auto-chrome-mcp-shared 1.6.0 → 1.8.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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 hangye
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2024 hangye
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.js CHANGED
@@ -822,7 +822,7 @@ Tip: If the returned elements do not include the specific element you need, use
822
822
  },
823
823
  {
824
824
  name: TOOL_NAMES.BROWSER.WEB_FETCHER,
825
- description: "Fetch content from a web page",
825
+ description: "Read a page as text (reader view by default: nav/footer/cookie-banner noise stripped) or as cleaned HTML. Repeat reads of an unchanged tab return {unchanged:true} instead of the body. Both modes are length-capped and report fullTextChars/fullHtmlChars vs returnedChars so you can tell what was cut. For a handful of known fields prefer chrome_extract, and for clicking/typing prefer chrome_read_page (it returns element refs); use this when you want the page content itself.",
826
826
  inputSchema: {
827
827
  type: "object",
828
828
  properties: {
@@ -840,7 +840,7 @@ Tip: If the returned elements do not include the specific element you need, use
840
840
  },
841
841
  htmlContent: {
842
842
  type: "boolean",
843
- description: "Get the visible HTML content of the page. If true, textContent will be ignored (default: false)"
843
+ description: "Return cleaned HTML (scripts/styles/SVG stripped) instead of text. Much more expensive than text \u2014 use it only when you need markup/attributes, and pair it with selector. If true, textContent is ignored (default: false)"
844
844
  },
845
845
  textContent: {
846
846
  type: "boolean",
@@ -850,13 +850,17 @@ Tip: If the returned elements do not include the specific element you need, use
850
850
  type: "string",
851
851
  description: "CSS selector to get content from a specific element. If provided, only content from this element will be returned"
852
852
  },
853
+ maxChars: {
854
+ type: "number",
855
+ description: "Cap on returned HTML length (default 100000). Only applies to htmlContent mode; the result reports fullHtmlChars/returnedChars and truncated:true when it was cut."
856
+ },
853
857
  raw: {
854
858
  type: "boolean",
855
859
  description: "Text mode returns reader-view content by default (navigation/footer/cookie-banner noise stripped, main content kept \u2014 fullTextChars vs returnedChars reported). Pass true for the unfiltered full text. Default: false"
856
860
  },
857
861
  diff: {
858
862
  type: "boolean",
859
- description: "When true (default), returns {unchanged:true} instead of the body if identical to your previous read of this tab \u2014 reuse the earlier content. Pass false to force full re-send."
863
+ description: "When true (default), returns {unchanged:true} instead of the body if identical to your previous read of this tab (text and HTML modes are tracked separately) \u2014 reuse the earlier content. Pass false to force full re-send."
860
864
  }
861
865
  },
862
866
  required: []
@@ -1885,6 +1889,28 @@ Tip: If the returned elements do not include the specific element you need, use
1885
1889
  }
1886
1890
  }
1887
1891
  ];
1892
+ var LANE_EXEMPT_TOOLS = /* @__PURE__ */ new Set([
1893
+ TOOL_NAMES.BROWSER.GET_WINDOWS_AND_TABS,
1894
+ TOOL_NAMES.BROWSER.SEARCH_TABS_CONTENT,
1895
+ TOOL_NAMES.BROWSER.HISTORY,
1896
+ TOOL_NAMES.BROWSER.BOOKMARK_SEARCH,
1897
+ TOOL_NAMES.BROWSER.BOOKMARK_ADD,
1898
+ TOOL_NAMES.BROWSER.BOOKMARK_DELETE,
1899
+ TOOL_NAMES.BROWSER.REQUEST_USER_CONSENT
1900
+ ]);
1901
+ var LANE_DESCRIPTION_SHORT = 'Parallel lane id. Concurrent agents share one MCP session \u2014 give each agent its own lane (e.g. "agent-1") and pass it on every call so they get isolated work tabs. Omit when not parallel.';
1902
+ var LANE_DESCRIPTION_LONG = 'Parallel lane id. Sub-agents of one Claude Code session share a single MCP session, so without a lane they overwrite each other\u2019s work tab. Give each concurrent agent a distinct lane (e.g. "agent-1") and pass the SAME lane on every subsequent call: the tab opened for a lane is never retargeted or closed by another lane. Omit when not running agents in parallel.';
1903
+ for (const tool of TOOL_SCHEMAS) {
1904
+ if (LANE_EXEMPT_TOOLS.has(tool.name)) continue;
1905
+ const schema = tool.inputSchema;
1906
+ if (!schema || typeof schema !== "object") continue;
1907
+ if (!schema.properties) schema.properties = {};
1908
+ if (schema.properties.lane !== void 0) continue;
1909
+ schema.properties.lane = {
1910
+ type: "string",
1911
+ description: tool.name === TOOL_NAMES.BROWSER.NAVIGATE || tool.name === TOOL_NAMES.BROWSER.SET_WORK_TAB ? LANE_DESCRIPTION_LONG : LANE_DESCRIPTION_SHORT
1912
+ };
1913
+ }
1888
1914
 
1889
1915
  // src/labels.ts
1890
1916
  var EDGE_LABELS = {
package/dist/index.mjs CHANGED
@@ -777,7 +777,7 @@ Tip: If the returned elements do not include the specific element you need, use
777
777
  },
