@roackb2/heddle 1.6.0 → 1.7.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/README.md +5 -0
- package/dist/examples/repo-investigator.js +2 -2
- package/dist/examples/repo-investigator.js.map +1 -1
- package/dist/src/cli/ask.d.ts.map +1 -1
- package/dist/src/cli/ask.js +4 -4
- package/dist/src/cli/ask.js.map +1 -1
- package/dist/src/cli/chat/commands/debug-snapshot-command.js +2 -2
- package/dist/src/cli/chat/commands/debug-snapshot-command.js.map +1 -1
- package/dist/src/cli/chat/state/local-commands.js +6 -6
- package/dist/src/cli/chat/state/local-commands.js.map +1 -1
- package/dist/src/cli/chat/utils/runtime.d.ts.map +1 -1
- package/dist/src/cli/chat/utils/runtime.js +3 -3
- package/dist/src/cli/chat/utils/runtime.js.map +1 -1
- package/dist/src/cli/main.js +22 -20
- package/dist/src/cli/main.js.map +1 -1
- package/dist/src/cli/remote/control-plane-client.d.ts +1 -1
- package/dist/src/core/agent/budget/index.d.ts +2 -0
- package/dist/src/core/agent/budget/index.d.ts.map +1 -0
- package/dist/src/core/agent/budget/index.js +2 -0
- package/dist/src/core/agent/budget/index.js.map +1 -0
- package/dist/src/core/agent/budget/step-budget.d.ts +12 -0
- package/dist/src/core/agent/budget/step-budget.d.ts.map +1 -0
- package/dist/src/core/agent/budget/step-budget.js +21 -0
- package/dist/src/core/agent/budget/step-budget.js.map +1 -0
- package/dist/src/core/agent/context/run-context-builder.js +6 -6
- package/dist/src/core/agent/context/run-context-builder.js.map +1 -1
- package/dist/src/core/agent/tools/tool-dispatcher.d.ts +3 -4
- package/dist/src/core/agent/tools/tool-dispatcher.d.ts.map +1 -1
- package/dist/src/core/agent/tools/tool-dispatcher.js +2 -2
- package/dist/src/core/agent/tools/tool-dispatcher.js.map +1 -1
- package/dist/src/core/agent/types.d.ts +5 -5
- package/dist/src/core/agent/types.d.ts.map +1 -1
- package/dist/src/core/chat/engine/turns/memory/turn-memory-maintenance.d.ts.map +1 -1
- package/dist/src/core/chat/engine/turns/memory/turn-memory-maintenance.js +9 -5
- package/dist/src/core/chat/engine/turns/memory/turn-memory-maintenance.js.map +1 -1
- package/dist/src/core/chat/engine/turns/runtime/runtime-resolver.d.ts.map +1 -1
- package/dist/src/core/chat/engine/turns/runtime/runtime-resolver.js +2 -3
- package/dist/src/core/chat/engine/turns/runtime/runtime-resolver.js.map +1 -1
- package/dist/src/core/commands/slash/autocomplete.d.ts +9 -4
- package/dist/src/core/commands/slash/autocomplete.d.ts.map +1 -1
- package/dist/src/core/commands/slash/autocomplete.js +53 -48
- package/dist/src/core/commands/slash/autocomplete.js.map +1 -1
- package/dist/src/core/commands/slash/modules/auth/auth-commands.js +4 -4
- package/dist/src/core/commands/slash/modules/auth/auth-commands.js.map +1 -1
- package/dist/src/core/commands/slash/modules/compaction/compaction-commands.js +2 -2
- package/dist/src/core/commands/slash/modules/compaction/compaction-commands.js.map +1 -1
- package/dist/src/core/commands/slash/modules/drift/drift-commands.js +4 -4
- package/dist/src/core/commands/slash/modules/drift/drift-commands.js.map +1 -1
- package/dist/src/core/commands/slash/modules/heartbeat/heartbeat-commands.js +3 -3
- package/dist/src/core/commands/slash/modules/heartbeat/heartbeat-commands.js.map +1 -1
- package/dist/src/core/commands/slash/modules/model/model-commands.js +8 -8
- package/dist/src/core/commands/slash/modules/model/model-commands.js.map +1 -1
- package/dist/src/core/commands/slash/modules/session/session-commands.js +6 -6
- package/dist/src/core/commands/slash/modules/session/session-commands.js.map +1 -1
- package/dist/src/core/commands/slash/parser.d.ts +10 -5
- package/dist/src/core/commands/slash/parser.d.ts.map +1 -1
- package/dist/src/core/commands/slash/parser.js +42 -37
- package/dist/src/core/commands/slash/parser.js.map +1 -1
- package/dist/src/core/commands/slash/registry.d.ts +12 -3
- package/dist/src/core/commands/slash/registry.d.ts.map +1 -1
- package/dist/src/core/commands/slash/registry.js +50 -45
- package/dist/src/core/commands/slash/registry.js.map +1 -1
- package/dist/src/core/heartbeat/wake/service.d.ts.map +1 -1
- package/dist/src/core/heartbeat/wake/service.js +2 -3
- package/dist/src/core/heartbeat/wake/service.js.map +1 -1
- package/dist/src/core/memory/catalog.d.ts +22 -40
- package/dist/src/core/memory/catalog.d.ts.map +1 -1
- package/dist/src/core/memory/catalog.js +166 -155
- package/dist/src/core/memory/catalog.js.map +1 -1
- package/dist/src/core/memory/index.d.ts +14 -0
- package/dist/src/core/memory/index.d.ts.map +1 -0
- package/dist/src/core/memory/index.js +13 -0
- package/dist/src/core/memory/index.js.map +1 -0
- package/dist/src/core/memory/maintainer-prompt.d.ts +14 -0
- package/dist/src/core/memory/maintainer-prompt.d.ts.map +1 -0
- package/dist/src/core/memory/maintainer-prompt.js +58 -0
- package/dist/src/core/memory/maintainer-prompt.js.map +1 -0
- package/dist/src/core/memory/maintainer.d.ts +20 -44
- package/dist/src/core/memory/maintainer.d.ts.map +1 -1
- package/dist/src/core/memory/maintainer.js +124 -184
- package/dist/src/core/memory/maintainer.js.map +1 -1
- package/dist/src/core/memory/maintenance-integration.d.ts +22 -19
- package/dist/src/core/memory/maintenance-integration.d.ts.map +1 -1
- package/dist/src/core/memory/maintenance-integration.js +158 -163
- package/dist/src/core/memory/maintenance-integration.js.map +1 -1
- package/dist/src/core/memory/maintenance-repository.d.ts +27 -0
- package/dist/src/core/memory/maintenance-repository.d.ts.map +1 -0
- package/dist/src/core/memory/maintenance-repository.js +134 -0
- package/dist/src/core/memory/maintenance-repository.js.map +1 -0
- package/dist/src/core/memory/note-service.d.ts +23 -0
- package/dist/src/core/memory/note-service.d.ts.map +1 -0
- package/dist/src/core/memory/note-service.js +165 -0
- package/dist/src/core/memory/note-service.js.map +1 -0
- package/dist/src/core/memory/path-utils.d.ts +15 -0
- package/dist/src/core/memory/path-utils.d.ts.map +1 -0
- package/dist/src/core/memory/path-utils.js +31 -0
- package/dist/src/core/memory/path-utils.js.map +1 -0
- package/dist/src/core/memory/schemas.d.ts +116 -0
- package/dist/src/core/memory/schemas.d.ts.map +1 -0
- package/dist/src/core/memory/schemas.js +53 -0
- package/dist/src/core/memory/schemas.js.map +1 -0
- package/dist/src/core/memory/types.d.ts +149 -0
- package/dist/src/core/memory/types.d.ts.map +1 -0
- package/dist/src/core/memory/types.js +2 -0
- package/dist/src/core/memory/types.js.map +1 -0
- package/dist/src/core/memory/validation.d.ts +20 -38
- package/dist/src/core/memory/validation.d.ts.map +1 -1
- package/dist/src/core/memory/validation.js +98 -83
- package/dist/src/core/memory/validation.js.map +1 -1
- package/dist/src/core/memory/visibility.d.ts +19 -41
- package/dist/src/core/memory/visibility.d.ts.map +1 -1
- package/dist/src/core/memory/visibility.js +53 -153
- package/dist/src/core/memory/visibility.js.map +1 -1
- package/dist/src/core/review/index.d.ts +3 -0
- package/dist/src/core/review/index.d.ts.map +1 -0
- package/dist/src/core/review/index.js +2 -0
- package/dist/src/core/review/index.js.map +1 -0
- package/dist/src/core/review/service.d.ts +22 -0
- package/dist/src/core/review/service.d.ts.map +1 -0
- package/dist/src/core/review/service.js +143 -0
- package/dist/src/core/review/service.js.map +1 -0
- package/dist/src/core/review/{diff-domain.d.ts → types.d.ts} +1 -3
- package/dist/src/core/review/types.d.ts.map +1 -0
- package/dist/src/core/review/types.js +2 -0
- package/dist/src/core/review/types.js.map +1 -0
- package/dist/src/core/runtime/tools/service.js +2 -2
- package/dist/src/core/runtime/tools/service.js.map +1 -1
- package/dist/src/core/tools/execute-tool.d.ts +5 -4
- package/dist/src/core/tools/execute-tool.d.ts.map +1 -1
- package/dist/src/core/tools/execute-tool.js +23 -25
- package/dist/src/core/tools/execute-tool.js.map +1 -1
- package/dist/src/core/tools/index.d.ts +5 -0
- package/dist/src/core/tools/index.d.ts.map +1 -0
- package/dist/src/core/tools/index.js +4 -0
- package/dist/src/core/tools/index.js.map +1 -0
- package/dist/src/core/tools/registry.d.ts +8 -7
- package/dist/src/core/tools/registry.d.ts.map +1 -1
- package/dist/src/core/tools/registry.js +18 -21
- package/dist/src/core/tools/registry.js.map +1 -1
- package/dist/src/core/tools/toolkit.d.ts +9 -4
- package/dist/src/core/tools/toolkit.d.ts.map +1 -1
- package/dist/src/core/tools/toolkit.js +21 -16
- package/dist/src/core/tools/toolkit.js.map +1 -1
- package/dist/src/core/tools/toolkits/knowledge/memory-notes.d.ts +1 -1
- package/dist/src/core/tools/toolkits/knowledge/memory-notes.d.ts.map +1 -1
- package/dist/src/core/tools/toolkits/knowledge/memory-notes.js +48 -238
- package/dist/src/core/tools/toolkits/knowledge/memory-notes.js.map +1 -1
- package/dist/src/core/tools/toolkits/knowledge/record-knowledge.d.ts.map +1 -1
- package/dist/src/core/tools/toolkits/knowledge/record-knowledge.js +75 -105
- package/dist/src/core/tools/toolkits/knowledge/record-knowledge.js.map +1 -1
- package/dist/src/core/trace/format.d.ts +9 -3
- package/dist/src/core/trace/format.d.ts.map +1 -1
- package/dist/src/core/trace/format.js +106 -107
- package/dist/src/core/trace/format.js.map +1 -1
- package/dist/src/core/trace/index.d.ts +4 -0
- package/dist/src/core/trace/index.d.ts.map +1 -0
- package/dist/src/core/trace/index.js +3 -0
- package/dist/src/core/trace/index.js.map +1 -0
- package/dist/src/core/trace/recorder.d.ts +10 -7
- package/dist/src/core/trace/recorder.d.ts.map +1 -1
- package/dist/src/core/trace/recorder.js +15 -17
- package/dist/src/core/trace/recorder.js.map +1 -1
- package/dist/src/core/trace/types.d.ts +7 -0
- package/dist/src/core/trace/types.d.ts.map +1 -0
- package/dist/src/core/trace/types.js +2 -0
- package/dist/src/core/trace/types.js.map +1 -0
- package/dist/src/index.d.ts +15 -14
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +11 -8
- package/dist/src/index.js.map +1 -1
- package/dist/src/server/features/control-plane/controllers/ask.d.ts.map +1 -1
- package/dist/src/server/features/control-plane/controllers/ask.js +6 -7
- package/dist/src/server/features/control-plane/controllers/ask.js.map +1 -1
- package/dist/src/server/features/control-plane/controllers/chat-turn-review-presenter.js +3 -3
- package/dist/src/server/features/control-plane/controllers/chat-turn-review-presenter.js.map +1 -1
- package/dist/src/server/features/control-plane/controllers/memory.d.ts +2 -1
- package/dist/src/server/features/control-plane/controllers/memory.d.ts.map +1 -1
- package/dist/src/server/features/control-plane/controllers/memory.js +8 -7
- package/dist/src/server/features/control-plane/controllers/memory.js.map +1 -1
- package/dist/src/server/features/control-plane/controllers/workspace-diff.js +2 -2
- package/dist/src/server/features/control-plane/controllers/workspace-diff.js.map +1 -1
- package/dist/src/server/features/control-plane/router.d.ts +1 -1
- package/dist/src/server/features/control-plane/types.d.ts +2 -2
- package/dist/src/server/features/control-plane/types.d.ts.map +1 -1
- package/dist/src/server/router.d.ts +1 -1
- package/package.json +1 -1
- package/dist/src/core/review/diff-domain.d.ts.map +0 -1
- package/dist/src/core/review/diff-domain.js +0 -134
- package/dist/src/core/review/diff-domain.js.map +0 -1
- package/dist/src/core/utils/budget.d.ts +0 -13
- package/dist/src/core/utils/budget.d.ts.map +0 -1
- package/dist/src/core/utils/budget.js +0 -22
- package/dist/src/core/utils/budget.js.map +0 -1
|
@@ -1,94 +1,109 @@
|
|
|
1
1
|
import { readFile, stat } from 'node:fs/promises';
|
|
2
2
|
import { basename, dirname, join, resolve } from 'node:path';
|
|
3
|
-
import { DEFAULT_MEMORY_FOLDER_CATALOG_MAX_BYTES, DEFAULT_MEMORY_ROOT_CATALOG_MAX_BYTES,
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
3
|
+
import { DEFAULT_MEMORY_FOLDER_CATALOG_MAX_BYTES, DEFAULT_MEMORY_ROOT_CATALOG_MAX_BYTES, MemoryCatalogService, } from './catalog.js';
|
|
4
|
+
import { MemoryMaintenanceRepository } from './maintenance-repository.js';
|
|
5
|
+
import { MemoryVisibilityService } from './visibility.js';
|
|
6
|
+
/**
|
|
7
|
+
* Owns memory workspace health checks and lightweight repair actions.
|
|
8
|
+
*/
|
|
9
|
+
export class MemoryValidationService {
|
|
10
|
+
memoryRoot;
|
|
11
|
+
catalog;
|
|
12
|
+
visibility;
|
|
13
|
+
maintenance;
|
|
14
|
+
constructor(memoryRoot, catalog = new MemoryCatalogService(memoryRoot), visibility = new MemoryVisibilityService(memoryRoot), maintenance = new MemoryMaintenanceRepository(memoryRoot)) {
|
|
15
|
+
this.memoryRoot = memoryRoot;
|
|
16
|
+
this.catalog = catalog;
|
|
17
|
+
this.visibility = visibility;
|
|
18
|
+
this.maintenance = maintenance;
|
|
17
19
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
return {
|
|
31
|
-
memoryRoot,
|
|
32
|
-
ok: issues.every((issue) => issue.severity !== 'error'),
|
|
33
|
-
issueCount: issues.length,
|
|
34
|
-
issues,
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
export async function repairMissingMemoryCatalogs(options) {
|
|
38
|
-
return bootstrapMemoryWorkspace({ memoryRoot: options.memoryRoot });
|
|
39
|
-
}
|
|
40
|
-
async function appendOversizedCatalogIssues(memoryRoot, notes, issues) {
|
|
41
|
-
for (const path of notes.filter((note) => basename(note).toLowerCase() === 'readme.md')) {
|
|
42
|
-
const fullPath = join(memoryRoot, path);
|
|
43
|
-
const info = await stat(fullPath);
|
|
44
|
-
const maxBytes = path === 'README.md' ? DEFAULT_MEMORY_ROOT_CATALOG_MAX_BYTES : DEFAULT_MEMORY_FOLDER_CATALOG_MAX_BYTES;
|
|
45
|
-
if (info.size <= maxBytes) {
|
|
46
|
-
continue;
|
|
20
|
+
async validate() {
|
|
21
|
+
const memoryRoot = resolve(this.memoryRoot);
|
|
22
|
+
const issues = [];
|
|
23
|
+
const shape = this.catalog.validateShape();
|
|
24
|
+
for (const path of shape.missing) {
|
|
25
|
+
issues.push({
|
|
26
|
+
type: 'missing_catalog',
|
|
27
|
+
severity: 'error',
|
|
28
|
+
path,
|
|
29
|
+
message: `Missing required memory catalog: ${path}`,
|
|
30
|
+
});
|
|
47
31
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
32
|
+
const notes = await this.visibility.listNotePaths();
|
|
33
|
+
await this.appendOversizedCatalogIssues(memoryRoot, notes, issues);
|
|
34
|
+
await this.appendOrphanNoteIssues(memoryRoot, notes, issues);
|
|
35
|
+
const pending = await this.maintenance.readPendingCandidates();
|
|
36
|
+
if (pending.length > 0) {
|
|
37
|
+
issues.push({
|
|
38
|
+
type: 'pending_candidates',
|
|
39
|
+
severity: 'info',
|
|
40
|
+
count: pending.length,
|
|
41
|
+
message: `${pending.length} pending memory candidate${pending.length === 1 ? '' : 's'} waiting for maintenance.`,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
memoryRoot,
|
|
46
|
+
ok: issues.every((issue) => issue.severity !== 'error'),
|
|
47
|
+
issueCount: issues.length,
|
|
48
|
+
issues,
|
|
49
|
+
};
|
|
56
50
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const catalogPaths = notes.filter((note) => basename(note).toLowerCase() === 'readme.md');
|
|
60
|
-
const catalogTextByPath = new Map();
|
|
61
|
-
for (const catalogPath of catalogPaths) {
|
|
62
|
-
catalogTextByPath.set(catalogPath, await readFile(join(memoryRoot, catalogPath), 'utf8'));
|
|
51
|
+
repairMissingCatalogs() {
|
|
52
|
+
return this.catalog.bootstrap();
|
|
63
53
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
54
|
+
async appendOversizedCatalogIssues(memoryRoot, notes, issues) {
|
|
55
|
+
for (const path of notes.filter((note) => basename(note).toLowerCase() === 'readme.md')) {
|
|
56
|
+
const fullPath = join(memoryRoot, path);
|
|
57
|
+
const info = await stat(fullPath);
|
|
58
|
+
const maxBytes = path === 'README.md' ? DEFAULT_MEMORY_ROOT_CATALOG_MAX_BYTES : DEFAULT_MEMORY_FOLDER_CATALOG_MAX_BYTES;
|
|
59
|
+
if (info.size <= maxBytes) {
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
issues.push({
|
|
63
|
+
type: 'oversized_catalog',
|
|
64
|
+
severity: 'warning',
|
|
65
|
+
path,
|
|
66
|
+
sizeBytes: info.size,
|
|
67
|
+
maxBytes,
|
|
68
|
+
message: `Memory catalog ${path} is ${info.size} bytes, above the ${maxBytes} byte cap.`,
|
|
69
|
+
});
|
|
67
70
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
const
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
}
|
|
72
|
+
async appendOrphanNoteIssues(memoryRoot, notes, issues) {
|
|
73
|
+
const catalogPaths = notes.filter((note) => basename(note).toLowerCase() === 'readme.md');
|
|
74
|
+
const catalogTextByPath = new Map();
|
|
75
|
+
for (const catalogPath of catalogPaths) {
|
|
76
|
+
catalogTextByPath.set(catalogPath, await readFile(join(memoryRoot, catalogPath), 'utf8'));
|
|
77
|
+
}
|
|
78
|
+
for (const note of notes) {
|
|
79
|
+
if (basename(note).toLowerCase() === 'readme.md') {
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
const folderCatalog = MemoryValidationService.catalogPathForNote(note);
|
|
83
|
+
const folderCatalogText = catalogTextByPath.get(folderCatalog) ?? '';
|
|
84
|
+
const rootCatalogText = catalogTextByPath.get('README.md') ?? '';
|
|
85
|
+
const localName = basename(note);
|
|
86
|
+
const linkedFromFolder = folderCatalogText.includes(localName) || folderCatalogText.includes(note);
|
|
87
|
+
const linkedFromRoot = rootCatalogText.includes(note);
|
|
88
|
+
if (linkedFromFolder || linkedFromRoot) {
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
issues.push({
|
|
92
|
+
type: 'orphan_note',
|
|
93
|
+
severity: 'warning',
|
|
94
|
+
path: note,
|
|
95
|
+
message: MemoryValidationService.orphanNoteMessage(note, folderCatalog),
|
|
96
|
+
});
|
|
76
97
|
}
|
|
77
|
-
issues.push({
|
|
78
|
-
type: 'orphan_note',
|
|
79
|
-
severity: 'warning',
|
|
80
|
-
path: note,
|
|
81
|
-
message: orphanNoteMessage(note, folderCatalog),
|
|
82
|
-
});
|
|
83
98
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
99
|
+
static catalogPathForNote(path) {
|
|
100
|
+
const folder = dirname(path);
|
|
101
|
+
return folder === '.' ? 'README.md' : join(folder, 'README.md');
|
|
102
|
+
}
|
|
103
|
+
static orphanNoteMessage(note, folderCatalog) {
|
|
104
|
+
return folderCatalog === 'README.md' ?
|
|
105
|
+
`Memory note ${note} is not linked from README.md.`
|
|
106
|
+
: `Memory note ${note} is not linked from ${folderCatalog} or README.md.`;
|
|
107
|
+
}
|
|
93
108
|
}
|
|
94
109
|
//# sourceMappingURL=validation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../../src/core/memory/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EACL,uCAAuC,EACvC,qCAAqC,EACrC,
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../../src/core/memory/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB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
|
|
23
|
-
memoryRoot: string;
|
|
24
|
-
path?: string;
|
|
25
|
-
}): Promise<string[]>;
|
|
26
|
-
export declare function readMemoryNote(options: {
|
|
27
|
-
memoryRoot: string;
|
|
28
|
-
path: string;
|
|
29
|
-
offset?: number;
|
|
30
|
-
maxLines?: number;
|
|
31
|
-
}): Promise<string>;
|
|
32
|
-
export declare function searchMemoryNotes(options: {
|
|
33
|
-
memoryRoot: string;
|
|
34
|
-
query: string;
|
|
35
|
-
path?: string;
|
|
36
|
-
maxResults?: number;
|
|
37
|
-
}): Promise<string>;
|
|
38
|
-
export declare function readRecentMemoryMaintenanceRuns(options: {
|
|
39
|
-
memoryRoot: string;
|
|
40
|
-
limit?: number;
|
|
41
|
-
}): Promise<KnowledgeMaintenanceRunRecord[]>;
|
|
1
|
+
import { MemoryCatalogService } from './catalog.js';
|
|
2
|
+
import { MemoryMaintenanceRepository } from './maintenance-repository.js';
|
|
3
|
+
import { MemoryNoteService } from './note-service.js';
|
|
4
|
+
import type { MemoryStatusView, ReadMemoryNoteInput, SearchMemoryNotesInput } from './types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Owns host-facing memory status and note visibility reads.
|
|
7
|
+
*/
|
|
8
|
+
export declare class MemoryVisibilityService {
|
|
9
|
+
private readonly memoryRoot;
|
|
10
|
+
private readonly notes;
|
|
11
|
+
private readonly maintenance;
|
|
12
|
+
private readonly catalog;
|
|
13
|
+
constructor(memoryRoot: string, notes?: MemoryNoteService, maintenance?: MemoryMaintenanceRepository, catalog?: MemoryCatalogService);
|
|
14
|
+
loadStatus(recentRunLimit?: number): Promise<MemoryStatusView>;
|
|
15
|
+
listNotePaths(path?: string): Promise<string[]>;
|
|
16
|
+
readNote(input: ReadMemoryNoteInput): Promise<string>;
|
|
17
|
+
searchNotes(input: SearchMemoryNotesInput): Promise<string>;
|
|
18
|
+
readRecentMaintenanceRuns(limit?: number): Promise<import("./types.js").KnowledgeMaintenanceRunRecord[]>;
|
|
19
|
+
}
|
|
42
20
|
//# sourceMappingURL=visibility.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visibility.d.ts","sourceRoot":"","sources":["../../../../src/core/memory/visibility.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"visibility.d.ts","sourceRoot":"","sources":["../../../../src/core/memory/visibility.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEhG;;GAEG;AACH,qBAAa,uBAAuB;IAEhC,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAHP,UAAU,EAAE,MAAM,EAClB,KAAK,oBAAoC,EACzC,WAAW,8BAA8C,EACzD,OAAO,uBAAuC;IAG3D,UAAU,CAAC,cAAc,SAAI,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA0BzD,aAAa,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAI/C,QAAQ,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC;IAIrD,WAAW,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC;IAI3D,yBAAyB,CAAC,KAAK,SAAI;CAG1C"}
|
|
@@ -1,156 +1,56 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
notes
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
export async function searchMemoryNotes(options) {
|
|
55
|
-
const result = await createSearchMemoryNotesTool({ memoryRoot: options.memoryRoot }).execute({
|
|
56
|
-
query: options.query,
|
|
57
|
-
path: options.path,
|
|
58
|
-
maxResults: options.maxResults,
|
|
59
|
-
});
|
|
60
|
-
if (!result.ok) {
|
|
61
|
-
throw new Error(result.error);
|
|
1
|
+
import { resolve } from 'node:path';
|
|
2
|
+
import { MemoryCatalogService } from './catalog.js';
|
|
3
|
+
import { MemoryMaintenanceRepository } from './maintenance-repository.js';
|
|
4
|
+
import { MemoryNoteService } from './note-service.js';
|
|
5
|
+
/**
|
|
6
|
+
* Owns host-facing memory status and note visibility reads.
|
|
7
|
+
*/
|
|
8
|
+
export class MemoryVisibilityService {
|
|
9
|
+
memoryRoot;
|
|
10
|
+
notes;
|
|
11
|
+
maintenance;
|
|
12
|
+
catalog;
|
|
13
|
+
constructor(memoryRoot, notes = new MemoryNoteService(memoryRoot), maintenance = new MemoryMaintenanceRepository(memoryRoot), catalog = new MemoryCatalogService(memoryRoot)) {
|
|
14
|
+
this.memoryRoot = memoryRoot;
|
|
15
|
+
this.notes = notes;
|
|
16
|
+
this.maintenance = maintenance;
|
|
17
|
+
this.catalog = catalog;
|
|
18
|
+
}
|
|
19
|
+
async loadStatus(recentRunLimit = 5) {
|
|
20
|
+
const [notes, pending, latestRuns] = await Promise.all([
|
|
21
|
+
this.notes.list(),
|
|
22
|
+
this.maintenance.readPendingCandidates(),
|
|
23
|
+
this.maintenance.readRecentMaintenanceRuns(recentRunLimit),
|
|
24
|
+
]);
|
|
25
|
+
const catalog = this.catalog.validateShape();
|
|
26
|
+
return {
|
|
27
|
+
memoryRoot: resolve(this.memoryRoot),
|
|
28
|
+
catalog: {
|
|
29
|
+
ok: catalog.ok,
|
|
30
|
+
missing: catalog.missing,
|
|
31
|
+
},
|
|
32
|
+
notes: {
|
|
33
|
+
count: notes.length,
|
|
34
|
+
},
|
|
35
|
+
candidates: {
|
|
36
|
+
pending: pending.length,
|
|
37
|
+
},
|
|
38
|
+
runs: {
|
|
39
|
+
latest: latestRuns,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
async listNotePaths(path) {
|
|
44
|
+
return await this.notes.list({ path });
|
|
45
|
+
}
|
|
46
|
+
async readNote(input) {
|
|
47
|
+
return await this.notes.read(input);
|
|
48
|
+
}
|
|
49
|
+
async searchNotes(input) {
|
|
50
|
+
return await this.notes.search(input);
|
|
51
|
+
}
|
|
52
|
+
async readRecentMaintenanceRuns(limit = 5) {
|
|
53
|
+
return await this.maintenance.readRecentMaintenanceRuns(limit);
|
|
62
54
|
}
|
|
63
|
-
return typeof result.output === 'string' ? result.output : JSON.stringify(result.output, null, 2);
|
|
64
|
-
}
|
|
65
|
-
export async function readRecentMemoryMaintenanceRuns(options) {
|
|
66
|
-
const memoryRoot = resolve(options.memoryRoot);
|
|
67
|
-
const raw = await readTextIfExists(resolve(memoryRoot, '_maintenance', 'runs.jsonl'));
|
|
68
|
-
if (!raw) {
|
|
69
|
-
return [];
|
|
70
|
-
}
|
|
71
|
-
return raw
|
|
72
|
-
.split(/\r?\n/u)
|
|
73
|
-
.filter((line) => line.trim())
|
|
74
|
-
.map(parseRunRecord)
|
|
75
|
-
.filter((run) => Boolean(run))
|
|
76
|
-
.slice(-(options.limit ?? 5))
|
|
77
|
-
.reverse();
|
|
78
|
-
}
|
|
79
|
-
function resolveMemoryPath(memoryRoot, requestedPath) {
|
|
80
|
-
if (!requestedPath.trim()) {
|
|
81
|
-
return { ok: false, error: `Memory note paths must be non-empty and stay inside ${memoryRoot}.` };
|
|
82
|
-
}
|
|
83
|
-
const targetPath = resolve(memoryRoot, requestedPath);
|
|
84
|
-
const rel = relative(memoryRoot, targetPath);
|
|
85
|
-
if (rel.startsWith('..') || isAbsolute(rel)) {
|
|
86
|
-
return { ok: false, error: `Memory note paths must stay inside ${memoryRoot}. Refusing to access ${targetPath}.` };
|
|
87
|
-
}
|
|
88
|
-
return { ok: true, path: targetPath };
|
|
89
|
-
}
|
|
90
|
-
async function listMarkdownNotes(root) {
|
|
91
|
-
const entries = await readdir(root, { withFileTypes: true });
|
|
92
|
-
const results = [];
|
|
93
|
-
for (const entry of entries) {
|
|
94
|
-
if (entry.name === '_maintenance') {
|
|
95
|
-
continue;
|
|
96
|
-
}
|
|
97
|
-
const nextPath = resolve(root, entry.name);
|
|
98
|
-
if (entry.isDirectory()) {
|
|
99
|
-
results.push(...await listMarkdownNotes(nextPath));
|
|
100
|
-
continue;
|
|
101
|
-
}
|
|
102
|
-
if (entry.isFile() && /\.md$/iu.test(entry.name)) {
|
|
103
|
-
results.push(nextPath);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
return results;
|
|
107
|
-
}
|
|
108
|
-
async function pathExists(path) {
|
|
109
|
-
try {
|
|
110
|
-
await access(path);
|
|
111
|
-
return true;
|
|
112
|
-
}
|
|
113
|
-
catch {
|
|
114
|
-
return false;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
async function readTextIfExists(path) {
|
|
118
|
-
try {
|
|
119
|
-
return await readFile(path, 'utf8');
|
|
120
|
-
}
|
|
121
|
-
catch (error) {
|
|
122
|
-
if (error instanceof Error && 'code' in error && error.code === 'ENOENT') {
|
|
123
|
-
return undefined;
|
|
124
|
-
}
|
|
125
|
-
throw error;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
function parseRunRecord(line) {
|
|
129
|
-
try {
|
|
130
|
-
const parsed = JSON.parse(line);
|
|
131
|
-
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
132
|
-
return undefined;
|
|
133
|
-
}
|
|
134
|
-
const record = parsed;
|
|
135
|
-
return typeof record.id === 'string'
|
|
136
|
-
&& typeof record.startedAt === 'string'
|
|
137
|
-
&& typeof record.finishedAt === 'string'
|
|
138
|
-
&& typeof record.source === 'string'
|
|
139
|
-
&& typeof record.outcome === 'string'
|
|
140
|
-
&& typeof record.summary === 'string'
|
|
141
|
-
&& Array.isArray(record.candidateIds)
|
|
142
|
-
&& Array.isArray(record.processedCandidateIds)
|
|
143
|
-
&& Array.isArray(record.failedCandidateIds)
|
|
144
|
-
&& typeof record.catalogValid === 'boolean'
|
|
145
|
-
&& Array.isArray(record.catalogMissing) ?
|
|
146
|
-
record
|
|
147
|
-
: undefined;
|
|
148
|
-
}
|
|
149
|
-
catch {
|
|
150
|
-
return undefined;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
function toMemoryRelativePath(memoryRoot, filePath) {
|
|
154
|
-
return relative(memoryRoot, filePath) || '.';
|
|
155
55
|
}
|
|
156
56
|
//# sourceMappingURL=visibility.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visibility.js","sourceRoot":"","sources":["../../../../src/core/memory/visibility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"visibility.js","sourceRoot":"","sources":["../../../../src/core/memory/visibility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,oBAA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CAAC,IAAa;QAC/B,OAAO,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,KAA0B;QACvC,OAAO,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,KAA6B;QAC7C,OAAO,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,yBAAyB,CAAC,KAAK,GAAG,CAAC;QACvC,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC;IACjE,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/review/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,YAAY,EACV,cAAc,EACd,cAAc,EACd,cAAc,EACd,gBAAgB,GACjB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/review/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ReviewDiffFile } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Parses unified Git diffs into Heddle's review model.
|
|
4
|
+
*
|
|
5
|
+
* This class owns the boundary between the third-party diff parser shape and
|
|
6
|
+
* the stable review data consumed by server/control-plane presenters.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ReviewDiffParser {
|
|
9
|
+
private static readonly parser;
|
|
10
|
+
static parseUnifiedDiffFiles(diff: string): ReviewDiffFile[];
|
|
11
|
+
private static splitUnifiedDiffChunks;
|
|
12
|
+
private static projectParsedFile;
|
|
13
|
+
private static findUnifiedDiffChunkForFile;
|
|
14
|
+
private static renderParsedGitDiffFile;
|
|
15
|
+
private static pathForParsedGitDiffFile;
|
|
16
|
+
private static oldPathForParsedGitDiffFile;
|
|
17
|
+
private static statusFromParsedGitDiffFile;
|
|
18
|
+
private static projectDiffLine;
|
|
19
|
+
private static lineTypeFromChange;
|
|
20
|
+
private static countDiffLines;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../src/core/review/service.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,cAAc,EAIf,MAAM,YAAY,CAAC;AASpB;;;;;GAKG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAC+B;IAE7D,MAAM,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,EAAE;IAiB5D,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAOrC,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAoBhC,OAAO,CAAC,MAAM,CAAC,2BAA2B;IAY1C,OAAO,CAAC,MAAM,CAAC,uBAAuB;IAmBtC,OAAO,CAAC,MAAM,CAAC,wBAAwB;IAIvC,OAAO,CAAC,MAAM,CAAC,2BAA2B;IAU1C,OAAO,CAAC,MAAM,CAAC,2BAA2B;IAqB1C,OAAO,CAAC,MAAM,CAAC,eAAe;IAS9B,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAajC,OAAO,CAAC,MAAM,CAAC,cAAc;CAe9B"}
|