Skip to content

Commit 6b9cb42

Browse files
committed
fixed: gpt-oss fail schema of list, resolve - fail soft, rf take into account whitespaces
1 parent 5f3087e commit 6b9cb42

4 files changed

Lines changed: 13 additions & 4 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tune-basic-toolset",
3-
"version": "0.1.5",
3+
"version": "0.1.6",
44
"description": "Basic toolset for tune",
55
"main": "src/index.js",
66
"files": [

src/list.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"properties": {
77
"text": {
88
"type": "string",
9-
"description": "lines in format 'status - item', they'll be used to update list or to insert to the list, to delete item change its status to deleted or cancelled\nThe lines should contain only those items that needs to be changed - inserted/updated/deleted"
9+
"description": "text where each line is in format 'status - item', they'll be used to update list or to insert to the list, to delete item change its status to deleted or cancelled\nThe lines should contain only those items that needs to be changed - inserted/updated/deleted"
1010
},
1111
"filename": {
1212
"type": "string",

src/resolve.proc.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,11 @@ module.exports = async function resolve(node, args, ctx) {
66
throw Error(`can resolve only text nodes, got ${node.type}`)
77
}
88
const filename = await node.read()
9-
return ctx.resolve(filename.trim())
9+
const result = await ctx.resolve(filename.trim())
10+
if (result) return result
11+
12+
return {
13+
type: "text",
14+
read: async () => args || "Not found"
15+
}
1016
}

src/rf.tool.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,8 @@ module.exports = async function readFile({ filename, linenum }, ctx) {
1616
if (pathArr.length > 1) {
1717
return`@{ ${pathArr.join(" | ")} }`;
1818
}
19+
if (relFile.match(/\s+/)) {
20+
return `@{${relFile}}`;
21+
}
1922
return `@${relFile}`;
20-
};
23+
};

0 commit comments

Comments
 (0)