@kuralle-agents/cli 0.13.1 → 0.14.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/chat.js CHANGED
@@ -52,21 +52,21 @@ async function runTurn(demo, input, onText, onEvent) {
52
52
  try {
53
53
  for await (const part of handle.events) {
54
54
  if (part.type === 'text-delta') {
55
- text += part.delta;
55
+ text += part.payload.delta;
56
56
  onText(text);
57
57
  }
58
58
  else if (part.type === 'tool-call')
59
- onEvent(`⚙ tool ${part.toolName}`);
59
+ onEvent(`⚙ tool ${part.payload.toolName}`);
60
60
  else if (part.type === 'flow-enter')
61
- onEvent(`▸ enter flow ${part.flow}`);
61
+ onEvent(`▸ enter flow ${part.payload.flow}`);
62
62
  else if (part.type === 'flow-end')
63
- onEvent(`■ end flow ${part.flow}`);
63
+ onEvent(`■ end flow ${part.payload.flow}`);
64
64
  else if (part.type === 'handoff')
65
- onEvent(`→ handoff ${part.targetAgent}`);
65
+ onEvent(`→ handoff ${part.payload.targetAgent}`);
66
66
  else if (part.type === 'paused')
67
- onEvent(`⏸ paused ${part.waitingFor ?? ''}`);
67
+ onEvent(`⏸ paused ${part.payload.waitingFor}`);
68
68
  else if (part.type === 'error')
69
- onEvent(`✖ ${part.error}`);
69
+ onEvent(`✖ ${part.payload.error}`);
70
70
  }
71
71
  const res = await handle;
72
72
  if (!text && typeof res.text === 'string')
package/dist/send.js CHANGED
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import { join } from 'node:path';
7
7
  import { fileSessionStore } from './fileStore.js';
8
+ import { fileTraceStore } from './fileTraceStore.js';
8
9
  function flag(argv, name) {
9
10
  const i = argv.indexOf(name);
10
11
  return i >= 0 ? argv[i + 1] : undefined;
@@ -20,7 +21,12 @@ export async function runSend(argv, buildRuntime) {
20
21
  .join(' ')
21
22
  .trim();
22
23
  const store = fileSessionStore(storePath);
23
- const demo = buildRuntime(sessionId, store);
24
+ // Traces must be file-backed too. `send` is one turn per process, so a MemoryTraceStore
25
+ // (what the loader defaults to whenever a session store is supplied) is discarded on
26
+ // exit and `kuralle trace --store` finds nothing — the exact sidecar `chat --store`
27
+ // writes and the CLI guide promises for both commands.
28
+ const traces = fileTraceStore(storePath.replace(/\.json$/, '') + '.traces.json');
29
+ const demo = buildRuntime(sessionId, store, traces);
24
30
  async function readState() {
25
31
  const s = await store.get(sessionId);
26
32
  const rs = s?.durableRuns?.[sessionId]?.runState;
@@ -42,21 +48,21 @@ export async function runSend(argv, buildRuntime) {
42
48
  let text = '';
43
49
  for await (const part of handle.events) {
44
50
  if (part.type === 'text-delta') {
45
- text += part.delta;
46
- process.stdout.write(part.delta);
51
+ text += part.payload.delta;
52
+ process.stdout.write(part.payload.delta);
47
53
  }
48
54
  else if (part.type === 'tool-call')
49
- events.push(`tool:${part.toolName}`);
55
+ events.push(`tool:${part.payload.toolName}`);
50
56
  else if (part.type === 'flow-enter')
51
- events.push(`enter:${part.flow}`);
57
+ events.push(`enter:${part.payload.flow}`);
52
58
  else if (part.type === 'flow-end')
53
- events.push(`end:${part.flow}`);
59
+ events.push(`end:${part.payload.flow}`);
54
60
  else if (part.type === 'handoff')
55
- events.push(`handoff:${part.targetAgent}`);
61
+ events.push(`handoff:${part.payload.targetAgent}`);
56
62
  else if (part.type === 'paused')
57
- events.push(`paused:${part.waitingFor ?? ''}`);
63
+ events.push(`paused:${part.payload.waitingFor}`);
58
64
  else if (part.type === 'error')
59
- events.push(`error:${part.error}`);
65
+ events.push(`error:${part.payload.error}`);
60
66
  }
61
67
  const res = await handle;
62
68
  if (!text && typeof res.text === 'string')
package/dist/trace.js CHANGED
@@ -4,7 +4,8 @@ import { fileSessionStore } from './fileStore.js';
4
4
  import { fileTraceStore } from './fileTraceStore.js';
5
5
  export async function runTrace(argv, buildRuntime) {
6
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).
7
+ // persist to; traces live in a sidecar with the extension replaced
8
+ // `runs/app.json` -> `runs/app.traces.json` (JSONL, one span per line).
8
9
  // Without wiring these, buildRuntime falls back to an in-memory store that is
9
10
  // always empty in a fresh process, so no persisted trace is ever found.
10
11
  const storeIdx = argv.indexOf('--store');
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.1",
9
+ "version": "0.14.0",
10
10
  "description": "Kuralle CLI — interactive TUI chat, adaptive send, and conversation simulation",
11
11
  "type": "module",
12
12
  "bin": {
@@ -20,13 +20,13 @@
20
20
  "ink-text-input": "^6.0.0",
21
21
  "react": "^19.2.7",
22
22
  "zod": "^4.0.0",
23
- "@kuralle-agents/core": "0.13.0",
24
- "@kuralle-agents/trace-ui": "0.13.0"
23
+ "@kuralle-agents/core": "0.14.0",
24
+ "@kuralle-agents/trace-ui": "0.14.0"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "ai": "^6.0.0",
28
28
  "zod": "^4.0.0",
29
- "@kuralle-agents/core": "0.13.0"
29
+ "@kuralle-agents/core": "0.14.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/node": "^20.11.0",
@@ -44,6 +44,7 @@
44
44
  "prebuild": "rm -rf dist",
45
45
  "build": "tsc -p tsconfig.json",
46
46
  "typecheck": "tsc --noEmit -p tsconfig.json",
47
- "clean": "rm -rf dist"
47
+ "clean": "rm -rf dist",
48
+ "test": "bun test ./test"
48
49
  }
49
50
  }