@vypdev/copilot 3.3.0 → 3.5.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/README.md +33 -5
- package/action.yml +85 -109
- package/build/api/index.js +4737 -1506
- package/build/api/src/api.d.ts +60 -14
- package/build/api/src/application/errors/application_error.d.ts +10 -0
- package/build/api/src/application/ports/bugbot_context_ports.d.ts +20 -7
- package/build/api/src/application/ports/bugbot_finding_publication_ports.d.ts +4 -4
- package/build/api/src/application/ports/bugbot_finding_resolution_ports.d.ts +4 -4
- package/build/api/src/application/ports/bugbot_issue_read_ports.d.ts +3 -0
- package/build/api/src/application/ports/bugbot_issue_write_ports.d.ts +12 -0
- package/build/api/src/application/ports/bugbot_pull_request_read_ports.d.ts +3 -17
- package/build/api/src/application/ports/bugbot_pull_request_resolution_ports.d.ts +7 -1
- package/build/api/src/application/ports/bugbot_pull_request_write_ports.d.ts +6 -1
- package/build/api/src/application/ports/bugbot_reconciliation_ports.d.ts +18 -0
- package/build/api/src/application/ports/bugbot_review_navigation_ports.d.ts +13 -0
- package/build/api/src/application/ports/bugbot_rule_ports.d.ts +1 -1
- package/build/api/src/application/ports/bugbot_scm_ports.d.ts +14 -0
- package/build/api/src/application/ports/bugbot_telemetry_ports.d.ts +27 -2
- package/build/api/src/application/ports/message_catalog_ports.d.ts +17 -0
- package/build/api/src/application/ports/pull_request_review_comment_ports.d.ts +31 -2
- package/build/api/src/data/model/application_error.d.ts +82 -0
- package/build/api/src/data/model/result.d.ts +3 -4
- package/build/api/src/domain/agent.d.ts +6 -5
- package/build/api/src/domain/branch_sync_validation.d.ts +4 -0
- package/build/api/src/domain/bugbot/context.d.ts +68 -0
- package/build/api/src/domain/bugbot/finding.d.ts +61 -0
- package/build/api/src/domain/bugbot/review_projection.d.ts +33 -0
- package/build/api/src/domain/bugbot/review_state.d.ts +29 -0
- package/build/api/src/domain/message_catalog.d.ts +35 -0
- package/build/api/src/tooling/bugbot_analytics.d.ts +2 -1
- package/build/cli/index.js +93317 -71617
- package/build/github_action/index.js +79616 -63218
- package/build/web/assets/index-2NVaAtP1.js +3 -0
- package/build/web/assets/index-FN-aja4Y.css +1 -0
- package/build/web/index.html +14 -0
- package/package.json +35 -22
- package/scripts/install-git-hooks.cjs +38 -14
- package/setup/ISSUE_TEMPLATE/hotfix.yml +1 -1
- package/setup/ISSUE_TEMPLATE/release.yml +1 -1
- package/setup/pull_request_template.md +9 -135
- package/setup/source-workflows/copilot_pull_request_approval.yml +55 -0
- package/setup/workflows/agent-cli-provisioning.yml +37 -13
- package/setup/workflows/copilot_close_inactive_issues.yml +4 -4
- package/setup/workflows/copilot_commit.yml +16 -16
- package/setup/workflows/copilot_credential_health.yml +0 -20
- package/setup/workflows/copilot_deployment_orchestration.yml +91 -0
- package/setup/workflows/copilot_issue.yml +15 -19
- package/setup/workflows/copilot_issue_comment.yml +17 -19
- package/setup/workflows/copilot_pull_request.yml +21 -22
- package/setup/workflows/copilot_pull_request_approval.yml +51 -0
- package/setup/workflows/copilot_pull_request_comment.yml +17 -19
- package/setup/workflows/copilot_pull_request_merge_queue.yml +20 -0
- package/setup/workflows/copilot_pull_request_review_state.yml +109 -0
- package/setup/workflows/hotfix_workflow.yml +157 -168
- package/setup/workflows/release_workflow.yml +157 -168
- package/build/api/src/application/usecases/steps/commit/bugbot/types.d.ts +0 -112
- package/build/api/src/data/model/agent.d.ts +0 -2
- package/build/api/src/data/model/ai.d.ts +0 -28
- package/build/api/src/data/model/branch_configuration.d.ts +0 -6
- package/build/api/src/data/model/branches.d.ts +0 -12
- package/build/api/src/data/model/commit.d.ts +0 -8
- package/build/api/src/data/model/config.d.ts +0 -30
- package/build/api/src/data/model/emoji.d.ts +0 -5
- package/build/api/src/data/model/execution.d.ts +0 -75
- package/build/api/src/data/model/execution_components.d.ts +0 -43
- package/build/api/src/data/model/execution_inputs.d.ts +0 -94
- package/build/api/src/data/model/hotfix.d.ts +0 -7
- package/build/api/src/data/model/images.d.ts +0 -27
- package/build/api/src/data/model/issue.d.ts +0 -27
- package/build/api/src/data/model/issue_types.d.ts +0 -30
- package/build/api/src/data/model/labels.d.ts +0 -60
- package/build/api/src/data/model/locale.d.ts +0 -6
- package/build/api/src/data/model/project_detail.d.ts +0 -15
- package/build/api/src/data/model/projects.d.ts +0 -14
- package/build/api/src/data/model/pull_request.d.ts +0 -32
- package/build/api/src/data/model/recommendation_state.d.ts +0 -6
- package/build/api/src/data/model/release.d.ts +0 -6
- package/build/api/src/data/model/single_action.d.ts +0 -43
- package/build/api/src/data/model/size_threshold.d.ts +0 -6
- package/build/api/src/data/model/size_thresholds.d.ts +0 -10
- package/build/api/src/data/model/tokens.d.ts +0 -4
- package/build/api/src/data/model/welcome.d.ts +0 -5
- package/build/api/src/data/model/workflows.d.ts +0 -5
- package/build/api/src/domain/bugbot/review_command.d.ts +0 -16
- package/build/api/src/domain/copilot_lifecycle.d.ts +0 -42
- package/build/api/src/domain/pull_request_description.d.ts +0 -13
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export type BugbotContextCoverageStatus = "complete" | "partial";
|
|
2
|
+
export type BugbotContextSource = "selection" | "previous-findings" | "human-conversation" | "issue-comments" | "pull-request-comments" | "review-threads" | "diff" | "rules";
|
|
3
|
+
export interface BugbotSourceCoverage {
|
|
4
|
+
readonly source: BugbotContextSource;
|
|
5
|
+
readonly status: BugbotContextCoverageStatus;
|
|
6
|
+
readonly pagesFetched: number;
|
|
7
|
+
readonly itemsFetched: number;
|
|
8
|
+
readonly itemsRetained: number;
|
|
9
|
+
readonly omittedItems: number;
|
|
10
|
+
readonly truncatedItems: number;
|
|
11
|
+
readonly limitReached: boolean;
|
|
12
|
+
/** True when a provider page cap hides an unknown number of older records. */
|
|
13
|
+
readonly providerLimitReached?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface BugbotContextCoverage {
|
|
16
|
+
readonly status: BugbotContextCoverageStatus;
|
|
17
|
+
readonly sources: readonly BugbotSourceCoverage[];
|
|
18
|
+
}
|
|
19
|
+
export interface BugbotReviewTarget {
|
|
20
|
+
readonly repository: {
|
|
21
|
+
readonly owner: string;
|
|
22
|
+
readonly name: string;
|
|
23
|
+
readonly id?: number;
|
|
24
|
+
};
|
|
25
|
+
readonly triggerKind: string;
|
|
26
|
+
readonly issueNumber?: number;
|
|
27
|
+
readonly headOwner: string;
|
|
28
|
+
readonly headRef: string;
|
|
29
|
+
readonly expectedHeadSha?: string;
|
|
30
|
+
readonly pullRequestSelection: {
|
|
31
|
+
readonly kind: "event";
|
|
32
|
+
readonly number?: number;
|
|
33
|
+
} | {
|
|
34
|
+
readonly kind: "exact-head";
|
|
35
|
+
readonly required: boolean;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export interface BugbotPullRequestIdentity {
|
|
39
|
+
readonly number: number;
|
|
40
|
+
readonly state: "open" | "closed";
|
|
41
|
+
readonly draft: boolean;
|
|
42
|
+
readonly baseRepository: {
|
|
43
|
+
readonly owner: string;
|
|
44
|
+
readonly name: string;
|
|
45
|
+
readonly id?: number;
|
|
46
|
+
};
|
|
47
|
+
readonly headRepositoryOwner: string;
|
|
48
|
+
/** Optional for read-only review; repository writes require the provider-owned name. */
|
|
49
|
+
readonly headRepositoryName?: string;
|
|
50
|
+
readonly headRef: string;
|
|
51
|
+
readonly headSha: string;
|
|
52
|
+
}
|
|
53
|
+
export type BugbotCanonicalPullRequestSelection = {
|
|
54
|
+
readonly kind: "canonical";
|
|
55
|
+
readonly pullRequest: BugbotPullRequestIdentity;
|
|
56
|
+
readonly reason: "event" | "exact-head";
|
|
57
|
+
} | {
|
|
58
|
+
readonly kind: "none";
|
|
59
|
+
} | {
|
|
60
|
+
readonly kind: "ambiguous";
|
|
61
|
+
readonly candidateCount: 2;
|
|
62
|
+
} | {
|
|
63
|
+
readonly kind: "stale";
|
|
64
|
+
readonly reason: string;
|
|
65
|
+
};
|
|
66
|
+
export declare function selectCanonicalBugbotPullRequest(target: BugbotReviewTarget, candidates: readonly BugbotPullRequestIdentity[], source: "event" | "exact-head"): BugbotCanonicalPullRequestSelection;
|
|
67
|
+
export declare function summarizeBugbotCoverage(sources: readonly BugbotSourceCoverage[]): BugbotContextCoverage;
|
|
68
|
+
export declare function completeBugbotSourceCoverage(source: BugbotContextSource, items: number, pagesFetched?: number): BugbotSourceCoverage;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider-neutral Bugbot finding and durable identity contracts.
|
|
3
|
+
*
|
|
4
|
+
* These types are shared by analysis, reconciliation, and publication. Keeping
|
|
5
|
+
* them in the domain prevents policies from depending on a particular use-case
|
|
6
|
+
* folder and gives every adapter one stable semantic vocabulary.
|
|
7
|
+
*/
|
|
8
|
+
export interface BugbotFinding {
|
|
9
|
+
id: string;
|
|
10
|
+
title: string;
|
|
11
|
+
description: string;
|
|
12
|
+
/** Computed locally; never accepted from the agent as an authority. */
|
|
13
|
+
fingerprint?: string;
|
|
14
|
+
/** Location-independent reconciliation identity computed locally. */
|
|
15
|
+
semanticFingerprint?: string;
|
|
16
|
+
file?: string;
|
|
17
|
+
line?: number;
|
|
18
|
+
endLine?: number;
|
|
19
|
+
severity?: string;
|
|
20
|
+
confidence?: number;
|
|
21
|
+
category?: string;
|
|
22
|
+
evidence?: string;
|
|
23
|
+
suggestion?: string;
|
|
24
|
+
/** Optional enclosing symbol used only to improve local identity. */
|
|
25
|
+
symbol?: string;
|
|
26
|
+
/** Short code anchor used only to improve local identity. */
|
|
27
|
+
codeSnippet?: string;
|
|
28
|
+
/** Exact replacement text for a suggested change, when safe and local. */
|
|
29
|
+
suggestedCode?: string;
|
|
30
|
+
}
|
|
31
|
+
export type BugbotFindingResolution = 'fixed' | 'obsolete' | 'dismissed';
|
|
32
|
+
export interface ExistingIssueFindingInfo {
|
|
33
|
+
commentId: number;
|
|
34
|
+
resolved: boolean;
|
|
35
|
+
fingerprint?: string;
|
|
36
|
+
semanticFingerprint?: string;
|
|
37
|
+
resolution?: BugbotFindingResolution;
|
|
38
|
+
}
|
|
39
|
+
export interface ExistingPullRequestFindingInfo {
|
|
40
|
+
commentIdentity: string;
|
|
41
|
+
pullRequestNumber: number;
|
|
42
|
+
resolved: boolean;
|
|
43
|
+
/** Fresh provider thread state when it was available. */
|
|
44
|
+
threadResolved?: boolean;
|
|
45
|
+
threadResolvedByLogin?: string;
|
|
46
|
+
parentReviewIdentity?: string;
|
|
47
|
+
url?: string;
|
|
48
|
+
/** Explicitly non-clean when durable marker and native facts disagree. */
|
|
49
|
+
verificationRequired?: boolean;
|
|
50
|
+
fingerprint?: string;
|
|
51
|
+
semanticFingerprint?: string;
|
|
52
|
+
resolution?: BugbotFindingResolution;
|
|
53
|
+
}
|
|
54
|
+
/** Tracks each durable destination independently so partial failures remain retryable. */
|
|
55
|
+
export interface ExistingFindingInfo {
|
|
56
|
+
issue?: ExistingIssueFindingInfo;
|
|
57
|
+
pullRequest?: ExistingPullRequestFindingInfo;
|
|
58
|
+
}
|
|
59
|
+
export type ExistingByFindingId = Record<string, ExistingFindingInfo>;
|
|
60
|
+
export declare function isExistingFindingFullyResolved(finding: ExistingFindingInfo): boolean;
|
|
61
|
+
export declare function findExistingFindingInfo(existingByFindingId: ExistingByFindingId, finding: Pick<BugbotFinding, 'id' | 'fingerprint' | 'semanticFingerprint'>): ExistingFindingInfo | undefined;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type BugbotFindingState, type BugbotFindingStateCounts } from './review_state';
|
|
2
|
+
import type { BugbotContextCoverage } from './context';
|
|
3
|
+
export type BugbotProjectionOutcome = 'complete' | 'partial' | 'failed' | 'superseded' | 'dry-run';
|
|
4
|
+
export interface BugbotProjectedFinding {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly state: BugbotFindingState;
|
|
7
|
+
readonly title?: string;
|
|
8
|
+
readonly url?: string;
|
|
9
|
+
readonly parentReviewIdentity?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface BugbotReviewProjection {
|
|
12
|
+
readonly schemaVersion: 1;
|
|
13
|
+
readonly pullRequestNumber: number;
|
|
14
|
+
readonly analyzedHeadSha: string;
|
|
15
|
+
readonly verifiedHeadSha: string;
|
|
16
|
+
readonly findings: readonly BugbotProjectedFinding[];
|
|
17
|
+
readonly counts: Readonly<BugbotFindingStateCounts>;
|
|
18
|
+
readonly actionableCount: number;
|
|
19
|
+
readonly outcome: BugbotProjectionOutcome;
|
|
20
|
+
readonly coverage: BugbotContextCoverage;
|
|
21
|
+
readonly errors: readonly string[];
|
|
22
|
+
readonly digest: string;
|
|
23
|
+
}
|
|
24
|
+
export declare function buildBugbotReviewProjection(input: {
|
|
25
|
+
pullRequestNumber: number;
|
|
26
|
+
analyzedHeadSha: string;
|
|
27
|
+
verifiedHeadSha?: string;
|
|
28
|
+
findings: readonly BugbotProjectedFinding[];
|
|
29
|
+
errors?: readonly string[];
|
|
30
|
+
coverage: BugbotContextCoverage;
|
|
31
|
+
superseded?: boolean;
|
|
32
|
+
dryRun?: boolean;
|
|
33
|
+
}): BugbotReviewProjection;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const BUGBOT_FINDING_STATES: readonly ["open", "reopened", "fixed", "obsolete", "dismissed", "verification-required", "unknown"];
|
|
2
|
+
export type BugbotFindingState = typeof BUGBOT_FINDING_STATES[number];
|
|
3
|
+
export type BugbotResolvedFindingState = 'fixed' | 'obsolete' | 'dismissed';
|
|
4
|
+
export interface BugbotThreadFact {
|
|
5
|
+
readonly resolved: boolean;
|
|
6
|
+
readonly resolvedByLogin?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface BugbotFindingEvidence {
|
|
9
|
+
readonly markerResolved: boolean;
|
|
10
|
+
readonly markerResolution?: BugbotResolvedFindingState;
|
|
11
|
+
readonly thread?: BugbotThreadFact;
|
|
12
|
+
readonly botLogin?: string;
|
|
13
|
+
readonly wasResolvedBeforeCurrentAnalysis?: boolean;
|
|
14
|
+
readonly currentAnalysisReportsFinding?: boolean;
|
|
15
|
+
readonly trusted?: boolean;
|
|
16
|
+
readonly malformed?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Resolves one provider-neutral Bugbot lifecycle state from durable marker and
|
|
20
|
+
* native thread facts. The model is intentionally fail-closed: disagreement
|
|
21
|
+
* never projects a clean PR unless a human dismissal can be attributed.
|
|
22
|
+
*/
|
|
23
|
+
export declare function classifyBugbotFindingState(evidence: BugbotFindingEvidence): BugbotFindingState;
|
|
24
|
+
export declare function isBugbotActionableState(state: BugbotFindingState): boolean;
|
|
25
|
+
export declare function isBugbotCleanState(state: BugbotFindingState): boolean;
|
|
26
|
+
export declare function isHumanResolver(resolverLogin: string | undefined, botLogin: string | undefined): boolean;
|
|
27
|
+
export type BugbotFindingStateCounts = Record<BugbotFindingState, number>;
|
|
28
|
+
export declare function countBugbotFindingStates(states: Iterable<BugbotFindingState>): BugbotFindingStateCounts;
|
|
29
|
+
export declare function countActionableBugbotFindings(counts: Readonly<BugbotFindingStateCounts>): number;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare const MESSAGE_CATALOG_VERSION = "3";
|
|
2
|
+
export type CatalogResolutionSource = 'exact' | 'base' | 'dynamic' | 'fallback';
|
|
3
|
+
export type CatalogFallbackReason = 'dynamic-provider-unavailable' | 'dynamic-response-invalid' | 'dynamic-request-failed';
|
|
4
|
+
export declare const CATALOG_PLURAL_CATEGORIES: readonly ["zero", "one", "two", "few", "many", "other"];
|
|
5
|
+
export type CatalogPluralCategory = typeof CATALOG_PLURAL_CATEGORIES[number];
|
|
6
|
+
export type CatalogPluralMessage = Readonly<Partial<Record<CatalogPluralCategory, string>> & {
|
|
7
|
+
readonly other: string;
|
|
8
|
+
}>;
|
|
9
|
+
export type CatalogMessage = string | CatalogPluralMessage;
|
|
10
|
+
export interface MessageCatalogDefinition<Id extends string = string> {
|
|
11
|
+
readonly version: string;
|
|
12
|
+
readonly locale: string;
|
|
13
|
+
readonly compatibleBaseLanguage: string;
|
|
14
|
+
readonly messages: Readonly<Record<Id, CatalogMessage>>;
|
|
15
|
+
}
|
|
16
|
+
export interface ResolvedMessageCatalog<Id extends string = string> {
|
|
17
|
+
readonly requestedLocale: string;
|
|
18
|
+
readonly resolvedLocale: string;
|
|
19
|
+
readonly source: CatalogResolutionSource;
|
|
20
|
+
readonly messages: Readonly<Record<Id, CatalogMessage>>;
|
|
21
|
+
readonly fallbackReason?: CatalogFallbackReason;
|
|
22
|
+
}
|
|
23
|
+
export interface CatalogResolutionObservation {
|
|
24
|
+
readonly requestedLocale: string;
|
|
25
|
+
readonly resolvedLocale: string;
|
|
26
|
+
readonly source: CatalogResolutionSource;
|
|
27
|
+
readonly descriptorCount: number;
|
|
28
|
+
readonly fallbackReason?: CatalogFallbackReason;
|
|
29
|
+
}
|
|
30
|
+
export declare function selectBundledMessageCatalog<Id extends string>(requestedValue: string, catalogs: readonly MessageCatalogDefinition<Id>[]): ResolvedMessageCatalog<Id> | undefined;
|
|
31
|
+
export declare function validateCatalogDefinition<Id extends string>(catalog: MessageCatalogDefinition<Id>, requiredIds: readonly Id[]): readonly string[];
|
|
32
|
+
export declare function validateDynamicCatalogMessages<Id extends string>(value: unknown, sourceMessages: Readonly<Record<Id, CatalogMessage>>, requiredIds: readonly Id[], targetLocale?: string): value is Readonly<Record<Id, CatalogMessage>>;
|
|
33
|
+
export declare function renderCatalogMessage(message: CatalogMessage, variables?: Readonly<Record<string, string | number>>, locale?: string, count?: number): string;
|
|
34
|
+
export declare function catalogPlaceholders(message: CatalogMessage): readonly string[];
|
|
35
|
+
export declare function catalogPluralCategories(locale: string): readonly CatalogPluralCategory[];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BugbotReviewOutcome, BugbotReviewTelemetrySnapshot } from '../application/ports/bugbot_telemetry_ports';
|
|
2
|
+
import type { BugbotFindingState } from '../domain/bugbot/review_state';
|
|
2
3
|
export interface BugbotAnalyticsReport {
|
|
3
4
|
readonly reviews: number;
|
|
4
5
|
readonly outcomes: Readonly<Record<BugbotReviewOutcome, number>>;
|
|
@@ -14,7 +15,7 @@ export interface BugbotAnalyticsReport {
|
|
|
14
15
|
readonly averageCandidateFindings: number;
|
|
15
16
|
readonly averagePublishedFindings: number;
|
|
16
17
|
readonly resolutionEvents: number;
|
|
17
|
-
readonly findingStateObservations: Readonly<Record<
|
|
18
|
+
readonly findingStateObservations: Readonly<Record<BugbotFindingState, number>>;
|
|
18
19
|
readonly estimatedInputTokens: number;
|
|
19
20
|
readonly estimatedOutputTokens: number;
|
|
20
21
|
readonly stageP95Ms: Readonly<Record<string, number>>;
|