@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.cjs CHANGED
@@ -923,6 +923,24 @@ function registerPrimitiveTools(server, { sessions, env }) {
923
923
  return { content: [{ type: "text", text: `cleared ${selector}` }] };
924
924
  }
925
925
  );
926
+ server.registerTool(
927
+ "human_selectText",
928
+ {
929
+ title: "Select an element\u2019s text (humanized)",
930
+ 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.",
931
+ inputSchema: {
932
+ selector: zod.z.string().describe("Selector of the element whose text to select."),
933
+ text: zod.z.string().optional().describe("Optional substring to select instead of the element\u2019s whole text."),
934
+ session: sessionArg2
935
+ }
936
+ },
937
+ async ({ selector, text, session }) => {
938
+ const { human } = await sessions.get(session);
939
+ await human.selectText(selector, text === void 0 ? void 0 : { text });
940
+ const what = text === void 0 ? "text" : `"${text}"`;
941
+ return { content: [{ type: "text", text: `selected ${what} in ${selector}` }] };
942
+ }
943
+ );
926
944
  server.registerTool(
927
945
  "human_check",
928
946
  {