Skip to main content

DelegatingToolDeps

@forge/monorepo


@forge/monorepo / backend/src / DelegatingToolDeps

Type Alias: DelegatingToolDeps

DelegatingToolDeps = object

Defined in: backend/src/tools/delegating.ts:88

Properties

approvals?

readonly optional approvals?: ApprovalGate

Defined in: backend/src/tools/delegating.ts:95

Consulted for gated effects. Absent means no capability with an external-write or destructive effect can run — refusing is the safe default, since the alternative is performing an unapproved side effect because a dependency was not wired.


authorization

readonly authorization: AuthorizationPolicy

Defined in: backend/src/tools/delegating.ts:89


idempotency?

readonly optional idempotency?: IdempotencyStore

Defined in: backend/src/tools/delegating.ts:109

Where a first result is stored so a retry returns it. Absent means gated effects are refused for the same reason: an external write with no replay protection is exactly the thing this envelope exists to prevent. See the open question on #113.


onMisconfiguration?

readonly optional onMisconfiguration?: (report) => void

Defined in: backend/src/tools/delegating.ts:103

Where "this tool can never run" is reported — #162, the same sink and the same shape the registry uses.

Deliberately not a separate type: the case that misled in #155 was wiring one layer and not the other, so a host that reports both through one function sees "registry" and "delegating-envelope" side by side instead of guessing which file to open.

Parameters

report

ToolMisconfiguration

Returns

void


shadow?

readonly optional shadow?: ShadowRecorder

Defined in: backend/src/tools/delegating.ts:129

Where a shadow run's suppressed writes go.

Required when the run says it is shadow: context.shadow === true with no recorder is refused rather than performed. Announcing a shadow run and having nowhere to record it is not a licence to publish — the same fail-closed reasoning as the missing approval gate.


validator?

readonly optional validator?: SchemaValidator

Defined in: backend/src/tools/delegating.ts:121

Validates input against the spec's inputSchema before the delegate is reached (#115 AC-5).

Defaults to zodishValidator, which passes through anything that is not a zod-like schema — and inputSchema itself defaults to {} — so a tool that declares no schema behaves exactly as it did before this existed.

The registry already re-validates at execution, which covers the production path. This covers every path: a tool executed directly, from a test, or from a future caller that is not the registry. The envelope's whole purpose is that a guarantee cannot be reached around.