ceulen 0.15.0 → 0.15.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/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.15.1 — 2026-10-08
4
+
5
+ pi 1.1.0 compatibility (audit found the API diff purely additive — SettingsManager,
6
+ ProviderConfig, jiti loader, composer/editor duck-typing, `defaultTools` semantics
7
+ and all root exports unchanged):
8
+
9
+ - **Peer deps widened** to `>=0.99.1 <1.2.0` for both `@earendil-works/pi-coding-agent`
10
+ and `@earendil-works/pi-tui` — the old range excluded 1.1.0 semver-wise. Dev lockfile
11
+ refreshed; typecheck + full suite now run against 1.1.0 types (2767 pass).
12
+ - **advisor**: the background review skips `agent_settled` events flagged `aborted`
13
+ (pi 1.1.0; user hit Escape) — no isolated review of a half-finished transcript.
14
+ Absent flag on older pi → unchanged behavior.
15
+ - **plan**: auto-approve never fires off an aborted settle; `planReadyForReview`
16
+ stays set, so the plan still approves/executes on the next clean settle.
17
+
3
18
  ## 0.15.0 — 2026-10-08
4
19
 
5
20
  Deferred-exposure pass + config kill-switch removal (net −660 lines):
@@ -176,8 +176,13 @@ export default function advisorModule(pi: ExtensionAPI): void {
176
176
  pi.on("session_compact", (_event, ctx) => resetForRewrite(ctx));
177
177
  pi.on("session_before_switch", (_event, ctx) => resetForRewrite(ctx));
178
178
 
179
- pi.on("agent_settled", async (_event, ctx) => {
179
+ pi.on("agent_settled", async (event, ctx) => {
180
180
  if (!runtime || !watchEnabled || runtime.stats.paused) return;
181
+ // pi 1.1.0 flags runs the user cancelled (Escape). A half-finished
182
+ // transcript is not worth an isolated review — and reviewing it would
183
+ // steer on work the user deliberately stopped. Absent on older pi →
184
+ // undefined → falsy → today's behavior.
185
+ if ((event as { aborted?: boolean }).aborted) return;
181
186
  // Only TUI: a floating review would die at process exit in headless
182
187
  // modes, and a note there fired an unrequested follow-up run. Fail-safe:
183
188
  // unknown/mode-less contexts skip too (missed review < surprise run).
@@ -93,9 +93,9 @@ function fakeCtx(entries: any[], sessionId = "test-session"): any {
93
93
  return ctx;
94
94
  }
95
95
 
96
- async function fire(_pi: any, state: any, channel: string, ctx: any): Promise<void> {
96
+ async function fire(_pi: any, state: any, channel: string, ctx: any, event: any = {}): Promise<void> {
97
97
  const handlers = state.eventHandlers.get(channel) ?? [];
98
- for (const h of handlers) await h({}, ctx);
98
+ for (const h of handlers) await h(event, ctx);
99
99
  // agent_settled schedules the review fire-and-forget (never blocks the
100
100
  // settle) — drain the event loop so a floating review settles before
101
101
  // assertions.
@@ -202,6 +202,22 @@ describe("advisor module wiring", () => {
202
202
  assert.equal(calls, 1, "review resumed after re-enabling");
203
203
  });
204
204
 
205
+ it("skips the review when the run settled aborted (pi 1.1.0 Escape flag)", async () => {
206
+ const { pi, state } = createFakePi();
207
+ advisorModule(pi);
208
+ writeSettings({ advisor: { models: [MODEL] } });
209
+ await fire(pi, state, "session_start", available(fakeCtx([])));
210
+ let calls = 0;
211
+ __setIsolatedForTest(async (_c, models) => { calls++; return { text: '{"severity":"nit","note":"live"}', model: models[0], usage: NO_USAGE }; });
212
+ const settled = step(available(fakeCtx(toolCalls(4))), "tui");
213
+ // User cancelled the run → no review of a half-finished transcript.
214
+ await fire(pi, state, "agent_settled", settled, { aborted: true });
215
+ assert.equal(calls, 0, "aborted settle does not burn a review");
216
+ // A clean settle (field absent — older pi passes nothing) still reviews.
217
+ await fire(pi, state, "agent_settled", settled);
218
+ assert.equal(calls, 1, "clean settle reviews as before");
219
+ });
220
+
205
221
  it("/advisor on re-syncs tool availability after the model becomes available again", async () => {
206
222
  const { pi, state } = createFakePi();
207
223
  advisorModule(pi);
@@ -889,8 +889,12 @@ export default function planModule(pi: ExtensionAPI): void {
889
889
 
890
890
  /** Plan written → prefill /plan-approve, or execute immediately under
891
891
  * auto-approve. */
892
- pi.on("agent_settled", async (_event, ctx) => {
892
+ pi.on("agent_settled", async (event, ctx) => {
893
893
  if (!planModeEnabled || !planReadyForReview) return;
894
+ // pi 1.1.0 flags runs the user cancelled (Escape): never approve off a
895
+ // settle they aborted. Leave planReadyForReview set — a later clean
896
+ // settle still picks the plan up.
897
+ if ((event as { aborted?: boolean }).aborted) return;
894
898
  planReadyForReview = false;
895
899
  persistState();
896
900
  if (settings.autoApprove && ctx.mode !== "print") {
@@ -200,6 +200,20 @@ describe("plan mode — prompt + approval flow", () => {
200
200
  assert.match(h.userMessages[0].content, /Execute the approved plan/);
201
201
  });
202
202
 
203
+ it("auto-approve never fires off an aborted settle; the plan still approves on a clean one", async () => {
204
+ setPlanSettings(agent.dir, { autoApprove: true });
205
+ const h = await start();
206
+ await h.commands.plan.handler("", h.ctx({ cwd: REPO }));
207
+ await h.tools.write_plan.execute("tc1", { title: "T", content: "body" }, undefined, undefined, h.ctx({ cwd: REPO }));
208
+ // User hit Escape after write_plan → no autonomous execution.
209
+ await h.fire("agent_settled", { aborted: true }, h.ctx({ cwd: REPO }));
210
+ assert.equal(h.userMessages.length, 0, "aborted settle does not execute");
211
+ // The plan stays pending: the next clean settle approves it.
212
+ await h.fire("agent_settled", {}, h.ctx({ cwd: REPO }));
213
+ assert.equal(h.userMessages.length, 1);
214
+ assert.match(h.userMessages[0].content, /Execute the approved plan/);
215
+ });
216
+
203
217
  it("/plan-approve without a plan warns", async () => {
204
218
  const h = await start();
205
219
  await h.commands["plan-approve"].handler("current", h.ctx({ cwd: REPO }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ceulen",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "description": "Ceulen — the Pi coding agent, fully dressed: one bundle extension carrying the full toolkit with a single /ceulen config command.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -52,8 +52,8 @@
52
52
  ]
53
53
  },
54
54
  "peerDependencies": {
55
- "@earendil-works/pi-coding-agent": ">=0.99.1 <1.1.0",
56
- "@earendil-works/pi-tui": ">=0.99.1 <1.1.0",
55
+ "@earendil-works/pi-coding-agent": ">=0.99.1 <1.2.0",
56
+ "@earendil-works/pi-tui": ">=0.99.1 <1.2.0",
57
57
  "typebox": "*"
58
58
  },
59
59
  "devDependencies": {