@primitive.ai/prim 0.1.0-alpha.97 → 0.1.0-alpha.99

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 (41) hide show
  1. package/README.md +20 -0
  2. package/dist/{chunk-ZYK3TBEW.js → chunk-25DDRMWS.js} +4 -6
  3. package/dist/{chunk-LY6NJ7KL.js → chunk-2IRLFOEL.js} +123 -19
  4. package/dist/{chunk-27ADT6FQ.js → chunk-2Q3OGSTV.js} +44 -6
  5. package/dist/{chunk-35FMRWJH.js → chunk-5LRKJTLA.js} +1 -1
  6. package/dist/{chunk-RK4ZS3HG.js → chunk-6C3CCVDI.js} +2 -2
  7. package/dist/{chunk-UO2U6IKF.js → chunk-7VIMU2HR.js} +1 -1
  8. package/dist/{chunk-OW4GJBLW.js → chunk-EJPKZT5M.js} +2 -2
  9. package/dist/{chunk-2MBV7ZMV.js → chunk-FK7FJPWS.js} +1 -1
  10. package/dist/{chunk-4GHANPWQ.js → chunk-JJI7FU24.js} +2 -2
  11. package/dist/{chunk-AJYZB5PF.js → chunk-JJYS7IPD.js} +3 -3
  12. package/dist/{chunk-Y5W4TZM7.js → chunk-K4JWJ6OM.js} +80 -269
  13. package/dist/{chunk-XEDJ5N3M.js → chunk-KGBMU76T.js} +2 -4
  14. package/dist/{chunk-7KABYYWG.js → chunk-O2WV5SQZ.js} +11 -13
  15. package/dist/{chunk-FBPZ4YUD.js → chunk-X5BN67D2.js} +2 -2
  16. package/dist/{chunk-DWRSEC34.js → chunk-XG7S3LIL.js} +596 -16
  17. package/dist/{chunk-3I4GEWXQ.js → chunk-XPS6LG6I.js} +8 -12
  18. package/dist/{chunk-QNPTWTBG.js → chunk-ZNLIGT3J.js} +2 -2
  19. package/dist/daemon/server.js +247 -180
  20. package/dist/hook-runtime/daemon/server.js +247 -180
  21. package/dist/hook-runtime/hooks/post-commit.js +114 -59
  22. package/dist/hook-runtime/hooks/post-rewrite.js +109 -54
  23. package/dist/hook-runtime/hooks/post-tool-use.js +256 -156
  24. package/dist/hook-runtime/hooks/pre-commit.js +374 -31
  25. package/dist/hook-runtime/hooks/pre-tool-use.js +237 -137
  26. package/dist/hook-runtime/hooks/prim-hook.js +281 -181
  27. package/dist/hook-runtime/hooks/session-start.js +209 -109
  28. package/dist/hook-runtime/index.js +656 -521
  29. package/dist/hook-runtime/statusline-main.js +71 -16
  30. package/dist/hooks/post-commit.js +7 -8
  31. package/dist/hooks/post-rewrite.js +6 -7
  32. package/dist/hooks/post-tool-use.js +13 -14
  33. package/dist/hooks/pre-commit.js +4 -4
  34. package/dist/hooks/pre-tool-use.js +11 -14
  35. package/dist/hooks/prim-hook.js +14 -15
  36. package/dist/hooks/session-end.js +6 -7
  37. package/dist/hooks/session-start.js +13 -14
  38. package/dist/index.js +33 -35
  39. package/dist/statusline-main.js +71 -16
  40. package/package.json +1 -1
  41. package/dist/chunk-DHOQGHKQ.js +0 -379
@@ -57,13 +57,13 @@ import {
57
57
  constants as constants3,
58
58
  closeSync as closeSync4,
59
59
  fstatSync as fstatSync2,
60
- lstatSync as lstatSync3,
60
+ lstatSync as lstatSync4,
61
61
  openSync as openSync4,
62
- readFileSync as readFileSync10,
62
+ readFileSync as readFileSync12,
63
63
  unlinkSync as unlinkSync2
64
64
  } from "fs";
65
- import { basename as basename3, dirname as dirname9, isAbsolute as isAbsolute4, join as join11 } from "path";
66
- import { fileURLToPath } from "url";
65
+ import { basename as basename3, dirname as dirname10, isAbsolute as isAbsolute5, join as join13 } from "path";
66
+ import { fileURLToPath as fileURLToPath2 } from "url";
67
67
 
