@ordewell/core 0.10.1 → 0.10.3

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.
Files changed (45) hide show
  1. package/dist/{IFileSystem-Bj6fy1cG.d.mts → IFileSystem-B8Nkgg4e.d.mts} +1 -1
  2. package/dist/{IFileSystem-BCJBHFwB.d.ts → IFileSystem-DCd-rkeH.d.ts} +1 -1
  3. package/dist/{IRunner-hWAJC4hg.d.mts → IRunner-CXdYyIZo.d.mts} +213 -202
  4. package/dist/{IRunner-C7_SSpzG.d.ts → IRunner-QBdYcatb.d.ts} +213 -202
  5. package/dist/{ModeResolver-m1d8Cb-j.d.mts → ModeResolver-BOU90Nn-.d.ts} +1 -1
  6. package/dist/{ModeResolver-u5ZhRC8x.d.ts → ModeResolver-geqjKkLY.d.mts} +1 -1
  7. package/dist/{Task-CxwnCJLi.d.mts → Task-CRVIqSfy.d.mts} +58 -11
  8. package/dist/{Task-CxwnCJLi.d.ts → Task-CRVIqSfy.d.ts} +58 -11
  9. package/dist/{chunk-DNFT4SQG.mjs → chunk-645FALZX.mjs} +5 -5
  10. package/dist/chunk-645FALZX.mjs.map +1 -0
  11. package/dist/{chunk-DJAPDO6E.mjs → chunk-A57ITQE7.mjs} +41 -21
  12. package/dist/chunk-A57ITQE7.mjs.map +1 -0
  13. package/dist/{chunk-CH5IGWFS.mjs → chunk-FH6M5QZG.mjs} +168 -122
  14. package/dist/chunk-FH6M5QZG.mjs.map +1 -0
  15. package/dist/{chunk-2IIRSBEQ.mjs → chunk-SM6BV6XS.mjs} +20 -4
  16. package/dist/chunk-SM6BV6XS.mjs.map +1 -0
  17. package/dist/index.d.mts +454 -63
  18. package/dist/index.d.ts +454 -63
  19. package/dist/index.js +19575 -18631
  20. package/dist/index.js.map +1 -1
  21. package/dist/index.mjs +17991 -17137
  22. package/dist/index.mjs.map +1 -1
  23. package/dist/parsing.d.mts +2 -2
  24. package/dist/parsing.d.ts +2 -2
  25. package/dist/parsing.js +15 -14
  26. package/dist/parsing.js.map +1 -1
  27. package/dist/parsing.mjs +3 -3
  28. package/dist/{plan-utils-CKXdD1AD.d.mts → plan-utils-KU1Rse82.d.mts} +1322 -1146
  29. package/dist/{plan-utils-B6yJdpgi.d.ts → plan-utils-oC8bO4pN.d.ts} +1322 -1146
  30. package/dist/plan-utils.d.mts +4 -4
  31. package/dist/plan-utils.d.ts +4 -4
  32. package/dist/plan-utils.js +60 -0
  33. package/dist/plan-utils.js.map +1 -1
  34. package/dist/plan-utils.mjs +11 -3
  35. package/dist/testing.d.mts +3 -3
  36. package/dist/testing.d.ts +3 -3
  37. package/dist/testing.js +3 -1
  38. package/dist/testing.js.map +1 -1
  39. package/dist/testing.mjs +4 -2
  40. package/dist/testing.mjs.map +1 -1
  41. package/package.json +5 -1
  42. package/dist/chunk-2IIRSBEQ.mjs.map +0 -1
  43. package/dist/chunk-CH5IGWFS.mjs.map +0 -1
  44. package/dist/chunk-DJAPDO6E.mjs.map +0 -1
  45. package/dist/chunk-DNFT4SQG.mjs.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { ChildProcess } from 'child_process';
2
- import { ao as UsageRecord, aa as SubagentOutcome, $ as RunnerId, aj as TaskSkillSnapshot } from './Task-CxwnCJLi.js';
2
+ import { a2 as RunnerId, ar as UsageRecord, ad as SubagentOutcome, d as DiscoveredModel, am as TaskSkillSnapshot } from './Task-CRVIqSfy.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
- task_skills: "task_skills";
592
- turn_start: "turn_start";
593
- command_output: "command_output";
594
- compaction: "compaction";
595
- runner_loaded: "runner_loaded";
596
- turn_end: "turn_end";
597
- text_delta: "text_delta";
598
783
  thinking_delta: "thinking_delta";
599
784
  tool_call: "tool_call";
600
785
  tool_result: "tool_result";
786
+ usage: "usage";
601
787
  subagent_started: "subagent_started";
602
788
  subagent_finished: "subagent_finished";
603
- usage: "usage";
789
+ turn_end: "turn_end";
790
+ message_delivered: "message_delivered";
791
+ runner_loaded: "runner_loaded";
792
+ compaction: "compaction";
793
+ command_output: "command_output";
794
+ text_delta: "text_delta";
795
+ turn_start: "turn_start";
604
796
  message_queued: "message_queued";
