token-goat 2.6.31 → 2.6.33

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 (36) hide show
  1. package/README.md +21 -2
  2. package/SECURITY.md +67 -3
  3. package/dist/{token-goat-chunk-QL2743EW.mjs → token-goat-chunk-72R7M5H7.mjs} +6 -9
  4. package/dist/{token-goat-chunk-56C3XUQY.mjs → token-goat-chunk-77CX3MCN.mjs} +4 -7
  5. package/dist/token-goat-chunk-AEX54RUZ.mjs +11 -0
  6. package/dist/{token-goat-chunk-VYC34TBW.mjs → token-goat-chunk-AO2QD2AG.mjs} +0 -4
  7. package/dist/{token-goat-hook-chunk-FKZ5RBT4.mjs → token-goat-chunk-DG53MVNJ.mjs} +9 -105
  8. package/dist/{token-goat-chunk-P7I6LS5H.mjs → token-goat-chunk-FN6WLFIX.mjs} +49 -50
  9. package/dist/{token-goat-chunk-DCGBS2YZ.mjs → token-goat-chunk-G6XLWJWI.mjs} +4 -7
  10. package/dist/{token-goat-chunk-J6JTYE2B.mjs → token-goat-chunk-HPWPUBAK.mjs} +7 -7
  11. package/dist/{token-goat-chunk-PWD5XZ6C.mjs → token-goat-chunk-L6FVTDPD.mjs} +278 -204
  12. package/dist/{token-goat-chunk-OIBTYBVR.mjs → token-goat-chunk-OHQ7RBLL.mjs} +23 -24
  13. package/dist/{token-goat-chunk-XEJBPPD7.mjs → token-goat-chunk-RPOXYJWK.mjs} +3781 -3407
  14. package/dist/{token-goat-chunk-N2S7UAVU.mjs → token-goat-chunk-RQQ4SY2P.mjs} +11 -31
  15. package/dist/{token-goat-chunk-HPY7XE77.mjs → token-goat-chunk-TDYTBCT4.mjs} +1052 -1785
  16. package/dist/{token-goat-chunk-X7PIWZMB.mjs → token-goat-chunk-WFRR2DBG.mjs} +1131 -275
  17. package/dist/{token-goat-hook-chunk-3OJELLK5.mjs → token-goat-hook-chunk-26DLRODR.mjs} +4 -7
  18. package/dist/{token-goat-chunk-Q4N6SQWR.mjs → token-goat-hook-chunk-3QYSN4QV.mjs} +9 -105
  19. package/dist/{token-goat-hook-chunk-KNVHTGEX.mjs → token-goat-hook-chunk-BUOCULAM.mjs} +0 -4
  20. package/dist/{token-goat-hook-chunk-NIVRFAJ4.mjs → token-goat-hook-chunk-E6AIPKNF.mjs} +1131 -275
  21. package/dist/{token-goat-hook-chunk-K6HLYRRI.mjs → token-goat-hook-chunk-EKGDLI4D.mjs} +6 -9
  22. package/dist/{token-goat-hook-chunk-JVJUBWKT.mjs → token-goat-hook-chunk-HXHFLKEL.mjs} +11 -31
  23. package/dist/{token-goat-hook-chunk-2K7FV2ME.mjs → token-goat-hook-chunk-QD2DX2U7.mjs} +276 -203
  24. package/dist/token-goat-hook-chunk-RFRLWOQH.mjs +11 -0
  25. package/dist/{token-goat-hook-chunk-SJM4BUZQ.mjs → token-goat-hook-chunk-UWV4MTYI.mjs} +1064 -1795
  26. package/dist/{token-goat-hook-chunk-66W63A4Y.mjs → token-goat-hook-chunk-VDXQXYJK.mjs} +49 -50
  27. package/dist/{token-goat-hook-chunk-YHRJMMEF.mjs → token-goat-hook-chunk-WBBHV6TZ.mjs} +3782 -3408
  28. package/dist/token-goat-hook-chunk-XBOWDNJB.mjs +23 -0
  29. package/dist/{token-goat-hook-chunk-5AQYD2SZ.mjs → token-goat-hook-chunk-XUMIVYEN.mjs} +4 -7
  30. package/dist/{token-goat-hook-chunk-JT5RMRIY.mjs → token-goat-hook-chunk-ZT47M3IA.mjs} +23 -24
  31. package/dist/token-goat-hook.mjs +7 -12
  32. package/dist/token-goat.core.mjs +7 -10
  33. package/package.json +23 -35
  34. package/dist/token-goat-chunk-4WGVGN6W.mjs +0 -54
  35. package/dist/token-goat-hook-chunk-7WC2H3EW.mjs +0 -54
  36. package/dist/token-goat-hook-chunk-ULGSXGZK.mjs +0 -23
