@poe-platform/safe-bash 0.1.639 → 0.1.640

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.
@@ -0,0 +1,2 @@
1
+ export declare const playwrightHelpReference = "playwright-cli - run playwright mcp commands from terminal\n\nUsage: playwright-cli <command> [args] [options]\nUsage: playwright-cli -s=<session> <command> [args] [options]\n\nCore:\n open [url] open the browser\n attach [name] attach to a running playwright browser\n close close the browser\n detach detach from an attached browser\n goto <url> navigate to a url\n type <text> type text into editable element\n click <target> [button] perform click on a web page\n dblclick <target> [button] perform double click on a web page\n fill <target> <text> fill text into editable element\n drag <startTarget> <endTarget> perform drag and drop between two elements\n drop <target> drop files or data onto an element\n hover <target> hover over element on page\n select <target> <val> select an option in a dropdown\n upload <files...> upload one or multiple files\n check <target> check a checkbox or radio button\n uncheck <target> uncheck a checkbox or radio button\n snapshot [target] capture page snapshot to obtain element ref\n find [text] search the page snapshot for text or a regexp, returning matching nodes with surrounding context (like search snippets)\n eval <func> [target] evaluate javascript expression on page or element\n dialog-accept [prompt] accept a dialog\n dialog-dismiss dismiss a dialog\n resize <w> <h> resize the browser window\n delete-data delete session data\n\nNavigation:\n go-back go back to the previous page\n go-forward go forward to the next page\n reload reload the current page\n\nKeyboard:\n press <key> press a key on the keyboard, `a`, `arrowleft`\n keydown <key> press a key down on the keyboard\n keyup <key> press a key up on the keyboard\n\nMouse:\n mousemove <x> <y> move mouse to a given position\n mousedown [button] press mouse down\n mouseup [button] press mouse up\n mousewheel <dx> <dy> scroll mouse wheel\n\nSave as:\n screenshot [target] screenshot of the current page or element\n pdf save page as pdf\n\nTabs:\n tab-list list all tabs\n tab-new [url] create a new tab\n tab-close [index] close a browser tab\n tab-select <index> select a browser tab\n\nStorage:\n state-load <filename> loads browser storage (authentication) state from a file\n state-save [filename] saves the current storage (authentication) state to a file\n cookie-list list all cookies (optionally filtered by domain/path)\n cookie-get <name> get a specific cookie by name\n cookie-set <name> <value> set a cookie with optional flags\n cookie-delete <name> delete a specific cookie\n cookie-clear clear all cookies\n localstorage-list list all localstorage key-value pairs\n localstorage-get <key> get a localstorage item by key\n localstorage-set <key> <value> set a localstorage item\n localstorage-delete <key> delete a localstorage item\n localstorage-clear clear all localstorage\n sessionstorage-list list all sessionstorage key-value pairs\n sessionstorage-get <key> get a sessionstorage item by key\n sessionstorage-set <key> <value> set a sessionstorage item\n sessionstorage-delete <key> delete a sessionstorage item\n sessionstorage-clear clear all sessionstorage\n\nNetwork:\n requests list all network requests since loading the page. each request is numbered for use with the `request` command.\n request <index> show full details (headers, body, response) of a single network request by its number from the `requests` command.\n request-headers <index> print only the request headers for a single network request by its number from the `requests` command.\n request-body <index> print only the request body for a single network request by its number from the `requests` command.\n response-headers <index> print only the response headers for a single network request by its number from the `requests` command.\n response-body <index> print the response body for a single network request by its number from the `requests` command. textual bodies are inlined; binary bodies are saved to a file and the path is printed.\n route <pattern> mock network requests matching a url pattern\n route-list list all active network routes\n unroute [pattern] remove routes matching a pattern (or all routes)\n network-state-set <state> set the browser network state to online or offline\n\nDevTools:\n console [min-level] list console messages\n run-code [code] run playwright code snippet\n recording-start start recording user actions\n recording-stop stop recording user actions and print them as playwright code\n tracing-start start trace recording\n tracing-stop stop trace recording\n video-start [filename] start video recording\n video-stop stop video recording\n video-chapter <title> add a chapter marker to the video recording\n video-show-actions annotate subsequent cli/mcp actions on the page with a callout that names the action and highlights the target element\n video-hide-actions stop annotating actions performed on the page\n show show playwright dashboard\n pause-at <location> run the test up to a specific location and pause there\n resume resume the test execution\n step-over step over the next call in the test\n generate-locator <target> generate a playwright locator for the given element\n highlight [target] show (or with --hide, remove) a highlight overlay for an element; `--hide` without a target hides all page highlights.\n\nWebMCP:\n webmcp-list list the webmcp tools registered by the page\n webmcp-call <name> call a webmcp tool registered by the page\n\nInstall:\n install initialize workspace\n install-browser [browser] install browser\n\nBrowser sessions:\n list list browser sessions\n close-all close all browser sessions\n kill-all forcefully kill all browser sessions (for stale/zombie processes)\n\nGlobal options:\n --help [command] print help\n --json output response as JSON\n --raw output only the result value, without status and code\n --version print version\n";
2
+ //# sourceMappingURL=help-reference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"help-reference.d.ts","sourceRoot":"","sources":["../../src/playwright/help-reference.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,k2NA4HnC,CAAC"}
@@ -0,0 +1,126 @@
1
+ export const playwrightHelpReference = `playwright-cli - run playwright mcp commands from terminal
2
+
3
+ Usage: playwright-cli <command> [args] [options]
4
+ Usage: playwright-cli -s=<session> <command> [args] [options]
5
+
6
+ Core:
7
+ open [url] open the browser
8
+ attach [name] attach to a running playwright browser
9
+ close close the browser
10
+ detach detach from an attached browser
11
+ goto <url> navigate to a url
12
+ type <text> type text into editable element
13
+ click <target> [button] perform click on a web page
14
+ dblclick <target> [button] perform double click on a web page
15
+ fill <target> <text> fill text into editable element
16
+ drag <startTarget> <endTarget> perform drag and drop between two elements
17
+ drop <target> drop files or data onto an element
18
+ hover <target> hover over element on page
19
+ select <target> <val> select an option in a dropdown
20
+ upload <files...> upload one or multiple files
21
+ check <target> check a checkbox or radio button
22
+ uncheck <target> uncheck a checkbox or radio button
23
+ snapshot [target] capture page snapshot to obtain element ref
24
+ find [text] search the page snapshot for text or a regexp, returning matching nodes with surrounding context (like search snippets)
25
+ eval <func> [target] evaluate javascript expression on page or element
26
+ dialog-accept [prompt] accept a dialog
27
+ dialog-dismiss dismiss a dialog
28
+ resize <w> <h> resize the browser window
29
+ delete-data delete session data
30
+
31
+ Navigation:
32
+ go-back go back to the previous page
33
+ go-forward go forward to the next page
34
+ reload reload the current page
35
+
36
+ Keyboard:
37
+ press <key> press a key on the keyboard, \`a\`, \`arrowleft\`
38
+ keydown <key> press a key down on the keyboard
39
+ keyup <key> press a key up on the keyboard
40
+
41
+ Mouse:
42
+ mousemove <x> <y> move mouse to a given position
43
+ mousedown [button] press mouse down
44
+ mouseup [button] press mouse up
45
+ mousewheel <dx> <dy> scroll mouse wheel
46
+
47
+ Save as:
48
+ screenshot [target] screenshot of the current page or element
49
+ pdf save page as pdf
50
+
51
+ Tabs:
52
+ tab-list list all tabs
53
+ tab-new [url] create a new tab
54
+ tab-close [index] close a browser tab
55
+ tab-select <index> select a browser tab
56
+
57
+ Storage:
58
+ state-load <filename> loads browser storage (authentication) state from a file
59
+ state-save [filename] saves the current storage (authentication) state to a file
60
+ cookie-list list all cookies (optionally filtered by domain/path)
61
+ cookie-get <name> get a specific cookie by name
62
+ cookie-set <name> <value> set a cookie with optional flags
63
+ cookie-delete <name> delete a specific cookie
64
+ cookie-clear clear all cookies
65
+ localstorage-list list all localstorage key-value pairs
66
+ localstorage-get <key> get a localstorage item by key
67
+ localstorage-set <key> <value> set a localstorage item
68
+ localstorage-delete <key> delete a localstorage item
69
+ localstorage-clear clear all localstorage
70
+ sessionstorage-list list all sessionstorage key-value pairs
71
+ sessionstorage-get <key> get a sessionstorage item by key
72
+ sessionstorage-set <key> <value> set a sessionstorage item
73
+ sessionstorage-delete <key> delete a sessionstorage item
74
+ sessionstorage-clear clear all sessionstorage
75
+
76
+ Network:
77
+ requests list all network requests since loading the page. each request is numbered for use with the \`request\` command.
78
+ request <index> show full details (headers, body, response) of a single network request by its number from the \`requests\` command.
79
+ request-headers <index> print only the request headers for a single network request by its number from the \`requests\` command.
80
+ request-body <index> print only the request body for a single network request by its number from the \`requests\` command.
81
+ response-headers <index> print only the response headers for a single network request by its number from the \`requests\` command.
82
+ response-body <index> print the response body for a single network request by its number from the \`requests\` command. textual bodies are inlined; binary bodies are saved to a file and the path is printed.
83
+ route <pattern> mock network requests matching a url pattern
84
+ route-list list all active network routes
85
+ unroute [pattern] remove routes matching a pattern (or all routes)
86
+ network-state-set <state> set the browser network state to online or offline
87
+
88
+ DevTools:
89
+ console [min-level] list console messages
90
+ run-code [code] run playwright code snippet
91
+ recording-start start recording user actions
92
+ recording-stop stop recording user actions and print them as playwright code
93
+ tracing-start start trace recording
94
+ tracing-stop stop trace recording
95
+ video-start [filename] start video recording
96
+ video-stop stop video recording
97
+ video-chapter <title> add a chapter marker to the video recording
98
+ video-show-actions annotate subsequent cli/mcp actions on the page with a callout that names the action and highlights the target element
99
+ video-hide-actions stop annotating actions performed on the page
100
+ show show playwright dashboard
101
+ pause-at <location> run the test up to a specific location and pause there
102
+ resume resume the test execution
103
+ step-over step over the next call in the test
104
+ generate-locator <target> generate a playwright locator for the given element
105
+ highlight [target] show (or with --hide, remove) a highlight overlay for an element; \`--hide\` without a target hides all page highlights.
106
+
107
+ WebMCP:
108
+ webmcp-list list the webmcp tools registered by the page
109
+ webmcp-call <name> call a webmcp tool registered by the page
110
+
111
+ Install:
112
+ install initialize workspace
113
+ install-browser [browser] install browser
114
+
115
+ Browser sessions:
116
+ list list browser sessions
117
+ close-all close all browser sessions
118
+ kill-all forcefully kill all browser sessions (for stale/zombie processes)
119
+
120
+ Global options:
121
+ --help [command] print help
122
+ --json output response as JSON
123
+ --raw output only the result value, without status and code
124
+ --version print version
125
+ `;
126
+ //# sourceMappingURL=help-reference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"help-reference.js","sourceRoot":"","sources":["../../src/playwright/help-reference.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4HtC,CAAC"}
@@ -1,87 +1,59 @@
1
1
  export declare const playwrightCommands: {
2
2
  readonly open: {
3
3
  readonly arity: readonly [1, 2];
4
- readonly usage: "open [url]";
5
- readonly description: "Open a new session (about:blank when no URL is given).";
6
4
  readonly details: "--browser <chromium|firefox|webkit> selects an injected engine (default: chromium).\n--headed or --headless selects the mode (default: headless); host support is required.";
7
5
  };
8
6
  readonly goto: {
9
7
  readonly arity: readonly [2, 2];
10
- readonly usage: "goto <url>";
11
- readonly description: "Navigate the selected tab in an open session.";
12
8
  readonly details: "Navigation accepts http:, https:, and about:blank. It invalidates snapshot refs.";
13
9
  };
14
10
  readonly list: {
15
11
  readonly arity: readonly [1, 1];
16
- readonly usage: "list";
17
- readonly description: "List named sessions and their lifecycle states.";
18
- readonly details: "States: acquiring, open, closing, closed.";
12
+ readonly details: "Lists sessions owned by this controller. States: acquiring, open, closing, closed.";
19
13
  };
20
14
  readonly close: {
21
15
  readonly arity: readonly [1, 1];
22
- readonly usage: "close";
23
- readonly description: "Close the selected session.";
24
- readonly details: "Closing an absent session is safe. Use open to start it again.";
16
+ readonly details: "Closes the selected owned session. Closing an absent session is safe; use open to start it again.";
25
17
  };
26
18
  readonly 'close-all': {
27
19
  readonly arity: readonly [1, 1];
28
- readonly usage: "close-all";
29
- readonly description: "Close all sessions owned by this controller.";
30
- readonly details: "This does not terminate unrelated host browsers.";
20
+ readonly details: "Closes sessions owned by this controller, not unrelated host browsers.";
31
21
  };
32
22
  readonly snapshot: {
33
23
  readonly arity: readonly [1, 1];
34
- readonly usage: "snapshot";
35
- readonly description: "Read page text and capture actionable element refs.";
36
24
  readonly details: "--filename <path> writes UTF-8 snapshot text to the virtual filesystem instead of stdout.\nUse the emitted refs (for example e1) with click/fill; snapshot again after changes.\nA new snapshot, navigation or tab change invalidates old refs. Byte/ref limits apply.";
37
25
  };
38
26
  readonly click: {
39
27
  readonly arity: readonly [2, 2];
40
- readonly usage: "click <ref>";
41
- readonly description: "Click an element from the latest snapshot.";
42
- readonly details: "The ref must be an issued, still-connected element handle, not a CSS selector.";
28
+ readonly details: "The target must still be connected to the current page.";
43
29
  };
44
30
  readonly fill: {
45
31
  readonly arity: readonly [3, 3];
46
- readonly usage: "fill <ref> <text>";
47
- readonly description: "Fill an element from the latest snapshot.";
48
32
  readonly details: "Quote text containing spaces; use -- before literal arguments beginning with -.";
49
33
  };
50
34
  readonly press: {
51
35
  readonly arity: readonly [2, 2];
52
- readonly usage: "press <key>";
53
- readonly description: "Press a key, such as Enter or Control+a.";
54
36
  readonly details: "Acts on the selected tab through the injected keyboard capability.";
55
37
  };
56
38
  readonly screenshot: {
57
39
  readonly arity: readonly [1, 1];
58
- readonly usage: "screenshot";
59
- readonly description: "Capture an image of the selected tab.";
60
40
  readonly details: "--filename <path.png|path.jpg|path.jpeg> writes to the virtual filesystem.\nWithout --filename, raw PNG bytes go to stdout; use shell redirection.\n--full-page captures the whole page instead of the viewport. Byte limits apply.";
61
41
  };
62
42
  readonly 'tab-list': {
63
43
  readonly arity: readonly [1, 1];
64
- readonly usage: "tab-list";
65
- readonly description: "List tabs with zero-based indexes and URLs.";
66
- readonly details: "The selected tab is marked selected.";
44
+ readonly details: "Tabs have zero-based indexes; the selected tab is marked selected.";
67
45
  };
68
46
  readonly 'tab-new': {
69
47
  readonly arity: readonly [1, 2];
70
- readonly usage: "tab-new [url]";
71
- readonly description: "Open and select a new tab.";
72
- readonly details: "Defaults to about:blank. The host tab limit applies.";
48
+ readonly details: "Opens and selects a tab, defaulting to about:blank. The host tab limit applies.";
73
49
  };
74
50
  readonly 'tab-select': {
75
51
  readonly arity: readonly [2, 2];
76
- readonly usage: "tab-select <index>";
77
- readonly description: "Select a tab by its zero-based index.";
78
52
  readonly details: "Use tab-list to discover indexes. Selecting a tab invalidates snapshot refs.";
79
53
  };
80
54
  readonly 'tab-close': {
81
55
  readonly arity: readonly [1, 2];
82
- readonly usage: "tab-close [index]";
83
- readonly description: "Close a tab (the selected tab by default).";
84
- readonly details: "Use tab-list to discover the remaining tabs after closing one.";
56
+ readonly details: "Closes the selected tab when no index is given. Use tab-list to discover remaining tabs.";
85
57
  };
86
58
  };
