Lines 22-80javascript
22Message: ${this.message}
23 `.trim()}},Kr=class extends I{constructor(t,o,n,s,i,a){super(t,"SUMMARIZATION_ERROR",500,a);this.conversationId=o;this.messageCount=n;this.failureReason=s;this.summaryAttempt=i;this.name="SummarizationError"}conversationId;messageCount;failureReason;summaryAttempt;isRetryable(){return this.failureReason==="provider_error"||this.failureReason==="insufficient_tokens"}getSuggestedRecovery(){switch(this.failureReason){case"provider_error":return"Retry the summarization request or switch to a different summarizer model";case"invalid_response":return"Review the summarizer prompt or use a differe ...
26Conversation ID: ${this.conversationId}
27Messages Attempted: ${this.messageCount}
28Failure Reason: ${this.failureReason}
29Retryable: ${this.isRetryable()?"Yes":"No"}
30Recovery Action: ${this.getSuggestedRecovery()}
32Message: ${this.message}`;return this.summaryAttempt?t+`
35${this.summaryAttempt.substring(0,500)}${this.summaryAttempt.length>500?"...":""}`:t.trim()}},da=class extends I{constructor(t
36Context Window Configuration Error
37===================================
38Field: ${this.configField}
39Provided Value: ${JSON.stringify(this.providedValue)}
40Constraint: ${this.constraint}
42Message: ${this.message}
43 `.trim()}},ua=class extends I{constructor(t,o,n){super(t,"CONVERSATION_NOT_FOUND",404,n);this.conversationId=o;this.name="ConversationNotFoundError"}conversationId}});var gt,Wt,Yw,Ca=h(()=>{"use strict";c();gt={name:3,displayName:2.5,description:2,category:1.5,parameterNames:1,parameterDescriptions:.5},Wt=class{documents=[];avgDocLength=0;idf=new Map;totalDocs=0;docFrequencies=new Map;k1=1.2;b=.75;index(e){this.documents=[],this.docFrequencies.clear(),this.idf.clear();for(let t of e){let o=this.createDocument(t);this.documents.push(o);let n=new Set(o.tokens);for(let s of n)this.docFrequenc ...
44Use this to discover tools before using them.
45Examples: "file operations", "web scraping", "run command", "http request"
47Returns a list of matching tools with their names, descriptions, and parameters.
48After discovering tools, you can call them directly by name.`,parameters:{type:"object",properties:{query:{type:"string",description:'Natural language search query (e.g., "read files", "web scraping", "execute shell commands")'},category:{type:"string",description:"Optional: filter by category",enum:["filesystem"
49`)}var Zw,Pa=h(()=>{"use strict";c();Zw={filesystem:"File operations (read, write, delete, list, search files)",network:"HTTP requests and web scraping (GET, POST, fetch pages, extract data)",execution:"Run shell commands and manage processes",system:"System information, environment variables, disk usage",meta:"Tool discovery and management"}});var Ut=h(()=>{"use strict";c();Ca();Sa();ka();Pa()});var eT,ce,Bt=h(()=>{"use strict";c();eT={enabled:!1,alwaysLoadedTools:[],alwaysLoadedCategories:[],searchResultLimit:5,cacheDiscoveredTools:!0},ce={enabled:!0,autoExecute:!0,maxToolRounds:5,toolChoice ...
50`)}catch(e){console.warn(`[Toolpack Warning] Failed to initialize log file "${Ce}": ${e.message}`),Tt=!1}}function tt(r){return Tt?es[r]<=es[zt]:!1}function Ht(r,e){if(!tt(r))return;let o=`[${new
51`),ts&&(r==="error"?console.error:r==="warn"?console.warn:console.log)(o)}function pe(r){Ht("error",r)}function j(r){Ht("warn",r)}
52`),a=i.length,l=Math.min(t,a),p=Math.min(o,a),d=i.slice(l-1,p).map((g,b)=>`${l+b}: ${g}`).join(`
53`);return`Lines ${l}-${p} of ${a} total:
54${d}`}var lo,ys=h(()=>{"use strict";c();hc();lo={name:mc,displayName:dc,description:uc,parameters:gc,category:fc,execute:ET}});var yc,bc,wc,Tc,xc,vc=h(()=>{"use strict";c();yc="fs.search",bc="Search",wc="Search for text in files within a directory. Returns matching lines with file paths and line numbers.",Tc="filesystem",xc={type:"object",properties:{path:{type:"string",description:"Directory path to search in"},query:{type:"string",description:"Text or pattern to search for"},recursive:{type:"boolean",description:"Search recursively in subdirectories (default: true)",default:!0},max_results:{ ...
55`);for(let i=0;i<s.length&&t.length<o;i++){let a=s[i];(typeof e=="string"?a.includes(e):e.test(a))&&t.push({file:r,line:i+
56(results capped at ${n})`:"";return JSON.stringify(p,null,2)+m}var co,bs=h(()=>{"use strict";c();vc();k();co={name:yc,displayName:bc,description:wc,parameters:xc,category:Tc,execute:MT}});var kc,Pc,Rc,_c,$c,Ec=h(()=>{"use strict";c();kc="fs.replace_in_file",Pc="Replace In File",Rc="Find and replace text in a file. Returns the number of replacements made.",_c="filesystem",$c={type:"object",properties:{path:{type:"string",description:"Absolute or relative file path"},search:{type:"string",description:"Text to search for"},replace:{type:"string",description:"Text to replace with"}},required:["pat ...
LowWeak Crypto
Package source references weak cryptographic algorithms.
dist/index.jsView on unpkg · L42 57`)}var mo,Ts=h(()=>{"use strict";c();Ic();mo={name:Dc,displayName:Mc,description:Ac,parameters:Nc,category:Oc,execute:OT}});var Lc,Fc,qc,Wc,Uc,Gc=h(()=>{"use strict";c();Lc="fs.glob",Fc="Glob Pattern Match",qc='Find files matching glob patterns (e.g., "**/*.ts", "src/**/*.test.js")'
58STDOUT:
HighCommand Output Exfiltration
Source combines command execution, command-output handling, and outbound requests; review data flow before blocking.
dist/index.jsView on unpkg · L50 HighChild Process
Package source references child process execution.
dist/index.jsView on unpkg · L56 61${i}`}}var yo,Ps=h(()=>{"use strict";c();yp();k();yo={name:dp,displayName:up,description:fp,parameters:hp,category:gp,execute:QT,confirmation:{level:"high",reason:"This will execute a shell command on the host system.",showArgs:["command"]}}});var bp,wp,Tp,xp,vp,Cp=h(()=>{"use strict";c();bp="exec.run_shell",wp="Run Shell",Tp="Execute a command through the system shell. Supports pipes, redirects, environment variable expansion, and other shell features.",xp="execution",vp={type:"object",properties:{command:{type:"string",description:"The shell command to execute (supports pipes, redirects, etc ...
65${i}`}}var bo,Rs=h(()=>{"use strict";c();Cp();k();bo={name:bp,displayName:wp,description:Tp,parameters:vp,category:xp,execute:ZT,confirmation:{level:"high",reason:"This will execute a shell command with explicit shell context.",showArgs:["command"]}}});function Sp(r,e
66`),a=i.slice(-t).join(`
67`).trim(),p=o.stderr.split(`
68`).filter(m=>m.trim()).slice(-3).join(`
69`).trim();return JSON.stringify({id:e,alive:n,exitCode:s,lastLines:a||"(no output yet)",lastStderr:p||"",totalStdoutLines:i.length})}var vo,Ds=h(()=>{"use strict";c();Dt();Qp();vo={name:zp,displayName:Hp,description:Kp,parameters:Vp,category:Jp,execute:ax}});var Xp,Yp,Zp,em,tm,om=h(()=>{"use strict";c();Xp="exec.kill",Yp="Kill",Zp="Kill a background process started with exec.run_background.",em="execution",tm={type:"object",properties:{process_id:{type:"string",description:"The process ID returned by exec.run_background"}},required:["process_id"]}});async function lx(r){let e=r.process_id;if(! ...
70`);if(i.length<2)return s;let a=i[1].split(/\s+/);return JSON.stringify({path:t,filesystem:a[0]||"unknown",size:a[1]
73... (truncated, total ${n.length} characters)`:`${s}
75${n}`}var Ym,Eo,Us=h(()=>{"use strict";c();Xm();k();Ym=1e5;Eo={name:Hm,displayName:Km,description:Jm,parameters:Qm,category:Vm,execute:gx}});var Zm,ed,td,od,nd,rd=h(()=>{"use strict";c();Zm="http.post",ed="POST",td="Make an HTTP POST request to a URL with an optional body and return the response.",od="network",nd={type:"object",properties:{url:{type:"string",description:"The URL to request"},body:{type:"string",description:"Request body (JSON string or plain text)"},headers:{type:"object",description:"Optional HTTP headers as key-value pairs"}},required:["url"]}});async function hx(r){let e=r. ...
78... (truncated, total ${s.length} characters)`:`${i}
79${s}`}var sd,Do,Gs=h(()=>{"use strict";c();rd();k();sd=1e5;Do={name:Zm,displayName:ed,description:td,parameters:nd,category:od,execute:hx,confirmation:{level:"high",reason:"This will send an HTTP POST request with arbitrary payload.",showArgs:["url","body"]}}});var id,ad,ld,cd,pd,md=h(()=>
Long lines were clipped for display.