scoutline 0.24.0 → 0.24.1

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.
Files changed (45) hide show
  1. package/dist/commands/archive.d.ts +18 -1
  2. package/dist/commands/archive.d.ts.map +1 -1
  3. package/dist/commands/archive.js +23 -12
  4. package/dist/commands/archive.js.map +1 -1
  5. package/dist/commands/search.d.ts +16 -0
  6. package/dist/commands/search.d.ts.map +1 -1
  7. package/dist/commands/search.js +10 -2
  8. package/dist/commands/search.js.map +1 -1
  9. package/dist/index.d.ts +2 -0
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +21 -19
  12. package/dist/index.js.map +1 -1
  13. package/dist/lib/context-file.d.ts +21 -0
  14. package/dist/lib/context-file.d.ts.map +1 -1
  15. package/dist/lib/context-file.js +84 -6
  16. package/dist/lib/context-file.js.map +1 -1
  17. package/dist/lib/equals-form.d.ts +34 -0
  18. package/dist/lib/equals-form.d.ts.map +1 -0
  19. package/dist/lib/equals-form.js +49 -0
  20. package/dist/lib/equals-form.js.map +1 -0
  21. package/dist/lib/investigate-claims.d.ts +11 -3
  22. package/dist/lib/investigate-claims.d.ts.map +1 -1
  23. package/dist/lib/investigate-claims.js +28 -50
  24. package/dist/lib/investigate-claims.js.map +1 -1
  25. package/dist/lib/investigate-extract.d.ts +23 -0
  26. package/dist/lib/investigate-extract.d.ts.map +1 -1
  27. package/dist/lib/investigate-extract.js +32 -7
  28. package/dist/lib/investigate-extract.js.map +1 -1
  29. package/dist/lib/investigate-planner.d.ts +5 -3
  30. package/dist/lib/investigate-planner.d.ts.map +1 -1
  31. package/dist/lib/investigate-planner.js +17 -33
  32. package/dist/lib/investigate-planner.js.map +1 -1
  33. package/dist/lib/journal.d.ts.map +1 -1
  34. package/dist/lib/journal.js +10 -9
  35. package/dist/lib/journal.js.map +1 -1
  36. package/dist/providers/types.d.ts +16 -1
  37. package/dist/providers/types.d.ts.map +1 -1
  38. package/dist/providers/types.js.map +1 -1
  39. package/dist/providers/zai/adapter.d.ts.map +1 -1
  40. package/dist/providers/zai/adapter.js +38 -10
  41. package/dist/providers/zai/adapter.js.map +1 -1
  42. package/dist/providers/zai/layout-parsing.d.ts +2 -2
  43. package/dist/providers/zai/layout-parsing.d.ts.map +1 -1
  44. package/dist/providers/zai/layout-parsing.js.map +1 -1
  45. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -17,7 +17,7 @@ import { CONFIG_HELP, configGetCommand, configSetCommand, configUnsetCommand, }
17
17
  import { usageCommand, USAGE_HELP, DEFAULT_USAGE_WINDOW_DAYS, MAX_USAGE_WINDOW_DAYS, } from "./commands/usage.js";
18
18
  import { historyCommand, historyClearCommand, historyRecallCommand, historyExportCommand, HISTORY_HELP, HISTORY_NOTE_HELP, HISTORY_RECALL_HELP, HISTORY_CLEAR_HELP, HISTORY_EXPORT_HELP, } from "./commands/history.js";
19
19
  import { handleFetch } from "./commands/fetch.js";
20
- import { handleArchive, parseArchiveArgs } from "./commands/archive.js";
20
+ import { handleArchive, parseArchiveTokens } from "./commands/archive.js";
21
21
  import { handleWatch } from "./commands/watch.js";
22
22
  import { handleScience } from "./commands/science.js";
23
23
  import { investigate, INVESTIGATE_HELP, } from "./commands/investigate.js";
@@ -36,6 +36,7 @@ import { buildJournalRepeatMarker } from "./lib/journal.js";
36
36
  import { applyBudget } from "./lib/output-budget.js";
37
37
  import { persistCompaction } from "./lib/output-budget-persistence.js";
38
38
  import { ApiError, FileError, ValidationError, UnsupportedCapabilityError, CommandOptionUnsupportedError, getErrorExitCode, } from "./lib/errors.js";
39
+ import { normalizeEqualsFormFlags } from "./lib/equals-form.js";
39
40
  import * as os from "node:os";
40
41
  import * as path from "node:path";
41
42
  import * as fs from "node:fs/promises";
@@ -245,6 +246,8 @@ export function rejectFlagPair(flags, name, makeError) {
245
246
  throw makeError();
246
247
  }
247
248
  }
