@drawpro/mcp 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. package/dist/server.js +41 -13
  2. package/package.json +1 -1
package/dist/server.js CHANGED
@@ -337,23 +337,51 @@ function forgetKey(email) {
337
337
  }
338
338
 
339
339
  // ../client/src/prompt.ts
340
- var import_node_readline = require("node:readline");
341
- var CLEAR_LINE = "\x1B[2K\x1B[200D";
342
340
  function askHidden(question) {
343
341
  return new Promise((resolve) => {
344
- const rl = (0, import_node_readline.createInterface)({ input: process.stdin, output: process.stdout, terminal: true });
342
+ const input = process.stdin;
345
343
  process.stdout.write(question);
346
- const onData = () => {
347
- const typed = rl.line ?? "";
348
- process.stdout.write(CLEAR_LINE + question + "*".repeat(typed.length));
349
- };
350
- process.stdin.on("data", onData);
351
- rl.question("", (answer) => {
352
- process.stdin.removeListener("data", onData);
353
- rl.close();
344
+ if (!input.isTTY) {
345
+ let buffered = "";
346
+ input.setEncoding("utf8");
347
+ input.on("data", (chunk) => {
348
+ buffered += chunk;
349
+ });
350
+ input.on("end", () => resolve(buffered.split("\n")[0].trim()));
351
+ return;
352
+ }
353
+ const wasRaw = input.isRaw;
354
+ input.setRawMode(true);
355
+ input.resume();
356
+ input.setEncoding("utf8");
357
+ let value = "";
358
+ const finish = (result) => {
359
+ input.removeListener("data", onData);
360
+ input.setRawMode(wasRaw);
361
+ input.pause();
354
362
  process.stdout.write("\n");
355
- resolve(answer);
356
- });
363
+ if (result === null) {
364
+ process.exit(130);
365
+ }
366
+ resolve(result);
367
+ };
368
+ const onData = (chunk) => {
369
+ for (const ch of chunk) {
370
+ if (ch === "\r" || ch === "\n") return finish(value);
371
+ if (ch === "") return finish(null);
372
+ if (ch === "\x7F" || ch === "\b") {
373
+ if (value.length > 0) {
374
+ value = value.slice(0, -1);
375
+ process.stdout.write("\b \b");
376
+ }
377
+ continue;
378
+ }
379
+ if (ch < " ") continue;
380
+ value += ch;
381
+ process.stdout.write("*");
382
+ }
383
+ };
384
+ input.on("data", onData);
357
385
  });
358
386
  }
359
387
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drawpro/mcp",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "MCP server for DrawPro \u2014 read and create end-to-end encrypted Excalidraw diagrams from Claude",
5
5
  "license": "MIT",
6
6
  "repository": {