@withone/cli 1.47.5 → 1.47.6
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
|
@@ -168,10 +168,15 @@ Connect a new platform via OAuth.
|
|
|
168
168
|
one add shopify
|
|
169
169
|
one add hubspot
|
|
170
170
|
one add gmail
|
|
171
|
+
one add gmail --tag work # tag the connection
|
|
171
172
|
```
|
|
172
173
|
|
|
173
174
|
Opens your browser, you authorize, done. The CLI polls until the connection is live. Platform names are lowercase (with dashes for multi-word names) - run `one platforms` to see them all.
|
|
174
175
|
|
|
176
|
+
| Flag | What it does |
|
|
177
|
+
|------|-------------|
|
|
178
|
+
| `--tag <name>` | Tag the new connection once it's created. Lets sync/flow profiles target a specific connection via `"connection": { "platform": "gmail", "tag": "work" }` when you have several connections for one platform (e.g. personal vs work Gmail). |
|
|
179
|
+
|
|
175
180
|
### `one list`
|
|
176
181
|
|
|
177
182
|
List your active connections with their status and connection keys.
|
|
@@ -106,6 +106,16 @@ var OneApi = class {
|
|
|
106
106
|
async deleteConnection(id) {
|
|
107
107
|
await this.requestFull({ path: `/vault/connections/${id}`, method: "DELETE" });
|
|
108
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* Set the tag set on a connection (replaces existing tags). Backs
|
|
111
|
+
* `one add <platform> --tag <name>`, which tags a connection right after
|
|
112
|
+
* the OAuth flow creates it so sync/flow profiles can reference it via
|
|
113
|
+
* `connection: { platform, tag }` when several connections share a platform.
|
|
114
|
+
* Maps to `PATCH /v1/vault/connections/{id}` (UpdateConnection { tags }).
|
|
115
|
+
*/
|
|
116
|
+
async updateConnectionTags(id, tags) {
|
|
117
|
+
await this.requestFull({ path: `/vault/connections/${id}`, method: "PATCH", body: { tags } });
|
|
118
|
+
}
|
|
109
119
|
/**
|
|
110
120
|
* Resolve a late-bound `ConnectionRef` to a current `Connection`. Pass
|
|
111
121
|
* `cache` (a pre-fetched connection list) when resolving many refs in a
|
|
@@ -1279,7 +1289,7 @@ async function executeSubflowStep(step, context, api, permissions, allowedAction
|
|
|
1279
1289
|
if (flowStack.includes(resolvedKey)) {
|
|
1280
1290
|
throw new Error(`Circular flow detected: ${[...flowStack, resolvedKey].join(" \u2192 ")}`);
|
|
1281
1291
|
}
|
|
1282
|
-
const { loadFlowWithMeta: loadFlowWithMeta2 } = await import("./flow-runner-
|
|
1292
|
+
const { loadFlowWithMeta: loadFlowWithMeta2 } = await import("./flow-runner-KL2ATVBD.js");
|
|
1283
1293
|
const { flow: subFlow, rootDir: subRootDir } = loadFlowWithMeta2(resolvedKey);
|
|
1284
1294
|
const subContext = await executeFlow(
|
|
1285
1295
|
subFlow,
|
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
searchCachePath,
|
|
31
31
|
validateActionInput,
|
|
32
32
|
writeCache
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-SFGH6VAJ.js";
|
|
34
34
|
import {
|
|
35
35
|
memSqlCommand
|
|
36
36
|
} from "./chunk-QV3Y5N5G.js";
|
|
@@ -2012,7 +2012,7 @@ function stripAnsi(str) {
|
|
|
2012
2012
|
}
|
|
2013
2013
|
|
|
2014
2014
|
// src/commands/connection.ts
|
|
2015
|
-
async function connectionAddCommand(platformArg) {
|
|
2015
|
+
async function connectionAddCommand(platformArg, options) {
|
|
2016
2016
|
if (isAgentMode()) {
|
|
2017
2017
|
error("This command requires interactive input. Run without --agent.");
|
|
2018
2018
|
}
|
|
@@ -2107,7 +2107,22 @@ ${url}`);
|
|
|
2107
2107
|
try {
|
|
2108
2108
|
const connection2 = await api.waitForConnection(platform, 5 * 60 * 1e3, 5e3);
|
|
2109
2109
|
pollSpinner.stop(`${platform} connected!`);
|
|
2110
|
-
|
|
2110
|
+
const tag = options?.tag?.trim();
|
|
2111
|
+
if (tag) {
|
|
2112
|
+
const tagSpinner = p4.spinner();
|
|
2113
|
+
tagSpinner.start(`Tagging connection "${tag}"...`);
|
|
2114
|
+
try {
|
|
2115
|
+
await api.updateConnectionTags(connection2.id, [tag]);
|
|
2116
|
+
tagSpinner.stop(`Tagged "${tag}"`);
|
|
2117
|
+
} catch (err) {
|
|
2118
|
+
tagSpinner.stop("Could not set tag");
|
|
2119
|
+
p4.log.warn(
|
|
2120
|
+
`Connected, but tagging failed: ${err instanceof Error ? err.message : "Unknown error"}
|
|
2121
|
+
The connection is usable; set the tag later in the dashboard or retry.`
|
|
2122
|
+
);
|
|
2123
|
+
}
|
|
2124
|
+
}
|
|
2125
|
+
p4.log.success(`${pc4.green("\u2713")} ${connection2.platform} is now available to your AI agents.${tag ? ` (tag: ${tag})` : ""}`);
|
|
2111
2126
|
p4.outro("Connection complete!");
|
|
2112
2127
|
} catch (error2) {
|
|
2113
2128
|
pollSpinner.stop("Connection timed out");
|
|
@@ -11285,8 +11300,8 @@ config.command("reset").description("Remove the project config for the current d
|
|
|
11285
11300
|
}
|
|
11286
11301
|
});
|
|
11287
11302
|
var connection = program.command("connection").description("Manage connections");
|
|
11288
|
-
connection.command("add [platform]").alias("a").description("Add a new connection").action(async (platform) => {
|
|
11289
|
-
await connectionAddCommand(platform);
|
|
11303
|
+
connection.command("add [platform]").alias("a").description("Add a new connection").option("--tag <name>", "Tag the new connection (disambiguates multiple connections per platform in sync/flow profiles)").action(async (platform, options) => {
|
|
11304
|
+
await connectionAddCommand(platform, { tag: options.tag });
|
|
11290
11305
|
});
|
|
11291
11306
|
connection.command("list").alias("ls").description("List your connections").option("-s, --search <query>", "Filter connections by platform name").option("-l, --limit <n>", "Max connections to return (agent mode default: 20)").action(async (options) => {
|
|
11292
11307
|
await connectionListCommand(options);
|
|
@@ -11450,8 +11465,8 @@ program.command("whoami").description("Show the user, organization, and project
|
|
|
11450
11465
|
console.log(` ${pc14.dim("API:")} ${apiBase}`);
|
|
11451
11466
|
console.log();
|
|
11452
11467
|
});
|
|
11453
|
-
program.command("add [platform]").description("Shortcut for: connection add").action(async (platform) => {
|
|
11454
|
-
await connectionAddCommand(platform);
|
|
11468
|
+
program.command("add [platform]").description("Shortcut for: connection add").option("--tag <name>", "Tag the new connection (disambiguates multiple connections per platform in sync/flow profiles)").action(async (platform, options) => {
|
|
11469
|
+
await connectionAddCommand(platform, { tag: options.tag });
|
|
11455
11470
|
});
|
|
11456
11471
|
program.command("list").alias("ls").description("Shortcut for: connection list").option("-s, --search <query>", "Filter connections by platform name").option("-l, --limit <n>", "Max connections to return (agent mode default: 20)").action(async (options) => {
|
|
11457
11472
|
await connectionListCommand(options);
|
package/package.json
CHANGED
package/skills/one/SKILL.md
CHANGED
|
@@ -251,7 +251,7 @@ Without declared paths, the default walker concatenates every string in the reco
|
|
|
251
251
|
|
|
252
252
|
**Sync rejects custom actions** — profiles must use passthrough. `sync init` only surfaces passthrough models; `sync run` aborts if the list or enrich action is tagged `custom`. If no passthrough exists, compose a flow instead.
|
|
253
253
|
|
|
254
|
-
**Connections are late-bound** — profiles use `"connection": { "platform": "<name>" }`, not literal `connectionKey` strings. The key is resolved at sync time, so `one add <platform>` (re-auth) doesn't break the profile. For multi-account platforms, add `"tag": "<connection-tag>"` to disambiguate
|
|
254
|
+
**Connections are late-bound** — profiles use `"connection": { "platform": "<name>" }`, not literal `connectionKey` strings. The key is resolved at sync time, so `one add <platform>` (re-auth) doesn't break the profile. For multi-account platforms, add `"tag": "<connection-tag>"` to disambiguate, and create the tagged connection with `one add <platform> --tag <name>`. Don't hardcode connection keys in profiles.
|
|
255
255
|
|
|
256
256
|
**Advanced features** (enrich, transform, exclude, identityKey, hooks, --full-refresh, alternative backends, embedding tuning): run `one guide memory` or `one guide sync` for the full reference.
|
|
257
257
|
|
|
@@ -267,8 +267,9 @@ One also supports more advanced patterns. Read the relevant reference file befor
|
|
|
267
267
|
If the user needs a platform that isn't connected yet, tell them to run:
|
|
268
268
|
```bash
|
|
269
269
|
one add <platform>
|
|
270
|
+
one add <platform> --tag <name> # tag it (for multiple connections per platform)
|
|
270
271
|
```
|
|
271
|
-
This is interactive and opens the browser for OAuth. After connecting, the platform will appear in `one --agent connection list`.
|
|
272
|
+
This is interactive and opens the browser for OAuth. After connecting, the platform will appear in `one --agent connection list`. Use `--tag` when the user has (or will have) more than one connection for the same platform so sync/flow profiles can target a specific one via `"connection": { "platform": "<name>", "tag": "<name>" }`.
|
|
272
273
|
|
|
273
274
|
## Removing Connections
|
|
274
275
|
|