@vypdev/copilot 3.9.1 → 3.9.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/README.md +47 -93
- package/action.yml +1 -1
- package/build/cli/index.js +317 -16
- package/build/github_action/index.js +274 -9
- package/build/web/assets/index-CfyclPC5.css +1 -0
- package/build/web/assets/index-CsboG2sG.js +3 -0
- package/build/web/index.html +2 -2
- package/package.json +1 -1
- package/setup/workflows/copilot_commit.yml +4 -0
- package/setup/workflows/copilot_issue.yml +4 -0
- package/setup/workflows/copilot_issue_comment.yml +4 -0
- package/setup/workflows/copilot_pull_request.yml +4 -0
- package/setup/workflows/copilot_pull_request_comment.yml +4 -0
- package/setup/workflows/copilot_pull_request_review_state.yml +4 -0
- package/build/web/assets/index-BTzJj-al.js +0 -3
- package/build/web/assets/index-ERZ4A62w.css +0 -1
package/build/cli/index.js
CHANGED
|
@@ -38002,6 +38002,23 @@ exports.TITLE = void 0;
|
|
|
38002
38002
|
exports.TITLE = 'Copilot';
|
|
38003
38003
|
|
|
38004
38004
|
|
|
38005
|
+
/***/ }),
|
|
38006
|
+
|
|
38007
|
+
/***/ 2396:
|
|
38008
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
38009
|
+
|
|
38010
|
+
"use strict";
|
|
38011
|
+
|
|
38012
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
38013
|
+
exports.SETUP_DOCUMENTATION = void 0;
|
|
38014
|
+
/** Public, source-controlled navigation. Never attach session, repository or credential data. */
|
|
38015
|
+
exports.SETUP_DOCUMENTATION = {
|
|
38016
|
+
tutorial: 'https://docs.page/vypdev/copilot/setup-web',
|
|
38017
|
+
firstWorkflow: 'https://docs.page/vypdev/copilot/first-workflow',
|
|
38018
|
+
recovery: 'https://docs.page/vypdev/copilot/security-operations/operations/troubleshooting',
|
|
38019
|
+
};
|
|
38020
|
+
|
|
38021
|
+
|
|
38005
38022
|
/***/ }),
|
|
38006
38023
|
|
|
38007
38024
|
/***/ 75999:
|
|
@@ -45862,6 +45879,34 @@ function verifiedReadinessLink(snapshot, number) {
|
|
|
45862
45879
|
}
|
|
45863
45880
|
|
|
45864
45881
|
|
|
45882
|
+
/***/ }),
|
|
45883
|
+
|
|
45884
|
+
/***/ 59756:
|
|
45885
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
45886
|
+
|
|
45887
|
+
"use strict";
|
|
45888
|
+
|
|
45889
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
45890
|
+
exports.hasConventionalPullRequestTitle = hasConventionalPullRequestTitle;
|
|
45891
|
+
exports.generatedPullRequestTitle = generatedPullRequestTitle;
|
|
45892
|
+
/** Recognizes the conventional header shape; the consumer's CI owns its allowed types and subject rules. */
|
|
45893
|
+
function hasConventionalPullRequestTitle(title) {
|
|
45894
|
+
return !title.includes('\n') && !title.includes('\r')
|
|
45895
|
+
&& /^\p{L}[\p{L}\p{N}_-]*(?:\([^()\r\n]+\))?!?: +\S[^\r\n]*$/u.test(title);
|
|
45896
|
+
}
|
|
45897
|
+
function generatedPullRequestTitle(sourceTitle, sanitizedSubject, issueNumber, labels) {
|
|
45898
|
+
if (hasConventionalPullRequestTitle(sourceTitle))
|
|
45899
|
+
return sourceTitle;
|
|
45900
|
+
const type = labels.isHotfix || labels.isBugfix || labels.isBug ? 'fix'
|
|
45901
|
+
: labels.isFeature || labels.isEnhancement ? 'feat'
|
|
45902
|
+
: labels.isDocs || labels.isDocumentation ? 'docs' : 'chore';
|
|
45903
|
+
const prefix = `${type}: `;
|
|
45904
|
+
const suffix = ` (#${issueNumber})`;
|
|
45905
|
+
const subject = (sanitizedSubject || 'Update linked issue').slice(0, 256 - prefix.length - suffix.length).trimEnd();
|
|
45906
|
+
return `${prefix}${subject}${suffix}`;
|
|
45907
|
+
}
|
|
45908
|
+
|
|
45909
|
+
|
|
45865
45910
|
/***/ }),
|
|
45866
45911
|
|
|
45867
45912
|
/***/ 39410:
|
|
@@ -46053,6 +46098,12 @@ Do not add the \`${profile.deployment.launcherLabel}\` label, dispatch a deploym
|
|
|
46053
46098
|
|
|
46054
46099
|
Never expose credentials, tokens, private keys, or other secrets in issues, commits, pull requests, logs, or diagnostic comments.
|
|
46055
46100
|
|
|
46101
|
+
## Repository verification prerequisites
|
|
46102
|
+
|
|
46103
|
+
The setup runner profile selects placement; it does not install the project's language runtimes. An operator must provision the project's required runtimes and dependencies in every job that runs file-changing or branch-sync verification, before the Copilot step. A separate application CI job does not prepare this job.
|
|
46104
|
+
|
|
46105
|
+
Declare reviewed version prefixes in \`.copilot/verification-prerequisites.json\` (schemaVersion 1, runtimes such as java 17, node 24, pnpm 10). Copilot checks declared versions in the credential-free verification environment before each configured verification command; a missing or incompatible runtime blocks publication. Without this optional declaration, existing verification behavior remains and no language is inferred. Java provisioning may use \`actions/setup-java\`; \`JAVA_HOME\` and \`PATH\` survive isolation, while agent credentials and tool-option injection variables do not. Do not add an unreviewed bootstrap or weaken verification to work around a missing runtime. Read [verification prerequisites and same-job setup](https://docs.page/vypdev/copilot/security-operations/operations/verification#repository-verification-prerequisites).
|
|
46106
|
+
|
|
46056
46107
|
For the full contributor flow, read [repository collaboration](https://github.com/vypdev/copilot/blob/master/docs/agents/repository-collaboration.mdx). For drift and recovery, read [guidance troubleshooting](https://github.com/vypdev/copilot/blob/master/docs/agents/repository-guidance-troubleshooting.mdx).
|
|
46057
46108
|
`;
|
|
46058
46109
|
}
|
|
@@ -50159,13 +50210,16 @@ function validateDiscoveredProjectStatuses(configuration, discovery) {
|
|
|
50159
50210
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
50160
50211
|
exports.setupQuestionDocumentation = setupQuestionDocumentation;
|
|
50161
50212
|
const docs = {
|
|
50162
|
-
features: { title: '
|
|
50163
|
-
issueWorkflows: { title: '
|
|
50213
|
+
features: { title: 'Choose a Copilot goal', url: 'https://docs.page/vypdev/copilot/guides' },
|
|
50214
|
+
issueWorkflows: { title: 'Select issue kinds and forms', url: 'https://docs.page/vypdev/copilot/issues/configurable-workflows' },
|
|
50215
|
+
issuesGuide: { title: 'Manage issues and branches', url: 'https://docs.page/vypdev/copilot/guides/issues-and-branches' },
|
|
50216
|
+
reviewGuide: { title: 'Review PRs and resolve findings', url: 'https://docs.page/vypdev/copilot/guides/review-pull-requests' },
|
|
50217
|
+
botGuide: { title: 'Work with the bot', url: 'https://docs.page/vypdev/copilot/guides/work-with-the-bot' },
|
|
50218
|
+
releaseGuide: { title: 'Release and hotfix guide', url: 'https://docs.page/vypdev/copilot/guides/releases-and-hotfixes' },
|
|
50164
50219
|
branchManagement: { title: 'Issue branch management', url: 'https://docs.page/vypdev/copilot/issues/branch-management' },
|
|
50165
50220
|
preBranchSdd: { title: 'Pre-branch design documents', url: 'https://docs.page/vypdev/copilot/issues/pre-branch-sdds' },
|
|
50166
50221
|
issueLifecycle: { title: 'Issue notifications and automatic closure', url: 'https://docs.page/vypdev/copilot/issues/notifications-and-auto-close' },
|
|
50167
50222
|
assignments: { title: 'Assignees and GitHub Projects', url: 'https://docs.page/vypdev/copilot/issues/assignees-and-projects' },
|
|
50168
|
-
pullRequestWorkflows: { title: 'Pull-request workflow setup', url: 'https://docs.page/vypdev/copilot/pull-requests/workflow-setup' },
|
|
50169
50223
|
pullRequestDescription: { title: 'AI pull-request descriptions', url: 'https://docs.page/vypdev/copilot/pull-requests/ai-description' },
|
|
50170
50224
|
repositoryGuidance: { title: 'Repository guidance for agents', url: 'https://docs.page/vypdev/copilot/agents/repository-collaboration' },
|
|
50171
50225
|
runtime: { title: 'Agent runtime selection', url: 'https://docs.page/vypdev/copilot/agents/runtime-selection' },
|
|
@@ -50180,7 +50234,7 @@ const docs = {
|
|
|
50180
50234
|
projects: { title: 'Assignees and GitHub Projects', url: 'https://docs.page/vypdev/copilot/issues/assignees-and-projects' },
|
|
50181
50235
|
githubProjects: { title: 'GitHub: About Projects', url: 'https://docs.github.com/en/issues/planning-and-tracking-with-projects/learning-about-projects/about-projects' },
|
|
50182
50236
|
githubStatus: { title: 'GitHub: About single-select fields', url: 'https://docs.github.com/en/issues/planning-and-tracking-with-projects/understanding-fields/about-single-select-fields' },
|
|
50183
|
-
provisioning: { title: '
|
|
50237
|
+
provisioning: { title: 'Set up with the web assistant', url: 'https://docs.page/vypdev/copilot/setup-web' },
|
|
50184
50238
|
storage: { title: 'GitHub Actions Secrets and Variables', url: 'https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-secrets' },
|
|
50185
50239
|
};
|
|
50186
50240
|
/** Links are selected from source-controlled constants, never derived from answers or remote text. */
|
|
@@ -50190,10 +50244,14 @@ function setupQuestionDocumentation(question) {
|
|
|
50190
50244
|
return { title: 'Runner profiles', url: 'https://docs.page/vypdev/copilot/configuration#runner-profiles' };
|
|
50191
50245
|
if (id === 'issueWorkflows.enabled')
|
|
50192
50246
|
return docs.issueWorkflows;
|
|
50193
|
-
if (id === 'features.issues')
|
|
50194
|
-
return docs.
|
|
50247
|
+
if (id === 'features.issues' || id === 'features.commits')
|
|
50248
|
+
return docs.issuesGuide;
|
|
50195
50249
|
if (id === 'features.pullRequests')
|
|
50196
|
-
return docs.
|
|
50250
|
+
return docs.reviewGuide;
|
|
50251
|
+
if (id === 'features.issueComments' || id === 'features.pullRequestComments')
|
|
50252
|
+
return docs.botGuide;
|
|
50253
|
+
if (id === 'features.release' || id === 'features.hotfix')
|
|
50254
|
+
return docs.releaseGuide;
|
|
50197
50255
|
if (id === 'repository.issueManagedBranches' || /^repository\.(feature|bugfix|hotfix|release|docs|chore)Tree$/u.test(id))
|
|
50198
50256
|
return docs.branchManagement;
|
|
50199
50257
|
if (id === 'repository.preBranchSdd')
|
|
@@ -53048,6 +53106,87 @@ function projectCurrentNativeStatus(status, facts) {
|
|
|
53048
53106
|
}
|
|
53049
53107
|
|
|
53050
53108
|
|
|
53109
|
+
/***/ }),
|
|
53110
|
+
|
|
53111
|
+
/***/ 89347:
|
|
53112
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
53113
|
+
|
|
53114
|
+
"use strict";
|
|
53115
|
+
|
|
53116
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
53117
|
+
exports.VerificationPrerequisiteError = exports.VERIFICATION_RUNTIME_SPECS = exports.VERIFICATION_RUNTIME_HELP = exports.VERIFICATION_RUNTIME_MANIFEST = void 0;
|
|
53118
|
+
exports.parseVerificationRuntimeManifest = parseVerificationRuntimeManifest;
|
|
53119
|
+
exports.verificationRuntimeVersion = verificationRuntimeVersion;
|
|
53120
|
+
exports.verificationRuntimeMatches = verificationRuntimeMatches;
|
|
53121
|
+
exports.VERIFICATION_RUNTIME_MANIFEST = '.copilot/verification-prerequisites.json';
|
|
53122
|
+
exports.VERIFICATION_RUNTIME_HELP = 'https://docs.page/vypdev/copilot/security-operations/operations/verification#repository-verification-prerequisites';
|
|
53123
|
+
exports.VERIFICATION_RUNTIME_SPECS = {
|
|
53124
|
+
java: { label: 'Java', program: 'java', args: ['-version'] },
|
|
53125
|
+
node: { label: 'Node.js', program: 'node', args: ['--version'] },
|
|
53126
|
+
pnpm: { label: 'pnpm', program: 'pnpm', args: ['--version'] },
|
|
53127
|
+
python: { label: 'Python', program: 'python3', args: ['--version'] },
|
|
53128
|
+
go: { label: 'Go', program: 'go', args: ['version'] },
|
|
53129
|
+
dotnet: { label: '.NET SDK', program: 'dotnet', args: ['--version'] },
|
|
53130
|
+
ruby: { label: 'Ruby', program: 'ruby', args: ['--version'] },
|
|
53131
|
+
rust: { label: 'Rust', program: 'rustc', args: ['--version'] },
|
|
53132
|
+
};
|
|
53133
|
+
const VERSION_PREFIX = /^[1-9]\d{0,2}(?:\.(?:0|[1-9]\d{0,2})){0,2}$/u;
|
|
53134
|
+
/** Only reviewed, closed runtime/version facts enter user-visible diagnostics. Raw tool output never does. */
|
|
53135
|
+
class VerificationPrerequisiteError extends Error {
|
|
53136
|
+
constructor(reason, requirement, observed, job) {
|
|
53137
|
+
const jobLabel = job && /^[A-Za-z_][A-Za-z0-9_-]{0,99}$/u.test(job) ? ` in job ${job}` : ' in this job';
|
|
53138
|
+
const runtime = requirement && Object.prototype.hasOwnProperty.call(exports.VERIFICATION_RUNTIME_SPECS, requirement.runtime)
|
|
53139
|
+
? exports.VERIFICATION_RUNTIME_SPECS[requirement.runtime].label : 'Required runtime';
|
|
53140
|
+
const version = requirement && VERSION_PREFIX.test(requirement.version) ? requirement.version : 'declared version';
|
|
53141
|
+
const actual = observed && /^[1-9]\d{0,2}(?:\.(?:0|[1-9]\d{0,2})){0,3}$/u.test(observed) ? observed : 'unavailable';
|
|
53142
|
+
const cause = reason === 'manifest-invalid' ? `${exports.VERIFICATION_RUNTIME_MANIFEST} is invalid or unsafe`
|
|
53143
|
+
: reason === 'version-mismatch' ? `${runtime} ${version} is required; observed ${actual}`
|
|
53144
|
+
: reason === 'unreadable-version' ? `${runtime} ${version} could not be verified`
|
|
53145
|
+
: `${runtime} ${version} is unavailable`;
|
|
53146
|
+
const action = reason === 'manifest-invalid' ? 'Correct the reviewed runtime declaration.'
|
|
53147
|
+
: `Provision the declared runtime in the same job before Copilot, then retry.${requirement?.runtime === 'java' ? ' For Java, configure actions/setup-java or a managed JAVA_HOME.' : ''}`;
|
|
53148
|
+
super(`Repository verification is blocked${jobLabel}: ${cause}. ${action} The repository verification command was not run. Help: ${exports.VERIFICATION_RUNTIME_HELP}`);
|
|
53149
|
+
this.name = 'VerificationPrerequisiteError';
|
|
53150
|
+
}
|
|
53151
|
+
}
|
|
53152
|
+
exports.VerificationPrerequisiteError = VerificationPrerequisiteError;
|
|
53153
|
+
function parseVerificationRuntimeManifest(value) {
|
|
53154
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
53155
|
+
throw new VerificationPrerequisiteError('manifest-invalid');
|
|
53156
|
+
const object = value;
|
|
53157
|
+
if (object.schemaVersion !== 1 || Object.keys(object).some(key => !['schemaVersion', 'runtimes'].includes(key))
|
|
53158
|
+
|| !object.runtimes || typeof object.runtimes !== 'object' || Array.isArray(object.runtimes)) {
|
|
53159
|
+
throw new VerificationPrerequisiteError('manifest-invalid');
|
|
53160
|
+
}
|
|
53161
|
+
const runtimes = object.runtimes;
|
|
53162
|
+
if (Object.keys(runtimes).length > 8)
|
|
53163
|
+
throw new VerificationPrerequisiteError('manifest-invalid');
|
|
53164
|
+
return Object.entries(runtimes).map(([runtime, version]) => {
|
|
53165
|
+
if (!Object.prototype.hasOwnProperty.call(exports.VERIFICATION_RUNTIME_SPECS, runtime) || typeof version !== 'string' || !VERSION_PREFIX.test(version)) {
|
|
53166
|
+
throw new VerificationPrerequisiteError('manifest-invalid');
|
|
53167
|
+
}
|
|
53168
|
+
return Object.freeze({ runtime: runtime, version });
|
|
53169
|
+
});
|
|
53170
|
+
}
|
|
53171
|
+
function verificationRuntimeVersion(runtime, output) {
|
|
53172
|
+
const patterns = {
|
|
53173
|
+
java: /^(?:openjdk|java) (?:version )?["']?(\d+(?:\.\d+){0,3})/imu,
|
|
53174
|
+
node: /^v(\d+\.\d+\.\d+)/mu,
|
|
53175
|
+
pnpm: /^(\d+\.\d+\.\d+)/mu,
|
|
53176
|
+
python: /^Python (\d+\.\d+\.\d+)/mu,
|
|
53177
|
+
go: /^go version go(\d+\.\d+(?:\.\d+)?)/mu,
|
|
53178
|
+
dotnet: /^(\d+\.\d+\.\d+)/mu,
|
|
53179
|
+
ruby: /^ruby (\d+\.\d+\.\d+)/mu,
|
|
53180
|
+
rust: /^rustc (\d+\.\d+\.\d+)/mu,
|
|
53181
|
+
};
|
|
53182
|
+
const version = patterns[runtime].exec(output)?.[1];
|
|
53183
|
+
return runtime === 'java' && version?.startsWith('1.') ? version.slice(2) : version;
|
|
53184
|
+
}
|
|
53185
|
+
function verificationRuntimeMatches(required, observed) {
|
|
53186
|
+
return observed === required || observed.startsWith(`${required}.`);
|
|
53187
|
+
}
|
|
53188
|
+
|
|
53189
|
+
|
|
53051
53190
|
/***/ }),
|
|
53052
53191
|
|
|
53053
53192
|
/***/ 43193:
|
|
@@ -57143,7 +57282,7 @@ class SyncBranchUseCase {
|
|
|
57143
57282
|
const commands = (0, verify_command_policy_1.limitVerifyCommands)([...context.verifyCommands]);
|
|
57144
57283
|
if (commands.length === verify_command_policy_1.MAX_VERIFY_COMMANDS)
|
|
57145
57284
|
(0, logging_ports_1.logInfo)(`Branch sync verification is capped at ${verify_command_policy_1.MAX_VERIFY_COMMANDS} commands.`);
|
|
57146
|
-
const verification = await (0, verify_command_runner_1.runVerifyCommands)(commands, (program, args) => this.git.execute(program, args, { untrusted: true }));
|
|
57285
|
+
const verification = await (0, verify_command_runner_1.runVerifyCommands)(commands, (program, args) => this.git.execute(program, args, { untrusted: true, verifyRuntimePrerequisites: true }));
|
|
57147
57286
|
if (!verification.success) {
|
|
57148
57287
|
return {
|
|
57149
57288
|
commandCount: commands.length,
|
|
@@ -65658,7 +65797,7 @@ async function runVerification(context, gitCommitPort) {
|
|
|
65658
65797
|
if (verifyCommands.length === 0)
|
|
65659
65798
|
return undefined;
|
|
65660
65799
|
(0, logging_ports_1.logInfo)(`Running ${verifyCommands.length} verify ${verifyCommands.length === 1 ? 'command' : 'commands'}...`);
|
|
65661
|
-
const verify = await (0, verify_command_runner_1.runVerifyCommands)(verifyCommands, (program, args) => gitCommitPort.execute(program, args, { untrusted: true }));
|
|
65800
|
+
const verify = await (0, verify_command_runner_1.runVerifyCommands)(verifyCommands, (program, args) => gitCommitPort.execute(program, args, { untrusted: true, verifyRuntimePrerequisites: true }));
|
|
65662
65801
|
return verify.success
|
|
65663
65802
|
? undefined
|
|
65664
65803
|
: verify.error ?? `Verify command failed: ${verify.failedCommand ?? "unknown"}.`;
|
|
@@ -67881,6 +68020,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
67881
68020
|
exports.runVerifyCommands = runVerifyCommands;
|
|
67882
68021
|
const logging_ports_1 = __nccwpck_require__(6152);
|
|
67883
68022
|
const verify_command_policy_1 = __nccwpck_require__(96031);
|
|
68023
|
+
const verification_runtime_policy_1 = __nccwpck_require__(89347);
|
|
67884
68024
|
async function runVerifyCommands(commands, execute) {
|
|
67885
68025
|
for (const command of commands) {
|
|
67886
68026
|
const result = await executeVerifyCommand(command, execute);
|
|
@@ -67899,7 +68039,11 @@ async function executeVerifyCommand(command, execute) {
|
|
|
67899
68039
|
? { success: true }
|
|
67900
68040
|
: { success: false, failedCommand: formatCommandForDiagnostics(parsed) };
|
|
67901
68041
|
}
|
|
67902
|
-
catch {
|
|
68042
|
+
catch (error) {
|
|
68043
|
+
if (error instanceof verification_runtime_policy_1.VerificationPrerequisiteError) {
|
|
68044
|
+
return { success: false, failedCommand: formatCommandForDiagnostics(parsed),
|
|
68045
|
+
error: `${error.message} Verification command: ${formatCommandForDiagnostics(parsed)}.` };
|
|
68046
|
+
}
|
|
67903
68047
|
(0, logging_ports_1.logError)('Verify command failed.');
|
|
67904
68048
|
return { success: false, failedCommand: formatCommandForDiagnostics(parsed) };
|
|
67905
68049
|
}
|
|
@@ -70081,6 +70225,7 @@ exports.titleUpdateFailure = titleUpdateFailure;
|
|
|
70081
70225
|
const result_1 = __nccwpck_require__(73817);
|
|
70082
70226
|
const application_error_1 = __nccwpck_require__(75999);
|
|
70083
70227
|
const positive_integer_policy_1 = __nccwpck_require__(19879);
|
|
70228
|
+
const pull_request_title_policy_1 = __nccwpck_require__(59756);
|
|
70084
70229
|
function projectUpdateTitleContext(source) {
|
|
70085
70230
|
if (source.isIssue) {
|
|
70086
70231
|
return Object.freeze({
|
|
@@ -70131,19 +70276,27 @@ async function runPullRequestTitleUpdate(param, taskId, issueRepository) {
|
|
|
70131
70276
|
if (!linkedIssueNumber || linkedIssueNumber === param.pullRequestNumber) {
|
|
70132
70277
|
return [skippedResult(taskId)];
|
|
70133
70278
|
}
|
|
70279
|
+
const currentTitle = await issueRepository.getTitle(param.pullRequestNumber);
|
|
70280
|
+
if (currentTitle === undefined) {
|
|
70281
|
+
return [new result_1.Result({ id: taskId, success: false, executed: true,
|
|
70282
|
+
steps: ['The current pull request title could not be read. No title change was attempted.'],
|
|
70283
|
+
errors: [new application_error_1.ApplicationError('provider.unavailable', 'Unable to read the current pull request title.')] })];
|
|
70284
|
+
}
|
|
70285
|
+
if ((0, pull_request_title_policy_1.hasConventionalPullRequestTitle)(currentTitle))
|
|
70286
|
+
return [skippedResult(taskId)];
|
|
70134
70287
|
const issueTitle = await issueRepository.getTitle(linkedIssueNumber);
|
|
70135
70288
|
if (issueTitle === undefined) {
|
|
70136
70289
|
return [new result_1.Result({ id: taskId, success: false, executed: true, steps: ['Tried to update title, but there was a problem.'] })];
|
|
70137
70290
|
}
|
|
70138
70291
|
const title = await issueRepository.updatePullRequestTitle({
|
|
70139
|
-
pullRequestTitle:
|
|
70292
|
+
pullRequestTitle: currentTitle,
|
|
70140
70293
|
issueTitle,
|
|
70141
70294
|
issueNumber: linkedIssueNumber,
|
|
70142
70295
|
pullRequestNumber: param.pullRequestNumber,
|
|
70143
70296
|
labelFacts: param.labelFacts,
|
|
70144
70297
|
});
|
|
70145
70298
|
return title
|
|
70146
|
-
? [updatedResult(taskId, `The pull request's title was updated from \`${
|
|
70299
|
+
? [updatedResult(taskId, `The pull request's title was updated from \`${currentTitle}\` to \`${title}\`.`)]
|
|
70147
70300
|
: [skippedResult(taskId)];
|
|
70148
70301
|
}
|
|
70149
70302
|
function titleUpdateFailure(taskId, error) {
|
|
@@ -73494,6 +73647,7 @@ exports.registerSetupCommand = registerSetupCommand;
|
|
|
73494
73647
|
const product_identity_1 = __nccwpck_require__(18739);
|
|
73495
73648
|
const setup_command_options_1 = __nccwpck_require__(99254);
|
|
73496
73649
|
const setup_execution_1 = __nccwpck_require__(51293);
|
|
73650
|
+
const setup_documentation_1 = __nccwpck_require__(2396);
|
|
73497
73651
|
function registerSetupCommand(program) {
|
|
73498
73652
|
program
|
|
73499
73653
|
.command('setup')
|
|
@@ -73527,6 +73681,7 @@ function registerSetupCommand(program) {
|
|
|
73527
73681
|
.option('--update-workflows', 'Allow setup-managed workflows already in the repository to be updated', false)
|
|
73528
73682
|
.option('--workflow-pat <token>', 'Workflow PAT for the bot account (prefer the hidden interactive prompt)')
|
|
73529
73683
|
.option('--secret <name=value>', 'Secret value for non-interactive setup; repeat for each API key', setup_command_options_1.collectSecret, {})
|
|
73684
|
+
.addHelpText('after', `\nGuides (open only when you choose):\n Web setup tutorial: ${setup_documentation_1.SETUP_DOCUMENTATION.tutorial}\n First issue-to-PR workflow: ${setup_documentation_1.SETUP_DOCUMENTATION.firstWorkflow}\n Troubleshooting: ${setup_documentation_1.SETUP_DOCUMENTATION.recovery}\n\nDuring interactive setup, type ? for question help and :back to revisit an answer.\n`)
|
|
73530
73685
|
.action(setup_execution_1.executeSetupCommand);
|
|
73531
73686
|
}
|
|
73532
73687
|
|
|
@@ -75440,9 +75595,19 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
75440
75595
|
exports.ConsoleSetupJourneyPresenter = void 0;
|
|
75441
75596
|
exports.renderSetupJourney = renderSetupJourney;
|
|
75442
75597
|
const setup_prompt_rendering_1 = __nccwpck_require__(76673);
|
|
75598
|
+
const setup_documentation_1 = __nccwpck_require__(2396);
|
|
75443
75599
|
class ConsoleSetupJourneyPresenter {
|
|
75444
75600
|
present(view) {
|
|
75445
75601
|
console.log(renderSetupJourney(view));
|
|
75602
|
+
if (view.outcome === 'complete') {
|
|
75603
|
+
console.log(`Next: install the reviewed files, then verify your first workflow: ${setup_documentation_1.SETUP_DOCUMENTATION.firstWorkflow}`);
|
|
75604
|
+
}
|
|
75605
|
+
else if (view.outcome === 'blocked' || view.outcome === 'partial') {
|
|
75606
|
+
console.log(`Inspect the result before retrying. Troubleshooting: ${setup_documentation_1.SETUP_DOCUMENTATION.recovery}`);
|
|
75607
|
+
}
|
|
75608
|
+
else if (view.current === 'Repository' || view.outcome === 'dry-run') {
|
|
75609
|
+
console.log(`Setup tutorial (opens only when you choose): ${setup_documentation_1.SETUP_DOCUMENTATION.tutorial}`);
|
|
75610
|
+
}
|
|
75446
75611
|
}
|
|
75447
75612
|
}
|
|
75448
75613
|
exports.ConsoleSetupJourneyPresenter = ConsoleSetupJourneyPresenter;
|
|
@@ -84736,6 +84901,7 @@ exports.IssueProgressTrackingRepository = IssueProgressTrackingRepository;
|
|
|
84736
84901
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
84737
84902
|
exports.IssueTitleRepository = void 0;
|
|
84738
84903
|
const issue_emoji_policy_1 = __nccwpck_require__(81201);
|
|
84904
|
+
const pull_request_title_policy_1 = __nccwpck_require__(59756);
|
|
84739
84905
|
const issue_title_policy_1 = __nccwpck_require__(83179);
|
|
84740
84906
|
const issue_title_update_1 = __nccwpck_require__(9229);
|
|
84741
84907
|
class IssueTitleRepository {
|
|
@@ -84753,10 +84919,12 @@ class IssueTitleRepository {
|
|
|
84753
84919
|
return (0, issue_title_update_1.updateIssueTitle)(this.issueTitleClient, owner, repository, issueTitle, formattedTitle, issueNumber, token);
|
|
84754
84920
|
});
|
|
84755
84921
|
};
|
|
84756
|
-
this.updateTitlePullRequestFormat = async (owner, repository, pullRequestTitle, issueTitle, issueNumber, pullRequestNumber,
|
|
84922
|
+
this.updateTitlePullRequestFormat = async (owner, repository, pullRequestTitle, issueTitle, issueNumber, pullRequestNumber, _branchManagementEmoji, labels, token) => {
|
|
84757
84923
|
return (0, issue_title_update_1.withTitleUpdateLogging)(() => {
|
|
84758
|
-
|
|
84759
|
-
|
|
84924
|
+
if ((0, pull_request_title_policy_1.hasConventionalPullRequestTitle)(pullRequestTitle))
|
|
84925
|
+
return Promise.resolve(undefined);
|
|
84926
|
+
const sourceTitle = (0, issue_title_policy_1.normalizePullRequestSourceTitle)(issueTitle, issueNumber);
|
|
84927
|
+
const formattedTitle = (0, pull_request_title_policy_1.generatedPullRequestTitle)(sourceTitle, (0, issue_title_policy_1.sanitizePullRequestTitle)(sourceTitle), issueNumber, labels);
|
|
84760
84928
|
return (0, issue_title_update_1.updateIssueTitle)(this.issueTitleClient, owner, repository, pullRequestTitle, formattedTitle, pullRequestNumber, token);
|
|
84761
84929
|
});
|
|
84762
84930
|
};
|
|
@@ -96391,6 +96559,7 @@ const exec = __importStar(__nccwpck_require__(18538));
|
|
|
96391
96559
|
const git_authentication_environment_1 = __nccwpck_require__(16535);
|
|
96392
96560
|
const untrusted_command_environment_1 = __nccwpck_require__(2304);
|
|
96393
96561
|
const git_hook_isolation_1 = __nccwpck_require__(39764);
|
|
96562
|
+
const verification_runtime_preflight_1 = __nccwpck_require__(23100);
|
|
96394
96563
|
class GitCommitAdapter {
|
|
96395
96564
|
constructor(executeCommand = (program, args, options) => options
|
|
96396
96565
|
? exec.exec(program, args, {
|
|
@@ -96400,16 +96569,21 @@ class GitCommitAdapter {
|
|
|
96400
96569
|
...(options.stdout ? { listeners: { stdout: options.stdout } } : {}),
|
|
96401
96570
|
...(options.env ? { env: options.env } : {}),
|
|
96402
96571
|
})
|
|
96403
|
-
: exec.exec(program, args)) {
|
|
96572
|
+
: exec.exec(program, args), checkPrerequisites = verification_runtime_preflight_1.assertVerificationRuntimePrerequisites) {
|
|
96404
96573
|
this.executeCommand = executeCommand;
|
|
96574
|
+
this.checkPrerequisites = checkPrerequisites;
|
|
96405
96575
|
}
|
|
96406
96576
|
async execute(program, args, options) {
|
|
96577
|
+
if (options?.verifyRuntimePrerequisites && !options.untrusted)
|
|
96578
|
+
throw new Error('Runtime preflight requires credential-free verification.');
|
|
96407
96579
|
if (!options?.untrusted)
|
|
96408
96580
|
return options ? this.executeCommand(program, args, options) : this.executeCommand(program, args);
|
|
96409
96581
|
if (options.env)
|
|
96410
96582
|
throw new Error('Untrusted command execution does not accept a caller-supplied environment.');
|
|
96411
96583
|
const runtime = (0, untrusted_command_environment_1.prepareUntrustedCommandEnvironment)();
|
|
96412
96584
|
try {
|
|
96585
|
+
if (options.verifyRuntimePrerequisites)
|
|
96586
|
+
this.checkPrerequisites(runtime.environment);
|
|
96413
96587
|
return await this.executeCommand(program, args, {
|
|
96414
96588
|
...(options.stdout ? { stdout: options.stdout } : {}),
|
|
96415
96589
|
env: runtime.environment,
|
|
@@ -101890,6 +102064,7 @@ const node_path_1 = __nccwpck_require__(49411);
|
|
|
101890
102064
|
const agent_private_install_root_1 = __nccwpck_require__(44640);
|
|
101891
102065
|
const ALLOWED_VARIABLES = [
|
|
101892
102066
|
'PATH',
|
|
102067
|
+
'JAVA_HOME',
|
|
101893
102068
|
'LANG',
|
|
101894
102069
|
'LANGUAGE',
|
|
101895
102070
|
'LC_ALL',
|
|
@@ -101949,6 +102124,132 @@ function prepareUntrustedCommandEnvironment(source = process.env, platform = pro
|
|
|
101949
102124
|
}
|
|
101950
102125
|
|
|
101951
102126
|
|
|
102127
|
+
/***/ }),
|
|
102128
|
+
|
|
102129
|
+
/***/ 91053:
|
|
102130
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
102131
|
+
|
|
102132
|
+
"use strict";
|
|
102133
|
+
|
|
102134
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
102135
|
+
exports.readVerificationRuntimeManifest = readVerificationRuntimeManifest;
|
|
102136
|
+
const node_fs_1 = __nccwpck_require__(87561);
|
|
102137
|
+
const node_path_1 = __nccwpck_require__(49411);
|
|
102138
|
+
const verification_runtime_policy_1 = __nccwpck_require__(89347);
|
|
102139
|
+
const MAX_MANIFEST_BYTES = 16 * 1024;
|
|
102140
|
+
function readVerificationRuntimeManifest(root) {
|
|
102141
|
+
const path = (0, node_path_1.resolve)(root, verification_runtime_policy_1.VERIFICATION_RUNTIME_MANIFEST);
|
|
102142
|
+
let descriptor;
|
|
102143
|
+
try {
|
|
102144
|
+
let directory;
|
|
102145
|
+
try {
|
|
102146
|
+
directory = (0, node_fs_1.lstatSync)((0, node_path_1.join)(root, '.copilot'));
|
|
102147
|
+
}
|
|
102148
|
+
catch (error) {
|
|
102149
|
+
if (error.code === 'ENOENT')
|
|
102150
|
+
return [];
|
|
102151
|
+
throw error;
|
|
102152
|
+
}
|
|
102153
|
+
if (!directory.isDirectory() || directory.isSymbolicLink()
|
|
102154
|
+
|| (0, node_fs_1.realpathSync)((0, node_path_1.join)(root, '.copilot')) !== (0, node_path_1.join)((0, node_fs_1.realpathSync)(root), '.copilot'))
|
|
102155
|
+
throw new Error('Unsafe manifest parent');
|
|
102156
|
+
let entry;
|
|
102157
|
+
try {
|
|
102158
|
+
entry = (0, node_fs_1.lstatSync)(path, { bigint: true });
|
|
102159
|
+
}
|
|
102160
|
+
catch (error) {
|
|
102161
|
+
if (error.code === 'ENOENT')
|
|
102162
|
+
return [];
|
|
102163
|
+
throw error;
|
|
102164
|
+
}
|
|
102165
|
+
if (!entry.isFile() || entry.isSymbolicLink() || entry.nlink !== 1n || entry.size > BigInt(MAX_MANIFEST_BYTES))
|
|
102166
|
+
throw new Error('Unsafe manifest');
|
|
102167
|
+
descriptor = (0, node_fs_1.openSync)(path, node_fs_1.constants.O_RDONLY | (node_fs_1.constants.O_NOFOLLOW ?? 0));
|
|
102168
|
+
const opened = (0, node_fs_1.fstatSync)(descriptor, { bigint: true });
|
|
102169
|
+
if (!opened.isFile() || opened.nlink !== 1n || opened.dev !== entry.dev || opened.ino !== entry.ino
|
|
102170
|
+
|| opened.size > BigInt(MAX_MANIFEST_BYTES))
|
|
102171
|
+
throw new Error('Manifest changed');
|
|
102172
|
+
const bytes = Buffer.alloc(MAX_MANIFEST_BYTES + 1);
|
|
102173
|
+
const size = (0, node_fs_1.readSync)(descriptor, bytes, 0, bytes.length, 0);
|
|
102174
|
+
if (size > MAX_MANIFEST_BYTES)
|
|
102175
|
+
throw new Error('Oversized manifest');
|
|
102176
|
+
return (0, verification_runtime_policy_1.parseVerificationRuntimeManifest)(JSON.parse(bytes.subarray(0, size).toString('utf8')));
|
|
102177
|
+
}
|
|
102178
|
+
catch {
|
|
102179
|
+
throw new verification_runtime_policy_1.VerificationPrerequisiteError('manifest-invalid');
|
|
102180
|
+
}
|
|
102181
|
+
finally {
|
|
102182
|
+
if (descriptor !== undefined)
|
|
102183
|
+
(0, node_fs_1.closeSync)(descriptor);
|
|
102184
|
+
}
|
|
102185
|
+
}
|
|
102186
|
+
|
|
102187
|
+
|
|
102188
|
+
/***/ }),
|
|
102189
|
+
|
|
102190
|
+
/***/ 23100:
|
|
102191
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
102192
|
+
|
|
102193
|
+
"use strict";
|
|
102194
|
+
|
|
102195
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
102196
|
+
exports.assertVerificationRuntimePrerequisites = assertVerificationRuntimePrerequisites;
|
|
102197
|
+
const node_child_process_1 = __nccwpck_require__(17718);
|
|
102198
|
+
const node_path_1 = __nccwpck_require__(49411);
|
|
102199
|
+
const verification_runtime_manifest_1 = __nccwpck_require__(91053);
|
|
102200
|
+
const verification_runtime_policy_1 = __nccwpck_require__(89347);
|
|
102201
|
+
const probe = (program, args, environment) => {
|
|
102202
|
+
const result = (0, node_child_process_1.spawnSync)(program, [...args], { env: environment, encoding: 'utf8', shell: false,
|
|
102203
|
+
windowsHide: true, timeout: 5000, maxBuffer: 8192, stdio: ['ignore', 'pipe', 'pipe'] });
|
|
102204
|
+
return { status: result.status, output: `${result.stdout ?? ''}\n${result.stderr ?? ''}`, failed: !!result.error };
|
|
102205
|
+
};
|
|
102206
|
+
const hasControlCharacter = (value) => [...value].some(character => character.charCodeAt(0) < 32);
|
|
102207
|
+
/** Fixed version probes only; never installs a runtime or executes a repository-provided bootstrap. */
|
|
102208
|
+
function assertVerificationRuntimePrerequisites(environment, root = process.cwd(), run = probe, platform = process.platform, job = process.env.GITHUB_JOB) {
|
|
102209
|
+
for (const requirement of (0, verification_runtime_manifest_1.readVerificationRuntimeManifest)(root)) {
|
|
102210
|
+
checkRuntime(requirement, environment, run, platform, job);
|
|
102211
|
+
}
|
|
102212
|
+
}
|
|
102213
|
+
function checkRuntime(requirement, environment, run, platform, job) {
|
|
102214
|
+
const spec = verification_runtime_policy_1.VERIFICATION_RUNTIME_SPECS[requirement.runtime];
|
|
102215
|
+
let program = spec.program;
|
|
102216
|
+
let args = spec.args;
|
|
102217
|
+
if (requirement.runtime === 'java' && environment.JAVA_HOME) {
|
|
102218
|
+
const paths = platform === 'win32' ? node_path_1.win32 : node_path_1.posix;
|
|
102219
|
+
if (!paths.isAbsolute(environment.JAVA_HOME) || hasControlCharacter(environment.JAVA_HOME)) {
|
|
102220
|
+
throw new verification_runtime_policy_1.VerificationPrerequisiteError('unavailable', requirement, undefined, job);
|
|
102221
|
+
}
|
|
102222
|
+
program = paths.join(environment.JAVA_HOME, 'bin', platform === 'win32' ? 'java.exe' : 'java');
|
|
102223
|
+
}
|
|
102224
|
+
else if (requirement.runtime === 'python' && platform === 'win32')
|
|
102225
|
+
program = 'python';
|
|
102226
|
+
else if (requirement.runtime === 'pnpm' && platform === 'win32') {
|
|
102227
|
+
const systemRoot = environment.SystemRoot;
|
|
102228
|
+
if (!systemRoot || !node_path_1.win32.isAbsolute(systemRoot) || hasControlCharacter(systemRoot)) {
|
|
102229
|
+
throw new verification_runtime_policy_1.VerificationPrerequisiteError('unavailable', requirement, undefined, job);
|
|
102230
|
+
}
|
|
102231
|
+
program = node_path_1.win32.join(systemRoot, 'System32', 'cmd.exe');
|
|
102232
|
+
args = ['/d', '/s', '/c', 'pnpm --version'];
|
|
102233
|
+
}
|
|
102234
|
+
let result;
|
|
102235
|
+
try {
|
|
102236
|
+
result = run(program, args, environment);
|
|
102237
|
+
}
|
|
102238
|
+
catch {
|
|
102239
|
+
throw new verification_runtime_policy_1.VerificationPrerequisiteError('unavailable', requirement, undefined, job);
|
|
102240
|
+
}
|
|
102241
|
+
if (result.failed || result.status !== 0 || result.output.length > 8192) {
|
|
102242
|
+
throw new verification_runtime_policy_1.VerificationPrerequisiteError('unavailable', requirement, undefined, job);
|
|
102243
|
+
}
|
|
102244
|
+
const observed = (0, verification_runtime_policy_1.verificationRuntimeVersion)(requirement.runtime, result.output);
|
|
102245
|
+
if (!observed)
|
|
102246
|
+
throw new verification_runtime_policy_1.VerificationPrerequisiteError('unreadable-version', requirement, undefined, job);
|
|
102247
|
+
if (!(0, verification_runtime_policy_1.verificationRuntimeMatches)(requirement.version, observed)) {
|
|
102248
|
+
throw new verification_runtime_policy_1.VerificationPrerequisiteError('version-mismatch', requirement, observed, job);
|
|
102249
|
+
}
|
|
102250
|
+
}
|
|
102251
|
+
|
|
102252
|
+
|
|
101952
102253
|
/***/ }),
|
|
101953
102254
|
|
|
101954
102255
|
/***/ 92540:
|