@lmctl-ai/lmctl 0.1.44 → 0.1.45
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 +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -1779,7 +1779,7 @@ ${pb}
|
|
|
1779
1779
|
[--permission-mode plan|yolo] [--idle-timeout <duration>]
|
|
1780
1780
|
[--from <teamfile>:<alias>] [--root <teamfile>] [--force]
|
|
1781
1781
|
|
|
1782
|
-
Send a prompt to a team member or raw provider session, or answer a paused run.`});var $s,TY,Cd=b(()=>{"use strict";$s=[{name:"lmctl_chat",description:'Send one prompt to a member of an AI-managed .lmctl team \u2014 addressed by teamfile path (team) and alias \u2014 and return the reply. This is the only MCP tool lmctl exposes. For batch or long-running background jobs, call the CLI directly instead: `lmctl chat <team.lmctl> <alias> "<prompt>"`.',inputSchema:{type:"object",properties:{team:{type:"string",description:"Path to .lmctl teamfile"},alias:{type:"string",description:"Target alias; omitted means Lead"},from:{type:"string",description:"Optional self-asserted sender identity: <teamfile.lmctl>:<alias>"},prompt:{type:"string",description:"Prompt text to send"}},required:["team","prompt"]
|
|
1782
|
+
Send a prompt to a team member or raw provider session, or answer a paused run.`});var $s,TY,Cd=b(()=>{"use strict";$s=[{name:"lmctl_chat",description:'Send one prompt to a member of an AI-managed .lmctl team \u2014 addressed by teamfile path (team) and alias \u2014 and return the reply. This is the only MCP tool lmctl exposes. For batch or long-running background jobs, call the CLI directly instead: `lmctl chat <team.lmctl> <alias> "<prompt>"`.',inputSchema:{type:"object",properties:{team:{type:"string",description:"Path to .lmctl teamfile"},alias:{type:"string",description:"Target alias; omitted means Lead"},from:{type:"string",description:"Optional self-asserted sender identity: <teamfile.lmctl>:<alias>"},prompt:{type:"string",description:"Prompt text to send"}},required:["team","prompt"]},local:!0}],TY=$s.length});import{spawn as t1}from"node:child_process";async function Eb(t,e,r){let n=n1.get(t);if(n===void 0)return{status:"error",code:404,message:`unknown tool: ${t}`};let s=e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{};for(let o of n.inputSchema.required??[])if(s[o]===void 0)return{status:"error",code:400,message:`missing required parameter: ${o}`};return s1(n.name,s)}function s1(t,e){return t==="lmctl_chat"?o1(e):{status:"error",code:404,message:`unknown local tool: ${t}`}}function o1(t){let e=typeof t.prompt=="string"?t.prompt:"";if(e.length===0)return Promise.resolve({status:"error",code:400,message:"missing required parameter: prompt"});let r=typeof t.team=="string"?t.team:"";if(r.length===0)return Promise.resolve({status:"error",code:400,message:"missing required parameter: team"});let n=typeof t.alias=="string"&&t.alias.length>0?t.alias:"Lead",s=typeof t.from=="string"&&t.from.length>0?t.from:void 0,o=["chat",r,n,e];return s!==void 0&&o.push("--from",s),i1(o,process.cwd())}function i1(t,e){return new Promise(r=>{let n=!1,s,o=u=>{n||(n=!0,s!==void 0&&clearTimeout(s),r(u))},i=t1("lmctl",t,{cwd:e,env:process.env,stdio:["ignore","pipe","pipe"]}),a=a1(process.env);s=setTimeout(()=>{try{i.kill("SIGTERM")}catch{}o({status:"error",code:124,message:`lmctl chat timed out after ${a}ms`})},a),s.unref?.();let l="",c="";i.stdout?.on("data",u=>{l+=u.toString("utf8")}),i.stderr?.on("data",u=>{c+=u.toString("utf8")}),i.on("error",u=>{o({status:"error",code:1,message:`failed to spawn lmctl chat: ${u.message}`})}),i.on("exit",u=>{if(u===0){Se()&&Vs(JSON.stringify({event:"mcp_chat_payload",bytes:Buffer.byteLength(l,"utf8"),lines:l.split(`
|
|
1783
1783
|
`).length})),o({status:"ok",data:{text:l.trim()||"(empty response)"}});return}o({status:"error",code:u??1,message:c.trim()||`lmctl chat exited with code ${u}`})})})}function a1(t){let e=t.LMCTL_MCP_CHAT_TIMEOUT_MS;if(e===void 0||e.trim().length===0)return yb;let r=Number(e);return!Number.isFinite(r)||r<=0?yb:r}function Md(t,e=process.env){let n=t.getConfig("api.url")??(e.LMCTL_API_URL!==void 0&&e.LMCTL_API_URL.length>0?e.LMCTL_API_URL:r1),o=t.getConfig("api.token")??(e.LMCTL_API_TOKEN!==void 0&&e.LMCTL_API_TOKEN.length>0?e.LMCTL_API_TOKEN:null);return{baseUrl:n,token:o}}var r1,yb,n1,Dd=b(()=>{"use strict";Cd();je();r1="http://127.0.0.1:8787",yb=30*60*1e3,n1=new Map($s.map(t=>[t.name,t]))});async function d1(t,e){let r=t.id===void 0,n=t.id??null;if(t.method==="exit")return r||e.io.write(Pd({jsonrpc:"2.0",id:n,result:null})),{kind:"exit"};if(t.method==="initialize")return{kind:"response",message:{jsonrpc:"2.0",id:n,result:{protocolVersion:l1,capabilities:{tools:{listChanged:!1}},serverInfo:{name:c1,version:u1}}}};if(t.method==="notifications/initialized")return{kind:"notification"};if(t.method==="shutdown")return{kind:"response",message:{jsonrpc:"2.0",id:n,result:null}};if(t.method==="tools/list")return{kind:"response",message:{jsonrpc:"2.0",id:n,result:{tools:$s.map(s=>({name:s.name,description:s.description,inputSchema:s.inputSchema}))}}};if(t.method==="tools/call"){let s=t.params!==null&&typeof t.params=="object"?t.params:{},o=typeof s.name=="string"?s.name:"",i=s.arguments,a=await Eb(o,i,e.dispatch),l=o==="lmctl_chat"&&a.status==="ok"&&a.data!==null&&typeof a.data=="object"&&typeof a.data.text=="string"?a.data.text:JSON.stringify(a);return{kind:"response",message:{jsonrpc:"2.0",id:n,result:{isError:a.status==="error",content:[{type:"text",text:l}]}}}}return r?{kind:"notification"}:{kind:"response",message:{jsonrpc:"2.0",id:n,error:{code:-32601,message:`method not found: ${t.method}`}}}}function Pd(t){return`${JSON.stringify(t)}
|
|
1784
1784
|
`}async function bb(t,e){let r=!1,n="",s=!1,o=async i=>{let a=i.trim();if(a.length===0)return;let l;try{l=JSON.parse(a)}catch(u){t.io.write(Pd({jsonrpc:"2.0",id:null,error:{code:-32700,message:`parse error: ${u instanceof Error?u.message:String(u)}`}}));return}l.method==="shutdown"&&(r=!0);let c=await d1(l,t);c.kind==="response"?t.io.write(Pd(c.message)):c.kind==="exit"&&(s=!0)};return new Promise(i=>{let a=Promise.resolve(),l=!1,c=d=>{l||(l=!0,i(d))},u=()=>{let d=n.indexOf(`
|
|
1785
1785
|
`);for(;d!==-1;){let f=n.slice(0,d);n=n.slice(d+1),a=a.then(()=>o(f)).then(()=>{s&&c(0)}),d=n.indexOf(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmctl-ai/lmctl",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.45",
|
|
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",
|