@sjawhar/claude-envoy 4.14.6 → 4.15.0
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/.claude-plugin/plugin.json +1 -1
- package/.omp-plugin/plugin.json +1 -1
- package/dist/codex-hook.js +178 -130
- package/dist/dispatch.js +178 -130
- package/dist/envoy-channel.js +179 -131
- package/dist/session-hook.js +178 -130
- package/package.json +1 -1
package/dist/envoy-channel.js
CHANGED
|
@@ -36907,17 +36907,41 @@ var documentEditValidation = {
|
|
|
36907
36907
|
};
|
|
36908
36908
|
var commentOwner = documentOwnerValidation(true);
|
|
36909
36909
|
var COMMENT_TURN_RULE = "turn requires reply_to_ask: turn says who holds an open ask's thread after the reply. Pass reply_to_ask with the open ask's id, or drop turn.";
|
|
36910
|
+
var MAX_COMMENT_MENTIONS = 10;
|
|
36911
|
+
var COMMENT_MENTION_LIMIT_RULE = `mentions allow at most ${MAX_COMMENT_MENTIONS} targets`;
|
|
36912
|
+
var MENTION_TARGET_PATTERNS = [/^role:[a-z0-9-]+$/, /^session:[A-Za-z0-9_-]+$/];
|
|
36913
|
+
var COMMENT_MENTION_TARGET_RULE = "mention target must be role:<name> or session:<id>";
|
|
36914
|
+
var COMMENT_MENTION_REPEAT_RULE = "mentions must not repeat a target";
|
|
36915
|
+
function mentionProblem(mentions) {
|
|
36916
|
+
if (!Array.isArray(mentions))
|
|
36917
|
+
return;
|
|
36918
|
+
if (mentions.length > MAX_COMMENT_MENTIONS)
|
|
36919
|
+
return COMMENT_MENTION_LIMIT_RULE;
|
|
36920
|
+
const seen = new Set;
|
|
36921
|
+
for (const target of mentions) {
|
|
36922
|
+
if (typeof target !== "string" || !MENTION_TARGET_PATTERNS.some((pattern) => pattern.test(target))) {
|
|
36923
|
+
return COMMENT_MENTION_TARGET_RULE;
|
|
36924
|
+
}
|
|
36925
|
+
if (seen.has(target))
|
|
36926
|
+
return COMMENT_MENTION_REPEAT_RULE;
|
|
36927
|
+
seen.add(target);
|
|
36928
|
+
}
|
|
36929
|
+
return;
|
|
36930
|
+
}
|
|
36910
36931
|
function commentProblem(value) {
|
|
36911
36932
|
const input = value;
|
|
36933
|
+
const mention = mentionProblem(input.mentions);
|
|
36912
36934
|
return brokenParts([
|
|
36913
36935
|
[commentOwner.check(value), commentOwner.message],
|
|
36914
|
-
[input.turn === undefined || typeof input.reply_to_ask === "string", COMMENT_TURN_RULE]
|
|
36936
|
+
[input.turn === undefined || typeof input.reply_to_ask === "string", COMMENT_TURN_RULE],
|
|
36937
|
+
[mention === undefined, mention ?? ""]
|
|
36915
36938
|
]);
|
|
36916
36939
|
}
|
|
36940
|
+
var COMMENT_RULE = `${commentOwner.message} ${COMMENT_TURN_RULE} ${COMMENT_MENTION_LIMIT_RULE}, each ${COMMENT_MENTION_TARGET_RULE}, and ${COMMENT_MENTION_REPEAT_RULE}.`;
|
|
36917
36941
|
var commentValidation = {
|
|
36918
36942
|
check: (value) => commentProblem(value) === undefined,
|
|
36919
|
-
message:
|
|
36920
|
-
refusal: (value) => commentProblem(value) ??
|
|
36943
|
+
message: COMMENT_RULE,
|
|
36944
|
+
refusal: (value) => commentProblem(value) ?? COMMENT_RULE
|
|
36921
36945
|
};
|
|
36922
36946
|
var ISSUE_UPDATE_FIELDS_RULE = "Issue update requires at least one field besides issue: status, title, labels, priority, assignee, external_links, route, parent, blocked_by, advances, components, repo, before, or after.";
|
|
36923
36947
|
var ISSUE_UPDATE_DONE_RULE = "status done requires reason, a non-empty note saying why the issue is closing, posted on the issue before it closes so the close carries its note";
|
|
@@ -37277,6 +37301,7 @@ var dispatchToolSpecs = [
|
|
|
37277
37301
|
reply_to: z.string().describe("A comment id (uuid); replying to any comment in a thread continues that thread (an " + "ask's clarification thread included). A block reference to one block of the comment " + "(dispatch://KEY/comment/<id>#b-<block id>) replies to that comment and names the " + "passage the reply answers. To reply to an ask, use reply_to_ask with the ask id, or " + "with a reference to one of its parts, instead.").optional(),
|
|
37278
37302
|
reply_to_ask: z.string().describe("Optional ask id to reply to, threading this comment under that question. A block " + "reference to one part of the ask (dispatch://KEY/ask/<id>#b-<part id>, the id an " + "option or the answer carries) threads under that ask and names the part the reply " + "answers. Mutually exclusive with reply_to.").optional(),
|
|
37279
37303
|
turn: z.enum(["agent", "human"]).describe("Only with reply_to_ask: who holds the turn after this reply. agent: a progress note - " + "you keep the turn and the ask stays 'Waiting on agents' for the human; human (default): " + "you need the human to act - the ask returns to 'Waiting on you'. human does not " + "apply to an approval request a newer version moved: it stays with you until dispatch " + "request-approval hands it back at the current version.").optional(),
|
|
37304
|
+
mentions: z.array(z.string()).describe("Optional targets the comment mentions: role:<name> (lowercase letters, digits and -), " + "which reaches the session holding that role, or session:<id> (letters, digits, _ " + "and -); at most 10, none named twice. Dispatch delivers the comment to each target, " + "retries a send that does not go through, and records every attempt on the comment.").optional(),
|
|
37280
37305
|
images: imagesArgument(z, "the issue (or the project document's project)")
|
|
37281
37306
|
}),
|
|
37282
37307
|
validation: commentValidation
|
|
@@ -37422,7 +37447,7 @@ var dispatchToolSpecs = [
|
|
|
37422
37447
|
verdict: "pass",
|
|
37423
37448
|
commit: "1111111111111111111111111111111111111111"
|
|
37424
37449
|
},
|
|
37425
|
-
description: "Record one result of one check of an issue's Verification document, or retract a result " + "recorded before. A record prints the pull-request body line it implies. Write that line " + "into the pull-request body unchanged: it is the one grammar every writer uses, and it " + "carries no link to Dispatch, no private host and no issue key: Dispatch keeps only words " + "of letters, digits and plain punctuation, and of those leaves out every word that holds " + "`://`, a private or Dispatch host, or an issue key of one of its projects; the record keeps " + "the whole reading. --dry-run prints the line the record would print, and records nothing. " + "Name the check by its block id. Where two Verification documents in reach hold that id, " + "name it by its canonical reference (dispatch://KEY/artifact/verification-md#b-<id>). " + "409 CHECK_AMBIGUOUS names both documents. An id no Verification document of the issue " + "or of an issue above it holds is 400 UNKNOWN_CHECK. " + `${CHECK_PROVED_BY_CI}. ` + "Dispatch reads its result from that run, so a record for it is 409 " + "CHECK_PROVED_BY_CI from every role, which names the check and the run. " + "A pass that counts a failed, a skipped or an excluded case contradicts itself, and is " + "400 RESULT_CONTRADICTS. " + "Dispatch asks GitHub whether the repository of the check's issue holds the commit. A " + "commit that
|
|
37450
|
+
description: "Record one result of one check of an issue's Verification document, or retract a result " + "recorded before. A record prints the pull-request body line it implies. Write that line " + "into the pull-request body unchanged: it is the one grammar every writer uses, and it " + "carries no link to Dispatch, no private host and no issue key: Dispatch keeps only words " + "of letters, digits and plain punctuation, and of those leaves out every word that holds " + "`://`, a private or Dispatch host, or an issue key of one of its projects; the record keeps " + "the whole reading. --dry-run prints the line the record would print, and records nothing. " + "Name the check by its block id. Where two Verification documents in reach hold that id, " + "name it by its canonical reference (dispatch://KEY/artifact/verification-md#b-<id>). " + "409 CHECK_AMBIGUOUS names both documents. An id no Verification document of the issue " + "or of an issue above it holds is 400 UNKNOWN_CHECK. " + `${CHECK_PROVED_BY_CI}. ` + "Dispatch reads its result from that run, so a record for it is 409 " + "CHECK_PROVED_BY_CI from every role, which names the check and the run. " + "A pass that counts a failed, a skipped or an excluded case contradicts itself, and is " + "400 RESULT_CONTRADICTS. " + "Dispatch asks GitHub whether the repository of the check's issue holds the commit. If " + "GitHub does not say that it does, Dispatch reads the external links of the check's issue: " + "a link to a GitHub pull request (https://github.com/<owner>/<repo>/pull/<n>) that is open " + "or merged, in a repository that Dispatch's GitHub App is installed on and can read, adds " + "the repository of that pull request. One record reads at most 10 linked pull requests. A " + "commit that none of these repositories holds is 400 RESULT_COMMIT_UNKNOWN, which names the " + "commit and each owner/repo that Dispatch asked. It also names, with its reason " + "(owner/repo#n (repository_unreadable)), each linked pull request that Dispatch could not " + "read, at most 10 and a count of the rest, and every linked pull request in whose " + "repository it could not read the commit, since each of those spent one of the record's 10 " + "reads, and says to grant Dispatch's GitHub App that repository or to link a readable pull " + "request. It says how many linked pull requests it left unread past that bound. Record the " + "result after the commit is pushed. A linked repository that the App is not installed on " + "or cannot read does " + "not count. Where a read of " + "a linked pull request or of a linked repository does not answer, and no repository is shown " + "to hold the commit, the record is 502 GITHUB_UNREADABLE and nothing is recorded: record the " + "result again, after the wait the refusal names for a rate limit. Where the issue has no " + "repository, the result is recorded as before. Where Dispatch cannot read the repository " + "of the check's issue, the result is recorded as before only when every linked read " + "answers and no linked repository holds the commit: a linked read that does not answer " + "is 502 GITHUB_UNREADABLE and nothing is recorded. " + "The result is recorded against the check's own issue, so a child's run of a parent's " + "check appears under that check. A closed issue takes a result only for a check whose " + "when is after_merge or default_branch, the production check after the merge. It refuses " + "every other record with 409 ISSUE_CLOSED, as it refuses every other write. " + "A check a document version rewords while the result is being written is 409 " + "CHECK_CONTENDED, with nothing recorded: run the same command again. " + RESULT_RETRACT_RULE + " The retraction keeps both records: the result stays readable, and it proves nothing " + "from then on. Record a new result where the check still needs one. A retraction is " + "taken on a closed issue and for a check of any when. Three callers may retract: the " + "session that recorded the result, a session that holds the Dispatch claim of the issue " + "the result was recorded on, and a caller whose credential carries a person. Every other " + "caller is 403 RETRACTION_FORBIDDEN. A result retracted already is 409 RESULT_RETRACTED. " + ISSUE_REFERENCE,
|
|
37426
37451
|
arguments: (z) => ({
|
|
37427
37452
|
issue: z.string().describe(ISSUE_REFERENCE).optional(),
|
|
37428
37453
|
check: z.string().describe("The check block's id, or its canonical reference dispatch://KEY/artifact/verification-md#b-<id> when the id is not unique among the issue's Verification document and those of the issues above it.").optional(),
|
|
@@ -49185,6 +49210,153 @@ function childrenSummary(issue) {
|
|
|
49185
49210
|
`);
|
|
49186
49211
|
}
|
|
49187
49212
|
|
|
49213
|
+
// ../envoy-client/src/dispatch-commands/render-results.ts
|
|
49214
|
+
var BRIEF_READING_CHARACTERS = 200;
|
|
49215
|
+
var COMPARISON_REASONS = {
|
|
49216
|
+
no_pull_request_or_branch: () => "the issue has no pull request and no branch to compare with",
|
|
49217
|
+
repository_unreadable: (repo = "the repository") => `Dispatch cannot read ${repo}`,
|
|
49218
|
+
read_failed: (repo) => repo === undefined ? "a read Dispatch made did not answer" : `a read Dispatch made of ${repo} did not answer`
|
|
49219
|
+
};
|
|
49220
|
+
function isComparisonReason(reason) {
|
|
49221
|
+
return Object.hasOwn(COMPARISON_REASONS, reason);
|
|
49222
|
+
}
|
|
49223
|
+
function reasonText(reason, repo) {
|
|
49224
|
+
if (isComparisonReason(reason))
|
|
49225
|
+
return COMPARISON_REASONS[reason](repo);
|
|
49226
|
+
return repo === undefined ? reason : `${reason} (${repo})`;
|
|
49227
|
+
}
|
|
49228
|
+
function learnedText(learned) {
|
|
49229
|
+
if (learned.kind === "read_at")
|
|
49230
|
+
return `Dispatch read it ${learned.at}`;
|
|
49231
|
+
return `GitHub updated it ${learned.at}`;
|
|
49232
|
+
}
|
|
49233
|
+
function pullRequestName(basis, number) {
|
|
49234
|
+
return basis.repo === undefined ? `pull request #${number}` : `${basis.repo}#${number}`;
|
|
49235
|
+
}
|
|
49236
|
+
function branchName(basis) {
|
|
49237
|
+
const branch = basis.branch ?? "unnamed";
|
|
49238
|
+
return basis.repo === undefined ? branch : `${branch} of ${basis.repo}`;
|
|
49239
|
+
}
|
|
49240
|
+
function basisText(basis) {
|
|
49241
|
+
const learned = basis.learned_at === undefined ? "" : ` (${learnedText(basis.learned_at)})`;
|
|
49242
|
+
if (basis.kind === "pull_request") {
|
|
49243
|
+
const pullRequest = basis.pull_request === undefined ? "pull request " : `${pullRequestName(basis, basis.pull_request)} `;
|
|
49244
|
+
return `the head of ${pullRequest}at ${basis.commit ?? "an unnamed commit"}${learned}`;
|
|
49245
|
+
}
|
|
49246
|
+
if (basis.kind === "branch")
|
|
49247
|
+
return `branch ${branchName(basis)}${learned}`;
|
|
49248
|
+
return `the commit you named, ${basis.commit ?? ""}${learned}`;
|
|
49249
|
+
}
|
|
49250
|
+
function basisPlace(basis) {
|
|
49251
|
+
if (basis.kind === "pull_request") {
|
|
49252
|
+
return basis.pull_request === undefined ? "the head of a pull request" : `the head of ${pullRequestName(basis, basis.pull_request)}`;
|
|
49253
|
+
}
|
|
49254
|
+
if (basis.kind === "branch")
|
|
49255
|
+
return `on branch ${branchName(basis)}`;
|
|
49256
|
+
return "the commit you named";
|
|
49257
|
+
}
|
|
49258
|
+
function commitStandsText(stands) {
|
|
49259
|
+
if (stands === undefined) {
|
|
49260
|
+
return "Where that commit stands is not known: this Dispatch server does not say";
|
|
49261
|
+
}
|
|
49262
|
+
if (stands.answer === "at_basis") {
|
|
49263
|
+
return stands.basis === undefined ? "That commit is one of the compared commits" : `That commit is ${basisPlace(stands.basis)}`;
|
|
49264
|
+
}
|
|
49265
|
+
if (stands.answer === "other_commit") {
|
|
49266
|
+
return stands.repo === undefined ? "That commit is none of the compared commits" : `That commit, of ${stands.repo}, is none of the compared commits`;
|
|
49267
|
+
}
|
|
49268
|
+
if (stands.reason === undefined) {
|
|
49269
|
+
return stands.repo === undefined ? "Where that commit stands is not known" : `Where that commit of ${stands.repo} stands is not known`;
|
|
49270
|
+
}
|
|
49271
|
+
return `Where that commit stands is not known: ${reasonText(stands.reason, stands.repo)}`;
|
|
49272
|
+
}
|
|
49273
|
+
function checkWordsText(check, result) {
|
|
49274
|
+
const versions = `result version ${result.check_version}, check version ${check.version}`;
|
|
49275
|
+
if (result.check_words_moved === undefined) {
|
|
49276
|
+
return `Whether the check's words moved is not known (${versions})`;
|
|
49277
|
+
}
|
|
49278
|
+
return result.check_words_moved ? `The check's words moved after this result (${versions})` : `The check's words did not move after this result (${versions})`;
|
|
49279
|
+
}
|
|
49280
|
+
function passStandsText(pass) {
|
|
49281
|
+
if (pass === undefined)
|
|
49282
|
+
return "Whether a pass stands is not known: this Dispatch server does not say";
|
|
49283
|
+
if (pass.answer === "yes") {
|
|
49284
|
+
const roles = pass.roles ?? [];
|
|
49285
|
+
return roles.length === 0 ? "A pass stands: yes" : `A pass stands: yes, from ${roles.join(", ")}`;
|
|
49286
|
+
}
|
|
49287
|
+
if (pass.answer === "no")
|
|
49288
|
+
return "A pass stands: no";
|
|
49289
|
+
return "A pass stands: not known";
|
|
49290
|
+
}
|
|
49291
|
+
function readingLines(result, brief, indent = " ") {
|
|
49292
|
+
const observed = result.observed;
|
|
49293
|
+
if (observed === "")
|
|
49294
|
+
return [`${indent}The role recorded no reading.`];
|
|
49295
|
+
const cut = brief && result.commit_stands?.answer !== "at_basis";
|
|
49296
|
+
if (cut && observed.length > BRIEF_READING_CHARACTERS) {
|
|
49297
|
+
return [
|
|
49298
|
+
`${indent}Reading: ${observed.slice(0, BRIEF_READING_CHARACTERS)}\u2026 (result ${result.id})`
|
|
49299
|
+
];
|
|
49300
|
+
}
|
|
49301
|
+
return [`${indent}Reading: ${observed}`];
|
|
49302
|
+
}
|
|
49303
|
+
function resultLines(check, result, brief) {
|
|
49304
|
+
const lines = [
|
|
49305
|
+
` - ${result.verdict} by ${result.role} at ${result.commit_sha}. ${commitStandsText(result.commit_stands)}. ${checkWordsText(check, result)}. Recorded ${result.created_at}. Result ${result.id}.`
|
|
49306
|
+
];
|
|
49307
|
+
const retracted = result.retracted;
|
|
49308
|
+
if (retracted !== undefined) {
|
|
49309
|
+
lines.push(` Retracted by ${actorText(retracted.actor)} at ${retracted.created_at}. The reason: ${retracted.reason}`);
|
|
49310
|
+
}
|
|
49311
|
+
return [...lines, ...readingLines(result, brief)];
|
|
49312
|
+
}
|
|
49313
|
+
function ciCheckLines(check, ci, brief) {
|
|
49314
|
+
const passStandsLine = ` ${passStandsText(check.pass_stands)}.`;
|
|
49315
|
+
const pullRequestLine = ` Pull request line: ${ci.line}`;
|
|
49316
|
+
const derived = check.results?.[0];
|
|
49317
|
+
if (derived === undefined) {
|
|
49318
|
+
return [
|
|
49319
|
+
`- ${check.block_id} (${check.when}): no result: ${ci.detail} ${check.text}`,
|
|
49320
|
+
passStandsLine,
|
|
49321
|
+
pullRequestLine
|
|
49322
|
+
];
|
|
49323
|
+
}
|
|
49324
|
+
const stands = commitStandsText(derived.commit_stands);
|
|
49325
|
+
return [
|
|
49326
|
+
`- ${check.block_id} (${check.when}): ${derived.verdict} at ${derived.commit_sha} by ${derived.role} (CI run ${ci.run}, ${ci.case}), ${stands.charAt(0).toLowerCase()}${stands.slice(1)}. ${check.text}`,
|
|
49327
|
+
passStandsLine,
|
|
49328
|
+
pullRequestLine,
|
|
49329
|
+
...readingLines(derived, brief, " ")
|
|
49330
|
+
];
|
|
49331
|
+
}
|
|
49332
|
+
function checkLines(check, brief) {
|
|
49333
|
+
if (check.ci !== undefined)
|
|
49334
|
+
return ciCheckLines(check, check.ci, brief);
|
|
49335
|
+
const bases = check.compared_with ?? [];
|
|
49336
|
+
const reason = check.compared_nothing;
|
|
49337
|
+
const compared = bases.length > 0 ? `Compared with ${bases.map(basisText).join(", ")}` : reason === undefined ? "Compared with nothing, and this Dispatch server does not say why" : `Compared with nothing: ${reasonText(reason)}`;
|
|
49338
|
+
const results = check.results ?? [];
|
|
49339
|
+
return [
|
|
49340
|
+
`- ${check.block_id} (${check.when}). ${compared}. ${passStandsText(check.pass_stands)}.`,
|
|
49341
|
+
` The check's words: ${check.text}`,
|
|
49342
|
+
...results.length === 0 ? [" No result is recorded for this check."] : results.flatMap((result) => resultLines(check, result, brief))
|
|
49343
|
+
];
|
|
49344
|
+
}
|
|
49345
|
+
function formatCheckResults(results, brief = false) {
|
|
49346
|
+
if (results.verification_artifact_id === "") {
|
|
49347
|
+
return `${results.issue} has no Verification document, so it has no checks. Write one (verification.md) with a check block per thing that must be proved.`;
|
|
49348
|
+
}
|
|
49349
|
+
const checks = results.checks ?? [];
|
|
49350
|
+
if (checks.length === 0) {
|
|
49351
|
+
return `${results.issue}'s Verification document holds no check blocks.`;
|
|
49352
|
+
}
|
|
49353
|
+
const blocks = checks.map((check) => checkLines(check, brief).join(`
|
|
49354
|
+
`));
|
|
49355
|
+
return [`Checks of ${results.issue}:`, ...blocks].join(`
|
|
49356
|
+
|
|
49357
|
+
`);
|
|
49358
|
+
}
|
|
49359
|
+
|
|
49188
49360
|
// ../envoy-client/src/dispatch-subscribe.ts
|
|
49189
49361
|
function followedAsk(details) {
|
|
49190
49362
|
if (typeof details !== "object" || details === null)
|
|
@@ -49710,132 +49882,6 @@ async function issuesCommand(context) {
|
|
|
49710
49882
|
details: { issues: rows, total, offset, limit }
|
|
49711
49883
|
};
|
|
49712
49884
|
}
|
|
49713
|
-
var BRIEF_READING_CHARACTERS = 200;
|
|
49714
|
-
var COMPARISON_REASONS = {
|
|
49715
|
-
no_pull_request_or_branch: "the issue has no pull request and no branch to compare with",
|
|
49716
|
-
repository_unreadable: "Dispatch cannot read the repository",
|
|
49717
|
-
read_failed: "a read Dispatch made did not answer"
|
|
49718
|
-
};
|
|
49719
|
-
function learnedText(learned) {
|
|
49720
|
-
if (learned.kind === "read_at")
|
|
49721
|
-
return `Dispatch read it ${learned.at}`;
|
|
49722
|
-
return `GitHub updated it ${learned.at}`;
|
|
49723
|
-
}
|
|
49724
|
-
function basisText(basis) {
|
|
49725
|
-
const learned = basis.learned_at === undefined ? "" : ` (${learnedText(basis.learned_at)})`;
|
|
49726
|
-
if (basis.kind === "pull_request") {
|
|
49727
|
-
const number = basis.pull_request === undefined ? "" : `#${basis.pull_request} `;
|
|
49728
|
-
return `the head of pull request ${number}at ${basis.commit ?? "an unnamed commit"}${learned}`;
|
|
49729
|
-
}
|
|
49730
|
-
if (basis.kind === "branch")
|
|
49731
|
-
return `branch ${basis.branch ?? "unnamed"}${learned}`;
|
|
49732
|
-
return `the commit you named, ${basis.commit ?? ""}${learned}`;
|
|
49733
|
-
}
|
|
49734
|
-
function basisPlace(basis) {
|
|
49735
|
-
if (basis.kind === "pull_request") {
|
|
49736
|
-
return basis.pull_request === undefined ? "the head of a pull request" : `the head of pull request #${basis.pull_request}`;
|
|
49737
|
-
}
|
|
49738
|
-
if (basis.kind === "branch")
|
|
49739
|
-
return `on branch ${basis.branch ?? "unnamed"}`;
|
|
49740
|
-
return "the commit you named";
|
|
49741
|
-
}
|
|
49742
|
-
function commitStandsText(stands) {
|
|
49743
|
-
if (stands === undefined) {
|
|
49744
|
-
return "Where that commit stands is not known: this Dispatch server does not say";
|
|
49745
|
-
}
|
|
49746
|
-
if (stands.answer === "at_basis") {
|
|
49747
|
-
return stands.basis === undefined ? "That commit is one of the compared commits" : `That commit is ${basisPlace(stands.basis)}`;
|
|
49748
|
-
}
|
|
49749
|
-
if (stands.answer === "other_commit")
|
|
49750
|
-
return "That commit is none of the compared commits";
|
|
49751
|
-
return stands.reason === undefined ? "Where that commit stands is not known" : `Where that commit stands is not known: ${COMPARISON_REASONS[stands.reason]}`;
|
|
49752
|
-
}
|
|
49753
|
-
function checkWordsText(check, result) {
|
|
49754
|
-
const versions = `result version ${result.check_version}, check version ${check.version}`;
|
|
49755
|
-
if (result.check_words_moved === undefined) {
|
|
49756
|
-
return `Whether the check's words moved is not known (${versions})`;
|
|
49757
|
-
}
|
|
49758
|
-
return result.check_words_moved ? `The check's words moved after this result (${versions})` : `The check's words did not move after this result (${versions})`;
|
|
49759
|
-
}
|
|
49760
|
-
function passStandsText(pass) {
|
|
49761
|
-
if (pass === undefined)
|
|
49762
|
-
return "Whether a pass stands is not known: this Dispatch server does not say";
|
|
49763
|
-
if (pass.answer === "yes") {
|
|
49764
|
-
const roles = pass.roles ?? [];
|
|
49765
|
-
return roles.length === 0 ? "A pass stands: yes" : `A pass stands: yes, from ${roles.join(", ")}`;
|
|
49766
|
-
}
|
|
49767
|
-
if (pass.answer === "no")
|
|
49768
|
-
return "A pass stands: no";
|
|
49769
|
-
return "A pass stands: not known";
|
|
49770
|
-
}
|
|
49771
|
-
function readingLines(result, brief, indent = " ") {
|
|
49772
|
-
const observed = result.observed;
|
|
49773
|
-
if (observed === "")
|
|
49774
|
-
return [`${indent}The role recorded no reading.`];
|
|
49775
|
-
const cut = brief && result.commit_stands?.answer !== "at_basis";
|
|
49776
|
-
if (cut && observed.length > BRIEF_READING_CHARACTERS) {
|
|
49777
|
-
return [
|
|
49778
|
-
`${indent}Reading: ${observed.slice(0, BRIEF_READING_CHARACTERS)}\u2026 (result ${result.id})`
|
|
49779
|
-
];
|
|
49780
|
-
}
|
|
49781
|
-
return [`${indent}Reading: ${observed}`];
|
|
49782
|
-
}
|
|
49783
|
-
function resultLines(check, result, brief) {
|
|
49784
|
-
const lines = [
|
|
49785
|
-
` - ${result.verdict} by ${result.role} at ${result.commit_sha}. ${commitStandsText(result.commit_stands)}. ${checkWordsText(check, result)}. Recorded ${result.created_at}. Result ${result.id}.`
|
|
49786
|
-
];
|
|
49787
|
-
const retracted = result.retracted;
|
|
49788
|
-
if (retracted !== undefined) {
|
|
49789
|
-
lines.push(` Retracted by ${actorText(retracted.actor)} at ${retracted.created_at}. The reason: ${retracted.reason}`);
|
|
49790
|
-
}
|
|
49791
|
-
return [...lines, ...readingLines(result, brief)];
|
|
49792
|
-
}
|
|
49793
|
-
function ciCheckLines(check, ci, brief) {
|
|
49794
|
-
const passStandsLine = ` ${passStandsText(check.pass_stands)}.`;
|
|
49795
|
-
const pullRequestLine = ` Pull request line: ${ci.line}`;
|
|
49796
|
-
const derived = check.results?.[0];
|
|
49797
|
-
if (derived === undefined) {
|
|
49798
|
-
return [
|
|
49799
|
-
`- ${check.block_id} (${check.when}): no result: ${ci.detail} ${check.text}`,
|
|
49800
|
-
passStandsLine,
|
|
49801
|
-
pullRequestLine
|
|
49802
|
-
];
|
|
49803
|
-
}
|
|
49804
|
-
const stands = commitStandsText(derived.commit_stands);
|
|
49805
|
-
return [
|
|
49806
|
-
`- ${check.block_id} (${check.when}): ${derived.verdict} at ${derived.commit_sha} by ${derived.role} (CI run ${ci.run}, ${ci.case}), ${stands.charAt(0).toLowerCase()}${stands.slice(1)}. ${check.text}`,
|
|
49807
|
-
passStandsLine,
|
|
49808
|
-
pullRequestLine,
|
|
49809
|
-
...readingLines(derived, brief, " ")
|
|
49810
|
-
];
|
|
49811
|
-
}
|
|
49812
|
-
function checkLines(check, brief) {
|
|
49813
|
-
if (check.ci !== undefined)
|
|
49814
|
-
return ciCheckLines(check, check.ci, brief);
|
|
49815
|
-
const bases = check.compared_with ?? [];
|
|
49816
|
-
const reason = check.compared_nothing;
|
|
49817
|
-
const compared = bases.length > 0 ? `Compared with ${bases.map(basisText).join(", ")}` : reason === undefined ? "Compared with nothing, and this Dispatch server does not say why" : `Compared with nothing: ${COMPARISON_REASONS[reason]}`;
|
|
49818
|
-
const results = check.results ?? [];
|
|
49819
|
-
return [
|
|
49820
|
-
`- ${check.block_id} (${check.when}). ${compared}. ${passStandsText(check.pass_stands)}.`,
|
|
49821
|
-
` The check's words: ${check.text}`,
|
|
49822
|
-
...results.length === 0 ? [" No result is recorded for this check."] : results.flatMap((result) => resultLines(check, result, brief))
|
|
49823
|
-
];
|
|
49824
|
-
}
|
|
49825
|
-
function formatCheckResults(results, brief = false) {
|
|
49826
|
-
if (results.verification_artifact_id === "") {
|
|
49827
|
-
return `${results.issue} has no Verification document, so it has no checks. Write one (verification.md) with a check block per thing that must be proved.`;
|
|
49828
|
-
}
|
|
49829
|
-
const checks = results.checks ?? [];
|
|
49830
|
-
if (checks.length === 0) {
|
|
49831
|
-
return `${results.issue}'s Verification document holds no check blocks.`;
|
|
49832
|
-
}
|
|
49833
|
-
const blocks = checks.map((check) => checkLines(check, brief).join(`
|
|
49834
|
-
`));
|
|
49835
|
-
return [`Checks of ${results.issue}:`, ...blocks].join(`
|
|
49836
|
-
|
|
49837
|
-
`);
|
|
49838
|
-
}
|
|
49839
49885
|
function dryRunAsksDispatch(tool, args) {
|
|
49840
49886
|
return tool === "dispatch_result" && args["retract"] === undefined;
|
|
49841
49887
|
}
|
|
@@ -50587,6 +50633,7 @@ async function commentCommand(context) {
|
|
|
50587
50633
|
const replyToAsk = replyToAskTarget === undefined ? undefined : await resolveReplyToAsk(input.tool, client, owner, resolved, replyToAskTarget.id);
|
|
50588
50634
|
const replyToBlock = replyTo?.block ?? replyToAskTarget?.block;
|
|
50589
50635
|
const requestedTurn = optionalString(args, "turn");
|
|
50636
|
+
const mentions = optionalStringArray(args, "mentions");
|
|
50590
50637
|
const body = await writePictures(resolved, stringArg(args, "body"));
|
|
50591
50638
|
const commentInput = {
|
|
50592
50639
|
body,
|
|
@@ -50595,6 +50642,7 @@ async function commentCommand(context) {
|
|
|
50595
50642
|
...replyToBlock === undefined ? {} : { reply_to_block: replyToBlock },
|
|
50596
50643
|
...replyToAsk === undefined ? {} : { ask_id: replyToAsk },
|
|
50597
50644
|
...requestedTurn === undefined ? {} : { turn: requestedTurn },
|
|
50645
|
+
...mentions === undefined ? {} : { mentions: mentions.map((target) => ({ target })) },
|
|
50598
50646
|
actor
|
|
50599
50647
|
};
|
|
50600
50648
|
const comment = resolved?.owner.kind === "project" ? await client.artifactComment(resolved.artifact.id, commentInput) : await client.comment(issue(), commentInput);
|
|
@@ -58531,7 +58579,7 @@ var import_nats2 = __toESM(require_mod4(), 1);
|
|
|
58531
58579
|
|
|
58532
58580
|
// package.json
|
|
58533
58581
|
var name2 = "@sjawhar/claude-envoy";
|
|
58534
|
-
var version2 = "4.
|
|
58582
|
+
var version2 = "4.15.0";
|
|
58535
58583
|
var legion = {
|
|
58536
58584
|
daemonApiVersion: 178
|
|
58537
58585
|
};
|