browser-debugger-cli 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -4
- package/dist/__tests__/smoke/error-handling.smoke.test.js +0 -11
- package/dist/__tests__/smoke/error-handling.smoke.test.js.map +1 -1
- package/dist/cdp/protocol.d.ts +121 -0
- package/dist/cdp/protocol.d.ts.map +1 -0
- package/dist/cdp/protocol.js +215 -0
- package/dist/cdp/protocol.js.map +1 -0
- package/dist/cdp/schema.d.ts +159 -0
- package/dist/cdp/schema.d.ts.map +1 -0
- package/dist/cdp/schema.js +256 -0
- package/dist/cdp/schema.js.map +1 -0
- package/dist/cdp/types.d.ts +139 -0
- package/dist/cdp/types.d.ts.map +1 -0
- package/dist/cdp/types.js +7 -0
- package/dist/cdp/types.js.map +1 -0
- package/dist/commands/cdp.d.ts +10 -1
- package/dist/commands/cdp.d.ts.map +1 -1
- package/dist/commands/cdp.js +363 -26
- package/dist/commands/cdp.js.map +1 -1
- package/dist/commands/cleanup.js +3 -3
- package/dist/commands/cleanup.js.map +1 -1
- package/dist/commands/dom.d.ts.map +1 -1
- package/dist/commands/dom.js +1 -0
- package/dist/commands/dom.js.map +1 -1
- package/dist/commands/domEvalHelpers.d.ts +2 -15
- package/dist/commands/domEvalHelpers.d.ts.map +1 -1
- package/dist/commands/domEvalHelpers.js +1 -1
- package/dist/commands/domEvalHelpers.js.map +1 -1
- package/dist/commands/peek.d.ts.map +1 -1
- package/dist/commands/peek.js +12 -6
- package/dist/commands/peek.js.map +1 -1
- package/dist/commands/shared/CommandRunner.d.ts +2 -0
- package/dist/commands/shared/CommandRunner.d.ts.map +1 -1
- package/dist/commands/shared/CommandRunner.js +13 -1
- package/dist/commands/shared/CommandRunner.js.map +1 -1
- package/dist/commands/shared/commonOptions.d.ts.map +1 -1
- package/dist/commands/shared/commonOptions.js +2 -2
- package/dist/commands/shared/commonOptions.js.map +1 -1
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +21 -12
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/status.js +2 -2
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/stop.js +2 -2
- package/dist/commands/stop.js.map +1 -1
- package/dist/commands/tail.d.ts.map +1 -1
- package/dist/commands/tail.js +9 -6
- package/dist/commands/tail.js.map +1 -1
- package/dist/connection/cdp.d.ts.map +1 -1
- package/dist/connection/cdp.js +15 -2
- package/dist/connection/cdp.js.map +1 -1
- package/dist/connection/domOperations.d.ts.map +1 -1
- package/dist/connection/domOperations.js +3 -1
- package/dist/connection/domOperations.js.map +1 -1
- package/dist/connection/handlers.d.ts +34 -2
- package/dist/connection/handlers.d.ts.map +1 -1
- package/dist/connection/handlers.js +28 -2
- package/dist/connection/handlers.js.map +1 -1
- package/dist/connection/launcher.d.ts.map +1 -1
- package/dist/connection/launcher.js +14 -2
- package/dist/connection/launcher.js.map +1 -1
- package/dist/connection/pageReadiness.d.ts.map +1 -1
- package/dist/connection/pageReadiness.js +6 -6
- package/dist/connection/pageReadiness.js.map +1 -1
- package/dist/connection/typed-cdp.d.ts +144 -0
- package/dist/connection/typed-cdp.d.ts.map +1 -0
- package/dist/connection/typed-cdp.js +120 -0
- package/dist/connection/typed-cdp.js.map +1 -0
- package/dist/daemon/worker/commandRegistry.d.ts.map +1 -1
- package/dist/daemon/worker/commandRegistry.js.map +1 -1
- package/dist/telemetry/__tests__/network.contract.test.js +124 -93
- package/dist/telemetry/__tests__/network.contract.test.js.map +1 -1
- package/dist/telemetry/console.d.ts.map +1 -1
- package/dist/telemetry/console.js +3 -2
- package/dist/telemetry/console.js.map +1 -1
- package/dist/telemetry/dialogs.d.ts.map +1 -1
- package/dist/telemetry/dialogs.js.map +1 -1
- package/dist/telemetry/dom.d.ts.map +1 -1
- package/dist/telemetry/dom.js +3 -1
- package/dist/telemetry/dom.js.map +1 -1
- package/dist/telemetry/navigation.d.ts.map +1 -1
- package/dist/telemetry/navigation.js.map +1 -1
- package/dist/telemetry/network.d.ts.map +1 -1
- package/dist/telemetry/network.js.map +1 -1
- package/dist/types.d.ts +0 -141
- package/dist/types.d.ts.map +1 -1
- package/dist/ui/messages/commands.d.ts +1 -0
- package/dist/ui/messages/commands.d.ts.map +1 -1
- package/dist/ui/messages/commands.js +1 -0
- package/dist/ui/messages/commands.js.map +1 -1
- package/dist/ui/messages/errors.d.ts +30 -3
- package/dist/ui/messages/errors.d.ts.map +1 -1
- package/dist/ui/messages/errors.js +36 -8
- package/dist/ui/messages/errors.js.map +1 -1
- package/dist/ui/messages/session.d.ts.map +1 -1
- package/dist/ui/messages/session.js +5 -4
- package/dist/ui/messages/session.js.map +1 -1
- package/dist/ui/messages/validation.d.ts +22 -4
- package/dist/ui/messages/validation.d.ts.map +1 -1
- package/dist/ui/messages/validation.js +26 -5
- package/dist/ui/messages/validation.js.map +1 -1
- package/package.json +2 -1
- package/dist/cli/commands/__tests__/start.unit.test.d.ts +0 -2
- package/dist/cli/commands/__tests__/start.unit.test.d.ts.map +0 -1
- package/dist/cli/commands/__tests__/start.unit.test.js +0 -131
- package/dist/cli/commands/__tests__/start.unit.test.js.map +0 -1
- package/dist/cli/commands/cleanup.d.ts +0 -9
- package/dist/cli/commands/cleanup.d.ts.map +0 -1
- package/dist/cli/commands/cleanup.js +0 -148
- package/dist/cli/commands/cleanup.js.map +0 -1
- package/dist/cli/commands/details.d.ts +0 -9
- package/dist/cli/commands/details.d.ts.map +0 -1
- package/dist/cli/commands/details.js +0 -120
- package/dist/cli/commands/details.js.map +0 -1
- package/dist/cli/commands/peek.d.ts +0 -9
- package/dist/cli/commands/peek.d.ts.map +0 -1
- package/dist/cli/commands/peek.js +0 -64
- package/dist/cli/commands/peek.js.map +0 -1
- package/dist/cli/commands/query.d.ts +0 -9
- package/dist/cli/commands/query.d.ts.map +0 -1
- package/dist/cli/commands/query.js +0 -125
- package/dist/cli/commands/query.js.map +0 -1
- package/dist/cli/commands/start.d.ts +0 -83
- package/dist/cli/commands/start.d.ts.map +0 -1
- package/dist/cli/commands/start.js +0 -204
- package/dist/cli/commands/start.js.map +0 -1
- package/dist/cli/commands/status.d.ts +0 -9
- package/dist/cli/commands/status.d.ts.map +0 -1
- package/dist/cli/commands/status.js +0 -75
- package/dist/cli/commands/status.js.map +0 -1
- package/dist/cli/commands/stop.d.ts +0 -9
- package/dist/cli/commands/stop.d.ts.map +0 -1
- package/dist/cli/commands/stop.js +0 -133
- package/dist/cli/commands/stop.js.map +0 -1
- package/dist/cli/formatters/detailsFormatter.d.ts +0 -10
- package/dist/cli/formatters/detailsFormatter.d.ts.map +0 -1
- package/dist/cli/formatters/detailsFormatter.js +0 -63
- package/dist/cli/formatters/detailsFormatter.js.map +0 -1
- package/dist/cli/formatters/previewFormatter.d.ts +0 -27
- package/dist/cli/formatters/previewFormatter.d.ts.map +0 -1
- package/dist/cli/formatters/previewFormatter.js +0 -155
- package/dist/cli/formatters/previewFormatter.js.map +0 -1
- package/dist/cli/formatters/statusFormatter.d.ts +0 -42
- package/dist/cli/formatters/statusFormatter.d.ts.map +0 -1
- package/dist/cli/formatters/statusFormatter.js +0 -126
- package/dist/cli/formatters/statusFormatter.js.map +0 -1
- package/dist/cli/handlers/ChromeBootstrap.d.ts +0 -24
- package/dist/cli/handlers/ChromeBootstrap.d.ts.map +0 -1
- package/dist/cli/handlers/ChromeBootstrap.js +0 -50
- package/dist/cli/handlers/ChromeBootstrap.js.map +0 -1
- package/dist/cli/handlers/OutputBuilder.d.ts +0 -59
- package/dist/cli/handlers/OutputBuilder.d.ts.map +0 -1
- package/dist/cli/handlers/OutputBuilder.js +0 -136
- package/dist/cli/handlers/OutputBuilder.js.map +0 -1
- package/dist/cli/handlers/OutputWriter.d.ts +0 -15
- package/dist/cli/handlers/OutputWriter.d.ts.map +0 -1
- package/dist/cli/handlers/OutputWriter.js +0 -34
- package/dist/cli/handlers/OutputWriter.js.map +0 -1
- package/dist/cli/handlers/PreviewWriter.d.ts +0 -52
- package/dist/cli/handlers/PreviewWriter.d.ts.map +0 -1
- package/dist/cli/handlers/PreviewWriter.js +0 -118
- package/dist/cli/handlers/PreviewWriter.js.map +0 -1
- package/dist/cli/handlers/SessionLock.d.ts +0 -16
- package/dist/cli/handlers/SessionLock.d.ts.map +0 -1
- package/dist/cli/handlers/SessionLock.js +0 -35
- package/dist/cli/handlers/SessionLock.js.map +0 -1
- package/dist/cli/handlers/SessionLoop.d.ts +0 -19
- package/dist/cli/handlers/SessionLoop.d.ts.map +0 -1
- package/dist/cli/handlers/SessionLoop.js +0 -47
- package/dist/cli/handlers/SessionLoop.js.map +0 -1
- package/dist/cli/handlers/ShutdownController.d.ts +0 -41
- package/dist/cli/handlers/ShutdownController.d.ts.map +0 -1
- package/dist/cli/handlers/ShutdownController.js +0 -94
- package/dist/cli/handlers/ShutdownController.js.map +0 -1
- package/dist/cli/handlers/SignalHandler.d.ts +0 -35
- package/dist/cli/handlers/SignalHandler.d.ts.map +0 -1
- package/dist/cli/handlers/SignalHandler.js +0 -81
- package/dist/cli/handlers/SignalHandler.js.map +0 -1
- package/dist/cli/handlers/TargetSetup.d.ts +0 -42
- package/dist/cli/handlers/TargetSetup.d.ts.map +0 -1
- package/dist/cli/handlers/TargetSetup.js +0 -87
- package/dist/cli/handlers/TargetSetup.js.map +0 -1
- package/dist/cli/handlers/sessionController.d.ts +0 -62
- package/dist/cli/handlers/sessionController.d.ts.map +0 -1
- package/dist/cli/handlers/sessionController.js +0 -316
- package/dist/cli/handlers/sessionController.js.map +0 -1
- package/dist/cli/registry.d.ts +0 -11
- package/dist/cli/registry.d.ts.map +0 -1
- package/dist/cli/registry.js +0 -21
- package/dist/cli/registry.js.map +0 -1
- package/dist/collectors/console.d.ts +0 -19
- package/dist/collectors/console.d.ts.map +0 -1
- package/dist/collectors/console.js +0 -87
- package/dist/collectors/console.js.map +0 -1
- package/dist/collectors/dom.d.ts +0 -21
- package/dist/collectors/dom.d.ts.map +0 -1
- package/dist/collectors/dom.js +0 -99
- package/dist/collectors/dom.js.map +0 -1
- package/dist/collectors/network.d.ts +0 -32
- package/dist/collectors/network.d.ts.map +0 -1
- package/dist/collectors/network.js +0 -191
- package/dist/collectors/network.js.map +0 -1
- package/dist/connection/tabs.d.ts +0 -52
- package/dist/connection/tabs.d.ts.map +0 -1
- package/dist/connection/tabs.js +0 -227
- package/dist/connection/tabs.js.map +0 -1
- package/dist/help/machineReadableHelp.d.ts +0 -100
- package/dist/help/machineReadableHelp.d.ts.map +0 -1
- package/dist/help/machineReadableHelp.js +0 -139
- package/dist/help/machineReadableHelp.js.map +0 -1
- package/dist/session/BdgSession.d.ts +0 -91
- package/dist/session/BdgSession.d.ts.map +0 -1
- package/dist/session/BdgSession.js +0 -230
- package/dist/session/BdgSession.js.map +0 -1
- package/dist/ui/errors/SystemErrors.d.ts +0 -22
- package/dist/ui/errors/SystemErrors.d.ts.map +0 -1
- package/dist/ui/errors/SystemErrors.js +0 -23
- package/dist/ui/errors/SystemErrors.js.map +0 -1
- package/dist/ui/errors.d.ts +0 -39
- package/dist/ui/errors.d.ts.map +0 -1
- package/dist/ui/errors.js +0 -48
- package/dist/ui/errors.js.map +0 -1
- package/dist/ui/messages/deprecation.d.ts +0 -30
- package/dist/ui/messages/deprecation.d.ts.map +0 -1
- package/dist/ui/messages/deprecation.js +0 -49
- package/dist/ui/messages/deprecation.js.map +0 -1
- package/dist/ui/messages/index.d.ts +0 -12
- package/dist/ui/messages/index.d.ts.map +0 -1
- package/dist/ui/messages/index.js +0 -12
- package/dist/ui/messages/index.js.map +0 -1
- package/dist/utils/__tests__/filters.unit.test.d.ts +0 -2
- package/dist/utils/__tests__/filters.unit.test.d.ts.map +0 -1
- package/dist/utils/__tests__/filters.unit.test.js +0 -239
- package/dist/utils/__tests__/filters.unit.test.js.map +0 -1
- package/dist/utils/cdpHandlers.d.ts +0 -31
- package/dist/utils/cdpHandlers.d.ts.map +0 -1
- package/dist/utils/cdpHandlers.js +0 -38
- package/dist/utils/cdpHandlers.js.map +0 -1
- package/dist/utils/chromeDiagnostics.d.ts +0 -16
- package/dist/utils/chromeDiagnostics.d.ts.map +0 -1
- package/dist/utils/chromeDiagnostics.js +0 -37
- package/dist/utils/chromeDiagnostics.js.map +0 -1
- package/dist/utils/errors.d.ts +0 -82
- package/dist/utils/errors.d.ts.map +0 -1
- package/dist/utils/errors.js +0 -88
- package/dist/utils/errors.js.map +0 -1
- package/dist/utils/filters.d.ts +0 -148
- package/dist/utils/filters.d.ts.map +0 -1
- package/dist/utils/filters.js +0 -358
- package/dist/utils/filters.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -98
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -93
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/pageReadiness.d.ts +0 -46
- package/dist/utils/pageReadiness.d.ts.map +0 -1
- package/dist/utils/pageReadiness.js +0 -270
- package/dist/utils/pageReadiness.js.map +0 -1
- package/dist/utils/session.d.ts +0 -200
- package/dist/utils/session.d.ts.map +0 -1
- package/dist/utils/session.js +0 -498
- package/dist/utils/session.js.map +0 -1
- package/dist/utils/validation.d.ts +0 -12
- package/dist/utils/validation.d.ts.map +0 -1
- package/dist/utils/validation.js +0 -20
- package/dist/utils/validation.js.map +0 -1
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Machine-readable help generation using Commander.js introspection API.
|
|
3
|
-
*
|
|
4
|
-
* @module help/machineReadableHelp
|
|
5
|
-
*/
|
|
6
|
-
import { filterDefined } from '../utils/objects.js';
|
|
7
|
-
/**
|
|
8
|
-
* Converts a Commander Option to OptionMetadata.
|
|
9
|
-
*
|
|
10
|
-
* @param option - Commander option instance
|
|
11
|
-
* @returns Option metadata
|
|
12
|
-
*/
|
|
13
|
-
function convertOption(option) {
|
|
14
|
-
return filterDefined({
|
|
15
|
-
flags: option.flags,
|
|
16
|
-
description: option.description,
|
|
17
|
-
required: option.required,
|
|
18
|
-
optional: option.optional,
|
|
19
|
-
defaultValue: option.defaultValue,
|
|
20
|
-
defaultValueDescription: option.defaultValueDescription,
|
|
21
|
-
choices: option.argChoices,
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Converts a Commander Argument to ArgumentMetadata.
|
|
26
|
-
*
|
|
27
|
-
* @param argument - Commander argument instance
|
|
28
|
-
* @returns Argument metadata
|
|
29
|
-
*/
|
|
30
|
-
function convertArgument(argument) {
|
|
31
|
-
return filterDefined({
|
|
32
|
-
name: argument.name(),
|
|
33
|
-
description: argument.description,
|
|
34
|
-
required: argument.required,
|
|
35
|
-
variadic: argument.variadic,
|
|
36
|
-
defaultValue: argument.defaultValue,
|
|
37
|
-
choices: argument.argChoices,
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Recursively converts a Commander Command to CommandMetadata.
|
|
42
|
-
*
|
|
43
|
-
* @param command - Commander command instance
|
|
44
|
-
* @returns Command metadata
|
|
45
|
-
*/
|
|
46
|
-
function convertCommand(command) {
|
|
47
|
-
return {
|
|
48
|
-
name: command.name(),
|
|
49
|
-
aliases: command.aliases(),
|
|
50
|
-
description: command.description(),
|
|
51
|
-
usage: command.usage(),
|
|
52
|
-
arguments: command.registeredArguments.map(convertArgument),
|
|
53
|
-
options: command.options.map(convertOption),
|
|
54
|
-
subcommands: command.commands.map(convertCommand),
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Generates machine-readable help from a Commander program.
|
|
59
|
-
*
|
|
60
|
-
* @param program - Commander program instance
|
|
61
|
-
* @returns Machine-readable help structure
|
|
62
|
-
*
|
|
63
|
-
* @example
|
|
64
|
-
* ```typescript
|
|
65
|
-
* import { program } from 'commander';
|
|
66
|
-
* import { generateMachineReadableHelp } from './help/machineReadableHelp.js';
|
|
67
|
-
*
|
|
68
|
-
* const help = generateMachineReadableHelp(program);
|
|
69
|
-
* console.log(JSON.stringify(help, null, 2));
|
|
70
|
-
* ```
|
|
71
|
-
*/
|
|
72
|
-
export function generateMachineReadableHelp(program) {
|
|
73
|
-
return {
|
|
74
|
-
name: program.name(),
|
|
75
|
-
version: program.version() ?? 'unknown',
|
|
76
|
-
description: program.description(),
|
|
77
|
-
command: convertCommand(program),
|
|
78
|
-
exitCodes: [
|
|
79
|
-
{ code: 0, name: 'SUCCESS', description: 'Operation completed successfully' },
|
|
80
|
-
{ code: 1, name: 'GENERIC_FAILURE', description: 'Generic failure' },
|
|
81
|
-
{
|
|
82
|
-
code: 80,
|
|
83
|
-
name: 'INVALID_URL',
|
|
84
|
-
description: 'Invalid URL format provided',
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
code: 81,
|
|
88
|
-
name: 'INVALID_ARGUMENTS',
|
|
89
|
-
description: 'Invalid command arguments',
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
code: 82,
|
|
93
|
-
name: 'PERMISSION_DENIED',
|
|
94
|
-
description: 'Insufficient permissions',
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
code: 83,
|
|
98
|
-
name: 'RESOURCE_NOT_FOUND',
|
|
99
|
-
description: 'Required resource not found',
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
code: 84,
|
|
103
|
-
name: 'RESOURCE_BUSY',
|
|
104
|
-
description: 'Resource is currently in use',
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
code: 85,
|
|
108
|
-
name: 'OPERATION_NOT_PERMITTED',
|
|
109
|
-
description: 'Operation not permitted in current state',
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
code: 86,
|
|
113
|
-
name: 'DAEMON_ALREADY_RUNNING',
|
|
114
|
-
description: 'Daemon is already running',
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
code: 100,
|
|
118
|
-
name: 'CHROME_LAUNCH_FAILURE',
|
|
119
|
-
description: 'Failed to launch Chrome browser',
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
code: 101,
|
|
123
|
-
name: 'CDP_CONNECTION_FAILURE',
|
|
124
|
-
description: 'Failed to connect to Chrome DevTools Protocol',
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
code: 102,
|
|
128
|
-
name: 'CDP_TIMEOUT',
|
|
129
|
-
description: 'CDP operation timed out',
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
code: 110,
|
|
133
|
-
name: 'IPC_ERROR',
|
|
134
|
-
description: 'Inter-process communication error',
|
|
135
|
-
},
|
|
136
|
-
],
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
//# sourceMappingURL=machineReadableHelp.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"machineReadableHelp.js","sourceRoot":"","sources":["../../src/help/machineReadableHelp.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAmFnD;;;;;GAKG;AACH,SAAS,aAAa,CAAC,MAAc;IACnC,OAAO,aAAa,CAAC;QACnB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,uBAAuB,EAAE,MAAM,CAAC,uBAAuB;QACvD,OAAO,EAAE,MAAM,CAAC,UAAU;KAC3B,CAA8B,CAAC;AAClC,CAAC;AAED;;;;;GAKG;AACH,SAAS,eAAe,CAAC,QAAkB;IACzC,OAAO,aAAa,CAAC;QACnB,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE;QACrB,WAAW,EAAE,QAAQ,CAAC,WAAW;QACjC,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,YAAY,EAAE,QAAQ,CAAC,YAAY;QACnC,OAAO,EAAE,QAAQ,CAAC,UAAU;KAC7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ACR,IAAI,EAAE,oBAAoB;gBAC1B,WAAW,EAAE,6BAA6B;aAC3C;YACD;gBACE,IAAI,EAAE,EAAE;gBACR,IAAI,EAAE,eAAe;gBACrB,WAAW,EAAE,8BAA8B;aAC5C;YACD;gBACE,IAAI,EAAE,EAAE;gBACR,IAAI,EAAE,yBAAyB;gBAC/B,WAAW,EAAE,0CAA0C;aACxD;YACD;gBACE,IAAI,EAAE,EAAE;gBACR,IAAI,EAAE,wBAAwB;gBAC9B,WAAW,EAAE,2BAA2B;aACzC;YACD;gBACE,IAAI,EAAE,GAAG;gBACT,IAAI,EAAE,uBAAuB;gBAC7B,WAAW,EAAE,iCAAiC;aAC/C;YACD;gBACE,IAAI,EAAE,GAAG;gBACT,IAAI,EAAE,wBAAwB;gBAC9B,WAAW,EAAE,+CAA+C;aAC7D;YACD;gBACE,IAAI,EAAE,GAAG;gBACT,IAAI,EAAE,aAAa;gBACnB,WAAW,EAAE,yBAAyB;aACvC;YACD;gBACE,IAAI,EAAE,GAAG;gBACT,IAAI,EAAE,WAAW;gBACjB,WAAW,EAAE,mCAAmC;aACjD;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { CDPConnection } from '../connection/cdp.js';
|
|
2
|
-
import type { CDPTarget, CollectorType, NetworkRequest, ConsoleMessage, BdgOutput, SessionOptions } from '../types.js';
|
|
3
|
-
/**
|
|
4
|
-
* Manages a browser debugging session.
|
|
5
|
-
*
|
|
6
|
-
* Encapsulates the lifecycle of collecting telemetry from a browser tab:
|
|
7
|
-
* - CDP connection management
|
|
8
|
-
* - Collector initialization and cleanup
|
|
9
|
-
* - Data aggregation
|
|
10
|
-
* - Graceful shutdown with final snapshot
|
|
11
|
-
*/
|
|
12
|
-
export declare class BdgSession {
|
|
13
|
-
private target;
|
|
14
|
-
private port;
|
|
15
|
-
private cdp;
|
|
16
|
-
private collectors;
|
|
17
|
-
private startTime;
|
|
18
|
-
private isActive;
|
|
19
|
-
private networkRequests;
|
|
20
|
-
private consoleLogs;
|
|
21
|
-
private activeCollectors;
|
|
22
|
-
private sessionOptions;
|
|
23
|
-
constructor(target: CDPTarget, port: number, options?: SessionOptions);
|
|
24
|
-
connect(): Promise<void>;
|
|
25
|
-
/**
|
|
26
|
-
* Start a specific data collector.
|
|
27
|
-
*
|
|
28
|
-
* @param type - Type of collector to start ('dom', 'network', or 'console')
|
|
29
|
-
* @throws Error if session is not active
|
|
30
|
-
*/
|
|
31
|
-
startCollector(type: CollectorType): Promise<void>;
|
|
32
|
-
/**
|
|
33
|
-
* Stop the session and return collected telemetry.
|
|
34
|
-
*
|
|
35
|
-
* Captures final DOM snapshot, aggregates all collected data,
|
|
36
|
-
* and performs cleanup of CDP connection and collectors.
|
|
37
|
-
*
|
|
38
|
-
* @returns Complete telemetry output with success/error status
|
|
39
|
-
* @throws Error if session is not active
|
|
40
|
-
*/
|
|
41
|
-
stop(): Promise<BdgOutput>;
|
|
42
|
-
/**
|
|
43
|
-
* Check if the session is active and connected.
|
|
44
|
-
*
|
|
45
|
-
* @returns True if session is active and CDP connection is open
|
|
46
|
-
*/
|
|
47
|
-
isConnected(): boolean;
|
|
48
|
-
/**
|
|
49
|
-
* Get the CDP target information for this session.
|
|
50
|
-
*
|
|
51
|
-
* @returns Target information (URL, title, ID, etc.)
|
|
52
|
-
*/
|
|
53
|
-
getTarget(): CDPTarget;
|
|
54
|
-
/**
|
|
55
|
-
* Get the CDP connection instance.
|
|
56
|
-
*
|
|
57
|
-
* Useful for registering additional event handlers or sending custom commands.
|
|
58
|
-
*
|
|
59
|
-
* @returns CDP connection instance
|
|
60
|
-
*/
|
|
61
|
-
getCDP(): CDPConnection;
|
|
62
|
-
/**
|
|
63
|
-
* Get collected network requests.
|
|
64
|
-
*
|
|
65
|
-
* Useful for live preview of collected data without stopping the session.
|
|
66
|
-
*
|
|
67
|
-
* @returns Array of network requests collected so far
|
|
68
|
-
*/
|
|
69
|
-
getNetworkRequests(): NetworkRequest[];
|
|
70
|
-
/**
|
|
71
|
-
* Get collected console messages.
|
|
72
|
-
*
|
|
73
|
-
* Useful for live preview of collected data without stopping the session.
|
|
74
|
-
*
|
|
75
|
-
* @returns Array of console messages collected so far
|
|
76
|
-
*/
|
|
77
|
-
getConsoleLogs(): ConsoleMessage[];
|
|
78
|
-
/**
|
|
79
|
-
* Get session start time.
|
|
80
|
-
*
|
|
81
|
-
* @returns Timestamp when session was created
|
|
82
|
-
*/
|
|
83
|
-
getStartTime(): number;
|
|
84
|
-
/**
|
|
85
|
-
* Get list of active collectors.
|
|
86
|
-
*
|
|
87
|
-
* @returns Array of collector types that are currently active
|
|
88
|
-
*/
|
|
89
|
-
getActiveCollectors(): CollectorType[];
|
|
90
|
-
}
|
|
91
|
-
//# sourceMappingURL=BdgSession.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BdgSession.d.ts","sourceRoot":"","sources":["../../src/session/BdgSession.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EACb,cAAc,EACd,cAAc,EAEd,SAAS,EAET,cAAc,EACf,MAAM,SAAS,CAAC;AAGjB;;;;;;;;GAQG;AACH,qBAAa,UAAU;IAWnB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,IAAI;IAXd,OAAO,CAAC,GAAG,CAAgB;IAC3B,OAAO,CAAC,UAAU,CAA6C;IAC/D,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,eAAe,CAAwB;IAC/C,OAAO,CAAC,WAAW,CAAwB;IAC3C,OAAO,CAAC,gBAAgB,CAAuB;IAC/C,OAAO,CAAC,cAAc,CAAiB;gBAG7B,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,MAAM,EACpB,OAAO,GAAE,cAAmB;IAOxB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAqB9B;;;;;OAKG;IACG,cAAc,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IA+CxD;;;;;;;;OAQG;IACG,IAAI,IAAI,OAAO,CAAC,SAAS,CAAC;IA2EhC;;;;OAIG;IACH,WAAW,IAAI,OAAO;IAItB;;;;OAIG;IACH,SAAS,IAAI,SAAS;IAItB;;;;;;OAMG;IACH,MAAM,IAAI,aAAa;IAIvB;;;;;;OAMG;IACH,kBAAkB,IAAI,cAAc,EAAE;IAItC;;;;;;OAMG;IACH,cAAc,IAAI,cAAc,EAAE;IAIlC;;;;OAIG;IACH,YAAY,IAAI,MAAM;IAItB;;;;OAIG;IACH,mBAAmB,IAAI,aAAa,EAAE;CAGvC"}
|
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
import { startConsoleCollection } from '../collectors/console.js';
|
|
2
|
-
import { prepareDOMCollection, collectDOM } from '../collectors/dom.js';
|
|
3
|
-
import { startNetworkCollection } from '../collectors/network.js';
|
|
4
|
-
import { CDPConnection } from '../connection/cdp.js';
|
|
5
|
-
import { validateTarget } from '../connection/finder.js';
|
|
6
|
-
import { VERSION } from '../utils/version.js';
|
|
7
|
-
/**
|
|
8
|
-
* Manages a browser debugging session.
|
|
9
|
-
*
|
|
10
|
-
* Encapsulates the lifecycle of collecting telemetry from a browser tab:
|
|
11
|
-
* - CDP connection management
|
|
12
|
-
* - Collector initialization and cleanup
|
|
13
|
-
* - Data aggregation
|
|
14
|
-
* - Graceful shutdown with final snapshot
|
|
15
|
-
*/
|
|
16
|
-
export class BdgSession {
|
|
17
|
-
target;
|
|
18
|
-
port;
|
|
19
|
-
cdp;
|
|
20
|
-
collectors = new Map();
|
|
21
|
-
startTime;
|
|
22
|
-
isActive = false;
|
|
23
|
-
networkRequests = [];
|
|
24
|
-
consoleLogs = [];
|
|
25
|
-
activeCollectors = [];
|
|
26
|
-
sessionOptions;
|
|
27
|
-
constructor(target, port, options = {}) {
|
|
28
|
-
this.target = target;
|
|
29
|
-
this.port = port;
|
|
30
|
-
this.cdp = new CDPConnection();
|
|
31
|
-
this.startTime = Date.now();
|
|
32
|
-
this.sessionOptions = options;
|
|
33
|
-
}
|
|
34
|
-
async connect() {
|
|
35
|
-
// Connect with retry and keepalive (no auto-reconnect for CLI use)
|
|
36
|
-
await this.cdp.connect(this.target.webSocketDebuggerUrl, {
|
|
37
|
-
maxRetries: 3,
|
|
38
|
-
autoReconnect: false,
|
|
39
|
-
keepaliveInterval: 30000,
|
|
40
|
-
});
|
|
41
|
-
// Validate target still exists
|
|
42
|
-
const targetExists = await validateTarget(this.target.id, this.port);
|
|
43
|
-
if (!targetExists) {
|
|
44
|
-
this.cdp.close();
|
|
45
|
-
throw new Error('Target tab closed during connection');
|
|
46
|
-
}
|
|
47
|
-
// Enable Target domain to receive targetDestroyed events
|
|
48
|
-
await this.cdp.send('Target.setDiscoverTargets', { discover: true });
|
|
49
|
-
this.isActive = true;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Start a specific data collector.
|
|
53
|
-
*
|
|
54
|
-
* @param type - Type of collector to start ('dom', 'network', or 'console')
|
|
55
|
-
* @throws Error if session is not active
|
|
56
|
-
*/
|
|
57
|
-
async startCollector(type) {
|
|
58
|
-
if (!this.isActive) {
|
|
59
|
-
throw new Error('Session not active');
|
|
60
|
-
}
|
|
61
|
-
this.activeCollectors.push(type);
|
|
62
|
-
let cleanup;
|
|
63
|
-
switch (type) {
|
|
64
|
-
case 'network': {
|
|
65
|
-
const networkOptions = {};
|
|
66
|
-
if (this.sessionOptions.includeAll !== undefined) {
|
|
67
|
-
networkOptions.includeAll = this.sessionOptions.includeAll;
|
|
68
|
-
}
|
|
69
|
-
if (this.sessionOptions.fetchAllBodies !== undefined) {
|
|
70
|
-
networkOptions.fetchAllBodies = this.sessionOptions.fetchAllBodies;
|
|
71
|
-
}
|
|
72
|
-
if (this.sessionOptions.fetchBodiesInclude !== undefined) {
|
|
73
|
-
networkOptions.fetchBodiesInclude = this.sessionOptions.fetchBodiesInclude;
|
|
74
|
-
}
|
|
75
|
-
if (this.sessionOptions.fetchBodiesExclude !== undefined) {
|
|
76
|
-
networkOptions.fetchBodiesExclude = this.sessionOptions.fetchBodiesExclude;
|
|
77
|
-
}
|
|
78
|
-
if (this.sessionOptions.networkInclude !== undefined) {
|
|
79
|
-
networkOptions.networkInclude = this.sessionOptions.networkInclude;
|
|
80
|
-
}
|
|
81
|
-
if (this.sessionOptions.networkExclude !== undefined) {
|
|
82
|
-
networkOptions.networkExclude = this.sessionOptions.networkExclude;
|
|
83
|
-
}
|
|
84
|
-
cleanup = await startNetworkCollection(this.cdp, this.networkRequests, networkOptions);
|
|
85
|
-
break;
|
|
86
|
-
}
|
|
87
|
-
case 'console':
|
|
88
|
-
cleanup = await startConsoleCollection(this.cdp, this.consoleLogs, this.sessionOptions.includeAll ?? false);
|
|
89
|
-
break;
|
|
90
|
-
case 'dom':
|
|
91
|
-
cleanup = await prepareDOMCollection(this.cdp);
|
|
92
|
-
break;
|
|
93
|
-
}
|
|
94
|
-
this.collectors.set(type, cleanup);
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Stop the session and return collected telemetry.
|
|
98
|
-
*
|
|
99
|
-
* Captures final DOM snapshot, aggregates all collected data,
|
|
100
|
-
* and performs cleanup of CDP connection and collectors.
|
|
101
|
-
*
|
|
102
|
-
* @returns Complete telemetry output with success/error status
|
|
103
|
-
* @throws Error if session is not active
|
|
104
|
-
*/
|
|
105
|
-
async stop() {
|
|
106
|
-
if (!this.isActive) {
|
|
107
|
-
throw new Error('Session not active');
|
|
108
|
-
}
|
|
109
|
-
console.error('Capturing final state...');
|
|
110
|
-
// Attempt to capture DOM if it's an active collector
|
|
111
|
-
let domData;
|
|
112
|
-
if (this.activeCollectors.includes('dom')) {
|
|
113
|
-
try {
|
|
114
|
-
console.error('Capturing DOM snapshot...');
|
|
115
|
-
domData = await collectDOM(this.cdp);
|
|
116
|
-
console.error('DOM snapshot captured successfully');
|
|
117
|
-
}
|
|
118
|
-
catch (domError) {
|
|
119
|
-
// Chrome may be closing during shutdown, ignore DOM capture failures
|
|
120
|
-
console.error('Warning: DOM capture failed (Chrome may be closing):', domError instanceof Error ? domError.message : String(domError));
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
// Build output (even if DOM capture failed)
|
|
124
|
-
const output = {
|
|
125
|
-
version: VERSION,
|
|
126
|
-
success: true,
|
|
127
|
-
timestamp: new Date().toISOString(),
|
|
128
|
-
duration: Date.now() - this.startTime,
|
|
129
|
-
target: {
|
|
130
|
-
url: domData?.url ?? this.target.url,
|
|
131
|
-
title: domData?.title ?? this.target.title,
|
|
132
|
-
},
|
|
133
|
-
data: {},
|
|
134
|
-
};
|
|
135
|
-
// Add collected data
|
|
136
|
-
if (this.activeCollectors.includes('dom') && domData) {
|
|
137
|
-
output.data.dom = domData;
|
|
138
|
-
}
|
|
139
|
-
if (this.activeCollectors.includes('network')) {
|
|
140
|
-
output.data.network = this.networkRequests;
|
|
141
|
-
}
|
|
142
|
-
if (this.activeCollectors.includes('console')) {
|
|
143
|
-
output.data.console = this.consoleLogs;
|
|
144
|
-
}
|
|
145
|
-
// Clean up collectors (skip CDP domain disabling during shutdown to avoid hanging)
|
|
146
|
-
try {
|
|
147
|
-
console.error('Cleaning up session...');
|
|
148
|
-
// Call cleanup functions for all collectors
|
|
149
|
-
this.collectors.forEach((cleanup) => cleanup());
|
|
150
|
-
this.collectors.clear();
|
|
151
|
-
// Skip disabling CDP domains - Chrome may be dead during SIGINT shutdown
|
|
152
|
-
// Just close the connection and mark as inactive
|
|
153
|
-
try {
|
|
154
|
-
this.cdp.close();
|
|
155
|
-
}
|
|
156
|
-
catch {
|
|
157
|
-
// Ignore close errors
|
|
158
|
-
}
|
|
159
|
-
this.isActive = false;
|
|
160
|
-
console.error('Session cleanup complete');
|
|
161
|
-
}
|
|
162
|
-
catch (cleanupError) {
|
|
163
|
-
console.error('Warning: Cleanup error:', cleanupError instanceof Error ? cleanupError.message : String(cleanupError));
|
|
164
|
-
}
|
|
165
|
-
return output;
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Check if the session is active and connected.
|
|
169
|
-
*
|
|
170
|
-
* @returns True if session is active and CDP connection is open
|
|
171
|
-
*/
|
|
172
|
-
isConnected() {
|
|
173
|
-
return this.isActive && this.cdp.isConnected();
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Get the CDP target information for this session.
|
|
177
|
-
*
|
|
178
|
-
* @returns Target information (URL, title, ID, etc.)
|
|
179
|
-
*/
|
|
180
|
-
getTarget() {
|
|
181
|
-
return this.target;
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Get the CDP connection instance.
|
|
185
|
-
*
|
|
186
|
-
* Useful for registering additional event handlers or sending custom commands.
|
|
187
|
-
*
|
|
188
|
-
* @returns CDP connection instance
|
|
189
|
-
*/
|
|
190
|
-
getCDP() {
|
|
191
|
-
return this.cdp;
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* Get collected network requests.
|
|
195
|
-
*
|
|
196
|
-
* Useful for live preview of collected data without stopping the session.
|
|
197
|
-
*
|
|
198
|
-
* @returns Array of network requests collected so far
|
|
199
|
-
*/
|
|
200
|
-
getNetworkRequests() {
|
|
201
|
-
return this.networkRequests;
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* Get collected console messages.
|
|
205
|
-
*
|
|
206
|
-
* Useful for live preview of collected data without stopping the session.
|
|
207
|
-
*
|
|
208
|
-
* @returns Array of console messages collected so far
|
|
209
|
-
*/
|
|
210
|
-
getConsoleLogs() {
|
|
211
|
-
return this.consoleLogs;
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Get session start time.
|
|
215
|
-
*
|
|
216
|
-
* @returns Timestamp when session was created
|
|
217
|
-
*/
|
|
218
|
-
getStartTime() {
|
|
219
|
-
return this.startTime;
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
* Get list of active collectors.
|
|
223
|
-
*
|
|
224
|
-
* @returns Array of collector types that are currently active
|
|
225
|
-
*/
|
|
226
|
-
getActiveCollectors() {
|
|
227
|
-
return this.activeCollectors;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
//# sourceMappingURL=BdgSession.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BdgSession.js","sourceRoot":"","sources":["../../src/session/BdgSession.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAWxD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C;;;;;;;;GAQG;AACH,MAAM,OAAO,UAAU;IAWX;IACA;IAXF,GAAG,CAAgB;IACnB,UAAU,GAAG,IAAI,GAAG,EAAkC,CAAC;IACvD,SAAS,CAAS;IAClB,QAAQ,GAAG,KAAK,CAAC;IACjB,eAAe,GAAqB,EAAE,CAAC;IACvC,WAAW,GAAqB,EAAE,CAAC;IACnC,gBAAgB,GAAoB,EAAE,CAAC;IACvC,cAAc,CAAiB;IAEvC,YACU,MAAiB,EACjB,IAAY,EACpB,UAA0B,EAAE;QAFpB,WAAM,GAAN,MAAM,CAAW;QACjB,SAAI,GAAJ,IAAI,CAAQ;QAGpB,IAAI,CAAC,GAAG,GAAG,IAAI,aAAa,EAAE,CAAC;QAC/B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC5B,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,OAAO;QACX,mEAAmE;QACnE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;;OAMG;IACH,MAAM;QACJ,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;IAED;;;;;;OAMG;IACH,kBAAkB;QAChB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IAED;;;;;;OAMG;IACH,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED;;;;OAIG;IACH,YAAY;QACV,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACH,mBAAmB;QACjB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;CACF"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Legacy system error classes (deprecated).
|
|
3
|
-
*
|
|
4
|
-
* This file will be removed. Domain errors have been moved to their respective modules.
|
|
5
|
-
* Use connection/errors.ts for CDP and Chrome errors.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Base error class for all bdg system errors (legacy).
|
|
9
|
-
*
|
|
10
|
-
* No longer used. Domain modules define their own error base classes.
|
|
11
|
-
*
|
|
12
|
-
* Extends native Error with error codes for programmatic handling,
|
|
13
|
-
* category for filtering, exit codes for semantic exit codes,
|
|
14
|
-
* and cause chaining for nested errors.
|
|
15
|
-
*/
|
|
16
|
-
export declare abstract class BdgError extends Error {
|
|
17
|
-
abstract readonly code: string;
|
|
18
|
-
abstract readonly category: 'system' | 'user' | 'external';
|
|
19
|
-
abstract readonly exitCode: number;
|
|
20
|
-
constructor(message: string, cause?: Error);
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=SystemErrors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SystemErrors.d.ts","sourceRoot":"","sources":["../../../src/ui/errors/SystemErrors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;;GAQG;AACH,8BAAsB,QAAS,SAAQ,KAAK;IAC1C,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;IAC3D,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;gBAEvB,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAK3C"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Legacy system error classes (deprecated).
|
|
3
|
-
*
|
|
4
|
-
* This file will be removed. Domain errors have been moved to their respective modules.
|
|
5
|
-
* Use connection/errors.ts for CDP and Chrome errors.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Base error class for all bdg system errors (legacy).
|
|
9
|
-
*
|
|
10
|
-
* No longer used. Domain modules define their own error base classes.
|
|
11
|
-
*
|
|
12
|
-
* Extends native Error with error codes for programmatic handling,
|
|
13
|
-
* category for filtering, exit codes for semantic exit codes,
|
|
14
|
-
* and cause chaining for nested errors.
|
|
15
|
-
*/
|
|
16
|
-
export class BdgError extends Error {
|
|
17
|
-
constructor(message, cause) {
|
|
18
|
-
super(message);
|
|
19
|
-
this.name = this.constructor.name;
|
|
20
|
-
this.cause = cause;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=SystemErrors.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SystemErrors.js","sourceRoot":"","sources":["../../../src/ui/errors/SystemErrors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;;GAQG;AACH,MAAM,OAAgB,QAAS,SAAQ,KAAK;IAK1C,YAAY,OAAe,EAAE,KAAa;QACxC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;QAClC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF"}
|
package/dist/ui/errors.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Structured error handling for CLI commands.
|
|
3
|
-
*
|
|
4
|
-
* Provides CommandError class for throwing errors with metadata and exit codes.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Custom error class for CLI commands with structured metadata.
|
|
8
|
-
*
|
|
9
|
-
* Extends Error to include additional context like suggestions, notes,
|
|
10
|
-
* and specific exit codes for better user experience and automation support.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```typescript
|
|
14
|
-
* throw new CommandError(
|
|
15
|
-
* 'Session not found',
|
|
16
|
-
* { suggestion: 'Start a session with: bdg <url>' },
|
|
17
|
-
* EXIT_CODES.RESOURCE_NOT_FOUND
|
|
18
|
-
* );
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export declare class CommandError extends Error {
|
|
22
|
-
/**
|
|
23
|
-
* Additional context for the error (suggestions, notes, etc.)
|
|
24
|
-
*/
|
|
25
|
-
readonly metadata: Record<string, string>;
|
|
26
|
-
/**
|
|
27
|
-
* Specific exit code for this error
|
|
28
|
-
*/
|
|
29
|
-
readonly exitCode: number;
|
|
30
|
-
/**
|
|
31
|
-
* Create a new CommandError
|
|
32
|
-
*
|
|
33
|
-
* @param message - Main error message
|
|
34
|
-
* @param metadata - Additional context (suggestions, notes, etc.)
|
|
35
|
-
* @param exitCode - Exit code to use when this error occurs
|
|
36
|
-
*/
|
|
37
|
-
constructor(message: string, metadata?: Record<string, string>, exitCode?: number);
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=errors.d.ts.map
|
package/dist/ui/errors.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/ui/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;GAcG;AACH,qBAAa,YAAa,SAAQ,KAAK;IACrC;;OAEG;IACH,SAAgB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEjD;;OAEG;IACH,SAAgB,QAAQ,EAAE,MAAM,CAAC;IAEjC;;;;;;OAMG;gBACS,OAAO,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,EAAE,QAAQ,GAAE,MAAU;CAWzF"}
|
package/dist/ui/errors.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Structured error handling for CLI commands.
|
|
3
|
-
*
|
|
4
|
-
* Provides CommandError class for throwing errors with metadata and exit codes.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Custom error class for CLI commands with structured metadata.
|
|
8
|
-
*
|
|
9
|
-
* Extends Error to include additional context like suggestions, notes,
|
|
10
|
-
* and specific exit codes for better user experience and automation support.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```typescript
|
|
14
|
-
* throw new CommandError(
|
|
15
|
-
* 'Session not found',
|
|
16
|
-
* { suggestion: 'Start a session with: bdg <url>' },
|
|
17
|
-
* EXIT_CODES.RESOURCE_NOT_FOUND
|
|
18
|
-
* );
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export class CommandError extends Error {
|
|
22
|
-
/**
|
|
23
|
-
* Additional context for the error (suggestions, notes, etc.)
|
|
24
|
-
*/
|
|
25
|
-
metadata;
|
|
26
|
-
/**
|
|
27
|
-
* Specific exit code for this error
|
|
28
|
-
*/
|
|
29
|
-
exitCode;
|
|
30
|
-
/**
|
|
31
|
-
* Create a new CommandError
|
|
32
|
-
*
|
|
33
|
-
* @param message - Main error message
|
|
34
|
-
* @param metadata - Additional context (suggestions, notes, etc.)
|
|
35
|
-
* @param exitCode - Exit code to use when this error occurs
|
|
36
|
-
*/
|
|
37
|
-
constructor(message, metadata = {}, exitCode = 1) {
|
|
38
|
-
super(message);
|
|
39
|
-
this.name = 'CommandError';
|
|
40
|
-
this.metadata = metadata;
|
|
41
|
-
this.exitCode = exitCode;
|
|
42
|
-
// Maintains proper stack trace for where our error was thrown
|
|
43
|
-
if (Error.captureStackTrace) {
|
|
44
|
-
Error.captureStackTrace(this, CommandError);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=errors.js.map
|
package/dist/ui/errors.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/ui/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK;IACrC;;OAEG;IACa,QAAQ,CAAyB;IAEjD;;OAEG;IACa,QAAQ,CAAS;IAEjC;;;;;;OAMG;IACH,YAAY,OAAe,EAAE,WAAmC,EAAE,EAAE,WAAmB,CAAC;QACtF,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;QAC3B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,8DAA8D;QAC9D,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Deprecation warning messages
|
|
3
|
-
*
|
|
4
|
-
* Messages for deprecated flags and features that will be removed in future versions.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Generate deprecation warning for peek --follow flag.
|
|
8
|
-
*
|
|
9
|
-
* @returns Formatted deprecation warning message
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```typescript
|
|
13
|
-
* console.error(peekFollowDeprecationWarning());
|
|
14
|
-
* // Output: "⚠️ Deprecation Warning: The --follow flag will be removed in v1.0"
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
export declare function peekFollowDeprecationWarning(): string;
|
|
18
|
-
/**
|
|
19
|
-
* Generate deprecation warning for stop --kill-chrome flag.
|
|
20
|
-
*
|
|
21
|
-
* @returns Formatted deprecation warning message
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```typescript
|
|
25
|
-
* console.error(stopKillChromeDeprecationWarning());
|
|
26
|
-
* // Output: "⚠️ Deprecation Warning: The --kill-chrome flag will be removed in v1.0"
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
export declare function stopKillChromeDeprecationWarning(): string;
|
|
30
|
-
//# sourceMappingURL=deprecation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deprecation.d.ts","sourceRoot":"","sources":["../../../src/ui/messages/deprecation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;;;;;;;;;GAUG;AACH,wBAAgB,4BAA4B,IAAI,MAAM,CAQrD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gCAAgC,IAAI,MAAM,CAQzD"}
|