cascade-ai 0.76.0 → 0.77.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/dist/index.d.cts CHANGED
@@ -1,5 +1,6 @@
1
1
  import EventEmitter from 'node:events';
2
2
  import { OAuthClientProvider } from '@modelcontextprotocol/sdk/client/auth.js';
3
+ import { z } from 'zod';
3
4
  import { Server } from 'node:http';
4
5
  import { OAuthClientInformationMixed, OAuthTokens, OAuthClientMetadata, OAuthClientInformationFull } from '@modelcontextprotocol/sdk/shared/auth.js';
5
6
  export { OAuthClientInformationMixed, OAuthTokens } from '@modelcontextprotocol/sdk/shared/auth.js';
@@ -368,6 +369,20 @@ interface WebSearchConfig {
368
369
  braveApiKey?: string;
369
370
  tavilyApiKey?: string;
370
371
  maxResults?: number;
372
+ /**
373
+ * Route `searxngUrl` through the SSRF guard — set by hosts that take the URL
374
+ * from a request rather than from local config. Full reasoning on the
375
+ * matching field in `src/tools/web-search.ts`, which is the copy the tool
376
+ * actually reads.
377
+ *
378
+ * This shape is declared in THREE places that must move together: here, that
379
+ * interface, and `WebSearchConfigSchema` in `src/config/schema.ts`. The zod
380
+ * one is load-bearing rather than decorative — `createCascade` runs the whole
381
+ * config through `CascadeConfigSchema.parse()`, which strips keys the schema
382
+ * does not name, so a field added only to the interfaces type-checks and then
383
+ * silently vanishes at runtime.
384
+ */
385
+ guardSearxngUrl?: boolean;
371
386
  }
