pi-agent-extensions 0.3.3 → 0.3.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.
package/README.md CHANGED
@@ -98,6 +98,10 @@ pi
98
98
 
99
99
  You'll see a loader while context is extracted, then an editor to review the handoff prompt.
100
100
 
101
+ ## Changelog
102
+
103
+ See [CHANGELOG.md](CHANGELOG.md) for release history.
104
+
101
105
  ## Update
102
106
 
103
107
  ```bash
@@ -458,8 +458,8 @@ pi.on("tool_result", (event, ctx) => {
458
458
  ```typescript
459
459
  // Store extension state in session
460
460
  pi.appendEntry<StateType>(CUSTOM_TYPE, stateData);
461
- // Restore on session switch
462
- pi.on("session_switch", (event, ctx) => {
461
+ // Restore on session start (covers startup, switch, fork, etc.)
462
+ pi.on("session_start", (event, ctx) => {
463
463
  applyState(ctx);
464
464
  });
465
465
  ```
@@ -25,7 +25,7 @@ import { DynamicBorder } from "@mariozechner/pi-coding-agent";
25
25
  import {
26
26
  Container,
27
27
  fuzzyFilter,
28
- getEditorKeybindings,
28
+ getKeybindings,
29
29
  Input,
30
30
  matchesKey,
31
31
  type SelectItem,
@@ -938,16 +938,16 @@ const showFileSelector = async (
938
938
  }
939
939
  }
940
940
 
941
- const kb = getEditorKeybindings();
941
+ const kb = getKeybindings();
942
942
  if (
943
- kb.matches(data, "selectUp") ||
944
- kb.matches(data, "selectDown") ||
945
- kb.matches(data, "selectConfirm") ||
946
- kb.matches(data, "selectCancel")
943
+ kb.matches(data, "tui.select.up") ||
944
+ kb.matches(data, "tui.select.down") ||
945
+ kb.matches(data, "tui.select.confirm") ||
946
+ kb.matches(data, "tui.select.cancel")
947
947
  ) {
948
948
  if (selectList) {
949
949
  selectList.handleInput(data);
950
- } else if (kb.matches(data, "selectCancel")) {
950
+ } else if (kb.matches(data, "tui.select.cancel")) {
951
951
  done(null);
952
952
  }
953
953
  tui.requestRender();
@@ -67,7 +67,7 @@ async function listSessions(ctx: ExtensionCommandContext): Promise<SessionInfoLi
67
67
  container.addChild(new DynamicBorder(borderColor));
68
68
  container.addChild(loader);
69
69
  container.addChild(new Spacer(1));
70
- container.addChild(new Text(keyHint("selectCancel", "cancel"), 1, 0));
70
+ container.addChild(new Text(keyHint("tui.select.cancel", "cancel"), 1, 0));
71
71
  container.addChild(new Spacer(1));
72
72
  container.addChild(new DynamicBorder(borderColor));
73
73
 
@@ -48,7 +48,7 @@ import {
48
48
  Text,
49
49
  TUI,
50
50
  fuzzyMatch,
51
- getEditorKeybindings,
51
+ getKeybindings,
52
52
  matchesKey,
53
53
  truncateToWidth,
54
54
  visibleWidth,
@@ -397,25 +397,25 @@ class TodoSelectorComponent extends Container implements Focusable {
397
397
  }
398
398
 
399
399
  handleInput(keyData: string): void {
400
- const kb = getEditorKeybindings();
401
- if (kb.matches(keyData, "selectUp")) {
400
+ const kb = getKeybindings();
401
+ if (kb.matches(keyData, "tui.select.up")) {
402
402
  if (this.filteredTodos.length === 0) return;
403
403
  this.selectedIndex = this.selectedIndex === 0 ? this.filteredTodos.length - 1 : this.selectedIndex - 1;
404
404
  this.updateList();
405
405
  return;
406
406
  }
407
- if (kb.matches(keyData, "selectDown")) {
407
+ if (kb.matches(keyData, "tui.select.down")) {
408
408
  if (this.filteredTodos.length === 0) return;
409
409
  this.selectedIndex = this.selectedIndex === this.filteredTodos.length - 1 ? 0 : this.selectedIndex + 1;
410
410
  this.updateList();
411
411
  return;
412
412
  }
413
- if (kb.matches(keyData, "selectConfirm")) {
413
+ if (kb.matches(keyData, "tui.select.confirm")) {
414
414
  const selected = this.filteredTodos[this.selectedIndex];
415
415
  if (selected) this.onSelectCallback(selected);
416
416
  return;
417
417
  }
418
- if (kb.matches(keyData, "selectCancel")) {
418
+ if (kb.matches(keyData, "tui.select.cancel")) {
419
419
  this.onCancelCallback();
420
420
  return;
421
421
  }
@@ -573,28 +573,28 @@ class TodoDetailOverlayComponent {
573
573
  }
574
574
 
575
575
  handleInput(keyData: string): void {
576
- const kb = getEditorKeybindings();
577
- if (kb.matches(keyData, "selectCancel")) {
576
+ const kb = getKeybindings();
577
+ if (kb.matches(keyData, "tui.select.cancel")) {
578
578
  this.onAction("back");
579
579
  return;
580
580
  }
581
- if (kb.matches(keyData, "selectConfirm")) {
581
+ if (kb.matches(keyData, "tui.select.confirm")) {
582
582
  this.onAction("work");
583
583
  return;
584
584
  }
585
- if (kb.matches(keyData, "selectUp")) {
585
+ if (kb.matches(keyData, "tui.select.up")) {
586
586
  this.scrollBy(-1);
587
587
  return;
588
588
  }
589
- if (kb.matches(keyData, "selectDown")) {
589
+ if (kb.matches(keyData, "tui.select.down")) {
590
590
  this.scrollBy(1);
591
591
  return;
592
592
  }
593
- if (kb.matches(keyData, "selectPageUp")) {
593
+ if (kb.matches(keyData, "tui.select.pageUp")) {
594
594
  this.scrollBy(-this.viewHeight || -1);
595
595
  return;
596
596
  }
597
- if (kb.matches(keyData, "selectPageDown")) {
597
+ if (kb.matches(keyData, "tui.select.pageDown")) {
598
598
  this.scrollBy(this.viewHeight || 1);
599
599
  return;
600
600
  }
@@ -1256,7 +1256,7 @@ function renderTodoDetail(theme: Theme, todo: TodoRecord, expanded: boolean): st
1256
1256
  }
1257
1257
 
1258
1258
  function appendExpandHint(theme: Theme, text: string): string {
1259
- return `${text}\n${theme.fg("dim", `(${keyHint("expandTools", "to expand")})`)}`;
1259
+ return `${text}\n${theme.fg("dim", `(${keyHint("app.tools.expand", "to expand")})`)}`;
1260
1260
  }
1261
1261
 
1262
1262
  async function ensureTodoExists(filePath: string, id: string): Promise<TodoRecord | null> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-agent-extensions",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "Collection of extensions for pi coding agent",
5
5
  "type": "module",
6
6
  "repository": {