@withone/cli 1.55.3 → 1.56.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 +10 -0
- package/dist/{chunk-EVEUGRCB.js → chunk-6UB623BG.js} +31 -2
- package/dist/{chunk-OWDR5L3Q.js → chunk-KAF5SVJS.js} +2 -2
- package/dist/{chunk-GNSR3NYN.js → chunk-OLQ55K6B.js} +2 -2
- package/dist/{chunk-WXJWF7QG.js → chunk-QCXFSOTS.js} +2 -2
- package/dist/{chunk-DDCDPVJH.js → chunk-VH46MAE4.js} +2 -2
- package/dist/{chunk-FS4HAKZ6.js → chunk-XWTV7FA3.js} +2 -2
- package/dist/{chunk-5O5KODGV.js → chunk-YMUY55U2.js} +1 -1
- package/dist/{embedding-Z2WCDN6R.js → embedding-OXX4OF65.js} +2 -2
- package/dist/{flow-runner-MVSJ2GB7.js → flow-runner-QQ675PJD.js} +2 -2
- package/dist/index.js +1530 -1266
- package/dist/{migrate-37A463L6.js → migrate-IJI3BTWL.js} +5 -5
- package/dist/{runtime-AFXLC4IC.js → runtime-65IPTPVD.js} +3 -3
- package/dist/{schema-4JJO2CIZ.js → schema-OO4WK5ND.js} +4 -4
- package/dist/sql-QIVDWTL3.js +12 -0
- package/package.json +1 -1
- package/skills/one/SKILL.md +2 -0
- package/dist/sql-3WNYRCWP.js +0 -12
package/README.md
CHANGED
|
@@ -48,6 +48,8 @@ one login # Opens browser for authentication (global or per-directo
|
|
|
48
48
|
one logout # Clear credentials (with scope picker and confirmation)
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
+
The browser consent page names the key and tags it with where this CLI is installed (scope, project path, machine, OS user, CLI version, chosen harnesses, and the per-install device id unless telemetry is off) so you can find and revoke it from Settings → API keys. The terminal prints exactly what will be sent before the browser opens.
|
|
52
|
+
|
|
51
53
|
Requires Node.js 18+. `one sync` additionally needs Node 20+, because its
|
|
52
54
|
local SQLite engine (`better-sqlite3`, an optional dependency) ships prebuilt
|
|
53
55
|
binaries only for Node 20 and above. On Node 18 every other command works
|
|
@@ -162,6 +164,10 @@ one init --auth manual --api-key sk_live_... # headless / CI, no browser
|
|
|
162
164
|
| `--auth <browser\|manual>` | Run setup with **no prompts**. `browser` opens a login window; `manual` uses `--api-key`. Scope from `-g`/`-p` (default global). |
|
|
163
165
|
| `--api-key <key>` | API key for `--auth manual` (`sk_live_…` / `sk_test_…`) |
|
|
164
166
|
| `--openai-key <key>` | Optional OpenAI key for `one mem` semantic search |
|
|
167
|
+
| `ONE_APP_URL` (env) | Dashboard origin the browser flows open (default `https://app.withone.ai`); use `http://localhost:4202` against a local frontend. |
|
|
168
|
+
| `ONE_API_BASE` (env) | API origin, overriding `apiBase` in config (default `https://api.withone.ai`); use `http://localhost:5005` against a local backend. |
|
|
169
|
+
|
|
170
|
+
Both overrides apply to the current process only and are never written to config, so a key minted against a local backend lands in your normal config and a cron job or MCP server without the variable would send it to the hosted API. Pair them with `ONE_HOME` (see below) to keep a local stack's credentials in a separate profile.
|
|
165
171
|
|
|
166
172
|
### `one add <platform>`
|
|
167
173
|
|
|
@@ -650,6 +656,10 @@ Updates the CLI to the latest version (`npm install -g @withone/cli@latest`).
|
|
|
650
656
|
|
|
651
657
|
The CLI also **auto-updates in the background**: when a newer version has been published for more than 30 minutes, the next `one` command silently kicks off a global install. This is hardened against concurrent runs — a lock file in `~/.one/` ensures at most one install runs at a time (so parallel agent invocations can't collide and wedge npm), and the lock self-heals after 10 minutes if an install ever crashes or hangs.
|
|
652
658
|
|
|
659
|
+
**Scheduled runs update too.** `one sync schedule` installs a crontab entry, and cron runs jobs with a bare `PATH=/usr/bin:/bin` — where an nvm, Volta, fnm, or Homebrew `npm` does not appear. The updater therefore resolves `npm` next to the running `node` binary rather than through `PATH`, and prepends node's own directory to the install's environment. Without this a scheduled install can never upgrade itself and stays pinned to the version that created it, forever.
|
|
660
|
+
|
|
661
|
+
If an install still doesn't land — a read-only prefix, a permissions problem, a node with no npm alongside it — the CLI **says so instead of retrying invisibly**. npm's own output is appended to `~/.one/auto-update.log`, and after three consecutive failed attempts a warning goes to **stderr** (never stdout, so it can't corrupt `--agent` JSON or a piped command) telling you to run the install by hand. That notice repeats at most once a day.
|
|
662
|
+
|
|
653
663
|
To disable background auto-updates entirely (e.g. on CI or a shared agent host), set:
|
|
654
664
|
|
|
655
665
|
```bash
|
|
@@ -181,10 +181,18 @@ function getAccessControl() {
|
|
|
181
181
|
}
|
|
182
182
|
var DEFAULT_API_BASE = "https://api.withone.ai/v1";
|
|
183
183
|
function getApiBase() {
|
|
184
|
+
const override = process.env.ONE_API_BASE?.trim();
|
|
185
|
+
if (override) return withV1(override);
|
|
186
|
+
const rc = readOneRc().ONE_API_BASE?.trim();
|
|
187
|
+
if (rc) return withV1(rc);
|
|
184
188
|
const config = readConfig();
|
|
185
|
-
if (config?.apiBase) return
|
|
189
|
+
if (config?.apiBase) return withV1(config.apiBase);
|
|
186
190
|
return DEFAULT_API_BASE;
|
|
187
191
|
}
|
|
192
|
+
function withV1(origin) {
|
|
193
|
+
const trimmed = origin.replace(/\/+$/, "");
|
|
194
|
+
return trimmed.endsWith("/v1") ? trimmed : `${trimmed}/v1`;
|
|
195
|
+
}
|
|
188
196
|
function updateApiBase(url) {
|
|
189
197
|
const config = readConfig();
|
|
190
198
|
if (!config) return;
|
|
@@ -194,8 +202,23 @@ function updateApiBase(url) {
|
|
|
194
202
|
delete config.apiBase;
|
|
195
203
|
}
|
|
196
204
|
delete config.whoami;
|
|
205
|
+
delete config.whoamiApiBase;
|
|
197
206
|
writeConfig(config);
|
|
198
207
|
}
|
|
208
|
+
function saveCredentials(apiKey, scope, opts) {
|
|
209
|
+
const existing = scope === "project" ? readProjectConfig() : readGlobalConfig();
|
|
210
|
+
const next = {
|
|
211
|
+
...existing,
|
|
212
|
+
apiKey,
|
|
213
|
+
installedAgents: existing?.installedAgents ?? [],
|
|
214
|
+
createdAt: existing?.createdAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
215
|
+
whoami: opts.whoami,
|
|
216
|
+
whoamiApiBase: getApiBase()
|
|
217
|
+
};
|
|
218
|
+
if (opts.keyName) next.apiKeyName = opts.keyName;
|
|
219
|
+
else delete next.apiKeyName;
|
|
220
|
+
writeConfig(next, scope);
|
|
221
|
+
}
|
|
199
222
|
function getCacheTtl() {
|
|
200
223
|
if (process.env.ONE_CACHE_TTL) {
|
|
201
224
|
const val = parseInt(process.env.ONE_CACHE_TTL, 10);
|
|
@@ -229,12 +252,17 @@ function updateAccessControl(settings) {
|
|
|
229
252
|
writeConfig(config);
|
|
230
253
|
}
|
|
231
254
|
function getWhoAmI() {
|
|
232
|
-
|
|
255
|
+
const config = readConfig();
|
|
256
|
+
if (!config?.whoami) return null;
|
|
257
|
+
const fetchedFrom = config.whoamiApiBase ?? withV1(config.apiBase ?? DEFAULT_API_BASE);
|
|
258
|
+
if (fetchedFrom !== getApiBase()) return null;
|
|
259
|
+
return config.whoami;
|
|
233
260
|
}
|
|
234
261
|
function updateWhoAmI(whoami) {
|
|
235
262
|
const config = readConfig();
|
|
236
263
|
if (!config) return;
|
|
237
264
|
config.whoami = whoami;
|
|
265
|
+
config.whoamiApiBase = getApiBase();
|
|
238
266
|
writeConfig(config);
|
|
239
267
|
}
|
|
240
268
|
async function ensureWhoAmI(api) {
|
|
@@ -393,6 +421,7 @@ export {
|
|
|
393
421
|
getAccessControl,
|
|
394
422
|
getApiBase,
|
|
395
423
|
updateApiBase,
|
|
424
|
+
saveCredentials,
|
|
396
425
|
getCacheTtl,
|
|
397
426
|
updateAccessControl,
|
|
398
427
|
getWhoAmI,
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
isAgentMode,
|
|
4
4
|
json,
|
|
5
5
|
requireMemoryInit
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-OLQ55K6B.js";
|
|
7
7
|
import {
|
|
8
8
|
getBackend
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VH46MAE4.js";
|
|
10
10
|
|
|
11
11
|
// src/commands/mem/sql.ts
|
|
12
12
|
async function memSqlCommand(sql) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getMemoryConfigOrDefault
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YMUY55U2.js";
|
|
4
4
|
import {
|
|
5
5
|
getOpenAiApiKey,
|
|
6
6
|
readConfig
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-6UB623BG.js";
|
|
8
8
|
|
|
9
9
|
// src/lib/output.ts
|
|
10
10
|
import * as p from "@clack/prompts";
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
getCacheTtl,
|
|
7
7
|
homeDir
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-6UB623BG.js";
|
|
9
9
|
|
|
10
10
|
// src/lib/flow-runner.ts
|
|
11
11
|
import fs3 from "fs";
|
|
@@ -2354,7 +2354,7 @@ async function executeSubflowStep(step, context, api, permissions, allowedAction
|
|
|
2354
2354
|
if (flowStack.includes(resolvedKey)) {
|
|
2355
2355
|
throw new Error(`Circular flow detected: ${[...flowStack, resolvedKey].join(" \u2192 ")}`);
|
|
2356
2356
|
}
|
|
2357
|
-
const { loadFlowWithMeta: loadFlowWithMeta2 } = await import("./flow-runner-
|
|
2357
|
+
const { loadFlowWithMeta: loadFlowWithMeta2 } = await import("./flow-runner-QQ675PJD.js");
|
|
2358
2358
|
const { flow: subFlow, rootDir: subRootDir } = loadFlowWithMeta2(resolvedKey);
|
|
2359
2359
|
const subContext = await executeFlow(
|
|
2360
2360
|
subFlow,
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
getMemoryConfig,
|
|
6
6
|
getMemoryConfigOrDefault,
|
|
7
7
|
updateMemoryConfig
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-YMUY55U2.js";
|
|
9
9
|
import {
|
|
10
10
|
getOpenAiApiKey,
|
|
11
11
|
homeDir
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-6UB623BG.js";
|
|
13
13
|
|
|
14
14
|
// src/lib/memory/schema.ts
|
|
15
15
|
var SCHEMA_VERSION = "2.3.1";
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
note,
|
|
7
7
|
okJson,
|
|
8
8
|
requireMemoryInit
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-OLQ55K6B.js";
|
|
10
10
|
import {
|
|
11
11
|
getBackend,
|
|
12
12
|
upsertRecord
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-VH46MAE4.js";
|
|
14
14
|
|
|
15
15
|
// src/commands/mem/migrate.ts
|
|
16
16
|
import fs4 from "fs";
|
|
@@ -12,9 +12,9 @@ import {
|
|
|
12
12
|
stripStepsAlias,
|
|
13
13
|
summarizeFlowInputs,
|
|
14
14
|
walkSteps
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-QCXFSOTS.js";
|
|
16
16
|
import "./chunk-44CV5IMX.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-6UB623BG.js";
|
|
18
18
|
export {
|
|
19
19
|
FlowRunner,
|
|
20
20
|
collectStepTypes,
|