@jamesaphoenix/tx-types 0.4.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/dist/anchor.d.ts +153 -0
- package/dist/anchor.d.ts.map +1 -0
- package/dist/anchor.js +27 -0
- package/dist/anchor.js.map +1 -0
- package/dist/attempt.d.ts +53 -0
- package/dist/attempt.d.ts.map +1 -0
- package/dist/attempt.js +11 -0
- package/dist/attempt.js.map +1 -0
- package/dist/candidate.d.ts +203 -0
- package/dist/candidate.d.ts.map +1 -0
- package/dist/candidate.js +30 -0
- package/dist/candidate.js.map +1 -0
- package/dist/deduplication.d.ts +116 -0
- package/dist/deduplication.d.ts.map +1 -0
- package/dist/deduplication.js +9 -0
- package/dist/deduplication.js.map +1 -0
- package/dist/edge.d.ts +90 -0
- package/dist/edge.d.ts.map +1 -0
- package/dist/edge.js +32 -0
- package/dist/edge.js.map +1 -0
- package/dist/file-learning.d.ts +41 -0
- package/dist/file-learning.d.ts.map +1 -0
- package/dist/file-learning.js +8 -0
- package/dist/file-learning.js.map +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -0
- package/dist/learning.d.ts +204 -0
- package/dist/learning.d.ts.map +1 -0
- package/dist/learning.js +17 -0
- package/dist/learning.js.map +1 -0
- package/dist/run.d.ts +77 -0
- package/dist/run.d.ts.map +1 -0
- package/dist/run.js +17 -0
- package/dist/run.js.map +1 -0
- package/dist/symbol.d.ts +72 -0
- package/dist/symbol.d.ts.map +1 -0
- package/dist/symbol.js +29 -0
- package/dist/symbol.js.map +1 -0
- package/dist/task.d.ts +138 -0
- package/dist/task.d.ts.map +1 -0
- package/dist/task.js +35 -0
- package/dist/task.js.map +1 -0
- package/dist/tracked-project.d.ts +65 -0
- package/dist/tracked-project.d.ts.map +1 -0
- package/dist/tracked-project.js +13 -0
- package/dist/tracked-project.js.map +1 -0
- package/package.json +59 -0
package/dist/edge.d.ts
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Edge types for tx
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for graph edges that connect nodes in the knowledge graph.
|
|
5
|
+
* Zero runtime dependencies - pure TypeScript types only.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Branded type for edge IDs.
|
|
9
|
+
*/
|
|
10
|
+
export type EdgeId = number & {
|
|
11
|
+
readonly _brand: unique symbol;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Node types in the graph - entities that can be connected by edges.
|
|
15
|
+
*/
|
|
16
|
+
export declare const NODE_TYPES: readonly ["learning", "file", "task", "run"];
|
|
17
|
+
export type NodeType = (typeof NODE_TYPES)[number];
|
|
18
|
+
/**
|
|
19
|
+
* Edge types - strong ENUMs (fixed ontology, not pluggable).
|
|
20
|
+
* - ANCHORED_TO: Learning is anchored to a file/location
|
|
21
|
+
* - DERIVED_FROM: Learning is derived from another learning
|
|
22
|
+
* - IMPORTS: File imports another file
|
|
23
|
+
* - CO_CHANGES_WITH: Files frequently change together
|
|
24
|
+
* - SIMILAR_TO: Learnings are semantically similar
|
|
25
|
+
* - LINKS_TO: Explicit link reference
|
|
26
|
+
* - USED_IN_RUN: Learning was used in a run
|
|
27
|
+
* - INVALIDATED_BY: Learning was invalidated by another
|
|
28
|
+
*/
|
|
29
|
+
export declare const EDGE_TYPES: readonly ["ANCHORED_TO", "DERIVED_FROM", "IMPORTS", "CO_CHANGES_WITH", "SIMILAR_TO", "LINKS_TO", "USED_IN_RUN", "INVALIDATED_BY"];
|
|
30
|
+
export type EdgeType = (typeof EDGE_TYPES)[number];
|
|
31
|
+
/**
|
|
32
|
+
* Edge entity - connects two nodes in the graph.
|
|
33
|
+
*/
|
|
34
|
+
export interface Edge {
|
|
35
|
+
readonly id: EdgeId;
|
|
36
|
+
readonly edgeType: EdgeType;
|
|
37
|
+
readonly sourceType: NodeType;
|
|
38
|
+
readonly sourceId: string;
|
|
39
|
+
readonly targetType: NodeType;
|
|
40
|
+
readonly targetId: string;
|
|
41
|
+
readonly weight: number;
|
|
42
|
+
readonly metadata: Record<string, unknown>;
|
|
43
|
+
readonly createdAt: Date;
|
|
44
|
+
readonly invalidatedAt: Date | null;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Input for creating a new edge.
|
|
48
|
+
*/
|
|
49
|
+
export interface CreateEdgeInput {
|
|
50
|
+
readonly edgeType: EdgeType;
|
|
51
|
+
readonly sourceType: NodeType;
|
|
52
|
+
readonly sourceId: string;
|
|
53
|
+
readonly targetType: NodeType;
|
|
54
|
+
readonly targetId: string;
|
|
55
|
+
readonly weight?: number;
|
|
56
|
+
readonly metadata?: Record<string, unknown>;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Input for updating an edge.
|
|
60
|
+
*/
|
|
61
|
+
export interface UpdateEdgeInput {
|
|
62
|
+
readonly weight?: number;
|
|
63
|
+
readonly metadata?: Record<string, unknown>;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Database row type for edges (snake_case from SQLite).
|
|
67
|
+
*/
|
|
68
|
+
export interface EdgeRow {
|
|
69
|
+
id: number;
|
|
70
|
+
edge_type: string;
|
|
71
|
+
source_type: string;
|
|
72
|
+
source_id: string;
|
|
73
|
+
target_type: string;
|
|
74
|
+
target_id: string;
|
|
75
|
+
weight: number;
|
|
76
|
+
metadata: string;
|
|
77
|
+
created_at: string;
|
|
78
|
+
invalidated_at: string | null;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Neighbor node returned from graph traversal.
|
|
82
|
+
*/
|
|
83
|
+
export interface NeighborNode {
|
|
84
|
+
readonly nodeType: NodeType;
|
|
85
|
+
readonly nodeId: string;
|
|
86
|
+
readonly edgeType: EdgeType;
|
|
87
|
+
readonly weight: number;
|
|
88
|
+
readonly direction: "outgoing" | "incoming";
|
|
89
|
+
}
|
|
90
|
+
//# source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,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC7C;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC7C;AAED;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,UAAU,GAAG,UAAU,CAAC;CAC7C"}
|
package/dist/edge.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Edge types for tx
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for graph edges that connect nodes in the knowledge graph.
|
|
5
|
+
* Zero runtime dependencies - pure TypeScript types only.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Node types in the graph - entities that can be connected by edges.
|
|
9
|
+
*/
|
|
10
|
+
export const NODE_TYPES = ["learning", "file", "task", "run"];
|
|
11
|
+
/**
|
|
12
|
+
* Edge types - strong ENUMs (fixed ontology, not pluggable).
|
|
13
|
+
* - ANCHORED_TO: Learning is anchored to a file/location
|
|
14
|
+
* - DERIVED_FROM: Learning is derived from another learning
|
|
15
|
+
* - IMPORTS: File imports another file
|
|
16
|
+
* - CO_CHANGES_WITH: Files frequently change together
|
|
17
|
+
* - SIMILAR_TO: Learnings are semantically similar
|
|
18
|
+
* - LINKS_TO: Explicit link reference
|
|
19
|
+
* - USED_IN_RUN: Learning was used in a run
|
|
20
|
+
* - INVALIDATED_BY: Learning was invalidated by another
|
|
21
|
+
*/
|
|
22
|
+
export const EDGE_TYPES = [
|
|
23
|
+
"ANCHORED_TO",
|
|
24
|
+
"DERIVED_FROM",
|
|
25
|
+
"IMPORTS",
|
|
26
|
+
"CO_CHANGES_WITH",
|
|
27
|
+
"SIMILAR_TO",
|
|
28
|
+
"LINKS_TO",
|
|
29
|
+
"USED_IN_RUN",
|
|
30
|
+
"INVALIDATED_BY",
|
|
31
|
+
];
|
|
32
|
+
//# sourceMappingURL=edge.js.map
|
package/dist/edge.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edge.js","sourceRoot":"","sources":["../src/edge.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAU,CAAC;AAGvE;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,aAAa;IACb,cAAc;IACd,SAAS;IACT,iBAAiB;IACjB,YAAY;IACZ,UAAU;IACV,aAAa;IACb,gBAAgB;CACR,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File learning types for tx
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for path-based knowledge storage.
|
|
5
|
+
* Zero runtime dependencies - pure TypeScript types only.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Branded type for file learning IDs.
|
|
9
|
+
*/
|
|
10
|
+
export type FileLearningId = number & {
|
|
11
|
+
readonly _brand: unique symbol;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* File learning entity - a note associated with a file pattern.
|
|
15
|
+
*/
|
|
16
|
+
export interface FileLearning {
|
|
17
|
+
readonly id: FileLearningId;
|
|
18
|
+
readonly filePattern: string;
|
|
19
|
+
readonly note: string;
|
|
20
|
+
readonly taskId: string | null;
|
|
21
|
+
readonly createdAt: Date;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Input for creating a new file learning.
|
|
25
|
+
*/
|
|
26
|
+
export interface CreateFileLearningInput {
|
|
27
|
+
readonly filePattern: string;
|
|
28
|
+
readonly note: string;
|
|
29
|
+
readonly taskId?: string | null;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Database row type for file learnings (snake_case from SQLite).
|
|
33
|
+
*/
|
|
34
|
+
export interface FileLearningRow {
|
|
35
|
+
id: number;
|
|
36
|
+
file_pattern: string;
|
|
37
|
+
note: string;
|
|
38
|
+
task_id: string | null;
|
|
39
|
+
created_at: string;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=file-learning.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-learning.d.ts","sourceRoot":"","sources":["../src/file-learning.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,MAAM,CAAA;CAAE,CAAC;AAEzE;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,EAAE,cAAc,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-learning.js","sourceRoot":"","sources":["../src/file-learning.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @tx/types - Shared TypeScript types for tx
|
|
3
|
+
*
|
|
4
|
+
* Zero runtime dependencies - pure TypeScript types only.
|
|
5
|
+
* Works with any runtime (Node, Bun, Deno).
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { Task, TaskWithDeps, TaskId, TaskStatus } from "@jamesaphoenix/tx-types";
|
|
10
|
+
* import { Learning, LearningWithScore } from "@jamesaphoenix/tx-types";
|
|
11
|
+
* import { Attempt, Run } from "@jamesaphoenix/tx-types";
|
|
12
|
+
*
|
|
13
|
+
* // Or import from specific modules:
|
|
14
|
+
* import type { Task, TaskWithDeps } from "@tx/types/task";
|
|
15
|
+
* import type { Learning } from "@tx/types/learning";
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export { TASK_STATUSES, VALID_TRANSITIONS, type TaskStatus, type TaskId, type Task, type TaskWithDeps, type TaskTree, type TaskDependency, type CreateTaskInput, type UpdateTaskInput, type TaskFilter, type TaskCursor, type TaskRow, type DependencyRow, } from "./task.js";
|
|
19
|
+
export { LEARNING_SOURCE_TYPES, type LearningSourceType, type LearningId, type Learning, type LearningWithScore, type CreateLearningInput, type UpdateLearningInput, type LearningQuery, type ContextOptions, type ContextResult, type GraphExpansionStats, type LearningSearchResult, type LearningRow, type LearningRowWithBM25, type RetrievalOptions, type GraphExpansionQueryOptions, type DiversificationOptions, } from "./learning.js";
|
|
20
|
+
export { type FileLearningId, type FileLearning, type CreateFileLearningInput, type FileLearningRow, } from "./file-learning.js";
|
|
21
|
+
export { ATTEMPT_OUTCOMES, type AttemptOutcome, type AttemptId, type Attempt, type CreateAttemptInput, type AttemptRow, } from "./attempt.js";
|
|
22
|
+
export { RUN_STATUSES, type RunId, type RunStatus, type Run, type CreateRunInput, type UpdateRunInput, type RunRow, } from "./run.js";
|
|
23
|
+
export { ANCHOR_TYPES, ANCHOR_STATUSES, INVALIDATION_SOURCES, type AnchorId, type AnchorType, type AnchorStatus, type Anchor, type AnchorWithFreshness, type CreateAnchorInput, type UpdateAnchorInput, type AnchorRow, type InvalidationSource, type InvalidationLog, type InvalidationLogRow, } from "./anchor.js";
|
|
24
|
+
export { NODE_TYPES, EDGE_TYPES, type EdgeId, type NodeType, type EdgeType, type Edge, type CreateEdgeInput, type UpdateEdgeInput, type EdgeRow, type NeighborNode, } from "./edge.js";
|
|
25
|
+
export { type ProcessedHashId, type ProcessedHash, type CreateProcessedHashInput, type ProcessedHashRow, type FileProgressId, type FileProgress, type UpsertFileProgressInput, type FileProgressRow, type HashCheckResult, type LineProcessResult, type FileProcessResult, type DeduplicationOptions, } from "./deduplication.js";
|
|
26
|
+
export { CANDIDATE_CONFIDENCES, CANDIDATE_CATEGORIES, CANDIDATE_STATUSES, type CandidateConfidence, type CandidateCategory, type CandidateStatus, type CandidateId, type TranscriptChunk, type ExtractedCandidate, type LearningCandidate, type CreateCandidateInput, type UpdateCandidateInput, type CandidateFilter, type ExtractionResult, type CandidateRow, } from "./candidate.js";
|
|
27
|
+
export { SYMBOL_KINDS, IMPORT_KINDS, type SymbolKind, type SymbolInfo, type ImportKind, type ImportInfo, type SymbolPattern, type Match, } from "./symbol.js";
|
|
28
|
+
export { SOURCE_TYPES, type SourceType, type TrackedProjectId, type TrackedProject, type CreateTrackedProjectInput, type TrackedProjectRow, } from "./tracked-project.js";
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,KAAK,UAAU,EACf,KAAK,MAAM,EACX,KAAK,IAAI,EACT,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,OAAO,EACZ,KAAK,aAAa,GACnB,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,qBAAqB,EACrB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,GAC5B,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,YAAY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pB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,YAAY,GAClB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,KAAK,GACX,MAAM,aAAa,CAAA;AAGpB,OAAO,EACL,YAAY,EACZ,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,GACvB,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @tx/types - Shared TypeScript types for tx
|
|
3
|
+
*
|
|
4
|
+
* Zero runtime dependencies - pure TypeScript types only.
|
|
5
|
+
* Works with any runtime (Node, Bun, Deno).
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { Task, TaskWithDeps, TaskId, TaskStatus } from "@jamesaphoenix/tx-types";
|
|
10
|
+
* import { Learning, LearningWithScore } from "@jamesaphoenix/tx-types";
|
|
11
|
+
* import { Attempt, Run } from "@jamesaphoenix/tx-types";
|
|
12
|
+
*
|
|
13
|
+
* // Or import from specific modules:
|
|
14
|
+
* import type { Task, TaskWithDeps } from "@tx/types/task";
|
|
15
|
+
* import type { Learning } from "@tx/types/learning";
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
// Task types
|
|
19
|
+
export { TASK_STATUSES, VALID_TRANSITIONS, } from "./task.js";
|
|
20
|
+
// Learning types
|
|
21
|
+
export { LEARNING_SOURCE_TYPES, } from "./learning.js";
|
|
22
|
+
// Attempt types
|
|
23
|
+
export { ATTEMPT_OUTCOMES, } from "./attempt.js";
|
|
24
|
+
// Run types
|
|
25
|
+
export { RUN_STATUSES, } from "./run.js";
|
|
26
|
+
// Anchor types
|
|
27
|
+
export { ANCHOR_TYPES, ANCHOR_STATUSES, INVALIDATION_SOURCES, } from "./anchor.js";
|
|
28
|
+
// Edge types
|
|
29
|
+
export { NODE_TYPES, EDGE_TYPES, } from "./edge.js";
|
|
30
|
+
// Candidate types (learning extraction from transcripts)
|
|
31
|
+
export { CANDIDATE_CONFIDENCES, CANDIDATE_CATEGORIES, CANDIDATE_STATUSES, } from "./candidate.js";
|
|
32
|
+
// Symbol extraction types (code intelligence)
|
|
33
|
+
export { SYMBOL_KINDS, IMPORT_KINDS, } from "./symbol.js";
|
|
34
|
+
// Tracked project types (daemon monitoring)
|
|
35
|
+
export { SOURCE_TYPES, } from "./tracked-project.js";
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,aAAa;AACb,OAAO,EACL,aAAa,EACb,iBAAiB,GAalB,MAAM,WAAW,CAAC;AAEnB,iBAAiB;AACjB,OAAO,EACL,qBAAqB,GAiBtB,MAAM,eAAe,CAAC;AAUvB,gBAAgB;AAChB,OAAO,EACL,gBAAgB,GAMjB,MAAM,cAAc,CAAC;AAEtB,YAAY;AACZ,OAAO,EACL,YAAY,GAOb,MAAM,UAAU,CAAC;AAElB,eAAe;AACf,OAAO,EACL,YAAY,EACZ,eAAe,EACf,oBAAoB,GAYrB,MAAM,aAAa,CAAA;AAEpB,aAAa;AACb,OAAO,EACL,UAAU,EACV,UAAU,GASX,MAAM,WAAW,CAAC;AAkBnB,yDAAyD;AACzD,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,GAanB,MAAM,gBAAgB,CAAC;AAExB,8CAA8C;AAC9C,OAAO,EACL,YAAY,EACZ,YAAY,GAOb,MAAM,aAAa,CAAA;AAEpB,4CAA4C;AAC5C,OAAO,EACL,YAAY,GAMb,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Learning types for tx
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for the contextual learnings system.
|
|
5
|
+
* See PRD-010 and DD-010 for specification.
|
|
6
|
+
* Zero runtime dependencies - pure TypeScript types only.
|
|
7
|
+
*/
|
|
8
|
+
import type { EdgeType } from "./edge.js";
|
|
9
|
+
/**
|
|
10
|
+
* Valid learning source types.
|
|
11
|
+
*/
|
|
12
|
+
export declare const LEARNING_SOURCE_TYPES: readonly ["compaction", "run", "manual", "claude_md"];
|
|
13
|
+
/**
|
|
14
|
+
* Learning source type - where the learning came from.
|
|
15
|
+
*/
|
|
16
|
+
export type LearningSourceType = (typeof LEARNING_SOURCE_TYPES)[number];
|
|
17
|
+
/**
|
|
18
|
+
* Branded type for learning IDs.
|
|
19
|
+
*/
|
|
20
|
+
export type LearningId = number & {
|
|
21
|
+
readonly _brand: unique symbol;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Core learning entity.
|
|
25
|
+
*/
|
|
26
|
+
export interface Learning {
|
|
27
|
+
readonly id: LearningId;
|
|
28
|
+
readonly content: string;
|
|
29
|
+
readonly sourceType: LearningSourceType;
|
|
30
|
+
readonly sourceRef: string | null;
|
|
31
|
+
readonly createdAt: Date;
|
|
32
|
+
readonly keywords: string[];
|
|
33
|
+
readonly category: string | null;
|
|
34
|
+
readonly usageCount: number;
|
|
35
|
+
readonly lastUsedAt: Date | null;
|
|
36
|
+
readonly outcomeScore: number | null;
|
|
37
|
+
readonly embedding: Float32Array | null;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Learning with relevance scoring from search results.
|
|
41
|
+
*/
|
|
42
|
+
export interface LearningWithScore extends Learning {
|
|
43
|
+
readonly relevanceScore: number;
|
|
44
|
+
readonly bm25Score: number;
|
|
45
|
+
readonly vectorScore: number;
|
|
46
|
+
readonly recencyScore: number;
|
|
47
|
+
/** RRF (Reciprocal Rank Fusion) score from combining BM25 and vector rankings */
|
|
48
|
+
readonly rrfScore: number;
|
|
49
|
+
/** Rank in BM25 results (1-indexed, 0 if not in BM25 results) */
|
|
50
|
+
readonly bm25Rank: number;
|
|
51
|
+
/** Rank in vector similarity results (1-indexed, 0 if not in vector results) */
|
|
52
|
+
readonly vectorRank: number;
|
|
53
|
+
/** LLM reranker score (0-1, optional - only present when reranking is applied) */
|
|
54
|
+
readonly rerankerScore?: number;
|
|
55
|
+
/** Number of hops from seed (0 = direct match from RRF, 1+ = expanded via graph) */
|
|
56
|
+
readonly expansionHops?: number;
|
|
57
|
+
/** Path of learning IDs from seed to this learning (only for expanded results) */
|
|
58
|
+
readonly expansionPath?: readonly LearningId[];
|
|
59
|
+
/** Edge type that led to this learning (null for direct matches) */
|
|
60
|
+
readonly sourceEdge?: EdgeType | null;
|
|
61
|
+
/** Feedback score from historical usage (0-1, 0.5 = neutral, optional) */
|
|
62
|
+
readonly feedbackScore?: number;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Input for creating a new learning.
|
|
66
|
+
*/
|
|
67
|
+
export interface CreateLearningInput {
|
|
68
|
+
readonly content: string;
|
|
69
|
+
readonly sourceType?: LearningSourceType;
|
|
70
|
+
readonly sourceRef?: string | null;
|
|
71
|
+
readonly keywords?: string[];
|
|
72
|
+
readonly category?: string | null;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Input for updating an existing learning.
|
|
76
|
+
*/
|
|
77
|
+
export interface UpdateLearningInput {
|
|
78
|
+
readonly usageCount?: number;
|
|
79
|
+
readonly lastUsedAt?: Date;
|
|
80
|
+
readonly outcomeScore?: number;
|
|
81
|
+
readonly embedding?: Float32Array;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Options for graph expansion during search.
|
|
85
|
+
* See PRD-016 for specification.
|
|
86
|
+
*/
|
|
87
|
+
export interface GraphExpansionQueryOptions {
|
|
88
|
+
/** Enable graph expansion (default: false) */
|
|
89
|
+
readonly enabled: boolean;
|
|
90
|
+
/** Maximum traversal depth (default: 2) */
|
|
91
|
+
readonly depth?: number;
|
|
92
|
+
/** Score decay factor per hop (default: 0.7) */
|
|
93
|
+
readonly decayFactor?: number;
|
|
94
|
+
/** Maximum nodes to return from expansion (default: 100) */
|
|
95
|
+
readonly maxNodes?: number;
|
|
96
|
+
/** Filter by specific edge types (default: all types) */
|
|
97
|
+
readonly edgeTypes?: readonly EdgeType[];
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Query options for learning searches.
|
|
101
|
+
*/
|
|
102
|
+
export interface LearningQuery {
|
|
103
|
+
readonly query: string;
|
|
104
|
+
readonly limit?: number;
|
|
105
|
+
readonly minScore?: number;
|
|
106
|
+
readonly category?: string;
|
|
107
|
+
readonly sourceType?: LearningSourceType;
|
|
108
|
+
/** Graph expansion options for traversing related learnings */
|
|
109
|
+
readonly graphExpansion?: GraphExpansionQueryOptions;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Options for context retrieval.
|
|
113
|
+
*/
|
|
114
|
+
export interface ContextOptions {
|
|
115
|
+
/** Enable graph expansion (default: false) */
|
|
116
|
+
readonly useGraph?: boolean;
|
|
117
|
+
/** Graph expansion depth (default: 2 per PRD-016) */
|
|
118
|
+
readonly expansionDepth?: number;
|
|
119
|
+
/** Edge types to include in expansion */
|
|
120
|
+
readonly edgeTypes?: readonly EdgeType[];
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Statistics about graph expansion during context retrieval.
|
|
124
|
+
*/
|
|
125
|
+
export interface GraphExpansionStats {
|
|
126
|
+
readonly enabled: boolean;
|
|
127
|
+
readonly seedCount: number;
|
|
128
|
+
readonly expandedCount: number;
|
|
129
|
+
readonly maxDepthReached: number;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Result of context retrieval for a task.
|
|
133
|
+
*/
|
|
134
|
+
export interface ContextResult {
|
|
135
|
+
readonly taskId: string;
|
|
136
|
+
readonly taskTitle: string;
|
|
137
|
+
readonly learnings: readonly LearningWithScore[];
|
|
138
|
+
readonly searchQuery: string;
|
|
139
|
+
readonly searchDuration: number;
|
|
140
|
+
/** Graph expansion statistics (only present when useGraph=true) */
|
|
141
|
+
readonly graphExpansion?: GraphExpansionStats;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Result of a learning search operation.
|
|
145
|
+
*/
|
|
146
|
+
export interface LearningSearchResult {
|
|
147
|
+
readonly learnings: readonly Learning[];
|
|
148
|
+
readonly query: string;
|
|
149
|
+
readonly searchDuration: number;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Database row type for learnings (snake_case from SQLite).
|
|
153
|
+
*/
|
|
154
|
+
export interface LearningRow {
|
|
155
|
+
id: number;
|
|
156
|
+
content: string;
|
|
157
|
+
source_type: string;
|
|
158
|
+
source_ref: string | null;
|
|
159
|
+
created_at: string;
|
|
160
|
+
keywords: string | null;
|
|
161
|
+
category: string | null;
|
|
162
|
+
usage_count: number;
|
|
163
|
+
last_used_at: string | null;
|
|
164
|
+
outcome_score: number | null;
|
|
165
|
+
embedding: Buffer | null;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Options for MMR (Maximal Marginal Relevance) diversification.
|
|
169
|
+
* Balances relevance with diversity to avoid redundant results.
|
|
170
|
+
* See PRD-017 for specification.
|
|
171
|
+
*/
|
|
172
|
+
export interface DiversificationOptions {
|
|
173
|
+
/** Enable MMR diversification (default: false) */
|
|
174
|
+
readonly enabled?: boolean;
|
|
175
|
+
/** Trade-off between relevance (1.0) and diversity (0.0) (default: 0.7) */
|
|
176
|
+
readonly lambda?: number;
|
|
177
|
+
/** Maximum results per category for top 5 results (default: 2) */
|
|
178
|
+
readonly maxPerCategory?: number;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Options for retrieval operations.
|
|
182
|
+
* Used by RetrieverService.search() and custom retrievers.
|
|
183
|
+
*/
|
|
184
|
+
export interface RetrievalOptions {
|
|
185
|
+
/** Maximum number of results to return (default: 10) */
|
|
186
|
+
readonly limit?: number;
|
|
187
|
+
/** Minimum relevance score threshold (default: 0.1) */
|
|
188
|
+
readonly minScore?: number;
|
|
189
|
+
/** Optional category filter */
|
|
190
|
+
readonly category?: string;
|
|
191
|
+
/** Optional source type filter */
|
|
192
|
+
readonly sourceType?: LearningSourceType;
|
|
193
|
+
/** Graph expansion options for traversing related learnings */
|
|
194
|
+
readonly graphExpansion?: GraphExpansionQueryOptions;
|
|
195
|
+
/** MMR diversification options for result variety */
|
|
196
|
+
readonly diversification?: DiversificationOptions;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Learning row with BM25 score from FTS5 query.
|
|
200
|
+
*/
|
|
201
|
+
export interface LearningRowWithBM25 extends LearningRow {
|
|
202
|
+
bm25_score: number;
|
|
203
|
+
}
|
|
204
|
+
//# sourceMappingURL=learning.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"learning.d.ts","sourceRoot":"","sources":["../src/learning.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAEzC;;GAEG;AACH,eAAO,MAAM,qBAAqB,uDAKxB,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAExE;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,MAAM,CAAA;CAAE,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC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-010 and DD-010 for specification.
|
|
6
|
+
* Zero runtime dependencies - pure TypeScript types only.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Valid learning source types.
|
|
10
|
+
*/
|
|
11
|
+
export const LEARNING_SOURCE_TYPES = [
|
|
12
|
+
"compaction",
|
|
13
|
+
"run",
|
|
14
|
+
"manual",
|
|
15
|
+
"claude_md",
|
|
16
|
+
];
|
|
17
|
+
//# sourceMappingURL=learning.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"learning.js","sourceRoot":"","sources":["../src/learning.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,YAAY;IACZ,KAAK;IACL,QAAQ;IACR,WAAW;CACH,CAAC"}
|
package/dist/run.d.ts
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run types for tx
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for tracking Claude agent runs/sessions.
|
|
5
|
+
* Zero runtime dependencies - pure TypeScript types only.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Run ID format: run-<8 hex chars>
|
|
9
|
+
*/
|
|
10
|
+
export type RunId = `run-${string}`;
|
|
11
|
+
/**
|
|
12
|
+
* Valid run statuses.
|
|
13
|
+
*/
|
|
14
|
+
export declare const RUN_STATUSES: readonly ["running", "completed", "failed", "timeout", "cancelled"];
|
|
15
|
+
/**
|
|
16
|
+
* Run status - current state of an agent run.
|
|
17
|
+
*/
|
|
18
|
+
export type RunStatus = (typeof RUN_STATUSES)[number];
|
|
19
|
+
/**
|
|
20
|
+
* A single Claude agent run/session.
|
|
21
|
+
*/
|
|
22
|
+
export interface Run {
|
|
23
|
+
readonly id: RunId;
|
|
24
|
+
readonly taskId: string | null;
|
|
25
|
+
readonly agent: string;
|
|
26
|
+
readonly startedAt: Date;
|
|
27
|
+
readonly endedAt: Date | null;
|
|
28
|
+
readonly status: RunStatus;
|
|
29
|
+
readonly exitCode: number | null;
|
|
30
|
+
readonly pid: number | null;
|
|
31
|
+
readonly transcriptPath: string | null;
|
|
32
|
+
readonly contextInjected: string | null;
|
|
33
|
+
readonly summary: string | null;
|
|
34
|
+
readonly errorMessage: string | null;
|
|
35
|
+
readonly metadata: Record<string, unknown>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Input for creating a new run.
|
|
39
|
+
*/
|
|
40
|
+
export interface CreateRunInput {
|
|
41
|
+
readonly taskId?: string;
|
|
42
|
+
readonly agent: string;
|
|
43
|
+
readonly pid?: number;
|
|
44
|
+
readonly transcriptPath?: string;
|
|
45
|
+
readonly contextInjected?: string;
|
|
46
|
+
readonly metadata?: Record<string, unknown>;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Input for updating an existing run.
|
|
50
|
+
*/
|
|
51
|
+
export interface UpdateRunInput {
|
|
52
|
+
readonly status?: RunStatus;
|
|
53
|
+
readonly endedAt?: Date;
|
|
54
|
+
readonly exitCode?: number;
|
|
55
|
+
readonly summary?: string;
|
|
56
|
+
readonly errorMessage?: string;
|
|
57
|
+
readonly transcriptPath?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Database row type for runs (snake_case from SQLite).
|
|
61
|
+
*/
|
|
62
|
+
export interface RunRow {
|
|
63
|
+
id: string;
|
|
64
|
+
task_id: string | null;
|
|
65
|
+
agent: string;
|
|
66
|
+
started_at: string;
|
|
67
|
+
ended_at: string | null;
|
|
68
|
+
status: string;
|
|
69
|
+
exit_code: number | null;
|
|
70
|
+
pid: number | null;
|
|
71
|
+
transcript_path: string | null;
|
|
72
|
+
context_injected: string | null;
|
|
73
|
+
summary: string | null;
|
|
74
|
+
error_message: string | null;
|
|
75
|
+
metadata: string;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":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AM,CAAC;IACjC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC7C;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;CAClB"}
|
package/dist/run.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run types for tx
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for tracking Claude agent runs/sessions.
|
|
5
|
+
* Zero runtime dependencies - pure TypeScript types only.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Valid run statuses.
|
|
9
|
+
*/
|
|
10
|
+
export const RUN_STATUSES = [
|
|
11
|
+
"running",
|
|
12
|
+
"completed",
|
|
13
|
+
"failed",
|
|
14
|
+
"timeout",
|
|
15
|
+
"cancelled",
|
|
16
|
+
];
|
|
17
|
+
//# sourceMappingURL=run.js.map
|
package/dist/run.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,SAAS;IACT,WAAW;IACX,QAAQ;IACR,SAAS;IACT,WAAW;CACH,CAAC"}
|