pi-outpost 0.27.1 → 0.28.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12370,7 +12370,7 @@ function rulePatterns(profile, rules, sources) {
12370
12370
  }
12371
12371
 
12372
12372
  // shared/bin/validate-structured-exchange.mjs
12373
- var VERSION = `validate-structured-exchange ${false ? "development" : "0.27.1"}`;
12373
+ var VERSION = `validate-structured-exchange ${false ? "development" : "0.28.1"}`;
12374
12374
  var USAGE = `validate-structured-exchange [file]
12375
12375
  validate-structured-exchange --profile <profile.json> [file]
12376
12376
  validate-structured-exchange --check-profile <profile.json>
@@ -132364,6 +132364,12 @@ var WORST_LISTED = 8;
132364
132364
  function isStackExhaustion(message) {
132365
132365
  return /maximum call stack size exceeded|call stack size exceeded|stack overflow/i.test(message);
132366
132366
  }
132367
+ var PROVIDER_STACK_ENV = "PI_OUTPOST_PROVIDER_STACK";
132368
+ var PROVIDER_STACK_OFF = /* @__PURE__ */ new Set(["", "0", "false", "no", "off"]);
132369
+ function providerStackProbeArmed(env2 = process.env) {
132370
+ return !PROVIDER_STACK_OFF.has((env2[PROVIDER_STACK_ENV] ?? "").trim().toLowerCase());
132371
+ }
132372
+ var PROVIDER_STACK_HINT = `[pi-outpost] no stack accompanies this \u2014 the provider's catch drops it. Set ${PROVIDER_STACK_ENV}=1 and the next occurrence will print one.`;
132367
132373
  function inspectShape(root) {
132368
132374
  let depth = 0;
132369
132375
  let cyclic = false;
@@ -132508,6 +132514,7 @@ function writeRecord(agentDir, report) {
132508
132514
  context?.cyclic?.length ? ` SELF-REFERENCE in ${context.cyclic.length} entr${context.cyclic.length === 1 ? "y" : "ies"}` : ""
132509
132515
  ].join("");
132510
132516
  console.error(headline);
132517
+ if (!providerStackProbeArmed()) console.error(PROVIDER_STACK_HINT);
132511
132518
  const file = path23.join(agentDir, "turn-failures.jsonl");
132512
132519
  try {
132513
132520
  fs21.mkdirSync(agentDir, { recursive: true });
@@ -140648,12 +140655,15 @@ var TuiAltScreen = class extends TuiBase {
140648
140655
  if (row >= screen.length || isImageLine(screen[row] ?? ""))
140649
140656
  return screen;
140650
140657
  const scrollbarColumn = box ? getScrollbarGeometry(box)?.column : void 0;
140651
- const availableWidth = Math.max(0, (scrollbarColumn ?? clip.x + clip.width) - clip.x);
140652
- const text2 = truncateToWidth(this.scrollToEndIndicator(), availableWidth, "");
140658
+ const label = truncateToWidth(this.scrollToEndIndicator(), clip.width, "");
140659
+ const labelWidth = visibleWidth(label);
140660
+ const column = clip.x + Math.floor((clip.width - labelWidth) / 2);
140661
+ const rightEdge = scrollbarColumn ?? clip.x + clip.width;
140662
+ const availableWidth = Math.max(0, rightEdge - column);
140663
+ const text2 = truncateToWidth(label, availableWidth, "");
140653
140664
  const textWidth = visibleWidth(text2);
140654
140665
  if (textWidth === 0)
140655
140666
  return screen;
140656
- const column = clip.x + Math.floor((availableWidth - textWidth) / 2);
140657
140667
  const result = [...screen];
140658
140668
  result[row] = compositeTuiLine(result[row] ?? "", text2, column, textWidth, width);
140659
140669
  this.scrollToEndIndicatorRect = { row, column, width: textWidth };
@@ -143476,8 +143486,8 @@ function cacheControlFor(url) {
143476
143486
  }
143477
143487
 
143478
143488
  // ../server/src/index.ts
143479
- var VERSION2 = true ? "0.27.1" : "dev";
143480
- var PI_SDK_VERSION = true ? "0.86.1" : readInstalledPiSdkVersion();
143489
+ var VERSION2 = true ? "0.28.1" : "dev";
143490
+ var PI_SDK_VERSION = true ? "0.87.0" : readInstalledPiSdkVersion();
143481
143491
  var LAUNCH_DIR = process.env.INIT_CWD ?? process.cwd();
143482
143492
  function complain(error) {
143483
143493
  const message = error instanceof Error ? error.message : String(error);
@@ -144212,8 +144222,8 @@ for (const root of config.openProjects) {
144212
144222
  }
144213
144223
  workspace.workPlan = await loadWorkPlan(workspace.agent.snapshot().sessionFile);
144214
144224
  workspace.workPlanSessionFile = workspace.agent.snapshot().sessionFile;
144215
- publishWorkPlanTools(workspace, workspace.workPlan);
144216
144225
  withholdDocumentTools(workspace);
144226
+ publishWorkPlanTools(workspace, workspace.workPlan);
144217
144227
  function withholdDocumentTools(workspace2) {
144218
144228
  for (const tool of [...DOCUMENT_TOOLS, PROJECT_MODEL_TOOL]) workspace2.agent.setToolPublished(tool, false);
144219
144229
  workspace2.documentToolIdleTurns.clear();
@@ -144241,11 +144251,12 @@ function unpublishDocumentTools(workspace2, tools) {
144241
144251
  }
144242
144252
  }
144243
144253
  var DOCUMENT_TOOL_IDLE_LIMIT = { unused: 1, used: 5 };
144254
+ var WORK_PLAN_EXTENDED_IDLE_LIMIT = 5;
144244
144255
  function ageDocumentTools(workspace2) {
144245
144256
  const used = workspace2.documentToolsUsedThisTurn;
144246
144257
  for (const [tool, idle] of workspace2.documentToolIdleTurns) {
144247
144258
  if (used.has(tool)) continue;
144248
- const limit = workspace2.documentToolsEverUsed.has(tool) ? DOCUMENT_TOOL_IDLE_LIMIT.used : DOCUMENT_TOOL_IDLE_LIMIT.unused;
144259
+ const limit = tool === WORK_PLAN_EXTENDED_TOOL ? WORK_PLAN_EXTENDED_IDLE_LIMIT : workspace2.documentToolsEverUsed.has(tool) ? DOCUMENT_TOOL_IDLE_LIMIT.used : DOCUMENT_TOOL_IDLE_LIMIT.unused;
144249
144260
  if (idle + 1 < limit) {
144250
144261
  workspace2.documentToolIdleTurns.set(tool, idle + 1);
144251
144262
  continue;
@@ -144256,7 +144267,10 @@ function ageDocumentTools(workspace2) {
144256
144267
  used.clear();
144257
144268
  }
144258
144269
  function publishWorkPlanTools(workspace2, plan) {
144259
- workspace2.agent.setToolPublished(WORK_PLAN_EXTENDED_TOOL, plan !== null);
144270
+ const published = plan !== null;
144271
+ if (!workspace2.agent.setToolPublished(WORK_PLAN_EXTENDED_TOOL, published)) return;
144272
+ if (published) workspace2.documentToolIdleTurns.set(WORK_PLAN_EXTENDED_TOOL, 0);
144273
+ else workspace2.documentToolIdleTurns.delete(WORK_PLAN_EXTENDED_TOOL);
144260
144274
  }
144261
144275
  function queueWorkPlanSessionSync(workspace2, after) {
144262
144276
  const sessionFile = workspace2.agent.snapshot().sessionFile;
@@ -144276,8 +144290,8 @@ function queueWorkPlanSessionSync(workspace2, after) {
144276
144290
  if (!sameSessionFile(workspace2.agent.snapshot().sessionFile, sessionFile)) return;
144277
144291
  workspace2.workPlan = plan;
144278
144292
  workspace2.workPlanSessionFile = sessionFile;
144279
- publishWorkPlanTools(workspace2, plan);
144280
144293
  withholdDocumentTools(workspace2);
144294
+ publishWorkPlanTools(workspace2, plan);
144281
144295
  broadcast(workspace2, { type: "session_replaced", ...snapshot(workspace2) });
144282
144296
  if (inherited) broadcast(workspace2, { type: "work_plan_changed", workPlan: plan });
144283
144297
  announceWorkspaceActivity();
@@ -145251,8 +145265,8 @@ async function ensureStarted(target) {
145251
145265
  refreshExtensionRender(target);
145252
145266
  target.workPlan = await loadWorkPlan(runtime.snapshot().sessionFile);
145253
145267
  target.workPlanSessionFile = runtime.snapshot().sessionFile;
145254
- publishWorkPlanTools(target, target.workPlan);
145255
145268
  withholdDocumentTools(target);
145269
+ publishWorkPlanTools(target, target.workPlan);
145256
145270
  target.lastUsedAt = Date.now();
145257
145271
  void refreshPiPackages(target);
145258
145272
  })();