terminalhire 0.42.8 → 0.42.9
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/jpi-claim.js +123 -112
- package/dist/bin/jpi-dispatch.js +135 -121
- package/dist/bin/jpi-mcp.js +135 -121
- package/dist/src/repo-policy.js +0 -36
- package/package.json +1 -1
package/dist/bin/jpi-claim.js
CHANGED
|
@@ -24825,10 +24825,8 @@ var init_repo_policy_semantic = __esm({
|
|
|
24825
24825
|
// src/repo-policy.ts
|
|
24826
24826
|
var repo_policy_exports = {};
|
|
24827
24827
|
__export(repo_policy_exports, {
|
|
24828
|
-
FOUNDER_DECLARATION_SOURCE: () => FOUNDER_DECLARATION_SOURCE,
|
|
24829
24828
|
POLICY_RULESET_VERSION: () => POLICY_RULESET_VERSION,
|
|
24830
24829
|
auditContent: () => auditContent,
|
|
24831
|
-
auditDeclaredPolicy: () => auditDeclaredPolicy,
|
|
24832
24830
|
checkRepoPolicy: () => checkRepoPolicy,
|
|
24833
24831
|
ghHeaders: () => ghHeaders2
|
|
24834
24832
|
});
|
|
@@ -25034,40 +25032,7 @@ async function checkRepoPolicy(repoFullName, opts = {}) {
|
|
|
25034
25032
|
files
|
|
25035
25033
|
};
|
|
25036
25034
|
}
|
|
25037
|
-
|
|
25038
|
-
const text = typeof declaration === "string" ? declaration.trim() : "";
|
|
25039
|
-
if (text === "") {
|
|
25040
|
-
return {
|
|
25041
|
-
status: "unavailable",
|
|
25042
|
-
verdict: "unavailable",
|
|
25043
|
-
hits: [],
|
|
25044
|
-
requirements: [],
|
|
25045
|
-
assignment: "none",
|
|
25046
|
-
rulesetVersion: POLICY_RULESET_VERSION,
|
|
25047
|
-
contentHash: null,
|
|
25048
|
-
scanComplete: false,
|
|
25049
|
-
files: []
|
|
25050
|
-
};
|
|
25051
|
-
}
|
|
25052
|
-
const files = [{ file: FOUNDER_DECLARATION_SOURCE, content: text }];
|
|
25053
|
-
const { hits, requirements, verdict, assignment } = auditContent(files);
|
|
25054
|
-
return {
|
|
25055
|
-
// Same status rule as a scanned repo: any classified hit → 'flagged' (the
|
|
25056
|
-
// verdict says how severe), no hit → 'clean'. The declaration is one short
|
|
25057
|
-
// text that was read in full, so the incomplete-scan precedence above can
|
|
25058
|
-
// never apply here.
|
|
25059
|
-
status: hits.length > 0 ? "flagged" : "clean",
|
|
25060
|
-
verdict,
|
|
25061
|
-
hits,
|
|
25062
|
-
requirements,
|
|
25063
|
-
assignment,
|
|
25064
|
-
rulesetVersion: POLICY_RULESET_VERSION,
|
|
25065
|
-
contentHash: hashFiles(files),
|
|
25066
|
-
scanComplete: true,
|
|
25067
|
-
files
|
|
25068
|
-
};
|
|
25069
|
-
}
|
|
25070
|
-
var GH_API, GH_API_ORIGIN, GH_HEADERS, MAX_REQUESTS, POLICY_RULESET_VERSION, AI_SIGNAL_PATTERNS, AI_TERM, PROHIBITED_PATTERNS, DISCLOSURE_PATTERNS, DISCLOSURE_ENFORCEMENT_PATTERNS, REQUIREMENT_PATTERNS, CANDIDATE_GROUPS, VERDICT_SEVERITY, FOUNDER_DECLARATION_SOURCE;
|
|
25035
|
+
var GH_API, GH_API_ORIGIN, GH_HEADERS, MAX_REQUESTS, POLICY_RULESET_VERSION, AI_SIGNAL_PATTERNS, AI_TERM, PROHIBITED_PATTERNS, DISCLOSURE_PATTERNS, DISCLOSURE_ENFORCEMENT_PATTERNS, REQUIREMENT_PATTERNS, CANDIDATE_GROUPS, VERDICT_SEVERITY;
|
|
25071
25036
|
var init_repo_policy = __esm({
|
|
25072
25037
|
"src/repo-policy.ts"() {
|
|
25073
25038
|
"use strict";
|
|
@@ -25151,7 +25116,6 @@ var init_repo_policy = __esm({
|
|
|
25151
25116
|
"disclosure-required": 2,
|
|
25152
25117
|
prohibited: 3
|
|
25153
25118
|
};
|
|
25154
|
-
FOUNDER_DECLARATION_SOURCE = "founder-declaration";
|
|
25155
25119
|
}
|
|
25156
25120
|
});
|
|
25157
25121
|
|
|
@@ -26710,8 +26674,7 @@ function buildSubmitBody(issueNumber, opts = {}) {
|
|
|
26710
26674
|
return `${closesLine}${main}${AI_DISCLOSURE_NOTE}`;
|
|
26711
26675
|
}
|
|
26712
26676
|
function printPolicySection(policy) {
|
|
26713
|
-
const
|
|
26714
|
-
const subject = declared ? "this posting's declared policy" : "this repo";
|
|
26677
|
+
const subject = "this repo";
|
|
26715
26678
|
const verdict = policy.verdict ?? (policy.status === "flagged" ? "ai-mentioned" : policy.status);
|
|
26716
26679
|
if (verdict === "prohibited") {
|
|
26717
26680
|
console.log(
|
|
@@ -26729,11 +26692,7 @@ function printPolicySection(policy) {
|
|
|
26729
26692
|
);
|
|
26730
26693
|
} else if (policy.status === "unavailable") {
|
|
26731
26694
|
console.log(
|
|
26732
|
-
|
|
26733
|
-
);
|
|
26734
|
-
} else if (declared) {
|
|
26735
|
-
console.log(
|
|
26736
|
-
" policy: no AI-assistance restriction in the founder's declared policy (shown above verbatim when flagged)"
|
|
26695
|
+
"\n POLICY: could not read this repo's CONTRIBUTING/PR-template/AGENTS docs (rate-limited or unreachable) \u2014 read them yourself before working."
|
|
26737
26696
|
);
|
|
26738
26697
|
} else if (policy.semantic?.status === "not-configured" && (policy.files?.length ?? 0) > 0) {
|
|
26739
26698
|
console.log(
|
|
@@ -26952,8 +26911,7 @@ function extractClaimableFields(job) {
|
|
|
26952
26911
|
openPRsAtDiscovery: c.openPRsAtDiscovery,
|
|
26953
26912
|
// A contribute issue is never first-party founder supply.
|
|
26954
26913
|
founderPosting: false,
|
|
26955
|
-
claimMode: "open"
|
|
26956
|
-
aiDeclaration: null
|
|
26914
|
+
claimMode: "open"
|
|
26957
26915
|
};
|
|
26958
26916
|
}
|
|
26959
26917
|
const b = job.bounty ?? {};
|
|
@@ -26966,15 +26924,13 @@ function extractClaimableFields(job) {
|
|
|
26966
26924
|
source: "bounty",
|
|
26967
26925
|
// Bounties carry no discovery-time PR proof — always live-count (unchanged).
|
|
26968
26926
|
openPRsAtDiscovery: void 0,
|
|
26969
|
-
// TERM-142 — first-party founder supply drives a different record path:
|
|
26970
|
-
//
|
|
26927
|
+
// TERM-142 — first-party founder supply drives a different record path: no
|
|
26928
|
+
// policy step at all (TERM-625 — there is no repo to scan either, `repoFullName`
|
|
26971
26929
|
// here is the posting's opaque handle, V-9), and recording registers the claim
|
|
26972
|
-
// server-side (Decision 4).
|
|
26973
|
-
// default
|
|
26974
|
-
// founder declared nothing.
|
|
26930
|
+
// server-side (Decision 4). `claimMode` follows the index row's absent-means-
|
|
26931
|
+
// default convention: absent = open.
|
|
26975
26932
|
founderPosting: b.bountySource === "founder",
|
|
26976
|
-
claimMode: b.claimMode === "approval-only" ? "approval-only" : "open"
|
|
26977
|
-
aiDeclaration: typeof b.aiDeclaration === "string" && b.aiDeclaration.trim() !== "" ? b.aiDeclaration : null
|
|
26933
|
+
claimMode: b.claimMode === "approval-only" ? "approval-only" : "open"
|
|
26978
26934
|
};
|
|
26979
26935
|
}
|
|
26980
26936
|
function parseGitHubUrl(url) {
|
|
@@ -27142,6 +27098,7 @@ async function hasPriorAssignmentRequest(repoFullName, issueNumber, login, marke
|
|
|
27142
27098
|
}
|
|
27143
27099
|
}
|
|
27144
27100
|
function shouldRequestAssignment(claim, flags = {}) {
|
|
27101
|
+
if (claim && claim.approval) return { post: Boolean(flags.assign), takeBot: false };
|
|
27145
27102
|
const expectation = claim && claim.policy ? claim.policy.assignment : void 0;
|
|
27146
27103
|
const post = Boolean(flags.assign) || expectation === void 0 || expectation === "required" || expectation === "take-bot";
|
|
27147
27104
|
return { post, takeBot: expectation === "take-bot" };
|
|
@@ -27398,7 +27355,6 @@ async function resolveBounty(arg) {
|
|
|
27398
27355
|
let bountyId, title, repoFullName, issueUrl, amountUSD, source, openPRsAtDiscovery, indexNativeId;
|
|
27399
27356
|
let founderPosting = false;
|
|
27400
27357
|
let claimMode = "open";
|
|
27401
|
-
let aiDeclaration = null;
|
|
27402
27358
|
let job = findClaimableInCache(arg) ?? (looksLikeShortRef(arg) ? findClaimableByShortRef(arg) : null);
|
|
27403
27359
|
let freshPool;
|
|
27404
27360
|
if (!job && looksLikeShortRef(arg)) {
|
|
@@ -27415,8 +27371,7 @@ async function resolveBounty(arg) {
|
|
|
27415
27371
|
source,
|
|
27416
27372
|
openPRsAtDiscovery,
|
|
27417
27373
|
founderPosting,
|
|
27418
|
-
claimMode
|
|
27419
|
-
aiDeclaration
|
|
27374
|
+
claimMode
|
|
27420
27375
|
} = extractClaimableFields(job));
|
|
27421
27376
|
indexNativeId = bountyId;
|
|
27422
27377
|
} else {
|
|
@@ -27482,13 +27437,12 @@ async function resolveBounty(arg) {
|
|
|
27482
27437
|
// `openPRs`, which may be the discovery-time snapshot used for display.
|
|
27483
27438
|
openPRsLive,
|
|
27484
27439
|
issueNumber: ghIssue ? ghIssue.number : null,
|
|
27485
|
-
// TERM-142 — founder-posting facts for cmdRecord's
|
|
27486
|
-
//
|
|
27487
|
-
//
|
|
27488
|
-
//
|
|
27440
|
+
// TERM-142 — founder-posting facts for cmdRecord's registration call. The URL
|
|
27441
|
+
// tier can never resolve a founder posting (its claimUrl is a docs page, not a
|
|
27442
|
+
// GitHub issue), so the defaults above are correct there: a URL-tier claim is
|
|
27443
|
+
// never treated as founder supply.
|
|
27489
27444
|
founderPosting,
|
|
27490
|
-
claimMode
|
|
27491
|
-
aiDeclaration
|
|
27445
|
+
claimMode
|
|
27492
27446
|
};
|
|
27493
27447
|
}
|
|
27494
27448
|
function fmtOpenPRsLine(b) {
|
|
@@ -27905,21 +27859,14 @@ ${contestedWarning}`);
|
|
|
27905
27859
|
process.exit(1);
|
|
27906
27860
|
}
|
|
27907
27861
|
}
|
|
27908
|
-
|
|
27909
|
-
|
|
27910
|
-
|
|
27911
|
-
const { auditDeclaredPolicy: auditDeclaredPolicy2 } = await Promise.resolve().then(() => (init_repo_policy(), repo_policy_exports));
|
|
27912
|
-
const declared = await applySemanticPolicyGate2(
|
|
27913
|
-
b.repoFullName,
|
|
27914
|
-
auditDeclaredPolicy2(b.aiDeclaration)
|
|
27915
|
-
);
|
|
27916
|
-
policy = { ...declared, provenance: "founder-declaration" };
|
|
27917
|
-
} else {
|
|
27862
|
+
let policy = null;
|
|
27863
|
+
if (!b.founderPosting) {
|
|
27864
|
+
const { applySemanticPolicyGate: applySemanticPolicyGate2 } = await Promise.resolve().then(() => (init_repo_policy_semantic(), repo_policy_semantic_exports));
|
|
27918
27865
|
const { checkRepoPolicy: checkRepoPolicy2 } = await Promise.resolve().then(() => (init_repo_policy(), repo_policy_exports));
|
|
27919
27866
|
const keywordPolicy = await checkRepoPolicy2(b.repoFullName, { token: await policyScanToken() });
|
|
27920
27867
|
policy = await applySemanticPolicyGate2(b.repoFullName, keywordPolicy);
|
|
27868
|
+
printPolicySection(policy);
|
|
27921
27869
|
}
|
|
27922
|
-
printPolicySection(policy);
|
|
27923
27870
|
if (process.stdout.isTTY) {
|
|
27924
27871
|
try {
|
|
27925
27872
|
const { getRepoEntry: getRepoEntry2, briefingLines: briefingLines2 } = await Promise.resolve().then(() => (init_repo_experience(), repo_experience_exports));
|
|
@@ -27934,20 +27881,19 @@ ${contestedWarning}`);
|
|
|
27934
27881
|
} catch {
|
|
27935
27882
|
}
|
|
27936
27883
|
}
|
|
27937
|
-
const policySubject = policy.provenance === "founder-declaration" ? "this founder posting" : b.repoFullName;
|
|
27938
27884
|
let ackedAt = null;
|
|
27939
|
-
if (policy
|
|
27885
|
+
if (!policy) {
|
|
27886
|
+
} else if (policy.verdict === "prohibited") {
|
|
27940
27887
|
let acked = Boolean(flags["ack-policy-prohibited"]);
|
|
27941
27888
|
if (!acked && process.stdin.isTTY) {
|
|
27942
27889
|
acked = await confirm(
|
|
27943
|
-
|
|
27944
|
-
${policy.provenance === "founder-declaration" ? "This posting's declared policy" : "This repo"} PROHIBITS AI-generated contributions \u2014 continuing means everything you submit must be hand-written by you. Continue? (y/N) `
|
|
27890
|
+
"\n This repo PROHIBITS AI-generated contributions \u2014 continuing means everything you submit must be hand-written by you. Continue? (y/N) "
|
|
27945
27891
|
);
|
|
27946
27892
|
}
|
|
27947
27893
|
if (!acked) {
|
|
27948
27894
|
console.error(
|
|
27949
27895
|
`
|
|
27950
|
-
terminalhire claim: refusing to record \u2014 ${
|
|
27896
|
+
terminalhire claim: refusing to record \u2014 ${b.repoFullName} prohibits AI-generated contributions.
|
|
27951
27897
|
Read the excerpts above. If you will hand-write the work yourself, re-run with
|
|
27952
27898
|
--ack-policy-prohibited (or confirm interactively). --ack-policy is not enough here.`
|
|
27953
27899
|
);
|
|
@@ -27963,8 +27909,7 @@ terminalhire claim: refusing to record \u2014 ${policySubject} prohibits AI-gene
|
|
|
27963
27909
|
);
|
|
27964
27910
|
ackedAt = prior.ackedAt;
|
|
27965
27911
|
} else {
|
|
27966
|
-
const
|
|
27967
|
-
const reason = policy.status === "flagged" ? declaredProvenance ? "This posting's declared policy has AI-assistance language" : "This repo has AI-assistance policy language" : (policy.hits?.length ?? 0) > 0 ? "This repo's policy scan was cut short \u2014 AI-policy language was found in what WAS read, and other governing docs went unread" : declaredProvenance ? "The founder declared no AI-assistance policy on this posting" : "This repo's contribution policy could not be checked";
|
|
27912
|
+
const reason = policy.status === "flagged" ? "This repo has AI-assistance policy language" : (policy.hits?.length ?? 0) > 0 ? "This repo's policy scan was cut short \u2014 AI-policy language was found in what WAS read, and other governing docs went unread" : "This repo's contribution policy could not be checked";
|
|
27968
27913
|
let acked = Boolean(flags["ack-policy"]);
|
|
27969
27914
|
if (!acked && process.stdin.isTTY) {
|
|
27970
27915
|
acked = await confirm(
|
|
@@ -27974,9 +27919,7 @@ terminalhire claim: refusing to record \u2014 ${policySubject} prohibits AI-gene
|
|
|
27974
27919
|
}
|
|
27975
27920
|
if (!acked) {
|
|
27976
27921
|
console.error(
|
|
27977
|
-
|
|
27978
|
-
terminalhire claim: refusing to record. ${reason}.
|
|
27979
|
-
Re-run with --ack-policy to acknowledge and proceed (or confirm interactively).` : `
|
|
27922
|
+
`
|
|
27980
27923
|
terminalhire claim: refusing to record \u2014 read ${b.repoFullName}'s contribution policy first.
|
|
27981
27924
|
Re-run with --ack-policy once you have (or confirm interactively).`
|
|
27982
27925
|
);
|
|
@@ -28034,17 +27977,22 @@ terminalhire claim: refusing to record \u2014 read ${b.repoFullName}'s contribut
|
|
|
28034
27977
|
// start` can drive the assignment decision from it and `claim audit` can
|
|
28035
27978
|
// show what ruleset the dev acknowledged. Excerpts are NOT persisted —
|
|
28036
27979
|
// the record stores the conclusion; the docs stay the source of truth.
|
|
28037
|
-
|
|
28038
|
-
|
|
28039
|
-
|
|
28040
|
-
|
|
28041
|
-
|
|
28042
|
-
|
|
28043
|
-
|
|
28044
|
-
|
|
28045
|
-
|
|
28046
|
-
|
|
28047
|
-
|
|
27980
|
+
//
|
|
27981
|
+
// TERM-625: a founder posting has no audit, so the key is OMITTED rather
|
|
27982
|
+
// than filled with a manufactured 'clean'. Absent means "never scanned";
|
|
27983
|
+
// a stored verdict would claim we read something. `shouldRequestAssignment`
|
|
27984
|
+
// reads an absent policy as the legacy-claim branch, which is the right
|
|
27985
|
+
// answer here — there is no third-party assignment convention to honour.
|
|
27986
|
+
...policy ? {
|
|
27987
|
+
policy: {
|
|
27988
|
+
status: policy.status,
|
|
27989
|
+
verdict: policy.verdict,
|
|
27990
|
+
assignment: policy.assignment,
|
|
27991
|
+
requirements: (policy.requirements ?? []).map((r) => r.kind),
|
|
27992
|
+
rulesetVersion: policy.rulesetVersion,
|
|
27993
|
+
ackedAt
|
|
27994
|
+
}
|
|
27995
|
+
} : {},
|
|
28048
27996
|
// Registration receipt + approval wait (founder postings only; see claims.ts).
|
|
28049
27997
|
...approval ? { approval } : {}
|
|
28050
27998
|
});
|
|
@@ -28052,10 +28000,12 @@ terminalhire claim: refusing to record \u2014 read ${b.repoFullName}'s contribut
|
|
|
28052
28000
|
console.error(`terminalhire claim: ${err.message ?? err}`);
|
|
28053
28001
|
process.exit(1);
|
|
28054
28002
|
}
|
|
28055
|
-
|
|
28056
|
-
|
|
28057
|
-
|
|
28058
|
-
|
|
28003
|
+
if (policy) {
|
|
28004
|
+
try {
|
|
28005
|
+
const { recordPolicySnapshot: recordPolicySnapshot2 } = await Promise.resolve().then(() => (init_repo_experience(), repo_experience_exports));
|
|
28006
|
+
await recordPolicySnapshot2(b.repoFullName, policy);
|
|
28007
|
+
} catch {
|
|
28008
|
+
}
|
|
28059
28009
|
}
|
|
28060
28010
|
try {
|
|
28061
28011
|
const { markStatus: markStatus2 } = await Promise.resolve().then(() => (init_job_status_store(), job_status_store_exports));
|
|
@@ -28147,8 +28097,11 @@ async function cmdPreview(arg, { json } = {}) {
|
|
|
28147
28097
|
console.error(" Run `terminalhire bounties` to populate the cache, or pass a full issue URL.");
|
|
28148
28098
|
process.exit(1);
|
|
28149
28099
|
}
|
|
28150
|
-
|
|
28151
|
-
|
|
28100
|
+
let policy = null;
|
|
28101
|
+
if (!b.founderPosting) {
|
|
28102
|
+
const { checkRepoPolicy: checkRepoPolicy2 } = await Promise.resolve().then(() => (init_repo_policy(), repo_policy_exports));
|
|
28103
|
+
policy = await checkRepoPolicy2(b.repoFullName, { token: await policyScanToken() });
|
|
28104
|
+
}
|
|
28152
28105
|
if (json) {
|
|
28153
28106
|
process.stdout.write(
|
|
28154
28107
|
JSON.stringify({
|
|
@@ -28161,14 +28114,18 @@ async function cmdPreview(arg, { json } = {}) {
|
|
|
28161
28114
|
openPRs: b.openPRs,
|
|
28162
28115
|
assignees: b.assignees,
|
|
28163
28116
|
contested: isContested(b),
|
|
28164
|
-
|
|
28165
|
-
|
|
28166
|
-
|
|
28167
|
-
|
|
28168
|
-
|
|
28169
|
-
|
|
28170
|
-
|
|
28171
|
-
|
|
28117
|
+
// Absent on a founder posting — see the scan above. A consumer must read
|
|
28118
|
+
// "no policy key" as "no policy step exists here", never as "clean".
|
|
28119
|
+
...policy ? {
|
|
28120
|
+
policy: {
|
|
28121
|
+
status: policy.status,
|
|
28122
|
+
verdict: policy.verdict,
|
|
28123
|
+
assignment: policy.assignment,
|
|
28124
|
+
rulesetVersion: policy.rulesetVersion,
|
|
28125
|
+
hits: policy.hits,
|
|
28126
|
+
requirements: policy.requirements
|
|
28127
|
+
}
|
|
28128
|
+
} : {}
|
|
28172
28129
|
}) + "\n"
|
|
28173
28130
|
);
|
|
28174
28131
|
return;
|
|
@@ -28187,7 +28144,7 @@ async function cmdPreview(arg, { json } = {}) {
|
|
|
28187
28144
|
console.log(fmtOpenPRsLine(b));
|
|
28188
28145
|
const previewContested = fmtContestedWarning(b);
|
|
28189
28146
|
if (previewContested) console.log(previewContested);
|
|
28190
|
-
printPolicySection(policy);
|
|
28147
|
+
if (policy) printPolicySection(policy);
|
|
28191
28148
|
if (process.stdout.isTTY) {
|
|
28192
28149
|
try {
|
|
28193
28150
|
const { getRepoEntry: getRepoEntry2, briefingLines: briefingLines2 } = await Promise.resolve().then(() => (init_repo_experience(), repo_experience_exports));
|
|
@@ -29173,7 +29130,15 @@ async function requireReadPushToken(what) {
|
|
|
29173
29130
|
}
|
|
29174
29131
|
async function cmdSlice(id, flags = {}) {
|
|
29175
29132
|
const claims = await Promise.resolve().then(() => (init_claims(), claims_exports));
|
|
29176
|
-
|
|
29133
|
+
if (!id) {
|
|
29134
|
+
console.error("Usage: terminalhire claim slice <id>");
|
|
29135
|
+
process.exit(1);
|
|
29136
|
+
}
|
|
29137
|
+
const local = claims.findClaim(id) ?? null;
|
|
29138
|
+
if (local) {
|
|
29139
|
+
requireFounderLoopClaim(claims, id, "slice");
|
|
29140
|
+
}
|
|
29141
|
+
const bountyId = local ? founderPostingIdOf(local) : String(id).replace(/^bounty:founder:/, "");
|
|
29177
29142
|
const pushToken = await requireReadPushToken("fetching your granted slice");
|
|
29178
29143
|
let res;
|
|
29179
29144
|
try {
|
|
@@ -29181,8 +29146,11 @@ async function cmdSlice(id, flags = {}) {
|
|
|
29181
29146
|
method: "POST",
|
|
29182
29147
|
headers: { "Content-Type": "application/json" },
|
|
29183
29148
|
body: JSON.stringify({
|
|
29184
|
-
bountyId
|
|
29185
|
-
|
|
29149
|
+
bountyId,
|
|
29150
|
+
// Sent only when we hold one. Omitted, the server resolves the caller's single
|
|
29151
|
+
// claim on this posting; sent, it is matched EXACTLY, so a stale local id still
|
|
29152
|
+
// fails closed instead of being redirected to a different claim.
|
|
29153
|
+
...local ? { claimId: local.approval.claimId } : {},
|
|
29186
29154
|
pushToken
|
|
29187
29155
|
}),
|
|
29188
29156
|
signal: AbortSignal.timeout(3e4)
|
|
@@ -29210,6 +29178,40 @@ async function cmdSlice(id, flags = {}) {
|
|
|
29210
29178
|
);
|
|
29211
29179
|
process.exit(1);
|
|
29212
29180
|
}
|
|
29181
|
+
let claim = local;
|
|
29182
|
+
if (!claim) {
|
|
29183
|
+
try {
|
|
29184
|
+
claim = claims.recordClaim({
|
|
29185
|
+
id,
|
|
29186
|
+
bountyId: body.bountyId ?? bountyId,
|
|
29187
|
+
title: body.title ?? null,
|
|
29188
|
+
repoFullName: null,
|
|
29189
|
+
issueUrl: null,
|
|
29190
|
+
amountUSD: null,
|
|
29191
|
+
openPRsAtClaim: null,
|
|
29192
|
+
kind: "bounty",
|
|
29193
|
+
policy: null,
|
|
29194
|
+
approval: {
|
|
29195
|
+
mode: body.claimMode ?? "open",
|
|
29196
|
+
// Granted, not pending: the server only delivers a slice to an approved
|
|
29197
|
+
// claimant. Recording 'pending' here would make `claim start` render a wait
|
|
29198
|
+
// for approval that has already happened.
|
|
29199
|
+
state: "granted",
|
|
29200
|
+
claimId: body.claimId,
|
|
29201
|
+
claimantLogin: null,
|
|
29202
|
+
registeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
29203
|
+
// So a later reader can tell this record was rebuilt from a slice delivery
|
|
29204
|
+
// rather than written by `claim record` — it is deliberately thinner.
|
|
29205
|
+
hydratedFrom: "slice"
|
|
29206
|
+
}
|
|
29207
|
+
});
|
|
29208
|
+
} catch (err) {
|
|
29209
|
+
console.error(
|
|
29210
|
+
`terminalhire claim: the slice was delivered but the local record could not be written (${err?.message ?? err}) \u2014 nothing was written to disk.`
|
|
29211
|
+
);
|
|
29212
|
+
process.exit(1);
|
|
29213
|
+
}
|
|
29214
|
+
}
|
|
29213
29215
|
let dest = flags.dir ? pathResolve(String(flags.dir)) : sliceWorkDirFor(claim.id);
|
|
29214
29216
|
if (existsSync8(dest) && readdirSync2(dest).length > 0) {
|
|
29215
29217
|
console.error(
|
|
@@ -30153,6 +30155,15 @@ async function cmdPush({ keepUpdated = false } = {}) {
|
|
|
30153
30155
|
lastPushedAt: consentedAt,
|
|
30154
30156
|
lastSnapshotHash: computeSnapshotHash(pushed)
|
|
30155
30157
|
});
|
|
30158
|
+
const omitted = Number(syncBody?.skipped ?? 0);
|
|
30159
|
+
if (omitted > 0) {
|
|
30160
|
+
console.log(
|
|
30161
|
+
`
|
|
30162
|
+
${omitted} claim${omitted === 1 ? "" : "s"} could not be shown on your dashboard \u2014 ${omitted === 1 ? "it names" : "they name"} no repository.`
|
|
30163
|
+
);
|
|
30164
|
+
console.log(" A posting claimed on the web withholds its repo until work starts.");
|
|
30165
|
+
console.log(" Everything else in this push is on your dashboard.");
|
|
30166
|
+
}
|
|
30156
30167
|
if (pushToken) {
|
|
30157
30168
|
try {
|
|
30158
30169
|
if (autoConsent) {
|