pi-outpost 0.62.0 → 0.62.2
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 +40 -0
- package/dist/contract/validate-structured-exchange.mjs +1 -1
- package/dist/pi-outpost-tools.mjs +2473 -2412
- package/dist/pi-outpost.mjs +531 -464
- package/dist/pi-outpost.sea.mjs +2 -2
- package/dist/sea-prep.blob +2 -2
- package/package.json +2 -2
package/dist/pi-outpost.mjs
CHANGED
|
@@ -111024,7 +111024,7 @@ function normalizeThinkingLevels(levels) {
|
|
|
111024
111024
|
levels.filter((l3) => typeof l3 === "string" && THINKING_LEVELS.includes(l3))
|
|
111025
111025
|
);
|
|
111026
111026
|
if (known.size === 0) return void 0;
|
|
111027
|
-
return THINKING_LEVELS.filter((l3) =>
|
|
111027
|
+
return THINKING_LEVELS.filter((l3) => known.has(l3));
|
|
111028
111028
|
}
|
|
111029
111029
|
function clampThinkingLevel(level, levels) {
|
|
111030
111030
|
if (levels.includes(level)) return level;
|
|
@@ -131509,24 +131509,46 @@ function reduceHtmlToMarkdown(html2, options2 = {}) {
|
|
|
131509
131509
|
const flushTable = () => {
|
|
131510
131510
|
const frame = tables.pop();
|
|
131511
131511
|
if (frame === void 0) return;
|
|
131512
|
+
closeRow(frame);
|
|
131512
131513
|
const rows = frame.rows.filter((row) => row.some((cell) => cell.trim() !== ""));
|
|
131513
131514
|
const columns = rows.length === 0 ? 0 : Math.max(...rows.map((row) => row.length));
|
|
131514
131515
|
const isData = !frame.nested && rows.length >= 2 && columns >= 2;
|
|
131515
131516
|
if (isData) {
|
|
131516
|
-
const rendered = renderMarkdownTable(
|
|
131517
|
-
|
|
131518
|
-
|
|
131517
|
+
const rendered = renderMarkdownTable(
|
|
131518
|
+
rows.map((row) => row.map((cell) => cell.replace(/\s+/g, " ").trim())),
|
|
131519
|
+
{ header: true }
|
|
131520
|
+
);
|
|
131521
|
+
pushBlock(rendered);
|
|
131519
131522
|
return;
|
|
131520
131523
|
}
|
|
131521
131524
|
for (const row of rows) {
|
|
131522
131525
|
for (const cell of row) {
|
|
131523
131526
|
const text7 = cell.trim();
|
|
131524
|
-
if (text7
|
|
131525
|
-
if (tables.length > 0 && tables[tables.length - 1].cell !== null) tables[tables.length - 1].cell?.push(text7);
|
|
131526
|
-
else out.push(quoteDepth > 0 ? text7.replace(/^/gm, "> ".repeat(quoteDepth)) : text7);
|
|
131527
|
+
if (text7 !== "") pushBlock(text7);
|
|
131527
131528
|
}
|
|
131528
131529
|
}
|
|
131529
131530
|
};
|
|
131531
|
+
const pushBlock = (text7) => {
|
|
131532
|
+
const cell = tables.length > 0 ? tables[tables.length - 1].cell : null;
|
|
131533
|
+
if (cell !== null) cell.push(`
|
|
131534
|
+
|
|
131535
|
+
${text7}
|
|
131536
|
+
|
|
131537
|
+
`);
|
|
131538
|
+
else out.push(quoteDepth > 0 ? text7.replace(/^/gm, "> ".repeat(quoteDepth)) : text7);
|
|
131539
|
+
};
|
|
131540
|
+
const closeCell = (frame) => {
|
|
131541
|
+
if (frame.cell === null) return;
|
|
131542
|
+
const text7 = frame.cell.join("").replace(/[ \t]+/g, " ").replace(/ ?\n ?/g, "\n").replace(/\n{3,}/g, "\n\n").trim();
|
|
131543
|
+
frame.cell = null;
|
|
131544
|
+
(frame.row ??= []).push(text7);
|
|
131545
|
+
};
|
|
131546
|
+
const closeRow = (frame) => {
|
|
131547
|
+
closeCell(frame);
|
|
131548
|
+
if (frame.row === null) return;
|
|
131549
|
+
frame.rows.push(frame.row);
|
|
131550
|
+
frame.row = null;
|
|
131551
|
+
};
|
|
131530
131552
|
scanHtml(html2, (event) => {
|
|
131531
131553
|
if (++events % 2e3 === 0) options2.deadline?.();
|
|
131532
131554
|
if (event.kind === "text") {
|
|
@@ -131565,12 +131587,18 @@ function reduceHtmlToMarkdown(html2, options2 = {}) {
|
|
|
131565
131587
|
}
|
|
131566
131588
|
if (name2 === "tr") {
|
|
131567
131589
|
const frame = tables[tables.length - 1];
|
|
131568
|
-
if (frame !== void 0)
|
|
131590
|
+
if (frame !== void 0) {
|
|
131591
|
+
closeRow(frame);
|
|
131592
|
+
frame.row = [];
|
|
131593
|
+
}
|
|
131569
131594
|
return;
|
|
131570
131595
|
}
|
|
131571
131596
|
if (name2 === "td" || name2 === "th") {
|
|
131572
131597
|
const frame = tables[tables.length - 1];
|
|
131573
|
-
if (frame !== void 0)
|
|
131598
|
+
if (frame !== void 0) {
|
|
131599
|
+
closeCell(frame);
|
|
131600
|
+
frame.cell = [];
|
|
131601
|
+
}
|
|
131574
131602
|
return;
|
|
131575
131603
|
}
|
|
131576
131604
|
if (name2 === "li") {
|
|
@@ -131634,20 +131662,12 @@ function reduceHtmlToMarkdown(html2, options2 = {}) {
|
|
|
131634
131662
|
}
|
|
131635
131663
|
if (name === "tr") {
|
|
131636
131664
|
const frame = tables[tables.length - 1];
|
|
131637
|
-
if (frame
|
|
131638
|
-
frame.rows.push(frame.row);
|
|
131639
|
-
frame.row = null;
|
|
131640
|
-
}
|
|
131665
|
+
if (frame !== void 0) closeRow(frame);
|
|
131641
131666
|
return;
|
|
131642
131667
|
}
|
|
131643
131668
|
if (name === "td" || name === "th") {
|
|
131644
131669
|
const frame = tables[tables.length - 1];
|
|
131645
|
-
if (frame
|
|
131646
|
-
const text7 = frame.cell.join("").replace(/\s+/g, " ").trim();
|
|
131647
|
-
frame.cell = null;
|
|
131648
|
-
if (frame.row === null) frame.row = [];
|
|
131649
|
-
frame.row.push(text7);
|
|
131650
|
-
}
|
|
131670
|
+
if (frame !== void 0) closeCell(frame);
|
|
131651
131671
|
return;
|
|
131652
131672
|
}
|
|
131653
131673
|
if (name === "ul" || name === "ol") {
|
|
@@ -131945,6 +131965,19 @@ function decompressRtf(stream) {
|
|
|
131945
131965
|
}
|
|
131946
131966
|
return out.subarray(0, length2);
|
|
131947
131967
|
}
|
|
131968
|
+
function skipUnicodeFallback(rtf, at3, count) {
|
|
131969
|
+
for (let left = count; left > 0 && at3 < rtf.length; left--) {
|
|
131970
|
+
const char = rtf[at3];
|
|
131971
|
+
if (char === "{" || char === "}") break;
|
|
131972
|
+
if (char !== "\\") {
|
|
131973
|
+
at3++;
|
|
131974
|
+
continue;
|
|
131975
|
+
}
|
|
131976
|
+
const unit = /^\\(?:'[0-9a-fA-F]{2}|[a-zA-Z]+-?\d*[ ]?|.)/s.exec(rtf.slice(at3, at3 + 40));
|
|
131977
|
+
at3 += unit === null ? 1 : unit[0].length;
|
|
131978
|
+
}
|
|
131979
|
+
return at3;
|
|
131980
|
+
}
|
|
131948
131981
|
function htmlFromEncapsulatedRtf(rtf) {
|
|
131949
131982
|
if (!/\\from(html|text)|\\\*\\htmltag/.test(rtf)) return null;
|
|
131950
131983
|
let out = "";
|
|
@@ -131952,10 +131985,13 @@ function htmlFromEncapsulatedRtf(rtf) {
|
|
|
131952
131985
|
let suppressed = 0;
|
|
131953
131986
|
let skipUntilDepth = null;
|
|
131954
131987
|
let depth = 0;
|
|
131988
|
+
let fallback = 1;
|
|
131989
|
+
const fallbacks = [];
|
|
131955
131990
|
while (at3 < rtf.length) {
|
|
131956
131991
|
const char = rtf[at3];
|
|
131957
131992
|
if (char === "{") {
|
|
131958
131993
|
depth++;
|
|
131994
|
+
fallbacks.push(fallback);
|
|
131959
131995
|
at3++;
|
|
131960
131996
|
const ahead = rtf.slice(at3, at3 + 12);
|
|
131961
131997
|
if (skipUntilDepth === null && /^\\\*\\(mhtmltag|htmlbase)/.test(ahead)) skipUntilDepth = depth;
|
|
@@ -131964,6 +132000,7 @@ function htmlFromEncapsulatedRtf(rtf) {
|
|
|
131964
132000
|
if (char === "}") {
|
|
131965
132001
|
if (skipUntilDepth !== null && depth <= skipUntilDepth) skipUntilDepth = null;
|
|
131966
132002
|
depth--;
|
|
132003
|
+
fallback = fallbacks.pop() ?? 1;
|
|
131967
132004
|
at3++;
|
|
131968
132005
|
continue;
|
|
131969
132006
|
}
|
|
@@ -132000,11 +132037,16 @@ function htmlFromEncapsulatedRtf(rtf) {
|
|
|
132000
132037
|
if (suppressed === 0 && skipUntilDepth === null) out += " ";
|
|
132001
132038
|
continue;
|
|
132002
132039
|
}
|
|
132040
|
+
if (word === "uc" && parameter !== void 0) {
|
|
132041
|
+
fallback = Math.max(0, Number(parameter));
|
|
132042
|
+
continue;
|
|
132043
|
+
}
|
|
132003
132044
|
if (word === "u" && parameter !== void 0) {
|
|
132004
132045
|
if (suppressed === 0 && skipUntilDepth === null) {
|
|
132005
132046
|
const code3 = Number(parameter);
|
|
132006
132047
|
out += String.fromCharCode(code3 < 0 ? code3 + 65536 : code3);
|
|
132007
132048
|
}
|
|
132049
|
+
at3 = skipUnicodeFallback(rtf, at3, fallback);
|
|
132008
132050
|
continue;
|
|
132009
132051
|
}
|
|
132010
132052
|
continue;
|
|
@@ -132024,10 +132066,13 @@ function textFromRtf(rtf) {
|
|
|
132024
132066
|
let at3 = 0;
|
|
132025
132067
|
let skipUntilDepth = null;
|
|
132026
132068
|
let depth = 0;
|
|
132069
|
+
let fallback = 1;
|
|
132070
|
+
const fallbacks = [];
|
|
132027
132071
|
while (at3 < rtf.length) {
|
|
132028
132072
|
const char = rtf[at3];
|
|
132029
132073
|
if (char === "{") {
|
|
132030
132074
|
depth++;
|
|
132075
|
+
fallbacks.push(fallback);
|
|
132031
132076
|
at3++;
|
|
132032
132077
|
if (skipUntilDepth === null && /^\\(\*|fonttbl|colortbl|stylesheet|info|pict)/.test(rtf.slice(at3, at3 + 12))) {
|
|
132033
132078
|
skipUntilDepth = depth;
|
|
@@ -132037,6 +132082,7 @@ function textFromRtf(rtf) {
|
|
|
132037
132082
|
if (char === "}") {
|
|
132038
132083
|
if (skipUntilDepth !== null && depth <= skipUntilDepth) skipUntilDepth = null;
|
|
132039
132084
|
depth--;
|
|
132085
|
+
fallback = fallbacks.pop() ?? 1;
|
|
132040
132086
|
at3++;
|
|
132041
132087
|
continue;
|
|
132042
132088
|
}
|
|
@@ -132059,13 +132105,21 @@ function textFromRtf(rtf) {
|
|
|
132059
132105
|
continue;
|
|
132060
132106
|
}
|
|
132061
132107
|
at3 += control[0].length;
|
|
132108
|
+
if (control[1] === "uc" && control[2] !== void 0) {
|
|
132109
|
+
fallback = Math.max(0, Number(control[2]));
|
|
132110
|
+
continue;
|
|
132111
|
+
}
|
|
132112
|
+
if (control[1] === "u" && control[2] !== void 0) {
|
|
132113
|
+
if (writable) {
|
|
132114
|
+
const code3 = Number(control[2]);
|
|
132115
|
+
out += String.fromCharCode(code3 < 0 ? code3 + 65536 : code3);
|
|
132116
|
+
}
|
|
132117
|
+
at3 = skipUnicodeFallback(rtf, at3, fallback);
|
|
132118
|
+
continue;
|
|
132119
|
+
}
|
|
132062
132120
|
if (!writable) continue;
|
|
132063
132121
|
if (control[1] === "par" || control[1] === "line") out += "\n";
|
|
132064
132122
|
else if (control[1] === "tab") out += " ";
|
|
132065
|
-
else if (control[1] === "u" && control[2] !== void 0) {
|
|
132066
|
-
const code3 = Number(control[2]);
|
|
132067
|
-
out += String.fromCharCode(code3 < 0 ? code3 + 65536 : code3);
|
|
132068
|
-
}
|
|
132069
132123
|
continue;
|
|
132070
132124
|
}
|
|
132071
132125
|
if (char === "\r" || char === "\n") {
|
|
@@ -132627,18 +132681,26 @@ function parseEntity(entity, state2, depth) {
|
|
|
132627
132681
|
const boundary = contentType.params.boundary;
|
|
132628
132682
|
if (boundary === void 0 || boundary === "") {
|
|
132629
132683
|
state2.notes.push(`a ${mediaType} part declares no boundary; it was read as a single part`);
|
|
132630
|
-
return node2;
|
|
132684
|
+
return asSinglePart(node2);
|
|
132631
132685
|
}
|
|
132632
132686
|
if (depth >= MAX_DEPTH2) {
|
|
132633
132687
|
state2.notes.push(`parts nested deeper than ${MAX_DEPTH2} were not read`);
|
|
132634
132688
|
return node2;
|
|
132635
132689
|
}
|
|
132636
|
-
|
|
132690
|
+
const pieces = splitMultipart(body, boundary, state2);
|
|
132691
|
+
if (pieces === void 0) {
|
|
132692
|
+
state2.notes.push("a multipart part's boundary was never found; it was read as a single part");
|
|
132693
|
+
return asSinglePart(node2);
|
|
132694
|
+
}
|
|
132695
|
+
for (const piece of pieces) {
|
|
132637
132696
|
node2.children.push(parseEntity(piece, state2, depth + 1));
|
|
132638
132697
|
}
|
|
132639
132698
|
}
|
|
132640
132699
|
return node2;
|
|
132641
132700
|
}
|
|
132701
|
+
function asSinglePart(node2) {
|
|
132702
|
+
return { ...node2, mediaType: "text/plain" };
|
|
132703
|
+
}
|
|
132642
132704
|
function splitMultipart(body, boundary, state2) {
|
|
132643
132705
|
const marker = Buffer.from(`--${boundary}`, "latin1");
|
|
132644
132706
|
const starts = [];
|
|
@@ -132650,10 +132712,7 @@ function splitMultipart(body, boundary, state2) {
|
|
|
132650
132712
|
if (found === 0 || body[found - 1] === 10) starts.push(found);
|
|
132651
132713
|
at3 = found + marker.length;
|
|
132652
132714
|
}
|
|
132653
|
-
if (starts.length === 0)
|
|
132654
|
-
state2.notes.push("a multipart part's boundary was never found; it was read as a single part");
|
|
132655
|
-
return [];
|
|
132656
|
-
}
|
|
132715
|
+
if (starts.length === 0) return void 0;
|
|
132657
132716
|
const parts = [];
|
|
132658
132717
|
for (let index4 = 0; index4 < starts.length; index4++) {
|
|
132659
132718
|
const start = starts[index4];
|
|
@@ -198419,8 +198478,7 @@ var TerminalManager = class {
|
|
|
198419
198478
|
this.socketSessions.delete(socket);
|
|
198420
198479
|
}
|
|
198421
198480
|
}
|
|
198422
|
-
|
|
198423
|
-
});
|
|
198481
|
+
endSession(session);
|
|
198424
198482
|
onExit(terminalId, exitCode);
|
|
198425
198483
|
}));
|
|
198426
198484
|
return session;
|
|
@@ -198572,7 +198630,7 @@ async function firstChildOnMac(pid) {
|
|
|
198572
198630
|
async function argv(pid) {
|
|
198573
198631
|
return (await fs15.readFile(`/proc/${pid}/cmdline`, "utf8").catch(() => "")).split("\0");
|
|
198574
198632
|
}
|
|
198575
|
-
var RUNNER_LAYERS = /* @__PURE__ */ new Set(["lxc-exec", "bwrap"]);
|
|
198633
|
+
var RUNNER_LAYERS = /* @__PURE__ */ new Set(["lxc-exec", "bwrap", "landstrip"]);
|
|
198576
198634
|
async function childrenOf3(pid) {
|
|
198577
198635
|
const children = [];
|
|
198578
198636
|
try {
|
|
@@ -199815,144 +199873,12 @@ var RuntimeUnsupportedError = class extends Error {
|
|
|
199815
199873
|
}
|
|
199816
199874
|
};
|
|
199817
199875
|
|
|
199818
|
-
// ../server/src/projectModelTool.ts
|
|
199819
|
-
import { readFile as readFile2 } from "node:fs/promises";
|
|
199820
|
-
import path36 from "node:path";
|
|
199821
|
-
var PROJECT_MODEL_TOOL = "present_project_model";
|
|
199822
|
-
var SETUP_SKILL = /(?:^|[/\\])structured-exchange-project[/\\]SKILL\.md$/i;
|
|
199823
|
-
var MODEL_FORMAT = /"urn:structured-exchange-(?:profile|profile-registry|rules):\d+"/;
|
|
199824
|
-
var UNUSABLE_REGISTRY = /structured-exchange (?:profile )?registry cannot be used/;
|
|
199825
|
-
var posix = (value) => value.split(path36.sep).join("/").replace(/\\/g, "/");
|
|
199826
|
-
async function projectModelFiles(projectRoot) {
|
|
199827
|
-
const files = [STRUCTURED_EXCHANGE_PROFILE_REGISTRY_PATH];
|
|
199828
|
-
try {
|
|
199829
|
-
const registry = JSON.parse(await readFile2(path36.join(projectRoot, STRUCTURED_EXCHANGE_PROFILE_REGISTRY_PATH), "utf8"));
|
|
199830
|
-
for (const list3 of [registry.profiles, registry.rules]) {
|
|
199831
|
-
if (!Array.isArray(list3)) continue;
|
|
199832
|
-
for (const entry of list3) if (typeof entry === "string" && entry !== "") files.push(posix(path36.normalize(entry)));
|
|
199833
|
-
}
|
|
199834
|
-
} catch {
|
|
199835
|
-
}
|
|
199836
|
-
return files;
|
|
199837
|
-
}
|
|
199838
|
-
var SETUP_SKILL_COMMAND = /(?:^|\s)\/skill:structured-exchange-project(?=$|\s)/;
|
|
199839
|
-
function promptNamesProjectModel(text7, files) {
|
|
199840
|
-
if (SETUP_SKILL_COMMAND.test(text7)) return true;
|
|
199841
|
-
const normalized = posix(text7);
|
|
199842
|
-
return files.some((file) => {
|
|
199843
|
-
let from = 0;
|
|
199844
|
-
for (; ; ) {
|
|
199845
|
-
const at3 = normalized.indexOf(file, from);
|
|
199846
|
-
if (at3 === -1) return false;
|
|
199847
|
-
const before = at3 === 0 ? "" : normalized[at3 - 1];
|
|
199848
|
-
const after = normalized[at3 + file.length] ?? "";
|
|
199849
|
-
if (/^$|[\s"'`<(/@]/.test(before) && /^$|[\s"'`>),;:!?.]/.test(after)) return true;
|
|
199850
|
-
from = at3 + 1;
|
|
199851
|
-
}
|
|
199852
|
-
});
|
|
199853
|
-
}
|
|
199854
|
-
function toolCallTouchesProjectModel(args, roots, files) {
|
|
199855
|
-
if (args === null || typeof args !== "object") return false;
|
|
199856
|
-
const { path: target, content: content3 } = args;
|
|
199857
|
-
if (typeof content3 === "string" && MODEL_FORMAT.test(content3)) return true;
|
|
199858
|
-
if (typeof target !== "string" || target === "") return false;
|
|
199859
|
-
if (SETUP_SKILL.test(target)) return true;
|
|
199860
|
-
return roots.some((root2) => {
|
|
199861
|
-
const relative2 = posix(path36.relative(root2, path36.resolve(root2, target)));
|
|
199862
|
-
return files.includes(relative2);
|
|
199863
|
-
});
|
|
199864
|
-
}
|
|
199865
|
-
var REGISTRY_BOUND_TOOLS = /* @__PURE__ */ new Set(["present_structure", "write_structure_figure", "write_structure_table"]);
|
|
199866
|
-
function resultReportsUnusableRegistry(toolName, text7) {
|
|
199867
|
-
return REGISTRY_BOUND_TOOLS.has(toolName) && UNUSABLE_REGISTRY.test(text7);
|
|
199868
|
-
}
|
|
199869
|
-
|
|
199870
|
-
// ../server/src/documentTools.ts
|
|
199871
|
-
var PRESENTATION_TOOLS = ["pptx_layouts", "pptx_create", "pptx_update", "pptx_render"];
|
|
199872
|
-
var PRESENTATION_SKILL = "pptx-from-template";
|
|
199873
|
-
var WORD_TOOLS = ["docx_styles", "docx_create", "docx_update", "docx_restyle", "docx_render"];
|
|
199874
|
-
var WORD_SKILL = "docx-from-template";
|
|
199875
|
-
var WORD_COMPARE_TOOL = "docx_compare";
|
|
199876
|
-
var EXTRACTORS = {
|
|
199877
|
-
// `pdf_render` travels with the extractor because it is the answer to something the
|
|
199878
|
-
// extractor says: a page carrying neither text nor an image tells the caller to draw
|
|
199879
|
-
// it, and that advice is worthless if the tool it names was never offered.
|
|
199880
|
-
pdf: ["pdf_extract", "pdf_render"],
|
|
199881
|
-
// A Word document may be read, updated, or be the template a new one is written from.
|
|
199882
|
-
docx: ["docx_extract", ...WORD_TOOLS],
|
|
199883
|
-
// A .dotx is only ever a template.
|
|
199884
|
-
dotx: WORD_TOOLS,
|
|
199885
|
-
xlsx: ["xlsx_extract"],
|
|
199886
|
-
// A deck may be read, or be the template a new one is built from.
|
|
199887
|
-
pptx: ["pptx_extract", ...PRESENTATION_TOOLS],
|
|
199888
|
-
// A .potx is only ever a template.
|
|
199889
|
-
potx: PRESENTATION_TOOLS,
|
|
199890
|
-
// A message is read by one tool, which also unpacks what it carries. The
|
|
199891
|
-
// extractors for those attachments are published when they are *written*, not
|
|
199892
|
-
// here: naming a `.msg` says nothing about what is inside it.
|
|
199893
|
-
msg: ["mail_extract"],
|
|
199894
|
-
eml: ["mail_extract"],
|
|
199895
|
-
emlx: ["mail_extract"]
|
|
199896
|
-
};
|
|
199897
|
-
var DOCUMENT_TOOLS = [...new Set(Object.values(EXTRACTORS).flat()), WORD_COMPARE_TOOL];
|
|
199898
|
-
var TOOL_SEARCH_TOOL = "tool_search";
|
|
199899
|
-
var DEFERRED_TOOLS = [
|
|
199900
|
-
...DOCUMENT_TOOLS,
|
|
199901
|
-
PROJECT_MODEL_TOOL,
|
|
199902
|
-
"drawio_check",
|
|
199903
|
-
"poster_check",
|
|
199904
|
-
"poster_pictures",
|
|
199905
|
-
"compare_timelines",
|
|
199906
|
-
"write_structure_figure",
|
|
199907
|
-
"write_structure_table"
|
|
199908
|
-
];
|
|
199909
|
-
function deferOnDemandTools(tools) {
|
|
199910
|
-
return tools.map((tool) => DEFERRED_TOOLS.includes(tool.name) ? { ...tool, exposure: "deferred" } : tool);
|
|
199911
|
-
}
|
|
199912
|
-
function extractorsFor(extension2, platform) {
|
|
199913
|
-
const tools = EXTRACTORS[extension2] ?? [];
|
|
199914
|
-
return extension2 === "docx" && platform === "win32" ? [...tools, WORD_COMPARE_TOOL] : tools;
|
|
199915
|
-
}
|
|
199916
|
-
var MENTION = /(?:^|[\s"'`<])(?:[^\s"'`<>]*[/\\])?[^\s"'`<>/\\]+\.(pdf|docx|dotx|xlsx|pptx|potx|msg|eml|emlx)(?=$|[\s"'`>)\],;:!?.])/gi;
|
|
199917
|
-
function documentToolsFor(text7, platform = process.platform) {
|
|
199918
|
-
const found = /* @__PURE__ */ new Set();
|
|
199919
|
-
for (const match of text7.matchAll(MENTION)) {
|
|
199920
|
-
for (const tool of extractorsFor(match[1].toLowerCase(), platform)) found.add(tool);
|
|
199921
|
-
}
|
|
199922
|
-
if (new RegExp(`(?:^|\\s)/skill:${PRESENTATION_SKILL}(?=$|\\s)`).test(text7)) {
|
|
199923
|
-
for (const tool of PRESENTATION_TOOLS) found.add(tool);
|
|
199924
|
-
}
|
|
199925
|
-
if (new RegExp(`(?:^|\\s)/skill:${WORD_SKILL}(?=$|\\s)`).test(text7)) {
|
|
199926
|
-
for (const tool of WORD_TOOLS) found.add(tool);
|
|
199927
|
-
}
|
|
199928
|
-
return DOCUMENT_TOOLS.filter((tool) => found.has(tool));
|
|
199929
|
-
}
|
|
199930
|
-
function documentToolsForWrittenPaths(paths) {
|
|
199931
|
-
const found = /* @__PURE__ */ new Set();
|
|
199932
|
-
for (const written of paths) {
|
|
199933
|
-
const extension2 = /\.([A-Za-z0-9]+)$/.exec(written.replace(/\\/g, "/"))?.[1]?.toLowerCase() ?? "";
|
|
199934
|
-
for (const tool of EXTRACTORS[extension2] ?? []) {
|
|
199935
|
-
if (tool.endsWith("_extract") || tool === "pdf_render") found.add(tool);
|
|
199936
|
-
}
|
|
199937
|
-
}
|
|
199938
|
-
return DOCUMENT_TOOLS.filter((tool) => found.has(tool));
|
|
199939
|
-
}
|
|
199940
|
-
function documentToolsForToolCall(toolName, args) {
|
|
199941
|
-
const target = args?.path;
|
|
199942
|
-
if (typeof target !== "string") return [];
|
|
199943
|
-
const normalized = target.replace(/\\/g, "/");
|
|
199944
|
-
if (toolName === "read" && normalized.endsWith(`/${PRESENTATION_SKILL}/SKILL.md`)) return PRESENTATION_TOOLS;
|
|
199945
|
-
if (toolName === "read" && normalized.endsWith(`/${WORD_SKILL}/SKILL.md`)) return WORD_TOOLS;
|
|
199946
|
-
if (/\.(docx|dotx)$/i.test(normalized)) return WORD_TOOLS;
|
|
199947
|
-
return /\.(pptx|potx)$/i.test(normalized) ? PRESENTATION_TOOLS : [];
|
|
199948
|
-
}
|
|
199949
|
-
|
|
199950
199876
|
// ../server/src/embeddedRuntime.ts
|
|
199951
199877
|
import { createAgentSessionRuntime } from "@earendil-works/pi-coding-agent";
|
|
199952
199878
|
|
|
199953
199879
|
// ../server/src/credentials.ts
|
|
199954
199880
|
import fs18 from "node:fs/promises";
|
|
199955
|
-
import
|
|
199881
|
+
import path36 from "node:path";
|
|
199956
199882
|
import { ModelRuntime } from "@earendil-works/pi-coding-agent";
|
|
199957
199883
|
var CredentialError = class extends Error {
|
|
199958
199884
|
};
|
|
@@ -199961,8 +199887,8 @@ var CredentialSyncError = class extends Error {
|
|
|
199961
199887
|
var PROVIDER_ID = /^[a-z0-9][a-z0-9._-]{0,63}$/i;
|
|
199962
199888
|
async function knownProviders(agentDir) {
|
|
199963
199889
|
const modelRuntime = await ModelRuntime.create({
|
|
199964
|
-
authPath:
|
|
199965
|
-
modelsPath:
|
|
199890
|
+
authPath: path36.join(agentDir, "auth.json"),
|
|
199891
|
+
modelsPath: path36.join(agentDir, "models.json"),
|
|
199966
199892
|
allowModelNetwork: false
|
|
199967
199893
|
});
|
|
199968
199894
|
return [...new Set(modelRuntime.getProviders().map((p) => p.id))].sort();
|
|
@@ -199982,7 +199908,7 @@ function validBaseUrl(baseUrl) {
|
|
|
199982
199908
|
async function storeApiKey(agentDir, provider, apiKey, modelRuntime, options2) {
|
|
199983
199909
|
if (!validProviderId(provider)) throw new CredentialError(`Invalid provider name: ${provider}`);
|
|
199984
199910
|
if (typeof apiKey !== "string" || apiKey.trim().length === 0) throw new CredentialError("An API key is required");
|
|
199985
|
-
const authPath =
|
|
199911
|
+
const authPath = path36.join(agentDir, "auth.json");
|
|
199986
199912
|
await fs18.mkdir(agentDir, { recursive: true }).catch(() => {
|
|
199987
199913
|
});
|
|
199988
199914
|
try {
|
|
@@ -200014,7 +199940,7 @@ async function storeProvider(agentDir, declaration) {
|
|
|
200014
199940
|
if (!Array.isArray(models) || models.length === 0 || models.some((id) => typeof id !== "string" || id.trim() === "")) {
|
|
200015
199941
|
throw new CredentialError("At least one model id is required");
|
|
200016
199942
|
}
|
|
200017
|
-
const modelsPath =
|
|
199943
|
+
const modelsPath = path36.join(agentDir, "models.json");
|
|
200018
199944
|
await fs18.mkdir(agentDir, { recursive: true }).catch(() => {
|
|
200019
199945
|
});
|
|
200020
199946
|
let file = {};
|
|
@@ -200089,7 +200015,7 @@ import { randomUUID as randomUUID2 } from "node:crypto";
|
|
|
200089
200015
|
|
|
200090
200016
|
// ../node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.js
|
|
200091
200017
|
import * as fs19 from "node:fs";
|
|
200092
|
-
import * as
|
|
200018
|
+
import * as path37 from "node:path";
|
|
200093
200019
|
|
|
200094
200020
|
// ../node_modules/marked/lib/marked.esm.js
|
|
200095
200021
|
function A3() {
|
|
@@ -202205,7 +202131,7 @@ function sliceWithWidth(line, startCol, length2, strict = false) {
|
|
|
202205
202131
|
if (currentCol >= startCol && currentCol < endCol) {
|
|
202206
202132
|
result += pendingAnsi + ansi.code;
|
|
202207
202133
|
pendingAnsi = "";
|
|
202208
|
-
} else if (currentCol < startCol)
|
|
202134
|
+
} else if (currentCol < startCol && !ansi.code.startsWith("\x1B_"))
|
|
202209
202135
|
pendingAnsi += ansi.code;
|
|
202210
202136
|
i2 += ansi.length;
|
|
202211
202137
|
continue;
|
|
@@ -203481,7 +203407,8 @@ function detectCapabilitiesFromEnvironment(tmuxForwardsHyperlink) {
|
|
|
203481
203407
|
if (process.env.WT_SESSION) {
|
|
203482
203408
|
return { images: null, trueColor: true, hyperlinks: true };
|
|
203483
203409
|
}
|
|
203484
|
-
|
|
203410
|
+
const isAlacritty = termProgram === "alacritty" || term.startsWith("alacritty") || process.env.ALACRITTY_WINDOW_ID;
|
|
203411
|
+
if (isAlacritty || termProgram === "vscode" || termProgram === "zed") {
|
|
203485
203412
|
return { images: null, trueColor: true, hyperlinks: true };
|
|
203486
203413
|
}
|
|
203487
203414
|
if (terminalEmulator === "jetbrains-jediterm") {
|
|
@@ -204566,7 +204493,7 @@ var TuiBase = class _TuiBase extends Container {
|
|
|
204566
204493
|
for (let i2 = 0; i2 < lines.length; i2++) {
|
|
204567
204494
|
const line = lines[i2];
|
|
204568
204495
|
if (!isImageLine(line)) {
|
|
204569
|
-
lines[i2] = normalizeTerminalOutput(line) + reset;
|
|
204496
|
+
lines[i2] = normalizeTerminalOutput(line.replaceAll(CURSOR_MARKER, "")) + reset;
|
|
204570
204497
|
}
|
|
204571
204498
|
}
|
|
204572
204499
|
return lines;
|
|
@@ -204590,7 +204517,7 @@ var TuiBase = class _TuiBase extends Container {
|
|
|
204590
204517
|
if (markerIndex !== -1) {
|
|
204591
204518
|
const beforeMarker = line.slice(0, markerIndex);
|
|
204592
204519
|
const col = visibleWidth(beforeMarker);
|
|
204593
|
-
lines[row] = line.
|
|
204520
|
+
lines[row] = line.replaceAll(CURSOR_MARKER, "");
|
|
204594
204521
|
return { row, col };
|
|
204595
204522
|
}
|
|
204596
204523
|
}
|
|
@@ -208042,8 +207969,7 @@ var TuiAltScreen = class extends TuiBase {
|
|
|
208042
207969
|
const fullRedraw = this.previousScreen.length === 0 || this.previousScreenWidth !== width || this.previousScreenHeight !== height;
|
|
208043
207970
|
const changedRows = screen.map((line, row) => line !== this.previousScreen[row]);
|
|
208044
207971
|
const imageAnchorsNeedRedraw = screen.some((line, row) => changedRows[row] && (isImageLine(line) || isImageLine(this.previousScreen[row] ?? "")));
|
|
208045
|
-
const
|
|
208046
|
-
const imageCellsNeedRedraw = !imageAnchorsNeedRedraw && isWezTerm && this.imageProtocol === "kitty" && changedRows.some(Boolean) && screen.some((line, row) => {
|
|
207972
|
+
const imageCellsNeedRedraw = !imageAnchorsNeedRedraw && this.imageProtocol === "kitty" && changedRows.some(Boolean) && screen.some((line, row) => {
|
|
208047
207973
|
const placementRows = getKittyImagePlacementRows(line);
|
|
208048
207974
|
if (placementRows === void 0)
|
|
208049
207975
|
return false;
|
|
@@ -208069,7 +207995,7 @@ var TuiAltScreen = class extends TuiBase {
|
|
|
208069
207995
|
buffer += deleteAllKittyPlacements();
|
|
208070
207996
|
}
|
|
208071
207997
|
buffer += preparedKittyScreen.evictedImageDeletion;
|
|
208072
|
-
const drawKittyImagesLast = redrawImages && this.imageProtocol === "kitty" && screen.some(isImageLine)
|
|
207998
|
+
const drawKittyImagesLast = redrawImages && this.imageProtocol === "kitty" && screen.some(isImageLine);
|
|
208073
207999
|
if (drawKittyImagesLast) {
|
|
208074
208000
|
for (let row = 0; row < height; row++) {
|
|
208075
208001
|
if (!fullRedraw && !imagesNeedRedraw && screen[row] === this.previousScreen[row])
|
|
@@ -208688,7 +208614,7 @@ var import_cross_spawn = __toESM(require_cross_spawn(), 1);
|
|
|
208688
208614
|
|
|
208689
208615
|
// ../node_modules/@earendil-works/pi-coding-agent/dist/utils/paths.js
|
|
208690
208616
|
import { homedir as homedir3 } from "node:os";
|
|
208691
|
-
import { isAbsolute, join, resolve as nodeResolvePath, posix
|
|
208617
|
+
import { isAbsolute, join, resolve as nodeResolvePath, posix, relative, sep, win32 } from "node:path";
|
|
208692
208618
|
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
208693
208619
|
var UNICODE_SPACES = /[\u00A0\u2000-\u200A\u202F\u205F\u3000]/g;
|
|
208694
208620
|
function normalizeWindowsShellPath(filePath) {
|
|
@@ -209637,8 +209563,8 @@ var BUILTIN_THEMES;
|
|
|
209637
209563
|
function getBuiltinThemes() {
|
|
209638
209564
|
if (!BUILTIN_THEMES) {
|
|
209639
209565
|
const themesDir = getThemesDir();
|
|
209640
|
-
const darkPath =
|
|
209641
|
-
const lightPath =
|
|
209566
|
+
const darkPath = path37.join(themesDir, "dark.json");
|
|
209567
|
+
const lightPath = path37.join(themesDir, "light.json");
|
|
209642
209568
|
BUILTIN_THEMES = {
|
|
209643
209569
|
dark: JSON.parse(stripBom(fs19.readFileSync(darkPath, "utf-8"))),
|
|
209644
209570
|
light: JSON.parse(stripBom(fs19.readFileSync(lightPath, "utf-8")))
|
|
@@ -209677,7 +209603,7 @@ function loadThemeJson(name) {
|
|
|
209677
209603
|
throw new Error(`Theme "${name}" does not have a source path for export`);
|
|
209678
209604
|
}
|
|
209679
209605
|
const customThemesDir = getCustomThemesDir();
|
|
209680
|
-
const themePath =
|
|
209606
|
+
const themePath = path37.join(customThemesDir, `${name}.json`);
|
|
209681
209607
|
if (!fs19.existsSync(themePath)) {
|
|
209682
209608
|
throw new Error(`Theme not found: ${name}`);
|
|
209683
209609
|
}
|
|
@@ -209950,13 +209876,13 @@ var ExtensionUiBridge = class {
|
|
|
209950
209876
|
};
|
|
209951
209877
|
|
|
209952
209878
|
// ../server/src/convert.ts
|
|
209953
|
-
import
|
|
209879
|
+
import path38 from "node:path";
|
|
209954
209880
|
var MAX_TOOL_OUTPUT = 2e4;
|
|
209955
209881
|
function relativizeUnderRoot(root2, maybePath) {
|
|
209956
|
-
if (!
|
|
209957
|
-
const rel2 =
|
|
209958
|
-
if (rel2 === "" || rel2.startsWith("..") ||
|
|
209959
|
-
return rel2.split(
|
|
209882
|
+
if (!path38.isAbsolute(maybePath)) return void 0;
|
|
209883
|
+
const rel2 = path38.relative(root2, maybePath);
|
|
209884
|
+
if (rel2 === "" || rel2.startsWith("..") || path38.isAbsolute(rel2)) return void 0;
|
|
209885
|
+
return rel2.split(path38.sep).join("/");
|
|
209960
209886
|
}
|
|
209961
209887
|
function userMessageText(content3, browserRoot) {
|
|
209962
209888
|
const text7 = typeof content3 === "string" ? content3 : Array.isArray(content3) ? content3.filter((c2) => c2.type === "text").map((c2) => c2.text ?? "").filter(Boolean).join("\n") : "";
|
|
@@ -210598,7 +210524,7 @@ var EmbeddedRuntime = class {
|
|
|
210598
210524
|
}
|
|
210599
210525
|
break;
|
|
210600
210526
|
case "tool_execution_start":
|
|
210601
|
-
if (
|
|
210527
|
+
if (this.session.getToolDefinition(event.toolName)?.exposure === "deferred" && this.session.getCallableToolNames().includes(event.toolName)) {
|
|
210602
210528
|
this.setToolPublished(event.toolName, true);
|
|
210603
210529
|
const tool = this.session.agent.state.tools.find((candidate) => candidate.name === event.toolName);
|
|
210604
210530
|
if (tool && this.executionTools && !this.executionTools.some((candidate) => candidate.name === tool.name)) this.executionTools.push(tool);
|
|
@@ -211966,16 +211892,418 @@ function isSuspendedQueueRefusal(error) {
|
|
|
211966
211892
|
return error instanceof Error && error.message.includes("queued session input is suspended");
|
|
211967
211893
|
}
|
|
211968
211894
|
|
|
211895
|
+
// ../server/src/projectModelTool.ts
|
|
211896
|
+
import { readFile as readFile2 } from "node:fs/promises";
|
|
211897
|
+
import path39 from "node:path";
|
|
211898
|
+
var PROJECT_MODEL_TOOL = "present_project_model";
|
|
211899
|
+
var SETUP_SKILL = /(?:^|[/\\])structured-exchange-project[/\\]SKILL\.md$/i;
|
|
211900
|
+
var MODEL_FORMAT = /"urn:structured-exchange-(?:profile|profile-registry|rules):\d+"/;
|
|
211901
|
+
var UNUSABLE_REGISTRY = /structured-exchange (?:profile )?registry cannot be used/;
|
|
211902
|
+
var posix2 = (value) => value.split(path39.sep).join("/").replace(/\\/g, "/");
|
|
211903
|
+
async function projectModelFiles(projectRoot) {
|
|
211904
|
+
const files = [STRUCTURED_EXCHANGE_PROFILE_REGISTRY_PATH];
|
|
211905
|
+
try {
|
|
211906
|
+
const registry = JSON.parse(await readFile2(path39.join(projectRoot, STRUCTURED_EXCHANGE_PROFILE_REGISTRY_PATH), "utf8"));
|
|
211907
|
+
for (const list3 of [registry.profiles, registry.rules]) {
|
|
211908
|
+
if (!Array.isArray(list3)) continue;
|
|
211909
|
+
for (const entry of list3) if (typeof entry === "string" && entry !== "") files.push(posix2(path39.normalize(entry)));
|
|
211910
|
+
}
|
|
211911
|
+
} catch {
|
|
211912
|
+
}
|
|
211913
|
+
return files;
|
|
211914
|
+
}
|
|
211915
|
+
var SETUP_SKILL_COMMAND = /(?:^|\s)\/skill:structured-exchange-project(?=$|\s)/;
|
|
211916
|
+
function promptNamesProjectModel(text7, files) {
|
|
211917
|
+
if (SETUP_SKILL_COMMAND.test(text7)) return true;
|
|
211918
|
+
const normalized = posix2(text7);
|
|
211919
|
+
return files.some((file) => {
|
|
211920
|
+
let from = 0;
|
|
211921
|
+
for (; ; ) {
|
|
211922
|
+
const at3 = normalized.indexOf(file, from);
|
|
211923
|
+
if (at3 === -1) return false;
|
|
211924
|
+
const before = at3 === 0 ? "" : normalized[at3 - 1];
|
|
211925
|
+
const after = normalized[at3 + file.length] ?? "";
|
|
211926
|
+
if (/^$|[\s"'`<(/@]/.test(before) && /^$|[\s"'`>),;:!?.]/.test(after)) return true;
|
|
211927
|
+
from = at3 + 1;
|
|
211928
|
+
}
|
|
211929
|
+
});
|
|
211930
|
+
}
|
|
211931
|
+
function toolCallTouchesProjectModel(args, roots, files) {
|
|
211932
|
+
if (args === null || typeof args !== "object") return false;
|
|
211933
|
+
const { path: target, content: content3 } = args;
|
|
211934
|
+
if (typeof content3 === "string" && MODEL_FORMAT.test(content3)) return true;
|
|
211935
|
+
if (typeof target !== "string" || target === "") return false;
|
|
211936
|
+
if (SETUP_SKILL.test(target)) return true;
|
|
211937
|
+
return roots.some((root2) => {
|
|
211938
|
+
const relative2 = posix2(path39.relative(root2, path39.resolve(root2, target)));
|
|
211939
|
+
return files.includes(relative2);
|
|
211940
|
+
});
|
|
211941
|
+
}
|
|
211942
|
+
var REGISTRY_BOUND_TOOLS = /* @__PURE__ */ new Set(["present_structure", "write_structure_figure", "write_structure_table"]);
|
|
211943
|
+
function resultReportsUnusableRegistry(toolName, text7) {
|
|
211944
|
+
return REGISTRY_BOUND_TOOLS.has(toolName) && UNUSABLE_REGISTRY.test(text7);
|
|
211945
|
+
}
|
|
211946
|
+
|
|
211947
|
+
// ../server/src/workPlanStore.ts
|
|
211948
|
+
import fs21 from "node:fs/promises";
|
|
211949
|
+
import { realpathSync as realpathSync5 } from "node:fs";
|
|
211950
|
+
import path40 from "node:path";
|
|
211951
|
+
var workPlanPath = (sessionFile) => `${sessionFile}.work-plan.json`;
|
|
211952
|
+
function sameSessionFile(left, right) {
|
|
211953
|
+
if (left === void 0 || right === void 0) return left === right;
|
|
211954
|
+
try {
|
|
211955
|
+
return realpathSync5.native(path40.resolve(left)) === realpathSync5.native(path40.resolve(right));
|
|
211956
|
+
} catch {
|
|
211957
|
+
return path40.resolve(left) === path40.resolve(right);
|
|
211958
|
+
}
|
|
211959
|
+
}
|
|
211960
|
+
async function loadWorkPlan(sessionFile) {
|
|
211961
|
+
if (!sessionFile) return null;
|
|
211962
|
+
try {
|
|
211963
|
+
return validateWorkPlan(JSON.parse(await fs21.readFile(workPlanPath(sessionFile), "utf8")));
|
|
211964
|
+
} catch (error) {
|
|
211965
|
+
if (error.code === "ENOENT") return null;
|
|
211966
|
+
throw new Error(`Cannot load the Work Plan: ${error instanceof Error ? error.message : String(error)}`);
|
|
211967
|
+
}
|
|
211968
|
+
}
|
|
211969
|
+
async function persist(sessionFile, plan) {
|
|
211970
|
+
const target = workPlanPath(sessionFile);
|
|
211971
|
+
if (plan === null) {
|
|
211972
|
+
await fs21.unlink(target).catch((error) => {
|
|
211973
|
+
if (error.code !== "ENOENT") throw error;
|
|
211974
|
+
});
|
|
211975
|
+
return;
|
|
211976
|
+
}
|
|
211977
|
+
const temporary = path40.join(path40.dirname(target), `.${path40.basename(target)}.${process.pid}.${Date.now()}.tmp`);
|
|
211978
|
+
try {
|
|
211979
|
+
await fs21.writeFile(temporary, `${JSON.stringify(plan, null, 2)}
|
|
211980
|
+
`, { encoding: "utf8", mode: 384, flag: "wx" });
|
|
211981
|
+
await fs21.rename(temporary, target);
|
|
211982
|
+
} catch (error) {
|
|
211983
|
+
await fs21.unlink(temporary).catch(() => {
|
|
211984
|
+
});
|
|
211985
|
+
throw error;
|
|
211986
|
+
}
|
|
211987
|
+
}
|
|
211988
|
+
async function applyWorkPlanMutation(sessionFile, mutation) {
|
|
211989
|
+
if (!sessionFile) throw new Error("The session has no persistent file yet");
|
|
211990
|
+
const current = await loadWorkPlan(sessionFile);
|
|
211991
|
+
const next = mutateWorkPlan(current, mutation);
|
|
211992
|
+
if (mutation.action !== "get") await persist(sessionFile, next);
|
|
211993
|
+
return next;
|
|
211994
|
+
}
|
|
211995
|
+
async function copyWorkPlan(sourceSessionFile, targetSessionFile) {
|
|
211996
|
+
if (!sourceSessionFile || !targetSessionFile || sourceSessionFile === targetSessionFile) return;
|
|
211997
|
+
await persist(targetSessionFile, await loadWorkPlan(sourceSessionFile));
|
|
211998
|
+
}
|
|
211999
|
+
async function deleteWorkPlan(sessionFile) {
|
|
212000
|
+
await persist(sessionFile, null);
|
|
212001
|
+
}
|
|
212002
|
+
|
|
212003
|
+
// ../server/src/workPlanTool.ts
|
|
212004
|
+
var objectOptions = { additionalProperties: false };
|
|
212005
|
+
var boundedText = (_maxLength, description) => typebox_exports.String({
|
|
212006
|
+
...description === void 0 ? {} : { description }
|
|
212007
|
+
});
|
|
212008
|
+
var identifierSchema = boundedText(WORK_PLAN_LIMITS.title);
|
|
212009
|
+
var titleSchema = boundedText(WORK_PLAN_LIMITS.title);
|
|
212010
|
+
var descriptionSchema = boundedText(WORK_PLAN_LIMITS.description);
|
|
212011
|
+
var reasonSchema = boundedText(WORK_PLAN_LIMITS.reason);
|
|
212012
|
+
var stringEnum = (values, description) => typebox_exports.Unsafe({ type: "string", enum: [...values], ...description === void 0 ? {} : { description } });
|
|
212013
|
+
var statusSchema = stringEnum(WORK_PLAN_STATUSES);
|
|
212014
|
+
var resourceSchema = typebox_exports.Object({
|
|
212015
|
+
uri: boundedText(WORK_PLAN_LIMITS.uri),
|
|
212016
|
+
label: typebox_exports.Optional(boundedText(WORK_PLAN_LIMITS.title))
|
|
212017
|
+
}, objectOptions);
|
|
212018
|
+
var resourcesSchema = typebox_exports.Array(resourceSchema, { maxItems: WORK_PLAN_LIMITS.resourcesPerTask });
|
|
212019
|
+
var dependenciesSchema = typebox_exports.Array(identifierSchema, { maxItems: WORK_PLAN_LIMITS.tasks, uniqueItems: true });
|
|
212020
|
+
var evidenceResultSchema = stringEnum(WORK_PLAN_EVIDENCE_RESULTS);
|
|
212021
|
+
var evidenceSchema = typebox_exports.Object({
|
|
212022
|
+
id: identifierSchema,
|
|
212023
|
+
type: boundedText(WORK_PLAN_LIMITS.evidenceType, "Free-form evidence kind or source, such as test, command, file, or external-check."),
|
|
212024
|
+
result: evidenceResultSchema,
|
|
212025
|
+
summary: typebox_exports.Optional(boundedText(WORK_PLAN_LIMITS.evidenceSummary)),
|
|
212026
|
+
reference: typebox_exports.Optional(resourceSchema)
|
|
212027
|
+
}, {
|
|
212028
|
+
...objectOptions,
|
|
212029
|
+
anyOf: [{ required: ["summary"] }, { required: ["reference"] }],
|
|
212030
|
+
description: "One evidence record. Supply at least a summary or reference."
|
|
212031
|
+
});
|
|
212032
|
+
var evidenceCollectionSchema = typebox_exports.Array(evidenceSchema, { maxItems: WORK_PLAN_LIMITS.evidencePerTask });
|
|
212033
|
+
var normalizedTaskSchema = typebox_exports.Object({
|
|
212034
|
+
id: identifierSchema,
|
|
212035
|
+
title: titleSchema,
|
|
212036
|
+
description: typebox_exports.Optional(descriptionSchema),
|
|
212037
|
+
status: statusSchema,
|
|
212038
|
+
parentId: typebox_exports.Optional(identifierSchema),
|
|
212039
|
+
dependsOn: typebox_exports.Optional(dependenciesSchema),
|
|
212040
|
+
resources: typebox_exports.Optional(resourcesSchema),
|
|
212041
|
+
evidence: typebox_exports.Optional(evidenceCollectionSchema),
|
|
212042
|
+
statusReason: typebox_exports.Optional(reasonSchema)
|
|
212043
|
+
}, objectOptions);
|
|
212044
|
+
var normalizedPlanSchema = typebox_exports.Object({
|
|
212045
|
+
version: typebox_exports.Literal(1),
|
|
212046
|
+
id: identifierSchema,
|
|
212047
|
+
title: titleSchema,
|
|
212048
|
+
tasks: typebox_exports.Array(normalizedTaskSchema, { maxItems: WORK_PLAN_LIMITS.tasks }),
|
|
212049
|
+
updatedAt: boundedText(WORK_PLAN_LIMITS.title)
|
|
212050
|
+
}, objectOptions);
|
|
212051
|
+
var creationTaskSchema = (depth) => typebox_exports.Object({
|
|
212052
|
+
id: typebox_exports.Optional(boundedText(
|
|
212053
|
+
WORK_PLAN_LIMITS.title,
|
|
212054
|
+
"Optional identifier, unique across the plan; one is generated when omitted."
|
|
212055
|
+
)),
|
|
212056
|
+
title: titleSchema,
|
|
212057
|
+
description: typebox_exports.Optional(descriptionSchema),
|
|
212058
|
+
status: typebox_exports.Optional(statusSchema),
|
|
212059
|
+
statusReason: typebox_exports.Optional(reasonSchema),
|
|
212060
|
+
// No `resources` or `evidence` here. Both are collections whose shapes are the
|
|
212061
|
+
// expensive part of this schema, and both are inlined once per nesting level —
|
|
212062
|
+
// 1 009 characters twice over, to describe something a task acquires *after* it
|
|
212063
|
+
// has been worked on rather than while the plan is being drawn. They are set
|
|
212064
|
+
// through `work_plan_extended`, on a task that exists. `mutateWorkPlan` still
|
|
212065
|
+
// accepts them in a draft, so a client written against the old contract keeps
|
|
212066
|
+
// working; only the advertisement is gone.
|
|
212067
|
+
dependsOn: typebox_exports.Optional(typebox_exports.Array(identifierSchema, {
|
|
212068
|
+
maxItems: WORK_PLAN_LIMITS.tasks,
|
|
212069
|
+
uniqueItems: true,
|
|
212070
|
+
description: "Ids of other tasks in this same call that must finish first. Give those tasks an explicit id."
|
|
212071
|
+
})),
|
|
212072
|
+
...depth < WORK_PLAN_CREATE_MAX_DEPTH ? { subtasks: typebox_exports.Optional(typebox_exports.Array(creationTaskSchema(depth + 1), {
|
|
212073
|
+
maxItems: WORK_PLAN_LIMITS.tasks,
|
|
212074
|
+
description: `Direct subtasks only; the complete plan may contain at most ${WORK_PLAN_LIMITS.tasks} tasks.`
|
|
212075
|
+
})) } : {}
|
|
212076
|
+
}, objectOptions);
|
|
212077
|
+
var WORK_PLAN_COMMON_ACTIONS = [
|
|
212078
|
+
"get",
|
|
212079
|
+
"create",
|
|
212080
|
+
"add_task",
|
|
212081
|
+
"update_task",
|
|
212082
|
+
"move_task",
|
|
212083
|
+
"remove_task",
|
|
212084
|
+
"clear"
|
|
212085
|
+
];
|
|
212086
|
+
var WORK_PLAN_EXTENDED_ACTIONS = [
|
|
212087
|
+
"replace",
|
|
212088
|
+
"set_dependencies",
|
|
212089
|
+
"set_resources",
|
|
212090
|
+
"set_evidence"
|
|
212091
|
+
];
|
|
212092
|
+
var WORK_PLAN_TOOL = "work_plan";
|
|
212093
|
+
var WORK_PLAN_EXTENDED_TOOL = "work_plan_extended";
|
|
212094
|
+
function workPlanToolFor(action) {
|
|
212095
|
+
if (WORK_PLAN_COMMON_ACTIONS.includes(action)) return WORK_PLAN_TOOL;
|
|
212096
|
+
if (WORK_PLAN_EXTENDED_ACTIONS.includes(action)) return WORK_PLAN_EXTENDED_TOOL;
|
|
212097
|
+
return void 0;
|
|
212098
|
+
}
|
|
212099
|
+
var workPlanParameters = typebox_exports.Object({
|
|
212100
|
+
action: stringEnum(
|
|
212101
|
+
WORK_PLAN_COMMON_ACTIONS,
|
|
212102
|
+
"What to do. Every property below is required by some actions and ignored by the rest."
|
|
212103
|
+
),
|
|
212104
|
+
title: typebox_exports.Optional(typebox_exports.String({ ...titleSchema, description: "Plan title (create), or the task's new title (update_task)." })),
|
|
212105
|
+
tasks: typebox_exports.Optional(typebox_exports.Array(creationTaskSchema(1), {
|
|
212106
|
+
maxItems: WORK_PLAN_LIMITS.tasks,
|
|
212107
|
+
description: `Top-level tasks (create); each may carry subtasks. At most ${WORK_PLAN_LIMITS.tasks} tasks total and ${WORK_PLAN_LIMITS.serializedBytes} serialized bytes across the complete plan.`
|
|
212108
|
+
})),
|
|
212109
|
+
task: typebox_exports.Optional(typebox_exports.Object({
|
|
212110
|
+
// The normalized task shape minus its collections, for the same reason creation
|
|
212111
|
+
// drops them: `resources` and `evidence` are what a task acquires once it is
|
|
212112
|
+
// being worked on, they are the largest shapes in this schema, and they have a
|
|
212113
|
+
// tool of their own. `mutateWorkPlan` defaults both to empty, so an added task is
|
|
212114
|
+
// complete without them. A call that carries them anyway is refused by pi's own
|
|
212115
|
+
// validation, before the handler — the schema is the contract, not a hint.
|
|
212116
|
+
id: normalizedTaskSchema.properties.id,
|
|
212117
|
+
title: normalizedTaskSchema.properties.title,
|
|
212118
|
+
description: normalizedTaskSchema.properties.description,
|
|
212119
|
+
status: normalizedTaskSchema.properties.status,
|
|
212120
|
+
parentId: normalizedTaskSchema.properties.parentId,
|
|
212121
|
+
statusReason: normalizedTaskSchema.properties.statusReason,
|
|
212122
|
+
dependsOn: normalizedTaskSchema.properties.dependsOn
|
|
212123
|
+
}, { ...objectOptions, description: "One complete task, id and status included (add_task)." })),
|
|
212124
|
+
taskId: typebox_exports.Optional(typebox_exports.String({ ...identifierSchema, description: "Which task to act on (update_task, move_task, remove_task)." })),
|
|
212125
|
+
status: typebox_exports.Optional(stringEnum(WORK_PLAN_STATUSES, "New status (update_task).")),
|
|
212126
|
+
description: typebox_exports.Optional(typebox_exports.Union([descriptionSchema, typebox_exports.Null()], { description: "New description, or null to clear it (update_task)." })),
|
|
212127
|
+
statusReason: typebox_exports.Optional(typebox_exports.Union([reasonSchema, typebox_exports.Null()], { description: "Why the task sits in its status, or null to clear it (update_task)." })),
|
|
212128
|
+
parentId: typebox_exports.Optional(typebox_exports.Union([identifierSchema, typebox_exports.Null()], { description: "New parent, or null for top level (move_task)." }))
|
|
212129
|
+
}, objectOptions);
|
|
212130
|
+
var workPlanExtendedParameters = typebox_exports.Object({
|
|
212131
|
+
action: stringEnum(
|
|
212132
|
+
WORK_PLAN_EXTENDED_ACTIONS,
|
|
212133
|
+
"What to do. Every property below is required by some actions and ignored by the rest."
|
|
212134
|
+
),
|
|
212135
|
+
plan: typebox_exports.Optional(typebox_exports.Object({ ...normalizedPlanSchema.properties }, { ...objectOptions, description: "A complete normalized plan (replace)." })),
|
|
212136
|
+
taskId: typebox_exports.Optional(typebox_exports.String({ ...identifierSchema, description: "Which task to act on (set_dependencies, set_resources, set_evidence)." })),
|
|
212137
|
+
dependsOn: typebox_exports.Optional(typebox_exports.Array(identifierSchema, { maxItems: WORK_PLAN_LIMITS.tasks, uniqueItems: true, description: "Complete dependency set for taskId (set_dependencies)." })),
|
|
212138
|
+
resources: typebox_exports.Optional(typebox_exports.Array(resourceSchema, { maxItems: WORK_PLAN_LIMITS.resourcesPerTask, description: "Complete resource set for taskId (set_resources)." })),
|
|
212139
|
+
evidence: typebox_exports.Optional(typebox_exports.Array(evidenceSchema, {
|
|
212140
|
+
maxItems: WORK_PLAN_LIMITS.evidencePerTask,
|
|
212141
|
+
description: "Complete evidence set for taskId (set_evidence). Replaces the prior collection; [] clears it and never changes task status."
|
|
212142
|
+
}))
|
|
212143
|
+
}, objectOptions);
|
|
212144
|
+
function executeWorkPlan(tool) {
|
|
212145
|
+
return async (_toolCallId, params, _signal, _onUpdate, ctx) => {
|
|
212146
|
+
const action = params.action;
|
|
212147
|
+
const home = typeof action === "string" ? workPlanToolFor(action) : void 0;
|
|
212148
|
+
if (home !== void 0 && home !== tool) {
|
|
212149
|
+
return {
|
|
212150
|
+
content: [{ type: "text", text: `Work Plan update refused: action=${action} belongs to the ${home} tool.` }],
|
|
212151
|
+
details: void 0,
|
|
212152
|
+
isError: true
|
|
212153
|
+
};
|
|
212154
|
+
}
|
|
212155
|
+
try {
|
|
212156
|
+
const sessionFile = ctx.sessionManager.getSessionFile();
|
|
212157
|
+
const plan = await applyWorkPlanMutation(sessionFile, params);
|
|
212158
|
+
const summary = plan === null ? "This session has no Work Plan." : `Work Plan "${plan.title}": ${plan.tasks.length} tasks (${plan.tasks.filter((task2) => task2.status === "done").length} done).`;
|
|
212159
|
+
return {
|
|
212160
|
+
// `details` drives authoritative UI synchronization but is not model
|
|
212161
|
+
// context. A resumed agent must receive the complete working state in
|
|
212162
|
+
// content; otherwise post-compaction `get` would expose only a counter.
|
|
212163
|
+
content: [{ type: "text", text: (action === "get" || action === "create") && plan !== null ? `${summary}
|
|
212164
|
+
${JSON.stringify(plan)}` : summary }],
|
|
212165
|
+
details: { type: "work_plan", sessionFile, plan, changed: action !== "get" }
|
|
212166
|
+
};
|
|
212167
|
+
} catch (error) {
|
|
212168
|
+
return { content: [{ type: "text", text: `Work Plan update refused: ${error instanceof Error ? error.message : String(error)}` }], details: void 0, isError: true };
|
|
212169
|
+
}
|
|
212170
|
+
};
|
|
212171
|
+
}
|
|
212172
|
+
function createWorkPlanToolDefinition() {
|
|
212173
|
+
return {
|
|
212174
|
+
name: WORK_PLAN_TOOL,
|
|
212175
|
+
label: "Work Plan",
|
|
212176
|
+
description: `Read or atomically update the persistent Work Plan for this session. Use create for a compact two-level task hierarchy (${WORK_PLAN_LIMITS.tasks} tasks total, 64 KiB normalized plan) whose tasks need only a title, and the other task operations for precise later mutations. Dependencies, resources, evidence and whole-plan replacement live in ${WORK_PLAN_EXTENDED_TOOL}, which is available once this session has a plan.`,
|
|
212177
|
+
promptSnippet: "Create, inspect, and update the session's persistent Work Plan",
|
|
212178
|
+
// A worked call, because the schema alone left models repairing by guess. The
|
|
212179
|
+
// titles are deliberately meaningless: an example that reads like real work
|
|
212180
|
+
// gets copied into real plans (a live model lifted "Add the theme tokens"
|
|
212181
|
+
// verbatim from an earlier draft of this list).
|
|
212182
|
+
promptGuidelines: [
|
|
212183
|
+
'Create the whole plan in one call, dependencies included: {"action":"create","title":"<plan title>","tasks":[{"id":"a","title":"<first task>"},{"id":"b","title":"<second task>","dependsOn":["a"],"subtasks":[{"title":"<a step of the second task>"}]}]}',
|
|
212184
|
+
"Give a task an explicit short id whenever something references it; ids are generated for the rest.",
|
|
212185
|
+
'Update one task with {"action":"update_task","taskId":"b","status":"in_progress"}. Statuses are todo, in_progress, done, blocked, needs_review.',
|
|
212186
|
+
`Dependencies, resources, evidence and whole-plan replacement are in ${WORK_PLAN_EXTENDED_TOOL}. It appears as soon as this session has a plan. If it is not listed, {"action":"get"} brings it back for your next call.`,
|
|
212187
|
+
// Pointing a small model at `replace` for this was a trap: that action wants
|
|
212188
|
+
// a complete normalized document, down to a plan id and an updatedAt it
|
|
212189
|
+
// would have to invent. `clear` then `create` reaches the same state through
|
|
212190
|
+
// the compact form it already knows.
|
|
212191
|
+
"A session holds one plan: to start a different one, clear it and create the new one."
|
|
212192
|
+
],
|
|
212193
|
+
parameters: workPlanParameters,
|
|
212194
|
+
executionMode: "sequential",
|
|
212195
|
+
execute: executeWorkPlan(WORK_PLAN_TOOL)
|
|
212196
|
+
};
|
|
212197
|
+
}
|
|
212198
|
+
function createWorkPlanExtendedToolDefinition() {
|
|
212199
|
+
return {
|
|
212200
|
+
name: WORK_PLAN_EXTENDED_TOOL,
|
|
212201
|
+
label: "Work Plan (extended)",
|
|
212202
|
+
description: "Set the collections of one task in this session's Work Plan \u2014 dependencies, resources, verification evidence \u2014 or replace the whole plan with a complete normalized version-1 document. Create the plan with work_plan first; every action here acts on a task that already exists.",
|
|
212203
|
+
promptSnippet: "Set dependencies, resources and evidence on the session's Work Plan",
|
|
212204
|
+
promptGuidelines: [
|
|
212205
|
+
'Record verification explicitly with {"action":"set_evidence","taskId":"b","evidence":[{"id":"tests","type":"test","result":"passed","summary":"Focused tests passed"},{"id":"probe","type":"external-check","result":"failed","summary":"The external probe failed"}]}. Results are passed, failed, inconclusive, informational.',
|
|
212206
|
+
"set_evidence replaces the complete evidence collection: include prior failures when appending a result, or use [] to clear it. Evidence never changes task status, and status changes never create evidence.",
|
|
212207
|
+
'Declare order with {"action":"set_dependencies","taskId":"b","dependsOn":["a"]} \u2014 the complete set for that task, replacing what it had.',
|
|
212208
|
+
"replace is for handing back a complete normalized document you already have; to start a different plan, clear it with work_plan and create the new one."
|
|
212209
|
+
],
|
|
212210
|
+
parameters: workPlanExtendedParameters,
|
|
212211
|
+
executionMode: "sequential",
|
|
212212
|
+
execute: executeWorkPlan(WORK_PLAN_EXTENDED_TOOL)
|
|
212213
|
+
};
|
|
212214
|
+
}
|
|
212215
|
+
|
|
212216
|
+
// ../server/src/documentTools.ts
|
|
212217
|
+
var PRESENTATION_TOOLS = ["pptx_layouts", "pptx_create", "pptx_update", "pptx_render"];
|
|
212218
|
+
var PRESENTATION_SKILL = "pptx-from-template";
|
|
212219
|
+
var WORD_TOOLS = ["docx_styles", "docx_create", "docx_update", "docx_restyle", "docx_render"];
|
|
212220
|
+
var WORD_SKILL = "docx-from-template";
|
|
212221
|
+
var WORD_COMPARE_TOOL = "docx_compare";
|
|
212222
|
+
var EXTRACTORS = {
|
|
212223
|
+
// `pdf_render` travels with the extractor because it is the answer to something the
|
|
212224
|
+
// extractor says: a page carrying neither text nor an image tells the caller to draw
|
|
212225
|
+
// it, and that advice is worthless if the tool it names was never offered.
|
|
212226
|
+
pdf: ["pdf_extract", "pdf_render"],
|
|
212227
|
+
// A Word document may be read, updated, or be the template a new one is written from.
|
|
212228
|
+
docx: ["docx_extract", ...WORD_TOOLS],
|
|
212229
|
+
// A .dotx is only ever a template.
|
|
212230
|
+
dotx: WORD_TOOLS,
|
|
212231
|
+
xlsx: ["xlsx_extract"],
|
|
212232
|
+
// A deck may be read, or be the template a new one is built from.
|
|
212233
|
+
pptx: ["pptx_extract", ...PRESENTATION_TOOLS],
|
|
212234
|
+
// A .potx is only ever a template.
|
|
212235
|
+
potx: PRESENTATION_TOOLS,
|
|
212236
|
+
// A message is read by one tool, which also unpacks what it carries. The
|
|
212237
|
+
// extractors for those attachments are published when they are *written*, not
|
|
212238
|
+
// here: naming a `.msg` says nothing about what is inside it.
|
|
212239
|
+
msg: ["mail_extract"],
|
|
212240
|
+
eml: ["mail_extract"],
|
|
212241
|
+
emlx: ["mail_extract"]
|
|
212242
|
+
};
|
|
212243
|
+
var DOCUMENT_TOOLS = [...new Set(Object.values(EXTRACTORS).flat()), WORD_COMPARE_TOOL];
|
|
212244
|
+
var TOOL_SEARCH_TOOL = "tool_search";
|
|
212245
|
+
var DEFERRED_TOOLS = [
|
|
212246
|
+
...DOCUMENT_TOOLS,
|
|
212247
|
+
PROJECT_MODEL_TOOL,
|
|
212248
|
+
"drawio_check",
|
|
212249
|
+
"poster_check",
|
|
212250
|
+
"poster_pictures",
|
|
212251
|
+
"compare_timelines",
|
|
212252
|
+
"write_structure_figure",
|
|
212253
|
+
"write_structure_table",
|
|
212254
|
+
WORK_PLAN_EXTENDED_TOOL
|
|
212255
|
+
];
|
|
212256
|
+
function deferOnDemandTools(tools, deferred2 = DEFERRED_TOOLS) {
|
|
212257
|
+
return tools.map((tool) => deferred2.includes(tool.name) ? { ...tool, exposure: "deferred" } : tool);
|
|
212258
|
+
}
|
|
212259
|
+
function extractorsFor(extension2, platform) {
|
|
212260
|
+
const tools = EXTRACTORS[extension2] ?? [];
|
|
212261
|
+
return extension2 === "docx" && platform === "win32" ? [...tools, WORD_COMPARE_TOOL] : tools;
|
|
212262
|
+
}
|
|
212263
|
+
var MENTION = /(?:^|[\s"'`<])(?:[^\s"'`<>]*[/\\])?[^\s"'`<>/\\]+\.(pdf|docx|dotx|xlsx|pptx|potx|msg|eml|emlx)(?=$|[\s"'`>)\],;:!?.])/gi;
|
|
212264
|
+
function documentToolsFor(text7, platform = process.platform) {
|
|
212265
|
+
const found = /* @__PURE__ */ new Set();
|
|
212266
|
+
for (const match of text7.matchAll(MENTION)) {
|
|
212267
|
+
for (const tool of extractorsFor(match[1].toLowerCase(), platform)) found.add(tool);
|
|
212268
|
+
}
|
|
212269
|
+
if (new RegExp(`(?:^|\\s)/skill:${PRESENTATION_SKILL}(?=$|\\s)`).test(text7)) {
|
|
212270
|
+
for (const tool of PRESENTATION_TOOLS) found.add(tool);
|
|
212271
|
+
}
|
|
212272
|
+
if (new RegExp(`(?:^|\\s)/skill:${WORD_SKILL}(?=$|\\s)`).test(text7)) {
|
|
212273
|
+
for (const tool of WORD_TOOLS) found.add(tool);
|
|
212274
|
+
}
|
|
212275
|
+
return DOCUMENT_TOOLS.filter((tool) => found.has(tool));
|
|
212276
|
+
}
|
|
212277
|
+
function documentToolsForWrittenPaths(paths) {
|
|
212278
|
+
const found = /* @__PURE__ */ new Set();
|
|
212279
|
+
for (const written of paths) {
|
|
212280
|
+
const extension2 = /\.([A-Za-z0-9]+)$/.exec(written.replace(/\\/g, "/"))?.[1]?.toLowerCase() ?? "";
|
|
212281
|
+
for (const tool of EXTRACTORS[extension2] ?? []) {
|
|
212282
|
+
if (tool.endsWith("_extract") || tool === "pdf_render") found.add(tool);
|
|
212283
|
+
}
|
|
212284
|
+
}
|
|
212285
|
+
return DOCUMENT_TOOLS.filter((tool) => found.has(tool));
|
|
212286
|
+
}
|
|
212287
|
+
function documentToolsForToolCall(toolName, args) {
|
|
212288
|
+
const target = args?.path;
|
|
212289
|
+
if (typeof target !== "string") return [];
|
|
212290
|
+
const normalized = target.replace(/\\/g, "/");
|
|
212291
|
+
if (toolName === "read" && normalized.endsWith(`/${PRESENTATION_SKILL}/SKILL.md`)) return PRESENTATION_TOOLS;
|
|
212292
|
+
if (toolName === "read" && normalized.endsWith(`/${WORD_SKILL}/SKILL.md`)) return WORD_TOOLS;
|
|
212293
|
+
if (/\.(docx|dotx)$/i.test(normalized)) return WORD_TOOLS;
|
|
212294
|
+
return /\.(pptx|potx)$/i.test(normalized) ? PRESENTATION_TOOLS : [];
|
|
212295
|
+
}
|
|
212296
|
+
|
|
211969
212297
|
// ../server/src/posterPictureHooks.ts
|
|
211970
212298
|
import { readFile as readFile3 } from "node:fs/promises";
|
|
211971
212299
|
import os6 from "node:os";
|
|
211972
|
-
import
|
|
212300
|
+
import path41 from "node:path";
|
|
211973
212301
|
import { DEFAULT_MAX_BYTES, formatSize, truncateHead } from "@earendil-works/pi-coding-agent";
|
|
211974
212302
|
var isPosterPath = (given) => typeof given === "string" && given.toLowerCase().endsWith(POSTER_SUFFIX);
|
|
211975
212303
|
function resolved(cwd, given) {
|
|
211976
212304
|
const named = given.startsWith("@") ? given.slice(1) : given;
|
|
211977
|
-
const home = named === "~" || named.startsWith("~/") ?
|
|
211978
|
-
return
|
|
212305
|
+
const home = named === "~" || named.startsWith("~/") ? path41.join(os6.homedir(), named.slice(1)) : named;
|
|
212306
|
+
return path41.resolve(cwd, home);
|
|
211979
212307
|
}
|
|
211980
212308
|
async function picturesOf(file) {
|
|
211981
212309
|
const text7 = await readFile3(file, "utf8").catch(() => void 0);
|
|
@@ -212436,277 +212764,9 @@ function createStructuredExchangeProjectModelToolDefinition(options2) {
|
|
|
212436
212764
|
};
|
|
212437
212765
|
}
|
|
212438
212766
|
|
|
212439
|
-
// ../server/src/workPlanStore.ts
|
|
212440
|
-
import fs21 from "node:fs/promises";
|
|
212441
|
-
import { realpathSync as realpathSync5 } from "node:fs";
|
|
212442
|
-
import path41 from "node:path";
|
|
212443
|
-
var workPlanPath = (sessionFile) => `${sessionFile}.work-plan.json`;
|
|
212444
|
-
function sameSessionFile(left, right) {
|
|
212445
|
-
if (left === void 0 || right === void 0) return left === right;
|
|
212446
|
-
try {
|
|
212447
|
-
return realpathSync5.native(path41.resolve(left)) === realpathSync5.native(path41.resolve(right));
|
|
212448
|
-
} catch {
|
|
212449
|
-
return path41.resolve(left) === path41.resolve(right);
|
|
212450
|
-
}
|
|
212451
|
-
}
|
|
212452
|
-
async function loadWorkPlan(sessionFile) {
|
|
212453
|
-
if (!sessionFile) return null;
|
|
212454
|
-
try {
|
|
212455
|
-
return validateWorkPlan(JSON.parse(await fs21.readFile(workPlanPath(sessionFile), "utf8")));
|
|
212456
|
-
} catch (error) {
|
|
212457
|
-
if (error.code === "ENOENT") return null;
|
|
212458
|
-
throw new Error(`Cannot load the Work Plan: ${error instanceof Error ? error.message : String(error)}`);
|
|
212459
|
-
}
|
|
212460
|
-
}
|
|
212461
|
-
async function persist(sessionFile, plan) {
|
|
212462
|
-
const target = workPlanPath(sessionFile);
|
|
212463
|
-
if (plan === null) {
|
|
212464
|
-
await fs21.unlink(target).catch((error) => {
|
|
212465
|
-
if (error.code !== "ENOENT") throw error;
|
|
212466
|
-
});
|
|
212467
|
-
return;
|
|
212468
|
-
}
|
|
212469
|
-
const temporary = path41.join(path41.dirname(target), `.${path41.basename(target)}.${process.pid}.${Date.now()}.tmp`);
|
|
212470
|
-
try {
|
|
212471
|
-
await fs21.writeFile(temporary, `${JSON.stringify(plan, null, 2)}
|
|
212472
|
-
`, { encoding: "utf8", mode: 384, flag: "wx" });
|
|
212473
|
-
await fs21.rename(temporary, target);
|
|
212474
|
-
} catch (error) {
|
|
212475
|
-
await fs21.unlink(temporary).catch(() => {
|
|
212476
|
-
});
|
|
212477
|
-
throw error;
|
|
212478
|
-
}
|
|
212479
|
-
}
|
|
212480
|
-
async function applyWorkPlanMutation(sessionFile, mutation) {
|
|
212481
|
-
if (!sessionFile) throw new Error("The session has no persistent file yet");
|
|
212482
|
-
const current = await loadWorkPlan(sessionFile);
|
|
212483
|
-
const next = mutateWorkPlan(current, mutation);
|
|
212484
|
-
if (mutation.action !== "get") await persist(sessionFile, next);
|
|
212485
|
-
return next;
|
|
212486
|
-
}
|
|
212487
|
-
async function copyWorkPlan(sourceSessionFile, targetSessionFile) {
|
|
212488
|
-
if (!sourceSessionFile || !targetSessionFile || sourceSessionFile === targetSessionFile) return;
|
|
212489
|
-
await persist(targetSessionFile, await loadWorkPlan(sourceSessionFile));
|
|
212490
|
-
}
|
|
212491
|
-
async function deleteWorkPlan(sessionFile) {
|
|
212492
|
-
await persist(sessionFile, null);
|
|
212493
|
-
}
|
|
212494
|
-
|
|
212495
|
-
// ../server/src/workPlanTool.ts
|
|
212496
|
-
var objectOptions = { additionalProperties: false };
|
|
212497
|
-
var boundedText = (_maxLength, description) => typebox_exports.String({
|
|
212498
|
-
...description === void 0 ? {} : { description }
|
|
212499
|
-
});
|
|
212500
|
-
var identifierSchema = boundedText(WORK_PLAN_LIMITS.title);
|
|
212501
|
-
var titleSchema = boundedText(WORK_PLAN_LIMITS.title);
|
|
212502
|
-
var descriptionSchema = boundedText(WORK_PLAN_LIMITS.description);
|
|
212503
|
-
var reasonSchema = boundedText(WORK_PLAN_LIMITS.reason);
|
|
212504
|
-
var stringEnum = (values, description) => typebox_exports.Unsafe({ type: "string", enum: [...values], ...description === void 0 ? {} : { description } });
|
|
212505
|
-
var statusSchema = stringEnum(WORK_PLAN_STATUSES);
|
|
212506
|
-
var resourceSchema = typebox_exports.Object({
|
|
212507
|
-
uri: boundedText(WORK_PLAN_LIMITS.uri),
|
|
212508
|
-
label: typebox_exports.Optional(boundedText(WORK_PLAN_LIMITS.title))
|
|
212509
|
-
}, objectOptions);
|
|
212510
|
-
var resourcesSchema = typebox_exports.Array(resourceSchema, { maxItems: WORK_PLAN_LIMITS.resourcesPerTask });
|
|
212511
|
-
var dependenciesSchema = typebox_exports.Array(identifierSchema, { maxItems: WORK_PLAN_LIMITS.tasks, uniqueItems: true });
|
|
212512
|
-
var evidenceResultSchema = stringEnum(WORK_PLAN_EVIDENCE_RESULTS);
|
|
212513
|
-
var evidenceSchema = typebox_exports.Object({
|
|
212514
|
-
id: identifierSchema,
|
|
212515
|
-
type: boundedText(WORK_PLAN_LIMITS.evidenceType, "Free-form evidence kind or source, such as test, command, file, or external-check."),
|
|
212516
|
-
result: evidenceResultSchema,
|
|
212517
|
-
summary: typebox_exports.Optional(boundedText(WORK_PLAN_LIMITS.evidenceSummary)),
|
|
212518
|
-
reference: typebox_exports.Optional(resourceSchema)
|
|
212519
|
-
}, {
|
|
212520
|
-
...objectOptions,
|
|
212521
|
-
anyOf: [{ required: ["summary"] }, { required: ["reference"] }],
|
|
212522
|
-
description: "One evidence record. Supply at least a summary or reference."
|
|
212523
|
-
});
|
|
212524
|
-
var evidenceCollectionSchema = typebox_exports.Array(evidenceSchema, { maxItems: WORK_PLAN_LIMITS.evidencePerTask });
|
|
212525
|
-
var normalizedTaskSchema = typebox_exports.Object({
|
|
212526
|
-
id: identifierSchema,
|
|
212527
|
-
title: titleSchema,
|
|
212528
|
-
description: typebox_exports.Optional(descriptionSchema),
|
|
212529
|
-
status: statusSchema,
|
|
212530
|
-
parentId: typebox_exports.Optional(identifierSchema),
|
|
212531
|
-
dependsOn: typebox_exports.Optional(dependenciesSchema),
|
|
212532
|
-
resources: typebox_exports.Optional(resourcesSchema),
|
|
212533
|
-
evidence: typebox_exports.Optional(evidenceCollectionSchema),
|
|
212534
|
-
statusReason: typebox_exports.Optional(reasonSchema)
|
|
212535
|
-
}, objectOptions);
|
|
212536
|
-
var normalizedPlanSchema = typebox_exports.Object({
|
|
212537
|
-
version: typebox_exports.Literal(1),
|
|
212538
|
-
id: identifierSchema,
|
|
212539
|
-
title: titleSchema,
|
|
212540
|
-
tasks: typebox_exports.Array(normalizedTaskSchema, { maxItems: WORK_PLAN_LIMITS.tasks }),
|
|
212541
|
-
updatedAt: boundedText(WORK_PLAN_LIMITS.title)
|
|
212542
|
-
}, objectOptions);
|
|
212543
|
-
var creationTaskSchema = (depth) => typebox_exports.Object({
|
|
212544
|
-
id: typebox_exports.Optional(boundedText(
|
|
212545
|
-
WORK_PLAN_LIMITS.title,
|
|
212546
|
-
"Optional identifier, unique across the plan; one is generated when omitted."
|
|
212547
|
-
)),
|
|
212548
|
-
title: titleSchema,
|
|
212549
|
-
description: typebox_exports.Optional(descriptionSchema),
|
|
212550
|
-
status: typebox_exports.Optional(statusSchema),
|
|
212551
|
-
statusReason: typebox_exports.Optional(reasonSchema),
|
|
212552
|
-
// No `resources` or `evidence` here. Both are collections whose shapes are the
|
|
212553
|
-
// expensive part of this schema, and both are inlined once per nesting level —
|
|
212554
|
-
// 1 009 characters twice over, to describe something a task acquires *after* it
|
|
212555
|
-
// has been worked on rather than while the plan is being drawn. They are set
|
|
212556
|
-
// through `work_plan_extended`, on a task that exists. `mutateWorkPlan` still
|
|
212557
|
-
// accepts them in a draft, so a client written against the old contract keeps
|
|
212558
|
-
// working; only the advertisement is gone.
|
|
212559
|
-
dependsOn: typebox_exports.Optional(typebox_exports.Array(identifierSchema, {
|
|
212560
|
-
maxItems: WORK_PLAN_LIMITS.tasks,
|
|
212561
|
-
uniqueItems: true,
|
|
212562
|
-
description: "Ids of other tasks in this same call that must finish first. Give those tasks an explicit id."
|
|
212563
|
-
})),
|
|
212564
|
-
...depth < WORK_PLAN_CREATE_MAX_DEPTH ? { subtasks: typebox_exports.Optional(typebox_exports.Array(creationTaskSchema(depth + 1), {
|
|
212565
|
-
maxItems: WORK_PLAN_LIMITS.tasks,
|
|
212566
|
-
description: `Direct subtasks only; the complete plan may contain at most ${WORK_PLAN_LIMITS.tasks} tasks.`
|
|
212567
|
-
})) } : {}
|
|
212568
|
-
}, objectOptions);
|
|
212569
|
-
var WORK_PLAN_COMMON_ACTIONS = [
|
|
212570
|
-
"get",
|
|
212571
|
-
"create",
|
|
212572
|
-
"add_task",
|
|
212573
|
-
"update_task",
|
|
212574
|
-
"move_task",
|
|
212575
|
-
"remove_task",
|
|
212576
|
-
"clear"
|
|
212577
|
-
];
|
|
212578
|
-
var WORK_PLAN_EXTENDED_ACTIONS = [
|
|
212579
|
-
"replace",
|
|
212580
|
-
"set_dependencies",
|
|
212581
|
-
"set_resources",
|
|
212582
|
-
"set_evidence"
|
|
212583
|
-
];
|
|
212584
|
-
var WORK_PLAN_TOOL = "work_plan";
|
|
212585
|
-
var WORK_PLAN_EXTENDED_TOOL = "work_plan_extended";
|
|
212586
|
-
function workPlanToolFor(action) {
|
|
212587
|
-
if (WORK_PLAN_COMMON_ACTIONS.includes(action)) return WORK_PLAN_TOOL;
|
|
212588
|
-
if (WORK_PLAN_EXTENDED_ACTIONS.includes(action)) return WORK_PLAN_EXTENDED_TOOL;
|
|
212589
|
-
return void 0;
|
|
212590
|
-
}
|
|
212591
|
-
var workPlanParameters = typebox_exports.Object({
|
|
212592
|
-
action: stringEnum(
|
|
212593
|
-
WORK_PLAN_COMMON_ACTIONS,
|
|
212594
|
-
"What to do. Every property below is required by some actions and ignored by the rest."
|
|
212595
|
-
),
|
|
212596
|
-
title: typebox_exports.Optional(typebox_exports.String({ ...titleSchema, description: "Plan title (create), or the task's new title (update_task)." })),
|
|
212597
|
-
tasks: typebox_exports.Optional(typebox_exports.Array(creationTaskSchema(1), {
|
|
212598
|
-
maxItems: WORK_PLAN_LIMITS.tasks,
|
|
212599
|
-
description: `Top-level tasks (create); each may carry subtasks. At most ${WORK_PLAN_LIMITS.tasks} tasks total and ${WORK_PLAN_LIMITS.serializedBytes} serialized bytes across the complete plan.`
|
|
212600
|
-
})),
|
|
212601
|
-
task: typebox_exports.Optional(typebox_exports.Object({
|
|
212602
|
-
// The normalized task shape minus its collections, for the same reason creation
|
|
212603
|
-
// drops them: `resources` and `evidence` are what a task acquires once it is
|
|
212604
|
-
// being worked on, they are the largest shapes in this schema, and they have a
|
|
212605
|
-
// tool of their own. `mutateWorkPlan` defaults both to empty, so an added task is
|
|
212606
|
-
// complete without them. A call that carries them anyway is refused by pi's own
|
|
212607
|
-
// validation, before the handler — the schema is the contract, not a hint.
|
|
212608
|
-
id: normalizedTaskSchema.properties.id,
|
|
212609
|
-
title: normalizedTaskSchema.properties.title,
|
|
212610
|
-
description: normalizedTaskSchema.properties.description,
|
|
212611
|
-
status: normalizedTaskSchema.properties.status,
|
|
212612
|
-
parentId: normalizedTaskSchema.properties.parentId,
|
|
212613
|
-
statusReason: normalizedTaskSchema.properties.statusReason,
|
|
212614
|
-
dependsOn: normalizedTaskSchema.properties.dependsOn
|
|
212615
|
-
}, { ...objectOptions, description: "One complete task, id and status included (add_task)." })),
|
|
212616
|
-
taskId: typebox_exports.Optional(typebox_exports.String({ ...identifierSchema, description: "Which task to act on (update_task, move_task, remove_task)." })),
|
|
212617
|
-
status: typebox_exports.Optional(stringEnum(WORK_PLAN_STATUSES, "New status (update_task).")),
|
|
212618
|
-
description: typebox_exports.Optional(typebox_exports.Union([descriptionSchema, typebox_exports.Null()], { description: "New description, or null to clear it (update_task)." })),
|
|
212619
|
-
statusReason: typebox_exports.Optional(typebox_exports.Union([reasonSchema, typebox_exports.Null()], { description: "Why the task sits in its status, or null to clear it (update_task)." })),
|
|
212620
|
-
parentId: typebox_exports.Optional(typebox_exports.Union([identifierSchema, typebox_exports.Null()], { description: "New parent, or null for top level (move_task)." }))
|
|
212621
|
-
}, objectOptions);
|
|
212622
|
-
var workPlanExtendedParameters = typebox_exports.Object({
|
|
212623
|
-
action: stringEnum(
|
|
212624
|
-
WORK_PLAN_EXTENDED_ACTIONS,
|
|
212625
|
-
"What to do. Every property below is required by some actions and ignored by the rest."
|
|
212626
|
-
),
|
|
212627
|
-
plan: typebox_exports.Optional(typebox_exports.Object({ ...normalizedPlanSchema.properties }, { ...objectOptions, description: "A complete normalized plan (replace)." })),
|
|
212628
|
-
taskId: typebox_exports.Optional(typebox_exports.String({ ...identifierSchema, description: "Which task to act on (set_dependencies, set_resources, set_evidence)." })),
|
|
212629
|
-
dependsOn: typebox_exports.Optional(typebox_exports.Array(identifierSchema, { maxItems: WORK_PLAN_LIMITS.tasks, uniqueItems: true, description: "Complete dependency set for taskId (set_dependencies)." })),
|
|
212630
|
-
resources: typebox_exports.Optional(typebox_exports.Array(resourceSchema, { maxItems: WORK_PLAN_LIMITS.resourcesPerTask, description: "Complete resource set for taskId (set_resources)." })),
|
|
212631
|
-
evidence: typebox_exports.Optional(typebox_exports.Array(evidenceSchema, {
|
|
212632
|
-
maxItems: WORK_PLAN_LIMITS.evidencePerTask,
|
|
212633
|
-
description: "Complete evidence set for taskId (set_evidence). Replaces the prior collection; [] clears it and never changes task status."
|
|
212634
|
-
}))
|
|
212635
|
-
}, objectOptions);
|
|
212636
|
-
function executeWorkPlan(tool) {
|
|
212637
|
-
return async (_toolCallId, params, _signal, _onUpdate, ctx) => {
|
|
212638
|
-
const action = params.action;
|
|
212639
|
-
const home = typeof action === "string" ? workPlanToolFor(action) : void 0;
|
|
212640
|
-
if (home !== void 0 && home !== tool) {
|
|
212641
|
-
return {
|
|
212642
|
-
content: [{ type: "text", text: `Work Plan update refused: action=${action} belongs to the ${home} tool.` }],
|
|
212643
|
-
details: void 0,
|
|
212644
|
-
isError: true
|
|
212645
|
-
};
|
|
212646
|
-
}
|
|
212647
|
-
try {
|
|
212648
|
-
const sessionFile = ctx.sessionManager.getSessionFile();
|
|
212649
|
-
const plan = await applyWorkPlanMutation(sessionFile, params);
|
|
212650
|
-
const summary = plan === null ? "This session has no Work Plan." : `Work Plan "${plan.title}": ${plan.tasks.length} tasks (${plan.tasks.filter((task2) => task2.status === "done").length} done).`;
|
|
212651
|
-
return {
|
|
212652
|
-
// `details` drives authoritative UI synchronization but is not model
|
|
212653
|
-
// context. A resumed agent must receive the complete working state in
|
|
212654
|
-
// content; otherwise post-compaction `get` would expose only a counter.
|
|
212655
|
-
content: [{ type: "text", text: (action === "get" || action === "create") && plan !== null ? `${summary}
|
|
212656
|
-
${JSON.stringify(plan)}` : summary }],
|
|
212657
|
-
details: { type: "work_plan", sessionFile, plan, changed: action !== "get" }
|
|
212658
|
-
};
|
|
212659
|
-
} catch (error) {
|
|
212660
|
-
return { content: [{ type: "text", text: `Work Plan update refused: ${error instanceof Error ? error.message : String(error)}` }], details: void 0, isError: true };
|
|
212661
|
-
}
|
|
212662
|
-
};
|
|
212663
|
-
}
|
|
212664
|
-
function createWorkPlanToolDefinition() {
|
|
212665
|
-
return {
|
|
212666
|
-
name: WORK_PLAN_TOOL,
|
|
212667
|
-
label: "Work Plan",
|
|
212668
|
-
description: `Read or atomically update the persistent Work Plan for this session. Use create for a compact two-level task hierarchy (${WORK_PLAN_LIMITS.tasks} tasks total, 64 KiB normalized plan) whose tasks need only a title, and the other task operations for precise later mutations. Dependencies, resources, evidence and whole-plan replacement live in ${WORK_PLAN_EXTENDED_TOOL}, which is available once this session has a plan.`,
|
|
212669
|
-
promptSnippet: "Create, inspect, and update the session's persistent Work Plan",
|
|
212670
|
-
// A worked call, because the schema alone left models repairing by guess. The
|
|
212671
|
-
// titles are deliberately meaningless: an example that reads like real work
|
|
212672
|
-
// gets copied into real plans (a live model lifted "Add the theme tokens"
|
|
212673
|
-
// verbatim from an earlier draft of this list).
|
|
212674
|
-
promptGuidelines: [
|
|
212675
|
-
'Create the whole plan in one call, dependencies included: {"action":"create","title":"<plan title>","tasks":[{"id":"a","title":"<first task>"},{"id":"b","title":"<second task>","dependsOn":["a"],"subtasks":[{"title":"<a step of the second task>"}]}]}',
|
|
212676
|
-
"Give a task an explicit short id whenever something references it; ids are generated for the rest.",
|
|
212677
|
-
'Update one task with {"action":"update_task","taskId":"b","status":"in_progress"}. Statuses are todo, in_progress, done, blocked, needs_review.',
|
|
212678
|
-
`Dependencies, resources, evidence and whole-plan replacement are in ${WORK_PLAN_EXTENDED_TOOL}. It appears as soon as this session has a plan.`,
|
|
212679
|
-
// Pointing a small model at `replace` for this was a trap: that action wants
|
|
212680
|
-
// a complete normalized document, down to a plan id and an updatedAt it
|
|
212681
|
-
// would have to invent. `clear` then `create` reaches the same state through
|
|
212682
|
-
// the compact form it already knows.
|
|
212683
|
-
"A session holds one plan: to start a different one, clear it and create the new one."
|
|
212684
|
-
],
|
|
212685
|
-
parameters: workPlanParameters,
|
|
212686
|
-
executionMode: "sequential",
|
|
212687
|
-
execute: executeWorkPlan(WORK_PLAN_TOOL)
|
|
212688
|
-
};
|
|
212689
|
-
}
|
|
212690
|
-
function createWorkPlanExtendedToolDefinition() {
|
|
212691
|
-
return {
|
|
212692
|
-
name: WORK_PLAN_EXTENDED_TOOL,
|
|
212693
|
-
label: "Work Plan (extended)",
|
|
212694
|
-
description: "Set the collections of one task in this session's Work Plan \u2014 dependencies, resources, verification evidence \u2014 or replace the whole plan with a complete normalized version-1 document. Create the plan with work_plan first; every action here acts on a task that already exists.",
|
|
212695
|
-
promptSnippet: "Set dependencies, resources and evidence on the session's Work Plan",
|
|
212696
|
-
promptGuidelines: [
|
|
212697
|
-
'Record verification explicitly with {"action":"set_evidence","taskId":"b","evidence":[{"id":"tests","type":"test","result":"passed","summary":"Focused tests passed"},{"id":"probe","type":"external-check","result":"failed","summary":"The external probe failed"}]}. Results are passed, failed, inconclusive, informational.',
|
|
212698
|
-
"set_evidence replaces the complete evidence collection: include prior failures when appending a result, or use [] to clear it. Evidence never changes task status, and status changes never create evidence.",
|
|
212699
|
-
'Declare order with {"action":"set_dependencies","taskId":"b","dependsOn":["a"]} \u2014 the complete set for that task, replacing what it had.',
|
|
212700
|
-
"replace is for handing back a complete normalized document you already have; to start a different plan, clear it with work_plan and create the new one."
|
|
212701
|
-
],
|
|
212702
|
-
parameters: workPlanExtendedParameters,
|
|
212703
|
-
executionMode: "sequential",
|
|
212704
|
-
execute: executeWorkPlan(WORK_PLAN_EXTENDED_TOOL)
|
|
212705
|
-
};
|
|
212706
|
-
}
|
|
212707
|
-
|
|
212708
212767
|
// ../server/src/piOutpostTools.ts
|
|
212709
212768
|
var TOOLS_ENV_VAR = "PI_OUTPOST_TOOLS";
|
|
212769
|
+
var CHILD_DEFERRED_TOOLS = DEFERRED_TOOLS.filter((name) => name !== WORK_PLAN_EXTENDED_TOOL);
|
|
212710
212770
|
|
|
212711
212771
|
// ../server/src/index.ts
|
|
212712
212772
|
import os10 from "node:os";
|
|
@@ -219068,9 +219128,9 @@ async function recordRunningVersion(options2) {
|
|
|
219068
219128
|
}
|
|
219069
219129
|
|
|
219070
219130
|
// ../server/src/index.ts
|
|
219071
|
-
var VERSION2 = true ? "0.62.
|
|
219072
|
-
var CHANGELOG = true ? "# Changelog\n\nWhat changed in each release of pi-outpost, newest first. This file ships inside the\npackage and the executables: after an update, the app shows the sections between the\nversion you had and the one you run now, without going online.\n\nReleases before 0.41.0 are described on\n[GitHub Releases](https://github.com/laurentftech/pi-outpost/releases).\n\n## [0.62.0] - 2026-11-08\n\n### Added\n\n- **Host questions under landstrip on Linux.** `sandbox.allowedHosts` now works with\n landstrip: the agent's shell reaches the listed hosts through the server's proxy, and a\n connection to any other host asks you, as under MXC and Seatbelt. An empty list asks about\n every host. ([#468](https://github.com/laurentftech/pi-outpost/pull/468))\n\n### Changed\n\n- **Docker: the agent's network asks you by default.** The image used to close the agent's\n network unless the operator opted in; it now reaches hosts only through the server's proxy,\n which asks you about each one. Existing volumes get `sandbox.allowedHosts: []` at startup.\n `ALLOW_AGENT_NETWORK=0` now refuses all networking, the proxy included, and `1` follows\n your configuration as before. The image ships landstrip 0.20.26, which also hides the\n server's processes from the agent's commands. ([#468](https://github.com/laurentftech/pi-outpost/pull/468))\n- **Remote servers require encrypted transport.** A server listening beyond the loopback\n now refuses plain HTTP: configure a certificate for native HTTPS/WSS, or keep it on the\n loopback behind SSH or a TLS proxy. `server.allowInsecureHttp` (or\n `PI_OUTPOST_ALLOW_INSECURE_HTTP=1`) keeps plain HTTP for a hop you protect otherwise, with\n a warning. Loopback HTTP is unchanged. ([#463](https://github.com/laurentftech/pi-outpost/pull/463))\n\n### Fixed\n\n- Under landstrip, a refused operation is told to the agent in words instead of landstrip's\n JSON report, so a command that survived the refusal is no longer taken for a failed one;\n the startup line now says an empty host list asks about every host.\n ([#469](https://github.com/laurentftech/pi-outpost/pull/469))\n- draw.io wires with a fixed end on a shape that has perimeter spacing end where draw.io\n draws them, and `drawio_check` judges those routes as drawn.\n ([#467](https://github.com/laurentftech/pi-outpost/pull/467))\n\n## [0.61.0] - 2026-11-08\n\n### Added\n\n- **One actions menu per row in the Files tree.** Each file and folder now has a single\n `\u22EF` menu (also on right-click) instead of a row of unlabelled icons. Folders can be\n renamed, moved, deleted and downloaded like files. Select several entries with\n Shift-click or Ctrl/Cmd-click to delete, move, download or reference them together.\n **Download** saves a file as itself, and a folder or a selection as one `.zip`.\n The last move, rename or deletion can be undone (Undo, or Ctrl/Cmd+Z): deleted entries\n go to a temporary server trash, emptied at startup and after 24 hours.\n ([#438](https://github.com/laurentftech/pi-outpost/pull/438))\n- **Git credentials for private repositories in Agent resources.** When a clone or refresh\n needs a login, the panel asks for a user name and token, stores them for that host and\n retries. Settings \u2192 Accounts lists the stored Git hosts and removes them. Git errors now\n show git's actual reason instead of its progress line. ([#428](https://github.com/laurentftech/pi-outpost/pull/428))\n- **Host questions on Linux and macOS sandboxes.** Under MXC on Linux and macOS and under\n Seatbelt, a connection to a host missing from `sandbox.allowedHosts` now asks you\n instead of being refused silently. ([#429](https://github.com/laurentftech/pi-outpost/pull/429))\n- Release files now carry signed build provenance: check a download with\n `gh attestation verify <file> -R laurentftech/pi-outpost`. ([#436](https://github.com/laurentftech/pi-outpost/pull/436))\n\n### Fixed\n\n- Terminal colours in tool output are rendered instead of printed as escape codes, in the\n app and in the HTML export. ([#427](https://github.com/laurentftech/pi-outpost/pull/427))\n- A session whose first reply starts with a tool call is titled from its answer, not from\n the question alone. ([#449](https://github.com/laurentftech/pi-outpost/pull/449))\n\n## [0.60.1] - 2026-11-06\n\n### Fixed\n\n- Hardened filesystem access, document parsing, command execution, URL validation and\n diagnostic logging against untrusted input. ([#420](https://github.com/laurentftech/pi-outpost/pull/420),\n [#422](https://github.com/laurentftech/pi-outpost/pull/422))\n\n## [0.60.0] - 2026-11-05\n\n### Added\n\n- **Run the full app with Python in Docker.** A Compose recipe includes the web\n interface, agent, Python/venv and integrated terminal, with persistent projects\n and agent settings. The app runs as a non-root user and verifies shell and terminal\n confinement before serving. Agent shell networking is off by default and can be\n enabled explicitly by the operator. Releases now publish the tested Linux x64 image\n to `ghcr.io/laurentftech/pi-outpost`, with a version tag and `latest` for stable releases.\n The deployment guide documents the required sandbox profiles and host prerequisites.\n ([#416](https://github.com/laurentftech/pi-outpost/pull/416))\n\n### Changed\n\n- **Clearer contribution and security guidance.** The repository now documents\n contribution requirements, private vulnerability reporting, quality checks and\n their limitations. Bug and feature issue forms help provide useful reports.\n Server lint and broader JavaScript/TypeScript CodeQL analysis extend the existing\n checks; the analysis also reports existing findings that need triage.\n ([#418](https://github.com/laurentftech/pi-outpost/pull/418))\n- **Updated dependency maintenance.** Bump glob and related locked dependencies.\n ([#415](https://github.com/laurentftech/pi-outpost/pull/415))\n\n### Fixed\n\n- **Keep stable extension symlinks across updates.** Adding an extension folder\n preserves the chosen symlink or Windows junction instead of saving its versioned\n target. The resource manager displays the configured folder and removes the correct\n entry without deleting its files. After repointing the link, restart pi-outpost to\n load the new extension code.\n ([#417](https://github.com/laurentftech/pi-outpost/pull/417))\n\n## [0.59.1] - 2026-11-05\n\n### Changed\n\n- **Keep the conversation visible while answering questions.** Questions now appear\n below the timeline, leaving the context readable and scrollable. Short choices use\n up to two columns when there is room; long descriptions and narrow windows keep\n one column. Sandbox permission requests scroll their command, paths and explanation\n independently, with all three decision buttons kept visible.\n ([#412](https://github.com/laurentftech/pi-outpost/pull/412),\n [#413](https://github.com/laurentftech/pi-outpost/pull/413))\n- **Install safely with npm 12.** Installation instructions and the updater explicitly\n allow the native scripts needed by the terminal and sandbox while blocking unrelated\n dependency scripts. Use `npx --allow-scripts=node-pty,koffi pi-outpost` with npm 12\n and a compatible Node version (24.15+ or 26+).\n ([#411](https://github.com/laurentftech/pi-outpost/pull/411))\n\n### Fixed\n\n- **Unanswered questions survive browser disconnections.** A connection lost during\n browser sleep no longer becomes a refusal sent to the agent. Questions without an\n extension-defined deadline reappear on reconnect, and a project waiting for your\n answer stays available even after its idle timeout. Starting a new session can\n still deliberately abandon an old question.\n ([#414](https://github.com/laurentftech/pi-outpost/pull/414))\n\n## [0.59.0] - 2026-11-04\n\n### Changed\n\n- **Keep the conversation visible in narrow windows.** The Work Plan collapses\n automatically below 768 pixels and restores its desktop state when the window\n widens. The model selector and Settings resources also have clearer accessible\n names and improved contrast.\n ([#407](https://github.com/laurentftech/pi-outpost/pull/407))\n- **Updated diagram and page editors.** Mermaid is now 12.3.0 and GrapesJS 0.23.9.\n ([#407](https://github.com/laurentftech/pi-outpost/pull/407))\n\n### Fixed\n\n- **Send queued messages immediately after an interruption.** \u201CSend now\u201D starts a\n new turn with the pending messages, including when the agent was running a tool.\n Stopping the agent keeps pending messages ready for the next prompt. Long\n conversations no longer create a second page scrollbar.\n ([#405](https://github.com/laurentftech/pi-outpost/pull/405))\n- **Reuse document tools after reopening a session.** Tools discovered for PDFs,\n Word documents, presentations and spreadsheets are restored when the session\n resumes. Repeating an earlier tool call works without another discovery step.\n ([#406](https://github.com/laurentftech/pi-outpost/pull/406))\n- **HTTPS commands work in the macOS sandbox.** The sandbox now permits the\n system certificate trust service needed to validate HTTPS connections.\n ([#405](https://github.com/laurentftech/pi-outpost/pull/405))\n\n## [0.58.0] - 2026-11-03\n\n### Added\n\n- **Add and remove pi packages from Settings.** Under Extensions \u2192 Packages,\n **Add a package** takes an npm name (`openlore`, `@scope/name`, or\n `name@1.2.3` to pin that version) and installs it for all projects or for\n this project only. The name is looked up on the registry your npm\n configuration uses first, and the confirmation names the version that will\n be installed. **Remove** uninstalls a package; it keeps running until\n pi-outpost restarts, so it stays listed with **Undo** until then. Nothing\n changes while an agent is working, and `extensionLock` forbids both.\n ([#404](https://github.com/laurentftech/pi-outpost/pull/404))\n\n### Changed\n\n- **Queued messages are lighter.** A message waiting for the agent now looks\n like a sent one, only paler, without a frame or a heading; a single line under\n the queue says \"queued\", with \"send now\" as a plain link. When the queue\n cannot be sent (a message an extension queued, or the connection dropped), the\n line still says \"queued\", without the link.\n ([#403](https://github.com/laurentftech/pi-outpost/pull/403))\n- **The restart notice names each package once, by its latest change.** It now\n covers packages added and removed, and drops one put back as it was.\n ([#404](https://github.com/laurentftech/pi-outpost/pull/404))\n\n## [0.57.0] - 2026-11-02\n\n### Added\n\n- **Change a message the agent has not read yet.** A message you send while the\n agent works waits until the end of its current step. It now shows below the\n running turn, marked as queued, with the usual \u270E to rewrite it and a \u2715 to\n take it out; once the agent reads it, it joins the conversation where it was\n read. If the agent reads it while you are editing it, your edit lands in the\n composer instead of being lost.\n ([#400](https://github.com/laurentftech/pi-outpost/pull/400))\n- **Send queued messages now.** One button sends everything that is queued at\n once. After a stop, it sends them without your typing a new message. While\n the agent works, it first stops the current step, and tells you so before\n doing it: a reply being written is dropped and a running tool is stopped,\n while the work already done is kept.\n ([#400](https://github.com/laurentftech/pi-outpost/pull/400))\n\n### Changed\n\n- **A turned-off sandbox shows the shell's lock open.** With `\"sandbox\": false`,\n the agent's shell runs with every right of the server's account; the lock next\n to the model now says so, instead of showing nothing. Where this machine can\n confine the shell, it offers `pi-outpost config --confine`, which now turns\n the sandbox back on (after checking the runner) and tells you that the\n agent's file tools are limited to the project again.\n ([#402](https://github.com/laurentftech/pi-outpost/pull/402))\n- **Pi SDK 1.5.0.** The npm CLI and server use the updated SDK, which also brings\n the `undici` security fix it had been pinning out.\n ([#399](https://github.com/laurentftech/pi-outpost/pull/399))\n\n### Fixed\n\n- **Messages sent in quick succession reach the agent in the order you sent\n them.** A message naming files with `@` could be overtaken by a plain one\n sent right after it.\n ([#401](https://github.com/laurentftech/pi-outpost/pull/401))\n- **A message queued before a stop no longer vanishes.** It disappeared from the\n screen while the agent kept it and sent it with your next message; it now\n stays visible, and can be changed, removed or sent.\n ([#400](https://github.com/laurentftech/pi-outpost/pull/400))\n\n## [0.56.0] - 2026-11-01\n\n### Changed\n\n- **The agent is now sandboxed by default.** This is the main change of this\n release. If your configuration has no `sandbox` section, the agent can now read\n and write only inside the project, and its shell runs in the operating\n system's sandbox: MXC on Windows and Linux, Seatbelt on macOS. Commands run\n once the sandbox has passed its check; where it cannot confine \u2014 a Windows 11\n build without the August 2026 update, a container without user namespaces \u2014\n the shell refuses every command and says why. To get an unconfined shell\n back, set `\"bashRunner\": \"none\"` in `sandbox`; to turn the sandbox off\n entirely, `\"sandbox\": false`. A configuration that already has a `sandbox`\n section behaves as before. The agent can no longer write pi-outpost's\n configuration file, and `pi-outpost init` writes this default out.\n ([#397](https://github.com/laurentftech/pi-outpost/pull/397))\n- **A shorter README.** Setup, configuration, the command line, features,\n deployment and integrations each have their own guide under `docs/`.\n ([#398](https://github.com/laurentftech/pi-outpost/pull/398))\n- The draw.io viewer is updated to 32.6.9.\n ([#386](https://github.com/laurentftech/pi-outpost/pull/386))\n\n### Added\n\n- **Confine an unconfined shell in one command.** When your configuration runs\n the shell unconfined and this machine can confine it, the lock next to the\n model is highlighted and says so; `pi-outpost config --confine` checks the\n sandbox, then switches it on in your configuration file.\n ([#397](https://github.com/laurentftech/pi-outpost/pull/397))\n- **Let a confined command through, once or for the session.** When a sandboxed\n command connects to a host that is not allowed, or the agent needs a folder\n beside the project, you are asked, and choose this command only, this session,\n or no. The agent directory, the configuration and `.pi` folders are never\n offered. ([#392](https://github.com/laurentftech/pi-outpost/pull/392))\n- **Run one turn from the terminal.** `pi-outpost -p \"<prompt>\"` answers on\n stdout and exits, without a browser; `-p -` reads the prompt from stdin and\n `--json` prints every event.\n ([#395](https://github.com/laurentftech/pi-outpost/pull/395))\n- **Search file contents from the Files panel.** The magnifying glass searches\n text files and the text of PDFs; a hit opens the file at the match.\n ([#385](https://github.com/laurentftech/pi-outpost/pull/385))\n- **Graphs with straight, readable wires that keep their layout.** Structured\n graphs are drawn with right-angled wires routed like draw.io's, and a layout you\n adjust \u2014 by dragging, or touched up in draw.io \u2014 is kept beside the document and\n reused when the model is revised.\n ([#390](https://github.com/laurentftech/pi-outpost/pull/390))\n- **`drawio_check` checks where wires meet.** It warns about wires that share a\n point while carrying different data, exits facing the wrong way, long detours\n and needless bends, with advice that settles the diagram.\n ([#389](https://github.com/laurentftech/pi-outpost/pull/389))\n\n### Fixed\n\n- **Tools installed for your user run in the Windows sandbox.** A confined\n command finds what `PATH` finds (Python in your profile, for example), and a\n bare `sandbox.bashShell` such as `pwsh.exe` is looked up on `PATH`.\n ([#393](https://github.com/laurentftech/pi-outpost/pull/393))\n- **The PowerShell confinement check reports again**, instead of always showing\n \"confinement unchecked\". ([#388](https://github.com/laurentftech/pi-outpost/pull/388))\n- **Two arrangements saved at once both stick on Windows.**\n ([#394](https://github.com/laurentftech/pi-outpost/pull/394))\n- **`drawio_check`'s advice is read in linear time**, whatever a diagram's labels\n hold. ([#396](https://github.com/laurentftech/pi-outpost/pull/396))\n\n## [0.55.0] - 2026-10-29\n\n### Added\n\n- **Ask a side question while the agent works.** Use `/btw` to ask about the\n conversation without interrupting the running turn. The answer appears above\n the composer, supports follow-up questions, and stays out of the agent's\n conversation and saved session. Side answers use the session's model with no\n tools, in both embedded and RPC runtimes.\n ([#383](https://github.com/laurentftech/pi-outpost/pull/383))\n\n### Changed\n\n- **Load specialist tools when they are needed.** Document and project-model tools\n stay available through `tool_search` and extension calls without adding all their\n schemas to every request. Tools loaded by search follow the same inactivity\n rules as tools published when a document is named.\n ([#382](https://github.com/laurentftech/pi-outpost/pull/382))\n- **Keep diagram, poster and structure tools out of idle conversations.** These\n tools now load through `tool_search` too, with guidance explaining which tool\n families the agent can find.\n ([#384](https://github.com/laurentftech/pi-outpost/pull/384))\n\n### Fixed\n\n- **Keep on-demand tools hidden across conversation rewinds.** Restoring or\n rewinding a conversation no longer republishes tools that should stay inactive.\n ([#381](https://github.com/laurentftech/pi-outpost/pull/381))\n- **Find the Word extractor on Windows.** Searching for \u201CWord document\u201D includes\n `docx_extract` even when the Windows-only comparison tool is available.\n ([#384](https://github.com/laurentftech/pi-outpost/pull/384))\n\n## [0.54.0] - 2026-10-28\n\n### Added\n\n- **Drop desktop files straight into a workspace folder.** Drag files onto a folder\n in the Files tree, or onto Workspace root, to import them there without attaching\n them to the conversation. Progress, saved paths and individual errors stay visible\n when you close and reopen Files. Existing names receive a numeric suffix instead\n of being overwritten. Imports accept files up to 25 MB; folder drops and read-only\n destinations are refused, and changing workspace stops the remaining batch.\n ([#379](https://github.com/laurentftech/pi-outpost/pull/379))\n\n## [0.53.0] - 2026-10-28\n\n### Added\n\n- **Touch up a poster's draw.io diagram in place.** In pi-outpost, double-click a\n diagram picture to edit its page, or open it in draw.io desktop. Returning to the\n poster refreshes every picture of that page, keeping its position and width;\n one undo restores them all. Unsaved touch-ups are kept unless you discard them.\n ([#376](https://github.com/laurentftech/pi-outpost/pull/376))\n- **See why a session is slow to open.** A new session, session switch or fork taking\n at least two seconds logs the time spent shutting down the previous session,\n loading the new one and binding extensions. An extension binding that finishes\n later reports its completion too, helping diagnose slow MCP connections.\n ([#377](https://github.com/laurentftech/pi-outpost/pull/377))\n\n### Fixed\n\n- **The poster's Format panel starts from what you see.** Inherited fonts, sizes,\n colours and alignment are shown correctly, and the size arrows step from those\n values without accidental dragging. Font sizes stay positive and in pixels,\n line spacing is a multiple of the text size, and invalid colours are refused.\n The panel follows the light or dark theme and its colour picker stays in view.\n ([#375](https://github.com/laurentftech/pi-outpost/pull/375))\n\n## [0.52.0] - 2026-10-27\n\n### Added\n\n- **draw.io diagrams in posters.** In the poster editor, **Insert \u25BE \u2192 draw.io diagram\u2026** lists\n the project's diagrams page by page and puts the one you choose into the selected frame or\n onto the page. The agent can lay out a frame naming a diagram, and the editor draws it when\n the poster opens. ([#370](https://github.com/laurentftech/pi-outpost/pull/370))\n- **The project's pictures in posters.** **Insert \u25BE \u2192 Picture from the project\u2026** lists the\n project's SVG, PNG, JPEG, GIF and WebP files, including the figures the agent drew. An SVG\n stays sharp at any size; the agent can name a picture file in a frame too.\n ([#371](https://github.com/laurentftech/pi-outpost/pull/371))\n- **The agent checks its posters.** After writing a poster, the agent runs `poster_check`,\n which says what the editor would refuse, drop or leave empty, so it fixes the poster before\n you open it. ([#373](https://github.com/laurentftech/pi-outpost/pull/373))\n- **Wires that cross boxes are caught.** `drawio_check` now warns when a wire runs through a\n box or its label sits on one, so the agent can tidy its diagram. In touch-up, a **wires**\n control draws the selected wires, or all of them, straight, orthogonal or curved.\n ([#374](https://github.com/laurentftech/pi-outpost/pull/374))\n\n### Fixed\n\n- **A poster open in the viewer shows the agent's new version** as soon as it rewrites the\n file, unless you have unsaved touch-ups, which are kept. ([#369](https://github.com/laurentftech/pi-outpost/pull/369))\n- **Posters with text pasted from Word export to Word and PowerPoint** instead of failing with\n \"this browser could not draw the page as a picture\"; an export that still fails says why.\n ([#372](https://github.com/laurentftech/pi-outpost/pull/372))\n- **Opening a poster no longer asks to discard changes you never made**, when the editor filled\n frames on opening. ([#373](https://github.com/laurentftech/pi-outpost/pull/373))\n- **No more stray \"git log failed\" at the bottom of the conversation.** The commit map only\n follows the repository while its menu is open, and a failure shows in the menu, saying why\n git failed (too slow, not found, too much output). ([#368](https://github.com/laurentftech/pi-outpost/pull/368))\n\n## [0.51.0] - 2026-10-26\n\n### Added\n\n- **Pictures, text boxes and shapes in posters.** In the poster editor, **Insert \u25BE** adds a\n picture from your computer, a text box or a shape (rectangle, ellipse, arrow, star, speech\n bubble\u2026). Double-click an empty frame the agent laid out, or drop a file on the page, to put\n a picture in it. Pictures are shrunk to 1200 px and kept inside the poster file, and they\n still go out with it to Word and PowerPoint.\n ([#365](https://github.com/laurentftech/pi-outpost/pull/365))\n- **The agent keeps your pictures and can draw.** The agent reads each picture as a short\n marker and puts the picture back when it edits the poster, so its edits never drop one. It\n can also lay out empty frames for your pictures and draw simple illustrations, which move\n and resize as one piece. ([#365](https://github.com/laurentftech/pi-outpost/pull/365))\n- **Open WebUI's model can look at a poster's pictures.** With a model that reads images,\n `get_poster` can hand it the poster's pictures as images.\n ([#366](https://github.com/laurentftech/pi-outpost/pull/366))\n\n### Fixed\n\n- **The poster page stays still under your clicks.** The page is kept in view after you\n scroll, pinch or zoom, without ever fighting the editor's own fit, so a click on a text or\n a drawing selects it at once. ([#367](https://github.com/laurentftech/pi-outpost/pull/367))\n\n## [0.50.0] - 2026-10-25\n\n### Added\n\n- **Posters you can retouch.** Ask the agent for a poster, a worksheet or a slide and it\n writes a printable `.poster.html` page (A4, A3 or 16:9). The file viewer opens it in an\n editor: double-click a text to correct it, drag a pictogram, change colours, fonts and\n sizes, then save it back to the file. Unsaved touch-ups are not dropped without asking.\n ([#361](https://github.com/laurentftech/pi-outpost/pull/361))\n- **Posters to Word and PowerPoint.** From the editor, download the poster as a Word page,\n a PowerPoint slide or HTML. In Word and PowerPoint the poster is a picture at print\n resolution: correct texts in the editor, then export again.\n ([#361](https://github.com/laurentftech/pi-outpost/pull/361))\n- **Posters in Claude Desktop.** A second extension, `pi-outpost-posters.mcpb`, attached to\n each release, shows the same editor inside Claude.\n ([#361](https://github.com/laurentftech/pi-outpost/pull/361))\n- **Posters in Open WebUI.** The tool server creates, shows and lists posters for each user.\n When saving is configured, touch-ups made in the embed are kept as a new revision that\n the model reads back; an older embed cannot overwrite a newer revision.\n ([#361](https://github.com/laurentftech/pi-outpost/pull/361),\n [#362](https://github.com/laurentftech/pi-outpost/pull/362))\n\n### Changed\n\n- **Open WebUI embeds follow the host theme.** Planning and poster views switch between\n light and dark with Open WebUI. ([#362](https://github.com/laurentftech/pi-outpost/pull/362))\n\n### Fixed\n\n- **Extension statuses keep their semantic colours.** Statuses an extension styles as\n success, warning or error (pi-blackhole's gauges, for instance) are shown in colour\n instead of plain text, including in the standalone executables.\n ([#360](https://github.com/laurentftech/pi-outpost/pull/360))\n- **Dependency security updates.** `fast-uri` 3.1.9 fixes four URI parsing advisories;\n `undici` moves to 8.12.3. ([#363](https://github.com/laurentftech/pi-outpost/pull/363),\n [#364](https://github.com/laurentftech/pi-outpost/pull/364))\n\n## [0.49.0] - 2026-10-23\n\n### Added\n\n- **Coloured extension statuses.** Status badges keep the foreground colours, bold,\n dim, italic and underline styling sent by extensions, both in the header and in\n the overflow list. Hover titles remain plain text.\n ([#356](https://github.com/laurentftech/pi-outpost/pull/356))\n- **Release notes readable by agents.** The npm package now carries `CHANGELOG.md`\n at its root, so agents and tools can read what changed without starting the server.\n ([#356](https://github.com/laurentftech/pi-outpost/pull/356))\n\n### Changed\n\n- **Pi SDK 1.4.0.** The npm CLI and server use the updated SDK.\n ([#356](https://github.com/laurentftech/pi-outpost/pull/356))\n\n## [0.48.0] - 2026-10-23\n\n### Added\n\n- **Update the agent's pi packages from the terminal.** `pi-outpost update --extensions`\n installs the newest version of every npm pi package the agent loads, with the same rules\n as Settings: pinned packages stay put, a failed lookup is reported rather than called up to\n date, and `extensionLock` refuses. `pi-outpost update --all` updates pi-outpost, then the\n packages, and works from a standalone executable too. Plain `pi-outpost update` now ends\n by naming the packages that have a newer version.\n ([#351](https://github.com/laurentftech/pi-outpost/pull/351))\n- **Choose the shell of each terminal.** A new terminal tab offers the shells installed on\n the machine, and defaults to PowerShell on Windows. The terminal's height can be resized\n and is remembered, the usual copy and paste shortcuts work, and its shell sessions come\n back after a reconnect. ([#355](https://github.com/laurentftech/pi-outpost/pull/355))\n- **A System theme.** Next to Light and Dark, the header offers System, which follows your\n operating system. ([#355](https://github.com/laurentftech/pi-outpost/pull/355))\n- **Git changes beside the scrollbar.** The file editor and the read-only source view mark\n every Git change next to the scrollbar; click a marker to jump to it, even when it is\n out of view. ([#355](https://github.com/laurentftech/pi-outpost/pull/355))\n- **Credits.** Settings have a Credits page listing the third-party software pi-outpost\n includes, readable offline. ([#355](https://github.com/laurentftech/pi-outpost/pull/355))\n\n### Changed\n\n- **Opening a file no longer attaches it to your message.** Files you browse stay out of\n the composer; attach or pin one when you want the agent to see it.\n ([#355](https://github.com/laurentftech/pi-outpost/pull/355))\n- **Restart the session at any time.** Settings always offer a session restart, to reload\n extensions and MCP servers without changing the configuration.\n ([#355](https://github.com/laurentftech/pi-outpost/pull/355))\n\n### Fixed\n\n- **Images and codemode in the standalone executable.** The agent saw no image (`read` on\n a picture answered \"Image omitted\") and codemode scripts failed to start; both now work in\n the executable as they do from npm.\n ([#353](https://github.com/laurentftech/pi-outpost/pull/353))\n- **A Mermaid diagram drawn again no longer vanishes.** Turning a diagram back to an\n orientation it already had left the block with its buttons and no picture.\n ([#354](https://github.com/laurentftech/pi-outpost/pull/354))\n\n## [0.47.0] - 2026-10-22\n\n### Added\n\n- **Tracked changes and comments in Word documents.** `docx_extract` with `review: true`\n marks every insertion, deletion and move where it sits, anchors each comment on its text,\n and closes with a list of them all \u2014 author, date, section, replies and whether the\n thread is resolved \u2014 so the agent can analyse the impact of a revision. The default\n reading now says when a document holds tracked changes or comments it does not show.\n ([#347](https://github.com/laurentftech/pi-outpost/pull/347))\n- **Compare two versions of a Word document, on Windows.** When a document was revised\n without tracked changes, `docx_compare` has desktop Microsoft Word compare the two\n versions and returns every difference with the same markers, under its section; it can\n also save Word's compared document for you to open. Where Word is not available, the\n agent names the manual path: Review \u2192 Compare in Word.\n ([#348](https://github.com/laurentftech/pi-outpost/pull/348))\n\n### Fixed\n\n- **Word documents read as they now stand.** Moved text comes back once, at its\n destination; a table row deleted with tracking is no longer read as a row; and formatting\n replaced by a tracked change is no longer read as current.\n ([#347](https://github.com/laurentftech/pi-outpost/pull/347))\n- **No Word left running after a timeout.** When rendering or comparing a Word document\n ran out of time, the Word it had started kept running, invisible; it is now ended.\n ([#348](https://github.com/laurentftech/pi-outpost/pull/348))\n\n## [0.46.0] - 2026-10-20\n\n### Added\n\n- **Draw.io diagrams in replies.** Diagrams included in agent replies are interactive, and\n you can ask the agent to adjust one in place. ([#345](https://github.com/laurentftech/pi-outpost/pull/345))\n\n## [0.45.0] - 2026-10-20\n\n### Added\n\n- **draw.io diagrams, seen and made.** A `.drawio` file opens drawn in the file viewer, by\n draw.io's own viewer \u2014 every page, zoom, dark mode \u2014 with nothing fetched from anywhere;\n \"open in draw.io\" hands it to draw.io desktop for editing, and the view follows the saved\n file. The agent writes draw.io diagrams and checks them with `drawio_check`.\n\n## [0.44.0] - 2026-10-20\n\n### Added\n\n- **The commit history is a metro map.** The branch chip's menu draws the checked-out\n line and every local branch as parallel coloured lines, with merges as curves, branch\n names at their tips and tags on their commits. The checked-out line always runs first,\n in green. A commit or a branch made in a terminal shows up while the menu is open.\n ([#341](https://github.com/laurentftech/pi-outpost/pull/341))\n- **What's changed, after an update.** This changelog now ships inside pi-outpost: once\n updated, the app names the version you came from and shows what changed since, without\n going online. The notice of a newer version links its release notes.\n ([#342](https://github.com/laurentftech/pi-outpost/pull/342))\n\n## [0.43.0] - 2026-10-20\n\n### Added\n\n- **A change gutter in the editor**: a bar beside each line added or changed since HEAD,\n a notch where lines were removed. A click shows what was there and, while editing,\n reverts that change into the draft. The git state now follows commits, checkouts and\n resets made outside the app. ([#338](https://github.com/laurentftech/pi-outpost/pull/338))\n\n### Fixed\n\n- A confined shell's history is kept out of the project.\n ([#340](https://github.com/laurentftech/pi-outpost/pull/340))\n- The header's controls stay on one row. ([#339](https://github.com/laurentftech/pi-outpost/pull/339))\n- `show_planning` repeats its summary in its structured content.\n ([#336](https://github.com/laurentftech/pi-outpost/pull/336))\n\n## [0.42.0] - 2026-10-19\n\n### Added\n\n- **Provider accounts**: sign in to model providers and manage the accounts from the app.\n ([#335](https://github.com/laurentftech/pi-outpost/pull/335))\n- **A lock that shows confinement was verified**, not only configured.\n ([#334](https://github.com/laurentftech/pi-outpost/pull/334))\n- **More sandbox runners**: Seatbelt through `sandbox-exec` on every Mac\n ([#330](https://github.com/laurentftech/pi-outpost/pull/330)), and MXC's macOS\n ([#329](https://github.com/laurentftech/pi-outpost/pull/329)) and Linux\n ([#328](https://github.com/laurentftech/pi-outpost/pull/328)) executors.\n- **`sandbox.allowedHosts`**: under MXC, the agent's shell reaches only the hosts you name.\n ([#327](https://github.com/laurentftech/pi-outpost/pull/327))\n\n### Fixed\n\n- A confined shell reads the global git ignore and attributes files.\n ([#332](https://github.com/laurentftech/pi-outpost/pull/332))\n- MXC is asked for no clipboard and no input injection.\n ([#326](https://github.com/laurentftech/pi-outpost/pull/326))\n\n## [0.41.0] - 2026-10-18\n\n### Changed\n\n- The Claude Desktop planning view follows the host's theme.\n ([#323](https://github.com/laurentftech/pi-outpost/pull/323))\n- Structured-exchange figures follow the dark theme, and the table key names its colours.\n ([#322](https://github.com/laurentftech/pi-outpost/pull/322))\n- `@microsoft/mxc-sdk` 1.0.1. ([#324](https://github.com/laurentftech/pi-outpost/pull/324))\n\n### Fixed\n\n- A confined shell runs a turn's commands in order.\n ([#325](https://github.com/laurentftech/pi-outpost/pull/325))\n" : "";
|
|
219073
|
-
var PI_SDK_VERSION = true ? "1.5.
|
|
219131
|
+
var VERSION2 = true ? "0.62.2" : "dev";
|
|
219132
|
+
var CHANGELOG = true ? "# Changelog\n\nWhat changed in each release of pi-outpost, newest first. This file ships inside the\npackage and the executables: after an update, the app shows the sections between the\nversion you had and the one you run now, without going online.\n\nReleases before 0.41.0 are described on\n[GitHub Releases](https://github.com/laurentftech/pi-outpost/releases).\n\n## [0.62.2] - 2026-11-11\n\n### Fixed\n\n- **Decode Outlook rich-text email without duplicating Unicode fallback characters.**\n ([#480](https://github.com/laurentftech/pi-outpost/pull/480))\n- **Keep email text when multipart boundaries are missing and preserve loosely written\n HTML tables.** ([#481](https://github.com/laurentftech/pi-outpost/pull/481),\n [#483](https://github.com/laurentftech/pi-outpost/pull/483))\n- **Stop the agent turn even when queued messages cannot be kept pending.**\n ([#484](https://github.com/laurentftech/pi-outpost/pull/484))\n- **Close Windows pseudo-terminals when their shell exits.**\n ([#481](https://github.com/laurentftech/pi-outpost/pull/481))\n\n## [0.62.1] - 2026-11-10\n\n### Fixed\n\n- **Thinking controls respect the model's minimum.** Models requiring reasoning no\n longer offer an unsupported `off` choice; models allowing it keep that choice.\n ([#478](https://github.com/laurentftech/pi-outpost/pull/478))\n- **Find on-demand tools again after they leave the prompt.** `tool_search` can reload\n the extended Work Plan tools after inactivity. In embedded sessions, calling a\n remembered deferred tool from another extension also reactivates it.\n ([#474](https://github.com/laurentftech/pi-outpost/pull/474))\n\n### Changed\n\n- **Updated the pi engine to 1.5.1**, with tool-search, file-reading and grep fixes.\n When no model is configured, the Anthropic default is now Claude Opus 5.5.\n Eligible prompt caches can now be warmed while idle, which can incur provider\n charges; set `cacheWarming` to `\"streaming\"` for the previous behavior or `\"off\"`\n in `<agentDir>/settings.json` to disable warming.\n ([#478](https://github.com/laurentftech/pi-outpost/pull/478))\n- More automated checks exercise malformed ZIP archives, email and structured-exchange\n documents. ([#472](https://github.com/laurentftech/pi-outpost/pull/472))\n- Refreshed the project website, with clearer guidance on built-in sandboxing and\n deployment options. ([#475](https://github.com/laurentftech/pi-outpost/pull/475),\n [#476](https://github.com/laurentftech/pi-outpost/pull/476))\n\n## [0.62.0] - 2026-11-08\n\n### Added\n\n- **Host questions under landstrip on Linux.** `sandbox.allowedHosts` now works with\n landstrip: the agent's shell reaches the listed hosts through the server's proxy, and a\n connection to any other host asks you, as under MXC and Seatbelt. An empty list asks about\n every host. ([#468](https://github.com/laurentftech/pi-outpost/pull/468))\n\n### Changed\n\n- **Docker: the agent's network asks you by default.** The image used to close the agent's\n network unless the operator opted in; it now reaches hosts only through the server's proxy,\n which asks you about each one. Existing volumes get `sandbox.allowedHosts: []` at startup.\n `ALLOW_AGENT_NETWORK=0` now refuses all networking, the proxy included, and `1` follows\n your configuration as before. The image ships landstrip 0.20.26, which also hides the\n server's processes from the agent's commands. ([#468](https://github.com/laurentftech/pi-outpost/pull/468))\n- **Remote servers require encrypted transport.** A server listening beyond the loopback\n now refuses plain HTTP: configure a certificate for native HTTPS/WSS, or keep it on the\n loopback behind SSH or a TLS proxy. `server.allowInsecureHttp` (or\n `PI_OUTPOST_ALLOW_INSECURE_HTTP=1`) keeps plain HTTP for a hop you protect otherwise, with\n a warning. Loopback HTTP is unchanged. ([#463](https://github.com/laurentftech/pi-outpost/pull/463))\n\n### Fixed\n\n- Under landstrip, a refused operation is told to the agent in words instead of landstrip's\n JSON report, so a command that survived the refusal is no longer taken for a failed one;\n the startup line now says an empty host list asks about every host.\n ([#469](https://github.com/laurentftech/pi-outpost/pull/469))\n- draw.io wires with a fixed end on a shape that has perimeter spacing end where draw.io\n draws them, and `drawio_check` judges those routes as drawn.\n ([#467](https://github.com/laurentftech/pi-outpost/pull/467))\n\n## [0.61.0] - 2026-11-08\n\n### Added\n\n- **One actions menu per row in the Files tree.** Each file and folder now has a single\n `\u22EF` menu (also on right-click) instead of a row of unlabelled icons. Folders can be\n renamed, moved, deleted and downloaded like files. Select several entries with\n Shift-click or Ctrl/Cmd-click to delete, move, download or reference them together.\n **Download** saves a file as itself, and a folder or a selection as one `.zip`.\n The last move, rename or deletion can be undone (Undo, or Ctrl/Cmd+Z): deleted entries\n go to a temporary server trash, emptied at startup and after 24 hours.\n ([#438](https://github.com/laurentftech/pi-outpost/pull/438))\n- **Git credentials for private repositories in Agent resources.** When a clone or refresh\n needs a login, the panel asks for a user name and token, stores them for that host and\n retries. Settings \u2192 Accounts lists the stored Git hosts and removes them. Git errors now\n show git's actual reason instead of its progress line. ([#428](https://github.com/laurentftech/pi-outpost/pull/428))\n- **Host questions on Linux and macOS sandboxes.** Under MXC on Linux and macOS and under\n Seatbelt, a connection to a host missing from `sandbox.allowedHosts` now asks you\n instead of being refused silently. ([#429](https://github.com/laurentftech/pi-outpost/pull/429))\n- Release files now carry signed build provenance: check a download with\n `gh attestation verify <file> -R laurentftech/pi-outpost`. ([#436](https://github.com/laurentftech/pi-outpost/pull/436))\n\n### Fixed\n\n- Terminal colours in tool output are rendered instead of printed as escape codes, in the\n app and in the HTML export. ([#427](https://github.com/laurentftech/pi-outpost/pull/427))\n- A session whose first reply starts with a tool call is titled from its answer, not from\n the question alone. ([#449](https://github.com/laurentftech/pi-outpost/pull/449))\n\n## [0.60.1] - 2026-11-06\n\n### Fixed\n\n- Hardened filesystem access, document parsing, command execution, URL validation and\n diagnostic logging against untrusted input. ([#420](https://github.com/laurentftech/pi-outpost/pull/420),\n [#422](https://github.com/laurentftech/pi-outpost/pull/422))\n\n## [0.60.0] - 2026-11-05\n\n### Added\n\n- **Run the full app with Python in Docker.** A Compose recipe includes the web\n interface, agent, Python/venv and integrated terminal, with persistent projects\n and agent settings. The app runs as a non-root user and verifies shell and terminal\n confinement before serving. Agent shell networking is off by default and can be\n enabled explicitly by the operator. Releases now publish the tested Linux x64 image\n to `ghcr.io/laurentftech/pi-outpost`, with a version tag and `latest` for stable releases.\n The deployment guide documents the required sandbox profiles and host prerequisites.\n ([#416](https://github.com/laurentftech/pi-outpost/pull/416))\n\n### Changed\n\n- **Clearer contribution and security guidance.** The repository now documents\n contribution requirements, private vulnerability reporting, quality checks and\n their limitations. Bug and feature issue forms help provide useful reports.\n Server lint and broader JavaScript/TypeScript CodeQL analysis extend the existing\n checks; the analysis also reports existing findings that need triage.\n ([#418](https://github.com/laurentftech/pi-outpost/pull/418))\n- **Updated dependency maintenance.** Bump glob and related locked dependencies.\n ([#415](https://github.com/laurentftech/pi-outpost/pull/415))\n\n### Fixed\n\n- **Keep stable extension symlinks across updates.** Adding an extension folder\n preserves the chosen symlink or Windows junction instead of saving its versioned\n target. The resource manager displays the configured folder and removes the correct\n entry without deleting its files. After repointing the link, restart pi-outpost to\n load the new extension code.\n ([#417](https://github.com/laurentftech/pi-outpost/pull/417))\n\n## [0.59.1] - 2026-11-05\n\n### Changed\n\n- **Keep the conversation visible while answering questions.** Questions now appear\n below the timeline, leaving the context readable and scrollable. Short choices use\n up to two columns when there is room; long descriptions and narrow windows keep\n one column. Sandbox permission requests scroll their command, paths and explanation\n independently, with all three decision buttons kept visible.\n ([#412](https://github.com/laurentftech/pi-outpost/pull/412),\n [#413](https://github.com/laurentftech/pi-outpost/pull/413))\n- **Install safely with npm 12.** Installation instructions and the updater explicitly\n allow the native scripts needed by the terminal and sandbox while blocking unrelated\n dependency scripts. Use `npx --allow-scripts=node-pty,koffi pi-outpost` with npm 12\n and a compatible Node version (24.15+ or 26+).\n ([#411](https://github.com/laurentftech/pi-outpost/pull/411))\n\n### Fixed\n\n- **Unanswered questions survive browser disconnections.** A connection lost during\n browser sleep no longer becomes a refusal sent to the agent. Questions without an\n extension-defined deadline reappear on reconnect, and a project waiting for your\n answer stays available even after its idle timeout. Starting a new session can\n still deliberately abandon an old question.\n ([#414](https://github.com/laurentftech/pi-outpost/pull/414))\n\n## [0.59.0] - 2026-11-04\n\n### Changed\n\n- **Keep the conversation visible in narrow windows.** The Work Plan collapses\n automatically below 768 pixels and restores its desktop state when the window\n widens. The model selector and Settings resources also have clearer accessible\n names and improved contrast.\n ([#407](https://github.com/laurentftech/pi-outpost/pull/407))\n- **Updated diagram and page editors.** Mermaid is now 12.3.0 and GrapesJS 0.23.9.\n ([#407](https://github.com/laurentftech/pi-outpost/pull/407))\n\n### Fixed\n\n- **Send queued messages immediately after an interruption.** \u201CSend now\u201D starts a\n new turn with the pending messages, including when the agent was running a tool.\n Stopping the agent keeps pending messages ready for the next prompt. Long\n conversations no longer create a second page scrollbar.\n ([#405](https://github.com/laurentftech/pi-outpost/pull/405))\n- **Reuse document tools after reopening a session.** Tools discovered for PDFs,\n Word documents, presentations and spreadsheets are restored when the session\n resumes. Repeating an earlier tool call works without another discovery step.\n ([#406](https://github.com/laurentftech/pi-outpost/pull/406))\n- **HTTPS commands work in the macOS sandbox.** The sandbox now permits the\n system certificate trust service needed to validate HTTPS connections.\n ([#405](https://github.com/laurentftech/pi-outpost/pull/405))\n\n## [0.58.0] - 2026-11-03\n\n### Added\n\n- **Add and remove pi packages from Settings.** Under Extensions \u2192 Packages,\n **Add a package** takes an npm name (`openlore`, `@scope/name`, or\n `name@1.2.3` to pin that version) and installs it for all projects or for\n this project only. The name is looked up on the registry your npm\n configuration uses first, and the confirmation names the version that will\n be installed. **Remove** uninstalls a package; it keeps running until\n pi-outpost restarts, so it stays listed with **Undo** until then. Nothing\n changes while an agent is working, and `extensionLock` forbids both.\n ([#404](https://github.com/laurentftech/pi-outpost/pull/404))\n\n### Changed\n\n- **Queued messages are lighter.** A message waiting for the agent now looks\n like a sent one, only paler, without a frame or a heading; a single line under\n the queue says \"queued\", with \"send now\" as a plain link. When the queue\n cannot be sent (a message an extension queued, or the connection dropped), the\n line still says \"queued\", without the link.\n ([#403](https://github.com/laurentftech/pi-outpost/pull/403))\n- **The restart notice names each package once, by its latest change.** It now\n covers packages added and removed, and drops one put back as it was.\n ([#404](https://github.com/laurentftech/pi-outpost/pull/404))\n\n## [0.57.0] - 2026-11-02\n\n### Added\n\n- **Change a message the agent has not read yet.** A message you send while the\n agent works waits until the end of its current step. It now shows below the\n running turn, marked as queued, with the usual \u270E to rewrite it and a \u2715 to\n take it out; once the agent reads it, it joins the conversation where it was\n read. If the agent reads it while you are editing it, your edit lands in the\n composer instead of being lost.\n ([#400](https://github.com/laurentftech/pi-outpost/pull/400))\n- **Send queued messages now.** One button sends everything that is queued at\n once. After a stop, it sends them without your typing a new message. While\n the agent works, it first stops the current step, and tells you so before\n doing it: a reply being written is dropped and a running tool is stopped,\n while the work already done is kept.\n ([#400](https://github.com/laurentftech/pi-outpost/pull/400))\n\n### Changed\n\n- **A turned-off sandbox shows the shell's lock open.** With `\"sandbox\": false`,\n the agent's shell runs with every right of the server's account; the lock next\n to the model now says so, instead of showing nothing. Where this machine can\n confine the shell, it offers `pi-outpost config --confine`, which now turns\n the sandbox back on (after checking the runner) and tells you that the\n agent's file tools are limited to the project again.\n ([#402](https://github.com/laurentftech/pi-outpost/pull/402))\n- **Pi SDK 1.5.0.** The npm CLI and server use the updated SDK, which also brings\n the `undici` security fix it had been pinning out.\n ([#399](https://github.com/laurentftech/pi-outpost/pull/399))\n\n### Fixed\n\n- **Messages sent in quick succession reach the agent in the order you sent\n them.** A message naming files with `@` could be overtaken by a plain one\n sent right after it.\n ([#401](https://github.com/laurentftech/pi-outpost/pull/401))\n- **A message queued before a stop no longer vanishes.** It disappeared from the\n screen while the agent kept it and sent it with your next message; it now\n stays visible, and can be changed, removed or sent.\n ([#400](https://github.com/laurentftech/pi-outpost/pull/400))\n\n## [0.56.0] - 2026-11-01\n\n### Changed\n\n- **The agent is now sandboxed by default.** This is the main change of this\n release. If your configuration has no `sandbox` section, the agent can now read\n and write only inside the project, and its shell runs in the operating\n system's sandbox: MXC on Windows and Linux, Seatbelt on macOS. Commands run\n once the sandbox has passed its check; where it cannot confine \u2014 a Windows 11\n build without the August 2026 update, a container without user namespaces \u2014\n the shell refuses every command and says why. To get an unconfined shell\n back, set `\"bashRunner\": \"none\"` in `sandbox`; to turn the sandbox off\n entirely, `\"sandbox\": false`. A configuration that already has a `sandbox`\n section behaves as before. The agent can no longer write pi-outpost's\n configuration file, and `pi-outpost init` writes this default out.\n ([#397](https://github.com/laurentftech/pi-outpost/pull/397))\n- **A shorter README.** Setup, configuration, the command line, features,\n deployment and integrations each have their own guide under `docs/`.\n ([#398](https://github.com/laurentftech/pi-outpost/pull/398))\n- The draw.io viewer is updated to 32.6.9.\n ([#386](https://github.com/laurentftech/pi-outpost/pull/386))\n\n### Added\n\n- **Confine an unconfined shell in one command.** When your configuration runs\n the shell unconfined and this machine can confine it, the lock next to the\n model is highlighted and says so; `pi-outpost config --confine` checks the\n sandbox, then switches it on in your configuration file.\n ([#397](https://github.com/laurentftech/pi-outpost/pull/397))\n- **Let a confined command through, once or for the session.** When a sandboxed\n command connects to a host that is not allowed, or the agent needs a folder\n beside the project, you are asked, and choose this command only, this session,\n or no. The agent directory, the configuration and `.pi` folders are never\n offered. ([#392](https://github.com/laurentftech/pi-outpost/pull/392))\n- **Run one turn from the terminal.** `pi-outpost -p \"<prompt>\"` answers on\n stdout and exits, without a browser; `-p -` reads the prompt from stdin and\n `--json` prints every event.\n ([#395](https://github.com/laurentftech/pi-outpost/pull/395))\n- **Search file contents from the Files panel.** The magnifying glass searches\n text files and the text of PDFs; a hit opens the file at the match.\n ([#385](https://github.com/laurentftech/pi-outpost/pull/385))\n- **Graphs with straight, readable wires that keep their layout.** Structured\n graphs are drawn with right-angled wires routed like draw.io's, and a layout you\n adjust \u2014 by dragging, or touched up in draw.io \u2014 is kept beside the document and\n reused when the model is revised.\n ([#390](https://github.com/laurentftech/pi-outpost/pull/390))\n- **`drawio_check` checks where wires meet.** It warns about wires that share a\n point while carrying different data, exits facing the wrong way, long detours\n and needless bends, with advice that settles the diagram.\n ([#389](https://github.com/laurentftech/pi-outpost/pull/389))\n\n### Fixed\n\n- **Tools installed for your user run in the Windows sandbox.** A confined\n command finds what `PATH` finds (Python in your profile, for example), and a\n bare `sandbox.bashShell` such as `pwsh.exe` is looked up on `PATH`.\n ([#393](https://github.com/laurentftech/pi-outpost/pull/393))\n- **The PowerShell confinement check reports again**, instead of always showing\n \"confinement unchecked\". ([#388](https://github.com/laurentftech/pi-outpost/pull/388))\n- **Two arrangements saved at once both stick on Windows.**\n ([#394](https://github.com/laurentftech/pi-outpost/pull/394))\n- **`drawio_check`'s advice is read in linear time**, whatever a diagram's labels\n hold. ([#396](https://github.com/laurentftech/pi-outpost/pull/396))\n\n## [0.55.0] - 2026-10-29\n\n### Added\n\n- **Ask a side question while the agent works.** Use `/btw` to ask about the\n conversation without interrupting the running turn. The answer appears above\n the composer, supports follow-up questions, and stays out of the agent's\n conversation and saved session. Side answers use the session's model with no\n tools, in both embedded and RPC runtimes.\n ([#383](https://github.com/laurentftech/pi-outpost/pull/383))\n\n### Changed\n\n- **Load specialist tools when they are needed.** Document and project-model tools\n stay available through `tool_search` and extension calls without adding all their\n schemas to every request. Tools loaded by search follow the same inactivity\n rules as tools published when a document is named.\n ([#382](https://github.com/laurentftech/pi-outpost/pull/382))\n- **Keep diagram, poster and structure tools out of idle conversations.** These\n tools now load through `tool_search` too, with guidance explaining which tool\n families the agent can find.\n ([#384](https://github.com/laurentftech/pi-outpost/pull/384))\n\n### Fixed\n\n- **Keep on-demand tools hidden across conversation rewinds.** Restoring or\n rewinding a conversation no longer republishes tools that should stay inactive.\n ([#381](https://github.com/laurentftech/pi-outpost/pull/381))\n- **Find the Word extractor on Windows.** Searching for \u201CWord document\u201D includes\n `docx_extract` even when the Windows-only comparison tool is available.\n ([#384](https://github.com/laurentftech/pi-outpost/pull/384))\n\n## [0.54.0] - 2026-10-28\n\n### Added\n\n- **Drop desktop files straight into a workspace folder.** Drag files onto a folder\n in the Files tree, or onto Workspace root, to import them there without attaching\n them to the conversation. Progress, saved paths and individual errors stay visible\n when you close and reopen Files. Existing names receive a numeric suffix instead\n of being overwritten. Imports accept files up to 25 MB; folder drops and read-only\n destinations are refused, and changing workspace stops the remaining batch.\n ([#379](https://github.com/laurentftech/pi-outpost/pull/379))\n\n## [0.53.0] - 2026-10-28\n\n### Added\n\n- **Touch up a poster's draw.io diagram in place.** In pi-outpost, double-click a\n diagram picture to edit its page, or open it in draw.io desktop. Returning to the\n poster refreshes every picture of that page, keeping its position and width;\n one undo restores them all. Unsaved touch-ups are kept unless you discard them.\n ([#376](https://github.com/laurentftech/pi-outpost/pull/376))\n- **See why a session is slow to open.** A new session, session switch or fork taking\n at least two seconds logs the time spent shutting down the previous session,\n loading the new one and binding extensions. An extension binding that finishes\n later reports its completion too, helping diagnose slow MCP connections.\n ([#377](https://github.com/laurentftech/pi-outpost/pull/377))\n\n### Fixed\n\n- **The poster's Format panel starts from what you see.** Inherited fonts, sizes,\n colours and alignment are shown correctly, and the size arrows step from those\n values without accidental dragging. Font sizes stay positive and in pixels,\n line spacing is a multiple of the text size, and invalid colours are refused.\n The panel follows the light or dark theme and its colour picker stays in view.\n ([#375](https://github.com/laurentftech/pi-outpost/pull/375))\n\n## [0.52.0] - 2026-10-27\n\n### Added\n\n- **draw.io diagrams in posters.** In the poster editor, **Insert \u25BE \u2192 draw.io diagram\u2026** lists\n the project's diagrams page by page and puts the one you choose into the selected frame or\n onto the page. The agent can lay out a frame naming a diagram, and the editor draws it when\n the poster opens. ([#370](https://github.com/laurentftech/pi-outpost/pull/370))\n- **The project's pictures in posters.** **Insert \u25BE \u2192 Picture from the project\u2026** lists the\n project's SVG, PNG, JPEG, GIF and WebP files, including the figures the agent drew. An SVG\n stays sharp at any size; the agent can name a picture file in a frame too.\n ([#371](https://github.com/laurentftech/pi-outpost/pull/371))\n- **The agent checks its posters.** After writing a poster, the agent runs `poster_check`,\n which says what the editor would refuse, drop or leave empty, so it fixes the poster before\n you open it. ([#373](https://github.com/laurentftech/pi-outpost/pull/373))\n- **Wires that cross boxes are caught.** `drawio_check` now warns when a wire runs through a\n box or its label sits on one, so the agent can tidy its diagram. In touch-up, a **wires**\n control draws the selected wires, or all of them, straight, orthogonal or curved.\n ([#374](https://github.com/laurentftech/pi-outpost/pull/374))\n\n### Fixed\n\n- **A poster open in the viewer shows the agent's new version** as soon as it rewrites the\n file, unless you have unsaved touch-ups, which are kept. ([#369](https://github.com/laurentftech/pi-outpost/pull/369))\n- **Posters with text pasted from Word export to Word and PowerPoint** instead of failing with\n \"this browser could not draw the page as a picture\"; an export that still fails says why.\n ([#372](https://github.com/laurentftech/pi-outpost/pull/372))\n- **Opening a poster no longer asks to discard changes you never made**, when the editor filled\n frames on opening. ([#373](https://github.com/laurentftech/pi-outpost/pull/373))\n- **No more stray \"git log failed\" at the bottom of the conversation.** The commit map only\n follows the repository while its menu is open, and a failure shows in the menu, saying why\n git failed (too slow, not found, too much output). ([#368](https://github.com/laurentftech/pi-outpost/pull/368))\n\n## [0.51.0] - 2026-10-26\n\n### Added\n\n- **Pictures, text boxes and shapes in posters.** In the poster editor, **Insert \u25BE** adds a\n picture from your computer, a text box or a shape (rectangle, ellipse, arrow, star, speech\n bubble\u2026). Double-click an empty frame the agent laid out, or drop a file on the page, to put\n a picture in it. Pictures are shrunk to 1200 px and kept inside the poster file, and they\n still go out with it to Word and PowerPoint.\n ([#365](https://github.com/laurentftech/pi-outpost/pull/365))\n- **The agent keeps your pictures and can draw.** The agent reads each picture as a short\n marker and puts the picture back when it edits the poster, so its edits never drop one. It\n can also lay out empty frames for your pictures and draw simple illustrations, which move\n and resize as one piece. ([#365](https://github.com/laurentftech/pi-outpost/pull/365))\n- **Open WebUI's model can look at a poster's pictures.** With a model that reads images,\n `get_poster` can hand it the poster's pictures as images.\n ([#366](https://github.com/laurentftech/pi-outpost/pull/366))\n\n### Fixed\n\n- **The poster page stays still under your clicks.** The page is kept in view after you\n scroll, pinch or zoom, without ever fighting the editor's own fit, so a click on a text or\n a drawing selects it at once. ([#367](https://github.com/laurentftech/pi-outpost/pull/367))\n\n## [0.50.0] - 2026-10-25\n\n### Added\n\n- **Posters you can retouch.** Ask the agent for a poster, a worksheet or a slide and it\n writes a printable `.poster.html` page (A4, A3 or 16:9). The file viewer opens it in an\n editor: double-click a text to correct it, drag a pictogram, change colours, fonts and\n sizes, then save it back to the file. Unsaved touch-ups are not dropped without asking.\n ([#361](https://github.com/laurentftech/pi-outpost/pull/361))\n- **Posters to Word and PowerPoint.** From the editor, download the poster as a Word page,\n a PowerPoint slide or HTML. In Word and PowerPoint the poster is a picture at print\n resolution: correct texts in the editor, then export again.\n ([#361](https://github.com/laurentftech/pi-outpost/pull/361))\n- **Posters in Claude Desktop.** A second extension, `pi-outpost-posters.mcpb`, attached to\n each release, shows the same editor inside Claude.\n ([#361](https://github.com/laurentftech/pi-outpost/pull/361))\n- **Posters in Open WebUI.** The tool server creates, shows and lists posters for each user.\n When saving is configured, touch-ups made in the embed are kept as a new revision that\n the model reads back; an older embed cannot overwrite a newer revision.\n ([#361](https://github.com/laurentftech/pi-outpost/pull/361),\n [#362](https://github.com/laurentftech/pi-outpost/pull/362))\n\n### Changed\n\n- **Open WebUI embeds follow the host theme.** Planning and poster views switch between\n light and dark with Open WebUI. ([#362](https://github.com/laurentftech/pi-outpost/pull/362))\n\n### Fixed\n\n- **Extension statuses keep their semantic colours.** Statuses an extension styles as\n success, warning or error (pi-blackhole's gauges, for instance) are shown in colour\n instead of plain text, including in the standalone executables.\n ([#360](https://github.com/laurentftech/pi-outpost/pull/360))\n- **Dependency security updates.** `fast-uri` 3.1.9 fixes four URI parsing advisories;\n `undici` moves to 8.12.3. ([#363](https://github.com/laurentftech/pi-outpost/pull/363),\n [#364](https://github.com/laurentftech/pi-outpost/pull/364))\n\n## [0.49.0] - 2026-10-23\n\n### Added\n\n- **Coloured extension statuses.** Status badges keep the foreground colours, bold,\n dim, italic and underline styling sent by extensions, both in the header and in\n the overflow list. Hover titles remain plain text.\n ([#356](https://github.com/laurentftech/pi-outpost/pull/356))\n- **Release notes readable by agents.** The npm package now carries `CHANGELOG.md`\n at its root, so agents and tools can read what changed without starting the server.\n ([#356](https://github.com/laurentftech/pi-outpost/pull/356))\n\n### Changed\n\n- **Pi SDK 1.4.0.** The npm CLI and server use the updated SDK.\n ([#356](https://github.com/laurentftech/pi-outpost/pull/356))\n\n## [0.48.0] - 2026-10-23\n\n### Added\n\n- **Update the agent's pi packages from the terminal.** `pi-outpost update --extensions`\n installs the newest version of every npm pi package the agent loads, with the same rules\n as Settings: pinned packages stay put, a failed lookup is reported rather than called up to\n date, and `extensionLock` refuses. `pi-outpost update --all` updates pi-outpost, then the\n packages, and works from a standalone executable too. Plain `pi-outpost update` now ends\n by naming the packages that have a newer version.\n ([#351](https://github.com/laurentftech/pi-outpost/pull/351))\n- **Choose the shell of each terminal.** A new terminal tab offers the shells installed on\n the machine, and defaults to PowerShell on Windows. The terminal's height can be resized\n and is remembered, the usual copy and paste shortcuts work, and its shell sessions come\n back after a reconnect. ([#355](https://github.com/laurentftech/pi-outpost/pull/355))\n- **A System theme.** Next to Light and Dark, the header offers System, which follows your\n operating system. ([#355](https://github.com/laurentftech/pi-outpost/pull/355))\n- **Git changes beside the scrollbar.** The file editor and the read-only source view mark\n every Git change next to the scrollbar; click a marker to jump to it, even when it is\n out of view. ([#355](https://github.com/laurentftech/pi-outpost/pull/355))\n- **Credits.** Settings have a Credits page listing the third-party software pi-outpost\n includes, readable offline. ([#355](https://github.com/laurentftech/pi-outpost/pull/355))\n\n### Changed\n\n- **Opening a file no longer attaches it to your message.** Files you browse stay out of\n the composer; attach or pin one when you want the agent to see it.\n ([#355](https://github.com/laurentftech/pi-outpost/pull/355))\n- **Restart the session at any time.** Settings always offer a session restart, to reload\n extensions and MCP servers without changing the configuration.\n ([#355](https://github.com/laurentftech/pi-outpost/pull/355))\n\n### Fixed\n\n- **Images and codemode in the standalone executable.** The agent saw no image (`read` on\n a picture answered \"Image omitted\") and codemode scripts failed to start; both now work in\n the executable as they do from npm.\n ([#353](https://github.com/laurentftech/pi-outpost/pull/353))\n- **A Mermaid diagram drawn again no longer vanishes.** Turning a diagram back to an\n orientation it already had left the block with its buttons and no picture.\n ([#354](https://github.com/laurentftech/pi-outpost/pull/354))\n\n## [0.47.0] - 2026-10-22\n\n### Added\n\n- **Tracked changes and comments in Word documents.** `docx_extract` with `review: true`\n marks every insertion, deletion and move where it sits, anchors each comment on its text,\n and closes with a list of them all \u2014 author, date, section, replies and whether the\n thread is resolved \u2014 so the agent can analyse the impact of a revision. The default\n reading now says when a document holds tracked changes or comments it does not show.\n ([#347](https://github.com/laurentftech/pi-outpost/pull/347))\n- **Compare two versions of a Word document, on Windows.** When a document was revised\n without tracked changes, `docx_compare` has desktop Microsoft Word compare the two\n versions and returns every difference with the same markers, under its section; it can\n also save Word's compared document for you to open. Where Word is not available, the\n agent names the manual path: Review \u2192 Compare in Word.\n ([#348](https://github.com/laurentftech/pi-outpost/pull/348))\n\n### Fixed\n\n- **Word documents read as they now stand.** Moved text comes back once, at its\n destination; a table row deleted with tracking is no longer read as a row; and formatting\n replaced by a tracked change is no longer read as current.\n ([#347](https://github.com/laurentftech/pi-outpost/pull/347))\n- **No Word left running after a timeout.** When rendering or comparing a Word document\n ran out of time, the Word it had started kept running, invisible; it is now ended.\n ([#348](https://github.com/laurentftech/pi-outpost/pull/348))\n\n## [0.46.0] - 2026-10-20\n\n### Added\n\n- **Draw.io diagrams in replies.** Diagrams included in agent replies are interactive, and\n you can ask the agent to adjust one in place. ([#345](https://github.com/laurentftech/pi-outpost/pull/345))\n\n## [0.45.0] - 2026-10-20\n\n### Added\n\n- **draw.io diagrams, seen and made.** A `.drawio` file opens drawn in the file viewer, by\n draw.io's own viewer \u2014 every page, zoom, dark mode \u2014 with nothing fetched from anywhere;\n \"open in draw.io\" hands it to draw.io desktop for editing, and the view follows the saved\n file. The agent writes draw.io diagrams and checks them with `drawio_check`.\n\n## [0.44.0] - 2026-10-20\n\n### Added\n\n- **The commit history is a metro map.** The branch chip's menu draws the checked-out\n line and every local branch as parallel coloured lines, with merges as curves, branch\n names at their tips and tags on their commits. The checked-out line always runs first,\n in green. A commit or a branch made in a terminal shows up while the menu is open.\n ([#341](https://github.com/laurentftech/pi-outpost/pull/341))\n- **What's changed, after an update.** This changelog now ships inside pi-outpost: once\n updated, the app names the version you came from and shows what changed since, without\n going online. The notice of a newer version links its release notes.\n ([#342](https://github.com/laurentftech/pi-outpost/pull/342))\n\n## [0.43.0] - 2026-10-20\n\n### Added\n\n- **A change gutter in the editor**: a bar beside each line added or changed since HEAD,\n a notch where lines were removed. A click shows what was there and, while editing,\n reverts that change into the draft. The git state now follows commits, checkouts and\n resets made outside the app. ([#338](https://github.com/laurentftech/pi-outpost/pull/338))\n\n### Fixed\n\n- A confined shell's history is kept out of the project.\n ([#340](https://github.com/laurentftech/pi-outpost/pull/340))\n- The header's controls stay on one row. ([#339](https://github.com/laurentftech/pi-outpost/pull/339))\n- `show_planning` repeats its summary in its structured content.\n ([#336](https://github.com/laurentftech/pi-outpost/pull/336))\n\n## [0.42.0] - 2026-10-19\n\n### Added\n\n- **Provider accounts**: sign in to model providers and manage the accounts from the app.\n ([#335](https://github.com/laurentftech/pi-outpost/pull/335))\n- **A lock that shows confinement was verified**, not only configured.\n ([#334](https://github.com/laurentftech/pi-outpost/pull/334))\n- **More sandbox runners**: Seatbelt through `sandbox-exec` on every Mac\n ([#330](https://github.com/laurentftech/pi-outpost/pull/330)), and MXC's macOS\n ([#329](https://github.com/laurentftech/pi-outpost/pull/329)) and Linux\n ([#328](https://github.com/laurentftech/pi-outpost/pull/328)) executors.\n- **`sandbox.allowedHosts`**: under MXC, the agent's shell reaches only the hosts you name.\n ([#327](https://github.com/laurentftech/pi-outpost/pull/327))\n\n### Fixed\n\n- A confined shell reads the global git ignore and attributes files.\n ([#332](https://github.com/laurentftech/pi-outpost/pull/332))\n- MXC is asked for no clipboard and no input injection.\n ([#326](https://github.com/laurentftech/pi-outpost/pull/326))\n\n## [0.41.0] - 2026-10-18\n\n### Changed\n\n- The Claude Desktop planning view follows the host's theme.\n ([#323](https://github.com/laurentftech/pi-outpost/pull/323))\n- Structured-exchange figures follow the dark theme, and the table key names its colours.\n ([#322](https://github.com/laurentftech/pi-outpost/pull/322))\n- `@microsoft/mxc-sdk` 1.0.1. ([#324](https://github.com/laurentftech/pi-outpost/pull/324))\n\n### Fixed\n\n- A confined shell runs a turn's commands in order.\n ([#325](https://github.com/laurentftech/pi-outpost/pull/325))\n" : "";
|
|
219133
|
+
var PI_SDK_VERSION = true ? "1.5.1" : readInstalledPiSdkVersion();
|
|
219074
219134
|
var LAUNCH_DIR = process.env.INIT_CWD ?? process.cwd();
|
|
219075
219135
|
function complain(error) {
|
|
219076
219136
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -220316,7 +220376,7 @@ function restoreDocumentTools(workspace2) {
|
|
|
220316
220376
|
workspace2.agent.setToolPublished(TOOL_SEARCH_TOOL, true);
|
|
220317
220377
|
}
|
|
220318
220378
|
function reassertOnDemandTools(workspace2) {
|
|
220319
|
-
for (const tool of
|
|
220379
|
+
for (const tool of DEFERRED_TOOLS) {
|
|
220320
220380
|
workspace2.agent.setToolPublished(tool, workspace2.documentToolIdleTurns.has(tool));
|
|
220321
220381
|
}
|
|
220322
220382
|
}
|
|
@@ -222000,7 +222060,14 @@ async function abortTurn(workspace2) {
|
|
|
222000
222060
|
await workspace2.agent.abort();
|
|
222001
222061
|
return;
|
|
222002
222062
|
}
|
|
222003
|
-
|
|
222063
|
+
let taken;
|
|
222064
|
+
try {
|
|
222065
|
+
taken = await takeQueueBack(workspace2);
|
|
222066
|
+
} catch (error) {
|
|
222067
|
+
broadcast(workspace2, { type: "error", message: `The queued messages could not be kept pending: ${error instanceof Error ? error.message : String(error)}` });
|
|
222068
|
+
await workspace2.agent.abort();
|
|
222069
|
+
return;
|
|
222070
|
+
}
|
|
222004
222071
|
await stopTurn(workspace2);
|
|
222005
222072
|
await requeue(workspace2, void 0, taken);
|
|
222006
222073
|
} finally {
|