@buddysh/buddy 0.11.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/CHANGELOG.md +1633 -0
- package/LICENSE.md +21 -0
- package/README.md +1087 -0
- package/bin/cli.ts +3401 -0
- package/dist/bin/cli.d.ts +1 -0
- package/dist/bin/cli.js +188 -0
- package/dist/chunk-0j7z87kh.js +3 -0
- package/dist/chunk-0r8zt3d7.js +2 -0
- package/dist/chunk-16yqbccr.js +3 -0
- package/dist/chunk-1a53wj0h.js +1 -0
- package/dist/chunk-1c1gznm9.js +3 -0
- package/dist/chunk-1h3ey7k5.js +3 -0
- package/dist/chunk-1stt2whn.js +62 -0
- package/dist/chunk-1wjnd24b.js +24 -0
- package/dist/chunk-1xe07hzm.js +2 -0
- package/dist/chunk-2bp7tqca.js +2 -0
- package/dist/chunk-2dbkpfy9.js +2 -0
- package/dist/chunk-3q6czqs4.js +6 -0
- package/dist/chunk-3zdcekfj.js +5 -0
- package/dist/chunk-49ey79p0.js +5 -0
- package/dist/chunk-4c9m61yd.js +5 -0
- package/dist/chunk-4efbxdjr.js +4 -0
- package/dist/chunk-4f7panqj.js +21 -0
- package/dist/chunk-4hd3rre0.js +2 -0
- package/dist/chunk-4xsq18p3.js +9 -0
- package/dist/chunk-52x8mvh4.js +15 -0
- package/dist/chunk-54sc18p8.js +2 -0
- package/dist/chunk-56q4pwb5.js +3 -0
- package/dist/chunk-5c3qf34r.js +2 -0
- package/dist/chunk-5k40mwd4.js +4 -0
- package/dist/chunk-5kt03hx5.js +2 -0
- package/dist/chunk-63ept76v.js +2 -0
- package/dist/chunk-65b3vq52.js +2 -0
- package/dist/chunk-6d9hmjt8.js +3 -0
- package/dist/chunk-6g1y9yqh.js +3 -0
- package/dist/chunk-6k653r8w.js +2 -0
- package/dist/chunk-6md7qf2g.js +4 -0
- package/dist/chunk-6patq6bw.js +2 -0
- package/dist/chunk-6sgh49z1.js +2 -0
- package/dist/chunk-74pxb991.js +7 -0
- package/dist/chunk-7mgec8kb.js +7 -0
- package/dist/chunk-7tfrww3v.js +2 -0
- package/dist/chunk-7xk28xrv.js +2 -0
- package/dist/chunk-82dv4p13.js +2 -0
- package/dist/chunk-8661pvb8.js +3 -0
- package/dist/chunk-887s0w81.js +2 -0
- package/dist/chunk-8rc6042h.js +4 -0
- package/dist/chunk-9750tenz.js +3 -0
- package/dist/chunk-978wtejw.js +44 -0
- package/dist/chunk-9eqpaxfz.js +2 -0
- package/dist/chunk-9h04nskh.js +8 -0
- package/dist/chunk-9p1xkmjy.js +2 -0
- package/dist/chunk-agdesgzv.js +2 -0
- package/dist/chunk-akffynkc.js +3 -0
- package/dist/chunk-ar01x04a.js +2 -0
- package/dist/chunk-ay43f085.js +2 -0
- package/dist/chunk-bk9bqd5j.js +2 -0
- package/dist/chunk-bm8d40j0.js +69 -0
- package/dist/chunk-bxfc4g2x.js +73 -0
- package/dist/chunk-c3fczawt.js +2 -0
- package/dist/chunk-c9r9nd4t.js +1 -0
- package/dist/chunk-ctsz0ynx.js +3 -0
- package/dist/chunk-czremqk7.js +2 -0
- package/dist/chunk-da3wbh04.js +2 -0
- package/dist/chunk-dat582cg.js +2 -0
- package/dist/chunk-dfesffnr.js +3 -0
- package/dist/chunk-djntbp7a.js +105 -0
- package/dist/chunk-eagjp0dh.js +3 -0
- package/dist/chunk-eht72nnj.js +2 -0
- package/dist/chunk-f4nv5x3z.js +2 -0
- package/dist/chunk-fdfk918n.js +2 -0
- package/dist/chunk-fdj0tewy.js +20 -0
- package/dist/chunk-fm8ckj9b.js +2 -0
- package/dist/chunk-fqj7e6xa.js +2 -0
- package/dist/chunk-frm8zz31.js +2 -0
- package/dist/chunk-fvpr07dn.js +16 -0
- package/dist/chunk-g0nv8psv.js +2 -0
- package/dist/chunk-g0w8n555.js +19 -0
- package/dist/chunk-gkmvxjbe.js +2 -0
- package/dist/chunk-gngwjf70.js +7 -0
- package/dist/chunk-h7hs95wn.js +5 -0
- package/dist/chunk-hfvezfxh.js +3 -0
- package/dist/chunk-hw70wbzg.js +3 -0
- package/dist/chunk-j8asz4hb.js +15 -0
- package/dist/chunk-k62w2v03.js +2 -0
- package/dist/chunk-mcrfxphm.js +5 -0
- package/dist/chunk-mh3x7j6h.js +2 -0
- package/dist/chunk-naq32yx3.js +86 -0
- package/dist/chunk-nsmcjkas.js +2 -0
- package/dist/chunk-p1xm1jvz.js +2 -0
- package/dist/chunk-p3wsm8kz.js +2 -0
- package/dist/chunk-p4zwy518.js +4 -0
- package/dist/chunk-p7zgy37f.js +2 -0
- package/dist/chunk-ph1b3vbp.js +315 -0
- package/dist/chunk-pkjm2r0a.js +2 -0
- package/dist/chunk-pkkwb0n0.js +4 -0
- package/dist/chunk-pnpx1kqn.js +6 -0
- package/dist/chunk-q9n79dd3.js +3 -0
- package/dist/chunk-qpz9k66h.js +2 -0
- package/dist/chunk-qvn1rtgp.js +2 -0
- package/dist/chunk-qyf90zz3.js +2 -0
- package/dist/chunk-r06ce5g6.js +2 -0
- package/dist/chunk-r2sbprdb.js +49 -0
- package/dist/chunk-r3zyw8x0.js +3 -0
- package/dist/chunk-rb1fh9vd.js +1 -0
- package/dist/chunk-rqdep14r.js +2 -0
- package/dist/chunk-s1km8cyq.js +2 -0
- package/dist/chunk-s4ms8zag.js +2 -0
- package/dist/chunk-sp818c27.js +9 -0
- package/dist/chunk-tb5y0350.js +3 -0
- package/dist/chunk-thaxgm5p.js +2 -0
- package/dist/chunk-tn8prpny.js +503 -0
- package/dist/chunk-ts35hc5t.js +3 -0
- package/dist/chunk-tzs22es2.js +3 -0
- package/dist/chunk-vagxqhef.js +13 -0
- package/dist/chunk-vh504tcv.js +6 -0
- package/dist/chunk-vkctfqpm.js +3 -0
- package/dist/chunk-vyapg8ca.js +186 -0
- package/dist/chunk-wdwvt7gb.js +43 -0
- package/dist/chunk-wtjhehz9.js +4 -0
- package/dist/chunk-x0ya2r4r.js +3 -0
- package/dist/chunk-x3kragh9.js +12 -0
- package/dist/chunk-x9ctz1qc.js +1 -0
- package/dist/chunk-xakpdqaq.js +3 -0
- package/dist/chunk-xqx460y2.js +3 -0
- package/dist/chunk-xvptf9jy.js +3 -0
- package/dist/chunk-yk23nc4t.js +2 -0
- package/dist/chunk-yncea6ty.js +2 -0
- package/dist/chunk-yq0gxtzv.js +2 -0
- package/dist/chunk-yqhs08ky.js +2 -0
- package/dist/chunk-zb62jhwm.js +31 -0
- package/dist/chunk-zs3jaj0g.js +1023 -0
- package/dist/chunk-zve5d96e.js +2 -0
- package/dist/src/agent/index.d.ts +44 -0
- package/dist/src/agent/modes.d.ts +33 -0
- package/dist/src/agent/runner.d.ts +44 -0
- package/dist/src/agent/stacked.d.ts +83 -0
- package/dist/src/agent/tasks.d.ts +41 -0
- package/dist/src/agent/toolbelt.d.ts +19 -0
- package/dist/src/agent/tools/fs.d.ts +26 -0
- package/dist/src/agent/tools/shell.d.ts +32 -0
- package/dist/src/agent/types.d.ts +56 -0
- package/dist/src/ai/aliases.d.ts +62 -0
- package/dist/src/ai/client.d.ts +42 -0
- package/dist/src/ai/index.d.ts +35 -0
- package/dist/src/ai/learnings.d.ts +78 -0
- package/dist/src/ai/providers/anthropic.d.ts +12 -0
- package/dist/src/ai/providers/google.d.ts +12 -0
- package/dist/src/ai/providers/openai.d.ts +15 -0
- package/dist/src/ai/redact.d.ts +30 -0
- package/dist/src/ai/types.d.ts +75 -0
- package/dist/src/analysis/analyzers/actionlint.d.ts +11 -0
- package/dist/src/analysis/analyzers/external.d.ts +57 -0
- package/dist/src/analysis/analyzers/github-actions.d.ts +9 -0
- package/dist/src/analysis/analyzers/hadolint.d.ts +9 -0
- package/dist/src/analysis/analyzers/linter.d.ts +53 -0
- package/dist/src/analysis/analyzers/markdownlint.d.ts +11 -0
- package/dist/src/analysis/analyzers/secrets.d.ts +23 -0
- package/dist/src/analysis/analyzers/shellcheck.d.ts +8 -0
- package/dist/src/analysis/analyzers/syntax.d.ts +13 -0
- package/dist/src/analysis/engine.d.ts +38 -0
- package/dist/src/analysis/index.d.ts +13 -0
- package/dist/src/analysis/types.d.ts +14 -0
- package/dist/src/buddy.d.ts +17 -0
- package/dist/src/ci/classify.d.ts +49 -0
- package/dist/src/ci/fix.d.ts +42 -0
- package/dist/src/ci/index.d.ts +8 -0
- package/dist/src/commands/dispatcher.d.ts +49 -0
- package/dist/src/commands/handlers.d.ts +23 -0
- package/dist/src/commands/index.d.ts +22 -0
- package/dist/src/commands/parser.d.ts +71 -0
- package/dist/src/config-validation.d.ts +38 -0
- package/dist/src/config.d.ts +22 -0
- package/dist/src/dashboard/dashboard-generator.d.ts +10 -0
- package/dist/src/doctor.d.ts +44 -0
- package/dist/src/ecosystems/go.d.ts +10 -0
- package/dist/src/ecosystems/index.d.ts +60 -0
- package/dist/src/ecosystems/pep440.d.ts +57 -0
- package/dist/src/ecosystems/python.d.ts +12 -0
- package/dist/src/ecosystems/ruby.d.ts +9 -0
- package/dist/src/ecosystems/rust.d.ts +8 -0
- package/dist/src/ecosystems/scan.d.ts +49 -0
- package/dist/src/ecosystems/shared.d.ts +45 -0
- package/dist/src/ecosystems/types.d.ts +58 -0
- package/dist/src/events/bus.d.ts +41 -0
- package/dist/src/events/index.d.ts +11 -0
- package/dist/src/events/sinks.d.ts +33 -0
- package/dist/src/gates/ai-checks.d.ts +77 -0
- package/dist/src/gates/checks.d.ts +84 -0
- package/dist/src/gates/index.d.ts +17 -0
- package/dist/src/gates/post-merge.d.ts +56 -0
- package/dist/src/git/bitbucket-provider.d.ts +50 -0
- package/dist/src/git/github-provider.d.ts +50 -0
- package/dist/src/git/gitlab-provider.d.ts +51 -0
- package/dist/src/git/provider.d.ts +210 -0
- package/dist/src/headless/run.d.ts +78 -0
- package/dist/src/index.d.ts +243 -0
- package/dist/src/index.js +2 -0
- package/dist/src/issues/enrichment.d.ts +76 -0
- package/dist/src/issues/index.d.ts +16 -0
- package/dist/src/issues/quick-links.d.ts +55 -0
- package/dist/src/pr/auto-merge.d.ts +75 -0
- package/dist/src/pr/pr-generator.d.ts +9 -0
- package/dist/src/pr/pr-manifest.d.ts +82 -0
- package/dist/src/pr/templates.d.ts +44 -0
- package/dist/src/registry/docker-tags.d.ts +56 -0
- package/dist/src/registry/eol.d.ts +87 -0
- package/dist/src/registry/oci-client.d.ts +98 -0
- package/dist/src/registry/registry-client.d.ts +39 -0
- package/dist/src/reports/history.d.ts +51 -0
- package/dist/src/reports/index.d.ts +23 -0
- package/dist/src/reports/metrics.d.ts +89 -0
- package/dist/src/reports/render.d.ts +33 -0
- package/dist/src/review/diff.d.ts +50 -0
- package/dist/src/review/engine.d.ts +49 -0
- package/dist/src/review/findings.d.ts +102 -0
- package/dist/src/review/guidelines.d.ts +46 -0
- package/dist/src/review/index.d.ts +48 -0
- package/dist/src/review/local.d.ts +81 -0
- package/dist/src/review/marker.d.ts +34 -0
- package/dist/src/review/poster.d.ts +39 -0
- package/dist/src/review/run.d.ts +24 -0
- package/dist/src/rules/engine.d.ts +108 -0
- package/dist/src/rules/index.d.ts +9 -0
- package/dist/src/rules/renovate.d.ts +25 -0
- package/dist/src/rules/schedule.d.ts +44 -0
- package/dist/src/scanner/catalog-scan.d.ts +39 -0
- package/dist/src/scanner/package-json-extras.d.ts +101 -0
- package/dist/src/scanner/package-scanner.d.ts +17 -0
- package/dist/src/scanner/resolution-drift.d.ts +81 -0
- package/dist/src/scanner/workspace-catalog.d.ts +53 -0
- package/dist/src/scheduler/scheduler.d.ts +27 -0
- package/dist/src/security/engine.d.ts +12 -0
- package/dist/src/security/loader.d.ts +7 -0
- package/dist/src/security/parser.d.ts +15 -0
- package/dist/src/security/rules/bash-injection.d.ts +18 -0
- package/dist/src/security/rules/dangerous-pull-request-target.d.ts +18 -0
- package/dist/src/security/rules/excessive-permissions.d.ts +14 -0
- package/dist/src/security/rules/index.d.ts +16 -0
- package/dist/src/security/rules/missing-timeout.d.ts +9 -0
- package/dist/src/security/rules/self-hosted-exposure.d.ts +13 -0
- package/dist/src/security/rules/unpinned-action.d.ts +10 -0
- package/dist/src/security/rules/walk.d.ts +13 -0
- package/dist/src/security/types.d.ts +64 -0
- package/dist/src/services/deprecated-dependencies-checker.d.ts +16 -0
- package/dist/src/services/release-notes-fetcher.d.ts +70 -0
- package/dist/src/services/security-advisories.d.ts +59 -0
- package/dist/src/setup.d.ts +162 -0
- package/dist/src/setup.js +2 -0
- package/dist/src/templates/github-actions.d.ts +31 -0
- package/dist/src/templates/gitlab-ci.d.ts +46 -0
- package/dist/src/types.d.ts +449 -0
- package/dist/src/upgrades/index.d.ts +18 -0
- package/dist/src/upgrades/migrate.d.ts +45 -0
- package/dist/src/upgrades/plan.d.ts +112 -0
- package/dist/src/upgrades/report.d.ts +22 -0
- package/dist/src/upgrades/span.d.ts +47 -0
- package/dist/src/upgrades/usage.d.ts +30 -0
- package/dist/src/upgrades/wire.d.ts +61 -0
- package/dist/src/utils/concurrency.d.ts +50 -0
- package/dist/src/utils/dependency-file-parser.d.ts +17 -0
- package/dist/src/utils/dockerfile-parser.d.ts +69 -0
- package/dist/src/utils/endpoints.d.ts +58 -0
- package/dist/src/utils/errors.d.ts +35 -0
- package/dist/src/utils/file-changes.d.ts +14 -0
- package/dist/src/utils/github-actions-parser.d.ts +21 -0
- package/dist/src/utils/globs.d.ts +22 -0
- package/dist/src/utils/helpers.d.ts +73 -0
- package/dist/src/utils/http.d.ts +81 -0
- package/dist/src/utils/lock-file.d.ts +28 -0
- package/dist/src/utils/logger.d.ts +45 -0
- package/dist/src/utils/package-paths.d.ts +6 -0
- package/dist/src/utils/pantry-parser.d.ts +30 -0
- package/dist/src/utils/repository.d.ts +41 -0
- package/dist/src/utils/security-format.d.ts +18 -0
- package/dist/src/utils/zig-parser.d.ts +18 -0
- package/dist/src/version/version-resolver.d.ts +9 -0
- package/package.json +115 -0
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
export type { PipelineSchedule } from './templates/gitlab-ci';
|
|
2
|
+
export type {
|
|
3
|
+
CheckRunResult,
|
|
4
|
+
GitProvider,
|
|
5
|
+
GitProviderName,
|
|
6
|
+
ProviderBranch,
|
|
7
|
+
ProviderCapabilities,
|
|
8
|
+
ProviderConfig,
|
|
9
|
+
ReviewSubmission,
|
|
10
|
+
ReviewSubmissionResult,
|
|
11
|
+
} from './git/provider';
|
|
12
|
+
export type { DoctorCheck, DoctorEnvironment, DoctorReport } from './doctor';
|
|
13
|
+
export type { HeadlessOptions, HeadlessResult, SchemaViolation } from './headless/run';
|
|
14
|
+
export type {
|
|
15
|
+
AdapterScanOptions,
|
|
16
|
+
AdapterScanResult,
|
|
17
|
+
EcosystemAdapter,
|
|
18
|
+
EcosystemDependency,
|
|
19
|
+
EcosystemUpdate,
|
|
20
|
+
LatestOptions,
|
|
21
|
+
Pep440Version,
|
|
22
|
+
VersionInfo,
|
|
23
|
+
} from './ecosystems/index';
|
|
24
|
+
export type { ParsedTag } from './registry/docker-tags';
|
|
25
|
+
export type { DockerRegistryConfig, ImageRef, RegistryAuth } from './registry/oci-client';
|
|
26
|
+
export type { EolCycle, EolStatus } from './registry/eol';
|
|
27
|
+
export type { CatalogScanResult } from './scanner/catalog-scan';
|
|
28
|
+
export type { ResolutionPin } from './scanner/package-json-extras';
|
|
29
|
+
export type { CatalogEntry, WorkspaceCatalogs } from './scanner/workspace-catalog';
|
|
30
|
+
export type {
|
|
31
|
+
ActivityMetrics,
|
|
32
|
+
Delta,
|
|
33
|
+
HealthMetrics,
|
|
34
|
+
MetricsInput,
|
|
35
|
+
ReportMetrics,
|
|
36
|
+
ReportPeriod,
|
|
37
|
+
} from './reports/index';
|
|
38
|
+
export type { AdvisoryQuery } from './services/security-advisories';
|
|
39
|
+
export type { ConfigIssue } from './config-validation';
|
|
40
|
+
export type { HttpRequestOptions } from './utils/http';
|
|
41
|
+
export type { LockFileResult, PackageManagerType } from './utils/lock-file';
|
|
42
|
+
export type { LogLevel } from './utils/logger';
|
|
43
|
+
// Main Buddy class
|
|
44
|
+
export { Buddy } from './buddy';
|
|
45
|
+
export { BitbucketProvider } from './git/bitbucket-provider';
|
|
46
|
+
export { GitHubProvider } from './git/github-provider';
|
|
47
|
+
export { GitLabProvider } from './git/gitlab-provider';
|
|
48
|
+
export {
|
|
49
|
+
ciTemplateFor,
|
|
50
|
+
DEFAULT_SCHEDULE,
|
|
51
|
+
generateBitbucketPipeline,
|
|
52
|
+
generateGitLabPipeline,
|
|
53
|
+
} from './templates/gitlab-ci';
|
|
54
|
+
export {
|
|
55
|
+
assertProviderSupported,
|
|
56
|
+
assertSupports,
|
|
57
|
+
createProvider,
|
|
58
|
+
IMPLEMENTED_PROVIDERS,
|
|
59
|
+
NO_CAPABILITIES,
|
|
60
|
+
PROVIDER_NAMES,
|
|
61
|
+
PROVIDER_TOKEN_ENV,
|
|
62
|
+
PROVIDER_TRACKING_ISSUES,
|
|
63
|
+
resolveProviderToken,
|
|
64
|
+
supports,
|
|
65
|
+
UnsupportedProviderError,
|
|
66
|
+
} from './git/provider';
|
|
67
|
+
export { diagnose, renderDoctorReport } from './doctor';
|
|
68
|
+
export { formatGithubOutput, publishOutput, runHeadless, validateAgainstSchema } from './headless/run';
|
|
69
|
+
export {
|
|
70
|
+
adapterFor,
|
|
71
|
+
adapterNamed,
|
|
72
|
+
BUILTIN_ADAPTERS,
|
|
73
|
+
comparePep440,
|
|
74
|
+
compareNumeric,
|
|
75
|
+
detectFiles,
|
|
76
|
+
goAdapter,
|
|
77
|
+
isPep440Prerelease,
|
|
78
|
+
numericUpdateType,
|
|
79
|
+
parsePep440,
|
|
80
|
+
pep440UpdateType,
|
|
81
|
+
pythonAdapter,
|
|
82
|
+
regenerateLockfiles,
|
|
83
|
+
rubyAdapter,
|
|
84
|
+
rustAdapter,
|
|
85
|
+
scanEcosystems,
|
|
86
|
+
splitConstraint,
|
|
87
|
+
stripOperators,
|
|
88
|
+
} from './ecosystems/index';
|
|
89
|
+
export { PullRequestGenerator } from './pr/pr-generator';
|
|
90
|
+
export {
|
|
91
|
+
compareVersions,
|
|
92
|
+
parseTag,
|
|
93
|
+
sameVariant,
|
|
94
|
+
selectLatestTag,
|
|
95
|
+
tagUpdateType,
|
|
96
|
+
} from './registry/docker-tags';
|
|
97
|
+
export {
|
|
98
|
+
apiHostFor,
|
|
99
|
+
formatImageRef,
|
|
100
|
+
OciClient,
|
|
101
|
+
parseAuthChallenge,
|
|
102
|
+
parseImageRef,
|
|
103
|
+
resolveCredentials,
|
|
104
|
+
} from './registry/oci-client';
|
|
105
|
+
export {
|
|
106
|
+
checkEol,
|
|
107
|
+
cycleFor,
|
|
108
|
+
describeEol,
|
|
109
|
+
EOL_PRODUCTS,
|
|
110
|
+
EOL_WARNING_DAYS,
|
|
111
|
+
productFor,
|
|
112
|
+
} from './registry/eol';
|
|
113
|
+
export { RegistryClient } from './registry/registry-client';
|
|
114
|
+
export { applyCatalogUpdates, scanCatalogs } from './scanner/catalog-scan';
|
|
115
|
+
export {
|
|
116
|
+
bumpEngineConstraint,
|
|
117
|
+
collectResolutionPins,
|
|
118
|
+
extractEngines,
|
|
119
|
+
KNOWN_ENGINES,
|
|
120
|
+
pinBlocksUpdate,
|
|
121
|
+
resolveEngineVersion,
|
|
122
|
+
} from './scanner/package-json-extras';
|
|
123
|
+
export {
|
|
124
|
+
applyCatalogUpdate,
|
|
125
|
+
isCatalogReference,
|
|
126
|
+
parseWorkspaceCatalogs,
|
|
127
|
+
resolveCatalogReference,
|
|
128
|
+
} from './scanner/workspace-catalog';
|
|
129
|
+
export {
|
|
130
|
+
appendHistory,
|
|
131
|
+
computeDeltas,
|
|
132
|
+
computeMetrics,
|
|
133
|
+
findPrevious,
|
|
134
|
+
HISTORY_LIMIT,
|
|
135
|
+
HISTORY_PATH,
|
|
136
|
+
loadHistory,
|
|
137
|
+
parseHistory,
|
|
138
|
+
PERIOD_DAYS,
|
|
139
|
+
REPORT_MARKER,
|
|
140
|
+
REPORT_PERIODS,
|
|
141
|
+
renderReport,
|
|
142
|
+
withNarrative,
|
|
143
|
+
} from './reports/index';
|
|
144
|
+
// Core functionality exports
|
|
145
|
+
export { PackageScanner } from './scanner/package-scanner';
|
|
146
|
+
export { Scheduler } from './scheduler/scheduler';
|
|
147
|
+
// Enhanced services
|
|
148
|
+
export { ReleaseNotesFetcher } from './services/release-notes-fetcher';
|
|
149
|
+
export {
|
|
150
|
+
advisoryKey,
|
|
151
|
+
normalizeSeverity,
|
|
152
|
+
SecurityAdvisoryService,
|
|
153
|
+
toOsvEcosystem,
|
|
154
|
+
} from './services/security-advisories';
|
|
155
|
+
export { GitHubActionsTemplate } from './templates/github-actions';
|
|
156
|
+
export * from './types';
|
|
157
|
+
// Utility functions
|
|
158
|
+
export {
|
|
159
|
+
detectPackageManager,
|
|
160
|
+
formatCommitMessage,
|
|
161
|
+
formatPRBody,
|
|
162
|
+
formatPRTitle,
|
|
163
|
+
generateBranchName,
|
|
164
|
+
groupUpdates,
|
|
165
|
+
parsePackageFile,
|
|
166
|
+
sortUpdatesByPriority,
|
|
167
|
+
} from './utils/helpers';
|
|
168
|
+
export {
|
|
169
|
+
clearNpmrcCache,
|
|
170
|
+
getComposerRegistryUrl,
|
|
171
|
+
getGitHubApiUrl,
|
|
172
|
+
getGitHubServerUrl,
|
|
173
|
+
getNpmRegistryUrl,
|
|
174
|
+
} from './utils/endpoints';
|
|
175
|
+
export {
|
|
176
|
+
assertValidConfig,
|
|
177
|
+
formatConfigIssues,
|
|
178
|
+
validateConfig,
|
|
179
|
+
} from './config-validation';
|
|
180
|
+
export { AsyncMemo, chunk, DEFAULT_CONCURRENCY, mapWithConcurrency } from './utils/concurrency';
|
|
181
|
+
export { formatError, GitHubApiError } from './utils/errors';
|
|
182
|
+
export {
|
|
183
|
+
DEFAULT_RETRIES,
|
|
184
|
+
DEFAULT_TIMEOUT_MS,
|
|
185
|
+
fetchJsonOrNull,
|
|
186
|
+
fetchWithTimeout,
|
|
187
|
+
HttpRequestError,
|
|
188
|
+
parseRetryDelay,
|
|
189
|
+
} from './utils/http';
|
|
190
|
+
export { formatSecurityAdvisorySection } from './utils/security-format';
|
|
191
|
+
export {
|
|
192
|
+
detectRequiredPackageManagers,
|
|
193
|
+
getAllLockFilePaths,
|
|
194
|
+
regenerateLockFile,
|
|
195
|
+
} from './utils/lock-file';
|
|
196
|
+
export { getDefaultLogger, Logger, setDefaultLogger } from './utils/logger';
|
|
197
|
+
export { VersionResolver } from './version/version-resolver';
|
|
198
|
+
/**
|
|
199
|
+
* Packages that are behind for a reason no manifest shows: a transitive
|
|
200
|
+
* dependant's range capping what the installer can resolve to.
|
|
201
|
+
*/
|
|
202
|
+
export {
|
|
203
|
+
type DeclaredRange,
|
|
204
|
+
describeDrift,
|
|
205
|
+
type Drift,
|
|
206
|
+
driftFor,
|
|
207
|
+
type DriftInput,
|
|
208
|
+
type DriftKind,
|
|
209
|
+
findDrift,
|
|
210
|
+
ROOT,
|
|
211
|
+
} from './scanner/resolution-drift';
|
|
212
|
+
// AI provider layer
|
|
213
|
+
export * from './ai/index';
|
|
214
|
+
// Agent runtime
|
|
215
|
+
export * from './agent/index';
|
|
216
|
+
// AI code review
|
|
217
|
+
export * from './review/index';
|
|
218
|
+
// Static analysis
|
|
219
|
+
export * from './analysis/index';
|
|
220
|
+
// Comment commands
|
|
221
|
+
export * from './commands/index';
|
|
222
|
+
// CI failure analysis
|
|
223
|
+
export * from './ci/index';
|
|
224
|
+
// Merge gates
|
|
225
|
+
export * from './gates/index';
|
|
226
|
+
// Issue enrichment
|
|
227
|
+
export * from './issues/index';
|
|
228
|
+
// Package rules engine
|
|
229
|
+
export * from './rules/index';
|
|
230
|
+
// AI-assisted major upgrades
|
|
231
|
+
export * from './upgrades/index';
|
|
232
|
+
// Runtime events and notifications
|
|
233
|
+
export * from './events/index';
|
|
234
|
+
// Configuration loading
|
|
235
|
+
export {
|
|
236
|
+
config,
|
|
237
|
+
defaultConfig,
|
|
238
|
+
getConfig,
|
|
239
|
+
resetConfigCache,
|
|
240
|
+
} from './config';
|
|
241
|
+
// Interactive setup, configuration migration and plugin discovery.
|
|
242
|
+
// Also reachable as `@buddysh/buddy/setup`.
|
|
243
|
+
export * from './setup';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{I as no,J as so,K as px,L as ox,M as xx,N as Ex,O as dx,P as fx,Q as Ax,R as Ox,S as Rx,T as Mx,U as Ux}from"../chunk-sp818c27.js";import{V as $o,W as ho}from"../chunk-3zdcekfj.js";import{X as to,Y as wo,Z as Po,_ as ao}from"../chunk-52x8mvh4.js";import{$ as AA,aa as OA,ba as RA,ca as MA,da as UA,ea as mA,fa as kA,ga as yA,ha as GA,ia as NA}from"../chunk-9h04nskh.js";import"../chunk-c9r9nd4t.js";import{ja as $d,ka as hd,la as td,ma as wd,na as Pd,oa as ad,pa as ud,qa as Vd,ra as gd}from"../chunk-zb62jhwm.js";import{sa as vd,ta as rd,ua as id,va as nd,wa as sd}from"../chunk-gngwjf70.js";import{Aa as rf,Ba as nf,Ca as sf,Da as pA,Ea as oA,Fa as xA,Ga as EA,Ha as dA,Ia as fA,xa as Vf,ya as gf,za as vf}from"../chunk-1wjnd24b.js";import{Ja as uo,Ka as Vo,La as go,Ma as vo,Na as ro,Oa as io}from"../chunk-xvptf9jy.js";import"../chunk-rb1fh9vd.js";import{Pa as mx}from"../chunk-x0ya2r4r.js";import"../chunk-1a53wj0h.js";import{Qa as cf,Ra as qf,Sa as Ff,Ta as Jf,Ua as Qf,Va as Xf,Wa as Zf,Xa as $f,Ya as hf,Za as uf}from"../chunk-pnpx1kqn.js";import{$a as wf,_a as tf,ab as Pf,bb as af}from"../chunk-fdj0tewy.js";import"../chunk-x9ctz1qc.js";import{cb as Ef,db as df,eb as ff,fb as Af,gb as Of,hb as Rf,ib as Mf,jb as Uf,kb as mf,lb as ef,mb as _f,nb as Sf,ob as lf,pb as Cf,qb as Df,rb as Bf}from"../chunk-bm8d40j0.js";import{sb as pf,tb as of,ub as xf}from"../chunk-4xsq18p3.js";import{vb as jo,wb as Ho,xb as Wo,yb as Ko}from"../chunk-dfesffnr.js";import{Ab as yf,Bb as Gf,Cb as Nf,zb as kf}from"../chunk-49ey79p0.js";import{Db as md,Eb as kd,Fb as yd,Gb as Gd,Hb as Nd,Ib as ed,Jb as _d,Kb as Sd,Lb as ld}from"../chunk-74pxb991.js";import{Mb as xd,Nb as Ed,Ob as dd,Pb as fd,Qb as Ad,Rb as Od,Sb as Rd,Tb as Md,Ub as Ud}from"../chunk-p4zwy518.js";import{$b as Ro,Vb as Eo,Wb as fo,Xb as Ao,Yb as Oo,ac as Mo}from"../chunk-h7hs95wn.js";import{cc as Uo,fc as mo,gc as ko,hc as yo,ic as Go,jc as No,kc as eo,lc as _o,mc as So,nc as lo,oc as Co,pc as Do,qc as Bo,rc as To,sc as zo,tc as Io,uc as Lo,vc as bo}from"../chunk-vh504tcv.js";import{wc as ep}from"../chunk-4f7panqj.js";import{xc as yp,yc as Gp,zc as Np}from"../chunk-r3zyw8x0.js";import{Bc as yx,Cc as Gx,Dc as Nx,Ec as ex}from"../chunk-1stt2whn.js";import{Fc as Qo,Gc as Xo,Hc as Zo}from"../chunk-mcrfxphm.js";import{Ic as K,Jc as Y,Kc as c,Lc as q,Mc as F,Nc as J,Oc as Q,Pc as X,Qc as Z,Rc as sp,Sc as po,Tc as oo,Uc as xo,Wc as Yo}from"../chunk-djntbp7a.js";import{$c as G,Xc as U,Yc as m,Zc as k,_c as y,ad as N}from"../chunk-1c1gznm9.js";import"../chunk-hw70wbzg.js";import{cd as Wp,dd as Kp,ed as Yp,fd as cp,gd as qp}from"../chunk-3q6czqs4.js";import{jd as Hp}from"../chunk-vyapg8ca.js";import{Ad as Jd,Bd as Qd,Cd as Xd,Dd as Zd,kd as Cd,ld as Dd,md as Bd,nd as Td,od as zd,pd as Id,qd as Ld,rd as bd,sd as jd,td as Hd,ud as Wd,vd as Kd,wd as Yd,xd as cd,yd as qd,zd as Fd}from"../chunk-vagxqhef.js";import"../chunk-xqx460y2.js";import{Gd as _p,Hd as Sp,Id as lp,Jd as Cp,Kd as Dp,Ld as Bp,Md as Tp,Nd as zp,Od as Ip,Pd as Lp,Qd as bp}from"../chunk-ts35hc5t.js";import{Rd as Tf,Sd as zf,Td as If,Ud as Lf,Vd as bf,Wd as jf,Xd as Hf,Yd as Wf,Zd as Kf,_d as Yf}from"../chunk-fvpr07dn.js";import{$d as np}from"../chunk-56q4pwb5.js";import"../chunk-tb5y0350.js";import{be as nE,ce as sE,de as pd,ee as od}from"../chunk-16yqbccr.js";import"../chunk-8rc6042h.js";import{ke as Fp,le as Jp,me as Qp,ne as Xp,oe as Zp,pe as $p,qe as hp,re as tp,se as wp,te as Pp,ue as ap}from"../chunk-4efbxdjr.js";import"../chunk-q9n79dd3.js";import{De as jp}from"../chunk-6md7qf2g.js";import{Ee as up,Fe as Vp,Ge as gp,He as vp,Ie as rp,Je as ip}from"../chunk-eagjp0dh.js";import"../chunk-6d9hmjt8.js";import{Oe as dp,Pe as fp,Qe as Ap,Re as Op,Se as Rp,Te as Mp,Ue as Up,Ve as mp,We as kp}from"../chunk-978wtejw.js";import"../chunk-pkkwb0n0.js";import"../chunk-ph1b3vbp.js";import"../chunk-0j7z87kh.js";import{$h as e,ai as _,bi as S,ci as l,di as C,ei as D,fi as B,gi as T,hi as z,ii as I,ji as L,ki as b,li as j,mi as H,ni as W}from"../chunk-naq32yx3.js";import{oi as LE,pi as bE,qi as jE,ri as HE,si as WE,ti as KE,ui as YE}from"../chunk-bxfc4g2x.js";import{Ai as PE,Bi as aE,Ci as uE,Di as VE,Ei as gE,Fi as vE,Gi as rE,Hi as iE,vi as ZE,wi as $E,xi as hE,yi as tE,zi as wE}from"../chunk-g0w8n555.js";import{Ii as cE,Ji as qE,Ki as FE,Li as JE,Mi as QE,Ni as XE}from"../chunk-tzs22es2.js";import"../chunk-9750tenz.js";import"../chunk-7mgec8kb.js";import{$i as co,aj as qo,bj as Fo,cj as Jo,ej as eA,fj as _A,gj as SA,hj as lA,ij as CA,jj as DA,kj as BA,lj as TA,mj as zA,nj as IA,oj as LA,pj as bA,qj as jA,rj as HA,sj as WA,tj as KA,uj as YA,vj as cA,wj as qA,xj as FA,yj as JA}from"../chunk-zs3jaj0g.js";import{zj as kx}from"../chunk-tn8prpny.js";import{Aj as s,Bj as pp,Cj as op,Dj as xp,Ej as Ep}from"../chunk-5k40mwd4.js";import{Fj as i}from"../chunk-4c9m61yd.js";import{Gj as n}from"../chunk-xakpdqaq.js";import{Hj as t,Ij as w,Jj as P,Kj as a,Lj as u,Mj as V}from"../chunk-1h3ey7k5.js";import{Nj as $,Oj as h,Pj as g,Qj as v,Rj as r}from"../chunk-akffynkc.js";import"../chunk-x3kragh9.js";import"../chunk-wdwvt7gb.js";import"../chunk-8661pvb8.js";import"../chunk-ctsz0ynx.js";import"../chunk-vkctfqpm.js";import"../chunk-6g1y9yqh.js";var{semver:A}=globalThis.Bun;class M{static compareVersions(p,o){return A.order(p,o)}static satisfiesRange(p,o){return A.satisfies(p,o)}static getLatestInRange(p,o){let O=p.filter((E)=>A.satisfies(E,o));if(O.length===0)return null;return O.sort((E,x)=>A.order(x,E))[0]}static createRange(p){return{raw:p,range:p.replace(/^[\^~>=<]+/,""),isExact:!/^[\^~>=<]/.test(p),satisfies:(o)=>this.satisfiesRange(o,p),getLatest:(o)=>this.getLatestInRange(o,p)}}static getUpdateType(p,o){let O=p.replace(/^[\^~>=<]+/,""),E=o.replace(/^[\^~>=<]+/,""),x=O.split(".").map((R)=>{let f=Number(R);return Number.isNaN(f)?0:f}),d=E.split(".").map((R)=>{let f=Number(R);return Number.isNaN(f)?0:f});while(x.length<3)x.push(0);while(d.length<3)d.push(0);if(d[0]>x[0])return"major";if(d[0]===x[0]&&d[1]>x[1])return"minor";return"patch"}static isSafeUpdate(p,o){return A.satisfies(o,p)}}export{hE as writeFileTool,rE as wrapUntrusted,Ux as withNarrative,rd as verifyChanges,YA as validateWorkflowGeneration,cA as validateRepositoryAccess,Af as validateFindings,Qo as validateConfig,to as validateAgainstSchema,DA as updateProgress,hd as unitTestsTouch,sp as toOsvEcosystem,Zp as tagUpdateType,Qd as syntaxAnalyzer,Lp as supports,B as summarizeUsage,nf as summarizeGates,Lo as stripOperators,Ff as stripNonCommandContext,id as stackedBranchName,So as splitConstraint,kp as sortUpdatesByPriority,wd as simplifyTouch,MA as similarity,Z as sign,JA as showFinalInstructions,C as shouldOpenAsDraft,Yf as shouldFail,Jd as shellcheckAnalyzer,uE as shellTool,FA as setupCustomWorkflow,v as setDefaultLogger,yf as serializeReviewState,Gd as serializeLearnings,_d as selectLearnings,Xp as selectLatestTag,Fd as secretsAnalyzer,Io as scanEcosystems,Ro as scanCatalogs,Qp as sameVariant,Do as rustAdapter,Dd as runTool,nd as runStackedTouch,Bf as runReviewForPR,SA as runPreflightChecks,dA as runPostMerge,wo as runHeadless,rf as runGates,Zd as runAnalyzers,oA as runAiGates,iE as runAgent,m as ruleMatches,Co as rubyAdapter,LE as reviewMode,Mf as reviewDiff,WE as restrictedMode,ZE as resolveWorkspacePath,k as resolveRuleEffects,Tp as resolveProviderToken,fd as resolveModelAlias,rp as resolveEngineVersion,wp as resolveCredentials,fo as resolveCatalogReference,Md as resolveAiProvider,Nx as resetConfigCache,Vd as renderTouchOffer,Mx as renderReport,NA as renderQuickLinks,OA as renderPackageContext,T as renderMigrationReport,Sd as renderLearnings,Cf as renderFinding,ho as renderDoctorReport,of as renderDiffForReview,zd as relativize,bo as regenerateLockfiles,Gp as regenerateLockFile,JE as redactError,FE as redactDeep,qE as redact,$E as readFileTool,lo as pythonAdapter,ao as publishOutput,Vo as productFor,Df as prepareReview,Pd as planTouch,HE as planMode,vp as pinBlocksUpdate,_o as pep440UpdateType,Eo as parseWorkspaceCatalogs,pf as parseUnifiedDiff,gd as parseTouchSelections,Td as parseToolJson,Fp as parseTag,Gf as parseReviewState,a as parseRetryDelay,TA as parseRemote,yA as parseQuickSelection,Go as parsePep440,fp as parsePackageFile,yd as parseLearnings,$p as parseImageRef,px as parseHistory,Jf as parseCommand,Pp as parseAuthChallenge,Hd as offsetToLine,ko as numericUpdateType,po as normalizeSeverity,l as normalizePlan,Nf as needsReview,G as mergeGroupEffects,Xf as mentionsBot,j as matchesGlobs,cd as markdownlintAnalyzer,Kp as mapWithConcurrency,Bd as mapSeverity,ld as loadLearnings,Ex as loadHistory,Sf as loadGuidelines,tE as listDirTool,Yd as linterAnalyzer,Qf as isReadOnlyCommand,eo as isPep440Prerelease,fA as isMergeEvent,Ao as isCatalogReference,_ as isAllowedCodemod,bE as implementMode,jd as hadolintAnalyzer,IA as guideTokenCreation,bA as guideRepositorySettings,N as groupsToRules,mp as groupUpdates,yo as goAdapter,bd as githubActionsAnalyzer,KA as getWorkflowPreset,xp as getNpmRegistryUrl,pp as getGitHubServerUrl,s as getGitHubApiUrl,ud as getFinishingTouch,r as getDefaultLogger,Gx as getConfig,Ep as getComposerRegistryUrl,yp as getAllLockFilePaths,YE as getAgentMode,HA as generateUnifiedWorkflow,qo as generateGitLabPipeline,WA as generateCoreWorkflows,jA as generateConfigFile,Up as generateBranchName,Fo as generateBitbucketPipeline,wE as fsTools,dp as formatSecurityAdvisorySection,Wf as formatReview,Lf as formatPretty,Rp as formatPRTitle,Mp as formatPRBody,hp as formatImageRef,Po as formatGithubOutput,bf as formatGithub,h as formatError,Xo as formatConfigIssues,Op as formatCommitMessage,jf as formatAgent,jE as fixCiMode,ff as fingerprint,D as findUsageSites,xx as findPrevious,AA as findMentionedPackages,xA as findLinkedIssues,UA as findDuplicates,Wo as findDrift,u as fetchWithTimeout,V as fetchJsonOrNull,wf as extractErrorLines,Vp as extractEngines,U as ecosystemOf,jo as driftFor,$d as docstringsTouch,qA as displayValidationResults,BA as displayProgress,hf as dispatchCommand,zf as diffArgsFor,$o as diagnose,Np as detectRequiredPackageManagers,zA as detectRepository,Ap as detectPackageManager,Kd as detectLinter,Uo as detectFiles,sd as detectChangedFiles,b as describeSpanGaps,Pf as describeFailure,c as describeEvent,io as describeEol,Ko as describeDrift,mf as defaultIncludePath,yx as defaultConfig,Of as dedupeFindings,go as cycleFor,X as createWebhookSink,J as createSlackSink,F as createSinks,Ip as createProvider,CA as createProgressTracker,Rd as createOpenAiProvider,Nd as createLearning,uf as createHandlers,Od as createGoogleProvider,Q as createDiscordSink,Ad as createAnthropicProvider,Ud as createAiClient,Hf as countBySeverity,RA as constrainLabels,LA as confirmTokenSetup,ex as config,Ax as computeMetrics,Ox as computeDeltas,lf as composeInstructions,Jp as compareVersions,No as comparePep440,mo as compareNumeric,Id as commandExists,L as collectSpanNotes,gp as collectResolutionPins,If as collectLocalDiff,xf as collectGitDiff,GA as clearQuickSelection,op as clearNpmrcCache,tf as classifyFailure,Jo as ciTemplateFor,Yp as chunk,Vf as checkTitleFormat,$f as checkPermission,sf as checkLinkedIssue,vo as checkEol,gf as checkDescription,vf as checkDependencies,pA as checkCustomAssertions,ip as bumpEngineConstraint,aE as buildShellEnv,S as buildAnalysisPrompt,td as autofixTouch,z as attemptMajorUpgrade,af as attemptFix,Zo as assertValidConfig,bp as assertSupports,zp as assertProviderSupported,Kf as applySuggestion,y as applyRules,Mo as applyCatalogUpdates,Oo as applyCatalogUpdate,W as appendUpgradeReport,ox as appendHistory,EA as appendChangelogEntry,tp as apiHostFor,Uf as anchorMap,lA as analyzeProject,H as analyzeGroupMajors,xo as advisoryKey,ed as addLearning,zo as adapterNamed,To as adapterFor,Ld as actionlintAnalyzer,q as WEBHOOK_PAYLOAD_VERSION,M as VersionResolver,Dp as UnsupportedProviderError,vE as Toolbelt,VE as ToolPermissionError,Cd as TOOL_TIMEOUT_MS,vd as TEST_COMMANDS,oo as SecurityAdvisoryService,mx as Scheduler,PE as SHELL_ENV_ALLOWLIST,Ef as SEVERITY_ORDER,qd as SECRET_RULES,jp as ReleaseNotesFetcher,qp as RegistryClient,Ho as ROOT,kf as REVIEW_STATE_VERSION,df as REVIEW_SCHEMA,Tf as REVIEW_FORMATS,dx as REPORT_PERIODS,Rx as REPORT_MARKER,cE as REDACTED,qf as READ_ONLY_COMMANDS,mA as QUICK_LINKS_MARKER,kA as QUICK_ACTIONS,Hp as PullRequestGenerator,_A as PluginManager,np as PackageScanner,sE as PackageRegistryError,lp as PROVIDER_TRACKING_ISSUES,Bp as PROVIDER_TOKEN_ENV,dd as PROVIDER_PRIORITY,_p as PROVIDER_NAMES,Ed as PROVIDER_KEY_ENV,fx as PERIOD_DAYS,ap as OciClient,Cp as NO_CAPABILITIES,xd as MODEL_ALIASES,e as MIGRATION_PLAN_SCHEMA,_f as MAX_GUIDELINE_CHARS,g as Logger,Wd as LINTER_SPECS,up as KNOWN_ENGINES,Sp as IMPLEMENTED_PROVIDERS,P as HttpRequestError,no as HISTORY_PATH,so as HISTORY_LIMIT,Zf as HELP_TEXT,pd as GitProviderError,i as GitLabProvider,ep as GitHubProvider,$ as GitHubApiError,kx as GitHubActionsTemplate,ad as FINISHING_TOUCHES,Y as EventBus,K as EVENT_NAMES,ro as EOL_WARNING_DAYS,uo as EOL_PRODUCTS,t as DEFAULT_TIMEOUT_MS,I as DEFAULT_SPAN_BUDGET,co as DEFAULT_SCHEDULE,w as DEFAULT_RETRIES,kd as DEFAULT_PROMPT_LIMIT,md as DEFAULT_LEARNINGS_FILE,ef as DEFAULT_GUIDELINE_FILES,Rf as DEFAULT_EXCLUDED_PATHS,Wp as DEFAULT_CONCURRENCY,eA as ConfigurationMigrator,od as ConfigurationError,cf as COMMAND_ALIASES,nE as BuddyError,Yo as Buddy,n as BitbucketProvider,gE as BUILTIN_TOOLS,Xd as BUILTIN_ANALYZERS,Bo as BUILTIN_ADAPTERS,cp as AsyncMemo,XE as AiProviderError,QE as AiBudgetExceededError,KE as AGENT_MODES};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Find package names an issue plausibly refers to.
|
|
3
|
+
*
|
|
4
|
+
* Matched against the repository's own dependencies rather than extracted
|
|
5
|
+
* freely, so an issue mentioning "react hooks" does not produce context for a
|
|
6
|
+
* package the project does not use.
|
|
7
|
+
*
|
|
8
|
+
* @param text - Issue title and body
|
|
9
|
+
* @param knownPackages - Dependencies declared in the repository
|
|
10
|
+
* @returns The referenced package names
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* findMentionedPackages('bump lodash please', ['lodash', 'react']) // => ['lodash']
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare function findMentionedPackages(text: string, knownPackages: string[]): string[];
|
|
17
|
+
/**
|
|
18
|
+
* Render what buddy knows about the packages an issue mentions.
|
|
19
|
+
*
|
|
20
|
+
* This is the half of issue enrichment that needs no model: every fact here is
|
|
21
|
+
* already collected by the scanner, the advisory service and the deprecation
|
|
22
|
+
* checker, so a repository gets it without configuring AI.
|
|
23
|
+
*
|
|
24
|
+
* @param packages - Context for each mentioned package
|
|
25
|
+
* @returns A comment body, or empty when there is nothing useful to say
|
|
26
|
+
*/
|
|
27
|
+
export declare function renderPackageContext(packages: PackageContext[]): string;
|
|
28
|
+
/**
|
|
29
|
+
* Keep only labels the repository actually defines.
|
|
30
|
+
*
|
|
31
|
+
* A model asked to label an issue will invent plausible-sounding labels;
|
|
32
|
+
* applying those creates junk labels that nobody curated. Restricting to the
|
|
33
|
+
* existing set makes the feature safe to leave on.
|
|
34
|
+
*
|
|
35
|
+
* @param suggested - Labels the model proposed
|
|
36
|
+
* @param existing - Labels the repository defines
|
|
37
|
+
* @returns Which to apply and which were rejected
|
|
38
|
+
*/
|
|
39
|
+
export declare function constrainLabels(suggested: string[], existing: string[]): LabelDecision;
|
|
40
|
+
/**
|
|
41
|
+
* Score how likely two issues are duplicates.
|
|
42
|
+
*
|
|
43
|
+
* A cheap token-overlap score rather than embeddings: it runs with no model,
|
|
44
|
+
* and duplicate detection only needs to be good enough to ask a human.
|
|
45
|
+
*
|
|
46
|
+
* @param a - First issue's title and body
|
|
47
|
+
* @param b - Second issue's title and body
|
|
48
|
+
* @returns Similarity between 0 and 1
|
|
49
|
+
*/
|
|
50
|
+
export declare function similarity(a: string, b: string): number;
|
|
51
|
+
/**
|
|
52
|
+
* Find issues that look like duplicates of a new one.
|
|
53
|
+
*
|
|
54
|
+
* Never used to close anything automatically — a wrong auto-close costs a
|
|
55
|
+
* maintainer far more than a wrong suggestion, so this only ever produces a
|
|
56
|
+
* comment asking a human to confirm.
|
|
57
|
+
*
|
|
58
|
+
* @param issue - The new issue's text
|
|
59
|
+
* @param candidates - Existing issues to compare against
|
|
60
|
+
* @param threshold - Minimum similarity to report
|
|
61
|
+
*/
|
|
62
|
+
export declare function findDuplicates(issue: string, candidates: Array<{ number: number, text: string }>, threshold?: number): Array<{ number: number, score: number }>;
|
|
63
|
+
/** A package mentioned in an issue, with what buddy already knows. */
|
|
64
|
+
export declare interface PackageContext {
|
|
65
|
+
name: string
|
|
66
|
+
declaredVersion?: string
|
|
67
|
+
latestVersion?: string
|
|
68
|
+
vulnerable?: boolean
|
|
69
|
+
deprecated?: boolean
|
|
70
|
+
openPRs?: number[]
|
|
71
|
+
}
|
|
72
|
+
/** Labels a repository already defines, and the ones to apply. */
|
|
73
|
+
export declare interface LabelDecision {
|
|
74
|
+
apply: string[]
|
|
75
|
+
rejected: string[]
|
|
76
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type { LabelDecision, PackageContext } from './enrichment';
|
|
2
|
+
export type { QuickAction, QuickSelection } from './quick-links';
|
|
3
|
+
export {
|
|
4
|
+
constrainLabels,
|
|
5
|
+
findDuplicates,
|
|
6
|
+
findMentionedPackages,
|
|
7
|
+
renderPackageContext,
|
|
8
|
+
similarity,
|
|
9
|
+
} from './enrichment';
|
|
10
|
+
export {
|
|
11
|
+
clearQuickSelection,
|
|
12
|
+
parseQuickSelection,
|
|
13
|
+
QUICK_ACTIONS,
|
|
14
|
+
QUICK_LINKS_MARKER,
|
|
15
|
+
renderQuickLinks,
|
|
16
|
+
} from './quick-links';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { PackageContext } from './enrichment';
|
|
2
|
+
/**
|
|
3
|
+
* Parse which quick actions were ticked.
|
|
4
|
+
*
|
|
5
|
+
* The marker carries the action id rather than the label, so retitling a
|
|
6
|
+
* button in a later release cannot silently change which action an
|
|
7
|
+
* already-posted comment triggers.
|
|
8
|
+
*
|
|
9
|
+
* @param body - Comment body
|
|
10
|
+
* @returns The requested action ids
|
|
11
|
+
*/
|
|
12
|
+
export declare function parseQuickSelection(body: string | null | undefined): QuickSelection;
|
|
13
|
+
/**
|
|
14
|
+
* Clear the ticked boxes in a quick-links comment.
|
|
15
|
+
*
|
|
16
|
+
* Called after the actions run, so the comment does not re-trigger on the next
|
|
17
|
+
* poll — the same reason the dashboard unchecks its own boxes.
|
|
18
|
+
*
|
|
19
|
+
* @param body - Comment body
|
|
20
|
+
* @returns The body with every quick-action box cleared
|
|
21
|
+
*/
|
|
22
|
+
export declare function clearQuickSelection(body: string): string;
|
|
23
|
+
/**
|
|
24
|
+
* Render the quick-links comment for a new issue.
|
|
25
|
+
*
|
|
26
|
+
* Both actions are opt-in checkboxes rather than automatic. An issue is a
|
|
27
|
+
* request for a conversation as often as for code, and a bot that opens a pull
|
|
28
|
+
* request against every new issue is one a maintainer turns off in a week.
|
|
29
|
+
*
|
|
30
|
+
* @param options - Issue text and known packages, for the context section
|
|
31
|
+
* @returns The comment body
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* await provider.createComment(issue.number, renderQuickLinks({ body: issue.body, packages }))
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare function renderQuickLinks(options?: {
|
|
38
|
+
body?: string
|
|
39
|
+
/** Dependency metadata, for the context section */
|
|
40
|
+
packages?: PackageContext[]
|
|
41
|
+
}): string;
|
|
42
|
+
/** Marker identifying the quick-links comment, so it updates rather than repeats. */
|
|
43
|
+
export declare const QUICK_LINKS_MARKER: '<!-- buddy:quick-links -->';
|
|
44
|
+
/** The actions offered on a new issue. */
|
|
45
|
+
export declare const QUICK_ACTIONS: QuickAction[];
|
|
46
|
+
/** An action a maintainer can request by ticking a box. */
|
|
47
|
+
export declare interface QuickAction {
|
|
48
|
+
id: string
|
|
49
|
+
label: string
|
|
50
|
+
description: string
|
|
51
|
+
}
|
|
52
|
+
/** Which quick actions a comment body requests. */
|
|
53
|
+
export declare interface QuickSelection {
|
|
54
|
+
actions: string[]
|
|
55
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { BuddyConfig, PackageUpdate } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Resolved auto-merge settings, with defaults applied.
|
|
4
|
+
*
|
|
5
|
+
* @param config - Full buddy configuration
|
|
6
|
+
*/
|
|
7
|
+
export declare function resolveAutoMergeConfig(config: BuddyConfig): {
|
|
8
|
+
enabled: boolean
|
|
9
|
+
strategy: 'merge' | 'squash' | 'rebase'
|
|
10
|
+
conditions: AutoMergeCondition[]
|
|
11
|
+
requireGreenCI: boolean
|
|
12
|
+
optOutLabel: string
|
|
13
|
+
securityLabel: string
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Decides whether a pull request may be auto-merged.
|
|
17
|
+
*
|
|
18
|
+
* Reads the update types from the embedded metadata manifest rather than the
|
|
19
|
+
* PR title, so a retitled or reworded PR cannot be talked into a merge it does
|
|
20
|
+
* not qualify for. A PR whose manifest is missing or truncated is never
|
|
21
|
+
* eligible: without the complete update list there is no way to prove every
|
|
22
|
+
* update satisfies the configured conditions.
|
|
23
|
+
*
|
|
24
|
+
* CI state is checked separately by the caller and passed in, because the two
|
|
25
|
+
* entry points differ — PR creation has no checks yet, while `update-check`
|
|
26
|
+
* polls a PR whose checks have had time to run.
|
|
27
|
+
*
|
|
28
|
+
* @param pr - The pull request under consideration
|
|
29
|
+
* @param config - Full buddy configuration
|
|
30
|
+
* @param ciGreen - Whether required checks have passed, or `undefined` when not yet known
|
|
31
|
+
* @returns The decision and the reason behind it
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* const decision = evaluateAutoMerge(pr, config, true)
|
|
35
|
+
* if (decision.eligible)
|
|
36
|
+
* await provider.mergePullRequest(pr.number, strategy)
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare function evaluateAutoMerge(pr: AutoMergeCandidate, config: BuddyConfig, ciGreen?: boolean): AutoMergeDecision;
|
|
40
|
+
/**
|
|
41
|
+
* Decides auto-merge eligibility for a set of updates before a PR exists.
|
|
42
|
+
*
|
|
43
|
+
* Used at creation time, where the manifest has not been written yet but the
|
|
44
|
+
* updates are already known.
|
|
45
|
+
*
|
|
46
|
+
* @param updates - Updates the PR will contain
|
|
47
|
+
* @param labels - Labels the PR will be created with
|
|
48
|
+
* @param config - Full buddy configuration
|
|
49
|
+
*/
|
|
50
|
+
export declare function evaluateAutoMergeForUpdates(updates: PackageUpdate[], labels: string[], config: BuddyConfig): AutoMergeDecision;
|
|
51
|
+
/** Label that suppresses auto-merge on an individual PR. */
|
|
52
|
+
export declare const DEFAULT_OPT_OUT_LABEL: 'no-auto-merge';
|
|
53
|
+
/** Why a pull request was or was not eligible for auto-merge. */
|
|
54
|
+
export declare interface AutoMergeDecision {
|
|
55
|
+
eligible: boolean
|
|
56
|
+
reason: string
|
|
57
|
+
}
|
|
58
|
+
/** The subset of a pull request auto-merge needs to make a decision. */
|
|
59
|
+
export declare interface AutoMergeCandidate {
|
|
60
|
+
number: number
|
|
61
|
+
title: string
|
|
62
|
+
body: string
|
|
63
|
+
head: string
|
|
64
|
+
author?: string
|
|
65
|
+
labels?: string[]
|
|
66
|
+
draft?: boolean
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Conditions that restrict which updates may merge without review.
|
|
70
|
+
*
|
|
71
|
+
* `all` is deliberately explicit: an empty condition list is treated as
|
|
72
|
+
* "nothing qualifies" rather than "everything qualifies", so a half-written
|
|
73
|
+
* config cannot start merging major upgrades.
|
|
74
|
+
*/
|
|
75
|
+
export type AutoMergeCondition = 'patch-only' | 'minor-only' | 'security-only' | 'all';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BuddyConfig, PullRequest, UpdateGroup } from '../types';
|
|
2
|
+
export declare class PullRequestGenerator {
|
|
3
|
+
constructor(config?: BuddyConfig | undefined);
|
|
4
|
+
generatePullRequests(groups: UpdateGroup[]): Promise<PullRequest[]>;
|
|
5
|
+
generateLabels(group: UpdateGroup): string[];
|
|
6
|
+
generateTitle(group: UpdateGroup): string;
|
|
7
|
+
generateBody(group: UpdateGroup): Promise<string>;
|
|
8
|
+
generateCustomTemplate(group: UpdateGroup, template: string, variables?: Record<string, string>): string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { PackageUpdate, PRManifest, UpdateGroup } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Serializes package updates into the HTML comment embedded in every PR body.
|
|
4
|
+
*
|
|
5
|
+
* The payload is what `rebase`, auto-close and the dashboard read back, so it
|
|
6
|
+
* has to survive body truncation — callers append it *after* any truncation
|
|
7
|
+
* pass rather than treating it as ordinary body content.
|
|
8
|
+
*
|
|
9
|
+
* @param updates - Updates contained in the pull request
|
|
10
|
+
* @param meta - Group name, strategy and branch recorded for diagnostics
|
|
11
|
+
* @returns The manifest comment, including a leading newline
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* body += serializeManifest(group.updates, { group: group.name })
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare function serializeManifest(updates: PackageUpdate[], meta?: { group?: string, strategy?: string, branch?: string, generatedAt?: string }): string;
|
|
18
|
+
/**
|
|
19
|
+
* Serializes the manifest for an update group.
|
|
20
|
+
*
|
|
21
|
+
* @param group - Group whose updates back the pull request
|
|
22
|
+
* @param meta - Additional metadata merged into the payload
|
|
23
|
+
*/
|
|
24
|
+
export declare function serializeGroupManifest(group: UpdateGroup, meta?: { strategy?: string, branch?: string, generatedAt?: string }): string;
|
|
25
|
+
/**
|
|
26
|
+
* Reads the manifest back out of a PR body.
|
|
27
|
+
*
|
|
28
|
+
* Tolerant by design: a missing, malformed or partially-truncated manifest
|
|
29
|
+
* returns `null` so callers can fall back to legacy parsing instead of
|
|
30
|
+
* crashing a workflow run.
|
|
31
|
+
*
|
|
32
|
+
* @param body - Pull request body, possibly `null` for empty PRs
|
|
33
|
+
* @returns The parsed manifest, or `null` when absent or unreadable
|
|
34
|
+
*/
|
|
35
|
+
export declare function parseManifest(body: string | null | undefined): PRManifest | null;
|
|
36
|
+
/**
|
|
37
|
+
* Reports whether a body carries a readable manifest.
|
|
38
|
+
*
|
|
39
|
+
* @param body - Pull request body
|
|
40
|
+
*/
|
|
41
|
+
export declare function hasManifest(body: string | null | undefined): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Removes the manifest comment from a body.
|
|
44
|
+
*
|
|
45
|
+
* Used when regenerating a body so repeated rebases don't stack manifests.
|
|
46
|
+
*
|
|
47
|
+
* @param body - Pull request body
|
|
48
|
+
*/
|
|
49
|
+
export declare function stripManifest(body: string): string;
|
|
50
|
+
/**
|
|
51
|
+
* Replaces any existing manifest with a freshly serialized one.
|
|
52
|
+
*
|
|
53
|
+
* @param body - Pull request body
|
|
54
|
+
* @param updates - Updates the pull request now contains
|
|
55
|
+
* @param meta - Additional metadata merged into the payload
|
|
56
|
+
*/
|
|
57
|
+
export declare function withManifest(body: string, updates: PackageUpdate[], meta?: { group?: string, strategy?: string, branch?: string }): string;
|
|
58
|
+
/**
|
|
59
|
+
* Projects manifest entries onto the `{ name, currentVersion, newVersion }`
|
|
60
|
+
* shape the rebase and auto-close paths already work with.
|
|
61
|
+
*
|
|
62
|
+
* @param manifest - Parsed manifest
|
|
63
|
+
*/
|
|
64
|
+
export declare function manifestUpdates(manifest: PRManifest): Array<{ name: string, currentVersion: string, newVersion: string }>;
|
|
65
|
+
/**
|
|
66
|
+
* Distinct file paths recorded in a manifest, for `ignorePaths` auto-close.
|
|
67
|
+
*
|
|
68
|
+
* @param manifest - Parsed manifest
|
|
69
|
+
*/
|
|
70
|
+
export declare function manifestFiles(manifest: PRManifest): string[];
|
|
71
|
+
/** Schema version emitted by this build. */
|
|
72
|
+
export declare const MANIFEST_SCHEMA_VERSION: 1;
|
|
73
|
+
/**
|
|
74
|
+
* Hard ceiling on the serialized manifest.
|
|
75
|
+
*
|
|
76
|
+
* The manifest is reserved out of the PR body budget before the prose is
|
|
77
|
+
* truncated, so it cannot be allowed to grow without bound — a monorepo group
|
|
78
|
+
* with hundreds of packages would otherwise push the body past GitHub's
|
|
79
|
+
* 65,536 character limit on its own. Manifests above this size shed optional
|
|
80
|
+
* fields first, then rows.
|
|
81
|
+
*/
|
|
82
|
+
export declare const MANIFEST_MAX_LENGTH: 30000;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { UpdateGroup } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Substitutes `{token}` placeholders in a user-supplied template.
|
|
4
|
+
*
|
|
5
|
+
* Unknown tokens are preserved verbatim: silently blanking them would turn a
|
|
6
|
+
* typo into missing PR content with no indication of why.
|
|
7
|
+
*
|
|
8
|
+
* @param template - Template string from config
|
|
9
|
+
* @param tokens - Values available for substitution
|
|
10
|
+
* @returns The rendered string
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* applyTemplate('chore(deps): {title}', { title: 'update react to v18' })
|
|
14
|
+
* // => 'chore(deps): update react to v18'
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare function applyTemplate(template: string, tokens: TemplateTokens): string;
|
|
18
|
+
/**
|
|
19
|
+
* Builds the token set describing an update group.
|
|
20
|
+
*
|
|
21
|
+
* @param group - Group backing the pull request
|
|
22
|
+
* @param defaults - Generated title and commit message to expose as tokens
|
|
23
|
+
* @param strategy - Configured update strategy
|
|
24
|
+
*/
|
|
25
|
+
export declare function templateTokensForGroup(group: UpdateGroup, defaults?: { title?: string, message?: string }, strategy?: string): TemplateTokens;
|
|
26
|
+
/**
|
|
27
|
+
* Values a user-supplied PR template can interpolate.
|
|
28
|
+
*
|
|
29
|
+
* Tokens are written as `{name}` and unknown tokens are left untouched, so a
|
|
30
|
+
* literal brace in a template survives rather than becoming an empty string.
|
|
31
|
+
*/
|
|
32
|
+
export declare interface TemplateTokens {
|
|
33
|
+
title?: string
|
|
34
|
+
message?: string
|
|
35
|
+
group?: string
|
|
36
|
+
count?: number
|
|
37
|
+
strategy?: string
|
|
38
|
+
updateType?: string
|
|
39
|
+
packages?: string
|
|
40
|
+
updatesTable?: string
|
|
41
|
+
releaseNotes?: string
|
|
42
|
+
footer?: string
|
|
43
|
+
packageCount?: number
|
|
44
|
+
}
|