nagoc-zerowork 1.1.18 → 1.1.20

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 (3) hide show
  1. package/README.md +1 -1
  2. package/dist/index.js +13 -11
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -86,7 +86,7 @@ Just ask:
86
86
 
87
87
  Claude will pause and ask you to choose between two styles:
88
88
  1. **Interactive HTML**: Claude writes a premium, self-contained HTML file. Save it and open it in your browser to see a stunning Interactive Blueprint where you can click on any block to see the exact ZeroWork settings!
89
- 2. **Mermaid Flowchart**: Claude renders a visual, native Mermaid flowchart directly inside your chat window so you can view it instantly without leaving the app.
89
+ 2. **Mermaid Flowchart**: Claude outputs the raw copyable Mermaid code block as text, so you can easily copy and paste it into Draw.io, Mermaid Live Editor, or any other software.
90
90
 
91
91
  Because this MCP enforces strict ZeroWork naming rules, Claude will always use the exact building block names (e.g., *Launch Browser*, *Start Repeat*) in its diagrams.
92
92
 
package/dist/index.js CHANGED
@@ -9309,7 +9309,7 @@ Like this, you can just run it, you can schedule it to run as much as you like.
9309
9309
  When a user asks you to build, draw, or generate a diagram or flowchart for a ZeroWork workflow, you MUST follow these instructions STRICTLY:
9310
9310
 
9311
9311
  #### 1. ASK FOR THE FORMAT BEFORE GENERATING
9312
- You must STOP and ask the user: "Would you like a native Mermaid chart rendered here in the chat, or a premium interactive HTML file that you can save to your computer?"
9312
+ You must STOP and ask the user: "Would you like a copyable Mermaid chart code as text, or a premium interactive HTML file that you can save to your computer?"
9313
9313
  DO NOT generate any code until the user answers this question.
9314
9314
 
9315
9315
  #### 2. EXACT ZERO-WORK BLOCK NAMES
@@ -9332,11 +9332,12 @@ Do not invent block names. Use the exact UI names found in ZeroWork.
9332
9332
 
9333
9333
  ### If the User Chooses: MERMAID CHART
9334
9334
  Generate a production-ready Mermaid.js diagram adhering strictly to these standards:
