@skydiveai/pi-extensions 0.1.0-beta.2642 → 0.1.0-beta.2654

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { A2AOptions, Middleware, ProtocolsOptions } from "@skydiveai/pi-server";
2
+ import { ExtensionFactory } from "@earendil-works/pi-coding-agent";
2
3
  import { Type } from "typebox";
3
4
  import { Client } from "@modelcontextprotocol/sdk/client/index.js";
4
- import { ExtensionFactory } from "@earendil-works/pi-coding-agent";
5
5
  import { Logger } from "pino";
6
6
 
7
7
  //#region src/harness.d.ts
package/dist/index.mjs CHANGED
@@ -5,6 +5,7 @@ import { buildAgentCard, chainMiddleware, composeHandlers, createAgentExecutor,
5
5
  import { mkdir, open, readFile, readdir, stat, unlink, writeFile } from "node:fs/promises";
6
6
  import { basename, dirname, join, relative, resolve } from "node:path";
7
7
  import { pathToFileURL } from "node:url";
8
+ import { createEditToolDefinition, createLocalBashOperations } from "@earendil-works/pi-coding-agent";
8
9
  import { z } from "zod";
9
10
  import { CallToolResultSchema } from "@modelcontextprotocol/sdk/types.js";
10
11
  import { Type } from "typebox";
@@ -29,7 +30,6 @@ import { quote } from "shell-quote";
29
30
  import { createHash } from "node:crypto";
30
31
  import { createWriteStream } from "node:fs";
31
32
  import { finished } from "node:stream/promises";
32
- import { createLocalBashOperations } from "@earendil-works/pi-coding-agent";
33
33
  //#region src/platform-env-middleware.ts
34
34
  const ENVD_TOKEN_HEADER = "x-e2b-envd-token";
35
35
  const ENVD_URL = "http://localhost:49983/envs";
@@ -459,6 +459,13 @@ function withoutInjectedSummary(args) {
459
459
  *
460
460
  * Fails open, like the rest of this module: if the strip throws, the original
461
461
  * arguments are used rather than failing the call.
462
+ *
463
+ * The type constraint names only the fields this wrapper reads, rather than
464
+ * `ToolDefinition` itself: a concretely-typed definition (e.g. the built-in
465
+ * edit tool's `ToolDefinition<typeof editSchema, EditToolDetails, ...>`) is
466
+ * not assignable to the default `ToolDefinition<TSchema, unknown, any>`
467
+ * because of the render hooks' parameter variance, and this wrapper never
468
+ * touches those hooks anyway.
462
469
  */
463
470
  function withSummaryStrippedBeforeValidation(tool) {
464
471
  if (schemaDeclaresSummary(tool.parameters)) return tool;
@@ -526,6 +533,19 @@ const toolCallSummaryExtension = (pi) => {
526
533
  pi.on("tool_call", (event) => {
527
534
  stripInjectedSummary(pi, event.toolName, event.input);
528
535
  });
536
+ let editOverrideRegistered = false;
537
+ pi.on("session_start", (_event, ctx) => {
538
+ if (editOverrideRegistered) return;
539
+ try {
540
+ pi.registerTool(withSummaryStrippedBeforeValidation(createEditToolDefinition(ctx.cwd)));
541
+ editOverrideRegistered = true;
542
+ } catch (err) {
543
+ log$15.error({
544
+ err,
545
+ event: "tool_call_summary_edit_override_failed"
546
+ }, "failed to register summary-tolerant edit tool; built-in remains active");
547
+ }
548
+ });
529
549
  };
530
550
  //#endregion
531
551
  //#region src/extensions/local-tools.ts
@@ -4219,7 +4239,7 @@ const TaskItem = Type.Object({
4219
4239
  persona: Type.Optional(Type.String({ description: "Optional extra system prompt / role for this task, applied ON TOP of the child run's own default persona (your full identity and soul are still there underneath). Omit to run with just your default persona." })),
4220
4240
  model: Type.Optional(Type.String({ description: "Optional model id to run this subagent on. PREFER A LOWER-COST, FASTER MODEL when the task is well-scoped and does not need your full reasoning depth — most delegated subtasks (searching, summarizing, mechanical edits, gathering or reformatting data, running a check) run just as well on a lighter model and cost far less. Reserve a top-tier model for subtasks that genuinely need deep reasoning or careful judgment. Must be a real catalogued model id. Omit to inherit your own model. If you are locked to a Google-compliant model, only compliant models are accepted." })),
4221
4241
  timeoutMinutes: Type.Optional(Type.Integer({
4222
- description: "Optional wall-clock timeout for this subagent, in minutes. If the run is still going after this long it is ended and you are rewoken with a timeout result, so a hung subagent can never strand you. Omit for the default (30 minutes). Raise it for genuinely long work (a big migration, a large audit); lower it for a quick lookup. Range 1-360.",
4242
+ description: "Optional wall-clock timeout for this subagent, in minutes. If the run is still going after this long it is ended and you are rewoken with a timeout result, so a hung subagent can never strand you. Omit for the default (30 minutes). Set a shorter timeout only when the task has a strict runtime bound; open-ended work should use the default or longer. Range 1-360.",
4223
4243
  minimum: 1,
4224
4244
  maximum: 360
4225
4245
  }))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skydiveai/pi-extensions",
3
- "version": "0.1.0-beta.2642",
3
+ "version": "0.1.0-beta.2654",
4
4
  "homepage": "https://skydive.com",
5
5
  "license": "MIT",
6
6
  "author": "Create, Inc.",