@github/copilot 0.0.355-15 → 0.0.355-17

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/index.js CHANGED
@@ -846,10 +846,11 @@ ${Z.stdout}${Z.stderr}
846
846
  `))!==-1;){let s=n.substring(0,I);n=n.substring(I+1),l++;let o=e(s,l);if(o!==void 0)return r.destroy(),o}}if(n.length>0){l++;let a=e(n,l);if(a!==void 0)return a}return}catch(a){throw r.destroy(),a}}var pE="code_review",Kte="copilot_swe_agent_code_review",p3l="ccr[EnableAgenticTools=true]",iNt=`Operation cancelled due to timeout. Do not re-run the ${pE} tool because it will not complete successfully.`,cNt=async(t,e,l,n)=>{let r=ND.createBudgeter(pE,n),a=new hZ(e,l),I=n.swebench_base_commit&&n.swebench_base_commit!=="undefined"?n.swebench_base_commit:await a.getCurrentCommitHash(t.location),s=kx.isEnabled(n)?`* The ${pE} tool must be run _before_ the ${kx.TOOL_NAME} to ensure that code reviews are completed prior to security scanning.
847
847
  `:"",o=`${pE} is your tool for getting automated code reviews for your changes.
848
848
  Pay attention to the following when using it:
849
- * Before finalizing your session and completing the task, use the ${pE} tool to request a review of your changes.
849
+ * Before finalizing your session and completing the task, use the ${pE} tool to request a review of your changes, even if there are no code changes (e.g., documentation-only changes).
850
850
  ${s}* Look over the comments returned by the ${pE} tool, decide which ones are correct, and address the relevant ones.
851
851
  * NOTE: The ${pE} tool is imperfect. It may make incorrect comments, and it may not catch every issue. Use your judgment when addressing feedback.
852
- * If you make significant changes after a code review, get another review by calling ${pE} again.`;return{name:pE,instructions:o,description:`Request a code review for the current PR changes. This tool analyzes the proposed changes and provides feedback.
852
+ * If you make significant changes after a code review, get another review by calling ${pE} again.
853
+ `;return{name:pE,instructions:o,description:`Request a code review for the current PR changes. This tool analyzes the proposed changes and provides feedback.
853
854
  Call this tool before finalizing your session and completing the task to get review feedback.
854
855
  If the review identifies issues that you agree with, address them and call this tool again if significant changes were made.`,input_schema:{type:"object",properties:{prTitle:{type:"string",description:"Title for the pull request, specifying the task addressed by this PR"},prDescription:{type:"string",description:"Description for the pull request, explaining the task and the high-level code changes made relative to the base branch"}},required:["prTitle","prDescription"]},callback:async c=>{let d=r.startJob(),m=h3l();try{let b=t.location||process.cwd();if(!c||!c.prTitle||!c.prDescription)return{textResultForLlm:"Invalid input provided to code_review tool",resultType:"failure",error:"Missing required fields: prTitle or prDescription",toolTelemetry:{properties:{codeReviewResult:"invalid_input",codeReviewModel:m,codeReviewError:"",codeReviewTimedOut:"false"},metrics:{},restrictedProperties:{}}};let p=await A3l(a,b,I,e);if(p.length===0)return{textResultForLlm:"No changed files found to review. Make sure you have made some changes before requesting a code review.",resultType:"failure",error:"No changed files found",toolTelemetry:{properties:{codeReviewResult:"no_changed_files",codeReviewModel:m,codeReviewTimedOut:"false"},metrics:{},restrictedProperties:{}}};d.throwIfAborted(),e.debug(`Code review requested for PR: ${c.prTitle}`),e.debug(`Files to review: ${p.map(X=>X.path).join(", ")}`);let A=g3l(b,await a.getCurrentCommitHash(b),c.prTitle,c.prDescription,n);d.throwIfAborted();let Z=await N3l(m,p,A,n,l,d,e);if(d.throwIfAborted(),Z.alerts.length===0&&Z.error)return{textResultForLlm:`Code review tool encountered an issue: ${Z.error}`,resultType:"failure",error:Z.error,toolTelemetry:{properties:{codeReviewResult:"failure",codeReviewError:Z.error,codeReviewTimedOut:Z.timedOut?"true":"false",codeReviewModel:m},metrics:{},restrictedProperties:{}}};let W=Z.alerts.filter(X=>!X.meta||!X.meta?.exclusionReason||X.meta.exclusionReason===""),R=`Code review completed. Reviewed ${p.length} file(s).
855
856
  `;if(W.length>0){R+=`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@github/copilot",
3
3
  "description": "GitHub Copilot CLI brings the power of Copilot coding agent directly to your terminal.",
4
- "version": "0.0.355-15",
4
+ "version": "0.0.355-17",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "type": "module",
7
7
  "repository": {
@@ -37,6 +37,6 @@
37
37
  "worker/**/*"
38
38
  ],
39
39
  "buildMetadata": {
40
- "gitCommit": "34447ee"
40
+ "gitCommit": "d8dfbc4"
41
41
  }
42
42
  }
