@ordewell/core 0.5.6 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{IFileSystem-BkPX7mLD.d.mts → IFileSystem-CFYf4yR2.d.mts} +1 -1
- package/dist/{IFileSystem-C0l-4MGT.d.ts → IFileSystem-D4dAl2r8.d.ts} +1 -1
- package/dist/{ModeResolver--16lh7dS.d.mts → ModeResolver-DVYVRbJp.d.ts} +6 -2
- package/dist/{ModeResolver-CjpG5Wli.d.ts → ModeResolver-a4xJFlEp.d.mts} +6 -2
- package/dist/{Task-Dyxp67s2.d.mts → Task-CZJr6rmz.d.mts} +47 -12
- package/dist/{Task-Dyxp67s2.d.ts → Task-CZJr6rmz.d.ts} +47 -12
- package/dist/{chunk-ROVYWEBI.mjs → chunk-2SOVKO7P.mjs} +3 -2
- package/dist/chunk-2SOVKO7P.mjs.map +1 -0
- package/dist/{chunk-JBEFAJ2W.mjs → chunk-OM4D274O.mjs} +19 -1
- package/dist/chunk-OM4D274O.mjs.map +1 -0
- package/dist/index.d.mts +207 -45
- package/dist/index.d.ts +207 -45
- package/dist/index.js +5290 -4409
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4878 -4015
- package/dist/index.mjs.map +1 -1
- package/dist/order-labels.d.mts +1 -1
- package/dist/order-labels.d.ts +1 -1
- package/dist/{parsing-EcmCsF1y.d.ts → parsing-Bd6-b644.d.ts} +2 -2
- package/dist/{parsing-DPEpAszP.d.mts → parsing-DIaGZmiQ.d.mts} +2 -2
- package/dist/parsing.d.mts +3 -3
- package/dist/parsing.d.ts +3 -3
- package/dist/parsing.js.map +1 -1
- package/dist/parsing.mjs +1 -1
- package/dist/{plan-utils-BAvW3hvl.d.mts → plan-utils-Ba-l8EZS.d.mts} +2 -2
- package/dist/{plan-utils-BMyEiDKv.d.ts → plan-utils-_T5S7Mnk.d.ts} +2 -2
- package/dist/plan-utils.d.mts +3 -3
- package/dist/plan-utils.d.ts +3 -3
- package/dist/plan-utils.js +2 -1
- package/dist/plan-utils.js.map +1 -1
- package/dist/plan-utils.mjs +1 -1
- package/dist/testing.d.mts +2 -2
- package/dist/testing.d.ts +2 -2
- package/package.json +1 -1
- package/dist/chunk-JBEFAJ2W.mjs.map +0 -1
- package/dist/chunk-ROVYWEBI.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aG as RunnerId } from './Task-
|
|
1
|
+
import { aG as RunnerId } from './Task-CZJr6rmz.js';
|
|
2
2
|
|
|
3
3
|
interface RunnerModeInfo {
|
|
4
4
|
id: string;
|
|
@@ -38,7 +38,11 @@ declare function resolveDefaultMode(modes: RunnerModeInfo[] | undefined, autonom
|
|
|
38
38
|
* either toggle.
|
|
39
39
|
*/
|
|
40
40
|
declare function filteredBuildModes(modes: RunnerModeInfo[], autonomousDefault: boolean): RunnerModeInfo[];
|
|
41
|
+
/** The user-facing name of the `autonomousMode` boolean's two states. */
|
|
42
|
+
declare function autonomyLevelLabel(autonomous: boolean): 'Full auto' | 'Auto';
|
|
43
|
+
/** `full`/`auto` name the levels; `on`/`off` are the toggle's old words for them. Null for anything else. */
|
|
44
|
+
declare function parseAutonomyLevel(arg: string | undefined): boolean | null;
|
|
41
45
|
declare function buildModeGuide(runnerModes: Record<RunnerId, RunnerModeInfo[]>, autonomousDefault?: boolean): string;
|
|
42
46
|
declare function resolveTaskMode(emittedMode: string | undefined, runnerId: RunnerId, runnerModes: Record<RunnerId, RunnerModeInfo[]> | undefined, autonomousDefault?: boolean): string;
|
|
43
47
|
|
|
44
|
-
export { type ManifestLookup as M, type RunnerModeInfo as R,
|
|
48
|
+
export { type ManifestLookup as M, type RunnerModeInfo as R, autonomyLevelLabel as a, buildModeGuide as b, resolveTaskMode as c, runnerModesFrom as d, filteredBuildModes as f, parseAutonomyLevel as p, resolveDefaultMode as r };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aG as RunnerId } from './Task-
|
|
1
|
+
import { aG as RunnerId } from './Task-CZJr6rmz.mjs';
|
|
2
2
|
|
|
3
3
|
interface RunnerModeInfo {
|
|
4
4
|
id: string;
|
|
@@ -38,7 +38,11 @@ declare function resolveDefaultMode(modes: RunnerModeInfo[] | undefined, autonom
|
|
|
38
38
|
* either toggle.
|
|
39
39
|
*/
|
|
40
40
|
declare function filteredBuildModes(modes: RunnerModeInfo[], autonomousDefault: boolean): RunnerModeInfo[];
|
|
41
|
+
/** The user-facing name of the `autonomousMode` boolean's two states. */
|
|
42
|
+
declare function autonomyLevelLabel(autonomous: boolean): 'Full auto' | 'Auto';
|
|
43
|
+
/** `full`/`auto` name the levels; `on`/`off` are the toggle's old words for them. Null for anything else. */
|
|
44
|
+
declare function parseAutonomyLevel(arg: string | undefined): boolean | null;
|
|
41
45
|
declare function buildModeGuide(runnerModes: Record<RunnerId, RunnerModeInfo[]>, autonomousDefault?: boolean): string;
|
|
42
46
|
declare function resolveTaskMode(emittedMode: string | undefined, runnerId: RunnerId, runnerModes: Record<RunnerId, RunnerModeInfo[]> | undefined, autonomousDefault?: boolean): string;
|
|
43
47
|
|
|
44
|
-
export { type ManifestLookup as M, type RunnerModeInfo as R,
|
|
48
|
+
export { type ManifestLookup as M, type RunnerModeInfo as R, autonomyLevelLabel as a, buildModeGuide as b, resolveTaskMode as c, runnerModesFrom as d, filteredBuildModes as f, parseAutonomyLevel as p, resolveDefaultMode as r };
|
|
@@ -7,13 +7,14 @@ import { EventEmitter } from 'events';
|
|
|
7
7
|
* "run without isolation", while the others fall back to the shared
|
|
8
8
|
* workspace root with a one-line notice.
|
|
9
9
|
*/
|
|
10
|
-
type IsolationInactiveReason = 'disabled' | 'git-missing' | 'not-git' | 'no-commits' | 'dirty'
|
|
10
|
+
type IsolationInactiveReason = 'disabled' | 'git-missing' | 'not-git' | 'no-commits' | 'dirty';
|
|
11
11
|
/**
|
|
12
12
|
* `repos` names, relative to the workspace, the repositories behind the answer:
|
|
13
13
|
* when active, the ones that will isolate, with `shared` the paths every task
|
|
14
|
-
* will share live
|
|
15
|
-
*
|
|
16
|
-
* group of
|
|
14
|
+
* will share live — loose entries of the workspace root, or, for a lone
|
|
15
|
+
* repository, the repositories nested inside it; otherwise the dirty ones of a
|
|
16
|
+
* `dirty` group, or the commitless ones of a `no-commits` group. A group of one
|
|
17
|
+
* names none.
|
|
17
18
|
*/
|
|
18
19
|
type IsolationAvailability = {
|
|
19
20
|
active: true;
|
|
@@ -27,7 +28,8 @@ type IsolationAvailability = {
|
|
|
27
28
|
/**
|
|
28
29
|
* Where a run's tasks work, as the planner is told it: the repos of the group
|
|
29
30
|
* and the paths shared live between tasks. A lone repository is `['.']` with
|
|
30
|
-
* nothing shared
|
|
31
|
+
* nothing shared, unless it holds nested repositories, which are shared live
|
|
32
|
+
* and named in `shared`.
|
|
31
33
|
*/
|
|
32
34
|
interface RepoGroupLayout {
|
|
33
35
|
repos: string[];
|
|
@@ -49,9 +51,11 @@ interface IsolationTaskRepo {
|
|
|
49
51
|
/** Absolute path of this repo's worktree: the task workspace joined with the repo's path. */
|
|
50
52
|
worktree: string;
|
|
51
53
|
/**
|
|
52
|
-
* Paths
|
|
53
|
-
*
|
|
54
|
-
*
|
|
54
|
+
* Paths linked from the real workspace and kept out of the task's commit:
|
|
55
|
+
* the artifacts bootstrapped from the real repo, and a lone repository's
|
|
56
|
+
* nested repositories (`run.shared`). Recorded because a symlink is not
|
|
57
|
+
* matched by an ignore rule such as `node_modules/` and would otherwise be
|
|
58
|
+
* committed.
|
|
55
59
|
*/
|
|
56
60
|
linked: string[];
|
|
57
61
|
/** Whether the task brought commits to this repo; unknown until it first integrates. */
|
|
@@ -142,7 +146,9 @@ interface IsolationRun {
|
|
|
142
146
|
/**
|
|
143
147
|
* Workspace paths outside every isolated repo, linked live into each task
|
|
144
148
|
* workspace: loose entries of the workspace root, the entries beside a deeper
|
|
145
|
-
* repo, and `sharedRepos`.
|
|
149
|
+
* repo, and `sharedRepos`. For a lone repository, the repositories nested
|
|
150
|
+
* inside it, which cannot be isolated with it and so are linked live instead.
|
|
151
|
+
* Empty when a group of one holds no nested repositories.
|
|
146
152
|
*/
|
|
147
153
|
shared: string[];
|
|
148
154
|
/** Repos of the group that could not be isolated — no commits, or git refused a worktree — and are among `shared`. */
|
|
@@ -817,6 +823,12 @@ interface ApprovalRequest {
|
|
|
817
823
|
* second file from an already-approved directory does not prompt again.
|
|
818
824
|
*/
|
|
819
825
|
scope: string;
|
|
826
|
+
/**
|
|
827
|
+
* Every scope one answer settles, when a command needs more than one — its
|
|
828
|
+
* own and each outside directory it touches — so it prompts once rather than
|
|
829
|
+
* once per scope. `scope` is the first. Absent means `scope` alone.
|
|
830
|
+
*/
|
|
831
|
+
scopes?: string[];
|
|
820
832
|
/** One-line context for the prompt. */
|
|
821
833
|
detail?: string;
|
|
822
834
|
/** The task whose runner asked; absent for the planner's own requests. */
|
|
@@ -841,6 +853,7 @@ type ApprovalDecision = {
|
|
|
841
853
|
type ApprovalAnswer = boolean | ApprovalDecision;
|
|
842
854
|
declare function toApprovalDecision(answer: ApprovalAnswer): ApprovalDecision;
|
|
843
855
|
declare function isGranted(decision: ApprovalDecision): boolean;
|
|
856
|
+
declare function approvalScopes(request: ApprovalRequest): string[];
|
|
844
857
|
declare function isRunnerApproval(request: ApprovalRequest): boolean;
|
|
845
858
|
interface IApproval {
|
|
846
859
|
request(req: ApprovalRequest): Promise<boolean>;
|
|
@@ -937,6 +950,8 @@ type AgentEvent =
|
|
|
937
950
|
*
|
|
938
951
|
* `input` and `suggestions` are the raw request; `suggestions` are the
|
|
939
952
|
* agent's own session-scoped grants, what "Allow for this task" answers with.
|
|
953
|
+
* `decided` marks a request the task's mode already answered — the adapter
|
|
954
|
+
* replied as the manifest says that mode does — so it is shown, never asked.
|
|
940
955
|
*/
|
|
941
956
|
| {
|
|
942
957
|
type: 'permission_request';
|
|
@@ -946,6 +961,7 @@ type AgentEvent =
|
|
|
946
961
|
input?: Record<string, unknown>;
|
|
947
962
|
suggestions?: unknown[];
|
|
948
963
|
toolUseId?: string;
|
|
964
|
+
decided?: ApprovalDecision;
|
|
949
965
|
}
|
|
950
966
|
/** The agent withdrew an open request — an interrupt cancels the call it was for. It takes no answer now. */
|
|
951
967
|
| {
|
|
@@ -1005,8 +1021,10 @@ interface PlannerStartOptions extends AgentStartCommon {
|
|
|
1005
1021
|
interface TaskRunnerFlags {
|
|
1006
1022
|
/** The runner's own permission-mode value for the task's mode. */
|
|
1007
1023
|
permissionMode: string;
|
|
1008
|
-
/**
|
|
1009
|
-
|
|
1024
|
+
/** The task's raw effort id, present only alongside a model. Each adapter maps it to its own protocol. */
|
|
1025
|
+
effort?: string;
|
|
1026
|
+
/** The manifest's further settings for the task's mode, by setting name — see `PluginFeatures.modeSettings`. */
|
|
1027
|
+
modeSettings: Record<string, string>;
|
|
1010
1028
|
}
|
|
1011
1029
|
/** A plan task driven over the runner's programmatic protocol (ADR-0018, C1). */
|
|
1012
1030
|
interface TaskStartOptions extends AgentStartCommon {
|
|
@@ -1059,6 +1077,13 @@ interface TaskModeAgentAdapter extends AgentAdapter {
|
|
|
1059
1077
|
* within `timeoutMs`, and the caller must fall back to killing it.
|
|
1060
1078
|
*/
|
|
1061
1079
|
interrupt(timeoutMs: number): Promise<boolean>;
|
|
1080
|
+
/**
|
|
1081
|
+
* Registers the listener for what the agent does after a turn has ended and
|
|
1082
|
+
* before the next message — a turn it opens itself when background work
|
|
1083
|
+
* finishes, most often. Without one that output is dropped, which is right
|
|
1084
|
+
* for a planner and wrong for a task, whose marker may be said there.
|
|
1085
|
+
*/
|
|
1086
|
+
onOutOfTurn?(listener: (event: AgentEvent) => void): void;
|
|
1062
1087
|
/** Registers a listener for the process ending, for any reason. Fires at most once. */
|
|
1063
1088
|
onProcessExit(listener: (code: number) => void): void;
|
|
1064
1089
|
/**
|
|
@@ -1158,6 +1183,16 @@ interface PluginFeatures {
|
|
|
1158
1183
|
thinkingValueAdaptive?: string;
|
|
1159
1184
|
/** Maps mode IDs to the CLI --permission-mode value. Used by {{feature:permissionModeVal}}. */
|
|
1160
1185
|
permissionModeValues?: Record<string, string>;
|
|
1186
|
+
/**
|
|
1187
|
+
* Further per-mode settings for runners whose permission story has more than
|
|
1188
|
+
* one axis (Codex: sandbox, approval policy, approvals reviewer). Keyed by
|
|
1189
|
+
* setting name, then by mode id; a mode a map does not name leaves that
|
|
1190
|
+
* setting to the runner's own default. Codex declares `approvalPolicy`
|
|
1191
|
+
* (`-a` / `approval_policy`) and `approvalsReviewer` (`approvals_reviewer`);
|
|
1192
|
+
* the terminal template reads them too, through `{{feature:approvalPolicyVal}}`
|
|
1193
|
+
* and the `*Config` tokens.
|
|
1194
|
+
*/
|
|
1195
|
+
modeSettings?: Record<string, Record<string, string>>;
|
|
1161
1196
|
}
|
|
1162
1197
|
type PluginParser = 'claude-help' | 'opencode-models' | 'opencode-models-verbose' | 'anthropic-models' | 'line-by-line' | 'json' | 'json-table';
|
|
1163
1198
|
interface DiscoveryCommand {
|
|
@@ -2083,4 +2118,4 @@ interface ValidationContext {
|
|
|
2083
2118
|
type ValidationCheck = (ctx: ValidationContext) => ValidationResult;
|
|
2084
2119
|
declare function warningsText(w: PlanModificationWarnings): string | null;
|
|
2085
2120
|
|
|
2086
|
-
export { type IsolationRun as $, AbstractRunner as A, type BlockingPrompt as B, CMD_EXE_MAX_COMMAND_LINE as C, DENY_ALL as D, EmbeddedNewlineError as E, type FetchAllProviderModelsOptions as F, HeadlessSession as G, HeadlessRunner as H, type IApproval as I, type IConfig as J, type IPluginStore as K, type ITerminalRunner as L, type ITerminalSession as M, type IWorktreeIsolation as N, type IntegrationDisposal as O, type IsolationAvailability as P, type IsolationHandoff as Q, type IsolationHandoffRepo as R, type IsolationInactiveReason as S, type IsolationLandedTask as T, type IsolationLanding as U, type IsolationMergeBlock as V, type IsolationMergeBlockReason as W, type IsolationMergeResult as X, type IsolationOutcome as Y, type IsolationPruneResult as Z, type IsolationRepo as _, AbstractTerminalSession as a, type TaskOutputSummary as a$, type IsolationTaskRecord as a0, type IsolationTaskRepo as a1, type IsolationTaskStatus as a2, type IsolationView as a3, type LaunchDeps as a4, type LaunchPlan as a5, type LegacyPlanState as a6, LineBuffer as a7, type Message as a8, ModelCatalog as a9, type ResearchLogEntry as aA, type ResearchProgress as aB, type ResearchStep as aC, type ResearchStepOutcome as aD, type ResearchToolType as aE, type ResolveContext as aF, type RunnerId as aG, type RunnerInvocation as aH, type RunnerPluginManifest as aI, RunnerRegistry as aJ, type RunnerSpawnOptions as aK, type RunnerTransport as aL, type StreamEvent as aM, type StreamStepEvent as aN, type StreamThinkingEvent as aO, type StructuredEvent as aP, type StructuredSessionCapability as aQ, type StructuredTurnEnd as aR, type SubagentLogEntry as aS, type SubagentOutcome as aT, type Task as aU, type TaskIsolation as aV, type TaskIsolationState as aW, type TaskMode as aX, type TaskModeAgentAdapter as aY, TaskModeUnsupportedError as aZ, type TaskModelAssignment as a_, type ModelShortcut as aa, ORCHESTRATOR_SHORTCUTS as ab, type OrchestratorOption as ac, type PlanIsolation as ad, type PlanModificationWarnings as ae, type PlanState as af, type PlanStatus as ag, type PlannerStartOptions as ah, type PlannerUsage as ai, type PluginCloneFn as aj, type PluginEntry as ak, type PluginFeatures as al, type PluginMode as am, type PluginModelDiscovery as an, type PluginRunnerDef as ao, type PreparedLaunch as ap, type PreparedTask as aq, type ProviderCredentialSource as ar, type ProviderModelLists as as, type ProviderModelsResult as at, type PtySize as au, type PtyWrapOptions as av, type QueuedMessage as aw, type QueuedTaskMessage as ax, type RepairEvidence as ay, type RepoGroupLayout as az, type ActiveTaskSession as b, type TaskRunnerFlags as b0, type TaskSnapshot as b1, type TaskStartOptions as b2, type TaskStatus as b3, type TaskTransport as b4, type TaskType as b5, type TaskWithParent as b6, type ThinkingBlock as b7, type UsageLine as b8, type UsageRecord as b9,
|
|
2121
|
+
export { type IsolationRun as $, AbstractRunner as A, type BlockingPrompt as B, CMD_EXE_MAX_COMMAND_LINE as C, DENY_ALL as D, EmbeddedNewlineError as E, type FetchAllProviderModelsOptions as F, HeadlessSession as G, HeadlessRunner as H, type IApproval as I, type IConfig as J, type IPluginStore as K, type ITerminalRunner as L, type ITerminalSession as M, type IWorktreeIsolation as N, type IntegrationDisposal as O, type IsolationAvailability as P, type IsolationHandoff as Q, type IsolationHandoffRepo as R, type IsolationInactiveReason as S, type IsolationLandedTask as T, type IsolationLanding as U, type IsolationMergeBlock as V, type IsolationMergeBlockReason as W, type IsolationMergeResult as X, type IsolationOutcome as Y, type IsolationPruneResult as Z, type IsolationRepo as _, AbstractTerminalSession as a, type TaskOutputSummary as a$, type IsolationTaskRecord as a0, type IsolationTaskRepo as a1, type IsolationTaskStatus as a2, type IsolationView as a3, type LaunchDeps as a4, type LaunchPlan as a5, type LegacyPlanState as a6, LineBuffer as a7, type Message as a8, ModelCatalog as a9, type ResearchLogEntry as aA, type ResearchProgress as aB, type ResearchStep as aC, type ResearchStepOutcome as aD, type ResearchToolType as aE, type ResolveContext as aF, type RunnerId as aG, type RunnerInvocation as aH, type RunnerPluginManifest as aI, RunnerRegistry as aJ, type RunnerSpawnOptions as aK, type RunnerTransport as aL, type StreamEvent as aM, type StreamStepEvent as aN, type StreamThinkingEvent as aO, type StructuredEvent as aP, type StructuredSessionCapability as aQ, type StructuredTurnEnd as aR, type SubagentLogEntry as aS, type SubagentOutcome as aT, type Task as aU, type TaskIsolation as aV, type TaskIsolationState as aW, type TaskMode as aX, type TaskModeAgentAdapter as aY, TaskModeUnsupportedError as aZ, type TaskModelAssignment as a_, type ModelShortcut as aa, ORCHESTRATOR_SHORTCUTS as ab, type OrchestratorOption as ac, type PlanIsolation as ad, type PlanModificationWarnings as ae, type PlanState as af, type PlanStatus as ag, type PlannerStartOptions as ah, type PlannerUsage as ai, type PluginCloneFn as aj, type PluginEntry as ak, type PluginFeatures as al, type PluginMode as am, type PluginModelDiscovery as an, type PluginRunnerDef as ao, type PreparedLaunch as ap, type PreparedTask as aq, type ProviderCredentialSource as ar, type ProviderModelLists as as, type ProviderModelsResult as at, type PtySize as au, type PtyWrapOptions as av, type QueuedMessage as aw, type QueuedTaskMessage as ax, type RepairEvidence as ay, type RepoGroupLayout as az, type ActiveTaskSession as b, type TaskRunnerFlags as b0, type TaskSnapshot as b1, type TaskStartOptions as b2, type TaskStatus as b3, type TaskTransport as b4, type TaskType as b5, type TaskWithParent as b6, type ThinkingBlock as b7, type UsageLine as b8, type UsageRecord as b9, isReservedRunnerName as bA, isRunnerApproval as bB, isRunnerTransport as bC, isStructuredSession as bD, keepExecutionState as bE, knownModelId as bF, migrateLegacyPlan as bG, migratePlanState as bH, migrateTask as bI, partedPromptUsage as bJ, planDirectLaunch as bK, planShellLaunch as bL, plannerContextFill as bM, posixShellQuote as bN, removeTaskFromPlan as bO, renumberTasks as bP, resolveModelShortcut as bQ, resolveProvider as bR, stripAnsi as bS, toApprovalDecision as bT, toOrchestratorOptions as bU, updateTaskInPlan as bV, usageLine as bW, validateModifiedPlan as bX, warningsText as bY, windowsCommandLine as bZ, wrapWithPty as b_, type UsageTotals as ba, type UserPromptEntry as bb, type UserStep as bc, type ValidationCheck as bd, type ValidationContext as be, type ValidationResult as bf, type Verdict as bg, type VerificationCheck as bh, WINDOWS_MAX_COMMAND_LINE as bi, addPlannerUsage as bj, addTaskToPlan as bk, addUsage as bl, approvalScopes as bm, buildShellInvocation as bn, collectProviderCredentials as bo, createEmptyPlan as bp, createTask as bq, emptyWarnings as br, enabledRunners as bs, fetchAllProviderModels as bt, flattenTasks as bu, flattenTasksWithParents as bv, isAwaitingReason as bw, isExecutableResolved as bx, isGranted as by, isMeasured as bz, type AgentAdapter as c, 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, CommandLineTooLongError as t, type ConversationMessage as u, type DiscoveredMode as v, type DiscoveredModel as w, type DiscoveryCommand as x, ExecutableNotFoundError as y, type HeadlessRunnerDeps as z };
|
|
@@ -7,13 +7,14 @@ import { EventEmitter } from 'events';
|
|
|
7
7
|
* "run without isolation", while the others fall back to the shared
|
|
8
8
|
* workspace root with a one-line notice.
|
|
9
9
|
*/
|
|
10
|
-
type IsolationInactiveReason = 'disabled' | 'git-missing' | 'not-git' | 'no-commits' | 'dirty'
|
|
10
|
+
type IsolationInactiveReason = 'disabled' | 'git-missing' | 'not-git' | 'no-commits' | 'dirty';
|
|
11
11
|
/**
|
|
12
12
|
* `repos` names, relative to the workspace, the repositories behind the answer:
|
|
13
13
|
* when active, the ones that will isolate, with `shared` the paths every task
|
|
14
|
-
* will share live
|
|
15
|
-
*
|
|
16
|
-
* group of
|
|
14
|
+
* will share live — loose entries of the workspace root, or, for a lone
|
|
15
|
+
* repository, the repositories nested inside it; otherwise the dirty ones of a
|
|
16
|
+
* `dirty` group, or the commitless ones of a `no-commits` group. A group of one
|
|
17
|
+
* names none.
|
|
17
18
|
*/
|
|
18
19
|
type IsolationAvailability = {
|
|
19
20
|
active: true;
|
|
@@ -27,7 +28,8 @@ type IsolationAvailability = {
|
|
|
27
28
|
/**
|
|
28
29
|
* Where a run's tasks work, as the planner is told it: the repos of the group
|
|
29
30
|
* and the paths shared live between tasks. A lone repository is `['.']` with
|
|
30
|
-
* nothing shared
|
|
31
|
+
* nothing shared, unless it holds nested repositories, which are shared live
|
|
32
|
+
* and named in `shared`.
|
|
31
33
|
*/
|
|
32
34
|
interface RepoGroupLayout {
|
|
33
35
|
repos: string[];
|
|
@@ -49,9 +51,11 @@ interface IsolationTaskRepo {
|
|
|
49
51
|
/** Absolute path of this repo's worktree: the task workspace joined with the repo's path. */
|
|
50
52
|
worktree: string;
|
|
51
53
|
/**
|
|
52
|
-
* Paths
|
|
53
|
-
*
|
|
54
|
-
*
|
|
54
|
+
* Paths linked from the real workspace and kept out of the task's commit:
|
|
55
|
+
* the artifacts bootstrapped from the real repo, and a lone repository's
|
|
56
|
+
* nested repositories (`run.shared`). Recorded because a symlink is not
|
|
57
|
+
* matched by an ignore rule such as `node_modules/` and would otherwise be
|
|
58
|
+
* committed.
|
|
55
59
|
*/
|
|
56
60
|
linked: string[];
|
|
57
61
|
/** Whether the task brought commits to this repo; unknown until it first integrates. */
|
|
@@ -142,7 +146,9 @@ interface IsolationRun {
|
|
|
142
146
|
/**
|
|
143
147
|
* Workspace paths outside every isolated repo, linked live into each task
|
|
144
148
|
* workspace: loose entries of the workspace root, the entries beside a deeper
|
|
145
|
-
* repo, and `sharedRepos`.
|
|
149
|
+
* repo, and `sharedRepos`. For a lone repository, the repositories nested
|
|
150
|
+
* inside it, which cannot be isolated with it and so are linked live instead.
|
|
151
|
+
* Empty when a group of one holds no nested repositories.
|
|
146
152
|
*/
|
|
147
153
|
shared: string[];
|
|
148
154
|
/** Repos of the group that could not be isolated — no commits, or git refused a worktree — and are among `shared`. */
|
|
@@ -817,6 +823,12 @@ interface ApprovalRequest {
|
|
|
817
823
|
* second file from an already-approved directory does not prompt again.
|
|
818
824
|
*/
|
|
819
825
|
scope: string;
|
|
826
|
+
/**
|
|
827
|
+
* Every scope one answer settles, when a command needs more than one — its
|
|
828
|
+
* own and each outside directory it touches — so it prompts once rather than
|
|
829
|
+
* once per scope. `scope` is the first. Absent means `scope` alone.
|
|
830
|
+
*/
|
|
831
|
+
scopes?: string[];
|
|
820
832
|
/** One-line context for the prompt. */
|
|
821
833
|
detail?: string;
|
|
822
834
|
/** The task whose runner asked; absent for the planner's own requests. */
|
|
@@ -841,6 +853,7 @@ type ApprovalDecision = {
|
|
|
841
853
|
type ApprovalAnswer = boolean | ApprovalDecision;
|
|
842
854
|
declare function toApprovalDecision(answer: ApprovalAnswer): ApprovalDecision;
|
|
843
855
|
declare function isGranted(decision: ApprovalDecision): boolean;
|
|
856
|
+
declare function approvalScopes(request: ApprovalRequest): string[];
|
|
844
857
|
declare function isRunnerApproval(request: ApprovalRequest): boolean;
|
|
845
858
|
interface IApproval {
|
|
846
859
|
request(req: ApprovalRequest): Promise<boolean>;
|
|
@@ -937,6 +950,8 @@ type AgentEvent =
|
|
|
937
950
|
*
|
|
938
951
|
* `input` and `suggestions` are the raw request; `suggestions` are the
|
|
939
952
|
* agent's own session-scoped grants, what "Allow for this task" answers with.
|
|
953
|
+
* `decided` marks a request the task's mode already answered — the adapter
|
|
954
|
+
* replied as the manifest says that mode does — so it is shown, never asked.
|
|
940
955
|
*/
|
|
941
956
|
| {
|
|
942
957
|
type: 'permission_request';
|
|
@@ -946,6 +961,7 @@ type AgentEvent =
|
|
|
946
961
|
input?: Record<string, unknown>;
|
|
947
962
|
suggestions?: unknown[];
|
|
948
963
|
toolUseId?: string;
|
|
964
|
+
decided?: ApprovalDecision;
|
|
949
965
|
}
|
|
950
966
|
/** The agent withdrew an open request — an interrupt cancels the call it was for. It takes no answer now. */
|
|
951
967
|
| {
|
|
@@ -1005,8 +1021,10 @@ interface PlannerStartOptions extends AgentStartCommon {
|
|
|
1005
1021
|
interface TaskRunnerFlags {
|
|
1006
1022
|
/** The runner's own permission-mode value for the task's mode. */
|
|
1007
1023
|
permissionMode: string;
|
|
1008
|
-
/**
|
|
1009
|
-
|
|
1024
|
+
/** The task's raw effort id, present only alongside a model. Each adapter maps it to its own protocol. */
|
|
1025
|
+
effort?: string;
|
|
1026
|
+
/** The manifest's further settings for the task's mode, by setting name — see `PluginFeatures.modeSettings`. */
|
|
1027
|
+
modeSettings: Record<string, string>;
|
|
1010
1028
|
}
|
|
1011
1029
|
/** A plan task driven over the runner's programmatic protocol (ADR-0018, C1). */
|
|
1012
1030
|
interface TaskStartOptions extends AgentStartCommon {
|
|
@@ -1059,6 +1077,13 @@ interface TaskModeAgentAdapter extends AgentAdapter {
|
|
|
1059
1077
|
* within `timeoutMs`, and the caller must fall back to killing it.
|
|
1060
1078
|
*/
|
|
1061
1079
|
interrupt(timeoutMs: number): Promise<boolean>;
|
|
1080
|
+
/**
|
|
1081
|
+
* Registers the listener for what the agent does after a turn has ended and
|
|
1082
|
+
* before the next message — a turn it opens itself when background work
|
|
1083
|
+
* finishes, most often. Without one that output is dropped, which is right
|
|
1084
|
+
* for a planner and wrong for a task, whose marker may be said there.
|
|
1085
|
+
*/
|
|
1086
|
+
onOutOfTurn?(listener: (event: AgentEvent) => void): void;
|
|
1062
1087
|
/** Registers a listener for the process ending, for any reason. Fires at most once. */
|
|
1063
1088
|
onProcessExit(listener: (code: number) => void): void;
|
|
1064
1089
|
/**
|
|
@@ -1158,6 +1183,16 @@ interface PluginFeatures {
|
|
|
1158
1183
|
thinkingValueAdaptive?: string;
|
|
1159
1184
|
/** Maps mode IDs to the CLI --permission-mode value. Used by {{feature:permissionModeVal}}. */
|
|
1160
1185
|
permissionModeValues?: Record<string, string>;
|
|
1186
|
+
/**
|
|
1187
|
+
* Further per-mode settings for runners whose permission story has more than
|
|
1188
|
+
* one axis (Codex: sandbox, approval policy, approvals reviewer). Keyed by
|
|
1189
|
+
* setting name, then by mode id; a mode a map does not name leaves that
|
|
1190
|
+
* setting to the runner's own default. Codex declares `approvalPolicy`
|
|
1191
|
+
* (`-a` / `approval_policy`) and `approvalsReviewer` (`approvals_reviewer`);
|
|
1192
|
+
* the terminal template reads them too, through `{{feature:approvalPolicyVal}}`
|
|
1193
|
+
* and the `*Config` tokens.
|
|
1194
|
+
*/
|
|
1195
|
+
modeSettings?: Record<string, Record<string, string>>;
|
|
1161
1196
|
}
|
|
1162
1197
|
type PluginParser = 'claude-help' | 'opencode-models' | 'opencode-models-verbose' | 'anthropic-models' | 'line-by-line' | 'json' | 'json-table';
|
|
1163
1198
|
interface DiscoveryCommand {
|
|
@@ -2083,4 +2118,4 @@ interface ValidationContext {
|
|
|
2083
2118
|
type ValidationCheck = (ctx: ValidationContext) => ValidationResult;
|
|
2084
2119
|
declare function warningsText(w: PlanModificationWarnings): string | null;
|
|
2085
2120
|
|
|
2086
|
-
export { type IsolationRun as $, AbstractRunner as A, type BlockingPrompt as B, CMD_EXE_MAX_COMMAND_LINE as C, DENY_ALL as D, EmbeddedNewlineError as E, type FetchAllProviderModelsOptions as F, HeadlessSession as G, HeadlessRunner as H, type IApproval as I, type IConfig as J, type IPluginStore as K, type ITerminalRunner as L, type ITerminalSession as M, type IWorktreeIsolation as N, type IntegrationDisposal as O, type IsolationAvailability as P, type IsolationHandoff as Q, type IsolationHandoffRepo as R, type IsolationInactiveReason as S, type IsolationLandedTask as T, type IsolationLanding as U, type IsolationMergeBlock as V, type IsolationMergeBlockReason as W, type IsolationMergeResult as X, type IsolationOutcome as Y, type IsolationPruneResult as Z, type IsolationRepo as _, AbstractTerminalSession as a, type TaskOutputSummary as a$, type IsolationTaskRecord as a0, type IsolationTaskRepo as a1, type IsolationTaskStatus as a2, type IsolationView as a3, type LaunchDeps as a4, type LaunchPlan as a5, type LegacyPlanState as a6, LineBuffer as a7, type Message as a8, ModelCatalog as a9, type ResearchLogEntry as aA, type ResearchProgress as aB, type ResearchStep as aC, type ResearchStepOutcome as aD, type ResearchToolType as aE, type ResolveContext as aF, type RunnerId as aG, type RunnerInvocation as aH, type RunnerPluginManifest as aI, RunnerRegistry as aJ, type RunnerSpawnOptions as aK, type RunnerTransport as aL, type StreamEvent as aM, type StreamStepEvent as aN, type StreamThinkingEvent as aO, type StructuredEvent as aP, type StructuredSessionCapability as aQ, type StructuredTurnEnd as aR, type SubagentLogEntry as aS, type SubagentOutcome as aT, type Task as aU, type TaskIsolation as aV, type TaskIsolationState as aW, type TaskMode as aX, type TaskModeAgentAdapter as aY, TaskModeUnsupportedError as aZ, type TaskModelAssignment as a_, type ModelShortcut as aa, ORCHESTRATOR_SHORTCUTS as ab, type OrchestratorOption as ac, type PlanIsolation as ad, type PlanModificationWarnings as ae, type PlanState as af, type PlanStatus as ag, type PlannerStartOptions as ah, type PlannerUsage as ai, type PluginCloneFn as aj, type PluginEntry as ak, type PluginFeatures as al, type PluginMode as am, type PluginModelDiscovery as an, type PluginRunnerDef as ao, type PreparedLaunch as ap, type PreparedTask as aq, type ProviderCredentialSource as ar, type ProviderModelLists as as, type ProviderModelsResult as at, type PtySize as au, type PtyWrapOptions as av, type QueuedMessage as aw, type QueuedTaskMessage as ax, type RepairEvidence as ay, type RepoGroupLayout as az, type ActiveTaskSession as b, type TaskRunnerFlags as b0, type TaskSnapshot as b1, type TaskStartOptions as b2, type TaskStatus as b3, type TaskTransport as b4, type TaskType as b5, type TaskWithParent as b6, type ThinkingBlock as b7, type UsageLine as b8, type UsageRecord as b9,
|
|
2121
|
+
export { type IsolationRun as $, AbstractRunner as A, type BlockingPrompt as B, CMD_EXE_MAX_COMMAND_LINE as C, DENY_ALL as D, EmbeddedNewlineError as E, type FetchAllProviderModelsOptions as F, HeadlessSession as G, HeadlessRunner as H, type IApproval as I, type IConfig as J, type IPluginStore as K, type ITerminalRunner as L, type ITerminalSession as M, type IWorktreeIsolation as N, type IntegrationDisposal as O, type IsolationAvailability as P, type IsolationHandoff as Q, type IsolationHandoffRepo as R, type IsolationInactiveReason as S, type IsolationLandedTask as T, type IsolationLanding as U, type IsolationMergeBlock as V, type IsolationMergeBlockReason as W, type IsolationMergeResult as X, type IsolationOutcome as Y, type IsolationPruneResult as Z, type IsolationRepo as _, AbstractTerminalSession as a, type TaskOutputSummary as a$, type IsolationTaskRecord as a0, type IsolationTaskRepo as a1, type IsolationTaskStatus as a2, type IsolationView as a3, type LaunchDeps as a4, type LaunchPlan as a5, type LegacyPlanState as a6, LineBuffer as a7, type Message as a8, ModelCatalog as a9, type ResearchLogEntry as aA, type ResearchProgress as aB, type ResearchStep as aC, type ResearchStepOutcome as aD, type ResearchToolType as aE, type ResolveContext as aF, type RunnerId as aG, type RunnerInvocation as aH, type RunnerPluginManifest as aI, RunnerRegistry as aJ, type RunnerSpawnOptions as aK, type RunnerTransport as aL, type StreamEvent as aM, type StreamStepEvent as aN, type StreamThinkingEvent as aO, type StructuredEvent as aP, type StructuredSessionCapability as aQ, type StructuredTurnEnd as aR, type SubagentLogEntry as aS, type SubagentOutcome as aT, type Task as aU, type TaskIsolation as aV, type TaskIsolationState as aW, type TaskMode as aX, type TaskModeAgentAdapter as aY, TaskModeUnsupportedError as aZ, type TaskModelAssignment as a_, type ModelShortcut as aa, ORCHESTRATOR_SHORTCUTS as ab, type OrchestratorOption as ac, type PlanIsolation as ad, type PlanModificationWarnings as ae, type PlanState as af, type PlanStatus as ag, type PlannerStartOptions as ah, type PlannerUsage as ai, type PluginCloneFn as aj, type PluginEntry as ak, type PluginFeatures as al, type PluginMode as am, type PluginModelDiscovery as an, type PluginRunnerDef as ao, type PreparedLaunch as ap, type PreparedTask as aq, type ProviderCredentialSource as ar, type ProviderModelLists as as, type ProviderModelsResult as at, type PtySize as au, type PtyWrapOptions as av, type QueuedMessage as aw, type QueuedTaskMessage as ax, type RepairEvidence as ay, type RepoGroupLayout as az, type ActiveTaskSession as b, type TaskRunnerFlags as b0, type TaskSnapshot as b1, type TaskStartOptions as b2, type TaskStatus as b3, type TaskTransport as b4, type TaskType as b5, type TaskWithParent as b6, type ThinkingBlock as b7, type UsageLine as b8, type UsageRecord as b9, isReservedRunnerName as bA, isRunnerApproval as bB, isRunnerTransport as bC, isStructuredSession as bD, keepExecutionState as bE, knownModelId as bF, migrateLegacyPlan as bG, migratePlanState as bH, migrateTask as bI, partedPromptUsage as bJ, planDirectLaunch as bK, planShellLaunch as bL, plannerContextFill as bM, posixShellQuote as bN, removeTaskFromPlan as bO, renumberTasks as bP, resolveModelShortcut as bQ, resolveProvider as bR, stripAnsi as bS, toApprovalDecision as bT, toOrchestratorOptions as bU, updateTaskInPlan as bV, usageLine as bW, validateModifiedPlan as bX, warningsText as bY, windowsCommandLine as bZ, wrapWithPty as b_, type UsageTotals as ba, type UserPromptEntry as bb, type UserStep as bc, type ValidationCheck as bd, type ValidationContext as be, type ValidationResult as bf, type Verdict as bg, type VerificationCheck as bh, WINDOWS_MAX_COMMAND_LINE as bi, addPlannerUsage as bj, addTaskToPlan as bk, addUsage as bl, approvalScopes as bm, buildShellInvocation as bn, collectProviderCredentials as bo, createEmptyPlan as bp, createTask as bq, emptyWarnings as br, enabledRunners as bs, fetchAllProviderModels as bt, flattenTasks as bu, flattenTasksWithParents as bv, isAwaitingReason as bw, isExecutableResolved as bx, isGranted as by, isMeasured as bz, type AgentAdapter as c, 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, CommandLineTooLongError as t, type ConversationMessage as u, type DiscoveredMode as v, type DiscoveredModel as w, type DiscoveryCommand as x, ExecutableNotFoundError as y, type HeadlessRunnerDeps as z };
|
|
@@ -676,7 +676,8 @@ function decideApproval(view, { approvalId, decision, note }) {
|
|
|
676
676
|
}
|
|
677
677
|
function startTurn(view, { message, messageId }) {
|
|
678
678
|
const queued = messageId ? view.queued.filter((m) => m.id !== messageId) : view.queued;
|
|
679
|
-
|
|
679
|
+
const working = { ...view, queued, working: true };
|
|
680
|
+
return message ? append(working, (id) => settledMessage(id, "user", message)) : working;
|
|
680
681
|
}
|
|
681
682
|
var CUT = { completed: null, interrupted: "stopped", failed: "failed" };
|
|
682
683
|
function endTurn(view, { reason }) {
|
|
@@ -2112,4 +2113,4 @@ export {
|
|
|
2112
2113
|
hasHiddenDetail,
|
|
2113
2114
|
taskStartedNotice
|
|
2114
2115
|
};
|
|
2115
|
-
//# sourceMappingURL=chunk-
|
|
2116
|
+
//# sourceMappingURL=chunk-2SOVKO7P.mjs.map
|