@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.
- package/LICENSE +21 -0
- package/README.i18n.yaml +6 -0
- package/README.md +156 -0
- package/README.zh.md +156 -0
- package/lib/client.js +3424 -0
- package/lib/index.js +2406 -0
- package/lib/types/client/bridge/controller.d.ts +10 -0
- package/lib/types/client/bridge/dispatcher.d.ts +26 -0
- package/lib/types/client/bridge/lifecycle.d.ts +20 -0
- package/lib/types/client/bridge/publisher.d.ts +42 -0
- package/lib/types/client/bridge/rpc.d.ts +13 -0
- package/lib/types/client/bridge/transport.d.ts +34 -0
- package/lib/types/client/cdp/console.d.ts +45 -0
- package/lib/types/client/cdp/debugger.d.ts +8 -0
- package/lib/types/client/cdp/errors.d.ts +8 -0
- package/lib/types/client/cdp/heap-profiler.d.ts +8 -0
- package/lib/types/client/cdp/index.d.ts +10 -0
- package/lib/types/client/cdp/objects.d.ts +69 -0
- package/lib/types/client/cdp/profiler.d.ts +8 -0
- package/lib/types/client/cdp/properties.d.ts +16 -0
- package/lib/types/client/cdp/runtime.d.ts +79 -0
- package/lib/types/client/cdp/sources.d.ts +52 -0
- package/lib/types/client/cdp/stack.d.ts +27 -0
- package/lib/types/client/index.d.ts +3 -0
- package/lib/types/client/inspection/cordis.d.ts +3 -0
- package/lib/types/client/inspection/network.d.ts +4 -0
- package/lib/types/client/inspection/realm.d.ts +27 -0
- package/lib/types/client/plugin.d.ts +28 -0
- package/lib/types/host/bridge/controller.d.ts +108 -0
- package/lib/types/host/bridge/dispatcher.d.ts +16 -0
- package/lib/types/host/bridge/lifecycle.d.ts +42 -0
- package/lib/types/host/bridge/publisher.d.ts +31 -0
- package/lib/types/host/bridge/rpc.d.ts +15 -0
- package/lib/types/host/bridge/transport.d.ts +28 -0
- package/lib/types/host/cdp/console.d.ts +14 -0
- package/lib/types/host/cdp/debugger.d.ts +8 -0
- package/lib/types/host/cdp/errors.d.ts +6 -0
- package/lib/types/host/cdp/heap-profiler.d.ts +8 -0
- package/lib/types/host/cdp/index.d.ts +10 -0
- package/lib/types/host/cdp/objects.d.ts +8 -0
- package/lib/types/host/cdp/profiler.d.ts +8 -0
- package/lib/types/host/cdp/properties.d.ts +7 -0
- package/lib/types/host/cdp/runtime.d.ts +16 -0
- package/lib/types/host/cdp/sources.d.ts +14 -0
- package/lib/types/host/cdp/stack.d.ts +4 -0
- package/lib/types/host/index.d.ts +3 -0
- package/lib/types/host/inspection/cordis.d.ts +3 -0
- package/lib/types/host/inspection/network.d.ts +23 -0
- package/lib/types/host/inspection/realm.d.ts +9 -0
- package/lib/types/host/plugin.d.ts +19 -0
- package/lib/types/index.d.ts +50 -0
- package/lib/types/shared/bridge/buffer.d.ts +62 -0
- package/lib/types/shared/bridge/codec.d.ts +4 -0
- package/lib/types/shared/bridge/control-codec.d.ts +27 -0
- package/lib/types/shared/bridge/ids.d.ts +19 -0
- package/lib/types/shared/bridge/messages/control.d.ts +64 -0
- package/lib/types/shared/bridge/messages/cordis.d.ts +4 -0
- package/lib/types/shared/bridge/messages/network.d.ts +4 -0
- package/lib/types/shared/bridge/messages/observation.d.ts +110 -0
- package/lib/types/shared/bridge/messages/query/codec.d.ts +40 -0
- package/lib/types/shared/bridge/messages/query/commands.d.ts +35 -0
- package/lib/types/shared/bridge/messages/query/frames.d.ts +31 -0
- package/lib/types/shared/bridge/messages/query/index.d.ts +5 -0
- package/lib/types/shared/bridge/messages/runtime/command-codec.d.ts +9 -0
- package/lib/types/shared/bridge/messages/runtime/commands.d.ts +76 -0
- package/lib/types/shared/bridge/messages/runtime/console-frames.d.ts +52 -0
- package/lib/types/shared/bridge/messages/runtime/frames.d.ts +98 -0
- package/lib/types/shared/bridge/messages/runtime/index.d.ts +5 -0
- package/lib/types/shared/bridge/messages/runtime/value-codec.d.ts +28 -0
- package/lib/types/shared/bridge/messages/sources/codec.d.ts +15 -0
- package/lib/types/shared/bridge/messages/sources/commands.d.ts +42 -0
- package/lib/types/shared/bridge/messages/sources/frames.d.ts +67 -0
- package/lib/types/shared/bridge/messages/sources/index.d.ts +5 -0
- package/lib/types/shared/bridge/publisher.d.ts +33 -0
- package/lib/types/shared/bridge/query-reader.d.ts +10 -0
- package/lib/types/shared/bridge/rpc.d.ts +62 -0
- package/lib/types/shared/bridge/validation.d.ts +3 -0
- package/lib/types/shared/bridge/version.d.ts +3 -0
- package/lib/types/shared/cdp/capabilities.d.ts +17 -0
- package/lib/types/shared/cdp/console.d.ts +28 -0
- package/lib/types/shared/cdp/debugger.d.ts +69 -0
- package/lib/types/shared/cdp/errors.d.ts +27 -0
- package/lib/types/shared/cdp/ids.d.ts +9 -0
- package/lib/types/shared/cdp/index.d.ts +11 -0
- package/lib/types/shared/cdp/operations.d.ts +86 -0
- package/lib/types/shared/cdp/property.d.ts +28 -0
- package/lib/types/shared/cdp/realm.d.ts +137 -0
- package/lib/types/shared/cdp/remote-object.d.ts +44 -0
- package/lib/types/shared/cdp/sources.d.ts +18 -0
- package/lib/types/shared/cordis/collector.d.ts +26 -0
- package/lib/types/shared/cordis/ids.d.ts +7 -0
- package/lib/types/shared/cordis/model.d.ts +61 -0
- package/lib/types/shared/cordis/object-reference.d.ts +14 -0
- package/lib/types/shared/cordis/object-registry.d.ts +80 -0
- package/lib/types/shared/cordis/observer.d.ts +15 -0
- package/lib/types/shared/cordis/projector.d.ts +34 -0
- package/lib/types/shared/cordis/publisher.d.ts +13 -0
- package/lib/types/shared/cordis/reader.d.ts +18 -0
- package/lib/types/shared/cordis/snapshot.d.ts +39 -0
- package/lib/types/shared/identity.d.ts +12 -0
- package/lib/types/shared/index.d.ts +18 -0
- package/lib/types/shared/json.d.ts +35 -0
- package/lib/types/shared/network/event-source.d.ts +20 -0
- package/lib/types/shared/network/observation.d.ts +52 -0
- package/lib/types/shared/service.d.ts +23 -0
- package/lib/types/shared/validation.d.ts +52 -0
- package/lib/types/worker/bridge/endpoint.d.ts +49 -0
- package/lib/types/worker/bridge/hub.d.ts +108 -0
- package/lib/types/worker/bridge/runtime-rpc.d.ts +90 -0
- package/lib/types/worker/bridge/session.d.ts +15 -0
- package/lib/types/worker/bridge/source-rpc.d.ts +42 -0
- package/lib/types/worker/cdp/domains/debugger/cdp-params.d.ts +15 -0
- package/lib/types/worker/cdp/domains/debugger/index.d.ts +6 -0
- package/lib/types/worker/cdp/domains/debugger/projector.d.ts +22 -0
- package/lib/types/worker/cdp/domains/debugger/script-registry.d.ts +70 -0
- package/lib/types/worker/cdp/domains/debugger/session.d.ts +47 -0
- package/lib/types/worker/cdp/domains/dom/index.d.ts +4 -0
- package/lib/types/worker/cdp/domains/dom/model.d.ts +108 -0
- package/lib/types/worker/cdp/domains/dom/session.d.ts +74 -0
- package/lib/types/worker/cdp/domains/native.d.ts +25 -0
- package/lib/types/worker/cdp/domains/network/session.d.ts +46 -0
- package/lib/types/worker/cdp/domains/runtime/cdp-params.d.ts +82 -0
- package/lib/types/worker/cdp/domains/runtime/index.d.ts +3 -0
- package/lib/types/worker/cdp/domains/runtime/object-table.d.ts +117 -0
- package/lib/types/worker/cdp/domains/runtime/session.d.ts +97 -0
- package/lib/types/worker/cdp/ids.d.ts +37 -0
- package/lib/types/worker/cdp/protocol.d.ts +46 -0
- package/lib/types/worker/cdp/realm-sessions.d.ts +64 -0
- package/lib/types/worker/cdp/session.d.ts +34 -0
- package/lib/types/worker/cdp/target.d.ts +17 -0
- package/lib/types/worker/entry.d.ts +3 -0
- package/lib/types/worker/inspection/cordis-query.d.ts +11 -0
- package/lib/types/worker/inspection/cordis-store.d.ts +94 -0
- package/lib/types/worker/inspection/network-store.d.ts +110 -0
- package/lib/types/worker/inspection/query-router.d.ts +78 -0
- package/lib/types/worker/inspection/realm-store.d.ts +58 -0
- package/lib/types/worker/inspection/realm.d.ts +43 -0
- package/lib/types/worker/realms/client/bridge.d.ts +18 -0
- package/lib/types/worker/realms/client/console.d.ts +21 -0
- package/lib/types/worker/realms/client/debugger.d.ts +8 -0
- package/lib/types/worker/realms/client/index.d.ts +18 -0
- package/lib/types/worker/realms/client/runtime.d.ts +28 -0
- package/lib/types/worker/realms/client/scripts.d.ts +15 -0
- package/lib/types/worker/realms/client/sources.d.ts +30 -0
- package/lib/types/worker/realms/client/values.d.ts +55 -0
- package/lib/types/worker/realms/host/bridge.d.ts +49 -0
- package/lib/types/worker/realms/host/console.d.ts +25 -0
- package/lib/types/worker/realms/host/debugger.d.ts +25 -0
- package/lib/types/worker/realms/host/index.d.ts +13 -0
- package/lib/types/worker/realms/host/runtime.d.ts +54 -0
- package/lib/types/worker/realms/host/scripts.d.ts +9 -0
- package/lib/types/worker/realms/host/sources.d.ts +26 -0
- package/lib/types/worker/realms/host/values.d.ts +22 -0
- package/lib/types/worker/server.d.ts +16 -0
- package/lib/worker.js +7184 -0
- package/package.json +64 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/** RuntimeBackend implementation over one native Node inspector session. */
|
|
2
|
+
import type { RuntimeBackendObjectHandle } from '../../../shared/cdp/ids.ts';
|
|
3
|
+
import type { RuntimeCompletion, RuntimeExceptionDetails, RuntimeRemoteObject, RuntimeExecutionContext, RuntimeStackTrace } from '../../../shared/cdp/index.ts';
|
|
4
|
+
import type { HostInspectorSession } from './bridge.ts';
|
|
5
|
+
import type { RuntimeBackend } from '../../../shared/cdp/realm.ts';
|
|
6
|
+
/** Host Runtime adapter preserving native V8 semantics behind common values. */
|
|
7
|
+
export declare class HostRuntimeBackend implements RuntimeBackend {
|
|
8
|
+
private readonly target;
|
|
9
|
+
private defaultContextId;
|
|
10
|
+
private readonly unsubscribe;
|
|
11
|
+
constructor(target: HostInspectorSession);
|
|
12
|
+
enable(): Promise<void>;
|
|
13
|
+
disable(): Promise<void>;
|
|
14
|
+
evaluate(request: Parameters<RuntimeBackend['evaluate']>[0]): ReturnType<RuntimeBackend['evaluate']>;
|
|
15
|
+
getProperties(request: Parameters<RuntimeBackend['getProperties']>[0]): ReturnType<RuntimeBackend['getProperties']>;
|
|
16
|
+
callFunction(request: Parameters<RuntimeBackend['callFunction']>[0]): ReturnType<RuntimeBackend['callFunction']>;
|
|
17
|
+
awaitPromise(request: Parameters<RuntimeBackend['awaitPromise']>[0]): ReturnType<RuntimeBackend['awaitPromise']>;
|
|
18
|
+
globalLexicalScopeNames(context?: RuntimeExecutionContext): Promise<readonly string[]>;
|
|
19
|
+
releaseObject(handle: RuntimeBackendObjectHandle): Promise<void>;
|
|
20
|
+
releaseObjectGroup(group: string): Promise<void>;
|
|
21
|
+
/** Release the native-context observer owned by this backend. */
|
|
22
|
+
close(): void;
|
|
23
|
+
/**
|
|
24
|
+
* Convert a native Runtime completion returned through another Node domain.
|
|
25
|
+
* @param value - Native result and optional exception details.
|
|
26
|
+
* @returns The realm-neutral completion.
|
|
27
|
+
*/
|
|
28
|
+
completion(value: Readonly<Record<string, unknown>>): Promise<RuntimeCompletion<RuntimeBackendObjectHandle>>;
|
|
29
|
+
private properties;
|
|
30
|
+
private property;
|
|
31
|
+
private internalProperties;
|
|
32
|
+
private privateProperties;
|
|
33
|
+
/**
|
|
34
|
+
* Convert native exception details to the common Runtime model.
|
|
35
|
+
* @param value - Native `Runtime.ExceptionDetails` fields.
|
|
36
|
+
* @returns Exception details with normalized object references.
|
|
37
|
+
*/
|
|
38
|
+
exceptionDetails(value: unknown): Promise<RuntimeExceptionDetails<RuntimeBackendObjectHandle>>;
|
|
39
|
+
/**
|
|
40
|
+
* Convert one native V8 RemoteObject to the common Runtime model.
|
|
41
|
+
* @param value - Native `Runtime.RemoteObject` fields.
|
|
42
|
+
* @returns Descriptor, backend handle, and optional Cordis identity.
|
|
43
|
+
*/
|
|
44
|
+
remoteObject(value: unknown): Promise<RuntimeRemoteObject<RuntimeBackendObjectHandle>>;
|
|
45
|
+
/**
|
|
46
|
+
* Convert a native stack trace while retaining native script identities.
|
|
47
|
+
* @param value - Native `Runtime.StackTrace` fields.
|
|
48
|
+
* @returns Realm-neutral stack frames.
|
|
49
|
+
*/
|
|
50
|
+
stackTrace(value: unknown): RuntimeStackTrace;
|
|
51
|
+
private observeContext;
|
|
52
|
+
private identifyObject;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Host-native script identity conversion for normalized source and debugger values. */
|
|
2
|
+
import type { RuntimeScriptKey } from '../../../shared/cdp/ids.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Convert a Node inspector script id into the realm backend identity namespace.
|
|
5
|
+
* @param value - Native Node inspector script id.
|
|
6
|
+
* @returns The corresponding normalized script key.
|
|
7
|
+
*/
|
|
8
|
+
export declare function hostScriptKey(value: string): RuntimeScriptKey;
|
|
9
|
+
//# sourceMappingURL=scripts.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** SourceBackend implementation over native Node Debugger notifications. */
|
|
2
|
+
import type { RuntimeScriptKey } from '../../../shared/cdp/ids.ts';
|
|
3
|
+
import type { RuntimeScript } from '../../../shared/cdp/index.ts';
|
|
4
|
+
import type { HostInspectorSession } from './bridge.ts';
|
|
5
|
+
import type { SourceBackend } from '../../../shared/cdp/realm.ts';
|
|
6
|
+
/** Maintains one connection-local catalog of scripts reported by Node's inspector. */
|
|
7
|
+
export declare class HostSourceBackend implements SourceBackend {
|
|
8
|
+
private readonly target;
|
|
9
|
+
private readonly scripts;
|
|
10
|
+
private readonly listeners;
|
|
11
|
+
private readonly unsubscribe;
|
|
12
|
+
constructor(target: HostInspectorSession);
|
|
13
|
+
listScripts(): Promise<readonly RuntimeScript[]>;
|
|
14
|
+
getScriptSource(scriptKey: RuntimeScriptKey): Promise<string>;
|
|
15
|
+
getSourceMap(_scriptKey: RuntimeScriptKey): Promise<string | undefined>;
|
|
16
|
+
/**
|
|
17
|
+
* Subscribe to scripts discovered after the initial catalog read.
|
|
18
|
+
* @param listener - Consumer of newly discovered scripts.
|
|
19
|
+
* @returns A disposer removing the consumer.
|
|
20
|
+
*/
|
|
21
|
+
subscribe(listener: (script: RuntimeScript) => void): () => void;
|
|
22
|
+
/** Release the native notification subscription and cached catalog. */
|
|
23
|
+
close(): void;
|
|
24
|
+
private receive;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=sources.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Small validators for values returned by Node's native Inspector protocol. */
|
|
2
|
+
/**
|
|
3
|
+
* Test whether a native protocol value is a non-array object record.
|
|
4
|
+
* @param value - Native protocol value.
|
|
5
|
+
* @returns Whether the value can be read as named fields.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isNativeRecord(value: unknown): value is Readonly<Record<string, unknown>>;
|
|
8
|
+
/**
|
|
9
|
+
* Require a native protocol object record.
|
|
10
|
+
* @param value - Native protocol value.
|
|
11
|
+
* @param label - Subject named in the validation error.
|
|
12
|
+
* @returns The validated object record.
|
|
13
|
+
*/
|
|
14
|
+
export declare function requireNativeRecord(value: unknown, label: string): Readonly<Record<string, unknown>>;
|
|
15
|
+
/**
|
|
16
|
+
* Include an optional field only when the native request supplied a value.
|
|
17
|
+
* @param key - Native protocol field name.
|
|
18
|
+
* @param value - Optional field value.
|
|
19
|
+
* @returns An empty record or the requested field.
|
|
20
|
+
*/
|
|
21
|
+
export declare function optionalNativeField<Key extends string, Value>(key: Key, value: Value | undefined): Partial<Record<Key, Value>>;
|
|
22
|
+
//# sourceMappingURL=values.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Inspector Worker assembly over one Host source port and one loopback endpoint. */
|
|
2
|
+
import type { MessagePort } from 'node:worker_threads';
|
|
3
|
+
import type { InspectorWorkerBoot } from '../shared/bridge/messages/control.ts';
|
|
4
|
+
import { type InspectorEndpointInfo } from './bridge/endpoint.ts';
|
|
5
|
+
/** Live Worker runtime. */
|
|
6
|
+
export interface InspectorWorkerRuntime {
|
|
7
|
+
readonly endpoint: InspectorEndpointInfo;
|
|
8
|
+
close(): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Assemble and start the Worker-owned source registry, Runtime router, Network domain, and endpoints.
|
|
12
|
+
* @param boot - Validated Worker configuration and transferred Host source port.
|
|
13
|
+
* @returns The listening endpoint and quiescent shutdown owner.
|
|
14
|
+
*/
|
|
15
|
+
export declare function startInspectorWorker(boot: InspectorWorkerBoot<MessagePort>): Promise<InspectorWorkerRuntime>;
|
|
16
|
+
//# sourceMappingURL=server.d.ts.map
|