@arbidocs/cli 0.5.101 → 0.5.103

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,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.5.103
4
+
5
+ [compare changes](https://github.com/arbicity/ARBI-frontend/compare/v0.5.102...HEAD)
6
+
7
+ ### 🚀 Enhancements
8
+
9
+ - **mail:** Add mail to a workspace through the mailbox-sync mechanism (private, while online) ([#2237](https://github.com/arbicity/ARBI-frontend/pull/2237))
10
+
11
+ ### 🩹 Fixes
12
+
13
+ - **blocks:** Show the workspace guest role as "Read only" ([#2250](https://github.com/arbicity/ARBI-frontend/pull/2250))
14
+
15
+ ## v0.5.102
16
+
17
+ [compare changes](https://github.com/arbicity/ARBI-frontend/compare/v0.5.101...HEAD)
18
+
19
+ ### 🩹 Fixes
20
+
21
+ - **blocks:** Custom site kit gaps: assistant name, routed page inset, demo account, phone brand, palette skills ([#2248](https://github.com/arbicity/ARBI-frontend/pull/2248))
22
+
3
23
  ## v0.5.101
4
24
 
5
25
  [compare changes](https://github.com/arbicity/ARBI-frontend/compare/v0.5.100...HEAD)
package/SKILL.md CHANGED
@@ -38,7 +38,7 @@ Common moves:
38
38
  - Create: `arbi workspace create "My WS"` — does NOT auto-select. Use `--select` to create + select in one go, `--json` for scripts
39
39
  - Rename / edit: `arbi workspace update '{"name":"New Name"}'` (add `--json` for scripts)
40
40
  - Delete: `arbi workspace delete [id-or-name]` — prompts for confirmation in interactive shells. In non-TTY shells you **must** pass `-y/--yes` (otherwise the command refuses to delete). If you delete the active workspace, the selection is cleared. `--json` outputs `{id, deleted}`
41
- - Share: `arbi workspace add-user <email> -r <role>` where role is `owner|collaborator|guest` (plan-limited — free tier has 0 collaborator slots)
41
+ - Share: `arbi workspace add-user <email> -r <role>` where role is `owner|collaborator|guest` (`guest` is shown as "Read only"; `read-only` is accepted too) (plan-limited — free tier has 0 collaborator slots)
42
42
  - List members: `arbi workspace users [--json]`
43
43
  - Remove member: `arbi workspace remove-user <user-id>`
44
44
  - Copy docs between workspaces: `arbi workspace copy <target-ws-id> <doc-id>...` — only copies documents that have finished indexing; partial/failed copies exit non-zero
package/dist/index.js CHANGED
@@ -3689,7 +3689,7 @@ function getLatestVersion(skipCache = false) {
3689
3689
  }
3690
3690
  }
3691
3691
  function getCurrentVersion() {
3692
- return "0.5.101";
3692
+ return "0.5.103";
3693
3693
  }
3694
3694
  function readChangelog(fromVersion, toVersion) {
3695
3695
  try {
@@ -3742,17 +3742,17 @@ function showChangelog(fromVersion, toVersion) {
3742
3742
  async function checkForUpdates(autoUpdate) {
3743
3743
  try {
3744
3744
  const latest = getLatestVersion();
3745
- if (!latest || latest === "0.5.101") return;
3745
+ if (!latest || latest === "0.5.103") return;
3746
3746
  if (autoUpdate) {
3747
3747
  warn(`
3748
- Your arbi version is out of date (${"0.5.101"} \u2192 ${latest}). Updating...`);
3748
+ Your arbi version is out of date (${"0.5.103"} \u2192 ${latest}). Updating...`);
3749
3749
  child_process.execSync("npm install -g @arbidocs/cli@latest", { stdio: "inherit" });
3750
- showChangelog("0.5.101", latest);
3750
+ showChangelog("0.5.103", latest);
3751
3751
  console.log(`Updated to ${latest}.`);
3752
3752
  } else {
3753
3753
  warn(
3754
3754
  `
3755
- Your arbi version is out of date (${"0.5.101"} \u2192 ${latest}).
3755
+ Your arbi version is out of date (${"0.5.103"} \u2192 ${latest}).
3756
3756
  Run "arbi update" to upgrade, or "arbi update auto" to always stay up to date.`
3757
3757
  );
3758
3758
  }
@@ -3784,10 +3784,10 @@ function markNagShown(latest) {
3784
3784
  function hintUpdateOnError() {
3785
3785
  try {
3786
3786
  const cached = readCache();
3787
- if (!cached || cached.latest === "0.5.101") return;
3787
+ if (!cached || cached.latest === "0.5.103") return;
3788
3788
  if (!shouldShowNag(cached.latest)) return;
3789
3789
  warn(
3790
- `Your arbi version is out of date (${"0.5.101"} \u2192 ${cached.latest}). Run "arbi update".`
3790
+ `Your arbi version is out of date (${"0.5.103"} \u2192 ${cached.latest}). Run "arbi update".`
3791
3791
  );
3792
3792
  markNagShown(cached.latest);
3793
3793
  } catch {
@@ -5203,6 +5203,17 @@ Try: arbi contacts add ${recipient.includes("@") ? recipient : "<their-email>"}`
5203
5203
 
5204
5204
  // src/commands/workspaces.ts
5205
5205
  init_prompts();
5206
+ function requireWorkspaceRole(input2) {
5207
+ const role = sdk.workspaces.parseWorkspaceRole(input2);
5208
+ if (!role) {
5209
+ throw new Error(`Unknown role "${input2}" \u2014 use owner, collaborator or guest (read only)`);
5210
+ }
5211
+ return role;
5212
+ }
5213
+ function roleText(role) {
5214
+ const label2 = sdk.workspaces.workspaceRoleLabel(role);
5215
+ return label2.toLowerCase() === role ? role : `${label2} (${role})`;
5216
+ }
5206
5217
  function resolveWorkspaceSelector(list, selector) {
5207
5218
  const byId = list.find((w) => w.external_id === selector);
5208
5219
  if (byId) return { ok: true, id: byId.external_id, ws: byId };
@@ -5294,7 +5305,7 @@ function registerWorkspacesCommand(program2) {
5294
5305
  const myRow = r.users?.find(
5295
5306
  (u) => u?.user?.email === store.requireCredentials().email
5296
5307
  );
5297
- return myRow?.role ?? "common";
5308
+ return myRow ? sdk.workspaces.workspaceRoleLabel(myRow.role) : "common";
5298
5309
  }
5299
5310
  }
5300
5311
  ],
@@ -5528,7 +5539,11 @@ function registerWorkspacesCommand(program2) {
5528
5539
  width: 30,
5529
5540
  value: (r) => r.user?.email ?? ""
5530
5541
  },
5531
- { header: "ROLE", width: 14, value: (r) => r.role },
5542
+ {
5543
+ header: "ROLE",
5544
+ width: 14,
5545
+ value: (r) => sdk.workspaces.workspaceRoleLabel(r.role)
5546
+ },
5532
5547
  { header: "DOCS", width: 6, value: (r) => String(r.document_count) },
5533
5548
  { header: "CONVS", width: 6, value: (r) => String(r.conversation_count) }
5534
5549
  ],
@@ -5536,12 +5551,16 @@ function registerWorkspacesCommand(program2) {
5536
5551
  );
5537
5552
  })()
5538
5553
  );
5539
- workspace.command("add-user <emails...>").description("Add users to the active workspace").option("-w, --workspace <id>", "Workspace ID (defaults to selected workspace)").option("-r, --role <role>", "Role: owner, collaborator, guest", "collaborator").action(
5554
+ workspace.command("add-user <emails...>").description("Add users to the active workspace").option("-w, --workspace <id>", "Workspace ID (defaults to selected workspace)").option(
5555
+ "-r, --role <role>",
5556
+ "Role: owner, collaborator, guest (read only; also read-only)",
5557
+ "collaborator"
5558
+ ).action(
5540
5559
  (emails, opts) => runAction(async () => {
5541
5560
  const { arbi } = await resolveWorkspace(opts.workspace);
5542
- const role = opts.role ?? "collaborator";
5561
+ const role = requireWorkspaceRole(opts.role ?? "collaborator");
5543
5562
  const data = await sdk.workspaces.addWorkspaceUsers(arbi, emails, role);
5544
- for (const u of data) success(`Added: ${u.user.email} as ${u.role}`);
5563
+ for (const u of data) success(`Added: ${u.user.email} as ${roleText(u.role)}`);
5545
5564
  })()
5546
5565
  );
5547
5566
  workspace.command("request-access <owner>").description("Ask another user to grant you access to one of their workspaces").option("--note <note>", "Optional message to the workspace owner").option(
@@ -5640,15 +5659,11 @@ Try: arbi contacts add ${owner.includes("@") ? owner : "<their-email>"}`
5640
5659
  success(`Left workspace "${target.ws.name}" (${target.id}).`);
5641
5660
  })()
5642
5661
  );
5643
- workspace.command("set-role <role> <user-ids...>").description("Update user roles (owner, collaborator, guest)").option("-w, --workspace <id>", "Workspace ID (defaults to selected workspace)").action(
5662
+ workspace.command("set-role <role> <user-ids...>").description("Update user roles (owner, collaborator, guest = read only; also read-only)").option("-w, --workspace <id>", "Workspace ID (defaults to selected workspace)").action(
5644
5663
  (role, userIds, opts) => runAction(async () => {
5645
5664
  const { arbi } = await resolveWorkspace(opts.workspace);
5646
- const data = await sdk.workspaces.setUserRole(
5647
- arbi,
5648
- userIds,
5649
- role
5650
- );
5651
- for (const u of data) success(`Updated: ${u.user.email} \u2192 ${u.role}`);
5665
+ const data = await sdk.workspaces.setUserRole(arbi, userIds, requireWorkspaceRole(role));
5666
+ for (const u of data) success(`Updated: ${u.user.email} \u2192 ${roleText(u.role)}`);
5652
5667
  })()
5653
5668
  );
5654
5669
  workspace.command("copy <target-workspace> <doc-ids...>").description("Copy documents to another workspace (target accepts ID or unique name)").option("-w, --workspace <id>", "Source workspace ID (defaults to selected workspace)").action(
@@ -10313,7 +10328,11 @@ function registerAgentCommand(program2) {
10313
10328
  );
10314
10329
  agent.command("create").description(
10315
10330
  "Create a child persistent agent owned by the current user (different from `arbi agent-create`, which is a SUPPORT_API_KEY bot-account flow)"
10316
- ).option("--name <name>", "Agent name (letters, digits, hyphens, underscores)").option("-w, --workspace <ids...>", "Workspace IDs to share with the agent").option("--role <role>", "Workspace role: collaborator or guest", "collaborator").action(
10331
+ ).option("--name <name>", "Agent name (letters, digits, hyphens, underscores)").option("-w, --workspace <ids...>", "Workspace IDs to share with the agent").option(
10332
+ "--role <role>",
10333
+ "Workspace role: collaborator or guest (read only; also read-only)",
10334
+ "collaborator"
10335
+ ).action(
10317
10336
  (opts) => runAction(async () => {
10318
10337
  const { arbi, loginResult } = await resolveAuth();
10319
10338
  const creds = store.requireCredentials();
@@ -10322,6 +10341,10 @@ function registerAgentCommand(program2) {
10322
10341
  if (!name?.trim() || !/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/.test(name.trim())) {
10323
10342
  throw new Error("Invalid agent name \u2014 use letters, digits, hyphens, underscores");
10324
10343
  }
10344
+ const agentRole = sdk.workspaces.parseWorkspaceRole(opts.role ?? "collaborator");
10345
+ if (agentRole !== "collaborator" && agentRole !== "guest") {
10346
+ throw new Error(`Unknown role "${opts.role}" \u2014 use collaborator or guest (read only)`);
10347
+ }
10325
10348
  let workspaceIds = opts.workspace ?? [];
10326
10349
  if (workspaceIds.length === 0) {
10327
10350
  const { data: allWorkspaces } = await arbi.fetch.GET("/v1/user/workspaces");
@@ -10353,7 +10376,7 @@ function registerAgentCommand(program2) {
10353
10376
  await arbi.fetch.POST("/v1/workspace/users", {
10354
10377
  body: sdk.workspaces.addWorkspaceMembersBody({
10355
10378
  emails: [agent2.email],
10356
- role: opts.role ?? "collaborator",
10379
+ role: agentRole,
10357
10380
  workspace_key: encryptedKey,
10358
10381
  workspace_ext_id: wsId
10359
10382
  })
@@ -12612,7 +12635,7 @@ console.info = (...args) => {
12612
12635
  _origInfo(...args);
12613
12636
  };
12614
12637
  var program = new commander.Command();
12615
- program.name("arbi").description("ARBI CLI \u2014 interact with ARBI from the terminal").version("0.5.101").showHelpAfterError(true).showSuggestionAfterError(true);
12638
+ program.name("arbi").description("ARBI CLI \u2014 interact with ARBI from the terminal").version("0.5.103").showHelpAfterError(true).showSuggestionAfterError(true);
12616
12639
  registerConfigCommand(program);
12617
12640
  registerLoginCommand(program);
12618
12641
  registerRegisterCommand(program);