Relocate the ~6k-file docs tree from the repo root into plugins/document-navigator/docs/ so the plugin is self-contained and portable. docs/superpowers/ (specs and plans) stays at the repo root. Moved via cp+rm rather than git mv because directory rename() fails with EPERM on this WSL /mnt DrvFs mount; git rename-detection pairs the identical-content files at commit time. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@suaveplan/api-secrets - Abstract Secrets contract for the Suaveplan API plugin system — per-plugin secret access typed against manifest secrets[], canonical redaction marker, conformance harness. Concrete adapters (env/Bun.secrets/vault) live in sibling packages.
Abstract Secrets contract for the Suaveplan API plugin system — per-plugin secret access typed against manifest.secrets[], canonical redaction marker, frozen SECRETS.* error-code registry, capability-id pins, and the conformance harness every concrete source must pass. api-plugin-foundation umbrella; concrete sources land (api-secrets-env, api-secrets-vault) and Stage 8 (api-secrets-bun).
The canonical SecretsLike type is owned by @suaveplan/api-types/secrets; this package re-exports it and supplies the runtime surface every consumer needs.
Documentation tree
- capability-id — This module pins the two literal capability ids the api-secrets family contributes to the plugin-host
CapabilityIdun…- capability-id — This module pins the two literal capability ids the api-secrets family contributes to the plugin-host
CapabilityIdun…
- capability-id — This module pins the two literal capability ids the api-secrets family contributes to the plugin-host
- descriptor —
SecretDescriptoris the manifest-side declaration of a secret a plugin needs. The host iterates the manifest's `secre…- descriptor —
SecretDescriptoris the manifest-side declaration of a secret a plugin needs. The host iterates the manifest's `secre…
- descriptor —
- error-codes —
SECRETS_CODESis the frozen registry of fully-qualified error codes the API plugin system throws when a plugin tr…- error-codes —
SECRETS_CODESis the frozen registry of fully-qualified error codes the API plugin system throws when a plugin tr…
- error-codes —
- redaction — This module pins the single literal string every logger, audit sink, and OTel exporter in the API plugin system use…
- redaction — This module pins the single literal string every logger, audit sink, and OTel exporter in the API plugin system use…
- secrets-like — This module is the runtime entry point for the abstract Secrets contract. The canonical
SecretsLikeinterface — `get(…- secrets-like — This module is the runtime entry point for the abstract Secrets contract. The canonical
SecretsLikeinterface — `get(…
- secrets-like — This module is the runtime entry point for the abstract Secrets contract. The canonical
- testing —
runSecretsConformanceis the reusable Vitest suite every concreteSecretsLikeimplementation in the api-secrets fam…- conformance —
runSecretsConformanceis the reusable Vitest suite every concreteSecretsLikeimplementation in the api-secrets fam…
- conformance —
Subpath modules
| Subpath | Purpose | Docs |
|---|---|---|
./capability-id |
SECRETS_CAPABILITY_ID ("secrets") + SECRETS_BUN_CAPABILITY_ID ("secrets.bun") reservation. |
capability-id.md |
./descriptor |
SecretDescriptor interface + strict Zod schemas (secretDescriptorSchema, secretDescriptorListSchema). |
descriptor.md |
./error-codes |
SECRETS_CODES frozen registry + SecretsError concrete subclass. |
error-codes.md |
./redaction |
REDACTED_MARKER literal + redactSecret helper. |
redaction.md |
./secrets-like |
Re-export of SecretsLike + checkRequiredSecrets / enforceRequiredSecrets host helpers. |
secrets-like.md |
./testing |
runSecretsConformance reusable suite for every concrete source. |
conformance.md |
Installation
bun add @suaveplan/api-secrets
Quick example
import {
SECRETS_CAPABILITY_ID,
enforceRequiredSecrets,
secretDescriptorListSchema,
} from "@suaveplan/api-secrets";
const descriptors = secretDescriptorListSchema.parse(manifest.secrets);
await enforceRequiredSecrets(ctx.secrets, descriptors);
if (manifest.requiredCapabilities.includes(SECRETS_CAPABILITY_ID)) {
// ctx.secrets is guaranteed populated at this point
}
Dependencies
Runtime: @suaveplan/api-types, @suaveplan/error, tslib, zod.
Verification
bunx turbo lint typecheck test --filter=@suaveplan/api-secrets— green.bunx turbo test:coverage --filter=@suaveplan/api-secrets— 100/100/100/100.bunx turbo build --filter=@suaveplan/api-secrets— green.
License
MIT