@nexrall/code-core 1.4.35 → 1.4.37
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/agent/loop.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loop.d.ts","sourceRoot":"","sources":["../../src/agent/loop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAKP,UAAU,EACV,gBAAgB,EAChB,UAAU,EACX,MAAM,UAAU,CAAC;AAIlB,OAAO,EAAkE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAMrH,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAkK7B;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,GAC9C,MAAM,CAKR;AAED,+CAA+C;AAC/C,eAAO,MAAM,YAAY;;;CAAsC,CAAC;AAEhE;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,uBAAuB,CAAC;AAEtD;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;CAgB3B,CAAC;AAEX,mEAAmE;AACnE,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,gBAAgB,CAAC;CACzB;AAED;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,OAAO,EAAE,kBAAkB,GAAG,SAAS,EACvC,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,UAAU,CAAC,CA8BrB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAClB,OAAO,GACP,SAAS,GACT,oBAAoB,GACpB,gBAAg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1593
|
'gpt-4o-mini': 128000,
|
|
1594
|
+
// DeepSeek, by real model id (documented — see backend/services/providers/
|
|
1595
|
+
// modelRegistry.js's own TODO(unverified-by-400): DeepSeek accepts an
|
|
1596
|
+
// oversized max_completion_tokens without rejecting it, so there was no 400
|
|
1597
|
+
// to measure the ceiling from the way the OpenAI rows above were).
|
|
1598
|
+
'deepseek-v4-pro': 1048576,
|
|
1599
|
+
'deepseek-v4-flash': 1048576,
|
|
1600
|
+
// Qwen (DashScope), by real model id (documented max input, same caveat).
|
|
1601
|
+
'qwen3.7-max': 991800,
|
|
1594
1602
|
};
|
|
1595
1603
|
/**
|
|
1596
1604
|
* Context window (tokens) for a model alias or real model id.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modePolicy.d.ts","sourceRoot":"","sources":["../../src/permissions/modePolicy.ts"],"names":[],"mappings":"AAsBA,yDAAyD;AACzD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAE9D,kDAAkD;AAClD,MAAM,MAAM,cAAc,GACtB,OAAO,GACP,KAAK,GACL,MAAM,GACN,SAAS,CAAC;AAEd,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,IAAI,EAAE,cAAc,CAAC;IACrB,oFAAoF;IACpF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,2EAA2E;IAC3E,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,aAU1B,CAAC;AAEH,0CAA0C;AAC1C,eAAO,MAAM,gBAAgB,aAE3B,CAAC;AAEH,oEAAoE;AACpE,eAAO,MAAM,iBAAiB,aAE5B,CAAC;AAEH,sCAAsC;AACtC,eAAO,MAAM,UAAU,aAAsD,CAAC;AAE9E;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,WAAW,GAAG,cAAc,
|
|
1
|
+
{"version":3,"file":"modePolicy.d.ts","sourceRoot":"","sources":["../../src/permissions/modePolicy.ts"],"names":[],"mappings":"AAsBA,yDAAyD;AACzD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAE9D,kDAAkD;AAClD,MAAM,MAAM,cAAc,GACtB,OAAO,GACP,KAAK,GACL,MAAM,GACN,SAAS,CAAC;AAEd,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,IAAI,EAAE,cAAc,CAAC;IACrB,oFAAoF;IACpF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,2EAA2E;IAC3E,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,aAU1B,CAAC;AAEH,0CAA0C;AAC1C,eAAO,MAAM,gBAAgB,aAE3B,CAAC;AAEH,oEAAoE;AACpE,eAAO,MAAM,iBAAiB,aAE5B,CAAC;AAEH,sCAAsC;AACtC,eAAO,MAAM,UAAU,aAAsD,CAAC;AAE9E;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,WAAW,GAAG,cAAc,CAwDvD;AAED,4DAA4D;AAC5D,wBAAgB,YAAY,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAOzD;AAED,gFAAgF;AAChF,wBAAgB,SAAS,CAAC,GAAG,EAAE,OAAO,GAAG,cAAc,CAGtD"}
|
|
@@ -78,34 +78,39 @@ function decide(req) {
|
|
|
78
78
|
// plan", and a prompt would let one distracted keypress break it.
|
|
79
79
|
if (mode === 'plan')
|
|
80
80
|
return 'deny';
|
|
81
|
-
// 4. Explicit blanket approval (--yolo / bypassPermissions)
|
|
82
|
-
//
|
|
83
|
-
|
|
81
|
+
// 4. Explicit blanket approval (--yolo / bypassPermissions), OR `auto` mode itself.
|
|
82
|
+
//
|
|
83
|
+
// `auto` used to only pre-authorise the two tool families it happened to name
|
|
84
|
+
// explicitly (file writes, bash) and fall through to "ask" for everything else —
|
|
85
|
+
// `task` (sub-agent dispatch), `generate_image`, `stock_photo`, `create_directory`,
|
|
86
|
+
// `move_file`, `copy_file`, and every MCP/plugin tool. That made "auto" a lie for
|
|
87
|
+
// any session that used sub-agents or MCP tools: the mode picker said "Nexrall
|
|
88
|
+
// chooses the best mode for each task" / "edits and runs commands", but the model
|
|
89
|
+
// still stopped and asked for a permission bubble on the very first `task` or MCP
|
|
90
|
+
// call. A mode named `auto` must mean the agent runs tools on its own — the same
|
|
91
|
+
// guarantee `bypass` already gives. Destructive commands and plan mode are checked
|
|
92
|
+
// ABOVE this line and are UNAFFECTED: `auto` still cannot silently drop a database
|
|
93
|
+
// or force-push, and cannot escape plan mode's read-only lock.
|
|
94
|
+
if (req.bypass || mode === 'auto')
|
|
84
95
|
return 'allow';
|
|
85
|
-
// 5. Mode policy for the mutating tools that remain
|
|
96
|
+
// 5. Mode policy for the mutating tools that remain (ask / edit only — auto already
|
|
97
|
+
// returned above).
|
|
86
98
|
if (exports.FILE_WRITE_TOOLS.has(tool) || exports.FILE_MUTATE_TOOLS.has(tool)) {
|
|
87
|
-
// `edit`
|
|
88
|
-
// reason to leave `ask`.
|
|
99
|
+
// `edit` pre-authorises ordinary file edits — that is the whole reason to leave `ask`.
|
|
89
100
|
return mode === 'ask' ? 'ask' : 'allow';
|
|
90
101
|
}
|
|
91
102
|
if (exports.BASH_TOOLS.has(tool)) {
|
|
92
|
-
//
|
|
93
|
-
// `cargo build`. `auto` runs these, which is the behaviour its own prompt block
|
|
94
|
-
// already advertises. `edit` still asks, matching Claude Code's acceptEdits —
|
|
103
|
+
// `edit` still asks before a shell command, matching Claude Code's acceptEdits —
|
|
95
104
|
// "file changes flow, anything with side effects beyond the working directory
|
|
96
105
|
// still prompts" — because shell commands reach the network, global caches and
|
|
97
106
|
// other checkouts, not just this repo.
|
|
98
|
-
return
|
|
107
|
+
return 'ask';
|
|
99
108
|
}
|
|
100
|
-
// 6. Anything unrecognised — a newly added tool, an MCP tool, a plugin tool — asks
|
|
101
|
-
//
|
|
102
|
-
//
|
|
103
|
-
//
|
|
104
|
-
//
|
|
105
|
-
// is third-party code whose blast radius this policy cannot see, so `auto` meaning
|
|
106
|
-
// "run anything, including things I've never heard of" would make the mode
|
|
107
|
-
// unauditable. Same principle as forcing an unparseable agent definition to
|
|
108
|
-
// read-only: the less we know, the less it gets.
|
|
109
|
+
// 6. Anything unrecognised — a newly added tool, an MCP tool, a plugin tool — asks in
|
|
110
|
+
// `ask` and `edit` mode. `auto` already returned 'allow' above (step 4): a mode
|
|
111
|
+
// whose entire point is "the agent runs tools on its own" cannot then carve out an
|
|
112
|
+
// exception for exactly the tools it wasn't told about, or every third-party/MCP
|
|
113
|
+
// tool call would silently degrade `auto` back into `ask`.
|
|
109
114
|
return 'ask';
|
|
110
115
|
}
|
|
111
116
|
/** Human-readable one-liner for the footer / status bar. */
|
|
@@ -114,7 +119,7 @@ function describeMode(mode) {
|
|
|
114
119
|
case 'plan': return 'plan — read-only, produces a plan for approval';
|
|
115
120
|
case 'ask': return 'ask — approves reads; asks before edits and commands';
|
|
116
121
|
case 'edit': return 'edit — edits files freely; asks before shell commands';
|
|
117
|
-
case 'auto': return 'auto —
|
|
122
|
+
case 'auto': return 'auto — runs every tool on its own; still confirms irreversible actions';
|
|
118
123
|
}
|
|
119
124
|
}
|
|
120
125
|
/** Normalise arbitrary input to a known mode, defaulting to the safe middle. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../src/tools/executor.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAyB,KAAK,aAAa,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../src/tools/executor.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAyB,KAAK,aAAa,EAAE,MAAM,WAAW,CAAC;AA0wEtE,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,WAAW,CAAC,EAAE;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,EAClC,OAAO,CAAC,EAAE,aAAa,EACvB,OAAO,CAAC,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,MAAM,EACnB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GACjC,OAAO,CAAC,UAAU,CAAC,CAoBrB"}
|
package/dist/tools/executor.js
CHANGED
|
@@ -1582,6 +1582,41 @@ function isValidDottedQuad(host) {
|
|
|
1582
1582
|
return false;
|
|
1583
1583
|
return m.slice(1).every((o) => Number(o) <= 255);
|
|
1584
1584
|
}
|
|
1585
|
+
/**
|
|
1586
|
+
* Opt-in hostname blocklist for `fetch_url`, separate from the (always-on)
|
|
1587
|
+
* SSRF guard above. SSRF blocks *private/internal* addresses; this blocks
|
|
1588
|
+
* specific *public* hosts the invoker never wants this run to reach at all.
|
|
1589
|
+
*
|
|
1590
|
+
* Built for running benchmarks like SWE-bench, whose own submission rules
|
|
1591
|
+
* require: "has taken steps to prevent lookup of SWE-bench solutions via
|
|
1592
|
+
* web-browsing" — i.e. the agent must not be able to `fetch_url` the actual
|
|
1593
|
+
* GitHub PR/issue/commit that already fixed the task it's being scored on.
|
|
1594
|
+
* `problem_statement` never contains that URL, but nothing stopped the agent
|
|
1595
|
+
* from guessing one (e.g. issue number → `.../pull/<n>`) or following a link
|
|
1596
|
+
* surfaced by `grep`/`git log` output in the repo it's working in.
|
|
1597
|
+
*
|
|
1598
|
+
* Deliberately an env var, not a code default: the guard has to be OFF for
|
|
1599
|
+
* normal interactive use (agents fetch GitHub constantly — release notes,
|
|
1600
|
+
* docs, issues the USER is actually asking about), and ON only for the
|
|
1601
|
+
* specific run that needs it, exactly like NEXRALL_TRUST_WORKSPACE /
|
|
1602
|
+
* NEXRALL_ALLOW_DESTRUCTIVE follow the same "invoker opts in" shape.
|
|
1603
|
+
*
|
|
1604
|
+
* NEXRALL_FETCH_BLOCKLIST is a comma-separated list of hostnames; a request
|
|
1605
|
+
* is blocked if its host equals or is a subdomain of any entry.
|
|
1606
|
+
*/
|
|
1607
|
+
function fetchBlocklistCheck(parsedUrl) {
|
|
1608
|
+
const raw = process.env.NEXRALL_FETCH_BLOCKLIST;
|
|
1609
|
+
if (!raw)
|
|
1610
|
+
return null;
|
|
1611
|
+
const host = parsedUrl.hostname.toLowerCase().replace(/^\[|\]$/g, '');
|
|
1612
|
+
const entries = raw.split(',').map((s) => s.trim().toLowerCase()).filter(Boolean);
|
|
1613
|
+
for (const entry of entries) {
|
|
1614
|
+
if (host === entry || host.endsWith(`.${entry}`)) {
|
|
1615
|
+
return `Refusing to fetch "${host}" — blocked by NEXRALL_FETCH_BLOCKLIST (matched "${entry}").`;
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
return null;
|
|
1619
|
+
}
|
|
1585
1620
|
async function fetchUrl(input, _workDir, _redirectCount = 0) {
|
|
1586
1621
|
const url = typeof input.url === 'string' ? input.url : '';
|
|
1587
1622
|
if (!url)
|
|
@@ -1599,6 +1634,11 @@ async function fetchUrl(input, _workDir, _redirectCount = 0) {
|
|
|
1599
1634
|
if (parsedUrl.protocol !== 'http:' && parsedUrl.protocol !== 'https:') {
|
|
1600
1635
|
return { error: `Unsupported protocol: ${parsedUrl.protocol}. Only http and https are supported.` };
|
|
1601
1636
|
}
|
|
1637
|
+
// Opt-in hostname blocklist — checked before the SSRF guard so it also
|
|
1638
|
+
// catches every redirect hop (this function recurses through itself).
|
|
1639
|
+
const blocklistError = fetchBlocklistCheck(parsedUrl);
|
|
1640
|
+
if (blocklistError)
|
|
1641
|
+
return { error: blocklistError };
|
|
1602
1642
|
// SSRF guard — runs on every hop (redirects recurse through fetchUrl), so a
|
|
1603
1643
|
// public URL that 302-redirects to 169.254.169.254 is still blocked.
|
|
1604
1644
|
const ssrfError = await ssrfCheck(parsedUrl);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexrall/code-core",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.37",
|
|
4
4
|
"description": "Core agent loop, tools, and extension primitives for Nexrall Code — embed an AI coding agent in any Node.js application.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Nexrall <support@nexrall.com> (https://nexrall.com)",
|