pi-outpost 0.31.0 → 0.32.1
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/dist/contract/validate-structured-exchange.mjs +1 -1
- package/dist/pi-outpost-tools.mjs +172413 -0
- package/dist/pi-outpost.mjs +47 -12
- package/dist/pi-outpost.sea.mjs +2 -2
- package/dist/sea-prep.blob +2 -2
- package/package.json +1 -1
package/dist/pi-outpost.mjs
CHANGED
|
@@ -185968,7 +185968,7 @@ function childEnv(extra = {}) {
|
|
|
185968
185968
|
}
|
|
185969
185969
|
function agentDirEnv(executable, agentDir) {
|
|
185970
185970
|
const env2 = { PI_CODING_AGENT_DIR: agentDir };
|
|
185971
|
-
const base = (executable.split(/[\\/]/).pop() ?? "").replace(/\.(exe|cmd|bat|js|mjs)$/i, "");
|
|
185971
|
+
const base = (executable.split(/[\\/]/).pop() ?? "").replace(/\.(exe|cmd|bat|js|mjs|sh)$/i, "");
|
|
185972
185972
|
const derived = base.toUpperCase().replace(/[^A-Z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
185973
185973
|
if (derived !== "" && derived !== "PI" && /^[A-Z]/.test(derived)) env2[`${derived}_CODING_AGENT_DIR`] = agentDir;
|
|
185974
185974
|
return env2;
|
|
@@ -186338,12 +186338,14 @@ var RpcRuntime = class {
|
|
|
186338
186338
|
availableCommands = [];
|
|
186339
186339
|
availableResources = [];
|
|
186340
186340
|
usage;
|
|
186341
|
-
/** Standard Pi
|
|
186341
|
+
/** Standard Pi and Prime Agent name this operation `fork`; OMP's compatible dialect names it `branch`. */
|
|
186342
186342
|
forkCommand = "fork";
|
|
186343
|
-
/** Standard Pi settles after maintenance; OMP's
|
|
186343
|
+
/** Standard Pi settles after maintenance; OMP's and Prime Agent's dialects terminate directly at `agent_end`. */
|
|
186344
186344
|
completionEvent = "agent_settled";
|
|
186345
186345
|
/** Assistant message being streamed, assembled from deltas so a mid-stream connect sees it. */
|
|
186346
186346
|
partial;
|
|
186347
|
+
/** The child's last reported queue, re-sent when a retry reopens a turn. */
|
|
186348
|
+
pendingQueue = { steering: [], followUp: [] };
|
|
186347
186349
|
/** Dialog requests Pi is blocked on, so a session replacement can release them. */
|
|
186348
186350
|
openDialogs = /* @__PURE__ */ new Set();
|
|
186349
186351
|
/** Serializes record handling: a refresh must not interleave with the next event. */
|
|
@@ -186485,14 +186487,21 @@ var RpcRuntime = class {
|
|
|
186485
186487
|
this.completionEvent = "agent_settled";
|
|
186486
186488
|
} catch (error) {
|
|
186487
186489
|
if (!isUnknownCommand(error, "get_tree")) throw error;
|
|
186488
|
-
|
|
186490
|
+
let branch;
|
|
186491
|
+
try {
|
|
186492
|
+
branch = await this.process.command("get_branch_messages");
|
|
186493
|
+
this.forkCommand = "branch";
|
|
186494
|
+
} catch (branchError) {
|
|
186495
|
+
if (!isUnknownCommand(branchError, "get_branch_messages")) throw branchError;
|
|
186496
|
+
branch = await this.process.command("get_fork_messages");
|
|
186497
|
+
this.forkCommand = "fork";
|
|
186498
|
+
}
|
|
186489
186499
|
const projected = (branch?.messages ?? []).flatMap(
|
|
186490
186500
|
(item) => typeof item.entryId === "string" && typeof item.text === "string" ? [{ type: "message", id: item.entryId, message: { role: "user", content: item.text } }] : []
|
|
186491
186501
|
);
|
|
186492
186502
|
this.sessionEntries = projected;
|
|
186493
186503
|
this.treeRoots = linearTree(projected);
|
|
186494
186504
|
this.leafId = projected.at(-1)?.id ?? null;
|
|
186495
|
-
this.forkCommand = "branch";
|
|
186496
186505
|
this.completionEvent = "agent_end";
|
|
186497
186506
|
}
|
|
186498
186507
|
const stats = await this.process.command("get_session_stats");
|
|
@@ -186519,6 +186528,7 @@ var RpcRuntime = class {
|
|
|
186519
186528
|
rebootstrap() {
|
|
186520
186529
|
return this.queued(async () => {
|
|
186521
186530
|
this.releaseDialogs();
|
|
186531
|
+
this.pendingQueue = { steering: [], followUp: [] };
|
|
186522
186532
|
this.applyState(await this.process.command("get_state"));
|
|
186523
186533
|
await this.refreshCatalog();
|
|
186524
186534
|
await this.refreshConversation();
|
|
@@ -186622,11 +186632,21 @@ var RpcRuntime = class {
|
|
|
186622
186632
|
break;
|
|
186623
186633
|
}
|
|
186624
186634
|
case "queue_update":
|
|
186625
|
-
this.
|
|
186626
|
-
|
|
186627
|
-
|
|
186628
|
-
|
|
186629
|
-
|
|
186635
|
+
this.emitQueue(toStringArray(record.steering), toStringArray(record.followUp));
|
|
186636
|
+
break;
|
|
186637
|
+
case "session_action_update": {
|
|
186638
|
+
const actions = record.actions;
|
|
186639
|
+
this.emitQueue(toStringArray(actions?.steering), toStringArray(actions?.followUps));
|
|
186640
|
+
break;
|
|
186641
|
+
}
|
|
186642
|
+
case "auto_retry_start":
|
|
186643
|
+
if (!this.streaming) {
|
|
186644
|
+
this.streaming = true;
|
|
186645
|
+
this.emit({ type: "agent_start" });
|
|
186646
|
+
if (this.pendingQueue.steering.length || this.pendingQueue.followUp.length) {
|
|
186647
|
+
this.emit({ type: "queue", ...this.pendingQueue });
|
|
186648
|
+
}
|
|
186649
|
+
}
|
|
186630
186650
|
break;
|
|
186631
186651
|
case "compaction_start":
|
|
186632
186652
|
this.emit({ type: "compaction_start" });
|
|
@@ -186646,10 +186666,17 @@ var RpcRuntime = class {
|
|
|
186646
186666
|
case "extension_ui_request":
|
|
186647
186667
|
this.onExtensionUiRequest(record);
|
|
186648
186668
|
break;
|
|
186669
|
+
case "auto_retry_end":
|
|
186670
|
+
if (record.success === false && this.streaming && this.completionEvent === "agent_end") await this.completeTurn();
|
|
186671
|
+
break;
|
|
186649
186672
|
default:
|
|
186650
186673
|
break;
|
|
186651
186674
|
}
|
|
186652
186675
|
}
|
|
186676
|
+
emitQueue(steering, followUp) {
|
|
186677
|
+
this.pendingQueue = { steering, followUp };
|
|
186678
|
+
this.emit({ type: "queue", steering, followUp });
|
|
186679
|
+
}
|
|
186653
186680
|
async completeTurn() {
|
|
186654
186681
|
this.streaming = false;
|
|
186655
186682
|
try {
|
|
@@ -186805,7 +186832,12 @@ var RpcRuntime = class {
|
|
|
186805
186832
|
...this.streaming ? { streamingBehavior: "steer" } : {}
|
|
186806
186833
|
};
|
|
186807
186834
|
try {
|
|
186808
|
-
|
|
186835
|
+
try {
|
|
186836
|
+
await this.command("prompt", payload);
|
|
186837
|
+
} catch (error) {
|
|
186838
|
+
if (payload.streamingBehavior !== void 0 || !isSuspendedQueueRefusal(error)) throw error;
|
|
186839
|
+
await this.command("prompt", { ...payload, streamingBehavior: "followUp" });
|
|
186840
|
+
}
|
|
186809
186841
|
} catch (error) {
|
|
186810
186842
|
options?.onAccepted?.(false);
|
|
186811
186843
|
throw error;
|
|
@@ -186941,6 +186973,9 @@ function isUnknownCommand(error, command) {
|
|
|
186941
186973
|
const message = error.message.toLowerCase();
|
|
186942
186974
|
return message.includes(command.toLowerCase()) && ABSENT_COMMAND_WORDS.test(message);
|
|
186943
186975
|
}
|
|
186976
|
+
function isSuspendedQueueRefusal(error) {
|
|
186977
|
+
return error instanceof Error && error.message.includes("queued session input is suspended");
|
|
186978
|
+
}
|
|
186944
186979
|
|
|
186945
186980
|
// ../server/src/structuredExchangeTool.ts
|
|
186946
186981
|
var DESCRIPTION8 = [
|
|
@@ -200567,7 +200602,7 @@ function cacheControlFor(url) {
|
|
|
200567
200602
|
}
|
|
200568
200603
|
|
|
200569
200604
|
// ../server/src/index.ts
|
|
200570
|
-
var VERSION2 = true ? "0.
|
|
200605
|
+
var VERSION2 = true ? "0.32.1" : "dev";
|
|
200571
200606
|
var PI_SDK_VERSION = true ? "0.87.1" : readInstalledPiSdkVersion();
|
|
200572
200607
|
var LAUNCH_DIR = process.env.INIT_CWD ?? process.cwd();
|
|
200573
200608
|
function complain(error) {
|
package/dist/pi-outpost.sea.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/dist/pi-outpost.sea.mjs
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 34848625 bytes
|
|
4
|
+
sha256: 3648843285579c259704a68cc612fd8d549c53a27d55224d69c787bd63be1ea2
|
package/dist/sea-prep.blob
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/dist/sea-prep.blob
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 34847683 bytes
|
|
4
|
+
sha256: b2c66458bdeb6756596a723959b05154ad8d679e3bf3060a1f3bbf9fe51a740f
|