PageSourceSearch

https://www.noclick.com/assets/agentScaffold-CnEe0CfC.js

js noclick.com collected 2026-10-04 02:37:04 UTC 3,905 bytes, 1 lines download raw bytes

1import{c as $,s as P,a as C}from"./applyNodeUpdate-bXowpCYE.js";import{s as M}from"./agentCredentialModel-1Zy3QTX6.js";const y="agent",O=e=>`e_${e}_${y}`,S="top",k="bottom",H="left";function T(e){return e.replace(/^(automation|trigger)-/,"")}function x(e){if(e.name)return e.name;const t=e.integrations.map(n=>n.label);return t.length===1?`${e.harnessLabel} + ${t[0]}`:t.length===2?`${e.harnessLabel} + ${t[0]} and ${t[1]}`:t.length>2?`${e.harnessLabel} agent (${t.length} tools)`:`${e.harnessLabel} agent`}function D(e){const t=(e.triggers??[]).map(r=>r.label),n=e.integrations.map(r=>r.label),s=n.length?n.join(", "):"the connected apps",c=t.length?` and set a sensible trigger event on the ${t.join(", ")} trigger ${t.length>1?"nodes":"node"}`:"";return`I just scaffolded this ${e.harnessLabel} agent from a template — the nodes are wired but their operations aren't picked yet. Keep it quick: ask me at most a question or two to get what I'm going for, then mainly focus on getting the accounts connected for each node and hooking everything up. Pick sensible ${s} operations for me${c} rather than making me choose them all, and once it's wired up tell me what you set so I can change anything.`}function W(e){const t=e.triggers??[],n=t.length>0,s=e.integrations.length,c=160,r=45,p=100,u=40,w=140,d=150,L=90,N=160,g=s>1?(s-1)/2*c:0,f=n?Math.max(320,N+p,N+r+g):Math.max(300,r+g),a=u+w/2-(t.length-1)*d/2-L/2,E=n?a+(t.length-1)*d+L:0,I=Math.max(u+w+90,E+70),l=$(y,"agent",{x:f-p,y:u},{label:e.harnessLabel,model:e.harnessModel,message:e.message,...M(e.harnessModel)}),m=[],h=[],_=[];return t.forEach((o,b)=>{const i=`trigger-${T(o.type)}-${b+1}`;m.push($(i,o.type,{x:20,y:a+b*d},{label:o.label},o.operation?{operation:o.operation}:{})),_.push({id:O(i),source:i,target:y,targetHandle:H})}),e.integrations.forEach((o,b)=>{var A;const i=`${T(o.type)}-${b+1}`,G=f+(b-(s-1)/2)*c;h.push($(i,o.type,{x:G-r,y:I},{label:o.label,...(A=o.toolOperations)!=null&&A.length?{agent_tool_operations:o.toolOperations}:{}})),_.push({id:O(i),source:i,target:y,sourceHandle:S,targetHandle:k})}),{name:x(e),workflowData:{nodes:[l,...m,...h].map(C),edges:_.map(P)},builderPrompt:D(e)}}function Y(e){const t="mcp-server",n=e.integrations.length,s=160,c=45,r=45,p=40,u=90,w=n>1?(n-1)/2*s:0,d=Math.max(300,c+w),L=p+u+110,N=$(t,"mcp-server",{x:d-r,y:p},{label:"MCP Server"}),g=[],f=[];e.integrations.forEach((l,m)=>{var o;const h=`${T(l.type)}-${m+1}`,_=d+(m-(n-1)/2)*s;g.push($(h,l.type,{x:_-c,y:L},{label:l.label,...(o=l.toolOperations)!=null&&o.length?{agent_tool_operations:l.toolOperations}:{}})),f.push({id:`e_${h}_${t}`,source:h,target:t,sourceHandle:S,targetHandle:k})});const a=e.integrations.map(l=>l.label),E=e.name??(a.length===1?`${a[0]} MCP server`:a.length===2?`${a[0]} + ${a[1]} MCP server`:a.length>2?`MCP server (${a.length} apps)`:"MCP server"),I="I just scaffolded an MCP server from a template — the apps are wired in but their operations aren't selected yet. Keep it quick: ask me at most a question or two about what I want to expose, then "+(a.length?`turn the most useful ${a.join(", ")} operations into tools and get the accounts connected. `:"help me wire in apps, expose their most useful operations as tools, and get the accounts connected. ")+"Pick sensible defaults rather than making me choose everything, and once it's set tell me what you did so I can change anything.";return{name:E,workflowData:{nodes:[N,...g].map(C),edges:f.map(P)},builderPrompt:I}}const v="noclick_scaffold_workflow_data",j="noclick_pending_scaffold";function q(e){typeof window>"u"||sessionStorage.setItem(v,JSON.stringify(e))}function K(){var t,n;if(typeof window>"u")return null;const e=sessionStorage.getItem(v);if(!e)return null;try{const s=JSON.parse(e);return(n=(t=s==null?void 0:s.workflowData)==null?void 0:t.nodes)!=null&&n.length?s:null}catch{return null}}export{j as P,v as S,Y as a,W as b,K as r,q as s};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.