@ordewell/core 0.10.12 → 0.11.1
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/AUTHORS.md +37 -0
- package/NOTICE +71 -0
- package/README.md +1 -1
- package/dist/{IFileSystem-1PqRCjhu.d.mts → IRunner-B5l9PCTv.d.ts} +926 -102
- package/dist/{IFileSystem-lTRL_G9Z.d.ts → IRunner-DBgDx_Mr.d.mts} +926 -102
- package/dist/{ModeResolver-CoJAJD-f.d.ts → ModeResolver-BDAgouuE.d.mts} +9 -2
- package/dist/{ModeResolver-6TQXVsde.d.mts → ModeResolver-DyXeZ9ib.d.ts} +9 -2
- package/dist/{Task-CfBM0wkV.d.mts → Task-BL4Idm9r.d.mts} +656 -26
- package/dist/{Task-CfBM0wkV.d.ts → Task-BL4Idm9r.d.ts} +656 -26
- package/dist/{chunk-ESKK5I4F.mjs → chunk-4QXOWEGC.mjs} +1888 -334
- package/dist/chunk-4QXOWEGC.mjs.map +1 -0
- package/dist/{chunk-KWS3VEER.mjs → chunk-MYXMIVWA.mjs} +6 -6
- package/dist/chunk-MYXMIVWA.mjs.map +1 -0
- package/dist/{chunk-PFH7WFIB.mjs → chunk-QTZ5XTBY.mjs} +228 -15
- package/dist/chunk-QTZ5XTBY.mjs.map +1 -0
- package/dist/{chunk-24EL4Z2W.mjs → chunk-YAFNYNFX.mjs} +342 -36
- package/dist/chunk-YAFNYNFX.mjs.map +1 -0
- package/dist/index.d.mts +1488 -769
- package/dist/index.d.ts +1488 -769
- package/dist/index.js +32003 -20350
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +29380 -19553
- package/dist/index.mjs.map +1 -1
- package/dist/parsing.d.mts +2 -2
- package/dist/parsing.d.ts +2 -2
- package/dist/parsing.js +232 -25
- package/dist/parsing.js.map +1 -1
- package/dist/parsing.mjs +3 -3
- package/dist/plan-utils.d.mts +4 -4
- package/dist/plan-utils.d.ts +4 -4
- package/dist/plan-utils.js +1156 -96
- package/dist/plan-utils.js.map +1 -1
- package/dist/plan-utils.mjs +144 -8
- package/dist/{runSettingsText-Jb_efnI4.d.mts → runSettingsText-BKwWs052.d.mts} +2882 -621
- package/dist/{runSettingsText-C5uv2axI.d.ts → runSettingsText-CAXiTpsj.d.ts} +2882 -621
- package/dist/testing.d.mts +10 -4
- package/dist/testing.d.ts +10 -4
- package/dist/testing.js +30 -7
- package/dist/testing.js.map +1 -1
- package/dist/testing.mjs +26 -7
- package/dist/testing.mjs.map +1 -1
- package/package.json +7 -3
- package/skills/diagnose/SKILL.md +52 -0
- package/skills/explore/SKILL.md +65 -0
- package/dist/chunk-24EL4Z2W.mjs.map +0 -1
- package/dist/chunk-ESKK5I4F.mjs.map +0 -1
- package/dist/chunk-KWS3VEER.mjs.map +0 -1
- package/dist/chunk-NJGID6BG.mjs +0 -115
- package/dist/chunk-NJGID6BG.mjs.map +0 -1
- package/dist/chunk-PFH7WFIB.mjs.map +0 -1
package/dist/testing.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { R as IRunnerSession, ar as QueuedTaskMessage, b5 as StructuredTurnEnd, b4 as StructuredEvent, bb as TaskCompleteArgs, t as CheckpointAnswer, aW as ScriptExit, bd as TaskMessageFrom, aE as RunnerCommand, S as InvokedCommand, k as ApprovalDecision, O as IConfig, P as IFileSystem } from './IRunner-DBgDx_Mr.mjs';
|
|
2
|
+
import { y as IntegrationDisposal, aA as RunnerSessionCost, x as IWorktreeIsolation, J as IsolationAvailability, R as IsolationMergeResult, b4 as TreeSnapshot, aF as SetupFailure, U as IsolationPruneResult, V as IsolationRemoval, S as IsolationOutcome, ao as RepairEvidence, X as IsolationRun, aS as Task, ah as PrepareIntent, ai as PreparedTask, q as HandoffCommit, K as IsolationHandoff } from './Task-BL4Idm9r.mjs';
|
|
3
3
|
import 'child_process';
|
|
4
4
|
import 'zod/v4';
|
|
5
5
|
|
|
@@ -60,6 +60,10 @@ declare class FakeRunnerSession implements IRunnerSession {
|
|
|
60
60
|
*/
|
|
61
61
|
reportComplete(report: TaskCompleteArgs): void;
|
|
62
62
|
onToolCheckpoint(handler: (question: string, signal: AbortSignal) => Promise<CheckpointAnswer>): void;
|
|
63
|
+
private scriptExitCbs;
|
|
64
|
+
onScriptExit(cb: (exit: ScriptExit) => void): void;
|
|
65
|
+
/** A script task's body ended, as `ScriptSession` hands it on (ADR-0035). */
|
|
66
|
+
reportScriptExit(exit: ScriptExit): void;
|
|
63
67
|
/** The runner calls `checkpoint`, as `StructuredSession` relays it; settles with the answer. */
|
|
64
68
|
callCheckpoint(question: string, signal?: AbortSignal): Promise<CheckpointAnswer>;
|
|
65
69
|
sendMessage(text: string, from?: TaskMessageFrom): string;
|
|
@@ -192,12 +196,14 @@ declare class FakeWorktreeIsolation implements IWorktreeIsolation {
|
|
|
192
196
|
/** Like git: once the tracked changes are stashed, the tree is no longer dirty. */
|
|
193
197
|
stash(workspaceRoot: string): Promise<void>;
|
|
194
198
|
startRun(workspaceRoot: string): Promise<IsolationRun>;
|
|
195
|
-
prepare(task: Task, run: IsolationRun
|
|
199
|
+
prepare(task: Task, run: IsolationRun, _intent?: PrepareIntent, opts?: {
|
|
200
|
+
readOnly?: boolean;
|
|
201
|
+
}): Promise<PreparedTask>;
|
|
196
202
|
/** Like git: the same cwd, each changed repo's tip recorded, the repair counted. */
|
|
197
203
|
reopen(task: Task, run: IsolationRun): Promise<PreparedTask>;
|
|
198
204
|
verifyRepair(task: Task, _run: IsolationRun): Promise<RepairEvidence>;
|
|
199
205
|
/** Like git: the landing is recorded and persisted before the (held) merge, and cleared once it settles. */
|
|
200
|
-
integrate(task: Task, run: IsolationRun, persist?: () => void): Promise<IsolationOutcome>;
|
|
206
|
+
integrate(task: Task, run: IsolationRun, persist?: () => void, commit?: HandoffCommit): Promise<IsolationOutcome>;
|
|
201
207
|
release(run: IsolationRun, taskId: string, opts: {
|
|
202
208
|
keep: boolean;
|
|
203
209
|
}): Promise<IsolationRemoval>;
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { R as IRunnerSession, ar as QueuedTaskMessage, b5 as StructuredTurnEnd, b4 as StructuredEvent, bb as TaskCompleteArgs, t as CheckpointAnswer, aW as ScriptExit, bd as TaskMessageFrom, aE as RunnerCommand, S as InvokedCommand, k as ApprovalDecision, O as IConfig, P as IFileSystem } from './IRunner-B5l9PCTv.js';
|
|
2
|
+
import { y as IntegrationDisposal, aA as RunnerSessionCost, x as IWorktreeIsolation, J as IsolationAvailability, R as IsolationMergeResult, b4 as TreeSnapshot, aF as SetupFailure, U as IsolationPruneResult, V as IsolationRemoval, S as IsolationOutcome, ao as RepairEvidence, X as IsolationRun, aS as Task, ah as PrepareIntent, ai as PreparedTask, q as HandoffCommit, K as IsolationHandoff } from './Task-BL4Idm9r.js';
|
|
3
3
|
import 'child_process';
|
|
4
4
|
import 'zod/v4';
|
|
5
5
|
|
|
@@ -60,6 +60,10 @@ declare class FakeRunnerSession implements IRunnerSession {
|
|
|
60
60
|
*/
|
|
61
61
|
reportComplete(report: TaskCompleteArgs): void;
|
|
62
62
|
onToolCheckpoint(handler: (question: string, signal: AbortSignal) => Promise<CheckpointAnswer>): void;
|
|
63
|
+
private scriptExitCbs;
|
|
64
|
+
onScriptExit(cb: (exit: ScriptExit) => void): void;
|
|
65
|
+
/** A script task's body ended, as `ScriptSession` hands it on (ADR-0035). */
|
|
66
|
+
reportScriptExit(exit: ScriptExit): void;
|
|
63
67
|
/** The runner calls `checkpoint`, as `StructuredSession` relays it; settles with the answer. */
|
|
64
68
|
callCheckpoint(question: string, signal?: AbortSignal): Promise<CheckpointAnswer>;
|
|
65
69
|
sendMessage(text: string, from?: TaskMessageFrom): string;
|
|
@@ -192,12 +196,14 @@ declare class FakeWorktreeIsolation implements IWorktreeIsolation {
|
|
|
192
196
|
/** Like git: once the tracked changes are stashed, the tree is no longer dirty. */
|
|
193
197
|
stash(workspaceRoot: string): Promise<void>;
|
|
194
198
|
startRun(workspaceRoot: string): Promise<IsolationRun>;
|
|
195
|
-
prepare(task: Task, run: IsolationRun
|
|
199
|
+
prepare(task: Task, run: IsolationRun, _intent?: PrepareIntent, opts?: {
|
|
200
|
+
readOnly?: boolean;
|
|
201
|
+
}): Promise<PreparedTask>;
|
|
196
202
|
/** Like git: the same cwd, each changed repo's tip recorded, the repair counted. */
|
|
197
203
|
reopen(task: Task, run: IsolationRun): Promise<PreparedTask>;
|
|
198
204
|
verifyRepair(task: Task, _run: IsolationRun): Promise<RepairEvidence>;
|
|
199
205
|
/** Like git: the landing is recorded and persisted before the (held) merge, and cleared once it settles. */
|
|
200
|
-
integrate(task: Task, run: IsolationRun, persist?: () => void): Promise<IsolationOutcome>;
|
|
206
|
+
integrate(task: Task, run: IsolationRun, persist?: () => void, commit?: HandoffCommit): Promise<IsolationOutcome>;
|
|
201
207
|
release(run: IsolationRun, taskId: string, opts: {
|
|
202
208
|
keep: boolean;
|
|
203
209
|
}): Promise<IsolationRemoval>;
|
package/dist/testing.js
CHANGED
|
@@ -35,12 +35,10 @@ var import_uuid = require("uuid");
|
|
|
35
35
|
var SKILL_NAME_PATTERN = "[a-z0-9][a-z0-9_-]*";
|
|
36
36
|
var SKILL_TOKEN = new RegExp(`(^|\\s)\\/(${SKILL_NAME_PATTERN})([,.!?;:]*)(?=\\s|$)`, "gi");
|
|
37
37
|
|
|
38
|
-
// src/
|
|
39
|
-
var
|
|
40
|
-
var DEFAULT_RUNNERS = ["claude-code"];
|
|
38
|
+
// src/services/repoPath.ts
|
|
39
|
+
var SELF_REPO = ".";
|
|
41
40
|
|
|
42
41
|
// src/services/isolationRecord.ts
|
|
43
|
-
var SELF_REPO = ".";
|
|
44
42
|
function integrationBranchFor(runId) {
|
|
45
43
|
return `ordewell/${runId}/integration`;
|
|
46
44
|
}
|
|
@@ -68,6 +66,10 @@ function handoffOf(run) {
|
|
|
68
66
|
};
|
|
69
67
|
}
|
|
70
68
|
|
|
69
|
+
// src/models/Task.ts
|
|
70
|
+
var SKILL_NAME = new RegExp(`^${SKILL_NAME_PATTERN}$`);
|
|
71
|
+
var DEFAULT_RUNNERS = ["claude-code"];
|
|
72
|
+
|
|
71
73
|
// src/testing.ts
|
|
72
74
|
async function flushMicrotasks(rounds = 20) {
|
|
73
75
|
for (let i = 0; i < rounds; i += 1) await Promise.resolve();
|
|
@@ -104,7 +106,9 @@ function fakeConfig(overrides = {}) {
|
|
|
104
106
|
approvalPreApproved: [],
|
|
105
107
|
// Off so a test that is not about the allowlist sees every prompt it raises.
|
|
106
108
|
approvalDefaults: false,
|
|
109
|
+
effectAllowlist: [],
|
|
107
110
|
webReadBudget: 40,
|
|
111
|
+
plannerNativeShell: false,
|
|
108
112
|
setProviderModelLists: () => {
|
|
109
113
|
},
|
|
110
114
|
getProviderBaseUrl: () => "",
|
|
@@ -212,6 +216,14 @@ var FakeRunnerSession = class {
|
|
|
212
216
|
onToolCheckpoint(handler) {
|
|
213
217
|
this.checkpointHandler = handler;
|
|
214
218
|
}
|
|
219
|
+
scriptExitCbs = [];
|
|
220
|
+
onScriptExit(cb) {
|
|
221
|
+
this.scriptExitCbs.push(cb);
|
|
222
|
+
}
|
|
223
|
+
/** A script task's body ended, as `ScriptSession` hands it on (ADR-0035). */
|
|
224
|
+
reportScriptExit(exit) {
|
|
225
|
+
for (const cb of this.scriptExitCbs) cb(exit);
|
|
226
|
+
}
|
|
215
227
|
/** The runner calls `checkpoint`, as `StructuredSession` relays it; settles with the answer. */
|
|
216
228
|
callCheckpoint(question, signal = new AbortController().signal) {
|
|
217
229
|
if (!this.checkpointHandler) throw new Error("no checkpoint handler attached");
|
|
@@ -422,7 +434,7 @@ var FakeWorktreeIsolation = class {
|
|
|
422
434
|
tasks: {}
|
|
423
435
|
};
|
|
424
436
|
}
|
|
425
|
-
async prepare(task, run) {
|
|
437
|
+
async prepare(task, run, _intent, opts = {}) {
|
|
426
438
|
this.log({ op: "prepare", taskId: task.id });
|
|
427
439
|
const name = `${task.order}-${task.id}`;
|
|
428
440
|
const cwd = `/fake-worktrees/${run.id}/${name}`;
|
|
@@ -434,7 +446,8 @@ var FakeWorktreeIsolation = class {
|
|
|
434
446
|
branch,
|
|
435
447
|
workspace: cwd,
|
|
436
448
|
status: "active",
|
|
437
|
-
repos: Object.fromEntries(run.repos.map((r) => [r.path, { worktree: r.path === SELF_REPO ? cwd : `${cwd}/${r.path}`, linked: [] }]))
|
|
449
|
+
repos: Object.fromEntries(run.repos.map((r) => [r.path, { worktree: r.path === SELF_REPO ? cwd : `${cwd}/${r.path}`, linked: [] }])),
|
|
450
|
+
...opts.readOnly ? { readOnly: true } : {}
|
|
438
451
|
};
|
|
439
452
|
return { cwd, branch, copied: [...this.copied], ...this.setupFailed.length > 0 ? { setupFailed: [...this.setupFailed] } : {} };
|
|
440
453
|
}
|
|
@@ -457,10 +470,16 @@ var FakeWorktreeIsolation = class {
|
|
|
457
470
|
return this.repairEvidence.get(task.id) ?? { ok: true };
|
|
458
471
|
}
|
|
459
472
|
/** Like git: the landing is recorded and persisted before the (held) merge, and cleared once it settles. */
|
|
460
|
-
async integrate(task, run, persist = () => void 0) {
|
|
473
|
+
async integrate(task, run, persist = () => void 0, commit) {
|
|
461
474
|
this.log({ op: "integrate", taskId: task.id });
|
|
462
475
|
const record = run.tasks[task.id];
|
|
463
476
|
if (!record) return "failed";
|
|
477
|
+
if (commit) record.commit = commit;
|
|
478
|
+
if (record.readOnly) {
|
|
479
|
+
record.status = "failed";
|
|
480
|
+
record.landingError = "a read-only task lands nothing";
|
|
481
|
+
return "failed";
|
|
482
|
+
}
|
|
464
483
|
const changed = this.changes.get(task.id) ?? run.repos.map((r) => r.path);
|
|
465
484
|
for (const [repo, entry] of Object.entries(record.repos)) entry.changed = changed.includes(repo) || (entry.changed ?? false);
|
|
466
485
|
if (changed.length > 0) {
|
|
@@ -486,6 +505,10 @@ var FakeWorktreeIsolation = class {
|
|
|
486
505
|
async release(run, taskId, opts) {
|
|
487
506
|
this.log({ op: "release", taskId, keep: opts.keep });
|
|
488
507
|
const record = run.tasks[taskId];
|
|
508
|
+
if (record?.readOnly) {
|
|
509
|
+
delete run.tasks[taskId];
|
|
510
|
+
return noRemoval();
|
|
511
|
+
}
|
|
489
512
|
const removal = opts.keep || !record ? noRemoval() : this.removed();
|
|
490
513
|
const refused = removal.refused.some((r) => r.task?.taskId === taskId);
|
|
491
514
|
if (!opts.keep && !refused) delete run.tasks[taskId];
|