@happyvertical/smrt-web 0.49.2 → 0.49.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -191,6 +191,19 @@ collections. Their duplicate tool names or collection/action identities reject
191
191
  the registration atomically. Prefer the canonical set for complete generated
192
192
  coverage, or compose only disjoint legacy and canonical subsets.
193
193
 
194
+ ### Bespoke execution cancellation
195
+
196
+ A bespoke tool's `execute(args, options)` receives the host's optional
197
+ `WebMcpToolExecutionOptions` unchanged, including `options.signal`. Pass that
198
+ signal to your asynchronous operations and check it before publishing results.
199
+ It represents cancellation of that invocation, independently of the registration
200
+ signal that unregisters the tool. Existing one-argument callbacks and hosts that
201
+ omit options remain supported. Cancellation is cooperative and does not roll
202
+ back an operation that has already taken effect.
203
+
204
+ The same callback type is used by `smrt-svelte`'s `useWebMcpTool`. This forwarding
205
+ contract does not add cancellation to generated REST or collection operations.
206
+
194
207
  ### Tool names are locked per document
195
208
 
196
209
  Generated model tools, the six fixed `smrt_ui_*` tools a UI layer registers
@@ -2407,10 +2407,10 @@ function annotationsFor(tool) {
2407
2407
  return capabilityAnnotations(tool);
2408
2408
  }
2409
2409
  function guardedExecute(tool, allowedEffects, isDisposed, execute) {
2410
- return (args) => {
2410
+ return (args, options) => {
2411
2411
  if (isDisposed()) throw new Error(`WebMCP tool ${tool.name} is no longer registered`);
2412
2412
  if (!allowedEffects.has(tool.effect)) throw new Error(`WebMCP policy no longer allows ${tool.effect} tool ${tool.name}`);
2413
- return execute(args ?? {});
2413
+ return options === void 0 ? execute(args ?? {}) : execute(args ?? {}, options);
2414
2414
  };
2415
2415
  }
2416
2416
  function isCanonicalToolDefinition(definition) {
@@ -3039,4 +3039,4 @@ function createSmrtCollection(definition, options) {
3039
3039
  //#endregion
3040
3040
  export { MAX_SMRT_WEB_DATA_QUERY_OFFSET as A, offlineOutbox as C, MAX_SMRT_WEB_DATA_QUERY_CONTAINER_ITEMS as D, wipeDurableStore as E, MAX_SMRT_WEB_DATA_QUERY_WARNINGS as F, executeSmrtWebDataQuery as I, normalizeSmrtWebDataQueryResult as L, MAX_SMRT_WEB_DATA_QUERY_RESULT_BYTES as M, MAX_SMRT_WEB_DATA_QUERY_ROWS as N, MAX_SMRT_WEB_DATA_QUERY_FACETS as O, MAX_SMRT_WEB_DATA_QUERY_STRING_LENGTH as P, runWrapMutation as R, getOutboxHandle as S, registerDurableResource as T, createSmrtWebEventSubscriber as _, createSmrtWebClient as a, DEFAULT_PERSIST_DEBOUNCE_MS as b, newLocalId as c, unwrapListResult as d, validateSmrtWebClient as f, createUpdateState as g, registerWebMcpTools as h, createSmrtCollection as i, MAX_SMRT_WEB_DATA_QUERY_PAGE_LIMIT as j, MAX_SMRT_WEB_DATA_QUERY_FACET_VALUES as k, throwIfSmrtWebError as l, registerWebMcpBespokeTool as m, buildListQuery as n, getEngineCollection as o, registerViewIntent as p, createDefinitionFetchers as r, invalidateSmrtWebCollections as s, SmrtWebRequestError as t, unwrapItemResult as u, liveInvalidation as v, durableStoreNamespace as w, persistCollection as x, createSmrtWebQuery as y };
3041
3041
 
3042
- //# sourceMappingURL=src-DHH8ptH8.js.map
3042
+ //# sourceMappingURL=src-BSrj5jW0.js.map