249
+ // #263: re-exported for the parser-level tests.
250
+ export { normalizeEqualsFormFlags };
248
251
  /**
249
252
  * Collect every occurrence of a long `--<name>` flag in argv order,
250
253
  * mirroring parseArgs' value-consumption rule (the next argument is the
@@ -3642,13 +3645,10 @@ async function handleInvestigate(args, outputMode, deps) {
3642
3645
  if (flags.verify !== undefined && flags.context !== undefined) {
3643
3646
  throw new ValidationError("--verify and --context cannot be combined: --verify splits the statement into claims (verify owns planning).", "Drop --context, or run without --verify to plan from the notes file.");
3644
3647
  }
3645
- // Valueless/malformed --verify guards (the --synthesize pattern):
3646
- // parseArgs would swallow a following token as the value.
3647
- for (const token of args) {
3648
- if (typeof token === "string" && token.startsWith("--verify=")) {
3649
- throw new ValidationError(`Invalid flag "${token}": the --flag=value form is not supported; --verify takes no value.`, "Pass the bare --verify to enable claim-corroboration mode, or omit it.");
3650
- }
3651
- }
3648
+ // Valueless --verify guard: parseArgs would swallow a following
3649
+ // token as the value. (The `--verify=` equals-form check is GONE:
3650
+ // #263 normalizes `--verify=foo` to `--verify foo` upstream, and this
3651
+ // existing boolean guard rejects it with the same error.)
3652
3652
  if (flags.verify !== undefined && flags.verify !== true) {
3653
3653
  throw new ValidationError("--verify is a boolean flag and takes no value", "Pass the bare --verify to enable claim-corroboration mode, or omit it.");
3654
3654
  }
@@ -3662,15 +3662,9 @@ async function handleInvestigate(args, outputMode, deps) {
3662
3662
  rejectFlagPair(flags, "arms", () => new ValidationError("investigate has no --arms flag; the arm set IS the provider pin.", "Use --provider <tavily,exa|all> to fan out, or a single --provider id for one arm."));
3663
3663
  rejectFlagPair(flags, "budget-tokens", () => new ValidationError("investigate has no --budget-tokens flag; --max-chars is the budget.", "Use --max-chars <n> (characters, not tokens)."));
3664
3664
  // T7 (PRD AC-7): --synthesize is VALUELESS. parseArgs assigns the
3665
- // next non-dash token as a flag value, so `--synthesize foo` would
3666
- // swallow the value; the =-form parses as a garbage key and is
3667
- // silently dropped (#172 review F6). Both reject here, before the
3665
+ // next non-dash token as a flag value, so `--synthesize foo` (and the
3666
+ // #263-normalized `--synthesize=foo`) rejects here, before the
3668
3667
  // help-gate, like every other malformed-flag guard in this handler.
3669
- for (const token of args) {
3670
- if (typeof token === "string" && token.startsWith("--synthesize=")) {
3671
- throw new ValidationError(`Invalid flag "${token}": the --flag=value form is not supported; --synthesize takes no value.`, "Pass the bare --synthesize to enable it, or omit it.");
3672
- }
3673
- }
3674
3668
  if (flags.synthesize !== undefined && flags.synthesize !== true) {
3675
3669
  throw new ValidationError("--synthesize is a boolean flag and takes no value", "Pass the bare --synthesize to enable it, or omit it.");
3676
3670
  }
@@ -4456,12 +4450,20 @@ export async function main(args, dependencies) {
4456
4450
  // envelope in the output mode the argv requested (re-derived from the
4457
4451
  // raw argv via `bestEffortOutputMode` because the partially parsed
4458
4452
  // result never escapes the throw) and the error's exit code.
4453
+ // #263: central `--flag=value` ≡ `--flag value` normalization. Runs
4454
+ // before EVERY argv consumer below (extractGlobalOptions, the
4455
+ // strict-flag gate, help/version checks, command handlers' parseArgs)
4456
+ // so all token walks observe space-form tokens only. Pure and
4457
+ // total-length-preserving plus at most the split tokens; the only
4458
+ // behavior change is where a `--flag=value` used to be a garbage
4459
+ // boolean key.
4460
+ const normalizedArgs = normalizeEqualsFormFlags(args);
4459
4461
  let extracted;
4460
4462
  try {
4461
- extracted = extractGlobalOptions([...args]);
4463
+ extracted = extractGlobalOptions(normalizedArgs);
4462
4464
  }
4463
4465
  catch (error) {
4464
- invocation.writeStderr(formatErrorOutput(error, bestEffortOutputMode(args, invocation), envSecrets));
4466
+ invocation.writeStderr(formatErrorOutput(error, bestEffortOutputMode(normalizedArgs, invocation), envSecrets));
4465
4467
  return getErrorExitCode(error);
4466
4468
  }
4467
4469
  const { outputFormat, forcePretty, forceRaw, provider, noFallback, isolated, rest } = extracted;
@@ -4943,7 +4945,7 @@ export async function main(args, dependencies) {
4943
4945
  // the human table was never the flag's contract.
4944
4946
  // Determine the subcommand through the parser (not positional
4945
4947
  // assumption): options may precede `get`/`cdx`.
4946
- const archiveSubcommand = parseArchiveArgs(commandArgs).subcommand;
4948
+ const archiveSubcommand = parseArchiveTokens(commandArgs).subcommand;
4947
4949
  const archiveOutputMode = forceRaw && outputFormat === undefined && archiveSubcommand === "get"
4948
4950
  ? "compact"
4949
4951
  : outputMode;