context-eng 0.1.0
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/README.md +272 -0
- package/dist/categories.d.ts +27 -0
- package/dist/categories.js +71 -0
- package/dist/categories.js.map +1 -0
- package/dist/cli-entry.d.ts +2 -0
- package/dist/cli-entry.js +7 -0
- package/dist/cli-entry.js.map +1 -0
- package/dist/cli.d.ts +30 -0
- package/dist/cli.js +327 -0
- package/dist/cli.js.map +1 -0
- package/dist/db.d.ts +40 -0
- package/dist/db.js +158 -0
- package/dist/db.js.map +1 -0
- package/dist/engine.d.ts +149 -0
- package/dist/engine.js +589 -0
- package/dist/engine.js.map +1 -0
- package/dist/harness.d.ts +56 -0
- package/dist/harness.js +358 -0
- package/dist/harness.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/inspect-cli.d.ts +2 -0
- package/dist/inspect-cli.js +96 -0
- package/dist/inspect-cli.js.map +1 -0
- package/dist/inspect.d.ts +33 -0
- package/dist/inspect.js +149 -0
- package/dist/inspect.js.map +1 -0
- package/dist/map.d.ts +39 -0
- package/dist/map.js +106 -0
- package/dist/map.js.map +1 -0
- package/dist/mcp.d.ts +5 -0
- package/dist/mcp.js +348 -0
- package/dist/mcp.js.map +1 -0
- package/dist/migrate.d.ts +7 -0
- package/dist/migrate.js +107 -0
- package/dist/migrate.js.map +1 -0
- package/dist/paths.d.ts +29 -0
- package/dist/paths.js +69 -0
- package/dist/paths.js.map +1 -0
- package/dist/search.d.ts +144 -0
- package/dist/search.js +449 -0
- package/dist/search.js.map +1 -0
- package/dist/secrets.d.ts +28 -0
- package/dist/secrets.js +135 -0
- package/dist/secrets.js.map +1 -0
- package/dist/text.d.ts +22 -0
- package/dist/text.js +153 -0
- package/dist/text.js.map +1 -0
- package/dist/tokens.d.ts +6 -0
- package/dist/tokens.js +15 -0
- package/dist/tokens.js.map +1 -0
- package/dist/typesafe.d.ts +40 -0
- package/dist/typesafe.js +170 -0
- package/dist/typesafe.js.map +1 -0
- package/package.json +51 -0
- package/system_prompts/AGENTS.md +14 -0
- package/system_prompts/CLAUDE.md +14 -0
- package/system_prompts/rules.md +157 -0
package/dist/engine.d.ts
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { type Category, type Scope } from "./categories.js";
|
|
2
|
+
import { type MapIndex } from "./map.js";
|
|
3
|
+
import { type Layout } from "./paths.js";
|
|
4
|
+
import { EngineError, budgetHits, sortHits, type SearchDebugSnapshot, type SearchInput, type SearchResult } from "./search.js";
|
|
5
|
+
export { EngineError, budgetHits, sortHits };
|
|
6
|
+
export type { EngineErrorCode, ListFilter, MatchMode, SearchFilters, SearchHints, SearchHit, SearchInput, SearchResult, SearchSort, TimeFilter } from "./search.js";
|
|
7
|
+
export interface Memory {
|
|
8
|
+
id: string;
|
|
9
|
+
scope: Scope;
|
|
10
|
+
category: Category;
|
|
11
|
+
content: string;
|
|
12
|
+
subject?: string;
|
|
13
|
+
topics: string[];
|
|
14
|
+
tags: string[];
|
|
15
|
+
links: string[];
|
|
16
|
+
importance: number;
|
|
17
|
+
staging: boolean;
|
|
18
|
+
active: boolean;
|
|
19
|
+
tokens: number;
|
|
20
|
+
created_at: number;
|
|
21
|
+
updated_at: number;
|
|
22
|
+
}
|
|
23
|
+
export interface CreateInput {
|
|
24
|
+
scope: Scope;
|
|
25
|
+
category: Category;
|
|
26
|
+
confirmNewCategory?: boolean;
|
|
27
|
+
content: string;
|
|
28
|
+
subject?: string;
|
|
29
|
+
topics?: string[];
|
|
30
|
+
tags?: string[];
|
|
31
|
+
links?: string[];
|
|
32
|
+
importance?: number;
|
|
33
|
+
}
|
|
34
|
+
export interface CreateResult {
|
|
35
|
+
memory: Memory;
|
|
36
|
+
promoted: boolean;
|
|
37
|
+
projectPath?: string;
|
|
38
|
+
projectKey?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface BindResult {
|
|
41
|
+
projectPath: string;
|
|
42
|
+
projectKey: string;
|
|
43
|
+
created: boolean;
|
|
44
|
+
maps: {
|
|
45
|
+
global: string;
|
|
46
|
+
project: string;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export interface CategoryListResult {
|
|
50
|
+
global?: string[];
|
|
51
|
+
project?: {
|
|
52
|
+
projectPath: string;
|
|
53
|
+
categories: string[];
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export interface MemoryMapResult {
|
|
57
|
+
global: MapIndex;
|
|
58
|
+
project?: MapIndex;
|
|
59
|
+
}
|
|
60
|
+
export interface EditInput {
|
|
61
|
+
content?: string;
|
|
62
|
+
category?: Category;
|
|
63
|
+
confirmNewCategory?: boolean;
|
|
64
|
+
subject?: string | null;
|
|
65
|
+
topics?: string[];
|
|
66
|
+
tags?: string[];
|
|
67
|
+
links?: string[];
|
|
68
|
+
importance?: number;
|
|
69
|
+
}
|
|
70
|
+
export interface EngineOptions {
|
|
71
|
+
projectPath?: string;
|
|
72
|
+
home?: string;
|
|
73
|
+
deferProject?: boolean;
|
|
74
|
+
}
|
|
75
|
+
export declare class Engine {
|
|
76
|
+
private readonly globalLayout;
|
|
77
|
+
private projectLayout;
|
|
78
|
+
private readonly globalCatalog;
|
|
79
|
+
private projectCatalog;
|
|
80
|
+
private readonly categoryDbs;
|
|
81
|
+
constructor(opts?: EngineOptions);
|
|
82
|
+
get layout(): Layout;
|
|
83
|
+
get projectPath(): string | undefined;
|
|
84
|
+
get globalMapPath(): string;
|
|
85
|
+
get projectMapPath(): string;
|
|
86
|
+
close(): void;
|
|
87
|
+
bind(projectPath: string): BindResult;
|
|
88
|
+
create(input: CreateInput): CreateResult;
|
|
89
|
+
edit(currentCategory: Category, id: string, patch: EditInput): Memory;
|
|
90
|
+
get(category: Category, id: string): Memory;
|
|
91
|
+
promote(category: Category, target: string | {
|
|
92
|
+
id?: string;
|
|
93
|
+
line?: string;
|
|
94
|
+
}): Memory;
|
|
95
|
+
demote(category: Category, target: string | {
|
|
96
|
+
id?: string;
|
|
97
|
+
line?: string;
|
|
98
|
+
}): Memory;
|
|
99
|
+
delete(category: Category, target: string | {
|
|
100
|
+
id?: string;
|
|
101
|
+
line?: string;
|
|
102
|
+
}): {
|
|
103
|
+
id: string;
|
|
104
|
+
deleted: true;
|
|
105
|
+
};
|
|
106
|
+
/** Candidates for Jev: exhaustive for small notebooks, bounded signals plus fill for large notebooks. */
|
|
107
|
+
prepareSearch(input: SearchInput): SearchResult;
|
|
108
|
+
/** Raw selection data for diagnostics; formatting and relevance decisions stay outside Engine. */
|
|
109
|
+
prepareSearchDebug(input: SearchInput): SearchDebugSnapshot;
|
|
110
|
+
/** Complete local fallback: lexical and exact-label candidates plus final sorting and read budget. */
|
|
111
|
+
search(input: SearchInput): SearchResult;
|
|
112
|
+
private runSearch;
|
|
113
|
+
private resolveSearch;
|
|
114
|
+
map(): MemoryMapResult;
|
|
115
|
+
map(scope: "global"): {
|
|
116
|
+
global: MapIndex;
|
|
117
|
+
};
|
|
118
|
+
map(scope: "project"): {
|
|
119
|
+
project: MapIndex;
|
|
120
|
+
};
|
|
121
|
+
listCategoryNames(scope?: Scope): CategoryListResult;
|
|
122
|
+
refreshMaps(): {
|
|
123
|
+
global: MapIndex;
|
|
124
|
+
project: MapIndex;
|
|
125
|
+
};
|
|
126
|
+
listStaging(scope: Scope, category?: Category): Memory[];
|
|
127
|
+
categoryDatabasePath(scope: Scope, category: Category): string;
|
|
128
|
+
private searchAccess;
|
|
129
|
+
private mapSources;
|
|
130
|
+
private refreshGlobalMap;
|
|
131
|
+
private refreshAvailableMaps;
|
|
132
|
+
private openProject;
|
|
133
|
+
private closeProject;
|
|
134
|
+
private catalogFor;
|
|
135
|
+
private categoriesDir;
|
|
136
|
+
private recordFor;
|
|
137
|
+
private requireRecord;
|
|
138
|
+
private ensureCategory;
|
|
139
|
+
private dbForRecord;
|
|
140
|
+
private dbCacheKey;
|
|
141
|
+
private locate;
|
|
142
|
+
private locateSelector;
|
|
143
|
+
private locateByLine;
|
|
144
|
+
private setChatLocated;
|
|
145
|
+
private moveRow;
|
|
146
|
+
private migrateScope;
|
|
147
|
+
private bindResult;
|
|
148
|
+
private requireProjectLayout;
|
|
149
|
+
}
|