@giladbarnea/pi-simple-team 2.0.11 → 2.0.12
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/index.ts +11 -4
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -494,13 +494,21 @@ interface ChildStartOptions {
|
|
|
494
494
|
signal?: AbortSignal;
|
|
495
495
|
}
|
|
496
496
|
|
|
497
|
+
/**
|
|
498
|
+
* Resume lets Pi restore the session's model. It passes the saved thinking level because Pi records `--thinking` only in a new session, so a fork keeps main's level.
|
|
499
|
+
* @example launchSettingArguments({ model: "openai-codex/gpt-6-luna", thinking: "xhigh" }, { sessionFile: "/sessions/a.jsonl" }) // ["--thinking", "xhigh"]
|
|
500
|
+
*/
|
|
501
|
+
function launchSettingArguments(teammate: Pick<TeammateState, "model" | "thinking">, options: ChildStartOptions): string[] {
|
|
502
|
+
const thinkingArguments = ["--thinking", teammate.thinking];
|
|
503
|
+
return options.sessionFile ? thinkingArguments : ["--model", teammate.model, ...thinkingArguments];
|
|
504
|
+
}
|
|
505
|
+
|
|
497
506
|
function attachRpcTeammate(team: TeamState, teammate: TeammateState, participants: string[], options: ChildStartOptions): void {
|
|
498
507
|
const sessionArgs = options.sessionFile
|
|
499
508
|
? ["--session", options.sessionFile]
|
|
500
509
|
: teammate.forkContext && !options.restartEmpty
|
|
501
510
|
? ["--fork", team.mainSessionFile!]
|
|
502
511
|
: [];
|
|
503
|
-
const modelArgs = options.sessionFile ? [] : ["--model", teammate.model, "--thinking", teammate.thinking];
|
|
504
512
|
const args = [
|
|
505
513
|
"--mode",
|
|
506
514
|
"rpc",
|
|
@@ -511,7 +519,7 @@ function attachRpcTeammate(team: TeamState, teammate: TeammateState, participant
|
|
|
511
519
|
...teammate.extensionPaths.flatMap(extensionPath => ["-e", extensionPath]),
|
|
512
520
|
"--no-prompt-templates",
|
|
513
521
|
"--no-themes",
|
|
514
|
-
...
|
|
522
|
+
...launchSettingArguments(teammate, options),
|
|
515
523
|
];
|
|
516
524
|
const proc = childProcess.spawn(team.parentPiExecutable, args, {
|
|
517
525
|
cwd: team.projectDirectory ?? process.cwd(),
|
|
@@ -559,7 +567,6 @@ async function attachHerdrTeammate(
|
|
|
559
567
|
: teammate.forkContext && !options.restartEmpty
|
|
560
568
|
? ["--fork", team.mainSessionFile!]
|
|
561
569
|
: [];
|
|
562
|
-
const modelArgs = options.sessionFile ? [] : ["--model", teammate.model, "--thinking", teammate.thinking];
|
|
563
570
|
const args = ["pane", "split", "--pane", herdrParentPaneId, "--direction", "right", "--no-focus", "--cwd", team.projectDirectory ?? process.cwd()];
|
|
564
571
|
for (const [name, value] of Object.entries(environment)) {
|
|
565
572
|
if (value !== undefined) args.push("--env", `${name}=${value}`);
|
|
@@ -574,7 +581,7 @@ async function attachHerdrTeammate(
|
|
|
574
581
|
"-e",
|
|
575
582
|
teamLiteExtensionPath,
|
|
576
583
|
...teammate.extensionPaths.flatMap(extensionPath => ["-e", extensionPath]),
|
|
577
|
-
...
|
|
584
|
+
...launchSettingArguments(teammate, options),
|
|
578
585
|
].map(shellQuote).join(" ");
|
|
579
586
|
await runCommand("herdr", ["pane", "run", teammate.paneId, command]);
|
|
580
587
|
appendSpawnLog(team, teammate);
|