@agentrq/agentrq-ws 0.9.8 → 0.9.9
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 +1 -1
- package/package.json +1 -1
- package/src/commands.js +23 -10
package/README.md
CHANGED
|
@@ -58,7 +58,7 @@ Node 20.6 or newer.
|
|
|
58
58
|
| `skill delete <uri>` | Delete a skill (`skill://<name>`) or one of its files |
|
|
59
59
|
| `event publish <name>` | Publish a named event |
|
|
60
60
|
| `ask <taskId> <message>` | Ask the human a question and wait |
|
|
61
|
-
| `site-tools` | List the websites shared with this workspace from the Chrome extension, and their tools' names and descriptions |
|
|
61
|
+
| `site-tools [q]` | List the websites shared with this workspace from the Chrome extension, and their tools' names and descriptions; `q` ranks the tools, `--pattern` filters them by a regular expression, `--limit`/`--offset` page |
|
|
62
62
|
| `site-tool <site> <tool>` | Show one shared website's tool in full, with its input schema |
|
|
63
63
|
| `call-site-tool <site> <tool> --task <taskId>` | Run a shared website's tool in the human's Chrome, with `--args '{…}'` |
|
|
64
64
|
| `tools` | List the tools this workspace server offers |
|
package/package.json
CHANGED
package/src/commands.js
CHANGED
|
@@ -92,6 +92,17 @@ function requirePositional(positionals, index, name) {
|
|
|
92
92
|
return value
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
/** Adds --limit and --offset to a search's arguments, as whole numbers. */
|
|
96
|
+
function withPaging(ctx, args) {
|
|
97
|
+
for (const key of ['limit', 'offset']) {
|
|
98
|
+
if (ctx.values[key] === undefined) continue
|
|
99
|
+
const n = Number(ctx.values[key])
|
|
100
|
+
if (!Number.isInteger(n) || n < 0) throw new UserError(`--${key} must be a whole number, 0 or more`)
|
|
101
|
+
args[key] = n
|
|
102
|
+
}
|
|
103
|
+
return args
|
|
104
|
+
}
|
|
105
|
+
|
|
95
106
|
/**
|
|
96
107
|
* `getAttachment` answers with the attachment's name and type, and its public
|
|
97
108
|
* link — the default — or, for one saved before attachments had links, its
|
|
@@ -286,13 +297,7 @@ export const COMMANDS = [
|
|
|
286
297
|
async run(ctx) {
|
|
287
298
|
const args = {}
|
|
288
299
|
if (ctx.positionals.length) args.q = ctx.positionals.join(' ')
|
|
289
|
-
|
|
290
|
-
if (ctx.values[key] === undefined) continue
|
|
291
|
-
const n = Number(ctx.values[key])
|
|
292
|
-
if (!Number.isInteger(n) || n < 0) throw new UserError(`--${key} must be a whole number, 0 or more`)
|
|
293
|
-
args[key] = n
|
|
294
|
-
}
|
|
295
|
-
return ctx.client.callTool('searchSkills', args)
|
|
300
|
+
return ctx.client.callTool('searchSkills', withPaging(ctx, args))
|
|
296
301
|
},
|
|
297
302
|
},
|
|
298
303
|
{
|
|
@@ -387,10 +392,18 @@ export const COMMANDS = [
|
|
|
387
392
|
},
|
|
388
393
|
{
|
|
389
394
|
path: ['site-tools'],
|
|
390
|
-
summary: 'List the websites shared with this workspace and their tools',
|
|
391
|
-
usage: 'agentrq-ws site-tools',
|
|
395
|
+
summary: 'List the websites shared with this workspace and their tools, ranked by q or filtered by a pattern',
|
|
396
|
+
usage: 'agentrq-ws site-tools [q] [--pattern REGEX] [--limit N] [--offset N]',
|
|
397
|
+
options: {
|
|
398
|
+
pattern: { type: 'string', description: "A regular expression a tool's name or description must match" },
|
|
399
|
+
limit: { type: 'string', description: 'How many tools to return (at most 100; default all)' },
|
|
400
|
+
offset: { type: 'string', description: 'How many matches to skip' },
|
|
401
|
+
},
|
|
392
402
|
async run(ctx) {
|
|
393
|
-
|
|
403
|
+
const args = {}
|
|
404
|
+
if (ctx.positionals.length) args.q = ctx.positionals.join(' ')
|
|
405
|
+
if (ctx.values.pattern !== undefined) args.pattern = ctx.values.pattern
|
|
406
|
+
return ctx.client.callTool('listSiteTools', withPaging(ctx, args))
|
|
394
407
|
},
|
|
395
408
|
},
|
|
396
409
|
{
|