@ordewell/core 0.4.11 → 0.4.12
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/ApprovalPolicy-BVhGdECT.d.mts +79 -0
- package/dist/ApprovalPolicy-BVhGdECT.d.ts +79 -0
- package/dist/{ITerminalRunner-BTaKZ659.d.mts → ITerminalRunner-D_RBDoHa.d.mts} +8 -79
- package/dist/{ITerminalRunner-DVwORcV9.d.ts → ITerminalRunner-DqAs12sy.d.ts} +8 -79
- package/dist/{chunk-DNNZGH3I.mjs → chunk-YTJ7EOV6.mjs} +61 -2
- package/dist/chunk-YTJ7EOV6.mjs.map +1 -0
- package/dist/index.d.mts +76 -175
- package/dist/index.d.ts +76 -175
- package/dist/index.js +32 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +31 -54
- package/dist/index.mjs.map +1 -1
- package/dist/{plan-utils-akoB6YCL.d.ts → plan-utils-BbC9KdK4.d.ts} +138 -2
- package/dist/{plan-utils-BHLbBym3.d.mts → plan-utils-DHBIvkiT.d.mts} +138 -2
- package/dist/plan-utils.d.mts +2 -1
- package/dist/plan-utils.d.ts +2 -1
- package/dist/plan-utils.js +14 -2
- package/dist/plan-utils.js.map +1 -1
- package/dist/plan-utils.mjs +7 -3
- package/dist/testing.d.mts +2 -1
- package/dist/testing.d.ts +2 -1
- package/package.json +1 -1
- package/dist/chunk-DNNZGH3I.mjs.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { h as RunnerId, c as PlanStatus, L as LegacyPlanState, a as DiscoveredModel, T as Task, d as ResearchProgress, R as ResearchLogEntry, C as ConversationMessage, n as TaskSnapshot, Q as QueuedMessage, A as ActiveTaskSession, g as ResearchToolType,
|
|
2
|
-
export { D as DiscoveredMode, M as Message, P as PlanModificationWarnings, f as ResearchStepOutcome, S as StreamEvent, i as StreamStepEvent, j as StreamThinkingEvent, k as TaskMode, l as TaskModelAssignment, m as TaskOutputSummary, o as TaskStatus, p as TaskType, q as TaskWithParent, r as ThinkingBlock, U as UserPromptEntry, s as UserStep, V as ValidationCheck, t as ValidationContext, u as ValidationResult, w as VerificationCheck, x as addTaskToPlan, y as createEmptyPlan, z as createTask, B as emptyWarnings, E as flattenTasks, F as flattenTasksWithParents, G as migrateLegacyPlan, H as migratePlanState, I as migrateTask, J as removeTaskFromPlan, K as renumberTasks, N as updateTaskInPlan, O as validateModifiedPlan, W as warningsText } from './Task-cGrfYRXK.js';
|
|
3
|
-
import {
|
|
4
|
-
export { a as AllProviderModels,
|
|
1
|
+
import { h as RunnerId, c as PlanStatus, L as LegacyPlanState, a as DiscoveredModel, T as Task, d as ResearchProgress, R as ResearchLogEntry, C as ConversationMessage, n as TaskSnapshot, Q as QueuedMessage, A as ActiveTaskSession, g as ResearchToolType, b as PlanState, v as Verdict } from './Task-cGrfYRXK.js';
|
|
2
|
+
export { D as DiscoveredMode, M as Message, P as PlanModificationWarnings, e as ResearchStep, f as ResearchStepOutcome, S as StreamEvent, i as StreamStepEvent, j as StreamThinkingEvent, k as TaskMode, l as TaskModelAssignment, m as TaskOutputSummary, o as TaskStatus, p as TaskType, q as TaskWithParent, r as ThinkingBlock, U as UserPromptEntry, s as UserStep, V as ValidationCheck, t as ValidationContext, u as ValidationResult, w as VerificationCheck, x as addTaskToPlan, y as createEmptyPlan, z as createTask, B as emptyWarnings, E as flattenTasks, F as flattenTasksWithParents, G as migrateLegacyPlan, H as migratePlanState, I as migrateTask, J as removeTaskFromPlan, K as renumberTasks, N as updateTaskInPlan, O as validateModifiedPlan, W as warningsText } from './Task-cGrfYRXK.js';
|
|
3
|
+
import { f as IFileSystem, R as ReadFileOpts, T as ToolOutcome, d as GrepOptions, c as GlobOptions, b as FindSymbolOptions, I as IConfig, A as AiProvider, r as ProviderModelLists, i as ITerminalSession, h as ITerminalRunner, w as RunnerRegistry, k as OrchestratorOption, u as RunnerInvocation, g as IPluginStore, v as RunnerPluginManifest, t as ResolveContext } from './ITerminalRunner-DqAs12sy.js';
|
|
4
|
+
export { a as AllProviderModels, C as CatalogModel, D as DiscoveryCommand, F as FetchAllProviderModelsOptions, G as GREP_DEFAULT_HEAD_LIMIT, e as GrepOutputMode, M as ModelCatalog, j as ModelShortcut, O as ORCHESTRATOR_SHORTCUTS, P as PluginCloneFn, l as PluginEntry, m as PluginFeatures, n as PluginMode, o as PluginModelDiscovery, p as PluginRunnerDef, q as ProviderCredentialSource, s as ProviderModelsResult, S as SEARCH_EXCLUSIONS, x as collectProviderCredentials, y as enabledRunners, z as fetchAllProviderModels, B as isReservedRunnerName, E as knownModelId, H as resolveModelShortcut, J as resolveProvider, K as toOrchestratorOptions } from './ITerminalRunner-DqAs12sy.js';
|
|
5
|
+
import { I as IApproval, d as ApprovalRequest, a as ApprovalMode } from './ApprovalPolicy-BVhGdECT.js';
|
|
6
|
+
export { A as ApprovalKind, b as ApprovalPolicy, c as ApprovalPolicyOptions, e as ApprovalSource, D as DENY_ALL } from './ApprovalPolicy-BVhGdECT.js';
|
|
5
7
|
import { R as RunnerModeInfo } from './ModeResolver-CzZd-i6T.js';
|
|
6
8
|
export { M as ManifestLookup, b as buildModeGuide, f as filteredBuildModes, r as resolveDefaultMode, a as resolveTaskMode, c as runnerModesFrom } from './ModeResolver-CzZd-i6T.js';
|
|
7
|
-
import { T as TaskOp } from './plan-utils-
|
|
8
|
-
export { A as ApplyTaskOpsResult, a as
|
|
9
|
+
import { T as TaskOp, c as SessionBroadcaster } from './plan-utils-BbC9KdK4.js';
|
|
10
|
+
export { A as ApplyTaskOpsResult, C as CHECKPOINT_TRUNCATE_LENGTH, S as SerializedPlan, a as SerializedTask, b as SerializedTaskStatus, d as SessionMessage, e as TaskRef, f as applyTaskOps, g as canMergeTasks, h as canSetDependencies, i as canSplitTask, j as classifyOutcome, k as dependencyCandidates, l as dependentsOf, m as executionSummary, p as parseTaskOpsJson, s as serializePlan, n as serializeTask, o as serializeTaskStatus, q as summarizeToolCall, t as textHasTaskOps, r as truncateCheckpointSummary } from './plan-utils-BbC9KdK4.js';
|
|
9
11
|
import { ChildProcess } from 'child_process';
|
|
10
12
|
import { EventEmitter } from 'events';
|
|
11
13
|
import { b as PlanParseError } from './parsing-D87zKtTe.js';
|
|
@@ -723,6 +725,65 @@ declare abstract class AbstractRunner<S extends ITerminalSession> implements ITe
|
|
|
723
725
|
}): Promise<ITerminalSession>;
|
|
724
726
|
}
|
|
725
727
|
|
|
728
|
+
declare function stripAnsi(text: string): string;
|
|
729
|
+
declare function posixShellQuote(s: string): string;
|
|
730
|
+
/**
|
|
731
|
+
* Wrap a command for execution inside a POSIX login shell, which is what
|
|
732
|
+
* resolves runner binaries managed by nvm/volta/asdf.
|
|
733
|
+
*
|
|
734
|
+
* Deliberately POSIX-only. This used to take a `platform` and emit
|
|
735
|
+
* `powershell.exe -Command "'claude' '-p' '…'"` for Windows, which PowerShell
|
|
736
|
+
* cannot run at all: a quoted string in leading position is parsed in
|
|
737
|
+
* expression mode, so the invocation died with a parse error before the runner
|
|
738
|
+
* started — a task that failed instantly, every time, on that platform. Windows
|
|
739
|
+
* has no login-shell equivalent to emulate (its PATH comes from the registry
|
|
740
|
+
* and is already inherited), so {@link planShellLaunch} starts the runner
|
|
741
|
+
* directly there instead of routing it through a shell. Platform choice belongs
|
|
742
|
+
* to that function; this one only knows how to phrase the POSIX half.
|
|
743
|
+
*/
|
|
744
|
+
declare function buildShellInvocation(command: string, args: string[]): {
|
|
745
|
+
shellPath: string;
|
|
746
|
+
shellArgs: string[];
|
|
747
|
+
};
|
|
748
|
+
/** A terminal size in cells. */
|
|
749
|
+
interface PtySize {
|
|
750
|
+
cols: number;
|
|
751
|
+
rows: number;
|
|
752
|
+
}
|
|
753
|
+
/**
|
|
754
|
+
* Options for {@link wrapWithPty}. `size` sets the PTY's window size before the
|
|
755
|
+
* wrapped command starts. `controlChannel` makes the wrapper listen on its fd 3
|
|
756
|
+
* for `"<cols> <rows>"` lines and resize the PTY live — the caller spawns the
|
|
757
|
+
* child with an extra pipe there and writes resize requests into it.
|
|
758
|
+
*/
|
|
759
|
+
interface PtyWrapOptions {
|
|
760
|
+
size?: PtySize;
|
|
761
|
+
controlChannel?: boolean;
|
|
762
|
+
}
|
|
763
|
+
/**
|
|
764
|
+
* Wrap a command in `script` to allocate the PTY some runners require when
|
|
765
|
+
* headless; `-e` propagates the child's exit code so verification still works.
|
|
766
|
+
*
|
|
767
|
+
* POSIX-only by nature — there is no `script` on Windows, which
|
|
768
|
+
* `HeadlessRunner`'s `hasScriptCmd` probe already discovers, so this is never
|
|
769
|
+
* reached there.
|
|
770
|
+
*
|
|
771
|
+
* `script` sizes its PTY off the terminal it is attached to; spawned off a pipe
|
|
772
|
+
* (every transport here) it allocates 0x0, which a runner TUI renders as
|
|
773
|
+
* garbage. `stty` fixes the size on the PTY slave before the command starts, so
|
|
774
|
+
* the TUI reads its true dimensions via ioctl.
|
|
775
|
+
*
|
|
776
|
+
* The control channel can only live on a *separate* fd from the agent's stdin,
|
|
777
|
+
* so the wrapper saves the PTY on fd 4 first: POSIX sends an asynchronous
|
|
778
|
+
* command's stdin to `/dev/null`, so the watcher's own stdin cannot be the PTY.
|
|
779
|
+
* A background job also inherits an fd 0 that is not the terminal; `stty` names
|
|
780
|
+
* fd 4 explicitly for that reason.
|
|
781
|
+
*/
|
|
782
|
+
declare function wrapWithPty(command: string, args: string[], opts?: PtyWrapOptions): {
|
|
783
|
+
command: string;
|
|
784
|
+
args: string[];
|
|
785
|
+
};
|
|
786
|
+
|
|
726
787
|
/**
|
|
727
788
|
* cmd.exe's command-line buffer. A longer line is truncated rather than
|
|
728
789
|
* rejected, which would corrupt a planner's system prompt or a task's prompt
|
|
@@ -857,7 +918,7 @@ declare function planShellLaunch(command: string, args: string[], deps?: LaunchD
|
|
|
857
918
|
|
|
858
919
|
type SpawnFn = (command: string, args: string[], options: {
|
|
859
920
|
env: NodeJS.ProcessEnv;
|
|
860
|
-
stdio:
|
|
921
|
+
stdio: Array<'pipe' | 'ignore'>;
|
|
861
922
|
cwd: string;
|
|
862
923
|
/** Set by the Windows batch route, where `args` is already a quoted command line. */
|
|
863
924
|
windowsVerbatimArguments?: boolean;
|
|
@@ -877,12 +938,17 @@ declare class HeadlessSession extends AbstractTerminalSession {
|
|
|
877
938
|
private spawnImpl;
|
|
878
939
|
private process;
|
|
879
940
|
private outputBuffer;
|
|
941
|
+
private controlStream;
|
|
880
942
|
constructor(id: string, taskId: string, spawnImpl: SpawnFn);
|
|
881
943
|
get isStarted(): boolean;
|
|
882
|
-
start(launch: LaunchPlan, cwd: string, resolvedPath: string, env?: Record<string, string
|
|
944
|
+
start(launch: LaunchPlan, cwd: string, resolvedPath: string, env?: Record<string, string>, options?: {
|
|
945
|
+
controlChannel?: boolean;
|
|
946
|
+
}): void;
|
|
883
947
|
kill(): void;
|
|
884
948
|
getOutput(): string;
|
|
885
949
|
write(text: string): void;
|
|
950
|
+
/** PTY resize requests from a surface that owns the terminal rendering the wrapper. */
|
|
951
|
+
writeControl(text: string): void;
|
|
886
952
|
}
|
|
887
953
|
type RunnerSpawnOptions = Parameters<ITerminalRunner['spawn']>[0];
|
|
888
954
|
/** Everything needed to start one runner process, resolved before any child exists. */
|
|
@@ -909,7 +975,7 @@ declare class HeadlessRunner extends AbstractRunner<HeadlessSession> {
|
|
|
909
975
|
constructor(deps?: HeadlessRunnerDeps);
|
|
910
976
|
protected createSession(id: string, taskId: string): HeadlessSession;
|
|
911
977
|
/** Everything up to, but not including, spawning — so a surface that owns its own child reaches the same decisions. */
|
|
912
|
-
protected prepareLaunch(opts: RunnerSpawnOptions): Promise<PreparedLaunch>;
|
|
978
|
+
protected prepareLaunch(opts: RunnerSpawnOptions, ptyOptions?: PtyWrapOptions): Promise<PreparedLaunch>;
|
|
913
979
|
spawn(opts: RunnerSpawnOptions): Promise<ITerminalSession>;
|
|
914
980
|
}
|
|
915
981
|
|
|
@@ -2259,138 +2325,6 @@ declare class SkillsService {
|
|
|
2259
2325
|
}
|
|
2260
2326
|
declare function createSkillsService(workspaceRoot?: string): SkillsService;
|
|
2261
2327
|
|
|
2262
|
-
type SerializedTaskStatus = {
|
|
2263
|
-
id: string;
|
|
2264
|
-
status: string;
|
|
2265
|
-
verdict: {
|
|
2266
|
-
outcome: 'pass' | 'fail';
|
|
2267
|
-
reason: string;
|
|
2268
|
-
checks: Verdict['checks'];
|
|
2269
|
-
} | null;
|
|
2270
|
-
/** Advisory silence timestamp from VerdictEngine — not part of task status semantics. */
|
|
2271
|
-
idleSince?: string | null;
|
|
2272
|
-
};
|
|
2273
|
-
type SerializedTask = {
|
|
2274
|
-
id: string;
|
|
2275
|
-
order: number;
|
|
2276
|
-
title: string;
|
|
2277
|
-
type: string;
|
|
2278
|
-
description: string;
|
|
2279
|
-
dependencies: string[];
|
|
2280
|
-
assignedRunner: RunnerId;
|
|
2281
|
-
assignedModel: Task['assignedModel'] | null;
|
|
2282
|
-
taskMode: string;
|
|
2283
|
-
prompt: string | null;
|
|
2284
|
-
subtasks: SerializedTask[];
|
|
2285
|
-
userSteps: Task['userSteps'];
|
|
2286
|
-
thinkingEffort: Task['thinkingEffort'];
|
|
2287
|
-
autonomy: Task['autonomy'];
|
|
2288
|
-
sliceType: Task['sliceType'];
|
|
2289
|
-
userStoriesCovered: Task['userStoriesCovered'];
|
|
2290
|
-
};
|
|
2291
|
-
type SerializedPlan = {
|
|
2292
|
-
tasks: SerializedTask[];
|
|
2293
|
-
runners: RunnerId[];
|
|
2294
|
-
generatedAt: string;
|
|
2295
|
-
conversationHistory?: LegacyPlanState['conversationHistory'];
|
|
2296
|
-
prdMarkdown?: string;
|
|
2297
|
-
queuedMessages?: QueuedMessage[];
|
|
2298
|
-
};
|
|
2299
|
-
type SessionMessage = {
|
|
2300
|
-
type: 'plan_generated';
|
|
2301
|
-
plan: SerializedPlan;
|
|
2302
|
-
goal: string;
|
|
2303
|
-
runners: RunnerId[];
|
|
2304
|
-
} | {
|
|
2305
|
-
type: 'planner_message';
|
|
2306
|
-
content: string;
|
|
2307
|
-
timestamp: string;
|
|
2308
|
-
} | {
|
|
2309
|
-
type: 'status_update';
|
|
2310
|
-
tasks: SerializedTaskStatus[];
|
|
2311
|
-
} | {
|
|
2312
|
-
type: 'review_needed';
|
|
2313
|
-
tasks: SerializedTask[];
|
|
2314
|
-
} | {
|
|
2315
|
-
type: 'review_approved';
|
|
2316
|
-
} | {
|
|
2317
|
-
type: 'checkpoint';
|
|
2318
|
-
taskId: string;
|
|
2319
|
-
taskTitle: string;
|
|
2320
|
-
summary: string;
|
|
2321
|
-
} | {
|
|
2322
|
-
type: 'execution_complete';
|
|
2323
|
-
summary: {
|
|
2324
|
-
total: number;
|
|
2325
|
-
completed: number;
|
|
2326
|
-
failed: number;
|
|
2327
|
-
};
|
|
2328
|
-
} | {
|
|
2329
|
-
type: 'execution_stopped';
|
|
2330
|
-
} | {
|
|
2331
|
-
type: 'queue_ready';
|
|
2332
|
-
} | {
|
|
2333
|
-
type: 'task_updated';
|
|
2334
|
-
taskId: string;
|
|
2335
|
-
changes: Record<string, unknown>;
|
|
2336
|
-
} | {
|
|
2337
|
-
type: 'task_started';
|
|
2338
|
-
taskId: string;
|
|
2339
|
-
order: number;
|
|
2340
|
-
title: string;
|
|
2341
|
-
runner: RunnerId;
|
|
2342
|
-
modelId?: string;
|
|
2343
|
-
} | {
|
|
2344
|
-
type: 'task_output';
|
|
2345
|
-
taskId: string;
|
|
2346
|
-
text: string;
|
|
2347
|
-
} | {
|
|
2348
|
-
type: 'plan_thinking';
|
|
2349
|
-
text: string;
|
|
2350
|
-
} | {
|
|
2351
|
-
type: 'research_step';
|
|
2352
|
-
tool: string;
|
|
2353
|
-
toolLabel?: string;
|
|
2354
|
-
args: string;
|
|
2355
|
-
subagentId?: string;
|
|
2356
|
-
toolCallId?: string;
|
|
2357
|
-
} | {
|
|
2358
|
-
type: 'plan_token';
|
|
2359
|
-
token: string;
|
|
2360
|
-
} | {
|
|
2361
|
-
type: 'research_step_done';
|
|
2362
|
-
step: ResearchStep;
|
|
2363
|
-
subagentId?: string;
|
|
2364
|
-
} | {
|
|
2365
|
-
type: 'approval_request';
|
|
2366
|
-
id: string;
|
|
2367
|
-
kind: ApprovalKind;
|
|
2368
|
-
subject: string;
|
|
2369
|
-
scope: string;
|
|
2370
|
-
detail?: string;
|
|
2371
|
-
} | {
|
|
2372
|
-
type: 'approval_settled';
|
|
2373
|
-
id: string;
|
|
2374
|
-
granted: boolean;
|
|
2375
|
-
} | {
|
|
2376
|
-
type: 'approval_decided';
|
|
2377
|
-
kind: ApprovalKind;
|
|
2378
|
-
subject: string;
|
|
2379
|
-
scope: string;
|
|
2380
|
-
detail?: string;
|
|
2381
|
-
granted: boolean;
|
|
2382
|
-
source: Exclude<ApprovalSource, 'asked'>;
|
|
2383
|
-
};
|
|
2384
|
-
type SessionBroadcaster = (msg: SessionMessage) => void;
|
|
2385
|
-
declare function serializeTask(t: Task): SerializedTask;
|
|
2386
|
-
declare function serializeTaskStatus(t: Task, idleSince?: string | null): SerializedTaskStatus;
|
|
2387
|
-
declare function serializePlan(plan: LegacyPlanState): SerializedPlan;
|
|
2388
|
-
declare function executionSummary(tasks: Task[]): {
|
|
2389
|
-
total: number;
|
|
2390
|
-
completed: number;
|
|
2391
|
-
failed: number;
|
|
2392
|
-
};
|
|
2393
|
-
|
|
2394
2328
|
/**
|
|
2395
2329
|
* A direct (non-planner) plan edit the session refused. Distinct from a plain
|
|
2396
2330
|
* Error so a surface can tell "you asked for something invalid" from "something
|
|
@@ -3286,39 +3220,6 @@ declare class TmuxRunner extends AbstractRunner<TmuxSession> {
|
|
|
3286
3220
|
}): Promise<ITerminalSession>;
|
|
3287
3221
|
}
|
|
3288
3222
|
|
|
3289
|
-
declare function stripAnsi(text: string): string;
|
|
3290
|
-
declare function posixShellQuote(s: string): string;
|
|
3291
|
-
/**
|
|
3292
|
-
* Wrap a command for execution inside a POSIX login shell, which is what
|
|
3293
|
-
* resolves runner binaries managed by nvm/volta/asdf.
|
|
3294
|
-
*
|
|
3295
|
-
* Deliberately POSIX-only. This used to take a `platform` and emit
|
|
3296
|
-
* `powershell.exe -Command "'claude' '-p' '…'"` for Windows, which PowerShell
|
|
3297
|
-
* cannot run at all: a quoted string in leading position is parsed in
|
|
3298
|
-
* expression mode, so the invocation died with a parse error before the runner
|
|
3299
|
-
* started — a task that failed instantly, every time, on that platform. Windows
|
|
3300
|
-
* has no login-shell equivalent to emulate (its PATH comes from the registry
|
|
3301
|
-
* and is already inherited), so {@link planShellLaunch} starts the runner
|
|
3302
|
-
* directly there instead of routing it through a shell. Platform choice belongs
|
|
3303
|
-
* to that function; this one only knows how to phrase the POSIX half.
|
|
3304
|
-
*/
|
|
3305
|
-
declare function buildShellInvocation(command: string, args: string[]): {
|
|
3306
|
-
shellPath: string;
|
|
3307
|
-
shellArgs: string[];
|
|
3308
|
-
};
|
|
3309
|
-
/**
|
|
3310
|
-
* Wrap a command in `script` to allocate the PTY some runners require when
|
|
3311
|
-
* headless; `-e` propagates the child's exit code so verification still works.
|
|
3312
|
-
*
|
|
3313
|
-
* POSIX-only by nature — there is no `script` on Windows, which
|
|
3314
|
-
* `HeadlessRunner`'s `hasScriptCmd` probe already discovers, so this is never
|
|
3315
|
-
* reached there.
|
|
3316
|
-
*/
|
|
3317
|
-
declare function wrapWithPty(command: string, args: string[]): {
|
|
3318
|
-
command: string;
|
|
3319
|
-
args: string[];
|
|
3320
|
-
};
|
|
3321
|
-
|
|
3322
3223
|
/**
|
|
3323
3224
|
* A workspace path that does not exist, or exists but is not a directory.
|
|
3324
3225
|
* Checked at every surface that starts a planner or spawns an agent inside
|
|
@@ -3696,4 +3597,4 @@ declare class PlannerModelMemory {
|
|
|
3696
3597
|
recall(provider: string, catalog: PlannerModelCandidate[]): PlannerModelRecall;
|
|
3697
3598
|
}
|
|
3698
3599
|
|
|
3699
|
-
export { ALLOWED_PLUGIN_HOSTS, ALL_PROVIDERS, AUTO_COMMANDS, AbstractRunner, AbstractTerminalSession, ActiveTaskSession, type AgentAdapter, type AgentAdapterFactory, type AgentEvent, type AgentProcessDeps, type AgentStartOptions, AiProvider,
|
|
3600
|
+
export { ALLOWED_PLUGIN_HOSTS, ALL_PROVIDERS, AUTO_COMMANDS, AbstractRunner, AbstractTerminalSession, ActiveTaskSession, type AgentAdapter, type AgentAdapterFactory, type AgentEvent, type AgentProcessDeps, type AgentStartOptions, AiProvider, ApprovalMode, ApprovalRequest, BUILTIN_SKILL_NAMES, BaseAiService, BaseConfig, BaseFileSystem, CLAUDE_CODE_MANIFEST, CLI_PROVIDERS, CMD_EXE_MAX_COMMAND_LINE, CORE_PLANNER_PROMPT, type CappedRows, type CheckpointListener, ClaudeCodeAdapter, CliAgentAiService, type CliAgentAiServiceDeps, CodexAdapter, type CommandClassification, CommandLineTooLongError, type CommandTier, type ComposeOptions, ConsoleLogger, ContextCollector, ConversationMessage, type ConversationRequest, type ConversationTurn, DAEMON_SUBPROTOCOL, DAEMON_TOKEN_SUBPROTOCOL_PREFIX, DiscoveredModel, EmbeddedNewlineError, type EnvAdmission, EnvConfig, type ExecFileFn, type ExecImpl, ExecutableNotFoundError, FindSymbolOptions, FsPluginStore, GIT_READONLY_SUBCOMMANDS, GeminiService, GlobOptions, type GrepInvocation, GrepOptions, type HasBinFn, HeadlessRunner, type HeadlessRunnerDeps, HeadlessSession, type IAiService, IApproval, IConfig, IFileSystem, type ILogger, type INotification, IPluginStore, ITerminalRunner, ITerminalSession, JSON_REPAIR_INSTRUCTION, type KillTreeDeps, type LaunchDeps, type LaunchPlan, LegacyPlanState, LineBuffer, type MappedTool, ModelResolver, type ModelResolverDeps, type ModifyPlanRequest, type NotificationAction, OPENCODE_MANIFEST, ORDEWELL_SETTABLE_ENV, OpenAiService, OpenCodeAdapter, type OrchestratorObserver, OrchestratorOption, PLUGIN_NAME_PATTERN, PROVIDER_CREDENTIAL_ENV, PROVIDER_DETECT_PRIORITY, PROVIDER_LABEL, PROVIDER_PRIORITY, PROVIDER_SHORT_LABEL, type PendingApproval, PendingApprovals, type PendingApprovalsOptions, PlanEditError, PlanParseError, type PlanRequest, PlanState, PlanStatus, PlanStore, Planner, type PlannerModelCandidate, type PlannerModelChoice, PlannerModelMemory, type PlannerModelRecall, type PlannerModelStore, type PlannerReplyClassification, type PlannerRuntimeToggles, type PluginSource, type PrdBlock, type PreparedLaunch, type PriorOutput, type ProbeFn, ProviderModelLists, type ProviderRegistration, type PtySize, type PtyWrapOptions, QueuedMessage, REFUSED_COMMANDS, ReadFileOpts, type RepairLoopOpts, type RepairVerdict, type ResearchChat, ResearchLogEntry, ResearchProgress, type ResearchShell, type ResearchShellDeps, ResearchToolType, type ResearchTurn, ResolveContext, type RunnerCatalog, RunnerId, RunnerInstallation, RunnerInvocation, type RunnerMode, RunnerModeInfo, RunnerPluginManifest, RunnerRegistry, type RunnerSpawnOptions, SETTINGS_ENV_ALLOWLIST, SETTINGS_ENV_REFUSED, STATE_DIR, STOPPED_TOOL_RESULT, SYMBOL_LANGUAGES, Session, SessionBroadcaster, type SessionData, type SessionDeps, type SessionMeta, type SessionPlanner, type SessionRuntimeSettings, SettingsService, type ShellDialect, type SkillInfo, type SkillMetadata, SkillsService, type SpawnSpec, StdioAgentAdapter, TASK_QUERY_ANSWER_OR_OPS, TASK_QUERY_FIELDS, TASK_QUERY_PROTOCOL, TASK_QUERY_REMINDER, TRUNCATED_PLAN_REPAIR_INSTRUCTION, Task, TaskOp, TaskOrchestrator, type TaskQuery, type TaskQueryCatalog, type TaskQueryField, TaskSnapshot, TmuxRunner, type TmuxRunnerDeps, type TokenCarriers, type ToolCall, ToolOutcome, type ToolResult, type UserSettings, Verdict, VerdictEngine, type VerdictListener, WINDOWS_MAX_COMMAND_LINE, type WorkspaceCheckDeps, WorkspaceNotAProjectError, WorkspaceNotFoundError, type WorkspaceProjectCheckDeps, admitSettingsEnv, applyHeadLimit, assertInstallablePluginUrl, assertPlainPluginName, assertWorkspaceExists, assertWorkspaceIsProject, augmentPromptWithPriorOutputs, augmentedPath, bearerHeaderValue, buildConversationSystemPrompt, buildFallbackGrepArgs, buildGlobArgs, buildGrepArgs, buildMergePrompt, buildModifyDuringExecutionPrompt, buildModifyPlanPrompt, buildPlanWithResults, buildResearchPrompt, buildResearchToolsPrompt, buildRunnerInvocation, buildShellInvocation, buildSplitPrompt, buildSubagentSystemPrompt, clampThinkingEffort, classifyCommand, classifyPlannerReply, classifyPluginSource, clearAugmentedPathCache, clearDaemonToken, clearResearchShellCache, clearState, clipboardCopyCommand, coerceAssignments, collectDirectDependencyOutputs, composeAugmentedPrompt, configuredProviders, createAiService, createSkillsService, daemonTokenPath, defaultLogger, definitionPattern, deleteSession, discoverGeminiModels, effectiveAllowlist, ensureDir, ensureStateDirIgnored, executionLogBlock, extractPrdBlock, extractPresentedToken, filterFallbackByAnchoredInclude, filterModelsForPrompt, formatSearchOutput, generatePlanWithRepair, getLatestSession, getProviderMeta, getSettingsPath, getStateDir, globalDataDir, grantScopeFor, hasTmux, includeGlobFor, isCliProvider, isExecutableResolved, isOpenAiProvider, isPlainPluginName, isValidManifest, killTree, languageForId, listSessions, loadSession, loadSessionPlanState, loadState, mapAgentTool, migrateOldConfigDir, mintDaemonToken, mintSessionId, modelContextBlock, modifyValidationFeedback, normalizeAgentArgs, normalizeGeminiModel, parseTaskQueryJson, pendingEditRulesBlock, planDirectLaunch, planShellLaunch, posixShellQuote, prefixModelId, providerForRunner, reEmitPlanPrompt, reEmitTaskOpsPrompt, reEmitTaskQueryPrompt, readDaemonToken, referencePattern, renderPlanMap, renderPriorOutputs, renderTaskQueryAnswer, repairLoop, researchShellWarning, researchToolsPath, resolveArgs, resolvePluginInstallDir, resolveProviderFromPrefix, resolveResearchShell, resolveSkillInvocation, resolveWithin, retargetTaskRunner, runnerAssignment, runnerForProvider, sanitizeSlug, savePrdMarkdown, saveSession, saveState, sessionRuntimeSettings, stateExists, stripAnsi, stripModelPrefix, summarizeOutput, taskOpsRejectedPrompt, taskQuerySignature, textHasTaskQuery, tmuxSessionName, tmuxSocketName, tmuxWindowName, tokenSubprotocols, tokensMatch, truncatedPlanReEmitPrompt, wellKnownBinDirs, windowsCommandLine, withPath, wrapWithPty };
|
package/dist/index.js
CHANGED
|
@@ -40,6 +40,7 @@ __export(index_exports, {
|
|
|
40
40
|
BaseAiService: () => BaseAiService,
|
|
41
41
|
BaseConfig: () => BaseConfig,
|
|
42
42
|
BaseFileSystem: () => BaseFileSystem,
|
|
43
|
+
CHECKPOINT_TRUNCATE_LENGTH: () => CHECKPOINT_TRUNCATE_LENGTH,
|
|
43
44
|
CLAUDE_CODE_MANIFEST: () => CLAUDE_CODE_MANIFEST,
|
|
44
45
|
CLI_PROVIDERS: () => CLI_PROVIDERS,
|
|
45
46
|
CMD_EXE_MAX_COMMAND_LINE: () => CMD_EXE_MAX_COMMAND_LINE,
|
|
@@ -288,6 +289,7 @@ __export(index_exports, {
|
|
|
288
289
|
toOrchestratorOptions: () => toOrchestratorOptions,
|
|
289
290
|
tokenSubprotocols: () => tokenSubprotocols,
|
|
290
291
|
tokensMatch: () => tokensMatch,
|
|
292
|
+
truncateCheckpointSummary: () => truncateCheckpointSummary,
|
|
291
293
|
truncatedPlanReEmitPrompt: () => truncatedPlanReEmitPrompt,
|
|
292
294
|
updateTaskInPlan: () => updateTaskInPlan,
|
|
293
295
|
validateModifiedPlan: () => validateModifiedPlan,
|
|
@@ -9419,9 +9421,11 @@ function buildShellInvocation(command, args) {
|
|
|
9419
9421
|
const inner = [command, ...args].map(posixShellQuote).join(" ");
|
|
9420
9422
|
return { shellPath: "/bin/bash", shellArgs: ["-lc", inner] };
|
|
9421
9423
|
}
|
|
9422
|
-
function wrapWithPty(command, args) {
|
|
9424
|
+
function wrapWithPty(command, args, opts = {}) {
|
|
9423
9425
|
const inner = [command, ...args].map(posixShellQuote).join(" ");
|
|
9424
|
-
|
|
9426
|
+
const watcher = opts.controlChannel ? 'exec 4<&0; ( while read -r C R <&3; do stty cols "$C" rows "$R" <&4; done ) & ' : "";
|
|
9427
|
+
const setup = opts.size ? `stty cols ${opts.size.cols} rows ${opts.size.rows}; ` : "";
|
|
9428
|
+
return { command: "script", args: ["-q", "-e", "-f", "-c", `${watcher}${setup}${inner}`, "/dev/null"] };
|
|
9425
9429
|
}
|
|
9426
9430
|
|
|
9427
9431
|
// src/utils/launch.ts
|
|
@@ -12777,6 +12781,12 @@ function executionSummary(tasks) {
|
|
|
12777
12781
|
failed: tasks.filter((t) => t.status === "failed").length
|
|
12778
12782
|
};
|
|
12779
12783
|
}
|
|
12784
|
+
var CHECKPOINT_TRUNCATE_LENGTH = 120;
|
|
12785
|
+
function truncateCheckpointSummary(summary) {
|
|
12786
|
+
const firstLine = summary.split("\n")[0].trim();
|
|
12787
|
+
if (firstLine.length <= CHECKPOINT_TRUNCATE_LENGTH) return firstLine;
|
|
12788
|
+
return firstLine.slice(0, CHECKPOINT_TRUNCATE_LENGTH - 1) + "\u2026";
|
|
12789
|
+
}
|
|
12780
12790
|
|
|
12781
12791
|
// src/utils/sessionStore.ts
|
|
12782
12792
|
var fs6 = __toESM(require("fs"));
|
|
@@ -14527,17 +14537,25 @@ var HeadlessSession = class extends AbstractTerminalSession {
|
|
|
14527
14537
|
spawnImpl;
|
|
14528
14538
|
process = null;
|
|
14529
14539
|
outputBuffer = "";
|
|
14540
|
+
controlStream = null;
|
|
14530
14541
|
get isStarted() {
|
|
14531
14542
|
return this.process !== null;
|
|
14532
14543
|
}
|
|
14533
|
-
start(launch, cwd, resolvedPath, env) {
|
|
14544
|
+
start(launch, cwd, resolvedPath, env, options) {
|
|
14534
14545
|
if (this.exited || this.process) return;
|
|
14546
|
+
const stdio = ["pipe", "pipe", "pipe"];
|
|
14547
|
+
if (options?.controlChannel) stdio.push("pipe");
|
|
14535
14548
|
this.process = this.spawnImpl(launch.file, launch.args, {
|
|
14536
14549
|
env: withPath(process.env, resolvedPath, env),
|
|
14537
|
-
stdio
|
|
14550
|
+
stdio,
|
|
14538
14551
|
cwd,
|
|
14539
14552
|
windowsVerbatimArguments: launch.verbatim
|
|
14540
14553
|
});
|
|
14554
|
+
if (options?.controlChannel) {
|
|
14555
|
+
this.controlStream = this.process.stdio?.[3] ?? null;
|
|
14556
|
+
this.controlStream?.on("error", () => {
|
|
14557
|
+
});
|
|
14558
|
+
}
|
|
14541
14559
|
const onData = (data) => {
|
|
14542
14560
|
const raw = data.toString();
|
|
14543
14561
|
this.outputBuffer += stripAnsi(raw);
|
|
@@ -14570,6 +14588,12 @@ Process error: ${err.message}
|
|
|
14570
14588
|
this.process.stdin.write(text);
|
|
14571
14589
|
}
|
|
14572
14590
|
}
|
|
14591
|
+
/** PTY resize requests from a surface that owns the terminal rendering the wrapper. */
|
|
14592
|
+
writeControl(text) {
|
|
14593
|
+
if (this.controlStream && !this.controlStream.destroyed) {
|
|
14594
|
+
this.controlStream.write(text);
|
|
14595
|
+
}
|
|
14596
|
+
}
|
|
14573
14597
|
};
|
|
14574
14598
|
var HeadlessRunner = class extends AbstractRunner {
|
|
14575
14599
|
spawnImpl;
|
|
@@ -14595,7 +14619,7 @@ var HeadlessRunner = class extends AbstractRunner {
|
|
|
14595
14619
|
return new HeadlessSession(id, taskId, this.spawnImpl);
|
|
14596
14620
|
}
|
|
14597
14621
|
/** Everything up to, but not including, spawning — so a surface that owns its own child reaches the same decisions. */
|
|
14598
|
-
async prepareLaunch(opts) {
|
|
14622
|
+
async prepareLaunch(opts, ptyOptions) {
|
|
14599
14623
|
const interactive = this.defaultInteractive;
|
|
14600
14624
|
const invocation = buildRunnerInvocation({
|
|
14601
14625
|
runner: opts.runner,
|
|
@@ -14612,7 +14636,7 @@ var HeadlessRunner = class extends AbstractRunner {
|
|
|
14612
14636
|
const manifest = opts.registry?.get(opts.runner)?.manifest;
|
|
14613
14637
|
const pty = (manifest?.runner.requiresTty === true || interactive) && this.hasScriptCmd();
|
|
14614
14638
|
const resolvedPath = await this.resolvePath();
|
|
14615
|
-
const { command, args } = pty ? wrapWithPty(invocation.command, invocation.args) : { command: invocation.command, args: invocation.args };
|
|
14639
|
+
const { command, args } = pty ? wrapWithPty(invocation.command, invocation.args, ptyOptions) : { command: invocation.command, args: invocation.args };
|
|
14616
14640
|
return {
|
|
14617
14641
|
launch: await planDirectLaunch(command, args, this.launchDeps),
|
|
14618
14642
|
resolvedPath,
|
|
@@ -15932,6 +15956,7 @@ var PlannerModelMemory = class {
|
|
|
15932
15956
|
BaseAiService,
|
|
15933
15957
|
BaseConfig,
|
|
15934
15958
|
BaseFileSystem,
|
|
15959
|
+
CHECKPOINT_TRUNCATE_LENGTH,
|
|
15935
15960
|
CLAUDE_CODE_MANIFEST,
|
|
15936
15961
|
CLI_PROVIDERS,
|
|
15937
15962
|
CMD_EXE_MAX_COMMAND_LINE,
|
|
@@ -16180,6 +16205,7 @@ var PlannerModelMemory = class {
|
|
|
16180
16205
|
toOrchestratorOptions,
|
|
16181
16206
|
tokenSubprotocols,
|
|
16182
16207
|
tokensMatch,
|
|
16208
|
+
truncateCheckpointSummary,
|
|
16183
16209
|
truncatedPlanReEmitPrompt,
|
|
16184
16210
|
updateTaskInPlan,
|
|
16185
16211
|
validateModifiedPlan,
|