terminalhire 0.42.16 → 0.42.17
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.
- package/dist/bin/approved-claims-sync.js +2 -0
- package/dist/bin/claim-push-bg.js +20 -11
- package/dist/bin/directory.js +7 -5
- package/dist/bin/founder-note-sync.js +2 -0
- package/dist/bin/founder-verdict-sync.js +2 -0
- package/dist/bin/jpi-bounties.js +41 -39
- package/dist/bin/jpi-chat-read.js +25 -15
- package/dist/bin/jpi-chat.js +66 -34
- package/dist/bin/jpi-claim.js +126 -113
- package/dist/bin/jpi-contribute.js +38 -36
- package/dist/bin/jpi-devs.js +25 -23
- package/dist/bin/jpi-dispatch-dev.js +53 -0
- package/dist/bin/jpi-dispatch.js +380 -315
- package/dist/bin/jpi-hub.js +46 -36
- package/dist/bin/jpi-inbox.js +65 -33
- package/dist/bin/jpi-init.js +24 -22
- package/dist/bin/jpi-intro.js +17 -15
- package/dist/bin/jpi-jobs.js +73 -49
- package/dist/bin/jpi-link.js +7 -5
- package/dist/bin/jpi-login.js +30 -28
- package/dist/bin/jpi-mcp-chat.js +27 -17
- package/dist/bin/jpi-mcp.js +146 -133
- package/dist/bin/jpi-post.js +8 -6
- package/dist/bin/jpi-project.js +14 -12
- package/dist/bin/jpi-refresh.js +134 -90
- package/dist/bin/jpi-run.js +68 -66
- package/dist/bin/jpi-spinner.js +22 -7
- package/dist/bin/jpi-statusline.js +24 -12
- package/dist/bin/jpi-sync.js +29 -20
- package/dist/bin/jpi-trajectory.js +26 -24
- package/dist/bin/jpi.js +42 -4
- package/dist/bin/peer-connect-prompt.js +2 -0
- package/dist/bin/pulse-prompt.js +4 -2
- package/dist/bin/recall-check.js +7 -5
- package/dist/bin/spinner-render.js +23 -7
- package/dist/bin/spinner.js +23 -7
- package/dist/src/api-base.js +16 -0
- package/dist/src/chat-client.js +6 -4
- package/dist/src/intro.js +17 -15
- package/dist/src/link.js +2 -0
- package/dist/src/trajectory.js +26 -24
- package/package.json +4 -2
|
@@ -115,8 +115,8 @@ import {
|
|
|
115
115
|
statSync
|
|
116
116
|
} from "fs";
|
|
117
117
|
import { randomBytes as randomBytes3 } from "crypto";
|
|
118
|
-
import { join as
|
|
119
|
-
import { homedir as
|
|
118
|
+
import { join as join5 } from "path";
|
|
119
|
+
import { homedir as homedir4 } from "os";
|
|
120
120
|
function sleepSync(ms) {
|
|
121
121
|
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
|
|
122
122
|
}
|
|
@@ -310,8 +310,8 @@ var init_claims = __esm({
|
|
|
310
310
|
"src/claims.ts"() {
|
|
311
311
|
"use strict";
|
|
312
312
|
init_state_dir();
|
|
313
|
-
TERMINALHIRE_DIR3 = process.env.TERMINALHIRE_DIR ||
|
|
314
|
-
CLAIMS_FILE =
|
|
313
|
+
TERMINALHIRE_DIR3 = process.env.TERMINALHIRE_DIR || join5(homedir4(), ".terminalhire");
|
|
314
|
+
CLAIMS_FILE = join5(TERMINALHIRE_DIR3, "claims.json");
|
|
315
315
|
LOCK_DIR = `${CLAIMS_FILE}.lock`;
|
|
316
316
|
LOCK_STALE_MS = Number(process.env.TERMINALHIRE_LOCK_STALE_MS) || 1e4;
|
|
317
317
|
LOCK_RETRY_MS = Number(process.env.TERMINALHIRE_LOCK_RETRY_MS) || 25;
|
|
@@ -369,8 +369,8 @@ var init_claims = __esm({
|
|
|
369
369
|
// bin/claim-push-bg.js
|
|
370
370
|
import { createHash } from "crypto";
|
|
371
371
|
import { readFileSync as readFileSync4, writeFileSync as writeFileSync4, existsSync as existsSync5, rmSync as rmSync3 } from "fs";
|
|
372
|
-
import { join as
|
|
373
|
-
import { homedir as
|
|
372
|
+
import { join as join6 } from "path";
|
|
373
|
+
import { homedir as homedir5 } from "os";
|
|
374
374
|
|
|
375
375
|
// src/github-auth.ts
|
|
376
376
|
init_state_dir();
|
|
@@ -511,8 +511,11 @@ function decrypt(blob, key) {
|
|
|
511
511
|
init_state_dir();
|
|
512
512
|
|
|
513
513
|
// src/api-base.ts
|
|
514
|
+
import { homedir as homedir3 } from "os";
|
|
515
|
+
import { join as join4 } from "path";
|
|
514
516
|
var PROD_API_BASE = "https://terminalhire.com";
|
|
515
517
|
var DEV_API_BASE = "https://dev.terminalhire.com";
|
|
518
|
+
var DEV_STATE_DIR_NAME = ".terminalhire-dev";
|
|
516
519
|
var ApiBaseError = class extends Error {
|
|
517
520
|
constructor(message) {
|
|
518
521
|
super(message);
|
|
@@ -613,6 +616,7 @@ function isNonProdApiBase(base = resolveApiBaseOrProd()) {
|
|
|
613
616
|
}
|
|
614
617
|
function warnSharedCredentialsIfNonProd(base, stream = process.stderr) {
|
|
615
618
|
if (!isNonProdApiBase(base)) return;
|
|
619
|
+
if (usingSeparateStateDir()) return;
|
|
616
620
|
try {
|
|
617
621
|
stream.write(
|
|
618
622
|
"terminalhire: non-prod API base \u2014 using the same local session/push credentials as prod; do not mix environments casually.\n"
|
|
@@ -620,12 +624,17 @@ function warnSharedCredentialsIfNonProd(base, stream = process.stderr) {
|
|
|
620
624
|
} catch {
|
|
621
625
|
}
|
|
622
626
|
}
|
|
627
|
+
function usingSeparateStateDir(env = process.env) {
|
|
628
|
+
const dir = env["TERMINALHIRE_DIR"];
|
|
629
|
+
if (dir === void 0 || dir === "") return false;
|
|
630
|
+
return dir.endsWith(DEV_STATE_DIR_NAME);
|
|
631
|
+
}
|
|
623
632
|
|
|
624
633
|
// bin/claim-push-bg.js
|
|
625
|
-
var TERMINALHIRE_DIR4 = process.env.TERMINALHIRE_DIR ||
|
|
626
|
-
var CLAIM_PUSH_AUTO_MARKER =
|
|
627
|
-
var CLAIM_PUSH_TOKEN_FILE =
|
|
628
|
-
var CLAIM_PUSH_MANUAL_MARKER =
|
|
634
|
+
var TERMINALHIRE_DIR4 = process.env.TERMINALHIRE_DIR || join6(homedir5(), ".terminalhire");
|
|
635
|
+
var CLAIM_PUSH_AUTO_MARKER = join6(TERMINALHIRE_DIR4, "claim-push-auto.json");
|
|
636
|
+
var CLAIM_PUSH_TOKEN_FILE = join6(TERMINALHIRE_DIR4, "claim-push-token.enc");
|
|
637
|
+
var CLAIM_PUSH_MANUAL_MARKER = join6(TERMINALHIRE_DIR4, "claim-push.json");
|
|
629
638
|
var CLAIM_SYNC_BASE = resolveApiBase();
|
|
630
639
|
warnSharedCredentialsIfNonProd(CLAIM_SYNC_BASE);
|
|
631
640
|
var AUTO_CONSENT_VERSION = 3;
|
|
@@ -731,7 +740,7 @@ async function shouldNudgeUnpushed() {
|
|
|
731
740
|
return false;
|
|
732
741
|
}
|
|
733
742
|
}
|
|
734
|
-
var CLAIM_HEARTBEAT_FILE =
|
|
743
|
+
var CLAIM_HEARTBEAT_FILE = join6(TERMINALHIRE_DIR4, "claim-heartbeat.json");
|
|
735
744
|
var HEARTBEAT_MIN_INTERVAL_MS = 3e4;
|
|
736
745
|
var HEARTBEAT_MIN_CONSENT_VERSION = 3;
|
|
737
746
|
function readHeartbeatState() {
|
package/dist/bin/directory.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
// bin/directory.js
|
|
4
4
|
import { readFileSync, writeFileSync, renameSync } from "fs";
|
|
5
|
-
import { join } from "path";
|
|
6
|
-
import { homedir } from "os";
|
|
5
|
+
import { join as join2 } from "path";
|
|
6
|
+
import { homedir as homedir2 } from "os";
|
|
7
7
|
|
|
8
8
|
// src/state-dir.ts
|
|
9
9
|
import { closeSync, constants, fchmodSync, fstatSync, mkdirSync, openSync } from "fs";
|
|
@@ -54,6 +54,8 @@ function ensureStateDir(dir) {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
// src/api-base.ts
|
|
57
|
+
import { homedir } from "os";
|
|
58
|
+
import { join } from "path";
|
|
57
59
|
var PROD_API_BASE = "https://terminalhire.com";
|
|
58
60
|
var DEV_API_BASE = "https://dev.terminalhire.com";
|
|
59
61
|
var ApiBaseError = class extends Error {
|
|
@@ -146,9 +148,9 @@ function normalizeOverride(raw) {
|
|
|
146
148
|
}
|
|
147
149
|
|
|
148
150
|
// bin/directory.js
|
|
149
|
-
var TERMINALHIRE_DIR = process.env.TERMINALHIRE_DIR ||
|
|
150
|
-
var DIRECTORY_CACHE_FILE =
|
|
151
|
-
var PROJECT_FILE =
|
|
151
|
+
var TERMINALHIRE_DIR = process.env.TERMINALHIRE_DIR || join2(homedir2(), ".terminalhire");
|
|
152
|
+
var DIRECTORY_CACHE_FILE = join2(TERMINALHIRE_DIR, "directory-cache.json");
|
|
153
|
+
var PROJECT_FILE = join2(TERMINALHIRE_DIR, "project.json");
|
|
152
154
|
var INDEX_TTL_MS = 15 * 60 * 1e3;
|
|
153
155
|
var API_URL = resolveApiBase();
|
|
154
156
|
function readDirectoryCache() {
|
package/dist/bin/jpi-bounties.js
CHANGED
|
@@ -10562,17 +10562,17 @@ var init_founder_pin = __esm({
|
|
|
10562
10562
|
|
|
10563
10563
|
// src/test-race-barrier.ts
|
|
10564
10564
|
import { closeSync as closeSync2, constants as constants2, existsSync, lstatSync, openSync as openSync2 } from "fs";
|
|
10565
|
-
import { join as
|
|
10565
|
+
import { join as join4 } from "path";
|
|
10566
10566
|
function syncSleepMs(ms) {
|
|
10567
10567
|
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
|
|
10568
10568
|
}
|
|
10569
10569
|
function waitForTestRaceBarrier(phase) {
|
|
10570
10570
|
const root = process.env[ENV_VAR];
|
|
10571
10571
|
if (!root) return;
|
|
10572
|
-
const phaseDir =
|
|
10572
|
+
const phaseDir = join4(root, phase);
|
|
10573
10573
|
if (!existsSync(phaseDir)) return;
|
|
10574
|
-
const readyFile =
|
|
10575
|
-
const goFile =
|
|
10574
|
+
const readyFile = join4(phaseDir, `ready-${process.pid}`);
|
|
10575
|
+
const goFile = join4(phaseDir, "go");
|
|
10576
10576
|
const noFollow = constants2.O_NOFOLLOW ?? 0;
|
|
10577
10577
|
if (lstatSync(readyFile, { throwIfNoEntry: false })) {
|
|
10578
10578
|
throw new Error(
|
|
@@ -10612,8 +10612,8 @@ var init_test_race_barrier = __esm({
|
|
|
10612
10612
|
// src/shared-key.ts
|
|
10613
10613
|
import { randomBytes as randomBytes3 } from "crypto";
|
|
10614
10614
|
import { readFileSync as readFileSync3, writeFileSync as writeFileSync2, existsSync as existsSync2, linkSync, unlinkSync } from "fs";
|
|
10615
|
-
import { join as
|
|
10616
|
-
import { homedir as
|
|
10615
|
+
import { join as join5 } from "path";
|
|
10616
|
+
import { homedir as homedir3 } from "os";
|
|
10617
10617
|
function isValidKeyHex(value) {
|
|
10618
10618
|
return KEY_HEX_RE.test(value);
|
|
10619
10619
|
}
|
|
@@ -10667,8 +10667,8 @@ var init_shared_key = __esm({
|
|
|
10667
10667
|
"use strict";
|
|
10668
10668
|
init_state_dir();
|
|
10669
10669
|
init_test_race_barrier();
|
|
10670
|
-
TERMINALHIRE_DIR2 = process.env.TERMINALHIRE_DIR ||
|
|
10671
|
-
KEY_FILE =
|
|
10670
|
+
TERMINALHIRE_DIR2 = process.env.TERMINALHIRE_DIR || join5(homedir3(), ".terminalhire");
|
|
10671
|
+
KEY_FILE = join5(TERMINALHIRE_DIR2, "key");
|
|
10672
10672
|
KEY_BYTES = 32;
|
|
10673
10673
|
KEY_HEX_RE = new RegExp(`^[0-9a-f]{${KEY_BYTES * 2}}$`);
|
|
10674
10674
|
}
|
|
@@ -10677,7 +10677,7 @@ var init_shared_key = __esm({
|
|
|
10677
10677
|
// src/crypto-store.ts
|
|
10678
10678
|
import { createCipheriv, createDecipheriv, randomBytes as randomBytes4 } from "crypto";
|
|
10679
10679
|
import { readFileSync as readFileSync4, writeFileSync as writeFileSync3, existsSync as existsSync3, renameSync as renameSync2, rmSync, readdirSync } from "fs";
|
|
10680
|
-
import { join as
|
|
10680
|
+
import { join as join6, dirname, basename } from "path";
|
|
10681
10681
|
import { createRequire } from "module";
|
|
10682
10682
|
function encrypt(plaintext, key) {
|
|
10683
10683
|
const iv = randomBytes4(IV_BYTES);
|
|
@@ -10732,7 +10732,7 @@ function makeWarnOnce() {
|
|
|
10732
10732
|
function atomicWriteFileSync(filePath, content) {
|
|
10733
10733
|
const dir = dirname(filePath);
|
|
10734
10734
|
ensureStateDirForSecret(dir);
|
|
10735
|
-
const tmp =
|
|
10735
|
+
const tmp = join6(
|
|
10736
10736
|
dir,
|
|
10737
10737
|
`.${basename(filePath)}.tmp-${process.pid}-${randomBytes4(6).toString("hex")}`
|
|
10738
10738
|
);
|
|
@@ -10750,7 +10750,7 @@ async function deleteKey() {
|
|
|
10750
10750
|
}
|
|
10751
10751
|
for (const name of encFiles) {
|
|
10752
10752
|
try {
|
|
10753
|
-
rmSync(
|
|
10753
|
+
rmSync(join6(stateDir, name));
|
|
10754
10754
|
} catch (e) {
|
|
10755
10755
|
const code = e.code;
|
|
10756
10756
|
if (code !== "ENOENT") {
|
|
@@ -10841,8 +10841,8 @@ __export(profile_exports, {
|
|
|
10841
10841
|
removeSavedJob: () => removeSavedJob,
|
|
10842
10842
|
writeProfile: () => writeProfile
|
|
10843
10843
|
});
|
|
10844
|
-
import { join as
|
|
10845
|
-
import { homedir as
|
|
10844
|
+
import { join as join7 } from "path";
|
|
10845
|
+
import { homedir as homedir4 } from "os";
|
|
10846
10846
|
function blankProfile() {
|
|
10847
10847
|
return {
|
|
10848
10848
|
version: 3,
|
|
@@ -10975,8 +10975,8 @@ var init_profile = __esm({
|
|
|
10975
10975
|
"use strict";
|
|
10976
10976
|
init_src();
|
|
10977
10977
|
init_crypto_store();
|
|
10978
|
-
TERMINALHIRE_DIR3 = process.env.TERMINALHIRE_DIR ||
|
|
10979
|
-
PROFILE_FILE =
|
|
10978
|
+
TERMINALHIRE_DIR3 = process.env.TERMINALHIRE_DIR || join7(homedir4(), ".terminalhire");
|
|
10979
|
+
PROFILE_FILE = join7(TERMINALHIRE_DIR3, "profile.enc");
|
|
10980
10980
|
profileStore = createEncryptedStore(PROFILE_FILE, {
|
|
10981
10981
|
blank: blankProfile,
|
|
10982
10982
|
keyPolicy: "keytar-first-file-fallback"
|
|
@@ -11028,8 +11028,8 @@ __export(repo_experience_exports, {
|
|
|
11028
11028
|
recordPolicySnapshot: () => recordPolicySnapshot,
|
|
11029
11029
|
writeTombstone: () => writeTombstone
|
|
11030
11030
|
});
|
|
11031
|
-
import { join as
|
|
11032
|
-
import { homedir as
|
|
11031
|
+
import { join as join8 } from "path";
|
|
11032
|
+
import { homedir as homedir5 } from "os";
|
|
11033
11033
|
function blankFile() {
|
|
11034
11034
|
return { version: 1, repos: {} };
|
|
11035
11035
|
}
|
|
@@ -11236,8 +11236,8 @@ var init_repo_experience = __esm({
|
|
|
11236
11236
|
"use strict";
|
|
11237
11237
|
init_crypto_store();
|
|
11238
11238
|
init_profile();
|
|
11239
|
-
TERMINALHIRE_DIR4 = process.env.TERMINALHIRE_DIR ||
|
|
11240
|
-
REPO_EXPERIENCE_FILE =
|
|
11239
|
+
TERMINALHIRE_DIR4 = process.env.TERMINALHIRE_DIR || join8(homedir5(), ".terminalhire");
|
|
11240
|
+
REPO_EXPERIENCE_FILE = join8(TERMINALHIRE_DIR4, "repo-experience.enc");
|
|
11241
11241
|
MAX_REPOS = 100;
|
|
11242
11242
|
MAX_CULTURE_SAMPLES = 12;
|
|
11243
11243
|
MAX_NOTES = 10;
|
|
@@ -11278,8 +11278,8 @@ import {
|
|
|
11278
11278
|
statSync
|
|
11279
11279
|
} from "fs";
|
|
11280
11280
|
import { randomBytes as randomBytes5 } from "crypto";
|
|
11281
|
-
import { join as
|
|
11282
|
-
import { homedir as
|
|
11281
|
+
import { join as join9 } from "path";
|
|
11282
|
+
import { homedir as homedir6 } from "os";
|
|
11283
11283
|
function sleepSync(ms) {
|
|
11284
11284
|
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
|
|
11285
11285
|
}
|
|
@@ -11473,8 +11473,8 @@ var init_claims = __esm({
|
|
|
11473
11473
|
"src/claims.ts"() {
|
|
11474
11474
|
"use strict";
|
|
11475
11475
|
init_state_dir();
|
|
11476
|
-
TERMINALHIRE_DIR5 = process.env.TERMINALHIRE_DIR ||
|
|
11477
|
-
CLAIMS_FILE =
|
|
11476
|
+
TERMINALHIRE_DIR5 = process.env.TERMINALHIRE_DIR || join9(homedir6(), ".terminalhire");
|
|
11477
|
+
CLAIMS_FILE = join9(TERMINALHIRE_DIR5, "claims.json");
|
|
11478
11478
|
LOCK_DIR = `${CLAIMS_FILE}.lock`;
|
|
11479
11479
|
LOCK_STALE_MS = Number(process.env.TERMINALHIRE_LOCK_STALE_MS) || 1e4;
|
|
11480
11480
|
LOCK_RETRY_MS = Number(process.env.TERMINALHIRE_LOCK_RETRY_MS) || 25;
|
|
@@ -11547,8 +11547,8 @@ __export(config_exports, {
|
|
|
11547
11547
|
writeConfig: () => writeConfig
|
|
11548
11548
|
});
|
|
11549
11549
|
import { readFileSync as readFileSync6, writeFileSync as writeFileSync5, existsSync as existsSync5 } from "fs";
|
|
11550
|
-
import { join as
|
|
11551
|
-
import { homedir as
|
|
11550
|
+
import { join as join10 } from "path";
|
|
11551
|
+
import { homedir as homedir7 } from "os";
|
|
11552
11552
|
function readConfig() {
|
|
11553
11553
|
try {
|
|
11554
11554
|
if (!existsSync5(CONFIG_FILE)) return { ...DEFAULT_CONFIG };
|
|
@@ -11630,8 +11630,8 @@ var init_config = __esm({
|
|
|
11630
11630
|
"src/config.ts"() {
|
|
11631
11631
|
"use strict";
|
|
11632
11632
|
init_state_dir();
|
|
11633
|
-
TERMINALHIRE_DIR6 = process.env.TERMINALHIRE_DIR ||
|
|
11634
|
-
CONFIG_FILE =
|
|
11633
|
+
TERMINALHIRE_DIR6 = process.env.TERMINALHIRE_DIR || join10(homedir7(), ".terminalhire");
|
|
11634
|
+
CONFIG_FILE = join10(TERMINALHIRE_DIR6, "config.json");
|
|
11635
11635
|
DEFAULT_CONFIG = {
|
|
11636
11636
|
nudge: "session",
|
|
11637
11637
|
peerConnect: false,
|
|
@@ -11756,13 +11756,13 @@ __export(web_session_exports, {
|
|
|
11756
11756
|
writeWebSessionFile: () => writeWebSessionFile
|
|
11757
11757
|
});
|
|
11758
11758
|
import { chmodSync, existsSync as existsSync6, readFileSync as readFileSync7, rmSync as rmSync3, writeFileSync as writeFileSync6 } from "fs";
|
|
11759
|
-
import { homedir as
|
|
11760
|
-
import { join as
|
|
11759
|
+
import { homedir as homedir8 } from "os";
|
|
11760
|
+
import { join as join11 } from "path";
|
|
11761
11761
|
function terminalhireDir() {
|
|
11762
|
-
return process.env.TERMINALHIRE_DIR ||
|
|
11762
|
+
return process.env.TERMINALHIRE_DIR || join11(homedir8(), ".terminalhire");
|
|
11763
11763
|
}
|
|
11764
11764
|
function webSessionFilePath() {
|
|
11765
|
-
return
|
|
11765
|
+
return join11(terminalhireDir(), "web-session");
|
|
11766
11766
|
}
|
|
11767
11767
|
function parseWebSessionFile(raw) {
|
|
11768
11768
|
const trimmed = raw.trim();
|
|
@@ -11850,13 +11850,13 @@ __export(jpi_decline_exports, {
|
|
|
11850
11850
|
});
|
|
11851
11851
|
import { createInterface } from "readline";
|
|
11852
11852
|
import { existsSync as existsSync7, readFileSync as readFileSync8, writeFileSync as writeFileSync7, rmSync as rmSync4 } from "fs";
|
|
11853
|
-
import { homedir as
|
|
11854
|
-
import { join as
|
|
11853
|
+
import { homedir as homedir9 } from "os";
|
|
11854
|
+
import { join as join12 } from "path";
|
|
11855
11855
|
function terminalhireDir2() {
|
|
11856
|
-
return process.env.TERMINALHIRE_DIR ||
|
|
11856
|
+
return process.env.TERMINALHIRE_DIR || join12(homedir9(), ".terminalhire");
|
|
11857
11857
|
}
|
|
11858
11858
|
function consentFilePath() {
|
|
11859
|
-
return
|
|
11859
|
+
return join12(terminalhireDir2(), "decline-consent");
|
|
11860
11860
|
}
|
|
11861
11861
|
function postingIdFromJobId(jobId) {
|
|
11862
11862
|
const id = String(jobId ?? "");
|
|
@@ -11994,8 +11994,8 @@ var init_jpi_decline = __esm({
|
|
|
11994
11994
|
// bin/jpi-bounties.js
|
|
11995
11995
|
init_src();
|
|
11996
11996
|
import { readFileSync as readFileSync9 } from "fs";
|
|
11997
|
-
import { join as
|
|
11998
|
-
import { homedir as
|
|
11997
|
+
import { join as join13 } from "path";
|
|
11998
|
+
import { homedir as homedir10 } from "os";
|
|
11999
11999
|
import { createInterface as createInterface2 } from "readline";
|
|
12000
12000
|
|
|
12001
12001
|
// ../../packages/core/src/payout-split.ts
|
|
@@ -12212,6 +12212,8 @@ function linkTitle(title, url) {
|
|
|
12212
12212
|
}
|
|
12213
12213
|
|
|
12214
12214
|
// src/api-base.ts
|
|
12215
|
+
import { homedir as homedir2 } from "os";
|
|
12216
|
+
import { join as join3 } from "path";
|
|
12215
12217
|
var PROD_API_BASE = "https://terminalhire.com";
|
|
12216
12218
|
var DEV_API_BASE = "https://dev.terminalhire.com";
|
|
12217
12219
|
var ApiBaseError = class extends Error {
|
|
@@ -12305,8 +12307,8 @@ function normalizeOverride(raw) {
|
|
|
12305
12307
|
|
|
12306
12308
|
// bin/jpi-bounties.js
|
|
12307
12309
|
init_founder_pin();
|
|
12308
|
-
var TERMINALHIRE_DIR7 = process.env.TERMINALHIRE_DIR ||
|
|
12309
|
-
var INDEX_CACHE_FILE2 =
|
|
12310
|
+
var TERMINALHIRE_DIR7 = process.env.TERMINALHIRE_DIR || join13(homedir10(), ".terminalhire");
|
|
12311
|
+
var INDEX_CACHE_FILE2 = join13(TERMINALHIRE_DIR7, "index-cache.json");
|
|
12310
12312
|
var INDEX_TTL_MS = 15 * 60 * 1e3;
|
|
12311
12313
|
var API_URL2 = resolveApiBase();
|
|
12312
12314
|
var RANK_MODE = process.env["TERMINALHIRE_BOUNTY_RANK"] ?? "winnability";
|
|
@@ -4631,6 +4631,8 @@ var init_web_session = __esm({
|
|
|
4631
4631
|
});
|
|
4632
4632
|
|
|
4633
4633
|
// src/api-base.ts
|
|
4634
|
+
import { homedir as homedir5 } from "os";
|
|
4635
|
+
import { join as join7 } from "path";
|
|
4634
4636
|
function sanitizeOverrideForError(raw) {
|
|
4635
4637
|
try {
|
|
4636
4638
|
const url = new URL(raw);
|
|
@@ -4730,8 +4732,8 @@ var init_api_base = __esm({
|
|
|
4730
4732
|
|
|
4731
4733
|
// src/chat-client.ts
|
|
4732
4734
|
import { existsSync as existsSync6, readFileSync as readFileSync6, writeFileSync as writeFileSync5 } from "fs";
|
|
4733
|
-
import { homedir as
|
|
4734
|
-
import { join as
|
|
4735
|
+
import { homedir as homedir6 } from "os";
|
|
4736
|
+
import { join as join8 } from "path";
|
|
4735
4737
|
function defaultReadPeerPins() {
|
|
4736
4738
|
try {
|
|
4737
4739
|
if (!existsSync6(PEERS_FILE)) return {};
|
|
@@ -4936,8 +4938,8 @@ var init_chat_client = __esm({
|
|
|
4936
4938
|
init_api_base();
|
|
4937
4939
|
CHAT_BASE = resolveApiBase();
|
|
4938
4940
|
GH_SESSION_COOKIE = "__jpi_gh_session";
|
|
4939
|
-
TERMINALHIRE_DIR4 = process.env.TERMINALHIRE_DIR ||
|
|
4940
|
-
PEERS_FILE =
|
|
4941
|
+
TERMINALHIRE_DIR4 = process.env.TERMINALHIRE_DIR || join8(homedir6(), ".terminalhire");
|
|
4942
|
+
PEERS_FILE = join8(TERMINALHIRE_DIR4, "chat-peers.json");
|
|
4941
4943
|
REQUEST_TIMEOUT_MS = 1e4;
|
|
4942
4944
|
ChatNotLinkedError = class extends Error {
|
|
4943
4945
|
constructor() {
|
|
@@ -4982,8 +4984,8 @@ var init_chat_client = __esm({
|
|
|
4982
4984
|
|
|
4983
4985
|
// src/config.ts
|
|
4984
4986
|
import { readFileSync as readFileSync7, writeFileSync as writeFileSync6, existsSync as existsSync7 } from "fs";
|
|
4985
|
-
import { join as
|
|
4986
|
-
import { homedir as
|
|
4987
|
+
import { join as join9 } from "path";
|
|
4988
|
+
import { homedir as homedir7 } from "os";
|
|
4987
4989
|
function readConfig() {
|
|
4988
4990
|
try {
|
|
4989
4991
|
if (!existsSync7(CONFIG_FILE)) return { ...DEFAULT_CONFIG };
|
|
@@ -5011,8 +5013,8 @@ var init_config = __esm({
|
|
|
5011
5013
|
"src/config.ts"() {
|
|
5012
5014
|
"use strict";
|
|
5013
5015
|
init_state_dir();
|
|
5014
|
-
TERMINALHIRE_DIR5 = process.env.TERMINALHIRE_DIR ||
|
|
5015
|
-
CONFIG_FILE =
|
|
5016
|
+
TERMINALHIRE_DIR5 = process.env.TERMINALHIRE_DIR || join9(homedir7(), ".terminalhire");
|
|
5017
|
+
CONFIG_FILE = join9(TERMINALHIRE_DIR5, "config.json");
|
|
5016
5018
|
DEFAULT_CONFIG = {
|
|
5017
5019
|
nudge: "session",
|
|
5018
5020
|
peerConnect: false,
|
|
@@ -5084,11 +5086,18 @@ var init_tui_core = __esm({
|
|
|
5084
5086
|
}
|
|
5085
5087
|
});
|
|
5086
5088
|
|
|
5089
|
+
// bin/session-case.js
|
|
5090
|
+
var init_session_case = __esm({
|
|
5091
|
+
"bin/session-case.js"() {
|
|
5092
|
+
"use strict";
|
|
5093
|
+
}
|
|
5094
|
+
});
|
|
5095
|
+
|
|
5087
5096
|
// bin/jpi-chat.js
|
|
5088
5097
|
import { createInterface } from "readline";
|
|
5089
5098
|
import { existsSync as existsSync8, readFileSync as readFileSync8 } from "fs";
|
|
5090
|
-
import { homedir as
|
|
5091
|
-
import { join as
|
|
5099
|
+
import { homedir as homedir8 } from "os";
|
|
5100
|
+
import { join as join10 } from "path";
|
|
5092
5101
|
function defaultPromptAck({ input = process.stdin, output = process.stdout } = {}) {
|
|
5093
5102
|
if (!input || input.isTTY !== true) return Promise.resolve(false);
|
|
5094
5103
|
const rl = createInterface({ input, output });
|
|
@@ -5216,6 +5225,7 @@ var init_jpi_chat = __esm({
|
|
|
5216
5225
|
init_web_session();
|
|
5217
5226
|
init_api_base();
|
|
5218
5227
|
init_tui_core();
|
|
5228
|
+
init_session_case();
|
|
5219
5229
|
CHAT_BASE2 = resolveApiBase();
|
|
5220
5230
|
GH_SESSION_COOKIE2 = "__jpi_gh_session";
|
|
5221
5231
|
CHAT_DISCLOSURE = "Messages are end-to-end encrypted using keys stored only on your device. Our server cannot read message content. Since we distribute your contact's public key, verify your connection by comparing Safety Numbers to rule out a server-side substitution. We store metadata: who messaged whom, when, and message count. Content is purged after 90 days.";
|
|
@@ -5228,8 +5238,8 @@ var init_jpi_chat = __esm({
|
|
|
5228
5238
|
|
|
5229
5239
|
// bin/jpi-chat-read.js
|
|
5230
5240
|
import { existsSync as existsSync9, readFileSync as readFileSync9, writeFileSync as writeFileSync7 } from "fs";
|
|
5231
|
-
import { homedir as
|
|
5232
|
-
import { join as
|
|
5241
|
+
import { homedir as homedir9 } from "os";
|
|
5242
|
+
import { join as join11 } from "path";
|
|
5233
5243
|
async function syncUnreadBadge(deps = {}) {
|
|
5234
5244
|
const readCookie = deps.readCookie ?? readWebSessionCookie;
|
|
5235
5245
|
const fetchImpl = deps.fetchImpl ?? globalThis.fetch;
|
|
@@ -5635,9 +5645,9 @@ var init_jpi_chat_read = __esm({
|
|
|
5635
5645
|
init_api_base();
|
|
5636
5646
|
CHAT_BASE3 = resolveApiBase();
|
|
5637
5647
|
GH_SESSION_COOKIE3 = "__jpi_gh_session";
|
|
5638
|
-
TERMINALHIRE_DIR6 = process.env.TERMINALHIRE_DIR ||
|
|
5639
|
-
READS_FILE =
|
|
5640
|
-
INDEX_CACHE_FILE =
|
|
5648
|
+
TERMINALHIRE_DIR6 = process.env.TERMINALHIRE_DIR || join11(homedir9(), ".terminalhire");
|
|
5649
|
+
READS_FILE = join11(TERMINALHIRE_DIR6, "chat-reads.json");
|
|
5650
|
+
INDEX_CACHE_FILE = join11(TERMINALHIRE_DIR6, "index-cache.json");
|
|
5641
5651
|
REACHABLE_DISPLAY = { shareActivity: false, optin: false, lastSeen: null };
|
|
5642
5652
|
}
|
|
5643
5653
|
});
|