@jentrix/cli 0.5.13 → 0.5.14
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/dist/main.js +35 -15
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -10336,7 +10336,7 @@ import {
|
|
|
10336
10336
|
readFileSync as readFileSync7,
|
|
10337
10337
|
statSync as statSync3
|
|
10338
10338
|
} from "node:fs";
|
|
10339
|
-
import { homedir } from "node:os";
|
|
10339
|
+
import { homedir as homedir2 } from "node:os";
|
|
10340
10340
|
import { basename as basename2, delimiter as delimiter2, dirname as dirname4, join as join6, resolve as resolve4 } from "node:path";
|
|
10341
10341
|
import { fileURLToPath } from "node:url";
|
|
10342
10342
|
|
|
@@ -20593,8 +20593,8 @@ var ConfigError = class extends Error {
|
|
|
20593
20593
|
this.exitCode = exitCode;
|
|
20594
20594
|
}
|
|
20595
20595
|
};
|
|
20596
|
-
function configPathFor(
|
|
20597
|
-
return join(
|
|
20596
|
+
function configPathFor(homedir3) {
|
|
20597
|
+
return join(homedir3, ".config", "stacks", "config.json");
|
|
20598
20598
|
}
|
|
20599
20599
|
var PROJECT_CONFIG_DIR = ".stacks";
|
|
20600
20600
|
function projectConfigPathFor(dir) {
|
|
@@ -20610,8 +20610,8 @@ function findProjectConfigPath(startDir, exists = existsSync) {
|
|
|
20610
20610
|
dir = parent;
|
|
20611
20611
|
}
|
|
20612
20612
|
}
|
|
20613
|
-
function resolveConfigPath(cwd,
|
|
20614
|
-
return findProjectConfigPath(cwd, exists) ?? configPathFor(
|
|
20613
|
+
function resolveConfigPath(cwd, homedir3, exists = existsSync) {
|
|
20614
|
+
return findProjectConfigPath(cwd, exists) ?? configPathFor(homedir3);
|
|
20615
20615
|
}
|
|
20616
20616
|
function scaffoldProjectConfigDir(dir) {
|
|
20617
20617
|
const stacksDir = join(dir, PROJECT_CONFIG_DIR);
|
|
@@ -20962,7 +20962,7 @@ function refreshAccessToken(input) {
|
|
|
20962
20962
|
|
|
20963
20963
|
// src/client.ts
|
|
20964
20964
|
var CLI_NAME = "stacks-cli";
|
|
20965
|
-
var CLI_VERSION = "0.5.
|
|
20965
|
+
var CLI_VERSION = "0.5.14";
|
|
20966
20966
|
var DEAD_TOKEN_MESSAGE = "authentication failed (HTTP 401): the token is dead or expired \u2014 mint a new PAT at /account/tokens on your Jentrix server and update STACKS_TOKEN (or --token / the config file).";
|
|
20967
20967
|
var RELOGIN_MESSAGE = "OAuth session expired and could not be refreshed \u2014 run `jentrix login` to sign in again.";
|
|
20968
20968
|
function originOf2(url2) {
|
|
@@ -25105,6 +25105,8 @@ async function offerCardMint(kind, payload, flags, deps2, sessionId = null) {
|
|
|
25105
25105
|
artifactId: payload.artifactId,
|
|
25106
25106
|
anchorTaskId: payload.taskId,
|
|
25107
25107
|
noun: mintNoun(ARTIFACT_TYPE_BY_PUSH_KIND[kind] ?? "FINDINGS"),
|
|
25108
|
+
// STA-128: the operator's own claim title, when one was given.
|
|
25109
|
+
artifactTitle: flags.title?.trim() || null,
|
|
25108
25110
|
blocks: Boolean(flags.blocks),
|
|
25109
25111
|
sessionId
|
|
25110
25112
|
});
|
|
@@ -25147,9 +25149,11 @@ async function mintCard(deps2, input) {
|
|
|
25147
25149
|
const anchor = await callStructured(caller, "get_task", {
|
|
25148
25150
|
taskId: input.anchorTaskId
|
|
25149
25151
|
});
|
|
25152
|
+
const claim = input.artifactTitle?.trim();
|
|
25150
25153
|
const created = await callStructured(caller, "create_task", {
|
|
25151
25154
|
columnId: input.board.columnId,
|
|
25152
|
-
title
|
|
25155
|
+
// The task-title cap is 200 chars; the claim form truncates into it.
|
|
25156
|
+
title: (claim ? `${input.noun}: ${claim}` : `${input.noun} from ${String(anchor.key ?? input.anchorTaskId)}`).slice(0, 200),
|
|
25153
25157
|
description: `Minted from a ${input.noun.toLowerCase()} artifact pushed on ${String(anchor.key ?? input.anchorTaskId)}. Origin session artifact: ${input.artifactId}.`,
|
|
25154
25158
|
idempotencyKey: `mint-${input.artifactId}`
|
|
25155
25159
|
});
|
|
@@ -25225,6 +25229,8 @@ async function runMintIssue(flags, deps2) {
|
|
|
25225
25229
|
artifactId: flags.artifact,
|
|
25226
25230
|
anchorTaskId: flags.fromTask,
|
|
25227
25231
|
noun: mintNoun(type),
|
|
25232
|
+
// STA-128: the stored artifact's claim title rides onto the card.
|
|
25233
|
+
artifactTitle: typeof record3.title === "string" ? record3.title : null,
|
|
25228
25234
|
blocks: Boolean(flags.blocks),
|
|
25229
25235
|
sessionId
|
|
25230
25236
|
});
|
|
@@ -27622,6 +27628,7 @@ function registerPluginCommand(program3, deps2, onExit2) {
|
|
|
27622
27628
|
// src/commands/runner.ts
|
|
27623
27629
|
import { execFile as execFile2, spawn as spawn2 } from "node:child_process";
|
|
27624
27630
|
import { constants, promises as fs } from "node:fs";
|
|
27631
|
+
import { homedir } from "node:os";
|
|
27625
27632
|
import { delimiter, isAbsolute, resolve as resolve3 } from "node:path";
|
|
27626
27633
|
var CLI_RUNNER_PROTOCOL_VERSION = 1;
|
|
27627
27634
|
var RUNNER_TIMEOUT_MS = 35e3;
|
|
@@ -27690,6 +27697,16 @@ async function resolveRunnerExecutable(env = process.env) {
|
|
|
27690
27697
|
}
|
|
27691
27698
|
return null;
|
|
27692
27699
|
}
|
|
27700
|
+
async function resolveClaudeExecutable(env = process.env, home = homedir()) {
|
|
27701
|
+
const names = platformExecutableNames("claude");
|
|
27702
|
+
const onPath = await resolveExecutableOnPath(names, env);
|
|
27703
|
+
if (onPath) return onPath;
|
|
27704
|
+
for (const name of names) {
|
|
27705
|
+
const found = await executable(resolve3(home, ".local", "bin", name));
|
|
27706
|
+
if (found) return found;
|
|
27707
|
+
}
|
|
27708
|
+
return null;
|
|
27709
|
+
}
|
|
27693
27710
|
function invokeRunnerProcess(file, args, stdin, timeoutMs = RUNNER_TIMEOUT_MS) {
|
|
27694
27711
|
if (!isAbsolute(file)) {
|
|
27695
27712
|
return Promise.reject(new Error("runner executable path must be absolute"));
|
|
@@ -28213,8 +28230,9 @@ var RUNTIMES = [
|
|
|
28213
28230
|
provider: "claude",
|
|
28214
28231
|
resolve: (deps2) => deps2.resolveClaude(),
|
|
28215
28232
|
absent: [
|
|
28216
|
-
"note: the `claude` CLI
|
|
28217
|
-
"
|
|
28233
|
+
"note: the `claude` CLI was not found \u2014 skipped its plugin.",
|
|
28234
|
+
" Installed already? This terminal's PATH may predate the install \u2014 reopen it and re-run, or run: jentrix plugin install claude",
|
|
28235
|
+
" Otherwise install Claude Code (https://claude.com/claude-code) first."
|
|
28218
28236
|
]
|
|
28219
28237
|
},
|
|
28220
28238
|
{
|
|
@@ -28813,8 +28831,8 @@ function readStdin() {
|
|
|
28813
28831
|
process.stdin.on("error", reject);
|
|
28814
28832
|
});
|
|
28815
28833
|
}
|
|
28816
|
-
var CONFIG_PATH = resolveConfigPath(process.cwd(),
|
|
28817
|
-
var HOME_CONFIG_PATH = configPathFor(
|
|
28834
|
+
var CONFIG_PATH = resolveConfigPath(process.cwd(), homedir2());
|
|
28835
|
+
var HOME_CONFIG_PATH = configPathFor(homedir2());
|
|
28818
28836
|
function configFile() {
|
|
28819
28837
|
return readConfigFile(CONFIG_PATH);
|
|
28820
28838
|
}
|
|
@@ -29033,7 +29051,7 @@ var sessionDeps = {
|
|
|
29033
29051
|
closeSync3(fd);
|
|
29034
29052
|
}
|
|
29035
29053
|
},
|
|
29036
|
-
spoolRoot: join6(
|
|
29054
|
+
spoolRoot: join6(homedir2(), ".config", "stacks", "session-spool")
|
|
29037
29055
|
};
|
|
29038
29056
|
var sessionCommand = registerSessionCommand(program2, sessionDeps, onExit);
|
|
29039
29057
|
registerSnapshotCommand(sessionCommand, sessionDeps, onExit);
|
|
@@ -29047,7 +29065,9 @@ var CODEX_PLUGIN_DIR = fileURLToPath(
|
|
|
29047
29065
|
var pluginDeps = {
|
|
29048
29066
|
resolvePluginDir: () => existsSync6(PLUGIN_DIR) && isPluginMarketplaceDir(PLUGIN_DIR) ? PLUGIN_DIR : null,
|
|
29049
29067
|
resolveCodexPluginDir: () => existsSync6(CODEX_PLUGIN_DIR) && isCodexPluginMarketplaceDir(CODEX_PLUGIN_DIR) ? CODEX_PLUGIN_DIR : null,
|
|
29050
|
-
|
|
29068
|
+
// STA-133: PATH plus the native installer's ~/.local/bin, so a terminal
|
|
29069
|
+
// whose PATH predates the Claude Code install still finds the binary.
|
|
29070
|
+
resolveClaude: () => resolveClaudeExecutable(process.env),
|
|
29051
29071
|
resolveCodex: () => resolveExecutableOnPath(platformExecutableNames("codex"), process.env),
|
|
29052
29072
|
resolveRunner: () => resolveRunnerExecutable(process.env),
|
|
29053
29073
|
resolveNpm: () => resolveExecutableOnPath(platformExecutableNames("npm"), process.env),
|
|
@@ -29158,7 +29178,7 @@ registerSetupCommand(
|
|
|
29158
29178
|
}
|
|
29159
29179
|
},
|
|
29160
29180
|
login: (flags) => runLoginCommand(flags, loginDeps),
|
|
29161
|
-
codexConfigPath: () => join6(process.env.CODEX_HOME ?? join6(
|
|
29181
|
+
codexConfigPath: () => join6(process.env.CODEX_HOME ?? join6(homedir2(), ".codex"), "config.toml"),
|
|
29162
29182
|
readTextFile: (path) => existsSync6(path) ? readFileSync7(path, "utf8") : null,
|
|
29163
29183
|
appendTextFile: (path, text) => {
|
|
29164
29184
|
mkdirSync4(dirname4(path), { recursive: true });
|
|
@@ -29167,7 +29187,7 @@ registerSetupCommand(
|
|
|
29167
29187
|
copyFile: (from, to) => copyFileSync(from, to),
|
|
29168
29188
|
now: () => /* @__PURE__ */ new Date(),
|
|
29169
29189
|
cwd: () => process.cwd(),
|
|
29170
|
-
homeDir: () =>
|
|
29190
|
+
homeDir: () => homedir2(),
|
|
29171
29191
|
git: defaultGitRunner,
|
|
29172
29192
|
readLine
|
|
29173
29193
|
},
|