@dreki-gg/pi-pr-canvas 1.6.1 → 1.7.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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @dreki-gg/pi-pr-canvas
2
2
 
3
+ ## 1.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Add argument autocompletion to slash commands. Typing after `/impeccable`,
8
+ `/stack`, `/babysit`, `/pr-canvas`, `/context-folders`, or `/past-chats` now
9
+ suggests the available sub-commands (filtered by prefix, with descriptions),
10
+ so you no longer have to remember the exact verb to type.
11
+
3
12
  ## 1.6.1
4
13
 
5
14
  ### Patch Changes
@@ -4,6 +4,7 @@ import { createWsBridge, type WsBridge } from './server/ws-bridge';
4
4
  import { createServerManager, resolveAppDir, type ServerManager } from './server/manager';
5
5
  import { createMessageHandlers } from './server/handlers';
6
6
  import { openUrlCommand } from './open-url';
7
+ import { getPrCanvasCompletions } from './completions';
7
8
 
8
9
  const WS_PORT = 3001;
9
10
  const APP_PORT = 3000;
@@ -107,6 +108,7 @@ export function registerPrCanvasCommands(pi: ExtensionAPI) {
107
108
  pi.registerCommand('pr-canvas', {
108
109
  description:
109
110
  'Manage the PR Canvas server. Usage: /pr-canvas start | stop | open [number] | status',
111
+ getArgumentCompletions: (argumentPrefix) => getPrCanvasCompletions(argumentPrefix),
110
112
  handler: async (args, ctx) => {
111
113
  const parts = (args?.trim() || '').split(/\s+/);
112
114
  const subcommand = parts[0] || '';
@@ -0,0 +1,23 @@
1
+ export interface SubcommandCompletion {
2
+ value: string;
3
+ label: string;
4
+ description?: string;
5
+ }
6
+
7
+ const SUBCOMMANDS: SubcommandCompletion[] = [
8
+ { value: 'start', label: 'start', description: 'Start the PR Canvas server' },
9
+ { value: 'stop', label: 'stop', description: 'Stop the PR Canvas server' },
10
+ { value: 'open', label: 'open [number]', description: 'Open the canvas (optionally for a PR number)' },
11
+ { value: 'status', label: 'status', description: 'Show server and bridge status' },
12
+ ];
13
+
14
+ /**
15
+ * Argument completions for `/pr-canvas`. Completes the sub-command while the
16
+ * user is still typing the first token; returns `null` once a space was typed
17
+ * (e.g. while typing the PR number after `open`).
18
+ */
19
+ export function getPrCanvasCompletions(argumentPrefix: string): SubcommandCompletion[] | null {
20
+ if (/\s/.test(argumentPrefix)) return null;
21
+ const prefix = argumentPrefix.toLowerCase();
22
+ return SUBCOMMANDS.filter((s) => s.value.startsWith(prefix));
23
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dreki-gg/pi-pr-canvas",
3
- "version": "1.6.1",
3
+ "version": "1.7.0",
4
4
  "description": "Visual GitHub Pull Request canvas for pi — generate a self-contained HTML overview of any PR with file tree, diffs, CI checks, comments, and AI-powered mind map",
5
5
  "keywords": [
6
6
  "pi-package",