68
68
  // src/binding.ts
69
69
  import { existsSync, readFileSync as readFileSync2 } from "fs";
@@ -379,21 +379,21 @@ function resolveOrg(args) {
379
379
  import {
380
380
  appendFileSync,
381
381
  closeSync as closeSync2,
382
- existsSync as existsSync5,
382
+ existsSync as existsSync6,
383
383
  fstatSync,
384
384
  mkdirSync as mkdirSync4,
385
385
  openSync as openSync2,
386
386
  opendirSync,
387
- readFileSync as readFileSync6,
387
+ readFileSync as readFileSync8,
388
388
  readSync,
389
389
  readdirSync as readdirSync2
390
390
  } from "fs";
391
- import { dirname as dirname6, join as join7 } from "path";
391
+ import { dirname as dirname7, join as join9 } from "path";
392
392
 
393
393
  // src/client.ts
394
394
  import { createHash as createHash2 } from "crypto";
395
- import { chmodSync, existsSync as existsSync3, mkdirSync as mkdirSync3, readFileSync as readFileSync4, rmSync as rmSync3 } from "fs";
396
- import { dirname as dirname4 } from "path";
395
+ import { chmodSync as chmodSync2, existsSync as existsSync4, mkdirSync as mkdirSync3, readFileSync as readFileSync6, rmSync as rmSync3 } from "fs";
396
+ import { dirname as dirname5 } from "path";
397
397
 
398
398
  // src/lib/atomic-file.ts
399
399
  import { randomUUID } from "crypto";
@@ -416,6 +416,61 @@ import { existsSync as existsSync2, mkdirSync as mkdirSync2, readFileSync as rea
416
416
  import { dirname as dirname3, join as join4 } from "path";
417
417
  var syncSleeper = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT));
418
418
 
419
+ // src/daemon/client-instance-id.ts
420
+ import { randomBytes as randomBytes2 } from "crypto";
421
+ import { chmodSync, lstatSync, readFileSync as readFileSync4 } from "fs";
422
+ import { join as join5 } from "path";
423
+ var INSTANCE_BODY_CHARS = 43;
424
+ var INSTANCE_PREFIX = "pci_";
425
+ var MAX_STORED_BYTES = INSTANCE_PREFIX.length + INSTANCE_BODY_CHARS + 1;
426
+
427
+ // src/lib/bin-path.ts
428
+ import { existsSync as existsSync3, readFileSync as readFileSync5 } from "fs";
429
+ import { dirname as dirname4, isAbsolute as isAbsolute2, join as join6 } from "path";
430
+ import { fileURLToPath } from "url";
431
+ var PKG_NAME = "@primitive.ai/prim";
432
+ var ROOT_WALK_LIMIT = 6;
433
+ var resolvedRoot;
434
+ function locateRoot() {
435
+ if (resolvedRoot !== void 0) {
436
+ return resolvedRoot;
437
+ }
438
+ let dir = dirname4(fileURLToPath(import.meta.url));
439
+ for (let depth = 0; depth < ROOT_WALK_LIMIT; depth++) {
440
+ const manifestPath = join6(dir, "package.json");
441
+ if (existsSync3(manifestPath)) {
442
+ try {
443
+ const manifest = JSON.parse(readFileSync5(manifestPath, "utf-8"));
444
+ if (manifest.name === PKG_NAME && manifest.bin) {
445
+ resolvedRoot = { dir, version: manifest.version, bin: manifest.bin };
446
+ return resolvedRoot;
447
+ }
448
+ } catch {
449
+ }
450
+ }
451
+ const parent = dirname4(dir);
452
+ if (parent === dir) {
453
+ break;
454
+ }
455
+ dir = parent;
456
+ }
457
+ resolvedRoot = null;
458
+ return resolvedRoot;
459
+ }
460
+ function packageVersion() {
461
+ return locateRoot()?.version ?? null;
462
+ }
463
+ var PRIM_CONFIG_SHELL_RESOLVER = [
464
+ 'prim_absolute() { case "$1" in [/]* ) ;; *) return 1 ;; esac; case "$1" in [[:space:]]*|*[[:space:]]|*[/][/]*|*[/].[/]*|*[/]..[/]*|*[/].|*[/]..|?*[/]) return 1 ;; esac; }; ',
465
+ 'prim_config=${PRIM_CONFIG_DIR:-}; if ! prim_absolute "$prim_config"; then prim_config=${XDG_CONFIG_HOME:-}; if prim_absolute "$prim_config"; then ',
466
+ 'case "$prim_config" in /) prim_config=/prim ;; *) prim_config="$prim_config/prim" ;; esac; ',
467
+ 'else prim_home=${HOME:-}; prim_absolute "$prim_home" || exit 78; case "$prim_home" in /) prim_config=/.config/prim ;; *) prim_config="$prim_home/.config/prim" ;; esac; ',
468
+ "fi; fi; "
469
+ ].join("");
470
+
471
+ // src/lib/ingest-uploader.ts
472
+ var runtimeVersion = process.env.PRIM_RUNTIME_VERSION ?? packageVersion();
473
+
419
474
  // src/client.ts
