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