@vtstech/pi-react-fallback 1.1.6 → 1.1.8

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/package.json +2 -2
  2. package/react-fallback.js +5 -18
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtstech/pi-react-fallback",
3
- "version": "1.1.6",
3
+ "version": "1.1.8",
4
4
  "description": "ReAct fallback extension for Pi Coding Agent",
5
5
  "main": "react-fallback.js",
6
6
  "keywords": ["pi-extensions"],
@@ -14,7 +14,7 @@
14
14
  "url": "https://github.com/VTSTech/pi-coding-agent"
15
15
  },
16
16
  "dependencies": {
17
- "@vtstech/pi-shared": "1.1.6"
17
+ "@vtstech/pi-shared": "1.1.8"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "@mariozechner/pi-coding-agent": ">=0.66"
package/react-fallback.js CHANGED
@@ -4,17 +4,14 @@ import * as fs from "node:fs";
4
4
  import * as path from "node:path";
5
5
  import { section, ok, fail, warn, info } from "@vtstech/pi-shared/format";
6
6
  import { EXTENSION_VERSION } from "@vtstech/pi-shared/ollama";
7
+ import { debugLog } from "@vtstech/pi-shared/debug";
7
8
  import {
8
9
  sanitizeModelJson,
9
10
  extractToolFromJson,
10
11
  parseReact,
11
- parseReactWithPatterns,
12
12
  detectReactDialect,
13
13
  fuzzyMatchToolName,
14
- normalizeArguments,
15
14
  looksLikeSchemaDump,
16
- REACT_DIALECTS,
17
- ALL_DIALECT_PATTERNS,
18
15
  FINAL_ANSWER_RE
19
16
  } from "@vtstech/pi-shared/react-parser";
20
17
  var REACT_CONFIG_PATH = path.join(os.homedir(), ".pi", "agent", "react-mode.json");
@@ -24,7 +21,8 @@ function readReactConfig() {
24
21
  const raw = JSON.parse(fs.readFileSync(REACT_CONFIG_PATH, "utf-8"));
25
22
  if (typeof raw.enabled === "boolean") return raw;
26
23
  }
27
- } catch {
24
+ } catch (err) {
25
+ debugLog("react-fallback", "failed to read ReAct config", err);
28
26
  }
29
27
  return { enabled: false };
30
28
  }
@@ -204,7 +202,8 @@ ${argsJson}`
204
202
  }
205
203
  }
206
204
  }
207
- } catch {
205
+ } catch (err) {
206
+ debugLog("react-fallback", "failed to extract JSON from parse test input", err);
208
207
  }
209
208
  if (looksLikeSchemaDump(text)) {
210
209
  lines.push(warn("Text appears to be a tool schema dump (not a tool call)"));
@@ -221,18 +220,6 @@ ${argsJson}`
221
220
  });
222
221
  }
223
222
  });
224
- pi._reactParser = {
225
- parseReact,
226
- parseReactWithPatterns,
227
- detectReactDialect,
228
- sanitizeModelJson,
229
- extractToolFromJson,
230
- fuzzyMatchToolName,
231
- normalizeArguments,
232
- looksLikeSchemaDump,
233
- REACT_DIALECTS,
234
- ALL_DIALECT_PATTERNS
235
- };
236
223
  }
237
224
  export {
238
225
  react_fallback_temp_default as default