@selesai/code 0.8.0 → 0.8.2

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
@@ -2,6 +2,16 @@
2
2
 
3
3
  All notable changes to `@selesai/code` will be documented in this file.
4
4
 
5
+ ## [0.8.2] - 2026-08-11
6
+
7
+ ### Fixed
8
+ - **Guide version-marking no longer locks in the implicit mode.** When the recurring guide marks a new version as seen, Selesai no longer writes the fallback `compact` mode into `settings.json` as if it were a user choice. An explicit `full`, `compact`, or `off` mode is still preserved across version-only writes, so the guide keeps following the current default until you choose otherwise.
9
+
10
+ ## [0.8.1] - 2026-08-11
11
+
12
+ ### Fixed
13
+ - **Powerline guide defaults to compact mode.** When `selesaiGuide.mode` is not set, the recurring `/guide` tour now opens in compact mode instead of the full tour. An explicit `full`, `compact`, or `off` setting is still honored.
14
+
5
15
  ## [0.8.0] - 2026-08-11
6
16
 
7
17
  ### Added
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ### Fixed
6
+ - **Guide version-marking never persists an implicit mode** — `markGuideVersionSeen` (version-only writes) preserves an explicit user mode but never writes the fallback default as a user choice, so the guide keeps following the current default instead of locking in `compact`.
7
+ - **Guide defaults to compact mode** — When `selesaiGuide.mode` is unset, the recurring guide opens in compact mode instead of the full tour. Explicit `full`, `compact`, or `off` settings are still honored.
8
+
5
9
  ### Changed
6
10
  - **Upstream 0.12.3 merge (Selesai fork)** — Updated from upstream v0.5.4 to v0.12.3. Adopts the Powerline queue/inbox (`/idea`, `/ideas`, `/queue`, `/ideas next`, `/ideas issue`), compaction-aware queue delivery, `/cd` session directory switching, cost currency and subagent cost accounting, `powerline.separator`/`layout`/`placement`/`disabledSegments`/`welcome` options, git host icons, cached session token stats, strict TypeScript gate, and all upstream fixes through 0.12.3. Selesai-specific features are preserved: the fixed editor and chat scrolling, the guide overlay, the TPS tracker, session-usage accounting, and mode-aware autocomplete trigger forwarding.
7
11
 
@@ -149,7 +149,7 @@ export function getGuidePreferences(settings: unknown): GuidePreferences {
149
149
  : {};
150
150
 
151
151
  return {
152
- mode: isGuideMode(raw.mode) ? raw.mode : "full",
152
+ mode: isGuideMode(raw.mode) ? raw.mode : "compact",
153
153
  lastSeenVersion: typeof raw.lastSeenVersion === "string" ? raw.lastSeenVersion : undefined,
154
154
  };
155
155
  }
