@membank/cli 0.10.1 → 0.11.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/dist/index.mjs +26 -2
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { cancel, confirm, intro, isCancel, multiselect, note, outro } from "@clack/prompts";
|
|
3
3
|
import { DatabaseManager, EmbeddingService, MIGRATIONS, MemoryRepository, MemoryTypeSchema, MemoryTypeSchema as MemoryTypeSchema$1, PIN_BUDGET_THRESHOLD, ProjectRepository, QueryEngine, SessionContextBuilder, SynthesisRepository, TagsJsonSchema as TagsRowSchema, resolveProject, runScopeToProjectsMigration } from "@membank/core";
|
|
4
|
-
import { startServer } from "@membank/mcp";
|
|
4
|
+
import { runSynthesis, startServer } from "@membank/mcp";
|
|
5
5
|
import chalk from "chalk";
|
|
6
6
|
import { Command } from "commander";
|
|
7
7
|
import ora from "ora";
|
|
@@ -288,6 +288,10 @@ async function buildText() {
|
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
290
|
async function handleEvent(harness, eventName) {
|
|
291
|
+
if (harness === "claude-code" && eventName === "Stop") {
|
|
292
|
+
process.stdout.write("{}");
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
291
295
|
const text = await buildText().catch((err) => {
|
|
292
296
|
const msg = err instanceof Error ? err.message : String(err);
|
|
293
297
|
process.stderr.write(`membank inject: ${msg}\n`);
|
|
@@ -434,6 +438,16 @@ async function statsCommand(formatter) {
|
|
|
434
438
|
function hasSynthesesTable(db) {
|
|
435
439
|
return db.db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='syntheses'").get() !== void 0;
|
|
436
440
|
}
|
|
441
|
+
async function synthesizeRunCommand(opts, formatter) {
|
|
442
|
+
const scope = opts.scope ?? "global";
|
|
443
|
+
if (!formatter.isJson) process.stdout.write(`Running synthesis for scope: ${scope}\n`);
|
|
444
|
+
const content = await runSynthesis(scope);
|
|
445
|
+
if (formatter.isJson) process.stdout.write(`${JSON.stringify({
|
|
446
|
+
scope,
|
|
447
|
+
content
|
|
448
|
+
})}\n`);
|
|
449
|
+
else process.stdout.write(`\nSynthesis complete for scope: ${scope}\n\n${content}\n\n`);
|
|
450
|
+
}
|
|
437
451
|
function synthesizeShowCommand(opts, formatter) {
|
|
438
452
|
const db = DatabaseManager.open();
|
|
439
453
|
try {
|
|
@@ -1790,7 +1804,17 @@ configCmd.command("show").description("print the entire config as formatted JSON
|
|
|
1790
1804
|
const globalOpts = program.opts();
|
|
1791
1805
|
configShowCommand(Formatter.create(globalOpts.json === true));
|
|
1792
1806
|
});
|
|
1793
|
-
const synthesizeCmd = program.command("synthesize").description("view synthesis
|
|
1807
|
+
const synthesizeCmd = program.command("synthesize").description("view and manage synthesis");
|
|
1808
|
+
synthesizeCmd.command("run").description("trigger a synthesis run for a scope").option("--scope <scope>", "scope to synthesize (default: global)").action(async (cmdOptions) => {
|
|
1809
|
+
const globalOpts = program.opts();
|
|
1810
|
+
const formatter = Formatter.create(globalOpts.json === true);
|
|
1811
|
+
try {
|
|
1812
|
+
await synthesizeRunCommand(cmdOptions, formatter);
|
|
1813
|
+
} catch (err) {
|
|
1814
|
+
formatter.error(err instanceof Error ? err.message : String(err));
|
|
1815
|
+
process.exit(2);
|
|
1816
|
+
}
|
|
1817
|
+
});
|
|
1794
1818
|
synthesizeCmd.command("show").description("display current synthesis for a scope").option("--scope <scope>", "scope to show (default: global)").action((cmdOptions) => {
|
|
1795
1819
|
const globalOpts = program.opts();
|
|
1796
1820
|
const formatter = Formatter.create(globalOpts.json === true);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@membank/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"commander": "^14.0.3",
|
|
22
22
|
"ora": "^9.4.0",
|
|
23
23
|
"zod": "^4.4.3",
|
|
24
|
-
"@membank/core": "0.9.
|
|
25
|
-
"@membank/
|
|
26
|
-
"@membank/
|
|
24
|
+
"@membank/core": "0.9.2",
|
|
25
|
+
"@membank/dashboard": "0.5.3",
|
|
26
|
+
"@membank/mcp": "0.12.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/node": "^25.6.0",
|