browser-debugger-cli 0.6.10 → 0.6.11

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 (227) hide show
  1. package/README.md +10 -0
  2. package/dist/commands/cdp.js +1 -1
  3. package/dist/commands/cdp.js.map +1 -1
  4. package/dist/commands/cleanup.js +1 -1
  5. package/dist/commands/cleanup.js.map +1 -1
  6. package/dist/commands/console.d.ts +4 -28
  7. package/dist/commands/console.d.ts.map +1 -1
  8. package/dist/commands/console.js +81 -187
  9. package/dist/commands/console.js.map +1 -1
  10. package/dist/commands/details.d.ts.map +1 -1
  11. package/dist/commands/details.js +8 -0
  12. package/dist/commands/details.js.map +1 -1
  13. package/dist/commands/dom/DomElementResolver.d.ts +2 -2
  14. package/dist/commands/dom/DomElementResolver.d.ts.map +1 -1
  15. package/dist/commands/dom/DomElementResolver.js +6 -6
  16. package/dist/commands/dom/DomElementResolver.js.map +1 -1
  17. package/dist/commands/dom/__tests__/screenshotResize.unit.test.d.ts +2 -0
  18. package/dist/commands/dom/__tests__/screenshotResize.unit.test.d.ts.map +1 -0
  19. package/dist/commands/dom/__tests__/screenshotResize.unit.test.js +184 -0
  20. package/dist/commands/dom/__tests__/screenshotResize.unit.test.js.map +1 -0
  21. package/dist/commands/dom/a11y.d.ts.map +1 -1
  22. package/dist/commands/dom/a11y.js +9 -9
  23. package/dist/commands/dom/a11y.js.map +1 -1
  24. package/dist/commands/dom/evalHelpers.d.ts.map +1 -1
  25. package/dist/commands/dom/evalHelpers.js +10 -7
  26. package/dist/commands/dom/evalHelpers.js.map +1 -1
  27. package/dist/commands/dom/formFillHelpers.d.ts +2 -1
  28. package/dist/commands/dom/formFillHelpers.d.ts.map +1 -1
  29. package/dist/commands/dom/formFillHelpers.js +22 -20
  30. package/dist/commands/dom/formFillHelpers.js.map +1 -1
  31. package/dist/commands/dom/formInteraction.d.ts.map +1 -1
  32. package/dist/commands/dom/formInteraction.js +26 -10
  33. package/dist/commands/dom/formInteraction.js.map +1 -1
  34. package/dist/commands/dom/formSubmitHelpers.d.ts +2 -1
  35. package/dist/commands/dom/formSubmitHelpers.d.ts.map +1 -1
  36. package/dist/commands/dom/formSubmitHelpers.js.map +1 -1
  37. package/dist/commands/dom/helpers.d.ts +11 -4
  38. package/dist/commands/dom/helpers.d.ts.map +1 -1
  39. package/dist/commands/dom/helpers.js +324 -40
  40. package/dist/commands/dom/helpers.js.map +1 -1
  41. package/dist/commands/dom/index.d.ts.map +1 -1
  42. package/dist/commands/dom/index.js +15 -5
  43. package/dist/commands/dom/index.js.map +1 -1
  44. package/dist/commands/dom/reactEventHelpers.d.ts +4 -4
  45. package/dist/commands/dom/reactEventHelpers.d.ts.map +1 -1
  46. package/dist/commands/dom/reactEventHelpers.js +11 -11
  47. package/dist/commands/dom/screenshotResize.d.ts +81 -0
  48. package/dist/commands/dom/screenshotResize.d.ts.map +1 -0
  49. package/dist/commands/dom/screenshotResize.js +103 -0
  50. package/dist/commands/dom/screenshotResize.js.map +1 -0
  51. package/dist/commands/helpJson.d.ts +20 -0
  52. package/dist/commands/helpJson.d.ts.map +1 -1
  53. package/dist/commands/helpJson.js +21 -29
  54. package/dist/commands/helpJson.js.map +1 -1
  55. package/dist/commands/network/har.d.ts.map +1 -1
  56. package/dist/commands/network/har.js +3 -2
  57. package/dist/commands/network/har.js.map +1 -1
  58. package/dist/commands/network/list.d.ts +0 -8
  59. package/dist/commands/network/list.d.ts.map +1 -1
  60. package/dist/commands/network/list.js +131 -201
  61. package/dist/commands/network/list.js.map +1 -1
  62. package/dist/commands/network/shared.d.ts.map +1 -1
  63. package/dist/commands/network/shared.js +6 -0
  64. package/dist/commands/network/shared.js.map +1 -1
  65. package/dist/commands/optionBehaviors.d.ts +26 -0
  66. package/dist/commands/optionBehaviors.d.ts.map +1 -0
  67. package/dist/commands/optionBehaviors.js +184 -0
  68. package/dist/commands/optionBehaviors.js.map +1 -0
  69. package/dist/commands/peek.d.ts +2 -4
  70. package/dist/commands/peek.d.ts.map +1 -1
  71. package/dist/commands/peek.js +108 -92
  72. package/dist/commands/peek.js.map +1 -1
  73. package/dist/commands/shared/CommandRunner.js +1 -1
  74. package/dist/commands/shared/CommandRunner.js.map +1 -1
  75. package/dist/commands/shared/dataFetcher.d.ts +58 -0
  76. package/dist/commands/shared/dataFetcher.d.ts.map +1 -0
  77. package/dist/commands/shared/dataFetcher.js +98 -0
  78. package/dist/commands/shared/dataFetcher.js.map +1 -0
  79. package/dist/commands/shared/optionTypes.d.ts +8 -4
  80. package/dist/commands/shared/optionTypes.d.ts.map +1 -1
  81. package/dist/commands/shared/startHelpers.d.ts.map +1 -1
  82. package/dist/commands/shared/startHelpers.js +6 -5
  83. package/dist/commands/shared/startHelpers.js.map +1 -1
  84. package/dist/commands/shared/validation.d.ts +0 -45
  85. package/dist/commands/shared/validation.d.ts.map +1 -1
  86. package/dist/commands/shared/validation.js +65 -107
  87. package/dist/commands/shared/validation.js.map +1 -1
  88. package/dist/commands/status.d.ts.map +1 -1
  89. package/dist/commands/status.js +13 -4
  90. package/dist/commands/status.js.map +1 -1
  91. package/dist/commands/stop.d.ts.map +1 -1
  92. package/dist/commands/stop.js +15 -4
  93. package/dist/commands/stop.js.map +1 -1
  94. package/dist/commands/tail.d.ts +2 -7
  95. package/dist/commands/tail.d.ts.map +1 -1
  96. package/dist/commands/tail.js +61 -64
  97. package/dist/commands/tail.js.map +1 -1
  98. package/dist/connection/cdp.d.ts.map +1 -1
  99. package/dist/connection/cdp.js +5 -3
  100. package/dist/connection/cdp.js.map +1 -1
  101. package/dist/connection/diagnostics.js +1 -1
  102. package/dist/connection/diagnostics.js.map +1 -1
  103. package/dist/connection/errors.d.ts +0 -7
  104. package/dist/connection/errors.d.ts.map +1 -1
  105. package/dist/connection/errors.js +0 -7
  106. package/dist/connection/errors.js.map +1 -1
  107. package/dist/connection/launcher/binaryResolver.d.ts.map +1 -1
  108. package/dist/connection/launcher/binaryResolver.js +2 -1
  109. package/dist/connection/launcher/binaryResolver.js.map +1 -1
  110. package/dist/connection/launcher/preferencesLoader.d.ts.map +1 -1
  111. package/dist/connection/launcher/preferencesLoader.js +2 -1
  112. package/dist/connection/launcher/preferencesLoader.js.map +1 -1
  113. package/dist/connection/launcher.d.ts.map +1 -1
  114. package/dist/connection/launcher.js +2 -1
  115. package/dist/connection/launcher.js.map +1 -1
  116. package/dist/connection/pageReadiness.d.ts.map +1 -1
  117. package/dist/connection/pageReadiness.js +2 -9
  118. package/dist/connection/pageReadiness.js.map +1 -1
  119. package/dist/daemon/handlers/BaseHandler.d.ts.map +1 -1
  120. package/dist/daemon/handlers/BaseHandler.js +1 -1
  121. package/dist/daemon/handlers/BaseHandler.js.map +1 -1
  122. package/dist/daemon/handlers/QueryHandlers.d.ts.map +1 -1
  123. package/dist/daemon/handlers/QueryHandlers.js +1 -1
  124. package/dist/daemon/handlers/QueryHandlers.js.map +1 -1
  125. package/dist/daemon/handlers/SessionHandlers.d.ts.map +1 -1
  126. package/dist/daemon/handlers/SessionHandlers.js +1 -1
  127. package/dist/daemon/handlers/SessionHandlers.js.map +1 -1
  128. package/dist/daemon/ipcServer.js +1 -1
  129. package/dist/daemon/ipcServer.js.map +1 -1
  130. package/dist/daemon/launcher.d.ts.map +1 -1
  131. package/dist/daemon/launcher.js +3 -2
  132. package/dist/daemon/launcher.js.map +1 -1
  133. package/dist/daemon/lifecycle/signalHandlers.d.ts.map +1 -1
  134. package/dist/daemon/lifecycle/signalHandlers.js +1 -1
  135. package/dist/daemon/lifecycle/signalHandlers.js.map +1 -1
  136. package/dist/daemon/lifecycle/workerCleanup.d.ts.map +1 -1
  137. package/dist/daemon/lifecycle/workerCleanup.js +4 -3
  138. package/dist/daemon/lifecycle/workerCleanup.js.map +1 -1
  139. package/dist/daemon/lifecycle/workerConfig.d.ts.map +1 -1
  140. package/dist/daemon/lifecycle/workerConfig.js +1 -1
  141. package/dist/daemon/lifecycle/workerConfig.js.map +1 -1
  142. package/dist/daemon/lifecycle/workerIpc.d.ts.map +1 -1
  143. package/dist/daemon/lifecycle/workerIpc.js +1 -1
  144. package/dist/daemon/lifecycle/workerIpc.js.map +1 -1
  145. package/dist/daemon/server/JsonlParser.d.ts.map +1 -1
  146. package/dist/daemon/server/JsonlParser.js +1 -1
  147. package/dist/daemon/server/JsonlParser.js.map +1 -1
  148. package/dist/daemon/startSession.d.ts.map +1 -1
  149. package/dist/daemon/startSession.js +1 -1
  150. package/dist/daemon/startSession.js.map +1 -1
  151. package/dist/daemon/worker/plugins.js +3 -3
  152. package/dist/daemon/worker/plugins.js.map +1 -1
  153. package/dist/index.js +23 -7
  154. package/dist/index.js.map +1 -1
  155. package/dist/ipc/utils/errors.js +1 -1
  156. package/dist/ipc/utils/errors.js.map +1 -1
  157. package/dist/session/QueryCacheManager.d.ts.map +1 -1
  158. package/dist/session/QueryCacheManager.js +1 -1
  159. package/dist/session/QueryCacheManager.js.map +1 -1
  160. package/dist/session/chrome.js +1 -1
  161. package/dist/session/chrome.js.map +1 -1
  162. package/dist/session/cleanup.js +5 -5
  163. package/dist/session/cleanup.js.map +1 -1
  164. package/dist/session/lock.js +1 -1
  165. package/dist/session/lock.js.map +1 -1
  166. package/dist/session/metadata.d.ts.map +1 -1
  167. package/dist/session/metadata.js +1 -1
  168. package/dist/session/metadata.js.map +1 -1
  169. package/dist/session/pid.js +1 -1
  170. package/dist/session/pid.js.map +1 -1
  171. package/dist/telemetry/dom.d.ts.map +1 -1
  172. package/dist/telemetry/dom.js +1 -1
  173. package/dist/telemetry/dom.js.map +1 -1
  174. package/dist/telemetry/filterPresets.d.ts.map +1 -1
  175. package/dist/telemetry/filterPresets.js +5 -2
  176. package/dist/telemetry/filterPresets.js.map +1 -1
  177. package/dist/telemetry/network.d.ts.map +1 -1
  178. package/dist/telemetry/network.js +1 -1
  179. package/dist/telemetry/network.js.map +1 -1
  180. package/dist/types.d.ts +97 -0
  181. package/dist/types.d.ts.map +1 -1
  182. package/dist/types.js +33 -1
  183. package/dist/types.js.map +1 -1
  184. package/dist/ui/OutputBuilder.d.ts +2 -44
  185. package/dist/ui/OutputBuilder.d.ts.map +1 -1
  186. package/dist/ui/OutputBuilder.js +71 -103
  187. package/dist/ui/OutputBuilder.js.map +1 -1
  188. package/dist/ui/errors/CommandError.d.ts +0 -2
  189. package/dist/ui/errors/CommandError.d.ts.map +1 -1
  190. package/dist/ui/errors/CommandError.js.map +1 -1
  191. package/dist/ui/formatters/dom.d.ts +8 -19
  192. package/dist/ui/formatters/dom.d.ts.map +1 -1
  193. package/dist/ui/formatters/dom.js +12 -68
  194. package/dist/ui/formatters/dom.js.map +1 -1
  195. package/dist/ui/logging/logger.d.ts +1 -1
  196. package/dist/ui/logging/logger.d.ts.map +1 -1
  197. package/dist/ui/logging/logger.js +1 -1
  198. package/dist/ui/logging/logger.js.map +1 -1
  199. package/dist/ui/messages/dom.d.ts +14 -0
  200. package/dist/ui/messages/dom.d.ts.map +1 -0
  201. package/dist/ui/messages/dom.js +28 -0
  202. package/dist/ui/messages/dom.js.map +1 -0
  203. package/dist/ui/messages/errors.d.ts +83 -0
  204. package/dist/ui/messages/errors.d.ts.map +1 -1
  205. package/dist/ui/messages/errors.js +171 -0
  206. package/dist/ui/messages/errors.js.map +1 -1
  207. package/dist/utils/async.d.ts +10 -0
  208. package/dist/utils/async.d.ts.map +1 -0
  209. package/dist/utils/async.js +12 -0
  210. package/dist/utils/async.js.map +1 -0
  211. package/dist/utils/atomicFile.js +1 -1
  212. package/dist/utils/atomicFile.js.map +1 -1
  213. package/dist/utils/errorMapping.d.ts.map +1 -1
  214. package/dist/utils/errorMapping.js +4 -1
  215. package/dist/utils/errorMapping.js.map +1 -1
  216. package/dist/utils/exitCodes.d.ts +16 -17
  217. package/dist/utils/exitCodes.d.ts.map +1 -1
  218. package/dist/utils/exitCodes.js +85 -17
  219. package/dist/utils/exitCodes.js.map +1 -1
  220. package/dist/utils/suggestions.d.ts +19 -0
  221. package/dist/utils/suggestions.d.ts.map +1 -0
  222. package/dist/utils/suggestions.js +34 -0
  223. package/dist/utils/suggestions.js.map +1 -0
  224. package/dist/utils/taskMappings.d.ts.map +1 -1
  225. package/dist/utils/taskMappings.js +35 -0
  226. package/dist/utils/taskMappings.js.map +1 -1
  227. package/package.json +1 -1
