@skydiveai/pi-extensions 0.1.0-beta.93 → 0.1.0-beta.95

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.
Files changed (2) hide show
  1. package/dist/index.mjs +6 -2
  2. package/package.json +2 -1
package/dist/index.mjs CHANGED
@@ -21,6 +21,7 @@ import { BatchSpanProcessor, NodeTracerProvider } from "@opentelemetry/sdk-trace
21
21
  import { ATTR_SERVICE_NAME } from "@opentelemetry/semantic-conventions";
22
22
  import { hc } from "hono/client";
23
23
  import { parse } from "yaml";
24
+ import { quote } from "shell-quote";
24
25
  import { createWriteStream } from "node:fs";
25
26
  import { finished } from "node:stream/promises";
26
27
  import { createLocalBashOperations } from "@earendil-works/pi-coding-agent";
@@ -2891,10 +2892,13 @@ function createSubagentExtension({ channelContext }) {
2891
2892
  //#endregion
2892
2893
  //#region src/extensions/tool-call-env.ts
2893
2894
  const TOOL_CALL_ID_VAR = "TOOL_CALL_ID";
2895
+ function shellQuoteValue(value) {
2896
+ return quote([value]);
2897
+ }
2894
2898
  function withToolCallId({ command, toolCallId }) {
2895
- return `export ${TOOL_CALL_ID_VAR}=${toolCallId}; ${command}`;
2899
+ return `export ${TOOL_CALL_ID_VAR}=${shellQuoteValue(toolCallId)}; ${command}`;
2896
2900
  }
2897
- const PLATFORM_EXPORT = new RegExp(`^\\s*export\\s+(?:${TOOL_CALL_ID_VAR}|ANYONE_\\w+|SKYDIVE_\\w+)=(?:"(?:\\\\.|[^"])*"|'[^']*'|[^;\\s]*)\\s*;\\s*`);
2901
+ const PLATFORM_EXPORT = new RegExp(`^\\s*export\\s+(?:${TOOL_CALL_ID_VAR}|ANYONE_\\w+|SKYDIVE_\\w+)=(?:"(?:\\\\.|[^"])*"|'(?:'\\\\''|[^'])*'|[^;\\s]*)\\s*;\\s*`);
2898
2902
  function stripPlatformExportsForDisplay(command) {
2899
2903
  let c = command;
2900
2904
  let m;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skydiveai/pi-extensions",
3
- "version": "0.1.0-beta.93",
3
+ "version": "0.1.0-beta.95",
4
4
  "homepage": "https://skydive.com",
5
5
  "license": "MIT",
6
6
  "author": "Create, Inc.",
@@ -45,6 +45,7 @@
45
45
  "@skydiveai/pi-server": "^0.1.0",
46
46
  "hono": "^4.6.14",
47
47
  "pino": "^9.6.0",
48
+ "shell-quote": "^1.8.4",
48
49
  "typebox": "^1.1.34",
49
50
  "yaml": "^2.8.3",
50
51
  "zod": "^3.25.0"