@paysdoc/devplatform 1.0.0 → 1.1.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 +58 -13
- package/dist/git/branchOps.d.ts +5 -3
- package/dist/git/branchOps.d.ts.map +1 -1
- package/dist/git/branchOps.js +5 -3
- package/dist/git/branchOps.js.map +1 -1
- package/dist/git/commitOps.d.ts +5 -1
- package/dist/git/commitOps.d.ts.map +1 -1
- package/dist/git/commitOps.js +5 -1
- package/dist/git/commitOps.js.map +1 -1
- package/dist/git/index.d.ts +24 -11
- package/dist/git/index.d.ts.map +1 -1
- package/dist/git/index.js +24 -11
- package/dist/git/index.js.map +1 -1
- package/dist/git/literalTokenProvider.d.ts +26 -0
- package/dist/git/literalTokenProvider.d.ts.map +1 -0
- package/dist/git/literalTokenProvider.js +12 -0
- package/dist/git/literalTokenProvider.js.map +1 -0
- package/dist/providers/forgeCredentials.d.ts +74 -0
- package/dist/providers/forgeCredentials.d.ts.map +1 -0
- package/dist/providers/forgeCredentials.js +87 -0
- package/dist/providers/forgeCredentials.js.map +1 -0
- package/dist/providers/forgeProviders.d.ts +2 -2
- package/dist/providers/forgeProviders.d.ts.map +1 -1
- package/dist/providers/forgeProviders.js +3 -3
- package/dist/providers/forgeProviders.js.map +1 -1
- package/dist/providers/github/ghRepoApi.d.ts +6 -4
- package/dist/providers/github/ghRepoApi.d.ts.map +1 -1
- package/dist/providers/github/ghRepoApi.js +6 -4
- package/dist/providers/github/ghRepoApi.js.map +1 -1
- package/dist/providers/github/githubIdentity.d.ts +15 -0
- package/dist/providers/github/githubIdentity.d.ts.map +1 -1
- package/dist/providers/github/githubIdentity.js +19 -3
- package/dist/providers/github/githubIdentity.js.map +1 -1
- package/dist/providers/github/githubTokenProvider.d.ts +5 -4
- package/dist/providers/github/githubTokenProvider.d.ts.map +1 -1
- package/dist/providers/github/githubTokenProvider.js +5 -10
- package/dist/providers/github/githubTokenProvider.js.map +1 -1
- package/dist/providers/github/index.d.ts +10 -0
- package/dist/providers/github/index.d.ts.map +1 -1
- package/dist/providers/github/index.js +14 -0
- package/dist/providers/github/index.js.map +1 -1
- package/dist/providers/gitlab/gitlabIdentity.d.ts +29 -0
- package/dist/providers/gitlab/gitlabIdentity.d.ts.map +1 -0
- package/dist/providers/gitlab/gitlabIdentity.js +38 -0
- package/dist/providers/gitlab/gitlabIdentity.js.map +1 -0
- package/dist/providers/gitlab/gitlabTokenProvider.d.ts +20 -0
- package/dist/providers/gitlab/gitlabTokenProvider.d.ts.map +1 -0
- package/dist/providers/gitlab/gitlabTokenProvider.js +28 -0
- package/dist/providers/gitlab/gitlabTokenProvider.js.map +1 -0
- package/dist/providers/index.d.ts +1 -0
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +1 -0
- package/dist/providers/index.js.map +1 -1
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -17,30 +17,47 @@ The package ships three entry points:
|
|
|
17
17
|
|
|
18
18
|
```ts
|
|
19
19
|
import { BoardStatus, type Issue, type RepoContext } from '@paysdoc/devplatform'; // forge ports + domain model
|
|
20
|
-
import { forgeProviders } from '@paysdoc/devplatform/providers';
|
|
20
|
+
import { forgeProviders, createForgeCredentials } from '@paysdoc/devplatform/providers'; // adapter assembly + GitHub/GitLab/Jira adapters
|
|
21
21
|
import { GitContext, consoleLogger } from '@paysdoc/devplatform/git'; // forge-neutral git/worktree core
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
+
A launch boundary obtains its `TokenProvider` and bootstrap `GitIdentity` from the forge name
|
|
25
|
+
alone, then hands both straight to `GitContext` — no GitHub- or GitLab-named import required:
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import { Platform } from '@paysdoc/devplatform';
|
|
29
|
+
|
|
30
|
+
const { tokenProvider, gitIdentity } = createForgeCredentials({
|
|
31
|
+
forge: { codeHost: 'github', issueTracker: 'github' },
|
|
32
|
+
identity: { owner: 'acme', repo: 'webapp', platform: Platform.GitHub },
|
|
33
|
+
deps: { github: { appConfig: null, pat: process.env.GH_TOKEN } },
|
|
34
|
+
});
|
|
35
|
+
const gitContext = new GitContext({ owner: 'acme', repo: 'webapp', selfHost: false, gitIdentity, tokenProvider, frameworkRepoRoot, targetReposDir });
|
|
36
|
+
```
|
|
37
|
+
|
|
24
38
|
## What it does
|
|
25
39
|
|
|
26
40
|
- **Forge-neutral git executor** — `GitContext.exec()` is the single spawn site, env merge, cwd resolution, and ENOENT rewrap for every git command; no forge semantics leak into it.
|
|
27
41
|
- **Identity-bound context construction** — a `GitContext` is built from a mandatory owner/repo/selfHost/tokenProvider/gitIdentity; incomplete identity fails at construction rather than at first use.
|
|
28
42
|
- **Worktree lifecycle management** — create/ensure, list, remove, probe (health: `healthy`/`locked`/`prunable`/`missing`), and reset (takeover) operations for git worktrees under `.worktrees/`.
|
|
29
|
-
- **Branch, commit, and remote operations** — branch creation/switching, commits, and remote push/fetch helpers layered on the shared executor.
|
|
43
|
+
- **Branch, commit, and remote operations** — branch creation/switching, commits, and remote push/fetch helpers layered on the shared executor; `commitOps`, `branchOps`, and `isLeaseRejection` ship from `@paysdoc/devplatform/git` since issue #11, for a consumer that wants to drive them directly.
|
|
30
44
|
- **Working-directory guard** — turns a spawn ENOENT caused by a missing cwd into a diagnostic naming the path and repo identity, keyed off the OS-independent error `code`.
|
|
31
45
|
- **Distributed-lock claim primitives** — detached-worktree add/remove, empty-commit nonce marking, and a never-forced push used to implement an atomic winner/loser election (e.g. for upgrade claims).
|
|
32
46
|
- **Process cleanup** — kills processes still running inside a worktree directory before it is removed.
|
|
33
47
|
- **Pluggable credential and logging ports** — `TokenProvider` (credential-purpose-scoped) and `Logger` ports let a consumer supply auth and logging without the core depending on either.
|
|
34
48
|
- **Bootstrap-only git reads** — a narrow, structurally-exempt set of pre-context reads (origin remote URL, env/git-config identity) for use before a full `GitContext` exists.
|
|
35
49
|
- **Forge-neutral provider interfaces** — `IssueTracker`, `CodeHost`, and `BoardManager` ports abstract issue tracking, PR/code hosting, and project boards across platforms.
|
|
50
|
+
- **Workspace validation helpers** — `validateWorkingDirectory` and `parseOwnerRepoFromUrl` ship from `@paysdoc/devplatform/providers` for cross-adapter cwd/remote-URL checks shared by GitHub, GitLab, and Jira.
|
|
36
51
|
- **`forgeProviders()` assembly function** — binds one `RepoIdentifier` to a full provider triple, validating identity, token provider shape, and context binding before constructing any adapter; rejects unknown or wrong-port forge names via `UnknownForgeError`.
|
|
37
|
-
-
|
|
52
|
+
- **`createForgeCredentials()` forge-keyed credential factory** — resolves a `TokenProvider` and a bootstrap `GitIdentity` from `forge.codeHost` alone, the way `forgeProviders()` resolves the tracker/code-host/board: GitHub dispatches through the App-installation-token → PAT → `gh auth token` chain plus the App-bot identity; GitLab serves its configured token for both credential purposes plus an environment/git-config identity; an unknown code host is refused via `UnknownForgeError` before any credential seam is touched. `createLiteralTokenProvider` — a fixed-string `TokenProvider` for tests and fixtures — ships from `@paysdoc/devplatform/git` (re-exported from the GitHub adapter for backwards compatibility).
|
|
53
|
+
- **GitHub adapter** — issue tracker, code host, and Projects V2 board manager built on the `gh` CLI, including issue/PR read and write operations, label management, GitHub App authentication, and token resolution. Since issue #11, its credential/identity helpers (`createGitHubTokenProvider`, `resolveBootstrapGitIdentity`, `resolveContextToken`, `ghAuthToken`, `isGitHubAppConfigured`, `getInstallationToken`) and the bound `createGhRepoApi` view ship from `@paysdoc/devplatform/providers` too, for a consumer switching over with no behaviour change — `createForgeCredentials` remains the recommended, forge-neutral route that composes exactly those functions.
|
|
38
54
|
- **GitLab adapter** — code host implementation backed by a `curl`-based API client with injected configuration (no environment reads).
|
|
39
55
|
- **Jira adapter** — issue tracker backed by the Jira REST API v3, including Markdown ↔ Atlassian Document Format (ADF) conversion.
|
|
40
56
|
- **Board status model** — a canonical, ordered set of board columns (`Blocked`/`Todo`/`In Progress`/`Review`/`Done`) with colors and descriptions shared across board-capable adapters.
|
|
41
57
|
- **Injected configuration everywhere** — GitLab, Jira, and GitHub App adapters take configuration as constructor arguments; none reads `process.env` or files directly, keeping the library embeddable in any host.
|
|
42
58
|
- **Compiled ESM + type declarations** — `bun run build` emits `dist/**/*.js` and `dist/**/*.d.ts` via `tsc`, with a three-entry-point `exports` map (`.`, `./providers`, `./git`) and a `files` allow-list so `npm pack` ships only `dist/`, `README.md`, and `LICENSE`.
|
|
43
|
-
- **
|
|
59
|
+
- **Cucumber/Gherkin BDD suite** — `bun run test:e2e` runs `cucumber-js` over per-issue `.feature` files under `features/per-issue/`, backed by step definitions and a shared Cucumber world/support layer, with promoted, reusable phrases tracked in `features/regression/vocabulary.md`. A `@packaging` subset packs the real tarball into a clean consumer and proves a name resolves both at runtime and in the emitted `.d.ts`.
|
|
60
|
+
- **CI type-check, git/gh guard, unit-test, BDD, and package gate** — GitHub Actions runs `bun install`, `bun run typecheck`, `bun run lint:git-guard`, `bun run test:unit`, and the hermetic (`not @packaging`) BDD scenarios on every PR and push to `main`, plus a second job that builds, packs, smoke-tests the tarball under both Node and Bun, and runs the `@packaging` BDD scenarios against it.
|
|
44
61
|
- **Automated releases via semantic-release** — a `Release` GitHub Actions job runs semantic-release on every push to `main`, using a commit parser that accepts an optional `<agent-name>: ` prefix before the conventional type (`build-agent: feat: …` → minor, `review-patch-agent: fix: …` → patch, `plan-orchestrator: chore: …` → no release), a PR `release-dry-run` job that prints the computed next version before merge, and npm OIDC trusted publishing with an `NPM_TOKEN` fallback.
|
|
45
62
|
- **Git/gh CI guard** — an AST-based check (`bun run lint:git-guard`, `scripts/checkGitGhGuard.ts` + `scripts/guard/`) that fails CI on a direct `git`/`gh` shell-out outside `src/git/` and `src/providers/github/` (the two structurally-exempt packages), or on ad-hoc provider/`GitContext` construction anywhere outside the one-entry `src/providers/forgeProviders.ts` allowlist.
|
|
46
63
|
- **Claude Code agent guardrails** — a hooked `.claude/settings.json` and `.claude/hooks/*` scripts (pre/post-tool-use, notification, stop, subagent-stop) constrain and observe agent tool use in this repo.
|
|
@@ -48,11 +65,18 @@ import { GitContext, consoleLogger } from '@paysdoc/devplatform/git';
|
|
|
48
65
|
## Setup
|
|
49
66
|
|
|
50
67
|
1. Install dependencies: `bun install`
|
|
51
|
-
2.
|
|
52
|
-
3.
|
|
53
|
-
4. Run the
|
|
68
|
+
2. Type-check: `bun run typecheck`
|
|
69
|
+
3. Run the unit test suite: `bun run test:unit`
|
|
70
|
+
4. Run the BDD scenario suite: `bun run test:e2e`
|
|
54
71
|
5. Build: `bun run build`
|
|
55
72
|
|
|
73
|
+
This package takes all forge configuration (tokens, App credentials, GitLab/Jira settings) as
|
|
74
|
+
constructor arguments from the consumer — it reads no `.env` file and no `process.env` value as
|
|
75
|
+
its primary configuration path. There is no root `.env.sample` to copy for using the library
|
|
76
|
+
itself; the optional `GIT_AUTHOR_*`/`GITHUB_APP_*` environment fallbacks used only by the
|
|
77
|
+
bootstrap-identity readers are documented in `app_docs/git-worktree-core.md` and
|
|
78
|
+
`app_docs/github-provider.md`.
|
|
79
|
+
|
|
56
80
|
## Releasing
|
|
57
81
|
|
|
58
82
|
Releases are computed by [semantic-release](https://semantic-release.gitbook.io/) from commit messages on
|
|
@@ -77,6 +101,15 @@ back to an `NPM_TOKEN` secret if one is present. The release baseline is the `v1
|
|
|
77
101
|
of the first manually published version; the release workflow hard-fails if that tag is not reachable, so it
|
|
78
102
|
can never recompute or republish `1.0.0`.
|
|
79
103
|
|
|
104
|
+
The npm trusted publisher for `@paysdoc/devplatform` must be linked to this exact GitHub Actions workflow
|
|
105
|
+
(owner `paysdoc`, repository `devplatform`, workflow filename `release.yml`, no environment), and the
|
|
106
|
+
package's Publishing access setting must permit trusted publishing. If the OIDC token exchange succeeds but
|
|
107
|
+
the publish itself is still denied (`403 … OIDC permission denied for this action`), add an `NPM_TOKEN`
|
|
108
|
+
repository secret as a fallback — `@semantic-release/npm` prefers it over OIDC when both are present. A run
|
|
109
|
+
that tags a version and then fails to publish it leaves an orphan tag that a re-run will not republish (no
|
|
110
|
+
new commits exist after the tag); delete the orphan tag and any GitHub release it created, then trigger the
|
|
111
|
+
workflow again — never delete `v1.0.0`.
|
|
112
|
+
|
|
80
113
|
## Domain glossary
|
|
81
114
|
|
|
82
115
|
See [UBIQUITOUS_LANGUAGE.md](./UBIQUITOUS_LANGUAGE.md) for the canonical terms used across this codebase (identity, forge, provider, worktree, etc.).
|
|
@@ -91,30 +124,42 @@ See [UBIQUITOUS_LANGUAGE.md](./UBIQUITOUS_LANGUAGE.md) for the canonical terms u
|
|
|
91
124
|
hooks/ Claude Code lifecycle hooks (pre/post-tool-use, notification, stop, subagent-stop)
|
|
92
125
|
skills/ Agent skills (TDD, PRD authoring, architecture review, ubiquitous language, ...)
|
|
93
126
|
settings.json Agent permission/guardrail configuration
|
|
127
|
+
bun.lock Bun lockfile
|
|
94
128
|
.github/
|
|
95
129
|
workflows/ci.yml Typecheck + git/gh guard + unit test CI gate, build/pack/smoke-test package gate, and a PR-only release-dry-run job
|
|
96
130
|
workflows/release.yml Release automation: semantic-release on push to main (v1.0.0 baseline guard, OIDC + NPM_TOKEN fallback)
|
|
97
131
|
adw.yml ADW guardrails toggle (outside .adw/, survives regeneration)
|
|
98
132
|
app_docs/ Per-module documentation owned by conditional_docs.md routing (ADW-generated)
|
|
99
133
|
UBIQUITOUS_LANGUAGE.md Canonical domain glossary
|
|
100
|
-
|
|
101
|
-
|
|
134
|
+
LICENSE Package license
|
|
135
|
+
package.json Package manifest: entry-point exports map, files allow-list, scripts
|
|
136
|
+
cucumber.js Cucumber/BDD runner configuration (loads tsx, points at features/)
|
|
137
|
+
features/
|
|
138
|
+
per-issue/ Per-issue Gherkin feature files (e.g. feature-9.feature), tagged @adw-<issue>
|
|
139
|
+
regression/vocabulary.md Regression test vocabulary (promoted, reusable Given/When/Then phrases)
|
|
140
|
+
step_definitions/ Cucumber step definitions wiring Gherkin steps to the library's public surface
|
|
141
|
+
support/ Shared Cucumber world/support code (packagedConsumer helper, world.ts)
|
|
142
|
+
logs/<session-id>/ Claude Code hook session logs (chat, pre/post-tool-use, stop transcripts)
|
|
143
|
+
specs/ Per-issue implementation plans (ADW-generated), plus specs/patch/ for patch plans
|
|
102
144
|
release.config.js semantic-release configuration: agent-prefix-aware commit parser, branches, plugin list
|
|
103
145
|
scripts/
|
|
104
|
-
smokePackage.ts Builds, packs, and smoke-tests the tarball under Node + Bun (`bun run smoke:package`)
|
|
146
|
+
smokePackage.ts Builds, packs, and smoke-tests the tarball under Node + Bun via a table-driven dynamic-import key check (`bun run smoke:package`)
|
|
105
147
|
releaseDryRun.ts Runs `semantic-release --dry-run` and prints the computed next version (`bun run release:dry-run`)
|
|
106
148
|
checkGitGhGuard.ts CI git/gh guard entry point (`bun run lint:git-guard`) — dev-only, excluded from dist/
|
|
107
149
|
guard/ Guard rule modules: shell-out exempt-package set, construction allowlist, stdout report
|
|
108
150
|
src/
|
|
109
151
|
index.ts Root entry point ("."): forge ports + domain model only
|
|
110
152
|
__tests__/ Import-graph, package-exports, and release-config contract tests
|
|
111
|
-
git/ Forge-neutral git/worktree core (GitContext, worktree ops, bootstrap identity, process cleanup) — entry point "./git"
|
|
153
|
+
git/ Forge-neutral git/worktree core (GitContext, worktree ops, bootstrap identity, process cleanup) — entry point "./git"; also re-exports commitOps/branchOps/isLeaseRejection since issue #11
|
|
154
|
+
literalTokenProvider.ts Fixed-string TokenProvider for tests/fixtures (re-exported from the GitHub adapter)
|
|
112
155
|
providers/ Forge provider ports and adapters — entry point "./providers"
|
|
113
|
-
github/ GitHub adapter (issue tracker, code host, board manager, App auth, gh CLI commands)
|
|
114
|
-
gitlab/ GitLab adapter (API client, code host, type mappers)
|
|
156
|
+
github/ GitHub adapter (issue tracker, code host, board manager, App auth, gh CLI commands); its credential/identity helpers and createGhRepoApi are re-exported on this barrel since issue #11
|
|
157
|
+
gitlab/ GitLab adapter (API client, code host, type mappers, adapter-internal token provider + bootstrap identity)
|
|
115
158
|
jira/ Jira adapter (API client, issue tracker, ADF converter)
|
|
116
159
|
forgeProviders.ts Provider assembly function
|
|
160
|
+
forgeCredentials.ts Forge-keyed credential factory (TokenProvider + bootstrap GitIdentity)
|
|
117
161
|
types.ts Platform-agnostic provider interfaces
|
|
162
|
+
workspaceValidation.ts Cross-adapter cwd/remote-URL validation helpers
|
|
118
163
|
dist/ Build output (gitignored) — emitted by `bun run build`
|
|
119
164
|
tsconfig.json TypeScript strict-mode configuration (NodeNext modules/resolution)
|
|
120
165
|
tsconfig.build.json Build config: extends tsconfig.json, emits dist/**/*.js + dist/**/*.d.ts
|
package/dist/git/branchOps.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* Each function takes an injected
|
|
4
|
-
*
|
|
2
|
+
* Branch operation orchestration for GitContext. Exported from the `./git`
|
|
3
|
+
* entry point since issue #11. Each function takes an injected
|
|
4
|
+
* `(cmd, cwd) => string` runner so GitContext methods stay thin and this
|
|
5
|
+
* module is testable without a real context; the `PROTECTED_BRANCHES` guard
|
|
6
|
+
* is unchanged and stays off the public surface.
|
|
5
7
|
*/
|
|
6
8
|
export declare const PROTECTED_BRANCHES: readonly ["main", "master", "develop"];
|
|
7
9
|
type Runner = (command: string, cwd: string) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"branchOps.d.ts","sourceRoot":"","sources":["../../src/git/branchOps.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"branchOps.d.ts","sourceRoot":"","sources":["../../src/git/branchOps.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,kBAAkB,wCAAyC,CAAC;AAEzE,KAAK,MAAM,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;AAMvD,iBAAS,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,iBAAS,4BAA4B,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAY3F;AAED,iBAAS,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAWpF;AAED,iBAAS,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAQ5E;AAED,iBAAS,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAQ7E;AAED;;;GAGG;AACH,iBAAS,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAYzD;AAED,eAAO,MAAM,SAAS;;;;;;;CAOrB,CAAC"}
|
package/dist/git/branchOps.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* Each function takes an injected
|
|
4
|
-
*
|
|
2
|
+
* Branch operation orchestration for GitContext. Exported from the `./git`
|
|
3
|
+
* entry point since issue #11. Each function takes an injected
|
|
4
|
+
* `(cmd, cwd) => string` runner so GitContext methods stay thin and this
|
|
5
|
+
* module is testable without a real context; the `PROTECTED_BRANCHES` guard
|
|
6
|
+
* is unchanged and stays off the public surface.
|
|
5
7
|
*/
|
|
6
8
|
export const PROTECTED_BRANCHES = ['main', 'master', 'develop'];
|
|
7
9
|
function isProtected(branch) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"branchOps.js","sourceRoot":"","sources":["../../src/git/branchOps.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"branchOps.js","sourceRoot":"","sources":["../../src/git/branchOps.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAU,C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
* `./git` entry point since issue #11 — alongside `isLeaseRejection` — so ADW's
|
|
4
|
+
* regression steps can drive it directly with their own runner. Every function
|
|
5
|
+
* still takes an injected `(command, cwd) => string` runner; nothing here
|
|
6
|
+
* spawns a process itself.
|
|
3
7
|
*/
|
|
4
8
|
type Runner = (command: string, cwd: string) => string;
|
|
5
9
|
export declare function isLeaseRejection(error: unknown): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commitOps.d.ts","sourceRoot":"","sources":["../../src/git/commitOps.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"commitOps.d.ts","sourceRoot":"","sources":["../../src/git/commitOps.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,KAAK,MAAM,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;AAIvD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAMxD;AAkDD,iBAAS,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;IAAE,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAAG,OAAO,CAOtH;AAED;;;;;GAKG;AACH,iBAAS,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAQ1G;AAED;;;;;GAKG;AACH,iBAAS,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAQvG;AAED,iBAAS,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAclE;AAED,iBAAS,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,iBAAS,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAEhE;AAED,eAAO,MAAM,SAAS;;;;;;;CAOrB,CAAC"}
|
package/dist/git/commitOps.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Commit/push operation orchestration for GitContext. Exported from the
|
|
3
|
+
* `./git` entry point since issue #11 — alongside `isLeaseRejection` — so ADW's
|
|
4
|
+
* regression steps can drive it directly with their own runner. Every function
|
|
5
|
+
* still takes an injected `(command, cwd) => string` runner; nothing here
|
|
6
|
+
* spawns a process itself.
|
|
3
7
|
*/
|
|
4
8
|
export function isLeaseRejection(error) {
|
|
5
9
|
const e = error;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commitOps.js","sourceRoot":"","sources":["../../src/git/commitOps.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"commitOps.js","sourceRoot":"","sources":["../../src/git/commitOps.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,MAAM,CAAC,GAAG,KAAkB,CAAC;IAC7B,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC;SACzC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;SACxC,IAAI,CAAC,IAAI,CAAC,CAAC;IACd,OAAO,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,mCAAmC,CAA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AAG,CAAC,8DAA8D,MAAM,GAAG,EAAE,GAAG,CAAC,CAAC;IACpF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5B,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;QACpD,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,GAAW,EAAE,GAAW;IAC/C,OAAO,GAAG,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAC;AACjD,CAAC;AAED,SAAS,qBAAqB,CAAC,GAAW,EAAE,GAAW;IACrD,OAAO,GAAG,CAAC,wBAAwB,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;AAC9D,CAAC;AAED,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,aAAa;IACb,oBAAoB;IACpB,iBAAiB;IACjB,UAAU;IACV,eAAe;IACf,qBAAqB;CACtB,CAAC"}
|
package/dist/git/index.d.ts
CHANGED
|
@@ -8,19 +8,29 @@
|
|
|
8
8
|
* a forge adapter built on this package implements instead of the core
|
|
9
9
|
* holding a credential — and the `Logger` port (`Logger`/`LogLevel`,
|
|
10
10
|
* defaulting to `consoleLogger`), so the package carries no dependency on
|
|
11
|
-
* the host application's logger.
|
|
12
|
-
* TokenProvider
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* `
|
|
16
|
-
*
|
|
11
|
+
* the host application's logger. Also exports `createLiteralTokenProvider`,
|
|
12
|
+
* a fixed-string TokenProvider for tests and fixtures — the one
|
|
13
|
+
* implementation that lives here rather than in a forge adapter, since it
|
|
14
|
+
* carries no forge logic. Every *production* TokenProvider implementation
|
|
15
|
+
* (`createGitHubTokenProvider`), the gh command-string builders, GitHub App
|
|
16
|
+
* authentication, token resolution, GitHub remote-URL parsing, bot-identity
|
|
17
|
+
* derivation and clone-URL construction all live in the GitHub forge adapter
|
|
18
|
+
* (`src/providers/github/`, #792/#793) and, since issue #11, are themselves
|
|
19
|
+
* re-exported from that adapter's `./index.ts` — reachable from this package's
|
|
20
|
+
* consumers via `@paysdoc/devplatform/providers` — rather than deep-import
|
|
21
|
+
* only. The forge-keyed `createForgeCredentials` factory
|
|
22
|
+
* (`src/providers/forgeCredentials.ts`, issue #9) remains the recommended,
|
|
23
|
+
* forge-neutral way to obtain a production TokenProvider without naming a
|
|
24
|
+
* forge. This git core still never imports from `src/providers/`.
|
|
17
25
|
*
|
|
18
26
|
* Also exports the worktree lifecycle op namespaces (create/remove/query/
|
|
19
|
-
* probe/reset)
|
|
20
|
-
* `
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
27
|
+
* probe/reset), the distributed-lock `claimOps`, the commit/push and branch
|
|
28
|
+
* orchestration namespaces (`commitOps`, `isLeaseRejection`, `branchOps` —
|
|
29
|
+
* exported since issue #11, git-core: runner-injected orchestration with no
|
|
30
|
+
* forge vocabulary), alongside the `repoWorkspace` workspace ops — the full
|
|
31
|
+
* forge-neutral git/worktree surface this package ships (issue #1). None of
|
|
32
|
+
* it imports from `src/providers/`; that boundary is enforced by a committed
|
|
33
|
+
* import-graph test.
|
|
24
34
|
*
|
|
25
35
|
* Bootstrap exceptions (issue #700, narrowed by #793): the functions below
|
|
26
36
|
* are the ONLY legitimate pre-context git reads in the codebase — generic
|
|
@@ -32,8 +42,11 @@
|
|
|
32
42
|
export { GitContext } from './gitContext.js';
|
|
33
43
|
export type { GitIdentity, GitContextOptions, ExecFn, GitContextDeps, FsDeps, ExecWorkingDirectory, ExecOptions, TokenProvider, CredentialPurpose, CredentialRequest, Logger, LogLevel, } from './types.js';
|
|
34
44
|
export { consoleLogger } from './consoleLogger.js';
|
|
45
|
+
export { createLiteralTokenProvider } from './literalTokenProvider.js';
|
|
35
46
|
export { killProcessesInDirectory } from './processCleanup.js';
|
|
36
47
|
export { claimOps } from './claimOps.js';
|
|
48
|
+
export { commitOps, isLeaseRejection } from './commitOps.js';
|
|
49
|
+
export { branchOps } from './branchOps.js';
|
|
37
50
|
export { worktreeCreateOps } from './worktreeCreateOps.js';
|
|
38
51
|
export { worktreeRemoveOps } from './worktreeRemoveOps.js';
|
|
39
52
|
export { worktreeQueryOps } from './worktreeQueryOps.js';
|
package/dist/git/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/git/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/git/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,YAAY,EACV,WAAW,EAAE,iBAAiB,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,oBAAoB,EAAE,WAAW,EACjG,aAAa,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,EAAE,QAAQ,GACtE,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACpE,YAAY,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGvD,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC3H,YAAY,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EACL,0BAA0B,EAC1B,YAAY,EACZ,SAAS,EACT,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/git/index.js
CHANGED
|
@@ -8,19 +8,29 @@
|
|
|
8
8
|
* a forge adapter built on this package implements instead of the core
|
|
9
9
|
* holding a credential — and the `Logger` port (`Logger`/`LogLevel`,
|
|
10
10
|
* defaulting to `consoleLogger`), so the package carries no dependency on
|
|
11
|
-
* the host application's logger.
|
|
12
|
-
* TokenProvider
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* `
|
|
16
|
-
*
|
|
11
|
+
* the host application's logger. Also exports `createLiteralTokenProvider`,
|
|
12
|
+
* a fixed-string TokenProvider for tests and fixtures — the one
|
|
13
|
+
* implementation that lives here rather than in a forge adapter, since it
|
|
14
|
+
* carries no forge logic. Every *production* TokenProvider implementation
|
|
15
|
+
* (`createGitHubTokenProvider`), the gh command-string builders, GitHub App
|
|
16
|
+
* authentication, token resolution, GitHub remote-URL parsing, bot-identity
|
|
17
|
+
* derivation and clone-URL construction all live in the GitHub forge adapter
|
|
18
|
+
* (`src/providers/github/`, #792/#793) and, since issue #11, are themselves
|
|
19
|
+
* re-exported from that adapter's `./index.ts` — reachable from this package's
|
|
20
|
+
* consumers via `@paysdoc/devplatform/providers` — rather than deep-import
|
|
21
|
+
* only. The forge-keyed `createForgeCredentials` factory
|
|
22
|
+
* (`src/providers/forgeCredentials.ts`, issue #9) remains the recommended,
|
|
23
|
+
* forge-neutral way to obtain a production TokenProvider without naming a
|
|
24
|
+
* forge. This git core still never imports from `src/providers/`.
|
|
17
25
|
*
|
|
18
26
|
* Also exports the worktree lifecycle op namespaces (create/remove/query/
|
|
19
|
-
* probe/reset)
|
|
20
|
-
* `
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
27
|
+
* probe/reset), the distributed-lock `claimOps`, the commit/push and branch
|
|
28
|
+
* orchestration namespaces (`commitOps`, `isLeaseRejection`, `branchOps` —
|
|
29
|
+
* exported since issue #11, git-core: runner-injected orchestration with no
|
|
30
|
+
* forge vocabulary), alongside the `repoWorkspace` workspace ops — the full
|
|
31
|
+
* forge-neutral git/worktree surface this package ships (issue #1). None of
|
|
32
|
+
* it imports from `src/providers/`; that boundary is enforced by a committed
|
|
33
|
+
* import-graph test.
|
|
24
34
|
*
|
|
25
35
|
* Bootstrap exceptions (issue #700, narrowed by #793): the functions below
|
|
26
36
|
* are the ONLY legitimate pre-context git reads in the codebase — generic
|
|
@@ -31,8 +41,11 @@
|
|
|
31
41
|
*/
|
|
32
42
|
export { GitContext } from './gitContext.js';
|
|
33
43
|
export { consoleLogger } from './consoleLogger.js';
|
|
44
|
+
export { createLiteralTokenProvider } from './literalTokenProvider.js';
|
|
34
45
|
export { killProcessesInDirectory } from './processCleanup.js';
|
|
35
46
|
export { claimOps } from './claimOps.js';
|
|
47
|
+
export { commitOps, isLeaseRejection } from './commitOps.js';
|
|
48
|
+
export { branchOps } from './branchOps.js';
|
|
36
49
|
export { worktreeCreateOps } from './worktreeCreateOps.js';
|
|
37
50
|
export { worktreeRemoveOps } from './worktreeRemoveOps.js';
|
|
38
51
|
export { worktreeQueryOps } from './worktreeQueryOps.js';
|
package/dist/git/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/git/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/git/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAK7C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAKzD,0FAA0F;AAC1F,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAE3H,OAAO,EACL,0BAA0B,EAC1B,YAAY,EACZ,SAAS,EACT,mBAAmB,GACpB,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A fixed-string TokenProvider — for tests and fixtures, never a production
|
|
3
|
+
* credential source (production boundaries build a provider through
|
|
4
|
+
* `createForgeCredentials`, `src/providers/forgeCredentials.ts`).
|
|
5
|
+
*
|
|
6
|
+
* Lives in the git core rather than an adapter: it carries no forge *logic* —
|
|
7
|
+
* no resolution order, no App/PAT/CLI chain — only a literal echo, and the
|
|
8
|
+
* core's own tests need it (six suites under `src/git/__tests__/` construct a
|
|
9
|
+
* `GitContext` and need some `TokenProvider`). `src/providers/github/githubTokenProvider.ts`
|
|
10
|
+
* re-exports this same function so no import outside `src/git/__tests__/` had
|
|
11
|
+
* to move.
|
|
12
|
+
*
|
|
13
|
+
* The overlay key stays `GH_TOKEN` — a relocation, not a behaviour change:
|
|
14
|
+
* every fixture in this repository and in ADW asserts that key. Per
|
|
15
|
+
* `./types.js`'s `TokenProvider` docblock, a production provider keeps the
|
|
16
|
+
* credential variable's *name* on the adapter side of the port; this fixture
|
|
17
|
+
* is the one deliberate, documented exception, grandfathered in by the shape
|
|
18
|
+
* every existing test already depends on.
|
|
19
|
+
*/
|
|
20
|
+
import type { TokenProvider } from './types.js';
|
|
21
|
+
/**
|
|
22
|
+
* A TokenProvider that serves a fixed credential — `alternateIdentityPat`
|
|
23
|
+
* (when given) for `'alternateIdentity'` requests, `token` otherwise.
|
|
24
|
+
*/
|
|
25
|
+
export declare function createLiteralTokenProvider(token: string, alternateIdentityPat?: string): TokenProvider;
|
|
26
|
+
//# sourceMappingURL=literalTokenProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"literalTokenProvider.d.ts","sourceRoot":"","sources":["../../src/git/literalTokenProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAqB,aAAa,EAAE,MAAM,YAAY,CAAC;AAEnE;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,EAAE,oBAAoB,CAAC,EAAE,MAAM,GAAG,aAAa,CAMtG"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A TokenProvider that serves a fixed credential — `alternateIdentityPat`
|
|
3
|
+
* (when given) for `'alternateIdentity'` requests, `token` otherwise.
|
|
4
|
+
*/
|
|
5
|
+
export function createLiteralTokenProvider(token, alternateIdentityPat) {
|
|
6
|
+
return {
|
|
7
|
+
credentialEnv({ purpose }) {
|
|
8
|
+
return { GH_TOKEN: (purpose === 'alternateIdentity' && alternateIdentityPat) ? alternateIdentityPat : token };
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=literalTokenProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"literalTokenProvider.js","sourceRoot":"","sources":["../../src/git/literalTokenProvider.ts"],"names":[],"mappings":"AAqBA;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CAAC,KAAa,EAAE,oBAA6B;IACrF,OAAO;QACL,aAAa,CAAC,EAAE,OAAO,EAAqB;YAC1C,OAAO,EAAE,QAAQ,EAAE,CAAC,OAAO,KAAK,mBAAmB,IAAI,oBAAoB,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;QAChH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* createForgeCredentials() — the forge-keyed credential factory (issue #9),
|
|
3
|
+
* a sibling of `forgeProviders()`. Resolves a `TokenProvider` and a
|
|
4
|
+
* bootstrap `GitIdentity` from a forge name alone, dispatching on
|
|
5
|
+
* `forge.codeHost` the same way `forgeProviders()` dispatches for the
|
|
6
|
+
* tracker, code host and board — the consumer never names GitHub or GitLab.
|
|
7
|
+
*
|
|
8
|
+
* Since issue #11, the GitHub barrel also re-exports the GitHub-named helpers
|
|
9
|
+
* that build these values (`createGitHubTokenProvider`, `resolveContextToken`,
|
|
10
|
+
* `getInstallationToken`, `isGitHubAppConfigured`, `resolveBootstrapGitIdentity`,
|
|
11
|
+
* `ghAuthToken`) so ADW's launch boundary can switch over to the published
|
|
12
|
+
* package with no behaviour change. This factory remains the forge-neutral,
|
|
13
|
+
* recommended route — it composes exactly those functions — and still
|
|
14
|
+
* re-exports only the `GitHubAppConfig`/`AppAuthDeps` *types*: the GitHub
|
|
15
|
+
* barrel must not re-export them too, or `src/providers/index.ts`'s `export *`
|
|
16
|
+
* over both barrels would collide (TS2308).
|
|
17
|
+
*
|
|
18
|
+
* Side-effect contract: construction never resolves a token — the returned
|
|
19
|
+
* `TokenProvider` resolves per `credentialEnv` call, unmemoised, exactly as
|
|
20
|
+
* `createGitHubTokenProvider`/`createGitLabTokenProvider` do on their own
|
|
21
|
+
* (the only cache on the path is `appAuth.ts`'s expiry-aware
|
|
22
|
+
* installation-token cache). Construction DOES perform the bootstrap
|
|
23
|
+
* identity reads (environment, then `git config` when needed) eagerly,
|
|
24
|
+
* exactly as `resolveBootstrapGitIdentity`/`resolveGitLabBootstrapGitIdentity`
|
|
25
|
+
* do today.
|
|
26
|
+
*/
|
|
27
|
+
import type { GitIdentity, TokenProvider } from '../git/types.js';
|
|
28
|
+
import type { GitConfigIdentityDeps } from '../git/bootstrapIdentity.js';
|
|
29
|
+
import { type RepoIdentifier } from './types.js';
|
|
30
|
+
import { type ForgeSelection } from './forgeProviders.js';
|
|
31
|
+
import type { GitHubAppConfig, AppAuthDeps } from './github/appAuth.js';
|
|
32
|
+
import type { GitLabConfig } from './gitlab/gitlabApiClient.js';
|
|
33
|
+
export type { GitHubAppConfig, AppAuthDeps };
|
|
34
|
+
/** What the launch boundary currently injects by hand for the GitHub branch. */
|
|
35
|
+
export interface GitHubCredentialDeps {
|
|
36
|
+
/** Already resolved from the environment by the caller — never re-read here. */
|
|
37
|
+
readonly appConfig: GitHubAppConfig | null;
|
|
38
|
+
readonly pat?: string;
|
|
39
|
+
readonly alternateIdentityPat?: string;
|
|
40
|
+
/** Test seam; production default is the adapter's `gh auth token` reader. */
|
|
41
|
+
readonly ghAuthToken?: () => string;
|
|
42
|
+
readonly env?: NodeJS.ProcessEnv;
|
|
43
|
+
readonly exec?: GitConfigIdentityDeps['exec'];
|
|
44
|
+
/** The `runCurl`/`apiBaseUrl` transport seam of `getInstallationToken`; production default is real curl against `api.github.com`. */
|
|
45
|
+
readonly appAuth?: AppAuthDeps;
|
|
46
|
+
}
|
|
47
|
+
/** Mirrors `ForgeProviderDeps`: forge-neutral seams at the top, one per-forge bag each. */
|
|
48
|
+
export interface ForgeCredentialDeps {
|
|
49
|
+
/** Forge-neutral bootstrap-identity seam, applies to whichever code host is selected. Overridden by `github.env` when both are given. */
|
|
50
|
+
readonly env?: NodeJS.ProcessEnv;
|
|
51
|
+
/** Forge-neutral bootstrap-identity seam. Overridden by `github.exec` when both are given. */
|
|
52
|
+
readonly exec?: GitConfigIdentityDeps['exec'];
|
|
53
|
+
readonly github?: GitHubCredentialDeps;
|
|
54
|
+
/** Required when `forge.codeHost === 'gitlab'`. */
|
|
55
|
+
readonly gitlab?: GitLabConfig;
|
|
56
|
+
}
|
|
57
|
+
export interface ForgeCredentialsOptions {
|
|
58
|
+
readonly forge: ForgeSelection;
|
|
59
|
+
readonly identity: RepoIdentifier;
|
|
60
|
+
readonly deps?: ForgeCredentialDeps;
|
|
61
|
+
}
|
|
62
|
+
export type ForgeCredentials = Readonly<{
|
|
63
|
+
tokenProvider: TokenProvider;
|
|
64
|
+
gitIdentity: GitIdentity;
|
|
65
|
+
}>;
|
|
66
|
+
/**
|
|
67
|
+
* Builds the one `{ tokenProvider, gitIdentity }` pair for `identity`. Guard
|
|
68
|
+
* clauses run in `forgeProviders()`'s order — identity, then the code host
|
|
69
|
+
* — entirely before any credential source is touched, so a refusal never
|
|
70
|
+
* partially resolves a token. Only the code host is validated; the tracker
|
|
71
|
+
* selection is irrelevant to credentials.
|
|
72
|
+
*/
|
|
73
|
+
export declare function createForgeCredentials(options: ForgeCredentialsOptions): ForgeCredentials;
|
|
74
|
+
//# sourceMappingURL=forgeCredentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":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AAQ,CAAC,MAAM,CAAC,EAAE,oBAAoB,CAAC;IACvC,mDAAmD;IACnD,QAAQ,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC;CAChC;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,IAAI,CAAC,EAAE,mBAAmB,CAAC;CACrC;AAED,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IACtC,aAAa,EAAE,aAAa,CAAC;IAC7B,WAAW,EAAE,WAAW,CAAC;CAC1B,CAAC,CAAC;AA2CH;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,uBAAuB,GAAG,gBAAgB,CAczF"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* createForgeCredentials() — the forge-keyed credential factory (issue #9),
|
|
3
|
+
* a sibling of `forgeProviders()`. Resolves a `TokenProvider` and a
|
|
4
|
+
* bootstrap `GitIdentity` from a forge name alone, dispatching on
|
|
5
|
+
* `forge.codeHost` the same way `forgeProviders()` dispatches for the
|
|
6
|
+
* tracker, code host and board — the consumer never names GitHub or GitLab.
|
|
7
|
+
*
|
|
8
|
+
* Since issue #11, the GitHub barrel also re-exports the GitHub-named helpers
|
|
9
|
+
* that build these values (`createGitHubTokenProvider`, `resolveContextToken`,
|
|
10
|
+
* `getInstallationToken`, `isGitHubAppConfigured`, `resolveBootstrapGitIdentity`,
|
|
11
|
+
* `ghAuthToken`) so ADW's launch boundary can switch over to the published
|
|
12
|
+
* package with no behaviour change. This factory remains the forge-neutral,
|
|
13
|
+
* recommended route — it composes exactly those functions — and still
|
|
14
|
+
* re-exports only the `GitHubAppConfig`/`AppAuthDeps` *types*: the GitHub
|
|
15
|
+
* barrel must not re-export them too, or `src/providers/index.ts`'s `export *`
|
|
16
|
+
* over both barrels would collide (TS2308).
|
|
17
|
+
*
|
|
18
|
+
* Side-effect contract: construction never resolves a token — the returned
|
|
19
|
+
* `TokenProvider` resolves per `credentialEnv` call, unmemoised, exactly as
|
|
20
|
+
* `createGitHubTokenProvider`/`createGitLabTokenProvider` do on their own
|
|
21
|
+
* (the only cache on the path is `appAuth.ts`'s expiry-aware
|
|
22
|
+
* installation-token cache). Construction DOES perform the bootstrap
|
|
23
|
+
* identity reads (environment, then `git config` when needed) eagerly,
|
|
24
|
+
* exactly as `resolveBootstrapGitIdentity`/`resolveGitLabBootstrapGitIdentity`
|
|
25
|
+
* do today.
|
|
26
|
+
*/
|
|
27
|
+
import { validateRepoIdentifier } from './types.js';
|
|
28
|
+
import { CODE_HOST_FORGES, isCodeHostForge, UnknownForgeError } from './forgeProviders.js';
|
|
29
|
+
import { createGitHubTokenProvider } from './github/githubTokenProvider.js';
|
|
30
|
+
import { resolveBootstrapGitIdentity } from './github/githubIdentity.js';
|
|
31
|
+
import { isGitHubAppConfigured, getInstallationToken } from './github/appAuth.js';
|
|
32
|
+
import { ghAuthToken as defaultGhAuthToken } from './github/ghAuthToken.js';
|
|
33
|
+
import { createGitLabTokenProvider } from './gitlab/gitlabTokenProvider.js';
|
|
34
|
+
import { resolveGitLabBootstrapGitIdentity } from './gitlab/gitlabIdentity.js';
|
|
35
|
+
// ---------------------------------------------------------------------------
|
|
36
|
+
// Per-code-host builders
|
|
37
|
+
// ---------------------------------------------------------------------------
|
|
38
|
+
function buildGitHubCredentials(github, topEnv, topExec) {
|
|
39
|
+
const appConfig = github.appConfig;
|
|
40
|
+
const appConfigured = appConfig !== null && isGitHubAppConfigured(appConfig);
|
|
41
|
+
const env = github.env ?? topEnv;
|
|
42
|
+
const exec = github.exec ?? topExec;
|
|
43
|
+
const tokenProvider = createGitHubTokenProvider({
|
|
44
|
+
pat: github.pat,
|
|
45
|
+
alternateIdentityPat: github.alternateIdentityPat,
|
|
46
|
+
isAppConfigured: () => appConfigured,
|
|
47
|
+
mintInstallationToken: (owner, repo) => {
|
|
48
|
+
if (appConfig === null) {
|
|
49
|
+
throw new Error('createForgeCredentials: the GitHub App is not configured, so no installation token can be minted');
|
|
50
|
+
}
|
|
51
|
+
return getInstallationToken(appConfig, owner, repo, github.appAuth);
|
|
52
|
+
},
|
|
53
|
+
ghAuthToken: github.ghAuthToken ?? defaultGhAuthToken,
|
|
54
|
+
});
|
|
55
|
+
const gitIdentity = resolveBootstrapGitIdentity({ env, exec, appConfig });
|
|
56
|
+
return Object.freeze({ tokenProvider, gitIdentity });
|
|
57
|
+
}
|
|
58
|
+
function buildGitLabCredentials(config, topEnv, topExec) {
|
|
59
|
+
if (!config) {
|
|
60
|
+
throw new Error('createForgeCredentials: code host "gitlab" needs deps.gitlab (GitLabConfig)');
|
|
61
|
+
}
|
|
62
|
+
const tokenProvider = createGitLabTokenProvider(config);
|
|
63
|
+
const gitIdentity = resolveGitLabBootstrapGitIdentity({ env: topEnv, exec: topExec });
|
|
64
|
+
return Object.freeze({ tokenProvider, gitIdentity });
|
|
65
|
+
}
|
|
66
|
+
// ---------------------------------------------------------------------------
|
|
67
|
+
// The factory
|
|
68
|
+
// ---------------------------------------------------------------------------
|
|
69
|
+
/**
|
|
70
|
+
* Builds the one `{ tokenProvider, gitIdentity }` pair for `identity`. Guard
|
|
71
|
+
* clauses run in `forgeProviders()`'s order — identity, then the code host
|
|
72
|
+
* — entirely before any credential source is touched, so a refusal never
|
|
73
|
+
* partially resolves a token. Only the code host is validated; the tracker
|
|
74
|
+
* selection is irrelevant to credentials.
|
|
75
|
+
*/
|
|
76
|
+
export function createForgeCredentials(options) {
|
|
77
|
+
const { forge, identity, deps = {} } = options;
|
|
78
|
+
validateRepoIdentifier(identity);
|
|
79
|
+
if (!isCodeHostForge(forge.codeHost)) {
|
|
80
|
+
throw new UnknownForgeError(forge.codeHost, 'code host', CODE_HOST_FORGES, 'createForgeCredentials');
|
|
81
|
+
}
|
|
82
|
+
if (forge.codeHost === 'github') {
|
|
83
|
+
return buildGitHubCredentials(deps.github ?? { appConfig: null }, deps.env, deps.exec);
|
|
84
|
+
}
|
|
85
|
+
return buildGitLabCredentials(deps.gitlab, deps.env, deps.exec);
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=forgeCredentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forgeCredentials.js","sourceRoot":"","sources":["../../src/providers/forgeCredentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAIH,OAAO,EAAuB,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,iBAAiB,EAAuB,MAAM,qBAAqB,CAAC;AAChH,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAElF,OAAO,EAAE,WAAW,IAAI,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,iCAAiC,EAAE,MAAM,4BAA4B,CAAC;AA6C/E,8EAA8E;AAC9E,yBAAyB;AACzB,8EAA8E;AAE9E,SAAS,sBAAsB,CAAC,MAA4B,EAAE,MAAqC,EAAE,OAAkD;IACrJ,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;IACnC,MAAM,aAAa,GAAG,SAAS,KAAK,IAAI,IAAI,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAC7E,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC;IACjC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,IAAI,OAAO,CAAC;IAEpC,MAAM,aAAa,GAAG,yBAAyB,CAAC;QAC9C,GAAG,EAAE,MAAM,CAAC,GAAG;QACf,oBAAoB,EAA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C,eAAe,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,iBAAiB,CAAC,KAAK,CAAC,QAAQ,EAAE,WAAW,EAAE,gBAAgB,EAAE,wBAAwB,CAAC,CAAC;IACvG,CAAC;IAED,IAAI,KAAK,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAChC,OAAO,sBAAsB,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACzF,CAAC;IAED,OAAO,sBAAsB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -58,9 +58,9 @@ export interface ForgeProvidersOptions {
|
|
|
58
58
|
readonly gitContext: GitContext;
|
|
59
59
|
readonly deps?: ForgeProviderDeps;
|
|
60
60
|
}
|
|
61
|
-
/** Thrown by {@link forgeProviders} for a forge name outside the closed union for its port. */
|
|
61
|
+
/** Thrown by {@link forgeProviders} and `createForgeCredentials` for a forge name outside the closed union for its port. */
|
|
62
62
|
export declare class UnknownForgeError extends Error {
|
|
63
|
-
constructor(value: string, port: 'code host' | 'issue tracker', allowed: readonly string[]);
|
|
63
|
+
constructor(value: string, port: 'code host' | 'issue tracker', allowed: readonly string[], source?: string);
|
|
64
64
|
}
|
|
65
65
|
/**
|
|
66
66
|
* Builds the one bound provider set for `identity`. Guard clauses run in
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forgeProviders.d.ts","sourceRoot":"","sources":["../../src/providers/forgeProviders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAqB,KAAK,cAAc,EAAoC,KAAK,c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AAE,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,GAAE,MAAyB;CAI9H;AAiDD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,cAAc,CAmB7E"}
|
|
@@ -38,10 +38,10 @@ export function isCodeHostForge(value) {
|
|
|
38
38
|
export function isIssueTrackerForge(value) {
|
|
39
39
|
return ISSUE_TRACKER_FORGES.includes(value);
|
|
40
40
|
}
|
|
41
|
-
/** Thrown by {@link forgeProviders} for a forge name outside the closed union for its port. */
|
|
41
|
+
/** Thrown by {@link forgeProviders} and `createForgeCredentials` for a forge name outside the closed union for its port. */
|
|
42
42
|
export class UnknownForgeError extends Error {
|
|
43
|
-
constructor(value, port, allowed) {
|
|
44
|
-
super(
|
|
43
|
+
constructor(value, port, allowed, source = 'forgeProviders') {
|
|
44
|
+
super(`${source}: unknown ${port} forge "${value}" (expected one of: ${allowed.join(', ')})`);
|
|
45
45
|
this.name = 'UnknownForgeError';
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forgeProviders.js","sourceRoot":"","sources":["../../src/providers/forgeProviders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAiG,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACnJ,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAA+B,MAAM,gCAAgC,CAAC;AACvG,OAAO,EAAE,oBAAoB,EAA2B,MAAM,4BAA4B,CAAC;AAC3F,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,EAAE,sBAAsB,EAAmB,MAAM,4BAA4B,CAAC;AAErF,8EAA8E;AAC9E,yCAAyC;AACzC,8EAA8E;AAE9E,MAAM,CAAC,MAA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CAAC,CAAC;IACzF,CAAC;IACD,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,iBAAiB,CAAC,KAAK,CAAC,QAAQ,EAAE,WAAW,EAAE,gBAAgB,CAAC,CAAC;IAC7E,CAAC;IAED,MAAM,YAAY,GAAG,iBAAiB,CAAC,KAAK,CAAC,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;IACvF,MAAM,QAAQ,GAAG,aAAa,CAAC,KAAK,CAAC,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC3E,MAAM,YAAY,GAAG,iBAAiB,CAAC,KAAK,CAAC,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;IAEnF,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC,CAAC;AACjE,CAAC"}
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
* ghRepoApi.ts — the relocation target of GitContext's former semantic
|
|
3
3
|
* surface (#797). Composes the issue and PR leaf factories with the
|
|
4
4
|
* repo/label/secret/board remainder into one `GhRepoApi` view over a
|
|
5
|
-
* `GitContext` the caller already holds.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* construction site the guard's
|
|
5
|
+
* `GitContext` the caller already holds. Exported from `./index.ts` since
|
|
6
|
+
* issue #11, because ADW's `feature-797` step definitions consume it from the
|
|
7
|
+
* published package; `ghIssueApi`, `ghPrApi` and `createGhCommandRunner`
|
|
8
|
+
* remain deep-import only. Still not a construction site for the guard's
|
|
9
|
+
* `unsanctioned-construction` rule — a bound view over an existing context
|
|
10
|
+
* selects no identity.
|
|
9
11
|
*/
|
|
10
12
|
import type { GitContext } from '../../git/index.js';
|
|
11
13
|
import { type GhIssueApi } from './ghIssueApi.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ghRepoApi.d.ts","sourceRoot":"","sources":["../../../src/providers/github/ghRepoApi.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ghRepoApi.d.ts","sourceRoot":"","sources":["../../../src/providers/github/ghRepoApi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAQrD,oGAAoG;AACpG,MAAM,WAAW,SAAS;IACxB,aAAa,IAAI,MAAM,CAAC;IACxB,iBAAiB,IAAI,MAAM,CAAC;IAC5B,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpE,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzD,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7C,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,MAAM,CAAC;IAC/E,uGAAuG;IACvG,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC;IACvD;;;OAGG;IACH,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC;CACvE;AAED,6GAA6G;AAC7G,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,OAAO,GAAG,SAAS,CAAC;AA4EzD,mGAAmG;AACnG,wBAAgB,eAAe,CAAC,GAAG,EAAE,UAAU,GAAG,SAAS,CAO1D"}
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
* ghRepoApi.ts — the relocation target of GitContext's former semantic
|
|
3
3
|
* surface (#797). Composes the issue and PR leaf factories with the
|
|
4
4
|
* repo/label/secret/board remainder into one `GhRepoApi` view over a
|
|
5
|
-
* `GitContext` the caller already holds.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* construction site the guard's
|
|
5
|
+
* `GitContext` the caller already holds. Exported from `./index.ts` since
|
|
6
|
+
* issue #11, because ADW's `feature-797` step definitions consume it from the
|
|
7
|
+
* published package; `ghIssueApi`, `ghPrApi` and `createGhCommandRunner`
|
|
8
|
+
* remain deep-import only. Still not a construction site for the guard's
|
|
9
|
+
* `unsanctioned-construction` rule — a bound view over an existing context
|
|
10
|
+
* selects no identity.
|
|
9
11
|
*/
|
|
10
12
|
import { createGhCommandRunner } from './ghCommandRunner.js';
|
|
11
13
|
import { ghIssueApi } from './ghIssueApi.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ghRepoApi.js","sourceRoot":"","sources":["../../../src/providers/github/ghRepoApi.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ghRepoApi.js","sourceRoot":"","sources":["../../../src/providers/github/ghRepoApi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,qBAAqB,EAAwB,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,UAAU,EAAmB,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAgB,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EACL,UAAU,EAAE,eAAe,EAAE,eAAe,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EACxF,cAAc,EAAE,cAAc,EAAE,gBAAgB,GACjD,MAAM,6BAA6B,CAAC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AAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,mBAAmB,EAAE,CAAC;QAEvF,iBAAiB,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,YAAY,CAAC;KACjH,CAAC;AACJ,CAAC;AAED,mGAAmG;AACnG,MAAM,UAAU,eAAe,CAAC,GAAe;IAC7C,MAAM,EAAE,GAAG,EAAE,GAAG,qBAAqB,CAAC,GAAG,CAAC,CAAC;IAC3C,OAAO;QACL,GAAG,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC;QACvC,GAAG,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC;QACpC,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC;KACvC,CAAC;AACJ,CAAC"}
|
|
@@ -11,8 +11,23 @@
|
|
|
11
11
|
import type { GitIdentity } from '../../git/types.js';
|
|
12
12
|
import type { GitConfigIdentityDeps } from '../../git/bootstrapIdentity.js';
|
|
13
13
|
import { type RepoIdentifier } from '../types.js';
|
|
14
|
+
import { type GitHubAppConfig } from './appAuth.js';
|
|
14
15
|
export interface BootstrapIdentityDeps extends GitConfigIdentityDeps {
|
|
15
16
|
isAppConfigured?: () => boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The App configuration the caller already resolved (issue #9's
|
|
19
|
+
* `createForgeCredentials`). Three states, each distinct:
|
|
20
|
+
* - present and complete (`isGitHubAppConfigured`) → the bot identity
|
|
21
|
+
* derives from `appConfig.appId`/`appConfig.appSlug`, regardless of
|
|
22
|
+
* what the environment carries;
|
|
23
|
+
* - `null` → the caller has established "no App"; bot derivation is
|
|
24
|
+
* skipped even if the environment carries `GITHUB_APP_*`;
|
|
25
|
+
* - `undefined` (the default) → today's behaviour: the `GITHUB_APP_*`
|
|
26
|
+
* environment triple decides.
|
|
27
|
+
* An explicitly injected `isAppConfigured` still wins over this — it is
|
|
28
|
+
* the finer-grained seam and existing call sites rely on it.
|
|
29
|
+
*/
|
|
30
|
+
appConfig?: GitHubAppConfig | null;
|
|
16
31
|
}
|
|
17
32
|
/**
|
|
18
33
|
* Parses a `RepoIdentifier` out of a GitHub remote URL (HTTPS or SSH).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"githubIdentity.d.ts","sourceRoot":"","sources":["../../../src/providers/github/githubIdentity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"githubIdentity.d.ts","sourceRoot":"","sources":["../../../src/providers/github/githubIdentity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAM3E,MAAM,WAAW,qBAAsB,SAAQ,qBAAqB;IAClE,eAAe,CAAC,EAAE,MAAM,OAAO,CAAC;IAChC;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;CACpC;AAmCD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAK7E;AAMD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,cAAc,CAW9D;AAMD,kIAAkI;AAClI,eAAO,MAAM,yBAAyB,EAAE,WAKvC,CAAC;AASF;;;;;;;;;;;GAWG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,GAAE,qBAA0B,GAAG,WAAW,CAgBzF"}
|
|
@@ -10,6 +10,21 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { readOriginRemoteUrl, readEnvGitIdentity, readGitConfigIdentity } from '../../git/bootstrapIdentity.js';
|
|
12
12
|
import { Platform } from '../types.js';
|
|
13
|
+
import { isGitHubAppConfigured } from './appAuth.js';
|
|
14
|
+
/** Resolves the App-bot decision and its appId/appSlug from the injected config or, absent one, the environment. */
|
|
15
|
+
function resolveAppIdentitySource(deps, env) {
|
|
16
|
+
if (deps.appConfig !== undefined) {
|
|
17
|
+
if (deps.appConfig !== null && isGitHubAppConfigured(deps.appConfig)) {
|
|
18
|
+
return { configured: true, appId: deps.appConfig.appId, appSlug: deps.appConfig.appSlug };
|
|
19
|
+
}
|
|
20
|
+
return { configured: false };
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
configured: Boolean(env['GITHUB_APP_ID'] && env['GITHUB_APP_SLUG'] && env['GITHUB_APP_PRIVATE_KEY_PATH']),
|
|
24
|
+
appId: env['GITHUB_APP_ID'],
|
|
25
|
+
appSlug: env['GITHUB_APP_SLUG'],
|
|
26
|
+
};
|
|
27
|
+
}
|
|
13
28
|
// ---------------------------------------------------------------------------
|
|
14
29
|
// parseGitHubRemoteUrl
|
|
15
30
|
// ---------------------------------------------------------------------------
|
|
@@ -95,10 +110,11 @@ function deriveAppBotIdentity(appId, appSlug) {
|
|
|
95
110
|
*/
|
|
96
111
|
export function resolveBootstrapGitIdentity(deps = {}) {
|
|
97
112
|
const env = deps.env ?? process.env;
|
|
98
|
-
const
|
|
113
|
+
const derived = resolveAppIdentitySource(deps, env);
|
|
114
|
+
const isAppConfigured = deps.isAppConfigured ?? (() => derived.configured);
|
|
99
115
|
if (isAppConfigured()) {
|
|
100
|
-
const appId = env['GITHUB_APP_ID'];
|
|
101
|
-
const appSlug = env['GITHUB_APP_SLUG'];
|
|
116
|
+
const appId = derived.appId ?? env['GITHUB_APP_ID'];
|
|
117
|
+
const appSlug = derived.appSlug ?? env['GITHUB_APP_SLUG'];
|
|
102
118
|
if (appId && appSlug) {
|
|
103
119
|
return deriveAppBotIdentity(appId, appSlug);
|
|
104
120
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"githubIdentity.js","sourceRoot":"","sources":["../../../src/providers/github/githubIdentity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAEhH,OAAO,EAAE,QAAQ,EAAuB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"githubIdentity.js","sourceRoot":"","sources":["../../../src/providers/github/githubIdentity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAEhH,OAAO,EAAE,QAAQ,EAAuB,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAwB,MAAM,cAAc,CAAC;AAwB3E,oHAAoH;AACpH,SAAS,wBAAwB,CAAC,IAA2B,EAAE,GAAsB;IACnF,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;QACjC,IAAI,IAAI,CAAC,SAAS,KAAK,IAAI,IAAI,qBAAqB,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;YACrE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;QAC5F,CAAC;QACD,OAAO,EA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B,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;IAED,OAAO,kBAAkB,CAAC,GAAG,CAAC;WACzB,qBAAqB,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;WAC/C,yBAAyB,CAAC;AACjC,CAAC"}
|
|
@@ -33,9 +33,10 @@ export interface GitHubTokenProviderInput {
|
|
|
33
33
|
*/
|
|
34
34
|
export declare function createGitHubTokenProvider(input: GitHubTokenProviderInput): TokenProvider;
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
36
|
+
* Re-exported from the git core (`src/git/literalTokenProvider.ts`) so every
|
|
37
|
+
* existing `'../githubTokenProvider.js'` import in this package keeps
|
|
38
|
+
* working — the function itself carries no GitHub logic and moved there
|
|
39
|
+
* (issue #9).
|
|
39
40
|
*/
|
|
40
|
-
export
|
|
41
|
+
export { createLiteralTokenProvider } from '../../git/literalTokenProvider.js';
|
|
41
42
|
//# sourceMappingURL=githubTokenProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"githubTokenProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/github/githubTokenProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAqB,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAE3E,MAAM,WAAW,wBAAwB;IACvC,6DAA6D;IAC7D,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,eAAe,EAAE,MAAM,OAAO,CAAC;IAC/B,sFAAsF;IACtF,qBAAqB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAC/D,iFAAiF;IACjF,WAAW,EAAE,MAAM,MAAM,CAAC;CAC3B;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,wBAAwB,GAAG,aAAa,CAmBxF;AAED
|
|
1
|
+
{"version":3,"file":"githubTokenProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/github/githubTokenProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAqB,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAE3E,MAAM,WAAW,wBAAwB;IACvC,6DAA6D;IAC7D,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,eAAe,EAAE,MAAM,OAAO,CAAC;IAC/B,sFAAsF;IACtF,qBAAqB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAC/D,iFAAiF;IACjF,WAAW,EAAE,MAAM,MAAM,CAAC;CAC3B;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,wBAAwB,GAAG,aAAa,CAmBxF;AAED;;;;;GAKG;AACH,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC"}
|
|
@@ -37,15 +37,10 @@ export function createGitHubTokenProvider(input) {
|
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
40
|
+
* Re-exported from the git core (`src/git/literalTokenProvider.ts`) so every
|
|
41
|
+
* existing `'../githubTokenProvider.js'` import in this package keeps
|
|
42
|
+
* working — the function itself carries no GitHub logic and moved there
|
|
43
|
+
* (issue #9).
|
|
43
44
|
*/
|
|
44
|
-
export
|
|
45
|
-
return {
|
|
46
|
-
credentialEnv({ purpose }) {
|
|
47
|
-
return { GH_TOKEN: (purpose === 'alternateIdentity' && alternateIdentityPat) ? alternateIdentityPat : token };
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
}
|
|
45
|
+
export { createLiteralTokenProvider } from '../../git/literalTokenProvider.js';
|
|
51
46
|
//# sourceMappingURL=githubTokenProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"githubTokenProvider.js","sourceRoot":"","sources":["../../../src/providers/github/githubTokenProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAmBzD;;;;;GAKG;AACH,MAAM,UAAU,yBAAyB,CAAC,KAA+B;IACvE,OAAO;QACL,aAAa,CAAC,OAA0B;YACtC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;YACzC,IAAI,OAAO,KAAK,mBAAmB,IAAI,KAAK,CAAC,oBAAoB,EAAE,IAAI,EAAE,EAAE,CAAC;gBAC1E,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,oBAAoB,EAAE,CAAC;YAClD,CAAC;YACD,OAAO;gBACL,QAAQ,EAAE,mBAAmB,CAAC;oBAC5B,KAAK;oBACL,IAAI;oBACJ,GAAG,EAAE,KAAK,CAAC,GAAG;oBACd,eAAe,EAAE,KAAK,CAAC,eAAe;oBACtC,qBAAqB,EAAE,KAAK,CAAC,qBAAqB;oBAClD,WAAW,EAAE,KAAK,CAAC,WAAW;iBAC/B,CAAC;aACH,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"githubTokenProvider.js","sourceRoot":"","sources":["../../../src/providers/github/githubTokenProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAmBzD;;;;;GAKG;AACH,MAAM,UAAU,yBAAyB,CAAC,KAA+B;IACvE,OAAO;QACL,aAAa,CAAC,OAA0B;YACtC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;YACzC,IAAI,OAAO,KAAK,mBAAmB,IAAI,KAAK,CAAC,oBAAoB,EAAE,IAAI,EAAE,EAAE,CAAC;gBAC1E,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,oBAAoB,EAAE,CAAC;YAClD,CAAC;YACD,OAAO;gBACL,QAAQ,EAAE,mBAAmB,CAAC;oBAC5B,KAAK;oBACL,IAAI;oBACJ,GAAG,EAAE,KAAK,CAAC,GAAG;oBACd,eAAe,EAAE,KAAK,CAAC,eAAe;oBACtC,qBAAqB,EAAE,KAAK,CAAC,qBAAqB;oBAClD,WAAW,EAAE,KAAK,CAAC,WAAW;iBAC/B,CAAC;aACH,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC"}
|
|
@@ -7,4 +7,14 @@ export type { GitHubBoardManagerDeps } from './githubBoardManager.js';
|
|
|
7
7
|
export type { GitHubUser, GitHubLabel, GitHubMilestone, GitHubComment, GitHubIssueListItem, GitHubIssue, IssueCommentSummary, } from './domain/issue.js';
|
|
8
8
|
export type { PRReviewComment, PRDetails, PRListItem, RawPR } from './domain/pullRequest.js';
|
|
9
9
|
export * from './mappers.js';
|
|
10
|
+
export { createGitHubTokenProvider } from './githubTokenProvider.js';
|
|
11
|
+
export type { GitHubTokenProviderInput } from './githubTokenProvider.js';
|
|
12
|
+
export { resolveBootstrapGitIdentity } from './githubIdentity.js';
|
|
13
|
+
export type { BootstrapIdentityDeps } from './githubIdentity.js';
|
|
14
|
+
export { resolveContextToken } from './tokenResolver.js';
|
|
15
|
+
export type { ResolveContextTokenInput } from './tokenResolver.js';
|
|
16
|
+
export { ghAuthToken } from './ghAuthToken.js';
|
|
17
|
+
export { isGitHubAppConfigured, getInstallationToken } from './appAuth.js';
|
|
18
|
+
export { createGhRepoApi } from './ghRepoApi.js';
|
|
19
|
+
export type { GhRepoApi } from './ghRepoApi.js';
|
|
10
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/github/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACvF,YAAY,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC7F,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC3E,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,YAAY,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACtE,YAAY,EACV,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EACvD,mBAAmB,EAAE,WAAW,EAAE,mBAAmB,GACtD,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC7F,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/github/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACvF,YAAY,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC7F,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC3E,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,YAAY,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACtE,YAAY,EACV,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EACvD,mBAAmB,EAAE,WAAW,EAAE,mBAAmB,GACtD,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC7F,cAAc,cAAc,CAAC;AAU7B,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,YAAY,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAClE,YAAY,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,YAAY,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -2,4 +2,18 @@ export { createGitHubIssueTracker, GitHubIssueTracker } from './githubIssueTrack
|
|
|
2
2
|
export { createGitHubCodeHost, GitHubCodeHost } from './githubCodeHost.js';
|
|
3
3
|
export { createGitHubBoardManager } from './githubBoardManager.js';
|
|
4
4
|
export * from './mappers.js';
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
// Credential/identity helpers and the bound repo API view — widened onto this
|
|
7
|
+
// barrel by issue #11 for the ADW switchover to @paysdoc/devplatform. Prefer
|
|
8
|
+
// `createForgeCredentials` (`src/providers/forgeCredentials.ts`) as the
|
|
9
|
+
// forge-neutral route; the names below are the GitHub-specific building
|
|
10
|
+
// blocks it composes, exported directly so a caller that already speaks
|
|
11
|
+
// GitHub can use them with no behaviour change.
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
export { createGitHubTokenProvider } from './githubTokenProvider.js';
|
|
14
|
+
export { resolveBootstrapGitIdentity } from './githubIdentity.js';
|
|
15
|
+
export { resolveContextToken } from './tokenResolver.js';
|
|
16
|
+
export { ghAuthToken } from './ghAuthToken.js';
|
|
17
|
+
export { isGitHubAppConfigured, getInstallationToken } from './appAuth.js';
|
|
18
|
+
export { createGhRepoApi } from './ghRepoApi.js';
|
|
5
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/providers/github/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAEvF,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAOnE,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/providers/github/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAEvF,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAOnE,cAAc,cAAc,CAAC;AAE7B,8EAA8E;AAC9E,8EAA8E;AAC9E,6EAA6E;AAC7E,wEAAwE;AACxE,wEAAwE;AACxE,wEAAwE;AACxE,gDAAgD;AAChD,8EAA8E;AAC9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAErE,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitLab bootstrap identity resolution (issue #9) — the GitLab half of what
|
|
3
|
+
* `githubIdentity.ts`'s `resolveBootstrapGitIdentity` does for GitHub, minus
|
|
4
|
+
* bot derivation: GitLab credentials carry no App-style bot identity to
|
|
5
|
+
* derive, by design. Composes the core's generic readers
|
|
6
|
+
* (`readEnvGitIdentity`, `readGitConfigIdentity`) rather than shelling out
|
|
7
|
+
* itself. Adapter-internal — `createForgeCredentials` is the public name.
|
|
8
|
+
*/
|
|
9
|
+
import type { GitIdentity } from '../../git/types.js';
|
|
10
|
+
import { type GitConfigIdentityDeps } from '../../git/bootstrapIdentity.js';
|
|
11
|
+
/**
|
|
12
|
+
* The built-in default when nothing else resolves. Deliberately forge-shaped
|
|
13
|
+
* and deliberately not in the core (same reasoning as GitHub's
|
|
14
|
+
* `ADW_BOT_FALLBACK_IDENTITY`) — the scenario only asserts a *complete*
|
|
15
|
+
* fallback, so this address is this library's decision, not the issue's.
|
|
16
|
+
*/
|
|
17
|
+
export declare const GITLAB_BOT_FALLBACK_IDENTITY: GitIdentity;
|
|
18
|
+
/**
|
|
19
|
+
* Resolves a complete git author/committer identity before a GitContext
|
|
20
|
+
* exists. Resolution order:
|
|
21
|
+
* 1. GIT_AUTHOR_* / GIT_COMMITTER_* env vars (the core's `readEnvGitIdentity`)
|
|
22
|
+
* 2. `git config user.name / user.email` (the core's `readGitConfigIdentity`)
|
|
23
|
+
* 3. Built-in fallback (never returns empty fields)
|
|
24
|
+
*
|
|
25
|
+
* No bot-identity step — GitLab has none to derive, unlike the GitHub App
|
|
26
|
+
* bot identity `resolveBootstrapGitIdentity` derives first.
|
|
27
|
+
*/
|
|
28
|
+
export declare function resolveGitLabBootstrapGitIdentity(deps?: GitConfigIdentityDeps): GitIdentity;
|
|
29
|
+
//# sourceMappingURL=gitlabIdentity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitlabIdentity.d.ts","sourceRoot":"","sources":["../../../src/providers/gitlab/gitlabIdentity.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAA6C,KAAK,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAEvH;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,EAAE,WAK1C,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,iCAAiC,CAAC,IAAI,GAAE,qBAA0B,GAAG,WAAW,CAK/F"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitLab bootstrap identity resolution (issue #9) — the GitLab half of what
|
|
3
|
+
* `githubIdentity.ts`'s `resolveBootstrapGitIdentity` does for GitHub, minus
|
|
4
|
+
* bot derivation: GitLab credentials carry no App-style bot identity to
|
|
5
|
+
* derive, by design. Composes the core's generic readers
|
|
6
|
+
* (`readEnvGitIdentity`, `readGitConfigIdentity`) rather than shelling out
|
|
7
|
+
* itself. Adapter-internal — `createForgeCredentials` is the public name.
|
|
8
|
+
*/
|
|
9
|
+
import { readEnvGitIdentity, readGitConfigIdentity } from '../../git/bootstrapIdentity.js';
|
|
10
|
+
/**
|
|
11
|
+
* The built-in default when nothing else resolves. Deliberately forge-shaped
|
|
12
|
+
* and deliberately not in the core (same reasoning as GitHub's
|
|
13
|
+
* `ADW_BOT_FALLBACK_IDENTITY`) — the scenario only asserts a *complete*
|
|
14
|
+
* fallback, so this address is this library's decision, not the issue's.
|
|
15
|
+
*/
|
|
16
|
+
export const GITLAB_BOT_FALLBACK_IDENTITY = {
|
|
17
|
+
authorName: 'ADW Bot',
|
|
18
|
+
authorEmail: 'adw-bot@users.noreply.gitlab.com',
|
|
19
|
+
committerName: 'ADW Bot',
|
|
20
|
+
committerEmail: 'adw-bot@users.noreply.gitlab.com',
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Resolves a complete git author/committer identity before a GitContext
|
|
24
|
+
* exists. Resolution order:
|
|
25
|
+
* 1. GIT_AUTHOR_* / GIT_COMMITTER_* env vars (the core's `readEnvGitIdentity`)
|
|
26
|
+
* 2. `git config user.name / user.email` (the core's `readGitConfigIdentity`)
|
|
27
|
+
* 3. Built-in fallback (never returns empty fields)
|
|
28
|
+
*
|
|
29
|
+
* No bot-identity step — GitLab has none to derive, unlike the GitHub App
|
|
30
|
+
* bot identity `resolveBootstrapGitIdentity` derives first.
|
|
31
|
+
*/
|
|
32
|
+
export function resolveGitLabBootstrapGitIdentity(deps = {}) {
|
|
33
|
+
const env = deps.env ?? process.env;
|
|
34
|
+
return readEnvGitIdentity(env)
|
|
35
|
+
?? readGitConfigIdentity({ env, exec: deps.exec })
|
|
36
|
+
?? GITLAB_BOT_FALLBACK_IDENTITY;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=gitlabIdentity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitlabIdentity.js","sourceRoot":"","sources":["../../../src/providers/gitlab/gitlabIdentity.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAA8B,MAAM,gCAAgC,CAAC;AAEvH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAgB;IACvD,UAAU,EAAE,SAAS;IACrB,WAAW,EAAE,kCAAkC;IAC/C,aAAa,EAAE,SAAS;IACxB,cAAc,EAAE,kCAAkC;CACnD,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,UAAU,iCAAiC,CAAC,OAA8B,EAAE;IAChF,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IACpC,OAAO,kBAAkB,CAAC,GAAG,CAAC;WACzB,qBAAqB,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;WAC/C,4BAA4B,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TokenProvider port — GitLab implementation (issue #9).
|
|
3
|
+
*
|
|
4
|
+
* GitLab has no App/PAT/CLI resolution chain and no bot-versus-personal
|
|
5
|
+
* identity split to express: `GitLabConfig.token` is the one credential the
|
|
6
|
+
* caller injects, so `credentialEnv` serves it for both `'default'` and
|
|
7
|
+
* `'alternateIdentity'` requests. Adapter-internal — `createForgeCredentials`
|
|
8
|
+
* (`src/providers/forgeCredentials.ts`) is the only public way to obtain one.
|
|
9
|
+
*
|
|
10
|
+
* The overlay key `GITLAB_TOKEN` is adapter-owned (the core never learns
|
|
11
|
+
* it); it matches the `glab` CLI and the `GITLAB_TOKEN` variable
|
|
12
|
+
* `gitlabCodeHost.ts`'s factory docblock already reads for `GitLabConfig`.
|
|
13
|
+
*/
|
|
14
|
+
import type { TokenProvider } from '../../git/types.js';
|
|
15
|
+
import type { GitLabConfig } from './gitlabApiClient.js';
|
|
16
|
+
/** The credential environment variable a GitLab TokenProvider overlays. Exported for tests. */
|
|
17
|
+
export declare const GITLAB_TOKEN_ENV_VAR = "GITLAB_TOKEN";
|
|
18
|
+
/** Builds the port's GitLab implementation. Throws at construction on a blank token — never at first use. */
|
|
19
|
+
export declare function createGitLabTokenProvider(config: GitLabConfig): TokenProvider;
|
|
20
|
+
//# sourceMappingURL=gitlabTokenProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitlabTokenProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/gitlab/gitlabTokenProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAqB,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,+FAA+F;AAC/F,eAAO,MAAM,oBAAoB,iBAAiB,CAAC;AAEnD,6GAA6G;AAC7G,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,YAAY,GAAG,aAAa,CAU7E"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TokenProvider port — GitLab implementation (issue #9).
|
|
3
|
+
*
|
|
4
|
+
* GitLab has no App/PAT/CLI resolution chain and no bot-versus-personal
|
|
5
|
+
* identity split to express: `GitLabConfig.token` is the one credential the
|
|
6
|
+
* caller injects, so `credentialEnv` serves it for both `'default'` and
|
|
7
|
+
* `'alternateIdentity'` requests. Adapter-internal — `createForgeCredentials`
|
|
8
|
+
* (`src/providers/forgeCredentials.ts`) is the only public way to obtain one.
|
|
9
|
+
*
|
|
10
|
+
* The overlay key `GITLAB_TOKEN` is adapter-owned (the core never learns
|
|
11
|
+
* it); it matches the `glab` CLI and the `GITLAB_TOKEN` variable
|
|
12
|
+
* `gitlabCodeHost.ts`'s factory docblock already reads for `GitLabConfig`.
|
|
13
|
+
*/
|
|
14
|
+
/** The credential environment variable a GitLab TokenProvider overlays. Exported for tests. */
|
|
15
|
+
export const GITLAB_TOKEN_ENV_VAR = 'GITLAB_TOKEN';
|
|
16
|
+
/** Builds the port's GitLab implementation. Throws at construction on a blank token — never at first use. */
|
|
17
|
+
export function createGitLabTokenProvider(config) {
|
|
18
|
+
if (!config.token.trim()) {
|
|
19
|
+
throw new Error('createGitLabTokenProvider: GitLabConfig.token must not be empty');
|
|
20
|
+
}
|
|
21
|
+
const token = config.token;
|
|
22
|
+
return {
|
|
23
|
+
credentialEnv(_request) {
|
|
24
|
+
return { [GITLAB_TOKEN_ENV_VAR]: token };
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=gitlabTokenProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitlabTokenProvider.js","sourceRoot":"","sources":["../../../src/providers/gitlab/gitlabTokenProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,+FAA+F;AAC/F,MAAM,CAAC,MAAM,oBAAoB,GAAG,cAAc,CAAC;AAEnD,6GAA6G;AAC7G,MAAM,UAAU,yBAAyB,CAAC,MAAoB;IAC5D,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,iEAAiE,CAAC,CAAC;IACrF,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;IAC3B,OAAO;QACL,aAAa,CAAC,QAA2B;YACvC,OAAO,EAAE,CAAC,oBAAoB,CAAC,EAAE,KAAK,EAAE,CAAC;QAC3C,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC"}
|
package/dist/providers/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paysdoc/devplatform",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Forge ports and adapters (GitHub, GitLab, Jira) over a forge-neutral git/worktree core",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"typecheck": "tsc --noEmit",
|
|
45
45
|
"lint:git-guard": "bunx tsx scripts/checkGitGhGuard.ts",
|
|
46
46
|
"test:unit": "vitest run",
|
|
47
|
+
"test:e2e": "NODE_OPTIONS=\"--import tsx\" cucumber-js",
|
|
47
48
|
"test": "tsc --noEmit",
|
|
48
49
|
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
49
50
|
"build": "bun run clean && tsc -p tsconfig.build.json",
|
|
@@ -52,6 +53,7 @@
|
|
|
52
53
|
"prepack": "bun run build"
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|
|
56
|
+
"@cucumber/cucumber": "^13.2.1",
|
|
55
57
|
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
56
58
|
"@semantic-release/github": "^12.0.9",
|
|
57
59
|
"@semantic-release/npm": "^13.1.5",
|