MCPcopy Index your code
hub / github.com/TanStack/ai / createSecrets

Function createSecrets

packages/ai-sandbox/src/secrets.ts:24–42  ·  view source on GitHub ↗
(
  values: T,
)

Source from the content-addressed store, hash-verified

22
23/** Create a typed secrets object from a plain record of name→value pairs. */
24export function createSecrets<T extends Record<string, string>>(
25 values: T,
26): Secrets<keyof T & string> {
27 const registry = new Map<string, string>(Object.entries(values))
28 const obj = {} as Record<string, SecretRef>
29
30 for (const name of Object.keys(values)) {
31 obj[name] = Object.freeze({ __secretName: name })
32 }
33
34 Object.defineProperty(obj, REGISTRY, {
35 value: registry,
36 enumerable: false,
37 configurable: false,
38 writable: false,
39 })
40
41 return obj as Secrets<keyof T & string>
42}
43
44/** Marker type for a bearer-token value derived from a SecretRef. */
45export type BearerRef = { readonly __bearerRef: SecretRef }

Callers 15

buildScenarioFunction · 0.90
projection.test.tsFile · 0.90
reconstituteWorkspaceFunction · 0.90
buildScenarioFunction · 0.90
projection.test.tsFile · 0.90
projection.test.tsFile · 0.90
key.test.tsFile · 0.90
secrets.test.tsFile · 0.90
bootstrap.test.tsFile · 0.90
workspace.test.tsFile · 0.90
buildScenarioFunction · 0.90

Calls

no outgoing calls

Tested by 4

buildScenarioFunction · 0.72
buildScenarioFunction · 0.72
buildScenarioFunction · 0.72
buildScenarioFunction · 0.72