sapper-iq 1.1.21 → 1.1.23
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 +1 -1
- package/sapper.mjs +5 -3
package/package.json
CHANGED
package/sapper.mjs
CHANGED
|
@@ -435,7 +435,9 @@ const tools = {
|
|
|
435
435
|
},
|
|
436
436
|
list: (path) => {
|
|
437
437
|
try {
|
|
438
|
-
|
|
438
|
+
let dir = path.trim() || '.';
|
|
439
|
+
// If AI sends "/" (root), treat as current directory "."
|
|
440
|
+
if (dir === '/') dir = '.';
|
|
439
441
|
const entries = fs.readdirSync(dir);
|
|
440
442
|
// Filter out ignored directories
|
|
441
443
|
const filtered = entries.filter(entry => {
|
|
@@ -812,8 +814,8 @@ async function runSapper() {
|
|
|
812
814
|
|
|
813
815
|
messages.push({ role: 'assistant', content: msg });
|
|
814
816
|
|
|
815
|
-
// Fixed regex: [^\]]
|
|
816
|
-
const toolMatches = [...msg.matchAll(/\[TOOL:(\w+)\]([^\]]
|
|
817
|
+
// Fixed regex: [^\]]* allows empty path (AI sometimes sends [TOOL:LIST][/TOOL])
|
|
818
|
+
const toolMatches = [...msg.matchAll(/\[TOOL:(\w+)\]([^\]]*)(?:\]([\s\S]*?))?\[\/TOOL\]/g)];
|
|
817
819
|
|
|
818
820
|
// Debug mode: show what regex sees
|
|
819
821
|
if (debugMode) {
|