@withone/cli 1.57.0 → 2.0.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 +33 -40
- package/dist/{chunk-QCXFSOTS.js → chunk-6EQDEYVD.js} +28 -101
- package/dist/{chunk-KAF5SVJS.js → chunk-GKAIRI4Y.js} +1 -1
- package/dist/{chunk-VH46MAE4.js → chunk-IMU2X3ZV.js} +335 -102
- package/dist/{chunk-XWTV7FA3.js → chunk-YTM6HJKA.js} +1 -1
- package/dist/{flow-runner-QQ675PJD.js → flow-runner-L3JG2WCY.js} +1 -1
- package/dist/index.js +737 -630
- package/dist/{migrate-IJI3BTWL.js → migrate-TACDLGPD.js} +2 -2
- package/dist/{runtime-65IPTPVD.js → runtime-SX36HGBA.js} +1 -1
- package/dist/{schema-OO4WK5ND.js → schema-RJC2WQQ6.js} +1 -1
- package/dist/{sql-QIVDWTL3.js → sql-SYCWUPNP.js} +2 -2
- package/package.json +1 -1
- package/skills/one/SKILL.md +38 -38
- package/skills/one/references/flows.md +7 -7
- package/skills/one/references/relay.md +7 -14
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
dotPathToJsonbExpr,
|
|
4
4
|
memMigrateCommand,
|
|
5
5
|
reviveStringifiedJson
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YTM6HJKA.js";
|
|
7
7
|
import "./chunk-44CV5IMX.js";
|
|
8
8
|
import "./chunk-OLQ55K6B.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-IMU2X3ZV.js";
|
|
10
10
|
import "./chunk-YMUY55U2.js";
|
|
11
11
|
import "./chunk-6UB623BG.js";
|
|
12
12
|
export {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
memSqlCommand,
|
|
3
3
|
syncSqlCommand
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-GKAIRI4Y.js";
|
|
5
5
|
import "./chunk-OLQ55K6B.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-IMU2X3ZV.js";
|
|
7
7
|
import "./chunk-YMUY55U2.js";
|
|
8
8
|
import "./chunk-6UB623BG.js";
|
|
9
9
|
export {
|
package/package.json
CHANGED
package/skills/one/SKILL.md
CHANGED
|
@@ -6,7 +6,7 @@ description: |
|
|
|
6
6
|
TRIGGER when:
|
|
7
7
|
- Interact with ANY 3rd-party platform or external service (e.g., "send an email", "create a Shopify order", "find a HubSpot contact", "post to Slack")
|
|
8
8
|
- List their connected platforms or check available ones
|
|
9
|
-
-
|
|
9
|
+
- Find the actions a task needs (e.g., "how do I send a Slack message", "what can I do with Gmail")
|
|
10
10
|
- Execute API calls with a connected platform
|
|
11
11
|
- Set up webhook-driven automations between platforms (e.g., "when a Stripe payment comes in, notify Slack")
|
|
12
12
|
- Build multi-step workflows that chain actions across platforms (e.g., "fetch Stripe customers and email each one")
|
|
@@ -37,7 +37,7 @@ The consent page asks which harness will use the key (Claude Code, Codex, Cursor
|
|
|
37
37
|
|
|
38
38
|
**Onboarding a user with no prompts:** run `one init --auth browser` — it opens a login window (the user authenticates there), saves the key, and auto-installs this skill, all without blocking on stdin. Add `-g`/`-p` for scope (default global). For CI/CD or headless environments, use `one init --auth manual --api-key sk_live_...`.
|
|
39
39
|
|
|
40
|
-
## Core Workflow:
|
|
40
|
+
## Core Workflow: find -> execute
|
|
41
41
|
|
|
42
42
|
Always follow this sequence when the user wants to do something on a connected platform:
|
|
43
43
|
|
|
@@ -47,7 +47,7 @@ Always follow this sequence when the user wants to do something on a connected p
|
|
|
47
47
|
one --agent connection list
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
Returns connected platforms with their connection keys (needed for execution), platform names in kebab-case (needed for
|
|
50
|
+
Returns connected platforms with their connection keys (needed for execution), platform names in kebab-case (needed for finding actions), and an `access` field per connection telling you what you may run there.
|
|
51
51
|
|
|
52
52
|
**Read `access` before you plan a workflow** — it saves you from discovering a restriction as a 403 halfway through:
|
|
53
53
|
|
|
@@ -55,13 +55,13 @@ Returns connected platforms with their connection keys (needed for execution), p
|
|
|
55
55
|
|----------|---------------|
|
|
56
56
|
| `{"policy": "full"}` | Every action on this connection is available |
|
|
57
57
|
| `{"policy": "methods", "methods": ["GET"]}` | Only actions with these HTTP methods will execute — don't propose writes |
|
|
58
|
-
| `{"policy": "actions", "actions": [...]}` | Only these exact actions may run. Each has `actionId`, `title`, `method` — **use them directly
|
|
58
|
+
| `{"policy": "actions", "actions": [...]}` | Only these exact actions may run. Each has `actionId`, `title`, `method` — **use them directly**: `actions load <actionId>` reads their docs, no find needed |
|
|
59
59
|
|
|
60
60
|
Two more fields appear only when relevant:
|
|
61
|
-
- `"knowledgeOnly": true` — `actions execute` is disabled.
|
|
61
|
+
- `"knowledgeOnly": true` — `actions execute` is disabled. `actions find` returns each action's whole document with how to call it from code; write integration code instead of executing.
|
|
62
62
|
- `"unresolvedActionIds": [...]` — allowlisted ids that couldn't be looked up; treat them as unavailable and tell the user.
|
|
63
63
|
|
|
64
|
-
An empty `actions` array means the allowlist grants nothing on that connection — say so rather than
|
|
64
|
+
An empty `actions` array means the allowlist grants nothing on that connection — say so rather than looking for alternatives.
|
|
65
65
|
|
|
66
66
|
### 1b. Delete a connection
|
|
67
67
|
|
|
@@ -71,43 +71,43 @@ one --agent connection delete <connection-key>
|
|
|
71
71
|
|
|
72
72
|
Removes a connection. Returns `{"deleted": true, "platform": "...", "key": "..."}` on success. Use the connection key from `one --agent connection list`.
|
|
73
73
|
|
|
74
|
-
### 2.
|
|
74
|
+
### 2. Find every action the task needs, with its docs (READ them before executing)
|
|
75
75
|
|
|
76
76
|
```bash
|
|
77
|
-
one --agent actions
|
|
77
|
+
one --agent actions find <platform> "<intent>" [<platform> "<intent>" ...] --task "<the job, in general terms>"
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
- Use `-t execute` when performing actions, `-t knowledge` when researching or writing code
|
|
82
|
-
- If no results, broaden the query (e.g., `"list"` instead of `"list active premium customers"`)
|
|
80
|
+
**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.
|
|
83
81
|
|
|
84
|
-
|
|
82
|
+
- **`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.
|
|
83
|
+
- **`--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.
|
|
84
|
+
- **`-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.
|
|
85
|
+
- **`--ai-model`** (optional): the model you are running as (e.g. `claude-sonnet-5`), used to tune documentation per model.
|
|
86
|
+
- Platform names are lowercase; multi-word names use dashes: `gmail`, `hubspot`, `ship-station`, `google-calendar`.
|
|
85
87
|
|
|
86
|
-
|
|
87
|
-
one --agent actions knowledge <platform> <actionId>
|
|
88
|
-
```
|
|
88
|
+
Each entry of `answers[]` carries:
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
- `selected[]` — **the action(s) to use**, each with `actionId`, `title`, `method`, `path`, and `knowledge` (its docs). More than one means the intent needs them together (look up, then update).
|
|
91
|
+
- `alsoSelected[]` — also needed, listed rather than documented to keep the answer small: `actions load` them.
|
|
92
|
+
- `runnerUp` — only when the model was unsure: a **substitute** for the pick. Use **one or the other, never both**.
|
|
93
|
+
- `alternatives[]` — other candidates, undocumented.
|
|
94
|
+
- `status` — why: a confidence; *no action fits* (rephrase the intent by outcome, or check the platform); *the decision model was unavailable* (the top search result — check it fits); *not allowed by this CLI* (the next allowed candidate stood in); or *allow none of them* (the access settings block the operation — tell the user, rephrasing won't help).
|
|
91
95
|
|
|
92
|
-
|
|
96
|
+
`guide` (once, at the end) says how to execute any of them.
|
|
93
97
|
|
|
94
|
-
|
|
95
|
-
- `sections[]` — the omitted sections only, each with `id`, `heading`, `chars`, and `included` (`false` / `"partial"`). Included sections are the headings you can see in the markdown.
|
|
96
|
-
- The markdown itself ends with a notice naming the omitted sections and the exact commands to load them.
|
|
98
|
+
**Large docs come back as a digest** (`truncated: true`): the request-building sections (method/URL, headers, description, rules, required + optional parameters, sample request, gotchas, error handling), then a notice naming what it left out with the exact command to load it. Sections named `(appendix)` are appended reference chunks or companion endpoints, not the action doc itself.
|
|
97
99
|
|
|
98
|
-
Load more only when you need it
|
|
100
|
+
### 3. Load more of a document (only when you need it)
|
|
99
101
|
|
|
100
102
|
```bash
|
|
101
|
-
one --agent actions
|
|
102
|
-
one --agent actions
|
|
103
|
-
one --agent actions
|
|
103
|
+
one --agent actions load <actionId> --section "Response Fields" # by heading
|
|
104
|
+
one --agent actions load <actionId> --section response,optional # by alias, several at once
|
|
105
|
+
one --agent actions load <actionId> --full # whole document
|
|
106
|
+
one --agent actions load <actionId> --toc # every heading, no text
|
|
107
|
+
one --agent actions load <actionId> # an alternative's digest
|
|
104
108
|
```
|
|
105
109
|
|
|
106
|
-
Aliases: `response`, `fields`, `optional`, `required`, `examples`, `errors`, `success`, `body`, `query`, `path`, `notes`, `behavior`, `gotchas`. An unknown name returns
|
|
107
|
-
|
|
108
|
-
- A `--section` response has `truncated: false` (you got the whole section) and `resolved` (which ids your names matched). It does not repeat the table of contents.
|
|
109
|
-
- If the digest says `sectionsCollapsed: true`, the doc has hundreds of headings and `sections` shows only the top omitted levels (`children` = hidden count). `--toc` lists every heading without the document.
|
|
110
|
-
- Sections named `(appendix)` in the notice are appended reference chunks or companion endpoints, not the action doc itself.
|
|
110
|
+
Served from the local cache once a doc is cached. Aliases: `response`, `fields`, `optional`, `required`, `examples`, `errors`, `success`, `body`, `query`, `path`, `notes`, `behavior`, `gotchas`. An unknown name returns the list of available sections — retry with one of those ids. Up to 10 action ids per call.
|
|
111
111
|
|
|
112
112
|
### 4. Execute
|
|
113
113
|
|
|
@@ -170,21 +170,21 @@ All errors return JSON: `{"error": "message"}`. Parse output as JSON and check f
|
|
|
170
170
|
|
|
171
171
|
- Always use `--agent` flag for structured JSON output
|
|
172
172
|
- Platform names are lowercase; multi-word names use dashes (`hubspot` not `HubSpot`, `google-calendar` not `googleCalendar`)
|
|
173
|
-
- Always use the exact action ID from
|
|
174
|
-
- Always read
|
|
173
|
+
- Always use the exact action ID from a find answer — never guess or construct them
|
|
174
|
+
- Always read the action's docs (from `actions find`) before executing — they have required params, validation rules, and caveats
|
|
175
175
|
- JSON values passed to `-d`, `--path-vars`, `--query-params` must be valid JSON (use single quotes around JSON to avoid shell escaping)
|
|
176
176
|
- Do NOT pass path or query parameters inside the `-d` body flag
|
|
177
177
|
|
|
178
178
|
## Caching
|
|
179
179
|
|
|
180
|
-
|
|
180
|
+
Action documentation is cached locally (`~/.one/cache/`). `actions find` and `actions load` read it through the cache, and `actions execute` reuses the cached action details for its preflight lookup, so after a find (or a prior execute of the same action) it makes a single API call — the action itself. Find's picks are not cached: the decision model answers every call.
|
|
181
181
|
|
|
182
182
|
- Cache is automatic — no setup required
|
|
183
183
|
- Default TTL: 1 hour (configurable via `ONE_CACHE_TTL` env var)
|
|
184
|
-
- In `--agent` mode,
|
|
185
|
-
- Use `--no-cache` to force a fresh fetch: works on `
|
|
186
|
-
- Use
|
|
187
|
-
- `
|
|
184
|
+
- In `--agent` mode, execute responses include `"_preflight": {"cache": "hit"|"miss"}`
|
|
185
|
+
- Use `--no-cache` to force a fresh fetch: works on `find`, `load`, and `execute` (refreshes execute's action-details lookup)
|
|
186
|
+
- Use `actions load <actionId> --cache-status` to check cache state without fetching
|
|
187
|
+
- `load --section <name>` and `--full` read from the cached document — no extra API call once the doc is cached
|
|
188
188
|
- Manage cache: `one cache list`, `one cache clear`, `one cache update-all`
|
|
189
189
|
- Execution responses are NEVER cached — the action always runs live; only action metadata (docs, method, path, schema) is cached
|
|
190
190
|
|
|
@@ -192,7 +192,7 @@ Knowledge and search responses are cached locally (`~/.one/cache/`). Subsequent
|
|
|
192
192
|
|
|
193
193
|
One ships a local memory store (a real Postgres process bootstrapped on demand via the bundled `embedded-postgres` plugin, with a `postgres` plugin available for remote/self-hosted Postgres) that backs both user-authored notes and synced platform data. `one mem <cmd>` is the primary surface; `one sync` is a namespaced alias (`one mem sync ...`) that writes synced rows into the same store.
|
|
194
194
|
|
|
195
|
-
**Zero-config.** The first `one mem` call on a new machine auto-initializes — no separate `mem init` step required. The `embedded-postgres` plugin downloads its Postgres binaries on first run (~52MB) and writes a daemon PID/port file at `~/.one/pg/.pgserve.json` so subsequent CLI invocations reuse the running cluster. If an OpenAI key is already resolvable (env, `.onerc`, or `config.openaiApiKey`), embeddings enable automatically and search becomes hybrid FTS + semantic. Otherwise you get FTS-only with a structured `_upgrade` hint on every response telling the user how to upgrade.
|
|
195
|
+
**Zero-config.** The first `one mem` call on a new machine auto-initializes — no separate `mem init` step required. The `embedded-postgres` plugin downloads its Postgres binaries on first run (~52MB) and writes a daemon PID/port file at `~/.one/pg/.pgserve.json` so subsequent CLI invocations reuse the running cluster. The daemon listens on 5434, or the next free port if another program holds it; pin one with `one --agent mem config set embedded-postgres.port <n>` (a conflict on a pinned port is an error, not a silent move). If an OpenAI key is already resolvable (env, `.onerc`, or `config.openaiApiKey`), embeddings enable automatically and search becomes hybrid FTS + semantic. Otherwise you get FTS-only with a structured `_upgrade` hint on every response telling the user how to upgrade.
|
|
196
196
|
|
|
197
197
|
**Listing synced rows.** `mem list <type>` takes a positional namespaced type — there is no `--platform` flag. Synced rows live under `<platform>/<model>` types:
|
|
198
198
|
|
|
@@ -296,7 +296,7 @@ one --agent sync init attio attioPeople --config '{
|
|
|
296
296
|
]
|
|
297
297
|
}
|
|
298
298
|
}'
|
|
299
|
-
# Skip the "pick paths by reading
|
|
299
|
+
# Skip the "pick paths by reading the docs" step — let the CLI rank them from a live sample
|
|
300
300
|
one --agent sync suggest-searchable attio/attioPeople
|
|
301
301
|
# → { suggestions: [{path, score, hitRate, avgLength, noiseFraction, sampleValue}], configPatch: {...paste-ready...} }
|
|
302
302
|
|
|
@@ -39,7 +39,7 @@ Before touching CLI commands:
|
|
|
39
39
|
3. Identify where AI analysis is needed (summarization, scoring, classification)
|
|
40
40
|
4. Write the step sequence as a plain list before constructing JSON
|
|
41
41
|
|
|
42
|
-
Common mistake: jumping straight to `actions
|
|
42
|
+
Common mistake: jumping straight to `actions find` and building a raw data pipe. Design first.
|
|
43
43
|
|
|
44
44
|
### Step 1: Discover connections
|
|
45
45
|
|
|
@@ -47,14 +47,14 @@ Common mistake: jumping straight to `actions search` and building a raw data pip
|
|
|
47
47
|
one --agent connection list
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
### Step 2:
|
|
50
|
+
### Step 2: Find EVERY action, with its docs, in one call
|
|
51
51
|
|
|
52
52
|
```bash
|
|
53
|
-
one --agent actions
|
|
54
|
-
one --agent actions
|
|
53
|
+
one --agent actions find <platform> "<intent>" [<platform> "<intent>" ...] --task "<what the flow does, in general terms>" -t knowledge
|
|
54
|
+
one --agent actions load <actionId> --section "<name>" # a section a digest left out, or --full
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
You MUST
|
|
57
|
+
You MUST read the docs of every action in the workflow — they tell you the exact body structure, required fields, and path variables. `-t knowledge` searches the catalog that includes the platform's own (passthrough) endpoints, which flows should prefer.
|
|
58
58
|
|
|
59
59
|
### Step 3: Build the workflow JSON
|
|
60
60
|
|
|
@@ -705,9 +705,9 @@ Three tools that turn "re-run the whole 40-step flow to debug step 30" into near
|
|
|
705
705
|
|
|
706
706
|
## Important Notes
|
|
707
707
|
|
|
708
|
-
- **Prefer passthrough actions over custom actions.** Custom actions add server-side fan-out that causes timeouts at scale. The flow runner handles pagination, retries, and rate limiting locally.
|
|
708
|
+
- **Prefer passthrough actions over custom actions.** Custom actions add server-side fan-out that causes timeouts at scale. The flow runner handles pagination, retries, and rate limiting locally. Find with `-t knowledge` to reach passthrough endpoints (e.g. GET `/gmail/v1/users/{userId}/threads` instead of POST `/gmail/get-threads`)
|
|
709
709
|
- Connection keys are inputs, not hardcoded — makes workflows portable
|
|
710
|
-
- Action IDs in examples are placeholders — always use `actions
|
|
710
|
+
- Action IDs in examples are placeholders — always use `actions find` to find real IDs
|
|
711
711
|
- Code steps support `require('crypto')`, `require('buffer')`, `require('url')`, `require('path')` — `fs`, `http`, `child_process` are blocked
|
|
712
712
|
- Bash steps require `--allow-bash` flag
|
|
713
713
|
- Action steps validate required params before executing — pass `--skip-validation` to bypass
|
|
@@ -30,23 +30,17 @@ This returns `[{ "platform": "<name>", "eventTypeCount": <n> }, ...]` for every
|
|
|
30
30
|
one --agent relay event-types <source-platform>
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
### Step 3:
|
|
33
|
+
### Step 3: Find the source and destination actions with their docs, in one call
|
|
34
34
|
|
|
35
35
|
```bash
|
|
36
|
-
one --agent actions
|
|
37
|
-
one --agent actions knowledge <source-platform> <actionId>
|
|
36
|
+
one --agent actions find <source-platform> "<event description>" <dest-platform> "<what you want to do>" -t knowledge
|
|
38
37
|
```
|
|
39
38
|
|
|
40
|
-
The
|
|
39
|
+
The source action's docs tell you the webhook payload structure — these fields become `{{payload.*}}` in your templates.
|
|
41
40
|
|
|
42
|
-
### Step 4:
|
|
41
|
+
### Step 4: Read the destination action's docs (understand the outgoing API)
|
|
43
42
|
|
|
44
|
-
|
|
45
|
-
one --agent actions search <dest-platform> "<what you want to do>" -t execute
|
|
46
|
-
one --agent actions knowledge <dest-platform> <actionId>
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
The knowledge tells you required body fields — these become the keys in your passthrough action's `body`.
|
|
43
|
+
The destination action's docs, from the same find answer, tell you required body fields — these become the keys in your passthrough action's `body`.
|
|
50
44
|
|
|
51
45
|
### Step 5: Create the relay endpoint
|
|
52
46
|
|
|
@@ -157,9 +151,8 @@ one --agent connection list
|
|
|
157
151
|
# 2. Get event types
|
|
158
152
|
one --agent relay event-types stripe
|
|
159
153
|
|
|
160
|
-
# 3.
|
|
161
|
-
one --agent actions
|
|
162
|
-
one --agent actions knowledge slack <actionId>
|
|
154
|
+
# 3. Find the Slack send-message action, with its docs
|
|
155
|
+
one --agent actions find slack "send a message to a channel" -t knowledge
|
|
163
156
|
|
|
164
157
|
# 4. Create relay
|
|
165
158
|
one --agent relay create \
|