@timurproko/a1 0.1.1-dev.9 → 0.1.4

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/README.md +76 -15
  2. package/bin/cli.js +14 -2
  3. package/bin/module-identity.js +132 -0
  4. package/bin/ui.js +10 -0
  5. package/dist/native/darwin-arm64/manifest.json +1 -1
  6. package/dist/native/linux-x64/manifest.json +1 -1
  7. package/dist/native/win32-x64/manifest.json +2 -2
  8. package/dist/native/win32-x64/process-guardian.exe +0 -0
  9. package/dist/src/cli/capabilities.d.ts +15 -0
  10. package/dist/src/cli/capabilities.js +7 -0
  11. package/dist/src/cli/dispatch.d.ts +9 -3
  12. package/dist/src/cli/dispatch.js +104 -16
  13. package/dist/src/cli/index.d.ts +2 -0
  14. package/dist/src/cli/index.js +2 -0
  15. package/dist/src/cli/packages.d.ts +23 -0
  16. package/dist/src/cli/packages.js +84 -0
  17. package/dist/src/foundation/agent-engine-contracts/index.d.ts +1 -0
  18. package/dist/src/foundation/agent-engine-contracts/index.js +1 -0
  19. package/dist/src/foundation/agent-engine-contracts/package-ports.d.ts +54 -0
  20. package/dist/src/foundation/agent-engine-contracts/package-ports.js +31 -0
  21. package/dist/src/foundation/pi-component-adapter/shell-editor-autocomplete.js +1 -1
  22. package/dist/src/foundation/pi-component-adapter/shell-extension-ui.js +1 -1
  23. package/dist/src/foundation/pi-component-adapter/shell-footer-status.js +1 -1
  24. package/dist/src/foundation/pi-component-adapter/shell-presenters-transcript.d.ts +15 -0
  25. package/dist/src/foundation/pi-component-adapter/shell-presenters-transcript.js +34 -1
  26. package/dist/src/foundation/pi-component-adapter/shell-selectors-dialogs.js +1 -1
  27. package/dist/src/foundation/pi-component-adapter/shell-shared-facade.d.ts +1 -1
  28. package/dist/src/foundation/pi-component-adapter/shell-shared-facade.js +1 -1
  29. package/dist/src/foundation/pi-component-adapter/upstream/adjacent/core/keybindings.d.ts +2 -2
  30. package/dist/src/foundation/pi-component-adapter/upstream/adjacent/core/keybindings.js +1 -1
  31. package/dist/src/foundation/pi-component-adapter/upstream/components/countdown-timer.d.ts +1 -1
  32. package/dist/src/foundation/pi-component-adapter/upstream/components/custom-entry.d.ts +1 -1
  33. package/dist/src/foundation/pi-component-adapter/upstream/components/custom-entry.js +1 -1
  34. package/dist/src/foundation/pi-component-adapter/upstream/components/daxnuts.d.ts +1 -1
  35. package/dist/src/foundation/pi-component-adapter/upstream/components/earendil-announcement.d.ts +1 -1
  36. package/dist/src/foundation/pi-component-adapter/upstream/components/earendil-announcement.js +1 -1
  37. package/dist/src/foundation/pi-component-adapter/upstream/components/extension-editor.d.ts +1 -1
  38. package/dist/src/foundation/pi-component-adapter/upstream/components/extension-editor.js +1 -1
  39. package/dist/src/foundation/pi-component-adapter/upstream/components/first-time-setup.d.ts +1 -1
  40. package/dist/src/foundation/pi-component-adapter/upstream/components/first-time-setup.js +1 -1
  41. package/dist/src/foundation/pi-component-adapter/upstream/components/mermaid.js +1 -1
  42. package/dist/src/foundation/pi-component-adapter/upstream/components/owned-editor.d.ts +1 -1
  43. package/dist/src/foundation/pi-component-adapter/upstream/components/owned-editor.js +1 -1
  44. package/dist/src/foundation/pi-component-adapter/upstream/components/scoped-models-selector.d.ts +1 -1
  45. package/dist/src/foundation/pi-component-adapter/upstream/components/scoped-models-selector.js +1 -1
  46. package/dist/src/foundation/pi-component-adapter/upstream/components/session-footer.d.ts +1 -1
  47. package/dist/src/foundation/pi-component-adapter/upstream/components/session-footer.js +1 -1
  48. package/dist/src/foundation/pi-component-adapter/upstream/components/session-selector-search.js +1 -1
  49. package/dist/src/foundation/pi-component-adapter/upstream/components/session-selector.d.ts +1 -1
  50. package/dist/src/foundation/pi-component-adapter/upstream/components/session-selector.js +1 -1
  51. package/dist/src/foundation/pi-component-adapter/upstream/components/skill-invocation-message.d.ts +1 -1
  52. package/dist/src/foundation/pi-component-adapter/upstream/components/skill-invocation-message.js +1 -1
  53. package/dist/src/foundation/pi-component-adapter/upstream/components/status-indicator.d.ts +1 -1
  54. package/dist/src/foundation/pi-component-adapter/upstream/components/status-indicator.js +1 -1
  55. package/dist/src/foundation/pi-component-adapter/upstream/components/tree-selector.d.ts +1 -1
  56. package/dist/src/foundation/pi-component-adapter/upstream/components/tree-selector.js +1 -1
  57. package/dist/src/foundation/pi-component-adapter/upstream/components/trust-selector.d.ts +1 -1
  58. package/dist/src/foundation/pi-component-adapter/upstream/components/trust-selector.js +1 -1
  59. package/dist/src/foundation/pi-component-adapter/upstream/theme/theme.d.ts +1 -1
  60. package/dist/src/foundation/pi-component-adapter/upstream/theme/theme.js +1 -1
  61. package/dist/src/foundation/pi-engine-adapter/adapter.d.ts +8 -1
  62. package/dist/src/foundation/pi-engine-adapter/adapter.js +28 -1
  63. package/dist/src/foundation/pi-engine-adapter/index.d.ts +1 -0
  64. package/dist/src/foundation/pi-engine-adapter/index.js +1 -0
  65. package/dist/src/foundation/pi-engine-adapter/package-integration.d.ts +13 -0
  66. package/dist/src/foundation/pi-engine-adapter/package-integration.js +112 -0
  67. package/dist/src/foundation/pi-engine-adapter/runtime-integration.d.ts +18 -1
  68. package/dist/src/foundation/pi-engine-adapter/runtime-integration.js +37 -2
  69. package/dist/src/foundation/pi-owned-ui-integration/session-shell.js +14 -2
  70. package/dist/src/foundation/pi-tui-runtime-adapter/adapter.js +1 -1
  71. package/dist/src/foundation/release/release.js +26 -2
  72. package/dist/src/foundation/release/update.d.ts +11 -1
  73. package/dist/src/foundation/release/update.js +106 -5
  74. package/docs/architecture/toolchain.md +3 -3
  75. package/docs/ci-release-runbook.md +80 -40
  76. package/docs/features/launch-profiles.md +2 -0
  77. package/package.json +8 -3
