@knowledgine/core 0.0.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/LICENSE +21 -0
- package/dist/config.d.ts +13 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +30 -0
- package/dist/config.js.map +1 -0
- package/dist/errors.d.ts +42 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +101 -0
- package/dist/errors.js.map +1 -0
- package/dist/extraction/context-analyzer.d.ts +21 -0
- package/dist/extraction/context-analyzer.d.ts.map +1 -0
- package/dist/extraction/context-analyzer.js +50 -0
- package/dist/extraction/context-analyzer.js.map +1 -0
- package/dist/extraction/default-patterns.d.ts +21 -0
- package/dist/extraction/default-patterns.d.ts.map +1 -0
- package/dist/extraction/default-patterns.js +121 -0
- package/dist/extraction/default-patterns.js.map +1 -0
- package/dist/extraction/pattern-extractor.d.ts +18 -0
- package/dist/extraction/pattern-extractor.d.ts.map +1 -0
- package/dist/extraction/pattern-extractor.js +182 -0
- package/dist/extraction/pattern-extractor.js.map +1 -0
- package/dist/extraction/psp-detector.d.ts +29 -0
- package/dist/extraction/psp-detector.d.ts.map +1 -0
- package/dist/extraction/psp-detector.js +49 -0
- package/dist/extraction/psp-detector.js.map +1 -0
- package/dist/extraction/rule-based-classifier.d.ts +13 -0
- package/dist/extraction/rule-based-classifier.d.ts.map +1 -0
- package/dist/extraction/rule-based-classifier.js +35 -0
- package/dist/extraction/rule-based-classifier.js.map +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -0
- package/dist/memory/memory-manager.d.ts +21 -0
- package/dist/memory/memory-manager.d.ts.map +1 -0
- package/dist/memory/memory-manager.js +206 -0
- package/dist/memory/memory-manager.js.map +1 -0
- package/dist/processing/file-processor.d.ts +15 -0
- package/dist/processing/file-processor.d.ts.map +1 -0
- package/dist/processing/file-processor.js +38 -0
- package/dist/processing/file-processor.js.map +1 -0
- package/dist/search/knowledge-searcher.d.ts +25 -0
- package/dist/search/knowledge-searcher.d.ts.map +1 -0
- package/dist/search/knowledge-searcher.js +45 -0
- package/dist/search/knowledge-searcher.js.map +1 -0
- package/dist/search/link-generator.d.ts +21 -0
- package/dist/search/link-generator.d.ts.map +1 -0
- package/dist/search/link-generator.js +131 -0
- package/dist/search/link-generator.js.map +1 -0
- package/dist/storage/database.d.ts +3 -0
- package/dist/storage/database.d.ts.map +1 -0
- package/dist/storage/database.js +14 -0
- package/dist/storage/database.js.map +1 -0
- package/dist/storage/knowledge-repository.d.ts +74 -0
- package/dist/storage/knowledge-repository.d.ts.map +1 -0
- package/dist/storage/knowledge-repository.js +244 -0
- package/dist/storage/knowledge-repository.js.map +1 -0
- package/dist/storage/migrations/001_initial.d.ts +3 -0
- package/dist/storage/migrations/001_initial.d.ts.map +1 -0
- package/dist/storage/migrations/001_initial.js +21 -0
- package/dist/storage/migrations/001_initial.js.map +1 -0
- package/dist/storage/migrations/002_memory_layers.d.ts +3 -0
- package/dist/storage/migrations/002_memory_layers.d.ts.map +1 -0
- package/dist/storage/migrations/002_memory_layers.js +55 -0
- package/dist/storage/migrations/002_memory_layers.js.map +1 -0
- package/dist/storage/migrator.d.ts +24 -0
- package/dist/storage/migrator.d.ts.map +1 -0
- package/dist/storage/migrator.js +68 -0
- package/dist/storage/migrator.js.map +1 -0
- package/dist/storage/schema.d.ts +2 -0
- package/dist/storage/schema.d.ts.map +1 -0
- package/dist/storage/schema.js +79 -0
- package/dist/storage/schema.js.map +1 -0
- package/dist/types.d.ts +119 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/code-block-detector.d.ts +25 -0
- package/dist/utils/code-block-detector.d.ts.map +1 -0
- package/dist/utils/code-block-detector.js +84 -0
- package/dist/utils/code-block-detector.js.map +1 -0
- package/package.json +53 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 R.M
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type PatternCategory = "problem" | "solution" | "learning" | "time";
|
|
2
|
+
export interface KnowledgineConfig {
|
|
3
|
+
rootPath: string;
|
|
4
|
+
dbPath: string;
|
|
5
|
+
patterns: {
|
|
6
|
+
enabled: PatternCategory[];
|
|
7
|
+
};
|
|
8
|
+
frontmatter: {
|
|
9
|
+
requiredFields: string[];
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export declare function defineConfig(partial?: Partial<KnowledgineConfig>): KnowledgineConfig;
|
|
13
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;AAE3E,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE;QACR,OAAO,EAAE,eAAe,EAAE,CAAC;KAC5B,CAAC;IACF,WAAW,EAAE;QACX,cAAc,EAAE,MAAM,EAAE,CAAC;KAC1B,CAAC;CACH;AAaD,wBAAgB,YAAY,CAAC,OAAO,GAAE,OAAO,CAAC,iBAAiB,CAAM,GAAG,iBAAiB,CAkBxF"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { resolve } from "path";
|
|
2
|
+
const DEFAULT_CONFIG = {
|
|
3
|
+
rootPath: ".",
|
|
4
|
+
dbPath: "",
|
|
5
|
+
patterns: {
|
|
6
|
+
enabled: ["problem", "solution", "learning", "time"],
|
|
7
|
+
},
|
|
8
|
+
frontmatter: {
|
|
9
|
+
requiredFields: [],
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
export function defineConfig(partial = {}) {
|
|
13
|
+
const rootPath = partial.rootPath ?? DEFAULT_CONFIG.rootPath;
|
|
14
|
+
const dbPath = partial.dbPath || resolve(rootPath, ".knowledgine", "index.sqlite");
|
|
15
|
+
return {
|
|
16
|
+
...DEFAULT_CONFIG,
|
|
17
|
+
...partial,
|
|
18
|
+
rootPath,
|
|
19
|
+
dbPath,
|
|
20
|
+
patterns: {
|
|
21
|
+
...DEFAULT_CONFIG.patterns,
|
|
22
|
+
...partial.patterns,
|
|
23
|
+
},
|
|
24
|
+
frontmatter: {
|
|
25
|
+
...DEFAULT_CONFIG.frontmatter,
|
|
26
|
+
...partial.frontmatter,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAe/B,MAAM,cAAc,GAAsB;IACxC,QAAQ,EAAE,GAAG;IACb,MAAM,EAAE,EAAE;IACV,QAAQ,EAAE;QACR,OAAO,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,CAAC;KACrD;IACD,WAAW,EAAE;QACX,cAAc,EAAE,EAAE;KACnB;CACF,CAAC;AAEF,MAAM,UAAU,YAAY,CAAC,UAAsC,EAAE;IACnE,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,cAAc,CAAC,QAAQ,CAAC;IAC7D,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,QAAQ,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC;IAEnF,OAAO;QACL,GAAG,cAAc;QACjB,GAAG,OAAO;QACV,QAAQ;QACR,MAAM;QACN,QAAQ,EAAE;YACR,GAAG,cAAc,CAAC,QAAQ;YAC1B,GAAG,OAAO,CAAC,QAAQ;SACpB;QACD,WAAW,EAAE;YACX,GAAG,cAAc,CAAC,WAAW;YAC7B,GAAG,OAAO,CAAC,WAAW;SACvB;KACF,CAAC;AACJ,CAAC"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/** Base error class for all knowledgine errors */
|
|
2
|
+
export declare class KnowledgeError extends Error {
|
|
3
|
+
readonly context?: Record<string, unknown> | undefined;
|
|
4
|
+
constructor(message: string, context?: Record<string, unknown> | undefined);
|
|
5
|
+
}
|
|
6
|
+
/** Error thrown when a note cannot be found */
|
|
7
|
+
export declare class KnowledgeNotFoundError extends KnowledgeError {
|
|
8
|
+
constructor(identifier: string | number, identifierType?: "path" | "id", context?: Record<string, unknown>);
|
|
9
|
+
}
|
|
10
|
+
/** Error thrown when FTS5 index operations fail */
|
|
11
|
+
export declare class FTSIndexError extends KnowledgeError {
|
|
12
|
+
constructor(operation: "insert" | "update" | "delete" | "search" | "rebuild", cause?: unknown, context?: Record<string, unknown>);
|
|
13
|
+
}
|
|
14
|
+
/** Error thrown when input validation fails */
|
|
15
|
+
export declare class ValidationError extends KnowledgeError {
|
|
16
|
+
constructor(field: string, value: unknown, reason: string, context?: Record<string, unknown>);
|
|
17
|
+
}
|
|
18
|
+
/** Error thrown when database operations fail */
|
|
19
|
+
export declare class DatabaseError extends KnowledgeError {
|
|
20
|
+
constructor(operation: string, cause?: unknown, context?: Record<string, unknown>);
|
|
21
|
+
}
|
|
22
|
+
/** Error thrown when pattern classification fails */
|
|
23
|
+
export declare class ClassificationError extends KnowledgeError {
|
|
24
|
+
constructor(reason: string, cause?: unknown, context?: Record<string, unknown>);
|
|
25
|
+
}
|
|
26
|
+
/** Error thrown when link generation fails */
|
|
27
|
+
export declare class LinkGenerationError extends KnowledgeError {
|
|
28
|
+
constructor(noteId: number, reason: string, context?: Record<string, unknown>);
|
|
29
|
+
}
|
|
30
|
+
/** Error thrown when a memory entry cannot be found */
|
|
31
|
+
export declare class MemoryNotFoundError extends KnowledgeError {
|
|
32
|
+
constructor(id: number);
|
|
33
|
+
}
|
|
34
|
+
/** Error thrown when memory promotion fails */
|
|
35
|
+
export declare class MemoryPromotionError extends KnowledgeError {
|
|
36
|
+
constructor(id: number, currentLayer: string, accessCount?: number, requiredCount?: number);
|
|
37
|
+
}
|
|
38
|
+
/** Error thrown when memory demotion fails */
|
|
39
|
+
export declare class MemoryDemotionError extends KnowledgeError {
|
|
40
|
+
constructor(id: number, currentLayer: string);
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":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AM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAK9E;AAED,uDAAuD;AACvD,qBAAa,mBAAoB,SAAQ,cAAc;gBACzC,EAAE,EAAE,MAAM;CAIvB;AAED,+CAA+C;AAC/C,qBAAa,oBAAqB,SAAQ,cAAc;gBAC1C,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM;CAQ3F;AAED,8CAA8C;AAC9C,qBAAa,mBAAoB,SAAQ,cAAc;gBACzC,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;CAO7C"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/** Base error class for all knowledgine errors */
|
|
2
|
+
export class KnowledgeError extends Error {
|
|
3
|
+
context;
|
|
4
|
+
constructor(message, context) {
|
|
5
|
+
super(message);
|
|
6
|
+
this.context = context;
|
|
7
|
+
this.name = "KnowledgeError";
|
|
8
|
+
Error.captureStackTrace(this, this.constructor);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
/** Error thrown when a note cannot be found */
|
|
12
|
+
export class KnowledgeNotFoundError extends KnowledgeError {
|
|
13
|
+
constructor(identifier, identifierType = "path", context) {
|
|
14
|
+
const suggestion = identifierType === "path"
|
|
15
|
+
? "Please verify the file path is correct and the note exists in the knowledge base."
|
|
16
|
+
: "Please verify the note ID is valid.";
|
|
17
|
+
const message = `Note not found: ${identifierType} = "${identifier}". ${suggestion}`;
|
|
18
|
+
super(message, { identifier, identifierType, ...context });
|
|
19
|
+
this.name = "KnowledgeNotFoundError";
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/** Error thrown when FTS5 index operations fail */
|
|
23
|
+
export class FTSIndexError extends KnowledgeError {
|
|
24
|
+
constructor(operation, cause, context) {
|
|
25
|
+
const suggestions = {
|
|
26
|
+
insert: "Check if the note data contains valid searchable content.",
|
|
27
|
+
update: "Ensure the note exists before updating.",
|
|
28
|
+
delete: "Verify the note ID is correct.",
|
|
29
|
+
search: "Check your search query syntax. FTS5 supports AND, OR, NOT operators.",
|
|
30
|
+
rebuild: "Check database integrity and available disk space.",
|
|
31
|
+
};
|
|
32
|
+
const message = `FTS index operation failed: ${operation}. ${suggestions[operation] ?? ""}`;
|
|
33
|
+
super(message, { operation, cause, ...context });
|
|
34
|
+
this.name = "FTSIndexError";
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/** Error thrown when input validation fails */
|
|
38
|
+
export class ValidationError extends KnowledgeError {
|
|
39
|
+
constructor(field, value, reason, context) {
|
|
40
|
+
const valueType = value === null ? "null" : value === undefined ? "undefined" : typeof value;
|
|
41
|
+
const valueInfo = valueType === "string" && typeof value === "string"
|
|
42
|
+
? ` (received string of length ${value.length})`
|
|
43
|
+
: ` (received ${valueType})`;
|
|
44
|
+
const message = `Validation failed for field "${field}": ${reason}${valueInfo}.`;
|
|
45
|
+
super(message, { field, value, reason, valueType, ...context });
|
|
46
|
+
this.name = "ValidationError";
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/** Error thrown when database operations fail */
|
|
50
|
+
export class DatabaseError extends KnowledgeError {
|
|
51
|
+
constructor(operation, cause, context) {
|
|
52
|
+
const causeMessage = cause instanceof Error ? `: ${cause.message}` : "";
|
|
53
|
+
const message = `Database operation failed: ${operation}${causeMessage}. Check database connection, file permissions, and disk space.`;
|
|
54
|
+
super(message, { operation, cause, ...context });
|
|
55
|
+
this.name = "DatabaseError";
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/** Error thrown when pattern classification fails */
|
|
59
|
+
export class ClassificationError extends KnowledgeError {
|
|
60
|
+
constructor(reason, cause, context) {
|
|
61
|
+
const message = `Pattern classification failed: ${reason}.`;
|
|
62
|
+
super(message, { cause, ...context });
|
|
63
|
+
this.name = "ClassificationError";
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/** Error thrown when link generation fails */
|
|
67
|
+
export class LinkGenerationError extends KnowledgeError {
|
|
68
|
+
constructor(noteId, reason, context) {
|
|
69
|
+
const message = `Link generation failed for note ${noteId}: ${reason}.`;
|
|
70
|
+
super(message, { noteId, reason, ...context });
|
|
71
|
+
this.name = "LinkGenerationError";
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/** Error thrown when a memory entry cannot be found */
|
|
75
|
+
export class MemoryNotFoundError extends KnowledgeError {
|
|
76
|
+
constructor(id) {
|
|
77
|
+
super(`Memory entry not found: id = ${id}.`, { id });
|
|
78
|
+
this.name = "MemoryNotFoundError";
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/** Error thrown when memory promotion fails */
|
|
82
|
+
export class MemoryPromotionError extends KnowledgeError {
|
|
83
|
+
constructor(id, currentLayer, accessCount, requiredCount) {
|
|
84
|
+
const message = currentLayer === "procedural"
|
|
85
|
+
? `Cannot promote memory ${id}: already at the highest layer (procedural).`
|
|
86
|
+
: `Cannot promote memory ${id}: access_count ${accessCount} is below the required threshold ${requiredCount} for promotion from ${currentLayer}.`;
|
|
87
|
+
super(message, { id, currentLayer, accessCount, requiredCount });
|
|
88
|
+
this.name = "MemoryPromotionError";
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/** Error thrown when memory demotion fails */
|
|
92
|
+
export class MemoryDemotionError extends KnowledgeError {
|
|
93
|
+
constructor(id, currentLayer) {
|
|
94
|
+
super(`Cannot demote memory ${id}: already at the lowest layer (${currentLayer}).`, {
|
|
95
|
+
id,
|
|
96
|
+
currentLayer,
|
|
97
|
+
});
|
|
98
|
+
this.name = "MemoryDemotionError";
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA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oB;QAC1C,KAAK,CAAC,wBAAwB,EAAE,kCAAkC,YAAY,IAAI,EAAE;YAClF,EAAE;YACF,YAAY;SACb,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare enum ContextType {
|
|
2
|
+
SECTION_HEADER = "section_header",
|
|
3
|
+
LIST_ITEM = "list_item",
|
|
4
|
+
BODY_TEXT = "body_text",
|
|
5
|
+
CODE_COMMENT = "code_comment"
|
|
6
|
+
}
|
|
7
|
+
export interface LineContext {
|
|
8
|
+
type: ContextType;
|
|
9
|
+
confidence: number;
|
|
10
|
+
}
|
|
11
|
+
export declare class ContextAnalyzer {
|
|
12
|
+
private static readonly HEADER_PATTERN;
|
|
13
|
+
private static readonly LIST_PATTERN;
|
|
14
|
+
private static readonly COMMENT_PATTERN;
|
|
15
|
+
private static readonly CONFIDENCE_MULTIPLIERS;
|
|
16
|
+
analyzeContext(line: string, previousLines: string[]): ContextType;
|
|
17
|
+
calculateConfidence(contextType: ContextType, baseConfidence: number): number;
|
|
18
|
+
analyzeLineContext(line: string, previousLines: string[], baseConfidence: number): LineContext;
|
|
19
|
+
getMultiplier(contextType: ContextType): number;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=context-analyzer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-analyzer.d.ts","sourceRoot":"","sources":["../../src/extraction/context-analyzer.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW;IACrB,cAAc,mBAAmB;IACjC,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,YAAY,iBAAiB;CAC9B;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,WAAW,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAgB;IACtD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAkB;IACtD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAc;IAErD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,sBAAsB,CAK5C;IAEF,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,WAAW;IAuBlE,mBAAmB,CAAC,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM;IAM7E,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,cAAc,EAAE,MAAM,GAAG,WAAW;IAM9F,aAAa,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM;CAGhD"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export var ContextType;
|
|
2
|
+
(function (ContextType) {
|
|
3
|
+
ContextType["SECTION_HEADER"] = "section_header";
|
|
4
|
+
ContextType["LIST_ITEM"] = "list_item";
|
|
5
|
+
ContextType["BODY_TEXT"] = "body_text";
|
|
6
|
+
ContextType["CODE_COMMENT"] = "code_comment";
|
|
7
|
+
})(ContextType || (ContextType = {}));
|
|
8
|
+
export class ContextAnalyzer {
|
|
9
|
+
static HEADER_PATTERN = /^#{1,6}\s+/;
|
|
10
|
+
static LIST_PATTERN = /^\s*[-*+]\s+/;
|
|
11
|
+
static COMMENT_PATTERN = /^\s*\/\//;
|
|
12
|
+
static CONFIDENCE_MULTIPLIERS = {
|
|
13
|
+
[ContextType.SECTION_HEADER]: 1.2,
|
|
14
|
+
[ContextType.LIST_ITEM]: 1.0,
|
|
15
|
+
[ContextType.BODY_TEXT]: 0.9,
|
|
16
|
+
[ContextType.CODE_COMMENT]: 0.8,
|
|
17
|
+
};
|
|
18
|
+
analyzeContext(line, previousLines) {
|
|
19
|
+
if (ContextAnalyzer.HEADER_PATTERN.test(line)) {
|
|
20
|
+
return ContextType.SECTION_HEADER;
|
|
21
|
+
}
|
|
22
|
+
if (previousLines.length > 0) {
|
|
23
|
+
const lastLine = previousLines[previousLines.length - 1];
|
|
24
|
+
if (lastLine && ContextAnalyzer.HEADER_PATTERN.test(lastLine)) {
|
|
25
|
+
return ContextType.SECTION_HEADER;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (ContextAnalyzer.LIST_PATTERN.test(line)) {
|
|
29
|
+
return ContextType.LIST_ITEM;
|
|
30
|
+
}
|
|
31
|
+
if (ContextAnalyzer.COMMENT_PATTERN.test(line)) {
|
|
32
|
+
return ContextType.CODE_COMMENT;
|
|
33
|
+
}
|
|
34
|
+
return ContextType.BODY_TEXT;
|
|
35
|
+
}
|
|
36
|
+
calculateConfidence(contextType, baseConfidence) {
|
|
37
|
+
const multiplier = ContextAnalyzer.CONFIDENCE_MULTIPLIERS[contextType] ?? 1.0;
|
|
38
|
+
const adjusted = baseConfidence * multiplier;
|
|
39
|
+
return Math.min(adjusted, 0.9);
|
|
40
|
+
}
|
|
41
|
+
analyzeLineContext(line, previousLines, baseConfidence) {
|
|
42
|
+
const contextType = this.analyzeContext(line, previousLines);
|
|
43
|
+
const confidence = this.calculateConfidence(contextType, baseConfidence);
|
|
44
|
+
return { type: contextType, confidence };
|
|
45
|
+
}
|
|
46
|
+
getMultiplier(contextType) {
|
|
47
|
+
return ContextAnalyzer.CONFIDENCE_MULTIPLIERS[contextType] ?? 1.0;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=context-analyzer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-analyzer.js","sourceRoot":"","sources":["../../src/extraction/context-analyzer.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,gDAAiC,CAAA;IACjC,sCAAuB,CAAA;IACvB,sCAAuB,CAAA;IACvB,4CAA6B,CAAA;AAC/B,CAAC,EALW,WAAW,KAAX,WAAW,QAKtB;AAOD,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G,CAAC;QAC9E,MAAM,QAAQ,GAAG,cAAc,GAAG,UAAU,CAAC;QAC7C,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IACjC,CAAC;IAED,kBAAkB,CAAC,IAAY,EAAE,aAAuB,EAAE,cAAsB;QAC9E,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;QAC7D,MAAM,UAAU,GAAG,IAAI,CAAC,mBAAmB,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;QACzE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC;IAC3C,CAAC;IAED,aAAa,CAAC,WAAwB;QACpC,OAAO,eAAe,CAAC,sBAAsB,CAAC,WAAW,CAAC,IAAI,GAAG,CAAC;IACpE,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface PatternRule {
|
|
2
|
+
patterns: string[];
|
|
3
|
+
description: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ClassificationRule {
|
|
6
|
+
patterns: string[];
|
|
7
|
+
description: string;
|
|
8
|
+
confidence: number;
|
|
9
|
+
}
|
|
10
|
+
export interface PatternConfig {
|
|
11
|
+
dailyPatterns: Record<string, PatternRule>;
|
|
12
|
+
ticketPatterns: Record<string, PatternRule>;
|
|
13
|
+
classificationRules: Record<string, ClassificationRule>;
|
|
14
|
+
confidence: {
|
|
15
|
+
high: number;
|
|
16
|
+
medium: number;
|
|
17
|
+
low: number;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export declare const DEFAULT_PATTERNS: PatternConfig;
|
|
21
|
+
//# sourceMappingURL=default-patterns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-patterns.d.ts","sourceRoot":"","sources":["../../src/extraction/default-patterns.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAC3C,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAC5C,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IACxD,UAAU,EAAE;QACV,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH;AAED,eAAO,MAAM,gBAAgB,EAAE,aAuH9B,CAAC"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
export const DEFAULT_PATTERNS = {
|
|
2
|
+
dailyPatterns: {
|
|
3
|
+
problem: {
|
|
4
|
+
patterns: [
|
|
5
|
+
"同じエラー|また発生|繰り返し",
|
|
6
|
+
"error.*same|again|recurring",
|
|
7
|
+
"^##\\s+問題\\s*$",
|
|
8
|
+
"^##\\s+Problems?\\s*$",
|
|
9
|
+
"問題:|Problem:|エラー:|Error:|失敗:|Failed:",
|
|
10
|
+
],
|
|
11
|
+
description: "Problems and errors encountered",
|
|
12
|
+
},
|
|
13
|
+
solution: {
|
|
14
|
+
patterns: [
|
|
15
|
+
"解決|修正|完了|fixed|solved|resolved",
|
|
16
|
+
"^##\\s+解決\\s*$",
|
|
17
|
+
"^##\\s+Solutions?\\s*$",
|
|
18
|
+
"解決策:|Solution:|対処法:|修正方法:",
|
|
19
|
+
],
|
|
20
|
+
description: "Solutions and fixes applied",
|
|
21
|
+
},
|
|
22
|
+
learning: {
|
|
23
|
+
patterns: [
|
|
24
|
+
"^##\\s+学び\\s*$",
|
|
25
|
+
"^##\\s+Learning|Learned\\s*$",
|
|
26
|
+
"学んだこと:|Learned:|気づき:|Insight:",
|
|
27
|
+
"次回は|Next time|今後は",
|
|
28
|
+
],
|
|
29
|
+
description: "Learnings and insights",
|
|
30
|
+
},
|
|
31
|
+
time: {
|
|
32
|
+
patterns: [
|
|
33
|
+
"(\\d+)\\s*時間",
|
|
34
|
+
"(\\d+)\\s*分",
|
|
35
|
+
"(\\d+)\\s*h(?:our)?s?",
|
|
36
|
+
"(\\d+)\\s*m(?:in)?s?",
|
|
37
|
+
"見積[もり]*[::]\\s*(\\d+)",
|
|
38
|
+
"実績[::]\\s*(\\d+)",
|
|
39
|
+
],
|
|
40
|
+
description: "Time estimates and actuals",
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
ticketPatterns: {
|
|
44
|
+
problem: {
|
|
45
|
+
patterns: [
|
|
46
|
+
"^##\\s+問題定義\\s*$",
|
|
47
|
+
"^##\\s+Problem\\s*$",
|
|
48
|
+
"^##\\s+課題\\s*$",
|
|
49
|
+
"^##\\s+Issue\\s*$",
|
|
50
|
+
"エラー:|Error:|バグ:|Bug:",
|
|
51
|
+
],
|
|
52
|
+
description: "Problem definition in tickets",
|
|
53
|
+
},
|
|
54
|
+
solution: {
|
|
55
|
+
patterns: [
|
|
56
|
+
"^##\\s+解決\\s*$",
|
|
57
|
+
"^##\\s+Resolution\\s*$",
|
|
58
|
+
"^##\\s+実装結果\\s*$",
|
|
59
|
+
"^##\\s+Result\\s*$",
|
|
60
|
+
"完了:|Completed:|実装:|Implemented:",
|
|
61
|
+
],
|
|
62
|
+
description: "Solution and resolution",
|
|
63
|
+
},
|
|
64
|
+
learning: {
|
|
65
|
+
patterns: [
|
|
66
|
+
"^##\\s+学び\\s*$",
|
|
67
|
+
"^##\\s+Learnings?\\s*$",
|
|
68
|
+
"学んだこと:|Learned:|知見:|Takeaway:",
|
|
69
|
+
],
|
|
70
|
+
description: "Learnings from ticket work",
|
|
71
|
+
},
|
|
72
|
+
time: {
|
|
73
|
+
patterns: [
|
|
74
|
+
"(\\d+)\\s*時間",
|
|
75
|
+
"(\\d+)\\s*分",
|
|
76
|
+
"(\\d+)\\s*h(?:our)?s?",
|
|
77
|
+
"(\\d+)\\s*m(?:in)?s?",
|
|
78
|
+
"見積[もり]*[::]\\s*(\\d+)",
|
|
79
|
+
"実績[::]\\s*(\\d+)",
|
|
80
|
+
],
|
|
81
|
+
description: "Time estimates and actuals",
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
classificationRules: {
|
|
85
|
+
recurring_error: {
|
|
86
|
+
patterns: [
|
|
87
|
+
"同じエラー.*again|また発生|繰り返し",
|
|
88
|
+
"error.*same.*again",
|
|
89
|
+
"recurring.*error",
|
|
90
|
+
"再度.*エラー",
|
|
91
|
+
],
|
|
92
|
+
description: "Recurring errors that happened before",
|
|
93
|
+
confidence: 0.8,
|
|
94
|
+
},
|
|
95
|
+
solution_found: {
|
|
96
|
+
patterns: [
|
|
97
|
+
"solved|fixed|解決|修正完了",
|
|
98
|
+
"問題.*解決|issue.*solved",
|
|
99
|
+
"完了.*修正|completed.*fix",
|
|
100
|
+
],
|
|
101
|
+
description: "Solutions that resolved problems",
|
|
102
|
+
confidence: 0.9,
|
|
103
|
+
},
|
|
104
|
+
time_estimate: {
|
|
105
|
+
patterns: [
|
|
106
|
+
"\\d+[hH時間分min]",
|
|
107
|
+
"見積[もり]*[::]\\s*\\d+",
|
|
108
|
+
"実績[::]\\s*\\d+",
|
|
109
|
+
"estimate.*\\d+.*hours?",
|
|
110
|
+
],
|
|
111
|
+
description: "Time estimates and actuals",
|
|
112
|
+
confidence: 0.7,
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
confidence: {
|
|
116
|
+
high: 0.9,
|
|
117
|
+
medium: 0.7,
|
|
118
|
+
low: 0.5,
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
//# sourceMappingURL=default-patterns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-patterns.js","sourceRoot":"","sources":["../../src/extraction/default-patterns.ts"],"names":[],"mappings":"AAsBA,MAAM,CAAC,MAAM,gBAAgB,GAAkB;IAC7C,aAAa,EAAE;QACb,OAAO,EAAE;YACP,QAAQ,EAAE;gBACR,iBAAiB;gBACjB,6BAA6B;gBAC7B,gBAAgB;gBAChB,uBAAuB;gBACvB,sCAAsC;aACvC;YACD,WAAW,EAAE,iCAAiC;SAC/C;QACD,QAAQ,EAAE;YACR,QAAQ,EAAE;gBACR,gCAAgC;gBAChC,gBAAgB;gBAChB,wBAAwB;gBACxB,2BAA2B;aAC5B;YACD,WAAW,EAAE,6BAA6B;SAC3C;QACD,QAAQ,EAAE;YACR,QAAQ,EAAE;gBACR,gBAAgB;gBAChB,8BAA8B;gBAC9B,+BAA+B;gBAC/B,mBAAmB;aACpB;YACD,WAAW,EAAE,wBAAwB;SACtC;QACD,IAAI,EAAE;YACJ,QAAQ,EAAE;gBACR,cAAc;gBACd,aAAa;gBACb,uBAAuB;gBACvB,sBAAsB;gBACtB,uBAAuB;gBACvB,kBAAkB;aACnB;YACD,WAAW,EAAE,4BAA4B;SAC1C;KACF;IACD,cAAc,EAAE;QACd,OAAO,EAAE;YACP,QAAQ,EAAE;gBACR,kBAAkB;gBAClB,qBAAqB;gBACrB,gBAAgB;gBAChB,mBAAmB;gBACnB,sBAAsB;aACvB;YACD,WAAW,EAAE,+BAA+B;SAC7C;QACD,QAAQ,EAAE;YACR,QAAQ,EAAE;gBACR,gBAAgB;gBAChB,wBAAwB;gBACxB,kBAAkB;gBAClB,oBAAoB;gBACpB,iCAAiC;aAClC;YACD,WAAW,EAAE,yBAAyB;SACvC;QACD,QAAQ,EAAE;YACR,QAAQ,EAAE;gBACR,gBAAgB;gBAChB,wBAAwB;gBACxB,+BAA+B;aAChC;YACD,WAAW,EAAE,4BAA4B;SAC1C;QACD,IAAI,EAAE;YACJ,QAAQ,EAAE;gBACR,cAAc;gBACd,aAAa;gBACb,uBAAuB;gBACvB,sBAAsB;gBACtB,uBAAuB;gBACvB,kBAAkB;aACnB;YACD,WAAW,EAAE,4BAA4B;SAC1C;KACF;IACD,mBAAmB,EAAE;QACnB,eAAe,EAAE;YACf,QAAQ,EAAE;gBACR,wBAAwB;gBACxB,oBAAoB;gBACpB,kBAAkB;gBAClB,SAAS;aACV;YACD,WAAW,EAAE,uCAAuC;YACpD,UAAU,EAAE,GAAG;SAChB;QACD,cAAc,EAAE;YACd,QAAQ,EAAE;gBACR,sBAAsB;gBACtB,sBAAsB;gBACtB,uBAAuB;aACxB;YACD,WAAW,EAAE,kCAAkC;YAC/C,UAAU,EAAE,GAAG;SAChB;QACD,aAAa,EAAE;YACb,QAAQ,EAAE;gBACR,gBAAgB;gBAChB,qBAAqB;gBACrB,gBAAgB;gBAChB,wBAAwB;aACzB;YACD,WAAW,EAAE,4BAA4B;YACzC,UAAU,EAAE,GAAG;SAChB;KACF;IACD,UAAU,EAAE;QACV,IAAI,EAAE,GAAG;QACT,MAAM,EAAE,GAAG;QACX,GAAG,EAAE,GAAG;KACT;CACF,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ExtractedPattern } from "../types.js";
|
|
2
|
+
import type { PatternConfig } from "./default-patterns.js";
|
|
3
|
+
export declare class PatternExtractor {
|
|
4
|
+
private config;
|
|
5
|
+
private codeBlockDetector;
|
|
6
|
+
private contextAnalyzer;
|
|
7
|
+
constructor(customPatterns?: Partial<PatternConfig>);
|
|
8
|
+
extractDailyPatterns(content: string): ExtractedPattern[];
|
|
9
|
+
extractTicketPatterns(content: string): ExtractedPattern[];
|
|
10
|
+
private isValidPatternType;
|
|
11
|
+
private extractPattern;
|
|
12
|
+
private createSectionPattern;
|
|
13
|
+
private extractTimePatterns;
|
|
14
|
+
private getContext;
|
|
15
|
+
private getPreviousLines;
|
|
16
|
+
private isCodeComment;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=pattern-extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pattern-extractor.d.ts","sourceRoot":"","sources":["../../src/extraction/pattern-extractor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAe,MAAM,aAAa,CAAC;AACjE,OAAO,KAAK,EAAe,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAKxE,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,iBAAiB,CAAoB;IAC7C,OAAO,CAAC,eAAe,CAAkB;gBAE7B,cAAc,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC;IAMnD,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,EAAE;IAYzD,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,EAAE;IAiB1D,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,cAAc;IAkHtB,OAAO,CAAC,oBAAoB;IAyB5B,OAAO,CAAC,mBAAmB;IAmC3B,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,aAAa;CAWtB"}
|