token-goat 2.9.9 → 2.9.10

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.
@@ -4,14 +4,14 @@ import {
4
4
  buildEvent,
5
5
  relay,
6
6
  relayInProcess
7
- } from "./token-goat-chunk-P5SQX2VK.mjs";
7
+ } from "./token-goat-chunk-ZQODJQTP.mjs";
8
8
  import {
9
9
  MAX_STDIN_BYTES,
10
10
  readStdinJson
11
- } from "./token-goat-chunk-QCHD2ENV.mjs";
12
- import "./token-goat-chunk-BYDDWQ2T.mjs";
13
- import "./token-goat-chunk-OBDTBOQA.mjs";
14
- import "./token-goat-chunk-KIEOFWLL.mjs";
11
+ } from "./token-goat-chunk-SLGOIXKF.mjs";
12
+ import "./token-goat-chunk-PA5UXNOT.mjs";
13
+ import "./token-goat-chunk-ATVQ6IIT.mjs";
14
+ import "./token-goat-chunk-VCEK77ED.mjs";
15
15
  import "./token-goat-chunk-EEIDFMEM.mjs";
16
16
  import "./token-goat-chunk-A37V4PBF.mjs";
17
17
  export {
@@ -86,7 +86,7 @@ import {
86
86
  runZipRead,
87
87
  symbolNamesInFile,
88
88
  upsertNote
89
- } from "./token-goat-chunk-L6Q2XM5X.mjs";
89
+ } from "./token-goat-chunk-YFXFUG3L.mjs";
90
90
  import {
91
91
  DEFAULT_RECONCILE_BUDGET_MS,
92
92
  GEMINI_TOOL_NAME_MAP,
@@ -108,7 +108,7 @@ import {
108
108
  runReconcile,
109
109
  storeWebOutput,
110
110
  summarizeResidentContext
111
- } from "./token-goat-chunk-QCHD2ENV.mjs";
111
+ } from "./token-goat-chunk-SLGOIXKF.mjs";
112
112
  import {
113
113
  AGENT_SALT_MARKER,
114
114
  BASH_OUTPUT_SUBDIR,
@@ -238,7 +238,7 @@ import {
238
238
  visionTokensSavedByText,
239
239
  walkProject,
240
240
  writeCompact
241
- } from "./token-goat-chunk-BYDDWQ2T.mjs";
241
+ } from "./token-goat-chunk-PA5UXNOT.mjs";
242
242
  import {
243
243
  C,
244
244
  CONFIG_KEY_ENV_OVERRIDES,
@@ -372,7 +372,7 @@ import {
372
372
  withFileLock,
373
373
  withRetryOnLock,
374
374
  writeJsonSettings
375
- } from "./token-goat-chunk-KIEOFWLL.mjs";
375
+ } from "./token-goat-chunk-VCEK77ED.mjs";
376
376
  import {
377
377
  __export,
378
378
  init_define_import_meta_env
@@ -15761,7 +15761,7 @@ async function cmdMcpServe() {
15761
15761
  let StdioServerTransport;
15762
15762
  try {
15763
15763
  ;
15764
- ({ createMcpServer } = await import("./token-goat-chunk-LQ3SGWIW.mjs"));
15764
+ ({ createMcpServer } = await import("./token-goat-chunk-DCYHAUW3.mjs"));
15765
15765
  ({ StdioServerTransport } = await import("./token-goat-chunk-EVC4TOLE.mjs"));
15766
15766
  } catch (err2) {
15767
15767
  process.stderr.write(
@@ -15786,7 +15786,7 @@ async function cmdHook(event, opts) {
15786
15786
  if (typeof opts.harness === "string" && opts.harness.length > 0) {
15787
15787
  process.env[ENV_KEYS.HARNESS_OVERRIDE] = opts.harness;
15788
15788
  }
15789
- const { relay } = await import("./token-goat-chunk-K5GKX6ND.mjs");
15789
+ const { relay } = await import("./token-goat-chunk-2TJBY5RD.mjs");
15790
15790
  await relay(event);
15791
15791
  }
15792
15792
  async function cmdInstall(opts) {
@@ -16719,7 +16719,7 @@ function emitExtraFileArgsNote(command, first, extras, opts = {}) {
16719
16719
  }
16720
16720
  async function cmdCompress(opts) {
16721
16721
  try {
16722
- const bashRunner = await import("./token-goat-chunk-WBPVYAEO.mjs");
16722
+ const bashRunner = await import("./token-goat-chunk-JS44SRAX.mjs");
16723
16723
  if (opts.compress === false) {
16724
16724
  process.exitCode = bashRunner.runRaw(opts.cmd, parseTimeout(opts.timeout, bashRunner.DEFAULT_TIMEOUT_SECONDS));
16725
16725
  return;
@@ -2,7 +2,7 @@ import { createRequire as __cjsRequire } from 'node:module';
2
2
  const require = __cjsRequire(import.meta.url);
3
3
  import {
4
4
  detectHarness
5
- } from "./token-goat-chunk-KIEOFWLL.mjs";
5
+ } from "./token-goat-chunk-VCEK77ED.mjs";
6
6
  import {
7
7
  init_define_import_meta_env
8
8
  } from "./token-goat-chunk-A37V4PBF.mjs";
@@ -25,7 +25,7 @@ import {
25
25
  runSkeleton,
26
26
  runSymbol,
27
27
  withPinnedReads
28
- } from "./token-goat-chunk-L6Q2XM5X.mjs";
28
+ } from "./token-goat-chunk-YFXFUG3L.mjs";
29
29
  import {
30
30
  buildProjectMap,
31
31
  embeddingsDepsAvailable,
@@ -34,7 +34,7 @@ import {
34
34
  getProjectIndexCounts,
35
35
  isWorkerRunning,
36
36
  mapLookupBytesSaved
37
- } from "./token-goat-chunk-BYDDWQ2T.mjs";
37
+ } from "./token-goat-chunk-PA5UXNOT.mjs";
38
38
  import {
39
39
  ENV_KEYS,
40
40
  VERSION,
@@ -48,7 +48,7 @@ import {
48
48
  recordStat,
49
49
  resolveProjectRoot,
50
50
  savedTokensFromBytes
51
- } from "./token-goat-chunk-KIEOFWLL.mjs";
51
+ } from "./token-goat-chunk-VCEK77ED.mjs";
52
52
  import "./token-goat-chunk-EEIDFMEM.mjs";
53
53
  import {
54
54
  init_define_import_meta_env
@@ -7,11 +7,11 @@ import {
7
7
  expandGlobs,
8
8
  leftoverIntegrations,
9
9
  run
10
- } from "./token-goat-chunk-PNMGVJ4C.mjs";
11
- import "./token-goat-chunk-L6Q2XM5X.mjs";
12
- import "./token-goat-chunk-QCHD2ENV.mjs";
13
- import "./token-goat-chunk-BYDDWQ2T.mjs";
14
- import "./token-goat-chunk-KIEOFWLL.mjs";
10
+ } from "./token-goat-chunk-7ALFFPJW.mjs";
11
+ import "./token-goat-chunk-YFXFUG3L.mjs";
12
+ import "./token-goat-chunk-SLGOIXKF.mjs";
13
+ import "./token-goat-chunk-PA5UXNOT.mjs";
14
+ import "./token-goat-chunk-VCEK77ED.mjs";
15
15
  import "./token-goat-chunk-EEIDFMEM.mjs";
16
16
  import "./token-goat-chunk-A37V4PBF.mjs";
17
17
  export {
@@ -3,7 +3,7 @@ const require = __cjsRequire(import.meta.url);
3
3
  import {
4
4
  deliveredOutputBytes,
5
5
  wrappedShell
6
- } from "./token-goat-chunk-OBDTBOQA.mjs";
6
+ } from "./token-goat-chunk-ATVQ6IIT.mjs";
7
7
  import {
8
8
  ToolFilter,
9
9
  capTokens,
@@ -15,7 +15,7 @@ import {
15
15
  recordStat,
16
16
  selectFilter,
17
17
  shlexSplit
18
- } from "./token-goat-chunk-KIEOFWLL.mjs";
18
+ } from "./token-goat-chunk-VCEK77ED.mjs";
19
19
  import "./token-goat-chunk-EEIDFMEM.mjs";
20
20
  import {
21
21
  init_define_import_meta_env
@@ -101,7 +101,7 @@ import {
101
101
  toDisplayPath,
102
102
  toKB,
103
103
  withFileLock
104
- } from "./token-goat-chunk-KIEOFWLL.mjs";
104
+ } from "./token-goat-chunk-VCEK77ED.mjs";
105
105
  import {
106
106
  registerReset
107
107
  } from "./token-goat-chunk-EEIDFMEM.mjs";
@@ -10277,7 +10277,8 @@ async function copyFromSharedCache(shared, file, target) {
10277
10277
  const source = path7.join(shared, file.name);
10278
10278
  const temp = `${target}.${process.pid}.shared`;
10279
10279
  try {
10280
- if (!fs11.existsSync(source)) return false;
10280
+ const info = fs11.lstatSync(source, { throwIfNoEntry: false });
10281
+ if (!info?.isFile() || info.size !== file.bytes) return false;
10281
10282
  fs11.copyFileSync(source, temp);
10282
10283
  if (await sha256Of(temp) !== file.sha256) {
10283
10284
  fs11.rmSync(temp, { force: true, maxRetries: 20, retryDelay: 25 });
@@ -10297,12 +10298,15 @@ async function copyFromSharedCache(shared, file, target) {
10297
10298
  function publishToSharedCache(shared, file, target) {
10298
10299
  const destination = path7.join(shared, file.name);
10299
10300
  const temp = `${destination}.${process.pid}.partial`;
10301
+ let created = false;
10300
10302
  try {
10301
10303
  if (fs11.existsSync(destination)) return;
10302
10304
  fs11.mkdirSync(path7.dirname(destination), { recursive: true });
10303
- fs11.copyFileSync(target, temp);
10305
+ fs11.copyFileSync(target, temp, fs11.constants.COPYFILE_EXCL);
10306
+ created = true;
10304
10307
  fs11.renameSync(temp, destination);
10305
10308
  } catch {
10309
+ if (!created) return;
10306
10310
  try {
10307
10311
  fs11.rmSync(temp, { force: true, maxRetries: 20, retryDelay: 25 });
10308
10312
  } catch {
@@ -9,7 +9,7 @@ import {
9
9
  isBlobStale,
10
10
  loadBlob,
11
11
  storeBlob
12
- } from "./token-goat-chunk-BYDDWQ2T.mjs";
12
+ } from "./token-goat-chunk-PA5UXNOT.mjs";
13
13
  import {
14
14
  SYMBOL_BODY_CHAR_CAP,
15
15
  copilotCliMcpToolsDir,
@@ -25,7 +25,7 @@ import {
25
25
  resolveIndexPath,
26
26
  shortFingerprint,
27
27
  toDisplayPath
28
- } from "./token-goat-chunk-KIEOFWLL.mjs";
28
+ } from "./token-goat-chunk-VCEK77ED.mjs";
29
29
  import {
30
30
  registerReset
31
31
  } from "./token-goat-chunk-EEIDFMEM.mjs";
@@ -12,7 +12,7 @@ init_define_import_meta_env();
12
12
  import { createRequire } from "node:module";
13
13
  function resolveVersion() {
14
14
  if (true) {
15
- return "2.9.9";
15
+ return "2.9.10";
16
16
  }
17
17
  const require2 = createRequire(import.meta.url);
18
18
  const pkg = require2("../package.json");
@@ -67,7 +67,7 @@ import {
67
67
  walkProject,
68
68
  yamlLineClosesQuote,
69
69
  yamlOpenQuoteAfter
70
- } from "./token-goat-chunk-BYDDWQ2T.mjs";
70
+ } from "./token-goat-chunk-PA5UXNOT.mjs";
71
71
  import {
72
72
  Database,
73
73
  PER_FILE_COUNTERFACTUAL_CEILING,
@@ -125,7 +125,7 @@ import {
125
125
  unsupportedLanguageName,
126
126
  windowsCmdQuoteArg,
127
127
  withExtension
128
- } from "./token-goat-chunk-KIEOFWLL.mjs";
128
+ } from "./token-goat-chunk-VCEK77ED.mjs";
129
129
  import {
130
130
  registerReset
131
131
  } from "./token-goat-chunk-EEIDFMEM.mjs";
@@ -18,7 +18,7 @@ import {
18
18
  storeWebOutput,
19
19
  summarizeResidentContext,
20
20
  taskListPruneHint
21
- } from "./token-goat-chunk-QCHD2ENV.mjs";
21
+ } from "./token-goat-chunk-SLGOIXKF.mjs";
22
22
  import {
23
23
  BASH_OUTPUT_SUBDIR,
24
24
  GENERIC_SERVED_OUTPUT_KEY,
@@ -125,12 +125,12 @@ import {
125
125
  wasCliReadThisSession,
126
126
  wasFileReadThisSession,
127
127
  wasHintShown
128
- } from "./token-goat-chunk-BYDDWQ2T.mjs";
128
+ } from "./token-goat-chunk-PA5UXNOT.mjs";
129
129
  import {
130
130
  bashOutputCapBytes,
131
131
  canRunWrappedShell,
132
132
  deliveredOutputBytes
133
- } from "./token-goat-chunk-OBDTBOQA.mjs";
133
+ } from "./token-goat-chunk-ATVQ6IIT.mjs";
134
134
  import {
135
135
  BODY_FIRST_TOOL_RESPONSE_KEYS,
136
136
  ENV_KEYS,
@@ -194,7 +194,7 @@ import {
194
194
  stripAnsiEscapes,
195
195
  toDisplayPath,
196
196
  toKB
197
- } from "./token-goat-chunk-KIEOFWLL.mjs";
197
+ } from "./token-goat-chunk-VCEK77ED.mjs";
198
198
  import {
199
199
  init_define_import_meta_env
200
200
  } from "./token-goat-chunk-A37V4PBF.mjs";
@@ -798,7 +798,7 @@ init_define_import_meta_env();
798
798
  var TRACKED_SKILL = "token-goat";
799
799
  var MAX_COMMANDS_SHOWN = 8;
800
800
  async function currentCommandNames() {
801
- const { buildProgram } = await import("./token-goat-chunk-DRH4CVGF.mjs");
801
+ const { buildProgram } = await import("./token-goat-chunk-DSHYDU53.mjs");
802
802
  return flattenCommandNames(buildCommandManifest(buildProgram()));
803
803
  }
804
804
  async function recordSkillVersionSnapshot(sessionId, skillName) {
@@ -2,11 +2,11 @@ import { createRequire as __cjsRequire } from 'node:module';
2
2
  const require = __cjsRequire(import.meta.url);
3
3
  import {
4
4
  relayInProcess
5
- } from "./token-goat-chunk-P5SQX2VK.mjs";
6
- import "./token-goat-chunk-QCHD2ENV.mjs";
7
- import "./token-goat-chunk-BYDDWQ2T.mjs";
8
- import "./token-goat-chunk-OBDTBOQA.mjs";
9
- import "./token-goat-chunk-KIEOFWLL.mjs";
5
+ } from "./token-goat-chunk-ZQODJQTP.mjs";
6
+ import "./token-goat-chunk-SLGOIXKF.mjs";
7
+ import "./token-goat-chunk-PA5UXNOT.mjs";
8
+ import "./token-goat-chunk-ATVQ6IIT.mjs";
9
+ import "./token-goat-chunk-VCEK77ED.mjs";
10
10
  import "./token-goat-chunk-EEIDFMEM.mjs";
11
11
  import {
12
12
  init_define_import_meta_env
@@ -2,13 +2,13 @@ import { createRequire as __cjsRequire } from 'node:module';
2
2
  const require = __cjsRequire(import.meta.url);
3
3
  import {
4
4
  run
5
- } from "./token-goat-chunk-PNMGVJ4C.mjs";
6
- import "./token-goat-chunk-L6Q2XM5X.mjs";
7
- import "./token-goat-chunk-QCHD2ENV.mjs";
8
- import "./token-goat-chunk-BYDDWQ2T.mjs";
5
+ } from "./token-goat-chunk-7ALFFPJW.mjs";
6
+ import "./token-goat-chunk-YFXFUG3L.mjs";
7
+ import "./token-goat-chunk-SLGOIXKF.mjs";
8
+ import "./token-goat-chunk-PA5UXNOT.mjs";
9
9
  import {
10
10
  installEpipeGuard
11
- } from "./token-goat-chunk-KIEOFWLL.mjs";
11
+ } from "./token-goat-chunk-VCEK77ED.mjs";
12
12
  import "./token-goat-chunk-EEIDFMEM.mjs";
13
13
  import {
14
14
  init_define_import_meta_env
package/docs/security.md CHANGED
@@ -15,7 +15,7 @@ Outbound network is reserved to these explicit cases:
15
15
  - Google Drive API calls, only if you already authorized Drive in Claude Code. Token-goat never prompts for its own auth.
16
16
  - Image fetches from URLs: either explicit via `token-goat fetch-image <url>`, or when the AI agent issues a WebFetch call that returns image content — the hook intercepts and shrinks the image. The URL always originates from the agent's work, not from token-goat itself.
17
17
  - `token-goat screenshot <url>` navigates a headless browser to the URL you give it, subject to the target restrictions described below.
18
- - The first `token-goat semantic` run on a machine downloads the embedding model from `huggingface.co`, pinned to an immutable commit rather than a mutable branch and checked against a recorded SHA-256 and byte length before it is used, and only once `onnxruntime-node` has been installed (see below — it is not part of a default install). Subsequent runs use the local cache, re-verify it, and make no network call. Setting `TOKEN_GOAT_MODEL_CACHE_DIR` adds one more place to look before the network: a directory you name that outlives any single data root, which is how a continuous-integration job stops refetching the weights once per worker. A file taken from there is checked against the same recorded digest as a downloaded one and dropped from the shared directory if it fails, so a tampered copy costs a download and cannot substitute different weights. It is an environment variable only, so no project config file can point it anywhere. Skip the download entirely by setting `indexing.embeddings_enabled = false` (it is on by default), in which case `semantic` falls back to full-text search.
18
+ - The first `token-goat semantic` run on a machine downloads the embedding model from `huggingface.co`, pinned to an immutable commit rather than a mutable branch and checked against a recorded SHA-256 and byte length before it is used, and only once `onnxruntime-node` has been installed (see below — it is not part of a default install). Subsequent runs use the local cache, re-verify it, and make no network call. Setting `TOKEN_GOAT_MODEL_CACHE_DIR` adds one more place to look before the network: a directory you name that outlives any single data root, which is how a continuous-integration job stops refetching the weights once per worker. A file taken from there is checked against the same recorded digest as a downloaded one and dropped from the shared directory if it fails, and an entry that is not a plain file of the expected size is passed over without being read at all, so a tampered copy costs a download and cannot substitute different weights, stall the read, or fill the disk. Token-goat also writes there, and treats the directory as somebody else's: it creates its temporary file exclusively rather than through whatever is already sitting at that name, and removes only what it created. Point it at a directory you control all the same, since nothing token-goat does can stop another writer filling it with entries that will simply be rejected. It is an environment variable only, so no project config file can point it anywhere. Skip the download entirely by setting `indexing.embeddings_enabled = false` (it is on by default), in which case `semantic` falls back to full-text search.
19
19
  - The first optical-character read of an image downloads the English language data (about 4 MB) from `cdn.jsdelivr.net`, at a fixed version path. Subsequent reads use the local cache. This happens for an explicit `token-goat image-text`, and also for the automatic text extraction the image-shrink hook performs when the agent reads a screenshot; turn the automatic one off with `image_shrink.ocr_enabled = false`.
20
20
 
21
21
  **One switch for all of it.** Set `network.offline = true` (env `TOKEN_GOAT_OFFLINE`) and every one of the paths above refuses instead of connecting, saying so rather than failing quietly. Anything already cached keeps working: a machine that has the embedding model still runs `semantic`, and one that has the language data still reads text out of images. This is one of the settings a per-project config file may not touch, so cloning a repository cannot switch it back off.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "token-goat",
3
- "version": "2.9.9",
3
+ "version": "2.9.10",
4
4
  "description": "Surgical token-reduction companion for Claude Code and other AI coding agents",
5
5
  "type": "module",
6
6
  "main": "./dist/token-goat.mjs",