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.
- package/dist/App-3OBJDI2C.js +9 -0
- package/dist/adam-tools-4LZYFB6J.js +1 -0
- package/dist/{approval-handler-JYIS2PKQ.js → approval-handler-RIJO3OBO.js} +1 -1
- package/dist/audit-manager-6FFPXID3.js +1 -0
- package/dist/bree-engine-2NOTIBAZ.js +1 -0
- package/dist/{channels-WZOYE4O4.js → channels-LUJ7GTSP.js} +1 -1
- package/dist/channels-TSZLEU3L.js +1 -0
- package/dist/{chunk-PMHNW5IL.js → chunk-4LSIHSCO.js} +1 -1
- package/dist/{chunk-KVSO3KGZ.js → chunk-4MJF77RD.js} +54 -5
- package/dist/{chunk-BIIP363C.js → chunk-4NW2DNDZ.js} +1 -1
- package/dist/{chunk-OEKM2W3K.js → chunk-6NUHSHS5.js} +1 -1
- package/dist/{chunk-IHP7JV6J.js → chunk-72VLUJ2S.js} +1 -1
- package/dist/chunk-7CJGPCSJ.js +49 -0
- package/dist/{chunk-KLQOILIJ.js → chunk-7IXLL673.js} +1 -1
- package/dist/{chunk-SBX3HMDA.js → chunk-7K4AQBDD.js} +1 -1
- package/dist/{chunk-GMCIKDTC.js → chunk-AKPLOO2V.js} +1 -1
- package/dist/{chunk-AJVN3KPM.js → chunk-AZBNUSM2.js} +1 -1
- package/dist/{chunk-SWPXG2CY.js → chunk-CLHSPXZ6.js} +1 -1
- package/dist/{chunk-KKLZIXBN.js → chunk-DBUEHITK.js} +2 -2
- package/dist/chunk-GSMC3VUM.js +1 -0
- package/dist/{chunk-EJVUUIAV.js → chunk-HFN7Y3IM.js} +1 -1
- package/dist/{chunk-6DXNXLYG.js → chunk-IKUBP3SY.js} +1 -1
- package/dist/{chunk-4TCP2AT7.js → chunk-IZGTTLTG.js} +1 -1
- package/dist/chunk-JZNBFZ7W.js +7 -0
- package/dist/{chunk-6YURWVQG.js → chunk-NDP6LWXX.js} +1 -1
- package/dist/{chunk-CDVIT7L5.js → chunk-NLD7WK3R.js} +1 -1
- package/dist/{chunk-OFOVSC72.js → chunk-NUTUI5KM.js} +1 -1
- package/dist/{chunk-B4WHT7DX.js → chunk-OTH4M5L3.js} +1 -1
- package/dist/{chunk-GUQAIWCQ.js → chunk-P6KWAGAY.js} +1 -1
- package/dist/chunk-PVYEGQEG.js +83 -0
- package/dist/{chunk-Z5ET7WW2.js → chunk-T33BLZV2.js} +1 -1
- package/dist/{chunk-2HN2TSP6.js → chunk-TCHBOWQ5.js} +1 -1
- package/dist/{chunk-RPTHFQX7.js → chunk-TKDT7EQO.js} +1 -1
- package/dist/{chunk-ZM6YED5F.js → chunk-UQJZU3R5.js} +1 -1
- package/dist/{chunk-7LBDLAUQ.js → chunk-WKS7QVIX.js} +1 -1
- package/dist/{chunk-EGS6U3V5.js → chunk-WTRM5VO7.js} +2 -2
- package/dist/chunk-XTHP5JMO.js +10 -0
- package/dist/chunk-YHVFZB6Q.js +1 -0
- package/dist/{chunk-QN6BEJF5.js → chunk-YPOTHL7X.js} +1 -1
- package/dist/chunk-ZKMDHQJY.js +104 -0
- package/dist/{chunk-AR2IZMM2.js → chunk-ZQYKT5UY.js} +1 -1
- package/dist/cli.js +2 -2
- package/dist/{config-EI3SCA4W.js → config-HR4MBTIS.js} +1 -1
- package/dist/config-XMQS2NPT.js +1 -0
- package/dist/{db-4NY7ZOS2.js → db-6KUGCGVR.js} +1 -1
- package/dist/{delivery-log-SC2ULFCK.js → delivery-log-7DJJTPXL.js} +1 -1
- package/dist/engine-HJUE6I4I.js +1 -0
- package/dist/{evolution-audit-KUBXFUHI.js → evolution-audit-I2ITWAEC.js} +1 -1
- package/dist/{external-api-A4JXX4ZE.js → external-api-7XV2PXPC.js} +1 -1
- package/dist/index.js +12 -11
- package/dist/{learner-B6XVQKBF.js → learner-CBPQZ3HL.js} +1 -1
- package/dist/{memories-FQCRKMK6.js → memories-HBBW44MG.js} +1 -1
- package/dist/{memory-extractor-FUOJ5D77.js → memory-extractor-XO2HJ22Y.js} +2 -2
- package/dist/memory-service-HIFTKEW2.js +1 -0
- package/dist/outbound-gateway-GGFMU5JW.js +1 -0
- package/dist/role-presets-W452Y3RV.js +1 -0
- package/dist/{roles-3UTFKSHI.js → roles-NYGWZMQI.js} +1 -1
- package/dist/{runtime-B2DP3JNB.js → runtime-VDBZZ4KG.js} +1 -1
- package/dist/{session-manager-Z6MIYRD3.js → session-manager-JICVE4CO.js} +1 -1
- package/dist/{task-templates-PSP7GOJJ.js → task-templates-NC7XIZIC.js} +1 -1
- package/dist/workflow-executor-QN4KP7B4.js +1 -0
- package/package.json +1 -1
- package/web/dist/assets/{ChannelDetail-eWtIGhAd.js → ChannelDetail-DX4QnE8j.js} +1 -1
- package/web/dist/assets/{Channels-2veauYsm.js → Channels-EXkNOQpB.js} +1 -1
- package/web/dist/assets/{Chat-Bha4vXwT.js → Chat-Da-mCR0c.js} +1 -1
- package/web/dist/assets/{Dashboard-cDHpOWnY.js → Dashboard-Bq6sEDdP.js} +1 -1
- package/web/dist/assets/{EnvVarEditor-CaCpNT3y.js → EnvVarEditor-CNxXpVbD.js} +1 -1
- package/web/dist/assets/{Evolution-Ao-gdHbS.js → Evolution-DPdmbooj.js} +1 -1
- package/web/dist/assets/{GoalDetail-CX2i9A5a.js → GoalDetail-BamCfVzS.js} +1 -1
- package/web/dist/assets/{Goals-DdM0tFus.js → Goals-CHPEg0RK.js} +1 -1
- package/web/dist/assets/{Logs-DJhpDtCA.js → Logs-BHkBvH0T.js} +1 -1
- package/web/dist/assets/{Memories-CYN99g2T.js → Memories-BY2pJhVd.js} +1 -1
- package/web/dist/assets/{Plugins-gcMpBdyq.js → Plugins-C5xLM0BU.js} +1 -1
- package/web/dist/assets/{RoleDetail-s7u-Shk3.js → RoleDetail-Dnp-W14x.js} +1 -1
- package/web/dist/assets/{Roles-CCy1H7PY.js → Roles-BVOVoHvc.js} +1 -1
- package/web/dist/assets/Settings-eBHvn6s_.js +1 -0
- package/web/dist/assets/{Strategies-CO4LwZjS.js → Strategies-BbFbLKBJ.js} +1 -1
- package/web/dist/assets/{Switch-CTAIxUd_.js → Switch-Q-inggPs.js} +1 -1
- package/web/dist/assets/{TaskDetail-DEg_oUwx.js → TaskDetail-BEjZ1gco.js} +1 -1
- package/web/dist/assets/Work-CF2iLs8i.js +1 -0
- package/web/dist/assets/{index-rvaixveh.js → index-CaHdOfAc.js} +2 -2
- package/web/dist/assets/index-D0SvKqKc.css +2 -0
- package/web/dist/index.html +2 -2
- package/dist/App-RIYRYLKD.js +0 -9
- package/dist/adam-tools-V22LRDCP.js +0 -1
- package/dist/audit-manager-QDFDBK4E.js +0 -1
- package/dist/bree-engine-EKZFCS4Q.js +0 -1
- package/dist/channels-WMCY4QC3.js +0 -1
- package/dist/chunk-6HD6NYIB.js +0 -1
- package/dist/chunk-ITUBFUJQ.js +0 -67
- package/dist/chunk-IZWULGUS.js +0 -83
- package/dist/chunk-JNRCXAW3.js +0 -49
- package/dist/chunk-W3554FQ7.js +0 -7
- package/dist/config-7HYICF5P.js +0 -1
- package/dist/engine-5RJ7NJSM.js +0 -1
- package/dist/memory-service-ANR67OPY.js +0 -1
- package/dist/outbound-gateway-6FQRWYFF.js +0 -1
- package/dist/role-presets-LRP6P5O2.js +0 -1
- package/web/dist/assets/Settings-JbgBxBeo.js +0 -1
- package/web/dist/assets/Work-BpKK_uXA.js +0 -1
- package/web/dist/assets/index-CaocwyO8.css +0 -2
package/dist/chunk-IZWULGUS.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import{a as Z}from"./chunk-5V36ACKZ.js";import{a as xe,c as Le,d as Pe,e as K,f as Ce,g as Ee,h as De,i as mt,j as Ae,k as Ve,l as U,n as he}from"./chunk-OEKM2W3K.js";import{b as _e,c as pe,e as Me}from"./chunk-EJVUUIAV.js";import{b as J}from"./chunk-GMCIKDTC.js";import{a as Be,c as be,e as qe}from"./chunk-6YURWVQG.js";import{a as Q,b as k,c as X,d as Fe,e as Ge}from"./chunk-CDVIT7L5.js";import{a as W,b as h,c as E,d as L}from"./chunk-W3554FQ7.js";import{j as fe}from"./chunk-RPTHFQX7.js";import{d as ge}from"./chunk-SWPXG2CY.js";import{f as Y,i as ue,j as z}from"./chunk-KLQOILIJ.js";import{a as me}from"./chunk-L7JP7DUO.js";import{g as Ne}from"./chunk-4TCP2AT7.js";import{a as Ue,b as N,c as $e,f as je,g as Oe}from"./chunk-6DXNXLYG.js";import{d as I,j as Te}from"./chunk-6HD6NYIB.js";import{d as ke,e as T,g as D,h as A,i as Re,j as de,k as H}from"./chunk-B4WHT7DX.js";import{b,d as ce}from"./chunk-KVSO3KGZ.js";import{c as w,d as Se,h as C}from"./chunk-INNDBLZE.js";import{f as _}from"./chunk-FCV2DPZQ.js";import{createSdkMcpServer as Dt,tool as p}from"@anthropic-ai/claude-agent-sdk";import{z as a}from"zod";H();z();import{v4 as j}from"uuid";ce();function gt(e){return{id:e.id,goalId:e.goal_id,level:e.level,parentId:e.parent_id??void 0,name:e.name,description:e.description??void 0,weight:e.weight,calibrationFactor:e.calibration_factor,createdAt:e.created_at}}function $(e){b().prepare(`
|
|
2
|
-
INSERT INTO metric_tree (id, goal_id, level, parent_id, name, description,
|
|
3
|
-
weight, calibration_factor, created_at)
|
|
4
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
5
|
-
`).run(e.id,e.goalId,e.level,e.parentId??null,e.name,e.description??null,e.weight,e.calibrationFactor,e.createdAt)}function We(e){return b().prepare("SELECT * FROM metric_tree WHERE goal_id = ? ORDER BY level, created_at").all(e).map(gt)}C();var ft=w("goal-manager");async function Nr(e){let t;try{let n=JSON.parse(e);t={name:n.name??"",description:n.description,metric:n.metric??"",targetValue:n.targetValue??0,currentValue:n.currentValue??0,deadline:n.deadline??0,budget:n.budget??0,roleId:n.roleId??"engineer",status:"active"}}catch{t=await ht(e)}let r=bt(t);return{goalState:t,validationResult:r,rawInput:e}}async function ht(e){let t=`Extract SMART goal fields from this natural language input.
|
|
6
|
-
|
|
7
|
-
Input: "${e}"
|
|
8
|
-
|
|
9
|
-
Respond ONLY with a JSON object:
|
|
10
|
-
{
|
|
11
|
-
"name": "short goal name (max 100 chars)",
|
|
12
|
-
"description": "detailed description of what the goal aims to achieve",
|
|
13
|
-
"metric": "measurable metric name (e.g. completion, reports_written, accuracy_score)",
|
|
14
|
-
"targetValue": <number, the target to reach>,
|
|
15
|
-
"deadline_days": <number, days from now to complete>,
|
|
16
|
-
"budget": <number, estimated budget in USD>,
|
|
17
|
-
"role": "<best matching role: engineer | analyst | content_creator | reviewer>"
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
Rules:
|
|
21
|
-
- name: concise, actionable title
|
|
22
|
-
- metric: quantifiable measure of success; use "completion" if the goal is binary (done/not done)
|
|
23
|
-
- targetValue: realistic target for the metric; use 1 for binary goals
|
|
24
|
-
- deadline_days: reasonable timeframe; default 7 if unclear
|
|
25
|
-
- budget: estimated cost in USD; default 5 if unclear
|
|
26
|
-
- role: match to the nature of work (research=analyst, writing=content_creator, coding=engineer, review=reviewer)`;try{let n=(await Z(t,"You extract structured SMART goal fields from natural language. Reply with only valid JSON.")).match(/\{[\s\S]*\}/);if(n){let o=JSON.parse(n[0]),i=o.deadline_days??7;return{name:(o.name??e.slice(0,100)).slice(0,100),description:o.description??e,metric:o.metric??"completion",targetValue:o.targetValue??1,currentValue:0,deadline:Date.now()+i*24*60*60*1e3,budget:o.budget??5,roleId:o.roleId??"engineer",status:"active"}}}catch(r){ft.warn({error:r},"LLM goal parsing failed, using fallback")}return{name:e.trim().slice(0,100),description:e.trim(),metric:"completion",targetValue:1,currentValue:0,deadline:Date.now()+10080*60*1e3,budget:5,roleId:"engineer",status:"active"}}function bt(e){let t=[],r=[];return(!e.name||e.name.trim().length===0)&&t.push("S: name must be non-empty"),(!e.description||e.description.trim().length===0)&&t.push("S: description must be non-empty"),(!e.metric||e.metric.trim().length===0)&&t.push("M: metric must be specified"),e.targetValue<=0&&t.push("A: targetValue must be > 0"),(!e.roleId||e.roleId.trim().length===0)&&t.push("R: roleId must be non-empty"),e.deadline<=Date.now()&&t.push("T: deadline must be in the future"),e.budget<=0&&r.push("budget is zero or negative; goal will have no spending limit"),{isValid:t.length===0,errors:t,warnings:r}}function Ur(e,t,r){let n=j(),o=Date.now(),i={id:n,name:e.name,description:e.description,roleId:e.roleId,metricType:e.metric,targetValue:e.targetValue,currentValue:e.currentValue,deadline:e.deadline,budgetUsd:e.budget,status:e.status,createdAt:o,deliverTo:t,reportTo:r};return Q(i),i}function Je(e,t){let r=Date.now(),n=[],o={id:j(),goalId:e,level:"L0",name:`${t}_goal_progress`,description:`Goal-level ${t} progress (monthly)`,weight:1,calibrationFactor:1,createdAt:r};n.push(o),$(o);let i={id:j(),goalId:e,level:"L1",parentId:o.id,name:`${t}_weekly_trend`,description:`Weekly trend for ${t}`,weight:.8,calibrationFactor:1,createdAt:r};n.push(i),$(i);let s={id:j(),goalId:e,level:"L2",parentId:i.id,name:`${t}_daily_process`,description:`Daily process metric for ${t}`,weight:.6,calibrationFactor:1,createdAt:r};n.push(s),$(s);let l={id:j(),goalId:e,level:"L3",parentId:s.id,name:`${t}_per_task`,description:`Per-task instant metric for ${t}`,weight:.4,calibrationFactor:1,createdAt:r};return n.push(l),$(l),n}var ee=class{static collect(t,r){let n=h(t);if(!n)return this.emptyMetrics(t,r);let o=J(t,500,0),i=n.completedAt&&n.startedAt?n.completedAt-n.startedAt:0,s=new Set,l=0,d=0;for(let m of o)m.type==="tool_call"&&m.toolName&&s.add(m.toolName),m.type==="error"&&l++,m.type==="approval_request"&&d++;let u={taskId:t,goalId:r,timestamp:Date.now(),durationMs:i,costUsd:n.costUsd??0,turns:n.numTurns??0,toolCount:s.size,errorCount:l,approvalCount:d,rawScore:0,isComplete:n.status==="completed"};return u.rawScore=this.computeRawScore(u),u}static computeRawScore(t){let n=1-Math.min(t.durationMs/6e5,1),i=1-Math.min(t.costUsd/5,1),l=1-Math.min(t.turns/50,1),d;t.toolCount>=3&&t.toolCount<=15?d=1:t.toolCount<3?d=t.toolCount/3:d=Math.max(0,1-(t.toolCount-15)/15);let u=t.errorCount===0?1:Math.max(0,1-t.errorCount*.2),m=Math.min(1,.5+t.approvalCount*.25);return .3*n+.2*i+.2*l+.1*d+.15*u+.05*m}static cache=new Map;static persist(t){this.cache.set(t.taskId,t)}static getCached(t){return this.cache.get(t)}static clearCache(){this.cache.clear()}static emptyMetrics(t,r){return{taskId:t,goalId:r,timestamp:Date.now(),durationMs:0,costUsd:0,turns:0,toolCount:0,errorCount:0,approvalCount:0,rawScore:0,isComplete:!1}}};ce();function yt(e){return{id:e.id,strategyId:e.strategy_id,goalId:e.goal_id,taskId:e.task_id??void 0,reward:e.reward??void 0,metricL2Score:e.metric_l2_score??void 0,metricL3Score:e.metric_l3_score??void 0,context:e.context??void 0,completedAt:e.completed_at}}function He(e){b().prepare(`
|
|
27
|
-
INSERT INTO trials (id, strategy_id, goal_id, task_id, reward,
|
|
28
|
-
metric_l2_score, metric_l3_score, context, completed_at)
|
|
29
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
30
|
-
`).run(e.id,e.strategyId,e.goalId,e.taskId??null,e.reward??null,e.metricL2Score??null,e.metricL3Score??null,e.context??null,e.completedAt)}function Ye(e,t=100){return b().prepare("SELECT * FROM trials WHERE goal_id = ? ORDER BY completed_at DESC LIMIT ?").all(e,t).map(yt)}var te=class{static collect(t){let r=k(t);if(!r)return this.emptyMetrics(t);let n=Date.now(),o=r.targetValue>0?Math.min(r.currentValue/r.targetValue,1):0,i=Math.max(0,(r.deadline-n)/(1e3*60*60*24)),s=this.calculateBudgetSpent(t),l=r.budgetUsd>0?Math.max(0,1-s/r.budgetUsd):1,d=this.calculateExpectedCompletion(r),u={goalId:t,metricType:r.metricType,targetValue:r.targetValue,currentValue:r.currentValue,progressPct:o,deadlineRemainingDays:i,budgetRemainingPct:l,expectedCompletionPct:d,rawScore:0};return u.rawScore=this.computeRawScore(u),u}static computeRawScore(t){let r=Math.min(t.progressPct,1),n;t.expectedCompletionPct>=1?n=1:t.expectedCompletionPct>=.8?n=.5+(t.expectedCompletionPct-.8)*2.5:n=t.expectedCompletionPct*.625;let o=t.budgetRemainingPct;return .5*r+.3*n+.2*o}static calculateExpectedCompletion(t){let r=Date.now(),n=t.deadline-t.createdAt,o=r-t.createdAt;if(n<=0)return 0;let i=o/n;if(i<.1)return .5;let s=t.targetValue>0?t.currentValue/t.targetValue:0;return i>0?s/i:0}static calculateBudgetSpent(t){let r=Ye(t,1e3),n=0,o=new Set;for(let i of r)if(i.taskId&&!o.has(i.taskId)){o.add(i.taskId);let s=h(i.taskId);s?.costUsd&&(n+=s.costUsd)}return n}static emptyMetrics(t){return{goalId:t,metricType:"",targetValue:0,currentValue:0,progressPct:0,deadlineRemainingDays:0,budgetRemainingPct:0,expectedCompletionPct:0,rawScore:0}}};C();var wt=w("agent"),O=class{static cache=new Map;static CACHE_TTL=1440*60*1e3;static async callClaude(t){let o=(await Z(t,'You are an AI quality evaluator. Respond with JSON: {"score": 0-1, "confidence": 0-1, "reasoning": "..."}')).match(/\{[\s\S]*\}/);if(!o)throw new Error("Failed to parse LLM Judge response as JSON");let i=JSON.parse(o[0]);return{score:Math.max(0,Math.min(1,i.score??0)),confidence:Math.max(.3,Math.min(.95,i.confidence??.5)),reasoning:i.reasoning??"No reasoning provided"}}static async evaluate(t,r){let n=`${t}:${r}`,o=this.cache.get(n);if(o&&Date.now()-o.evaluatedAt<this.CACHE_TTL)return o;let i=h(t);if(!i){let g={taskId:t,criteria:r,score:0,confidence:.3,reasoning:"Task not found",evaluatedAt:Date.now()};return this.cache.set(n,g),g}let s=this.getPromptTemplate(i.prompt??"",i.result??i.error??"",r),l,d,u;try{let g=await this.callClaude(s);l=g.score,d=g.confidence,u=g.reasoning}catch(g){wt.warn({error:g,taskId:t},"LLM Judge Claude API call failed, using heuristic fallback"),i.status==="failed"?(l=.1,d=.6,u=`Task failed: ${i.error??"unknown error"} (heuristic fallback)`):i.status==="completed"&&i.result?(l=.7,d=.5,u="Task completed with result (heuristic fallback due to API error)"):i.status==="completed"?(l=.5,d=.4,u="Task completed without explicit result (heuristic fallback)"):(l=.3,d=.3,u=`Task in status: ${i.status} (heuristic fallback)`)}let m={taskId:t,criteria:r,score:l,confidence:d,reasoning:u,evaluatedAt:Date.now()};return this.cache.set(n,m),m}static shouldUseObjective(t){let r=h(t);return r?r.status==="completed"&&r.costUsd!==void 0&&r.numTurns!==void 0:!1}static clearCache(){this.cache.clear()}static getPromptTemplate(t,r,n){return`You are an expert evaluator. Evaluate the following task result against these criteria:
|
|
31
|
-
|
|
32
|
-
Task: ${t}
|
|
33
|
-
Result: ${r}
|
|
34
|
-
Criteria: ${n}
|
|
35
|
-
|
|
36
|
-
Provide:
|
|
37
|
-
1. Score (0-1): How well did the task meet the criteria?
|
|
38
|
-
2. Confidence (0-1): How confident are you in this evaluation?
|
|
39
|
-
3. Reasoning: Brief explanation of your scoring
|
|
40
|
-
|
|
41
|
-
Respond in JSON: {"score": number, "confidence": number, "reasoning": "string"}`}};var vt={L0:.2,L1:.15,L2:.35,L3:.3},re=class e{goalId;nodes;children;constructor(t,r){this.goalId=t,this.nodes=new Map(r.map(n=>[n.id,n])),this.children=new Map;for(let n of r){let o=n.parentId,i=this.children.get(o)??[];i.push(n),this.children.set(o,i)}this.validateAcyclicity()}validateAcyclicity(){for(let t of this.nodes.values()){if(t.parentId&&!this.nodes.has(t.parentId))continue;let r=new Set,n=t.id;for(;n;){if(r.has(n))throw new Error(`Cycle detected in metric tree at node ${n}`);r.add(n),n=this.nodes.get(n)?.parentId}}}static buildFromGoal(t){let r=We(t);return new e(t,r)}static fromNodes(t,r){return new e(t,r)}queryPath(t){let r=[];for(let n of this.nodes.values())n.level===t&&r.push(n);return r.sort((n,o)=>o.weight-n.weight)}aggregateScores(t,r){let n=this.queryPath(t);if(n.length===0)return 0;let o=0,i=0;for(let s of n){let l=r.get(s.id)??0,d=s.weight*s.calibrationFactor;o+=l*d,i+=d}return i>0?o/i:0}getWeightedScore(t){let r=0;for(let[n,o]of Object.entries(vt)){let i=this.aggregateScores(n,t);r+=i*o}return Math.max(0,Math.min(1,r))}getNodeCount(){return this.nodes.size}getChildren(t){return this.children.get(t)??[]}};C();var on=w("agent");function ne(e,t){let r=Date.now(),n=re.buildFromGoal(e),o=new Map,i=te.collect(e);for(let d of n.queryPath("L0"))o.set(d.id,i.rawScore);let s=It(n);if(t){let d=ee.collect(t,e);if(d.isComplete){for(let m of n.queryPath("L3"))o.set(m.id,d.rawScore);let u=n.getNodeCount()>0?n.getWeightedScore(o):Math.max(0,Math.min(1,d.rawScore*.65+i.rawScore*.35));return{goalId:e,taskId:t,reward:u,breakdown:{L0:i.rawScore,L1:0,L2:0,L3:d.rawScore},calibrationFactors:s,source:"objective",confidence:.9,computedAt:r}}}if(t&&!O.shouldUseObjective(t)){let u=O.evaluate(t,"general_quality"),m=i.rawScore*.5+.5*.5;return{goalId:e,taskId:t,reward:i.rawScore,breakdown:{L0:i.rawScore,L1:0,L2:0,L3:0,llmJudge:.5},calibrationFactors:s,source:"llm_judge",confidence:.4,computedAt:r}}let l=n.getNodeCount()>0?n.getWeightedScore(o):i.rawScore;return{goalId:e,reward:l,breakdown:{L0:i.rawScore,L1:0,L2:0,L3:0},calibrationFactors:s,source:"fallback",confidence:.3,computedAt:r}}function It(e){let t={L0:1,L1:1,L2:1,L3:1};for(let r of["L0","L1","L2","L3"]){let n=e.queryPath(r);n.length>0&&(t[r]=n[0].calibrationFactor)}return t}import{v4 as Ze}from"uuid";ce();function oe(e){return{id:e.id,roleId:e.role_id,taskType:e.task_type,name:e.name,promptTemplate:e.prompt_template,alpha:e.alpha,beta:e.beta,totalTrials:e.total_trials,avgReward:e.avg_reward??void 0,createdAt:e.created_at,updatedAt:e.updated_at??void 0}}function ze(e){b().prepare(`
|
|
42
|
-
INSERT INTO strategies (id, role_id, task_type, name, prompt_template,
|
|
43
|
-
alpha, beta, total_trials, avg_reward, created_at, updated_at)
|
|
44
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
45
|
-
`).run(e.id,e.roleId,e.taskType,e.name,e.promptTemplate,e.alpha,e.beta,e.totalTrials,e.avgReward??null,e.createdAt,e.updatedAt??null)}function Ke(e){let r=b().prepare("SELECT * FROM strategies WHERE id = ?").get(e);return r?oe(r):void 0}function ln(e=100){return b().prepare("SELECT * FROM strategies ORDER BY created_at LIMIT ?").all(e).map(oe)}function Qe(e){return b().prepare("SELECT * FROM strategies WHERE role_id = ? ORDER BY created_at").all(e).map(oe)}function M(e,t){return b().prepare("SELECT * FROM strategies WHERE role_id = ? AND task_type = ? ORDER BY created_at").all(e,t).map(oe)}function Xe(e,t){b().prepare(`
|
|
46
|
-
UPDATE strategies
|
|
47
|
-
SET alpha = alpha + ?,
|
|
48
|
-
beta = beta + ?,
|
|
49
|
-
total_trials = total_trials + 1,
|
|
50
|
-
avg_reward = CASE
|
|
51
|
-
WHEN total_trials = 0 THEN ?
|
|
52
|
-
ELSE (avg_reward * total_trials + ?) / (total_trials + 1)
|
|
53
|
-
END,
|
|
54
|
-
updated_at = ?
|
|
55
|
-
WHERE id = ?
|
|
56
|
-
`).run(t,1-t,t,t,Date.now(),e)}var F=class{static sampleBeta(t,r){let n=this.sampleGamma(t,1),o=this.sampleGamma(r,1);return n/(n+o)}static sampleGamma(t,r){if(t<1)return this.sampleGamma(t+1,r)*Math.pow(Math.random(),1/t);let n=t-1/3,o=1/Math.sqrt(9*n);for(;;){let i,s;do i=this.randn(),s=1+o*i;while(s<=0);s=s*s*s;let l=Math.random();if(l<1-.0331*i*i*i*i||Math.log(l)<.5*i*i+n*(1-s+Math.log(s)))return n*s/r}}static randn(){let t=Math.random(),r=Math.random();return Math.sqrt(-2*Math.log(t))*Math.cos(2*Math.PI*r)}static sample(t){if(t.length===0)return null;let r=null,n=-1;for(let o of t){let i=this.sampleBeta(o.alpha,o.beta);i>n&&(n=i,r=o)}return r}static getProbabilities(t,r=1e4){let n=new Map;for(let i=0;i<r;i++){let s=this.sample(t);s&&n.set(s.id,(n.get(s.id)||0)+1)}let o=new Map;for(let[i,s]of n)o.set(i,s/r);return o}};var Tt=5,ye=20,et=.5,v=class{static selectStrategy(t,r){let n=M(t,r);return F.sample(n)}static recordTrial(t,r,n,o,i,s,l){Xe(t,o),He({id:Ze(),strategyId:t,goalId:r,taskId:n,reward:o,metricL2Score:i,metricL3Score:s,context:l,completedAt:Date.now()})}static getStrategies(t,r){return M(t,r)}static getStrategyById(t){return Ke(t)}static getPopulationStats(t,r){let n=M(t,r);if(n.length===0)return{count:0,avgTrials:0,avgReward:0,minTrials:0,maxTrials:0};let i=n.reduce((d,u)=>d+u.totalTrials,0)/n.length,s=n.filter(d=>d.avgReward!==void 0).map(d=>d.avgReward),l=s.length>0?s.reduce((d,u)=>d+u,0)/s.length:0;return{count:n.length,avgTrials:i,avgReward:l,minTrials:Math.min(...n.map(d=>d.totalTrials)),maxTrials:Math.max(...n.map(d=>d.totalTrials))}}static shouldEvolve(t,r){let n=this.getPopulationStats(t,r);return n.count<Tt?!0:n.count<ye&&n.maxTrials>0}static addStrategy(t,r,n,o){if(M(t,r).length>=ye)throw new Error(`Strategy population at maximum (${ye}) for ${t}/${r}`);let s={id:`strat-${Ze().slice(0,8)}`,roleId:t,taskType:r,name:n,promptTemplate:o,alpha:et,beta:et,totalTrials:0,createdAt:Date.now()};return ze(s),s}static getTopStrategies(t,r,n=3){let i=M(t,r).filter(s=>s.totalTrials>0);return i.sort((s,l)=>(l.avgReward??0)-(s.avgReward??0)),i.slice(0,n)}static getSamplingProbabilities(t,r){let n=M(t,r);return F.getProbabilities(n)}static evaluateAndRecord(t,r,n,o,i,s){let l=ne(r,n);return this.recordTrial(t,r,n,l.reward,o,i,s),l.reward}};var St=3,kt=2,ae=class{static async generateVariants(t,r,n=St,o=kt){let i=v.getTopStrategies(t,r,n);if(i.length===0){let l=`baseline-${r}-v1`;return v.addStrategy(t,r,l,this.generateBaselinePrompt(t,r)),[l]}let s=[];for(let l=0;l<o;l++){let d=i[0].totalTrials+l+1,u=`${r}-evolved-v${d}`,m=i[0].promptTemplate,g=this.mutateTemplate(m);v.addStrategy(t,r,u,g),s.push(u)}return s}static generateBaselinePrompt(t,r){return`You are a ${t} agent specializing in ${r}.
|
|
57
|
-
|
|
58
|
-
## Core Focus
|
|
59
|
-
Complete tasks with high quality.
|
|
60
|
-
|
|
61
|
-
## Approach
|
|
62
|
-
1. Understand the task requirements thoroughly
|
|
63
|
-
2. Plan your approach before executing
|
|
64
|
-
3. Execute systematically, checking your work
|
|
65
|
-
4. Verify completion against requirements`}static mutateTemplate(t){let r=[this.addProcessEmphasis(),this.addQualityFocus(),this.addVerificationStep()],n=r[Math.floor(Math.random()*r.length)];return`${t}
|
|
66
|
-
|
|
67
|
-
## Evolution
|
|
68
|
-
${n}`}static addProcessEmphasis(){let t=["Break down complex tasks into smaller steps","Iterate on solutions, testing each component","Document your reasoning at each step"];return`**Process:** ${t[Math.floor(Math.random()*t.length)]}`}static addQualityFocus(){let t=["Double-check all outputs before completing","Consider edge cases and error conditions","Optimize for correctness over speed"];return`**Quality:** ${t[Math.floor(Math.random()*t.length)]}`}static addVerificationStep(){return"**Verification:** After completing, verify your work meets all requirements."}static async generateWithLLM(t,r,n){return{promptTemplate:this.generateBaselinePrompt(t,r),rationale:"Generated baseline - LLM integration in Phase 5"}}};C();Ae();import{v4 as y}from"uuid";import{spawnSync as tt}from"child_process";import{createRequire as Rt}from"module";import{dirname as _t,join as rt}from"path";import{openSync as Mt,readFileSync as xt,unlinkSync as Lt}from"fs";var Pt=3e4,nt=12e4;function ot(){let t=Rt(import.meta.url).resolve("@anthropic-ai/claude-agent-sdk");return rt(_t(t),"cli.js")}function G(e,t){let r=ot(),n=t?.timeout??Pt;if(t?.json){let i=rt("/tmp",`adam-cli-stdout-${process.pid}-${Date.now()}.txt`),s=Mt(i,"w");try{let l=tt("node",[r,...e],{cwd:t.cwd,timeout:n,stdio:["ignore",s,"pipe"],encoding:"utf-8"});if(l.status!==0)throw new Error(l.stderr?.trim()||`CLI exited with status ${l.status}`);return xt(i,"utf-8")}finally{try{Lt(i)}catch{}}}let o=tt("node",[r,...e],{cwd:t?.cwd,timeout:n,encoding:"utf-8"});if(o.status!==0)throw new Error(o.stderr?.trim()||`CLI exited with status ${o.status}`);return o.stdout}function at(){let e=G(["plugin","list","--available","--json"],{json:!0});return JSON.parse(e)}function we(e,t="user",r){return G(["plugin","install",e,"--scope",t],{cwd:r,timeout:nt})}function ve(e,t,r){let n=["plugin","uninstall",e];return t&&n.push("--scope",t),G(n,{cwd:r,timeout:nt})}function it(e,t){return G(["plugin","enable",e])}function st(e,t){return G(["plugin","disable",e])}function Sn(){try{return!!ot()}catch{return!1}}C();import*as lt from"crypto";var V=w("api"),B=class{cancelTask(t){let r=h(t);r&&(E(t,{status:"cancelled",completedAt:Date.now()}),me.emit({type:"task_status_change",taskId:t,oldStatus:r.status,newStatus:"cancelled"}),V.debug({taskId:t,oldStatus:r.status},"Task cancelled"))}resolveApproval(t,r,n){return V.debug({approvalId:t,action:r,reason:n},"Approval resolved (no-op in Pure C)"),!0}resolvePlanApproval(t,r,n,o){let i=_e(t);if(!i)return V.warn({planId:t},"Plan not found or already resolved"),!1;let s=h(i.taskId);return s?(Me(t,r==="allow"?"approved":"denied",n),r==="allow"&&n==="permanent"&&xe({id:lt.randomUUID(),roleId:i.roleId,taskPattern:s.prompt.slice(0,100).replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),maxRiskLevel:i.plan.overallRisk,createdAt:Date.now(),createdByTaskId:s.id}),me.emit({type:"plan_approval_decision",taskId:s.id,planId:t,decision:r,approvalType:n,reason:o}),V.debug({planId:t,decision:r,approvalType:n},"Plan approval resolved"),!0):(V.warn({planId:t},"Task not found for plan"),!1)}};import{existsSync as At}from"fs";function ct(e,t){return t?{allowedTools:Et(t.allowedTools,e.allowedTools),disallowedTools:Ie(e.disallowedTools,t.disallowedTools),approvalRequired:Ie(e.approvalRequired,t.approvalRequired),maxBudgetUsd:t.maxBudgetUsd!==void 0&&t.maxBudgetUsd>0?Math.min(t.maxBudgetUsd,e.maxBudgetUsd):e.maxBudgetUsd,plugins:Ie(e.plugins??[],t.plugins)}:{allowedTools:e.allowedTools,disallowedTools:e.disallowedTools,approvalRequired:e.approvalRequired,maxBudgetUsd:e.maxBudgetUsd,plugins:e.plugins??[]}}function Et(e,t){if(e===void 0)return t;if(e.length===0)return[];if(t.length===0)return e;let r=new Set(t);return e.filter(n=>r.has(n))}function Ie(e,t){return t===void 0?e:[...new Set([...e,...t])]}var ie=w("manager");function c(e){return{content:[{type:"text",text:JSON.stringify(e)}]}}async function R(e){let{listChannels:t}=await import("./channels-WZOYE4O4.js"),r=t(),{listSessions:n}=await import("./session-manager-Z6MIYRD3.js"),o=[...n("active"),...n("archived")],i=[];for(let s of e)if(s.type==="session"&&s.sessionId)i.push({type:"session",sessionId:s.sessionId});else if(s.type==="channel"){let l=s.channelId,d=s.chatId;if(!l&&s.channelName){let u=r.find(m=>m.name.toLowerCase().includes(s.channelName.toLowerCase()));u&&(l=u.id)}if(l&&!d){let u=o.find(m=>m.source.type==="channel"&&m.source.channelId===l&&m.source.chatId);u?.source.chatId?d=u.source.chatId:d=r.find(g=>g.id===l)?.config?.userId}l&&d?i.push({type:"channel",channelId:l,chatId:d}):ie.warn({channelName:s.channelName,channelId:l,chatId:d},"Could not resolve channel notify target")}return i}async function Nt(e){let{listRoles:t}=await import("./roles-3UTFKSHI.js"),r=t(void 0,100,0);for(let n of r)if(n.name.toLowerCase().includes(e.toLowerCase()))return n.id}var Ut={goalId:a.string()},$t={goalId:a.string(),status:a.string().optional(),currentValue:a.number().optional(),budgetUsd:a.number().optional(),notes:a.string().optional()},jt={goalId:a.string(),goalDescription:a.string(),maxSubtasks:a.number().optional()},x=a.union([a.object({type:a.literal("session"),sessionId:a.string()}),a.object({type:a.literal("channel"),channelName:a.string()}),a.object({type:a.literal("channel"),channelId:a.string(),chatId:a.string().optional()})]),Ot={prompt:a.string(),roleId:a.string().describe("Role ID. Call list_roles first to find the best role for the task."),deliverTo:a.array(x).optional().describe("Where to deliver the task output (result full text). E.g., send result to a specific channel."),reportTo:a.array(x).optional().describe("Where to send status reports (completion summary). Defaults to the originating channel/session."),toolOverrides:a.object({allowedTools:a.array(a.string()).optional(),disallowedTools:a.array(a.string()).optional()}).optional()},Ft={taskId:a.string(),goalId:a.string().optional(),strategyId:a.string().optional()},Gt={roleId:a.string(),taskType:a.string(),name:a.string().optional()},Vt={status:a.string().optional(),limit:a.number().optional()},Bt={taskId:a.string(),roleId:a.string()},qt={taskId:a.string().optional(),status:a.string().optional(),limit:a.number().optional()},Wt={roleId:a.string(),allowedTools:a.array(a.string()).optional(),disallowedTools:a.array(a.string()).optional(),additionalDirectories:a.array(a.object({path:a.string(),mode:a.enum(["ro","rw"]).optional().describe("Read-only or read-write access. Default: rw. Enforced by OS sandbox."),inheritPlugins:a.boolean().optional(),inheritMcp:a.boolean().optional(),inheritPermissions:a.boolean().optional()})).optional(),allowedChannels:a.array(a.string()).optional(),inheritUserSettings:a.boolean().optional().describe("Enable/disable inheriting user-level settings (global plugins, MCP servers). Default: false (isolated).")},Jt={roleId:a.string().optional(),limit:a.number().optional()},Ht={name:a.string(),cagPrompt:a.string(),traits:a.array(a.string()).optional(),allowedTools:a.array(a.string()).optional(),disallowedTools:a.array(a.string()).optional(),additionalDirectories:a.array(a.object({path:a.string(),mode:a.enum(["ro","rw"]).optional().describe("Read-only or read-write access. Default: rw. Enforced by OS sandbox."),inheritPlugins:a.boolean().optional(),inheritMcp:a.boolean().optional(),inheritPermissions:a.boolean().optional()})).optional()},Yt={roleId:a.string(),reason:a.string().optional()},zt={name:a.string(),description:a.string().optional(),roleId:a.string().optional(),metric:a.string().optional(),targetValue:a.number().optional(),deadline:a.number().optional(),budgetUsd:a.number().optional(),deliverTo:a.array(x).optional().describe("Where to deliver goal completion notifications.")},Kt={name:a.string(),description:a.string().optional(),triggerType:a.enum(["cron","event"]),triggerCron:a.string().optional(),triggerEvent:a.string().optional(),prompt:a.string(),roleId:a.string().optional(),enabled:a.boolean().optional(),goalIds:a.array(a.string()).optional(),deliverTo:a.array(x).optional().describe("Where to deliver the task output (result full text)."),reportTo:a.array(x).optional().describe("Where to send status reports (completion summary).")},Qt={status:a.enum(["active","retired","probation"]).optional(),limit:a.number().optional()},Xt={enabled:a.boolean().optional()},Zt={},er={},tr={prompt:a.string().describe("The task prompt to execute after the delay"),delayMinutes:a.number().optional().describe("Minutes from now to execute (e.g., 30 for 'half an hour later')"),runAt:a.string().optional().describe("ISO 8601 timestamp to execute at (e.g., '2026-04-01T15:00:00+08:00')"),roleId:a.string().describe("Role ID to assign the task to. Call list_roles first."),deliverTo:a.array(x).optional().describe("Where to deliver the task output (result full text)."),reportTo:a.array(x).optional().describe("Where to send status reports (completion summary).")},rr={roleId:a.string().optional().describe("If provided, shows which plugins are installed in that role's workspace.")},nr={roleId:a.string().describe("Role ID to install the plugin under (project-scope)."),pluginId:a.string().describe("Plugin ID (e.g. 'github@anthropic'). Use list_available_plugins to discover available plugins.")},or={roleId:a.string().describe("Role ID to uninstall the plugin from."),pluginId:a.string().describe("Plugin ID to uninstall.")},ar={roleId:a.string().describe("Role ID to bind the MCP server to."),mcpName:a.string().describe("Name for this MCP server (e.g., 'github', 'filesystem')."),mcpConfig:a.record(a.string(),a.unknown()).describe("MCP server configuration object.")},ir={roleId:a.string().describe("Role ID to unbind the MCP server from."),mcpName:a.string().describe("Name of the MCP server to remove.")},sr={pluginId:a.string().describe("Plugin ID (e.g., 'github@anthropic').")},lr={pluginId:a.string().describe("Plugin ID (e.g., 'github@anthropic').")},cr={pluginId:a.string().describe("Plugin ID (e.g., 'github@anthropic').")},dr={pluginId:a.string().describe("Plugin ID (e.g., 'github@anthropic').")},ur={},pr={},mr={pluginId:a.string().describe("Plugin ID (e.g., 'github@anthropic').")},gr={roleId:a.string().describe("Role ID to associate scanned plugins with."),path:a.string().describe("Directory path to scan for .claude/settings.json.")},fr={taskId:a.string().describe("Task ID to cancel.")},hr={taskId:a.string().describe("Task ID to get logs for."),limit:a.number().optional().describe("Max log entries (default 20).")},br={roleId:a.string().describe("Role ID to delete.")},yr={},wr={updates:a.record(a.string(),a.unknown()).describe("Config key-value pairs to update. Example: { 'defaults.maxTurns': 50, 'logging.level': 'debug' }")},vr={roleId:a.string().describe("Role ID to list memories for."),limit:a.number().optional().describe("Max results (default 20).")},Ir={templateId:a.string().describe("Template ID to update."),name:a.string().optional(),enabled:a.boolean().optional(),prompt:a.string().optional(),triggerCron:a.string().optional(),triggerEvent:a.string().optional(),roleId:a.string().optional()},Tr={templateId:a.string().describe("Template ID to delete.")},Sr={templateId:a.string().describe("Template ID to run immediately.")},kr={enabled:a.boolean().optional().describe("Filter by enabled status.")},Rr={eventType:a.string().describe("Event type that triggers this rule (e.g., 'task_complete')."),channelId:a.string().describe("Channel ID to deliver to."),format:a.string().optional().describe("Format template (e.g., 'summary', 'full'). Default: 'summary'."),matchCriteria:a.record(a.string(),a.unknown()).optional().describe("JSON match criteria for event fields."),enabled:a.boolean().optional().describe("Enable this rule immediately (default true).")},_r={ruleId:a.string().describe("Delivery rule ID to delete.")},Mr={roleId:a.string().optional().describe("Role ID to filter strategies by.")},dt=[p("read_goal_state","Read a single goal's detailed state: progress percentage, time remaining, budget spent, and current value. Use this for deep-dive on one goal; use list_goals for an overview of all goals.",Ut,async e=>{let t=k(e.goalId);if(!t)return c({error:"Goal not found"});let r=Date.now(),n=t.targetValue>0?t.currentValue/t.targetValue:0;return c({id:t.id,name:t.name,description:t.description,roleId:t.roleId,metricType:t.metricType,targetValue:t.targetValue,currentValue:t.currentValue,deadline:t.deadline,budgetUsd:t.budgetUsd,status:t.status,progress:n,timeRemainingMs:Math.max(0,t.deadline-r),budgetRemainingUsd:t.budgetUsd})}),p("update_goal_state","Update a goal's status, current value, or budget.",$t,async e=>{let t={};return e.status&&(t.status=e.status),e.currentValue!==void 0&&(t.currentValue=e.currentValue),e.budgetUsd!==void 0&&(t.budgetUsd=e.budgetUsd),Object.keys(t).length>0&&(t.updatedAt=Date.now(),X(e.goalId,t)),c({success:!0})}),p("decompose_goal","Decompose a goal into actionable subtasks using LLM reasoning.",jt,async e=>{let t=I(),r=Math.min(e.maxSubtasks??5,10);try{let{query:o}=await import("@anthropic-ai/claude-agent-sdk"),i=`Decompose this goal into ${r} actionable subtasks.
|
|
69
|
-
|
|
70
|
-
Goal: ${e.goalDescription}
|
|
71
|
-
|
|
72
|
-
Respond ONLY with a JSON array. Each item: {"description": "...", "prompt": "detailed task instruction", "complexity": "low|medium|high", "role": "engineer|analyst|content_creator|reviewer"}
|
|
73
|
-
|
|
74
|
-
Rules:
|
|
75
|
-
- Each subtask must be independently executable
|
|
76
|
-
- Order from foundational to dependent
|
|
77
|
-
- Be specific about what each subtask should accomplish
|
|
78
|
-
- For each subtask, specify the best role from: 'engineer', 'analyst', 'content_creator', 'reviewer'. Match role to the nature of the work.`,s=o({prompt:i,options:{cwd:process.cwd(),maxTurns:1,maxBudgetUsd:.02}}),l="";for await(let u of s){let m=u;m.type==="result"&&typeof m.result=="string"&&(l=m.result)}let d=l.match(/\[[\s\S]*\]/);if(d){let u=JSON.parse(d[0]),m=[];for(let g=0;g<Math.min(u.length,r);g++){let f=u[g],q=`subtask-${y().slice(0,8)}`,P=f.role,se=P?await Nt(P):void 0;W({id:q,status:"pending",prompt:f.prompt,parentId:e.goalId,roleId:se,config:t.defaults,createdAt:Date.now()}),m.push({id:q,description:f.description,prompt:f.prompt,dependencies:g>0?[m[g-1].id]:[],estimatedComplexity:f.complexity??"medium",role:P})}if(m.length>0)return c({subtasks:m})}}catch(o){ie.error({error:o},"LLM decomposition failed, using fallback")}let n=[];for(let o=0;o<r;o++){let i=`subtask-${y().slice(0,8)}`,s=`Subtask ${o+1} of goal: ${e.goalDescription.slice(0,100)}`,l=`${e.goalDescription}
|
|
79
|
-
|
|
80
|
-
Subtask ${o+1}/${r}`;W({id:i,status:"pending",prompt:l,parentId:e.goalId,config:t.defaults,createdAt:Date.now()}),n.push({id:i,description:s,prompt:l,dependencies:o>0?[n[o-1].id]:[],estimatedComplexity:"medium"})}return c({subtasks:n})}),p("dispatch_task","Create and immediately dispatch a task to the execution pool. roleId is required \u2014 call list_roles first to find the best role. The assigned role determines which tools the worker can use. Pass deliverTo (result delivery) and/or reportTo (status reports) to route output when the task completes.",Ot,async e=>{let t=T(e.roleId);if(!t||t.status!=="active"){let le=A("active",20,0).filter(S=>S.source!=="system").map(S=>({id:S.id,name:S.name,allowedTools:S.allowedTools??[],capabilitySummary:U(S)}));return c({error:`Role not found or not active: ${e.roleId}. Pick a roleId from the list below.`,availableRoles:le})}let r=y(),n=I(),o=e.prompt.toLowerCase(),i={coding:["code","implement","fix","debug","refactor","build"],analysis:["analyze","data","report","statistics","investigate"],content:["write","translate","summarize","content","draft"],review:["review","check","audit","evaluate","assess"],admin:["config","permission","deploy","manage"]},s="general";for(let[le,S]of Object.entries(i))if(S.some(pt=>o.includes(pt))){s=le;break}let l,d=e.prompt,u=v.selectStrategy(e.roleId,s);u?.promptTemplate&&(d=`${u.promptTemplate}
|
|
81
|
-
|
|
82
|
-
## Task
|
|
83
|
-
${e.prompt}`,l=u.id);let m=t?{allowedTools:t.allowedTools,disallowedTools:t.disallowedTools,approvalRequired:t.approvalRequired,maxBudgetUsd:t.maxBudgetUsd,plugins:void 0}:void 0,g=ct(n.defaults,m),f=g.allowedTools;e.toolOverrides?.allowedTools&&(f=[...e.toolOverrides.allowedTools]);let q={...n.defaults,...g,allowedTools:f,disallowedTools:e.toolOverrides?.disallowedTools??g.disallowedTools},P=e.deliverTo?await R(e.deliverTo):void 0,se=e.reportTo?await R(e.reportTo):void 0;W({id:r,status:"pending",prompt:d,roleId:e.roleId,deliverTo:P,reportTo:se,config:q,createdAt:Date.now()});let{serverBus:ut}=await import("./server-bus-GEGVMSCA.js");return ut.emit({type:"task_created",taskId:r}),c({taskId:r,roleId:e.roleId,strategyId:l})}),p("evaluate_result","Evaluate a completed task's result and record a trial for Thompson Sampling.",Ft,async e=>{let{goalId:t,taskId:r,strategyId:n}=e,o=ne(t??"",r);return n&&t&&v.recordTrial(n,t,r,o.reward,o.breakdown.L2||void 0,o.breakdown.L3||void 0,"Evaluated via adam-tools"),c({reward:o.reward,metricL2Score:o.breakdown.L2||void 0,metricL3Score:o.breakdown.L3||void 0,source:o.source,reasoning:`Evaluated via ${o.source} with confidence ${o.confidence.toFixed(2)}`})}),p("create_strategy","Create a new strategy variant for a role/taskType using LLM evolution.",Gt,async e=>{let{roleId:t,taskType:r}=e;await ae.generateVariants(t,r,3,1);let n=v.getStrategies(t,r),o=n[n.length-1];return c(o?{id:o.id,name:o.name,promptTemplate:o.promptTemplate}:{error:`Failed to create strategy for ${t}/${r}`})}),p("list_goals","List all goals with progress percentage, budget, deadline, and time remaining. Goal statuses: active (in progress), paused, completed, failed. Use this to check current goal status before making decisions.",Vt,async e=>{let t=e.status;return c(Fe(t,e.limit??10,0))}),p("delete_goal","Delete a goal by ID.",{goalId:a.string()},async e=>k(e.goalId)?(Ge(e.goalId),c({success:!0,goalId:e.goalId})):c({error:"Goal not found"})),p("pause_goal","Pause an active goal.",{goalId:a.string()},async e=>k(e.goalId)?(X(e.goalId,{status:"paused",updatedAt:Date.now()}),c({success:!0,goalId:e.goalId,status:"paused"})):c({error:"Goal not found"})),p("assign_role","Assign a role to a pending task.",Bt,async e=>{let{taskId:t,roleId:r}=e;if(!h(t))return c({error:`Task not found: ${t}`});let o=T(r);return o?(E(t,{roleId:r}),ie.debug({taskId:t,roleId:r,roleName:o.name},"Role assigned to task"),c({success:!0,taskId:t,roleId:r})):c({error:`Role not found: ${r}`})}),...Ve(),p("read_task_status","Read a single task's details (prompt, status, result, roleId) by ID, or list all tasks filtered by status (pending, running, completed, failed). Use this to check task progress and results.",qt,async e=>{if(e.taskId){let r=h(e.taskId);return c(r??{error:"Task not found"})}let t=e.status;return c(L(t,e.limit??100,0))}),p("modify_role_permissions","Update a role's RBAC permissions (paths, tools).",Wt,async e=>{if(!T(e.roleId))return c({error:`Role not found: ${e.roleId}`});let r={};return e.allowedTools&&(r.allowedTools=e.allowedTools),e.disallowedTools&&(r.disallowedTools=e.disallowedTools),e.additionalDirectories!==void 0&&(r.additionalDirectories=e.additionalDirectories),e.allowedChannels!==void 0&&(r.allowedChannels=e.allowedChannels),"inheritUserSettings"in e&&(r.inheritUserSettings=e.inheritUserSettings),D(e.roleId,r),c({success:!0})}),p("view_audit_log","View the evolution audit log for role changes.",Jt,async e=>{let{listEvolutionAudit:t}=await import("./evolution-audit-KUBXFUHI.js"),r=t(e.limit??50);return c({entries:r})}),p("list_roles","List all roles with their capabilities including bound plugins (skills/agents). Use this to discover available roles before dispatching tasks.",Qt,async e=>{let r=A(e.status,e.limit??50,0).map(n=>{let o=he(n);return{id:n.id,name:n.name,status:n.status,allowedTools:n.allowedTools??[],disallowedTools:n.disallowedTools??[],additionalDirectories:n.additionalDirectories??[],cagPrompt:n.cagPrompt.slice(0,500)+(n.cagPrompt.length>500?"...":""),capabilitySummary:U(n,o),plugins:o.plugins.map(i=>({name:i.name,skills:i.skills.map(s=>s.name),agents:i.agents.map(s=>s.name)}))}});return c({roles:r})}),p("create_role","Create a new role with a name, CAG prompt, and optional tool permissions.",Ht,async e=>{let t=`role-${y().slice(0,8)}`,r={id:t,name:e.name,cagPrompt:e.cagPrompt,learnedRules:[],memoryStreamId:`mem-${y().slice(0,8)}`,status:"active",preferences:{},createdAt:Date.now(),allowedTools:e.allowedTools,disallowedTools:e.disallowedTools,additionalDirectories:e.additionalDirectories};return ke(r),Y(r),c({roleId:t,name:e.name,allowedTools:e.allowedTools,additionalDirectories:e.additionalDirectories??[]})}),p("retire_role","Retire a role (marks as retired, stops receiving tasks).",Yt,async e=>T(e.roleId)?(D(e.roleId,{status:"retired"}),ie.info({roleId:e.roleId,reason:e.reason},"Role retired"),c({success:!0})):c({error:`Role not found: ${e.roleId}`})),p("create_goal","Create a new goal with optional budget, deadline, and metric tracking.",zt,async e=>{let t=y(),r=Date.now(),n=r+10080*60*1e3,o={id:t,name:e.name,description:e.description,roleId:e.roleId??"engineer",metricType:e.metric??"completion",targetValue:e.targetValue??1,currentValue:0,deadline:e.deadline??n,budgetUsd:e.budgetUsd??5,status:"active",createdAt:r,deliverTo:e.deliverTo?await R(e.deliverTo):void 0};Q(o),Je(t,o.metricType);let i=k(t);return c({goalId:i.id,name:i.name,status:i.status})}),p("create_template","Create a recurring scheduled task using cron expressions (e.g., 'every hour', 'daily at 9am', 'weekly'). For one-shot delayed tasks ('in 30 minutes', 'tomorrow at 3pm'), use schedule_task instead.",Kt,async e=>{let{createTaskTemplate:t}=await import("./task-templates-PSP7GOJJ.js"),r=y(),n=y(),o=e.deliverTo?await R(e.deliverTo):void 0,i=e.reportTo?await R(e.reportTo):void 0,s={id:r,name:e.name,description:e.description,trigger:{type:e.triggerType,cron:e.triggerCron,event:e.triggerEvent},steps:[{id:n,prompt:e.prompt}],rolePreference:e.roleId,enabled:e.enabled??!0,createdAt:Date.now(),goalIds:e.goalIds,deliverTo:o,reportTo:i};return t(s),c({templateId:r,name:s.name,trigger:s.trigger})}),p("list_templates","List task templates (automations). Use this to check existing scheduled/recurring tasks before creating new ones.",{enabled:a.boolean().optional().describe("Filter by enabled status. Omit to list all."),limit:a.number().optional().describe("Max results (default 50)")},async e=>{let{listTaskTemplates:t}=await import("./task-templates-PSP7GOJJ.js"),r=t(e.enabled,e.limit??50,0);return c(r.map(n=>({id:n.id,name:n.name,description:n.description,trigger:n.trigger,enabled:n.enabled,rolePreference:n.rolePreference,deliverTo:n.deliverTo,createdAt:n.createdAt})))}),p("send_to_channel","Send a message (text, image, voice, video, file) to a connected channel by name. Use this to deliver task results, media, or notifications to a specific channel (e.g., WeChat on iPad). For media: provide mediaUrl as an absolute local file path and mediaType. Do NOT use remote URLs \u2014 download files locally first.",{channelName:a.string().describe("The channel name, e.g., 'WeChat on iPad'"),message:a.string().describe("The message content to send (text caption when sending media)"),mediaUrl:a.string().optional().describe("Absolute local file path to the media file (e.g. /Users/.../file.png). Must exist on disk. Do NOT use remote URLs \u2014 download files locally first."),mediaType:a.enum(["image","audio","video","file"]).optional().describe("Type of the media file. Required when mediaUrl is provided")},async e=>{if(e.mediaUrl){if(e.mediaUrl.includes("://")&&!e.mediaUrl.startsWith("file://"))return c({error:`mediaUrl must be a local file path, not a remote URL. Got: ${e.mediaUrl.slice(0,80)}. Download the file to a local path first, then pass the local path.`});let s=e.mediaUrl.startsWith("file://")?new URL(e.mediaUrl).pathname:e.mediaUrl;if(!At(s))return c({error:`Media file not found: ${s}. Verify the file exists before sending.`});if(!e.mediaType)return c({error:"mediaType is required when mediaUrl is provided. Specify one of: image, audio, video, file."})}let t=await R([{type:"channel",channelName:e.channelName}]);if(t.length===0)return c({error:`Channel "${e.channelName}" not found or no chatId available`});let r=t[0];if(r.type!=="channel")return c({error:"Resolved target is not a channel"});let{getOutboundGateway:n}=await import("./outbound-gateway-6FQRWYFF.js"),i=await n().send({channelId:r.channelId,chatId:r.chatId,content:e.message,messageType:"deliver",mediaUrl:e.mediaUrl,mediaType:e.mediaType});return c({success:i.success,channelName:e.channelName,...i.error?{error:i.error}:{}})}),p("list_channels","List all connected channels with their platform, status, and chatId for message delivery. Use this to discover available channels before sending messages or setting up notifications.",Xt,async e=>{let t=ge(e.enabled),r=[...fe("active"),...fe("archived")],n=t.map(o=>{let i,s=r.find(l=>l.source.type==="channel"&&l.source.channelId===o.id&&l.source.chatId);return s?.source.chatId?i=s.source.chatId:i=o.config?.userId,{id:o.id,name:o.name,platform:o.platform,status:o.status,chatId:i}});return c({channels:n})}),p("get_system_status","Get current system status: execution pool capacity (active/max/queued slots), running task count, and system health. Use this to check if the system has capacity before dispatching tasks.",Zt,async()=>{let e=I(),t=L("running"),r=L("pending");return c({executionPool:{active:t.length,max:e.execution?.maxConcurrent??5,queued:r.length},timestamp:new Date().toISOString()})}),p("schedule_task","Schedule a one-shot delayed task. roleId is required \u2014 call list_roles first. Use this when the user wants something done later (e.g., '\u534A\u5C0F\u65F6\u540E', 'in 30 minutes', 'tomorrow at 3pm'). For recurring schedules ('every day', 'weekly'), use create_template instead.",tr,async e=>{let t=T(e.roleId);if(!t||t.status!=="active"){let g=A("active",20,0).filter(f=>f.source!=="system").map(f=>({id:f.id,name:f.name,allowedTools:f.allowedTools??[],capabilitySummary:U(f)}));return c({error:`Role not found or not active: ${e.roleId}. Pick a roleId from the list below.`,availableRoles:g})}let r=Date.now(),n;if(e.delayMinutes!==void 0&&e.runAt!==void 0)return c({error:"Provide exactly one of delayMinutes or runAt, not both"});if(e.delayMinutes!==void 0)n=r+e.delayMinutes*60*1e3;else if(e.runAt!==void 0){if(n=new Date(e.runAt).getTime(),isNaN(n))return c({error:"Invalid ISO 8601 timestamp in runAt"})}else return c({error:"Provide either delayMinutes or runAt"});if(n<=r)return c({error:"Scheduled time must be in the future"});let o=10080*60*1e3;if(n-r>o)return c({error:"Schedule exceeds maximum of 7 days"});let i=y(),s=new Date(n).toISOString(),l=e.deliverTo?await R(e.deliverTo):void 0,d=e.reportTo?await R(e.reportTo):void 0;Ue({id:i,name:e.prompt.slice(0,80),description:`One-shot scheduled task: ${e.prompt.slice(0,200)}`,trigger:{type:"once",runAt:s},steps:[{id:"main",prompt:e.prompt}],rolePreference:e.roleId,config:{...I().defaults},tags:["scheduled","once"],enabled:!0,createdAt:r,deliverTo:l,reportTo:d});let{getBreeEngine:u}=await import("./bree-engine-EKZFCS4Q.js"),m=u();return m&&m.scheduleOnceJob(i),c({templateId:i,executeAt:s,prompt:e.prompt})}),p("cancel_scheduled_task","Cancel a previously scheduled one-shot task by its template ID. The task will not execute.",{templateId:a.string().describe("The template ID returned by schedule_task")},async e=>{let t=N(e.templateId);if(!t)return c({error:`Template not found: ${e.templateId}`});if(t.trigger.type!=="once")return c({error:"This is not a one-shot scheduled task. Use disable_template for recurring automations."});je(e.templateId);let{getBreeEngine:r}=await import("./bree-engine-EKZFCS4Q.js"),n=r();return n&&await n.unscheduleJob(e.templateId),c({cancelled:!0,templateId:e.templateId})}),p("list_available_plugins","List all installed plugins with their scope and global enabled state. If roleId is provided, shows which plugins are installed in that role's workspace.",rr,async e=>{let t=Le(),r=K(),n=e.roleId?(()=>{let{getRoleWorkspacePath:o}=(z(),_(ue)),{getRole:i}=(H(),_(de)),{listInstalledPlugins:s}=(Ae(),_(mt)),l=i(e.roleId);if(!l)return[];let d=o(l.name);return s({scope:"project",projectPath:d}).map(u=>u.id)})():[];return c({plugins:r.map(o=>({id:o.id,name:o.name,scope:o.scope,projectPath:o.projectPath,enabled:o.enabled,globalEnabled:t[o.id]??o.enabled,isInstalledInRole:n.includes(o.id),description:o.version?`v${o.version}`:void 0}))})}),p("install_plugin_for_role","Install a plugin into a role's workspace (project-scope). The plugin will be available when that role executes tasks.",nr,async e=>{let{getRole:t}=(H(),_(de)),{getRoleWorkspacePath:r}=(z(),_(ue)),n=t(e.roleId);if(!n)return c({error:`Role not found: ${e.roleId}`});let o=r(n.name);try{return we(e.pluginId,"project",o),c({success:!0,roleId:e.roleId,pluginId:e.pluginId,scope:"project",cwd:o})}catch(i){return c({error:`Failed to install plugin: ${i}`})}}),p("uninstall_plugin_from_role","Uninstall a plugin from a role's workspace.",or,async e=>{let{getRole:t}=(H(),_(de)),{getRoleWorkspacePath:r}=(z(),_(ue)),n=t(e.roleId);if(!n)return c({error:`Role not found: ${e.roleId}`});let o=r(n.name);try{return ve(e.pluginId,"project",o),c({success:!0,roleId:e.roleId,pluginId:e.pluginId})}catch(i){return c({error:`Failed to uninstall plugin: ${i}`})}}),p("bind_mcp_to_role","Bind an MCP server configuration to a role. The MCP server will be available to the role during task execution.",ar,async e=>{let t=T(e.roleId);if(!t)return c({error:`Role not found: ${e.roleId}`});let n={...t.mcpServers??{},[e.mcpName]:e.mcpConfig};try{return D(e.roleId,{mcpServers:n}),Y(t),c({success:!0,roleId:e.roleId,mcpName:e.mcpName,mcpServers:n})}catch(o){return c({error:`Failed to bind MCP server: ${o}`})}}),p("unbind_mcp_from_role","Remove an MCP server binding from a role.",ir,async e=>{let t=T(e.roleId);if(!t)return c({error:`Role not found: ${e.roleId}`});let r={...t.mcpServers??{}};if(!(e.mcpName in r))return c({error:`MCP server "${e.mcpName}" not bound to this role`});delete r[e.mcpName];try{return D(e.roleId,{mcpServers:r}),Y(t),c({success:!0,roleId:e.roleId,mcpName:e.mcpName})}catch(n){return c({error:`Failed to unbind MCP server: ${n}`})}}),p("get_capabilities","Get a comprehensive overview of Adam's current capabilities: available roles and their tools, connected channels, installed plugins, active automations, and execution capacity. Call this when the user asks what you can do, or asks for help.",er,async()=>{let{listTaskTemplates:e}=await import("./task-templates-PSP7GOJJ.js"),t=I(),r=A(void 0,100,0),n=ge(),o=e(!0,100,0),i=L("running"),s=L("pending");return c({roles:{description:"Specialized worker identities \u2014 each has its own tools, MCP servers, plugins (skills/agents), and learned rules",active:r.filter(l=>l.status==="active"&&l.source!=="system").map(l=>{let d=he(l);return{name:l.name,tools:l.allowedTools??[],mcpServers:Object.keys(l.mcpServers??{}),channels:l.allowedChannels??[],capabilitySummary:U(l,d),plugins:d.plugins.map(u=>({name:u.name,skills:u.skills.map(m=>m.name),agents:u.agents.map(m=>m.name)}))}}),retired:r.filter(l=>l.status==="retired").length,probation:r.filter(l=>l.status==="probation").length},channels:{description:"Send/receive messages via connected platforms",connected:n.filter(l=>l.enabled).map(l=>({name:l.name,platform:l.platform,status:l.status}))},plugins:{description:"Extensions that add capabilities to roles",installed:K().filter(l=>l.enabled).map(l=>({name:l.name,scope:l.scope,description:l.version?`v${l.version}`:void 0}))},automations:{description:"Recurring cron tasks and event-triggered templates",active:o.map(l=>({name:l.name,trigger:l.trigger}))},execution:{description:"Parallel task execution pool",maxConcurrent:t.execution?.maxConcurrent??5,running:i.length,queued:s.length},coreFeatures:["Goal management \u2014 SMART goals with budget/deadline/metric, auto-decomposition into subtasks","Memory \u2014 per-Role vector + keyword searchable memory across tasks","Strategy evolution \u2014 Thompson Sampling optimizes task approaches over time","Monitor \u2014 automatic quality scoring, role retirement/reinstatement","Delivery engine \u2014 event-driven result routing to channels/webhooks","Schedule \u2014 cron recurring templates + one-shot delayed tasks"]})}),p("enable_plugin","Enable a globally installed plugin (makes it available to all roles).",sr,async e=>{try{return it(e.pluginId),c({success:!0,pluginId:e.pluginId})}catch(t){return c({error:`Failed to enable plugin: ${t}`})}}),p("disable_plugin","Disable a globally installed plugin (removes it from all roles).",lr,async e=>{try{return st(e.pluginId),c({success:!0,pluginId:e.pluginId})}catch(t){return c({error:`Failed to disable plugin: ${t}`})}}),p("install_plugin_for_user","Install a plugin globally for the current user (user-scope).",cr,async e=>{try{return we(e.pluginId,"user"),c({success:!0,pluginId:e.pluginId,scope:"user"})}catch(t){return c({error:`Failed to install plugin: ${t}`})}}),p("uninstall_plugin_for_user","Uninstall a globally installed plugin from the current user.",dr,async e=>{try{return ve(e.pluginId,"user"),c({success:!0,pluginId:e.pluginId})}catch(t){return c({error:`Failed to uninstall plugin: ${t}`})}}),p("browse_marketplace","Browse all available plugins from configured marketplaces (shows installed and available).",ur,async()=>{try{let e=at(),t=K();return c({available:e,installed:t})}catch(e){return c({error:`Failed to browse marketplace: ${e}`})}}),p("list_marketplace_sources","List configured plugin marketplace sources.",pr,async()=>{let e=Ee();return c({sources:e})}),p("get_plugin_detail","Get detailed manifest for an installed plugin (skills, agents, MCP servers, hooks).",mr,async e=>{let t=Ce(e.pluginId);if(!t)return c({error:`Plugin not found: ${e.pluginId}`});let r=Pe(t.installPath);return c({id:t.id,name:t.name,version:t.version,scope:t.scope,projectPath:t.projectPath,enabled:t.enabled,manifest:r})}),p("scan_directory","Scan a directory for .claude/settings.json and return its plugin/MCP configuration.",gr,async e=>{let{getRole:t}=await import("./roles-3UTFKSHI.js");if(!t(e.roleId))return c({error:`Role not found: ${e.roleId}`});try{let n=De(e.path);return c({roleId:e.roleId,path:e.path,config:n})}catch(n){return c({error:`Failed to scan directory: ${n}`})}}),p("cancel_task","Cancel a running or pending task by setting its status to 'cancelled'. Emits a task_status_change event.",fr,async e=>{let t=h(e.taskId);if(!t)return c({error:`Task not found: ${e.taskId}`});let r=t.status;E(e.taskId,{status:"cancelled"});let{serverBus:n}=await import("./server-bus-GEGVMSCA.js");return n.emit({type:"task_status_change",taskId:e.taskId,oldStatus:r,newStatus:"cancelled"}),c({success:!0,taskId:e.taskId,status:"cancelled"})}),p("view_task_logs","Retrieve step-by-step execution logs for a task.",hr,async e=>{let t=J(e.taskId,e.limit??20);return c({taskId:e.taskId,count:t.length,logs:t})}),p("delete_role","Delete a role by ID. This removes the role and its workspace.",br,async e=>T(e.roleId)?(Re(e.roleId),c({success:!0,roleId:e.roleId})):c({error:`Role not found: ${e.roleId}`})),p("view_config","Get the current runtime configuration (mutable fields and restart-required fields).",yr,async()=>{let{MUTABLE_PATHS:e,RESTART_REQUIRED_PATHS:t}=await import("./runtime-B2DP3JNB.js"),r=I(),n={};try{let l=I().server?.port??7100,d=await fetch(`http://127.0.0.1:${l}/config`);d.ok&&(n=await d.json())}catch{}let o=[...e,...t],i=[...t],s={};for(let l of o){let d=l.split("."),u=r;for(let m of d)if(u&&typeof u=="object")u=u[m];else{u=void 0;break}s[l]={value:u,mutable:!t.includes(l)}}return c({config:s,mutable:[...e],restartRequired:[...t]})}),p("update_config","Update mutable runtime configuration fields. Returns partial-success: some fields may update while others return errors.",wr,async e=>{let{isRestartRequiredPath:t}=await import("./runtime-B2DP3JNB.js"),{setConfigValue:r}=await import("./config-EI3SCA4W.js"),n=Te(e.updates,r);if(e.updates["logging.level"]&&Se(e.updates["logging.level"]),n.updated.length>0){let{serverBus:o}=await import("./server-bus-GEGVMSCA.js");o.emit({type:"config_changed",changes:n.updated.map(i=>({path:i,value:e.updates[i]}))})}return c(n)}),p("list_memories","List memories stored under a specific role.",vr,async e=>{let t=Ne(e.roleId,e.limit??20);return c({roleId:e.roleId,count:t.length,memories:t})}),p("update_template","Update a task template's fields (name, prompt, cron, enabled, etc.).",Ir,async e=>{let t=N(e.templateId);if(!t)return c({error:`Template not found: ${e.templateId}`});let r={};if(e.name!==void 0&&(r.name=e.name),e.enabled!==void 0&&(r.enabled=e.enabled),e.prompt!==void 0){let n=t.steps?.length?[...t.steps]:[];n.length===0?n.push({id:y(),prompt:e.prompt}):n[0]={...n[0],prompt:e.prompt},r.steps=n}return(e.triggerCron!==void 0||e.triggerEvent!==void 0)&&(r.trigger={type:e.triggerEvent?"event":"cron",cron:e.triggerCron,event:e.triggerEvent}),e.roleId!==void 0&&(r.rolePreference=e.roleId),$e(e.templateId,r),c({success:!0,templateId:e.templateId,updated:Object.keys(r)})}),p("delete_template","Delete a task template by ID.",Tr,async e=>N(e.templateId)?(Oe(e.templateId),c({success:!0,templateId:e.templateId})):c({error:`Template not found: ${e.templateId}`})),p("run_template","Trigger a template immediately (runs the webhook endpoint for its name).",Sr,async e=>{let t=N(e.templateId);if(!t)return c({error:`Template not found: ${e.templateId}`});try{let r=I().server?.port??7100,n=await fetch(`http://127.0.0.1:${r}/webhooks/${t.name}`,{method:"POST"}),o=await n.json();return n.ok?c({success:!0,templateId:e.templateId,templateName:t.name,response:o}):c({error:`Webhook failed: ${o.code??n.status} \u2014 ${o.message??""}`})}catch(r){return c({error:`Failed to trigger template: ${r}`})}}),p("list_delivery_rules","List delivery rules, optionally filtered by enabled status.",kr,async e=>{let t=be(e.enabled);return c({count:t.length,rules:t})}),p("create_delivery_rule","Create a new delivery rule for event-driven result routing.",Rr,async e=>{let t=y(),r={id:t,eventType:e.eventType,matchCriteria:e.matchCriteria??{},target:{type:"channel",channelId:e.channelId},formatTemplate:e.format,maxPerMinute:10,skipOriginChannel:!1,enabled:e.enabled??!0,createdAt:Date.now()};return Be(r),c({success:!0,ruleId:t,rule:r})}),p("delete_delivery_rule","Delete a delivery rule by ID.",_r,async e=>be().find(n=>n.id===e.ruleId)?(qe(e.ruleId),c({success:!0,ruleId:e.ruleId})):c({error:`Delivery rule not found: ${e.ruleId}`})),p("list_strategies","List Thompson Sampling strategy populations for a role, or all strategies if roleId omitted.",Mr,async e=>{let t;if(e.roleId)t=Qe(e.roleId);else{let{getDb:r}=await import("./db-4NY7ZOS2.js");t=r().prepare("SELECT * FROM strategies ORDER BY created_at").all().map(o=>({id:o.id,roleId:o.role_id,name:o.name,taskType:o.task_type,createdAt:o.created_at,updatedAt:o.updated_at??void 0,promptTemplate:o.prompt_template??"",alpha:o.alpha,beta:o.beta,totalTrials:o.trials,avgReward:o.total_reward&&o.trials>0?o.total_reward/o.trials:void 0,enabled:o.enabled===1}))}return c({roleId:e.roleId??null,count:t.length,strategies:t})}),p("authorize_task_operation","Authorize a pending privilege escalation for a task. The paused operation will proceed.",{taskId:a.string(),operationId:a.string().optional().describe("ID of the specific operation. If omitted, authorizes the most recent pending operation."),scope:a.enum(["once","permanent"]).default("once").describe("'once' = this operation only. 'permanent' = auto-authorize matching patterns in the future.")},async e=>{let t=pe(e.taskId),r=e.operationId?t.find(o=>o.id===e.operationId):t.find(o=>o.status==="pending");return r?(new B().resolvePlanApproval(r.id,"allow",e.scope),c({success:!0,operationId:r.id,decision:"allow",scope:e.scope})):c({error:"No pending operation found for this task"})}),p("deny_task_operation","Deny a pending privilege escalation for a task. The paused operation will be rejected.",{taskId:a.string(),operationId:a.string().optional(),reason:a.string().optional().describe("Reason for denial, provided to the executor as feedback.")},async e=>{let t=pe(e.taskId),r=e.operationId?t.find(o=>o.id===e.operationId):t.find(o=>o.status==="pending");return r?(new B().resolvePlanApproval(r.id,"deny","once",e.reason),c({success:!0,operationId:r.id,decision:"deny"})):c({error:"No pending operation found for this task"})})];function ao(){return dt.map(e=>e.name).sort().join(",")}function io(){return Dt({name:"adam-tools",version:"1.0.0",tools:dt})}export{B as a,Nr as b,Ur as c,Je as d,ln as e,Qe as f,v as g,at as h,we as i,ve as j,it as k,st as l,Sn as m,ao as n,io as o};
|
package/dist/chunk-JNRCXAW3.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import{a as S,b as P}from"./chunk-CDVIT7L5.js";import{a as k,b as m}from"./chunk-W3554FQ7.js";import{a as u}from"./chunk-L7JP7DUO.js";import{p as I}from"./chunk-4TCP2AT7.js";import{a as C,b as c,d as y,f as R}from"./chunk-6DXNXLYG.js";import{d as T}from"./chunk-SBX3HMDA.js";import{h as x,k as J}from"./chunk-B4WHT7DX.js";import{c as h,h as b}from"./chunk-INNDBLZE.js";b();J();import{v4 as l}from"uuid";import{CronExpressionParser as D}from"cron-parser";b();import{v4 as M}from"uuid";var g=h("scheduler"),v=class{maxRetries=3;baseDelayMs=1e3;async execute(e,t){let o=T(),r={timeout:e.config?.timeout??o.timeout,approvalRequired:o.approvalRequired,approvalTimeout:o.approvalTimeout,plugins:e.config?.plugins,mcpServers:e.config?.mcpServers,model:e.config?.model??o.model,maxTurns:e.config?.maxTurns??o.maxTurns,maxBudgetUsd:e.config?.maxBudgetUsd??o.maxBudgetUsd,env:{...o.env,...e.config?.env},claudeCodePath:o.claudeCodePath},s={templateId:e.id,executionId:t,stepResults:new Map,config:r,rolePreference:e.rolePreference,deliverTo:e.deliverTo,reportTo:e.reportTo},i=this.sortSteps(e.steps);for(let a of i){try{await this.executeStep(a,s)}catch(p){g.error({stepId:a.id,error:p},"Workflow step failed");break}if(s.stepResults.get(a.id)?.status==="failed"){g.warn({stepId:a.id},"Workflow step failed, workflow aborted");break}}g.info({executionId:t,completedSteps:s.stepResults.size,totalSteps:i.length},"Workflow completed")}sortSteps(e){let t=new Set,o=[],r=new Map(e.map(i=>[i.id,i])),s=i=>{if(!t.has(i.id)){if(t.add(i.id),i.dependsOn)for(let a of i.dependsOn){let d=r.get(a);d&&s(d)}o.push(i)}};for(let i of e)s(i);return o}async executeStep(e,t){let o=this.resolveVariables(e.prompt,t.stepResults),r=M();k({id:r,status:"pending",prompt:o,config:t.config,createdAt:Date.now(),parentId:t.executionId,templateId:t.templateId,roleId:t.rolePreference,deliverTo:t.deliverTo,reportTo:t.reportTo}),g.debug({stepId:e.id,taskId:r},"Created workflow step as task"),u.emit({type:"task_created",taskId:r});let s=await this.executeWithRetry(r,e.id),i=m(r);t.stepResults.set(e.id,{stepId:e.id,taskId:r,status:s==="completed"?"completed":"failed",result:i?.result,error:i?.error})}resolveVariables(e,t){return e.replace(/\{\{([^}]+)\.result\}\}/g,(o,r)=>t.get(r)?.result??`[no result from ${r}]`)}async executeWithRetry(e,t){let o=0;for(;o<this.maxRetries;){if(o++,await this.waitForTaskCompletion(e)==="completed")return"completed";if(o<this.maxRetries){let s=this.baseDelayMs*Math.pow(2,o-1);g.info({stepId:t,attempt:o,maxRetries:this.maxRetries,delayMs:s},"Workflow step failed, retrying"),await this.sleep(s)}}return"failed"}waitForTaskCompletion(e,t=6e5){return new Promise(o=>{let r=Date.now(),s=()=>{if(Date.now()-r>t){o("failed");return}let i=m(e);if(!i){o("failed");return}if(i.status==="completed"){o("completed");return}if(i.status==="failed"||i.status==="cancelled"){o("failed");return}setTimeout(s,500)};s()})}sleep(e){return new Promise(t=>setTimeout(t,e))}};var n=h("scheduler"),w="ai-hourly-digest";function O(){if(c(w)){n.debug({templateId:w},"Built-in template already exists");return}let e={id:w,name:"AI Hourly Digest",description:"\u6BCF\u5C0F\u65F6\u641C\u7D22 AI \u524D\u6CBF\u6587\u7AE0\uFF0C\u603B\u7ED3\u540E\u4FDD\u5B58\u5230 Omnifocus",trigger:{type:"cron",cron:"0 * * * *"},enabled:!0,steps:[{id:"search_ai_news",prompt:`\u641C\u7D22\u8FC7\u53BB 24 \u5C0F\u65F6\u5185\u5173\u4E8E AI/\u4EBA\u5DE5\u667A\u80FD\u7684\u6700\u65B0\u524D\u6CBF\u6587\u7AE0\u3002
|
|
2
|
-
|
|
3
|
-
\u641C\u7D22\u6765\u6E90:
|
|
4
|
-
1. Hacker News AI \u677F\u5757 (https://news.ycombinator.com/front?day=1)
|
|
5
|
-
2. ArXiv cs.AI \u6700\u65B0\u8BBA\u6587 (https://arxiv.org/list/cs.AI/recent)
|
|
6
|
-
3. Reddit r/MachineLearning \u70ED\u95E8\u5E16\u5B50
|
|
7
|
-
|
|
8
|
-
\u627E\u51FA\u4E00\u7BC7\u6700\u6709\u4EF7\u503C\u3001\u6700\u6709\u6280\u672F\u6DF1\u5EA6\u7684\u6587\u7AE0\u3002
|
|
9
|
-
|
|
10
|
-
\u8F93\u51FA\u683C\u5F0F:
|
|
11
|
-
- \u6807\u9898\uFF1A[\u6587\u7AE0\u6807\u9898]
|
|
12
|
-
- \u6765\u6E90\uFF1A[\u7F51\u7AD9/\u5E73\u53F0\u540D\u79F0]
|
|
13
|
-
- \u94FE\u63A5\uFF1A[\u5B8C\u6574 URL]
|
|
14
|
-
- \u6838\u5FC3\u4EF7\u503C\uFF1A[1-2 \u53E5\u8BDD\u8BF4\u660E\u4E3A\u4EC0\u4E48\u8FD9\u7BC7\u6587\u7AE0\u503C\u5F97\u770B]`},{id:"summarize_article",dependsOn:["search_ai_news"],prompt:`\u9605\u8BFB\u5E76\u603B\u7ED3\u8FD9\u7BC7\u6587\u7AE0\u3002
|
|
15
|
-
|
|
16
|
-
\u6587\u7AE0\u4FE1\u606F:
|
|
17
|
-
{{search_ai_news.result}}
|
|
18
|
-
|
|
19
|
-
\u8BF7:
|
|
20
|
-
1. \u7528 WebFetch \u83B7\u53D6\u6587\u7AE0\u5B8C\u6574\u5185\u5BB9
|
|
21
|
-
2. \u63D0\u53D6\u6838\u5FC3\u89C2\u70B9\u548C\u6280\u672F\u7EC6\u8282
|
|
22
|
-
3. \u7528\u4E2D\u6587\u5199\u51FA 300-500 \u5B57\u7684\u603B\u7ED3
|
|
23
|
-
|
|
24
|
-
\u603B\u7ED3\u7ED3\u6784:
|
|
25
|
-
## \u6838\u5FC3\u53D1\u73B0
|
|
26
|
-
[\u6587\u7AE0\u6700\u91CD\u8981\u7684\u53D1\u73B0/\u521B\u65B0\u70B9]
|
|
27
|
-
|
|
28
|
-
## \u6280\u672F\u7EC6\u8282
|
|
29
|
-
[\u5173\u952E\u7684\u6280\u672F\u65B9\u6CD5/\u5B9E\u73B0\u7EC6\u8282]
|
|
30
|
-
|
|
31
|
-
## \u5F71\u54CD/\u610F\u4E49
|
|
32
|
-
[\u8FD9\u9879\u5DE5\u4F5C\u7684\u610F\u4E49\u6216\u5BF9\u884C\u4E1A\u7684\u5F71\u54CD]
|
|
33
|
-
|
|
34
|
-
## \u539F\u6587\u94FE\u63A5
|
|
35
|
-
[\u6587\u7AE0 URL]`},{id:"save_to_omnifocus",dependsOn:["summarize_article"],prompt:`\u5C06\u6587\u7AE0\u603B\u7ED3\u4FDD\u5B58\u5230 Omnifocus\u3002
|
|
36
|
-
|
|
37
|
-
\u603B\u7ED3\u5185\u5BB9:
|
|
38
|
-
{{summarize_article.result}}
|
|
39
|
-
|
|
40
|
-
\u63D0\u53D6\u6587\u7AE0\u6807\u9898\u548C\u5B8C\u6574\u603B\u7ED3\uFF0C\u7136\u540E\u6267\u884C\u4EE5\u4E0B\u547D\u4EE4\u6DFB\u52A0\u5230 Omnifocus Inbox\uFF1A
|
|
41
|
-
|
|
42
|
-
osascript /Users/norvyn/Code/Projects/Adam/scripts/add-to-omnifocus.applescript "[\u6587\u7AE0\u6807\u9898] AI \u524D\u6CBF\u901F\u9012" "[\u5B8C\u6574\u603B\u7ED3\u5185\u5BB9]"
|
|
43
|
-
|
|
44
|
-
\u6CE8\u610F\uFF1A
|
|
45
|
-
- \u5C06 [\u6587\u7AE0\u6807\u9898] \u66FF\u6362\u4E3A\u5B9E\u9645\u6807\u9898
|
|
46
|
-
- \u5C06 [\u5B8C\u6574\u603B\u7ED3\u5185\u5BB9] \u66FF\u6362\u4E3A\u5B8C\u6574\u7684\u603B\u7ED3\u6587\u672C\uFF08\u5305\u542B\u6838\u5FC3\u53D1\u73B0\u3001\u6280\u672F\u7EC6\u8282\u3001\u5F71\u54CD/\u610F\u4E49\u548C\u539F\u6587\u94FE\u63A5\uFF09
|
|
47
|
-
- \u603B\u7ED3\u5185\u5BB9\u4F7F\u7528\u6362\u884C\u7B26\u5206\u9694\u5404\u90E8\u5206
|
|
48
|
-
|
|
49
|
-
\u5B8C\u6210\u540E\u8F93\u51FA\uFF1A\u5DF2\u4FDD\u5B58\u5230 Omnifocus\uFF1A[\u4EFB\u52A1\u6807\u9898]`}],config:{timeout:300},tags:["ai","digest","hourly","automation"],createdAt:Date.now()};C(e),n.info({templateId:w,cron:"0 * * * *"},"Registered built-in AI Hourly Digest template")}var A=class{cronJobs=new Map;workflowExecutor=new v;started=!1;taskCompletionHandler=null;async start(){if(this.started)return;this.started=!0,O();let e=y(!0),t=0;for(let r of e)r.trigger.type==="cron"&&r.trigger.cron&&(this.scheduleCronJob(r),t++);let o=0;for(let r of e)r.trigger.type==="once"&&r.trigger.runAt&&(this.scheduleOnceJob(r.id),o++);this.taskCompletionHandler=r=>{r.newStatus==="completed"&&this.checkEventTriggers(r.taskId).catch(s=>{n.error({taskId:r.taskId,error:s},"Event trigger check failed")})},u.on("task_status_change",this.taskCompletionHandler),this.cronJobs.set("memory-cleanup",setInterval(()=>{this.runMemoryCleanup()},36e5)),n.info({cronCount:t,onceCount:o},"Bree engine started with cron jobs + memory cleanup")}runMemoryCleanup(){try{let e=x(void 0,1e3,0),t=0;for(let o of e)t+=I(o.id);t>0&&n.info({totalCleaned:t},"Memory cleanup completed")}catch(e){n.warn({error:e},"Memory cleanup failed")}}async stop(){for(let[,e]of this.cronJobs)clearTimeout(e),clearInterval(e);this.cronJobs.clear(),this.taskCompletionHandler&&(u.off("task_status_change",this.taskCompletionHandler),this.taskCompletionHandler=null),this.started=!1,n.info("Bree engine stopped")}scheduleCronJob(e){let t=`template-${e.id}`;this.cronJobs.has(t)&&(clearTimeout(this.cronJobs.get(t)),this.cronJobs.delete(t));let o;try{o=D.parse(e.trigger.cron)}catch{n.warn({templateId:e.id,cron:e.trigger.cron},"Invalid cron expression");return}let r=()=>{let p=o.next().getTime()-Date.now();return Math.max(p,1e3)},s=()=>{this.executeCronTrigger(e.id).catch(p=>{n.error({templateId:e.id,error:p},"Cron trigger failed")});let d=setTimeout(s,r());this.cronJobs.set(t,d)},i=r(),a=setTimeout(s,i);this.cronJobs.set(t,a),n.debug({jobName:t,nextRun:new Date(Date.now()+i).toISOString()},"Scheduled cron job")}async executeCronTrigger(e){let t=c(e);!t||!t.enabled||(n.info({templateName:t.name},"Cron triggered"),await this.executeWorkflow(t,l()))}async scheduleJob(e){let t=c(e);t&&t.trigger.type==="cron"&&t.trigger.cron&&this.scheduleCronJob(t)}async unscheduleJob(e){let t=`template-${e}`,o=this.cronJobs.get(t);o&&(clearTimeout(o),this.cronJobs.delete(t))}async runNow(e){let t=c(e);if(!t)throw new Error(`Template ${e} not found`);let o=l();return this.executeWorkflow(t,o).catch(r=>{n.error({templateId:e,error:r},"Workflow execution failed")}),o}async checkEventTriggers(e){let t=m(e);if(!t)return;let o=y(!0),r=o.filter(s=>s.trigger.type==="event"&&s.trigger.event==="task_complete");for(let s of r)n.debug({templateName:s.name},"Event trigger matched"),await this.executeWorkflow(s,l());if(t.templateId){let s=o.filter(i=>i.trigger.type!=="event"||!i.trigger.event?!1:i.trigger.event===`template_complete:${t.templateId}`);for(let i of s)n.info({templateName:i.name,sourceTemplateId:t.templateId},"Template complete trigger matched"),await this.executeWorkflow(i,l())}}async executeWorkflow(e,t){if(n.info({templateName:e.name,executionId:t},"Executing workflow"),e.goalIds&&e.goalIds.length>0){for(let o of e.goalIds){let r=P(o);if(!r){n.warn({goalId:o,templateId:e.id},"Goal reference not found, skipping");continue}let s=l();S({id:s,name:r.name,description:r.description,roleId:r.roleId,metricType:r.metricType,targetValue:r.targetValue,currentValue:0,deadline:r.deadline,budgetUsd:r.budgetUsd,status:"active",createdAt:Date.now(),sourceSessionId:e.sourceSessionId,deliverTo:e.deliverTo,reportTo:e.reportTo});let i=l();k({id:i,status:"pending",prompt:`Decompose and execute goal: ${r.name}. ${r.description??""}`,parentId:s,config:T(),createdAt:Date.now(),templateId:e.id,roleId:e.rolePreference,deliverTo:e.deliverTo,reportTo:e.reportTo}),u.emit({type:"task_created",taskId:i}),n.info({templateId:e.id,sourceGoalId:o,newGoalId:s,taskId:i},"Goal reference triggered, dispatched decomposition task")}return}await this.workflowExecutor.execute(e,t)}scheduleOnceJob(e){let t=c(e);if(!t||!t.enabled||t.trigger.type!=="once")return;let r=(t.trigger.runAt?new Date(t.trigger.runAt).getTime():0)-Date.now();if(r<=0){n.info({templateId:e,runAt:t.trigger.runAt},"Once-shot template past due, executing immediately"),this.executeOnceTrigger(e).catch(a=>{n.error({templateId:e,error:a},"Once trigger execution failed")});return}let s=`template-${e}`;this.cronJobs.has(s)&&clearTimeout(this.cronJobs.get(s));let i=setTimeout(()=>{this.cronJobs.delete(s),this.executeOnceTrigger(e).catch(a=>{n.error({templateId:e,error:a},"Once trigger execution failed")})},r);this.cronJobs.set(s,i),n.info({templateId:e,runAt:t.trigger.runAt,delayMs:r},"Scheduled once-shot job")}async executeOnceTrigger(e){let t=c(e);!t||!t.enabled||(n.info({templateName:t.name},"Once-shot triggered"),await this.executeWorkflow(t,l()),R(e),n.info({templateId:e},"Once-shot template auto-disabled after execution"))}},_=null;function Y(){return _}function Z(f){_=f}export{A as a,Y as b,Z as c};
|
package/dist/chunk-W3554FQ7.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{b as i,d as a}from"./chunk-KVSO3KGZ.js";a();function d(t){return{id:t.id,parentId:t.parent_id??void 0,status:t.status,prompt:t.prompt,originalPrompt:t.original_prompt??void 0,config:JSON.parse(t.config),result:t.result??void 0,error:t.error??void 0,sdkSessionId:t.sdk_session_id??void 0,templateId:t.template_id??void 0,roleId:t.role_id??void 0,sourceSessionId:t.source_session_id??void 0,deliverTo:t.deliver_to?JSON.parse(t.deliver_to):void 0,reportTo:t.report_to?JSON.parse(t.report_to):void 0,createdAt:t.created_at,startedAt:t.started_at??void 0,completedAt:t.completed_at??void 0,costUsd:t.cost_usd??void 0,tokenUsage:t.token_usage?JSON.parse(t.token_usage):void 0,numTurns:t.num_turns??void 0,totalDurationMs:t.total_duration_ms??void 0}}function c(t){i().prepare(`
|
|
2
|
-
INSERT INTO tasks (id, parent_id, status, prompt, original_prompt, config, result, error,
|
|
3
|
-
sdk_session_id, template_id, role_id, source_session_id, notify_targets, deliver_to, report_to,
|
|
4
|
-
created_at, started_at, completed_at,
|
|
5
|
-
cost_usd, token_usage, num_turns, total_duration_ms)
|
|
6
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
7
|
-
`).run(t.id,t.parentId??null,t.status,t.prompt,t.originalPrompt??null,JSON.stringify(t.config),t.result??null,t.error??null,t.sdkSessionId??null,t.templateId??null,t.roleId??null,t.sourceSessionId??null,null,t.deliverTo?JSON.stringify(t.deliverTo):null,t.reportTo?JSON.stringify(t.reportTo):null,t.createdAt,t.startedAt??null,t.completedAt??null,t.costUsd??null,t.tokenUsage?JSON.stringify(t.tokenUsage):null,t.numTurns??null,t.totalDurationMs??null)}function g(t){let r=i().prepare("SELECT * FROM tasks WHERE id = ?").get(t);return r?d(r):void 0}function m(t,e){let r=i(),n=[],s=[],l={parentId:"parent_id",status:"status",prompt:"prompt",result:"result",error:"error",sdkSessionId:"sdk_session_id",templateId:"template_id",roleId:"role_id",sourceSessionId:"source_session_id",originalPrompt:"original_prompt",startedAt:"started_at",completedAt:"completed_at",costUsd:"cost_usd",numTurns:"num_turns",totalDurationMs:"total_duration_ms"};for(let[o,u]of Object.entries(l))o in e&&(n.push(`${u} = ?`),s.push(e[o]??null));"config"in e&&(n.push("config = ?"),s.push(JSON.stringify(e.config))),"tokenUsage"in e&&(n.push("token_usage = ?"),s.push(e.tokenUsage?JSON.stringify(e.tokenUsage):null)),"deliverTo"in e&&(n.push("deliver_to = ?"),s.push(e.deliverTo?JSON.stringify(e.deliverTo):null)),"reportTo"in e&&(n.push("report_to = ?"),s.push(e.reportTo?JSON.stringify(e.reportTo):null)),n.length!==0&&(s.push(t),r.prepare(`UPDATE tasks SET ${n.join(", ")} WHERE id = ?`).run(...s))}function f(t,e=100,r=0,n){let s=i(),l="SELECT * FROM tasks",o=[],u=[];return t&&(o.push("status = ?"),u.push(t)),n&&(o.push("role_id = ?"),u.push(n)),o.length>0&&(l+=" WHERE "+o.join(" AND ")),l+=" ORDER BY created_at DESC LIMIT ? OFFSET ?",u.push(e,r),s.prepare(l).all(...u).map(d)}function T(t){return i().prepare("SELECT * FROM tasks WHERE parent_id = ? ORDER BY created_at ASC").all(t).map(d)}function E(t){return i().prepare("SELECT COALESCE(SUM(cost_usd), 0) as total FROM tasks WHERE completed_at >= ? AND cost_usd IS NOT NULL").get(t).total}export{c as a,g as b,m as c,f as d,T as e,E as f};
|
package/dist/config-7HYICF5P.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as b,b as c,d,e}from"./chunk-SBX3HMDA.js";import{a}from"./chunk-ZM6YED5F.js";import"./chunk-7IFLU3CY.js";import"./chunk-6HD6NYIB.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};
|
package/dist/engine-5RJ7NJSM.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d}from"./chunk-KKLZIXBN.js";import"./chunk-2HN2TSP6.js";import"./chunk-EGS6U3V5.js";import"./chunk-6YURWVQG.js";import"./chunk-W3554FQ7.js";import"./chunk-AJVN3KPM.js";import"./chunk-AR2IZMM2.js";import"./chunk-SWPXG2CY.js";import"./chunk-OFOVSC72.js";import"./chunk-L7JP7DUO.js";import"./chunk-KVSO3KGZ.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 +0,0 @@
|
|
|
1
|
-
import{a,b,c}from"./chunk-GUQAIWCQ.js";import"./chunk-2CMR5AG7.js";import"./chunk-4TCP2AT7.js";import"./chunk-B4WHT7DX.js";import"./chunk-7LBDLAUQ.js";import"./chunk-KVSO3KGZ.js";import"./chunk-WBAPIPST.js";import"./chunk-INNDBLZE.js";import"./chunk-FCV2DPZQ.js";export{b as getRelevantMemoryContext,a as queryMemory,c as queryMemoryByTier};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c}from"./chunk-EGS6U3V5.js";import"./chunk-SWPXG2CY.js";import"./chunk-OFOVSC72.js";import"./chunk-L7JP7DUO.js";import"./chunk-KVSO3KGZ.js";import"./chunk-WBAPIPST.js";import"./chunk-INNDBLZE.js";import"./chunk-FCV2DPZQ.js";export{a as OutboundGateway,b as getOutboundGateway,c as isRecentlySent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b}from"./chunk-BIIP363C.js";import"./chunk-KLQOILIJ.js";import"./chunk-B4WHT7DX.js";import"./chunk-7LBDLAUQ.js";import"./chunk-KVSO3KGZ.js";import"./chunk-WBAPIPST.js";import"./chunk-INNDBLZE.js";import"./chunk-FCV2DPZQ.js";export{a as CHAT_MANAGER_ROLE_ID,b as initializeDefaultRoles};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{D as t,h as n,nt as r,p as i,u as a}from"./vendor-icons-CkI4-NxL.js";import{l as o,t as s}from"./vendor-react-DLRtONKt.js";import{r as c}from"./dist-HyCSN_hp.js";import{C as l,a as u,c as d,f,i as p,l as m,o as h,r as g,s as _,u as v}from"./index-rvaixveh.js";import{t as y}from"./Card-4mOZntHG.js";import{i as b}from"./format-DvtQjPZn.js";import{t as x}from"./EmptyState-BlgMMAr-.js";import{t as S}from"./EnvVarEditor-CaCpNT3y.js";var C=e(r(),1),w=s(),T={anthropic:{label:`Anthropic`,paths:[`anthropic.apiKey`,`anthropic.baseUrl`,`anthropic.model`,`anthropic.defaultOpusModel`,`anthropic.defaultSonnetModel`,`anthropic.defaultHaikuModel`,`anthropic.smallFastModel`]},defaults:{label:`Defaults`,paths:[`defaults.model`,`defaults.effort`,`defaults.maxTurns`,`defaults.maxBudgetUsd`,`defaults.timeout`,`defaults.approvalTimeout`]},server:{label:`Server`,paths:[`server.port`,`server.host`,`server.apiKey`],mutablePaths:[`server.timezone`]},logging:{label:`Logging`,paths:[`logging.level`]},evolution:{label:`Evolution`,paths:[`roles.evolution.triggerEvery`,`roles.evolution.reflectionThreshold`]},chat:{label:`Chat`,paths:[`chat.sessionTimeoutMinutes`,`chat.maxSessionTurns`,`chat.autoTitle`,`chat.archiveExtractMemory`]}},E=[`defaults.deniedReadPaths`,`defaults.approvalRequired`],D=new Set([`anthropic.apiKey`,`server.apiKey`]),O={"anthropic.apiKey":`API Key`,"anthropic.baseUrl":`Base URL`,"anthropic.model":`Model`,"anthropic.defaultOpusModel":`Default Opus Model`,"anthropic.defaultSonnetModel":`Default Sonnet Model`,"anthropic.defaultHaikuModel":`Default Haiku Model`,"anthropic.smallFastModel":`Small Fast Model`,"defaults.model":`Default Model`,"defaults.effort":`Effort Level`,"defaults.maxTurns":`Max Turns`,"defaults.maxBudgetUsd":`Max Budget (USD)`,"defaults.timeout":`Timeout (seconds)`,"defaults.approvalTimeout":`Approval Timeout (seconds)`,"server.port":`Port`,"server.host":`Host`,"server.apiKey":`API Key (server auth)`,"server.timezone":`Timezone`,"logging.level":`Log Level`,"roles.evolution.triggerEvery":`Evolution Trigger Every (tasks)`,"roles.evolution.reflectionThreshold":`Reflection Threshold (tokens)`,"chat.sessionTimeoutMinutes":`Session Timeout (minutes)`,"chat.maxSessionTurns":`Max Session Turns`,"chat.autoTitle":`Auto-generate Session Title`,"chat.archiveExtractMemory":`Extract Memory on Archive`},k={"defaults.effort":[`low`,`medium`,`high`,`max`],"logging.level":[`debug`,`info`,`warn`,`error`],"server.timezone":[`system`,`Asia/Shanghai`,`Asia/Tokyo`,`Asia/Singapore`,`America/New_York`,`America/Los_Angeles`,`America/Chicago`,`Europe/London`,`Europe/Berlin`,`Europe/Paris`,`UTC`]};function A(){let[e,r]=(0,C.useState)({}),[s,A]=(0,C.useState)([]),[M,N]=(0,C.useState)({}),[P,F]=(0,C.useState)(new Set),[I,L]=(0,C.useState)(!1),[R,z]=(0,C.useState)(null),[B,V]=(0,C.useState)(!0),[H,U]=(0,C.useState)(null),[W,G]=(0,C.useState)({}),[K,q]=(0,C.useState)(new Set),[J,Y]=(0,C.useState)({}),X=l(e=>e.configVersion);(0,C.useEffect)(()=>{if(P.size===0)return;let e=e=>{e.preventDefault()};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[P.size]);let Z=o(({currentLocation:e,nextLocation:t})=>P.size>0&&e.pathname!==t.pathname),Q=(0,C.useCallback)(async()=>{try{let e=await c(`/config`);r(e.config),A(e.mutable);let t={};for(let[n,r]of Object.entries(e.config))t[n]=String(r.value??``);N(t),F(new Set);let n=e.config[`server.timezone`]?.value;n&&b(n);let i={};for(let t of E){let n=e.config[t];n&&(i[t]=Array.isArray(n.value)?n.value:[])}G(i),q(new Set),U(await c(`/config/env-diff`)),Y((await c(`/config/env`)).env)}catch(e){z({type:`error`,text:e instanceof Error?e.message:`Failed to load config`})}finally{V(!1)}},[]);(0,C.useEffect)(()=>{Q()},[Q]),(0,C.useEffect)(()=>{X>0&&Q()},[X,Q]);let ee=async()=>{await c(`/config/sync-to-env`,{method:`POST`}),z({type:`success`,text:`Synced DB values to .env`}),U(null)},te=async()=>{await c(`/config/load-from-env`,{method:`POST`}),z({type:`success`,text:`Loaded .env values to DB`}),Q()},$=(e,t)=>{N(n=>({...n,[e]:t})),F(t=>new Set(t).add(e)),z(null)},ne=async()=>{if(P.size!==0){L(!0),z(null);try{let t={};for(let n of P){let r=e[n],i=M[n];if(r&&typeof r.value==`number`&&(i=Number(i),isNaN(i))){z({type:`error`,text:`"${O[n]??n}" must be a number`}),L(!1);return}t[n]=i}let n=await c(`/config`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...t,...Object.fromEntries(Array.from(K).map(e=>[e,W[e]??[]]))})});if(n.updated.length>0&&(z({type:`success`,text:`Updated ${n.updated.length} setting(s)`}),n.updated.includes(`server.timezone`))){let e=M[`server.timezone`];b(e)}n.errors.length>0&&z({type:`error`,text:n.errors.join(`; `)}),F(new Set),Q()}catch(e){z({type:`error`,text:e instanceof Error?e.message:`Save failed`})}finally{L(!1)}}};return B?(0,w.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,w.jsx)(`div`,{className:`h-8 w-8 animate-spin rounded-full border-2 border-slate-700 border-t-blue-500`})}):Object.keys(e).length===0?(0,w.jsx)(x,{icon:(0,w.jsx)(a,{size:32}),title:`No configuration`,description:`Config API not available`}):(0,w.jsxs)(`div`,{className:`space-y-4`,children:[(0,w.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,w.jsx)(`h1`,{className:`text-lg font-semibold text-slate-100`,children:`Settings`}),(0,w.jsxs)(`div`,{className:`flex gap-2`,children:[(0,w.jsx)(f,{variant:`ghost`,size:`sm`,onClick:()=>void Q(),children:(0,w.jsx)(n,{size:14})}),P.size>0&&(0,w.jsxs)(f,{size:`sm`,onClick:()=>void ne(),disabled:I,children:[(0,w.jsx)(i,{size:14}),I?`Saving...`:`Save (${P.size})`]})]})]}),R&&(0,w.jsx)(`div`,{className:`rounded px-3 py-2 text-sm ${R.type===`success`?`bg-green-900/30 text-green-400`:`bg-red-900/30 text-red-400`}`,children:R.text}),H&&H.diffs.length>0&&(0,w.jsx)(y,{children:(0,w.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsxs)(`p`,{className:`text-sm font-medium text-yellow-400`,children:[`.env and DB have `,H.diffs.length,` different value(s)`]}),(0,w.jsx)(`p`,{className:`mt-1 text-xs text-slate-500`,children:H.diffs.map(e=>e.envKey).join(`, `)})]}),(0,w.jsxs)(`div`,{className:`flex gap-2`,children:[(0,w.jsx)(f,{variant:`ghost`,size:`sm`,onClick:ee,children:`Sync DB → .env`}),(0,w.jsx)(f,{variant:`ghost`,size:`sm`,onClick:te,children:`Load .env → DB`})]})]})}),Object.entries(T).map(([n,{label:r,paths:i,mutablePaths:a}])=>{let o=[...i,...a??[]];return(0,w.jsxs)(y,{children:[(0,w.jsx)(`h2`,{className:`mb-3 text-sm font-medium text-slate-300`,children:r}),(0,w.jsx)(`div`,{className:`space-y-3`,children:o.map(n=>{let r=e[n];if(!r)return null;let i=s.includes(n),a=O[n]??n,o=M[n]??String(r.value??``),c=P.has(n),l=k[n];return(0,w.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,w.jsxs)(`div`,{className:`w-56 flex items-center gap-1.5`,children:[!i&&(0,w.jsx)(t,{size:12,className:`text-slate-600`}),(0,w.jsx)(`label`,{className:`text-sm text-slate-400`,children:a}),!i&&(0,w.jsx)(`span`,{className:`text-[10px] text-slate-600`,children:`restart required`})]}),(0,w.jsx)(`div`,{className:`flex-1`,children:l?(0,w.jsx)(`select`,{className:`w-full rounded border border-slate-700 bg-slate-900 px-2 py-1.5 text-sm text-slate-200 focus:border-blue-500 focus:outline-none disabled:opacity-50`,value:o,onChange:e=>$(n,e.target.value),disabled:!i,children:l.map(e=>(0,w.jsx)(`option`,{value:e,children:e},e))}):(0,w.jsx)(`input`,{className:`w-full rounded border border-slate-700 bg-slate-900 px-2 py-1.5 text-sm text-slate-200 focus:border-blue-500 focus:outline-none disabled:opacity-50`,type:D.has(n)?`password`:`text`,value:o,onChange:e=>$(n,e.target.value),disabled:!i,placeholder:D.has(n)?`Enter to update`:void 0})}),(0,w.jsx)(`div`,{className:`w-16 text-right`,children:c&&i&&(0,w.jsx)(`span`,{className:`text-[10px] text-yellow-500`,children:`modified`})})]},n)})})]},n)}),(0,w.jsx)(S,{envVars:J,onSave:()=>void Q(),mode:`global`,title:`Environment Variables`}),(0,w.jsx)(j,{mutablePaths:s,listValues:W,listDirty:K,setListValues:G,setListDirty:e=>q(e),dirty:P}),(0,w.jsx)(g,{open:Z.state===`blocked`,children:(0,w.jsxs)(h,{children:[(0,w.jsxs)(m,{children:[(0,w.jsx)(v,{children:`Unsaved Changes`}),(0,w.jsxs)(_,{children:[`You have `,P.size+K.size,` unsaved change(s). Discard and leave?`]})]}),(0,w.jsxs)(d,{children:[(0,w.jsx)(u,{onClick:()=>Z.reset?.(),children:`Stay`}),(0,w.jsx)(p,{onClick:()=>Z.proceed?.(),children:`Discard`})]})]})})]})}function j({mutablePaths:e,listValues:n,listDirty:r,setListValues:i,setListDirty:a,dirty:o}){let[s,c]=(0,C.useState)(``),[l,u]=(0,C.useState)(``),d=e.includes(`defaults.deniedReadPaths`),p=e.includes(`defaults.approvalRequired`),m=n[`defaults.deniedReadPaths`]??[],h=n[`defaults.approvalRequired`]??[],g=[`~/.ssh`,`~/.aws`,`~/.gnupg`,`/etc/shadow`],_=[`rm -rf *`,`git push*`,`git reset*`,`curl * -X POST*`,`curl * --request POST*`],v=e=>g.some(t=>e===(t.startsWith(`~/`),t)||e===t),b=e=>_.includes(e),x=()=>{let e=s.trim();!e||m.includes(e)||(i(t=>({...t,"defaults.deniedReadPaths":[...m,e]})),a(e=>new Set(e).add(`defaults.deniedReadPaths`)),c(``))},S=e=>{v(e)||(i(t=>({...t,"defaults.deniedReadPaths":m.filter(t=>t!==e)})),a(e=>new Set(e).add(`defaults.deniedReadPaths`)))},T=()=>{let e=l.trim();!e||h.includes(e)||(i(t=>({...t,"defaults.approvalRequired":[...h,e]})),a(e=>new Set(e).add(`defaults.approvalRequired`)),u(``))},E=e=>{b(e)||(i(t=>({...t,"defaults.approvalRequired":h.filter(t=>t!==e)})),a(e=>new Set(e).add(`defaults.approvalRequired`)))},D=o.size+r.size;return(0,w.jsxs)(y,{children:[(0,w.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,w.jsx)(`h2`,{className:`text-sm font-medium text-slate-300`,children:`Advanced`}),D>0&&(0,w.jsxs)(`span`,{className:`text-[10px] text-yellow-500`,children:[r.size,` modified`]})]}),(0,w.jsxs)(`div`,{className:`mb-6`,children:[(0,w.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,w.jsx)(`h3`,{className:`text-xs font-medium text-slate-400`,children:`Denied Read Paths`}),!d&&(0,w.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px] text-slate-600`,children:[(0,w.jsx)(t,{size:10}),` restart required`]})]}),(0,w.jsxs)(`p`,{className:`mb-2 text-xs text-slate-500`,children:[`Paths blocked at both the SDK and OS layer for all roles. System defaults (locked) cannot be removed. Uses `,(0,w.jsx)(`code`,{className:`text-slate-400`,children:`*`}),` as wildcard.`]}),(0,w.jsx)(`div`,{className:`mb-2 flex flex-wrap gap-1.5`,children:m.map(e=>{let n=v(e);return(0,w.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded border px-2 py-0.5 text-xs ${n?`border-slate-700 bg-slate-800 text-slate-500`:`border-red-800 bg-red-950 text-red-300`}`,children:[n&&(0,w.jsx)(t,{size:9}),e,!n&&d&&(0,w.jsx)(`button`,{type:`button`,className:`ml-0.5 text-red-500 hover:text-red-300`,onClick:()=>S(e),children:`×`})]},e)})}),d&&(0,w.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,w.jsx)(`input`,{className:`flex-1 rounded border border-slate-700 bg-slate-900 px-2 py-1 text-xs text-slate-200 focus:border-blue-500 focus:outline-none`,placeholder:`/absolute/path or ~/path`,value:s,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),x())}}),(0,w.jsx)(f,{variant:`ghost`,size:`sm`,className:`scale-75`,onClick:()=>x(),children:`Add`})]})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,w.jsx)(`h3`,{className:`text-xs font-medium text-slate-400`,children:`Approval Required Patterns`}),!p&&(0,w.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px] text-slate-600`,children:[(0,w.jsx)(t,{size:10}),` restart required`]})]}),(0,w.jsxs)(`p`,{className:`mb-2 text-xs text-slate-500`,children:[`Operations matching these glob patterns require user approval before execution. Uses SDK Permission Rule glob syntax (`,(0,w.jsx)(`code`,{className:`text-slate-400`,children:`*`}),` = wildcard, e.g.,`,` `,(0,w.jsx)(`code`,{className:`text-slate-400`,children:`rm -rf *`}),`).`]}),(0,w.jsx)(`div`,{className:`mb-2 flex flex-wrap gap-1.5`,children:h.map(e=>{let n=b(e);return(0,w.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded border px-2 py-0.5 text-xs ${n?`border-slate-700 bg-slate-800 text-slate-500`:`border-amber-800 bg-amber-950 text-amber-300`}`,children:[n&&(0,w.jsx)(t,{size:9}),e,!n&&p&&(0,w.jsx)(`button`,{type:`button`,className:`ml-0.5 text-amber-500 hover:text-amber-300`,onClick:()=>E(e),children:`×`})]},e)})}),p&&(0,w.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,w.jsx)(`input`,{className:`flex-1 rounded border border-slate-700 bg-slate-900 px-2 py-1 text-xs text-slate-200 focus:border-blue-500 focus:outline-none`,placeholder:`e.g. "curl * --request POST *"`,value:l,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),T())}}),(0,w.jsx)(f,{variant:`ghost`,size:`sm`,className:`scale-75`,onClick:()=>T(),children:`Add`})]})]})]})}export{A as Settings};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{I as t,S as n,U as r,X as i,h as a,k as o,nt as s,o as c,v as l,x as u}from"./vendor-icons-CkI4-NxL.js";import{r as d,t as f}from"./vendor-react-DLRtONKt.js";import{n as p,r as m}from"./dist-HyCSN_hp.js";import{C as h,S as g,_,a as v,b as y,c as b,f as x,g as S,h as C,i as w,l as T,m as ee,n as E,o as D,p as O,r as te,s as ne,t as re,u as ie,v as k,w as A,x as j}from"./index-rvaixveh.js";import{t as M}from"./Card-4mOZntHG.js";import{a as ae,o as oe,t as se}from"./format-DvtQjPZn.js";import{t as ce}from"./EmptyState-BlgMMAr-.js";import{a as le,i as N,n as ue,o as P,r as F,t as de}from"./Table-BxbnOSbq.js";import{Goals as I,t as fe}from"./Goals-DdM0tFus.js";import{t as pe}from"./Switch-CTAIxUd_.js";var L=e(s(),1),R=f();function z(e){let t=e+`CollectionProvider`,[n,r]=g(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=L.useRef(null),a=L.useRef(new Map).current;return(0,R.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=S(s),l=L.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,R.jsx)(c,{ref:j(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=S(u),p=L.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=L.useRef(null),s=j(t,o),c=a(u,n);return L.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,R.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return L.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}var B=L.createContext(void 0);function V(e){let t=L.useContext(B);return e||t||`ltr`}var H=`rovingFocusGroup.onEntryFocus`,U={bubbles:!1,cancelable:!0},W=`RovingFocusGroup`,[G,K,me]=z(W),[q,he]=g(W,[me]),[ge,_e]=q(W),J=L.forwardRef((e,t)=>(0,R.jsx)(G.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(G.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(ve,{...e,ref:t})})}));J.displayName=W;var ve=L.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=L.useRef(null),p=j(t,f),m=V(a),[h,g]=_({prop:o,defaultProp:s??null,onChange:c,caller:W}),[v,b]=L.useState(!1),x=ee(l),S=K(n),w=L.useRef(!1),[T,E]=L.useState(0);return L.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(H,x),()=>e.removeEventListener(H,x)},[x]),(0,R.jsx)(ge,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:L.useCallback(e=>g(e),[g]),onItemShiftTab:L.useCallback(()=>b(!0),[]),onFocusableItemAdd:L.useCallback(()=>E(e=>e+1),[]),onFocusableItemRemove:L.useCallback(()=>E(e=>e-1),[]),children:(0,R.jsx)(C.div,{tabIndex:v||T===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:y(e.onMouseDown,()=>{w.current=!0}),onFocus:y(e.onFocus,e=>{let t=!w.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(H,U);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=S().filter(e=>e.focusable);Z([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}w.current=!1}),onBlur:y(e.onBlur,()=>b(!1))})})}),ye=`RovingFocusGroupItem`,be=L.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=k(),l=a||c,u=_e(ye,n),d=u.currentTabStopId===l,f=K(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return L.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,R.jsx)(G.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,R.jsx)(C.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:y(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:y(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:y(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=X(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Se(n,r+1):n.slice(r+1)}setTimeout(()=>Z(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});be.displayName=ye;var Y={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function xe(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function X(e,t,n){let r=xe(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Y[r]}function Z(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Se(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Ce=J,we=be,Q=`Tabs`,[Te,Ee]=g(Q,[he]),De=he(),[Oe,ke]=Te(Q),Ae=L.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=V(s),[d,f]=_({prop:r,onChange:i,defaultProp:a??``,caller:Q});return(0,R.jsx)(Oe,{scope:n,baseId:k(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,R.jsx)(C.div,{dir:u,"data-orientation":o,...l,ref:t})})});Ae.displayName=Q;var je=`TabsList`,Me=L.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=ke(je,n),o=De(n);return(0,R.jsx)(Ce,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,R.jsx)(C.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});Me.displayName=je;var Ne=`TabsTrigger`,Pe=L.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=ke(Ne,n),s=De(n),c=Le(o.baseId,r),l=Re(o.baseId,r),u=r===o.value;return(0,R.jsx)(we,{asChild:!0,...s,focusable:!i,active:u,children:(0,R.jsx)(C.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:y(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:y(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:y(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})});Pe.displayName=Ne;var Fe=`TabsContent`,Ie=L.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=ke(Fe,n),c=Le(s.baseId,r),l=Re(s.baseId,r),u=r===s.value,d=L.useRef(u);return L.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,R.jsx)(O,{present:i||u,children:({present:n})=>(0,R.jsx)(C.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})});Ie.displayName=Fe;function Le(e,t){return`${e}-trigger-${t}`}function Re(e,t){return`${e}-content-${t}`}var ze=Ae,Be=Me,Ve=Pe,He=Ie,Ue=ze,We=L.forwardRef(({className:e,...t},n)=>(0,R.jsx)(Be,{ref:n,className:p(`inline-flex h-9 items-center justify-center rounded-lg bg-slate-800/50 p-1 text-slate-400`,e),...t}));We.displayName=Be.displayName;var Ge=L.forwardRef(({className:e,...t},n)=>(0,R.jsx)(Ve,{ref:n,className:p(`inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-slate-950 transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-slate-900 data-[state=active]:text-slate-100 data-[state=active]:shadow`,e),...t}));Ge.displayName=Ve.displayName;var Ke=L.forwardRef(({className:e,...t},n)=>(0,R.jsx)(He,{ref:n,className:p(`mt-2 ring-offset-slate-950 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2`,e),...t}));Ke.displayName=He.displayName;var qe=[{label:`All`,value:`all`},{label:`Running`,value:`running`},{label:`Pending`,value:`pending`},{label:`Completed`,value:`completed`},{label:`Failed`,value:`failed`},{label:`Cancelled`,value:`cancelled`}],$=new Set([`pending`,`queued`,`running`,`paused`]);function Je(){let e=h(e=>e.tasks),t=h(e=>e.fetchTasks),[n,s]=(0,L.useState)(`all`),[c,u]=(0,L.useState)(!1),[f,p]=(0,L.useState)(``),[g,_]=(0,L.useState)(!1),[v,y]=(0,L.useState)(new Set),[b,S]=(0,L.useState)(!1);(0,L.useEffect)(()=>{let e=n===`all`?void 0:n;t(e);let r=setInterval(()=>void t(e),5e3);return()=>clearInterval(r)},[t,n]),(0,L.useEffect)(()=>{y(new Set)},[n]);let C=async()=>{if(f.trim()){_(!0);try{await m(`/tasks`,{method:`POST`,body:JSON.stringify({prompt:f.trim()})}),p(``),u(!1),t(n===`all`?void 0:n)}finally{_(!1)}}},w=e=>{y(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},T=()=>{let e=D.filter(e=>$.has(e.status)).map(e=>e.id);y(new Set(e))},ee=async()=>{if(v.size!==0){S(!0);try{await m(`/tasks/batch-cancel`,{method:`POST`,body:JSON.stringify({taskIds:Array.from(v)})}),y(new Set),t(n===`all`?void 0:n)}finally{S(!1)}}},D=[...e].sort((e,t)=>t.createdAt-e.createdAt),O=Array.from(v).filter(t=>{let n=e.find(e=>e.id===t);return n&&$.has(n.status)});return(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,R.jsx)(`h1`,{className:`text-lg font-semibold text-slate-100`,children:`Tasks`}),(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[v.size>0&&(0,R.jsxs)(x,{variant:`destructive`,size:`sm`,onClick:()=>void ee(),disabled:b||O.length===0,children:[(0,R.jsx)(r,{size:14}),b?`Cancelling...`:`Cancel ${O.length} task${O.length===1?``:`s`}`]}),(0,R.jsx)(x,{variant:`ghost`,size:`sm`,onClick:()=>void t(n===`all`?void 0:n),children:(0,R.jsx)(a,{size:14})}),(0,R.jsxs)(x,{size:`sm`,onClick:()=>u(!c),children:[(0,R.jsx)(l,{size:14}),`New Task`]})]})]}),c&&(0,R.jsxs)(M,{className:`flex gap-2`,children:[(0,R.jsx)(`input`,{className:`flex-1 rounded-md border border-slate-700 bg-slate-800 px-3 py-1.5 text-sm text-slate-200 placeholder:text-slate-500 focus:border-blue-500 focus:outline-none`,placeholder:`Enter task prompt...`,value:f,onChange:e=>p(e.target.value),onKeyDown:e=>{e.key===`Enter`&&C()}}),(0,R.jsx)(x,{onClick:()=>void C(),disabled:g||!f.trim(),children:g?`Creating...`:`Create`}),(0,R.jsx)(x,{variant:`ghost`,onClick:()=>u(!1),children:`Cancel`})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(`div`,{className:`flex gap-1.5`,children:qe.map(e=>(0,R.jsx)(`button`,{onClick:()=>s(e.value),className:`rounded-md px-2.5 py-1 text-xs font-medium transition-colors ${n===e.value?`bg-slate-800 text-slate-100`:`text-slate-500 hover:text-slate-300`}`,children:e.label},e.value))}),D.some(e=>$.has(e.status))&&(0,R.jsx)(`button`,{onClick:T,className:`text-xs text-slate-500 hover:text-slate-300`,children:`Select all cancellable`}),v.size>0&&(0,R.jsxs)(`button`,{onClick:()=>y(new Set),className:`text-xs text-slate-500 hover:text-slate-300`,children:[`Clear selection (`,v.size,`)`]})]}),(0,R.jsx)(M,{padding:!1,children:D.length===0?(0,R.jsx)(ce,{icon:(0,R.jsx)(o,{size:32}),title:`No tasks found`,description:n===`all`?`Create a task to get started`:`No tasks with status "${n}"`}):(0,R.jsxs)(de,{children:[(0,R.jsx)(le,{children:(0,R.jsxs)(P,{children:[(0,R.jsx)(N,{className:`w-8`,children:(0,R.jsx)(`button`,{onClick:()=>{v.size>0&&v.size===D.filter(e=>$.has(e.status)).length?y(new Set):T()},className:`flex h-4 w-4 items-center justify-center rounded border transition-colors ${v.size>0&&v.size===D.filter(e=>$.has(e.status)).length?`border-blue-600 bg-blue-600 text-white`:`border-slate-600 bg-transparent hover:border-slate-400`}`,children:v.size>0&&v.size===D.filter(e=>$.has(e.status)).length&&(0,R.jsx)(i,{size:12})})}),(0,R.jsx)(N,{children:`ID`}),(0,R.jsx)(N,{children:`Prompt`}),(0,R.jsx)(N,{children:`Status`}),(0,R.jsx)(N,{children:`Role`}),(0,R.jsx)(N,{children:`Cost`}),(0,R.jsx)(N,{children:`Created`})]})}),(0,R.jsx)(ue,{children:D.map(e=>(0,R.jsxs)(P,{className:v.has(e.id)?`bg-slate-800/50`:``,children:[(0,R.jsx)(F,{children:$.has(e.status)?(0,R.jsx)(`button`,{onClick:()=>w(e.id),className:`flex h-4 w-4 items-center justify-center rounded border transition-colors ${v.has(e.id)?`border-blue-600 bg-blue-600 text-white`:`border-slate-600 bg-transparent hover:border-slate-400`}`,children:v.has(e.id)&&(0,R.jsx)(i,{size:12})}):(0,R.jsx)(`span`,{className:`inline-block w-4`})}),(0,R.jsx)(F,{children:(0,R.jsx)(d,{to:`/tasks/${e.id}`,className:`font-mono text-xs text-blue-400 hover:text-blue-300`,children:e.id.slice(0,8)})}),(0,R.jsx)(F,{children:oe(e.prompt,80)}),(0,R.jsx)(F,{children:(0,R.jsx)(re,{variant:E(e.status),children:e.status})}),(0,R.jsx)(F,{children:(0,R.jsx)(`span`,{className:`font-mono text-xs text-slate-500`,children:e.roleId?e.roleId.slice(0,12):`—`})}),(0,R.jsx)(F,{className:`font-mono text-xs`,children:e.costUsd==null?`—`:se(e.costUsd)}),(0,R.jsx)(F,{className:`text-xs text-slate-500`,children:ae(e.createdAt)})]},e.id))})]})})]})}function Ye(){let e=h(e=>e.templates),r=h(e=>e.fetchTemplates),i=h(e=>e.goals),o=h(e=>e.fetchGoals),[s,d]=(0,L.useState)(!1),[f,p]=(0,L.useState)(``),[g,_]=(0,L.useState)(`manual`),[y,S]=(0,L.useState)(``),[C,ee]=(0,L.useState)(``),[E,O]=(0,L.useState)(``),[k,j]=(0,L.useState)(!1),[oe,se]=(0,L.useState)(null),[I,z]=(0,L.useState)(null),[B,V]=(0,L.useState)(null),[H,U]=(0,L.useState)(null),[W,G]=(0,L.useState)(``),[K,me]=(0,L.useState)(`manual`),[q,he]=(0,L.useState)(``),[ge,_e]=(0,L.useState)(``),[J,ve]=(0,L.useState)(``),[ye,be]=(0,L.useState)(!1),[Y,xe]=(0,L.useState)(`prompt`),[X,Z]=(0,L.useState)([]),[Se,Ce]=(0,L.useState)([]),[we,Q]=(0,L.useState)([]);(0,L.useEffect)(()=>{r(),o()},[r,o]);let Te=async()=>{if(f.trim()&&!(Y===`prompt`&&!E.trim())&&!(Y===`goal`&&X.length===0)){j(!0);try{let e={name:f.trim(),trigger:{type:g,...g===`cron`&&y?{cron:y}:{},...g===`once`&&C?{runAt:new Date(C).toISOString()}:{}},enabled:!0,...Se.length>0?{deliverTo:Se}:{}};Y===`prompt`?e.steps=[{id:`step-1`,prompt:E.trim()}]:(e.goalIds=X,e.steps=[]),await m(`/task-templates`,{method:`POST`,body:JSON.stringify(e)}),p(``),O(``),S(``),ee(``),Z([]),Ce([]),d(!1),r()}finally{j(!1)}}},Ee=async t=>{let n=e.find(e=>e.id===t);se(t);try{await m(`/task-templates/${t}/run`,{method:`POST`}),A.success(`Triggered: ${n?.name??t}`)}catch(e){let t=e instanceof Error?e.message:`Failed to trigger template`;A.error(`Trigger failed: ${t}`)}finally{se(null)}},De=async t=>{let n=e.find(e=>e.id===t);try{await m(`/task-templates/${t}`,{method:`DELETE`}),A.success(`Deleted: ${n?.name??t}`),r()}catch(e){let t=e instanceof Error?e.message:`Failed to delete template`;A.error(`Delete failed: ${t}`)}},Oe=async t=>{let n=e.find(e=>e.id===t);if(!n)return;if(n.trigger.type!==`cron`&&n.trigger.type!==`event`&&n.trigger.type!==`once`){A.error(`Toggle not applicable for manual triggers`);return}let i=!n.enabled;try{await m(`/task-templates/${t}`,{method:`PATCH`,body:JSON.stringify({enabled:i})}),A.success(`${n.name} ${i?`enabled`:`disabled`}`),r()}catch(e){let t=e instanceof Error?e.message:`Failed to toggle template`;A.error(`Toggle failed: ${t}`)}},ke=e=>{U(e.id),G(e.name),me(e.trigger.type),he(e.trigger.cron??``),_e(e.trigger.runAt?new Date(e.trigger.runAt).toISOString().slice(0,16):``),ve(e.steps[0]?.prompt??``),Q(e.deliverTo??[])},Ae=async()=>{if(!(!H||!W.trim()||!J.trim())){be(!0);try{await m(`/task-templates/${H}`,{method:`PATCH`,body:JSON.stringify({name:W.trim(),trigger:{type:K,...K===`cron`&&q?{cron:q}:{},...K===`once`&&ge?{runAt:new Date(ge).toISOString()}:{}},steps:[{id:`step-1`,prompt:J.trim()}],enabled:e.find(e=>e.id===H)?.enabled??!0,deliverTo:we.length>0?we:void 0})}),U(null),r(),A.success(`Template updated`)}catch(e){let t=e instanceof Error?e.message:`Failed to update template`;A.error(t)}finally{be(!1)}}},je=e.find(e=>e.id===I),Me=e.find(e=>e.id===B);return(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,R.jsx)(`h1`,{className:`text-lg font-semibold text-slate-100`,children:`Automations`}),(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsx)(x,{variant:`ghost`,size:`sm`,onClick:()=>void r(),children:(0,R.jsx)(a,{size:14})}),(0,R.jsxs)(x,{size:`sm`,onClick:()=>d(!s),children:[(0,R.jsx)(l,{size:14}),`New Automation`]})]})]}),s&&(0,R.jsxs)(M,{className:`space-y-3`,children:[(0,R.jsx)(`input`,{className:`w-full rounded-md border border-slate-700 bg-slate-800 px-3 py-1.5 text-sm text-slate-200 placeholder:text-slate-500 focus:border-blue-500 focus:outline-none`,placeholder:`Template name`,value:f,onChange:e=>p(e.target.value)}),(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsxs)(`select`,{className:`rounded-md border border-slate-700 bg-slate-800 px-3 py-1.5 text-sm text-slate-200 focus:border-blue-500 focus:outline-none`,value:g,onChange:e=>_(e.target.value),children:[(0,R.jsx)(`option`,{value:`manual`,children:`Manual`}),(0,R.jsx)(`option`,{value:`cron`,children:`Cron`}),(0,R.jsx)(`option`,{value:`event`,children:`Event`}),(0,R.jsx)(`option`,{value:`once`,children:`Once`})]}),g===`cron`&&(0,R.jsx)(`input`,{className:`flex-1 rounded-md border border-slate-700 bg-slate-800 px-3 py-1.5 text-sm text-slate-200 placeholder:text-slate-500 focus:border-blue-500 focus:outline-none`,placeholder:`Cron expression (e.g. */5 * * * *)`,value:y,onChange:e=>S(e.target.value)}),g===`once`&&(0,R.jsx)(`input`,{type:`datetime-local`,className:`flex-1 rounded-md border border-slate-700 bg-slate-800 px-3 py-1.5 text-sm text-slate-200 focus:border-blue-500 focus:outline-none`,value:C,onChange:e=>ee(e.target.value)})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,R.jsx)(`span`,{className:`text-xs text-slate-400`,children:`Action type:`}),(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:()=>xe(`prompt`),className:`rounded px-2 py-1 text-xs ${Y===`prompt`?`bg-blue-600 text-white`:`bg-slate-800 text-slate-400 hover:text-slate-300`}`,children:`Custom Prompt`}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>xe(`goal`),className:`rounded px-2 py-1 text-xs ${Y===`goal`?`bg-blue-600 text-white`:`bg-slate-800 text-slate-400 hover:text-slate-300`}`,children:`Goal Reference`})]})]}),Y===`prompt`?(0,R.jsx)(`textarea`,{className:`w-full rounded-md border border-slate-700 bg-slate-800 px-3 py-2 text-sm text-slate-200 placeholder:text-slate-500 focus:border-blue-500 focus:outline-none`,placeholder:`Step prompt`,rows:3,value:E,onChange:e=>O(e.target.value)}):(0,R.jsx)(`div`,{className:`space-y-1`,children:i.length===0?(0,R.jsx)(`p`,{className:`text-xs text-slate-500`,children:`No goals available`}):i.map(e=>(0,R.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-slate-300 hover:text-slate-100 cursor-pointer`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:X.includes(e.id),onChange:t=>{t.target.checked?Z([...X,e.id]):Z(X.filter(t=>t!==e.id))},className:`rounded border-slate-600 bg-slate-800`}),(0,R.jsx)(`span`,{className:`truncate`,children:e.name}),(0,R.jsx)(re,{variant:`muted`,className:`text-[10px]`,children:e.status})]},e.id))}),(0,R.jsx)(fe,{value:Se,onChange:Ce}),(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsx)(x,{onClick:()=>void Te(),disabled:k||!f.trim()||Y===`prompt`&&!E.trim()||Y===`goal`&&X.length===0,children:k?`Creating...`:`Create`}),(0,R.jsx)(x,{variant:`ghost`,onClick:()=>d(!1),children:`Cancel`})]})]}),H!==null&&(0,R.jsxs)(M,{className:`space-y-3`,children:[(0,R.jsx)(`span`,{className:`text-sm font-medium text-slate-200`,children:`Edit Automation`}),(0,R.jsx)(`input`,{className:`w-full rounded-md border border-slate-700 bg-slate-800 px-3 py-1.5 text-sm text-slate-200 placeholder:text-slate-500 focus:border-blue-500 focus:outline-none`,placeholder:`Template name`,value:W,onChange:e=>G(e.target.value)}),(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsxs)(`select`,{className:`rounded-md border border-slate-700 bg-slate-800 px-3 py-1.5 text-sm text-slate-200 focus:border-blue-500 focus:outline-none`,value:K,onChange:e=>me(e.target.value),children:[(0,R.jsx)(`option`,{value:`manual`,children:`Manual`}),(0,R.jsx)(`option`,{value:`cron`,children:`Cron`}),(0,R.jsx)(`option`,{value:`event`,children:`Event`}),(0,R.jsx)(`option`,{value:`once`,children:`Once`})]}),K===`cron`&&(0,R.jsx)(`input`,{className:`flex-1 rounded-md border border-slate-700 bg-slate-800 px-3 py-1.5 text-sm text-slate-200 placeholder:text-slate-500 focus:border-blue-500 focus:outline-none`,placeholder:`Cron expression`,value:q,onChange:e=>he(e.target.value)}),K===`once`&&(0,R.jsx)(`input`,{type:`datetime-local`,className:`flex-1 rounded-md border border-slate-700 bg-slate-800 px-3 py-1.5 text-sm text-slate-200 focus:border-blue-500 focus:outline-none`,value:ge,onChange:e=>_e(e.target.value)})]}),(0,R.jsx)(`textarea`,{className:`w-full rounded-md border border-slate-700 bg-slate-800 px-3 py-2 text-sm text-slate-200 placeholder:text-slate-500 focus:border-blue-500 focus:outline-none`,placeholder:`Step prompt`,rows:3,value:J,onChange:e=>ve(e.target.value)}),(0,R.jsx)(fe,{value:we,onChange:Q}),(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsx)(x,{onClick:()=>void Ae(),disabled:ye||!W.trim()||!J.trim(),children:ye?`Saving...`:`Save`}),(0,R.jsx)(x,{variant:`ghost`,onClick:()=>U(null),children:`Cancel`})]})]}),(0,R.jsx)(M,{padding:!1,children:e.length===0?(0,R.jsx)(ce,{icon:(0,R.jsx)(t,{size:32}),title:`No automations`,description:`Create an automation to run recurring tasks`}):(0,R.jsxs)(de,{children:[(0,R.jsx)(le,{children:(0,R.jsxs)(P,{children:[(0,R.jsx)(N,{children:`Name`}),(0,R.jsx)(N,{children:`Trigger`}),(0,R.jsx)(N,{children:`Schedule`}),(0,R.jsx)(N,{children:`Steps`}),(0,R.jsx)(N,{children:`Enabled`}),(0,R.jsx)(N,{children:`Created`}),(0,R.jsx)(N,{children:`Webhook URL`}),(0,R.jsx)(N,{children:`Actions`})]})}),(0,R.jsx)(ue,{children:e.map(e=>(0,R.jsxs)(P,{children:[(0,R.jsx)(F,{className:`font-medium text-slate-200`,children:e.name}),(0,R.jsx)(F,{children:(0,R.jsx)(re,{variant:e.trigger.type===`cron`?`info`:e.trigger.type===`event`?`warning`:(e.trigger.type,`muted`),children:e.trigger.type})}),(0,R.jsx)(F,{className:`font-mono text-xs`,children:e.trigger.type===`once`&&e.trigger.runAt?new Date(e.trigger.runAt).toLocaleString():e.trigger.cron??`—`}),(0,R.jsx)(F,{className:`font-mono text-xs`,children:e.goalIds&&e.goalIds.length>0?`Goals: ${e.goalIds.length}`:e.steps.length}),(0,R.jsx)(F,{children:e.trigger.type!==`cron`&&e.trigger.type!==`event`&&e.trigger.type!==`once`?(0,R.jsx)(`span`,{className:`text-xs text-slate-500`,children:`—`}):(0,R.jsx)(pe,{checked:e.enabled,onCheckedChange:()=>void Oe(e.id),"aria-label":`Toggle ${e.name}`})}),(0,R.jsx)(F,{className:`text-xs text-slate-500`,children:e.createdAt?ae(e.createdAt):`—`}),(0,R.jsx)(F,{className:`font-mono text-xs text-slate-400`,children:e.enabled?`POST /webhooks/${e.id}`:`—`}),(0,R.jsx)(F,{children:(0,R.jsxs)(`div`,{className:`flex gap-1`,children:[(0,R.jsx)(x,{variant:`ghost`,size:`sm`,onClick:()=>ke(e),title:`Edit`,children:(0,R.jsx)(n,{size:12})}),(0,R.jsx)(x,{variant:`ghost`,size:`sm`,onClick:()=>z(e.id),disabled:oe===e.id,title:`Run now`,children:(0,R.jsx)(u,{size:12})}),(0,R.jsx)(x,{variant:`ghost`,size:`sm`,onClick:()=>V(e.id),title:`Delete`,children:(0,R.jsx)(c,{size:12,className:`text-red-400`})})]})})]},e.id))})]})}),(0,R.jsx)(te,{open:I!==null,onOpenChange:e=>{e||z(null)},children:(0,R.jsxs)(D,{children:[(0,R.jsxs)(T,{children:[(0,R.jsx)(ie,{children:`Run Template`}),(0,R.jsxs)(ne,{children:[`Run “`,je?.name,`” now? This will execute the template immediately.`]})]}),(0,R.jsxs)(b,{children:[(0,R.jsx)(v,{children:`Cancel`}),(0,R.jsx)(w,{onClick:()=>{I&&Ee(I),z(null)},children:`Run Now`})]})]})}),(0,R.jsx)(te,{open:B!==null,onOpenChange:e=>{e||V(null)},children:(0,R.jsxs)(D,{children:[(0,R.jsxs)(T,{children:[(0,R.jsx)(ie,{children:`Delete Template`}),(0,R.jsxs)(ne,{children:[`Delete “`,Me?.name,`”? This action cannot be undone.`]})]}),(0,R.jsxs)(b,{children:[(0,R.jsx)(v,{children:`Cancel`}),(0,R.jsx)(w,{className:`bg-red-600 hover:bg-red-500`,onClick:()=>{B&&De(B),V(null)},children:`Delete`})]})]})})]})}function Xe(){return(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsx)(`h1`,{className:`text-lg font-semibold text-slate-100`,children:`Work`}),(0,R.jsxs)(Ue,{defaultValue:`tasks`,children:[(0,R.jsxs)(We,{children:[(0,R.jsx)(Ge,{value:`tasks`,children:`Tasks`}),(0,R.jsx)(Ge,{value:`automations`,children:`Automations`}),(0,R.jsx)(Ge,{value:`goals`,children:`Goals`})]}),(0,R.jsx)(Ke,{value:`tasks`,children:(0,R.jsx)(Je,{})}),(0,R.jsx)(Ke,{value:`automations`,children:(0,R.jsx)(Ye,{})}),(0,R.jsx)(Ke,{value:`goals`,children:(0,R.jsx)(I,{})})]})]})}export{Xe as Work};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */
|
|
2
|
-
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-space-x-reverse:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-red-950:oklch(25.8% .092 26.042);--color-orange-400:oklch(75% .183 55.934);--color-orange-500:oklch(70.5% .213 47.604);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-amber-950:oklch(27.9% .077 45.635);--color-yellow-300:oklch(90.5% .182 98.111);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-600:oklch(68.1% .162 75.834);--color-yellow-800:oklch(47.6% .114 61.907);--color-yellow-900:oklch(42.1% .095 57.708);--color-yellow-950:oklch(28.6% .066 53.813);--color-green-300:oklch(87.1% .15 154.449);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-800:oklch(44.8% .119 151.328);--color-green-900:oklch(39.3% .095 152.535);--color-green-950:oklch(26.6% .065 152.934);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-800:oklch(43.2% .095 166.913);--color-emerald-900:oklch(37.8% .077 168.94);--color-teal-400:oklch(77.7% .152 181.912);--color-cyan-400:oklch(78.9% .154 211.53);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-blue-900:oklch(37.9% .146 265.522);--color-purple-400:oklch(71.4% .203 305.504);--color-pink-400:oklch(71.8% .202 349.761);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-700:oklch(37.2% .044 257.287);--color-slate-800:oklch(27.9% .041 260.031);--color-slate-900:oklch(20.8% .042 265.755);--color-slate-950:oklch(12.9% .042 264.695);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-6xl:3.75rem;--text-6xl--line-height:1;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-relaxed:1.625;--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing) * 2)}.top-\[50\%\]{top:50%}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.right-2{right:calc(var(--spacing) * 2)}.right-4{right:calc(var(--spacing) * 4)}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-2{left:calc(var(--spacing) * 2)}.left-2\.5{left:calc(var(--spacing) * 2.5)}.left-\[50\%\]{left:50%}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.mx-1{margin-inline:calc(var(--spacing) * 1)}.mx-4{margin-inline:calc(var(--spacing) * 4)}.mx-auto{margin-inline:auto}.my-1{margin-block:calc(var(--spacing) * 1)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mr-1{margin-right:calc(var(--spacing) * 1)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.ml-0\.5{margin-left:calc(var(--spacing) * .5)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-3{margin-left:calc(var(--spacing) * 3)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-64{height:calc(var(--spacing) * 64)}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-32{max-height:calc(var(--spacing) * 32)}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-96{max-height:calc(var(--spacing) * 96)}.max-h-\[80vh\]{max-height:80vh}.max-h-\[calc\(100vh-280px\)\]{max-height:calc(100vh - 280px)}.min-h-0{min-height:calc(var(--spacing) * 0)}.w-0\.5{width:calc(var(--spacing) * .5)}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-12{width:calc(var(--spacing) * 12)}.w-16{width:calc(var(--spacing) * 16)}.w-20{width:calc(var(--spacing) * 20)}.w-28{width:calc(var(--spacing) * 28)}.w-48{width:calc(var(--spacing) * 48)}.w-56{width:calc(var(--spacing) * 56)}.w-60{width:calc(var(--spacing) * 60)}.w-64{width:calc(var(--spacing) * 64)}.w-full{width:100%}.w-px{width:1px}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-\[80\%\]{max-width:80%}.max-w-\[120px\]{max-width:120px}.max-w-\[180px\]{max-width:180px}.max-w-\[280px\]{max-width:280px}.max-w-\[300px\]{max-width:300px}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[140px\]{min-width:140px}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.scale-75{--tw-scale-x:75%;--tw-scale-y:75%;--tw-scale-z:75%;scale:var(--tw-scale-x) var(--tw-scale-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-0>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 0) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 0) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-slate-800\/50>:not(:last-child)){border-color:#1d293d80}@supports (color:color-mix(in lab, red, red)){:where(.divide-slate-800\/50>:not(:last-child)){border-color:color-mix(in oklab, var(--color-slate-800) 50%, transparent)}}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) * .8)}.rounded-sm{border-radius:calc(var(--radius) * .6)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-amber-700{border-color:var(--color-amber-700)}.border-amber-800{border-color:var(--color-amber-800)}.border-amber-900\/50{border-color:#7b330680}@supports (color:color-mix(in lab, red, red)){.border-amber-900\/50{border-color:color-mix(in oklab, var(--color-amber-900) 50%, transparent)}}.border-blue-600{border-color:var(--color-blue-600)}.border-blue-800{border-color:var(--color-blue-800)}.border-blue-800\/50{border-color:#193cb880}@supports (color:color-mix(in lab, red, red)){.border-blue-800\/50{border-color:color-mix(in oklab, var(--color-blue-800) 50%, transparent)}}.border-emerald-800{border-color:var(--color-emerald-800)}.border-green-600{border-color:var(--color-green-600)}.border-green-800{border-color:var(--color-green-800)}.border-red-500{border-color:var(--color-red-500)}.border-red-500\/40{border-color:#fb2c3666}@supports (color:color-mix(in lab, red, red)){.border-red-500\/40{border-color:color-mix(in oklab, var(--color-red-500) 40%, transparent)}}.border-red-800{border-color:var(--color-red-800)}.border-slate-600{border-color:var(--color-slate-600)}.border-slate-700{border-color:var(--color-slate-700)}.border-slate-800{border-color:var(--color-slate-800)}.border-transparent{border-color:#0000}.border-yellow-600{border-color:var(--color-yellow-600)}.border-yellow-800{border-color:var(--color-yellow-800)}.border-t-blue-500{border-top-color:var(--color-blue-500)}.bg-amber-900\/50{background-color:#7b330680}@supports (color:color-mix(in lab, red, red)){.bg-amber-900\/50{background-color:color-mix(in oklab, var(--color-amber-900) 50%, transparent)}}.bg-amber-950{background-color:var(--color-amber-950)}.bg-amber-950\/20{background-color:#46190133}@supports (color:color-mix(in lab, red, red)){.bg-amber-950\/20{background-color:color-mix(in oklab, var(--color-amber-950) 20%, transparent)}}.bg-amber-950\/30{background-color:#4619014d}@supports (color:color-mix(in lab, red, red)){.bg-amber-950\/30{background-color:color-mix(in oklab, var(--color-amber-950) 30%, transparent)}}.bg-black{background-color:var(--color-black)}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab, red, red)){.bg-black\/60{background-color:color-mix(in oklab, var(--color-black) 60%, transparent)}}.bg-black\/80{background-color:#000c}@supports (color:color-mix(in lab, red, red)){.bg-black\/80{background-color:color-mix(in oklab, var(--color-black) 80%, transparent)}}.bg-blue-400{background-color:var(--color-blue-400)}.bg-blue-500{background-color:var(--color-blue-500)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-blue-900\/30{background-color:#1c398e4d}@supports (color:color-mix(in lab, red, red)){.bg-blue-900\/30{background-color:color-mix(in oklab, var(--color-blue-900) 30%, transparent)}}.bg-blue-900\/50{background-color:#1c398e80}@supports (color:color-mix(in lab, red, red)){.bg-blue-900\/50{background-color:color-mix(in oklab, var(--color-blue-900) 50%, transparent)}}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-emerald-900\/50{background-color:#004e3b80}@supports (color:color-mix(in lab, red, red)){.bg-emerald-900\/50{background-color:color-mix(in oklab, var(--color-emerald-900) 50%, transparent)}}.bg-green-500{background-color:var(--color-green-500)}.bg-green-900\/30{background-color:#0d542b4d}@supports (color:color-mix(in lab, red, red)){.bg-green-900\/30{background-color:color-mix(in oklab, var(--color-green-900) 30%, transparent)}}.bg-green-950{background-color:var(--color-green-950)}.bg-orange-500{background-color:var(--color-orange-500)}.bg-red-500{background-color:var(--color-red-500)}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab, red, red)){.bg-red-500\/10{background-color:color-mix(in oklab, var(--color-red-500) 10%, transparent)}}.bg-red-600{background-color:var(--color-red-600)}.bg-red-900\/30{background-color:#82181a4d}@supports (color:color-mix(in lab, red, red)){.bg-red-900\/30{background-color:color-mix(in oklab, var(--color-red-900) 30%, transparent)}}.bg-red-900\/50{background-color:#82181a80}@supports (color:color-mix(in lab, red, red)){.bg-red-900\/50{background-color:color-mix(in oklab, var(--color-red-900) 50%, transparent)}}.bg-red-950{background-color:var(--color-red-950)}.bg-red-950\/10{background-color:#4608091a}@supports (color:color-mix(in lab, red, red)){.bg-red-950\/10{background-color:color-mix(in oklab, var(--color-red-950) 10%, transparent)}}.bg-red-950\/30{background-color:#4608094d}@supports (color:color-mix(in lab, red, red)){.bg-red-950\/30{background-color:color-mix(in oklab, var(--color-red-950) 30%, transparent)}}.bg-slate-500{background-color:var(--color-slate-500)}.bg-slate-700{background-color:var(--color-slate-700)}.bg-slate-800{background-color:var(--color-slate-800)}.bg-slate-800\/30{background-color:#1d293d4d}@supports (color:color-mix(in lab, red, red)){.bg-slate-800\/30{background-color:color-mix(in oklab, var(--color-slate-800) 30%, transparent)}}.bg-slate-800\/50{background-color:#1d293d80}@supports (color:color-mix(in lab, red, red)){.bg-slate-800\/50{background-color:color-mix(in oklab, var(--color-slate-800) 50%, transparent)}}.bg-slate-900{background-color:var(--color-slate-900)}.bg-slate-900\/50{background-color:#0f172b80}@supports (color:color-mix(in lab, red, red)){.bg-slate-900\/50{background-color:color-mix(in oklab, var(--color-slate-900) 50%, transparent)}}.bg-slate-950{background-color:var(--color-slate-950)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-yellow-400{background-color:var(--color-yellow-400)}.bg-yellow-500{background-color:var(--color-yellow-500)}.bg-yellow-950{background-color:var(--color-yellow-950)}.bg-yellow-950\/50{background-color:#43200480}@supports (color:color-mix(in lab, red, red)){.bg-yellow-950\/50{background-color:color-mix(in oklab, var(--color-yellow-950) 50%, transparent)}}.fill-current{fill:currentColor}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:calc(var(--spacing) * 1)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-16{padding-block:calc(var(--spacing) * 16)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-8{padding-left:calc(var(--spacing) * 8)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-6xl{font-size:var(--text-6xl);line-height:var(--tw-leading,var(--text-6xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-200{color:var(--color-amber-200)}.text-amber-300{color:var(--color-amber-300)}.text-amber-400{color:var(--color-amber-400)}.text-amber-500{color:var(--color-amber-500)}.text-blue-200\/60{color:#bedbff99}@supports (color:color-mix(in lab, red, red)){.text-blue-200\/60{color:color-mix(in oklab, var(--color-blue-200) 60%, transparent)}}.text-blue-300{color:var(--color-blue-300)}.text-blue-400{color:var(--color-blue-400)}.text-blue-500{color:var(--color-blue-500)}.text-cyan-400{color:var(--color-cyan-400)}.text-emerald-400{color:var(--color-emerald-400)}.text-emerald-500{color:var(--color-emerald-500)}.text-green-300{color:var(--color-green-300)}.text-green-400{color:var(--color-green-400)}.text-green-500{color:var(--color-green-500)}.text-orange-400{color:var(--color-orange-400)}.text-pink-400{color:var(--color-pink-400)}.text-purple-400{color:var(--color-purple-400)}.text-red-300{color:var(--color-red-300)}.text-red-400{color:var(--color-red-400)}.text-red-500{color:var(--color-red-500)}.text-slate-100{color:var(--color-slate-100)}.text-slate-200{color:var(--color-slate-200)}.text-slate-300{color:var(--color-slate-300)}.text-slate-400{color:var(--color-slate-400)}.text-slate-500{color:var(--color-slate-500)}.text-slate-600{color:var(--color-slate-600)}.text-teal-400{color:var(--color-teal-400)}.text-white{color:var(--color-white)}.text-yellow-300{color:var(--color-yellow-300)}.text-yellow-400{color:var(--color-yellow-400)}.text-yellow-500{color:var(--color-yellow-500)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.italic{font-style:italic}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.placeholder-slate-500::placeholder{color:var(--color-slate-500)}.placeholder-slate-600::placeholder{color:var(--color-slate-600)}.opacity-0{opacity:0}.opacity-60{opacity:.6}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-red-400{--tw-ring-color:var(--color-red-400)}.ring-offset-slate-950{--tw-ring-offset-color:var(--color-slate-950)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.animate-in{--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial;animation-name:enter;animation-duration:.15s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.duration-200{animation-duration:.2s}.fade-in-0{--tw-enter-opacity:0}.paused{animation-play-state:paused}.running{animation-play-state:running}.slide-in-from-left-1\/2{--tw-enter-translate-x:-50%}.slide-in-from-top-\[48\%\]{--tw-enter-translate-y:-48%}.slide-out-to-left-1\/2{--tw-exit-translate-x:-50%}.slide-out-to-top-\[48\%\]{--tw-exit-translate-y:-48%}.zoom-in-95{--tw-enter-scale:.95}@media (hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}.group-hover\/install\:block:is(:where(.group\/install):hover *){display:block}}.group-\[\.toast\]\:bg-blue-600:is(:where(.group).toast *){background-color:var(--color-blue-600)}.group-\[\.toast\]\:bg-slate-800:is(:where(.group).toast *){background-color:var(--color-slate-800)}.group-\[\.toast\]\:text-slate-200:is(:where(.group).toast *){color:var(--color-slate-200)}.group-\[\.toast\]\:text-slate-400:is(:where(.group).toast *){color:var(--color-slate-400)}.group-\[\.toast\]\:text-white:is(:where(.group).toast *){color:var(--color-white)}.group-\[\.toaster\]\:border-slate-800:is(:where(.group).toaster *){border-color:var(--color-slate-800)}.group-\[\.toaster\]\:bg-slate-900:is(:where(.group).toaster *){background-color:var(--color-slate-900)}.group-\[\.toaster\]\:text-slate-200:is(:where(.group).toaster *){color:var(--color-slate-200)}.group-\[\.toaster\]\:shadow-lg:is(:where(.group).toaster *){--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.placeholder\:text-slate-500::placeholder{color:var(--color-slate-500)}.placeholder\:text-slate-600::placeholder{color:var(--color-slate-600)}@media (hover:hover){.hover\:border-slate-400:hover{border-color:var(--color-slate-400)}.hover\:border-slate-600:hover{border-color:var(--color-slate-600)}.hover\:bg-blue-500:hover{background-color:var(--color-blue-500)}.hover\:bg-green-900:hover{background-color:var(--color-green-900)}.hover\:bg-red-500:hover{background-color:var(--color-red-500)}.hover\:bg-red-700:hover{background-color:var(--color-red-700)}.hover\:bg-slate-700:hover{background-color:var(--color-slate-700)}.hover\:bg-slate-800:hover{background-color:var(--color-slate-800)}.hover\:bg-slate-800\/30:hover{background-color:#1d293d4d}@supports (color:color-mix(in lab, red, red)){.hover\:bg-slate-800\/30:hover{background-color:color-mix(in oklab, var(--color-slate-800) 30%, transparent)}}.hover\:bg-slate-800\/50:hover{background-color:#1d293d80}@supports (color:color-mix(in lab, red, red)){.hover\:bg-slate-800\/50:hover{background-color:color-mix(in oklab, var(--color-slate-800) 50%, transparent)}}.hover\:bg-slate-900:hover{background-color:var(--color-slate-900)}.hover\:bg-yellow-900:hover{background-color:var(--color-yellow-900)}.hover\:text-amber-200:hover{color:var(--color-amber-200)}.hover\:text-amber-300:hover{color:var(--color-amber-300)}.hover\:text-amber-400:hover{color:var(--color-amber-400)}.hover\:text-blue-300:hover{color:var(--color-blue-300)}.hover\:text-emerald-400:hover{color:var(--color-emerald-400)}.hover\:text-green-300:hover{color:var(--color-green-300)}.hover\:text-red-300:hover{color:var(--color-red-300)}.hover\:text-red-400:hover{color:var(--color-red-400)}.hover\:text-slate-100:hover{color:var(--color-slate-100)}.hover\:text-slate-200:hover{color:var(--color-slate-200)}.hover\:text-slate-300:hover{color:var(--color-slate-300)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:not-sr-only:focus{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.focus\:fixed:focus{position:fixed}.focus\:top-4:focus{top:calc(var(--spacing) * 4)}.focus\:left-4:focus{left:calc(var(--spacing) * 4)}.focus\:z-50:focus{z-index:50}.focus\:rounded-md:focus{border-radius:calc(var(--radius) * .8)}.focus\:border-blue-500:focus{border-color:var(--color-blue-500)}.focus\:bg-blue-600:focus{background-color:var(--color-blue-600)}.focus\:bg-slate-800:focus{background-color:var(--color-slate-800)}.focus\:px-4:focus{padding-inline:calc(var(--spacing) * 4)}.focus\:py-2:focus{padding-block:calc(var(--spacing) * 2)}.focus\:text-sm:focus{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.focus\:font-medium:focus{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.focus\:text-slate-100:focus{color:var(--color-slate-100)}.focus\:text-white:focus{color:var(--color-white)}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-blue-500:focus{--tw-ring-color:var(--color-blue-500)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus\:ring-offset-slate-900:focus{--tw-ring-offset-color:var(--color-slate-900)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-blue-500:focus-visible{--tw-ring-color:var(--color-blue-500)}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\:ring-offset-slate-900:focus-visible{--tw-ring-offset-color:var(--color-slate-900)}.focus-visible\:ring-offset-slate-950:focus-visible{--tw-ring-offset-color:var(--color-slate-950)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.active\:bg-blue-700:active{background-color:var(--color-blue-700)}.active\:bg-red-700:active{background-color:var(--color-red-700)}.active\:bg-slate-600:active{background-color:var(--color-slate-600)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:-.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:.5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:-.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:.5rem}.data-\[state\=active\]\:bg-slate-900[data-state=active]{background-color:var(--color-slate-900)}.data-\[state\=active\]\:text-slate-100[data-state=active]{color:var(--color-slate-100)}.data-\[state\=active\]\:shadow[data-state=active]{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.data-\[state\=checked\]\:translate-x-4[data-state=checked]{--tw-translate-x:calc(var(--spacing) * 4);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[state\=checked\]\:bg-blue-600[data-state=checked]{background-color:var(--color-blue-600)}.data-\[state\=closed\]\:animate-out[data-state=closed]{--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial;animation-name:exit;animation-duration:.15s}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x:-50%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y:-48%}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\[state\=open\]\:bg-slate-800[data-state=open]{background-color:var(--color-slate-800)}.data-\[state\=open\]\:animate-in[data-state=open]{--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial;animation-name:enter;animation-duration:.15s}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x:-50%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y:-48%}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[state\=unchecked\]\:bg-slate-700[data-state=unchecked]{background-color:var(--color-slate-700)}@media (width>=40rem){.sm\:mt-0{margin-top:calc(var(--spacing) * 0)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}:where(.sm\:space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * 2) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:text-left{text-align:left}}@media (width>=48rem){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}@media (width>=64rem){.lg\:block{display:block}.lg\:hidden{display:none}.lg\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:p-6{padding:calc(var(--spacing) * 6)}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}}:root{--background:oklch(100% 0 0);--foreground:oklch(14.5% 0 0);--card:oklch(100% 0 0);--card-foreground:oklch(14.5% 0 0);--popover:oklch(100% 0 0);--popover-foreground:oklch(14.5% 0 0);--primary:oklch(20.5% 0 0);--primary-foreground:oklch(98.5% 0 0);--secondary:oklch(97% 0 0);--secondary-foreground:oklch(20.5% 0 0);--muted:oklch(97% 0 0);--muted-foreground:oklch(55.6% 0 0);--accent:oklch(97% 0 0);--accent-foreground:oklch(20.5% 0 0);--destructive:oklch(57.7% .245 27.325);--border:oklch(92.2% 0 0);--input:oklch(92.2% 0 0);--ring:oklch(70.8% 0 0);--chart-1:oklch(87% 0 0);--chart-2:oklch(55.6% 0 0);--chart-3:oklch(43.9% 0 0);--chart-4:oklch(37.1% 0 0);--chart-5:oklch(26.9% 0 0);--radius:.625rem;--sidebar:oklch(98.5% 0 0);--sidebar-foreground:oklch(14.5% 0 0);--sidebar-primary:oklch(20.5% 0 0);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(97% 0 0);--sidebar-accent-foreground:oklch(20.5% 0 0);--sidebar-border:oklch(92.2% 0 0);--sidebar-ring:oklch(70.8% 0 0)}.dark{--background:oklch(14.5% 0 0);--foreground:oklch(98.5% 0 0);--card:oklch(20.5% 0 0);--card-foreground:oklch(98.5% 0 0);--popover:oklch(20.5% 0 0);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(92.2% 0 0);--primary-foreground:oklch(20.5% 0 0);--secondary:oklch(26.9% 0 0);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(26.9% 0 0);--muted-foreground:oklch(70.8% 0 0);--accent:oklch(26.9% 0 0);--accent-foreground:oklch(98.5% 0 0);--destructive:oklch(70.4% .191 22.216);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.6% 0 0);--chart-1:oklch(87% 0 0);--chart-2:oklch(55.6% 0 0);--chart-3:oklch(43.9% 0 0);--chart-4:oklch(37.1% 0 0);--chart-5:oklch(26.9% 0 0);--sidebar:oklch(20.5% 0 0);--sidebar-foreground:oklch(98.5% 0 0);--sidebar-primary:oklch(48.8% .243 264.376);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(26.9% 0 0);--sidebar-accent-foreground:oklch(98.5% 0 0);--sidebar-border:oklch(100% 0 0/.1);--sidebar-ring:oklch(55.6% 0 0)}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:var(--color-slate-700);border-radius:3px}::-webkit-scrollbar-thumb:hover{background:var(--color-slate-600)}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0), var(--tw-enter-translate-y,0), 0) scale3d(var(--tw-enter-scale,1), var(--tw-enter-scale,1), var(--tw-enter-scale,1)) rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0), var(--tw-exit-translate-y,0), 0) scale3d(var(--tw-exit-scale,1), var(--tw-exit-scale,1), var(--tw-exit-scale,1)) rotate(var(--tw-exit-rotate,0))}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@keyframes spin{to{transform:rotate(360deg)}}
|