@ordewell/core 0.7.1 → 0.7.2

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 (44) hide show
  1. package/dist/{IFileSystem-BnLh-_SK.d.mts → IFileSystem-B5asBRDa.d.mts} +1 -1
  2. package/dist/{IFileSystem-DofiRcCo.d.ts → IFileSystem-CbCmUDBn.d.ts} +1 -1
  3. package/dist/{ModeResolver-DZzJSdIU.d.mts → ModeResolver-DcqAho4y.d.mts} +1 -1
  4. package/dist/{ModeResolver-DkMYf4uS.d.ts → ModeResolver-DtfhWeVL.d.ts} +1 -1
  5. package/dist/{Task-BnLxkVQF.d.mts → Task-BpzIbunq.d.mts} +7 -2
  6. package/dist/{Task-BnLxkVQF.d.ts → Task-BpzIbunq.d.ts} +7 -2
  7. package/dist/{chunk-Y36NIASW.mjs → chunk-AJ5KDO6V.mjs} +38 -68
  8. package/dist/chunk-AJ5KDO6V.mjs.map +1 -0
  9. package/dist/chunk-H5O74L77.mjs +185 -0
  10. package/dist/chunk-H5O74L77.mjs.map +1 -0
  11. package/dist/{chunk-LGQNXPBX.mjs → chunk-MZYZS7B3.mjs} +5 -185
  12. package/dist/chunk-MZYZS7B3.mjs.map +1 -0
  13. package/dist/{chunk-ZV5LDNCO.mjs → chunk-OUIQWNS3.mjs} +6 -4
  14. package/dist/{chunk-ZV5LDNCO.mjs.map → chunk-OUIQWNS3.mjs.map} +1 -1
  15. package/dist/index.d.mts +634 -248
  16. package/dist/index.d.ts +634 -248
  17. package/dist/index.js +3605 -2735
  18. package/dist/index.js.map +1 -1
  19. package/dist/index.mjs +3610 -2713
  20. package/dist/index.mjs.map +1 -1
  21. package/dist/order-labels.d.mts +1 -1
  22. package/dist/order-labels.d.ts +1 -1
  23. package/dist/{parsing-ddZXZFP4.d.ts → parsing-COFGUEWx.d.ts} +2 -2
  24. package/dist/{parsing-B6ctfF80.d.mts → parsing-D0uo-Icd.d.mts} +2 -2
  25. package/dist/parsing.d.mts +3 -3
  26. package/dist/parsing.d.ts +3 -3
  27. package/dist/parsing.js.map +1 -1
  28. package/dist/parsing.mjs +3 -2
  29. package/dist/{plan-utils-CKgNtDwQ.d.mts → plan-utils-CdW3mxt5.d.mts} +3 -5
  30. package/dist/{plan-utils--kQRzSE-.d.ts → plan-utils-D4Z8UyLL.d.ts} +3 -5
  31. package/dist/plan-utils.d.mts +3 -3
  32. package/dist/plan-utils.d.ts +3 -3
  33. package/dist/plan-utils.js +8 -0
  34. package/dist/plan-utils.js.map +1 -1
  35. package/dist/plan-utils.mjs +6 -2
  36. package/dist/testing.d.mts +2 -2
  37. package/dist/testing.d.ts +2 -2
  38. package/dist/testing.js +5 -1
  39. package/dist/testing.js.map +1 -1
  40. package/dist/testing.mjs +5 -1
  41. package/dist/testing.mjs.map +1 -1
  42. package/package.json +1 -1
  43. package/dist/chunk-LGQNXPBX.mjs.map +0 -1
  44. package/dist/chunk-Y36NIASW.mjs.map +0 -1
@@ -1,4 +1,4 @@
1
- import { L as IApproval } from './Task-BnLxkVQF.mjs';
1
+ import { M as IApproval } from './Task-BpzIbunq.mjs';
2
2
 
