@trops/dash-core 0.1.549 → 0.1.550
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/electron/index.js +81 -0
- package/dist/electron/index.js.map +1 -1
- package/package.json +1 -1
package/dist/electron/index.js
CHANGED
|
@@ -50404,6 +50404,62 @@ function resolveLockdownCwd({ cwd, disableTools = false } = {}) {
|
|
|
50404
50404
|
return null;
|
|
50405
50405
|
}
|
|
50406
50406
|
|
|
50407
|
+
/**
|
|
50408
|
+
* Resolve the plugin directory the spawned CLI should look in.
|
|
50409
|
+
*
|
|
50410
|
+
* Same shape as resolveLockdownCwd. When in lockdown, point Claude
|
|
50411
|
+
* Code at an empty scratch directory so plugin auto-discovery finds
|
|
50412
|
+
* nothing — sealing the gap left by `--bare` (which strips CLAUDE.md
|
|
50413
|
+
* and auto-memory but NOT user plugins under ~/.claude/plugins/).
|
|
50414
|
+
* The Skill tool gets loaded from those plugins, which is how it
|
|
50415
|
+
* survived the slice 17f flag set.
|
|
50416
|
+
*
|
|
50417
|
+
* Sibling of the scratch cwd dir — DIFFERENT name so plugin discovery
|
|
50418
|
+
* doesn't pick up the cwd itself.
|
|
50419
|
+
*
|
|
50420
|
+
* @param {object} opts
|
|
50421
|
+
* @param {string=} opts.pluginDir
|
|
50422
|
+
* @param {boolean=} opts.disableTools
|
|
50423
|
+
* @returns {string|null}
|
|
50424
|
+
*/
|
|
50425
|
+
function resolveLockdownPluginDir({ pluginDir, disableTools = false } = {}) {
|
|
50426
|
+
if (pluginDir) return pluginDir;
|
|
50427
|
+
if (disableTools) {
|
|
50428
|
+
const os = require$$2$1;
|
|
50429
|
+
const path = require$$1$1;
|
|
50430
|
+
return path.join(os.tmpdir(), "dash-widget-builder-cli-plugins");
|
|
50431
|
+
}
|
|
50432
|
+
return null;
|
|
50433
|
+
}
|
|
50434
|
+
|
|
50435
|
+
/**
|
|
50436
|
+
* Canonical denylist for the lockdown — every built-in tool name we
|
|
50437
|
+
* know about, comma-separated (no whitespace) so the single arg is
|
|
50438
|
+
* Windows-shell-safe. Adding a new built-in upstream means appending
|
|
50439
|
+
* its name here; the flag is belt-and-suspenders alongside `--tools ""`,
|
|
50440
|
+
* but it's the only layer that actually keeps the Skill tool from
|
|
50441
|
+
* being callable when a user has plugins installed in
|
|
50442
|
+
* ~/.claude/plugins/.
|
|
50443
|
+
*/
|
|
50444
|
+
const LOCKDOWN_DISALLOWED_TOOLS = [
|
|
50445
|
+
"Skill",
|
|
50446
|
+
"Bash",
|
|
50447
|
+
"BashOutput",
|
|
50448
|
+
"Read",
|
|
50449
|
+
"Edit",
|
|
50450
|
+
"Write",
|
|
50451
|
+
"Glob",
|
|
50452
|
+
"Grep",
|
|
50453
|
+
"WebFetch",
|
|
50454
|
+
"WebSearch",
|
|
50455
|
+
"NotebookRead",
|
|
50456
|
+
"NotebookEdit",
|
|
50457
|
+
"Task",
|
|
50458
|
+
"TodoWrite",
|
|
50459
|
+
"KillBash",
|
|
50460
|
+
"SlashCommand",
|
|
50461
|
+
].join(",");
|
|
50462
|
+
|
|
50407
50463
|
/**
|
|
50408
50464
|
* Build the argv array for spawning the Claude Code CLI.
|
|
50409
50465
|
*
|
|
@@ -50464,6 +50520,17 @@ function buildClaudeCliArgs({
|
|
|
50464
50520
|
// exactly our --system-prompt and nothing else.
|
|
50465
50521
|
args.push("--bare");
|
|
50466
50522
|
args.push("--strict-mcp-config");
|
|
50523
|
+
|
|
50524
|
+
// `--bare` strips CLAUDE.md and auto-memory but NOT user plugins
|
|
50525
|
+
// (under ~/.claude/plugins/). The Skill TOOL gets loaded from
|
|
50526
|
+
// those plugins, which is why it kept firing despite slices 17e
|
|
50527
|
+
// and 17f. Two layers seal it:
|
|
50528
|
+
// 1. --disallowed-tools denies every known built-in by name
|
|
50529
|
+
// (comma-separated, no whitespace, Windows-shell-safe).
|
|
50530
|
+
// 2. --plugin-dir points at an empty scratch dir under
|
|
50531
|
+
// os.tmpdir() so plugin auto-discovery finds nothing.
|
|
50532
|
+
args.push("--disallowed-tools", LOCKDOWN_DISALLOWED_TOOLS);
|
|
50533
|
+
args.push("--plugin-dir", resolveLockdownPluginDir({ disableTools: true }));
|
|
50467
50534
|
}
|
|
50468
50535
|
|
|
50469
50536
|
if (model) {
|
|
@@ -50677,6 +50744,18 @@ const cliController$2 = {
|
|
|
50677
50744
|
}
|
|
50678
50745
|
spawnOpts.cwd = resolvedCwd;
|
|
50679
50746
|
}
|
|
50747
|
+
// The --plugin-dir argv we built above points at a scratch
|
|
50748
|
+
// directory; create it on first run so the CLI doesn't error
|
|
50749
|
+
// out trying to read a missing path.
|
|
50750
|
+
if (disableTools) {
|
|
50751
|
+
const fs = require("fs");
|
|
50752
|
+
const lockdownPluginDir = resolveLockdownPluginDir({
|
|
50753
|
+
disableTools: true,
|
|
50754
|
+
});
|
|
50755
|
+
if (lockdownPluginDir && !fs.existsSync(lockdownPluginDir)) {
|
|
50756
|
+
fs.mkdirSync(lockdownPluginDir, { recursive: true });
|
|
50757
|
+
}
|
|
50758
|
+
}
|
|
50680
50759
|
const spawnCmd = IS_WINDOWS ? windowsQuote(binaryPath) : binaryPath;
|
|
50681
50760
|
const spawnArgs = IS_WINDOWS ? args.map(windowsQuote) : args;
|
|
50682
50761
|
const child = spawn(spawnCmd, spawnArgs, spawnOpts);
|
|
@@ -50998,6 +51077,8 @@ const cliController$2 = {
|
|
|
50998
51077
|
cliController$3.exports = cliController$2;
|
|
50999
51078
|
cliController$3.exports.buildClaudeCliArgs = buildClaudeCliArgs;
|
|
51000
51079
|
cliController$3.exports.resolveLockdownCwd = resolveLockdownCwd;
|
|
51080
|
+
cliController$3.exports.resolveLockdownPluginDir = resolveLockdownPluginDir;
|
|
51081
|
+
cliController$3.exports.LOCKDOWN_DISALLOWED_TOOLS = LOCKDOWN_DISALLOWED_TOOLS;
|
|
51001
51082
|
|
|
51002
51083
|
var cliControllerExports = cliController$3.exports;
|
|
51003
51084
|
|