@timurproko/a1 0.2.4 → 0.2.5-dev.683

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.
Files changed (77) hide show
  1. package/dist/app/session-shell/session-shell-root.d.ts +1 -0
  2. package/dist/app/session-shell/session-shell-root.js +4 -4
  3. package/dist/app/session-shell/session-shell.js +7 -5
  4. package/dist/composition/owned-ui.js +1 -0
  5. package/dist/composition/session-info-reference.d.ts +4 -0
  6. package/dist/composition/session-info-reference.js +20 -0
  7. package/dist/composition/settings-route-host.d.ts +2 -5
  8. package/dist/composition/settings-route-host.js +7 -11
  9. package/dist/features/owned-ui/reference-screen-app.d.ts +2 -0
  10. package/dist/features/owned-ui/reference-screen-app.js +7 -1
  11. package/dist/foundation/release/progress-palette.generated.d.ts +2 -2
  12. package/dist/foundation/release/progress-palette.generated.js +2 -2
  13. package/dist/foundation/startup/startup-descriptor.js +2 -2
  14. package/dist/integrations/pi/components/resources/builtin-themes.d.ts +2 -2
  15. package/dist/integrations/pi/components/resources/builtin-themes.js +2 -2
  16. package/dist/integrations/pi/components/shell-presenters-info.d.ts +2 -0
  17. package/dist/integrations/pi/components/shell-presenters-info.js +1 -1
  18. package/dist/integrations/pi/components/shell-session-info-reference.d.ts +10 -0
  19. package/dist/integrations/pi/components/shell-session-info-reference.js +61 -0
  20. package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.d.ts +5 -5
  21. package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.js +1 -1
  22. package/dist/integrations/pi/components/upstream/assets/earendil-image.json +2 -2
  23. package/dist/integrations/pi/components/upstream/components/countdown-timer.d.ts +1 -1
  24. package/dist/integrations/pi/components/upstream/components/earendil-announcement.js +1 -1
  25. package/dist/integrations/pi/components/upstream/components/extension-editor.d.ts +1 -1
  26. package/dist/integrations/pi/components/upstream/components/extension-editor.js +1 -1
  27. package/dist/integrations/pi/components/upstream/components/extension-input.js +1 -1
  28. package/dist/integrations/pi/components/upstream/components/extension-selector.js +1 -1
  29. package/dist/integrations/pi/components/upstream/components/mermaid.js +1 -1
  30. package/dist/integrations/pi/components/upstream/components/owned-editor.d.ts +1 -1
  31. package/dist/integrations/pi/components/upstream/components/owned-editor.js +1 -1
  32. package/dist/integrations/pi/components/upstream/components/pi-logo.js +1 -1
  33. package/dist/integrations/pi/components/upstream/components/scoped-models-selector.d.ts +1 -1
  34. package/dist/integrations/pi/components/upstream/components/session-footer.js +1 -1
  35. package/dist/integrations/pi/components/upstream/components/session-selector-search.js +1 -1
  36. package/dist/integrations/pi/components/upstream/components/session-selector.js +1 -1
  37. package/dist/integrations/pi/components/upstream/components/skill-invocation-message.d.ts +1 -1
  38. package/dist/integrations/pi/components/upstream/components/skill-invocation-message.js +1 -1
  39. package/dist/integrations/pi/components/upstream/components/status-indicator.d.ts +1 -1
  40. package/dist/integrations/pi/components/upstream/components/status-indicator.js +1 -1
  41. package/dist/integrations/pi/components/upstream/components/themed-text.d.ts +1 -1
  42. package/dist/integrations/pi/components/upstream/components/themed-text.js +1 -1
  43. package/dist/integrations/pi/components/upstream/components/thinking-selector.d.ts +1 -1
  44. package/dist/integrations/pi/components/upstream/components/thinking-selector.js +1 -1
  45. package/dist/integrations/pi/components/upstream/components/tool-execution.js +1 -1
  46. package/dist/integrations/pi/components/upstream/components/tree-selector.d.ts +1 -1
  47. package/dist/integrations/pi/components/upstream/components/tree-selector.js +1 -1
  48. package/dist/integrations/pi/components/upstream/components/trust-selector.js +1 -1
  49. package/dist/integrations/pi/components/upstream/external-editor.js +1 -1
  50. package/dist/integrations/pi/components/upstream/history/editor-core.d.ts +1 -1
  51. package/dist/integrations/pi/components/upstream/history/editor-core.js +1 -1
  52. package/dist/integrations/pi/components/upstream/history/kill-ring.d.ts +1 -1
  53. package/dist/integrations/pi/components/upstream/history/kill-ring.js +1 -1
  54. package/dist/integrations/pi/components/upstream/history/printable-key.js +1 -1
  55. package/dist/integrations/pi/components/upstream/history/text-helpers.js +1 -1
  56. package/dist/integrations/pi/components/upstream/history/undo-stack.d.ts +1 -1
  57. package/dist/integrations/pi/components/upstream/history/undo-stack.js +1 -1
  58. package/dist/integrations/pi/components/upstream/history/word-navigation.js +1 -1
  59. package/dist/integrations/pi/components/upstream/model-search.d.ts +1 -1
  60. package/dist/integrations/pi/components/upstream/theme/system-theme.d.ts +1 -1
  61. package/dist/integrations/pi/components/upstream/theme/system-theme.js +1 -1
  62. package/dist/integrations/pi/components/upstream/theme/theme-controller.d.ts +1 -1
  63. package/dist/integrations/pi/components/upstream/theme/theme.js +1 -1
  64. package/dist/integrations/pi/engine/resources/changelog.json +4 -4
  65. package/dist/integrations/pi/startup-public.js +186 -81
  66. package/dist/integrations/pi/startup-public.manifest.json +107 -95
  67. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +1 -1
  68. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +1 -1
  69. package/dist/native/darwin-arm64/manifest.json +1 -1
  70. package/dist/native/linux-x64/manifest.json +1 -1
  71. package/dist/native/win32-x64/manifest.json +2 -2
  72. package/dist/native/win32-x64/process-guardian.exe +0 -0
  73. package/dist/runtime-payload-inventory.json +2717 -2630
  74. package/docs/assets/readme/separator-dark.svg +2 -4
  75. package/docs/assets/readme/separator.svg +2 -4
  76. package/docs/releases/0.2.4.md +1 -5
  77. package/package.json +3 -3
