Skip to content

Graphorin API reference v0.1.0


Graphorin API reference / @graphorin/core / / ToolSecretsAccessor

Interface: ToolSecretsAccessor

Defined in: packages/core/src/contracts/tool.ts:254

Per-call secrets accessor surface. Implemented by the executor; the tool author calls require(...) to obtain a SecretValue wrapper.

The accessor is intentionally narrow — the ACL enforcement happens inside require(...), so the tool author never accidentally unwraps a secret outside the tool's permitted set.

Stable

Methods

require()

Call Signature

ts
require(key, options?): Promise<SecretValue>;

Defined in: packages/core/src/contracts/tool.ts:261

Resolve a secret by key. Throws SecretAccessDeniedError if the key is not in the tool's secretsAllowed allowlist; throws SecretRequiredError (or returns null when optional: true) if the key resolves to no value.

Parameters
ParameterType
keystring
options?{ optional?: false; }
options.optional?false
Returns

Promise&lt;SecretValue&gt;

Call Signature

ts
require(key, options): Promise<SecretValue | null>;

Defined in: packages/core/src/contracts/tool.ts:265

Parameters
ParameterType
keystring
options{ optional: true; }
options.optionaltrue
Returns

Promise&lt;SecretValue | null&gt;