3
3
  interface ToolOutcome {
4
4
  success: boolean;
@@ -1,4 +1,4 @@
1
- import { L as IApproval } from './Task-BnLxkVQF.js';
1
+ import { M as IApproval } from './Task-BpzIbunq.js';
2
2
 
3
3
  interface ToolOutcome {
4
4
  success: boolean;
@@ -1,4 +1,4 @@
1
- import { a$ as RunnerId } from './Task-BnLxkVQF.mjs';
1
+ import { b0 as RunnerId } from './Task-BpzIbunq.mjs';
2
2
 
3
3
  interface RunnerModeInfo {
4
4
  id: string;
@@ -1,4 +1,4 @@
1
- import { a$ as RunnerId } from './Task-BnLxkVQF.js';
1
+ import { b0 as RunnerId } from './Task-BpzIbunq.js';
2
2
 
3
3
  interface RunnerModeInfo {
4
4
  id: string;
@@ -713,6 +713,8 @@ type SpawnFn = (command: string, args: string[], options: {
713
713
  cwd: string;
714
714
  /** Set by the Windows batch route, where `args` is already a quoted command line. */
715
715
  windowsVerbatimArguments?: boolean;
716
+ /** Set on POSIX so the runner leads its own process group (see `spawnInOwnGroup`). */
717
+ detached?: boolean;
716
718
  }) => ChildProcess;
717
719
  /** Test seam: every OS touchpoint is injectable; production uses the defaults. */
718
720
  interface HeadlessRunnerDeps {
@@ -730,10 +732,11 @@ interface HeadlessRunnerDeps {
730
732
  declare class HeadlessSession extends AbstractTerminalSession {
731
733
  private spawnImpl;
732
734
  readonly interactive: boolean;
735
+ private platform;
733
736
  private process;
734
737
  private outputBuffer;
735
738
  private controlStream;
736
- constructor(id: string, taskId: string, spawnImpl: SpawnFn, interactive?: boolean);
739
+ constructor(id: string, taskId: string, spawnImpl: SpawnFn, interactive?: boolean, platform?: NodeJS.Platform);
737
740
  get isStarted(): boolean;
738
741
  start(launch: LaunchPlan, cwd: string, resolvedPath: string, env?: Record<string, string>, options?: {
739
742
  controlChannel?: boolean;
@@ -2551,6 +2554,8 @@ declare function opsFlag(value: unknown, type?: Task['type']): true | undefined;
2551
2554
  * task did.
2552
2555
  */
2553
2556
  declare function inheritedOps(from: readonly Pick<Task, 'ops'>[], chosen?: boolean): boolean;
2557
+ /** The runner set a plan has until one is chosen: the one runner every host ships. */
2558
+ declare const DEFAULT_RUNNERS: readonly RunnerId[];
2554
2559
  declare function createEmptyPlan(): LegacyPlanState;
2555
2560
  declare function flattenTasks(tasks: readonly Task[]): Task[];
2556
2561
  /** A flattened task with the parent it hangs under, null for a top-level task. */
@@ -2591,4 +2596,4 @@ interface ValidationContext {
2591
2596
  type ValidationCheck = (ctx: ValidationContext) => ValidationResult;
2592
2597
  declare function warningsText(w: PlanModificationWarnings): string | null;
2593
2598
 
2594
- export { type IsolationOutcome as $, AbstractRunner as A, type BlockingPrompt as B, CMD_EXE_MAX_COMMAND_LINE as C, DENY_ALL as D, type EditPlanArgs as E, EmbeddedNewlineError as F, ExecutableNotFoundError as G, type FetchAllProviderModelsOptions as H, HeadlessRunner as I, type HeadlessRunnerDeps as J, HeadlessSession as K, type IApproval as L, type IConfig as M, type IPluginStore as N, type ITerminalRunner as O, type ITerminalSession as P, type IWorktreeIsolation as Q, type IntegrationDisposal as R, type IsolationAvailability as S, type IsolationHandoff as T, type IsolationHandoffRepo as U, type IsolationInactiveReason as V, type IsolationLandedTask as W, type IsolationLanding as X, type IsolationMergeBlock as Y, type IsolationMergeBlockReason as Z, type IsolationMergeResult as _, AbstractTerminalSession as a, type RunnerId as a$, type IsolationPruneResult as a0, type IsolationRemoval as a1, type IsolationRepo as a2, type IsolationRun as a3, type IsolationTaskRecord as a4, type IsolationTaskRef as a5, type IsolationTaskRepo as a6, type IsolationTaskStatus as a7, type IsolationView as a8, type LaunchDeps as a9, type PlannerToolHandler as aA, type PlannerUsage as aB, type PluginCloneFn as aC, type PluginEntry as aD, type PluginFeatures as aE, type PluginMode as aF, type PluginModelDiscovery as aG, type PluginRunnerDef as aH, type PreparedLaunch as aI, type PreparedTask as aJ, type PreservedWork as aK, type ProviderCredentialSource as aL, type ProviderModelLists as aM, type ProviderModelsResult as aN, type PtySize as aO, type PtyWrapOptions as aP, type QueuedMessage as aQ, type QueuedTaskMessage as aR, type RefusedRemoval as aS, type RepairEvidence as aT, type RepoGroupLayout as aU, type ResearchLogEntry as aV, type ResearchProgress as aW, type ResearchStep as aX, type ResearchStepOutcome as aY, type ResearchToolType as aZ, type ResolveContext as a_, type LaunchPlan as aa, type LegacyPlanState as ab, LineBuffer as ac, type ListModelsArgs as ad, type ListRunnersArgs as ae, type McpClientConfig as af, type McpCredential as ag, type McpTool as ah, type McpToolContext as ai, type McpToolReply as aj, type Message as ak, ModelCatalog as al, type ModelShortcut as am, ORCHESTRATOR_SHORTCUTS as an, ORDEWELL_MCP_PATH as ao, ORDEWELL_MCP_SERVER_NAME as ap, type OrchestratorOption as aq, OrdewellMcpServer as ar, type OwnerOnlyFile as as, PLANNER_TOOLS as at, type PlanIsolation as au, type PlanModificationWarnings as av, type PlanState as aw, type PlanStatus as ax, type PlannerStartOptions as ay, type PlannerTokenScope as az, type ActiveTaskSession as b, inheritedOps as b$, type RunnerInvocation as b0, type RunnerPluginManifest as b1, RunnerRegistry as b2, type RunnerSpawnOptions as b3, type RunnerTransport as b4, type RunnerVersionProbe as b5, type StreamEvent as b6, type StreamStepEvent as b7, type StreamThinkingEvent as b8, type StructuredEvent as b9, type TaskWithParent as bA, type ThinkingBlock as bB, type TreeSnapshot as bC, type UsageLine as bD, type UsageRecord as bE, type UsageTotals as bF, type UserPromptEntry as bG, type UserStep as bH, type ValidationCheck as bI, type ValidationContext as bJ, type ValidationResult as bK, type Verdict as bL, type VerificationCheck as bM, WINDOWS_MAX_COMMAND_LINE as bN, addPlannerUsage as bO, addTaskToPlan as bP, addUsage as bQ, approvalScopes as bR, buildShellInvocation as bS, collectProviderCredentials as bT, createEmptyPlan as bU, createTask as bV, emptyWarnings as bW, enabledRunners as bX, fetchAllProviderModels as bY, flattenTasks as bZ, flattenTasksWithParents as b_, type StructuredSessionCapability as ba, type StructuredTurnEnd as bb, type SubagentLogEntry as bc, type SubagentOutcome as bd, type SubmitPlanArgs as be, TASK_COMPLETE_TOOL as bf, TASK_TOOLS as bg, type Task as bh, type TaskCompleteArgs as bi, type TaskIsolation as bj, type TaskIsolationState as bk, type TaskMode as bl, type TaskModeAgentAdapter as bm, TaskModeUnsupportedError as bn, type TaskModelAssignment as bo, type TaskOutputArgs as bp, type TaskOutputSummary as bq, type TaskQueryArgs as br, type TaskRunnerFlags as bs, type TaskSnapshot as bt, type TaskStartOptions as bu, type TaskStatus as bv, type TaskTokenScope as bw, type TaskToolHandler as bx, type TaskTransport as by, type TaskType as bz, type AgentAdapter as c, isAwaitingReason as c0, isExecutableResolved as c1, isGranted as c2, isMeasured as c3, isReservedRunnerName as c4, isRunnerApproval as c5, isRunnerTransport as c6, isStructuredSession as c7, keepExecutionState as c8, knownModelId as c9, mcpClientConfig as ca, migrateLegacyPlan as cb, migratePlanState as cc, migrateTask as cd, opsFlag as ce, ownerOnlyConfigFile as cf, partedPromptUsage as cg, planDirectLaunch as ch, planShellLaunch as ci, plannerContextFill as cj, posixShellQuote as ck, removeTaskFromPlan as cl, renumberTasks as cm, resolveModelShortcut as cn, resolveProvider as co, sharedMcpServer as cp, stripAnsi as cq, toApprovalDecision as cr, toOrchestratorOptions as cs, updateTaskInPlan as ct, usageLine as cu, validateModifiedPlan as cv, warningsText as cw, windowsCommandLine as cx, wrapWithPty as cy, type AgentAdapterFactory as d, type AgentEvent as e, type AgentProcessDeps as f, type AgentStartOptions as g, type AiProvider as h, type AllProviderModels as i, type ApprovalAnswer as j, type ApprovalDecision as k, type ApprovalKind as l, type ApprovalMode as m, ApprovalPolicy as n, type ApprovalPolicyOptions as o, type ApprovalRequest as p, type ApprovalSource as q, type AwaitingReason as r, type CatalogModel as s, type CheckpointAnswer as t, type CheckpointArgs as u, CommandLineTooLongError as v, type ConversationMessage as w, type DiscoveredMode as x, type DiscoveredModel as y, type DiscoveryCommand as z };
2599
+ export { type IsolationMergeResult as $, AbstractRunner as A, type BlockingPrompt as B, CMD_EXE_MAX_COMMAND_LINE as C, DEFAULT_RUNNERS as D, type DiscoveryCommand as E, type EditPlanArgs as F, EmbeddedNewlineError as G, ExecutableNotFoundError as H, type FetchAllProviderModelsOptions as I, HeadlessRunner as J, type HeadlessRunnerDeps as K, HeadlessSession as L, type IApproval as M, type IConfig as N, type IPluginStore as O, type ITerminalRunner as P, type ITerminalSession as Q, type IWorktreeIsolation as R, type IntegrationDisposal as S, type IsolationAvailability as T, type IsolationHandoff as U, type IsolationHandoffRepo as V, type IsolationInactiveReason as W, type IsolationLandedTask as X, type IsolationLanding as Y, type IsolationMergeBlock as Z, type IsolationMergeBlockReason as _, AbstractTerminalSession as a, type ResolveContext as a$, type IsolationOutcome as a0, type IsolationPruneResult as a1, type IsolationRemoval as a2, type IsolationRepo as a3, type IsolationRun as a4, type IsolationTaskRecord as a5, type IsolationTaskRef as a6, type IsolationTaskRepo as a7, type IsolationTaskStatus as a8, type IsolationView as a9, type PlannerTokenScope as aA, type PlannerToolHandler as aB, type PlannerUsage as aC, type PluginCloneFn as aD, type PluginEntry as aE, type PluginFeatures as aF, type PluginMode as aG, type PluginModelDiscovery as aH, type PluginRunnerDef as aI, type PreparedLaunch as aJ, type PreparedTask as aK, type PreservedWork as aL, type ProviderCredentialSource as aM, type ProviderModelLists as aN, type ProviderModelsResult as aO, type PtySize as aP, type PtyWrapOptions as aQ, type QueuedMessage as aR, type QueuedTaskMessage as aS, type RefusedRemoval as aT, type RepairEvidence as aU, type RepoGroupLayout as aV, type ResearchLogEntry as aW, type ResearchProgress as aX, type ResearchStep as aY, type ResearchStepOutcome as aZ, type ResearchToolType as a_, type LaunchDeps as aa, type LaunchPlan as ab, type LegacyPlanState as ac, LineBuffer as ad, type ListModelsArgs as ae, type ListRunnersArgs as af, type McpClientConfig as ag, type McpCredential as ah, type McpTool as ai, type McpToolContext as aj, type McpToolReply as ak, type Message as al, ModelCatalog as am, type ModelShortcut as an, ORCHESTRATOR_SHORTCUTS as ao, ORDEWELL_MCP_PATH as ap, ORDEWELL_MCP_SERVER_NAME as aq, type OrchestratorOption as ar, OrdewellMcpServer as as, type OwnerOnlyFile as at, PLANNER_TOOLS as au, type PlanIsolation as av, type PlanModificationWarnings as aw, type PlanState as ax, type PlanStatus as ay, type PlannerStartOptions as az, type ActiveTaskSession as b, flattenTasksWithParents as b$, type RunnerId as b0, type RunnerInvocation as b1, type RunnerPluginManifest as b2, RunnerRegistry as b3, type RunnerSpawnOptions as b4, type RunnerTransport as b5, type RunnerVersionProbe as b6, type StreamEvent as b7, type StreamStepEvent as b8, type StreamThinkingEvent as b9, type TaskType as bA, type TaskWithParent as bB, type ThinkingBlock as bC, type TreeSnapshot as bD, type UsageLine as bE, type UsageRecord as bF, type UsageTotals as bG, type UserPromptEntry as bH, type UserStep as bI, type ValidationCheck as bJ, type ValidationContext as bK, type ValidationResult as bL, type Verdict as bM, type VerificationCheck as bN, WINDOWS_MAX_COMMAND_LINE as bO, addPlannerUsage as bP, addTaskToPlan as bQ, addUsage as bR, approvalScopes as bS, buildShellInvocation as bT, collectProviderCredentials as bU, createEmptyPlan as bV, createTask as bW, emptyWarnings as bX, enabledRunners as bY, fetchAllProviderModels as bZ, flattenTasks as b_, type StructuredEvent as ba, type StructuredSessionCapability as bb, type StructuredTurnEnd as bc, type SubagentLogEntry as bd, type SubagentOutcome as be, type SubmitPlanArgs as bf, TASK_COMPLETE_TOOL as bg, TASK_TOOLS as bh, type Task as bi, type TaskCompleteArgs as bj, type TaskIsolation as bk, type TaskIsolationState as bl, type TaskMode as bm, type TaskModeAgentAdapter as bn, TaskModeUnsupportedError as bo, type TaskModelAssignment as bp, type TaskOutputArgs as bq, type TaskOutputSummary as br, type TaskQueryArgs as bs, type TaskRunnerFlags as bt, type TaskSnapshot as bu, type TaskStartOptions as bv, type TaskStatus as bw, type TaskTokenScope as bx, type TaskToolHandler as by, type TaskTransport as bz, type AgentAdapter as c, inheritedOps as c0, isAwaitingReason as c1, isExecutableResolved as c2, isGranted as c3, isMeasured as c4, isReservedRunnerName as c5, isRunnerApproval as c6, isRunnerTransport as c7, isStructuredSession as c8, keepExecutionState as c9, knownModelId as ca, mcpClientConfig as cb, migrateLegacyPlan as cc, migratePlanState as cd, migrateTask as ce, opsFlag as cf, ownerOnlyConfigFile as cg, partedPromptUsage as ch, planDirectLaunch as ci, planShellLaunch as cj, plannerContextFill as ck, posixShellQuote as cl, removeTaskFromPlan as cm, renumberTasks as cn, resolveModelShortcut as co, resolveProvider as cp, sharedMcpServer as cq, stripAnsi as cr, toApprovalDecision as cs, toOrchestratorOptions as ct, updateTaskInPlan as cu, usageLine as cv, validateModifiedPlan as cw, warningsText as cx, windowsCommandLine as cy, wrapWithPty as cz, type AgentAdapterFactory as d, type AgentEvent as e, type AgentProcessDeps as f, type AgentStartOptions as g, type AiProvider as h, type AllProviderModels as i, type ApprovalAnswer as j, type ApprovalDecision as k, type ApprovalKind as l, type ApprovalMode as m, ApprovalPolicy as n, type ApprovalPolicyOptions as o, type ApprovalRequest as p, type ApprovalSource as q, type AwaitingReason as r, type CatalogModel as s, type CheckpointAnswer as t, type CheckpointArgs as u, CommandLineTooLongError as v, type ConversationMessage as w, DENY_ALL as x, type DiscoveredMode as y, type DiscoveredModel as z };
@@ -713,6 +713,8 @@ type SpawnFn = (command: string, args: string[], options: {
713
713
  cwd: string;
714
714
  /** Set by the Windows batch route, where `args` is already a quoted command line. */
715
715
  windowsVerbatimArguments?: boolean;
716
+ /** Set on POSIX so the runner leads its own process group (see `spawnInOwnGroup`). */
717
+ detached?: boolean;
716
718
  }) => ChildProcess;
717
719
  /** Test seam: every OS touchpoint is injectable; production uses the defaults. */
718
720
  interface HeadlessRunnerDeps {
@@ -730,10 +732,11 @@ interface HeadlessRunnerDeps {
730
732
  declare class HeadlessSession extends AbstractTerminalSession {
731
733
  private spawnImpl;
732
734
  readonly interactive: boolean;
735
+ private platform;
733
736
  private process;
734
737
  private outputBuffer;
735
738
  private controlStream;
736
- constructor(id: string, taskId: string, spawnImpl: SpawnFn, interactive?: boolean);
739
+ constructor(id: string, taskId: string, spawnImpl: SpawnFn, interactive?: boolean, platform?: NodeJS.Platform);
737
740
  get isStarted(): boolean;
738
741
  start(launch: LaunchPlan, cwd: string, resolvedPath: string, env?: Record<string, string>, options?: {
739
742
  controlChannel?: boolean;
@@ -2551,6 +2554,8 @@ declare function opsFlag(value: unknown, type?: Task['type']): true | undefined;
2551
2554
  * task did.
2552
2555
  */
2553
2556
  declare function inheritedOps(from: readonly Pick<Task, 'ops'>[], chosen?: boolean): boolean;
2557
+ /** The runner set a plan has until one is chosen: the one runner every host ships. */
2558
+ declare const DEFAULT_RUNNERS: readonly RunnerId[];
2554
2559
  declare function createEmptyPlan(): LegacyPlanState;
2555
2560
  declare function flattenTasks(tasks: readonly Task[]): Task[];
2556
2561
  /** A flattened task with the parent it hangs under, null for a top-level task. */
@@ -2591,4 +2596,4 @@ interface ValidationContext {
2591
2596
  type ValidationCheck = (ctx: ValidationContext) => ValidationResult;
2592
2597
  declare function warningsText(w: PlanModificationWarnings): string | null;
2593
2598
 
2594
- export { type IsolationOutcome as $, AbstractRunner as A, type BlockingPrompt as B, CMD_EXE_MAX_COMMAND_LINE as C, DENY_ALL as D, type EditPlanArgs as E, EmbeddedNewlineError as F, ExecutableNotFoundError as G, type FetchAllProviderModelsOptions as H, HeadlessRunner as I, type HeadlessRunnerDeps as J, HeadlessSession as K, type IApproval as L, type IConfig as M, type IPluginStore as N, type ITerminalRunner as O, type ITerminalSession as P, type IWorktreeIsolation as Q, type IntegrationDisposal as R, type IsolationAvailability as S, type IsolationHandoff as T, type IsolationHandoffRepo as U, type IsolationInactiveReason as V, type IsolationLandedTask as W, type IsolationLanding as X, type IsolationMergeBlock as Y, type IsolationMergeBlockReason as Z, type IsolationMergeResult as _, AbstractTerminalSession as a, type RunnerId as a$, type IsolationPruneResult as a0, type IsolationRemoval as a1, type IsolationRepo as a2, type IsolationRun as a3, type IsolationTaskRecord as a4, type IsolationTaskRef as a5, type IsolationTaskRepo as a6, type IsolationTaskStatus as a7, type IsolationView as a8, type LaunchDeps as a9, type PlannerToolHandler as aA, type PlannerUsage as aB, type PluginCloneFn as aC, type PluginEntry as aD, type PluginFeatures as aE, type PluginMode as aF, type PluginModelDiscovery as aG, type PluginRunnerDef as aH, type PreparedLaunch as aI, type PreparedTask as aJ, type PreservedWork as aK, type ProviderCredentialSource as aL, type ProviderModelLists as aM, type ProviderModelsResult as aN, type PtySize as aO, type PtyWrapOptions as aP, type QueuedMessage as aQ, type QueuedTaskMessage as aR, type RefusedRemoval as aS, type RepairEvidence as aT, type RepoGroupLayout as aU, type ResearchLogEntry as aV, type ResearchProgress as aW, type ResearchStep as aX, type ResearchStepOutcome as aY, type ResearchToolType as aZ, type ResolveContext as a_, type LaunchPlan as aa, type LegacyPlanState as ab, LineBuffer as ac, type ListModelsArgs as ad, type ListRunnersArgs as ae, type McpClientConfig as af, type McpCredential as ag, type McpTool as ah, type McpToolContext as ai, type McpToolReply as aj, type Message as ak, ModelCatalog as al, type ModelShortcut as am, ORCHESTRATOR_SHORTCUTS as an, ORDEWELL_MCP_PATH as ao, ORDEWELL_MCP_SERVER_NAME as ap, type OrchestratorOption as aq, OrdewellMcpServer as ar, type OwnerOnlyFile as as, PLANNER_TOOLS as at, type PlanIsolation as au, type PlanModificationWarnings as av, type PlanState as aw, type PlanStatus as ax, type PlannerStartOptions as ay, type PlannerTokenScope as az, type ActiveTaskSession as b, inheritedOps as b$, type RunnerInvocation as b0, type RunnerPluginManifest as b1, RunnerRegistry as b2, type RunnerSpawnOptions as b3, type RunnerTransport as b4, type RunnerVersionProbe as b5, type StreamEvent as b6, type StreamStepEvent as b7, type StreamThinkingEvent as b8, type StructuredEvent as b9, type TaskWithParent as bA, type ThinkingBlock as bB, type TreeSnapshot as bC, type UsageLine as bD, type UsageRecord as bE, type UsageTotals as bF, type UserPromptEntry as bG, type UserStep as bH, type ValidationCheck as bI, type ValidationContext as bJ, type ValidationResult as bK, type Verdict as bL, type VerificationCheck as bM, WINDOWS_MAX_COMMAND_LINE as bN, addPlannerUsage as bO, addTaskToPlan as bP, addUsage as bQ, approvalScopes as bR, buildShellInvocation as bS, collectProviderCredentials as bT, createEmptyPlan as bU, createTask as bV, emptyWarnings as bW, enabledRunners as bX, fetchAllProviderModels as bY, flattenTasks as bZ, flattenTasksWithParents as b_, type StructuredSessionCapability as ba, type StructuredTurnEnd as bb, type SubagentLogEntry as bc, type SubagentOutcome as bd, type SubmitPlanArgs as be, TASK_COMPLETE_TOOL as bf, TASK_TOOLS as bg, type Task as bh, type TaskCompleteArgs as bi, type TaskIsolation as bj, type TaskIsolationState as bk, type TaskMode as bl, type TaskModeAgentAdapter as bm, TaskModeUnsupportedError as bn, type TaskModelAssignment as bo, type TaskOutputArgs as bp, type TaskOutputSummary as bq, type TaskQueryArgs as br, type TaskRunnerFlags as bs, type TaskSnapshot as bt, type TaskStartOptions as bu, type TaskStatus as bv, type TaskTokenScope as bw, type TaskToolHandler as bx, type TaskTransport as by, type TaskType as bz, type AgentAdapter as c, isAwaitingReason as c0, isExecutableResolved as c1, isGranted as c2, isMeasured as c3, isReservedRunnerName as c4, isRunnerApproval as c5, isRunnerTransport as c6, isStructuredSession as c7, keepExecutionState as c8, knownModelId as c9, mcpClientConfig as ca, migrateLegacyPlan as cb, migratePlanState as cc, migrateTask as cd, opsFlag as ce, ownerOnlyConfigFile as cf, partedPromptUsage as cg, planDirectLaunch as ch, planShellLaunch as ci, plannerContextFill as cj, posixShellQuote as ck, removeTaskFromPlan as cl, renumberTasks as cm, resolveModelShortcut as cn, resolveProvider as co, sharedMcpServer as cp, stripAnsi as cq, toApprovalDecision as cr, toOrchestratorOptions as cs, updateTaskInPlan as ct, usageLine as cu, validateModifiedPlan as cv, warningsText as cw, windowsCommandLine as cx, wrapWithPty as cy, type AgentAdapterFactory as d, type AgentEvent as e, type AgentProcessDeps as f, type AgentStartOptions as g, type AiProvider as h, type AllProviderModels as i, type ApprovalAnswer as j, type ApprovalDecision as k, type ApprovalKind as l, type ApprovalMode as m, ApprovalPolicy as n, type ApprovalPolicyOptions as o, type ApprovalRequest as p, type ApprovalSource as q, type AwaitingReason as r, type CatalogModel as s, type CheckpointAnswer as t, type CheckpointArgs as u, CommandLineTooLongError as v, type ConversationMessage as w, type DiscoveredMode as x, type DiscoveredModel as y, type DiscoveryCommand as z };
2599
+ export { type IsolationMergeResult as $, AbstractRunner as A, type BlockingPrompt as B, CMD_EXE_MAX_COMMAND_LINE as C, DEFAULT_RUNNERS as D, type DiscoveryCommand as E, type EditPlanArgs as F, EmbeddedNewlineError as G, ExecutableNotFoundError as H, type FetchAllProviderModelsOptions as I, HeadlessRunner as J, type HeadlessRunnerDeps as K, HeadlessSession as L, type IApproval as M, type IConfig as N, type IPluginStore as O, type ITerminalRunner as P, type ITerminalSession as Q, type IWorktreeIsolation as R, type IntegrationDisposal as S, type IsolationAvailability as T, type IsolationHandoff as U, type IsolationHandoffRepo as V, type IsolationInactiveReason as W, type IsolationLandedTask as X, type IsolationLanding as Y, type IsolationMergeBlock as Z, type IsolationMergeBlockReason as _, AbstractTerminalSession as a, type ResolveContext as a$, type IsolationOutcome as a0, type IsolationPruneResult as a1, type IsolationRemoval as a2, type IsolationRepo as a3, type IsolationRun as a4, type IsolationTaskRecord as a5, type IsolationTaskRef as a6, type IsolationTaskRepo as a7, type IsolationTaskStatus as a8, type IsolationView as a9, type PlannerTokenScope as aA, type PlannerToolHandler as aB, type PlannerUsage as aC, type PluginCloneFn as aD, type PluginEntry as aE, type PluginFeatures as aF, type PluginMode as aG, type PluginModelDiscovery as aH, type PluginRunnerDef as aI, type PreparedLaunch as aJ, type PreparedTask as aK, type PreservedWork as aL, type ProviderCredentialSource as aM, type ProviderModelLists as aN, type ProviderModelsResult as aO, type PtySize as aP, type PtyWrapOptions as aQ, type QueuedMessage as aR, type QueuedTaskMessage as aS, type RefusedRemoval as aT, type RepairEvidence as aU, type RepoGroupLayout as aV, type ResearchLogEntry as aW, type ResearchProgress as aX, type ResearchStep as aY, type ResearchStepOutcome as aZ, type ResearchToolType as a_, type LaunchDeps as aa, type LaunchPlan as ab, type LegacyPlanState as ac, LineBuffer as ad, type ListModelsArgs as ae, type ListRunnersArgs as af, type McpClientConfig as ag, type McpCredential as ah, type McpTool as ai, type McpToolContext as aj, type McpToolReply as ak, type Message as al, ModelCatalog as am, type ModelShortcut as an, ORCHESTRATOR_SHORTCUTS as ao, ORDEWELL_MCP_PATH as ap, ORDEWELL_MCP_SERVER_NAME as aq, type OrchestratorOption as ar, OrdewellMcpServer as as, type OwnerOnlyFile as at, PLANNER_TOOLS as au, type PlanIsolation as av, type PlanModificationWarnings as aw, type PlanState as ax, type PlanStatus as ay, type PlannerStartOptions as az, type ActiveTaskSession as b, flattenTasksWithParents as b$, type RunnerId as b0, type RunnerInvocation as b1, type RunnerPluginManifest as b2, RunnerRegistry as b3, type RunnerSpawnOptions as b4, type RunnerTransport as b5, type RunnerVersionProbe as b6, type StreamEvent as b7, type StreamStepEvent as b8, type StreamThinkingEvent as b9, type TaskType as bA, type TaskWithParent as bB, type ThinkingBlock as bC, type TreeSnapshot as bD, type UsageLine as bE, type UsageRecord as bF, type UsageTotals as bG, type UserPromptEntry as bH, type UserStep as bI, type ValidationCheck as bJ, type ValidationContext as bK, type ValidationResult as bL, type Verdict as bM, type VerificationCheck as bN, WINDOWS_MAX_COMMAND_LINE as bO, addPlannerUsage as bP, addTaskToPlan as bQ, addUsage as bR, approvalScopes as bS, buildShellInvocation as bT, collectProviderCredentials as bU, createEmptyPlan as bV, createTask as bW, emptyWarnings as bX, enabledRunners as bY, fetchAllProviderModels as bZ, flattenTasks as b_, type StructuredEvent as ba, type StructuredSessionCapability as bb, type StructuredTurnEnd as bc, type SubagentLogEntry as bd, type SubagentOutcome as be, type SubmitPlanArgs as bf, TASK_COMPLETE_TOOL as bg, TASK_TOOLS as bh, type Task as bi, type TaskCompleteArgs as bj, type TaskIsolation as bk, type TaskIsolationState as bl, type TaskMode as bm, type TaskModeAgentAdapter as bn, TaskModeUnsupportedError as bo, type TaskModelAssignment as bp, type TaskOutputArgs as bq, type TaskOutputSummary as br, type TaskQueryArgs as bs, type TaskRunnerFlags as bt, type TaskSnapshot as bu, type TaskStartOptions as bv, type TaskStatus as bw, type TaskTokenScope as bx, type TaskToolHandler as by, type TaskTransport as bz, type AgentAdapter as c, inheritedOps as c0, isAwaitingReason as c1, isExecutableResolved as c2, isGranted as c3, isMeasured as c4, isReservedRunnerName as c5, isRunnerApproval as c6, isRunnerTransport as c7, isStructuredSession as c8, keepExecutionState as c9, knownModelId as ca, mcpClientConfig as cb, migrateLegacyPlan as cc, migratePlanState as cd, migrateTask as ce, opsFlag as cf, ownerOnlyConfigFile as cg, partedPromptUsage as ch, planDirectLaunch as ci, planShellLaunch as cj, plannerContextFill as ck, posixShellQuote as cl, removeTaskFromPlan as cm, renumberTasks as cn, resolveModelShortcut as co, resolveProvider as cp, sharedMcpServer as cq, stripAnsi as cr, toApprovalDecision as cs, toOrchestratorOptions as ct, updateTaskInPlan as cu, usageLine as cv, validateModifiedPlan as cw, warningsText as cx, windowsCommandLine as cy, wrapWithPty as cz, type AgentAdapterFactory as d, type AgentEvent as e, type AgentProcessDeps as f, type AgentStartOptions as g, type AiProvider as h, type AllProviderModels as i, type ApprovalAnswer as j, type ApprovalDecision as k, type ApprovalKind as l, type ApprovalMode as m, ApprovalPolicy as n, type ApprovalPolicyOptions as o, type ApprovalRequest as p, type ApprovalSource as q, type AwaitingReason as r, type CatalogModel as s, type CheckpointAnswer as t, type CheckpointArgs as u, CommandLineTooLongError as v, type ConversationMessage as w, DENY_ALL as x, type DiscoveredMode as y, type DiscoveredModel as z };
@@ -1,18 +1,20 @@
1
1
  import {
2
2
  PlanParseError,
3
3
  TASK_OPS_ENVELOPE_KEY,
4
- addTaskToPlan,
5
- createTask,
6
4
  escapeControlCharsInStrings,
7
5
  extractObjectsWithKey,
6
+ stripTrailingCommas
7
+ } from "./chunk-H5O74L77.mjs";
8
+ import {
9
+ addTaskToPlan,
10
+ createTask,
8
11
  flattenTasks,
9
12
  inheritedOps,
10
13
  opsFlag,
11
14
  removeTaskFromPlan,
12
15
  renumberTasks,
13
- stripTrailingCommas,
14
16
  updateTaskInPlan
15
- } from "./chunk-LGQNXPBX.mjs";
17
+ } from "./chunk-MZYZS7B3.mjs";
16
18
  import {
17
19
  taskOrderLabel,
18
20
  taskRef,
@@ -1328,41 +1330,38 @@ function applyTaskOps(currentTasks, ops, runners, catalog) {
1328
1330
  }
1329
1331
  return { ids, bad };
1330
1332
  };
1333
+ const prepareEdit = (op, opIndex, label, audience, refuseRunning = false) => {
1334
+ const ref = resolveRef(op.taskId, originalFlatAll, flattenTasks(tasks), handleOwner, handleId, opIndex);
1335
+ if ("error" in ref) return { error: `${label}: ${ref.error}` };
1336
+ const target = findInTasks(tasks, ref.id);
1337
+ if (!target) return { error: `${label}: task "${op.taskId}" no longer exists in this batch (removed, merged, or split by an earlier op)` };
1338
+ if (refuseRunning && target.status === "in_progress") return { error: `${label}: "${target.title}" is running and cannot be re-armed` };
1339
+ const changes = updatableChanges(op.changes);
1340
+ if (changes.assignedRunner && !runners.includes(changes.assignedRunner)) {
1341
+ return { error: `${label}: runner "${changes.assignedRunner}" is not in this plan's runner set [${runners.join(", ")}]` };
1342
+ }
1343
+ const changesForCheck = { ...changes };
1344
+ delete changesForCheck.dependencies;
1345
+ const check = validateTaskEdit(audience, flattenTasks(tasks), target.id, changesForCheck, catalog);
1346
+ if (!check.ok) return { error: `${label}: ${check.error}` };
1347
+ for (const field of check.clear ?? []) changes[field] = void 0;
1348
+ if ("dependencies" in changes) {
1349
+ const { ids, bad } = resolveDeps(changes.dependencies, opIndex);
1350
+ if (bad.length) return { error: `${label}: unknown dependencies: ${bad.join(", ")}` };
1351
+ changes.dependencies = ids.filter((id) => id !== target.id);
1352
+ }
1353
+ return { target, changes, check };
1354
+ };
1331
1355
  for (const [i, op] of ops.entries()) {
1332
1356
  const label = `op ${i + 1} (${op.op})`;
1333
1357
  switch (op.op) {
1334
1358
  case "update": {
1335
- const ref = resolveRef(op.taskId, originalFlatAll, flattenTasks(tasks), handleOwner, handleId, i);
1336
- if ("error" in ref) {
1337
- errors.push(`${label}: ${ref.error}`);
1359
+ const prep = prepareEdit(op, i, label, "planner");
1360
+ if ("error" in prep) {
1361
+ errors.push(prep.error);
1338
1362
  break;
1339
1363
  }
1340
- const target = findInTasks(tasks, ref.id);
1341
- if (!target) {
1342
- errors.push(`${label}: task "${op.taskId}" no longer exists in this batch (removed, merged, or split by an earlier op)`);
1343
- break;
1344
- }
1345
- const changes = updatableChanges(op.changes);
1346
- if (changes.assignedRunner && !runners.includes(changes.assignedRunner)) {
1347
- errors.push(`${label}: runner "${changes.assignedRunner}" is not in this plan's runner set [${runners.join(", ")}]`);
1348
- break;
1349
- }
1350
- const changesForCheck = { ...changes };
1351
- delete changesForCheck.dependencies;
1352
- const check = validateTaskEdit("planner", flattenTasks(tasks), target.id, changesForCheck, catalog);
1353
- if (!check.ok) {
1354
- errors.push(`${label}: ${check.error}`);
1355
- break;
1356
- }
1357
- for (const field of check.clear ?? []) changes[field] = void 0;
1358
- if ("dependencies" in changes) {
1359
- const { ids, bad } = resolveDeps(changes.dependencies, i);
1360
- if (bad.length) {
1361
- errors.push(`${label}: unknown dependencies: ${bad.join(", ")}`);
1362
- break;
1363
- }
1364
- changes.dependencies = ids.filter((id) => id !== target.id);
1365
- }
1364
+ const { target, changes, check } = prep;
1366
1365
  if (Object.keys(changes).length === 0) {
1367
1366
  errors.push(`${label}: no valid changes provided`);
1368
1367
  break;
@@ -1459,7 +1458,7 @@ function applyTaskOps(currentTasks, ops, runners, catalog) {
1459
1458
  errors.push(`${label}: unknown task in merge list (already removed, merged, or split by an earlier op)`);
1460
1459
  break;
1461
1460
  }
1462
- const toMerge = resolved.map((t) => t).sort((a, b) => a.order - b.order);
1461
+ const toMerge = [...new Map(resolved.map((t) => [t.id, t])).values()].sort((a, b) => a.order - b.order);
1463
1462
  if (toMerge.length < 2) {
1464
1463
  errors.push(`${label}: merge needs at least two tasks`);
1465
1464
  break;
@@ -1597,41 +1596,12 @@ function applyTaskOps(currentTasks, ops, runners, catalog) {
1597
1596
  break;
1598
1597
  }
1599
1598
  case "rearm": {
1600
- const ref = resolveRef(op.taskId, originalFlatAll, flattenTasks(tasks), handleOwner, handleId, i);
1601
- if ("error" in ref) {
1602
- errors.push(`${label}: ${ref.error}`);
1603
- break;
1604
- }
1605
- const target = findInTasks(tasks, ref.id);
1606
- if (!target) {
1607
- errors.push(`${label}: task "${op.taskId}" no longer exists in this batch (removed, merged, or split by an earlier op)`);
1599
+ const prep = prepareEdit(op, i, label, "direct", true);
1600
+ if ("error" in prep) {
1601
+ errors.push(prep.error);
1608
1602
  break;
1609
1603
  }
1610
- if (target.status === "in_progress") {
1611
- errors.push(`${label}: "${target.title}" is running and cannot be re-armed`);
1612
- break;
1613
- }
1614
- const changes = updatableChanges(op.changes);
1615
- if (changes.assignedRunner && !runners.includes(changes.assignedRunner)) {
1616
- errors.push(`${label}: runner "${changes.assignedRunner}" is not in this plan's runner set [${runners.join(", ")}]`);
1617
- break;
1618
- }
1619
- const changesForCheck = { ...changes };
1620
- delete changesForCheck.dependencies;
1621
- const check = validateTaskEdit("direct", flattenTasks(tasks), target.id, changesForCheck, catalog);
1622
- if (!check.ok) {
1623
- errors.push(`${label}: ${check.error}`);
1624
- break;
1625
- }
1626
- for (const field of check.clear ?? []) changes[field] = void 0;
1627
- if ("dependencies" in changes) {
1628
- const { ids, bad } = resolveDeps(changes.dependencies, i);
1629
- if (bad.length) {
1630
- errors.push(`${label}: unknown dependencies: ${bad.join(", ")}`);
1631
- break;
1632
- }
1633
- changes.dependencies = ids.filter((id) => id !== target.id);
1634
- }
1604
+ const { target, changes, check } = prep;
1635
1605
  tasks = updateTaskInPlan(tasks, target.id, { ...changes, status: "pending", verdict: void 0, outputSummary: void 0, awaitingReason: void 0 });
1636
1606
  for (const dep of flattenTasks(tasks)) {
1637
1607
  if (dep.status === "blocked" && dep.dependencies.includes(target.id)) {
@@ -2359,4 +2329,4 @@ export {
2359
2329
  pastGateConfirmation,
2360
2330
  newTaskFields
2361
2331
  };
2362
- //# sourceMappingURL=chunk-Y36NIASW.mjs.map
2332
+ //# sourceMappingURL=chunk-AJ5KDO6V.mjs.map