@darkrymit/crunes-cli 0.14.0 → 0.14.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.
@@ -9,7 +9,7 @@ import "./chunk-PRCVJ727.js";
9
9
  import "./chunk-AFAVAB5Q.js";
10
10
  import {
11
11
  describeRunBlock
12
- } from "./chunk-C3FADOZT.js";
12
+ } from "./chunk-NCSTZMBQ.js";
13
13
  import {
14
14
  assertNotMissedRename,
15
15
  onPath,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  utils_api_default
3
- } from "./chunk-32GEHGUV.js";
3
+ } from "./chunk-ZO2JKBJX.js";
4
4
  import {
5
5
  globals_api_default
6
6
  } from "./chunk-V35LVVNV.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  parseSegment,
3
3
  permissionHint
4
- } from "./chunk-PICTIOYJ.js";
4
+ } from "./chunk-JDPQACG7.js";
5
5
  import {
6
6
  tailStdin
7
7
  } from "./chunk-OV4WBJT3.js";
@@ -13,10 +13,10 @@ import "./chunk-PRCVJ727.js";
13
13
  import "./chunk-AFAVAB5Q.js";
14
14
  import {
15
15
  describeConfigLayers
16
- } from "./chunk-WUNDVEEL.js";
16
+ } from "./chunk-W2A4ECOP.js";
17
17
  import {
18
18
  formatSection
19
- } from "./chunk-C3FADOZT.js";
19
+ } from "./chunk-NCSTZMBQ.js";
20
20
  import "./chunk-UKAIACRQ.js";
21
21
  import "./chunk-HQUMVDQE.js";
22
22
  import {
@@ -157,7 +157,7 @@ async function handler({
157
157
  output.info("Run `crunes init` to create a config file.");
158
158
  process.exit(1);
159
159
  }
160
- const { resolveRuneEntry } = await import("./resolver-II54EHPA.js");
160
+ const { resolveRuneEntry } = await import("./resolver-4IZNQ3QJ.js");
161
161
  let runeEntry;
162
162
  try {
163
163
  runeEntry = await resolveRuneEntry(projectRoot, config, key, configRoot);
@@ -4,8 +4,8 @@ import {
4
4
  resolveRuneEntry,
5
5
  resolveRuneFromPlugins,
6
6
  runRune
7
- } from "./chunk-WUNDVEEL.js";
8
- import "./chunk-C3FADOZT.js";
7
+ } from "./chunk-W2A4ECOP.js";
8
+ import "./chunk-NCSTZMBQ.js";
9
9
  import "./chunk-UKAIACRQ.js";
10
10
  import "./chunk-HQUMVDQE.js";
11
11
  import {
@@ -4,12 +4,12 @@ import {
4
4
  parseBracketKey,
5
5
  parseRunArgs,
6
6
  parseSegment
7
- } from "./chunk-PICTIOYJ.js";
7
+ } from "./chunk-JDPQACG7.js";
8
8
  import "./chunk-RQ6KHY6W.js";
9
9
  import "./chunk-PRCVJ727.js";
10
10
  import "./chunk-AFAVAB5Q.js";
11
- import "./chunk-WUNDVEEL.js";
12
- import "./chunk-C3FADOZT.js";
11
+ import "./chunk-W2A4ECOP.js";
12
+ import "./chunk-NCSTZMBQ.js";
13
13
  import "./chunk-UKAIACRQ.js";
14
14
  import "./chunk-HQUMVDQE.js";
15
15
  import "./chunk-YUI5RTLD.js";
@@ -5,7 +5,7 @@ import {
5
5
  getArgsSchema,
6
6
  getPluginRunePath,
7
7
  getReplSchema
8
- } from "./chunk-ZFIRPZPE.js";
8
+ } from "./chunk-SPXPSPM7.js";
9
9
  import "./chunk-HYPUZ5DT.js";
10
10
  import "./chunk-XPEVUBUK.js";
11
11
  import "./chunk-5L2GJWCD.js";
@@ -19,7 +19,7 @@ import "./chunk-AFAVAB5Q.js";
19
19
  import {
20
20
  resolvePluginRune,
21
21
  resolveRuneFromPlugins
22
- } from "./chunk-WUNDVEEL.js";
22
+ } from "./chunk-W2A4ECOP.js";
23
23
  import {
24
24
  describeRunBlock,
25
25
  flattenCommands,
@@ -28,7 +28,7 @@ import {
28
28
  formatRuneIndex,
29
29
  getRunBlockSchema,
30
30
  selectNode
31
- } from "./chunk-C3FADOZT.js";
31
+ } from "./chunk-NCSTZMBQ.js";
32
32
  import {
33
33
  resolveInterpreter
34
34
  } from "./chunk-UKAIACRQ.js";
