Skip to content

toolmark-monorepo / @toolmark/core / ToolmarkOptions

Interface: ToolmarkOptions ​

Defined in: packages/core/src/registry.ts:84

Options for createToolmark. Invalid confirmMode / policy entries are validated while createToolmark runs: in development they throw; in production they are reported as error events (invalid_confirm_mode, invalid_policy) before any events.on listener can exist, so only onError observes them.

Extended by ​

Properties ​

abortGraceMs? ​

optional abortGraceMs?: number

Defined in: packages/core/src/registry.ts:104

Grace period after abort before a call is abandoned, in ms (default 5000).


budget? ​

optional budget?: number

Defined in: packages/core/src/registry.ts:118

Visible-tool budget; exceeding it emits tool_budget_exceeded in dev (default 40).


callTimeoutMs? ​

optional callTimeoutMs?: number

Defined in: packages/core/src/registry.ts:116

Deadline in ms (default 120000) for every run that has no caller signal: a tm.call without signal, the run a Toolmark.confirmPending approval starts, and an Toolmark.undo restorer. When it passes, the run's ctx.signal aborts; a tool that still has not settled after abortGraceMs is abandoned with cancelled signal, which releases its scope queue (a later settle is dropped with a late_result event). Calls that pass a signal are bounded by it instead. Infinity disables the deadline. The deadline is paused while an inline ctx.confirm is open (that wait is bounded by confirmExpiryMs) and resumes with the time that was left once the confirmation settles, so an operator's answer never counts against the run.


confirm? ​

optional confirm?: (req) => Promise<ConfirmOutcome>

Defined in: packages/core/src/registry.ts:88

Inline confirmation handler (used by inline-mode callers).

Parameters ​

req ​

ConfirmRequest

Returns ​

Promise<ConfirmOutcome>


confirmExpiryMs? ​

optional confirmExpiryMs?: number

Defined in: packages/core/src/registry.ts:102

Pending/inline confirmation expiry in ms (default 600000).


confirmMode? ​

optional confirmMode?: object

Defined in: packages/core/src/registry.ts:90

Confirmation mode per caller; only inapp/test are configurable (default deferred).

inapp? ​

optional inapp?: "deferred" | "inline"

mcp? ​

optional mcp?: "inline"

test? ​

optional test?: "deferred" | "inline"

tour? ​

optional tour?: "inline"

webmcp? ​

optional webmcp?: "inline"


dev? ​

optional dev?: boolean

Defined in: packages/core/src/registry.ts:86

Development behaviour: misconfiguration throws instead of emitting error events.


files? ​

optional files?: FilesOptions

Defined in: packages/core/src/registry.ts:123

File references (spec §8.4, D27): the { ref } resolver, URL origins (URL fetching is off unless allowOrigins is non-empty) and limits. Misconfiguration → files_misconfigured.


jsonSchema? ​

optional jsonSchema?: JsonSchemaConverter

Defined in: packages/core/src/registry.ts:100

Global JSON Schema converter for schemas without Standard JSON Schema.


onError? ​

optional onError?: (e) => void

Defined in: packages/core/src/registry.ts:125

Receives every error event (after events.on('error') listeners).

Parameters ​

e ​

ToolmarkErrorEvent

Returns ​

void


policy? ​

optional policy?: Partial<Record<"inapp" | "webmcp" | "mcp" | "test" | "tour", CallerPolicy>>

Defined in: packages/core/src/registry.ts:98

Per-caller policy (human is fixed).