372
387
  interface Message {
373
388
  id: string;
@@ -4392,6 +4407,1129 @@ declare class ConfigManager {
4392
4407
  private ensureDefaultIdentity;
4393
4408
  }
4394
4409
 
4410
+ declare const CascadeConfigSchema: z.ZodObject<{
4411
+ version: z.ZodDefault<z.ZodLiteral<"1.0">>;
4412
+ defaultIdentityId: z.ZodOptional<z.ZodString>;
4413
+ providers: z.ZodDefault<z.ZodArray<z.ZodObject<{
4414
+ type: z.ZodEnum<["anthropic", "openai", "gemini", "azure", "openai-compatible", "ollama"]>;
4415
+ label: z.ZodOptional<z.ZodString>;
4416
+ apiKey: z.ZodOptional<z.ZodString>;
4417
+ baseUrl: z.ZodOptional<z.ZodString>;
4418
+ deploymentName: z.ZodOptional<z.ZodString>;
4419
+ apiVersion: z.ZodOptional<z.ZodString>;
4420
+ model: z.ZodOptional<z.ZodString>;
4421
+ authToken: z.ZodOptional<z.ZodString>;
4422
+ credentialSource: z.ZodOptional<z.ZodString>;
4423
+ /**
4424
+ * "This endpoint is self-hosted, so inference genuinely costs $0."
4425
+ * Only meaningful for `ollama` and `openai-compatible`. Unset ⇒ inferred:
4426
+ * ollama is local, openai-compatible is local when its baseUrl is
4427
+ * loopback/LAN. Set it explicitly to override — e.g. `false` for an Ollama
4428
+ * instance you rent, `true` for a llama.cpp box on your own LAN reached by
4429
+ * hostname.
4430
+ */
4431
+ local: z.ZodOptional<z.ZodBoolean>;
4432
+ /** Region for providers whose price varies by region (Azure: global | us | eu | …). */
4433
+ region: z.ZodOptional<z.ZodString>;
4434
+ }, "strip", z.ZodTypeAny, {
4435
+ type: "anthropic" | "openai" | "gemini" | "azure" | "openai-compatible" | "ollama";
4436
+ region?: string | undefined;
4437
+ baseUrl?: string | undefined;
4438
+ local?: boolean | undefined;
4439
+ label?: string | undefined;
4440
+ apiKey?: string | undefined;
4441
+ deploymentName?: string | undefined;
4442
+ apiVersion?: string | undefined;
4443
+ model?: string | undefined;
4444
+ authToken?: string | undefined;
4445
+ credentialSource?: string | undefined;
4446
+ }, {
4447
+ type: "anthropic" | "openai" | "gemini" | "azure" | "openai-compatible" | "ollama";
4448
+ region?: string | undefined;
4449
+ baseUrl?: string | undefined;
4450
+ local?: boolean | undefined;
4451
+ label?: string | undefined;
4452
+ apiKey?: string | undefined;
4453
+ deploymentName?: string | undefined;
4454
+ apiVersion?: string | undefined;
4455
+ model?: string | undefined;
4456
+ authToken?: string | undefined;
4457
+ credentialSource?: string | undefined;
4458
+ }>, "many">>;
4459
+ models: z.ZodDefault<z.ZodObject<{
4460
+ t1: z.ZodOptional<z.ZodString>;
4461
+ t2: z.ZodOptional<z.ZodString>;
4462
+ t3: z.ZodOptional<z.ZodString>;
4463
+ vision: z.ZodOptional<z.ZodString>;
4464
+ }, "strip", z.ZodTypeAny, {
4465
+ t1?: string | undefined;
4466
+ t2?: string | undefined;
4467
+ t3?: string | undefined;
4468
+ vision?: string | undefined;
4469
+ }, {
4470
+ t1?: string | undefined;
4471
+ t2?: string | undefined;
4472
+ t3?: string | undefined;
4473
+ vision?: string | undefined;
4474
+ }>>;
4475
+ tools: z.ZodDefault<z.ZodObject<{
4476
+ shellAllowlist: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
4477
+ shellBlocklist: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
4478
+ requireApprovalFor: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
4479
+ browserEnabled: z.ZodDefault<z.ZodBoolean>;
4480
+ mcpServers: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
4481
+ name: z.ZodString;
4482
+ command: z.ZodOptional<z.ZodString>;
4483
+ args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4484
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
4485
+ url: z.ZodOptional<z.ZodString>;
4486
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
4487
+ oauthStore: z.ZodOptional<z.ZodString>;
4488
+ }, "strip", z.ZodTypeAny, {
4489
+ name: string;
4490
+ url?: string | undefined;
4491
+ headers?: Record<string, string> | undefined;
4492
+ command?: string | undefined;
4493
+ args?: string[] | undefined;
4494
+ env?: Record<string, string> | undefined;
4495
+ oauthStore?: string | undefined;
4496
+ }, {
4497
+ name: string;
4498
+ url?: string | undefined;
4499
+ headers?: Record<string, string> | undefined;
4500
+ command?: string | undefined;
4501
+ args?: string[] | undefined;
4502
+ env?: Record<string, string> | undefined;
4503
+ oauthStore?: string | undefined;
4504
+ }>, {
4505
+ name: string;
4506
+ url?: string | undefined;
4507
+ headers?: Record<string, string> | undefined;
4508
+ command?: string | undefined;
4509
+ args?: string[] | undefined;
4510
+ env?: Record<string, string> | undefined;
4511
+ oauthStore?: string | undefined;
4512
+ }, {
4513
+ name: string;
4514
+ url?: string | undefined;
4515
+ headers?: Record<string, string> | undefined;
4516
+ command?: string | undefined;
4517
+ args?: string[] | undefined;
4518
+ env?: Record<string, string> | undefined;
4519
+ oauthStore?: string | undefined;
4520
+ }>, "many">>;
4521
+ mcpTrusted: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4522
+ /** Web search backends — at least one should be configured for best results */
4523
+ webSearch: z.ZodOptional<z.ZodObject<{
4524
+ /** Base URL of your SearXNG instance (e.g. http://localhost:8080) */
4525
+ searxngUrl: z.ZodOptional<z.ZodString>;
4526
+ /** Brave Search API key — get one at https://api.search.brave.com */
4527
+ braveApiKey: z.ZodOptional<z.ZodString>;
4528
+ /** Tavily API key — get one at https://tavily.com */
4529
+ tavilyApiKey: z.ZodOptional<z.ZodString>;
4530
+ /** Max results per search (default 5) */
4531
+ maxResults: z.ZodDefault<z.ZodNumber>;
4532
+ /**
4533
+ * Send `searxngUrl` through the SSRF guard. Off for a local run, where the
4534
+ * URL is the machine owner's own config and a self-hosted SearXNG is
4535
+ * routinely on a private address; on for a host that accepts it from a
4536
+ * request. See `src/tools/web-search.ts`.
4537
+ *
4538
+ * It has to be named HERE, not just on the TypeScript interfaces: the config
4539
+ * passes through `CascadeConfigSchema.parse()` on its way into a run, and
4540
+ * zod drops every key this object does not declare.
4541
+ */
4542
+ guardSearxngUrl: z.ZodOptional<z.ZodBoolean>;
4543
+ }, "strip", z.ZodTypeAny, {
4544
+ maxResults: number;
4545
+ searxngUrl?: string | undefined;
4546
+ braveApiKey?: string | undefined;
4547
+ tavilyApiKey?: string | undefined;
4548
+ guardSearxngUrl?: boolean | undefined;
4549
+ }, {
4550
+ searxngUrl?: string | undefined;
4551
+ braveApiKey?: string | undefined;
4552
+ tavilyApiKey?: string | undefined;
4553
+ maxResults?: number | undefined;
4554
+ guardSearxngUrl?: boolean | undefined;
4555
+ }>>;
4556
+ /**
4557
+ * Sandbox runtime for LLM-authored dynamic tools:
4558
+ * - 'isolate': hard V8 isolate (isolated-vm) — no Node globals, true capability
4559
+ * confinement. Requires the optional native `isolated-vm` dependency.
4560
+ * - 'worker': node:worker_threads (resource/kill limits, but not capability-confined).
4561
+ * - 'auto' (default): use the isolate when `isolated-vm` loads, else fall back to worker.
4562
+ */
4563
+ dynamicToolSandbox: z.ZodDefault<z.ZodEnum<["isolate", "worker", "auto"]>>;
4564
+ /**
4565
+ * When set, ONLY these tool names are registered — the sole way to omit a
4566
+ * built-in tool (shell/file/git/…) from existing at all, rather than just
4567
+ * gating it behind approval. Omitted = full default set (unchanged).
4568
+ */
4569
+ enabledTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4570
+ /**
4571
+ * Tools to remove even when they would otherwise be registered. Unlike
4572
+ * `enabledTools` (an allowlist over the built-in set), this also reaches
4573
+ * tools registered outside it — MCP tools and media generation — which is
4574
+ * the only way to turn those off.
4575
+ */
4576
+ disabledTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4577
+ }, "strip", z.ZodTypeAny, {
4578
+ shellAllowlist: string[];
4579
+ shellBlocklist: string[];
4580
+ requireApprovalFor: string[];
4581
+ browserEnabled: boolean;
4582
+ dynamicToolSandbox: "auto" | "isolate" | "worker";
4583
+ mcpServers?: {
4584
+ name: string;
4585
+ url?: string | undefined;
4586
+ headers?: Record<string, string> | undefined;
4587
+ command?: string | undefined;
4588
+ args?: string[] | undefined;
4589
+ env?: Record<string, string> | undefined;
4590
+ oauthStore?: string | undefined;
4591
+ }[] | undefined;
4592
+ mcpTrusted?: string[] | undefined;
4593
+ webSearch?: {
4594
+ maxResults: number;
4595
+ searxngUrl?: string | undefined;
4596
+ braveApiKey?: string | undefined;
4597
+ tavilyApiKey?: string | undefined;
4598
+ guardSearxngUrl?: boolean | undefined;
4599
+ } | undefined;
4600
+ enabledTools?: string[] | undefined;
4601
+ disabledTools?: string[] | undefined;
4602
+ }, {
4603
+ mcpServers?: {
4604
+ name: string;
4605
+ url?: string | undefined;
4606
+ headers?: Record<string, string> | undefined;
4607
+ command?: string | undefined;
4608
+ args?: string[] | undefined;
4609
+ env?: Record<string, string> | undefined;
4610
+ oauthStore?: string | undefined;
4611
+ }[] | undefined;
4612
+ shellAllowlist?: string[] | undefined;
4613
+ shellBlocklist?: string[] | undefined;
4614
+ requireApprovalFor?: string[] | undefined;
4615
+ browserEnabled?: boolean | undefined;
4616
+ mcpTrusted?: string[] | undefined;
4617
+ webSearch?: {
4618
+ searxngUrl?: string | undefined;
4619
+ braveApiKey?: string | undefined;
4620
+ tavilyApiKey?: string | undefined;
4621
+ maxResults?: number | undefined;
4622
+ guardSearxngUrl?: boolean | undefined;
4623
+ } | undefined;
4624
+ dynamicToolSandbox?: "auto" | "isolate" | "worker" | undefined;
4625
+ enabledTools?: string[] | undefined;
4626
+ disabledTools?: string[] | undefined;
4627
+ }>>;
4628
+ hooks: z.ZodDefault<z.ZodObject<{
4629
+ preToolUse: z.ZodOptional<z.ZodArray<z.ZodObject<{
4630
+ name: z.ZodOptional<z.ZodString>;
4631
+ command: z.ZodString;
4632
+ tools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4633
+ timeout: z.ZodOptional<z.ZodNumber>;
4634
+ }, "strip", z.ZodTypeAny, {
4635
+ command: string;
4636
+ timeout?: number | undefined;
4637
+ name?: string | undefined;
4638
+ tools?: string[] | undefined;
4639
+ }, {
4640
+ command: string;
4641
+ timeout?: number | undefined;
4642
+ name?: string | undefined;
4643
+ tools?: string[] | undefined;
4644
+ }>, "many">>;
4645
+ postToolUse: z.ZodOptional<z.ZodArray<z.ZodObject<{
4646
+ name: z.ZodOptional<z.ZodString>;
4647
+ command: z.ZodString;
4648
+ tools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4649
+ timeout: z.ZodOptional<z.ZodNumber>;
4650
+ }, "strip", z.ZodTypeAny, {
4651
+ command: string;
4652
+ timeout?: number | undefined;
4653
+ name?: string | undefined;
4654
+ tools?: string[] | undefined;
4655
+ }, {
4656
+ command: string;
4657
+ timeout?: number | undefined;
4658
+ name?: string | undefined;
4659
+ tools?: string[] | undefined;
4660
+ }>, "many">>;
4661
+ preTask: z.ZodOptional<z.ZodArray<z.ZodObject<{
4662
+ name: z.ZodOptional<z.ZodString>;
4663
+ command: z.ZodString;
4664
+ tools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4665
+ timeout: z.ZodOptional<z.ZodNumber>;
4666
+ }, "strip", z.ZodTypeAny, {
4667
+ command: string;
4668
+ timeout?: number | undefined;
4669
+ name?: string | undefined;
4670
+ tools?: string[] | undefined;
4671
+ }, {
4672
+ command: string;
4673
+ timeout?: number | undefined;
4674
+ name?: string | undefined;
4675
+ tools?: string[] | undefined;
4676
+ }>, "many">>;
4677
+ postTask: z.ZodOptional<z.ZodArray<z.ZodObject<{
4678
+ name: z.ZodOptional<z.ZodString>;
4679
+ command: z.ZodString;
4680
+ tools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4681
+ timeout: z.ZodOptional<z.ZodNumber>;
4682
+ }, "strip", z.ZodTypeAny, {
4683
+ command: string;
4684
+ timeout?: number | undefined;
4685
+ name?: string | undefined;
4686
+ tools?: string[] | undefined;
4687
+ }, {
4688
+ command: string;
4689
+ timeout?: number | undefined;
4690
+ name?: string | undefined;
4691
+ tools?: string[] | undefined;
4692
+ }>, "many">>;
4693
+ }, "strip", z.ZodTypeAny, {
4694
+ preToolUse?: {
4695
+ command: string;
4696
+ timeout?: number | undefined;
4697
+ name?: string | undefined;
4698
+ tools?: string[] | undefined;
4699
+ }[] | undefined;
4700
+ postToolUse?: {
4701
+ command: string;
4702
+ timeout?: number | undefined;
4703
+ name?: string | undefined;
4704
+ tools?: string[] | undefined;
4705
+ }[] | undefined;
4706
+ preTask?: {
4707
+ command: string;
4708
+ timeout?: number | undefined;
4709
+ name?: string | undefined;
4710
+ tools?: string[] | undefined;
4711
+ }[] | undefined;
4712
+ postTask?: {
4713
+ command: string;
4714
+ timeout?: number | undefined;
4715
+ name?: string | undefined;
4716
+ tools?: string[] | undefined;
4717
+ }[] | undefined;
4718
+ }, {
4719
+ preToolUse?: {
4720
+ command: string;
4721
+ timeout?: number | undefined;
4722
+ name?: string | undefined;
4723
+ tools?: string[] | undefined;
4724
+ }[] | undefined;
4725
+ postToolUse?: {
4726
+ command: string;
4727
+ timeout?: number | undefined;
4728
+ name?: string | undefined;
4729
+ tools?: string[] | undefined;
4730
+ }[] | undefined;
4731
+ preTask?: {
4732
+ command: string;
4733
+ timeout?: number | undefined;
4734
+ name?: string | undefined;
4735
+ tools?: string[] | undefined;
4736
+ }[] | undefined;
4737
+ postTask?: {
4738
+ command: string;
4739
+ timeout?: number | undefined;
4740
+ name?: string | undefined;
4741
+ tools?: string[] | undefined;
4742
+ }[] | undefined;
4743
+ }>>;
4744
+ dashboard: z.ZodDefault<z.ZodObject<{
4745
+ port: z.ZodDefault<z.ZodNumber>;
4746
+ /**
4747
+ * Interface to bind the dashboard HTTP/WebSocket server to. Defaults to
4748
+ * loopback so the dashboard — which exposes /api/run (arbitrary task
4749
+ * execution) and config mutation — is never reachable from the network
4750
+ * unless the operator explicitly opts in (e.g. "0.0.0.0" for team mode).
4751
+ */
4752
+ host: z.ZodDefault<z.ZodString>;
4753
+ auth: z.ZodDefault<z.ZodBoolean>;
4754
+ teamMode: z.ZodDefault<z.ZodEnum<["single", "multi"]>>;
4755
+ secret: z.ZodOptional<z.ZodString>;
4756
+ }, "strip", z.ZodTypeAny, {
4757
+ auth: boolean;
4758
+ host: string;
4759
+ port: number;
4760
+ teamMode: "single" | "multi";
4761
+ secret?: string | undefined;
4762
+ }, {
4763
+ auth?: boolean | undefined;
4764
+ host?: string | undefined;
4765
+ port?: number | undefined;
4766
+ teamMode?: "single" | "multi" | undefined;
4767
+ secret?: string | undefined;
4768
+ }>>;
4769
+ telemetry: z.ZodDefault<z.ZodObject<{
4770
+ enabled: z.ZodDefault<z.ZodBoolean>;
4771
+ posthogApiKey: z.ZodOptional<z.ZodString>;
4772
+ distinctId: z.ZodOptional<z.ZodString>;
4773
+ }, "strip", z.ZodTypeAny, {
4774
+ enabled: boolean;
4775
+ posthogApiKey?: string | undefined;
4776
+ distinctId?: string | undefined;
4777
+ }, {
4778
+ enabled?: boolean | undefined;
4779
+ posthogApiKey?: string | undefined;
4780
+ distinctId?: string | undefined;
4781
+ }>>;
4782
+ memory: z.ZodDefault<z.ZodObject<{
4783
+ maxSessionMessages: z.ZodDefault<z.ZodNumber>;
4784
+ autoSummarizeAt: z.ZodDefault<z.ZodNumber>;
4785
+ retentionDays: z.ZodDefault<z.ZodNumber>;
4786
+ /** Opt-in session→knowledge distillation after each run. Default: false. */
4787
+ rememberSessions: z.ZodDefault<z.ZodBoolean>;
4788
+ }, "strip", z.ZodTypeAny, {
4789
+ maxSessionMessages: number;
4790
+ autoSummarizeAt: number;
4791
+ retentionDays: number;
4792
+ rememberSessions: boolean;
4793
+ }, {
4794
+ maxSessionMessages?: number | undefined;
4795
+ autoSummarizeAt?: number | undefined;
4796
+ retentionDays?: number | undefined;
4797
+ rememberSessions?: boolean | undefined;
4798
+ }>>;
4799
+ tierLimits: z.ZodDefault<z.ZodObject<{
4800
+ t1MaxTokens: z.ZodOptional<z.ZodNumber>;
4801
+ t2MaxTokens: z.ZodOptional<z.ZodNumber>;
4802
+ t3MaxTokens: z.ZodOptional<z.ZodNumber>;
4803
+ t1Temperature: z.ZodOptional<z.ZodNumber>;
4804
+ t2Temperature: z.ZodOptional<z.ZodNumber>;
4805
+ t3Temperature: z.ZodOptional<z.ZodNumber>;
4806
+ }, "strip", z.ZodTypeAny, {
4807
+ t1MaxTokens?: number | undefined;
4808
+ t2MaxTokens?: number | undefined;
4809
+ t3MaxTokens?: number | undefined;
4810
+ t1Temperature?: number | undefined;
4811
+ t2Temperature?: number | undefined;
4812
+ t3Temperature?: number | undefined;
4813
+ }, {
4814
+ t1MaxTokens?: number | undefined;
4815
+ t2MaxTokens?: number | undefined;
4816
+ t3MaxTokens?: number | undefined;
4817
+ t1Temperature?: number | undefined;
4818
+ t2Temperature?: number | undefined;
4819
+ t3Temperature?: number | undefined;
4820
+ }>>;
4821
+ extendedContext: z.ZodDefault<z.ZodObject<{
4822
+ enabled: z.ZodDefault<z.ZodBoolean>;
4823
+ maxMultiplier: z.ZodDefault<z.ZodNumber>;
4824
+ }, "strip", z.ZodTypeAny, {
4825
+ enabled: boolean;
4826
+ maxMultiplier: number;
4827
+ }, {
4828
+ enabled?: boolean | undefined;
4829
+ maxMultiplier?: number | undefined;
4830
+ }>>;
4831
+ budget: z.ZodDefault<z.ZodObject<{
4832
+ dailyBudgetUsd: z.ZodOptional<z.ZodNumber>;
4833
+ sessionBudgetUsd: z.ZodOptional<z.ZodNumber>;
4834
+ /**
4835
+ * Hard per-task token ceiling. A single `cascade run` is stopped once its
4836
+ * combined token usage crosses this, so a mis-routed trivial task can never
4837
+ * fan out into a runaway multi-agent burn. Resets every run. Raise it for
4838
+ * genuinely large jobs. Defaults to 200k.
4839
+ */
4840
+ maxTokensPerRun: z.ZodDefault<z.ZodNumber>;
4841
+ /** Optional hard per-task cost ceiling (USD). Unset = only the token cap applies. */
4842
+ maxCostPerRunUsd: z.ZodOptional<z.ZodNumber>;
4843
+ /**
4844
+ * Consecutive systemic failures against ONE model before the run stops
4845
+ * launching work that would fail the same way (dead key, wrong model id,
4846
+ * exhausted quota). Lower reacts sooner and wastes less; higher absorbs a
4847
+ * longer transient before giving up. Only failures that will certainly repeat
4848
+ * are counted — see core/run-breaker.ts.
4849
+ */
4850
+ failureThreshold: z.ZodDefault<z.ZodNumber>;
4851
+ warnAtPct: z.ZodDefault<z.ZodNumber>;
4852
+ }, "strip", z.ZodTypeAny, {
4853
+ maxTokensPerRun: number;
4854
+ failureThreshold: number;
4855
+ warnAtPct: number;
4856
+ dailyBudgetUsd?: number | undefined;
4857
+ sessionBudgetUsd?: number | undefined;
4858
+ maxCostPerRunUsd?: number | undefined;
4859
+ }, {
4860
+ dailyBudgetUsd?: number | undefined;
4861
+ sessionBudgetUsd?: number | undefined;
4862
+ maxTokensPerRun?: number | undefined;
4863
+ maxCostPerRunUsd?: number | undefined;
4864
+ failureThreshold?: number | undefined;
4865
+ warnAtPct?: number | undefined;
4866
+ }>>;
4867
+ theme: z.ZodDefault<z.ZodString>;
4868
+ workspace: z.ZodDefault<z.ZodObject<{
4869
+ cascadeMdPath: z.ZodDefault<z.ZodString>;
4870
+ configPath: z.ZodDefault<z.ZodString>;
4871
+ keystorePath: z.ZodDefault<z.ZodString>;
4872
+ auditLogPath: z.ZodDefault<z.ZodString>;
4873
+ debugWorldState: z.ZodDefault<z.ZodBoolean>;
4874
+ }, "strip", z.ZodTypeAny, {
4875
+ cascadeMdPath: string;
4876
+ configPath: string;
4877
+ keystorePath: string;
4878
+ auditLogPath: string;
4879
+ debugWorldState: boolean;
4880
+ }, {
4881
+ cascadeMdPath?: string | undefined;
4882
+ configPath?: string | undefined;
4883
+ keystorePath?: string | undefined;
4884
+ auditLogPath?: string | undefined;
4885
+ debugWorldState?: boolean | undefined;
4886
+ }>>;
4887
+ /**
4888
+ * Per-provider tokens-per-minute overrides for the router's TpmLimiter (see
4889
+ * DEFAULT_PROVIDER_TPM in core/router/tpm-limiter.ts). Documented as a raw
4890
+ * config field for a while before this — since CascadeConfigSchema strips
4891
+ * unknown keys, a config file setting it was silently discarded and the
4892
+ * override never reached TpmLimiter's constructor. Optional/permissive on
4893
+ * provider name (not a ProviderType enum) so a config still validates
4894
+ * against a slightly newer/older provider list than this schema knows.
4895
+ */
4896
+ rateLimits: z.ZodOptional<z.ZodObject<{
4897
+ providerTpm: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
4898
+ }, "strip", z.ZodTypeAny, {
4899
+ providerTpm?: Record<string, number> | undefined;
4900
+ }, {
4901
+ providerTpm?: Record<string, number> | undefined;
4902
+ }>>;
4903
+ /**
4904
+ * Cascade Auto: when true, the TaskAnalyzer selects the optimal model for each
4905
+ * tier based on task type and complexity, overriding the static priority lists.
4906
+ * Heuristic-first with AI inference fallback (adds ~0–500ms per task).
4907
+ * ON by default since v0.19.0 — "Auto" without it was just a static priority
4908
+ * list, not the benchmark-value routing the docs describe. Explicit per-tier
4909
+ * model pins are unaffected; disable via config/Settings → Advanced.
4910
+ */
4911
+ cascadeAuto: z.ZodDefault<z.ZodBoolean>;
4912
+ /**
4913
+ * Cascade Auto trade-off bias when picking a model for a task:
4914
+ * - 'balanced' (default): quality × cost-efficiency — cheap models win
4915
+ * trivial tasks, strong models win hard ones.
4916
+ * - 'quality': pick the highest-benchmark model; cost only breaks ties.
4917
+ * - 'cost': pick the cheapest model that clears a per-task quality floor.
4918
+ */
4919
+ autoBias: z.ZodDefault<z.ZodEnum<["balanced", "quality", "cost"]>>;
4920
+ /**
4921
+ * Public-benchmark data source for Cascade Auto. All fields have safe
4922
+ * defaults so zero config "just works" — live data is fetched in the
4923
+ * background and the bundled snapshot is used until it arrives (or offline).
4924
+ */
4925
+ benchmarks: z.ZodDefault<z.ZodObject<{
4926
+ /** Fetch current quality scores from a public source. Default: true. */
4927
+ live: z.ZodDefault<z.ZodBoolean>;
4928
+ /** How long a fetched snapshot stays fresh before re-fetching (hours). */
4929
+ refreshHours: z.ZodDefault<z.ZodNumber>;
4930
+ /**
4931
+ * Override the quality-benchmark source URL (must return the snapshot
4932
+ * JSON shape). When unset, the maintained GitHub-raw snapshot is used.
4933
+ */
4934
+ sourceUrl: z.ZodOptional<z.ZodString>;
4935
+ /** Fetch current per-token prices from OpenRouter (free, no key). */
4936
+ pricingLive: z.ZodDefault<z.ZodBoolean>;
4937
+ /** Cache location for the fetched snapshot (cloud → persistent volume). */
4938
+ cacheFile: z.ZodOptional<z.ZodString>;
4939
+ }, "strip", z.ZodTypeAny, {
4940
+ live: boolean;
4941
+ pricingLive: boolean;
4942
+ refreshHours: number;
4943
+ sourceUrl?: string | undefined;
4944
+ cacheFile?: string | undefined;
4945
+ }, {
4946
+ live?: boolean | undefined;
4947
+ sourceUrl?: string | undefined;
4948
+ pricingLive?: boolean | undefined;
4949
+ refreshHours?: number | undefined;
4950
+ cacheFile?: string | undefined;
4951
+ }>>;
4952
+ /**
4953
+ * Runtime Tool Creation: when true, T3 workers can generate and register new tools
4954
+ * at runtime via the ToolCreator when no existing tool can handle a required operation.
4955
+ * Generated tools are session-scoped and sandboxed (see tools.dynamicToolSandbox).
4956
+ * HTTP calls from generated tools require approval.
4957
+ */
4958
+ enableToolCreation: z.ZodDefault<z.ZodBoolean>;
4959
+ /**
4960
+ * Project knowledge (world state). `factsExtraction`: after each worker
4961
+ * completes, run a cheap extraction pass that distills its output into
4962
+ * queryable entity/relation/value facts (superseding older facts), which T1
4963
+ * queries during planning instead of replaying the whole linear log. Best-effort
4964
+ * and non-blocking; set false to keep only the raw linear log.
4965
+ */
4966
+ knowledge: z.ZodDefault<z.ZodObject<{
4967
+ factsExtraction: z.ZodDefault<z.ZodBoolean>;
4968
+ }, "strip", z.ZodTypeAny, {
4969
+ factsExtraction: boolean;
4970
+ }, {
4971
+ factsExtraction?: boolean | undefined;
4972
+ }>>;
4973
+ /**
4974
+ * Fast answer behaviour. `autoSimple`: pure small talk ("hi", "who are you")
4975
+ * skips the T1/T2/T3 machinery for a direct single-model reply — same cost
4976
+ * shape as the explicit fast-answer toggle, applied automatically.
4977
+ */
4978
+ fastAnswer: z.ZodDefault<z.ZodObject<{
4979
+ autoSimple: z.ZodDefault<z.ZodBoolean>;
4980
+ }, "strip", z.ZodTypeAny, {
4981
+ autoSimple: boolean;
4982
+ }, {
4983
+ autoSimple?: boolean | undefined;
4984
+ }>>;
4985
+ /**
4986
+ * Workspace code index (Phase 3). Opt-in. When enabled, Cascade registers a
4987
+ * `code_search` tool backed by a hybrid + reranked index of the workspace so
4988
+ * workers can find code by meaning. Build/refresh the index with
4989
+ * `cascade index`; set autoRefresh to update it at run start (incremental —
4990
+ * only changed files are re-embedded).
4991
+ */
4992
+ codeIndex: z.ZodDefault<z.ZodObject<{
4993
+ enabled: z.ZodDefault<z.ZodBoolean>;
4994
+ autoRefresh: z.ZodDefault<z.ZodBoolean>;
4995
+ /** SQLite file for the index. Defaults to <workspace>/.cascade/code-index.db. */
4996
+ dbPath: z.ZodOptional<z.ZodString>;
4997
+ }, "strip", z.ZodTypeAny, {
4998
+ enabled: boolean;
4999
+ autoRefresh: boolean;
5000
+ dbPath?: string | undefined;
5001
+ }, {
5002
+ enabled?: boolean | undefined;
5003
+ autoRefresh?: boolean | undefined;
5004
+ dbPath?: string | undefined;
5005
+ }>>;
5006
+ /**
5007
+ * Persist runtime-generated tools to .cascade/dynamic-tools.json and reload them
5008
+ * on startup for cross-run dedup. Reloaded (and peer-received) tools are always
5009
+ * treated as UNTRUSTED — their dangerous actions re-escalate. Set false to disable
5010
+ * persistence entirely.
5011
+ */
5012
+ persistDynamicTools: z.ZodDefault<z.ZodBoolean>;
5013
+ /**
5014
+ * External plugin paths or npm package names to load at startup.
5015
+ * Each entry must export a default ToolPlugin object.
5016
+ * Example: ["./plugins/my-tool.js", "cascade-plugin-slack"]
5017
+ */
5018
+ plugins: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
5019
+ /**
5020
+ * Maximum number of concurrent inference requests to any local model provider
5021
+ * (e.g. Ollama). Defaults to 1 to prevent GPU memory pressure when multiple
5022
+ * T3 workers run in parallel on a single-GPU machine.
5023
+ */
5024
+ localConcurrency: z.ZodDefault<z.ZodNumber>;
5025
+ /**
5026
+ * Timeout in milliseconds for a single local model inference call.
5027
+ * Local models can take minutes for large parameter counts. Default: 5 minutes.
5028
+ */
5029
+ localInferenceTimeoutMs: z.ZodDefault<z.ZodNumber>;
5030
+ /**
5031
+ * Timeout (ms) for a single cloud LLM call (streaming or not). Guards against
5032
+ * a stalled provider stream hanging the whole run with no output. On timeout
5033
+ * the call errors and the worker escalates. Default: 2 minutes.
5034
+ */
5035
+ cloudInferenceTimeoutMs: z.ZodDefault<z.ZodNumber>;
5036
+ /**
5037
+ * Timeout (ms) for a tool-approval decision. If no decision arrives in time the
5038
+ * request is DENIED (never auto-approved) so the run continues rather than
5039
+ * hanging on an unanswered prompt. Default: 10 minutes.
5040
+ */
5041
+ approvalTimeoutMs: z.ZodDefault<z.ZodNumber>;
5042
+ /**
5043
+ * Boardroom plan approval: pause after the plan is produced so the user can
5044
+ * review the org chart (sections, workers, estimated cost) before any worker
5045
+ * spawns. Scope:
5046
+ * 'never' — never pause (default; no behavior change).
5047
+ * 'complex' — pause Complex runs only ('always' is kept as an alias).
5048
+ * 'all' — pause Moderate and Complex runs.
5049
+ * Headless/SDK consumers without a listener auto-approve, so pausing is safe
5050
+ * outside the TUI.
5051
+ */
5052
+ planApproval: z.ZodDefault<z.ZodEnum<["never", "complex", "all", "always"]>>;
5053
+ /**
5054
+ * Plan-review behaviour for the boardroom gate:
5055
+ * autoReviewer — a reviewer model critiques the plan (gaps/risks/cost)
5056
+ * before you see it, and the critique is shown in the dialog.
5057
+ * editable — allow editing the plan (drop sections) in the dialog.
5058
+ * maxRevisionRounds — how many steering-note → re-plan → re-ask rounds the
5059
+ * boardroom allows before proceeding with the last plan.
5060
+ */
5061
+ planReview: z.ZodDefault<z.ZodObject<{
5062
+ autoReviewer: z.ZodDefault<z.ZodBoolean>;
5063
+ editable: z.ZodDefault<z.ZodBoolean>;
5064
+ maxRevisionRounds: z.ZodDefault<z.ZodNumber>;
5065
+ }, "strip", z.ZodTypeAny, {
5066
+ autoReviewer: boolean;
5067
+ editable: boolean;
5068
+ maxRevisionRounds: number;
5069
+ }, {
5070
+ autoReviewer?: boolean | undefined;
5071
+ editable?: boolean | undefined;
5072
+ maxRevisionRounds?: number | undefined;
5073
+ }>>;
5074
+ /**
5075
+ * Autonomy level. 'manual' (default): plan + tool approvals prompt as usual.
5076
+ * 'auto': hands-off — the plan gate auto-approves and the escalator
5077
+ * auto-approves NON-dangerous tools, while dangerous tools still escalate and
5078
+ * budget caps remain the hard stop. Toggle at runtime with /auto.
5079
+ */
5080
+ autonomy: z.ZodDefault<z.ZodEnum<["manual", "auto"]>>;
5081
+ /**
5082
+ * Max corrective re-plan passes T1's reviewer runs before returning the best
5083
+ * partial result. The run also stops early when a pass makes no net progress.
5084
+ */
5085
+ maxReplanPasses: z.ZodDefault<z.ZodNumber>;
5086
+ /**
5087
+ * Reflection / self-critique. When enabled, after a worker's pass/fail self-test
5088
+ * succeeds it runs a goal-alignment critique and revises once if the output is
5089
+ * weak against the broader goal (not just the subtask spec). Off by default — it
5090
+ * adds an LLM call per worker.
5091
+ */
5092
+ reflection: z.ZodDefault<z.ZodObject<{
5093
+ enabled: z.ZodDefault<z.ZodBoolean>;
5094
+ maxRounds: z.ZodDefault<z.ZodNumber>;
5095
+ }, "strip", z.ZodTypeAny, {
5096
+ enabled: boolean;
5097
+ maxRounds: number;
5098
+ }, {
5099
+ enabled?: boolean | undefined;
5100
+ maxRounds?: number | undefined;
5101
+ }>>;
5102
+ /**
5103
+ * T3 worker execution within a dependency wave:
5104
+ * 'auto' (default) — sequential when the T3 tier is a LOCAL model (a single
5105
+ * GPU serializes anyway, so parallel just thrashes the queue), parallel for
5106
+ * cloud models.
5107
+ * 'parallel' / 'sequential' — force it.
5108
+ */
5109
+ t3Execution: z.ZodDefault<z.ZodEnum<["auto", "parallel", "sequential"]>>;
5110
+ /**
5111
+ * Per-path privacy tiers. A subtask touching a `local-only` path is forced
5112
+ * onto LOCAL models (never cloud) and its raw output is withheld from the
5113
+ * tiers above. Patterns use .gitignore syntax, like .cascadeignore.
5114
+ */
5115
+ privacy: z.ZodOptional<z.ZodObject<{
5116
+ paths: z.ZodDefault<z.ZodArray<z.ZodObject<{
5117
+ pattern: z.ZodString;
5118
+ policy: z.ZodEnum<["local-only"]>;
5119
+ }, "strip", z.ZodTypeAny, {
5120
+ pattern: string;
5121
+ policy: "local-only";
5122
+ }, {
5123
+ pattern: string;
5124
+ policy: "local-only";
5125
+ }>, "many">>;
5126
+ }, "strip", z.ZodTypeAny, {
5127
+ paths: {
5128
+ pattern: string;
5129
+ policy: "local-only";
5130
+ }[];
5131
+ }, {
5132
+ paths?: {
5133
+ pattern: string;
5134
+ policy: "local-only";
5135
+ }[] | undefined;
5136
+ }>>;
5137
+ /** Routing controls — forceTier pins the root tier, bypassing the classifier. */
5138
+ routing: z.ZodOptional<z.ZodObject<{
5139
+ forceTier: z.ZodDefault<z.ZodEnum<["auto", "T1", "T2", "T3"]>>;
5140
+ perfStatsPath: z.ZodOptional<z.ZodString>;
5141
+ learnFromOutcomes: z.ZodDefault<z.ZodBoolean>;
5142
+ }, "strip", z.ZodTypeAny, {
5143
+ forceTier: "T1" | "T2" | "T3" | "auto";
5144
+ learnFromOutcomes: boolean;
5145
+ perfStatsPath?: string | undefined;
5146
+ }, {
5147
+ forceTier?: "T1" | "T2" | "T3" | "auto" | undefined;
5148
+ perfStatsPath?: string | undefined;
5149
+ learnFromOutcomes?: boolean | undefined;
5150
+ }>>;
5151
+ /**
5152
+ * T3→T2 reinforcement: when enabled, a worker that discovers its subtask should
5153
+ * fan out can call the `request_workers` tool to have its T2 manager spawn
5154
+ * sibling workers for the new pieces (no 4th tier; bounded). Off by default.
5155
+ */
5156
+ reinforcements: z.ZodDefault<z.ZodObject<{
5157
+ enabled: z.ZodDefault<z.ZodBoolean>;
5158
+ maxPerSection: z.ZodDefault<z.ZodNumber>;
5159
+ }, "strip", z.ZodTypeAny, {
5160
+ enabled: boolean;
5161
+ maxPerSection: number;
5162
+ }, {
5163
+ enabled?: boolean | undefined;
5164
+ maxPerSection?: number | undefined;
5165
+ }>>;
5166
+ /**
5167
+ * Render the TUI in the terminal's alternate screen buffer (like vim).
5168
+ * Flicker-proof and restores the shell on exit, but native scrollback is
5169
+ * unavailable — history scrolls in-app with PgUp/PgDn. Also enabled per
5170
+ * session with the --alt-screen flag. Default: off.
5171
+ */
5172
+ altScreen: z.ZodDefault<z.ZodBoolean>;
5173
+ }, "strip", z.ZodTypeAny, {
5174
+ workspace: {
5175
+ cascadeMdPath: string;
5176
+ configPath: string;
5177
+ keystorePath: string;
5178
+ auditLogPath: string;
5179
+ debugWorldState: boolean;
5180
+ };
5181
+ providers: {
5182
+ type: "anthropic" | "openai" | "gemini" | "azure" | "openai-compatible" | "ollama";
5183
+ region?: string | undefined;
5184
+ baseUrl?: string | undefined;
5185
+ local?: boolean | undefined;
5186
+ label?: string | undefined;
5187
+ apiKey?: string | undefined;
5188
+ deploymentName?: string | undefined;
5189
+ apiVersion?: string | undefined;
5190
+ model?: string | undefined;
5191
+ authToken?: string | undefined;
5192
+ credentialSource?: string | undefined;
5193
+ }[];
5194
+ tools: {
5195
+ shellAllowlist: string[];
5196
+ shellBlocklist: string[];
5197
+ requireApprovalFor: string[];
5198
+ browserEnabled: boolean;
5199
+ dynamicToolSandbox: "auto" | "isolate" | "worker";
5200
+ mcpServers?: {
5201
+ name: string;
5202
+ url?: string | undefined;
5203
+ headers?: Record<string, string> | undefined;
5204
+ command?: string | undefined;
5205
+ args?: string[] | undefined;
5206
+ env?: Record<string, string> | undefined;
5207
+ oauthStore?: string | undefined;
5208
+ }[] | undefined;
5209
+ mcpTrusted?: string[] | undefined;
5210
+ webSearch?: {
5211
+ maxResults: number;
5212
+ searxngUrl?: string | undefined;
5213
+ braveApiKey?: string | undefined;
5214
+ tavilyApiKey?: string | undefined;
5215
+ guardSearxngUrl?: boolean | undefined;
5216
+ } | undefined;
5217
+ enabledTools?: string[] | undefined;
5218
+ disabledTools?: string[] | undefined;
5219
+ };
5220
+ models: {
5221
+ t1?: string | undefined;
5222
+ t2?: string | undefined;
5223
+ t3?: string | undefined;
5224
+ vision?: string | undefined;
5225
+ };
5226
+ version: "1.0";
5227
+ hooks: {
5228
+ preToolUse?: {
5229
+ command: string;
5230
+ timeout?: number | undefined;
5231
+ name?: string | undefined;
5232
+ tools?: string[] | undefined;
5233
+ }[] | undefined;
5234
+ postToolUse?: {
5235
+ command: string;
5236
+ timeout?: number | undefined;
5237
+ name?: string | undefined;
5238
+ tools?: string[] | undefined;
5239
+ }[] | undefined;
5240
+ preTask?: {
5241
+ command: string;
5242
+ timeout?: number | undefined;
5243
+ name?: string | undefined;
5244
+ tools?: string[] | undefined;
5245
+ }[] | undefined;
5246
+ postTask?: {
5247
+ command: string;
5248
+ timeout?: number | undefined;
5249
+ name?: string | undefined;
5250
+ tools?: string[] | undefined;
5251
+ }[] | undefined;
5252
+ };
5253
+ dashboard: {
5254
+ auth: boolean;
5255
+ host: string;
5256
+ port: number;
5257
+ teamMode: "single" | "multi";
5258
+ secret?: string | undefined;
5259
+ };
5260
+ telemetry: {
5261
+ enabled: boolean;
5262
+ posthogApiKey?: string | undefined;
5263
+ distinctId?: string | undefined;
5264
+ };
5265
+ memory: {
5266
+ maxSessionMessages: number;
5267
+ autoSummarizeAt: number;
5268
+ retentionDays: number;
5269
+ rememberSessions: boolean;
5270
+ };
5271
+ tierLimits: {
5272
+ t1MaxTokens?: number | undefined;
5273
+ t2MaxTokens?: number | undefined;
5274
+ t3MaxTokens?: number | undefined;
5275
+ t1Temperature?: number | undefined;
5276
+ t2Temperature?: number | undefined;
5277
+ t3Temperature?: number | undefined;
5278
+ };
5279
+ extendedContext: {
5280
+ enabled: boolean;
5281
+ maxMultiplier: number;
5282
+ };
5283
+ budget: {
5284
+ maxTokensPerRun: number;
5285
+ failureThreshold: number;
5286
+ warnAtPct: number;
5287
+ dailyBudgetUsd?: number | undefined;
5288
+ sessionBudgetUsd?: number | undefined;
5289
+ maxCostPerRunUsd?: number | undefined;
5290
+ };
5291
+ theme: string;
5292
+ cascadeAuto: boolean;
5293
+ autoBias: "balanced" | "quality" | "cost";
5294
+ benchmarks: {
5295
+ live: boolean;
5296
+ pricingLive: boolean;
5297
+ refreshHours: number;
5298
+ sourceUrl?: string | undefined;
5299
+ cacheFile?: string | undefined;
5300
+ };
5301
+ enableToolCreation: boolean;
5302
+ knowledge: {
5303
+ factsExtraction: boolean;
5304
+ };
5305
+ fastAnswer: {
5306
+ autoSimple: boolean;
5307
+ };
5308
+ codeIndex: {
5309
+ enabled: boolean;
5310
+ autoRefresh: boolean;
5311
+ dbPath?: string | undefined;
5312
+ };
5313
+ persistDynamicTools: boolean;
5314
+ plugins: string[];
5315
+ localConcurrency: number;
5316
+ localInferenceTimeoutMs: number;
5317
+ cloudInferenceTimeoutMs: number;
5318
+ approvalTimeoutMs: number;
5319
+ planApproval: "never" | "complex" | "all" | "always";
5320
+ planReview: {
5321
+ autoReviewer: boolean;
5322
+ editable: boolean;
5323
+ maxRevisionRounds: number;
5324
+ };
5325
+ autonomy: "manual" | "auto";
5326
+ maxReplanPasses: number;
5327
+ reflection: {
5328
+ enabled: boolean;
5329
+ maxRounds: number;
5330
+ };
5331
+ t3Execution: "parallel" | "sequential" | "auto";
5332
+ reinforcements: {
5333
+ enabled: boolean;
5334
+ maxPerSection: number;
5335
+ };
5336
+ altScreen: boolean;
5337
+ defaultIdentityId?: string | undefined;
5338
+ rateLimits?: {
5339
+ providerTpm?: Record<string, number> | undefined;
5340
+ } | undefined;
5341
+ privacy?: {
5342
+ paths: {
5343
+ pattern: string;
5344
+ policy: "local-only";
5345
+ }[];
5346
+ } | undefined;
5347
+ routing?: {
5348
+ forceTier: "T1" | "T2" | "T3" | "auto";
5349
+ learnFromOutcomes: boolean;
5350
+ perfStatsPath?: string | undefined;
5351
+ } | undefined;
5352
+ }, {
5353
+ workspace?: {
5354
+ cascadeMdPath?: string | undefined;
5355
+ configPath?: string | undefined;
5356
+ keystorePath?: string | undefined;
5357
+ auditLogPath?: string | undefined;
5358
+ debugWorldState?: boolean | undefined;
5359
+ } | undefined;
5360
+ providers?: {
5361
+ type: "anthropic" | "openai" | "gemini" | "azure" | "openai-compatible" | "ollama";
5362
+ region?: string | undefined;
5363
+ baseUrl?: string | undefined;
5364
+ local?: boolean | undefined;
5365
+ label?: string | undefined;
5366
+ apiKey?: string | undefined;
5367
+ deploymentName?: string | undefined;
5368
+ apiVersion?: string | undefined;
5369
+ model?: string | undefined;
5370
+ authToken?: string | undefined;
5371
+ credentialSource?: string | undefined;
5372
+ }[] | undefined;
5373
+ tools?: {
5374
+ mcpServers?: {
5375
+ name: string;
5376
+ url?: string | undefined;
5377
+ headers?: Record<string, string> | undefined;
5378
+ command?: string | undefined;
5379
+ args?: string[] | undefined;
5380
+ env?: Record<string, string> | undefined;
5381
+ oauthStore?: string | undefined;
5382
+ }[] | undefined;
5383
+ shellAllowlist?: string[] | undefined;
5384
+ shellBlocklist?: string[] | undefined;
5385
+ requireApprovalFor?: string[] | undefined;
5386
+ browserEnabled?: boolean | undefined;
5387
+ mcpTrusted?: string[] | undefined;
5388
+ webSearch?: {
5389
+ searxngUrl?: string | undefined;
5390
+ braveApiKey?: string | undefined;
5391
+ tavilyApiKey?: string | undefined;
5392
+ maxResults?: number | undefined;
5393
+ guardSearxngUrl?: boolean | undefined;
5394
+ } | undefined;
5395
+ dynamicToolSandbox?: "auto" | "isolate" | "worker" | undefined;
5396
+ enabledTools?: string[] | undefined;
5397
+ disabledTools?: string[] | undefined;
5398
+ } | undefined;
5399
+ models?: {
5400
+ t1?: string | undefined;
5401
+ t2?: string | undefined;
5402
+ t3?: string | undefined;
5403
+ vision?: string | undefined;
5404
+ } | undefined;
5405
+ version?: "1.0" | undefined;
5406
+ defaultIdentityId?: string | undefined;
5407
+ hooks?: {
5408
+ preToolUse?: {
5409
+ command: string;
5410
+ timeout?: number | undefined;
5411
+ name?: string | undefined;
5412
+ tools?: string[] | undefined;
5413
+ }[] | undefined;
5414
+ postToolUse?: {
5415
+ command: string;
5416
+ timeout?: number | undefined;
5417
+ name?: string | undefined;
5418
+ tools?: string[] | undefined;
5419
+ }[] | undefined;
5420
+ preTask?: {
5421
+ command: string;
5422
+ timeout?: number | undefined;
5423
+ name?: string | undefined;
5424
+ tools?: string[] | undefined;
5425
+ }[] | undefined;
5426
+ postTask?: {
5427
+ command: string;
5428
+ timeout?: number | undefined;
5429
+ name?: string | undefined;
5430
+ tools?: string[] | undefined;
5431
+ }[] | undefined;
5432
+ } | undefined;
5433
+ dashboard?: {
5434
+ auth?: boolean | undefined;
5435
+ host?: string | undefined;
5436
+ port?: number | undefined;
5437
+ teamMode?: "single" | "multi" | undefined;
5438
+ secret?: string | undefined;
5439
+ } | undefined;
5440
+ telemetry?: {
5441
+ enabled?: boolean | undefined;
5442
+ posthogApiKey?: string | undefined;
5443
+ distinctId?: string | undefined;
5444
+ } | undefined;
5445
+ memory?: {
5446
+ maxSessionMessages?: number | undefined;
5447
+ autoSummarizeAt?: number | undefined;
5448
+ retentionDays?: number | undefined;
5449
+ rememberSessions?: boolean | undefined;
5450
+ } | undefined;
5451
+ tierLimits?: {
5452
+ t1MaxTokens?: number | undefined;
5453
+ t2MaxTokens?: number | undefined;
5454
+ t3MaxTokens?: number | undefined;
5455
+ t1Temperature?: number | undefined;
5456
+ t2Temperature?: number | undefined;
5457
+ t3Temperature?: number | undefined;
5458
+ } | undefined;
5459
+ extendedContext?: {
5460
+ enabled?: boolean | undefined;
5461
+ maxMultiplier?: number | undefined;
5462
+ } | undefined;
5463
+ budget?: {
5464
+ dailyBudgetUsd?: number | undefined;
5465
+ sessionBudgetUsd?: number | undefined;
5466
+ maxTokensPerRun?: number | undefined;
5467
+ maxCostPerRunUsd?: number | undefined;
5468
+ failureThreshold?: number | undefined;
5469
+ warnAtPct?: number | undefined;
5470
+ } | undefined;
5471
+ theme?: string | undefined;
5472
+ rateLimits?: {
5473
+ providerTpm?: Record<string, number> | undefined;
5474
+ } | undefined;
5475
+ cascadeAuto?: boolean | undefined;
5476
+ autoBias?: "balanced" | "quality" | "cost" | undefined;
5477
+ benchmarks?: {
5478
+ live?: boolean | undefined;
5479
+ sourceUrl?: string | undefined;
5480
+ pricingLive?: boolean | undefined;
5481
+ refreshHours?: number | undefined;
5482
+ cacheFile?: string | undefined;
5483
+ } | undefined;
5484
+ enableToolCreation?: boolean | undefined;
5485
+ knowledge?: {
5486
+ factsExtraction?: boolean | undefined;
5487
+ } | undefined;
5488
+ fastAnswer?: {
5489
+ autoSimple?: boolean | undefined;
5490
+ } | undefined;
5491
+ codeIndex?: {
5492
+ enabled?: boolean | undefined;
5493
+ autoRefresh?: boolean | undefined;
5494
+ dbPath?: string | undefined;
5495
+ } | undefined;
5496
+ persistDynamicTools?: boolean | undefined;
5497
+ plugins?: string[] | undefined;
5498
+ localConcurrency?: number | undefined;
5499
+ localInferenceTimeoutMs?: number | undefined;
5500
+ cloudInferenceTimeoutMs?: number | undefined;
5501
+ approvalTimeoutMs?: number | undefined;
5502
+ planApproval?: "never" | "complex" | "all" | "always" | undefined;
5503
+ planReview?: {
5504
+ autoReviewer?: boolean | undefined;
5505
+ editable?: boolean | undefined;
5506
+ maxRevisionRounds?: number | undefined;
5507
+ } | undefined;
5508
+ autonomy?: "manual" | "auto" | undefined;
5509
+ maxReplanPasses?: number | undefined;
5510
+ reflection?: {
5511
+ enabled?: boolean | undefined;
5512
+ maxRounds?: number | undefined;
5513
+ } | undefined;
5514
+ t3Execution?: "parallel" | "sequential" | "auto" | undefined;
5515
+ privacy?: {
5516
+ paths?: {
5517
+ pattern: string;
5518
+ policy: "local-only";
5519
+ }[] | undefined;
5520
+ } | undefined;
5521
+ routing?: {
5522
+ forceTier?: "T1" | "T2" | "T3" | "auto" | undefined;
5523
+ perfStatsPath?: string | undefined;
5524
+ learnFromOutcomes?: boolean | undefined;
5525
+ } | undefined;
5526
+ reinforcements?: {
5527
+ enabled?: boolean | undefined;
5528
+ maxPerSection?: number | undefined;
5529
+ } | undefined;
5530
+ altScreen?: boolean | undefined;
5531
+ }>;
5532
+
4395
5533
  /** A provider row, as every settings surface manipulates it. */
