@cldmv/gh-broker 0.7.0 → 0.9.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.
Files changed (107) hide show
  1. package/README.md +165 -41
  2. package/config.example.json +38 -9
  3. package/config.sample.json +45 -0
  4. package/deploy/README.md +76 -17
  5. package/deploy/install.mjs +171 -104
  6. package/deploy/install.sh +0 -0
  7. package/deploy/lib/config-merge.mjs +174 -16
  8. package/deploy/lib/credentials.mjs +143 -0
  9. package/deploy/lib/install-args.mjs +144 -0
  10. package/deploy/lib/npm-setup.mjs +164 -0
  11. package/deploy/lib/secret-store.mjs +20 -2
  12. package/deploy/lib/system.mjs +26 -2
  13. package/dist/index.mjs +5864 -1809
  14. package/dist/index.mjs.map +4 -4
  15. package/package.json +18 -8
  16. package/.configs/fix-headers.json +0 -3
  17. package/.configs/vitest.config.mjs +0 -44
  18. package/.github/dependabot.yml +0 -111
  19. package/.github/workflows/branch-retention.yml +0 -44
  20. package/.github/workflows/bundle-size.yml +0 -52
  21. package/.github/workflows/ci.yml +0 -389
  22. package/.github/workflows/cla.yml +0 -66
  23. package/.github/workflows/codeql.yml +0 -87
  24. package/.github/workflows/dependabot-auto-merge.yml +0 -62
  25. package/.github/workflows/dependabot-recreate.yml +0 -67
  26. package/.github/workflows/dependency-review.yml +0 -46
  27. package/.github/workflows/feature-pr.yml +0 -75
  28. package/.github/workflows/hotfix-redirector.yml +0 -67
  29. package/.github/workflows/hotfixes-release.yml +0 -70
  30. package/.github/workflows/labeler.yml +0 -48
  31. package/.github/workflows/master-commit-audit.yml +0 -56
  32. package/.github/workflows/member-auto-merge.yml +0 -75
  33. package/.github/workflows/next-release.yml +0 -76
  34. package/.github/workflows/next-reset.yml +0 -50
  35. package/.github/workflows/pr-notify.yml +0 -44
  36. package/.github/workflows/pr-title-normalizer.yml +0 -52
  37. package/.github/workflows/provenance.yml +0 -51
  38. package/.github/workflows/publish.yml +0 -146
  39. package/.github/workflows/release-merge.yml +0 -104
  40. package/.github/workflows/release-notify.yml +0 -41
  41. package/.github/workflows/scorecard.yml +0 -64
  42. package/.github/workflows/stale.yml +0 -50
  43. package/.github/workflows/tag-health.yml +0 -70
  44. package/.github/workflows/update-major-version-tags.yml +0 -94
  45. package/.github/workflows/v4-bootstrap.yml +0 -115
  46. package/.github/workflows/welcome.yml +0 -42
  47. package/docs/TOOLS.md +0 -347
  48. package/docs/agent-user-model.md +0 -89
  49. package/docs/changelog/v0/v0.2.0.md +0 -26
  50. package/docs/changelog/v0/v0.2.1.md +0 -23
  51. package/docs/changelog/v0/v0.2.2.md +0 -23
  52. package/docs/changelog/v0/v0.2.3.md +0 -33
  53. package/docs/changelog/v0/v0.2.4.md +0 -25
  54. package/docs/changelog/v0/v0.2.5.md +0 -29
  55. package/docs/changelog/v0/v0.3.0.md +0 -84
  56. package/docs/changelog/v0/v0.3.1.md +0 -30
  57. package/docs/changelog/v0/v0.3.2.md +0 -24
  58. package/docs/changelog/v0/v0.3.3.md +0 -28
  59. package/docs/changelog/v0/v0.4.0.md +0 -58
  60. package/docs/changelog/v0/v0.4.1.md +0 -33
  61. package/docs/changelog/v0/v0.4.2.md +0 -45
  62. package/docs/changelog/v0/v0.5.0.md +0 -39
  63. package/docs/changelog/v0/v0.5.1.md +0 -28
  64. package/docs/changelog/v0/v0.6.0.md +0 -52
  65. package/docs/changelog/v0/v0.6.1.md +0 -48
  66. package/docs/changelog/v0/v0.7.0.md +0 -71
  67. package/docs/deploy-architecture.md +0 -82
  68. package/src/appauth.ts +0 -56
  69. package/src/audit.ts +0 -34
  70. package/src/catalog.ts +0 -165
  71. package/src/config.ts +0 -130
  72. package/src/index.ts +0 -107
  73. package/src/paths.ts +0 -60
  74. package/src/router.ts +0 -258
  75. package/src/secrets.ts +0 -137
  76. package/src/server.ts +0 -91
  77. package/src/types.ts +0 -104
  78. package/src/upstream.ts +0 -85
  79. package/src/verbs/issue_labels.ts +0 -329
  80. package/src/verbs/link_issue.ts +0 -84
  81. package/src/verbs/release-analysis.ts +0 -210
  82. package/src/verbs/repo-tier.ts +0 -90
  83. package/src/verbs/report_ci_status.ts +0 -358
  84. package/src/verbs/report_release_prs.ts +0 -238
  85. package/src/verbs/report_security_alerts.ts +0 -442
  86. package/src/verbs/report_unlabeled.ts +0 -194
  87. package/src/verbs/rest-client.ts +0 -181
  88. package/src/verbs/review_thread.ts +0 -138
  89. package/tests/appauth.test.vitest.mts +0 -76
  90. package/tests/audit.test.vitest.mts +0 -48
  91. package/tests/catalog.test.vitest.mts +0 -180
  92. package/tests/config-merge.test.vitest.mts +0 -58
  93. package/tests/config.test.vitest.mts +0 -314
  94. package/tests/issue-labels.test.vitest.mts +0 -347
  95. package/tests/paths.test.vitest.mts +0 -52
  96. package/tests/release-prs.test.vitest.mts +0 -237
  97. package/tests/rest-client.test.vitest.mts +0 -115
  98. package/tests/router.test.vitest.mts +0 -399
  99. package/tests/run-vitest.mjs +0 -51
  100. package/tests/secret-store.test.vitest.mts +0 -106
  101. package/tests/secrets.test.vitest.mts +0 -155
  102. package/tests/security-alerts.test.vitest.mts +0 -328
  103. package/tests/server.test.vitest.mts +0 -20
  104. package/tests/upstream.test.vitest.mts +0 -91
  105. package/tests/verb-helpers.test.vitest.mts +0 -331
  106. package/tests/verbs.test.vitest.mts +0 -624
  107. package/tsconfig.json +0 -21
