constCODER_SYSTEM_PROMPT=`You are a professional coding assistant. You help users with programming questions, code review, debugging, and software design.
if(!username||!password){
console.warn(
'Bootstrap skipped: set BOOTSTRAP_ADMIN_USERNAME and BOOTSTRAP_ADMIN_PASSWORD',
'Bootstrap skipped: invalid BOOTSTRAP_ADMIN_USERNAME or BOOTSTRAP_ADMIN_PASSWORD',
)
return
}
constTOOLS_SEED=[
{id:'tool_fetch_html',name:'fetch_html',slug:'fetch_html',description:'Fetch a URL and return the HTML content',type:'fetch',config:{parseMode:'raw',timeout:30000,allowedDomains:['*'],blockedDomains:[],maxResponseSize:102400,defaultMethod:'GET',defaultHeaders:{}},enabled:1,needsApproval:0,adminOnly:0,sortOrder:10},
{id:'tool_fetch_md',name:'fetch_md',slug:'fetch_md',description:'Fetch a URL and return the content as markdown',type:'fetch',config:{parseMode:'markdown',timeout:30000,allowedDomains:['*'],blockedDomains:[],maxResponseSize:102400,defaultMethod:'GET',defaultHeaders:{}},enabled:1,needsApproval:0,adminOnly:0,sortOrder:11},
{id:'tool_fetch_json',name:'fetch_json',slug:'fetch_json',description:'Fetch a URL and return the JSON content',type:'fetch',config:{parseMode:'json',timeout:30000,allowedDomains:['*'],blockedDomains:[],maxResponseSize:102400,defaultMethod:'GET',defaultHeaders:{}},enabled:1,needsApproval:0,adminOnly:0,sortOrder:12},
{id:'tool_calculator',name:'calculator',slug:'calculator',description:'Evaluate a mathematical expression',type:'calculator',config:{},enabled:1,needsApproval:0,adminOnly:0,sortOrder:20},
{id:'tool_datetime',name:'datetime',slug:'datetime',description:'Get current date and time',type:'datetime',config:{},enabled:1,needsApproval:0,adminOnly:0,sortOrder:30},
{id:'tool_uuid',name:'uuid',slug:'uuid',description:'Generate a UUID',type:'uuid',config:{},enabled:1,needsApproval:0,adminOnly:0,sortOrder:40},
{id:'tool_base64',name:'base64',slug:'base64',description:'Encode or decode base64 strings',type:'base64',config:{},enabled:1,needsApproval:0,adminOnly:0,sortOrder:50},
{id:'tool_json_formatter',name:'json-formatter',slug:'json-formatter',description:'Format and validate JSON strings',type:'json-formatter',config:{},enabled:1,needsApproval:0,adminOnly:0,sortOrder:60},
{id:'tool_regex_tester',name:'regex-tester',slug:'regex-tester',description:'Test a regular expression against a string',type:'regex-tester',config:{},enabled:1,needsApproval:0,adminOnly:0,sortOrder:70},
{id:'tool_user_info',name:'user-info',slug:'user-info',description:'Get current user information',type:'user-info',config:{},enabled:1,needsApproval:0,adminOnly:0,sortOrder:80},
{id:'tool_search',name:'search',slug:'search',description:'Search the web for information',type:'search',config:{maxResults:5},enabled:1,needsApproval:0,adminOnly:0,sortOrder:90},
{id:'tool_hash',name:'hash',slug:'hash',description:'Compute hash (md5/sha1/sha256/sha512) or compare hashes',type:'hash',config:{defaultAlgorithm:'sha256',uppercase:false},enabled:1,needsApproval:0,adminOnly:0,sortOrder:100},
{id:'tool_color',name:'color',slug:'color',description:'Color conversion (hex/rgb/hsl), random color, mix colors, WCAG contrast',type:'color',config:{defaultFormat:'hex'},enabled:1,needsApproval:0,adminOnly:0,sortOrder:110},
{id:'tool_dice',name:'dice',slug:'dice',description:'Roll dice, flip coin, pick from list, or play rock-paper-scissors',type:'dice',config:{defaultSides:6},enabled:1,needsApproval:0,adminOnly:0,sortOrder:120},
{id:'tool_magic_8ball',name:'magic-8ball',slug:'magic-8ball',description:'Magic 8-Ball fortune telling and daily fortune',type:'magic-8ball',config:{language:'zh'},enabled:1,needsApproval:0,adminOnly:0,sortOrder:130},
{id:'tool_guess_who',name:'guess-who',slug:'guess-who',description:'Guess who game - AI guesses your character or you guess AI character',type:'guess-who',config:{language:'zh',maxQuestions:20,difficulty:'medium'},enabled:1,needsApproval:0,adminOnly:0,sortOrder:140},