@withone/cli 1.42.0 → 1.43.3
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 +57 -17
- package/dist/chunk-3ZJVO4GP.js +59 -0
- package/dist/chunk-44CV5IMX.js +38 -0
- package/dist/chunk-AU2ZEEMS.js +477 -0
- package/dist/chunk-C3ORS3RG.js +762 -0
- package/dist/{chunk-PK2RAVAF.js → chunk-EMAQVPRD.js} +6 -36
- package/dist/chunk-IAFQVFCB.js +1708 -0
- package/dist/chunk-MRGKKO54.js +158 -0
- package/dist/embedding-O4XWBL6T.js +10 -0
- package/dist/{flow-runner-Y2CXXU3U.js → flow-runner-XSJ4US5S.js} +2 -1
- package/dist/index.js +2856 -1691
- package/dist/migrate-BEARUBLO.js +16 -0
- package/dist/runtime-NVC7KAJZ.js +15 -0
- package/dist/sql-EGTWQIU5.js +11 -0
- package/package.json +6 -2
- package/profiles/attio/attioCompanies.json +5 -3
- package/profiles/attio/attioPeople.json +5 -4
- package/skills/one/SKILL.md +83 -10
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildIdentityMap,
|
|
3
|
+
dotPathToJsonbExpr,
|
|
4
|
+
memMigrateCommand,
|
|
5
|
+
reviveStringifiedJson
|
|
6
|
+
} from "./chunk-C3ORS3RG.js";
|
|
7
|
+
import "./chunk-44CV5IMX.js";
|
|
8
|
+
import "./chunk-MRGKKO54.js";
|
|
9
|
+
import "./chunk-IAFQVFCB.js";
|
|
10
|
+
import "./chunk-AU2ZEEMS.js";
|
|
11
|
+
export {
|
|
12
|
+
buildIdentityMap,
|
|
13
|
+
dotPathToJsonbExpr,
|
|
14
|
+
memMigrateCommand,
|
|
15
|
+
reviveStringifiedJson
|
|
16
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
addRecord,
|
|
3
|
+
closeBackendIfCached,
|
|
4
|
+
getBackend,
|
|
5
|
+
resetBackendSingleton,
|
|
6
|
+
upsertRecord
|
|
7
|
+
} from "./chunk-IAFQVFCB.js";
|
|
8
|
+
import "./chunk-AU2ZEEMS.js";
|
|
9
|
+
export {
|
|
10
|
+
addRecord,
|
|
11
|
+
closeBackendIfCached,
|
|
12
|
+
getBackend,
|
|
13
|
+
resetBackendSingleton,
|
|
14
|
+
upsertRecord
|
|
15
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@withone/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.43.3",
|
|
4
4
|
"description": "CLI for managing One",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -23,15 +23,19 @@
|
|
|
23
23
|
"@clack/prompts": "^0.9.1",
|
|
24
24
|
"commander": "^13.1.0",
|
|
25
25
|
"open": "^10.1.0",
|
|
26
|
+
"pgserve": "^2.2.3",
|
|
26
27
|
"picocolors": "^1.1.1",
|
|
27
28
|
"smol-toml": "^1.6.0"
|
|
28
29
|
},
|
|
29
30
|
"optionalDependencies": {
|
|
30
|
-
"
|
|
31
|
+
"@electric-sql/pglite": "^0.2.17",
|
|
32
|
+
"better-sqlite3": "^11.7.0",
|
|
33
|
+
"pg": "^8.20.0"
|
|
31
34
|
},
|
|
32
35
|
"devDependencies": {
|
|
33
36
|
"@types/better-sqlite3": "^7.6.13",
|
|
34
37
|
"@types/node": "^22.13.1",
|
|
38
|
+
"@types/pg": "^8.20.0",
|
|
35
39
|
"tsup": "^8.3.6",
|
|
36
40
|
"typescript": "^5.7.3"
|
|
37
41
|
},
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
"platform": "attio",
|
|
4
4
|
"model": "attioCompanies",
|
|
5
5
|
"connection": { "platform": "attio" },
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
6
|
+
"identityKey": "values.domains[0].domain",
|
|
7
|
+
"actionId": "conn_mod_def::GJ0CbN-LPiU::A6h6M9QkS0Cs2Lt9CdPH7Q",
|
|
8
|
+
"pathVars": { "object": "companies" },
|
|
9
|
+
"resultsPath": "data",
|
|
10
|
+
"idField": "id.record_id",
|
|
9
11
|
"pagination": {
|
|
10
12
|
"type": "offset",
|
|
11
13
|
"passAs": "body:offset"
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
"platform": "attio",
|
|
4
4
|
"model": "attioPeople",
|
|
5
5
|
"connection": { "platform": "attio" },
|
|
6
|
-
"identityKey": "
|
|
7
|
-
"actionId": "conn_mod_def::
|
|
8
|
-
"
|
|
9
|
-
"
|
|
6
|
+
"identityKey": "values.email_addresses[0].email_address",
|
|
7
|
+
"actionId": "conn_mod_def::GJ0CbN-LPiU::A6h6M9QkS0Cs2Lt9CdPH7Q",
|
|
8
|
+
"pathVars": { "object": "people" },
|
|
9
|
+
"resultsPath": "data",
|
|
10
|
+
"idField": "id.record_id",
|
|
10
11
|
"pagination": {
|
|
11
12
|
"type": "offset",
|
|
12
13
|
"passAs": "body:offset"
|
package/skills/one/SKILL.md
CHANGED
|
@@ -148,36 +148,109 @@ Knowledge and search responses are cached locally (`~/.one/cache/`). Subsequent
|
|
|
148
148
|
- Manage cache: `one cache list`, `one cache clear`, `one cache update-all`
|
|
149
149
|
- `actions execute` is NEVER cached — always fresh
|
|
150
150
|
|
|
151
|
-
##
|
|
151
|
+
## Unified Memory
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
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.
|
|
154
|
+
|
|
155
|
+
**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.
|
|
156
|
+
|
|
157
|
+
**Listing synced rows.** `mem list <type>` takes a positional namespaced type — there is no `--platform` flag. Synced rows live under `<platform>/<model>` types:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
one --agent mem list "gmail/threads"
|
|
161
|
+
one --agent mem list "attio/attioPeople" --limit 5
|
|
162
|
+
one --agent mem list "google-calendar/events"
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Underneath, the store has no `platform` column — `type` is the only platform-scoping mechanism. If you need raw SQL via `mem sql`, filter with `WHERE type LIKE 'platform/%'` (not `WHERE platform = ...`).
|
|
154
166
|
|
|
155
167
|
```bash
|
|
156
|
-
#
|
|
157
|
-
one
|
|
168
|
+
# User memories
|
|
169
|
+
one --agent mem add note '{"content":"..."}' --tags work --weight 7
|
|
170
|
+
one --agent mem search "deadline" # hybrid if key set, else FTS
|
|
171
|
+
one --agent mem list note --limit 20
|
|
172
|
+
one --agent mem link <from-id> <to-id> relates_to --bi
|
|
173
|
+
|
|
174
|
+
# Status + diagnostics
|
|
175
|
+
one --agent mem status # backend, provider, _upgrade hint
|
|
176
|
+
one --agent mem doctor # full health report
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Adding OpenAI for semantic search
|
|
180
|
+
|
|
181
|
+
Stored at the top level of `~/.one/config.json` as `openaiApiKey`, same precedence as `ONE_SECRET` (env > `.onerc OPENAI_API_KEY=...` > project > global). Three equivalent ways to set:
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
# Via re-run of one init (interactive prompt)
|
|
185
|
+
one init
|
|
186
|
+
|
|
187
|
+
# Via config set (writes to top-level, not the memory block)
|
|
188
|
+
one --agent mem config set embedding.apiKey sk-...
|
|
158
189
|
|
|
190
|
+
# Via env var (no persistence)
|
|
191
|
+
export OPENAI_API_KEY=sk-...
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Syncing platforms into memory
|
|
195
|
+
|
|
196
|
+
```bash
|
|
159
197
|
# Check built-in profiles (pre-validated configs for common platforms)
|
|
160
198
|
one --agent sync profiles
|
|
161
199
|
|
|
162
|
-
# Setup
|
|
200
|
+
# Setup — seeds from the built-in, merges your --config overrides
|
|
163
201
|
one --agent sync init stripe balanceTransactions
|
|
164
|
-
# If _complete: true and _test.ok: true →
|
|
165
|
-
|
|
166
|
-
#
|
|
202
|
+
# If _complete: true and _test.ok: true → ready to run
|
|
203
|
+
|
|
204
|
+
# Preview what gets embedded BEFORE paying embedding cost (agent declares paths)
|
|
205
|
+
one --agent sync init attio attioPeople --config '{
|
|
206
|
+
"memory": {
|
|
207
|
+
"embed": true,
|
|
208
|
+
"searchable": [
|
|
209
|
+
"values.name[0].full_name",
|
|
210
|
+
"values.job_title[0].value",
|
|
211
|
+
"values.description[0].value",
|
|
212
|
+
"values.email_addresses[0].email_address"
|
|
213
|
+
]
|
|
214
|
+
}
|
|
215
|
+
}'
|
|
216
|
+
# Skip the "pick paths by reading knowledge" step — let the CLI rank them from a live sample
|
|
217
|
+
one --agent sync suggest-searchable attio/attioPeople
|
|
218
|
+
# → { suggestions: [{path, score, hitRate, avgLength, noiseFraction, sampleValue}], configPatch: {...paste-ready...} }
|
|
219
|
+
|
|
220
|
+
one --agent sync test attio/attioPeople --show-searchable
|
|
221
|
+
# → Previews across 5 samples. Each path has { hits, total, sample }:
|
|
222
|
+
# 5/5 = path resolves on every record (clean)
|
|
223
|
+
# 1/5 = field is real but sparse on this page
|
|
224
|
+
# 0/5 = typo, or field never populated in sampled records
|
|
225
|
+
# Iterate until the numbers match intent.
|
|
226
|
+
|
|
227
|
+
# Run — memory is always written; pass --no-memory to skip (rare)
|
|
167
228
|
one --agent sync run stripe
|
|
168
229
|
one --agent sync query stripe/balanceTransactions --where "status=available" --limit 20
|
|
169
|
-
one --agent sync search "refund" #
|
|
230
|
+
one --agent sync search "refund" # hybrid across all synced platforms
|
|
170
231
|
one --agent sync list stripe # progress + freshness
|
|
171
232
|
|
|
172
233
|
# Schedule unattended syncs
|
|
173
234
|
one sync schedule add stripe --every 1h
|
|
174
235
|
```
|
|
175
236
|
|
|
237
|
+
### memory.searchable paths
|
|
238
|
+
|
|
239
|
+
Declared on the profile, drives what gets embedded + FTS-indexed. Supports numeric indexes AND `[]` wildcards for array fan-out:
|
|
240
|
+
|
|
241
|
+
```
|
|
242
|
+
values.name[0].full_name # numeric index (first element)
|
|
243
|
+
messages[].snippet # wildcard — every element's .snippet
|
|
244
|
+
messages[].payload.parts[].body.data # nested wildcards
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
Without declared paths, the default walker concatenates every string in the record — correct but often noisy for hierarchical APIs (Attio, HubSpot). **Always declare paths for any profile with `embed: true`.**
|
|
248
|
+
|
|
176
249
|
**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.
|
|
177
250
|
|
|
178
251
|
**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. Don't hardcode connection keys in profiles.
|
|
179
252
|
|
|
180
|
-
**Advanced features** (enrich, transform, exclude, identityKey, hooks, --full-refresh,
|
|
253
|
+
**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.
|
|
181
254
|
|
|
182
255
|
## Beyond Single Actions
|
|
183
256
|
|