@vtstech/pi-react-fallback 1.0.9 → 1.1.1

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/README.md CHANGED
@@ -15,9 +15,11 @@ pi install "npm:@vtstech/pi-react-fallback"
15
15
  Automatically loaded — no commands needed. When a model lacks native tool calling:
16
16
 
17
17
  - Parses `Thought:`, `Action:`, `Action Input:` patterns from model output
18
+ - **Multi-dialect support**: classic ReAct (`Action:`), Function (`Function:`), Tool (`Tool:`), Call (`Call:`) — each with dynamically-built regex patterns
18
19
  - Multiple regex strategies including parenthetical style and loose matching
19
20
  - Bridges text-based tool calls into Pi's native tool execution pipeline
20
21
  - Falls back when native tool calls fail
22
+ - Disabled by default; toggle via `/react-mode` with persistent config across restarts
21
23
 
22
24
  ## Links
23
25
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtstech/pi-react-fallback",
3
- "version": "1.0.9",
3
+ "version": "1.1.1",
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.0.9"
17
+ "@vtstech/pi-shared": "1.1.1"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "@mariozechner/pi-coding-agent": ">=0.66"
package/react-fallback.js CHANGED
@@ -3,6 +3,7 @@ import os from "node:os";
3
3
  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
+ import { EXTENSION_VERSION } from "@vtstech/pi-shared/ollama";
6
7
  function sanitizeModelJson(text) {
7
8
  text = text.replace(/:\s*True\b/g, ": true");
8
9
  text = text.replace(/:\s*False\b/g, ": false");
@@ -390,7 +391,7 @@ function react_fallback_temp_default(pi2) {
390
391
  let reactModeEnabled = readReactConfig().enabled;
391
392
  let stats = { bridgeCalls: 0, fuzzyMatches: 0, argNormalizations: 0, parseFailures: 0 };
392
393
  const branding = [
393
- ` \u26A1 Pi ReAct Fallback Extension v1.0.9`,
394
+ ` \u26A1 Pi ReAct Fallback Extension v${EXTENSION_VERSION}`,
394
395
  ` Written by VTSTech`,
395
396
  ` GitHub: https://github.com/VTSTech`,
396
397
  ` Website: www.vts-tech.org`
@@ -562,8 +563,9 @@ ${argsJson}`
562
563
  if (looksLikeSchemaDump(text)) {
563
564
  lines.push(warn("Text appears to be a tool schema dump (not a tool call)"));
564
565
  }
565
- if (FINAL_ANSWER_RE.test(text)) {
566
- const fa = FINAL_ANSWER_RE.exec(text)[1].trim();
566
+ const faMatch = FINAL_ANSWER_RE.exec(text);
567
+ if (faMatch) {
568
+ const fa = faMatch[1].trim();
567
569
  lines.push(ok(`Final Answer: ${fa}`));
568
570
  }
569
571
  pi2.sendMessage({