cascade-ai 0.12.19 → 0.12.21
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/cli.cjs +222 -142
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +222 -142
- package/dist/cli.js.map +1 -1
- package/dist/desktop-core.cjs +10 -8
- package/dist/index.cjs +10 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -3
- package/dist/index.d.ts +9 -3
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -497,7 +497,9 @@ interface WorkspaceConfig {
|
|
|
497
497
|
keystorePath: string;
|
|
498
498
|
auditLogPath: string;
|
|
499
499
|
}
|
|
500
|
-
type
|
|
500
|
+
type CascadeThemeName = 'midnight' | 'aurora' | 'ember' | 'tide' | 'bloom' | 'daybreak';
|
|
501
|
+
type LegacyThemeName = 'cascade' | 'dark' | 'light' | 'dracula' | 'nord' | 'solarized';
|
|
502
|
+
type ThemeName = CascadeThemeName | LegacyThemeName;
|
|
501
503
|
interface Theme {
|
|
502
504
|
name: ThemeName;
|
|
503
505
|
colors: ThemeColors;
|
|
@@ -1092,6 +1094,7 @@ declare class CascadeRouter extends EventEmitter {
|
|
|
1092
1094
|
getAvailableModels(): ModelInfo[];
|
|
1093
1095
|
private detectAvailableProviders;
|
|
1094
1096
|
private discoverOllamaModels;
|
|
1097
|
+
/** Returns true when at least one real model was discovered from the endpoint. */
|
|
1095
1098
|
private discoverOpenAICompatibleModels;
|
|
1096
1099
|
private ensureProvider;
|
|
1097
1100
|
private getProvider;
|
|
@@ -2301,8 +2304,11 @@ declare class CascadeToolError extends Error {
|
|
|
2301
2304
|
constructor(userMessage: string, cause?: unknown, retryable?: boolean);
|
|
2302
2305
|
}
|
|
2303
2306
|
|
|
2304
|
-
/**
|
|
2307
|
+
/**
|
|
2308
|
+
* Keep localhost intact. Node's `dns.setDefaultResultOrder('ipv4first')` handles IPv4 priority process-wide.
|
|
2309
|
+
* We no longer forcefully rewrite `localhost` to `127.0.0.1` as it breaks IPv6-only environments (e.g. ::1).
|
|
2310
|
+
*/
|
|
2305
2311
|
declare function preferIpv4Host(url: string | undefined): string | undefined;
|
|
2306
2312
|
declare function nodeHttpFetch(input: string | URL | Request, init?: RequestInit, redirectCount?: number): Promise<Response>;
|
|
2307
2313
|
|
|
2308
|
-
export { AZURE_BASE_URL_TEMPLATE, type ApprovalRequest, type ApprovalResponse, type AuditEntry, AuditLogger, type BenchmarksConfig, type BudgetConfig, CASCADE_AUDIT_FILE, CASCADE_CONFIG_DIR, CASCADE_CONFIG_FILE, CASCADE_DASHBOARD_SECRET_FILE, CASCADE_DB_FILE, CASCADE_IGNORE_FILE, CASCADE_KEYSTORE_FILE, CASCADE_MD_FILE, CASCADE_VERSION, COMPLEXITY_T2_COUNT, Cascade, CascadeCancelledError, type CascadeConfig, type CascadeEvent, type CascadeEventType, CascadeIgnore, type CascadeMessage, CascadeRouter, type CascadeRunOptions, type CascadeRunResult, CascadeToolError, ConfigManager, type ConversationMessage, DEFAULT_API_PORT, DEFAULT_APPROVAL_REQUIRED, DEFAULT_AUTO_SUMMARIZE_AT, DEFAULT_CONTEXT_LIMIT, DEFAULT_DASHBOARD_PORT, DEFAULT_MAX_SESSION_MESSAGES, DEFAULT_RETENTION_DAYS, DEFAULT_THEME, type DashboardConfig, DashboardServer, type EscalationPayload, GLOBAL_CONFIG_DIR, GLOBAL_DB_FILE, GLOBAL_KEYSTORE_FILE, GLOBAL_RUNTIME_DB_FILE, type GenerateOptions, type GenerateResult, type HookDefinition, type HooksConfig, HooksRunner, type Identity, type ImageAttachment, Keystore, LM_STUDIO_BASE_URL, MODELS, McpClient, type McpServerConfig$1 as McpServerConfig, type MemoryConfig, MemoryStore, type Message, type MessageContent, type MessagePayload, type MessageStatus, type MessageType, type ModelInfo, type ModelOverrides, OLLAMA_BASE_URL, PROVIDER_DISPLAY_NAMES, type PeerMessage, type PeerMessageEvent, type PeerSyncPayload, type PeerSyncType, type PermissionDecision, type PermissionDecisionPayload, type PermissionRequest, type PlanReviewConfig, type ProviderConfig, type ProviderType, type RuntimeNode, type RuntimeNodeLog, type RuntimeRefreshPayload, type RuntimeScope, type RuntimeSession, type RuntimeSnapshotPayload, type ScheduledTask, type Session, type SessionCheckpoint, type SessionMetadata, type SessionSubscriptionPayload, type StatusUpdate, type StoredMessage, type StreamChunk, T1Administrator, type T1ToT2Assignment, T1_MODEL_PRIORITY, T2Manager, type T2Result, type T2ToT3Assignment, T2_MODEL_PRIORITY, type T3Result, type T3ResultPayload, type T3SubtaskSpec, T3Worker, T3_MODEL_PRIORITY, THEME_NAMES, TOOL_NAMES, type TaskComplexity, TaskScheduler, Telemetry, type TelemetryConfig, type Theme, type ThemeColors, type ThemeName, type TierConfig, type TierLimits, type TierRole, type TierStatus, type TokenUsage, type ToolCall, type ToolDefinition, type ToolExecuteOptions, ToolRegistry, type ToolResult, type ToolsConfig, VISION_MODEL_PRIORITY, type WebSearchConfig, type WebhookConfig, type WorkspaceConfig, createCascade, nodeHttpFetch, preferIpv4Host, runCascade, streamCascade };
|
|
2314
|
+
export { AZURE_BASE_URL_TEMPLATE, type ApprovalRequest, type ApprovalResponse, type AuditEntry, AuditLogger, type BenchmarksConfig, type BudgetConfig, CASCADE_AUDIT_FILE, CASCADE_CONFIG_DIR, CASCADE_CONFIG_FILE, CASCADE_DASHBOARD_SECRET_FILE, CASCADE_DB_FILE, CASCADE_IGNORE_FILE, CASCADE_KEYSTORE_FILE, CASCADE_MD_FILE, CASCADE_VERSION, COMPLEXITY_T2_COUNT, Cascade, CascadeCancelledError, type CascadeConfig, type CascadeEvent, type CascadeEventType, CascadeIgnore, type CascadeMessage, CascadeRouter, type CascadeRunOptions, type CascadeRunResult, type CascadeThemeName, CascadeToolError, ConfigManager, type ConversationMessage, DEFAULT_API_PORT, DEFAULT_APPROVAL_REQUIRED, DEFAULT_AUTO_SUMMARIZE_AT, DEFAULT_CONTEXT_LIMIT, DEFAULT_DASHBOARD_PORT, DEFAULT_MAX_SESSION_MESSAGES, DEFAULT_RETENTION_DAYS, DEFAULT_THEME, type DashboardConfig, DashboardServer, type EscalationPayload, GLOBAL_CONFIG_DIR, GLOBAL_DB_FILE, GLOBAL_KEYSTORE_FILE, GLOBAL_RUNTIME_DB_FILE, type GenerateOptions, type GenerateResult, type HookDefinition, type HooksConfig, HooksRunner, type Identity, type ImageAttachment, Keystore, LM_STUDIO_BASE_URL, type LegacyThemeName, MODELS, McpClient, type McpServerConfig$1 as McpServerConfig, type MemoryConfig, MemoryStore, type Message, type MessageContent, type MessagePayload, type MessageStatus, type MessageType, type ModelInfo, type ModelOverrides, OLLAMA_BASE_URL, PROVIDER_DISPLAY_NAMES, type PeerMessage, type PeerMessageEvent, type PeerSyncPayload, type PeerSyncType, type PermissionDecision, type PermissionDecisionPayload, type PermissionRequest, type PlanReviewConfig, type ProviderConfig, type ProviderType, type RuntimeNode, type RuntimeNodeLog, type RuntimeRefreshPayload, type RuntimeScope, type RuntimeSession, type RuntimeSnapshotPayload, type ScheduledTask, type Session, type SessionCheckpoint, type SessionMetadata, type SessionSubscriptionPayload, type StatusUpdate, type StoredMessage, type StreamChunk, T1Administrator, type T1ToT2Assignment, T1_MODEL_PRIORITY, T2Manager, type T2Result, type T2ToT3Assignment, T2_MODEL_PRIORITY, type T3Result, type T3ResultPayload, type T3SubtaskSpec, T3Worker, T3_MODEL_PRIORITY, THEME_NAMES, TOOL_NAMES, type TaskComplexity, TaskScheduler, Telemetry, type TelemetryConfig, type Theme, type ThemeColors, type ThemeName, type TierConfig, type TierLimits, type TierRole, type TierStatus, type TokenUsage, type ToolCall, type ToolDefinition, type ToolExecuteOptions, ToolRegistry, type ToolResult, type ToolsConfig, VISION_MODEL_PRIORITY, type WebSearchConfig, type WebhookConfig, type WorkspaceConfig, createCascade, nodeHttpFetch, preferIpv4Host, runCascade, streamCascade };
|
package/dist/index.d.ts
CHANGED
|
@@ -497,7 +497,9 @@ interface WorkspaceConfig {
|
|
|
497
497
|
keystorePath: string;
|
|
498
498
|
auditLogPath: string;
|
|
499
499
|
}
|
|
500
|
-
type
|
|
500
|
+
type CascadeThemeName = 'midnight' | 'aurora' | 'ember' | 'tide' | 'bloom' | 'daybreak';
|
|
501
|
+
type LegacyThemeName = 'cascade' | 'dark' | 'light' | 'dracula' | 'nord' | 'solarized';
|
|
502
|
+
type ThemeName = CascadeThemeName | LegacyThemeName;
|
|
501
503
|
interface Theme {
|
|
502
504
|
name: ThemeName;
|
|
503
505
|
colors: ThemeColors;
|
|
@@ -1092,6 +1094,7 @@ declare class CascadeRouter extends EventEmitter {
|
|
|
1092
1094
|
getAvailableModels(): ModelInfo[];
|
|
1093
1095
|
private detectAvailableProviders;
|
|
1094
1096
|
private discoverOllamaModels;
|
|
1097
|
+
/** Returns true when at least one real model was discovered from the endpoint. */
|
|
1095
1098
|
private discoverOpenAICompatibleModels;
|
|
1096
1099
|
private ensureProvider;
|
|
1097
1100
|
private getProvider;
|
|
@@ -2301,8 +2304,11 @@ declare class CascadeToolError extends Error {
|
|
|
2301
2304
|
constructor(userMessage: string, cause?: unknown, retryable?: boolean);
|
|
2302
2305
|
}
|
|
2303
2306
|
|
|
2304
|
-
/**
|
|
2307
|
+
/**
|
|
2308
|
+
* Keep localhost intact. Node's `dns.setDefaultResultOrder('ipv4first')` handles IPv4 priority process-wide.
|
|
2309
|
+
* We no longer forcefully rewrite `localhost` to `127.0.0.1` as it breaks IPv6-only environments (e.g. ::1).
|
|
2310
|
+
*/
|
|
2305
2311
|
declare function preferIpv4Host(url: string | undefined): string | undefined;
|
|
2306
2312
|
declare function nodeHttpFetch(input: string | URL | Request, init?: RequestInit, redirectCount?: number): Promise<Response>;
|
|
2307
2313
|
|
|
2308
|
-
export { AZURE_BASE_URL_TEMPLATE, type ApprovalRequest, type ApprovalResponse, type AuditEntry, AuditLogger, type BenchmarksConfig, type BudgetConfig, CASCADE_AUDIT_FILE, CASCADE_CONFIG_DIR, CASCADE_CONFIG_FILE, CASCADE_DASHBOARD_SECRET_FILE, CASCADE_DB_FILE, CASCADE_IGNORE_FILE, CASCADE_KEYSTORE_FILE, CASCADE_MD_FILE, CASCADE_VERSION, COMPLEXITY_T2_COUNT, Cascade, CascadeCancelledError, type CascadeConfig, type CascadeEvent, type CascadeEventType, CascadeIgnore, type CascadeMessage, CascadeRouter, type CascadeRunOptions, type CascadeRunResult, CascadeToolError, ConfigManager, type ConversationMessage, DEFAULT_API_PORT, DEFAULT_APPROVAL_REQUIRED, DEFAULT_AUTO_SUMMARIZE_AT, DEFAULT_CONTEXT_LIMIT, DEFAULT_DASHBOARD_PORT, DEFAULT_MAX_SESSION_MESSAGES, DEFAULT_RETENTION_DAYS, DEFAULT_THEME, type DashboardConfig, DashboardServer, type EscalationPayload, GLOBAL_CONFIG_DIR, GLOBAL_DB_FILE, GLOBAL_KEYSTORE_FILE, GLOBAL_RUNTIME_DB_FILE, type GenerateOptions, type GenerateResult, type HookDefinition, type HooksConfig, HooksRunner, type Identity, type ImageAttachment, Keystore, LM_STUDIO_BASE_URL, MODELS, McpClient, type McpServerConfig$1 as McpServerConfig, type MemoryConfig, MemoryStore, type Message, type MessageContent, type MessagePayload, type MessageStatus, type MessageType, type ModelInfo, type ModelOverrides, OLLAMA_BASE_URL, PROVIDER_DISPLAY_NAMES, type PeerMessage, type PeerMessageEvent, type PeerSyncPayload, type PeerSyncType, type PermissionDecision, type PermissionDecisionPayload, type PermissionRequest, type PlanReviewConfig, type ProviderConfig, type ProviderType, type RuntimeNode, type RuntimeNodeLog, type RuntimeRefreshPayload, type RuntimeScope, type RuntimeSession, type RuntimeSnapshotPayload, type ScheduledTask, type Session, type SessionCheckpoint, type SessionMetadata, type SessionSubscriptionPayload, type StatusUpdate, type StoredMessage, type StreamChunk, T1Administrator, type T1ToT2Assignment, T1_MODEL_PRIORITY, T2Manager, type T2Result, type T2ToT3Assignment, T2_MODEL_PRIORITY, type T3Result, type T3ResultPayload, type T3SubtaskSpec, T3Worker, T3_MODEL_PRIORITY, THEME_NAMES, TOOL_NAMES, type TaskComplexity, TaskScheduler, Telemetry, type TelemetryConfig, type Theme, type ThemeColors, type ThemeName, type TierConfig, type TierLimits, type TierRole, type TierStatus, type TokenUsage, type ToolCall, type ToolDefinition, type ToolExecuteOptions, ToolRegistry, type ToolResult, type ToolsConfig, VISION_MODEL_PRIORITY, type WebSearchConfig, type WebhookConfig, type WorkspaceConfig, createCascade, nodeHttpFetch, preferIpv4Host, runCascade, streamCascade };
|
|
2314
|
+
export { AZURE_BASE_URL_TEMPLATE, type ApprovalRequest, type ApprovalResponse, type AuditEntry, AuditLogger, type BenchmarksConfig, type BudgetConfig, CASCADE_AUDIT_FILE, CASCADE_CONFIG_DIR, CASCADE_CONFIG_FILE, CASCADE_DASHBOARD_SECRET_FILE, CASCADE_DB_FILE, CASCADE_IGNORE_FILE, CASCADE_KEYSTORE_FILE, CASCADE_MD_FILE, CASCADE_VERSION, COMPLEXITY_T2_COUNT, Cascade, CascadeCancelledError, type CascadeConfig, type CascadeEvent, type CascadeEventType, CascadeIgnore, type CascadeMessage, CascadeRouter, type CascadeRunOptions, type CascadeRunResult, type CascadeThemeName, CascadeToolError, ConfigManager, type ConversationMessage, DEFAULT_API_PORT, DEFAULT_APPROVAL_REQUIRED, DEFAULT_AUTO_SUMMARIZE_AT, DEFAULT_CONTEXT_LIMIT, DEFAULT_DASHBOARD_PORT, DEFAULT_MAX_SESSION_MESSAGES, DEFAULT_RETENTION_DAYS, DEFAULT_THEME, type DashboardConfig, DashboardServer, type EscalationPayload, GLOBAL_CONFIG_DIR, GLOBAL_DB_FILE, GLOBAL_KEYSTORE_FILE, GLOBAL_RUNTIME_DB_FILE, type GenerateOptions, type GenerateResult, type HookDefinition, type HooksConfig, HooksRunner, type Identity, type ImageAttachment, Keystore, LM_STUDIO_BASE_URL, type LegacyThemeName, MODELS, McpClient, type McpServerConfig$1 as McpServerConfig, type MemoryConfig, MemoryStore, type Message, type MessageContent, type MessagePayload, type MessageStatus, type MessageType, type ModelInfo, type ModelOverrides, OLLAMA_BASE_URL, PROVIDER_DISPLAY_NAMES, type PeerMessage, type PeerMessageEvent, type PeerSyncPayload, type PeerSyncType, type PermissionDecision, type PermissionDecisionPayload, type PermissionRequest, type PlanReviewConfig, type ProviderConfig, type ProviderType, type RuntimeNode, type RuntimeNodeLog, type RuntimeRefreshPayload, type RuntimeScope, type RuntimeSession, type RuntimeSnapshotPayload, type ScheduledTask, type Session, type SessionCheckpoint, type SessionMetadata, type SessionSubscriptionPayload, type StatusUpdate, type StoredMessage, type StreamChunk, T1Administrator, type T1ToT2Assignment, T1_MODEL_PRIORITY, T2Manager, type T2Result, type T2ToT3Assignment, T2_MODEL_PRIORITY, type T3Result, type T3ResultPayload, type T3SubtaskSpec, T3Worker, T3_MODEL_PRIORITY, THEME_NAMES, TOOL_NAMES, type TaskComplexity, TaskScheduler, Telemetry, type TelemetryConfig, type Theme, type ThemeColors, type ThemeName, type TierConfig, type TierLimits, type TierRole, type TierStatus, type TokenUsage, type ToolCall, type ToolDefinition, type ToolExecuteOptions, ToolRegistry, type ToolResult, type ToolsConfig, VISION_MODEL_PRIORITY, type WebSearchConfig, type WebhookConfig, type WorkspaceConfig, createCascade, nodeHttpFetch, preferIpv4Host, runCascade, streamCascade };
|
package/dist/index.js
CHANGED
|
@@ -39,7 +39,7 @@ import cron from 'node-cron';
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
// src/constants.ts
|
|
42
|
-
var CASCADE_VERSION = "0.12.
|
|
42
|
+
var CASCADE_VERSION = "0.12.21";
|
|
43
43
|
var CASCADE_CONFIG_DIR = ".cascade";
|
|
44
44
|
var CASCADE_MD_FILE = "CASCADE.md";
|
|
45
45
|
var CASCADE_IGNORE_FILE = ".cascadeignore";
|
|
@@ -1105,8 +1105,7 @@ try {
|
|
|
1105
1105
|
} catch {
|
|
1106
1106
|
}
|
|
1107
1107
|
function preferIpv4Host(url) {
|
|
1108
|
-
|
|
1109
|
-
return url.replace(/^(https?:\/\/)localhost(?=[:/]|$)/i, "$1127.0.0.1");
|
|
1108
|
+
return url;
|
|
1110
1109
|
}
|
|
1111
1110
|
var MAX_REDIRECTS = 5;
|
|
1112
1111
|
async function nodeHttpFetch(input, init = {}, redirectCount = 0) {
|
|
@@ -1379,7 +1378,7 @@ var OllamaProvider = class extends BaseProvider {
|
|
|
1379
1378
|
};
|
|
1380
1379
|
var OpenAICompatibleProvider = class extends OpenAIProvider {
|
|
1381
1380
|
constructor(config, model) {
|
|
1382
|
-
super(config, model);
|
|
1381
|
+
super({ ...config, apiKey: config.apiKey ?? "not-required" }, model);
|
|
1383
1382
|
this.client = new OpenAI({
|
|
1384
1383
|
apiKey: config.apiKey ?? "not-required",
|
|
1385
1384
|
baseURL: preferIpv4Host(config.baseUrl),
|
|
@@ -2265,10 +2264,10 @@ var CascadeRouter = class _CascadeRouter extends EventEmitter {
|
|
|
2265
2264
|
if (availableProviders.has("ollama")) {
|
|
2266
2265
|
await this.discoverOllamaModels(ollamaCfg);
|
|
2267
2266
|
}
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
);
|
|
2267
|
+
const ocConfigs = config.providers.filter((p) => p.type === "openai-compatible" && p.baseUrl);
|
|
2268
|
+
if (ocConfigs.length > 0) {
|
|
2269
|
+
const results = await Promise.all(ocConfigs.map((cfg) => this.discoverOpenAICompatibleModels(cfg)));
|
|
2270
|
+
if (results.some(Boolean)) this.selector.markProviderAvailable("openai-compatible");
|
|
2272
2271
|
}
|
|
2273
2272
|
for (const tier of ["T1", "T2", "T3"]) {
|
|
2274
2273
|
const override = tier === "T1" ? config.models.t1 : tier === "T2" ? config.models.t2 : config.models.t3;
|
|
@@ -2739,6 +2738,7 @@ var CascadeRouter = class _CascadeRouter extends EventEmitter {
|
|
|
2739
2738
|
} catch {
|
|
2740
2739
|
}
|
|
2741
2740
|
}
|
|
2741
|
+
/** Returns true when at least one real model was discovered from the endpoint. */
|
|
2742
2742
|
async discoverOpenAICompatibleModels(cfg) {
|
|
2743
2743
|
try {
|
|
2744
2744
|
const seed = {
|
|
@@ -2758,8 +2758,10 @@ var CascadeRouter = class _CascadeRouter extends EventEmitter {
|
|
|
2758
2758
|
for (const m of models) {
|
|
2759
2759
|
this.selector.addDynamicModel(m);
|
|
2760
2760
|
}
|
|
2761
|
+
return models.length > 0;
|
|
2761
2762
|
} catch (err) {
|
|
2762
2763
|
console.warn("[router] OpenAI-compatible model discovery failed:", err instanceof Error ? err.message : err);
|
|
2764
|
+
return false;
|
|
2763
2765
|
}
|
|
2764
2766
|
}
|
|
2765
2767
|
ensureProvider(model, configs) {
|