@zenera/cli 1.1.12 → 1.1.14

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.
@@ -1,9 +1,9 @@
1
+ import { assertState, buildRunReport, FilePayloadStore, memoryDir, MemoryStore, PayloadResolver, readProjectConfig, renderReportHtml, } from '@zenera/neo';
1
2
  import { spawn } from 'node:child_process';
2
3
  import { createReadStream, existsSync } from 'node:fs';
3
4
  import { readFile, writeFile } from 'node:fs/promises';
4
5
  import { createServer } from 'node:http';
5
- import { extname, normalize, resolve, sep } from 'node:path';
6
- import { assertState, buildRunReport, FilePayloadStore, PayloadResolver, renderReportHtml, } from '@zenera/neo';
6
+ import { extname, join, normalize, resolve, sep } from 'node:path';
7
7
  import { parse } from "../args.js";
8
8
  import { project as resolveProject } from "../resolve.js";
9
9
  import { display, newestRun, newestSession, requireSession, runPaths, sessionPaths, } from "../session.js";
@@ -29,7 +29,7 @@ export const inspect = {
29
29
  const session = pickSession(dir, values.session);
30
30
  const run = pickRun(session, positionals[0]);
31
31
  if (values.rebuild || !existsSync(run.report)) {
32
- await rebuild(session, run);
32
+ await rebuild(session, run, await memory(dir));
33
33
  }
34
34
  if (ctx.json) {
35
35
  json({ session: session.id, run: run.id, report: run.report });
@@ -78,7 +78,7 @@ function pickRun(session, asked) {
78
78
  * state — which is what makes `--rebuild` safe and what makes an old run
79
79
  * readable by a newer renderer.
80
80
  */
81
- async function rebuild(session, run) {
81
+ async function rebuild(session, run, store) {
82
82
  if (!existsSync(run.state)) {
83
83
  throw invalidError(`run ${run.id} has no state to rebuild from`);
84
84
  }
@@ -90,9 +90,27 @@ async function rebuild(session, run) {
90
90
  throw invalidError(`${run.state}: ${err instanceof Error ? err.message : String(err)}`);
91
91
  }
92
92
  const payloads = new PayloadResolver(new FilePayloadStore({ dir: session.blobs, id: 'file' }));
93
- const report = await buildRunReport(state, payloads, { title: run.id });
93
+ const report = await buildRunReport(state, payloads, { title: run.id, memory: store });
94
94
  await writeFile(run.report, renderReportHtml(report), 'utf8');
95
95
  }
96
+ /**
97
+ * The project's memory, unlocked, when it has one. Without it the memory view
98
+ * has the shape of what the run recalled but not a word of it; a run that
99
+ * never touched memory pays nothing, because the report asks for no node.
100
+ */
101
+ async function memory(dir) {
102
+ const { config } = readProjectConfig(dir);
103
+ const at = memoryDir(dir, config);
104
+ if (!at || !existsSync(join(at, 'manifest.json'))) {
105
+ return undefined;
106
+ }
107
+ try {
108
+ return await MemoryStore.open(at, { lock: false });
109
+ }
110
+ catch {
111
+ return undefined;
112
+ }
113
+ }
96
114
  // ---------------------------------------------------------------------------
97
115
  // Serving
98
116
  //
package/dist/engine.js CHANGED
@@ -172,6 +172,7 @@ async function record(engine, input, result, startedAt, durationMs) {
172
172
  const built = await buildRunReport(result.state, engine.runner.services.payloads, {
173
173
  title: `${engine.name} · ${run.id}`,
174
174
  architecture: await engine.runner.describe(),
175
+ memory: engine.runner.services.memory?.store,
175
176
  });
176
177
  await writeFile(run.report, renderReportHtml(built), 'utf8');
177
178
  report = run.report;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenera/cli",
3
- "version": "1.1.12",
3
+ "version": "1.1.14",
4
4
  "description": "Command-line front end for @zenera/neo: agentic projects you can run, share and commit.",
5
5
  "keywords": [
6
6
  "agents",
@@ -51,7 +51,7 @@
51
51
  "@inkjs/ui": "^2.0.0",
52
52
  "ink": "^7.1.1",
53
53
  "react": "^19.2.8",
54
- "@zenera/neo": "^1.1.12",
54
+ "@zenera/neo": "^1.1.14",
55
55
  "@anthropic-ai/sdk": "^0.120.0",
56
56
  "@google/genai": "^2.18.0",
57
57
  "@openrouter/sdk": "^1.2.80",