browser-debugger-cli 0.10.0 → 0.12.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/.claude/skills/bdg/SKILL.md +268 -0
- package/README.md +148 -74
- package/dist/commands/css.d.ts +13 -0
- package/dist/commands/css.js +53 -0
- package/dist/commands/dom/audit.d.ts +14 -0
- package/dist/commands/dom/audit.js +87 -0
- package/dist/commands/dom/formInteraction.js +36 -6
- package/dist/commands/dom/helpers/keyAttributes.d.ts +3 -2
- package/dist/commands/dom/helpers/keyAttributes.js +6 -4
- package/dist/commands/dom/helpers/screenshot.d.ts +1 -0
- package/dist/commands/dom/helpers/screenshot.js +158 -38
- package/dist/commands/dom/index.js +4 -1
- package/dist/commands/dom/screenshot.js +10 -6
- package/dist/commands/dom/wait.js +5 -3
- package/dist/commands/helpJson.js +1 -1
- package/dist/commands/installSkill.d.ts +20 -0
- package/dist/commands/installSkill.js +87 -0
- package/dist/commands/optionBehaviors.js +21 -6
- package/dist/commands/page.js +7 -4
- package/dist/commands/peek.d.ts +7 -0
- package/dist/commands/peek.js +65 -23
- package/dist/commands/shared/optionTypes.d.ts +5 -1
- package/dist/commands/start.d.ts +13 -0
- package/dist/commands/start.js +19 -2
- package/dist/commands/tail.d.ts +7 -1
- package/dist/commands/tail.js +13 -62
- package/dist/commands.js +5 -0
- package/dist/daemon/session/commandRegistry.js +7 -1
- package/dist/daemon/session/plugins.js +4 -52
- package/dist/daemon.js +7986 -6848
- package/dist/errors/messages.d.ts +50 -4
- package/dist/errors/messages.js +94 -5
- package/dist/index.js +709 -190
- package/dist/ipc/client.d.ts +4 -0
- package/dist/ipc/client.js +8 -0
- package/dist/ipc/protocol/auditTypes.d.ts +129 -0
- package/dist/ipc/protocol/auditTypes.js +6 -0
- package/dist/ipc/protocol/commands.d.ts +23 -0
- package/dist/ipc/protocol/commands.js +2 -0
- package/dist/ipc/protocol/domTypes.d.ts +4 -0
- package/dist/ipc/protocol/inspectTypes.d.ts +71 -8
- package/dist/runtime/css/search.d.ts +39 -0
- package/dist/runtime/css/search.js +122 -0
- package/dist/runtime/dom/actionEffects.d.ts +4 -1
- package/dist/runtime/dom/actionEffects.js +8 -4
- package/dist/runtime/dom/audit.d.ts +19 -0
- package/dist/runtime/dom/audit.js +36 -0
- package/dist/runtime/dom/auditModel.d.ts +45 -0
- package/dist/runtime/dom/auditModel.js +215 -0
- package/dist/runtime/dom/auditScripts.d.ts +107 -0
- package/dist/runtime/dom/auditScripts.js +112 -0
- package/dist/runtime/dom/elementGeometry.d.ts +8 -2
- package/dist/runtime/dom/elementGeometry.js +24 -8
- package/dist/runtime/dom/elementInfo.d.ts +3 -2
- package/dist/runtime/dom/elementInfo.js +8 -2
- package/dist/runtime/dom/formFillHelpers/fill.js +2 -2
- package/dist/runtime/dom/inspect.d.ts +7 -0
- package/dist/runtime/dom/inspect.js +88 -23
- package/dist/runtime/dom/inspectAllStyles.d.ts +16 -4
- package/dist/runtime/dom/inspectAllStyles.js +89 -7
- package/dist/runtime/dom/inspectCascade.d.ts +19 -2
- package/dist/runtime/dom/inspectCascade.js +214 -44
- package/dist/runtime/dom/inspectCascadeModel.d.ts +8 -0
- package/dist/runtime/dom/inspectCascadeModel.js +108 -34
- package/dist/runtime/dom/inspectHints.d.ts +26 -3
- package/dist/runtime/dom/inspectHints.js +125 -9
- package/dist/runtime/dom/inspectModel.d.ts +3 -0
- package/dist/runtime/dom/inspectModel.js +30 -7
- package/dist/runtime/dom/inspectPaintModel.d.ts +48 -22
- package/dist/runtime/dom/inspectPaintModel.js +180 -68
- package/dist/runtime/dom/inspectRules.d.ts +19 -0
- package/dist/runtime/dom/inspectRules.js +21 -5
- package/dist/runtime/dom/inspectScripts.d.ts +85 -12
- package/dist/runtime/dom/inspectScripts.js +314 -28
- package/dist/runtime/dom/inspectTree.js +10 -2
- package/dist/runtime/dom/inspectWhyModel.d.ts +2 -1
- package/dist/runtime/dom/inspectWhyModel.js +52 -10
- package/dist/runtime/dom/layout.js +31 -9
- package/dist/runtime/dom/reactEventHelpers.d.ts +7 -0
- package/dist/runtime/dom/reactEventHelpers.js +27 -9
- package/dist/runtime/page/emulation.d.ts +13 -4
- package/dist/runtime/page/emulation.js +69 -4
- package/dist/runtime/page/userAgent.d.ts +17 -0
- package/dist/runtime/page/userAgent.js +57 -0
- package/dist/types.d.ts +12 -0
- package/dist/ui/formatters/audit.d.ts +19 -0
- package/dist/ui/formatters/audit.js +106 -0
- package/dist/ui/formatters/dom.d.ts +1 -1
- package/dist/ui/formatters/dom.js +6 -3
- package/dist/ui/formatters/inspect.js +42 -15
- package/dist/ui/formatters/installSkill.d.ts +11 -0
- package/dist/ui/formatters/installSkill.js +31 -0
- package/dist/ui/formatters/status.js +1 -1
- package/dist/ui/messages/commands.d.ts +44 -7
- package/dist/ui/messages/commands.js +83 -11
- package/dist/ui/messages/preview.d.ts +6 -0
- package/dist/ui/messages/preview.js +9 -1
- package/dist/utils/cssValues.js +36 -4
- package/dist/utils/decisionTrees.js +0 -5
- package/dist/utils/suggestions.d.ts +4 -2
- package/dist/utils/suggestions.js +7 -5
- package/dist/utils/taskMappings.js +1 -1
- package/package.json +4 -2
|
@@ -691,7 +691,16 @@ export declare function elementNotVisibleError(): ErrorWithSuggestion;
|
|
|
691
691
|
*/
|
|
692
692
|
export declare function elementZeroDimensionsError(): ErrorWithSuggestion;
|
|
693
693
|
/**
|
|
694
|
-
*
|
|
694
|
+
* `bdg dom hover --off` was given an element too.
|
|
695
|
+
*
|
|
696
|
+
* @returns Message and suggestion
|
|
697
|
+
*/
|
|
698
|
+
export declare function hoverOffWithTargetError(): ErrorWithSuggestion;
|
|
699
|
+
/**
|
|
700
|
+
* A command was given neither its argument nor a flag that replaces it.
|
|
701
|
+
*
|
|
702
|
+
* @param usage - How to call it
|
|
703
|
+
* @returns Message and suggestion
|
|
695
704
|
*/
|
|
696
705
|
export declare function missingArgumentError(usage: string): ErrorWithSuggestion;
|
|
697
706
|
/**
|
|
@@ -927,10 +936,16 @@ export declare function unexpectedResponseFormatError(context: string): ErrorWit
|
|
|
927
936
|
*/
|
|
928
937
|
export declare function operationFailedError(operation: string, errorMessage: string): ErrorWithSuggestion;
|
|
929
938
|
/**
|
|
930
|
-
*
|
|
939
|
+
* `--why all`: `all` resets every property, so there is no one cascade to show.
|
|
931
940
|
*
|
|
932
|
-
* @
|
|
933
|
-
|
|
941
|
+
* @returns Message and suggestion
|
|
942
|
+
*/
|
|
943
|
+
export declare function whyAllPropertyError(): ErrorWithSuggestion;
|
|
944
|
+
/**
|
|
945
|
+
* Names given to --props or --why that are not CSS properties.
|
|
946
|
+
*
|
|
947
|
+
* @param names - Unknown names
|
|
948
|
+
* @param suggestions - Closest known names
|
|
934
949
|
* @returns Message and suggestion
|
|
935
950
|
*/
|
|
936
951
|
export declare function unknownCssPropertyError(names: string[], suggestions: string[]): ErrorWithSuggestion;
|
|
@@ -973,5 +988,36 @@ export declare function formInIframeError(iframeUrl: string, crossOrigin: boolea
|
|
|
973
988
|
export declare function cdpCallError(method: string, message: string): ErrorWithSuggestion & {
|
|
974
989
|
notFound: boolean;
|
|
975
990
|
};
|
|
991
|
+
/**
|
|
992
|
+
* The skill file is not where the package should have it (a broken or
|
|
993
|
+
* partial install).
|
|
994
|
+
*
|
|
995
|
+
* @param source - Expected SKILL.md path
|
|
996
|
+
* @returns Message and suggestion
|
|
997
|
+
*/
|
|
998
|
+
export declare function skillSourceMissingError(source: string): ErrorWithSuggestion;
|
|
999
|
+
/**
|
|
1000
|
+
* The skill could not be written to an agent's skill directory.
|
|
1001
|
+
*
|
|
1002
|
+
* @param path - Destination SKILL.md
|
|
1003
|
+
* @param reason - The file system error
|
|
1004
|
+
* @returns Message and suggestion
|
|
1005
|
+
*/
|
|
1006
|
+
export declare function skillWriteFailedError(path: string, reason: string): ErrorWithSuggestion;
|
|
1007
|
+
/**
|
|
1008
|
+
* `bdg peek --interval` without `--follow`.
|
|
1009
|
+
*
|
|
1010
|
+
* @returns Message and suggestion
|
|
1011
|
+
*/
|
|
1012
|
+
export declare function intervalWithoutFollowError(): ErrorWithSuggestion;
|
|
1013
|
+
/**
|
|
1014
|
+
* An unknown `dom audit` check.
|
|
1015
|
+
*
|
|
1016
|
+
* @param value - Name given
|
|
1017
|
+
* @param similar - Closest names
|
|
1018
|
+
* @param checks - Every check
|
|
1019
|
+
* @returns Message
|
|
1020
|
+
*/
|
|
1021
|
+
export declare function unknownAuditCheckMessage(value: string, similar: string[], checks: readonly string[]): string;
|
|
976
1022
|
export {};
|
|
977
1023
|
//# sourceMappingURL=messages.d.ts.map
|
package/dist/errors/messages.js
CHANGED
|
@@ -1025,9 +1025,25 @@ export function noNodesFoundError(selector, context = {}) {
|
|
|
1025
1025
|
const note = unreachableElementsNote(selector, context.unsearched);
|
|
1026
1026
|
return {
|
|
1027
1027
|
message: `No nodes found matching "${selector}"`,
|
|
1028
|
-
suggestion: withLoadingHint(joinLines(context.similar, context.shadowHost && shadowBoundaryLine(context.shadowHost), `${hidden}Verify the CSS selector is correct.`, note ? note : undefined), context.readyState, selector),
|
|
1028
|
+
suggestion: withLoadingHint(joinLines(context.similar, context.shadowHost && shadowBoundaryLine(context.shadowHost), shadowPseudoLine(selector), `${hidden}Verify the CSS selector is correct.`, note ? note : undefined), context.readyState, selector),
|
|
1029
1029
|
};
|
|
1030
1030
|
}
|
|
1031
|
+
/**
|
|
1032
|
+
* Advice for a selector with `::part()` or `::slotted()`, which name
|
|
1033
|
+
* pseudo-elements a page's stylesheet uses and never match an element.
|
|
1034
|
+
*
|
|
1035
|
+
* @param selector - Selector as given
|
|
1036
|
+
* @returns Line, or undefined for other selectors
|
|
1037
|
+
*/
|
|
1038
|
+
function shadowPseudoLine(selector) {
|
|
1039
|
+
const part = /::part\(\s*([^)\s]+)\s*\)/.exec(selector)?.[1];
|
|
1040
|
+
if (part) {
|
|
1041
|
+
return `::part() styles a shadow part and selects nothing; bdg searches open shadow roots, so select the part itself: [part~="${part}"]`;
|
|
1042
|
+
}
|
|
1043
|
+
return /::slotted\(/.test(selector)
|
|
1044
|
+
? '::slotted() selects nothing; select the slotted element itself (it is in the light DOM)'
|
|
1045
|
+
: undefined;
|
|
1046
|
+
}
|
|
1031
1047
|
/**
|
|
1032
1048
|
* Quote a value for a POSIX shell command line.
|
|
1033
1049
|
*
|
|
@@ -1176,7 +1192,21 @@ export function elementZeroDimensionsError() {
|
|
|
1176
1192
|
};
|
|
1177
1193
|
}
|
|
1178
1194
|
/**
|
|
1179
|
-
*
|
|
1195
|
+
* `bdg dom hover --off` was given an element too.
|
|
1196
|
+
*
|
|
1197
|
+
* @returns Message and suggestion
|
|
1198
|
+
*/
|
|
1199
|
+
export function hoverOffWithTargetError() {
|
|
1200
|
+
return {
|
|
1201
|
+
message: '--off moves the mouse off the page; it takes no element',
|
|
1202
|
+
suggestion: 'Use bdg dom hover --off alone, or bdg dom hover <selector> to hover an element',
|
|
1203
|
+
};
|
|
1204
|
+
}
|
|
1205
|
+
/**
|
|
1206
|
+
* A command was given neither its argument nor a flag that replaces it.
|
|
1207
|
+
*
|
|
1208
|
+
* @param usage - How to call it
|
|
1209
|
+
* @returns Message and suggestion
|
|
1180
1210
|
*/
|
|
1181
1211
|
export function missingArgumentError(usage) {
|
|
1182
1212
|
return {
|
|
@@ -1644,10 +1674,21 @@ export function operationFailedError(operation, errorMessage) {
|
|
|
1644
1674
|
};
|
|
1645
1675
|
}
|
|
1646
1676
|
/**
|
|
1647
|
-
*
|
|
1677
|
+
* `--why all`: `all` resets every property, so there is no one cascade to show.
|
|
1678
|
+
*
|
|
1679
|
+
* @returns Message and suggestion
|
|
1680
|
+
*/
|
|
1681
|
+
export function whyAllPropertyError() {
|
|
1682
|
+
return {
|
|
1683
|
+
message: '--why takes one property; "all" resets every property',
|
|
1684
|
+
suggestion: 'Name the property you are after (e.g. --why color), or use --all to list the set ones',
|
|
1685
|
+
};
|
|
1686
|
+
}
|
|
1687
|
+
/**
|
|
1688
|
+
* Names given to --props or --why that are not CSS properties.
|
|
1648
1689
|
*
|
|
1649
|
-
* @param names - Unknown
|
|
1650
|
-
* @param suggestions -
|
|
1690
|
+
* @param names - Unknown names
|
|
1691
|
+
* @param suggestions - Closest known names
|
|
1651
1692
|
* @returns Message and suggestion
|
|
1652
1693
|
*/
|
|
1653
1694
|
export function unknownCssPropertyError(names, suggestions) {
|
|
@@ -1751,4 +1792,52 @@ export function cdpCallError(method, message) {
|
|
|
1751
1792
|
notFound: false,
|
|
1752
1793
|
};
|
|
1753
1794
|
}
|
|
1795
|
+
/**
|
|
1796
|
+
* The skill file is not where the package should have it (a broken or
|
|
1797
|
+
* partial install).
|
|
1798
|
+
*
|
|
1799
|
+
* @param source - Expected SKILL.md path
|
|
1800
|
+
* @returns Message and suggestion
|
|
1801
|
+
*/
|
|
1802
|
+
export function skillSourceMissingError(source) {
|
|
1803
|
+
return {
|
|
1804
|
+
message: `The bdg skill is missing from the installed package (${source})`,
|
|
1805
|
+
suggestion: 'Reinstall bdg: npm install -g browser-debugger-cli',
|
|
1806
|
+
};
|
|
1807
|
+
}
|
|
1808
|
+
/**
|
|
1809
|
+
* The skill could not be written to an agent's skill directory.
|
|
1810
|
+
*
|
|
1811
|
+
* @param path - Destination SKILL.md
|
|
1812
|
+
* @param reason - The file system error
|
|
1813
|
+
* @returns Message and suggestion
|
|
1814
|
+
*/
|
|
1815
|
+
export function skillWriteFailedError(path, reason) {
|
|
1816
|
+
return {
|
|
1817
|
+
message: `Could not write ${path}: ${reason}`,
|
|
1818
|
+
suggestion: 'Check the permissions of that directory, or install for the other agent only (--claude or --agents)',
|
|
1819
|
+
};
|
|
1820
|
+
}
|
|
1821
|
+
/**
|
|
1822
|
+
* `bdg peek --interval` without `--follow`.
|
|
1823
|
+
*
|
|
1824
|
+
* @returns Message and suggestion
|
|
1825
|
+
*/
|
|
1826
|
+
export function intervalWithoutFollowError() {
|
|
1827
|
+
return {
|
|
1828
|
+
message: '--interval sets how often --follow refreshes',
|
|
1829
|
+
suggestion: 'Add --follow, e.g. bdg peek --follow --interval 500',
|
|
1830
|
+
};
|
|
1831
|
+
}
|
|
1832
|
+
/**
|
|
1833
|
+
* An unknown `dom audit` check.
|
|
1834
|
+
*
|
|
1835
|
+
* @param value - Name given
|
|
1836
|
+
* @param similar - Closest names
|
|
1837
|
+
* @param checks - Every check
|
|
1838
|
+
* @returns Message
|
|
1839
|
+
*/
|
|
1840
|
+
export function unknownAuditCheckMessage(value, similar, checks) {
|
|
1841
|
+
return `Unknown check "${value}"${similar.length > 0 ? `; did you mean ${similar[0]}?` : ''} (checks: ${checks.join(', ')})`;
|
|
1842
|
+
}
|
|
1754
1843
|
//# sourceMappingURL=messages.js.map
|