4396
5534
  interface WritableProvider {
4397
5535
  type: string;
@@ -6206,23 +7344,8 @@ declare class CascadeToolError extends Error {
6206
7344
  constructor(userMessage: string, cause?: unknown, retryable?: boolean);
6207
7345
  }
6208
7346
 
6209
- /** Selectable base models, in the order a picker should show them. */
6210
7347
  declare const AZURE_BASE_MODELS: readonly string[];
6211
7348
  declare function inferAzureBaseModel(deploymentName: string): string | null;
6212
- /**
6213
- * The ModelInfo for one configured Azure deployment. On Azure the deployment IS
6214
- * the model (you address it by deployment name, and which base model backs it is
6215
- * opaque to the API) — so each `providers[]` entry with a deploymentName becomes
6216
- * one selectable model.
6217
- *
6218
- * Which base model it serves drives correct benchmark scoring + pricing, so we
6219
- * resolve it: an explicit `cfg.model` (user override) wins, else we infer it from
6220
- * the deployment name. When resolved to a known catalog model, this deployment
6221
- * INHERITS that model's real economics (context window, pricing, vision, output
6222
- * cap) while keeping the deployment name as its callable `id` and carrying the
6223
- * base identity in `baseModelId`. Unresolved deployments fall back to neutral
6224
- * GPT-4o-class defaults (an estimate, not $0), exactly as before.
6225
- */
6226
7349
  declare function azureModelForDeployment(cfg: ProviderConfig): ModelInfo | null;
6227
7350
 
6228
7351
  interface CloudUser {
@@ -6456,4 +7579,4 @@ declare function gatherSyncBundle(config: CascadeConfig): SyncBundle;
6456
7579
  /** Merge a pulled bundle into a config, returning the updated config to persist. */
6457
7580
  declare function applySyncBundle(bundle: SyncBundle, config: CascadeConfig, cleanup?: RetiredProviderCleanup): CascadeConfig;
6458
7581
 
6459
- export { AZURE_BASE_MODELS, AZURE_BASE_URL_TEMPLATE, type AcceptanceOptions, type AcceptanceProbe, type AcceptanceResult, type AcceptanceVerdict, type ApprovalRequest, type ApprovalResponse, type AuditEntry, AuditLogger, type AzureDeploymentInput, type BenchmarksConfig, type Block, 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, CHARS_PER_TOKEN, COMPLEXITY_T2_COUNT, Cascade, CascadeCancelledError, type CascadeConfig, type CascadeEvent, type CascadeEventType, CascadeIgnore, type CascadeMessage, CascadeRouter, type CascadeRunOptions, type CascadeRunResult, type CascadeThemeName, CascadeToolError, type ChartSeries, type ChartSpec, type Chunk, type ChunkOptions, CloudClient, type CloudConversation, type CloudMessage, type CloudSession, type CloudSessionStore, type CloudTurnInput, type CloudUser, type CodeChunkOptions, type CodeChunker, CodeSearchTool, type CompileTaskGraphOptions, type CompiledTaskGraph, type CompleteFn, type CompletedNode, ConfigManager, type ConversationMessage, type CredentialDisposition, type CredentialEndpoint, type CredentialWriteOutcome, type CurrentPageProvider, type CurrentPageSnapshot, CurrentPageTool, DEFAULT_API_PORT, DEFAULT_APPROVAL_REQUIRED, DEFAULT_AUTO_SUMMARIZE_AT, DEFAULT_CLOUD_URL, DEFAULT_CONTEXT_LIMIT, DEFAULT_DASHBOARD_PORT, DEFAULT_MAX_SESSION_MESSAGES, DEFAULT_RETENTION_DAYS, DEFAULT_THEME, DOCUMENT_MIME, type DashboardConfig, DashboardServer, DependencyScheduler, type DeviceStart, type DiscoveredMcpTool, type DistilledFact, type ChartKind as DocumentChartKind, type DocumentFormat, type Embedder, type EncryptedBlob, type EscalationDecision, type EscalationPayload, type ExtendedContextConfig, type FileManifest, FileMcpOAuthStore, GLOBAL_CONFIG_DIR, GLOBAL_CREDENTIALS_FILE, GLOBAL_DB_FILE, GLOBAL_KEYSTORE_FILE, GLOBAL_RUNTIME_DB_FILE, GenerateDocumentTool, type GenerateOptions, type GenerateResult, type GraphFactSource, GraphRetriever, type GraphSearchOptions, GraphSearchTool, type HookDefinition, type HooksConfig, HooksRunner, type Identity, type ImageAttachment, type ImageByteLoader, type ImageInfo, type ImageRef, type InlineRun, Keystore, LLMReranker, LM_STUDIO_BASE_URL, type LegacyThemeName, type LoadedImage, MAX_PAGE_TEXT_CHARS, MCP_TOOL_PREFIX, MODELS, type ManifestDiff, McpClient, type McpDiscoveryResult, McpOAuthProvider, type McpOAuthState, type McpOAuthStore, type McpServerConfig$1 as McpServerConfig, type McpServerRename, type MemoryConfig, MemoryStore, type Message, type MessageContent, type MessagePayload, type MessageStatus, type MessageType, type ModelInfo, type ModelOverrides, type NativeProvider, OLLAMA_BASE_URL, OpenAICompatibleEmbedder, type OpenAIEmbedderOptions, PROVIDER_DISPLAY_NAMES, type PeerMessage, type PeerMessageEvent, type PeerSyncPayload, type PeerSyncType, type PermissionDecision, type PermissionDecisionPayload, type PermissionRequest, type PermissionTrailEntry, type PlanReviewConfig, type ProviderConfig, type ProviderType, RESUME_SCHEMA_VERSION, type RankedFact, type RefreshResult, type RenderOptions, type Reranker, type ResumeCheckpoint, type ResumeReason, ResumeStore, type ResumeStoreOptions, type RetrievalContext, type RetrievalMode, type RetrievalPlan, Retriever, type RetrieverSearchOptions, type RuntimeNode, type RuntimeNodeLog, type RuntimeRefreshPayload, type RuntimeScope, type RuntimeSession, type RuntimeSnapshotPayload, type ScheduledTask, type SchedulerExecutionMode, type SchedulerHooks, type SchedulerOptions, type SchedulerResult, type ScoredChunk, type SearchOptions, type Session, type SessionCheckpoint, type SessionMetadata, type SessionSubscriptionPayload, type SettingsCommitResult, type SettingsCredentialResult, type SettingsPayload, type SettingsSnapshot, type Slide, SqliteVectorStore, type StatusUpdate, type StoredMessage, type StreamChunk, type SyncBundle, 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, type TaskGraph, type TaskGraphInputNode, type TaskGraphIssue, type TaskGraphIssueCode, type TaskGraphNode, type TaskGraphNodeKind, TaskGraphValidationError, type TaskGraphValidationMode, TaskScheduler, type TaskType, 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 VectorStore, type WebSearchConfig, type WebhookConfig, type WorkspaceConfig, type WorkspaceFileReader, WorkspaceIndex, type WorkspaceIndexOptions, applyEndpointEdit, applyProviderApiKey, applyProviderCredential, applySettingsCredentials, applySettingsPayload, applySyncBundle, azureModelForDeployment, beginMcpOAuth, buildDocumentTools, buildManifest, buildSessionTranscript, bytesToBase64, cagCharBudget, chartKind, chartToTableRows, chatCompleterFromProviders, chunkCode, chunkText, commitSettings, compileSectionGraph, compileSubtaskGraph, compileTaskGraph, completeMcpOAuth, connectMcpWithLoopbackOAuth, createCascade, credentialDispositionForEdit, credentialEndpointIdentity, decryptJSON as decryptSyncBlob, diffManifest, disambiguateMcpServerNames, discoverMcpAuthServer, discoverMcpTools, distillSessionFacts, embedderFromProviders, encryptJSON as encryptSyncBlob, endpointFromSettingsPayload, evaluateAcceptance, explainRefusal, extractCharts, failures, fileExt, fileOAuthProvider, gatherSyncBundle, hasDefaultEndpoint, hasProviderCredential, hasUsableProvider, hashContent, heuristicCodeChunker, inferAzureBaseModel, inlineRuns, isDocumentFormat, isMcpToolName, matchImageLine, mcpServerPrefix, mcpToolName, nodeHttpFetch, normalizeEndpoint, parseBlocks, parseChartSpec, parseDelimited, parseRankOrder, parseSlide, planRetrieval, preferIpv4Host, priorAzureRow, reciprocalRankFusion, refreshMcpToken, removeMcpServerDenials, renderDocument, renderDocx, renderPptx, renderXlsx, runCascade, sameAzureEndpoint, sameCredentialEndpoint, sameEndpoint, sessionWorthRemembering, settingsSnapshot, sniffImage, splitSlides, streamCascade, stripInline, summarizeCompleted, undecided, uniqueMcpServerName };
7582
+ export { AZURE_BASE_MODELS, AZURE_BASE_URL_TEMPLATE, type AcceptanceOptions, type AcceptanceProbe, type AcceptanceResult, type AcceptanceVerdict, type ApprovalRequest, type ApprovalResponse, type AuditEntry, AuditLogger, type AzureDeploymentInput, type BenchmarksConfig, type Block, 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, CHARS_PER_TOKEN, COMPLEXITY_T2_COUNT, Cascade, CascadeCancelledError, type CascadeConfig, CascadeConfigSchema, type CascadeEvent, type CascadeEventType, CascadeIgnore, type CascadeMessage, CascadeRouter, type CascadeRunOptions, type CascadeRunResult, type CascadeThemeName, CascadeToolError, type ChartSeries, type ChartSpec, type Chunk, type ChunkOptions, CloudClient, type CloudConversation, type CloudMessage, type CloudSession, type CloudSessionStore, type CloudTurnInput, type CloudUser, type CodeChunkOptions, type CodeChunker, CodeSearchTool, type CompileTaskGraphOptions, type CompiledTaskGraph, type CompleteFn, type CompletedNode, ConfigManager, type ConversationMessage, type CredentialDisposition, type CredentialEndpoint, type CredentialWriteOutcome, type CurrentPageProvider, type CurrentPageSnapshot, CurrentPageTool, DEFAULT_API_PORT, DEFAULT_APPROVAL_REQUIRED, DEFAULT_AUTO_SUMMARIZE_AT, DEFAULT_CLOUD_URL, DEFAULT_CONTEXT_LIMIT, DEFAULT_DASHBOARD_PORT, DEFAULT_MAX_SESSION_MESSAGES, DEFAULT_RETENTION_DAYS, DEFAULT_THEME, DOCUMENT_MIME, type DashboardConfig, DashboardServer, DependencyScheduler, type DeviceStart, type DiscoveredMcpTool, type DistilledFact, type ChartKind as DocumentChartKind, type DocumentFormat, type Embedder, type EncryptedBlob, type EscalationDecision, type EscalationPayload, type ExtendedContextConfig, type FileManifest, FileMcpOAuthStore, GLOBAL_CONFIG_DIR, GLOBAL_CREDENTIALS_FILE, GLOBAL_DB_FILE, GLOBAL_KEYSTORE_FILE, GLOBAL_RUNTIME_DB_FILE, GenerateDocumentTool, type GenerateOptions, type GenerateResult, type GraphFactSource, GraphRetriever, type GraphSearchOptions, GraphSearchTool, type HookDefinition, type HooksConfig, HooksRunner, type Identity, type ImageAttachment, type ImageByteLoader, type ImageInfo, type ImageRef, type InlineRun, Keystore, LLMReranker, LM_STUDIO_BASE_URL, type LegacyThemeName, type LoadedImage, MAX_PAGE_TEXT_CHARS, MCP_TOOL_PREFIX, MODELS, type ManifestDiff, McpClient, type McpDiscoveryResult, McpOAuthProvider, type McpOAuthState, type McpOAuthStore, type McpServerConfig$1 as McpServerConfig, type McpServerRename, type MemoryConfig, MemoryStore, type Message, type MessageContent, type MessagePayload, type MessageStatus, type MessageType, type ModelInfo, type ModelOverrides, type NativeProvider, OLLAMA_BASE_URL, OpenAICompatibleEmbedder, type OpenAIEmbedderOptions, PROVIDER_DISPLAY_NAMES, type PeerMessage, type PeerMessageEvent, type PeerSyncPayload, type PeerSyncType, type PermissionDecision, type PermissionDecisionPayload, type PermissionRequest, type PermissionTrailEntry, type PlanReviewConfig, type ProviderConfig, type ProviderType, RESUME_SCHEMA_VERSION, type RankedFact, type RefreshResult, type RenderOptions, type Reranker, type ResumeCheckpoint, type ResumeReason, ResumeStore, type ResumeStoreOptions, type RetrievalContext, type RetrievalMode, type RetrievalPlan, Retriever, type RetrieverSearchOptions, type RuntimeNode, type RuntimeNodeLog, type RuntimeRefreshPayload, type RuntimeScope, type RuntimeSession, type RuntimeSnapshotPayload, type ScheduledTask, type SchedulerExecutionMode, type SchedulerHooks, type SchedulerOptions, type SchedulerResult, type ScoredChunk, type SearchOptions, type Session, type SessionCheckpoint, type SessionMetadata, type SessionSubscriptionPayload, type SettingsCommitResult, type SettingsCredentialResult, type SettingsPayload, type SettingsSnapshot, type Slide, SqliteVectorStore, type StatusUpdate, type StoredMessage, type StreamChunk, type SyncBundle, 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, type TaskGraph, type TaskGraphInputNode, type TaskGraphIssue, type TaskGraphIssueCode, type TaskGraphNode, type TaskGraphNodeKind, TaskGraphValidationError, type TaskGraphValidationMode, TaskScheduler, type TaskType, 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 VectorStore, type WebSearchConfig, type WebhookConfig, type WorkspaceConfig, type WorkspaceFileReader, WorkspaceIndex, type WorkspaceIndexOptions, applyEndpointEdit, applyProviderApiKey, applyProviderCredential, applySettingsCredentials, applySettingsPayload, applySyncBundle, azureModelForDeployment, beginMcpOAuth, buildDocumentTools, buildManifest, buildSessionTranscript, bytesToBase64, cagCharBudget, chartKind, chartToTableRows, chatCompleterFromProviders, chunkCode, chunkText, commitSettings, compileSectionGraph, compileSubtaskGraph, compileTaskGraph, completeMcpOAuth, connectMcpWithLoopbackOAuth, createCascade, credentialDispositionForEdit, credentialEndpointIdentity, decryptJSON as decryptSyncBlob, diffManifest, disambiguateMcpServerNames, discoverMcpAuthServer, discoverMcpTools, distillSessionFacts, embedderFromProviders, encryptJSON as encryptSyncBlob, endpointFromSettingsPayload, evaluateAcceptance, explainRefusal, extractCharts, failures, fileExt, fileOAuthProvider, gatherSyncBundle, hasDefaultEndpoint, hasProviderCredential, hasUsableProvider, hashContent, heuristicCodeChunker, inferAzureBaseModel, inlineRuns, isDocumentFormat, isMcpToolName, matchImageLine, mcpServerPrefix, mcpToolName, nodeHttpFetch, normalizeEndpoint, parseBlocks, parseChartSpec, parseDelimited, parseRankOrder, parseSlide, planRetrieval, preferIpv4Host, priorAzureRow, reciprocalRankFusion, refreshMcpToken, removeMcpServerDenials, renderDocument, renderDocx, renderPptx, renderXlsx, runCascade, sameAzureEndpoint, sameCredentialEndpoint, sameEndpoint, sessionWorthRemembering, settingsSnapshot, sniffImage, splitSlides, streamCascade, stripInline, summarizeCompleted, undecided, uniqueMcpServerName };