terminalhire 0.42.24 → 0.42.26

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 (45) hide show
  1. package/dist/bin/approved-claims-sync.js +1 -1
  2. package/dist/bin/claim-push-bg.js +6 -4
  3. package/dist/bin/directory.js +1 -1
  4. package/dist/bin/founder-note-sync.js +1 -1
  5. package/dist/bin/founder-verdict-sync.js +1 -1
  6. package/dist/bin/jpi-bounties.js +9 -6
  7. package/dist/bin/jpi-chat-read.js +1 -1
  8. package/dist/bin/jpi-chat.js +3 -3
  9. package/dist/bin/jpi-claim.js +20 -18
  10. package/dist/bin/jpi-contribute.js +3 -3
  11. package/dist/bin/jpi-decline.js +7 -4
  12. package/dist/bin/jpi-devs.js +17 -17
  13. package/dist/bin/jpi-dispatch-dev.js +1 -1
  14. package/dist/bin/jpi-dispatch.js +73 -57
  15. package/dist/bin/jpi-hub.js +1 -1
  16. package/dist/bin/jpi-inbox.js +3 -3
  17. package/dist/bin/jpi-init.js +16 -16
  18. package/dist/bin/jpi-intro.js +3 -3
  19. package/dist/bin/jpi-jobs.js +16 -6
  20. package/dist/bin/jpi-link.js +1 -1
  21. package/dist/bin/jpi-login.js +17 -17
  22. package/dist/bin/jpi-mcp-chat.js +7 -7
  23. package/dist/bin/jpi-mcp.js +40 -38
  24. package/dist/bin/jpi-post.js +3 -3
  25. package/dist/bin/jpi-project.js +16 -16
  26. package/dist/bin/jpi-refresh.js +31 -24
  27. package/dist/bin/jpi-run.js +17 -16
  28. package/dist/bin/jpi-spinner.js +48 -19
  29. package/dist/bin/jpi-sync.js +10 -8
  30. package/dist/bin/jpi-trajectory.js +3 -3
  31. package/dist/bin/jpi.js +1 -1
  32. package/dist/bin/peer-connect-prompt.js +1 -1
  33. package/dist/bin/pulse-prompt.js +1 -1
  34. package/dist/bin/recall-check.js +3 -3
  35. package/dist/bin/spinner-io.js +29 -7
  36. package/dist/bin/spinner-render.js +31 -7
  37. package/dist/bin/spinner.js +36 -14
  38. package/dist/src/api-base.js +7 -4
  39. package/dist/src/chat-client.js +1 -1
  40. package/dist/src/intro.js +3 -3
  41. package/dist/src/link.js +1 -1
  42. package/dist/src/state-dir-pin.js +1 -1
  43. package/dist/src/trajectory.js +3 -3
  44. package/dist/src/web-session.js +1 -1
  45. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  // src/api-base.ts
2
2
  import { homedir } from "os";
3
- import { join } from "path";
3
+ import { basename, join, normalize } from "path";
4
4
  var PROD_API_BASE = "https://terminalhire.com";
5
5
  var DEV_API_BASE = "https://dev.terminalhire.com";
6
6
  var ApiBaseError = class extends Error {
@@ -550,7 +550,7 @@ init_state_dir();
550
550
 
551
551
  // src/api-base.ts
552
552
  import { homedir as homedir3 } from "os";
553
- import { join as join4 } from "path";
553
+ import { basename, join as join4, normalize } from "path";
554
554
  var PROD_API_BASE = "https://terminalhire.com";
555
555
  var DEV_API_BASE = "https://dev.terminalhire.com";
556
556
  var DEV_STATE_DIR_NAME = ".terminalhire-dev";
@@ -662,10 +662,12 @@ function warnSharedCredentialsIfNonProd(base, stream = process.stderr) {
662
662
  } catch {
663
663
  }
664
664
  }
