@losoft/taube 0.1.8 → 0.1.9

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/README.md CHANGED
@@ -4,6 +4,17 @@ Taube lets Codex CLI, Claude Code, and Grok Build hand tasks to each other from
4
4
 
5
5
  Taube connects directly to target adapters through the Agent Client Protocol (ACP). Each task starts a fresh session. The `taube-dispatch` skill calls the same CLI from each host.
6
6
 
7
+ [![Poster for the silent Taube dispatch demo video. Select it to open the video.](docs/media/dispatch-demo.jpg)](docs/media/dispatch-demo.mp4)
8
+
9
+ <details>
10
+ <summary>Play the demo in this README</summary>
11
+
12
+ ![Animated demo of the Taube dispatch workflow](docs/media/dispatch-demo.gif)
13
+
14
+ </details>
15
+
16
+ In the silent demo, Claude reviews a missing `await` through `taube dispatch`. Taube Monitor then shows the same completed session with its prompt and answer.
17
+
7
18
  ## Try it
8
19
 
9
20
  You need Node.js 22.13 or later and npm. Sign in to each target agent you plan to use. In scripts, `npx --yes` skips the npm install prompt.
package/dist/cli.js CHANGED
@@ -52,9 +52,14 @@ var init_prompt = () => {};
52
52
 
53
53
  // src/home.ts
54
54
  import { homedir } from "node:os";
55
- import { join, resolve } from "node:path";
55
+ import { resolve } from "node:path";
56
56
  function taubeHome() {
57
- return resolve(process.env.LOSOFT_TABE_HOME || join(homedir(), ".taube"));
57
+ const { LOSOFT_TAUBE_HOME, LOSOFT_TABE_HOME } = process.env;
58
+ for (const path of [LOSOFT_TAUBE_HOME, LOSOFT_TABE_HOME]) {
59
+ if (path?.trim())
60
+ return resolve(path);
61
+ }
62
+ return resolve(homedir(), ".taube");
58
63
  }
59
64
  var init_home = () => {};
60
65
 
@@ -67,11 +72,11 @@ import {
67
72
  } from "node:crypto";
68
73
  import { link, lstat, mkdir, readFile as readFile2, rm, writeFile } from "node:fs/promises";
69
74
  import { connect, createServer } from "node:net";
70
- import { join as join2 } from "node:path";
75
+ import { join } from "node:path";
71
76
  function endpointPath(id) {
72
77
  if (!uuidPattern.test(id))
73
78
  throw new Error("Expected a Taube session ID.");
74
- return join2(taubeHome(), "channels", `${id}.json`);
79
+ return join(taubeHome(), "channels", `${id}.json`);
75
80
  }