@@ -118,4 +118,87 @@ export declare function sessionNotActiveError(operation: string): string;
118
118
  * ```
119
119
  */
120
120
  export declare function elementNotFoundError(selector: string): string;
121
+ /**
122
+ * Error with suggestion pair for CommandError usage.
123
+ */
124
+ export interface ErrorWithSuggestion {
125
+ message: string;
126
+ suggestion: string;
127
+ }
128
+ /**
129
+ * Index out of range error.
130
+ */
131
+ export declare function indexOutOfRangeError(index: number, max: number): ErrorWithSuggestion;
132
+ /**
133
+ * Element at index not found (stale cache).
134
+ */
135
+ export declare function elementAtIndexNotFoundError(index: number, selector: string): ErrorWithSuggestion;
136
+ /**
137
+ * No nodes found for selector.
138
+ */
139
+ export declare function noNodesFoundError(selector: string): ErrorWithSuggestion;
140
+ /**
141
+ * Element not visible/rendered.
142
+ */
143
+ export declare function elementNotVisibleError(): ErrorWithSuggestion;
144
+ /**
145
+ * Element has zero dimensions.
146
+ */
147
+ export declare function elementZeroDimensionsError(): ErrorWithSuggestion;
148
+ /**
149
+ * Missing required argument.
150
+ */
151
+ export declare function missingArgumentError(usage: string): ErrorWithSuggestion;
152
+ /**
153
+ * Either/or argument required.
154
+ */
155
+ export declare function eitherArgumentRequiredError(arg1: string, arg2: string, example: string): ErrorWithSuggestion;
156
+ /**
157
+ * Invalid query pattern.
158
+ */
159
+ export declare function invalidQueryPatternError(pattern: string): ErrorWithSuggestion;
160
+ /**
161
+ * No a11y nodes matching pattern.
162
+ */
163
+ export declare function noA11yNodesFoundError(pattern: string): ErrorWithSuggestion;
164
+ /**
165
+ * Element not accessible (a11y).
166
+ */
167
+ export declare function elementNotAccessibleError(index: number): ErrorWithSuggestion;
168
+ /**
169
+ * Fillable element not found.
170
+ */
171
+ export declare function fillableElementNotFoundError(selector: string): ErrorWithSuggestion;
172
+ /**
173
+ * Clickable element not found.
174
+ */
175
+ export declare function clickableElementNotFoundError(selector: string): ErrorWithSuggestion;
176
+ /**
177
+ * Key press failed.
178
+ */
179
+ export declare function keyPressFailedError(details: string): ErrorWithSuggestion;
180
+ /**
181
+ * Session target not found.
182
+ */
183
+ export declare function sessionTargetNotFoundError(): ErrorWithSuggestion;
184
+ /**
185
+ * Session metadata missing.
186
+ */
187
+ export declare function sessionMetadataMissingError(field: string): ErrorWithSuggestion;
188
+ /**
189
+ * Script execution error.
190
+ */
191
+ export declare function scriptExecutionError(details: string): ErrorWithSuggestion;
192
+ /**
193
+ * Unexpected CDP response format.
194
+ */
195
+ export declare function unexpectedResponseFormatError(context: string): ErrorWithSuggestion;
196
+ /**
197
+ * Generic operation failure with dynamic error message.
198
+ */
199
+ export declare function operationFailedError(operation: string, errorMessage: string): ErrorWithSuggestion;
200
+ /**
201
+ * Internal error (should not happen in normal usage).
202
+ */
203
+ export declare function internalError(context: string): ErrorWithSuggestion;
121
204
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/ui/messages/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;;;;;;;;;;;GAaG;AACH,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAcR;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,4CAA4C;IAC5C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,2EAA2E;IAC3E,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,yDAAyD;IACzD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,CAAC,EAAE,kBA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H,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,MAAM,GAAG,mBAAmB,CAKlF;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,MAAM,GAAG,mBAAmB,CAKnF;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,mBAAmB,CAKxE;AAED;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,mBAAmB,CAKhE;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,GAAG,mBAAmB,CAK9E;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,mBAAmB,CAKzE;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,MAAM,GAAG,mBAAmB,CAKlF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,mBAAmB,CAKjG;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,mBAAmB,CAKlE"}
@@ -123,4 +123,175 @@ export function sessionNotActiveError(operation) {
123
123
  export function elementNotFoundError(selector) {
124
124
  return joinLines(`Error: Element not found: ${selector}`, '', 'Suggestions:', ' - Check the selector syntax', ' - Wait for the element to load (page might still be loading)', ' - Use bdg peek to see if page loaded correctly', '', 'Advanced: Use CDP for complex queries:', ` bdg cdp Runtime.evaluate --params '{"expression":"document.querySelector('${selector}')"}'`);
125
125
  }
126
+ /**
127
+ * Index out of range error.
128
+ */
129
+ export function indexOutOfRangeError(index, max) {
130
+ return {
131
+ message: `Index ${index} out of range (found ${max + 1} nodes)`,
132
+ suggestion: `Use an index between 0 and ${max}`,
133
+ };
134
+ }
135
+ /**
136
+ * Element at index not found (stale cache).
137
+ */
138
+ export function elementAtIndexNotFoundError(index, selector) {
139
+ return {
140
+ message: `Element at index ${index} not found`,
141
+ suggestion: `Re-run "bdg dom query ${selector}" to refresh the cache`,
142
+ };
143
+ }
144
+ /**
145
+ * No nodes found for selector.
146
+ */
147
+ export function noNodesFoundError(selector) {
148
+ return {
149
+ message: `No nodes found matching "${selector}"`,
150
+ suggestion: 'Verify the CSS selector is correct',
151
+ };
152
+ }
153
+ /**
154
+ * Element not visible/rendered.
155
+ */
156
+ export function elementNotVisibleError() {
157
+ return {
158
+ message: 'Failed to get element bounds',
159
+ suggestion: 'Element may not be rendered or visible',
160
+ };
161
+ }
162
+ /**
163
+ * Element has zero dimensions.
164
+ */
165
+ export function elementZeroDimensionsError() {
166
+ return {
167
+ message: 'Element has zero dimensions (not visible)',
168
+ suggestion: 'Element may be hidden or collapsed',
169
+ };
170
+ }
171
+ /**
172
+ * Missing required argument.
173
+ */
174
+ export function missingArgumentError(usage) {
175
+ return {
176
+ message: 'Missing required argument or flag',
177
+ suggestion: usage,
178
+ };
179
+ }
180
+ /**
181
+ * Either/or argument required.
182
+ */
183
+ export function eitherArgumentRequiredError(arg1, arg2, example) {
184
+ return {
185
+ message: `Either ${arg1} or ${arg2} must be provided`,
186
+ suggestion: example,
187
+ };
188
+ }
189
+ /**
190
+ * Invalid query pattern.
191
+ */
192
+ export function invalidQueryPatternError(pattern) {
193
+ return {
194
+ message: 'Query pattern must specify at least one field',
195
+ suggestion: `Received: "${pattern}". Try: bdg dom a11y query "role:button" or "name:Submit"`,
196
+ };
197
+ }
198
+ /**
199
+ * No a11y nodes matching pattern.
200
+ */
201
+ export function noA11yNodesFoundError(pattern) {
202
+ return {
203
+ message: 'No nodes found matching pattern',
204
+ suggestion: `Pattern: ${pattern}. Try a broader query or use "bdg dom a11y tree" to see all elements`,
205
+ };
206
+ }
207
+ /**
208
+ * Element not accessible (a11y).
209
+ */
210
+ export function elementNotAccessibleError(index) {
211
+ return {
212
+ message: `Element at index ${index} not accessible`,
213
+ suggestion: 'Re-run query to refresh cache',
214
+ };
215
+ }
216
+ /**
217
+ * Fillable element not found.
218
+ */
219
+ export function fillableElementNotFoundError(selector) {
220
+ return {
221
+ message: `Element not found: ${selector}`,
222
+ suggestion: 'Verify the selector matches a fillable element (input, textarea, select)',
223
+ };
224
+ }
225
+ /**
226
+ * Clickable element not found.
227
+ */
228
+ export function clickableElementNotFoundError(selector) {
229
+ return {
230
+ message: `Element not found: ${selector}`,
231
+ suggestion: 'Verify the selector matches a clickable element',
232
+ };
233
+ }
234
+ /**
235
+ * Key press failed.
236
+ */
237
+ export function keyPressFailedError(details) {
238
+ return {
239
+ message: 'Failed to press key',
240
+ suggestion: details,
241
+ };
242
+ }
243
+ /**
244
+ * Session target not found.
245
+ */
246
+ export function sessionTargetNotFoundError() {
247
+ return {
248
+ message: 'Session target not found (tab may have been closed)',
249
+ suggestion: 'Start a new session with: bdg <url>',
250
+ };
251
+ }
252
+ /**
253
+ * Session metadata missing.
254
+ */
255
+ export function sessionMetadataMissingError(field) {
256
+ return {
257
+ message: `Session metadata missing ${field}`,
258
+ suggestion: 'Start a new session with: bdg <url>',
259
+ };
260
+ }
261
+ /**
262
+ * Script execution error.
263
+ */
264
+ export function scriptExecutionError(details) {
265
+ return {
266
+ message: details,
267
+ suggestion: 'Check JavaScript syntax and ensure the expression is valid',
268
+ };
269
+ }
270
+ /**
271
+ * Unexpected CDP response format.
272
+ */
273
+ export function unexpectedResponseFormatError(context) {
274
+ return {
275
+ message: 'Unexpected response format',
276
+ suggestion: `CDP response missing result.value or invalid ${context} structure`,
277
+ };
278
+ }
279
+ /**
280
+ * Generic operation failure with dynamic error message.
281
+ */
282
+ export function operationFailedError(operation, errorMessage) {
283
+ return {
284
+ message: `Failed to ${operation}`,
285
+ suggestion: errorMessage,
286
+ };
287
+ }
288
+ /**
289
+ * Internal error (should not happen in normal usage).
290
+ */
291
+ export function internalError(context) {
292
+ return {
293
+ message: context,
294
+ suggestion: 'This is an internal error - please report this issue',
295
+ };
296
+ }
126
297
  //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","source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UAAU,oBAAoB,CAAC,MAAc;IACjD,OAAO,uCAAuC,MAAM,EAAE,CAAC;AACzD,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,qBAAqB,CAAC,SAAiB;IACrD,OAAO,SAAS,CACd,iBAAiB,SAAS,sBAAsB,EAChD,EAAE,EACF,wBAAwB,EACxB,aAAa,EACb,EAAE,EACF,UAAU,EACV,2BAA2B,EAC3B,SAAS,SAAS,EAAE,CACrB,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAAgB;IACnD,OAAO,SAAS,CACd,6BAA6B,QAAQ,EAAE,EACvC,EAAE,EACF,cAAc,EACd,+BAA+B,EAC/B,gEAAgE,EAChE,kDAAkD,EAClD,EAAE,EACF,wCAAwC,EACxC,+EAA+E,QAAQ,OAAO,CAC/F,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/ui/messages/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/D;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,0BAA0B,CACxC,GAAW,EACX,QAAgB,EAChB,SAAkB;IAElB,OAAO,SAAS,CACd,EAAE,EACF,gCAAgC,EAChC,EAAE,EACF,eAAe,GAAG,EAAE,EACpB,SAAS,IAAI,eAAe,SAAS,EAAE,EACvC,eAAe,cAAc,CAAC,QAAQ,CAAC,EAAE,EACzC,EAAE,EACF,cAAc,EACd,gCAAgC,EAChC,2CAA2C,EAC3C,EAAE,CACH,CAAC;AACJ,CAAC;AAgBD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAA4B;IAChE,OAAO,SAAS,CACd,2BAA2B,EAC3B,OAAO,EAAE,cAAc,IAAI,iCAAiC,EAC5D,OAAO,EAAE,SAAS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AAO,YAAY;KAChF,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,SAAiB,EAAE,YAAoB;IAC1E,OAAO;QACL,OAAO,EAAE,aAAa,SAAS,EAAE;QACjC,UAAU,EAAE,YAAY;KACzB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,OAAe;IAC3C,OAAO;QACL,OAAO,EAAE,OAAO;QAChB,UAAU,EAAE,sDAAsD;KACnE,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Async utilities for common patterns.
3
+ */
4
+ /**
5
+ * Delay execution for a specified duration.
6
+ *
7
+ * @param ms - Milliseconds to delay
8
+ */
9
+ export declare function delay(ms: number): Promise<void>;
10
+ //# sourceMappingURL=async.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"async.d.ts","sourceRoot":"","sources":["../../src/utils/async.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE/C"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Async utilities for common patterns.
3
+ */
4
+ /**
5
+ * Delay execution for a specified duration.
6
+ *
7
+ * @param ms - Milliseconds to delay
8
+ */
9
+ export function delay(ms) {
10
+ return new Promise((resolve) => setTimeout(resolve, ms));
11
+ }
12
+ //# sourceMappingURL=async.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"async.js","sourceRoot":"","sources":["../../src/utils/async.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,MAAM,UAAU,KAAK,CAAC,EAAU;IAC9B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import * as crypto from 'crypto';
2
2
  import * as fs from 'fs';
3
- import { getErrorMessage } from '../connection/errors.js';
4
3
  import { createLogger } from '../ui/logging/index.js';
4
+ import { getErrorMessage } from '../utils/errors.js';
5
5
  const log = createLogger('atomic-file');
6
6
  /**
7
7
  * Atomic file operations using tmp-file-then-rename pattern.
@@ -1 +1 @@
1
- {"version":3,"file":"atomicFile.js","sourceRoot":"","sources":["../../src/utils/atomicFile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAEzB,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,MAAM,GAAG,GAAG,YAAY,CAAC,aAAa,CAAC,CAAC;AAExC;;;;;GAKG;AACH,MAAM,OAAO,gBAAgB;IAC3B;;;;;;;OAOG;IACK,MAAM,CAAC,WAAW,CAAC,QAAgB;QACzC,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QACjC,OAAO,GAAG,QAAQ,IAAI,OAAO,CAAC,GAAG,IAAI,IAAI,MAAM,CAAC;IAClD,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,SAAS,CACd,QAAgB,EAChB,IAAY,EACZ,UAAyC,EAAE;QAE3C,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAE3C,IAAI,CAAC;YACH,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,OAAO,EAAE,CAAC,CAAC;YAC3E,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACnC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC;gBACH,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YACzB,CAAC;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CAAC;YACH,MAAM,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAC7C,MAAM,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QAC9C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC;gBACH,MAAM,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YACpC,CAAC;YAAC,OAAO,YAAY,EAAE,CAAC;gBACtB,GAAG,CAAC,KAAK,CAAC,+BAA+B,OAAO,KAAK,eAAe,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;YACxF,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"errorMapping.d.ts","sourceRoot":"","sources":["../../src/utils/errorMapping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,CAAC,EAAE,YAAY,GAAG,MAAM,CAoBvE;AASD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,6BAA6B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAgB1E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAErE"}
1
+ {"version":3,"file":"errorMapping.d.ts","sourceRoot":"","sources":["../../src/utils/errorMapping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,CAAC,EAAE,YAAY,GAAG,MAAM,CA0BvE;AASD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,6BAA6B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAgB1E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAErE"}
@@ -34,10 +34,13 @@ export function getExitCodeForIPCError(errorCode) {
34
34
  case IPCErrorCode.CDP_TIMEOUT:
35
35
  return EXIT_CODES.CDP_TIMEOUT;
36
36
  case IPCErrorCode.SESSION_KILL_FAILED:
37
+ return EXIT_CODES.SESSION_FILE_ERROR;
37
38
  case IPCErrorCode.WORKER_START_FAILED:
39
+ return EXIT_CODES.CDP_CONNECTION_FAILURE;
38
40
  case IPCErrorCode.DAEMON_ERROR:
41
+ return EXIT_CODES.SOFTWARE_ERROR;
39
42
  case undefined:
40
- return EXIT_CODES.UNHANDLED_EXCEPTION;
43
+ return EXIT_CODES.SOFTWARE_ERROR;
41
44
  }
42
45
  }
43
46
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"errorMapping.js","sourceRoot":"","sources":["../../src/utils/errorMapping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,sBAAsB,CAAC,SAAwB;IAC7D,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,YAAY,CAAC,UAAU;YAC1B,OAAO,UAAU,CAAC,kBAAkB,CAAC;QAEvC,KAAK,YAAY,CAAC,uBAAuB;YACvC,OAAO,UAAU,CAAC,uBAAuB,CAAC;QAE5C,KAAK,YAAY,CAAC,oBAAoB;YACpC,OAAO,UAAU,CAAC,qBAAqB,CAAC;QAE1C,KAAK,YAAY,CAAC,WAAW;YAC3B,OAAO,UAAU,CAAC,WAAW,CAAC;QAEhC,KAAK,YAAY,CAAC,mBAAmB,CAAC;QACtC,KAAK,YAAY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;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAoB;IAC1D,OAAO,uBAAuB,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,CAAC;AAC7D,CAAC"}
@@ -32,39 +32,38 @@
32
32
  * **These values are stable API** - use confidently in automation scripts.
33
33
  */
34
34
  export declare const EXIT_CODES: {
35
- /** Command completed successfully */
36
35
  readonly SUCCESS: 0;
37
- /** Generic failure (use specific codes when possible) */
38
36
  readonly GENERIC_FAILURE: 1;
39
- /** Invalid URL format or unreachable URL */
40
37
  readonly INVALID_URL: 80;
41
- /** Invalid command-line arguments or options */
42
38
  readonly INVALID_ARGUMENTS: 81;
43
- /** Insufficient permissions for operation */
44
39
  readonly PERMISSION_DENIED: 82;
45
- /** Requested resource not found (session, file, etc.) */
46
40
  readonly RESOURCE_NOT_FOUND: 83;
47
- /** Resource already exists (duplicate session, etc.) */
48
41
  readonly RESOURCE_ALREADY_EXISTS: 84;
49
- /** Resource is locked or busy */
50
42
  readonly RESOURCE_BUSY: 85;
51
- /** Daemon already running when trying to start */
52
43
  readonly DAEMON_ALREADY_RUNNING: 86;
53
- /** Cache invalidated by navigation or DOM changes */
54
44
  readonly STALE_CACHE: 87;
55
- /** Chrome browser failed to launch */
56
45
  readonly CHROME_LAUNCH_FAILURE: 100;
57
- /** CDP connection failed */
58
46
  readonly CDP_CONNECTION_FAILURE: 101;
59
- /** CDP operation timed out */
60
47
  readonly CDP_TIMEOUT: 102;
61
- /** Session file read/write error */
62
48
  readonly SESSION_FILE_ERROR: 103;
63
- /** Unhandled exception in code */
64
49
  readonly UNHANDLED_EXCEPTION: 104;
65
- /** Signal handler error */
66
50
  readonly SIGNAL_HANDLER_ERROR: 105;
67
- /** Generic software error (use specific codes when possible) */
68
51
  readonly SOFTWARE_ERROR: 110;
69
52
  };
53
+ /**
54
+ * Exit code registry entry with code, name, and description.
55
+ */
56
+ interface ExitCodeEntry {
57
+ readonly code: number;
58
+ readonly name: string;
59
+ readonly description: string;
60
+ }
61
+ /**
62
+ * Exit code registry - provides documentation for all exit codes.
63
+ *
64
+ * This registry is derived from EXIT_CODES to ensure consistency.
65
+ * Used by help --json for machine-readable documentation.
66
+ */
67
+ export declare const EXIT_CODE_REGISTRY: readonly ExitCodeEntry[];
68
+ export {};
70
69
  //# sourceMappingURL=exitCodes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"exitCodes.d.ts","sourceRoot":"","sources":["../../src/utils/exitCodes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH;;;;GAIG;AACH,eAAO,MAAM,UAAU;IACrB,qCAAqC;;IAGrC,yDAAyD;;IAGzD,4CAA4C;;IAG5C,gDAAgD;;IAGhD,6CAA6C;;IAG7C,yDAAyD;;IAGzD,wDAAwD;;IAGxD,iCAAiC;;IAGjC,kDAAkD;;IAGlD,qDAAqD;;IAGrD,sCAAsC;;IAGtC,4BAA4B;;IAG5B,8BAA8B;;IAG9B,oCAAoC;;IAGpC,kCAAkC;;IAGlC,2BAA2B;;IAG3B,gEAAgE;;CAExD,CAAC"}
1
+ {"version":3,"file":"exitCodes.d.ts","sourceRoot":"","sources":["../../src/utils/exitCodes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH;;;;GAIG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;CAkBb,CAAC;AAEX;;GAEG;AACH,UAAU,aAAa;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,aAAa,EA8EtD,CAAC"}
@@ -32,39 +32,107 @@
32
32
  * **These values are stable API** - use confidently in automation scripts.
33
33
  */
34
34
  export const EXIT_CODES = {
35
- /** Command completed successfully */
36
35
  SUCCESS: 0,
37
- /** Generic failure (use specific codes when possible) */
38
36
  GENERIC_FAILURE: 1,
39
- /** Invalid URL format or unreachable URL */
40
37
  INVALID_URL: 80,
41
- /** Invalid command-line arguments or options */
42
38
  INVALID_ARGUMENTS: 81,
43
- /** Insufficient permissions for operation */
44
39
  PERMISSION_DENIED: 82,
45
- /** Requested resource not found (session, file, etc.) */
46
40
  RESOURCE_NOT_FOUND: 83,
47
- /** Resource already exists (duplicate session, etc.) */
48
41
  RESOURCE_ALREADY_EXISTS: 84,
49
- /** Resource is locked or busy */
50
42
  RESOURCE_BUSY: 85,
51
- /** Daemon already running when trying to start */
52
43
  DAEMON_ALREADY_RUNNING: 86,
53
- /** Cache invalidated by navigation or DOM changes */
54
44
  STALE_CACHE: 87,
55
- /** Chrome browser failed to launch */
56
45
  CHROME_LAUNCH_FAILURE: 100,
57
- /** CDP connection failed */
58
46
  CDP_CONNECTION_FAILURE: 101,
59
- /** CDP operation timed out */
60
47
  CDP_TIMEOUT: 102,
61
- /** Session file read/write error */
62
48
  SESSION_FILE_ERROR: 103,
63
- /** Unhandled exception in code */
64
49
  UNHANDLED_EXCEPTION: 104,
65
- /** Signal handler error */
66
50
  SIGNAL_HANDLER_ERROR: 105,
67
- /** Generic software error (use specific codes when possible) */
68
51
  SOFTWARE_ERROR: 110,
69
52
  };
53
+ /**
54
+ * Exit code registry - provides documentation for all exit codes.
55
+ *
56
+ * This registry is derived from EXIT_CODES to ensure consistency.
57
+ * Used by help --json for machine-readable documentation.
58
+ */
59
+ export const EXIT_CODE_REGISTRY = [
60
+ { code: EXIT_CODES.SUCCESS, name: 'SUCCESS', description: 'Operation completed successfully' },
61
+ {
62
+ code: EXIT_CODES.GENERIC_FAILURE,
63
+ name: 'GENERIC_FAILURE',
64
+ description: 'Generic failure (use specific codes when possible)',
65
+ },
66
+ {
67
+ code: EXIT_CODES.INVALID_URL,
68
+ name: 'INVALID_URL',
69
+ description: 'Invalid URL format or unreachable URL',
70
+ },
71
+ {
72
+ code: EXIT_CODES.INVALID_ARGUMENTS,
73
+ name: 'INVALID_ARGUMENTS',
74
+ description: 'Invalid command-line arguments or options',
75
+ },
76
+ {
77
+ code: EXIT_CODES.PERMISSION_DENIED,
78
+ name: 'PERMISSION_DENIED',
79
+ description: 'Insufficient permissions for operation',
80
+ },
81
+ {
82
+ code: EXIT_CODES.RESOURCE_NOT_FOUND,
83
+ name: 'RESOURCE_NOT_FOUND',
84
+ description: 'Requested resource not found (session, file, etc.)',
85
+ },
86
+ {
87
+ code: EXIT_CODES.RESOURCE_ALREADY_EXISTS,
88
+ name: 'RESOURCE_ALREADY_EXISTS',
89
+ description: 'Resource already exists (duplicate session, etc.)',
90
+ },
91
+ {
92
+ code: EXIT_CODES.RESOURCE_BUSY,
93
+ name: 'RESOURCE_BUSY',
94
+ description: 'Resource is locked or busy',
95
+ },
96
+ {
97
+ code: EXIT_CODES.DAEMON_ALREADY_RUNNING,
98
+ name: 'DAEMON_ALREADY_RUNNING',
99
+ description: 'Daemon is already running',
100
+ },
101
+ {
102
+ code: EXIT_CODES.STALE_CACHE,
103
+ name: 'STALE_CACHE',
104
+ description: 'Cache invalidated by navigation or DOM changes',
105
+ },
106
+ {
107
+ code: EXIT_CODES.CHROME_LAUNCH_FAILURE,
108
+ name: 'CHROME_LAUNCH_FAILURE',
109
+ description: 'Chrome browser failed to launch',
110
+ },
111
+ {
112
+ code: EXIT_CODES.CDP_CONNECTION_FAILURE,
113
+ name: 'CDP_CONNECTION_FAILURE',
114
+ description: 'Failed to connect to Chrome DevTools Protocol',
115
+ },
116
+ { code: EXIT_CODES.CDP_TIMEOUT, name: 'CDP_TIMEOUT', description: 'CDP operation timed out' },
117
+ {
118
+ code: EXIT_CODES.SESSION_FILE_ERROR,
119
+ name: 'SESSION_FILE_ERROR',
120
+ description: 'Session file read/write error',
121
+ },
122
+ {
123
+ code: EXIT_CODES.UNHANDLED_EXCEPTION,
124
+ name: 'UNHANDLED_EXCEPTION',
125
+ description: 'Unhandled exception in code',
126
+ },
127
+ {
128
+ code: EXIT_CODES.SIGNAL_HANDLER_ERROR,
129
+ name: 'SIGNAL_HANDLER_ERROR',
130
+ description: 'Signal handler error',
131
+ },
132
+ {
133
+ code: EXIT_CODES.SOFTWARE_ERROR,
134
+ name: 'SOFTWARE_ERROR',
135
+ description: 'Generic software error (use specific codes when possible)',
136
+ },
137
+ ];
70
138
  //# sourceMappingURL=exitCodes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"exitCodes.js","sourceRoot":"","sources":["../../src/utils/exitCodes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,qCAAqC;IACrC,OAAO,EAAE,CAAC;IAEV,yDAAyD;IACzD,eAAe,EAAE,CAAC;IAElB,4CAA4C;IAC5C,WAAW,EAAE,EAAE;IAEf,gDAAgD;IAChD,iBAAiB,EAAE,EAAE;IAErB,6CAA6C;IAC7C,iBAAiB,EAAE,EAAE;IAErB,yDAAyD;IACzD,kBAAkB,EAAE,EAAE;IAEtB,wDAAwD;IACxD,uBAAuB,EAAE,EAAE;IAE3B,iCAAiC;IACjC,aAAa,EAAE,EAAE;IAEjB,kDAAkD;IAClD,sBAAsB,EAAE,EAAE;IAE1B,qDAAqD;IACrD,WAAW,EAAE,EAAE;IAEf,sCAAsC;IACtC,qBAAqB,EAAE,GAAG;IAE1B,4BAA4B;IAC5B,sBAAsB,EAAE,GAAG;IAE3B,8BAA8B;IAC9B,WAAW,EAAE,GAAG;IAEhB,oCAAoC;IACpC,kBAAkB,EAAE,GAAG;IAEvB,kCAAkC;IAClC,mBAAmB,EAAE,GAAG;IAExB,2BAA2B;IAC3B,oBAAoB,EAAE,GAAG;IAEzB,gEAAgE;IAChE,cAAc,EAAE,GAAG;CACX,CAAC"}
1
+ {"version":3,"file":"exitCodes.js","sourceRoot":"","sources":["../../src/utils/exitCodes.ts"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E,UAAU,CAAC,uBAAuB;QACxC,IAAI,EAAE,yBAAyB;QAC/B,WAAW,EAAE,mDAAmD;KACjE;IACD;QACE,IAAI,EAAE,UAAU,CAAC,aAAa;QAC9B,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,4BAA4B;KAC1C;IACD;QACE,IAAI,EAAE,UAAU,CAAC,sBAAsB;QACvC,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,2BAA2B;KACzC;IACD;QACE,IAAI,EAAE,UAAU,CAAC,WAAW;QAC5B,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,gDAAgD;KAC9D;IACD;QACE,IAAI,EAAE,UAAU,CAAC,qBAAqB;QACtC,IAAI,EAAE,uBAAuB;QAC7B,WAAW,EAAE,iCAAiC;KAC/C;IACD;QACE,IAAI,EAAE,UAAU,CAAC,sBAAsB;QACvC,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,+CAA+C;KAC7D;IACD,EAAE,IAAI,EAAE,UAAU,CAAC,WAAW,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,yBAAyB,EAAE;IAC7F;QACE,IAAI,EAAE,UAAU,CAAC,kBAAkB;QACnC,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EAAE,+BAA+B;KAC7C;IACD;QACE,IAAI,EAAE,UAAU,CAAC,mBAAmB;QACpC,IAAI,EAAE,qBAAqB;QAC3B,WAAW,EAAE,6BAA6B;KAC3C;IACD;QACE,IAAI,EAAE,UAAU,CAAC,oBAAoB;QACrC,IAAI,EAAE,sBAAsB;QAC5B,WAAW,EAAE,sBAAsB;KACpC;IACD;QACE,IAAI,EAAE,UAAU,CAAC,cAAc;QAC/B,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,2DAA2D;KACzE;CACF,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Suggestion utilities for typo detection and helpful error messages.
3
+ */
4
+ interface SimilarityOptions {
5
+ maxDistance?: number;
6
+ maxSuggestions?: number;
7
+ caseInsensitive?: boolean;
8
+ }
9
+ export declare function findSimilar(input: string, candidates: readonly string[], options?: SimilarityOptions): string[];
10
+ export declare function formatSuggestions(suggestions: readonly string[], options?: {
11
+ prefix?: string;
12
+ suffix?: string;
13
+ }): string;
14
+ export declare function getSuggestion(input: string, candidates: readonly string[], options?: SimilarityOptions & {
15
+ prefix?: string;
16
+ suffix?: string;
17
+ }): string;
18
+ export {};
19
+ //# sourceMappingURL=suggestions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suggestions.d.ts","sourceRoot":"","sources":["../../src/utils/suggestions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,UAAU,iBAAiB;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAgCD,wBAAgB,WAAW,CACzB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,OAAO,GAAE,iBAAsB,GAC9B,MAAM,EAAE,CAIV;AAED,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAO,GACjD,MAAM,CAIR;AAED,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,OAAO,GAAE,iBAAiB,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAO,GACrE,MAAM,CAER"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Suggestion utilities for typo detection and helpful error messages.
3
+ */
4
+ import { levenshteinDistance } from '../utils/levenshtein.js';
5
+ function normalizeForComparison(str, caseInsensitive) {
6
+ return caseInsensitive ? str.toLowerCase() : str;
7
+ }
8
+ function findMatches(input, candidates, maxDistance, caseInsensitive) {
9
+ const normalizedInput = normalizeForComparison(input, caseInsensitive);
10
+ const matches = [];
11
+ for (const candidate of candidates) {
12
+ const normalizedCandidate = normalizeForComparison(candidate, caseInsensitive);
13
+ const distance = levenshteinDistance(normalizedInput, normalizedCandidate);
14
+ if (distance > 0 && distance <= maxDistance) {
15
+ matches.push({ value: candidate, distance });
16
+ }
17
+ }
18
+ return matches.sort((a, b) => a.distance - b.distance);
19
+ }
20
+ export function findSimilar(input, candidates, options = {}) {
21
+ const { maxDistance = 3, maxSuggestions = 3, caseInsensitive = true } = options;
22
+ const matches = findMatches(input, candidates, maxDistance, caseInsensitive);
23
+ return matches.slice(0, maxSuggestions).map((m) => m.value);
24
+ }
25
+ export function formatSuggestions(suggestions, options = {}) {
26
+ if (suggestions.length === 0)
27
+ return '';
28
+ const { prefix = 'Did you mean: ', suffix = '?' } = options;
29
+ return `${prefix}${suggestions.join(', ')}${suffix}`;
30
+ }
31
+ export function getSuggestion(input, candidates, options = {}) {
32
+ return formatSuggestions(findSimilar(input, candidates, options), options);
33
+ }
34
+ //# sourceMappingURL=suggestions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suggestions.js","sourceRoot":"","sources":["../../src/utils/suggestions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAa7D,SAAS,sBAAsB,CAAC,GAAW,EAAE,eAAwB;IACnE,OAAO,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;AACnD,CAAC;AAED,SAAS,WAAW,CAClB,KAAa,EACb,UAA6B,EAC7B,WAAmB,EACnB,eAAwB;IAExB,MAAM,eAAe,GAAG,sBAAsB,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC;IACvE,MAAM,OAAO,GAAsB,EAAE,CAAC;IAEtC,KAAK,MAAM,SAAS,IAAI,UAAU,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AU,aAAa,CAC3B,KAAa,EACb,UAA6B,EAC7B,UAAoE,EAAE;IAEtE,OAAO,iBAAiB,CAAC,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;AAC7E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"taskMappings.d.ts","sourceRoot":"","sources":["../../src/utils/taskMappings.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,oDAAoD;IACpD,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,sCAAsC;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,gCAAgC;IAChC,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAmHrD,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAEhE"}
1
+ {"version":3,"file":"taskMappings.d.ts","sourceRoot":"","sources":["../../src/utils/taskMappings.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,oDAAoD;IACpD,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,sCAAsC;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,gCAAgC;IAChC,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CA6JrD,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAEhE"}