@withone/cli 2.10.0 → 2.11.1
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 +3 -3
- package/dist/{chunk-PUQKTRYC.js → chunk-5O5OUAHJ.js} +2 -2
- package/dist/{chunk-HTXZZQ6U.js → chunk-FR4VGZUI.js} +22 -1
- package/dist/{chunk-3HRC3IPE.js → chunk-NC3HVQ7O.js} +1 -1
- package/dist/{chunk-5CPQHXTO.js → chunk-RUVW6QYK.js} +2 -2
- package/dist/{chunk-NOPTG4GC.js → chunk-UYOXEMF5.js} +2 -2
- package/dist/{chunk-VMFWA43Q.js → chunk-VYOIHD4B.js} +2 -2
- package/dist/{chunk-O3HDWHHS.js → chunk-WWPH6JOO.js} +2 -2
- package/dist/{embedding-C7FIKORV.js → embedding-MVPO6QW7.js} +2 -2
- package/dist/{flow-runner-P23IZDWM.js → flow-runner-36I4G5BS.js} +2 -2
- package/dist/index.js +51 -26
- package/dist/{migrate-KWEEEQ3E.js → migrate-IKK2N3VW.js} +5 -5
- package/dist/{runtime-HLW365HP.js → runtime-J4TQCY7Z.js} +3 -3
- package/dist/{schema-YJ7JTGFL.js → schema-JKYKFQZD.js} +4 -4
- package/dist/sql-XCMEVSVD.js +13 -0
- package/package.json +1 -1
- package/skills/one/SKILL.md +2 -2
- package/dist/sql-NDMMFQP6.js +0 -13
package/README.md
CHANGED
|
@@ -529,14 +529,14 @@ Commit `.agents/skills/one-connect` and the agent links so your team's agents sh
|
|
|
529
529
|
|
|
530
530
|
### `one connect`
|
|
531
531
|
|
|
532
|
-
Create and update a [One Connect](https://www.npmjs.com/package/@withone/connect) app from `one.connect.ts`, typed by `defineConnectApp` from `@withone/connect/config` (0.
|
|
532
|
+
Create and update a [One Connect](https://www.npmjs.com/package/@withone/connect) app from `one.connect.ts`, typed by `defineConnectApp` from `@withone/connect/config` (0.20.0 or later).
|
|
533
533
|
|
|
534
534
|
```bash
|
|
535
535
|
one connect types # writes one-connect-env.d.ts: tool slugs and action names autocomplete
|
|
536
536
|
one connect create # approve the app in the browser; re-run to review and apply changes
|
|
537
537
|
```
|
|
538
538
|
|
|
539
|
-
`one connect create` opens a setup page in your signed-in browser, where you review the app (or, on a re-run, its new version) and approve it; nothing is created or changed with your API key. A new app's client secret and connect key are made there and shown once, so they never pass through the terminal. Once you approve, the CLI writes `ONE_CLIENT_ID`, `
|
|
539
|
+
`one connect create` opens a setup page in your signed-in browser, where you review the app (or, on a re-run, its new version) and approve it; nothing is created or changed with your API key. A new app's client secret and connect key are made there and shown once, so they never pass through the terminal. Once you approve, the CLI writes `ONE_CLIENT_ID`, `ONE_REDIRECT_URI` and, for a list of tools, `ONE_PERMISSION_SET` to `.env.local` (or `.env`). `ask` is required: either the tools, where each takes `access` (`read-only`, `read-write`, `full-access`, or `custom` with `actions`, named as `one connect types` wrote them or by id from `one actions find <platform> "<what it does>" --no-knowledge`), or `"everything"`, where users see every connection they have and can connect any other app. An app switched to `"everything"` loses its ask, and the CLI removes `ONE_PERMISSION_SET` from the env file. Options: `--config <file>`, `--env-file <file>`, `--no-open`. Install `@withone/connect` (0.20.0 or later) in the project first. A `.ts` config needs Node 22.18 or later; on older Node use `one.connect.mjs`.
|
|
540
540
|
|
|
541
541
|
### `one guide [topic]`
|
|
542
542
|
|
|
@@ -738,7 +738,7 @@ Drop a `.onerc` file in your project root to override global settings per-projec
|
|
|
738
738
|
| Key | Purpose |
|
|
739
739
|
|-----|---------|
|
|
740
740
|
| `ONE_SECRET` | API key (also honored as env var) |
|
|
741
|
-
| `ONE_API_BASE` | API base URL
|
|
741
|
+
| `ONE_API_BASE` | API base URL, `https://api.withone.ai` or `https://development-api.withone.ai` only (the env var accepts any origin) |
|
|
742
742
|
| `ONE_PERMISSIONS` | `admin` / `write` / `read` |
|
|
743
743
|
| `ONE_CONNECTION_KEYS` | Comma-separated connection-key allowlist |
|
|
744
744
|
| `ONE_ACTION_IDS` | Comma-separated action-ID allowlist |
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
okJson,
|
|
6
6
|
requireMemoryInit
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-VYOIHD4B.js";
|
|
8
8
|
import {
|
|
9
9
|
isAgentMode,
|
|
10
10
|
note
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
getBackend,
|
|
14
14
|
upsertRecord
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-UYOXEMF5.js";
|
|
16
16
|
|
|
17
17
|
// src/commands/mem/migrate.ts
|
|
18
18
|
import fs4 from "fs";
|
|
@@ -180,11 +180,32 @@ function getAccessControl() {
|
|
|
180
180
|
return readConfig()?.accessControl ?? {};
|
|
181
181
|
}
|
|
182
182
|
var DEFAULT_API_BASE = "https://api.withone.ai/v1";
|
|
183
|
+
var ONERC_API_HOSTS = /* @__PURE__ */ new Set(["api.withone.ai", "development-api.withone.ai"]);
|
|
184
|
+
function isHostedApiOrigin(value) {
|
|
185
|
+
try {
|
|
186
|
+
const url = new URL(value);
|
|
187
|
+
return url.protocol === "https:" && ONERC_API_HOSTS.has(url.hostname) && url.port === "" && url.username === "" && url.password === "";
|
|
188
|
+
} catch {
|
|
189
|
+
return false;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
var warnedOneRcApiBase = false;
|
|
193
|
+
function warnIgnoredOneRcApiBase(value) {
|
|
194
|
+
if (warnedOneRcApiBase) return;
|
|
195
|
+
warnedOneRcApiBase = true;
|
|
196
|
+
process.stderr.write(
|
|
197
|
+
`Ignoring ONE_API_BASE=${value} from .onerc: only ${[...ONERC_API_HOSTS].map((h) => `https://${h}`).join(" and ")} are allowed there. Set ONE_API_BASE in the environment or apiBase in config for another backend.
|
|
198
|
+
`
|
|
199
|
+
);
|
|
200
|
+
}
|
|
183
201
|
function getApiBase() {
|
|
184
202
|
const override = process.env.ONE_API_BASE?.trim();
|
|
185
203
|
if (override) return withV1(override);
|
|
186
204
|
const rc = readOneRc().ONE_API_BASE?.trim();
|
|
187
|
-
if (rc)
|
|
205
|
+
if (rc) {
|
|
206
|
+
if (isHostedApiOrigin(rc)) return withV1(rc);
|
|
207
|
+
warnIgnoredOneRcApiBase(rc);
|
|
208
|
+
}
|
|
188
209
|
const config = readConfig();
|
|
189
210
|
if (config?.apiBase) return withV1(config.apiBase);
|
|
190
211
|
return DEFAULT_API_BASE;
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
writeAnalyticsQueue,
|
|
25
25
|
writeUsageLog,
|
|
26
26
|
writeUsageState
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-FR4VGZUI.js";
|
|
28
28
|
|
|
29
29
|
// src/lib/flow-runner.ts
|
|
30
30
|
import fs5 from "fs";
|
|
@@ -2977,7 +2977,7 @@ async function executeSubflowStep(step, context, api, permissions, allowedAction
|
|
|
2977
2977
|
if (flowStack.includes(resolvedKey)) {
|
|
2978
2978
|
throw new Error(`Circular flow detected: ${[...flowStack, resolvedKey].join(" \u2192 ")}`);
|
|
2979
2979
|
}
|
|
2980
|
-
const { loadFlowWithMeta: loadFlowWithMeta2 } = await import("./flow-runner-
|
|
2980
|
+
const { loadFlowWithMeta: loadFlowWithMeta2 } = await import("./flow-runner-36I4G5BS.js");
|
|
2981
2981
|
const { flow: subFlow, rootDir: subRootDir } = loadFlowWithMeta2(resolvedKey);
|
|
2982
2982
|
const subContext = await executeFlow(
|
|
2983
2983
|
subFlow,
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
getMemoryConfig,
|
|
6
6
|
getMemoryConfigOrDefault,
|
|
7
7
|
updateMemoryConfig
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-NC3HVQ7O.js";
|
|
9
9
|
import {
|
|
10
10
|
getOpenAiApiKey,
|
|
11
11
|
homeDir
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-FR4VGZUI.js";
|
|
13
13
|
|
|
14
14
|
// src/lib/memory/schema.ts
|
|
15
15
|
var SCHEMA_VERSION = "2.3.1";
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
} from "./chunk-Q6PWTATS.js";
|
|
6
6
|
import {
|
|
7
7
|
getMemoryConfigOrDefault
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-NC3HVQ7O.js";
|
|
9
9
|
import {
|
|
10
10
|
getOpenAiApiKey,
|
|
11
11
|
readConfig
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-FR4VGZUI.js";
|
|
13
13
|
|
|
14
14
|
// src/commands/mem/util.ts
|
|
15
15
|
function requireMemoryInit() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
requireMemoryInit
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VYOIHD4B.js";
|
|
4
4
|
import {
|
|
5
5
|
error,
|
|
6
6
|
isAgentMode,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./chunk-Q6PWTATS.js";
|
|
9
9
|
import {
|
|
10
10
|
getBackend
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-UYOXEMF5.js";
|
|
12
12
|
|
|
13
13
|
// src/commands/mem/sql.ts
|
|
14
14
|
async function memSqlCommand(sql) {
|
|
@@ -12,10 +12,10 @@ import {
|
|
|
12
12
|
stripStepsAlias,
|
|
13
13
|
summarizeFlowInputs,
|
|
14
14
|
walkSteps
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-RUVW6QYK.js";
|
|
16
16
|
import "./chunk-44CV5IMX.js";
|
|
17
17
|
import "./chunk-Q6PWTATS.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-FR4VGZUI.js";
|
|
19
19
|
export {
|
|
20
20
|
FlowRunner,
|
|
21
21
|
collectStepTypes,
|
package/dist/index.js
CHANGED
|
@@ -42,10 +42,10 @@ import {
|
|
|
42
42
|
validateActionInput,
|
|
43
43
|
walkSteps,
|
|
44
44
|
writeCache
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-RUVW6QYK.js";
|
|
46
46
|
import {
|
|
47
47
|
memSqlCommand
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-WWPH6JOO.js";
|
|
49
49
|
import {
|
|
50
50
|
collectIdentityKeys,
|
|
51
51
|
countRecords,
|
|
@@ -76,7 +76,7 @@ import {
|
|
|
76
76
|
writeDraftProfile,
|
|
77
77
|
writePageToMemory,
|
|
78
78
|
writeProfile
|
|
79
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-5O5OUAHJ.js";
|
|
80
80
|
import {
|
|
81
81
|
getByDotPath
|
|
82
82
|
} from "./chunk-44CV5IMX.js";
|
|
@@ -90,7 +90,7 @@ import {
|
|
|
90
90
|
requireMemoryInit,
|
|
91
91
|
semanticSearchUpgradeHint,
|
|
92
92
|
semanticSearchUpgradeLine
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-VYOIHD4B.js";
|
|
94
94
|
import {
|
|
95
95
|
cancel,
|
|
96
96
|
createSpinner,
|
|
@@ -112,7 +112,7 @@ import {
|
|
|
112
112
|
listBackendPlugins,
|
|
113
113
|
loadBackendFromConfig,
|
|
114
114
|
updateRecord
|
|
115
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-UYOXEMF5.js";
|
|
116
116
|
import {
|
|
117
117
|
DEFAULT_MEMORY_CONFIG,
|
|
118
118
|
defaultSearchableText,
|
|
@@ -122,7 +122,7 @@ import {
|
|
|
122
122
|
memoryConfigExists,
|
|
123
123
|
setOpenAiApiKey,
|
|
124
124
|
updateMemoryConfig
|
|
125
|
-
} from "./chunk-
|
|
125
|
+
} from "./chunk-NC3HVQ7O.js";
|
|
126
126
|
import {
|
|
127
127
|
configExists,
|
|
128
128
|
ensureWhoAmI,
|
|
@@ -148,7 +148,7 @@ import {
|
|
|
148
148
|
updateApiBase,
|
|
149
149
|
updateWhoAmI,
|
|
150
150
|
writeConfig
|
|
151
|
-
} from "./chunk-
|
|
151
|
+
} from "./chunk-FR4VGZUI.js";
|
|
152
152
|
|
|
153
153
|
// src/cli.ts
|
|
154
154
|
import { createRequire } from "module";
|
|
@@ -6015,6 +6015,9 @@ import zlib from "zlib";
|
|
|
6015
6015
|
import { pathToFileURL } from "url";
|
|
6016
6016
|
var CONFIG_FILES = ["one.connect.ts", "one.connect.mts", "one.connect.mjs", "one.connect.js"];
|
|
6017
6017
|
var TYPES_FILE = "one-connect-env.d.ts";
|
|
6018
|
+
function askedTools(config2) {
|
|
6019
|
+
return config2.ask === "everything" ? [] : Object.entries(config2.ask ?? {});
|
|
6020
|
+
}
|
|
6018
6021
|
var ACCESS_METHODS = {
|
|
6019
6022
|
"read-only": ["GET"],
|
|
6020
6023
|
"read-write": ["GET", "POST", "PUT", "PATCH"],
|
|
@@ -6077,7 +6080,18 @@ function validateConfig(value) {
|
|
|
6077
6080
|
if (!HEX_COLOR.test(String(v.branding[key] ?? ""))) errors.push(`\`branding.${key}\` must be a #RRGGBB colour.`);
|
|
6078
6081
|
}
|
|
6079
6082
|
}
|
|
6080
|
-
|
|
6083
|
+
const asked = v.ask;
|
|
6084
|
+
if (asked === void 0) {
|
|
6085
|
+
errors.push('`ask` is required: name the tools the app asks for, or write `ask: "everything"`.');
|
|
6086
|
+
} else if (typeof asked === "string") {
|
|
6087
|
+
if (asked !== "everything") errors.push(`\`ask\` is "${asked}"; it must be a map of tools or "everything".`);
|
|
6088
|
+
} else if (!asked || typeof asked !== "object" || Array.isArray(asked)) {
|
|
6089
|
+
errors.push('`ask` must be a map of tools or "everything".');
|
|
6090
|
+
} else if (Object.keys(asked).length === 0) {
|
|
6091
|
+
errors.push('`ask` names no tools. Name at least one, or write `ask: "everything"`.');
|
|
6092
|
+
}
|
|
6093
|
+
const tools = asked && typeof asked === "object" && !Array.isArray(asked) ? Object.entries(asked) : [];
|
|
6094
|
+
for (const [tool, ask] of tools) {
|
|
6081
6095
|
const access = ask?.access;
|
|
6082
6096
|
if (access === "custom") {
|
|
6083
6097
|
const actions2 = ask.actions;
|
|
@@ -6134,7 +6148,11 @@ function clientFields(config2) {
|
|
|
6134
6148
|
return fields;
|
|
6135
6149
|
}
|
|
6136
6150
|
function buildHandoff(config2, rules) {
|
|
6137
|
-
return {
|
|
6151
|
+
return {
|
|
6152
|
+
v: 2,
|
|
6153
|
+
app: clientFields(config2),
|
|
6154
|
+
ask: config2.ask === "everything" ? { kind: "everything" } : { kind: "tools", rules }
|
|
6155
|
+
};
|
|
6138
6156
|
}
|
|
6139
6157
|
function encodeHandoff(handoff) {
|
|
6140
6158
|
return zlib.deflateRawSync(Buffer.from(JSON.stringify(handoff), "utf8"), { level: 9 }).toString("base64url");
|
|
@@ -6165,6 +6183,10 @@ function upsertEnv(text5, values) {
|
|
|
6165
6183
|
return `${next}${separator}${appended.join("\n")}
|
|
6166
6184
|
`;
|
|
6167
6185
|
}
|
|
6186
|
+
function removeEnvKeys(text5, keys) {
|
|
6187
|
+
return keys.reduce((next, key) => next.replace(new RegExp(`^${key}=.*(?:\r?
|
|
6188
|
+
|$)`, "m"), ""), text5);
|
|
6189
|
+
}
|
|
6168
6190
|
function renderTypes(tools, actionsByTool) {
|
|
6169
6191
|
const literal = (value) => JSON.stringify(value);
|
|
6170
6192
|
const union = (values) => values.length > 0 ? values.map(literal).join(" | ") : "never";
|
|
@@ -6214,7 +6236,7 @@ function message(error2) {
|
|
|
6214
6236
|
return error2 instanceof Error ? error2.message : String(error2);
|
|
6215
6237
|
}
|
|
6216
6238
|
async function buildRules(api, config2) {
|
|
6217
|
-
const asked =
|
|
6239
|
+
const asked = askedTools(config2);
|
|
6218
6240
|
if (asked.length === 0) return [];
|
|
6219
6241
|
const platforms = await api.listPlatforms();
|
|
6220
6242
|
const idBySlug = new Map(platforms.map((p9) => [p9.platform, p9.id]));
|
|
@@ -6302,19 +6324,21 @@ async function connectCreateCommand(options) {
|
|
|
6302
6324
|
if (outcome.kind === "cancelled") error("Cancelled in the browser. Nothing was changed.");
|
|
6303
6325
|
if (outcome.kind === "failed") error(`The setup page reported: ${outcome.reason}`);
|
|
6304
6326
|
const created = outcome.outcome === "created";
|
|
6327
|
+
const asksForEverything = config2.ask === "everything";
|
|
6305
6328
|
fs6.writeFileSync(
|
|
6306
6329
|
envFile,
|
|
6307
|
-
upsertEnv(envText, {
|
|
6330
|
+
upsertEnv(asksForEverything ? removeEnvKeys(envText, ["ONE_PERMISSION_SET"]) : envText, {
|
|
6308
6331
|
ONE_CLIENT_ID: outcome.clientId,
|
|
6309
6332
|
ONE_REDIRECT_URI: config2.redirectUris[0],
|
|
6310
|
-
|
|
6333
|
+
...!asksForEverything && outcome.permissionSetId ? { ONE_PERMISSION_SET: outcome.permissionSetId } : {},
|
|
6311
6334
|
...created ? { ONE_CLIENT_SECRET: null, ONE_CONNECT_KEY: null } : {}
|
|
6312
6335
|
})
|
|
6313
6336
|
);
|
|
6314
6337
|
const result = {
|
|
6315
6338
|
outcome: outcome.outcome,
|
|
6316
6339
|
clientId: outcome.clientId,
|
|
6317
|
-
permissionSetId: outcome.permissionSetId,
|
|
6340
|
+
permissionSetId: asksForEverything ? null : outcome.permissionSetId,
|
|
6341
|
+
asksForEverything,
|
|
6318
6342
|
redirectUris: config2.redirectUris,
|
|
6319
6343
|
envFile: path6.relative(cwd, envFile) || envFile
|
|
6320
6344
|
};
|
|
@@ -6327,7 +6351,8 @@ async function connectCreateCommand(options) {
|
|
|
6327
6351
|
);
|
|
6328
6352
|
console.log();
|
|
6329
6353
|
console.log(` ${pc10.dim("Client ID:")} ${outcome.clientId}`);
|
|
6330
|
-
if (
|
|
6354
|
+
if (asksForEverything) console.log(` ${pc10.dim("Asks for:")} everything the user has connected`);
|
|
6355
|
+
else if (outcome.permissionSetId) console.log(` ${pc10.dim("Permission set:")} ${outcome.permissionSetId}`);
|
|
6331
6356
|
console.log(` ${pc10.dim("Wrote")} ${result.envFile}`);
|
|
6332
6357
|
if (created) {
|
|
6333
6358
|
console.log(` ${pc10.dim("The two secrets came from the browser page, never through here.")}`);
|
|
@@ -6349,7 +6374,7 @@ async function connectTypesCommand(options) {
|
|
|
6349
6374
|
try {
|
|
6350
6375
|
const file = findConfigFile(cwd, options.config);
|
|
6351
6376
|
const config2 = file ? validateConfig(await loadConfigFile(file)) : null;
|
|
6352
|
-
const tools =
|
|
6377
|
+
const tools = config2 && "config" in config2 ? askedTools(config2.config).map(([slug]) => slug) : [];
|
|
6353
6378
|
const platforms = await api.listPlatforms();
|
|
6354
6379
|
const known = new Set(platforms.map((p9) => p9.platform));
|
|
6355
6380
|
const actionsByTool = {};
|
|
@@ -7402,7 +7427,7 @@ async function syncModel(api, profile, options) {
|
|
|
7402
7427
|
updateModelState(platform, model, { status: "failed", pagesProcessed, lastCursor }),
|
|
7403
7428
|
(async () => {
|
|
7404
7429
|
try {
|
|
7405
|
-
const { getBackend: getBackend2 } = await import("./runtime-
|
|
7430
|
+
const { getBackend: getBackend2 } = await import("./runtime-J4TQCY7Z.js");
|
|
7406
7431
|
const backend = await getBackend2();
|
|
7407
7432
|
await Promise.race([
|
|
7408
7433
|
backend.close(),
|
|
@@ -7768,7 +7793,7 @@ async function syncModel(api, profile, options) {
|
|
|
7768
7793
|
db.exec(`DROP TABLE IF EXISTS _seen_ids`);
|
|
7769
7794
|
}
|
|
7770
7795
|
if (options.toMemory !== false) {
|
|
7771
|
-
const backend = await (await import("./runtime-
|
|
7796
|
+
const backend = await (await import("./runtime-J4TQCY7Z.js")).getBackend();
|
|
7772
7797
|
const type = `${platform}/${model}`;
|
|
7773
7798
|
const existing = await backend.listKeysByType(type);
|
|
7774
7799
|
const sourcePrefix = `${type}:`;
|
|
@@ -7869,7 +7894,7 @@ async function syncModel(api, profile, options) {
|
|
|
7869
7894
|
let statusCounts;
|
|
7870
7895
|
if (options.toMemory !== false) {
|
|
7871
7896
|
try {
|
|
7872
|
-
const backend = await (await import("./runtime-
|
|
7897
|
+
const backend = await (await import("./runtime-J4TQCY7Z.js")).getBackend();
|
|
7873
7898
|
const typeName = `${platform}/${model}`;
|
|
7874
7899
|
const [active, archived] = await Promise.all([
|
|
7875
7900
|
backend.count(typeName, { status: "active" }),
|
|
@@ -9591,7 +9616,7 @@ ${result.total} results`);
|
|
|
9591
9616
|
}
|
|
9592
9617
|
}
|
|
9593
9618
|
async function syncSqlCommand(platformModel, sql) {
|
|
9594
|
-
const { syncSqlCommand: runSyncSql } = await import("./sql-
|
|
9619
|
+
const { syncSqlCommand: runSyncSql } = await import("./sql-XCMEVSVD.js");
|
|
9595
9620
|
await runSyncSql(platformModel, sql);
|
|
9596
9621
|
}
|
|
9597
9622
|
async function syncDeleteCommand(platformModel, options) {
|
|
@@ -9669,7 +9694,7 @@ async function syncDeleteCommand(platformModel, options) {
|
|
|
9669
9694
|
async function maybeAutoMigrateLegacy(platform, models) {
|
|
9670
9695
|
const dbSize = getDatabaseSize(platform);
|
|
9671
9696
|
if (!dbSize || dbSize === "0 B") return;
|
|
9672
|
-
const { getBackend: getBackend2 } = await import("./runtime-
|
|
9697
|
+
const { getBackend: getBackend2 } = await import("./runtime-J4TQCY7Z.js");
|
|
9673
9698
|
const backend = await getBackend2();
|
|
9674
9699
|
let memoryHasData = false;
|
|
9675
9700
|
for (const model of models) {
|
|
@@ -9685,7 +9710,7 @@ async function maybeAutoMigrateLegacy(platform, models) {
|
|
|
9685
9710
|
` detected legacy .one/sync/data/${platform}.db (${dbSize}) \u2014 auto-migrating into memory before sync.
|
|
9686
9711
|
`
|
|
9687
9712
|
);
|
|
9688
|
-
const { memMigrateCommand: memMigrateCommand3 } = await import("./migrate-
|
|
9713
|
+
const { memMigrateCommand: memMigrateCommand3 } = await import("./migrate-IKK2N3VW.js");
|
|
9689
9714
|
await memMigrateCommand3({ platform, yes: true });
|
|
9690
9715
|
return;
|
|
9691
9716
|
}
|
|
@@ -9694,7 +9719,7 @@ async function maybeAutoMigrateLegacy(platform, models) {
|
|
|
9694
9719
|
initialValue: true
|
|
9695
9720
|
});
|
|
9696
9721
|
if (p6.isCancel(shouldMigrate) || !shouldMigrate) return;
|
|
9697
|
-
const { memMigrateCommand: memMigrateCommand2 } = await import("./migrate-
|
|
9722
|
+
const { memMigrateCommand: memMigrateCommand2 } = await import("./migrate-IKK2N3VW.js");
|
|
9698
9723
|
await memMigrateCommand2({ platform, yes: true });
|
|
9699
9724
|
}
|
|
9700
9725
|
async function syncSuggestSearchableCommand(platformModel, options = {}) {
|
|
@@ -9755,7 +9780,7 @@ async function syncSuggestSearchableCommand(platformModel, options = {}) {
|
|
|
9755
9780
|
async function syncListCommand(platform) {
|
|
9756
9781
|
const profiles = listProfiles(platform);
|
|
9757
9782
|
const state = await readSyncState();
|
|
9758
|
-
const { getBackend: getBackend2 } = await import("./runtime-
|
|
9783
|
+
const { getBackend: getBackend2 } = await import("./runtime-J4TQCY7Z.js");
|
|
9759
9784
|
const backend = await getBackend2();
|
|
9760
9785
|
const syncs = await Promise.all(profiles.map(async (p9) => {
|
|
9761
9786
|
const modelState = state[p9.platform]?.[p9.model];
|
|
@@ -10031,7 +10056,7 @@ function registerSyncSubcommands(sync) {
|
|
|
10031
10056
|
await syncSqlCommand(platformModel, sql);
|
|
10032
10057
|
});
|
|
10033
10058
|
sync.command("schema <platform/model>").description("Inspect the JSON structure of synced records (field paths, types, examples) \u2014 useful before writing `sync sql` queries").action(async (platformModel) => {
|
|
10034
|
-
const { syncSchemaCommand } = await import("./schema-
|
|
10059
|
+
const { syncSchemaCommand } = await import("./schema-JKYKFQZD.js");
|
|
10035
10060
|
await syncSchemaCommand(platformModel);
|
|
10036
10061
|
});
|
|
10037
10062
|
sync.command("delete <platform/model>").description('Delete records from local sync data (e.g. one sync delete notion/pages --id "abc-123")').option("--id <value>", "Delete record by ID").option("--where <conditions>", 'Delete records matching conditions (e.g. "status=archived")').option("--where-sql <predicate>", `Delete using a raw SQL WHERE clause (e.g. "json_extract(data, '$.type') = 'promotion'")`).option("--yes", "Skip confirmation prompt").action(async (platformModel, options) => {
|
|
@@ -10808,7 +10833,7 @@ async function memDoctorCommand() {
|
|
|
10808
10833
|
}
|
|
10809
10834
|
if (cfg.embedding.provider === "openai") {
|
|
10810
10835
|
try {
|
|
10811
|
-
const { embed: embed2 } = await import("./embedding-
|
|
10836
|
+
const { embed: embed2 } = await import("./embedding-MVPO6QW7.js");
|
|
10812
10837
|
const result = await embed2("connectivity check");
|
|
10813
10838
|
checks.push({
|
|
10814
10839
|
name: "OpenAI embedding provider reachable",
|
|
@@ -11380,7 +11405,7 @@ one --agent relay deliveries --endpoint-id <id> # Check delivery
|
|
|
11380
11405
|
- Use \`actions find\` (and \`actions load\` for more) to learn both the incoming payload shape AND the destination API shape before building templates
|
|
11381
11406
|
|
|
11382
11407
|
### One Connect apps \u2014 created from \`one.connect.ts\`
|
|
11383
|
-
\`one connect create\` reads \`one.connect.ts\`, typed by \`defineConnectApp\` from \`@withone/connect/config\` (install \`@withone/connect\` 0.
|
|
11408
|
+
\`one connect create\` reads \`one.connect.ts\`, typed by \`defineConnectApp\` from \`@withone/connect/config\` (install \`@withone/connect\` 0.20.0 or later in the project first), and opens a setup page where the human reviews the app (or, once .env holds its \`ONE_CLIENT_ID\`, its new version) and approves it with their dashboard session; an API key never creates or changes a Connect app. A new app's client secret and connect key are made and shown there once; the CLI never receives them. It waits up to 10 minutes, then writes \`ONE_CLIENT_ID\`, \`ONE_REDIRECT_URI\` and, for a list of tools, \`ONE_PERMISSION_SET\` to the env file. \`one connect types\` writes \`one-connect-env.d.ts\` so tool slugs and action names autocomplete. \`ask\` is required: the tools, each with \`access\` \`read-only\`, \`read-write\`, \`full-access\`, or \`custom\` with \`actions\` (names, or ids from \`actions find\`), or \`"everything"\`, which asks for every connection the user has and removes \`ONE_PERMISSION_SET\` from the env file.
|
|
11384
11409
|
|
|
11385
11410
|
### 4. Memory + Sync \u2014 Unified store with hybrid FTS + semantic search
|
|
11386
11411
|
One ships a local memory store (a real Postgres process bootstrapped on demand via the bundled \`embedded-postgres\` plugin, with a \`postgres\` plugin for remote/self-hosted) that backs both user-authored notes (\`one mem add\`) and synced platform data (\`one sync run\`). Auto-initializes on first use \u2014 no separate install step. Run \`one guide memory\` and \`one guide sync\` for the full references.
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
dotPathToJsonbExpr,
|
|
4
4
|
memMigrateCommand,
|
|
5
5
|
reviveStringifiedJson
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5O5OUAHJ.js";
|
|
7
7
|
import "./chunk-44CV5IMX.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-VYOIHD4B.js";
|
|
9
9
|
import "./chunk-Q6PWTATS.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-UYOXEMF5.js";
|
|
11
|
+
import "./chunk-NC3HVQ7O.js";
|
|
12
|
+
import "./chunk-FR4VGZUI.js";
|
|
13
13
|
export {
|
|
14
14
|
buildIdentityMap,
|
|
15
15
|
dotPathToJsonbExpr,
|
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
resetBackendSingleton,
|
|
6
6
|
updateRecord,
|
|
7
7
|
upsertRecord
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-UYOXEMF5.js";
|
|
9
|
+
import "./chunk-NC3HVQ7O.js";
|
|
10
|
+
import "./chunk-FR4VGZUI.js";
|
|
11
11
|
export {
|
|
12
12
|
addRecord,
|
|
13
13
|
closeBackendIfCached,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
okJson,
|
|
3
3
|
requireMemoryInit
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-VYOIHD4B.js";
|
|
5
5
|
import {
|
|
6
6
|
isAgentMode,
|
|
7
7
|
note
|
|
8
8
|
} from "./chunk-Q6PWTATS.js";
|
|
9
9
|
import {
|
|
10
10
|
getBackend
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-UYOXEMF5.js";
|
|
12
|
+
import "./chunk-NC3HVQ7O.js";
|
|
13
|
+
import "./chunk-FR4VGZUI.js";
|
|
14
14
|
|
|
15
15
|
// src/lib/memory/sync/schema.ts
|
|
16
16
|
import pc from "picocolors";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
memSqlCommand,
|
|
3
|
+
syncSqlCommand
|
|
4
|
+
} from "./chunk-WWPH6JOO.js";
|
|
5
|
+
import "./chunk-VYOIHD4B.js";
|
|
6
|
+
import "./chunk-Q6PWTATS.js";
|
|
7
|
+
import "./chunk-UYOXEMF5.js";
|
|
8
|
+
import "./chunk-NC3HVQ7O.js";
|
|
9
|
+
import "./chunk-FR4VGZUI.js";
|
|
10
|
+
export {
|
|
11
|
+
memSqlCommand,
|
|
12
|
+
syncSqlCommand
|
|
13
|
+
};
|
package/package.json
CHANGED
package/skills/one/SKILL.md
CHANGED
|
@@ -377,10 +377,10 @@ To create the Connect app itself without the dashboard, install `@withone/connec
|
|
|
377
377
|
|
|
378
378
|
```bash
|
|
379
379
|
one --agent connect types # tool slugs and action names autocomplete in one.connect.ts
|
|
380
|
-
one --agent connect create # the human approves it in the browser; then writes ONE_CLIENT_ID, ONE_PERMISSION_SET
|
|
380
|
+
one --agent connect create # the human approves it in the browser; then writes ONE_CLIENT_ID, ONE_REDIRECT_URI and (for a list of tools) ONE_PERMISSION_SET to .env
|
|
381
381
|
```
|
|
382
382
|
|
|
383
|
-
It opens a setup page in the human's browser and waits up to 10 minutes, so run it in the background or with a long timeout; the link is printed to stderr at once, so pass it on if no browser opened. The human reviews the app (or, on a re-run, its new version) and approves it with their dashboard session: an API key never creates or changes a Connect app. For a new app the page also makes `ONE_CLIENT_SECRET` and `ONE_CONNECT_KEY` and shows them once; tell the human to copy them into the env file the result names. The CLI never receives either secret. Run `connect create` again after editing the file to update the same app.
|
|
383
|
+
It opens a setup page in the human's browser and waits up to 10 minutes, so run it in the background or with a long timeout; the link is printed to stderr at once, so pass it on if no browser opened. The human reviews the app (or, on a re-run, its new version) and approves it with their dashboard session: an API key never creates or changes a Connect app. For a new app the page also makes `ONE_CLIENT_SECRET` and `ONE_CONNECT_KEY` and shows them once; tell the human to copy them into the env file the result names. The CLI never receives either secret. Run `connect create` again after editing the file to update the same app. `ask` is required: the tools the app asks for, or `"everything"` (users see every connection they have and can connect any other app; the CLI then removes `ONE_PERMISSION_SET` from the env file).
|
|
384
384
|
|
|
385
385
|
## Adding New Connections
|
|
386
386
|
|
package/dist/sql-NDMMFQP6.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
memSqlCommand,
|
|
3
|
-
syncSqlCommand
|
|
4
|
-
} from "./chunk-O3HDWHHS.js";
|
|
5
|
-
import "./chunk-VMFWA43Q.js";
|
|
6
|
-
import "./chunk-Q6PWTATS.js";
|
|
7
|
-
import "./chunk-NOPTG4GC.js";
|
|
8
|
-
import "./chunk-3HRC3IPE.js";
|
|
9
|
-
import "./chunk-HTXZZQ6U.js";
|
|
10
|
-
export {
|
|
11
|
-
memSqlCommand,
|
|
12
|
-
syncSqlCommand
|
|
13
|
-
};
|