@arbidocs/cli 0.3.43 → 0.3.45

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/CHANGELOG.md CHANGED
@@ -1,12 +1,32 @@
1
1
  # Changelog
2
2
 
3
- ## v0.3.43
3
+ ## v0.3.45
4
+
5
+ [compare changes](https://github.com/arbicity/ARBI-frontend/compare/v0.3.44...HEAD)
6
+
7
+ ### 🚀 Enhancements
8
+
9
+ - Skeleton-first document loading with on-demand column backfill ([39ef78a6](https://github.com/arbicity/ARBI-frontend/commit/39ef78a6))
10
+
11
+ ## v0.3.44
4
12
 
5
13
  [compare changes](https://github.com/arbicity/ARBI-frontend/compare/v0.3.42...HEAD)
6
14
 
7
- ### 🏡 Chore
15
+ ### 🚀 Enhancements
16
+
17
+ - **documents:** Pulse tab badge + dedupe progressive-loading subscription ([#632](https://github.com/arbicity/ARBI-frontend/pull/632))
18
+
19
+ ### 🩹 Fixes
20
+
21
+ - **cli:** Clean Ctrl+C in quickstart; expand SKILL.md for agents ([#621](https://github.com/arbicity/ARBI-frontend/pull/621))
22
+
23
+ ## v0.3.42
24
+
25
+ [compare changes](https://github.com/arbicity/ARBI-frontend/compare/v0.3.40...HEAD)
26
+
27
+ ### 🚀 Enhancements
8
28
 
9
- - Release v0.3.42 [skip ci] ([0b0830d0](https://github.com/arbicity/ARBI-frontend/commit/0b0830d0))
29
+ - **cli:** Workspace improvements --json, workspace current, delete + copy fixes ([#623](https://github.com/arbicity/ARBI-frontend/pull/623))
10
30
 
11
31
  ## v0.3.40
12
32
 
package/dist/index.js CHANGED
@@ -3641,7 +3641,7 @@ function getLatestVersion(skipCache = false) {
3641
3641
  }
3642
3642
  }
3643
3643
  function getCurrentVersion() {
3644
- return "0.3.43";
3644
+ return "0.3.45";
3645
3645
  }
3646
3646
  function readChangelog(fromVersion, toVersion) {
3647
3647
  try {
@@ -3694,17 +3694,17 @@ function showChangelog(fromVersion, toVersion) {
3694
3694
  async function checkForUpdates(autoUpdate) {
3695
3695
  try {
3696
3696
  const latest = getLatestVersion();
3697
- if (!latest || latest === "0.3.43") return;
3697
+ if (!latest || latest === "0.3.45") return;
3698
3698
  if (autoUpdate) {
3699
3699
  warn(`
3700
- Your arbi version is out of date (${"0.3.43"} \u2192 ${latest}). Updating...`);
3700
+ Your arbi version is out of date (${"0.3.45"} \u2192 ${latest}). Updating...`);
3701
3701
  child_process.execSync("npm install -g @arbidocs/cli@latest", { stdio: "inherit" });
3702
- showChangelog("0.3.43", latest);
3702
+ showChangelog("0.3.45", latest);
3703
3703
  console.log(`Updated to ${latest}.`);
3704
3704
  } else {
3705
3705
  warn(
3706
3706
  `
3707
- Your arbi version is out of date (${"0.3.43"} \u2192 ${latest}).
3707
+ Your arbi version is out of date (${"0.3.45"} \u2192 ${latest}).
3708
3708
  Run "arbi update" to upgrade, or "arbi update auto" to always stay up to date.`
3709
3709
  );
3710
3710
  }
@@ -3714,9 +3714,9 @@ Run "arbi update" to upgrade, or "arbi update auto" to always stay up to date.`
3714
3714
  function hintUpdateOnError() {
3715
3715
  try {
3716
3716
  const cached = readCache();
3717
- if (cached && cached.latest !== "0.3.43") {
3717
+ if (cached && cached.latest !== "0.3.45") {
3718
3718
  warn(
3719
- `Your arbi version is out of date (${"0.3.43"} \u2192 ${cached.latest}). Run "arbi update".`
3719
+ `Your arbi version is out of date (${"0.3.45"} \u2192 ${cached.latest}). Run "arbi update".`
3720
3720
  );
3721
3721
  }
3722
3722
  } catch {
@@ -7910,145 +7910,160 @@ Updated to ${latest}.`);
7910
7910
  success("Auto-update enabled. ARBI CLI will update automatically on login.");
7911
7911
  });
7912
7912
  }
7913
+ function isExitPromptError(err) {
7914
+ return err instanceof Error && err.name === "ExitPromptError";
7915
+ }
7913
7916
  function registerQuickstartCommand(program2) {
7914
7917
  program2.command("quickstart").description("Interactive setup wizard \u2014 configure, register/login, and select a workspace").argument("[url]", "Server URL (auto-detected if omitted)").action(async (url) => {
7915
- console.log("\nWelcome to ARBI CLI setup!\n");
7916
- const { config, source } = store.resolveConfigWithFallbacks();
7917
- if (url) {
7918
- const domain = new URL(url).hostname;
7919
- config.baseUrl = url.replace(/\/$/, "");
7918
+ try {
7919
+ await runQuickstart(url);
7920
+ } catch (err) {
7921
+ if (isExitPromptError(err)) {
7922
+ console.log("\nSetup cancelled.");
7923
+ process.exit(130);
7924
+ }
7925
+ error(`Quickstart failed: ${sdk.getErrorMessage(err)}`);
7926
+ process.exit(1);
7927
+ }
7928
+ });
7929
+ }
7930
+ async function runQuickstart(url) {
7931
+ console.log("\nWelcome to ARBI CLI setup!\n");
7932
+ const { config, source } = store.resolveConfigWithFallbacks();
7933
+ if (url) {
7934
+ const domain = new URL(url).hostname;
7935
+ config.baseUrl = url.replace(/\/$/, "");
7936
+ config.deploymentDomain = domain;
7937
+ store.saveConfig(config);
7938
+ }
7939
+ const useDetected = await promptConfirm(`Use server ${config.baseUrl}?`, true);
7940
+ if (!useDetected) {
7941
+ const customUrl = await promptInput("Server URL");
7942
+ try {
7943
+ const domain = new URL(customUrl).hostname;
7944
+ config.baseUrl = customUrl.replace(/\/$/, "");
7920
7945
  config.deploymentDomain = domain;
7921
7946
  store.saveConfig(config);
7947
+ } catch {
7948
+ error("Invalid URL");
7949
+ process.exit(1);
7922
7950
  }
7923
- const useDetected = await promptConfirm(`Use server ${config.baseUrl}?`, true);
7924
- if (!useDetected) {
7925
- const customUrl = await promptInput("Server URL");
7926
- try {
7927
- const domain = new URL(customUrl).hostname;
7928
- config.baseUrl = customUrl.replace(/\/$/, "");
7929
- config.deploymentDomain = domain;
7930
- store.saveConfig(config);
7931
- } catch {
7932
- error("Invalid URL");
7933
- process.exit(1);
7934
- }
7935
- } else if (source !== "config") {
7936
- store.saveConfig(config);
7951
+ } else if (source !== "config") {
7952
+ store.saveConfig(config);
7953
+ }
7954
+ dim(`Server: ${config.baseUrl}`);
7955
+ const action = await promptSelect("Do you have an account?", [
7956
+ { name: "Yes, log me in", value: "login" },
7957
+ { name: "No, register a new account", value: "register" }
7958
+ ]);
7959
+ const arbiClient = client.createArbiClient({
7960
+ baseUrl: config.baseUrl,
7961
+ deploymentDomain: config.deploymentDomain,
7962
+ credentials: "omit"
7963
+ });
7964
+ await arbiClient.crypto.initSodium();
7965
+ let email;
7966
+ let password2;
7967
+ if (action === "register") {
7968
+ email = await promptInput("Email");
7969
+ password2 = await promptPassword("Password");
7970
+ const confirmPw = await promptPassword("Confirm password");
7971
+ if (password2 !== confirmPw) {
7972
+ error("Passwords do not match.");
7973
+ process.exit(1);
7937
7974
  }
7938
- dim(`Server: ${config.baseUrl}`);
7939
- const action = await promptSelect("Do you have an account?", [
7940
- { name: "Yes, log me in", value: "login" },
7941
- { name: "No, register a new account", value: "register" }
7975
+ const codeMethod = await promptSelect("Verification method", [
7976
+ { name: "I have an invitation code", value: "code" },
7977
+ { name: "Send me a verification email", value: "email" }
7942
7978
  ]);
7943
- const arbiClient = client.createArbiClient({
7944
- baseUrl: config.baseUrl,
7945
- deploymentDomain: config.deploymentDomain,
7946
- credentials: "omit"
7947
- });
7948
- await arbiClient.crypto.initSodium();
7949
- let email;
7950
- let password2;
7951
- if (action === "register") {
7952
- email = await promptInput("Email");
7953
- password2 = await promptPassword("Password");
7954
- const confirmPw = await promptPassword("Confirm password");
7955
- if (password2 !== confirmPw) {
7956
- error("Passwords do not match.");
7957
- process.exit(1);
7958
- }
7959
- const codeMethod = await promptSelect("Verification method", [
7960
- { name: "I have an invitation code", value: "code" },
7961
- { name: "Send me a verification email", value: "email" }
7962
- ]);
7963
- let verificationCode;
7964
- if (codeMethod === "code") {
7965
- verificationCode = await promptInput("Invitation code");
7966
- } else {
7967
- console.log("Sending verification email...");
7968
- const verifyResponse = await arbiClient.fetch.POST("/v1/user/verify-email", {
7969
- body: { email }
7970
- });
7971
- if (verifyResponse.error) {
7972
- error(`Failed to send verification email: ${JSON.stringify(verifyResponse.error)}`);
7973
- process.exit(1);
7974
- }
7975
- success("Verification email sent. Check your inbox.");
7976
- verificationCode = await promptInput("Verification code");
7977
- }
7978
- try {
7979
- const firstName = await promptInput("First name", false) || "User";
7980
- const lastName = await promptInput("Last name", false) || "";
7981
- await arbiClient.auth.register({
7982
- email,
7983
- password: password2,
7984
- verificationCode,
7985
- firstName,
7986
- lastName
7987
- });
7988
- success(`Registered as ${email}`);
7989
- } catch (err) {
7990
- error(`Registration failed: ${sdk.getErrorMessage(err)}`);
7979
+ let verificationCode;
7980
+ if (codeMethod === "code") {
7981
+ verificationCode = await promptInput("Invitation code");
7982
+ } else {
7983
+ console.log("Sending verification email...");
7984
+ const verifyResponse = await arbiClient.fetch.POST("/v1/user/verify-email", {
7985
+ body: { email }
7986
+ });
7987
+ if (verifyResponse.error) {
7988
+ error(`Failed to send verification email: ${JSON.stringify(verifyResponse.error)}`);
7991
7989
  process.exit(1);
7992
7990
  }
7993
- } else {
7994
- email = await promptInput("Email");
7995
- password2 = await promptPassword("Password");
7991
+ success("Verification email sent. Check your inbox.");
7992
+ verificationCode = await promptInput("Verification code");
7996
7993
  }
7997
7994
  try {
7998
- const { arbi, loginResult } = await sdk.performPasswordLogin(config, email, password2, store);
7999
- success(`Logged in as ${email}`);
8000
- const { data: workspaces3 } = await arbi.fetch.GET("/v1/user/workspaces");
8001
- const wsList = workspaces3 || [];
8002
- const memberWorkspaces = wsList.filter(
8003
- (ws) => ws.users?.some((u) => u.user.email === email)
7995
+ const firstName = await promptInput("First name", false) || "User";
7996
+ const lastName = await promptInput("Last name", false) || "";
7997
+ await arbiClient.auth.register({
7998
+ email,
7999
+ password: password2,
8000
+ verificationCode,
8001
+ firstName,
8002
+ lastName
8003
+ });
8004
+ success(`Registered as ${email}`);
8005
+ } catch (err) {
8006
+ if (isExitPromptError(err)) throw err;
8007
+ error(`Registration failed: ${sdk.getErrorMessage(err)}`);
8008
+ process.exit(1);
8009
+ }
8010
+ } else {
8011
+ email = await promptInput("Email");
8012
+ password2 = await promptPassword("Password");
8013
+ }
8014
+ try {
8015
+ const { arbi, loginResult } = await sdk.performPasswordLogin(config, email, password2, store);
8016
+ success(`Logged in as ${email}`);
8017
+ const { data: workspaces3 } = await arbi.fetch.GET("/v1/user/workspaces");
8018
+ const wsList = workspaces3 || [];
8019
+ const memberWorkspaces = wsList.filter((ws) => ws.users?.some((u) => u.user.email === email));
8020
+ const userProjects = await sdk.projects.listProjects(arbi);
8021
+ const defaultProjectExtId = userProjects[0]?.external_id;
8022
+ if (!defaultProjectExtId) throw new Error("No projects found for user");
8023
+ let workspaceId;
8024
+ let workspaceName;
8025
+ if (memberWorkspaces.length === 0) {
8026
+ console.log("Creating your first workspace...");
8027
+ const encryptedKey = await sdk.generateNewWorkspaceKey(arbi, loginResult.serverSessionKey);
8028
+ const ws = await sdk.workspaces.createWorkspace(
8029
+ arbi,
8030
+ "My Workspace",
8031
+ encryptedKey,
8032
+ defaultProjectExtId
8004
8033
  );
8005
- const userProjects = await sdk.projects.listProjects(arbi);
8006
- const defaultProjectExtId = userProjects[0]?.external_id;
8007
- if (!defaultProjectExtId) throw new Error("No projects found for user");
8008
- let workspaceId;
8009
- let workspaceName;
8010
- if (memberWorkspaces.length === 0) {
8011
- console.log("Creating your first workspace...");
8012
- const encryptedKey = await sdk.generateNewWorkspaceKey(arbi, loginResult.serverSessionKey);
8013
- const ws = await sdk.workspaces.createWorkspace(
8014
- arbi,
8015
- "My Workspace",
8016
- encryptedKey,
8017
- defaultProjectExtId
8018
- );
8034
+ workspaceId = ws.external_id;
8035
+ workspaceName = ws.name;
8036
+ } else {
8037
+ const choices = [
8038
+ ...sdk.formatWorkspaceChoices(memberWorkspaces),
8039
+ { name: "+ Create new workspace", value: "__new__", description: "" }
8040
+ ];
8041
+ const selected = await promptSelect("Select workspace", choices);
8042
+ if (selected === "__new__") {
8043
+ const name = await promptInput("Workspace name", false) || "My Workspace";
8044
+ const encKey = await sdk.generateNewWorkspaceKey(arbi, loginResult.serverSessionKey);
8045
+ const ws = await sdk.workspaces.createWorkspace(arbi, name, encKey, defaultProjectExtId);
8019
8046
  workspaceId = ws.external_id;
8020
8047
  workspaceName = ws.name;
8021
8048
  } else {
8022
- const choices = [
8023
- ...sdk.formatWorkspaceChoices(memberWorkspaces),
8024
- { name: "+ Create new workspace", value: "__new__", description: "" }
8025
- ];
8026
- const selected = await promptSelect("Select workspace", choices);
8027
- if (selected === "__new__") {
8028
- const name = await promptInput("Workspace name", false) || "My Workspace";
8029
- const encKey = await sdk.generateNewWorkspaceKey(arbi, loginResult.serverSessionKey);
8030
- const ws = await sdk.workspaces.createWorkspace(arbi, name, encKey, defaultProjectExtId);
8031
- workspaceId = ws.external_id;
8032
- workspaceName = ws.name;
8033
- } else {
8034
- workspaceId = selected;
8035
- workspaceName = memberWorkspaces.find((w) => w.external_id === selected)?.name || "";
8036
- }
8049
+ workspaceId = selected;
8050
+ workspaceName = memberWorkspaces.find((w) => w.external_id === selected)?.name || "";
8037
8051
  }
8038
- updateConfig({ selectedWorkspaceId: workspaceId });
8039
- console.log("");
8040
- success("Setup complete!");
8041
- console.log("");
8042
- console.log(` Server: ${ref(config.baseUrl)}`);
8043
- console.log(` Account: ${ref(email)}`);
8044
- console.log(` Workspace: ${workspaceName} (${ref(workspaceId)})`);
8045
- console.log("");
8046
- dim('Try: arbi ask "hello"');
8047
- } catch (err) {
8048
- error(`Login failed: ${sdk.getErrorMessage(err)}`);
8049
- process.exit(1);
8050
8052
  }
8051
- });
8053
+ updateConfig({ selectedWorkspaceId: workspaceId });
8054
+ console.log("");
8055
+ success("Setup complete!");
8056
+ console.log("");
8057
+ console.log(` Server: ${ref(config.baseUrl)}`);
8058
+ console.log(` Account: ${ref(email)}`);
8059
+ console.log(` Workspace: ${workspaceName} (${ref(workspaceId)})`);
8060
+ console.log("");
8061
+ dim('Try: arbi ask "hello"');
8062
+ } catch (err) {
8063
+ if (isExitPromptError(err)) throw err;
8064
+ error(`Login failed: ${sdk.getErrorMessage(err)}`);
8065
+ process.exit(1);
8066
+ }
8052
8067
  }
8053
8068
  var CENTRAL_API_URL2 = "https://central.arbi.work";
8054
8069
  var DEFAULT_PASSWORD = "agent-dev-1234";
@@ -8606,7 +8621,7 @@ console.info = (...args) => {
8606
8621
  _origInfo(...args);
8607
8622
  };
8608
8623
  var program = new commander.Command();
8609
- program.name("arbi").description("ARBI CLI \u2014 interact with ARBI from the terminal").version("0.3.43");
8624
+ program.name("arbi").description("ARBI CLI \u2014 interact with ARBI from the terminal").version("0.3.45");
8610
8625
  registerConfigCommand(program);
8611
8626
  registerLoginCommand(program);
8612
8627
  registerRegisterCommand(program);