@github/copilot 0.0.340-1 → 0.0.340-2
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 +2 -2
- package/package.json +2 -2
- package/sdk/index.js +2 -2
- package/sdk/index.js.map +1 -1
package/index.js
CHANGED
|
@@ -793,7 +793,7 @@ Pay attention to the following when using it:
|
|
|
793
793
|
* NOTE: The ${bF} tool is imperfect. It may make incorrect comments, and it may not catch every issue. Use your judgment when addressing feedback.
|
|
794
794
|
* If you make significant changes after a code review, get another review by calling ${bF} again.`;return{name:bF,instructions:a,description:`Request a code review for the current PR changes. This tool analyzes the proposed changes and provides feedback.
|
|
795
795
|
Call this tool before finalizing your session and completing the task to get review feedback.
|
|
796
|
-
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 s=>{let o=I.startJob(),d=OFl();try{let u=t.location||process.cwd();if(!s||!s.prTitle||!s.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:d},metrics:{},restrictedProperties:{}}};let G=await TFl(r,u,n,l,e);if(G.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:d}}};o.throwIfAborted(),e.debug(`Code review requested for PR: ${s.prTitle}`),e.debug(`Files to review: ${G.map(w=>w.path).join(", ")}`);let p=UFl(u,n.github?.owner?.name||"",n.github?.repo?.name||"",await r.getCurrentCommitHash(u),s.prTitle,s.prDescription),h=await _Fl(d,G,p,n,l,o,e);if(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:d}}};let W=h.alerts.filter(w=>!w.meta||!w.meta?.exclusionReason||w.meta.exclusionReason===""),y=`Code review completed. Reviewed ${G.length} file(s).
|
|
796
|
+
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 s=>{let o=I.startJob(),d=OFl();try{let u=t.location||process.cwd();if(!s||!s.prTitle||!s.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:d,codeReviewError:"",codeReviewTimedOut:"false"},metrics:{},restrictedProperties:{}}};let G=await TFl(r,u,n,l,e);if(G.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:d,codeReviewTimedOut:"false"},metrics:{},restrictedProperties:{}}};o.throwIfAborted(),e.debug(`Code review requested for PR: ${s.prTitle}`),e.debug(`Files to review: ${G.map(w=>w.path).join(", ")}`);let p=UFl(u,n.github?.owner?.name||"",n.github?.repo?.name||"",await r.getCurrentCommitHash(u),s.prTitle,s.prDescription),h=await _Fl(d,G,p,n,l,o,e);if(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:d},metrics:{},restrictedProperties:{}}};let W=h.alerts.filter(w=>!w.meta||!w.meta?.exclusionReason||w.meta.exclusionReason===""),y=`Code review completed. Reviewed ${G.length} file(s).
|
|
797
797
|
`;if(W.length>0){y+=`
|
|
798
798
|
Found ${W.length} review comment(s):
|
|
799
799
|
`;for(let w of W)w.location.endLine===w.location.startLine?y+=`- In ${w.location.file}, line ${w.location.startLine}: ${w.message}
|
|
@@ -801,7 +801,7 @@ Found ${W.length} review comment(s):
|
|
|
801
801
|
`}else y+=`
|
|
802
802
|
No review comments found.`,h.warning&&(y+=`
|
|
803
803
|
|
|
804
|
-
Note: ${h.warning}`);e.debug(`Code review completed: ${y}`);let R=W.map(w=>w.meta?.queryId).filter(w=>!!w&&w.trim().length>0).sort();return{textResultForLlm:y,resultType:"success",sessionLog:y,toolTelemetry:{properties:{commentQueryNames:R.join(", "),codeReviewResult:"success",codeReviewModel:d},restrictedProperties:{prTitle:s.prTitle,filesReviewed:G.map(w=>w.path).join(", ")},metrics:{reviewedFiles:G.length,commentsGenerated:W.length,commentsExcluded:h.alerts.length-W.length}}}}catch(u){let G=Ipt(u),p=G?lpt:`Error during code review: ${u}`;return e.error(p),{textResultForLlm:p,resultType:"failure",error:p,toolTelemetry:{properties:{codeReviewError:p,codeReviewTimedOut:G?"true":"false",codeReviewModel:d}}}}finally{I.endJob()}},safeForTelemetry:!0}};function OFl(){return process.env.NODE_ENV==="production"?"capi-prod-claude-sonnet-4":"capi-dev-claude-sonnet-4"}async function TFl(t,e,l,n,I){try{let r=l.swebench_base_commit||"HEAD~1",a=[];try{await t.stageChanges(e),a=await t.getChangedPaths(e,r)}catch(o){I.debug(`Could not get diff against ${r}, checking for working directory changes: ${o}`);try{let u=(await n.execReturn("git",["diff","--name-only"],{cwd:e})).stdout.trim().split(`
|
|
804
|
+
Note: ${h.warning}`);e.debug(`Code review completed: ${y}`);let R=W.map(w=>w.meta?.queryId).filter(w=>!!w&&w.trim().length>0).sort();return{textResultForLlm:y,resultType:"success",sessionLog:y,toolTelemetry:{properties:{commentQueryNames:R.join(", "),codeReviewResult:"success",codeReviewModel:d},restrictedProperties:{prTitle:s.prTitle,filesReviewed:G.map(w=>w.path).join(", ")},metrics:{reviewedFiles:G.length,commentsGenerated:W.length,commentsExcluded:h.alerts.length-W.length}}}}catch(u){let G=Ipt(u),p=G?lpt:`Error during code review: ${u}`;return e.error(p),{textResultForLlm:p,resultType:"failure",error:p,toolTelemetry:{properties:{codeReviewResult:"failure",codeReviewError:p,codeReviewTimedOut:G?"true":"false",codeReviewModel:d},metrics:{},restrictedProperties:{}}}}finally{I.endJob()}},safeForTelemetry:!0}};function OFl(){return process.env.NODE_ENV==="production"?"capi-prod-claude-sonnet-4":"capi-dev-claude-sonnet-4"}async function TFl(t,e,l,n,I){try{let r=l.swebench_base_commit||"HEAD~1",a=[];try{await t.stageChanges(e),a=await t.getChangedPaths(e,r)}catch(o){I.debug(`Could not get diff against ${r}, checking for working directory changes: ${o}`);try{let u=(await n.execReturn("git",["diff","--name-only"],{cwd:e})).stdout.trim().split(`
|
|
805
805
|
`).filter(h=>h.length>0),p=(await n.execReturn("git",["diff","--cached","--name-only"],{cwd:e})).stdout.trim().split(`
|
|
806
806
|
`).filter(h=>h.length>0);if(a=[...new Set([...u,...p])],a.length===0)try{a=(await n.execReturn("git",["diff","--name-only",ept,"HEAD"],{cwd:e})).stdout.trim().split(`
|
|
807
807
|
`).filter(W=>W.length>0),r=ept}catch{return I.debug("Could not compare against empty tree"),[]}}catch(d){return I.error(`Error getting working directory changes: ${d}`),[]}}let s=[];for(let o of a)try{let d="";try{let G=GF(e,o);d=await tpt(G,"utf-8")}catch{d=""}let u="";try{u=(await n.execReturn("git",["show",`${r}:${o}`],{cwd:e})).stdout}catch{u=""}s.push({path:o,contents:d,baseContents:u,regions:[[1,Math.max(1,d.split(`
|
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.340-
|
|
4
|
+
"version": "0.0.340-2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"sdk/**/*"
|
|
34
34
|
],
|
|
35
35
|
"buildMetadata": {
|
|
36
|
-
"gitCommit": "
|
|
36
|
+
"gitCommit": "386e6ee"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"node-pty": "npm:@devm33/node-pty@^1.0.8",
|
package/sdk/index.js
CHANGED
|
@@ -255,7 +255,7 @@ Pay attention to the following when using it:
|
|
|
255
255
|
* NOTE: The ${bp} tool is imperfect. It may make incorrect comments, and it may not catch every issue. Use your judgment when addressing feedback.
|
|
256
256
|
* If you make significant changes after a code review, get another review by calling ${bp} again.`;return{name:bp,instructions:a,description:`Request a code review for the current PR changes. This tool analyzes the proposed changes and provides feedback.
|
|
257
257
|
Call this tool before finalizing your session and completing the task to get review feedback.
|
|
258
|
-
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 s=>{let r=n.startJob(),o=I6e();try{let d=t.location||process.cwd();if(!s||!s.prTitle||!s.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:o},metrics:{},restrictedProperties:{}}};let i=await t6e(c,d,l,I,e);if(i.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:o}}};r.throwIfAborted(),e.debug(`Code review requested for PR: ${s.prTitle}`),e.debug(`Files to review: ${i.map(Y=>Y.path).join(", ")}`);let h=l6e(d,l.github?.owner?.name||"",l.github?.repo?.name||"",await c.getCurrentCommitHash(d),s.prTitle,s.prDescription),p=await c6e(o,i,h,l,I,r,e);if(p.alerts.length===0&&p.error)return{textResultForLlm:`Code review tool encountered an issue: ${p.error}`,resultType:"failure",error:p.error,toolTelemetry:{properties:{codeReviewResult:"failure",codeReviewError:p.error,codeReviewTimedOut:p.timedOut?"true":"false",codeReviewModel:o}}};let Z=p.alerts.filter(Y=>!Y.meta||!Y.meta?.exclusionReason||Y.meta.exclusionReason===""),u=`Code review completed. Reviewed ${i.length} file(s).
|
|
258
|
+
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 s=>{let r=n.startJob(),o=I6e();try{let d=t.location||process.cwd();if(!s||!s.prTitle||!s.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:o,codeReviewError:"",codeReviewTimedOut:"false"},metrics:{},restrictedProperties:{}}};let i=await t6e(c,d,l,I,e);if(i.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:o,codeReviewTimedOut:"false"},metrics:{},restrictedProperties:{}}};r.throwIfAborted(),e.debug(`Code review requested for PR: ${s.prTitle}`),e.debug(`Files to review: ${i.map(Y=>Y.path).join(", ")}`);let h=l6e(d,l.github?.owner?.name||"",l.github?.repo?.name||"",await c.getCurrentCommitHash(d),s.prTitle,s.prDescription),p=await c6e(o,i,h,l,I,r,e);if(p.alerts.length===0&&p.error)return{textResultForLlm:`Code review tool encountered an issue: ${p.error}`,resultType:"failure",error:p.error,toolTelemetry:{properties:{codeReviewResult:"failure",codeReviewError:p.error,codeReviewTimedOut:p.timedOut?"true":"false",codeReviewModel:o},metrics:{},restrictedProperties:{}}};let Z=p.alerts.filter(Y=>!Y.meta||!Y.meta?.exclusionReason||Y.meta.exclusionReason===""),u=`Code review completed. Reviewed ${i.length} file(s).
|
|
259
259
|
`;if(Z.length>0){u+=`
|
|
260
260
|
Found ${Z.length} review comment(s):
|
|
261
261
|
`;for(let Y of Z)Y.location.endLine===Y.location.startLine?u+=`- In ${Y.location.file}, line ${Y.location.startLine}: ${Y.message}
|
|
@@ -263,7 +263,7 @@ Found ${Z.length} review comment(s):
|
|
|
263
263
|
`}else u+=`
|
|
264
264
|
No review comments found.`,p.warning&&(u+=`
|
|
265
265
|
|
|
266
|
-
Note: ${p.warning}`);e.debug(`Code review completed: ${u}`);let N=Z.map(Y=>Y.meta?.queryId).filter(Y=>!!Y&&Y.trim().length>0).sort();return{textResultForLlm:u,resultType:"success",sessionLog:u,toolTelemetry:{properties:{commentQueryNames:N.join(", "),codeReviewResult:"success",codeReviewModel:o},restrictedProperties:{prTitle:s.prTitle,filesReviewed:i.map(Y=>Y.path).join(", ")},metrics:{reviewedFiles:i.length,commentsGenerated:Z.length,commentsExcluded:p.alerts.length-Z.length}}}}catch(d){let i=Wue(d),h=i?Zue:`Error during code review: ${d}`;return e.error(h),{textResultForLlm:h,resultType:"failure",error:h,toolTelemetry:{properties:{codeReviewError:h,codeReviewTimedOut:i?"true":"false",codeReviewModel:o}}}}finally{n.endJob()}},safeForTelemetry:!0}};function I6e(){return process.env.NODE_ENV==="production"?"capi-prod-claude-sonnet-4":"capi-dev-claude-sonnet-4"}async function t6e(t,e,I,l,n){try{let c=I.swebench_base_commit||"HEAD~1",a=[];try{await t.stageChanges(e),a=await t.getChangedPaths(e,c)}catch(r){n.debug(`Could not get diff against ${c}, checking for working directory changes: ${r}`);try{let d=(await l.execReturn("git",["diff","--name-only"],{cwd:e})).stdout.trim().split(`
|
|
266
|
+
Note: ${p.warning}`);e.debug(`Code review completed: ${u}`);let N=Z.map(Y=>Y.meta?.queryId).filter(Y=>!!Y&&Y.trim().length>0).sort();return{textResultForLlm:u,resultType:"success",sessionLog:u,toolTelemetry:{properties:{commentQueryNames:N.join(", "),codeReviewResult:"success",codeReviewModel:o},restrictedProperties:{prTitle:s.prTitle,filesReviewed:i.map(Y=>Y.path).join(", ")},metrics:{reviewedFiles:i.length,commentsGenerated:Z.length,commentsExcluded:p.alerts.length-Z.length}}}}catch(d){let i=Wue(d),h=i?Zue:`Error during code review: ${d}`;return e.error(h),{textResultForLlm:h,resultType:"failure",error:h,toolTelemetry:{properties:{codeReviewResult:"failure",codeReviewError:h,codeReviewTimedOut:i?"true":"false",codeReviewModel:o},metrics:{},restrictedProperties:{}}}}finally{n.endJob()}},safeForTelemetry:!0}};function I6e(){return process.env.NODE_ENV==="production"?"capi-prod-claude-sonnet-4":"capi-dev-claude-sonnet-4"}async function t6e(t,e,I,l,n){try{let c=I.swebench_base_commit||"HEAD~1",a=[];try{await t.stageChanges(e),a=await t.getChangedPaths(e,c)}catch(r){n.debug(`Could not get diff against ${c}, checking for working directory changes: ${r}`);try{let d=(await l.execReturn("git",["diff","--name-only"],{cwd:e})).stdout.trim().split(`
|
|
267
267
|
`).filter(p=>p.length>0),h=(await l.execReturn("git",["diff","--cached","--name-only"],{cwd:e})).stdout.trim().split(`
|
|
268
268
|
`).filter(p=>p.length>0);if(a=[...new Set([...d,...h])],a.length===0)try{a=(await l.execReturn("git",["diff","--name-only",hue,"HEAD"],{cwd:e})).stdout.trim().split(`
|
|
269
269
|
`).filter(Z=>Z.length>0),c=hue}catch{return n.debug("Could not compare against empty tree"),[]}}catch(o){return n.error(`Error getting working directory changes: ${o}`),[]}}let s=[];for(let r of a)try{let o="";try{let i=ip(e,r);o=await pue(i,"utf-8")}catch{o=""}let d="";try{d=(await l.execReturn("git",["show",`${c}:${r}`],{cwd:e})).stdout}catch{d=""}s.push({path:r,contents:o,baseContents:d,regions:[[1,Math.max(1,o.split(`
|