@phi-code-admin/phi-code 0.96.1 → 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.
- package/CHANGELOG.md +40 -0
- package/dist/core/slash-commands.d.ts +13 -0
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +38 -0
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +24 -4
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/extensions/phi/benchmark.ts +12 -56
- package/extensions/phi/init.ts +86 -673
- package/extensions/phi/providers/catalog.ts +133 -0
- package/extensions/phi/setup.ts +180 -280
- package/extensions/phi/smart-router.ts +0 -17
- package/package.json +3 -3
|
@@ -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
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
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("!!");
|