@homeflare/alchemy 0.28.0 → 0.29.1
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 +2 -0
- package/dist/caddy/admin-address.d.ts +27 -0
- package/dist/caddy/admin-address.d.ts.map +1 -0
- package/dist/caddy/admin-calls.d.ts +25 -28
- package/dist/caddy/admin-calls.d.ts.map +1 -1
- package/dist/caddy/admin.d.ts +28 -38
- package/dist/caddy/admin.d.ts.map +1 -1
- package/dist/caddy/caddy-http-client.d.ts +25 -0
- package/dist/caddy/caddy-http-client.d.ts.map +1 -0
- package/dist/caddy/config-errors.d.ts +24 -0
- package/dist/caddy/config-errors.d.ts.map +1 -0
- package/dist/caddy/config-lifecycle.d.ts +20 -49
- package/dist/caddy/config-lifecycle.d.ts.map +1 -1
- package/dist/caddy/config-reconcile.d.ts +45 -0
- package/dist/caddy/config-reconcile.d.ts.map +1 -0
- package/dist/caddy/config.d.ts +4 -3
- package/dist/caddy/config.d.ts.map +1 -1
- package/dist/caddy/fake-caddy.d.ts +10 -2
- package/dist/caddy/fake-caddy.d.ts.map +1 -1
- package/dist/caddy/index.d.ts +3 -3
- package/dist/caddy/index.d.ts.map +1 -1
- package/dist/caddy/index.js +487 -444
- package/dist/caddy/index.js.map +16 -12
- package/dist/caddy/local-admin.d.ts +20 -34
- package/dist/caddy/local-admin.d.ts.map +1 -1
- package/dist/caddy/providers.d.ts +19 -3
- package/dist/caddy/providers.d.ts.map +1 -1
- package/dist/cloudflare/mesh-node-token.d.ts +1 -1
- package/dist/cloudflare/mesh-node-token.d.ts.map +1 -1
- package/dist/forgejo/branch-protection.d.ts +4 -4
- package/dist/forgejo/org-actions-secrets.d.ts +4 -4
- package/dist/forgejo/org-label.d.ts +4 -4
- package/dist/forgejo/org-team.d.ts +4 -4
- package/dist/forgejo/repo-webhook.d.ts +4 -4
- package/dist/forgejo/repository.d.ts +4 -4
- package/dist/forgejo/team-member.d.ts +4 -4
- package/dist/github/declare-repo-baseline.d.ts +1 -1
- package/dist/github/declare-repo-baseline.d.ts.map +1 -1
- package/dist/github/index.d.ts +8 -4
- package/dist/github/index.d.ts.map +1 -1
- package/dist/github/index.js +83 -24
- package/dist/github/index.js.map +14 -12
- package/dist/github/repo-apply-order-fake-providers.d.ts +48 -0
- package/dist/github/repo-apply-order-fake-providers.d.ts.map +1 -0
- package/dist/github/repo-apply-order-fake-stack.d.ts +13 -0
- package/dist/github/repo-apply-order-fake-stack.d.ts.map +1 -0
- package/dist/github/repo-auto-merge-gate.d.ts +54 -0
- package/dist/github/repo-auto-merge-gate.d.ts.map +1 -0
- package/dist/github/repo-baseline-data.d.ts +10 -1
- package/dist/github/repo-baseline-data.d.ts.map +1 -1
- package/dist/github/repo-policy.d.ts +1 -1
- package/dist/github/repo-policy.d.ts.map +1 -1
- package/dist/github/repository-ruleset-errors.d.ts +3 -2
- package/dist/github/repository-ruleset-errors.d.ts.map +1 -1
- package/dist/github/repository-ruleset-form.d.ts.map +1 -1
- package/dist/github/repository-ruleset-guards.d.ts +3 -2
- package/dist/github/repository-ruleset-guards.d.ts.map +1 -1
- package/dist/github/repository-ruleset-octokit.d.ts +49 -0
- package/dist/github/repository-ruleset-octokit.d.ts.map +1 -1
- package/dist/github/repository-ruleset-probe.d.ts +2 -1
- package/dist/github/repository-ruleset-probe.d.ts.map +1 -1
- package/dist/github/repository-ruleset-props.d.ts +7 -4
- package/dist/github/repository-ruleset-props.d.ts.map +1 -1
- package/dist/github/repository-ruleset-providers.d.ts +42 -0
- package/dist/github/repository-ruleset-providers.d.ts.map +1 -0
- package/dist/github/repository-ruleset.d.ts +26 -4
- package/dist/github/repository-ruleset.d.ts.map +1 -1
- package/dist/litellm/fake-litellm.d.ts +27 -16
- package/dist/litellm/fake-litellm.d.ts.map +1 -1
- package/dist/litellm/fake-stack.d.ts +9 -4
- package/dist/litellm/fake-stack.d.ts.map +1 -1
- package/dist/litellm/index.d.ts +7 -5
- package/dist/litellm/index.d.ts.map +1 -1
- package/dist/litellm/index.js +53 -123
- package/dist/litellm/index.js.map +8 -8
- package/dist/litellm/operations.d.ts +60 -0
- package/dist/litellm/operations.d.ts.map +1 -0
- package/dist/litellm/pass-through-endpoint.d.ts +10 -28
- package/dist/litellm/pass-through-endpoint.d.ts.map +1 -1
- package/dist/litellm/pass-through-errors.d.ts +37 -0
- package/dist/litellm/pass-through-errors.d.ts.map +1 -0
- package/dist/litellm/pass-through-form.d.ts +11 -4
- package/dist/litellm/pass-through-form.d.ts.map +1 -1
- package/dist/litellm/providers.d.ts +7 -5
- package/dist/litellm/providers.d.ts.map +1 -1
- package/dist/netbox/prefix.d.ts +4 -4
- package/dist/paperless/custom-field.d.ts +21 -21
- package/dist/paperless/custom-field.d.ts.map +1 -1
- package/dist/paperless/document-type.d.ts +34 -4
- package/dist/paperless/document-type.d.ts.map +1 -1
- package/dist/paperless/fake-paperless.d.ts +36 -19
- package/dist/paperless/fake-paperless.d.ts.map +1 -1
- package/dist/paperless/index.d.ts +7 -2
- package/dist/paperless/index.d.ts.map +1 -1
- package/dist/paperless/index.js +164 -228
- package/dist/paperless/index.js.map +10 -13
- package/dist/paperless/matching-locate.d.ts +42 -20
- package/dist/paperless/matching-locate.d.ts.map +1 -1
- package/dist/paperless/matching-types.d.ts +47 -18
- package/dist/paperless/matching-types.d.ts.map +1 -1
- package/dist/paperless/matching.d.ts +30 -27
- package/dist/paperless/matching.d.ts.map +1 -1
- package/dist/paperless/providers.d.ts +13 -7
- package/dist/paperless/providers.d.ts.map +1 -1
- package/dist/paperless/storage-path.d.ts +34 -4
- package/dist/paperless/storage-path.d.ts.map +1 -1
- package/dist/paperless/tag.d.ts +43 -8
- package/dist/paperless/tag.d.ts.map +1 -1
- package/dist/proxmox/acl.d.ts +30 -23
- package/dist/proxmox/acl.d.ts.map +1 -1
- package/dist/proxmox/distilled-pve.d.ts +89 -0
- package/dist/proxmox/distilled-pve.d.ts.map +1 -0
- package/dist/proxmox/index.js +663 -609
- package/dist/proxmox/index.js.map +12 -11
- package/dist/proxmox/members.d.ts +29 -10
- package/dist/proxmox/members.d.ts.map +1 -1
- package/docs/caddy-admin.md +1 -1
- package/docs/caddy.md +3 -2
- package/docs/credentials.md +16 -0
- package/docs/litellm.md +21 -13
- package/docs/paperless.md +12 -0
- package/docs/peers.md +5 -0
- package/docs/repo-policy.md +16 -1
- package/docs/repository-ruleset.md +53 -13
- package/docs/upstream-conformance.md +126 -10
- package/package.json +5 -2
- package/src/caddy/admin-address.ts +71 -0
- package/src/caddy/admin-calls.ts +48 -100
- package/src/caddy/admin.ts +37 -41
- package/src/caddy/adopt-scope.test.ts +1 -1
- package/src/caddy/caddy-http-client.ts +229 -0
- package/src/caddy/config-adopt-provider.test.ts +139 -0
- package/src/caddy/config-adopt.test.ts +60 -126
- package/src/caddy/config-errors.ts +47 -0
- package/src/caddy/config-lifecycle.test.ts +55 -42
- package/src/caddy/config-lifecycle.ts +72 -162
- package/src/caddy/config-reconcile.ts +138 -0
- package/src/caddy/config.ts +36 -42
- package/src/caddy/fake-caddy.ts +20 -2
- package/src/caddy/index.ts +3 -8
- package/src/caddy/local-admin.test.ts +35 -21
- package/src/caddy/local-admin.ts +60 -167
- package/src/caddy/providers.test.ts +14 -6
- package/src/caddy/providers.ts +20 -4
- package/src/github/declare-repo-baseline-apply-order.test.ts +86 -0
- package/src/github/declare-repo-baseline.ts +40 -7
- package/src/github/index.ts +8 -4
- package/src/github/repo-apply-order-fake-providers.ts +119 -0
- package/src/github/repo-apply-order-fake-stack.ts +74 -0
- package/src/github/repo-auto-merge-gate.ts +57 -0
- package/src/github/repo-baseline-data.test.ts +13 -0
- package/src/github/repo-baseline-data.ts +11 -2
- package/src/github/repo-policy-apply-order.test.ts +72 -0
- package/src/github/repo-policy-stack.test.ts +59 -0
- package/src/github/repo-policy.ts +31 -3
- package/src/github/repository-ruleset-errors.ts +6 -4
- package/src/github/repository-ruleset-exact-adopt-k1.test.ts +109 -0
- package/src/github/repository-ruleset-exact-adopt.test.ts +14 -9
- package/src/github/repository-ruleset-form.ts +7 -3
- package/src/github/repository-ruleset-guards.ts +3 -2
- package/src/github/repository-ruleset-octokit.test.ts +141 -0
- package/src/github/repository-ruleset-octokit.ts +121 -30
- package/src/github/repository-ruleset-probe.ts +2 -1
- package/src/github/repository-ruleset-props.ts +7 -4
- package/src/github/repository-ruleset-providers.ts +46 -0
- package/src/github/repository-ruleset-wire.test.ts +38 -27
- package/src/github/repository-ruleset.ts +27 -3
- package/src/litellm/fake-litellm.ts +83 -78
- package/src/litellm/fake-stack.ts +13 -5
- package/src/litellm/index.ts +7 -21
- package/src/litellm/operations.ts +149 -0
- package/src/litellm/pass-through-endpoint-delete-swallow.test.ts +17 -20
- package/src/litellm/pass-through-endpoint-replace.test.ts +3 -4
- package/src/litellm/pass-through-endpoint.test.ts +8 -8
- package/src/litellm/pass-through-endpoint.ts +21 -31
- package/src/litellm/pass-through-errors.ts +37 -0
- package/src/litellm/pass-through-form.ts +20 -10
- package/src/litellm/providers.ts +8 -7
- package/src/paperless/custom-field.test.ts +49 -40
- package/src/paperless/custom-field.ts +57 -33
- package/src/paperless/document-type.test.ts +48 -0
- package/src/paperless/document-type.ts +51 -22
- package/src/paperless/fake-paperless.ts +63 -72
- package/src/paperless/index.ts +7 -13
- package/src/paperless/matching-locate.test.ts +102 -0
- package/src/paperless/matching-locate.ts +80 -86
- package/src/paperless/matching-types.ts +49 -16
- package/src/paperless/matching.ts +77 -90
- package/src/paperless/providers.ts +14 -10
- package/src/paperless/storage-path.test.ts +56 -0
- package/src/paperless/storage-path.ts +53 -24
- package/src/paperless/tag-identity.test.ts +127 -0
- package/src/paperless/tag.test.ts +100 -0
- package/src/paperless/tag.ts +62 -32
- package/src/proxmox/acl.test.ts +145 -0
- package/src/proxmox/acl.ts +128 -150
- package/src/proxmox/distilled-pve.test.ts +231 -0
- package/src/proxmox/distilled-pve.ts +147 -0
- package/src/proxmox/members-timeout.test.ts +161 -0
- package/src/proxmox/members.test.ts +9 -0
- package/src/proxmox/members.ts +36 -2
- package/dist/litellm/client.d.ts +0 -76
- package/dist/litellm/client.d.ts.map +0 -1
- package/dist/litellm/credentials.d.ts +0 -48
- package/dist/litellm/credentials.d.ts.map +0 -1
- package/dist/litellm/generated/pass-through.d.ts +0 -71
- package/dist/litellm/generated/pass-through.d.ts.map +0 -1
- package/dist/paperless/client.d.ts +0 -37
- package/dist/paperless/client.d.ts.map +0 -1
- package/dist/paperless/credentials.d.ts +0 -40
- package/dist/paperless/credentials.d.ts.map +0 -1
- package/dist/paperless/errors.d.ts +0 -49
- package/dist/paperless/errors.d.ts.map +0 -1
- package/src/litellm/client.ts +0 -195
- package/src/litellm/credentials.ts +0 -73
- package/src/litellm/generated/pass-through.ts +0 -73
- package/src/paperless/client.ts +0 -88
- package/src/paperless/credentials.ts +0 -69
- package/src/paperless/errors.ts +0 -62
- package/src/paperless/matching-identity.test.ts +0 -194
- package/src/paperless/matching.test.ts +0 -128
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fully in-memory `Provider.succeed(...)` fakes for `GitHub.Repository` and `RepositoryRuleset`
|
|
3
|
+
* — no octokit, no `GitHubCredentials`, no network. Unlike `repository-ruleset-fake-octokit.ts`
|
|
4
|
+
* (a fake HTTP client fed into the REAL provider's `reconcile`), these fakes replace the provider
|
|
5
|
+
* entirely, because what `declare-repo-baseline-apply-order.test.ts` and
|
|
6
|
+
* `repo-policy-apply-order.test.ts` measure is the ENGINE's own scheduling — which resource's
|
|
7
|
+
* `reconcile` runs first, and whether one's failure reaches the other — not GitHub's wire
|
|
8
|
+
* protocol. `Provider.succeed`'s runtime lookup (`tryFindProviderRegistrationByType`,
|
|
9
|
+
* `node_modules/alchemy/src/Provider.ts`) checks the INDIVIDUAL `Provider<R>` tag before falling
|
|
10
|
+
* back to a `GitHub.Providers` collection, so registering these two standalone providers is
|
|
11
|
+
* enough regardless of `GitHub.Repository`'s own declared `Providers` slot — the same shortcut
|
|
12
|
+
* `RepositoryRulesetProvider()` already relies on.
|
|
13
|
+
*
|
|
14
|
+
* ⚠️ NO LIVE NETWORK, EVER. Nothing here imports `octokit`/`GitHubCredentials`, so a test built
|
|
15
|
+
* on this file cannot make a real GitHub call even by accident — required by this PR's own
|
|
16
|
+
* "no live GitHub writes" rule.
|
|
17
|
+
*
|
|
18
|
+
* ⚠️ THE FAKE RULESET REFUSES A REPO THAT DOESN'T EXIST YET, ON PURPOSE — mirroring GitHub's own
|
|
19
|
+
* `POST /repos/{owner}/{repo}/rulesets`, which 404s on a repo that hasn't been created. A first
|
|
20
|
+
* ADVERSARIAL REVIEW pass (2026-09-24) on this PR found that the ordering fix forces the
|
|
21
|
+
* ruleset to apply before the repository whenever auto-merge turns on — safe for an UPDATE
|
|
22
|
+
* (the repo already exists), but a real hazard for a repo+ruleset created together for the
|
|
23
|
+
* FIRST time with checks set from day one, and the original version of this fake modeled no
|
|
24
|
+
* such constraint, so its own tests could not have caught that regression. It now can — see
|
|
25
|
+
* `declare-repo-baseline-apply-order.test.ts`'s "a repo and ruleset created together" test.
|
|
26
|
+
*/
|
|
27
|
+
import * as GitHub from 'alchemy/GitHub';
|
|
28
|
+
import * as Provider from 'alchemy/Provider';
|
|
29
|
+
import * as Layer from 'effect/Layer';
|
|
30
|
+
import { RepositoryRuleset } from './repository-ruleset.ts';
|
|
31
|
+
/** One resource type's name, in the order its fake `reconcile` was actually invoked. */
|
|
32
|
+
export type CallLog = ('repository' | 'ruleset')[];
|
|
33
|
+
export interface World {
|
|
34
|
+
readonly calls: CallLog;
|
|
35
|
+
/** `owner/name` of every repository the fake repository provider has reconciled at least
|
|
36
|
+
* once — what the fake ruleset provider checks before allowing a create. */
|
|
37
|
+
readonly liveRepositories: Set<string>;
|
|
38
|
+
/** Set before `deploy` to make the ruleset's `reconcile` fail instead of succeeding, even
|
|
39
|
+
* against a repository already in `liveRepositories`. */
|
|
40
|
+
rulesetShouldFail: boolean;
|
|
41
|
+
/** `news.allowAutoMerge` as the repository's fake `reconcile` last observed it — `undefined`
|
|
42
|
+
* until (unless) the repository's `reconcile` actually runs. */
|
|
43
|
+
repositoryAllowAutoMerge: boolean | undefined;
|
|
44
|
+
}
|
|
45
|
+
export declare const makeWorld: () => World;
|
|
46
|
+
/** Both fakes, merged — everything `declareRepoBaseline`/`declareRepoPolicy` need. */
|
|
47
|
+
export declare const fakeGithubProviders: (world: World) => Layer.Layer<Provider.Provider<GitHub.Repository> | Provider.Provider<RepositoryRuleset>, never, never>;
|
|
48
|
+
//# sourceMappingURL=repo-apply-order-fake-providers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repo-apply-order-fake-providers.d.ts","sourceRoot":"","sources":["../../src/github/repo-apply-order-fake-providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAE7C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAA+B,MAAM,yBAAyB,CAAC;AAEzF,wFAAwF;AACxF,MAAM,MAAM,OAAO,GAAG,CAAC,YAAY,GAAG,SAAS,CAAC,EAAE,CAAC;AAEnD,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB;gFAC4E;IAC5E,QAAQ,CAAC,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACvC;6DACyD;IACzD,iBAAiB,EAAE,OAAO,CAAC;IAC3B;oEACgE;IAChE,wBAAwB,EAAE,OAAO,GAAG,SAAS,CAAC;CAC/C;AAED,eAAO,MAAM,SAAS,QAAO,KAK3B,CAAC;AA+DH,sFAAsF;AACtF,eAAO,MAAM,mBAAmB,UAAW,KAAK,2GAC2B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import * as Layer from 'effect/Layer';
|
|
3
|
+
export type Planned = Readonly<Record<string, string>>;
|
|
4
|
+
export type StackBody = Effect.Effect<unknown, unknown, unknown>;
|
|
5
|
+
export type DeployOptions = {
|
|
6
|
+
readonly adopt?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export interface FakeStack {
|
|
9
|
+
/** Plan, then apply, `body`. Resolves to the plan; rejects with the apply's failure. */
|
|
10
|
+
readonly deploy: (body: StackBody, options?: DeployOptions) => Promise<Planned>;
|
|
11
|
+
}
|
|
12
|
+
export declare const fakeStack: <ROut, E, RIn>(providers: Layer.Layer<ROut, E, RIn>, name?: string) => FakeStack;
|
|
13
|
+
//# sourceMappingURL=repo-apply-order-fake-stack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repo-apply-order-fake-stack.d.ts","sourceRoot":"","sources":["../../src/github/repo-apply-order-fake-stack.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,MAAM,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AACvD,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AACjE,MAAM,MAAM,aAAa,GAAG;IAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEzD,MAAM,WAAW,SAAS;IACxB,wFAAwF;IACxF,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,aAAa,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACjF;AAiBD,eAAO,MAAM,SAAS,GAAI,IAAI,EAAE,CAAC,EAAE,GAAG,aACzB,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,oBAEnC,SA6BF,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `gateAutoMergeOnRuleset` — the one place `declareRepoBaseline` and `declareRepoPolicy` thread
|
|
3
|
+
* a real apply-ordering edge from `GitHub.Repository`'s `allowAutoMerge` to the sibling
|
|
4
|
+
* `RepositoryRuleset`, so a deploy can never turn auto-merge on before the ruleset's required
|
|
5
|
+
* checks/approvals are actually live.
|
|
6
|
+
*
|
|
7
|
+
* ⛔ K5 (kit PR 216, 2026-09-24): both callers declare `GitHub.Repository` and `RepositoryRuleset`
|
|
8
|
+
* as two INDEPENDENT resources with no dependency edge between them. When a repo moves from
|
|
9
|
+
* `checks:[]` to `checks:['x']`, `allowAutoMerge` flips to `true` in the very same deploy that
|
|
10
|
+
* adds the required check. If the Repository apply lands before the Ruleset apply — or the
|
|
11
|
+
* Ruleset apply fails outright — the repo ends up with auto-merge on and nothing required: `gh
|
|
12
|
+
* pr merge --auto` merges a CLEAN pull request immediately (memory `gh-auto-merge-merges-now`).
|
|
13
|
+
* That fail-open state is exactly what K5 exists to prevent.
|
|
14
|
+
*
|
|
15
|
+
* ★ THE MECHANISM — ALCHEMY ORDERS BY OUTPUT REFERENCES IN PROPS, NOT DECLARATION ORDER.
|
|
16
|
+
* `Plan.ts` (~l.1031-1038): a resource's upstream deps are `Output.upstreamAny(resource.Props)`.
|
|
17
|
+
* `Apply.ts` (~l.760-762, ~l.909): `waitForDeps(allUpstreamFqns())` — built the same way from
|
|
18
|
+
* `Output.resolveUpstream(node.props)` — runs before `reconcile`. See the kit's own
|
|
19
|
+
* `alchemy-output-refs-order-resources` memory. `GitHub.Repository`'s upstream `RepositoryProps`
|
|
20
|
+
* has no spare field: `reconcile` (`node_modules/alchemy/src/GitHub/Repository.ts`) sends every
|
|
21
|
+
* declared prop straight to Octokit's create/update calls, so there is nothing to smuggle an
|
|
22
|
+
* unrelated Output into. `allowAutoMerge` itself is the vehicle instead: its value is still
|
|
23
|
+
* exactly `true` whenever this function is called with it already `true` — only now computed
|
|
24
|
+
* AFTER `ruleset.rulesetId` resolves via `Output.map`, instead of written as a literal. That
|
|
25
|
+
* single Output reference is enough for `Output.upstreamAny` to record the ruleset as this
|
|
26
|
+
* Repository's upstream dependency, so the engine applies the ruleset first.
|
|
27
|
+
*
|
|
28
|
+
* ★ WHY THIS NEEDS NO REVERSE-DIRECTION EDGE. The opposite transition — checks/approvals
|
|
29
|
+
* REMOVED, so `allowAutoMerge` turns off — cannot silently race the other way. Neither caller
|
|
30
|
+
* ever declares `rules.requiredStatusChecks: false` or omits `rules.pullRequest` on purpose;
|
|
31
|
+
* dropping `checks`/`requiredApprovals` from the options just OMITS the corresponding rule key.
|
|
32
|
+
* `requiredChecksOmissionRefusal` and `undeclaredLiveRuleRefusal` (repository-ruleset-guards.ts)
|
|
33
|
+
* both refuse — unconditionally, regardless of apply order — to drop a rule that is still LIVE
|
|
34
|
+
* by omission. So the worst reachable state, whichever resource applies first, is: Repository
|
|
35
|
+
* succeeds (auto-merge off, the correct direction anyway) and Ruleset refuses (the live rule
|
|
36
|
+
* stays required) — never fail-open. Proved by the ordering/failure tests beside this file.
|
|
37
|
+
*/
|
|
38
|
+
import * as Output from 'alchemy/Output';
|
|
39
|
+
/** The one attribute this gate needs from a declared `RepositoryRuleset`. */
|
|
40
|
+
export interface AutoMergeGateSource {
|
|
41
|
+
readonly rulesetId: Output.Output<number, never>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Returns `settings` unchanged when `allowAutoMerge` is falsy — nothing to gate, and every
|
|
45
|
+
* existing declaration with auto-merge off keeps its exact prior props (no diff, no replan).
|
|
46
|
+
* Otherwise returns `settings` with `allowAutoMerge` recomputed as an Output.map over
|
|
47
|
+
* `ruleset.rulesetId` — still resolves to `true`, now with a real dependency edge attached.
|
|
48
|
+
*/
|
|
49
|
+
export declare function gateAutoMergeOnRuleset<P extends {
|
|
50
|
+
readonly allowAutoMerge?: boolean;
|
|
51
|
+
}>(settings: P, ruleset: AutoMergeGateSource): P | (Omit<P, 'allowAutoMerge'> & {
|
|
52
|
+
readonly allowAutoMerge: Output.Output<boolean, never>;
|
|
53
|
+
});
|
|
54
|
+
//# sourceMappingURL=repo-auto-merge-gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repo-auto-merge-gate.d.ts","sourceRoot":"","sources":["../../src/github/repo-auto-merge-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AAEzC,6EAA6E;AAC7E,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;CAClD;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS;IAAE,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAA;CAAE,EACpF,QAAQ,EAAE,CAAC,EACX,OAAO,EAAE,mBAAmB,GAC3B,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,gBAAgB,CAAC,GAAG;IAAE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;CAAE,CAAC,CAG9F"}
|
|
@@ -19,7 +19,16 @@ export interface RepoBaselineInput {
|
|
|
19
19
|
}
|
|
20
20
|
/** `GitHub.Repository` fields this baseline owns. Every merge-automation caller across the 17
|
|
21
21
|
* tray checkouts uses `--squash` (measured 2026-09-23; the only non-squash mentions are
|
|
22
|
-
* GitLab-era comments in cliff.toml), so squash-only is not a per-repo choice.
|
|
22
|
+
* GitLab-era comments in cliff.toml), so squash-only is not a per-repo choice.
|
|
23
|
+
*
|
|
24
|
+
* ⛔ K5 (2026-09-24): `allowAutoMerge` FOLLOWS `checks.length`, NOT A HARDCODED `true`. `gh pr
|
|
25
|
+
* merge --auto` (and the ruleset's own auto-merge) is a queue only while something is
|
|
26
|
+
* outstanding — with zero required status checks there is nothing to wait for, so GitHub
|
|
27
|
+
* merges a CLEAN pull request on the spot, with no review and no green run. This is the same
|
|
28
|
+
* failure `repo-policy-guards.ts`'s `assertAutoMergeWaits` refuses on the sibling `repoPolicy`
|
|
29
|
+
* path (five doors to the same "nothing outstanding" state); this baseline has no `autoMerge`
|
|
30
|
+
* opt-out prop to refuse WITH, so the fix here is unconditional rather than a thrown refusal —
|
|
31
|
+
* a repo with an empty `checks` list simply never gets auto-merge turned on by this baseline. */
|
|
23
32
|
export declare function repoBaselineSettings(input: RepoBaselineInput): {
|
|
24
33
|
owner: string;
|
|
25
34
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repo-baseline-data.d.ts","sourceRoot":"","sources":["../../src/github/repo-baseline-data.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,UAAU,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED
|
|
1
|
+
{"version":3,"file":"repo-baseline-data.d.ts","sourceRoot":"","sources":["../../src/github/repo-baseline-data.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,UAAU,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;;;;;;;;;;mGAWmG;AACnG,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,iBAAiB;;;;;;;;;;;EAa5D;AAED;;mGAEmG;AACnG,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,iBAAiB;;;;YAKhD,QAAQ;iBACH,QAAQ;;;QAEP,OAAO;QAAuB,OAAO;;;;;;YAK/C,4BAA4B;YAC5B,yBAAyB;YACzB,sBAAsB;YACtB,uBAAuB;YACvB,8BAA8B;YAC9B,mBAAmB;YACnB,mCAAmC;;;YAM7B,MAAM;;;YACN,gCAAgC;YAChC,oBAAoB;;;EAKjC;AAED;;;cAGc;AACd,eAAO,MAAM,wBAAwB,YACnC,0BAA0B,EAC1B,0CAA0C,EAC1C,0CAA0C,EAC1C,6CAA6C,CACrC,CAAC"}
|
|
@@ -17,5 +17,5 @@ export declare const declareRepoPolicy: (id: string, options: DeclareRepoPolicyO
|
|
|
17
17
|
policy: import("./repo-policy-form.ts").RepoPolicy;
|
|
18
18
|
repository: GitHub.Repository;
|
|
19
19
|
ruleset: RepositoryRuleset;
|
|
20
|
-
}, Error,
|
|
20
|
+
}, Error, import("alchemy").Provider<RepositoryRuleset> | GitHub.Providers>;
|
|
21
21
|
//# sourceMappingURL=repo-policy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repo-policy.d.ts","sourceRoot":"","sources":["../../src/github/repo-policy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"repo-policy.d.ts","sourceRoot":"","sources":["../../src/github/repo-policy.ts"],"names":[],"mappings":"AA4CA,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AAEzC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,KAAK,iBAAiB,EAAc,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,MAAM,WAAW,wBAAyB,SAAQ,iBAAiB;IACjE;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,OAAQ,MAAM,WAAW,wBAAwB;;;;2EA6B3E,CAAC"}
|
|
@@ -90,8 +90,9 @@ export declare class RequiredChecksOmitted extends RequiredChecksOmitted_base<{
|
|
|
90
90
|
declare const NeverReportedContext_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
91
91
|
readonly _tag: "NeverReportedContext";
|
|
92
92
|
} & Readonly<A>;
|
|
93
|
-
/** A context being ADDED to `requiredStatusChecks` has never reported success
|
|
94
|
-
* branch
|
|
93
|
+
/** A context being ADDED to `requiredStatusChecks` has never reported success anywhere this
|
|
94
|
+
* family looks (the default branch's tip, then recent merged PR heads — K2, bounded, not full
|
|
95
|
+
* history). Requiring it would leave every future pull request pending forever. */
|
|
95
96
|
export declare class NeverReportedContext extends NeverReportedContext_base<{
|
|
96
97
|
readonly owner: string;
|
|
97
98
|
readonly repository: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository-ruleset-errors.d.ts","sourceRoot":"","sources":["../../src/github/repository-ruleset-errors.ts"],"names":[],"mappings":";;;AAQA;;;;GAIG;AACH,qBAAa,gBAAiB,SAAQ,sBAAqC;IACzE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;CACjC,CAAC;IACA,IAAa,OAAO,IAAI,MAAM,CAM7B;CACF;;;;AAED;6EAC6E;AAC7E,qBAAa,kBAAmB,SA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AI,MAAM,CAE7B;CACF;;;;AAED;kGACkG;AAClG,qBAAa,gBAAiB,SAAQ,sBAAqC;IACzE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;CACxB,CAAC;IACA,IAAa,OAAO,IAAI,MAAM,CAM7B;CACF;AAED,MAAM,MAAM,sBAAsB,GAC9B,gBAAgB,GAChB,kBAAkB,GAClB,mBAAmB,GACnB,kBAAkB,GAClB,YAAY,GACZ,qBAAqB,GACrB,oBAAoB,GACpB,wBAAwB,GACxB,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository-ruleset-form.d.ts","sourceRoot":"","sources":["../../src/github/repository-ruleset-form.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EACV,sBAAsB,EAEtB,sBAAsB,EAEvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"repository-ruleset-form.d.ts","sourceRoot":"","sources":["../../src/github/repository-ruleset-form.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EACV,sBAAsB,EAEtB,sBAAsB,EAEvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AA+DvF,wBAAgB,cAAc,CAAC,KAAK,EAAE,sBAAsB,GAAG,SAAS,GAAG,QAAQ,EAAE,CAmCpF;AAED;0BAC0B;AAC1B,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,sBAAsB,GAAG,iBAAiB,CAqBnF;AA+CD;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAiB/D"}
|
|
@@ -76,7 +76,8 @@ export declare function requiredChecksOmissionRefusal(input: {
|
|
|
76
76
|
/** Every context in the declared `requiredStatusChecks` that the LIVE ruleset does not already
|
|
77
77
|
* require — i.e. being added by this plan, the only case a never-reported context can matter. */
|
|
78
78
|
export declare const newlyRequiredContexts: (declared: RepositoryRulesetProps['rules'], live: RulesetRecord | undefined) => readonly string[];
|
|
79
|
-
/** Fails on the first newly-required context that has never reported success
|
|
80
|
-
*
|
|
79
|
+
/** Fails on the first newly-required context that has never reported success anywhere this
|
|
80
|
+
* family looks (the default branch's tip, then recent merged PR heads — K2) — checked once here
|
|
81
|
+
* (reconcile's observe step) and again by the standalone checker. */
|
|
81
82
|
export declare const refuseUnreportedContexts: <R = never>(octokit: RulesetOctokit<R>, owner: string, repo: string, contexts: readonly string[]) => Effect.Effect<void, NeverReportedContext | Error, R>;
|
|
82
83
|
//# sourceMappingURL=repository-ruleset-guards.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository-ruleset-guards.d.ts","sourceRoot":"","sources":["../../src/github/repository-ruleset-guards.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEtE,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnF;;aAEa;AACb,eAAO,MAAM,SAAS,MAAO;IAAE,UAAU,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAC;IAAC,WAAW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
|
2
|
+
* The real {@link RulesetOctokit} — every wire call this family makes, built from the EXPORTED
|
|
3
|
+
* `GitHubCredentials` service via `creds.octokit()`, exactly upstream's own `octokitFor` does
|
|
4
|
+
* (`node_modules/alchemy/src/GitHub/Octokit.ts`). H15: Octokit, not `@distilled.cloud/github`
|
|
5
|
+
* — its `S.Struct` request schemas have no field for `require_extra_approval_for_unattributed_
|
|
6
|
+
* changes` and would very likely strip an unknown key on encode; Octokit's REST methods hand
|
|
7
|
+
* their `parameters` object to `@octokit/endpoint` mostly as-is, so an extra JSON body key
|
|
8
|
+
* should reach the wire. repository-ruleset-wire.test.ts MEASURES this against a real Octokit
|
|
9
|
+
* instance with a fetch shim rather than asserting it from reading the source.
|
|
10
|
+
*
|
|
11
|
+
* ★ K2 (2026-09-24): "REPORTED SUCCESS" IS THE DEFAULT BRANCH'S TIP, THEN RECENT MERGED PR
|
|
12
|
+
* HEADS — NOT FULL HISTORY. The rendered CI (`packages/config/src/repo-shape/ci.ts`) triggers
|
|
13
|
+
* on `pull_request` ONLY, deliberately (measured 2026-09-15..22: 613 of 619 main-push runs
|
|
14
|
+
* duplicated an already-green PR run, ~41% of the mini's CI load) — so `ci`/`secret scan`/
|
|
15
|
+
* `CodeQL` NEVER report on the default branch's tip itself, only on PR heads. Checking the tip
|
|
16
|
+
* alone therefore refused adding any of them everywhere, including homeflare-builds' pending
|
|
17
|
+
* first ruleset. `contextReportedSuccess` now falls back to `recentMergedHeadShas` — bounded
|
|
18
|
+
* (`RECENT_MERGED_PR_LIMIT` heads, from one `per_page`-bounded list call, never the repo's
|
|
19
|
+
* full PR history) — so a context that only ever reports on PR heads is no longer refused
|
|
20
|
+
* everywhere, while a context that has never reported ANYWHERE (not the tip, not any recent
|
|
21
|
+
* merged head) still is: `NeverReportedContext`'s whole purpose survives unchanged.
|
|
22
|
+
* ⚠️ Still not full history: a context whose only successful run predates
|
|
23
|
+
* `RECENT_MERGED_PR_LIMIT` merges ago reads as never-reported until it runs again. Widening
|
|
24
|
+
* the bound trades this guard's cost (more vendor calls per newly-required context) against
|
|
25
|
+
* its reach; `RECENT_MERGED_PR_LIMIT` is a deliberate, named number for exactly that reason,
|
|
26
|
+
* not a magic constant.
|
|
27
|
+
*/
|
|
28
|
+
import type { Octokit as OctokitClient } from '@octokit/rest';
|
|
1
29
|
import { GitHubCredentials } from 'alchemy/GitHub';
|
|
30
|
+
import * as Effect from 'effect/Effect';
|
|
2
31
|
import type { RulesetOctokit } from './repository-ruleset-probe.ts';
|
|
3
32
|
export type RealRulesetOctokit = RulesetOctokit<GitHubCredentials>;
|
|
33
|
+
/** How many of the most-recently-updated MERGED pull requests' head SHAs to check, once the
|
|
34
|
+
* default branch's own tip has no reported success — see the file header (K2). */
|
|
35
|
+
export declare const RECENT_MERGED_PR_LIMIT = 10;
|
|
36
|
+
/** Whether `context` reported success for a single ref — a branch tip or a PR head SHA, both
|
|
37
|
+
* checked the same way (checks + statuses, exactly as GitHub's own UI does). Takes a plain
|
|
38
|
+
* `OctokitClient`, not an Effect service, so it and its caller below are testable directly
|
|
39
|
+
* against a real `@octokit/rest` instance with a fetch shim (repository-ruleset-octokit.test.ts)
|
|
40
|
+
* — no `GitHubCredentials` layer needed, mirroring `desiredWireRuleset`'s pure-function seam. */
|
|
41
|
+
export declare const hasRefReportedSuccess: (octokit: OctokitClient, owner: string, repo: string, ref: string, context: string) => Effect.Effect<boolean, Error>;
|
|
42
|
+
/** The head SHAs of up to `RECENT_MERGED_PR_LIMIT` most-recently-updated MERGED pull requests
|
|
43
|
+
* against `base` — one bounded list call (`RECENT_CLOSED_PR_PAGE_SIZE` closed PRs), filtered to
|
|
44
|
+
* merged, then capped. Never paginates further: a repo whose last `RECENT_MERGED_PR_LIMIT`
|
|
45
|
+
* merges are all older than its last `RECENT_CLOSED_PR_PAGE_SIZE` closed PRs simply yields fewer
|
|
46
|
+
* than the limit, same as a repo with too little history — both are the "still refused" case. */
|
|
47
|
+
export declare const recentMergedHeadShas: (octokit: OctokitClient, owner: string, repo: string, base: string) => Effect.Effect<readonly string[], Error>;
|
|
48
|
+
/** The full K2 answer: the default branch's tip, then (only if the tip has no success) up to
|
|
49
|
+
* `RECENT_MERGED_PR_LIMIT` recent merged PR heads, short-circuiting on the first success. `false`
|
|
50
|
+
* only once every one of those has been checked and none reported — the case
|
|
51
|
+
* `NeverReportedContext` exists to refuse. */
|
|
52
|
+
export declare const contextReportedSuccess: (octokit: OctokitClient, owner: string, repo: string, context: string) => Effect.Effect<boolean, Error>;
|
|
4
53
|
export declare const makeRulesetOctokit: (baseUrl: string | undefined) => RealRulesetOctokit;
|
|
5
54
|
//# sourceMappingURL=repository-ruleset-octokit.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository-ruleset-octokit.d.ts","sourceRoot":"","sources":["../../src/github/repository-ruleset-octokit.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"repository-ruleset-octokit.d.ts","sourceRoot":"","sources":["../../src/github/repository-ruleset-octokit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,EAAE,cAAc,EAAiC,MAAM,+BAA+B,CAAC;AAEnG,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,iBAAiB,CAAC,CAAC;AAcnE;kFACkF;AAClF,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAczC;;;;iGAIiG;AACjG,eAAO,MAAM,qBAAqB,YACvB,aAAa,SACf,MAAM,QACP,MAAM,OACP,MAAM,WACF,MAAM,KACd,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAmB3B,CAAC;AAEL;;;;iGAIiG;AACjG,eAAO,MAAM,oBAAoB,YACtB,aAAa,SACf,MAAM,QACP,MAAM,QACN,MAAM,KACX,MAAM,CAAC,MAAM,CAAC,SAAS,MAAM,EAAE,EAAE,KAAK,CAmBrC,CAAC;AAEL;;;8CAG8C;AAC9C,eAAO,MAAM,sBAAsB,YACxB,aAAa,SACf,MAAM,QACP,MAAM,WACH,MAAM,KACd,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAc3B,CAAC;AAEL,eAAO,MAAM,kBAAkB,YAAa,MAAM,GAAG,SAAS,KAAG,kBA+E/D,CAAC"}
|
|
@@ -64,7 +64,8 @@ export interface RulesetOctokit<R = never> {
|
|
|
64
64
|
readonly repo: string;
|
|
65
65
|
readonly rulesetId: number;
|
|
66
66
|
}) => Effect.Effect<void, Error, R>;
|
|
67
|
-
/** Whether `context` has
|
|
67
|
+
/** Whether `context` has reported success against the repository's default branch tip OR a
|
|
68
|
+
* recent merged PR head (K2, bounded — see repository-ruleset-octokit.ts's file header) —
|
|
68
69
|
* backs the `NeverReportedContext` guard. */
|
|
69
70
|
readonly hasContextReportedSuccess: (input: {
|
|
70
71
|
readonly owner: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository-ruleset-probe.d.ts","sourceRoot":"","sources":["../../src/github/repository-ruleset-probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAMlE,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3C;AA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CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,KACA,MAAM,CAAC,MAAM,CAAC,aAAa,GAAG,SAAS,EAAE,gBAAgB,GAAG,KAAK,EAAE,CAAC,CAmBnE,CAAC"}
|
|
@@ -16,10 +16,13 @@ export interface RepositoryRulesetPullRequestRule extends NonNullable<UpstreamRu
|
|
|
16
16
|
/** @default every method GitHub allows — the house baseline always pins `['squash']`. */
|
|
17
17
|
readonly allowedMergeMethods?: readonly ('merge' | 'squash' | 'rebase')[];
|
|
18
18
|
readonly requiredReviewers?: readonly RepositoryRulesetReviewerRule[];
|
|
19
|
-
/** `require_extra_approval_for_unattributed_changes` — see repository-ruleset.ts's H15.
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
|
|
19
|
+
/** `require_extra_approval_for_unattributed_changes` — see repository-ruleset.ts's H15.
|
|
20
|
+
* Both values are modeled (K1, 2026-09-23): 8 live rulesets carry `true` (aop, cloudflareforms,
|
|
21
|
+
* doesthishelp-workeropen, homeflare-anyauth, homeflare-desktop, loggarr, magictransit,
|
|
22
|
+
* proxmox-tb4 — re-read live via `gh api repos/taslabs-net/<repo>/rulesets/<id>`,
|
|
23
|
+
* 2026-09-23), and this resource declares exactly what is live or it cannot adopt them —
|
|
24
|
+
* `undefined` stays "no opinion" (GitHub defaults an absent key to `true`). */
|
|
25
|
+
readonly extraApprovalForUnattributedChanges?: boolean;
|
|
23
26
|
}
|
|
24
27
|
export interface RepositoryRulesetStatusChecksRule extends NonNullable<UpstreamRules['requiredStatusChecks']> {
|
|
25
28
|
readonly doNotEnforceOnCreate?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository-ruleset-props.d.ts","sourceRoot":"","sources":["../../src/github/repository-ruleset-props.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,KAAK,a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AAC,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAC;IAC1E,QAAQ,CAAC,iBAAiB,CAAC,EAAE,SAAS,6BAA6B,EAAE,CAAC;IACtE;;;;;mFAK+E;IAC/E,QAAQ,CAAC,mCAAmC,CAAC,EAAE,OAAO,CAAC;CACxD;AAED,MAAM,WAAW,iCAAkC,SAAQ,WAAW,CACpE,aAAa,CAAC,sBAAsB,CAAC,CACtC;IACC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC;CACzC;AAED,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAClD,aAAa,EACb,aAAa,GAAG,sBAAsB,CACvC;IACC;;;;;;;;;;gGAU4F;IAC5F,QAAQ,CAAC,WAAW,CAAC,EAAE,gCAAgC,GAAG,KAAK,CAAC;IAChE;2FACuF;IACvF,QAAQ,CAAC,oBAAoB,CAAC,EAAE,iCAAiC,GAAG,KAAK,CAAC;CAC3E;AAED,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC;IACzE,QAAQ,CAAC,KAAK,CAAC,EAAE,sBAAsB,CAAC;IACxC;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,QAAQ,CAAC,0BAA0B,CAAC,EAAE;QAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAClE;;;;;;;OAOG;IACH,QAAQ,CAAC,wBAAwB,CAAC,EAAE;QAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CACjE"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `repoPolicyProviders` — the documented stack wiring for `RepositoryRuleset` (directly, or
|
|
3
|
+
* through `declareRepoPolicy` / `declareRepoBaseline`): `GitHub.providers()` and
|
|
4
|
+
* `RepositoryRulesetProvider()`, composed so the whole thing typechecks and needs nothing
|
|
5
|
+
* further from the stack.
|
|
6
|
+
*
|
|
7
|
+
* providers: repoPolicyProviders()
|
|
8
|
+
*
|
|
9
|
+
* ⛔ WHY THIS EXISTS — MEASURED 2026-09-24 (homeflare-builds bump PR 6, tsc). Writing the two
|
|
10
|
+
* providers side by side, `Layer.mergeAll(GitHub.providers(), RepositoryRulesetProvider())`,
|
|
11
|
+
* type-errors: `RepositoryRulesetProvider()`'s handlers call `octokitFor`, which needs
|
|
12
|
+
* `GitHubCredentials` — a requirement of the PROVIDER's layer, correctly inferred by
|
|
13
|
+
* `Provider.succeed` from `repositoryRulesetHandlers` in repository-ruleset.ts. Merging two
|
|
14
|
+
* layers does not thread one's output into the other's requirement; `RepositoryRulesetProvider()`
|
|
15
|
+
* still needs `GitHubCredentials` fed in. `GitHub.providers()` is the only thing here that
|
|
16
|
+
* resolves credentials (env, stored PAT, `gh` CLI, or OAuth — see `alchemy/src/GitHub/
|
|
17
|
+
* Providers.ts`), and — because it chains `Layer.provideMerge(Credentials.fromAuthProvider(…))`
|
|
18
|
+
* internally rather than `Layer.provide` — its own OUTPUT includes `GitHubCredentials`
|
|
19
|
+
* alongside `GitHub.Providers`. `Layer.provideMerge(github)` on `RepositoryRulesetProvider()`
|
|
20
|
+
* both supplies that requirement AND keeps `github`'s own output merged in for any
|
|
21
|
+
* `GitHub.Repository`/`GitHub.Ruleset` the caller also declares. `github` is built once and
|
|
22
|
+
* referenced twice below — Effect's layer memoization (by reference) builds it once, not
|
|
23
|
+
* twice, not twice against the auth provider either.
|
|
24
|
+
*
|
|
25
|
+
* ★ THIS IS ONLY HALF OF 2026-09-24's FIX. The other half — `RepositoryRuleset`'s own `Resource<>`
|
|
26
|
+
* declaration no longer naming `GitHubCredentials` in its 5th (`Providers`) slot — lives in
|
|
27
|
+
* repository-ruleset.ts's file header; that half is what let a stack BODY calling
|
|
28
|
+
* `declareRepoPolicy`/`declareRepoBaseline` typecheck at all. Composing the providers
|
|
29
|
+
* correctly, as this function does, does not by itself fix a body that still requires
|
|
30
|
+
* `GitHubCredentials` directly.
|
|
31
|
+
*
|
|
32
|
+
* ⚠️ DON'T ALSO MERGE A SEPARATE `GitHub.providers()` CALL IN. `github` here is one Layer
|
|
33
|
+
* object referenced twice, which Effect's layer memoization (by reference, ADVERSARIAL
|
|
34
|
+
* REVIEW 2026-09-24: confirmed against `effect@4.0.0-rc.115`'s own `MemoMap`) builds once. A
|
|
35
|
+
* stack that ALSO writes its own `GitHub.providers()` alongside this function's result is a
|
|
36
|
+
* second, distinct Layer object — a genuine second credential resolution, not shared with
|
|
37
|
+
* this one. Get every GitHub resource's providers from this one call.
|
|
38
|
+
*/
|
|
39
|
+
import * as GitHub from 'alchemy/GitHub';
|
|
40
|
+
import * as Layer from 'effect/Layer';
|
|
41
|
+
export declare const repoPolicyProviders: (options?: GitHub.ProvidersOptions) => Layer.Layer<import("alchemy/Auth/Credentials").CredentialsStore | GitHub.GitHubCredentials | import("alchemy/Auth/Profile").ProfileStore | import("alchemy").Provider<import("./repository-ruleset.ts").RepositoryRuleset> | GitHub.Providers, never, import("alchemy").AuthProviders | import("effect/unstable/process/ChildProcessSpawner").ChildProcessSpawner | import("effect/FileSystem").FileSystem | import("effect/Path").Path>;
|
|
42
|
+
//# sourceMappingURL=repository-ruleset-providers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository-ruleset-providers.d.ts","sourceRoot":"","sources":["../../src/github/repository-ruleset-providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAGtC,eAAO,MAAM,mBAAmB,aAAc,MAAM,CAAC,gBAAgB,6aAGpE,CAAC"}
|
|
@@ -38,9 +38,31 @@
|
|
|
38
38
|
* meant to allow. `octokitFor`/`GitHubCredentials` are upstream's own EXPORTED building
|
|
39
39
|
* blocks (S23's second clause: reuse Alchemy's own client construction), so the client itself
|
|
40
40
|
* is not hand-rolled — only the choice of Octokit over distilled is a recorded divergence.
|
|
41
|
+
*
|
|
42
|
+
* ⛔ CREDENTIALS BELONG TO THE PROVIDER'S LAYER, NOT THE RESOURCE'S DECLARATION — MEASURED
|
|
43
|
+
* 2026-09-24 (homeflare-builds bump PR 6, tsc TS2345). The `Resource<Type, Props, Attributes,
|
|
44
|
+
* Binding, Providers>` 5th type parameter had `GitHubCredentials` here; that puts the
|
|
45
|
+
* credential requirement on every `yield* RepositoryRuleset(...)` CALL SITE (see
|
|
46
|
+
* `alchemy/src/Resource.ts#ResourceClass`: `Req = R["Providers"] extends undefined ?
|
|
47
|
+
* Provider<R> : R["Providers"]`), so a STACK BODY that merely declares the resource would
|
|
48
|
+
* itself need `GitHubCredentials` in its own effect context — which a stack body cannot
|
|
49
|
+
* produce (`Alchemy.Stack`'s own type, `alchemy/src/Stack.ts#ProviderServices`, is a closed
|
|
50
|
+
* union of tagged marker interfaces — `ProviderCollectionLike | Provider<any> |
|
|
51
|
+
* EnvironmentLike | CredentialsLike | DockerLike` — and `GitHubCredentials` matches none of
|
|
52
|
+
* them structurally). VERIFIED against upstream `Ruleset` (`node_modules/alchemy/src/GitHub/
|
|
53
|
+
* Ruleset.ts`): its 5th slot is `GitHub.Providers`, the ProviderCollection tag `GitHub.
|
|
54
|
+
* providers()` OUTPUTS — never the raw `GitHubCredentials` service upstream's OWN provider
|
|
55
|
+
* handlers pull in via `octokitFor`. `GitHubCredentials` stays confined to the PROVIDER's
|
|
56
|
+
* layer requirement (`Provider.succeed`'s inferred `ReadReq | DiffReq | ReconcileReq |
|
|
57
|
+
* DeleteReq`, below), never the declaration's. Omitting the 5th parameter here defaults it to
|
|
58
|
+
* `undefined`, so the declaration's own requirement becomes `Provider<RepositoryRuleset>` —
|
|
59
|
+
* itself a `Provider<any>`, a real `ProviderServices` member — matching the pattern a
|
|
60
|
+
* standalone (non-collection) resource actually needs. See `repoPolicyProviders()` in
|
|
61
|
+
* repository-ruleset-providers.ts for the layer composition this now requires (the provider
|
|
62
|
+
* still needs `GitHubCredentials` fed in — that half of the fix was already correct, per
|
|
63
|
+
* `docs/repository-ruleset.md`).
|
|
41
64
|
*/
|
|
42
65
|
import { Resource } from 'alchemy';
|
|
43
|
-
import type { GitHubCredentials } from 'alchemy/GitHub';
|
|
44
66
|
import * as Provider from 'alchemy/Provider';
|
|
45
67
|
import { type RulesetRecord } from './repository-ruleset-probe.ts';
|
|
46
68
|
import type { RepositoryRulesetProps } from './repository-ruleset-props.ts';
|
|
@@ -52,10 +74,10 @@ export interface RepositoryRulesetAttributes {
|
|
|
52
74
|
readonly createdAt: string | undefined;
|
|
53
75
|
readonly updatedAt: string | undefined;
|
|
54
76
|
}
|
|
55
|
-
export interface RepositoryRuleset extends Resource<'GitHub.RepositoryRuleset', RepositoryRulesetProps, RepositoryRulesetAttributes, never
|
|
77
|
+
export interface RepositoryRuleset extends Resource<'GitHub.RepositoryRuleset', RepositoryRulesetProps, RepositoryRulesetAttributes, never> {
|
|
56
78
|
}
|
|
57
79
|
export declare const RepositoryRuleset: import("alchemy").ResourceClass<RepositoryRuleset>;
|
|
58
80
|
export declare const attrsOf: (r: RulesetRecord) => RepositoryRulesetAttributes;
|
|
59
|
-
export declare const repositoryRulesetHandlers: Provider.ProviderService<RepositoryRuleset, GitHubCredentials, never, never, GitHubCredentials, GitHubCredentials, never, never, never>;
|
|
60
|
-
export declare const RepositoryRulesetProvider: () => import("effect/Layer").Layer<Provider.Provider<RepositoryRuleset>, never, GitHubCredentials>;
|
|
81
|
+
export declare const repositoryRulesetHandlers: Provider.ProviderService<RepositoryRuleset, import("alchemy/GitHub/Credentials").GitHubCredentials, never, never, import("alchemy/GitHub/Credentials").GitHubCredentials, import("alchemy/GitHub/Credentials").GitHubCredentials, never, never, never>;
|
|
82
|
+
export declare const RepositoryRulesetProvider: () => import("effect/Layer").Layer<Provider.Provider<RepositoryRuleset>, never, import("alchemy/GitHub/Credentials").GitHubCredentials>;
|
|
61
83
|
//# sourceMappingURL=repository-ruleset.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository-ruleset.d.ts","sourceRoot":"","sources":["../../src/github/repository-ruleset.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"repository-ruleset.d.ts","sourceRoot":"","sources":["../../src/github/repository-ruleset.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGnC,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAQ7C,OAAO,EAAE,KAAK,aAAa,EAAe,MAAM,+BAA+B,CAAC;AAChF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAG5E,YAAY,EACV,sBAAsB,EACtB,gCAAgC,EAChC,6BAA6B,EAC7B,sBAAsB,EACtB,iCAAiC,GAClC,MAAM,+BAA+B,CAAC;AAEvC,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;CACxC;AAED,MAAM,WAAW,iBAAkB,SAAQ,QAAQ,CACjD,0BAA0B,EAC1B,sBAAsB,EACtB,2BAA2B,EAC3B,KAAK,CAIN;CAAG;AAEJ,eAAO,MAAM,iBAAiB,oDAE5B,CAAC;AAEH,eAAO,MAAM,OAAO,MAAO,aAAa,KAAG,2BAMzC,CAAC;AA4CH,eAAO,MAAM,yBAAyB,wPAkEpC,CAAC;AAEH,eAAO,MAAM,yBAAyB,yIAC0B,CAAC"}
|
|
@@ -1,31 +1,42 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A
|
|
3
|
-
*
|
|
2
|
+
* A fake of LiteLLM's `/config/pass_through_endpoint` routes for tests — TEST ONLY, never imported
|
|
3
|
+
* by `index.ts` (the netbox/forgejo house convention for test-only helpers). Mirrors
|
|
4
|
+
* `../netbox/fake-netbox.ts`/`../forgejo/fake-forgejo.ts`: a `fetch` function handed to Effect's
|
|
5
|
+
* real `FetchHttpClient` through its `Fetch` reference, so a test exercises distilled's REAL path
|
|
6
|
+
* assembly, JSON encode/decode and status→typed-error matching (`BadRequest`, `NotFound`, …) —
|
|
7
|
+
* nothing about that matching is re-implemented here, only the wire responses a scenario needs.
|
|
4
8
|
*
|
|
5
9
|
* ★ MODELS THE WHOLE-FIELD READ-MODIFY-WRITE ON PURPOSE. `general_settings.pass_through_endpoints`
|
|
6
|
-
* is ONE field (
|
|
7
|
-
* (so two concurrent
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
+
* is ONE field (operations.ts's header), so every mutation here reads the CURRENT row list,
|
|
11
|
+
* awaits (so two concurrent calls can interleave — no real socket needed, `fetch` is just an
|
|
12
|
+
* async function the runtime awaits), then writes back what it captured — not what is there by
|
|
13
|
+
* the time it writes. Two `create` calls that race lose one row, exactly like the vendor field
|
|
14
|
+
* would without `operations.ts`'s per-base-URL semaphore serialising them.
|
|
10
15
|
* ⚠️ WHAT THIS FAKE DOES NOT MODEL: PROXY_ADMIN vs. a lesser role for most routes (any correct
|
|
11
|
-
* bearer token is accepted)
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
16
|
+
* bearer token is accepted). `forbidDelete` is the one exception: it models the real asymmetry
|
|
17
|
+
* `operations.ts`'s header describes — `DELETE` routes through `update_config_general_settings`,
|
|
18
|
+
* which 400s `not_allowed_access` for a non-PROXY_ADMIN caller (or a disconnected DB) on a row
|
|
19
|
+
* that is genuinely still live, the SAME status a missing-id delete gets (proxy_server.py:
|
|
20
|
+
* 16389-16416 at v1.100.0).
|
|
21
|
+
* ⚠️ UPDATE-OF-A-MISSING-ID IS 404, NOT 400 — corrected by this migration. The retired hand-rolled
|
|
22
|
+
* fake 400'd it as "not measured at the tag, a documented test simplification". The distilled
|
|
23
|
+
* SDK's own `patches/misc/update_pass_through_endpoints_*.json` cites the real source
|
|
24
|
+
* (`pass_through_endpoints.py`'s `update_pass_through_endpoints` at the tag): unlike DELETE, this
|
|
25
|
+
* route raises a genuine, unambiguous `HTTPException(404)` for a missing id, distinct from the
|
|
26
|
+
* 400 `update_config_general_settings` raises for the trailing auth/DB-disconnected write. This
|
|
27
|
+
* fake now matches that measured vendor behaviour.
|
|
18
28
|
*/
|
|
19
|
-
import type { PassThroughGenericEndpoint } from '
|
|
29
|
+
import type { PassThroughGenericEndpoint } from '@distilled.cloud/litellm/misc';
|
|
30
|
+
/** RFC 2606 placeholder — never a real host. Shared across tests, like `../netbox/fake-netbox.ts`. */
|
|
31
|
+
export declare const FAKE_BASE = "https://litellm.example.com";
|
|
20
32
|
export interface FakeRequest {
|
|
21
33
|
readonly method: string;
|
|
22
34
|
readonly path: string;
|
|
23
35
|
}
|
|
24
36
|
export interface FakeLitellm {
|
|
25
|
-
readonly
|
|
37
|
+
readonly fetch: typeof globalThis.fetch;
|
|
26
38
|
readonly rows: () => readonly PassThroughGenericEndpoint[];
|
|
27
39
|
readonly requests: () => readonly FakeRequest[];
|
|
28
|
-
readonly stop: () => void;
|
|
29
40
|
}
|
|
30
41
|
export declare const startFakeLitellm: (options?: {
|
|
31
42
|
readonly masterKey?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fake-litellm.d.ts","sourceRoot":"","sources":["../../src/litellm/fake-litellm.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"fake-litellm.d.ts","sourceRoot":"","sources":["../../src/litellm/fake-litellm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAEhF,sGAAsG;AACtG,eAAO,MAAM,SAAS,gCAAgC,CAAC;AAEvD,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,SAAS,0BAA0B,EAAE,CAAC;IAC3D,QAAQ,CAAC,QAAQ,EAAE,MAAM,SAAS,WAAW,EAAE,CAAC;CACjD;AAQD,eAAO,MAAM,gBAAgB,aAAc;IACzC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,0BAA0B,EAAE,CAAC;IACtD,qGAAqG;IACrG,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;CACjC,KAAG,WAiEH,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as Effect from 'effect/Effect';
|
|
2
|
-
import { type LitellmCreds } from './credentials.ts';
|
|
3
2
|
/** The planned action for each resource, deletions included, keyed by FQN. */
|
|
4
3
|
export type Planned = Readonly<Record<string, string>>;
|
|
5
4
|
/** A stack body: resource declarations, as an `alchemy.run.ts` would write them. */
|
|
@@ -15,13 +14,19 @@ export interface FakeStack {
|
|
|
15
14
|
/**
|
|
16
15
|
* ⚠️ CREDENTIALS/HTTPCLIENT ARE PROVIDED AROUND `deploy`, NOT BAKED INTO THE PROVIDER LAYER.
|
|
17
16
|
* `Provider.effect`'s own construction effect is `Effect.succeed(...)` (pass-through-endpoint.ts)
|
|
18
|
-
* — it never actually reads `
|
|
19
|
-
*
|
|
17
|
+
* — it never actually reads `Credentials`/`HttpClient`; only the HANDLERS it returns do, and
|
|
18
|
+
* those run later, whenever `Apply.ts` calls `provider.reconcile`/`read`/`delete`. Effect
|
|
20
19
|
* resolves a `yield*`'s service from whatever ambient context wraps the CALL SITE, so the layers
|
|
21
20
|
* those handlers need must wrap the whole plan+apply pipeline below, exactly where openbao's
|
|
22
21
|
* fake-stack.ts wraps `BaoEnv` around its own `deploy`.
|
|
22
|
+
* ★ `fetchFn` IS `startFakeLitellm(...).fetch` (fake-litellm.ts) — this harness never opens a real
|
|
23
|
+
* socket; `FetchHttpClient.Fetch` is the seam the SDK's protocol layer calls through, same as
|
|
24
|
+
* `../netbox/fake-netbox.ts`'s `fakeNetboxLayer`.
|
|
23
25
|
*/
|
|
24
|
-
export declare const fakeStack: (creds:
|
|
26
|
+
export declare const fakeStack: (creds: {
|
|
27
|
+
readonly apiKey: string;
|
|
28
|
+
readonly baseUrl: string;
|
|
29
|
+
}, fetchFn: typeof globalThis.fetch, name?: string) => FakeStack;
|
|
25
30
|
/** Every call that changed something, as `METHOD path`, in order. */
|
|
26
31
|
export declare const writesOf: (requests: readonly {
|
|
27
32
|
readonly method: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fake-stack.d.ts","sourceRoot":"","sources":["../../src/litellm/fake-stack.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fake-stack.d.ts","sourceRoot":"","sources":["../../src/litellm/fake-stack.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,8EAA8E;AAC9E,MAAM,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAEvD,oFAAoF;AACpF,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAEjE,6FAA6F;AAC7F,MAAM,MAAM,aAAa,GAAG;IAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEzD,MAAM,WAAW,SAAS;IACxB,wFAAwF;IACxF,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,aAAa,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACjF;AAiBD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,SAAS,UACb;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,WACnD,OAAO,UAAU,CAAC,KAAK,oBAE/B,SAiCF,CAAC;AAEF,qEAAqE;AACrE,eAAO,MAAM,QAAQ,aACT,SAAS;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,KACtE,MAAM,EACsF,CAAC"}
|
package/dist/litellm/index.d.ts
CHANGED
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
* LiteLLM providers for Alchemy.
|
|
3
3
|
*
|
|
4
4
|
* ⛔ THIS BARREL IS THE PUBLIC API, deliberately smaller than the directory — `fake-litellm.ts`
|
|
5
|
-
* and the internals `pass-through-form.ts`/`
|
|
6
|
-
* directly are not re-exported here (netbox/index.ts's own rule).
|
|
5
|
+
* and the internals `pass-through-form.ts`/`operations.ts` need but a consumer should not depend
|
|
6
|
+
* on directly are not re-exported here (netbox/index.ts's own rule).
|
|
7
|
+
* ★ CREDENTIALS AND TYPES NOW COME FROM `@distilled.cloud/litellm` ITSELF (2026-09-24, moved off a
|
|
8
|
+
* hand-rolled `client.ts`/`credentials.ts` the same way `/netbox` and `/forgejo` did) — a
|
|
9
|
+
* consumer building its own credentials layer imports `Credentials`/`CredentialsFromEnv`/
|
|
10
|
+
* `credentials` from `@distilled.cloud/litellm/Credentials` directly, not through this barrel.
|
|
7
11
|
*/
|
|
8
|
-
export
|
|
9
|
-
export { LITELLM_OPERATIONS, LitellmBadRequestError, type LitellmError, LitellmHttpError, type LitellmRequirements, LitellmTransportError, LitellmUnauthorizedError, } from './client.ts';
|
|
10
|
-
export type { PassThroughEndpointResponse, PassThroughGenericEndpoint, PassThroughGuardrailSettings, } from './generated/pass-through.ts';
|
|
12
|
+
export type { PassThroughEndpointResponse, PassThroughGenericEndpoint, PassThroughGuardrailSettings, } from '@distilled.cloud/litellm/misc';
|
|
11
13
|
export { LiteLLMPassThroughEndpoint, LiteLLMPassThroughEndpointProvider, LitellmConfigPathConflictError, LitellmLiteralSecretHeaderError, LitellmUnaddressableRowError, isLiteLLMPassThroughEndpoint, type PassThroughEndpointAttributes, type PassThroughEndpointError, type PassThroughEndpointProps, } from './pass-through-endpoint.ts';
|
|
12
14
|
export { litellmProviders } from './providers.ts';
|
|
13
15
|
//# sourceMappingURL=index.d.ts.map
|