@@ -2,6 +2,7 @@ export * from "./capability-ports.js";
2
2
  export * from "./domain.js";
3
3
  export * from "./domain-validation.js";
4
4
  export * from "./model.js";
5
+ export * from "./package-ports.js";
5
6
  export * from "./ports.js";
6
7
  export * from "./validation.js";
7
8
  export * from "./serialization.js";
@@ -2,6 +2,7 @@ export * from "./capability-ports.js";
2
2
  export * from "./domain.js";
3
3
  export * from "./domain-validation.js";
4
4
  export * from "./model.js";
5
+ export * from "./package-ports.js";
5
6
  export * from "./ports.js";
6
7
  export * from "./validation.js";
7
8
  export * from "./serialization.js";
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Extension packages are managed outside any session: the command that installs
3
+ * one runs before the runtime exists, against a profile root chosen by the caller
4
+ * rather than by whatever session happens to be open. So this port stands apart
5
+ * from the session-scoped service ports and names only what a package operation
6
+ * needs — a root, a source, and an outcome a caller can render without knowing
7
+ * which engine performed it.
8
+ */
9
+ export type AgentPackageOperation = "install" | "remove" | "update" | "refresh-models" | "list";
10
+ /**
11
+ * Why an operation ended, kept separate from the prose so callers can branch on
12
+ * it. `not-found` is the one failure an engine can state structurally — the source
13
+ * is not configured in this profile — rather than only in a message.
14
+ */
15
+ export type AgentPackageStatus = "completed" | "not-found" | "failed";
16
+ export interface AgentPackageDescriptor {
17
+ readonly source: string;
18
+ readonly installedPath: string | null;
19
+ /** True when the profile enables only part of what the package provides. */
20
+ readonly filtered: boolean;
21
+ }
22
+ export interface AgentPackageOutcome {
23
+ readonly operation: AgentPackageOperation;
24
+ readonly status: AgentPackageStatus;
25
+ readonly source: string | null;
26
+ readonly packages: readonly AgentPackageDescriptor[];
27
+ readonly detail: string | null;
28
+ }
29
+ export interface AgentPackageProgress {
30
+ readonly operation: AgentPackageOperation;
31
+ readonly message: string;
32
+ }
33
+ export interface AgentPackagesPort {
34
+ readonly capabilities: {
35
+ readonly install: boolean;
36
+ readonly remove: boolean;
37
+ readonly update: boolean;
38
+ readonly refreshModels: boolean;
39
+ };
40
+ /** Absolute profile root every operation of this port acts on. */
41
+ readonly profileRoot: string;
42
+ list(): Promise<AgentPackageOutcome>;
43
+ install(source: string): Promise<AgentPackageOutcome>;
44
+ remove(source: string): Promise<AgentPackageOutcome>;
45
+ update(source?: string): Promise<AgentPackageOutcome>;
46
+ refreshModels(): Promise<AgentPackageOutcome>;
47
+ }
48
+ export interface AgentPackagesPortInput {
49
+ readonly profileRoot: string;
50
+ readonly cwd: string;
51
+ readonly onProgress?: (progress: AgentPackageProgress) => void;
52
+ }
53
+ export declare function assertAgentPackagesPort(port: AgentPackagesPort): void;
54
+ export declare function agentPackageOutcome(operation: AgentPackageOperation, status: AgentPackageStatus, detail?: string | null, source?: string | null, packages?: readonly AgentPackageDescriptor[]): AgentPackageOutcome;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Extension packages are managed outside any session: the command that installs
3
+ * one runs before the runtime exists, against a profile root chosen by the caller
4
+ * rather than by whatever session happens to be open. So this port stands apart
5
+ * from the session-scoped service ports and names only what a package operation
6
+ * needs — a root, a source, and an outcome a caller can render without knowing
7
+ * which engine performed it.
8
+ */
9
+ export function assertAgentPackagesPort(port) {
10
+ if (typeof port?.capabilities !== "object" || port.capabilities === null)
11
+ throw new TypeError("packages port capabilities are required");
12
+ if (typeof port.profileRoot !== "string" || port.profileRoot.length === 0)
13
+ throw new TypeError("packages port requires an absolute profile root");
14
+ for (const operation of ["list", "install", "remove", "update", "refreshModels"]) {
15
+ if (typeof port[operation] !== "function")
16
+ throw new TypeError(`packages port requires ${operation}`);
17
+ }
18
+ for (const capability of ["install", "remove", "update", "refreshModels"]) {
19
+ if (typeof port.capabilities[capability] !== "boolean")
20
+ throw new TypeError(`packages capability ${capability} must be explicit`);
21
+ }
22
+ }
23
+ export function agentPackageOutcome(operation, status, detail, source, packages = []) {
24
+ return Object.freeze({
25
+ operation,
26
+ status,
27
+ source: source ?? null,
28
+ packages: Object.freeze([...packages]),
29
+ detail: detail ?? null,
30
+ });
31
+ }
@@ -1,5 +1,5 @@
1
1
  import { getSelectListTheme } from "@earendil-works/pi-coding-agent";