package/sdk/index.js CHANGED
@@ -320,10 +320,11 @@ ${h.stdout}${h.stderr}
320
320
  `))(r.startsWith("--- ")||r.startsWith("+++ ")||r.startsWith("@@ "))&&c.push(r);return c}};var WA=class t{toolName;static createBudgeter(e,I){let l=I.tools?.validation?.timeout!==void 0?I.tools.validation.timeout*1e3:void 0;return new t(e,l)}static DEFAULT_BUDGET_MS=180*1e3;budget;currentJobStartTime=void 0;constructor(e,I=t.DEFAULT_BUDGET_MS){this.budget=I,this.toolName=e}startJob(){if(this.currentJobStartTime!==void 0)throw new Error("A job is already running.");return this.currentJobStartTime=Date.now(),AbortSignal.timeout(this.budget)}endJob(){if(this.currentJobStartTime!==void 0){let e=Date.now()-this.currentJobStartTime;this.budget=Math.max(0,this.budget-e),this.currentJobStartTime=void 0}else throw new Error("No job is currently running.")}get remainingBudget(){return this.budget}};var Di="code_review",UC="copilot_swe_agent_code_review",ucI="ccr[EnableAgenticTools=true]",PVe=`Operation cancelled due to timeout. Do not re-run the ${Di} tool because it will not complete successfully.`,qVe=async(t,e,I,l)=>{let n=WA.createBudgeter(Di,l),c=new Jo(e,I),r=l.swebench_base_commit&&l.swebench_base_commit!=="undefined"?l.swebench_base_commit:await c.getCurrentCommitHash(t.location),s=iR.isEnabled(l)?`* The ${Di} tool must be run _before_ the ${iR.TOOL_NAME} to ensure that code reviews are completed prior to security scanning.
321
321
  `:"",a=`${Di} is your tool for getting automated code reviews for your changes.
322
322
  Pay attention to the following when using it:
323
- * Before finalizing your session and completing the task, use the ${Di} tool to request a review of your changes.
323
+ * Before finalizing your session and completing the task, use the ${Di} tool to request a review of your changes, even if there are no code changes (e.g., documentation-only changes).
324
324
  ${s}* Look over the comments returned by the ${Di} tool, decide which ones are correct, and address the relevant ones.
325
325
  * NOTE: The ${Di} tool is imperfect. It may make incorrect comments, and it may not catch every issue. Use your judgment when addressing feedback.
326
- * If you make significant changes after a code review, get another review by calling ${Di} again.`;return{name:Di,instructions:a,description:`Request a code review for the current PR changes. This tool analyzes the proposed changes and provides feedback.
326
+ * If you make significant changes after a code review, get another review by calling ${Di} again.
327
+ `;return{name:Di,instructions:a,description:`Request a code review for the current PR changes. This tool analyzes the proposed changes and provides feedback.
327
328
  Call this tool before finalizing your session and completing the task to get review feedback.
328
329
  If the review identifies issues that you agree with, address them and call this tool again if significant changes were made.`,input_schema:{type:"object",properties:{prTitle:{type:"string",description:"Title for the pull request, specifying the task addressed by this PR"},prDescription:{type:"string",description:"Description for the pull request, explaining the task and the high-level code changes made relative to the base branch"}},required:["prTitle","prDescription"]},callback:async o=>{let G=n.startJob(),i=ZcI();try{let d=t.location||process.cwd();if(!o||!o.prTitle||!o.prDescription)return{textResultForLlm:"Invalid input provided to code_review tool",resultType:"failure",error:"Missing required fields: prTitle or prDescription",toolTelemetry:{properties:{codeReviewResult:"invalid_input",codeReviewModel:i,codeReviewError:"",codeReviewTimedOut:"false"},metrics:{},restrictedProperties:{}}};let b=await WcI(c,d,r,e);if(b.length===0)return{textResultForLlm:"No changed files found to review. Make sure you have made some changes before requesting a code review.",resultType:"failure",error:"No changed files found",toolTelemetry:{properties:{codeReviewResult:"no_changed_files",codeReviewModel:i,codeReviewTimedOut:"false"},metrics:{},restrictedProperties:{}}};G.throwIfAborted(),e.debug(`Code review requested for PR: ${o.prTitle}`),e.debug(`Files to review: ${b.map(y=>y.path).join(", ")}`);let m=NcI(d,await c.getCurrentCommitHash(d),o.prTitle,o.prDescription,l);G.throwIfAborted();let h=await VcI(i,b,m,l,I,G,e);if(G.throwIfAborted(),h.alerts.length===0&&h.error)return{textResultForLlm:`Code review tool encountered an issue: ${h.error}`,resultType:"failure",error:h.error,toolTelemetry:{properties:{codeReviewResult:"failure",codeReviewError:h.error,codeReviewTimedOut:h.timedOut?"true":"false",codeReviewModel:i},metrics:{},restrictedProperties:{}}};let u=h.alerts.filter(y=>!y.meta||!y.meta?.exclusionReason||y.meta.exclusionReason===""),Z=`Code review completed. Reviewed ${b.length} file(s).
329
330
  `;if(u.length>0){Z+=`