@ordewell/core 0.5.4 → 0.5.5
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/{ITerminalRunner-Bd-vAJnw.d.ts → ITerminalRunner-BV9Rd2o9.d.ts} +3 -1
- package/dist/{ITerminalRunner-ByeoLF57.d.mts → ITerminalRunner-C77ZNZS9.d.mts} +3 -1
- package/dist/{ModeResolver-DVJ7HV3k.d.mts → ModeResolver-D-SUFRNF.d.mts} +1 -1
- package/dist/{ModeResolver-Dkig8ghQ.d.ts → ModeResolver-D3XO0fT9.d.ts} +1 -1
- package/dist/{Task-BxQkPlXO.d.mts → Task-Vl5Zq_D-.d.mts} +168 -7
- package/dist/{Task-BxQkPlXO.d.ts → Task-Vl5Zq_D-.d.ts} +168 -7
- package/dist/{chunk-JVMDEHRQ.mjs → chunk-HD2FWPRV.mjs} +72 -37
- package/dist/chunk-HD2FWPRV.mjs.map +1 -0
- package/dist/{chunk-GWPIYDQW.mjs → chunk-KLN7ELXO.mjs} +897 -18
- package/dist/chunk-KLN7ELXO.mjs.map +1 -0
- package/dist/{chunk-XWOUIA6A.mjs → chunk-UUBGVCGJ.mjs} +2 -2
- package/dist/index.d.mts +320 -60
- package/dist/index.d.ts +320 -60
- package/dist/index.js +2497 -672
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1605 -659
- 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-CF_grC29.d.ts → parsing-BTP4bwkk.d.ts} +11 -3
- package/dist/{parsing-DRp4dPC0.d.mts → parsing-CDtRSxBY.d.mts} +11 -3
- 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 +2 -2
- package/dist/plan-utils-BFaPo-IT.d.ts +708 -0
- package/dist/plan-utils-pE4TBwxl.d.mts +708 -0
- package/dist/plan-utils.d.mts +3 -3
- package/dist/plan-utils.d.ts +3 -3
- package/dist/plan-utils.js +668 -7
- package/dist/plan-utils.js.map +1 -1
- package/dist/plan-utils.mjs +38 -4
- package/dist/testing.d.mts +5 -3
- package/dist/testing.d.ts +5 -3
- package/dist/testing.js +3 -0
- package/dist/testing.js.map +1 -1
- package/dist/testing.mjs +3 -0
- package/dist/testing.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-GWPIYDQW.mjs.map +0 -1
- package/dist/chunk-JVMDEHRQ.mjs.map +0 -1
- package/dist/plan-utils-CkNbqAmS.d.ts +0 -329
- package/dist/plan-utils-CtB3_Ovf.d.mts +0 -329
- /package/dist/{chunk-XWOUIA6A.mjs.map → chunk-UUBGVCGJ.mjs.map} +0 -0
|
@@ -1,329 +0,0 @@
|
|
|
1
|
-
import { q as IsolationTaskStatus, P as PlanIsolation, F as RunnerId, a as DiscoveredModel, T as Task, L as LegacyPlanState, Q as QueuedMessage, a3 as Verdict, J as TaskIsolation, d as IsolationHandoff, k as IsolationMergeResult, z as ResearchStep, B as ResearchStepOutcome } from './Task-BxQkPlXO.mjs';
|
|
2
|
-
import { R as RunnerModeInfo } from './ModeResolver-DVJ7HV3k.mjs';
|
|
3
|
-
import { A as ApprovalKind, e as ApprovalSource } from './ApprovalPolicy-BVhGdECT.mjs';
|
|
4
|
-
|
|
5
|
-
/** A conflict's files as one surface shows them: every one, up to `max`, then how many more. */
|
|
6
|
-
declare function capConflictFiles(files: string[], max?: number): string;
|
|
7
|
-
/** A task record as ADR-0013 persisted it, for one repository. */
|
|
8
|
-
interface Adr0013TaskRecord {
|
|
9
|
-
taskId: string;
|
|
10
|
-
order: number;
|
|
11
|
-
title: string;
|
|
12
|
-
branch: string;
|
|
13
|
-
worktree: string;
|
|
14
|
-
status: IsolationTaskStatus;
|
|
15
|
-
linked: string[];
|
|
16
|
-
}
|
|
17
|
-
/** A run as ADR-0013 persisted it (0.4.23): one repository, its refs on the run itself. */
|
|
18
|
-
interface Adr0013IsolationRun {
|
|
19
|
-
id: string;
|
|
20
|
-
workspaceRoot: string;
|
|
21
|
-
baseRef: string;
|
|
22
|
-
baseBranch?: string;
|
|
23
|
-
integrationBranch: string;
|
|
24
|
-
tasks: Record<string, Adr0013TaskRecord>;
|
|
25
|
-
}
|
|
26
|
-
interface Adr0013PlanIsolation {
|
|
27
|
-
run: Adr0013IsolationRun;
|
|
28
|
-
resolvers: Record<string, string>;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* A persisted plan isolation in today's shape. A run saved in the ADR-0013
|
|
32
|
-
* format — recognised by its own `integrationBranch` — becomes a group of one
|
|
33
|
-
* at `.`, keeping its branches, so a session saved by 0.4.23 resumes and hands
|
|
34
|
-
* off exactly as it would have.
|
|
35
|
-
*/
|
|
36
|
-
declare function migratePlanIsolation(state: PlanIsolation | Adr0013PlanIsolation): PlanIsolation;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* The catalog a model/task-mode edit is checked against — the same discovered
|
|
40
|
-
* models and manifest modes the planner was shown in the per-turn catalog
|
|
41
|
-
* block (`PlannerConversation.catalogBlock`), so a refusal here can never name something
|
|
42
|
-
* as invalid that the planner was never told about, or vice versa.
|
|
43
|
-
*/
|
|
44
|
-
interface EditCatalog {
|
|
45
|
-
modelsByRunner: Partial<Record<RunnerId, DiscoveredModel[]>>;
|
|
46
|
-
runnerModes: Partial<Record<RunnerId, RunnerModeInfo[]>>;
|
|
47
|
-
/** Raw (unfiltered) allowlist, keyed by runner — the same shape `coerceAssignments` takes. */
|
|
48
|
-
perRunnerAllowlist?: Partial<Record<RunnerId, string[]>>;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Targeted task edits emitted by the planner conversation (the 'task_ops'
|
|
53
|
-
* ConversationTurn). Task references accept a task id, a "#<order>" ref, or a
|
|
54
|
-
* bare order number — cheap models rarely echo UUIDs correctly.
|
|
55
|
-
*/
|
|
56
|
-
type TaskOp = {
|
|
57
|
-
op: 'update';
|
|
58
|
-
taskId: string;
|
|
59
|
-
changes: Partial<Task>;
|
|
60
|
-
} | {
|
|
61
|
-
op: 'add';
|
|
62
|
-
task: Partial<Task>;
|
|
63
|
-
handle?: string;
|
|
64
|
-
} | {
|
|
65
|
-
op: 'remove';
|
|
66
|
-
taskId: string;
|
|
67
|
-
} | {
|
|
68
|
-
op: 'reorder';
|
|
69
|
-
taskIds: string[];
|
|
70
|
-
} | {
|
|
71
|
-
op: 'merge';
|
|
72
|
-
taskIds: string[];
|
|
73
|
-
merged: Partial<Task>;
|
|
74
|
-
handle?: string;
|
|
75
|
-
} | {
|
|
76
|
-
op: 'split';
|
|
77
|
-
taskId: string;
|
|
78
|
-
parts: Partial<Task>[];
|
|
79
|
-
handle?: string;
|
|
80
|
-
} | {
|
|
81
|
-
op: 'rearm';
|
|
82
|
-
taskId: string;
|
|
83
|
-
changes?: Partial<Task>;
|
|
84
|
-
};
|
|
85
|
-
declare function textHasTaskOps(text: string): boolean;
|
|
86
|
-
/** Parse a `{"taskOps":[...]}` reply. Throws PlanParseError when the JSON is unusable. */
|
|
87
|
-
declare function parseTaskOpsJson(text: string): TaskOp[];
|
|
88
|
-
interface ApplyTaskOpsResult {
|
|
89
|
-
ok: boolean;
|
|
90
|
-
tasks: Task[];
|
|
91
|
-
errors: string[];
|
|
92
|
-
/** Human-readable summary of what changed, for the chat transcript. */
|
|
93
|
-
summary: string[];
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Pre-flight check for a merge: would collapsing the selected tasks into one
|
|
97
|
-
* (rewiring every dependent of any selected task to the survivor) keep the
|
|
98
|
-
* dependency graph valid? Rejects locked tasks and merges whose rewiring would
|
|
99
|
-
* introduce a cycle. Display order is NOT checked here — neither
|
|
100
|
-
* consecutiveness (a UI concern) nor a dependency the merge pulls out of order,
|
|
101
|
-
* which {@link applyTaskOps} repairs; refusing on order would make this
|
|
102
|
-
* pre-flight stricter than the applier it stands in for.
|
|
103
|
-
*/
|
|
104
|
-
declare function canMergeTasks(tasks: Task[], selectedIds: string[]): {
|
|
105
|
-
ok: boolean;
|
|
106
|
-
error?: string;
|
|
107
|
-
};
|
|
108
|
-
/**
|
|
109
|
-
* The shape the dependency helpers below read. Structural rather than `Task`,
|
|
110
|
-
* because the TUI projects tasks into its own `TaskView`: a surface's
|
|
111
|
-
* dependency picker and the API's validation must agree on which dependencies
|
|
112
|
-
* are legal, and a signature only core can satisfy would have forced the TUI
|
|
113
|
-
* to keep a second copy of the rule.
|
|
114
|
-
*/
|
|
115
|
-
interface TaskRef {
|
|
116
|
-
id: string;
|
|
117
|
-
order: number;
|
|
118
|
-
title: string;
|
|
119
|
-
dependencies: string[];
|
|
120
|
-
}
|
|
121
|
-
/** The tasks listing `taskId` as a dependency — exactly what removing it detaches. */
|
|
122
|
-
declare function dependentsOf<T extends Pick<TaskRef, 'id' | 'dependencies'>>(tasks: T[], taskId: string): T[];
|
|
123
|
-
/**
|
|
124
|
-
* The tasks that may become dependencies of `taskId`: those displayed before it.
|
|
125
|
-
*
|
|
126
|
-
* Offering only earlier tasks is what keeps a hand-edited graph valid without a
|
|
127
|
-
* cycle check — dependencies then only ever point backwards in display order,
|
|
128
|
-
* the same invariant `applyTaskOps` enforces. Omit `taskId` for a task that does
|
|
129
|
-
* not exist yet: it lands last, so every current task is a candidate.
|
|
130
|
-
*/
|
|
131
|
-
declare function dependencyCandidates<T extends Pick<TaskRef, 'id' | 'order'>>(tasks: T[], taskId?: string): T[];
|
|
132
|
-
/** Pre-flight check for a hand-edited dependency list: every id exists and comes earlier. */
|
|
133
|
-
declare function canSetDependencies<T extends TaskRef>(tasks: T[], taskId: string, dependencies: string[]): {
|
|
134
|
-
ok: boolean;
|
|
135
|
-
error?: string;
|
|
136
|
-
};
|
|
137
|
-
/** Pre-flight check for a split: the task exists and is not locked by execution. */
|
|
138
|
-
declare function canSplitTask(tasks: Task[], taskId: string): {
|
|
139
|
-
ok: boolean;
|
|
140
|
-
error?: string;
|
|
141
|
-
};
|
|
142
|
-
/**
|
|
143
|
-
* Apply task ops to a snapshot of the plan, atomically: either every op
|
|
144
|
-
* applies and the result validates (deps resolve, no cycles, running and
|
|
145
|
-
* completed tasks untouched), or nothing is returned and `errors` explains
|
|
146
|
-
* why. The caller commits `tasks` on ok.
|
|
147
|
-
*/
|
|
148
|
-
declare function applyTaskOps(currentTasks: Task[], ops: TaskOp[], runners: RunnerId[], catalog?: EditCatalog): ApplyTaskOpsResult;
|
|
149
|
-
|
|
150
|
-
type SerializedTaskStatus = {
|
|
151
|
-
id: string;
|
|
152
|
-
status: string;
|
|
153
|
-
verdict: {
|
|
154
|
-
outcome: 'pass' | 'fail';
|
|
155
|
-
reason: string;
|
|
156
|
-
checks: Verdict['checks'];
|
|
157
|
-
} | null;
|
|
158
|
-
/** Advisory silence timestamp from VerdictEngine — not part of task status semantics. */
|
|
159
|
-
idleSince?: string | null;
|
|
160
|
-
/** Absent unless the plan has an isolation run, so a shared-root plan's updates are unchanged. */
|
|
161
|
-
isolation?: TaskIsolation;
|
|
162
|
-
};
|
|
163
|
-
type SerializedTask = {
|
|
164
|
-
id: string;
|
|
165
|
-
order: number;
|
|
166
|
-
title: string;
|
|
167
|
-
type: string;
|
|
168
|
-
description: string;
|
|
169
|
-
dependencies: string[];
|
|
170
|
-
assignedRunner: RunnerId;
|
|
171
|
-
assignedModel: Task['assignedModel'] | null;
|
|
172
|
-
taskMode: string;
|
|
173
|
-
prompt: string | null;
|
|
174
|
-
subtasks: SerializedTask[];
|
|
175
|
-
userSteps: Task['userSteps'];
|
|
176
|
-
thinkingEffort: Task['thinkingEffort'];
|
|
177
|
-
autonomy: Task['autonomy'];
|
|
178
|
-
sliceType: Task['sliceType'];
|
|
179
|
-
userStoriesCovered: Task['userStoriesCovered'];
|
|
180
|
-
};
|
|
181
|
-
type SerializedPlan = {
|
|
182
|
-
tasks: SerializedTask[];
|
|
183
|
-
runners: RunnerId[];
|
|
184
|
-
generatedAt: string;
|
|
185
|
-
conversationHistory?: LegacyPlanState['conversationHistory'];
|
|
186
|
-
prdMarkdown?: string;
|
|
187
|
-
queuedMessages?: QueuedMessage[];
|
|
188
|
-
};
|
|
189
|
-
type SessionMessage = {
|
|
190
|
-
type: 'plan_generated';
|
|
191
|
-
plan: SerializedPlan;
|
|
192
|
-
goal: string;
|
|
193
|
-
runners: RunnerId[];
|
|
194
|
-
} | {
|
|
195
|
-
type: 'planner_message';
|
|
196
|
-
content: string;
|
|
197
|
-
timestamp: string;
|
|
198
|
-
} | {
|
|
199
|
-
type: 'status_update';
|
|
200
|
-
tasks: SerializedTaskStatus[];
|
|
201
|
-
} | {
|
|
202
|
-
type: 'review_needed';
|
|
203
|
-
tasks: SerializedTask[];
|
|
204
|
-
} | {
|
|
205
|
-
type: 'review_approved';
|
|
206
|
-
} | {
|
|
207
|
-
type: 'checkpoint';
|
|
208
|
-
taskId: string;
|
|
209
|
-
taskTitle: string;
|
|
210
|
-
summary: string;
|
|
211
|
-
} | {
|
|
212
|
-
type: 'execution_complete';
|
|
213
|
-
summary: {
|
|
214
|
-
total: number;
|
|
215
|
-
completed: number;
|
|
216
|
-
failed: number;
|
|
217
|
-
};
|
|
218
|
-
} | {
|
|
219
|
-
type: 'execution_stopped';
|
|
220
|
-
} | {
|
|
221
|
-
type: 'queue_ready';
|
|
222
|
-
} | {
|
|
223
|
-
type: 'task_updated';
|
|
224
|
-
taskId: string;
|
|
225
|
-
changes: Record<string, unknown>;
|
|
226
|
-
} | {
|
|
227
|
-
type: 'task_started';
|
|
228
|
-
taskId: string;
|
|
229
|
-
order: number;
|
|
230
|
-
title: string;
|
|
231
|
-
runner: RunnerId;
|
|
232
|
-
modelId?: string;
|
|
233
|
-
} | {
|
|
234
|
-
type: 'task_output';
|
|
235
|
-
taskId: string;
|
|
236
|
-
text: string;
|
|
237
|
-
} | {
|
|
238
|
-
type: 'isolation_blocked';
|
|
239
|
-
reason: 'dirty';
|
|
240
|
-
repos?: string[];
|
|
241
|
-
message: string;
|
|
242
|
-
} | {
|
|
243
|
-
type: 'isolation_handoff';
|
|
244
|
-
repos: IsolationHandoff['repos'];
|
|
245
|
-
landed: IsolationHandoff['landed'];
|
|
246
|
-
} | {
|
|
247
|
-
type: 'isolation_merge';
|
|
248
|
-
result: IsolationMergeResult;
|
|
249
|
-
} | {
|
|
250
|
-
type: 'plan_thinking';
|
|
251
|
-
text: string;
|
|
252
|
-
} | {
|
|
253
|
-
type: 'planner_liveness';
|
|
254
|
-
} | {
|
|
255
|
-
type: 'research_step';
|
|
256
|
-
tool: string;
|
|
257
|
-
toolLabel?: string;
|
|
258
|
-
args: string;
|
|
259
|
-
subagentId?: string;
|
|
260
|
-
toolCallId?: string;
|
|
261
|
-
} | {
|
|
262
|
-
type: 'plan_token';
|
|
263
|
-
token: string;
|
|
264
|
-
} | {
|
|
265
|
-
type: 'research_step_done';
|
|
266
|
-
step: ResearchStep;
|
|
267
|
-
subagentId?: string;
|
|
268
|
-
} | {
|
|
269
|
-
type: 'approval_request';
|
|
270
|
-
id: string;
|
|
271
|
-
kind: ApprovalKind;
|
|
272
|
-
subject: string;
|
|
273
|
-
scope: string;
|
|
274
|
-
detail?: string;
|
|
275
|
-
} | {
|
|
276
|
-
type: 'approval_settled';
|
|
277
|
-
id: string;
|
|
278
|
-
granted: boolean;
|
|
279
|
-
} | {
|
|
280
|
-
type: 'approval_decided';
|
|
281
|
-
kind: ApprovalKind;
|
|
282
|
-
subject: string;
|
|
283
|
-
scope: string;
|
|
284
|
-
detail?: string;
|
|
285
|
-
granted: boolean;
|
|
286
|
-
source: Exclude<ApprovalSource, 'asked'>;
|
|
287
|
-
};
|
|
288
|
-
/**
|
|
289
|
-
* A line a run wants the user to read — how it isolates, what it shares. Not a
|
|
290
|
-
* {@link SessionMessage}: hosts that show notices as toasts already do, and
|
|
291
|
-
* widening the union would break every exhaustive switch over it. A host with
|
|
292
|
-
* no toast channel (the daemon) hands these to its clients by its own means.
|
|
293
|
-
*/
|
|
294
|
-
type SessionNotice = {
|
|
295
|
-
type: 'notice';
|
|
296
|
-
level: 'info' | 'warn';
|
|
297
|
-
message: string;
|
|
298
|
-
};
|
|
299
|
-
type SessionBroadcaster = (msg: SessionMessage) => void;
|
|
300
|
-
declare function serializeTask(t: Task): SerializedTask;
|
|
301
|
-
declare function serializeTaskStatus(t: Task, idleSince?: string | null, isolation?: TaskIsolation | null): SerializedTaskStatus;
|
|
302
|
-
declare function serializePlan(plan: LegacyPlanState): SerializedPlan;
|
|
303
|
-
declare function executionSummary(tasks: Task[]): {
|
|
304
|
-
total: number;
|
|
305
|
-
completed: number;
|
|
306
|
-
failed: number;
|
|
307
|
-
};
|
|
308
|
-
declare const CHECKPOINT_TRUNCATE_LENGTH = 120;
|
|
309
|
-
/** Truncate a checkpoint summary to a single line of at most CHECKPOINT_TRUNCATE_LENGTH chars. */
|
|
310
|
-
declare function truncateCheckpointSummary(summary: string): string;
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
* @param toolLabel The agent's own name for the tool, when a harness planner
|
|
314
|
-
* produced the call (ADR-0009). It replaces the member name in the summary, so
|
|
315
|
-
* the timeline says `Edit` rather than the catch-all `agent_tool` — and says
|
|
316
|
-
* `WebFetch` rather than claiming a shell command ran.
|
|
317
|
-
*/
|
|
318
|
-
declare function summarizeToolCall(tool: string, argsJson: string, toolLabel?: string): string;
|
|
319
|
-
/**
|
|
320
|
-
* Classify a tool outcome from its result text and success flag, so a surface
|
|
321
|
-
* can render a refused `rm` or a denied `npm test` distinctly from a
|
|
322
|
-
* successful run without re-deriving the refusal signatures per surface. The
|
|
323
|
-
* refusal/denial strings come from `commandPolicy.ts`, `BaseFileSystem.ts`,
|
|
324
|
-
* and the research-subagent wrapper — keeping the matching here means the
|
|
325
|
-
* signatures stay in one place alongside the human summary.
|
|
326
|
-
*/
|
|
327
|
-
declare function classifyOutcome(success: boolean, output: string): ResearchStepOutcome;
|
|
328
|
-
|
|
329
|
-
export { type Adr0013IsolationRun as A, CHECKPOINT_TRUNCATE_LENGTH as C, type SerializedPlan as S, type TaskOp as T, type Adr0013PlanIsolation as a, type Adr0013TaskRecord as b, type ApplyTaskOpsResult as c, type SerializedTask as d, type SerializedTaskStatus as e, type SessionBroadcaster as f, type SessionMessage as g, type SessionNotice as h, type TaskRef as i, applyTaskOps as j, canMergeTasks as k, canSetDependencies as l, canSplitTask as m, capConflictFiles as n, classifyOutcome as o, dependencyCandidates as p, dependentsOf as q, executionSummary as r, migratePlanIsolation as s, parseTaskOpsJson as t, serializePlan as u, serializeTask as v, serializeTaskStatus as w, summarizeToolCall as x, textHasTaskOps as y, truncateCheckpointSummary as z };
|
|
File without changes
|