@deathbeam/pi-delegate 0.0.34 → 0.0.36
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 +6 -5
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -275,19 +275,20 @@ export default function (pi: ExtensionAPI) {
|
|
|
275
275
|
const entrypoint = process.argv[1];
|
|
276
276
|
if (!entrypoint) throw new Error("Pi CLI entrypoint missing; start Pi from its CLI to delegate.");
|
|
277
277
|
const cwd = isolation ? cloneCwd(isolation, ctx.cwd) : ctx.cwd;
|
|
278
|
+
if (isolation)
|
|
279
|
+
args.push(
|
|
280
|
+
"--append-system-prompt",
|
|
281
|
+
`You are working in an isolated git clone at ${isolation.clone}. Your working directory is ${cwd}; run every command from it with relative paths. Any path under ${ctx.cwd} means the same file under ${cwd}. Your edits stay in this clone until the orchestrator applies them.${tools.includes("bash") ? " Git commands that write, such as commit and rebase, work here and change only this clone. `git diff main-snapshot` shows every change made in it." : ""}`,
|
|
282
|
+
);
|
|
278
283
|
const child = spawn(process.execPath, [entrypoint, "--mode", "rpc", ...args], {
|
|
279
284
|
cwd,
|
|
280
285
|
shell: false,
|
|
281
286
|
stdio: "pipe",
|
|
282
287
|
});
|
|
283
288
|
store.launch(job);
|
|
284
|
-
// The brief was written against the main tree, so its absolute paths need mapping to the clone.
|
|
285
|
-
const isolatedPrompt = isolation
|
|
286
|
-
? `You are working in an isolated git clone at ${isolation.clone}. Your working directory ${cwd} is already inside it, so use relative paths and do not cd into it. Paths under ${ctx.cwd} in the task refer to the same files under ${cwd}. The main working tree is untouched; any edits or commits you make stay in this clone until the orchestrator applies them.${tools.includes("bash") ? " `git diff main-snapshot` shows all changes made in this clone." : ""}`
|
|
287
|
-
: "";
|
|
288
289
|
const run = runChild(
|
|
289
290
|
child,
|
|
290
|
-
|
|
291
|
+
prompt,
|
|
291
292
|
// Foreground runs also stop on the tool's own abort (Esc); delegate_cancel and shutdown use the controller.
|
|
292
293
|
details.background || !signal ? job.controller.signal : AbortSignal.any([signal, job.controller.signal]),
|
|
293
294
|
(update) => store.record(job, update),
|