@lmctl-ai/lmctl 0.2.488 → 0.2.489

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/cli/index.js CHANGED
@@ -2790,7 +2790,7 @@ breakdown, liveness with terminal-lock/in-flight holder info).
2790
2790
 
2791
2791
  --json emits { schema_version: 2, scope: 'self'|'db'|'team'|'member', ... }.
2792
2792
  `,g1=2,bS=5,hje=24*60*60*1e3,c1=72,Ure=80;_je={name:"status",allowsBareTeamfile:!0,supportsRaw:!1};Gre=new WeakMap});var E1={};Ne(E1,{_setRunningWatchMaxTicksForTests:()=>Jje,parentSessionId:()=>Zre,runRunning:()=>oFe});import{resolve as Vje}from"node:path";function Jje(e){v1=e??void 0}function Zre(e){let t=e?.lastIndexOf(":")??-1;if(!e||t<=0||!e.startsWith("/"))return null;let r=e.slice(t+1);return r===""||r==="terminal"||r==="batch"?null:`${e.slice(0,t)}#${r}`}function Kje(e,t,r){let o=new Map,n=i=>{let a=`${i.target_teamfile}#${i.target_alias}`,l=o.get(a);(!l||i.started_at<l.started_at)&&o.set(a,i)};for(let i of t.query(`SELECT target_teamfile, target_alias, from_identity, parent_invocation_id, started_at FROM tracked_invocation