76
81
  async function checkDirectory(directory) {
77
82
  const stat = await lstat(directory);
@@ -86,7 +91,7 @@ function validateText(text) {
86
91
  }
87
92
  async function openSessionChannel(id, accept) {
88
93
  const path = endpointPath(id);
89
- const directory = join2(taubeHome(), "channels");
94
+ const directory = join(taubeHome(), "channels");
90
95
  await mkdir(directory, { recursive: true, mode: 448 });
91
96
  await checkDirectory(directory);
92
97
  const key = randomBytes(32);
@@ -212,7 +217,7 @@ async function sendFollowUp(id, request) {
212
217
  let tracked;
213
218
  let compactRequests;
214
219
  try {
215
- await checkDirectory(join2(taubeHome(), "channels"));
220
+ await checkDirectory(join(taubeHome(), "channels"));
216
221
  const endpoint = JSON.parse(await readFile2(path, "utf8"));
217
222
  if (!Number.isInteger(endpoint.port) || endpoint.port < 1 || endpoint.port > 65535 || typeof endpoint.key !== "string" || !/^[\da-f]{64}$/.test(endpoint.key))
218
223
  throw new Error(closedMessage);
@@ -286,7 +291,7 @@ import {
286
291
  rm as rm2,
287
292
  writeFile as writeFile2
288
293
  } from "node:fs/promises";
289
- import { join as join3 } from "node:path";
294
+ import { join as join2 } from "node:path";
290
295
  function initialSelection({
291
296
  model = null,
292
297
  effort = null
@@ -297,7 +302,7 @@ function initialSelection({
297
302
  };
298
303
  }
299
304
  function sessionsDirectory() {
300
- return join3(taubeHome(), "sessions");
305
+ return join2(taubeHome(), "sessions");
301
306
  }
302
307
  function sessionRecordName({
303
308
  id,
@@ -308,7 +313,7 @@ function sessionRecordName({
308
313
  return `${basename}.json`;
309
314
  }
310
315
  function sessionRecordPath(session) {
311
- return join3(sessionsDirectory(), sessionRecordName(session));
316
+ return join2(sessionsDirectory(), sessionRecordName(session));
312
317
  }
313
318
  function findSessionByRequestId(sessions, requestId, dispatcher) {
314
319
  const matches = sessions.filter((session) => session.requestId === requestId && (dispatcher === null || session.dispatcher === dispatcher));
@@ -490,7 +495,7 @@ async function listSessions() {
490
495
  for (const name of names) {
491
496
  if (!name.endsWith(".json"))
492
497
  continue;
493
- const path = join3(directory, name);
498
+ const path = join2(directory, name);
494
499
  try {
495
500
  sessions.push(await readCurrentSession(path));
496
501
  } catch (error) {
@@ -612,7 +617,7 @@ var init_session_watch = __esm(() => {
612
617
  // src/adapter.ts
613
618
  import { accessSync, constants as fsConstants, statSync } from "node:fs";
614
619
  import { access, readFile as readFile4 } from "node:fs/promises";
615
- import { delimiter, dirname, join as join4, resolve as resolve2 } from "node:path";
620
+ import { delimiter, dirname, join as join3, resolve as resolve2 } from "node:path";
616
621
  function executableOnPath(command) {
617
622
  const extensions = process.platform === "win32" ? (process.env.PATHEXT ?? ".EXE;.CMD;.BAT").split(";") : [""];
618
623
  for (const directory of (process.env.PATH ?? "").split(delimiter)) {
@@ -630,7 +635,7 @@ function isRecord(value) {
630
635
  return typeof value === "object" && value !== null && !Array.isArray(value);
631
636
  }
632
637
  async function configuredArgv(cwd, profile) {
633
- const path = join4(cwd, ".acpxrc.json");
638
+ const path = join3(cwd, ".acpxrc.json");
634
639
  let source;
635
640
  try {
636
641
  source = await readFile4(path, "utf8");
@@ -674,7 +679,7 @@ async function packageLauncher(spec, launcher) {
674
679
  const args = ["--yes", "--package", spec, "--", launcher];
675
680
  if (!requiresWindowsShell(npx))
676
681
  return { command: npx, args };
677
- const entry = join4(dirname(npx), "node_modules", "npm", "bin", "npx-cli.js");
682
+ const entry = join3(dirname(npx), "node_modules", "npm", "bin", "npx-cli.js");
678
683
  try {
679
684
  await access(entry);
680
685
  } catch (cause) {
@@ -684,7 +689,13 @@ async function packageLauncher(spec, launcher) {
684
689
  }
685
690
  async function resolveAdapter(target, cwd) {
686
691
  const codexPath = target.id === "codex" && process.env.CODEX_PATH === undefined ? executableOnPath("codex") : undefined;
687
- const env = codexPath ? { ...process.env, CODEX_PATH: codexPath } : process.env;
692
+ const home = taubeHome();
693
+ const env = {
694
+ ...process.env,
695
+ LOSOFT_TAUBE_HOME: home,
696
+ LOSOFT_TABE_HOME: home,
697
+ ...codexPath && { CODEX_PATH: codexPath }
698
+ };
688
699
  const override = await configuredArgv(cwd, target.profile);
689
700
  if (override) {
690
701
  const [command, ...args] = override;
@@ -710,6 +721,7 @@ async function resolveAdapter(target, cwd) {
710
721
  }
711
722
  var packages;
712
723
  var init_adapter = __esm(() => {
724
+ init_home();
713
725
  packages = {
714
726
  codex: "@agentclientprotocol/codex-acp@1.13.1",
715
727
  claude: "@agentclientprotocol/claude-agent-acp@0.95.0"
@@ -719,9 +731,9 @@ var init_adapter = __esm(() => {
719
731
  // src/auth-state.ts
720
732
  import { randomUUID as randomUUID3 } from "node:crypto";
721
733
  import { mkdir as mkdir3, readFile as readFile5, rename as rename2, rm as rm3, writeFile as writeFile3 } from "node:fs/promises";
722
- import { join as join5 } from "node:path";
734
+ import { join as join4 } from "node:path";
723
735
  async function readAuth(target) {
724
- const path = join5(taubeHome(), "auth", `${target}.json`);
736
+ const path = join4(taubeHome(), "auth", `${target}.json`);
725
737
  let contents;
726
738
  try {
727
739
  contents = await readFile5(path, "utf8");
@@ -738,10 +750,10 @@ async function readAuth(target) {
738
750
  throw new Error(`Invalid authentication cache for ${target}.`);
739
751
  }
740
752
  async function recordAuth(target, authenticated) {
741
- const directory = join5(taubeHome(), "auth");
753
+ const directory = join4(taubeHome(), "auth");
742
754
  await mkdir3(directory, { recursive: true, mode: 448 });
743
755
  const result = { authenticated, checkedAt: new Date().toISOString() };
744
- const path = join5(directory, `${target}.json`);
756
+ const path = join4(directory, `${target}.json`);
745
757
  const temporary = `${path}.${randomUUID3()}.tmp`;
746
758
  try {
747
759
  await writeFile3(temporary, JSON.stringify(result), {
@@ -1216,17 +1228,17 @@ class FinalResponseCapture {
1216
1228
 
1217
1229
  // src/turn-journal.ts
1218
1230
  import { lstat as lstat2, mkdir as mkdir4, open } from "node:fs/promises";
1219
- import { join as join6 } from "node:path";
1231
+ import { join as join5 } from "node:path";
1220
1232
  import { setTimeout as delay2 } from "node:timers/promises";
1221
1233
  async function openTurnJournal(id) {
1222
1234
  if (!/^[\da-f]{8}-[\da-f]{4}-4[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i.test(id))
1223
1235
  throw new Error("Expected a Taube session ID.");
1224
- const directory = join6(taubeHome(), "turns");
1236
+ const directory = join5(taubeHome(), "turns");
1225
1237
  await mkdir4(directory, { recursive: true, mode: 448 });
1226
1238
  const stat = await lstat2(directory);
1227
1239
  if (!stat.isDirectory() || process.getuid && (stat.uid !== process.getuid() || (stat.mode & 63) !== 0))
1228
1240
  throw new Error("The turn journal directory must be private to the current user.");
1229
- const file = await open(join6(directory, `${id}.ndjson`), "ax", 384);
1241
+ const file = await open(join5(directory, `${id}.ndjson`), "ax", 384);
1230
1242
  let number = 0;
1231
1243
  let active = false;
1232
1244
  let closed = false;
@@ -1355,13 +1367,13 @@ var init_turn_journal = __esm(() => {
1355
1367
  // src/session-resume.ts
1356
1368
  import { createHash as createHash2 } from "node:crypto";
1357
1369
  import { mkdir as mkdir5 } from "node:fs/promises";
1358
- import { join as join7 } from "node:path";
1370
+ import { join as join6 } from "node:path";
1359
1371
  async function acquireResume(target, cwd, dispatcher, { sourceId, acpSessionId }) {
1360
- const directory = join7(taubeHome(), "resume-locks");
1372
+ const directory = join6(taubeHome(), "resume-locks");
1361
1373
  await mkdir5(directory, { recursive: true, mode: 448 });
1362
1374
  const key = createHash2("sha256").update(JSON.stringify([target, acpSessionId])).digest("hex");
1363
1375
  const { DatabaseSync } = await import("node:sqlite");
1364
- const lock = new DatabaseSync(join7(directory, key));
1376
+ const lock = new DatabaseSync(join6(directory, key));
1365
1377
  try {
1366
1378
  try {
1367
1379
  lock.exec("BEGIN IMMEDIATE");
@@ -1564,7 +1576,6 @@ async function runAdapter(target, instruction, cwd, record, signal, chunks, foll
1564
1576
  cwd,
1565
1577
  env: {
1566
1578
  ...adapter.env,
1567
- LOSOFT_TABE_HOME: taubeHome(),
1568
1579
  TAUBE_DISPATCHER: record.id
1569
1580
  },
1570
1581
  detached: process.platform !== "win32",
@@ -1901,7 +1912,6 @@ var init_direct_acp = __esm(() => {
1901
1912
  init_adapter();
1902
1913
  init_auth_state();
1903
1914
  init_direct_session();
1904
- init_home();
1905
1915
  init_permission();
1906
1916
  init_prompt();
1907
1917
  init_session_channel();
@@ -1912,7 +1922,7 @@ var init_direct_acp = __esm(() => {
1912
1922
  // src/turn-history.ts
1913
1923
  import { constants as constants2, unwatchFile, watchFile } from "node:fs";
1914
1924
  import { open as open2 } from "node:fs/promises";
1915
- import { join as join8 } from "node:path";
1925
+ import { join as join7 } from "node:path";
1916
1926
  function invalidRecord() {
1917
1927
  throw new Error("Invalid record in the selected turn journal.");
1918
1928
  }
@@ -2105,7 +2115,7 @@ class TurnJournal {
2105
2115
  function journalPath(id) {
2106
2116
  if (!uuidPattern.test(id))
2107
2117
  throw new Error("Expected a Taube session ID.");
2108
- return join8(taubeHome(), "turns", `${id}.ndjson`);
2118
+ return join7(taubeHome(), "turns", `${id}.ndjson`);
2109
2119
  }
2110
2120
  async function readLatestTurnText(id, full, final, result = false) {
2111
2121
  const journal = new TurnJournal(full || result ? "response" : "finalResponse");
@@ -2295,7 +2305,7 @@ import {
2295
2305
  statSync as statSync2,
2296
2306
  unlinkSync
2297
2307
  } from "node:fs";
2298
- import { dirname as dirname2, join as join9 } from "node:path";
2308
+ import { dirname as dirname2, join as join8 } from "node:path";
2299
2309
  import { setTimeout as delay4 } from "node:timers/promises";
2300
2310
  function missing(error) {
2301
2311
  return error.code === "ENOENT";
@@ -2466,7 +2476,7 @@ async function pruneSessions(options) {
2466
2476
  if (!days || !Number.isSafeInteger(age))
2467
2477
  throw new Error("--older-than requires a positive whole number of days, for example 30d.");
2468
2478
  const cutoff = Date.now() - age;
2469
- const turns = join9(taubeHome(), "turns");
2479
+ const turns = join8(taubeHome(), "turns");
2470
2480
  const result = {
2471
2481
  mode: options.apply ? "applied" : "preview",
2472
2482
  selectedIds: [],
@@ -2679,7 +2689,7 @@ import { parseArgs as parseArgs2 } from "node:util";
2679
2689
  // package.json
2680
2690
  var package_default = {
2681
2691
  name: "@losoft/taube",
2682
- version: "0.1.8",
2692
+ version: "0.1.9",
2683
2693
  description: "Delegate a coding task to Codex, Claude Code, or Grok Build over the Agent Client Protocol.",
2684
2694
  type: "module",
2685
2695
  license: "MIT",
@@ -3143,6 +3153,9 @@ permission requests exit nonzero.
3143
3153
  -V, --version Print the installed Taube version.
3144
3154
  -h, --help Show this help.
3145
3155
 
3156
+ LOSOFT_TAUBE_HOME sets the directory for local session and authentication data.
3157
+ If it is unset or blank, Taube uses LOSOFT_TABE_HOME (legacy), then ~/.taube.
3158
+
3146
3159
  Omit --model and --effort to use the target defaults.`;
3147
3160
  async function showSurfaces(args) {
3148
3161
  const { values, positionals } = parseArgs2({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@losoft/taube",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Delegate a coding task to Codex, Claude Code, or Grok Build over the Agent Client Protocol.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taube",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Dispatch coding agents from the terminal with Taube.",
5
5
  "author": {
6
6
  "name": "Taube contributors"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taube",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Dispatch coding agents from the terminal with Taube.",
5
5
  "license": "MIT",
6
6
  "skills": "./skills/",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taube",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Dispatch coding agents from the terminal with Taube.",
5
5
  "license": "MIT"
6
6
  }
@@ -37,6 +37,8 @@ For parallel jobs, use `dispatch --detach` to get the registered session ID whil
37
37
 
38
38
  ## Check your sessions
39
39
 
40
+ If the caller sets `LOSOFT_TAUBE_HOME`, use the same state directory for dispatch and follow-up commands. Taube falls back to the legacy `LOSOFT_TABE_HOME` and then to `~/.taube`, skipping blank values.
41
+
40
42
  Run `taube sessions` or `npx --yes @losoft/taube sessions` to see the current caller’s direct dispatches. Add `--status running` for active work or `--status finished` for all terminal outcomes. Read each record’s `status` and `exitCode` before reporting success. Use `--all` when the user asks for an overview across dispatchers.
41
43
 
42
44
  To add instructions to a running dispatch, use `taube sessions send ID --prompt TEXT`, `--prompt-file FILE`, or stdin. A `queued` receipt means Taube accepted the message for the next turn in that ACP session. Read the original dispatch output for the reply.