@homeflare/alchemy 0.29.1 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -0
- package/dist/caddy/config-reconcile.d.ts.map +1 -1
- package/dist/caddy/config.d.ts.map +1 -1
- package/dist/caddy/format-warnings.d.ts +29 -0
- package/dist/caddy/format-warnings.d.ts.map +1 -0
- package/dist/caddy/format.d.ts +50 -0
- package/dist/caddy/format.d.ts.map +1 -0
- package/dist/caddy/index.d.ts +1 -0
- package/dist/caddy/index.d.ts.map +1 -1
- package/dist/caddy/index.js +78 -10
- package/dist/caddy/index.js.map +7 -5
- package/dist/discord/application-command.d.ts +52 -0
- package/dist/discord/application-command.d.ts.map +1 -0
- package/dist/discord/command-form.d.ts +62 -0
- package/dist/discord/command-form.d.ts.map +1 -0
- package/dist/discord/credentials.d.ts +35 -0
- package/dist/discord/credentials.d.ts.map +1 -0
- package/dist/discord/fake-discord.d.ts +44 -0
- package/dist/discord/fake-discord.d.ts.map +1 -0
- package/dist/discord/guild-application-command.d.ts +53 -0
- package/dist/discord/guild-application-command.d.ts.map +1 -0
- package/dist/discord/index.d.ts +12 -0
- package/dist/discord/index.d.ts.map +1 -0
- package/dist/discord/index.js +193 -0
- package/dist/discord/index.js.map +15 -0
- package/dist/discord/providers.d.ts +15 -0
- package/dist/discord/providers.d.ts.map +1 -0
- package/dist/discord/resource.d.ts +75 -0
- package/dist/discord/resource.d.ts.map +1 -0
- package/dist/google-workspace/credentials.d.ts +54 -0
- package/dist/google-workspace/credentials.d.ts.map +1 -0
- package/dist/google-workspace/domain-alias.d.ts +74 -0
- package/dist/google-workspace/domain-alias.d.ts.map +1 -0
- package/dist/google-workspace/fake-google-workspace.d.ts +41 -0
- package/dist/google-workspace/fake-google-workspace.d.ts.map +1 -0
- package/dist/google-workspace/group-member.d.ts +73 -0
- package/dist/google-workspace/group-member.d.ts.map +1 -0
- package/dist/google-workspace/group.d.ts +87 -0
- package/dist/google-workspace/group.d.ts.map +1 -0
- package/dist/google-workspace/index.d.ts +19 -0
- package/dist/google-workspace/index.d.ts.map +1 -0
- package/dist/google-workspace/index.js +283 -0
- package/dist/google-workspace/index.js.map +17 -0
- package/dist/google-workspace/org-unit.d.ts +75 -0
- package/dist/google-workspace/org-unit.d.ts.map +1 -0
- package/dist/google-workspace/providers.d.ts +16 -0
- package/dist/google-workspace/providers.d.ts.map +1 -0
- package/dist/google-workspace/resource.d.ts +80 -0
- package/dist/google-workspace/resource.d.ts.map +1 -0
- package/dist/google-workspace/values.d.ts +28 -0
- package/dist/google-workspace/values.d.ts.map +1 -0
- package/dist/grafana/credentials.d.ts +38 -0
- package/dist/grafana/credentials.d.ts.map +1 -0
- package/dist/grafana/datasource.d.ts +90 -0
- package/dist/grafana/datasource.d.ts.map +1 -0
- package/dist/grafana/fake-grafana.d.ts +48 -0
- package/dist/grafana/fake-grafana.d.ts.map +1 -0
- package/dist/grafana/index.d.ts +17 -0
- package/dist/grafana/index.d.ts.map +1 -0
- package/dist/grafana/index.js +149 -0
- package/dist/grafana/index.js.map +13 -0
- package/dist/grafana/providers.d.ts +17 -0
- package/dist/grafana/providers.d.ts.map +1 -0
- package/dist/grafana/resource.d.ts +68 -0
- package/dist/grafana/resource.d.ts.map +1 -0
- package/docs/caddy-fmt.md +59 -0
- package/docs/caddy.md +7 -0
- package/docs/credentials.md +20 -0
- package/docs/discord.md +129 -0
- package/docs/google-workspace.md +105 -0
- package/docs/grafana.md +102 -0
- package/docs/peers.md +9 -0
- package/docs/upstream-conformance.md +53 -0
- package/package.json +13 -1
- package/src/caddy/config-format-warning.test.ts +91 -0
- package/src/caddy/config-reconcile.ts +6 -0
- package/src/caddy/config.ts +8 -1
- package/src/caddy/format-warnings.test.ts +50 -0
- package/src/caddy/format-warnings.ts +39 -0
- package/src/caddy/format.test.ts +105 -0
- package/src/caddy/format.ts +121 -0
- package/src/caddy/index.ts +7 -0
- package/src/caddy/providers.test.ts +8 -0
- package/src/discord/application-command.test.ts +103 -0
- package/src/discord/application-command.ts +109 -0
- package/src/discord/command-form.test.ts +144 -0
- package/src/discord/command-form.ts +133 -0
- package/src/discord/credentials.ts +36 -0
- package/src/discord/fake-discord.ts +70 -0
- package/src/discord/guild-application-command.test.ts +215 -0
- package/src/discord/guild-application-command.ts +129 -0
- package/src/discord/index.ts +31 -0
- package/src/discord/providers.ts +18 -0
- package/src/discord/resource.ts +164 -0
- package/src/discord/retry.test.ts +74 -0
- package/src/google-workspace/credentials.test.ts +40 -0
- package/src/google-workspace/credentials.ts +75 -0
- package/src/google-workspace/domain-alias.test.ts +69 -0
- package/src/google-workspace/domain-alias.ts +116 -0
- package/src/google-workspace/fake-google-workspace.ts +54 -0
- package/src/google-workspace/group-member.test.ts +91 -0
- package/src/google-workspace/group-member.ts +126 -0
- package/src/google-workspace/group.test.ts +93 -0
- package/src/google-workspace/group.ts +128 -0
- package/src/google-workspace/index.ts +54 -0
- package/src/google-workspace/org-unit.test.ts +81 -0
- package/src/google-workspace/org-unit.ts +143 -0
- package/src/google-workspace/providers.ts +26 -0
- package/src/google-workspace/resource.test.ts +186 -0
- package/src/google-workspace/resource.ts +162 -0
- package/src/google-workspace/values.ts +36 -0
- package/src/grafana/credentials.ts +65 -0
- package/src/grafana/datasource.test.ts +183 -0
- package/src/grafana/datasource.ts +171 -0
- package/src/grafana/fake-grafana.ts +64 -0
- package/src/grafana/index.ts +22 -0
- package/src/grafana/providers.ts +19 -0
- package/src/grafana/resource.ts +120 -0
package/dist/caddy/index.js.map
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/caddy/access-forward-auth.ts", "../src/caddy/admin.ts", "../src/caddy/caddy-http-client.ts", "../src/caddy/config.ts", "../src/launchd/host-effect.ts", "../src/ownership/adopt.ts", "../src/ownership/resume.ts", "../src/ownership/rows.ts", "../src/ownership/whole.ts", "../src/caddy/config-lifecycle.ts", "../src/caddy/admin-calls.ts", "../src/caddy/admin-guard.ts", "../src/caddy/config-errors.ts", "../src/launchd/secret-tripwire.ts", "../src/caddy/caddyfile-tripwire.ts", "../src/caddy/config-form.ts", "../src/launchd/job-form.ts", "../src/launchd/plist.ts", "../src/caddy/digest.ts", "../src/caddy/config-reconcile.ts", "../src/caddy/local-admin.ts", "../src/caddy/admin-address.ts", "../src/caddy/providers.ts", "../src/caddy/with-file.ts", "../src/launchd/host-file.ts", "../src/launchd/file-identity.ts", "../src/launchd/runner.ts", "../src/launchd/file-converge.ts", "../src/launchd/host-file-form.ts", "../src/launchd/host-file-lifecycle.ts"],
|
|
3
|
+
"sources": ["../src/caddy/access-forward-auth.ts", "../src/caddy/admin.ts", "../src/caddy/caddy-http-client.ts", "../src/caddy/config.ts", "../src/launchd/host-effect.ts", "../src/ownership/adopt.ts", "../src/ownership/resume.ts", "../src/ownership/rows.ts", "../src/ownership/whole.ts", "../src/caddy/config-lifecycle.ts", "../src/caddy/admin-calls.ts", "../src/caddy/admin-guard.ts", "../src/caddy/config-errors.ts", "../src/launchd/secret-tripwire.ts", "../src/caddy/caddyfile-tripwire.ts", "../src/caddy/config-form.ts", "../src/launchd/job-form.ts", "../src/launchd/plist.ts", "../src/caddy/digest.ts", "../src/caddy/config-reconcile.ts", "../src/caddy/format-warnings.ts", "../src/caddy/format.ts", "../src/caddy/local-admin.ts", "../src/caddy/admin-address.ts", "../src/caddy/providers.ts", "../src/caddy/with-file.ts", "../src/launchd/host-file.ts", "../src/launchd/file-identity.ts", "../src/launchd/runner.ts", "../src/launchd/file-converge.ts", "../src/launchd/host-file-form.ts", "../src/launchd/host-file-lifecycle.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"/**\n * The Caddyfile half of \"protect this route with Cloudflare Access\": a `forward_auth` block\n * pointing at a verifier that speaks the contract in `@homeflare/cloudflare/access-auth`.\n *\n * ★ A BUILDER, NOT A RESOURCE. Nothing here is created, adopted or destroyed — it is Caddyfile\n * TEXT that a caller drops into the `caddyfile` prop of a `CaddyConfig` / `caddyWithFile()`.\n * A resource would own a fragment of a config that `CaddyConfig` already owns whole, and two\n * owners of one file is the drift this package exists to prevent.\n *\n * ⛔ WHY IT IS GENERATED RATHER THAN COPY-PASTED. Every field below is load-bearing, and the\n * failure mode of getting one wrong is a route that looks protected and is not:\n * · a missing `copy_headers` — the upstream gets no identity and either breaks or, worse,\n * falls back to trusting a header the CLIENT set;\n * · the verifier on anything but loopback — the JWT check becomes advisory, because the\n * verifier itself can be reached and answered around;\n * · `uri` pointing at a path the verifier does not route — every request 404s, which is\n * non-2xx, which Caddy correctly treats as a denial, so the symptom is \"Access is broken\".\n */\n\n/** ⚠️ Kept in step with `granted()` in @homeflare/cloudflare/access-auth. */\nconst DEFAULT_COPY_HEADERS = ['X-Access-Email', 'X-Access-Sub'] as const;\n\nexport interface AccessForwardAuthProps {\n /**\n * Where the verifier listens, e.g. `127.0.0.1:9101`.\n * ⛔ LOOPBACK OR A UNIX SOCKET. See `verifierProblems` — a routable verifier is not a check.\n */\n readonly verifier: string;\n /** The path the verifier answers on. @default '/access/verify' */\n readonly uri?: string;\n /**\n * Response headers copied from the verifier onto the upstream request.\n * @default ['X-Access-Email', 'X-Access-Sub']\n */\n readonly copyHeaders?: readonly string[];\n /** Lines placed inside the route BEFORE `forward_auth` — typically the upstream. */\n readonly body?: readonly string[];\n /** Indent applied to every emitted line. @default '\\t' */\n readonly indent?: string;\n}\n\n/**\n * Problems that make a `forward_auth` block unsafe rather than merely wrong.\n *\n * ⛔ THE LOOPBACK RULE IS THE IMPORTANT ONE. If the verifier answers on a routable address, an\n * attacker reaches the UPSTREAM directly and never involves Caddy at all — or reaches the\n * verifier and reads identities out of it. The whole design assumes both the verifier and the\n * upstream are bound to loopback and that Caddy is the only way in.\n */\nconst LOOPBACK = new Set(['127.0.0.1', 'localhost', '::1', '[::1]']);\n\n/**\n * The host part of a Caddy upstream address.\n *\n * ⚠️ NOT `split(':')[0]`. That returns `'['` for `[::1]:9101`, so an IPv6 loopback verifier\n * was rejected as routable — caught by the test below, not by reading the code.\n */\nconst hostOf = (verifier: string): string => {\n const address = verifier.replace(/^https?:\\/\\//, '');\n if (address.startsWith('unix/')) return 'unix';\n\n // Bracketed IPv6 keeps its brackets; the port is whatever follows the closing one.\n if (address.startsWith('[')) return address.slice(0, address.indexOf(']') + 1);\n\n const colon = address.indexOf(':');\n return colon === -1 ? address : address.slice(0, colon);\n};\n\nexport const verifierProblems = (verifier: string): string[] => {\n const found: string[] = [];\n const host = hostOf(verifier.trim());\n\n if (verifier.trim() === '') found.push('verifier is empty');\n else if (host !== 'unix' && !LOOPBACK.has(host)) {\n found.push(\n `verifier must be loopback or a unix socket, got ${verifier} — a routable verifier can be bypassed`,\n );\n }\n return found;\n};\n\n/**\n * Render the `forward_auth` block for one protected route.\n *\n * ```ts\n * const caddyfile = `vnc.example.com {\n * ${accessForwardAuth({ verifier: '127.0.0.1:9101', body: ['reverse_proxy 127.0.0.1:6080'] })}\n * }\n * `;\n * ```\n *\n * ⛔ ONE VERIFIER ENDPOINT PER ACCESS APPLICATION. The AUD is fixed in the verifier's own config,\n * never carried in this request — so two applications mean two `uri`s (or two verifiers), not\n * one endpoint told which app to check. An AUD the request can influence is the vulnerability.\n *\n * ⚠️ `forward_auth` COPIES THE VERIFIER'S RESPONSE BACK TO THE CLIENT on any non-2xx, which is why\n * the verifier answers a bare 401 with no body: whatever it returns is what the browser sees.\n */\nexport const accessForwardAuth = (props: AccessForwardAuthProps): string => {\n const problems = verifierProblems(props.verifier);\n if (problems.length > 0) throw new Error(`accessForwardAuth: ${problems.join('; ')}`);\n\n const indent = props.indent ?? '\\t';\n const uri = props.uri ?? '/access/verify';\n const headers = props.copyHeaders ?? DEFAULT_COPY_HEADERS;\n\n const lines = [\n ...(props.body ?? []),\n `forward_auth ${props.verifier} {`,\n `${indent}uri ${uri}`,\n // ⚠️ `copy_headers` with a block, one field per line: the single-line form is also valid but\n // diffs badly, and this list is exactly where a security review needs to read a change.\n `${indent}copy_headers {`,\n ...headers.map((header) => `${indent}${indent}${header}`),\n `${indent}}`,\n '}',\n ];\n\n return lines.map((line) => `${indent}${line}`).join('\\n');\n};\n",
|
|
6
6
|
"/**\n * The one seam between the Caddy provider and a running Caddy: every operation goes through\n * `@distilled.cloud/caddy`'s typed `Services.admin.*` calls (admin-calls.ts), over the\n * `CaddyAdminService` metadata and the `Credentials` + `HttpClient` layers `localCaddyAdmin()`\n * builds (local-admin.ts) — nothing in this directory reaches Caddy any other way.\n *\n * ★ CADDY's OWN MANAGEMENT API, NOT A FILE AND A SIGNAL. Decision 23 (vault consolidation plan,\n * 2026-09-21): `POST /load` applies a Caddyfile with a graceful reload and rolls back a config\n * Caddy refuses; `GET /config/` reports what is running. Read in caddyserver/caddy v2.11.4,\n * caddyconfig/load.go and admin.go, and in the API docs (caddyserver.com/docs/api).\n * ★ `CaddyAdminService` CARRIES ONLY MESSAGE/GUARD METADATA (endpoint, listener) — never a\n * credential, and never the transport itself. The transport is `@distilled.cloud/caddy`'s own\n * `Credentials` and `HttpClient.HttpClient` services, provided alongside it by `caddyAdminLayer`,\n * so admin-calls.ts calls the SDK's operations directly rather than through a house-specific\n * `.request()` seam. A consumer plugs in another route to the API (an SSH-forwarded socket today;\n * a remote runner later) by providing a different `CaddyTransport` to `caddyAdminLayer`.\n * ⛔ THE ADMIN API HAS NO AUTHENTICATION. Anyone who reaches it can replace every site. It stays on\n * loopback or a unix socket; localCaddyAdmin() refuses anything else (local-admin.ts).\n */\nimport type * as HttpClient from 'effect/unstable/http/HttpClient';\nimport * as Context from 'effect/Context';\nimport * as Layer from 'effect/Layer';\nimport type { Credentials } from '@distilled.cloud/caddy';\n\n/**\n * Where the admin listener is, in the terms Caddy's own `admin` option uses — so a Caddyfile that\n * would move the listener away from where the provider talks to it can be refused (admin-guard.ts).\n */\nexport type CaddyAdminListener =\n | { readonly kind: 'tcp'; readonly hostHeader: string; readonly port: number }\n | { readonly kind: 'unix'; readonly path: string };\n\n/** Message/guard metadata for the Caddy this stack talks to — never a credential. */\nexport interface CaddyTarget {\n /** Where requests go, for error messages and the resource's attributes. */\n readonly endpoint: string;\n /**\n * The listener as Caddy sees it. `hostHeader` is the Host every request carries: Caddy checks it\n * against `admin.origins` (admin.go checkHost) on any loopback TCP listener.\n */\n readonly listener: CaddyAdminListener;\n}\n\n/** What `localCaddyAdmin()` (or a consumer's own transport) hands `caddyAdminLayer`. */\nexport interface CaddyTransport extends CaddyTarget {\n /** Provides the SDK's own `Credentials` and `HttpClient.HttpClient` — see local-admin.ts. */\n readonly layer: Layer.Layer<Credentials | HttpClient.HttpClient>;\n}\n\n/** The Effect service the Caddy provider reads its admin target's metadata from. */\nexport class CaddyAdminService extends Context.Service<CaddyAdminService, CaddyTarget>()(\n 'homeflare/caddy/CaddyAdmin',\n) {}\n\n/**\n * Provide a transport to the provider: `CaddyConfigProvider().pipe(Layer.provideMerge(caddyAdminLayer(localCaddyAdmin())))`\n * — never plain `Layer.provide` here (see providers.ts's own ⚠️): `CaddyConfigProvider()`'s handlers\n * keep needing these services every time the engine calls them, not just once while it is built. Merges\n * the target metadata with the SDK's `Credentials`/`HttpClient` layers `transport.layer` carries.\n */\nexport const caddyAdminLayer = (\n transport: CaddyTransport,\n): Layer.Layer<CaddyAdminService | Credentials | HttpClient.HttpClient> =>\n Layer.mergeAll(\n Layer.succeed(CaddyAdminService, {\n endpoint: transport.endpoint,\n listener: transport.listener,\n }),\n transport.layer,\n );\n",
|
|
7
7
|
"/**\n * An Effect `HttpClient.HttpClient` over `node:http`, dialling a unix socket or loopback TCP\n * directly — the SDK's own transport layer for `@distilled.cloud/caddy`'s typed operations.\n *\n * ★ node:http, NOT `effect/unstable/http/FetchHttpClient`. MEASURED 2026-09-21 on bun 1.4.0 and\n * node 26.7.0 (local-admin.ts's history): node:http dials a unix socket on BOTH runtimes, while\n * node's fetch has no `unix` option at all (only Bun's does) — `@effect/platform-node`'s own\n * `FetchHttpClient`/`NodeHttpClient.makeNodeHttp` (node:http, but URL-only — no `socketPath` seam)\n * cannot speak a unix socket either. The published dist loads under node too (launchd's\n * local-runner.ts makes the same call for the same reason), so this stays runtime-agnostic.\n * ★ A CONNECTION NOTHING ACCEPTED IS RETRIED; ONE CADDY ALREADY SAW IS NEVER RE-SENT. Only\n * `ECONNREFUSED` (nothing listening) and `ENOENT` (no unix socket file yet) mean the request\n * never reached Caddy — a launchd job bootstrapped a moment ago. Anything else (a reset, a\n * timeout) may have reached Caddy, so `POST /load` is never resent for it: `isUnreachable`\n * (local-admin.ts) is what tells `Caddy.Config`'s plan-time read to proceed without Caddy instead\n * of failing the whole plan (config.ts's `planWithoutCaddy`).\n */\nimport * as http from 'node:http';\nimport { Readable } from 'node:stream';\nimport * as Duration from 'effect/Duration';\nimport * as Effect from 'effect/Effect';\nimport * as Layer from 'effect/Layer';\nimport * as Result from 'effect/Result';\nimport * as HttpClient from 'effect/unstable/http/HttpClient';\nimport * as HttpClientError from 'effect/unstable/http/HttpClientError';\nimport type * as HttpClientRequest from 'effect/unstable/http/HttpClientRequest';\nimport * as HttpClientResponse from 'effect/unstable/http/HttpClientResponse';\nimport type { Target } from './admin-address.ts';\n\nexport type LocalHttpClientOptions = {\n /**\n * Abort an exchange after this long. @default 60_000\n * ⚠️ A `shutdown_delay` in the Caddyfile makes `/load` block that long (caddyhttp app.go Stop);\n * a timeout then fails the deploy while Caddy goes on to apply — the next plan converges.\n */\n readonly timeoutMs?: number;\n /** Retries when the connection is REFUSED — see the module doc. @default 2 */\n readonly retries?: number;\n /** @default 500 */\n readonly retryDelayMs?: number;\n};\n\nconst NEVER_CONNECTED = new Set(['ECONNREFUSED', 'ENOENT']);\n\nconst codeOf = (cause: unknown): string | undefined =>\n typeof cause === 'object' && cause !== null && 'code' in cause\n ? String((cause as { code: unknown }).code)\n : undefined;\n\n/**\n * Nothing accepted the connection — see the module doc's ★. A type guard, not just a predicate, so\n * config-lifecycle.ts's error-wrapping can pass through the raw error unchanged (still typed) and\n * config.ts's plan-time escape hatch (`Effect.catchIf`) narrows to it directly.\n */\nexport const isUnreachable = (error: unknown): error is HttpClientError.HttpClientError =>\n error instanceof HttpClientError.HttpClientError &&\n error.reason._tag === 'TransportError' &&\n NEVER_CONNECTED.has(codeOf(error.reason.cause) ?? '');\n\nconst transportFailure = (request: HttpClientRequest.HttpClientRequest, cause: unknown) =>\n new HttpClientError.HttpClientError({\n reason: new HttpClientError.TransportError({ request, cause }),\n });\n\n/** Node's response headers (string | string[] | undefined) → the single-valued form Web `Response` wants. Caddy never repeats a header this transport reads. */\nconst flattenHeaders = (headers: http.IncomingHttpHeaders): Record<string, string> => {\n const flat: Record<string, string> = {};\n for (const [key, value] of Object.entries(headers)) {\n if (value !== undefined) flat[key] = Array.isArray(value) ? value.join(', ') : value;\n }\n return flat;\n};\n\nconst waitForResponse = (\n nodeRequest: http.ClientRequest,\n request: HttpClientRequest.HttpClientRequest,\n) =>\n Effect.callback<http.IncomingMessage, HttpClientError.HttpClientError>((resume) => {\n const onError = (cause: Error): void => {\n resume(Effect.fail(transportFailure(request, cause)));\n };\n nodeRequest.on('error', onError);\n const onResponse = (response: http.IncomingMessage): void => {\n nodeRequest.off('error', onError);\n resume(Effect.succeed(response));\n };\n nodeRequest.on('response', onResponse);\n return Effect.sync(() => {\n nodeRequest.off('error', onError);\n nodeRequest.off('response', onResponse);\n });\n });\n\nconst waitForFinish = (\n nodeRequest: http.ClientRequest,\n request: HttpClientRequest.HttpClientRequest,\n) =>\n Effect.callback<void, HttpClientError.HttpClientError>((resume) => {\n const onError = (cause: Error): void => {\n resume(Effect.fail(transportFailure(request, cause)));\n };\n nodeRequest.once('error', onError);\n const onFinish = (): void => {\n nodeRequest.off('error', onError);\n resume(Effect.void);\n };\n nodeRequest.once('finish', onFinish);\n return Effect.sync(() => {\n nodeRequest.off('error', onError);\n nodeRequest.off('finish', onFinish);\n });\n });\n\n/**\n * Every Caddy operation's request body is `Empty` (GET/DELETE/`/stop`) or a `Uint8Array` — the\n * `T.HttpBody()`/JSON-body cascade never produces `Raw`, `FormData` or `Stream` for this SDK\n * (protocol.ts). A typed refusal, not a defect (S20), for a body shape that would mean the SDK grew\n * an operation this transport was never taught to send.\n */\nconst sendBody = (\n nodeRequest: http.ClientRequest,\n request: HttpClientRequest.HttpClientRequest,\n): Effect.Effect<void, HttpClientError.HttpClientError> =>\n Effect.suspend(() => {\n const body = request.body;\n if (body._tag === 'Empty') {\n nodeRequest.end();\n return waitForFinish(nodeRequest, request);\n }\n if (body._tag === 'Uint8Array') {\n // ⚠️ `body.contentLength` is never nullish, so `?? body.body.byteLength` reads as dead code\n // to TypeScript's `??` narrowing — which then (a real quirk, not a defect here) infers\n // `body` itself as `never` on that unreachable side. Two plain statements instead.\n nodeRequest.setHeader('content-length', body.contentLength);\n nodeRequest.end(body.body);\n return waitForFinish(nodeRequest, request);\n }\n return Effect.fail(\n new HttpClientError.HttpClientError({\n reason: new HttpClientError.EncodeError({\n request,\n description: `Caddy admin transport: unsupported request body \"${body._tag}\" — every Caddy operation sends Empty or a Uint8Array body`,\n }),\n }),\n );\n });\n\nconst toWebResponse = (source: http.IncomingMessage): Response =>\n new Response(Readable.toWeb(source) as unknown as ReadableStream, {\n headers: flattenHeaders(source.headers),\n status: source.statusCode ?? 0,\n });\n\nconst exchangeOnce = (\n target: Target,\n request: HttpClientRequest.HttpClientRequest,\n url: URL,\n signal: AbortSignal,\n timeoutMs: number,\n): Effect.Effect<HttpClientResponse.HttpClientResponse, HttpClientError.HttpClientError> =>\n Effect.suspend(() => {\n const nodeRequest = http.request({\n headers: request.headers,\n method: request.method,\n path: `${url.pathname}${url.search}`,\n signal,\n timeout: timeoutMs,\n ...(target.kind === 'unix'\n ? { socketPath: target.socketPath }\n : { host: target.host, port: target.port }),\n });\n // node:http's own inactivity timeout — a hang (e.g. a `shutdown_delay` blocking `/load`, see\n // the module doc) destroys the request, which then surfaces through the same 'error' handler\n // `waitForResponse`/`waitForFinish` already listen on.\n nodeRequest.on('timeout', () => {\n nodeRequest.destroy(new Error(`no answer in ${String(timeoutMs)} ms`));\n });\n return Effect.raceFirst(\n waitForResponse(nodeRequest, request),\n sendBody(nodeRequest, request).pipe(Effect.andThen(Effect.never)),\n ).pipe(\n Effect.onError(() => Effect.sync(() => nodeRequest.destroy())),\n Effect.map((source) => HttpClientResponse.fromWeb(request, toWebResponse(source))),\n );\n });\n\n/**\n * Retry ONLY a connection nothing accepted, up to `retries` times, spaced `retryDelayMs` apart —\n * a plain loop over `Effect.result`, not `Effect.retry`'s `{schedule, times, while}` options\n * object. MEASURED 2026-09-23: with a `Schedule` given alongside `times`/`while`, that combined\n * form retried an ECONNRESET past both — `while` kept correctly returning `false` every attempt,\n * logged and confirmed, yet the schedule's own unbounded `spaced` kept driving retries anyway. A\n * loop leaves no such ambiguity: the SAME `isUnreachable` check that would gate `while` here gates\n * every iteration directly, one attempt at a time.\n */\nconst withUnreachableRetry = (\n attempt: Effect.Effect<HttpClientResponse.HttpClientResponse, HttpClientError.HttpClientError>,\n retries: number,\n retryDelayMs: number,\n): Effect.Effect<HttpClientResponse.HttpClientResponse, HttpClientError.HttpClientError> =>\n Effect.gen(function* () {\n let attemptsLeft = retries;\n for (;;) {\n const outcome = yield* Effect.result(attempt);\n if (Result.isSuccess(outcome)) return outcome.success;\n if (attemptsLeft <= 0 || !isUnreachable(outcome.failure)) {\n return yield* Effect.fail(outcome.failure);\n }\n attemptsLeft -= 1;\n yield* Effect.sleep(Duration.millis(retryDelayMs));\n }\n });\n\n/** The transport `localCaddyAdmin()` provides as `HttpClient.HttpClient` — see local-admin.ts. */\nexport const makeLocalHttpClient = (\n target: Target,\n options: LocalHttpClientOptions = {},\n): Layer.Layer<HttpClient.HttpClient> => {\n const timeoutMs = options.timeoutMs ?? 60_000;\n const retries = options.retries ?? 2;\n const retryDelayMs = options.retryDelayMs ?? 500;\n return Layer.succeed(\n HttpClient.HttpClient,\n HttpClient.make((request, url, signal) => {\n const attempt = exchangeOnce(target, request, url, signal, timeoutMs);\n return retries <= 0 ? attempt : withUnreachableRetry(attempt, retries, retryDelayMs);\n }),\n );\n};\n",
|
|
8
|
-
"/**\n * `Caddy.Config` — a running Caddy's whole config, declared as Caddyfile text and applied through\n * Caddy's own admin API (decision 23), via `@distilled.cloud/caddy`'s typed `admin` operations.\n *\n * - create / update — `POST /adapt` (validate), `POST /load` with `text/caddyfile` (a graceful\n * reload; Caddy keeps the old config if it refuses the new one, and the error names why), then\n * `GET /config/` and insist it matches. Skipped when Caddy already runs this config.\n * - read — the digest of `GET /config/`. With no state it is the adoption probe (below).\n * - diff — declared, live and stored digests (config-lifecycle.ts). Never `replace`.\n * - delete — ⛔ NOTHING. See below.\n *\n * ⛔ DELETE NEVER TOUCHES CADDY, UNDER EITHER REMOVAL POLICY. Removing this declaration must not take\n * every site down: there is no \"less config\" to fall back to, and an empty config stops all\n * servers. `retain` is the default (the engine never calls delete); with `destroy` the handler\n * still only forgets. It never calls `/stop` (which exits the process) or `DELETE /config/`.\n * To empty a Caddy, do it by hand at its admin API.\n * ⛔ NOTHING IS ADOPTED SILENTLY (decision, 2026-09-21 — the house rule HostFile and LaunchdJob\n * keep). With no state, a running Caddy whose live config IS the declared one reads as ours (the\n * adoption changes nothing); any other config reads as `Unowned`, and the plan refuses it unless\n * the deploy runs with `--adopt`. A Caddy serving nothing reads as absent: a create. Where the\n * engine skips that probe, reconcile refuses the same takeover (config-lifecycle.ts).\n * ⛔ `caddyfile` IS NEVER A SECRET — see config-form.ts; refused before anything is sent.\n * ⚠️ WHICH CADDY is the transport's (providers.ts): `CaddyAdminService` plus the `Credentials`/\n * `HttpClient` layers `caddyAdminLayer` merges — one per stack, not a prop.\n */\nimport { Resource } from 'alchemy';\nimport { Unowned } from 'alchemy/AdoptPolicy';\nimport { isResolved } from 'alchemy/Diff';\nimport * as Provider from 'alchemy/Provider';\nimport * as Effect from 'effect/Effect';\nimport { resolvedString } from '../launchd/host-effect.ts';\nimport { adoptEnabled } from '../ownership/adopt.ts';\nimport { CaddyAdminService } from './admin.ts';\nimport { isUnreachable } from './caddy-http-client.ts';\nimport type { CaddyConfigAttributes, CaddyConfigProps } from './config-form.ts';\nimport { probeLive, readLive } from './config-lifecycle.ts';\nimport { diffConfig, reconcileConfig } from './config-reconcile.ts';\n\nexport type { CaddyConfigAttributes, CaddyConfigProps } from './config-form.ts';\n\nexport interface CaddyConfig extends Resource<\n 'Caddy.Config',\n CaddyConfigProps,\n CaddyConfigAttributes\n> {}\n\nexport const CaddyConfig = Resource<CaddyConfig>('Caddy.Config', {\n defaultRemovalPolicy: 'retain',\n});\n\n/**\n * ⚠️ A STOPPED CADDY MUST NOT FAIL THE PLAN THAT BRINGS IT BACK. Its launchd job usually sits in the\n * same stack; if every plan died on `ECONNREFUSED`, the fix to that job could never be deployed.\n * So at PLAN time only (read, diff) an unreachable Caddy plans an update — with a warning, because\n * the plan-time `/adapt` check did not run — and reconcile, which needs Caddy, still fails loudly.\n */\nconst planWithoutCaddy =\n <A>(admin: { endpoint: string }, fallback: A) =>\n (error: unknown) =>\n Effect.as(\n Effect.logWarning(\n `Caddy.Config: no Caddy at ${admin.endpoint} ` +\n `(${error instanceof Error ? error.message : String(error)}); planning without it — ` +\n 'the Caddyfile is validated when the deploy reaches Caddy',\n ),\n fallback,\n );\n\nexport const CaddyConfigProvider = () =>\n Provider.effect(\n CaddyConfig,\n Effect.gen(function* () {\n const admin = yield* CaddyAdminService;\n /** The probe, branded for the engine: plain when ours, `Unowned` otherwise. */\n const probe = (caddyfile: string | undefined, sourceFile: string | undefined) =>\n Effect.flatMap(probeLive(caddyfile, sourceFile), (found) => {\n if (found === undefined) return Effect.succeed(undefined);\n if (found.ours) return Effect.succeed(found.attributes);\n const unowned = Unowned(found.attributes);\n return found.unchecked === undefined\n ? Effect.succeed(unowned)\n : Effect.as(\n Effect.logWarning(\n `Caddy.Config at ${admin.endpoint}: the running config could not be compared ` +\n `with the declared Caddyfile (${found.unchecked}), so it is not treated as ours`,\n ),\n unowned,\n );\n });\n return CaddyConfig.Provider.of({\n /** ⛔ A Caddy has one config; there is nothing to enumerate, and nothing for nuke to delete. */\n list: () => Effect.succeed([]),\n\n /**\n * With state: the live attributes, which diff compares. With none, the ADOPTION PROBE —\n * `olds` is the declaration (Plan.ts passes `news`), and only a live config equal to it is\n * ours. ⚠️ A running Caddy is still the one the stack means (the transport reaches only\n * loopback), but WHOSE CONFIG it runs is not: a person, another tool or another stack.\n */\n read: ({ olds, output }) =>\n Effect.gen(function* () {\n return output === undefined\n ? yield* probe(resolvedString(olds, 'caddyfile'), resolvedString(olds, 'sourceFile'))\n : yield* readLive(resolvedString(olds, 'sourceFile'));\n }).pipe(\n // ★ Nothing to adopt from a Caddy that is down: plan a create, which is the same load.\n Effect.catchIf(isUnreachable, planWithoutCaddy(admin, undefined)),\n ),\n\n diff: ({ news, output }) => {\n if (output === undefined) return Effect.succeed(undefined);\n const update = planWithoutCaddy(admin, { action: 'update' as const });\n if (isResolved(news)) {\n return diffConfig(news, output).pipe(Effect.catchIf(isUnreachable, update));\n }\n /**\n * ⚠️ `sourceFile` is an Output while its HostFile changes in the same deploy\n * (caddyWithFile). The Caddyfile itself is usually plain text, so validate and compare\n * it now — a bad Caddyfile must fail the PLAN, before the HostFile writes it to disk —\n * and plan an update, which reloads only if the config really differs.\n */\n const caddyfile = resolvedString(news, 'caddyfile');\n if (caddyfile === undefined) return Effect.succeed(undefined);\n return Effect.as(diffConfig({ caddyfile }, output), { action: 'update' as const }).pipe(\n Effect.catchIf(isUnreachable, update),\n );\n },\n\n reconcile: ({ fqn, news, output }) =>\n Effect.gen(function* () {\n // ⛔ State is authority over the Caddy it was applied to, and no other. With none (the\n // engine may not have probed: see reconcileConfig), or with the transport now at\n // another endpoint, only adoption — `--adopt`, or this resource's own `adopt(…)`,\n // as the planner resolves it — loads over a config the stack cannot claim.\n const sameCaddy = output !== undefined && output.endpoint === admin.endpoint;\n const takeOver = sameCaddy || (yield* adoptEnabled(fqn));\n const stored = output === undefined ? {} : { stored: output.configSha256 };\n const applied = yield* reconcileConfig(news, { takeOver, ...stored });\n
|
|
8
|
+
"/**\n * `Caddy.Config` — a running Caddy's whole config, declared as Caddyfile text and applied through\n * Caddy's own admin API (decision 23), via `@distilled.cloud/caddy`'s typed `admin` operations.\n *\n * - create / update — `POST /adapt` (validate), `POST /load` with `text/caddyfile` (a graceful\n * reload; Caddy keeps the old config if it refuses the new one, and the error names why), then\n * `GET /config/` and insist it matches. Skipped when Caddy already runs this config.\n * - read — the digest of `GET /config/`. With no state it is the adoption probe (below).\n * - diff — declared, live and stored digests (config-lifecycle.ts). Never `replace`.\n * - delete — ⛔ NOTHING. See below.\n *\n * ⛔ DELETE NEVER TOUCHES CADDY, UNDER EITHER REMOVAL POLICY. Removing this declaration must not take\n * every site down: there is no \"less config\" to fall back to, and an empty config stops all\n * servers. `retain` is the default (the engine never calls delete); with `destroy` the handler\n * still only forgets. It never calls `/stop` (which exits the process) or `DELETE /config/`.\n * To empty a Caddy, do it by hand at its admin API.\n * ⛔ NOTHING IS ADOPTED SILENTLY (decision, 2026-09-21 — the house rule HostFile and LaunchdJob\n * keep). With no state, a running Caddy whose live config IS the declared one reads as ours (the\n * adoption changes nothing); any other config reads as `Unowned`, and the plan refuses it unless\n * the deploy runs with `--adopt`. A Caddy serving nothing reads as absent: a create. Where the\n * engine skips that probe, reconcile refuses the same takeover (config-lifecycle.ts).\n * ⛔ `caddyfile` IS NEVER A SECRET — see config-form.ts; refused before anything is sent.\n * ⚠️ WHICH CADDY is the transport's (providers.ts): `CaddyAdminService` plus the `Credentials`/\n * `HttpClient` layers `caddyAdminLayer` merges — one per stack, not a prop.\n */\nimport { Resource } from 'alchemy';\nimport { Unowned } from 'alchemy/AdoptPolicy';\nimport { isResolved } from 'alchemy/Diff';\nimport * as Provider from 'alchemy/Provider';\nimport * as Effect from 'effect/Effect';\nimport { resolvedString } from '../launchd/host-effect.ts';\nimport { adoptEnabled } from '../ownership/adopt.ts';\nimport { CaddyAdminService } from './admin.ts';\nimport { isUnreachable } from './caddy-http-client.ts';\nimport type { CaddyConfigAttributes, CaddyConfigProps } from './config-form.ts';\nimport { probeLive, readLive } from './config-lifecycle.ts';\nimport { diffConfig, reconcileConfig } from './config-reconcile.ts';\nimport { formattingFixLine, splitFormattingWarning } from './format-warnings.ts';\n\nexport type { CaddyConfigAttributes, CaddyConfigProps } from './config-form.ts';\n\nexport interface CaddyConfig extends Resource<\n 'Caddy.Config',\n CaddyConfigProps,\n CaddyConfigAttributes\n> {}\n\nexport const CaddyConfig = Resource<CaddyConfig>('Caddy.Config', {\n defaultRemovalPolicy: 'retain',\n});\n\n/**\n * ⚠️ A STOPPED CADDY MUST NOT FAIL THE PLAN THAT BRINGS IT BACK. Its launchd job usually sits in the\n * same stack; if every plan died on `ECONNREFUSED`, the fix to that job could never be deployed.\n * So at PLAN time only (read, diff) an unreachable Caddy plans an update — with a warning, because\n * the plan-time `/adapt` check did not run — and reconcile, which needs Caddy, still fails loudly.\n */\nconst planWithoutCaddy =\n <A>(admin: { endpoint: string }, fallback: A) =>\n (error: unknown) =>\n Effect.as(\n Effect.logWarning(\n `Caddy.Config: no Caddy at ${admin.endpoint} ` +\n `(${error instanceof Error ? error.message : String(error)}); planning without it — ` +\n 'the Caddyfile is validated when the deploy reaches Caddy',\n ),\n fallback,\n );\n\nexport const CaddyConfigProvider = () =>\n Provider.effect(\n CaddyConfig,\n Effect.gen(function* () {\n const admin = yield* CaddyAdminService;\n /** The probe, branded for the engine: plain when ours, `Unowned` otherwise. */\n const probe = (caddyfile: string | undefined, sourceFile: string | undefined) =>\n Effect.flatMap(probeLive(caddyfile, sourceFile), (found) => {\n if (found === undefined) return Effect.succeed(undefined);\n if (found.ours) return Effect.succeed(found.attributes);\n const unowned = Unowned(found.attributes);\n return found.unchecked === undefined\n ? Effect.succeed(unowned)\n : Effect.as(\n Effect.logWarning(\n `Caddy.Config at ${admin.endpoint}: the running config could not be compared ` +\n `with the declared Caddyfile (${found.unchecked}), so it is not treated as ours`,\n ),\n unowned,\n );\n });\n return CaddyConfig.Provider.of({\n /** ⛔ A Caddy has one config; there is nothing to enumerate, and nothing for nuke to delete. */\n list: () => Effect.succeed([]),\n\n /**\n * With state: the live attributes, which diff compares. With none, the ADOPTION PROBE —\n * `olds` is the declaration (Plan.ts passes `news`), and only a live config equal to it is\n * ours. ⚠️ A running Caddy is still the one the stack means (the transport reaches only\n * loopback), but WHOSE CONFIG it runs is not: a person, another tool or another stack.\n */\n read: ({ olds, output }) =>\n Effect.gen(function* () {\n return output === undefined\n ? yield* probe(resolvedString(olds, 'caddyfile'), resolvedString(olds, 'sourceFile'))\n : yield* readLive(resolvedString(olds, 'sourceFile'));\n }).pipe(\n // ★ Nothing to adopt from a Caddy that is down: plan a create, which is the same load.\n Effect.catchIf(isUnreachable, planWithoutCaddy(admin, undefined)),\n ),\n\n diff: ({ news, output }) => {\n if (output === undefined) return Effect.succeed(undefined);\n const update = planWithoutCaddy(admin, { action: 'update' as const });\n if (isResolved(news)) {\n return diffConfig(news, output).pipe(Effect.catchIf(isUnreachable, update));\n }\n /**\n * ⚠️ `sourceFile` is an Output while its HostFile changes in the same deploy\n * (caddyWithFile). The Caddyfile itself is usually plain text, so validate and compare\n * it now — a bad Caddyfile must fail the PLAN, before the HostFile writes it to disk —\n * and plan an update, which reloads only if the config really differs.\n */\n const caddyfile = resolvedString(news, 'caddyfile');\n if (caddyfile === undefined) return Effect.succeed(undefined);\n return Effect.as(diffConfig({ caddyfile }, output), { action: 'update' as const }).pipe(\n Effect.catchIf(isUnreachable, update),\n );\n },\n\n reconcile: ({ fqn, news, output }) =>\n Effect.gen(function* () {\n // ⛔ State is authority over the Caddy it was applied to, and no other. With none (the\n // engine may not have probed: see reconcileConfig), or with the transport now at\n // another endpoint, only adoption — `--adopt`, or this resource's own `adopt(…)`,\n // as the planner resolves it — loads over a config the stack cannot claim.\n const sameCaddy = output !== undefined && output.endpoint === admin.endpoint;\n const takeOver = sameCaddy || (yield* adoptEnabled(fqn));\n const stored = output === undefined ? {} : { stored: output.configSha256 };\n const applied = yield* reconcileConfig(news, { takeOver, ...stored });\n // ★ THE FORMATTING WARNING GETS ITS OWN LINE, NAMING THE FIX — separate from the rest,\n // which keep logging exactly as before (format-warnings.ts).\n const { formatting, rest } = splitFormattingWarning(applied.warnings);\n if (formatting.length > 0) {\n yield* Effect.logWarning(formattingFixLine(admin.endpoint));\n }\n for (const warning of rest) {\n yield* Effect.logWarning(`Caddy.Config at ${admin.endpoint}: ${warning}`);\n }\n return applied.attributes;\n }),\n\n delete: () => Effect.void,\n });\n }),\n );\n",
|
|
9
9
|
"/**\n * The one place a HostRunner's promises become Effects — plus the one probe of an unresolved\n * `news` both providers' diffs share. (The engine's adopt setting lives in ownership/adopt.ts.)\n *\n * ★ The lifecycle files are plain async functions over a HostRunner (see runner.ts for why the\n * runner is promise-based), so each provider handler is a single `lift(() => step(runner, …))`.\n * ⚠️ A thrown Error stays that Error — its message is the refusal a deploy prints. Anything else\n * thrown is wrapped, so the failure channel is always an Error with a readable message.\n */\nimport * as Effect from 'effect/Effect';\n\nexport const lift = <A>(step: () => Promise<A>): Effect.Effect<A, Error> =>\n Effect.tryPromise({\n catch: (cause) => (cause instanceof Error ? cause : new Error(String(cause))),\n try: step,\n });\n\n/**\n * A string prop of a diff's `news`, when that one prop is already resolved; `undefined` while it\n * is still an Output (a function-typed proxy), an Effect or a Config.\n * ★ For the identity props a diff must see even when the rest of `news` is unresolved — a plain\n * string is resolved by definition, so `typeof` is the whole test.\n */\nexport const resolvedString = (news: unknown, key: string): string | undefined => {\n if (typeof news !== 'object' || news === null) return undefined;\n const value = (news as Record<string, unknown>)[key];\n return typeof value === 'string' ? value : undefined;\n};\n",
|
|
10
10
|
"/**\n * Whether a live object this stack holds no state for may be written — the apply-time half of the\n * house rule that NOTHING IS ADOPTED WITHOUT `--adopt` (decided 2026-09-21 for HostFile, LaunchdJob,\n * CaddyConfig and every Bao.* family). probe.ts is the plan-time half.\n *\n * ★ FAMILY-NEUTRAL ON PURPOSE. The engine questions here — what `--adopt` resolves to for one FQN,\n * whether this apply resumes the resource's own interrupted create — are the same for a vault\n * role, a launchd plist and a Caddy config, so they live once, outside every subpath's directory.\n */\nimport { AdoptPolicy } from 'alchemy/AdoptPolicy';\nimport { AlchemyContext } from 'alchemy/AlchemyContext';\nimport { Stack } from 'alchemy/Stack';\nimport * as Effect from 'effect/Effect';\nimport * as Option from 'effect/Option';\nimport { resumes, unfinished } from './resume.ts';\nimport { forgetRefusedCreate, isCreate } from './rows.ts';\n\n/**\n * Whether the resource at `fqn` may be adopted, resolved exactly as the planner resolves it (alchemy\n * beta.79 Plan.ts: `resource.Adopt ?? shouldAdopt`): a resource-scoped `adopt(…)`, else the\n * `AdoptPolicy` service, else `AlchemyContext.adopt`, else off.\n * ★ FOR A CREATE THE ENGINE NEVER PROBED. Alchemy skips the adoption probe while `news` holds an\n * Output, so an ownership check that must still honour `--adopt` can only run at apply. All three\n * reach the apply: Alchemist runs plan AND apply under the session context, which provides the\n * services from the CLI flag and the Stack the resources registered on (Alchemist/Session.ts,\n * routes/stack.ts; Apply.ts reads the same Stack).\n * ⛔ THE RESOURCE-SCOPED SETTING WINS, BOTH WAYS. The engine captures `adopt(…)` on the resource at\n * registration (Resource.ts `Adopt`, into `Stack.resources[fqn]`) and never hands it to a\n * provider. Reading only the deploy-wide flag let `--adopt` take over a resource declared\n * `.pipe(adopt(false))` — which the planner refuses — and refused one declared `adopt(true)`.\n * ⚠️ `resources` carries an `@internal` comment in Alchemy's source, but it is in the published types\n * and the planner reads `Adopt` from it. caddy/adopt-scope.test.ts registers through the real\n * `Resource`, so an upgrade that stops recording it there fails the suite.\n */\nexport const adoptEnabled = (fqn: string): Effect.Effect<boolean> =>\n Effect.gen(function* () {\n const stack = yield* Effect.serviceOption(Stack);\n const scoped = Option.isSome(stack) ? stack.value.resources[fqn]?.Adopt : undefined;\n if (scoped !== undefined) return scoped;\n const policy = yield* Effect.serviceOption(AdoptPolicy);\n if (Option.isSome(policy)) return policy.value;\n const context = yield* Effect.serviceOption(AlchemyContext);\n return Option.isSome(context) ? context.value.adopt : false;\n });\n\n/** The three fields of a `reconcile` (or `read`) call that say whose object this is. */\nexport type Owner = {\n readonly fqn: string;\n readonly instanceId: string;\n /** The attributes state holds; `undefined` on a create. */\n readonly output: unknown;\n};\n\n/**\n * Whether `--adopt` may speak for this apply's generation: a CREATE (rows.ts isCreate), or an\n * UNFINISHED generation whose row this plan's diff saw with no attributes (resume.ts) — the\n * resume Alchemy itself offers `--adopt` for (\"Cannot resume creating … Re-run with --adopt\").\n * ⛔ NOT A FRESH REPLACE'S NEW GENERATION. The planner never probes it and never offers it adoption,\n * so the identity it moves to was never asked about under `--adopt`: 🔴 MEASURED 2026-09-21\n * (launchd/adopt-apply.test.ts), a HostFile whose path changed onto a file it did not own\n * overwrote that file under a deploy-wide `--adopt` meant for something else. A Bao rename onto a\n * taken identity already fails the plan, `--adopt` or not (rename.ts judgeMove); this keeps the\n * apply to the same answer.\n */\nconst adoptable = (owner: Owner): Effect.Effect<boolean> =>\n Effect.gen(function* () {\n if (yield* isCreate(owner.fqn, owner.instanceId)) return true;\n return yield* unfinished(owner.instanceId);\n });\n\n/** Whether a stateless `reconcile` may take over a live object: adoption on, for an adoptable one. */\nexport const adoptsAtApply = (owner: Owner): Effect.Effect<boolean> =>\n Effect.gen(function* () {\n if (!(yield* adoptEnabled(owner.fqn))) return false;\n return yield* adoptable(owner);\n });\n\n/** A lifecycle helper's hook for refuseTakeover, bound to one call's Owner: `(what) => …`. */\nexport type Claim = (what: string) => Effect.Effect<void>;\n\n/**\n * `reconcile`'s check, called with the live object it found BEFORE any write: dies unless that\n * object may be written. It may when state already vouches for it (`output`), when this apply\n * resumes the resource's own interrupted create or replace and its diff proved the object that\n * generation's (resume.ts), or when adoption is on for a create or an unfinished generation\n * (adoptable).\n * ⛔ WHY IT EXISTS AT ALL: THE PROBE DOES NOT GUARD EVERY CREATE. Alchemy skips it while `news` holds\n * an Output (Plan.ts), a new generation of a replace is never probed, and an object can appear\n * between plan and apply. Each of those used to be a silent takeover: written over, then recorded\n * as ours, and deleted with the stack under `destroy`.\n * ⚠️ A CHECK, THEN A WRITE — NOT A LOCK. Two creates of one name in the same deploy run\n * concurrently, both read nothing, and both write (measured with the fakes, 2026-09-21). Nothing\n * between a read and a write can close that; declare each name once.\n * ⚠️ AN IDENTICAL OBJECT IS STILL A TAKEOVER (decided 2026-09-21). Nothing would be written, but the\n * state row would claim it, and a later delete would remove what another owner still relies on.\n * ⛔ A REFUSED CREATE FORGETS ITS `creating` ROW (rows.ts forgetRefusedCreate), or the next plan's\n * recovery read would adopt the very object this refused.\n */\nexport const refuseTakeover = (owner: Owner, what: string): Effect.Effect<void> =>\n Effect.gen(function* () {\n if (owner.output !== undefined) return;\n if (yield* resumes(owner.instanceId)) return;\n const may = yield* adoptable(owner);\n if (may && (yield* adoptEnabled(owner.fqn))) return;\n yield* forgetRefusedCreate(owner.fqn, owner.instanceId);\n const remedy = may\n ? 'Deploy with --adopt (or wrap the resource in adopt(true)) to take it over, or remove it first.'\n : 'It is the new identity of a replace, which --adopt does not cover: remove it first.';\n return yield* Effect.die(\n new Error(\n `${what}: already exists, and this stack holds no state for it — the plan could not ask ` +\n 'first (a prop was still an Output, a replace moved onto it, or it appeared after the ' +\n `plan). Nothing was written. ${remedy}`,\n ),\n );\n });\n\n/** refuseTakeover bound to one call's Owner, for a lifecycle helper that finds the live object. */\nexport const claimFor =\n (owner: Owner): Claim =>\n (what) =>\n refuseTakeover(owner, what);\n",
|
|
11
11
|
"/**\n * Whether this apply RESUMES a create or replace the engine already started for this resource AND\n * the live object it will find is proven that generation's own — the one case in which a stateless\n * `reconcile` may write over a live object without `--adopt`.\n *\n * ★ HOW THE ENGINE TELLS US. Alchemy calls `diff` whenever a state row exists, and hands it `output`\n * = that row's attributes (alchemy beta.79 Plan.ts). A row with NO attributes is exactly an\n * unfinished generation: `creating` (a create interrupted after its write, before its commit),\n * `replacing` (the same for a replace), or `deleting` re-driven as a create. A fresh create is\n * never diffed at all. So the diff of such a row decides, and the apply that follows (the same\n * instance id: Apply.ts reuses the row's) finds the note.\n * ⛔ A ROW PROVES NOTHING BY ITSELF (red team, 2026-09-21). Apply commits it BEFORE reconcile runs, so\n * a deploy killed before the claim — an upstream that failed, a Ctrl-C — leaves a row whose create\n * never asked whose object sat at its identity. 🔴 MEASURED (openbao/adopt-holes.test.ts): with the\n * name an Output, the next deploy \"resumed\" that create and wrote over another owner's role, in\n * every family that had a note on the row alone. So the note is left only when the family's own\n * `read`, asked as the recovery read (probe.ts ownedRead: a recorded instance, a row carrying the\n * whole declaration, and a live object that matches it), answers \"ours\". For a `creating` row\n * that is the question Plan.ts already asked; for a `replacing` row it is the only time it is asked.\n * ⚠️ WHY NOT THE STATE STORE ALONE. At reconcile both look the same: Apply commits the fresh create's\n * `creating` row before calling reconcile, so a row with this instance id is always there.\n * ★ THE CHANNEL IS ALCHEMY'S OWN: `Artifacts`, the per-FQN bag the engine shares between one plan\n * and its apply (Artifacts.ts: \"diff computes … create / update reads the same artifact\").\n * Deploy.ts and the Alchemist session both hold one store across the pair.\n * ⚠️ IT FAILS CLOSED. No bag, a bag the plan never wrote, or an object the read cannot prove ours\n * reads as a fresh create, and adopt.ts then asks for `--adopt` — the safe direction.\n * ★ AN UNPROVEN RESUME IS STILL MARKED UNFINISHED (`noteUnfinished`), so `--adopt` can take it over\n * the way Alchemy's own \"Cannot resume creating … Re-run with --adopt\" offers for a create — while\n * a FRESH replace's new generation, which no diff ever saw without attributes, stays unadoptable.\n */\nimport { Unowned } from 'alchemy/AdoptPolicy';\nimport { Artifacts } from 'alchemy/Artifacts';\nimport * as Effect from 'effect/Effect';\nimport * as Option from 'effect/Option';\n\nconst PROVEN = 'homeflare/ownership/resumes';\nconst UNFINISHED = 'homeflare/ownership/unfinished';\n\nconst note = (key: string, instanceId: string): Effect.Effect<void> =>\n Effect.gen(function* () {\n const bag = yield* Effect.serviceOption(Artifacts);\n if (Option.isSome(bag)) yield* bag.value.set(key, instanceId);\n });\n\nconst noted = (key: string, instanceId: string): Effect.Effect<boolean> =>\n Effect.gen(function* () {\n const bag = yield* Effect.serviceOption(Artifacts);\n if (Option.isNone(bag)) return false;\n return (yield* bag.value.get<string>(key)) === instanceId;\n });\n\n/**\n * `diff`'s note for a row with no attributes: `instanceId` is an unfinished generation of this\n * resource's own, which `--adopt` may resume when nothing proves it (adopt.ts adoptable). Returns\n * `undefined`, a diff's \"defer to the engine\".\n */\nexport const noteUnfinished = (instanceId: string): Effect.Effect<undefined> =>\n Effect.as(note(UNFINISHED, instanceId), undefined);\n\n/**\n * Note `instanceId` unfinished, and a proven resume when `recovered` — the family's `read` of the\n * row's props, asked with no attributes — answers a plain object: ours. `Unowned`, nothing, or a\n * read that fails or dies proves nothing. ⚠️ Never fails the plan: an unproven resume is refused\n * at apply instead, unless `--adopt`.\n */\nexport const noteResume = <R>(\n instanceId: string,\n recovered: Effect.Effect<unknown, unknown, R>,\n): Effect.Effect<void, never, R> =>\n Effect.gen(function* () {\n yield* noteUnfinished(instanceId);\n const unproven = () => Effect.succeed(undefined);\n const found = yield* recovered.pipe(Effect.catch(unproven), Effect.catchDefect(unproven));\n if (found === undefined || found === null || Unowned.is(found)) return;\n yield* note(PROVEN, instanceId);\n });\n\n/** Whether the plan for this apply noted `instanceId` as a proven resumed create or replace. */\nexport const resumes = (instanceId: string): Effect.Effect<boolean> => noted(PROVEN, instanceId);\n\n/** Whether the plan for this apply saw `instanceId` as an unfinished generation (proven or not). */\nexport const unfinished = (instanceId: string): Effect.Effect<boolean> =>\n noted(UNFINISHED, instanceId);\n\n/** The fields of a `read` or `diff` call provingResumes uses; a family's own input carries more. */\ntype Ask = {\n readonly id: string;\n readonly fqn: string;\n readonly instanceId: string;\n readonly olds: unknown;\n readonly output: unknown;\n};\ntype Hook = Effect.Effect<unknown, unknown, unknown>;\n\n/** The two hooks provingResumes wraps, as Alchemy's ProviderService declares them. */\ninterface Resumable {\n read?(input: Ask): Hook;\n diff?(input: Ask): Hook;\n}\n\n/**\n * A provider whose `diff`, for a row with no attributes, first asks the provider's own `read` whether\n * the live object is that unfinished generation's (noteResume), then runs as written. Every Bao.*\n * family is built through it, so their diffs answer such a row with a plain `undefined`.\n */\nexport const provingResumes = <S extends Resumable>(service: S): S => {\n const { diff, read } = service;\n if (diff === undefined || read === undefined) return service;\n const proving: Resumable['diff'] = (input) =>\n Effect.gen(function* () {\n if (input.output === undefined) {\n yield* noteResume(input.instanceId, read({ ...input, output: undefined }));\n }\n return yield* diff(input);\n });\n // ⚠️ The one cast: `diff` keeps the family's own signature — it is the family's diff, run after.\n return { ...service, diff: proving } as S;\n};\n",
|
|
@@ -21,7 +21,9 @@
|
|
|
21
21
|
"/**\n * LaunchdJob's props, attributes and the pure half of the provider: domain parsing, the plist path,\n * and the props → plist mapping whose SHA-256 is the whole diff.\n *\n * ★ KEY NAMES AND MEANINGS FROM launchd.plist(5), checked against the 148 nix-darwin daemons on a\n * macOS 27.2 host on 2026-09-21 (read-only, from /nix/store): Label, ProgramArguments, RunAtLoad,\n * KeepAlive (boolean or {SuccessfulExit}), ThrottleInterval, StandardOutPath/StandardErrorPath,\n * EnvironmentVariables, UserName, StartInterval and StartCalendarInterval are the keys in real\n * use. Everything rarer goes through `extraKeys`.\n */\nimport { createHash } from 'node:crypto';\nimport { type PlistDict, type PlistValue, renderPlist } from './plist.ts';\n\n/** `system` (LaunchDaemons, root) or one user's login session, `gui/<uid>` (LaunchAgents). */\nexport type LaunchdDomain = 'system' | `gui/${number}`;\n\n/** One StartCalendarInterval entry. An omitted field is a wildcard, as in cron. */\nexport type CalendarInterval = {\n readonly minute?: number;\n readonly hour?: number;\n readonly day?: number;\n /** 0 and 7 are both Sunday. */\n readonly weekday?: number;\n readonly month?: number;\n};\n\n/** `true` = always restart; the object form restarts only on the named conditions. */\nexport type KeepAlive = boolean | { readonly successfulExit?: boolean; readonly crashed?: boolean };\n\nexport interface LaunchdJobProps {\n /** Reverse-DNS label. Unique per domain; also the plist's file name. */\n label: string;\n domain: LaunchdDomain;\n /** argv; the first element must be an absolute path. */\n programArguments: readonly string[];\n /**\n * ⛔ NON-SECRET VALUES ONLY. Props are stored unencrypted in Alchemy state, and these also land in\n * the plist on disk and in `launchctl print`. Pass a secret as a FILE PATH that a secret renderer\n * (openbao-agent) maintains — secret-tripwire.ts refuses the obvious mistakes.\n */\n environment?: Readonly<Record<string, string>>;\n runAtLoad?: boolean;\n keepAlive?: KeepAlive;\n /** Seconds between starts. */\n startInterval?: number;\n startCalendarInterval?: CalendarInterval | readonly CalendarInterval[];\n /** Minimum seconds between (re)starts; launchd's default is 10. */\n throttleInterval?: number;\n standardOutPath?: string;\n standardErrorPath?: string;\n workingDirectory?: string;\n /** Run as this user. ⚠️ System domain only — launchd ignores it for agents, so it is refused. */\n userName?: string;\n /** Run as this group. ⚠️ System domain only, like `userName`. */\n groupName?: string;\n /**\n * Any other launchd.plist(5) key, verbatim (`ProcessType`, `SoftResourceLimits`, …).\n * ⛔ A key the typed props own is refused, so one job can never say two things.\n */\n extraKeys?: PlistDict;\n}\n\nexport interface LaunchdJobAttributes {\n label: string;\n domain: LaunchdDomain;\n /** `<domain>/<label>` — what `launchctl print` / `bootout` take. */\n serviceTarget: string;\n plistPath: string;\n /** SHA-256 of the plist bytes last bootstrapped (reconcile) or found on disk (read). */\n plistSha256: string;\n /** Bootstrapped into the domain — not necessarily running. */\n loaded: boolean;\n /** launchd's own word: `running`, `not running`, … */\n state?: string;\n pid?: number;\n lastExitCode?: number;\n}\n\nexport type ParsedDomain =\n | { readonly kind: 'system' }\n | { readonly kind: 'gui'; readonly uid: number };\n\nexport const parseDomain = (domain: string): ParsedDomain | undefined => {\n if (domain === 'system') return { kind: 'system' };\n const match = /^gui\\/(\\d+)$/.exec(domain);\n return match?.[1] === undefined ? undefined : { kind: 'gui', uid: Number(match[1]) };\n};\n\nexport const serviceTarget = (label: string, domain: LaunchdDomain): string => `${domain}/${label}`;\n\n/**\n * Where launchd expects the job's plist. ★ Derived, never declared: a daemon's plist outside\n * /Library/LaunchDaemons is not bootstrapped at boot, so a free-form path would be a job that\n * silently stops existing after the next restart.\n */\nexport const plistPathFor = (\n label: string,\n domain: ParsedDomain,\n home: string | undefined,\n): string => {\n if (domain.kind === 'system') return `/Library/LaunchDaemons/${label}.plist`;\n // ⛔ No `~` fallback: the provider may run as root, whose `~` is not the agent owner's home.\n if (home === undefined || !home.startsWith('/')) {\n throw new Error(`gui/${String(domain.uid)}: no home directory for that uid on this host`);\n }\n return `${home}/Library/LaunchAgents/${label}.plist`;\n};\n\n/** Plist keys the typed props own — `extraKeys` may not name them. `Program` is refused too. */\nexport const OWNED_KEYS: readonly string[] = [\n 'EnvironmentVariables',\n 'GroupName',\n 'KeepAlive',\n 'Label',\n 'Program',\n 'ProgramArguments',\n 'RunAtLoad',\n 'StandardErrorPath',\n 'StandardOutPath',\n 'StartCalendarInterval',\n 'StartInterval',\n 'ThrottleInterval',\n 'UserName',\n 'WorkingDirectory',\n];\n\nconst calendarDict = (entry: CalendarInterval): PlistDict => {\n const dict: Record<string, PlistValue> = {};\n if (entry.minute !== undefined) dict['Minute'] = entry.minute;\n if (entry.hour !== undefined) dict['Hour'] = entry.hour;\n if (entry.day !== undefined) dict['Day'] = entry.day;\n if (entry.weekday !== undefined) dict['Weekday'] = entry.weekday;\n if (entry.month !== undefined) dict['Month'] = entry.month;\n return dict;\n};\n\nconst keepAliveValue = (keepAlive: KeepAlive): PlistValue => {\n if (typeof keepAlive === 'boolean') return keepAlive;\n const dict: Record<string, PlistValue> = {};\n if (keepAlive.successfulExit !== undefined) dict['SuccessfulExit'] = keepAlive.successfulExit;\n if (keepAlive.crashed !== undefined) dict['Crashed'] = keepAlive.crashed;\n return dict;\n};\n\n/** The plist dict for a job. ⚠️ Assumes jobProblems() came back empty. */\nexport const jobPlistDict = (props: LaunchdJobProps): PlistDict => {\n const dict: Record<string, PlistValue> = { ...props.extraKeys };\n dict['Label'] = props.label;\n dict['ProgramArguments'] = [...props.programArguments];\n const env = props.environment ?? {};\n if (Object.keys(env).length > 0) dict['EnvironmentVariables'] = { ...env };\n if (props.runAtLoad !== undefined) dict['RunAtLoad'] = props.runAtLoad;\n if (props.keepAlive !== undefined) dict['KeepAlive'] = keepAliveValue(props.keepAlive);\n if (props.startInterval !== undefined) dict['StartInterval'] = props.startInterval;\n const calendar = props.startCalendarInterval;\n if (calendar !== undefined) {\n dict['StartCalendarInterval'] = Array.isArray(calendar)\n ? (calendar as readonly CalendarInterval[]).map(calendarDict)\n : calendarDict(calendar as CalendarInterval);\n }\n if (props.throttleInterval !== undefined) dict['ThrottleInterval'] = props.throttleInterval;\n if (props.standardOutPath !== undefined) dict['StandardOutPath'] = props.standardOutPath;\n if (props.standardErrorPath !== undefined) dict['StandardErrorPath'] = props.standardErrorPath;\n if (props.workingDirectory !== undefined) dict['WorkingDirectory'] = props.workingDirectory;\n if (props.userName !== undefined) dict['UserName'] = props.userName;\n if (props.groupName !== undefined) dict['GroupName'] = props.groupName;\n return dict;\n};\n\nexport const sha256Hex = (bytes: Uint8Array | string): string =>\n createHash('sha256').update(bytes).digest('hex');\n\n/** The rendered plist and its digest — the only thing LaunchdJob compares. */\nexport const renderJob = (\n props: LaunchdJobProps,\n): { text: string; bytes: Uint8Array; sha256: string } => {\n const text = renderPlist(jobPlistDict(props));\n const bytes = new TextEncoder().encode(text);\n return { bytes, sha256: sha256Hex(bytes), text };\n};\n",
|
|
22
22
|
"/**\n * An XML property list serializer — the subset launchd.plist(5) reads, and nothing else.\n *\n * ★ WHY NOT AN npm LIBRARY. Nothing in this workspace depends on one (checked 2026-09-21: no\n * `plist`, `xmlbuilder` or `@xmldom/xmldom` anywhere under node_modules), and the common one pulls\n * an XML DOM in for PARSING, which a provider that only RENDERS never does. The subset a launchd\n * job needs is five node types, so this is ~100 lines plus exhaustive tests (plist.test.ts), which\n * also round-trip every case through Apple's own `plutil` when the tests run on macOS.\n *\n * ⛔ THE OUTPUT MUST BE DETERMINISTIC. LaunchdJob diffs by the SHA-256 of these bytes, so two\n * renders of one declaration must be byte-identical: dict keys are sorted, indentation is fixed,\n * and nothing depends on insertion order. A non-deterministic render is a forever-`update`.\n * ⚠️ AND A CHANGE TO THIS FILE'S OUTPUT RESTARTS EVERY JOB. A new header, indent or escape changes\n * every digest, so the next deploy after the kit upgrade updates — restarts — every declared\n * job at once. Treat any byte change here as a breaking change and say so in its changeset.\n *\n * ⛔ REFUSE, NEVER COERCE. `undefined`, `null`, a fraction, NaN, a class instance or a character XML\n * 1.0 cannot carry is a thrown PlistError naming the path, not a silently dropped key. A dropped\n * `KeepAlive` is a daemon that never restarts, and nothing downstream would say why.\n */\n\n/** Every value launchd reads. ⚠️ No `<real>`, `<date>` or `<data>`: no launchd key needs one. */\nexport type PlistValue =\n | string\n | number\n | boolean\n | readonly PlistValue[]\n | { readonly [key: string]: PlistValue };\n\nexport type PlistDict = { readonly [key: string]: PlistValue };\n\nexport class PlistError extends Error {\n constructor(\n readonly path: string,\n detail: string,\n ) {\n super(`plist ${path === '' ? '(root)' : path}: ${detail}`);\n this.name = 'PlistError';\n }\n}\n\nconst HEADER =\n '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n' +\n '<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" ' +\n '\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\\n' +\n '<plist version=\"1.0\">\\n';\n\n/** ⚠️ A cycle, or a runaway generator, would otherwise recurse until the stack dies. */\nconst MAX_DEPTH = 32;\n\n/**\n * ⛔ CHARACTERS XML 1.0 CANNOT CARRY AT ALL — not even escaped (XML 1.0 §2.2 `Char`). C0 controls\n * other than tab, LF and CR; U+FFFE / U+FFFF; and an unpaired surrogate, which has no UTF-8 form.\n */\n// ★ The `u` flag makes a VALID surrogate pair one code point above U+FFFF, outside this class, so\n// only an unpaired half matches the \\uD800-\\uDFFF range.\n// oxlint-disable-next-line no-control-regex -- matching control characters is the point\nconst FORBIDDEN = /[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\uD800-\\uDFFF\\uFFFE\\uFFFF]/u;\n\n/**\n * Escape text content.\n * ⚠️ CR IS A CHARACTER REFERENCE, NOT A LITERAL. An XML parser normalises a literal CR (and CRLF)\n * to LF before the application sees it (XML 1.0 §2.11), so `a\\r\\nb` would come back as `a\\nb` and\n * the argument launchd passes would differ from the one declared. ` ` survives normalisation.\n */\nexport const escapeText = (text: string, path: string): string => {\n const bad = FORBIDDEN.exec(text);\n if (bad !== null) {\n const code = bad[0].codePointAt(0) ?? 0;\n throw new PlistError(\n path,\n `U+${code.toString(16).toUpperCase().padStart(4, '0')} cannot appear in XML 1.0`,\n );\n }\n return text\n .replaceAll('&', '&')\n .replaceAll('<', '<')\n .replaceAll('>', '>')\n .replaceAll('\\r', ' ');\n};\n\nconst isPlainObject = (value: object): boolean => {\n const proto = Object.getPrototypeOf(value) as unknown;\n return proto === Object.prototype || proto === null;\n};\n\nconst renderValue = (value: unknown, path: string, depth: number, out: string[]): void => {\n const pad = '\\t'.repeat(depth);\n if (depth > MAX_DEPTH) throw new PlistError(path, `nested deeper than ${String(MAX_DEPTH)}`);\n if (typeof value === 'string') {\n out.push(`${pad}<string>${escapeText(value, path)}</string>`);\n return;\n }\n if (typeof value === 'boolean') {\n out.push(`${pad}<${value ? 'true' : 'false'}/>`);\n return;\n }\n if (typeof value === 'number') {\n // ⛔ launchd reads every numeric key as an integer; 1.5 would be a silently different job.\n if (!Number.isSafeInteger(value)) {\n throw new PlistError(path, `${String(value)} is not a safe integer (no <real> support)`);\n }\n out.push(`${pad}<integer>${String(value === 0 ? 0 : value)}</integer>`);\n return;\n }\n if (Array.isArray(value)) {\n if (value.length === 0) {\n out.push(`${pad}<array/>`);\n return;\n }\n out.push(`${pad}<array>`);\n for (const [index, item] of (value as readonly unknown[]).entries()) {\n renderValue(item, `${path}[${String(index)}]`, depth + 1, out);\n }\n out.push(`${pad}</array>`);\n return;\n }\n if (typeof value === 'object' && value !== null && isPlainObject(value)) {\n renderDict(value as Record<string, unknown>, path, depth, out);\n return;\n }\n const kind = value === null ? 'null' : typeof value;\n throw new PlistError(path, `${kind} has no plist form — omit the key instead`);\n};\n\nconst renderDict = (\n dict: Record<string, unknown>,\n path: string,\n depth: number,\n out: string[],\n): void => {\n const pad = '\\t'.repeat(depth);\n // ★ Code-unit order, not localeCompare: the same bytes on every machine and every locale.\n const keys = Object.keys(dict).sort();\n if (keys.length === 0) {\n out.push(`${pad}<dict/>`);\n return;\n }\n out.push(`${pad}<dict>`);\n for (const key of keys) {\n const child = path === '' ? key : `${path}.${key}`;\n out.push(`${pad}\\t<key>${escapeText(key, child)}</key>`);\n renderValue(dict[key], child, depth + 1, out);\n }\n out.push(`${pad}</dict>`);\n};\n\n/** Render a top-level dict as a complete XML plist document, ending in a newline. */\nexport const renderPlist = (dict: PlistDict): string => {\n if (typeof dict !== 'object' || dict === null || Array.isArray(dict) || !isPlainObject(dict)) {\n throw new PlistError('', 'the top level of a launchd plist must be a dict');\n }\n const out: string[] = [];\n renderDict(dict as Record<string, unknown>, '', 0, out);\n return `${HEADER}${out.join('\\n')}\\n</plist>\\n`;\n};\n",
|
|
23
23
|
"/**\n * The one form an adapted Caddy config is hashed in — so what `POST /adapt` returns for the\n * declared Caddyfile and what `GET /config/` reports after the load hash the same.\n *\n * ⛔ THE TWO ARE NOT THE SAME BYTES, AND COMPARING BYTES WOULD BE A FOREVER-`update`. Read in\n * caddyserver/caddy v2.11.4:\n * · `/adapt` returns the adapter's `json.Marshal(cfg)` of Go STRUCTS — keys in field order\n * (caddyconfig/caddyfile/adapter.go Adapt; load.go handleAdapt).\n * · `/load` decodes that JSON into a generic `any` and re-marshals it (caddy.go changeConfig):\n * Go sorts MAP keys, so the stored config has every object's keys sorted.\n * · `GET /config/` streams that stored value through `json.Encoder`, which appends a newline\n * (admin.go unsyncedConfigAccess), and escapes `<`, `>` and `&` as `\\u003c`, `\\u003e`, `\\u0026`.\n * Parsing both and re-serialising with sorted keys erases all three differences. MEASURED\n * 2026-09-21 on a throwaway Caddy 2.11.4: the digest of `GET /config/` after `POST /load` equals\n * the digest of `/adapt` for the same Caddyfile — and a Caddy started with `--config <file>`\n * hashes the same as `/adapt` of that file's text, so adopting it is a noop.\n * ★ NUMBERS AGREE BY CONSTRUCTION. Go decodes every JSON number in that generic `any` as float64\n * (caddy.go indexConfigObjects says so), and JSON.parse does too — the same double on both sides\n * serialises the same way here.\n */\nimport { sha256Hex } from '../launchd/job-form.ts';\n\ntype Json = null | boolean | number | string | readonly Json[] | { readonly [key: string]: Json };\n\nconst sorted = (value: Json): Json => {\n if (Array.isArray(value)) return (value as readonly Json[]).map(sorted);\n if (typeof value === 'object' && value !== null) {\n const object = value as { readonly [key: string]: Json };\n const out: Record<string, Json> = {};\n for (const key of Object.keys(object).sort()) out[key] = sorted(object[key] ?? null);\n return out;\n }\n return value;\n};\n\n/** Parse a config body Caddy returned. ⚠️ An empty config is the JSON `null`, not an error. */\nexport const parseConfig = (text: string): unknown => JSON.parse(text) as unknown;\n\n/** The canonical text of a parsed config: sorted keys, no whitespace. */\nexport const canonicalConfig = (config: unknown): string =>\n JSON.stringify(sorted((config ?? null) as Json));\n\n/** SHA-256 of the canonical form — what the resource stores and compares, never the config. */\nexport const configDigest = (config: unknown): string => sha256Hex(canonicalConfig(config));\n",
|
|
24
|
-
"/**\n * CaddyConfig's diff / reconcile — the apply half of the lifecycle config-lifecycle.ts's\n * `desiredConfig`/`readLive`/`probeLive` compute the inputs for. Split out at the 250-line file\n * cap; the two files together are one lifecycle, read config-lifecycle.ts's module doc first.\n */\nimport * as Effect from 'effect/Effect';\nimport * as Result from 'effect/Result';\nimport type * as Diff from 'alchemy/Diff';\nimport type * as Caddy from '@distilled.cloud/caddy';\nimport { CaddyAdminService } from './admin.ts';\nimport { loadCaddyfile, readRunningConfig } from './admin-calls.ts';\nimport { isUnreachable } from './caddy-http-client.ts';\nimport { messageOf, refuse, short, wrapOperation } from './config-errors.ts';\nimport type { CaddyConfigAttributes, CaddyConfigProps } from './config-form.ts';\nimport { claimable, desiredConfig, readLive } from './config-lifecycle.ts';\nimport { configDigest } from './digest.ts';\n\n/**\n * ★ NEVER `replace`. Nothing in the props names a different object: a new Caddyfile is a reload of\n * the same Caddy, and `sourceFile` is a header. (Which Caddy is the transport's business — see\n * the ⚠️ on `endpoint` in the diff.)\n */\nexport const diffConfig = (\n news: CaddyConfigProps,\n output: CaddyConfigAttributes,\n): Effect.Effect<Diff.Diff, Error | Caddy.CaddyOpError, CaddyAdminService | Caddy.CaddyOpContext> =>\n Effect.gen(function* () {\n const { endpoint } = yield* CaddyAdminService;\n const want = yield* desiredConfig(news);\n const live = yield* readLive();\n const converged =\n want.digest === live.configSha256 &&\n live.configSha256 === output.configSha256 &&\n news.sourceFile === output.sourceFile &&\n // ⚠️ A stack whose transport now reaches ANOTHER Caddy (a new address) must load there; the\n // old one keeps what it has — the same as a delete, which never unloads (see config.ts).\n // Planned as an update, but the state does not vouch for that Caddy: see Authority.\n endpoint === output.endpoint;\n return converged ? { action: 'noop' } : { action: 'update' };\n });\n\nexport type Applied = {\n readonly attributes: CaddyConfigAttributes;\n /** The adapter's warnings (e.g. \"Caddyfile input is not formatted\") — log them, never refuse. */\n readonly warnings: readonly string[];\n /** Whether a `POST /load` was sent (false when Caddy already ran this config). */\n readonly loaded: boolean;\n};\n\n/**\n * What this apply may load over — config.ts decides from the state and the adopt setting:\n * · `takeOver` — any running config: the state was applied to THIS Caddy (an update, drift\n * correction, or a create the engine adopted), or adoption is on (`--adopt`, or the\n * resource's own `adopt(true)` — ownership/adopt.ts adoptEnabled).\n * · otherwise only a claimable one — plus, as `stored`, the digest the state last recorded: a\n * Caddy reached at a NEW endpoint that runs exactly that is the same config under another name.\n */\nexport type Authority = { readonly takeOver: boolean; readonly stored?: string };\n\n/**\n * Load the Caddyfile unless Caddy already runs it, then read it back and insist it matches.\n * ⛔ WITHOUT `takeOver`, A CONFIG THE STACK CANNOT CLAIM IS NEVER LOADED OVER. The engine's adoption\n * probe cannot guard every create: it is skipped while `news` holds an Output — ALWAYS on\n * caddyWithFile's first deploy (`sourceFile` is its HostFile's path) — and a Caddy that was down at\n * plan time read as nothing. Nor does state vouch for a Caddy the transport NOW reaches at another\n * endpoint (diff plans that as an update). Refused here, before any `/load`, like HostFile's.\n */\nexport const reconcileConfig = (\n props: CaddyConfigProps,\n authority: Authority,\n): Effect.Effect<Applied, Error | Caddy.CaddyOpError, CaddyAdminService | Caddy.CaddyOpContext> =>\n Effect.gen(function* () {\n const { endpoint } = yield* CaddyAdminService;\n const want = yield* desiredConfig(props);\n const running = yield* readRunningConfig().pipe(wrapOperation(endpoint, 'GET /config/'));\n const before = configDigest(running);\n const known = before === authority.stored || claimable(running, want.digest);\n if (!authority.takeOver && !known) {\n return yield* Effect.fail(\n refuse(\n endpoint,\n `Caddy runs config ${short(before)}, which this stack did not load, and the Caddyfile ` +\n `adapts to ${short(want.digest)} — loading it would replace every site that config ` +\n 'serves. Deploy with --adopt (or wrap the resource in adopt(true)) to take this Caddy ' +\n 'over, or point caddyProviders() at the Caddy you meant.',\n ),\n );\n }\n let warnings = want.warnings;\n const loaded = before !== want.digest;\n if (loaded) {\n const outcome = yield* Effect.result(loadCaddyfile(props.caddyfile, props.sourceFile));\n if (Result.isFailure(outcome)) {\n const error = outcome.failure;\n // ⚠️ Caddy going unreachable MID-load is not a refusal — nothing to \"say what's running\n // now\" about, and re-sending it is unsafe (admin-calls.ts's module doc). Propagated raw,\n // still narrowable, matching every other unreachable path in this file.\n if (isUnreachable(error)) return yield* Effect.fail(error);\n // ★ SAY WHAT IS RUNNING NOW. Caddy restores the previous config on a failed load (caddy.go\n // changeConfig); confirm it rather than promise it, because the deploy log is where the\n // person decides whether sites are down.\n const afterRead = yield* Effect.result(readLive());\n const after = Result.isSuccess(afterRead) ? afterRead.success : undefined;\n const state =\n after === undefined\n ? 'and the running config could not be read back'\n : after.configSha256 === before\n ? 'Caddy kept the previous config (still serving)'\n : `and the running config is now ${short(after.configSha256)}, not the previous ${short(before)}`;\n // ⚠️ SAY SO WHEN THE STATUS LIED, or a bare \"refused\" reads like a normal 4xx/5xx.\n // `LoadRefused` IS the 200-embedded-error trap (admin-calls.ts's module doc): Caddy\n // answered 200, and the failure was only in the body.\n const reason =\n error._tag === 'LoadRefused'\n ? `${error.message} (LoadRefused: a 200 whose body carried the error, not a failure status)`\n : messageOf(error);\n return yield* Effect.fail(\n refuse(endpoint, `Caddy refused the Caddyfile — ${reason}; ${state}`),\n );\n }\n warnings = outcome.success;\n }\n // ⚠️ READ BACK, never echo the declaration: a concurrent writer, or a load Caddy answered 200 but\n // did not apply (admin-calls.ts), shows up here as a refusal instead of as stored state that is\n // already wrong.\n const attributes = yield* readLive(props.sourceFile);\n if (attributes.configSha256 !== want.digest) {\n return yield* Effect.fail(\n refuse(\n endpoint,\n `after the load Caddy runs config ${short(attributes.configSha256)}, not the ` +\n `${short(want.digest)} this Caddyfile adapts to — another writer changed it, or it was ` +\n 'not applied',\n ),\n );\n }\n return { attributes, loaded, warnings };\n });\n",
|
|
24
|
+
"/**\n * CaddyConfig's diff / reconcile — the apply half of the lifecycle config-lifecycle.ts's\n * `desiredConfig`/`readLive`/`probeLive` compute the inputs for. Split out at the 250-line file\n * cap; the two files together are one lifecycle, read config-lifecycle.ts's module doc first.\n */\nimport * as Effect from 'effect/Effect';\nimport * as Result from 'effect/Result';\nimport type * as Diff from 'alchemy/Diff';\nimport type * as Caddy from '@distilled.cloud/caddy';\nimport { CaddyAdminService } from './admin.ts';\nimport { loadCaddyfile, readRunningConfig } from './admin-calls.ts';\nimport { isUnreachable } from './caddy-http-client.ts';\nimport { messageOf, refuse, short, wrapOperation } from './config-errors.ts';\nimport type { CaddyConfigAttributes, CaddyConfigProps } from './config-form.ts';\nimport { claimable, desiredConfig, readLive } from './config-lifecycle.ts';\nimport { configDigest } from './digest.ts';\nimport { formattingFixLine, splitFormattingWarning } from './format-warnings.ts';\n\n/**\n * ★ NEVER `replace`. Nothing in the props names a different object: a new Caddyfile is a reload of\n * the same Caddy, and `sourceFile` is a header. (Which Caddy is the transport's business — see\n * the ⚠️ on `endpoint` in the diff.)\n */\nexport const diffConfig = (\n news: CaddyConfigProps,\n output: CaddyConfigAttributes,\n): Effect.Effect<Diff.Diff, Error | Caddy.CaddyOpError, CaddyAdminService | Caddy.CaddyOpContext> =>\n Effect.gen(function* () {\n const { endpoint } = yield* CaddyAdminService;\n const want = yield* desiredConfig(news);\n // ★ SURFACED AT PLAN TIME, NOT JUST DEPLOY TIME. `want.warnings` otherwise goes nowhere here —\n // only the formatting warning gets its own clear line; the rest keep logging at reconcile\n // (config.ts), same as before this change.\n const { formatting } = splitFormattingWarning(want.warnings);\n if (formatting.length > 0) yield* Effect.logWarning(formattingFixLine(endpoint));\n const live = yield* readLive();\n const converged =\n want.digest === live.configSha256 &&\n live.configSha256 === output.configSha256 &&\n news.sourceFile === output.sourceFile &&\n // ⚠️ A stack whose transport now reaches ANOTHER Caddy (a new address) must load there; the\n // old one keeps what it has — the same as a delete, which never unloads (see config.ts).\n // Planned as an update, but the state does not vouch for that Caddy: see Authority.\n endpoint === output.endpoint;\n return converged ? { action: 'noop' } : { action: 'update' };\n });\n\nexport type Applied = {\n readonly attributes: CaddyConfigAttributes;\n /** The adapter's warnings (e.g. \"Caddyfile input is not formatted\") — log them, never refuse. */\n readonly warnings: readonly string[];\n /** Whether a `POST /load` was sent (false when Caddy already ran this config). */\n readonly loaded: boolean;\n};\n\n/**\n * What this apply may load over — config.ts decides from the state and the adopt setting:\n * · `takeOver` — any running config: the state was applied to THIS Caddy (an update, drift\n * correction, or a create the engine adopted), or adoption is on (`--adopt`, or the\n * resource's own `adopt(true)` — ownership/adopt.ts adoptEnabled).\n * · otherwise only a claimable one — plus, as `stored`, the digest the state last recorded: a\n * Caddy reached at a NEW endpoint that runs exactly that is the same config under another name.\n */\nexport type Authority = { readonly takeOver: boolean; readonly stored?: string };\n\n/**\n * Load the Caddyfile unless Caddy already runs it, then read it back and insist it matches.\n * ⛔ WITHOUT `takeOver`, A CONFIG THE STACK CANNOT CLAIM IS NEVER LOADED OVER. The engine's adoption\n * probe cannot guard every create: it is skipped while `news` holds an Output — ALWAYS on\n * caddyWithFile's first deploy (`sourceFile` is its HostFile's path) — and a Caddy that was down at\n * plan time read as nothing. Nor does state vouch for a Caddy the transport NOW reaches at another\n * endpoint (diff plans that as an update). Refused here, before any `/load`, like HostFile's.\n */\nexport const reconcileConfig = (\n props: CaddyConfigProps,\n authority: Authority,\n): Effect.Effect<Applied, Error | Caddy.CaddyOpError, CaddyAdminService | Caddy.CaddyOpContext> =>\n Effect.gen(function* () {\n const { endpoint } = yield* CaddyAdminService;\n const want = yield* desiredConfig(props);\n const running = yield* readRunningConfig().pipe(wrapOperation(endpoint, 'GET /config/'));\n const before = configDigest(running);\n const known = before === authority.stored || claimable(running, want.digest);\n if (!authority.takeOver && !known) {\n return yield* Effect.fail(\n refuse(\n endpoint,\n `Caddy runs config ${short(before)}, which this stack did not load, and the Caddyfile ` +\n `adapts to ${short(want.digest)} — loading it would replace every site that config ` +\n 'serves. Deploy with --adopt (or wrap the resource in adopt(true)) to take this Caddy ' +\n 'over, or point caddyProviders() at the Caddy you meant.',\n ),\n );\n }\n let warnings = want.warnings;\n const loaded = before !== want.digest;\n if (loaded) {\n const outcome = yield* Effect.result(loadCaddyfile(props.caddyfile, props.sourceFile));\n if (Result.isFailure(outcome)) {\n const error = outcome.failure;\n // ⚠️ Caddy going unreachable MID-load is not a refusal — nothing to \"say what's running\n // now\" about, and re-sending it is unsafe (admin-calls.ts's module doc). Propagated raw,\n // still narrowable, matching every other unreachable path in this file.\n if (isUnreachable(error)) return yield* Effect.fail(error);\n // ★ SAY WHAT IS RUNNING NOW. Caddy restores the previous config on a failed load (caddy.go\n // changeConfig); confirm it rather than promise it, because the deploy log is where the\n // person decides whether sites are down.\n const afterRead = yield* Effect.result(readLive());\n const after = Result.isSuccess(afterRead) ? afterRead.success : undefined;\n const state =\n after === undefined\n ? 'and the running config could not be read back'\n : after.configSha256 === before\n ? 'Caddy kept the previous config (still serving)'\n : `and the running config is now ${short(after.configSha256)}, not the previous ${short(before)}`;\n // ⚠️ SAY SO WHEN THE STATUS LIED, or a bare \"refused\" reads like a normal 4xx/5xx.\n // `LoadRefused` IS the 200-embedded-error trap (admin-calls.ts's module doc): Caddy\n // answered 200, and the failure was only in the body.\n const reason =\n error._tag === 'LoadRefused'\n ? `${error.message} (LoadRefused: a 200 whose body carried the error, not a failure status)`\n : messageOf(error);\n return yield* Effect.fail(\n refuse(endpoint, `Caddy refused the Caddyfile — ${reason}; ${state}`),\n );\n }\n warnings = outcome.success;\n }\n // ⚠️ READ BACK, never echo the declaration: a concurrent writer, or a load Caddy answered 200 but\n // did not apply (admin-calls.ts), shows up here as a refusal instead of as stored state that is\n // already wrong.\n const attributes = yield* readLive(props.sourceFile);\n if (attributes.configSha256 !== want.digest) {\n return yield* Effect.fail(\n refuse(\n endpoint,\n `after the load Caddy runs config ${short(attributes.configSha256)}, not the ` +\n `${short(want.digest)} this Caddyfile adapts to — another writer changed it, or it was ` +\n 'not applied',\n ),\n );\n }\n return { attributes, loaded, warnings };\n });\n",
|
|
25
|
+
"/**\n * Pulls Caddy's adapter \"Caddyfile input is not formatted\" warning(s) out of a warnings list, so\n * config.ts's reconcile (deploy) and config-reconcile.ts's diffConfig (plan) can show it as one\n * clear, actionable line instead of burying it among the rest.\n *\n * ★ THIS IS THE COMMON CASE, NOT AN EDGE ONE. admin-calls.ts's module doc: the Caddyfile adapter\n * warns on EVERY unformatted input (adapter.go FormattingDifference) — every declared Caddyfile\n * that was not run through `caddy fmt` (or format.ts's formatCaddyfile()) carries this warning\n * on every plan and every deploy, indistinguishable from the rest unless split out.\n */\n\n/** The exact adapter message (caddyserver/caddy v2.11.4, adapter.go FormattingDifference). */\nconst NOT_FORMATTED = 'Caddyfile input is not formatted';\n\nexport type SplitWarnings = {\n /**\n * Every warning THAT IS the formatting one — usually one, but an `import`ed file can add\n * another with its own file:line, and this keeps every one of them (never just the first): a\n * `.find()` here would silently drop the rest, not merely leave them uncounted.\n */\n readonly formatting: readonly string[];\n /** Every other warning, in order, formatting removed. */\n readonly rest: readonly string[];\n};\n\n/** Separates the formatting warning(s) (by substring, matching admin-calls.ts's `describe()`). */\nexport const splitFormattingWarning = (warnings: readonly string[]): SplitWarnings => ({\n formatting: warnings.filter((warning) => warning.includes(NOT_FORMATTED)),\n rest: warnings.filter((warning) => !warning.includes(NOT_FORMATTED)),\n});\n\n/**\n * One clear line naming the fix — never just the adapter's own warning text, and never repeated\n * per formatting warning: however many `formatting` holds, this is logged once (config.ts,\n * config-reconcile.ts), since restating the same fix N times is its own noise.\n */\nexport const formattingFixLine = (endpoint: string): string =>\n `Caddy.Config at ${endpoint}: Caddyfile is not formatted — run \\`caddy fmt\\` on it, or format ` +\n \"it with this package's formatCaddyfile() before declaring it, to silence this warning.\";\n",
|
|
26
|
+
"/**\n * `formatCaddyfile(text)` — pipes a Caddyfile through the LOCAL `caddy fmt -` binary (stdin in,\n * formatted text out), the same formatter the `caddy fmt` CLI command runs\n * (caddyconfig/caddyfile Format in caddyserver/caddy).\n *\n * ⛔ THERE IS NO ADMIN API FOR THIS. `caddy fmt` is a CLI-only feature (cmd/commandfuncs.go); no\n * `/adapt`, `/load` or other admin endpoint formats a Caddyfile, so this never belongs in\n * `@distilled.cloud/caddy` — measured 2026-09-24. It shells out instead, the same pattern\n * talos/talosctl.ts uses for a vendor CLI Alchemy does not wrap.\n * ⛔ NEVER REIMPLEMENTED IN TS. The Caddyfile grammar's formatting rules live in the Go adapter;\n * a hand-rolled formatter would drift from it silently. This module only ever runs the real\n * binary.\n * ⛔ A MISSING OR FAILING BINARY FAILS THE EFFECT — IT NEVER RETURNS THE INPUT UNCHANGED.\n * `CaddyFmtNotFound` and `CaddyFmtFailed` are typed, catchTag-able failures (S21); there is no\n * fallback path that silently skips formatting.\n * ★ WHY THIS MATTERS: admin-calls.ts's module doc — Caddy's adapter warns \"Caddyfile input is not\n * formatted\" on EVERY unformatted input (adapter.go FormattingDifference), which shares the\n * `/load` response body with the refused-but-200 trap. format-warnings.ts surfaces that warning\n * distinctly in plan/deploy output; this function is how a caller silences it — by formatting\n * the Caddyfile before declaring it, not by ignoring the warning.\n */\nimport * as Effect from 'effect/Effect';\nimport * as Stream from 'effect/Stream';\nimport * as ChildProcess from 'effect/unstable/process/ChildProcess';\nimport * as ChildProcessSpawner from 'effect/unstable/process/ChildProcessSpawner';\nimport type * as PlatformError from 'effect/PlatformError';\n\n/** `caddy` resolved on `PATH`, unless the caller points at a specific build. */\nexport const DEFAULT_CADDY_BINARY = 'caddy';\n\n/** The configured binary is not on `PATH` (or not executable) — install Caddy, or fix the path. */\nexport class CaddyFmtNotFound extends Error {\n readonly _tag = 'CaddyFmtNotFound';\n constructor(\n readonly binaryPath: string,\n cause: PlatformError.PlatformError,\n ) {\n super(\n `formatCaddyfile: \"${binaryPath}\" was not found (${cause.message}). Install Caddy so it is ` +\n 'on PATH, or pass { binaryPath } naming the exact build the target Caddy runs.',\n );\n this.name = 'CaddyFmtNotFound';\n }\n}\n\n/** The binary ran but exited non-zero — a syntax error in `text`, most likely. */\nexport class CaddyFmtFailed extends Error {\n readonly _tag = 'CaddyFmtFailed';\n constructor(\n readonly binaryPath: string,\n readonly exitCode: number,\n stderr: string,\n ) {\n super(\n `formatCaddyfile: \"${binaryPath} fmt -\" exited ${String(exitCode)}: ${stderr.slice(0, 300)}`,\n );\n this.name = 'CaddyFmtFailed';\n }\n}\n\nexport type FormatCaddyfileOptions = {\n /** The `caddy` binary to run `fmt -` against. @default DEFAULT_CADDY_BINARY, resolved on PATH. */\n readonly binaryPath?: string;\n};\n\n/**\n * Format a Caddyfile the way `caddy fmt` would, by actually running it — never a TS\n * reimplementation. Requires `ChildProcessSpawner` (S19: no `node:child_process`, no\n * `async`/`await`); provide `@effect/platform-node`'s or `@effect/platform-bun`'s layer.\n */\nexport const formatCaddyfile = (\n text: string,\n options: FormatCaddyfileOptions = {},\n): Effect.Effect<\n string,\n // ⚠️ A raw PlatformError still escapes for anything that is not \"missing binary\" (a permission\n // problem, a process the OS killed mid-run) — narrower than that would misname what happened.\n CaddyFmtNotFound | CaddyFmtFailed | PlatformError.PlatformError,\n ChildProcessSpawner.ChildProcessSpawner\n> =>\n Effect.gen(function* () {\n const binaryPath = options.binaryPath ?? DEFAULT_CADDY_BINARY;\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const input = new TextEncoder().encode(text);\n const result = yield* ChildProcess.make(binaryPath, ['fmt', '-'], {\n detached: false,\n stderr: 'pipe',\n stdin: Stream.make(input),\n stdout: 'pipe',\n }).pipe(\n spawner.spawn,\n Effect.flatMap((child) =>\n Effect.all(\n {\n exitCode: child.exitCode,\n stderr: child.stderr.pipe(\n Stream.decodeText,\n Stream.mkString,\n Effect.map((out) => out.trim()),\n ),\n stdout: child.stdout.pipe(Stream.decodeText, Stream.mkString),\n },\n { concurrency: 'unbounded' },\n ),\n ),\n Effect.scoped,\n // ⛔ ENOENT (the binary is missing) becomes the typed, named failure above — every other\n // PlatformError (a permission problem, a killed process) propagates as-is, still typed.\n Effect.catchTag(\n 'PlatformError',\n (error): Effect.Effect<never, CaddyFmtNotFound | PlatformError.PlatformError> =>\n error.reason._tag === 'NotFound'\n ? Effect.fail(new CaddyFmtNotFound(binaryPath, error))\n : Effect.fail(error),\n ),\n );\n if (result.exitCode !== 0) {\n return yield* Effect.fail(new CaddyFmtFailed(binaryPath, result.exitCode, result.stderr));\n }\n return result.stdout;\n });\n",
|
|
25
27
|
"/**\n * The real Caddy transport: this machine's Caddy, over loopback TCP or a unix socket — the\n * `Credentials` and `HttpClient.HttpClient` layers `@distilled.cloud/caddy`'s typed operations run\n * against (admin-calls.ts), plus the message/guard metadata `CaddyAdminService` carries.\n *\n * Address parsing (`parseAdminAddress`) is pure — admin-address.ts. The wire transport itself\n * (retries, timeouts, the unix-socket dial) is caddy-http-client.ts; this file is the seam between\n * the two and `@distilled.cloud/caddy`'s own `Credentials`.\n */\nimport * as Layer from 'effect/Layer';\nimport * as Caddy from '@distilled.cloud/caddy';\nimport type { CaddyTransport } from './admin.ts';\nimport { DEFAULT_ADMIN_ADDRESS, parseAdminAddress } from './admin-address.ts';\nimport { type LocalHttpClientOptions, makeLocalHttpClient } from './caddy-http-client.ts';\n\nexport { DEFAULT_ADMIN_ADDRESS, parseAdminAddress } from './admin-address.ts';\nexport { isUnreachable } from './caddy-http-client.ts';\n\nexport type LocalCaddyAdminOptions = LocalHttpClientOptions & {\n /**\n * `http://<loopback>:<port>` or `unix:///absolute/path.sock`.\n * @default 'http://127.0.0.1:2019' — Caddy's default admin listener (`localhost:2019`).\n */\n readonly address?: string;\n /**\n * The Host (and, over TCP, Origin) to send when it is not the address's own: the Caddyfile\n * narrowed `admin { origins … }`, or the port is an SSH forward of the real one (Caddy checks\n * the Host against ITS port, not yours). Form `host:port`. Over a unix socket this still sets\n * the Host header `@distilled.cloud/caddy`'s protocol always sends (Caddy skips the Host check\n * on unix listeners regardless — admin.go allowedOrigins) — defaults to `127.0.0.1`, matching\n * the Caddy CLI's own unix-socket calls (cmd/commandfuncs.go AdminAPIRequest).\n */\n readonly hostHeader?: string;\n};\n\n/**\n * A transport to this machine's Caddy — feed it to `caddyProviders()`, or build the layer by hand\n * with `CaddyConfigProvider().pipe(Layer.provideMerge(caddyAdminLayer(localCaddyAdmin())))` (never\n * plain `Layer.provide` — admin.ts's own doc on `caddyAdminLayer` says why).\n *\n * ⛔ LOOPBACK OR A UNIX SOCKET, NOTHING ELSE. The admin API is unauthenticated plaintext; an\n * address off this machine means it is reachable from the network, which decision 23 forbids.\n * `parseAdminAddress` refuses anything else.\n */\nexport const localCaddyAdmin = (options: LocalCaddyAdminOptions = {}): CaddyTransport => {\n const address = options.address ?? DEFAULT_ADMIN_ADDRESS;\n const { listener, target } = parseAdminAddress(address, options.hostHeader);\n // `@distilled.cloud/caddy`'s protocol always builds `Host`/Origin from `apiBaseUrl` (or this\n // override) — never from the dial target, which caddy-http-client.ts ignores the URL's host/port\n // for anyway over a unix socket. `http://localhost` is a placeholder base for the request-URL\n // machinery (`buildRequest` needs a syntactically valid `http://` URL to join `/config/…` onto);\n // the hostHeader default `127.0.0.1` is what actually reaches Caddy's Host check, matching what\n // the Caddy CLI sends over a unix socket.\n const credentials =\n target.kind === 'unix'\n ? Caddy.fromApiBaseUrl({\n apiBaseUrl: 'http://localhost',\n hostHeader: options.hostHeader ?? '127.0.0.1',\n })\n : Caddy.fromApiBaseUrl({\n apiBaseUrl: address,\n ...(options.hostHeader === undefined ? {} : { hostHeader: options.hostHeader }),\n });\n return {\n endpoint: address,\n // ⚠️ `Caddy.Retry.Retry` DISABLED, not left at the SDK's default. MEASURED 2026-09-23: core's\n // `isTransientError` treats ANY `HttpClientError` with a `TransportError` reason as transient\n // — including an ECONNRESET well after the connection was accepted — and every generated\n // operation already retries under that default (`API.make({ retry: Retry.Retry })`,\n // services/admin.ts). Left in place, it retried a `POST /load` that had already reached the\n // far side (a socket that accepted, then reset) — the exact re-send admin-calls.ts's module\n // doc says must never happen — NINE times over, compounding with caddy-http-client.ts's own\n // narrower retry below it. This transport's retry (ECONNREFUSED/ENOENT only — \"nothing\n // accepted the connection yet\") is the one retry policy Caddy's admin API gets.\n layer: Layer.mergeAll(\n credentials,\n makeLocalHttpClient(target, options),\n Layer.succeed(Caddy.Retry.Retry, { while: () => false }),\n ),\n listener,\n };\n};\n",
|
|
26
28
|
"/**\n * Parses a `localCaddyAdmin()` address into a dial target and the listener Caddy checks requests\n * against — pure, so admin-guard.ts and local-admin.ts's tests exercise it with no transport at all.\n *\n * ★ LOOPBACK OR A UNIX SOCKET, NOTHING ELSE. The admin API is unauthenticated plaintext; an address\n * off this machine means it is reachable from the network, which decision 23 forbids. Reaching\n * another host's Caddy means forwarding its socket or port to here (SSH), never exposing :2019.\n * ★ HOST, AS CADDY's OWN CLI SENDS IT (cmd/commandfuncs.go AdminAPIRequest): `host:port`, over TCP.\n * MEASURED against a Mac host's Caddy 2.11.4: any other Host gets 403 `host not allowed`, a\n * forwarded port included — hence `hostHeader`.\n */\nimport type { CaddyAdminListener } from './admin.ts';\n\nexport type Target =\n | { readonly kind: 'tcp'; readonly host: string; readonly port: number }\n | { readonly kind: 'unix'; readonly socketPath: string };\n\nexport const DEFAULT_ADMIN_ADDRESS = 'http://127.0.0.1:2019';\n\nconst UNIX = 'unix://';\nconst HOST_PORT = /^(?:[A-Za-z0-9.-]+|\\[[0-9A-Fa-f:.]+\\]):\\d{1,5}$/;\n\nconst refuse = (address: string, why: string): Error =>\n new Error(`Caddy admin address ${JSON.stringify(address)}: ${why}`);\n\nconst isLoopback = (hostname: string): boolean =>\n hostname === 'localhost' || hostname === '[::1]' || /^127(?:\\.\\d{1,3}){3}$/.test(hostname);\n\n/** The dial target and listener for an address, or a refusal naming what is wrong with it. */\nexport const parseAdminAddress = (\n address: string,\n hostHeader?: string,\n): { target: Target; listener: CaddyAdminListener } => {\n if (hostHeader !== undefined && !HOST_PORT.test(hostHeader)) {\n throw refuse(address, `hostHeader ${JSON.stringify(hostHeader)} must be host:port`);\n }\n if (address.startsWith(UNIX)) {\n const socketPath = address.slice(UNIX.length);\n if (!socketPath.startsWith('/')) throw refuse(address, 'the socket path must be absolute');\n return { listener: { kind: 'unix', path: socketPath }, target: { kind: 'unix', socketPath } };\n }\n let url: URL;\n try {\n url = new URL(address);\n } catch {\n throw refuse(address, 'not a URL (http://127.0.0.1:2019 or unix:///path)');\n }\n // ⛔ Caddy's local admin endpoint is plaintext by design; its TLS one (`admin.remote`, mTLS on\n // :2021) is a different, network-facing API this transport deliberately does not speak.\n if (url.protocol !== 'http:') throw refuse(address, 'only http:// (loopback) or unix://');\n if (!isLoopback(url.hostname)) {\n throw refuse(address, 'not loopback — the admin API is unauthenticated; forward it to here');\n }\n if (url.pathname !== '/' || url.search !== '' || url.username !== '') {\n throw refuse(address, 'no path, query or credentials — the API lives at the root');\n }\n const port = url.port === '' ? 80 : Number(url.port);\n // ⚠️ NOT `url.host`: WHATWG URL drops a default port (`http://127.0.0.1:80` has host\n // `127.0.0.1`), and Caddy compares the Host against `host:port` (admin.go allowedOrigins), so\n // a portless Host is a 403 on every call. The Caddy CLI always sends the port (JoinHostPort).\n const host = hostHeader ?? `${url.hostname}:${String(port)}`;\n return {\n listener: {\n hostHeader: host,\n kind: 'tcp',\n port: Number(host.slice(host.lastIndexOf(':') + 1)),\n },\n // ★ `hostname` keeps IPv6 brackets; node:http wants them off.\n target: { host: url.hostname.replace(/^\\[(.*)\\]$/, '$1'), kind: 'tcp', port },\n };\n};\n",
|
|
27
29
|
"/**\n * The Caddy provider with its admin transport, as a single layer for a host stack.\n *\n * Layer.mergeAll(caddyProviders(), launchdProviders(), …the stack's other providers)\n *\n * ★ launchdProviders() TOO when the stack uses caddyWithFile(): the file is a launchd-subpath\n * HostFile, written through that subpath's HostRunner.\n * ⚠️ The default is localCaddyAdmin(): `http://127.0.0.1:2019`, Caddy's default admin listener.\n * Pass another CaddyTransport for a unix socket, a narrowed `admin { origins }`, or an SSH\n * forward — `localCaddyAdmin({ address, hostHeader })` builds one; a consumer can provide any\n * other `{ endpoint, listener, layer }` reaching `@distilled.cloud/caddy`'s own `Credentials`\n * and `HttpClient.HttpClient`.\n *\n * ⚠️ `Layer.provideMerge`, NEVER PLAIN `Layer.provide`, for `caddyAdminLayer`. `CaddyConfigProvider()`'s\n * `read`/`diff`/`reconcile` handlers each still need `CaddyAdminService` and\n * `@distilled.cloud/caddy`'s `Credentials`/`HttpClient` — Alchemy's own `Provider.effect` types\n * those as part of the LAYER's overall requirement (`ProviderService`'s per-handler `Req` type\n * parameters, `alchemy/Provider.ts`), for exactly this reason. Plain `Layer.provide` SEALS a\n * layer — it satisfies `CaddyConfigProvider()`'s requirement only for BUILDING the `Provider`\n * value (the `admin` in its outer `Effect.gen`), then hides those services from anything that\n * runs LATER, when the returned `read`/`diff`/`reconcile` FUNCTIONS actually execute. MEASURED\n * 2026-09-23: with plain `Layer.provide`, `caddyProviders()`'s own `reconcile` handler dies with\n * \"Service not found: homeflare/caddy/CaddyAdmin\" the moment the ENGINE calls it. `provideMerge`\n * feeds `caddyAdminLayer`'s output into `CaddyConfigProvider()`'s requirement AND keeps that same\n * output live in the result, so every later handler call still runs with it in context.\n */\nimport * as Layer from 'effect/Layer';\nimport { type CaddyTransport, caddyAdminLayer } from './admin.ts';\nimport { CaddyConfigProvider } from './config.ts';\nimport { localCaddyAdmin } from './local-admin.ts';\n\nexport const caddyProviders = (transport: CaddyTransport = localCaddyAdmin()) =>\n CaddyConfigProvider().pipe(Layer.provideMerge(caddyAdminLayer(transport)));\n",
|
|
@@ -33,7 +35,7 @@
|
|
|
33
35
|
"/**\n * HostFile's props, attributes and validation — the pure half of the provider.\n *\n * ⛔ `content` IS NEVER A SECRET. Alchemy stores props unencrypted, so the content of every HostFile\n * sits in the state store and in every plan diff. A secret file stays RENDERED BY A SECRET\n * RENDERER (openbao-agent templates, on this estate) that fetches it at run time; the stack\n * declares only non-secret config, and at most the PATH the renderer writes to.\n * secret-tripwire.ts refuses the obvious case (a PEM private key); nothing can catch all of them.\n */\nimport { fileSecretProblems } from './secret-tripwire.ts';\n\nexport interface HostFileProps {\n /** Absolute path. The parent directory must already exist. */\n path: string;\n /** UTF-8 text. ⛔ Never a secret — see the file header. */\n content: string;\n /** Permission bits. @default 0o644 */\n mode?: number;\n /** User name or numeric uid. Omitted: whoever the runner writes as (a rewrite keeps no owner). */\n owner?: string | number;\n /** Group name or numeric gid. Omitted: the directory's default group. */\n group?: string | number;\n}\n\nexport interface HostFileAttributes {\n path: string;\n /** SHA-256 of the bytes on disk. */\n sha256: string;\n mode: number;\n uid: number;\n gid: number;\n size: number;\n}\n\nexport const DEFAULT_MODE = 0o644;\n\n/** A user or group as declared: a non-negative id, or a name the host could have. */\nexport const identityProblems = (name: string, value: string | number | undefined): string[] => {\n if (value === undefined) return [];\n if (typeof value === 'number') {\n return Number.isSafeInteger(value) && value >= 0\n ? []\n : [`${name} must be a non-negative integer id`];\n }\n return /^[A-Za-z_][A-Za-z0-9_.-]*$/.test(value) || /^\\d+$/.test(value)\n ? []\n : [`${name} ${JSON.stringify(value)} is not a valid user or group name`];\n};\n\n/**\n * An absolute, normalised path, or the reasons it is not. ★ Shared with sudo-allowlist.ts, so a\n * path the sudo runner may touch as root obeys exactly the rule a declared file does.\n */\nexport const pathProblems = (path: string): string[] => {\n const found: string[] = [];\n if (!path.startsWith('/')) found.push('path must be absolute');\n // ★ One spelling per file: `a/./b`, `a//b` and `a/../b` would each be a second resource for the\n // same inode, and `..` is how a derived path walks out of the directory it was meant for.\n if (\n path.endsWith('/') ||\n path\n .split('/')\n .slice(1)\n .some((part) => part === '' || part === '.' || part === '..')\n ) {\n found.push('path must be normalised (no trailing slash, no empty, \".\" or \"..\" segments)');\n }\n if (path.includes('\\x00')) found.push('path contains NUL');\n return found;\n};\n\nexport const fileProblems = (props: HostFileProps): string[] => {\n const found = pathProblems(props.path);\n const mode = props.mode ?? DEFAULT_MODE;\n if (!Number.isSafeInteger(mode) || mode < 0 || mode > 0o7777) found.push('mode must be 0–0o7777');\n found.push(...identityProblems('owner', props.owner));\n found.push(...identityProblems('group', props.group));\n found.push(...fileSecretProblems(props.content));\n return found;\n};\n",
|
|
34
36
|
"/**\n * HostFile's read / diff / reconcile / delete as plain async functions over a HostRunner, so the\n * lifecycle runs against fake-runner.ts in tests.\n *\n * ★ THE CONVERGENCE ITSELF IS file-converge.ts, shared with every resource that owns one whole file\n * (Release.Binary is the second). What stays here is what makes a HOST FILE: text content, its\n * validation (never a secret — host-file-form.ts), and the refusal wording `Host.File <path>: …`.\n * ⛔ SYMLINKS AND DIRECTORIES ARE REFUSED, NOT REPLACED — see file-converge.ts for why.\n */\nimport type { Diff } from 'alchemy/Diff';\nimport {\n type FileTarget,\n convergeFile,\n diffTarget,\n removeWholeFile,\n resolveIds,\n} from './file-converge.ts';\nimport {\n DEFAULT_MODE,\n type HostFileAttributes,\n type HostFileProps,\n fileProblems,\n} from './host-file-form.ts';\nimport { sha256Hex } from './job-form.ts';\nimport type { HostRunner } from './runner.ts';\n\nexport { readFileAttributes } from './file-converge.ts';\n\ntype Desired = FileTarget & { readonly bytes: Uint8Array };\n\nconst refuse = (path: string, message: string): Error => new Error(`Host.File ${path}: ${message}`);\n\n/** Validate, then resolve owner/group names to ids through the runner. */\nexport const desiredFile = async (runner: HostRunner, props: HostFileProps): Promise<Desired> => {\n const found = fileProblems(props);\n if (found.length > 0) throw refuse(props.path, found.join('; '));\n const bytes = new TextEncoder().encode(props.content);\n return {\n bytes,\n mode: props.mode ?? DEFAULT_MODE,\n path: props.path,\n sha256: sha256Hex(bytes),\n ...(await resolveIds(runner, props, props.path, refuse)),\n };\n};\n\n/** Declared digest, mode and owner against state and the live file — see diffTarget. */\nexport const diffFile = async (\n runner: HostRunner,\n news: HostFileProps,\n output: HostFileAttributes,\n): Promise<Diff> => diffTarget(runner, await desiredFile(runner, news), output);\n\n/**\n * Write the declared text, unless the file already matches. `adopt` is adoptsAtApply's answer;\n * what it may and may not take over is convergeFile's ⛔.\n */\nexport const reconcileFile = async (\n runner: HostRunner,\n props: HostFileProps,\n output?: HostFileAttributes,\n adopt = false,\n): Promise<HostFileAttributes> => {\n const want = await desiredFile(runner, props);\n const spec = { bytesFor: async () => want.bytes, owner: props.owner, refuse, want };\n return convergeFile(runner, spec, output, adopt);\n};\n\n/** Remove the file. Idempotent. ⛔ Refuses a path that has since become a symlink or directory. */\nexport const deleteFile = (runner: HostRunner, output: HostFileAttributes): Promise<void> =>\n removeWholeFile(runner, output, refuse);\n"
|
|
35
37
|
],
|
|
36
|
-
"mappings": ";AAoBA,IAAM,uBAAuB,CAAC,kBAAkB,cAAc;AA6B9D,IAAM,WAAW,IAAI,IAAI,CAAC,aAAa,aAAa,OAAO,OAAO,CAAC;AAQnE,IAAM,SAAS,CAAC,aAA6B;AAAA,EAC3C,MAAM,UAAU,SAAS,QAAQ,gBAAgB,EAAE;AAAA,EACnD,IAAI,QAAQ,WAAW,OAAO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F,OAAO,EAAE,QAAQ,KAAK;AAAA,CACvB;",
|
|
39
|
+
"debugId": "CC0C3E3E18BF8F0664756E2164756E21",
|
|
38
40
|
"names": []
|
|
39
41
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Resource } from 'alchemy';
|
|
2
|
+
import * as Provider from 'alchemy/Provider';
|
|
3
|
+
import * as command from '@distilled.cloud/discord/discord';
|
|
4
|
+
import type { DiscordOpError } from '@distilled.cloud/discord/Protocol';
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import { type CommandFields, type CommandFieldsAttributes } from './command-form.ts';
|
|
7
|
+
import type { DiscordRequirements, DiscordSpec } from './resource.ts';
|
|
8
|
+
export interface ApplicationCommandProps extends CommandFields {
|
|
9
|
+
/** The Discord application (bot) this command belongs to — a public snowflake, not a secret. */
|
|
10
|
+
applicationId: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ApplicationCommandAttributes extends CommandFieldsAttributes {
|
|
13
|
+
commandId: string;
|
|
14
|
+
applicationId: string;
|
|
15
|
+
version: string;
|
|
16
|
+
}
|
|
17
|
+
export interface DiscordApplicationCommand extends Resource<'Discord.ApplicationCommand', ApplicationCommandProps, ApplicationCommandAttributes, never, DiscordRequirements> {
|
|
18
|
+
}
|
|
19
|
+
export declare const DiscordApplicationCommand: import("alchemy").ResourceClass<DiscordApplicationCommand>;
|
|
20
|
+
export declare const isDiscordApplicationCommand: (value: unknown) => value is DiscordApplicationCommand;
|
|
21
|
+
/** Exported for direct testing against `fake-discord.ts` — the same seam `../netbox/prefix.ts` uses. */
|
|
22
|
+
export declare const spec: DiscordSpec<ApplicationCommandProps, command.ApplicationCommandResponse, ApplicationCommandAttributes, DiscordOpError>;
|
|
23
|
+
export declare const handlers: {
|
|
24
|
+
list: () => Effect.Effect<never[], never, never>;
|
|
25
|
+
read: ({ olds, output }: {
|
|
26
|
+
olds: ApplicationCommandProps;
|
|
27
|
+
output: ApplicationCommandAttributes | undefined;
|
|
28
|
+
}) => Effect.Effect<ApplicationCommandAttributes | undefined, DiscordOpError, import("effect/unstable/http/HttpClient").HttpClient>;
|
|
29
|
+
diff: ({ news, output }: {
|
|
30
|
+
news: import("alchemy").Input<ApplicationCommandProps>;
|
|
31
|
+
output: ApplicationCommandAttributes | undefined;
|
|
32
|
+
}) => Effect.Effect<{
|
|
33
|
+
readonly action: 'update';
|
|
34
|
+
} | {
|
|
35
|
+
readonly action: 'noop';
|
|
36
|
+
} | undefined, DiscordOpError, import("effect/unstable/http/HttpClient").HttpClient>;
|
|
37
|
+
reconcile: ({ news }: {
|
|
38
|
+
news: ApplicationCommandProps;
|
|
39
|
+
}) => Effect.Effect<ApplicationCommandAttributes, DiscordOpError, import("effect/unstable/http/HttpClient").HttpClient>;
|
|
40
|
+
delete: ({ olds }: {
|
|
41
|
+
olds: ApplicationCommandProps;
|
|
42
|
+
}) => Effect.Effect<void, DiscordOpError, import("effect/unstable/http/HttpClient").HttpClient>;
|
|
43
|
+
};
|
|
44
|
+
export declare const DiscordApplicationCommandProvider: () => import("effect/Layer").Layer<Provider.Provider<DiscordApplicationCommand>, never, import("effect/unstable/http/HttpClient").HttpClient>;
|
|
45
|
+
/**
|
|
46
|
+
* `applicationCommand('help', { applicationId, name: 'help', description: '…' })` — `adopt(true)`
|
|
47
|
+
* piped on by default (H5), so a first deploy against a command that already exists silently
|
|
48
|
+
* takes it over instead of failing `OwnedBySomeoneElse`. Mirrors `cloudflare/website.ts`'s
|
|
49
|
+
* `astroWebsite`/`viteWebsite` convenience constructors.
|
|
50
|
+
*/
|
|
51
|
+
export declare const applicationCommand: (id: string, props: ApplicationCommandProps) => Effect.Effect<DiscordApplicationCommand, never, import("effect/unstable/http/HttpClient").HttpClient>;
|
|
52
|
+
//# sourceMappingURL=application-command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"application-command.d.ts","sourceRoot":"","sources":["../../src/discord/application-command.ts"],"names":[],"mappings":"AAeA,OAAO,EAA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|
|
2
|
+
export interface CommandFields {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly description?: string;
|
|
5
|
+
/**
|
|
6
|
+
* ⚠️ GAP: passed through opaquely, not re-modeled. The SDK's generated option union is ~40
|
|
7
|
+
* nested schema types (subcommand, subcommand group, string/int/number/channel/role/user/
|
|
8
|
+
* mentionable/attachment, each with its own choices and localizations) — see
|
|
9
|
+
* `docs/upstream-conformance.md#discord`. A caller supplies the exact wire shape from
|
|
10
|
+
* Discord's own docs; this resource neither validates nor transforms it.
|
|
11
|
+
*/
|
|
12
|
+
readonly options?: readonly Record<string, unknown>[];
|
|
13
|
+
/** Bitfield, stringified, per Discord's real wire contract (the SDK types write as `number`). */
|
|
14
|
+
readonly defaultMemberPermissions?: string;
|
|
15
|
+
readonly dmPermission?: boolean;
|
|
16
|
+
readonly contexts?: readonly number[];
|
|
17
|
+
readonly integrationTypes?: readonly number[];
|
|
18
|
+
readonly nsfw?: boolean;
|
|
19
|
+
/** `ApplicationCommandType`; omitted means `1` (`CHAT_INPUT`), Discord's own default. */
|
|
20
|
+
readonly type?: number;
|
|
21
|
+
}
|
|
22
|
+
export interface CommandFieldsAttributes {
|
|
23
|
+
readonly name: string;
|
|
24
|
+
readonly description: string;
|
|
25
|
+
readonly options: readonly Record<string, unknown>[];
|
|
26
|
+
readonly defaultMemberPermissions: string | undefined;
|
|
27
|
+
readonly dmPermission: boolean | undefined;
|
|
28
|
+
readonly contexts: readonly number[] | undefined;
|
|
29
|
+
readonly integrationTypes: readonly number[] | undefined;
|
|
30
|
+
readonly nsfw: boolean;
|
|
31
|
+
readonly type: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* ⛔ SENT IN FULL ON EVERY UPSERT, NEVER PARTIAL. Discord's create-as-upsert (resource.ts's own
|
|
35
|
+
* note) replaces the whole command, so a body that omitted a field the caller stopped declaring
|
|
36
|
+
* would never actually clear it — the same "declared, then forgotten" bug `prefix-form.ts`
|
|
37
|
+
* documents for NetBox's PATCH. Sending the full settled shape every time is what keeps a
|
|
38
|
+
* removed prop actually removed live, not just removed from the declaration.
|
|
39
|
+
*/
|
|
40
|
+
export declare const commandBody: (props: CommandFields) => Record<string, unknown>;
|
|
41
|
+
/** Whether the live command already says what the declaration says. */
|
|
42
|
+
export declare const commandMatches: (attributes: CommandFieldsAttributes, props: CommandFields) => boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Reads the shared fields off any `ApplicationCommandResponse`-shaped object.
|
|
45
|
+
*
|
|
46
|
+
* ⚠️ `options` IS READ AS `readonly unknown[]`, NOT RE-TYPED. The SDK's real
|
|
47
|
+
* `ApplicationCommandResponseOptionsItem` union has no index signature (each option kind is a
|
|
48
|
+
* distinct generated interface), so it cannot structurally satisfy `Record<string, unknown>`
|
|
49
|
+
* without a cast — the same "opaque passthrough" gap `CommandFields.options` documents above.
|
|
50
|
+
*/
|
|
51
|
+
export declare const commandFieldsOf: (live: {
|
|
52
|
+
readonly name: string;
|
|
53
|
+
readonly description: string;
|
|
54
|
+
readonly options?: readonly unknown[] | null | undefined;
|
|
55
|
+
readonly default_member_permissions?: string | null | undefined;
|
|
56
|
+
readonly dm_permission?: boolean | undefined;
|
|
57
|
+
readonly contexts?: readonly number[] | null | undefined;
|
|
58
|
+
readonly integration_types?: readonly number[] | null | undefined;
|
|
59
|
+
readonly nsfw?: boolean | undefined;
|
|
60
|
+
readonly type: number;
|
|
61
|
+
}) => CommandFieldsAttributes;
|
|
62
|
+
//# sourceMappingURL=command-form.d.ts.map
|