pinokiod 6.0.21 → 6.0.22
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
package/server/index.js
CHANGED
|
@@ -8322,8 +8322,8 @@ class Server {
|
|
|
8322
8322
|
if (entry.provider === "gemini" && typeof entry.source === "string" && entry.source.length > 0) {
|
|
8323
8323
|
forkCapable = Boolean(entry.fork_capable)
|
|
8324
8324
|
if (forkCapable) {
|
|
8325
|
-
const
|
|
8326
|
-
const cloneAndResume = `node ${JSON.stringify(
|
|
8325
|
+
const geminiForkScript = path.resolve(__dirname, "scripts", "fork_gemini_session.js")
|
|
8326
|
+
const cloneAndResume = `FORK_SESSION_ID=$(node ${JSON.stringify(geminiForkScript)} ${JSON.stringify(entry.source)} ${JSON.stringify(entry.id)}) && ${resumeBaseCommand} --resume "$FORK_SESSION_ID"`
|
|
8327
8327
|
forkCommand = cloneAndResume
|
|
8328
8328
|
} else {
|
|
8329
8329
|
forkCommand = ""
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
|
|
4
|
-
const path = require("path");
|
|
5
|
-
const { execFileSync, spawn } = require("child_process");
|
|
6
|
-
|
|
7
|
-
const sourcePath = process.argv[2];
|
|
8
|
-
const expectedSessionId = process.argv[3];
|
|
9
|
-
|
|
10
|
-
if (!sourcePath) {
|
|
11
|
-
process.exit(1);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const forkScriptPath = path.resolve(__dirname, "fork_gemini_session.js");
|
|
15
|
-
|
|
16
|
-
let forkedSessionId = "";
|
|
17
|
-
try {
|
|
18
|
-
forkedSessionId = execFileSync(
|
|
19
|
-
process.execPath,
|
|
20
|
-
[forkScriptPath, sourcePath, expectedSessionId || ""],
|
|
21
|
-
{
|
|
22
|
-
encoding: "utf8",
|
|
23
|
-
stdio: ["ignore", "pipe", "inherit"]
|
|
24
|
-
}
|
|
25
|
-
).trim();
|
|
26
|
-
} catch (error) {
|
|
27
|
-
if (typeof error.status === "number") {
|
|
28
|
-
process.exit(error.status);
|
|
29
|
-
}
|
|
30
|
-
process.exit(1);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (!forkedSessionId) {
|
|
34
|
-
process.exit(1);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const npxBinary = process.platform === "win32" ? "npx.cmd" : "npx";
|
|
38
|
-
const child = spawn(
|
|
39
|
-
npxBinary,
|
|
40
|
-
["-y", "@google/gemini-cli@latest", "--resume", forkedSessionId],
|
|
41
|
-
{ stdio: "inherit" }
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
child.on("error", () => {
|
|
45
|
-
process.exit(1);
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
child.on("exit", (code) => {
|
|
49
|
-
process.exit(typeof code === "number" ? code : 1);
|
|
50
|
-
});
|