@@ -5,14 +5,10 @@ import {
5
5
  MAX_OVER_FETCH,
6
6
  OVER_FETCH_FACTOR,
7
7
  SKIP_DIRS,
8
- _detectOpenQuote,
9
- _lineClosesQuote,
10
- buildLineIndex,
11
8
  capJsonRows,
12
9
  countRefs,
13
10
  countSymbols,
14
11
  createLazyModuleLoader,
15
- detectLanguage,
16
12
  distinctSymbolKinds,
17
13
  eachUnfencedLine,
18
14
  emptyIndexMessage,
@@ -21,7 +17,6 @@ import {
21
17
  extractPdfMeta,
22
18
  extractPdfOutline,
23
19
  extractPdfText,
24
- findHtmlHeadingMatches,
25
20
  formatCsvProfile,
26
21
  formatCsvTable,
27
22
  getFileEntry,
@@ -34,7 +29,6 @@ import {
34
29
  loadBlob,
35
30
  mergeNearbyHits,
36
31
  ocrImage,
37
- offsetToLine,
38
32
  parseWhereSpecs,
39
33
  pathEqClause,
40
34
  probeImageMeta,
@@ -52,23 +46,27 @@ import {
52
46
  stripLeadingAttributes,
53
47
  tomlBracketDelta,
54
48
  trimToBudget,
55
- unsupportedLanguageName,
56
49
  urlPolicyDenialReason,
57
50
  walkProject,
58
51
  yamlLineClosesQuote,
59
52
  yamlOpenQuoteAfter
60
- } from "./token-goat-chunk-HPY7XE77.mjs";
53
+ } from "./token-goat-chunk-TDYTBCT4.mjs";
61
54
  import {
62
55
  PER_FILE_COUNTERFACTUAL_CEILING,
56
+ _detectOpenQuote,
57
+ _lineClosesQuote,
63
58
  atomicWriteBytes,
64
59
  buildContextWindow,
60
+ buildLineIndex,
65
61
  colorStdout,
66
62
  compileGrepMatcher,
67
63
  countNoun,
64
+ detectLanguage,
68
65
  ensureNewline,
69
66
  escapeRegExp,
70
67
  excludeTestsHiddenNote,
71
68
  extractErrorMessage,
69
+ findHtmlHeadingMatches,
72
70
  findProject,
73
71
  fingerprintContent,
74
72
  fingerprintFile,
@@ -81,7 +79,9 @@ import {
81
79
  isTestFile,
82
80
  loadConfig,
83
81
  normalizePath,
82
+ offsetToLine,
84
83
  recordStat,
84
+ redactIfDotenv,
85
85
  redactSecrets,
86
86
  redactUrlQuery,
87
87
  renderContextWindow,
@@ -94,18 +94,15 @@ import {
94
94
  stripAnsi,
95
95
  stripBom,
96
96
  toDisplayPath,
97
+ unsupportedLanguageName,
97
98
  windowsCmdQuoteArg,
98
99
  withExtension
99
- } from "./token-goat-chunk-X7PIWZMB.mjs";
100
+ } from "./token-goat-chunk-WFRR2DBG.mjs";
100
101
  import {
101
102
  registerReset
102
- } from "./token-goat-chunk-VYC34TBW.mjs";
103
- import {
104
- init_define_import_meta_env
105
- } from "./token-goat-chunk-4WGVGN6W.mjs";
103
+ } from "./token-goat-chunk-AO2QD2AG.mjs";
106
104
 
107
105
  // src/repomap.ts
108
- init_define_import_meta_env();
109
106
  import * as fs from "fs";
110
107
  import * as path from "path";
111
108
  function getTrackedFiles(cwd = process.cwd()) {
@@ -131,7 +128,6 @@ function getTrackedFiles(cwd = process.cwd()) {
131
128
  }
132
129
 
133
130
  // src/section_reader.ts
134
- init_define_import_meta_env();
135
131
  import { readFileSync } from "node:fs";
136
132
  function parseHeadingSpec(spec, headers) {
137
133
  const m = /^(.*?)#(\d+)$/.exec(spec);
@@ -399,7 +395,7 @@ function readTextForSections(filePath, readFn) {
399
395
  if (text.charCodeAt(0) === 65279) {
400
396
  text = text.slice(1);
401
397
  }
402
- return text;
398
+ return redactIfDotenv(filePath, text);
403
399
  }
404
400
  function readSection(filePath, headingSpec, readFn) {
405
401
  const text = readTextForSections(filePath, readFn);
@@ -439,7 +435,6 @@ function listSections(filePath, readFn) {
439
435
  }
440
436
 
441
437
  // src/graph_commands.ts
442
- init_define_import_meta_env();
443
438
  import * as fs6 from "node:fs";
444
439
  import * as os from "node:os";
445
440
  import * as path6 from "node:path";
@@ -447,12 +442,10 @@ import { execFileSync, spawnSync as spawnSync2 } from "node:child_process";
447
442
  import { randomUUID } from "node:crypto";
448
443
 
449
444
  // src/read_commands.ts
450
- init_define_import_meta_env();
451
445
  import * as fs5 from "node:fs";
452
446
  import * as path5 from "node:path";
453
447
 
454
448
  // src/json_query.ts
455
- init_define_import_meta_env();
456
449
  function jsonType(value) {
457
450
  if (value === null) return "null";
458
451
  if (Array.isArray(value)) return "array";
@@ -591,8 +584,7 @@ function queryJson(data, spec) {
591
584
  }
592
585
 
593
586
  // node_modules/js-yaml/dist/js-yaml.mjs
594
- init_define_import_meta_env();
595
- var NOT_RESOLVED = Symbol("NOT_RESOLVED");
587
+ var NOT_RESOLVED = /* @__PURE__ */ Symbol("NOT_RESOLVED");
596
588
  function defineScalarTag(tagName, options) {
597
589
  return {
598
590
  tagName,
@@ -2892,9 +2884,6 @@ function load(input, options) {
2892
2884
  if (documents.length === 1) return documents[0];
2893
2885
  throw new YAMLException("expected a single document in the stream, but found more");
2894
2886
  }
2895
- var INVALID = Symbol("INVALID");
2896
- var VISIT_BREAK = Symbol("visit:break");
2897
- var VISIT_SKIP = Symbol("visit:skip");
2898
2887
  var ESCAPE_SEQUENCES = {};
2899
2888
  ESCAPE_SEQUENCES[0] = "\\0";
2900
2889
  ESCAPE_SEQUENCES[7] = "\\a";
@@ -2952,7 +2941,6 @@ var CHOMPING_STRIP = CHOMPING_MODE.STRIP;
2952
2941
  var CHOMPING_KEEP = CHOMPING_MODE.KEEP;
2953
2942
 
2954
2943
  // src/openapi_query.ts
2955
- init_define_import_meta_env();
2956
2944
  import * as path2 from "node:path";
2957
2945
  var HTTP_METHODS = ["get", "put", "post", "delete", "options", "head", "patch", "trace"];
2958
2946
  function parseOpenApiSpec(text, filePath) {
@@ -3072,11 +3060,25 @@ function formatOperationDetail(op) {
3072
3060
  }
3073
3061
 
3074
3062
  // src/archive_query.ts
3075
- init_define_import_meta_env();
3076
- import { unzipSync } from "fflate";
3077
- function listZipEntries(data) {
3063
+ var loadFflate = createLazyModuleLoader(
3064
+ async () => await import("fflate"),
3065
+ "archive reading disabled (fflate unavailable)"
3066
+ );
3067
+ var ArchiveDependencyMissingError = class extends Error {
3068
+ constructor() {
3069
+ super("fflate is not installed; run `npm install fflate` to enable zip-list/zip-read");
3070
+ this.name = "ArchiveDependencyMissingError";
3071
+ }
3072
+ };
3073
+ async function requireFflate() {
3074
+ const fflate = await loadFflate();
3075
+ if (!fflate) throw new ArchiveDependencyMissingError();
3076
+ return fflate;
3077
+ }
3078
+ async function listZipEntries(data) {
3079
+ const fflate = await requireFflate();
3078
3080
  const entries = [];
3079
- unzipSync(data, {
3081
+ fflate.unzipSync(data, {
3080
3082
  filter: (file) => {
3081
3083
  entries.push({
3082
3084
  path: file.name,
@@ -3094,13 +3096,13 @@ function formatZipList(entries) {
3094
3096
  if (entries.length === 0) return "(no entries found)";
3095
3097
  return entries.map((e) => `${String(e.size).padStart(10)} ${e.path}`).join("\n");
3096
3098
  }
3097
- function extractZipEntry(data, entryPath) {
3098
- const result = unzipSync(data, { filter: (file) => file.name === entryPath });
3099
+ async function extractZipEntry(data, entryPath) {
3100
+ const fflate = await requireFflate();
3101
+ const result = fflate.unzipSync(data, { filter: (file) => file.name === entryPath });
3099
3102
  return result[entryPath];
3100
3103
  }
3101
3104
 
3102
3105
  // src/pr_slice.ts
3103
- init_define_import_meta_env();
3104
3106
  import { spawnSync } from "node:child_process";
3105
3107
  var _ghAvailable;
3106
3108
  function isGhAvailable() {
@@ -3270,7 +3272,6 @@ ${c.body}`).join("\n\n");
3270
3272
  }
3271
3273
 
3272
3274
  // src/sqlite_query.ts
3273
- init_define_import_meta_env();
3274
3275
  import * as fs2 from "node:fs";
3275
3276
  import Database from "better-sqlite3";
3276
3277
  var SQLITE_QUERY_ROW_CAP = 5e3;
@@ -3534,7 +3535,6 @@ function quoteCsvCellLocal(cell) {
3534
3535
  }
3535
3536
 
3536
3537
  // src/coverage_query.ts
3537
- init_define_import_meta_env();
3538
3538
  function num(v) {
3539
3539
  return typeof v === "number" && Number.isFinite(v) ? v : 0;
3540
3540
  }
@@ -3836,7 +3836,6 @@ function formatCoverageGaps(report) {
3836
3836
  }
3837
3837
 
3838
3838
  // src/conflict_query.ts
3839
- init_define_import_meta_env();
3840
3839
  var OURS_RE = /^<{7}(?:\s+(.*))?$/;
3841
3840
  var BASE_RE = /^\|{7}(?:\s+(.*))?$/;
3842
3841
  var SEP_RE = /^={7}\s*$/;
@@ -4001,7 +4000,6 @@ function formatConflictSummaries(summaries) {
4001
4000
  }
4002
4001
 
4003
4002
  // src/screenshot.ts
4004
- init_define_import_meta_env();
4005
4003
  import dns from "node:dns/promises";
4006
4004
  import fs3 from "node:fs";
4007
4005
  import path3 from "node:path";
@@ -4365,7 +4363,6 @@ async function takeScreenshot(url, destPath, opts) {
4365
4363
  }
4366
4364
 
4367
4365
  // src/notes.ts
4368
- init_define_import_meta_env();
4369
4366
  import * as fs4 from "node:fs";
4370
4367
  var WHOLE_FILE_NOTE_SYMBOL = "";
4371
4368
  function toNoteRow(row) {
@@ -4441,7 +4438,6 @@ function isNoteStale(note, dbPath = globalDbPath()) {
4441
4438
  }
4442
4439
 
4443
4440
  // src/ts_refs.ts
4444
- init_define_import_meta_env();
4445
4441
  import { createRequire } from "node:module";
4446
4442
  import * as path4 from "node:path";
4447
4443
  var _require = createRequire(import.meta.url);
@@ -4737,8 +4733,8 @@ function readFileText(p) {
4737
4733
  verifyStillAbsent(p);
4738
4734
  return null;
4739
4735
  }
4740
- if (pinned !== void 0) return readPinnedBytes(p, pinned).toString("utf-8");
4741
- return fs5.readFileSync(p, "utf-8");
4736
+ if (pinned !== void 0) return redactIfDotenv(p, readPinnedBytes(p, pinned).toString("utf-8"));
4737
+ return redactIfDotenv(p, fs5.readFileSync(p, "utf-8"));
4742
4738
  } catch (err) {
4743
4739
  if (err instanceof ConfinementIdentityError) throw err;
4744
4740
  return null;
@@ -6286,7 +6282,11 @@ function runOpenApiOp(opts) {
6286
6282
  }
6287
6283
  return 0;
6288
6284
  }
6289
- function runZipList(opts) {
6285
+ function archiveReadFailure(err, file) {
6286
+ if (err instanceof ArchiveDependencyMissingError) return err.message;
6287
+ return `Failed to read archive (not a valid zip-format file): ${file}`;
6288
+ }
6289
+ async function runZipList(opts) {
6290
6290
  const data = readFileBytes(opts.file);
6291
6291
  if (data === null) {
6292
6292
  emitErr(`Could not read: ${opts.file}`);
@@ -6294,9 +6294,9 @@ function runZipList(opts) {
6294
6294
  }
6295
6295
  let entries;
6296
6296
  try {
6297
- entries = listZipEntries(data);
6298
- } catch {
6299
- emitErr(`Failed to read archive (not a valid zip-format file): ${opts.file}`);
6297
+ entries = await listZipEntries(data);
6298
+ } catch (err) {
6299
+ emitErr(archiveReadFailure(err, opts.file));
6300
6300
  return 1;
6301
6301
  }
6302
6302
  const fullSourceBytes = sumFileSizes([opts.file]);
@@ -6311,7 +6311,7 @@ function runZipList(opts) {
6311
6311
  }
6312
6312
  return 0;
6313
6313
  }
6314
- function runZipRead(opts) {
6314
+ async function runZipRead(opts) {
6315
6315
  const data = readFileBytes(opts.file);
6316
6316
  if (data === null) {
6317
6317
  emitErr(`Could not read: ${opts.file}`);
@@ -6320,10 +6320,10 @@ function runZipRead(opts) {
6320
6320
  let entries;
6321
6321
  let content;
6322
6322
  try {
6323
- entries = listZipEntries(data);
6324
- content = extractZipEntry(data, opts.entry);
6325
- } catch {
6326
- emitErr(`Failed to read archive (not a valid zip-format file): ${opts.file}`);
6323
+ entries = await listZipEntries(data);
6324
+ content = await extractZipEntry(data, opts.entry);
6325
+ } catch (err) {
6326
+ emitErr(archiveReadFailure(err, opts.file));
6327
6327
  return 1;
6328
6328
  }
6329
6329
  const matchedEntry = entries.find((e) => e.path === opts.entry);
@@ -9425,7 +9425,6 @@ ANSWER:`;
9425
9425
  }
9426
9426
 
9427
9427
  // src/content_store.ts
9428
- init_define_import_meta_env();
9429
9428
  import { deflateRawSync } from "node:zlib";
9430
9429
  import * as path7 from "node:path";
9431
9430
  var CONTENT_MAX_INPUT_CHARS = 512 * 1024;
@@ -2,13 +2,10 @@ import { createRequire as __cjsRequire } from 'node:module';
2
2
  const require = __cjsRequire(import.meta.url);
3
3
  import {
4
4
  clearModuleCaches
5
- } from "./token-goat-chunk-VYC34TBW.mjs";
6
- import {
7
- init_define_import_meta_env
8
- } from "./token-goat-chunk-4WGVGN6W.mjs";
5
+ } from "./token-goat-chunk-AO2QD2AG.mjs";
6
+ import "./token-goat-chunk-AEX54RUZ.mjs";
9
7
 
10
8
  // src/batch_serve.ts
11
- init_define_import_meta_env();
12
9
  function swapEnv(next) {
13
10
  const before = { ...process.env };
14
11
  for (const key of Object.keys(process.env)) if (!(key in next)) delete process.env[key];
@@ -23,12 +20,12 @@ function captureOutput() {
23
20
  let errText = "";
24
21
  const realOut = process.stdout.write.bind(process.stdout);
25
22
  const realErr = process.stderr.write.bind(process.stderr);
26
- const sink = (append) => (chunk, enc, cb) => {
23
+ const sink = (append) => ((chunk, enc, cb) => {
27
24
  append(typeof chunk === "string" ? chunk : String(chunk));
28
25
  const done = typeof enc === "function" ? enc : cb;
29
26
  if (typeof done === "function") done();
30
27
  return true;
31
- };
28
+ });
32
29
  process.stdout.write = sink((s) => {
33
30
  out += s;
34
31
  });
@@ -7,13 +7,13 @@ import {
7
7
  expandGlobs,
8
8
  leftoverIntegrations,
9
9
  run
10
- } from "./token-goat-chunk-XEJBPPD7.mjs";
11
- import "./token-goat-chunk-P7I6LS5H.mjs";
12
- import "./token-goat-chunk-OIBTYBVR.mjs";
13
- import "./token-goat-chunk-HPY7XE77.mjs";
14
- import "./token-goat-chunk-X7PIWZMB.mjs";
15
- import "./token-goat-chunk-VYC34TBW.mjs";
16
- import "./token-goat-chunk-4WGVGN6W.mjs";
10
+ } from "./token-goat-chunk-RPOXYJWK.mjs";
11
+ import "./token-goat-chunk-FN6WLFIX.mjs";
12
+ import "./token-goat-chunk-OHQ7RBLL.mjs";
13
+ import "./token-goat-chunk-TDYTBCT4.mjs";
14
+ import "./token-goat-chunk-WFRR2DBG.mjs";
15
+ import "./token-goat-chunk-AO2QD2AG.mjs";
16
+ import "./token-goat-chunk-AEX54RUZ.mjs";
17
17
  export {
18
18
  applyExitOverride,
19
19
  buildProgram,