pi-extmgr 0.2.2 → 0.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-extmgr",
3
- "version": "0.2.2",
3
+ "version": "0.3.0",
4
4
  "description": "Enhanced UX for managing local Pi extensions and community packages",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -44,13 +44,13 @@
44
44
  "image": "https://i.imgur.com/Ce513Br.png"
45
45
  },
46
46
  "peerDependencies": {
47
- "@mariozechner/pi-coding-agent": "*",
48
- "@mariozechner/pi-tui": "*"
47
+ "@earendil-works/pi-coding-agent": "*",
48
+ "@earendil-works/pi-tui": "*"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@biomejs/biome": "^2.4.9",
52
- "@mariozechner/pi-coding-agent": "^0.70.6",
53
- "@mariozechner/pi-tui": "^0.70.6",
52
+ "@earendil-works/pi-coding-agent": "^0.74.0",
53
+ "@earendil-works/pi-tui": "^0.74.0",
54
54
  "@release-it/conventional-changelog": "^10.0.5",
55
55
  "@types/node": "^22.19.10",
56
56
  "husky": "^9.1.7",
@@ -2,7 +2,7 @@ import {
2
2
  type ExtensionAPI,
3
3
  type ExtensionCommandContext,
4
4
  type ExtensionContext,
5
- } from "@mariozechner/pi-coding-agent";
5
+ } from "@earendil-works/pi-coding-agent";
6
6
  import {
7
7
  disableAutoUpdate,
8
8
  enableAutoUpdate,
@@ -1,4 +1,4 @@
1
- import { type ExtensionAPI, type ExtensionCommandContext } from "@mariozechner/pi-coding-agent";
1
+ import { type ExtensionAPI, type ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
2
2
  import { clearSearchCache } from "../packages/discovery.js";
3
3
  import { clearRemotePackageInfoCache } from "../ui/remote.js";
4
4
  import { clearCache } from "../utils/cache.js";
@@ -1,4 +1,4 @@
1
- import { type ExtensionAPI, type ExtensionCommandContext } from "@mariozechner/pi-coding-agent";
1
+ import { type ExtensionAPI, type ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
2
2
  import {
3
3
  type ChangeAction,
4
4
  formatChangeEntry,
@@ -1,4 +1,4 @@
1
- import { type ExtensionAPI, type ExtensionCommandContext } from "@mariozechner/pi-coding-agent";
1
+ import { type ExtensionAPI, type ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
2
2
  import { type InstallScope, installPackage } from "../packages/install.js";
3
3
  import { notify } from "../utils/notify.js";
4
4
 
@@ -1,5 +1,5 @@
1
- import { type ExtensionAPI, type ExtensionCommandContext } from "@mariozechner/pi-coding-agent";
2
- import { type AutocompleteItem } from "@mariozechner/pi-tui";
1
+ import { type ExtensionAPI, type ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
2
+ import { type AutocompleteItem } from "@earendil-works/pi-tui";
3
3
  import {
4
4
  promptRemove,
5
5
  removePackage,
@@ -1,4 +1,4 @@
1
- import { type ExtensionAPI, type ExtensionCommandContext } from "@mariozechner/pi-coding-agent";
1
+ import { type ExtensionAPI, type ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
2
2
 
3
3
  export type CommandId =
4
4
  | "local"
package/src/index.ts CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  type ExtensionAPI,
8
8
  type ExtensionCommandContext,
9
9
  type ExtensionContext,
10
- } from "@mariozechner/pi-coding-agent";
10
+ } from "@earendil-works/pi-coding-agent";
11
11
  import { createAutoUpdateNotificationHandler } from "./commands/auto-update.js";
12
12
  import {
13
13
  getExtensionsAutocompleteItems,
@@ -4,7 +4,7 @@ import {
4
4
  type PackageSource,
5
5
  type ProgressEvent,
6
6
  SettingsManager,
7
- } from "@mariozechner/pi-coding-agent";
7
+ } from "@earendil-works/pi-coding-agent";
8
8
  import { type InstalledPackage, type Scope } from "../types/index.js";
9
9
  import { normalizePackageIdentity, parsePackageNameAndVersion } from "../utils/package-source.js";
10
10
 
@@ -8,7 +8,7 @@ import {
8
8
  type ExtensionCommandContext,
9
9
  type ExtensionContext,
10
10
  getAgentDir,
11
- } from "@mariozechner/pi-coding-agent";
11
+ } from "@earendil-works/pi-coding-agent";
12
12
  import { CACHE_TTL, TIMEOUTS } from "../constants.js";
13
13
  import { type InstalledPackage, type NpmPackage, type SearchCache } from "../types/index.js";
14
14
  import { parseNpmSource } from "../utils/format.js";
@@ -5,7 +5,7 @@ import { homedir } from "node:os";
5
5
  import { dirname, join, relative, resolve } from "node:path";
6
6
  import { fileURLToPath } from "node:url";
7
7
  import { promisify } from "node:util";
8
- import { getAgentDir } from "@mariozechner/pi-coding-agent";
8
+ import { getAgentDir } from "@earendil-works/pi-coding-agent";
9
9
  import {
10
10
  type InstalledPackage,
11
11
  type PackageExtensionEntry,
@@ -8,7 +8,7 @@ import {
8
8
  type ExtensionAPI,
9
9
  type ExtensionCommandContext,
10
10
  type ProgressEvent,
11
- } from "@mariozechner/pi-coding-agent";
11
+ } from "@earendil-works/pi-coding-agent";
12
12
  import { TIMEOUTS } from "../constants.js";
13
13
  import { runTaskWithLoader } from "../ui/async-task.js";
14
14
  import { parseChoiceByLabel } from "../utils/command.js";
@@ -6,7 +6,7 @@ import {
6
6
  type ExtensionCommandContext,
7
7
  getAgentDir,
8
8
  type ProgressEvent,
9
- } from "@mariozechner/pi-coding-agent";
9
+ } from "@earendil-works/pi-coding-agent";
10
10
  import { UI } from "../constants.js";
11
11
  import { type InstalledPackage } from "../types/index.js";
12
12
  import { runTaskWithLoader } from "../ui/async-task.js";
@@ -3,8 +3,15 @@ import {
3
3
  type ExtensionCommandContext,
4
4
  type ExtensionContext,
5
5
  type Theme,
6
- } from "@mariozechner/pi-coding-agent";
7
- import { CancellableLoader, Container, Loader, Spacer, Text, type TUI } from "@mariozechner/pi-tui";
6
+ } from "@earendil-works/pi-coding-agent";
7
+ import {
8
+ CancellableLoader,
9
+ Container,
10
+ Loader,
11
+ Spacer,
12
+ Text,
13
+ type TUI,
14
+ } from "@earendil-works/pi-tui";
8
15
  import { hasCustomUI } from "../utils/mode.js";
9
16
 
10
17
  type AnyContext = ExtensionCommandContext | ExtensionContext;
package/src/ui/help.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Help display
3
3
  */
4
- import { type ExtensionCommandContext } from "@mariozechner/pi-coding-agent";
4
+ import { type ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
5
5
  import { notify } from "../utils/notify.js";
6
6
 
7
7
  export function showHelp(ctx: ExtensionCommandContext): void {
@@ -7,7 +7,7 @@ import {
7
7
  type ExtensionCommandContext,
8
8
  getSettingsListTheme,
9
9
  type Theme,
10
- } from "@mariozechner/pi-coding-agent";
10
+ } from "@earendil-works/pi-coding-agent";
11
11
  import {
12
12
  Container,
13
13
  Key,
@@ -16,7 +16,7 @@ import {
16
16
  SettingsList,
17
17
  Spacer,
18
18
  Text,
19
- } from "@mariozechner/pi-tui";
19
+ } from "@earendil-works/pi-tui";
20
20
  import { UI } from "../constants.js";
21
21
  import {
22
22
  applyPackageExtensionStateChanges,
package/src/ui/remote.ts CHANGED
@@ -5,13 +5,13 @@ import {
5
5
  DynamicBorder,
6
6
  type ExtensionAPI,
7
7
  type ExtensionCommandContext,
8
+ type KeybindingsManager,
8
9
  type Theme,
9
- } from "@mariozechner/pi-coding-agent";
10
+ } from "@earendil-works/pi-coding-agent";
10
11
  import {
11
12
  Container,
12
13
  fuzzyMatch,
13
14
  type Focusable,
14
- getKeybindings,
15
15
  Input,
16
16
  Key,
17
17
  matchesKey,
@@ -19,7 +19,7 @@ import {
19
19
  Text,
20
20
  truncateToWidth,
21
21
  wrapTextWithAnsi,
22
- } from "@mariozechner/pi-tui";
22
+ } from "@earendil-works/pi-tui";
23
23
  import { CACHE_LIMITS, PAGE_SIZE, TIMEOUTS, UI } from "../constants.js";
24
24
  import {
25
25
  clearSearchCache,
@@ -552,6 +552,7 @@ class RemotePackageBrowser implements Focusable {
552
552
  constructor(
553
553
  private readonly packages: NpmPackage[],
554
554
  private readonly theme: Theme,
555
+ private readonly keybindings: KeybindingsManager,
555
556
  private readonly browseSource: RemoteBrowseSource,
556
557
  private readonly queryLabel: string,
557
558
  private readonly totalResults: number,
@@ -578,8 +579,6 @@ class RemotePackageBrowser implements Focusable {
578
579
  }
579
580
 
580
581
  handleBrowseInput(data: string): boolean {
581
- const kb = getKeybindings();
582
-
583
582
  if (this.searchActive) {
584
583
  if (matchesKey(data, Key.enter)) {
585
584
  this.searchActive = false;
@@ -606,22 +605,22 @@ class RemotePackageBrowser implements Focusable {
606
605
  return true;
607
606
  }
608
607
 
609
- if (kb.matches(data, "tui.select.up")) {
608
+ if (this.keybindings.matches(data, "tui.select.up")) {
610
609
  this.moveSelection(-1);
611
610
  return true;
612
611
  }
613
612
 
614
- if (kb.matches(data, "tui.select.down")) {
613
+ if (this.keybindings.matches(data, "tui.select.down")) {
615
614
  this.moveSelection(1);
616
615
  return true;
617
616
  }
618
617
 
619
- if (kb.matches(data, "tui.select.pageUp")) {
618
+ if (this.keybindings.matches(data, "tui.select.pageUp")) {
620
619
  this.moveSelection(-Math.max(1, this.maxVisibleItems - 1));
621
620
  return true;
622
621
  }
623
622
 
624
- if (kb.matches(data, "tui.select.pageDown")) {
623
+ if (this.keybindings.matches(data, "tui.select.pageDown")) {
625
624
  this.moveSelection(Math.max(1, this.maxVisibleItems - 1));
626
625
  return true;
627
626
  }
@@ -811,12 +810,13 @@ async function selectBrowseAction(
811
810
  if (!ctx.hasUI) return undefined;
812
811
 
813
812
  return runCustomUI(ctx, "Remote package browsing", () =>
814
- ctx.ui.custom<BrowseAction>((tui, theme, _keybindings, done) => {
813
+ ctx.ui.custom<BrowseAction>((tui, theme, keybindings, done) => {
815
814
  const container = new Container();
816
815
  const title = new Text("", 2, 0);
817
816
  const browser = new RemotePackageBrowser(
818
817
  packages,
819
818
  theme,
819
+ keybindings,
820
820
  browseSource,
821
821
  plan.displayQuery,
822
822
  totalResults,
package/src/ui/theme.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Theme utilities for consistent UI styling across dark/light themes
3
3
  */
4
- import { type Theme } from "@mariozechner/pi-coding-agent";
4
+ import { type Theme } from "@earendil-works/pi-coding-agent";
5
5
 
6
6
  /**
7
7
  * Status icons that work across themes
package/src/ui/unified.ts CHANGED
@@ -8,13 +8,13 @@ import {
8
8
  DynamicBorder,
9
9
  type ExtensionAPI,
10
10
  type ExtensionCommandContext,
11
+ type KeybindingsManager,
11
12
  type Theme,
12
- } from "@mariozechner/pi-coding-agent";
13
+ } from "@earendil-works/pi-coding-agent";
13
14
  import {
14
15
  Container,
15
16
  type Focusable,
16
17
  fuzzyMatch,
17
- getKeybindings,
18
18
  Input,
19
19
  Key,
20
20
  matchesKey,
@@ -22,7 +22,7 @@ import {
22
22
  Text,
23
23
  truncateToWidth,
24
24
  wrapTextWithAnsi,
25
- } from "@mariozechner/pi-tui";
25
+ } from "@earendil-works/pi-tui";
26
26
  import { UI } from "../constants.js";
27
27
  import {
28
28
  discoverExtensions,
@@ -164,7 +164,7 @@ async function showInteractiveOnce(
164
164
  ctx,
165
165
  "The unified extensions manager",
166
166
  () =>
167
- ctx.ui.custom<UnifiedAction>((tui, theme, _keybindings, done) => {
167
+ ctx.ui.custom<UnifiedAction>((tui, theme, keybindings, done) => {
168
168
  const container = new Container();
169
169
 
170
170
  const titleText = new Text("", 2, 0);
@@ -179,6 +179,7 @@ async function showInteractiveOnce(
179
179
  items,
180
180
  staged,
181
181
  theme,
182
+ keybindings,
182
183
  ctx.cwd,
183
184
  Math.max(4, Math.min(UI.maxListHeight, tui.terminal.rows - 12)),
184
185
  complete,
@@ -637,6 +638,7 @@ class UnifiedManagerBrowser implements Focusable {
637
638
  private readonly items: UnifiedItem[],
638
639
  private readonly staged: Map<string, State>,
639
640
  private readonly theme: Theme,
641
+ private readonly keybindings: KeybindingsManager,
640
642
  private readonly cwd: string,
641
643
  private readonly maxVisibleItems: number,
642
644
  private readonly onAction: (action: UnifiedAction) => void,
@@ -695,8 +697,6 @@ class UnifiedManagerBrowser implements Focusable {
695
697
  }
696
698
 
697
699
  handleManagerInput(data: string): boolean {
698
- const kb = getKeybindings();
699
-
700
700
  if (this.searchActive) {
701
701
  if (matchesKey(data, Key.enter)) {
702
702
  this.searchActive = false;
@@ -745,22 +745,22 @@ class UnifiedManagerBrowser implements Focusable {
745
745
  return true;
746
746
  }
747
747
 
748
- if (kb.matches(data, "tui.select.up")) {
748
+ if (this.keybindings.matches(data, "tui.select.up")) {
749
749
  this.moveSelection(-1);
750
750
  return true;
751
751
  }
752
752
 
753
- if (kb.matches(data, "tui.select.down")) {
753
+ if (this.keybindings.matches(data, "tui.select.down")) {
754
754
  this.moveSelection(1);
755
755
  return true;
756
756
  }
757
757
 
758
- if (kb.matches(data, "tui.select.pageUp")) {
758
+ if (this.keybindings.matches(data, "tui.select.pageUp")) {
759
759
  this.moveSelection(-Math.max(1, this.maxVisibleItems - 1));
760
760
  return true;
761
761
  }
762
762
 
763
- if (kb.matches(data, "tui.select.pageDown")) {
763
+ if (this.keybindings.matches(data, "tui.select.pageDown")) {
764
764
  this.moveSelection(Math.max(1, this.maxVisibleItems - 1));
765
765
  return true;
766
766
  }
@@ -5,7 +5,7 @@ import {
5
5
  type ExtensionAPI,
6
6
  type ExtensionCommandContext,
7
7
  type ExtensionContext,
8
- } from "@mariozechner/pi-coding-agent";
8
+ } from "@earendil-works/pi-coding-agent";
9
9
  import { getPackageCatalog } from "../packages/catalog.js";
10
10
  import { parseChoiceByLabel } from "./command.js";
11
11
  import { logAutoUpdateConfig } from "./history.js";
@@ -7,7 +7,7 @@ import { type Dirent } from "node:fs";
7
7
  import { readdir, readFile } from "node:fs/promises";
8
8
  import { homedir } from "node:os";
9
9
  import { join } from "node:path";
10
- import { type ExtensionAPI, type ExtensionCommandContext } from "@mariozechner/pi-coding-agent";
10
+ import { type ExtensionAPI, type ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
11
11
 
12
12
  export type ChangeAction =
13
13
  | "extension_toggle"
package/src/utils/mode.ts CHANGED
@@ -1,7 +1,10 @@
1
1
  /**
2
2
  * UI capability helpers
3
3
  */
4
- import { type ExtensionCommandContext, type ExtensionContext } from "@mariozechner/pi-coding-agent";
4
+ import {
5
+ type ExtensionCommandContext,
6
+ type ExtensionContext,
7
+ } from "@earendil-works/pi-coding-agent";
5
8
  import { notify } from "./notify.js";
6
9
 
7
10
  type AnyContext = ExtensionCommandContext | ExtensionContext;
@@ -1,7 +1,10 @@
1
1
  /**
2
2
  * Centralized notification handling for UI and non-UI modes
3
3
  */
4
- import { type ExtensionCommandContext, type ExtensionContext } from "@mariozechner/pi-coding-agent";
4
+ import {
5
+ type ExtensionCommandContext,
6
+ type ExtensionContext,
7
+ } from "@earendil-works/pi-coding-agent";
5
8
 
6
9
  export type NotifyLevel = "info" | "warning" | "error";
7
10
 
@@ -2,7 +2,7 @@ import { existsSync, readFileSync } from "node:fs";
2
2
  import { homedir } from "node:os";
3
3
  import path from "node:path";
4
4
  import { execPath, platform } from "node:process";
5
- import { type ExtensionAPI, getAgentDir, SettingsManager } from "@mariozechner/pi-coding-agent";
5
+ import { type ExtensionAPI, getAgentDir, SettingsManager } from "@earendil-works/pi-coding-agent";
6
6
 
7
7
  interface NpmCommandResolutionOptions {
8
8
  platform?: NodeJS.Platform;
@@ -10,7 +10,7 @@ import {
10
10
  type ExtensionAPI,
11
11
  type ExtensionCommandContext,
12
12
  type ExtensionContext,
13
- } from "@mariozechner/pi-coding-agent";
13
+ } from "@earendil-works/pi-coding-agent";
14
14
  import { parseScheduleDuration } from "./duration.js";
15
15
  import { fileExists } from "./fs.js";
16
16
  import { normalizePackageIdentity } from "./package-source.js";
@@ -6,7 +6,7 @@ import {
6
6
  type ExtensionCommandContext,
7
7
  type ExtensionContext,
8
8
  getAgentDir,
9
- } from "@mariozechner/pi-coding-agent";
9
+ } from "@earendil-works/pi-coding-agent";
10
10
  import { getPackageCatalog, type PackageCatalog } from "../packages/catalog.js";
11
11
  import { getAutoUpdateStatus } from "./auto-update.js";
12
12
  import { normalizePackageIdentity } from "./package-source.js";
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Common UI helper patterns
3
3
  */
4
- import { type ExtensionCommandContext } from "@mariozechner/pi-coding-agent";
4
+ import { type ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
5
5
  import { UI } from "../constants.js";
6
6
  import { error as notifyError, notify } from "./notify.js";
7
7