terminalhire 0.40.9 → 0.40.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.
- package/dist/bin/founder-surface.js +47 -0
- package/dist/bin/jpi-bounties.js +240 -36
- package/dist/bin/jpi-chat-read.js +30 -30
- package/dist/bin/jpi-chat.js +30 -30
- package/dist/bin/jpi-claim.js +247 -246
- package/dist/bin/jpi-config.js +29 -0
- package/dist/bin/jpi-devs.js +31 -30
- package/dist/bin/jpi-dispatch.js +1677 -984
- package/dist/bin/jpi-hub.js +31 -30
- package/dist/bin/jpi-inbox.js +30 -30
- package/dist/bin/jpi-init.js +31 -30
- package/dist/bin/jpi-jobs.js +262 -101
- package/dist/bin/jpi-login.js +31 -30
- package/dist/bin/jpi-mcp-chat.js +468 -468
- package/dist/bin/jpi-mcp.js +694 -684
- package/dist/bin/jpi-post.js +559 -0
- package/dist/bin/jpi-project.js +31 -30
- package/dist/bin/jpi-refresh.js +140 -32
- package/dist/bin/jpi-statusline.js +21 -0
- package/dist/src/chat-client.js +15 -15
- package/dist/src/chat-keystore.js +11 -11
- package/dist/src/config.js +9 -0
- package/dist/src/posting-drafts.js +264 -0
- package/dist/src/repo-policy-semantic.js +216 -216
- package/package.json +1 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// bin/founder-surface.js
|
|
2
|
+
function projectFounderSurface(body) {
|
|
3
|
+
if (!body || body.ok !== true || !Array.isArray(body.postings)) return null;
|
|
4
|
+
const statusline = body.statusline;
|
|
5
|
+
if (!statusline || typeof statusline.needsYouCount !== "number" || typeof statusline.openPostingCount !== "number" || typeof statusline.refreshedAt !== "string") {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
const postings = [];
|
|
9
|
+
for (const raw of body.postings) {
|
|
10
|
+
if (!raw || typeof raw.id !== "string" || typeof raw.title !== "string" || typeof raw.status !== "string" || typeof raw.needsYou !== "boolean" || typeof raw.claimantCount !== "number" || typeof raw.postedAt !== "string") {
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
postings.push({
|
|
14
|
+
id: raw.id,
|
|
15
|
+
title: raw.title,
|
|
16
|
+
status: raw.status,
|
|
17
|
+
needsYou: raw.needsYou,
|
|
18
|
+
claimantCount: raw.claimantCount,
|
|
19
|
+
postedAt: raw.postedAt
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
postings,
|
|
24
|
+
needsYouCount: Math.max(0, statusline.needsYouCount),
|
|
25
|
+
openPostingCount: Math.max(0, statusline.openPostingCount),
|
|
26
|
+
refreshedAt: statusline.refreshedAt
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function resolveSurfaceLead(override, founderSurface) {
|
|
30
|
+
if (override === "dev" || override === "founder") return override;
|
|
31
|
+
if (founderSurface && (founderSurface.openPostingCount > 0 || founderSurface.needsYouCount > 0)) {
|
|
32
|
+
return "founder";
|
|
33
|
+
}
|
|
34
|
+
return "dev";
|
|
35
|
+
}
|
|
36
|
+
function founderRows(surface, kind) {
|
|
37
|
+
if (!surface || !Array.isArray(surface.postings)) return [];
|
|
38
|
+
if (kind === "jobs") {
|
|
39
|
+
return surface.postings.filter((posting) => posting.status === "open" || posting.needsYou);
|
|
40
|
+
}
|
|
41
|
+
return surface.postings;
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
founderRows,
|
|
45
|
+
projectFounderSurface,
|
|
46
|
+
resolveSurfaceLead
|
|
47
|
+
};
|
package/dist/bin/jpi-bounties.js
CHANGED
|
@@ -5367,17 +5367,17 @@ var init_directoryThreshold = __esm({
|
|
|
5367
5367
|
}
|
|
5368
5368
|
});
|
|
5369
5369
|
|
|
5370
|
-
//
|
|
5370
|
+
// ../../node_modules/@noble/hashes/esm/cryptoNode.js
|
|
5371
5371
|
import * as nc from "crypto";
|
|
5372
5372
|
var crypto;
|
|
5373
5373
|
var init_cryptoNode = __esm({
|
|
5374
|
-
"
|
|
5374
|
+
"../../node_modules/@noble/hashes/esm/cryptoNode.js"() {
|
|
5375
5375
|
"use strict";
|
|
5376
5376
|
crypto = nc && typeof nc === "object" && "webcrypto" in nc ? nc.webcrypto : nc && typeof nc === "object" && "randomBytes" in nc ? nc : void 0;
|
|
5377
5377
|
}
|
|
5378
5378
|
});
|
|
5379
5379
|
|
|
5380
|
-
//
|
|
5380
|
+
// ../../node_modules/@noble/hashes/esm/utils.js
|
|
5381
5381
|
function isBytes(a) {
|
|
5382
5382
|
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
|
|
5383
5383
|
}
|
|
@@ -5497,7 +5497,7 @@ function randomBytes(bytesLength = 32) {
|
|
|
5497
5497
|
}
|
|
5498
5498
|
var hasHexBuiltin, hexes, asciis, Hash;
|
|
5499
5499
|
var init_utils = __esm({
|
|
5500
|
-
"
|
|
5500
|
+
"../../node_modules/@noble/hashes/esm/utils.js"() {
|
|
5501
5501
|
"use strict";
|
|
5502
5502
|
init_cryptoNode();
|
|
5503
5503
|
hasHexBuiltin = /* @__PURE__ */ (() => (
|
|
@@ -5511,7 +5511,7 @@ var init_utils = __esm({
|
|
|
5511
5511
|
}
|
|
5512
5512
|
});
|
|
5513
5513
|
|
|
5514
|
-
//
|
|
5514
|
+
// ../../node_modules/@noble/hashes/esm/_md.js
|
|
5515
5515
|
function setBigUint64(view, byteOffset, value, isLE2) {
|
|
5516
5516
|
if (typeof view.setBigUint64 === "function")
|
|
5517
5517
|
return view.setBigUint64(byteOffset, value, isLE2);
|
|
@@ -5526,7 +5526,7 @@ function setBigUint64(view, byteOffset, value, isLE2) {
|
|
|
5526
5526
|
}
|
|
5527
5527
|
var HashMD, SHA512_IV;
|
|
5528
5528
|
var init_md = __esm({
|
|
5529
|
-
"
|
|
5529
|
+
"../../node_modules/@noble/hashes/esm/_md.js"() {
|
|
5530
5530
|
"use strict";
|
|
5531
5531
|
init_utils();
|
|
5532
5532
|
HashMD = class extends Hash {
|
|
@@ -5640,7 +5640,7 @@ var init_md = __esm({
|
|
|
5640
5640
|
}
|
|
5641
5641
|
});
|
|
5642
5642
|
|
|
5643
|
-
//
|
|
5643
|
+
// ../../node_modules/@noble/hashes/esm/_u64.js
|
|
5644
5644
|
function fromBig(n, le = false) {
|
|
5645
5645
|
if (le)
|
|
5646
5646
|
return { h: Number(n & U32_MASK64), l: Number(n >> _32n & U32_MASK64) };
|
|
@@ -5662,7 +5662,7 @@ function add(Ah, Al, Bh, Bl) {
|
|
|
5662
5662
|
}
|
|
5663
5663
|
var U32_MASK64, _32n, shrSH, shrSL, rotrSH, rotrSL, rotrBH, rotrBL, add3L, add3H, add4L, add4H, add5L, add5H;
|
|
5664
5664
|
var init_u64 = __esm({
|
|
5665
|
-
"
|
|
5665
|
+
"../../node_modules/@noble/hashes/esm/_u64.js"() {
|
|
5666
5666
|
"use strict";
|
|
5667
5667
|
U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
|
|
5668
5668
|
_32n = /* @__PURE__ */ BigInt(32);
|
|
@@ -5681,10 +5681,10 @@ var init_u64 = __esm({
|
|
|
5681
5681
|
}
|
|
5682
5682
|
});
|
|
5683
5683
|
|
|
5684
|
-
//
|
|
5684
|
+
// ../../node_modules/@noble/hashes/esm/sha2.js
|
|
5685
5685
|
var K512, SHA512_Kh, SHA512_Kl, SHA512_W_H, SHA512_W_L, SHA512, sha512;
|
|
5686
5686
|
var init_sha2 = __esm({
|
|
5687
|
-
"
|
|
5687
|
+
"../../node_modules/@noble/hashes/esm/sha2.js"() {
|
|
5688
5688
|
"use strict";
|
|
5689
5689
|
init_md();
|
|
5690
5690
|
init_u64();
|
|
@@ -5890,7 +5890,7 @@ var init_sha2 = __esm({
|
|
|
5890
5890
|
}
|
|
5891
5891
|
});
|
|
5892
5892
|
|
|
5893
|
-
//
|
|
5893
|
+
// ../../node_modules/@noble/curves/esm/utils.js
|
|
5894
5894
|
function _abool2(value, title = "") {
|
|
5895
5895
|
if (typeof value !== "boolean") {
|
|
5896
5896
|
const prefix = title && `"${title}"`;
|
|
@@ -5997,7 +5997,7 @@ function memoized(fn) {
|
|
|
5997
5997
|
}
|
|
5998
5998
|
var _0n, _1n, isPosBig, bitMask, notImplemented;
|
|
5999
5999
|
var init_utils2 = __esm({
|
|
6000
|
-
"
|
|
6000
|
+
"../../node_modules/@noble/curves/esm/utils.js"() {
|
|
6001
6001
|
"use strict";
|
|
6002
6002
|
init_utils();
|
|
6003
6003
|
init_utils();
|
|
@@ -6011,7 +6011,7 @@ var init_utils2 = __esm({
|
|
|
6011
6011
|
}
|
|
6012
6012
|
});
|
|
6013
6013
|
|
|
6014
|
-
//
|
|
6014
|
+
// ../../node_modules/@noble/curves/esm/abstract/modular.js
|
|
6015
6015
|
function mod(a, b) {
|
|
6016
6016
|
const result = a % b;
|
|
6017
6017
|
return result >= _0n2 ? result : b + result;
|
|
@@ -6308,7 +6308,7 @@ function Field(ORDER, bitLenOrOpts, isLE2 = false, opts = {}) {
|
|
|
6308
6308
|
}
|
|
6309
6309
|
var _0n2, _1n2, _2n, _3n, _4n, _5n, _7n, _8n, _9n, _16n, isNegativeLE, FIELD_FIELDS;
|
|
6310
6310
|
var init_modular = __esm({
|
|
6311
|
-
"
|
|
6311
|
+
"../../node_modules/@noble/curves/esm/abstract/modular.js"() {
|
|
6312
6312
|
"use strict";
|
|
6313
6313
|
init_utils2();
|
|
6314
6314
|
_0n2 = BigInt(0);
|
|
@@ -6344,7 +6344,7 @@ var init_modular = __esm({
|
|
|
6344
6344
|
}
|
|
6345
6345
|
});
|
|
6346
6346
|
|
|
6347
|
-
//
|
|
6347
|
+
// ../../node_modules/@noble/curves/esm/abstract/curve.js
|
|
6348
6348
|
function negateCt(condition, item) {
|
|
6349
6349
|
const neg = item.negate();
|
|
6350
6350
|
return condition ? neg : item;
|
|
@@ -6477,7 +6477,7 @@ function _createCurveFields(type, CURVE, curveOpts = {}, FpFnLE) {
|
|
|
6477
6477
|
}
|
|
6478
6478
|
var _0n3, _1n3, pointPrecomputes, pointWindowSizes, wNAF;
|
|
6479
6479
|
var init_curve = __esm({
|
|
6480
|
-
"
|
|
6480
|
+
"../../node_modules/@noble/curves/esm/abstract/curve.js"() {
|
|
6481
6481
|
"use strict";
|
|
6482
6482
|
init_utils2();
|
|
6483
6483
|
init_modular();
|
|
@@ -6615,7 +6615,7 @@ var init_curve = __esm({
|
|
|
6615
6615
|
}
|
|
6616
6616
|
});
|
|
6617
6617
|
|
|
6618
|
-
//
|
|
6618
|
+
// ../../node_modules/@noble/curves/esm/abstract/edwards.js
|
|
6619
6619
|
function isEdValidXY(Fp2, CURVE, x, y) {
|
|
6620
6620
|
const x2 = Fp2.sqr(x);
|
|
6621
6621
|
const y2 = Fp2.sqr(y);
|
|
@@ -7096,7 +7096,7 @@ function twistedEdwards(c) {
|
|
|
7096
7096
|
}
|
|
7097
7097
|
var _0n4, _1n4, _2n2, _8n2, PrimeEdwardsPoint;
|
|
7098
7098
|
var init_edwards = __esm({
|
|
7099
|
-
"
|
|
7099
|
+
"../../node_modules/@noble/curves/esm/abstract/edwards.js"() {
|
|
7100
7100
|
"use strict";
|
|
7101
7101
|
init_utils2();
|
|
7102
7102
|
init_curve();
|
|
@@ -7175,7 +7175,7 @@ var init_edwards = __esm({
|
|
|
7175
7175
|
}
|
|
7176
7176
|
});
|
|
7177
7177
|
|
|
7178
|
-
//
|
|
7178
|
+
// ../../node_modules/@noble/curves/esm/abstract/montgomery.js
|
|
7179
7179
|
function validateOpts(curve) {
|
|
7180
7180
|
_validateObject(curve, {
|
|
7181
7181
|
adjustScalarBytes: "function",
|
|
@@ -7293,7 +7293,7 @@ function montgomery(curveDef) {
|
|
|
7293
7293
|
}
|
|
7294
7294
|
var _0n5, _1n5, _2n3;
|
|
7295
7295
|
var init_montgomery = __esm({
|
|
7296
|
-
"
|
|
7296
|
+
"../../node_modules/@noble/curves/esm/abstract/montgomery.js"() {
|
|
7297
7297
|
"use strict";
|
|
7298
7298
|
init_utils2();
|
|
7299
7299
|
init_modular();
|
|
@@ -7303,7 +7303,7 @@ var init_montgomery = __esm({
|
|
|
7303
7303
|
}
|
|
7304
7304
|
});
|
|
7305
7305
|
|
|
7306
|
-
//
|
|
7306
|
+
// ../../node_modules/@noble/curves/esm/ed25519.js
|
|
7307
7307
|
function ed25519_pow_2_252_3(x) {
|
|
7308
7308
|
const _10n = BigInt(10), _20n = BigInt(20), _40n = BigInt(40), _80n = BigInt(80);
|
|
7309
7309
|
const P = ed25519_CURVE_p;
|
|
@@ -7381,7 +7381,7 @@ function ristretto255_map(bytes) {
|
|
|
7381
7381
|
}
|
|
7382
7382
|
var _0n6, _1n6, _2n4, _3n2, _5n2, _8n3, ed25519_CURVE_p, ed25519_CURVE, ED25519_SQRT_M1, Fp, Fn, ed25519Defaults, ed25519, x25519, SQRT_M1, SQRT_AD_MINUS_ONE, INVSQRT_A_MINUS_D, ONE_MINUS_D_SQ, D_MINUS_ONE_SQ, invertSqrt, MAX_255B, bytes255ToNumberLE, _RistrettoPoint;
|
|
7383
7383
|
var init_ed25519 = __esm({
|
|
7384
|
-
"
|
|
7384
|
+
"../../node_modules/@noble/curves/esm/ed25519.js"() {
|
|
7385
7385
|
"use strict";
|
|
7386
7386
|
init_sha2();
|
|
7387
7387
|
init_utils();
|
|
@@ -7551,7 +7551,7 @@ var init_ed25519 = __esm({
|
|
|
7551
7551
|
}
|
|
7552
7552
|
});
|
|
7553
7553
|
|
|
7554
|
-
//
|
|
7554
|
+
// ../../node_modules/@noble/ciphers/esm/utils.js
|
|
7555
7555
|
function isBytes2(a) {
|
|
7556
7556
|
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
|
|
7557
7557
|
}
|
|
@@ -7658,7 +7658,7 @@ function copyBytes2(bytes) {
|
|
|
7658
7658
|
}
|
|
7659
7659
|
var isLE, wrapCipher;
|
|
7660
7660
|
var init_utils3 = __esm({
|
|
7661
|
-
"
|
|
7661
|
+
"../../node_modules/@noble/ciphers/esm/utils.js"() {
|
|
7662
7662
|
"use strict";
|
|
7663
7663
|
isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68)();
|
|
7664
7664
|
wrapCipher = /* @__NO_SIDE_EFFECTS__ */ (params, constructor) => {
|
|
@@ -7713,7 +7713,7 @@ var init_utils3 = __esm({
|
|
|
7713
7713
|
}
|
|
7714
7714
|
});
|
|
7715
7715
|
|
|
7716
|
-
//
|
|
7716
|
+
// ../../node_modules/@noble/ciphers/esm/_arx.js
|
|
7717
7717
|
function rotl(a, b) {
|
|
7718
7718
|
return a << b | a >>> 32 - b;
|
|
7719
7719
|
}
|
|
@@ -7813,7 +7813,7 @@ function createCipher(core, opts) {
|
|
|
7813
7813
|
}
|
|
7814
7814
|
var _utf8ToBytes, sigma16, sigma32, sigma16_32, sigma32_32, BLOCK_LEN, BLOCK_LEN32, MAX_COUNTER, U32_EMPTY;
|
|
7815
7815
|
var init_arx = __esm({
|
|
7816
|
-
"
|
|
7816
|
+
"../../node_modules/@noble/ciphers/esm/_arx.js"() {
|
|
7817
7817
|
"use strict";
|
|
7818
7818
|
init_utils3();
|
|
7819
7819
|
_utf8ToBytes = (str) => Uint8Array.from(str.split("").map((c) => c.charCodeAt(0)));
|
|
@@ -7828,7 +7828,7 @@ var init_arx = __esm({
|
|
|
7828
7828
|
}
|
|
7829
7829
|
});
|
|
7830
7830
|
|
|
7831
|
-
//
|
|
7831
|
+
// ../../node_modules/@noble/ciphers/esm/_poly1305.js
|
|
7832
7832
|
function wrapConstructorWithKey(hashCons) {
|
|
7833
7833
|
const hashC = (msg, key) => hashCons(key).update(toBytes2(msg)).digest();
|
|
7834
7834
|
const tmp = hashCons(new Uint8Array(32));
|
|
@@ -7839,7 +7839,7 @@ function wrapConstructorWithKey(hashCons) {
|
|
|
7839
7839
|
}
|
|
7840
7840
|
var u8to16, Poly1305, poly1305;
|
|
7841
7841
|
var init_poly1305 = __esm({
|
|
7842
|
-
"
|
|
7842
|
+
"../../node_modules/@noble/ciphers/esm/_poly1305.js"() {
|
|
7843
7843
|
"use strict";
|
|
7844
7844
|
init_utils3();
|
|
7845
7845
|
u8to16 = (a, i) => a[i++] & 255 | (a[i++] & 255) << 8;
|
|
@@ -8090,7 +8090,7 @@ var init_poly1305 = __esm({
|
|
|
8090
8090
|
}
|
|
8091
8091
|
});
|
|
8092
8092
|
|
|
8093
|
-
//
|
|
8093
|
+
// ../../node_modules/@noble/ciphers/esm/chacha.js
|
|
8094
8094
|
function chachaCore(s, k, n, out, cnt, rounds = 20) {
|
|
8095
8095
|
let y00 = s[0], y01 = s[1], y02 = s[2], y03 = s[3], y04 = k[0], y05 = k[1], y06 = k[2], y07 = k[3], y08 = k[4], y09 = k[5], y10 = k[6], y11 = k[7], y12 = cnt, y13 = n[0], y14 = n[1], y15 = n[2];
|
|
8096
8096
|
let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15;
|
|
@@ -8270,7 +8270,7 @@ function computeTag(fn, key, nonce, data, AAD) {
|
|
|
8270
8270
|
}
|
|
8271
8271
|
var chacha20, xchacha20, ZEROS16, updatePadded, ZEROS32, _poly1305_aead, chacha20poly1305, xchacha20poly1305;
|
|
8272
8272
|
var init_chacha = __esm({
|
|
8273
|
-
"
|
|
8273
|
+
"../../node_modules/@noble/ciphers/esm/chacha.js"() {
|
|
8274
8274
|
"use strict";
|
|
8275
8275
|
init_arx();
|
|
8276
8276
|
init_poly1305();
|
|
@@ -10332,6 +10332,7 @@ __export(src_exports, {
|
|
|
10332
10332
|
fetchOwnedRepoTraction: () => fetchOwnedRepoTraction,
|
|
10333
10333
|
fetchPRLifecycle: () => fetchPRLifecycle,
|
|
10334
10334
|
fetchPRScoringFacts: () => fetchPRScoringFacts,
|
|
10335
|
+
fetchPublicOrgs: () => fetchPublicOrgs,
|
|
10335
10336
|
fetchRepoRecency: () => fetchRepoRecency,
|
|
10336
10337
|
fetchRepoReceptivity: () => fetchRepoReceptivity,
|
|
10337
10338
|
fetchRepoStatus: () => fetchRepoStatus,
|
|
@@ -11519,6 +11520,178 @@ var init_claims = __esm({
|
|
|
11519
11520
|
}
|
|
11520
11521
|
});
|
|
11521
11522
|
|
|
11523
|
+
// src/config.ts
|
|
11524
|
+
var config_exports = {};
|
|
11525
|
+
__export(config_exports, {
|
|
11526
|
+
getNudgeMode: () => getNudgeMode,
|
|
11527
|
+
getSurfaceLeadOverride: () => getSurfaceLeadOverride,
|
|
11528
|
+
getSurfaceMix: () => getSurfaceMix,
|
|
11529
|
+
isBetaOptIn: () => isBetaOptIn,
|
|
11530
|
+
isContributeEnabled: () => isContributeEnabled,
|
|
11531
|
+
isInboundNudgeMuted: () => isInboundNudgeMuted,
|
|
11532
|
+
isPeerConnectEnabled: () => isPeerConnectEnabled,
|
|
11533
|
+
parseNudgeMode: () => parseNudgeMode,
|
|
11534
|
+
parseSurfaceLead: () => parseSurfaceLead,
|
|
11535
|
+
parseSurfaceMix: () => parseSurfaceMix,
|
|
11536
|
+
readConfig: () => readConfig,
|
|
11537
|
+
writeConfig: () => writeConfig
|
|
11538
|
+
});
|
|
11539
|
+
import { readFileSync as readFileSync6, writeFileSync as writeFileSync5, existsSync as existsSync5 } from "fs";
|
|
11540
|
+
import { join as join9 } from "path";
|
|
11541
|
+
import { homedir as homedir6 } from "os";
|
|
11542
|
+
function readConfig() {
|
|
11543
|
+
try {
|
|
11544
|
+
if (!existsSync5(CONFIG_FILE)) return { ...DEFAULT_CONFIG };
|
|
11545
|
+
const raw = readFileSync6(CONFIG_FILE, "utf8");
|
|
11546
|
+
const parsed = JSON.parse(raw);
|
|
11547
|
+
return { ...DEFAULT_CONFIG, ...parsed };
|
|
11548
|
+
} catch {
|
|
11549
|
+
return { ...DEFAULT_CONFIG };
|
|
11550
|
+
}
|
|
11551
|
+
}
|
|
11552
|
+
function writeConfig(config) {
|
|
11553
|
+
ensureStateDir(TERMINALHIRE_DIR6);
|
|
11554
|
+
const current = readConfig();
|
|
11555
|
+
const merged = { ...current, ...config };
|
|
11556
|
+
if ("contributePrompted" in merged) {
|
|
11557
|
+
if (merged.contributeEnabled === false && !("contributeEnabled" in config)) {
|
|
11558
|
+
delete merged.contributeEnabled;
|
|
11559
|
+
}
|
|
11560
|
+
delete merged.contributePrompted;
|
|
11561
|
+
}
|
|
11562
|
+
writeFileSync5(CONFIG_FILE, JSON.stringify(merged, null, 2) + "\n", "utf8");
|
|
11563
|
+
}
|
|
11564
|
+
function parseNudgeMode(raw) {
|
|
11565
|
+
if (raw === "session" || raw === "always") return raw;
|
|
11566
|
+
const m = /^every:(\d+)$/.exec(raw);
|
|
11567
|
+
if (m) {
|
|
11568
|
+
const n = parseInt(m[1], 10);
|
|
11569
|
+
if (n >= 1) return `every:${n}`;
|
|
11570
|
+
}
|
|
11571
|
+
return null;
|
|
11572
|
+
}
|
|
11573
|
+
function parseSurfaceMix(raw) {
|
|
11574
|
+
if (raw === "jobs" || raw === "balanced" || raw === "credential") return raw;
|
|
11575
|
+
return null;
|
|
11576
|
+
}
|
|
11577
|
+
function parseSurfaceLead(raw) {
|
|
11578
|
+
return raw === "dev" || raw === "founder" ? raw : null;
|
|
11579
|
+
}
|
|
11580
|
+
function getSurfaceLeadOverride() {
|
|
11581
|
+
const value = readConfig().surfaceLead;
|
|
11582
|
+
return value === "dev" || value === "founder" ? value : void 0;
|
|
11583
|
+
}
|
|
11584
|
+
function getSurfaceMix() {
|
|
11585
|
+
const envVal = process.env["TH_MIX"];
|
|
11586
|
+
if (envVal) {
|
|
11587
|
+
const parsed = parseSurfaceMix(envVal);
|
|
11588
|
+
if (parsed) return parsed;
|
|
11589
|
+
}
|
|
11590
|
+
const config = readConfig();
|
|
11591
|
+
return parseSurfaceMix(config.mix) ?? "balanced";
|
|
11592
|
+
}
|
|
11593
|
+
function getNudgeMode() {
|
|
11594
|
+
const envVal = process.env["TERMINALHIRE_NUDGE"];
|
|
11595
|
+
if (envVal) {
|
|
11596
|
+
const parsed = parseNudgeMode(envVal);
|
|
11597
|
+
if (parsed) return parsed;
|
|
11598
|
+
}
|
|
11599
|
+
const config = readConfig();
|
|
11600
|
+
return config.nudge ?? "session";
|
|
11601
|
+
}
|
|
11602
|
+
function isPeerConnectEnabled() {
|
|
11603
|
+
return readConfig().peerConnect === true;
|
|
11604
|
+
}
|
|
11605
|
+
function isInboundNudgeMuted() {
|
|
11606
|
+
return readConfig().inboundNudgeMuted === true;
|
|
11607
|
+
}
|
|
11608
|
+
function isContributeEnabled() {
|
|
11609
|
+
const cfg = readConfig();
|
|
11610
|
+
return !(cfg.contributeEnabled === false && !("contributePrompted" in cfg));
|
|
11611
|
+
}
|
|
11612
|
+
function isBetaOptIn() {
|
|
11613
|
+
return readConfig().betaOptIn === true;
|
|
11614
|
+
}
|
|
11615
|
+
var TERMINALHIRE_DIR6, CONFIG_FILE, DEFAULT_CONFIG;
|
|
11616
|
+
var init_config = __esm({
|
|
11617
|
+
"src/config.ts"() {
|
|
11618
|
+
"use strict";
|
|
11619
|
+
init_state_dir();
|
|
11620
|
+
TERMINALHIRE_DIR6 = process.env.TERMINALHIRE_DIR || join9(homedir6(), ".terminalhire");
|
|
11621
|
+
CONFIG_FILE = join9(TERMINALHIRE_DIR6, "config.json");
|
|
11622
|
+
DEFAULT_CONFIG = {
|
|
11623
|
+
nudge: "session",
|
|
11624
|
+
peerConnect: false,
|
|
11625
|
+
peerConnectPrompted: false,
|
|
11626
|
+
resumePublishPrompted: false,
|
|
11627
|
+
chatDisclosureAck: false,
|
|
11628
|
+
chatShareActivity: false,
|
|
11629
|
+
inboundNudgeMuted: false,
|
|
11630
|
+
inboundNudgeDisclosed: false,
|
|
11631
|
+
contributeEnabled: true,
|
|
11632
|
+
betaOptIn: false,
|
|
11633
|
+
lastFullFeedbackAt: null,
|
|
11634
|
+
lastPulseAskAt: null,
|
|
11635
|
+
pulseDisclosed: false,
|
|
11636
|
+
mix: "balanced"
|
|
11637
|
+
};
|
|
11638
|
+
}
|
|
11639
|
+
});
|
|
11640
|
+
|
|
11641
|
+
// bin/founder-surface.js
|
|
11642
|
+
var founder_surface_exports = {};
|
|
11643
|
+
__export(founder_surface_exports, {
|
|
11644
|
+
founderRows: () => founderRows,
|
|
11645
|
+
projectFounderSurface: () => projectFounderSurface,
|
|
11646
|
+
resolveSurfaceLead: () => resolveSurfaceLead
|
|
11647
|
+
});
|
|
11648
|
+
function projectFounderSurface(body) {
|
|
11649
|
+
if (!body || body.ok !== true || !Array.isArray(body.postings)) return null;
|
|
11650
|
+
const statusline = body.statusline;
|
|
11651
|
+
if (!statusline || typeof statusline.needsYouCount !== "number" || typeof statusline.openPostingCount !== "number" || typeof statusline.refreshedAt !== "string") {
|
|
11652
|
+
return null;
|
|
11653
|
+
}
|
|
11654
|
+
const postings = [];
|
|
11655
|
+
for (const raw of body.postings) {
|
|
11656
|
+
if (!raw || typeof raw.id !== "string" || typeof raw.title !== "string" || typeof raw.status !== "string" || typeof raw.needsYou !== "boolean" || typeof raw.claimantCount !== "number" || typeof raw.postedAt !== "string") {
|
|
11657
|
+
continue;
|
|
11658
|
+
}
|
|
11659
|
+
postings.push({
|
|
11660
|
+
id: raw.id,
|
|
11661
|
+
title: raw.title,
|
|
11662
|
+
status: raw.status,
|
|
11663
|
+
needsYou: raw.needsYou,
|
|
11664
|
+
claimantCount: raw.claimantCount,
|
|
11665
|
+
postedAt: raw.postedAt
|
|
11666
|
+
});
|
|
11667
|
+
}
|
|
11668
|
+
return {
|
|
11669
|
+
postings,
|
|
11670
|
+
needsYouCount: Math.max(0, statusline.needsYouCount),
|
|
11671
|
+
openPostingCount: Math.max(0, statusline.openPostingCount),
|
|
11672
|
+
refreshedAt: statusline.refreshedAt
|
|
11673
|
+
};
|
|
11674
|
+
}
|
|
11675
|
+
function resolveSurfaceLead(override, founderSurface) {
|
|
11676
|
+
if (override === "dev" || override === "founder") return override;
|
|
11677
|
+
if (founderSurface && (founderSurface.openPostingCount > 0 || founderSurface.needsYouCount > 0)) {
|
|
11678
|
+
return "founder";
|
|
11679
|
+
}
|
|
11680
|
+
return "dev";
|
|
11681
|
+
}
|
|
11682
|
+
function founderRows(surface, kind) {
|
|
11683
|
+
if (!surface || !Array.isArray(surface.postings)) return [];
|
|
11684
|
+
if (kind === "jobs") {
|
|
11685
|
+
return surface.postings.filter((posting) => posting.status === "open" || posting.needsYou);
|
|
11686
|
+
}
|
|
11687
|
+
return surface.postings;
|
|
11688
|
+
}
|
|
11689
|
+
var init_founder_surface = __esm({
|
|
11690
|
+
"bin/founder-surface.js"() {
|
|
11691
|
+
"use strict";
|
|
11692
|
+
}
|
|
11693
|
+
});
|
|
11694
|
+
|
|
11522
11695
|
// bin/founder-paid-badge.js
|
|
11523
11696
|
var founder_paid_badge_exports = {};
|
|
11524
11697
|
__export(founder_paid_badge_exports, {
|
|
@@ -11559,9 +11732,9 @@ var init_founder_paid_badge = __esm({
|
|
|
11559
11732
|
// bin/jpi-bounties.js
|
|
11560
11733
|
init_src();
|
|
11561
11734
|
init_cache_store();
|
|
11562
|
-
import { readFileSync as
|
|
11563
|
-
import { join as
|
|
11564
|
-
import { homedir as
|
|
11735
|
+
import { readFileSync as readFileSync7 } from "fs";
|
|
11736
|
+
import { join as join10 } from "path";
|
|
11737
|
+
import { homedir as homedir7 } from "os";
|
|
11565
11738
|
import { createInterface } from "readline";
|
|
11566
11739
|
|
|
11567
11740
|
// bin/sanitize.js
|
|
@@ -11597,8 +11770,8 @@ function linkTitle(title, url) {
|
|
|
11597
11770
|
|
|
11598
11771
|
// bin/jpi-bounties.js
|
|
11599
11772
|
init_founder_pin();
|
|
11600
|
-
var
|
|
11601
|
-
var INDEX_CACHE_FILE2 =
|
|
11773
|
+
var TERMINALHIRE_DIR7 = process.env.TERMINALHIRE_DIR || join10(homedir7(), ".terminalhire");
|
|
11774
|
+
var INDEX_CACHE_FILE2 = join10(TERMINALHIRE_DIR7, "index-cache.json");
|
|
11602
11775
|
var INDEX_TTL_MS = 15 * 60 * 1e3;
|
|
11603
11776
|
var API_URL = process.env["TERMINALHIRE_API_URL"] ?? process.env["JPI_API_URL"] ?? "https://terminalhire.com";
|
|
11604
11777
|
var RANK_MODE = process.env["TERMINALHIRE_BOUNTY_RANK"] ?? "winnability";
|
|
@@ -11612,7 +11785,7 @@ var SHOW_ALL = args.includes("--all");
|
|
|
11612
11785
|
var WINNABLE_ONLY = args.includes("--winnable");
|
|
11613
11786
|
function readIndexCache() {
|
|
11614
11787
|
try {
|
|
11615
|
-
const entry = JSON.parse(
|
|
11788
|
+
const entry = JSON.parse(readFileSync7(INDEX_CACHE_FILE2, "utf8"));
|
|
11616
11789
|
if (Date.now() - entry.ts < INDEX_TTL_MS) return entry.index;
|
|
11617
11790
|
return null;
|
|
11618
11791
|
} catch {
|
|
@@ -11665,6 +11838,11 @@ ${i + 1}. ${linkTitle(job.title, job.url)} [${ref}]`);
|
|
|
11665
11838
|
);
|
|
11666
11839
|
if (reason) console.log(` ${reason}`);
|
|
11667
11840
|
if (continuityNote) console.log(` ${continuityNote}`);
|
|
11841
|
+
if (b.bountySource === "founder" && b.specProvenance) {
|
|
11842
|
+
console.log(
|
|
11843
|
+
` Spec: ${b.specProvenance === "agent_drafted_human_confirmed" ? "agent drafted \xB7 founder confirmed" : "founder authored"}`
|
|
11844
|
+
);
|
|
11845
|
+
}
|
|
11668
11846
|
if (matchedTags && matchedTags.length)
|
|
11669
11847
|
console.log(` Tags matched: ${matchedTags.slice(0, 5).join(", ")}`);
|
|
11670
11848
|
console.log(` id: ${job.id}`);
|
|
@@ -11775,6 +11953,32 @@ async function getBounties({ quiet = false, offline = false, priced = PRICED_ONL
|
|
|
11775
11953
|
}
|
|
11776
11954
|
async function run() {
|
|
11777
11955
|
try {
|
|
11956
|
+
if (args.length === 0) {
|
|
11957
|
+
try {
|
|
11958
|
+
const { readCacheEntry: readCacheEntry2 } = await Promise.resolve().then(() => (init_cache_store(), cache_store_exports));
|
|
11959
|
+
const { getSurfaceLeadOverride: getSurfaceLeadOverride2 } = await Promise.resolve().then(() => (init_config(), config_exports));
|
|
11960
|
+
const { founderRows: founderRows2, resolveSurfaceLead: resolveSurfaceLead2 } = await Promise.resolve().then(() => (init_founder_surface(), founder_surface_exports));
|
|
11961
|
+
const surface = (readCacheEntry2() ?? {}).founderSurface;
|
|
11962
|
+
if (resolveSurfaceLead2(getSurfaceLeadOverride2(), surface) === "founder") {
|
|
11963
|
+
const rows = founderRows2(surface, "bounties");
|
|
11964
|
+
console.log("\n\u26A1 Your TerminalHire postings\n");
|
|
11965
|
+
if (!rows.length) {
|
|
11966
|
+
console.log(" No current posting data. Run `terminalhire refresh`, or lead with work:");
|
|
11967
|
+
console.log(" terminalhire config set lead dev\n");
|
|
11968
|
+
} else {
|
|
11969
|
+
rows.forEach((row, index) => {
|
|
11970
|
+
console.log(
|
|
11971
|
+
` ${index + 1}. ${sanitizeText(row.title)} \xB7 ${row.status} \xB7 ${row.claimantCount} claimant${row.claimantCount === 1 ? "" : "s"}${row.needsYou ? " \xB7 waiting on you" : ""}`
|
|
11972
|
+
);
|
|
11973
|
+
});
|
|
11974
|
+
console.log("\n Review and act: https://terminalhire.com/dashboard?tab=postings");
|
|
11975
|
+
console.log(" Lead with developer bounties instead: terminalhire config set lead dev\n");
|
|
11976
|
+
}
|
|
11977
|
+
return;
|
|
11978
|
+
}
|
|
11979
|
+
} catch {
|
|
11980
|
+
}
|
|
11981
|
+
}
|
|
11778
11982
|
const result = await getBounties();
|
|
11779
11983
|
if (result.status === "empty") {
|
|
11780
11984
|
console.log(
|