778
778
  {
779
779
  name: TOOL_NAMES.BROWSER.WEB_FETCHER,
780
- description: "Fetch content from a web page",
780
+ description: "Read a page as text (reader view by default: nav/footer/cookie-banner noise stripped) or as cleaned HTML. Repeat reads of an unchanged tab return {unchanged:true} instead of the body. Both modes are length-capped and report fullTextChars/fullHtmlChars vs returnedChars so you can tell what was cut. For a handful of known fields prefer chrome_extract, and for clicking/typing prefer chrome_read_page (it returns element refs); use this when you want the page content itself.",
781
781
  inputSchema: {
782
782
  type: "object",
783
783
  properties: {
@@ -795,7 +795,7 @@ Tip: If the returned elements do not include the specific element you need, use
795
795
  },
796
796
  htmlContent: {
797
797
  type: "boolean",
798
- description: "Get the visible HTML content of the page. If true, textContent will be ignored (default: false)"
798
+ description: "Return cleaned HTML (scripts/styles/SVG stripped) instead of text. Much more expensive than text \u2014 use it only when you need markup/attributes, and pair it with selector. If true, textContent is ignored (default: false)"
799
799
  },
800
800
  textContent: {
801
801
  type: "boolean",
@@ -805,13 +805,17 @@ Tip: If the returned elements do not include the specific element you need, use
805
805
  type: "string",
806
806
  description: "CSS selector to get content from a specific element. If provided, only content from this element will be returned"
807
807
  },
808
+ maxChars: {
809
+ type: "number",
810
+ description: "Cap on returned HTML length (default 100000). Only applies to htmlContent mode; the result reports fullHtmlChars/returnedChars and truncated:true when it was cut."
811
+ },
808
812
  raw: {
809
813
  type: "boolean",
810
814
  description: "Text mode returns reader-view content by default (navigation/footer/cookie-banner noise stripped, main content kept \u2014 fullTextChars vs returnedChars reported). Pass true for the unfiltered full text. Default: false"
811
815
  },
812
816
  diff: {
813
817
  type: "boolean",
814
- description: "When true (default), returns {unchanged:true} instead of the body if identical to your previous read of this tab \u2014 reuse the earlier content. Pass false to force full re-send."
818
+ description: "When true (default), returns {unchanged:true} instead of the body if identical to your previous read of this tab (text and HTML modes are tracked separately) \u2014 reuse the earlier content. Pass false to force full re-send."
815
819
  }
816
820
  },
817
821
  required: []
@@ -1840,6 +1844,28 @@ Tip: If the returned elements do not include the specific element you need, use
1840
1844
  }
1841
1845
  }
1842
1846
  ];
1847
+ var LANE_EXEMPT_TOOLS = /* @__PURE__ */ new Set([
1848
+ TOOL_NAMES.BROWSER.GET_WINDOWS_AND_TABS,
1849
+ TOOL_NAMES.BROWSER.SEARCH_TABS_CONTENT,
1850
+ TOOL_NAMES.BROWSER.HISTORY,
1851
+ TOOL_NAMES.BROWSER.BOOKMARK_SEARCH,
1852
+ TOOL_NAMES.BROWSER.BOOKMARK_ADD,
1853
+ TOOL_NAMES.BROWSER.BOOKMARK_DELETE,
1854
+ TOOL_NAMES.BROWSER.REQUEST_USER_CONSENT
1855
+ ]);
1856
+ var LANE_DESCRIPTION_SHORT = 'Parallel lane id. Concurrent agents share one MCP session \u2014 give each agent its own lane (e.g. "agent-1") and pass it on every call so they get isolated work tabs. Omit when not parallel.';
1857
+ var LANE_DESCRIPTION_LONG = 'Parallel lane id. Sub-agents of one Claude Code session share a single MCP session, so without a lane they overwrite each other\u2019s work tab. Give each concurrent agent a distinct lane (e.g. "agent-1") and pass the SAME lane on every subsequent call: the tab opened for a lane is never retargeted or closed by another lane. Omit when not running agents in parallel.';
1858
+ for (const tool of TOOL_SCHEMAS) {
1859
+ if (LANE_EXEMPT_TOOLS.has(tool.name)) continue;
1860
+ const schema = tool.inputSchema;
1861
+ if (!schema || typeof schema !== "object") continue;
1862
+ if (!schema.properties) schema.properties = {};
1863
+ if (schema.properties.lane !== void 0) continue;
1864
+ schema.properties.lane = {
1865
+ type: "string",
1866
+ description: tool.name === TOOL_NAMES.BROWSER.NAVIGATE || tool.name === TOOL_NAMES.BROWSER.SET_WORK_TAB ? LANE_DESCRIPTION_LONG : LANE_DESCRIPTION_SHORT
1867
+ };
1868
+ }
1843
1869
 
1844
1870
  // src/labels.ts
1845
1871
  var EDGE_LABELS = {
package/package.json CHANGED
@@ -1,7 +1,12 @@
1
1
  {
2
2
  "name": "auto-chrome-mcp-shared",
3
- "version": "1.6.0",
3
+ "version": "1.8.0",
4
4
  "author": "hangye (upstream), scalemaker-ship-it (auto-chrome-mcp fork)",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/cw02326/auto-chrome-mcp.git",
8
+ "directory": "packages/shared"
9
+ },
5
10
  "main": "dist/index.js",
6
11
  "module": "./dist/index.mjs",
7
12
  "types": "dist/index.d.ts",