Files
openclaw/src/plugin-sdk/secret-input.ts
T
Peter Steinberger 90e465833b feat(gateway): durable cloud worker environments, provider SDK contract, and lifecycle RPCs (#104401)
* docs(plan): add cloud workers design plan

* feat(plugin-sdk): add cloud worker provider foundations

* feat(protocol): add worker environment lifecycle shapes

* feat(gateway): persist worker environment lifecycles

* test(gateway): pin environment inventory assertion for damaged worker store

* style(cloud-workers): satisfy lint and docs formatting

* fix(gateway): narrow worker environment type boundaries

* chore(plugin-sdk): account for WorkerProvider surface growth

* docs: regenerate docs map
2026-07-11 04:54:27 -07:00

47 lines
1.4 KiB
TypeScript

// Secret input helpers normalize credential prompt definitions for plugin setup flows.
import { z } from "zod";
import {
hasConfiguredSecretInput,
isSecretRef,
coerceSecretRef,
resolveSecretInputString,
normalizeResolvedSecretInputString,
normalizeSecretInputString,
} from "../config/types.secrets.js";
import { isValidSecretRef } from "../secrets/ref-contract.js";
import { normalizeSecretInput } from "../utils/normalize-secret-input.js";
import { buildSecretInputSchema } from "./secret-input-schema.js";
export type {
SecretInput,
SecretInputStringResolution,
SecretInputStringResolutionMode,
} from "../config/types.secrets.js";
export {
buildSecretInputSchema,
coerceSecretRef,
hasConfiguredSecretInput,
isSecretRef,
isValidSecretRef,
resolveSecretInputString,
normalizeResolvedSecretInputString,
normalizeSecretInput,
normalizeSecretInputString,
};
/**
* Builds an optional secret-input schema for config fields that may be omitted.
* The inner schema stays shared so sensitive-path redaction still recognizes it.
*/
export function buildOptionalSecretInputSchema() {
return buildSecretInputSchema().optional();
}
/**
* Builds an array schema for provider/channel config that accepts multiple secret inputs.
* Each element uses the shared schema so plaintext and ref validation stay identical.
*/
export function buildSecretInputArraySchema() {
return z.array(buildSecretInputSchema());
}