@homeflare/alchemy 0.37.4 → 0.37.6
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/dist/linux/directory-read.d.ts +14 -0
- package/dist/linux/directory-read.d.ts.map +1 -0
- package/dist/linux/directory.d.ts.map +1 -1
- package/dist/linux/index.js +22 -6
- package/dist/linux/index.js.map +5 -4
- package/dist/litellm/index.js +12 -3
- package/dist/litellm/index.js.map +3 -3
- package/dist/litellm/operations.d.ts.map +1 -1
- package/dist/openbao/auth-role-form.d.ts +0 -6
- package/dist/openbao/auth-role-form.d.ts.map +1 -1
- package/dist/openbao/auth-role-identity.d.ts +11 -0
- package/dist/openbao/auth-role-identity.d.ts.map +1 -0
- package/dist/openbao/auth-role-wire.d.ts +23 -0
- package/dist/openbao/auth-role-wire.d.ts.map +1 -0
- package/dist/openbao/auth-role.d.ts.map +1 -1
- package/dist/openbao/bao-http.d.ts +34 -13
- package/dist/openbao/bao-http.d.ts.map +1 -1
- package/dist/openbao/distilled.d.ts +25 -0
- package/dist/openbao/distilled.d.ts.map +1 -0
- package/dist/openbao/fake-engines-roles.d.ts +5 -1
- package/dist/openbao/fake-engines-roles.d.ts.map +1 -1
- package/dist/openbao/index.js +358 -305
- package/dist/openbao/index.js.map +13 -9
- package/dist/openbao/policy-identity.d.ts +12 -0
- package/dist/openbao/policy-identity.d.ts.map +1 -0
- package/dist/openbao/policy-wire.d.ts +9 -8
- package/dist/openbao/policy-wire.d.ts.map +1 -1
- package/dist/openbao/policy.d.ts.map +1 -1
- package/dist/openbao/rename.d.ts +5 -0
- package/dist/openbao/rename.d.ts.map +1 -1
- package/dist/proxmox/index.js +2 -2
- package/dist/proxmox/index.js.map +3 -3
- package/dist/proxmox/node-network-wire.d.ts +14 -10
- package/dist/proxmox/node-network-wire.d.ts.map +1 -1
- package/docs/upstream-conformance.md +5 -3
- package/package.json +3 -2
- package/src/linux/directory-read.ts +24 -0
- package/src/linux/directory.test.ts +20 -0
- package/src/linux/directory.ts +21 -11
- package/src/litellm/operations.ts +31 -4
- package/src/litellm/pass-through-fetch-client.test.ts +40 -0
- package/src/openbao/auth-role-form.test.ts +11 -9
- package/src/openbao/auth-role-form.ts +0 -19
- package/src/openbao/auth-role-identity.ts +24 -0
- package/src/openbao/auth-role-sdk.test.ts +155 -0
- package/src/openbao/auth-role-wire.test.ts +128 -0
- package/src/openbao/auth-role-wire.ts +89 -0
- package/src/openbao/auth-role.ts +9 -9
- package/src/openbao/bao-http.ts +9 -7
- package/src/openbao/distilled-retry.test.ts +164 -0
- package/src/openbao/distilled.test.ts +146 -0
- package/src/openbao/distilled.ts +88 -0
- package/src/openbao/fake-engines-roles.ts +9 -2
- package/src/openbao/policy-distilled.test.ts +98 -0
- package/src/openbao/policy-identity.ts +24 -0
- package/src/openbao/policy-rename.test.ts +2 -2
- package/src/openbao/policy-wire.test.ts +5 -5
- package/src/openbao/policy-wire.ts +31 -11
- package/src/openbao/policy.ts +10 -13
- package/src/openbao/rename.ts +17 -1
- package/src/proxmox/node-network-read-failure.test.ts +24 -0
- package/src/proxmox/node-network-wire.ts +15 -17
package/dist/litellm/index.js
CHANGED
|
@@ -12,6 +12,7 @@ import * as misc from "@distilled.cloud/litellm/misc";
|
|
|
12
12
|
import { Credentials } from "@distilled.cloud/litellm/Credentials";
|
|
13
13
|
import * as Effect from "effect/Effect";
|
|
14
14
|
import * as Semaphore from "effect/Semaphore";
|
|
15
|
+
import * as FetchHttpClient from "effect/unstable/http/FetchHttpClient";
|
|
15
16
|
var semaphores = new Map;
|
|
16
17
|
var semaphoreFor = (baseUrl) => Effect.sync(() => {
|
|
17
18
|
const existing = semaphores.get(baseUrl);
|
|
@@ -21,13 +22,21 @@ var semaphoreFor = (baseUrl) => Effect.sync(() => {
|
|
|
21
22
|
semaphores.set(baseUrl, created);
|
|
22
23
|
return created;
|
|
23
24
|
});
|
|
25
|
+
var throughFetch = (io) => io.pipe(Effect.provide(FetchHttpClient.layer));
|
|
24
26
|
var mutate = (io) => Effect.gen(function* () {
|
|
25
27
|
const resolve = yield* Credentials;
|
|
26
28
|
const creds = yield* resolve;
|
|
27
29
|
const semaphore = yield* semaphoreFor(creds.apiBaseUrl);
|
|
28
|
-
return yield* semaphore.withPermits(1)(io);
|
|
30
|
+
return yield* semaphore.withPermits(1)(throughFetch(io));
|
|
29
31
|
});
|
|
30
|
-
var
|
|
32
|
+
var endpointsOf = (response) => {
|
|
33
|
+
const rows = response.endpoints;
|
|
34
|
+
if (!Array.isArray(rows)) {
|
|
35
|
+
return Effect.die(new Error("GET /config/pass_through_endpoint decoded no endpoints array. The call reached something other than the LiteLLM proxy."));
|
|
36
|
+
}
|
|
37
|
+
return Effect.succeed(rows);
|
|
38
|
+
};
|
|
39
|
+
var listPassThroughEndpoints = () => throughFetch(misc.getPassThroughEndpointsConfigPassThroughEndpointGet({})).pipe(Effect.flatMap(endpointsOf));
|
|
31
40
|
var createPassThroughEndpoint = (body) => mutate(misc.createPassThroughEndpointsConfigPassThroughEndpointPost(body).pipe(Effect.asVoid));
|
|
32
41
|
var updatePassThroughEndpoint = (endpointId, body) => mutate(misc.updatePassThroughEndpointsConfigPassThroughEndpointEndpointIdPost({
|
|
33
42
|
...body,
|
|
@@ -196,5 +205,5 @@ export {
|
|
|
196
205
|
litellmProviders
|
|
197
206
|
};
|
|
198
207
|
|
|
199
|
-
//# debugId=
|
|
208
|
+
//# debugId=37B90757C77EC46E64756E2164756E21
|
|
200
209
|
//# sourceMappingURL=index.js.map
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
"sources": ["../src/litellm/pass-through-endpoint.ts", "../src/litellm/operations.ts", "../src/litellm/pass-through-errors.ts", "../src/litellm/pass-through-form.ts", "../src/litellm/providers.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"/**\n * `LiteLLM.PassThroughEndpoint` — one row in LiteLLM's `general_settings.pass_through_endpoints`.\n *\n * ★ ADOPT-FRIENDLY BY id, NOT BY PATH. `output?.id` is used as the object's live id once the\n * engine has one — from our own prior create (the deterministic physical name) or from an\n * adopted foreign row — and `read` computes a FRESH physical name only for a resource the\n * engine has never resolved before. This is S7/S9's \"output is a cache of stable identifiers,\n * not proof the object exists\" and S13's \"an adopted object keeps its live name as an explicit\n * prop\", applied to an id LiteLLM lets a client choose (`_types.py:2192` at v1.100.0: create\n * takes a caller-supplied `id`, else `uuid4()`).\n *\n * ⛔ A PATH HELD BY AN `is_from_config` ROW IS REFUSED, NOT ADOPTED. A DB row on the same path\n * overrides it at runtime (`pass_through_endpoints.py` merges DB after config, at the tag) — so\n * creating one would silently take over a route the operator declared in `config.yaml`, the\n * exact \"DB row silently overrides the file\" the task names. `is_from_config` rows are also\n * never updated or deleted by this provider, for the same reason.\n * ⛔ A DB ROW WITH NO `id` (path-only, `_types.py`'s \"backwards compatibility\" case) CANNOT BE\n * ADDRESSED by the id-keyed update/delete calls this provider uses, so it is refused rather than\n * silently adopted into an id-based lifecycle it cannot actually manage — see docs/litellm.md.\n * ⛔ NO CREDENTIAL IS A PROP (S25). `LITELLM_PROXY_URL`/`LITELLM_PROXY_API_KEY` are read at call\n * time by `@distilled.cloud/litellm`'s own `CredentialsFromEnv` (providers.ts) — the same two\n * variable names the retired hand-rolled `credentials.ts` read.\n * ⛔ CREDENTIALS ARE NOT A RESOURCE REQUIREMENT. `LitellmOpContext` (`Credentials | HttpClient`)\n * belongs to the handlers at Apply, on `litellmProviders`'s layer. The 5th `Resource` parameter\n * used to be `LitellmRequirements | Stack | Stage`, so a stack body required `Credentials`, and\n * `Alchemy.Stack` rejects that (`\"LitellmCredentials\"` is not `\"Stack\"`). Measured 2026-09-24.\n */\nimport { Resource } from 'alchemy';\nimport { Unowned } from 'alchemy/AdoptPolicy';\nimport { isResolved } from 'alchemy/Diff';\nimport type { Input } from 'alchemy/Input';\nimport { createPhysicalName } from 'alchemy/PhysicalName';\nimport * as Provider from 'alchemy/Provider';\nimport type * as misc from '@distilled.cloud/litellm/misc';\nimport * as Effect from 'effect/Effect';\nimport * as Predicate from 'effect/Predicate';\nimport {\n createPassThroughEndpoint,\n deletePassThroughEndpoint,\n listPassThroughEndpoints,\n updatePassThroughEndpoint,\n} from './operations.ts';\nimport {\n LitellmConfigPathConflictError,\n LitellmLiteralSecretHeaderError,\n LitellmUnaddressableRowError,\n} from './pass-through-errors.ts';\nimport {\n type PassThroughEndpointAttributes,\n type PassThroughEndpointProps,\n createBody,\n literalSecretHeaders,\n matches,\n needsReplace,\n updateBody,\n} from './pass-through-form.ts';\n\nexport type { PassThroughEndpointAttributes, PassThroughEndpointProps };\nexport {\n LitellmConfigPathConflictError,\n LitellmLiteralSecretHeaderError,\n LitellmUnaddressableRowError,\n type PassThroughEndpointError,\n} from './pass-through-errors.ts';\n\nexport interface LiteLLMPassThroughEndpoint extends Resource<\n 'LiteLLM.PassThroughEndpoint',\n PassThroughEndpointProps,\n PassThroughEndpointAttributes\n> {}\n\nexport const LiteLLMPassThroughEndpoint = Resource<LiteLLMPassThroughEndpoint>(\n 'LiteLLM.PassThroughEndpoint',\n);\n\nexport const isLiteLLMPassThroughEndpoint = (value: unknown): value is LiteLLMPassThroughEndpoint =>\n Predicate.hasProperty(value, 'Type') && value.Type === 'LiteLLM.PassThroughEndpoint';\n\nconst toAttributes = (\n row: misc.PassThroughGenericEndpoint,\n fallbackId: string,\n): PassThroughEndpointAttributes => ({\n ...row,\n id: row.id ?? fallbackId,\n});\n\nconst physicalIdOf = (logicalId: string, instanceId: string) =>\n createPhysicalName({ id: logicalId, instanceId, lowercase: true, maxLength: 64 });\n\n/**\n * Find this resource's live row (by id) and, when absent, the row that already holds its `path`\n * (a config-file row to refuse, or a DB row LiteLLM did not give an id — also refused, see the\n * file header — or a genuine foreign DB row to hand back `Unowned`).\n */\nconst locate = (\n rows: readonly misc.PassThroughGenericEndpoint[],\n objectId: string,\n path: string,\n): {\n readonly mine: misc.PassThroughGenericEndpoint | undefined;\n readonly conflict: misc.PassThroughGenericEndpoint | undefined;\n} => {\n const mine = rows.find((row) => row.id === objectId);\n const conflict = mine === undefined ? rows.find((row) => row.path === path) : undefined;\n return { conflict, mine };\n};\n\n/** The typed refusal for a `path` conflict that cannot ever be adopted (config row, or no id). */\nconst conflictRefusal = (conflict: misc.PassThroughGenericEndpoint, path: string) =>\n conflict.is_from_config === true\n ? new LitellmConfigPathConflictError({ path })\n : new LitellmUnaddressableRowError({ path });\n\n/** `read`'s answer for a path conflict: `Unowned` when it is a real, addressable DB row — a typed refusal otherwise. */\nconst readConflict = (conflict: misc.PassThroughGenericEndpoint, path: string) =>\n conflict.is_from_config !== true && conflict.id !== undefined && conflict.id !== null\n ? Effect.succeed(Unowned(toAttributes(conflict, conflict.id)))\n : Effect.fail(conflictRefusal(conflict, path));\n\nconst refuseLiteralSecrets = (headers: Readonly<Record<string, unknown>> | undefined) => {\n const bad = literalSecretHeaders(headers);\n return bad.length === 0\n ? Effect.void\n : Effect.fail(new LitellmLiteralSecretHeaderError({ headers: bad }));\n};\n\n/** ⛔ TEST-ONLY EXPORT. Not on index.ts's barrel — a lifecycle test calls these directly against the fake. */\nexport const passThroughHandlers = {\n read: ({\n id,\n instanceId,\n olds,\n output,\n }: {\n id: string;\n instanceId: string;\n olds: PassThroughEndpointProps;\n output: PassThroughEndpointAttributes | undefined;\n }) =>\n Effect.gen(function* () {\n const objectId = output?.id ?? (yield* physicalIdOf(id, instanceId));\n const rows = yield* listPassThroughEndpoints();\n const { conflict, mine } = locate(rows, objectId, olds.path);\n if (mine !== undefined) return toAttributes(mine, objectId);\n if (conflict === undefined) return undefined;\n return yield* readConflict(conflict, olds.path);\n }),\n\n diff: ({\n news,\n output,\n }: {\n news: Input<PassThroughEndpointProps>;\n output: PassThroughEndpointAttributes | undefined;\n }) =>\n Effect.gen(function* () {\n if (!isResolved(news)) return undefined;\n yield* refuseLiteralSecrets(news.headers);\n if (output === undefined) return undefined;\n // ⛔ deleteFirst: TRUE — a create-first replace mints a new instanceId/id before the old row\n // on `path` is gone, so the new generation's `reconcile` would refuse it as a foreign\n // conflict (Apply.ts). Same fix this kit's other unique-identity providers use.\n if (needsReplace(output, news)) return { action: 'replace', deleteFirst: true } as const;\n return matches(output, news)\n ? ({ action: 'noop' } as const)\n : ({ action: 'update' } as const);\n }),\n\n reconcile: ({\n id,\n instanceId,\n news,\n output,\n }: {\n id: string;\n instanceId: string;\n news: PassThroughEndpointProps;\n output: PassThroughEndpointAttributes | undefined;\n }) =>\n Effect.gen(function* () {\n yield* refuseLiteralSecrets(news.headers);\n const objectId = output?.id ?? (yield* physicalIdOf(id, instanceId));\n const rows = yield* listPassThroughEndpoints();\n const { conflict, mine } = locate(rows, objectId, news.path);\n\n if (mine === undefined) {\n // ⚠️ A CONFLICT HERE — reconcile, not read — means ownership shifted between plan and\n // apply (a config row or a foreign DB row landed on this path after `read` cleared it).\n // `read` gates a genuine adopt by returning `Unowned`; reconcile itself never adopts,\n // so ANY conflict here fails rather than risking a second row on one path.\n if (conflict !== undefined) return yield* Effect.fail(conflictRefusal(conflict, news.path));\n yield* createPassThroughEndpoint(createBody(news, objectId));\n } else if (mine.is_from_config === true) {\n // ⛔ NEVER UPDATE OR DELETE AN `is_from_config` ROW, even one this resource's own\n // deterministic id happens to match (a config.yaml author could in principle choose the\n // same id `createPhysicalName` would). Refuse rather than silently editing the file's row.\n return yield* Effect.fail(new LitellmConfigPathConflictError({ path: news.path }));\n } else if (needsReplace(toAttributes(mine, objectId), news)) {\n yield* deletePassThroughEndpoint(objectId);\n yield* createPassThroughEndpoint(createBody(news, objectId));\n } else if (!matches(toAttributes(mine, objectId), news)) {\n const body = updateBody(news);\n if (Object.keys(body).length > 0) yield* updatePassThroughEndpoint(objectId, body);\n }\n\n const after = (yield* listPassThroughEndpoints()).find((row) => row.id === objectId);\n if (after === undefined) {\n return yield* Effect.die(\n new Error(\n `LiteLLM.PassThroughEndpoint ${news.path}: the write returned no error but id ` +\n `${objectId} is still absent from GET /config/pass_through_endpoint — read back ` +\n 'rather than trusting the call that just returned.',\n ),\n );\n }\n return toAttributes(after, objectId);\n }),\n\n delete: ({\n id,\n instanceId,\n olds,\n output,\n }: {\n id: string;\n instanceId: string;\n olds: PassThroughEndpointProps;\n output: PassThroughEndpointAttributes;\n }) =>\n Effect.gen(function* () {\n const objectId = output.id ?? (yield* physicalIdOf(id, instanceId));\n const rows = yield* listPassThroughEndpoints();\n const live = rows.find((row) => row.id === objectId);\n // ⛔ NEVER DELETE AN `is_from_config` ROW, and a DB row this resource never created (a path\n // match with a different id) is not this resource's to remove either.\n if (live === undefined || live.is_from_config === true || live.path !== olds.path) return;\n yield* deletePassThroughEndpoint(objectId);\n }),\n\n list: () => Effect.succeed([]),\n};\n\nexport const LiteLLMPassThroughEndpointProvider = () =>\n Provider.effect(\n LiteLLMPassThroughEndpoint,\n Effect.succeed(LiteLLMPassThroughEndpoint.Provider.of(passThroughHandlers)),\n );\n",
|
|
6
|
-
"/**\n * The four LiteLLM `/config/pass_through_endpoint*` calls this package writes to and reads from —\n * now through `@distilled.cloud/litellm`'s typed operations (S23), not a hand-rolled `HttpClient`\n * client. `client.ts` is retired; nothing else in this package imported it.\n *\n * ⛔ STILL WRAPPED IN A PER-BASE-URL SEMAPHORE, UNCHANGED FROM `client.ts`. LiteLLM stores every\n * pass-through endpoint in ONE `general_settings.pass_through_endpoints` list\n * (`pass_through_endpoints.py` at tag v1.100.0, mirrored in the SDK's own `misc.ts` docstrings),\n * so create/update/delete are each a read-modify-write of the WHOLE list through\n * `update_config_general_settings`. Two of this package's own calls racing each other — two\n * endpoints created in the same deploy — would each read the list, add their own row and write\n * it back, and the second write would silently drop the first row. The SDK has no opinion on\n * this: it is a quirk of how THIS vendor stores the resource, not a distilled protocol concern,\n * so it stays here, one layer above the typed calls. One permit per proxy serialises this\n * package's own writes; it cannot serialise against the LiteLLM UI or a second deploy process,\n * which is why `pass-through-endpoint.ts`'s `reconcile` reads back after writing rather than\n * trusting the call that just returned (docs/litellm.md).\n * ⛔ NO STATUS SNIFFING (S21). Every failure the SDK's own typed operations declare — `BadRequest`\n * (400), `NotFound` (404 on update only), `UnprocessableEntity` (422) plus the shared\n * `Unauthorized`/`TooManyRequests`/`InternalServerError`/`BadGateway`/`ServiceUnavailable`/\n * `GatewayTimeout` every operation carries — is a distilled patch's doing\n * (`@distilled.cloud/litellm`'s own `patches/misc/*.json`, applied at generation time), never a\n * status check here or in `pass-through-endpoint.ts`. Deleting an id LiteLLM does not have\n * answers `BadRequest` (measured against the tag's `pass_through_endpoint_delete` — the id is\n * looked up in the list and a miss raises `HTTPException(400)`, not 404) — but so does a\n * genuinely-live row when the caller isn't PROXY_ADMIN, or the DB is disconnected. Telling those\n * apart by re-listing, not by the `BadRequest`'s message text, is `pass-through-endpoint.ts`'s\n * `deletePassThroughEndpoint`'s own job (S21 — a status-and-a-real-read decision, never body\n * text) — this file only forwards the typed error.\n */\nimport * as misc from '@distilled.cloud/litellm/misc';\nimport { Credentials } from '@distilled.cloud/litellm/Credentials';\nimport type { LitellmOpContext } from '@distilled.cloud/litellm/Protocol';\nimport type { ConfigError } from '@distilled.cloud/litellm/Errors';\nimport * as Effect from 'effect/Effect';\nimport * as Semaphore from 'effect/Semaphore';\n\nexport type { LitellmOpContext } from '@distilled.cloud/litellm/Protocol';\nexport type LitellmRequirements = LitellmOpContext;\nexport type {\n PassThroughEndpointResponse,\n PassThroughGenericEndpoint,\n PassThroughGuardrailSettings,\n} from '@distilled.cloud/litellm/misc';\n\nconst semaphores = new Map<string, Semaphore.Semaphore>();\n\n/** One semaphore per base URL, created on first use. Never `Hash.structure` (S18) — a plain Map key. */\nconst semaphoreFor = (baseUrl: string): Effect.Effect<Semaphore.Semaphore> =>\n Effect.sync(() => {\n const existing = semaphores.get(baseUrl);\n if (existing !== undefined) return existing;\n const created = Semaphore.makeUnsafe(1);\n semaphores.set(baseUrl, created);\n return created;\n });\n\n/**\n * Serialises a write against this call's own base URL — see the file header.\n *\n * ⚠️ `Credentials` itself ends in `Effect.orDie` on a missing/misspelled env var (Q6, decision\n * 49 \"upstream wins\", 2026-09-24, matching distilled's own convention — 73 of 80 packages'\n * `credentials.ts` do the same at `homeflare/base`), so resolving it here can no longer fail\n * typed. The `| ConfigError` this function still adds to its return type stays only because\n * `@distilled.cloud/litellm`'s own `LitellmOpError` (protocol.ts) unconditionally declares\n * `ConfigError` as a member of every generated operation's error union regardless of\n * `Credentials`'s own type — so `E` (the wrapped operation's error) already contains it, and\n * this widening is a genuine no-op for callers, not dead type-state left over from the revert.\n */\nconst mutate = <A, E>(\n io: Effect.Effect<A, E, LitellmOpContext>,\n): Effect.Effect<A, E | ConfigError, LitellmOpContext> =>\n Effect.gen(function* () {\n const resolve = yield* Credentials;\n const creds = yield* resolve;\n const semaphore = yield* semaphoreFor(creds.apiBaseUrl);\n return yield* semaphore.withPermits(1)(io);\n });\n\n/** GET /config/pass_through_endpoint — every row, config-file and DB alike. Not under the semaphore: reads don't race the field. */\nexport const listPassThroughEndpoints = (): Effect.Effect<\n readonly misc.PassThroughGenericEndpoint[],\n misc.GetPassThroughEndpointsConfigPassThroughEndpointGetError,\n LitellmOpContext\n> =>\n misc
|
|
6
|
+
"/**\n * The four LiteLLM `/config/pass_through_endpoint*` calls this package writes to and reads from —\n * now through `@distilled.cloud/litellm`'s typed operations (S23), not a hand-rolled `HttpClient`\n * client. `client.ts` is retired; nothing else in this package imported it.\n *\n * ⛔ STILL WRAPPED IN A PER-BASE-URL SEMAPHORE, UNCHANGED FROM `client.ts`. LiteLLM stores every\n * pass-through endpoint in ONE `general_settings.pass_through_endpoints` list\n * (`pass_through_endpoints.py` at tag v1.100.0, mirrored in the SDK's own `misc.ts` docstrings),\n * so create/update/delete are each a read-modify-write of the WHOLE list through\n * `update_config_general_settings`. Two of this package's own calls racing each other — two\n * endpoints created in the same deploy — would each read the list, add their own row and write\n * it back, and the second write would silently drop the first row. The SDK has no opinion on\n * this: it is a quirk of how THIS vendor stores the resource, not a distilled protocol concern,\n * so it stays here, one layer above the typed calls. One permit per proxy serialises this\n * package's own writes; it cannot serialise against the LiteLLM UI or a second deploy process,\n * which is why `pass-through-endpoint.ts`'s `reconcile` reads back after writing rather than\n * trusting the call that just returned (docs/litellm.md).\n * ⛔ NO STATUS SNIFFING (S21). Every failure the SDK's own typed operations declare — `BadRequest`\n * (400), `NotFound` (404 on update only), `UnprocessableEntity` (422) plus the shared\n * `Unauthorized`/`TooManyRequests`/`InternalServerError`/`BadGateway`/`ServiceUnavailable`/\n * `GatewayTimeout` every operation carries — is a distilled patch's doing\n * (`@distilled.cloud/litellm`'s own `patches/misc/*.json`, applied at generation time), never a\n * status check here or in `pass-through-endpoint.ts`. Deleting an id LiteLLM does not have\n * answers `BadRequest` (measured against the tag's `pass_through_endpoint_delete` — the id is\n * looked up in the list and a miss raises `HTTPException(400)`, not 404) — but so does a\n * genuinely-live row when the caller isn't PROXY_ADMIN, or the DB is disconnected. Telling those\n * apart by re-listing, not by the `BadRequest`'s message text, is `pass-through-endpoint.ts`'s\n * `deletePassThroughEndpoint`'s own job (S21 — a status-and-a-real-read decision, never body\n * text) — this file only forwards the typed error.\n */\nimport * as misc from '@distilled.cloud/litellm/misc';\nimport { Credentials } from '@distilled.cloud/litellm/Credentials';\nimport type { LitellmOpContext } from '@distilled.cloud/litellm/Protocol';\nimport type { ConfigError } from '@distilled.cloud/litellm/Errors';\nimport * as Effect from 'effect/Effect';\nimport * as Semaphore from 'effect/Semaphore';\nimport * as FetchHttpClient from 'effect/unstable/http/FetchHttpClient';\n\nexport type { LitellmOpContext } from '@distilled.cloud/litellm/Protocol';\nexport type LitellmRequirements = LitellmOpContext;\nexport type {\n PassThroughEndpointResponse,\n PassThroughGenericEndpoint,\n PassThroughGuardrailSettings,\n} from '@distilled.cloud/litellm/misc';\n\nconst semaphores = new Map<string, Semaphore.Semaphore>();\n\n/** One semaphore per base URL, created on first use. Never `Hash.structure` (S18) — a plain Map key. */\nconst semaphoreFor = (baseUrl: string): Effect.Effect<Semaphore.Semaphore> =>\n Effect.sync(() => {\n const existing = semaphores.get(baseUrl);\n if (existing !== undefined) return existing;\n const created = Semaphore.makeUnsafe(1);\n semaphores.set(baseUrl, created);\n return created;\n });\n\n/**\n * Serialises a write against this call's own base URL — see the file header.\n *\n * ⚠️ `Credentials` itself ends in `Effect.orDie` on a missing/misspelled env var (Q6, decision\n * 49 \"upstream wins\", 2026-09-24, matching distilled's own convention — 73 of 80 packages'\n * `credentials.ts` do the same at `homeflare/base`), so resolving it here can no longer fail\n * typed. The `| ConfigError` this function still adds to its return type stays only because\n * `@distilled.cloud/litellm`'s own `LitellmOpError` (protocol.ts) unconditionally declares\n * `ConfigError` as a member of every generated operation's error union regardless of\n * `Credentials`'s own type — so `E` (the wrapped operation's error) already contains it, and\n * this widening is a genuine no-op for callers, not dead type-state left over from the revert.\n */\n/**\n * ⛔ THE STACK'S AMBIENT `HttpClient` MAY BE CADDY'S. `caddyProviders()` provideMerges a client\n * that dials the admin listener and ignores the request host (`caddy-http-client.ts`). Measured\n * 2026-09-25: that client answers `GET /config/pass_through_endpoint` with HTTP 200 `null`\n * (Caddy's empty-config body). The decoded value then has no `endpoints`, and `locate` throws\n * `rows.find` of undefined. FetchHttpClient uses the URL the LiteLLM protocol built. An outer\n * `Fetch` service still wins inside that client, which is how the fake proxy stays the test\n * transport.\n */\nconst throughFetch = <A, E, R>(io: Effect.Effect<A, E, R>) =>\n io.pipe(Effect.provide(FetchHttpClient.layer));\n\nconst mutate = <A, E>(\n io: Effect.Effect<A, E, LitellmOpContext>,\n): Effect.Effect<A, E | ConfigError, LitellmOpContext> =>\n Effect.gen(function* () {\n const resolve = yield* Credentials;\n const creds = yield* resolve;\n const semaphore = yield* semaphoreFor(creds.apiBaseUrl);\n return yield* semaphore.withPermits(1)(throughFetch(io));\n });\n\nconst endpointsOf = (\n response: misc.PassThroughEndpointResponse,\n): Effect.Effect<readonly misc.PassThroughGenericEndpoint[]> => {\n const rows = response.endpoints;\n if (!Array.isArray(rows)) {\n return Effect.die(\n new Error(\n 'GET /config/pass_through_endpoint decoded no endpoints array. The call reached something other than the LiteLLM proxy.',\n ),\n );\n }\n return Effect.succeed(rows);\n};\n\n/** GET /config/pass_through_endpoint — every row, config-file and DB alike. Not under the semaphore: reads don't race the field. */\nexport const listPassThroughEndpoints = (): Effect.Effect<\n readonly misc.PassThroughGenericEndpoint[],\n misc.GetPassThroughEndpointsConfigPassThroughEndpointGetError,\n LitellmOpContext\n> =>\n throughFetch(misc.getPassThroughEndpointsConfigPassThroughEndpointGet({})).pipe(\n Effect.flatMap(endpointsOf),\n );\n\n/** POST /config/pass_through_endpoint. `body` carries `id` — see pass-through-form.ts. */\nexport const createPassThroughEndpoint = (\n body: misc.PassThroughGenericEndpoint,\n): Effect.Effect<\n void,\n misc.CreatePassThroughEndpointsConfigPassThroughEndpointPostError,\n LitellmOpContext\n> => mutate(misc.createPassThroughEndpointsConfigPassThroughEndpointPost(body).pipe(Effect.asVoid));\n\n/**\n * POST /config/pass_through_endpoint/{endpoint_id}. Merges with `exclude_none` — see\n * pass-through-form.ts. `body` is `pass-through-form.ts`'s own `UpdateBody`, not a blanket\n * `Partial<>` — `path`/`target` are the two fields the SDK's request type still requires\n * non-optionally on an update.\n */\nexport const updatePassThroughEndpoint = (\n endpointId: string,\n body: Partial<Omit<misc.PassThroughGenericEndpoint, 'path' | 'target'>> &\n Pick<misc.PassThroughGenericEndpoint, 'path' | 'target'>,\n): Effect.Effect<\n void,\n misc.UpdatePassThroughEndpointsConfigPassThroughEndpointEndpointIdPostError,\n LitellmOpContext\n> =>\n mutate(\n misc\n .updatePassThroughEndpointsConfigPassThroughEndpointEndpointIdPost({\n ...body,\n endpoint_id: endpointId,\n })\n .pipe(Effect.asVoid),\n );\n\n/**\n * DELETE /config/pass_through_endpoint?endpoint_id=… — idempotent BY THIS FUNCTION, not by the\n * vendor. ⚠️ Measured at v1.100.0: deleting an id the list does not have raises `HTTPException(400)`\n * from `pass_through_endpoint_delete`, which the SDK decodes as a typed `BadRequest` — but the SAME\n * route also raises the SAME `BadRequest` for `not_allowed_access` (a non-PROXY_ADMIN caller) or a\n * disconnected DB, on a row that never got deleted. A `BadRequest` alone cannot tell the two apart,\n * so THIS FUNCTION DOESN'T GUESS FROM THE TAG ALONE: on `BadRequest` it re-lists (a GET — no\n * PROXY_ADMIN required) and only treats the delete as already-done if `endpointId` is genuinely\n * absent; otherwise the delete failed and this re-fails with the ORIGINAL error, not a message\n * match (S21 — a status-and-a-real-read decision, never body text).\n */\nexport const deletePassThroughEndpoint = (\n endpointId: string,\n): Effect.Effect<\n void,\n misc.DeletePassThroughEndpointsConfigPassThroughEndpointDeleteError,\n LitellmOpContext\n> =>\n mutate(\n misc\n .deletePassThroughEndpointsConfigPassThroughEndpointDelete({ endpoint_id: endpointId })\n .pipe(\n Effect.asVoid,\n Effect.catchTag('BadRequest', (original) =>\n Effect.gen(function* () {\n const rows = yield* listPassThroughEndpoints();\n if (rows.some((row) => row.id === endpointId)) return yield* Effect.fail(original);\n }),\n ),\n ),\n );\n",
|
|
7
7
|
"/**\n * The typed refusals `LiteLLM.PassThroughEndpoint` raises on top of `@distilled.cloud/litellm`'s\n * own SDK errors — split out of pass-through-endpoint.ts to keep that file under the house's\n * 250-line cap once this migration added the four named SDK error-union re-exports.\n */\nimport type * as misc from '@distilled.cloud/litellm/misc';\nimport * as Data from 'effect/Data';\n\nexport class LitellmConfigPathConflictError extends Data.TaggedError(\n 'LitellmConfigPathConflictError',\n)<{\n readonly path: string;\n}> {}\nexport class LitellmUnaddressableRowError extends Data.TaggedError('LitellmUnaddressableRowError')<{\n readonly path: string;\n}> {}\nexport class LitellmLiteralSecretHeaderError extends Data.TaggedError(\n 'LitellmLiteralSecretHeaderError',\n)<{\n readonly headers: readonly string[];\n}> {}\n\n/**\n * ⛔ THE FOUR SDK ERROR UNIONS, NAMED, NOT `LitellmOpError` ALONE. `catchTag`'s tag-literal\n * inference needs a concrete union to resolve `\"BadRequest\"`/`\"NotFound\"` against (the same\n * reason `netbox/resource.ts` leaves `NotFound` folding to each resource file, not its shared\n * engine) — `operations.ts` already returns each call's own precise per-operation error type, so\n * this is just their union, not a re-widening.\n */\nexport type PassThroughEndpointError =\n | misc.GetPassThroughEndpointsConfigPassThroughEndpointGetError\n | misc.CreatePassThroughEndpointsConfigPassThroughEndpointPostError\n | misc.UpdatePassThroughEndpointsConfigPassThroughEndpointEndpointIdPostError\n | misc.DeletePassThroughEndpointsConfigPassThroughEndpointDeleteError\n | LitellmConfigPathConflictError\n | LitellmUnaddressableRowError\n | LitellmLiteralSecretHeaderError;\n",
|
|
8
8
|
"/**\n * The wire body for a `LiteLLM.PassThroughEndpoint`, the comparison that decides whether it needs\n * writing, and the refusals that stop a plan before it writes anything unsafe.\n *\n * ★ EXTRACTED SO IT CAN BE TESTED WITHOUT A SERVER — the same reason netbox keeps `prefix-form.ts`\n * beside `prefix.ts` (S32/testing-and-docs.md).\n *\n * ⛔ PROPS ARE `@distilled.cloud/litellm`'s OWN GENERATED TYPE, MINUS THE TWO FIELDS THIS RESOURCE\n * OWNS ITSELF: `id` (a deterministic physical name — pass-through-endpoint.ts) and\n * `is_from_config` (response-only; the vendor sets it, a declaration never does). Deriving\n * `Props` with `Omit<>` rather than hand-typing it means a vendor schema change the SDK's own\n * next regeneration picks up is felt here as a compiler error, not silently ignored — the same\n * reason this used to derive from the kit's own hand-generated `./generated/pass-through.ts`\n * (retired by this migration: the SDK's type is the same shape, generated from the same LiteLLM\n * 1.100.0 OpenAPI document, and keeping a second copy would only drift).\n */\nimport { deepEqual } from 'alchemy/Diff';\nimport type * as Generated from '@distilled.cloud/litellm/misc';\n\nexport type PassThroughEndpointProps = Omit<\n Generated.PassThroughGenericEndpoint,\n 'id' | 'is_from_config'\n>;\n\n/** What `read` returns: the props plus the two vendor-owned fields, `id` now guaranteed present. */\nexport type PassThroughEndpointAttributes = Omit<Generated.PassThroughGenericEndpoint, 'id'> & {\n readonly id: string;\n};\n\n/** ⚠️ NetBox `settled()`'s pattern: only fields the SCHEMA gives a vendor default for, copied from it (not assumed). */\nexport const settled = (props: PassThroughEndpointProps) => ({\n auth: props.auth ?? true,\n cost_per_request: props.cost_per_request ?? 0,\n default_query_params: props.default_query_params ?? {},\n headers: props.headers ?? {},\n include_subpath: props.include_subpath ?? false,\n});\n\n/** The three fields whose absence the vendor's `exclude_none` update can never write (see client.ts). */\nexport const NULLABLE_FIELDS = ['timeout', 'methods', 'guardrails'] as const;\n\nconst isUnset = (value: unknown): boolean => value === undefined || value === null;\n\n/**\n * ⚠️ BUILT AS A WIDER RECORD AND PRUNED, NOT AS THE GENERATED TYPE DIRECTLY.\n * `exactOptionalPropertyTypes` is on (packages/config/tsconfig.base.json), so writing\n * `timeout: undefined` into a `{ timeout?: number | null }` is a type error rather than an\n * absent key — the same reason `codegen/openapi.ts`'s `prune` exists, and the same fix.\n */\nconst prune = (value: Record<string, unknown>): Record<string, unknown> =>\n Object.fromEntries(Object.entries(value).filter(([, v]) => v !== undefined));\n\n/**\n * Full body for CREATE. `id` is the deterministic physical name (pass-through-endpoint.ts), sent\n * so a failed create is recoverable by `read` rather than orphaning a second row on retry.\n */\nexport const createBody = (\n props: PassThroughEndpointProps,\n id: string,\n): Generated.PassThroughGenericEndpoint =>\n prune({\n ...settled(props),\n guardrails: isUnset(props.guardrails) ? undefined : props.guardrails,\n id,\n methods: isUnset(props.methods) ? undefined : props.methods,\n path: props.path,\n target: props.target,\n timeout: isUnset(props.timeout) ? undefined : props.timeout,\n }) as unknown as Generated.PassThroughGenericEndpoint;\n\n/**\n * Partial body for UPDATE (`POST /{id}`). ⛔ ONLY FIELDS THIS DECLARATION ACTUALLY SETS — the\n * vendor merges the parsed body with `model_dump(exclude_none=True)` (measured at v1.100.0), so an\n * `undefined` OR an explicit `null` here would be dropped by the server anyway; sending neither is\n * the same outcome with no request made when nothing changed (`Object.keys(body).length === 0`\n * checked by the caller in pass-through-endpoint.ts).\n *\n * ⛔ `path`/`target` ARE NOT `Partial` HERE, UNLIKE EVERY OTHER FIELD. The SDK's own update\n * request type requires both non-optionally (the vendor's PATCH route still wants the full\n * route/target pair on every call, unlike the other fields' `exclude_none` merge) — typing them\n * as always-present here is what lets `operations.ts`'s `updatePassThroughEndpoint` pass this\n * straight to the SDK without an unsafe cast.\n */\nexport type UpdateBody = Partial<Omit<Generated.PassThroughGenericEndpoint, 'path' | 'target'>> &\n Pick<Generated.PassThroughGenericEndpoint, 'path' | 'target'>;\n\nexport const updateBody = (props: PassThroughEndpointProps): UpdateBody =>\n prune({\n ...settled(props),\n guardrails: isUnset(props.guardrails) ? undefined : props.guardrails,\n methods: isUnset(props.methods) ? undefined : props.methods,\n path: props.path,\n target: props.target,\n timeout: isUnset(props.timeout) ? undefined : props.timeout,\n }) as UpdateBody;\n\n/**\n * Whether ANY of the three nullable fields went from set (in `live`) to unset (in `props`) — the\n * one case `updateBody` cannot express, because the vendor's `exclude_none` merge silently keeps\n * the old value instead of clearing it. Detected here so `pass-through-endpoint.ts` can plan a\n * `replace` (delete-then-create) instead of an update that would look like it worked.\n */\nexport const needsReplace = (\n live: PassThroughEndpointAttributes,\n props: PassThroughEndpointProps,\n): boolean => NULLABLE_FIELDS.some((field) => !isUnset(live[field]) && isUnset(props[field]));\n\n/** Whether the live object already says what the declaration says — the `diff` \"noop\" test. */\nexport const matches = (\n live: PassThroughEndpointAttributes,\n props: PassThroughEndpointProps,\n): boolean => {\n const fixed = settled(props);\n return (\n live.target === props.target &&\n live.auth === fixed.auth &&\n live.cost_per_request === fixed.cost_per_request &&\n live.include_subpath === fixed.include_subpath &&\n deepEqual(live.headers, fixed.headers) &&\n deepEqual(live.default_query_params, fixed.default_query_params) &&\n (isUnset(props.timeout) ? isUnset(live.timeout) : live.timeout === props.timeout) &&\n (isUnset(props.methods) ? isUnset(live.methods) : deepEqual(live.methods, props.methods)) &&\n (isUnset(props.guardrails)\n ? isUnset(live.guardrails)\n : deepEqual(live.guardrails, props.guardrails))\n );\n};\n\n/**\n * A literal secret in a forwarded header (S25, house rule — not a vendor one; see\n * pass-through-endpoint.ts). Case-insensitive on the header name; the reference form is LiteLLM's\n * own, `os.environ/NAME` (`set_env_variables_in_header`, pass_through_endpoints.py:117-160 at the\n * tag) — a missing variable on the proxy host leaves that literal string in the header, which\n * nothing in the API can detect, so this is enforced here rather than trusted to the vendor.\n */\nconst SECRET_HEADER_NAMES = new Set(['authorization', 'x-api-key', 'cf-aig-authorization']);\n\nexport const literalSecretHeaders = (\n headers: Readonly<Record<string, unknown>> | undefined,\n): readonly string[] =>\n Object.entries(headers ?? {})\n .filter(\n ([name, value]) =>\n SECRET_HEADER_NAMES.has(name.toLowerCase()) && !String(value).includes('os.environ/'),\n )\n .map(([name]) => name);\n",
|
|
9
9
|
"/**\n * The LiteLLM provider, with its credential source, as one layer for a stack.\n *\n * Layer.mergeAll(litellmProviders(), …the stack's other providers)\n *\n * ★ THE DEFAULT READS `LITELLM_PROXY_URL`/`LITELLM_PROXY_API_KEY` AT CALL TIME, through\n * `@distilled.cloud/litellm`'s own `CredentialsFromEnv` — the same two variable names the\n * retired hand-rolled `credentials.ts` read — never at layer build. Pass another\n * `Layer.Layer<Credentials>` (see the SDK's own `credentials({ apiKey, baseUrl })` in a test) to\n * source them another way.\n * ⚠️ `HttpClient` is NOT provided here. It is ambient in every Alchemy runtime the same way it is\n * for `netboxProviders`-style families in this kit; a stack that already deploys anything over\n * HTTP already has one. Do not add a second client to this layer.\n * ⚠️ `Layer.provideMerge`, NEVER PLAIN `Layer.provide`, for the credentials layer. The handlers\n * still need `Credentials` when the engine calls `read`/`diff`/`reconcile`. `Provider.effect`\n * puts that need on the layer. Plain `provide` satisfies it only while the `Provider` value is\n * built, then hides `Credentials` from those later calls. Measured on Caddy, 2026-09-23:\n * `caddy/providers.ts`. `provideMerge` feeds credentials in and keeps them in the layer the\n * engine runs the handlers with.\n */\nimport { type Credentials, CredentialsFromEnv } from '@distilled.cloud/litellm/Credentials';\nimport * as Layer from 'effect/Layer';\nimport { LiteLLMPassThroughEndpointProvider } from './pass-through-endpoint.ts';\n\nexport const litellmProviders = (creds: Layer.Layer<Credentials> = CredentialsFromEnv) =>\n LiteLLMPassThroughEndpointProvider().pipe(Layer.provideMerge(creds));\n"
|
|
10
10
|
],
|
|
11
|
-
"mappings": ";AA2BA;AACA;AACA;AAEA;AACA;AAEA;AACA;;;ACLA;AACA;AAGA;AACA;AAUA,IAAM,aAAa,IAAI;AAGvB,IAAM,eAAe,CAAC,YACb,YAAK,MAAM;AAAA,EAChB,MAAM,WAAW,WAAW,IAAI,OAAO;AAAA,EACvC,IAAI,aAAa;AAAA,IAAW,OAAO;AAAA,EACnC,MAAM,UAAoB,qBAAW,CAAC;AAAA,EACtC,WAAW,IAAI,SAAS,OAAO;AAAA,EAC/B,OAAO;AAAA,CACR;
|
|
12
|
-
"debugId": "
|
|
11
|
+
"mappings": ";AA2BA;AACA;AACA;AAEA;AACA;AAEA;AACA;;;ACLA;AACA;AAGA;AACA;AACA;AAUA,IAAM,aAAa,IAAI;AAGvB,IAAM,eAAe,CAAC,YACb,YAAK,MAAM;AAAA,EAChB,MAAM,WAAW,WAAW,IAAI,OAAO;AAAA,EACvC,IAAI,aAAa;AAAA,IAAW,OAAO;AAAA,EACnC,MAAM,UAAoB,qBAAW,CAAC;AAAA,EACtC,WAAW,IAAI,SAAS,OAAO;AAAA,EAC/B,OAAO;AAAA,CACR;AAuBH,IAAM,eAAe,CAAU,OAC7B,GAAG,KAAY,eAAwB,qBAAK,CAAC;AAE/C,IAAM,SAAS,CACb,OAEO,WAAI,UAAU,GAAG;AAAA,EACtB,MAAM,UAAU,OAAO;AAAA,EACvB,MAAM,QAAQ,OAAO;AAAA,EACrB,MAAM,YAAY,OAAO,aAAa,MAAM,UAAU;AAAA,EACtD,OAAO,OAAO,UAAU,YAAY,CAAC,EAAE,aAAa,EAAE,CAAC;AAAA,CACxD;AAEH,IAAM,cAAc,CAClB,aAC8D;AAAA,EAC9D,MAAM,OAAO,SAAS;AAAA,EACtB,IAAI,CAAC,MAAM,QAAQ,IAAI,GAAG;AAAA,IACxB,OAAc,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M;AAAA,IACnF,OAAO,0BAA0B,QAAQ;AAAA,GAC1C;AAAA,EAEH,MAAM,MAAa,gBAAQ,CAAC,CAAC;AAC/B;AAEO,IAAM,qCAAqC,MACvC,gBACP,4BACO,gBAAQ,2BAA2B,SAAS,GAAG,mBAAmB,CAAC,CAC5E;;AIlOF;AACA;AAGO,IAAM,mBAAmB,CAAC,QAAkC,uBACjE,mCAAmC,EAAE,KAAW,mBAAa,KAAK,CAAC;",
|
|
12
|
+
"debugId": "37B90757C77EC46E64756E2164756E21",
|
|
13
13
|
"names": []
|
|
14
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/litellm/operations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;AAEtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAE1E,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/litellm/operations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;AAEtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAE1E,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAIxC,YAAY,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,CAAC;AACnD,YAAY,EACV,2BAA2B,EAC3B,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,+BAA+B,CAAC;AA8DvC,oIAAoI;AACpI,eAAO,MAAM,wBAAwB,QAAO,MAAM,CAAC,MAAM,CACvD,SAAS,IAAI,CAAC,0BAA0B,EAAE,EAC1C,IAAI,CAAC,wDAAwD,EAC7D,gBAAgB,CAIf,CAAC;AAEJ,0FAA0F;AAC1F,eAAO,MAAM,yBAAyB,SAC9B,IAAI,CAAC,0BAA0B,KACpC,MAAM,CAAC,MAAM,CACd,IAAI,EACJ,IAAI,CAAC,4DAA4D,EACjE,gBAAgB,CACiF,CAAC;AAEpG;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,eACxB,MAAM,QACZ,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,0BAA0B,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC,GACrE,IAAI,CAAC,IAAI,CAAC,0BAA0B,EAAE,MAAM,GAAG,QAAQ,CAAC,KACzD,MAAM,CAAC,MAAM,CACd,IAAI,EACJ,IAAI,CAAC,sEAAsE,EAC3E,gBAAgB,CASf,CAAC;AAEJ;;;;;;;;;;GAUG;AACH,eAAO,MAAM,yBAAyB,eACxB,MAAM,KACjB,MAAM,CAAC,MAAM,CACd,IAAI,EACJ,IAAI,CAAC,8DAA8D,EACnE,gBAAgB,CAcf,CAAC"}
|
|
@@ -27,12 +27,6 @@ export interface BaoAuthRoleAttributes {
|
|
|
27
27
|
}
|
|
28
28
|
export declare const attributesOf: (props: BaoAuthRoleProps, live: Record<string, unknown>) => BaoAuthRoleAttributes;
|
|
29
29
|
export declare const readPath: (name: string) => string;
|
|
30
|
-
/**
|
|
31
|
-
* The body for `PUT auth/approle/role/<name>`.
|
|
32
|
-
*
|
|
33
|
-
* ★ ALL STRINGS, EXACTLY THE `k=v` PAIRS `bao write` USED TO SEND — see `baoWrite` in bao-http.ts.
|
|
34
|
-
*/
|
|
35
|
-
export declare const writeBody: (props: BaoAuthRoleProps) => Record<string, string>;
|
|
36
30
|
/** True when live already matches the declaration on every managed field. */
|
|
37
31
|
export declare const matches: (attributes: BaoAuthRoleAttributes, props: BaoAuthRoleProps) => boolean;
|
|
38
32
|
//# sourceMappingURL=auth-role-form.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-role-form.d.ts","sourceRoot":"","sources":["../../src/openbao/auth-role-form.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,gBAAgB;IAC/B,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,sFAAsF;IACtF,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,6BAA6B;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,gCAAgC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,0FAA0F;IAC1F,WAAW,EAAE,MAAM,CAAC;IACpB,kFAAkF;IAClF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mFAAmF;IACnF,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,sEAAsE;IACtE,MAAM,EAAE,MAAM,CAAC;CAChB;AAwBD,eAAO,MAAM,YAAY,UAChB,gBAAgB,QACjB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,qBAWF,CAAC;AAEF,eAAO,MAAM,QAAQ,SAAU,MAAM,WAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"auth-role-form.d.ts","sourceRoot":"","sources":["../../src/openbao/auth-role-form.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,gBAAgB;IAC/B,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,sFAAsF;IACtF,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,6BAA6B;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,gCAAgC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,0FAA0F;IAC1F,WAAW,EAAE,MAAM,CAAC;IACpB,kFAAkF;IAClF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mFAAmF;IACnF,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,sEAAsE;IACtE,MAAM,EAAE,MAAM,CAAC;CAChB;AAwBD,eAAO,MAAM,YAAY,UAChB,gBAAgB,QACjB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,qBAWF,CAAC;AAEF,eAAO,MAAM,QAAQ,SAAU,MAAM,WAAgC,CAAC;AAWtE,6EAA6E;AAC7E,eAAO,MAAM,OAAO,eAAgB,qBAAqB,SAAS,gBAAgB,YAUjF,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const authRoleIdentity: import("./rename-identity.ts").Identity<{
|
|
2
|
+
readonly name: string;
|
|
3
|
+
}>;
|
|
4
|
+
/** All occupied-name reads share the SDK's typed absence and refusal behavior. */
|
|
5
|
+
export declare const judgeAuthRoleRename: (olds: unknown, news: unknown, output: {
|
|
6
|
+
readonly name: string;
|
|
7
|
+
} | undefined) => import("effect/Effect").Effect<{
|
|
8
|
+
from: string;
|
|
9
|
+
to: string;
|
|
10
|
+
} | undefined, import("@distilled.cloud/caddy").BadGateway | import("@distilled.cloud/caddy").BadRequest | import("./bao-status.ts").BaoError | import("@distilled.cloud/caddy").ConfigError | import("@distilled.cloud/caddy").Conflict | import("@distilled.cloud/caddy").Forbidden | import("@distilled.cloud/caddy").GatewayTimeout | import("effect/unstable/http/HttpClientError").HttpClientError | import("@distilled.cloud/caddy").InternalServerError | import("@distilled.cloud/caddy").Locked | import("@distilled.cloud/caddy").ServiceUnavailable | import("effect/Cause").TimeoutError | import("@distilled.cloud/caddy").TooManyRequests | import("@distilled.cloud/caddy").Unauthorized | import("@distilled.cloud/caddy").UnprocessableEntity | import("@distilled.cloud/openbao/Errors").ClientErrors, import("effect/unstable/http/HttpClient").HttpClient>;
|
|
11
|
+
//# sourceMappingURL=auth-role-identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-role-identity.d.ts","sourceRoot":"","sources":["../../src/openbao/auth-role-identity.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB;mBAAiC,MAAM;EAInE,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,mBAAmB,SACxB,OAAO,QACP,OAAO,UACL;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS;;;+0BAQ5C,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AppRole METADATA through the named SDK operations (OpenBao 2.6.2 generated schema).
|
|
3
|
+
* ★ pathRoleRead returns nil for absence; logical.RespondErrorCommon turns that read into
|
|
4
|
+
* 404. pathRoleDelete returns nil for an already absent role (204). Reasoned from v2.6.2
|
|
5
|
+
* builtin/credential/approle/path_role.go:1758-1904 and sdk/logical/response_util.go:21-26.
|
|
6
|
+
* ⛔ No role-id, secret-id or login request belongs in this configuration lifecycle.
|
|
7
|
+
*/
|
|
8
|
+
import { type AppRoleReadRoleResponse, type AppRoleWriteRoleRequest } from '@distilled.cloud/openbao/approle';
|
|
9
|
+
import * as Effect from 'effect/Effect';
|
|
10
|
+
import { type BaoAuthRoleProps } from './auth-role-form.ts';
|
|
11
|
+
import { BaoError } from './bao-status.ts';
|
|
12
|
+
export declare const readAuthRole: (name: string) => Effect.Effect<AppRoleReadRoleResponse | undefined, import("@distilled.cloud/caddy").BadGateway | import("@distilled.cloud/caddy").BadRequest | BaoError | import("@distilled.cloud/caddy").ConfigError | import("@distilled.cloud/caddy").Conflict | import("@distilled.cloud/caddy").Forbidden | import("@distilled.cloud/caddy").GatewayTimeout | import("effect/unstable/http/HttpClientError").HttpClientError | import("@distilled.cloud/caddy").InternalServerError | import("@distilled.cloud/caddy").Locked | import("@distilled.cloud/caddy").ServiceUnavailable | import("effect/Cause").TimeoutError | import("@distilled.cloud/caddy").TooManyRequests | import("@distilled.cloud/caddy").Unauthorized | import("@distilled.cloud/caddy").UnprocessableEntity | import("@distilled.cloud/openbao/Errors").ClientErrors, import("effect/unstable/http/HttpClient").HttpClient>;
|
|
13
|
+
export declare const authRoleExists: (name: string) => Effect.Effect<boolean, import("@distilled.cloud/caddy").BadGateway | import("@distilled.cloud/caddy").BadRequest | BaoError | import("@distilled.cloud/caddy").ConfigError | import("@distilled.cloud/caddy").Conflict | import("@distilled.cloud/caddy").Forbidden | import("@distilled.cloud/caddy").GatewayTimeout | import("effect/unstable/http/HttpClientError").HttpClientError | import("@distilled.cloud/caddy").InternalServerError | import("@distilled.cloud/caddy").Locked | import("@distilled.cloud/caddy").ServiceUnavailable | import("effect/Cause").TimeoutError | import("@distilled.cloud/caddy").TooManyRequests | import("@distilled.cloud/caddy").Unauthorized | import("@distilled.cloud/caddy").UnprocessableEntity | import("@distilled.cloud/openbao/Errors").ClientErrors, import("effect/unstable/http/HttpClient").HttpClient>;
|
|
14
|
+
export declare const authRoleRequest: (props: BaoAuthRoleProps) => Effect.Effect<AppRoleWriteRoleRequest, BaoError, never>;
|
|
15
|
+
/**
|
|
16
|
+
* ★ A FULL-REPLACE WRITE, like the policy write: every managed field travels in the request
|
|
17
|
+
* every time (only genuinely omitted knobs stay omitted), so a transport failure is safe to
|
|
18
|
+
* retry through `runBaoWrite` — the replay sends the identical desired state.
|
|
19
|
+
*/
|
|
20
|
+
export declare const writeAuthRole: (props: BaoAuthRoleProps) => Effect.Effect<import("@distilled.cloud/openbao/approle").AppRoleWriteRoleResponse, BaoError | import("effect/Cause").TimeoutError | import("@distilled.cloud/openbao/Protocol").OpenBaoOpError, import("effect/unstable/http/HttpClient").HttpClient>;
|
|
21
|
+
/** Other typed SDK failures, including denied deletes, propagate unchanged. */
|
|
22
|
+
export declare const deleteAuthRole: (name: string) => Effect.Effect<void | import("@distilled.cloud/openbao/approle").AppRoleDeleteRoleResponse, import("@distilled.cloud/caddy").BadGateway | import("@distilled.cloud/caddy").BadRequest | BaoError | import("@distilled.cloud/caddy").ConfigError | import("@distilled.cloud/caddy").Conflict | import("@distilled.cloud/caddy").Forbidden | import("@distilled.cloud/caddy").GatewayTimeout | import("effect/unstable/http/HttpClientError").HttpClientError | import("@distilled.cloud/caddy").InternalServerError | import("@distilled.cloud/caddy").Locked | import("@distilled.cloud/caddy").ServiceUnavailable | import("effect/Cause").TimeoutError | import("@distilled.cloud/caddy").TooManyRequests | import("@distilled.cloud/caddy").Unauthorized | import("@distilled.cloud/caddy").UnprocessableEntity | import("@distilled.cloud/openbao/Errors").ClientErrors, import("effect/unstable/http/HttpClient").HttpClient>;
|
|
23
|
+
//# sourceMappingURL=auth-role-wire.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-role-wire.d.ts","sourceRoot":"","sources":["../../src/openbao/auth-role-wire.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAI7B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,KAAK,gBAAgB,EAAY,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAwB3C,eAAO,MAAM,YAAY,SAAU,MAAM,81BAQtC,CAAC;AAEJ,eAAO,MAAM,cAAc,SAAU,MAAM,k0BACwB,CAAC;AAEpE,eAAO,MAAM,eAAe,UAAW,gBAAgB,4DAuBnD,CAAC;AAEL;;;;GAIG;AACH,eAAO,MAAM,aAAa,UAAW,gBAAgB,0PAC6C,CAAC;AAEnG,+EAA+E;AAC/E,eAAO,MAAM,cAAc,SAAU,MAAM,s4BACqD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-role.d.ts","sourceRoot":"","sources":["../../src/openbao/auth-role.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAE7C,OAAO,KAAK,KAAK,UAAU,MAAM,iCAAiC,CAAC;AAInE,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,
|
|
1
|
+
{"version":3,"file":"auth-role.d.ts","sourceRoot":"","sources":["../../src/openbao/auth-role.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAE7C,OAAO,KAAK,KAAK,UAAU,MAAM,iCAAiC,CAAC;AAInE,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EAItB,MAAM,qBAAqB,CAAC;AAK7B,YAAY,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,CAAC;AAExD,MAAM,WAAW,WAAY,SAAQ,QAAQ,CAC3C,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACrB,KAAK,EACL,UAAU,CAAC,UAAU,CACtB;CAAG;AAEJ,eAAO,MAAM,WAAW,8CAEtB,CAAC;AAiBH,eAAO,MAAM,mBAAmB,kGAoF7B,CAAC"}
|
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* One call to OpenBao's HTTP API through Effect's `HttpClient` — the transport every Bao.* family
|
|
3
|
-
* uses since it stopped shelling out to `bao`.
|
|
4
|
-
*
|
|
5
|
-
* ★ `HttpClient`, THE SAME PATTERN <estate>/proxmox and <estate>/forgejo USE AGAINST THEIR APIs, decided
|
|
6
|
-
* 2026-09-14. It buys a typed error channel, interruption when a plan is cancelled, the runtime's
|
|
7
|
-
* tracing, and a client a test can point at a fake server — and it needs no Alchemy session, so
|
|
8
|
-
* every call here works from all four operations. (`CommandExecutor.run` was tried on Bao.Policy
|
|
9
|
-
* first and blocked read/diff: Alchemy passes a session to reconcile/delete but NOT to read/diff,
|
|
10
|
-
* Provider.ts:258-289. The ChildProcessSpawner that fixed that is gone with the CLI.)
|
|
11
|
-
* ⚠️ THE STACK MUST PROVIDE `FetchHttpClient.layer`. alchemy.run.ts does, the way
|
|
12
|
-
* <estate>/proxmox/alchemy.run.ts does.
|
|
13
|
-
*/
|
|
14
1
|
import * as Context from 'effect/Context';
|
|
15
2
|
import * as Effect from 'effect/Effect';
|
|
16
3
|
import * as Semaphore from 'effect/Semaphore';
|
|
@@ -47,6 +34,40 @@ export declare const BaoEnv: Context.Reference<Readonly<Record<string, string |
|
|
|
47
34
|
*/
|
|
48
35
|
export declare const MAX_IN_FLIGHT = 8;
|
|
49
36
|
export declare const BaoGate: Context.Reference<Semaphore.Semaphore>;
|
|
37
|
+
/**
|
|
38
|
+
* ⚠️ THE CLI's DEFAULT CLIENT TIMEOUT (openbao v2.6.2 api/client.go:324). A hung agent or a server
|
|
39
|
+
* that accepts and never answers would otherwise hang the plan with no line saying why.
|
|
40
|
+
*/
|
|
41
|
+
export declare const BAO_TIMEOUT = "60 seconds";
|
|
42
|
+
/**
|
|
43
|
+
* Mesh in front of a remote OpenBao drops connections under Alchemy's unbounded
|
|
44
|
+
* fan-out. Status 0 is transport, not an OpenBao 4xx — retry twice. Measured
|
|
45
|
+
* 2026-09-16 against bao.example.internal: a 585-role plan died mid-diff with
|
|
46
|
+
* `no response: (no errors given)` while the vault stayed unsealed.
|
|
47
|
+
*/
|
|
48
|
+
export declare const retryTransport: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
49
|
+
/**
|
|
50
|
+
* ⛔ EFFECT RECORDS EVERY REQUEST HEADER ON THE CLIENT SPAN and redacts only the names in
|
|
51
|
+
* `Headers.CurrentRedactedNames` — by default authorization, cookie, set-cookie and x-api-key
|
|
52
|
+
* (effect Headers.ts:753-762; HttpClient.ts:842-849, with `TracerHeaderFilter` defaulting to
|
|
53
|
+
* true). `X-Vault-Token` is not on that list, so under any tracer the token would be exported as
|
|
54
|
+
* a span attribute. It is added for every call made here.
|
|
55
|
+
*/
|
|
56
|
+
export declare const redactingToken: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, never>>;
|
|
57
|
+
/**
|
|
58
|
+
* Route the exchange over a unix socket when the address is one.
|
|
59
|
+
*
|
|
60
|
+
* ★ BUN's `fetch` TAKES A `unix` OPTION (bun-types globals.d.ts BunFetchRequestInit.unix), AND
|
|
61
|
+
* `FetchHttpClient.RequestInit` IS EFFECT'S DOCUMENTED WAY TO PASS FETCH OPTIONS. The fetch client
|
|
62
|
+
* spreads that service into every call (effect FetchHttpClient.ts:59-72), reading it from the
|
|
63
|
+
* CALLING fiber's context — and `layerMergedContext` merges the caller's context over the layer's
|
|
64
|
+
* (HttpClient.ts:2065-2076), so providing it around one call routes that call alone. Any defaults
|
|
65
|
+
* already provided are kept.
|
|
66
|
+
* ⛔ IT ONLY WORKS ON BUN, SO ANYWHERE ELSE IT REFUSES. Node's fetch ignores `unix` and would send
|
|
67
|
+
* the request to http://localhost:80 — a silent wrong server, which is the one outcome this
|
|
68
|
+
* package exists to prevent. It also assumes the provided `HttpClient` is the fetch one.
|
|
69
|
+
*/
|
|
70
|
+
export declare const overSocket: (socket: string | undefined, method: string, path: string) => <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E | BaoError, R>;
|
|
50
71
|
/** One exchange, classified. The body is the parsed JSON object, or undefined for absent / 204. */
|
|
51
72
|
export declare const baoCall: (intent: BaoIntent, method: 'DELETE' | 'GET' | 'POST' | 'PUT', path: string, body?: Readonly<Record<string, unknown>>) => Effect.Effect<Record<string, unknown> | undefined, BaoError, HttpClient.HttpClient>;
|
|
52
73
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bao-http.d.ts","sourceRoot":"","sources":["../../src/openbao/bao-http.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bao-http.d.ts","sourceRoot":"","sources":["../../src/openbao/bao-http.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAG9C,OAAO,KAAK,UAAU,MAAM,iCAAiC,CAAC;AAG9D,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAU,MAAM,iBAAiB,CAAC;AAEnE;;;GAGG;AACH,eAAO,MAAM,MAAM,iEAEjB,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,aAAa,IAAI,CAAC;AAE/B,eAAO,MAAM,OAAO,wCAElB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,WAAW,eAAe,CAAC;AAExC;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,EAAE,CAAC,EAAE,CAAC,UAAU,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,2BAMlE,CAAC;AAEL;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,EAAE,CAAC,EAAE,CAAC,UAAU,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,2CAOlE,CAAC;AAEL;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,UAAU,WACZ,MAAM,GAAG,SAAS,UAAU,MAAM,QAAQ,MAAM,MACxD,CAAC,EAAE,CAAC,EAAE,CAAC,UAAU,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAAG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,QAAQ,EAAE,CAAC,CAW1E,CAAC;AAEJ,mGAAmG;AACnG,eAAO,MAAM,OAAO,WACV,SAAS,UACT,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,QACnC,MAAM,SACL,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,wFAoCtC,CAAC;AAEL;;;;;GAKG;AACH,eAAO,MAAM,OAAO,SAAU,MAAM,wFAOhC,CAAC;AAEL;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,WACX,MAAM,GAAG,KAAK,QAChB,MAAM,QACN,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,yDACe,CAAC;AAEzD,kGAAkG;AAClG,eAAO,MAAM,SAAS,SAAU,MAAM,yDAAqD,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { OpenBaoOpContext } from '@distilled.cloud/openbao/Protocol';
|
|
2
|
+
import type * as Cause from 'effect/Cause';
|
|
3
|
+
import type * as Duration from 'effect/Duration';
|
|
4
|
+
import * as Effect from 'effect/Effect';
|
|
5
|
+
import type * as HttpClient from 'effect/unstable/http/HttpClient';
|
|
6
|
+
import { BaoError } from './bao-status.ts';
|
|
7
|
+
export declare const runBao: <A, E>(operation: Effect.Effect<A, E, OpenBaoOpContext>, timeout?: Duration.Input) => Effect.Effect<A, E | BaoError | Cause.TimeoutError, HttpClient.HttpClient>;
|
|
8
|
+
/**
|
|
9
|
+
* Reads use the existing two transport retries (750 ms between attempts). Each attempt
|
|
10
|
+
* reacquires the shared permit and its own bounded timeout. Typed SDK status and decoding
|
|
11
|
+
* failures still propagate immediately; a read is always safe to replay because it never
|
|
12
|
+
* changes vault state.
|
|
13
|
+
*/
|
|
14
|
+
export declare const runBaoRead: <A, E>(operation: Effect.Effect<A, E, OpenBaoOpContext>, timeout?: Duration.Input) => Effect.Effect<A, E | BaoError | Cause.TimeoutError, HttpClient.HttpClient>;
|
|
15
|
+
/**
|
|
16
|
+
* The pre-PR `baoCall()` retried every call, writes included; that bound was lost when the
|
|
17
|
+
* distilled SDK path landed with `Retry.none` on `runBao`. Restore it for the writes where
|
|
18
|
+
* replaying is safe: a FULL-REPLACE, idempotent write (an OpenBao policy PUT, an AppRole
|
|
19
|
+
* write) sends the complete desired state every time, so retrying an uncertain transport
|
|
20
|
+
* failure converges on the same result rather than compounding a partial change. A create
|
|
21
|
+
* that mints a new identifier, or any operation whose second attempt could do something the
|
|
22
|
+
* first did not, must keep calling `runBao` directly and make one attempt.
|
|
23
|
+
*/
|
|
24
|
+
export declare const runBaoWrite: <A, E>(operation: Effect.Effect<A, E, OpenBaoOpContext>, timeout?: Duration.Input) => Effect.Effect<A, E | BaoError | Cause.TimeoutError, HttpClient.HttpClient>;
|
|
25
|
+
//# sourceMappingURL=distilled.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"distilled.d.ts","sourceRoot":"","sources":["../../src/openbao/distilled.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAE1E,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,KAAK,KAAK,UAAU,MAAM,iCAAiC,CAAC;AAWnE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,eAAO,MAAM,MAAM,GAAI,CAAC,EAAE,CAAC,aACd,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,gBAAgB,CAAC,YACvC,QAAQ,CAAC,KAAK,KACtB,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,QAAQ,GAAG,KAAK,CAAC,YAAY,EAAE,UAAU,CAAC,UAAU,CA4BxE,CAAC;AAEL;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAI,CAAC,EAAE,CAAC,aAClB,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,gBAAgB,CAAC,YACvC,QAAQ,CAAC,KAAK,KACtB,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,QAAQ,GAAG,KAAK,CAAC,YAAY,EAAE,UAAU,CAAC,UAAU,CAChC,CAAC;AAE7C;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,GAAI,CAAC,EAAE,CAAC,aACnB,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,gBAAgB,CAAC,YACvC,QAAQ,CAAC,KAAK,KACtB,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,QAAQ,GAAG,KAAK,CAAC,YAAY,EAAE,UAAU,CAAC,UAAU,CAChC,CAAC"}
|
|
@@ -9,7 +9,11 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import type { Reply, Seen } from './fake-bao.ts';
|
|
11
11
|
import { type Store } from './fake-engines.ts';
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Every role engine, JWT auth config and MFA login enforcement.
|
|
14
|
+
* ★ AppRole preserves omitted knobs and supplies defaults on create (OpenBao 2.6.2
|
|
15
|
+
* path_role.go:1688-1721); this fixture must not turn a correct omitted SDK field into drift.
|
|
16
|
+
*/
|
|
13
17
|
export declare const wireRoles: () => Store;
|
|
14
18
|
/**
|
|
15
19
|
* `sys/plugins/catalog/<type>/<name>`. A register names its version in the body; a read or a delete
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fake-engines-roles.d.ts","sourceRoot":"","sources":["../../src/openbao/fake-engines-roles.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAU,KAAK,KAAK,EAAmC,MAAM,mBAAmB,CAAC;AAwCxF
|
|
1
|
+
{"version":3,"file":"fake-engines-roles.d.ts","sourceRoot":"","sources":["../../src/openbao/fake-engines-roles.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAU,KAAK,KAAK,EAAmC,MAAM,mBAAmB,CAAC;AAwCxF;;;;GAIG;AACH,eAAO,MAAM,SAAS,QAAO,KAO1B,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,aAAa,QAAO,KAO9B,CAAC;AAEJ;;;;GAIG;AACH,eAAO,MAAM,WAAW,QAAO,KAuB9B,CAAC;AAEF,wFAAwF;AACxF,eAAO,MAAM,UAAU,gBAIC,IAAI,KAAG,KAAK;;;;CAMnC,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC"}
|