@mammothb/pi-web 6.0.1 → 6.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mammothb/pi-web",
3
- "version": "6.0.1",
3
+ "version": "6.0.2",
4
4
  "description": "A pi extension that adds WebFetch and WebSearch tools for fetching and searching web content",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -23,7 +23,7 @@
23
23
  "dependencies": {
24
24
  "htmlparser2": "12.0.0",
25
25
  "turndown": "7.2.4",
26
- "@mammothb/pi-shared": "1.4.0"
26
+ "@mammothb/pi-shared": "1.4.1"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/turndown": "5.0.6"
@@ -1,7 +1,7 @@
1
1
  import type { Format, Header } from "./types";
2
2
 
3
3
  export function buildHeaders(format: Format): Header {
4
- let acceptHeader = "*/*";
4
+ let acceptHeader: string;
5
5
  switch (format) {
6
6
  case "markdown":
7
7
  acceptHeader =
@@ -106,18 +106,16 @@ export function runScript(
106
106
  // The wrapper creates shutdown-<pid>.pid, runs the script, then
107
107
  // removes the file. If the file remains on next startup, the
108
108
  // shutdown was unclean.
109
+ // NOSONAR — CLI tool, PATH is user-controlled
109
110
  const child = spawn(
110
111
  "bash",
111
112
  [
112
113
  "-c",
113
- `
114
- PID_FILE="${opts.shutdownPidDir}/shutdown-$$.pid"
115
- echo $$ > "$PID_FILE"
116
- "${script}" ${command}
117
- EXIT=$?
118
- rm -f "$PID_FILE"
119
- exit $EXIT
120
- `,
114
+ 'PID_FILE="$1/shutdown-$$.pid"\necho $$ > "$PID_FILE"\n"$2" "$3"\nEXIT=$?\nrm -f "$PID_FILE"\nexit $EXIT',
115
+ "sh",
116
+ opts.shutdownPidDir,
117
+ script,
118
+ command,
121
119
  ],
122
120
  {
123
121
  stdio: "ignore",
@@ -132,6 +130,7 @@ export function runScript(
132
130
  });
133
131
  } else {
134
132
  const child = spawn("bash", [script, command], {
133
+ // NOSONAR — CLI tool, PATH is user-controlled
135
134
  stdio: "ignore",
136
135
  detached: true,
137
136
  });
@@ -148,6 +147,7 @@ export function runScript(
148
147
  // Default mode: wait for completion, capture output
149
148
  return new Promise((resolve, reject) => {
150
149
  const child = spawn("bash", [script, command], {
150
+ // NOSONAR — CLI tool, PATH is user-controlled
151
151
  stdio: "pipe",
152
152
  });
153
153