adam-agent-server 1.2.2 → 1.3.0

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 (101) hide show
  1. package/dist/App-3OBJDI2C.js +9 -0
  2. package/dist/adam-tools-4LZYFB6J.js +1 -0
  3. package/dist/{approval-handler-JYIS2PKQ.js → approval-handler-RIJO3OBO.js} +1 -1
  4. package/dist/audit-manager-6FFPXID3.js +1 -0
  5. package/dist/bree-engine-2NOTIBAZ.js +1 -0
  6. package/dist/{channels-WZOYE4O4.js → channels-LUJ7GTSP.js} +1 -1
  7. package/dist/channels-TSZLEU3L.js +1 -0
  8. package/dist/{chunk-PMHNW5IL.js → chunk-4LSIHSCO.js} +1 -1
  9. package/dist/{chunk-KVSO3KGZ.js → chunk-4MJF77RD.js} +54 -5
  10. package/dist/{chunk-BIIP363C.js → chunk-4NW2DNDZ.js} +1 -1
  11. package/dist/{chunk-OEKM2W3K.js → chunk-6NUHSHS5.js} +1 -1
  12. package/dist/{chunk-IHP7JV6J.js → chunk-72VLUJ2S.js} +1 -1
  13. package/dist/chunk-7CJGPCSJ.js +49 -0
  14. package/dist/{chunk-KLQOILIJ.js → chunk-7IXLL673.js} +1 -1
  15. package/dist/{chunk-SBX3HMDA.js → chunk-7K4AQBDD.js} +1 -1
  16. package/dist/{chunk-GMCIKDTC.js → chunk-AKPLOO2V.js} +1 -1
  17. package/dist/{chunk-AJVN3KPM.js → chunk-AZBNUSM2.js} +1 -1
  18. package/dist/{chunk-SWPXG2CY.js → chunk-CLHSPXZ6.js} +1 -1
  19. package/dist/{chunk-KKLZIXBN.js → chunk-DBUEHITK.js} +2 -2
  20. package/dist/chunk-GSMC3VUM.js +1 -0
  21. package/dist/{chunk-EJVUUIAV.js → chunk-HFN7Y3IM.js} +1 -1
  22. package/dist/{chunk-6DXNXLYG.js → chunk-IKUBP3SY.js} +1 -1
  23. package/dist/{chunk-4TCP2AT7.js → chunk-IZGTTLTG.js} +1 -1
  24. package/dist/chunk-JZNBFZ7W.js +7 -0
  25. package/dist/{chunk-6YURWVQG.js → chunk-NDP6LWXX.js} +1 -1
  26. package/dist/{chunk-CDVIT7L5.js → chunk-NLD7WK3R.js} +1 -1
  27. package/dist/{chunk-OFOVSC72.js → chunk-NUTUI5KM.js} +1 -1
  28. package/dist/{chunk-B4WHT7DX.js → chunk-OTH4M5L3.js} +1 -1
  29. package/dist/{chunk-GUQAIWCQ.js → chunk-P6KWAGAY.js} +1 -1
  30. package/dist/chunk-PVYEGQEG.js +83 -0
  31. package/dist/{chunk-Z5ET7WW2.js → chunk-T33BLZV2.js} +1 -1
  32. package/dist/{chunk-2HN2TSP6.js → chunk-TCHBOWQ5.js} +1 -1
  33. package/dist/{chunk-RPTHFQX7.js → chunk-TKDT7EQO.js} +1 -1
  34. package/dist/{chunk-ZM6YED5F.js → chunk-UQJZU3R5.js} +1 -1
  35. package/dist/{chunk-7LBDLAUQ.js → chunk-WKS7QVIX.js} +1 -1
  36. package/dist/{chunk-EGS6U3V5.js → chunk-WTRM5VO7.js} +2 -2
  37. package/dist/chunk-XTHP5JMO.js +10 -0
  38. package/dist/chunk-YHVFZB6Q.js +1 -0
  39. package/dist/{chunk-QN6BEJF5.js → chunk-YPOTHL7X.js} +1 -1
  40. package/dist/chunk-ZKMDHQJY.js +104 -0
  41. package/dist/{chunk-AR2IZMM2.js → chunk-ZQYKT5UY.js} +1 -1
  42. package/dist/cli.js +2 -2
  43. package/dist/{config-EI3SCA4W.js → config-HR4MBTIS.js} +1 -1
  44. package/dist/config-XMQS2NPT.js +1 -0
  45. package/dist/{db-4NY7ZOS2.js → db-6KUGCGVR.js} +1 -1
  46. package/dist/{delivery-log-SC2ULFCK.js → delivery-log-7DJJTPXL.js} +1 -1
  47. package/dist/engine-HJUE6I4I.js +1 -0
  48. package/dist/{evolution-audit-KUBXFUHI.js → evolution-audit-I2ITWAEC.js} +1 -1
  49. package/dist/{external-api-A4JXX4ZE.js → external-api-7XV2PXPC.js} +1 -1
  50. package/dist/index.js +12 -11
  51. package/dist/{learner-B6XVQKBF.js → learner-CBPQZ3HL.js} +1 -1
  52. package/dist/{memories-FQCRKMK6.js → memories-HBBW44MG.js} +1 -1
  53. package/dist/{memory-extractor-FUOJ5D77.js → memory-extractor-XO2HJ22Y.js} +2 -2
  54. package/dist/memory-service-HIFTKEW2.js +1 -0
  55. package/dist/outbound-gateway-GGFMU5JW.js +1 -0
  56. package/dist/role-presets-W452Y3RV.js +1 -0
  57. package/dist/{roles-3UTFKSHI.js → roles-NYGWZMQI.js} +1 -1
  58. package/dist/{runtime-B2DP3JNB.js → runtime-VDBZZ4KG.js} +1 -1
  59. package/dist/{session-manager-Z6MIYRD3.js → session-manager-JICVE4CO.js} +1 -1
  60. package/dist/{task-templates-PSP7GOJJ.js → task-templates-NC7XIZIC.js} +1 -1
  61. package/dist/workflow-executor-QN4KP7B4.js +1 -0
  62. package/package.json +1 -1
  63. package/web/dist/assets/{ChannelDetail-eWtIGhAd.js → ChannelDetail-DX4QnE8j.js} +1 -1
  64. package/web/dist/assets/{Channels-2veauYsm.js → Channels-EXkNOQpB.js} +1 -1
  65. package/web/dist/assets/{Chat-Bha4vXwT.js → Chat-Da-mCR0c.js} +1 -1
  66. package/web/dist/assets/{Dashboard-cDHpOWnY.js → Dashboard-Bq6sEDdP.js} +1 -1
  67. package/web/dist/assets/{EnvVarEditor-CaCpNT3y.js → EnvVarEditor-CNxXpVbD.js} +1 -1
  68. package/web/dist/assets/{Evolution-Ao-gdHbS.js → Evolution-DPdmbooj.js} +1 -1
  69. package/web/dist/assets/{GoalDetail-CX2i9A5a.js → GoalDetail-BamCfVzS.js} +1 -1
  70. package/web/dist/assets/{Goals-DdM0tFus.js → Goals-CHPEg0RK.js} +1 -1
  71. package/web/dist/assets/{Logs-DJhpDtCA.js → Logs-BHkBvH0T.js} +1 -1
  72. package/web/dist/assets/{Memories-CYN99g2T.js → Memories-BY2pJhVd.js} +1 -1
  73. package/web/dist/assets/{Plugins-gcMpBdyq.js → Plugins-C5xLM0BU.js} +1 -1
  74. package/web/dist/assets/{RoleDetail-s7u-Shk3.js → RoleDetail-Dnp-W14x.js} +1 -1
  75. package/web/dist/assets/{Roles-CCy1H7PY.js → Roles-BVOVoHvc.js} +1 -1
  76. package/web/dist/assets/Settings-eBHvn6s_.js +1 -0
  77. package/web/dist/assets/{Strategies-CO4LwZjS.js → Strategies-BbFbLKBJ.js} +1 -1
  78. package/web/dist/assets/{Switch-CTAIxUd_.js → Switch-Q-inggPs.js} +1 -1
  79. package/web/dist/assets/{TaskDetail-DEg_oUwx.js → TaskDetail-BEjZ1gco.js} +1 -1
  80. package/web/dist/assets/Work-CF2iLs8i.js +1 -0
  81. package/web/dist/assets/{index-rvaixveh.js → index-CaHdOfAc.js} +2 -2
  82. package/web/dist/assets/index-D0SvKqKc.css +2 -0
  83. package/web/dist/index.html +2 -2
  84. package/dist/App-RIYRYLKD.js +0 -9
  85. package/dist/adam-tools-V22LRDCP.js +0 -1
  86. package/dist/audit-manager-QDFDBK4E.js +0 -1
  87. package/dist/bree-engine-EKZFCS4Q.js +0 -1
  88. package/dist/channels-WMCY4QC3.js +0 -1
  89. package/dist/chunk-6HD6NYIB.js +0 -1
  90. package/dist/chunk-ITUBFUJQ.js +0 -67
  91. package/dist/chunk-IZWULGUS.js +0 -83
  92. package/dist/chunk-JNRCXAW3.js +0 -49
  93. package/dist/chunk-W3554FQ7.js +0 -7
  94. package/dist/config-7HYICF5P.js +0 -1
  95. package/dist/engine-5RJ7NJSM.js +0 -1
  96. package/dist/memory-service-ANR67OPY.js +0 -1
  97. package/dist/outbound-gateway-6FQRWYFF.js +0 -1
  98. package/dist/role-presets-LRP6P5O2.js +0 -1
  99. package/web/dist/assets/Settings-JbgBxBeo.js +0 -1
  100. package/web/dist/assets/Work-BpKK_uXA.js +0 -1
  101. package/web/dist/assets/index-CaocwyO8.css +0 -2
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{a as W,b as h,c as z,e as V}from"./chunk-VRP4LTHY.js";import{a as B,b as J,d as G}from"./chunk-PMHNW5IL.js";import{a as q}from"./chunk-Z5ET7WW2.js";import"./chunk-6DXNXLYG.js";import{b as _}from"./chunk-7IFLU3CY.js";import"./chunk-6HD6NYIB.js";import{c as M,e as K,g as de}from"./chunk-7LBDLAUQ.js";import{b as H,c as j,d as ce}from"./chunk-KVSO3KGZ.js";import"./chunk-WBAPIPST.js";import"./chunk-INNDBLZE.js";import"./chunk-FCV2DPZQ.js";import{Command as we}from"commander";import{fork as ue}from"child_process";import{readFileSync as L,writeFileSync as me,existsSync as v,unlinkSync as $,mkdirSync as pe,openSync as ge}from"fs";import{join as D}from"path";import{homedir as fe}from"os";var P=D(fe(),".adam"),S=D(P,"adam.pid"),k=D(P,"adam.port"),b=D(P,"server.log");function he(){v(P)||pe(P,{recursive:!0})}function C(){if(!v(S))return null;let e=parseInt(L(S,"utf-8").trim(),10);return isNaN(e)?null:e}function ve(){if(!v(k))return null;let e=parseInt(L(k,"utf-8").trim(),10);return isNaN(e)?null:e}function A(e){try{return process.kill(e,0),!0}catch{return!1}}async function N(){he();let e=C();if(e&&A(e))throw new Error(`Server already running (PID ${e})`);v(S)&&$(S),v(k)&&$(k);let o=ge(b,"a"),t=D(B,"dist/index.js"),n=ue(t,[],{detached:!0,stdio:["ignore",o,o,"ipc"]}),l=await new Promise((i,c)=>{let g=setTimeout(()=>{n.kill(),c(new Error(`Server start timeout. Check logs: ${b}`))},1e4);n.on("message",a=>{if(a&&typeof a=="object"&&a.type==="ready"){clearTimeout(g);let s=a.port;s?i(s):c(new Error("Ready signal received but missing port"))}}),n.on("exit",a=>{clearTimeout(g);let s=v(b)?L(b,"utf-8").split(`
2
+ import{a as W,b as h,c as z,e as V}from"./chunk-VRP4LTHY.js";import{a as B,b as J,d as G}from"./chunk-4LSIHSCO.js";import{a as q}from"./chunk-T33BLZV2.js";import"./chunk-IKUBP3SY.js";import{b as _}from"./chunk-7IFLU3CY.js";import"./chunk-GSMC3VUM.js";import{c as M,e as K,g as de}from"./chunk-WKS7QVIX.js";import{b as H,c as j,d as ce}from"./chunk-4MJF77RD.js";import"./chunk-WBAPIPST.js";import"./chunk-INNDBLZE.js";import"./chunk-FCV2DPZQ.js";import{Command as we}from"commander";import{fork as ue}from"child_process";import{readFileSync as L,writeFileSync as me,existsSync as v,unlinkSync as $,mkdirSync as pe,openSync as ge}from"fs";import{join as D}from"path";import{homedir as fe}from"os";var P=D(fe(),".adam"),S=D(P,"adam.pid"),k=D(P,"adam.port"),b=D(P,"server.log");function he(){v(P)||pe(P,{recursive:!0})}function C(){if(!v(S))return null;let e=parseInt(L(S,"utf-8").trim(),10);return isNaN(e)?null:e}function ve(){if(!v(k))return null;let e=parseInt(L(k,"utf-8").trim(),10);return isNaN(e)?null:e}function A(e){try{return process.kill(e,0),!0}catch{return!1}}async function N(){he();let e=C();if(e&&A(e))throw new Error(`Server already running (PID ${e})`);v(S)&&$(S),v(k)&&$(k);let o=ge(b,"a"),t=D(B,"dist/index.js"),n=ue(t,[],{detached:!0,stdio:["ignore",o,o,"ipc"]}),l=await new Promise((i,c)=>{let g=setTimeout(()=>{n.kill(),c(new Error(`Server start timeout. Check logs: ${b}`))},1e4);n.on("message",a=>{if(a&&typeof a=="object"&&a.type==="ready"){clearTimeout(g);let s=a.port;s?i(s):c(new Error("Ready signal received but missing port"))}}),n.on("exit",a=>{clearTimeout(g);let s=v(b)?L(b,"utf-8").split(`
3
3
  `).slice(-10).join(`
4
4
  `):"";c(new Error(`Server exited with code ${a}.
5
5
  ${s?`Last log lines:
@@ -14,4 +14,4 @@ Task cancelled.`)),process.exit(130)};process.on("SIGINT",l);let i=new V(n);awai
14
14
  `));let i={Anthropic:[["anthropic.apiKey",t["anthropic.apiKey"]],["anthropic.baseUrl",t["anthropic.baseUrl"]],["anthropic.model",t["anthropic.model"]],["anthropic.defaultOpusModel",t["anthropic.defaultOpusModel"]],["anthropic.defaultSonnetModel",t["anthropic.defaultSonnetModel"]],["anthropic.defaultHaikuModel",t["anthropic.defaultHaikuModel"]],["anthropic.smallFastModel",t["anthropic.smallFastModel"]]],Defaults:[["defaults.model",t["defaults.model"]],["defaults.effort",t["defaults.effort"]],["defaults.maxTurns",t["defaults.maxTurns"]],["defaults.maxBudgetUsd",t["defaults.maxBudgetUsd"]],["defaults.timeout",t["defaults.timeout"]]],Server:[["server.port",t["server.port"]],["server.host",t["server.host"]],["server.apiKey",t["server.apiKey"]],["server.timezone",t["server.timezone"]]],Logging:[["logging.level",t["logging.level"]]],Evolution:[["roles.evolution.triggerEvery",t["roles.evolution.triggerEvery"]],["roles.evolution.reflectionThreshold",t["roles.evolution.reflectionThreshold"]]],Chat:[["chat.sessionTimeoutMinutes",t["chat.sessionTimeoutMinutes"]],["chat.maxSessionTurns",t["chat.maxSessionTurns"]],["chat.autoTitle",t["chat.autoTitle"]],["chat.archiveExtractMemory",t["chat.archiveExtractMemory"]]]},c={"anthropic.apiKey":"API Key","anthropic.baseUrl":"Base URL","anthropic.model":"Model","anthropic.defaultOpusModel":"Default Opus","anthropic.defaultSonnetModel":"Default Sonnet","anthropic.defaultHaikuModel":"Default Haiku","anthropic.smallFastModel":"Small Fast","defaults.model":"Default Model","defaults.effort":"Effort","defaults.maxTurns":"Max Turns","defaults.maxBudgetUsd":"Max Budget (USD)","defaults.timeout":"Timeout (sec)","server.port":"Port","server.host":"Host","server.apiKey":"API Key","server.timezone":"Timezone","logging.level":"Log Level","roles.evolution.triggerEvery":"Evolution Trigger Every","chat.sessionTimeoutMinutes":"Session Timeout (min)","chat.maxSessionTurns":"Max Session Turns","chat.autoTitle":"Auto Title","chat.archiveExtractMemory":"Archive Extract Memory","roles.evolution.reflectionThreshold":"Reflection Threshold"};for(let[g,a]of Object.entries(i)){let s=a.filter(([,r])=>r!=null&&r!=="");if(s.length!==0){console.log(O.cyan(`${g}:`));for(let[r,m]of s){let f=c[r]??r,R=r.includes("apiKey")||r.includes("token")||r.includes("secret")?se(String(m)):String(m);console.log(` ${f}: ${R}`)}console.log("")}}if(n){console.log(O.bold(`.env File Values:
15
15
  `));let g=["ANTHROPIC_API_KEY","ANTHROPIC_BASE_URL","ANTHROPIC_MODEL","ANTHROPIC_DEFAULT_OPUS_MODEL","ANTHROPIC_DEFAULT_SONNET_MODEL","ANTHROPIC_DEFAULT_HAIKU_MODEL","ANTHROPIC_SMALL_FAST_MODEL"];for(let a of g)if(a in n){let s=a.includes("API_KEY");console.log(` ${a}: ${s?se(n[a]):n[a]}`)}console.log("")}}}finally{j()}}function se(e){return!e||e.length<8?"****":e.slice(0,4)+"****"}import w from"chalk";async function ae(e){try{let o=e.limit??"20",t=await h(`/evolution-audit?limit=${o}`);if(t.length===0){console.log(w.dim("No evolution records yet"));return}console.log(w.bold(`Evolution Audit Log (${t.length} records)
16
16
  `));for(let n of t){let l=new Date(n.timestamp).toLocaleString();console.log(w.bold(`[${l}]`)+(n.triggerTaskId?w.dim(` task: ${n.triggerTaskId.slice(0,8)}`):"")),console.log(w.dim(" Diff:"));for(let i of n.diff.split(`
17
- `))i.startsWith("+")?console.log(w.green(` ${i}`)):i.startsWith("-")?console.log(w.red(` ${i}`)):console.log(w.dim(` ${i}`));console.log()}}catch(o){console.error(w.red(o.message)),process.exit(1)}}import p from"chalk";import{WebSocket as Se}from"ws";async function le(e){let o=I(),t=e.port?Number(e.port):o.port??7100,n=W(),l=new URL(`ws://localhost:${t}/events`);n&&l.searchParams.set("api_key",n);let i=l.toString(),c=e.component,g=e.level;function a(){let r=new Se(i);r.on("open",()=>{console.log(p.dim(`Connected to ${i}`)),e.follow&&console.log(p.dim("Following logs... (Ctrl+C to exit)"))}),r.on("message",m=>{try{let f=JSON.parse(m.toString());if(f.type==="log_event"&&f.msg){if(c&&f.component!==c||g&&f.level!==g)return;s(f)}}catch{}}),r.on("error",m=>{console.error(p.red(`WebSocket error: ${m.message}`))}),r.on("close",()=>{e.follow&&(console.log(p.yellow("Connection closed, reconnecting...")),setTimeout(a,1e3))})}function s(r){let m=q(r.timestamp),x={debug:p.gray,info:p.blue,warn:p.yellow,error:p.red,fatal:p.bgRed.white}[r.level]||p.white,R=p.cyan(`[${r.component}]`);console.log(`${p.dim(m)} ${x(r.level.toUpperCase().padEnd(5))} ${R} ${r.msg}`),r.metadata&&typeof r.metadata=="object"&&Object.keys(r.metadata).length>0&&console.log(p.dim(" ")+p.dim(JSON.stringify(r.metadata)))}a(),await new Promise(r=>{process.on("SIGINT",()=>r()),process.on("SIGTERM",()=>r()),e.follow||setTimeout(r,3e3)})}var y=new we;y.name("adam").description("Adam Agent Server CLI").version(J());var E=y.command("server").description("Server management");E.command("start").description("Start the server daemon").action(async()=>{try{let{pid:e,port:o}=await N();console.log(`Server started (PID ${e}, port ${o})`)}catch(e){console.error("Failed to start server:",e.message),process.exit(1)}});E.command("stop").description("Stop the server daemon").action(async()=>{try{await U(),console.log("Server stopped")}catch(e){console.error("Failed to stop server:",e.message),process.exit(1)}});E.command("restart").description("Restart the server daemon").action(async()=>{try{I().running&&(await U(),console.log("Server stopped"));let{pid:o,port:t}=await N();console.log(`Server restarted (PID ${o}, port ${t})`)}catch(e){console.error("Failed to restart server:",e.message),process.exit(1)}});E.command("status").description("Show server status").action(()=>{let e=I();e.running?console.log(`Server is running (PID ${e.pid}, port ${e.port})`):e.pid?console.log("Server not running (stale PID file)"):console.log("Server not running")});E.command("logs").description("Show server logs").option("-f, --follow","Follow log output").action(async e=>{let o=Y();if(!Te(o)){console.log("No log file found");return}if(e.follow){let t=be(o,{encoding:"utf-8"});for await(let n of t)process.stdout.write(n)}else console.log(ke(o,"utf-8"))});y.command("run <prompt>").description("Submit a task and stream output").option("--model <model>","Model to use").option("--timeout <seconds>","Task timeout",parseInt).option("--budget <usd>","Max budget in USD",parseFloat).option("--template <name>","Task template to use").option("--workspace <path>","Workspace directory").option("--no-approval","Auto-approve all approval requests").option("--json","Output as JSON").option("--server <url>","Server URL").action(X);var F=y.command("tasks").description("Task management");F.command("list").description("List recent tasks").option("-s, --status <status>","Filter by status").option("-l, --limit <number>","Limit results","20").action(te);F.command("show <id>").description("Show task details").action(re);F.command("cancel <id>").description("Cancel a running task").action(ne);y.command("config").description("Display current configuration").option("--json","Output as JSON").action(ie);y.command("evolution").description("Show self-evolution audit log").option("-l, --limit <number>","Limit results","20").action(ae);y.command("logs").description("Stream server logs in real-time via WebSocket").option("-f, --follow","Follow logs continuously").option("-c, --component <component>","Filter by component (manager, worker, scheduler, api, ws)").option("-l, --level <level>","Filter by level (debug, info, warn, error)").option("-p, --port <port>","Server port").action(le);y.command("register-ai-digest").description("Register the AI Hourly Digest task template (cron: every hour)").action(()=>{try{G(),console.log("AI Digest template registered successfully")}catch(e){console.error("Failed to register AI Digest template:",e.message),process.exit(1)}});y.action(async()=>{try{await z()}catch{I().running?console.error("Server is running but not responding. Check: adam server logs"):console.error("Server not running. Run: adam server start"),process.exit(1)}let e=(await import("./App-RIYRYLKD.js")).default,{waitUntilExit:o}=Ie($e.createElement(e));await o()});y.parse();
17
+ `))i.startsWith("+")?console.log(w.green(` ${i}`)):i.startsWith("-")?console.log(w.red(` ${i}`)):console.log(w.dim(` ${i}`));console.log()}}catch(o){console.error(w.red(o.message)),process.exit(1)}}import p from"chalk";import{WebSocket as Se}from"ws";async function le(e){let o=I(),t=e.port?Number(e.port):o.port??7100,n=W(),l=new URL(`ws://localhost:${t}/events`);n&&l.searchParams.set("api_key",n);let i=l.toString(),c=e.component,g=e.level;function a(){let r=new Se(i);r.on("open",()=>{console.log(p.dim(`Connected to ${i}`)),e.follow&&console.log(p.dim("Following logs... (Ctrl+C to exit)"))}),r.on("message",m=>{try{let f=JSON.parse(m.toString());if(f.type==="log_event"&&f.msg){if(c&&f.component!==c||g&&f.level!==g)return;s(f)}}catch{}}),r.on("error",m=>{console.error(p.red(`WebSocket error: ${m.message}`))}),r.on("close",()=>{e.follow&&(console.log(p.yellow("Connection closed, reconnecting...")),setTimeout(a,1e3))})}function s(r){let m=q(r.timestamp),x={debug:p.gray,info:p.blue,warn:p.yellow,error:p.red,fatal:p.bgRed.white}[r.level]||p.white,R=p.cyan(`[${r.component}]`);console.log(`${p.dim(m)} ${x(r.level.toUpperCase().padEnd(5))} ${R} ${r.msg}`),r.metadata&&typeof r.metadata=="object"&&Object.keys(r.metadata).length>0&&console.log(p.dim(" ")+p.dim(JSON.stringify(r.metadata)))}a(),await new Promise(r=>{process.on("SIGINT",()=>r()),process.on("SIGTERM",()=>r()),e.follow||setTimeout(r,3e3)})}var y=new we;y.name("adam").description("Adam Agent Server CLI").version(J());var E=y.command("server").description("Server management");E.command("start").description("Start the server daemon").action(async()=>{try{let{pid:e,port:o}=await N();console.log(`Server started (PID ${e}, port ${o})`)}catch(e){console.error("Failed to start server:",e.message),process.exit(1)}});E.command("stop").description("Stop the server daemon").action(async()=>{try{await U(),console.log("Server stopped")}catch(e){console.error("Failed to stop server:",e.message),process.exit(1)}});E.command("restart").description("Restart the server daemon").action(async()=>{try{I().running&&(await U(),console.log("Server stopped"));let{pid:o,port:t}=await N();console.log(`Server restarted (PID ${o}, port ${t})`)}catch(e){console.error("Failed to restart server:",e.message),process.exit(1)}});E.command("status").description("Show server status").action(()=>{let e=I();e.running?console.log(`Server is running (PID ${e.pid}, port ${e.port})`):e.pid?console.log("Server not running (stale PID file)"):console.log("Server not running")});E.command("logs").description("Show server logs").option("-f, --follow","Follow log output").action(async e=>{let o=Y();if(!Te(o)){console.log("No log file found");return}if(e.follow){let t=be(o,{encoding:"utf-8"});for await(let n of t)process.stdout.write(n)}else console.log(ke(o,"utf-8"))});y.command("run <prompt>").description("Submit a task and stream output").option("--model <model>","Model to use").option("--timeout <seconds>","Task timeout",parseInt).option("--budget <usd>","Max budget in USD",parseFloat).option("--template <name>","Task template to use").option("--workspace <path>","Workspace directory").option("--no-approval","Auto-approve all approval requests").option("--json","Output as JSON").option("--server <url>","Server URL").action(X);var F=y.command("tasks").description("Task management");F.command("list").description("List recent tasks").option("-s, --status <status>","Filter by status").option("-l, --limit <number>","Limit results","20").action(te);F.command("show <id>").description("Show task details").action(re);F.command("cancel <id>").description("Cancel a running task").action(ne);y.command("config").description("Display current configuration").option("--json","Output as JSON").action(ie);y.command("evolution").description("Show self-evolution audit log").option("-l, --limit <number>","Limit results","20").action(ae);y.command("logs").description("Stream server logs in real-time via WebSocket").option("-f, --follow","Follow logs continuously").option("-c, --component <component>","Filter by component (manager, worker, scheduler, api, ws)").option("-l, --level <level>","Filter by level (debug, info, warn, error)").option("-p, --port <port>","Server port").action(le);y.command("register-ai-digest").description("Register the AI Hourly Digest task template (cron: every hour)").action(()=>{try{G(),console.log("AI Digest template registered successfully")}catch(e){console.error("Failed to register AI Digest template:",e.message),process.exit(1)}});y.action(async()=>{try{await z()}catch{I().running?console.error("Server is running but not responding. Check: adam server logs"):console.error("Server not running. Run: adam server start"),process.exit(1)}let e=(await import("./App-3OBJDI2C.js")).default,{waitUntilExit:o}=Ie($e.createElement(e));await o()});y.parse();
@@ -1 +1 @@
1
- import{a,b,c,d,e,f,g}from"./chunk-7LBDLAUQ.js";import"./chunk-KVSO3KGZ.js";import"./chunk-WBAPIPST.js";import"./chunk-INNDBLZE.js";import"./chunk-FCV2DPZQ.js";g();export{f as deleteConfigValue,c as getAllConfig,a as getConfigValue,e as isConfigEmpty,d as seedConfig,b as setConfigValue};
1
+ import{a,b,c,d,e,f,g}from"./chunk-WKS7QVIX.js";import"./chunk-4MJF77RD.js";import"./chunk-WBAPIPST.js";import"./chunk-INNDBLZE.js";import"./chunk-FCV2DPZQ.js";g();export{f as deleteConfigValue,c as getAllConfig,a as getConfigValue,e as isConfigEmpty,d as seedConfig,b as setConfigValue};
@@ -0,0 +1 @@
1
+ import{a as b,b as c,d,e}from"./chunk-7K4AQBDD.js";import{a}from"./chunk-UQJZU3R5.js";import"./chunk-7IFLU3CY.js";import"./chunk-GSMC3VUM.js";import"./chunk-WBAPIPST.js";import"./chunk-INNDBLZE.js";import"./chunk-FCV2DPZQ.js";export{a as DEFAULT_CONFIG,e as getChatConfig,d as getDefaults,b as loadConfig,c as loadDefaultConfig};
@@ -1 +1 @@
1
- import{a,b,c,d}from"./chunk-KVSO3KGZ.js";import"./chunk-WBAPIPST.js";import"./chunk-INNDBLZE.js";import"./chunk-FCV2DPZQ.js";d();export{c as closeDb,b as getDb,a as runMigrations};
1
+ import{a,b,c,d}from"./chunk-4MJF77RD.js";import"./chunk-WBAPIPST.js";import"./chunk-INNDBLZE.js";import"./chunk-FCV2DPZQ.js";d();export{c as closeDb,b as getDb,a as runMigrations};
@@ -1 +1 @@
1
- import{a,b,c,d,e,f,g,h,i}from"./chunk-OFOVSC72.js";import"./chunk-KVSO3KGZ.js";import"./chunk-WBAPIPST.js";import"./chunk-INNDBLZE.js";import"./chunk-FCV2DPZQ.js";export{a as TTL_MS,g as cleanupExpired,b as createDeliveryLog,i as getDeliveryLogByRule,h as getDeliveryLogByTask,f as getFailedDeliveries,e as getPendingDeliveries,d as markDelivered,c as updateDeliveryLogStatus};
1
+ import{a,b,c,d,e,f,g,h,i}from"./chunk-NUTUI5KM.js";import"./chunk-4MJF77RD.js";import"./chunk-WBAPIPST.js";import"./chunk-INNDBLZE.js";import"./chunk-FCV2DPZQ.js";export{a as TTL_MS,g as cleanupExpired,b as createDeliveryLog,i as getDeliveryLogByRule,h as getDeliveryLogByTask,f as getFailedDeliveries,e as getPendingDeliveries,d as markDelivered,c as updateDeliveryLogStatus};
@@ -0,0 +1 @@
1
+ import{a,b,c,d}from"./chunk-DBUEHITK.js";import"./chunk-NDP6LWXX.js";import"./chunk-TCHBOWQ5.js";import"./chunk-JZNBFZ7W.js";import"./chunk-WTRM5VO7.js";import"./chunk-CLHSPXZ6.js";import"./chunk-AZBNUSM2.js";import"./chunk-ZQYKT5UY.js";import"./chunk-NUTUI5KM.js";import"./chunk-L7JP7DUO.js";import"./chunk-4MJF77RD.js";import"./chunk-WBAPIPST.js";import"./chunk-INNDBLZE.js";import"./chunk-FCV2DPZQ.js";export{a as DeliveryEngine,b as getDeliveryEngine,c as initDeliveryEngine,d as stopDeliveryEngine};
@@ -1 +1 @@
1
- import{a,b,c,d,e}from"./chunk-QN6BEJF5.js";import"./chunk-KVSO3KGZ.js";import"./chunk-WBAPIPST.js";import"./chunk-INNDBLZE.js";import"./chunk-FCV2DPZQ.js";export{a as createEvolutionAudit,e as generateDiff,d as getLatestRoleEvolution,b as listEvolutionAudit,c as listEvolutionAuditByRole};
1
+ import{a,b,c,d,e}from"./chunk-YPOTHL7X.js";import"./chunk-4MJF77RD.js";import"./chunk-WBAPIPST.js";import"./chunk-INNDBLZE.js";import"./chunk-FCV2DPZQ.js";export{a as createEvolutionAudit,e as generateDiff,d as getLatestRoleEvolution,b as listEvolutionAudit,c as listEvolutionAuditByRole};
@@ -1 +1 @@
1
- import{a as i}from"./chunk-ZM6YED5F.js";import"./chunk-WBAPIPST.js";import{c as a,h as c}from"./chunk-INNDBLZE.js";import"./chunk-FCV2DPZQ.js";c();var u=a("agent");async function m(n){let e=f();if(e.length===0)return{scores:[],errors:[]};let s=[],r=[];for(let t of e)try{let o=await l(t);o!==null&&s.push({nodeId:n,score:o,source:t.name,fetchedAt:Date.now()})}catch(o){r.push(`External API "${t.name}" (${t.url}): ${o instanceof Error?o.message:String(o)}`),u.warn({endpoint:t.name,error:o},"External API fetch failed")}return{scores:s,errors:r}}async function l(n){let e=await fetch(n.url,{signal:AbortSignal.timeout(5e3),headers:{Accept:"application/json"}});if(!e.ok)throw new Error(`HTTP ${e.status} ${e.statusText}`);let s=await e.json(),r=p(s,n.scorePath);if(typeof r!="number"||isNaN(r))throw new Error(`Score at "${n.scorePath}" is not a number: ${JSON.stringify(r)}`);return Math.max(0,Math.min(1,r))}function p(n,e){let s=e.replace(/^\$\.?/,""),r=n;for(let t of s.split(".")){if(r==null||typeof r!="object")return;r=r[t]}return r}function f(){return i.externalApis??[]}export{m as collectExternalApiScores};
1
+ import{a as i}from"./chunk-UQJZU3R5.js";import"./chunk-WBAPIPST.js";import{c as a,h as c}from"./chunk-INNDBLZE.js";import"./chunk-FCV2DPZQ.js";c();var u=a("agent");async function m(n){let e=f();if(e.length===0)return{scores:[],errors:[]};let s=[],r=[];for(let t of e)try{let o=await l(t);o!==null&&s.push({nodeId:n,score:o,source:t.name,fetchedAt:Date.now()})}catch(o){r.push(`External API "${t.name}" (${t.url}): ${o instanceof Error?o.message:String(o)}`),u.warn({endpoint:t.name,error:o},"External API fetch failed")}return{scores:s,errors:r}}async function l(n){let e=await fetch(n.url,{signal:AbortSignal.timeout(5e3),headers:{Accept:"application/json"}});if(!e.ok)throw new Error(`HTTP ${e.status} ${e.statusText}`);let s=await e.json(),r=p(s,n.scorePath);if(typeof r!="number"||isNaN(r))throw new Error(`Score at "${n.scorePath}" is not a number: ${JSON.stringify(r)}`);return Math.max(0,Math.min(1,r))}function p(n,e){let s=e.replace(/^\$\.?/,""),r=n;for(let t of s.split(".")){if(r==null||typeof r!="object")return;r=r[t]}return r}function f(){return i.externalApis??[]}export{m as collectExternalApiScores};