@withone/cli 1.27.0 → 1.28.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
@@ -391,6 +391,30 @@ Settings propagate automatically to all installed agent configs.
391
391
 
392
392
  Auto-sync refuses to resurrect skills if you opted out of skill installation during `one init` — the canonical dir has to already exist.
393
393
 
394
+ ### Project config (`.onerc`)
395
+
396
+ Drop a `.onerc` file in your project root to override global settings per-project. Simple `KEY=VALUE` format; `#` for comments. Read from the current working directory (no parent lookup).
397
+
398
+ | Key | Purpose |
399
+ |-----|---------|
400
+ | `ONE_SECRET` | API key (also honored as env var) |
401
+ | `ONE_API_BASE` | API base URL (also honored as env var) |
402
+ | `ONE_PERMISSIONS` | `admin` / `write` / `read` |
403
+ | `ONE_CONNECTION_KEYS` | Comma-separated connection-key allowlist |
404
+ | `ONE_ACTION_IDS` | Comma-separated action-ID allowlist |
405
+ | `ONE_KNOWLEDGE_AGENT` | `true` / `false` — knowledge-only mode |
406
+
407
+ Precedence: env var > `.onerc` > `~/.one/config.json`.
408
+
409
+ ```bash
410
+ # .onerc
411
+ ONE_SECRET=sk_live_xxx
412
+ ONE_API_BASE=https://development-api.withone.ai
413
+ ONE_PERMISSIONS=read
414
+ ```
415
+
416
+ > ⚠️ **Add `.onerc` to your `.gitignore`.** If you put `ONE_SECRET` in it, committing the file will leak your API key. Treat `.onerc` like `.env` — never check it in.
417
+
394
418
  ## The workflow
395
419
 
396
420
  The power of One is in the workflow. Every interaction follows the same pattern:
package/dist/index.js CHANGED
@@ -108,6 +108,10 @@ function getAccessControl() {
108
108
  }
109
109
  var DEFAULT_API_BASE = "https://api.withone.ai/v1";
110
110
  function getApiBase() {
111
+ const envBase = process.env.ONE_API_BASE;
112
+ if (envBase) return `${envBase.replace(/\/+$/, "").replace(/\/v1$/, "")}/v1`;
113
+ const rc = readOneRc();
114
+ if (rc.ONE_API_BASE) return `${rc.ONE_API_BASE.replace(/\/+$/, "").replace(/\/v1$/, "")}/v1`;
111
115
  const config2 = readConfig();
112
116
  if (config2?.apiBase) return `${config2.apiBase}/v1`;
113
117
  return DEFAULT_API_BASE;
@@ -2489,7 +2493,7 @@ function validateSelectorReferences(flow2) {
2489
2493
  for (const match of value.matchAll(SELECTOR_TOKEN_RE)) {
2490
2494
  selectors.push(match[0]);
2491
2495
  }
2492
- const interpolated = value.matchAll(/\{\{(\$\.[^}]+)\}\}/g);
2496
+ const interpolated = value.matchAll(/\{\{\s*(?:q\s+)?(\$\.[^}\s|]+)/g);
2493
2497
  for (const match of interpolated) {
2494
2498
  selectors.push(match[1]);
2495
2499
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@withone/cli",
3
- "version": "1.27.0",
3
+ "version": "1.28.0",
4
4
  "description": "CLI for managing One",
5
5
  "type": "module",
6
6
  "files": [