@happyvertical/smrt-web 0.49.2 → 0.49.4

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/dist/index.d.ts CHANGED
@@ -240,6 +240,10 @@ export declare function executeSmrtWebDataQuery(transport: SmrtWebDataQueryTrans
240
240
  signal?: AbortSignal;
241
241
  }): Promise<SmrtWebDataQueryResult>;
242
242
 
243
+ export declare function executeSmrtWebDataSurfaceAction(transport: SmrtWebDataSurfaceActionTransport, request: SmrtWebDataSurfaceActionRequest, options?: {
244
+ signal?: AbortSignal;
245
+ }): Promise<SmrtWebDataSurfaceActionResult>;
246
+
243
247
  /**
244
248
  * Retrieve the underlying engine collection backing a handle — an advanced
245
249
  * bridge for trusted framework bindings (e.g. the smrt-svelte live-query
@@ -315,6 +319,14 @@ export declare const MAX_SMRT_WEB_DATA_QUERY_STRING_LENGTH = 65536;
315
319
 
316
320
  export declare const MAX_SMRT_WEB_DATA_QUERY_WARNINGS = 100;
317
321
 
322
+ export declare const MAX_SMRT_WEB_DATA_SURFACE_ACTION_CONTAINER_ITEMS = 1000;
323
+
324
+ export declare const MAX_SMRT_WEB_DATA_SURFACE_ACTION_IDENTIFIER_LENGTH = 256;
325
+
326
+ export declare const MAX_SMRT_WEB_DATA_SURFACE_ACTION_JSON_DEPTH = 16;
327
+
328
+ export declare const MAX_SMRT_WEB_DATA_SURFACE_ACTION_RESULT_BYTES = 1000000;
329
+
318
330
  /** The settle outcome handed to {@link SmrtWebCapability.onSettled}. */
319
331
  export declare type MutationSettleOutcome = {
320
332
  ok: true;
@@ -339,6 +351,9 @@ export declare function newLocalId(): string;
339
351
  */
340
352
  export declare function normalizeSmrtWebDataQueryResult(value: unknown): SmrtWebDataQueryResult;
341
353
 
354
+ /** Fail closed before an action result reaches browser state. */
355
+ export declare function normalizeSmrtWebDataSurfaceActionResult(value: unknown): SmrtWebDataSurfaceActionResult;
356
+
342
357
  /**
343
358
  * Build a durable offline-outbox capability for a collection. Add the returned
344
359
  * capability to the collection's `capabilities` array; a collection without it
@@ -1041,6 +1056,73 @@ export declare interface SmrtWebDataQueryTransport {
1041
1056
  }): Promise<unknown>;
1042
1057
  }
1043
1058
 
1059
+ export declare interface SmrtWebDataSurfaceActionRequest {
1060
+ version: 1;
1061
+ requestId: string;
1062
+ identity: SmrtWebDataSurfaceIdentity;
1063
+ actionId: string;
1064
+ phase: 'preview' | 'apply';
1065
+ expectedRevision: number;
1066
+ /** Required by the server for apply; retries with the same key replay safely. */
1067
+ idempotencyKey?: string;
1068
+ selection: SmrtWebDataSurfaceSelection;
1069
+ payload?: SmrtWebDataSurfaceJsonValue;
1070
+ confirmationToken?: string;
1071
+ }
1072
+
1073
+ export declare interface SmrtWebDataSurfaceActionResult {
1074
+ version: 1;
1075
+ requestId: string;
1076
+ identity: SmrtWebDataSurfaceIdentity;
1077
+ actionId: string;
1078
+ phase: 'preview' | 'apply';
1079
+ ok: boolean;
1080
+ reason?: string;
1081
+ confirmationToken?: string;
1082
+ details?: {
1083
+ [key: string]: SmrtWebDataSurfaceJsonValue;
1084
+ };
1085
+ }
1086
+
1087
+ export declare interface SmrtWebDataSurfaceActionTransport {
1088
+ action(request: SmrtWebDataSurfaceActionRequest, options?: {
1089
+ signal?: AbortSignal;
1090
+ }): Promise<unknown>;
1091
+ }
1092
+
1093
+ export declare interface SmrtWebDataSurfaceIdentity {
1094
+ surfaceId: string;
1095
+ kind: 'table' | 'list' | 'report' | 'custom';
1096
+ subject?: {
1097
+ type: string;
1098
+ id: string;
1099
+ label?: string;
1100
+ };
1101
+ }
1102
+
1103
+ /**
1104
+ * Browser transport for bounded data-surface action envelopes.
1105
+ *
1106
+ * This structurally mirrors smrt-types without importing another SMRT package.
1107
+ * The server remains responsible for authority, descriptor allowlists, and
1108
+ * confirmation-token validation; this boundary only rejects malformed replies.
1109
+ */
1110
+ export declare type SmrtWebDataSurfaceJsonPrimitive = string | number | boolean | null;
1111
+
1112
+ export declare type SmrtWebDataSurfaceJsonValue = SmrtWebDataSurfaceJsonPrimitive | SmrtWebDataSurfaceJsonValue[] | {
1113
+ [key: string]: SmrtWebDataSurfaceJsonValue;
1114
+ };
1115
+
1116
+ export declare type SmrtWebDataSurfaceSelection = {
1117
+ scope: 'current-page';
1118
+ } | {
1119
+ scope: 'explicit-ids';
1120
+ rowIds: Array<string | number>;
1121
+ } | {
1122
+ scope: 'all-matching';
1123
+ queryFingerprint: string;
1124
+ };
1125
+
1044
1126
  /**
1045
1127
  * The minimal `EventSource` surface the subscriber uses — declared here so a
1046
1128
  * test injects a fake without a real DOM, and so this module compiles without
@@ -1635,7 +1717,7 @@ export declare interface WebMcpBespokeToolSpec {
1635
1717
  openWorldHint?: boolean;
1636
1718
  untrustedContentHint?: boolean;
1637
1719
  };
1638
- execute: (args: Record<string, unknown>) => string | Promise<string>;
1720
+ execute: (args: Record<string, unknown>, options?: WebMcpToolExecutionOptions) => string | Promise<string>;
1639
1721
  }
1640
1722
 
1641
1723
  /** The MCP-shaped annotation set a resolved classification emits. */
