@withone/cli 2.3.0 → 2.3.2

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.
@@ -3,7 +3,7 @@ import {
3
3
  readConfig,
4
4
  setOpenAiApiKey,
5
5
  writeConfig
6
- } from "./chunk-GGDXUXLM.js";
6
+ } from "./chunk-HTXZZQ6U.js";
7
7
 
8
8
  // src/lib/memory/config.ts
9
9
  var DEFAULT_MEMORY_CONFIG = {
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  getCacheTtl,
7
7
  homeDir
8
- } from "./chunk-GGDXUXLM.js";
8
+ } from "./chunk-HTXZZQ6U.js";
9
9
 
10
10
  // src/lib/flow-runner.ts
11
11
  import fs3 from "fs";
@@ -2285,7 +2285,7 @@ async function executeSubflowStep(step, context, api, permissions, allowedAction
2285
2285
  if (flowStack.includes(resolvedKey)) {
2286
2286
  throw new Error(`Circular flow detected: ${[...flowStack, resolvedKey].join(" \u2192 ")}`);
2287
2287
  }
2288
- const { loadFlowWithMeta: loadFlowWithMeta2 } = await import("./flow-runner-YGRRUARS.js");
2288
+ const { loadFlowWithMeta: loadFlowWithMeta2 } = await import("./flow-runner-SFECNAO2.js");
2289
2289
  const { flow: subFlow, rootDir: subRootDir } = loadFlowWithMeta2(resolvedKey);
2290
2290
  const subContext = await executeFlow(
2291
2291
  subFlow,
@@ -3,10 +3,10 @@ import {
3
3
  isAgentMode,
4
4
  json,
5
5
  requireMemoryInit
6
- } from "./chunk-5MDUKW5N.js";
6
+ } from "./chunk-NOFJ4NYD.js";
7
7
  import {
8
8
  getBackend
9
- } from "./chunk-Y5JEZWWM.js";
9
+ } from "./chunk-NOPTG4GC.js";
10
10
 
11
11
  // src/commands/mem/sql.ts
12
12
  async function memSqlCommand(sql) {
@@ -205,6 +205,12 @@ function updateApiBase(url) {
205
205
  delete config.whoamiApiBase;
206
206
  writeConfig(config);
207
207
  }
208
+ function withKnowledgeAgent(accessControl, on) {
209
+ const next = { ...accessControl };
210
+ if (on) next.knowledgeAgent = true;
211
+ else delete next.knowledgeAgent;
212
+ return Object.keys(next).length ? next : void 0;
213
+ }
208
214
  function saveCredentials(apiKey, scope, opts) {
209
215
  const existing = scope === "project" ? readProjectConfig() : readGlobalConfig();
210
216
  const next = {
@@ -217,7 +223,14 @@ function saveCredentials(apiKey, scope, opts) {
217
223
  };
218
224
  if (opts.keyName) next.apiKeyName = opts.keyName;
219
225
  else delete next.apiKeyName;
220
- if (opts.knowledgeOnly) next.accessControl = { ...existing?.accessControl, knowledgeAgent: true };
226
+ const userSetKnowledge = !!existing?.accessControl?.knowledgeAgent && !existing.knowledgeAgentFromGrant;
227
+ if (opts.knowledgeOnly !== void 0 && !userSetKnowledge) {
228
+ const accessControl = withKnowledgeAgent(existing?.accessControl, opts.knowledgeOnly);
229
+ if (accessControl) next.accessControl = accessControl;
230
+ else delete next.accessControl;
231
+ if (opts.knowledgeOnly) next.knowledgeAgentFromGrant = true;
232
+ else delete next.knowledgeAgentFromGrant;
233
+ }
221
234
  writeConfig(next, scope);
222
235
  }
223
236
  function getCacheTtl() {
@@ -250,6 +263,7 @@ function updateAccessControl(settings) {
250
263
  } else {
251
264
  config.accessControl = cleaned;
252
265
  }
266
+ delete config.knowledgeAgentFromGrant;
253
267
  writeConfig(config);
254
268
  }
255
269
  function getWhoAmI() {
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  getMemoryConfigOrDefault
3
- } from "./chunk-WMVVWO6N.js";
3
+ } from "./chunk-3HRC3IPE.js";
4
4
  import {
5
5
  getOpenAiApiKey,
6
6
  readConfig
7
- } from "./chunk-GGDXUXLM.js";
7
+ } from "./chunk-HTXZZQ6U.js";
8
8
 
9
9
  // src/lib/output.ts
10
10
  import * as p from "@clack/prompts";
@@ -23,13 +23,31 @@ function silenceWarningsInAgentMode() {
23
23
  process.emitWarning = (() => {
24
24
  });
25
25
  }
26
+ var SPINNER_CHROME = 6;
27
+ function fitSpinnerMessage(msg, columns) {
28
+ if (!columns || columns <= 0) return msg;
29
+ const room = columns - SPINNER_CHROME;
30
+ const chars = Array.from(msg);
31
+ if (chars.length <= room) return msg;
32
+ return room > 1 ? `${chars.slice(0, room - 1).join("")}\u2026` : "";
33
+ }
26
34
  function createSpinner() {
27
35
  if (isAgentMode()) {
28
36
  return { start() {
29
37
  }, stop() {
30
38
  } };
31
39
  }
32
- return p.spinner();
40
+ if (!process.stdout.isTTY) {
41
+ return {
42
+ start: (msg) => p.log.step(msg),
43
+ stop: (msg) => p.log.message(msg)
44
+ };
45
+ }
46
+ const spinner2 = p.spinner();
47
+ return {
48
+ start: (msg) => spinner2.start(fitSpinnerMessage(msg, process.stdout.columns)),
49
+ stop: (msg) => spinner2.stop(msg)
50
+ };
33
51
  }
34
52
  function intro2(msg) {
35
53
  if (!isAgentMode()) p.intro(msg);
@@ -5,11 +5,11 @@ import {
5
5
  getMemoryConfig,
6
6
  getMemoryConfigOrDefault,
7
7
  updateMemoryConfig
8
- } from "./chunk-WMVVWO6N.js";
8
+ } from "./chunk-3HRC3IPE.js";
9
9
  import {
10
10
  getOpenAiApiKey,
11
11
  homeDir
12
- } from "./chunk-GGDXUXLM.js";
12
+ } from "./chunk-HTXZZQ6U.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-5MDUKW5N.js";
9
+ } from "./chunk-NOFJ4NYD.js";
10
10
  import {
11
11
  getBackend,
12
12
  upsertRecord
13
- } from "./chunk-Y5JEZWWM.js";
13
+ } from "./chunk-NOPTG4GC.js";
14
14
 
15
15
  // src/commands/mem/migrate.ts
16
16
  import fs4 from "fs";
@@ -2,8 +2,8 @@ import {
2
2
  defaultSearchableText,
3
3
  embed,
4
4
  embedBatch
5
- } from "./chunk-WMVVWO6N.js";
6
- import "./chunk-GGDXUXLM.js";
5
+ } from "./chunk-3HRC3IPE.js";
6
+ import "./chunk-HTXZZQ6U.js";
7
7
  export {
8
8
  defaultSearchableText,
9
9
  embed,
@@ -12,9 +12,9 @@ import {
12
12
  stripStepsAlias,
13
13
  summarizeFlowInputs,
14
14
  walkSteps
15
- } from "./chunk-BWTPQPII.js";
15
+ } from "./chunk-6FA7KUNQ.js";
16
16
  import "./chunk-44CV5IMX.js";
17
- import "./chunk-GGDXUXLM.js";
17
+ import "./chunk-HTXZZQ6U.js";
18
18
  export {
19
19
  FlowRunner,
20
20
  collectStepTypes,
package/dist/index.js CHANGED
@@ -28,10 +28,10 @@ import {
28
28
  validateActionInput,
29
29
  walkSteps,
30
30
  writeCache
31
- } from "./chunk-BWTPQPII.js";
31
+ } from "./chunk-6FA7KUNQ.js";
32
32
  import {
33
33
  memSqlCommand
34
- } from "./chunk-V4LY2G2F.js";
34
+ } from "./chunk-7FPQOAQ4.js";
35
35
  import {
36
36
  collectIdentityKeys,
37
37
  countRecords,
@@ -62,7 +62,7 @@ import {
62
62
  writeDraftProfile,
63
63
  writePageToMemory,
64
64
  writeProfile
65
- } from "./chunk-C7GJ5GUQ.js";
65
+ } from "./chunk-XKUTG7JD.js";
66
66
  import {
67
67
  getByDotPath
68
68
  } from "./chunk-44CV5IMX.js";