package/package.json CHANGED
@@ -1,13 +1,19 @@
1
1
  {
2
2
  "name": "@cldmv/gh-broker",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "description": "Local credential-routing MCP proxy: holds per-org GitHub PATs out of the agent's reach, routes by repo owner, exposes a config-driven default-deny toolset in front of GitHub's hosted MCP.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
7
7
  "bin": {
8
- "gh-broker": "./dist/index.mjs"
8
+ "gh-broker": "./deploy/install.mjs"
9
9
  },
10
10
  "main": "./dist/index.mjs",
11
+ "files": [
12
+ "dist",
13
+ "deploy",
14
+ "config.example.json",
15
+ "config.sample.json"
16
+ ],
11
17
  "engines": {
12
18
  "node": ">=22.12.0"
13
19
  },
@@ -50,16 +56,16 @@
50
56
  "homepage": "https://github.com/CLDMV/gh-broker#readme",
51
57
  "devDependencies": {
52
58
  "@cldmv/configs": "^1.3.0",
53
- "@cldmv/fix-headers": "^2.2.1",
54
- "@cldmv/vitest-runner": "^1.5.4",
55
- "@types/node": "^26.6.5",
56
- "@vitest/coverage-v8": "^5.0.2",
59
+ "@cldmv/fix-headers": "^2.2.3",
60
+ "@cldmv/vitest-runner": "^1.5.6",
61
+ "@types/node": "^26.6.6",
62
+ "@vitest/coverage-v8": "^5.0.5",
57
63
  "esbuild": "^0.28.2",
58
64
  "typescript": "^6.0.3",
59
- "vitest": "^5.0.3"
65
+ "vitest": "^5.0.5"
60
66
  },
61
67
  "dependencies": {
62
- "@modelcontextprotocol/sdk": "^1.32.1",
68
+ "@modelcontextprotocol/sdk": "^1.32.2",
63
69
  "@octokit/auth-app": "^8.3.1",
64
70
  "@octokit/core": "^7.0.8"
65
71
  },
@@ -68,5 +74,9 @@
68
74
  },
