@arbidocs/cli 0.4.124 → 0.4.126

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,16 +1,38 @@
1
1
  # Changelog
2
2
 
3
- ## v0.4.124
3
+ ## v0.4.126
4
4
 
5
5
  [compare changes](https://github.com/arbicity/ARBI-frontend/compare/v0.4.123...HEAD)
6
6
 
7
+ ### 🚀 Enhancements
8
+
9
+ - Native document translation replaces the browser-translate compare ([#1647](https://github.com/arbicity/ARBI-frontend/pull/1647))
10
+
11
+ ### 🩹 Fixes
12
+
13
+ - **transcription:** Let Whisper detect the spoken language instead of forcing the browser locale ([#1649](https://github.com/arbicity/ARBI-frontend/pull/1649))
14
+
15
+ ## v0.4.123
16
+
17
+ [compare changes](https://github.com/arbicity/ARBI-frontend/compare/v0.4.121...HEAD)
18
+
19
+ ### 🚀 Enhancements
20
+
21
+ - **threads:** Thread bar in the workflow canvas's look, agents-view list and a launcher ([db3c72893](https://github.com/arbicity/ARBI-frontend/commit/db3c72893))
22
+ - **threads:** Document-first steps, matching chips in the chat, and user-test fixes ([e6c2c327a](https://github.com/arbicity/ARBI-frontend/commit/e6c2c327a))
23
+ - **threads:** Open a step's document from its chip; no red flag on replies that never come ([01214d139](https://github.com/arbicity/ARBI-frontend/commit/01214d139))
24
+ - **threads:** Drafting mode in the composer; one status vocabulary and four columns in the list ([ae4c898c9](https://github.com/arbicity/ARBI-frontend/commit/ae4c898c9))
25
+ - **viewer:** Open the thread a generated document was made in ([dd713a43f](https://github.com/arbicity/ARBI-frontend/commit/dd713a43f))
26
+ - **docs:** Each version says which thread made it; a thread's documents include the ones it edited ([203d3e68c](https://github.com/arbicity/ARBI-frontend/commit/203d3e68c))
27
+
7
28
  ### 🩹 Fixes
8
29
 
9
- - **signing:** Keep the Review and sign banner in sight; readable signature rows in the narrow panel ([#1652](https://github.com/arbicity/ARBI-frontend/pull/1652))
30
+ - **thread:** A link to a message lands on it while the thread is still loading ([759bd9971](https://github.com/arbicity/ARBI-frontend/commit/759bd9971))
31
+ - **notifications:** Readable signature-request notifications that open the document to sign ([#1642](https://github.com/arbicity/ARBI-frontend/pull/1642))
10
32
 
11
33
  ### 🏡 Chore
12
34
 
13
- - Release v0.4.123 [skip ci] ([1d9934f72](https://github.com/arbicity/ARBI-frontend/commit/1d9934f72))
35
+ - Drop imports left unused by the orphan-flag removal ([602257ed3](https://github.com/arbicity/ARBI-frontend/commit/602257ed3))
14
36
 
15
37
  ## v0.4.121
16
38
 
package/dist/index.js CHANGED
@@ -3695,7 +3695,7 @@ function getLatestVersion(skipCache = false) {
3695
3695
  }
3696
3696
  }
3697
3697
  function getCurrentVersion() {
3698
- return "0.4.124";
3698
+ return "0.4.126";
3699
3699
  }
3700
3700
  function readChangelog(fromVersion, toVersion) {
3701
3701
  try {
@@ -3748,17 +3748,17 @@ function showChangelog(fromVersion, toVersion) {
3748
3748
  async function checkForUpdates(autoUpdate) {
3749
3749
  try {
3750
3750
  const latest = getLatestVersion();
3751
- if (!latest || latest === "0.4.124") return;
3751
+ if (!latest || latest === "0.4.126") return;
3752
3752
  if (autoUpdate) {
3753
3753
  warn(`
3754
- Your arbi version is out of date (${"0.4.124"} \u2192 ${latest}). Updating...`);
3754
+ Your arbi version is out of date (${"0.4.126"} \u2192 ${latest}). Updating...`);
3755
3755
  child_process.execSync("npm install -g @arbidocs/cli@latest", { stdio: "inherit" });
3756
- showChangelog("0.4.124", latest);
3756
+ showChangelog("0.4.126", latest);
3757
3757
  console.log(`Updated to ${latest}.`);
3758
3758
  } else {
3759
3759
  warn(
3760
3760
  `
3761
- Your arbi version is out of date (${"0.4.124"} \u2192 ${latest}).
3761
+ Your arbi version is out of date (${"0.4.126"} \u2192 ${latest}).
3762
3762
  Run "arbi update" to upgrade, or "arbi update auto" to always stay up to date.`
3763
3763
  );
3764
3764
  }
@@ -3790,10 +3790,10 @@ function markNagShown(latest) {
3790
3790
  function hintUpdateOnError() {
3791
3791
  try {
3792
3792
  const cached = readCache();
3793
- if (!cached || cached.latest === "0.4.124") return;
3793
+ if (!cached || cached.latest === "0.4.126") return;
3794
3794
  if (!shouldShowNag(cached.latest)) return;
3795
3795
  warn(
3796
- `Your arbi version is out of date (${"0.4.124"} \u2192 ${cached.latest}). Run "arbi update".`
3796
+ `Your arbi version is out of date (${"0.4.126"} \u2192 ${cached.latest}). Run "arbi update".`
3797
3797
  );
3798
3798
  markNagShown(cached.latest);
3799
3799
  } catch {
@@ -6053,6 +6053,21 @@ function registerDocsCommand(program2) {
6053
6053
  }
6054
6054
  })()
6055
6055
  );
6056
+ doc.command("finalise <id>").description(
6057
+ "Finalise a translation: save it as a new PDF, labelled Translation and linked to the original"
6058
+ ).option("--json", "Output as JSON").action(
6059
+ (id, opts) => runAction(async () => {
6060
+ const { arbi } = await resolveWorkspace();
6061
+ const result = await sdk.documents.finaliseTranslation(arbi, id);
6062
+ if (opts?.json) {
6063
+ console.log(JSON.stringify(result, null, 2));
6064
+ return;
6065
+ }
6066
+ console.log(
6067
+ `Final PDF: ${result.document_ext_id} (from ${result.translation_ref}${result.source_ref ? `, a translation of ${result.source_ref}` : ""})`
6068
+ );
6069
+ })()
6070
+ );
6056
6071
  doc.command("versions <id>").description("List every version of a document, oldest first").option("--json", "Output as JSON").action(
6057
6072
  (id, opts) => runAction(async () => {
6058
6073
  const { arbi } = await resolveWorkspace();
@@ -10501,6 +10516,23 @@ function registerTaskCommand(program2) {
10501
10516
  })()
10502
10517
  );
10503
10518
  }
10519
+ async function depositAgentKey(data) {
10520
+ if (data.on_demand || !data.agent_ext_id) return;
10521
+ if (data.auth_mode !== "scheduled_permanent") {
10522
+ dim(
10523
+ "Each unattended run asks you for workspace access first. Use --auth-mode scheduled_permanent to give its agent standing access."
10524
+ );
10525
+ return;
10526
+ }
10527
+ const { arbi } = await resolveWorkspace(data.workspace_ext_id ?? void 0);
10528
+ const email = await sdk.workflows.grantWorkflowAgentAccess(
10529
+ await sdk.agents.listAgents(arbi),
10530
+ data,
10531
+ (agentEmail) => sdk.workspaces.addWorkspaceUsers(arbi, [agentEmail], "collaborator")
10532
+ );
10533
+ if (email)
10534
+ dim(`Gave ${email} standing access to the workspace, so unattended runs start on their own.`);
10535
+ }
10504
10536
  function signalTrigger(name, eventKind, eventFilter) {
10505
10537
  if (name === void 0) return void 0;
10506
10538
  if (!sdk.workflowSteps.SIGNAL_NAME_PATTERN.test(name))
@@ -10544,7 +10576,12 @@ function registerWorkflowCommand(program2) {
10544
10576
  "--auth-mode <mode>",
10545
10577
  "scheduled_require_auth or scheduled_permanent",
10546
10578
  "scheduled_require_auth"
10547
- ).option("--event-filter <json>", "Notification attribute filters as a JSON object").option("--prompt <text>", "Instruction the agent runs").option("--skill <ref>", "Skill reference to run").option("--agent <agt-id>", "Agent to run it as (external id)").option("--workspace <wrk-id>", "Workspace to scope the workflow to (default: the current one)").option("--shared", "Share it with the workspace").option("--json", "Output as JSON").action(
10579
+ ).option("--event-filter <json>", "Notification attribute filters as a JSON object").option("--prompt <text>", "Instruction the agent runs").option("--skill <ref>", "Skill reference to run").option(
10580
+ "--input <name=value>",
10581
+ "The skill's inputs (repeatable), e.g. --input language=English --input layout=translation-only",
10582
+ collect,
10583
+ []
10584
+ ).option("--agent <agt-id>", "Agent to run it as (external id)").option("--workspace <wrk-id>", "Workspace to scope the workflow to (default: the current one)").option("--shared", "Share it with the workspace").option("--json", "Output as JSON").action(
10548
10585
  (opts) => runAction(async () => {
10549
10586
  if (opts.steps && (opts.prompt || opts.skill || opts.action))
10550
10587
  throw new Error("Use --steps, or --prompt / --skill / --action, not both");
@@ -10594,9 +10631,20 @@ function registerWorkflowCommand(program2) {
10594
10631
  if (opts.eventKind) body.event_kind = opts.eventKind;
10595
10632
  if (opts.after) body.after_conversation_ext_id = opts.after;
10596
10633
  if (opts.skill) body.skill_ref = opts.skill;
10634
+ if (opts.input?.length) {
10635
+ if (!opts.skill) throw new Error("--input sets a skill input: use it with --skill");
10636
+ body.skill_inputs = Object.fromEntries(
10637
+ opts.input.map((pair) => {
10638
+ const at = pair.indexOf("=");
10639
+ if (at < 1) throw new Error(`--input ${pair}: expected name=value`);
10640
+ return [pair.slice(0, at).trim(), pair.slice(at + 1)];
10641
+ })
10642
+ );
10643
+ }
10597
10644
  if (opts.agent) body.agent_ext_id = opts.agent;
10598
10645
  if (steps) body.plan = sdk.workflowSteps.stepsPlan(steps);
10599
10646
  const data = await sdk.workflows.createWorkflow(arbi, body);
10647
+ await depositAgentKey(data);
10600
10648
  if (opts.json) {
10601
10649
  printJson(data);
10602
10650
  return;
@@ -10720,6 +10768,7 @@ function registerWorkflowCommand(program2) {
10720
10768
  });
10721
10769
  const { arbi } = await resolveAuth();
10722
10770
  const data = await sdk.workflows.updateWorkflow(arbi, id, body);
10771
+ await depositAgentKey(data);
10723
10772
  if (opts.json) printJson(data);
10724
10773
  else success(`Updated workflow ${ref(id)}${steps ? ` \u2014 ${steps.length} steps` : ""}`);
10725
10774
  })()
@@ -10759,6 +10808,8 @@ function runJson(progress, answers = {}) {
10759
10808
  signals: s.signals,
10760
10809
  linked_runs: s.linkedRuns.map(linkedJson),
10761
10810
  waiting_documents: s.waitingDocuments,
10811
+ waiting_for: s.waitingAction,
10812
+ waiting_document: s.waitingDocument,
10762
10813
  ...s.responseId && answers[s.responseId] !== void 0 ? { answer: answers[s.responseId] } : {}
10763
10814
  })),
10764
10815
  signals: (progress.signals ?? []).map((x) => ({ step: x.step, signal: x.signal, at: x.at })),
@@ -10784,6 +10835,9 @@ function stepNotes(s) {
10784
10835
  const notes = [];
10785
10836
  if (s.waitingDocuments.length)
10786
10837
  notes.push(sdk.workflowSteps.waitingForDocumentsText(s.waitingDocuments.length).toLowerCase());
10838
+ if (s.waitingAction === "sign")
10839
+ notes.push(`waiting for signatures${s.waitingDocument ? ` on ${s.waitingDocument}` : ""}`);
10840
+ else if (s.waitingAction === "email_draft") notes.push("draft ready to send");
10787
10841
  if (s.sentBack) notes.push(`sent back${s.hasNote ? " (note)" : ""}`);
10788
10842
  else if (s.timesSentBack) notes.push(`sent back \xD7${s.timesSentBack}`);
10789
10843
  if (s.signals.length) notes.push(`\u2691 ${s.signals.join(", ")}`);
@@ -12296,6 +12350,12 @@ function registerSkillsCommand(program2) {
12296
12350
  [
12297
12351
  { header: "SLUG", width: 20, value: (r) => r.slug ?? "" },
12298
12352
  { header: "NAME", width: 24, value: (r) => r.name ?? "" },
12353
+ {
12354
+ // builtin (ships with ARBI), mine, or global (shared in the marketplace)
12355
+ header: "SOURCE",
12356
+ width: 8,
12357
+ value: (r) => r.visibility ?? "mine"
12358
+ },
12299
12359
  {
12300
12360
  header: "TYPE",
12301
12361
  width: 10,
@@ -12361,20 +12421,25 @@ function registerSkillsCommand(program2) {
12361
12421
  );
12362
12422
  process.exit(1);
12363
12423
  }
12364
- const authHeaders = {
12365
- baseUrl: ctx.config.baseUrl,
12366
- accessToken: ctx.accessToken
12367
- };
12368
- const dlRes = await sdk.documents.downloadDocument(authHeaders, skill.doc_ext_id);
12369
- const body = dlRes.ok ? await dlRes.text() : "";
12424
+ let body = skill.content ?? "";
12425
+ if (skill.doc_ext_id) {
12426
+ const authHeaders = {
12427
+ baseUrl: ctx.config.baseUrl,
12428
+ accessToken: ctx.accessToken
12429
+ };
12430
+ const dlRes = await sdk.documents.downloadDocument(authHeaders, skill.doc_ext_id);
12431
+ body = dlRes.ok ? await dlRes.text() : "";
12432
+ }
12370
12433
  if (opts.json) {
12371
12434
  console.log(JSON.stringify({ ...skill, body }, null, 2));
12372
12435
  return;
12373
12436
  }
12374
- console.log(bold(`${skill.name} (${skill.slug})`));
12375
- if (skill.description) console.log(dim(skill.description));
12376
- if (skill.arg_hint) console.log(dim(`args: ${skill.arg_hint}`));
12377
- console.log(dim(`type: ${skill.skill_type} doc: ${skill.doc_ext_id}`));
12437
+ bold(`${skill.name} (${skill.slug})`);
12438
+ if (skill.description) dim(skill.description);
12439
+ if (skill.arg_hint) dim(`args: ${skill.arg_hint}`);
12440
+ dim(
12441
+ `type: ${skill.skill_type} ${skill.doc_ext_id ? `doc: ${skill.doc_ext_id}` : "built-in (ships with ARBI)"}`
12442
+ );
12378
12443
  console.log("");
12379
12444
  console.log(body);
12380
12445
  })()
@@ -12504,7 +12569,7 @@ console.info = (...args) => {
12504
12569
  _origInfo(...args);
12505
12570
  };
12506
12571
  var program = new commander.Command();
12507
- program.name("arbi").description("ARBI CLI \u2014 interact with ARBI from the terminal").version("0.4.124").showHelpAfterError(true).showSuggestionAfterError(true);
12572
+ program.name("arbi").description("ARBI CLI \u2014 interact with ARBI from the terminal").version("0.4.126").showHelpAfterError(true).showSuggestionAfterError(true);
12508
12573
  registerConfigCommand(program);
12509
12574
  registerLoginCommand(program);
12510
12575
  registerRegisterCommand(program);