@bunny-agent/runner-cli 0.9.47 → 0.9.48

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/bundle.mjs +14 -5
  2. package/package.json +4 -4
package/dist/bundle.mjs CHANGED
@@ -1933,11 +1933,13 @@ import { closeSync, fstatSync, openSync, readdirSync as readdirSync2, readSync,
1933
1933
  import { join as join7 } from "node:path";
1934
1934
  import { SessionManager } from "@earendil-works/pi-coding-agent";
1935
1935
  var MAX_SESSION_FILE_BYTES = Number(process.env.SANDAGENT_MAX_SESSION_BYTES) || 10 * 1024 * 1024;
1936
- function resolveSessionPathById(cwd, sessionId) {
1936
+ function resolveSessionPathById(cwd, sessionIdOrPath) {
1937
+ if (sessionIdOrPath.includes("/"))
1938
+ return sessionIdOrPath;
1937
1939
  const tempMgr = SessionManager.create(cwd);
1938
1940
  const sessionsDir = tempMgr.getSessionDir();
1939
1941
  try {
1940
- const suffix = `_${sessionId}.jsonl`;
1942
+ const suffix = `_${sessionIdOrPath}.jsonl`;
1941
1943
  const match = readdirSync2(sessionsDir).find((f) => f.endsWith(suffix));
1942
1944
  return match ? join7(sessionsDir, match) : void 0;
1943
1945
  } catch {
@@ -5471,12 +5473,18 @@ function createPiRunner(options = {}) {
5471
5473
  modelRegistry.authStorage.setRuntimeApiKey(provider, inlineApiKey);
5472
5474
  }
5473
5475
  try {
5476
+ const forkFrom = options.forkFrom?.trim();
5474
5477
  const resume = options.sessionId?.trim();
5475
5478
  const sessionManager = await (async () => {
5476
- if (resume !== void 0 && resume !== "") {
5477
- if (resume.includes("/")) {
5478
- return SessionManager2.open(resume);
5479
+ if (forkFrom) {
5480
+ const sourcePath = resolveSessionPathById(cwd, forkFrom);
5481
+ console.error(`${LOG_PREFIX2} fork: sourceId=${forkFrom} sourcePath=${sourcePath ?? "(not found)"}`);
5482
+ if (!sourcePath) {
5483
+ throw new Error(`Pi runner: forkFrom source session not found: ${forkFrom}`);
5479
5484
  }
5485
+ return SessionManager2.forkFrom(sourcePath, cwd);
5486
+ }
5487
+ if (resume) {
5480
5488
  const sessionPath2 = resolveSessionPathById(cwd, resume);
5481
5489
  console.error(`${LOG_PREFIX2} resume: id=${resume} path=${sessionPath2 ?? "(not found)"}`);
5482
5490
  if (sessionPath2) {
@@ -5716,6 +5724,7 @@ function dispatchRunner(runner, base, cwd, options) {
5716
5724
  ...base,
5717
5725
  cwd,
5718
5726
  sessionId: base.resume,
5727
+ forkFrom: options.forkFrom,
5719
5728
  skillPaths: options.skillPaths ?? discoverSkillPaths(cwd),
5720
5729
  toolRefs: options.toolRefs,
5721
5730
  effort: options.effort,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bunny-agent/runner-cli",
3
- "version": "0.9.47",
3
+ "version": "0.9.48",
4
4
  "description": "BunnyAgent Runner CLI - Like gemini-cli or claude-code, runs in your local terminal with AI SDK UI streaming",
5
5
  "type": "module",
6
6
  "bin": {
@@ -54,11 +54,11 @@
54
54
  "typescript": "^5.3.0",
55
55
  "vitest": "^1.6.1",
56
56
  "@bunny-agent/runner-harness": "0.1.1-beta.0",
57
- "@bunny-agent/runner-gemini": "0.6.2",
58
- "@bunny-agent/runner-codex": "0.6.2",
59
57
  "@bunny-agent/runner-claude": "0.6.2",
60
58
  "@bunny-agent/runner-pi": "0.6.4-beta.0",
61
- "@bunny-agent/runner-opencode": "0.6.2"
59
+ "@bunny-agent/runner-gemini": "0.6.2",
60
+ "@bunny-agent/runner-opencode": "0.6.2",
61
+ "@bunny-agent/runner-codex": "0.6.2"
62
62
  },
63
63
  "scripts": {
64
64
  "build": "tsc && pnpm bundle",