@ordewell/core 0.10.2 → 0.10.4
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/{IFileSystem-CyTIoiSn.d.ts → IFileSystem-_effm8-b.d.ts} +1 -1
- package/dist/{IFileSystem-j0naIoAQ.d.mts → IFileSystem-vyqMdL-x.d.mts} +1 -1
- package/dist/{IRunner---PfQVdc.d.mts → IRunner-D_UkkMbJ.d.ts} +202 -196
- package/dist/{IRunner-WwL-Bjqq.d.ts → IRunner-NtTHQgLR.d.mts} +202 -196
- package/dist/{ModeResolver-DrMU-5lw.d.ts → ModeResolver-Dy3Ef6p-.d.ts} +1 -1
- package/dist/{ModeResolver-CjQ7zqTN.d.mts → ModeResolver-wnTFsDnF.d.mts} +1 -1
- package/dist/{Task-AfA1m4qW.d.mts → Task-DZs9eKgg.d.mts} +25 -6
- package/dist/{Task-AfA1m4qW.d.ts → Task-DZs9eKgg.d.ts} +25 -6
- package/dist/{chunk-4FEARWTS.mjs → chunk-645FALZX.mjs} +5 -5
- package/dist/chunk-645FALZX.mjs.map +1 -0
- package/dist/{chunk-3LNZDBCX.mjs → chunk-A57ITQE7.mjs} +35 -16
- package/dist/chunk-A57ITQE7.mjs.map +1 -0
- package/dist/{chunk-UQGR3UCA.mjs → chunk-FH6M5QZG.mjs} +136 -122
- package/dist/chunk-FH6M5QZG.mjs.map +1 -0
- package/dist/{chunk-CIL3BQIF.mjs → chunk-SM6BV6XS.mjs} +17 -3
- package/dist/chunk-SM6BV6XS.mjs.map +1 -0
- package/dist/index.d.mts +427 -40
- package/dist/index.d.ts +427 -40
- package/dist/index.js +2589 -1498
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10799 -9764
- package/dist/index.mjs.map +1 -1
- package/dist/parsing.d.mts +2 -2
- package/dist/parsing.d.ts +2 -2
- package/dist/parsing.js +12 -12
- package/dist/parsing.js.map +1 -1
- package/dist/parsing.mjs +3 -3
- package/dist/{plan-utils-DL7yOuJs.d.mts → plan-utils-CtKceSsQ.d.mts} +1292 -1147
- package/dist/{plan-utils-gpeqV-Lp.d.ts → plan-utils-POIz5d8z.d.ts} +1292 -1147
- package/dist/plan-utils.d.mts +4 -4
- package/dist/plan-utils.d.ts +4 -4
- package/dist/plan-utils.js +16 -0
- package/dist/plan-utils.js.map +1 -1
- package/dist/plan-utils.mjs +7 -3
- package/dist/testing.d.mts +3 -3
- package/dist/testing.d.ts +3 -3
- package/dist/testing.js +3 -1
- package/dist/testing.js.map +1 -1
- package/dist/testing.mjs +4 -2
- package/dist/testing.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-3LNZDBCX.mjs.map +0 -1
- package/dist/chunk-4FEARWTS.mjs.map +0 -1
- package/dist/chunk-CIL3BQIF.mjs.map +0 -1
- package/dist/chunk-UQGR3UCA.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChildProcess } from 'child_process';
|
|
2
|
-
import {
|
|
2
|
+
import { a2 as RunnerId, ar as UsageRecord, ad as SubagentOutcome, d as DiscoveredModel, am as TaskSkillSnapshot } from './Task-DZs9eKgg.js';
|
|
3
3
|
import { z } from 'zod/v4';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -463,6 +463,198 @@ interface IApproval {
|
|
|
463
463
|
/** Denies everything. The safe default when a surface wires no approval channel. */
|
|
464
464
|
declare const DENY_ALL: IApproval;
|
|
465
465
|
|
|
466
|
+
interface CatalogModel {
|
|
467
|
+
id: string;
|
|
468
|
+
name: string;
|
|
469
|
+
description: string;
|
|
470
|
+
pricing: {
|
|
471
|
+
prompt: string;
|
|
472
|
+
completion: string;
|
|
473
|
+
};
|
|
474
|
+
contextLength: number;
|
|
475
|
+
}
|
|
476
|
+
declare class ModelCatalog {
|
|
477
|
+
static fetchModels(apiKey: string, baseUrl?: string, fetchImpl?: typeof fetch): Promise<CatalogModel[]>;
|
|
478
|
+
/**
|
|
479
|
+
* Delete the on-disk catalog cache for a base URL so the next fetch re-runs.
|
|
480
|
+
* Used by the resolver's `invalidate()` in production (no injected fetch);
|
|
481
|
+
* best-effort — a missing file or unreadable dir is a no-op.
|
|
482
|
+
*/
|
|
483
|
+
static clearCache(baseUrl?: string): void;
|
|
484
|
+
private static readCache;
|
|
485
|
+
private static writeCache;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
interface ModelShortcut {
|
|
489
|
+
label: string;
|
|
490
|
+
id: string;
|
|
491
|
+
provider: string;
|
|
492
|
+
description: string;
|
|
493
|
+
pricing?: string;
|
|
494
|
+
}
|
|
495
|
+
declare const ORCHESTRATOR_SHORTCUTS: ModelShortcut[];
|
|
496
|
+
declare function resolveModelShortcut(input: string, shortcuts: ModelShortcut[]): string | null;
|
|
497
|
+
/**
|
|
498
|
+
* Resolves a value to a model id ONLY when it is in the supplied catalog
|
|
499
|
+
* option list — either directly or via a shortcut label. Free-typed, unknown,
|
|
500
|
+
* or not-currently-available values return null, so callers never store an id
|
|
501
|
+
* the user couldn't have selected from the list. Keeps model-setting list-only.
|
|
502
|
+
*/
|
|
503
|
+
declare function knownModelId(value: string, optionIds: string[], shortcuts: ModelShortcut[]): string | null;
|
|
504
|
+
|
|
505
|
+
type ProviderModelLists = Record<string, string[]>;
|
|
506
|
+
interface OrchestratorOption {
|
|
507
|
+
id: string;
|
|
508
|
+
label: string;
|
|
509
|
+
provider: string;
|
|
510
|
+
apiProvider: AiProvider;
|
|
511
|
+
description?: string;
|
|
512
|
+
pricing?: string;
|
|
513
|
+
/** The model's context window when the catalog reports one (#49). */
|
|
514
|
+
contextWindow?: number;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
interface FetchAllProviderModelsOptions {
|
|
518
|
+
apiKeys: Record<string, string>;
|
|
519
|
+
baseUrls: Record<string, string>;
|
|
520
|
+
fetchImpl?: typeof fetch;
|
|
521
|
+
}
|
|
522
|
+
type AllProviderModels = Record<string, CatalogModel[]>;
|
|
523
|
+
/**
|
|
524
|
+
* Result of a picker-catalog fetch fan-out: the per-provider model lists plus
|
|
525
|
+
* the per-provider failures. `errors` is keyed by provider id and holds the
|
|
526
|
+
* failure message for any provider whose catalog fetch rejected — the seam the
|
|
527
|
+
* surfaces (CLI, VS Code) use to flag "this configured provider didn't work"
|
|
528
|
+
* rather than silently showing a short list.
|
|
529
|
+
*/
|
|
530
|
+
interface ProviderModelsResult {
|
|
531
|
+
models: AllProviderModels;
|
|
532
|
+
errors: Record<string, string>;
|
|
533
|
+
}
|
|
534
|
+
/** The provider config fields the discovery fan-out needs. */
|
|
535
|
+
interface ProviderCredentialSource {
|
|
536
|
+
getProviderApiKey(provider: AiProvider): string;
|
|
537
|
+
getProviderBaseUrl(provider: AiProvider): string;
|
|
538
|
+
openaiCompatibleBaseUrl: string;
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* Collect the API keys and base URLs the picker fan-out should probe, applying
|
|
542
|
+
* the single "configured" policy shared by every surface (CLI + VS Code):
|
|
543
|
+
* - a preset is discovered only when it has an API key (OpenRouter included —
|
|
544
|
+
* its public catalog is not probed keyless, matching the product rule that
|
|
545
|
+
* only key-configured providers appear);
|
|
546
|
+
* - `openai_compatible` is discovered only when an explicit endpoint is set
|
|
547
|
+
* (keyless local servers like ollama / LM Studio).
|
|
548
|
+
* Base URLs are handed through only for providers that pass the gate, so the
|
|
549
|
+
* fan-out never touches an unconfigured third-party endpoint.
|
|
550
|
+
*/
|
|
551
|
+
declare function collectProviderCredentials(config: ProviderCredentialSource): {
|
|
552
|
+
apiKeys: Record<string, string>;
|
|
553
|
+
baseUrls: Record<string, string>;
|
|
554
|
+
};
|
|
555
|
+
declare function fetchAllProviderModels(opts: FetchAllProviderModelsOptions): Promise<ProviderModelsResult>;
|
|
556
|
+
declare function resolveProvider(modelId: string, providerModelLists: Record<string, string[]>): AiProvider | null;
|
|
557
|
+
declare function toOrchestratorOptions(providerModels: AllProviderModels, shortcuts: ModelShortcut[]): OrchestratorOption[];
|
|
558
|
+
|
|
559
|
+
/** An LLM vendor reached over HTTP. A closed set: each one has its own registration in `ProviderRegistry`. */
|
|
560
|
+
type AiProvider = 'google' | 'openrouter' | 'openai_compatible' | 'openai' | 'xai' | 'groq' | 'deepseek' | 'together' | 'mistral' | 'anthropic' | 'fireworks' | 'perplexity' | 'zhipu' | 'kimi' | 'cerebras' | 'deepinfra' | 'doubao' | 'qwen' | 'hunyuan' | 'baichuan' | 'minimax' | 'yi' | 'stepfun' | 'siliconflow' | 'cohere' | 'novita';
|
|
561
|
+
/**
|
|
562
|
+
* Who plans: an API vendor, or the id of a runner serving as a *harness
|
|
563
|
+
* planner* (ADR-0009) — a coding agent CLI already installed on the machine,
|
|
564
|
+
* driven as the planner over its own programmatic transport and authenticated
|
|
565
|
+
* by the subscription the user already holds. Runners sit in the provider axis
|
|
566
|
+
* deliberately: "what plans for me?" is one question, and it belongs in one
|
|
567
|
+
* setting. The runner half is open — any built-in runner with a connector can
|
|
568
|
+
* plan — so it is checked against the registry, not by the type:
|
|
569
|
+
* `isApiProvider` narrows to a vendor, `isCliProvider` tells a harness planner.
|
|
570
|
+
*/
|
|
571
|
+
type PlannerBackendId = AiProvider | RunnerId;
|
|
572
|
+
interface IConfig {
|
|
573
|
+
aiProvider: PlannerBackendId;
|
|
574
|
+
apiKey: string;
|
|
575
|
+
planningModel: string;
|
|
576
|
+
enabledRunners: string[];
|
|
577
|
+
maxParallelSessions: number;
|
|
578
|
+
researchEnabled: boolean;
|
|
579
|
+
researchMaxSteps: number;
|
|
580
|
+
researchMaxFileSize: number;
|
|
581
|
+
openAiBaseUrl: string;
|
|
582
|
+
openAiApiKey: string;
|
|
583
|
+
/** Provider keys + base URL the ModelResolver uses to fetch the picker catalogs. */
|
|
584
|
+
openrouterKey: string;
|
|
585
|
+
geminiKey: string;
|
|
586
|
+
geminiBaseUrl?: string;
|
|
587
|
+
/** Base URL + API key for a user-provided OpenAI-compatible endpoint (ollama, vLLM, LM Studio, etc.). */
|
|
588
|
+
openaiCompatibleBaseUrl: string;
|
|
589
|
+
openaiCompatibleApiKey: string;
|
|
590
|
+
orchestratorModel: string;
|
|
591
|
+
geminiModel: string;
|
|
592
|
+
/** Model for research subagents (issue #34); defaults to the (cheap) planner model. */
|
|
593
|
+
researchSubagentModel: string;
|
|
594
|
+
/**
|
|
595
|
+
* Thinking effort / model variant for a harness planner (ADR-0009), chosen
|
|
596
|
+
* from the agent's own discovered variants. Separate from the per-task
|
|
597
|
+
* efforts the plan carries — this one is the planner's own dial.
|
|
598
|
+
*/
|
|
599
|
+
plannerThinkingEffort?: string;
|
|
600
|
+
planMapEnabled: boolean;
|
|
601
|
+
autonomousMode: boolean;
|
|
602
|
+
/**
|
|
603
|
+
* Run each AI task in its own git worktree and integrate the results on a
|
|
604
|
+
* per-run branch (ADR-0013). Non-git workspaces fall back to the shared
|
|
605
|
+
* workspace root regardless of this flag.
|
|
606
|
+
*/
|
|
607
|
+
worktreeIsolation: boolean;
|
|
608
|
+
/**
|
|
609
|
+
* Shell command run in a fresh task worktree instead of symlinking ignored
|
|
610
|
+
* artifacts from the main worktree — for repos where sharing `node_modules`
|
|
611
|
+
* or a virtualenv is wrong.
|
|
612
|
+
*/
|
|
613
|
+
worktreeSetupCommand?: string;
|
|
614
|
+
/**
|
|
615
|
+
* Repositories of the repo group listed by hand, relative to the workspace
|
|
616
|
+
* (ADR-0014). When non-empty the group is exactly these, replacing the
|
|
617
|
+
* repositories auto-detected directly inside the folder; needed for ones
|
|
618
|
+
* deeper than that, which are never auto-detected.
|
|
619
|
+
*/
|
|
620
|
+
workspaceRepos: string[];
|
|
621
|
+
/**
|
|
622
|
+
* Extra paths or globs, relative to each repo root, linked from the real repo
|
|
623
|
+
* into its task worktree where they exist — gitignored local state such as
|
|
624
|
+
* `*.tfstate` that a task must use, not a copy of.
|
|
625
|
+
*/
|
|
626
|
+
worktreeLinks: string[];
|
|
627
|
+
/**
|
|
628
|
+
* How many conflict repairs one task may go through before its conflict is
|
|
629
|
+
* left for a person (ADR-0015); 0 turns repair off.
|
|
630
|
+
*/
|
|
631
|
+
conflictRepairAttempts: number;
|
|
632
|
+
/**
|
|
633
|
+
* What to do when planner research reaches outside its default envelope — an
|
|
634
|
+
* out-of-workspace path, a shell command beyond the auto-allowed read-only
|
|
635
|
+
* set, an MCP tool. `ask` prompts the user (and denies where no surface can
|
|
636
|
+
* prompt, such as headless runs); `allow` and `deny` skip the prompt
|
|
637
|
+
* entirely; `auto` follows {@link autonomousMode} (ADR-0026).
|
|
638
|
+
*/
|
|
639
|
+
approvalMode: ApprovalModeSetting;
|
|
640
|
+
/** Allowlist entries granted up front, beside the defaults (ADR-0026, `plannerAllowlist.ts`). */
|
|
641
|
+
approvalPreApproved: string[];
|
|
642
|
+
/** Whether the built-in allowlist of read-only command families and MCP tools applies. */
|
|
643
|
+
approvalDefaults: boolean;
|
|
644
|
+
/** How many fetches and searches one planner turn may make (ADR-0027). User-only, like the approval settings. */
|
|
645
|
+
webReadBudget: number;
|
|
646
|
+
/** Get the base URL for an OpenAI-compatible provider. */
|
|
647
|
+
getProviderBaseUrl(provider: AiProvider): string;
|
|
648
|
+
/** Get the API key for a provider. */
|
|
649
|
+
getProviderApiKey(provider: AiProvider): string;
|
|
650
|
+
/**
|
|
651
|
+
* Push the canonical provider routing lists in (sole producer: ModelResolver).
|
|
652
|
+
* Config consumes them when resolving a chosen model id to its serving API.
|
|
653
|
+
*/
|
|
654
|
+
setProviderModelLists(lists: ProviderModelLists): void;
|
|
655
|
+
}
|
|
656
|
+
declare function enabledRunners(cfg: IConfig): RunnerId[];
|
|
657
|
+
|
|
466
658
|
/**
|
|
467
659
|
* The tools of the Ordewell MCP server, per token role (ADR-0022), and the
|
|
468
660
|
* handler interfaces the session side implements to answer them.
|
|
@@ -588,24 +780,24 @@ declare const taskOutputInput: z.ZodObject<{
|
|
|
588
780
|
error: "error";
|
|
589
781
|
command: "command";
|
|
590
782
|
thinking: "thinking";
|
|
591
|
-
turn_end: "turn_end";
|
|
592
|
-
message_delivered: "message_delivered";
|
|
593
783
|
thinking_delta: "thinking_delta";
|
|
594
784
|
tool_call: "tool_call";
|
|
595
785
|
tool_result: "tool_result";
|
|
596
786
|
usage: "usage";
|
|
597
787
|
subagent_started: "subagent_started";
|
|
598
788
|
subagent_finished: "subagent_finished";
|
|
789
|
+
turn_end: "turn_end";
|
|
790
|
+
message_delivered: "message_delivered";
|
|
599
791
|
runner_loaded: "runner_loaded";
|
|
600
792
|
compaction: "compaction";
|
|
601
793
|
command_output: "command_output";
|
|
794
|
+
text_delta: "text_delta";
|
|
602
795
|
turn_start: "turn_start";
|
|
603
796
|
message_queued: "message_queued";
|
|
604
797
|
message_removed: "message_removed";
|
|
605
798
|
message_undelivered: "message_undelivered";
|
|
606
799
|
message_handed_over: "message_handed_over";
|
|
607
800
|
task_skills: "task_skills";
|
|
608
|
-
text_delta: "text_delta";
|
|
609
801
|
approval_requested: "approval_requested";
|
|
610
802
|
approval_decided: "approval_decided";
|
|
611
803
|
approval_withdrawn: "approval_withdrawn";
|
|
@@ -1380,6 +1572,12 @@ interface RunnerModelDiscovery {
|
|
|
1380
1572
|
modelId: string;
|
|
1381
1573
|
modelLabel: string;
|
|
1382
1574
|
}[];
|
|
1575
|
+
/**
|
|
1576
|
+
* The runner names its models `provider/model` (OpenCode), so an id of that
|
|
1577
|
+
* shape can be its own rather than an OpenRouter slug left from a vendor
|
|
1578
|
+
* planner.
|
|
1579
|
+
*/
|
|
1580
|
+
providerQualifiedIds?: boolean;
|
|
1383
1581
|
/**
|
|
1384
1582
|
* HTTP API discovery — tried BEFORE command discovery. When the runner's CLI
|
|
1385
1583
|
* has no model-listing subcommand (Claude Code), an API endpoint can serve as
|
|
@@ -1423,198 +1621,6 @@ interface RunnerEntry {
|
|
|
1423
1621
|
manifest: RunnerManifest;
|
|
1424
1622
|
}
|
|
1425
1623
|
|
|
1426
|
-
interface CatalogModel {
|
|
1427
|
-
id: string;
|
|
1428
|
-
name: string;
|
|
1429
|
-
description: string;
|
|
1430
|
-
pricing: {
|
|
1431
|
-
prompt: string;
|
|
1432
|
-
completion: string;
|
|
1433
|
-
};
|
|
1434
|
-
contextLength: number;
|
|
1435
|
-
}
|
|
1436
|
-
declare class ModelCatalog {
|
|
1437
|
-
static fetchModels(apiKey: string, baseUrl?: string, fetchImpl?: typeof fetch): Promise<CatalogModel[]>;
|
|
1438
|
-
/**
|
|
1439
|
-
* Delete the on-disk catalog cache for a base URL so the next fetch re-runs.
|
|
1440
|
-
* Used by the resolver's `invalidate()` in production (no injected fetch);
|
|
1441
|
-
* best-effort — a missing file or unreadable dir is a no-op.
|
|
1442
|
-
*/
|
|
1443
|
-
static clearCache(baseUrl?: string): void;
|
|
1444
|
-
private static readCache;
|
|
1445
|
-
private static writeCache;
|
|
1446
|
-
}
|
|
1447
|
-
|
|
1448
|
-
interface ModelShortcut {
|
|
1449
|
-
label: string;
|
|
1450
|
-
id: string;
|
|
1451
|
-
provider: string;
|
|
1452
|
-
description: string;
|
|
1453
|
-
pricing?: string;
|
|
1454
|
-
}
|
|
1455
|
-
declare const ORCHESTRATOR_SHORTCUTS: ModelShortcut[];
|
|
1456
|
-
declare function resolveModelShortcut(input: string, shortcuts: ModelShortcut[]): string | null;
|
|
1457
|
-
/**
|
|
1458
|
-
* Resolves a value to a model id ONLY when it is in the supplied catalog
|
|
1459
|
-
* option list — either directly or via a shortcut label. Free-typed, unknown,
|
|
1460
|
-
* or not-currently-available values return null, so callers never store an id
|
|
1461
|
-
* the user couldn't have selected from the list. Keeps model-setting list-only.
|
|
1462
|
-
*/
|
|
1463
|
-
declare function knownModelId(value: string, optionIds: string[], shortcuts: ModelShortcut[]): string | null;
|
|
1464
|
-
|
|
1465
|
-
type ProviderModelLists = Record<string, string[]>;
|
|
1466
|
-
interface OrchestratorOption {
|
|
1467
|
-
id: string;
|
|
1468
|
-
label: string;
|
|
1469
|
-
provider: string;
|
|
1470
|
-
apiProvider: AiProvider;
|
|
1471
|
-
description?: string;
|
|
1472
|
-
pricing?: string;
|
|
1473
|
-
/** The model's context window when the catalog reports one (#49). */
|
|
1474
|
-
contextWindow?: number;
|
|
1475
|
-
}
|
|
1476
|
-
|
|
1477
|
-
interface FetchAllProviderModelsOptions {
|
|
1478
|
-
apiKeys: Record<string, string>;
|
|
1479
|
-
baseUrls: Record<string, string>;
|
|
1480
|
-
fetchImpl?: typeof fetch;
|
|
1481
|
-
}
|
|
1482
|
-
type AllProviderModels = Record<string, CatalogModel[]>;
|
|
1483
|
-
/**
|
|
1484
|
-
* Result of a picker-catalog fetch fan-out: the per-provider model lists plus
|
|
1485
|
-
* the per-provider failures. `errors` is keyed by provider id and holds the
|
|
1486
|
-
* failure message for any provider whose catalog fetch rejected — the seam the
|
|
1487
|
-
* surfaces (CLI, VS Code) use to flag "this configured provider didn't work"
|
|
1488
|
-
* rather than silently showing a short list.
|
|
1489
|
-
*/
|
|
1490
|
-
interface ProviderModelsResult {
|
|
1491
|
-
models: AllProviderModels;
|
|
1492
|
-
errors: Record<string, string>;
|
|
1493
|
-
}
|
|
1494
|
-
/** The provider config fields the discovery fan-out needs. */
|
|
1495
|
-
interface ProviderCredentialSource {
|
|
1496
|
-
getProviderApiKey(provider: AiProvider): string;
|
|
1497
|
-
getProviderBaseUrl(provider: AiProvider): string;
|
|
1498
|
-
openaiCompatibleBaseUrl: string;
|
|
1499
|
-
}
|
|
1500
|
-
/**
|
|
1501
|
-
* Collect the API keys and base URLs the picker fan-out should probe, applying
|
|
1502
|
-
* the single "configured" policy shared by every surface (CLI + VS Code):
|
|
1503
|
-
* - a preset is discovered only when it has an API key (OpenRouter included —
|
|
1504
|
-
* its public catalog is not probed keyless, matching the product rule that
|
|
1505
|
-
* only key-configured providers appear);
|
|
1506
|
-
* - `openai_compatible` is discovered only when an explicit endpoint is set
|
|
1507
|
-
* (keyless local servers like ollama / LM Studio).
|
|
1508
|
-
* Base URLs are handed through only for providers that pass the gate, so the
|
|
1509
|
-
* fan-out never touches an unconfigured third-party endpoint.
|
|
1510
|
-
*/
|
|
1511
|
-
declare function collectProviderCredentials(config: ProviderCredentialSource): {
|
|
1512
|
-
apiKeys: Record<string, string>;
|
|
1513
|
-
baseUrls: Record<string, string>;
|
|
1514
|
-
};
|
|
1515
|
-
declare function fetchAllProviderModels(opts: FetchAllProviderModelsOptions): Promise<ProviderModelsResult>;
|
|
1516
|
-
declare function resolveProvider(modelId: string, providerModelLists: Record<string, string[]>): AiProvider | null;
|
|
1517
|
-
declare function toOrchestratorOptions(providerModels: AllProviderModels, shortcuts: ModelShortcut[]): OrchestratorOption[];
|
|
1518
|
-
|
|
1519
|
-
/** An LLM vendor reached over HTTP. A closed set: each one has its own registration in `ProviderRegistry`. */
|
|
1520
|
-
type AiProvider = 'google' | 'openrouter' | 'openai_compatible' | 'openai' | 'xai' | 'groq' | 'deepseek' | 'together' | 'mistral' | 'anthropic' | 'fireworks' | 'perplexity' | 'zhipu' | 'kimi' | 'cerebras' | 'deepinfra' | 'doubao' | 'qwen' | 'hunyuan' | 'baichuan' | 'minimax' | 'yi' | 'stepfun' | 'siliconflow' | 'cohere' | 'novita';
|
|
1521
|
-
/**
|
|
1522
|
-
* Who plans: an API vendor, or the id of a runner serving as a *harness
|
|
1523
|
-
* planner* (ADR-0009) — a coding agent CLI already installed on the machine,
|
|
1524
|
-
* driven as the planner over its own programmatic transport and authenticated
|
|
1525
|
-
* by the subscription the user already holds. Runners sit in the provider axis
|
|
1526
|
-
* deliberately: "what plans for me?" is one question, and it belongs in one
|
|
1527
|
-
* setting. The runner half is open — any built-in runner with a connector can
|
|
1528
|
-
* plan — so it is checked against the registry, not by the type:
|
|
1529
|
-
* `isApiProvider` narrows to a vendor, `isCliProvider` tells a harness planner.
|
|
1530
|
-
*/
|
|
1531
|
-
type PlannerBackendId = AiProvider | RunnerId;
|
|
1532
|
-
interface IConfig {
|
|
1533
|
-
aiProvider: PlannerBackendId;
|
|
1534
|
-
apiKey: string;
|
|
1535
|
-
planningModel: string;
|
|
1536
|
-
enabledRunners: string[];
|
|
1537
|
-
maxParallelSessions: number;
|
|
1538
|
-
researchEnabled: boolean;
|
|
1539
|
-
researchMaxSteps: number;
|
|
1540
|
-
researchMaxFileSize: number;
|
|
1541
|
-
openAiBaseUrl: string;
|
|
1542
|
-
openAiApiKey: string;
|
|
1543
|
-
/** Provider keys + base URL the ModelResolver uses to fetch the picker catalogs. */
|
|
1544
|
-
openrouterKey: string;
|
|
1545
|
-
geminiKey: string;
|
|
1546
|
-
geminiBaseUrl?: string;
|
|
1547
|
-
/** Base URL + API key for a user-provided OpenAI-compatible endpoint (ollama, vLLM, LM Studio, etc.). */
|
|
1548
|
-
openaiCompatibleBaseUrl: string;
|
|
1549
|
-
openaiCompatibleApiKey: string;
|
|
1550
|
-
orchestratorModel: string;
|
|
1551
|
-
geminiModel: string;
|
|
1552
|
-
/** Model for research subagents (issue #34); defaults to the (cheap) planner model. */
|
|
1553
|
-
researchSubagentModel: string;
|
|
1554
|
-
/**
|
|
1555
|
-
* Thinking effort / model variant for a harness planner (ADR-0009), chosen
|
|
1556
|
-
* from the agent's own discovered variants. Separate from the per-task
|
|
1557
|
-
* efforts the plan carries — this one is the planner's own dial.
|
|
1558
|
-
*/
|
|
1559
|
-
plannerThinkingEffort?: string;
|
|
1560
|
-
planMapEnabled: boolean;
|
|
1561
|
-
autonomousMode: boolean;
|
|
1562
|
-
/**
|
|
1563
|
-
* Run each AI task in its own git worktree and integrate the results on a
|
|
1564
|
-
* per-run branch (ADR-0013). Non-git workspaces fall back to the shared
|
|
1565
|
-
* workspace root regardless of this flag.
|
|
1566
|
-
*/
|
|
1567
|
-
worktreeIsolation: boolean;
|
|
1568
|
-
/**
|
|
1569
|
-
* Shell command run in a fresh task worktree instead of symlinking ignored
|
|
1570
|
-
* artifacts from the main worktree — for repos where sharing `node_modules`
|
|
1571
|
-
* or a virtualenv is wrong.
|
|
1572
|
-
*/
|
|
1573
|
-
worktreeSetupCommand?: string;
|
|
1574
|
-
/**
|
|
1575
|
-
* Repositories of the repo group listed by hand, relative to the workspace
|
|
1576
|
-
* (ADR-0014). When non-empty the group is exactly these, replacing the
|
|
1577
|
-
* repositories auto-detected directly inside the folder; needed for ones
|
|
1578
|
-
* deeper than that, which are never auto-detected.
|
|
1579
|
-
*/
|
|
1580
|
-
workspaceRepos: string[];
|
|
1581
|
-
/**
|
|
1582
|
-
* Extra paths or globs, relative to each repo root, linked from the real repo
|
|
1583
|
-
* into its task worktree where they exist — gitignored local state such as
|
|
1584
|
-
* `*.tfstate` that a task must use, not a copy of.
|
|
1585
|
-
*/
|
|
1586
|
-
worktreeLinks: string[];
|
|
1587
|
-
/**
|
|
1588
|
-
* How many conflict repairs one task may go through before its conflict is
|
|
1589
|
-
* left for a person (ADR-0015); 0 turns repair off.
|
|
1590
|
-
*/
|
|
1591
|
-
conflictRepairAttempts: number;
|
|
1592
|
-
/**
|
|
1593
|
-
* What to do when planner research reaches outside its default envelope — an
|
|
1594
|
-
* out-of-workspace path, a shell command beyond the auto-allowed read-only
|
|
1595
|
-
* set, an MCP tool. `ask` prompts the user (and denies where no surface can
|
|
1596
|
-
* prompt, such as headless runs); `allow` and `deny` skip the prompt
|
|
1597
|
-
* entirely; `auto` follows {@link autonomousMode} (ADR-0026).
|
|
1598
|
-
*/
|
|
1599
|
-
approvalMode: ApprovalModeSetting;
|
|
1600
|
-
/** Allowlist entries granted up front, beside the defaults (ADR-0026, `plannerAllowlist.ts`). */
|
|
1601
|
-
approvalPreApproved: string[];
|
|
1602
|
-
/** Whether the built-in allowlist of read-only command families and MCP tools applies. */
|
|
1603
|
-
approvalDefaults: boolean;
|
|
1604
|
-
/** How many fetches and searches one planner turn may make (ADR-0027). User-only, like the approval settings. */
|
|
1605
|
-
webReadBudget: number;
|
|
1606
|
-
/** Get the base URL for an OpenAI-compatible provider. */
|
|
1607
|
-
getProviderBaseUrl(provider: AiProvider): string;
|
|
1608
|
-
/** Get the API key for a provider. */
|
|
1609
|
-
getProviderApiKey(provider: AiProvider): string;
|
|
1610
|
-
/**
|
|
1611
|
-
* Push the canonical provider routing lists in (sole producer: ModelResolver).
|
|
1612
|
-
* Config consumes them when resolving a chosen model id to its serving API.
|
|
1613
|
-
*/
|
|
1614
|
-
setProviderModelLists(lists: ProviderModelLists): void;
|
|
1615
|
-
}
|
|
1616
|
-
declare function enabledRunners(cfg: IConfig): RunnerId[];
|
|
1617
|
-
|
|
1618
1624
|
declare class RunnerRegistry {
|
|
1619
1625
|
private readonly runners;
|
|
1620
1626
|
private readonly unavailableModes;
|