@withone/cli 2.5.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`), for tuning documentation per model later.
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.
@@ -701,6 +701,8 @@ Run `one update` manually whenever you want to upgrade.
701
701
 
702
702
  ### Telemetry
703
703
 
704
+ Every `actions execute` call also tells One which surface and harness made it (`x-one-source: cli`, and `x-one-agent: claude-code` or whichever agent launched the CLI), so the dashboard's Logs page can show which agent ran each action. This is the call's own record in your account, not analytics, and it is sent whether or not telemetry is on. No version, arguments or data ride with it.
705
+
704
706
  The CLI collects **usage analytics** — which command was run, the CLI version, OS/arch, and whether it ran in `--agent` mode — to help us prioritize improvements. Events are linked to your One account (user id, email, name, org) so they line up with your dashboard activity. **Command arguments, inputs, connection data, and secrets are never collected** (only the command name, e.g. `actions execute`). A one-time notice is shown on first run. Commands are aggregated locally and sent as periodic, batched roll-ups in the background, so telemetry never slows down or blocks a command (and stays lightweight even under heavy automation).
705
707
 
706
708
  To opt out, set any of:
@@ -1,9 +1,11 @@
1
+ import {
2
+ requireMemoryInit
3
+ } from "./chunk-VMFWA43Q.js";
1
4
  import {
2
5
  error,
3
6
  isAgentMode,
4
- json,
5
- requireMemoryInit
6
- } from "./chunk-NOFJ4NYD.js";
7
+ json
8
+ } from "./chunk-Q6PWTATS.js";
7
9
  import {
8
10
  getBackend
9
11
  } from "./chunk-NOPTG4GC.js";
@@ -2,11 +2,13 @@ import {
2
2
  getByDotPath
3
3
  } from "./chunk-44CV5IMX.js";
4
4
  import {
5
- isAgentMode,
6
- note,
7
5
  okJson,
8
6
  requireMemoryInit
9
- } from "./chunk-NOFJ4NYD.js";
7
+ } from "./chunk-VMFWA43Q.js";
8
+ import {
9
+ isAgentMode,
10
+ note
11
+ } from "./chunk-Q6PWTATS.js";
10
12
  import {
11
13
  getBackend,
12
14
  upsertRecord
@@ -0,0 +1,79 @@
1
+ // src/lib/output.ts
2
+ import * as p from "@clack/prompts";
3
+ var _agentMode = false;
4
+ function setAgentMode(value) {
5
+ _agentMode = value;
6
+ }
7
+ function isAgentMode() {
8
+ return _agentMode || process.env.ONE_AGENT === "1";
9
+ }
10
+ function silenceWarningsInAgentMode() {
11
+ const agent = process.argv.includes("--agent") || process.env.ONE_AGENT === "1";
12
+ if (!agent) return;
13
+ process.env.NODE_NO_WARNINGS = "1";
14
+ process.removeAllListeners("warning");
15
+ process.emitWarning = (() => {
16
+ });
17
+ }
18
+ var SPINNER_CHROME = 6;
19
+ function fitSpinnerMessage(msg, columns) {
20
+ if (!columns || columns <= 0) return msg;
21
+ const room = columns - SPINNER_CHROME;
22
+ const chars = Array.from(msg);
23
+ if (chars.length <= room) return msg;
24
+ return room > 1 ? `${chars.slice(0, room - 1).join("")}\u2026` : "";
25
+ }
26
+ function createSpinner() {
27
+ if (isAgentMode()) {
28
+ return { start() {
29
+ }, stop() {
30
+ } };
31
+ }
32
+ if (!process.stdout.isTTY) {
33
+ return {
34
+ start: (msg) => p.log.step(msg),
35
+ stop: (msg) => p.log.message(msg)
36
+ };
37
+ }
38
+ const spinner2 = p.spinner();
39
+ return {
40
+ start: (msg) => spinner2.start(fitSpinnerMessage(msg, process.stdout.columns)),
41
+ stop: (msg) => spinner2.stop(msg)
42
+ };
43
+ }
44
+ function intro2(msg) {
45
+ if (!isAgentMode()) p.intro(msg);
46
+ }
47
+ function outro2(msg) {
48
+ if (!isAgentMode()) p.outro(msg);
49
+ }
50
+ function note2(msg, title) {
51
+ if (!isAgentMode()) p.note(msg, title);
52
+ }
53
+ function cancel2(msg) {
54
+ if (!isAgentMode()) p.cancel(msg);
55
+ }
56
+ function json(data) {
57
+ process.stdout.write(JSON.stringify(data) + "\n");
58
+ }
59
+ function error(message, exitCode = 1) {
60
+ if (isAgentMode()) {
61
+ json({ error: message });
62
+ } else {
63
+ p.cancel(message);
64
+ }
65
+ process.exit(exitCode);
66
+ }
67
+
68
+ export {
69
+ setAgentMode,
70
+ isAgentMode,
71
+ silenceWarningsInAgentMode,
72
+ createSpinner,
73
+ intro2 as intro,
74
+ outro2 as outro,
75
+ note2 as note,
76
+ cancel2 as cancel,
77
+ json,
78
+ error
79
+ };