@@ -86,7 +86,7 @@ import {
86
86
  semanticSearchUpgradeLine,
87
87
  setAgentMode,
88
88
  silenceWarningsInAgentMode
89
- } from "./chunk-5MDUKW5N.js";
89
+ } from "./chunk-NOFJ4NYD.js";
90
90
  import {
91
91
  SCHEMA_VERSION,
92
92
  addRecord,
@@ -96,7 +96,7 @@ import {
96
96
  listBackendPlugins,
97
97
  loadBackendFromConfig,
98
98
  updateRecord
99
- } from "./chunk-Y5JEZWWM.js";
99
+ } from "./chunk-NOPTG4GC.js";
100
100
  import {
101
101
  DEFAULT_MEMORY_CONFIG,
102
102
  defaultSearchableText,
@@ -106,7 +106,7 @@ import {
106
106
  memoryConfigExists,
107
107
  setOpenAiApiKey,
108
108
  updateMemoryConfig
109
- } from "./chunk-WMVVWO6N.js";
109
+ } from "./chunk-3HRC3IPE.js";
110
110
  import {
111
111
  appendAnalyticsQueue,
112
112
  appendUsageLog,
@@ -143,7 +143,7 @@ import {
143
143
  writeConfig,
144
144
  writeUsageLog,
145
145
  writeUsageState
146
- } from "./chunk-GGDXUXLM.js";
146
+ } from "./chunk-HTXZZQ6U.js";
147
147
 
148
148
  // src/cli.ts
149
149
  import { createRequire as createRequire3 } from "module";
@@ -962,24 +962,24 @@ async function configCommand() {
962
962
  p.outro("No changes made.");
963
963
  return;
964
964
  }
965
- const spinner4 = p.spinner();
966
- spinner4.start("Validating API key...");
965
+ const spinner = createSpinner();
966
+ spinner.start("Validating API key...");
967
967
  let isValid = false;
968
968
  try {
969
969
  const api = new OneApi(apiKey, `${normalized}/v1`);
970
970
  isValid = Boolean(await api.validateApiKey());
971
971
  } catch (err) {
972
- spinner4.stop("Connection failed");
972
+ spinner.stop("Connection failed");
973
973
  const msg = err instanceof Error ? err.message : String(err);
974
974
  p.log.error(`Could not reach ${pc2.cyan(normalized)}: ${msg}`);
975
975
  return;
976
976
  }
977
977
  if (!isValid) {
978
- spinner4.stop("Invalid API key");
978
+ spinner.stop("Invalid API key");
979
979
  p.log.error(`Invalid API key for ${pc2.cyan(normalized)}.`);
980
980
  return;
981
981
  }
982
- spinner4.stop("API key validated");
982
+ spinner.stop("API key validated");
983
983
  updateApiBase(normalized);
984
984
  newApiKey = apiKey;
985
985
  } else if (isCustomBase) {
@@ -998,24 +998,24 @@ async function configCommand() {
998
998
  p.outro("No changes made.");
999
999
  return;
1000
1000
  }
1001
- const spinner4 = p.spinner();
1002
- spinner4.start("Validating API key...");
1001
+ const spinner = createSpinner();
1002
+ spinner.start("Validating API key...");
1003
1003
  let isValid = false;
1004
1004
  try {
1005
1005
  const api = new OneApi(apiKey, "https://api.withone.ai/v1");
1006
1006
  isValid = Boolean(await api.validateApiKey());
1007
1007
  } catch (err) {
1008
- spinner4.stop("Connection failed");
1008
+ spinner.stop("Connection failed");
1009
1009
  const msg = err instanceof Error ? err.message : String(err);
1010
1010
  p.log.error(`Could not reach ${pc2.cyan("https://api.withone.ai")}: ${msg}`);
1011
1011
  return;
1012
1012
  }
1013
1013
  if (!isValid) {
1014
- spinner4.stop("Invalid API key");
1014
+ spinner.stop("Invalid API key");
1015
1015
  p.log.error(`Invalid API key. Get a valid key at ${getApiKeyUrl()}`);
1016
1016
  return;
1017
1017
  }
1018
- spinner4.stop("API key validated");
1018
+ spinner.stop("API key validated");
1019
1019
  updateApiBase(null);
1020
1020
  newApiKey = apiKey;
1021
1021
  }
@@ -1053,16 +1053,16 @@ async function configCommand() {
1053
1053
  p.outro("Configuration updated.");
1054
1054
  }
1055
1055
  async function selectConnections(apiKey) {
1056
- const spinner4 = p.spinner();
1057
- spinner4.start("Fetching connections...");
1056
+ const spinner = createSpinner();
1057
+ spinner.start("Fetching connections...");
1058
1058
  let connections;
1059
1059
  try {
1060
1060
  const api = new OneApi(apiKey, getApiBase());
1061
1061
  const rawConnections = await api.listConnections();
1062
1062
  connections = rawConnections.map((c) => ({ platform: c.platform, key: c.key }));
1063
- spinner4.stop(`Found ${connections.length} connection(s)`);
1063
+ spinner.stop(`Found ${connections.length} connection(s)`);
1064
1064
  } catch {
1065
- spinner4.stop("Could not fetch connections");
1065
+ spinner.stop("Could not fetch connections");
1066
1066
  const manual = await p.text({
1067
1067
  message: "Enter connection keys manually (comma-separated):",
1068
1068
  placeholder: "conn_key_1, conn_key_2",
@@ -1635,7 +1635,7 @@ ${describeInstallContext(context)}`
1635
1635
  await open2(authUrl);
1636
1636
  } catch {
1637
1637
  }
1638
- spin.start("Waiting for authentication... (timeout: 5 min)");
1638
+ spin.start("Waiting for browser sign-in (5 min timeout)");
1639
1639
  const timeout = new Promise((_, reject) => {
1640
1640
  const timer = setTimeout(() => {
1641
1641
  reject(new Error("timeout"));
@@ -1794,7 +1794,7 @@ async function nonInteractiveInit(options) {
1794
1794
  let apiKey;
1795
1795
  let keyName;
1796
1796
  let grant;
1797
- let knowledgeOnly = false;
1797
+ let knowledgeOnly;
1798
1798
  let whoami;
1799
1799
  if (auth === "browser") {
1800
1800
  const result = await browserLogin({ scope });
@@ -2066,7 +2066,7 @@ async function handleUpdateKey(statuses, scope) {
2066
2066
  let newKey;
2067
2067
  let keyName;
2068
2068
  let grant;
2069
- let knowledgeOnly = false;
2069
+ let knowledgeOnly;
2070
2070
  let whoamiResult;
2071
2071
  if (authMethod === "browser") {
2072
2072
  const result = await browserLogin({ scope });
@@ -2109,16 +2109,16 @@ ${pc4.cyan(getApiKeyUrl())}`, `API Key ${scopeLabel(scope)}`);
2109
2109
  process.exit(0);
2110
2110
  }
2111
2111
  newKey = inputKey;
2112
- const spinner4 = p3.spinner();
2113
- spinner4.start("Validating API key...");
2112
+ const spinner = createSpinner();
2113
+ spinner.start("Validating API key...");
2114
2114
  const api = new OneApi(newKey, getApiBase());
2115
2115
  const validated = await api.validateApiKey();
2116
2116
  if (!validated) {
2117
- spinner4.stop("Invalid API key");
2117
+ spinner.stop("Invalid API key");
2118
2118
  p3.cancel(`Invalid API key. Get a valid key at ${getApiKeyUrl()}`);
2119
2119
  process.exit(1);
2120
2120
  }
2121
- spinner4.stop("API key validated");
2121
+ spinner.stop("API key validated");
2122
2122
  whoamiResult = validated;
2123
2123
  }
2124
2124
  const env = getEnvFromApiKey(newKey);
@@ -2136,7 +2136,8 @@ ${pc4.cyan(getApiKeyUrl())}`, `API Key ${scopeLabel(scope)}`);
2136
2136
  ].join("\n"),
2137
2137
  "Account"
2138
2138
  );
2139
- const ac = getAccessControl();
2139
+ saveCredentials(newKey, scope, { keyName, whoami: whoamiResult, knowledgeOnly });
2140
+ const ac = (scope === "project" ? readProjectConfig() : readGlobalConfig())?.accessControl ?? {};
2140
2141
  const reinstalled = [];
2141
2142
  for (const s of statuses) {
2142
2143
  if (s.globalMcp) {
@@ -2148,7 +2149,6 @@ ${pc4.cyan(getApiKeyUrl())}`, `API Key ${scopeLabel(scope)}`);
2148
2149
  reinstalled.push(`${s.agent.name} (project)`);