2
- import { CombinedAutocompleteProvider, setKeybindings, } from "@earendil-works/pi-tui";
2
+ import { CombinedAutocompleteProvider, setKeybindings, } from "#pi-tui";
3
3
  import { KeybindingsManager } from "./upstream/adjacent/core/keybindings.js";
4
4
  import { OwnedEditor } from "./upstream/components/owned-editor.js";
5
5
  import { PINNED_PI_LAYOUT, piTheme, } from "./theme.js";
@@ -1,6 +1,6 @@
1
1
  import { ExtensionInputComponent, ExtensionSelectorComponent, getSelectListTheme, } from "@earendil-works/pi-coding-agent";
2
2
  import { ExtensionEditorComponent, } from "./upstream/components/extension-editor.js";
3
- import { setKeybindings, Text, } from "@earendil-works/pi-tui";
3
+ import { setKeybindings, Text, } from "#pi-tui";
4
4
  import { KeybindingsManager, } from "./upstream/adjacent/core/keybindings.js";
5
5
  import { PINNED_PI_LAYOUT, applyPiTheme, applyPiThemeInstance, getAvailablePiThemes, loadPiTheme, piTheme, } from "./theme.js";
6
6
  import { componentPort, createTuiFacade, ensureTheme, isRecord, } from "./shell-shared-facade.js";
@@ -1,5 +1,5 @@
1
1
  import { rawKeyHint, VERSION } from "@earendil-works/pi-coding-agent";
2
- import { Spacer, Text, } from "@earendil-works/pi-tui";
2
+ import { Spacer, Text, } from "#pi-tui";
3
3
  import { SessionFooter } from "./upstream/components/session-footer.js";
4
4
  import { WorkingStatusIndicator } from "./upstream/components/status-indicator.js";
5
5
  import { PINNED_PI_LAYOUT, piTheme, } from "./theme.js";
@@ -37,6 +37,21 @@ export declare function createPiShellChangelog(markdown: string): PiShellCompone
37
37
  export declare function createPiShellHotkeys(): PiShellComponentPort;
38
38
  export declare function createPiShellTranscriptComponent(initial: OwnedUiTranscriptBlock, cwd: string, extensions?: PiShellExtensionRendererResolver): PiShellTranscriptComponentPort;
39
39
  export declare function renderPiShellTranscriptBlock(block: OwnedUiTranscriptBlock, width: number, cwd: string): readonly string[];
40
+ /**
41
+ * Pinned Pi's CLI prints startup diagnostics with `reportDiagnostics` before
42
+ * the banner: the whole line, prefix included, in chalk's basic ANSI severity
43
+ * colour — not the theme's tokens — with info lines dim and unprefixed.
44
+ */
45
+ export declare function renderPiShellStartupDiagnostic(diagnostic: {
46
+ readonly severity: "info" | "warning" | "error";
47
+ readonly message: string;
48
+ }, width: number): readonly string[];
49
+ /**
50
+ * Pinned Pi's `showPackageUpdateNotification` banner: warning-coloured dynamic
51
+ * borders around a bold warning title, the muted update instruction with the
52
+ * accent command, and the package list.
53
+ */
54
+ export declare function renderPiShellPackageUpdateNotice(packages: readonly string[], width: number): readonly string[];
40
55
  type PiAssistantMessage = NonNullable<ConstructorParameters<typeof AssistantMessageComponent>[0]>;
