adam-agent-server 1.2.0 → 1.2.2

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 (26) hide show
  1. package/README.md +4 -7
  2. package/dist/{adam-tools-SXOVOPS2.js → adam-tools-V22LRDCP.js} +1 -1
  3. package/dist/{chunk-XTGWQUO4.js → chunk-IZWULGUS.js} +1 -1
  4. package/dist/index.js +3 -3
  5. package/package.json +1 -1
  6. package/web/dist/assets/{ChannelDetail-e6rVX_y8.js → ChannelDetail-eWtIGhAd.js} +1 -1
  7. package/web/dist/assets/{Channels-DJvZPKer.js → Channels-2veauYsm.js} +1 -1
  8. package/web/dist/assets/{Chat-hTZdEwyE.js → Chat-Bha4vXwT.js} +1 -1
  9. package/web/dist/assets/{Dashboard-B4rL_ePs.js → Dashboard-cDHpOWnY.js} +1 -1
  10. package/web/dist/assets/EnvVarEditor-CaCpNT3y.js +1 -0
  11. package/web/dist/assets/{Evolution-BGwFCo7X.js → Evolution-Ao-gdHbS.js} +1 -1
  12. package/web/dist/assets/{GoalDetail-BH2ku-0t.js → GoalDetail-CX2i9A5a.js} +1 -1
  13. package/web/dist/assets/{Goals-DynDtpMC.js → Goals-DdM0tFus.js} +1 -1
  14. package/web/dist/assets/{Logs-CyJFouE6.js → Logs-DJhpDtCA.js} +1 -1
  15. package/web/dist/assets/{Memories-ClcFD7OG.js → Memories-CYN99g2T.js} +1 -1
  16. package/web/dist/assets/{Plugins-SNOQNNcL.js → Plugins-gcMpBdyq.js} +1 -1
  17. package/web/dist/assets/{RoleDetail-vlTPiYwY.js → RoleDetail-s7u-Shk3.js} +2 -2
  18. package/web/dist/assets/{Roles-CFcuHIvA.js → Roles-CCy1H7PY.js} +1 -1
  19. package/web/dist/assets/{Settings-C9Kuz-6D.js → Settings-JbgBxBeo.js} +1 -1
  20. package/web/dist/assets/{Strategies-DZWlQCHp.js → Strategies-CO4LwZjS.js} +1 -1
  21. package/web/dist/assets/{Switch-DOi0EFHj.js → Switch-CTAIxUd_.js} +1 -1
  22. package/web/dist/assets/{TaskDetail-DjmmnldI.js → TaskDetail-DEg_oUwx.js} +1 -1
  23. package/web/dist/assets/{Work-CvESHC3Y.js → Work-BpKK_uXA.js} +1 -1
  24. package/web/dist/assets/{index-BFmC20R2.js → index-rvaixveh.js} +5 -5
  25. package/web/dist/index.html +1 -1
  26. package/web/dist/assets/EnvVarEditor-C8kRWejV.js +0 -1
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{L as t,R as n,a as r,nt as i,o as a,v as o}from"./vendor-icons-CkI4-NxL.js";import{t as s}from"./vendor-react-DLRtONKt.js";import{n as c,r as l}from"./dist-HyCSN_hp.js";import{f as u,w as d}from"./index-BFmC20R2.js";import{n as f,r as p,t as m}from"./Card-4mOZntHG.js";var h=e(i(),1),g=s(),_=h.forwardRef(({className:e,type:t,...n},r)=>(0,g.jsx)(`input`,{type:t,className:c(`flex h-8 w-full rounded-md border border-slate-700 bg-slate-800 px-3 py-1 text-sm text-slate-200 placeholder:text-slate-500 focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500 disabled:cursor-not-allowed disabled:opacity-50`,e),ref:r,...n}));_.displayName=`Input`;var v=/^[A-Za-z_][A-Za-z0-9_]*$/,y=/key|token|secret|password|credential/i;function b({envVars:e,onSave:i,mode:s,roleId:c,title:b=`Environment Variables`}){let[x,S]=(0,h.useState)([]),[C,w]=(0,h.useState)(!1),[T,E]=(0,h.useState)(new Set),[D,O]=(0,h.useState)([]),[k,A]=(0,h.useState)(!1);(0,h.useEffect)(()=>{S(Object.entries(e).map(([e,t])=>({key:e,value:t,isNew:!1})))},[e]);let j=(0,h.useCallback)(async()=>{try{let e=await l(s===`global`?`/config/env-diff`:`/roles/${c}/env-diff`);O(s===`global`?e.diffs.filter(e=>e.configPath?.startsWith(`defaults.env.`)):e.diffs),A(e.envFileExists)}catch{}},[s,c]);(0,h.useEffect)(()=>{j()},[j]);let M=()=>{let t=Object.fromEntries(x.filter(e=>e.key.trim()).map(e=>[e.key,e.value]));return JSON.stringify(t)!==JSON.stringify(e)},N=()=>{S(e=>[...e,{key:``,value:``,isNew:!0}])},P=e=>{S(t=>t.filter((t,n)=>n!==e))},F=(e,t,n)=>{S(r=>r.map((r,i)=>i===e?{...r,[t]:n}:r))},I=e=>{E(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},L=()=>{let e=new Set;for(let t of x){let n=t.key.trim();if(n){if(!v.test(n))return`Invalid key format: "${n}"`;if(n.startsWith(`ANTHROPIC_`))return`ANTHROPIC_* keys are managed in the Anthropic section`;if(e.has(n))return`Duplicate key: "${n}"`;e.add(n)}}return e.size>100?`Maximum 100 environment variables`:null},R=async()=>{let e=L();if(e){d.error(e);return}w(!0);try{let e={};for(let t of x){let n=t.key.trim();n&&(e[n]=t.value)}s===`global`?await l(`/config/env`,{method:`PUT`,body:JSON.stringify(e)}):await l(`/roles/${c}`,{method:`PATCH`,body:JSON.stringify({envVars:e})}),d.success(`Environment variables saved`),i(),j()}catch(e){d.error(e instanceof Error?e.message:`Failed to save`)}finally{w(!1)}},z=async()=>{try{await l(s===`global`?`/config/sync-to-env`:`/roles/${c}/sync-to-env`,{method:`POST`}),d.success(`Synced DB to .env`),j()}catch(e){d.error(e instanceof Error?e.message:`Sync failed`)}},B=async()=>{try{await l(s===`global`?`/config/load-from-env`:`/roles/${c}/load-from-env`,{method:`POST`}),d.success(`Loaded .env to DB`),i(),j()}catch(e){d.error(e instanceof Error?e.message:`Load failed`)}};return(0,g.jsxs)(m,{children:[(0,g.jsxs)(f,{children:[(0,g.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,g.jsx)(p,{className:`text-sm`,children:b}),(0,g.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,g.jsxs)(u,{variant:`ghost`,size:`sm`,onClick:N,children:[(0,g.jsx)(o,{size:14,className:`mr-1`}),` Add`]}),M()&&(0,g.jsx)(u,{size:`sm`,onClick:()=>void R(),disabled:C,children:C?`Saving...`:`Save`})]})]}),s===`global`&&(0,g.jsx)(`p`,{className:`text-xs text-slate-500 mt-1`,children:`ANTHROPIC_* variables are managed in the Anthropic section above.`})]}),D.length>0&&k&&(0,g.jsx)(`div`,{className:`mx-4 mb-3 rounded border border-yellow-800 bg-yellow-950/50 p-3`,children:(0,g.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,g.jsx)(r,{size:14,className:`text-yellow-400`}),(0,g.jsxs)(`span`,{className:`text-xs text-yellow-400`,children:[`.env and DB differ on `,D.length,` key(s): `,D.map(e=>e.envKey).join(`, `)]})]}),(0,g.jsxs)(`div`,{className:`flex gap-2`,children:[(0,g.jsx)(u,{variant:`ghost`,size:`sm`,className:`text-xs`,onClick:()=>void z(),children:`DB → .env`}),(0,g.jsx)(u,{variant:`ghost`,size:`sm`,className:`text-xs`,onClick:()=>void B(),children:`.env → DB`})]})]})}),(0,g.jsxs)(`div`,{className:`px-4 pb-4 space-y-2`,children:[x.length===0&&(0,g.jsx)(`p`,{className:`text-xs text-slate-500 py-2`,children:`No environment variables configured.`}),x.map((e,r)=>{let i=y.test(e.key),o=T.has(e.key)||e.isNew;return(0,g.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,g.jsx)(_,{className:`w-48 font-mono text-xs`,placeholder:`KEY_NAME`,value:e.key,onChange:e=>F(r,`key`,e.target.value)}),(0,g.jsx)(`span`,{className:`text-slate-600`,children:`=`}),(0,g.jsxs)(`div`,{className:`relative flex-1`,children:[(0,g.jsx)(_,{className:`font-mono text-xs pr-8`,type:i&&!o?`password`:`text`,placeholder:`value`,value:e.value,onChange:e=>F(r,`value`,e.target.value)}),i&&(0,g.jsx)(`button`,{type:`button`,className:`absolute right-2 top-1/2 -translate-y-1/2 text-slate-500 hover:text-slate-300`,onClick:()=>I(e.key),children:o?(0,g.jsx)(n,{size:12}):(0,g.jsx)(t,{size:12})})]}),(0,g.jsx)(u,{variant:`ghost`,size:`sm`,className:`text-red-500 hover:text-red-300`,onClick:()=>P(r),children:(0,g.jsx)(a,{size:14})})]},r)})]})]})}export{b as t};