@phi-code-admin/phi-code 0.96.0 → 0.97.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 (39) hide show
  1. package/CHANGELOG.md +90 -0
  2. package/dist/cli/args.d.ts +1 -1
  3. package/dist/cli/args.d.ts.map +1 -1
  4. package/dist/cli/args.js +43 -1
  5. package/dist/cli/args.js.map +1 -1
  6. package/dist/core/api-key-store.d.ts +20 -4
  7. package/dist/core/api-key-store.d.ts.map +1 -1
  8. package/dist/core/api-key-store.js +37 -7
  9. package/dist/core/api-key-store.js.map +1 -1
  10. package/dist/core/compaction/compaction.d.ts +16 -0
  11. package/dist/core/compaction/compaction.d.ts.map +1 -1
  12. package/dist/core/compaction/compaction.js +43 -19
  13. package/dist/core/compaction/compaction.js.map +1 -1
  14. package/dist/core/json-utils.d.ts +11 -0
  15. package/dist/core/json-utils.d.ts.map +1 -0
  16. package/dist/core/json-utils.js +15 -0
  17. package/dist/core/json-utils.js.map +1 -0
  18. package/dist/core/model-registry.d.ts +6 -1
  19. package/dist/core/model-registry.d.ts.map +1 -1
  20. package/dist/core/model-registry.js +10 -9
  21. package/dist/core/model-registry.js.map +1 -1
  22. package/dist/core/slash-commands.d.ts +13 -0
  23. package/dist/core/slash-commands.d.ts.map +1 -1
  24. package/dist/core/slash-commands.js +38 -0
  25. package/dist/core/slash-commands.js.map +1 -1
  26. package/dist/migrations.d.ts.map +1 -1
  27. package/dist/migrations.js +2 -2
  28. package/dist/migrations.js.map +1 -1
  29. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  30. package/dist/modes/interactive/interactive-mode.js +24 -4
  31. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  32. package/extensions/phi/benchmark.ts +43 -83
  33. package/extensions/phi/init.ts +86 -673
  34. package/extensions/phi/memory.ts +1 -1
  35. package/extensions/phi/models.ts +4 -3
  36. package/extensions/phi/providers/catalog.ts +133 -0
  37. package/extensions/phi/setup.ts +180 -280
  38. package/extensions/phi/smart-router.ts +0 -17
  39. package/package.json +5 -5
@@ -20,7 +20,7 @@ import { DefaultPackageManager } from "../../core/package-manager.js";
20
20
  import { BUILT_IN_PROVIDER_DISPLAY_NAMES } from "../../core/provider-display-names.js";
21
21
  import { formatMissingSessionCwdPrompt, MissingSessionCwdError } from "../../core/session-cwd.js";
22
22
  import { SessionManager } from "../../core/session-manager.js";
23
- import { BUILTIN_SLASH_COMMANDS } from "../../core/slash-commands.js";
23
+ import { BUILTIN_SLASH_COMMANDS, matchBareBuiltinWithArgs } from "../../core/slash-commands.js";
24
24
  import { getChangelogPath, getNewEntries, parseChangelog } from "../../utils/changelog.js";
25
25
  import { copyToClipboard } from "../../utils/clipboard.js";
26
26
  import { extensionForImageMimeType, readClipboardImage } from "../../utils/clipboard-image.js";
@@ -2098,9 +2098,17 @@ export class InteractiveMode {
2098
2098
  return;
2099
2099
  }
2100
2100
  if (text === "/debug") {
2101
- this.handleDebugCommand();
2102
- this.editor.setText("");
2103
- return;
2101
+ // An extension may own /debug (the debug orchestrator does). The TUI
2102
+ // debug overlay only claims the bare form when nothing else does —
2103
+ // otherwise it would silently shadow the extension command.
2104
+ const extensionOwnsDebug = this.session.extensionRunner
2105
+ .getRegisteredCommands()
2106
+ .some((command) => command.name === "debug" || command.invocationName === "debug");
2107
+ if (!extensionOwnsDebug) {
2108
+ this.handleDebugCommand();
2109
+ this.editor.setText("");
2110
+ return;
2111
+ }
2104
2112
  }
2105
2113
  if (text === "/arminsayshi") {
2106
2114
  this.handleArminSaysHi();
@@ -2122,6 +2130,18 @@ export class InteractiveMode {
2122
2130
  await this.shutdown();
2123
2131
  return;
2124
2132
  }
2133
+ // A bare builtin invoked with arguments used to leak to the model as
2134
+ // prose ("/new please"). Surface it instead — unless an extension
2135
+ // registered a command with that name (it then owns the arguments).
2136
+ const bareWithArgs = matchBareBuiltinWithArgs(text);
2137
+ if (bareWithArgs &&
2138
+ !this.session.extensionRunner
2139
+ .getRegisteredCommands()
2140
+ .some((command) => command.name === bareWithArgs || command.invocationName === bareWithArgs)) {
2141
+ this.showWarning(`/${bareWithArgs} takes no arguments. Run \`/${bareWithArgs}\` alone.`);
2142
+ this.editor.setText(text);
2143
+ return;
2144
+ }
2125
2145
  // Handle bash command (! for normal, !! for excluded from context)
2126
2146
  if (text.startsWith("!")) {
2127
2147
  const isExcluded = text.startsWith("!!");