41
56
  export declare function validatedAssistantMessage(block: OwnedUiTranscriptBlock): PiAssistantMessage;
42
57
  export {};
@@ -1,6 +1,6 @@
1
1
  import { AssistantMessageComponent, BashExecutionComponent, CompactionSummaryMessageComponent, CustomMessageComponent, DynamicBorder, getMarkdownTheme, parseSkillBlock, ToolExecutionComponent, UserMessageComponent, } from "@earendil-works/pi-coding-agent";
2
2
  import { SkillInvocationMessageComponent, } from "./upstream/components/skill-invocation-message.js";
3
- import { Container, Markdown, Spacer, Text, } from "@earendil-works/pi-tui";
3
+ import { Container, Markdown, Spacer, Text, } from "#pi-tui";
4
4
  import { KeybindingsManager, } from "./upstream/adjacent/core/keybindings.js";
5
5
  import { PINNED_PI_LAYOUT, piTheme, } from "./theme.js";
6
6
  import { componentPort, createTuiFacade, ensureTheme, formatSessionTokens, isRecord, } from "./shell-shared-facade.js";
@@ -141,6 +141,39 @@ export function renderPiShellTranscriptBlock(block, width, cwd) {
141
141
  ensureTheme();
142
142
  return transcriptComponent(block, cwd, true).render(width);
143
143
  }
