xtrm-tools 0.5.16 → 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 +26 -11
- package/cli/dist/index.cjs.map +1 -1
- package/cli/package.json +1 -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
|
}
|
|
@@ -13510,7 +13510,7 @@ var require_jsonfile = __commonJS({
|
|
|
13510
13510
|
}
|
|
13511
13511
|
module2.exports = {
|
|
13512
13512
|
readFile,
|
|
13513
|
-
readFileSync:
|
|
13513
|
+
readFileSync: readFileSync3,
|
|
13514
13514
|
writeFile,
|
|
13515
13515
|
writeFileSync: writeFileSync3
|
|
13516
13516
|
};
|
|
@@ -41299,6 +41299,19 @@ function gitRepoRoot(cwd) {
|
|
|
41299
41299
|
});
|
|
41300
41300
|
return r.status === 0 ? (r.stdout ?? "").trim() : null;
|
|
41301
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
|
+
}
|
|
41302
41315
|
async function launchWorktreeSession(opts) {
|
|
41303
41316
|
const { runtime, name } = opts;
|
|
41304
41317
|
const cwd = process.cwd();
|
|
@@ -41342,15 +41355,17 @@ async function launchWorktreeSession(opts) {
|
|
|
41342
41355
|
\u2713 Worktree ready \u2014 launching ${runtime}...
|
|
41343
41356
|
`));
|
|
41344
41357
|
if (runtime === "claude") {
|
|
41345
|
-
const
|
|
41346
|
-
|
|
41347
|
-
|
|
41348
|
-
|
|
41349
|
-
|
|
41350
|
-
|
|
41351
|
-
|
|
41352
|
-
|
|
41353
|
-
|
|
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
|
+
}
|
|
41354
41369
|
}
|
|
41355
41370
|
}
|
|
41356
41371
|
const runtimeCmd = runtime === "claude" ? "claude" : "pi";
|