@vypdev/copilot 3.9.2 → 3.9.3
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/build/api/index.js +75 -0
- package/build/api/src/data/model/application_error.d.ts +5 -1
- package/build/api/src/domain/approval_evidence_diagnostic.d.ts +30 -0
- package/build/api/src/domain/closed_issue_reconciliation.d.ts +11 -0
- package/build/cli/index.js +499 -161
- package/build/github_action/index.js +605 -171
- package/package.json +1 -1
package/build/api/index.js
CHANGED
|
@@ -5152,6 +5152,8 @@ var _ApplicationError_cause;
|
|
|
5152
5152
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5153
5153
|
exports.ApplicationError = exports.APPLICATION_ERROR_METADATA = exports.APPLICATION_ERROR_RECOVERY_IDS = void 0;
|
|
5154
5154
|
exports.isApplicationErrorCorrelationId = isApplicationErrorCorrelationId;
|
|
5155
|
+
const closed_issue_reconciliation_1 = __nccwpck_require__(1565);
|
|
5156
|
+
const approval_evidence_diagnostic_1 = __nccwpck_require__(8205);
|
|
5155
5157
|
const branch_sync_validation_1 = __nccwpck_require__(981);
|
|
5156
5158
|
exports.APPLICATION_ERROR_RECOVERY_IDS = Object.freeze([
|
|
5157
5159
|
'pull-request-link-restored',
|
|
@@ -5167,6 +5169,8 @@ exports.APPLICATION_ERROR_RECOVERY_IDS = Object.freeze([
|
|
|
5167
5169
|
'sdd-draft-size-exceeded',
|
|
5168
5170
|
'sdd-draft-format-invalid',
|
|
5169
5171
|
'workspace-changes-rejected',
|
|
5172
|
+
'closed-issue-reconciliation-failed',
|
|
5173
|
+
'approval-evidence-read-failed',
|
|
5170
5174
|
]);
|
|
5171
5175
|
const PRESERVED_STATE = 'Existing persisted state and completed external effects were preserved.';
|
|
5172
5176
|
const UNCHANGED_STATE = 'No new state or external effect was created.';
|
|
@@ -5358,6 +5362,8 @@ class ApplicationError extends Error {
|
|
|
5358
5362
|
exports.ApplicationError = ApplicationError;
|
|
5359
5363
|
_ApplicationError_cause = new WeakMap();
|
|
5360
5364
|
const RECOVERY_VARIABLE_KEYS = Object.freeze({
|
|
5365
|
+
'closed-issue-reconciliation-failed': Object.freeze(['resultId', 'phase', 'state', 'reason', 'changed', 'remaining']),
|
|
5366
|
+
'approval-evidence-read-failed': Object.freeze(['operation', 'reason', 'permission']),
|
|
5361
5367
|
'pull-request-link-restored': Object.freeze([]),
|
|
5362
5368
|
'pull-request-link-base-retained': Object.freeze([]),
|
|
5363
5369
|
'pull-request-link-reference-retained': Object.freeze([]),
|
|
@@ -5410,6 +5416,20 @@ function normalizeApplicationErrorRecovery(recovery) {
|
|
|
5410
5416
|
&& !branch_sync_validation_1.BRANCH_SYNC_VALIDATION_CODES.some(code => code === variables.validationCode)) {
|
|
5411
5417
|
throw new TypeError('Application error recovery synchronization validation code is invalid.');
|
|
5412
5418
|
}
|
|
5419
|
+
if (recovery.id === 'closed-issue-reconciliation-failed'
|
|
5420
|
+
&& (!closed_issue_reconciliation_1.CLOSED_ISSUE_RESULTS.some(value => value === variables.resultId)
|
|
5421
|
+
|| !closed_issue_reconciliation_1.CLOSED_ISSUE_PHASES.some(value => value === variables.phase)
|
|
5422
|
+
|| !['open', 'closed', 'unavailable'].includes(variables.state)
|
|
5423
|
+
|| !closed_issue_reconciliation_1.CLOSED_ISSUE_REASONS.some(value => value === variables.reason)
|
|
5424
|
+
|| ![variables.changed, variables.remaining].every(value => typeof value === 'number' && Number.isSafeInteger(value) && value >= 0 && value <= 3000))) {
|
|
5425
|
+
throw new TypeError('Closed issue reconciliation diagnostic is invalid.');
|
|
5426
|
+
}
|
|
5427
|
+
if (recovery.id === 'approval-evidence-read-failed'
|
|
5428
|
+
&& (!Object.prototype.hasOwnProperty.call(approval_evidence_diagnostic_1.APPROVAL_EVIDENCE_PERMISSIONS, variables.operation)
|
|
5429
|
+
|| !approval_evidence_diagnostic_1.APPROVAL_EVIDENCE_REASONS.some(reason => reason === variables.reason)
|
|
5430
|
+
|| approval_evidence_diagnostic_1.APPROVAL_EVIDENCE_PERMISSIONS[variables.operation] !== variables.permission)) {
|
|
5431
|
+
throw new TypeError('Approval evidence diagnostic is invalid.');
|
|
5432
|
+
}
|
|
5413
5433
|
return Object.freeze({
|
|
5414
5434
|
id: recovery.id,
|
|
5415
5435
|
variables: Object.freeze({ ...variables }),
|
|
@@ -5468,6 +5488,43 @@ function isAgentConfigurationReady(configuration) {
|
|
|
5468
5488
|
}
|
|
5469
5489
|
|
|
5470
5490
|
|
|
5491
|
+
/***/ }),
|
|
5492
|
+
|
|
5493
|
+
/***/ 8205:
|
|
5494
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
5495
|
+
|
|
5496
|
+
|
|
5497
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5498
|
+
exports.APPROVAL_EVIDENCE_REASONS = exports.APPROVAL_EVIDENCE_PERMISSIONS = void 0;
|
|
5499
|
+
/** Closed vocabulary: no provider text, URLs, headers, policy values or credentials. */
|
|
5500
|
+
exports.APPROVAL_EVIDENCE_PERMISSIONS = Object.freeze({
|
|
5501
|
+
'evidence': 'repository-read',
|
|
5502
|
+
'pull-request': 'pull-requests-read',
|
|
5503
|
+
'base-ref': 'contents-read',
|
|
5504
|
+
'merge-commit': 'contents-read',
|
|
5505
|
+
'policy': 'actions-variables-read',
|
|
5506
|
+
'files': 'pull-requests-read',
|
|
5507
|
+
'reviews': 'pull-requests-read',
|
|
5508
|
+
'comments': 'issues-read',
|
|
5509
|
+
'head-checks': 'checks-read',
|
|
5510
|
+
'merge-checks': 'checks-read',
|
|
5511
|
+
'head-runs': 'actions-read',
|
|
5512
|
+
'merge-runs': 'actions-read',
|
|
5513
|
+
'jobs': 'actions-read',
|
|
5514
|
+
'rules': 'metadata-read',
|
|
5515
|
+
'classic-protection': 'administration-read',
|
|
5516
|
+
'authenticated-user': 'authenticated-user-read',
|
|
5517
|
+
'coverage-artifacts': 'actions-read',
|
|
5518
|
+
'coverage-download': 'actions-read',
|
|
5519
|
+
'coverage-parse': 'actions-read',
|
|
5520
|
+
});
|
|
5521
|
+
exports.APPROVAL_EVIDENCE_REASONS = Object.freeze([
|
|
5522
|
+
'http-400', 'http-401', 'http-403', 'http-404', 'http-409', 'http-422', 'http-429',
|
|
5523
|
+
'http-500', 'http-502', 'http-503', 'http-504', 'transport-unavailable',
|
|
5524
|
+
'invalid-response', 'invalid-page', 'page-limit', 'artifact-unavailable', 'artifact-invalid', 'artifact-mismatch',
|
|
5525
|
+
]);
|
|
5526
|
+
|
|
5527
|
+
|
|
5471
5528
|
/***/ }),
|
|
5472
5529
|
|
|
5473
5530
|
/***/ 981:
|
|
@@ -5913,6 +5970,24 @@ function countActionableBugbotFindings(counts) {
|
|
|
5913
5970
|
}
|
|
5914
5971
|
|
|
5915
5972
|
|
|
5973
|
+
/***/ }),
|
|
5974
|
+
|
|
5975
|
+
/***/ 1565:
|
|
5976
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
5977
|
+
|
|
5978
|
+
|
|
5979
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5980
|
+
exports.CLOSED_ISSUE_REASONS = exports.CLOSED_ISSUE_PHASES = exports.CLOSED_ISSUE_RESULTS = void 0;
|
|
5981
|
+
exports.CLOSED_ISSUE_RESULTS = Object.freeze([
|
|
5982
|
+
'ReconcileClosedIssueMetadataUseCase', 'CloseIssueAfterMergingUseCase', 'RetireBranchSyncUseCase', 'RetireProgressUseCase',
|
|
5983
|
+
]);
|
|
5984
|
+
exports.CLOSED_ISSUE_PHASES = Object.freeze([
|
|
5985
|
+
'identity', 'read', 'native-fence', 'label-remove', 'label-add', 'metadata-verification',
|
|
5986
|
+
'card-inventory', 'card-freshness', 'card-update', 'card-verification',
|
|
5987
|
+
]);
|
|
5988
|
+
exports.CLOSED_ISSUE_REASONS = Object.freeze(['completed', 'not_planned', 'duplicate', 'reopened', 'unknown', 'unavailable']);
|
|
5989
|
+
|
|
5990
|
+
|
|
5916
5991
|
/***/ }),
|
|
5917
5992
|
|
|
5918
5993
|
/***/ 8623:
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import { type ClosedIssueReconciliationFacts } from '../../domain/closed_issue_reconciliation';
|
|
2
|
+
import { type ApprovalEvidenceDiagnostic } from '../../domain/approval_evidence_diagnostic';
|
|
1
3
|
import { type BranchSyncValidationCode } from '../../domain/branch_sync_validation';
|
|
2
4
|
export type ApplicationErrorKind = 'configuration' | 'authorization' | 'provider' | 'agent' | 'validation' | 'workflow' | 'unknown';
|
|
3
5
|
export type ApplicationErrorCode = 'configuration.invalid' | 'configuration.unsupported' | 'authorization.denied' | 'authorization.credential-invalid' | 'provider.not-found' | 'provider.conflict' | 'provider.rate-limited' | 'provider.unavailable' | 'provider.contract-invalid' | 'agent.policy-rejected' | 'agent.failed' | 'locale.output-invalid' | 'locale.translation-failed' | 'validation.invalid-input' | 'validation.evidence-too-large' | 'validation.evidence-unavailable' | 'workflow.invalid-event' | 'workflow.stale' | 'workflow.cancelled' | 'workflow.failed' | 'workflow.presentation-pending' | 'timeout' | 'unexpected';
|
|
4
|
-
export declare const APPLICATION_ERROR_RECOVERY_IDS: readonly ["pull-request-link-restored", "pull-request-link-base-retained", "pull-request-link-reference-retained", "pull-request-link-base-and-reference-retained", "managed-branch-enrichment-failed", "inactivity-explanation-failed", "bugbot-review-blocks-pending", "branch-sync-agent-disabled", "branch-sync-fixer-unavailable", "branch-sync-resolution-invalid", "sdd-draft-size-exceeded", "sdd-draft-format-invalid", "workspace-changes-rejected"];
|
|
6
|
+
export declare const APPLICATION_ERROR_RECOVERY_IDS: readonly ["pull-request-link-restored", "pull-request-link-base-retained", "pull-request-link-reference-retained", "pull-request-link-base-and-reference-retained", "managed-branch-enrichment-failed", "inactivity-explanation-failed", "bugbot-review-blocks-pending", "branch-sync-agent-disabled", "branch-sync-fixer-unavailable", "branch-sync-resolution-invalid", "sdd-draft-size-exceeded", "sdd-draft-format-invalid", "workspace-changes-rejected", "closed-issue-reconciliation-failed", "approval-evidence-read-failed"];
|
|
5
7
|
export type ApplicationErrorRecoveryId = typeof APPLICATION_ERROR_RECOVERY_IDS[number];
|
|
6
8
|
interface ApplicationErrorRecoveryVariables {
|
|
9
|
+
readonly 'closed-issue-reconciliation-failed': ClosedIssueReconciliationFacts;
|
|
10
|
+
readonly 'approval-evidence-read-failed': ApprovalEvidenceDiagnostic;
|
|
7
11
|
readonly 'pull-request-link-restored': Readonly<Record<string, never>>;
|
|
8
12
|
readonly 'pull-request-link-base-retained': Readonly<Record<string, never>>;
|
|
9
13
|
readonly 'pull-request-link-reference-retained': Readonly<Record<string, never>>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** Closed vocabulary: no provider text, URLs, headers, policy values or credentials. */
|
|
2
|
+
export declare const APPROVAL_EVIDENCE_PERMISSIONS: Readonly<{
|
|
3
|
+
readonly evidence: "repository-read";
|
|
4
|
+
readonly 'pull-request': "pull-requests-read";
|
|
5
|
+
readonly 'base-ref': "contents-read";
|
|
6
|
+
readonly 'merge-commit': "contents-read";
|
|
7
|
+
readonly policy: "actions-variables-read";
|
|
8
|
+
readonly files: "pull-requests-read";
|
|
9
|
+
readonly reviews: "pull-requests-read";
|
|
10
|
+
readonly comments: "issues-read";
|
|
11
|
+
readonly 'head-checks': "checks-read";
|
|
12
|
+
readonly 'merge-checks': "checks-read";
|
|
13
|
+
readonly 'head-runs': "actions-read";
|
|
14
|
+
readonly 'merge-runs': "actions-read";
|
|
15
|
+
readonly jobs: "actions-read";
|
|
16
|
+
readonly rules: "metadata-read";
|
|
17
|
+
readonly 'classic-protection': "administration-read";
|
|
18
|
+
readonly 'authenticated-user': "authenticated-user-read";
|
|
19
|
+
readonly 'coverage-artifacts': "actions-read";
|
|
20
|
+
readonly 'coverage-download': "actions-read";
|
|
21
|
+
readonly 'coverage-parse': "actions-read";
|
|
22
|
+
}>;
|
|
23
|
+
export type ApprovalEvidenceOperation = keyof typeof APPROVAL_EVIDENCE_PERMISSIONS;
|
|
24
|
+
export declare const APPROVAL_EVIDENCE_REASONS: readonly ["http-400", "http-401", "http-403", "http-404", "http-409", "http-422", "http-429", "http-500", "http-502", "http-503", "http-504", "transport-unavailable", "invalid-response", "invalid-page", "page-limit", "artifact-unavailable", "artifact-invalid", "artifact-mismatch"];
|
|
25
|
+
export type ApprovalEvidenceReason = typeof APPROVAL_EVIDENCE_REASONS[number];
|
|
26
|
+
export type ApprovalEvidenceDiagnostic = {
|
|
27
|
+
readonly operation: ApprovalEvidenceOperation;
|
|
28
|
+
readonly reason: ApprovalEvidenceReason;
|
|
29
|
+
readonly permission: typeof APPROVAL_EVIDENCE_PERMISSIONS[ApprovalEvidenceOperation];
|
|
30
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const CLOSED_ISSUE_RESULTS: readonly ["ReconcileClosedIssueMetadataUseCase", "CloseIssueAfterMergingUseCase", "RetireBranchSyncUseCase", "RetireProgressUseCase"];
|
|
2
|
+
export declare const CLOSED_ISSUE_PHASES: readonly ["identity", "read", "native-fence", "label-remove", "label-add", "metadata-verification", "card-inventory", "card-freshness", "card-update", "card-verification"];
|
|
3
|
+
export declare const CLOSED_ISSUE_REASONS: readonly ["completed", "not_planned", "duplicate", "reopened", "unknown", "unavailable"];
|
|
4
|
+
export type ClosedIssueReconciliationFacts = {
|
|
5
|
+
readonly resultId: typeof CLOSED_ISSUE_RESULTS[number];
|
|
6
|
+
readonly phase: typeof CLOSED_ISSUE_PHASES[number];
|
|
7
|
+
readonly state: 'open' | 'closed' | 'unavailable';
|
|
8
|
+
readonly reason: typeof CLOSED_ISSUE_REASONS[number];
|
|
9
|
+
readonly changed: number;
|
|
10
|
+
readonly remaining: number;
|
|
11
|
+
};
|