@oh-my-pi/pi-tui 16.2.8 → 16.2.11

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/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [16.2.10] - 2026-06-30
6
+
7
+ ### Fixed
8
+
9
+ - Fixed mid-prompt `/skill:<name>` autocomplete acceptance wiping the user's draft. The autocomplete now inserts the `/skill:<name> ` token at the cursor (replacing only the partial `/sk` slash token) and preserves prose typed before and after it, so a user can compose a prompt and reach for a skill without losing their train of thought ([#3913](https://github.com/can1357/oh-my-pi/issues/3913)).
10
+
11
+ ## [16.2.9] - 2026-06-30
12
+
13
+ ### Added
14
+
15
+ - Added `Editor.submit()` to allow programmatic composer submission, enabling integration with speech input and other automated flows.
16
+
5
17
  ## [16.2.7] - 2026-06-30
6
18
 
7
19
  ### Fixed
@@ -111,6 +111,7 @@ export declare class Editor implements Component, Focusable {
111
111
  */
112
112
  undoPastTransientText(transientText: string): void;
113
113
  setText(text: string): void;
114
+ submit(): void;
114
115
  /** Insert text at the current cursor position */
115
116
  insertText(text: string): void;
116
117
  /** Delete up to `count` characters immediately before the cursor on the current line.
@@ -16,6 +16,8 @@ export interface EditorComponent extends Component {
16
16
  handleInput(data: string): void;
17
17
  /** Called when user submits (e.g., Enter key) */
18
18
  onSubmit?: (text: string) => void;
19
+ /** Programmatically trigger submission (optional, e.g. for voice submit). */
20
+ submit?(): void;
19
21
  /** Called when text changes */
20
22
  onChange?: (text: string) => void;
21
23
  /** Add text to history for up/down navigation */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-tui",
4
- "version": "16.2.8",
4
+ "version": "16.2.11",
5
5
  "description": "Terminal User Interface library with differential rendering for efficient text-based applications",
6
6
  "homepage": "https://omp.sh",
7
7
  "author": "Can Boluk",
@@ -37,8 +37,8 @@
37
37
  "fmt": "biome format --write ."
38
38
  },
39
39
  "dependencies": {
40
- "@oh-my-pi/pi-natives": "16.2.8",
41
- "@oh-my-pi/pi-utils": "16.2.8",
40
+ "@oh-my-pi/pi-natives": "16.2.11",
41
+ "@oh-my-pi/pi-utils": "16.2.11",
42
42
  "lru-cache": "11.5.1",
43
43
  "marked": "^18.0.5"
44
44
  },
@@ -522,12 +522,23 @@ export class CombinedAutocompleteProvider implements AutocompleteProvider {
522
522
  hasPromptTextBeforeSlash(lines, cursorLine, textBeforeCursor, trailingSlashStart) &&
523
523
  findTrailingSlashCommandStart(prefix) !== null;
524
524
 
525
- if (isMidPromptSkillLookup) {
526
- const newLine = `/${item.value}`;
525
+ if (isMidPromptSkillLookup && trailingSlashStart !== null) {
526
+ // Replace ONLY the partial slash token (e.g. "/sec") at the cursor with
527
+ // `/skill:<name> `; the rest of the user's draft — prose typed before
528
+ // the slash, text after the cursor, and any other lines — is preserved.
529
+ // The submit-time parser (`parseSkillInvocation` in coding-agent/skills)
530
+ // detects the mid-prompt `/skill:<name>` token and threads the surrounding
531
+ // prose through as `args`, so the skill still invokes (issue #3913, after
532
+ // the original mid-prompt autocomplete landed in #3654 wiped the draft).
533
+ const beforeSlash = currentLine.slice(0, trailingSlashStart);
534
+ const insert = `/${item.value} `;
535
+ const newLine = `${beforeSlash}${insert}${afterCursor}`;
536
+ const newLines = [...lines];
537
+ newLines[cursorLine] = newLine;
527
538
  return {
528
- lines: [newLine],
529
- cursorLine: 0,
530
- cursorCol: newLine.length,
539
+ lines: newLines,
540
+ cursorLine,
541
+ cursorCol: beforeSlash.length + insert.length,
531
542
  };
532
543
  }
533
544
 
@@ -1594,6 +1594,10 @@ export class Editor implements Component, Focusable {
1594
1594
  this.#resetKillSequence();
1595
1595
  this.#setTextInternal(text);
1596
1596
  }
1597
+ submit(): void {
1598
+ if (this.disableSubmit) return;
1599
+ this.#submitValue();
1600
+ }
1597
1601
 
1598
1602
  #exitHistoryForEditing(): void {
1599
1603
  if (this.#historyIndex === -1) return;
@@ -29,6 +29,9 @@ export interface EditorComponent extends Component {
29
29
  /** Called when user submits (e.g., Enter key) */
30
30
  onSubmit?: (text: string) => void;
31
31
 
32
+ /** Programmatically trigger submission (optional, e.g. for voice submit). */
33
+ submit?(): void;
34
+
32
35
  /** Called when text changes */
33
36
  onChange?: (text: string) => void;
34
37