@qontinui/ui-bridge-native 0.3.2 → 0.5.1

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.
Files changed (112) hide show
  1. package/dist/control/{index.d.mts → action-executor.d.ts} +6 -10
  2. package/dist/control/action-executor.d.ts.map +1 -0
  3. package/dist/control/index.d.ts +5 -95
  4. package/dist/control/index.d.ts.map +1 -0
  5. package/dist/{types-CjEKTDYT.d.ts → control/types.d.ts} +17 -20
  6. package/dist/control/types.d.ts.map +1 -0
  7. package/dist/core/element-identifier.d.ts +41 -0
  8. package/dist/core/element-identifier.d.ts.map +1 -0
  9. package/dist/core/index.d.ts +6 -43
  10. package/dist/core/index.d.ts.map +1 -0
  11. package/dist/{registry-pAUpQq2O.d.ts → core/registry.d.ts} +10 -13
  12. package/dist/core/registry.d.ts.map +1 -0
  13. package/dist/{types-CGVut7mc.d.mts → core/types.d.ts} +41 -41
  14. package/dist/core/types.d.ts.map +1 -0
  15. package/dist/debug/index.d.ts +4 -44
  16. package/dist/debug/index.d.ts.map +1 -0
  17. package/dist/debug/index.js +1 -1
  18. package/dist/debug/index.js.map +1 -1
  19. package/dist/debug/index.mjs +2 -2
  20. package/dist/debug/index.mjs.map +1 -1
  21. package/dist/debug/{index.d.mts → inspector.d.ts} +3 -6
  22. package/dist/debug/inspector.d.ts.map +1 -0
  23. package/dist/design/{index.d.mts → design-inspector-native.d.ts} +7 -11
  24. package/dist/design/design-inspector-native.d.ts.map +1 -0
  25. package/dist/{design-types-BHr6Q1FX.d.mts → design/design-types.d.ts} +10 -11
  26. package/dist/design/design-types.d.ts.map +1 -0
  27. package/dist/design/index.d.ts +5 -60
  28. package/dist/design/index.d.ts.map +1 -0
  29. package/dist/index.d.ts +37 -86
  30. package/dist/index.d.ts.map +1 -0
  31. package/dist/index.js +60 -4
  32. package/dist/index.js.map +1 -1
  33. package/dist/index.mjs +61 -5
  34. package/dist/index.mjs.map +1 -1
  35. package/dist/modal/index.d.ts +2 -0
  36. package/dist/modal/index.d.ts.map +1 -0
  37. package/dist/modal/modal-detector.d.ts +29 -0
  38. package/dist/modal/modal-detector.d.ts.map +1 -0
  39. package/dist/react/StateAnnotation.d.ts +30 -0
  40. package/dist/react/StateAnnotation.d.ts.map +1 -0
  41. package/dist/react/UIBridgeNativeProvider.d.ts +163 -0
  42. package/dist/react/UIBridgeNativeProvider.d.ts.map +1 -0
  43. package/dist/react/index.d.ts +14 -69
  44. package/dist/react/index.d.ts.map +1 -0
  45. package/dist/react/index.js +60 -4
  46. package/dist/react/index.js.map +1 -1
  47. package/dist/react/index.mjs +61 -5
  48. package/dist/react/index.mjs.map +1 -1
  49. package/dist/react/{index.d.mts → useAutoRegister.d.ts} +7 -15
  50. package/dist/react/useAutoRegister.d.ts.map +1 -0
  51. package/dist/react/useUIBridge.d.ts +103 -0
  52. package/dist/react/useUIBridge.d.ts.map +1 -0
  53. package/dist/react/useUIBridgeModal.d.ts +14 -0
  54. package/dist/react/useUIBridgeModal.d.ts.map +1 -0
  55. package/dist/react/useUIBridgeToast.d.ts +25 -0
  56. package/dist/react/useUIBridgeToast.d.ts.map +1 -0
  57. package/dist/react/useUIComponent.d.ts +112 -0
  58. package/dist/react/useUIComponent.d.ts.map +1 -0
  59. package/dist/react/useUIElement.d.ts +162 -0
  60. package/dist/react/useUIElement.d.ts.map +1 -0
  61. package/dist/server/design-handlers.d.ts +47 -0
  62. package/dist/server/design-handlers.d.ts.map +1 -0
  63. package/dist/server/handlers.d.ts +25 -0
  64. package/dist/server/handlers.d.ts.map +1 -0
  65. package/dist/server/http-server.d.ts +269 -0
  66. package/dist/server/http-server.d.ts.map +1 -0
  67. package/dist/server/index.d.ts +14 -176
  68. package/dist/server/index.d.ts.map +1 -0
  69. package/dist/server/index.js +51 -1
  70. package/dist/server/index.js.map +1 -1
  71. package/dist/server/index.mjs +51 -1
  72. package/dist/server/index.mjs.map +1 -1
  73. package/dist/server/observability.d.ts +55 -0
  74. package/dist/server/observability.d.ts.map +1 -0
  75. package/dist/server/types.d.ts +377 -0
  76. package/dist/server/types.d.ts.map +1 -0
  77. package/dist/server/ws-connection.d.ts +48 -0
  78. package/dist/server/ws-connection.d.ts.map +1 -0
  79. package/dist/server/ws-event-bridge.d.ts +113 -0
  80. package/dist/server/ws-event-bridge.d.ts.map +1 -0
  81. package/dist/server/ws-protocol.d.ts +48 -0
  82. package/dist/server/ws-protocol.d.ts.map +1 -0
  83. package/dist/server/ws-types.d.ts +65 -0
  84. package/dist/server/ws-types.d.ts.map +1 -0
  85. package/dist/toast/index.d.ts +2 -0
  86. package/dist/toast/index.d.ts.map +1 -0
  87. package/dist/toast/toast-capture.d.ts +27 -0
  88. package/dist/toast/toast-capture.d.ts.map +1 -0
  89. package/dist/transport/CloudRelayClient.d.ts +51 -0
  90. package/dist/transport/CloudRelayClient.d.ts.map +1 -0
  91. package/dist/transport/DeviceAnnouncer.d.ts +75 -0
  92. package/dist/transport/DeviceAnnouncer.d.ts.map +1 -0
  93. package/dist/transport/index.d.ts +3 -0
  94. package/dist/transport/index.d.ts.map +1 -0
  95. package/dist/transport/logger.d.ts +23 -0
  96. package/dist/transport/logger.d.ts.map +1 -0
  97. package/dist/undo/index.d.ts +3 -0
  98. package/dist/undo/index.d.ts.map +1 -0
  99. package/dist/undo/undo-tracker.d.ts +59 -0
  100. package/dist/undo/undo-tracker.d.ts.map +1 -0
  101. package/package.json +3 -3
  102. package/dist/StateAnnotation--zm0Jfqj.d.ts +0 -755
  103. package/dist/StateAnnotation-BgFoVWFy.d.mts +0 -755
  104. package/dist/core/index.d.mts +0 -46
  105. package/dist/design-types-BHr6Q1FX.d.ts +0 -205
  106. package/dist/http-server--550eD1F.d.mts +0 -805
  107. package/dist/http-server-C9NaNBEP.d.ts +0 -805
  108. package/dist/index.d.mts +0 -89
  109. package/dist/registry-B5JadBN9.d.mts +0 -300
  110. package/dist/server/index.d.mts +0 -178
  111. package/dist/types-B0XA4vOF.d.mts +0 -197
  112. package/dist/types-CGVut7mc.d.ts +0 -567
