open-think 0.2.2 → 0.2.3

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.
Files changed (2) hide show
  1. package/dist/index.js +50 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2247,7 +2247,52 @@ var recallCommand = new Command12("recall").argument("<query>", "What to recall"
2247
2247
  // src/commands/memory.ts
2248
2248
  import { Command as Command13 } from "commander";
2249
2249
  import chalk13 from "chalk";
2250
- var memoryCommand = new Command13("memory").description("Show current memories from local store").option("--history", "Show recent memory timeline").action(async (opts) => {
2250
+ var addCommand = new Command13("add").description("Add a memory directly, bypassing curation").argument("<message>", "The memory content").option("--no-push", "Skip pushing to remote after adding").option("--silent", "Suppress output").action(async function(message, opts) {
2251
+ const globalOpts = this.optsWithGlobals();
2252
+ const config = getConfig();
2253
+ const cortex = globalOpts.cortex ?? config.cortex?.active;
2254
+ if (!cortex) {
2255
+ console.error(chalk13.red("No active cortex. Run: think cortex switch <name>"));
2256
+ process.exit(1);
2257
+ }
2258
+ const author = config.cortex?.author ?? "unknown";
2259
+ const validated = validateEngramContent(message);
2260
+ message = validated.content;
2261
+ if (!opts.silent && validated.warnings.length > 0) {
2262
+ for (const w of validated.warnings) {
2263
+ console.log(chalk13.yellow(` \u26A0 ${w}`));
2264
+ }
2265
+ }
2266
+ const row = insertMemory(cortex, {
2267
+ ts: (/* @__PURE__ */ new Date()).toISOString(),
2268
+ author,
2269
+ content: message,
2270
+ source_ids: []
2271
+ });
2272
+ if (!opts.silent) {
2273
+ const badge = chalk13.cyan(`[${cortex}]`);
2274
+ const ts = chalk13.gray(row.ts.slice(0, 16).replace("T", " "));
2275
+ console.log(`${chalk13.green("\u2713")} ${badge} memory added ${ts}`);
2276
+ console.log(` ${row.content}`);
2277
+ }
2278
+ if (opts.push) {
2279
+ const adapter = getSyncAdapter();
2280
+ if (adapter?.isAvailable()) {
2281
+ try {
2282
+ const result = await adapter.push(cortex);
2283
+ if (!opts.silent && result.pushed > 0) {
2284
+ console.log(chalk13.dim(` Pushed ${result.pushed} memories to ${adapter.name}`));
2285
+ }
2286
+ } catch {
2287
+ if (!opts.silent) {
2288
+ console.log(chalk13.dim(" Push skipped (remote unavailable) \u2014 will push on next sync"));
2289
+ }
2290
+ }
2291
+ }
2292
+ }
2293
+ closeCortexDb(cortex);
2294
+ });
2295
+ async function showMemories(opts) {
2251
2296
  const config = getConfig();
2252
2297
  const cortex = config.cortex?.active;
2253
2298
  if (!cortex) {
@@ -2275,7 +2320,11 @@ var memoryCommand = new Command13("memory").description("Show current memories f
2275
2320
  console.log(chalk13.dim(`
2276
2321
  ${memories.length} memories`));
2277
2322
  closeCortexDb(cortex);
2323
+ }
2324
+ var memoryCommand = new Command13("memory").description("Show current memories from local store").option("--history", "Show recent memory timeline").action(async (opts) => {
2325
+ await showMemories(opts);
2278
2326
  });
2327
+ memoryCommand.addCommand(addCommand);
2279
2328
 
2280
2329
  // src/commands/curator-cmd.ts
2281
2330
  import { Command as Command14 } from "commander";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-think",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "type": "module",
5
5
  "description": "Local-first CLI that gives AI agents persistent, curated memory",
6
6
  "bin": {