@sjawhar/claude-envoy 5.19.3 → 5.20.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 +77 -27
- package/dist/dispatch.js +77 -27
- package/dist/envoy-channel.js +78 -28
- package/dist/session-hook.js +77 -27
- package/package.json +1 -1
package/dist/session-hook.js
CHANGED
|
@@ -17282,6 +17282,9 @@ var PriorityUpdatedEventPayloadSchema = strictObject({ id: string2(), change: _e
|
|
|
17282
17282
|
// ../contracts/src/dispatch-api-limits.ts
|
|
17283
17283
|
var MAX_ISSUE_BLOCKERS = 20;
|
|
17284
17284
|
var MAX_ISSUE_ADVANCES = 20;
|
|
17285
|
+
var MAX_ISSUE_LABELS = 20;
|
|
17286
|
+
var ISSUE_LABEL_MAX = 40;
|
|
17287
|
+
var MAX_ISSUE_COMPONENTS = 50;
|
|
17285
17288
|
var ISSUE_TITLE_MAX = 1000;
|
|
17286
17289
|
var PROJECT_NAME_MAX = 80;
|
|
17287
17290
|
var MAX_ISSUE_PAGE_LIMIT = 250;
|
|
@@ -17500,6 +17503,9 @@ var DecisionKeptEventPayloadSchema = strictObject({
|
|
|
17500
17503
|
changed_version: number2().int()
|
|
17501
17504
|
}).readonly();
|
|
17502
17505
|
|
|
17506
|
+
// ../contracts/src/go-blank.ts
|
|
17507
|
+
var goBlankPattern = /^[\t\n\v\f\r \u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*$/u;
|
|
17508
|
+
|
|
17503
17509
|
// ../contracts/src/dispatch-tools.ts
|
|
17504
17510
|
function dispatchToolSchema(spec, z, opts) {
|
|
17505
17511
|
const shape = spec.arguments(z);
|
|
@@ -17665,10 +17671,11 @@ var commentValidation = {
|
|
|
17665
17671
|
message: COMMENT_RULE,
|
|
17666
17672
|
refusal: (value) => commentProblem(value) ?? COMMENT_RULE
|
|
17667
17673
|
};
|
|
17668
|
-
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.";
|
|
17674
|
+
var ISSUE_UPDATE_FIELDS_RULE = "Issue update requires at least one field besides issue: status, title, labels, labels_add, priority, assignee, external_links, route, parent, blocked_by, advances, components, repo, before, or after.";
|
|
17669
17675
|
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";
|
|
17670
17676
|
var ISSUE_UPDATE_REASON_RULE = "reason goes only with status done";
|
|
17671
|
-
var
|
|
17677
|
+
var ISSUE_UPDATE_LABELS_RULE = "labels_add goes without labels";
|
|
17678
|
+
var ISSUE_UPDATE_RULE = `${ISSUE_UPDATE_FIELDS_RULE} ${ISSUE_UPDATE_DONE_RULE}; ${ISSUE_UPDATE_REASON_RULE}; ${ISSUE_UPDATE_LABELS_RULE}.`;
|
|
17672
17679
|
function issueUpdateProblem(value) {
|
|
17673
17680
|
const input = value;
|
|
17674
17681
|
if (input.status === "done") {
|
|
@@ -17679,7 +17686,10 @@ function issueUpdateProblem(value) {
|
|
|
17679
17686
|
const status = typeof input.status === "string" ? `status ${input.status}` : "an update without status done";
|
|
17680
17687
|
return `${ISSUE_UPDATE_REASON_RULE}: it is the note posted on the issue as it closes, and ${status} closes nothing. Drop reason, or set status done to close the issue.`;
|
|
17681
17688
|
}
|
|
17682
|
-
|
|
17689
|
+
if (input.labels !== undefined && input.labels_add !== undefined) {
|
|
17690
|
+
return `${ISSUE_UPDATE_LABELS_RULE}: labels replaces every label the issue holds and labels_add adds to them, so name the labels to add in labels_add alone, or the whole set in labels alone.`;
|
|
17691
|
+
}
|
|
17692
|
+
const changesAField = typeof input.status === "string" || typeof input.title === "string" || Array.isArray(input.labels) || Array.isArray(input.labels_add) || typeof input.priority === "number" || input.priority === null || typeof input.assignee === "string" || input.assignee === null || Array.isArray(input.external_links) || typeof input.route === "string" || typeof input.parent === "string" || Array.isArray(input.blocked_by) || Array.isArray(input.advances) || typeof input.components === "object" && input.components !== null || typeof input.repo === "string" || typeof input.before === "string" || typeof input.after === "string";
|
|
17683
17693
|
return changesAField ? undefined : ISSUE_UPDATE_FIELDS_RULE;
|
|
17684
17694
|
}
|
|
17685
17695
|
var messageValidation = {
|
|
@@ -17714,12 +17724,20 @@ var readValidation = {
|
|
|
17714
17724
|
refusal: (value) => readProblem(value) ?? `${READ_OWNER_RULE} ${READ_MESSAGE_RULE} ${READ_HISTORY_RULE}`
|
|
17715
17725
|
};
|
|
17716
17726
|
var ISSUE_COMPONENTS_MODES = ["inherit", "explicit", "none"];
|
|
17727
|
+
var COMPONENTS_RULE = "components mode explicit names ids, and mode none names a reason.";
|
|
17717
17728
|
function componentsArgument(z) {
|
|
17718
|
-
return z.
|
|
17719
|
-
mode: z.enum(ISSUE_COMPONENTS_MODES).describe("inherit: take the parent chain's attachment within the issue's own project (the default; deletes this issue's own). explicit: attach to ids. none: not architectural work, with reason."),
|
|
17720
|
-
ids: z.array(z.string({ min: 1 }), { min: 1, max:
|
|
17721
|
-
reason: z.string({ min: 1 }).describe("
|
|
17722
|
-
})
|
|
17729
|
+
return z.refineObject({
|
|
17730
|
+
mode: z.enum(ISSUE_COMPONENTS_MODES).describe("inherit: take the parent chain's attachment within the issue's own project (the default; deletes this issue's own). explicit: attach to ids, which it requires. none: not architectural work, with the reason it requires."),
|
|
17731
|
+
ids: z.array(z.string({ min: 1 }), { min: 1, max: MAX_ISSUE_COMPONENTS }).describe("Required for mode explicit: bare component ids from the project's architecture model (web, dispatch-server), not external ones.").optional(),
|
|
17732
|
+
reason: z.string({ min: 1 }).describe("Required for mode none: why this issue is not architectural (process, hiring, ops).").optional()
|
|
17733
|
+
}, (value) => {
|
|
17734
|
+
const input = value;
|
|
17735
|
+
if (input.mode === "explicit")
|
|
17736
|
+
return Array.isArray(input.ids) && input.ids.length > 0;
|
|
17737
|
+
if (input.mode === "none")
|
|
17738
|
+
return typeof input.reason === "string" && !goBlankPattern.test(input.reason);
|
|
17739
|
+
return true;
|
|
17740
|
+
}, COMPONENTS_RULE).describe(`Attach the issue to architecture components. Attach the root before decomposing it; children inherit unless they choose. ${COMPONENTS_RULE}`);
|
|
17723
17741
|
}
|
|
17724
17742
|
var SPEC_WRITING_POINTER = "Write a spec as skill://dispatch-writing-specs says.";
|
|
17725
17743
|
var CI_CHECK_RULE = "A check block whose ci_check names the CI check run that proves it carries no run, keeps when " + "before_merge, names its negative_control, and holds no recorded result. A write that adds a " + "check block, or changes a check's ci_check, run, when or negative_control, so that it breaks " + "one of those rules is refused with 400 INVALID_CI_CHECK, which names the block and the rule. " + "A check that already holds a result never becomes CI's: write a new check block under a new id.";
|
|
@@ -17767,7 +17785,7 @@ var REVIEW_REASON_RULE = "verdict changes_requested requires reason, a non-empty
|
|
|
17767
17785
|
var reviewValidation = {
|
|
17768
17786
|
check: (value) => {
|
|
17769
17787
|
const input = value;
|
|
17770
|
-
return input.verdict !== "changes_requested" || typeof input.reason === "string" && input.reason
|
|
17788
|
+
return input.verdict !== "changes_requested" || typeof input.reason === "string" && !goBlankPattern.test(input.reason);
|
|
17771
17789
|
},
|
|
17772
17790
|
message: REVIEW_REASON_RULE
|
|
17773
17791
|
};
|
|
@@ -17858,10 +17876,10 @@ var dispatchToolSpecs = [
|
|
|
17858
17876
|
parent: z.string().describe("Optional parent issue, in any project.").optional(),
|
|
17859
17877
|
blocked_by: z.array(z.string({ min: 1 }), { max: MAX_ISSUE_BLOCKERS }).describe("Issue keys this issue waits on; a key of any project, so work tracked elsewhere can be named. Dispatch refuses a dependency cycle.").optional(),
|
|
17860
17878
|
advances: z.array(z.string({ min: 1 }), { max: MAX_ISSUE_ADVANCES }).describe("Ids of the deployment's priorities this issue advances, which dispatch priorities lists. A child inherits every priority the issues above it advance, so name here only what this issue adds.").optional(),
|
|
17861
|
-
external: z.string().describe("Optional external issue reference.").optional(),
|
|
17879
|
+
external: z.string().describe("Optional external issue reference, owner/repo#n: the GitHub issue to import into the project this call names. A reference already imported into that project answers its issue and creates nothing; one already imported into another project is refused with 400 EXTERNAL_PROJECT_MISMATCH.").optional(),
|
|
17862
17880
|
force: z.boolean().describe("Create even though POSSIBLE_DUPLICATE listed similar issues; pass it only after reading them.").optional(),
|
|
17863
17881
|
spec: z.string().describe(`Optional initial primary-document markdown. ${SPEC_WRITING_POINTER}`).optional(),
|
|
17864
|
-
labels: z.array(z.string({ min: 1, max:
|
|
17882
|
+
labels: z.array(z.string({ min: 1, max: ISSUE_LABEL_MAX }), { max: MAX_ISSUE_LABELS }).describe(`Optional initial labels, at most ${MAX_ISSUE_LABELS} labels of up to ${ISSUE_LABEL_MAX} characters.`).optional(),
|
|
17865
17883
|
priority: z.number({ int: true, min: 0, max: 3 }).describe("Optional coarse priority, a number from 0 to 3: 0 is highest and 3 is lowest.").optional(),
|
|
17866
17884
|
assignee: z.string().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); defaults to your owner when you act for a person, else the parent's assignee, else the project's default assignee. Every project names a default assignee, so a new issue always has one. A parent in another project passes on no assignee. A question on it reaches the person it was handed to, else the issue's assignee, else the project's default assignee. Set it only when a person said who owns the issue.").optional(),
|
|
17867
17885
|
components: componentsArgument(z).optional(),
|
|
@@ -17875,13 +17893,14 @@ var dispatchToolSpecs = [
|
|
|
17875
17893
|
priority: 1,
|
|
17876
17894
|
before: "DSP-2"
|
|
17877
17895
|
},
|
|
17878
|
-
description: "Update an existing issue: move its lifecycle status, retitle it, replace its labels, set " + "its priority, set or clear its assignee, link a URL (the pull request that delivers it, a " + "run, a document), set its " + "route, set or clear its parent, replace the issues it is blocked by, replace the " + "priorities it advances, attach it to " + "architecture components, set the repository it targets, or move it on its project's " + "board. Status is one of " + `${ISSUE_STATUSES.join(", ")}; outside Legion, move it yourself as the work advances; inside ` + "Legion the daemon moves it. A non-empty external_links is " + "merged into the issue's existing links by URL, so linking the pull request you just opened " + "keeps every earlier link; an empty external_links removes every link instead. components " + "replaces the issue's own attachment. Closing an issue " + "(status done) requires reason, the note that says why: it is posted on the issue as a " + "message, then the issue closes, so the close carries its note; closing an issue that is " + "already closed is refused (ISSUE_CLOSED) before anything is posted. Reason goes only " + "with status done. Closing an issue withdraws every open ask " + "it holds (resolution kind withdrawn, naming the closer), and reopening it brings exactly " + "those asks back. " + "A closed issue still takes messages and comments, though not asks or artifacts; of this " + "tool's fields it takes only a board move " + "(before, after), components, " + "a reopening status (any status but done), and an external_links write that adds no new " + "link (so a link can move to the issue that replaced it); everything else, priority " + "included, waits for the reopen. " + "priority is yours to set and a human overrides it. assignee is the person who answers " + "this issue's asks, and every ask on it waits on them until a person hands that ask on. " + "Passing null unassigns the issue, and every ask on it then waits on the project's default " + "assignee: a question reaches the person it was handed to, else the issue's assignee, else " + "the project's default assignee, so every question reaches a person. " + "Set the assignee when a person said who owns the work, as you " + "file the issue or hand it over. before and after move the issue on " + "its project's board: before puts it above that issue, after below, and both together " + "land it between them. A project's board order is one agent's to keep; in a Legion " + "deployment that is the controller. Never reassign an issue a person holds to get a " + "faster answer: who holds it is their call. At least one " + `field besides issue is required. ${ISSUE_REFERENCE}`,
|
|
17896
|
+
description: "Update an existing issue: move its lifecycle status, retitle it, add labels to it or " + "replace its labels, set " + "its priority, set or clear its assignee, link a URL (the pull request that delivers it, a " + "run, a document), set its " + "route, set or clear its parent, replace the issues it is blocked by, replace the " + "priorities it advances, attach it to " + "architecture components, set the repository it targets, or move it on its project's " + "board. Status is one of " + `${ISSUE_STATUSES.join(", ")}; outside Legion, move it yourself as the work advances; inside ` + "Legion the daemon moves it. labels_add adds labels and keeps every label the issue holds; " + "labels replaces the whole set, so a label it does not name is removed, and the two never " + "go together. A non-empty external_links is " + "merged into the issue's existing links by URL, so linking the pull request you just opened " + "keeps every earlier link; an empty external_links removes every link instead. components " + "replaces the issue's own attachment. Closing an issue " + "(status done) requires reason, the note that says why: it is posted on the issue as a " + "message, then the issue closes, so the close carries its note; closing an issue that is " + "already closed is refused (ISSUE_CLOSED) before anything is posted. Reason goes only " + "with status done. Closing an issue withdraws every open ask " + "it holds (resolution kind withdrawn, naming the closer), and reopening it brings exactly " + "those asks back. " + "A closed issue still takes messages and comments, though not asks or artifacts; of this " + "tool's fields it takes only a board move " + "(before, after), components, " + "a reopening status (any status but done), and an external_links write that adds no new " + "link (so a link can move to the issue that replaced it); everything else, priority " + "included, waits for the reopen. " + "priority is yours to set and a human overrides it. assignee is the person who answers " + "this issue's asks, and every ask on it waits on them until a person hands that ask on. " + "Passing null unassigns the issue, and every ask on it then waits on the project's default " + "assignee: a question reaches the person it was handed to, else the issue's assignee, else " + "the project's default assignee, so every question reaches a person. " + "Set the assignee when a person said who owns the work, as you " + "file the issue or hand it over. before and after move the issue on " + "its project's board: before puts it above that issue, after below, and both together " + "land it between them. A project's board order is one agent's to keep; in a Legion " + "deployment that is the controller. Never reassign an issue a person holds to get a " + "faster answer: who holds it is their call. At least one " + `field besides issue is required. ${ISSUE_REFERENCE}`,
|
|
17879
17897
|
arguments: (z) => ({
|
|
17880
17898
|
issue: z.string().describe(ISSUE_REFERENCE),
|
|
17881
17899
|
status: z.enum(ISSUE_STATUSES).describe("New lifecycle status.").optional(),
|
|
17882
17900
|
reason: z.string().describe(`Required with status done, and only with it: why the issue is closing. Posted on the issue as a message before it closes. ${BODY_BLOCK_RULE}`).optional(),
|
|
17883
17901
|
title: z.string({ min: 1, max: ISSUE_TITLE_MAX }).describe("Replacement title, at most 1,000 characters.").optional(),
|
|
17884
|
-
labels: z.array(z.string({ min: 1, max:
|
|
17902
|
+
labels: z.array(z.string({ min: 1, max: ISSUE_LABEL_MAX }), { max: MAX_ISSUE_LABELS }).describe(`Replacement label set, at most ${MAX_ISSUE_LABELS} labels of up to ${ISSUE_LABEL_MAX} characters; replaces every existing label, so a label it does not name is removed. To add labels and keep the others, use labels_add. Not with labels_add.`).optional(),
|
|
17903
|
+
labels_add: z.array(z.string({ min: 1, max: ISSUE_LABEL_MAX }), { max: MAX_ISSUE_LABELS }).describe(`Labels to add, at most ${MAX_ISSUE_LABELS} of up to ${ISSUE_LABEL_MAX} characters: each is added to the labels the issue holds when the write lands, and every label it holds stays; the issue holds at most ${MAX_ISSUE_LABELS} in all. Not with labels.`).optional(),
|
|
17885
17904
|
priority: z.number({ int: true, min: 0, max: 3 }).nullable().optional().describe("Coarse priority: 0 is P0 (highest) through 3 is P3 (lowest); null clears it."),
|
|
17886
17905
|
assignee: z.string().nullable().optional().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); null unassigns the issue, and every ask on it then waits on the project's default assignee. Set it only when a person said who owns the issue, never to move a question off the person holding it."),
|
|
17887
17906
|
external_links: z.array(z.string({ min: 1 })).describe("URLs to link; a non-empty list merges into the issue's existing external links by URL, an empty list removes every link instead.").optional(),
|
|
@@ -18053,7 +18072,7 @@ var dispatchToolSpecs = [
|
|
|
18053
18072
|
artifact: z.string().describe("Project document artifact id, slug, or filename containing the quoted text; optional when ref names it.").optional(),
|
|
18054
18073
|
ref: z.string().describe("Optional dispatch:// issue or document reference.").optional(),
|
|
18055
18074
|
quote: z.string().describe("Exact document text to replace."),
|
|
18056
|
-
replace_with: z.string().describe("Replacement text; a CR LF or a lone carriage return in it is written as a line feed."),
|
|
18075
|
+
replace_with: z.string().describe("Replacement markdown for the quoted text. Text alone stays in the quoted text's block; whole blocks " + "(paragraphs, lists, headings written with their #s) stand where the quoted text stood, and over a " + "heading's whole text they take the heading's place, so a heading that stays is written with its #s. " + "A table cell takes text alone. To move a section, write its blocks beside the whole text of the block " + "where it goes, and suggest each moved block's text replaced with nothing where it stood (an emptied " + "heading stays as its #s alone). A CR LF or a lone carriage return in it is written as a line feed."),
|
|
18057
18076
|
body: z.string().describe(`Optional rationale. ${BODY_BLOCK_RULE}`).optional(),
|
|
18058
18077
|
occurrence: z.number({ int: true, min: 0 }).describe("Optional zero-based occurrence of quote.").optional()
|
|
18059
18078
|
}),
|
|
@@ -18139,7 +18158,7 @@ var dispatchToolSpecs = [
|
|
|
18139
18158
|
ops: [{ op: "delete_column", block: "table-123", index: 1 }],
|
|
18140
18159
|
precondition: { blocks: [{ id: "table-123", token: "sha256:current-table-token" }] }
|
|
18141
18160
|
},
|
|
18142
|
-
description: "Apply deterministic document edits: replace or delete quoted text, insert markdown at an anchor, retype an identified paragraph or typed block into a schema-declared typed block, delete or move a whole block by its id, or delete a table row or column in place. " + "Do not use it for review feedback or for reading; use dispatch comment, dispatch suggest, or dispatch doc-read instead. " + "For replace, delete, and quote anchors, find text as rendered: inline Markdown (**bold**, `code`) is tolerated and must be balanced; a leading '# ' matches a heading at any level. A find that opens with a list marker ('- ', '5. ', with an optional '[ ] ' or '[x] ' after it) and matches no text as written selects an item of that kind of list whose text starts with the rest, its number not matched and a box matching only a task item in that state. A find or quote anchor stays inside one block, and in a table inside one cell: ' | ' is the boundary markdown writes between two cells, not text a cell holds, so a quote that runs across cells is refused, naming the cells; change several cells with one operation per cell in the same batch, and anchor on one cell's text. replace parses with as markdown, as insert parses its markdown: a with that parses to one paragraph is the new text of the matched span, and one that parses to blocks ('---' over a paragraph, a list, a table, two paragraphs) writes those blocks where the match sits, so a marker of a different kind from the block's own opens the block it names ('4. Design' is an ordered list, which a heading cannot hold) unless you escape it ('4\\. Design'). A with that opens with a marker of the same kind as the matched block's own would write it twice and is INVALID_OP - including prose that merely looks like one ('1999. was a year' into an ordered item), which you write as text by escaping it ('1999\\. was a year'). The exceptions are an item a find's list marker selected (it matched no text as written): replace(find=\"5. Old\", with=\"5. New\") gives the item the text 'New' under its own number, and a with that is the marker alone is INVALID_OP; and a heading rename whose find carried a heading marker: replace(find=\"## Old\", with=\"## New\") gives '## New', where a different level applies only when find named the heading's actual level (find \"## Old\" with \"### New\" makes it an h3), since '# ' selects a heading without naming its level. A task item (`- [ ]` / `- [x]`) is ticked the same way: when find matches from the start of the item's text and with opens with '[x] ' or '[ ] ', the opening sets the item's box and the rest is its new text (replace(find=\"Write it\", with=\"[x] Write it\") ticks it); the same opening over a plain list item or a paragraph stays literal text. Any non-empty with that renders to no text - whitespace alone - is INVALID_OP rather than a silent deletion; pass an empty with to delete the matched text on purpose - a list item, quote, typed block or footnote definition left holding only the emptied paragraph keeps it. " + "The blocks a with writes are refused, with the document unchanged, where the block holding the match cannot hold them: a heading and any cell of a table, which hold one line of text, and a typed block whose content rule they break - write that block's new text alone, and insert the blocks beside it. A hard break in with is INVALID_OP when the matched text is in a heading or a table cell, which are written on one line. In a table cell, with is the cell's text: write a | in it bare, in code too, since code whose text has an odd run of backslashes right before a | cannot be stored in a cell and is INVALID_OP, naming the cell. " + "A delete whose find is a block's entire text removes the block (a list emptied of its items goes too); delete with block removes any block by id, and move with block relocates one. A delete or retype that would take an ask block out of the document while its ask is open is refused, with nothing sent. delete_row and delete_column take a table block and a zero-based index, preserving the table block id and refusing to remove cells with open asks or unresolved comments. " + `Insert and move anchors also accept "start", "end", "heading:<exact heading text>", and "block:<id>"; dispatch doc-read --blocks lists every block's id, type, opening words and token, and each table's rows and cells with the indexes delete_row and delete_column take (GET /api/v1/artifacts/{artifact UUID}/blocks serves the same list). ` + "Optionally require the state just read: precondition selects exactly one of a document token from dispatch doc-read, or block {id, token} values from dispatch doc-read --blocks. A block guard must include every block the batch changes; Dispatch resolves quote targets and rejects an uncovered batch rather than applying it. Use a document token for insert or move, which depend on document order. Prefer block tokens when the covered content blocks are independent sections. Tokens include inline marks, so a fresh human comment also makes a stale edit fail. PRECONDITION_FAILED means re-read; EDIT_QUEUE_FULL means back off before retrying. " + `${CI_CHECK_RULE} ` + "The result carries the document token this edit produced, so a chain of guarded edits passes each result's token as the next edit's precondition with no dispatch doc-read between them. " + "A batch that leaves the document exactly as it was mints no version, named or not, and the result says nothing changed and names each operation that did nothing. " + "A change a browser removes while the edit is in flight is never reported as applied: EDIT_LOST_TO_CONCURRENT_CHANGE means the write was refused and nothing was written, so re-read the document and decide again, as with PRECONDITION_FAILED; lost_ops on a successful result names operations whose text the live document no longer has, because the deletion landed after the version was written. " + "Several paragraphs, or a list, go in one replace, since with writes the blocks its markdown names; blocks beside a block go in one insert, since two inserts at one anchor come out reversed. The result prints the markdown of each block the edit wrote, so read that rather than the document again. " + "Each decision block the edit adds gets the related-item check dispatch ask gets, waiting at most five seconds for all of them together: the result prints, after its first line, `Decision block <id>:` and what that check found, that it found nothing, or that it was not made and why. " + "A block id written as {#id} longer than 256 bytes is stored, but its block is no graph node, so no reference reaches it. " + `The spec holds requirements, design, and decisions - never progress, status, or timestamps. Work still to do is a task in the issue's plan, an issue, or an ask, never a separate document that lists it. ${OWNER_REFERENCE} ${SPEC_WRITING_POINTER}`,
|
|
18161
|
+
description: "Apply deterministic document edits: replace or delete quoted text, insert markdown at an anchor, retype an identified paragraph or typed block into a schema-declared typed block, delete or move a whole block by its id, or delete a table row or column in place. " + "Do not use it for review feedback or for reading; use dispatch comment, dispatch suggest, or dispatch doc-read instead. " + "For replace, delete, and quote anchors, find text as rendered: inline Markdown (**bold**, `code`) is tolerated and must be balanced; a leading '# ' matches a heading at any level whose whole text is the rest. A find that opens with a list marker ('- ', '5. ', with an optional '[ ] ' or '[x] ' after it) and matches no text as written selects an item of that kind of list whose text starts with the rest, its number not matched and a box matching only a task item in that state. A find or quote anchor stays inside one block, and in a table inside one cell: ' | ' is the boundary markdown writes between two cells, not text a cell holds, so a quote that runs across cells is refused, naming the cells; change several cells with one operation per cell in the same batch, and anchor on one cell's text. replace parses with as markdown, as insert parses its markdown: a with that parses to one paragraph is the new text of the matched span, and one that parses to blocks ('---' over a paragraph, a list, a table, two paragraphs) writes those blocks where the match sits, so a marker of a different kind from the block's own opens the block it names ('4. Design' is an ordered list, which a heading cannot hold) unless you escape it ('4\\. Design'). A with that opens with a marker of the same kind as the matched block's own would write it twice and is INVALID_OP - including prose that merely looks like one ('1999. was a year' into an ordered item), which you write as text by escaping it ('1999\\. was a year'). The exceptions are an item a find's list marker selected (it matched no text as written): replace(find=\"5. Old\", with=\"5. New\") gives the item the text 'New' under its own number, and a with that is the marker alone is INVALID_OP; and a heading rename whose find carried a heading marker: replace(find=\"## Old\", with=\"## New\") gives '## New', where a different level applies only when find named the heading's actual level (find \"## Old\" with \"### New\" makes it an h3), since '# ' selects a heading without naming its level. A task item (`- [ ]` / `- [x]`) is ticked the same way: when find matches from the start of the item's text and with opens with '[x] ' or '[ ] ', the opening sets the item's box and the rest is its new text (replace(find=\"Write it\", with=\"[x] Write it\") ticks it); the same opening over a plain list item or a paragraph stays literal text. Any non-empty with that renders to no text - whitespace alone - is INVALID_OP rather than a silent deletion; pass an empty with to delete the matched text on purpose - a list item, quote, typed block or footnote definition left holding only the emptied paragraph keeps it. " + "The blocks a with writes are refused, with the document unchanged, where the block holding the match cannot hold them: a heading and any cell of a table, which hold one line of text, and a typed block whose content rule they break - write that block's new text alone, and insert the blocks beside it. A hard break in with is INVALID_OP when the matched text is in a heading or a table cell, which are written on one line. In a table cell, with is the cell's text: write a | in it bare, in code too, since code whose text has an odd run of backslashes right before a | cannot be stored in a cell and is INVALID_OP, naming the cell. " + "A delete whose find is a block's entire text removes the block (a list emptied of its items goes too); delete with block removes any block by id, and move with block relocates one. A delete or retype that would take an ask block out of the document while its ask is open is refused, with nothing sent. delete_row and delete_column take a table block and a zero-based index, preserving the table block id and refusing to remove cells with open asks or unresolved comments. " + `Insert and move anchors also accept "start", "end", "heading:<exact heading text>", and "block:<id>"; dispatch doc-read --blocks lists every block's id, type, opening words and token, and each table's rows and cells with the indexes delete_row and delete_column take (GET /api/v1/artifacts/{artifact UUID}/blocks serves the same list). ` + "Optionally require the state just read: precondition selects exactly one of a document token from dispatch doc-read, or block {id, token} values from dispatch doc-read --blocks. A block guard must include every block the batch changes; Dispatch resolves quote targets and rejects an uncovered batch rather than applying it. Use a document token for insert or move, which depend on document order. Prefer block tokens when the covered content blocks are independent sections. Tokens include inline marks, so a fresh human comment also makes a stale edit fail. PRECONDITION_FAILED means re-read; EDIT_QUEUE_FULL means back off before retrying. " + `${CI_CHECK_RULE} ` + "The result carries the document token this edit produced, so a chain of guarded edits passes each result's token as the next edit's precondition with no dispatch doc-read between them. " + "A batch that leaves the document exactly as it was mints no version, named or not, and the result says nothing changed and names each operation that did nothing. " + "A change a browser removes while the edit is in flight is never reported as applied: EDIT_LOST_TO_CONCURRENT_CHANGE means the write was refused and nothing was written, so re-read the document and decide again, as with PRECONDITION_FAILED; lost_ops on a successful result names operations whose text the live document no longer has, because the deletion landed after the version was written. " + "Several paragraphs, or a list, go in one replace, since with writes the blocks its markdown names; blocks beside a block go in one insert, since two inserts at one anchor come out reversed. The result prints the markdown of each block the edit wrote, so read that rather than the document again. " + "Each decision block the edit adds gets the related-item check dispatch ask gets, waiting at most five seconds for all of them together: the result prints, after its first line, `Decision block <id>:` and what that check found, that it found nothing, or that it was not made and why. " + "A block id written as {#id} longer than 256 bytes is stored, but its block is no graph node, so no reference reaches it. " + `The spec holds requirements, design, and decisions - never progress, status, or timestamps. Work still to do is a task in the issue's plan, an issue, or an ask, never a separate document that lists it. ${OWNER_REFERENCE} ${SPEC_WRITING_POINTER}`,
|
|
18143
18162
|
arguments: (z) => ({
|
|
18144
18163
|
issue: z.string().describe(ISSUE_REFERENCE).optional(),
|
|
18145
18164
|
project: z.string().describe("Project key owning the document.").optional(),
|
|
@@ -18147,7 +18166,7 @@ var dispatchToolSpecs = [
|
|
|
18147
18166
|
ref: z.string().describe("Optional dispatch:// issue or document reference.").optional(),
|
|
18148
18167
|
ops: z.array(z.object({
|
|
18149
18168
|
op: z.enum(DOC_EDIT_OPS).describe("Edit operation."),
|
|
18150
|
-
find: z.string().describe("Text of the target as rendered, for replace or delete; inline markdown (**bold**, `code`) is tolerated and must be balanced; a leading '# ' matches a heading. A delete of a block's entire text removes the block.").optional(),
|
|
18169
|
+
find: z.string().describe("Text of the target as rendered, for replace or delete; inline markdown (**bold**, `code`) is tolerated and must be balanced; a leading '# ' matches a heading at any level whose whole text is the rest. A delete of a block's entire text removes the block.").optional(),
|
|
18151
18170
|
with: z.string().describe("Replacement text for replace, which every replace names: an empty value deletes the match on purpose. A replace takes op, find, with and occurrence alone, and one without with, or carrying any other key whatever it holds, is refused before it is sent, and by the server with 400 REPLACE_FIELDS, the document unchanged. Inside a code block, with is the code's literal text as sent (line breaks at its end do not survive a read); elsewhere parsed as markdown, as insert's markdown is. Text that parses to one paragraph is written inside the matched block, where a backslash escape keeps prose that merely looks like a marker, a leading '[x] ' or '[ ] ' over a task item's text matched from its start sets the item's checkbox, and any non-empty value that renders to no text is refused - only an empty value deletes the match. Text that parses to blocks ('---' over a paragraph, a list, a table, two paragraphs) writes those blocks where the match sits, fitted as the editor fits them, and is refused, with the document unchanged, where the block holding the match cannot hold them: a heading, any cell of a table, and a typed block whose content rule they break. A leading marker of the same kind as the matched block's own is refused either way, since the block renders it already, unless it is a heading rename (where a level named by find is what lets with change it) or an item find's own marker selected. A CR LF or a lone carriage return in it is written as a line feed.").optional(),
|
|
18152
18171
|
occurrence: z.number({ int: true, min: 0 }).describe("Optional zero-based match occurrence.").optional(),
|
|
18153
18172
|
markdown: z.string().describe("Markdown to insert; a CR LF or a lone carriage return in it is written as a line feed.").optional(),
|
|
@@ -18281,12 +18300,12 @@ var dispatchToolSpecs = [
|
|
|
18281
18300
|
{
|
|
18282
18301
|
name: "dispatch_read",
|
|
18283
18302
|
example: { issue: "DSP-1" },
|
|
18284
|
-
description: "Read an issue or document summary, targeted ask, or targeted comment reply chain, or the conversation " + "a message belongs to. Do not use it for document contents; use dispatch doc-read instead. Supply ref, issue, " + "issue plus artifact (one of its documents), project plus artifact, or project alone, which lists the project's documents on no issue and nothing more; or message alone, which reads a human's direct message to this session and every " + "reply to it (they belong to no issue). A document summary names its issue, reference, versions and approval. " + "An issue read lists every document, picture and file the issue holds under `Documents:`, each by slug, filename and kind. " + "An anchored comment or ask also says where its quote sits, as `Position:`: the block's path from the top, " + "and in a table the row (0 is the header), the cells before the anchored one, and the column's header; " + "`Position: unavailable (<code>)` when Dispatch could not read the document: `DOC_SERVICE_UNAVAILABLE` " + "(try again shortly), `DOC_SCHEMA` (the document needs repair), `DOC_NEWER_CONTENT` (this Dispatch " + "build cannot read an element of the document; try again in one minute), `DOCUMENT_UNLOADABLE` (the " + "document's stored history cannot load; a person decides whether to rebuild it) or `INTERNAL`. " + "An issue read carries a `Progress:` line, `tasks 3/7, children 2/5`: its spec's task-list items " + "(`- [ ]` / `- [x]`, nested lists included) and its direct children, each done of total and each only " + "when it has any (`Progress: none` otherwise). " + "An issue whose spec marks requirements carries one `Coverage:` line per gap, `Coverage: R3 has no check` or " + "`Coverage: R3 has no plan task` (the second only once the issue has a plan document), counting the `check` and " + "`plan_task` blocks of every document of the issue and of its descendants; a spec that marks none reads " + "`Coverage: the spec marks no requirements`. Nothing is refused for a gap. " + `An issue read, and its dispatch://KEY/log, lists the issue's last ${DEFAULT_ISSUE_READ_EVENTS} events, oldest first; ` + "--events N lists the last N, and --all-events every one. " + "A comment reply chain names the comment each nested reply answers as `Answers: <comment id>`. " + "An edited post reads with the time of its edit, and a deleted one with who deleted it and when, in place of its body; " + "--history, with a ref naming that comment or message, lists the post's history newest first: each body an edit or the delete replaced, with the actor and the time, and of a deleted post each entry's actor and time with no body. " + "Every read ends with `Referenced by:` (what cites or hangs off this node, each with its dispatch:// address, " + "an excerpt, and when) and `Links:` (what it cites), so tracing provenance is one call. " + "A block read prints `Block:`, `Type:` for a block of a document, `Document:`, every attribute a typed block carries " + "(a `check`'s serves, surface, run, when, negative_control and ci_check; a `plan_task`'s serves and needs), `Changed in version:` " + "and `Text:`, then those two sections; a pinned one adds " + "the block's text at that version and whether it is unchanged, changed or removed since, and an absent block, unpinned, " + "reads `No block <id> in <document>.` " + "The pictures the shown messages, asks and comments embed come back as images you see, newest first, at most 8 " + "and 10 MiB of them per read, each a PNG, JPEG, GIF or WebP of at most 3,750,000 bytes (5 MB of base64); a `Pictures:` section names each " + "one shown, in order, and the rest by reference, for dispatch doc-read. A picture this session was already shown is named, not sent again " + "(every request carries the session's history, and the provider refuses one over 32 MB); dispatch doc-read shows it again. " + OWNER_REFERENCE,
|
|
18303
|
+
description: "Read an issue or document summary, targeted ask, or targeted comment reply chain, or the conversation " + "a message belongs to. Do not use it for document contents; use dispatch doc-read instead. Supply ref, issue, " + "issue plus artifact (one of its documents), project plus artifact, or project alone, which lists the project's documents on no issue and nothing more; or message alone, which reads a human's direct message to this session and every " + "reply to it (they belong to no issue). A document summary names its issue, reference, versions and approval. " + "An issue read lists every document, picture and file the issue holds under `Documents:`, each by slug, filename and kind. " + "An anchored comment or ask also says where its quote sits, as `Position:`: the block's path from the top, " + "and in a table the row (0 is the header), the cells before the anchored one, and the column's header; " + "`Position: unavailable (<code>)` when Dispatch could not read the document: `DOC_SERVICE_UNAVAILABLE` " + "(try again shortly), `DOC_SCHEMA` (the document needs repair), `DOC_NEWER_CONTENT` (this Dispatch " + "build cannot read an element of the document; try again in one minute), `DOCUMENT_UNLOADABLE` (the " + "document's stored history cannot load; a person decides whether to rebuild it) or `INTERNAL`. " + "An issue read carries a `Progress:` line, `tasks 3/7, children 2/5`: its spec's task-list items " + "(`- [ ]` / `- [x]`, nested lists included) and its direct children, each done of total and each only " + "when it has any (`Progress: none` otherwise). " + "An issue whose spec marks requirements carries one `Coverage:` line per gap, `Coverage: R3 has no check` or " + "`Coverage: R3 has no plan task` (the second only once the issue has a plan document), counting the `check` and " + "`plan_task` blocks of every document of the issue and of its descendants; a spec that marks none reads " + "`Coverage: the spec marks no requirements`. Nothing is refused for a gap. " + `An issue read, and its dispatch://KEY/log, lists the issue's last ${DEFAULT_ISSUE_READ_EVENTS} events, oldest first; ` + "--events N lists the last N, and --all-events every one. " + "An issue's dispatch://KEY/comments lists every comment on the issue. " + "A comment reply chain names the comment each nested reply answers as `Answers: <comment id>`. " + "An edited post reads with the time of its edit, and a deleted one with who deleted it and when, in place of its body; " + "--history, with a ref naming that comment or message, lists the post's history newest first: each body an edit or the delete replaced, with the actor and the time, and of a deleted post each entry's actor and time with no body. " + "Every read ends with `Referenced by:` (what cites or hangs off this node, each with its dispatch:// address, " + "an excerpt, and when) and `Links:` (what it cites), so tracing provenance is one call. " + "A block read prints `Block:`, `Type:` for a block of a document, `Document:`, every attribute a typed block carries " + "(a `check`'s serves, surface, run, when, negative_control and ci_check; a `plan_task`'s serves and needs), `Changed in version:` " + "and `Text:`, then those two sections; a pinned one adds " + "the block's text at that version and whether it is unchanged, changed or removed since, and an absent block, unpinned, " + "reads `No block <id> in <document>.` " + "The pictures the shown messages, asks and comments embed come back as images you see, newest first, at most 8 " + "and 10 MiB of them per read, each a PNG, JPEG, GIF or WebP of at most 3,750,000 bytes (5 MB of base64); a `Pictures:` section names each " + "one shown, in order, and the rest by reference, for dispatch doc-read. A picture this session was already shown is named, not sent again " + "(every request carries the session's history, and the provider refuses one over 32 MB); dispatch doc-read shows it again. " + OWNER_REFERENCE,
|
|
18285
18304
|
arguments: (z) => ({
|
|
18286
18305
|
issue: z.string().describe(ISSUE_REFERENCE).optional(),
|
|
18287
18306
|
project: z.string().describe("Project key owning the document.").optional(),
|
|
18288
18307
|
artifact: z.string().describe("Document artifact id, slug, or filename: one of the issue's, or a project document.").optional(),
|
|
18289
|
-
ref: z.string().describe("Optional dispatch:// reference: dispatch://KEY, dispatch://KEY/spec, " + "dispatch://KEY/artifact/<slug>[@vN], dispatch://KEY/ask/<id>, dispatch://KEY/comment/<id>, " + "dispatch://KEY/message/<id>, dispatch://PROJECT/artifact/<slug>[@vN], and its " + "/ask/<id> and /comment/<id>; or the dashboard URL of one. A block: " + "dispatch://KEY/spec#b-<block id>[@vN], dispatch://KEY/artifact/<slug>#b-<block id>[@vN] or " + "dispatch://PROJECT/artifact/<slug>#b-<block id>[@vN], the id percent-encoded except ASCII " + "letters, digits and -.").optional(),
|
|
18308
|
+
ref: z.string().describe("Optional dispatch:// reference: dispatch://KEY, dispatch://KEY/spec, dispatch://KEY/comments, " + "dispatch://KEY/artifact/<slug>[@vN], dispatch://KEY/ask/<id>, dispatch://KEY/comment/<id>, " + "dispatch://KEY/message/<id>, dispatch://PROJECT/artifact/<slug>[@vN], and its " + "/ask/<id> and /comment/<id>; or the dashboard URL of one. A block: " + "dispatch://KEY/spec#b-<block id>[@vN], dispatch://KEY/artifact/<slug>#b-<block id>[@vN] or " + "dispatch://PROJECT/artifact/<slug>#b-<block id>[@vN], the id percent-encoded except ASCII " + "letters, digits and -.").optional(),
|
|
18290
18309
|
message: z.string().describe("A message id (uuid): reads the conversation it belongs to, the root message and every " + "reply. Name nothing else with it.").optional(),
|
|
18291
18310
|
events: z.number({ int: true, min: 1 }).describe(`How many of the issue's newest events an issue read or its dispatch://KEY/log lists, oldest first; default ${DEFAULT_ISSUE_READ_EVENTS}. Name no --all-events with it.`).optional(),
|
|
18292
18311
|
all_events: z.boolean().describe(`List every one of the issue's events, oldest first, on an issue read or its dispatch://KEY/log, in place of the last ${DEFAULT_ISSUE_READ_EVENTS}. Name no --events with it.`).optional(),
|
|
@@ -21450,10 +21469,10 @@ function parseDispatchRef(ref) {
|
|
|
21450
21469
|
artifact
|
|
21451
21470
|
};
|
|
21452
21471
|
}
|
|
21453
|
-
const issueReference = ref.match(/^dispatch:\/\/([A-Z][A-Z0-9]{1,9}-[1-9][0-9]*)(?:\/(spec)|\/(log|activity)|\/(children)|\/artifact\/([^/@]+)(?:@v(\d+))?|\/ask\/([^/]+)|\/comment\/([^/]+)|\/message\/([^/]+))?$/);
|
|
21472
|
+
const issueReference = ref.match(/^dispatch:\/\/([A-Z][A-Z0-9]{1,9}-[1-9][0-9]*)(?:\/(spec)|\/(log|activity)|\/(children)|\/(comments)|\/artifact\/([^/@]+)(?:@v(\d+))?|\/ask\/([^/]+)|\/comment\/([^/]+)|\/message\/([^/]+))?$/);
|
|
21454
21473
|
if (!issueReference)
|
|
21455
21474
|
return null;
|
|
21456
|
-
const [, issue, spec, log, children, artifact, version, ask, comment, message] = issueReference;
|
|
21475
|
+
const [, issue, spec, log, children, comments, artifact, version, ask, comment, message] = issueReference;
|
|
21457
21476
|
if (!issue || version !== undefined && Number(version) < 1)
|
|
21458
21477
|
return null;
|
|
21459
21478
|
const owner = { kind: "issue", issue };
|
|
@@ -21463,6 +21482,8 @@ function parseDispatchRef(ref) {
|
|
|
21463
21482
|
return { owner, kind: "log", id: log };
|
|
21464
21483
|
if (children)
|
|
21465
21484
|
return { owner, kind: "children", id: children };
|
|
21485
|
+
if (comments)
|
|
21486
|
+
return { owner, kind: "comments", id: comments };
|
|
21466
21487
|
if (artifact) {
|
|
21467
21488
|
return {
|
|
21468
21489
|
owner,
|
|
@@ -26816,7 +26837,7 @@ function itemReplyTo(args, field) {
|
|
|
26816
26837
|
return block === undefined ? { id: replyTo } : { id: block.item.id, block: block.block };
|
|
26817
26838
|
}
|
|
26818
26839
|
function innerRefProblem(tool, ref, refText) {
|
|
26819
|
-
if (ref.kind !== "ask" && ref.kind !== "comment" && ref.kind !== "message" && ref.kind !== "log" && ref.kind !== "children" && ref.kind !== "block") {
|
|
26840
|
+
if (ref.kind !== "ask" && ref.kind !== "comment" && ref.kind !== "message" && ref.kind !== "log" && ref.kind !== "children" && ref.kind !== "comments" && ref.kind !== "block") {
|
|
26820
26841
|
return;
|
|
26821
26842
|
}
|
|
26822
26843
|
if (tool === "dispatch_read" || tool === "dispatch_ask")
|
|
@@ -26827,7 +26848,7 @@ function innerRefProblem(tool, ref, refText) {
|
|
|
26827
26848
|
const ownerArguments = ref.owner.kind === "issue" ? `issue ${ref.owner.issue}${documentArgument}` : `project ${ref.owner.project} and artifact ${ref.artifact}`;
|
|
26828
26849
|
const partRef = ref.pin === undefined ? refText : refText.slice(0, -`@v${ref.pin}`.length);
|
|
26829
26850
|
const fix = tool === "dispatch_comment" && itemKind === "ask" ? `reply under it with reply_to_ask ${ref.item === undefined ? ref.id : partRef} and ${ownerArguments}` : tool === "dispatch_comment" && itemKind === "comment" ? `reply in its thread with reply_to ${ref.id} and ${ownerArguments}` : `read it with dispatch read, or name ${owner} with ${ownerArguments}`;
|
|
26830
|
-
const item = ref.kind === "ask" ? "an ask" : ref.kind === "log" ? "the event log" : ref.kind === "children" ? "the children" : ref.kind === "block" ? `block ${ref.block}${ref.item === undefined ? "" : ` of ${article(ref.item.kind)}`}` : `a ${ref.kind}`;
|
|
26851
|
+
const item = ref.kind === "ask" ? "an ask" : ref.kind === "log" ? "the event log" : ref.kind === "children" ? "the children" : ref.kind === "comments" ? "the comments" : ref.kind === "block" ? `block ${ref.block}${ref.item === undefined ? "" : ` of ${article(ref.item.kind)}`}` : `a ${ref.kind}`;
|
|
26831
26852
|
return `ref ${refText} names ${item} on ${owner}; dispatch ${commandName(tool)} would act on ${owner} and drop the ${ref.kind}: ${fix}`;
|
|
26832
26853
|
}
|
|
26833
26854
|
var documentItemPattern = /^dispatch:\/\/([A-Z][A-Z0-9]{1,9}-[1-9][0-9]*)\/artifact\/[^/@]+(?:@v\d+)?\/(ask|comment)\/([^/]+)$/;
|
|
@@ -27008,6 +27029,8 @@ function readWithoutEvents(args) {
|
|
|
27008
27029
|
return "a message's conversation";
|
|
27009
27030
|
case "children":
|
|
27010
27031
|
return "the issue's children";
|
|
27032
|
+
case "comments":
|
|
27033
|
+
return "the issue's comments";
|
|
27011
27034
|
case "log":
|
|
27012
27035
|
return;
|
|
27013
27036
|
}
|
|
@@ -28761,6 +28784,7 @@ async function issueUpdateCommand(context) {
|
|
|
28761
28784
|
const priority = optionalPriority(args, "priority");
|
|
28762
28785
|
const assignee = optionalNullableString(args, "assignee");
|
|
28763
28786
|
const labels = Array.isArray(args.labels) ? args.labels : undefined;
|
|
28787
|
+
const labelsAdd = optionalStringArray(args, "labels_add");
|
|
28764
28788
|
const blockedBy = Array.isArray(args.blocked_by) ? args.blocked_by : undefined;
|
|
28765
28789
|
const advances = optionalStringArray(args, "advances");
|
|
28766
28790
|
const advancesRevision = optionalNumber(args, "advances_revision");
|
|
@@ -28807,6 +28831,7 @@ async function issueUpdateCommand(context) {
|
|
|
28807
28831
|
...status === undefined ? {} : { status },
|
|
28808
28832
|
...title === undefined ? {} : { title },
|
|
28809
28833
|
...labels === undefined ? {} : { labels },
|
|
28834
|
+
...labelsAdd === undefined ? {} : { labels_add: labelsAdd },
|
|
28810
28835
|
...priority === undefined ? {} : { priority },
|
|
28811
28836
|
...assignee === undefined ? {} : { assignee },
|
|
28812
28837
|
...route === undefined ? {} : { route },
|
|
@@ -28845,8 +28870,8 @@ async function issueUpdateCommand(context) {
|
|
|
28845
28870
|
...closingNote === undefined ? [] : [`reason posted as message ${closingNote.id} (${closingNote.ref})`],
|
|
28846
28871
|
...status === undefined ? [] : [`status ${before.status} -> ${after.status}`],
|
|
28847
28872
|
...title === undefined ? [] : [`title "${after.title}"`],
|
|
28848
|
-
...labels === undefined ? [] : [
|
|
28849
|
-
(after.labels ?? []).length
|
|
28873
|
+
...labels === undefined && labelsAdd === undefined ? [] : [
|
|
28874
|
+
(after.labels ?? []).length > 0 ? `labels ${(after.labels ?? []).join(", ")}` : labels === undefined ? "labels none" : "labels cleared"
|
|
28850
28875
|
],
|
|
28851
28876
|
...priority === undefined ? [] : [after.priority === null ? "priority cleared" : `priority -> P${after.priority}`],
|
|
28852
28877
|
...assignee === undefined ? [] : [after.assignee === null ? "assignee cleared" : `assignee -> ${after.assignee}`],
|
|
@@ -29266,6 +29291,21 @@ function commentSummary({ comment, replies }, graph) {
|
|
|
29266
29291
|
].join(`
|
|
29267
29292
|
`);
|
|
29268
29293
|
}
|
|
29294
|
+
function commentsSummary(issueKey, comments) {
|
|
29295
|
+
return [
|
|
29296
|
+
`Comments: ${issueKey}`,
|
|
29297
|
+
...comments.length === 0 ? ["- none"] : comments.flatMap((comment) => [
|
|
29298
|
+
`${comment.id} \xB7 ${actorText(comment.author)} \xB7 ${comment.created_at}`,
|
|
29299
|
+
...anchorLines(comment),
|
|
29300
|
+
...replyBlockLines(comment),
|
|
29301
|
+
...comment.reply_to === null ? [] : [`Reply to: ${comment.reply_to}`],
|
|
29302
|
+
...comment.answers != null && comment.answers !== comment.reply_to ? [`Answers: ${comment.answers}`] : [],
|
|
29303
|
+
...comment.ask_id == null ? [] : [`Ask: ${comment.ask_id}`],
|
|
29304
|
+
...postBodyLines(comment)
|
|
29305
|
+
])
|
|
29306
|
+
].join(`
|
|
29307
|
+
`);
|
|
29308
|
+
}
|
|
29269
29309
|
function replyBlockLines(record) {
|
|
29270
29310
|
const block = record.reply_block;
|
|
29271
29311
|
if (block === undefined || block === null)
|
|
@@ -29936,9 +29976,6 @@ async function sendToAgentCommand(context) {
|
|
|
29936
29976
|
// ../envoy-client/src/dispatch-commands/documents.ts
|
|
29937
29977
|
import { resolve as resolvePath2 } from "path";
|
|
29938
29978
|
|
|
29939
|
-
// ../contracts/src/go-blank.ts
|
|
29940
|
-
var goBlankPattern = /^[\t\n\v\f\r \u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*$/u;
|
|
29941
|
-
|
|
29942
29979
|
// ../envoy-client/src/typed-block-opener.ts
|
|
29943
29980
|
function runOf(text, index, char) {
|
|
29944
29981
|
let end = index;
|
|
@@ -31256,6 +31293,19 @@ async function readCommand(context) {
|
|
|
31256
31293
|
details: { issue: parent.key }
|
|
31257
31294
|
};
|
|
31258
31295
|
}
|
|
31296
|
+
if (ownerArguments.ref?.kind === "comments") {
|
|
31297
|
+
const [owner, comments] = await Promise.all([
|
|
31298
|
+
client.getIssue(issueKey),
|
|
31299
|
+
client.getComments(issueKey)
|
|
31300
|
+
]);
|
|
31301
|
+
const pictures = await picturesOf(datedBodies(comments));
|
|
31302
|
+
return {
|
|
31303
|
+
text: [commentsSummary(owner.key, comments), ...pictures.lines].join(`
|
|
31304
|
+
`),
|
|
31305
|
+
details: { issue: owner.key },
|
|
31306
|
+
...showImages(pictures)
|
|
31307
|
+
};
|
|
31308
|
+
}
|
|
31259
31309
|
const readPromise = client.read(issueKey, readEvents);
|
|
31260
31310
|
const referencesPromise = issueReferencesOrUnavailable(client, issueKey);
|
|
31261
31311
|
const read = await readPromise;
|