@@ -0,0 +1,65 @@
1
+ /**
2
+ * WebSocket JSON-RPC message types for the UI Bridge protocol.
3
+ */
4
+ /** Standard JSON-RPC request */
5
+ export interface JsonRpcRequest {
6
+ id: number | string;
7
+ method: string;
8
+ params?: Record<string, unknown>;
9
+ }
10
+ /** Batch request — execute multiple requests concurrently */
11
+ export interface JsonRpcBatchRequest {
12
+ id: number | string;
13
+ batch: JsonRpcRequest[];
14
+ }
15
+ /** Subscribe to registry events */
16
+ export interface JsonRpcSubscribe {
17
+ id: number | string;
18
+ method: 'subscribe';
19
+ params: {
20
+ events: string[];
21
+ /** Optional throttle in ms — batch rapid events within this window */
22
+ throttleMs?: number;
23
+ };
24
+ }
25
+ /** Unsubscribe from registry events */
26
+ export interface JsonRpcUnsubscribe {
27
+ id: number | string;
28
+ method: 'unsubscribe';
29
+ params: {
30
+ events: string[];
31
+ };
32
+ }
33
+ /** Any client message */
34
+ export type JsonRpcClientMessage = JsonRpcRequest | JsonRpcBatchRequest | JsonRpcSubscribe | JsonRpcUnsubscribe;
35
+ /** Standard JSON-RPC response */
36
+ export interface JsonRpcResponse {
37
+ id: number | string;
38
+ result?: {
39
+ success: boolean;
40
+ data?: unknown;
41
+ error?: string;
42
+ code?: string;
43
+ timestamp?: number;
44
+ };
45
+ }
46
+ /** Batch response */
47
+ export interface JsonRpcBatchResponse {
48
+ id: number | string;
49
+ results: JsonRpcResponse[];
50
+ }
51
+ /** Server-pushed event (no id — not a response to a request) */
52
+ export interface JsonRpcEvent {
53
+ event: string;
54
+ data: unknown;
55
+ timestamp: number;
56
+ }
57
+ /** Any server message */
58
+ export type JsonRpcServerMessage = JsonRpcResponse | JsonRpcBatchResponse | JsonRpcEvent;
59
+ /** Check if a message is a batch request */
60
+ export declare function isBatchRequest(msg: unknown): msg is JsonRpcBatchRequest;
61
+ /** Check if a message is a subscribe request */
62
+ export declare function isSubscribe(msg: unknown): msg is JsonRpcSubscribe;
63
+ /** Check if a message is an unsubscribe request */
64
+ export declare function isUnsubscribe(msg: unknown): msg is JsonRpcUnsubscribe;
65
+ //# sourceMappingURL=ws-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ws-types.d.ts","sourceRoot":"","sources":["../../src/server/ws-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,gCAAgC;AAChC,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,6DAA6D;AAC7D,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,KAAK,EAAE,cAAc,EAAE,CAAC;CACzB;AAED,mCAAmC;AACnC,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,MAAM,EAAE,WAAW,CAAC;IACpB,MAAM,EAAE;QACN,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,sEAAsE;QACtE,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAED,uCAAuC;AACvC,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,MAAM,EAAE,aAAa,CAAC;IACtB,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CAC9B;AAED,yBAAyB;AACzB,MAAM,MAAM,oBAAoB,GAC5B,cAAc,GACd,mBAAmB,GACnB,gBAAgB,GAChB,kBAAkB,CAAC;AAIvB,iCAAiC;AACjC,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE;QACP,OAAO,EAAE,OAAO,CAAC;QACjB,IAAI,CAAC,EAAE,OAAO,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH;AAED,qBAAqB;AACrB,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B;AAED,gEAAgE;AAChE,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,yBAAyB;AACzB,MAAM,MAAM,oBAAoB,GAAG,eAAe,GAAG,oBAAoB,GAAG,YAAY,CAAC;AAIzF,4CAA4C;AAC5C,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,mBAAmB,CAOvE;AAED,gDAAgD;AAChD,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,gBAAgB,CAIjE;AAED,mDAAmD;AACnD,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,kBAAkB,CAIrE"}
@@ -0,0 +1,2 @@
1
+ export { ToastCapture } from './toast-capture';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/toast/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,27 @@
1
+ import type { NativeCapturedToast, NativeSnapshotToastContext } from '../core/types';
2
+ export interface ToastRecordInput {
3
+ id: string;
4
+ message: string;
5
+ level?: NativeCapturedToast['level'];
6
+ appearedAt?: number;
7
+ }
8
+ export interface ToastCaptureConfig {
9
+ maxRecent?: number;
10
+ }
11
+ /**
12
+ * Declarative toast/snackbar tracker. Components call recordToast/dismissToast
13
+ * directly — there is no DOM/tree scanner. The active map plus a fixed-size
14
+ * recent ring buffer feed the snapshot's toasts context.
15
+ */
16
+ export declare class ToastCapture {
17
+ private active;
18
+ private recent;
19
+ private totalCaptured;
20
+ private maxRecent;
21
+ constructor(config?: ToastCaptureConfig);
22
+ recordToast(toast: ToastRecordInput): void;
23
+ dismissToast(id: string): void;
24
+ getSnapshotToastContext(): NativeSnapshotToastContext;
25
+ clear(): void;
26
+ }
27
+ //# sourceMappingURL=toast-capture.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toast-capture.d.ts","sourceRoot":"","sources":["../../src/toast/toast-capture.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAErF,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID;;;;GAIG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAA0C;IACxD,OAAO,CAAC,MAAM,CAA6B;IAC3C,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,SAAS,CAAS;gBAEd,MAAM,GAAE,kBAAuB;IAI3C,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI;IAiB1C,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAmB9B,uBAAuB,IAAI,0BAA0B;IAarD,KAAK,IAAI,IAAI;CAKd"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Cloud Relay Client — WebSocket tunnel from mobile device to backend
3
+ *
4
+ * Maintains a persistent WebSocket connection to the qontinui.io backend.
5
+ * Receives tunneled HTTP requests from runners, calls the local NativeUIBridgeServer,
6
+ * and sends responses back through the tunnel.
7
+ */
8
+ import type { NativeUIBridgeServer } from '../server/http-server';
9
+ export interface CloudRelayConfig {
10
+ /** WebSocket URL for the device bridge endpoint */
11
+ relayUrl: string;
12
+ /** Stable device identifier */
13
+ deviceId: string;
14
+ /** Authentication token */
15
+ authToken: string;
16
+ /** Reference to the local UI Bridge server for processing requests */
17
+ uiBridgeServer: NativeUIBridgeServer;
18
+ }
19
+ /**
20
+ * Manages a WebSocket tunnel from the mobile device to the qontinui.io backend.
21
+ *
22
+ * When a runner sends an HTTP request to a cloud device it is serialised as a
23
+ * `TunnelRequest` JSON frame by the backend and forwarded here. This client
24
+ * deserializes it, calls `NativeUIBridgeServer.handleRequest()` directly
25
+ * (avoiding loopback TCP overhead), and sends the `TunnelResponse` back.
26
+ */
27
+ export declare class CloudRelayClient {
28
+ private ws;
29
+ private config;
30
+ private reconnectDelay;
31
+ private maxReconnectDelay;
32
+ private stopped;
33
+ private _isConnected;
34
+ private reconnectTimer;
35
+ constructor(config: CloudRelayConfig);
36
+ /** Whether the relay WebSocket is currently connected */
37
+ get isConnected(): boolean;
38
+ /** Connect to the relay and start processing tunneled requests. */
39
+ start(): void;
40
+ /** Disconnect and stop reconnecting. */
41
+ stop(): void;
42
+ private connect;
43
+ private onMessage;
44
+ /**
45
+ * Process a tunneled HTTP request by calling the local NativeUIBridgeServer
46
+ * directly (no loopback TCP involved).
47
+ */
48
+ private handleTunneledRequest;
49
+ private scheduleReconnect;
50
+ }
51
+ //# sourceMappingURL=CloudRelayClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CloudRelayClient.d.ts","sourceRoot":"","sources":["../../src/transport/CloudRelayClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAGlE,MAAM,WAAW,gBAAgB;IAC/B,mDAAmD;IACnD,QAAQ,EAAE,MAAM,CAAC;IACjB,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,2BAA2B;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,sEAAsE;IACtE,cAAc,EAAE,oBAAoB,CAAC;CACtC;AAoBD;;;;;;;GAOG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,EAAE,CAA0B;IACpC,OAAO,CAAC,MAAM,CAAmB;IACjC,OAAO,CAAC,cAAc,CAA8B;IACpD,OAAO,CAAC,iBAAiB,CAA0B;IACnD,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,cAAc,CAA8C;gBAExD,MAAM,EAAE,gBAAgB;IAIpC,yDAAyD;IACzD,IAAI,WAAW,IAAI,OAAO,CAEzB;IAID,mEAAmE;IACnE,KAAK,IAAI,IAAI;IAKb,wCAAwC;IACxC,IAAI,IAAI,IAAI;IAkBZ,OAAO,CAAC,OAAO;YA8CD,SAAS;IAsCvB;;;OAGG;YACW,qBAAqB;IAuCnC,OAAO,CAAC,iBAAiB;CAY1B"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Device Announcer — mDNS + Cloud registration for physical device discovery
3
+ *
4
+ * Announces the UI Bridge service on the local network via mDNS (when
5
+ * react-native-zeroconf is available) and optionally registers with the
6
+ * cloud relay backend.
7
+ */
8
+ export interface AnnouncerConfig {
9
+ /** Stable device identifier */
10
+ deviceId: string;
11
+ /** App bundle/package ID */
12
+ appId: string;
13
+ /** UI Bridge server port (default 8087) */
14
+ port?: number;
15
+ /** Cloud relay WebSocket URL for registration */
16
+ cloudRelayUrl?: string;
17
+ /** Auth token for cloud relay */
18
+ cloudToken?: string;
19
+ /** UI Bridge SDK version */
20
+ version?: string;
21
+ }
22
+ export interface DeviceAnnouncerState {
23
+ mdnsActive: boolean;
24
+ cloudConnected: boolean;
25
+ }
26
+ /** Minimal interface for the react-native-zeroconf Zeroconf instance */
27
+ interface ZeroconfService {
28
+ publishService(type: string, protocol: string, domain: string, name: string, port: number, txtRecord: Record<string, string>): void;
29
+ unpublishService(name: string): void;
30
+ }
31
+ /**
32
+ * Announces the UI Bridge server on the local network (mDNS) and optionally
33
+ * registers with the qontinui.io cloud relay for remote discovery.
34
+ */
35
+ export declare class DeviceAnnouncer {
36
+ private config;
37
+ private state;
38
+ private cloudWs;
39
+ private reconnectTimer;
40
+ private reconnectDelay;
41
+ private stopped;
42
+ /** Zeroconf instance, set when mDNS is successfully started */
43
+ private zeroconf;
44
+ /** Rotated pairing token for mDNS TXT records */
45
+ private pairingToken;
46
+ constructor(config: AnnouncerConfig);
47
+ /**
48
+ * Start mDNS advertisement.
49
+ *
50
+ * The consumer must pass the `Zeroconf` constructor (from `react-native-zeroconf`)
51
+ * explicitly; otherwise this is a no-op.
52
+ *
53
+ * Rationale: Metro's `require()` throws an uncatchable module-load error if the
54
+ * bundle doesn't include the named package. That error escapes async try/catch
55
+ * boundaries and crashes the app. We avoid it by never calling `require()`
56
+ * ourselves — the consumer imports the package when they know it's installed.
57
+ *
58
+ * @param ZeroconfCtor - constructor from `import Zeroconf from 'react-native-zeroconf'`
59
+ */
60
+ startMdnsAdvertise(ZeroconfCtor?: new () => ZeroconfService): Promise<void>;
61
+ /**
62
+ * Connect to the cloud relay WebSocket and send a device_register message.
63
+ *
64
+ * Reconnects automatically with exponential backoff (2 s → 60 s) if the
65
+ * connection drops.
66
+ */
67
+ connectCloudRelay(): Promise<void>;
68
+ /** Stop all advertising and registration. */
69
+ stop(): Promise<void>;
70
+ /** Return a copy of the current announcer state. */
71
+ getState(): DeviceAnnouncerState;
72
+ private scheduleReconnect;
73
+ }
74
+ export {};
75
+ //# sourceMappingURL=DeviceAnnouncer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeviceAnnouncer.d.ts","sourceRoot":"","sources":["../../src/transport/DeviceAnnouncer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,MAAM,WAAW,eAAe;IAC9B,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iCAAiC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4BAA4B;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,wEAAwE;AACxE,UAAU,eAAe;IACvB,cAAc,CACZ,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAChC,IAAI,CAAC;IACR,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC;AAYD;;;GAGG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAA0E;IACxF,OAAO,CAAC,KAAK,CAGX;IACF,OAAO,CAAC,OAAO,CAA0B;IACzC,OAAO,CAAC,cAAc,CAA8C;IACpE,OAAO,CAAC,cAAc,CAA8B;IACpD,OAAO,CAAC,OAAO,CAAS;IACxB,+DAA+D;IAC/D,OAAO,CAAC,QAAQ,CAAgC;IAChD,iDAAiD;IACjD,OAAO,CAAC,YAAY,CAAS;gBAEjB,MAAM,EAAE,eAAe;IAOnC;;;;;;;;;;;;OAYG;IACG,kBAAkB,CAAC,YAAY,CAAC,EAAE,UAAU,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IA8BjF;;;;;OAKG;IACG,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IA4DxC,6CAA6C;IACvC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IA8B3B,oDAAoD;IACpD,QAAQ,IAAI,oBAAoB;IAMhC,OAAO,CAAC,iBAAiB;CAa1B"}
@@ -0,0 +1,3 @@
1
+ export { DeviceAnnouncer, type AnnouncerConfig, type DeviceAnnouncerState, } from './DeviceAnnouncer';
2
+ export { CloudRelayClient, type CloudRelayConfig } from './CloudRelayClient';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transport/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,KAAK,eAAe,EACpB,KAAK,oBAAoB,GAC1B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Minimal logger for the UI Bridge Native transport layer.
3
+ *
4
+ * Wraps console so callers go through a single controlled point. Log output
5
+ * can be suppressed globally by setting:
6
+ *
7
+ * import { transportLogger } from './logger';
8
+ * transportLogger.silent = true;
9
+ *
10
+ * In production builds you can also tree-shake the verbose log() calls by
11
+ * checking `__DEV__` in your Metro bundler config, but the silent flag is
12
+ * simpler and works without build-time configuration.
13
+ */
14
+ export interface TransportLogger {
15
+ log(message: string, ...args: unknown[]): void;
16
+ warn(message: string, ...args: unknown[]): void;
17
+ error(message: string, ...args: unknown[]): void;
18
+ /** Set to true to suppress all log output (warn/error are always emitted). */
19
+ silent: boolean;
20
+ }
21
+ /** Shared logger instance for the transport layer. */
22
+ export declare const transportLogger: TransportLogger;
23
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/transport/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,eAAe;IAC9B,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAC/C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAChD,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACjD,8EAA8E;IAC9E,MAAM,EAAE,OAAO,CAAC;CACjB;AAmBD,sDAAsD;AACtD,eAAO,MAAM,eAAe,iBAA0B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { UndoTracker } from './undo-tracker';
2
+ export type { ActionRecord, DeclaredUndoState, UndoTrackerConfig } from './undo-tracker';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/undo/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,59 @@
1
+ import type { NativeSnapshotUndoContext } from '../core/types';
2
+ /**
3
+ * A single bridge action recorded for undo correlation. Action-correlation
4
+ * only — RN has no DOM/execCommand probe, so we rely on developer
5
+ * declaration plus this rolling history of recent actions.
6
+ */
7
+ export interface ActionRecord {
8
+ id: string;
9
+ type: string;
10
+ targetId?: string;
11
+ description?: string;
12
+ timestamp: number;
13
+ /** Default true — set false for actions that aren't reversible (e.g. navigation, network calls) */
14
+ reversible?: boolean;
15
+ }
16
+ /**
17
+ * Developer-declared undo/redo state. When set, this is authoritative and
18
+ * overrides any heuristic inference from action history.
19
+ */
20
+ export interface DeclaredUndoState {
21
+ canUndo: boolean;
22
+ canRedo: boolean;
23
+ undoDescription?: string;
24
+ redoDescription?: string;
25
+ undoDepth?: number;
26
+ redoDepth?: number;
27
+ }
28
+ export interface UndoTrackerConfig {
29
+ maxHistory?: number;
30
+ }
31
+ /**
32
+ * Action-correlation undo tracker for React Native.
33
+ *
34
+ * Maintains a rolling buffer of recent actions and a developer-declared
35
+ * undo state slot. The declared state is authoritative when set; otherwise
36
+ * we infer `canUndo` from whether any reversible action has been recorded.
37
+ * `executeUndo`/`executeRedo` are placeholders pending an IPC path through
38
+ * ui-bridge-native to the runner's `/control/undo`.
39
+ */
40
+ export declare class UndoTracker {
41
+ private readonly maxHistory;
42
+ private actions;
43
+ private declaredState;
44
+ constructor(config?: UndoTrackerConfig);
45
+ recordAction(record: ActionRecord): void;
46
+ setDeclaredState(state: DeclaredUndoState): void;
47
+ getActionHistory(): ActionRecord[];
48
+ getSnapshotUndoContext(): NativeSnapshotUndoContext;
49
+ executeUndo(): {
50
+ ok: boolean;
51
+ reason?: string;
52
+ };
53
+ executeRedo(): {
54
+ ok: boolean;
55
+ reason?: string;
56
+ };
57
+ clear(): void;
58
+ }
59
+ //# sourceMappingURL=undo-tracker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"undo-tracker.d.ts","sourceRoot":"","sources":["../../src/undo/undo-tracker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAE/D;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,mGAAmG;IACnG,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAuBD;;;;;;;;GAQG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,OAAO,CAAsB;IACrC,OAAO,CAAC,aAAa,CAAkC;gBAE3C,MAAM,GAAE,iBAAsB;IAI1C,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;IAOxC,gBAAgB,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI;IAIhD,gBAAgB,IAAI,YAAY,EAAE;IAIlC,sBAAsB,IAAI,yBAAyB;IAkCnD,WAAW,IAAI;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;IAI/C,WAAW,IAAI;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;IAI/C,KAAK,IAAI,IAAI;CAId"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qontinui/ui-bridge-native",
3
- "version": "0.3.2",
3
+ "version": "0.5.1",
4
4
  "description": "UI Bridge Framework for React Native - Hooks and providers for UI observation and control in mobile apps",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -47,7 +47,7 @@
47
47
  "README.md"
48
48
  ],
49
49
  "scripts": {
50
- "build": "tsup",
50
+ "build": "tsup && tsc -p tsconfig.build.json",
51
51
  "dev": "tsup --watch",
52
52
  "test": "vitest run",
53
53
  "typecheck": "tsc --noEmit",
@@ -55,7 +55,7 @@
55
55
  "format": "prettier --write \"src/**/*.{ts,tsx}\""
56
56
  },
57
57
  "peerDependencies": {
58
- "@qontinui/ui-bridge": ">=0.3.0",
58
+ "@qontinui/ui-bridge": ">=0.4.0",
59
59
  "react": "^18.0.0 || ^19.0.0",
60
60
  "react-native": ">=0.70.0"
61
61
  },