sakuraai 0.0.2 → 0.0.3

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/index.js +11 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -419,10 +419,20 @@ function messages(sessionId) {
419
419
  const file = findFile(sessionId);
420
420
  return file ? readMessages(file) : [];
421
421
  }
422
+ function sessionCwd(sessionId) {
423
+ const file = findFile(sessionId);
424
+ if (!file) return void 0;
425
+ for (const entry of jsonlEntries(file)) {
426
+ if (typeof entry?.cwd === "string" && entry.cwd) return entry.cwd;
427
+ }
428
+ return void 0;
429
+ }
422
430
  function send(sessionId, message, onData) {
423
431
  return new Promise((resolve) => {
424
432
  const bin = process.env.CLAUDE_BIN || "claude";
433
+ const cwd = sessionCwd(sessionId);
425
434
  const child = spawn(bin, ["--resume", sessionId, "-p", message], {
435
+ cwd: cwd && fs3.existsSync(cwd) ? cwd : void 0,
426
436
  stdio: ["ignore", "pipe", "pipe"]
427
437
  });
428
438
  let out = "";
@@ -1736,7 +1746,7 @@ var init_pair = __esm({
1736
1746
  import { Command } from "commander";
1737
1747
 
1738
1748
  // src/version.ts
1739
- var VERSION = "0.0.2";
1749
+ var VERSION = "0.0.3";
1740
1750
 
1741
1751
  // src/index.ts
1742
1752
  init_config();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sakuraai",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Sakura Agent CLI + local runtime for managing AI coding sessions (Claude Code, Codex, OpenCode) and reaching them privately from the Sakura mobile app over Tailscale",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",