69
75
  "allowScripts": {
70
76
  "esbuild": true
77
+ },
78
+ "overrides": {
79
+ "katex": ">=0.19.1 <1.0.0",
80
+ "minimatch": "^11.0.3"
71
81
  }
72
82
  }
@@ -1,3 +0,0 @@
1
- {
2
- "extends": "@cldmv/configs/fix-headers.json"
3
- }
@@ -1,44 +0,0 @@
1
- /**
2
- *
3
- * @Project: @cldmv/gh-broker
4
- * @Filename: /.configs/vitest.config.mjs
5
- * @Date: 2026-08-02T16:55:52-07:00 (1785714952)
6
- * @Author: Nate Corcoran <CLDMV>
7
- * @Email: <Shinrai@users.noreply.github.com>
8
- * -----
9
- * @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
10
- * @Last modified time: 2026-10-02T11:30:57-07:00 (1790965857)
11
- * -----
12
- * @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
13
- *
14
- */
15
-
16
- import { defineConfig } from "vitest/config";
17
- import { fileURLToPath } from "node:url";
18
- import path from "node:path";
19
-
20
- const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
21
-
22
- export default defineConfig({
23
- root,
24
- test: {
25
- include: ["tests/**/*.test.vitest.mts"],
26
- exclude: ["node_modules", "dist"],
27
- environment: "node",
28
- testTimeout: 30000,
29
- reporters: ["dot"],
30
- coverage: {
31
- provider: "v8",
32
- include: ["src/**/*.ts"],
33
- // index.ts is the process entrypoint (arg parse + wire + listen);
34
- // types.ts is type-only (elided at compile time — zero runtime code).
35
- // Neither is unit-testable. server.ts (the stdio<->socket bridge) is
36
- // deliberately NOT excluded — its logic is real and only partly covered,
37
- // so it should show honestly rather than be hidden. Measured units are
38
- // the pure logic: config, router/owner-routing, catalog, audit, secrets,
39
- // verbs, upstream, appauth.
40
- exclude: ["tests/**", "**/*.json", "src/index.ts", "src/types.ts"],
41
- reporter: ["text", "html", "json-summary", "json"]
42
- }
43
- }
44
- });
@@ -1,111 +0,0 @@
1
- #
2
- # @Project: @cldmv/gh-broker
3
- # @Filename: /.github/dependabot.yml
4
- # @Date: 2026-05-26T00:00:00-07:00 (1779778800)
5
- # @Author: Nate Corcoran <CLDMV>
6
- # @Email: <Shinrai@users.noreply.github.com>
7
- # -----
8
- # @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
9
- # @Last modified time: 2026-10-02T11:30:57-07:00 (1790965857)
10
- # -----
11
- # @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
12
- #
13
-
14
- # Individual repo: .github/dependabot.yml
15
- #
16
- # Dependabot configuration tuned for the v4 staging-branch release flow.
17
- #
18
- # How it fits with v4:
19
- # - All Dependabot PRs target `next` so they pool with every other
20
- # contributor change and batch into the next release.
21
- # - `dependabot-auto-merge.yml` (in this same folder) auto-merges
22
- # patch/minor bumps into `next` after CI passes — zero-touch pooling.
23
- # Delete that workflow if you'd rather review each bump by hand.
24
- # - Security updates are detected by `hotfix-redirector.yml`
25
- # (release-flow-v4/) by GHSA references in the PR body and auto-promoted
26
- # from `next` → `hotfixes` so they ship via the hotfix lane, not the
27
- # next-batch release. No special routing needed in this config.
28
- #
29
- # Customize per repo:
30
- # - Add or remove `package-ecosystem` blocks for your stack (gomod, pip,
31
- # bundler, gradle, maven, cargo, docker, etc.).
32
- # - Adjust `directory` if your manifests don't live at the repo root.
33
- # - Tighten `open-pull-requests-limit` if Dependabot's noise is too much.
34
- # - Add `allow` / `ignore` rules for specific packages.
35
- # - Add `groups` to bundle related bumps into a single PR.
36
-
37
- version: 2
38
- updates:
39
- # GitHub Actions: keep pinned action SHAs / version tags fresh.
40
- - package-ecosystem: "github-actions"
41
- directory: "/"
42
- target-branch: "next"
43
- schedule:
44
- interval: "weekly"
45
- open-pull-requests-limit: 5
46
- commit-message:
47
- prefix: "deps"
48
- # Grouped PRs cut noise: one PR per (security | patch | minor) bundle
49
- # per week instead of N separate PRs. Security PRs still get retargeted
50
- # to `hotfixes` by hotfix-redirector.yml when GHSA refs appear in the
51
- # body — bundling N GHSA fixes into one PR is fine, the redirector
52
- # only needs one match to retarget.
53
- groups:
54
- security:
55
- applies-to: security-updates
56
- patterns: ["*"]
57
- patch:
58
- applies-to: version-updates
59
- update-types: ["patch"]
60
- minor:
61
- applies-to: version-updates
62
- update-types: ["minor"]
63
-
64
- # NPM: package.json + package-lock.json updates.
65
- # Delete this block if your repo isn't a Node project.
66
- - package-ecosystem: "npm"
67
- directory: "/"
68
- target-branch: "next"
69
- schedule:
70
- interval: "weekly"
71
- open-pull-requests-limit: 5
72
- commit-message:
73
- prefix: "deps"
74
- groups:
75
- # vitest and @vitest/coverage-v8 (and other @vitest/* packages) peer
76
- # each other EXACTLY, so a partial bump (e.g. vitest to 5.0.0 while
77
- # @vitest/coverage-v8 stays 4.1.11) breaks `npm ci` with an ERESOLVE.
78
- # Bump the whole family together in one PR so the exact-peer
79
- # versions never diverge. Must come before security/patch/minor
80
- # below — Dependabot assigns each update to the FIRST matching
81
- # group, and this one has no applies-to restriction so it always
82
- # wins for vitest-family packages regardless of update type.
83
- vitest:
84
- patterns:
85
- - "vitest"
86
- - "@vitest/*"
87
- # @eslint/js peers eslint with a major-locked range ("^10.0.0"), so a
88
- # future eslint major bump without @eslint/js moving too would hit
89
- # the same npm ci ERESOLVE class as the vitest/coverage-v8 split.
90
- # @cldmv/eslint-plugin-jsonv doesn't peer eslint directly but is
91
- # bundled here to keep the lint-config family moving together.
92
- eslint:
93
- patterns:
94
- - "eslint"
95
- - "@eslint/*"
96
- - "@cldmv/eslint-plugin-*"
97
- # @cldmv/prettier-plugin-jsonv peers prettier with a major-locked
98
- # range ("^3.0.0") — same reasoning as the eslint group above.
99
- prettier:
100
- patterns:
101
- - "prettier"
102
- - "@cldmv/prettier-plugin-*"
103
- security:
104
- applies-to: security-updates
105
- patterns: ["*"]
106
- patch:
107
- applies-to: version-updates
108
- update-types: ["patch"]
109
- minor:
110
- applies-to: version-updates
111
- update-types: ["minor"]
@@ -1,44 +0,0 @@
1
- #
2
- # @Project: @cldmv/gh-broker
3
- # @Filename: /.github/workflows/branch-retention.yml
4
- # @Date: 2026-05-20T00:00:00-07:00 (1779260400)
5
- # @Author: Nate Corcoran <CLDMV>
6
- # @Email: <Shinrai@users.noreply.github.com>
7
- # -----
8
- # @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
9
- # @Last modified time: 2026-10-02T11:30:57-07:00 (1790965857)
10
- # -----
11
- # @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
12
- #
13
-
14
- # Individual repo: .github/workflows/branch-retention.yml
15
- #
16
- # On PR merge: most branches deleted immediately; release/* keeps last 5,
17
- # hotfix/* keeps last 3. master/main/badges/gh-pages never touched.
18
- #
19
- # v4 flow: feature PRs merge into `next` and hotfix PRs into `hotfixes`
20
- # (not directly into master). next/hotfixes are in the branches: filter
21
- # below so this workflow fires on those PR closures too — otherwise
22
- # feat/* / fix/* / chore/* etc. would pile up on origin indefinitely.
23
- # (Repos that haven't adopted v4 just won't see those branches; the
24
- # extra entries in the filter are harmless.)
25
- name: 🌿 Branch Retention
26
-
27
- on:
28
- pull_request:
29
- types: [closed]
30
- branches: [master, main, next, hotfixes]
31
-
32
- permissions:
33
- contents: read
34
-
35
- jobs:
36
- retain:
37
- permissions:
38
- contents: write
39
- pull-requests: read
40
- if: github.event.pull_request.merged == true
41
- uses: CLDMV/.github/.github/workflows/reusable-branch-retention.yml@v4
42
- secrets:
43
- BOT_APP_CLIENT_ID: ${{ secrets.CLDMV_BOT_APP_CLIENT_ID }}
44
- BOT_APP_PRIVATE_KEY: ${{ secrets.CLDMV_BOT_APP_PRIVATE_KEY }}
@@ -1,52 +0,0 @@
1
- #
2
- # @Project: @cldmv/gh-broker
3
- # @Filename: /.github/workflows/bundle-size.yml
4
- # @Date: 2026-05-20T00:00:00-07:00 (1779260400)
5
- # @Author: Nate Corcoran <CLDMV>
6
- # @Email: <Shinrai@users.noreply.github.com>
7
- # -----
8
- # @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
9
- # @Last modified time: 2026-10-02T11:30:57-07:00 (1790965857)
10
- # -----
11
- # @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
12
- #
13
-
14
- # Individual repo: .github/workflows/bundle-size.yml
15
- #
16
- # Only relevant for runtime libraries where bundle size matters (e.g.
17
- # @cldmv/slothlet). Skip this template for tool repos / meta repos.
18
- #
19
- # Fork-PR caveat: builds PR-supplied code, so we use `pull_request`
20
- # (NOT pull_request_target). Fork builds run safely without secrets;
21
- # comment posting fails for fork PRs because the token is read-only.
22
- # Maintainer can run via workflow_dispatch after reviewing the code.
23
- #
24
- # Batch 5.4 from tmp/plan-future-workflows.md.
25
- name: 📊 Bundle Size
26
-
27
- on:
28
- pull_request:
29
- types: [opened, synchronize, reopened, ready_for_review]
30
- branches: [master, main]
31
- workflow_dispatch:
32
-
33
- permissions:
34
- contents: read
35
- pull-requests: write
36
-
37
- jobs:
38
- diff:
39
- uses: CLDMV/.github/.github/workflows/reusable-bundle-size.yml@v4
40
- with:
41
- build_command: "npm run build:ci"
42
- dist_paths: "dist/**"
43
- # warning_pct: 5
44
- # warning_bytes: 500
45
- # comment_mode: "update"
46
- # Optional. Without these, the size-diff comment is posted by
47
- # github-actions[bot]. With these, it's posted by your CLDMV bot App.
48
- # Note: fork PRs can't access org secrets, so the bot attribution only
49
- # applies to same-repo PRs; fork PRs fall back to GITHUB_TOKEN.
50
- secrets:
51
- BOT_APP_CLIENT_ID: ${{ secrets.CLDMV_BOT_APP_CLIENT_ID }}
52
- BOT_APP_PRIVATE_KEY: ${{ secrets.CLDMV_BOT_APP_PRIVATE_KEY }}