agentcache 0.3.3 → 0.3.4

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/cli.js CHANGED
@@ -46,7 +46,7 @@ program.command("enforce").description("PreToolUse hook: policy enforcement").ac
46
46
  }
47
47
  });
48
48
  program.command("compile-all").description("Batch-compile all unprocessed transcripts using an available LLM CLI").action(async () => {
49
- const { runCompileAll } = await import("./compile-all-XQBGUI3F.js");
49
+ const { runCompileAll } = await import("./compile-all-LB5S67BQ.js");
50
50
  await runCompileAll();
51
51
  });
52
52
  program.command("status").description("Show AgentCache knowledge stats").action(async () => {
@@ -321,14 +321,13 @@ function processOneTranscript(repo, path, project, projectRoot, backend) {
321
321
  const extractionResponse = backend.invoke(state.prompt);
322
322
  if (!extractionResponse) return { created: 0, reinforced: 0, skipped: true };
323
323
  const extractResult = processExtraction(repo, extractionResponse, sessionId, project, projectRoot);
324
+ repo.updateSessionTranscriptPath(sessionId, path);
324
325
  if (extractResult.status === "complete") {
325
- repo.updateSessionTranscriptPath(sessionId, path);
326
326
  return { created: 0, reinforced: 0, skipped: false };
327
327
  }
328
328
  const clusterResponse = backend.invoke(extractResult.clusteringPrompt);
329
- if (!clusterResponse) return { created: 0, reinforced: 0, skipped: true };
329
+ if (!clusterResponse) return { created: 0, reinforced: 0, skipped: false };
330
330
  const clusterResult = processClustering(repo, clusterResponse, sessionId, project, projectRoot);
331
- repo.updateSessionTranscriptPath(sessionId, path);
332
331
  const diag = clusterResult.diagnostics;
333
332
  const createdMatch = diag.match(/(\d+) new knowledge/);
334
333
  const reinforcedMatch = diag.match(/(\d+) reinforced/);
@@ -361,10 +360,11 @@ function processGooseSessions(repo, backend) {
361
360
  const projectRoot = session.working_dir || process.cwd();
362
361
  const project = getProjectId(projectRoot);
363
362
  const sessionId = `sess_${randomUUID().slice(0, 8)}`;
364
- const state = startCompile(events, sessionId, project, projectRoot, repo, markerPath);
363
+ const state = startCompile(events, sessionId, project, projectRoot, repo);
365
364
  const extractionResponse = backend.invoke(state.prompt);
366
365
  if (!extractionResponse) continue;
367
366
  const extractResult = processExtraction(repo, extractionResponse, sessionId, project, projectRoot);
367
+ repo.updateSessionTranscriptPath(sessionId, markerPath);
368
368
  if (extractResult.status === "needs_clustering") {
369
369
  const clusterResponse = backend.invoke(extractResult.clusteringPrompt);
370
370
  if (clusterResponse) {
package/dist/mcp.js CHANGED
@@ -31,7 +31,7 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
31
31
  import { CallToolRequestSchema, ListToolsRequestSchema, RootsListChangedNotificationSchema } from "@modelcontextprotocol/sdk/types.js";
32
32
 
33
33
  // src/utils/auto-update.ts
34
- import { execSync, spawn } from "child_process";
34
+ import { exec, spawn } from "child_process";
35
35
  import { readFileSync, writeFileSync, existsSync } from "fs";
36
36
  import { join } from "path";
37
37
  var CHECK_INTERVAL_MS = 4 * 60 * 60 * 1e3;
@@ -56,17 +56,6 @@ function getCurrentVersion() {
56
56
  const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
57
57
  return pkg.version;
58
58
  }
59
- function getLatestVersion() {
60
- try {
61
- return execSync("npm view agentcache version", {
62
- encoding: "utf-8",
63
- timeout: 1e4,
64
- stdio: ["pipe", "pipe", "pipe"]
65
- }).trim();
66
- } catch {
67
- return null;
68
- }
69
- }
70
59
  function isNewer(latest, current) {
71
60
  const l = latest.split(".").map(Number);
72
61
  const c = current.split(".").map(Number);
@@ -77,16 +66,27 @@ function isNewer(latest, current) {
77
66
  return false;
78
67
  }
79
68
  function checkForUpdates() {
80
- if (!shouldCheck()) return;
81
- markChecked();
69
+ try {
70
+ if (!shouldCheck()) return;
71
+ } catch {
72
+ return;
73
+ }
82
74
  const current = getCurrentVersion();
83
- const latest = getLatestVersion();
84
- if (!latest || !isNewer(latest, current)) return;
85
- const child = spawn("npm", ["install", "-g", "agentcache@latest"], {
86
- detached: true,
87
- stdio: "ignore"
75
+ exec("npm view agentcache version", { timeout: 1e4 }, (err, stdout) => {
76
+ if (err || !stdout) return;
77
+ const latest = stdout.trim();
78
+ if (!latest || !isNewer(latest, current)) {
79
+ markChecked();
80
+ return;
81
+ }
82
+ markChecked();
83
+ const child = spawn("npm", ["install", "-g", `agentcache@${latest}`], {
84
+ detached: true,
85
+ stdio: "ignore",
86
+ shell: true
87
+ });
88
+ child.unref();
88
89
  });
89
- child.unref();
90
90
  }
91
91
 
92
92
  // src/mcp.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentcache",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "Knowledge cache for AI agents — learns how you work, remembers across sessions, works everywhere",
5
5
  "type": "module",
6
6
  "license": "MIT",