87
59
  export type PlaywrightCommand = keyof typeof playwrightCommands;
@@ -1 +1 @@
1
- {"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/playwright/help.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAerB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,kBAAkB,CAAC;AAEhE,wBAAgB,oBAAoB,CAAC,KAAK,CAAC,EAAE,iBAAiB,GAAG,KAAK,GAAG,MAAM,CAS9E"}
1
+ {"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/playwright/help.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAerB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,kBAAkB,CAAC;AAShE,wBAAgB,oBAAoB,CAAC,KAAK,CAAC,EAAE,iBAAiB,GAAG,KAAK,GAAG,MAAM,CA0B9E"}
@@ -1,30 +1,56 @@
1
+ import { playwrightHelpReference } from './help-reference.js';
1
2
  export const playwrightCommands = {
2
- open: { arity: [1, 2], usage: 'open [url]', description: 'Open a new session (about:blank when no URL is given).', details: '--browser <chromium|firefox|webkit> selects an injected engine (default: chromium).\n--headed or --headless selects the mode (default: headless); host support is required.' },
3
- goto: { arity: [2, 2], usage: 'goto <url>', description: 'Navigate the selected tab in an open session.', details: 'Navigation accepts http:, https:, and about:blank. It invalidates snapshot refs.' },
4
- list: { arity: [1, 1], usage: 'list', description: 'List named sessions and their lifecycle states.', details: 'States: acquiring, open, closing, closed.' },
5
- close: { arity: [1, 1], usage: 'close', description: 'Close the selected session.', details: 'Closing an absent session is safe. Use open to start it again.' },
6
- 'close-all': { arity: [1, 1], usage: 'close-all', description: 'Close all sessions owned by this controller.', details: 'This does not terminate unrelated host browsers.' },
7
- snapshot: { arity: [1, 1], usage: 'snapshot', description: 'Read page text and capture actionable element refs.', details: '--filename <path> writes UTF-8 snapshot text to the virtual filesystem instead of stdout.\nUse the emitted refs (for example e1) with click/fill; snapshot again after changes.\nA new snapshot, navigation or tab change invalidates old refs. Byte/ref limits apply.' },
8
- click: { arity: [2, 2], usage: 'click <ref>', description: 'Click an element from the latest snapshot.', details: 'The ref must be an issued, still-connected element handle, not a CSS selector.' },
9
- fill: { arity: [3, 3], usage: 'fill <ref> <text>', description: 'Fill an element from the latest snapshot.', details: 'Quote text containing spaces; use -- before literal arguments beginning with -.' },
10
- press: { arity: [2, 2], usage: 'press <key>', description: 'Press a key, such as Enter or Control+a.', details: 'Acts on the selected tab through the injected keyboard capability.' },
11
- screenshot: { arity: [1, 1], usage: 'screenshot', description: 'Capture an image of the selected tab.', details: '--filename <path.png|path.jpg|path.jpeg> writes to the virtual filesystem.\nWithout --filename, raw PNG bytes go to stdout; use shell redirection.\n--full-page captures the whole page instead of the viewport. Byte limits apply.' },
12
- 'tab-list': { arity: [1, 1], usage: 'tab-list', description: 'List tabs with zero-based indexes and URLs.', details: 'The selected tab is marked selected.' },
13
- 'tab-new': { arity: [1, 2], usage: 'tab-new [url]', description: 'Open and select a new tab.', details: 'Defaults to about:blank. The host tab limit applies.' },
14
- 'tab-select': { arity: [2, 2], usage: 'tab-select <index>', description: 'Select a tab by its zero-based index.', details: 'Use tab-list to discover indexes. Selecting a tab invalidates snapshot refs.' },
15
- 'tab-close': { arity: [1, 2], usage: 'tab-close [index]', description: 'Close a tab (the selected tab by default).', details: 'Use tab-list to discover the remaining tabs after closing one.' },
3
+ open: { arity: [1, 2], details: '--browser <chromium|firefox|webkit> selects an injected engine (default: chromium).\n--headed or --headless selects the mode (default: headless); host support is required.' },
4
+ goto: { arity: [2, 2], details: 'Navigation accepts http:, https:, and about:blank. It invalidates snapshot refs.' },
5
+ list: { arity: [1, 1], details: 'Lists sessions owned by this controller. States: acquiring, open, closing, closed.' },
6
+ close: { arity: [1, 1], details: 'Closes the selected owned session. Closing an absent session is safe; use open to start it again.' },
7
+ 'close-all': { arity: [1, 1], details: 'Closes sessions owned by this controller, not unrelated host browsers.' },
8
+ snapshot: { arity: [1, 1], details: '--filename <path> writes UTF-8 snapshot text to the virtual filesystem instead of stdout.\nUse the emitted refs (for example e1) with click/fill; snapshot again after changes.\nA new snapshot, navigation or tab change invalidates old refs. Byte/ref limits apply.' },
9
+ click: { arity: [2, 2], details: 'The target must still be connected to the current page.' },
10
+ fill: { arity: [3, 3], details: 'Quote text containing spaces; use -- before literal arguments beginning with -.' },
11
+ press: { arity: [2, 2], details: 'Acts on the selected tab through the injected keyboard capability.' },
12
+ screenshot: { arity: [1, 1], details: '--filename <path.png|path.jpg|path.jpeg> writes to the virtual filesystem.\nWithout --filename, raw PNG bytes go to stdout; use shell redirection.\n--full-page captures the whole page instead of the viewport. Byte limits apply.' },
13
+ 'tab-list': { arity: [1, 1], details: 'Tabs have zero-based indexes; the selected tab is marked selected.' },
14
+ 'tab-new': { arity: [1, 2], details: 'Opens and selects a tab, defaulting to about:blank. The host tab limit applies.' },
15
+ 'tab-select': { arity: [2, 2], details: 'Use tab-list to discover indexes. Selecting a tab invalidates snapshot refs.' },
16
+ 'tab-close': { arity: [1, 2], details: 'Closes the selected tab when no index is given. Use tab-list to discover remaining tabs.' },
17
+ };
18
+ const limitedForms = {
19
+ click: 'click: <target> must be an issued snapshot ref; the optional button argument is unsupported.',
20
+ fill: 'fill: <target> must be an issued snapshot ref, not a selector or text target.',
21
+ snapshot: 'snapshot: the optional target argument is unsupported; only full-page snapshots are available.',
22
+ screenshot: 'screenshot: the optional target argument is unsupported; element screenshots are unavailable.',
16
23
  };
