cascade-ai 0.19.0 → 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 +52 -26
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +52 -26
- package/dist/cli.js.map +1 -1
- package/dist/desktop-core.cjs +52 -26
- package/dist/index.cjs +52 -26
- 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 +52 -26
- package/dist/index.js.map +1 -1
- package/package.json +6 -2
package/dist/desktop-core.cjs
CHANGED
|
@@ -222595,7 +222595,7 @@ Anthropic.Models = Models2;
|
|
|
222595
222595
|
Anthropic.Beta = Beta;
|
|
222596
222596
|
|
|
222597
222597
|
// src/constants.ts
|
|
222598
|
-
var CASCADE_VERSION = "0.
|
|
222598
|
+
var CASCADE_VERSION = "0.20.0";
|
|
222599
222599
|
var CASCADE_CONFIG_DIR = ".cascade";
|
|
222600
222600
|
var CASCADE_MD_FILE = "CASCADE.md";
|
|
222601
222601
|
var CASCADE_IGNORE_FILE = ".cascadeignore";
|
|
@@ -231312,14 +231312,27 @@ var AzureOpenAIProvider = class extends OpenAIProvider {
|
|
|
231312
231312
|
return [fromDeployment ?? this.model];
|
|
231313
231313
|
}
|
|
231314
231314
|
async isAvailable() {
|
|
231315
|
+
const params = {
|
|
231316
|
+
model: this.model.id,
|
|
231317
|
+
messages: [{ role: "user", content: "ping" }],
|
|
231318
|
+
max_tokens: 1
|
|
231319
|
+
};
|
|
231315
231320
|
try {
|
|
231316
|
-
await this.client.chat.completions.create(
|
|
231317
|
-
model: this.model.id,
|
|
231318
|
-
messages: [{ role: "user", content: "ping" }],
|
|
231319
|
-
max_tokens: 1
|
|
231320
|
-
});
|
|
231321
|
+
await this.client.chat.completions.create(params);
|
|
231321
231322
|
return true;
|
|
231322
|
-
} catch {
|
|
231323
|
+
} catch (err) {
|
|
231324
|
+
if (err?.message && String(err.message).includes("max_completion_tokens")) {
|
|
231325
|
+
try {
|
|
231326
|
+
await this.client.chat.completions.create({
|
|
231327
|
+
model: this.model.id,
|
|
231328
|
+
messages: [{ role: "user", content: "ping" }],
|
|
231329
|
+
max_completion_tokens: 1
|
|
231330
|
+
});
|
|
231331
|
+
return true;
|
|
231332
|
+
} catch {
|
|
231333
|
+
return false;
|
|
231334
|
+
}
|
|
231335
|
+
}
|
|
231323
231336
|
return false;
|
|
231324
231337
|
}
|
|
231325
231338
|
}
|
|
@@ -250093,6 +250106,10 @@ var ModelSelector = class {
|
|
|
250093
250106
|
actualId = parts.slice(1).join(":");
|
|
250094
250107
|
}
|
|
250095
250108
|
}
|
|
250109
|
+
const registered = this.availableModels.get(actualId);
|
|
250110
|
+
if (registered && (!providerStr || registered.provider === providerStr)) {
|
|
250111
|
+
return registered;
|
|
250112
|
+
}
|
|
250096
250113
|
if (!providerStr) {
|
|
250097
250114
|
const lower2 = actualId.toLowerCase();
|
|
250098
250115
|
if (lower2.includes("claude")) providerStr = "anthropic";
|
|
@@ -283227,29 +283244,32 @@ var ToolRegistry = class extends EventEmitter__default.default {
|
|
|
283227
283244
|
return tool.execute(input, options);
|
|
283228
283245
|
}
|
|
283229
283246
|
registerDefaults() {
|
|
283230
|
-
const
|
|
283231
|
-
|
|
283232
|
-
|
|
283233
|
-
new
|
|
283234
|
-
new
|
|
283235
|
-
new
|
|
283236
|
-
new
|
|
283237
|
-
new
|
|
283238
|
-
new
|
|
283239
|
-
new
|
|
283240
|
-
new
|
|
283241
|
-
new
|
|
283242
|
-
new
|
|
283243
|
-
new
|
|
283244
|
-
new
|
|
283245
|
-
new
|
|
283246
|
-
new
|
|
283247
|
+
const allowlist = this.config.enabledTools;
|
|
283248
|
+
const enabled = (name) => !allowlist || allowlist.includes(name);
|
|
283249
|
+
const candidates = [
|
|
283250
|
+
enabled("shell") && new ShellTool(this.config.shellAllowlist, this.config.shellBlocklist),
|
|
283251
|
+
enabled("file_read") && new FileReadTool(),
|
|
283252
|
+
enabled("file_write") && new FileWriteTool(),
|
|
283253
|
+
enabled("file_edit") && new FileEditTool(),
|
|
283254
|
+
enabled("file_delete") && new FileDeleteTool(),
|
|
283255
|
+
enabled("file_list") && new FileListTool(),
|
|
283256
|
+
enabled("git") && new GitTool(),
|
|
283257
|
+
enabled("github") && new GitHubTool(),
|
|
283258
|
+
enabled("image_analyze") && new ImageAnalyzeTool(),
|
|
283259
|
+
enabled("pdf_create") && new PDFCreateTool(),
|
|
283260
|
+
enabled("run_code") && new CodeInterpreterTool(),
|
|
283261
|
+
enabled("peer_message") && new PeerCommunicationTool(),
|
|
283262
|
+
enabled("web_search") && new WebSearchTool(this.config.webSearch),
|
|
283263
|
+
enabled("glob") && new GlobTool(),
|
|
283264
|
+
enabled("grep") && new GrepTool(),
|
|
283265
|
+
enabled("web_fetch") && new WebFetchTool()
|
|
283247
283266
|
];
|
|
283267
|
+
const tools = candidates.filter((t4) => t4 !== false);
|
|
283248
283268
|
for (const tool of tools) {
|
|
283249
283269
|
tool.setWorkspaceRoot(this.workspaceRoot);
|
|
283250
283270
|
this.register(tool);
|
|
283251
283271
|
}
|
|
283252
|
-
if (this.config.browserEnabled) {
|
|
283272
|
+
if (this.config.browserEnabled && enabled("browser")) {
|
|
283253
283273
|
const browser = new BrowserTool();
|
|
283254
283274
|
browser.setWorkspaceRoot(this.workspaceRoot);
|
|
283255
283275
|
this.register(browser);
|
|
@@ -294884,7 +294904,13 @@ var ToolsConfigSchema = external_exports.object({
|
|
|
294884
294904
|
* - 'worker': node:worker_threads (resource/kill limits, but not capability-confined).
|
|
294885
294905
|
* - 'auto' (default): use the isolate when `isolated-vm` loads, else fall back to worker.
|
|
294886
294906
|
*/
|
|
294887
|
-
dynamicToolSandbox: external_exports.enum(["isolate", "worker", "auto"]).default("auto")
|
|
294907
|
+
dynamicToolSandbox: external_exports.enum(["isolate", "worker", "auto"]).default("auto"),
|
|
294908
|
+
/**
|
|
294909
|
+
* When set, ONLY these tool names are registered — the sole way to omit a
|
|
294910
|
+
* built-in tool (shell/file/git/…) from existing at all, rather than just
|
|
294911
|
+
* gating it behind approval. Omitted = full default set (unchanged).
|
|
294912
|
+
*/
|
|
294913
|
+
enabledTools: external_exports.array(external_exports.string()).optional()
|
|
294888
294914
|
});
|
|
294889
294915
|
var HookDefinitionSchema = external_exports.object({
|
|
294890
294916
|
name: external_exports.string().optional(),
|
package/dist/index.cjs
CHANGED
|
@@ -236,7 +236,7 @@ var init_audit_logger = __esm({
|
|
|
236
236
|
});
|
|
237
237
|
|
|
238
238
|
// src/constants.ts
|
|
239
|
-
var CASCADE_VERSION = "0.
|
|
239
|
+
var CASCADE_VERSION = "0.20.0";
|
|
240
240
|
var CASCADE_CONFIG_DIR = ".cascade";
|
|
241
241
|
var CASCADE_MD_FILE = "CASCADE.md";
|
|
242
242
|
var CASCADE_IGNORE_FILE = ".cascadeignore";
|
|
@@ -1080,14 +1080,27 @@ var AzureOpenAIProvider = class extends OpenAIProvider {
|
|
|
1080
1080
|
return [fromDeployment ?? this.model];
|
|
1081
1081
|
}
|
|
1082
1082
|
async isAvailable() {
|
|
1083
|
+
const params = {
|
|
1084
|
+
model: this.model.id,
|
|
1085
|
+
messages: [{ role: "user", content: "ping" }],
|
|
1086
|
+
max_tokens: 1
|
|
1087
|
+
};
|
|
1083
1088
|
try {
|
|
1084
|
-
await this.client.chat.completions.create(
|
|
1085
|
-
model: this.model.id,
|
|
1086
|
-
messages: [{ role: "user", content: "ping" }],
|
|
1087
|
-
max_tokens: 1
|
|
1088
|
-
});
|
|
1089
|
+
await this.client.chat.completions.create(params);
|
|
1089
1090
|
return true;
|
|
1090
|
-
} catch {
|
|
1091
|
+
} catch (err) {
|
|
1092
|
+
if (err?.message && String(err.message).includes("max_completion_tokens")) {
|
|
1093
|
+
try {
|
|
1094
|
+
await this.client.chat.completions.create({
|
|
1095
|
+
model: this.model.id,
|
|
1096
|
+
messages: [{ role: "user", content: "ping" }],
|
|
1097
|
+
max_completion_tokens: 1
|
|
1098
|
+
});
|
|
1099
|
+
return true;
|
|
1100
|
+
} catch {
|
|
1101
|
+
return false;
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1091
1104
|
return false;
|
|
1092
1105
|
}
|
|
1093
1106
|
}
|
|
@@ -1829,6 +1842,10 @@ var ModelSelector = class {
|
|
|
1829
1842
|
actualId = parts.slice(1).join(":");
|
|
1830
1843
|
}
|
|
1831
1844
|
}
|
|
1845
|
+
const registered = this.availableModels.get(actualId);
|
|
1846
|
+
if (registered && (!providerStr || registered.provider === providerStr)) {
|
|
1847
|
+
return registered;
|
|
1848
|
+
}
|
|
1832
1849
|
if (!providerStr) {
|
|
1833
1850
|
const lower = actualId.toLowerCase();
|
|
1834
1851
|
if (lower.includes("claude")) providerStr = "anthropic";
|
|
@@ -8074,29 +8091,32 @@ var ToolRegistry = class extends EventEmitter__default.default {
|
|
|
8074
8091
|
return tool.execute(input, options);
|
|
8075
8092
|
}
|
|
8076
8093
|
registerDefaults() {
|
|
8077
|
-
const
|
|
8078
|
-
|
|
8079
|
-
|
|
8080
|
-
new
|
|
8081
|
-
new
|
|
8082
|
-
new
|
|
8083
|
-
new
|
|
8084
|
-
new
|
|
8085
|
-
new
|
|
8086
|
-
new
|
|
8087
|
-
new
|
|
8088
|
-
new
|
|
8089
|
-
new
|
|
8090
|
-
new
|
|
8091
|
-
new
|
|
8092
|
-
new
|
|
8093
|
-
new
|
|
8094
|
+
const allowlist = this.config.enabledTools;
|
|
8095
|
+
const enabled = (name) => !allowlist || allowlist.includes(name);
|
|
8096
|
+
const candidates = [
|
|
8097
|
+
enabled("shell") && new ShellTool(this.config.shellAllowlist, this.config.shellBlocklist),
|
|
8098
|
+
enabled("file_read") && new FileReadTool(),
|
|
8099
|
+
enabled("file_write") && new FileWriteTool(),
|
|
8100
|
+
enabled("file_edit") && new FileEditTool(),
|
|
8101
|
+
enabled("file_delete") && new FileDeleteTool(),
|
|
8102
|
+
enabled("file_list") && new FileListTool(),
|
|
8103
|
+
enabled("git") && new GitTool(),
|
|
8104
|
+
enabled("github") && new GitHubTool(),
|
|
8105
|
+
enabled("image_analyze") && new ImageAnalyzeTool(),
|
|
8106
|
+
enabled("pdf_create") && new PDFCreateTool(),
|
|
8107
|
+
enabled("run_code") && new CodeInterpreterTool(),
|
|
8108
|
+
enabled("peer_message") && new PeerCommunicationTool(),
|
|
8109
|
+
enabled("web_search") && new WebSearchTool(this.config.webSearch),
|
|
8110
|
+
enabled("glob") && new GlobTool(),
|
|
8111
|
+
enabled("grep") && new GrepTool(),
|
|
8112
|
+
enabled("web_fetch") && new WebFetchTool()
|
|
8094
8113
|
];
|
|
8114
|
+
const tools = candidates.filter((t) => t !== false);
|
|
8095
8115
|
for (const tool of tools) {
|
|
8096
8116
|
tool.setWorkspaceRoot(this.workspaceRoot);
|
|
8097
8117
|
this.register(tool);
|
|
8098
8118
|
}
|
|
8099
|
-
if (this.config.browserEnabled) {
|
|
8119
|
+
if (this.config.browserEnabled && enabled("browser")) {
|
|
8100
8120
|
const browser = new BrowserTool();
|
|
8101
8121
|
browser.setWorkspaceRoot(this.workspaceRoot);
|
|
8102
8122
|
this.register(browser);
|
|
@@ -8446,7 +8466,13 @@ var ToolsConfigSchema = zod.z.object({
|
|
|
8446
8466
|
* - 'worker': node:worker_threads (resource/kill limits, but not capability-confined).
|
|
8447
8467
|
* - 'auto' (default): use the isolate when `isolated-vm` loads, else fall back to worker.
|
|
8448
8468
|
*/
|
|
8449
|
-
dynamicToolSandbox: zod.z.enum(["isolate", "worker", "auto"]).default("auto")
|
|
8469
|
+
dynamicToolSandbox: zod.z.enum(["isolate", "worker", "auto"]).default("auto"),
|
|
8470
|
+
/**
|
|
8471
|
+
* When set, ONLY these tool names are registered — the sole way to omit a
|
|
8472
|
+
* built-in tool (shell/file/git/…) from existing at all, rather than just
|
|
8473
|
+
* gating it behind approval. Omitted = full default set (unchanged).
|
|
8474
|
+
*/
|
|
8475
|
+
enabledTools: zod.z.array(zod.z.string()).optional()
|
|
8450
8476
|
});
|
|
8451
8477
|
var HookDefinitionSchema = zod.z.object({
|
|
8452
8478
|
name: zod.z.string().optional(),
|