gentle-pi 4.6.0 → 4.7.0
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/README.md +10 -11
- package/assets/agents/gentle-ai-explore.md +1 -0
- package/assets/agents/gentle-ai-verify.md +5 -2
- package/assets/agents/gentle-ai-worker.md +3 -0
- package/assets/agents/jd-fix-agent.md +1 -0
- package/assets/agents/jd-judge-a.md +1 -0
- package/assets/agents/jd-judge-b.md +1 -0
- package/assets/design-canvas/canvas.css +13 -1
- package/assets/design-canvas/canvas.js +11 -2
- package/assets/install-wizard/wizard.js +1 -0
- package/assets/migrations/agent-body-history.json +16 -1
- package/assets/orchestrator-delegation-reference.md +4 -4
- package/assets/orchestrator-delegation.md +1 -1
- package/assets/orchestrator-full-delegation-card.md +65 -0
- package/assets/orchestrator-full-delegation.md +34 -0
- package/assets/orchestrator-memory.md +3 -3
- package/assets/orchestrator-prompts.md +1 -1
- package/assets/orchestrator-skills.md +1 -1
- package/assets/orchestrator-verification.md +7 -5
- package/assets/orchestrator.md +3 -3
- package/bin/gentle-shell.mjs +164 -56
- package/docs/agent-status.md +61 -0
- package/docs/bundled-install.md +7 -5
- package/docs/delegated-verification.md +29 -7
- package/docs/gentle-agents-activity.md +14 -0
- package/docs/gentle-shell.md +54 -16
- package/docs/install-wizard.md +1 -1
- package/docs/permission-modes.md +9 -4
- package/docs/readme-reference.md +75 -30
- package/docs/render-cache-performance.md +11 -1
- package/docs/review-coordinator.md +33 -0
- package/docs/review-request-context.md +19 -0
- package/docs/review-windows-acl.md +18 -0
- package/docs/voice.md +6 -3
- package/docs/yolo-mode.md +5 -5
- package/extensions/ask-user-choice.ts +1 -0
- package/extensions/ask-user-question.ts +1 -0
- package/extensions/child-safety.ts +3 -0
- package/extensions/gentle-agent-status.ts +99 -0
- package/extensions/gentle-agents.ts +326 -34
- package/extensions/gentle-ai.ts +1496 -454
- package/extensions/gentle-shell.ts +293 -63
- package/extensions/gentle-todo.ts +18 -2
- package/extensions/gentle-tps.ts +48 -0
- package/extensions/quiet-tools.ts +38 -8
- package/extensions/skill-registry.ts +175 -18
- package/extensions/startup-banner.ts +30 -3
- package/lib/agent-profile-pin.ts +3 -3
- package/lib/agent-profiles.ts +160 -2
- package/lib/agent-status.ts +105 -0
- package/lib/agents-config.ts +46 -0
- package/lib/agents-history.ts +24 -5
- package/lib/agents-messaging.ts +47 -5
- package/lib/agents-runner.ts +183 -12
- package/lib/auto-permission-runtime.ts +1 -1
- package/lib/bounded-writer-admission.ts +13 -1
- package/lib/card-content-policy.ts +8 -6
- package/lib/command-palette.ts +133 -17
- package/lib/context-backstop.ts +14 -5
- package/lib/destructive-command-guard.ts +48 -4
- package/lib/execution-surface-guard.ts +20 -0
- package/lib/exploration-budget.ts +4 -2
- package/lib/gentle-ai-binary.ts +1 -1
- package/lib/gentle-design.ts +3 -0
- package/lib/gentle-shell-bundled.ts +6 -19
- package/lib/gentle-shell-launcher.ts +43 -8
- package/lib/herdr-activity.ts +14 -2
- package/lib/herdr-busy.ts +45 -0
- package/lib/image-attachments.ts +33 -0
- package/lib/image-disk-cache.ts +137 -0
- package/lib/inprocess-reviewer.ts +270 -140
- package/lib/jobs-view.ts +198 -11
- package/lib/model-routing-authority.ts +22 -4
- package/lib/native-choice-list.ts +20 -2
- package/lib/native-review-cli.ts +96 -19
- package/lib/orchestrator-mode-policy.ts +105 -0
- package/lib/questionnaire/questionnaire-view.ts +105 -12
- package/lib/rdd-mode-control.ts +32 -0
- package/lib/reply-language-anchor.ts +104 -0
- package/lib/review-blocker.ts +92 -0
- package/lib/review-candidate-symlink-scan.ts +136 -0
- package/lib/review-candidate-view-owner.ts +81 -44
- package/lib/review-continuation-registry.ts +99 -0
- package/lib/review-coordinator.ts +163 -0
- package/lib/review-failure-facts.ts +49 -0
- package/lib/review-host-relay.ts +46 -10
- package/lib/review-integration-v2.ts +7 -1
- package/lib/review-relay-phase-timing.ts +45 -0
- package/lib/review-start-context.ts +17 -0
- package/lib/session-profile-freeze.ts +4 -2
- package/lib/shell-bar.ts +140 -58
- package/lib/shell-changes.ts +2 -0
- package/lib/shell-panel.ts +17 -3
- package/lib/shell-sidebar-layout.ts +112 -40
- package/lib/shell-sidebar.ts +7 -0
- package/lib/shell-todo.ts +10 -3
- package/lib/verifier-admission.ts +1 -1
- package/lib/visual-customization-policy.ts +36 -16
- package/lib/visual-customize-view.ts +216 -21
- package/lib/visual-layout-preview.ts +9 -5
- package/lib/visual-profiles.ts +2 -2
- package/lib/windows-session-transport.ts +53 -2
- package/lib/yolo-session-policy.ts +40 -15
- package/package.json +2 -1
- package/runtime/gentle-ai-binary.mjs +1 -1
- package/runtime/gentle-shell-bundled.mjs +6 -19
- package/runtime/gentle-shell-launcher.mjs +42 -7
- package/runtime/native-review-cli.mjs +93 -16
- package/runtime/review-integration-v2.mjs +7 -1
- package/scripts/build-full-delegation-card.mjs +175 -0
- package/scripts/bundled-install.mjs +38 -8
- package/scripts/download-progress.mjs +68 -0
- package/scripts/gentle-ai-installer.mjs +41 -18
- package/scripts/gentle-ai-proxy.mjs +294 -0
- package/scripts/install-gentle-ai.mjs +14 -1
- package/scripts/installer-preflight.mjs +5 -5
- package/scripts/installer-runner.mjs +27 -12
- package/scripts/installer-server.mjs +8 -7
- package/scripts/render-cache-host.mjs +72 -0
- package/scripts/render-cache-performance-worker.mjs +5 -4
- package/scripts/render-cache-performance.mjs +6 -1
- package/scripts/run-test-suite.mjs +40 -28
- package/scripts/verify-package-files.mjs +12 -2
- package/scripts/voice-worker.cjs +32 -6
- package/skills/design/SKILL.md +11 -8
- package/skills/gentle-ai/SKILL.md +2 -2
- package/skills/gentle-ui-design/SKILL.md +46 -0
- package/skills/gentle-ui-design/references/adaptive-interfaces.md +46 -0
- package/skills/gentle-ui-design/references/browse-and-compare.md +62 -0
- package/skills/gentle-ui-design/references/composition-and-feedback.md +56 -0
- package/skills/gentle-ui-design/references/task-and-content.md +60 -0
- package/skills/skill-registry/SKILL.md +4 -2
- package/skills/work-unit-commits/SKILL.md +6 -7
- package/tests/agent-home.test.ts +28 -9
- package/tests/agent-profiles-workflow.test.ts +163 -0
- package/tests/agent-risk-escalation.test.ts +1 -1
- package/tests/agent-status.test.ts +143 -0
- package/tests/agents-config.test.ts +96 -0
- package/tests/agents-history.test.ts +31 -0
- package/tests/agents-jobs-frames.test.ts +93 -0
- package/tests/agents-prompt-lifecycle-runtime.test.ts +376 -0
- package/tests/agents-runner-drain.test.ts +193 -0
- package/tests/agents-runner.test.ts +178 -2
- package/tests/append-system-prompt-route.test.ts +4 -1
- package/tests/ask-user-choice.test.ts +4 -3
- package/tests/ask-user-question.test.ts +97 -0
- package/tests/auto-permission-runtime.test.ts +1 -1
- package/tests/autonomous-guard.test.ts +346 -10
- package/tests/bounded-stop-contract.test.ts +43 -3
- package/tests/bridge-cost.test.ts +19 -4
- package/tests/bundled-install.test.ts +30 -5
- package/tests/card-content-policy.test.ts +3 -3
- package/tests/chained-pr-skill.test.ts +8 -6
- package/tests/child-safety.test.ts +11 -0
- package/tests/codegraph-tools.test.ts +11 -5
- package/tests/command-palette.test.ts +284 -1
- package/tests/delegate-for-reason-contract.test.ts +3 -3
- package/tests/design-canvas-assets.test.ts +185 -2
- package/tests/destructive-command-guard.test.ts +52 -0
- package/tests/download-progress.test.ts +71 -0
- package/tests/execution-surface-guard.test.ts +55 -0
- package/tests/fixtures/primary-session-prompt/gentleman.golden.md +9 -5
- package/tests/fixtures/proxy-tls/proxy.crt +19 -0
- package/tests/fixtures/proxy-tls/proxy.key +28 -0
- package/tests/fixtures/session-profile-v1/gentle-ai-reviewer.ts +89 -0
- package/tests/fixtures/session-profile-v1/replay.ts +53 -6
- package/tests/full-delegation-closure.test.ts +131 -0
- package/tests/full-delegation-notices.test.ts +76 -0
- package/tests/generic-agent-tools.test.ts +3 -3
- package/tests/gentle-agent-status.test.ts +74 -0
- package/tests/gentle-agents-child-jobs.test.ts +237 -0
- package/tests/gentle-agents.test.ts +1070 -12
- package/tests/gentle-ai-binary.test.ts +3 -1
- package/tests/gentle-ai-elapsed-store.test.ts +19 -0
- package/tests/gentle-ai-exploration-budget.test.ts +18 -2
- package/tests/gentle-ai-installer.test.ts +134 -51
- package/tests/gentle-ai-proxy.test.ts +434 -0
- package/tests/gentle-ai.test.ts +113 -38
- package/tests/gentle-design.test.ts +21 -0
- package/tests/gentle-herdr-activity.test.ts +9 -6
- package/tests/gentle-shell-bin.test.ts +123 -0
- package/tests/gentle-shell-bundled.test.ts +207 -31
- package/tests/gentle-shell-launcher.test.ts +77 -10
- package/tests/gentle-shell.test.ts +899 -59
- package/tests/gentle-todo.test.ts +19 -2
- package/tests/gentle-tps.test.ts +123 -0
- package/tests/gentle-ui-design-skill.test.ts +59 -0
- package/tests/herdr-busy.test.ts +59 -0
- package/tests/herdr-task-summary-policy.test.ts +8 -4
- package/tests/image-disk-cache.test.ts +163 -0
- package/tests/independent-recovery-delivery.test.ts +83 -0
- package/tests/inprocess-reviewer.test.ts +176 -4
- package/tests/installer-posix-bootstrap.test.ts +1 -1
- package/tests/installer-preflight.test.ts +5 -4
- package/tests/installer-runner.test.ts +79 -44
- package/tests/installer-server.test.ts +14 -11
- package/tests/jobs-view.test.ts +260 -6
- package/tests/modal-mouse-boundaries.test.ts +136 -0
- package/tests/model-routing-authority.test.ts +178 -2
- package/tests/native-choice-list.test.ts +77 -2
- package/tests/native-review-capability-contract.test.ts +7 -1
- package/tests/native-review-cli.test.ts +269 -1
- package/tests/no-self-pause-contract.test.ts +4 -1
- package/tests/odd-routing-canonical-ratchet.test.ts +3 -3
- package/tests/orchestrator-budget.test.ts +7 -2
- package/tests/orchestrator-delegation-mode.test.ts +153 -0
- package/tests/orchestrator-mode-policy.test.ts +175 -0
- package/tests/orchestrator-prompt-budget.test.ts +3 -1
- package/tests/orchestrator-rdd-ownership.test.ts +2 -2
- package/tests/package-manifest.test.ts +11 -9
- package/tests/permission-allowlist.test.ts +202 -0
- package/tests/pi-update-launcher.test.ts +8 -0
- package/tests/pnpm-workspace-config.test.ts +58 -0
- package/tests/primary-session-prompt.test.ts +13 -0
- package/tests/profile-pin.test.ts +29 -2
- package/tests/profile-tier-footer.test.ts +5 -0
- package/tests/profiles-panel-delegation-mode.test.ts +422 -0
- package/tests/questionnaire-view.test.ts +115 -0
- package/tests/quiet-bash-runtime.test.ts +1 -1
- package/tests/quiet-tool-rendering.test.ts +48 -0
- package/tests/rdd-aware-verification-contract.test.ts +16 -11
- package/tests/rdd-customize.test.ts +287 -0
- package/tests/rdd-mode-cache.test.ts +450 -0
- package/tests/rdd-mode-control.test.ts +407 -0
- package/tests/rdd-mode-scope-regression.test.ts +137 -0
- package/tests/rdd-off-independent-regression.test.ts +69 -0
- package/tests/rdd-status-line.test.ts +18 -0
- package/tests/render-cache-performance.test.ts +171 -2
- package/tests/reply-language-anchor.test.ts +173 -0
- package/tests/review-agent-end-preflight.test.ts +1 -1
- package/tests/review-blocker.test.ts +193 -0
- package/tests/review-candidate-owner-retry.test.ts +1 -1
- package/tests/review-candidate-symlink-scan.test.ts +157 -0
- package/tests/review-candidate-view.test.ts +1 -1
- package/tests/review-candidate-windows-boundary.test.ts +131 -0
- package/tests/review-candidate-windows-probe.test.ts +63 -0
- package/tests/review-committed-restart-ack.test.ts +129 -0
- package/tests/review-continuation-registry.test.ts +76 -0
- package/tests/review-controller-native-routing.test.ts +261 -5
- package/tests/review-controller-workspace-root.test.ts +230 -3
- package/tests/review-controller.test.ts +96 -11
- package/tests/review-coordinator-runtime.test.ts +117 -0
- package/tests/review-coordinator.test.ts +195 -0
- package/tests/review-failure-facts.test.ts +87 -0
- package/tests/review-host-relay-routing.test.ts +258 -4
- package/tests/review-host-relay.test.ts +39 -0
- package/tests/review-integration-v2.test.ts +46 -3
- package/tests/review-json-arguments.test.ts +65 -10
- package/tests/review-last-event-closure.test.ts +68 -0
- package/tests/review-loadout-rdd-off-sdk.test.ts +65 -31
- package/tests/review-owner-identity.test.ts +60 -24
- package/tests/review-relay-phase-timing.test.ts +128 -0
- package/tests/review-relay-transport-agent.test.ts +12 -2
- package/tests/review-reviewer-evidence.test.ts +183 -0
- package/tests/review-risk-assessment.test.ts +74 -3
- package/tests/review-session-standing-permission-controller.test.ts +21 -1
- package/tests/review-start-context.test.ts +19 -0
- package/tests/review-tool-prose-budget.test.ts +121 -0
- package/tests/run-test-suite.test.ts +122 -1
- package/tests/runtime-harness.mjs +4 -1
- package/tests/sensitive-path-tools.test.ts +181 -5
- package/tests/session-profile-append-controller-pi.test.ts +60 -31
- package/tests/session-profile-binding.test.ts +19 -1
- package/tests/session-profile-disk-reader-pi.test.ts +58 -16
- package/tests/session-profile-v1-compat.test.ts +35 -1
- package/tests/shell-bar.test.ts +186 -42
- package/tests/shell-panel.test.ts +50 -22
- package/tests/shell-sidebar-fullscreen.test.ts +5 -5
- package/tests/shell-sidebar-layout.test.ts +294 -23
- package/tests/shell-sidebar-scroll-benchmark.test.ts +1 -1
- package/tests/shell-surface-transparent.test.ts +89 -0
- package/tests/shell-todo.test.ts +12 -0
- package/tests/skill-registry.test.ts +838 -5
- package/tests/startup-banner.test.ts +152 -1
- package/tests/startup-home-repo.test.ts +2 -0
- package/tests/support/review-coordinator-runtime.ts +69 -0
- package/tests/task-size-routing-contract.test.ts +5 -3
- package/tests/verifier-admission.test.ts +49 -0
- package/tests/verify-first-launch-contract.test.ts +78 -3
- package/tests/visual-customization-policy.test.ts +39 -6
- package/tests/visual-customize-view.test.ts +573 -9
- package/tests/visual-layout-preview.test.ts +15 -1
- package/tests/visual-profiles.test.ts +11 -0
- package/tests/voice-worker.test.ts +73 -2
- package/tests/windows-session-transport.test.ts +126 -0
- package/tests/work-continuity-contract.test.ts +28 -0
- package/tests/writer-feature-document-admission.test.ts +92 -0
- package/tests/yolo-customize.test.ts +27 -4
- package/tests/yolo-mode.test.ts +23 -18
- package/tests/yolo-session-policy.test.ts +270 -1
package/tests/shell-bar.test.ts
CHANGED
|
@@ -2,6 +2,7 @@ import assert from "node:assert/strict";
|
|
|
2
2
|
import test, { after, before, type TestContext } from "node:test";
|
|
3
3
|
import { visibleWidth } from "@earendil-works/pi-tui";
|
|
4
4
|
import { DEFAULT_VISUAL_SETTINGS } from "../lib/visual-customization-policy.ts";
|
|
5
|
+
import { collectSessionStats } from "../lib/shell-stats.ts";
|
|
5
6
|
import {
|
|
6
7
|
buildShellHeaderModel,
|
|
7
8
|
formatCost,
|
|
@@ -11,6 +12,9 @@ import {
|
|
|
11
12
|
renderShellBar,
|
|
12
13
|
renderShellBottomOnlyBar,
|
|
13
14
|
renderShellBelowInputFloat,
|
|
15
|
+
renderShellChromeBar,
|
|
16
|
+
renderShellStatusBar,
|
|
17
|
+
renderShellTitleRow,
|
|
14
18
|
renderShellHeaderBar,
|
|
15
19
|
renderShellHeaderChrome,
|
|
16
20
|
renderShellHeaderRule,
|
|
@@ -374,60 +378,55 @@ test("the rail Status orders Changes before Integrations and keeps the location
|
|
|
374
378
|
assert.match(empty, /INTEGRATIONS/);
|
|
375
379
|
});
|
|
376
380
|
|
|
377
|
-
test("
|
|
381
|
+
test("the agent profile opens Stats and never touches Integrations' rows, count or order", () => {
|
|
382
|
+
const stats = collectSessionStats([]);
|
|
378
383
|
const data = model({
|
|
379
384
|
profile: "alpha (session)",
|
|
380
385
|
permission: { mode: "AUTO", detail: "confirm before action" },
|
|
381
386
|
statuses: ["compact status"],
|
|
382
387
|
integrations: ["MCP connected", "Engram ready"],
|
|
388
|
+
stats,
|
|
383
389
|
});
|
|
384
390
|
const rows = () => renderShellSidebarBar(data, plainTheme, 60).map((line) => line.trimEnd());
|
|
391
|
+
const section = (lines: string[], title: string) => {
|
|
392
|
+
const at = lines.findIndex((line) => line.startsWith(`▾ ${title}`));
|
|
393
|
+
const end = lines.findIndex((line, index) => index > at && line.startsWith("▾ "));
|
|
394
|
+
return lines.slice(at, end < 0 ? undefined : end).filter((line) => line.trim() !== "");
|
|
395
|
+
};
|
|
385
396
|
const initial = rows();
|
|
386
|
-
|
|
387
|
-
assert.
|
|
388
|
-
assert.
|
|
389
|
-
" Agent profile: alpha (session)",
|
|
390
|
-
" - permissions confirm before action",
|
|
391
|
-
" - MCP connected",
|
|
392
|
-
" - Engram ready",
|
|
393
|
-
]);
|
|
397
|
+
assert.match(section(initial, "INTEGRATIONS")[0]!, /INTEGRATIONS\s+3$/);
|
|
398
|
+
assert.deepEqual(section(initial, "INTEGRATIONS").slice(1), [" - permissions confirm before action", " - MCP connected", " - Engram ready"]);
|
|
399
|
+
assert.equal(section(initial, "STATS")[1], " profile alpha (session)", "Stats opens with the profile");
|
|
394
400
|
data.profile = "beta (repo)";
|
|
395
|
-
|
|
396
|
-
assert.
|
|
397
|
-
assert.doesNotMatch(updated, /alpha \(session\)/);
|
|
398
|
-
|
|
401
|
+
assert.equal(section(rows(), "STATS")[1], " profile beta (repo)");
|
|
402
|
+
assert.doesNotMatch(rows().join("\n"), /alpha \(session\)/);
|
|
399
403
|
data.profile = undefined;
|
|
400
404
|
const absent = rows();
|
|
401
|
-
|
|
402
|
-
assert.match(absent[absentAt]!, /INTEGRATIONS\s+3$/);
|
|
403
|
-
assert.deepEqual(absent.slice(absentAt + 1), [" - permissions confirm before action", " - MCP connected", " - Engram ready"]);
|
|
405
|
+
assert.doesNotMatch(section(absent, "STATS").join("\n"), /profile/);
|
|
404
406
|
for (const profile of ["", " \t\n", "\x1b[31m\x1b[0m"]) {
|
|
405
407
|
data.profile = profile;
|
|
406
408
|
assert.deepEqual(rows(), absent, "an empty sanitized profile leaves prior output unchanged");
|
|
407
409
|
}
|
|
408
410
|
const onlyProfile = renderShellSidebarBar(model({ profile: "solo (local)" }), plainTheme, 60).map((line) => line.trimEnd());
|
|
409
|
-
|
|
410
|
-
assert.match(onlyProfile[onlyAt]!, /INTEGRATIONS\s+none$/);
|
|
411
|
-
assert.deepEqual(onlyProfile.slice(onlyAt + 1), [" Agent profile: solo (local)", " no status reported"]);
|
|
411
|
+
assert.deepEqual(section(onlyProfile, "INTEGRATIONS").slice(1), [" no status reported"], "Integrations never lists the profile");
|
|
412
412
|
});
|
|
413
413
|
|
|
414
|
-
test("
|
|
414
|
+
test("Stats clips and sanitizes a long agent profile on one row, leaving the compact bar unchanged", () => {
|
|
415
415
|
const profile = `team-${"x".repeat(59)}\x1b[31m\nops\t界unit\x07\x1b[0m (repo)`;
|
|
416
416
|
const base = model();
|
|
417
|
-
const active = model({ profile });
|
|
417
|
+
const active = model({ profile, stats: collectSessionStats([]) });
|
|
418
418
|
const settings = { ...DEFAULT_VISUAL_SETTINGS, visibility: { ...DEFAULT_VISUAL_SETTINGS.visibility, changes: false } };
|
|
419
419
|
for (const width of [16, 24, 46]) {
|
|
420
420
|
const lines = renderShellSidebarBar(active, plainTheme, width, settings);
|
|
421
421
|
assert.ok(lines.every((line) => visibleWidth(line) <= width));
|
|
422
422
|
assert.ok(lines.every((line) => !/[\x00-\x1f\x7f-\x9f]/.test(line)), "profile controls must not reach the terminal");
|
|
423
|
-
const
|
|
424
|
-
assert.
|
|
423
|
+
const row = lines.find((line) => line.includes("profile"))!;
|
|
424
|
+
assert.match(row, /profile team-x*…/, "the profile clips with an ellipsis on its one row");
|
|
425
425
|
}
|
|
426
426
|
const ansiTheme = { ...plainTheme, fg: (role: string, value: string) => `\x1b[${role === "muted" ? 90 : 37}m${value}\x1b[0m` };
|
|
427
427
|
const colored = renderShellSidebarBar(active, ansiTheme, 24, settings);
|
|
428
428
|
assert.ok(colored.every((line) => visibleWidth(line) <= 24));
|
|
429
|
-
assert.match(colored.join(""), /\x1b\[
|
|
430
|
-
assert.ok(colored.slice(1).map(stripAnsi).join("").replace(/\s/g, "").includes(`Agentprofile:team-${"x".repeat(59)}ops界unit(repo)`));
|
|
429
|
+
assert.match(colored.join(""), /\x1b\[90mprofile\x1b\[0m/, "the label is muted like the other Stats labels");
|
|
431
430
|
assert.deepEqual(renderShellBar(active, plainTheme, 120), renderShellBar(base, plainTheme, 120));
|
|
432
431
|
});
|
|
433
432
|
|
|
@@ -560,7 +559,9 @@ test("header retains effort without location when it fits beside full usage wind
|
|
|
560
559
|
const header = buildShellHeaderModel(model({ cwd: "~/work/" + "x".repeat(80), profile: "current", usage: USAGE_TWO_WINDOWS }));
|
|
561
560
|
for (const density of ["minimal", "compact", "comfortable"] as const) {
|
|
562
561
|
const settings = { ...DEFAULT_VISUAL_SETTINGS, density };
|
|
563
|
-
const right =
|
|
562
|
+
const right = density === "minimal"
|
|
563
|
+
? "ctx 45% ⟡ $9.49 sub ⟡ usage 5h 26% · week 12%"
|
|
564
|
+
: "ctx ▰▰▰▰▱▱▱▱ 45% ⟡ $9.49 sub ⟡ usage 5h ▰▰▱▱▱▱▱▱ 26% · week ▰▱▱▱▱▱▱▱ 12% · alt+u";
|
|
564
565
|
const left = density === "minimal" ? "gpt-5.5 · medium" : "✿ Gentle Shell ⟡ gpt-5.5 · medium";
|
|
565
566
|
const width = visibleWidth(left) + 2 + visibleWidth(right);
|
|
566
567
|
const result = renderShellHeaderBar(header, plainTheme, width, "alt+u", settings);
|
|
@@ -581,6 +582,133 @@ test("header retains effort without location when it fits beside full usage wind
|
|
|
581
582
|
}
|
|
582
583
|
});
|
|
583
584
|
|
|
585
|
+
test("single top and below-input chrome includes the project identity without duplicating split", () => {
|
|
586
|
+
const cwd = "~/work/gentle-pi/.worktrees/庫-shell-ui-feedback";
|
|
587
|
+
const data = model({ cwd, branch: "feature/main", dirty: 3, permission: { mode: "SUPER-YOLO" }, profile: "current", profileTier: "fast", usage: USAGE_TWO_WINDOWS, jobs: [{ id: "one", label: "job", startedAt: 1 }] });
|
|
588
|
+
for (const headerPlacement of ["top", "below-input"] as const) for (const density of ["comfortable", "compact", "minimal"] as const) {
|
|
589
|
+
const settings = { ...DEFAULT_VISUAL_SETTINGS, headerPlacement, density };
|
|
590
|
+
const chrome = renderShellChromeBar(data, plainTheme, 240, "alt+u", settings, undefined, { jobs: true });
|
|
591
|
+
const row = chrome.rows[chrome.headerRow]!;
|
|
592
|
+
assert.match(row, /✿ 庫-shell-ui-feedback ~\/work\/gentle-pi\/\.worktrees\/庫-shell-ui-feedback/, `${headerPlacement}/${density}: folder and abbreviated path`);
|
|
593
|
+
assert.match(row, /feature\/main ±3/);
|
|
594
|
+
assert.match(row, /💥 SUPER-YOLO/);
|
|
595
|
+
assert.match(row, /⧗ 1 job/);
|
|
596
|
+
assert.match(row, /gpt-5\.5 · medium · Fast · current/);
|
|
597
|
+
assert.match(row, /45%/);
|
|
598
|
+
assert.match(row, /\$9\.49 sub/);
|
|
599
|
+
assert.match(row, /usage.*5h.*26%.*week.*12%/);
|
|
600
|
+
if (density === "minimal") assert.doesNotMatch(row, /[▰▱]|alt\+u/);
|
|
601
|
+
else assert.match(row, /[▰▱].*alt\+u/);
|
|
602
|
+
assert.equal(visibleWidth(row), 240);
|
|
603
|
+
const start = visibleWidth(row.slice(0, row.indexOf("usage")));
|
|
604
|
+
assert.deepEqual(chrome.usageSpan, { start, end: 239 }, `${headerPlacement}/${density}: wide glyphs do not shift the target`);
|
|
605
|
+
assert.equal(shellHeaderUsageHit(chrome, start, chrome.headerRow), true);
|
|
606
|
+
assert.equal(shellHeaderUsageHit(chrome, start - 1, chrome.headerRow), false);
|
|
607
|
+
assert.equal(shellHeaderUsageHit(chrome, 239, chrome.headerRow), false);
|
|
608
|
+
if (density === "comfortable") assert.equal(shellHeaderUsageHit(chrome, start, 0), false);
|
|
609
|
+
}
|
|
610
|
+
const split = { ...DEFAULT_VISUAL_SETTINGS, headerPlacement: "split" as const };
|
|
611
|
+
const title = renderShellTitleRow(data, plainTheme, 240);
|
|
612
|
+
const bar = renderShellChromeBar(data, plainTheme, 240, "alt+u", split, undefined).rows.join("\n");
|
|
613
|
+
assert.match(title, /✿ 庫-shell-ui-feedback ~\/work\/gentle-pi\/\.worktrees\/庫-shell-ui-feedback/);
|
|
614
|
+
assert.doesNotMatch(bar, /庫-shell-ui-feedback|~\/work/);
|
|
615
|
+
assert.match(bar, /gpt-5\.5 · medium · Fast · current/);
|
|
616
|
+
});
|
|
617
|
+
|
|
618
|
+
test("project identity yields before live values, and folder text is terminal-safe", () => {
|
|
619
|
+
const data = model({ cwd: "~/work/\x1b[31mproject\x1b[0m\nname", branch: "feature/" + "long-".repeat(20), dirty: 3, permission: { mode: "YOLO" }, profileTier: "fast", usage: USAGE_TWO_WINDOWS });
|
|
620
|
+
const settings = { ...DEFAULT_VISUAL_SETTINGS, headerPlacement: "top" as const, density: "minimal" as const };
|
|
621
|
+
const wide = renderShellChromeBar(data, plainTheme, 300, "alt+u", settings, undefined);
|
|
622
|
+
assert.match(wide.rows[0]!, /✿ project name ~\/work\/project name/);
|
|
623
|
+
assert.doesNotMatch(wide.rows[0]!, /\x1b|\n/);
|
|
624
|
+
const narrow = renderShellChromeBar(data, plainTheme, 105, "alt+u", settings, undefined);
|
|
625
|
+
const row = narrow.rows[0]!;
|
|
626
|
+
assert.doesNotMatch(row, /~\/work/);
|
|
627
|
+
assert.match(row, /feature\/.*… ±3/);
|
|
628
|
+
assert.match(row, /🔥 YOLO/);
|
|
629
|
+
assert.match(row, /gpt-5\.5 · medium · Fast/);
|
|
630
|
+
assert.match(row, /ctx 45%/);
|
|
631
|
+
assert.match(row, /\$9\.49 sub/);
|
|
632
|
+
assert.equal(visibleWidth(row), 105);
|
|
633
|
+
});
|
|
634
|
+
|
|
635
|
+
test("project path then name yield without displacing existing live values at any width", () => {
|
|
636
|
+
const data = model({ cwd: "~/work/gentle-pi/.worktrees/folder", branch: "feature/main", dirty: 3, permission: { mode: "YOLO" }, profile: "current", profileTier: "fast", usage: USAGE_TWO_WINDOWS });
|
|
637
|
+
for (const headerPlacement of ["top", "below-input"] as const) for (const density of ["comfortable", "compact", "minimal"] as const) {
|
|
638
|
+
let full = false, nameOnly = false, noIdentity = false;
|
|
639
|
+
for (let width = 1; width <= 240; width++) {
|
|
640
|
+
const settings = { ...DEFAULT_VISUAL_SETTINGS, headerPlacement, density };
|
|
641
|
+
const chrome = renderShellChromeBar(data, plainTheme, width, "alt+u", settings, undefined);
|
|
642
|
+
const row = chrome.rows[chrome.headerRow]!;
|
|
643
|
+
const prior = renderShellChromeBar(data, plainTheme, width, "alt+u", { ...settings, headerPlacement: "split" }, undefined).rows[chrome.headerRow]!;
|
|
644
|
+
assert.equal(visibleWidth(row), width, `${headerPlacement}/${density}/${width}`);
|
|
645
|
+
for (const value of ["feature/main", "±3", "🔥 YOLO", "gpt-5.5", "medium", "Fast", "current", "45%", "$9.49 sub", "usage", "26%", "12%"]) {
|
|
646
|
+
if (prior.includes(value)) assert.ok(row.includes(value), `${headerPlacement}/${density}/${width}: identity must not displace ${value}`);
|
|
647
|
+
}
|
|
648
|
+
if (row.includes("✿ folder ~/work/gentle-pi/.worktrees/folder")) full = true;
|
|
649
|
+
else if (row.includes("✿ folder")) nameOnly = true;
|
|
650
|
+
else noIdentity = true;
|
|
651
|
+
}
|
|
652
|
+
assert.ok(full && nameOnly && noIdentity, `${headerPlacement}/${density}: full → name → absent as the available space falls`);
|
|
653
|
+
}
|
|
654
|
+
const mobile = { ...DEFAULT_VISUAL_SETTINGS, headerPlacement: "top" as const };
|
|
655
|
+
const title = renderShellTitleRow(data, plainTheme, 120, { model: true });
|
|
656
|
+
const bottom = renderShellStatusBar(data, plainTheme, 120, "alt+u", mobile, undefined, { jobs: true }).rows[0]!;
|
|
657
|
+
assert.match(title, /✿ folder ~\/work\/gentle-pi\/\.worktrees\/folder/);
|
|
658
|
+
assert.doesNotMatch(bottom, /folder|~\/work/, "the narrow mobile title already owns the identity");
|
|
659
|
+
});
|
|
660
|
+
|
|
661
|
+
test("project identity respects model and usage visibility", () => {
|
|
662
|
+
const data = model({ cwd: "~/work/project", profileTier: "fast", usage: USAGE_TWO_WINDOWS });
|
|
663
|
+
for (const headerPlacement of ["top", "below-input"] as const) {
|
|
664
|
+
const hiddenModel = { ...DEFAULT_VISUAL_SETTINGS, headerPlacement, visibility: { ...DEFAULT_VISUAL_SETTINGS.visibility, modelDetails: false } };
|
|
665
|
+
const row = renderShellChromeBar(data, plainTheme, 160, "alt+u", hiddenModel, undefined).rows[1]!;
|
|
666
|
+
assert.match(row, /✿ project ~\/work\/project/);
|
|
667
|
+
assert.doesNotMatch(row, /gpt-5\.5|medium|Fast/);
|
|
668
|
+
assert.match(row, /ctx.*45%.*\$9\.49 sub.*usage/);
|
|
669
|
+
const hiddenUsage = { ...hiddenModel, visibility: { ...hiddenModel.visibility, modelDetails: true, usageCost: false } };
|
|
670
|
+
const chrome = renderShellChromeBar(data, plainTheme, 160, "alt+u", hiddenUsage, undefined);
|
|
671
|
+
assert.match(chrome.rows[chrome.headerRow]!, /✿ project ~\/work\/project.*gpt-5\.5 · medium · Fast/);
|
|
672
|
+
assert.doesNotMatch(chrome.rows[chrome.headerRow]!, /ctx|\$9\.49|usage|alt\+u/);
|
|
673
|
+
assert.equal(chrome.usageSpan, undefined);
|
|
674
|
+
}
|
|
675
|
+
});
|
|
676
|
+
|
|
677
|
+
test("below-input float and narrow fallback keep the same folder and path identity", (t) => {
|
|
678
|
+
const settings = { ...DEFAULT_VISUAL_SETTINGS, headerPlacement: "below-input" as const };
|
|
679
|
+
const data = model({ cwd: "~/work/gentle-pi/.worktrees/shell-ui-feedback", usage: USAGE_TWO_WINDOWS });
|
|
680
|
+
useCardStyle(t, CARD_STYLE.FLOAT);
|
|
681
|
+
const chrome = renderShellBelowInputFloat(data, withBackground(plainTheme), 240, "alt+u", settings);
|
|
682
|
+
assert.ok(chrome);
|
|
683
|
+
const row = stripAnsi(chrome.rows[chrome.headerRow]!);
|
|
684
|
+
assert.match(row, /✿ shell-ui-feedback ~\/work\/gentle-pi\/\.worktrees\/shell-ui-feedback/);
|
|
685
|
+
assert.match(row, /main/);
|
|
686
|
+
assert.match(row, /gpt-5\.5 · medium/);
|
|
687
|
+
assert.ok(chrome.usageSpan);
|
|
688
|
+
assert.match(row.slice(chrome.usageSpan.start, chrome.usageSpan.end), /^usage/);
|
|
689
|
+
assert.equal(shellHeaderUsageHit(chrome, chrome.usageSpan.start, chrome.headerRow), true);
|
|
690
|
+
assert.equal(shellHeaderUsageHit(chrome, chrome.usageSpan.start, chrome.headerRow - 1), false);
|
|
691
|
+
const neon = renderShellBottomOnlyBar(data, plainTheme, 240, "alt+u", settings);
|
|
692
|
+
assert.equal(neon.length, 1);
|
|
693
|
+
assert.match(neon[0]!, /✿ shell-ui-feedback ~\/work\/gentle-pi\/\.worktrees\/shell-ui-feedback/);
|
|
694
|
+
assert.match(neon[0]!, /main.*gpt-5\.5 · medium/);
|
|
695
|
+
});
|
|
696
|
+
|
|
697
|
+
test("long branches shorten before model, counters, badges and usage give way", () => {
|
|
698
|
+
const data = model({ branch: "feature/" + "long-".repeat(25), dirty: 3, permission: { mode: "SUPER-YOLO" }, profile: "current", profileTier: "fast", usage: USAGE_TWO_WINDOWS, jobs: [{ id: "one", label: "job", startedAt: 1 }] });
|
|
699
|
+
const settings = { ...DEFAULT_VISUAL_SETTINGS, headerPlacement: "split" as const, density: "minimal" as const };
|
|
700
|
+
const chrome = renderShellChromeBar(data, plainTheme, 150, "alt+u", settings, undefined, { jobs: true });
|
|
701
|
+
const row = chrome.rows[chrome.headerRow]!;
|
|
702
|
+
assert.match(row, /feature\/.*… ±3/);
|
|
703
|
+
assert.match(row, /💥 SUPER-YOLO.*⧗ 1 job/);
|
|
704
|
+
assert.match(row, /gpt-5\.5 · medium · Fast · current/);
|
|
705
|
+
assert.match(row, /ctx 45%.*\$9\.49 sub.*usage 5h 26% · week 12%/);
|
|
706
|
+
assert.doesNotMatch(row, /[▰▱]|alt\+u/);
|
|
707
|
+
assert.equal(visibleWidth(row), 150);
|
|
708
|
+
assert.ok(chrome.usageSpan);
|
|
709
|
+
assert.equal(shellHeaderUsageHit(chrome, chrome.usageSpan.start, chrome.headerRow), true);
|
|
710
|
+
});
|
|
711
|
+
|
|
584
712
|
test("renderShellHeaderBar shows 'usage · <shortcut>' with no data, and drops the hint when the shortcut is disabled", () => {
|
|
585
713
|
const withHint = renderShellHeaderBar(buildShellHeaderModel(model({ usage: undefined })), plainTheme, 140, "alt+u");
|
|
586
714
|
assert.match(withHint.text, /usage · alt\+u$/);
|
|
@@ -810,9 +938,10 @@ test("below-input float chrome mirrors only the edge and moves usage clicks to r
|
|
|
810
938
|
for (const width of [10, 40, 90, 100, 140, 140.9]) {
|
|
811
939
|
const above = renderShellHeaderChrome(header, theme, width, "alt+u");
|
|
812
940
|
const below = renderShellHeaderChrome(header, theme, width, "alt+u", presentation);
|
|
813
|
-
|
|
941
|
+
const belowBar = renderShellHeaderBar(header, theme, width, "alt+u", presentation);
|
|
942
|
+
assert.deepEqual(below.rows, ["▁".repeat(Math.floor(width)), above.rows[0], belowBar.text, above.rows[2]], "the edge and padding stay unchanged around the below-input identity");
|
|
814
943
|
assert.equal(below.headerRow, 2);
|
|
815
|
-
assert.deepEqual(below.usageSpan,
|
|
944
|
+
assert.deepEqual(below.usageSpan, belowBar.usageSpan);
|
|
816
945
|
if (!below.usageSpan) {
|
|
817
946
|
assert.equal(shellHeaderUsageHit(below, 0, 2), false);
|
|
818
947
|
continue;
|
|
@@ -826,17 +955,18 @@ test("below-input float chrome mirrors only the edge and moves usage clicks to r
|
|
|
826
955
|
}
|
|
827
956
|
});
|
|
828
957
|
|
|
829
|
-
test("below-input placement preserves neon and float fallback
|
|
958
|
+
test("below-input placement preserves neon and float fallback geometry with its project identity", (t) => {
|
|
830
959
|
const header = buildShellHeaderModel(model());
|
|
831
960
|
const presentation = { ...DEFAULT_VISUAL_SETTINGS, headerPlacement: "below-input" as const };
|
|
832
961
|
useCardStyle(t, CARD_STYLE.NEON);
|
|
833
962
|
for (const width of [0, 9, 10, 100, 140]) {
|
|
834
963
|
const theme = withBackground(plainTheme);
|
|
835
|
-
const neon = renderShellHeaderChrome(header, theme, width, "alt+u");
|
|
964
|
+
const neon = renderShellHeaderChrome(header, theme, width, "alt+u", presentation);
|
|
836
965
|
const data = model({ statuses: ["mcp ok"] });
|
|
837
|
-
const bottom = renderShellBottomOnlyBar(data, theme, width, "alt+u");
|
|
838
|
-
assert.deepEqual(
|
|
839
|
-
assert.
|
|
966
|
+
const bottom = renderShellBottomOnlyBar(data, theme, width, "alt+u", presentation);
|
|
967
|
+
assert.deepEqual(neon.rows, [renderShellHeaderBar(header, theme, width, "alt+u", presentation).text, renderShellHeaderRule(theme, width)]);
|
|
968
|
+
assert.equal(neon.headerRow, 0);
|
|
969
|
+
assert.deepEqual(bottom, [neon.rows[0]]);
|
|
840
970
|
setCardStyle(CARD_STYLE.FLOAT);
|
|
841
971
|
assert.deepEqual(renderShellHeaderChrome(header, plainTheme, width, "alt+u", presentation), neon);
|
|
842
972
|
assert.deepEqual(renderShellBottomOnlyBar(data, plainTheme, width, "alt+u", presentation), bottom);
|
|
@@ -848,7 +978,7 @@ test("below-input placement preserves neon and float fallback bytes", (t) => {
|
|
|
848
978
|
}
|
|
849
979
|
});
|
|
850
980
|
|
|
851
|
-
test("below-input bottom-only float bar retains mirrored padding and extension statuses", (t) => {
|
|
981
|
+
test("below-input bottom-only float bar retains mirrored padding and leaves extension statuses to the rail", (t) => {
|
|
852
982
|
useCardStyle(t, CARD_STYLE.FLOAT);
|
|
853
983
|
const theme = withBackground(plainTheme);
|
|
854
984
|
const presentation = { ...DEFAULT_VISUAL_SETTINGS, headerPlacement: "below-input" as const };
|
|
@@ -858,18 +988,15 @@ test("below-input bottom-only float bar retains mirrored padding and extension s
|
|
|
858
988
|
const rows = renderShellBottomOnlyBar(data, theme, width, "alt+u", presentation);
|
|
859
989
|
const chrome = renderShellHeaderChrome(buildShellHeaderModel(data), theme, width, "alt+u", presentation);
|
|
860
990
|
assert.deepEqual(rows.slice(0, 3), chrome.rows.slice(0, 3));
|
|
861
|
-
assert.equal(rows.length,
|
|
991
|
+
assert.equal(rows.length, 4, "integrations live only in the rail, so no statuses row");
|
|
862
992
|
assert.equal(rows.at(-1), chrome.rows.at(-1), "padding closes the entire group");
|
|
863
|
-
|
|
864
|
-
assert.match(stripAnsi(rows[3]!), width === 10 ? /^ mcp o…/ : /^ mcp ok/);
|
|
865
|
-
assert.ok(rows[3]!.startsWith(BG_OPEN), "statuses share the full-width background");
|
|
866
|
-
}
|
|
993
|
+
assert.doesNotMatch(rows.map(stripAnsi).join("\n"), /mcp ok|notice/);
|
|
867
994
|
assert.ok(rows.every((row) => visibleWidth(row) <= width));
|
|
868
995
|
}
|
|
869
996
|
}
|
|
870
997
|
});
|
|
871
998
|
|
|
872
|
-
test("unified below-input float includes optional Changes and
|
|
999
|
+
test("unified below-input float includes optional Changes inside one painted group and leaves statuses to the rail", (t) => {
|
|
873
1000
|
useCardStyle(t, CARD_STYLE.FLOAT);
|
|
874
1001
|
const theme = withBackground({ ...plainTheme, fg: (_role: string, text: string) => `\x1b[31m${text}\x1b[0m` });
|
|
875
1002
|
const presentation = { ...DEFAULT_VISUAL_SETTINGS, headerPlacement: "below-input" as const };
|
|
@@ -880,7 +1007,7 @@ test("unified below-input float includes optional Changes and sanitized statuses
|
|
|
880
1007
|
const chrome = renderShellBelowInputFloat(model({ statuses }), theme, width, "alt+u", presentation, captured)!;
|
|
881
1008
|
const hasChanges = Boolean(captured?.files.length);
|
|
882
1009
|
assert.equal(chrome.headerRow, hasChanges ? 3 : 2);
|
|
883
|
-
assert.equal(chrome.rows.length, 4 + Number(hasChanges)
|
|
1010
|
+
assert.equal(chrome.rows.length, 4 + Number(hasChanges), "integrations live only in the rail");
|
|
884
1011
|
assert.equal(stripAnsi(chrome.rows[0]!), "▁".repeat(width));
|
|
885
1012
|
for (const row of chrome.rows.slice(1)) {
|
|
886
1013
|
let painted = false;
|
|
@@ -892,7 +1019,7 @@ test("unified below-input float includes optional Changes and sanitized statuses
|
|
|
892
1019
|
assert.equal(visibleWidth(row), width);
|
|
893
1020
|
}
|
|
894
1021
|
if (width === 240 && hasChanges) assert.match(stripAnsi(chrome.rows[2]!), /^ .*lib\/live.ts/);
|
|
895
|
-
|
|
1022
|
+
assert.doesNotMatch(chrome.rows.map(stripAnsi).join("\n"), /MCP ready|notice/);
|
|
896
1023
|
if (chrome.usageSpan) {
|
|
897
1024
|
assert.equal(shellHeaderUsageHit(chrome, chrome.usageSpan.start, chrome.headerRow), true);
|
|
898
1025
|
for (let y = 0; y < chrome.rows.length; y++) if (y !== chrome.headerRow) assert.equal(shellHeaderUsageHit(chrome, chrome.usageSpan.start, y), false);
|
|
@@ -933,3 +1060,20 @@ test("the narrow-layout bottom-only bar stays unchanged in the float style", (t)
|
|
|
933
1060
|
useCardStyle(t, CARD_STYLE.FLOAT);
|
|
934
1061
|
assert.deepEqual(renderShellBottomOnlyBar(data, theme, 100, "alt+u"), neon);
|
|
935
1062
|
});
|
|
1063
|
+
|
|
1064
|
+
test("fullscreen bars outside the rail never list the integrations: they live only in the rail", (t) => {
|
|
1065
|
+
const previous = cardStyle();
|
|
1066
|
+
t.after(() => setCardStyle(previous));
|
|
1067
|
+
const painted = { ...plainTheme, bg: (_role: string, text: string) => `\x1b[48;5;22m${text}\x1b[49m` };
|
|
1068
|
+
const data = model({ statuses: ["🧠 gentle-pi · ready", "MCP connected"] });
|
|
1069
|
+
const presentation = { ...DEFAULT_VISUAL_SETTINGS, headerPlacement: "below-input" as const };
|
|
1070
|
+
for (const style of [CARD_STYLE.NEON, CARD_STYLE.FLOAT]) {
|
|
1071
|
+
setCardStyle(style);
|
|
1072
|
+
const rows = renderShellBottomOnlyBar(data, painted as never, 120, "alt+u", presentation).map(stripAnsi).join("\n");
|
|
1073
|
+
assert.doesNotMatch(rows, /gentle-pi · ready|MCP connected/, `${style}: no integrations in the bottom bar`);
|
|
1074
|
+
assert.match(rows, /ctx/, `${style}: the bar itself stays`);
|
|
1075
|
+
}
|
|
1076
|
+
setCardStyle(CARD_STYLE.FLOAT);
|
|
1077
|
+
const float = renderShellBelowInputFloat(data, painted as never, 120, "alt+u", presentation)!;
|
|
1078
|
+
assert.doesNotMatch(float.rows.map(stripAnsi).join("\n"), /gentle-pi · ready|MCP connected/, "no integrations under the input");
|
|
1079
|
+
});
|
|
@@ -127,7 +127,6 @@ test("the rail Status draws Changes, Review and Integrations with the agent prof
|
|
|
127
127
|
" app.ts +2 files",
|
|
128
128
|
"",
|
|
129
129
|
edge("▾ INTEGRATIONS", "2", 48),
|
|
130
|
-
" Agent profile: claude (session)",
|
|
131
130
|
" - 🧠 gentle-pi · ready",
|
|
132
131
|
" - 💥 SUPER YOLO ON — no permission prompts;",
|
|
133
132
|
" private paths stay blocked",
|
|
@@ -157,13 +156,13 @@ const chromeModel = {
|
|
|
157
156
|
integrations: ["🧠 gentle-pi · ready"],
|
|
158
157
|
};
|
|
159
158
|
|
|
160
|
-
test("the title row names the project once and always keeps the session
|
|
159
|
+
test("the title row names the project once and always keeps the session; the profile rides the status bar", () => {
|
|
161
160
|
const row = stripAnsi(renderShellTitleRow(chromeModel, plain as never, 90));
|
|
162
161
|
assert.equal(visibleWidth(row), 90);
|
|
163
|
-
assert.match(row, /^ ✿ gentle-pi ~\/work\/gentle-pi +fleet adopt
|
|
164
|
-
const narrow = stripAnsi(renderShellTitleRow(chromeModel, plain as never,
|
|
165
|
-
assert.equal(visibleWidth(narrow),
|
|
166
|
-
assert.match(narrow, /fleet adopt
|
|
162
|
+
assert.match(row, /^ ✿ gentle-pi ~\/work\/gentle-pi +fleet adopt $/);
|
|
163
|
+
const narrow = stripAnsi(renderShellTitleRow(chromeModel, plain as never, 34));
|
|
164
|
+
assert.equal(visibleWidth(narrow), 34);
|
|
165
|
+
assert.match(narrow, /fleet adopt $/, "the path gives way before the session");
|
|
167
166
|
assert.doesNotMatch(stripAnsi(renderShellTitleRow({ ...chromeModel, sessionName: undefined, profile: undefined }, plain as never, 90)), /·/);
|
|
168
167
|
});
|
|
169
168
|
|
|
@@ -172,7 +171,10 @@ test("the status bar shows branch, permission mode, model, context, cost and usa
|
|
|
172
171
|
assert.equal(chrome.rows.length, 1);
|
|
173
172
|
const row = stripAnsi(chrome.rows[0]!);
|
|
174
173
|
assert.equal(visibleWidth(row), 120);
|
|
175
|
-
assert.match(row, /^ feat\/shell-ide-rework ±3 │ SUPER-YOLO +claude-opus-5-5 · high │ ctx [▰▱]+ 27% │ \$0\.000 │ usage · alt\+u $/);
|
|
174
|
+
assert.match(row, /^ feat\/shell-ide-rework ±3 │ 💥 SUPER-YOLO +claude-opus-5-5 · high │ ctx [▰▱]+ 27% │ \$0\.000 │ usage · alt\+u $/);
|
|
175
|
+
const yolo = stripAnsi(renderShellStatusBar({ ...chromeModel, permission: { mode: "YOLO" } }, plain as never, 120, "alt+u").rows[0]!);
|
|
176
|
+
assert.match(yolo, /│ 🔥 YOLO /, "YOLO keeps its fire icon (#2890)");
|
|
177
|
+
assert.equal(visibleWidth(yolo), 120);
|
|
176
178
|
assert.equal((row.match(/SUPER-YOLO/g) ?? []).length, 1, "the permission mode appears once");
|
|
177
179
|
assert.ok(chrome.usageSpan && row.slice(chrome.usageSpan.start, chrome.usageSpan.end).startsWith("usage"), "the usage segment is the click target");
|
|
178
180
|
const normal = stripAnsi(renderShellStatusBar({ ...chromeModel, permission: { mode: "NORMAL" } }, plain as never, 120, "alt+u").rows[0]!);
|
|
@@ -188,7 +190,7 @@ test("a narrow status bar drops usage before the model and keeps the branch", ()
|
|
|
188
190
|
const tighter = stripAnsi(renderShellStatusBar(chromeModel, plain as never, 70, "alt+u").rows[0]!);
|
|
189
191
|
assert.equal(visibleWidth(tighter), 70);
|
|
190
192
|
assert.doesNotMatch(tighter, /claude-opus/, "then the model");
|
|
191
|
-
assert.match(tighter, /feat\/shell-ide-rework ±3 │ SUPER-YOLO +ctx [▰▱]+ 27% │ \$0\.000 $/, "branch, mode, context and cost stay");
|
|
193
|
+
assert.match(tighter, /feat\/shell-ide-rework ±3 │ 💥 SUPER-YOLO +ctx [▰▱]+ 27% │ \$0\.000 $/, "branch, mode, context and cost stay");
|
|
192
194
|
const hidden = stripAnsi(renderShellStatusBar(chromeModel, plain as never, 120, "alt+u", { density: "comfortable", visibility: { changes: true, rdd: true, agents: true, todo: true, usageCost: false, modelDetails: false, contextWarning: true, stats: false } }).rows[0]!);
|
|
193
195
|
assert.doesNotMatch(hidden, /claude-opus|ctx|\$0\.000|usage/, "the visibility toggles hide model, context, cost and usage");
|
|
194
196
|
});
|
|
@@ -201,8 +203,7 @@ test("Integrations bullets distinguish items from continuations without losing d
|
|
|
201
203
|
const [header, ...body] = result.lines.map(line => stripAnsi(line).trimEnd());
|
|
202
204
|
assert.match(header, /INTEGRATIONS\s+3$/);
|
|
203
205
|
const firstBullet = body.findIndex(line => line.startsWith(" - "));
|
|
204
|
-
assert.
|
|
205
|
-
assert.equal(body.slice(0, firstBullet).map(line => line.trim()).join(" "), "Agent profile: claude (session)");
|
|
206
|
+
assert.equal(firstBullet, 0, "the status bullets open the section; the profile lives in Stats and the bars");
|
|
206
207
|
const bullets = body.slice(firstBullet);
|
|
207
208
|
assert.equal(bullets.filter(line => line.startsWith(" - ")).length, 3);
|
|
208
209
|
assert.ok(bullets.every(line => line.startsWith(" - ") || line.startsWith(" ")), "wrapped lines align beneath the item's text");
|
|
@@ -220,7 +221,7 @@ test("Integrations bullets distinguish items from continuations without losing d
|
|
|
220
221
|
test("Integrations explains the permission mode without repeating it", () => {
|
|
221
222
|
const rows = renderShellSidebarBar(chromeModel, plain as never, 48).map((line) => line.trimEnd());
|
|
222
223
|
const at = rows.findIndex((row) => row.startsWith("▾ INTEGRATIONS"));
|
|
223
|
-
assert.deepEqual(rows.slice(at + 1), ["
|
|
224
|
+
assert.deepEqual(rows.slice(at + 1), [" - permissions no permission prompts; private", " paths stay blocked", " - 🧠 gentle-pi · ready"]);
|
|
224
225
|
assert.doesNotMatch(rows.join("\n"), /SUPER-YOLO|SUPER YOLO/);
|
|
225
226
|
});
|
|
226
227
|
|
|
@@ -258,17 +259,17 @@ test("the panel sheet stacks the rail sections under a title row and scrolls wit
|
|
|
258
259
|
assert.deepEqual(end.slice(1), [" ▾ AGENTS", "", " ▾ CHANGES", " clean"], "the last page shows the last rows without a more row");
|
|
259
260
|
});
|
|
260
261
|
|
|
261
|
-
test("the mobile sheet wraps and scrolls
|
|
262
|
-
const model = { ...chromeModel,
|
|
262
|
+
test("the mobile sheet wraps and scrolls a long Integrations status", () => {
|
|
263
|
+
const model = { ...chromeModel, permission: undefined, integrations: ["mobile-integration-with-a-long-name (local)", "MCP connected"] };
|
|
263
264
|
const visibility = { changes: false, rdd: true, agents: true, todo: true, usageCost: true, modelDetails: true, contextWarning: true, stats: false };
|
|
264
265
|
const parts = new Map([["footer", { render: (width: number) => renderShellSidebarBar(model, plain, width, { density: "compact", visibility }) }]]);
|
|
265
266
|
const full = renderPanelSheet(parts, plain, 28, { rows: 15, scrollTop: 0 });
|
|
266
|
-
assert.match(full.lines.join("").replace(/\s/g, ""), /
|
|
267
|
-
assert.match(full.lines.join("\n"), /INTEGRATIONS\s+
|
|
267
|
+
assert.match(full.lines.join("").replace(/\s/g, ""), /mobile-integration-with-a-long-name\(local\)/);
|
|
268
|
+
assert.match(full.lines.join("\n"), /INTEGRATIONS\s+2/);
|
|
268
269
|
const top = renderPanelSheet(parts, plain, 28, { rows: 5, scrollTop: 0 });
|
|
269
270
|
assert.ok(top.maxScroll > 0);
|
|
270
271
|
assert.match(top.lines.join("\n"), /INTEGRATIONS/);
|
|
271
|
-
assert.match(top.lines.join("\n"), /
|
|
272
|
+
assert.match(top.lines.join("\n"), /mobile-integration/);
|
|
272
273
|
const end = renderPanelSheet(parts, plain, 28, { rows: 5, scrollTop: top.maxScroll });
|
|
273
274
|
assert.match(end.lines.join("\n"), /MCP connected/);
|
|
274
275
|
for (const line of [...top.lines, ...end.lines]) assert.equal(visibleWidth(line), 28);
|
|
@@ -286,10 +287,10 @@ test("a short sheet fills the resized viewport with painted rows without adding
|
|
|
286
287
|
}
|
|
287
288
|
});
|
|
288
289
|
|
|
289
|
-
test("the mobile title row carries the model, since the narrow status bar leaves
|
|
290
|
-
const row = stripAnsi(renderShellTitleRow(chromeModel, plain as never,
|
|
291
|
-
assert.equal(visibleWidth(row),
|
|
292
|
-
assert.match(row, /^ ✿ gentle-pi .*claude-opus-5-5 · high $/);
|
|
290
|
+
test("the mobile title row carries the model and the profile, since the narrow status bar leaves them out", () => {
|
|
291
|
+
const row = stripAnsi(renderShellTitleRow(chromeModel, plain as never, 72, { model: true }));
|
|
292
|
+
assert.equal(visibleWidth(row), 72);
|
|
293
|
+
assert.match(row, /^ ✿ gentle-pi .*claude-opus-5-5 · high · claude \(session\) $/);
|
|
293
294
|
});
|
|
294
295
|
|
|
295
296
|
test("a long branch gives way before the context and cost in a phone-width status bar", () => {
|
|
@@ -298,7 +299,7 @@ test("a long branch gives way before the context and cost in a phone-width statu
|
|
|
298
299
|
const row = stripAnsi(renderShellStatusBar(longBranch, plain as never, 56, "alt+u", narrowSettings).rows[0]!);
|
|
299
300
|
assert.equal(visibleWidth(row), 56);
|
|
300
301
|
assert.match(row, /ctx [▰▱]+ 27% │ \$0\.000 $/, "context and cost stay");
|
|
301
|
-
assert.match(row, /^ feat\/shell
|
|
302
|
+
assert.match(row, /^ feat\/shell\S*… │ 💥 SUPER-YOLO /, "the branch is clipped and the permission mode stays");
|
|
302
303
|
});
|
|
303
304
|
|
|
304
305
|
test("the rail Status sections are click targets: headers collapse them and the Changes row opens /gentle:changes", () => {
|
|
@@ -314,7 +315,7 @@ test("the rail Status sections are click targets: headers collapse them and the
|
|
|
314
315
|
assert.ok(collapsed.some((line) => /^▸ INTEGRATIONS/.test(line)), "a collapsed section keeps its header with ▸");
|
|
315
316
|
assert.ok(!collapsed.some((line) => /gentle-pi · ready/.test(line)), "and hides its rows");
|
|
316
317
|
const hovered = renderShellStatusSections(model, theme as never, 120, undefined, undefined, { hovered: "changes" }).lines.join("\n");
|
|
317
|
-
assert.match(hovered, /<warning>▾<\/warning> <
|
|
318
|
+
assert.match(hovered, /<warning>▾<\/warning> <warning>\*CHANGES\*<\/warning>/, "a hovered header paints the shared hover role");
|
|
318
319
|
const hoveredOpen = renderShellStatusSections(model, theme as never, 120, undefined, undefined, { hovered: "open-changes" }).lines.join("\n");
|
|
319
320
|
assert.match(hoveredOpen, /<warning>\/gentle:changes<\/warning>/, "a hovered Changes row paints its command in the hover role");
|
|
320
321
|
assert.deepEqual(renderShellSidebarBar(model, plain as never, 48), open.lines, "renderShellSidebarBar stays the lines of the same render");
|
|
@@ -330,3 +331,30 @@ test("the work row and the sheet's esc back show they are clickable", () => {
|
|
|
330
331
|
assert.equal(panelSheetBackHit(30, 5, 0), false);
|
|
331
332
|
assert.equal(panelSheetBackHit(30, 25, 1), false, "only the title row carries the control");
|
|
332
333
|
});
|
|
334
|
+
|
|
335
|
+
test("minimal density drops the rail's key hints row; compact keeps it", () => {
|
|
336
|
+
const visibility = { changes: true, rdd: true, agents: true, todo: true, usageCost: true, modelDetails: true, contextWarning: true, stats: false };
|
|
337
|
+
const hints = "alt+u usage · / commands";
|
|
338
|
+
const compact = renderShellStatusSections(chromeModel, plain as never, 48, { density: "compact", visibility }, hints, {}).lines.map(stripAnsi).join("\n");
|
|
339
|
+
const minimal = renderShellStatusSections(chromeModel, plain as never, 48, { density: "minimal", visibility }, hints, {}).lines.map(stripAnsi).join("\n");
|
|
340
|
+
assert.match(compact, /alt\+u usage/);
|
|
341
|
+
assert.doesNotMatch(minimal, /alt\+u usage/);
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
test("the agent profile lives next to the model in the bars and in Stats, never in Integrations", async () => {
|
|
345
|
+
const { collectSessionStats } = await import("../lib/shell-stats.ts");
|
|
346
|
+
const bar = stripAnsi(renderShellStatusBar(chromeModel, plain as never, 140, "alt+u").rows[0]!);
|
|
347
|
+
assert.match(bar, /claude-opus-5-5 · high · claude \(session\) │ ctx/, "the profile follows the model and effort");
|
|
348
|
+
const roomy = stripAnsi(renderShellStatusBar(chromeModel, plain as never, 120, "alt+u").rows[0]!);
|
|
349
|
+
assert.match(roomy, /claude-opus-5-5 · high │ ctx .*usage/, "the profile gives way before usage");
|
|
350
|
+
const tight = stripAnsi(renderShellStatusBar(chromeModel, plain as never, 70, "alt+u").rows[0]!);
|
|
351
|
+
assert.doesNotMatch(tight, /claude \(session\)/, "the profile gives way with the model");
|
|
352
|
+
const sections = renderShellStatusSections({ ...chromeModel, stats: collectSessionStats([]) }, plain as never, 48, undefined, undefined, {}).lines.map(stripAnsi);
|
|
353
|
+
const integrations = sections.slice(sections.findIndex((row) => /INTEGRATIONS/.test(row)));
|
|
354
|
+
assert.doesNotMatch(integrations.join("\n"), /profile/i, "Integrations no longer lists the profile");
|
|
355
|
+
const stats = sections.slice(sections.findIndex((row) => /STATS/.test(row)), sections.findIndex((row) => /INTEGRATIONS/.test(row)));
|
|
356
|
+
assert.match(stats.join("\n"), /profile +claude \(session\)/, "Stats names the profile");
|
|
357
|
+
const mobile = stripAnsi(renderShellTitleRow(chromeModel, plain as never, 90, { model: true }));
|
|
358
|
+
assert.match(mobile, /claude-opus-5-5 · high · claude \(session\) $/, "on a phone the title row carries model and profile");
|
|
359
|
+
assert.doesNotMatch(stripAnsi(renderShellTitleRow(chromeModel, plain as never, 90)), /claude \(session\)/, "the split title row leaves the profile to the bar");
|
|
360
|
+
});
|
|
@@ -47,21 +47,21 @@ async function renderViewport(columns: number, rows: number, sidebar: boolean):
|
|
|
47
47
|
|
|
48
48
|
test("fullscreen with the sidebar leaves no blank row between the editor and the terminal edge", async () => {
|
|
49
49
|
const screen = await renderViewport(140, 24, true);
|
|
50
|
-
assert.equal(screen[0], "HEADER
|
|
50
|
+
assert.equal(screen[0], "HEADER 140", "the header owns the first row");
|
|
51
51
|
assert.match(screen[screen.length - 1] ?? "", /^╰/, `the editor's bottom border sits on the last row, got ${JSON.stringify(screen.slice(-3))}`);
|
|
52
52
|
assert.ok(screen.some((row) => row.startsWith("╭─ editor")), "the editor is still painted");
|
|
53
53
|
assert.ok(screen.some((row) => row.includes("Status card")), "the rail is still painted");
|
|
54
54
|
});
|
|
55
55
|
|
|
56
|
-
test("
|
|
56
|
+
test("under a split header the rail keeps one spacer below the title block", async (t) => {
|
|
57
57
|
const previous = cardStyle();
|
|
58
58
|
t.after(() => setCardStyle(previous));
|
|
59
59
|
setCardStyle(CARD_STYLE.FLOAT);
|
|
60
60
|
const screen = await renderViewport(140, 24, true);
|
|
61
|
-
assert.equal(screen[0], "HEADER
|
|
61
|
+
assert.equal(screen[0], "HEADER 140");
|
|
62
62
|
assert.match(screen[1]!, /^transcript /, "the transcript starts immediately below the header");
|
|
63
|
-
assert.doesNotMatch(screen[1]!, /Status card/, "the rail
|
|
64
|
-
assert.match(screen[2]!, /Status card
|
|
63
|
+
assert.doesNotMatch(screen[1]!, /Status card/, "the first rail row separates the header from its card");
|
|
64
|
+
assert.match(screen[2]!, /Status card/, "the first card starts after exactly one spacer row");
|
|
65
65
|
});
|
|
66
66
|
|
|
67
67
|
test("fullscreen without the sidebar keeps Pi's bottom bar on the last row", async () => {
|