@phi-code-admin/phi-code 0.84.1 → 0.85.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 +71 -0
- package/README.md +3 -3
- package/agents/code.md +1 -0
- package/agents/explore.md +11 -5
- package/agents/plan.md +18 -3
- package/agents/review.md +18 -7
- package/agents/test.md +1 -0
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +2 -2
- package/dist/core/sdk.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +2 -2
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +30 -28
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/utils/version-check.d.ts +5 -5
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +13 -8
- package/dist/utils/version-check.js.map +1 -1
- package/docs/settings.md +2 -2
- package/docs/usage.md +1 -1
- package/examples/sdk/12-full-control.ts +1 -1
- package/extensions/phi/mcp/index.ts +10 -4
- package/extensions/phi/models.ts +170 -49
- package/extensions/phi/orchestrator.ts +51 -12
- package/extensions/phi/providers/live-models.ts +31 -1
- package/extensions/phi/providers/opencode-go.ts +7 -3
- package/extensions/phi/setup.ts +9 -0
- package/extensions/phi/skill-loader.ts +46 -25
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ import * as os from "node:os";
|
|
|
8
8
|
import * as path from "node:path";
|
|
9
9
|
import { spawn, spawnSync } from "child_process";
|
|
10
10
|
import { getProviders, } from "phi-code-ai";
|
|
11
|
-
import { CombinedAutocompleteProvider, Container, fuzzyFilter, Loader, Markdown, matchesKey, ProcessTerminal, Spacer, setKeybindings, Text, TruncatedText, TUI, visibleWidth, } from "phi-code-tui";
|
|
11
|
+
import { CombinedAutocompleteProvider, Container, fuzzyFilter, getCapabilities, hyperlink, Loader, Markdown, matchesKey, ProcessTerminal, Spacer, setKeybindings, Text, TruncatedText, TUI, visibleWidth, } from "phi-code-tui";
|
|
12
12
|
import { APP_NAME, APP_TITLE, getAgentDir, getAuthPath, getDebugLogPath, getDocsPath, getShareViewerUrl, VERSION, } from "../../config.js";
|
|
13
13
|
import { parseSkillBlock } from "../../core/agent-session.js";
|
|
14
14
|
import { SessionImportFileNotFoundError } from "../../core/agent-session-runtime.js";
|
|
@@ -21,16 +21,14 @@ import { BUILT_IN_PROVIDER_DISPLAY_NAMES } from "../../core/provider-display-nam
|
|
|
21
21
|
import { formatMissingSessionCwdPrompt, MissingSessionCwdError } from "../../core/session-cwd.js";
|
|
22
22
|
import { SessionManager } from "../../core/session-manager.js";
|
|
23
23
|
import { BUILTIN_SLASH_COMMANDS } from "../../core/slash-commands.js";
|
|
24
|
-
import { isInstallTelemetryEnabled } from "../../core/telemetry.js";
|
|
25
24
|
import { getChangelogPath, getNewEntries, parseChangelog } from "../../utils/changelog.js";
|
|
26
25
|
import { copyToClipboard } from "../../utils/clipboard.js";
|
|
27
26
|
import { extensionForImageMimeType, readClipboardImage } from "../../utils/clipboard-image.js";
|
|
28
27
|
import { parseGitUrl } from "../../utils/git.js";
|
|
29
28
|
import { getCwdRelativePath } from "../../utils/paths.js";
|
|
30
|
-
import { getPiUserAgent } from "../../utils/pi-user-agent.js";
|
|
31
29
|
import { killTrackedDetachedChildren } from "../../utils/shell.js";
|
|
32
30
|
import { ensureTool } from "../../utils/tools-manager.js";
|
|
33
|
-
import {
|
|
31
|
+
import { checkForNewVersion } from "../../utils/version-check.js";
|
|
34
32
|
import { ArminComponent } from "./components/armin.js";
|
|
35
33
|
import { AssistantMessageComponent } from "./components/assistant-message.js";
|
|
36
34
|
import { BashExecutionComponent } from "./components/bash-execution.js";
|
|
@@ -540,7 +538,7 @@ export class InteractiveMode {
|
|
|
540
538
|
async run() {
|
|
541
539
|
await this.init();
|
|
542
540
|
// Start version check asynchronously
|
|
543
|
-
|
|
541
|
+
checkForNewVersion(this.version).then((newVersion) => {
|
|
544
542
|
if (newVersion) {
|
|
545
543
|
this.showNewVersionNotification(newVersion);
|
|
546
544
|
}
|
|
@@ -687,21 +685,11 @@ export class InteractiveMode {
|
|
|
687
685
|
}
|
|
688
686
|
return undefined;
|
|
689
687
|
}
|
|
690
|
-
reportInstallTelemetry(
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
return;
|
|
696
|
-
}
|
|
697
|
-
void fetch(`https://pi.dev/api/report-install?version=${encodeURIComponent(version)}`, {
|
|
698
|
-
headers: {
|
|
699
|
-
"User-Agent": getPiUserAgent(version),
|
|
700
|
-
},
|
|
701
|
-
signal: AbortSignal.timeout(5000),
|
|
702
|
-
})
|
|
703
|
-
.then(() => undefined)
|
|
704
|
-
.catch(() => undefined);
|
|
688
|
+
reportInstallTelemetry(_version) {
|
|
689
|
+
// Install telemetry is a no-op in phi-code: the inherited ping targeted
|
|
690
|
+
// https://pi.dev/api/report-install, the upstream Pi project's endpoint,
|
|
691
|
+
// which both leaked install events to a third party and polluted upstream
|
|
692
|
+
// install stats. phi-code has no telemetry backend of its own.
|
|
705
693
|
}
|
|
706
694
|
getMarkdownThemeWithSettings() {
|
|
707
695
|
return {
|
|
@@ -3018,15 +3006,29 @@ export class InteractiveMode {
|
|
|
3018
3006
|
this.chatContainer.addChild(new Text(theme.fg("warning", `Warning: ${warningMessage}`), 1, 0));
|
|
3019
3007
|
this.ui.requestRender();
|
|
3020
3008
|
}
|
|
3021
|
-
showNewVersionNotification(
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3009
|
+
showNewVersionNotification(newVersion) {
|
|
3010
|
+
const action = theme.fg("accent", `${APP_NAME} update`);
|
|
3011
|
+
const updateInstruction = theme.fg("muted", `New version ${newVersion} is available. Run `) + action;
|
|
3012
|
+
const changelogUrl = "https://github.com/uglyswap/phi-code/blob/main/packages/coding-agent/CHANGELOG.md";
|
|
3013
|
+
const changelogLink = getCapabilities().hyperlinks
|
|
3014
|
+
? hyperlink(theme.fg("accent", "open changelog"), changelogUrl)
|
|
3015
|
+
: theme.fg("accent", changelogUrl);
|
|
3016
|
+
const changelogLine = theme.fg("muted", "Changelog: ") + changelogLink;
|
|
3017
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
3018
|
+
this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
|
|
3019
|
+
this.chatContainer.addChild(new Text(`${theme.bold(theme.fg("warning", "Update Available"))}\n${updateInstruction}\n${changelogLine}`, 1, 0));
|
|
3020
|
+
this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
|
|
3021
|
+
this.ui.requestRender();
|
|
3027
3022
|
}
|
|
3028
|
-
showPackageUpdateNotification(
|
|
3029
|
-
|
|
3023
|
+
showPackageUpdateNotification(packages) {
|
|
3024
|
+
const action = theme.fg("accent", `${APP_NAME} update`);
|
|
3025
|
+
const updateInstruction = theme.fg("muted", "Package updates are available. Run ") + action;
|
|
3026
|
+
const packageLines = packages.map((pkg) => `- ${pkg}`).join("\n");
|
|
3027
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
3028
|
+
this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
|
|
3029
|
+
this.chatContainer.addChild(new Text(`${theme.bold(theme.fg("warning", "Package Updates Available"))}\n${updateInstruction}\n${theme.fg("muted", "Packages:")}\n${packageLines}`, 1, 0));
|
|
3030
|
+
this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
|
|
3031
|
+
this.ui.requestRender();
|
|
3030
3032
|
}
|
|
3031
3033
|
/**
|
|
3032
3034
|
* Get all queued messages (read-only).
|