@zhushanwen/pi-plan 0.2.3 → 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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/command.ts +11 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhushanwen/pi-plan",
3
- "version": "0.2.3",
3
+ "version": "0.3.0",
4
4
  "description": "Lightweight plan mode for Pi coding agent",
5
5
  "type": "module",
6
6
  "main": "index.ts",
@@ -16,7 +16,7 @@
16
16
  "license": "MIT",
17
17
  "peerDependencies": {
18
18
  "@earendil-works/pi-coding-agent": ">=0.73.0",
19
- "@sinclair/typebox": "*",
19
+ "typebox": "*",
20
20
  "@earendil-works/pi-ai": "*"
21
21
  },
22
22
  "peerDependenciesMeta": {
package/src/command.ts CHANGED
@@ -18,6 +18,17 @@ export function registerPlanCommand(
18
18
  "Enter plan mode: /plan [description]. " +
19
19
  "Subcommands: /plan abort, /plan status. " +
20
20
  "With no args, show status or detect existing plan.",
21
+ getArgumentCompletions(prefix: string) {
22
+ const parts = prefix.trimStart().split(/\s+/).filter(Boolean);
23
+ // More than 1 token means the user is typing a free-text requirement, no completion.
24
+ if (parts.length > 1) return null;
25
+ const trimmed = (parts[0] ?? "").toLowerCase();
26
+ const opts = [
27
+ { label: "abort", value: "abort", description: "取消活跃的 plan mode" },
28
+ { label: "status", value: "status", description: "查看 plan mode 状态" },
29
+ ];
30
+ return trimmed === "" ? opts : opts.filter((o) => o.label.startsWith(trimmed));
31
+ },
21
32
  handler: async (args: string, ctx: ExtensionContext) => {
22
33
  const trimmed = args.trim();
23
34
  const sessionId = ctx.sessionManager.getSessionId();