@deepseek-ai/dsh-experimental-inspector 0.1.6-alpha.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 (156) hide show
  1. package/LICENSE +21 -0
  2. package/README.i18n.yaml +6 -0
  3. package/README.md +156 -0
  4. package/README.zh.md +156 -0
  5. package/lib/client.js +3424 -0
  6. package/lib/index.js +2406 -0
  7. package/lib/types/client/bridge/controller.d.ts +10 -0
  8. package/lib/types/client/bridge/dispatcher.d.ts +26 -0
  9. package/lib/types/client/bridge/lifecycle.d.ts +20 -0
  10. package/lib/types/client/bridge/publisher.d.ts +42 -0
  11. package/lib/types/client/bridge/rpc.d.ts +13 -0
  12. package/lib/types/client/bridge/transport.d.ts +34 -0
  13. package/lib/types/client/cdp/console.d.ts +45 -0
  14. package/lib/types/client/cdp/debugger.d.ts +8 -0
  15. package/lib/types/client/cdp/errors.d.ts +8 -0
  16. package/lib/types/client/cdp/heap-profiler.d.ts +8 -0
  17. package/lib/types/client/cdp/index.d.ts +10 -0
  18. package/lib/types/client/cdp/objects.d.ts +69 -0
  19. package/lib/types/client/cdp/profiler.d.ts +8 -0
  20. package/lib/types/client/cdp/properties.d.ts +16 -0
  21. package/lib/types/client/cdp/runtime.d.ts +79 -0
  22. package/lib/types/client/cdp/sources.d.ts +52 -0
  23. package/lib/types/client/cdp/stack.d.ts +27 -0
  24. package/lib/types/client/index.d.ts +3 -0
  25. package/lib/types/client/inspection/cordis.d.ts +3 -0
  26. package/lib/types/client/inspection/network.d.ts +4 -0
  27. package/lib/types/client/inspection/realm.d.ts +27 -0
  28. package/lib/types/client/plugin.d.ts +28 -0
  29. package/lib/types/host/bridge/controller.d.ts +108 -0
  30. package/lib/types/host/bridge/dispatcher.d.ts +16 -0
  31. package/lib/types/host/bridge/lifecycle.d.ts +42 -0
  32. package/lib/types/host/bridge/publisher.d.ts +31 -0
  33. package/lib/types/host/bridge/rpc.d.ts +15 -0
  34. package/lib/types/host/bridge/transport.d.ts +28 -0
  35. package/lib/types/host/cdp/console.d.ts +14 -0
  36. package/lib/types/host/cdp/debugger.d.ts +8 -0
  37. package/lib/types/host/cdp/errors.d.ts +6 -0
  38. package/lib/types/host/cdp/heap-profiler.d.ts +8 -0
  39. package/lib/types/host/cdp/index.d.ts +10 -0
  40. package/lib/types/host/cdp/objects.d.ts +8 -0
  41. package/lib/types/host/cdp/profiler.d.ts +8 -0
  42. package/lib/types/host/cdp/properties.d.ts +7 -0
  43. package/lib/types/host/cdp/runtime.d.ts +16 -0
  44. package/lib/types/host/cdp/sources.d.ts +14 -0
  45. package/lib/types/host/cdp/stack.d.ts +4 -0
  46. package/lib/types/host/index.d.ts +3 -0
  47. package/lib/types/host/inspection/cordis.d.ts +3 -0
  48. package/lib/types/host/inspection/network.d.ts +23 -0
  49. package/lib/types/host/inspection/realm.d.ts +9 -0
  50. package/lib/types/host/plugin.d.ts +19 -0
  51. package/lib/types/index.d.ts +50 -0
  52. package/lib/types/shared/bridge/buffer.d.ts +62 -0
  53. package/lib/types/shared/bridge/codec.d.ts +4 -0
  54. package/lib/types/shared/bridge/control-codec.d.ts +27 -0
  55. package/lib/types/shared/bridge/ids.d.ts +19 -0
  56. package/lib/types/shared/bridge/messages/control.d.ts +64 -0
  57. package/lib/types/shared/bridge/messages/cordis.d.ts +4 -0
  58. package/lib/types/shared/bridge/messages/network.d.ts +4 -0
  59. package/lib/types/shared/bridge/messages/observation.d.ts +110 -0
  60. package/lib/types/shared/bridge/messages/query/codec.d.ts +40 -0
  61. package/lib/types/shared/bridge/messages/query/commands.d.ts +35 -0
  62. package/lib/types/shared/bridge/messages/query/frames.d.ts +31 -0
  63. package/lib/types/shared/bridge/messages/query/index.d.ts +5 -0
  64. package/lib/types/shared/bridge/messages/runtime/command-codec.d.ts +9 -0
  65. package/lib/types/shared/bridge/messages/runtime/commands.d.ts +76 -0
  66. package/lib/types/shared/bridge/messages/runtime/console-frames.d.ts +52 -0
  67. package/lib/types/shared/bridge/messages/runtime/frames.d.ts +98 -0
  68. package/lib/types/shared/bridge/messages/runtime/index.d.ts +5 -0
  69. package/lib/types/shared/bridge/messages/runtime/value-codec.d.ts +28 -0
  70. package/lib/types/shared/bridge/messages/sources/codec.d.ts +15 -0
  71. package/lib/types/shared/bridge/messages/sources/commands.d.ts +42 -0
  72. package/lib/types/shared/bridge/messages/sources/frames.d.ts +67 -0
  73. package/lib/types/shared/bridge/messages/sources/index.d.ts +5 -0
  74. package/lib/types/shared/bridge/publisher.d.ts +33 -0
  75. package/lib/types/shared/bridge/query-reader.d.ts +10 -0
  76. package/lib/types/shared/bridge/rpc.d.ts +62 -0
  77. package/lib/types/shared/bridge/validation.d.ts +3 -0
  78. package/lib/types/shared/bridge/version.d.ts +3 -0
  79. package/lib/types/shared/cdp/capabilities.d.ts +17 -0
  80. package/lib/types/shared/cdp/console.d.ts +28 -0
  81. package/lib/types/shared/cdp/debugger.d.ts +69 -0
  82. package/lib/types/shared/cdp/errors.d.ts +27 -0
  83. package/lib/types/shared/cdp/ids.d.ts +9 -0
  84. package/lib/types/shared/cdp/index.d.ts +11 -0
  85. package/lib/types/shared/cdp/operations.d.ts +86 -0
  86. package/lib/types/shared/cdp/property.d.ts +28 -0
  87. package/lib/types/shared/cdp/realm.d.ts +137 -0
  88. package/lib/types/shared/cdp/remote-object.d.ts +44 -0
  89. package/lib/types/shared/cdp/sources.d.ts +18 -0
  90. package/lib/types/shared/cordis/collector.d.ts +26 -0
  91. package/lib/types/shared/cordis/ids.d.ts +7 -0
  92. package/lib/types/shared/cordis/model.d.ts +61 -0
  93. package/lib/types/shared/cordis/object-reference.d.ts +14 -0
  94. package/lib/types/shared/cordis/object-registry.d.ts +80 -0
  95. package/lib/types/shared/cordis/observer.d.ts +15 -0
  96. package/lib/types/shared/cordis/projector.d.ts +34 -0
  97. package/lib/types/shared/cordis/publisher.d.ts +13 -0
  98. package/lib/types/shared/cordis/reader.d.ts +18 -0
  99. package/lib/types/shared/cordis/snapshot.d.ts +39 -0
  100. package/lib/types/shared/identity.d.ts +12 -0
  101. package/lib/types/shared/index.d.ts +18 -0
  102. package/lib/types/shared/json.d.ts +35 -0
  103. package/lib/types/shared/network/event-source.d.ts +20 -0
  104. package/lib/types/shared/network/observation.d.ts +52 -0
  105. package/lib/types/shared/service.d.ts +23 -0
  106. package/lib/types/shared/validation.d.ts +52 -0
  107. package/lib/types/worker/bridge/endpoint.d.ts +49 -0
  108. package/lib/types/worker/bridge/hub.d.ts +108 -0
  109. package/lib/types/worker/bridge/runtime-rpc.d.ts +90 -0
  110. package/lib/types/worker/bridge/session.d.ts +15 -0
  111. package/lib/types/worker/bridge/source-rpc.d.ts +42 -0
  112. package/lib/types/worker/cdp/domains/debugger/cdp-params.d.ts +15 -0
  113. package/lib/types/worker/cdp/domains/debugger/index.d.ts +6 -0
  114. package/lib/types/worker/cdp/domains/debugger/projector.d.ts +22 -0
  115. package/lib/types/worker/cdp/domains/debugger/script-registry.d.ts +70 -0
  116. package/lib/types/worker/cdp/domains/debugger/session.d.ts +47 -0
  117. package/lib/types/worker/cdp/domains/dom/index.d.ts +4 -0
  118. package/lib/types/worker/cdp/domains/dom/model.d.ts +108 -0
  119. package/lib/types/worker/cdp/domains/dom/session.d.ts +74 -0
  120. package/lib/types/worker/cdp/domains/native.d.ts +25 -0
  121. package/lib/types/worker/cdp/domains/network/session.d.ts +46 -0
  122. package/lib/types/worker/cdp/domains/runtime/cdp-params.d.ts +82 -0
  123. package/lib/types/worker/cdp/domains/runtime/index.d.ts +3 -0
  124. package/lib/types/worker/cdp/domains/runtime/object-table.d.ts +117 -0
  125. package/lib/types/worker/cdp/domains/runtime/session.d.ts +97 -0
  126. package/lib/types/worker/cdp/ids.d.ts +37 -0
  127. package/lib/types/worker/cdp/protocol.d.ts +46 -0
  128. package/lib/types/worker/cdp/realm-sessions.d.ts +64 -0
  129. package/lib/types/worker/cdp/session.d.ts +34 -0
  130. package/lib/types/worker/cdp/target.d.ts +17 -0
  131. package/lib/types/worker/entry.d.ts +3 -0
  132. package/lib/types/worker/inspection/cordis-query.d.ts +11 -0
  133. package/lib/types/worker/inspection/cordis-store.d.ts +94 -0
  134. package/lib/types/worker/inspection/network-store.d.ts +110 -0
  135. package/lib/types/worker/inspection/query-router.d.ts +78 -0
  136. package/lib/types/worker/inspection/realm-store.d.ts +58 -0
  137. package/lib/types/worker/inspection/realm.d.ts +43 -0
  138. package/lib/types/worker/realms/client/bridge.d.ts +18 -0
  139. package/lib/types/worker/realms/client/console.d.ts +21 -0
  140. package/lib/types/worker/realms/client/debugger.d.ts +8 -0
  141. package/lib/types/worker/realms/client/index.d.ts +18 -0
  142. package/lib/types/worker/realms/client/runtime.d.ts +28 -0
  143. package/lib/types/worker/realms/client/scripts.d.ts +15 -0
  144. package/lib/types/worker/realms/client/sources.d.ts +30 -0
  145. package/lib/types/worker/realms/client/values.d.ts +55 -0
  146. package/lib/types/worker/realms/host/bridge.d.ts +49 -0
  147. package/lib/types/worker/realms/host/console.d.ts +25 -0
  148. package/lib/types/worker/realms/host/debugger.d.ts +25 -0
  149. package/lib/types/worker/realms/host/index.d.ts +13 -0
  150. package/lib/types/worker/realms/host/runtime.d.ts +54 -0
  151. package/lib/types/worker/realms/host/scripts.d.ts +9 -0
  152. package/lib/types/worker/realms/host/sources.d.ts +26 -0
  153. package/lib/types/worker/realms/host/values.d.ts +22 -0
  154. package/lib/types/worker/server.d.ts +16 -0
  155. package/lib/worker.js +7184 -0
  156. package/package.json +64 -0
