@hoilab/ada-cli 0.84.11 → 0.84.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/agent-session.d.ts +11 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +84 -1
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/memory-engine/audit.d.ts +46 -0
- package/dist/core/memory-engine/audit.d.ts.map +1 -0
- package/dist/core/memory-engine/audit.js +165 -0
- package/dist/core/memory-engine/audit.js.map +1 -0
- package/dist/core/memory-engine/engine.d.ts +158 -0
- package/dist/core/memory-engine/engine.d.ts.map +1 -0
- package/dist/core/memory-engine/engine.js +948 -0
- package/dist/core/memory-engine/engine.js.map +1 -0
- package/dist/core/memory-engine/inverted-index.d.ts +46 -0
- package/dist/core/memory-engine/inverted-index.d.ts.map +1 -0
- package/dist/core/memory-engine/inverted-index.js +235 -0
- package/dist/core/memory-engine/inverted-index.js.map +1 -0
- package/dist/core/memory-engine/observation-store.d.ts +101 -0
- package/dist/core/memory-engine/observation-store.d.ts.map +1 -0
- package/dist/core/memory-engine/observation-store.js +429 -0
- package/dist/core/memory-engine/observation-store.js.map +1 -0
- package/dist/core/memory-engine/scanner.d.ts +11 -0
- package/dist/core/memory-engine/scanner.d.ts.map +1 -0
- package/dist/core/memory-engine/scanner.js +66 -0
- package/dist/core/memory-engine/scanner.js.map +1 -0
- package/dist/core/memory-engine/security.d.ts +31 -0
- package/dist/core/memory-engine/security.d.ts.map +1 -0
- package/dist/core/memory-engine/security.js +180 -0
- package/dist/core/memory-engine/security.js.map +1 -0
- package/dist/core/memory-engine/session-indexer.d.ts +71 -0
- package/dist/core/memory-engine/session-indexer.d.ts.map +1 -0
- package/dist/core/memory-engine/session-indexer.js +217 -0
- package/dist/core/memory-engine/session-indexer.js.map +1 -0
- package/dist/core/memory-engine/tools.d.ts +53 -0
- package/dist/core/memory-engine/tools.d.ts.map +1 -0
- package/dist/core/memory-engine/tools.js +220 -0
- package/dist/core/memory-engine/tools.js.map +1 -0
- package/dist/core/memory-engine/types.d.ts +134 -0
- package/dist/core/memory-engine/types.d.ts.map +1 -0
- package/dist/core/memory-engine/types.js +49 -0
- package/dist/core/memory-engine/types.js.map +1 -0
- package/dist/core/resource-loader.d.ts +4 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +27 -8
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/settings-manager.d.ts +48 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +75 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/modes/interactive/components/home-screen.d.ts.map +1 -1
- package/dist/modes/interactive/components/home-screen.js +0 -6
- package/dist/modes/interactive/components/home-screen.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +2 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +12 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +3 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +121 -0
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
|
@@ -2408,6 +2408,21 @@ export class InteractiveMode {
|
|
|
2408
2408
|
this.editor.setText("");
|
|
2409
2409
|
return;
|
|
2410
2410
|
}
|
|
2411
|
+
if (text === "/memory-insights") {
|
|
2412
|
+
this.editor.setText("");
|
|
2413
|
+
void this.handleMemoryInsightsCommand();
|
|
2414
|
+
return;
|
|
2415
|
+
}
|
|
2416
|
+
if (text === "/memory-consolidate") {
|
|
2417
|
+
this.editor.setText("");
|
|
2418
|
+
void this.handleMemoryConsolidateCommand();
|
|
2419
|
+
return;
|
|
2420
|
+
}
|
|
2421
|
+
if (text === "/memory-audit") {
|
|
2422
|
+
this.editor.setText("");
|
|
2423
|
+
void this.handleMemoryAuditCommand();
|
|
2424
|
+
return;
|
|
2425
|
+
}
|
|
2411
2426
|
if (text === "/changelog") {
|
|
2412
2427
|
this.handleChangelogCommand();
|
|
2413
2428
|
this.editor.setText("");
|
|
@@ -2552,6 +2567,17 @@ export class InteractiveMode {
|
|
|
2552
2567
|
}
|
|
2553
2568
|
this.footer.invalidate();
|
|
2554
2569
|
switch (event.type) {
|
|
2570
|
+
case "notification":
|
|
2571
|
+
if (event.level === "error") {
|
|
2572
|
+
this.showError(event.message);
|
|
2573
|
+
}
|
|
2574
|
+
else if (event.level === "warning") {
|
|
2575
|
+
this.showWarning(event.message);
|
|
2576
|
+
}
|
|
2577
|
+
else {
|
|
2578
|
+
this.showStatus(event.message);
|
|
2579
|
+
}
|
|
2580
|
+
break;
|
|
2555
2581
|
case "agent_start":
|
|
2556
2582
|
this.pendingTools.clear();
|
|
2557
2583
|
if (this.settingsManager.getShowTerminalProgress()) {
|
|
@@ -3694,6 +3720,7 @@ export class InteractiveMode {
|
|
|
3694
3720
|
autoResizeImages: this.settingsManager.getImageAutoResize(),
|
|
3695
3721
|
blockImages: this.settingsManager.getBlockImages(),
|
|
3696
3722
|
projectMemory: this.settingsManager.getProjectMemoryEnabled(),
|
|
3723
|
+
memoryMode: this.settingsManager.getMemoryMode(),
|
|
3697
3724
|
enableSkillCommands: this.settingsManager.getEnableSkillCommands(),
|
|
3698
3725
|
steeringMode: this.session.steeringMode,
|
|
3699
3726
|
followUpMode: this.session.followUpMode,
|
|
@@ -3753,6 +3780,11 @@ export class InteractiveMode {
|
|
|
3753
3780
|
onProjectMemoryChange: (enabled) => {
|
|
3754
3781
|
this.settingsManager.setProjectMemoryEnabled(enabled);
|
|
3755
3782
|
},
|
|
3783
|
+
onMemoryModeChange: (mode) => {
|
|
3784
|
+
this.settingsManager.setMemoryMode(mode);
|
|
3785
|
+
// Rebuild the prompt so the new injection mode takes effect.
|
|
3786
|
+
this.session.rebuildSystemPrompt();
|
|
3787
|
+
},
|
|
3756
3788
|
onEnableSkillCommandsChange: (enabled) => {
|
|
3757
3789
|
this.settingsManager.setEnableSkillCommands(enabled);
|
|
3758
3790
|
this.setupAutocompleteProvider();
|
|
@@ -5175,6 +5207,95 @@ export class InteractiveMode {
|
|
|
5175
5207
|
this.chatContainer.addChild(new Text(info, 1, 0));
|
|
5176
5208
|
this.ui.requestRender();
|
|
5177
5209
|
}
|
|
5210
|
+
async handleMemoryInsightsCommand() {
|
|
5211
|
+
const memoryEngine = this.session.resourceLoader.getMemoryEngine();
|
|
5212
|
+
if (!memoryEngine) {
|
|
5213
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
5214
|
+
this.chatContainer.addChild(new Text("Memory engine unavailable.", 1, 0));
|
|
5215
|
+
this.ui.requestRender();
|
|
5216
|
+
return;
|
|
5217
|
+
}
|
|
5218
|
+
await memoryEngine.ensureInitialized();
|
|
5219
|
+
const status = memoryEngine.status();
|
|
5220
|
+
const entries = [];
|
|
5221
|
+
for (const target of ["user", "project", "global", "failure"]) {
|
|
5222
|
+
const store = memoryEngine.getStore(target);
|
|
5223
|
+
if (!store)
|
|
5224
|
+
continue;
|
|
5225
|
+
const obs = store.getEntries();
|
|
5226
|
+
if (obs.length === 0)
|
|
5227
|
+
continue;
|
|
5228
|
+
entries.push(`${theme.bold(target.toUpperCase())} (${obs.length} ${obs.length === 1 ? "entry" : "entries"})`);
|
|
5229
|
+
for (const o of obs.slice(0, 10)) {
|
|
5230
|
+
const typeTag = theme.fg("dim", `[${o.type}]`);
|
|
5231
|
+
entries.push(` ${typeTag} ${o.text.split("\n")[0].slice(0, 100)}`);
|
|
5232
|
+
}
|
|
5233
|
+
if (obs.length > 10)
|
|
5234
|
+
entries.push(` ${theme.fg("dim", `… and ${obs.length - 10} more`)}`);
|
|
5235
|
+
}
|
|
5236
|
+
let info = `${theme.bold("🧠 Ada Memory")}\n\n`;
|
|
5237
|
+
info += `${theme.fg("dim", "Enabled:")} ${status.enabled ? "yes" : "no"} · ${theme.fg("dim", "Mode:")} ${status.mode}\n`;
|
|
5238
|
+
info += `${theme.fg("dim", "Indexes:")} ${status.memoryIndexDocs} memory docs · ${status.sessionIndexDocs} session docs\n\n`;
|
|
5239
|
+
info += entries.length > 0 ? entries.join("\n") : theme.fg("dim", "No memory entries yet. Ask the agent to remember something, or use memory_add.");
|
|
5240
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
5241
|
+
this.chatContainer.addChild(new Text(info, 1, 0));
|
|
5242
|
+
this.ui.requestRender();
|
|
5243
|
+
}
|
|
5244
|
+
async handleMemoryConsolidateCommand() {
|
|
5245
|
+
const memoryEngine = this.session.resourceLoader.getMemoryEngine();
|
|
5246
|
+
if (!memoryEngine) {
|
|
5247
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
5248
|
+
this.chatContainer.addChild(new Text("Memory engine unavailable.", 1, 0));
|
|
5249
|
+
this.ui.requestRender();
|
|
5250
|
+
return;
|
|
5251
|
+
}
|
|
5252
|
+
await memoryEngine.ensureInitialized();
|
|
5253
|
+
const results = [];
|
|
5254
|
+
for (const target of ["global", "user", "project", "failure"]) {
|
|
5255
|
+
const store = memoryEngine.getStore(target);
|
|
5256
|
+
if (!store)
|
|
5257
|
+
continue;
|
|
5258
|
+
const limit = this.settingsManager.getMemoryEngineConfig().charLimits[target];
|
|
5259
|
+
if (store.charCount < limit * 0.9)
|
|
5260
|
+
continue;
|
|
5261
|
+
const result = await memoryEngine.consolidate(target);
|
|
5262
|
+
results.push(`${target}: ${result.consolidated ? "consolidated" : `skipped (${result.error ?? "under limit"})`}`);
|
|
5263
|
+
}
|
|
5264
|
+
if (results.length === 0)
|
|
5265
|
+
results.push("No target is near its limit — nothing to consolidate.");
|
|
5266
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
5267
|
+
this.chatContainer.addChild(new Text(`🧠 ${theme.bold("Memory consolidation")}\n${results.join("\n")}`, 1, 0));
|
|
5268
|
+
this.ui.requestRender();
|
|
5269
|
+
}
|
|
5270
|
+
async handleMemoryAuditCommand() {
|
|
5271
|
+
const memoryEngine = this.session.resourceLoader.getMemoryEngine();
|
|
5272
|
+
if (!memoryEngine) {
|
|
5273
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
5274
|
+
this.chatContainer.addChild(new Text("Memory engine unavailable.", 1, 0));
|
|
5275
|
+
this.ui.requestRender();
|
|
5276
|
+
return;
|
|
5277
|
+
}
|
|
5278
|
+
await memoryEngine.ensureInitialized();
|
|
5279
|
+
const integrity = await memoryEngine.verifyAudit();
|
|
5280
|
+
const entries = await memoryEngine.auditEntries(25);
|
|
5281
|
+
const lines = [
|
|
5282
|
+
`${theme.bold("🛡️ Memory audit")}`,
|
|
5283
|
+
`${theme.fg("dim", "Integrity:")} ${integrity.valid ? theme.fg("success", "OK (" + integrity.entriesChecked + " entries)") : theme.fg("error", `TAMPERED at ${integrity.tamperedAt ?? "?"}`)}`,
|
|
5284
|
+
];
|
|
5285
|
+
if (entries.length === 0) {
|
|
5286
|
+
lines.push(theme.fg("dim", "No audit entries yet."));
|
|
5287
|
+
}
|
|
5288
|
+
else {
|
|
5289
|
+
for (const entry of entries) {
|
|
5290
|
+
const ok = entry.ok ? "✓" : theme.fg("error", "✗");
|
|
5291
|
+
const when = entry.ts.slice(0, 19).replace("T", " ");
|
|
5292
|
+
lines.push(`${ok} ${when} ${entry.action} ${entry.target}${entry.categories ? ` [${entry.categories.join(",")}]` : ""}${entry.ok ? "" : ` — ${entry.reason ?? ""}`}`);
|
|
5293
|
+
}
|
|
5294
|
+
}
|
|
5295
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
5296
|
+
this.chatContainer.addChild(new Text(lines.join("\n"), 1, 0));
|
|
5297
|
+
this.ui.requestRender();
|
|
5298
|
+
}
|
|
5178
5299
|
handleChangelogCommand() {
|
|
5179
5300
|
const changelogPath = getChangelogPath();
|
|
5180
5301
|
const allEntries = parseChangelog(changelogPath);
|