cascade-ai 0.19.1 → 0.20.0
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/README.md +2 -1
- package/bin/cascade.js +0 -0
- package/dist/cli.cjs +29 -20
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +29 -20
- package/dist/cli.js.map +1 -1
- package/dist/desktop-core.cjs +29 -20
- package/dist/index.cjs +29 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +29 -20
- package/dist/index.js.map +1 -1
- package/package.json +6 -2
package/dist/index.d.cts
CHANGED
|
@@ -499,6 +499,16 @@ interface ToolsConfig {
|
|
|
499
499
|
* 'auto' (default) = isolate when available else worker.
|
|
500
500
|
*/
|
|
501
501
|
dynamicToolSandbox?: 'isolate' | 'worker' | 'auto';
|
|
502
|
+
/**
|
|
503
|
+
* When set, ONLY these tool names are registered — every other built-in tool
|
|
504
|
+
* (including shell/file/git, which have no other off-switch) is omitted
|
|
505
|
+
* entirely rather than merely approval-gated. Built for embedding Cascade in
|
|
506
|
+
* an untrusted/multi-tenant context (e.g. a hosted chat server) where the
|
|
507
|
+
* full tool surface must never exist for a run, not just require a click to
|
|
508
|
+
* use. `undefined`/omitted registers the full default set (unchanged
|
|
509
|
+
* behavior). An empty array registers no tools at all.
|
|
510
|
+
*/
|
|
511
|
+
enabledTools?: string[];
|
|
502
512
|
}
|
|
503
513
|
interface HooksConfig {
|
|
504
514
|
preToolUse?: HookDefinition[];
|
package/dist/index.d.ts
CHANGED
|
@@ -499,6 +499,16 @@ interface ToolsConfig {
|
|
|
499
499
|
* 'auto' (default) = isolate when available else worker.
|
|
500
500
|
*/
|
|
501
501
|
dynamicToolSandbox?: 'isolate' | 'worker' | 'auto';
|
|
502
|
+
/**
|
|
503
|
+
* When set, ONLY these tool names are registered — every other built-in tool
|
|
504
|
+
* (including shell/file/git, which have no other off-switch) is omitted
|
|
505
|
+
* entirely rather than merely approval-gated. Built for embedding Cascade in
|
|
506
|
+
* an untrusted/multi-tenant context (e.g. a hosted chat server) where the
|
|
507
|
+
* full tool surface must never exist for a run, not just require a click to
|
|
508
|
+
* use. `undefined`/omitted registers the full default set (unchanged
|
|
509
|
+
* behavior). An empty array registers no tools at all.
|
|
510
|
+
*/
|
|
511
|
+
enabledTools?: string[];
|
|
502
512
|
}
|
|
503
513
|
interface HooksConfig {
|
|
504
514
|
preToolUse?: HookDefinition[];
|
package/dist/index.js
CHANGED
|
@@ -190,7 +190,7 @@ var init_audit_logger = __esm({
|
|
|
190
190
|
});
|
|
191
191
|
|
|
192
192
|
// src/constants.ts
|
|
193
|
-
var CASCADE_VERSION = "0.
|
|
193
|
+
var CASCADE_VERSION = "0.20.0";
|
|
194
194
|
var CASCADE_CONFIG_DIR = ".cascade";
|
|
195
195
|
var CASCADE_MD_FILE = "CASCADE.md";
|
|
196
196
|
var CASCADE_IGNORE_FILE = ".cascadeignore";
|
|
@@ -8045,29 +8045,32 @@ var ToolRegistry = class extends EventEmitter {
|
|
|
8045
8045
|
return tool.execute(input, options);
|
|
8046
8046
|
}
|
|
8047
8047
|
registerDefaults() {
|
|
8048
|
-
const
|
|
8049
|
-
|
|
8050
|
-
|
|
8051
|
-
new
|
|
8052
|
-
new
|
|
8053
|
-
new
|
|
8054
|
-
new
|
|
8055
|
-
new
|
|
8056
|
-
new
|
|
8057
|
-
new
|
|
8058
|
-
new
|
|
8059
|
-
new
|
|
8060
|
-
new
|
|
8061
|
-
new
|
|
8062
|
-
new
|
|
8063
|
-
new
|
|
8064
|
-
new
|
|
8048
|
+
const allowlist = this.config.enabledTools;
|
|
8049
|
+
const enabled = (name) => !allowlist || allowlist.includes(name);
|
|
8050
|
+
const candidates = [
|
|
8051
|
+
enabled("shell") && new ShellTool(this.config.shellAllowlist, this.config.shellBlocklist),
|
|
8052
|
+
enabled("file_read") && new FileReadTool(),
|
|
8053
|
+
enabled("file_write") && new FileWriteTool(),
|
|
8054
|
+
enabled("file_edit") && new FileEditTool(),
|
|
8055
|
+
enabled("file_delete") && new FileDeleteTool(),
|
|
8056
|
+
enabled("file_list") && new FileListTool(),
|
|
8057
|
+
enabled("git") && new GitTool(),
|
|
8058
|
+
enabled("github") && new GitHubTool(),
|
|
8059
|
+
enabled("image_analyze") && new ImageAnalyzeTool(),
|
|
8060
|
+
enabled("pdf_create") && new PDFCreateTool(),
|
|
8061
|
+
enabled("run_code") && new CodeInterpreterTool(),
|
|
8062
|
+
enabled("peer_message") && new PeerCommunicationTool(),
|
|
8063
|
+
enabled("web_search") && new WebSearchTool(this.config.webSearch),
|
|
8064
|
+
enabled("glob") && new GlobTool(),
|
|
8065
|
+
enabled("grep") && new GrepTool(),
|
|
8066
|
+
enabled("web_fetch") && new WebFetchTool()
|
|
8065
8067
|
];
|
|
8068
|
+
const tools = candidates.filter((t) => t !== false);
|
|
8066
8069
|
for (const tool of tools) {
|
|
8067
8070
|
tool.setWorkspaceRoot(this.workspaceRoot);
|
|
8068
8071
|
this.register(tool);
|
|
8069
8072
|
}
|
|
8070
|
-
if (this.config.browserEnabled) {
|
|
8073
|
+
if (this.config.browserEnabled && enabled("browser")) {
|
|
8071
8074
|
const browser = new BrowserTool();
|
|
8072
8075
|
browser.setWorkspaceRoot(this.workspaceRoot);
|
|
8073
8076
|
this.register(browser);
|
|
@@ -8417,7 +8420,13 @@ var ToolsConfigSchema = z.object({
|
|
|
8417
8420
|
* - 'worker': node:worker_threads (resource/kill limits, but not capability-confined).
|
|
8418
8421
|
* - 'auto' (default): use the isolate when `isolated-vm` loads, else fall back to worker.
|
|
8419
8422
|
*/
|
|
8420
|
-
dynamicToolSandbox: z.enum(["isolate", "worker", "auto"]).default("auto")
|
|
8423
|
+
dynamicToolSandbox: z.enum(["isolate", "worker", "auto"]).default("auto"),
|
|
8424
|
+
/**
|
|
8425
|
+
* When set, ONLY these tool names are registered — the sole way to omit a
|
|
8426
|
+
* built-in tool (shell/file/git/…) from existing at all, rather than just
|
|
8427
|
+
* gating it behind approval. Omitted = full default set (unchanged).
|
|
8428
|
+
*/
|
|
8429
|
+
enabledTools: z.array(z.string()).optional()
|
|
8421
8430
|
});
|
|
8422
8431
|
var HookDefinitionSchema = z.object({
|
|
8423
8432
|
name: z.string().optional(),
|