pi-fabric 0.132.5 → 0.132.7

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.
@@ -1782,13 +1782,17 @@ var FabricDirectToolApproval = class {
1782
1782
  };
1783
1783
 
1784
1784
  // src/core/execution-guidelines.ts
1785
+ var schemaDiscipline = "Form a falsifiable hypothesis covering the reported failure and affected paths. Let contrary evidence invalidate the plan. Verify postconditions before declaring success.";
1786
+ var taskDiscipline = "Be ambitious and persistent: work through uncertainty, try alternatives, and verify the result. Treat new requests as additive, not replacements; keep existing work progressing unless explicitly reprioritized.";
1785
1787
  var fabricExecutionGuidelines = (kernel = "typescript", pythonRuntime = "monty", managedHost = false) => managedHost ? [
1786
- "Batch independent operations with bounded concurrency, keep dependent calls ordered, inspect results, and return compact evidence."
1788
+ "Batch independent operations with bounded concurrency, keep dependent calls ordered, inspect results, and return compact evidence.",
1789
+ schemaDiscipline,
1790
+ taskDiscipline
1787
1791
  ] : [
1788
- kernel === "python" ? "Batch independent operations in one `fabric_exec` Python program with `asyncio.gather`; await dependent/conditional steps sequentially. Coalesce independent replacements into one `await pi.edit(path=..., edits=[...])`. Return only the compact final JSON-compatible value." : "Batch independent operations in one `fabric_exec` program (`Promise.all` for parallel, sequential `await` for ordered), not one call per tool; keep dependent/conditional steps sequential. Coalesce non-dependent replacements from one file snapshot into one `pi.edit({path, edits:[...]})`; use `all:true` only for intentional repeated exact anchors. Return only the compact final value; intermediate results stay in the sandbox.",
1792
+ kernel === "python" ? "Batch independent I/O in one `fabric_exec` Python program with `asyncio.gather`; await dependent steps sequentially. Coalesce independent replacements into one `await pi.edit(path=..., edits=[...])`. Inspect findings before choosing dependent reads or edits. Background long-running work when independent tasks can proceed; collect its result before completion. Return JSON-compatible evidence." : "Batch independent I/O in one `fabric_exec` program (`Promise.all` for parallel, sequential `await` for ordered). Coalesce independent replacements from one file snapshot into one `pi.edit({path, edits:[...]})`; use `all:true` only for intentional repeated exact anchors. Inspect findings before choosing dependent reads or edits. Background long-running work when independent tasks can proceed; collect its result before completion.",
1789
1793
  kernel === "python" ? "Search before reading with `await pi.grep(pattern=..., path=...)` or `await pi.find(pattern=..., path=...)`, then `await pi.read(path=..., offset=..., limit=...)`. Use Python dict syntax, `True`/`False`/`None`, and bounded searches; unbounded reads cap at 2000 lines or 50KB. Read continuation notices when needed." : "Search before reading: use `pi.grep`/`pi.find` to locate relevant lines, then `pi.read({path, offset, limit})` that range. Escape regex metacharacters, or use `literal:true` for exact punctuated text. Keep fan-out search limits small and widen only on misses. An unbounded `pi.read` returns at most 2000 lines or 50KB and, when truncated, ends with a `Use offset=\u2026` continuation notice; reserve whole-file reads for small files you will use in full.",
1790
- "Keep the acceptance ledger in reasoning or concise progress notes (no tool call): define concrete checks, trace execution before editing, implement end to end, then run targeted tests and direct behavioral probes. Confirm requested public symbols, registrations, and configuration entries. Use the smallest checks that cover the ledger; escalate only for failures or cross-cutting risk. Inspect failures and iterate instead of rerunning unchanged passing checks. A build alone is not completion.",
1791
- kernel === "python" ? "For test/probe nonzero exits, use `await pi.bash(command=..., settle=True)` and inspect the returned dict: `r['ok']`, `r['output']`, and `r.get('exitCode')`. Set shell `timeout` in seconds once for long suites. Return decisions and evidence rather than raw logs." : "Amortize round trips without inflating context: batch only independent, bounded work. Keep search\u2192read and edit\u2192verify sequential when an output determines the next action. Use `settle:true` for tests or probes whose nonzero result is evidence rather than an exceptional stop; for a known long suite, set `pi.bash` `timeout` in seconds once instead of retrying a timed-out call. Filter or summarize noisy command output inside the program and return decisions, failures, and evidence\u2014not raw logs or unused intermediate results.",
1794
+ schemaDiscipline,
1795
+ taskDiscipline,
1792
1796
  "For edits/writes, pass named payloads through top-level `payloads`; each `\u03C0.key` must exactly match a key there; prefer `pi.edit`/`pi.write`. `pi.bash`: no stdin.",
1793
1797
  "Use `display.name` and objective `display.description`; Fabric pairs them with verified outcomes in deterministic compaction.",
1794
1798
  ...kernel === "python" && pythonRuntime === "monty" ? ["Monty requires acyclic JSON host arguments. For underscore-prefixed provider/tool names, use `await tools.call(ref=..., args={...})`, not direct attributes. Use `payloads['key']` for private/non-identifier payload keys."] : []
@@ -4338,13 +4342,14 @@ var widgetViewport = (contentRows, budget, offset) => {
4338
4342
  };
4339
4343
  var HEADER_ROW = "\0main";
4340
4344
  var FabricWidget = class {
4341
- constructor(theme, snapshot, maxRows, terminalRows, retention = new FabricWidgetRetention(), interaction) {
4345
+ constructor(theme, snapshot, maxRows, terminalRows, retention = new FabricWidgetRetention(), interaction, viewport = { offset: 0 }) {
4342
4346
  this.theme = theme;
4343
4347
  this.snapshot = snapshot;
4344
4348
  this.maxRows = maxRows;
4345
4349
  this.terminalRows = terminalRows;
4346
4350
  this.retention = retention;
4347
4351
  this.interaction = interaction;
4352
+ this.viewport = viewport;
4348
4353
  }
4349
4354
  /** Set by the TUI when the widget gains or loses keyboard focus. */
4350
4355
  focused = false;
@@ -4356,7 +4361,12 @@ var FabricWidget = class {
4356
4361
  /** Rows above the header in the last render: the spacer, or none on a one-row budget. */
4357
4362
  #spacerRows = 1;
4358
4363
  #renderedInteraction;
4359
- #scrollOffset = 0;
4364
+ get #scrollOffset() {
4365
+ return this.viewport.offset;
4366
+ }
4367
+ set #scrollOffset(offset) {
4368
+ this.viewport.offset = offset;
4369
+ }
4360
4370
  #maxScrollOffset = 0;
4361
4371
  #followSelection = false;
4362
4372
  /** Select the row on screen, or the first row; used when focus arrives from the keyboard. */
@@ -4919,6 +4929,7 @@ var FabricUiController = class {
4919
4929
  #snapshotCache = new FabricDashboardSnapshotCache();
4920
4930
  #refreshGeneration = 0;
4921
4931
  #widgetRetention = new FabricWidgetRetention();
4932
+ #widgetViewport = { offset: 0 };
4922
4933
  start(context) {
4923
4934
  this.stop();
4924
4935
  this.#context = context;
@@ -4980,6 +4991,7 @@ var FabricUiController = class {
4980
4991
  this.#meshOffset = 0;
4981
4992
  this.#snapshot = emptySnapshot();
4982
4993
  this.#widgetRetention.clear();
4994
+ this.#widgetViewport.offset = 0;
4983
4995
  this.#lastRefreshErrorAt = 0;
4984
4996
  this.#lastRefreshAt = 0;
4985
4997
  this.#dashboardOpen = false;
@@ -5248,7 +5260,8 @@ var FabricUiController = class {
5248
5260
  this.state.config.ui.maxRows,
5249
5261
  () => tui.terminal?.rows ?? process.stdout.rows,
5250
5262
  this.#widgetRetention,
5251
- interaction
5263
+ interaction,
5264
+ this.#widgetViewport
5252
5265
  ),
5253
5266
  onTargetChange: (id) => {
5254
5267
  if (this.#activeConversationReader !== id) this.#suspendConversationReader();
@@ -5708,7 +5721,8 @@ var FabricUiController = class {
5708
5721
  requestRender: () => tui.requestRender(),
5709
5722
  rendered: () => this.#keepWidgetLast(context),
5710
5723
  availableRows: (width) => this.#footerDock?.availableRows(width)
5711
- }
5724
+ },
5725
+ this.#widgetViewport
5712
5726
  );
5713
5727
  const widget = this.#widget;
5714
5728
  const anchor = {
@@ -7039,4 +7053,4 @@ export {
7039
7053
  FABRIC_MANAGED_HOST_VERSION,
7040
7054
  createFabricExtension
7041
7055
  };
7042
- //# sourceMappingURL=chunk-4YQGGJMH.js.map
7056
+ //# sourceMappingURL=chunk-3DNDYLTA.js.map