420
475
  var DEFAULT_API_URL = "https://api.getprimitive.ai";
421
476
  function getSiteUrl() {
@@ -428,17 +483,17 @@ var CLI_MANAGEMENT_RESPONSE_MAX_BYTES = 2 * 1024 * 1024;
428
483
 
429
484
  // src/drain-progress.ts
430
485
  import {
431
- chmodSync as chmodSync2,
432
- existsSync as existsSync4,
433
- readFileSync as readFileSync5,
486
+ chmodSync as chmodSync3,
487
+ existsSync as existsSync5,
488
+ readFileSync as readFileSync7,
434
489
  readdirSync,
435
490
  rmSync as rmSync4,
436
491
  rmdirSync
437
492
  } from "fs";
438
- import { basename, dirname as dirname5, join as join6 } from "path";
493
+ import { basename, dirname as dirname6, join as join8 } from "path";
439
494
 
440
495
  // src/journal.ts
441
- var JOURNAL_DIR = join7(primConfigDirectory(), "moves");
496
+ var JOURNAL_DIR = join9(primConfigDirectory(), "moves");
442
497
  var UNBOUND_BUCKET = "_unbound";
443
498
  var JOURNAL_BASENAME = "journal.ndjson";
444
499
  var JOURNAL_STATS_SAMPLE_BYTES = 64 * 1024;
@@ -450,15 +505,15 @@ function envSlug(apiUrl) {
450
505
  return slug;
451
506
  }
452
507
  function currentEnvDir() {
453
- return join7(JOURNAL_DIR, envSlug(getSiteUrl()));
508
+ return join9(JOURNAL_DIR, envSlug(getSiteUrl()));
454
509
  }
455
510
  var DIR_MODE = 448;
456
511
  var FILE_MODE = 384;
457
512
  var SAFE_BUCKET = /^[A-Za-z0-9_-]+$/;
458
513
  var RESERVED_BUCKETS = /* @__PURE__ */ new Set([UNBOUND_BUCKET, "_legacy"]);
459
514
  function appendMoveToPath(path, move) {
460
- const dir = dirname6(path);
461
- if (!existsSync5(dir)) {
515
+ const dir = dirname7(path);
516
+ if (!existsSync6(dir)) {
462
517
  mkdirSync4(dir, { recursive: true, mode: DIR_MODE });
463
518
  }
464
519
  appendFileSync(path, `${JSON.stringify(move)}
@@ -466,10 +521,10 @@ function appendMoveToPath(path, move) {
466
521
  }
467
522
  function bucketDir(orgId) {
468
523
  const safe = orgId !== void 0 && SAFE_BUCKET.test(orgId) && !RESERVED_BUCKETS.has(orgId);
469
- return join7(currentEnvDir(), safe ? orgId : UNBOUND_BUCKET);
524
+ return join9(currentEnvDir(), safe ? orgId : UNBOUND_BUCKET);
470
525
  }
471
526
  function journalPath(orgId) {
472
- return join7(bucketDir(orgId), JOURNAL_BASENAME);
527
+ return join9(bucketDir(orgId), JOURNAL_BASENAME);
473
528
  }
474
529
  function appendMove(move, orgId) {
475
530
  appendMoveToPath(journalPath(orgId), move);
@@ -478,15 +533,15 @@ var FLUSHING_PREFIX = `${JOURNAL_BASENAME}.flushing.`;
478
533
 
479
534
  // src/lib/activation.ts
480
535
  import { execFileSync as execFileSync2 } from "child_process";
481
- import { existsSync as existsSync6, readFileSync as readFileSync7 } from "fs";
536
+ import { existsSync as existsSync7, readFileSync as readFileSync9 } from "fs";
482
537
  import { homedir as homedir2 } from "os";
483
- import { join as join8 } from "path";
538
+ import { join as join10 } from "path";
484
539
 
485
540
  // src/lib/git.ts
486
541
  import { execFileSync } from "child_process";
487
542
  import { createHash as createHash3 } from "crypto";
488
- import { lstatSync, realpathSync } from "fs";
489
- import { basename as basename2, dirname as dirname7, isAbsolute as isAbsolute2, relative, resolve as resolve2, sep } from "path";
543
+ import { lstatSync as lstatSync2, realpathSync } from "fs";
544
+ import { basename as basename2, dirname as dirname8, isAbsolute as isAbsolute3, relative, resolve as resolve2, sep } from "path";
490
545
  var GIT_TIMEOUT_MS = 1e3;
491
546
  var GITHUB_OWNER_PATTERN = /^(?![A-Za-z0-9-]*--)[A-Za-z0-9](?:[A-Za-z0-9-]{0,37}[A-Za-z0-9])?$/u;
492
547
  var GITHUB_REPOSITORY_PATTERN = /^[A-Za-z0-9._-]{1,100}$/u;
@@ -634,10 +689,10 @@ function hasProjectPrimInstall(cwd) {
634
689
  const root = gitToplevel(cwd);
635
690
  if (root === null || root === homedir2()) return false;
636
691
  for (const rel of PROJECT_INSTALL_FILES) {
637
- const path = join8(root, rel);
638
- if (existsSync6(path)) {
692
+ const path = join10(root, rel);
693
+ if (existsSync7(path)) {
639
694
  try {
640
- const content = readFileSync7(path, "utf-8");
695
+ const content = readFileSync9(path, "utf-8");
641
696
  if (PRIM_HOOK_BINS.some((bin) => content.includes(bin))) return true;
642
697
  } catch {
643
698
  }
@@ -19162,21 +19217,21 @@ import { execFileSync as execFileSync3 } from "child_process";
19162
19217
  import { randomUUID as randomUUID2 } from "crypto";
19163
19218
  import {
19164
19219
  constants as constants2,
19165
- chmodSync as chmodSync3,
19220
+ chmodSync as chmodSync4,
19166
19221
  closeSync as closeSync3,
19167
19222
  fchmodSync as fchmodSync2,
19168
19223
  fsyncSync as fsyncSync2,
19169
19224
  linkSync,
19170
- lstatSync as lstatSync2,
19225
+ lstatSync as lstatSync3,
19171
19226
  mkdirSync as mkdirSync5,
19172
19227
  openSync as openSync3,
19173
- readFileSync as readFileSync8,
19228
+ readFileSync as readFileSync10,
19174
19229
  statSync as statSync2,
19175
19230
  unlinkSync,
19176
19231
  writeFileSync as writeFileSync3
19177
19232
  } from "fs";
19178
- import { dirname as dirname8, isAbsolute as isAbsolute3, join as join9, resolve as resolve3 } from "path";
19179
- var WORKSPACE_ID_RELATIVE_PATH = join9("prim", "workspace-id");
19233
+ import { dirname as dirname9, isAbsolute as isAbsolute4, join as join11, resolve as resolve3 } from "path";
19234
+ var WORKSPACE_ID_RELATIVE_PATH = join11("prim", "workspace-id");
19180
19235
  var MAX_ANCESTORS = 64;
19181
19236
  var MAX_GIT_FILE_BYTES = 4096;
19182
19237
  var MAX_ID_FILE_BYTES = 128;
@@ -19222,7 +19277,7 @@ function resolveWorkspaceIdPath(cwd) {
19222
19277
  }
19223
19278
  return {
19224
19279
  status: "resolved",
19225
- path: isAbsolute3(gitPath) ? resolve3(gitPath) : resolve3(cwd, gitPath)
19280
+ path: isAbsolute4(gitPath) ? resolve3(gitPath) : resolve3(cwd, gitPath)
19226
19281
  };
19227
19282
  } catch (error) {
19228
19283
  const code = errorCode(error);
@@ -19235,19 +19290,19 @@ function resolveWorkspaceIdPath(cwd) {
19235
19290
  function resolveFromFilesystem(cwd) {
19236
19291
  let current = resolve3(cwd);
19237
19292
  for (let depth = 0; depth < MAX_ANCESTORS; depth += 1) {
19238
- const dotGit = join9(current, ".git");
19293
+ const dotGit = join11(current, ".git");
19239
19294
  try {
19240
- const stat = lstatSync2(dotGit);
19295
+ const stat = lstatSync3(dotGit);
19241
19296
  if (stat.isDirectory() && isGitDirectory(dotGit)) {
19242
- return join9(dotGit, WORKSPACE_ID_RELATIVE_PATH);
19297
+ return join11(dotGit, WORKSPACE_ID_RELATIVE_PATH);
19243
19298
  }
19244
19299
  if (stat.isFile() && stat.size <= MAX_GIT_FILE_BYTES) {
19245
- const contents = readFileSync8(dotGit, "utf8");
19300
+ const contents = readFileSync10(dotGit, "utf8");
19246
19301
  const match = /^gitdir: (.+?)(?:\r?\n)?$/.exec(contents);
19247
19302
  if (match?.[1]) {
19248
- const gitDirectory = isAbsolute3(match[1]) ? resolve3(match[1]) : resolve3(current, match[1]);
19303
+ const gitDirectory = isAbsolute4(match[1]) ? resolve3(match[1]) : resolve3(current, match[1]);
19249
19304
  if (isGitDirectory(gitDirectory)) {
19250
- return join9(gitDirectory, WORKSPACE_ID_RELATIVE_PATH);
19305
+ return join11(gitDirectory, WORKSPACE_ID_RELATIVE_PATH);
19251
19306
  }
19252
19307
  }
19253
19308
  }
@@ -19258,7 +19313,7 @@ function resolveFromFilesystem(cwd) {
19258
19313
  return null;
19259
19314
  }
19260
19315
  }
19261
- const parent = dirname8(current);
19316
+ const parent = dirname9(current);
19262
19317
  if (parent === current) break;
19263
19318
  current = parent;
19264
19319
  }
@@ -19266,7 +19321,7 @@ function resolveFromFilesystem(cwd) {
19266
19321
  }
19267
19322
  function isGitDirectory(path) {
19268
19323
  try {
19269
- return statSync2(join9(path, "HEAD")).isFile();
19324
+ return statSync2(join11(path, "HEAD")).isFile();
19270
19325
  } catch {
19271
19326
  return false;
19272
19327
  }
@@ -19274,7 +19329,7 @@ function isGitDirectory(path) {
19274
19329
  function inspectPath(path) {
19275
19330
  let stat;
19276
19331
  try {
19277
- stat = lstatSync2(path);
19332
+ stat = lstatSync3(path);
19278
19333
  } catch (error) {
19279
19334
  const code = errorCode(error);
19280
19335
  if (code === "ENOENT" || code === "ENOTDIR") return { status: "missing", path };
@@ -19285,7 +19340,7 @@ function inspectPath(path) {
19285
19340
  return { status: "corrupt", path, reason: "invalid_content" };
19286
19341
  }
19287
19342
  try {
19288
- const contents = readFileSync8(path, "utf8");
19343
+ const contents = readFileSync10(path, "utf8");
19289
19344
  const workspaceId = contents.endsWith("\n") ? contents.slice(0, -1) : contents;
19290
19345
  if ((contents === workspaceId || contents === `${workspaceId}
19291
19346
  `) && isCanonicalWorkspaceId(workspaceId)) {
@@ -19302,14 +19357,14 @@ function inspectPath(path) {
19302
19357
  }
19303
19358
  }
19304
19359
  function createWorkspaceId(path) {
19305
- const parent = dirname8(path);
19360
+ const parent = dirname9(path);
19306
19361
  const workspaceId = randomUUID2();
19307
- const temporaryPath = join9(parent, `.workspace-id-${process.pid}-${randomUUID2()}.tmp`);
19362
+ const temporaryPath = join11(parent, `.workspace-id-${process.pid}-${randomUUID2()}.tmp`);
19308
19363
  let temporaryCreated = false;
19309
19364
  let publishing = false;
19310
19365
  try {
19311
19366
  mkdirSync5(parent, { recursive: true, mode: 448 });
19312
- chmodSync3(parent, 448);
19367
+ chmodSync4(parent, 448);
19313
19368
  const fd = openSync3(
19314
19369
  temporaryPath,
19315
19370
  constants2.O_CREAT | constants2.O_EXCL | constants2.O_WRONLY,
@@ -19372,8 +19427,8 @@ var LEGACY_ENVELOPE_VERSION = 1;
19372
19427
  var ENVELOPE_VERSION = LEGACY_ENVELOPE_VERSION;
19373
19428
 
19374
19429
  // src/hooks/redact.ts
19375
- import { existsSync as existsSync7, readFileSync as readFileSync9, statSync as statSync3 } from "fs";
19376
- import { join as join10 } from "path";
19430
+ import { existsSync as existsSync8, readFileSync as readFileSync11, statSync as statSync3 } from "fs";
19431
+ import { join as join12 } from "path";
19377
19432
  import { Worker } from "worker_threads";
19378
19433
  var USER_HOME_RULES = [
19379
19434
  {
@@ -19552,7 +19607,7 @@ function toRewriteMove(rewrite, cliVersion, cwd, context) {
19552
19607
  }
19553
19608
 
19554
19609
  // src/hooks/post-rewrite.ts
19555
- var here = dirname9(fileURLToPath(import.meta.url));
19610
+ var here = dirname10(fileURLToPath2(import.meta.url));
19556
19611
  var GIT_TIMEOUT_MS3 = 1e3;
19557
19612
  var MAX_PAIRS_FILE_BYTES = 1048576;
19558
19613
  var MAX_PAIRS_FILE_AGE_MS = 10 * 60 * 1e3;
@@ -19582,17 +19637,17 @@ function privatePairsFileStat(stat, now) {
19582
19637
  }
19583
19638
  function rewritePairsFromLauncher(env = process.env, now = Date.now()) {
19584
19639
  const path = env.PRIM_REWRITE_PAIRS_FILE;
19585
- if (!path || !isAbsolute4(path) || !PAIRS_FILE_RE.test(basename3(path))) return;
19640
+ if (!path || !isAbsolute5(path) || !PAIRS_FILE_RE.test(basename3(path))) return;
19586
19641
  let fd;
19587
19642
  try {
19588
- const pathStat = lstatSync3(path);
19643
+ const pathStat = lstatSync4(path);
19589
19644
  if (!privatePairsFileStat(pathStat, now)) return;
19590
19645
  fd = openSync4(path, constants3.O_RDONLY | constants3.O_NOFOLLOW);
19591
19646
  const openStat = fstatSync2(fd);
19592
19647
  if (!privatePairsFileStat(openStat, now) || openStat.dev !== pathStat.dev || openStat.ino !== pathStat.ino) {
19593
19648
  return;
19594
19649
  }
19595
- const bytes = readFileSync10(fd);
19650
+ const bytes = readFileSync12(fd);
19596
19651
  if (bytes.length !== openStat.size) return;
19597
19652
  let text;
19598
19653
  try {
@@ -19622,7 +19677,7 @@ function rewritePairsFromLauncher(env = process.env, now = Date.now()) {
19622
19677
  }
19623
19678
  function unlinkSnapshot(snapshot) {
19624
19679
  try {
19625
- const current = lstatSync3(snapshot.path);
19680
+ const current = lstatSync4(snapshot.path);
19626
19681
  if (current.isFile() && !current.isSymbolicLink() && current.dev === snapshot.dev && current.ino === snapshot.ino) {
19627
19682
  unlinkSync2(snapshot.path);
19628
19683
  }
@@ -19648,14 +19703,14 @@ function validBranch(value) {
19648
19703
  }
19649
19704
  function resolveCliVersion() {
19650
19705
  try {
19651
- const pkg = JSON.parse(readFileSync10(join11(here, "..", "..", "package.json"), "utf-8"));
19706
+ const pkg = JSON.parse(readFileSync12(join13(here, "..", "..", "package.json"), "utf-8"));
19652
19707
  return pkg.version ?? "unknown";
19653
19708
  } catch {
19654
19709
  return "unknown";
19655
19710
  }
19656
19711
  }
19657
19712
  function spawnBackgroundFlush() {
19658
- const entry = join11(here, "..", "index.js");
19713
+ const entry = join13(here, "..", "index.js");
19659
19714
  spawn(process.execPath, [entry, "moves", "flush"], {
19660
19715
  detached: true,
19661
19716
  stdio: "ignore",