arcane-cli 0.33.9 → 0.34.0

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/dist/index.js CHANGED
@@ -4817,6 +4817,9 @@ async function runDoctor(targetDir, options = {}, assetsDir) {
4817
4817
  }
4818
4818
  }
4819
4819
 
4820
+ // src/commands/ward.ts
4821
+ import { readFile as readFile11 } from "fs/promises";
4822
+
4820
4823
  // src/modules/ward.ts
4821
4824
  import { readdir as readdir6, readFile as readFile10 } from "fs/promises";
4822
4825
  import { join as join13, relative as relative2 } from "path";
@@ -4942,8 +4945,24 @@ function parseTerms(raw) {
4942
4945
  if (!raw) return [];
4943
4946
  return raw.split(",").map((t) => t.trim()).filter(Boolean);
4944
4947
  }
4948
+ function parseTermsFileContent(raw) {
4949
+ return raw.split(/[,\r\n]+/).map((t) => t.trim()).filter(Boolean);
4950
+ }
4951
+ async function readTermsFile(filePath) {
4952
+ try {
4953
+ return parseTermsFileContent(await readFile11(filePath, "utf8"));
4954
+ } catch (error) {
4955
+ console.warn(
4956
+ `\u26A0 arcane: could not read --terms-file "${filePath}": ${error.message}`
4957
+ );
4958
+ return [];
4959
+ }
4960
+ }
4945
4961
  async function runWardCli(targetDir, options = {}, exclusions = []) {
4946
- const terms = parseTerms(options.terms);
4962
+ const terms = [
4963
+ ...parseTerms(options.terms),
4964
+ ...options.termsFile ? await readTermsFile(options.termsFile) : []
4965
+ ];
4947
4966
  const report = await runWard(targetDir, { terms, exclusions });
4948
4967
  console.log("\nspell ward \u2014 scanning for leaked identifiers\n");
4949
4968
  const leaks = report.findings.filter((f) => f.category === "leak");
@@ -5154,6 +5173,9 @@ program.command("doctor").description("Check your environment for Arcane prerequ
5154
5173
  program.command("ward").description("Scan the repo for leaked identifiers -- third-party trademarks and the operator's own personal identifiers alike (T18)").option(
5155
5174
  "--terms <terms>",
5156
5175
  "Comma-separated denylist terms, in addition to the built-in vendor-identifier list. Seed this from your OWN identity too, not just org/venture names -- usernames, machine names, and personal handles leak the same way a private venture name does (I1)"
5176
+ ).option(
5177
+ "--terms-file <path>",
5178
+ "Read denylist terms from a file instead of --terms, to avoid shell-history exposure (ARC-041). Same comma/newline-separated format as ARCANE_ORG_TOKENS."
5157
5179
  ).option("--gate", "Exit non-zero if any leak is found (for CI)").action(async (opts) => {
5158
5180
  await runWardCli(process.cwd(), opts);
5159
5181
  });