@narumitw/pi-caffeinate 0.6.1 → 0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@narumitw/pi-caffeinate",
3
- "version": "0.6.1",
3
+ "version": "0.7.0",
4
4
  "description": "Pi extension that keeps the computer awake while the agent is running.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/caffeinate.ts CHANGED
@@ -19,12 +19,12 @@ const SETTINGS_FILE = join(
19
19
  "pi-caffeinate-settings.json",
20
20
  );
21
21
  const COMMAND_COMPLETIONS = [
22
- { value: "display", label: "Keep system and display awake" },
23
- { value: "sleep", label: "Keep system awake; allow display sleep" },
24
- { value: "status", label: "Show current status" },
25
- { value: "mode", label: "Choose keep-awake mode" },
26
- { value: "stop", label: "Release inhibitor for now" },
27
- { value: "help", label: "Show command help" },
22
+ { value: "display", label: "display", description: "Keep system and display awake" },
23
+ { value: "sleep", label: "sleep", description: "Keep system awake; allow display sleep" },
24
+ { value: "status", label: "status", description: "Show current status" },
25
+ { value: "mode", label: "mode", description: "Choose keep-awake mode" },
26
+ { value: "stop", label: "stop", description: "Release inhibitor for now" },
27
+ { value: "help", label: "help", description: "Show command help" },
28
28
  ];
29
29
  const MENU_OPTIONS = {
30
30
  display: "Keep system and display awake",
@@ -246,8 +246,8 @@ export function parseCommand(args: string): CommandAction | "unknown" {
246
246
  }
247
247
 
248
248
  export function commandCompletions(prefix: string) {
249
- const normalized = prefix.trim().toLowerCase();
250
- if (normalized.includes(" ")) return null;
249
+ const normalized = prefix.trimStart().toLowerCase();
250
+ if (/\s/.test(normalized)) return null;
251
251
 
252
252
  const matches = COMMAND_COMPLETIONS.filter((completion) =>
253
253
  completion.value.startsWith(normalized),