665
- function usingSeparateStateDir(env = process.env) {
666
- const dir = env["TERMINALHIRE_DIR"];
665
+ function isDevStateDir(dir) {
667
666
  if (dir === void 0 || dir === "") return false;
668
- return dir.endsWith(DEV_STATE_DIR_NAME);
667
+ return basename(normalize(dir)) === DEV_STATE_DIR_NAME;
668
+ }
669
+ function usingSeparateStateDir(env = process.env) {
670
+ return isDevStateDir(env["TERMINALHIRE_DIR"]);
669
671
  }
670
672
 
671
673
  // bin/claim-push-bg.js
@@ -55,7 +55,7 @@ function ensureStateDir(dir) {
55
55
 
56
56
  // src/api-base.ts
57
57
  import { homedir } from "os";
58
- import { join } from "path";
58
+ import { basename, join, normalize } from "path";
59
59
  var PROD_API_BASE = "https://terminalhire.com";
60
60
  var DEV_API_BASE = "https://dev.terminalhire.com";
61
61
  var ApiBaseError = class extends Error {
@@ -1,6 +1,6 @@
1
1
  // src/api-base.ts
2
2
  import { homedir } from "os";
3
- import { join } from "path";
3
+ import { basename, join, normalize } from "path";
4
4
  var PROD_API_BASE = "https://terminalhire.com";
5
5
  var DEV_API_BASE = "https://dev.terminalhire.com";
6
6
  var ApiBaseError = class extends Error {
@@ -1,6 +1,6 @@
1
1
  // src/api-base.ts
2
2
  import { homedir } from "os";
3
- import { join } from "path";
3
+ import { basename, join, normalize } from "path";
4
4
  var PROD_API_BASE = "https://terminalhire.com";
5
5
  var DEV_API_BASE = "https://dev.terminalhire.com";
6
6
  var ApiBaseError = class extends Error {
@@ -10559,6 +10559,7 @@ __export(api_base_exports, {
10559
10559
  PROD_API_BASE: () => PROD_API_BASE,
10560
10560
  __resetDevMarkerLatchForTests: () => __resetDevMarkerLatchForTests,
10561
10561
  formatDevMarker: () => formatDevMarker,
10562
+ isDevStateDir: () => isDevStateDir,
10562
10563
  isLoopbackOrigin: () => isLoopbackOrigin,
10563
10564
  isNonProdApiBase: () => isNonProdApiBase,
10564
10565
  pinToDevApiBase: () => pinToDevApiBase,
@@ -10568,7 +10569,7 @@ __export(api_base_exports, {
10568
10569
  warnSharedCredentialsIfNonProd: () => warnSharedCredentialsIfNonProd
10569
10570
  });
10570
10571
  import { homedir as homedir2 } from "os";
10571
- import { join as join3 } from "path";
10572
+ import { basename, join as join3, normalize as normalize2 } from "path";
10572
10573
  function sanitizeOverrideForError(raw) {
10573
10574
  try {
10574
10575
  const url = new URL(raw);
@@ -10689,10 +10690,12 @@ function warnSharedCredentialsIfNonProd(base, stream = process.stderr) {
10689
10690
  } catch {
10690
10691
  }
10691
10692
  }
10692
- function usingSeparateStateDir(env = process.env) {
10693
- const dir = env["TERMINALHIRE_DIR"];
10693
+ function isDevStateDir(dir) {
10694
10694
  if (dir === void 0 || dir === "") return false;
10695
- return dir.endsWith(DEV_STATE_DIR_NAME);
10695
+ return basename(normalize2(dir)) === DEV_STATE_DIR_NAME;
10696
+ }
10697
+ function usingSeparateStateDir(env = process.env) {
10698
+ return isDevStateDir(env["TERMINALHIRE_DIR"]);
10696
10699
  }
10697
10700
  var PROD_API_BASE, DEV_API_BASE, DEV_STATE_DIR_NAME, ApiBaseError, ALLOWED_HOSTS, OAUTH_ALLOWED_ORIGINS, ALLOW_LOCAL_OAUTH_KEY, ALLOW_LOCAL_API_KEY, ALLOWED_DESCRIPTION, CANONICAL_REWRITES, ENV_KEYS, markerPrinted;
10698
10701
  var init_api_base = __esm({
@@ -10858,7 +10861,7 @@ var init_shared_key = __esm({
10858
10861
  // src/crypto-store.ts
10859
10862
  import { createCipheriv, createDecipheriv, randomBytes as randomBytes4 } from "crypto";
10860
10863
  import { readFileSync as readFileSync4, writeFileSync as writeFileSync3, existsSync as existsSync3, renameSync as renameSync2, rmSync, readdirSync } from "fs";
10861
- import { join as join6, dirname, basename } from "path";
10864
+ import { join as join6, dirname, basename as basename2 } from "path";
10862
10865
  import { createRequire } from "module";
10863
10866
  function encrypt(plaintext, key) {
10864
10867
  const iv = randomBytes4(IV_BYTES);
@@ -10915,7 +10918,7 @@ function atomicWriteFileSync(filePath, content) {
10915
10918
  ensureStateDirForSecret(dir);
10916
10919
  const tmp = join6(
10917
10920
  dir,
10918
- `.${basename(filePath)}.tmp-${process.pid}-${randomBytes4(6).toString("hex")}`
10921
+ `.${basename2(filePath)}.tmp-${process.pid}-${randomBytes4(6).toString("hex")}`
10919
10922
  );
10920
10923
  writeFileSync3(tmp, content, { encoding: "utf8", mode: 384, flag: "wx" });
10921
10924
  renameSync2(tmp, filePath);
@@ -4582,7 +4582,7 @@ var init_chat_keystore = __esm({
4582
4582
 
4583
4583
  // src/api-base.ts
4584
4584
  import { homedir as homedir4 } from "os";
4585
- import { join as join6 } from "path";
4585
+ import { basename, join as join6, normalize as normalize2 } from "path";
4586
4586
  function sanitizeOverrideForError(raw) {
4587
4587
  try {
4588
4588
  const url = new URL(raw);
@@ -4611,7 +4611,7 @@ var init_chat_keystore = __esm({
4611
4611
 
4612
4612
  // src/api-base.ts
4613
4613
  import { homedir as homedir4 } from "os";
4614
- import { join as join6 } from "path";
4614
+ import { basename, join as join6, normalize as normalize2 } from "path";
4615
4615
  function sanitizeOverrideForError(raw) {
4616
4616
  try {
4617
4617
  const url = new URL(raw);
@@ -5641,7 +5641,7 @@ var init_jpi_chat_read = __esm({
5641
5641
  // src/crypto-store.ts
5642
5642
  import { createCipheriv as createCipheriv2, createDecipheriv as createDecipheriv2, randomBytes as randomBytes6 } from "crypto";
5643
5643
  import { readFileSync as readFileSync9, writeFileSync as writeFileSync8, existsSync as existsSync9, renameSync as renameSync2, rmSync as rmSync4, readdirSync } from "fs";
5644
- import { join as join11, dirname, basename } from "path";
5644
+ import { join as join11, dirname, basename as basename2 } from "path";
5645
5645
  import { createRequire } from "module";
5646
5646
  function encrypt2(plaintext, key) {
5647
5647
  const iv = randomBytes6(IV_BYTES2);
@@ -5698,7 +5698,7 @@ function atomicWriteFileSync(filePath, content) {
5698
5698
  ensureStateDirForSecret(dir);
5699
5699
  const tmp = join11(
5700
5700
  dir,
5701
- `.${basename(filePath)}.tmp-${process.pid}-${randomBytes6(6).toString("hex")}`
5701
+ `.${basename2(filePath)}.tmp-${process.pid}-${randomBytes6(6).toString("hex")}`
5702
5702
  );
5703
5703
  writeFileSync8(tmp, content, { encoding: "utf8", mode: 384, flag: "wx" });
5704
5704
  renameSync2(tmp, filePath);
@@ -10878,7 +10878,7 @@ var init_claims = __esm({
10878
10878
 
10879
10879
  // src/api-base.ts
10880
10880
  import { homedir as homedir3 } from "os";
10881
- import { join as join4 } from "path";
10881
+ import { basename, join as join4, normalize as normalize2 } from "path";
10882
10882
  function sanitizeOverrideForError(raw) {
10883
10883
  try {
10884
10884
  const url = new URL(raw);
@@ -10971,10 +10971,12 @@ function warnSharedCredentialsIfNonProd(base, stream = process.stderr) {
10971
10971
  } catch {
10972
10972
  }
10973
10973
  }
10974
- function usingSeparateStateDir(env = process.env) {
10975
- const dir = env["TERMINALHIRE_DIR"];
10974
+ function isDevStateDir(dir) {
10976
10975
  if (dir === void 0 || dir === "") return false;
10977
- return dir.endsWith(DEV_STATE_DIR_NAME);
10976
+ return basename(normalize2(dir)) === DEV_STATE_DIR_NAME;
10977
+ }
10978
+ function usingSeparateStateDir(env = process.env) {
10979
+ return isDevStateDir(env["TERMINALHIRE_DIR"]);
10978
10980
  }
10979
10981
  var PROD_API_BASE, DEV_API_BASE, DEV_STATE_DIR_NAME, ApiBaseError, ALLOWED_HOSTS, OAUTH_ALLOWED_ORIGINS, ALLOW_LOCAL_OAUTH_KEY, ALLOW_LOCAL_API_KEY, ALLOWED_DESCRIPTION, CANONICAL_REWRITES, ENV_KEYS;
10980
10982
  var init_api_base = __esm({
@@ -24589,9 +24591,9 @@ import { homedir as homedir8 } from "os";
24589
24591
  import { join as join13 } from "path";
24590
24592
  import { readFileSync as readFileSync8, writeFileSync as writeFileSync7 } from "fs";
24591
24593
  function quoteFound(quote, content) {
24592
- const q = normalize2(quote);
24594
+ const q = normalize3(quote);
24593
24595
  if (q.length < MIN_QUOTE_CHARS) return false;
24594
- return normalize2(content).includes(q);
24596
+ return normalize3(content).includes(q);
24595
24597
  }
24596
24598
  function quoteSource(quote, files) {
24597
24599
  for (const { file, content } of [...files].sort((a, b) => a.file.localeCompare(b.file))) {
@@ -24844,7 +24846,7 @@ function unusable(policy, detail) {
24844
24846
  semantic: { status: "unusable", detail }
24845
24847
  };
24846
24848
  }
24847
- var TERMINALHIRE_DIR6, CACHE_FILE, MIN_QUOTE_CHARS, normalize2, SemanticAuditUnavailableError, CACHED_VERDICT_KEYS, SEMANTIC_POLICY_CACHE_FILE;
24849
+ var TERMINALHIRE_DIR6, CACHE_FILE, MIN_QUOTE_CHARS, normalize3, SemanticAuditUnavailableError, CACHED_VERDICT_KEYS, SEMANTIC_POLICY_CACHE_FILE;
24848
24850
  var init_repo_policy_semantic = __esm({
24849
24851
  "src/repo-policy-semantic.ts"() {
24850
24852
  "use strict";
@@ -24853,7 +24855,7 @@ var init_repo_policy_semantic = __esm({
24853
24855
  TERMINALHIRE_DIR6 = process.env.TERMINALHIRE_DIR || join13(homedir8(), ".terminalhire");
24854
24856
  CACHE_FILE = join13(TERMINALHIRE_DIR6, "semantic-policy-cache.json");
24855
24857
  MIN_QUOTE_CHARS = 16;
24856
- normalize2 = (s) => s.toLowerCase().replace(/\s+/g, " ").trim();
24858
+ normalize3 = (s) => s.toLowerCase().replace(/\s+/g, " ").trim();
24857
24859
  SemanticAuditUnavailableError = class extends Error {
24858
24860
  constructor(message) {
24859
24861
  super(message);
@@ -25174,7 +25176,7 @@ var init_repo_policy = __esm({
25174
25176
  // src/crypto-store.ts
25175
25177
  import { createCipheriv as createCipheriv2, createDecipheriv as createDecipheriv2, randomBytes as randomBytes6 } from "crypto";
25176
25178
  import { readFileSync as readFileSync9, writeFileSync as writeFileSync8, existsSync as existsSync7, renameSync as renameSync3, rmSync as rmSync5, readdirSync } from "fs";
25177
- import { join as join14, dirname as dirname4, basename as basename3 } from "path";
25179
+ import { join as join14, dirname as dirname4, basename as basename4 } from "path";
25178
25180
  import { createRequire } from "module";
25179
25181
  function encrypt2(plaintext, key) {
25180
25182
  const iv = randomBytes6(IV_BYTES2);
@@ -25231,7 +25233,7 @@ function atomicWriteFileSync(filePath, content) {
25231
25233
  ensureStateDirForSecret(dir);
25232
25234
  const tmp = join14(
25233
25235
  dir,
25234
- `.${basename3(filePath)}.tmp-${process.pid}-${randomBytes6(6).toString("hex")}`
25236
+ `.${basename4(filePath)}.tmp-${process.pid}-${randomBytes6(6).toString("hex")}`
25235
25237
  );
25236
25238
  writeFileSync8(tmp, content, { encoding: "utf8", mode: 384, flag: "wx" });
25237
25239
  renameSync3(tmp, filePath);
@@ -26485,9 +26487,9 @@ var init_classify2 = __esm({
26485
26487
  // rspec's summary line
26486
26488
  ].join("|"), "m");
26487
26489
  MISSING_SYSTEM_DEPENDENCY = [
26488
- /^(?:\S*\/)?ld(?:\.\w+)?: cannot find -l[\w.+-]+/m,
26489
- /^\S+:\d+(?::\d+)?: fatal error: [\w./+-]+\.(?:h|hh|hpp|hxx): No such file or directory$/m,
26490
- /^\S+: error while loading shared libraries: lib[\w.+-]*: cannot open shared object file/m
26490
+ /^[ \t|>]*(?:\S*\/)?ld(?:\.\w+)?: cannot find -l[\w.+-]+/m,
26491
+ /^[ \t|>]*[\w./~]\S*:\d+(?::\d+)?: fatal error: [\w./+-]+\.(?:h|hh|hpp|hxx): No such file or directory$/m,
26492
+ /^[ \t|>]*[\w./~]\S*: error while loading shared libraries: lib[\w.+-]*: cannot open shared object file/m
26491
26493
  ];
26492
26494
  OFFLINE_BUILD_GAP = [
26493
26495
  // Maven, `-o`: `Cannot access central (…) in offline mode and the artifact … has
@@ -26637,7 +26639,7 @@ var init_reap = __esm({
26637
26639
  // ../../packages/containment/dist/fence.js
26638
26640
  import { spawn as spawn3, spawnSync as spawnSync2 } from "child_process";
26639
26641
  import { existsSync as existsSync9, lchownSync, lstatSync as lstatSync3, mkdirSync as mkdirSync3, readdirSync as readdirSync2, realpathSync, statSync as statSync3, writeFileSync as writeFileSync10 } from "fs";
26640
- import { basename as basename4, dirname as dirname6, isAbsolute as isAbsolute3, join as join19, posix as posix2, resolve as resolve4, sep as sep5 } from "path";
26642
+ import { basename as basename5, dirname as dirname6, isAbsolute as isAbsolute3, join as join19, posix as posix2, resolve as resolve4, sep as sep5 } from "path";
26641
26643
  import { fileURLToPath as fileURLToPath2 } from "url";
26642
26644
  function canonical(path5, label) {
26643
26645
  if (!isAbsolute3(path5)) {
@@ -26715,7 +26717,7 @@ function canonicalPath(p) {
26715
26717
  const up = dirname6(head);
26716
26718
  if (up === head)
26717
26719
  return resolve4(p);
26718
- tail2.push(basename4(head));
26720
+ tail2.push(basename5(head));
26719
26721
  head = up;
26720
26722
  }
26721
26723
  }
@@ -35041,14 +35043,14 @@ function migrationUnits(runner, migrations) {
35041
35043
  return [...byDir.entries()].sort((a, b) => a[0].localeCompare(b[0])).map(([id, path5]) => ({ id, path: path5 }));
35042
35044
  }
35043
35045
  case "alembic":
35044
- return migrations.filter((p) => /^alembic\/versions\/[^/]+\.py$/.test(p) && !p.endsWith("/__init__.py")).sort().map((path5) => ({ id: basename5(path5).replace(/\.py$/, ""), path: path5 }));
35046
+ return migrations.filter((p) => /^alembic\/versions\/[^/]+\.py$/.test(p) && !p.endsWith("/__init__.py")).sort().map((path5) => ({ id: basename6(path5).replace(/\.py$/, ""), path: path5 }));
35045
35047
  case "rails":
35046
- return migrations.filter((p) => /^db\/migrate\/[^/]+\.rb$/.test(p)).sort().map((path5) => ({ id: /^(\d+)/.exec(basename5(path5))?.[1] ?? basename5(path5), path: path5 }));
35048
+ return migrations.filter((p) => /^db\/migrate\/[^/]+\.rb$/.test(p)).sort().map((path5) => ({ id: /^(\d+)/.exec(basename6(path5))?.[1] ?? basename6(path5), path: path5 }));
35047
35049
  case "sql":
35048
35050
  return migrations.filter((p) => p.endsWith(".sql") && !p.startsWith("prisma/migrations/")).sort().map((path5) => ({ id: path5, path: path5 }));
35049
35051
  }
35050
35052
  }
35051
- function basename5(path5) {
35053
+ function basename6(path5) {
35052
35054
  const at = path5.lastIndexOf("/");
35053
35055
  return at === -1 ? path5 : path5.slice(at + 1);
35054
35056
  }
@@ -2580,7 +2580,7 @@ var init_state_dir = __esm({
2580
2580
 
2581
2581
  // src/api-base.ts
2582
2582
  import { homedir as homedir3 } from "os";
2583
- import { join as join4 } from "path";
2583
+ import { basename, join as join4, normalize as normalize2 } from "path";
2584
2584
  function sanitizeOverrideForError(raw) {
2585
2585
  try {
2586
2586
  const url = new URL(raw);
@@ -2798,7 +2798,7 @@ var init_shared_key = __esm({
2798
2798
  // src/crypto-store.ts
2799
2799
  import { createCipheriv, createDecipheriv, randomBytes as randomBytes3 } from "crypto";
2800
2800
  import { readFileSync as readFileSync5, writeFileSync as writeFileSync4, existsSync as existsSync4, renameSync as renameSync2, rmSync, readdirSync } from "fs";
2801
- import { join as join7, dirname, basename } from "path";
2801
+ import { join as join7, dirname, basename as basename2 } from "path";
2802
2802
  import { createRequire } from "module";
2803
2803
  function encrypt(plaintext, key) {
2804
2804
  const iv = randomBytes3(IV_BYTES);
@@ -2855,7 +2855,7 @@ function atomicWriteFileSync(filePath, content) {
2855
2855
  ensureStateDirForSecret(dir);
2856
2856
  const tmp = join7(
2857
2857
  dir,
2858
- `.${basename(filePath)}.tmp-${process.pid}-${randomBytes3(6).toString("hex")}`
2858
+ `.${basename2(filePath)}.tmp-${process.pid}-${randomBytes3(6).toString("hex")}`
2859
2859
  );
2860
2860
  writeFileSync4(tmp, content, { encoding: "utf8", mode: 384, flag: "wx" });
2861
2861
  renameSync2(tmp, filePath);
@@ -110,6 +110,7 @@ __export(api_base_exports, {
110
110
  PROD_API_BASE: () => PROD_API_BASE,
111
111
  __resetDevMarkerLatchForTests: () => __resetDevMarkerLatchForTests,
112
112
  formatDevMarker: () => formatDevMarker,
113
+ isDevStateDir: () => isDevStateDir,
113
114
  isLoopbackOrigin: () => isLoopbackOrigin,
114
115
  isNonProdApiBase: () => isNonProdApiBase,
115
116
  pinToDevApiBase: () => pinToDevApiBase,
@@ -119,7 +120,7 @@ __export(api_base_exports, {
119
120
  warnSharedCredentialsIfNonProd: () => warnSharedCredentialsIfNonProd
120
121
  });
121
122
  import { homedir } from "os";
122
- import { join } from "path";
123
+ import { basename, join, normalize } from "path";
123
124
  function sanitizeOverrideForError(raw) {
124
125
  try {
125
126
  const url = new URL(raw);
@@ -240,10 +241,12 @@ function warnSharedCredentialsIfNonProd(base, stream = process.stderr) {
240
241
  } catch {
241
242
  }
242
243
  }
243
- function usingSeparateStateDir(env = process.env) {
244
- const dir = env["TERMINALHIRE_DIR"];
244
+ function isDevStateDir(dir) {
245
245
  if (dir === void 0 || dir === "") return false;
246
- return dir.endsWith(DEV_STATE_DIR_NAME);
246
+ return basename(normalize(dir)) === DEV_STATE_DIR_NAME;
247
+ }
248
+ function usingSeparateStateDir(env = process.env) {
249
+ return isDevStateDir(env["TERMINALHIRE_DIR"]);
247
250
  }
248
251
  var PROD_API_BASE, DEV_API_BASE, DEV_STATE_DIR_NAME, ApiBaseError, ALLOWED_HOSTS, OAUTH_ALLOWED_ORIGINS, ALLOW_LOCAL_OAUTH_KEY, ALLOW_LOCAL_API_KEY, ALLOWED_DESCRIPTION, CANONICAL_REWRITES, ENV_KEYS, markerPrinted;
249
252
  var init_api_base = __esm({
@@ -704,7 +704,7 @@ var init_classify = __esm({
704
704
  });
705
705
 
706
706
  // ../../packages/core/src/vocab/index.ts
707
- function normalize(tokens) {
707
+ function normalize2(tokens) {
708
708
  const result = /* @__PURE__ */ new Set();
709
709
  for (const raw of tokens) {
710
710
  const lower = raw.toLowerCase().trim();
@@ -1262,7 +1262,7 @@ function githubToFingerprint(p) {
1262
1262
  ...p.topics
1263
1263
  // recentPRorgs intentionally excluded — org names are not skill tags
1264
1264
  ];
1265
- const skillTags = normalize(rawTokens);
1265
+ const skillTags = normalize2(rawTokens);
1266
1266
  const seniorityBand = inferSeniority(p);
1267
1267
  return { skillTags, seniorityBand };
1268
1268
  }
@@ -1545,7 +1545,7 @@ async function computeAcceptanceFromSearch(login, token, ownedOrgs, cache, gates
1545
1545
  distinctOrgSet.add(ownerLc);
1546
1546
  const mergedAt = item.pull_request?.merged_at ?? item.closed_at ?? item.created_at;
1547
1547
  const rawDomains = [meta.language ?? "", ...meta.topics].filter(Boolean);
1548
- const domainTags = [...new Set(normalize(rawDomains))];
1548
+ const domainTags = [...new Set(normalize2(rawDomains))];
1549
1549
  qualifyingPRs.push({
1550
1550
  url: item.html_url,
1551
1551
  title: item.title,
@@ -1913,7 +1913,7 @@ function deriveResumeTrend(cred, repoRecency, now = Date.now()) {
1913
1913
  }
1914
1914
  }
1915
1915
  for (const r of repoRecency) {
1916
- for (const domain of new Set(normalize([r.language ?? "", ...r.topics].filter(Boolean)))) {
1916
+ for (const domain of new Set(normalize2([r.language ?? "", ...r.topics].filter(Boolean)))) {
1917
1917
  bump(domain, r.pushedAt, 1, 0);
1918
1918
  }
1919
1919
  }
@@ -3303,7 +3303,7 @@ async function fetchRepoBounties(repoFullName) {
3303
3303
  const body = issue.body ? decodeEntities(issue.body) : "";
3304
3304
  const amountUSD = parseAmountUSD(title) ?? parseAmountUSD(body) ?? await fetchCommentAmount(repoFullName, issue.number);
3305
3305
  const labels = labelNames(issue);
3306
- const tags = normalize(tokenize2([title, labels.join(" "), body.slice(0, 2e3)].join(" ")));
3306
+ const tags = normalize2(tokenize2([title, labels.join(" "), body.slice(0, 2e3)].join(" ")));
3307
3307
  return {
3308
3308
  id: `bounty:${repoFullName}#${issue.number}`,
3309
3309
  source: "bounty",
@@ -3440,7 +3440,7 @@ async function fetchSearchBounties() {
3440
3440
  }
3441
3441
  if (amountUSD == null) continue;
3442
3442
  if (!passesAntiFarm(amountUSD, repo.stargazers_count)) continue;
3443
- const tags = normalize(
3443
+ const tags = normalize2(
3444
3444
  tokenize2([title, labels.join(" "), body.slice(0, 2e3)].join(" "))
3445
3445
  );
3446
3446
  perRepo.set(fullName, (perRepo.get(fullName) ?? 0) + 1);
@@ -3587,7 +3587,7 @@ var init_opire = __esm({
3587
3587
  if (amountUSD == null || amountUSD < MIN_USD || amountUSD > MAX_USD) continue;
3588
3588
  const title = (r.title ?? "").trim();
3589
3589
  if (title.length < 4) continue;
3590
- const tags = normalize([...r.programmingLanguages ?? [], ...tokenize3(title)]);
3590
+ const tags = normalize2([...r.programmingLanguages ?? [], ...tokenize3(title)]);
3591
3591
  const bounty = {
3592
3592
  amountUSD,
3593
3593
  estimatedEffort: effortFromAmount(amountUSD),
@@ -4150,7 +4150,7 @@ async function aggregateContributions(opts = {}) {
4150
4150
  const prRefs = await repoPRRefs(fullName);
4151
4151
  if (prRefs === null) prRefsNull++;
4152
4152
  const openPRsAtDiscovery = prRefs ? prRefs.has(issue.number) ? 1 : 0 : void 0;
4153
- const tags = normalize(
4153
+ const tags = normalize2(
4154
4154
  tokenize4([title, repo.language ?? "", labels.join(" "), body.slice(0, 2e3)].join(" "))
4155
4155
  );
4156
4156
  seen.add(id);
@@ -4287,7 +4287,7 @@ async function aggregateContributions(opts = {}) {
4287
4287
  const prRefs = await repoPRRefs(fullName);
4288
4288
  if (prRefs === null) prRefsNull++;
4289
4289
  const openPRsAtDiscovery = prRefs ? prRefs.has(issue.number) ? 1 : 0 : void 0;
4290
- const tags = normalize(
4290
+ const tags = normalize2(
4291
4291
  tokenize4([title, repo.language ?? "", labels.join(" "), body.slice(0, 2e3)].join(" "))
4292
4292
  );
4293
4293
  seen.add(id);
@@ -4556,7 +4556,7 @@ function curateProjects(issues, opts = {}) {
4556
4556
  const repoLanguageRaw = firstNonEmptyString(
4557
4557
  winnableIssues.map((i) => i.contribution.language ?? "")
4558
4558
  );
4559
- const languageIds = new Set(repoLanguageRaw ? normalize(tokenize(repoLanguageRaw)) : []);
4559
+ const languageIds = new Set(repoLanguageRaw ? normalize2(tokenize(repoLanguageRaw)) : []);
4560
4560
  const skillTagUnion = /* @__PURE__ */ new Set();
4561
4561
  for (const iss of winnableIssues) for (const t of iss.tags ?? []) skillTagUnion.add(t);
4562
4562
  let distinctNonLanguageSkillTags = 0;
@@ -8576,7 +8576,7 @@ function deriveLegibleProfile(credential, recency, traction, seniorityBand) {
8576
8576
  const ok = credential.status === "ok";
8577
8577
  const domains = ok ? credential.byDomain : {};
8578
8578
  const chips = Object.entries(domains).map(([rawDomain, d]) => {
8579
- const canon = normalize([rawDomain])[0];
8579
+ const canon = normalize2([rawDomain])[0];
8580
8580
  return canon ? { domain: canon, mergedPRs: d.mergedPRs } : null;
8581
8581
  }).filter((c) => c !== null).sort((a, b) => b.mergedPRs - a.mergedPRs || (a.domain < b.domain ? -1 : 1));
8582
8582
  const dominant = chips.length > 0 ? chips[0].domain : void 0;
@@ -10072,7 +10072,7 @@ async function runAcceptanceAuditBatch(opts) {
10072
10072
  const appendQualifying = (cand, meta) => {
10073
10073
  const on = parseRepoUrl(cand.repoUrl);
10074
10074
  const rawDomains = [meta.language ?? "", ...meta.topics].filter(Boolean);
10075
- const domains = [...new Set(normalize(rawDomains))];
10075
+ const domains = [...new Set(normalize2(rawDomains))];
10076
10076
  const entry = {
10077
10077
  url: cand.url,
10078
10078
  title: cand.title,
@@ -10454,7 +10454,7 @@ __export(src_exports, {
10454
10454
  mergeLedger: () => mergeLedger,
10455
10455
  mergeProbability: () => mergeProbability,
10456
10456
  mmrRerank: () => mmrRerank,
10457
- normalize: () => normalize,
10457
+ normalize: () => normalize2,
10458
10458
  openPRClosingRefs: () => openPRClosingRefs,
10459
10459
  opire: () => opire,
10460
10460
  opportunityShortToken: () => opportunityShortToken,
@@ -10653,7 +10653,7 @@ var init_shared_key = __esm({
10653
10653
  // src/crypto-store.ts
10654
10654
  import { createCipheriv, createDecipheriv, randomBytes as randomBytes4 } from "crypto";
10655
10655
  import { readFileSync as readFileSync4, writeFileSync as writeFileSync3, existsSync as existsSync3, renameSync as renameSync2, rmSync, readdirSync } from "fs";
10656
- import { join as join6, dirname, basename } from "path";
10656
+ import { join as join6, dirname, basename as basename2 } from "path";
10657
10657
  import { createRequire } from "module";
10658
10658
  function encrypt(plaintext, key) {
10659
10659
  const iv = randomBytes4(IV_BYTES);
@@ -10710,7 +10710,7 @@ function atomicWriteFileSync(filePath, content) {
10710
10710
  ensureStateDirForSecret(dir);
10711
10711
  const tmp = join6(
10712
10712
  dir,
10713
- `.${basename(filePath)}.tmp-${process.pid}-${randomBytes4(6).toString("hex")}`
10713
+ `.${basename2(filePath)}.tmp-${process.pid}-${randomBytes4(6).toString("hex")}`
10714
10714
  );
10715
10715
  writeFileSync3(tmp, content, { encoding: "utf8", mode: 384, flag: "wx" });
10716
10716
  renameSync2(tmp, filePath);
@@ -10873,7 +10873,7 @@ async function writeProfile(profile) {
10873
10873
  }
10874
10874
  function accumulateSession(profile, tags, isEmployerContext, inferredSeniority, seniorityIsAuthoritative = false) {
10875
10875
  const now = (/* @__PURE__ */ new Date()).toISOString();
10876
- let filtered = normalize(tags);
10876
+ let filtered = normalize2(tags);
10877
10877
  if (isEmployerContext) {
10878
10878
  filtered = filtered.filter((t) => LANGUAGE_TAGS.has(t));
10879
10879
  profile.hasEmployerSessions = true;
@@ -10998,7 +10998,7 @@ import { homedir as homedir2 } from "os";
10998
10998
 
10999
10999
  // src/api-base.ts
11000
11000
  import { homedir } from "os";
11001
- import { join } from "path";
11001
+ import { basename, join, normalize } from "path";
11002
11002
  var PROD_API_BASE = "https://terminalhire.com";
11003
11003
  var DEV_API_BASE = "https://dev.terminalhire.com";
11004
11004
  var ApiBaseError = class extends Error {
@@ -7,7 +7,7 @@ import { fileURLToPath } from "url";
7
7
 
8
8
  // src/api-base.ts
9
9
  import { homedir } from "os";
10
- import { join } from "path";
10
+ import { basename, join, normalize } from "path";
11
11
  var PROD_API_BASE = "https://terminalhire.com";
12
12
  var DEV_API_BASE = "https://dev.terminalhire.com";
13
13
  var DEV_STATE_DIR_NAME = ".terminalhire-dev";