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?
optionalabortGraceMs?:number
Defined in: packages/core/src/registry.ts:104
Grace period after abort before a call is abandoned, in ms (default 5000).
budget?
optionalbudget?:number
Defined in: packages/core/src/registry.ts:118
Visible-tool budget; exceeding it emits tool_budget_exceeded in dev (default 40).
callTimeoutMs?
optionalcallTimeoutMs?: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?
optionalconfirm?: (req) =>Promise<ConfirmOutcome>
Defined in: packages/core/src/registry.ts:88
Inline confirmation handler (used by inline-mode callers).
Parameters
req
Returns
Promise<ConfirmOutcome>
confirmExpiryMs?
optionalconfirmExpiryMs?:number
Defined in: packages/core/src/registry.ts:102
Pending/inline confirmation expiry in ms (default 600000).
confirmMode?
optionalconfirmMode?:object
Defined in: packages/core/src/registry.ts:90
Confirmation mode per caller; only inapp/test are configurable (default deferred).
inapp?
optionalinapp?:"deferred"|"inline"
mcp?
optionalmcp?:"inline"
test?
optionaltest?:"deferred"|"inline"
tour?
optionaltour?:"inline"
webmcp?
optionalwebmcp?:"inline"
dev?
optionaldev?:boolean
Defined in: packages/core/src/registry.ts:86
Development behaviour: misconfiguration throws instead of emitting error events.
files?
optionalfiles?: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?
optionaljsonSchema?:JsonSchemaConverter
Defined in: packages/core/src/registry.ts:100
Global JSON Schema converter for schemas without Standard JSON Schema.
onError?
optionalonError?: (e) =>void
Defined in: packages/core/src/registry.ts:125
Receives every error event (after events.on('error') listeners).
Parameters
e
Returns
void
policy?
optionalpolicy?:Partial<Record<"inapp"|"webmcp"|"mcp"|"test"|"tour",CallerPolicy>>
Defined in: packages/core/src/registry.ts:98
Per-caller policy (human is fixed).