@jamesaphoenix/tx-core 0.4.2 → 0.4.4
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 +480 -0
- package/dist/db.d.ts +28 -14
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +108 -14
- package/dist/db.js.map +1 -1
- package/dist/errors.d.ts +178 -34
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +119 -26
- package/dist/errors.js.map +1 -1
- package/dist/id.d.ts +10 -0
- package/dist/id.d.ts.map +1 -1
- package/dist/id.js +17 -1
- package/dist/id.js.map +1 -1
- package/dist/index.d.ts +15 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +62 -8
- package/dist/index.js.map +1 -1
- package/dist/layer.d.ts +23 -14
- package/dist/layer.d.ts.map +1 -1
- package/dist/layer.js +75 -76
- package/dist/layer.js.map +1 -1
- package/dist/mappers/attempt.d.ts +3 -1
- package/dist/mappers/attempt.d.ts.map +1 -1
- package/dist/mappers/attempt.js +23 -9
- package/dist/mappers/attempt.js.map +1 -1
- package/dist/mappers/claim.d.ts +1 -1
- package/dist/mappers/claim.d.ts.map +1 -1
- package/dist/mappers/claim.js +11 -4
- package/dist/mappers/claim.js.map +1 -1
- package/dist/mappers/deduplication.d.ts +13 -1
- package/dist/mappers/deduplication.d.ts.map +1 -1
- package/dist/mappers/deduplication.js +22 -3
- package/dist/mappers/deduplication.js.map +1 -1
- package/dist/mappers/doc.d.ts +24 -0
- package/dist/mappers/doc.d.ts.map +1 -0
- package/dist/mappers/doc.js +161 -0
- package/dist/mappers/doc.js.map +1 -0
- package/dist/mappers/file-learning.d.ts.map +1 -1
- package/dist/mappers/file-learning.js +2 -1
- package/dist/mappers/file-learning.js.map +1 -1
- package/dist/mappers/index.d.ts +6 -7
- package/dist/mappers/index.d.ts.map +1 -1
- package/dist/mappers/index.js +10 -12
- package/dist/mappers/index.js.map +1 -1
- package/dist/mappers/learning.d.ts +9 -1
- package/dist/mappers/learning.d.ts.map +1 -1
- package/dist/mappers/learning.js +94 -14
- package/dist/mappers/learning.js.map +1 -1
- package/dist/mappers/orchestrator-state.d.ts +1 -1
- package/dist/mappers/orchestrator-state.d.ts.map +1 -1
- package/dist/mappers/orchestrator-state.js +31 -5
- package/dist/mappers/orchestrator-state.js.map +1 -1
- package/dist/mappers/parse-date.d.ts +11 -0
- package/dist/mappers/parse-date.d.ts.map +1 -0
- package/dist/mappers/parse-date.js +18 -0
- package/dist/mappers/parse-date.js.map +1 -0
- package/dist/mappers/run.d.ts +14 -4
- package/dist/mappers/run.d.ts.map +1 -1
- package/dist/mappers/run.js +49 -18
- package/dist/mappers/run.js.map +1 -1
- package/dist/mappers/task.d.ts +5 -1
- package/dist/mappers/task.d.ts.map +1 -1
- package/dist/mappers/task.js +66 -16
- package/dist/mappers/task.js.map +1 -1
- package/dist/mappers/tracked-project.d.ts +3 -1
- package/dist/mappers/tracked-project.d.ts.map +1 -1
- package/dist/mappers/tracked-project.js +23 -9
- package/dist/mappers/tracked-project.js.map +1 -1
- package/dist/mappers/worker.d.ts +1 -1
- package/dist/mappers/worker.d.ts.map +1 -1
- package/dist/mappers/worker.js +44 -6
- package/dist/mappers/worker.js.map +1 -1
- package/dist/repo/attempt-repo.d.ts +2 -2
- package/dist/repo/attempt-repo.d.ts.map +1 -1
- package/dist/repo/attempt-repo.js +16 -6
- package/dist/repo/attempt-repo.js.map +1 -1
- package/dist/repo/claim-repo.d.ts +46 -2
- package/dist/repo/claim-repo.d.ts.map +1 -1
- package/dist/repo/claim-repo.js +113 -6
- package/dist/repo/claim-repo.js.map +1 -1
- package/dist/repo/deduplication-repo.d.ts +9 -1
- package/dist/repo/deduplication-repo.d.ts.map +1 -1
- package/dist/repo/deduplication-repo.js +46 -9
- package/dist/repo/deduplication-repo.js.map +1 -1
- package/dist/repo/dep-repo.d.ts +27 -3
- package/dist/repo/dep-repo.d.ts.map +1 -1
- package/dist/repo/dep-repo.js +166 -39
- package/dist/repo/dep-repo.js.map +1 -1
- package/dist/repo/doc-repo.d.ts +59 -0
- package/dist/repo/doc-repo.d.ts.map +1 -0
- package/dist/repo/doc-repo.js +276 -0
- package/dist/repo/doc-repo.js.map +1 -0
- package/dist/repo/file-learning-repo.d.ts +3 -3
- package/dist/repo/file-learning-repo.d.ts.map +1 -1
- package/dist/repo/file-learning-repo.js +19 -8
- package/dist/repo/file-learning-repo.js.map +1 -1
- package/dist/repo/index.d.ts +4 -6
- package/dist/repo/index.d.ts.map +1 -1
- package/dist/repo/index.js +3 -5
- package/dist/repo/index.js.map +1 -1
- package/dist/repo/learning-repo.d.ts +10 -3
- package/dist/repo/learning-repo.d.ts.map +1 -1
- package/dist/repo/learning-repo.js +68 -11
- package/dist/repo/learning-repo.js.map +1 -1
- package/dist/repo/orchestrator-state-repo.d.ts.map +1 -1
- package/dist/repo/orchestrator-state-repo.js +8 -1
- package/dist/repo/orchestrator-state-repo.js.map +1 -1
- package/dist/repo/run-repo.d.ts +3 -3
- package/dist/repo/run-repo.d.ts.map +1 -1
- package/dist/repo/run-repo.js +40 -19
- package/dist/repo/run-repo.js.map +1 -1
- package/dist/repo/task-repo.d.ts +14 -3
- package/dist/repo/task-repo.d.ts.map +1 -1
- package/dist/repo/task-repo.js +194 -20
- package/dist/repo/task-repo.js.map +1 -1
- package/dist/repo/tracked-project-repo.d.ts.map +1 -1
- package/dist/repo/tracked-project-repo.js +15 -1
- package/dist/repo/tracked-project-repo.js.map +1 -1
- package/dist/repo/worker-repo.d.ts +3 -2
- package/dist/repo/worker-repo.d.ts.map +1 -1
- package/dist/repo/worker-repo.js +54 -8
- package/dist/repo/worker-repo.js.map +1 -1
- package/dist/schemas/sync.js +2 -2
- package/dist/schemas/sync.js.map +1 -1
- package/dist/schemas/worker.d.ts +1 -0
- package/dist/schemas/worker.d.ts.map +1 -1
- package/dist/schemas/worker.js +1 -0
- package/dist/schemas/worker.js.map +1 -1
- package/dist/services/agent-service.d.ts +57 -0
- package/dist/services/agent-service.d.ts.map +1 -0
- package/dist/services/agent-service.js +81 -0
- package/dist/services/agent-service.js.map +1 -0
- package/dist/services/attempt-service.d.ts.map +1 -1
- package/dist/services/attempt-service.js +1 -4
- 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 +18 -10
- package/dist/services/auto-sync-service.js.map +1 -1
- package/dist/services/claim-service.d.ts +8 -2
- package/dist/services/claim-service.d.ts.map +1 -1
- package/dist/services/claim-service.js +37 -23
- package/dist/services/claim-service.js.map +1 -1
- package/dist/services/cycle-scan-service.d.ts +32 -0
- package/dist/services/cycle-scan-service.d.ts.map +1 -0
- package/dist/services/cycle-scan-service.js +546 -0
- package/dist/services/cycle-scan-service.js.map +1 -0
- package/dist/services/daemon-service.d.ts +40 -2
- package/dist/services/daemon-service.d.ts.map +1 -1
- package/dist/services/daemon-service.js +199 -52
- package/dist/services/daemon-service.js.map +1 -1
- package/dist/services/deduplication-service.d.ts +8 -4
- package/dist/services/deduplication-service.d.ts.map +1 -1
- package/dist/services/deduplication-service.js +79 -25
- package/dist/services/deduplication-service.js.map +1 -1
- package/dist/services/dep-service.d.ts +2 -2
- package/dist/services/dep-service.d.ts.map +1 -1
- package/dist/services/dep-service.js +9 -5
- package/dist/services/dep-service.js.map +1 -1
- package/dist/services/diversifier-service.d.ts +2 -1
- package/dist/services/diversifier-service.d.ts.map +1 -1
- package/dist/services/diversifier-service.js +37 -43
- package/dist/services/diversifier-service.js.map +1 -1
- package/dist/services/doc-service.d.ts +49 -0
- package/dist/services/doc-service.d.ts.map +1 -0
- package/dist/services/doc-service.js +605 -0
- package/dist/services/doc-service.js.map +1 -0
- package/dist/services/embedding-service.d.ts +66 -2
- package/dist/services/embedding-service.d.ts.map +1 -1
- package/dist/services/embedding-service.js +138 -24
- package/dist/services/embedding-service.js.map +1 -1
- package/dist/services/file-learning-service.d.ts.map +1 -1
- package/dist/services/file-learning-service.js +8 -7
- package/dist/services/file-learning-service.js.map +1 -1
- package/dist/services/file-watcher-service.d.ts.map +1 -1
- package/dist/services/file-watcher-service.js +58 -11
- package/dist/services/file-watcher-service.js.map +1 -1
- package/dist/services/hierarchy-service.d.ts +1 -1
- package/dist/services/hierarchy-service.d.ts.map +1 -1
- package/dist/services/hierarchy-service.js +50 -32
- package/dist/services/hierarchy-service.js.map +1 -1
- package/dist/services/index.d.ts +13 -15
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +13 -15
- package/dist/services/index.js.map +1 -1
- package/dist/services/learning-service.d.ts +3 -3
- package/dist/services/learning-service.d.ts.map +1 -1
- package/dist/services/learning-service.js +75 -42
- package/dist/services/learning-service.js.map +1 -1
- package/dist/services/llm-service.d.ts +62 -0
- package/dist/services/llm-service.d.ts.map +1 -0
- package/dist/services/llm-service.js +172 -0
- package/dist/services/llm-service.js.map +1 -0
- package/dist/services/migration-service.d.ts +1 -1
- package/dist/services/migration-service.d.ts.map +1 -1
- package/dist/services/migration-service.js +18 -7
- package/dist/services/migration-service.js.map +1 -1
- package/dist/services/orchestrator-service.d.ts +4 -3
- package/dist/services/orchestrator-service.d.ts.map +1 -1
- package/dist/services/orchestrator-service.js +66 -27
- package/dist/services/orchestrator-service.js.map +1 -1
- package/dist/services/query-expansion-service.d.ts +30 -9
- package/dist/services/query-expansion-service.d.ts.map +1 -1
- package/dist/services/query-expansion-service.js +54 -63
- package/dist/services/query-expansion-service.js.map +1 -1
- package/dist/services/ready-service.d.ts +21 -1
- package/dist/services/ready-service.d.ts.map +1 -1
- package/dist/services/ready-service.js +44 -21
- package/dist/services/ready-service.js.map +1 -1
- package/dist/services/retriever-service.d.ts +10 -10
- package/dist/services/retriever-service.d.ts.map +1 -1
- package/dist/services/retriever-service.js +53 -161
- package/dist/services/retriever-service.js.map +1 -1
- package/dist/services/sync-service.d.ts +17 -4
- package/dist/services/sync-service.d.ts.map +1 -1
- package/dist/services/sync-service.js +381 -116
- package/dist/services/sync-service.js.map +1 -1
- package/dist/services/task-service.d.ts +6 -4
- package/dist/services/task-service.d.ts.map +1 -1
- package/dist/services/task-service.js +165 -35
- package/dist/services/task-service.js.map +1 -1
- package/dist/services/tracing-service.d.ts +55 -0
- package/dist/services/tracing-service.d.ts.map +1 -0
- package/dist/services/tracing-service.js +99 -0
- package/dist/services/tracing-service.js.map +1 -0
- package/dist/services/transcript-adapter.d.ts +99 -0
- package/dist/services/transcript-adapter.d.ts.map +1 -0
- package/dist/services/transcript-adapter.js +283 -0
- package/dist/services/transcript-adapter.js.map +1 -0
- package/dist/services/validation-service.d.ts +85 -0
- package/dist/services/validation-service.d.ts.map +1 -0
- package/dist/services/validation-service.js +289 -0
- package/dist/services/validation-service.js.map +1 -0
- package/dist/services/worker-process.d.ts +23 -4
- package/dist/services/worker-process.d.ts.map +1 -1
- package/dist/services/worker-process.js +168 -72
- package/dist/services/worker-process.js.map +1 -1
- package/dist/services/worker-service.d.ts.map +1 -1
- package/dist/services/worker-service.js +7 -12
- package/dist/services/worker-service.js.map +1 -1
- package/dist/sync/claude-task-writer.d.ts +49 -0
- package/dist/sync/claude-task-writer.d.ts.map +1 -0
- package/dist/sync/claude-task-writer.js +135 -0
- package/dist/sync/claude-task-writer.js.map +1 -0
- package/dist/utils/doc-hash.d.ts +10 -0
- package/dist/utils/doc-hash.d.ts.map +1 -0
- package/dist/utils/doc-hash.js +14 -0
- package/dist/utils/doc-hash.js.map +1 -0
- package/dist/utils/doc-renderer.d.ts +44 -0
- package/dist/utils/doc-renderer.d.ts.map +1 -0
- package/dist/utils/doc-renderer.js +202 -0
- package/dist/utils/doc-renderer.js.map +1 -0
- package/dist/utils/math.d.ts +5 -1
- package/dist/utils/math.d.ts.map +1 -1
- package/dist/utils/math.js +12 -4
- package/dist/utils/math.js.map +1 -1
- package/dist/utils/sql.d.ts +9 -0
- package/dist/utils/sql.d.ts.map +1 -0
- package/dist/utils/sql.js +9 -0
- package/dist/utils/sql.js.map +1 -0
- package/dist/utils/toml-config.d.ts +22 -0
- package/dist/utils/toml-config.d.ts.map +1 -0
- package/dist/utils/toml-config.js +75 -0
- package/dist/utils/toml-config.js.map +1 -0
- package/dist/worker/hooks.d.ts +102 -0
- package/dist/worker/hooks.d.ts.map +1 -0
- package/dist/worker/hooks.js +11 -0
- package/dist/worker/hooks.js.map +1 -0
- package/dist/worker/index.d.ts +9 -0
- package/dist/worker/index.d.ts.map +1 -0
- package/dist/worker/index.js +8 -0
- package/dist/worker/index.js.map +1 -0
- package/dist/worker/run-worker.d.ts +33 -0
- package/dist/worker/run-worker.d.ts.map +1 -0
- package/dist/worker/run-worker.js +265 -0
- package/dist/worker/run-worker.js.map +1 -0
- package/package.json +14 -12
- package/dist/mappers/anchor.d.ts +0 -14
- package/dist/mappers/anchor.d.ts.map +0 -1
- package/dist/mappers/anchor.js +0 -38
- package/dist/mappers/anchor.js.map +0 -1
- package/dist/mappers/candidate.d.ts +0 -23
- package/dist/mappers/candidate.d.ts.map +0 -1
- package/dist/mappers/candidate.js +0 -53
- package/dist/mappers/candidate.js.map +0 -1
- package/dist/mappers/edge.d.ts +0 -10
- package/dist/mappers/edge.d.ts.map +0 -1
- package/dist/mappers/edge.js +0 -19
- package/dist/mappers/edge.js.map +0 -1
- package/dist/repo/anchor-repo.d.ts +0 -52
- package/dist/repo/anchor-repo.d.ts.map +0 -1
- package/dist/repo/anchor-repo.js +0 -204
- package/dist/repo/anchor-repo.js.map +0 -1
- package/dist/repo/candidate-repo.d.ts +0 -16
- package/dist/repo/candidate-repo.d.ts.map +0 -1
- package/dist/repo/candidate-repo.js +0 -143
- package/dist/repo/candidate-repo.js.map +0 -1
- package/dist/repo/edge-repo.d.ts +0 -26
- package/dist/repo/edge-repo.d.ts.map +0 -1
- package/dist/repo/edge-repo.js +0 -227
- package/dist/repo/edge-repo.js.map +0 -1
- package/dist/services/anchor-service.d.ts +0 -147
- package/dist/services/anchor-service.d.ts.map +0 -1
- package/dist/services/anchor-service.js +0 -540
- package/dist/services/anchor-service.js.map +0 -1
- package/dist/services/anchor-verification.d.ts +0 -94
- package/dist/services/anchor-verification.d.ts.map +0 -1
- package/dist/services/anchor-verification.js +0 -617
- package/dist/services/anchor-verification.js.map +0 -1
- package/dist/services/ast-grep-service.d.ts +0 -58
- package/dist/services/ast-grep-service.d.ts.map +0 -1
- package/dist/services/ast-grep-service.js +0 -356
- package/dist/services/ast-grep-service.js.map +0 -1
- package/dist/services/candidate-extractor-service.d.ts +0 -56
- package/dist/services/candidate-extractor-service.d.ts.map +0 -1
- package/dist/services/candidate-extractor-service.js +0 -365
- package/dist/services/candidate-extractor-service.js.map +0 -1
- package/dist/services/edge-service.d.ts +0 -78
- package/dist/services/edge-service.d.ts.map +0 -1
- package/dist/services/edge-service.js +0 -158
- package/dist/services/edge-service.js.map +0 -1
- package/dist/services/feedback-tracker.d.ts +0 -64
- package/dist/services/feedback-tracker.d.ts.map +0 -1
- package/dist/services/feedback-tracker.js +0 -110
- package/dist/services/feedback-tracker.js.map +0 -1
- package/dist/services/graph-expansion.d.ts +0 -155
- package/dist/services/graph-expansion.d.ts.map +0 -1
- package/dist/services/graph-expansion.js +0 -466
- package/dist/services/graph-expansion.js.map +0 -1
- package/dist/services/promotion-service.d.ts +0 -67
- package/dist/services/promotion-service.d.ts.map +0 -1
- package/dist/services/promotion-service.js +0 -151
- package/dist/services/promotion-service.js.map +0 -1
- package/dist/services/swarm-verification.d.ts +0 -104
- package/dist/services/swarm-verification.d.ts.map +0 -1
- package/dist/services/swarm-verification.js +0 -400
- package/dist/services/swarm-verification.js.map +0 -1
package/dist/layer.d.ts
CHANGED
|
@@ -5,31 +5,40 @@
|
|
|
5
5
|
* See DD-002 for full specification.
|
|
6
6
|
*/
|
|
7
7
|
import { Layer } from "effect";
|
|
8
|
+
import { type SqliteClient } from "./db.js";
|
|
8
9
|
export { SyncService } from "./services/sync-service.js";
|
|
9
10
|
export { MigrationService } from "./services/migration-service.js";
|
|
10
11
|
export { AutoSyncService, AutoSyncServiceNoop, AutoSyncServiceLive } from "./services/auto-sync-service.js";
|
|
11
12
|
export { LearningService } from "./services/learning-service.js";
|
|
12
13
|
export { FileLearningService } from "./services/file-learning-service.js";
|
|
13
14
|
export { EmbeddingService, EmbeddingServiceNoop, EmbeddingServiceLive, EmbeddingServiceOpenAI, EmbeddingServiceAuto, createEmbedderLayer, type EmbedderConfig } from "./services/embedding-service.js";
|
|
14
|
-
export { QueryExpansionService, QueryExpansionServiceNoop, QueryExpansionServiceLive, QueryExpansionServiceAuto, QueryExpansionUnavailableError, type QueryExpansionResult } from "./services/query-expansion-service.js";
|
|
15
15
|
export { AttemptService } from "./services/attempt-service.js";
|
|
16
16
|
export { TaskService } from "./services/task-service.js";
|
|
17
17
|
export { DependencyService } from "./services/dep-service.js";
|
|
18
|
-
export { ReadyService } from "./services/ready-service.js";
|
|
18
|
+
export { ReadyService, type ReadyCheckResult, isReadyResult } from "./services/ready-service.js";
|
|
19
19
|
export { HierarchyService } from "./services/hierarchy-service.js";
|
|
20
20
|
export { ScoreService } from "./services/score-service.js";
|
|
21
|
-
export { RunRepository } from "./repo/run-repo.js";
|
|
22
21
|
export { RerankerService, RerankerServiceNoop, RerankerServiceLive, RerankerServiceAuto, type RerankerResult } from "./services/reranker-service.js";
|
|
23
|
-
export { DeduplicationService, DeduplicationServiceLive } from "./services/deduplication-service.js";
|
|
24
22
|
export { RetrieverService, RetrieverServiceNoop, RetrieverServiceLive, RetrieverServiceAuto } from "./services/retriever-service.js";
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
29
|
-
export {
|
|
30
|
-
export {
|
|
31
|
-
export {
|
|
32
|
-
export {
|
|
23
|
+
export { DiversifierService, DiversifierServiceNoop, DiversifierServiceLive, DiversifierServiceAuto } from "./services/diversifier-service.js";
|
|
24
|
+
export { QueryExpansionService, QueryExpansionServiceNoop, QueryExpansionServiceLive, QueryExpansionServiceAuto, QueryExpansionUnavailableError, type QueryExpansionResult } from "./services/query-expansion-service.js";
|
|
25
|
+
export { DeduplicationService, DeduplicationServiceLive } from "./services/deduplication-service.js";
|
|
26
|
+
export { LlmService, LlmServiceNoop, LlmServiceClaudeAgentSdk, LlmServiceAnthropicSdk, LlmServiceAuto, type LlmOptions } from "./services/llm-service.js";
|
|
27
|
+
export { RunRepository } from "./repo/run-repo.js";
|
|
28
|
+
export { DocService } from "./services/doc-service.js";
|
|
29
|
+
export { AgentService, AgentServiceNoop } from "./services/agent-service.js";
|
|
30
|
+
export { CycleScanService } from "./services/cycle-scan-service.js";
|
|
31
|
+
/**
|
|
32
|
+
* Create the full application layer from an existing SqliteClient infra layer.
|
|
33
|
+
*
|
|
34
|
+
* Use this when you already have a SqliteClient layer (e.g., from Layer.succeed
|
|
35
|
+
* with a pre-created database instance). This is useful for test utilities that
|
|
36
|
+
* need to share a single database across test runs while getting fresh service
|
|
37
|
+
* instances via Layer.fresh.
|
|
38
|
+
*
|
|
39
|
+
* @param infra A layer providing SqliteClient
|
|
40
|
+
*/
|
|
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/worker-repo.js").WorkerRepository | import("./repo/claim-repo.js").ClaimRepository | import("./repo/orchestrator-state-repo.js").OrchestratorStateRepository | import("./repo/deduplication-repo.js").DeduplicationRepository | import("./services/deduplication-service.js").DeduplicationService | import("./repo/tracked-project-repo.js").TrackedProjectRepository | import("./repo/doc-repo.js").DocRepository | 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/worker-service.js").WorkerService | import("./services/claim-service.js").ClaimService | import("./services/orchestrator-service.js").OrchestratorService | import("./services/tracing-service.js").TracingService | import("./services/validation-service.js").ValidationService | import("./services/llm-service.js").LlmService | import("./services/doc-service.js").DocService | import("./services/agent-service.js").AgentService | import("./services/cycle-scan-service.js").CycleScanService, import("./errors.js").DatabaseError | import("./errors.js").LlmUnavailableError | import("./errors.js").AgentError | E, never>;
|
|
33
42
|
/**
|
|
34
43
|
* Create the full application layer with all services.
|
|
35
44
|
*
|
|
@@ -39,12 +48,12 @@ export { DaemonService, DaemonServiceLive, DaemonServiceNoop, type DaemonStatus
|
|
|
39
48
|
*
|
|
40
49
|
* @param dbPath Path to SQLite database file
|
|
41
50
|
*/
|
|
42
|
-
export declare const makeAppLayer: (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("./repo/
|
|
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/worker-repo.js").WorkerRepository | import("./repo/claim-repo.js").ClaimRepository | import("./repo/orchestrator-state-repo.js").OrchestratorStateRepository | import("./repo/deduplication-repo.js").DeduplicationRepository | import("./services/deduplication-service.js").DeduplicationService | import("./repo/tracked-project-repo.js").TrackedProjectRepository | import("./repo/doc-repo.js").DocRepository | 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/worker-service.js").WorkerService | import("./services/claim-service.js").ClaimService | import("./services/orchestrator-service.js").OrchestratorService | import("./services/tracing-service.js").TracingService | import("./services/validation-service.js").ValidationService | import("./services/llm-service.js").LlmService | import("./services/doc-service.js").DocService | import("./services/agent-service.js").AgentService | import("./services/cycle-scan-service.js").CycleScanService, import("./errors.js").DatabaseError | import("./errors.js").LlmUnavailableError | import("./errors.js").AgentError, never>;
|
|
43
52
|
/**
|
|
44
53
|
* Create a minimal application layer without auto-sync.
|
|
45
54
|
* Useful for testing and simple CLI operations.
|
|
46
55
|
*
|
|
47
56
|
* @param dbPath Path to SQLite database file
|
|
48
57
|
*/
|
|
49
|
-
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("./
|
|
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/llm-service.js").LlmService, import("./errors.js").DatabaseError, never>;
|
|
50
59
|
//# 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;
|
|
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,CAAA;AAuC7D,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAClE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAA;AAC3G,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AACzE,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,KAAK,cAAc,EACpB,MAAM,iCAAiC,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,YAAY,EAAE,KAAK,gBAAgB,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AACh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|
package/dist/layer.js
CHANGED
|
@@ -12,14 +12,13 @@ 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";
|
|
20
15
|
import { WorkerRepositoryLive } from "./repo/worker-repo.js";
|
|
21
16
|
import { ClaimRepositoryLive } from "./repo/claim-repo.js";
|
|
22
17
|
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";
|
|
23
22
|
import { TaskServiceLive } from "./services/task-service.js";
|
|
24
23
|
import { DependencyServiceLive } from "./services/dep-service.js";
|
|
25
24
|
import { ReadyServiceLive } from "./services/ready-service.js";
|
|
@@ -27,25 +26,22 @@ import { HierarchyServiceLive } from "./services/hierarchy-service.js";
|
|
|
27
26
|
import { LearningServiceLive } from "./services/learning-service.js";
|
|
28
27
|
import { FileLearningServiceLive } from "./services/file-learning-service.js";
|
|
29
28
|
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";
|
|
33
29
|
import { SyncServiceLive } from "./services/sync-service.js";
|
|
34
30
|
import { AutoSyncServiceLive, AutoSyncServiceNoop } from "./services/auto-sync-service.js";
|
|
35
31
|
import { MigrationServiceLive } from "./services/migration-service.js";
|
|
36
32
|
import { EmbeddingServiceNoop } from "./services/embedding-service.js";
|
|
37
|
-
import { QueryExpansionServiceNoop } from "./services/query-expansion-service.js";
|
|
38
33
|
import { RerankerServiceNoop } from "./services/reranker-service.js";
|
|
39
34
|
import { RetrieverServiceLive } from "./services/retriever-service.js";
|
|
40
|
-
import {
|
|
41
|
-
import { AnchorVerificationServiceLive } from "./services/anchor-verification.js";
|
|
42
|
-
import { SwarmVerificationServiceLive } from "./services/swarm-verification.js";
|
|
43
|
-
import { PromotionServiceLive } from "./services/promotion-service.js";
|
|
44
|
-
import { FeedbackTrackerServiceLive } from "./services/feedback-tracker.js";
|
|
35
|
+
import { DiversifierServiceLive } from "./services/diversifier-service.js";
|
|
45
36
|
import { WorkerServiceLive } from "./services/worker-service.js";
|
|
46
37
|
import { ClaimServiceLive } from "./services/claim-service.js";
|
|
47
38
|
import { OrchestratorServiceLive } from "./services/orchestrator-service.js";
|
|
48
|
-
import {
|
|
39
|
+
import { TracingServiceLive, TracingServiceNoop } from "./services/tracing-service.js";
|
|
40
|
+
import { ValidationServiceLive } from "./services/validation-service.js";
|
|
41
|
+
import { LlmServiceClaudeAgentSdk, LlmServiceNoop } from "./services/llm-service.js";
|
|
42
|
+
import { DocServiceLive } from "./services/doc-service.js";
|
|
43
|
+
import { AgentServiceLive } from "./services/agent-service.js";
|
|
44
|
+
import { CycleScanServiceLive } from "./services/cycle-scan-service.js";
|
|
49
45
|
// Re-export services for cleaner imports
|
|
50
46
|
export { SyncService } from "./services/sync-service.js";
|
|
51
47
|
export { MigrationService } from "./services/migration-service.js";
|
|
@@ -53,70 +49,81 @@ export { AutoSyncService, AutoSyncServiceNoop, AutoSyncServiceLive } from "./ser
|
|
|
53
49
|
export { LearningService } from "./services/learning-service.js";
|
|
54
50
|
export { FileLearningService } from "./services/file-learning-service.js";
|
|
55
51
|
export { EmbeddingService, EmbeddingServiceNoop, EmbeddingServiceLive, EmbeddingServiceOpenAI, EmbeddingServiceAuto, createEmbedderLayer } from "./services/embedding-service.js";
|
|
56
|
-
export { QueryExpansionService, QueryExpansionServiceNoop, QueryExpansionServiceLive, QueryExpansionServiceAuto, QueryExpansionUnavailableError } from "./services/query-expansion-service.js";
|
|
57
52
|
export { AttemptService } from "./services/attempt-service.js";
|
|
58
53
|
export { TaskService } from "./services/task-service.js";
|
|
59
54
|
export { DependencyService } from "./services/dep-service.js";
|
|
60
|
-
export { ReadyService } from "./services/ready-service.js";
|
|
55
|
+
export { ReadyService, isReadyResult } from "./services/ready-service.js";
|
|
61
56
|
export { HierarchyService } from "./services/hierarchy-service.js";
|
|
62
57
|
export { ScoreService } from "./services/score-service.js";
|
|
63
|
-
export { RunRepository } from "./repo/run-repo.js";
|
|
64
58
|
export { RerankerService, RerankerServiceNoop, RerankerServiceLive, RerankerServiceAuto } from "./services/reranker-service.js";
|
|
65
|
-
export { DeduplicationService, DeduplicationServiceLive } from "./services/deduplication-service.js";
|
|
66
59
|
export { RetrieverService, RetrieverServiceNoop, RetrieverServiceLive, RetrieverServiceAuto } from "./services/retriever-service.js";
|
|
67
|
-
export {
|
|
68
|
-
export {
|
|
69
|
-
export {
|
|
70
|
-
export {
|
|
71
|
-
export {
|
|
72
|
-
export {
|
|
73
|
-
export {
|
|
74
|
-
export {
|
|
60
|
+
export { DiversifierService, DiversifierServiceNoop, DiversifierServiceLive, DiversifierServiceAuto } from "./services/diversifier-service.js";
|
|
61
|
+
export { QueryExpansionService, QueryExpansionServiceNoop, QueryExpansionServiceLive, QueryExpansionServiceAuto, QueryExpansionUnavailableError } from "./services/query-expansion-service.js";
|
|
62
|
+
export { DeduplicationService, DeduplicationServiceLive } from "./services/deduplication-service.js";
|
|
63
|
+
export { LlmService, LlmServiceNoop, LlmServiceClaudeAgentSdk, LlmServiceAnthropicSdk, LlmServiceAuto } from "./services/llm-service.js";
|
|
64
|
+
export { RunRepository } from "./repo/run-repo.js";
|
|
65
|
+
export { DocService } from "./services/doc-service.js";
|
|
66
|
+
export { AgentService, AgentServiceNoop } from "./services/agent-service.js";
|
|
67
|
+
export { CycleScanService } from "./services/cycle-scan-service.js";
|
|
75
68
|
/**
|
|
76
|
-
* Create the full application layer
|
|
69
|
+
* Create the full application layer from an existing SqliteClient infra layer.
|
|
77
70
|
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
71
|
+
* Use this when you already have a SqliteClient layer (e.g., from Layer.succeed
|
|
72
|
+
* with a pre-created database instance). This is useful for test utilities that
|
|
73
|
+
* need to share a single database across test runs while getting fresh service
|
|
74
|
+
* instances via Layer.fresh.
|
|
81
75
|
*
|
|
82
|
-
* @param
|
|
76
|
+
* @param infra A layer providing SqliteClient
|
|
83
77
|
*/
|
|
84
|
-
export const
|
|
85
|
-
const
|
|
86
|
-
const repos = Layer.mergeAll(TaskRepositoryLive, DependencyRepositoryLive, LearningRepositoryLive, FileLearningRepositoryLive, AttemptRepositoryLive, RunRepositoryLive, AnchorRepositoryLive, EdgeRepositoryLive, DeduplicationRepositoryLive, CandidateRepositoryLive, TrackedProjectRepositoryLive, WorkerRepositoryLive, ClaimRepositoryLive, OrchestratorStateRepositoryLive).pipe(Layer.provide(infra));
|
|
78
|
+
export const makeAppLayerFromInfra = (infra) => {
|
|
79
|
+
const repos = Layer.mergeAll(TaskRepositoryLive, DependencyRepositoryLive, LearningRepositoryLive, FileLearningRepositoryLive, AttemptRepositoryLive, RunRepositoryLive, WorkerRepositoryLive, ClaimRepositoryLive, OrchestratorStateRepositoryLive, DeduplicationRepositoryLive, TrackedProjectRepositoryLive, DocRepositoryLive).pipe(Layer.provide(infra));
|
|
87
80
|
// SyncServiceLive needs TaskService, repos, and infra
|
|
88
81
|
const syncServiceWithDeps = SyncServiceLive.pipe(Layer.provide(Layer.mergeAll(infra, repos, TaskServiceLive.pipe(Layer.provide(repos)))));
|
|
89
82
|
// AutoSyncServiceLive needs SyncService and infra
|
|
90
83
|
const autoSyncService = AutoSyncServiceLive.pipe(Layer.provide(Layer.merge(infra, syncServiceWithDeps)));
|
|
91
|
-
//
|
|
92
|
-
const
|
|
93
|
-
//
|
|
94
|
-
const
|
|
95
|
-
// GraphExpansionServiceLive needs EdgeService, LearningRepository, and AnchorRepository
|
|
96
|
-
const graphExpansionService = GraphExpansionServiceLive.pipe(Layer.provide(Layer.merge(repos, edgeService)));
|
|
97
|
-
// RetrieverServiceLive needs repos, embedding, query expansion, reranker, graph expansion, and optionally feedback tracker
|
|
98
|
-
const retrieverService = RetrieverServiceLive.pipe(Layer.provide(Layer.mergeAll(repos, EmbeddingServiceNoop, QueryExpansionServiceNoop, RerankerServiceNoop, graphExpansionService, feedbackTrackerService)));
|
|
99
|
-
// Services need repos, embedding, query expansion, reranker, retriever, and autoSyncService
|
|
100
|
-
const services = Layer.mergeAll(TaskServiceLive, DependencyServiceLive, ReadyServiceLive, HierarchyServiceLive, LearningServiceLive, FileLearningServiceLive, AttemptServiceLive, AnchorServiceLive, DeduplicationServiceLive).pipe(Layer.provide(Layer.mergeAll(repos, EmbeddingServiceNoop, QueryExpansionServiceNoop, RerankerServiceNoop, retrieverService, autoSyncService)));
|
|
101
|
-
// AnchorVerificationServiceLive needs AnchorRepository from repos
|
|
102
|
-
const anchorVerificationService = AnchorVerificationServiceLive.pipe(Layer.provide(repos));
|
|
103
|
-
// SwarmVerificationServiceLive needs AnchorVerificationService and AnchorRepository
|
|
104
|
-
const swarmVerificationService = SwarmVerificationServiceLive.pipe(Layer.provide(Layer.merge(repos, anchorVerificationService)));
|
|
105
|
-
// PromotionServiceLive needs CandidateRepository, LearningService, and EdgeService
|
|
106
|
-
const promotionService = PromotionServiceLive.pipe(Layer.provide(Layer.mergeAll(repos, services, edgeService)));
|
|
84
|
+
// RetrieverServiceLive needs repos, embedding, reranker, diversifier
|
|
85
|
+
const retrieverService = RetrieverServiceLive.pipe(Layer.provide(Layer.mergeAll(repos, EmbeddingServiceNoop, RerankerServiceNoop, DiversifierServiceLive)));
|
|
86
|
+
// Services need repos, embedding, reranker, retriever, and autoSyncService
|
|
87
|
+
const services = Layer.mergeAll(TaskServiceLive, DependencyServiceLive, ReadyServiceLive, HierarchyServiceLive, LearningServiceLive, FileLearningServiceLive, AttemptServiceLive).pipe(Layer.provide(Layer.mergeAll(repos, EmbeddingServiceNoop, RerankerServiceNoop, retrieverService, autoSyncService)));
|
|
107
88
|
// WorkerServiceLive needs WorkerRepository and OrchestratorStateRepository (from repos)
|
|
108
89
|
const workerService = WorkerServiceLive.pipe(Layer.provide(repos));
|
|
109
90
|
// ClaimServiceLive needs ClaimRepository and OrchestratorStateRepository (from repos)
|
|
110
91
|
const claimService = ClaimServiceLive.pipe(Layer.provide(repos));
|
|
111
|
-
// OrchestratorServiceLive needs WorkerService, ClaimService, TaskService, and
|
|
112
|
-
const orchestratorService = OrchestratorServiceLive.pipe(Layer.provide(Layer.mergeAll(repos, services, workerService, claimService)));
|
|
113
|
-
//
|
|
114
|
-
const
|
|
92
|
+
// OrchestratorServiceLive needs WorkerService, ClaimService, TaskService, OrchestratorStateRepository, and SqliteClient
|
|
93
|
+
const orchestratorService = OrchestratorServiceLive.pipe(Layer.provide(Layer.mergeAll(repos, services, workerService, claimService, infra)));
|
|
94
|
+
// TracingServiceLive needs SqliteClient
|
|
95
|
+
const tracingService = TracingServiceLive.pipe(Layer.provide(infra));
|
|
96
|
+
// ValidationServiceLive needs SqliteClient
|
|
97
|
+
const validationService = ValidationServiceLive.pipe(Layer.provide(infra));
|
|
98
|
+
// DeduplicationServiceLive needs DeduplicationRepository (from repos)
|
|
99
|
+
const deduplicationService = DeduplicationServiceLive.pipe(Layer.provide(repos));
|
|
100
|
+
// DocServiceLive needs DocRepository (from repos)
|
|
101
|
+
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
|
+
// Merge all services
|
|
109
|
+
const allServices = Layer.mergeAll(services, retrieverService, DiversifierServiceLive, workerService, claimService, orchestratorService, tracingService, validationService, llmService, deduplicationService, docService, agentService, cycleScanService);
|
|
115
110
|
// MigrationService only needs SqliteClient
|
|
116
111
|
const migrationService = MigrationServiceLive.pipe(Layer.provide(infra));
|
|
117
112
|
// Also expose RunRepository directly for run tracking
|
|
118
|
-
//
|
|
119
|
-
return Layer.mergeAll(allServices, syncServiceWithDeps, migrationService, repos);
|
|
113
|
+
// Also expose SqliteClient directly for direct database access (e.g., trace commands)
|
|
114
|
+
return Layer.mergeAll(allServices, syncServiceWithDeps, migrationService, repos, infra);
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Create the full application layer with all services.
|
|
118
|
+
*
|
|
119
|
+
* This is the standard entry point for CLI, MCP, and SDK consumers.
|
|
120
|
+
* Provides: TaskService, DependencyService, ReadyService, HierarchyService,
|
|
121
|
+
* LearningService, FileLearningService, AttemptService, SyncService, MigrationService
|
|
122
|
+
*
|
|
123
|
+
* @param dbPath Path to SQLite database file
|
|
124
|
+
*/
|
|
125
|
+
export const makeAppLayer = (dbPath) => {
|
|
126
|
+
return makeAppLayerFromInfra(SqliteClientLive(dbPath));
|
|
120
127
|
};
|
|
121
128
|
/**
|
|
122
129
|
* Create a minimal application layer without auto-sync.
|
|
@@ -126,25 +133,17 @@ export const makeAppLayer = (dbPath) => {
|
|
|
126
133
|
*/
|
|
127
134
|
export const makeMinimalLayer = (dbPath) => {
|
|
128
135
|
const infra = SqliteClientLive(dbPath);
|
|
129
|
-
const repos = Layer.mergeAll(TaskRepositoryLive, DependencyRepositoryLive, LearningRepositoryLive, FileLearningRepositoryLive, AttemptRepositoryLive, RunRepositoryLive
|
|
130
|
-
//
|
|
131
|
-
const
|
|
132
|
-
//
|
|
133
|
-
const
|
|
134
|
-
//
|
|
135
|
-
const
|
|
136
|
-
//
|
|
137
|
-
const
|
|
138
|
-
//
|
|
139
|
-
const
|
|
140
|
-
// AnchorVerificationServiceLive needs AnchorRepository from repos
|
|
141
|
-
const anchorVerificationService = AnchorVerificationServiceLive.pipe(Layer.provide(repos));
|
|
142
|
-
// SwarmVerificationServiceLive needs AnchorVerificationService and AnchorRepository
|
|
143
|
-
const swarmVerificationService = SwarmVerificationServiceLive.pipe(Layer.provide(Layer.merge(repos, anchorVerificationService)));
|
|
144
|
-
// PromotionServiceLive needs CandidateRepository, LearningService, and EdgeService
|
|
145
|
-
const promotionService = PromotionServiceLive.pipe(Layer.provide(Layer.mergeAll(repos, services, edgeService)));
|
|
146
|
-
// Merge all services including edgeService, graphExpansionService, anchorVerificationService, swarmVerificationService, promotionService, feedbackTrackerService, retrieverService, and daemon service (noop for minimal layer)
|
|
147
|
-
const allServices = Layer.mergeAll(services, edgeService, graphExpansionService, anchorVerificationService, swarmVerificationService, promotionService, feedbackTrackerService, retrieverService, DaemonServiceNoop);
|
|
136
|
+
const repos = Layer.mergeAll(TaskRepositoryLive, DependencyRepositoryLive, LearningRepositoryLive, FileLearningRepositoryLive, AttemptRepositoryLive, RunRepositoryLive).pipe(Layer.provide(infra));
|
|
137
|
+
// RetrieverServiceLive needs repos, embedding, reranker, diversifier
|
|
138
|
+
const retrieverService = RetrieverServiceLive.pipe(Layer.provide(Layer.mergeAll(repos, EmbeddingServiceNoop, RerankerServiceNoop, DiversifierServiceLive)));
|
|
139
|
+
// Services with Noop embedding, reranker, retriever, and auto-sync
|
|
140
|
+
const services = Layer.mergeAll(TaskServiceLive, DependencyServiceLive, ReadyServiceLive, HierarchyServiceLive, LearningServiceLive, FileLearningServiceLive, AttemptServiceLive).pipe(Layer.provide(Layer.mergeAll(repos, EmbeddingServiceNoop, RerankerServiceNoop, retrieverService, AutoSyncServiceNoop)));
|
|
141
|
+
// ValidationServiceLive needs SqliteClient
|
|
142
|
+
const validationService = ValidationServiceLive.pipe(Layer.provide(infra));
|
|
143
|
+
// LlmServiceNoop for minimal layer — no LLM needed for core commands (DD-022)
|
|
144
|
+
const llmService = LlmServiceNoop;
|
|
145
|
+
// Merge all services
|
|
146
|
+
const allServices = Layer.mergeAll(services, retrieverService, DiversifierServiceLive, TracingServiceNoop, validationService, llmService);
|
|
148
147
|
// MigrationService only needs SqliteClient
|
|
149
148
|
const migrationService = MigrationServiceLive.pipe(Layer.provide(infra));
|
|
150
149
|
// SyncService for manual exports
|
package/dist/layer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layer.js","sourceRoot":"","sources":["../src/layer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAC9B,OAAO,
|
|
1
|
+
{"version":3,"file":"layer.js","sourceRoot":"","sources":["../src/layer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAC9B,OAAO,EAAqB,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAA;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBA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sB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,UAAU,CAAC,CAAA;IAEzI,2CAA2C;IAC3C,MAAM,gBAAgB,GAAG,oBAAoB,CAAC,IAAI,CAChD,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CACrB,CAAA;IAED,iCAAiC;IACjC,MAAM,WAAW,GAAG,eAAe,CAAC,IAAI,CACtC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAC1B,KAAK,EACL,KAAK,EACL,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAC3C,CAAC,CACH,CAAA;IAED,sDAAsD;IACtD,OAAO,KAAK,CAAC,QAAQ,CAAC,WAAW,EAAE,gBAAgB,EAAE,WAAW,EAAE,KAAK,CAAC,CAAA;AAC1E,CAAC,CAAA"}
|
|
@@ -2,14 +2,16 @@
|
|
|
2
2
|
* Attempt mappers - convert database rows to domain objects
|
|
3
3
|
*/
|
|
4
4
|
import type { Attempt, AttemptOutcome, AttemptRow } from "@jamesaphoenix/tx-types";
|
|
5
|
+
import { ATTEMPT_OUTCOMES } from "@jamesaphoenix/tx-types";
|
|
5
6
|
export type { AttemptRow } from "@jamesaphoenix/tx-types";
|
|
6
|
-
export { ATTEMPT_OUTCOMES }
|
|
7
|
+
export { ATTEMPT_OUTCOMES };
|
|
7
8
|
/**
|
|
8
9
|
* Check if a string is a valid AttemptOutcome.
|
|
9
10
|
*/
|
|
10
11
|
export declare const isValidOutcome: (s: string) => s is AttemptOutcome;
|
|
11
12
|
/**
|
|
12
13
|
* Convert a database row to an Attempt domain object.
|
|
14
|
+
* Validates outcome and TaskId fields at runtime.
|
|
13
15
|
*/
|
|
14
16
|
export declare const rowToAttempt: (row: AttemptRow) => Attempt;
|
|
15
17
|
//# sourceMappingURL=attempt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attempt.d.ts","sourceRoot":"","sources":["../../src/mappers/attempt.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,OAAO,
|
|
1
|
+
{"version":3,"file":"attempt.d.ts","sourceRoot":"","sources":["../../src/mappers/attempt.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,UAAU,EACX,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAgB,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAKxE,YAAY,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,gBAAgB,EAAE,CAAA;AAE3B;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,GAAG,MAAM,KAAG,CAAC,IAAI,cAG/C,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,KAAK,UAAU,KAAG,OAiB9C,CAAA"}
|
package/dist/mappers/attempt.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Attempt mappers - convert database rows to domain objects
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
import { assertTaskId, ATTEMPT_OUTCOMES } from "@jamesaphoenix/tx-types";
|
|
5
|
+
import { InvalidStatusError } from "../errors.js";
|
|
6
|
+
import { parseDate } from "./parse-date.js";
|
|
7
|
+
export { ATTEMPT_OUTCOMES };
|
|
5
8
|
/**
|
|
6
9
|
* Check if a string is a valid AttemptOutcome.
|
|
7
10
|
*/
|
|
@@ -11,13 +14,24 @@ export const isValidOutcome = (s) => {
|
|
|
11
14
|
};
|
|
12
15
|
/**
|
|
13
16
|
* Convert a database row to an Attempt domain object.
|
|
17
|
+
* Validates outcome and TaskId fields at runtime.
|
|
14
18
|
*/
|
|
15
|
-
export const rowToAttempt = (row) =>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
});
|
|
19
|
+
export const rowToAttempt = (row) => {
|
|
20
|
+
if (!isValidOutcome(row.outcome)) {
|
|
21
|
+
throw new InvalidStatusError({
|
|
22
|
+
entity: "attempt",
|
|
23
|
+
status: row.outcome,
|
|
24
|
+
validStatuses: ATTEMPT_OUTCOMES,
|
|
25
|
+
rowId: row.id
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
id: row.id,
|
|
30
|
+
taskId: assertTaskId(row.task_id),
|
|
31
|
+
approach: row.approach,
|
|
32
|
+
outcome: row.outcome,
|
|
33
|
+
reason: row.reason,
|
|
34
|
+
createdAt: parseDate(row.created_at, "created_at", row.id)
|
|
35
|
+
};
|
|
36
|
+
};
|
|
23
37
|
//# sourceMappingURL=attempt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attempt.js","sourceRoot":"","sources":["../../src/mappers/attempt.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"attempt.js","sourceRoot":"","sources":["../../src/mappers/attempt.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAI3C,OAAO,EAAE,gBAAgB,EAAE,CAAA;AAE3B;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAS,EAAuB,EAAE;IAC/D,MAAM,QAAQ,GAAsB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAA;IAC3D,OAAO,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;AAC7B,CAAC,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,GAAe,EAAW,EAAE;IACvD,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,kBAAkB,CAAC;YAC3B,MAAM,EAAE,SAAS;YACjB,MAAM,EAAE,GAAG,CAAC,OAAO;YACnB,aAAa,EAAE,gBAAgB;YAC/B,KAAK,EAAE,GAAG,CAAC,EAAE;SACd,CAAC,CAAA;IACJ,CAAC;IACD,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,EAAmB;QAC3B,MAAM,EAAE,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC;QACjC,QAAQ,EAAE,GAAG,CAAC,QAAQ;QACtB,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,SAAS,EAAE,SAAS,CAAC,GAAG,CAAC,UAAU,EAAE,YAAY,EAAE,GAAG,CAAC,EAAE,CAAC;KAC3D,CAAA;AACH,CAAC,CAAA"}
|
package/dist/mappers/claim.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export declare const CLAIM_STATUSES: readonly ["active", "released", "expired",
|
|
|
24
24
|
export declare const isValidClaimStatus: (s: string) => s is ClaimStatus;
|
|
25
25
|
/**
|
|
26
26
|
* Convert a database row to a TaskClaim domain object.
|
|
27
|
-
* Throws if status is invalid.
|
|
27
|
+
* Throws InvalidStatusError if status is invalid.
|
|
28
28
|
*/
|
|
29
29
|
export declare const rowToClaim: (row: ClaimRow) => TaskClaim;
|
|
30
30
|
//# sourceMappingURL=claim.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claim.d.ts","sourceRoot":"","sources":["../../src/mappers/claim.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"claim.d.ts","sourceRoot":"","sources":["../../src/mappers/claim.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAElE;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,gBAAgB,EAAE,MAAM,CAAA;IACxB,aAAa,EAAE,MAAM,CAAA;IACrB,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,yDAA0D,CAAA;AAErF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,GAAG,MAAM,KAAG,CAAC,IAAI,WAEnD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,KAAK,QAAQ,KAAG,SAkB1C,CAAA"}
|
package/dist/mappers/claim.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Claim mappers - convert database rows to domain objects
|
|
3
3
|
*/
|
|
4
|
+
import { InvalidStatusError } from "../errors.js";
|
|
5
|
+
import { parseDate } from "./parse-date.js";
|
|
4
6
|
/**
|
|
5
7
|
* Valid claim statuses.
|
|
6
8
|
*/
|
|
@@ -13,18 +15,23 @@ export const isValidClaimStatus = (s) => {
|
|
|
13
15
|
};
|
|
14
16
|
/**
|
|
15
17
|
* Convert a database row to a TaskClaim domain object.
|
|
16
|
-
* Throws if status is invalid.
|
|
18
|
+
* Throws InvalidStatusError if status is invalid.
|
|
17
19
|
*/
|
|
18
20
|
export const rowToClaim = (row) => {
|
|
19
21
|
if (!isValidClaimStatus(row.status)) {
|
|
20
|
-
throw new
|
|
22
|
+
throw new InvalidStatusError({
|
|
23
|
+
entity: "claim",
|
|
24
|
+
status: row.status,
|
|
25
|
+
validStatuses: CLAIM_STATUSES,
|
|
26
|
+
rowId: row.id
|
|
27
|
+
});
|
|
21
28
|
}
|
|
22
29
|
return {
|
|
23
30
|
id: row.id,
|
|
24
31
|
taskId: row.task_id,
|
|
25
32
|
workerId: row.worker_id,
|
|
26
|
-
claimedAt:
|
|
27
|
-
leaseExpiresAt:
|
|
33
|
+
claimedAt: parseDate(row.claimed_at, "claimed_at", row.id),
|
|
34
|
+
leaseExpiresAt: parseDate(row.lease_expires_at, "lease_expires_at", row.id),
|
|
28
35
|
renewedCount: row.renewed_count,
|
|
29
36
|
status: row.status
|
|
30
37
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claim.js","sourceRoot":"","sources":["../../src/mappers/claim.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"claim.js","sourceRoot":"","sources":["../../src/mappers/claim.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAgB3C;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,CAAU,CAAA;AAErF;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAS,EAAoB,EAAE;IAChE,OAAQ,cAAoC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;AAC1D,CAAC,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,GAAa,EAAa,EAAE;IACrD,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;QACpC,MAAM,IAAI,kBAAkB,CAAC;YAC3B,MAAM,EAAE,OAAO;YACf,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,aAAa,EAAE,cAAc;YAC7B,KAAK,EAAE,GAAG,CAAC,EAAE;SACd,CAAC,CAAA;IACJ,CAAC;IACD,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,MAAM,EAAE,GAAG,CAAC,OAAO;QACnB,QAAQ,EAAE,GAAG,CAAC,SAAS;QACvB,SAAS,EAAE,SAAS,CAAC,GAAG,CAAC,UAAU,EAAE,YAAY,EAAE,GAAG,CAAC,EAAE,CAAC;QAC1D,cAAc,EAAE,SAAS,CAAC,GAAG,CAAC,gBAAgB,EAAE,kBAAkB,EAAE,GAAG,CAAC,EAAE,CAAC;QAC3E,YAAY,EAAE,GAAG,CAAC,aAAa;QAC/B,MAAM,EAAE,GAAG,CAAC,MAAM;KACnB,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -2,10 +2,22 @@
|
|
|
2
2
|
* Deduplication mappers - convert database rows to domain objects
|
|
3
3
|
*/
|
|
4
4
|
import type { ProcessedHash, ProcessedHashRow, FileProgress, FileProgressRow } from "@jamesaphoenix/tx-types";
|
|
5
|
+
/**
|
|
6
|
+
* Normalize content for deduplication comparison.
|
|
7
|
+
* Handles common semantic equivalences:
|
|
8
|
+
* - Trailing/leading whitespace
|
|
9
|
+
* - Line ending differences (CRLF → LF)
|
|
10
|
+
* - Unicode normalization (NFC canonical form)
|
|
11
|
+
*/
|
|
12
|
+
export declare const normalizeContent: (content: string) => string;
|
|
5
13
|
/**
|
|
6
14
|
* Compute SHA256 hash of content.
|
|
15
|
+
* By default, hashes raw content for backward compatibility with existing data.
|
|
16
|
+
* Pass normalize=true to normalize (trim, CRLF→LF, NFC) before hashing,
|
|
17
|
+
* which catches semantic duplicates but produces different hashes for
|
|
18
|
+
* previously stored content.
|
|
7
19
|
*/
|
|
8
|
-
export declare const hashContent: (content: string) => string;
|
|
20
|
+
export declare const hashContent: (content: string, normalize?: boolean) => string;
|
|
9
21
|
/**
|
|
10
22
|
* Convert a database row to a ProcessedHash domain object.
|
|
11
23
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deduplication.d.ts","sourceRoot":"","sources":["../../src/mappers/deduplication.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,eAAe,EAChB,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"deduplication.d.ts","sourceRoot":"","sources":["../../src/mappers/deduplication.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,eAAe,EAChB,MAAM,yBAAyB,CAAA;AAGhC;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAAI,SAAS,MAAM,KAAG,MAI9B,CAAA;AAErB;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM,EAAE,mBAAiB,KAAG,MAGhE,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,KAAK,gBAAgB,KAAG,aAMzD,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,GAAI,MAAM,aAAa;;;;;;CAMxD,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,KAAK,eAAe,KAAG,YAQvD,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAAI,UAAU,YAAY;;;;;;;;CAQ1D,CAAA"}
|