@jamesaphoenix/tx-core 0.4.5 → 0.5.1
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/README.md +154 -299
- package/dist/db.d.ts +4 -9
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +6 -80
- package/dist/db.js.map +1 -1
- package/dist/errors.d.ts +67 -10
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +44 -10
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +12 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -29
- package/dist/index.js.map +1 -1
- package/dist/layer.d.ts +32 -10
- package/dist/layer.d.ts.map +1 -1
- package/dist/layer.js +126 -47
- package/dist/layer.js.map +1 -1
- package/dist/mappers/anchor.d.ts +28 -0
- package/dist/mappers/anchor.d.ts.map +1 -0
- package/dist/mappers/anchor.js +105 -0
- package/dist/mappers/anchor.js.map +1 -0
- package/dist/mappers/candidate.d.ts +25 -0
- package/dist/mappers/candidate.d.ts.map +1 -0
- package/dist/mappers/candidate.js +83 -0
- package/dist/mappers/candidate.js.map +1 -0
- package/dist/mappers/doc.d.ts +2 -4
- package/dist/mappers/doc.d.ts.map +1 -1
- package/dist/mappers/doc.js +7 -4
- package/dist/mappers/doc.js.map +1 -1
- package/dist/mappers/edge.d.ts +19 -0
- package/dist/mappers/edge.d.ts.map +1 -0
- package/dist/mappers/edge.js +81 -0
- package/dist/mappers/edge.js.map +1 -0
- package/dist/mappers/index.d.ts +7 -3
- package/dist/mappers/index.d.ts.map +1 -1
- package/dist/mappers/index.js +14 -6
- package/dist/mappers/index.js.map +1 -1
- package/dist/mappers/message.d.ts +15 -0
- package/dist/mappers/message.d.ts.map +1 -0
- package/dist/mappers/message.js +58 -0
- package/dist/mappers/message.js.map +1 -0
- package/dist/repo/anchor-repo.d.ts +52 -0
- package/dist/repo/anchor-repo.d.ts.map +1 -0
- package/dist/repo/anchor-repo.js +245 -0
- package/dist/repo/anchor-repo.js.map +1 -0
- package/dist/repo/candidate-repo.d.ts +16 -0
- package/dist/repo/candidate-repo.d.ts.map +1 -0
- package/dist/repo/candidate-repo.js +164 -0
- package/dist/repo/candidate-repo.js.map +1 -0
- package/dist/repo/compaction-repo.d.ts +41 -0
- package/dist/repo/compaction-repo.d.ts.map +1 -0
- package/dist/repo/compaction-repo.js +84 -0
- package/dist/repo/compaction-repo.js.map +1 -0
- package/dist/repo/doc-repo.d.ts +68 -51
- package/dist/repo/doc-repo.d.ts.map +1 -1
- package/dist/repo/doc-repo.js +120 -54
- package/dist/repo/doc-repo.js.map +1 -1
- package/dist/repo/edge-repo.d.ts +26 -0
- package/dist/repo/edge-repo.d.ts.map +1 -0
- package/dist/repo/edge-repo.js +258 -0
- package/dist/repo/edge-repo.js.map +1 -0
- package/dist/repo/index.d.ts +8 -3
- package/dist/repo/index.d.ts.map +1 -1
- package/dist/repo/index.js +7 -2
- package/dist/repo/index.js.map +1 -1
- package/dist/repo/message-repo.d.ts +55 -0
- package/dist/repo/message-repo.d.ts.map +1 -0
- package/dist/repo/message-repo.js +132 -0
- package/dist/repo/message-repo.js.map +1 -0
- package/dist/services/agent-service.d.ts +18 -23
- package/dist/services/agent-service.d.ts.map +1 -1
- package/dist/services/agent-service.js +9 -0
- package/dist/services/agent-service.js.map +1 -1
- package/dist/services/anchor-service.d.ts +147 -0
- package/dist/services/anchor-service.d.ts.map +1 -0
- package/dist/services/anchor-service.js +540 -0
- package/dist/services/anchor-service.js.map +1 -0
- package/dist/services/anchor-verification.d.ts +102 -0
- package/dist/services/anchor-verification.d.ts.map +1 -0
- package/dist/services/anchor-verification.js +817 -0
- package/dist/services/anchor-verification.js.map +1 -0
- package/dist/services/ast-grep-service.d.ts +58 -0
- package/dist/services/ast-grep-service.d.ts.map +1 -0
- package/dist/services/ast-grep-service.js +427 -0
- package/dist/services/ast-grep-service.js.map +1 -0
- package/dist/services/attempt-service.d.ts.map +1 -1
- package/dist/services/attempt-service.js +4 -1
- package/dist/services/attempt-service.js.map +1 -1
- package/dist/services/auto-sync-service.d.ts.map +1 -1
- package/dist/services/auto-sync-service.js +7 -7
- package/dist/services/auto-sync-service.js.map +1 -1
- package/dist/services/candidate-extractor-service.d.ts +44 -0
- package/dist/services/candidate-extractor-service.d.ts.map +1 -0
- package/dist/services/candidate-extractor-service.js +175 -0
- package/dist/services/candidate-extractor-service.js.map +1 -0
- package/dist/services/claim-service.d.ts.map +1 -1
- package/dist/services/claim-service.js +0 -8
- package/dist/services/claim-service.js.map +1 -1
- package/dist/services/compaction-service.d.ts +105 -0
- package/dist/services/compaction-service.d.ts.map +1 -0
- package/dist/services/compaction-service.js +281 -0
- package/dist/services/compaction-service.js.map +1 -0
- package/dist/services/cycle-scan-service.d.ts +1 -5
- package/dist/services/cycle-scan-service.d.ts.map +1 -1
- package/dist/services/cycle-scan-service.js +49 -19
- package/dist/services/cycle-scan-service.js.map +1 -1
- package/dist/services/daemon-service.d.ts +2 -8
- package/dist/services/daemon-service.d.ts.map +1 -1
- package/dist/services/daemon-service.js +21 -35
- package/dist/services/daemon-service.js.map +1 -1
- package/dist/services/doc-service.d.ts +25 -32
- package/dist/services/doc-service.d.ts.map +1 -1
- package/dist/services/doc-service.js +206 -190
- package/dist/services/doc-service.js.map +1 -1
- package/dist/services/edge-service.d.ts +78 -0
- package/dist/services/edge-service.d.ts.map +1 -0
- package/dist/services/edge-service.js +158 -0
- package/dist/services/edge-service.js.map +1 -0
- package/dist/services/embedding-service.d.ts +3 -3
- package/dist/services/embedding-service.d.ts.map +1 -1
- package/dist/services/embedding-service.js +8 -14
- package/dist/services/embedding-service.js.map +1 -1
- package/dist/services/feedback-tracker.d.ts +64 -0
- package/dist/services/feedback-tracker.d.ts.map +1 -0
- package/dist/services/feedback-tracker.js +110 -0
- package/dist/services/feedback-tracker.js.map +1 -0
- package/dist/services/file-watcher-service.d.ts.map +1 -1
- package/dist/services/file-watcher-service.js +1 -3
- package/dist/services/file-watcher-service.js.map +1 -1
- package/dist/services/graph-expansion.d.ts +158 -0
- package/dist/services/graph-expansion.d.ts.map +1 -0
- package/dist/services/graph-expansion.js +487 -0
- package/dist/services/graph-expansion.js.map +1 -0
- package/dist/services/index.d.ts +19 -8
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +18 -7
- package/dist/services/index.js.map +1 -1
- package/dist/services/learning-service.d.ts.map +1 -1
- package/dist/services/learning-service.js +22 -14
- package/dist/services/learning-service.js.map +1 -1
- package/dist/services/llm-service.d.ts +60 -38
- package/dist/services/llm-service.d.ts.map +1 -1
- package/dist/services/llm-service.js +201 -113
- package/dist/services/llm-service.js.map +1 -1
- package/dist/services/message-service.d.ts +57 -0
- package/dist/services/message-service.d.ts.map +1 -0
- package/dist/services/message-service.js +78 -0
- package/dist/services/message-service.js.map +1 -0
- package/dist/services/orchestrator-service.d.ts.map +1 -1
- package/dist/services/orchestrator-service.js +19 -20
- package/dist/services/orchestrator-service.js.map +1 -1
- package/dist/services/promotion-service.d.ts +67 -0
- package/dist/services/promotion-service.d.ts.map +1 -0
- package/dist/services/promotion-service.js +151 -0
- package/dist/services/promotion-service.js.map +1 -0
- package/dist/services/query-expansion-service.d.ts +7 -22
- package/dist/services/query-expansion-service.d.ts.map +1 -1
- package/dist/services/query-expansion-service.js +41 -75
- package/dist/services/query-expansion-service.js.map +1 -1
- package/dist/services/reranker-service.d.ts +1 -1
- package/dist/services/reranker-service.d.ts.map +1 -1
- package/dist/services/reranker-service.js +8 -10
- package/dist/services/reranker-service.js.map +1 -1
- package/dist/services/retriever-service.d.ts +8 -5
- package/dist/services/retriever-service.d.ts.map +1 -1
- package/dist/services/retriever-service.js +150 -15
- package/dist/services/retriever-service.js.map +1 -1
- package/dist/services/swarm-verification.d.ts +104 -0
- package/dist/services/swarm-verification.d.ts.map +1 -0
- package/dist/services/swarm-verification.js +406 -0
- package/dist/services/swarm-verification.js.map +1 -0
- package/dist/services/sync-service.d.ts.map +1 -1
- package/dist/services/sync-service.js +8 -9
- package/dist/services/sync-service.js.map +1 -1
- package/dist/services/task-service.d.ts.map +1 -1
- package/dist/services/task-service.js +3 -8
- package/dist/services/task-service.js.map +1 -1
- package/dist/services/tracing-service.js +6 -6
- package/dist/services/tracing-service.js.map +1 -1
- package/dist/services/transcript-adapter.d.ts.map +1 -1
- package/dist/services/transcript-adapter.js +1 -1
- package/dist/services/transcript-adapter.js.map +1 -1
- package/dist/services/worker-process.d.ts.map +1 -1
- package/dist/services/worker-process.js +8 -30
- package/dist/services/worker-process.js.map +1 -1
- package/dist/utils/doc-hash.d.ts +0 -4
- package/dist/utils/doc-hash.d.ts.map +1 -1
- package/dist/utils/doc-hash.js.map +1 -1
- package/dist/utils/doc-renderer.d.ts +31 -26
- package/dist/utils/doc-renderer.d.ts.map +1 -1
- package/dist/utils/doc-renderer.js +0 -7
- package/dist/utils/doc-renderer.js.map +1 -1
- package/dist/utils/llm-json.d.ts +17 -0
- package/dist/utils/llm-json.d.ts.map +1 -0
- package/dist/utils/llm-json.js +51 -0
- package/dist/utils/llm-json.js.map +1 -0
- package/dist/utils/toml-config.d.ts +10 -16
- package/dist/utils/toml-config.d.ts.map +1 -1
- package/dist/utils/toml-config.js +3 -1
- package/dist/utils/toml-config.js.map +1 -1
- package/dist/worker/run-worker.d.ts.map +1 -1
- package/dist/worker/run-worker.js +2 -7
- package/dist/worker/run-worker.js.map +1 -1
- package/package.json +9 -8
package/dist/index.js
CHANGED
|
@@ -9,11 +9,7 @@
|
|
|
9
9
|
// =============================================================================
|
|
10
10
|
// Errors
|
|
11
11
|
// =============================================================================
|
|
12
|
-
export { TaskNotFoundError, LearningNotFoundError, FileLearningNotFoundError, AttemptNotFoundError, RunNotFoundError, ValidationError, CircularDependencyError, DatabaseError, DependencyNotFoundError, EmbeddingUnavailableError, EmbeddingDimensionMismatchError, RerankerUnavailableError, RetrievalError,
|
|
13
|
-
// LLM service errors (DD-022)
|
|
14
|
-
LlmUnavailableError,
|
|
15
|
-
// Daemon / file-watcher errors
|
|
16
|
-
DaemonError, FileWatcherError, WatcherAlreadyRunningError, WatcherNotRunningError,
|
|
12
|
+
export { TaskNotFoundError, LearningNotFoundError, FileLearningNotFoundError, AttemptNotFoundError, RunNotFoundError, ValidationError, CircularDependencyError, DatabaseError, DependencyNotFoundError, EmbeddingUnavailableError, EmbeddingDimensionMismatchError, EdgeNotFoundError, AnchorNotFoundError, CandidateNotFoundError, ExtractionUnavailableError, RerankerUnavailableError, RetrievalError, AstGrepError, DaemonError,
|
|
17
13
|
// Orchestration errors (PRD-018)
|
|
18
14
|
RegistrationError, WorkerNotFoundError, AlreadyClaimedError, ClaimNotFoundError, ClaimIdNotFoundError, LeaseExpiredError, MaxRenewalsExceededError, OrchestratorError,
|
|
19
15
|
// Batch processing errors
|
|
@@ -24,10 +20,14 @@ StaleDataError,
|
|
|
24
20
|
HasChildrenError,
|
|
25
21
|
// Data validation errors
|
|
26
22
|
InvalidStatusError, InvalidDateError,
|
|
27
|
-
//
|
|
23
|
+
// Message errors (PRD-024 agent outbox)
|
|
24
|
+
MessageNotFoundError, MessageAlreadyAckedError,
|
|
25
|
+
// Doc errors (DD-023 docs-as-primitives)
|
|
28
26
|
DocNotFoundError, DocLockedError, InvalidDocYamlError, InvariantNotFoundError,
|
|
29
|
-
// Cycle scan
|
|
30
|
-
AgentError, CycleScanError
|
|
27
|
+
// Agent/Cycle errors (PRD-023 cycle scan)
|
|
28
|
+
AgentError, CycleScanError,
|
|
29
|
+
// LLM errors
|
|
30
|
+
LlmUnavailableError } from "./errors.js";
|
|
31
31
|
// =============================================================================
|
|
32
32
|
// Database
|
|
33
33
|
// =============================================================================
|
|
@@ -39,35 +39,21 @@ export { generateTaskId, fixtureId } from "./id.js";
|
|
|
39
39
|
// =============================================================================
|
|
40
40
|
// Layers
|
|
41
41
|
// =============================================================================
|
|
42
|
-
export { makeAppLayer, makeAppLayerFromInfra, makeMinimalLayer,
|
|
42
|
+
export { makeAppLayer, makeAppLayerFromInfra, makeMinimalLayer, makeMinimalLayerFromInfra,
|
|
43
43
|
// Re-exports for convenience
|
|
44
|
-
SyncService, MigrationService, AutoSyncService, AutoSyncServiceNoop, AutoSyncServiceLive, LearningService, FileLearningService, EmbeddingService, EmbeddingServiceNoop, EmbeddingServiceLive, EmbeddingServiceOpenAI, EmbeddingServiceAuto, createEmbedderLayer, AttemptService, TaskService, DependencyService, ReadyService, isReadyResult, HierarchyService, ScoreService, DiversifierService, DiversifierServiceNoop, DiversifierServiceLive, DiversifierServiceAuto,
|
|
44
|
+
SyncService, MigrationService, AutoSyncService, AutoSyncServiceNoop, AutoSyncServiceLive, LearningService, FileLearningService, EmbeddingService, EmbeddingServiceNoop, EmbeddingServiceLive, EmbeddingServiceOpenAI, EmbeddingServiceAuto, createEmbedderLayer, AttemptService, TaskService, DependencyService, ReadyService, isReadyResult, HierarchyService, ScoreService, DeduplicationService, DeduplicationServiceLive, DiversifierService, DiversifierServiceNoop, DiversifierServiceLive, DiversifierServiceAuto, CompactionService, CompactionServiceLive, CompactionServiceNoop, CompactionServiceAuto, MessageService, MessageServiceLive } from "./layer.js";
|
|
45
45
|
// =============================================================================
|
|
46
46
|
// Services (full exports)
|
|
47
47
|
// =============================================================================
|
|
48
|
-
export { TaskServiceLive, DependencyServiceLive, ReadyServiceLive, HierarchyServiceLive, ScoreServiceLive, LearningServiceLive, FileLearningServiceLive, AttemptServiceLive, SyncServiceLive, MigrationServiceLive, RerankerService, RerankerServiceNoop, RerankerServiceLive, RerankerServiceAuto, RetrieverService, RetrieverServiceNoop, RetrieverServiceLive, RetrieverServiceAuto, WorkerService, WorkerServiceLive, ClaimService, ClaimServiceLive, OrchestratorService, OrchestratorServiceLive, runWorkerProcess,
|
|
48
|
+
export { TaskServiceLive, DependencyServiceLive, ReadyServiceLive, HierarchyServiceLive, ScoreServiceLive, LearningServiceLive, FileLearningServiceLive, AttemptServiceLive, SyncServiceLive, MigrationServiceLive, AnchorService, AnchorServiceLive, EdgeService, EdgeServiceLive, CandidateExtractorService, CandidateExtractorServiceNoop, CandidateExtractorServiceLive, CandidateExtractorServiceAuto, LlmService, LlmServiceNoop, LlmServiceAgentSdk, LlmServiceAnthropic, LlmServiceAuto, QueryExpansionService, QueryExpansionServiceNoop, QueryExpansionServiceLive, QueryExpansionServiceAuto, MAX_EXPANSION_QUERIES, MAX_QUERY_LENGTH, validateExpansions, RerankerService, RerankerServiceNoop, RerankerServiceLive, RerankerServiceAuto, RetrieverService, RetrieverServiceNoop, RetrieverServiceLive, RetrieverServiceAuto, GraphExpansionService, GraphExpansionServiceLive, AnchorVerificationService, AnchorVerificationServiceLive, SwarmVerificationService, SwarmVerificationServiceLive, calculateMajorityVote, AstGrepService, AstGrepServiceLive, AstGrepServiceNoop, AstGrepServiceAuto, EXT_TO_LANGUAGE, DEFAULT_SYMBOL_PATTERNS, DaemonService, DaemonServiceLive, DaemonServiceNoop, PID_FILE_PATH, LAUNCHD_PLIST_PATH, SYSTEMD_SERVICE_PATH, writePid, readPid, removePid, removePidIfContentMatches, isProcessRunning, tryAtomicPidCreate, acquirePidLock, defaultDaemonConfig, generateLaunchdPlist, generateSystemdService, MIGRATIONS, getLatestVersion, PromotionService, FeedbackTrackerService, FeedbackTrackerServiceNoop, FeedbackTrackerServiceLive, WorkerService, WorkerServiceLive, ClaimService, ClaimServiceLive, OrchestratorService, OrchestratorServiceLive, runWorkerProcess, DocService, DocServiceLive, AgentService, AgentServiceLive, AgentServiceNoop, CycleScanService, CycleScanServiceLive,
|
|
49
49
|
// Runtime interface validators for optional peer dependencies
|
|
50
50
|
isValidLlama, isValidLlamaModel, isValidLlamaEmbeddingContext, isValidOpenAIClient,
|
|
51
51
|
// Dimension validation
|
|
52
|
-
validateEmbeddingDimensions
|
|
53
|
-
// LLM service (DD-022)
|
|
54
|
-
LlmService, LlmServiceNoop, LlmServiceClaudeAgentSdk, LlmServiceAnthropicSdk, LlmServiceAuto, LlmOptionsSchema,
|
|
55
|
-
// Query expansion
|
|
56
|
-
QueryExpansionService, QueryExpansionServiceNoop, QueryExpansionServiceLive, QueryExpansionServiceAuto, QueryExpansionUnavailableError, MAX_EXPANSION_QUERIES, MAX_QUERY_LENGTH, validateExpansions,
|
|
57
|
-
// Daemon / file-watcher / deduplication
|
|
58
|
-
DeduplicationService, DeduplicationServiceLive, DaemonService, DaemonServiceLive, DaemonServiceNoop, PID_FILE_PATH, getPidFilePath, LAUNCHD_PLIST_PATH, writePid, readPid, removePid, removePidIfContentMatches, isProcessRunning, tryAtomicPidCreate, acquirePidLock, defaultDaemonConfig, generateLaunchdPlist, generateSystemdService, FileWatcherService, FileWatcherServiceLive, FileWatcherServiceNoop,
|
|
59
|
-
// Transcript adapter
|
|
60
|
-
ClaudeCodeAdapter, GenericJSONLAdapter, getAdapter, registerAdapter,
|
|
61
|
-
// Doc service (DD-023)
|
|
62
|
-
DocServiceLive,
|
|
63
|
-
// Agent service (cycle scan)
|
|
64
|
-
AgentService, AgentServiceLive, AgentServiceNoop,
|
|
65
|
-
// Cycle scan service
|
|
66
|
-
CycleScanService, CycleScanServiceLive } from "./services/index.js";
|
|
52
|
+
validateEmbeddingDimensions } from "./services/index.js";
|
|
67
53
|
// =============================================================================
|
|
68
54
|
// Repositories
|
|
69
55
|
// =============================================================================
|
|
70
|
-
export { TaskRepository, TaskRepositoryLive, DependencyRepository, DependencyRepositoryLive, LearningRepository, LearningRepositoryLive, FileLearningRepository, FileLearningRepositoryLive, AttemptRepository, AttemptRepositoryLive, RunRepository, RunRepositoryLive, WorkerRepository, WorkerRepositoryLive, ClaimRepository, ClaimRepositoryLive, OrchestratorStateRepository, OrchestratorStateRepositoryLive,
|
|
56
|
+
export { TaskRepository, TaskRepositoryLive, DependencyRepository, DependencyRepositoryLive, LearningRepository, LearningRepositoryLive, FileLearningRepository, FileLearningRepositoryLive, AttemptRepository, AttemptRepositoryLive, RunRepository, RunRepositoryLive, AnchorRepository, AnchorRepositoryLive, EdgeRepository, EdgeRepositoryLive, DeduplicationRepository, DeduplicationRepositoryLive, CandidateRepository, CandidateRepositoryLive, TrackedProjectRepository, TrackedProjectRepositoryLive, WorkerRepository, WorkerRepositoryLive, ClaimRepository, ClaimRepositoryLive, OrchestratorStateRepository, OrchestratorStateRepositoryLive, CompactionRepository, CompactionRepositoryLive, MessageRepository, MessageRepositoryLive, DocRepository, DocRepositoryLive } from "./repo/index.js";
|
|
71
57
|
// =============================================================================
|
|
72
58
|
// Schemas
|
|
73
59
|
// =============================================================================
|
|
@@ -79,13 +65,17 @@ export { rowToTask, rowToDependency, isValidStatus, isValidTransition, VALID_TRA
|
|
|
79
65
|
export { rowToLearning, float32ArrayToBuffer } from "./mappers/learning.js";
|
|
80
66
|
export { rowToFileLearning, matchesPattern } from "./mappers/file-learning.js";
|
|
81
67
|
export { rowToAttempt } from "./mappers/attempt.js";
|
|
68
|
+
export { rowToAnchor, rowToInvalidationLog } from "./mappers/anchor.js";
|
|
69
|
+
export { rowToEdge } from "./mappers/edge.js";
|
|
70
|
+
export { normalizeContent, hashContent, rowToProcessedHash, serializeProcessedHash, rowToFileProgress, serializeFileProgress } from "./mappers/deduplication.js";
|
|
82
71
|
export { rowToWorker, isValidWorkerStatus, WORKER_STATUSES } from "./mappers/worker.js";
|
|
83
|
-
export {
|
|
84
|
-
export { rowToDoc, rowToDocLink, rowToTaskDocLink, rowToInvariant, rowToInvariantCheck, isValidDocKind, isValidDocStatus } from "./mappers/doc.js";
|
|
72
|
+
export { rowToMessage, isValidMessageStatus } from "./mappers/message.js";
|
|
73
|
+
export { rowToDoc, rowToDocLink, rowToTaskDocLink, rowToInvariant, rowToInvariantCheck, isValidDocKind, isValidDocStatus, isValidDocLinkType, isValidTaskDocLinkType, isValidInvariantEnforcement, isValidInvariantStatus, } from "./mappers/doc.js";
|
|
85
74
|
// =============================================================================
|
|
86
75
|
// Utils
|
|
87
76
|
// =============================================================================
|
|
88
77
|
export { cosineSimilarity } from "./utils/math.js";
|
|
78
|
+
export { parseLlmJson } from "./utils/llm-json.js";
|
|
89
79
|
export { matchesGlob } from "./utils/glob.js";
|
|
90
80
|
export { escapeLikePattern, DEFAULT_QUERY_LIMIT } from "./utils/sql.js";
|
|
91
81
|
export { computeDocHash } from "./utils/doc-hash.js";
|
|
@@ -96,6 +86,10 @@ export { readTxConfig } from "./utils/toml-config.js";
|
|
|
96
86
|
// =============================================================================
|
|
97
87
|
export { runWorker } from "./worker/index.js";
|
|
98
88
|
// =============================================================================
|
|
89
|
+
// Transcript Adapters (PRD-019 Execution Tracing)
|
|
90
|
+
// =============================================================================
|
|
91
|
+
export { ClaudeCodeAdapter, GenericJSONLAdapter, getAdapter, registerAdapter } from "./services/transcript-adapter.js";
|
|
92
|
+
// =============================================================================
|
|
99
93
|
// Tracing Service (PRD-019 Execution Tracing)
|
|
100
94
|
// =============================================================================
|
|
101
95
|
export { TracingService, TracingServiceLive, TracingServiceNoop } from "./services/tracing-service.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,gFAAgF;AAChF,SAAS;AACT,gFAAgF;AAChF,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,uBAAuB,EACvB,aAAa,EACb,uBAAuB,EACvB,yBAAyB,EACzB,+BAA+B,EAC/B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,gFAAgF;AAChF,SAAS;AACT,gFAAgF;AAChF,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,uBAAuB,EACvB,aAAa,EACb,uBAAuB,EACvB,yBAAyB,EACzB,+BAA+B,EAC/B,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,0BAA0B,EAC1B,wBAAwB,EACxB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L,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAEnB,MAAM,+BAA+B,CAAA;AAEtC,gFAAgF;AAChF,qBAAqB;AACrB,gFAAgF;AAChF,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EAMtB,MAAM,kCAAkC,CAAA;AAEzC,gFAAgF;AAChF,gCAAgC;AAChC,gFAAgF;AAChF,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EAGvB,MAAM,8BAA8B,CAAA"}
|
package/dist/layer.d.ts
CHANGED
|
@@ -12,22 +12,34 @@ export { AutoSyncService, AutoSyncServiceNoop, AutoSyncServiceLive } from "./ser
|
|
|
12
12
|
export { LearningService } from "./services/learning-service.js";
|
|
13
13
|
export { FileLearningService } from "./services/file-learning-service.js";
|
|
14
14
|
export { EmbeddingService, EmbeddingServiceNoop, EmbeddingServiceLive, EmbeddingServiceOpenAI, EmbeddingServiceAuto, createEmbedderLayer, type EmbedderConfig } from "./services/embedding-service.js";
|
|
15
|
+
export { QueryExpansionService, QueryExpansionServiceNoop, QueryExpansionServiceLive, QueryExpansionServiceAuto, QueryExpansionUnavailableError, type QueryExpansionResult } from "./services/query-expansion-service.js";
|
|
15
16
|
export { AttemptService } from "./services/attempt-service.js";
|
|
16
17
|
export { TaskService } from "./services/task-service.js";
|
|
17
18
|
export { DependencyService } from "./services/dep-service.js";
|
|
18
19
|
export { ReadyService, type ReadyCheckResult, isReadyResult } from "./services/ready-service.js";
|
|
19
20
|
export { HierarchyService } from "./services/hierarchy-service.js";
|
|
20
21
|
export { ScoreService } from "./services/score-service.js";
|
|
22
|
+
export { RunRepository } from "./repo/run-repo.js";
|
|
21
23
|
export { RerankerService, RerankerServiceNoop, RerankerServiceLive, RerankerServiceAuto, type RerankerResult } from "./services/reranker-service.js";
|
|
24
|
+
export { DeduplicationService, DeduplicationServiceLive } from "./services/deduplication-service.js";
|
|
25
|
+
export { MessageService, MessageServiceLive } from "./services/message-service.js";
|
|
26
|
+
export { AgentService, AgentServiceLive, AgentServiceNoop } from "./services/agent-service.js";
|
|
27
|
+
export { CycleScanService, CycleScanServiceLive } from "./services/cycle-scan-service.js";
|
|
28
|
+
export { DocService, DocServiceLive } from "./services/doc-service.js";
|
|
22
29
|
export { RetrieverService, RetrieverServiceNoop, RetrieverServiceLive, RetrieverServiceAuto } from "./services/retriever-service.js";
|
|
30
|
+
export { GraphExpansionService, GraphExpansionServiceNoop, GraphExpansionServiceLive, type SeedLearning, type ExpandedLearning, type GraphExpansionOptions, type GraphExpansionResult } from "./services/graph-expansion.js";
|
|
31
|
+
export { AnchorVerificationService, AnchorVerificationServiceLive, type VerificationResult, type VerificationSummary, type VerifyOptions } from "./services/anchor-verification.js";
|
|
32
|
+
export { SwarmVerificationService, SwarmVerificationServiceLive, calculateMajorityVote, type VerificationBatch, type BatchResult, type SwarmMetrics, type SwarmVerificationResult, type SwarmVerifyOptions, type VoteResult } from "./services/swarm-verification.js";
|
|
33
|
+
export { PromotionService, PromotionServiceLive, type PromotionResult, type AutoPromoteResult } from "./services/promotion-service.js";
|
|
34
|
+
export { FeedbackTrackerService, FeedbackTrackerServiceNoop, FeedbackTrackerServiceLive, type LearningUsageFeedback } from "./services/feedback-tracker.js";
|
|
23
35
|
export { DiversifierService, DiversifierServiceNoop, DiversifierServiceLive, DiversifierServiceAuto } from "./services/diversifier-service.js";
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
29
|
-
export {
|
|
30
|
-
export {
|
|
36
|
+
export { CandidateRepository, CandidateRepositoryLive } from "./repo/candidate-repo.js";
|
|
37
|
+
export { TrackedProjectRepository, TrackedProjectRepositoryLive } from "./repo/tracked-project-repo.js";
|
|
38
|
+
export { DaemonService, DaemonServiceLive, DaemonServiceNoop, type DaemonStatus } from "./services/daemon-service.js";
|
|
39
|
+
export { TracingService, TracingServiceLive, TracingServiceNoop, type SpanOptions } from "./services/tracing-service.js";
|
|
40
|
+
export { CompactionService, CompactionServiceLive, CompactionServiceNoop, CompactionServiceAuto, type CompactionOutputMode, type CompactionResult, type CompactionOptions, type CompactionPreview } from "./services/compaction-service.js";
|
|
41
|
+
export { ValidationService, ValidationServiceLive, type ValidationSeverity, type ValidationIssue, type CheckResult, type ValidationResult, type ValidateOptions } from "./services/validation-service.js";
|
|
42
|
+
export { LlmService, LlmServiceNoop, LlmServiceAgentSdk, LlmServiceAnthropic, LlmServiceAuto, type LlmCompletionRequest, type LlmCompletionResult } from "./services/llm-service.js";
|
|
31
43
|
/**
|
|
32
44
|
* Create the full application layer from an existing SqliteClient infra layer.
|
|
33
45
|
*
|
|
@@ -38,7 +50,7 @@ export { CycleScanService } from "./services/cycle-scan-service.js";
|
|
|
38
50
|
*
|
|
39
51
|
* @param infra A layer providing SqliteClient
|
|
40
52
|
*/
|
|
41
|
-
export declare const makeAppLayerFromInfra: <E>(infra: Layer.Layer<SqliteClient, E>) => Layer.Layer<import("./services/migration-service.js").MigrationService | SqliteClient | import("./repo/task-repo.js").TaskRepository | import("./repo/dep-repo.js").DependencyRepository | import("./repo/learning-repo.js").LearningRepository | import("./repo/file-learning-repo.js").FileLearningRepository | import("./repo/attempt-repo.js").AttemptRepository | import("./repo/run-repo.js").RunRepository | import("./repo/
|
|
53
|
+
export declare const makeAppLayerFromInfra: <E>(infra: Layer.Layer<SqliteClient, E>) => Layer.Layer<import("./services/migration-service.js").MigrationService | SqliteClient | import("./repo/task-repo.js").TaskRepository | import("./repo/dep-repo.js").DependencyRepository | import("./repo/learning-repo.js").LearningRepository | import("./repo/file-learning-repo.js").FileLearningRepository | import("./repo/attempt-repo.js").AttemptRepository | import("./repo/run-repo.js").RunRepository | import("./repo/anchor-repo.js").AnchorRepository | import("./repo/edge-repo.js").EdgeRepository | import("./repo/deduplication-repo.js").DeduplicationRepository | import("./repo/candidate-repo.js").CandidateRepository | import("./repo/tracked-project-repo.js").TrackedProjectRepository | import("./repo/worker-repo.js").WorkerRepository | import("./repo/claim-repo.js").ClaimRepository | import("./repo/orchestrator-state-repo.js").OrchestratorStateRepository | import("./services/task-service.js").TaskService | import("./services/dep-service.js").DependencyService | import("./services/ready-service.js").ReadyService | import("./services/hierarchy-service.js").HierarchyService | import("./services/edge-service.js").EdgeService | import("./services/graph-expansion.js").GraphExpansionService | import("./services/feedback-tracker.js").FeedbackTrackerService | import("./services/diversifier-service.js").DiversifierService | import("./services/retriever-service.js").RetrieverService | import("./services/learning-service.js").LearningService | import("./services/file-learning-service.js").FileLearningService | import("./services/attempt-service.js").AttemptService | import("./services/anchor-verification.js").AnchorVerificationService | import("./services/anchor-service.js").AnchorService | import("./services/deduplication-service.js").DeduplicationService | import("./services/sync-service.js").SyncService | import("./services/swarm-verification.js").SwarmVerificationService | import("./services/promotion-service.js").PromotionService | import("./services/worker-service.js").WorkerService | import("./services/claim-service.js").ClaimService | import("./services/orchestrator-service.js").OrchestratorService | import("./services/daemon-service.js").DaemonService | import("./services/tracing-service.js").TracingService | import("./repo/compaction-repo.js").CompactionRepository | import("./services/compaction-service.js").CompactionService | import("./services/validation-service.js").ValidationService | import("./repo/message-repo.js").MessageRepository | import("./services/message-service.js").MessageService | import("./repo/doc-repo.js").DocRepository | import("./services/doc-service.js").DocService, import("./errors.js").DatabaseError | import("./errors.js").EmbeddingUnavailableError | import("./errors.js").LlmUnavailableError | E, never>;
|
|
42
54
|
/**
|
|
43
55
|
* Create the full application layer with all services.
|
|
44
56
|
*
|
|
@@ -48,12 +60,22 @@ export declare const makeAppLayerFromInfra: <E>(infra: Layer.Layer<SqliteClient,
|
|
|
48
60
|
*
|
|
49
61
|
* @param dbPath Path to SQLite database file
|
|
50
62
|
*/
|
|
51
|
-
export declare const makeAppLayer: (dbPath: string) => Layer.Layer<import("./services/migration-service.js").MigrationService | SqliteClient | import("./repo/task-repo.js").TaskRepository | import("./repo/dep-repo.js").DependencyRepository | import("./repo/learning-repo.js").LearningRepository | import("./repo/file-learning-repo.js").FileLearningRepository | import("./repo/attempt-repo.js").AttemptRepository | import("./repo/run-repo.js").RunRepository | import("./repo/
|
|
63
|
+
export declare const makeAppLayer: (dbPath: string) => Layer.Layer<import("./services/migration-service.js").MigrationService | SqliteClient | import("./repo/task-repo.js").TaskRepository | import("./repo/dep-repo.js").DependencyRepository | import("./repo/learning-repo.js").LearningRepository | import("./repo/file-learning-repo.js").FileLearningRepository | import("./repo/attempt-repo.js").AttemptRepository | import("./repo/run-repo.js").RunRepository | import("./repo/anchor-repo.js").AnchorRepository | import("./repo/edge-repo.js").EdgeRepository | import("./repo/deduplication-repo.js").DeduplicationRepository | import("./repo/candidate-repo.js").CandidateRepository | import("./repo/tracked-project-repo.js").TrackedProjectRepository | import("./repo/worker-repo.js").WorkerRepository | import("./repo/claim-repo.js").ClaimRepository | import("./repo/orchestrator-state-repo.js").OrchestratorStateRepository | import("./services/task-service.js").TaskService | import("./services/dep-service.js").DependencyService | import("./services/ready-service.js").ReadyService | import("./services/hierarchy-service.js").HierarchyService | import("./services/edge-service.js").EdgeService | import("./services/graph-expansion.js").GraphExpansionService | import("./services/feedback-tracker.js").FeedbackTrackerService | import("./services/diversifier-service.js").DiversifierService | import("./services/retriever-service.js").RetrieverService | import("./services/learning-service.js").LearningService | import("./services/file-learning-service.js").FileLearningService | import("./services/attempt-service.js").AttemptService | import("./services/anchor-verification.js").AnchorVerificationService | import("./services/anchor-service.js").AnchorService | import("./services/deduplication-service.js").DeduplicationService | import("./services/sync-service.js").SyncService | import("./services/swarm-verification.js").SwarmVerificationService | import("./services/promotion-service.js").PromotionService | import("./services/worker-service.js").WorkerService | import("./services/claim-service.js").ClaimService | import("./services/orchestrator-service.js").OrchestratorService | import("./services/daemon-service.js").DaemonService | import("./services/tracing-service.js").TracingService | import("./repo/compaction-repo.js").CompactionRepository | import("./services/compaction-service.js").CompactionService | import("./services/validation-service.js").ValidationService | import("./repo/message-repo.js").MessageRepository | import("./services/message-service.js").MessageService | import("./repo/doc-repo.js").DocRepository | import("./services/doc-service.js").DocService, import("./errors.js").DatabaseError | import("./errors.js").EmbeddingUnavailableError | import("./errors.js").LlmUnavailableError, never>;
|
|
64
|
+
/**
|
|
65
|
+
* Create a minimal application layer from an existing SqliteClient infra layer.
|
|
66
|
+
*
|
|
67
|
+
* Uses Noop variants for LLM-dependent services (embedding, query expansion,
|
|
68
|
+
* reranker, compaction, auto-sync). Useful for tests and environments where
|
|
69
|
+
* external services (LLM APIs, node-llama-cpp) are not available.
|
|
70
|
+
*
|
|
71
|
+
* @param infra A layer providing SqliteClient
|
|
72
|
+
*/
|
|
73
|
+
export declare const makeMinimalLayerFromInfra: <E>(infra: Layer.Layer<SqliteClient, E>) => Layer.Layer<import("./services/migration-service.js").MigrationService | SqliteClient | import("./repo/task-repo.js").TaskRepository | import("./repo/dep-repo.js").DependencyRepository | import("./repo/learning-repo.js").LearningRepository | import("./repo/file-learning-repo.js").FileLearningRepository | import("./repo/attempt-repo.js").AttemptRepository | import("./repo/run-repo.js").RunRepository | import("./repo/anchor-repo.js").AnchorRepository | import("./repo/edge-repo.js").EdgeRepository | import("./repo/deduplication-repo.js").DeduplicationRepository | import("./repo/candidate-repo.js").CandidateRepository | import("./repo/tracked-project-repo.js").TrackedProjectRepository | import("./repo/worker-repo.js").WorkerRepository | import("./repo/claim-repo.js").ClaimRepository | import("./repo/orchestrator-state-repo.js").OrchestratorStateRepository | import("./services/task-service.js").TaskService | import("./services/dep-service.js").DependencyService | import("./services/ready-service.js").ReadyService | import("./services/hierarchy-service.js").HierarchyService | import("./services/edge-service.js").EdgeService | import("./services/graph-expansion.js").GraphExpansionService | import("./services/feedback-tracker.js").FeedbackTrackerService | import("./services/diversifier-service.js").DiversifierService | import("./services/retriever-service.js").RetrieverService | import("./services/learning-service.js").LearningService | import("./services/file-learning-service.js").FileLearningService | import("./services/attempt-service.js").AttemptService | import("./services/anchor-verification.js").AnchorVerificationService | import("./services/anchor-service.js").AnchorService | import("./services/deduplication-service.js").DeduplicationService | import("./services/sync-service.js").SyncService | import("./services/swarm-verification.js").SwarmVerificationService | import("./services/promotion-service.js").PromotionService | import("./services/worker-service.js").WorkerService | import("./services/claim-service.js").ClaimService | import("./services/orchestrator-service.js").OrchestratorService | import("./services/daemon-service.js").DaemonService | import("./services/tracing-service.js").TracingService | import("./repo/compaction-repo.js").CompactionRepository | import("./services/compaction-service.js").CompactionService | import("./services/validation-service.js").ValidationService | import("./repo/message-repo.js").MessageRepository | import("./services/message-service.js").MessageService | import("./repo/doc-repo.js").DocRepository | import("./services/doc-service.js").DocService, import("./errors.js").DatabaseError | E, never>;
|
|
52
74
|
/**
|
|
53
75
|
* Create a minimal application layer without auto-sync.
|
|
54
76
|
* Useful for testing and simple CLI operations.
|
|
55
77
|
*
|
|
56
78
|
* @param dbPath Path to SQLite database file
|
|
57
79
|
*/
|
|
58
|
-
export declare const makeMinimalLayer: (dbPath: string) => Layer.Layer<import("./services/migration-service.js").MigrationService | import("./repo/task-repo.js").TaskRepository | import("./repo/dep-repo.js").DependencyRepository | import("./repo/learning-repo.js").LearningRepository | import("./repo/file-learning-repo.js").FileLearningRepository | import("./repo/attempt-repo.js").AttemptRepository | import("./repo/run-repo.js").RunRepository | import("./services/task-service.js").TaskService | import("./services/dep-service.js").DependencyService | import("./services/ready-service.js").ReadyService | import("./services/hierarchy-service.js").HierarchyService | import("./services/diversifier-service.js").DiversifierService | import("./services/retriever-service.js").RetrieverService | import("./services/learning-service.js").LearningService | import("./services/file-learning-service.js").FileLearningService | import("./services/attempt-service.js").AttemptService | import("./services/sync-service.js").SyncService | import("./services/tracing-service.js").TracingService | import("./services/validation-service.js").ValidationService | import("./services/
|
|
80
|
+
export declare const makeMinimalLayer: (dbPath: string) => Layer.Layer<import("./services/migration-service.js").MigrationService | SqliteClient | import("./repo/task-repo.js").TaskRepository | import("./repo/dep-repo.js").DependencyRepository | import("./repo/learning-repo.js").LearningRepository | import("./repo/file-learning-repo.js").FileLearningRepository | import("./repo/attempt-repo.js").AttemptRepository | import("./repo/run-repo.js").RunRepository | import("./repo/anchor-repo.js").AnchorRepository | import("./repo/edge-repo.js").EdgeRepository | import("./repo/deduplication-repo.js").DeduplicationRepository | import("./repo/candidate-repo.js").CandidateRepository | import("./repo/tracked-project-repo.js").TrackedProjectRepository | import("./repo/worker-repo.js").WorkerRepository | import("./repo/claim-repo.js").ClaimRepository | import("./repo/orchestrator-state-repo.js").OrchestratorStateRepository | import("./services/task-service.js").TaskService | import("./services/dep-service.js").DependencyService | import("./services/ready-service.js").ReadyService | import("./services/hierarchy-service.js").HierarchyService | import("./services/edge-service.js").EdgeService | import("./services/graph-expansion.js").GraphExpansionService | import("./services/feedback-tracker.js").FeedbackTrackerService | import("./services/diversifier-service.js").DiversifierService | import("./services/retriever-service.js").RetrieverService | import("./services/learning-service.js").LearningService | import("./services/file-learning-service.js").FileLearningService | import("./services/attempt-service.js").AttemptService | import("./services/anchor-verification.js").AnchorVerificationService | import("./services/anchor-service.js").AnchorService | import("./services/deduplication-service.js").DeduplicationService | import("./services/sync-service.js").SyncService | import("./services/swarm-verification.js").SwarmVerificationService | import("./services/promotion-service.js").PromotionService | import("./services/worker-service.js").WorkerService | import("./services/claim-service.js").ClaimService | import("./services/orchestrator-service.js").OrchestratorService | import("./services/daemon-service.js").DaemonService | import("./services/tracing-service.js").TracingService | import("./repo/compaction-repo.js").CompactionRepository | import("./services/compaction-service.js").CompactionService | import("./services/validation-service.js").ValidationService | import("./repo/message-repo.js").MessageRepository | import("./services/message-service.js").MessageService | import("./repo/doc-repo.js").DocRepository | import("./services/doc-service.js").DocService, import("./errors.js").DatabaseError, never>;
|
|
59
81
|
//# sourceMappingURL=layer.d.ts.map
|
package/dist/layer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layer.d.ts","sourceRoot":"","sources":["../src/layer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAC9B,OAAO,EAAE,KAAK,YAAY,EAAoB,MAAM,SAAS,CA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I,QAAQ,MAAM,unFAE9C,CAAA"}
|
package/dist/layer.js
CHANGED
|
@@ -12,13 +12,14 @@ import { LearningRepositoryLive } from "./repo/learning-repo.js";
|
|
|
12
12
|
import { FileLearningRepositoryLive } from "./repo/file-learning-repo.js";
|
|
13
13
|
import { AttemptRepositoryLive } from "./repo/attempt-repo.js";
|
|
14
14
|
import { RunRepositoryLive } from "./repo/run-repo.js";
|
|
15
|
+
import { AnchorRepositoryLive } from "./repo/anchor-repo.js";
|
|
16
|
+
import { EdgeRepositoryLive } from "./repo/edge-repo.js";
|
|
17
|
+
import { DeduplicationRepositoryLive } from "./repo/deduplication-repo.js";
|
|
18
|
+
import { CandidateRepositoryLive } from "./repo/candidate-repo.js";
|
|
19
|
+
import { TrackedProjectRepositoryLive } from "./repo/tracked-project-repo.js";
|
|
15
20
|
import { WorkerRepositoryLive } from "./repo/worker-repo.js";
|
|
16
21
|
import { ClaimRepositoryLive } from "./repo/claim-repo.js";
|
|
17
22
|
import { OrchestratorStateRepositoryLive } from "./repo/orchestrator-state-repo.js";
|
|
18
|
-
import { DeduplicationRepositoryLive } from "./repo/deduplication-repo.js";
|
|
19
|
-
import { DeduplicationServiceLive } from "./services/deduplication-service.js";
|
|
20
|
-
import { TrackedProjectRepositoryLive } from "./repo/tracked-project-repo.js";
|
|
21
|
-
import { DocRepositoryLive } from "./repo/doc-repo.js";
|
|
22
23
|
import { TaskServiceLive } from "./services/task-service.js";
|
|
23
24
|
import { DependencyServiceLive } from "./services/dep-service.js";
|
|
24
25
|
import { ReadyServiceLive } from "./services/ready-service.js";
|
|
@@ -26,22 +27,38 @@ import { HierarchyServiceLive } from "./services/hierarchy-service.js";
|
|
|
26
27
|
import { LearningServiceLive } from "./services/learning-service.js";
|
|
27
28
|
import { FileLearningServiceLive } from "./services/file-learning-service.js";
|
|
28
29
|
import { AttemptServiceLive } from "./services/attempt-service.js";
|
|
30
|
+
import { AnchorServiceLive } from "./services/anchor-service.js";
|
|
31
|
+
import { EdgeServiceLive } from "./services/edge-service.js";
|
|
32
|
+
import { DeduplicationServiceLive } from "./services/deduplication-service.js";
|
|
29
33
|
import { SyncServiceLive } from "./services/sync-service.js";
|
|
30
34
|
import { AutoSyncServiceLive, AutoSyncServiceNoop } from "./services/auto-sync-service.js";
|
|
31
35
|
import { MigrationServiceLive } from "./services/migration-service.js";
|
|
32
|
-
import { EmbeddingServiceNoop } from "./services/embedding-service.js";
|
|
33
|
-
import {
|
|
36
|
+
import { EmbeddingServiceNoop, EmbeddingServiceAuto } from "./services/embedding-service.js";
|
|
37
|
+
import { QueryExpansionServiceNoop, QueryExpansionServiceAuto } from "./services/query-expansion-service.js";
|
|
38
|
+
import { RerankerServiceNoop, RerankerServiceAuto } from "./services/reranker-service.js";
|
|
39
|
+
import { LlmServiceAuto } from "./services/llm-service.js";
|
|
34
40
|
import { RetrieverServiceLive } from "./services/retriever-service.js";
|
|
41
|
+
import { GraphExpansionServiceLive } from "./services/graph-expansion.js";
|
|
42
|
+
import { AnchorVerificationServiceLive } from "./services/anchor-verification.js";
|
|
43
|
+
import { SwarmVerificationServiceLive } from "./services/swarm-verification.js";
|
|
44
|
+
import { PromotionServiceLive } from "./services/promotion-service.js";
|
|
45
|
+
import { FeedbackTrackerServiceLive } from "./services/feedback-tracker.js";
|
|
35
46
|
import { DiversifierServiceLive } from "./services/diversifier-service.js";
|
|
36
47
|
import { WorkerServiceLive } from "./services/worker-service.js";
|
|
37
48
|
import { ClaimServiceLive } from "./services/claim-service.js";
|
|
38
49
|
import { OrchestratorServiceLive } from "./services/orchestrator-service.js";
|
|
50
|
+
import { DaemonServiceLive, DaemonServiceNoop } from "./services/daemon-service.js";
|
|
39
51
|
import { TracingServiceLive, TracingServiceNoop } from "./services/tracing-service.js";
|
|
52
|
+
import { CompactionRepositoryLive } from "./repo/compaction-repo.js";
|
|
53
|
+
import { CompactionServiceLive, CompactionServiceNoop } from "./services/compaction-service.js";
|
|
40
54
|
import { ValidationServiceLive } from "./services/validation-service.js";
|
|
41
|
-
import {
|
|
55
|
+
import { MessageRepositoryLive } from "./repo/message-repo.js";
|
|
56
|
+
import { MessageServiceLive } from "./services/message-service.js";
|
|
57
|
+
import { DocRepositoryLive } from "./repo/doc-repo.js";
|
|
42
58
|
import { DocServiceLive } from "./services/doc-service.js";
|
|
43
|
-
|
|
44
|
-
|
|
59
|
+
// AgentService + CycleScanService are NOT in the default layer.
|
|
60
|
+
// They are provided by the cycle CLI command via Effect.provide overlay.
|
|
61
|
+
// Re-exports below make them available from @jamesaphoenix/tx-core.
|
|
45
62
|
// Re-export services for cleaner imports
|
|
46
63
|
export { SyncService } from "./services/sync-service.js";
|
|
47
64
|
export { MigrationService } from "./services/migration-service.js";
|
|
@@ -49,22 +66,34 @@ export { AutoSyncService, AutoSyncServiceNoop, AutoSyncServiceLive } from "./ser
|
|
|
49
66
|
export { LearningService } from "./services/learning-service.js";
|
|
50
67
|
export { FileLearningService } from "./services/file-learning-service.js";
|
|
51
68
|
export { EmbeddingService, EmbeddingServiceNoop, EmbeddingServiceLive, EmbeddingServiceOpenAI, EmbeddingServiceAuto, createEmbedderLayer } from "./services/embedding-service.js";
|
|
69
|
+
export { QueryExpansionService, QueryExpansionServiceNoop, QueryExpansionServiceLive, QueryExpansionServiceAuto, QueryExpansionUnavailableError } from "./services/query-expansion-service.js";
|
|
52
70
|
export { AttemptService } from "./services/attempt-service.js";
|
|
53
71
|
export { TaskService } from "./services/task-service.js";
|
|
54
72
|
export { DependencyService } from "./services/dep-service.js";
|
|
55
73
|
export { ReadyService, isReadyResult } from "./services/ready-service.js";
|
|
56
74
|
export { HierarchyService } from "./services/hierarchy-service.js";
|
|
57
75
|
export { ScoreService } from "./services/score-service.js";
|
|
76
|
+
export { RunRepository } from "./repo/run-repo.js";
|
|
58
77
|
export { RerankerService, RerankerServiceNoop, RerankerServiceLive, RerankerServiceAuto } from "./services/reranker-service.js";
|
|
78
|
+
export { DeduplicationService, DeduplicationServiceLive } from "./services/deduplication-service.js";
|
|
79
|
+
export { MessageService, MessageServiceLive } from "./services/message-service.js";
|
|
80
|
+
export { AgentService, AgentServiceLive, AgentServiceNoop } from "./services/agent-service.js";
|
|
81
|
+
export { CycleScanService, CycleScanServiceLive } from "./services/cycle-scan-service.js";
|
|
82
|
+
export { DocService, DocServiceLive } from "./services/doc-service.js";
|
|
59
83
|
export { RetrieverService, RetrieverServiceNoop, RetrieverServiceLive, RetrieverServiceAuto } from "./services/retriever-service.js";
|
|
84
|
+
export { GraphExpansionService, GraphExpansionServiceNoop, GraphExpansionServiceLive } from "./services/graph-expansion.js";
|
|
85
|
+
export { AnchorVerificationService, AnchorVerificationServiceLive } from "./services/anchor-verification.js";
|
|
86
|
+
export { SwarmVerificationService, SwarmVerificationServiceLive, calculateMajorityVote } from "./services/swarm-verification.js";
|
|
87
|
+
export { PromotionService, PromotionServiceLive } from "./services/promotion-service.js";
|
|
88
|
+
export { FeedbackTrackerService, FeedbackTrackerServiceNoop, FeedbackTrackerServiceLive } from "./services/feedback-tracker.js";
|
|
60
89
|
export { DiversifierService, DiversifierServiceNoop, DiversifierServiceLive, DiversifierServiceAuto } from "./services/diversifier-service.js";
|
|
61
|
-
export {
|
|
62
|
-
export {
|
|
63
|
-
export {
|
|
64
|
-
export {
|
|
65
|
-
export {
|
|
66
|
-
export {
|
|
67
|
-
export {
|
|
90
|
+
export { CandidateRepository, CandidateRepositoryLive } from "./repo/candidate-repo.js";
|
|
91
|
+
export { TrackedProjectRepository, TrackedProjectRepositoryLive } from "./repo/tracked-project-repo.js";
|
|
92
|
+
export { DaemonService, DaemonServiceLive, DaemonServiceNoop } from "./services/daemon-service.js";
|
|
93
|
+
export { TracingService, TracingServiceLive, TracingServiceNoop } from "./services/tracing-service.js";
|
|
94
|
+
export { CompactionService, CompactionServiceLive, CompactionServiceNoop, CompactionServiceAuto } from "./services/compaction-service.js";
|
|
95
|
+
export { ValidationService, ValidationServiceLive } from "./services/validation-service.js";
|
|
96
|
+
export { LlmService, LlmServiceNoop, LlmServiceAgentSdk, LlmServiceAnthropic, LlmServiceAuto } from "./services/llm-service.js";
|
|
68
97
|
/**
|
|
69
98
|
* Create the full application layer from an existing SqliteClient infra layer.
|
|
70
99
|
*
|
|
@@ -76,15 +105,35 @@ export { CycleScanService } from "./services/cycle-scan-service.js";
|
|
|
76
105
|
* @param infra A layer providing SqliteClient
|
|
77
106
|
*/
|
|
78
107
|
export const makeAppLayerFromInfra = (infra) => {
|
|
79
|
-
const repos = Layer.mergeAll(TaskRepositoryLive, DependencyRepositoryLive, LearningRepositoryLive, FileLearningRepositoryLive, AttemptRepositoryLive, RunRepositoryLive, WorkerRepositoryLive, ClaimRepositoryLive, OrchestratorStateRepositoryLive,
|
|
108
|
+
const repos = Layer.mergeAll(TaskRepositoryLive, DependencyRepositoryLive, LearningRepositoryLive, FileLearningRepositoryLive, AttemptRepositoryLive, RunRepositoryLive, AnchorRepositoryLive, EdgeRepositoryLive, DeduplicationRepositoryLive, CandidateRepositoryLive, TrackedProjectRepositoryLive, WorkerRepositoryLive, ClaimRepositoryLive, OrchestratorStateRepositoryLive, CompactionRepositoryLive, MessageRepositoryLive, DocRepositoryLive).pipe(Layer.provide(infra));
|
|
80
109
|
// SyncServiceLive needs TaskService, repos, and infra
|
|
81
110
|
const syncServiceWithDeps = SyncServiceLive.pipe(Layer.provide(Layer.mergeAll(infra, repos, TaskServiceLive.pipe(Layer.provide(repos)))));
|
|
82
111
|
// AutoSyncServiceLive needs SyncService and infra
|
|
83
112
|
const autoSyncService = AutoSyncServiceLive.pipe(Layer.provide(Layer.merge(infra, syncServiceWithDeps)));
|
|
84
|
-
//
|
|
85
|
-
const
|
|
86
|
-
//
|
|
87
|
-
const
|
|
113
|
+
// LlmService (auto-detects Agent SDK → Anthropic → Noop)
|
|
114
|
+
const llmService = LlmServiceAuto;
|
|
115
|
+
// EmbeddingService (auto-detects local node-llama-cpp)
|
|
116
|
+
const embeddingService = EmbeddingServiceAuto;
|
|
117
|
+
// RerankerService (auto-detects local node-llama-cpp)
|
|
118
|
+
const rerankerService = RerankerServiceAuto;
|
|
119
|
+
// QueryExpansionService (auto-detects LlmService availability)
|
|
120
|
+
const queryExpansionService = QueryExpansionServiceAuto.pipe(Layer.provide(llmService));
|
|
121
|
+
// EdgeServiceLive needs EdgeRepository from repos
|
|
122
|
+
const edgeService = EdgeServiceLive.pipe(Layer.provide(repos));
|
|
123
|
+
// FeedbackTrackerServiceLive needs EdgeService (created early for RetrieverService optional dependency)
|
|
124
|
+
const feedbackTrackerService = FeedbackTrackerServiceLive.pipe(Layer.provide(edgeService));
|
|
125
|
+
// GraphExpansionServiceLive needs EdgeService, LearningRepository, and AnchorRepository
|
|
126
|
+
const graphExpansionService = GraphExpansionServiceLive.pipe(Layer.provide(Layer.merge(repos, edgeService)));
|
|
127
|
+
// RetrieverServiceLive needs repos, embedding, query expansion, reranker, graph expansion, diversifier, and optionally feedback tracker
|
|
128
|
+
const retrieverService = RetrieverServiceLive.pipe(Layer.provide(Layer.mergeAll(repos, embeddingService, queryExpansionService, rerankerService, graphExpansionService, feedbackTrackerService, DiversifierServiceLive)));
|
|
129
|
+
// Services need repos, embedding, query expansion, reranker, retriever, and autoSyncService
|
|
130
|
+
const services = Layer.mergeAll(TaskServiceLive, DependencyServiceLive, ReadyServiceLive, HierarchyServiceLive, LearningServiceLive, FileLearningServiceLive, AttemptServiceLive, AnchorServiceLive, DeduplicationServiceLive).pipe(Layer.provide(Layer.mergeAll(repos, embeddingService, queryExpansionService, rerankerService, retrieverService, autoSyncService)));
|
|
131
|
+
// AnchorVerificationServiceLive needs AnchorRepository from repos
|
|
132
|
+
const anchorVerificationService = AnchorVerificationServiceLive.pipe(Layer.provide(repos));
|
|
133
|
+
// SwarmVerificationServiceLive needs AnchorVerificationService and AnchorRepository
|
|
134
|
+
const swarmVerificationService = SwarmVerificationServiceLive.pipe(Layer.provide(Layer.merge(repos, anchorVerificationService)));
|
|
135
|
+
// PromotionServiceLive needs CandidateRepository, LearningService, and EdgeService
|
|
136
|
+
const promotionService = PromotionServiceLive.pipe(Layer.provide(Layer.mergeAll(repos, services, edgeService)));
|
|
88
137
|
// WorkerServiceLive needs WorkerRepository and OrchestratorStateRepository (from repos)
|
|
89
138
|
const workerService = WorkerServiceLive.pipe(Layer.provide(repos));
|
|
90
139
|
// ClaimServiceLive needs ClaimRepository and OrchestratorStateRepository (from repos)
|
|
@@ -93,23 +142,20 @@ export const makeAppLayerFromInfra = (infra) => {
|
|
|
93
142
|
const orchestratorService = OrchestratorServiceLive.pipe(Layer.provide(Layer.mergeAll(repos, services, workerService, claimService, infra)));
|
|
94
143
|
// TracingServiceLive needs SqliteClient
|
|
95
144
|
const tracingService = TracingServiceLive.pipe(Layer.provide(infra));
|
|
145
|
+
// CompactionServiceLive needs CompactionRepository (from repos), SqliteClient (from infra), and LlmService
|
|
146
|
+
const compactionService = CompactionServiceLive.pipe(Layer.provide(Layer.mergeAll(repos, infra, llmService)));
|
|
96
147
|
// ValidationServiceLive needs SqliteClient
|
|
97
148
|
const validationService = ValidationServiceLive.pipe(Layer.provide(infra));
|
|
98
|
-
//
|
|
99
|
-
const
|
|
149
|
+
// MessageServiceLive needs MessageRepository (from repos)
|
|
150
|
+
const messageService = MessageServiceLive.pipe(Layer.provide(repos));
|
|
100
151
|
// DocServiceLive needs DocRepository (from repos)
|
|
101
152
|
const docService = DocServiceLive.pipe(Layer.provide(repos));
|
|
102
|
-
// LlmServiceClaudeAgentSdk is the default — uses Claude Code subscription (DD-022)
|
|
103
|
-
const llmService = LlmServiceClaudeAgentSdk;
|
|
104
|
-
// AgentServiceLive — wraps Claude Agent SDK for sub-agent dispatch (cycle scan)
|
|
105
|
-
const agentService = AgentServiceLive;
|
|
106
|
-
// CycleScanServiceLive needs AgentService + SqliteClient
|
|
107
|
-
const cycleScanService = CycleScanServiceLive.pipe(Layer.provide(Layer.mergeAll(agentService, infra)));
|
|
108
153
|
// Merge all services
|
|
109
|
-
const allServices = Layer.mergeAll(services, retrieverService, DiversifierServiceLive, workerService, claimService, orchestratorService, tracingService,
|
|
154
|
+
const allServices = Layer.mergeAll(services, edgeService, graphExpansionService, anchorVerificationService, swarmVerificationService, promotionService, feedbackTrackerService, retrieverService, DiversifierServiceLive, workerService, claimService, orchestratorService, DaemonServiceLive, tracingService, compactionService, validationService, messageService, docService);
|
|
110
155
|
// MigrationService only needs SqliteClient
|
|
111
156
|
const migrationService = MigrationServiceLive.pipe(Layer.provide(infra));
|
|
112
157
|
// Also expose RunRepository directly for run tracking
|
|
158
|
+
// (Note: Consider creating RunService in future refactor)
|
|
113
159
|
// Also expose SqliteClient directly for direct database access (e.g., trace commands)
|
|
114
160
|
return Layer.mergeAll(allServices, syncServiceWithDeps, migrationService, repos, infra);
|
|
115
161
|
};
|
|
@@ -126,29 +172,62 @@ export const makeAppLayer = (dbPath) => {
|
|
|
126
172
|
return makeAppLayerFromInfra(SqliteClientLive(dbPath));
|
|
127
173
|
};
|
|
128
174
|
/**
|
|
129
|
-
* Create a minimal application layer
|
|
130
|
-
* Useful for testing and simple CLI operations.
|
|
175
|
+
* Create a minimal application layer from an existing SqliteClient infra layer.
|
|
131
176
|
*
|
|
132
|
-
*
|
|
177
|
+
* Uses Noop variants for LLM-dependent services (embedding, query expansion,
|
|
178
|
+
* reranker, compaction, auto-sync). Useful for tests and environments where
|
|
179
|
+
* external services (LLM APIs, node-llama-cpp) are not available.
|
|
180
|
+
*
|
|
181
|
+
* @param infra A layer providing SqliteClient
|
|
133
182
|
*/
|
|
134
|
-
export const
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
183
|
+
export const makeMinimalLayerFromInfra = (infra) => {
|
|
184
|
+
const repos = Layer.mergeAll(TaskRepositoryLive, DependencyRepositoryLive, LearningRepositoryLive, FileLearningRepositoryLive, AttemptRepositoryLive, RunRepositoryLive, AnchorRepositoryLive, EdgeRepositoryLive, DeduplicationRepositoryLive, CandidateRepositoryLive, TrackedProjectRepositoryLive, WorkerRepositoryLive, ClaimRepositoryLive, OrchestratorStateRepositoryLive, CompactionRepositoryLive, MessageRepositoryLive, DocRepositoryLive).pipe(Layer.provide(infra));
|
|
185
|
+
// SyncServiceLive needs TaskService, repos, and infra
|
|
186
|
+
const syncServiceWithDeps = SyncServiceLive.pipe(Layer.provide(Layer.mergeAll(infra, repos, TaskServiceLive.pipe(Layer.provide(repos)))));
|
|
187
|
+
// EdgeServiceLive needs EdgeRepository from repos
|
|
188
|
+
const edgeService = EdgeServiceLive.pipe(Layer.provide(repos));
|
|
189
|
+
// FeedbackTrackerServiceLive needs EdgeService
|
|
190
|
+
const feedbackTrackerService = FeedbackTrackerServiceLive.pipe(Layer.provide(edgeService));
|
|
191
|
+
// GraphExpansionServiceLive needs EdgeService, LearningRepository, and AnchorRepository
|
|
192
|
+
const graphExpansionService = GraphExpansionServiceLive.pipe(Layer.provide(Layer.merge(repos, edgeService)));
|
|
193
|
+
// RetrieverServiceLive with Noop variants for LLM-dependent services
|
|
194
|
+
const retrieverService = RetrieverServiceLive.pipe(Layer.provide(Layer.mergeAll(repos, EmbeddingServiceNoop, QueryExpansionServiceNoop, RerankerServiceNoop, graphExpansionService, feedbackTrackerService, DiversifierServiceLive)));
|
|
195
|
+
// Services with Noop embedding, query expansion, reranker, retriever, and auto-sync
|
|
196
|
+
const services = Layer.mergeAll(TaskServiceLive, DependencyServiceLive, ReadyServiceLive, HierarchyServiceLive, LearningServiceLive, FileLearningServiceLive, AttemptServiceLive, AnchorServiceLive, DeduplicationServiceLive).pipe(Layer.provide(Layer.mergeAll(repos, EmbeddingServiceNoop, QueryExpansionServiceNoop, RerankerServiceNoop, retrieverService, AutoSyncServiceNoop)));
|
|
197
|
+
// AnchorVerificationServiceLive needs AnchorRepository from repos
|
|
198
|
+
const anchorVerificationService = AnchorVerificationServiceLive.pipe(Layer.provide(repos));
|
|
199
|
+
// SwarmVerificationServiceLive needs AnchorVerificationService and AnchorRepository
|
|
200
|
+
const swarmVerificationService = SwarmVerificationServiceLive.pipe(Layer.provide(Layer.merge(repos, anchorVerificationService)));
|
|
201
|
+
// PromotionServiceLive needs CandidateRepository, LearningService, and EdgeService
|
|
202
|
+
const promotionService = PromotionServiceLive.pipe(Layer.provide(Layer.mergeAll(repos, services, edgeService)));
|
|
203
|
+
// WorkerServiceLive needs WorkerRepository and OrchestratorStateRepository (from repos)
|
|
204
|
+
const workerService = WorkerServiceLive.pipe(Layer.provide(repos));
|
|
205
|
+
// ClaimServiceLive needs ClaimRepository and OrchestratorStateRepository (from repos)
|
|
206
|
+
const claimService = ClaimServiceLive.pipe(Layer.provide(repos));
|
|
207
|
+
// OrchestratorServiceLive needs WorkerService, ClaimService, TaskService, OrchestratorStateRepository, and SqliteClient
|
|
208
|
+
const orchestratorService = OrchestratorServiceLive.pipe(Layer.provide(Layer.mergeAll(repos, services, workerService, claimService, infra)));
|
|
209
|
+
// CompactionServiceNoop for minimal layer (no LLM features)
|
|
210
|
+
const compactionService = CompactionServiceNoop.pipe(Layer.provide(Layer.merge(repos, infra)));
|
|
141
211
|
// ValidationServiceLive needs SqliteClient
|
|
142
212
|
const validationService = ValidationServiceLive.pipe(Layer.provide(infra));
|
|
143
|
-
//
|
|
144
|
-
const
|
|
213
|
+
// MessageServiceLive needs MessageRepository (from repos)
|
|
214
|
+
const messageService = MessageServiceLive.pipe(Layer.provide(repos));
|
|
215
|
+
// DocServiceLive needs DocRepository (from repos)
|
|
216
|
+
const docService = DocServiceLive.pipe(Layer.provide(repos));
|
|
145
217
|
// Merge all services
|
|
146
|
-
const allServices = Layer.mergeAll(services, retrieverService, DiversifierServiceLive, TracingServiceNoop, validationService,
|
|
218
|
+
const allServices = Layer.mergeAll(services, edgeService, graphExpansionService, anchorVerificationService, swarmVerificationService, promotionService, feedbackTrackerService, retrieverService, DiversifierServiceLive, workerService, claimService, orchestratorService, DaemonServiceNoop, TracingServiceNoop, compactionService, validationService, messageService, docService);
|
|
147
219
|
// MigrationService only needs SqliteClient
|
|
148
220
|
const migrationService = MigrationServiceLive.pipe(Layer.provide(infra));
|
|
149
|
-
//
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
221
|
+
// Also expose RunRepository directly for run tracking and SqliteClient for direct access
|
|
222
|
+
return Layer.mergeAll(allServices, syncServiceWithDeps, migrationService, repos, infra);
|
|
223
|
+
};
|
|
224
|
+
/**
|
|
225
|
+
* Create a minimal application layer without auto-sync.
|
|
226
|
+
* Useful for testing and simple CLI operations.
|
|
227
|
+
*
|
|
228
|
+
* @param dbPath Path to SQLite database file
|
|
229
|
+
*/
|
|
230
|
+
export const makeMinimalLayer = (dbPath) => {
|
|
231
|
+
return makeMinimalLayerFromInfra(SqliteClientLive(dbPath));
|
|
153
232
|
};
|
|
154
233
|
//# sourceMappingURL=layer.js.map
|