@arbidocs/cli 0.4.101 → 0.4.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,13 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.4.103
4
+
5
+ [compare changes](https://github.com/arbicity/ARBI-frontend/compare/v0.4.101...HEAD)
6
+
7
+ ### 🩹 Fixes
8
+
9
+ - **blocks:** Word ribbon collapses into a More menu, and new footnotes are formatted as in Word ([#1609](https://github.com/arbicity/ARBI-frontend/pull/1609))
10
+
3
11
  ## v0.4.101
4
12
 
5
13
  [compare changes](https://github.com/arbicity/ARBI-frontend/compare/v0.4.99...HEAD)
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.101";
3698
+ return "0.4.103";
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.101") return;
3751
+ if (!latest || latest === "0.4.103") return;
3752
3752
  if (autoUpdate) {
3753
3753
  warn(`
3754
- Your arbi version is out of date (${"0.4.101"} \u2192 ${latest}). Updating...`);
3754
+ Your arbi version is out of date (${"0.4.103"} \u2192 ${latest}). Updating...`);
3755
3755
  child_process.execSync("npm install -g @arbidocs/cli@latest", { stdio: "inherit" });
3756
- showChangelog("0.4.101", latest);
3756
+ showChangelog("0.4.103", 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.101"} \u2192 ${latest}).
3761
+ Your arbi version is out of date (${"0.4.103"} \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.101") return;
3793
+ if (!cached || cached.latest === "0.4.103") return;
3794
3794
  if (!shouldShowNag(cached.latest)) return;
3795
3795
  warn(
3796
- `Your arbi version is out of date (${"0.4.101"} \u2192 ${cached.latest}). Run "arbi update".`
3796
+ `Your arbi version is out of date (${"0.4.103"} \u2192 ${cached.latest}). Run "arbi update".`
3797
3797
  );
3798
3798
  markNagShown(cached.latest);
3799
3799
  } catch {
@@ -7617,6 +7617,90 @@ function registerDownloadCommand(program2) {
7617
7617
  })()
7618
7618
  );
7619
7619
  }
7620
+ function printRequest(r) {
7621
+ const signed = r.signers.filter((s) => s.status === "signed").length;
7622
+ console.log(
7623
+ `${r.external_id} ${r.doc_ext_id ?? ""}@v${r.version} ${r.status.padEnd(9)} ${signed}/${r.signers.length} signed` + (r.stale ? chalk2__default.default.yellow(" (document changed since)") : "") + (r.signed_version ? chalk2__default.default.green(` signed copy v${r.signed_version}`) : "")
7624
+ );
7625
+ for (const s of r.signers) {
7626
+ const n = r.fields.filter((f) => f.signer === s.user_ext_id).length;
7627
+ console.log(
7628
+ ` ${s.status.padEnd(8)} ${s.name} <${s.email ?? ""}> ${n} field${n === 1 ? "" : "s"}`
7629
+ );
7630
+ }
7631
+ }
7632
+ function registerSignaturesCommand(program2) {
7633
+ const cmd = program2.command("signatures").description("Request signatures on a document: place fields for signers and send it");
7634
+ cmd.command("suggest <doc-id>").description("Find the signature blocks of a document (fields grouped by block)").option("--version <n>", "Document version (default: current)", (v) => parseInt(v, 10)).option("--json", "Output as JSON").action(
7635
+ (docId, opts) => runAction(async () => {
7636
+ const { arbi } = await resolveWorkspace();
7637
+ const found = await sdk.signatureRequests.suggestSignatureFields(arbi, docId, opts.version);
7638
+ if (opts.json) return void console.log(JSON.stringify(found, null, 2));
7639
+ if (!found.length) return void console.log("No signature blocks found.");
7640
+ for (const f of found) {
7641
+ console.log(
7642
+ `block ${f.group} ${(f.role ?? "").padEnd(10)} ${f.type.padEnd(9)} p.${f.page + 1} "${f.anchor}"`
7643
+ );
7644
+ }
7645
+ })()
7646
+ );
7647
+ cmd.command("request <doc-id>").description(
7648
+ "Create a signature request and send it (fields from --fields, else the blocks found)"
7649
+ ).option("-s, --signer <usr-id...>", "Signers in block order (block n is for the n-th signer)").option(
7650
+ "--fields <file>",
7651
+ "JSON file with the fields (SignatureField[]) instead of the blocks found"
7652
+ ).option("-m, --message <text>", "A note to the signers").option("--draft", "Save as a draft instead of sending").option("--json", "Output as JSON").action(
7653
+ (docId, opts) => runAction(async () => {
7654
+ const { arbi } = await resolveWorkspace();
7655
+ let fields;
7656
+ if (opts.fields) {
7657
+ fields = JSON.parse(fs7.readFileSync(opts.fields, "utf8"));
7658
+ } else {
7659
+ if (!opts.signer?.length)
7660
+ throw new Error("Name the signers with --signer, or give --fields.");
7661
+ const found = await sdk.signatureRequests.suggestSignatureFields(arbi, docId);
7662
+ fields = sdk.signatureRequests.assignSuggestions(found, opts.signer);
7663
+ if (!fields.length)
7664
+ throw new Error("No signature blocks found: place the fields with --fields.");
7665
+ }
7666
+ const request = await sdk.signatureRequests.createSignatureRequest(arbi, docId, {
7667
+ fields,
7668
+ message: opts.message,
7669
+ send: !opts.draft
7670
+ });
7671
+ if (opts.json) return void console.log(JSON.stringify(request, null, 2));
7672
+ success(`${opts.draft ? "Draft saved" : "Sent for signature"}: ${request.external_id}`);
7673
+ printRequest(request);
7674
+ })()
7675
+ );
7676
+ cmd.command("list").description("Signature requests in the workspace").option("--awaiting-me", "Only those waiting for your signature").option("--doc <doc-id>", "Only this document\u2019s").option("--json", "Output as JSON").action(
7677
+ (opts) => runAction(async () => {
7678
+ const { arbi } = await resolveWorkspace();
7679
+ const list = opts.doc ? await sdk.signatureRequests.listDocumentSignatureRequests(arbi, opts.doc) : await sdk.signatureRequests.listSignatureRequests(arbi, !!opts.awaitingMe);
7680
+ if (opts.json) return void console.log(JSON.stringify(list, null, 2));
7681
+ if (!list.length) return void console.log("No signature requests.");
7682
+ list.forEach(printRequest);
7683
+ })()
7684
+ );
7685
+ for (const [name, description, run] of [
7686
+ ["show", "Show a signature request", sdk.signatureRequests.getSignatureRequest],
7687
+ ["send", "Send a draft to its signers", sdk.signatureRequests.sendSignatureRequest],
7688
+ [
7689
+ "void",
7690
+ "Withdraw a request (the document is unchanged)",
7691
+ sdk.signatureRequests.voidSignatureRequest
7692
+ ]
7693
+ ]) {
7694
+ cmd.command(`${name} <request-id>`).description(description).option("--json", "Output as JSON").action(
7695
+ (requestId, opts) => runAction(async () => {
7696
+ const { arbi } = await resolveWorkspace();
7697
+ const request = await run(arbi, requestId);
7698
+ if (opts.json) return void console.log(JSON.stringify(request, null, 2));
7699
+ printRequest(request);
7700
+ })()
7701
+ );
7702
+ }
7703
+ }
7620
7704
  function registerAskCommand(program2) {
7621
7705
  program2.command("ask <question...>").description("Ask the RAG assistant a question (no quotes needed)").option("-w, --workspace <id>", "Workspace ID (defaults to selected workspace)").option("-c, --continue <msg-id>", "Continue from a specific message ID").option("--config <id>", "Config ext_id to use (e.g. cfg-xxx)").option("-n, --new", "Start a new conversation (ignore previous context)").option("-b, --background", "Submit as background task \u2014 fetch result with `arbi task result`").option("-q, --quiet", "Suppress agent steps and tool calls").option("--json", "Output in JSON format (background mode only)").option(
7622
7706
  "--raw-citations",
@@ -12186,7 +12270,7 @@ console.info = (...args) => {
12186
12270
  _origInfo(...args);
12187
12271
  };
12188
12272
  var program = new commander.Command();
12189
- program.name("arbi").description("ARBI CLI \u2014 interact with ARBI from the terminal").version("0.4.101").showHelpAfterError(true).showSuggestionAfterError(true);
12273
+ program.name("arbi").description("ARBI CLI \u2014 interact with ARBI from the terminal").version("0.4.103").showHelpAfterError(true).showSuggestionAfterError(true);
12190
12274
  registerConfigCommand(program);
12191
12275
  registerLoginCommand(program);
12192
12276
  registerRegisterCommand(program);
@@ -12196,6 +12280,7 @@ registerWorkspacesCommand(program);
12196
12280
  registerDocsCommand(program);
12197
12281
  registerUploadCommand(program);
12198
12282
  registerDownloadCommand(program);
12283
+ registerSignaturesCommand(program);
12199
12284
  registerAskCommand(program);
12200
12285
  registerCiteCommand(program);
12201
12286
  registerFindCommand(program);