adam-agent-server 1.18.0 → 1.19.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.
- package/dist/{App-SIQUVFJY.js → App-522DTURQ.js} +10 -10
- package/dist/approval-handler-S3NV7OPO.js +1 -0
- package/dist/{artifacts-MAYKOTA2.js → artifacts-NFMM3ORE.js} +1 -1
- package/dist/audit-diagnostics-IHU3CJYZ.js +1 -0
- package/dist/audit-manager-MUMEEP3C.js +1 -0
- package/dist/bree-engine-EEKUQA3U.js +1 -0
- package/dist/channels-IDBWHLLE.js +1 -0
- package/dist/{channels-2TWTBE6Y.js → channels-ZHCTFSDA.js} +1 -1
- package/dist/chat-tool-calls-4BQWZCJH.js +1 -0
- package/dist/{chunk-Z2APBKIT.js → chunk-2JM3URDG.js} +1 -1
- package/dist/{chunk-OBD4245G.js → chunk-4G4CKAXY.js} +1 -1
- package/dist/{chunk-2CE2WUUZ.js → chunk-4ZESWP3J.js} +1 -1
- package/dist/{chunk-QYI44EP6.js → chunk-4ZG4UMAK.js} +1 -1
- package/dist/{chunk-BE653A45.js → chunk-6GYNUTPP.js} +1 -1
- package/dist/{chunk-JROGEBP5.js → chunk-76MMY2XC.js} +1 -1
- package/dist/{chunk-BMCNQGUH.js → chunk-7QT2ZX3K.js} +1 -1
- package/dist/{chunk-SGLZAIVL.js → chunk-A3YUIWLK.js} +1 -1
- package/dist/{chunk-HL373H4P.js → chunk-AMJJ2WGU.js} +1 -1
- package/dist/{chunk-NUOTFUNF.js → chunk-CN5NEJXG.js} +1 -1
- package/dist/{chunk-O6L4UVLV.js → chunk-DFTRUOT6.js} +1 -1
- package/dist/{chunk-JYZTIE2J.js → chunk-DRS5NOAA.js} +1 -1
- package/dist/{chunk-6WQFYV3N.js → chunk-EBZCHLYS.js} +1 -1
- package/dist/{chunk-SKHMWKJT.js → chunk-EPLSB63A.js} +1 -1
- package/dist/{chunk-V2MMQ3SH.js → chunk-FN64ZULV.js} +1 -1
- package/dist/chunk-FQHGIY3E.js +1 -0
- package/dist/{chunk-NSUXJ2VA.js → chunk-GQS3ED3B.js} +1 -1
- package/dist/{chunk-LKGYQJMS.js → chunk-HEHST2E2.js} +1 -1
- package/dist/chunk-IAGTZGGV.js +32 -0
- package/dist/chunk-ITVCPC7G.js +1 -0
- package/dist/{chunk-NXGR3PRY.js → chunk-J2VSAXVU.js} +1 -1
- package/dist/{chunk-5G64P4KE.js → chunk-JRRNGKDK.js} +1 -1
- package/dist/{chunk-KS24764D.js → chunk-JVYSSJKT.js} +2 -2
- package/dist/chunk-JXZCQ5XW.js +1 -0
- package/dist/{chunk-LCD5DVS6.js → chunk-KM4EFB4N.js} +1 -1
- package/dist/chunk-KQMKRRYW.js +143 -0
- package/dist/{chunk-4JHACUZY.js → chunk-L4APYD5A.js} +1 -1
- package/dist/{chunk-WY5BOCQP.js → chunk-LMQPGVM7.js} +16 -16
- package/dist/chunk-MMVDXKYS.js +14 -0
- package/dist/chunk-NKS7LEA7.js +182 -0
- package/dist/{chunk-VWX2B6OM.js → chunk-ORFLN4BF.js} +1 -1
- package/dist/{chunk-2JIQT2CI.js → chunk-PO66F7UQ.js} +1 -1
- package/dist/{chunk-XAPJJAJQ.js → chunk-QJXV4SQE.js} +1 -1
- package/dist/{chunk-UCUELFCS.js → chunk-R7Q6FSV4.js} +1 -1
- package/dist/{chunk-47HJPIUA.js → chunk-T7EKW3B7.js} +1 -1
- package/dist/{chunk-JZBXLN7M.js → chunk-VOH52UDS.js} +1 -1
- package/dist/{chunk-HRPMRWHD.js → chunk-VZL2DGC4.js} +1 -1
- package/dist/{chunk-IEBAOZED.js → chunk-WDMSZS4W.js} +1 -1
- package/dist/{chunk-2A2TXYT3.js → chunk-WG3C43QS.js} +3 -3
- package/dist/{chunk-TA5PFK5C.js → chunk-YEGUFMLJ.js} +1 -1
- package/dist/{chunk-ZQN6JZIJ.js → chunk-ZGA52HRD.js} +1 -1
- package/dist/cli.js +2 -2
- package/dist/{config-U624HJKI.js → config-GOJLI3X2.js} +1 -1
- package/dist/config-Z6KFEFJO.js +1 -0
- package/dist/db-ROXIYW5B.js +1 -0
- package/dist/{delivery-log-QMQQHES4.js → delivery-log-TGJZ5HU7.js} +1 -1
- package/dist/engine-GN7PJPGQ.js +1 -0
- package/dist/{evolution-audit-XF4KZZMP.js → evolution-audit-TFJF666X.js} +1 -1
- package/dist/execution-tools-BQD2O25X.js +1 -0
- package/dist/{external-api-435WH6V3.js → external-api-DSLQDRZ2.js} +1 -1
- package/dist/index.js +41 -39
- package/dist/{learner-4CJ7BSCN.js → learner-ACBX3GI7.js} +1 -1
- package/dist/{memories-NJFKSOL5.js → memories-RAIR5O2F.js} +1 -1
- package/dist/{memory-extractor-UQI75BBK.js → memory-extractor-A6CAOFOX.js} +1 -1
- package/dist/{memory-gc-NTZVUGJX.js → memory-gc-W63MGSDH.js} +1 -1
- package/dist/memory-service-H4OFUNCF.js +1 -0
- package/dist/outbound-gateway-LKRQYPA2.js +1 -0
- package/dist/presets-FO6RSGDN.js +1 -0
- package/dist/{reflection-job-F4BZA2E3.js → reflection-job-XC2F7GTT.js} +1 -1
- package/dist/role-presets-SDA664QG.js +1 -0
- package/dist/role-workspace-NGJEJG3H.js +1 -0
- package/dist/{roles-WDMUBWQP.js → roles-LZCJ7QFS.js} +1 -1
- package/dist/{session-manager-XFUKWEC7.js → session-manager-PU4GH3E4.js} +1 -1
- package/dist/skill-registry-XKLE2LXU.js +1 -0
- package/dist/{task-templates-BIVCRNXA.js → task-templates-52LAC6OA.js} +1 -1
- package/dist/template-dispatch-PJFSWEO2.js +1 -0
- package/package.json +1 -1
- package/web/dist/assets/{ChannelDetail-D0FBZoAX.js → ChannelDetail-CSq9o5fq.js} +1 -1
- package/web/dist/assets/{Channels-Cztxvsa2.js → Channels-CAxTh1Bp.js} +1 -1
- package/web/dist/assets/Chat-PUz41HFr.js +2 -0
- package/web/dist/assets/{Cost-K8-4xqBe.js → Cost-BHcsPz5T.js} +1 -1
- package/web/dist/assets/{Dashboard-BXqFb_Vr.js → Dashboard-BT39_iWc.js} +1 -1
- package/web/dist/assets/{EnvVarEditor-FiiJazzp.js → EnvVarEditor-D_1d7bTJ.js} +1 -1
- package/web/dist/assets/{EventDefDetail-C3S1G0K8.js → EventDefDetail-jKN3gO_7.js} +1 -1
- package/web/dist/assets/{Events-BKxqZ9j6.js → Events-CpeHg3fh.js} +1 -1
- package/web/dist/assets/{Evolution-DFcSm6Rw.js → Evolution-DsWyv2_a.js} +1 -1
- package/web/dist/assets/{ExtensionDetail-C8aPpyLv.js → ExtensionDetail-CJHNaNii.js} +1 -1
- package/web/dist/assets/{Extensions-MLZk05j0.js → Extensions-Pg2vx_ZK.js} +1 -1
- package/web/dist/assets/{FeatureRequests-D_4XaQ7F.js → FeatureRequests-3Yl8wTNT.js} +1 -1
- package/web/dist/assets/{GoalDetail-DVU7c0aR.js → GoalDetail-L3T1zqqs.js} +1 -1
- package/web/dist/assets/{Goals-D3h4WMjU.js → Goals-B-__r-Yq.js} +1 -1
- package/web/dist/assets/{Logs-D5MQv6Yw.js → Logs-CMkjUkmu.js} +1 -1
- package/web/dist/assets/{Memories-Dls71I2i.js → Memories-Q1eKfPQ2.js} +1 -1
- package/web/dist/assets/{Mistakes-BZcTg0vP.js → Mistakes-BROkixt_.js} +1 -1
- package/web/dist/assets/{Plugins-CwCHGzI6.js → Plugins-v17MyPVe.js} +1 -1
- package/web/dist/assets/{RoleDetail-B2M6ALSl.js → RoleDetail-DCGFBLP1.js} +2 -2
- package/web/dist/assets/{Roles-FEHqm_Jf.js → Roles-C7SNebvY.js} +1 -1
- package/web/dist/assets/{Settings-rdVQMfqX.js → Settings-QuKwKbKg.js} +1 -1
- package/web/dist/assets/{Strategies-CwJ9JQ-X.js → Strategies-CXQYvCkc.js} +1 -1
- package/web/dist/assets/{Switch-1JjR4Imr.js → Switch--h1rqagh.js} +1 -1
- package/web/dist/assets/{TaskDetail-h12WxjfG.js → TaskDetail-B0G5ZjDD.js} +1 -1
- package/web/dist/assets/{Work-CfzFRSZX.js → Work-DbFst_9-.js} +1 -1
- package/web/dist/assets/index-D35OGE0z.css +2 -0
- package/web/dist/assets/{index-CXEJd-0s.js → index-Dd3NDYZR.js} +2 -2
- package/web/dist/assets/{usePluginsWithUsage-4iLJAPjH.js → usePluginsWithUsage-DpTxJuFQ.js} +1 -1
- package/web/dist/index.html +2 -2
- package/dist/approval-handler-BWA7UIKN.js +0 -1
- package/dist/audit-diagnostics-K3LUWXTI.js +0 -1
- package/dist/audit-manager-6WL2V6JG.js +0 -1
- package/dist/bree-engine-KYD4GKQK.js +0 -1
- package/dist/channels-PWDSTYNR.js +0 -1
- package/dist/chat-tool-calls-WJDFQ54U.js +0 -1
- package/dist/chunk-3UFEOB6P.js +0 -143
- package/dist/chunk-MTRLUW7Z.js +0 -1
- package/dist/chunk-QTGAK62Z.js +0 -14
- package/dist/chunk-TWOJVEO7.js +0 -32
- package/dist/chunk-VO24C673.js +0 -1
- package/dist/chunk-VPMHZJS2.js +0 -1
- package/dist/chunk-ZJ3TS4FL.js +0 -182
- package/dist/config-X7A6NA73.js +0 -1
- package/dist/db-XODNIJSJ.js +0 -1
- package/dist/engine-OQXDHA2R.js +0 -1
- package/dist/execution-tools-BR4T4MMW.js +0 -1
- package/dist/memory-service-3RLVOF2C.js +0 -1
- package/dist/outbound-gateway-NJNSN2ZX.js +0 -1
- package/dist/presets-SUJRFRJC.js +0 -1
- package/dist/role-presets-VEYTGYA4.js +0 -1
- package/dist/role-workspace-AIVHPX5P.js +0 -1
- package/dist/skill-registry-LARMNUT5.js +0 -1
- package/dist/template-dispatch-6FPJQN6A.js +0 -1
- package/web/dist/assets/Chat-Ce72TtUi.js +0 -2
- package/web/dist/assets/index-CarTGiGO.css +0 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{a as m,g as L}from"./chunk-
|
|
1
|
+
import{a as m,g as L}from"./chunk-CN5NEJXG.js";import{o as a,q as x}from"./chunk-LMQPGVM7.js";import{b as u,i as _}from"./chunk-ITVCPC7G.js";import{c as v,e as N}from"./chunk-5M6IGE5G.js";import{b as l}from"./chunk-5PELJRUQ.js";var f,p,T=l(()=>{"use strict";f={stylePreferences:[],avoidedActions:[],pinnedParameters:[]},p=class extends Error{constructor(n,r,i,s){super(`Role '${r}' has ${i} active task(s) (${s.join(", ")}) and cannot be deleted without the force flag.`);this.roleId=n;this.roleName=r;this.activeTaskCount=i;this.taskStatuses=s;this.name="RoleHasActiveTasksError"}roleId;roleName;activeTaskCount;taskStatuses;code="ROLE_HAS_ACTIVE_TASKS"}});import*as R from"os";import*as C from"path";function g(e){return e.startsWith("~/")||e==="~"?C.join(R.homedir(),e.slice(1)):e}var S=l(()=>{"use strict";_()});function E(e){return k.includes(e)}function I(e){return A[e]}function B(){return k.map(e=>A[e])}function te(e,t=e!=="none"){return B().map(n=>J(n,e,t))}function J(e,t,n=t!=="none"){return process.platform==="darwin"?e.status==="runtime-enforced"&&(t!=="sandbox-exec"||!n)?{...e,availability:"runtime-unavailable",editable:!1,effectiveDisabledReason:"Current runtime has no macOS sandbox backend; Adam cannot enforce this capability on Roles."}:e.status==="runtime-enforced"?{...e,availability:"editable",editable:!0}:{...e,availability:e.status,editable:!1,effectiveDisabledReason:e.disabledReason}:{...e,availability:"platform-unsupported",editable:!1,effectiveDisabledReason:"macOS only"}}function re(e){if(!e?.length)return;for(let n of e)if(!E(n.id))throw new Error(`Unknown OS capability: ${n.id}`);let t=c(e);if(t?.length){for(let n of t){let r=I(n.id);if(r.status!=="runtime-enforced")throw new Error(`OS capability '${r.label}' is not editable in Role settings`);if(r.supportsTargets){if(!n.targets?.length)throw new Error(`OS capability '${r.label}' requires at least one target bundle id`);for(let i of n.targets)if(!F(i))throw new Error(`Invalid automation target bundle id: ${i}`)}else if(n.targets?.length)throw new Error(`OS capability '${r.label}' does not accept targets`)}return t}}function c(e){if(!e||e.length===0)return;let t=new Set,n=[];for(let r of e){if(!E(r.id))throw new Error(`Unknown OS capability: ${r.id}`);if(t.has(r.id))continue;t.add(r.id);let i=I(r.id),s={id:r.id};i.supportsTargets&&r.targets?.length&&(s.targets=[...new Set(r.targets.map(o=>o.trim()).filter(Boolean))]),n.push(s)}return n.length>0?n.sort((r,i)=>r.id.localeCompare(i.id)):void 0}function F(e){return U.test(e)}var k,A,U,w=l(()=>{"use strict";k=["location-services","calendars","contacts","files-and-folders","full-disk-access","homekit","media-and-apple-music","passkeys-access-for-web-browsers","photos","reminders","accessibility","app-management","automation","bluetooth","camera","developer-tools","focus","input-monitoring","local-network","microphone","motion-and-fitness","remote-desktop","screen-and-system-audio-recording","speech-recognition"],A={"location-services":{id:"location-services",label:"Location Services",description:"Access device location and region context.",platform:"darwin",status:"registered-unwired",disabledReason:"Not wired into Adam runtime yet."},calendars:{id:"calendars",label:"Calendars",description:"Access Calendar data via macOS privacy controls.",platform:"darwin",status:"registered-unwired",disabledReason:"Not wired into Adam runtime yet."},contacts:{id:"contacts",label:"Contacts",description:"Access Contacts data via macOS privacy controls.",platform:"darwin",status:"registered-unwired",disabledReason:"Not wired into Adam runtime yet."},"files-and-folders":{id:"files-and-folders",label:"Files & Folders",description:"Host-level file access categories managed outside Role sandboxing.",platform:"darwin",status:"host-only",disabledReason:"Role file boundaries are already controlled by visiblePaths and deniedReadPaths."},"full-disk-access":{id:"full-disk-access",label:"Full Disk Access",description:"Host-level macOS grant for protected storage locations.",platform:"darwin",status:"host-only",disabledReason:"This is a host app permission, not a Role-level control."},homekit:{id:"homekit",label:"HomeKit",description:"Access HomeKit devices and home automation data.",platform:"darwin",status:"registered-unwired",disabledReason:"Not wired into Adam runtime yet."},"media-and-apple-music":{id:"media-and-apple-music",label:"Media & Apple Music",description:"Access Apple Music and media library data.",platform:"darwin",status:"registered-unwired",disabledReason:"Not wired into Adam runtime yet."},"passkeys-access-for-web-browsers":{id:"passkeys-access-for-web-browsers",label:"Passkeys Access for Web Browsers",description:"Access passkeys for browser-integrated authentication.",platform:"darwin",status:"registered-unwired",disabledReason:"Not wired into Adam runtime yet."},photos:{id:"photos",label:"Photos",description:"Access the Photos library via macOS privacy controls.",platform:"darwin",status:"registered-unwired",disabledReason:"Not wired into Adam runtime yet."},reminders:{id:"reminders",label:"Reminders",description:"Access Reminder data via macOS privacy controls.",platform:"darwin",status:"registered-unwired",disabledReason:"Not wired into Adam runtime yet."},accessibility:{id:"accessibility",label:"Accessibility",description:"Control desktop UI and accessibility automation surfaces.",platform:"darwin",status:"runtime-enforced"},"app-management":{id:"app-management",label:"App Management",description:"Manage or inspect other installed applications.",platform:"darwin",status:"registered-unwired",disabledReason:"Not wired into Adam runtime yet."},automation:{id:"automation",label:"Automation",description:"Launch and control other apps via Apple Events.",platform:"darwin",status:"runtime-enforced",supportsTargets:!0},bluetooth:{id:"bluetooth",label:"Bluetooth",description:"Access nearby Bluetooth devices.",platform:"darwin",status:"registered-unwired",disabledReason:"Not wired into Adam runtime yet."},camera:{id:"camera",label:"Camera",description:"Capture camera input.",platform:"darwin",status:"registered-unwired",disabledReason:"Not wired into Adam runtime yet."},"developer-tools":{id:"developer-tools",label:"Developer Tools",description:"Use system developer tooling privileges.",platform:"darwin",status:"registered-unwired",disabledReason:"Not wired into Adam runtime yet."},focus:{id:"focus",label:"Focus",description:"Access Focus state and related automation.",platform:"darwin",status:"registered-unwired",disabledReason:"Not wired into Adam runtime yet."},"input-monitoring":{id:"input-monitoring",label:"Input Monitoring",description:"Observe keyboard and input device activity.",platform:"darwin",status:"registered-unwired",disabledReason:"Not wired into Adam runtime yet."},"local-network":{id:"local-network",label:"Local Network",description:"Discover and communicate with devices on the local network.",platform:"darwin",status:"registered-unwired",disabledReason:"Not wired into Adam runtime yet."},microphone:{id:"microphone",label:"Microphone",description:"Capture microphone input.",platform:"darwin",status:"registered-unwired",disabledReason:"Not wired into Adam runtime yet."},"motion-and-fitness":{id:"motion-and-fitness",label:"Motion & Fitness",description:"Access motion and fitness sensor data.",platform:"darwin",status:"registered-unwired",disabledReason:"Not wired into Adam runtime yet."},"remote-desktop":{id:"remote-desktop",label:"Remote Desktop",description:"Control or observe remote desktop sessions.",platform:"darwin",status:"registered-unwired",disabledReason:"Not wired into Adam runtime yet."},"screen-and-system-audio-recording":{id:"screen-and-system-audio-recording",label:"Screen & System Audio Recording",description:"Capture the screen and system audio.",platform:"darwin",status:"registered-unwired",disabledReason:"Not wired into Adam runtime yet."},"speech-recognition":{id:"speech-recognition",label:"Speech Recognition",description:"Use system speech recognition services.",platform:"darwin",status:"registered-unwired",disabledReason:"Not wired into Adam runtime yet."}},U=/^[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)+$/});function b(e){return{id:e.id,parentId:e.parent_id??void 0,status:e.status,prompt:e.prompt,originalPrompt:e.original_prompt??void 0,config:JSON.parse(e.config),result:e.result??void 0,error:e.error??void 0,sdkSessionId:e.sdk_session_id??void 0,templateId:e.template_id??void 0,roleId:e.role_id??void 0,stepId:e.step_id??void 0,sourceSessionId:e.source_session_id??void 0,deliverTo:e.deliver_to?JSON.parse(e.deliver_to):void 0,reportTo:e.report_to?JSON.parse(e.report_to):void 0,createdAt:e.created_at,startedAt:e.started_at??void 0,completedAt:e.completed_at??void 0,costUsd:e.cost_usd??void 0,costBreakdown:e.cost_breakdown?JSON.parse(e.cost_breakdown):void 0,tokenUsage:e.token_usage?JSON.parse(e.token_usage):void 0,numTurns:e.num_turns??void 0,totalDurationMs:e.total_duration_ms??void 0,blockReason:e.block_reason_json?JSON.parse(e.block_reason_json):void 0,traceId:e.trace_id??void 0,errorCategory:e.error_category??void 0,retryCount:e.retry_count}}function ae(e){a().prepare(`
|
|
2
2
|
INSERT INTO tasks (id, parent_id, status, prompt, original_prompt, config, result, error,
|
|
3
3
|
sdk_session_id, template_id, role_id, step_id, source_session_id, notify_targets, deliver_to, report_to,
|
|
4
4
|
created_at, started_at, completed_at,
|
|
5
5
|
cost_usd, token_usage, num_turns, total_duration_ms, trace_id, error_category, retry_count, cost_breakdown)
|
|
6
6
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
7
|
-
`).run(e.id,e.parentId??null,e.status,e.prompt,e.originalPrompt??null,JSON.stringify(e.config),e.result??null,e.error??null,e.sdkSessionId??null,e.templateId??null,e.roleId??null,e.stepId??null,e.sourceSessionId??null,null,e.deliverTo?JSON.stringify(e.deliverTo):null,e.reportTo?JSON.stringify(e.reportTo):null,e.createdAt,e.startedAt??null,e.completedAt??null,e.costUsd??null,e.tokenUsage?JSON.stringify(e.tokenUsage):null,e.numTurns??null,e.totalDurationMs??null,e.traceId??v()??null,e.errorCategory??null,e.retryCount??0,e.costBreakdown?JSON.stringify(e.costBreakdown):null)}function W(e){let n=
|
|
7
|
+
`).run(e.id,e.parentId??null,e.status,e.prompt,e.originalPrompt??null,JSON.stringify(e.config),e.result??null,e.error??null,e.sdkSessionId??null,e.templateId??null,e.roleId??null,e.stepId??null,e.sourceSessionId??null,null,e.deliverTo?JSON.stringify(e.deliverTo):null,e.reportTo?JSON.stringify(e.reportTo):null,e.createdAt,e.startedAt??null,e.completedAt??null,e.costUsd??null,e.tokenUsage?JSON.stringify(e.tokenUsage):null,e.numTurns??null,e.totalDurationMs??null,e.traceId??v()??null,e.errorCategory??null,e.retryCount??0,e.costBreakdown?JSON.stringify(e.costBreakdown):null)}function W(e){let n=a().prepare("SELECT * FROM tasks WHERE id = ?").get(e);return n?b(n):void 0}function H(e,t){let n=a(),r=[],i=[],s={parentId:"parent_id",status:"status",prompt:"prompt",result:"result",error:"error",sdkSessionId:"sdk_session_id",templateId:"template_id",roleId:"role_id",stepId:"step_id",sourceSessionId:"source_session_id",originalPrompt:"original_prompt",startedAt:"started_at",completedAt:"completed_at",costUsd:"cost_usd",numTurns:"num_turns",totalDurationMs:"total_duration_ms",errorCategory:"error_category",retryCount:"retry_count"};for(let[o,d]of Object.entries(s))o in t&&(r.push(`${d} = ?`),i.push(t[o]??null));"config"in t&&(r.push("config = ?"),i.push(JSON.stringify(t.config))),"tokenUsage"in t&&(r.push("token_usage = ?"),i.push(t.tokenUsage?JSON.stringify(t.tokenUsage):null)),"costBreakdown"in t&&(r.push("cost_breakdown = ?"),i.push(t.costBreakdown?JSON.stringify(t.costBreakdown):null)),"deliverTo"in t&&(r.push("deliver_to = ?"),i.push(t.deliverTo?JSON.stringify(t.deliverTo):null)),"reportTo"in t&&(r.push("report_to = ?"),i.push(t.reportTo?JSON.stringify(t.reportTo):null)),"blockReason"in t&&(r.push("block_reason_json = ?"),i.push(t.blockReason?JSON.stringify(t.blockReason):null)),"contextMeta"in t&&(r.push("context_meta = ?"),i.push(t.contextMeta?JSON.stringify(t.contextMeta):null)),r.length!==0&&(i.push(e),n.prepare(`UPDATE tasks SET ${r.join(", ")} WHERE id = ?`).run(...i))}function oe(e,t){let n=W(e);if(!n)return;let r={...n.config??{},...t};H(e,{config:r})}function P(e,t=100,n=0,r){let i=a(),s="SELECT * FROM tasks",o=[],d=[];return e&&(o.push("status = ?"),d.push(e)),r&&(o.push("role_id = ?"),d.push(r)),o.length>0&&(s+=" WHERE "+o.join(" AND ")),s+=" ORDER BY created_at DESC LIMIT ? OFFSET ?",d.push(t,n),i.prepare(s).all(...d).map(b)}function de(e){return a().prepare("SELECT * FROM tasks WHERE parent_id = ? ORDER BY created_at ASC").all(e).map(b)}function le(e){return a().prepare("SELECT COALESCE(SUM(cost_usd), 0) as total FROM tasks WHERE completed_at >= ? AND cost_usd IS NOT NULL").get(e).total}function ce(e){return a().prepare("SELECT trace_id FROM tasks WHERE id = ?").get(e)?.trace_id??void 0}function ue(e){let t=a();return t.prepare("UPDATE tasks SET retry_count = retry_count + 1 WHERE id = ?").run(e),t.prepare("SELECT retry_count FROM tasks WHERE id = ?").get(e)?.retry_count??1}function q(e){return{id:e.id,taskId:e.task_id,retryAt:e.retry_at,createdAt:e.created_at}}function pe(e){a().prepare("INSERT INTO delayed_retries (id, task_id, retry_at, created_at) VALUES (?, ?, ?, ?)").run(e.id,e.taskId,e.retryAt,e.createdAt)}function ge(e){return a().prepare("SELECT * FROM delayed_retries WHERE retry_at <= ? ORDER BY retry_at ASC").all(e).map(q)}function me(e){a().prepare("DELETE FROM delayed_retries WHERE id = ?").run(e)}function V(e,t){let n=a();n.transaction(()=>{let r=n.prepare("SELECT context_meta FROM tasks WHERE id = ?").get(e),i=(()=>{if(r?.context_meta)try{return JSON.parse(r.context_meta)}catch{return{}}return{}})();t(i),n.prepare("UPDATE tasks SET context_meta = ? WHERE id = ?").run(JSON.stringify(i),e)})()}function fe(e){let n=a().prepare("SELECT context_meta FROM tasks WHERE id = ?").get(e);if(!n||n.context_meta===null)return null;try{return JSON.parse(n.context_meta)}catch{return null}}function be(e,t){t.length!==0&&V(e,n=>{let r=Array.isArray(n.usedMemoryIds)?n.usedMemoryIds:[];n.usedMemoryIds=Array.from(new Set([...r,...t]))})}var O=l(()=>{"use strict";x();N()});import{existsSync as K}from"fs";import{resolve as y}from"path";function M(e){if(e==null)return{...f};if(Array.isArray(e))return{stylePreferences:e.filter(t=>typeof t=="string"),avoidedActions:[],pinnedParameters:[]};if(typeof e=="object"){let t=e;return{stylePreferences:Array.isArray(t.stylePreferences)?t.stylePreferences.filter(n=>typeof n=="string"):[],avoidedActions:Array.isArray(t.avoidedActions)?t.avoidedActions.filter(n=>typeof n=="string"):[],pinnedParameters:Array.isArray(t.pinnedParameters)?t.pinnedParameters.filter(n=>n!==null&&typeof n=="object"&&typeof n.tool=="string"):[]}}return{...f}}function D(e,t){for(let n of e){let r=typeof n=="string"?n:n.path;if(!r.startsWith("/")&&!r.startsWith("~/")&&r!=="~")throw new Error(`additionalDirectories must be absolute paths: '${r}' is not absolute`);let i=y(g(r));if(!i.startsWith("/"))throw new Error(`additionalDirectories must be absolute paths: '${r}' is not absolute`);for(let s of u){let o=y(g(s));if(i.startsWith(o))throw new Error(`additionalDirectories cannot include hardcoded denied path: '${r}' matches '${s}'`)}if(t?.length)for(let s of t){let o=y(g(s));if(i.startsWith(o)||o.startsWith(i))throw new Error(`additionalDirectories cannot overlap with deniedReadPaths: '${r}' conflicts with '${s}'`)}if(!K(i))throw new Error(`additionalDirectories path does not exist: '${r}'`)}}function h(e){return{id:e.id,name:e.name,cagPrompt:e.cag_prompt,learnedRules:M(e.learned_rules?JSON.parse(e.learned_rules):null),memoryStreamId:e.memory_stream_id,status:e.status,performanceScore:e.performance_score??void 0,preferences:e.preferences?JSON.parse(e.preferences):{},createdAt:e.created_at,updatedAt:e.updated_at??void 0,allowedTools:e.allowed_tools?JSON.parse(e.allowed_tools):void 0,disallowedTools:e.disallowed_tools?JSON.parse(e.disallowed_tools):void 0,evaluationCriteria:e.evaluation_criteria?JSON.parse(e.evaluation_criteria):void 0,executionMode:e.execution_mode??void 0,model:e.model??void 0,maxBudgetUsd:e.max_budget_usd??void 0,approvalRequired:e.approval_required?JSON.parse(e.approval_required):void 0,source:e.source??void 0,additionalDirectories:(()=>{if(e.additional_directories!==null)try{let t=JSON.parse(e.additional_directories);return Array.isArray(t)?t.map(n=>typeof n=="string"?{path:n}:n):void 0}catch{return}})(),allowedChannels:e.allowed_channels?JSON.parse(e.allowed_channels):void 0,mcpServers:e.mcp_servers?JSON.parse(e.mcp_servers):void 0,inheritUserSettings:e.inherit_user_settings===1?!0:void 0,permissionMode:e.permission_mode??void 0,allowedBashPatterns:e.allowed_bash_patterns?JSON.parse(e.allowed_bash_patterns):void 0,deniedBashPatterns:e.denied_bash_patterns?JSON.parse(e.denied_bash_patterns):void 0,envVars:e.env_vars?JSON.parse(e.env_vars):void 0,osCapabilities:e.os_capabilities?c(JSON.parse(e.os_capabilities)):void 0,presetId:e.preset_id??void 0,effortTier:e.effort_tier??void 0,skills:e.skills?JSON.parse(e.skills):void 0}}function Ae(e){let t=m("defaults.deniedReadPaths")??[...u];e.additionalDirectories&&D(e.additionalDirectories,t),a().prepare(`
|
|
8
8
|
INSERT INTO roles (id, name, cag_prompt, learned_rules, memory_stream_id, status,
|
|
9
9
|
performance_score, preferences, created_at, updated_at,
|
|
10
10
|
allowed_tools, disallowed_tools, evaluation_criteria, execution_mode, model,
|
|
@@ -12,4 +12,4 @@ import{a as m,g as L}from"./chunk-NUOTFUNF.js";import{n as o,p as x}from"./chunk
|
|
|
12
12
|
permission_mode, allowed_bash_patterns, denied_bash_patterns, env_vars, os_capabilities, preset_id,
|
|
13
13
|
effort_tier, skills)
|
|
14
14
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
15
|
-
`).run(e.id,e.name,e.cagPrompt,JSON.stringify(e.learnedRules),e.memoryStreamId,e.status,e.performanceScore??null,e.preferences?JSON.stringify(e.preferences):null,e.createdAt,e.updatedAt??null,e.allowedTools?JSON.stringify(e.allowedTools):null,e.disallowedTools?JSON.stringify(e.disallowedTools):null,e.evaluationCriteria?JSON.stringify(e.evaluationCriteria):null,e.executionMode??null,e.model??null,e.maxBudgetUsd??null,e.approvalRequired?JSON.stringify(e.approvalRequired):null,e.source??null,e.additionalDirectories?JSON.stringify(e.additionalDirectories):null,e.allowedChannels?JSON.stringify(e.allowedChannels):null,e.mcpServers?JSON.stringify(e.mcpServers):null,e.inheritUserSettings?1:0,e.permissionMode??null,e.allowedBashPatterns?JSON.stringify(e.allowedBashPatterns):null,e.deniedBashPatterns?JSON.stringify(e.deniedBashPatterns):null,e.envVars?JSON.stringify(e.envVars):null,e.osCapabilities?JSON.stringify(c(e.osCapabilities)):null,e.presetId??null,e.effortTier??null,e.skills?JSON.stringify(e.skills):null)}function j(e){let n=
|
|
15
|
+
`).run(e.id,e.name,e.cagPrompt,JSON.stringify(e.learnedRules),e.memoryStreamId,e.status,e.performanceScore??null,e.preferences?JSON.stringify(e.preferences):null,e.createdAt,e.updatedAt??null,e.allowedTools?JSON.stringify(e.allowedTools):null,e.disallowedTools?JSON.stringify(e.disallowedTools):null,e.evaluationCriteria?JSON.stringify(e.evaluationCriteria):null,e.executionMode??null,e.model??null,e.maxBudgetUsd??null,e.approvalRequired?JSON.stringify(e.approvalRequired):null,e.source??null,e.additionalDirectories?JSON.stringify(e.additionalDirectories):null,e.allowedChannels?JSON.stringify(e.allowedChannels):null,e.mcpServers?JSON.stringify(e.mcpServers):null,e.inheritUserSettings?1:0,e.permissionMode??null,e.allowedBashPatterns?JSON.stringify(e.allowedBashPatterns):null,e.deniedBashPatterns?JSON.stringify(e.deniedBashPatterns):null,e.envVars?JSON.stringify(e.envVars):null,e.osCapabilities?JSON.stringify(c(e.osCapabilities)):null,e.presetId??null,e.effortTier??null,e.skills?JSON.stringify(e.skills):null)}function j(e){let n=a().prepare("SELECT * FROM roles WHERE id = ?").get(e);return n?h(n):void 0}function Ee(e){let n=a().prepare("SELECT * FROM roles WHERE name = ?").get(e);return n?h(n):void 0}function Ie(e,t){let n=a(),r=[],i=[];if("name"in t&&(r.push("name = ?"),i.push(t.name)),"cagPrompt"in t&&(r.push("cag_prompt = ?"),i.push(t.cagPrompt)),"learnedRules"in t&&(r.push("learned_rules = ?"),i.push(JSON.stringify(M(t.learnedRules)))),"memoryStreamId"in t&&(r.push("memory_stream_id = ?"),i.push(t.memoryStreamId)),"status"in t&&(r.push("status = ?"),i.push(t.status)),"performanceScore"in t&&(r.push("performance_score = ?"),i.push(t.performanceScore??null)),"preferences"in t&&(r.push("preferences = ?"),i.push(t.preferences?JSON.stringify(t.preferences):null)),"updatedAt"in t&&(r.push("updated_at = ?"),i.push(t.updatedAt??null)),"allowedTools"in t&&(r.push("allowed_tools = ?"),i.push(t.allowedTools?JSON.stringify(t.allowedTools):null)),"disallowedTools"in t&&(r.push("disallowed_tools = ?"),i.push(t.disallowedTools?JSON.stringify(t.disallowedTools):null)),"evaluationCriteria"in t&&(r.push("evaluation_criteria = ?"),i.push(t.evaluationCriteria?JSON.stringify(t.evaluationCriteria):null)),"executionMode"in t&&(r.push("execution_mode = ?"),i.push(t.executionMode??null)),"model"in t&&(r.push("model = ?"),i.push(t.model??null)),"maxBudgetUsd"in t&&(r.push("max_budget_usd = ?"),i.push(t.maxBudgetUsd??null)),"approvalRequired"in t&&(r.push("approval_required = ?"),i.push(t.approvalRequired?JSON.stringify(t.approvalRequired):null)),"source"in t&&(r.push("source = ?"),i.push(t.source??null)),"additionalDirectories"in t){let s=m("defaults.deniedReadPaths")??[...u];t.additionalDirectories&&D(t.additionalDirectories,s),r.push("additional_directories = ?"),i.push(t.additionalDirectories?JSON.stringify(t.additionalDirectories):null)}"allowedChannels"in t&&(r.push("allowed_channels = ?"),i.push(t.allowedChannels?JSON.stringify(t.allowedChannels):null)),"mcpServers"in t&&(r.push("mcp_servers = ?"),i.push(t.mcpServers?JSON.stringify(t.mcpServers):null)),"inheritUserSettings"in t&&(r.push("inherit_user_settings = ?"),i.push(t.inheritUserSettings?1:0)),"permissionMode"in t&&(r.push("permission_mode = ?"),i.push(t.permissionMode??null)),"allowedBashPatterns"in t&&(r.push("allowed_bash_patterns = ?"),i.push(t.allowedBashPatterns?JSON.stringify(t.allowedBashPatterns):null)),"deniedBashPatterns"in t&&(r.push("denied_bash_patterns = ?"),i.push(t.deniedBashPatterns?JSON.stringify(t.deniedBashPatterns):null)),"envVars"in t&&(r.push("env_vars = ?"),i.push(t.envVars?JSON.stringify(t.envVars):null)),"osCapabilities"in t&&(r.push("os_capabilities = ?"),i.push(t.osCapabilities?JSON.stringify(c(t.osCapabilities)):null)),"presetId"in t&&(r.push("preset_id = ?"),i.push(t.presetId??null)),"effortTier"in t&&(r.push("effort_tier = ?"),i.push(t.effortTier??null)),"skills"in t&&(r.push("skills = ?"),i.push(t.skills?JSON.stringify(t.skills):null)),r.length!==0&&(i.push(e),n.prepare(`UPDATE roles SET ${r.join(", ")} WHERE id = ?`).run(...i))}function we(e,t,n=0){let r=a(),i="SELECT * FROM roles",s=[];return e&&(i+=" WHERE status = ?",s.push(e)),i+=" ORDER BY COALESCE(updated_at, created_at) DESC",typeof t=="number"&&(i+=" LIMIT ? OFFSET ?",s.push(t,n)),r.prepare(i).all(...s).map(h)}function G(e){let t=["pending","queued","running"],r=P(void 0,1e3,0,e).filter(s=>t.includes(s.status)),i=[...new Set(r.map(s=>s.status))];return{hasActive:r.length>0,count:r.length,statuses:i}}function Pe(e,t=!1){if(!t){let{hasActive:r,count:i,statuses:s}=G(e);if(r){let o=j(e);throw new p(e,o?.name??e,i,s)}}a().prepare("DELETE FROM roles WHERE id = ?").run(e)}function Oe(e){a().prepare("UPDATE roles SET task_seq = task_seq + 1 WHERE id = ?").run(e)}function Me(e){return a().prepare("SELECT task_seq FROM roles WHERE id = ?").get(e)?.task_seq??0}var $=l(()=>{x();T();_();S();L();w();O()});export{ae as a,W as b,H as c,oe as d,P as e,de as f,le as g,ce as h,ue as i,pe as j,ge as k,me as l,V as m,fe as n,be as o,O as p,p as q,T as r,g as s,S as t,k as u,U as v,I as w,te as x,re as y,c as z,w as A,D as B,Ae as C,j as D,Ee as E,Ie as F,we as G,G as H,Pe as I,Oe as J,Me as K,$ as L};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{o as a,q as o}from"./chunk-LMQPGVM7.js";o();function u(t){return{id:t.id,status:t.status,source:{type:t.source_type,channelId:t.source_channel_id??void 0,chatId:t.source_chat_id??void 0},title:t.title??void 0,createdAt:t.created_at,lastActiveAt:t.last_active_at,archivedAt:t.archived_at??void 0,messageCount:t.message_count,sdkSessionId:t.sdk_session_id??void 0}}function d(t){a().prepare(`
|
|
2
2
|
INSERT INTO chat_sessions (id, status, source_type, source_channel_id, source_chat_id,
|
|
3
3
|
title, created_at, last_active_at, archived_at, message_count)
|
|
4
4
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as E,c as A,i as R}from"./chunk-
|
|
1
|
+
import{b as E,c as A,i as R}from"./chunk-KM4EFB4N.js";import{e as C,i as T}from"./chunk-GQS3ED3B.js";import{G as _,L as I}from"./chunk-WG3C43QS.js";import{o as w,q as F}from"./chunk-LMQPGVM7.js";I();T();import{existsSync as W,readdirSync as L,readFileSync as j}from"fs";import{join as P}from"path";function v(l){let s=l.split(`
|
|
2
2
|
`),n=s[0]??"";return n.startsWith("```yaml")||n.startsWith("```")?s.slice(1).join(`
|
|
3
3
|
`):l}function H(l){let s={},o=v(l).split(`
|
|
4
4
|
`);for(let t of o){let u=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*):\s*(.*)$/);if(u)s[u[1].toLowerCase()]=u[2].trim();else if(t.trim()&&!t.startsWith("#")&&!t.startsWith(" ")&&!t.startsWith(" "))break}return s}function M(l,s){let n=[];try{let o=C(s),t=P(o,".claude","skills");if(!W(t))return n;let u=L(t,{withFileTypes:!0});for(let e of u){if(!e.isDirectory()&&!e.isSymbolicLink())continue;let i=P(t,e.name,"SKILL.md");if(W(i))try{let a=j(i,"utf-8"),r=H(a),m=r.name??e.name,c=r.description??"";n.push({name:m,description:c,roleName:s,roleId:l,path:i,rawFrontmatter:r})}catch{}}}catch{}return n}F();var O=new Set(["the","a","an","is","are","was","were","be","been","being","have","has","had","do","does","did","will","would","could","should","may","might","must","shall","can","need","dare","ought","used","to","of","in","for","on","with","at","by","from","as","into","through","during","before","after","above","below","between","under","again","further","then","once","here","there","when","where","why","how","all","each","few","more","most","other","some","such","no","nor","not","only","own","same","so","than","too","very","just","also","now","and","but","or","if","because","until","while","about","against","this","that","these","those","it","its"]);function S(l){return l.toLowerCase().replace(/[^a-z0-9\s]/g," ").split(/\s+/).filter(s=>s.length>1&&!O.has(s))}function g(l,s){if(s.length===0)return 0;let n=S(l),o=0;for(let t of s){n.includes(t)&&o++;for(let u of n)u.startsWith(t)&&u!==t&&(o+=.5)}return o}function D(l){let s=w(),n=new Map;if(l.length===0)return n;let o=l.map(()=>"?").join(","),t=s.prepare(`
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as G,b as h,c as W,e as z}from"./chunk-
|
|
2
|
+
import{a as G,b as h,c as W,e as z}from"./chunk-AMJJ2WGU.js";import{a as B,b as J}from"./chunk-NTVLV7NI.js";import{a as q}from"./chunk-AUSR5JYV.js";import{c as R,e as K,g as ce}from"./chunk-CN5NEJXG.js";import{d as F}from"./chunk-JRRNGKDK.js";import"./chunk-3MROEPGR.js";import{o as H,p as j,q as le}from"./chunk-LMQPGVM7.js";import"./chunk-ITVCPC7G.js";import"./chunk-EZLBMUQD.js";import"./chunk-5PELJRUQ.js";import{Command as Se}from"commander";import{fork as de}from"child_process";import{readFileSync as L,writeFileSync as ue,existsSync as v,unlinkSync as $,mkdirSync as me,openSync as pe}from"fs";import{join as E}from"path";import{homedir as ge}from"os";var P=E(ge(),".adam"),y=E(P,"adam.pid"),k=E(P,"adam.port"),b=E(P,"server.log");function fe(){v(P)||me(P,{recursive:!0})}function C(){if(!v(y))return null;let e=parseInt(L(y,"utf-8").trim(),10);return isNaN(e)?null:e}function he(){if(!v(k))return null;let e=parseInt(L(k,"utf-8").trim(),10);return isNaN(e)?null:e}function O(e){try{return process.kill(e,0),!0}catch{return!1}}async function N(){fe();let e=C();if(e&&O(e))throw new Error(`Server already running (PID ${e})`);v(y)&&$(y),v(k)&&$(k);let o=pe(b,"a"),t=E(B,"dist/index.js"),n=de(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 z(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(A.cyan(`${g}:`));for(let[r,m]of s){let f=c[r]??r,M=r.includes("apiKey")||r.includes("token")||r.includes("secret")?ne(String(m)):String(m);console.log(` ${f}: ${M}`)}console.log("")}}if(n){console.log(A.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?ne(n[a]):n[a]}`)}console.log("")}}}finally{j()}}function ne(e){return!e||e.length<8?"****":e.slice(0,4)+"****"}import S from"chalk";async function ie(e){try{let o=e.limit??"20",t=await h(`/evolution-audit?limit=${o}`);if(t.length===0){console.log(S.dim("No evolution records yet"));return}console.log(S.bold(`Evolution Audit Log (${t.length} records)
|
|
16
16
|
`));for(let n of t){let l=new Date(n.timestamp).toLocaleString();console.log(S.bold(`[${l}]`)+(n.triggerTaskId?S.dim(` task: ${n.triggerTaskId.slice(0,8)}`):"")),console.log(S.dim(" Diff:"));for(let i of n.diff.split(`
|
|
17
|
-
`))i.startsWith("+")?console.log(S.green(` ${i}`)):i.startsWith("-")?console.log(S.red(` ${i}`)):console.log(S.dim(` ${i}`));console.log()}}catch(o){console.error(S.red(o.message)),process.exit(1)}}import p from"chalk";import{WebSocket as ye}from"ws";async function ae(e){let o=I(),t=e.port?Number(e.port):o.port??7100,n=G(),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 ye(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,M=p.cyan(`[${r.component}]`);console.log(`${p.dim(m)} ${x(r.level.toUpperCase().padEnd(5))} ${M} ${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 w=new Se;w.name("adam").description("Adam Agent Server CLI").version(J());var D=w.command("server").description("Server management");D.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)}});D.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)}});D.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)}});D.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")});D.command("logs").description("Show server logs").option("-f, --follow","Follow log output").action(async e=>{let o=V();if(!ke(o)){console.log("No log file found");return}if(e.follow){let t=Te(o,{encoding:"utf-8"});for await(let n of t)process.stdout.write(n)}else console.log(we(o,"utf-8"))});w.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(Q);var _=w.command("tasks").description("Task management");_.command("list").description("List recent tasks").option("-s, --status <status>","Filter by status").option("-l, --limit <number>","Limit results","20").action(oe);_.command("show <id>").description("Show task details").action(te);_.command("cancel <id>").description("Cancel a running task").action(re);w.command("config").description("Display current configuration").option("--json","Output as JSON").action(se);w.command("evolution").description("Show self-evolution audit log").option("-l, --limit <number>","Limit results","20").action(ie);w.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(ae);w.action(async()=>{try{await W()}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-
|
|
17
|
+
`))i.startsWith("+")?console.log(S.green(` ${i}`)):i.startsWith("-")?console.log(S.red(` ${i}`)):console.log(S.dim(` ${i}`));console.log()}}catch(o){console.error(S.red(o.message)),process.exit(1)}}import p from"chalk";import{WebSocket as ye}from"ws";async function ae(e){let o=I(),t=e.port?Number(e.port):o.port??7100,n=G(),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 ye(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,M=p.cyan(`[${r.component}]`);console.log(`${p.dim(m)} ${x(r.level.toUpperCase().padEnd(5))} ${M} ${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 w=new Se;w.name("adam").description("Adam Agent Server CLI").version(J());var D=w.command("server").description("Server management");D.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)}});D.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)}});D.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)}});D.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")});D.command("logs").description("Show server logs").option("-f, --follow","Follow log output").action(async e=>{let o=V();if(!ke(o)){console.log("No log file found");return}if(e.follow){let t=Te(o,{encoding:"utf-8"});for await(let n of t)process.stdout.write(n)}else console.log(we(o,"utf-8"))});w.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(Q);var _=w.command("tasks").description("Task management");_.command("list").description("List recent tasks").option("-s, --status <status>","Filter by status").option("-l, --limit <number>","Limit results","20").action(oe);_.command("show <id>").description("Show task details").action(te);_.command("cancel <id>").description("Cancel a running task").action(re);w.command("config").description("Display current configuration").option("--json","Output as JSON").action(se);w.command("evolution").description("Show self-evolution audit log").option("-l, --limit <number>","Limit results","20").action(ie);w.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(ae);w.action(async()=>{try{await W()}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-522DTURQ.js")).default,{waitUntilExit:o}=$e(be.createElement(e));await o()});w.parse();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g}from"./chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g}from"./chunk-CN5NEJXG.js";import"./chunk-LMQPGVM7.js";import"./chunk-ITVCPC7G.js";import"./chunk-EZLBMUQD.js";import"./chunk-5PELJRUQ.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-T7EKW3B7.js";import{a}from"./chunk-J2VSAXVU.js";import"./chunk-JRRNGKDK.js";import"./chunk-3MROEPGR.js";import"./chunk-ITVCPC7G.js";import"./chunk-EZLBMUQD.js";import"./chunk-5PELJRUQ.js";export{a as DEFAULT_CONFIG,e as getChatConfig,d as getDefaults,b as loadConfig,c as loadDefaultConfig};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as a,o as b,p as c,q as d}from"./chunk-LMQPGVM7.js";import"./chunk-ITVCPC7G.js";import"./chunk-EZLBMUQD.js";import"./chunk-5PELJRUQ.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,j,k}from"./chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k}from"./chunk-DRS5NOAA.js";import"./chunk-LMQPGVM7.js";import"./chunk-ITVCPC7G.js";import"./chunk-EZLBMUQD.js";import"./chunk-5M6IGE5G.js";import"./chunk-5PELJRUQ.js";export{a as TTL_MS,g as cleanupExpired,b as createDeliveryLog,j as getDeliveryLogByExecution,i as getDeliveryLogByRule,h as getDeliveryLogByTask,f as getFailedDeliveries,k as getLatestDeliveryForContext,e as getPendingDeliveries,d as markDelivered,c as updateDeliveryLogStatus};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as a,h as b,i as c,j as d}from"./chunk-JVYSSJKT.js";import"./chunk-76MMY2XC.js";import"./chunk-4N5G7ND2.js";import"./chunk-WDMSZS4W.js";import"./chunk-NNMQGISW.js";import"./chunk-IAGTZGGV.js";import"./chunk-DRS5NOAA.js";import"./chunk-VZL2DGC4.js";import"./chunk-YEGUFMLJ.js";import"./chunk-4G4CKAXY.js";import"./chunk-L4APYD5A.js";import"./chunk-ORFLN4BF.js";import"./chunk-L7JP7DUO.js";import"./chunk-WG3C43QS.js";import"./chunk-EBZCHLYS.js";import"./chunk-CN5NEJXG.js";import"./chunk-J2VSAXVU.js";import"./chunk-3MROEPGR.js";import"./chunk-6GYNUTPP.js";import"./chunk-LMQPGVM7.js";import"./chunk-ITVCPC7G.js";import"./chunk-EZLBMUQD.js";import"./chunk-5M6IGE5G.js";import"./chunk-5PELJRUQ.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-
|
|
1
|
+
import{a,b,c,d,e}from"./chunk-A3YUIWLK.js";import"./chunk-LMQPGVM7.js";import"./chunk-ITVCPC7G.js";import"./chunk-EZLBMUQD.js";import"./chunk-5M6IGE5G.js";import"./chunk-5PELJRUQ.js";export{a as createEvolutionAudit,e as generateDiff,d as getLatestRoleEvolution,b as listEvolutionAudit,c as listEvolutionAuditByRole};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as a,f as b,g as c,h as d,i as e,j as f,k as g,l as h}from"./chunk-MMVDXKYS.js";import"./chunk-FQHGIY3E.js";import"./chunk-2JM3URDG.js";import"./chunk-L4APYD5A.js";import"./chunk-GQS3ED3B.js";import"./chunk-ORFLN4BF.js";import"./chunk-L7JP7DUO.js";import"./chunk-HEHST2E2.js";import"./chunk-PO66F7UQ.js";import"./chunk-4ZG4UMAK.js";import"./chunk-T2Z2JDPY.js";import"./chunk-FN64ZULV.js";import"./chunk-WG3C43QS.js";import"./chunk-CN5NEJXG.js";import"./chunk-3MROEPGR.js";import"./chunk-6GYNUTPP.js";import"./chunk-LMQPGVM7.js";import"./chunk-ITVCPC7G.js";import"./chunk-EZLBMUQD.js";import"./chunk-5M6IGE5G.js";import"./chunk-5PELJRUQ.js";export{e as EXECUTION_TOOLS_ALL_TOOL_NAMES,a as EXECUTION_TOOLS_MCP_NAME,c as EXECUTION_TOOLS_MUTATION_TOOLS,d as EXECUTION_TOOLS_READONLY_TOOLS,b as EXECUTION_TOOLS_TOOL_PREFIX,f as KEY_REGEX,h as createExecutionTools,g as inferMimeFromPath};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
1
|
+
import{a as i}from"./chunk-J2VSAXVU.js";import"./chunk-ITVCPC7G.js";import{c as a,h as c}from"./chunk-EZLBMUQD.js";import"./chunk-5PELJRUQ.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};
|