@withone/cli 2.7.1 → 2.8.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 +2 -1
- package/dist/index.js +26 -3
- package/package.json +1 -1
- package/skills/one/SKILL.md +2 -1
package/README.md
CHANGED
|
@@ -265,10 +265,11 @@ one actions find hubspot "find a contact by email" gmail "send an email" --task
|
|
|
265
265
|
one actions find shopify "list products" -t knowledge
|
|
266
266
|
```
|
|
267
267
|
|
|
268
|
-
- Each **intent** names the operation alone, in a few words (`"send a message to a channel"`), without its data: IDs, names and message text make the search miss. Up to 10 pairs.
|
|
268
|
+
- Each **intent** names the operation alone, in a few words (`"send a message to a channel"`), without its data: IDs, names and message text make the search miss. Up to 10 pairs. Name the platform before every intent, even when they share one (`stripe "list charges" stripe "list refunds"`); a "platform" containing a space is refused as an intent that slipped out of its pair.
|
|
269
269
|
- **`--task`** describes the whole job in one line, in general terms. Agents are asked to send it with every find, since it helps tell similar actions apart.
|
|
270
270
|
- **`-t knowledge`** searches the catalog for writing code and building flows and relays, which includes the platform's own (passthrough) endpoints; the default is the catalog for running actions now.
|
|
271
271
|
- **`--ai-model`** names the model running the CLI (e.g. `claude-sonnet-5`), recorded with the find beside the CLI and the harness that launched it, so the account's usage can report which model asked. Agents are asked to send it with every find.
|
|
272
|
+
- An answer to a find without `--task` or `--ai-model` carries a `hint` field (a dim line for humans) asking for them on the next find. Both stay optional.
|
|
272
273
|
- **`--no-knowledge`** lists the chosen actions (actionId, title, method, path) without fetching their documentation; load it later with `one actions load <actionId>`.
|
|
273
274
|
|
|
274
275
|
Each intent's answer gives the action(s) to use with their docs, any actions also needed beside them, a **substitute** when the model was unsure (use one or the other, never both), and a few alternatives, then says once how to execute. Always read the docs before executing. The access settings from `one config` apply: an action they refuse is never offered.
|
package/dist/index.js
CHANGED
|
@@ -3005,6 +3005,17 @@ var EXECUTE_GUIDE = `Run an action with:
|
|
|
3005
3005
|
Connection keys come from \`one --agent list\`. Put each value where the action's documentation says it goes: path variables (placeholders like {userId}) in --path-vars, query parameters in --query-params, the request body in -d. Never put path variables or query parameters in -d.`;
|
|
3006
3006
|
var FindArgsError = class extends Error {
|
|
3007
3007
|
};
|
|
3008
|
+
function misplacedIntent(requests) {
|
|
3009
|
+
return requests.map((r) => r.platform.trim()).find((platform) => /\s/.test(platform));
|
|
3010
|
+
}
|
|
3011
|
+
function findHint(task, aiModel) {
|
|
3012
|
+
const missing = [
|
|
3013
|
+
task?.trim() ? null : '--task "<the whole job in one line, in general terms, without names, addresses, IDs or message text>"',
|
|
3014
|
+
aiModel?.trim() ? null : '--ai-model "<your model name>"'
|
|
3015
|
+
].filter((m) => m !== null);
|
|
3016
|
+
if (missing.length === 0) return void 0;
|
|
3017
|
+
return `Send ${missing.join(" and ")} with every find: the task helps tell similar actions apart, and both are recorded with the find.`;
|
|
3018
|
+
}
|
|
3008
3019
|
function actionHeading(action) {
|
|
3009
3020
|
return `${action.title} \xB7 \`${action.method.toUpperCase()} ${action.path}\` \xB7 actionId: \`${action.actionId}\``;
|
|
3010
3021
|
}
|
|
@@ -3097,6 +3108,12 @@ async function find(requests, task, deps, settings, { knowledgeCatalog = false,
|
|
|
3097
3108
|
if (empty) {
|
|
3098
3109
|
throw new FindArgsError("Every request needs a platform and an intent.");
|
|
3099
3110
|
}
|
|
3111
|
+
const misplaced = misplacedIntent(requests);
|
|
3112
|
+
if (misplaced) {
|
|
3113
|
+
throw new FindArgsError(
|
|
3114
|
+
`"${misplaced}" looks like an intent, not a platform: the pairs are out of step. Name the platform before every intent, e.g. one actions find stripe "list charges" stripe "list refunds".`
|
|
3115
|
+
);
|
|
3116
|
+
}
|
|
3100
3117
|
const platforms = await reachable(settings, deps);
|
|
3101
3118
|
const reaches = (platform) => platforms === null || platforms.includes(platform.toLowerCase());
|
|
3102
3119
|
const asked = requests.filter((r) => reaches(r.platform));
|
|
@@ -3425,7 +3442,9 @@ async function actionsFindCommand(pairs, options) {
|
|
|
3425
3442
|
error("--type must be execute or knowledge.");
|
|
3426
3443
|
}
|
|
3427
3444
|
if (pairs.length === 0 || pairs.length % 2 !== 0) {
|
|
3428
|
-
error(
|
|
3445
|
+
error(
|
|
3446
|
+
'Pass platform and intent pairs, naming the platform before every intent: one actions find <platform> "<intent>" [<platform> "<intent>" ...], e.g. one actions find stripe "list charges" stripe "list refunds"'
|
|
3447
|
+
);
|
|
3429
3448
|
}
|
|
3430
3449
|
const requests = [];
|
|
3431
3450
|
for (let i = 0; i < pairs.length; i += 2) {
|
|
@@ -3444,13 +3463,16 @@ async function actionsFindCommand(pairs, options) {
|
|
|
3444
3463
|
settings,
|
|
3445
3464
|
{ knowledgeCatalog: options.type === "knowledge", knowledge: options.knowledge !== false }
|
|
3446
3465
|
);
|
|
3466
|
+
const hint = findHint(options.task, options.aiModel);
|
|
3447
3467
|
if (isAgentMode()) {
|
|
3448
|
-
json(result);
|
|
3468
|
+
json(hint ? { ...result, hint } : result);
|
|
3449
3469
|
return;
|
|
3450
3470
|
}
|
|
3451
3471
|
spinner.stop("Found");
|
|
3452
3472
|
console.log();
|
|
3453
3473
|
console.log(renderFind(result));
|
|
3474
|
+
if (hint) console.log(`
|
|
3475
|
+
${pc7.dim(hint)}`);
|
|
3454
3476
|
console.log();
|
|
3455
3477
|
} catch (error2) {
|
|
3456
3478
|
spinner.stop("Find failed");
|
|
@@ -10933,12 +10955,13 @@ Removes a connection by its key. In agent mode, returns \`{"deleted": true, "pla
|
|
|
10933
10955
|
one --agent actions find <platform> "<intent>" [<platform> "<intent>" ...] --task "<the job, in general terms>" --ai-model "<your model>"
|
|
10934
10956
|
\`\`\`
|
|
10935
10957
|
|
|
10936
|
-
One call for the whole task: one platform and intent pair per operation, on any platforms (up to 10). One's decision model picks the action for each and returns it **with its documentation** \u2014 required fields, validation rules, request structure. **Read it before execute.**
|
|
10958
|
+
One call for the whole task: one platform and intent pair per operation, on any platforms (up to 10). Name the platform before **every** intent, even when they share one: \`stripe "list charges" stripe "list refunds"\`. One's decision model picks the action for each and returns it **with its documentation** \u2014 required fields, validation rules, request structure. **Read it before execute.**
|
|
10937
10959
|
|
|
10938
10960
|
- **\`intent\` names the operation alone**, in a few words: \`"send a message to a channel"\`, not \`"post 'deploy done' in #eng"\`. IDs, names, and message text in the intent make the search miss.
|
|
10939
10961
|
- **\`--task\`**: send it with every find. It is the whole job in one line, **in general terms**: what it does, without names, addresses, IDs, or message text. It helps tell similar actions apart.
|
|
10940
10962
|
- **\`-t knowledge\`** searches the catalog for writing code and building flows and relays, which includes the platform's own (passthrough) endpoints; the default, \`-t execute\`, is the catalog for running actions now. Knowledge-only mode always uses \`knowledge\`.
|
|
10941
10963
|
- **\`--ai-model\`**: send it with every find. Your model name as you know it (e.g. \`claude-sonnet-5\`), recorded with the find; leave it out only if you do not know which model you are.
|
|
10964
|
+
- A find answer sent without either carries a **\`hint\`** naming what was missing: add it on your next find.
|
|
10942
10965
|
- **\`--no-knowledge\`** (optional) lists the chosen actions without their documentation, when only the actionIds are needed. Load the documentation with \`actions load\` before executing.
|
|
10943
10966
|
|
|
10944
10967
|
In \`--agent\` mode:
|
package/package.json
CHANGED
package/skills/one/SKILL.md
CHANGED
|
@@ -79,12 +79,13 @@ Removes a connection. Returns `{"deleted": true, "platform": "...", "key": "..."
|
|
|
79
79
|
one --agent actions find <platform> "<intent>" [<platform> "<intent>" ...] --task "<the job, in general terms>" --ai-model "<your model>"
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
**One call for the whole task**: one platform and intent pair per operation, on any platforms (up to 10). One's decision model picks the action for each and returns it **with its documentation**: exactly what parameters are required, how to structure the request, and where each value goes. Never execute without reading it — without it you'll guess wrong on parameters.
|
|
82
|
+
**One call for the whole task**: one platform and intent pair per operation, on any platforms (up to 10). Name the platform before **every** intent, even when they share one: `stripe "list charges" stripe "list refunds"`. One's decision model picks the action for each and returns it **with its documentation**: exactly what parameters are required, how to structure the request, and where each value goes. Never execute without reading it — without it you'll guess wrong on parameters.
|
|
83
83
|
|
|
84
84
|
- **`intent` names the operation alone**, in a few words: `"send a message to a channel"`, not `"post 'deploy done' in #eng"`. IDs, names, and message text in the intent make the search miss.
|
|
85
85
|
- **`--task`**: send it with every find. It is the whole job in one line, **in general terms**: `"email a weather report to a contact"`, without names, addresses, IDs, or message text. It helps tell similar actions apart.
|
|
86
86
|
- **`-t knowledge`** searches the catalog for writing code and building flows and relays (it includes the platform's own passthrough endpoints); the default, `-t execute`, is the catalog for running actions now.
|
|
87
87
|
- **`--ai-model`**: send it with every find. Your model name as you know it (e.g. `claude-sonnet-5`), recorded with the find; leave it out only if you do not know which model you are.
|
|
88
|
+
- A find answer sent without either carries a **`hint`** naming what was missing: add it on your next find.
|
|
88
89
|
- **`--no-knowledge`** (optional): list the chosen actions without their documentation, when you only need the actionIds. Load the documentation with `actions load` before executing.
|
|
89
90
|
- Platform names are lowercase; multi-word names use dashes: `gmail`, `hubspot`, `ship-station`, `google-calendar`.
|
|
90
91
|
|