2149
2150
  }
2150
2151
  }
2151
- saveCredentials(newKey, scope, { keyName, whoami: whoamiResult, knowledgeOnly });
2152
2152
  if (reinstalled.length > 0) {
2153
2153
  p3.log.success(`Updated MCP configs: ${reinstalled.join(", ")}`);
2154
2154
  }
@@ -2335,10 +2335,10 @@ async function promptSkillInstall() {
2335
2335
  p3.log.info("No agents selected.");
2336
2336
  return false;
2337
2337
  }
2338
- const spinner4 = p3.spinner();
2339
- spinner4.start("Installing skill...");
2338
+ const spinner = createSpinner();
2339
+ spinner.start("Installing skill...");
2340
2340
  const { installed, failed } = installSkillForAgents(selectedIds);
2341
- spinner4.stop(installed.length > 0 ? "Skill installed" : "Installation failed");
2341
+ spinner.stop(installed.length > 0 ? "Skill installed" : "Installation failed");
2342
2342
  for (const name of installed) {
2343
2343
  p3.log.success(`${name}: ${pc4.green("\u2713")} skill installed`);
2344
2344
  }
@@ -2434,16 +2434,16 @@ ${pc4.cyan(getApiKeyUrl())}`, `API Key ${scopeLabel(scope)}`);
2434
2434
  process.exit(0);
2435
2435
  }
2436
2436
  apiKey = inputKey;
2437
- const spinner4 = p3.spinner();
2438
- spinner4.start("Validating API key...");
2437
+ const spinner = createSpinner();
2438
+ spinner.start("Validating API key...");
2439
2439
  const api = new OneApi(apiKey, getApiBase());
2440
2440
  const whoami = await api.validateApiKey();
2441
2441
  if (!whoami) {
2442
- spinner4.stop("Invalid API key");
2442
+ spinner.stop("Invalid API key");
2443
2443
  p3.cancel(`Invalid API key. Get a valid key at ${getApiKeyUrl()}`);
2444
2444
  process.exit(1);
2445
2445
  }
2446
- spinner4.stop("API key validated");
2446
+ spinner.stop("API key validated");
2447
2447
  const env2 = getEnvFromApiKey(apiKey);
2448
2448
  const contextParts = [];
2449
2449
  if (whoami.organization) contextParts.push(whoami.organization.name);
@@ -2558,16 +2558,16 @@ async function promptConnectIntegrations(apiKey, connParams) {
2558
2558
  p3.log.warn("Could not open browser automatically.");
2559
2559
  p3.note(url, "Open manually");
2560
2560
  }
2561
- const spinner4 = p3.spinner();
2562
- spinner4.start("Waiting for connection... (complete auth in browser)");
2561
+ const spinner = createSpinner();
2562
+ spinner.start("Waiting for connection... (complete auth in browser)");
2563
2563
  try {
2564
2564
  await api.waitForConnection(platform, 5 * 60 * 1e3, 5e3);
2565
- spinner4.stop(`${label} connected!`);
2565
+ spinner.stop(`${label} connected!`);
2566
2566
  p3.log.success(`${pc4.green("\u2713")} ${label} is now available to your AI agents`);
2567
2567
  connected.push(platform);
2568
2568
  first = false;
2569
2569
  } catch (error2) {
2570
- spinner4.stop("Connection timed out");
2570
+ spinner.stop("Connection timed out");
2571
2571
  if (error2 instanceof TimeoutError) {
2572
2572
  p3.log.warn(`No worries. Connect later with: ${pc4.cyan(`one add ${platform}`)}`);
2573
2573
  }
@@ -2719,14 +2719,14 @@ async function connectionAddCommand(platformArg, options) {
2719
2719
  process.exit(1);
2720
2720
  }
2721
2721
  const api = new OneApi(apiKey, getApiBase());
2722
- const spinner4 = p4.spinner();
2723
- spinner4.start("Loading platforms...");
2722
+ const spinner = createSpinner();
2723
+ spinner.start("Loading platforms...");
2724
2724
  let platforms;
2725
2725
  try {
2726
2726
  platforms = await api.listPlatforms();
2727
- spinner4.stop(`${platforms.length} platforms available`);
2727
+ spinner.stop(`${platforms.length} platforms available`);
2728
2728
  } catch (error2) {
2729
- spinner4.stop("Failed to load platforms");
2729
+ spinner.stop("Failed to load platforms");
2730
2730
  p4.cancel(`Error: ${error2 instanceof Error ? error2.message : "Unknown error"}`);
2731
2731
  process.exit(1);
2732
2732
  }
@@ -2798,14 +2798,14 @@ Run ${pc6.cyan("one platforms")} to see available platforms.`);
2798
2798
  p4.note(`Open this URL manually:
2799
2799
  ${url}`);
2800
2800
  }
2801
- const pollSpinner = p4.spinner();
2801
+ const pollSpinner = createSpinner();
2802
2802
  pollSpinner.start("Waiting for connection... (complete auth in browser)");