@@ -200,9 +200,17 @@ export function saveGuidePreferences(
200
200
  if (!settings) return false;
201
201
 
202
202
  const current = getGuidePreferences(settings);
203
- const next: Record<string, unknown> = {
204
- mode: update.mode ?? current.mode,
205
- };
203
+ const raw = isRecord(settings) && isRecord(settings.selesaiGuide)
204
+ ? settings.selesaiGuide
205
+ : {};
206
+ const next: Record<string, unknown> = {};
207
+ if (update.mode !== undefined) {
208
+ next.mode = update.mode;
209
+ } else if (typeof raw.mode === "string") {
210
+ // Version-only writes (markGuideVersionSeen) must preserve an explicit user
211
+ // mode but never persist the fallback default as a user choice.
212
+ next.mode = raw.mode;
213
+ }
206
214
  const lastSeenVersion = update.lastSeenVersion === null
207
215
  ? undefined
208
216
  : update.lastSeenVersion ?? current.lastSeenVersion;
@@ -10,6 +10,7 @@ import {
10
10
  getGuideFeatureLines,
11
11
  getGuidePreferences,
12
12
  getNewGuideFeatures,
13
+ markGuideVersionSeen,
13
14
  resolveGuideDisplayMode,
14
15
  saveGuidePreferences,
15
16
  type GuideFeature,
@@ -22,7 +23,7 @@ const features: GuideFeature[] = [
22
23
  ];
23
24
 
24
25
 
25
- test("guide opens fully for each real session start", () => {
26
+ test("explicit full guide opens for each real session start", () => {
26
27
  for (const reason of ["startup", "new", "resume", "fork"]) {
27
28
  assert.equal(resolveGuideDisplayMode({ reason, hasUI: true, guideMode: "full" }), "full");
28
29
  }
@@ -35,8 +36,10 @@ test("guide dismissal and compact preferences change automatic display", () => {
35
36
  assert.equal(resolveGuideDisplayMode({ reason: "startup", hasUI: false, guideMode: "full" }), "none");
36
37
  });
37
38
 
38
- test("quiet startup does not suppress the default blocking guide", () => {
39
- assert.equal(resolveGuideDisplayMode({ reason: "startup", hasUI: true, guideMode: "full" }), "full");
39
+ test("guide defaults to a compact header so fixed-editor mode stays active", () => {
40
+ const preferences = getGuidePreferences({});
41
+ assert.equal(preferences.mode, "compact");
42
+ assert.equal(resolveGuideDisplayMode({ reason: "startup", hasUI: true, guideMode: preferences.mode }), "compact");
40
43
  });
41
44
 
42
45
  test("full and compact guide content expose README commands and examples", () => {
@@ -97,9 +100,31 @@ test("guide dismissal persists only the mode and version marker", () => {
97
100
  }
98
101
  });
99
102
 
100
- test("invalid persisted guide settings fall back to the full guide", () => {
103
+ test("version marking never persists an implicit guide mode", () => {
104
+ const dir = mkdtempSync(join(tmpdir(), "selesai-guide-"));
105
+ const settingsPath = join(dir, "settings.json");
106
+
107
+ try {
108
+ // markGuideVersionSeen writes only the version marker; the mode stays
109
+ // unset so the default (compact) applies instead of being locked in.
110
+ assert.equal(markGuideVersionSeen("0.5.3", settingsPath), true);
111
+ const settings = JSON.parse(readFileSync(settingsPath, "utf8")) as Record<string, unknown>;
112
+ assert.deepEqual(settings.selesaiGuide, { lastSeenVersion: "0.5.3" });
113
+ assert.equal(getGuidePreferences(settings).mode, "compact");
114
+
115
+ // An explicitly chosen mode is preserved across version-only writes.
116
+ assert.equal(saveGuidePreferences({ mode: "off" }, settingsPath), true);
117
+ assert.equal(saveGuidePreferences({ lastSeenVersion: "0.6.0" }, settingsPath), true);
118
+ const after = JSON.parse(readFileSync(settingsPath, "utf8")) as Record<string, unknown>;
119
+ assert.deepEqual(after.selesaiGuide, { mode: "off", lastSeenVersion: "0.6.0" });
120
+ } finally {
121
+ rmSync(dir, { recursive: true, force: true });
122
+ }
123
+ });
124
+
125
+ test("invalid persisted guide settings fall back to the compact guide", () => {
101
126
  assert.deepEqual(getGuidePreferences({ selesaiGuide: { mode: "unexpected", lastSeenVersion: 42 } }), {
102
- mode: "full",
127
+ mode: "compact",
103
128
  lastSeenVersion: undefined,
104
129
  });
105
130
  });
@@ -20,7 +20,7 @@
20
20
  "@earendil-works/pi-agent-core": "0.81.0",
21
21
  "@earendil-works/pi-ai": "0.81.0",
22
22
  "@earendil-works/pi-tui": "0.81.0",
23
- "@selesai/code": "0.8.0",
23
+ "@selesai/code": "0.8.2",
24
24
  "@types/node": "24.13.3",
25
25
  "typescript": "5.9.3"
26
26
  },
@@ -47,7 +47,7 @@
47
47
  },
48
48
  "../../..": {
49
49
  "name": "@selesai/code",
50
- "version": "0.8.0",
50
+ "version": "0.8.2",
51
51
  "dev": true,
52
52
  "dependencies": {
53
53
  "@earendil-works/pi-agent-core": "0.83.0",
@@ -97,7 +97,7 @@
97
97
  "devDependencies": {
98
98
  "@earendil-works/pi-agent-core": "0.81.0",
99
99
  "@earendil-works/pi-ai": "0.81.0",
100
- "@selesai/code": "0.8.0",
100
+ "@selesai/code": "0.8.2",
101
101
  "@earendil-works/pi-tui": "0.81.0",
102
102
  "@types/node": "24.13.3",
103
103
  "typescript": "5.9.3"
@@ -26,7 +26,7 @@ const expectedHostPeerRanges = {
26
26
  const expectedHostDevVersions = {
27
27
  "@earendil-works/pi-agent-core": "0.81.0",
28
28
  "@earendil-works/pi-ai": "0.81.0",
29
- "@selesai/code": "0.8.0",
29
+ "@selesai/code": "0.8.2",
30
30
  "@earendil-works/pi-tui": "0.81.0",
31
31
  } satisfies Record<(typeof hostPeerPackages)[number], string>;
32
32
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@selesai/code",
3
- "version": "0.8.0",
3
+ "version": "0.8.2",
4
4
  "description": "Maintained, extension-first Pi coding agent with built-in workflows, subagents, web research, questions, skills, and an enhanced terminal UI.",
5
5
  "type": "module",
6
6
  "repository": {