17
24
  export function formatPlaywrightHelp(topic) {
18
- const commands = Object.entries(playwrightCommands).filter(([name]) => topic === undefined || (topic === 'tab' ? name.startsWith('tab-') : name === topic));
19
- const usage = topic === undefined ? '[options] <command> [arguments]' : topic === 'tab' ? 'tab <list|new|select|close> [arguments]' : playwrightCommands[topic].usage;
20
- let text = `Usage: playwright-cli ${usage}\n\nSupported commands:\n`;
21
- for (const [, command] of commands)
22
- text += ` ${command.usage.padEnd(24)} ${command.description}\n`;
23
- if (topic !== undefined)
24
- text += `\n${commands.map(([, command]) => command.details).join('\n')}\n`;
25
- else
26
- text += '\nCommand options:\n open: --browser <engine>, --headed, --headless\n snapshot: --filename <path> (UTF-8 text; default: stdout)\n screenshot: --filename <path.png|path.jpg|path.jpeg>, --full-page\n Default: raw PNG on stdout; use shell redirection.\n';
27
- text += '\nSession selection:\n -s, --session <name> Select a session (also accepts --session=<name>).\n Precedence: explicit option > exported PLAYWRIGHT_CLI_SESSION > default.\n Commands reuse the selected open session; repeated open is an error.\n Sessions live only in this retained controller, not across independent owners.\n close/close-all release owned sessions; remote loss requires an explicit open.\n\nDiscovery and limits:\n --help, -h, help [command] Show help without allocating a browser.\n playwright-cli <command> --help shows command arguments and options.\n tab <list|new|select|close> is also accepted.\n Snapshot refs are temporary handles, not selectors; recapture after changes.\n Snapshot byte/ref, screenshot byte, session and tab limits are host-configured.\n Browser commands require an injected adapter; help does not.\n\nUnsupported in this subset:\n Arbitrary code/eval, uploads, downloads, PDF, video, tracing, install,\n kill-all, persistent profiles and unlisted commands/options.\n';
25
+ const lines = playwrightHelpReference.split('\n');
26
+ const commands = lines.filter(line => line.startsWith(' ')).map(line => ({ name: line.trimStart().split(' ')[0], line }));
27
+ let text;
28
+ if (topic === undefined) {
29
+ text = lines.map(line => {
30
+ if (!line.startsWith(' '))
31
+ return line;
32
+ const name = line.trimStart().split(' ')[0];
33
+ if (name === '--help')
34
+ return line;
35
+ if (!Object.hasOwn(playwrightCommands, name))
36
+ return `${line} [unsupported]`;
37
+ return limitedForms[name] ? `${line} [limited]` : line;
38
+ }).join('\n').replace('\nCore:\n', '\nAvailability: [unsupported] is not implemented; [limited] has restrictions explained below.\n\nCore:\n');
39
+ }
40
+ else {
41
+ const selected = commands.filter(command => topic === 'tab' ? command.name.startsWith('tab-') : command.name === topic);
42
+ const usage = topic === 'tab' ? 'tab <list|new|select|close> [args]' : selected[0].line.trimStart().split(' ')[0].trimEnd();
43
+ text = `${lines[0]}\n\nUsage: playwright-cli ${usage}\nUsage: playwright-cli -s=<session> ${usage}\n\n`;
44
+ for (const command of selected) {
45
+ const name = command.name;
46
+ text += `${command.line}${limitedForms[name] ? ' [limited]' : ''}\n\n${playwrightCommands[name].details}\n`;
47
+ }
48
+ }
49
+ text += '\nCompatibility notes:\nUnsupported entries above are reference-only and cannot be executed.\nUnlisted command options are also unsupported; use --help <command> for supported options.\n';
50
+ text += Object.entries(limitedForms).filter(([name]) => topic === undefined || topic === name).map(([, note]) => ` ${note}\n`).join('');
51
+ if (topic === undefined)
52
+ text += '\nSupported command options:\n open: --browser <chromium|firefox|webkit>, --headed, --headless\n snapshot: --filename <path> (UTF-8 text; default: stdout)\n screenshot: --filename <path.png|path.jpg|path.jpeg>, --full-page\n Default: raw PNG on stdout; use shell redirection.\n';
53
+ text += '\nSession selection and lifecycle:\n -s, --session <name> Select a session (also accepts -s=<name> or --session=<name>).\n Precedence: explicit option > exported PLAYWRIGHT_CLI_SESSION > default.\n Commands reuse the selected open session; repeated open is an error.\n Sessions live only in this retained controller, not across independent owners.\n close/close-all release owned sessions; remote loss requires an explicit open.\n\nHost limits and discovery:\n Snapshot byte/ref, screenshot byte, session and tab limits are host-configured.\n Snapshot refs are temporary handles, not selectors; recapture after changes.\n Browser commands require an injected adapter; help does not allocate a browser.\n -h and help [command] are also accepted, as is tab <list|new|select|close>.\n';
28
54
  return text;
29
55
  }