605
797
  message_removed: "message_removed";
606
798
  message_undelivered: "message_undelivered";
607
799
  message_handed_over: "message_handed_over";
608
- message_delivered: "message_delivered";
800
+ task_skills: "task_skills";
609
801
  approval_requested: "approval_requested";
610
802
  approval_decided: "approval_decided";
611
803
  approval_withdrawn: "approval_withdrawn";
@@ -1314,7 +1506,10 @@ interface RunnerFeatures {
1314
1506
  permissionModeValues?: Record<string, string>;
1315
1507
  modeSettings?: Record<string, Record<string, string>>;
1316
1508
  }
1317
- type ModelDiscoveryParser = 'claude-help' | 'opencode-models' | 'opencode-models-verbose' | 'anthropic-models' | 'line-by-line' | 'json' | 'json-table';
1509
+ /** A runner's own reader for its catalog's output, kept beside its manifest. */
1510
+ type ModelOutputParser = (output: string, manifest: RunnerManifest) => DiscoveredModel[];
1511
+ /** How discovery output becomes models: one `id label` per line, or the runner's own reader. Absent means per line. */
1512
+ type ModelDiscoveryParser = 'line-by-line' | ModelOutputParser;
1318
1513
  interface DiscoveryCommand {
1319
1514
  command: string;
1320
1515
  args: string[];
@@ -1343,7 +1538,6 @@ interface RunnerModelDiscovery {
1343
1538
  command?: string;
1344
1539
  args?: string[];
1345
1540
  parser?: ModelDiscoveryParser;
1346
- jsonPath?: string;
1347
1541
  /**
1348
1542
  * Stdio JSON-RPC discovery (Codex `app-server`): spawn the command, send
1349
1543
  * `initialize` then `model/list`, and read the catalog from the response.
@@ -1378,6 +1572,12 @@ interface RunnerModelDiscovery {
1378
1572
  modelId: string;
1379
1573
  modelLabel: string;
1380
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;
1381
1581
  /**
1382
1582
  * HTTP API discovery — tried BEFORE command discovery. When the runner's CLI
1383
1583
  * has no model-listing subcommand (Claude Code), an API endpoint can serve as
@@ -1421,195 +1621,6 @@ interface RunnerEntry {
1421
1621
  manifest: RunnerManifest;
1422
1622
  }
1423
1623
 
1424
- interface CatalogModel {
1425
- id: string;
1426
- name: string;
1427
- description: string;
1428
- pricing: {
1429
- prompt: string;
1430
- completion: string;
1431
- };
1432
- contextLength: number;
1433
- }
1434
- declare class ModelCatalog {
1435
- static fetchModels(apiKey: string, baseUrl?: string, fetchImpl?: typeof fetch): Promise<CatalogModel[]>;
1436
- /**
1437
- * Delete the on-disk catalog cache for a base URL so the next fetch re-runs.
1438
- * Used by the resolver's `invalidate()` in production (no injected fetch);
1439
- * best-effort — a missing file or unreadable dir is a no-op.
1440
- */
1441
- static clearCache(baseUrl?: string): void;
1442
- private static readCache;
1443
- private static writeCache;
1444
- }
1445
-
1446
- interface ModelShortcut {
1447
- label: string;
1448
- id: string;
1449
- provider: string;
1450
- description: string;
1451
- pricing?: string;
1452
- }
1453
- declare const ORCHESTRATOR_SHORTCUTS: ModelShortcut[];
1454
- declare function resolveModelShortcut(input: string, shortcuts: ModelShortcut[]): string | null;
1455
- /**
1456
- * Resolves a value to a model id ONLY when it is in the supplied catalog
1457
- * option list — either directly or via a shortcut label. Free-typed, unknown,
1458
- * or not-currently-available values return null, so callers never store an id
1459
- * the user couldn't have selected from the list. Keeps model-setting list-only.
1460
- */
1461
- declare function knownModelId(value: string, optionIds: string[], shortcuts: ModelShortcut[]): string | null;
1462
-
1463
- type ProviderModelLists = Record<string, string[]>;
1464
- interface OrchestratorOption {
1465
- id: string;
1466
- label: string;
1467
- provider: string;
1468
- apiProvider: AiProvider;
1469
- description?: string;
1470
- pricing?: string;
1471
- /** The model's context window when the catalog reports one (#49). */
1472
- contextWindow?: number;
1473
- }
1474
-
1475
- interface FetchAllProviderModelsOptions {
1476
- apiKeys: Record<string, string>;
1477
- baseUrls: Record<string, string>;
1478
- fetchImpl?: typeof fetch;
1479
- }
1480
- type AllProviderModels = Record<string, CatalogModel[]>;
1481
- /**
1482
- * Result of a picker-catalog fetch fan-out: the per-provider model lists plus
1483
- * the per-provider failures. `errors` is keyed by provider id and holds the
1484
- * failure message for any provider whose catalog fetch rejected — the seam the
1485
- * surfaces (CLI, VS Code) use to flag "this configured provider didn't work"
1486
- * rather than silently showing a short list.
1487
- */
1488
- interface ProviderModelsResult {
1489
- models: AllProviderModels;
1490
- errors: Record<string, string>;
1491
- }
1492
- /** The provider config fields the discovery fan-out needs. */
1493
- interface ProviderCredentialSource {
1494
- getProviderApiKey(provider: AiProvider): string;
1495
- getProviderBaseUrl(provider: AiProvider): string;
1496
- openaiCompatibleBaseUrl: string;
1497
- }
1498
- /**
1499
- * Collect the API keys and base URLs the picker fan-out should probe, applying
1500
- * the single "configured" policy shared by every surface (CLI + VS Code):
1501
- * - a preset is discovered only when it has an API key (OpenRouter included —
1502
- * its public catalog is not probed keyless, matching the product rule that
1503
- * only key-configured providers appear);
1504
- * - `openai_compatible` is discovered only when an explicit endpoint is set
1505
- * (keyless local servers like ollama / LM Studio).
1506
- * Base URLs are handed through only for providers that pass the gate, so the
1507
- * fan-out never touches an unconfigured third-party endpoint.
1508
- */
1509
- declare function collectProviderCredentials(config: ProviderCredentialSource): {
1510
- apiKeys: Record<string, string>;
1511
- baseUrls: Record<string, string>;
1512
- };
1513
- declare function fetchAllProviderModels(opts: FetchAllProviderModelsOptions): Promise<ProviderModelsResult>;
1514
- declare function resolveProvider(modelId: string, providerModelLists: Record<string, string[]>): AiProvider | null;
1515
- declare function toOrchestratorOptions(providerModels: AllProviderModels, shortcuts: ModelShortcut[]): OrchestratorOption[];
1516
-
1517
- /**
1518
- * Who plans. Mostly LLM vendors reached over HTTP; the last three are *harness
1519
- * planners* (ADR-0009) — a coding agent CLI already installed on the machine,
1520
- * driven as the planner over its own programmatic transport and authenticated
1521
- * by the subscription the user already holds. They are runners in the provider
1522
- * axis, deliberately: "what plans for me?" is one question, and it belongs in
1523
- * one setting. `isCliProvider` is the single guard that tells the two kinds
1524
- * apart.
1525
- */
1526
- 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' | 'claude-code' | 'codex' | 'opencode';
1527
- interface IConfig {
1528
- aiProvider: AiProvider;
1529
- apiKey: string;
1530
- planningModel: string;
1531
- enabledRunners: string[];
1532
- maxParallelSessions: number;
1533
- researchEnabled: boolean;
1534
- researchMaxSteps: number;
1535
- researchMaxFileSize: number;
1536
- openAiBaseUrl: string;
1537
- openAiApiKey: string;
1538
- /** Provider keys + base URL the ModelResolver uses to fetch the picker catalogs. */
1539
- openrouterKey: string;
1540
- geminiKey: string;
1541
- geminiBaseUrl?: string;
1542
- /** Base URL + API key for a user-provided OpenAI-compatible endpoint (ollama, vLLM, LM Studio, etc.). */
1543
- openaiCompatibleBaseUrl: string;
1544
- openaiCompatibleApiKey: string;
1545
- orchestratorModel: string;
1546
- geminiModel: string;
1547
- /** Model for research subagents (issue #34); defaults to the (cheap) planner model. */
1548
- researchSubagentModel: string;
1549
- /**
1550
- * Thinking effort / model variant for a harness planner (ADR-0009), chosen
1551
- * from the agent's own discovered variants. Separate from the per-task
1552
- * efforts the plan carries — this one is the planner's own dial.
1553
- */
1554
- plannerThinkingEffort?: string;
1555
- planMapEnabled: boolean;
1556
- autonomousMode: boolean;
1557
- /**
1558
- * Run each AI task in its own git worktree and integrate the results on a
1559
- * per-run branch (ADR-0013). Non-git workspaces fall back to the shared
1560
- * workspace root regardless of this flag.
1561
- */
1562
- worktreeIsolation: boolean;
1563
- /**
1564
- * Shell command run in a fresh task worktree instead of symlinking ignored
1565
- * artifacts from the main worktree — for repos where sharing `node_modules`
1566
- * or a virtualenv is wrong.
1567
- */
1568
- worktreeSetupCommand?: string;
1569
- /**
1570
- * Repositories of the repo group listed by hand, relative to the workspace
1571
- * (ADR-0014). When non-empty the group is exactly these, replacing the
1572
- * repositories auto-detected directly inside the folder; needed for ones
1573
- * deeper than that, which are never auto-detected.
1574
- */
1575
- workspaceRepos: string[];
1576
- /**
1577
- * Extra paths or globs, relative to each repo root, linked from the real repo
1578
- * into its task worktree where they exist — gitignored local state such as
1579
- * `*.tfstate` that a task must use, not a copy of.
1580
- */
1581
- worktreeLinks: string[];
1582
- /**
1583
- * How many conflict repairs one task may go through before its conflict is
1584
- * left for a person (ADR-0015); 0 turns repair off.
1585
- */
1586
- conflictRepairAttempts: number;
1587
- /**
1588
- * What to do when planner research reaches outside its default envelope — an
1589
- * out-of-workspace path, a shell command beyond the auto-allowed read-only
1590
- * set, an MCP tool. `ask` prompts the user (and denies where no surface can
1591
- * prompt, such as headless runs); `allow` and `deny` skip the prompt
1592
- * entirely; `auto` follows {@link autonomousMode} (ADR-0026).
1593
- */
1594
- approvalMode: ApprovalModeSetting;
1595
- /** Allowlist entries granted up front, beside the defaults (ADR-0026, `plannerAllowlist.ts`). */
1596
- approvalPreApproved: string[];
1597
- /** Whether the built-in allowlist of read-only command families and MCP tools applies. */
1598
- approvalDefaults: boolean;
1599
- /** How many fetches and searches one planner turn may make (ADR-0027). User-only, like the approval settings. */
1600
- webReadBudget: number;
1601
- /** Get the base URL for an OpenAI-compatible provider. */
1602
- getProviderBaseUrl(provider: AiProvider): string;
1603
- /** Get the API key for a provider. */
1604
- getProviderApiKey(provider: AiProvider): string;
1605
- /**
1606
- * Push the canonical provider routing lists in (sole producer: ModelResolver).
1607
- * Config consumes them when resolving a chosen model id to its serving API.
1608
- */
1609
- setProviderModelLists(lists: ProviderModelLists): void;
1610
- }
1611
- declare function enabledRunners(cfg: IConfig): RunnerId[];
1612
-
1613
1624
  declare class RunnerRegistry {
1614
1625
  private readonly runners;
1615
1626
  private readonly unavailableModes;
@@ -1833,4 +1844,4 @@ interface IRunner {
1833
1844
  activeCount: number;
1834
1845
  }
1835
1846
 
1836
- export { type OwnerOnlyFile as $, AUTO_COMMANDS as A, type IRunnerSession as B, type CatalogModel as C, DEFAULT_PLANNER_ALLOWLIST as D, type EditPlanArgs as E, type FetchAllProviderModelsOptions as F, GIT_READONLY_SUBCOMMANDS as G, type InvokedCommand as H, type IApproval as I, type ListModelsArgs as J, type ListRunnersArgs as K, LineBuffer as L, type LoadSkillArgs as M, type McpClientConfig as N, type McpCredential as O, type McpTool as P, type McpToolContext as Q, type McpToolReply as R, type MessageTaskArgs as S, ModelCatalog as T, type ModelShortcut as U, ORCHESTRATOR_SHORTCUTS as V, ORDEWELL_MCP_PATH as W, ORDEWELL_MCP_SERVER_NAME as X, type OneTaskArgs as Y, type OrchestratorOption as Z, OrdewellMcpServer as _, type AgentAdapter as a, researchToolsPath as a$, PLANNER_EXECUTION_TOOLS as a0, PLANNER_TOOLS as a1, type PlannerAllowlist as a2, type PlannerStartOptions as a3, type PlannerTokenScope as a4, type PlannerToolHandler as a5, type ProjectMcpServer as a6, type ProviderCredentialSource as a7, type ProviderModelLists as a8, type ProviderModelsResult as a9, type TaskDiffArgs as aA, type TaskMessageFrom as aB, type TaskModeAgentAdapter as aC, TaskModeUnsupportedError as aD, type TaskOutputArgs as aE, type TaskQueryArgs as aF, type TaskRunnerFlags as aG, type TaskStartOptions as aH, type TaskTokenScope as aI, type TaskToolHandler as aJ, approvalScopes as aK, classifyCommand as aL, clearResearchShellCache as aM, collectProviderCredentials as aN, commandAllowedBy as aO, effectiveApprovalMode as aP, enabledRunners as aQ, fetchAllProviderModels as aR, findRunnerCommand as aS, isGranted as aT, isRunnerApproval as aU, knownModelId as aV, mcpClientConfig as aW, ownerOnlyConfigFile as aX, parseAllowlist as aY, parseApprovalModeSetting as aZ, researchShellWarning as a_, type QueuedTaskMessage as aa, REFUSED_COMMANDS as ab, type ResearchShell as ac, type ResearchShellDeps as ad, type RetryTaskArgs as ae, type RunCommandArgs as af, type RunPlanArgs as ag, type RunnerCommand as ah, type RunnerCommandKind as ai, type RunnerEntry as aj, type RunnerFeatures as ak, type RunnerManifest as al, type RunnerMcpServer as am, type RunnerMode as an, type RunnerModelDiscovery as ao, RunnerRegistry as ap, type ShellDialect as aq, type SpawnFn as ar, type StandingDecision as as, type StructuredEvent as at, type StructuredTurnEnd as au, type SubmitPlanArgs as av, TASK_COMPLETE_TOOL as aw, TASK_COMPLETION_CONTRACT as ax, TASK_TOOLS as ay, type TaskCompleteArgs as az, type AgentAdapterFactory as b, resolveModelShortcut as b0, resolveProvider as b1, resolveResearchShell as b2, scopeAllowed as b3, sharedMcpServer as b4, toApprovalDecision as b5, toOrchestratorOptions as b6, toolAllowed as b7, type AgentEvent as c, type AgentProcessDeps as d, type AgentStartOptions as e, type AiProvider as f, type AllProviderModels as g, type AnswerApprovalArgs as h, type ApprovalAnswer as i, type ApprovalDecision as j, type ApprovalKind as k, type ApprovalMode as l, type ApprovalModeSetting as m, ApprovalPolicy as n, type ApprovalPolicyOptions as o, type ApprovalRequest as p, type ApprovalSource as q, type CheckpointAnswer as r, type CheckpointArgs as s, type CommandClassification as t, type CommandTier as u, type CommandWords as v, DENY_ALL as w, type DiscoveryCommand as x, type IConfig as y, type IRunner as z };
1847
+ export { type OwnerOnlyFile as $, AUTO_COMMANDS as A, type IRunnerSession as B, type CatalogModel as C, DEFAULT_PLANNER_ALLOWLIST as D, type EditPlanArgs as E, type FetchAllProviderModelsOptions as F, GIT_READONLY_SUBCOMMANDS as G, type InvokedCommand as H, type IApproval as I, type ListModelsArgs as J, type ListRunnersArgs as K, LineBuffer as L, type LoadSkillArgs as M, type McpClientConfig as N, type McpCredential as O, type McpTool as P, type McpToolContext as Q, type McpToolReply as R, type MessageTaskArgs as S, ModelCatalog as T, type ModelShortcut as U, ORCHESTRATOR_SHORTCUTS as V, ORDEWELL_MCP_PATH as W, ORDEWELL_MCP_SERVER_NAME as X, type OneTaskArgs as Y, type OrchestratorOption as Z, OrdewellMcpServer as _, type AgentAdapter as a, researchShellWarning as a$, PLANNER_EXECUTION_TOOLS as a0, PLANNER_TOOLS as a1, type PlannerAllowlist as a2, type PlannerBackendId as a3, type PlannerStartOptions as a4, type PlannerTokenScope as a5, type PlannerToolHandler as a6, type ProjectMcpServer as a7, type ProviderCredentialSource as a8, type ProviderModelLists as a9, type TaskCompleteArgs as aA, type TaskDiffArgs as aB, type TaskMessageFrom as aC, type TaskModeAgentAdapter as aD, TaskModeUnsupportedError as aE, type TaskOutputArgs as aF, type TaskQueryArgs as aG, type TaskRunnerFlags as aH, type TaskStartOptions as aI, type TaskTokenScope as aJ, type TaskToolHandler as aK, approvalScopes as aL, classifyCommand as aM, clearResearchShellCache as aN, collectProviderCredentials as aO, commandAllowedBy as aP, effectiveApprovalMode as aQ, enabledRunners as aR, fetchAllProviderModels as aS, findRunnerCommand as aT, isGranted as aU, isRunnerApproval as aV, knownModelId as aW, mcpClientConfig as aX, ownerOnlyConfigFile as aY, parseAllowlist as aZ, parseApprovalModeSetting as a_, type ProviderModelsResult as aa, type QueuedTaskMessage as ab, REFUSED_COMMANDS as ac, type ResearchShell as ad, type ResearchShellDeps as ae, type RetryTaskArgs as af, type RunCommandArgs as ag, type RunPlanArgs as ah, type RunnerCommand as ai, type RunnerCommandKind as aj, type RunnerEntry as ak, type RunnerFeatures as al, type RunnerManifest as am, type RunnerMcpServer as an, type RunnerMode as ao, type RunnerModelDiscovery as ap, RunnerRegistry as aq, type ShellDialect as ar, type SpawnFn as as, type StandingDecision as at, type StructuredEvent as au, type StructuredTurnEnd as av, type SubmitPlanArgs as aw, TASK_COMPLETE_TOOL as ax, TASK_COMPLETION_CONTRACT as ay, TASK_TOOLS as az, type AgentAdapterFactory as b, researchToolsPath as b0, resolveModelShortcut as b1, resolveProvider as b2, resolveResearchShell as b3, scopeAllowed as b4, sharedMcpServer as b5, toApprovalDecision as b6, toOrchestratorOptions as b7, toolAllowed as b8, type AgentEvent as c, type AgentProcessDeps as d, type AgentStartOptions as e, type AiProvider as f, type AllProviderModels as g, type AnswerApprovalArgs as h, type ApprovalAnswer as i, type ApprovalDecision as j, type ApprovalKind as k, type ApprovalMode as l, type ApprovalModeSetting as m, ApprovalPolicy as n, type ApprovalPolicyOptions as o, type ApprovalRequest as p, type ApprovalSource as q, type CheckpointAnswer as r, type CheckpointArgs as s, type CommandClassification as t, type CommandTier as u, type CommandWords as v, DENY_ALL as w, type DiscoveryCommand as x, type IConfig as y, type IRunner as z };
@@ -1,4 +1,4 @@
1
- import { $ as RunnerId } from './Task-CxwnCJLi.mjs';
1
+ import { a2 as RunnerId } from './Task-CRVIqSfy.js';
2
2
 
3
3
  interface RunnerModeInfo {
4
4
  id: string;
@@ -1,4 +1,4 @@
1
- import { $ as RunnerId } from './Task-CxwnCJLi.js';
1
+ import { a2 as RunnerId } from './Task-CRVIqSfy.mjs';
2
2
 
3
3
  interface RunnerModeInfo {
4
4
  id: string;
@@ -330,8 +330,26 @@ interface PreparedTask {
330
330
  setupFailed?: SetupFailure[];
331
331
  /** What the attempt this one replaces left unlanded, kept on a branch before its worktree went; absent when nothing was. */
332
332
  preserved?: PreservedWork[];
333
- continuation?: 'restored' | 'fallback';
333
+ /** Set for a `restore` prepare: whether the previous attempt's work was put back, or every repo fell back to its tip. */
334
+ restoration?: 'restored' | 'fallback';
334
335
  }
336
+ /**
337
+ * How a task workspace starts: `fresh` from the integration tips, `restore`
338
+ * with the previous attempt's preserved work merged on top of them — for a
339
+ * continue (ADR-0018, K1) and for a carry-over to another runner.
340
+ */
341
+ type PrepareIntent = 'fresh' | 'restore';
342
+ /**
343
+ * What a restoring attempt is told became of the previous attempt's work: in
344
+ * its working tree, or kept on `preserved` branches because restoring it
345
+ * conflicted with the integration tips.
346
+ */
347
+ type PreviousWork = {
348
+ outcome: 'restored';
349
+ } | {
350
+ outcome: 'fallback';
351
+ preserved: readonly PreservedWork[];
352
+ };
335
353
  /** A task as a removal names it. */
336
354
  type IsolationTaskRef = Pick<IsolationTaskRecord, 'taskId' | 'order' | 'title'>;
337
355
  /**
@@ -400,11 +418,11 @@ interface IWorktreeIsolation {
400
418
  /**
401
419
  * Create the task workspace — one worktree per isolated repo from its
402
420
  * integration tip, the shared paths linked in — and return the cwd to spawn
403
- * the Runner into. Fresh attempts start clean from the tips. A continuation
404
- * restores the previous attempt's preserved work on top of them, falling
405
- * back to the tips in every repo when any restoration conflicts (ADR-0018).
421
+ * the Runner into. Fresh attempts start clean from the tips. A `restore`
422
+ * puts the previous attempt's preserved work on top of them, falling back
423
+ * to the tips in every repo when any restoration conflicts (ADR-0018).
406
424
  */
407
- prepare(task: Task, run: IsolationRun, intent?: 'fresh' | 'continuation'): Promise<PreparedTask>;
425
+ prepare(task: Task, run: IsolationRun, intent?: PrepareIntent): Promise<PreparedTask>;
408
426
  /**
409
427
  * Hand a conflicted task's kept workspace to a conflict repair (ADR-0015)
410
428
  * as it is — nothing is re-cut — and return the same cwd. Records each
@@ -914,7 +932,8 @@ interface TaskOutputSummary {
914
932
  type TaskType = 'ai' | 'user';
915
933
  /**
916
934
  * `skipped` is terminal and verdict-less: the task will not be waited for, and
917
- * nothing it did lands. Its dependents go ahead without it.
935
+ * nothing it did lands. Its dependents go ahead without it once the work it
936
+ * waited on is done.
918
937
  */
919
938
  type TaskStatus = 'pending' | 'approved' | 'in_progress' | 'completed' | 'failed' | 'blocked' | 'awaiting_user' | 'skipped';
920
939
  type TaskMode = string;
@@ -983,6 +1002,12 @@ interface Task {
983
1002
  * waits for a manual retry. Set only with `awaitingReason` `usage-limit`.
984
1003
  */
985
1004
  resumeAt?: string;
1005
+ /**
1006
+ * The runner a task paused on its usage limit was moved off (ADR-0018, U1):
1007
+ * its next attempt is a carry-over, a fresh session that starts from that
1008
+ * attempt's files. Cleared once that attempt runs, and by a retry.
1009
+ */
1010
+ carriedFrom?: RunnerId;
986
1011
  /** Why the task was skipped, as whoever skipped it put it; set only while `status` is `skipped`, and not always then. */
987
1012
  skipReason?: string;
988
1013
  /**
@@ -1274,9 +1299,17 @@ interface LegacyPlanState {
1274
1299
  * The tasks the user approved to run: every task when they executed the
1275
1300
  * plan, and each one they started or retried themselves since. A command
1276
1301
  * from anyone else starts only these (ADR-0029); a task the planner added
1277
- * after the approval waits for the user's.
1302
+ * after the approval waits for the user's. Only tasks still in the plan: a
1303
+ * task that leaves takes its approval with it.
1278
1304
  */
1279
1305
  approvedTasks?: string[];
1306
+ /**
1307
+ * The user approved the plan to run: Execute plan, signing off a review, or
1308
+ * autorun's start (ADR-0029, ADR-0030). Kept apart from {@link status},
1309
+ * which surfaces rewrite for display; a user's start of one task approves
1310
+ * that task, not the plan.
1311
+ */
1312
+ approved?: boolean;
1280
1313
  }
1281
1314
  interface Message {
1282
1315
  id: string;
@@ -1290,7 +1323,8 @@ interface TaskSnapshot extends Task {
1290
1323
  retryCount: number;
1291
1324
  finalized: boolean;
1292
1325
  }
1293
- type PlanState = {
1326
+ /** The plan a surface reads whole carries the approval record, so it can tell which tasks wait for the user (ADR-0035). */
1327
+ type PlanState = ({
1294
1328
  phase: 'planning';
1295
1329
  history: Message[];
1296
1330
  message: string;
@@ -1304,11 +1338,15 @@ type PlanState = {
1304
1338
  goal: string;
1305
1339
  runners: string[];
1306
1340
  status: PlanStatus;
1307
- };
1341
+ }) & ApprovalRecord;
1308
1342
  declare function migratePlanState(raw: unknown): PlanState;
1309
1343
 
1310
1344
  declare function createTask(overrides?: Partial<Task>): Task;
1311
- /** The runner set a plan has until one is chosen: the one runner every host ships. */
1345
+ /**
1346
+ * The runner set a plan has until one is chosen. The one runner named outside
1347
+ * its declaration on purpose: a default is a product choice that no manifest
1348
+ * or connector implies.
1349
+ */
1312
1350
  declare const DEFAULT_RUNNERS: readonly RunnerId[];
1313
1351
  declare function createEmptyPlan(): LegacyPlanState;
1314
1352
  declare function flattenTasks(tasks: readonly Task[]): Task[];
@@ -1337,5 +1375,14 @@ interface TaskWithParent {
1337
1375
  declare function flattenTasksWithParents(tasks: readonly Task[]): TaskWithParent[];
1338
1376
  /** A task paused on its runner's usage limit, whether it resumes on its own or waits for the user (#84). */
1339
1377
  declare function pausedOnLimit(task: Readonly<Task>): boolean;
1378
+ /** The user's approval record, as a plan carries it (ADR-0029). */
1379
+ type ApprovalRecord = Pick<LegacyPlanState, 'approved' | 'approvedTasks'>;
1380
+ /**
1381
+ * A task the scheduler leaves for the user (ADR-0035): an AI task not started
1382
+ * yet, in a plan they approved, outside their approval record — the planner
1383
+ * added it since. It starts once they start it or execute the plan. In a plan
1384
+ * they never approved nothing is theirs yet, so nothing is singled out.
1385
+ */
1386
+ declare function waitsForApproval(task: Pick<Task, 'id' | 'type' | 'status'>, record: ApprovalRecord): boolean;
1340
1387
 
1341
- export { type RunnerId as $, type AttemptUsage as A, BUILTIN_SKILL_NAMES as B, type ConversationMessage as C, DEFAULT_RUNNERS as D, type ExecutionActor as E, type IsolationView as F, type GuardTarget as G, type PlanIsolation as H, type IWorktreeIsolation as I, type PlanState as J, type PlanStatus as K, type LegacyPlanState as L, type ModelUsage as M, type PlanUsage as N, type PlannerUsage as O, type PendingPlanTurn as P, type PreparedTask as Q, type PreservedWork as R, type RefusedRemoval as S, type RepairEvidence as T, type RepoGroupLayout as U, type ResearchLogEntry as V, type ResearchProgress as W, type ResearchStep as X, type ResearchStepOutcome as Y, type ResearchToolType as Z, type RunSettings as _, type AwaitingReason as a, type SetupFailure as a0, type ShadowedSkill as a1, type SkillAppliesTo as a2, type SkillCatalog as a3, type SkillInfo as a4, type SkillLoad as a5, type SkillLoadNotice as a6, type SkillMetadata as a7, type SkillSource as a8, SkillsService as a9, endAttemptUsage as aA, flattenTasks as aB, flattenTasksWithParents as aC, isAwaitingReason as aD, isMeasured as aE, isSupervisorLevel as aF, isUserMessage as aG, migratePlanState as aH, partedPromptUsage as aI, pausedOnLimit as aJ, planUsage as aK, plannerContextFill as aL, rejoinPlanTree as aM, startAttemptUsage as aN, usageLine as aO, type SubagentOutcome as aa, type SupervisorLevel as ab, type Task as ac, type TaskDiffRead as ad, type TaskDiffResult as ae, type TaskIsolation as af, type TaskIsolationState as ag, type TaskModelAssignment as ah, type TaskSkillNotice as ai, type TaskSkillSnapshot as aj, type TaskSnapshot as ak, type TaskStatus as al, type TreeSnapshot as am, type UsageLine as an, type UsageRecord as ao, type UsageTotals as ap, type Verdict as aq, type VerificationCheck as ar, addAttemptUsage as as, addModelUsage as at, addPlannerUsage as au, addUsage as av, addUsageTotals as aw, createEmptyPlan as ax, createSkillsService as ay, createTask as az, DEFAULT_SUPERVISOR_RETRY_LIMIT as b, type DiscoveredModel as c, type ExecutionCommandName as d, type ExecutionRecord as e, type GuardTrip as f, type IntegrationDisposal as g, type InvalidSkill as h, type IsolationAvailability as i, type IsolationHandoff as j, type IsolationHandoffRepo as k, type IsolationInactiveReason as l, type IsolationLandedTask as m, type IsolationLanding as n, type IsolationMergeBlock as o, type IsolationMergeBlockReason as p, type IsolationMergeResult as q, type IsolationOutcome as r, type IsolationPruneResult as s, type IsolationRemoval as t, type IsolationRepo as u, type IsolationRun as v, type IsolationTaskRecord as w, type IsolationTaskRef as x, type IsolationTaskRepo as y, type IsolationTaskStatus as z };
1388
+ export { type ResearchStepOutcome as $, type ApprovalRecord as A, BUILTIN_SKILL_NAMES as B, type ConversationMessage as C, DEFAULT_RUNNERS as D, type ExecutionActor as E, type IsolationTaskStatus as F, type GuardTarget as G, type IsolationView as H, type IWorktreeIsolation as I, type PlanIsolation as J, type PlanState as K, type LegacyPlanState as L, type ModelUsage as M, type PlanStatus as N, type PlanUsage as O, type PendingPlanTurn as P, type PlannerUsage as Q, type PrepareIntent as R, type PreparedTask as S, type PreservedWork as T, type PreviousWork as U, type RefusedRemoval as V, type RepairEvidence as W, type RepoGroupLayout as X, type ResearchLogEntry as Y, type ResearchProgress as Z, type ResearchStep as _, type AttemptUsage as a, type ResearchToolType as a0, type RunSettings as a1, type RunnerId as a2, type SetupFailure as a3, type ShadowedSkill as a4, type SkillAppliesTo as a5, type SkillCatalog as a6, type SkillInfo as a7, type SkillLoad as a8, type SkillLoadNotice as a9, createEmptyPlan as aA, createSkillsService as aB, createTask as aC, endAttemptUsage as aD, flattenTasks as aE, flattenTasksWithParents as aF, isAwaitingReason as aG, isMeasured as aH, isSupervisorLevel as aI, isUserMessage as aJ, migratePlanState as aK, partedPromptUsage as aL, pausedOnLimit as aM, planUsage as aN, plannerContextFill as aO, rejoinPlanTree as aP, startAttemptUsage as aQ, usageLine as aR, waitsForApproval as aS, type SkillMetadata as aa, type SkillSource as ab, SkillsService as ac, type SubagentOutcome as ad, type SupervisorLevel as ae, type Task as af, type TaskDiffRead as ag, type TaskDiffResult as ah, type TaskIsolation as ai, type TaskIsolationState as aj, type TaskModelAssignment as ak, type TaskSkillNotice as al, type TaskSkillSnapshot as am, type TaskSnapshot as an, type TaskStatus as ao, type TreeSnapshot as ap, type UsageLine as aq, type UsageRecord as ar, type UsageTotals as as, type Verdict as at, type VerificationCheck as au, addAttemptUsage as av, addModelUsage as aw, addPlannerUsage as ax, addUsage as ay, addUsageTotals as az, type AwaitingReason as b, DEFAULT_SUPERVISOR_RETRY_LIMIT as c, type DiscoveredModel as d, type ExecutionCommandName as e, type ExecutionRecord as f, type GuardTrip as g, type IntegrationDisposal as h, type InvalidSkill as i, type IsolationAvailability as j, type IsolationHandoff as k, type IsolationHandoffRepo as l, type IsolationInactiveReason as m, type IsolationLandedTask as n, type IsolationLanding as o, type IsolationMergeBlock as p, type IsolationMergeBlockReason as q, type IsolationMergeResult as r, type IsolationOutcome as s, type IsolationPruneResult as t, type IsolationRemoval as u, type IsolationRepo as v, type IsolationRun as w, type IsolationTaskRecord as x, type IsolationTaskRef as y, type IsolationTaskRepo as z };