@@ -0,0 +1,10 @@
1
+ /** Browser Client bridge construction for the Cordis plugin entry. */
2
+ import type { InspectorClientBootstrap } from '../../shared/bridge/messages/control.ts';
3
+ import { ClientInspectorSource } from './transport.ts';
4
+ /**
5
+ * Start the browser source transport for one validated Host bootstrap.
6
+ * @param bootstrap - Host-injected endpoint and resource limits.
7
+ * @returns The active reconnecting Client source after its tab identity is claimed.
8
+ */
9
+ export declare function startInspectorClient(bootstrap: InspectorClientBootstrap): Promise<ClientInspectorSource>;
10
+ //# sourceMappingURL=controller.d.ts.map
@@ -0,0 +1,26 @@
1
+ /** Dispatch of validated Worker frames to browser-realm capability handlers. */
2
+ import type { ClientConsoleDisableFrame, ClientConsoleEnableFrame, ClientRuntimeCancelFrame, ClientRuntimeRequestFrame, ClientRuntimeResponseAcknowledgedFrame, ClientRuntimeSessionClosedFrame } from '../../shared/bridge/messages/runtime/index.ts';
3
+ import type { ClientSourceRequestFrame, ClientSourceSessionClosedFrame } from '../../shared/bridge/messages/sources/index.ts';
4
+ import type { SourceAcceptedFrame, SourceAppendAcknowledgedFrame, SourceRejectedFrame, SourceResnapshotFrame, WorkerToSourceFrame } from '../../shared/bridge/messages/observation.ts';
5
+ /** Operations invoked for each Worker-to-Client frame family. */
6
+ export interface ClientBridgeFrameHandlers {
7
+ accepted(frame: SourceAcceptedFrame): void;
8
+ acknowledged(frame: SourceAppendAcknowledgedFrame): void;
9
+ resnapshot(frame: SourceResnapshotFrame): void;
10
+ rejected(frame: SourceRejectedFrame): void;
11
+ runtime(frame: ClientRuntimeRequestFrame): void;
12
+ runtimeCanceled(frame: ClientRuntimeCancelFrame): void;
13
+ runtimeAcknowledged(frame: ClientRuntimeResponseAcknowledgedFrame): void;
14
+ runtimeClosed(frame: ClientRuntimeSessionClosedFrame): void;
15
+ consoleEnabled(frame: ClientConsoleEnableFrame): void;
16
+ consoleDisabled(frame: ClientConsoleDisableFrame): void;
17
+ sources(frame: ClientSourceRequestFrame): void;
18
+ sourcesClosed(frame: ClientSourceSessionClosedFrame): void;
19
+ }
20
+ /**
21
+ * Dispatch one validated Worker frame without exposing transport details to domain adapters.
22
+ * @param frame - Decoded Worker-to-source frame.
23
+ * @param handlers - Browser-realm operations for each frame family.
24
+ */
25
+ export declare function dispatchBridgeFrame(frame: WorkerToSourceFrame, handlers: ClientBridgeFrameHandlers): void;
26
+ //# sourceMappingURL=dispatcher.d.ts.map
@@ -0,0 +1,20 @@
1
+ /** Reconnection lifecycle for the browser Client bridge. */
2
+ /** Owns one bounded-backoff timer and prevents reconnection after disposal. */
3
+ export declare class ClientBridgeLifecycle {
4
+ private readonly baseDelayMs;
5
+ private readonly maxDelayMs;
6
+ private reconnectAttempt;
7
+ private reconnectTimer;
8
+ private closed;
9
+ constructor(baseDelayMs: number, maxDelayMs: number);
10
+ /** Reset backoff after the Worker accepts a source generation. */
11
+ connected(): void;
12
+ /**
13
+ * Schedule the next reconnect attempt unless one is already pending.
14
+ * @param connect - Operation that opens the next transport generation.
15
+ */
16
+ reconnect(connect: () => void): void;
17
+ /** Stop pending and future reconnect attempts. */
18
+ close(): void;
19
+ }
20
+ //# sourceMappingURL=lifecycle.d.ts.map
@@ -0,0 +1,42 @@
1
+ /** Buffered Client observation publication across reconnecting WebSockets. */
2
+ import { type InspectorSourceBufferOptions } from '../../shared/bridge/buffer.ts';
3
+ import type { InspectorJsonValue } from '../../shared/json.ts';
4
+ import type { InspectorStatePublisher } from '../../shared/bridge/publisher.ts';
5
+ import type { InspectorSourceDescriptor } from '../../shared/bridge/messages/observation.ts';
6
+ /** Non-blocking Client publisher whose bounded state survives transport reconnects. */
7
+ export declare class ClientBridgePublisher implements InspectorStatePublisher {
8
+ private readonly maxBufferedBytes;
9
+ private readonly records;
10
+ private active;
11
+ private flushTimer;
12
+ private closed;
13
+ constructor(options: InspectorSourceBufferOptions, maxBufferedBytes: number);
14
+ publish(topic: string, payload: InspectorJsonValue, monotonicMs?: number): void;
15
+ setState(topic: string, payload: InspectorJsonValue, monotonicMs?: number): void;
16
+ /**
17
+ * Install one unopened transport generation.
18
+ * @param socket - WebSocket carrying the generation.
19
+ * @param source - Source identity and generation sent by the socket.
20
+ */
21
+ connect(socket: WebSocket, source: InspectorSourceDescriptor): void;
22
+ /**
23
+ * Send retained state and queued observations after Worker acceptance.
24
+ * @param socket - Accepted active WebSocket.
25
+ */
26
+ accept(socket: WebSocket): void;
27
+ /**
28
+ * Resend retained state for the active generation.
29
+ * @param socket - WebSocket that received the resnapshot request.
30
+ */
31
+ replace(socket: WebSocket): void;
32
+ /**
33
+ * Forget one closed transport while retaining buffered state for reconnect.
34
+ * @param socket - WebSocket whose close event fired.
35
+ */
36
+ disconnect(socket: WebSocket): void;
37
+ /** Stop delayed writes and reject later publication. */
38
+ close(): void;
39
+ private flush;
40
+ private scheduleFlush;
41
+ }
42
+ //# sourceMappingURL=publisher.d.ts.map
@@ -0,0 +1,13 @@
1
+ /** Client-side non-CDP query bridge over the active Worker WebSocket. */
2
+ import type { InspectorSourceDescriptor } from '../../shared/bridge/messages/observation.ts';
3
+ import { InspectorQueryConnection } from '../../shared/bridge/rpc.ts';
4
+ /** Owns query correlation across reconnecting Client source generations. */
5
+ export declare class ClientBridgeRpc extends InspectorQueryConnection {
6
+ /**
7
+ * Connect query writes to one accepted Client WebSocket generation.
8
+ * @param source - Accepted source descriptor.
9
+ * @param socket - Active source WebSocket.
10
+ */
11
+ connectSocket(source: InspectorSourceDescriptor, socket: WebSocket): void;
12
+ }
13
+ //# sourceMappingURL=rpc.d.ts.map
@@ -0,0 +1,34 @@
1
+ /** Client observation and Runtime endpoint over the Inspector Worker's ingest WebSocket. */
2
+ import type { InspectorClientBootstrap } from '../../shared/bridge/messages/control.ts';
3
+ import { InspectorSourceConnection } from '../../shared/bridge/publisher.ts';
4
+ import { ClientSourceCatalog } from '../cdp/sources.ts';
5
+ import { ClientRealmSource } from '../inspection/realm.ts';
6
+ import { ClientBridgePublisher } from './publisher.ts';
7
+ import { ClientBridgeRpc } from './rpc.ts';
8
+ /** Reconnecting Client source whose bounded queue never blocks page work. */
9
+ export declare class ClientInspectorSource extends InspectorSourceConnection {
10
+ private readonly bootstrap;
11
+ private readonly sourceCatalog;
12
+ private readonly realmSource;
13
+ protected readonly publisher: ClientBridgePublisher;
14
+ private socket;
15
+ private generation;
16
+ private accepted;
17
+ private closed;
18
+ private readonly runtime;
19
+ private readonly runtimeRequests;
20
+ private readonly console;
21
+ protected readonly queries: ClientBridgeRpc;
22
+ private readonly lifecycle;
23
+ constructor(bootstrap: InspectorClientBootstrap, label?: string, sourceCatalog?: ClientSourceCatalog | undefined, realmSource?: ClientRealmSource);
24
+ /** Permanently stop reconnecting and close the active source generation. */
25
+ close(): void;
26
+ private connect;
27
+ private executeRuntime;
28
+ private acknowledgeRuntime;
29
+ private cancelRuntime;
30
+ private cancelRuntimeSession;
31
+ private cancelRuntimeRequests;
32
+ private executeSourceRequest;
33
+ }
34
+ //# sourceMappingURL=transport.d.ts.map
@@ -0,0 +1,45 @@
1
+ /** Client Console observation shared by every active DevTools Runtime session. */
2
+ import type { ClientRemoteObjectHandle, ClientRuntimeSessionId } from '../../shared/bridge/ids.ts';
3
+ import type { ClientConsoleCapability } from '../../shared/bridge/messages/runtime/index.ts';
4
+ import type { RuntimeConsoleBackendEvent } from '../../shared/cdp/index.ts';
5
+ import type { ClientRuntimeExecutor } from './runtime.ts';
6
+ import { type ClientScriptKeyResolver } from './stack.ts';
7
+ /**
8
+ * Describe browser-side Console observation.
9
+ * @returns The Console capability advertised by a browser Client source.
10
+ */
11
+ export declare function consoleBridgeCapability(): ClientConsoleCapability;
12
+ /** Receives one Console event whose object handles belong to the given session. */
13
+ export type ClientConsoleSink = (sessionId: ClientRuntimeSessionId, event: RuntimeConsoleBackendEvent<ClientRemoteObjectHandle>) => void;
14
+ /** Installs one transparent console/error observer and fans out session-local values. */
15
+ export declare class ClientConsoleObserver {
16
+ private readonly runtime;
17
+ private readonly sink;
18
+ private readonly resolveScript;
19
+ private readonly sessions;
20
+ private readonly installed;
21
+ private active;
22
+ private closed;
23
+ constructor(runtime: ClientRuntimeExecutor, sink: ClientConsoleSink, resolveScript?: ClientScriptKeyResolver);
24
+ /**
25
+ * Start producing events for one DevTools Runtime session.
26
+ * @param sessionId - Session whose object table retains event arguments.
27
+ */
28
+ enable(sessionId: ClientRuntimeSessionId): void;
29
+ /**
30
+ * Stop producing events and release Console objects for one session.
31
+ * @param sessionId - Session being disabled or closed.
32
+ */
33
+ disable(sessionId: ClientRuntimeSessionId): void;
34
+ /** Restore original browser hooks and clear every active session. */
35
+ close(): void;
36
+ /** Stop observing the current source generation while allowing a later reconnect. */
37
+ reset(): void;
38
+ private install;
39
+ private uninstall;
40
+ private readonly onError;
41
+ private readonly onUnhandledRejection;
42
+ private captureConsole;
43
+ private captureException;
44
+ }
45
+ //# sourceMappingURL=console.d.ts.map
@@ -0,0 +1,8 @@
1
+ /** Client active debugging is not exposed by the source bridge. */
2
+ import type { InspectorSourceCapability } from '../../shared/bridge/messages/observation.ts';
3
+ /**
4
+ * Describe unavailable browser-side active debugging.
5
+ * @returns No source capability until a pause-safe Client debugger agent exists.
6
+ */
7
+ export declare function debuggerBridgeCapability(): InspectorSourceCapability | undefined;
8
+ //# sourceMappingURL=debugger.d.ts.map
@@ -0,0 +1,8 @@
1
+ /** Client Runtime failures that belong to the transport rather than evaluated JavaScript. */
2
+ import type { ClientRuntimeError } from '../../shared/bridge/messages/runtime/index.ts';
3
+ /** Failure returned through the typed Client Runtime error outcome. */
4
+ export declare class ClientRuntimeExecutionError extends Error {
5
+ readonly code: ClientRuntimeError['code'];
6
+ constructor(code: ClientRuntimeError['code'], message: string);
7
+ }
8
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1,8 @@
1
+ /** Client heap profiling is not exposed by the source bridge. */
2
+ import type { InspectorSourceCapability } from '../../shared/bridge/messages/observation.ts';
3
+ /**
4
+ * Describe unavailable browser-side heap profiling.
5
+ * @returns No source capability for Client heap profiling.
6
+ */
7
+ export declare function heapProfilerBridgeCapability(): InspectorSourceCapability | undefined;
8
+ //# sourceMappingURL=heap-profiler.d.ts.map
@@ -0,0 +1,10 @@
1
+ /** Source-side CDP capability declarations for the browser Client realm. */
2
+ import type { InspectorSourceCapability } from '../../shared/bridge/messages/observation.ts';
3
+ /**
4
+ * Describe Client operations that require Worker-to-page bridge messages.
5
+ * @param origin - Origin assigned to the synthetic execution context.
6
+ * @param hasSources - Whether the Client bundle source was discovered.
7
+ * @returns Capabilities included in the Client source handshake.
8
+ */
9
+ export declare function bridgeCapabilities(origin: string, hasSources: boolean): readonly InspectorSourceCapability[];
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,69 @@
1
+ /** Client-local object handles and CDP-compatible RemoteObject serialization. */
2
+ import { type ClientRemoteObjectHandle } from '../../shared/bridge/ids.ts';
3
+ import type { ClientRuntimeRemoteObject } from '../../shared/bridge/messages/runtime/index.ts';
4
+ /** Opaque set of handles allocated by one Client Runtime operation. */
5
+ export type ClientObjectAllocation = symbol;
6
+ /** Serialization choices inherited by child RemoteObjects. */
7
+ export interface ClientRuntimeObjectOptions {
8
+ readonly group?: string;
9
+ readonly generatePreview?: boolean;
10
+ readonly returnByValue?: boolean;
11
+ }
12
+ /** Per-DevTools-session owner of all live Client object references. */
13
+ export declare class ClientObjectStore {
14
+ private readonly maxObjects;
15
+ private readonly objects;
16
+ private readonly groups;
17
+ private readonly allocations;
18
+ private nextOrdinal;
19
+ constructor(maxObjects: number);
20
+ /**
21
+ * Start tracking handles allocated by one independently settling operation.
22
+ * @returns An opaque allocation identity.
23
+ */
24
+ beginAllocation(): ClientObjectAllocation;
25
+ /**
26
+ * Keep an operation's handles and release its allocation bookkeeping.
27
+ * @param allocation - Allocation returned by {@link beginAllocation}.
28
+ */
29
+ commitAllocation(allocation: ClientObjectAllocation): void;
30
+ /**
31
+ * Resolve one handle or fail without exposing another session's objects.
32
+ * @param handle - Client-local object handle.
33
+ * @returns The retained JavaScript value.
34
+ */
35
+ get(handle: ClientRemoteObjectHandle): unknown;
36
+ /**
37
+ * Read the object group inherited by values reached through one handle.
38
+ * @param handle - Client-local object handle.
39
+ * @returns Its object group, or `undefined` when it is ungrouped.
40
+ */
41
+ group(handle: ClientRemoteObjectHandle): string | undefined;
42
+ /**
43
+ * Convert a live value to the JSON-safe RemoteObject protocol.
44
+ * @param value - Value owned by this Client realm.
45
+ * @param options - Object group and serialization options.
46
+ * @param allocation - Optional operation that owns any newly retained handle.
47
+ * @returns A primitive value or opaque Client handle with display metadata.
48
+ */
49
+ serialize(value: unknown, options?: ClientRuntimeObjectOptions, allocation?: ClientObjectAllocation): ClientRuntimeRemoteObject;
50
+ /**
51
+ * Release exactly one handle. Releasing an unknown handle is idempotent.
52
+ * @param handle - Client-local object handle.
53
+ */
54
+ release(handle: ClientRemoteObjectHandle): void;
55
+ /**
56
+ * Release every handle in one DevTools object group.
57
+ * @param group - DevTools object-group name.
58
+ */
59
+ releaseGroup(group: string): void;
60
+ /**
61
+ * Discard exactly the handles allocated by one failed operation.
62
+ * @param allocation - Allocation returned by {@link beginAllocation}.
63
+ */
64
+ rollback(allocation: ClientObjectAllocation): void;
65
+ /** Release the whole DevTools session. */
66
+ clear(): void;
67
+ private register;
68
+ }
69
+ //# sourceMappingURL=objects.d.ts.map
@@ -0,0 +1,8 @@
1
+ /** Client CPU profiling is not exposed by the source bridge. */
2
+ import type { InspectorSourceCapability } from '../../shared/bridge/messages/observation.ts';
3
+ /**
4
+ * Describe unavailable browser-side CPU profiling.
5
+ * @returns No source capability for Client CPU profiling.
6
+ */
7
+ export declare function profilerBridgeCapability(): InspectorSourceCapability | undefined;
8
+ //# sourceMappingURL=profiler.d.ts.map
@@ -0,0 +1,16 @@
1
+ /** Lazy Client property enumeration for `Runtime.getProperties`. */
2
+ import type { ClientRuntimeGetPropertiesCommand, ClientRuntimeInternalPropertyDescriptor, ClientRuntimePropertyDescriptor } from '../../shared/bridge/messages/runtime/index.ts';
3
+ import { ClientObjectStore, type ClientObjectAllocation } from './objects.ts';
4
+ /**
5
+ * Read property descriptors without invoking getters.
6
+ * @param objects - Object table that owns the requested handle.
7
+ * @param command - Validated property request.
8
+ * @param maxProperties - Maximum descriptors returned by this operation.
9
+ * @param allocation - Current operation's object-allocation identity.
10
+ * @returns Own or inherited descriptors and the immediate prototype.
11
+ */
12
+ export declare function getClientProperties(objects: ClientObjectStore, command: ClientRuntimeGetPropertiesCommand, maxProperties: number, allocation: ClientObjectAllocation): {
13
+ readonly properties: readonly ClientRuntimePropertyDescriptor[];
14
+ readonly internalProperties?: readonly ClientRuntimeInternalPropertyDescriptor[];
15
+ };
16
+ //# sourceMappingURL=properties.d.ts.map
@@ -0,0 +1,79 @@
1
+ /** Client-realm executor for the typed Runtime command protocol. */
2
+ import type { ClientRuntimeCapability, ClientRuntimeRequestFrame, ClientRuntimeResponseFrame } from '../../shared/bridge/messages/runtime/index.ts';
3
+ import type { ClientRemoteObjectHandle, ClientRuntimeRequestId, ClientRuntimeSessionId } from '../../shared/bridge/ids.ts';
4
+ import type { RuntimeConsoleBackendEvent, RuntimeConsoleType, RuntimeStackTrace } from '../../shared/cdp/index.ts';
5
+ import { type ClientScriptKeyResolver } from './stack.ts';
6
+ /**
7
+ * Describe browser-side Runtime execution.
8
+ * @param origin - Origin assigned to the synthetic execution context.
9
+ * @returns The Runtime capability advertised by a browser Client source.
10
+ */
11
+ export declare function runtimeBridgeCapability(origin: string): ClientRuntimeCapability;
12
+ /** Client-side limits injected by the Host deployment. */
13
+ export interface ClientRuntimeLimits {
14
+ readonly maxObjectsPerSession: number;
15
+ readonly maxPropertiesPerResult: number;
16
+ readonly maxResponseBytes: number;
17
+ }
18
+ /** Executes Runtime requests while isolating object handles by DevTools session. */
19
+ export declare class ClientRuntimeExecutor {
20
+ private readonly limits;
21
+ private readonly resolveScript;
22
+ private readonly sessions;
23
+ private readonly responseAllocations;
24
+ constructor(limits: ClientRuntimeLimits, resolveScript?: ClientScriptKeyResolver);
25
+ /**
26
+ * Execute one request and preserve its source, generation, session, and request identities.
27
+ * @param frame - Validated command envelope from the Worker.
28
+ * @param signal - Optional cancellation for an operation awaiting user code.
29
+ * @param deferObjectCommit - Keep new object handles provisional until {@link acknowledge}.
30
+ * @returns A success or transport-error response for the same request.
31
+ */
32
+ execute(frame: ClientRuntimeRequestFrame, signal?: AbortSignal, deferObjectCommit?: boolean): Promise<ClientRuntimeResponseFrame>;
33
+ /**
34
+ * Commit handles after the Worker accepts one Runtime response.
35
+ * @param sessionId - Session that owns the response.
36
+ * @param requestId - Correlation id acknowledged by the Worker.
37
+ */
38
+ acknowledge(sessionId: ClientRuntimeSessionId, requestId: ClientRuntimeRequestId): void;
39
+ /**
40
+ * Roll back handles from a canceled or otherwise unaccepted Runtime response.
41
+ * @param sessionId - Session that owns the response.
42
+ * @param requestId - Correlation id rejected by the Worker.
43
+ */
44
+ cancel(sessionId: ClientRuntimeSessionId, requestId: ClientRuntimeRequestId): void;
45
+ /**
46
+ * Release all values retained for one closed DevTools connection.
47
+ * @param sessionId - Runtime session owned by that DevTools connection.
48
+ */
49
+ closeSession(sessionId: ClientRuntimeSessionId): void;
50
+ /**
51
+ * Release one object group without closing the surrounding Runtime session.
52
+ * @param sessionId - Session that owns the retained objects.
53
+ * @param group - Object-group name to release.
54
+ */
55
+ releaseObjectGroup(sessionId: ClientRuntimeSessionId, group: string): void;
56
+ /**
57
+ * Serialize one Console call for a specific DevTools Runtime session.
58
+ * @param sessionId - Session receiving the Console event.
59
+ * @param type - Console API operation.
60
+ * @param values - Original arguments from the page call.
61
+ * @param timestamp - Epoch timestamp in milliseconds.
62
+ * @param stackTrace - Browser call frames captured before deferred delivery.
63
+ * @returns A wire-safe event whose object handles belong only to this session.
64
+ */
65
+ consoleEvent(sessionId: ClientRuntimeSessionId, type: RuntimeConsoleType, values: readonly unknown[], timestamp: number, stackTrace?: RuntimeStackTrace): RuntimeConsoleBackendEvent<ClientRemoteObjectHandle> | undefined;
66
+ /**
67
+ * Serialize one uncaught Client exception for a DevTools Runtime session.
68
+ * @param sessionId - Session receiving the exception event.
69
+ * @param error - Thrown or rejected value.
70
+ * @param timestamp - Epoch timestamp in milliseconds.
71
+ * @param stackTrace - Browser call frames attached to the failure.
72
+ * @returns A wire-safe exception event.
73
+ */
74
+ exceptionEvent(sessionId: ClientRuntimeSessionId, error: unknown, timestamp: number, stackTrace?: RuntimeStackTrace): RuntimeConsoleBackendEvent<ClientRemoteObjectHandle> | undefined;
75
+ /** Release all sessions when a source generation ends or reconnects. */
76
+ reset(): void;
77
+ private session;
78
+ }
79
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1,52 @@
1
+ /** Browser-side catalog for the Inspector Client bundle and its source map. */
2
+ import type { ClientSourceCommand, ClientSourceError, ClientSourceResult, ClientSourcesCapability } from '../../shared/bridge/messages/sources/index.ts';
3
+ import type { RuntimeScriptKey } from '../../shared/cdp/ids.ts';
4
+ /**
5
+ * Describe browser-side source access.
6
+ * @param available - Whether the Client bundle was discovered.
7
+ * @returns The Sources capability when this Client discovered its bundle.
8
+ */
9
+ export declare function sourcesBridgeCapability(available: boolean): ClientSourcesCapability | undefined;
10
+ /** One lazily loaded browser script exposed by a Client source catalog. */
11
+ export interface ClientSourceAsset {
12
+ readonly scriptKey: RuntimeScriptKey;
13
+ readonly url: string;
14
+ readonly hash: string;
15
+ readonly sourceMapUrl?: string;
16
+ readonly isModule?: boolean;
17
+ loadSource(): Promise<string>;
18
+ loadSourceMap?(): Promise<string | undefined>;
19
+ }
20
+ /** Deliberate error serialized by the Client source transport. */
21
+ export declare class ClientSourceCatalogError extends Error {
22
+ readonly code: ClientSourceError['code'];
23
+ constructor(code: ClientSourceError['code'], message: string);
24
+ }
25
+ /** Executes bounded, read-only operations over Client script assets. */
26
+ export declare class ClientSourceCatalog {
27
+ private readonly assets;
28
+ constructor(assets: readonly ClientSourceAsset[]);
29
+ /**
30
+ * Resolve a stack-frame URL to this catalog's local script key.
31
+ * @param url - Absolute or page-relative stack-frame URL.
32
+ * @returns The matching script key when the URL belongs to this catalog.
33
+ */
34
+ scriptKeyForUrl(url: string): RuntimeScriptKey | undefined;
35
+ /**
36
+ * Execute one validated source operation.
37
+ * @param command - Read-only catalog command.
38
+ * @param maxContentBytes - Maximum encoded bytes admitted for one asset.
39
+ * @returns Script metadata or one bounded content chunk.
40
+ */
41
+ execute(command: ClientSourceCommand, maxContentBytes: number): Promise<ClientSourceResult>;
42
+ private describe;
43
+ private source;
44
+ private sourceBytes;
45
+ private sourceMapBytes;
46
+ }
47
+ /**
48
+ * Discover this package's bundle URL from the Host-injected web boot graph.
49
+ * @returns A lazy catalog, or `undefined` outside the assembled web application.
50
+ */
51
+ export declare function discoverInspectorClientSourceCatalog(): ClientSourceCatalog | undefined;
52
+ //# sourceMappingURL=sources.d.ts.map
@@ -0,0 +1,27 @@
1
+ /** Browser stack parsing for realm-neutral Runtime and Console events. */
2
+ import type { RuntimeScriptKey } from '../../shared/cdp/ids.ts';
3
+ import type { RuntimeStackTrace } from '../../shared/cdp/index.ts';
4
+ /** Resolve a browser stack-frame URL to a Client catalog script key. */
5
+ export type ClientScriptKeyResolver = (url: string) => RuntimeScriptKey | undefined;
6
+ /**
7
+ * Capture the caller stack of a wrapped Client Console method.
8
+ * @param resolveScript - Resolver for Client catalog script keys.
9
+ * @returns Parsed call frames when the browser supplies a stack.
10
+ */
11
+ export declare function captureClientConsoleStack(resolveScript: ClientScriptKeyResolver): RuntimeStackTrace | undefined;
12
+ /**
13
+ * Parse the stack attached to an uncaught Client value when available.
14
+ * @param value - Thrown or rejected value.
15
+ * @param resolveScript - Resolver for Client catalog script keys.
16
+ * @returns Parsed call frames when the value has a recognized stack string.
17
+ */
18
+ export declare function clientErrorStack(value: unknown, resolveScript?: ClientScriptKeyResolver): RuntimeStackTrace | undefined;
19
+ /**
20
+ * Parse V8- and Firefox-style textual frames into the common stack model.
21
+ * @param stack - Browser stack text.
22
+ * @param resolveScript - Resolver for Client catalog script keys.
23
+ * @param skipFrames - Parsed observer frames omitted from the result.
24
+ * @returns Parsed call frames, or `undefined` when none remain.
25
+ */
26
+ export declare function parseClientStack(stack: string | undefined, resolveScript: ClientScriptKeyResolver, skipFrames: number): RuntimeStackTrace | undefined;
27
+ //# sourceMappingURL=stack.d.ts.map
@@ -0,0 +1,3 @@
1
+ /** Browser Client entry for the experimental Inspector Cordis plugin. */
2
+ export * from './plugin.ts';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ /** Client entry for the shared Cordis snapshot publisher. */
2
+ export { publishCordisTree } from '../../shared/cordis/publisher.ts';
3
+ //# sourceMappingURL=cordis.d.ts.map
@@ -0,0 +1,4 @@
1
+ /** Client network observation is not enabled in the current source producer. */
2
+ /** Observation topics published by the Client network adapter. */
3
+ export declare const NETWORK_TOPICS: readonly string[];
4
+ //# sourceMappingURL=network.d.ts.map
@@ -0,0 +1,27 @@
1
+ /** Stable Client source identity with a fresh descriptor for each WebSocket generation. */
2
+ import type { InspectorSourceDescriptor } from '../../shared/bridge/messages/observation.ts';
3
+ /** Owns one browser realm's stable source id across transport reconnects. */
4
+ export declare class ClientRealmSource {
5
+ private readonly label;
6
+ private releaseClaim?;
7
+ /** Logical source id retained across reconnecting transport generations. */
8
+ readonly sourceId: InspectorSourceDescriptor['sourceId'];
9
+ constructor(label: string, sourceId?: import("../../shared/index.ts").InspectorSourceId, releaseClaim?: (() => void) | undefined);
10
+ /**
11
+ * Claim the tab identity before opening its source transport. Browsers with
12
+ * Web Locks reject a copied `sessionStorage` identity while its original tab
13
+ * remains live; a fresh id is persisted and claimed instead.
14
+ * @param label - Human-readable Client label reported to the Worker.
15
+ * @returns The claimed realm source.
16
+ */
17
+ static claim(label: string): Promise<ClientRealmSource>;
18
+ /**
19
+ * Create the descriptor for one newly admitted transport generation.
20
+ * @param hasSources - Whether the built Client bundle is available for source reads.
21
+ * @returns A source descriptor with a fresh generation.
22
+ */
23
+ connect(hasSources: boolean): InspectorSourceDescriptor;
24
+ /** Release this page's identity claim. */
25
+ close(): void;
26
+ }
27
+ //# sourceMappingURL=realm.d.ts.map
@@ -0,0 +1,28 @@
1
+ /** Client Cordis plugin that publishes browser observations directly to the Inspector Worker. */
2
+ import type { Context } from '@deepseek-ai/cordis';
3
+ import { type InspectorService as SharedInspectorService } from '../shared/service.ts';
4
+ export type { CordisRuntimeTreeReader } from '../shared/cordis/reader.ts';
5
+ export type { CordisRuntimeConnection, CordisRuntimeContext, CordisRuntimeFiber, CordisRuntimeNode, CordisRuntimeRealm, CordisRuntimeSource, CordisRuntimeTree, } from '../shared/cordis/model.ts';
6
+ /** Client-facing Inspector service backed by the shared implementation. */
7
+ export interface InspectorService extends SharedInspectorService {
8
+ }
9
+ declare global {
10
+ /** Host-injected Inspector Client connection parameters. */
11
+ var __DSH_INSPECTOR__: unknown;
12
+ }
13
+ declare module '@deepseek-ai/cordis' {
14
+ interface Context {
15
+ /** Publish Client-realm observations and query the shared Inspector state. */
16
+ inspector: InspectorService;
17
+ }
18
+ }
19
+ /** Cordis plugin name shared with the Host face. */
20
+ export declare const name = "experimental-inspector";
21
+ /** This transport root has no Client service dependencies. */
22
+ export declare const inject: string[];
23
+ /**
24
+ * Mount the Client source and shared `ctx.inspector` publishing API.
25
+ * @param ctx - Client Cordis context whose page identity and lifecycle own the source.
26
+ */
27
+ export declare function apply(ctx: Context): Promise<void>;
28
+ //# sourceMappingURL=plugin.d.ts.map