@koda-sl/baker-cli 0.344.0-dev.1f4f1c4b7 → 0.344.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/cli.js CHANGED
@@ -67,7 +67,7 @@ import {
67
67
  validateCanvasDeep,
68
68
  withoutCastName,
69
69
  ytDlpBlockSignal
70
- } from "./chunk-D5P4COPD.js";
70
+ } from "./chunk-FFOURYP5.js";
71
71
  import {
72
72
  csvOrJson,
73
73
  daysAgoIso,
@@ -67693,7 +67693,6 @@ function commandFor(root, argv) {
67693
67693
  const { command, resolved } = resolveCommand2(root, argv);
67694
67694
  return resolved ? command : null;
67695
67695
  }
67696
- var OUTPUT_EXPLANATION = "This command has no --output option: `--output json` is accepted by every command that prints the JSON envelope, and md or files only where `baker schema` lists `output`. Drop the option and read the default output. ";
67697
67696
  function unknownFlagEnvelope(unknown, commandPath, suggestion, hasSchema) {
67698
67697
  const list = unknown.join(", ");
67699
67698
  return {
@@ -67703,7 +67702,7 @@ function unknownFlagEnvelope(unknown, commandPath, suggestion, hasSchema) {
67703
67702
  message: `${list} ${unknown.length > 1 ? "are not options" : "is not an option"} of \`baker ${commandPath}\`.`,
67704
67703
  fix: {
67705
67704
  action: hasSchema ? "check_schema" : "check_help",
67706
- explanation: (unknown.some((flag) => flag === "--output" || flag.startsWith("--output=")) ? OUTPUT_EXPLANATION : "") + (suggestion ? `Did you mean ${suggestion}? ` : "") + `Run \`${hasSchema ? `baker schema ${commandPath}` : `baker ${commandPath} --help`}\` to see every option this command takes. Do not re-run the same call: until this version an unrecognised option was accepted and ignored, so a command that looked like it had filtered or narrowed the result was in fact answering the unfiltered question.`
67705
+ explanation: (suggestion ? `Did you mean ${suggestion}? ` : "") + `Run \`${hasSchema ? `baker schema ${commandPath}` : `baker ${commandPath} --help`}\` to see every option this command takes. Do not re-run the same call: until this version an unrecognised option was accepted and ignored, so a command that looked like it had filtered or narrowed the result was in fact answering the unfiltered question.`
67707
67706
  },
67708
67707
  retryable: false
67709
67708
  }
@@ -67742,53 +67741,6 @@ function refuseUnknownFlags(root, argv) {
67742
67741
  process.exit(1);
67743
67742
  }
67744
67743
 
67745
- // src/output-flag.ts
67746
- var FLAG = "--output";
67747
- var ENVELOPE = "json";
67748
- var PRINTS_NO_ENVELOPE = /* @__PURE__ */ new Set(["analytics sending-events", "canvas run", "canvas rerun", "canvas sync-definition"]);
67749
- function declaredArg(command, name) {
67750
- const args5 = command.args;
67751
- if (!args5 || typeof args5 !== "object" || !(name in args5)) {
67752
- return null;
67753
- }
67754
- const def = args5[name];
67755
- return def && typeof def === "object" ? def : {};
67756
- }
67757
- function envelopeRequests(argv) {
67758
- const end = argv.indexOf("--");
67759
- const limit = end === -1 ? argv.length : end;
67760
- const found = [];
67761
- for (let index = 0; index < limit; index++) {
67762
- const token = argv[index];
67763
- if (token === `${FLAG}=${ENVELOPE}`) {
67764
- found.push({ index, length: 1 });
67765
- } else if (token === FLAG && argv[index + 1] === ENVELOPE && index + 1 < limit) {
67766
- found.push({ index, length: 2 });
67767
- index++;
67768
- }
67769
- }
67770
- return found;
67771
- }
67772
- function outputFlagForCommand(root, argv) {
67773
- const requests = envelopeRequests(argv);
67774
- if (requests.length === 0) {
67775
- return argv;
67776
- }
67777
- const command = commandFor(root, argv);
67778
- if (!command || declaredArg(command, "output") || PRINTS_NO_ENVELOPE.has(commandPathOf(root, argv))) {
67779
- return argv;
67780
- }
67781
- const jsonSwitch = declaredArg(command, "json")?.type === "boolean";
67782
- const dropped = new Set(requests.flatMap(({ index, length }) => length === 2 ? [index, index + 1] : [index]));
67783
- const first = requests[0]?.index;
67784
- return argv.flatMap((token, index) => {
67785
- if (!dropped.has(index)) {
67786
- return [token];
67787
- }
67788
- return jsonSwitch && index === first ? ["--json"] : [];
67789
- });
67790
- }
67791
-
67792
67744
  // src/version.ts
67793
67745
  import { readFileSync as readFileSync21 } from "fs";
67794
67746
  function packageJsonUrl() {
@@ -67815,7 +67767,7 @@ var main = defineCommand245({
67815
67767
  Auth: Set BAKER_API_KEY (starts with bk_) and BAKER_API_URL environment variables.
67816
67768
  Chat: Set BAKER_CHAT_ID for action and scheduled-action commands that stage changes against a chat.
67817
67769
  Output: All commands return JSON envelopes: { ok: true, data: ... } or { ok: false, error: { code, message } }.
67818
- Formats: --output json works on every command that prints the envelope. --output md|files only where 'baker schema <command>' lists output. (The research commands additionally accept csv and jsonl.)
67770
+ Formats: Use --output json|files|md to control output format. Default: json. (The research commands additionally accept csv and jsonl.)
67819
67771
  Introspection: Run 'baker schema <command>' to inspect argument schemas.`
67820
67772
  },
67821
67773
  subCommands: {
@@ -67853,7 +67805,6 @@ process.argv = [...process.argv.slice(0, 2), ...normalizeCacheFlag(process.argv.
67853
67805
  installStreamTaps();
67854
67806
  logInvocation(process.argv.slice(2));
67855
67807
  installExitRecord();
67856
- process.argv = [...process.argv.slice(0, 2), ...outputFlagForCommand(main, process.argv.slice(2))];
67857
67808
  refuseUnknownFlags(main, process.argv.slice(2));
67858
67809
  process.argv = [...process.argv.slice(0, 2), ...cacheFlagForParser(process.argv.slice(2))];
67859
67810
  runMain(main);