@gajae-code/tui 0.16.0 → 0.16.1

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,10 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.16.1] - 2026-09-03
6
+
7
+ - Skill slash-token autocomplete now recognizes subsequent `/skill:` and `/skill-` tokens on the same or later lines without broadening ordinary inline slash-command completion; completion remains suppressed inside inline code and replaces only the active token.
8
+
5
9
  ## [0.16.0] - 2026-09-02
6
10
 
7
11
  ## [0.15.6] - 2026-08-30
@@ -14,6 +14,8 @@ declare function fuzzyScore(query: string, target: string): number;
14
14
  export { fuzzyMatch as autocompleteFuzzyMatch, fuzzyScore as autocompleteFuzzyScore };
15
15
  export declare function getSlashCommandMatchRank(query: string, commandName: string): number;
16
16
  export declare function isInsideInlineCodeSpan(text: string): boolean;
17
+ export declare function hasInlineCodeDelimiter(text: string): boolean;
18
+ export declare function isSkillSlashCommandToken(text: string): boolean;
17
19
  export declare function extractSlashCommandTokenPrefix(text: string): string | null;
18
20
  export declare function isSlashCommandPromptStart(lines: string[], cursorLine: number, textBeforeCursor: string): boolean;
19
21
  export interface AutocompleteItem {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@gajae-code/tui",
4
- "version": "0.16.0",
4
+ "version": "0.16.1",
5
5
  "description": "Terminal User Interface library with differential rendering for efficient text-based applications",
6
6
  "homepage": "https://gajae-code.com",
7
7
  "author": "Yeachan-Heo and Gajae Code Contributors",
@@ -36,8 +36,8 @@
36
36
  "fmt": "biome format --write ."
37
37
  },
38
38
  "dependencies": {
39
- "@gajae-code/natives": "0.16.0",
40
- "@gajae-code/utils": "0.16.0",
39
+ "@gajae-code/natives": "0.16.1",
40
+ "@gajae-code/utils": "0.16.1",
41
41
  "lru-cache": "11.3.6",
42
42
  "marked": "18.0.6"
43
43
  },
@@ -257,9 +257,22 @@ export function isInsideInlineCodeSpan(text: string): boolean {
257
257
  return findOpenInlineCodeSpanStart(text) !== null;
258
258
  }
259
259
 
260
+ export function hasInlineCodeDelimiter(text: string): boolean {
261
+ return text.includes("`");
262
+ }
263
+
264
+ export function isSkillSlashCommandToken(text: string): boolean {
265
+ return /^\/skill(?::|-)/i.test(text);
266
+ }
267
+
260
268
  export function extractSlashCommandTokenPrefix(text: string): string | null {
261
- if (!text.startsWith("/") || /[\s]/.test(text) || text.slice(1).includes("/")) return null;
262
- return text;
269
+ const match = text.match(/(?:^|\s)(\/[^\s]*)$/);
270
+ const token = match?.[1];
271
+ if (!token || token.slice(1).includes("/") || hasInlineCodeDelimiter(token)) return null;
272
+
273
+ const tokenStart = text.length - token.length;
274
+ if (isInsideInlineCodeSpan(text.slice(0, tokenStart))) return null;
275
+ return tokenStart === 0 || isSkillSlashCommandToken(token) ? token : null;
263
276
  }
264
277
  export function isSlashCommandPromptStart(lines: string[], cursorLine: number, textBeforeCursor: string): boolean {
265
278
  return lines.slice(0, cursorLine).every(line => line.trim() === "") && textBeforeCursor.trimStart().startsWith("/");
@@ -5,6 +5,7 @@ import {
5
5
  type CombinedAutocompleteProvider,
6
6
  extractSlashCommandTokenPrefix,
7
7
  isInsideInlineCodeSpan,
8
+ isSkillSlashCommandToken,
8
9
  isSlashCommandPromptStart,
9
10
  } from "../autocomplete";
10
11
  import { BracketedPasteHandler } from "../bracketed-paste";
@@ -1439,7 +1440,7 @@ export class Editor implements Component, Focusable {
1439
1440
  const textBeforeCursor = currentLine.slice(0, this.#state.cursorCol);
1440
1441
  if (
1441
1442
  (this.#isInSubmittedSlashCommandContext() ||
1442
- this.#getSlashTokenBeforeCursor()?.startsWith("/skill") === true) &&
1443
+ this.#getSlashTokenBeforeCursor()?.toLowerCase().startsWith("/skill") === true) &&
1443
1444
  this.#autocompleteProvider?.trySyncSlashCompletion
1444
1445
  ) {
1445
1446
  const syncResult = this.#autocompleteProvider.trySyncSlashCompletion(textBeforeCursor);
@@ -2895,10 +2896,18 @@ export class Editor implements Component, Focusable {
2895
2896
  }
2896
2897
 
2897
2898
  #getSlashTokenBeforeCursor(): string | null {
2898
- if (!this.#hasOnlyWhitespaceBeforeCursorLine()) return null;
2899
2899
  const currentLine = this.#state.lines[this.#state.cursorLine] || "";
2900
2900
  const beforeCursor = currentLine.slice(0, this.#state.cursorCol);
2901
- return extractSlashCommandTokenPrefix(beforeCursor.trimStart());
2901
+ const token = extractSlashCommandTokenPrefix(beforeCursor.trimStart());
2902
+ if (!token) return null;
2903
+ const tokenStart = beforeCursor.length - token.length;
2904
+ const textBeforeToken = [
2905
+ ...this.#state.lines.slice(0, this.#state.cursorLine),
2906
+ beforeCursor.slice(0, tokenStart),
2907
+ ].join("\n");
2908
+ if (isInsideInlineCodeSpan(textBeforeToken)) return null;
2909
+ if (isSkillSlashCommandToken(token)) return token;
2910
+ return this.#hasOnlyWhitespaceBeforeCursorLine() ? token : null;
2902
2911
  }
2903
2912
 
2904
2913
  #isInSlashTokenContext(): boolean {