30
56
  //# sourceMappingURL=help.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/playwright/help.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,wDAAwD,EAAE,OAAO,EAAE,6KAA6K,EAAE;IAC3S,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,+C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,KAAK,CAAC,CAAC,CAAC,6BAA6B,KAAK,wCAAwC,KAAK,MAAM,CAAC;QACxG,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAyB,CAAC;YAC/C,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC;QAC9G,CAAC;IACH,CAAC;IACD,IAAI,IAAI,4LAA4L,CAAC;IACrM,IAAI,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACzI,IAAI,KAAK,KAAK,SAAS;QAAE,IAAI,IAAI,+SAA+S,CAAC;IACjV,IAAI,IAAI,yxBAAyxB,CAAC;IAClyB,OAAO,IAAI,CAAC;AACd,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poe-platform/safe-bash",
3
- "version": "0.1.639",
3
+ "version": "0.1.640",
4
4
  "description": "Extensible virtual shell with pluggable filesystems and streaming commands",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -356,7 +356,7 @@
356
356
  "access": "public"
357
357
  },
358
358
  "dependencies": {
359
- "@poe-platform/safe-fs": "0.1.639",
359
+ "@poe-platform/safe-fs": "0.1.640",
360
360
  "pako": "3.0.1",
361
361
  "@noble/hashes": "2.4.0",
362
362
  "@types/node": "^25.2.2",