Skip to content

toolmark-monorepo / @toolmark/testing / CreateTestToolmarkOptions

Interface: CreateTestToolmarkOptions ​

Defined in: packages/testing/src/test-toolmark.ts:34

Options accepted by createTestToolmark.

Extends ​

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).

Inherited from ​

ToolmarkOptions.abortGraceMs


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).

Inherited from ​

ToolmarkOptions.budget


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.

Inherited from ​

ToolmarkOptions.callTimeoutMs


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>

Inherited from ​

ToolmarkOptions.confirm


confirmExpiryMs? ​

optional confirmExpiryMs?: number

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

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

Inherited from ​

ToolmarkOptions.confirmExpiryMs


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"

Inherited from ​

ToolmarkOptions.confirmMode


dev? ​

optional dev?: boolean

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

Development behaviour: misconfiguration throws instead of emitting error events.

Inherited from ​

ToolmarkOptions.dev


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.

Inherited from ​

ToolmarkOptions.files


inline? ​

optional inline?: "reject" | "approve" | ((req) => Promise<ConfirmOutcome>)

Defined in: packages/testing/src/test-toolmark.ts:41

Scripts the installed inline confirmation handler for inline-mode callers (webmcp, mcp, tour, or inapp/test configured inline): 'approve' (default), 'reject', or a function given the full request. opts.confirm, when given, wins and runs instead (still recorded in .confirms).


jsonSchema? ​

optional jsonSchema?: JsonSchemaConverter

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

Global JSON Schema converter for schemas without Standard JSON Schema.

Inherited from ​

ToolmarkOptions.jsonSchema


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

Inherited from ​

ToolmarkOptions.onError


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).

Inherited from ​

ToolmarkOptions.policy