@@ -257,6 +257,7 @@ export declare class OwnedUiSessionShellRoot implements PiTuiComponentPort {
257
257
  setViewportOverlaySurfaces(surfaces: readonly PiTuiPointerSurface[] | null): void;
258
258
  viewportInputGeometryReady(width: number, height: number): boolean;
259
259
  handleViewportPreInput(data: string, allowWheel?: boolean, now?: number, editorActive?: boolean): SessionViewportInputResult;
260
+ dismissNotice(): void;
260
261
  layoutRoot(): PiTuiLayoutNode;
261
262
  transcriptComponent(id: string): PiShellTranscriptComponentPort | undefined;
262
263
  exitTranscript(width: number): string;
@@ -286,7 +286,7 @@ export class OwnedUiSessionShellRoot {
286
286
  reconcilePromptImageLimitNotice(text = this.editor.getText()) {
287
287
  if (this.#dockNotice?.errorCode !== "image-count" || !this.#promptChips.imageLimitState(text).corrected)
288
288
  return false;
289
- this.#dismissDockNotice();
289
+ this.dismissNotice();
290
290
  return true;
291
291
  }
292
292
  hasPendingPastes(text) { return this.#promptChips.hasPending(text); }
@@ -375,7 +375,7 @@ export class OwnedUiSessionShellRoot {
375
375
  // Invariant: the notice answers the reader's last command, so only their next prompt or
376
376
  // shell command retires it; assistant, tool, and compaction blocks streaming in keep it.
377
377
  if (block.kind === "user" || block.kind === "bash")
378
- this.#dismissDockNotice();
378
+ this.dismissNotice();
379
379
  const created = createPiShellTranscriptComponent(block, this.#cwd, this.#extensionRenderers, this.#submittedPromptComposer, this.#outputPad, !this.#thinkingVisible, this.#mermaidRenderingMode, this.#showImages, this.#imageWidthCells, this.#imageAssets, { ...this.#componentRuntime, changed: () => {
380
380
  if (this.#transcript.get(block.id) !== created)
381
381
  return;
@@ -659,7 +659,7 @@ export class OwnedUiSessionShellRoot {
659
659
  }
660
660
  return renderPiShellCommandMessage({ kind: notice.kind, message: notice.message }, width, this.#outputPad);
661
661
  }
662
- #dismissDockNotice() {
662
+ dismissNotice() {
663
663
  if (this.#dockNotice === undefined)
664
664
  return;
665
665
  this.#dockNotice = undefined;
@@ -1247,7 +1247,7 @@ export class OwnedUiSessionShellRoot {
1247
1247
  }
1248
1248
  #appendAnchoredWorkflowComponent(render, dispose) {
1249
1249
  // Invariant: transcript-bound workflow output supersedes a pending acknowledgement.
1250
- this.#dismissDockNotice();
1250
+ this.dismissNotice();
1251
1251
  this.#workflowTranscriptSequence += 1;
1252
1252
  const id = `workflow-status-${this.#workflowTranscriptSequence}`;
1253
1253
  const component = {
@@ -358,12 +358,13 @@ export class OwnedUiSessionShell {
358
358
  ? this.runtime.addPreInputListener(data => {
359
359
  if (inputPresentation?.coordination === false)
360
360
  this.#streamPresentation.noteImmediatePresentation();
361
- // Compatibility: Pi's fullscreen renderer also intercepts plain Home/End.
362
- // Deliver them to the focused owned input before that outer scroll handler;
363
- // overlays retain Pi's normal dispatch, and comparison profiles never enter here.
361
+ // Compatibility: route boundary keys before Pi.
362
+ const isDefault = this.root.usesDefaultInputSurface();
364
363
  if (!this.runtime.hasOverlay() && (this.root.editor.matchesTerminalKey(data, "home")
365
- || this.root.editor.matchesTerminalKey(data, "end"))) {
366
- if (this.root.usesDefaultInputSurface())
364
+ || this.root.editor.matchesTerminalKey(data, "end")
365
+ || !isDefault && (this.root.editor.matchesTerminalKey(data, "ctrl+home")
366
+ || this.root.editor.matchesTerminalKey(data, "ctrl+end")))) {
367
+ if (isDefault)
367
368
  this.root.handleViewportPreInput(data, true);
368
369
  this.root.handleInput(data);
369
370
  this.runtime.requestRender();
@@ -1768,6 +1769,7 @@ export class OwnedUiSessionShell {
1768
1769
  return { outcome: "failed", diagnostic: `route is unavailable: ${route}` };
1769
1770
  if (!this.runtime.active)
1770
1771
  return { outcome: "failed", diagnostic: "runtime is not active" };
1772
+ this.root.dismissNotice();
1771
1773
  this.#dialogHandle?.hide();
1772
1774
  this.#dialogSource = "route";
1773
1775
  // Protocol: any-event reporting: hover and drag are what the screen is driven by, and
@@ -82,6 +82,7 @@ export async function composeOwnedUi(options = {}) {
82
82
  const { renderPiShellHotkeySections } = await import("../integrations/pi/components/shell-hotkey-sections.js");
83
83
  return { sections: width => renderPiShellHotkeySections(presentation, width) };
84
84
  },
85
+ session: () => import("./session-info-reference.js").then(m => m.loadSessionInfoReference(adapter)),
85
86
  };
86
87
  const routeHost = settings === null || !ownedSurfaces ? null : createOwnedRouteHost(settings, references);
87
88
  const viewportSettings = settings === null || !ownedSurfaces ? null : {
@@ -0,0 +1,4 @@
1
+ import type { ReferenceDocumentProvider } from "../features/owned-ui/reference-screen-app.js";
2
+ import type { PiEngineAdapter } from "../integrations/pi/engine/adapter.js";
3
+ /** Captures one current session snapshot and adapts it to the neutral reference document. */
4
+ export declare function loadSessionInfoReference(adapter: PiEngineAdapter): Promise<ReferenceDocumentProvider>;
@@ -0,0 +1,20 @@
1
+ import { renderPiShellSessionInfoReferenceDocument } from "../integrations/pi/components/shell-session-info-reference.js";
2
+ /** Captures one current session snapshot and adapts it to the neutral reference document. */
3
+ export async function loadSessionInfoReference(adapter) {
4
+ const result = await adapter.executeWorkflow({ command: "session", argument: "" });
5
+ if (result.outcome !== "completed")
6
+ throw new Error(result.message);
7
+ if (result.presentation?.kind !== "session-info")
8
+ throw new Error("Session workflow returned no structured information");
9
+ const presentation = result.presentation;
10
+ let cached = null;
11
+ const document = (width) => {
12
+ if (cached?.width !== width)
13
+ cached = { width, document: renderPiShellSessionInfoReferenceDocument(presentation, width) };
14
+ return cached.document;
15
+ };
16
+ return {
17
+ preamble: width => document(width).preamble,
18
+ sections: width => document(width).sections,
19
+ };
20
+ }
@@ -7,10 +7,7 @@ export type OwnedReferenceRows = NonNullable<ReferenceDocumentProvider["rows"]>;
7
7
  export interface OwnedReferenceProviders {
8
8
  changelog(input?: UiRouteInput): Promise<ReferenceDocumentProvider>;
9
9
  hotkeys(): Promise<ReferenceDocumentProvider>;
10
+ session(): Promise<ReferenceDocumentProvider>;
10
11
  }
11
- /**
12
- * Declares the A1-owned settings route, and the changelog and hotkeys reference
13
- * routes when their documents are supplied, without evaluating their presentation
14
- * graphs during startup. Opening a route retains input while the optional module loads.
15
- */
12
+ /** Declares settings and lazy document routes. */
16
13
  export declare function createOwnedRouteHost(settings: OwnedSettingsManager, references?: OwnedReferenceProviders): UiRouteHost;
@@ -1,14 +1,10 @@
1
- import { CHANGELOG_APP_ID, CHANGELOG_ROUTE, CHANGELOG_TITLE, HOTKEYS_APP_ID, HOTKEYS_ROUTE, HOTKEYS_TITLE, } from "../features/owned-ui/reference-routes.js";
1
+ import { CHANGELOG_ROUTE, CHANGELOG_TITLE, HOTKEYS_ROUTE, HOTKEYS_TITLE, } from "../features/owned-ui/reference-routes.js";
2
2
  import { SETTINGS_APP_ID, SETTINGS_ROUTE } from "../features/owned-ui/settings-route.js";
3
3
  import { piTheme } from "../integrations/pi/components/upstream/theme/theme.js";
4
4
  import { faint } from "../ui/components/text.js";
5
- /**
6
- * Declares the A1-owned settings route, and the changelog and hotkeys reference
7
- * routes when their documents are supplied, without evaluating their presentation
8
- * graphs during startup. Opening a route retains input while the optional module loads.
9
- */
5
+ /** Declares settings and lazy document routes. */
10
6
  export function createOwnedRouteHost(settings, references) {
11
- const routes = new Set([SETTINGS_ROUTE, ...(references === undefined ? [] : [CHANGELOG_ROUTE, HOTKEYS_ROUTE])]);
7
+ const routes = new Set([SETTINGS_ROUTE, ...(references === undefined ? [] : [CHANGELOG_ROUTE, HOTKEYS_ROUTE, "session"])]);
12
8
  return {
13
9
  claims: route => routes.has(route),
14
10
  open: (route, input) => {
@@ -18,10 +14,10 @@ export function createOwnedRouteHost(settings, references) {
18
14
  return deferredSurface(SETTINGS_APP_ID, "settings", () => loadSettingsSurface(settings));
19
15
  }
20
16
  const changelog = route === CHANGELOG_ROUTE;
21
- const id = changelog ? CHANGELOG_APP_ID : HOTKEYS_APP_ID;
22
- const title = changelog ? CHANGELOG_TITLE : HOTKEYS_TITLE;
23
- const document = changelog ? references.changelog(input) : references.hotkeys();
24
- return deferredSurface(id, title, () => loadReferenceSurface(settings, id, route, title, document));
17
+ const session = route === "session";
18
+ const title = session ? "Session Info" : changelog ? CHANGELOG_TITLE : HOTKEYS_TITLE;
19
+ const document = session ? references.session() : changelog ? references.changelog(input) : references.hotkeys();
20
+ return deferredSurface(route, title, () => loadReferenceSurface(settings, route, route, title, document));
25
21
  },
26
22
  };
27
23
  }
@@ -11,6 +11,8 @@ export interface ReferenceDocumentSection {
11
11
  export interface ReferenceDocumentProvider {
12
12
  /** Flat rows for this width, or null while the document is not available yet. */
13
13
  readonly rows?: (width: number) => readonly string[] | null;
14
+ /** Rows between the screen title and structured groups, absent for group-only documents. */
15
+ readonly preamble?: (width: number) => readonly string[] | null;
14
16
  /** Structured groups opt into shared Settings-style headers and pinning. */
15
17
  readonly sections?: (width: number) => readonly ReferenceDocumentSection[] | null;
16
18
  /** Settles once the selected content provider answers; absent when available at once. */
@@ -222,10 +222,16 @@ export class ReferenceScreenApp {
222
222
  if (cached !== null && cached.width === width)
223
223
  return this.#withTitle(cached.content, title);
224
224
  const sections = this.#document.sections?.(width);
225
- if (sections === null)
225
+ const preamble = sections === undefined ? undefined : this.#document.preamble?.(width);
226
+ if (sections === null || preamble === null)
226
227
  return { kind: "flat", rows: [title, "", LOADING_NOTICE] };
227
228
  if (sections !== undefined) {
228
229
  const rows = [];
230
+ if (preamble !== undefined && preamble.length > 0) {
231
+ for (const row of preamble)
232
+ rows.push({ kind: "note", group: "", text: row });
233
+ rows.push({ kind: "spacer" });
234
+ }
229
235
  sections.forEach((section, sectionIndex) => {
230
236
  if (sectionIndex > 0)
231
237
  rows.push({ kind: "spacer" });
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Generated by scripts/pi/sync-progress-palette.ts from @earendil-works/pi-coding-agent 1.0.2
3
- * (MIT), commit cd32f7725fdbddbaecdff5b1e68491563394e0ca. Do not edit directly.
2
+ * Generated by scripts/pi/sync-progress-palette.ts from @earendil-works/pi-coding-agent 1.0.4
3
+ * (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df. Do not edit directly.
4
4
  */
5
5
  export declare const SHARED_PROGRESS_ACCENT_ANSI = "\u001B[38;2;167;152;215m";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Generated by scripts/pi/sync-progress-palette.ts from @earendil-works/pi-coding-agent 1.0.2
3
- * (MIT), commit cd32f7725fdbddbaecdff5b1e68491563394e0ca. Do not edit directly.
2
+ * Generated by scripts/pi/sync-progress-palette.ts from @earendil-works/pi-coding-agent 1.0.4
3
+ * (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df. Do not edit directly.
4
4
  */
5
5
  export const SHARED_PROGRESS_ACCENT_ANSI = "\u001b[38;2;167;152;215m";
@@ -10,7 +10,7 @@ export const STARTUP_DESCRIPTOR = Object.freeze({
10
10
  ],
11
11
  "generatedArtifact": {
12
12
  "path": "dist/integrations/pi/startup-public.js",
13
- "sha256": "c115c1f4222f750961ed1d2d2b9b6c022f2948b070445b84e758c4d0c40d0bcd"
13
+ "sha256": "2adac500d8cebd5f7805c18a549ec0c6b23f13bd10ee5f3f463a6758f489e410"
14
14
  },
15
15
  "dependencyLayerIdentity": {
16
16
  "source": "A1_RELEASE_LAYERS",
@@ -19,7 +19,7 @@ export const STARTUP_DESCRIPTOR = Object.freeze({
19
19
  "compileCacheNamespace": {
20
20
  "strategy": "node-abi-version-and-ordered-layer-sha256-v1"
21
21
  },
22
- "identity": "e2d043ae3f413047a59b2d289bbca7b46ff0eebbc040e652dc8f76677054f49e"
22
+ "identity": "b010b97970c6c40fe160224121793bf0b26d7c77e7860d8e787aaeb912333100"
23
23
  });
24
24
 
25
25
  export function loadDeclaredStartupGraph() {
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Attributed owned theme resources adapted from @earendil-works/pi-coding-agent 1.0.0 (MIT),
3
- * commit cd32f7725fdbddbaecdff5b1e68491563394e0ca.
2
+ * Attributed owned theme resources adapted from @earendil-works/pi-coding-agent 1.0.4 (MIT),
3
+ * commit 7c10bd4337495ee613f2224843ecdf349b80d1df.
4
4
  * Upstream dark.json SHA-256: c11a588b714d35300293079b425fb09a3693d4b2d453585d211b08163c648b75
5
5
  * Upstream light.json SHA-256: f590c51c2bc8b238891efd0e983473ed2e2a6487b6692cc1d4b2845165e703f7
6
6
  * Modifications: removed upstream schema/export metadata; runtime color data is unchanged.
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Attributed owned theme resources adapted from @earendil-works/pi-coding-agent 1.0.0 (MIT),
3
- * commit cd32f7725fdbddbaecdff5b1e68491563394e0ca.
2
+ * Attributed owned theme resources adapted from @earendil-works/pi-coding-agent 1.0.4 (MIT),
3
+ * commit 7c10bd4337495ee613f2224843ecdf349b80d1df.
4
4
  * Upstream dark.json SHA-256: c11a588b714d35300293079b425fb09a3693d4b2d453585d211b08163c648b75
5
5
  * Upstream light.json SHA-256: f590c51c2bc8b238891efd0e983473ed2e2a6487b6692cc1d4b2845165e703f7
6
6
  * Modifications: removed upstream schema/export metadata; runtime color data is unchanged.
@@ -56,6 +56,8 @@ export interface PiShellCommandMessagePresentation {
56
56
  readonly detail?: string;
57
57
  }
58
58
  export declare function renderPiShellCommandMessage(presentation: PiShellCommandMessagePresentation, width: number, outputPad?: 0 | 1): readonly string[];
59
+ /** The one-line warming status the pinned session report shows; a decision is attached once warming acted. */
60
+ export declare function formatCacheWarmingStatus(status: NonNullable<PiShellCacheWarmingPresentation["status"]>, now?: number): string;
59
61
  export declare function createPiShellSessionInfo(presentation: PiShellSessionInfoPresentation): PiShellComponentPort;
60
62
  export declare function createPiShellCollapsedChangelog(): PiShellComponentPort;
61
63
  export declare function createPiShellChangelog(markdown: string): PiShellComponentPort;
@@ -56,7 +56,7 @@ function formatWarmingDecisionTime(nextWarmAt, now) {
56
56
  return `Decision in ${parts.join(" ")}`;
57
57
  }
58
58
  /** The one-line warming status the pinned session report shows; a decision is attached once warming acted. */
59
- function formatCacheWarmingStatus(status, now = Date.now()) {
59
+ export function formatCacheWarmingStatus(status, now = Date.now()) {
60
60
  const decision = status.decision;
61
61
  if (!decision || (status.state === "inactive" && !decision.economicsAvailable && !status.extensionOverride)) {
62
62
  return `Inactive (${status.reason ?? "unknown reason"})`;
@@ -0,0 +1,10 @@
1
+ import { type PiShellSessionInfoPresentation } from "./shell-presenters-info.js";
2
+ export interface PiShellSessionInfoReferenceDocument {
3
+ readonly preamble: readonly string[];
4
+ readonly sections: readonly {
5
+ readonly title: string;
6
+ readonly rows: readonly string[];
7
+ }[];
8
+ }
9
+ /** Renders the pinned report values while leaving group names semantic for the owned screen. */
10
+ export declare function renderPiShellSessionInfoReferenceDocument(presentation: PiShellSessionInfoPresentation, width: number): PiShellSessionInfoReferenceDocument;
@@ -0,0 +1,61 @@
1
+ import { Text } from "@earendil-works/pi-tui";
2
+ import { formatCacheWarmingStatus } from "./shell-presenters-info.js";
3
+ import { ensureTheme, formatSessionTokens } from "./shell-shared-facade.js";
4
+ import { piTheme } from "./theme.js";
5
+ /** Renders the pinned report values while leaving group names semantic for the owned screen. */
6
+ export function renderPiShellSessionInfoReferenceDocument(presentation, width) {
7
+ ensureTheme();
8
+ const { stats, sessionName, cacheWaste, usageBreakdown, cacheWarming } = presentation;
9
+ const render = (rows) => new Text(rows.join("\n"), 1, 0).render(width);
10
+ const preamble = [
11
+ ...(sessionName ? [`${piTheme().fg("dim", "Name:")} ${sessionName}`] : []),
12
+ `${piTheme().fg("dim", "File:")} ${stats.sessionFile ?? "In-memory"}`,
13
+ `${piTheme().fg("dim", "ID:")} ${stats.sessionId}`,
14
+ ];
15
+ const messages = [
16
+ `${piTheme().fg("dim", "Total:")} ${stats.totalMessages}`,
17
+ `${piTheme().fg("dim", "User:")} ${stats.userMessages}`,
18
+ `${piTheme().fg("dim", "Assistant:")} ${stats.assistantMessages}`,
19
+ `${piTheme().fg("dim", "Tools:")} ${stats.toolCalls} calls, ${stats.toolResults} results`,
20
+ ];
21
+ const { input, cacheRead, cacheWrite } = stats.tokens;
22
+ const promptTokens = input + cacheRead + cacheWrite;
23
+ const tokens = [`${piTheme().fg("dim", "Input:")} ${promptTokens.toLocaleString()}`];
24
+ if (promptTokens > 0 && (cacheRead > 0 || cacheWrite > 0)) {
25
+ tokens.push(` ${piTheme().fg("dim", "Cached:")} ${cacheRead.toLocaleString()} ${piTheme().fg("dim", `(${((cacheRead / promptTokens) * 100).toFixed(1)}%)`)}`);
26
+ const written = cacheWrite > 0 ? ` ${piTheme().fg("dim", `(${cacheWrite.toLocaleString()} written to cache)`)}` : "";
27
+ tokens.push(` ${piTheme().fg("dim", "Uncached:")} ${(input + cacheWrite).toLocaleString()}${written}`);
28
+ }
29
+ tokens.push(`${piTheme().fg("dim", "Output:")} ${stats.tokens.output.toLocaleString()}`);
30
+ tokens.push(`${piTheme().fg("dim", "Total:")} ${stats.tokens.total.toLocaleString()}`);
31
+ const warmingStatus = cacheWarming.status;
32
+ const warming = [
33
+ `${piTheme().fg("dim", "Mode:")} ${cacheWarming.mode}`,
34
+ `${piTheme().fg("dim", "Status:")} ${warmingStatus ? formatCacheWarmingStatus(warmingStatus) : "Inactive (cache warming unavailable)"}`,
35
+ ];
36
+ const warmingDecision = warmingStatus?.decision;
37
+ if (warmingDecision?.economicsAvailable) {
38
+ warming.push(`${piTheme().fg("dim", "Cache miss penalty:")} $${warmingDecision.missCost.toFixed(3)}`);
39
+ warming.push(`${piTheme().fg("dim", "Refresh cost:")} $${warmingDecision.warmCost.toFixed(3)}`);
40
+ }
41
+ const sections = [
42
+ { title: "Messages", rows: render(messages) },
43
+ { title: "Tokens", rows: render(tokens) },
44
+ { title: "Cache Warming", rows: render(warming) },
45
+ ];
46
+ if (stats.cost > 0 || cacheWaste.missedTokens > 0) {
47
+ const cost = [`${piTheme().fg("dim", "Total:")} $${stats.cost.toFixed(3)}`];
48
+ if (usageBreakdown.length > 1)
49
+ for (const entry of usageBreakdown) {
50
+ cost.push(` ${piTheme().fg("dim", `${entry.key}:`)} $${entry.cost.toFixed(3)} ${piTheme().fg("dim", `(${formatSessionTokens(entry.tokens)} tokens)`)}`);
51
+ }
52
+ if (cacheWaste.missedTokens > 0) {
53
+ const detail = `${cacheWaste.missedTokens.toLocaleString()} tokens, ${cacheWaste.missCount === 1 ? "1 miss" : `${cacheWaste.missCount} misses`}`;
54
+ cost.push(cacheWaste.missedCost >= 0.0001
55
+ ? `${piTheme().fg("dim", "Cache Re-billed:")} $${cacheWaste.missedCost.toFixed(3)} ${piTheme().fg("dim", `(${detail})`)}`
56
+ : `${piTheme().fg("dim", "Cache Re-billed:")} ${detail}`);
57
+ }
58
+ sections.push({ title: "Cost", rows: render(cost) });
59
+ }
60
+ return { preamble: render(preamble), sections };
61
+ }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.2 (MIT), commit cd32f7725fdbddbaecdff5b1e68491563394e0ca,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
3
3
  * packages/coding-agent/src/core/keybindings.ts.
4
4
  * Modifications: Mechanical source port with Node import prefixes, public package-root agent-directory
5
5
  * resolution, and an opt-in bare-A1 input profile including Ctrl+L level cycling, unbound model
@@ -287,11 +287,11 @@ export declare const KEYBINDINGS: {
287
287
  readonly description: "Move cursor word right";
288
288
  };
289
289
  readonly "tui.editor.cursorLineStart": {
290
- readonly defaultKeys: ["home", "ctrl+home", "ctrl+a"];
290
+ readonly defaultKeys: ["home", "ctrl+a"];
291
291
  readonly description: "Move to line start";
292
292
  };
293
293
  readonly "tui.editor.cursorLineEnd": {
294
- readonly defaultKeys: ["end", "ctrl+end", "ctrl+e"];
294
+ readonly defaultKeys: ["end", "ctrl+e"];
295
295
  readonly description: "Move to line end";
296
296
  };
297
297
  readonly "tui.editor.jumpForward": {
@@ -419,11 +419,11 @@ export declare const KEYBINDINGS: {
419
419
  readonly description: "Close transcript search";
420
420
  };
421
421
  readonly "tui.altScreen.top": {
422
- readonly defaultKeys: "home";
422
+ readonly defaultKeys: "ctrl+home";
423
423
  readonly description: "Scroll viewport to top";
424
424
  };
425
425
  readonly "tui.altScreen.bottom": {
426
- readonly defaultKeys: "end";
426
+ readonly defaultKeys: "ctrl+end";
427
427
  readonly description: "Scroll viewport to bottom";
428
428
  };
429
429
  };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.2 (MIT), commit cd32f7725fdbddbaecdff5b1e68491563394e0ca,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
3
3
  * packages/coding-agent/src/core/keybindings.ts.
4
4
  * Modifications: Mechanical source port with Node import prefixes, public package-root agent-directory
5
5
  * resolution, and an opt-in bare-A1 input profile including Ctrl+L level cycling, unbound model
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "sourcePackage": "@earendil-works/pi-coding-agent",
3
- "sourceVersion": "1.0.2",
3
+ "sourceVersion": "1.0.4",
4
4
  "upstreamRepository": "https://github.com/earendil-works/pi.git",
5
- "upstreamCommit": "cd32f7725fdbddbaecdff5b1e68491563394e0ca",
5
+ "upstreamCommit": "7c10bd4337495ee613f2224843ecdf349b80d1df",
6
6
  "sourcePath": "dist/modes/interactive/assets/clankolas.png",
7
7
  "sourceSha256": "169acd0dfe6fbb8d8742ed24a3fc654fd0b2e2d4223c733249c5493723f1b72d",
8
8
  "license": "MIT",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.2 (MIT), commit cd32f7725fdbddbaecdff5b1e68491563394e0ca,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
3
3
  * packages/coding-agent/src/modes/interactive/components/countdown-timer.ts.
4
4
  * Modifications: Mechanical source port with ECMAScript private fields; imports remain on the public
5
5
  * Pi TUI package root.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.2 (MIT), commit cd32f7725fdbddbaecdff5b1e68491563394e0ca,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
3
3
  * packages/coding-agent/src/modes/interactive/components/earendil-announcement.ts.
4
4
  * Modifications: Mechanical pinned source port with private imports remapped to public package-root
5
5
  * types/APIs and A1-owned theme boundaries. The unchanged image is loaded lazily from its attributed,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.2 (MIT), commit cd32f7725fdbddbaecdff5b1e68491563394e0ca,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
3
3
  * packages/coding-agent/src/modes/interactive/components/extension-editor.ts.
4
4
  * Modifications: Mechanical port: remap pi-tui to the root public singleton, use owned
5
5
  * keybindings/theme and external-editor seams, preserve editor layout, hints, focus, submission,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.2 (MIT), commit cd32f7725fdbddbaecdff5b1e68491563394e0ca,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
3
3
  * packages/coding-agent/src/modes/interactive/components/extension-editor.ts.
4
4
  * Modifications: Mechanical port: remap pi-tui to the root public singleton, use owned
5
5
  * keybindings/theme and external-editor seams, preserve editor layout, hints, focus, submission,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.2 (MIT), commit cd32f7725fdbddbaecdff5b1e68491563394e0ca,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
3
3
  * packages/coding-agent/src/modes/interactive/components/extension-input.ts.
4
4
  * Modifications: Mechanical port: remap public imports, use ECMAScript private fields, and route the
5
5
  * bare-A1 instruction row and chrome through the shared semantic shortcut and compact padded
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.2 (MIT), commit cd32f7725fdbddbaecdff5b1e68491563394e0ca,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
3
3
  * packages/coding-agent/src/modes/interactive/components/extension-selector.ts.
4
4
  * Modifications: Mechanical port: remap public imports, use ECMAScript private fields, and route the
5
5
  * bare-A1 instruction row and chrome through the shared semantic shortcut and compact padded
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.2 (MIT), commit cd32f7725fdbddbaecdff5b1e68491563394e0ca,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
3
3
  * packages/coding-agent/src/modes/interactive/components/mermaid.ts.
4
4
  * Modifications: Mechanical pinned source port with private imports remapped to public package-root
5
5
  * types/APIs and A1-owned theme boundaries; behavior remains acceptance-tested.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.2 (MIT), commit cd32f7725fdbddbaecdff5b1e68491563394e0ca,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
3
3
  * packages/coding-agent/src/modes/interactive/components/custom-editor.ts.
4
4
  * Modifications: A1-owned class name and synchronized A1 keybinding contract replace the nominal
5
5
  * private upstream keybinding constructor dependency; bare A1 injects the shared Settings/agent input
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.2 (MIT), commit cd32f7725fdbddbaecdff5b1e68491563394e0ca,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
3
3
  * packages/coding-agent/src/modes/interactive/components/custom-editor.ts.
4
4
  * Modifications: A1-owned class name and synchronized A1 keybinding contract replace the nominal
5
5
  * private upstream keybinding constructor dependency; bare A1 injects the shared Settings/agent input
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.2 (MIT), commit cd32f7725fdbddbaecdff5b1e68491563394e0ca,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
3
3
  * packages/coding-agent/src/modes/interactive/components/pi-logo.ts.
4
4
  * Modifications: Remapped the private theme import to A1's public-backed adapter and composed the
5
5
  * fixed-color logo into the owned startup header.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.2 (MIT), commit cd32f7725fdbddbaecdff5b1e68491563394e0ca,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
3
3
  * packages/coding-agent/src/modes/interactive/components/scoped-models-selector.ts.
4
4
  * Modifications: Source-synchronized scoped-model selector port: preserve session-only toggles,
5
5
  * search, bulk/provider/reorder actions, dirty state, Ctrl+S persistence, refresh status,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.2 (MIT), commit cd32f7725fdbddbaecdff5b1e68491563394e0ca,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
3
3
  * packages/coding-agent/src/modes/interactive/components/footer.ts.
4
4
  * Modifications: Consumes neutral owned-UI view data instead of a fabricated concrete AgentSession;
5
5
  * preserves the latest physical route for virtual models; an explicit bare-A1 profile colors the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.2 (MIT), commit cd32f7725fdbddbaecdff5b1e68491563394e0ca,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
3
3
  * packages/coding-agent/src/modes/interactive/components/session-selector-search.ts.
4
4
  * Modifications: Source-synchronized session search port with only the public SessionInfo type import
5
5
  * remapped.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.2 (MIT), commit cd32f7725fdbddbaecdff5b1e68491563394e0ca,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
3
3
  * packages/coding-agent/src/modes/interactive/components/session-selector.ts.
4
4
  * Modifications: Source-synchronized session selector port: preserve threaded/current/all scope,
5
5
  * search, sort, named/path filters, rename, delete confirmation, active-session protection, loading
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.2 (MIT), commit cd32f7725fdbddbaecdff5b1e68491563394e0ca,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
3
3
  * packages/coding-agent/src/modes/interactive/components/skill-invocation-message.ts.
4
4
  * Modifications: Mechanical port uses A1's public pi-tui instance, owned theme boundary, and
5
5
  * root-instance keybinding registry because the public coding-agent component closes over a second
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.2 (MIT), commit cd32f7725fdbddbaecdff5b1e68491563394e0ca,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
3
3
  * packages/coding-agent/src/modes/interactive/components/skill-invocation-message.ts.
4
4
  * Modifications: Mechanical port uses A1's public pi-tui instance, owned theme boundary, and
5
5
  * root-instance keybinding registry because the public coding-agent component closes over a second
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.2 (MIT), commit cd32f7725fdbddbaecdff5b1e68491563394e0ca,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
3
3
  * packages/coding-agent/src/modes/interactive/components/status-indicator.ts.
4
4
  * Modifications: Mechanical source port with public package-root keybinding, Loader, and owned
5
5
  * theme/countdown imports plus ECMAScript private fields.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.2 (MIT), commit cd32f7725fdbddbaecdff5b1e68491563394e0ca,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
3
3
  * packages/coding-agent/src/modes/interactive/components/status-indicator.ts.
4
4
  * Modifications: Mechanical source port with public package-root keybinding, Loader, and owned
5
5
  * theme/countdown imports plus ECMAScript private fields.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.2 (MIT), commit cd32f7725fdbddbaecdff5b1e68491563394e0ca,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
3
3
  * packages/coding-agent/src/modes/interactive/components/themed-text.ts.
4
4
  * Modifications: Integrated invalidation-aware text into A1's owned startup header and notices;
5
5
  * repository formatting only.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.2 (MIT), commit cd32f7725fdbddbaecdff5b1e68491563394e0ca,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
3
3
  * packages/coding-agent/src/modes/interactive/components/themed-text.ts.
4
4
  * Modifications: Integrated invalidation-aware text into A1's owned startup header and notices;
5
5
  * repository formatting only.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.2 (MIT), commit cd32f7725fdbddbaecdff5b1e68491563394e0ca,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
3
3
  * packages/coding-agent/src/modes/interactive/components/thinking-selector.ts.
4
4
  * Modifications: Preserve the searchable thinking-level selector, current/default semantics,
5
5
  * selection, and focus while accepting the active bare-A1 cycle-key label from the shell, styling the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.2 (MIT), commit cd32f7725fdbddbaecdff5b1e68491563394e0ca,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
3
3
  * packages/coding-agent/src/modes/interactive/components/thinking-selector.ts.
4
4
  * Modifications: Preserve the searchable thinking-level selector, current/default semantics,
5
5
  * selection, and focus while accepting the active bare-A1 cycle-key label from the shell, styling the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.2 (MIT), commit cd32f7725fdbddbaecdff5b1e68491563394e0ca,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
3
3
  * packages/coding-agent/src/modes/interactive/components/tool-execution.ts.
4
4
  * Modifications: Retain pinned shell and actual public tool-definition renderers. Replace private
5
5
  * index-keyed image conversion with current-source ownership, serial conversion, visible fallback, and
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.2 (MIT), commit cd32f7725fdbddbaecdff5b1e68491563394e0ca,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
3
3
  * packages/coding-agent/src/modes/interactive/components/tree-selector.ts.
4
4
  * Modifications: Source-synchronized tree selector port: preserve filtering, folding, labels, copying,
5
5
  * tree navigation, key hints, focus, and viewport behavior while remapping public types/components