@humanjs/mcp 0.3.0 → 0.4.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/dist/index.js CHANGED
@@ -920,6 +920,24 @@ function registerPrimitiveTools(server, { sessions, env }) {
920
920
  return { content: [{ type: "text", text: `cleared ${selector}` }] };
921
921
  }
922
922
  );
923
+ server.registerTool(
924
+ "human_selectText",
925
+ {
926
+ title: "Select an element\u2019s text (humanized)",
927
+ description: "Selects (highlights) text inside an element \u2014 moves the cursor to it, then selects. By default selects all of the element\u2019s text; pass `text` to select just that substring (found inside the element, whitespace-tolerant, first match; falls back to the whole element if not found). Use before copying, replacing, or triggering a highlight menu.",
928
+ inputSchema: {
929
+ selector: z.string().describe("Selector of the element whose text to select."),
930
+ text: z.string().optional().describe("Optional substring to select instead of the element\u2019s whole text."),
931
+ session: sessionArg2
932
+ }
933
+ },
934
+ async ({ selector, text, session }) => {
935
+ const { human } = await sessions.get(session);
936
+ await human.selectText(selector, text === void 0 ? void 0 : { text });
937
+ const what = text === void 0 ? "text" : `"${text}"`;
938
+ return { content: [{ type: "text", text: `selected ${what} in ${selector}` }] };
939
+ }
940
+ );
923
941
  server.registerTool(
924
942
  "human_check",
925
943
  {