@sjawhar/pi-envoy 17.1.0 → 17.2.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/dist/dispatch.js +50 -3
- package/dist/envoy.js +1 -1
- package/package.json +1 -1
package/dist/dispatch.js
CHANGED
|
@@ -19718,6 +19718,17 @@ var triageAdviceShown = new Set;
|
|
|
19718
19718
|
function adviceMemory() {
|
|
19719
19719
|
return triageAdviceShown;
|
|
19720
19720
|
}
|
|
19721
|
+
function handBackApprovalCommand(request) {
|
|
19722
|
+
const owner = request.owner.kind === "project" ? `--project ${request.owner.key} --artifact ${request.artifactID}` : request.primary ? `--issue ${request.owner.key}` : `--issue ${request.owner.key} --artifact ${request.artifactID}`;
|
|
19723
|
+
const verification = request.owner.kind === "issue" && request.primary && request.verification ? " --include-verification" : "";
|
|
19724
|
+
return `dispatch request-approval ${owner}${verification} ` + `--summary '<what changed since version ${request.summaryVersion}>'`;
|
|
19725
|
+
}
|
|
19726
|
+
function movedApprovalClauses(documents) {
|
|
19727
|
+
return documents.map((document) => `${document.name} asked about version ${document.requested_version} and is now version ${document.version}`).join("; ");
|
|
19728
|
+
}
|
|
19729
|
+
function movedApprovalDocuments(documents) {
|
|
19730
|
+
return documents.filter((document) => document.requested_version < document.version);
|
|
19731
|
+
}
|
|
19721
19732
|
function renderAdvice(tool, key, advice, opts) {
|
|
19722
19733
|
if (advice === undefined)
|
|
19723
19734
|
return [];
|
|
@@ -19748,6 +19759,24 @@ function renderAdvice(tool, key, advice, opts) {
|
|
|
19748
19759
|
lines.push(`You still have an open ask on ${key}: "${ask.question.slice(0, 80)}" (${ask.id}). Still needed? See the \`dispatch\` skill, "Close what you opened".`);
|
|
19749
19760
|
}
|
|
19750
19761
|
}
|
|
19762
|
+
const movedApproval = advice.moved_approval_request;
|
|
19763
|
+
if (movedApproval !== undefined && (tool === "dispatch_doc_edit" || tool === "dispatch_artifact")) {
|
|
19764
|
+
const documents = movedApproval.documents ?? [];
|
|
19765
|
+
const moved = movedApprovalDocuments(documents);
|
|
19766
|
+
const movedOwner = movedApproval.issue !== undefined && movedApproval.issue !== "" ? { kind: "issue", key: movedApproval.issue } : movedApproval.project !== undefined && movedApproval.project !== "" ? { kind: "project", key: movedApproval.project } : undefined;
|
|
19767
|
+
const first = documents[0];
|
|
19768
|
+
const firstMoved = moved[0];
|
|
19769
|
+
if (moved.length > 0 && movedOwner !== undefined && first !== undefined && firstMoved !== undefined) {
|
|
19770
|
+
const command = handBackApprovalCommand({
|
|
19771
|
+
owner: movedOwner,
|
|
19772
|
+
artifactID: first.artifact_id,
|
|
19773
|
+
primary: first.primary,
|
|
19774
|
+
verification: documents.slice(1).some((document) => document.role === "verification"),
|
|
19775
|
+
summaryVersion: firstMoved.requested_version
|
|
19776
|
+
});
|
|
19777
|
+
lines.push(`This write moved the open approval request (ask ${movedApproval.ask_id}): it waits on ` + "an agent now, not on the person, and nothing tells the person. " + `${movedApprovalClauses(moved)}. Once the human has agreed to every point in it, hand ` + `the same request back: ${command}. Not yours to hand back? Tell the issue's architect.`);
|
|
19778
|
+
}
|
|
19779
|
+
}
|
|
19751
19780
|
const superseded = advice.superseded_approval;
|
|
19752
19781
|
if (superseded !== undefined && (tool === "dispatch_doc_edit" || tool === "dispatch_artifact")) {
|
|
19753
19782
|
const gates = Array.isArray(superseded.design_gates) ? superseded.design_gates : [];
|
|
@@ -20698,10 +20727,28 @@ async function movedApprovalLine(client, askID) {
|
|
|
20698
20727
|
const approval = ask?.approval;
|
|
20699
20728
|
if (ask?.kind !== "approval" || approval === undefined)
|
|
20700
20729
|
return;
|
|
20701
|
-
|
|
20730
|
+
const listed = approval.documents ?? [];
|
|
20731
|
+
const documents = listed.length > 0 ? listed : [
|
|
20732
|
+
{
|
|
20733
|
+
name: approval.name,
|
|
20734
|
+
requested_version: approval.requested_version,
|
|
20735
|
+
version: approval.version
|
|
20736
|
+
}
|
|
20737
|
+
];
|
|
20738
|
+
const moved = movedApprovalDocuments(documents);
|
|
20739
|
+
if (moved.length === 0)
|
|
20702
20740
|
return;
|
|
20703
|
-
const
|
|
20704
|
-
|
|
20741
|
+
const firstMoved = moved[0];
|
|
20742
|
+
if (firstMoved === undefined)
|
|
20743
|
+
return;
|
|
20744
|
+
const command = handBackApprovalCommand({
|
|
20745
|
+
owner: ask.issue_key === null ? { kind: "project", key: ask.approval_artifact?.project ?? "<project>" } : { kind: "issue", key: ask.issue_key },
|
|
20746
|
+
artifactID: approval.artifact_id,
|
|
20747
|
+
primary: ask.approval_artifact?.primary === true,
|
|
20748
|
+
verification: documents.length > 1 && ask.approval_artifact?.primary === true,
|
|
20749
|
+
summaryVersion: firstMoved.requested_version
|
|
20750
|
+
});
|
|
20751
|
+
return "The reply did not hand the ask to the human: it is an open approval request, and " + `${movedApprovalClauses(moved)}. No reply hands a moved approval request back. Once the ` + `human has agreed to every point in it, run: ${command}`;
|
|
20705
20752
|
}
|
|
20706
20753
|
async function replyToAskCandidates(client, owner, resolved) {
|
|
20707
20754
|
if (owner.kind === "issue") {
|
package/dist/envoy.js
CHANGED
|
@@ -42849,7 +42849,7 @@ var import_nats2 = __toESM(require_mod4(), 1);
|
|
|
42849
42849
|
|
|
42850
42850
|
// package.json
|
|
42851
42851
|
var name = "@sjawhar/pi-envoy";
|
|
42852
|
-
var version2 = "17.
|
|
42852
|
+
var version2 = "17.2.0";
|
|
42853
42853
|
var package_default = {
|
|
42854
42854
|
name,
|
|
42855
42855
|
version: version2,
|