@codex-infinity/pi-infinity 0.62.1 → 0.62.3
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 +8 -0
- package/README.md +65 -65
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +2 -1
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session.d.ts +1 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +1 -0
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/export-html/index.d.ts.map +1 -1
- package/dist/core/export-html/index.js +5 -4
- package/dist/core/export-html/index.js.map +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +54 -6
- package/dist/core/package-manager.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +4 -1
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts +0 -1
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js +18 -4
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +4 -4
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/print-mode.d.ts +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +83 -71
- package/dist/modes/print-mode.js.map +1 -1
- package/docs/rpc.md +11 -2
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/custom-provider-qwen-cli/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/package.json +4 -4
|
@@ -1040,11 +1040,33 @@ export class DefaultPackageManager {
|
|
|
1040
1040
|
}
|
|
1041
1041
|
async getLocalGitUpdateTarget(installedPath) {
|
|
1042
1042
|
try {
|
|
1043
|
+
const upstream = await this.runCommandCapture("git", ["rev-parse", "--abbrev-ref", "@{upstream}"], {
|
|
1044
|
+
cwd: installedPath,
|
|
1045
|
+
timeoutMs: NETWORK_TIMEOUT_MS,
|
|
1046
|
+
});
|
|
1047
|
+
const trimmedUpstream = upstream.trim();
|
|
1048
|
+
if (!trimmedUpstream.startsWith("origin/")) {
|
|
1049
|
+
throw new Error(`Unsupported upstream remote: ${trimmedUpstream}`);
|
|
1050
|
+
}
|
|
1051
|
+
const branch = trimmedUpstream.slice("origin/".length);
|
|
1052
|
+
if (!branch) {
|
|
1053
|
+
throw new Error("Missing upstream branch name");
|
|
1054
|
+
}
|
|
1043
1055
|
const head = await this.runCommandCapture("git", ["rev-parse", "@{upstream}"], {
|
|
1044
1056
|
cwd: installedPath,
|
|
1045
1057
|
timeoutMs: NETWORK_TIMEOUT_MS,
|
|
1046
1058
|
});
|
|
1047
|
-
return {
|
|
1059
|
+
return {
|
|
1060
|
+
ref: "@{upstream}",
|
|
1061
|
+
head,
|
|
1062
|
+
fetchArgs: [
|
|
1063
|
+
"fetch",
|
|
1064
|
+
"--prune",
|
|
1065
|
+
"--no-tags",
|
|
1066
|
+
"origin",
|
|
1067
|
+
`+refs/heads/${branch}:refs/remotes/origin/${branch}`,
|
|
1068
|
+
],
|
|
1069
|
+
};
|
|
1048
1070
|
}
|
|
1049
1071
|
catch {
|
|
1050
1072
|
await this.runCommand("git", ["remote", "set-head", "origin", "-a"], { cwd: installedPath }).catch(() => { });
|
|
@@ -1052,7 +1074,29 @@ export class DefaultPackageManager {
|
|
|
1052
1074
|
cwd: installedPath,
|
|
1053
1075
|
timeoutMs: NETWORK_TIMEOUT_MS,
|
|
1054
1076
|
});
|
|
1055
|
-
|
|
1077
|
+
const originHeadRef = await this.runCommandCapture("git", ["symbolic-ref", "refs/remotes/origin/HEAD"], {
|
|
1078
|
+
cwd: installedPath,
|
|
1079
|
+
timeoutMs: NETWORK_TIMEOUT_MS,
|
|
1080
|
+
}).catch(() => "");
|
|
1081
|
+
const branch = originHeadRef.trim().replace(/^refs\/remotes\/origin\//, "");
|
|
1082
|
+
if (branch) {
|
|
1083
|
+
return {
|
|
1084
|
+
ref: "origin/HEAD",
|
|
1085
|
+
head,
|
|
1086
|
+
fetchArgs: [
|
|
1087
|
+
"fetch",
|
|
1088
|
+
"--prune",
|
|
1089
|
+
"--no-tags",
|
|
1090
|
+
"origin",
|
|
1091
|
+
`+refs/heads/${branch}:refs/remotes/origin/${branch}`,
|
|
1092
|
+
],
|
|
1093
|
+
};
|
|
1094
|
+
}
|
|
1095
|
+
return {
|
|
1096
|
+
ref: "origin/HEAD",
|
|
1097
|
+
head,
|
|
1098
|
+
fetchArgs: ["fetch", "--prune", "--no-tags", "origin", "+HEAD:refs/remotes/origin/HEAD"],
|
|
1099
|
+
};
|
|
1056
1100
|
}
|
|
1057
1101
|
}
|
|
1058
1102
|
async getGitUpstreamRef(installedPath) {
|
|
@@ -1217,14 +1261,18 @@ export class DefaultPackageManager {
|
|
|
1217
1261
|
await this.installGit(source, scope);
|
|
1218
1262
|
return;
|
|
1219
1263
|
}
|
|
1220
|
-
|
|
1221
|
-
|
|
1264
|
+
const target = await this.getLocalGitUpdateTarget(targetDir);
|
|
1265
|
+
// Fetch only the ref we will reset to, avoiding unrelated branch/tag noise.
|
|
1266
|
+
await this.runCommand("git", target.fetchArgs, { cwd: targetDir });
|
|
1222
1267
|
const localHead = await this.runCommandCapture("git", ["rev-parse", "HEAD"], {
|
|
1223
1268
|
cwd: targetDir,
|
|
1224
1269
|
timeoutMs: NETWORK_TIMEOUT_MS,
|
|
1225
1270
|
});
|
|
1226
|
-
const
|
|
1227
|
-
|
|
1271
|
+
const refreshedTargetHead = await this.runCommandCapture("git", ["rev-parse", target.ref], {
|
|
1272
|
+
cwd: targetDir,
|
|
1273
|
+
timeoutMs: NETWORK_TIMEOUT_MS,
|
|
1274
|
+
});
|
|
1275
|
+
if (localHead.trim() === refreshedTargetHead.trim()) {
|
|
1228
1276
|
return;
|
|
1229
1277
|
}
|
|
1230
1278
|
await this.runCommand("git", ["reset", "--hard", target.ref], { cwd: targetDir });
|