144
+ /**
145
+ * Pinned Pi's CLI prints startup diagnostics with `reportDiagnostics` before
146
+ * the banner: the whole line, prefix included, in chalk's basic ANSI severity
147
+ * colour — not the theme's tokens — with info lines dim and unprefixed.
148
+ */
149
+ export function renderPiShellStartupDiagnostic(diagnostic, width) {
150
+ ensureTheme();
151
+ const escape = String.fromCharCode(27);
152
+ const chalk = diagnostic.severity === "error"
153
+ ? { open: `${escape}[31m`, close: `${escape}[39m`, prefix: "Error: " }
154
+ : diagnostic.severity === "warning"
155
+ ? { open: `${escape}[33m`, close: `${escape}[39m`, prefix: "Warning: " }
156
+ : { open: `${escape}[2m`, close: `${escape}[22m`, prefix: "" };
157
+ return new Text(`${chalk.open}${chalk.prefix}${diagnostic.message}${chalk.close}`, 0, 0).render(width);
158
+ }
159
+ /**
160
+ * Pinned Pi's `showPackageUpdateNotification` banner: warning-coloured dynamic
161
+ * borders around a bold warning title, the muted update instruction with the
162
+ * accent command, and the package list.
163
+ */
164
+ export function renderPiShellPackageUpdateNotice(packages, width) {
165
+ ensureTheme();
166
+ const theme = piTheme();
167
+ const container = new Container();
168
+ container.addChild(new Spacer(1));
169
+ container.addChild(new DynamicBorder(text => theme.fg("warning", text)));
170
+ container.addChild(new Text(`${theme.bold(theme.fg("warning", "Package Updates Available"))}\n`
171
+ + `${theme.fg("muted", "Package updates are available. Run ")}${theme.fg("accent", "pi update --extensions")}\n`
172
+ + `${theme.fg("muted", "Packages:")}\n`
173
+ + packages.map(name => `- ${name}`).join("\n"), 1, 0));
174
+ container.addChild(new DynamicBorder(text => theme.fg("warning", text)));
175
+ return container.render(width);
176
+ }
144
177
  function transcriptComponent(block, cwd, expanded, extensions) {
145
178
  switch (block.kind) {
146
179
  case "user": {
@@ -3,7 +3,7 @@ import { DaxnutsComponent, } from "./upstream/components/daxnuts.js";
3
3
  import { EarendilAnnouncementComponent, } from "./upstream/components/earendil-announcement.js";
4
4
  import { SessionSelectorComponent, } from "./upstream/components/session-selector.js";
5
5
  import { TreeSelectorComponent, } from "./upstream/components/tree-selector.js";
6
- import { Box, Container, SelectList, Spacer, Text, } from "@earendil-works/pi-tui";
6
+ import { Box, Container, SelectList, Spacer, Text, } from "#pi-tui";
7
7
  import { ScopedModelsSelectorComponent, } from "./upstream/components/scoped-models-selector.js";
8
8
  import { TrustSelectorComponent, } from "./upstream/components/trust-selector.js";
9
9
  import { PINNED_PI_LAYOUT, piTheme, } from "./theme.js";
@@ -1,4 +1,4 @@
1
- import { type AutocompleteProvider, type Component, type TUI } from "@earendil-works/pi-tui";
1
+ import { type AutocompleteProvider, type Component, type TUI } from "#pi-tui";
2
2
  import type { OwnedUiSessionViewModel, OwnedUiThinkingLevel, OwnedUiTranscriptBlock } from "../owned-ui-contracts/index.js";
3
3
  export interface PiShellComponentPort {
4
4
  render(width: number): readonly string[];
@@ -1,4 +1,4 @@
1
- import { setKeybindings, } from "@earendil-works/pi-tui";
1
+ import { setKeybindings, } from "#pi-tui";
2
2
  import { KeybindingsManager, } from "./upstream/adjacent/core/keybindings.js";
3
3
  import { ensurePiTheme, } from "./theme.js";
4
4
  // Pinned from packages/coding-agent/src/core/slash-commands.ts at 914cf14.
@@ -1,5 +1,5 @@
1
1
  /** Source-synchronized from Pi 0.84.2 packages/coding-agent/src/core/keybindings.ts. */
2
- import { type Keybinding, type KeybindingsConfig, type KeyId, KeybindingsManager as TuiKeybindingsManager } from "@earendil-works/pi-tui";
2
+ import { type Keybinding, type KeybindingsConfig, type KeyId, KeybindingsManager as TuiKeybindingsManager } from "#pi-tui";
3
3
  export interface AppKeybindings {
4
4
  "app.interrupt": true;
5
5
  "app.clear": true;
@@ -45,7 +45,7 @@ export interface AppKeybindings {
45
45
  "app.tree.filter.cycleBackward": true;
46
46
  }
47
47
  export type AppKeybinding = keyof AppKeybindings;
48
- declare module "@earendil-works/pi-tui" {
48
+ declare module "#pi-tui" {
49
49
  interface Keybindings extends AppKeybindings {
50
50
  }
51
51
  }
@@ -1,5 +1,5 @@
1
1
  /** Source-synchronized from Pi 0.84.2 packages/coding-agent/src/core/keybindings.ts. */
2
- import { TUI_KEYBINDINGS, KeybindingsManager as TuiKeybindingsManager, } from "@earendil-works/pi-tui";
2
+ import { TUI_KEYBINDINGS, KeybindingsManager as TuiKeybindingsManager, } from "#pi-tui";
3
3
  import { existsSync, readFileSync } from "node:fs";
4
4
  import { join } from "node:path";
5
5
  import { getAgentDir } from "@earendil-works/pi-coding-agent";
@@ -2,7 +2,7 @@
2
2
  * Source-synchronized from Pi 0.84.2
3
3
  * packages/coding-agent/src/modes/interactive/components/countdown-timer.ts
4
4
  */
5
- import type { TUI } from "@earendil-works/pi-tui";
5
+ import type { TUI } from "#pi-tui";
6
6
  export declare class CountdownTimer {
7
7
  #private;
8
8
  constructor(timeoutMs: number, tui: TUI | undefined, onTick: (seconds: number) => void, onExpire: () => void);
@@ -1,4 +1,4 @@
1
- import { Container } from "@earendil-works/pi-tui";
1
+ import { Container } from "#pi-tui";
2
2
  import type { CustomEntry, EntryRenderer } from "@earendil-works/pi-coding-agent";
3
3
  /**
4
4
  * Component that renders a custom session entry from extensions.
@@ -1,4 +1,4 @@
1
- import { Box, Container, Spacer, Text } from "@earendil-works/pi-tui";
1
+ import { Box, Container, Spacer, Text } from "#pi-tui";
2
2
  import { piTheme } from "../theme/theme.js";
3
3
  /**
4
4
  * Component that renders a custom session entry from extensions.
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * A heartfelt tribute to dax (@thdxr) for providing free Kimi K2.5 access via OpenCode.
5
5
  */
6
- import type { Component, TUI } from "@earendil-works/pi-tui";
6
+ import type { Component, TUI } from "#pi-tui";
7
7
  export declare class DaxnutsComponent implements Component {
8
8
  private ui;
9
9
  private image;
@@ -1,4 +1,4 @@
1
- import { Container } from "@earendil-works/pi-tui";
1
+ import { Container } from "#pi-tui";
2
2
  export declare class EarendilAnnouncementComponent extends Container {
3
3
  constructor();
4
4
  }
@@ -1,7 +1,7 @@
1
1
  // Mechanically adapted from Pi commit 914cf14
2
2
  // packages/coding-agent/src/modes/interactive/components/earendil-announcement.ts (MIT).
3
3
  // Local modifications: remap private imports to public package-root/owned theme boundaries and omit optional package-private imagery.
4
- import { Container, Spacer, Text } from "@earendil-works/pi-tui";
4
+ import { Container, Spacer, Text } from "#pi-tui";
5
5
  import { DynamicBorder } from "@earendil-works/pi-coding-agent";
6
6
  import { piTheme } from "../theme/theme.js";
7
7
  const BLOG_URL = "https://mariozechner.at/posts/2026-04-08-ive-sold-out/";
@@ -3,7 +3,7 @@
3
3
  * packages/coding-agent/src/modes/interactive/components/extension-editor.ts (MIT).
4
4
  * Modifications: root public pi-tui singleton, owned keybindings/theme seam, owned external-editor import.
5
5
  */
6
- import { Container, type TUI } from "@earendil-works/pi-tui";
6
+ import { Container, type TUI } from "#pi-tui";
7
7
  import type { KeybindingsManager } from "../adjacent/core/keybindings.js";
8
8
  export declare class ExtensionEditorComponent extends Container {
9
9
  #private;
@@ -3,7 +3,7 @@
3
3
  * packages/coding-agent/src/modes/interactive/components/extension-editor.ts (MIT).
4
4
  * Modifications: root public pi-tui singleton, owned keybindings/theme seam, owned external-editor import.
5
5
  */
6
- import { Container, Editor, Spacer, Text, } from "@earendil-works/pi-tui";
6
+ import { Container, Editor, Spacer, Text, } from "#pi-tui";
7
7
  import { DynamicBorder, getSelectListTheme } from "@earendil-works/pi-coding-agent";
8
8
  import { editInExternalEditor } from "../external-editor.js";
9
9
  import { piTheme } from "../../theme.js";
@@ -1,4 +1,4 @@
1
- import { Container } from "@earendil-works/pi-tui";
1
+ import { Container } from "#pi-tui";
2
2
  export type TerminalTheme = "dark" | "light";
3
3
  export interface FirstTimeSetupResult {
4
4
  theme: TerminalTheme;
@@ -1,7 +1,7 @@
1
1
  // Mechanically adapted from Pi commit 914cf14
2
2
  // packages/coding-agent/src/modes/interactive/components/first-time-setup.ts (MIT).
3
3
  // Local modifications: remap private imports to public package-root or owned theme boundaries.
4
- import { Container, getKeybindings, Spacer, Text } from "@earendil-works/pi-tui";
4
+ import { Container, getKeybindings, Spacer, Text } from "#pi-tui";
5
5
  import { DynamicBorder, keyHint, rawKeyHint } from "@earendil-works/pi-coding-agent";
6
6
  import { piTheme } from "../theme/theme.js";
7
7
  const APP_NAME = "pi";
@@ -1,7 +1,7 @@
1
1
  // Mechanically adapted from Pi commit 914cf14
2
2
  // packages/coding-agent/src/modes/interactive/components/mermaid.ts (MIT).
3
3
  // Local modifications: remap private imports to public package-root or owned theme boundaries.
4
- import { Marked } from "@earendil-works/pi-tui";
4
+ import { Marked } from "#pi-tui";
5
5
  import { render } from "grok-mermaid";
6
6
  const markdownParser = new Marked();
7
7
  function isMermaid(token) {
@@ -3,7 +3,7 @@
3
3
  * packages/coding-agent/src/modes/interactive/components/custom-editor.ts (MIT).
4
4
  * Modifications: A1-owned class name and A1-owned synchronized keybinding contract.
5
5
  */
6
- import { Editor, type EditorOptions, type EditorTheme, type TUI } from "@earendil-works/pi-tui";
6
+ import { Editor, type EditorOptions, type EditorTheme, type TUI } from "#pi-tui";
7
7
  import type { AppKeybinding, KeybindingsManager } from "../adjacent/core/keybindings.js";
8
8
  export declare class OwnedEditor extends Editor {
9
9
  private readonly keybindings;
@@ -3,7 +3,7 @@
3
3
  * packages/coding-agent/src/modes/interactive/components/custom-editor.ts (MIT).
4
4
  * Modifications: A1-owned class name and A1-owned synchronized keybinding contract.
5
5
  */
6
- import { Editor } from "@earendil-works/pi-tui";
6
+ import { Editor } from "#pi-tui";
7
7
  export class OwnedEditor extends Editor {
8
8
  keybindings;
9
9
  actionHandlers = new Map();
@@ -8,7 +8,7 @@ interface ScopedModel {
8
8
  readonly id: string;
9
9
  readonly name?: string;
10
10
  }
11
- import { Container, type Focusable, Input } from "@earendil-works/pi-tui";
11
+ import { Container, type Focusable, Input } from "#pi-tui";
12
12
  export interface ModelsConfig {
13
13
  allModels: ScopedModel[];
14
14
  enabledModelIds: string[] | null;
@@ -1,4 +1,4 @@
1
- import { Container, fuzzyFilter, getKeybindings, Input, Key, matchesKey, Spacer, Text, } from "@earendil-works/pi-tui";
1
+ import { Container, fuzzyFilter, getKeybindings, Input, Key, matchesKey, Spacer, Text, } from "#pi-tui";
2
2
  import { DynamicBorder } from "@earendil-works/pi-coding-agent";
3
3
  import { getModelSearchText } from "../model-search.js";
4
4
  import { piTheme } from "../theme/theme.js";
@@ -1,4 +1,4 @@
1
- import { type Component } from "@earendil-works/pi-tui";
1
+ import { type Component } from "#pi-tui";
2
2
  import type { OwnedUiSessionViewModel } from "../../../owned-ui-contracts/index.js";
3
3
  export declare class SessionFooter implements Component {
4
4
  private readonly getView;
@@ -4,7 +4,7 @@
4
4
  * Modifications: consumes neutral owned-UI view data rather than a concrete AgentSession.
5
5
  */
6
6
  import { isAbsolute, relative, resolve, sep } from "node:path";
7
- import { truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
7
+ import { truncateToWidth, visibleWidth } from "#pi-tui";
8
8
  import { piTheme } from "../../theme.js";
9
9
  export class SessionFooter {
10
10
  getView;
@@ -3,7 +3,7 @@
3
3
  * packages/coding-agent/src/modes/interactive/components/session-selector-search.ts
4
4
  * Mechanical change: public SessionInfo type import.
5
5
  */
6
- import { fuzzyMatch } from "@earendil-works/pi-tui";
6
+ import { fuzzyMatch } from "#pi-tui";
7
7
  function normalizeWhitespaceLower(text) {
8
8
  return text.toLowerCase().replace(/\s+/g, " ").trim();
9
9
  }
@@ -1,4 +1,4 @@
1
- import { type Component, Container, type Focusable } from "@earendil-works/pi-tui";
1
+ import { type Component, Container, type Focusable } from "#pi-tui";
2
2
  import { KeybindingsManager } from "../adjacent/core/keybindings.js";
3
3
  import { type SessionInfo } from "@earendil-works/pi-coding-agent";
4
4
  type SessionListProgress = (loaded: number, total: number) => void;
@@ -7,7 +7,7 @@ import { spawnSync } from "node:child_process";
7
7
  import { existsSync, realpathSync } from "node:fs";
8
8
  import { unlink } from "node:fs/promises";
9
9
  import * as os from "node:os";
10
- import { Container, getKeybindings, Input, Spacer, Text, truncateToWidth, visibleWidth, } from "@earendil-works/pi-tui";
10
+ import { Container, getKeybindings, Input, Spacer, Text, truncateToWidth, visibleWidth, } from "#pi-tui";
11
11
  import { KeybindingsManager } from "../adjacent/core/keybindings.js";
12
12
  import { DynamicBorder } from "@earendil-works/pi-coding-agent";
13
13
  import { piTheme } from "../theme/theme.js";
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * Modified only to use A1's public pi-tui instance and owned theme boundary.
6
6
  */
7
- import { Box, type MarkdownTheme } from "@earendil-works/pi-tui";
7
+ import { Box, type MarkdownTheme } from "#pi-tui";
8
8
  export interface SkillInvocationBlock {
9
9
  readonly name: string;
10
10
  readonly content: string;
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * Modified only to use A1's public pi-tui instance and owned theme boundary.
6
6
  */
7
- import { Box, getKeybindings, Markdown, Text } from "@earendil-works/pi-tui";
7
+ import { Box, getKeybindings, Markdown, Text } from "#pi-tui";
8
8
  import { piTheme } from "../theme/theme.js";
9
9
  export class SkillInvocationMessageComponent extends Box {
10
10
  skillBlock;
@@ -2,7 +2,7 @@
2
2
  * Source-synchronized from Pi 0.84.2
3
3
  * packages/coding-agent/src/modes/interactive/components/status-indicator.ts
4
4
  */
5
- import { type Component, Loader, type LoaderIndicatorOptions, type TUI } from "@earendil-works/pi-tui";
5
+ import { type Component, Loader, type LoaderIndicatorOptions, type TUI } from "#pi-tui";
6
6
  export type StatusIndicatorKind = "working" | "retry" | "compaction" | "branchSummary";
7
7
  export declare class StatusIndicator extends Loader {
8
8
  readonly kind: StatusIndicatorKind;
@@ -2,7 +2,7 @@
2
2
  * Source-synchronized from Pi 0.84.2
3
3
  * packages/coding-agent/src/modes/interactive/components/status-indicator.ts
4
4
  */
5
- import { Loader } from "@earendil-works/pi-tui";
5
+ import { Loader } from "#pi-tui";
6
6
  import { keyText } from "@earendil-works/pi-coding-agent";
7
7
  import { piTheme } from "../theme/theme.js";
8
8
  import { CountdownTimer } from "./countdown-timer.js";
@@ -3,7 +3,7 @@
3
3
  * packages/coding-agent/src/modes/interactive/components/tree-selector.ts
4
4
  * Mechanical changes: public component/type imports and owned keybindings/theme helpers.
5
5
  */
6
- import { type Component, Container, type Focusable } from "@earendil-works/pi-tui";
6
+ import { type Component, Container, type Focusable } from "#pi-tui";
7
7
  import { type SessionTreeNode } from "@earendil-works/pi-coding-agent";
8
8
  /** Filter mode for tree display */
9
9
  export type FilterMode = "default" | "no-tools" | "user-only" | "labeled-only" | "all";
@@ -3,7 +3,7 @@
3
3
  * packages/coding-agent/src/modes/interactive/components/tree-selector.ts
4
4
  * Mechanical changes: public component/type imports and owned keybindings/theme helpers.
5
5
  */
6
- import { Container, Input, Spacer, sliceByColumn, Text, truncateToWidth, visibleWidth, wrapTextWithAnsi, } from "@earendil-works/pi-tui";
6
+ import { Container, Input, Spacer, sliceByColumn, Text, truncateToWidth, visibleWidth, wrapTextWithAnsi, } from "#pi-tui";
7
7
  import { DynamicBorder } from "@earendil-works/pi-coding-agent";
8
8
  import { KeybindingsManager } from "../adjacent/core/keybindings.js";
9
9
  import { piTheme } from "../theme/theme.js";
@@ -1,4 +1,4 @@
1
- import { Container } from "@earendil-works/pi-tui";
1
+ import { Container } from "#pi-tui";
2
2
  export interface TrustDecision {
3
3
  readonly path: string;
4
4
  readonly decision: boolean;
@@ -2,7 +2,7 @@
2
2
  // packages/coding-agent/src/modes/interactive/components/trust-selector.ts (MIT).
3
3
  // Local modifications: inject trust options and remap theme/import boundaries.
4
4
  import { DynamicBorder, keyHint, rawKeyHint } from "@earendil-works/pi-coding-agent";
5
- import { Container, getKeybindings, Spacer, Text } from "@earendil-works/pi-tui";
5
+ import { Container, getKeybindings, Spacer, Text } from "#pi-tui";
6
6
  import { piTheme } from "../theme/theme.js";
7
7
  function formatDecision(trustPath, decision) {
8
8
  if (decision === null)
@@ -1,5 +1,5 @@
1
1
  import { Theme } from "@earendil-works/pi-coding-agent";
2
- import { type RgbColor } from "@earendil-works/pi-tui";
2
+ import { type RgbColor } from "#pi-tui";
3
3
  export declare const PINNED_PI_LAYOUT: Readonly<{
4
4
  readonly editorPaddingX: 0;
5
5
  readonly outputPad: 1;
@@ -1,7 +1,7 @@
1
1
  import { existsSync, readFileSync, readdirSync, watch } from "node:fs";
2
2
  import { join } from "node:path";
3
3
  import { getAgentDir, initTheme, Theme, } from "@earendil-works/pi-coding-agent";
4
- import { getCapabilities } from "@earendil-works/pi-tui";
4
+ import { getCapabilities } from "#pi-tui";
5
5
  import { BUILTIN_THEME_RESOURCES, isBuiltinThemeName } from "../../resources/builtin-themes.js";
6
6
  export const PINNED_PI_LAYOUT = Object.freeze({
7
7
  editorPaddingX: 0,
@@ -1,4 +1,4 @@
1
- import { type AgentSessionRuntime, type SessionInfo } from "@earendil-works/pi-coding-agent";
1
+ import { type AgentSessionRuntime, type AgentSessionServices, type SessionInfo } from "@earendil-works/pi-coding-agent";
2
2
  import { OWNED_UI_EXTENSION_CONTRACT_VERSION, OWNED_UI_EXTENSION_RENDER_CALLBACKS, OWNED_UI_EXTENSION_UI_CALLBACKS, OWNED_UI_EXTENSION_UI_PROPERTIES, type OwnedUiCommand, type OwnedUiCommandOutcome, type OwnedUiEvent, type OwnedUiSessionViewModel, type OwnedUiSnapshot } from "../owned-ui-contracts/index.js";
3
3
  import { type PiAuthenticationProviderOption, type PiBashWorkflowResult, type PiPinnedSettingsCallback, type PiPinnedSettingsSnapshot, type PiWorkflowAutocompleteCommand, type PiWorkflowHost, type PiWorkflowInteractionHost, type PiWorkflowOption, type PiWorkflowRequest, type PiWorkflowResult } from "./workflows.js";
4
4
  import type { AgentSettingsPort } from "../agent-engine-contracts/index.js";
@@ -51,6 +51,7 @@ export interface PiScopedModelsRefreshResult extends PiScopedModelsContext {
51
51
  readonly status: string;
52
52
  readonly statusKind: "success" | "warning";
53
53
  }
54
+ type PiServicesApi = AgentSessionServices;
54
55
  export type PiEngineRuntimeFactory = (input: PiEngineRuntimeFactoryInput) => Promise<AgentSessionRuntime>;
55
56
  export interface OwnedPiResourceSummary {
56
57
  readonly kind: "skill" | "prompt-template" | "agent-context" | "system-prompt" | "theme";
@@ -90,6 +91,11 @@ export interface PiEngineAdapterOptions {
90
91
  * offering stay here.
91
92
  */
92
93
  readonly availableThemes?: () => readonly string[];
94
+ /**
95
+ * Startup extension-package update probe, mirroring pinned Pi's interactive
96
+ * mode. Returns display names of packages with updates available.
97
+ */
98
+ readonly checkPackageUpdates?: (settingsManager: PiServicesApi["settingsManager"]) => Promise<readonly string[]>;
93
99
  }
94
100
  export interface AdapterCommandResult {
95
101
  readonly outcome: OwnedUiCommandOutcome;
@@ -155,3 +161,4 @@ export declare class PiEngineAdapter {
155
161
  dispose(): Promise<void>;
156
162
  }
157
163
  export declare function createPiEngineAdapter(options?: PiEngineAdapterOptions): Promise<PiEngineAdapter>;
164
+ export {};