nexrall-code 0.5.56 → 0.5.57
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/index.js +204 -107
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -15375,6 +15375,63 @@ var require_rules = __commonJS({
|
|
|
15375
15375
|
}
|
|
15376
15376
|
});
|
|
15377
15377
|
|
|
15378
|
+
// ../core/dist/permissions/bashClassify.js
|
|
15379
|
+
var require_bashClassify = __commonJS({
|
|
15380
|
+
"../core/dist/permissions/bashClassify.js"(exports) {
|
|
15381
|
+
"use strict";
|
|
15382
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15383
|
+
exports.bashNeedsRepoLock = bashNeedsRepoLock;
|
|
15384
|
+
var MUTATING_BASH_VERBS = /* @__PURE__ */ new Set([
|
|
15385
|
+
"git",
|
|
15386
|
+
"npm",
|
|
15387
|
+
"pnpm",
|
|
15388
|
+
"yarn",
|
|
15389
|
+
"bun",
|
|
15390
|
+
"cargo",
|
|
15391
|
+
"go",
|
|
15392
|
+
"pip",
|
|
15393
|
+
"pip3",
|
|
15394
|
+
"poetry",
|
|
15395
|
+
"uv",
|
|
15396
|
+
"bundle",
|
|
15397
|
+
"composer",
|
|
15398
|
+
"gradle",
|
|
15399
|
+
"mvn",
|
|
15400
|
+
"make",
|
|
15401
|
+
"terraform",
|
|
15402
|
+
"helm",
|
|
15403
|
+
"docker",
|
|
15404
|
+
"vsce",
|
|
15405
|
+
"tsc",
|
|
15406
|
+
"pytest",
|
|
15407
|
+
"dotnet",
|
|
15408
|
+
"swift",
|
|
15409
|
+
"gem"
|
|
15410
|
+
]);
|
|
15411
|
+
function bashNeedsRepoLock(command) {
|
|
15412
|
+
if (!command)
|
|
15413
|
+
return false;
|
|
15414
|
+
const segments = command.split(/\|\||&&|[;|&\n()]|\$\(/);
|
|
15415
|
+
for (const seg of segments) {
|
|
15416
|
+
for (const tokenRaw of seg.trim().split(/\s+/)) {
|
|
15417
|
+
const token = tokenRaw.replace(/^["']|["']$/g, "");
|
|
15418
|
+
if (!token)
|
|
15419
|
+
continue;
|
|
15420
|
+
if (/^[A-Za-z_][A-Za-z0-9_]*=/.test(token))
|
|
15421
|
+
continue;
|
|
15422
|
+
if (token === "sudo" || token === "time" || token === "nice" || token === "env")
|
|
15423
|
+
continue;
|
|
15424
|
+
const verb = token.split("/").pop() ?? token;
|
|
15425
|
+
if (MUTATING_BASH_VERBS.has(verb))
|
|
15426
|
+
return true;
|
|
15427
|
+
break;
|
|
15428
|
+
}
|
|
15429
|
+
}
|
|
15430
|
+
return false;
|
|
15431
|
+
}
|
|
15432
|
+
}
|
|
15433
|
+
});
|
|
15434
|
+
|
|
15378
15435
|
// ../core/dist/agent/planMode.js
|
|
15379
15436
|
var require_planMode = __commonJS({
|
|
15380
15437
|
"../core/dist/agent/planMode.js"(exports) {
|
|
@@ -15897,12 +15954,11 @@ var require_loop = __commonJS({
|
|
|
15897
15954
|
};
|
|
15898
15955
|
}();
|
|
15899
15956
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15900
|
-
exports.VERIFY_CMD_RE = exports.WRITE_TOOL_NAMES = exports.ToolNotAllowedError = exports.AGENT_MEMORY_TOOL_SCHEMA = exports.AGENT_MEMORY_TOOL = exports._stallLimits = void 0;
|
|
15957
|
+
exports.VERIFY_CMD_RE = exports.WRITE_TOOL_NAMES = exports.ToolNotAllowedError = exports.AGENT_MEMORY_TOOL_SCHEMA = exports.AGENT_MEMORY_TOOL = exports._stallLimits = exports.bashNeedsRepoLock = void 0;
|
|
15901
15958
|
exports.errorRoundSignature = errorRoundSignature;
|
|
15902
15959
|
exports.executeAgentMemoryWrite = executeAgentMemoryWrite;
|
|
15903
15960
|
exports.stopReasonNotice = stopReasonNotice;
|
|
15904
15961
|
exports.resolveMaxIterations = resolveMaxIterations;
|
|
15905
|
-
exports.bashNeedsRepoLock = bashNeedsRepoLock;
|
|
15906
15962
|
exports.lockPathsFor = lockPathsFor;
|
|
15907
15963
|
exports.resolveMaxConcurrentSubtasks = resolveMaxConcurrentSubtasks;
|
|
15908
15964
|
exports.createLimiter = createLimiter;
|
|
@@ -15932,6 +15988,10 @@ var require_loop = __commonJS({
|
|
|
15932
15988
|
var agentTypes_1 = require_agentTypes();
|
|
15933
15989
|
var skills_1 = require_skills();
|
|
15934
15990
|
var rules_1 = require_rules();
|
|
15991
|
+
var bashClassify_1 = require_bashClassify();
|
|
15992
|
+
Object.defineProperty(exports, "bashNeedsRepoLock", { enumerable: true, get: function() {
|
|
15993
|
+
return bashClassify_1.bashNeedsRepoLock;
|
|
15994
|
+
} });
|
|
15935
15995
|
var planMode_1 = require_planMode();
|
|
15936
15996
|
var agentRegistry_1 = require_agentRegistry();
|
|
15937
15997
|
var sandbox_1 = require_sandbox();
|
|
@@ -16165,54 +16225,6 @@ ${ctx.repeatError}
|
|
|
16165
16225
|
"notebook_edit"
|
|
16166
16226
|
]);
|
|
16167
16227
|
var REPO_STATE_LOCK = "\0repo-state";
|
|
16168
|
-
var MUTATING_BASH_VERBS = /* @__PURE__ */ new Set([
|
|
16169
|
-
"git",
|
|
16170
|
-
"npm",
|
|
16171
|
-
"pnpm",
|
|
16172
|
-
"yarn",
|
|
16173
|
-
"bun",
|
|
16174
|
-
"cargo",
|
|
16175
|
-
"go",
|
|
16176
|
-
"pip",
|
|
16177
|
-
"pip3",
|
|
16178
|
-
"poetry",
|
|
16179
|
-
"uv",
|
|
16180
|
-
"bundle",
|
|
16181
|
-
"composer",
|
|
16182
|
-
"gradle",
|
|
16183
|
-
"mvn",
|
|
16184
|
-
"make",
|
|
16185
|
-
"terraform",
|
|
16186
|
-
"helm",
|
|
16187
|
-
"docker",
|
|
16188
|
-
"vsce",
|
|
16189
|
-
"tsc",
|
|
16190
|
-
"pytest",
|
|
16191
|
-
"dotnet",
|
|
16192
|
-
"swift",
|
|
16193
|
-
"gem"
|
|
16194
|
-
]);
|
|
16195
|
-
function bashNeedsRepoLock(command) {
|
|
16196
|
-
if (!command)
|
|
16197
|
-
return false;
|
|
16198
|
-
const segments = command.split(/\|\||&&|[;|&\n()]|\$\(/);
|
|
16199
|
-
for (const seg of segments) {
|
|
16200
|
-
for (const tokenRaw of seg.trim().split(/\s+/)) {
|
|
16201
|
-
const token = tokenRaw.replace(/^["']|["']$/g, "");
|
|
16202
|
-
if (!token)
|
|
16203
|
-
continue;
|
|
16204
|
-
if (/^[A-Za-z_][A-Za-z0-9_]*=/.test(token))
|
|
16205
|
-
continue;
|
|
16206
|
-
if (token === "sudo" || token === "time" || token === "nice" || token === "env")
|
|
16207
|
-
continue;
|
|
16208
|
-
const verb = token.split("/").pop() ?? token;
|
|
16209
|
-
if (MUTATING_BASH_VERBS.has(verb))
|
|
16210
|
-
return true;
|
|
16211
|
-
break;
|
|
16212
|
-
}
|
|
16213
|
-
}
|
|
16214
|
-
return false;
|
|
16215
|
-
}
|
|
16216
16228
|
function lockPathsFor(name, input, workDir) {
|
|
16217
16229
|
if (!WRITE_TOOLS.has(name))
|
|
16218
16230
|
return [];
|
|
@@ -17386,7 +17398,7 @@ ${options.nexrallMd}` : "") : options.nexrallMd;
|
|
|
17386
17398
|
options.checkpointManager?.recordBeforeMutation(name, input);
|
|
17387
17399
|
const onStream = options.onToolStreamChunk ? (chunk) => options.onToolStreamChunk(name, chunk) : void 0;
|
|
17388
17400
|
const run = () => (0, executor_1.executeTool)(name, input, options.abortSignal, sandboxCfg, options.workDir, agentScope, onStream);
|
|
17389
|
-
const locks = name === "bash" ? bashNeedsRepoLock(String(input.command ?? "")) ? [REPO_STATE_LOCK] : [] : lockPathsFor(name, input, options.workDir);
|
|
17401
|
+
const locks = name === "bash" ? (0, bashClassify_1.bashNeedsRepoLock)(String(input.command ?? "")) ? [REPO_STATE_LOCK] : [] : lockPathsFor(name, input, options.workDir);
|
|
17390
17402
|
result = locks.length ? await withFileLocks(locks, run) : await run();
|
|
17391
17403
|
}
|
|
17392
17404
|
} catch (err) {
|
|
@@ -18616,6 +18628,95 @@ var require_manager2 = __commonJS({
|
|
|
18616
18628
|
}
|
|
18617
18629
|
});
|
|
18618
18630
|
|
|
18631
|
+
// ../core/dist/permissions/modePolicy.js
|
|
18632
|
+
var require_modePolicy = __commonJS({
|
|
18633
|
+
"../core/dist/permissions/modePolicy.js"(exports) {
|
|
18634
|
+
"use strict";
|
|
18635
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18636
|
+
exports.BASH_TOOLS = exports.FILE_MUTATE_TOOLS = exports.FILE_WRITE_TOOLS = exports.READ_ONLY_TOOLS = void 0;
|
|
18637
|
+
exports.isReadOnlyBash = isReadOnlyBash;
|
|
18638
|
+
exports.decide = decide;
|
|
18639
|
+
exports.describeMode = describeMode2;
|
|
18640
|
+
exports.parseMode = parseMode2;
|
|
18641
|
+
var bashClassify_1 = require_bashClassify();
|
|
18642
|
+
exports.READ_ONLY_TOOLS = /* @__PURE__ */ new Set([
|
|
18643
|
+
"read_file",
|
|
18644
|
+
"list_directory",
|
|
18645
|
+
"search_files",
|
|
18646
|
+
"glob",
|
|
18647
|
+
"grep",
|
|
18648
|
+
"fetch_url",
|
|
18649
|
+
"web_search",
|
|
18650
|
+
"bash_output",
|
|
18651
|
+
"kill_shell",
|
|
18652
|
+
"todo_read",
|
|
18653
|
+
"todo_write",
|
|
18654
|
+
"memory_read",
|
|
18655
|
+
"use_skill",
|
|
18656
|
+
"notebook_read",
|
|
18657
|
+
"get_diagnostics",
|
|
18658
|
+
"go_to_definition",
|
|
18659
|
+
"find_references",
|
|
18660
|
+
"get_symbols",
|
|
18661
|
+
"get_workspace_symbols",
|
|
18662
|
+
"get_hover"
|
|
18663
|
+
]);
|
|
18664
|
+
exports.FILE_WRITE_TOOLS = /* @__PURE__ */ new Set([
|
|
18665
|
+
"write_file",
|
|
18666
|
+
"create_file",
|
|
18667
|
+
"edit_file",
|
|
18668
|
+
"multi_edit",
|
|
18669
|
+
"notebook_edit"
|
|
18670
|
+
]);
|
|
18671
|
+
exports.FILE_MUTATE_TOOLS = /* @__PURE__ */ new Set([
|
|
18672
|
+
"delete_file",
|
|
18673
|
+
"move_file",
|
|
18674
|
+
"copy_file"
|
|
18675
|
+
]);
|
|
18676
|
+
exports.BASH_TOOLS = /* @__PURE__ */ new Set(["bash", "run_command", "execute_command"]);
|
|
18677
|
+
function isReadOnlyBash(command) {
|
|
18678
|
+
return !(0, bashClassify_1.bashNeedsRepoLock)(command);
|
|
18679
|
+
}
|
|
18680
|
+
function decide(req) {
|
|
18681
|
+
const { tool, mode } = req;
|
|
18682
|
+
const command = String(req.input.command ?? req.input.cmd ?? "");
|
|
18683
|
+
if (exports.READ_ONLY_TOOLS.has(tool))
|
|
18684
|
+
return "allow";
|
|
18685
|
+
if (exports.BASH_TOOLS.has(tool) && isReadOnlyBash(command) && !req.destructive)
|
|
18686
|
+
return "allow";
|
|
18687
|
+
if (req.destructive)
|
|
18688
|
+
return "confirm";
|
|
18689
|
+
if (mode === "plan")
|
|
18690
|
+
return "deny";
|
|
18691
|
+
if (req.bypass)
|
|
18692
|
+
return "allow";
|
|
18693
|
+
if (exports.FILE_WRITE_TOOLS.has(tool) || exports.FILE_MUTATE_TOOLS.has(tool)) {
|
|
18694
|
+
return mode === "ask" ? "ask" : "allow";
|
|
18695
|
+
}
|
|
18696
|
+
if (exports.BASH_TOOLS.has(tool)) {
|
|
18697
|
+
return mode === "auto" ? "allow" : "ask";
|
|
18698
|
+
}
|
|
18699
|
+
return "ask";
|
|
18700
|
+
}
|
|
18701
|
+
function describeMode2(mode) {
|
|
18702
|
+
switch (mode) {
|
|
18703
|
+
case "plan":
|
|
18704
|
+
return "plan \u2014 read-only, produces a plan for approval";
|
|
18705
|
+
case "ask":
|
|
18706
|
+
return "ask \u2014 approves reads; asks before edits and commands";
|
|
18707
|
+
case "edit":
|
|
18708
|
+
return "edit \u2014 edits files freely; asks before shell commands";
|
|
18709
|
+
case "auto":
|
|
18710
|
+
return "auto \u2014 edits and runs commands; still confirms irreversible actions";
|
|
18711
|
+
}
|
|
18712
|
+
}
|
|
18713
|
+
function parseMode2(raw) {
|
|
18714
|
+
const s2 = String(raw ?? "").trim().toLowerCase();
|
|
18715
|
+
return s2 === "plan" || s2 === "ask" || s2 === "edit" || s2 === "auto" ? s2 : "ask";
|
|
18716
|
+
}
|
|
18717
|
+
}
|
|
18718
|
+
});
|
|
18719
|
+
|
|
18619
18720
|
// ../core/dist/permissions/destructive.js
|
|
18620
18721
|
var require_destructive = __commonJS({
|
|
18621
18722
|
"../core/dist/permissions/destructive.js"(exports) {
|
|
@@ -19378,6 +19479,8 @@ var require_dist2 = __commonJS({
|
|
|
19378
19479
|
__exportStar(require_planMode(), exports);
|
|
19379
19480
|
__exportStar(require_agentRegistry(), exports);
|
|
19380
19481
|
__exportStar(require_rules(), exports);
|
|
19482
|
+
__exportStar(require_modePolicy(), exports);
|
|
19483
|
+
__exportStar(require_bashClassify(), exports);
|
|
19381
19484
|
__exportStar(require_destructive(), exports);
|
|
19382
19485
|
__exportStar(require_plugins(), exports);
|
|
19383
19486
|
__exportStar(require_installer(), exports);
|
|
@@ -53703,7 +53806,7 @@ var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
|
53703
53806
|
var source_default = chalk;
|
|
53704
53807
|
|
|
53705
53808
|
// src/index.ts
|
|
53706
|
-
var
|
|
53809
|
+
var import_code_core6 = __toESM(require_dist2(), 1);
|
|
53707
53810
|
|
|
53708
53811
|
// src/commands/auth.ts
|
|
53709
53812
|
import * as readline from "readline";
|
|
@@ -54790,14 +54893,14 @@ var import_code_core2 = __toESM(require_dist2(), 1);
|
|
|
54790
54893
|
var autoApproved = /* @__PURE__ */ new Set();
|
|
54791
54894
|
var _rules = { allow: [], ask: [], deny: [] };
|
|
54792
54895
|
var _workDir = process.cwd();
|
|
54793
|
-
var _mode = "
|
|
54896
|
+
var _mode = "ask";
|
|
54794
54897
|
function initPermissions(workDir) {
|
|
54795
54898
|
_workDir = workDir;
|
|
54796
54899
|
_rules = (0, import_code_core2.loadSettings)(workDir).permissions;
|
|
54797
54900
|
return _rules;
|
|
54798
54901
|
}
|
|
54799
54902
|
function setMode(mode) {
|
|
54800
|
-
_mode = mode
|
|
54903
|
+
_mode = (0, import_code_core2.parseMode)(mode);
|
|
54801
54904
|
}
|
|
54802
54905
|
function setAutoApprove(category) {
|
|
54803
54906
|
autoApproved.add(category);
|
|
@@ -54864,31 +54967,18 @@ async function requestPermission(req) {
|
|
|
54864
54967
|
}
|
|
54865
54968
|
if (decision === "allow")
|
|
54866
54969
|
return true;
|
|
54867
|
-
const
|
|
54868
|
-
|
|
54869
|
-
|
|
54870
|
-
|
|
54871
|
-
"
|
|
54872
|
-
|
|
54873
|
-
"
|
|
54874
|
-
|
|
54875
|
-
|
|
54876
|
-
|
|
54877
|
-
"memory_read",
|
|
54878
|
-
"memory_write",
|
|
54879
|
-
"use_skill",
|
|
54880
|
-
"notebook_read",
|
|
54881
|
-
"get_diagnostics",
|
|
54882
|
-
"go_to_definition",
|
|
54883
|
-
"find_references",
|
|
54884
|
-
"get_symbols",
|
|
54885
|
-
"get_workspace_symbols",
|
|
54886
|
-
"get_hover",
|
|
54887
|
-
"open_in_browser"
|
|
54888
|
-
];
|
|
54889
|
-
if (readOnlyTools.includes(tool))
|
|
54970
|
+
const verdict = (0, import_code_core2.decide)({
|
|
54971
|
+
tool,
|
|
54972
|
+
input,
|
|
54973
|
+
mode: _mode,
|
|
54974
|
+
bypass: isAutoApproved("all"),
|
|
54975
|
+
// The destructive case was already handled above with the strong confirm flow
|
|
54976
|
+
// (type "yes", no "approve all"), so it must not be re-triggered here.
|
|
54977
|
+
destructive: false
|
|
54978
|
+
});
|
|
54979
|
+
if (verdict === "allow")
|
|
54890
54980
|
return true;
|
|
54891
|
-
if (
|
|
54981
|
+
if (verdict === "deny") {
|
|
54892
54982
|
console.error(source_default.yellow(` \u2298 Plan mode \u2014 refused ${tool} (read-only until you switch mode).`));
|
|
54893
54983
|
return false;
|
|
54894
54984
|
}
|
|
@@ -55038,6 +55128,9 @@ async function requestPermission(req) {
|
|
|
55038
55128
|
return answer === "y" || answer === "yes";
|
|
55039
55129
|
}
|
|
55040
55130
|
|
|
55131
|
+
// src/commands/chat.ts
|
|
55132
|
+
var import_code_core4 = __toESM(require_dist2(), 1);
|
|
55133
|
+
|
|
55041
55134
|
// src/commands/sessions.ts
|
|
55042
55135
|
import * as fs3 from "fs";
|
|
55043
55136
|
import * as path from "path";
|
|
@@ -64461,7 +64554,7 @@ var InkReadlineAdapter = class extends EventEmitter3 {
|
|
|
64461
64554
|
};
|
|
64462
64555
|
|
|
64463
64556
|
// src/commands/chat.ts
|
|
64464
|
-
var CLI_VERSION = "0.5.
|
|
64557
|
+
var CLI_VERSION = "0.5.57";
|
|
64465
64558
|
var MODEL_LABELS = {
|
|
64466
64559
|
turbo: "Nexrall Turbo",
|
|
64467
64560
|
pro: "Nexrall Pro",
|
|
@@ -65524,11 +65617,15 @@ ${dirList}`;
|
|
|
65524
65617
|
case "/mode": {
|
|
65525
65618
|
const modeArg = arg.toLowerCase();
|
|
65526
65619
|
if (!modeArg) {
|
|
65527
|
-
console.log(source_default.dim(` Current: ${source_default.cyan(agentMode)}
|
|
65620
|
+
console.log(source_default.dim(` Current: ${source_default.cyan(agentMode)}`));
|
|
65621
|
+
for (const m2 of ["ask", "edit", "auto", "plan"]) {
|
|
65622
|
+
const marker = m2 === agentMode ? source_default.cyan("\u276F") : " ";
|
|
65623
|
+
console.log(` ${marker} ${source_default.bold(m2.padEnd(5))} ${source_default.dim((0, import_code_core4.describeMode)(m2).replace(`${m2} \u2014 `, ""))}`);
|
|
65624
|
+
}
|
|
65528
65625
|
} else if (["ask", "edit", "plan", "auto"].includes(modeArg)) {
|
|
65529
65626
|
agentMode = modeArg;
|
|
65530
65627
|
updateFooter();
|
|
65531
|
-
console.log(source_default.green(` Mode \u2192 ${source_default.bold(modeArg)}`));
|
|
65628
|
+
console.log(source_default.green(` Mode \u2192 ${source_default.bold(modeArg)}`) + source_default.dim(` ${(0, import_code_core4.describeMode)(modeArg).replace(`${modeArg} \u2014 `, "")}`));
|
|
65532
65629
|
} else {
|
|
65533
65630
|
console.log(source_default.red(` Unknown: ${modeArg}`));
|
|
65534
65631
|
}
|
|
@@ -65818,7 +65915,7 @@ ${caption}` : `[Attached: ${rel}]`;
|
|
|
65818
65915
|
|
|
65819
65916
|
// src/commands/plugin.ts
|
|
65820
65917
|
var import_prompts = __toESM(require_prompts3(), 1);
|
|
65821
|
-
var
|
|
65918
|
+
var import_code_core5 = __toESM(require_dist2(), 1);
|
|
65822
65919
|
function describeInspection(i2, name, ctx) {
|
|
65823
65920
|
console.log();
|
|
65824
65921
|
console.log(source_default.bold(` Plugin: ${name}`) + (i2.meta.version ? source_default.dim(` v${i2.meta.version}`) : ""));
|
|
@@ -65894,14 +65991,14 @@ async function pluginInstallCommand(spec, opts) {
|
|
|
65894
65991
|
let registryName;
|
|
65895
65992
|
const isShortName = /^[\w.-]+$/.test(spec.trim()) && !spec.includes("/");
|
|
65896
65993
|
if (isShortName) {
|
|
65897
|
-
const alias = (0,
|
|
65994
|
+
const alias = (0, import_code_core5.resolveSourceAlias)(spec.trim(), process.cwd(), { includeProject: true });
|
|
65898
65995
|
if (alias) {
|
|
65899
65996
|
source2 = alias.spec;
|
|
65900
65997
|
console.log(source_default.dim(` Source: ${alias.name} (${alias.tier}) \u2190 ${alias.spec}`));
|
|
65901
65998
|
}
|
|
65902
65999
|
}
|
|
65903
66000
|
if (isShortName && source2 === spec) {
|
|
65904
|
-
const entry = await (0,
|
|
66001
|
+
const entry = await (0, import_code_core5.getRegistryPlugin)(spec.trim()).catch(() => null);
|
|
65905
66002
|
if (entry) {
|
|
65906
66003
|
source2 = entry.source;
|
|
65907
66004
|
registryName = entry.name;
|
|
@@ -65916,7 +66013,7 @@ async function pluginInstallCommand(spec, opts) {
|
|
|
65916
66013
|
return;
|
|
65917
66014
|
}
|
|
65918
66015
|
}
|
|
65919
|
-
const res = await (0,
|
|
66016
|
+
const res = await (0, import_code_core5.installPlugin)(source2, {
|
|
65920
66017
|
scope,
|
|
65921
66018
|
workDir: process.cwd(),
|
|
65922
66019
|
name: opts.name ?? registryName,
|
|
@@ -65924,7 +66021,7 @@ async function pluginInstallCommand(spec, opts) {
|
|
|
65924
66021
|
confirm: (i2, name, ctx) => confirmInstall(i2, name, opts.yes === true, ctx)
|
|
65925
66022
|
});
|
|
65926
66023
|
if (registryName)
|
|
65927
|
-
(0,
|
|
66024
|
+
(0, import_code_core5.reportInstall)(registryName);
|
|
65928
66025
|
console.log();
|
|
65929
66026
|
console.log(source_default.green(` \u2713 Installed "${res.name}" (${res.scope}) \u2192 ${res.dir}`) + (res.sha ? source_default.dim(` @ ${res.sha.slice(0, 7)}`) : ""));
|
|
65930
66027
|
if (res.inspection.commands.length) {
|
|
@@ -65938,7 +66035,7 @@ async function pluginInstallCommand(spec, opts) {
|
|
|
65938
66035
|
}
|
|
65939
66036
|
function pluginRemoveCommand(name, opts) {
|
|
65940
66037
|
try {
|
|
65941
|
-
const dir = (0,
|
|
66038
|
+
const dir = (0, import_code_core5.removePlugin)(name, {
|
|
65942
66039
|
scope: opts.project ? "project" : void 0,
|
|
65943
66040
|
// no flag → search both scopes
|
|
65944
66041
|
workDir: process.cwd()
|
|
@@ -65951,14 +66048,14 @@ function pluginRemoveCommand(name, opts) {
|
|
|
65951
66048
|
}
|
|
65952
66049
|
async function pluginUpdateCommand(name, opts) {
|
|
65953
66050
|
const workDir = process.cwd();
|
|
65954
|
-
const targets = name ? [name] : (0,
|
|
66051
|
+
const targets = name ? [name] : (0, import_code_core5.loadPlugins)(workDir).filter((p) => (0, import_code_core5.readReceipt)(p.dir)?.kind === "github").map((p) => p.name);
|
|
65955
66052
|
if (!targets.length) {
|
|
65956
66053
|
console.log(source_default.dim(" No updatable plugins (only GitHub-installed plugins with receipts can update)."));
|
|
65957
66054
|
return;
|
|
65958
66055
|
}
|
|
65959
66056
|
for (const t2 of targets) {
|
|
65960
66057
|
try {
|
|
65961
|
-
const res = await (0,
|
|
66058
|
+
const res = await (0, import_code_core5.updatePlugin)(t2, {
|
|
65962
66059
|
workDir,
|
|
65963
66060
|
confirm: (i2, n, ctx) => confirmInstall(i2, n, opts.yes === true, ctx)
|
|
65964
66061
|
});
|
|
@@ -65975,7 +66072,7 @@ function badgeFor(p) {
|
|
|
65975
66072
|
}
|
|
65976
66073
|
async function pluginSearchCommand(query) {
|
|
65977
66074
|
try {
|
|
65978
|
-
const results = await (0,
|
|
66075
|
+
const results = await (0, import_code_core5.searchRegistry)(query);
|
|
65979
66076
|
if (!results.length) {
|
|
65980
66077
|
console.log(source_default.dim(query ? ` No plugins matching "${query}".` : " Registry is empty."));
|
|
65981
66078
|
return;
|
|
@@ -65998,7 +66095,7 @@ async function pluginSearchCommand(query) {
|
|
|
65998
66095
|
}
|
|
65999
66096
|
async function pluginInfoCommand(name) {
|
|
66000
66097
|
try {
|
|
66001
|
-
const p = await (0,
|
|
66098
|
+
const p = await (0, import_code_core5.getRegistryPlugin)(name);
|
|
66002
66099
|
if (!p) {
|
|
66003
66100
|
console.error(source_default.red(` \u2717 "${name}" not found in the registry.`));
|
|
66004
66101
|
process.exitCode = 1;
|
|
@@ -66034,7 +66131,7 @@ async function pluginInfoCommand(name) {
|
|
|
66034
66131
|
}
|
|
66035
66132
|
}
|
|
66036
66133
|
function pluginListCommand() {
|
|
66037
|
-
const plugins = (0,
|
|
66134
|
+
const plugins = (0, import_code_core5.loadPlugins)(process.cwd());
|
|
66038
66135
|
if (!plugins.length) {
|
|
66039
66136
|
console.log(source_default.dim(" No plugins installed."));
|
|
66040
66137
|
console.log(source_default.dim(" Install one: nex plugin install owner/repo"));
|
|
@@ -66043,10 +66140,10 @@ function pluginListCommand() {
|
|
|
66043
66140
|
console.log();
|
|
66044
66141
|
console.log(source_default.bold(" Installed plugins:"));
|
|
66045
66142
|
for (const p of plugins) {
|
|
66046
|
-
const receipt = (0,
|
|
66143
|
+
const receipt = (0, import_code_core5.readReceipt)(p.dir);
|
|
66047
66144
|
const src = receipt ? source_default.dim(` \u2190 ${receipt.source}`) : source_default.dim(" (manual)");
|
|
66048
66145
|
const at = receipt?.sha ? source_default.dim(` @ ${receipt.sha.slice(0, 7)}`) : "";
|
|
66049
|
-
const insp = (0,
|
|
66146
|
+
const insp = (0, import_code_core5.inspectPluginDir)(p.dir);
|
|
66050
66147
|
const runs = insp.hasHooks || insp.hasMcp ? source_default.yellow(` \u26A0 ${[insp.hasHooks && "hooks", insp.hasMcp && "mcp"].filter(Boolean).join("+")}`) : "";
|
|
66051
66148
|
console.log(
|
|
66052
66149
|
" " + source_default.cyan(p.name.padEnd(24)) + source_default.dim(`${(p.version ?? "").padEnd(10)}${p.scope.padEnd(9)}`) + src + at + runs
|
|
@@ -66056,8 +66153,8 @@ function pluginListCommand() {
|
|
|
66056
66153
|
}
|
|
66057
66154
|
function pluginSourceListCommand() {
|
|
66058
66155
|
const workDir = process.cwd();
|
|
66059
|
-
const sources = (0,
|
|
66060
|
-
const patterns = (0,
|
|
66156
|
+
const sources = (0, import_code_core5.loadDeclaredSources)(workDir, { includeProject: true });
|
|
66157
|
+
const patterns = (0, import_code_core5.allowedSourcePatterns)();
|
|
66061
66158
|
if (patterns) {
|
|
66062
66159
|
console.log();
|
|
66063
66160
|
console.log(source_default.bold(" Organisation policy: ") + source_default.dim(`installs restricted to ${patterns.join(", ")}`));
|
|
@@ -66072,7 +66169,7 @@ function pluginSourceListCommand() {
|
|
|
66072
66169
|
console.log(source_default.bold(" Declared plugin sources:"));
|
|
66073
66170
|
for (const s2 of sources) {
|
|
66074
66171
|
const tier = s2.tier === "project" ? source_default.yellow(s2.tier.padEnd(9)) : source_default.dim(s2.tier.padEnd(9));
|
|
66075
|
-
const blocked = !(0,
|
|
66172
|
+
const blocked = !(0, import_code_core5.isSourceAllowed)(s2.spec, patterns) ? source_default.red(" \u2717 blocked by policy") : "";
|
|
66076
66173
|
console.log(" " + source_default.cyan(s2.name.padEnd(20)) + tier + source_default.white(s2.spec) + blocked);
|
|
66077
66174
|
}
|
|
66078
66175
|
console.log();
|
|
@@ -66082,17 +66179,17 @@ function pluginSourceListCommand() {
|
|
|
66082
66179
|
}
|
|
66083
66180
|
function pluginSourceAddCommand(name, spec, opts) {
|
|
66084
66181
|
try {
|
|
66085
|
-
(0,
|
|
66086
|
-
const patterns = (0,
|
|
66087
|
-
if (patterns && !(0,
|
|
66182
|
+
(0, import_code_core5.parsePluginSource)(spec);
|
|
66183
|
+
const patterns = (0, import_code_core5.allowedSourcePatterns)();
|
|
66184
|
+
if (patterns && !(0, import_code_core5.isSourceAllowed)(spec, patterns)) {
|
|
66088
66185
|
console.error(source_default.red(` \u2717 "${spec}" is not permitted by your organisation's policy.`));
|
|
66089
66186
|
console.error(source_default.dim(` Allowed: ${patterns.join(", ")}`));
|
|
66090
66187
|
process.exitCode = 1;
|
|
66091
66188
|
return;
|
|
66092
66189
|
}
|
|
66093
66190
|
const scope = opts.project ? "project" : "user";
|
|
66094
|
-
const file = (0,
|
|
66095
|
-
(0,
|
|
66191
|
+
const file = (0, import_code_core5.sourcesFileFor)(scope, process.cwd());
|
|
66192
|
+
(0, import_code_core5.writeDeclaredSource)(file, name, spec);
|
|
66096
66193
|
console.log();
|
|
66097
66194
|
console.log(source_default.green(` \u2713 Declared "${name}" \u2192 ${spec}`) + source_default.dim(` (${scope})`));
|
|
66098
66195
|
console.log(source_default.dim(` ${file}`));
|
|
@@ -66106,13 +66203,13 @@ function pluginSourceAddCommand(name, spec, opts) {
|
|
|
66106
66203
|
function pluginSourceRemoveCommand(name, opts) {
|
|
66107
66204
|
const workDir = process.cwd();
|
|
66108
66205
|
const scope = opts.project ? "project" : "user";
|
|
66109
|
-
const file = (0,
|
|
66110
|
-
if ((0,
|
|
66206
|
+
const file = (0, import_code_core5.sourcesFileFor)(scope, workDir);
|
|
66207
|
+
if ((0, import_code_core5.removeDeclaredSource)(file, name)) {
|
|
66111
66208
|
console.log(source_default.green(` \u2713 Removed source "${name}" (${scope})`));
|
|
66112
66209
|
console.log(source_default.dim(" Plugins already installed from it are untouched \u2014 remove them with nex plugin remove <name>"));
|
|
66113
66210
|
return;
|
|
66114
66211
|
}
|
|
66115
|
-
const found = (0,
|
|
66212
|
+
const found = (0, import_code_core5.resolveSourceAlias)(name, workDir, { includeProject: true });
|
|
66116
66213
|
if (found) {
|
|
66117
66214
|
console.error(source_default.red(` \u2717 "${name}" is declared in the ${found.tier} tier, not ${scope}.`));
|
|
66118
66215
|
console.error(source_default.dim(` ${found.file}`));
|
|
@@ -66128,7 +66225,7 @@ function pluginSourceRemoveCommand(name, opts) {
|
|
|
66128
66225
|
|
|
66129
66226
|
// src/index.ts
|
|
66130
66227
|
var program2 = new Command();
|
|
66131
|
-
program2.name("nex").description("Nexrall Code \u2014 AI coding assistant (powered by Nexrall)").version("0.5.
|
|
66228
|
+
program2.name("nex").description("Nexrall Code \u2014 AI coding assistant (powered by Nexrall)").version("0.5.57").enablePositionalOptions();
|
|
66132
66229
|
program2.command("auth").description("Login to your Nexrall account").action(authCommand);
|
|
66133
66230
|
program2.command("logout").description("Log out of your Nexrall account").action(logoutCommand);
|
|
66134
66231
|
program2.command("update").description("Update nex to the latest version").option("-c, --check", "Check for updates without installing").option("-y, --yes", "Skip confirmation prompt").action(async (opts) => {
|
|
@@ -66200,7 +66297,7 @@ program2.command("sessions").description("List or delete saved chat sessions").o
|
|
|
66200
66297
|
console.log();
|
|
66201
66298
|
});
|
|
66202
66299
|
program2.option("-p, --pro", "Use Nexrall Pro (Claude Opus, most capable)").option("-t, --turbo", "Use Nexrall Turbo (Claude Sonnet, fast)").option("-u, --ultra", "Use Ultra (Claude Fable 5, most powerful)").option("-y, --yolo", "Auto-approve all tool calls (no permission prompts)").option("-d, --dir <path>", "Set working directory (default: current directory)").option("-m, --model <name>", "Explicit model: turbo | pro | ultra").option("-r, --resume [id]", "Resume last session, or a specific session id").option("--no-banner", "Skip the ASCII banner (useful in scripts/pipes)").option("--output-format <fmt>", "One-shot output format: text | json | stream-json (implies auto-approve)").argument("[prompt...]", "One-shot prompt \u2014 if omitted, starts interactive mode").action(async (promptParts, options) => {
|
|
66203
|
-
if (!(0,
|
|
66300
|
+
if (!(0, import_code_core6.isAuthenticated)()) {
|
|
66204
66301
|
console.error("Not logged in. Run: nex auth");
|
|
66205
66302
|
process.exit(1);
|
|
66206
66303
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nexrall-code",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.57",
|
|
4
4
|
"description": "Nexrall Code — AI coding assistant for your terminal (headless agent for scripts, CI and automation)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"react": "^19.2.8",
|
|
42
42
|
"readline": "^1.3.0",
|
|
43
43
|
"string-width": "^7.2.0",
|
|
44
|
-
"@nexrall/code-core": "1.4.
|
|
44
|
+
"@nexrall/code-core": "1.4.32"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@aws-sdk/client-s3": "^3.600.0",
|