2793
- WHERE target_teamfile IS NOT NULL AND target_alias IS NOT NULL AND started_at >= ? ORDER BY started_at, id`,r))n(i);for(let i of[...e.running,...e.dead]){let a=i.target?.lastIndexOf(":")??-1;a>0&&n({target_teamfile:i.target.slice(0,a),target_alias:i.target.slice(a+1),from_identity:i.from_identity,parent_invocation_id:i.parent_invocation_id,started_at:i.started_at})}let s=new Map;for(let[i,a]of o){let l=a.parent_invocation_id===null?void 0:t.getTrackedInvocation(a.parent_invocation_id),u=(l?.target_teamfile&&l.target_alias?`${l.target_teamfile}#${l.target_alias}`:null)??Zre(a.from_identity);s.set(i,u===i?null:u)}return s}function Zje(e,t,r,o){let n=new Map,s=Kje(e,t,new Date(r.getTime()-o.sinceMs).toISOString()),i=c=>c.split(/[\\/]/).pop().replace(/\.(lmctl|lmbee)$/i,""),a=(c,u,d,f,p,m,h,g,_,v)=>{if(!c||!u||d!=="chat"&&d!=="exec")return;let y=`${c}#${u}`,b=po(t,c,u),E=b.busy&&b.reason==="terminal-held",I=f==="running"&&p!=="dead"||b.busy,k={id:y,team_path:c,team:i(c),member:u,kind:d,state:f,liveness:p??(E?"live":null),model:m,started_at:h,last_activity_at:g,busy:I,terminal_held:E,can_prompt:!I,cannot_prompt_reason:I?E?"terminal-held":"busy":null,sender_identity:_,parent_id:s.get(y)??null,completed_run:v},R=n.get(y);(!R||(k.last_activity_at??"")>(R.last_activity_at??""))&&n.set(y,k)};for(let c of e.running){let u=c.target?.lastIndexOf(":")??-1;a(u>0?c.target.slice(0,u):null,u>0?c.target.slice(u+1):null,c.kind,"running",c.holder_liveness,c.model,c.started_at,c.last_heartbeat_at??c.started_at,c.from_identity,null)}for(let c of e.dead){let u=c.target?.lastIndexOf(":")??-1;a(u>0?c.target.slice(0,u):null,u>0?c.target.slice(u+1):null,c.kind,"error","dead",c.model,c.started_at,c.started_at,c.from_identity,{ended_at:c.started_at,elapsed_ms:c.age_ms,error:"invocation holder exited before completion"})}for(let c of e.idle){let u=c.target?.lastIndexOf(":")??-1,d=c.status==="done"?"done":"error";a(u>0?c.target.slice(0,u):null,u>0?c.target.slice(u+1):null,c.kind,d,null,c.model,c.started_at,c.ended_at,c.from_identity,{ended_at:c.ended_at,elapsed_ms:c.ran_ms,error:c.error})}let l=r.getTime()-o.sinceMs;return[...n.values()].filter(c=>o.state===void 0||o.state==="all"||c.state===o.state).filter(c=>o.kind===void 0||c.kind===o.kind).filter(c=>o.team===void 0||c.team.toLowerCase()===o.team.toLowerCase()||c.team_path.toLowerCase()===o.team.toLowerCase()).filter(c=>o.member===void 0||c.member.toLowerCase()===o.member.toLowerCase()).filter(c=>o.model===void 0||(c.model??"").toLowerCase().includes(o.model.toLowerCase())).filter(c=>c.state==="running"||c.last_activity_at!==null&&Date.parse(c.last_activity_at)>=l).sort((c,u)=>(u.last_activity_at??"").localeCompare(c.last_activity_at??"")).slice(0,o.limit)}function Yje(e){let t=e.split(`
2793
+ WHERE target_teamfile IS NOT NULL AND target_alias IS NOT NULL AND started_at >= ? ORDER BY started_at, id`,r))n(i);for(let i of[...e.running,...e.dead]){let a=i.target?.lastIndexOf(":")??-1;a>0&&n({target_teamfile:i.target.slice(0,a),target_alias:i.target.slice(a+1),from_identity:i.from_identity,parent_invocation_id:i.parent_invocation_id,started_at:i.started_at})}let s=new Map;for(let[i,a]of o){let l=a.parent_invocation_id===null?void 0:t.getTrackedInvocation(a.parent_invocation_id),u=(l?.target_teamfile&&l.target_alias?`${l.target_teamfile}#${l.target_alias}`:null)??Zre(a.from_identity);s.set(i,u===i?null:u)}return s}function Zje(e,t,r,o){let n=new Map,s=Kje(e,t,new Date(r.getTime()-o.sinceMs).toISOString()),i=c=>c.split(/[\\/]/).pop().replace(/\.(lmctl|lmbee)$/i,""),a=(c,u,d,f,p,m,h,g,_,v)=>{if(!c||!u||d!=="chat"&&d!=="exec")return;let y=`${c}#${u}`,b=po(t,c,u),E=b.busy&&b.reason==="terminal-held";E&&f!=="running"&&(f="running",p="live",g=h,v=null);let I=f==="running"&&p!=="dead"||b.busy,k={id:y,team_path:c,team:i(c),member:u,kind:d,state:f,liveness:p??(E?"live":null),model:m,started_at:h,last_activity_at:g,busy:I,terminal_held:E,can_prompt:!I,cannot_prompt_reason:I?E?"terminal-held":"busy":null,sender_identity:_,parent_id:s.get(y)??null,completed_run:v},R=n.get(y);(!R||(k.last_activity_at??"")>(R.last_activity_at??""))&&n.set(y,k)};for(let c of e.running){let u=c.target?.lastIndexOf(":")??-1;a(u>0?c.target.slice(0,u):null,u>0?c.target.slice(u+1):null,c.kind,"running",c.holder_liveness,c.model,c.started_at,c.last_heartbeat_at??c.started_at,c.from_identity,null)}for(let c of e.dead){let u=c.target?.lastIndexOf(":")??-1;a(u>0?c.target.slice(0,u):null,u>0?c.target.slice(u+1):null,c.kind,"error","dead",c.model,c.started_at,c.started_at,c.from_identity,{ended_at:c.started_at,elapsed_ms:c.age_ms,error:"invocation holder exited before completion"})}for(let c of e.idle){let u=c.target?.lastIndexOf(":")??-1,d=c.status==="done"?"done":"error";a(u>0?c.target.slice(0,u):null,u>0?c.target.slice(u+1):null,c.kind,d,null,c.model,c.started_at,c.ended_at,c.from_identity,{ended_at:c.ended_at,elapsed_ms:c.ran_ms,error:c.error})}let l=r.getTime()-o.sinceMs;return[...n.values()].filter(c=>o.state===void 0||o.state==="all"||c.state===o.state).filter(c=>o.kind===void 0||c.kind===o.kind).filter(c=>o.team===void 0||c.team.toLowerCase()===o.team.toLowerCase()||c.team_path.toLowerCase()===o.team.toLowerCase()).filter(c=>o.member===void 0||c.member.toLowerCase()===o.member.toLowerCase()).filter(c=>o.model===void 0||(c.model??"").toLowerCase().includes(o.model.toLowerCase())).filter(c=>c.state==="running"||c.terminal_held||c.last_activity_at!==null&&Date.parse(c.last_activity_at)>=l).sort((c,u)=>(u.last_activity_at??"").localeCompare(c.last_activity_at??"")).slice(0,o.limit)}function Yje(e){let t=e.split(`
2794
2794
  `,1)[0];return t.length<=w1?t:`${t.slice(0,w1)}\u2026`}function b1(e){return e.target!==null?Js(e.target):e.from_identity}function Yre(e){return[(0,$o.escapeCell)(b1(e)),e.kind,"running",e.holder_liveness,(0,$o.escapeCell)(e.model),r_(e.started_at)]}function Qre(e){return[(0,$o.escapeCell)(b1(e)),e.kind,"DEAD","",(0,$o.escapeCell)(e.model),`started ${r_(e.started_at)}, holder process confirmed dead`]}function ene(e){let t=`ran ${TS(e.ran_ms)}, idle ${r_(e.ended_at)}`;return e.status==="error"&&e.error!==null&&e.error!==""&&(t+=` \u2014 ${(0,$o.escapeCell)(fy(e.error,w1)??Yje(e.error))}`),[(0,$o.escapeCell)(b1(e)),e.kind,e.status,"",(0,$o.escapeCell)(e.model),t]}function y1(e){return e.filter(t=>t!=="").join(" ")}function eFe(e){let t=new Map(e.map(s=>[s.id,s])),r=new Map,o=[];for(let s of e){let i=s.parent_invocation_id;if(i!==null&&t.has(i)){let a=r.get(i)??[];a.push(s),r.set(i,a)}else o.push(s)}let n=(s,i)=>i.started_at.localeCompare(s.started_at);o.sort(n);for(let s of r.values())s.sort(n);return{roots:o,childrenByParent:r}}function tFe(e){let{roots:t,childrenByParent:r}=eFe(e),o=[],n=(s,i)=>{o.push(`${" ".repeat(i+1)}${s.line}`);for(let a of r.get(s.id)??[])n(a,i+1)};for(let s of t)n(s,0);return o}function rFe(e){let t=[...e.running.map(o=>({id:o.id,parent_invocation_id:o.parent_invocation_id,started_at:o.started_at,line:y1(Yre(o))})),...e.dead.map(o=>({id:o.id,parent_invocation_id:o.parent_invocation_id,started_at:o.started_at,line:y1(Qre(o))})),...e.idle.map(o=>({id:o.id,parent_invocation_id:o.parent_invocation_id,started_at:o.started_at,line:y1(ene(o))}))],r=tFe(t);return`${r.length>0?r.join(`
2795
2795
  `):" none"}
2796
2796
  `}function nFe(e,t){let r=[{title:`Running (${e.running.length}):`,rows:e.running.map(Yre)},{title:`Dead (reclaimable) (${e.dead.length}):`,rows:e.dead.map(Qre)},{title:`Idle, finished in the last ${TS(t)} (${e.idle.length}):`,rows:e.idle.map(ene)}],o=["MEMBER","KIND","STATE","LIVENESS","MODEL","TIMING"],n=(0,$o.measureColumns)([{rows:[],headers:o},...r.map(a=>a.rows)],{max:Qje}),s=!1,i=[];return r.forEach((a,l)=>{if(l>0&&i.push(""),i.push(a.title),a.rows.length===0){i.push(" none");return}let c=!s;s=!0,i.push((0,$o.renderGrid)(a.rows,{widths:n,margin:2,...c?{headers:o}:{}}))}),`${i.join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lmctl-ai/lmctl",
3
- "version": "0.2.488",
3
+ "version": "0.2.489",
4
4
  "description": "A provider-agnostic control plane for teams of AI coding agents — across providers, with independent review and durable memory.",
5
5
  "type": "module",
6
6
  "homepage": "https://lmctl.com",