tune-basic-toolset 0.1.10 → 0.1.11
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 +36 -0
- package/package.json +1 -1
- package/src/grep.schema.json +25 -0
- package/src/grep.tool.js +16 -0
- package/src/patch.tool.js +3 -1
- package/src/proc.proc.js +1 -3
- package/src/websearch.schema.json +23 -0
- package/src/websearch.tool.chat +3 -0
package/README.md
CHANGED
|
@@ -13,8 +13,10 @@ Basic toolset for [Tune](https://github.com/iovdin/tune).
|
|
|
13
13
|
- [sh](#sh) execute shell command
|
|
14
14
|
- [cmd](#cmd) execute Windows cmd command
|
|
15
15
|
- [powershell](#powershell) execute PowerShell command
|
|
16
|
+
- [grep](#grep) search for patterns in text or files
|
|
16
17
|
- [osa](#osa) manage reminders/notes/calendar (AppleScript/macOS)
|
|
17
18
|
- [jina_r](#jina_r) fetch webpage content
|
|
19
|
+
- [websearch](#websearch) search the web with web-enabled llms
|
|
18
20
|
- [list](#list) keep list of tasks todo (loops for LLM)
|
|
19
21
|
- [sqlite](#sqlite) execute sqlite queries
|
|
20
22
|
- [py](#py) run python code
|
|
@@ -175,6 +177,22 @@ TotalPhysicalMemory : 17179869184
|
|
|
175
177
|
CsProcessors : {Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz}
|
|
176
178
|
```
|
|
177
179
|
|
|
180
|
+
### `grep`
|
|
181
|
+
Search for patterns in text or files using regular expressions
|
|
182
|
+
```chat
|
|
183
|
+
user: @grep
|
|
184
|
+
find all lines containing "TODO" in myfile.js
|
|
185
|
+
tool_call: grep {"filename":"myfile.js","regex":"TODO"}
|
|
186
|
+
tool_result:
|
|
187
|
+
// TODO: refactor this function
|
|
188
|
+
// TODO: add error handling
|
|
189
|
+
|
|
190
|
+
system:
|
|
191
|
+
TODOS:
|
|
192
|
+
@{ myfile.js | proc grep regex=TODO }
|
|
193
|
+
|
|
194
|
+
```
|
|
195
|
+
|
|
178
196
|
### `osa`
|
|
179
197
|
AppleScript tool, manage reminders, notes, calendar etc on osx
|
|
180
198
|
```chat
|
|
@@ -219,7 +237,25 @@ Tune is a versatile toolkit designed for developers and users to effectively int
|
|
|
219
237
|
<cut for brevity>
|
|
220
238
|
```
|
|
221
239
|
|
|
240
|
+
### `websearch`
|
|
241
|
+
Search the web with web enabled llms
|
|
242
|
+
Supports search with `perplexity/sonar`, `perplexity/sonar-pro`, `gpt-4o-search-preview`, `gpt-4o-mini-search-preview` models via the `model` parameter (defaults to `perplexity/sonar`).
|
|
243
|
+
|
|
244
|
+
```chat
|
|
245
|
+
user: @websearch
|
|
246
|
+
latest ai news
|
|
247
|
+
|
|
248
|
+
assistant:
|
|
249
|
+
|
|
250
|
+
tool_call: websearch {"model":"perplexity/sonar"}
|
|
251
|
+
latest AI news
|
|
252
|
+
tool_result:
|
|
253
|
+
The latest AI news in October 2025 highlights significant investments, new projects, policy developments, and advances across various sectors:
|
|
254
|
+
|
|
255
|
+
- Major companies including Microsoft, Google, Nvidia, OpenAI, Salesforce, and CoreWeave have pledged over £31 billion in capital expenditure focused on AI data centers and infrastructure upgrades[1].
|
|
256
|
+
```
|
|
222
257
|
|
|
258
|
+
The websearch tool provides up-to-date information by querying the web through AI-powered search models. You can specify different Perplexity models like `perplexity/sonar-pro` for more advanced searches.
|
|
223
259
|
|
|
224
260
|
### `list`
|
|
225
261
|
Keep list of tasks to do
|
package/package.json
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "filter lines with regex",
|
|
3
|
+
"parameters": {
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"text": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"description": "Text to be filtered"
|
|
9
|
+
},
|
|
10
|
+
"filename": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"description": "if text is not set, filename will be read and filtered"
|
|
13
|
+
},
|
|
14
|
+
"regex": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "js regex to filter lines in file or text. passed as first arguments to new RegExp "
|
|
17
|
+
},
|
|
18
|
+
"regex_flags": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"description": "flags to be passed to new RegExp constructor"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"required": ["regex"]
|
|
24
|
+
}
|
|
25
|
+
}
|
package/src/grep.tool.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module.exports = async function grep({filename, text, regex, regex_flags}, ctx) {
|
|
2
|
+
if (!text && filename) {
|
|
3
|
+
const n = await ctx.resolve(filename)
|
|
4
|
+
if (!n)
|
|
5
|
+
return `${filename} not found`
|
|
6
|
+
|
|
7
|
+
text = await n.read()
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
if (!text) {
|
|
11
|
+
return "content is empty"
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const r = new RegExp(regex, regex_flags)
|
|
15
|
+
return text.split(/\r?\n/).filter(line => r.test(line)).join("\n").replaceAll("@", "\\@")
|
|
16
|
+
}
|
package/src/patch.tool.js
CHANGED
|
@@ -5,7 +5,9 @@ const fs = require('fs').promises;
|
|
|
5
5
|
|
|
6
6
|
module.exports = async function patch({ text, filename }, ctx) {
|
|
7
7
|
// Regex to match each patch block
|
|
8
|
-
|
|
8
|
+
// Be lenient about the number of conflict marker characters because some
|
|
9
|
+
// environments may trim one or more > or < characters.
|
|
10
|
+
const patchRegex = /<{6,}\s*ORIGINAL[^\n]*\n([\s\S]*?)=+\n([\s\S]*?)>{6,}\s*UPDATED[^\n]*(?:\n|$)/g;
|
|
9
11
|
const patches = [];
|
|
10
12
|
let match;
|
|
11
13
|
|
package/src/proc.proc.js
CHANGED
|
@@ -14,8 +14,6 @@ module.exports = async function proc(node, args, ctx) {
|
|
|
14
14
|
|
|
15
15
|
const tool = await ctx.resolve(toolName, { "type": "tool" })
|
|
16
16
|
|
|
17
|
-
console.log(params)
|
|
18
|
-
|
|
19
17
|
if (!tool || tool.type !== "tool") {
|
|
20
18
|
throw Error(`tool '${toolName}' not found`)
|
|
21
19
|
}
|
|
@@ -46,7 +44,7 @@ function parseCommandLine(input) {
|
|
|
46
44
|
// 1) Parse leading alphanumeric command
|
|
47
45
|
skipWS();
|
|
48
46
|
const cmdStart = i;
|
|
49
|
-
while (i < len && /[A-Za-z0-
|
|
47
|
+
while (i < len && /[A-Za-z0-9_\-]/.test(s[i])) i++;
|
|
50
48
|
const command = s.slice(cmdStart, i);
|
|
51
49
|
if (!command) return [null, {}];
|
|
52
50
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Does a websearch using llm",
|
|
3
|
+
"parameters": {
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"text": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"description": "web search query"
|
|
9
|
+
},
|
|
10
|
+
"model": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"enum": [
|
|
13
|
+
"perplexity/sonar",
|
|
14
|
+
"perplexity/sonar-pro",
|
|
15
|
+
"gpt-4o-search-preview",
|
|
16
|
+
"gpt-4o-mini-search-preview"
|
|
17
|
+
],
|
|
18
|
+
"description": "model to do websearch, default is perplexity/sonar"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"required": ["text"]
|
|
22
|
+
}
|
|
23
|
+
}
|