9335
- 1. **Orientation & Flow:** Use \`graph LR\` (Left-to-Right) for logical, sequential, or decision-heavy workflows to prevent vertical stretching. Only use \`graph TD\` if the process is strictly hierarchical.
9336
- 2. **Visual Hierarchy (Subgraphs):** Cluster related steps into logical phases using \`subgraph\` blocks (e.g., [Setup/Auth], [Core Processing], [Error Handling]).
9337
- 3. **Routing & Branching Logic:** Keep the primary "Happy Path" moving linearly through the center. Route alternative paths and errors cleanly to the sides.
9338
- 4. **Clarity:** Keep text inside shapes short and action-oriented. Use standard shapes: \`[Rectangles]\` for actions, \`{"Diamonds"}\` for decisions, \`([Ovals])\` for start/end.
9339
- 5. **Modern Styling:** Apply a clean, professional color palette using Mermaid \`style\` or \`classDef\`. Use muted green for success, soft blue for operations, light yellow for decisions, and soft red for errors.
9335
+ 1. **Output Format:** You MUST wrap the Mermaid code inside a standard text code block (using \`\`\`text ... \`\`\`) rather than \`\`\`mermaid. This ensures the chat client displays the raw Mermaid syntax as copyable text instead of rendering it visually, so the user can easily copy and paste the code into Draw.io, Mermaid Live Editor, or other software.
9336
+ 2. **Orientation & Flow:** Use \`graph LR\` (Left-to-Right) for logical, sequential, or decision-heavy workflows to prevent vertical stretching. Only use \`graph TD\` if the process is strictly hierarchical.
9337
+ 3. **Visual Hierarchy (Subgraphs):** Cluster related steps into logical phases using \`subgraph\` blocks (e.g., [Setup/Auth], [Core Processing], [Error Handling]).
9338
+ 4. **Routing & Branching Logic:** Keep the primary "Happy Path" moving linearly through the center. Route alternative paths and errors cleanly to the sides.
9339
+ 5. **Clarity:** Keep text inside shapes short and action-oriented. Use standard shapes: \`[Rectangles]\` for actions, \`{"Diamonds"}\` for decisions, \`([Ovals])\` for start/end.
9340
+ 6. **Modern Styling:** Apply a clean, professional color palette using Mermaid \`style\` or \`classDef\`. Use muted green for success, soft blue for operations, light yellow for decisions, and soft red for errors.
9340
9341
 
9341
9342
  ---
9342
9343
 
@@ -9346,7 +9347,8 @@ You must use the EXACT HTML, CSS, and JS structure provided in the template belo
9346
9347
  Your job is to:
9347
9348
  1. Update the \`<header>\` and \`<footer>\` titles/descriptions.
9348
9349
  2. Mathematically generate the SVG \`<path>\` (edges) and \`<g>\` (nodes) coordinates so they form a beautiful flowchart matching the workflow logic. Ensure lines connect properly without crossing poorly.
9349
- 3. Update the \`const DATA = { ... }\` block in the JavaScript with the exact configurations of the blocks you plotted in the SVG (ensure the \`data-id\` in the SVG matches the keys in the \`DATA\` object).
9350
+ 3. **Dynamic viewBox & Padding**: Calculate the total bounding box of all plotted nodes, paths, and swimlanes. You MUST dynamically update the SVG \`viewBox="0 0 [width] [calculated_height]"\` attribute so that all elements fit perfectly, leaving at least 60px-100px of extra padding/margin at the bottom and sides. Absolutely no element should be cut off or clipped at the borders.
9351
+ 4. Update the \`const DATA = { ... }\` block in the JavaScript with the exact configurations of the blocks you plotted in the SVG (ensure the \`data-id\` in the SVG matches the keys in the \`DATA\` object).
9350
9352
 
9351
9353
  **HTML BLUEPRINT TEMPLATE:**
9352
9354
  \`\`\`html
@@ -9373,7 +9375,7 @@ Your job is to:
9373
9375
  .wrap{display:grid;grid-template-columns:minmax(0,1fr) 380px;gap:18px;padding:18px 28px 28px}
9374
9376
  @media (max-width:1100px){.wrap{grid-template-columns:1fr}}
9375
9377
  .canvas{background:var(--panel);border:1px solid var(--line);border-radius:16px;overflow:hidden;position:relative;min-height:760px}
9376
- .canvas svg{display:block;width:100%;height:100%}
9378
+ .canvas svg{display:block;width:100%;height:auto}
9377
9379
  .panel{background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:18px;position:sticky;top:18px;height:max-content;max-height:calc(100vh - 36px);overflow:auto}
9378
9380
  .panel h2{margin:0 0 4px;font-size:16px}
9379
9381
  .panel .sub{color:var(--muted);font-size:12px;margin-bottom:14px}
@@ -9419,7 +9421,7 @@ Your job is to:
9419
9421
  <div class="wrap">
9420
9422
  <div class="canvas">
9421
9423
  <!-- YOU MUST PLOT THE SVG NODES, EDGES, AND SWIMLANES HERE -->
9422
- <svg viewBox="0 0 1100 1480" preserveAspectRatio="xMidYMin meet" id="flow">
9424
+ <svg viewBox="0 0 1100 [Calculated Height]" preserveAspectRatio="xMidYMin meet" id="flow">
9423
9425
  <defs>
9424
9426
  <marker id="arr" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 z" class="arrow"/></marker>
9425
9427
  <marker id="arrT" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 z" class="arrow true"/></marker>
@@ -9487,7 +9489,7 @@ render('n1');
9487
9489
  </body>
9488
9490
  </html>
9489
9491
  \`\`\`
9490
- `;var N_=()=>{let t=process.env.ZEROWORK_BOTS;if(!t)return{};try{return JSON.parse(t)}catch{return console.error("Failed to parse ZEROWORK_BOTS environment variable. Must be valid JSON."),{}}},ho=new Er({name:"nagoc-zerowork",version:"1.1.18"},{capabilities:{tools:{},resources:{}}});function Ui(){return af}ho.setRequestHandler(Na,async()=>{let e=Ui().map(n=>({uri:`resource://zerowork/tutorials/${n.id}`,name:`ZeroWork Video Tutorial: ${n.title}`,mimeType:"text/plain",description:`Official video masterclass transcript for: ${n.title}`}));return{resources:[{uri:"resource://zerowork/general",name:"ZeroWork General Knowledge",mimeType:"text/plain",description:"General concepts about ZeroWork RPA, TaskBots, and Architecture"},{uri:"resource://zerowork/webhooks",name:"ZeroWork Webhooks Guide",mimeType:"text/plain",description:"How to trigger ZeroWork bots and pass dynamic data via webhooks"},{uri:"resource://zerowork/variables",name:"ZeroWork Variables Guide",mimeType:"text/plain",description:"How variables work in ZeroWork"},{uri:"resource://zerowork/tables",name:"ZeroWork Tables Guide",mimeType:"text/plain",description:"How data tables work in ZeroWork"},{uri:"resource://zerowork/selectors",name:"ZeroWork Selectors Guide",mimeType:"text/plain",description:"How CSS and XPath selectors work in ZeroWork"},{uri:"resource://zerowork/loops",name:"ZeroWork Loops Guide",mimeType:"text/plain",description:"How loops and repeats work in ZeroWork"},{uri:"resource://zerowork/chatgpt",name:"ZeroWork ChatGPT Guide",mimeType:"text/plain",description:"How to integrate ChatGPT via Ask ChatGPT block"},{uri:"resource://zerowork/anti_bot",name:"ZeroWork Anti-Bot Guide",mimeType:"text/plain",description:"Best practices to avoid bot detection and handle dynamic states"},{uri:"resource://zerowork/troubleshooting",name:"ZeroWork Troubleshooting Guide",mimeType:"text/plain",description:"Common problems and troubleshooting steps"},{uri:"resource://zerowork/building_blocks",name:"ZeroWork Building Blocks Guide",mimeType:"text/plain",description:"Comprehensive catalog of all ZeroWork building blocks and their options"},{uri:"resource://zerowork/dynamic_inputs",name:"ZeroWork Dynamic Inputs Guide",mimeType:"text/plain",description:"How to use dynamic inputs: variable/table references, code expressions, code blocks, and spintax in ZeroWork building blocks"},{uri:"resource://zerowork/visual_insights",name:"ZeroWork Visual Insights and Troubleshooting",mimeType:"text/plain",description:"Comprehensive visual documentation and troubleshooting guide for ZeroWork covering over 140 common scenarios."},...e]}});ho.setRequestHandler(Ma,async t=>{let e=t.params.uri,n="";if(e.startsWith("resource://zerowork/tutorials/")){let o=e.replace("resource://zerowork/tutorials/",""),a=Ui().find(s=>s.id===o);if(!a)throw new Error(`Tutorial resource not found: ${e}`);n=`=== ${a.title} ===
9492
+ `;var N_=()=>{let t=process.env.ZEROWORK_BOTS;if(!t)return{};try{return JSON.parse(t)}catch{return console.error("Failed to parse ZEROWORK_BOTS environment variable. Must be valid JSON."),{}}},ho=new Er({name:"nagoc-zerowork",version:"1.1.20"},{capabilities:{tools:{},resources:{}}});function Ui(){return af}ho.setRequestHandler(Na,async()=>{let e=Ui().map(n=>({uri:`resource://zerowork/tutorials/${n.id}`,name:`ZeroWork Video Tutorial: ${n.title}`,mimeType:"text/plain",description:`Official video masterclass transcript for: ${n.title}`}));return{resources:[{uri:"resource://zerowork/general",name:"ZeroWork General Knowledge",mimeType:"text/plain",description:"General concepts about ZeroWork RPA, TaskBots, and Architecture"},{uri:"resource://zerowork/webhooks",name:"ZeroWork Webhooks Guide",mimeType:"text/plain",description:"How to trigger ZeroWork bots and pass dynamic data via webhooks"},{uri:"resource://zerowork/variables",name:"ZeroWork Variables Guide",mimeType:"text/plain",description:"How variables work in ZeroWork"},{uri:"resource://zerowork/tables",name:"ZeroWork Tables Guide",mimeType:"text/plain",description:"How data tables work in ZeroWork"},{uri:"resource://zerowork/selectors",name:"ZeroWork Selectors Guide",mimeType:"text/plain",description:"How CSS and XPath selectors work in ZeroWork"},{uri:"resource://zerowork/loops",name:"ZeroWork Loops Guide",mimeType:"text/plain",description:"How loops and repeats work in ZeroWork"},{uri:"resource://zerowork/chatgpt",name:"ZeroWork ChatGPT Guide",mimeType:"text/plain",description:"How to integrate ChatGPT via Ask ChatGPT block"},{uri:"resource://zerowork/anti_bot",name:"ZeroWork Anti-Bot Guide",mimeType:"text/plain",description:"Best practices to avoid bot detection and handle dynamic states"},{uri:"resource://zerowork/troubleshooting",name:"ZeroWork Troubleshooting Guide",mimeType:"text/plain",description:"Common problems and troubleshooting steps"},{uri:"resource://zerowork/building_blocks",name:"ZeroWork Building Blocks Guide",mimeType:"text/plain",description:"Comprehensive catalog of all ZeroWork building blocks and their options"},{uri:"resource://zerowork/dynamic_inputs",name:"ZeroWork Dynamic Inputs Guide",mimeType:"text/plain",description:"How to use dynamic inputs: variable/table references, code expressions, code blocks, and spintax in ZeroWork building blocks"},{uri:"resource://zerowork/visual_insights",name:"ZeroWork Visual Insights and Troubleshooting",mimeType:"text/plain",description:"Comprehensive visual documentation and troubleshooting guide for ZeroWork covering over 140 common scenarios."},...e]}});ho.setRequestHandler(Ma,async t=>{let e=t.params.uri,n="";if(e.startsWith("resource://zerowork/tutorials/")){let o=e.replace("resource://zerowork/tutorials/",""),a=Ui().find(s=>s.id===o);if(!a)throw new Error(`Tutorial resource not found: ${e}`);n=`=== ${a.title} ===
9491
9493
 
9492
9494
  ${a.content}`}else if(e==="resource://zerowork/general")n=_e.general;else if(e==="resource://zerowork/webhooks")n=_e.webhooks;else if(e==="resource://zerowork/variables")n=_e.variables;else if(e==="resource://zerowork/tables")n=_e.tables;else if(e==="resource://zerowork/selectors")n=_e.selectors;else if(e==="resource://zerowork/loops")n=_e.loops;else if(e==="resource://zerowork/chatgpt")n=_e.chatgpt;else if(e==="resource://zerowork/anti_bot")n=_e.anti_bot;else if(e==="resource://zerowork/troubleshooting")n=_e.troubleshooting;else if(e==="resource://zerowork/building_blocks")n=_e.building_blocks;else if(e==="resource://zerowork/dynamic_inputs")n=_e.dynamic_inputs;else if(e==="resource://zerowork/visual_insights")n=_e.visual_insights;else throw new Error(`Resource not found: ${e}`);return{contents:[{uri:e,mimeType:"text/plain",text:n}]}});ho.setRequestHandler(Fa,async()=>({tools:[{name:"list_taskbots",description:"Lists all configured TaskBots and their names that are available to trigger.",inputSchema:{type:"object",properties:{}}},{name:"trigger_taskbot",description:"Triggers a specific ZeroWork TaskBot by its configured name. Does not send data.",inputSchema:{type:"object",properties:{botName:{type:"string",description:"The name of the TaskBot to trigger (must be one from list_taskbots)"}},required:["botName"]}},{name:"trigger_taskbot_with_data",description:"Triggers a specific ZeroWork TaskBot and sends dynamic JSON data to its zw_webhook_data variable.",inputSchema:{type:"object",properties:{botName:{type:"string",description:"The name of the TaskBot to trigger"},payload:{type:"object",description:"The JSON object payload to send to the bot"}},required:["botName","payload"]}},{name:"trigger_webhook_url",description:"Triggers an arbitrary ZeroWork webhook URL directly.",inputSchema:{type:"object",properties:{url:{type:"string",description:"The full ZeroWork webhook URL"},payload:{type:"object",description:"Optional JSON object payload to send to the bot"}},required:["url"]}},{name:"generate_robust_selector",description:"Analyzes an HTML snippet and target requirements to generate robust, non-brittle CSS and XPath selectors tailored for ZeroWork TaskBots.",inputSchema:{type:"object",properties:{htmlSnippet:{type:"string",description:"The raw HTML snippet containing the target element and its surrounding container hierarchy."},targetText:{type:"string",description:"Optional exact or partial visible text of the target element (e.g., 'Connect', 'Follow')."},description:{type:"string",description:"Optional description of what the element is or its context (e.g., 'The experience list container on LinkedIn', 'Submit button on a dynamic form')."}},required:["htmlSnippet"]}},{name:"get_mcp_version",description:"Returns the version of this MCP server package currently running.",inputSchema:{type:"object",properties:{}}},{name:"search_zerowork_docs",description:"Search and query the ENTIRE ZeroWork official documentation at docs.zerowork.io. Use this tool for ANY question about ZeroWork including features, building blocks, dynamic inputs, TaskBots, spintax, variables, code in inputs, agents, triggers, actions, conditions, loops, integrations, webhooks, selectors, device storage, or any how-to guides. ALWAYS use this tool before answering any ZeroWork-related questions. IMPORTANT: If the user is asking about specific automation workflows, step-by-step use cases (e.g. WhatsApp, LinkedIn, cold outreach), or advanced selector strategies, you MUST ALSO call search_zerowork_tutorials to check the expert video masterclass knowledge base!",inputSchema:{type:"object",properties:{question:{type:"string",description:"The natural language question to search the docs for"}},required:["question"]}},{name:"search_zerowork_tutorials",description:"Search and query the complete library of official ZeroWork video masterclasses, tutorial transcripts, and expert automation guides. ALWAYS call this tool when the user asks about specific automation workflows, step-by-step use cases (e.g., WhatsApp, LinkedIn, cold outreach, lead generation), advanced CSS selector walkthroughs, or dynamic loop setups, EVEN IF the user does not explicitly mention the words 'tutorials', 'videos', or 'guides'.",inputSchema:{type:"object",properties:{query:{type:"string",description:"The natural language search query or keywords to find in the video tutorials"}},required:["query"]}},{name:"get_diagram_design_rules",description:"Call this tool IMMEDIATELY whenever the user asks you to generate, draw, or build a diagram or flowchart for a ZeroWork workflow. It contains the routing instructions, HTML templates, and Mermaid rules you must follow.",inputSchema:{type:"object",properties:{}}}]}));ho.setRequestHandler(Rn,async t=>{let{name:e,arguments:n}=t.params,o=N_();try{if(e==="list_taskbots"){let r=Object.keys(o);return r.length===0?{content:[{type:"text",text:'No TaskBots are configured. Please set the ZEROWORK_BOTS environment variable in your Claude config (e.g., {"myBot": "https://hook.zerowork.io/..."}).'}]}:{content:[{type:"text",text:`Configured TaskBots:
9493
9495
  ${r.map(a=>`- ${a}`).join(`
@@ -9528,7 +9530,7 @@ ${r.slice(0,500)}${r.length>500?`
9528
9530
  ... (truncated)`:""}
9529
9531
  \`\`\`
9530
9532
 
9531
- `,i+="*Guidance*: Use the strategies above to construct your selector in ZeroWork. Test the selector in your browser console using `document.querySelectorAll('your-selector')` to verify uniqueness before adding it to your TaskBot.",{content:[{type:"text",text:i}]}}if(e==="get_mcp_version")return{content:[{type:"text",text:"nagoc-zerowork version 1.1.18"}]};if(e==="get_diagram_design_rules")return{content:[{type:"text",text:sf}]};if(e==="search_zerowork_tutorials"){let r=String(n?.query||"");if(!r)throw new Error("The 'query' parameter is required.");let a=Ui();if(a.length===0)return{content:[{type:"text",text:"No video tutorial subtitles found. Please check that subtitle files are bundled correctly."}]};let s=r.toLowerCase(),i=s.split(/\s+/).filter(h=>h.length>1),l=a.map(h=>{let d=0,p=h.title.toLowerCase(),m=h.content.toLowerCase();return p.includes(s)&&(d+=10),m.includes(s)&&(d+=5),i.forEach(w=>{p.includes(w)&&(d+=3);let y=m.match(new RegExp(w,"g"));y&&(d+=y.length)}),{tutorial:h,score:d}}).filter(h=>h.score>0).sort((h,d)=>d.score-h.score);if(l.length===0)return{content:[{type:"text",text:`No tutorial subtitles matched the query "${r}". Try searching with different keywords or use search_zerowork_docs for official written documentation.`}]};let c=l.slice(0,5),u=`### \u{1F3AC} ZeroWork Video Tutorial Search Results
9533
+ `,i+="*Guidance*: Use the strategies above to construct your selector in ZeroWork. Test the selector in your browser console using `document.querySelectorAll('your-selector')` to verify uniqueness before adding it to your TaskBot.",{content:[{type:"text",text:i}]}}if(e==="get_mcp_version")return{content:[{type:"text",text:"nagoc-zerowork version 1.1.20"}]};if(e==="get_diagram_design_rules")return{content:[{type:"text",text:sf}]};if(e==="search_zerowork_tutorials"){let r=String(n?.query||"");if(!r)throw new Error("The 'query' parameter is required.");let a=Ui();if(a.length===0)return{content:[{type:"text",text:"No video tutorial subtitles found. Please check that subtitle files are bundled correctly."}]};let s=r.toLowerCase(),i=s.split(/\s+/).filter(h=>h.length>1),l=a.map(h=>{let d=0,p=h.title.toLowerCase(),m=h.content.toLowerCase();return p.includes(s)&&(d+=10),m.includes(s)&&(d+=5),i.forEach(w=>{p.includes(w)&&(d+=3);let y=m.match(new RegExp(w,"g"));y&&(d+=y.length)}),{tutorial:h,score:d}}).filter(h=>h.score>0).sort((h,d)=>d.score-h.score);if(l.length===0)return{content:[{type:"text",text:`No tutorial subtitles matched the query "${r}". Try searching with different keywords or use search_zerowork_docs for official written documentation.`}]};let c=l.slice(0,5),u=`### \u{1F3AC} ZeroWork Video Tutorial Search Results
9532
9534
 
9533
9535
  *Crawled from official video masterclasses and automation guides*
9534
9536
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nagoc-zerowork",
3
- "version": "1.1.18",
3
+ "version": "1.1.20",
4
4
  "description": "An MCP Server for ZeroWork.io — trigger TaskBots, send dynamic data via webhooks, and get full ZeroWork documentation",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",