@vypdev/copilot 3.9.2 → 3.10.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.
@@ -1,9 +1,26 @@
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", "sdd-draft-case-identity-invalid", "sdd-draft-case-budget-invalid", "sdd-draft-requirement-mapping-invalid", "sdd-draft-repository-path-invalid", "workspace-changes-rejected", "closed-issue-reconciliation-failed", "approval-evidence-read-failed", "stored-configuration-schema-missing", "stored-configuration-schema-unsupported", "stored-configuration-invalid"];
5
7
  export type ApplicationErrorRecoveryId = typeof APPLICATION_ERROR_RECOVERY_IDS[number];
6
8
  interface ApplicationErrorRecoveryVariables {
9
+ readonly 'stored-configuration-schema-missing': Readonly<{
10
+ issueNumber: number;
11
+ expectedVersion: number;
12
+ }>;
13
+ readonly 'stored-configuration-schema-unsupported': Readonly<{
14
+ issueNumber: number;
15
+ expectedVersion: number;
16
+ actualVersion: number;
17
+ }>;
18
+ readonly 'stored-configuration-invalid': Readonly<{
19
+ issueNumber: number;
20
+ expectedVersion: number;
21
+ }>;
22
+ readonly 'closed-issue-reconciliation-failed': ClosedIssueReconciliationFacts;
23
+ readonly 'approval-evidence-read-failed': ApprovalEvidenceDiagnostic;
7
24
  readonly 'pull-request-link-restored': Readonly<Record<string, never>>;
8
25
  readonly 'pull-request-link-base-retained': Readonly<Record<string, never>>;
9
26
  readonly 'pull-request-link-reference-retained': Readonly<Record<string, never>>;
@@ -29,6 +46,10 @@ interface ApplicationErrorRecoveryVariables {
29
46
  }>;
30
47
  readonly 'sdd-draft-size-exceeded': Readonly<Record<string, never>>;
31
48
  readonly 'sdd-draft-format-invalid': Readonly<Record<string, never>>;
49
+ readonly 'sdd-draft-case-identity-invalid': Readonly<Record<string, never>>;
50
+ readonly 'sdd-draft-case-budget-invalid': Readonly<Record<string, never>>;
51
+ readonly 'sdd-draft-requirement-mapping-invalid': Readonly<Record<string, never>>;
52
+ readonly 'sdd-draft-repository-path-invalid': Readonly<Record<string, never>>;
32
53
  readonly 'workspace-changes-rejected': Readonly<Record<string, never>>;
33
54
  }
34
55
  export type ApplicationErrorRecovery = {
@@ -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
+ };
@@ -8,6 +8,8 @@ export interface BugbotSourceCoverage {
8
8
  readonly itemsRetained: number;
9
9
  readonly omittedItems: number;
10
10
  readonly truncatedItems: number;
11
+ /** Exact bounded provider identities of retained conversation items truncated by the prompt. */
12
+ readonly truncatedItemIds?: readonly string[];
11
13
  readonly limitReached: boolean;
12
14
  /** True when a provider page cap hides an unknown number of older records. */
13
15
  readonly providerLimitReached?: boolean;
@@ -1,10 +1,3 @@
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
1
  export interface BugbotFinding {
9
2
  id: string;
10
3
  title: string;
@@ -59,3 +52,14 @@ export interface ExistingFindingInfo {
59
52
  export type ExistingByFindingId = Record<string, ExistingFindingInfo>;
60
53
  export declare function isExistingFindingFullyResolved(finding: ExistingFindingInfo): boolean;
61
54
  export declare function findExistingFindingInfo(existingByFindingId: ExistingByFindingId, finding: Pick<BugbotFinding, 'id' | 'fingerprint' | 'semanticFingerprint'>): ExistingFindingInfo | undefined;
55
+ /** A match carries its durable key so updating a comment cannot re-key it. */
56
+ export declare function findExistingFindingMatch(existingByFindingId: ExistingByFindingId, finding: Pick<BugbotFinding, 'id' | 'fingerprint' | 'semanticFingerprint'>): {
57
+ id: string;
58
+ info: ExistingFindingInfo;
59
+ } | undefined;
60
+ /**
61
+ * Preserve trusted IDs across title/location changes, before limits, publication
62
+ * and final projection. Multiple reports of one uniquely matched durable finding
63
+ * share one record; unmatched or ambiguous reports remain independent evidence.
64
+ */
65
+ export declare function retainExistingFindingIds(findings: readonly BugbotFinding[], existingByFindingId: ExistingByFindingId): BugbotFinding[];
@@ -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
+ };