xtrm-tools 0.5.15 → 0.5.17
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/cli/dist/index.cjs +39 -10
- package/cli/dist/index.cjs.map +1 -1
- package/cli/package.json +1 -1
- package/hooks/beads-claim-sync.mjs +11 -1
- package/package.json +1 -1
package/cli/dist/index.cjs
CHANGED
|
@@ -13478,7 +13478,7 @@ var require_jsonfile = __commonJS({
|
|
|
13478
13478
|
return obj;
|
|
13479
13479
|
}
|
|
13480
13480
|
var readFile = universalify.fromPromise(_readFile);
|
|
13481
|
-
function
|
|
13481
|
+
function readFileSync3(file2, options = {}) {
|
|
13482
13482
|
if (typeof options === "string") {
|
|
13483
13483
|
options = { encoding: options };
|
|
13484
13484
|
}
|
|
@@ -13503,16 +13503,16 @@ var require_jsonfile = __commonJS({
|
|
|
13503
13503
|
await universalify.fromCallback(fs21.writeFile)(file2, str, options);
|
|
13504
13504
|
}
|
|
13505
13505
|
var writeFile = universalify.fromPromise(_writeFile);
|
|
13506
|
-
function
|
|
13506
|
+
function writeFileSync3(file2, obj, options = {}) {
|
|
13507
13507
|
const fs21 = options.fs || _fs;
|
|
13508
13508
|
const str = stringify2(obj, options);
|
|
13509
13509
|
return fs21.writeFileSync(file2, str, options);
|
|
13510
13510
|
}
|
|
13511
13511
|
module2.exports = {
|
|
13512
13512
|
readFile,
|
|
13513
|
-
readFileSync:
|
|
13513
|
+
readFileSync: readFileSync3,
|
|
13514
13514
|
writeFile,
|
|
13515
|
-
writeFileSync:
|
|
13515
|
+
writeFileSync: writeFileSync3
|
|
13516
13516
|
};
|
|
13517
13517
|
}
|
|
13518
13518
|
});
|
|
@@ -33827,7 +33827,7 @@ var init_boxen = __esm({
|
|
|
33827
33827
|
});
|
|
33828
33828
|
|
|
33829
33829
|
// src/index.ts
|
|
33830
|
-
var
|
|
33830
|
+
var import_node_fs5 = require("fs");
|
|
33831
33831
|
var import_node_path6 = require("path");
|
|
33832
33832
|
|
|
33833
33833
|
// ../node_modules/commander/esm.mjs
|
|
@@ -41286,6 +41286,8 @@ var import_node_child_process3 = require("child_process");
|
|
|
41286
41286
|
// src/utils/worktree-session.ts
|
|
41287
41287
|
var import_node_path5 = __toESM(require("path"), 1);
|
|
41288
41288
|
var import_node_child_process2 = require("child_process");
|
|
41289
|
+
var import_node_fs4 = require("fs");
|
|
41290
|
+
var import_node_os5 = require("os");
|
|
41289
41291
|
function randomSlug(len = 4) {
|
|
41290
41292
|
return Math.random().toString(36).slice(2, 2 + len);
|
|
41291
41293
|
}
|
|
@@ -41297,6 +41299,19 @@ function gitRepoRoot(cwd) {
|
|
|
41297
41299
|
});
|
|
41298
41300
|
return r.status === 0 ? (r.stdout ?? "").trim() : null;
|
|
41299
41301
|
}
|
|
41302
|
+
function resolveStatuslineScript() {
|
|
41303
|
+
const pluginsFile = import_node_path5.default.join((0, import_node_os5.homedir)(), ".claude", "plugins", "installed_plugins.json");
|
|
41304
|
+
try {
|
|
41305
|
+
const plugins = JSON.parse((0, import_node_fs4.readFileSync)(pluginsFile, "utf8"));
|
|
41306
|
+
const entries = plugins?.plugins?.["xtrm-tools@xtrm-tools"];
|
|
41307
|
+
if (entries?.length > 0) {
|
|
41308
|
+
return import_node_path5.default.join(entries[0].installPath, "hooks", "statusline.mjs");
|
|
41309
|
+
}
|
|
41310
|
+
} catch {
|
|
41311
|
+
}
|
|
41312
|
+
const fallback = import_node_path5.default.join((0, import_node_os5.homedir)(), ".claude", "hooks", "statusline.mjs");
|
|
41313
|
+
return fallback;
|
|
41314
|
+
}
|
|
41300
41315
|
async function launchWorktreeSession(opts) {
|
|
41301
41316
|
const { runtime, name } = opts;
|
|
41302
41317
|
const cwd = process.cwd();
|
|
@@ -41339,6 +41354,20 @@ async function launchWorktreeSession(opts) {
|
|
|
41339
41354
|
console.log(kleur_default.green(`
|
|
41340
41355
|
\u2713 Worktree ready \u2014 launching ${runtime}...
|
|
41341
41356
|
`));
|
|
41357
|
+
if (runtime === "claude") {
|
|
41358
|
+
const statuslinePath = resolveStatuslineScript();
|
|
41359
|
+
if (statuslinePath) {
|
|
41360
|
+
const claudeDir = import_node_path5.default.join(worktreePath, ".claude");
|
|
41361
|
+
const localSettingsPath = import_node_path5.default.join(claudeDir, "settings.local.json");
|
|
41362
|
+
try {
|
|
41363
|
+
(0, import_node_fs4.mkdirSync)(claudeDir, { recursive: true });
|
|
41364
|
+
(0, import_node_fs4.writeFileSync)(localSettingsPath, JSON.stringify({
|
|
41365
|
+
statusLine: { type: "command", command: `node ${statuslinePath}`, padding: 1 }
|
|
41366
|
+
}, null, 2));
|
|
41367
|
+
} catch {
|
|
41368
|
+
}
|
|
41369
|
+
}
|
|
41370
|
+
}
|
|
41342
41371
|
const runtimeCmd = runtime === "claude" ? "claude" : "pi";
|
|
41343
41372
|
const runtimeArgs = runtime === "claude" ? ["--dangerously-skip-permissions"] : [];
|
|
41344
41373
|
const launchResult = (0, import_node_child_process2.spawnSync)(runtimeCmd, runtimeArgs, {
|
|
@@ -41436,7 +41465,7 @@ function createClaudeCommand() {
|
|
|
41436
41465
|
// src/commands/pi.ts
|
|
41437
41466
|
var import_path13 = __toESM(require("path"), 1);
|
|
41438
41467
|
var import_node_child_process5 = require("child_process");
|
|
41439
|
-
var
|
|
41468
|
+
var import_node_os7 = require("os");
|
|
41440
41469
|
var import_fs_extra13 = __toESM(require_lib2(), 1);
|
|
41441
41470
|
|
|
41442
41471
|
// src/commands/install-pi.ts
|
|
@@ -41444,8 +41473,8 @@ var import_prompts2 = __toESM(require_prompts3(), 1);
|
|
|
41444
41473
|
var import_fs_extra12 = __toESM(require_lib2(), 1);
|
|
41445
41474
|
var import_path12 = __toESM(require("path"), 1);
|
|
41446
41475
|
var import_node_child_process4 = require("child_process");
|
|
41447
|
-
var
|
|
41448
|
-
var PI_AGENT_DIR2 = process.env.PI_AGENT_DIR || import_path12.default.join((0,
|
|
41476
|
+
var import_node_os6 = require("os");
|
|
41477
|
+
var PI_AGENT_DIR2 = process.env.PI_AGENT_DIR || import_path12.default.join((0, import_node_os6.homedir)(), ".pi", "agent");
|
|
41449
41478
|
function fillTemplate(template, values) {
|
|
41450
41479
|
return template.replace(/\{\{(\w+)\}\}/g, (_, key) => values[key] ?? "");
|
|
41451
41480
|
}
|
|
@@ -41644,7 +41673,7 @@ function createInstallPiCommand() {
|
|
|
41644
41673
|
}
|
|
41645
41674
|
|
|
41646
41675
|
// src/commands/pi.ts
|
|
41647
|
-
var PI_AGENT_DIR3 = process.env.PI_AGENT_DIR || import_path13.default.join((0,
|
|
41676
|
+
var PI_AGENT_DIR3 = process.env.PI_AGENT_DIR || import_path13.default.join((0, import_node_os7.homedir)(), ".pi", "agent");
|
|
41648
41677
|
function createPiCommand() {
|
|
41649
41678
|
const cmd = new Command("pi").description("Launch a Pi session in a sandboxed worktree, or manage the Pi runtime").argument("[name]", "Optional session name \u2014 used as xt/<name> branch (random if omitted)").action(async (name) => {
|
|
41650
41679
|
await launchWorktreeSession({ runtime: "pi", name });
|
|
@@ -56918,7 +56947,7 @@ async function printBanner(version3) {
|
|
|
56918
56947
|
// src/index.ts
|
|
56919
56948
|
var version2 = "0.0.0";
|
|
56920
56949
|
try {
|
|
56921
|
-
version2 = JSON.parse((0,
|
|
56950
|
+
version2 = JSON.parse((0, import_node_fs5.readFileSync)((0, import_node_path6.resolve)(__dirname, "../package.json"), "utf8")).version;
|
|
56922
56951
|
} catch {
|
|
56923
56952
|
}
|
|
56924
56953
|
var program2 = new Command();
|