@withone/cli 2.6.0 → 2.7.0
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
CHANGED
|
@@ -268,7 +268,7 @@ one actions find shopify "list products" -t knowledge
|
|
|
268
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.
|
|
269
269
|
- **`--task`** describes the whole job in one line, in general terms, which helps choose between similar actions.
|
|
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
|
-
- **`--ai-model`** names the model running the CLI (e.g. `claude-sonnet-5`),
|
|
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.
|
|
272
272
|
- **`--no-knowledge`** lists the chosen actions (actionId, title, method, path) without fetching their documentation; load it later with `one actions load <actionId>`.
|
|
273
273
|
|
|
274
274
|
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.
|
|
@@ -665,10 +665,13 @@ function describeInstallContext(ctx) {
|
|
|
665
665
|
// src/lib/caller.ts
|
|
666
666
|
var CALLER_SOURCE_HEADER = "x-one-source";
|
|
667
667
|
var CALLER_AGENT_HEADER = "x-one-agent";
|
|
668
|
-
|
|
668
|
+
var CALLER_MODEL_HEADER = "x-one-agent-model";
|
|
669
|
+
function callerHeaders(env = process.env, model) {
|
|
669
670
|
const headers = { [CALLER_SOURCE_HEADER]: "cli" };
|
|
670
671
|
const launcher = detectLauncher(env);
|
|
671
672
|
if (launcher) headers[CALLER_AGENT_HEADER] = launcher;
|
|
673
|
+
const declared = model?.trim();
|
|
674
|
+
if (declared) headers[CALLER_MODEL_HEADER] = declared;
|
|
672
675
|
return headers;
|
|
673
676
|
}
|
|
674
677
|
|
|
@@ -881,13 +884,16 @@ var OneApi = class {
|
|
|
881
884
|
/**
|
|
882
885
|
* The action for each intent, across platforms, in one call: search plus
|
|
883
886
|
* One's decision model, which picks among the candidates. Core caps a call
|
|
884
|
-
* at 10 intents and refuses more with a 400 naming the cap.
|
|
887
|
+
* at 10 intents and refuses more with a 400 naming the cap. `aiModel` is the
|
|
888
|
+
* model the agent says it is running as, sent beside the CLI and harness.
|
|
885
889
|
*/
|
|
886
|
-
async findActions(requests, task, knowledgeAgent) {
|
|
890
|
+
async findActions(requests, task, knowledgeAgent, aiModel) {
|
|
887
891
|
const response = await this.requestFull({
|
|
888
892
|
path: "/available-actions/find",
|
|
889
893
|
method: "POST",
|
|
890
|
-
body: { requests, ...task ? { task } : {}, knowledgeAgent }
|
|
894
|
+
body: { requests, ...task ? { task } : {}, knowledgeAgent },
|
|
895
|
+
// Who asked, for the record of what agents ask a find.
|
|
896
|
+
headers: callerHeaders(process.env, aiModel)
|
|
891
897
|
});
|
|
892
898
|
return Array.isArray(response) ? response : [];
|
|
893
899
|
}
|
|
@@ -2955,7 +2961,7 @@ async function executeSubflowStep(step, context, api, permissions, allowedAction
|
|
|
2955
2961
|
if (flowStack.includes(resolvedKey)) {
|
|
2956
2962
|
throw new Error(`Circular flow detected: ${[...flowStack, resolvedKey].join(" \u2192 ")}`);
|
|
2957
2963
|
}
|
|
2958
|
-
const { loadFlowWithMeta: loadFlowWithMeta2 } = await import("./flow-runner-
|
|
2964
|
+
const { loadFlowWithMeta: loadFlowWithMeta2 } = await import("./flow-runner-K73VDSS3.js");
|
|
2959
2965
|
const { flow: subFlow, rootDir: subRootDir } = loadFlowWithMeta2(resolvedKey);
|
|
2960
2966
|
const subContext = await executeFlow(
|
|
2961
2967
|
subFlow,
|
package/dist/index.js
CHANGED
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
validateActionInput,
|
|
40
40
|
walkSteps,
|
|
41
41
|
writeCache
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-UP2L4XJH.js";
|
|
43
43
|
import {
|
|
44
44
|
memSqlCommand
|
|
45
45
|
} from "./chunk-O3HDWHHS.js";
|
|
@@ -3402,9 +3402,9 @@ function parseJsonArg2(value, argName) {
|
|
|
3402
3402
|
error(`Invalid JSON for ${argName}: ${value}`);
|
|
3403
3403
|
}
|
|
3404
3404
|
}
|
|
3405
|
-
function findDeps(api, connectionKeys, useCache) {
|
|
3405
|
+
function findDeps(api, connectionKeys, useCache, aiModel) {
|
|
3406
3406
|
return {
|
|
3407
|
-
findActions: (requests, task, knowledgeAgent) => api.findActions(requests, task, knowledgeAgent),
|
|
3407
|
+
findActions: (requests, task, knowledgeAgent) => api.findActions(requests, task, knowledgeAgent, aiModel),
|
|
3408
3408
|
getActionDetails: async (actionId) => (await resolveActionDetails(api, actionId, { useCache })).details,
|
|
3409
3409
|
connectedPlatforms: async () => (await api.listConnections()).filter((c) => connectionKeys.includes(c.key)).map((c) => c.platform)
|
|
3410
3410
|
};
|
|
@@ -3440,7 +3440,7 @@ async function actionsFindCommand(pairs, options) {
|
|
|
3440
3440
|
const result = await find(
|
|
3441
3441
|
requests,
|
|
3442
3442
|
options.task,
|
|
3443
|
-
findDeps(api, connectionKeys, options.cache !== false),
|
|
3443
|
+
findDeps(api, connectionKeys, options.cache !== false, options.aiModel),
|
|
3444
3444
|
settings,
|
|
3445
3445
|
{ knowledgeCatalog: options.type === "knowledge", knowledge: options.knowledge !== false }
|
|
3446
3446
|
);
|
|
@@ -10938,7 +10938,7 @@ One call for the whole task: one platform and intent pair per operation, on any
|
|
|
10938
10938
|
- **\`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
10939
|
- **\`--task\`** (optional) is the whole job in one line, **in general terms**: what it does, without names, addresses, IDs, or message text. It helps choose between similar actions.
|
|
10940
10940
|
- **\`-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
|
-
- **\`--ai-model\`** (optional) names the model running the CLI (e.g. \`claude-sonnet-5\`); it
|
|
10941
|
+
- **\`--ai-model\`** (optional) names the model running the CLI (e.g. \`claude-sonnet-5\`); it is recorded with the find so the account's usage can report which model asked.
|
|
10942
10942
|
- **\`--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
10943
|
|
|
10944
10944
|
In \`--agent\` mode:
|
|
@@ -13246,7 +13246,7 @@ program.command("platforms").alias("p").description("List available platforms").
|
|
|
13246
13246
|
await platformsCommand(options);
|
|
13247
13247
|
});
|
|
13248
13248
|
var actions = program.command("actions").alias("a").description("Find, read, and execute platform actions (workflow: find \u2192 execute)");
|
|
13249
|
-
actions.command("find <pairs...>").alias("f").description('Find the action for every operation a task needs, across platforms, with its documentation, in one call: one actions find <platform> "<intent>" [<platform> "<intent>" ...] (up to 10 pairs). Each intent names the operation alone ("send an email"), without its data. Large documents come back as a digest; each names the exact `actions load` command for what it left out').option("--task <task>", 'The whole task in one line, in general terms (e.g. "email a report to a contact"): what it does, without names, addresses, IDs or message text. Helps choose between similar actions').option("-t, --type <type>", "execute (default: actions to run now) or knowledge (the catalog for writing code and building flows and relays, with the platform's own endpoints). Knowledge-only mode always uses knowledge").option("--ai-model <model>", "The AI model running
|
|
13249
|
+
actions.command("find <pairs...>").alias("f").description('Find the action for every operation a task needs, across platforms, with its documentation, in one call: one actions find <platform> "<intent>" [<platform> "<intent>" ...] (up to 10 pairs). Each intent names the operation alone ("send an email"), without its data. Large documents come back as a digest; each names the exact `actions load` command for what it left out').option("--task <task>", 'The whole task in one line, in general terms (e.g. "email a report to a contact"): what it does, without names, addresses, IDs or message text. Helps choose between similar actions').option("-t, --type <type>", "execute (default: actions to run now) or knowledge (the catalog for writing code and building flows and relays, with the platform's own endpoints). Knowledge-only mode always uses knowledge").option("--ai-model <model>", "The AI model you are running as (e.g. claude-sonnet-5), recorded with this find so the account's usage can report which model asked. Optional").option("--no-cache", "Bypass the cache for action documentation and re-fetch it (the fresh response still refreshes the cache)").option("--no-knowledge", "List the chosen actions (actionId, title, method, path) without their documentation; load it with `one actions load <actionId>`").action(async (pairs, options) => {
|
|
13250
13250
|
await actionsFindCommand(pairs, options);
|
|
13251
13251
|
});
|
|
13252
13252
|
actions.command("load <actionIds...>").alias("l").description("More of an action's documentation (up to 10 actions): the digest by default, --section for one a digest left out, --full for the whole document, --toc for its contents. Also how to read an alternative from a find answer").option("--section <name>", 'Return only the named section(s) \u2014 by heading, id, or alias (e.g. "Response Fields", response, optional). Repeatable or comma-separated', collect, []).option("--full", "Return the whole document instead of the digest").option("--toc", "List every section (id, heading, size) without the document").option("--no-cache", "Bypass the cache and re-fetch from the API (the fresh response still refreshes the cache)").option("--cache-status", "Print cache metadata without fetching").action(async (actionIds, options) => {
|
package/package.json
CHANGED
package/skills/one/SKILL.md
CHANGED
|
@@ -84,7 +84,7 @@ one --agent actions find <platform> "<intent>" [<platform> "<intent>" ...] --tas
|
|
|
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`** (optional) 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 choose between similar actions.
|
|
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
|
-
- **`--ai-model`** (optional): the model you are running as (e.g. `claude-sonnet-5`),
|
|
87
|
+
- **`--ai-model`** (optional): the model you are running as (e.g. `claude-sonnet-5`), recorded with the find so the account's usage can report which model asked.
|
|
88
88
|
- **`--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
89
|
- Platform names are lowercase; multi-word names use dashes: `gmail`, `hubspot`, `ship-station`, `google-calendar`.
|
|
90
90
|
|