@jamesaphoenix/tx-types 0.4.3 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jamesaphoenix/tx-types",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "Shared TypeScript types for tx - Effect Schema definitions",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -29,6 +29,26 @@
29
29
  "./run": {
30
30
  "types": "./dist/run.d.ts",
31
31
  "import": "./dist/run.js"
32
+ },
33
+ "./response": {
34
+ "types": "./dist/response.d.ts",
35
+ "import": "./dist/response.js"
36
+ },
37
+ "./doc": {
38
+ "types": "./dist/doc.d.ts",
39
+ "import": "./dist/doc.js"
40
+ },
41
+ "./cycle": {
42
+ "types": "./dist/cycle.d.ts",
43
+ "import": "./dist/cycle.js"
44
+ },
45
+ "./deduplication": {
46
+ "types": "./dist/deduplication.d.ts",
47
+ "import": "./dist/deduplication.js"
48
+ },
49
+ "./tracked-project": {
50
+ "types": "./dist/tracked-project.d.ts",
51
+ "import": "./dist/tracked-project.js"
32
52
  }
33
53
  },
34
54
  "files": [
package/dist/anchor.d.ts DELETED
@@ -1,150 +0,0 @@
1
- /**
2
- * Anchor types for tx
3
- *
4
- * Type definitions for file/code associations (anchors) that link learnings
5
- * to specific file locations, symbols, or code regions.
6
- * Core type definitions using Effect Schema (Doctrine Rule 10).
7
- * Schema definitions provide both compile-time types and runtime validation.
8
- */
9
- import { Schema } from "effect";
10
- /**
11
- * Anchor type - how the learning is associated with code.
12
- * - glob: Pattern match (e.g., "src/repo/*.ts")
13
- * - hash: Content hash of specific lines
14
- * - symbol: Named code element (function, class, etc.)
15
- * - line_range: Specific line numbers
16
- */
17
- export declare const ANCHOR_TYPES: readonly ["glob", "hash", "symbol", "line_range"];
18
- /**
19
- * Anchor status - validity of the file/code association.
20
- * - valid: Anchor still points to correct code
21
- * - drifted: Code has changed but anchor still exists
22
- * - invalid: Anchor no longer valid (file deleted, symbol removed)
23
- */
24
- export declare const ANCHOR_STATUSES: readonly ["valid", "drifted", "invalid"];
25
- /**
26
- * Detection source for invalidation.
27
- */
28
- export declare const INVALIDATION_SOURCES: readonly ["periodic", "lazy", "manual", "agent", "git_hook"];
29
- /** Anchor ID - branded integer. */
30
- export declare const AnchorIdSchema: Schema.brand<Schema.filter<typeof Schema.Number>, "AnchorId">;
31
- export type AnchorId = typeof AnchorIdSchema.Type;
32
- /** Anchor type schema. */
33
- export declare const AnchorTypeSchema: Schema.Literal<["glob", "hash", "symbol", "line_range"]>;
34
- export type AnchorType = typeof AnchorTypeSchema.Type;
35
- /** Anchor status schema. */
36
- export declare const AnchorStatusSchema: Schema.Literal<["valid", "drifted", "invalid"]>;
37
- export type AnchorStatus = typeof AnchorStatusSchema.Type;
38
- /** Invalidation source schema. */
39
- export declare const InvalidationSourceSchema: Schema.Literal<["periodic", "lazy", "manual", "agent", "git_hook"]>;
40
- export type InvalidationSource = typeof InvalidationSourceSchema.Type;
41
- /** Anchor entity - links a learning to a file/code location. */
42
- export declare const AnchorSchema: Schema.Struct<{
43
- id: Schema.brand<Schema.filter<typeof Schema.Number>, "AnchorId">;
44
- learningId: Schema.filter<typeof Schema.Number>;
45
- anchorType: Schema.Literal<["glob", "hash", "symbol", "line_range"]>;
46
- anchorValue: typeof Schema.String;
47
- filePath: typeof Schema.String;
48
- symbolFqname: Schema.NullOr<typeof Schema.String>;
49
- lineStart: Schema.NullOr<Schema.filter<typeof Schema.Number>>;
50
- lineEnd: Schema.NullOr<Schema.filter<typeof Schema.Number>>;
51
- contentHash: Schema.NullOr<typeof Schema.String>;
52
- /** Original content preview for self-healing Jaccard similarity comparison */
53
- contentPreview: Schema.NullOr<typeof Schema.String>;
54
- status: Schema.Literal<["valid", "drifted", "invalid"]>;
55
- pinned: typeof Schema.Boolean;
56
- verifiedAt: Schema.NullOr<typeof Schema.DateFromSelf>;
57
- createdAt: typeof Schema.DateFromSelf;
58
- }>;
59
- export type Anchor = typeof AnchorSchema.Type;
60
- /** Input for creating a new anchor. */
61
- export declare const CreateAnchorInputSchema: Schema.Struct<{
62
- learningId: Schema.filter<typeof Schema.Number>;
63
- anchorType: Schema.Literal<["glob", "hash", "symbol", "line_range"]>;
64
- anchorValue: typeof Schema.String;
65
- filePath: typeof Schema.String;
66
- symbolFqname: Schema.optional<Schema.NullOr<typeof Schema.String>>;
67
- lineStart: Schema.optional<Schema.NullOr<Schema.filter<typeof Schema.Number>>>;
68
- lineEnd: Schema.optional<Schema.NullOr<Schema.filter<typeof Schema.Number>>>;
69
- contentHash: Schema.optional<Schema.NullOr<typeof Schema.String>>;
70
- /** Original content preview for self-healing comparison (max ~500 chars) */
71
- contentPreview: Schema.optional<Schema.NullOr<typeof Schema.String>>;
72
- }>;
73
- export type CreateAnchorInput = typeof CreateAnchorInputSchema.Type;
74
- /** Input for updating an anchor. */
75
- export declare const UpdateAnchorInputSchema: Schema.Struct<{
76
- anchorValue: Schema.optional<typeof Schema.String>;
77
- filePath: Schema.optional<typeof Schema.String>;
78
- symbolFqname: Schema.optional<Schema.NullOr<typeof Schema.String>>;
79
- lineStart: Schema.optional<Schema.NullOr<Schema.filter<typeof Schema.Number>>>;
80
- lineEnd: Schema.optional<Schema.NullOr<Schema.filter<typeof Schema.Number>>>;
81
- contentHash: Schema.optional<Schema.NullOr<typeof Schema.String>>;
82
- /** Updated content preview for self-healing comparison */
83
- contentPreview: Schema.optional<Schema.NullOr<typeof Schema.String>>;
84
- status: Schema.optional<Schema.Literal<["valid", "drifted", "invalid"]>>;
85
- verifiedAt: Schema.optional<Schema.NullOr<typeof Schema.DateFromSelf>>;
86
- }>;
87
- export type UpdateAnchorInput = typeof UpdateAnchorInputSchema.Type;
88
- /** Invalidation log entry - tracks anchor status changes. */
89
- export declare const InvalidationLogSchema: Schema.Struct<{
90
- id: Schema.filter<typeof Schema.Number>;
91
- anchorId: Schema.filter<typeof Schema.Number>;
92
- oldStatus: Schema.Literal<["valid", "drifted", "invalid"]>;
93
- newStatus: Schema.Literal<["valid", "drifted", "invalid"]>;
94
- reason: typeof Schema.String;
95
- detectedBy: Schema.Literal<["periodic", "lazy", "manual", "agent", "git_hook"]>;
96
- oldContentHash: Schema.NullOr<typeof Schema.String>;
97
- newContentHash: Schema.NullOr<typeof Schema.String>;
98
- similarityScore: Schema.NullOr<typeof Schema.Number>;
99
- invalidatedAt: typeof Schema.DateFromSelf;
100
- }>;
101
- export type InvalidationLog = typeof InvalidationLogSchema.Type;
102
- /**
103
- * Anchor with freshness information for lazy verification.
104
- * Returned by getWithVerification - includes whether anchor was fresh or verified.
105
- */
106
- export interface AnchorWithFreshness {
107
- readonly anchor: Anchor;
108
- /** True if anchor was still within TTL, false if verification was needed */
109
- readonly isFresh: boolean;
110
- /** True if verification was performed (because anchor was stale) */
111
- readonly wasVerified: boolean;
112
- /** Verification result if verification was performed */
113
- readonly verificationResult?: {
114
- readonly previousStatus: AnchorStatus;
115
- readonly newStatus: AnchorStatus;
116
- readonly action: "unchanged" | "self_healed" | "drifted" | "invalidated";
117
- readonly reason?: string;
118
- };
119
- }
120
- /** Database row type for anchors (snake_case from SQLite). */
121
- export interface AnchorRow {
122
- id: number;
123
- learning_id: number;
124
- anchor_type: string;
125
- anchor_value: string;
126
- file_path: string;
127
- symbol_fqname: string | null;
128
- line_start: number | null;
129
- line_end: number | null;
130
- content_hash: string | null;
131
- content_preview: string | null;
132
- status: string;
133
- pinned: number;
134
- verified_at: string | null;
135
- created_at: string;
136
- }
137
- /** Database row type for invalidation log (snake_case from SQLite). */
138
- export interface InvalidationLogRow {
139
- id: number;
140
- anchor_id: number;
141
- old_status: string;
142
- new_status: string;
143
- reason: string;
144
- detected_by: string;
145
- old_content_hash: string | null;
146
- new_content_hash: string | null;
147
- similarity_score: number | null;
148
- invalidated_at: string;
149
- }
150
- //# sourceMappingURL=anchor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":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ClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,cAAc,EAAE,MAAM,CAAC;CACxB"}
package/dist/anchor.js DELETED
@@ -1,100 +0,0 @@
1
- /**
2
- * Anchor types for tx
3
- *
4
- * Type definitions for file/code associations (anchors) that link learnings
5
- * to specific file locations, symbols, or code regions.
6
- * Core type definitions using Effect Schema (Doctrine Rule 10).
7
- * Schema definitions provide both compile-time types and runtime validation.
8
- */
9
- import { Schema } from "effect";
10
- // =============================================================================
11
- // CONSTANTS
12
- // =============================================================================
13
- /**
14
- * Anchor type - how the learning is associated with code.
15
- * - glob: Pattern match (e.g., "src/repo/*.ts")
16
- * - hash: Content hash of specific lines
17
- * - symbol: Named code element (function, class, etc.)
18
- * - line_range: Specific line numbers
19
- */
20
- export const ANCHOR_TYPES = ["glob", "hash", "symbol", "line_range"];
21
- /**
22
- * Anchor status - validity of the file/code association.
23
- * - valid: Anchor still points to correct code
24
- * - drifted: Code has changed but anchor still exists
25
- * - invalid: Anchor no longer valid (file deleted, symbol removed)
26
- */
27
- export const ANCHOR_STATUSES = ["valid", "drifted", "invalid"];
28
- /**
29
- * Detection source for invalidation.
30
- */
31
- export const INVALIDATION_SOURCES = ["periodic", "lazy", "manual", "agent", "git_hook"];
32
- // =============================================================================
33
- // SCHEMAS & TYPES
34
- // =============================================================================
35
- /** Anchor ID - branded integer. */
36
- export const AnchorIdSchema = Schema.Number.pipe(Schema.int(), Schema.brand("AnchorId"));
37
- /** Anchor type schema. */
38
- export const AnchorTypeSchema = Schema.Literal(...ANCHOR_TYPES);
39
- /** Anchor status schema. */
40
- export const AnchorStatusSchema = Schema.Literal(...ANCHOR_STATUSES);
41
- /** Invalidation source schema. */
42
- export const InvalidationSourceSchema = Schema.Literal(...INVALIDATION_SOURCES);
43
- /** Anchor entity - links a learning to a file/code location. */
44
- export const AnchorSchema = Schema.Struct({
45
- id: AnchorIdSchema,
46
- learningId: Schema.Number.pipe(Schema.int()),
47
- anchorType: AnchorTypeSchema,
48
- anchorValue: Schema.String,
49
- filePath: Schema.String,
50
- symbolFqname: Schema.NullOr(Schema.String),
51
- lineStart: Schema.NullOr(Schema.Number.pipe(Schema.int())),
52
- lineEnd: Schema.NullOr(Schema.Number.pipe(Schema.int())),
53
- contentHash: Schema.NullOr(Schema.String),
54
- /** Original content preview for self-healing Jaccard similarity comparison */
55
- contentPreview: Schema.NullOr(Schema.String),
56
- status: AnchorStatusSchema,
57
- pinned: Schema.Boolean,
58
- verifiedAt: Schema.NullOr(Schema.DateFromSelf),
59
- createdAt: Schema.DateFromSelf,
60
- });
61
- /** Input for creating a new anchor. */
62
- export const CreateAnchorInputSchema = Schema.Struct({
63
- learningId: Schema.Number.pipe(Schema.int()),
64
- anchorType: AnchorTypeSchema,
65
- anchorValue: Schema.String,
66
- filePath: Schema.String,
67
- symbolFqname: Schema.optional(Schema.NullOr(Schema.String)),
68
- lineStart: Schema.optional(Schema.NullOr(Schema.Number.pipe(Schema.int()))),
69
- lineEnd: Schema.optional(Schema.NullOr(Schema.Number.pipe(Schema.int()))),
70
- contentHash: Schema.optional(Schema.NullOr(Schema.String)),
71
- /** Original content preview for self-healing comparison (max ~500 chars) */
72
- contentPreview: Schema.optional(Schema.NullOr(Schema.String)),
73
- });
74
- /** Input for updating an anchor. */
75
- export const UpdateAnchorInputSchema = Schema.Struct({
76
- anchorValue: Schema.optional(Schema.String),
77
- filePath: Schema.optional(Schema.String),
78
- symbolFqname: Schema.optional(Schema.NullOr(Schema.String)),
79
- lineStart: Schema.optional(Schema.NullOr(Schema.Number.pipe(Schema.int()))),
80
- lineEnd: Schema.optional(Schema.NullOr(Schema.Number.pipe(Schema.int()))),
81
- contentHash: Schema.optional(Schema.NullOr(Schema.String)),
82
- /** Updated content preview for self-healing comparison */
83
- contentPreview: Schema.optional(Schema.NullOr(Schema.String)),
84
- status: Schema.optional(AnchorStatusSchema),
85
- verifiedAt: Schema.optional(Schema.NullOr(Schema.DateFromSelf)),
86
- });
87
- /** Invalidation log entry - tracks anchor status changes. */
88
- export const InvalidationLogSchema = Schema.Struct({
89
- id: Schema.Number.pipe(Schema.int()),
90
- anchorId: Schema.Number.pipe(Schema.int()),
91
- oldStatus: AnchorStatusSchema,
92
- newStatus: AnchorStatusSchema,
93
- reason: Schema.String,
94
- detectedBy: InvalidationSourceSchema,
95
- oldContentHash: Schema.NullOr(Schema.String),
96
- newContentHash: Schema.NullOr(Schema.String),
97
- similarityScore: Schema.NullOr(Schema.Number),
98
- invalidatedAt: Schema.DateFromSelf,
99
- });
100
- //# sourceMappingURL=anchor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"anchor.js","sourceRoot":"","sources":["../src/anchor.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,gFAAgF;AAChF,YAAY;AACZ,gFAAgF;AAEhF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,CAAU,CAAC;AAE9E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,CAAU,CAAC;AAExE;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,CAAU,CAAC;AAEjG,gFAAgF;AAChF,kBAAkB;AAClB,gFAAgF;AAEhF,mCAAmC;AACnC,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAC9C,MAAM,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EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;IAC7C,aAAa,EAAE,MAAM,CAAC,YAAY;CACnC,CAAC,CAAA"}
@@ -1,175 +0,0 @@
1
- /**
2
- * @tx/types/candidate - Learning candidate types for transcript extraction
3
- *
4
- * Learning candidates are potential learnings extracted from Claude Code
5
- * transcripts that await promotion to the learnings table.
6
- * Core type definitions using Effect Schema (Doctrine Rule 10).
7
- *
8
- * @see PRD-015 for the JSONL daemon and knowledge promotion pipeline
9
- */
10
- import { Schema } from "effect";
11
- /**
12
- * All valid confidence levels.
13
- */
14
- export declare const CANDIDATE_CONFIDENCES: readonly ["high", "medium", "low"];
15
- /**
16
- * All valid candidate categories.
17
- */
18
- export declare const CANDIDATE_CATEGORIES: readonly ["architecture", "testing", "performance", "security", "debugging", "tooling", "patterns", "other"];
19
- /**
20
- * All valid candidate statuses.
21
- */
22
- export declare const CANDIDATE_STATUSES: readonly ["pending", "promoted", "rejected", "merged"];
23
- /** Confidence level for extracted learning candidates. */
24
- export declare const CandidateConfidenceSchema: Schema.Literal<["high", "medium", "low"]>;
25
- export type CandidateConfidence = typeof CandidateConfidenceSchema.Type;
26
- /** Category of the extracted learning. */
27
- export declare const CandidateCategorySchema: Schema.Literal<["architecture", "testing", "performance", "security", "debugging", "tooling", "patterns", "other"]>;
28
- export type CandidateCategory = typeof CandidateCategorySchema.Type;
29
- /** Status of a learning candidate in the promotion pipeline. */
30
- export declare const CandidateStatusSchema: Schema.Literal<["pending", "promoted", "rejected", "merged"]>;
31
- export type CandidateStatus = typeof CandidateStatusSchema.Type;
32
- /** Unique identifier for a stored learning candidate. */
33
- export type CandidateId = number;
34
- /** A chunk of transcript content to be analyzed for learning extraction. */
35
- export declare const TranscriptChunkSchema: Schema.Struct<{
36
- /** The transcript text content to analyze */
37
- content: typeof Schema.String;
38
- /** Source file path (e.g., ~/.claude/projects/foo/session.jsonl) */
39
- sourceFile: typeof Schema.String;
40
- /** Optional run ID for provenance tracking */
41
- sourceRunId: Schema.optional<Schema.NullOr<typeof Schema.String>>;
42
- /** Optional task ID for provenance tracking */
43
- sourceTaskId: Schema.optional<Schema.NullOr<typeof Schema.String>>;
44
- /** Byte offset in source file (for incremental processing) */
45
- byteOffset: Schema.optional<Schema.filter<typeof Schema.Number>>;
46
- /** Line number range in source file */
47
- lineRange: Schema.optional<Schema.Struct<{
48
- start: Schema.filter<typeof Schema.Number>;
49
- end: Schema.filter<typeof Schema.Number>;
50
- }>>;
51
- }>;
52
- export type TranscriptChunk = typeof TranscriptChunkSchema.Type;
53
- /** A learning candidate extracted from a transcript by the LLM. */
54
- export declare const ExtractedCandidateSchema: Schema.Struct<{
55
- /** The learning text (1-3 sentences, actionable) */
56
- content: typeof Schema.String;
57
- /** Confidence level assigned by the LLM */
58
- confidence: Schema.Literal<["high", "medium", "low"]>;
59
- /** Category of the learning */
60
- category: Schema.Literal<["architecture", "testing", "performance", "security", "debugging", "tooling", "patterns", "other"]>;
61
- }>;
62
- export type ExtractedCandidate = typeof ExtractedCandidateSchema.Type;
63
- /** A learning candidate stored in the database. */
64
- export declare const LearningCandidateSchema: Schema.Struct<{
65
- /** Unique database ID */
66
- id: Schema.filter<typeof Schema.Number>;
67
- /** The learning text (1-3 sentences, actionable) */
68
- content: typeof Schema.String;
69
- /** Confidence level assigned by the LLM */
70
- confidence: Schema.Literal<["high", "medium", "low"]>;
71
- /** Category of the learning */
72
- category: Schema.NullOr<Schema.Literal<["architecture", "testing", "performance", "security", "debugging", "tooling", "patterns", "other"]>>;
73
- /** Source JSONL file path */
74
- sourceFile: typeof Schema.String;
75
- /** Source run ID for provenance */
76
- sourceRunId: Schema.NullOr<typeof Schema.String>;
77
- /** Source task ID for provenance */
78
- sourceTaskId: Schema.NullOr<typeof Schema.String>;
79
- /** When the candidate was extracted */
80
- extractedAt: typeof Schema.DateFromSelf;
81
- /** Current status in promotion pipeline */
82
- status: Schema.Literal<["pending", "promoted", "rejected", "merged"]>;
83
- /** When the candidate was reviewed */
84
- reviewedAt: Schema.NullOr<typeof Schema.DateFromSelf>;
85
- /** Who reviewed ('auto' or user identifier) */
86
- reviewedBy: Schema.NullOr<typeof Schema.String>;
87
- /** ID of promoted learning (if promoted or merged) */
88
- promotedLearningId: Schema.NullOr<Schema.filter<typeof Schema.Number>>;
89
- /** Reason for rejection (if rejected) */
90
- rejectionReason: Schema.NullOr<typeof Schema.String>;
91
- }>;
92
- export type LearningCandidate = typeof LearningCandidateSchema.Type;
93
- /** Input for creating a new learning candidate. */
94
- export declare const CreateCandidateInputSchema: Schema.Struct<{
95
- content: typeof Schema.String;
96
- confidence: Schema.Literal<["high", "medium", "low"]>;
97
- category: Schema.optional<Schema.NullOr<Schema.Literal<["architecture", "testing", "performance", "security", "debugging", "tooling", "patterns", "other"]>>>;
98
- sourceFile: typeof Schema.String;
99
- sourceRunId: Schema.optional<Schema.NullOr<typeof Schema.String>>;
100
- sourceTaskId: Schema.optional<Schema.NullOr<typeof Schema.String>>;
101
- }>;
102
- export type CreateCandidateInput = typeof CreateCandidateInputSchema.Type;
103
- /** Input for updating a learning candidate. */
104
- export declare const UpdateCandidateInputSchema: Schema.Struct<{
105
- status: Schema.optional<Schema.Literal<["pending", "promoted", "rejected", "merged"]>>;
106
- reviewedAt: Schema.optional<typeof Schema.DateFromSelf>;
107
- reviewedBy: Schema.optional<typeof Schema.String>;
108
- promotedLearningId: Schema.optional<Schema.filter<typeof Schema.Number>>;
109
- rejectionReason: Schema.optional<typeof Schema.String>;
110
- }>;
111
- export type UpdateCandidateInput = typeof UpdateCandidateInputSchema.Type;
112
- /** Filter options for querying learning candidates. */
113
- export declare const CandidateFilterSchema: Schema.Struct<{
114
- status: Schema.optional<Schema.Union<[Schema.Literal<["pending", "promoted", "rejected", "merged"]>, Schema.Array$<Schema.Literal<["pending", "promoted", "rejected", "merged"]>>]>>;
115
- confidence: Schema.optional<Schema.Union<[Schema.Literal<["high", "medium", "low"]>, Schema.Array$<Schema.Literal<["high", "medium", "low"]>>]>>;
116
- category: Schema.optional<Schema.Union<[Schema.Literal<["architecture", "testing", "performance", "security", "debugging", "tooling", "patterns", "other"]>, Schema.Array$<Schema.Literal<["architecture", "testing", "performance", "security", "debugging", "tooling", "patterns", "other"]>>]>>;
117
- sourceFile: Schema.optional<typeof Schema.String>;
118
- sourceRunId: Schema.optional<typeof Schema.String>;
119
- sourceTaskId: Schema.optional<typeof Schema.String>;
120
- limit: Schema.optional<Schema.filter<typeof Schema.Number>>;
121
- offset: Schema.optional<Schema.filter<typeof Schema.Number>>;
122
- }>;
123
- export type CandidateFilter = typeof CandidateFilterSchema.Type;
124
- /** Result of candidate extraction from a transcript chunk. */
125
- export declare const ExtractionResultSchema: Schema.Struct<{
126
- candidates: Schema.Array$<Schema.Struct<{
127
- /** The learning text (1-3 sentences, actionable) */
128
- content: typeof Schema.String;
129
- /** Confidence level assigned by the LLM */
130
- confidence: Schema.Literal<["high", "medium", "low"]>;
131
- /** Category of the learning */
132
- category: Schema.Literal<["architecture", "testing", "performance", "security", "debugging", "tooling", "patterns", "other"]>;
133
- }>>;
134
- sourceChunk: Schema.Struct<{
135
- /** The transcript text content to analyze */
136
- content: typeof Schema.String;
137
- /** Source file path (e.g., ~/.claude/projects/foo/session.jsonl) */
138
- sourceFile: typeof Schema.String;
139
- /** Optional run ID for provenance tracking */
140
- sourceRunId: Schema.optional<Schema.NullOr<typeof Schema.String>>;
141
- /** Optional task ID for provenance tracking */
142
- sourceTaskId: Schema.optional<Schema.NullOr<typeof Schema.String>>;
143
- /** Byte offset in source file (for incremental processing) */
144
- byteOffset: Schema.optional<Schema.filter<typeof Schema.Number>>;
145
- /** Line number range in source file */
146
- lineRange: Schema.optional<Schema.Struct<{
147
- start: Schema.filter<typeof Schema.Number>;
148
- end: Schema.filter<typeof Schema.Number>;
149
- }>>;
150
- }>;
151
- wasExtracted: typeof Schema.Boolean;
152
- metadata: Schema.optional<Schema.Struct<{
153
- model: Schema.optional<typeof Schema.String>;
154
- tokensUsed: Schema.optional<Schema.filter<typeof Schema.Number>>;
155
- durationMs: Schema.optional<typeof Schema.Number>;
156
- }>>;
157
- }>;
158
- export type ExtractionResult = typeof ExtractionResultSchema.Type;
159
- /** Database row representation for learning_candidates table. */
160
- export interface CandidateRow {
161
- readonly id: number;
162
- readonly content: string;
163
- readonly confidence: string;
164
- readonly category: string | null;
165
- readonly source_file: string;
166
- readonly source_run_id: string | null;
167
- readonly source_task_id: string | null;
168
- readonly extracted_at: string;
169
- readonly status: string;
170
- readonly reviewed_at: string | null;
171
- readonly reviewed_by: string | null;
172
- readonly promoted_learning_id: number | null;
173
- readonly rejection_reason: string | null;
174
- }
175
- //# sourceMappingURL=candidate.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"candidate.d.ts","sourceRoot":"","sources":["../src/candidate.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAM/B;;GAEG;AACH,eAAO,MAAM,qBAAqB,oCAAqC,CAAA;AAEvE;;GAEG;AACH,eAAO,MAAM,oBAAoB,8GASvB,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,kBAAkB,wDAAyD,CAAA;AAMxF,0DAA0D;AAC1D,eAAO,MAAM,yBAAyB,2CAA2C,CAAA;AACjF,MAAM,MAAM,mBAAmB,GAAG,OAAO,yBAAyB,CAAC,IAAI,CAAA;AAEvE,0CAA0C;AAC1C,eAAO,MAAM,uBAAuB,qHAA0C,CAAA;AAC9E,MAAM,MAAM,iBAAiB,GAAG,OAAO,uBAAuB,CAAC,IAAI,CAAA;AAEnE,gEAAgE;AAChE,eAAO,MAAM,qBAAqB,+DAAwC,CAAA;AAC1E,MAAM,MAAM,eAAe,GAAG,OAAO,qBAAqB,CAAC,IAAI,CAAA;AAE/D,yDAAyD;AACzD,MAAM,MAAM,WAAW,GAAG,MAAM,CAAA;AAEhC,4EAA4E;AAC5E,eAAO,MAAM,qBAAqB;IAChC,6CAA6C;;IAE7C,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AuC;;;;;;;;;;;;EA8FvC,CAAA;AACF,MAAM,MAAM,gBAAgB,GAAG,OAAO,sBAAsB,CAAC,IAAI,CAAA;AAMjE,iEAAiE;AACjE,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IAChC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IACrC,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IACtC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IACnC,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IACnC,QAAQ,CAAC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5C,QAAQ,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;CACzC"}
package/dist/candidate.js DELETED
@@ -1,139 +0,0 @@
1
- /**
2
- * @tx/types/candidate - Learning candidate types for transcript extraction
3
- *
4
- * Learning candidates are potential learnings extracted from Claude Code
5
- * transcripts that await promotion to the learnings table.
6
- * Core type definitions using Effect Schema (Doctrine Rule 10).
7
- *
8
- * @see PRD-015 for the JSONL daemon and knowledge promotion pipeline
9
- */
10
- import { Schema } from "effect";
11
- // =============================================================================
12
- // CONSTANTS
13
- // =============================================================================
14
- /**
15
- * All valid confidence levels.
16
- */
17
- export const CANDIDATE_CONFIDENCES = ["high", "medium", "low"];
18
- /**
19
- * All valid candidate categories.
20
- */
21
- export const CANDIDATE_CATEGORIES = [
22
- "architecture",
23
- "testing",
24
- "performance",
25
- "security",
26
- "debugging",
27
- "tooling",
28
- "patterns",
29
- "other"
30
- ];
31
- /**
32
- * All valid candidate statuses.
33
- */
34
- export const CANDIDATE_STATUSES = ["pending", "promoted", "rejected", "merged"];
35
- // =============================================================================
36
- // SCHEMAS & TYPES
37
- // =============================================================================
38
- /** Confidence level for extracted learning candidates. */
39
- export const CandidateConfidenceSchema = Schema.Literal(...CANDIDATE_CONFIDENCES);
40
- /** Category of the extracted learning. */
41
- export const CandidateCategorySchema = Schema.Literal(...CANDIDATE_CATEGORIES);
42
- /** Status of a learning candidate in the promotion pipeline. */
43
- export const CandidateStatusSchema = Schema.Literal(...CANDIDATE_STATUSES);
44
- /** A chunk of transcript content to be analyzed for learning extraction. */
45
- export const TranscriptChunkSchema = Schema.Struct({
46
- /** The transcript text content to analyze */
47
- content: Schema.String,
48
- /** Source file path (e.g., ~/.claude/projects/foo/session.jsonl) */
49
- sourceFile: Schema.String,
50
- /** Optional run ID for provenance tracking */
51
- sourceRunId: Schema.optional(Schema.NullOr(Schema.String)),
52
- /** Optional task ID for provenance tracking */
53
- sourceTaskId: Schema.optional(Schema.NullOr(Schema.String)),
54
- /** Byte offset in source file (for incremental processing) */
55
- byteOffset: Schema.optional(Schema.Number.pipe(Schema.int())),
56
- /** Line number range in source file */
57
- lineRange: Schema.optional(Schema.Struct({
58
- start: Schema.Number.pipe(Schema.int()),
59
- end: Schema.Number.pipe(Schema.int()),
60
- })),
61
- });
62
- /** A learning candidate extracted from a transcript by the LLM. */
63
- export const ExtractedCandidateSchema = Schema.Struct({
64
- /** The learning text (1-3 sentences, actionable) */
65
- content: Schema.String,
66
- /** Confidence level assigned by the LLM */
67
- confidence: CandidateConfidenceSchema,
68
- /** Category of the learning */
69
- category: CandidateCategorySchema,
70
- });
71
- /** A learning candidate stored in the database. */
72
- export const LearningCandidateSchema = Schema.Struct({
73
- /** Unique database ID */
74
- id: Schema.Number.pipe(Schema.int()),
75
- /** The learning text (1-3 sentences, actionable) */
76
- content: Schema.String,
77
- /** Confidence level assigned by the LLM */
78
- confidence: CandidateConfidenceSchema,
79
- /** Category of the learning */
80
- category: Schema.NullOr(CandidateCategorySchema),
81
- /** Source JSONL file path */
82
- sourceFile: Schema.String,
83
- /** Source run ID for provenance */
84
- sourceRunId: Schema.NullOr(Schema.String),
85
- /** Source task ID for provenance */
86
- sourceTaskId: Schema.NullOr(Schema.String),
87
- /** When the candidate was extracted */
88
- extractedAt: Schema.DateFromSelf,
89
- /** Current status in promotion pipeline */
90
- status: CandidateStatusSchema,
91
- /** When the candidate was reviewed */
92
- reviewedAt: Schema.NullOr(Schema.DateFromSelf),
93
- /** Who reviewed ('auto' or user identifier) */
94
- reviewedBy: Schema.NullOr(Schema.String),
95
- /** ID of promoted learning (if promoted or merged) */
96
- promotedLearningId: Schema.NullOr(Schema.Number.pipe(Schema.int())),
97
- /** Reason for rejection (if rejected) */
98
- rejectionReason: Schema.NullOr(Schema.String),
99
- });
100
- /** Input for creating a new learning candidate. */
101
- export const CreateCandidateInputSchema = Schema.Struct({
102
- content: Schema.String,
103
- confidence: CandidateConfidenceSchema,
104
- category: Schema.optional(Schema.NullOr(CandidateCategorySchema)),
105
- sourceFile: Schema.String,
106
- sourceRunId: Schema.optional(Schema.NullOr(Schema.String)),
107
- sourceTaskId: Schema.optional(Schema.NullOr(Schema.String)),
108
- });
109
- /** Input for updating a learning candidate. */
110
- export const UpdateCandidateInputSchema = Schema.Struct({
111
- status: Schema.optional(CandidateStatusSchema),
112
- reviewedAt: Schema.optional(Schema.DateFromSelf),
113
- reviewedBy: Schema.optional(Schema.String),
114
- promotedLearningId: Schema.optional(Schema.Number.pipe(Schema.int())),
115
- rejectionReason: Schema.optional(Schema.String),
116
- });
117
- /** Filter options for querying learning candidates. */
118
- export const CandidateFilterSchema = Schema.Struct({
119
- status: Schema.optional(Schema.Union(CandidateStatusSchema, Schema.Array(CandidateStatusSchema))),
120
- confidence: Schema.optional(Schema.Union(CandidateConfidenceSchema, Schema.Array(CandidateConfidenceSchema))),
121
- category: Schema.optional(Schema.Union(CandidateCategorySchema, Schema.Array(CandidateCategorySchema))),
122
- sourceFile: Schema.optional(Schema.String),
123
- sourceRunId: Schema.optional(Schema.String),
124
- sourceTaskId: Schema.optional(Schema.String),
125
- limit: Schema.optional(Schema.Number.pipe(Schema.int())),
126
- offset: Schema.optional(Schema.Number.pipe(Schema.int())),
127
- });
128
- /** Result of candidate extraction from a transcript chunk. */
129
- export const ExtractionResultSchema = Schema.Struct({
130
- candidates: Schema.Array(ExtractedCandidateSchema),
131
- sourceChunk: TranscriptChunkSchema,
132
- wasExtracted: Schema.Boolean,
133
- metadata: Schema.optional(Schema.Struct({
134
- model: Schema.optional(Schema.String),
135
- tokensUsed: Schema.optional(Schema.Number.pipe(Schema.int())),
136
- durationMs: Schema.optional(Schema.Number),
137
- })),
138
- });
139
- //# sourceMappingURL=candidate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"candidate.js","sourceRoot":"","sources":["../src/candidate.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,gFAAgF;AAChF,YAAY;AACZ,gFAAgF;AAEhF;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAU,CAAA;AAEvE;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,cAAc;IACd,SAAS;IACT,aAAa;IACb,UAAU;IACV,WAAW;IACX,SAAS;IACT,UAAU;IACV,OAAO;CACC,CAAA;AAEV;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,CAAU,CAAA;AAExF,gFAAgF;AAChF,kBAAkB;AAClB,gFAAgF;AAEhF,0DAA0D;AAC1D,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAA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AC,MAAM,CAAC,KAAK,CAAC,uBAAuB,EAAE,MAAM,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC,CAAC;IACvG,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IAC1C,WAAW,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IAC3C,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IAC5C,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;IACxD,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;CAC1D,CAAC,CAAA;AAGF,8DAA8D;AAC9D,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,CAAC;IAClD,UAAU,EAAE,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC;IAClD,WAAW,EAAE,qBAAqB;IAClC,YAAY,EAAE,MAAM,CAAC,OAAO;IAC5B,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;QACtC,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;QACrC,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;QAC7D,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;KAC3C,CAAC,CAAC;CACJ,CAAC,CAAA"}
package/dist/edge.d.ts DELETED
@@ -1,87 +0,0 @@
1
- /**
2
- * Edge types for tx
3
- *
4
- * Type definitions for graph edges that connect nodes in the knowledge graph.
5
- * Core type definitions using Effect Schema (Doctrine Rule 10).
6
- * Schema definitions provide both compile-time types and runtime validation.
7
- */
8
- import { Schema } from "effect";
9
- /**
10
- * Node types in the graph - entities that can be connected by edges.
11
- */
12
- export declare const NODE_TYPES: readonly ["learning", "file", "task", "run"];
13
- /**
14
- * Edge types - strong ENUMs (fixed ontology, not pluggable).
15
- * - ANCHORED_TO: Learning is anchored to a file/location
16
- * - DERIVED_FROM: Learning is derived from another learning
17
- * - IMPORTS: File imports another file
18
- * - CO_CHANGES_WITH: Files frequently change together
19
- * - SIMILAR_TO: Learnings are semantically similar
20
- * - LINKS_TO: Explicit link reference
21
- * - USED_IN_RUN: Learning was used in a run
22
- * - INVALIDATED_BY: Learning was invalidated by another
23
- */
24
- export declare const EDGE_TYPES: readonly ["ANCHORED_TO", "DERIVED_FROM", "IMPORTS", "CO_CHANGES_WITH", "SIMILAR_TO", "LINKS_TO", "USED_IN_RUN", "INVALIDATED_BY"];
25
- /** Node type - one of the valid graph node types. */
26
- export declare const NodeTypeSchema: Schema.Literal<["learning", "file", "task", "run"]>;
27
- export type NodeType = typeof NodeTypeSchema.Type;
28
- /** Edge type - one of the valid graph edge types. */
29
- export declare const EdgeTypeSchema: Schema.Literal<["ANCHORED_TO", "DERIVED_FROM", "IMPORTS", "CO_CHANGES_WITH", "SIMILAR_TO", "LINKS_TO", "USED_IN_RUN", "INVALIDATED_BY"]>;
30
- export type EdgeType = typeof EdgeTypeSchema.Type;
31
- /** Edge ID - branded integer. */
32
- export declare const EdgeIdSchema: Schema.brand<Schema.filter<typeof Schema.Number>, "EdgeId">;
33
- export type EdgeId = typeof EdgeIdSchema.Type;
34
- /** Edge entity - connects two nodes in the graph. */
35
- export declare const EdgeSchema: Schema.Struct<{
36
- id: Schema.brand<Schema.filter<typeof Schema.Number>, "EdgeId">;
37
- edgeType: Schema.Literal<["ANCHORED_TO", "DERIVED_FROM", "IMPORTS", "CO_CHANGES_WITH", "SIMILAR_TO", "LINKS_TO", "USED_IN_RUN", "INVALIDATED_BY"]>;
38
- sourceType: Schema.Literal<["learning", "file", "task", "run"]>;
39
- sourceId: typeof Schema.String;
40
- targetType: Schema.Literal<["learning", "file", "task", "run"]>;
41
- targetId: typeof Schema.String;
42
- weight: typeof Schema.Number;
43
- metadata: Schema.Record$<typeof Schema.String, typeof Schema.Unknown>;
44
- createdAt: typeof Schema.DateFromSelf;
45
- invalidatedAt: Schema.NullOr<typeof Schema.DateFromSelf>;
46
- }>;
47
- export type Edge = typeof EdgeSchema.Type;
48
- /** Input for creating a new edge. */
49
- export declare const CreateEdgeInputSchema: Schema.Struct<{
50
- edgeType: Schema.Literal<["ANCHORED_TO", "DERIVED_FROM", "IMPORTS", "CO_CHANGES_WITH", "SIMILAR_TO", "LINKS_TO", "USED_IN_RUN", "INVALIDATED_BY"]>;
51
- sourceType: Schema.Literal<["learning", "file", "task", "run"]>;
52
- sourceId: typeof Schema.String;
53
- targetType: Schema.Literal<["learning", "file", "task", "run"]>;
54
- targetId: typeof Schema.String;
55
- weight: Schema.optional<typeof Schema.Number>;
56
- metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
57
- }>;
58
- export type CreateEdgeInput = typeof CreateEdgeInputSchema.Type;
59
- /** Input for updating an edge. */
60
- export declare const UpdateEdgeInputSchema: Schema.Struct<{
61
- weight: Schema.optional<typeof Schema.Number>;
62
- metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
63
- }>;
64
- export type UpdateEdgeInput = typeof UpdateEdgeInputSchema.Type;
65
- /** Neighbor node returned from graph traversal. */
66
- export declare const NeighborNodeSchema: Schema.Struct<{
67
- nodeType: Schema.Literal<["learning", "file", "task", "run"]>;
68
- nodeId: typeof Schema.String;
69
- edgeType: Schema.Literal<["ANCHORED_TO", "DERIVED_FROM", "IMPORTS", "CO_CHANGES_WITH", "SIMILAR_TO", "LINKS_TO", "USED_IN_RUN", "INVALIDATED_BY"]>;
70
- weight: typeof Schema.Number;
71
- direction: Schema.Literal<["outgoing", "incoming"]>;
72
- }>;
73
- export type NeighborNode = typeof NeighborNodeSchema.Type;
74
- /** Database row type for edges (snake_case from SQLite). */
75
- export interface EdgeRow {
76
- id: number;
77
- edge_type: string;
78
- source_type: string;
79
- source_id: string;
80
- target_type: string;
81
- target_id: string;
82
- weight: number;
83
- metadata: string;
84
- created_at: string;
85
- invalidated_at: string | null;
86
- }
87
- //# sourceMappingURL=edge.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"edge.d.ts","sourceRoot":"","sources":["../src/edge.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAM/B;;GAEG;AACH,eAAO,MAAM,UAAU,8CAA+C,CAAC;AAEvE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU,mIASb,CAAC;AAMX,qDAAqD;AACrD,eAAO,MAAM,cAAc,qDAAgC,CAAA;AAC3D,MAAM,MAAM,QAAQ,GAAG,OAAO,cAAc,CAAC,IAAI,CAAA;AAEjD,qDAAqD;AACrD,eAAO,MAAM,cAAc,0IAAgC,CAAA;AAC3D,MAAM,MAAM,QAAQ,GAAG,OAAO,cAAc,CAAC,IAAI,CAAA;AAEjD,iCAAiC;AACjC,eAAO,MAAM,YAAY,6DAGxB,CAAA;AACD,MAAM,MAAM,MAAM,GAAG,OAAO,YAAY,CAAC,IAAI,CAAA;AAE7C,qDAAqD;AACrD,eAAO,MAAM,UAAU;;;;;;;;;;;EAWrB,CAAA;AACF,MAAM,MAAM,IAAI,GAAG,OAAO,UAAU,CAAC,IAAI,CAAA;AAEzC,qCAAqC;AACrC,eAAO,MAAM,qBAAqB;;;;;;;;EAQhC,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,OAAO,qBAAqB,CAAC,IAAI,CAAA;AAE/D,kCAAkC;AAClC,eAAO,MAAM,qBAAqB;;;EAGhC,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,OAAO,qBAAqB,CAAC,IAAI,CAAA;AAE/D,mDAAmD;AACnD,eAAO,MAAM,kBAAkB;;;;;;EAM7B,CAAA;AACF,MAAM,MAAM,YAAY,GAAG,OAAO,kBAAkB,CAAC,IAAI,CAAA;AAMzD,4DAA4D;AAC5D,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"}
package/dist/edge.js DELETED
@@ -1,82 +0,0 @@
1
- /**
2
- * Edge types for tx
3
- *
4
- * Type definitions for graph edges that connect nodes in the knowledge graph.
5
- * Core type definitions using Effect Schema (Doctrine Rule 10).
6
- * Schema definitions provide both compile-time types and runtime validation.
7
- */
8
- import { Schema } from "effect";
9
- // =============================================================================
10
- // CONSTANTS
11
- // =============================================================================
12
- /**
13
- * Node types in the graph - entities that can be connected by edges.
14
- */
15
- export const NODE_TYPES = ["learning", "file", "task", "run"];
16
- /**
17
- * Edge types - strong ENUMs (fixed ontology, not pluggable).
18
- * - ANCHORED_TO: Learning is anchored to a file/location
19
- * - DERIVED_FROM: Learning is derived from another learning
20
- * - IMPORTS: File imports another file
21
- * - CO_CHANGES_WITH: Files frequently change together
22
- * - SIMILAR_TO: Learnings are semantically similar
23
- * - LINKS_TO: Explicit link reference
24
- * - USED_IN_RUN: Learning was used in a run
25
- * - INVALIDATED_BY: Learning was invalidated by another
26
- */
27
- export const EDGE_TYPES = [
28
- "ANCHORED_TO",
29
- "DERIVED_FROM",
30
- "IMPORTS",
31
- "CO_CHANGES_WITH",
32
- "SIMILAR_TO",
33
- "LINKS_TO",
34
- "USED_IN_RUN",
35
- "INVALIDATED_BY",
36
- ];
37
- // =============================================================================
38
- // SCHEMAS & TYPES
39
- // =============================================================================
40
- /** Node type - one of the valid graph node types. */
41
- export const NodeTypeSchema = Schema.Literal(...NODE_TYPES);
42
- /** Edge type - one of the valid graph edge types. */
43
- export const EdgeTypeSchema = Schema.Literal(...EDGE_TYPES);
44
- /** Edge ID - branded integer. */
45
- export const EdgeIdSchema = Schema.Number.pipe(Schema.int(), Schema.brand("EdgeId"));
46
- /** Edge entity - connects two nodes in the graph. */
47
- export const EdgeSchema = Schema.Struct({
48
- id: EdgeIdSchema,
49
- edgeType: EdgeTypeSchema,
50
- sourceType: NodeTypeSchema,
51
- sourceId: Schema.String,
52
- targetType: NodeTypeSchema,
53
- targetId: Schema.String,
54
- weight: Schema.Number, // 0-1
55
- metadata: Schema.Record({ key: Schema.String, value: Schema.Unknown }),
56
- createdAt: Schema.DateFromSelf,
57
- invalidatedAt: Schema.NullOr(Schema.DateFromSelf),
58
- });
59
- /** Input for creating a new edge. */
60
- export const CreateEdgeInputSchema = Schema.Struct({
61
- edgeType: EdgeTypeSchema,
62
- sourceType: NodeTypeSchema,
63
- sourceId: Schema.String,
64
- targetType: NodeTypeSchema,
65
- targetId: Schema.String,
66
- weight: Schema.optional(Schema.Number),
67
- metadata: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Unknown })),
68
- });
69
- /** Input for updating an edge. */
70
- export const UpdateEdgeInputSchema = Schema.Struct({
71
- weight: Schema.optional(Schema.Number),
72
- metadata: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Unknown })),
73
- });
74
- /** Neighbor node returned from graph traversal. */
75
- export const NeighborNodeSchema = Schema.Struct({
76
- nodeType: NodeTypeSchema,
77
- nodeId: Schema.String,
78
- edgeType: EdgeTypeSchema,
79
- weight: Schema.Number,
80
- direction: Schema.Literal("outgoing", "incoming"),
81
- });
82
- //# sourceMappingURL=edge.js.map
package/dist/edge.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"ed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A"}
package/dist/symbol.d.ts DELETED
@@ -1,71 +0,0 @@
1
- /**
2
- * Symbol extraction types for tx
3
- *
4
- * Type definitions for code intelligence and symbol extraction.
5
- * Used by ast-grep integration for structural code analysis.
6
- * Core type definitions using Effect Schema (Doctrine Rule 10).
7
- * Schema definitions provide both compile-time types and runtime validation.
8
- */
9
- import { Schema } from "effect";
10
- /**
11
- * All valid symbol kinds for code extraction.
12
- * Covers common constructs across TypeScript, Rust, Go, Python, etc.
13
- */
14
- export declare const SYMBOL_KINDS: readonly ["function", "class", "interface", "type", "const", "variable", "method", "struct", "enum", "trait", "module"];
15
- /**
16
- * Import kind - static (import/require) or dynamic (import()).
17
- */
18
- export declare const IMPORT_KINDS: readonly ["static", "dynamic"];
19
- /** Symbol kind - one of the valid code construct types. */
20
- export declare const SymbolKindSchema: Schema.Literal<["function", "class", "interface", "type", "const", "variable", "method", "struct", "enum", "trait", "module"]>;
21
- export type SymbolKind = typeof SymbolKindSchema.Type;
22
- /** Import kind schema. */
23
- export declare const ImportKindSchema: Schema.Literal<["static", "dynamic"]>;
24
- export type ImportKind = typeof ImportKindSchema.Type;
25
- /** Information about an extracted symbol. */
26
- export declare const SymbolInfoSchema: Schema.Struct<{
27
- /** Symbol name (e.g., function name, class name) */
28
- name: typeof Schema.String;
29
- /** Kind of symbol */
30
- kind: Schema.Literal<["function", "class", "interface", "type", "const", "variable", "method", "struct", "enum", "trait", "module"]>;
31
- /** Line number where the symbol is defined (1-indexed) */
32
- line: Schema.filter<typeof Schema.Number>;
33
- /** Whether the symbol is exported */
34
- exported: typeof Schema.Boolean;
35
- }>;
36
- export type SymbolInfo = typeof SymbolInfoSchema.Type;
37
- /** Information about an import statement. */
38
- export declare const ImportInfoSchema: Schema.Struct<{
39
- /** Source module path or package name */
40
- source: typeof Schema.String;
41
- /** Imported specifiers (names) */
42
- specifiers: Schema.Array$<typeof Schema.String>;
43
- /** Kind of import */
44
- kind: Schema.Literal<["static", "dynamic"]>;
45
- }>;
46
- export type ImportInfo = typeof ImportInfoSchema.Type;
47
- /** Pattern for matching symbols with ast-grep. */
48
- export declare const SymbolPatternSchema: Schema.Struct<{
49
- /** ast-grep pattern string */
50
- pattern: typeof Schema.String;
51
- /** Kind of symbol this pattern matches */
52
- kind: Schema.Literal<["function", "class", "interface", "type", "const", "variable", "method", "struct", "enum", "trait", "module"]>;
53
- /** If specified, only match exported/non-exported symbols */
54
- exported: Schema.optional<typeof Schema.Boolean>;
55
- }>;
56
- export type SymbolPattern = typeof SymbolPatternSchema.Type;
57
- /** A match result from ast-grep pattern matching. */
58
- export declare const MatchSchema: Schema.Struct<{
59
- /** File path where the match was found */
60
- file: typeof Schema.String;
61
- /** Line number (1-indexed) */
62
- line: Schema.filter<typeof Schema.Number>;
63
- /** Column number (1-indexed) */
64
- column: Schema.filter<typeof Schema.Number>;
65
- /** Matched text */
66
- text: typeof Schema.String;
67
- /** Named captures from the pattern (e.g., $NAME -> value) */
68
- captures: Schema.Record$<typeof Schema.String, typeof Schema.String>;
69
- }>;
70
- export type Match = typeof MatchSchema.Type;
71
- //# sourceMappingURL=symbol.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"symbol.d.ts","sourceRoot":"","sources":["../src/symbol.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAM/B;;;GAGG;AACH,eAAO,MAAM,YAAY,yHAYf,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,YAAY,gCAAiC,CAAC;AAM3D,2DAA2D;AAC3D,eAAO,MAAM,gBAAgB,gIAAkC,CAAA;AAC/D,MAAM,MAAM,UAAU,GAAG,OAAO,gBAAgB,CAAC,IAAI,CAAA;AAErD,0BAA0B;AAC1B,eAAO,MAAM,gBAAgB,uCAAkC,CAAA;AAC/D,MAAM,MAAM,UAAU,GAAG,OAAO,gBAAgB,CAAC,IAAI,CAAA;AAErD,6CAA6C;AAC7C,eAAO,MAAM,gBAAgB;IAC3B,oDAAoD;;IAEpD,qBAAqB;;IAErB,0DAA0D;;IAE1D,qCAAqC;;EAErC,CAAA;AACF,MAAM,MAAM,UAAU,GAAG,OAAO,gBAAgB,CAAC,IAAI,CAAA;AAErD,6CAA6C;AAC7C,eAAO,MAAM,gBAAgB;IAC3B,yCAAyC;;IAEzC,kCAAkC;;IAElC,qBAAqB;;EAErB,CAAA;AACF,MAAM,MAAM,UAAU,GAAG,OAAO,gBAAgB,CAAC,IAAI,CAAA;AAErD,kDAAkD;AAClD,eAAO,MAAM,mBAAmB;IAC9B,8BAA8B;;IAE9B,0CAA0C;;IAE1C,6DAA6D;;EAE7D,CAAA;AACF,MAAM,MAAM,aAAa,GAAG,OAAO,mBAAmB,CAAC,IAAI,CAAA;AAE3D,qDAAqD;AACrD,eAAO,MAAM,WAAW;IACtB,0CAA0C;;IAE1C,8BAA8B;;IAE9B,gCAAgC;;IAEhC,mBAAmB;;IAEnB,6DAA6D;;EAE7D,CAAA;AACF,MAAM,MAAM,KAAK,GAAG,OAAO,WAAW,CAAC,IAAI,CAAA"}
package/dist/symbol.js DELETED
@@ -1,83 +0,0 @@
1
- /**
2
- * Symbol extraction types for tx
3
- *
4
- * Type definitions for code intelligence and symbol extraction.
5
- * Used by ast-grep integration for structural code analysis.
6
- * Core type definitions using Effect Schema (Doctrine Rule 10).
7
- * Schema definitions provide both compile-time types and runtime validation.
8
- */
9
- import { Schema } from "effect";
10
- // =============================================================================
11
- // CONSTANTS
12
- // =============================================================================
13
- /**
14
- * All valid symbol kinds for code extraction.
15
- * Covers common constructs across TypeScript, Rust, Go, Python, etc.
16
- */
17
- export const SYMBOL_KINDS = [
18
- "function",
19
- "class",
20
- "interface",
21
- "type",
22
- "const",
23
- "variable",
24
- "method",
25
- "struct",
26
- "enum",
27
- "trait",
28
- "module",
29
- ];
30
- /**
31
- * Import kind - static (import/require) or dynamic (import()).
32
- */
33
- export const IMPORT_KINDS = ["static", "dynamic"];
34
- // =============================================================================
35
- // SCHEMAS & TYPES
36
- // =============================================================================
37
- /** Symbol kind - one of the valid code construct types. */
38
- export const SymbolKindSchema = Schema.Literal(...SYMBOL_KINDS);
39
- /** Import kind schema. */
40
- export const ImportKindSchema = Schema.Literal(...IMPORT_KINDS);
41
- /** Information about an extracted symbol. */
42
- export const SymbolInfoSchema = Schema.Struct({
43
- /** Symbol name (e.g., function name, class name) */
44
- name: Schema.String,
45
- /** Kind of symbol */
46
- kind: SymbolKindSchema,
47
- /** Line number where the symbol is defined (1-indexed) */
48
- line: Schema.Number.pipe(Schema.int()),
49
- /** Whether the symbol is exported */
50
- exported: Schema.Boolean,
51
- });
52
- /** Information about an import statement. */
53
- export const ImportInfoSchema = Schema.Struct({
54
- /** Source module path or package name */
55
- source: Schema.String,
56
- /** Imported specifiers (names) */
57
- specifiers: Schema.Array(Schema.String),
58
- /** Kind of import */
59
- kind: ImportKindSchema,
60
- });
61
- /** Pattern for matching symbols with ast-grep. */
62
- export const SymbolPatternSchema = Schema.Struct({
63
- /** ast-grep pattern string */
64
- pattern: Schema.String,
65
- /** Kind of symbol this pattern matches */
66
- kind: SymbolKindSchema,
67
- /** If specified, only match exported/non-exported symbols */
68
- exported: Schema.optional(Schema.Boolean),
69
- });
70
- /** A match result from ast-grep pattern matching. */
71
- export const MatchSchema = Schema.Struct({
72
- /** File path where the match was found */
73
- file: Schema.String,
74
- /** Line number (1-indexed) */
75
- line: Schema.Number.pipe(Schema.int()),
76
- /** Column number (1-indexed) */
77
- column: Schema.Number.pipe(Schema.int()),
78
- /** Matched text */
79
- text: Schema.String,
80
- /** Named captures from the pattern (e.g., $NAME -> value) */
81
- captures: Schema.Record({ key: Schema.String, value: Schema.String }),
82
- });
83
- //# sourceMappingURL=symbol.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"symbol.js","sourceRoot":"","sources":["../src/symbol.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,gFAA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