@arbidocs/cli 0.3.7 → 0.3.9

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,50 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.3.9
4
+
5
+ [compare changes](https://github.com/arbicity/ARBI-frontend/compare/v0.3.8...HEAD)
6
+
7
+ ### 🚀 Enhancements
8
+
9
+ - Run integration tests against local E2E backend ([#404](https://github.com/arbicity/ARBI-frontend/pull/404))
10
+
11
+ ### 🩹 Fixes
12
+
13
+ - Bundle CHANGELOG.md in CLI package for offline changelog display ([18d44cfa](https://github.com/arbicity/ARBI-frontend/commit/18d44cfa))
14
+ - Bypass version cache on explicit arbi update ([570d013d](https://github.com/arbicity/ARBI-frontend/commit/570d013d))
15
+ - Update GitHub org references from arbitrationcity to arbicity ([#393](https://github.com/arbicity/ARBI-frontend/pull/393))
16
+ - Update E2E health check URL from /api/ to /v1/ ([51308e65](https://github.com/arbicity/ARBI-frontend/commit/51308e65))
17
+
18
+ ### 🏡 Chore
19
+
20
+ - Update OpenAPI schema — add PlanningLLM, VisionLLM configs ([03f9183a](https://github.com/arbicity/ARBI-frontend/commit/03f9183a))
21
+ - Release v0.3.6 ([a15fbacc](https://github.com/arbicity/ARBI-frontend/commit/a15fbacc))
22
+ - Release v0.3.7 ([a8f1156f](https://github.com/arbicity/ARBI-frontend/commit/a8f1156f))
23
+ - Release v0.3.8 ([2863a411](https://github.com/arbicity/ARBI-frontend/commit/2863a411))
24
+
25
+ ### ❤️ Contributors
26
+
27
+ - Dmitri Evseev ([@arbi-dev](https://github.com/arbi-dev))
28
+
29
+ ## v0.3.8
30
+
31
+ [compare changes](https://github.com/arbicity/ARBI-frontend/compare/v0.3.7...HEAD)
32
+
33
+ ### 🩹 Fixes
34
+
35
+ - Bypass version cache on explicit arbi update ([570d013d](https://github.com/arbicity/ARBI-frontend/commit/570d013d))
36
+
37
+ ### ❤️ Contributors
38
+
39
+ - Dmitri Evseev <dmitri.evseev@arbi.city>
40
+
3
41
  ## v0.3.7
4
42
 
5
- [compare changes](https://github.com/arbitrationcity/ARBI-frontend/compare/v0.3.6...HEAD)
43
+ [compare changes](https://github.com/arbicity/ARBI-frontend/compare/v0.3.6...HEAD)
6
44
 
7
45
  ### 🩹 Fixes
8
46
 
9
- - Bundle CHANGELOG.md in CLI package for offline changelog display ([18d44cfa](https://github.com/arbitrationcity/ARBI-frontend/commit/18d44cfa))
47
+ - Bundle CHANGELOG.md in CLI package for offline changelog display ([18d44cfa](https://github.com/arbicity/ARBI-frontend/commit/18d44cfa))
10
48
 
11
49
  ### ❤️ Contributors
12
50
 
@@ -14,17 +52,17 @@
14
52
 
15
53
  ## v0.3.6
16
54
 
17
- [compare changes](https://github.com/arbitrationcity/ARBI-frontend/compare/v0.3.5...HEAD)
55
+ [compare changes](https://github.com/arbicity/ARBI-frontend/compare/v0.3.5...HEAD)
18
56
 
19
57
  ### 🚀 Enhancements
20
58
 
21
- - Unify artifacts into document viewer ([#385](https://github.com/arbitrationcity/ARBI-frontend/pull/385))
22
- - Surface agent focus text and backend elapsed time in topline ([#386](https://github.com/arbitrationcity/ARBI-frontend/pull/386))
23
- - Enable interjection — send messages while agent streams ([#387](https://github.com/arbitrationcity/ARBI-frontend/pull/387), [#388](https://github.com/arbitrationcity/ARBI-frontend/pull/388))
59
+ - Unify artifacts into document viewer ([#385](https://github.com/arbicity/ARBI-frontend/pull/385))
60
+ - Surface agent focus text and backend elapsed time in topline ([#386](https://github.com/arbicity/ARBI-frontend/pull/386))
61
+ - Enable interjection — send messages while agent streams ([#387](https://github.com/arbicity/ARBI-frontend/pull/387), [#388](https://github.com/arbicity/ARBI-frontend/pull/388))
24
62
 
25
63
  ### 🏡 Chore
26
64
 
27
- - Update OpenAPI schema — add PlanningLLM, VisionLLM configs ([03f9183a](https://github.com/arbitrationcity/ARBI-frontend/commit/03f9183a))
65
+ - Update OpenAPI schema — add PlanningLLM, VisionLLM configs ([03f9183a](https://github.com/arbicity/ARBI-frontend/commit/03f9183a))
28
66
 
29
67
  ### ❤️ Contributors
30
68
 
@@ -32,15 +70,15 @@
32
70
 
33
71
  ## v0.3.5
34
72
 
35
- [compare changes](https://github.com/arbitrationcity/ARBI-frontend/compare/v0.3.4...HEAD)
73
+ [compare changes](https://github.com/arbicity/ARBI-frontend/compare/v0.3.4...HEAD)
36
74
 
37
75
  ### 🚀 Enhancements
38
76
 
39
- - Add ANSI colors to CLI + DRY WebSocket formatting ([#380](https://github.com/arbitrationcity/ARBI-frontend/pull/380), [#381](https://github.com/arbitrationcity/ARBI-frontend/pull/381))
77
+ - Add ANSI colors to CLI + DRY WebSocket formatting ([#380](https://github.com/arbicity/ARBI-frontend/pull/380), [#381](https://github.com/arbicity/ARBI-frontend/pull/381))
40
78
 
41
79
  ### 🩹 Fixes
42
80
 
43
- - Remove "type": "module" from CLI/TUI packages ([e4b58d05](https://github.com/arbitrationcity/ARBI-frontend/commit/e4b58d05))
81
+ - Remove "type": "module" from CLI/TUI packages ([e4b58d05](https://github.com/arbicity/ARBI-frontend/commit/e4b58d05))
44
82
 
45
83
  ### ❤️ Contributors
46
84
 
@@ -48,48 +86,48 @@
48
86
 
49
87
  ## v0.3.4
50
88
 
51
- [compare changes](https://github.com/arbitrationcity/ARBI-frontend/compare/v0.3.3...HEAD)
89
+ [compare changes](https://github.com/arbicity/ARBI-frontend/compare/v0.3.3...HEAD)
52
90
 
53
91
  ### 🚀 Enhancements
54
92
 
55
- - Add high-level Arbi class, React hooks package, and examples ([a5f93a79](https://github.com/arbitrationcity/ARBI-frontend/commit/a5f93a79))
56
- - Add requestVerification() and register() to Arbi class ([c10db0c5](https://github.com/arbitrationcity/ARBI-frontend/commit/c10db0c5))
57
- - Add arbi update command + inject version at build time ([ddddfa58](https://github.com/arbitrationcity/ARBI-frontend/commit/ddddfa58))
58
- - Warn when CLI is outdated on login and status ([5eb28d44](https://github.com/arbitrationcity/ARBI-frontend/commit/5eb28d44))
59
- - Auto-update on login + clearer version warnings ([fda59831](https://github.com/arbitrationcity/ARBI-frontend/commit/fda59831))
60
- - Add fetch retry for ECONNREFUSED + scriptable register command ([4e09d6be](https://github.com/arbitrationcity/ARBI-frontend/commit/4e09d6be))
61
- - Add changelog generation to publish script ([cc7e7b9f](https://github.com/arbitrationcity/ARBI-frontend/commit/cc7e7b9f))
62
- - Show changelog on update and auto-update ([b89d0c03](https://github.com/arbitrationcity/ARBI-frontend/commit/b89d0c03))
63
- - Auto-create GitHub release + push in publish script ([9f31378c](https://github.com/arbitrationcity/ARBI-frontend/commit/9f31378c))
93
+ - Add high-level Arbi class, React hooks package, and examples ([a5f93a79](https://github.com/arbicity/ARBI-frontend/commit/a5f93a79))
94
+ - Add requestVerification() and register() to Arbi class ([c10db0c5](https://github.com/arbicity/ARBI-frontend/commit/c10db0c5))
95
+ - Add arbi update command + inject version at build time ([ddddfa58](https://github.com/arbicity/ARBI-frontend/commit/ddddfa58))
96
+ - Warn when CLI is outdated on login and status ([5eb28d44](https://github.com/arbicity/ARBI-frontend/commit/5eb28d44))
97
+ - Auto-update on login + clearer version warnings ([fda59831](https://github.com/arbicity/ARBI-frontend/commit/fda59831))
98
+ - Add fetch retry for ECONNREFUSED + scriptable register command ([4e09d6be](https://github.com/arbicity/ARBI-frontend/commit/4e09d6be))
99
+ - Add changelog generation to publish script ([cc7e7b9f](https://github.com/arbicity/ARBI-frontend/commit/cc7e7b9f))
100
+ - Show changelog on update and auto-update ([b89d0c03](https://github.com/arbicity/ARBI-frontend/commit/b89d0c03))
101
+ - Auto-create GitHub release + push in publish script ([9f31378c](https://github.com/arbicity/ARBI-frontend/commit/9f31378c))
64
102
 
65
103
  ### 🩹 Fixes
66
104
 
67
- - Zero key material on logout before clearing references ([c3f785fb](https://github.com/arbitrationcity/ARBI-frontend/commit/c3f785fb))
68
- - Move react-query to dependency, add example links to READMEs ([9643d497](https://github.com/arbitrationcity/ARBI-frontend/commit/9643d497))
69
- - Unify all @arbidocs packages to v0.3.0 + fix hello-world example ([90dd5b8b](https://github.com/arbitrationcity/ARBI-frontend/commit/90dd5b8b))
70
- - Publish script smoke test checks correct dist files ([e9c7f51a](https://github.com/arbitrationcity/ARBI-frontend/commit/e9c7f51a))
71
- - Only show version warning on login, hint on errors ([682070ee](https://github.com/arbitrationcity/ARBI-frontend/commit/682070ee))
72
- - Share changelog across npm + GitHub ([244274f3](https://github.com/arbitrationcity/ARBI-frontend/commit/244274f3))
73
- - Preserve changelog header when prepending new releases ([bb7c94da](https://github.com/arbitrationcity/ARBI-frontend/commit/bb7c94da))
105
+ - Zero key material on logout before clearing references ([c3f785fb](https://github.com/arbicity/ARBI-frontend/commit/c3f785fb))
106
+ - Move react-query to dependency, add example links to READMEs ([9643d497](https://github.com/arbicity/ARBI-frontend/commit/9643d497))
107
+ - Unify all @arbidocs packages to v0.3.0 + fix hello-world example ([90dd5b8b](https://github.com/arbicity/ARBI-frontend/commit/90dd5b8b))
108
+ - Publish script smoke test checks correct dist files ([e9c7f51a](https://github.com/arbicity/ARBI-frontend/commit/e9c7f51a))
109
+ - Only show version warning on login, hint on errors ([682070ee](https://github.com/arbicity/ARBI-frontend/commit/682070ee))
110
+ - Share changelog across npm + GitHub ([244274f3](https://github.com/arbicity/ARBI-frontend/commit/244274f3))
111
+ - Preserve changelog header when prepending new releases ([bb7c94da](https://github.com/arbicity/ARBI-frontend/commit/bb7c94da))
74
112
 
75
113
  ### 💅 Refactors
76
114
 
77
- - Arbi update auto replaces config auto-update ([682b1831](https://github.com/arbitrationcity/ARBI-frontend/commit/682b1831))
115
+ - Arbi update auto replaces config auto-update ([682b1831](https://github.com/arbicity/ARBI-frontend/commit/682b1831))
78
116
 
79
117
  ### 📖 Documentation
80
118
 
81
- - Add READMEs for @arbidocs/core and @arbidocs/react packages ([8041100d](https://github.com/arbitrationcity/ARBI-frontend/commit/8041100d))
119
+ - Add READMEs for @arbidocs/core and @arbidocs/react packages ([8041100d](https://github.com/arbicity/ARBI-frontend/commit/8041100d))
82
120
 
83
121
  ### 🏡 Chore
84
122
 
85
- - Bump @arbidocs/core to 0.2.0 and publish @arbidocs/react 0.1.0 ([4a116d5b](https://github.com/arbitrationcity/ARBI-frontend/commit/4a116d5b))
86
- - Bump all @arbidocs packages to v0.3.1 ([4ba71fc6](https://github.com/arbitrationcity/ARBI-frontend/commit/4ba71fc6))
87
- - Bump all @arbidocs packages to v0.3.2 ([155a5ef9](https://github.com/arbitrationcity/ARBI-frontend/commit/155a5ef9))
88
- - Release v0.3.3 ([ef2a3ab4](https://github.com/arbitrationcity/ARBI-frontend/commit/ef2a3ab4))
123
+ - Bump @arbidocs/core to 0.2.0 and publish @arbidocs/react 0.1.0 ([4a116d5b](https://github.com/arbicity/ARBI-frontend/commit/4a116d5b))
124
+ - Bump all @arbidocs packages to v0.3.1 ([4ba71fc6](https://github.com/arbicity/ARBI-frontend/commit/4ba71fc6))
125
+ - Bump all @arbidocs packages to v0.3.2 ([155a5ef9](https://github.com/arbicity/ARBI-frontend/commit/155a5ef9))
126
+ - Release v0.3.3 ([ef2a3ab4](https://github.com/arbicity/ARBI-frontend/commit/ef2a3ab4))
89
127
 
90
128
  ### ✅ Tests
91
129
 
92
- - Add unit tests for Arbi class and React package ([ca5d72e4](https://github.com/arbitrationcity/ARBI-frontend/commit/ca5d72e4))
130
+ - Add unit tests for Arbi class and React package ([ca5d72e4](https://github.com/arbicity/ARBI-frontend/commit/ca5d72e4))
93
131
 
94
132
  ### ❤️ Contributors
95
133
 
@@ -97,16 +135,16 @@
97
135
 
98
136
  ## v0.3.3
99
137
 
100
- [compare changes](https://github.com/arbitrationcity/ARBI-frontend/compare/v0.3.2...HEAD)
138
+ [compare changes](https://github.com/arbicity/ARBI-frontend/compare/v0.3.2...HEAD)
101
139
 
102
140
  ### 🚀 Enhancements
103
141
 
104
- - Add fetch retry for ECONNREFUSED + scriptable register command ([4e09d6be](https://github.com/arbitrationcity/ARBI-frontend/commit/4e09d6be))
105
- - Add changelog generation to publish script ([cc7e7b9f](https://github.com/arbitrationcity/ARBI-frontend/commit/cc7e7b9f))
106
- - Show changelog on update and auto-update ([b89d0c03](https://github.com/arbitrationcity/ARBI-frontend/commit/b89d0c03))
107
- - Auto-create GitHub release + push in publish script ([9f31378c](https://github.com/arbitrationcity/ARBI-frontend/commit/9f31378c))
142
+ - Add fetch retry for ECONNREFUSED + scriptable register command ([4e09d6be](https://github.com/arbicity/ARBI-frontend/commit/4e09d6be))
143
+ - Add changelog generation to publish script ([cc7e7b9f](https://github.com/arbicity/ARBI-frontend/commit/cc7e7b9f))
144
+ - Show changelog on update and auto-update ([b89d0c03](https://github.com/arbicity/ARBI-frontend/commit/b89d0c03))
145
+ - Auto-create GitHub release + push in publish script ([9f31378c](https://github.com/arbicity/ARBI-frontend/commit/9f31378c))
108
146
 
109
147
  ### 🩹 Fixes
110
148
 
111
- - Share changelog across npm + GitHub ([244274f3](https://github.com/arbitrationcity/ARBI-frontend/commit/244274f3))
112
- - Preserve changelog header when prepending new releases ([bb7c94da](https://github.com/arbitrationcity/ARBI-frontend/commit/bb7c94da))
149
+ - Share changelog across npm + GitHub ([244274f3](https://github.com/arbicity/ARBI-frontend/commit/244274f3))
150
+ - Preserve changelog header when prepending new releases ([bb7c94da](https://github.com/arbicity/ARBI-frontend/commit/bb7c94da))
package/dist/index.js CHANGED
@@ -3485,9 +3485,11 @@ function writeCache(latest) {
3485
3485
  } catch {
3486
3486
  }
3487
3487
  }
3488
- function getLatestVersion() {
3489
- const cached = readCache();
3490
- if (cached) return cached.latest;
3488
+ function getLatestVersion(skipCache = false) {
3489
+ if (!skipCache) {
3490
+ const cached = readCache();
3491
+ if (cached) return cached.latest;
3492
+ }
3491
3493
  try {
3492
3494
  const latest = child_process.execSync("npm view @arbidocs/cli version 2>/dev/null", {
3493
3495
  encoding: "utf8",
@@ -3500,7 +3502,7 @@ function getLatestVersion() {
3500
3502
  }
3501
3503
  }
3502
3504
  function getCurrentVersion() {
3503
- return "0.3.7";
3505
+ return "0.3.9";
3504
3506
  }
3505
3507
  function readChangelog(fromVersion, toVersion) {
3506
3508
  try {
@@ -3543,17 +3545,17 @@ function showChangelog(fromVersion, toVersion) {
3543
3545
  async function checkForUpdates(autoUpdate) {
3544
3546
  try {
3545
3547
  const latest = getLatestVersion();
3546
- if (!latest || latest === "0.3.7") return;
3548
+ if (!latest || latest === "0.3.9") return;
3547
3549
  if (autoUpdate) {
3548
3550
  warn(`
3549
- Your arbi version is out of date (${"0.3.7"} \u2192 ${latest}). Updating...`);
3551
+ Your arbi version is out of date (${"0.3.9"} \u2192 ${latest}). Updating...`);
3550
3552
  child_process.execSync("npm install -g @arbidocs/cli@latest", { stdio: "inherit" });
3551
- showChangelog("0.3.7", latest);
3553
+ showChangelog("0.3.9", latest);
3552
3554
  console.log(`Updated to ${latest}.`);
3553
3555
  } else {
3554
3556
  warn(
3555
3557
  `
3556
- Your arbi version is out of date (${"0.3.7"} \u2192 ${latest}).
3558
+ Your arbi version is out of date (${"0.3.9"} \u2192 ${latest}).
3557
3559
  Run "arbi update" to upgrade, or "arbi update auto" to always stay up to date.`
3558
3560
  );
3559
3561
  }
@@ -3563,9 +3565,9 @@ Run "arbi update" to upgrade, or "arbi update auto" to always stay up to date.`
3563
3565
  function hintUpdateOnError() {
3564
3566
  try {
3565
3567
  const cached = readCache();
3566
- if (cached && cached.latest !== "0.3.7") {
3568
+ if (cached && cached.latest !== "0.3.9") {
3567
3569
  warn(
3568
- `Your arbi version is out of date (${"0.3.7"} \u2192 ${cached.latest}). Run "arbi update".`
3570
+ `Your arbi version is out of date (${"0.3.9"} \u2192 ${cached.latest}). Run "arbi update".`
3569
3571
  );
3570
3572
  }
3571
3573
  } catch {
@@ -3580,7 +3582,7 @@ function registerLoginCommand(program2) {
3580
3582
  const pw = opts.password || process.env.ARBI_PASSWORD || await promptPassword("Password");
3581
3583
  try {
3582
3584
  const { arbi } = await core.performPasswordLogin(config, email, pw, store);
3583
- const { data: workspaces2 } = await arbi.fetch.GET("/api/user/workspaces");
3585
+ const { data: workspaces2 } = await arbi.fetch.GET("/v1/user/workspaces");
3584
3586
  const wsList = workspaces2 || [];
3585
3587
  success(`Logged in as ${email}`);
3586
3588
  if (wsList.length === 0) {
@@ -3662,7 +3664,7 @@ async function smartRegister(config, opts) {
3662
3664
  verificationCode = await promptInput("Invitation code");
3663
3665
  } else {
3664
3666
  console.log("Sending verification email...");
3665
- const verifyResponse = await arbi.fetch.POST("/api/user/verify-email", {
3667
+ const verifyResponse = await arbi.fetch.POST("/v1/user/verify-email", {
3666
3668
  body: { email }
3667
3669
  });
3668
3670
  if (verifyResponse.error) {
@@ -3736,7 +3738,7 @@ async function nonInteractiveRegister(config, opts) {
3736
3738
  );
3737
3739
  process.exit(1);
3738
3740
  }
3739
- const verifyResponse = await arbi.fetch.POST("/api/user/verify-email", {
3741
+ const verifyResponse = await arbi.fetch.POST("/v1/user/verify-email", {
3740
3742
  body: { email }
3741
3743
  });
3742
3744
  if (verifyResponse.error) {
@@ -3763,7 +3765,7 @@ async function loginAfterRegister(config, email, password2) {
3763
3765
  try {
3764
3766
  const { arbi } = await core.performPasswordLogin(config, email, password2, store);
3765
3767
  success(`Logged in as ${email}`);
3766
- const { data: workspaces2 } = await arbi.fetch.GET("/api/user/workspaces");
3768
+ const { data: workspaces2 } = await arbi.fetch.GET("/v1/user/workspaces");
3767
3769
  const wsList = workspaces2 || [];
3768
3770
  if (wsList.length === 0) {
3769
3771
  console.log("Creating your first workspace...");
@@ -3880,6 +3882,7 @@ function runAction(fn) {
3880
3882
  return async () => {
3881
3883
  try {
3882
3884
  await fn();
3885
+ process.exit(0);
3883
3886
  } catch (err) {
3884
3887
  error(`Error: ${core.getErrorMessage(err)}`);
3885
3888
  hintUpdateOnError();
@@ -4003,25 +4006,30 @@ function registerWorkspacesCommand(program2) {
4003
4006
  success(`Created: ${data.name} (${ref(data.external_id)})`);
4004
4007
  })()
4005
4008
  );
4006
- workspace.command("delete <id>").description("Delete a workspace").action(
4009
+ workspace.command("delete [id]").description("Delete a workspace (defaults to selected workspace)").action(
4007
4010
  (id) => runAction(async () => {
4008
4011
  const { arbi } = await resolveAuth();
4009
- const data = await core.workspaces.deleteWorkspace(arbi, id);
4010
- success(data?.detail ?? `Deleted workspace ${id}`);
4012
+ const targetId = id ?? getConfig()?.selectedWorkspaceId;
4013
+ if (!targetId) {
4014
+ error("No workspace ID given and no workspace selected. Run: arbi workspace select");
4015
+ process.exit(1);
4016
+ }
4017
+ await core.workspaces.deleteWorkspaces(arbi, [targetId]);
4018
+ success(`Deleted workspace ${targetId}`);
4011
4019
  })()
4012
4020
  );
4013
4021
  workspace.command("update <id> <json>").description("Update workspace properties (pass JSON)").action(
4014
4022
  (id, json) => runAction(async () => {
4015
4023
  const body = parseJsonArg(json, `arbi workspace update wrk-123 '{"name": "New Name"}'`);
4016
4024
  const { arbi } = await resolveWorkspace(id);
4017
- const data = await core.workspaces.updateWorkspace(arbi, id, body);
4025
+ const data = await core.workspaces.updateWorkspace(arbi, body);
4018
4026
  success(`Updated: ${data.name} (${ref(data.external_id)})`);
4019
4027
  })()
4020
4028
  );
4021
4029
  workspace.command("users").description("List users in the active workspace").option("-w, --workspace <id>", "Workspace ID (defaults to selected workspace)").action(
4022
4030
  (opts) => runAction(async () => {
4023
4031
  const { arbi, workspaceId } = await resolveWorkspace(opts.workspace);
4024
- const data = await core.workspaces.listWorkspaceUsers(arbi, workspaceId);
4032
+ const data = await core.workspaces.listWorkspaceUsers(arbi);
4025
4033
  if (data.length === 0) {
4026
4034
  console.log("No users found.");
4027
4035
  return;
@@ -4058,14 +4066,14 @@ function registerWorkspacesCommand(program2) {
4058
4066
  (emails, opts) => runAction(async () => {
4059
4067
  const { arbi, workspaceId } = await resolveWorkspace(opts.workspace);
4060
4068
  const role = opts.role ?? "collaborator";
4061
- const data = await core.workspaces.addWorkspaceUsers(arbi, workspaceId, emails, role);
4069
+ const data = await core.workspaces.addWorkspaceUsers(arbi, emails, role);
4062
4070
  for (const u of data) success(`Added: ${u.user.email} as ${u.role}`);
4063
4071
  })()
4064
4072
  );
4065
4073
  workspace.command("remove-user <user-ids...>").description("Remove users from the active workspace").option("-w, --workspace <id>", "Workspace ID (defaults to selected workspace)").action(
4066
4074
  (userIds, opts) => runAction(async () => {
4067
4075
  const { arbi, workspaceId } = await resolveWorkspace(opts.workspace);
4068
- await core.workspaces.removeWorkspaceUsers(arbi, workspaceId, userIds);
4076
+ await core.workspaces.removeWorkspaceUsers(arbi, userIds);
4069
4077
  success(`Removed ${userIds.length} user(s).`);
4070
4078
  })()
4071
4079
  );
@@ -4074,7 +4082,6 @@ function registerWorkspacesCommand(program2) {
4074
4082
  const { arbi, workspaceId } = await resolveWorkspace(opts.workspace);
4075
4083
  const data = await core.workspaces.setUserRole(
4076
4084
  arbi,
4077
- workspaceId,
4078
4085
  userIds,
4079
4086
  role
4080
4087
  );
@@ -4083,8 +4090,21 @@ function registerWorkspacesCommand(program2) {
4083
4090
  );
4084
4091
  workspace.command("copy <target-workspace-id> <doc-ids...>").description("Copy documents to another workspace").option("-w, --workspace <id>", "Source workspace ID (defaults to selected workspace)").action(
4085
4092
  (targetId, docIds, opts) => runAction(async () => {
4086
- const { arbi, workspaceId } = await resolveWorkspace(opts.workspace);
4087
- const data = await core.workspaces.copyDocuments(arbi, workspaceId, targetId, docIds);
4093
+ const { arbi, loginResult } = await resolveWorkspace(opts.workspace);
4094
+ const signingPrivateKeyBase64 = arbi.crypto.bytesToBase64(loginResult.signingPrivateKey);
4095
+ const wsList = await core.workspaces.listWorkspaces(arbi);
4096
+ const targetWs = wsList.find((w) => w.external_id === targetId);
4097
+ if (!targetWs || !targetWs.wrapped_key) {
4098
+ error(`Target workspace ${targetId} not found or has no encryption key`);
4099
+ process.exit(1);
4100
+ }
4101
+ const targetKey = await core.generateEncryptedWorkspaceKey(
4102
+ arbi,
4103
+ targetWs.wrapped_key,
4104
+ loginResult.serverSessionKey,
4105
+ signingPrivateKeyBase64
4106
+ );
4107
+ const data = await core.workspaces.copyDocuments(arbi, targetId, docIds, targetKey);
4088
4108
  success(`${data.detail} (${data.documents_copied} document(s) copied)`);
4089
4109
  })()
4090
4110
  );
@@ -4108,7 +4128,7 @@ function statusSymbol(status2) {
4108
4128
  }
4109
4129
  }
4110
4130
  async function fetchDocChoices(arbi, workspaceId) {
4111
- const data = await core.documents.listDocuments(arbi, workspaceId);
4131
+ const data = await core.documents.listDocuments(arbi);
4112
4132
  if (data.length === 0) {
4113
4133
  console.log("No documents found.");
4114
4134
  process.exit(0);
@@ -4123,7 +4143,7 @@ function registerDocsCommand(program2) {
4123
4143
  program2.command("docs").description("List documents in the active workspace").option("-w, --workspace <id>", "Workspace ID (defaults to selected workspace)").action(
4124
4144
  (opts) => runAction(async () => {
4125
4145
  const { arbi, workspaceId } = await resolveWorkspace(opts.workspace);
4126
- const data = await core.documents.listDocuments(arbi, workspaceId);
4146
+ const data = await core.documents.listDocuments(arbi);
4127
4147
  if (data.length === 0) {
4128
4148
  console.log("No documents found.");
4129
4149
  return;
@@ -4323,7 +4343,7 @@ function registerDownloadCommand(program2) {
4323
4343
  (docId, opts) => runAction(async () => {
4324
4344
  const { arbi, config, accessToken, workspaceKeyHeader, workspaceId } = await resolveWorkspace(opts.workspace);
4325
4345
  if (!docId) {
4326
- const data = await core.documents.listDocuments(arbi, workspaceId);
4346
+ const data = await core.documents.listDocuments(arbi);
4327
4347
  if (data.length === 0) {
4328
4348
  console.log("No documents found.");
4329
4349
  return;
@@ -4364,7 +4384,7 @@ function registerAskCommand(program2) {
4364
4384
  clearChatSession();
4365
4385
  session.lastMessageExtId = null;
4366
4386
  }
4367
- const docs = await core.documents.listDocuments(arbi, workspaceId);
4387
+ const docs = await core.documents.listDocuments(arbi);
4368
4388
  const docIds = docs.map((d) => d.external_id);
4369
4389
  const res = await core.assistant.queryAssistant({
4370
4390
  baseUrl: config.baseUrl,
@@ -4373,8 +4393,8 @@ function registerAskCommand(program2) {
4373
4393
  workspaceId,
4374
4394
  question,
4375
4395
  docIds,
4376
- parentMessageExtId: session.lastMessageExtId,
4377
- configExtId: opts.config
4396
+ previousResponseId: session.lastMessageExtId,
4397
+ model: opts.config
4378
4398
  });
4379
4399
  const result = await core.streamSSE(res, {
4380
4400
  onToken: (content) => process.stdout.write(content),
@@ -4630,7 +4650,7 @@ function registerDmCommand(program2) {
4630
4650
  });
4631
4651
  }
4632
4652
  async function fetchTagChoices(arbi, workspaceId) {
4633
- const data = await core.tags.listTags(arbi, workspaceId);
4653
+ const data = await core.tags.listTags(arbi);
4634
4654
  if (data.length === 0) {
4635
4655
  console.log("No tags found.");
4636
4656
  process.exit(0);
@@ -4649,7 +4669,7 @@ function registerTagsCommand(program2) {
4649
4669
  tags.command("list").description("List tags in the active workspace").option("-w, --workspace <id>", "Workspace ID (defaults to selected workspace)").action(
4650
4670
  (opts) => runAction(async () => {
4651
4671
  const { arbi, workspaceId } = await resolveWorkspace(opts.workspace);
4652
- const data = await core.tags.listTags(arbi, workspaceId);
4672
+ const data = await core.tags.listTags(arbi);
4653
4673
  if (data.length === 0) {
4654
4674
  console.log("No tags found.");
4655
4675
  return;
@@ -4695,7 +4715,6 @@ function registerTagsCommand(program2) {
4695
4715
  const shared = interactive ? opts.shared || await promptConfirm("Shared?", false) : opts.shared ?? false;
4696
4716
  const data = await core.tags.createTag(arbi, {
4697
4717
  name,
4698
- workspaceId,
4699
4718
  tagType: { type: tagType, options: [] },
4700
4719
  instruction,
4701
4720
  shared
@@ -4745,7 +4764,7 @@ function registerTagsCommand(program2) {
4745
4764
  });
4746
4765
  }
4747
4766
  async function pickTag(arbi, workspaceId, message = "Select tag") {
4748
- const data = await core.tags.listTags(arbi, workspaceId);
4767
+ const data = await core.tags.listTags(arbi);
4749
4768
  if (data.length === 0) {
4750
4769
  console.log("No tags found.");
4751
4770
  process.exit(0);
@@ -4760,7 +4779,7 @@ async function pickTag(arbi, workspaceId, message = "Select tag") {
4760
4779
  );
4761
4780
  }
4762
4781
  async function pickDocs(arbi, workspaceId, message = "Select documents") {
4763
- const data = await core.documents.listDocuments(arbi, workspaceId);
4782
+ const data = await core.documents.listDocuments(arbi);
4764
4783
  if (data.length === 0) {
4765
4784
  console.log("No documents found.");
4766
4785
  process.exit(0);
@@ -4804,7 +4823,7 @@ function registerDoctagsCommand(program2) {
4804
4823
  if (opts.tags) {
4805
4824
  tagIds = opts.tags.split(",").map((s) => s.trim());
4806
4825
  } else {
4807
- const data2 = await core.tags.listTags(arbi, workspaceId);
4826
+ const data2 = await core.tags.listTags(arbi);
4808
4827
  if (data2.length === 0) {
4809
4828
  console.log("No tags found.");
4810
4829
  return;
@@ -4833,7 +4852,7 @@ function registerDoctagsCommand(program2) {
4833
4852
  );
4834
4853
  }
4835
4854
  async function pickConversation(arbi, workspaceId, message = "Select conversation") {
4836
- const data = await core.conversations.listConversations(arbi, workspaceId);
4855
+ const data = await core.conversations.listConversations(arbi);
4837
4856
  if (data.length === 0) {
4838
4857
  console.log("No conversations found.");
4839
4858
  process.exit(0);
@@ -4852,7 +4871,7 @@ function registerConversationsCommand(program2) {
4852
4871
  conv.command("list").description("List conversations in the active workspace").option("-w, --workspace <id>", "Workspace ID (defaults to selected workspace)").action(
4853
4872
  (opts) => runAction(async () => {
4854
4873
  const { arbi, workspaceId } = await resolveWorkspace(opts.workspace);
4855
- const data = await core.conversations.listConversations(arbi, workspaceId);
4874
+ const data = await core.conversations.listConversations(arbi);
4856
4875
  if (data.length === 0) {
4857
4876
  console.log("No conversations found.");
4858
4877
  return;
@@ -4907,24 +4926,6 @@ function registerConversationsCommand(program2) {
4907
4926
  success(data?.detail ?? `Updated title to: ${title}`);
4908
4927
  })()
4909
4928
  );
4910
- conv.command("add-user [conversation-id] [user-id]").description("Add a user to a conversation (interactive if no args)").action(
4911
- (conversationId, userId) => runAction(async () => {
4912
- const { arbi, workspaceId } = await resolveWorkspace();
4913
- if (!conversationId) conversationId = await pickConversation(arbi, workspaceId);
4914
- if (!userId) userId = await promptInput("User ext_id or email");
4915
- const data = await core.conversations.addConversationUser(arbi, conversationId, userId);
4916
- success(data?.detail ?? `Added user ${userId} to conversation`);
4917
- })()
4918
- );
4919
- conv.command("remove-user [conversation-id] [user-id]").description("Remove a user from a conversation (interactive if no args)").action(
4920
- (conversationId, userId) => runAction(async () => {
4921
- const { arbi, workspaceId } = await resolveWorkspace();
4922
- if (!conversationId) conversationId = await pickConversation(arbi, workspaceId);
4923
- if (!userId) userId = await promptInput("User ext_id");
4924
- const data = await core.conversations.removeConversationUser(arbi, conversationId, userId);
4925
- success(data?.detail ?? `Removed user ${userId} from conversation`);
4926
- })()
4927
- );
4928
4929
  conv.command("message <message-id>").description("Get message details").action(
4929
4930
  (messageId) => runAction(async () => {
4930
4931
  const { arbi } = await resolveWorkspace();
@@ -5248,7 +5249,7 @@ function registerUpdateCommand(program2) {
5248
5249
  label("Current version:", current);
5249
5250
  console.log("Checking for updates...\n");
5250
5251
  try {
5251
- const latest = getLatestVersion() || child_process.execSync("npm view @arbidocs/cli version", { encoding: "utf8" }).trim();
5252
+ const latest = getLatestVersion(true) || child_process.execSync("npm view @arbidocs/cli version", { encoding: "utf8" }).trim();
5252
5253
  if (latest === current) {
5253
5254
  success("Already up to date.");
5254
5255
  return;
@@ -5282,7 +5283,7 @@ console.info = (...args) => {
5282
5283
  _origInfo(...args);
5283
5284
  };
5284
5285
  var program = new commander.Command();
5285
- program.name("arbi").description("ARBI CLI \u2014 interact with ARBI from the terminal").version("0.3.7");
5286
+ program.name("arbi").description("ARBI CLI \u2014 interact with ARBI from the terminal").version("0.3.9");
5286
5287
  registerConfigCommand(program);
5287
5288
  registerLoginCommand(program);
5288
5289
  registerRegisterCommand(program);