@@ -1738,6 +1820,12 @@ export declare interface WebMcpToolDefinition extends WebToolDescriptor {
1738
1820
  */
1739
1821
  export declare type WebMcpToolEffect = 'read' | 'write' | 'destructive';
1740
1822
 
1823
+ /** Host-supplied per-invocation options, distinct from registration lifetime. */
1824
+ export declare interface WebMcpToolExecutionOptions {
1825
+ /** Caller cancellation. Older hosts may omit execution options entirely. */
1826
+ signal?: AbortSignal;
1827
+ }
1828
+
1741
1829
  /**
1742
1830
  * Thrown synchronously when a name is already held. Carries the colliding
1743
1831
  * name and the owner that holds it so a host can report both without parsing
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as MAX_SMRT_WEB_DATA_QUERY_OFFSET, C as offlineOutbox, D as MAX_SMRT_WEB_DATA_QUERY_CONTAINER_ITEMS, E as wipeDurableStore, F as MAX_SMRT_WEB_DATA_QUERY_WARNINGS, I as executeSmrtWebDataQuery, L as normalizeSmrtWebDataQueryResult, M as MAX_SMRT_WEB_DATA_QUERY_RESULT_BYTES, N as MAX_SMRT_WEB_DATA_QUERY_ROWS, O as MAX_SMRT_WEB_DATA_QUERY_FACETS, P as MAX_SMRT_WEB_DATA_QUERY_STRING_LENGTH, R as runWrapMutation, S as getOutboxHandle, T as registerDurableResource, _ as createSmrtWebEventSubscriber, a as createSmrtWebClient, b as DEFAULT_PERSIST_DEBOUNCE_MS, c as newLocalId, d as unwrapListResult, f as validateSmrtWebClient, g as createUpdateState, h as registerWebMcpTools, i as createSmrtCollection, j as MAX_SMRT_WEB_DATA_QUERY_PAGE_LIMIT, k as MAX_SMRT_WEB_DATA_QUERY_FACET_VALUES, l as throwIfSmrtWebError, m as registerWebMcpBespokeTool, n as buildListQuery, o as getEngineCollection, p as registerViewIntent, r as createDefinitionFetchers, s as invalidateSmrtWebCollections, t as SmrtWebRequestError, u as unwrapItemResult, v as liveInvalidation, w as durableStoreNamespace, x as persistCollection, y as createSmrtWebQuery } from "./chunks/src-DHH8ptH8.js";
1
+ import { A as MAX_SMRT_WEB_DATA_SURFACE_ACTION_RESULT_BYTES, B as MAX_SMRT_WEB_DATA_QUERY_STRING_LENGTH, C as offlineOutbox, D as MAX_SMRT_WEB_DATA_SURFACE_ACTION_CONTAINER_ITEMS, E as wipeDurableStore, F as MAX_SMRT_WEB_DATA_QUERY_FACET_VALUES, H as executeSmrtWebDataQuery, I as MAX_SMRT_WEB_DATA_QUERY_OFFSET, L as MAX_SMRT_WEB_DATA_QUERY_PAGE_LIMIT, M as normalizeSmrtWebDataSurfaceActionResult, N as MAX_SMRT_WEB_DATA_QUERY_CONTAINER_ITEMS, O as MAX_SMRT_WEB_DATA_SURFACE_ACTION_IDENTIFIER_LENGTH, P as MAX_SMRT_WEB_DATA_QUERY_FACETS, R as MAX_SMRT_WEB_DATA_QUERY_RESULT_BYTES, S as getOutboxHandle, T as registerDurableResource, U as normalizeSmrtWebDataQueryResult, V as MAX_SMRT_WEB_DATA_QUERY_WARNINGS, W as runWrapMutation, _ as createSmrtWebEventSubscriber, a as createSmrtWebClient, b as DEFAULT_PERSIST_DEBOUNCE_MS, c as newLocalId, d as unwrapListResult, f as validateSmrtWebClient, g as createUpdateState, h as registerWebMcpTools, i as createSmrtCollection, j as executeSmrtWebDataSurfaceAction, k as MAX_SMRT_WEB_DATA_SURFACE_ACTION_JSON_DEPTH, l as throwIfSmrtWebError, m as registerWebMcpBespokeTool, n as buildListQuery, o as getEngineCollection, p as registerViewIntent, r as createDefinitionFetchers, s as invalidateSmrtWebCollections, t as SmrtWebRequestError, u as unwrapItemResult, v as liveInvalidation, w as durableStoreNamespace, x as persistCollection, y as createSmrtWebQuery, z as MAX_SMRT_WEB_DATA_QUERY_ROWS } from "./chunks/src-0IQGhPIM.js";
2
2
  import { n as compileViewIntentToolSpec, o as viewIntentToolName } from "./chunks/intents-BUTyN7YQ.js";
3
3
  import { WebMcpToolNameCollisionError, reserveWebMcpToolNames, webMcpToolNameOwner } from "./webmcp-tool-names.js";
4
- export { DEFAULT_PERSIST_DEBOUNCE_MS, MAX_SMRT_WEB_DATA_QUERY_CONTAINER_ITEMS, MAX_SMRT_WEB_DATA_QUERY_FACETS, MAX_SMRT_WEB_DATA_QUERY_FACET_VALUES, MAX_SMRT_WEB_DATA_QUERY_OFFSET, MAX_SMRT_WEB_DATA_QUERY_PAGE_LIMIT, MAX_SMRT_WEB_DATA_QUERY_RESULT_BYTES, MAX_SMRT_WEB_DATA_QUERY_ROWS, MAX_SMRT_WEB_DATA_QUERY_STRING_LENGTH, MAX_SMRT_WEB_DATA_QUERY_WARNINGS, SmrtWebRequestError, WebMcpToolNameCollisionError, buildListQuery, compileViewIntentToolSpec, createDefinitionFetchers, createSmrtCollection, createSmrtWebClient, createSmrtWebEventSubscriber, createSmrtWebQuery, createUpdateState, durableStoreNamespace, executeSmrtWebDataQuery, getEngineCollection, getOutboxHandle, invalidateSmrtWebCollections, liveInvalidation, newLocalId, normalizeSmrtWebDataQueryResult, offlineOutbox, persistCollection, registerDurableResource, registerViewIntent, registerWebMcpBespokeTool, registerWebMcpTools, reserveWebMcpToolNames, runWrapMutation, throwIfSmrtWebError, unwrapItemResult, unwrapListResult, validateSmrtWebClient, viewIntentToolName, webMcpToolNameOwner, wipeDurableStore };
4
+ export { DEFAULT_PERSIST_DEBOUNCE_MS, MAX_SMRT_WEB_DATA_QUERY_CONTAINER_ITEMS, MAX_SMRT_WEB_DATA_QUERY_FACETS, MAX_SMRT_WEB_DATA_QUERY_FACET_VALUES, MAX_SMRT_WEB_DATA_QUERY_OFFSET, MAX_SMRT_WEB_DATA_QUERY_PAGE_LIMIT, MAX_SMRT_WEB_DATA_QUERY_RESULT_BYTES, MAX_SMRT_WEB_DATA_QUERY_ROWS, MAX_SMRT_WEB_DATA_QUERY_STRING_LENGTH, MAX_SMRT_WEB_DATA_QUERY_WARNINGS, MAX_SMRT_WEB_DATA_SURFACE_ACTION_CONTAINER_ITEMS, MAX_SMRT_WEB_DATA_SURFACE_ACTION_IDENTIFIER_LENGTH, MAX_SMRT_WEB_DATA_SURFACE_ACTION_JSON_DEPTH, MAX_SMRT_WEB_DATA_SURFACE_ACTION_RESULT_BYTES, SmrtWebRequestError, WebMcpToolNameCollisionError, buildListQuery, compileViewIntentToolSpec, createDefinitionFetchers, createSmrtCollection, createSmrtWebClient, createSmrtWebEventSubscriber, createSmrtWebQuery, createUpdateState, durableStoreNamespace, executeSmrtWebDataQuery, executeSmrtWebDataSurfaceAction, getEngineCollection, getOutboxHandle, invalidateSmrtWebCollections, liveInvalidation, newLocalId, normalizeSmrtWebDataQueryResult, normalizeSmrtWebDataSurfaceActionResult, offlineOutbox, persistCollection, registerDurableResource, registerViewIntent, registerWebMcpBespokeTool, registerWebMcpTools, reserveWebMcpToolNames, runWrapMutation, throwIfSmrtWebError, unwrapItemResult, unwrapListResult, validateSmrtWebClient, viewIntentToolName, webMcpToolNameOwner, wipeDurableStore };
package/dist/webmcp.d.ts CHANGED
@@ -445,7 +445,7 @@ export declare interface WebMcpBespokeToolSpec {
445
445
  openWorldHint?: boolean;
446
446
  untrustedContentHint?: boolean;
447
447
  };
448
- execute: (args: Record<string, unknown>) => string | Promise<string>;
448
+ execute: (args: Record<string, unknown>, options?: WebMcpToolExecutionOptions) => string | Promise<string>;
449
449
  }
450
450
 
451
451
  /** A fully resolved classification. */
@@ -528,6 +528,12 @@ declare interface WebMcpToolDefinition extends WebToolDescriptor {
528
528
  */
529
529
  export declare type WebMcpToolEffect = 'read' | 'write' | 'destructive';
530
530
 
531
+ /** Host-supplied per-invocation options, distinct from registration lifetime. */
532
+ export declare interface WebMcpToolExecutionOptions {
533
+ /** Caller cancellation. Older hosts may omit execution options entirely. */
534
+ signal?: AbortSignal;
535
+ }
536
+
531
537
  /**
532
538
  * Thrown synchronously when a name is already held. Carries the colliding
533
539
  * name and the owner that holds it so a host can report both without parsing
package/dist/webmcp.js CHANGED
@@ -1,3 +1,3 @@
1
- import { h as registerWebMcpTools, m as registerWebMcpBespokeTool, p as registerViewIntent } from "./chunks/src-DHH8ptH8.js";
1
+ import { h as registerWebMcpTools, m as registerWebMcpBespokeTool, p as registerViewIntent } from "./chunks/src-0IQGhPIM.js";
2
2
  import { WebMcpToolNameCollisionError, reserveWebMcpToolNames, webMcpToolNameOwner } from "./webmcp-tool-names.js";
3
3
  export { WebMcpToolNameCollisionError, registerViewIntent, registerWebMcpBespokeTool, registerWebMcpTools, reserveWebMcpToolNames, webMcpToolNameOwner };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happyvertical/smrt-web",
3
- "version": "0.49.2",
3
+ "version": "0.49.4",
4
4
  "description": "SMRT browser client data runtime: typed collection factory wrapping the client-data engine over generated REST clients",
5
5
  "author": "HappyVertical",
6
6
  "type": "module",
@@ -36,8 +36,8 @@
36
36
  "@tanstack/query-db-collection": "^1.0.46"
37
37
  },
38
38
  "devDependencies": {
39
- "@happyvertical/smrt-core": "0.49.2",
40
- "@happyvertical/smrt-scanner": "0.49.2",
39
+ "@happyvertical/smrt-core": "0.49.4",
40
+ "@happyvertical/smrt-scanner": "0.49.4",
41
41
  "@types/node": "24.13.2",
42
42
  "fake-indexeddb": "^6.2.5",
43
43
  "typescript": "5.9.3",