ceulen 0.10.0 → 0.10.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 +42 -0
- package/extensions/lib/skill-path.test.ts +35 -0
- package/extensions/lib/skill-path.ts +22 -0
- package/extensions/modules/a2a/index.ts +2 -2
- package/extensions/modules/a2a/lib/config.ts +1 -1
- package/extensions/modules/a2a/lib/registry.ts +1 -1
- package/extensions/modules/composer/index.ts +19 -1
- package/extensions/modules/composer/lib/footer.ts +7 -7
- package/extensions/modules/composer/lib/shapes.ts +237 -112
- package/extensions/modules/composer/test/editor.test.ts +3 -3
- package/extensions/modules/composer/test/footer.test.ts +1 -1
- package/extensions/modules/composer/test/module.test.ts +6 -5
- package/extensions/modules/composer/test/screen.test.ts +10 -9
- package/extensions/modules/composer/test/shapes.test.ts +83 -61
- package/extensions/modules/munin/index.ts +2 -2
- package/extensions/modules/ponytail/index.ts +2 -2
- package/extensions/modules/repair/lib/settings.ts +1 -1
- package/extensions/modules/router/lib/provider.ts +13 -9
- package/extensions/modules/subagent/lib/runner.ts +4 -2
- package/extensions/modules/ux/index.ts +2 -2
- package/extensions/modules/web/index.ts +2 -2
- package/extensions/modules/web/lib/chrome.ts +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
## 0.10.1 — 2026-10-07
|
|
6
|
+
|
|
7
|
+
- **Windows fix**: extension load crashed with `ENOENT ... lstat 'D:\C:'` —
|
|
8
|
+
the resources_discover skill path was built with `new URL(...).pathname`,
|
|
9
|
+
which on Windows yields `/C:/...` (leading slash before the drive letter);
|
|
10
|
+
realpathSync resolved it against the current drive. The bug existed in FIVE
|
|
11
|
+
modules (web, munin, a2a, ponytail, ux). One shared helper
|
|
12
|
+
`extensions/lib/skill-path.ts` (`fileURLToPath`) now serves all call sites,
|
|
13
|
+
with a regression test.
|
|
14
|
+
|
|
15
|
+
- **Security & robustness review** (12 files): three settings writers (a2a
|
|
16
|
+
`writeSettingsA2A`, repair settings, a2a session registry) now write
|
|
17
|
+
`mode: 0o600` like every sibling writer — the files carry API keys/tokens;
|
|
18
|
+
router `refreshModels` no longer throws on null entries in a hand-edited
|
|
19
|
+
models-store.json; web `--virtual-time-budget` clamped non-negative;
|
|
20
|
+
subagent worktree patch temp file gets a randomUUID name + exclusive
|
|
21
|
+
(`wx`) write (shared-/tmp symlink hardening; cleanup already existed).
|
|
22
|
+
|
|
23
|
+
- **composer**: status layer aligned with OMP's actual rendering (source-level
|
|
24
|
+
study of `packages/tui/src/components/composer/*` + `status-line/component.ts`):
|
|
25
|
+
band/box embed OMP's POWERLINE row — bg-filled left group
|
|
26
|
+
`π > ⬢ model · level > 📁 dir > ⑂ git` (thin `>` separators, model icon,
|
|
27
|
+
dot-joined thinking level) over the context-reactive GAUGE (accent used-
|
|
28
|
+
portion, rounded `N%` label riding the used cells, `┃` at pi's compaction
|
|
29
|
+
threshold (window − 16384) when armed, window figure right-justified), with
|
|
30
|
+
the session-title chip on box (`─ omp ─╮`); the band starts FLUSH (OMP's
|
|
31
|
+
`sep.powerlineCapLeft` is empty outside the nerd set — no `╭─` cap). claude
|
|
32
|
+
and rule dock the title chip on the top rule and render the left group +
|
|
33
|
+
`◫ N%/window ⟲` context segment on a standalone BOTTOM status bar (after
|
|
34
|
+
the closing rule for claude, after a spacer row for rule) — pi/borderless/
|
|
35
|
+
field/rail render the full bar with the title right-justified. Context
|
|
36
|
+
segment steps at OMP's thresholds (>50 warning, >90 error) and carries the
|
|
37
|
+
`⟲` auto-compact icon; git indicators get OMP's per-indicator colors
|
|
38
|
+
(`*n` warn, `+n` success, `?n` dim; branch warns only when dirty); token
|
|
39
|
+
figures use OMP's formatNumber (`200K`, `1.0M`, trailing `.0` trimmed);
|
|
40
|
+
thinking level rides the model segment as `⬢ model · level` (was
|
|
41
|
+
`(provider) model (level)`). Session title sourced from
|
|
42
|
+
`sessionManager.getSessionName()`; line 1 (rate · token stats · quota
|
|
43
|
+
windows) unchanged.
|
|
44
|
+
|
|
3
45
|
## 0.10.0 — 2026-10-05
|
|
4
46
|
|
|
5
47
|
- **gh module**: new module — ONE read-only `github` tool over the `gh` CLI
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Windows regression: `new URL("../../../skills/", import.meta.url).pathname`
|
|
2
|
+
// yields "/C:/repo/skills/" — a leading slash before the drive letter — and
|
|
3
|
+
// fs.realpathSync then resolves it against the CURRENT drive, dying with
|
|
4
|
+
// `ENOENT ... lstat 'D:\C:'` at extension load. skillsRoot() must return a
|
|
5
|
+
// native path (fileURLToPath), i.e. never the drive-slash shape.
|
|
6
|
+
|
|
7
|
+
import { describe, it } from "node:test";
|
|
8
|
+
import assert from "node:assert/strict";
|
|
9
|
+
import { existsSync, realpathSync } from "node:fs";
|
|
10
|
+
import { isAbsolute, join } from "node:path";
|
|
11
|
+
|
|
12
|
+
import { skillsRoot } from "./skill-path.js";
|
|
13
|
+
|
|
14
|
+
describe("skillsRoot", () => {
|
|
15
|
+
it("resolves the in-package skills/ dir on disk", () => {
|
|
16
|
+
const root = skillsRoot();
|
|
17
|
+
assert.ok(existsSync(root), `skills root exists: ${root}`);
|
|
18
|
+
// realpathSync is the call that blew up on Windows — it must not throw.
|
|
19
|
+
assert.equal(typeof realpathSync(root), "string");
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it("never produces a drive-letter path with a leading slash", () => {
|
|
23
|
+
assert.doesNotMatch(skillsRoot(), /^\/[A-Za-z]:\//);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("joins to this package's own skill dirs", () => {
|
|
27
|
+
for (const name of ["web", "munin", "a2a", "ponytail", "ux-design"]) {
|
|
28
|
+
assert.ok(existsSync(join(skillsRoot(), name)), `skill dir exists: ${name}`);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it("is absolute (never resolved against cwd)", () => {
|
|
33
|
+
assert.ok(isAbsolute(skillsRoot()));
|
|
34
|
+
});
|
|
35
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Shared skills/ root resolution for every module's resources_discover handler.
|
|
2
|
+
//
|
|
3
|
+
// `new URL("../../../skills/", import.meta.url).pathname` is WRONG on Windows:
|
|
4
|
+
// the WHATWG URL pathname keeps the authority-style leading slash and percent
|
|
5
|
+
// encoding, so a file URL like file:///C:/repo/skills/ yields "/C:/repo/skills/".
|
|
6
|
+
// fs.realpathSync("/C:/...") then resolves against the CURRENT drive's root
|
|
7
|
+
// (e.g. D:\) and load dies with `ENOENT ... lstat 'D:\C:'`.
|
|
8
|
+
// fileURLToPath decodes and strips the leading slash on drive-letter paths,
|
|
9
|
+
// giving the native `C:\repo\skills\` shape.
|
|
10
|
+
|
|
11
|
+
import { fileURLToPath } from "node:url";
|
|
12
|
+
|
|
13
|
+
// This file sits at extensions/lib/, so the repo-root skills/ dir is TWO
|
|
14
|
+
// levels up (modules/<name>/index.ts callers need three — they import this
|
|
15
|
+
// helper instead of building the URL themselves).
|
|
16
|
+
//
|
|
17
|
+
// ponytail: assumes the standard in-repo layout (extensions/lib/ next to
|
|
18
|
+
// skills/). A future relocated build should set an explicit package-root
|
|
19
|
+
// constant here rather than deepen the relative walk.
|
|
20
|
+
export function skillsRoot(): string {
|
|
21
|
+
return fileURLToPath(new URL("../../skills/", import.meta.url));
|
|
22
|
+
}
|
|
@@ -41,6 +41,7 @@ import { Container, Text } from "@earendil-works/pi-tui";
|
|
|
41
41
|
// (configPanel.ts). ceulen deltas: ceulen-a2a-inbound customType/status key,
|
|
42
42
|
// per-tool kill-switch wrap, resources_discover skill, restart bridge export.
|
|
43
43
|
import { readDisabledTools } from "../../lib/tools.js";
|
|
44
|
+
import { skillsRoot } from "../../lib/skill-path.js";
|
|
44
45
|
|
|
45
46
|
// ---------------------------------------------------------------------------
|
|
46
47
|
// Module state
|
|
@@ -546,8 +547,7 @@ export default function a2aExtension(pi: ExtensionAPI): void {
|
|
|
546
547
|
// resources_discover — NOT via the package.json pi.skills manifest — so the
|
|
547
548
|
// kill-switch gates it too (web module pattern).
|
|
548
549
|
pi.on("resources_discover", () => {
|
|
549
|
-
|
|
550
|
-
return { skillPaths: [join(realpathSync(skillsRoot), "a2a")] };
|
|
550
|
+
return { skillPaths: [join(realpathSync(skillsRoot()), "a2a")] };
|
|
551
551
|
});
|
|
552
552
|
|
|
553
553
|
pi.registerTool({
|
|
@@ -768,7 +768,7 @@ export function writeSettingsA2A(opts: {
|
|
|
768
768
|
|
|
769
769
|
// Atomic write: temp file + rename.
|
|
770
770
|
const tmp = target + ".tmp";
|
|
771
|
-
writeFileSync(tmp, JSON.stringify(json, null, 2) + "\n", "utf-8");
|
|
771
|
+
writeFileSync(tmp, JSON.stringify(json, null, 2) + "\n", { encoding: "utf-8", mode: 0o600 });
|
|
772
772
|
renameSync(tmp, target);
|
|
773
773
|
return target;
|
|
774
774
|
}
|
|
@@ -62,7 +62,7 @@ export function register(desc: SessionDescriptor, piDir: string): void {
|
|
|
62
62
|
try {
|
|
63
63
|
const p = fileFor(piDir, desc.pid);
|
|
64
64
|
mkdirSync(dir(piDir), { recursive: true });
|
|
65
|
-
writeFileSync(p, JSON.stringify(desc, null, 2), { encoding: "utf-8" });
|
|
65
|
+
writeFileSync(p, JSON.stringify(desc, null, 2), { encoding: "utf-8", mode: 0o600 });
|
|
66
66
|
} catch {
|
|
67
67
|
/* best-effort */
|
|
68
68
|
}
|
|
@@ -21,7 +21,6 @@ import { row, type PanelGroup, type PanelMenuOption } from "../../lib/panel.js";
|
|
|
21
21
|
import { getGenRate } from "../../lib/rate.js";
|
|
22
22
|
import { USAGE_STATUS_KEY, getUsageItem } from "../../lib/usage-store.js";
|
|
23
23
|
import { ComposerFooter, statsLine, sessionTotals } from "./lib/footer.ts";
|
|
24
|
-
import { formatCompact } from "./lib/shapes.ts";
|
|
25
24
|
import { execFile } from "node:child_process";
|
|
26
25
|
import { DEFAULT_SHAPE, IDENTITY_THEME, isShapeId, parseGitStats, previewShape, readGitBranch, ShapeEditor, shapeById, shapeTheme, SHAPES, type BandData, type GitStats, type ShapeTheme } from "./lib/shapes.ts";
|
|
27
26
|
import { readComposerShape, writeComposerSection } from "./lib/settings.ts";
|
|
@@ -57,6 +56,24 @@ function bandStats(ctx: ExtensionContext | undefined): string {
|
|
|
57
56
|
}
|
|
58
57
|
}
|
|
59
58
|
|
|
59
|
+
/** Session title (OMP's session_name segment — the right group / rule chip).
|
|
60
|
+
* Cached with the same keys as the stats scan. */
|
|
61
|
+
let nameCache: { sessionId: string; name: string } | undefined;
|
|
62
|
+
|
|
63
|
+
function bandSessionName(ctx: ExtensionContext | undefined): string {
|
|
64
|
+
if (!ctx) return "";
|
|
65
|
+
try {
|
|
66
|
+
const sm = ctx.sessionManager;
|
|
67
|
+
const sessionId = sm.getSessionId();
|
|
68
|
+
if (nameCache?.sessionId === sessionId) return nameCache.name;
|
|
69
|
+
const name = sm.getSessionName() ?? "";
|
|
70
|
+
nameCache = { sessionId, name };
|
|
71
|
+
return name;
|
|
72
|
+
} catch {
|
|
73
|
+
return "";
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
60
77
|
/** Extension `setStatus` items for the footer's last line — key-sorted like
|
|
61
78
|
* pi's own footer, minus the usage module's item (the band carries the quota
|
|
62
79
|
* windows; printing them twice is the duplication this footer exists to
|
|
@@ -170,6 +187,7 @@ function shapeData(ctx: ExtensionContext | undefined): BandData {
|
|
|
170
187
|
pct: usage?.percent ?? null,
|
|
171
188
|
window: usage?.contextWindow,
|
|
172
189
|
autoCompact: liveAutoCompact,
|
|
190
|
+
sessionName: bandSessionName(ctx),
|
|
173
191
|
rate: getGenRate().tps,
|
|
174
192
|
usage: getUsageItem().windows,
|
|
175
193
|
usageTone: getUsageItem().tone,
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
import { truncateToWidth, type Component } from "@earendil-works/pi-tui";
|
|
17
|
-
import {
|
|
17
|
+
import { formatNumberTokens, type ShapeTheme } from "./shapes.ts";
|
|
18
18
|
|
|
19
19
|
/** Usage fields the totals read (structural — pi's Usage satisfies it). */
|
|
20
20
|
interface UsageLike {
|
|
@@ -69,14 +69,14 @@ export function sessionTotals(entries: readonly EntryLike[]): SessionTotals {
|
|
|
69
69
|
return t;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
/** Band token stats for line 1 (`↑1.9M ↓377k R69M CH99.7%` —
|
|
73
|
-
* /usage-only; "" before any usage). */
|
|
72
|
+
/** Band token stats for line 1 (`↑1.9M ↓377k R69M CH99.7%` — OMP's
|
|
73
|
+
* formatNumber figures; cost stays /usage-only; "" before any usage). */
|
|
74
74
|
export function statsLine(t: SessionTotals): string {
|
|
75
75
|
const parts: string[] = [];
|
|
76
|
-
if (t.input) parts.push(`↑${
|
|
77
|
-
if (t.output) parts.push(`↓${
|
|
78
|
-
if (t.cacheRead) parts.push(`R${
|
|
79
|
-
if (t.cacheWrite) parts.push(`W${
|
|
76
|
+
if (t.input) parts.push(`↑${formatNumberTokens(t.input)}`);
|
|
77
|
+
if (t.output) parts.push(`↓${formatNumberTokens(t.output)}`);
|
|
78
|
+
if (t.cacheRead) parts.push(`R${formatNumberTokens(t.cacheRead)}`);
|
|
79
|
+
if (t.cacheWrite) parts.push(`W${formatNumberTokens(t.cacheWrite)}`);
|
|
80
80
|
if (t.cacheHitRate !== undefined) parts.push(`CH${t.cacheHitRate.toFixed(1)}%`);
|
|
81
81
|
return parts.join(" ");
|
|
82
82
|
}
|