@kuralle-agents/cli 0.13.0 → 0.13.1
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/trace.js +15 -3
- package/package.json +1 -1
package/dist/trace.js
CHANGED
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
import { renderTraceViewerDocument } from '@kuralle-agents/trace-ui';
|
|
2
2
|
import { createServer } from 'node:http';
|
|
3
|
+
import { fileSessionStore } from './fileStore.js';
|
|
4
|
+
import { fileTraceStore } from './fileTraceStore.js';
|
|
3
5
|
export async function runTrace(argv, buildRuntime) {
|
|
4
|
-
|
|
6
|
+
// --store <file> points at the same file `kuralle chat --store` / `kuralle send`
|
|
7
|
+
// persist to; traces live in the `<file>.traces.json` sidecar (chat's convention).
|
|
8
|
+
// Without wiring these, buildRuntime falls back to an in-memory store that is
|
|
9
|
+
// always empty in a fresh process, so no persisted trace is ever found.
|
|
10
|
+
const storeIdx = argv.indexOf('--store');
|
|
11
|
+
const storePath = storeIdx >= 0 ? argv[storeIdx + 1] : undefined;
|
|
12
|
+
const sessionId = argv.find((arg, i) => !arg.startsWith('--') && i !== storeIdx + 1);
|
|
5
13
|
if (!sessionId)
|
|
6
|
-
throw new Error('Usage: kuralle trace <session> [--last] [--json]');
|
|
7
|
-
const
|
|
14
|
+
throw new Error('Usage: kuralle trace <session> [--last] [--json] [--store <file>]');
|
|
15
|
+
const sessionStore = storePath ? fileSessionStore(storePath) : undefined;
|
|
16
|
+
const traceStore = storePath
|
|
17
|
+
? fileTraceStore(storePath.replace(/\.json$/, '') + '.traces.json')
|
|
18
|
+
: undefined;
|
|
19
|
+
const { runtime } = buildRuntime(sessionId, sessionStore, traceStore);
|
|
8
20
|
if (argv.includes('--web')) {
|
|
9
21
|
const port = numberFlag(argv, '--port') ?? 4319;
|
|
10
22
|
await startTraceWebServer(runtime, sessionId, port);
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"url": "git+https://github.com/kuralle/kuralle-agents.git",
|
|
7
7
|
"directory": "packages/cli"
|
|
8
8
|
},
|
|
9
|
-
"version": "0.13.
|
|
9
|
+
"version": "0.13.1",
|
|
10
10
|
"description": "Kuralle CLI — interactive TUI chat, adaptive send, and conversation simulation",
|
|
11
11
|
"type": "module",
|
|
12
12
|
"bin": {
|