2803
2803
  try {
2804
2804
  const connection2 = await api.waitForConnection(platform, 5 * 60 * 1e3, 5e3);
2805
2805
  pollSpinner.stop(`${platform} connected!`);
2806
2806
  const tag = options?.tag?.trim();
2807
2807
  if (tag) {
2808
- const tagSpinner = p4.spinner();
2808
+ const tagSpinner = createSpinner();
2809
2809
  tagSpinner.start(`Tagging connection "${tag}"...`);
2810
2810
  try {
2811
2811
  await api.updateConnectionTags(connection2.id, [tag]);
@@ -2844,8 +2844,8 @@ async function connectionListCommand(options) {
2844
2844
  error("Not configured. Run `one init` first.");
2845
2845
  }
2846
2846
  const api = new OneApi(apiKey, getApiBase());
2847
- const spinner4 = createSpinner();
2848
- spinner4.start("Loading connections...");
2847
+ const spinner = createSpinner();
2848
+ spinner.start("Loading connections...");
2849
2849
  try {
2850
2850
  const allConnections = await api.listConnections();
2851
2851
  const ac = getAccessControlFromAllSources();
@@ -2887,7 +2887,7 @@ async function connectionListCommand(options) {
2887
2887
  return;
2888
2888
  }
2889
2889
  const displayed = limitArg !== void 0 ? filtered.slice(0, limitArg) : filtered;
2890
- spinner4.stop(`${filtered.length} connection${filtered.length === 1 ? "" : "s"} found`);
2890
+ spinner.stop(`${filtered.length} connection${filtered.length === 1 ? "" : "s"} found`);
2891
2891
  if (filtered.length === 0) {
2892
2892
  if (searchQuery) {
2893
2893
  p4.note(
@@ -2949,7 +2949,7 @@ Change it with: ${pc6.cyan("one config")}`, "Access");
2949
2949
  p4.note(`Add more with: ${pc6.cyan("one connection add <platform>")}`, "Tip");
2950
2950
  }
2951
2951
  } catch (error2) {
2952
- spinner4.stop("Failed to load connections");
2952
+ spinner.stop("Failed to load connections");
2953
2953
  error(`Error: ${error2 instanceof Error ? error2.message : "Unknown error"}`);
2954
2954
  }
2955
2955
  }
@@ -2959,13 +2959,13 @@ async function connectionDeleteCommand(connectionKey, options) {
2959
2959
  error("Not configured. Run `one init` first.");
2960
2960
  }
2961
2961
  const api = new OneApi(apiKey, getApiBase());
2962
- const spinner4 = createSpinner();
2963
- spinner4.start("Finding connection...");
2962
+ const spinner = createSpinner();
2963
+ spinner.start("Finding connection...");
2964
2964
  let allConnections;
2965
2965
  try {
2966
2966
  allConnections = await api.listConnections();
2967
2967
  } catch (error2) {
2968
- spinner4.stop("Failed to load connections");
2968
+ spinner.stop("Failed to load connections");
2969
2969
  error(`Error: ${error2 instanceof Error ? error2.message : "Unknown error"}`);
2970
2970
  return;
2971
2971
  }
@@ -2974,12 +2974,12 @@ async function connectionDeleteCommand(connectionKey, options) {
2974
2974
  const connections = allowedKeys.includes("*") ? allConnections : allConnections.filter((conn) => allowedKeys.includes(conn.key));
2975
2975
  const match = connections.find((conn) => conn.key === connectionKey);
2976
2976
  if (!match) {
2977
- spinner4.stop("Connection not found");
2977
+ spinner.stop("Connection not found");
2978
2978
  error(`No connection found with key: ${connectionKey}`);
2979
2979
  return;
2980
2980
  }
2981
2981
  const connection2 = match;
2982
- spinner4.stop(`Found ${connection2.platform} (${connection2.state})`);
2982
+ spinner.stop(`Found ${connection2.platform} (${connection2.state})`);
2983
2983
  if (!isAgentMode() && !options?.force) {
2984
2984
  console.log();
2985
2985
  console.log(` ${getStatusIndicator(connection2.state)} ${connection2.platform} ${pc6.dim(connection2.key)}`);
@@ -3068,11 +3068,11 @@ async function platformsCommand(options) {
3068
3068
  options.json = true;
3069
3069
  }
3070
3070
  const api = new OneApi(apiKey, getApiBase());
3071
- const spinner4 = createSpinner();
3072
- spinner4.start("Loading platforms...");
3071
+ const spinner = createSpinner();
3072
+ spinner.start("Loading platforms...");
3073
3073
  try {
3074
3074
  const platforms = await api.listPlatforms();
3075
- spinner4.stop(`${platforms.length} platforms available`);
3075
+ spinner.stop(`${platforms.length} platforms available`);
3076
3076
  let filtered = platforms;
3077
3077
  if (options.category) {
3078
3078
  filtered = platforms.filter((plat) => (plat.category || "Other") === options.category);
@@ -3126,7 +3126,7 @@ async function platformsCommand(options) {
3126
3126
  console.log();
3127
3127
  p5.note(`Connect with: ${pc7.cyan("one connection add <platform>")}`, "Tip");
3128
3128
  } catch (error2) {
3129
- spinner4.stop("Failed to load platforms");
3129
+ spinner.stop("Failed to load platforms");
3130
3130
  error(`Error: ${error2 instanceof Error ? error2.message : "Unknown error"}`);
3131
3131
  }
3132
3132
  }
@@ -3954,8 +3954,8 @@ async function actionsFindCommand(pairs, options) {
3954
3954
  const { apiKey, permissions, connectionKeys, actionIds, knowledgeAgent } = getConfig();
3955
3955
  const api = new OneApi(apiKey, getApiBase());
3956
3956
  const settings = { knowledgeAgent, permissions, actionIds, connectionKeys, apiBase: getApiBase() };
3957
- const spinner4 = createSpinner();
3958
- spinner4.start(`Finding actions for ${requests.length} intent${requests.length === 1 ? "" : "s"}...`);
3957
+ const spinner = createSpinner();
3958
+ spinner.start(`Finding actions for ${requests.length} intent${requests.length === 1 ? "" : "s"}...`);
3959
3959
  try {
3960
3960
  const result = await find(
3961
3961
  requests,
@@ -3968,12 +3968,12 @@ async function actionsFindCommand(pairs, options) {
3968
3968
  json(result);
3969
3969
  return;
3970
3970
  }
3971
- spinner4.stop("Found");
3971
+ spinner.stop("Found");
3972
3972
  console.log();
3973
3973
  console.log(renderFind(result));
3974
3974
  console.log();
3975
3975
  } catch (error2) {
3976
- spinner4.stop("Find failed");
3976
+ spinner.stop("Find failed");
3977
3977
  error(`Error: ${failure(error2)}`);
3978
3978
  }
3979
3979
  }
@@ -4002,20 +4002,20 @@ async function actionsLoadCommand(actionIds, options) {
4002
4002
  const { apiKey, permissions, connectionKeys, actionIds: allowed, knowledgeAgent } = getConfig();
4003
4003
  const api = new OneApi(apiKey, getApiBase());
4004
4004
  const settings = { knowledgeAgent, permissions, actionIds: allowed, connectionKeys, apiBase: getApiBase() };
4005
- const spinner4 = createSpinner();
4006
- spinner4.start(`Loading ${actionIds.length === 1 ? "the action" : `${actionIds.length} actions`}...`);
4005
+ const spinner = createSpinner();
4006
+ spinner.start(`Loading ${actionIds.length === 1 ? "the action" : `${actionIds.length} actions`}...`);
4007
4007
  try {
4008
4008
  const result = await load(actionIds, options, findDeps(api, connectionKeys, options.cache !== false), settings);
4009
4009
  if (isAgentMode()) {
4010
4010
  json(result);
4011
4011
  return;
4012
4012
  }
4013
- spinner4.stop("Loaded");
4013
+ spinner.stop("Loaded");
4014
4014
  console.log();
4015
4015
  console.log(renderLoad(result));
4016
4016
  console.log();
4017
4017
  } catch (error2) {
4018
- spinner4.stop("Load failed");
4018
+ spinner.stop("Load failed");
4019
4019
  error(`Error: ${failure(error2)}`);
4020
4020
  }
4021
4021
  }
@@ -4034,17 +4034,17 @@ async function actionsExecuteCommand(platform, actionId, connectionKey, options)
4034
4034
  error(`Connection key "${connectionKey}" is not allowed.`);
4035
4035
  }
4036
4036
  const api = new OneApi(apiKey, getApiBase());
4037
- const spinner4 = createSpinner();
4038
- spinner4.start("Resolving action details...");
4037
+ const spinner = createSpinner();
4038
+ spinner.start("Resolving action details...");
4039
4039
  try {
4040
4040
  const { details: actionDetails, cacheHit: preflightCacheHit } = await resolveActionDetails(api, actionId, { useCache: options.cache !== false });
4041
4041
  if (!isMethodAllowed(actionDetails.method, permissions)) {
4042
- spinner4.stop("Permission denied");
4042
+ spinner.stop("Permission denied");
4043
4043
  error(
4044
4044
  `Method "${actionDetails.method}" is not allowed under "${permissions}" permission level.`
4045
4045
  );
4046
4046
  }
4047
- spinner4.stop(
4047
+ spinner.stop(
4048
4048
  `Action: ${actionDetails.title} [${actionDetails.method}]` + (preflightCacheHit ? pc8.dim(" (cached)") : "")
4049
4049
  );
4050
4050
  const data = options.data ? parseJsonArg2(options.data, "--data") : void 0;
@@ -4054,7 +4054,7 @@ async function actionsExecuteCommand(platform, actionId, connectionKey, options)
4054
4054
  if (!options.skipValidation) {
4055
4055
  const validation = validateActionInput(actionDetails, { data, pathVariables, queryParams });
4056
4056
  if (!validation.valid) {
4057
- spinner4.stop("Validation failed");
4057
+ spinner.stop("Validation failed");
4058
4058
  if (isAgentMode()) {
4059
4059
  json({
4060
4060
  error: "Validation failed: missing required parameters",
@@ -4075,7 +4075,7 @@ async function actionsExecuteCommand(platform, actionId, connectionKey, options)
4075
4075
  }
4076
4076
  }
4077
4077
  if (options.mock) {
4078
- spinner4.stop("Mock \u2014 returning example response");
4078
+ spinner.stop("Mock \u2014 returning example response");
4079
4079
  const mockResponse = actionDetails.ioSchema?.ioExample?.output ?? null;
4080
4080
  if (isAgentMode()) {
4081
4081
  json({
@@ -4159,7 +4159,7 @@ async function actionsExecuteCommand(platform, actionId, connectionKey, options)
4159
4159
  }
4160
4160
  }
4161
4161
  } catch (error2) {
4162
- spinner4.stop("Execution failed");
4162
+ spinner.stop("Execution failed");
4163
4163
  error(
4164
4164
  `Error: ${error2 instanceof Error ? error2.message : "Unknown error"}`
4165
4165
  );
@@ -5376,8 +5376,8 @@ async function flowExecuteCommand(keyOrPath, options) {
5376
5376
  intro(pc9.bgCyan(pc9.black(" One Workflow ")));
5377
5377
  const { apiKey, permissions, actionIds } = getConfig2();
5378
5378
  const api = new OneApi(apiKey, getApiBase());
5379
- const spinner4 = createSpinner();
5380
- spinner4.start(`Loading workflow "${keyOrPath}"...`);
5379
+ const spinner = createSpinner();
5380
+ spinner.start(`Loading workflow "${keyOrPath}"...`);
5381
5381
  let flow2;
5382
5382
  let rootDir;
5383
5383
  let flowFilePath;
@@ -5387,11 +5387,11 @@ async function flowExecuteCommand(keyOrPath, options) {
5387
5387
  rootDir = loaded.rootDir;
5388
5388
  flowFilePath = loaded.filePath;
5389
5389
  } catch (err) {
5390
- spinner4.stop("Workflow not found");
5390
+ spinner.stop("Workflow not found");
5391
5391
  error(err instanceof Error ? err.message : String(err));
5392
5392
  return;
5393
5393
  }
5394
- spinner4.stop(`Workflow: ${flow2.name} (${flow2.steps.length} steps)`);
5394
+ spinner.stop(`Workflow: ${flow2.name} (${flow2.steps.length} steps)`);
5395
5395
  const preflightErrors = validateFlow(flow2, rootDir);
5396
5396
  if (preflightErrors.length > 0) {
5397
5397
  if (isAgentMode()) {
@@ -5596,8 +5596,8 @@ async function flowListCommand() {
5596
5596
  }
5597
5597
  async function flowValidateCommand(keyOrPath) {
5598
5598
  intro(pc9.bgCyan(pc9.black(" One Workflow ")));
5599
- const spinner4 = createSpinner();
5600
- spinner4.start(`Validating "${keyOrPath}"...`);
5599
+ const spinner = createSpinner();
5600
+ spinner.start(`Validating "${keyOrPath}"...`);
5601
5601
  let flowData;
5602
5602
  let rootDir;
5603
5603
  try {
@@ -5612,12 +5612,12 @@ async function flowValidateCommand(keyOrPath) {
5612
5612
  rootDir = path7.dirname(flowPath);
5613
5613
  }
5614
5614
  } catch (err) {
5615
- spinner4.stop("Validation failed");
5615
+ spinner.stop("Validation failed");
5616
5616
  error(`Could not read workflow: ${err instanceof Error ? err.message : String(err)}`);
5617
5617
  }
5618
5618
  const errors = validateFlow(flowData, rootDir);
5619
5619
  if (errors.length > 0) {
5620
- spinner4.stop("Validation failed");
5620
+ spinner.stop("Validation failed");
5621
5621
  if (isAgentMode()) {
5622
5622
  json({ valid: false, errors });
5623
5623
  process.exit(1);
@@ -5629,7 +5629,7 @@ async function flowValidateCommand(keyOrPath) {
5629
5629
  console.log();
5630
5630
  error(`${errors.length} validation error(s) found`);
5631
5631
  }
5632
- spinner4.stop("Workflow is valid");
5632
+ spinner.stop("Workflow is valid");
5633
5633
  if (isAgentMode()) {
5634
5634
  json({ valid: true, key: flowData.key });
5635
5635
  return;
@@ -5671,15 +5671,15 @@ async function flowResumeCommand(runId, options = {}) {
5671
5671
  json(event);
5672
5672
  }
5673
5673
  };
5674
- const spinner4 = createSpinner();
5675
- spinner4.start(`Resuming run ${runId} (${state.completedSteps.length} steps already completed)...`);
5674
+ const spinner = createSpinner();
5675
+ spinner.start(`Resuming run ${runId} (${state.completedSteps.length} steps already completed)...`);
5676
5676
  try {
5677
5677
  const context = await runner.resume(flow2, api, permissions, actionIds, {
5678
5678
  onEvent,
5679
5679
  rootDir,
5680
5680
  allowBash: options.allowBash
5681
5681
  });
5682
- spinner4.stop("Workflow completed");
5682
+ spinner.stop("Workflow completed");
5683
5683
  if (isAgentMode()) {
5684
5684
  json({
5685
5685
  event: "workflow:result",
@@ -5693,7 +5693,7 @@ async function flowResumeCommand(runId, options = {}) {
5693
5693
  console.log(` ${pc9.green("\u2713")} Resumed and completed successfully`);
5694
5694
  console.log(` ${pc9.dim(`Log: ${runner.getLogPath()}`)}`);
5695
5695
  } catch (error2) {
5696
- spinner4.stop("Resume failed");
5696
+ spinner.stop("Resume failed");
5697
5697
  const errorMsg = error2 instanceof Error ? error2.message : String(error2);
5698
5698
  if (isAgentMode()) {
5699
5699
  json({ event: "workflow:result", runId, status: "failed", error: errorMsg });
@@ -6010,8 +6010,8 @@ async function relayCreateCommand(options) {
6010
6010
  error(`Connection key "${options.connectionKey}" is not allowed.`);
6011
6011
  }
6012
6012
  const api = new OneApi(apiKey, getApiBase());
6013
- const spinner4 = createSpinner();
6014
- spinner4.start("Creating relay endpoint...");
6013
+ const spinner = createSpinner();
6014
+ spinner.start("Creating relay endpoint...");
6015
6015
  try {
6016
6016
  const body = {
6017
6017
  connectionKey: options.connectionKey
@@ -6026,7 +6026,7 @@ async function relayCreateCommand(options) {
6026
6026
  json(result);
6027
6027
  return;
6028
6028
  }
6029
- spinner4.stop("Relay endpoint created");
6029
+ spinner.stop("Relay endpoint created");
6030
6030
  console.log();
6031
6031
  console.log(` ${pc10.dim("ID:")} ${result.id}`);
6032
6032
  console.log(` ${pc10.dim("URL:")} ${result.url}`);
@@ -6040,15 +6040,15 @@ async function relayCreateCommand(options) {
6040
6040
  }
6041
6041
  console.log();
6042
6042
  } catch (error2) {
6043
- spinner4.stop("Failed to create relay endpoint");
6043
+ spinner.stop("Failed to create relay endpoint");
6044
6044
  error(`Error: ${error2 instanceof Error ? error2.message : "Unknown error"}`);
6045
6045
  }
6046
6046
  }
6047
6047
  async function relayListCommand(options) {
6048
6048
  const { apiKey } = getConfig3();
6049
6049
  const api = new OneApi(apiKey, getApiBase());
6050
- const spinner4 = createSpinner();
6051
- spinner4.start("Loading relay endpoints...");
6050
+ const spinner = createSpinner();
6051
+ spinner.start("Loading relay endpoints...");
6052
6052
  try {
6053
6053
  const query = {};
6054
6054
  if (options.limit) query.limit = options.limit;
@@ -6071,7 +6071,7 @@ async function relayListCommand(options) {
6071
6071
  });
6072
6072
  return;
6073
6073
  }
6074
- spinner4.stop(`${endpoints.length} relay endpoint${endpoints.length === 1 ? "" : "s"} found`);
6074
+ spinner.stop(`${endpoints.length} relay endpoint${endpoints.length === 1 ? "" : "s"} found`);
6075
6075
  if (endpoints.length === 0) {
6076
6076
  console.log("\n No relay endpoints yet.\n");
6077
6077
  return;
@@ -6093,22 +6093,22 @@ async function relayListCommand(options) {
6093
6093
  }))
6094
6094
  );
6095
6095
  } catch (error2) {
6096
- spinner4.stop("Failed to list relay endpoints");
6096
+ spinner.stop("Failed to list relay endpoints");
6097
6097
  error(`Error: ${error2 instanceof Error ? error2.message : "Unknown error"}`);
6098
6098
  }
6099
6099
  }
6100
6100
  async function relayGetCommand(id) {
6101
6101
  const { apiKey } = getConfig3();
6102
6102
  const api = new OneApi(apiKey, getApiBase());
6103
- const spinner4 = createSpinner();
6104
- spinner4.start("Loading relay endpoint...");
6103
+ const spinner = createSpinner();
6104
+ spinner.start("Loading relay endpoint...");
6105
6105
  try {
6106
6106
  const result = await api.getRelayEndpoint(id);
6107
6107
  if (isAgentMode()) {
6108
6108
  json(result);
6109
6109
  return;
6110
6110
  }
6111
- spinner4.stop("Relay endpoint loaded");
6111
+ spinner.stop("Relay endpoint loaded");
6112
6112
  console.log();
6113
6113
  console.log(` ${pc10.dim("ID:")} ${result.id}`);
6114
6114
  console.log(` ${pc10.dim("URL:")} ${result.url}`);
@@ -6124,15 +6124,15 @@ async function relayGetCommand(id) {
6124
6124
  console.log(` ${pc10.dim("Created:")} ${result.createdAt}`);
6125
6125
  console.log();
6126
6126
  } catch (error2) {
6127
- spinner4.stop("Failed to load relay endpoint");
6127
+ spinner.stop("Failed to load relay endpoint");
6128
6128
  error(`Error: ${error2 instanceof Error ? error2.message : "Unknown error"}`);
6129
6129
  }
6130
6130
  }
6131
6131
  async function relayUpdateCommand(id, options) {
6132
6132
  const { apiKey } = getConfig3();
6133
6133
  const api = new OneApi(apiKey, getApiBase());
6134
- const spinner4 = createSpinner();
6135
- spinner4.start("Updating relay endpoint...");
6134
+ const spinner = createSpinner();
6135
+ spinner.start("Updating relay endpoint...");
6136
6136
  try {
6137
6137
  const body = {};
6138
6138
  if (options.description !== void 0) body.description = options.description;
@@ -6145,40 +6145,40 @@ async function relayUpdateCommand(id, options) {
6145
6145
  json(result);
6146
6146
  return;
6147
6147
  }
6148
- spinner4.stop("Relay endpoint updated");
6148
+ spinner.stop("Relay endpoint updated");
6149
6149
  console.log(` ${pc10.dim("ID:")} ${result.id}`);
6150
6150
  console.log(` ${pc10.dim("Active:")} ${result.active}`);
6151
6151
  console.log(` ${pc10.dim("Actions:")} ${result.actions?.length || 0}`);
6152
6152
  console.log();
6153
6153
  } catch (error2) {
6154
- spinner4.stop("Failed to update relay endpoint");
6154
+ spinner.stop("Failed to update relay endpoint");
6155
6155
  error(`Error: ${error2 instanceof Error ? error2.message : "Unknown error"}`);
6156
6156
  }
6157
6157
  }
6158
6158
  async function relayDeleteCommand(id) {
6159
6159
  const { apiKey } = getConfig3();
6160
6160
  const api = new OneApi(apiKey, getApiBase());
6161
- const spinner4 = createSpinner();
6162
- spinner4.start("Deleting relay endpoint...");
6161
+ const spinner = createSpinner();
6162
+ spinner.start("Deleting relay endpoint...");
6163
6163
  try {
6164
6164
  const result = await api.deleteRelayEndpoint(id);
6165
6165
  if (isAgentMode()) {
6166
6166
  json({ deleted: true, id: result.id });
6167
6167
  return;
6168
6168
  }
6169
- spinner4.stop("Relay endpoint deleted");
6169
+ spinner.stop("Relay endpoint deleted");
6170
6170
  console.log(` Deleted: ${result.id}`);
6171
6171
  console.log();
6172
6172
  } catch (error2) {
6173
- spinner4.stop("Failed to delete relay endpoint");
6173
+ spinner.stop("Failed to delete relay endpoint");
6174
6174
  error(`Error: ${error2 instanceof Error ? error2.message : "Unknown error"}`);
6175
6175
  }
6176
6176
  }
6177
6177
  async function relayActivateCommand(id, options) {
6178
6178
  const { apiKey } = getConfig3();
6179
6179
  const api = new OneApi(apiKey, getApiBase());
6180
- const spinner4 = createSpinner();
6181
- spinner4.start("Activating relay endpoint...");
6180
+ const spinner = createSpinner();
6181
+ spinner.start("Activating relay endpoint...");
6182
6182
  try {
6183
6183
  const actions2 = parseJsonArg3(options.actions, "--actions");
6184
6184
  const body = { actions: actions2 };
@@ -6188,21 +6188,21 @@ async function relayActivateCommand(id, options) {
6188
6188
  json(result);
6189
6189
  return;
6190
6190
  }
6191
- spinner4.stop("Relay endpoint activated");
6191
+ spinner.stop("Relay endpoint activated");
6192
6192
  console.log(` ${pc10.dim("ID:")} ${result.id}`);
6193
6193
  console.log(` ${pc10.dim("Active:")} ${result.active}`);
6194
6194
  console.log(` ${pc10.dim("Actions:")} ${result.actions?.length || 0}`);
6195
6195
  console.log();
6196
6196
  } catch (error2) {
6197
- spinner4.stop("Failed to activate relay endpoint");
6197
+ spinner.stop("Failed to activate relay endpoint");
6198
6198
  error(`Error: ${error2 instanceof Error ? error2.message : "Unknown error"}`);
6199
6199
  }
6200
6200
  }
6201
6201
  async function relayEventsCommand(options) {
6202
6202
  const { apiKey } = getConfig3();
6203
6203
  const api = new OneApi(apiKey, getApiBase());
6204
- const spinner4 = createSpinner();
6205
- spinner4.start("Loading relay events...");
6204
+ const spinner = createSpinner();
6205
+ spinner.start("Loading relay events...");
6206
6206
  try {
6207
6207
  const query = {};
6208
6208
  if (options.limit) query.limit = options.limit;
@@ -6226,7 +6226,7 @@ async function relayEventsCommand(options) {
6226
6226
  });
6227
6227
  return;
6228
6228
  }
6229
- spinner4.stop(`${events.length} event${events.length === 1 ? "" : "s"} found`);
6229
+ spinner.stop(`${events.length} event${events.length === 1 ? "" : "s"} found`);
6230
6230
  if (events.length === 0) {
6231
6231
  console.log("\n No events found.\n");
6232
6232
  return;
@@ -6246,22 +6246,22 @@ async function relayEventsCommand(options) {
6246
6246
  }))
6247
6247
  );
6248
6248
  } catch (error2) {
6249
- spinner4.stop("Failed to list relay events");
6249
+ spinner.stop("Failed to list relay events");
6250
6250
  error(`Error: ${error2 instanceof Error ? error2.message : "Unknown error"}`);
6251
6251
  }
6252
6252
  }
6253
6253
  async function relayEventGetCommand(id) {
6254
6254
  const { apiKey } = getConfig3();
6255
6255
  const api = new OneApi(apiKey, getApiBase());
6256
- const spinner4 = createSpinner();
6257
- spinner4.start("Loading relay event...");
6256
+ const spinner = createSpinner();
6257
+ spinner.start("Loading relay event...");
6258
6258
  try {
6259
6259
  const result = await api.getRelayEvent(id);
6260
6260
  if (isAgentMode()) {
6261
6261
  json(result);
6262
6262
  return;
6263
6263
  }
6264
- spinner4.stop("Relay event loaded");
6264
+ spinner.stop("Relay event loaded");
6265
6265
  console.log();
6266
6266
  console.log(` ${pc10.dim("ID:")} ${result.id}`);
6267
6267
  console.log(` ${pc10.dim("Platform:")} ${result.platform}`);
@@ -6271,7 +6271,7 @@ async function relayEventGetCommand(id) {
6271
6271
  console.log(JSON.stringify(result.payload, null, 2));
6272
6272
  console.log();
6273
6273
  } catch (error2) {
6274
- spinner4.stop("Failed to load relay event");
6274
+ spinner.stop("Failed to load relay event");
6275
6275
  error(`Error: ${error2 instanceof Error ? error2.message : "Unknown error"}`);
6276
6276
  }
6277
6277
  }
@@ -6281,8 +6281,8 @@ async function relayDeliveriesCommand(options) {
6281
6281
  }
6282
6282
  const { apiKey } = getConfig3();
6283
6283
  const api = new OneApi(apiKey, getApiBase());
6284
- const spinner4 = createSpinner();
6285
- spinner4.start("Loading deliveries...");
6284
+ const spinner = createSpinner();
6285
+ spinner.start("Loading deliveries...");
6286
6286
  try {
6287
6287
  const deliveries = options.endpointId ? await api.listRelayEndpointDeliveries(options.endpointId) : await api.listRelayEventDeliveries(options.eventId);
6288
6288
  const items = Array.isArray(deliveries) ? deliveries : deliveries.rows || [];
@@ -6290,7 +6290,7 @@ async function relayDeliveriesCommand(options) {
6290
6290
  json({ deliveries: items });
6291
6291
  return;
6292
6292
  }
6293
- spinner4.stop(`${items.length} deliver${items.length === 1 ? "y" : "ies"} found`);
6293
+ spinner.stop(`${items.length} deliver${items.length === 1 ? "y" : "ies"} found`);
6294
6294
  if (items.length === 0) {
6295
6295
  console.log("\n No deliveries found.\n");
6296
6296
  return;
@@ -6312,22 +6312,22 @@ async function relayDeliveriesCommand(options) {
6312
6312
  }))
6313
6313
  );
6314
6314
  } catch (error2) {
6315
- spinner4.stop("Failed to load deliveries");
6315
+ spinner.stop("Failed to load deliveries");
6316
6316
  error(`Error: ${error2 instanceof Error ? error2.message : "Unknown error"}`);
6317
6317
  }
6318
6318
  }
6319
6319
  async function relayPlatformsCommand() {
6320
6320
  const { apiKey } = getConfig3();
6321
6321
  const api = new OneApi(apiKey, getApiBase());
6322
- const spinner4 = createSpinner();
6323
- spinner4.start("Loading relay-capable platforms...");
6322
+ const spinner = createSpinner();
6323
+ spinner.start("Loading relay-capable platforms...");
6324
6324
  try {
6325
6325
  const platforms = await api.listRelayPlatforms();
6326
6326
  if (isAgentMode()) {
6327
6327
  json({ platforms });
6328
6328
  return;
6329
6329
  }
6330
- spinner4.stop(`${platforms.length} relay-capable platform${platforms.length === 1 ? "" : "s"} found`);
6330
+ spinner.stop(`${platforms.length} relay-capable platform${platforms.length === 1 ? "" : "s"} found`);
6331
6331
  if (platforms.length === 0) {
6332
6332
  console.log("\n No relay-capable platforms available.\n");
6333
6333
  return;
@@ -6348,22 +6348,22 @@ async function relayPlatformsCommand() {
6348
6348
  )
6349
6349
  );
6350
6350
  } catch (error2) {
6351
- spinner4.stop("Failed to load relay platforms");
6351
+ spinner.stop("Failed to load relay platforms");
6352
6352
  error(`Error: ${error2 instanceof Error ? error2.message : "Unknown error"}`);
6353
6353
  }
6354
6354
  }
6355
6355
  async function relayEventTypesCommand(platform) {
6356
6356
  const { apiKey } = getConfig3();
6357
6357
  const api = new OneApi(apiKey, getApiBase());
6358
- const spinner4 = createSpinner();
6359
- spinner4.start(`Loading event types for ${pc10.cyan(platform)}...`);
6358
+ const spinner = createSpinner();
6359
+ spinner.start(`Loading event types for ${pc10.cyan(platform)}...`);
6360
6360
  try {
6361
6361
  const eventTypes = await api.listRelayEventTypes(platform);
6362
6362
  if (isAgentMode()) {
6363
6363
  json({ platform, eventTypes });
6364
6364
  return;
6365
6365
  }
6366
- spinner4.stop(`${eventTypes.length} event type${eventTypes.length === 1 ? "" : "s"} found`);
6366
+ spinner.stop(`${eventTypes.length} event type${eventTypes.length === 1 ? "" : "s"} found`);
6367
6367
  if (eventTypes.length === 0) {
6368
6368
  console.log(`
6369
6369
  No event types found for ${platform}.
@@ -6376,7 +6376,7 @@ async function relayEventTypesCommand(platform) {
6376
6376
  }
6377
6377
  console.log();
6378
6378
  } catch (error2) {
6379
- spinner4.stop("Failed to load event types");
6379
+ spinner.stop("Failed to load event types");
6380
6380
  error(`Error: ${error2 instanceof Error ? error2.message : "Unknown error"}`);
6381
6381
  }
6382
6382
  }
@@ -7413,7 +7413,7 @@ async function syncModel(api, profile, options) {
7413
7413
  updateModelState(platform, model, { status: "failed", pagesProcessed, lastCursor }),
7414
7414
  (async () => {
7415
7415
  try {
7416
- const { getBackend: getBackend2 } = await import("./runtime-DTKLN6KX.js");
7416
+ const { getBackend: getBackend2 } = await import("./runtime-HLW365HP.js");
7417
7417
  const backend = await getBackend2();
7418
7418
  await Promise.race([
7419
7419
  backend.close(),
@@ -7779,7 +7779,7 @@ async function syncModel(api, profile, options) {
7779
7779
  db.exec(`DROP TABLE IF EXISTS _seen_ids`);
7780
7780
  }
7781
7781
  if (options.toMemory !== false) {
7782
- const backend = await (await import("./runtime-DTKLN6KX.js")).getBackend();
7782
+ const backend = await (await import("./runtime-HLW365HP.js")).getBackend();
7783
7783
  const type = `${platform}/${model}`;
7784
7784
  const existing = await backend.listKeysByType(type);
7785
7785
  const sourcePrefix = `${type}:`;
@@ -7880,7 +7880,7 @@ async function syncModel(api, profile, options) {
7880
7880
  let statusCounts;
7881
7881
  if (options.toMemory !== false) {
7882
7882
  try {
7883
- const backend = await (await import("./runtime-DTKLN6KX.js")).getBackend();
7883
+ const backend = await (await import("./runtime-HLW365HP.js")).getBackend();
7884
7884
  const typeName = `${platform}/${model}`;
7885
7885
  const [active, archived] = await Promise.all([
7886
7886
  backend.count(typeName, { status: "active" }),
@@ -9179,11 +9179,11 @@ ${profiles.length} built-in profile(s). Run ${pc11.bold("one sync init <platform
9179
9179
  }
9180
9180
  async function syncModelsCommand(platform) {
9181
9181
  const api = getApi();
9182
- const spinner4 = createSpinner();
9183
- spinner4.start(`Discovering models for ${platform}...`);
9182
+ const spinner = createSpinner();
9183
+ spinner.start(`Discovering models for ${platform}...`);
9184
9184
  try {
9185
9185
  const models = await discoverModels(api, platform);
9186
- spinner4.stop(`Found ${models.length} models`);
9186
+ spinner.stop(`Found ${models.length} models`);
9187
9187
  if (isAgentMode()) {
9188
9188
  json({ platform, models, total: models.length });
9189
9189
  return;
@@ -9197,15 +9197,15 @@ async function syncModelsCommand(platform) {
9197
9197
  );
9198
9198
  note(lines.join("\n"), `${platform} \u2014 ${models.length} models`);
9199
9199
  } catch (err) {
9200
- spinner4.stop("Failed");
9200
+ spinner.stop("Failed");
9201
9201
  error(`Error discovering models: ${err instanceof Error ? err.message : String(err)}`);
9202
9202
  }
9203
9203
  }
9204
9204
  async function syncInitCommand(platform, model, options) {
9205
9205
  if (!options.config) {
9206
9206
  const api = getApi();
9207
- const spinner4 = createSpinner();
9208
- spinner4.start(`Looking up ${platform}/${model}...`);
9207
+ const spinner = createSpinner();
9208
+ spinner.start(`Looking up ${platform}/${model}...`);
9209
9209
  try {
9210
9210
  const models = await discoverModels(api, platform);
9211
9211
  const match = models.find((m) => m.name === model || m.name.toLowerCase() === model.toLowerCase());
@@ -9215,9 +9215,9 @@ async function syncInitCommand(platform, model, options) {
9215
9215
  if (actionId && !actionId.startsWith("conn_mod_def::")) {
9216
9216
  actionId = void 0;
9217
9217
  }
9218
- spinner4.stop(actionId ? "Found model + action ID" : "Found model (action ID not resolved)");
9218
+ spinner.stop(actionId ? "Found model + action ID" : "Found model (action ID not resolved)");
9219
9219
  } else {
9220
- spinner4.stop("Model not found in available actions");
9220
+ spinner.stop("Model not found in available actions");
9221
9221
  }
9222
9222
  const builtin = loadBuiltinProfile(platform, model);
9223
9223
  let template;
@@ -9317,7 +9317,7 @@ Run with --config to save:
9317
9317
  }
9318
9318
  }
9319
9319
  } catch (err) {
9320
- spinner4.stop("Failed");
9320
+ spinner.stop("Failed");
9321
9321
  error(`Error: ${err instanceof Error ? err.message : String(err)}`);
9322
9322
  }
9323
9323
  return;
@@ -9602,7 +9602,7 @@ ${result.total} results`);
9602
9602
  }
9603
9603
  }
9604
9604
  async function syncSqlCommand(platformModel, sql) {
9605
- const { syncSqlCommand: runSyncSql } = await import("./sql-5GNNGVNH.js");
9605
+ const { syncSqlCommand: runSyncSql } = await import("./sql-AKQSXRV2.js");
9606
9606
  await runSyncSql(platformModel, sql);
9607
9607
  }
9608
9608
  async function syncDeleteCommand(platformModel, options) {
@@ -9680,7 +9680,7 @@ async function syncDeleteCommand(platformModel, options) {
9680
9680
  async function maybeAutoMigrateLegacy(platform, models) {
9681
9681
  const dbSize = getDatabaseSize(platform);
9682
9682
  if (!dbSize || dbSize === "0 B") return;
9683
- const { getBackend: getBackend2 } = await import("./runtime-DTKLN6KX.js");
9683
+ const { getBackend: getBackend2 } = await import("./runtime-HLW365HP.js");
9684
9684
  const backend = await getBackend2();
9685
9685
  let memoryHasData = false;
9686
9686
  for (const model of models) {
@@ -9696,7 +9696,7 @@ async function maybeAutoMigrateLegacy(platform, models) {
9696
9696
  ` detected legacy .one/sync/data/${platform}.db (${dbSize}) \u2014 auto-migrating into memory before sync.
9697
9697
  `
9698
9698
  );
9699
- const { memMigrateCommand: memMigrateCommand3 } = await import("./migrate-DWRR6FWW.js");
9699
+ const { memMigrateCommand: memMigrateCommand3 } = await import("./migrate-3LSEIPRF.js");
9700
9700
  await memMigrateCommand3({ platform, yes: true });
9701
9701
  return;
9702
9702
  }
@@ -9705,7 +9705,7 @@ async function maybeAutoMigrateLegacy(platform, models) {
9705
9705
  initialValue: true
9706
9706
  });
9707
9707
  if (p6.isCancel(shouldMigrate) || !shouldMigrate) return;
9708
- const { memMigrateCommand: memMigrateCommand2 } = await import("./migrate-DWRR6FWW.js");
9708
+ const { memMigrateCommand: memMigrateCommand2 } = await import("./migrate-3LSEIPRF.js");
9709
9709
  await memMigrateCommand2({ platform, yes: true });
9710
9710
  }
9711
9711
  async function syncSuggestSearchableCommand(platformModel, options = {}) {
@@ -9766,7 +9766,7 @@ async function syncSuggestSearchableCommand(platformModel, options = {}) {
9766
9766
  async function syncListCommand(platform) {
9767
9767
  const profiles = listProfiles(platform);
9768
9768
  const state = await readSyncState();
9769
- const { getBackend: getBackend2 } = await import("./runtime-DTKLN6KX.js");
9769
+ const { getBackend: getBackend2 } = await import("./runtime-HLW365HP.js");
9770
9770
  const backend = await getBackend2();
9771
9771
  const syncs = await Promise.all(profiles.map(async (p9) => {
9772
9772
  const modelState = state[p9.platform]?.[p9.model];
@@ -10042,7 +10042,7 @@ function registerSyncSubcommands(sync) {
10042
10042
  await syncSqlCommand(platformModel, sql);
10043
10043
  });
10044
10044
  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) => {
10045
- const { syncSchemaCommand } = await import("./schema-SQA46NFA.js");
10045
+ const { syncSchemaCommand } = await import("./schema-FICQRMZ7.js");
10046
10046
  await syncSchemaCommand(platformModel);
10047
10047
  });
10048
10048
  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) => {
@@ -10819,7 +10819,7 @@ async function memDoctorCommand() {
10819
10819
  }
10820
10820
  if (cfg.embedding.provider === "openai") {
10821
10821
  try {
10822
- const { embed: embed2 } = await import("./embedding-DRTGVWP3.js");
10822
+ const { embed: embed2 } = await import("./embedding-C7FIKORV.js");
10823
10823
  const result = await embed2("connectivity check");
10824
10824
  checks.push({
10825
10825
  name: "OpenAI embedding provider reachable",
@@ -11243,8 +11243,8 @@ async function cacheUpdateAllCommand() {
11243
11243
  console.log("No cached entries to update");
11244
11244
  return;
11245
11245
  }
11246
- const spinner4 = createSpinner();
11247
- spinner4.start(`Updating ${entries.length} cached ${entries.length === 1 ? "entry" : "entries"}...`);
11246
+ const spinner = createSpinner();
11247
+ spinner.start(`Updating ${entries.length} cached ${entries.length === 1 ? "entry" : "entries"}...`);
11248
11248
  let updated = 0;
11249
11249
  let failed = 0;
11250
11250
  const errors = [];
@@ -11261,7 +11261,7 @@ async function cacheUpdateAllCommand() {
11261
11261
  });
11262
11262
  }
11263
11263
  }
11264
- spinner4.stop(`Updated ${updated} ${updated === 1 ? "entry" : "entries"}${failed > 0 ? `, ${failed} failed` : ""}`);
11264
+ spinner.stop(`Updated ${updated} ${updated === 1 ? "entry" : "entries"}${failed > 0 ? `, ${failed} failed` : ""}`);
11265
11265
  if (isAgentMode()) {
11266
11266
  json({ updated, failed, errors: errors.length > 0 ? errors : void 0 });
11267
11267
  return;
@@ -3,12 +3,12 @@ import {
3
3
  dotPathToJsonbExpr,
4
4
  memMigrateCommand,
5
5
  reviveStringifiedJson
6
- } from "./chunk-C7GJ5GUQ.js";
6
+ } from "./chunk-XKUTG7JD.js";
7
7
  import "./chunk-44CV5IMX.js";
8
- import "./chunk-5MDUKW5N.js";
9
- import "./chunk-Y5JEZWWM.js";
10
- import "./chunk-WMVVWO6N.js";
11
- import "./chunk-GGDXUXLM.js";
8
+ import "./chunk-NOFJ4NYD.js";
9
+ import "./chunk-NOPTG4GC.js";
10
+ import "./chunk-3HRC3IPE.js";
11
+ import "./chunk-HTXZZQ6U.js";
12
12
  export {
13
13
  buildIdentityMap,
14
14
  dotPathToJsonbExpr,
@@ -5,9 +5,9 @@ import {
5
5
  resetBackendSingleton,
6
6
  updateRecord,
7
7
  upsertRecord
8
- } from "./chunk-Y5JEZWWM.js";
9
- import "./chunk-WMVVWO6N.js";
10
- import "./chunk-GGDXUXLM.js";
8
+ } from "./chunk-NOPTG4GC.js";
9
+ import "./chunk-3HRC3IPE.js";
10
+ import "./chunk-HTXZZQ6U.js";
11
11
  export {
12
12
  addRecord,
13
13
  closeBackendIfCached,
@@ -3,12 +3,12 @@ import {
3
3
  note,
4
4
  okJson,
5
5
  requireMemoryInit
6
- } from "./chunk-5MDUKW5N.js";
6
+ } from "./chunk-NOFJ4NYD.js";
7
7
  import {
8
8
  getBackend
9
- } from "./chunk-Y5JEZWWM.js";
10
- import "./chunk-WMVVWO6N.js";
11
- import "./chunk-GGDXUXLM.js";
9
+ } from "./chunk-NOPTG4GC.js";
10
+ import "./chunk-3HRC3IPE.js";
11
+ import "./chunk-HTXZZQ6U.js";
12
12
 
13
13
  // src/lib/memory/sync/schema.ts
14
14
  import pc from "picocolors";
@@ -0,0 +1,12 @@
1
+ import {
2
+ memSqlCommand,
3
+ syncSqlCommand
4
+ } from "./chunk-7FPQOAQ4.js";
5
+ import "./chunk-NOFJ4NYD.js";
6
+ import "./chunk-NOPTG4GC.js";
7
+ import "./chunk-3HRC3IPE.js";
8
+ import "./chunk-HTXZZQ6U.js";
9
+ export {
10
+ memSqlCommand,
11
+ syncSqlCommand
12
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@withone/cli",
3
- "version": "2.3.0",
3
+ "version": "2.3.2",
4
4
  "description": "CLI for managing One",
5
5
  "type": "module",
6
6
  "files": [
@@ -1,12 +0,0 @@
1
- import {
2
- memSqlCommand,
3
- syncSqlCommand
4
- } from "./chunk-V4LY2G2F.js";
5
- import "./chunk-5MDUKW5N.js";
6
- import "./chunk-Y5JEZWWM.js";
7
- import "./chunk-WMVVWO6N.js";
8
- import "./chunk-GGDXUXLM.js";
9
- export {
10
- memSqlCommand,
11
- syncSqlCommand
12
- };