@@ -7,7 +7,7 @@ import {
7
7
  runPluginRune,
8
8
  runRuneInIsolate,
9
9
  runRuneInRepl
10
- } from "./chunk-ZFIRPZPE.js";
10
+ } from "./chunk-SPXPSPM7.js";
11
11
  import "./chunk-HYPUZ5DT.js";
12
12
  import "./chunk-XPEVUBUK.js";
13
13
  import "./chunk-5L2GJWCD.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  utils_api_default
3
- } from "./chunk-32GEHGUV.js";
3
+ } from "./chunk-ZO2JKBJX.js";
4
4
  import {
5
5
  formatNode,
6
6
  walk
@@ -16,7 +16,7 @@ import path from "node:path";
16
16
  // package.json
17
17
  var package_default = {
18
18
  name: "@darkrymit/crunes-cli",
19
- version: "0.14.0",
19
+ version: "0.14.1",
20
20
  description: "CLI tool for querying crunes enrichers",
21
21
  type: "module",
22
22
  bin: {
package/dist/cli.js CHANGED
@@ -3397,7 +3397,7 @@ var program = new Command();
3397
3397
  // src/cli/program.js
3398
3398
  function buildProgram() {
3399
3399
  const program3 = new Command();
3400
- program3.name("crunes").description("CLI tool for managing context runes").version("0.14.0", "-v, --version").enablePositionalOptions().option("-y, --yes", "assume yes to all prompts and skip interactive mode (also auto-detected in non-TTY environments)").option("-p, --plain", "plain output: no colors, no box-drawing, plain symbols \u2014 optimised for AI/pipe use").option("--cwd <path>", "project root to use instead of the current working directory").option("--ccd <path>", "config directory \u2014 where .crunes/config.json and local rune files live (default: --cwd)").option("--verbose", "print full error stack traces and other verbose output");
3400
+ program3.name("crunes").description("CLI tool for managing context runes").version("0.14.1", "-v, --version").enablePositionalOptions().option("-y, --yes", "assume yes to all prompts and skip interactive mode (also auto-detected in non-TTY environments)").option("-p, --plain", "plain output: no colors, no box-drawing, plain symbols \u2014 optimised for AI/pipe use").option("--cwd <path>", "project root to use instead of the current working directory").option("--ccd <path>", "config directory \u2014 where .crunes/config.json and local rune files live (default: --cwd)").option("--verbose", "print full error stack traces and other verbose output");
3401
3401
  program3.hook("preAction", (_thisCommand, actionCommand) => {
3402
3402
  const opts = { ...program3.opts(), ...actionCommand.opts() };
3403
3403
  configure({ plain: !!opts.plain, verbose: !!opts.verbose });
@@ -3417,7 +3417,7 @@ function buildProgram() {
3417
3417
  "after",
3418
3418
  '\nImportant: Global flags (e.g. --cwd) MUST appear before the "run" command.\n\nSyntax:\n [run-flags] <key>[-s s1,s2] [rune-args...]\n -b [run-flags] <key1>[-s s1] [rune-args1] + <key2>[-s s2] [rune-args2]\n\nCommand flags:\n -b, --batch enable batching multiple runes with +\n --format text|jsonl output format (default: text)\n --fail-fast stop on first error\n\nPer-rune bracket flags (inside key[...]):\n -s, --section s1,s2 filter output sections for this rune\n\nKey prefixes:\n project:name resolve from project config only\n plugin:name resolve directly from an enabled plugin\n name auto-resolve: project config first, then plugins\n\nFor rune argument documentation: crunes docs rune <key>'
3419
3419
  ).allowUnknownOption().passThroughOptions().action(async (args, _opts, _command) => {
3420
- const { handler, parseRunArgs } = await import("./chunks/run-PXTN5GYH.js");
3420
+ const { handler, parseRunArgs } = await import("./chunks/run-BFGVSKV7.js");
3421
3421
  const { segments, format, failFast, isBatch } = parseRunArgs(args);
3422
3422
  await handler({ segments, format, failFast, isBatch, projectRoot: projectRoot(), configRoot: configRoot() });
3423
3423
  });
@@ -3425,7 +3425,7 @@ function buildProgram() {
3425
3425
  "after",
3426
3426
  '\nImportant: Global flags (e.g. --cwd) MUST appear before the "repl" command.\n\nSyntax:\n [--format text|jsonl] <key>[-s s1,s2] [rune-args...]\n\nPer-rune bracket flags (inside key[...]):\n -s, --section s1,s2 filter output sections for this rune\n\nThe rune must export repl(args) and/or inputRepl(input).\nFor rune argument documentation: crunes docs rune <key>'
3427
3427
  ).allowUnknownOption().passThroughOptions().action(async (args, _opts, _command) => {
3428
- const { handler, parseReplArgs } = await import("./chunks/repl-GNA342PP.js");
3428
+ const { handler, parseReplArgs } = await import("./chunks/repl-QNXLTQYU.js");
3429
3429
  const { key, runeArgs, sections, format } = parseReplArgs(args);
3430
3430
  await handler({ key, runeArgs, sections, format, projectRoot: projectRoot(), configRoot: configRoot() });
3431
3431
  });
@@ -3434,11 +3434,11 @@ function buildProgram() {
3434
3434
  "after",
3435
3435
  "\n crunes docs rune index of every rune and its commands\n crunes docs rune <key> command index for one rune\n crunes docs rune <key> <cmd>... detail for one command path\n"
3436
3436
  ).addOption(new Option("--format <format>", "output format").choices(["text", "json"]).default("text")).action(async (key, path3, opts) => {
3437
- const { handler } = await import("./chunks/rune-7YEZJTHK.js");
3437
+ const { handler } = await import("./chunks/rune-RNJCIH4L.js");
3438
3438
  await handler({ key, path: path3, format: opts.format, projectRoot: projectRoot(), configRoot: configRoot() });
3439
3439
  });
3440
3440
  helpGroup.command("utils [namespaces...]").description("Show function signatures and parameter docs for utils.* namespaces").addOption(new Option("--format <format>", "output format").choices(["text", "json"]).default("text")).action(async (namespaces, opts) => {
3441
- const { handler } = await import("./chunks/utils-K7DAKWGS.js");
3441
+ const { handler } = await import("./chunks/utils-N6QJKOAO.js");
3442
3442
  await handler({ namespaces, format: opts.format });
3443
3443
  });
3444
3444
  helpGroup.command("globals").description("Show injected sandbox globals and ES2020 builtins available in rune scripts").addOption(new Option("--format <format>", "output format").choices(["text", "json"]).default("text")).action(async (opts) => {
@@ -3446,7 +3446,7 @@ function buildProgram() {
3446
3446
  await handler({ format: opts.format });
3447
3447
  });
3448
3448
  helpGroup.command("intro").description("Generate a comprehensive introduction to Crunes: rune anatomy, calling conventions, config, permissions and the full @utils API. Generic \u2014 for this project's own runes use `crunes list` and `crunes docs rune`").option("--out <path>", "output file path (defaults to stdout)").action(async (opts) => {
3449
- const { handler } = await import("./chunks/intro-L5WBDL2P.js");
3449
+ const { handler } = await import("./chunks/intro-PTGUS5FN.js");
3450
3450
  await handler({ out: opts.out });
3451
3451
  });
3452
3452
  helpGroup.command("args").description("Show detailed documentation, conventions, and examples for the args(builder) export").action(async () => {
@@ -3482,18 +3482,18 @@ function buildProgram() {
3482
3482
  await handler();
3483
3483
  });
3484
3484
  program3.command("version").description("Print the installed version and check for updates").option("--no-check", "skip the npm update check").action(async (opts) => {
3485
- const { handler } = await import("./chunks/version-RZVOIMQG.js");
3485
+ const { handler } = await import("./chunks/version-CYVVKOVG.js");
3486
3486
  await handler({ check: opts.check, plain: !!program3.opts().plain });
3487
3487
  });
3488
3488
  program3.command("doctor").description("Verify environment and project setup").option("-p, --plain", "plain output: no colors, no box-drawing, plain symbols \u2014 optimised for AI/pipe use").action(async () => {
3489
- const { handler } = await import("./chunks/doctor-HLQE7TVE.js");
3489
+ const { handler } = await import("./chunks/doctor-Q6FZHDMH.js");
3490
3490
  await handler({ projectRoot: projectRoot() });
3491
3491
  });
3492
3492
  program3.command("bench [args...]").description("Time rune execution and report fast, ok, or slow.").addHelpText(
3493
3493
  "after",
3494
3494
  '\nImportant: Global flags (e.g. --cwd) MUST appear before the "bench" command.\n\nSyntax:\n [--runs <n>] [--warmup] <key>[--runs <n>] [--warmup] [-s s1,s2] [rune-args...]\n\nCommand flags:\n -b, --batch enable batching multiple runes with +\n --format text|jsonl output format (default: text)\n --fail-fast stop on first error\n --runs <n> default number of runs for all runes (default: 1)\n --warmup default warmup run for all runes\n\nPer-rune bracket flags (inside key[...]):\n --runs <n> override run count for this rune\n --warmup override warmup for this rune\n -s, --section s1,s2 filter output sections for this rune'
3495
3495
  ).allowUnknownOption().passThroughOptions().action(async (args, _opts, _command) => {
3496
- const { handler, parseBenchArgs } = await import("./chunks/benchmark-HBIZCVFR.js");
3496
+ const { handler, parseBenchArgs } = await import("./chunks/benchmark-Y2FTRSOP.js");
3497
3497
  const parsed = parseBenchArgs(args);
3498
3498
  if (!parsed.segments[0]?.key) {
3499
3499
  const { output } = await import("./chunks/output-JVJFXQPF.js");
@@ -20696,7 +20696,7 @@ var require_parse3 = __commonJS({
20696
20696
  var BufferStream = require_BufferStream();
20697
20697
  var parseExtraField = require_parseExtraField();
20698
20698
  var parseDateTime = require_parseDateTime();
20699
- var pipeline2 = Stream.pipeline;
20699
+ var pipeline3 = Stream.pipeline;
20700
20700
  var parseBuffer = require_parseBuffer();
20701
20701
  var endDirectorySignature = Buffer.alloc(4);
20702
20702
  endDirectorySignature.writeUInt32LE(101010256, 0);
@@ -20845,7 +20845,7 @@ var require_parse3 = __commonJS({
20845
20845
  eof.writeUInt32LE(134695760, 0);
20846
20846
  }
20847
20847
  return new Promise(function(resolve6, reject) {
20848
- pipeline2(
20848
+ pipeline3(
20849
20849
  self2.stream(eof),
20850
20850
  inflater,
20851
20851
  entry,
@@ -28141,7 +28141,7 @@ var require_pipeline = __commonJS({
28141
28141
  if (typeof streams[streams.length - 1] !== "function") return noop;
28142
28142
  return streams.pop();
28143
28143
  }
28144
- function pipeline2() {
28144
+ function pipeline3() {
28145
28145
  for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {
28146
28146
  streams[_key] = arguments[_key];
28147
28147
  }
@@ -28164,7 +28164,7 @@ var require_pipeline = __commonJS({
28164
28164
  });
28165
28165
  return streams.reduce(pipe);
28166
28166
  }
28167
- module2.exports = pipeline2;
28167
+ module2.exports = pipeline3;
28168
28168
  }
28169
28169
  });
28170
28170
 
@@ -44917,7 +44917,7 @@ var require_pipeline2 = __commonJS({
44917
44917
  }
44918
44918
  }
44919
44919
  }
44920
- function pipeline2(...streams) {
44920
+ function pipeline3(...streams) {
44921
44921
  return pipelineImpl(streams, once(popCallback(streams)));
44922
44922
  }
44923
44923
  function pipelineImpl(streams, callback2, opts) {
@@ -45183,7 +45183,7 @@ var require_pipeline2 = __commonJS({
45183
45183
  }
45184
45184
  module2.exports = {
45185
45185
  pipelineImpl,
45186
- pipeline: pipeline2
45186
+ pipeline: pipeline3
45187
45187
  };
45188
45188
  }
45189
45189
  });
@@ -45193,7 +45193,7 @@ var require_compose = __commonJS({
45193
45193
  "node_modules/archiver/node_modules/readable-stream/lib/internal/streams/compose.js"(exports2, module2) {
45194
45194
  "use strict";
45195
45195
  init_require_shim();
45196
- var { pipeline: pipeline2 } = require_pipeline2();
45196
+ var { pipeline: pipeline3 } = require_pipeline2();
45197
45197
  var Duplex = require_duplex();
45198
45198
  var { destroyer } = require_destroy4();
45199
45199
  var {
@@ -45253,7 +45253,7 @@ var require_compose = __commonJS({
45253
45253
  }
45254
45254
  }
45255
45255
  const head = streams[0];
45256
- const tail = pipeline2(streams, onfinished);
45256
+ const tail = pipeline3(streams, onfinished);
45257
45257
  const writable = !!(isWritable(head) || isWritableStream(head) || isTransformStream(head));
45258
45258
  const readable = !!(isReadable(tail) || isReadableStream(tail) || isTransformStream(tail));
45259
45259
  d = new Duplex({
@@ -45798,7 +45798,7 @@ var require_promises = __commonJS({
45798
45798
  var { pipelineImpl: pl2 } = require_pipeline2();
45799
45799
  var { finished } = require_end_of_stream2();
45800
45800
  require_stream4();
45801
- function pipeline2(...streams) {
45801
+ function pipeline3(...streams) {
45802
45802
  return new Promise2((resolve6, reject) => {
45803
45803
  let signal;
45804
45804
  let end;
@@ -45826,7 +45826,7 @@ var require_promises = __commonJS({
45826
45826
  }
45827
45827
  module2.exports = {
45828
45828
  finished,
45829
- pipeline: pipeline2
45829
+ pipeline: pipeline3
45830
45830
  };
45831
45831
  }
45832
45832
  });
@@ -45847,7 +45847,7 @@ var require_stream4 = __commonJS({
45847
45847
  } = require_errors4();
45848
45848
  var compose = require_compose();
45849
45849
  var { setDefaultHighWaterMark, getDefaultHighWaterMark } = require_state2();
45850
- var { pipeline: pipeline2 } = require_pipeline2();
45850
+ var { pipeline: pipeline3 } = require_pipeline2();
45851
45851
  var { destroyer } = require_destroy4();
45852
45852
  var eos = require_end_of_stream2();
45853
45853
  var promises = require_promises();
@@ -45911,7 +45911,7 @@ var require_stream4 = __commonJS({
45911
45911
  Stream.Duplex = require_duplex();
45912
45912
  Stream.Transform = require_transform();
45913
45913
  Stream.PassThrough = require_passthrough2();
45914
- Stream.pipeline = pipeline2;
45914
+ Stream.pipeline = pipeline3;
45915
45915
  var { addAbortSignal } = require_add_abort_signal();
45916
45916
  Stream.addAbortSignal = addAbortSignal;
45917
45917
  Stream.finished = eos;
@@ -45927,7 +45927,7 @@ var require_stream4 = __commonJS({
45927
45927
  return promises;
45928
45928
  }
45929
45929
  });
45930
- ObjectDefineProperty(pipeline2, customPromisify, {
45930
+ ObjectDefineProperty(pipeline3, customPromisify, {
45931
45931
  __proto__: null,
45932
45932
  enumerable: true,
45933
45933
  get() {
@@ -51803,7 +51803,7 @@ var require_pipeline3 = __commonJS({
51803
51803
  }
51804
51804
  }
51805
51805
  }
51806
- function pipeline2(...streams) {
51806
+ function pipeline3(...streams) {
51807
51807
  return pipelineImpl(streams, once(popCallback(streams)));
51808
51808
  }
51809
51809
  function pipelineImpl(streams, callback2, opts) {
@@ -52069,7 +52069,7 @@ var require_pipeline3 = __commonJS({
52069
52069
  }
52070
52070
  module2.exports = {
52071
52071
  pipelineImpl,
52072
- pipeline: pipeline2
52072
+ pipeline: pipeline3
52073
52073
  };
52074
52074
  }
52075
52075
  });
@@ -52079,7 +52079,7 @@ var require_compose2 = __commonJS({
52079
52079
  "node_modules/compress-commons/node_modules/readable-stream/lib/internal/streams/compose.js"(exports2, module2) {
52080
52080
  "use strict";
52081
52081
  init_require_shim();
52082
- var { pipeline: pipeline2 } = require_pipeline3();
52082
+ var { pipeline: pipeline3 } = require_pipeline3();
52083
52083
  var Duplex = require_duplex2();
52084
52084
  var { destroyer } = require_destroy5();
52085
52085
  var {
@@ -52139,7 +52139,7 @@ var require_compose2 = __commonJS({
52139
52139
  }
52140
52140
  }
52141
52141
  const head = streams[0];
52142
- const tail = pipeline2(streams, onfinished);
52142
+ const tail = pipeline3(streams, onfinished);
52143
52143
  const writable = !!(isWritable(head) || isWritableStream(head) || isTransformStream(head));
52144
52144
  const readable = !!(isReadable(tail) || isReadableStream(tail) || isTransformStream(tail));
52145
52145
  d = new Duplex({
@@ -52684,7 +52684,7 @@ var require_promises2 = __commonJS({
52684
52684
  var { pipelineImpl: pl2 } = require_pipeline3();
52685
52685
  var { finished } = require_end_of_stream3();
52686
52686
  require_stream5();
52687
- function pipeline2(...streams) {
52687
+ function pipeline3(...streams) {
52688
52688
  return new Promise2((resolve6, reject) => {
52689
52689
  let signal;
52690
52690
  let end;
@@ -52712,7 +52712,7 @@ var require_promises2 = __commonJS({
52712
52712
  }
52713
52713
  module2.exports = {
52714
52714
  finished,
52715
- pipeline: pipeline2
52715
+ pipeline: pipeline3
52716
52716
  };
52717
52717
  }
52718
52718
  });
@@ -52733,7 +52733,7 @@ var require_stream5 = __commonJS({
52733
52733
  } = require_errors5();
52734
52734
  var compose = require_compose2();
52735
52735
  var { setDefaultHighWaterMark, getDefaultHighWaterMark } = require_state3();
52736
- var { pipeline: pipeline2 } = require_pipeline3();
52736
+ var { pipeline: pipeline3 } = require_pipeline3();
52737
52737
  var { destroyer } = require_destroy5();
52738
52738
  var eos = require_end_of_stream3();
52739
52739
  var promises = require_promises2();
@@ -52797,7 +52797,7 @@ var require_stream5 = __commonJS({
52797
52797
  Stream.Duplex = require_duplex2();
52798
52798
  Stream.Transform = require_transform2();
52799
52799
  Stream.PassThrough = require_passthrough3();
52800
- Stream.pipeline = pipeline2;
52800
+ Stream.pipeline = pipeline3;
52801
52801
  var { addAbortSignal } = require_add_abort_signal2();
52802
52802
  Stream.addAbortSignal = addAbortSignal;
52803
52803
  Stream.finished = eos;
@@ -52813,7 +52813,7 @@ var require_stream5 = __commonJS({
52813
52813
  return promises;
52814
52814
  }
52815
52815
  });
52816
- ObjectDefineProperty(pipeline2, customPromisify, {
52816
+ ObjectDefineProperty(pipeline3, customPromisify, {
52817
52817
  __proto__: null,
52818
52818
  enumerable: true,
52819
52819
  get() {
@@ -57501,7 +57501,7 @@ var require_pipeline4 = __commonJS({
57501
57501
  }
57502
57502
  }
57503
57503
  }
57504
- function pipeline2(...streams) {
57504
+ function pipeline3(...streams) {
57505
57505
  return pipelineImpl(streams, once(popCallback(streams)));
57506
57506
  }
57507
57507
  function pipelineImpl(streams, callback2, opts) {
@@ -57767,7 +57767,7 @@ var require_pipeline4 = __commonJS({
57767
57767
  }
57768
57768
  module2.exports = {
57769
57769
  pipelineImpl,
57770
- pipeline: pipeline2
57770
+ pipeline: pipeline3
57771
57771
  };
57772
57772
  }
57773
57773
  });
@@ -57777,7 +57777,7 @@ var require_compose3 = __commonJS({
57777
57777
  "node_modules/crc32-stream/node_modules/readable-stream/lib/internal/streams/compose.js"(exports2, module2) {
57778
57778
  "use strict";
57779
57779
  init_require_shim();
57780
- var { pipeline: pipeline2 } = require_pipeline4();
57780
+ var { pipeline: pipeline3 } = require_pipeline4();
57781
57781
  var Duplex = require_duplex3();
57782
57782
  var { destroyer } = require_destroy6();
57783
57783
  var {
@@ -57837,7 +57837,7 @@ var require_compose3 = __commonJS({
57837
57837
  }
57838
57838
  }
57839
57839
  const head = streams[0];
57840
- const tail = pipeline2(streams, onfinished);
57840
+ const tail = pipeline3(streams, onfinished);
57841
57841
  const writable = !!(isWritable(head) || isWritableStream(head) || isTransformStream(head));
57842
57842
  const readable = !!(isReadable(tail) || isReadableStream(tail) || isTransformStream(tail));
57843
57843
  d = new Duplex({
@@ -58382,7 +58382,7 @@ var require_promises3 = __commonJS({
58382
58382
  var { pipelineImpl: pl2 } = require_pipeline4();
58383
58383
  var { finished } = require_end_of_stream4();
58384
58384
  require_stream6();
58385
- function pipeline2(...streams) {
58385
+ function pipeline3(...streams) {
58386
58386
  return new Promise2((resolve6, reject) => {
58387
58387
  let signal;
58388
58388
  let end;
@@ -58410,7 +58410,7 @@ var require_promises3 = __commonJS({
58410
58410
  }
58411
58411
  module2.exports = {
58412
58412
  finished,
58413
- pipeline: pipeline2
58413
+ pipeline: pipeline3
58414
58414
  };
58415
58415
  }
58416
58416
  });
@@ -58431,7 +58431,7 @@ var require_stream6 = __commonJS({
58431
58431
  } = require_errors6();
58432
58432
  var compose = require_compose3();
58433
58433
  var { setDefaultHighWaterMark, getDefaultHighWaterMark } = require_state4();
58434
- var { pipeline: pipeline2 } = require_pipeline4();
58434
+ var { pipeline: pipeline3 } = require_pipeline4();
58435
58435
  var { destroyer } = require_destroy6();
58436
58436
  var eos = require_end_of_stream4();
58437
58437
  var promises = require_promises3();
@@ -58495,7 +58495,7 @@ var require_stream6 = __commonJS({
58495
58495
  Stream.Duplex = require_duplex3();
58496
58496
  Stream.Transform = require_transform3();
58497
58497
  Stream.PassThrough = require_passthrough4();
58498
- Stream.pipeline = pipeline2;
58498
+ Stream.pipeline = pipeline3;
58499
58499
  var { addAbortSignal } = require_add_abort_signal3();
58500
58500
  Stream.addAbortSignal = addAbortSignal;
58501
58501
  Stream.finished = eos;
@@ -58511,7 +58511,7 @@ var require_stream6 = __commonJS({
58511
58511
  return promises;
58512
58512
  }
58513
58513
  });
58514
- ObjectDefineProperty(pipeline2, customPromisify, {
58514
+ ObjectDefineProperty(pipeline3, customPromisify, {
58515
58515
  __proto__: null,
58516
58516
  enumerable: true,
58517
58517
  get() {
@@ -60578,13 +60578,13 @@ var require_streamx = __commonJS({
60578
60578
  }
60579
60579
  function pipelinePromise(...streams) {
60580
60580
  return new Promise((resolve6, reject) => {
60581
- return pipeline2(...streams, (err) => {
60581
+ return pipeline3(...streams, (err) => {
60582
60582
  if (err) return reject(err);
60583
60583
  resolve6();
60584
60584
  });
60585
60585
  });
60586
60586
  }
60587
- function pipeline2(stream, ...streams) {
60587
+ function pipeline3(stream, ...streams) {
60588
60588
  const all = Array.isArray(stream) ? [...stream, ...streams] : [stream, ...streams];
60589
60589
  const done = all.length && typeof all[all.length - 1] === "function" ? all.pop() : null;
60590
60590
  if (all.length < 2) throw new Error("Pipeline requires at least 2 streams");
@@ -60678,7 +60678,7 @@ var require_streamx = __commonJS({
60678
60678
  return s._writev !== Writable.prototype._writev && s._writev !== Duplex.prototype._writev;
60679
60679
  }
60680
60680
  module2.exports = {
60681
- pipeline: pipeline2,
60681
+ pipeline: pipeline3,
60682
60682
  pipelinePromise,
60683
60683
  isStream: isStream2,
60684
60684
  isStreamx,
@@ -69163,6 +69163,8 @@ function formatList(node2, bullet, depth) {
69163
69163
  init_require_shim();
69164
69164
  import fsPromises from "node:fs/promises";
69165
69165
  import { createReadStream, createWriteStream, realpathSync as realpathSync2 } from "node:fs";
69166
+ import { pipeline } from "node:stream";
69167
+ import { createZstdDecompress } from "node:zlib";
69166
69168
  import path5 from "node:path";
69167
69169
 
69168
69170
  // node_modules/tinyglobby/dist/index.mjs
@@ -70152,7 +70154,7 @@ async function readEdgeLines(abs, from, to) {
70152
70154
  }
70153
70155
  }
70154
70156
  var LINE_BATCH_BYTES = 256 * 1024;
70155
- async function* readLineBatches(abs, needles) {
70157
+ async function* readLineBatches(abs, needles, decompress) {
70156
70158
  let batch = [];
70157
70159
  let batchBytes = 0;
70158
70160
  let pending = [];
@@ -70167,7 +70169,10 @@ async function* readLineBatches(abs, needles) {
70167
70169
  batch.push(line.toString("utf8"));
70168
70170
  batchBytes += line.length + 1;
70169
70171
  };
70170
- for await (const chunk of createReadStream(abs, { highWaterMark: 1024 * 1024 })) {
70172
+ const file = createReadStream(abs, { highWaterMark: 1024 * 1024 });
70173
+ const source = decompress ? pipeline(file, createZstdDecompress(), () => {
70174
+ }) : file;
70175
+ for await (const chunk of source) {
70171
70176
  let start = 0;
70172
70177
  let nl;
70173
70178
  while ((nl = chunk.indexOf(10, start)) !== -1) {
@@ -70336,11 +70341,12 @@ function createFsUtils(dir, checkPermission, pluginDir = null, pluginId = null,
70336
70341
  if (checkPermission) checkPermission("fs.read", relPath);
70337
70342
  return createReadStream(abs);
70338
70343
  },
70339
- readLinesIter(relPath, { contains } = {}) {
70344
+ readLinesIter(relPath, { contains, decompress } = {}) {
70345
+ if (decompress != null && decompress !== "zstd") throw new TypeError(`fs.readLinesStream: unsupported decompress "${decompress}", expected "zstd"`);
70340
70346
  if (contains != null && !Array.isArray(contains)) throw new TypeError("fs.readLinesStream: contains must be an array of strings");
70341
70347
  const abs = resolvePath(relPath, ctx());
70342
70348
  if (checkPermission) checkPermission("fs.read", relPath);
70343
- return readLineBatches(abs, contains?.map((s) => Buffer.from(s, "utf8")) ?? null);
70349
+ return readLineBatches(abs, contains?.map((s) => Buffer.from(s, "utf8")) ?? null, decompress === "zstd");
70344
70350
  },
70345
70351
  async appendStreamRef(relPath) {
70346
70352
  const abs = resolvePath(relPath, ctx());
@@ -74688,7 +74694,7 @@ function createOsInfo() {
74688
74694
  init_require_shim();
74689
74695
  import fs3 from "node:fs/promises";
74690
74696
  import { createWriteStream as createWriteStream2 } from "node:fs";
74691
- import { pipeline } from "node:stream/promises";
74697
+ import { pipeline as pipeline2 } from "node:stream/promises";
74692
74698
  import path12 from "node:path";
74693
74699
  var _unzipper;
74694
74700
  function getUnzipper() {
@@ -74745,7 +74751,7 @@ function createArchiveUtils(dir, checkPermission) {
74745
74751
  await fs3.mkdir(absEntry, { recursive: true });
74746
74752
  } else {
74747
74753
  await fs3.mkdir(path12.dirname(absEntry), { recursive: true });
74748
- await pipeline(file.stream(), createWriteStream2(absEntry));
74754
+ await pipeline2(file.stream(), createWriteStream2(absEntry));
74749
74755
  }
74750
74756
  }
74751
74757
  },
@@ -74837,7 +74843,7 @@ function createArchiveUtils(dir, checkPermission) {
74837
74843
  if (entry.type === "Directory") {
74838
74844
  p2 = fs3.mkdir(absEntry, { recursive: true }).then(() => entry.autodrain()).catch(() => entry.autodrain());
74839
74845
  } else {
74840
- p2 = fs3.mkdir(path12.dirname(absEntry), { recursive: true }).then(() => pipeline(entry, createWriteStream2(absEntry))).catch(() => entry.autodrain());
74846
+ p2 = fs3.mkdir(path12.dirname(absEntry), { recursive: true }).then(() => pipeline2(entry, createWriteStream2(absEntry))).catch(() => entry.autodrain());
74841
74847
  }
74842
74848
  activePromises.add(p2);
74843
74849
  p2.finally(() => activePromises.delete(p2));
@@ -75034,7 +75040,7 @@ function createCacheUtils(dir, checkPermission, { pluginId = null, storeDir = nu
75034
75040
 
75035
75041
  // src/rune/api/sqlite.js
75036
75042
  init_require_shim();
75037
- import { mkdirSync } from "node:fs";
75043
+ import { existsSync as existsSync4, mkdirSync } from "node:fs";
75038
75044
  import path14 from "node:path";
75039
75045
  async function loadDatabase() {
75040
75046
  try {
@@ -75049,10 +75055,29 @@ async function loadDatabase() {
75049
75055
  function resolveFileName(name) {
75050
75056
  return /\.\w+$/.test(name) ? name : `${name}.sqlite`;
75051
75057
  }
75058
+ function isGranted(check) {
75059
+ if (!check) return true;
75060
+ try {
75061
+ check();
75062
+ return true;
75063
+ } catch (err) {
75064
+ if (err instanceof PermissionError) return false;
75065
+ throw err;
75066
+ }
75067
+ }
75068
+ function openDatabase(Database, dbPath, checkRead, checkWrite) {
75069
+ if (isGranted(checkWrite)) {
75070
+ mkdirSync(path14.dirname(dbPath), { recursive: true });
75071
+ const db = new Database(dbPath);
75072
+ db.pragma("journal_mode = WAL");
75073
+ return db;
75074
+ }
75075
+ checkRead();
75076
+ if (!existsSync4(dbPath)) throw new Error(`sqlite.open: no database at ${dbPath}, and creating one needs a sqlite.write grant`);
75077
+ return new Database(dbPath, { readonly: true, fileMustExist: true });
75078
+ }
75052
75079
  function makeHandle2(Database, dbPath, checkRead, checkWrite, connections) {
75053
- mkdirSync(path14.dirname(dbPath), { recursive: true });
75054
- const db = new Database(dbPath);
75055
- db.pragma("journal_mode = WAL");
75080
+ const db = openDatabase(Database, dbPath, checkRead, checkWrite);
75056
75081
  connections.push(db);
75057
75082
  return {
75058
75083
  query(sql, params = []) {
@@ -75943,6 +75968,31 @@ function createTestFs(fs5) {
75943
75968
  }
75944
75969
  };
75945
75970
  }
75971
+ function createTestSqlite(sqlite) {
75972
+ return {
75973
+ async open(location, name) {
75974
+ const handle = await sqlite.openHandle(location, name ?? void 0);
75975
+ const db = {
75976
+ query: async (sql, params) => handle.query(sql, params),
75977
+ get: async (sql, params) => handle.get(sql, params),
75978
+ exec: async (sql, params) => handle.exec(sql, params),
75979
+ run: async (sql) => handle.run(sql),
75980
+ transaction: async (fn) => {
75981
+ await db.exec("BEGIN");
75982
+ try {
75983
+ await fn();
75984
+ await db.exec("COMMIT");
75985
+ } catch (e) {
75986
+ await db.exec("ROLLBACK");
75987
+ throw e;
75988
+ }
75989
+ },
75990
+ close: async () => handle.close()
75991
+ };
75992
+ return db;
75993
+ }
75994
+ };
75995
+ }
75946
75996
  function setupCrunesTest({
75947
75997
  cwd = process.cwd(),
75948
75998
  projectRoot = cwd,
@@ -75975,6 +76025,7 @@ function setupCrunesTest({
75975
76025
  const merged = {
75976
76026
  ...utils,
75977
76027
  fs: createTestFs(utils.fs),
76028
+ sqlite: createTestSqlite(utils.sqlite),
75978
76029
  crypt: createTestCrypt(),
75979
76030
  codec: { ...codec_exports },
75980
76031
  time: { after: (ms) => new Promise((resolve6) => setTimeout(resolve6, ms)) },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@darkrymit/crunes-cli",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "description": "CLI tool for querying crunes enrichers",
5
5
  "type": "module",
6
6
  "bin": {