@lmctl-ai/lmctl 0.2.464 → 0.2.466
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/CHANGELOG.md +1 -0
- package/README.md +3 -2
- package/dist/cli/index.js +656 -655
- package/dist/cli/install-policy.js +4 -0
- package/dist/cli/lmscript.js +531 -531
- package/dist/dsl.js +533 -533
- package/dist/install-policy.js +4 -0
- package/package.json +3 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import {createRequire as __bundleRequire} from "node:module";const require=__bundleRequire(import.meta.url);
|
|
2
|
+
var v=t=>({ok:!0,value:t}),u=(t,r,...e)=>({ok:!1,error:{code:t,at:r,expected:e}}),g=(t,r="<text>",e="UTF16codeunit")=>({text:t,source:r,unit:e}),Z=t=>t<128?1:t<2048?2:t<65536?3:4,m=class{input;origin;index=0;offsets;constructor(r,e=0){if(this.input=r,this.origin=e,r.unit!=="UTF16codeunit"&&r.unit!=="UTF8byte")throw new RangeError("Unknown offset unit");if(!Number.isInteger(e)||e<0)throw new RangeError("Invalid span origin");if(r.unit==="UTF8byte"){let n=[0],s=0;for(let i=0;i<r.text.length;){let o=r.text.codePointAt(i),a=o>65535?2:1;n[i]=s,s+=Z(o),i+=a,n[i]=s}this.offsets=n}}peek(){let r=this.input.text.codePointAt(this.index);return r===void 0?void 0:String.fromCodePoint(r)}take(){let r=this.peek();return r!==void 0&&(this.index+=r.length),r}mark(){return this.index}spanFrom(r){return this.span(r,this.index)}span(r,e){if(!Number.isInteger(r)||!Number.isInteger(e)||r<0||e<r||e>this.input.text.length)throw new RangeError("Invalid source mark");if(this.offsets&&(this.offsets[r]===void 0||this.offsets[e]===void 0))throw new RangeError("Mark splits a code point");return{source:this.input.source,start:this.origin+(this.offsets?this.offsets[r]:r),end:this.origin+(this.offsets?this.offsets[e]:e),unit:this.input.unit}}expectToken(r){if(r.length===0)throw new RangeError("Expected token must be nonempty");let e=this.index;if(!this.input.text.startsWith(r,e)){let s=this.peek();return u("UnexpectedToken",this.span(e,e+(s?.length??0)),r)}let n=e+r.length;return n<this.input.text.length&&r.charCodeAt(r.length-1)>=55296&&r.charCodeAt(r.length-1)<=56319&&this.input.text.charCodeAt(n)>=56320&&this.input.text.charCodeAt(n)<=57343?u("UnexpectedToken",this.span(e,n+1),r):(this.index=n,v({text:r,at:this.spanFrom(e)}))}readWhile(r){let e=this.index;for(;this.peek()!==void 0&&r(this.peek());)this.take();return{text:this.input.text.slice(e,this.index),at:this.spanFrom(e)}}};var k=t=>{let r=new m(t);for(;r.take()!==void 0;);return r.spanFrom(0)},q=t=>({text:t.text,at:k(t)}),E=(t,r="<text>",e="UTF16codeunit")=>q(g(t,r,e)),W=t=>{if(!Number.isInteger(t.at.end)||t.at.end<t.at.start)throw new RangeError("Invalid token span");return new m(g(t.text,t.at.source,t.at.unit),t.at.start)};function M(t,r){let e=t.codePointAt(0);if(r==="ascii-horizontal@1")return e===9||e===32;if(r==="ascii-all@1")return e===32||e>=9&&e<=13;let n=e>=9&&e<=13||e===32||e===133||e===160||e===5760||e>=8192&&e<=8202||e===8232||e===8233||e===8239||e===8287||e===12288;return r==="ecmascript@1"?n&&e!==133||e===65279:n}function O(t,r){if(r!=="physical@1"&&r!=="unicode@1")throw new RangeError("Unknown line policy");let e=new m(t),n=[],s=0;for(;e.peek()!==void 0;){let i=e.peek();i==="\r"||i===`
|
|
3
|
+
`||r==="unicode@1"&&(i==="\u2028"||i==="\u2029")?(n.push({text:t.text.slice(s,e.mark()),at:e.spanFrom(s)}),e.take(),i==="\r"&&e.peek()===`
|
|
4
|
+
`&&e.take(),s=e.mark()):e.take()}return n.push({text:t.text.slice(s),at:e.spanFrom(s)}),n}function F(t,r){if(!["ascii-horizontal@1","ascii-all@1","unicode-white-space@1","ecmascript@1"].includes(r))throw new RangeError("Unknown whitespace profile");let e=new m(t),n=[];for(;e.peek()!==void 0;)e.readWhile(s=>M(s,r)),e.peek()!==void 0&&n.push(e.readWhile(s=>!M(s,r)));return n}function H(t){let r=t.length;for(;r>0&&t[r-1]==="/";)r--;return t.slice(0,r)}var K=t=>{let r=t.charCodeAt(0);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:-1};function X(t,r=!0){if(!r)return{kind:"opaque",value:t};if(t.startsWith("[")){let n=t.slice(1,-1).split(":"),s=[],i=0;for(let a of n)a&&i++;let o=!1;for(let a of n)if(a)s.push(Number.parseInt(a,16));else if(!o){for(let l=0;l<8-i;l++)s.push(0);o=!0}return{kind:"ipv6",value:t.slice(1,-1),words:s}}let e=t.split(".");return e.length===4&&e.every(n=>n.length>0&&Array.from(n).every(s=>s>="0"&&s<="9"))?{kind:"ipv4",value:t,octets:e.map(Number)}:{kind:"dns",value:t}}function V(t){if(t.kind==="ipv4")return t.octets[0]===127;if(t.kind!=="ipv6")return!1;let r=t.words;return r.slice(0,7).every(e=>e===0)&&r[7]===1||r.slice(0,5).every(e=>e===0)&&r[5]===65535&&r[6]>>>8===127}function P(t,r){for(let e of t.rawSegments){let n=e.toLowerCase();if(n==="."||n===".."||n.includes("%2e"))return!0}for(let e of t.decodedSegments)if(e==="."||e===".."||!r?.allowEncodedSeparators&&(e.includes("/")||e.includes("\\")))return!0;return!1}function L(t){let r=new m(t);for(;r.peek()!==void 0;){let c=r.mark(),C=r.take(),x=C.codePointAt(0);if(x<=32||x===127||x>=128&&x<=159||x===173||x>=8203&&x<=8207||x===8232||x===8233||x>=8288&&x<=8292||x===65279||C==="\\"||x>=55296&&x<=57343)return u("MalformedUrl",r.spanFrom(c),"absolute URL without controls or repair");if(C==="%"){for(;;){for(let R=0;R<2;R++){let _=r.peek();if(_===void 0||K(_)<0)return u("InvalidEscape",r.spanFrom(c),"two hex digits");r.take()}if(r.peek()!=="%")break;r.take()}try{decodeURIComponent(t.text.slice(c,r.mark()))}catch{return u("InvalidEscape",r.spanFrom(c),"UTF-8 percent encoding")}}}let e;try{e=new URL(t.text)}catch{return u("MalformedUrl",k(t),"absolute URL")}let n=e.protocol.slice(0,-1),s=["http","https","ftp","ws","wss"].includes(n),i=t.text.slice(e.protocol.length);if(s&&(!i.startsWith("//")||i.startsWith("///")))return u("MalformedUrl",k(t),"scheme://authority");if(!s&&n!=="file"&&i.startsWith("///"))return u("MalformedUrl",k(t),"scheme://authority");let o=i.startsWith("//")?2:-1,a=i.split("#")[0].split("?")[0],l=o<0?"":a.slice(o).split("/")[0],p=l.lastIndexOf("@"),d=p>=0?l.slice(p+1):l;if(o>=0&&n!=="file"&&!d)return u("MalformedUrl",k(t),"nonempty authority");let h=null;if(o>=0&&d)if(d.startsWith("[")){let c=d.indexOf("]");if(c<0)return u("MalformedUrl",k(t),"IPv6 authority");let C=d.slice(c+1);h=C===""?null:C.startsWith(":")?C.slice(1):""}else{let c=d.indexOf(":");if(c>=0){if(!d.slice(0,c)&&n!=="file")return u("MalformedUrl",k(t),"nonempty host");h=d.slice(c+1)}}if(h!==null&&(h.length<1||h.length>5||h[0]<"1"||h[0]>"9"||!Array.from(h).every(c=>c>="0"&&c<="9")||Number(h)>65535))return u("MalformedUrl",k(t),"port 1..65535");let w=n==="blob"?L({...t,text:i}):null;if(n==="blob"&&!w?.ok)return u("MalformedUrl",k(t),"embedded URL");let b;if(o>=0){let c=a.indexOf("/",o);b=c>=0?a.slice(c+1):""}else b=a.startsWith("/")?a.slice(1):a;let T=b.split("/");return v({kind:s?"network":n==="file"?"file":"other",scheme:n,host:e.hostname?X(e.hostname,s||n==="file"):null,port:h!==null?Number(h):null,hasCredentials:l.includes("@")||!!(w?.ok&&w.value.hasCredentials),rawSegments:T,decodedSegments:T.map(c=>decodeURIComponent(c)),query:e.search.slice(1),fragment:e.hash.slice(1),href:e.href})}var N=t=>t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1,A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function z(t,r,e){let n=W(t);if(!["sha256","sha384","sha512"].includes(r)||!["hex","base64","sri"].includes(e))return u("InvalidDigest",n.span(0,t.text.length),"supported digest algorithm and encoding");let s=r==="sha256"?32:r==="sha384"?48:64,i=(a=n.mark(),l=n.mark())=>u("InvalidDigest",n.span(a,l),"complete "+r+" "+e);if(e==="sri"){let a=n.expectToken(r+"-");if(!a.ok)return u("InvalidDigest",a.error.at,r+"-")}let o=[];if(e==="hex")for(;n.peek()!==void 0;){let a=n.mark(),l=N(n.take().charCodeAt(0)),p=n.take(),d=p===void 0?-1:N(p.charCodeAt(0));if(l<0||d<0)return i(a,n.mark());o.push(l<<4|d)}else{let a=!1;for(;n.peek()!==void 0;){let l=n.mark();if(a)return i(l,l);let p=[];for(let T=0;T<4;T++){let c=n.take();if(c===void 0)return i(l,n.mark());p.push(c)}let d=A.indexOf(p[0]),h=A.indexOf(p[1]),w=p[2]==="="?-2:A.indexOf(p[2]),b=p[3]==="="?-2:A.indexOf(p[3]);if(d<0||h<0||w===-1||b===-1||w===-2&&b!==-2)return i(l,n.mark());if(o.push(d<<2|h>>>4),w===-2){if(h&15)return i(l,n.mark());a=!0}else if(o.push((h&15)<<4|w>>>2),b===-2){if(w&3)return i(l,n.mark());a=!0}else o.push((w&3)<<6|b)}}return o.length!==s?i(0,n.mark()):v(new Uint8Array(o))}var D=t=>t>="a"&&t<="z"||t>="A"&&t<="Z",I=t=>t>="a"&&t<="z",y=t=>t>="0"&&t<="9",f=t=>D(t)||y(t);function Y(t){let r={"provider-id@1":{first:I,rest:e=>I(e)||y(e)||e==="-",min:2,max:32},"key-env@1":{first:e=>e>="A"&&e<="Z",rest:e=>e>="A"&&e<="Z"||y(e)||e==="_",min:9,suffix:"_API_KEY"},"alias@1":{first:D,rest:e=>f(e)||e==="_"||e==="-"},"slug@1":{first:e=>f(e)||"._-".includes(e),rest:e=>f(e)||"._-".includes(e)},"catalog@1":{first:e=>I(e)||y(e),rest:e=>I(e)||y(e)||e==="_"||e==="-"},"sample@1":{first:f,rest:e=>f(e)||e==="_"||e==="-"},"site@1":{first:f,rest:e=>f(e)||"._-".includes(e),max:53},"member@1":{first:e=>f(e)||e==="_",rest:e=>f(e)||"._-".includes(e),max:128},"org@1":{first:e=>f(e)||e==="_"||e==="-",rest:e=>f(e)||e==="_"||e==="-",max:128},"session@1":{first:e=>I(e)||y(e),rest:e=>I(e)||y(e)||e==="-",min:2,max:40},"model@1":{first:f,rest:e=>f(e)||"._:-".includes(e),max:80},"flag-word@1":{first:e=>I(e)||y(e),rest:e=>I(e)||y(e)},"github-owner@1":{first:f,rest:e=>f(e)||e==="-"},"github-repo@1":{first:e=>f(e)||e==="_",rest:e=>f(e)||"._-".includes(e)},"release-tag@1":{first:e=>f(e)||e==="_",rest:e=>f(e)||"._+-".includes(e)},"cli-word@1":{first:e=>f(e)||"._-".includes(e),rest:e=>f(e)||"._-".includes(e)},"executable@1":{first:e=>f(e)||e==="_",rest:e=>f(e)||"._-".includes(e)}};return Object.hasOwn(r,t)?r[t]:void 0}function B(t,r){let e=W(t),n=Y(r);if(!n)throw new RangeError("Unknown identifier profile");let s=0;for(;e.peek()!==void 0;){let i=e.mark(),o=e.take();if(!(s===0?n.first(o):n.rest(o)))return u("InvalidIdentifier",e.spanFrom(i),r);s++}return s<(n.min??1)||n.max!==void 0&&s>n.max||n.suffix!==void 0&&!t.text.endsWith(n.suffix)?u("InvalidIdentifier",e.span(0,e.mark()),r):v(t.text)}var j=E,U=(t,r)=>B(j(t),r).ok;function me(t){if(!t.startsWith("github:"))return null;let r=t.slice(7),e=r.indexOf("/"),n=r.indexOf("@");if(e<1||n<=e+1)return null;let s=r.slice(0,e),i=r.slice(e+1,n),o=r.slice(n+1);return U(s,"github-owner@1")&&U(i,"github-repo@1")&&U(o,"release-tag@1")?[s,i,o]:null}function ge(t){let r=new m(g(t));return t?(r.readWhile(e=>e>="0"&&e<="9"),r.peek()===void 0&&Number.isSafeInteger(Number(t))?Number(t):null):null}function S(t,r=!0){return typeof t!="string"||r&&t!==t.toLowerCase()?null:z(j(t),"sha256","hex").ok?t.toLowerCase():null}function ke(t){return typeof t=="string"&&t.slice(0,7).toLowerCase()==="sha256:"?S(t.slice(7),!1):null}function we(t){if(!t)return!1;for(let r of t)if(r<"!"||r>"~")return!1;return!0}function ve(t){let r=L(g(t));return r.ok&&(r.value.scheme==="http"||r.value.scheme==="https")}function ye(t,r,e,n="https://github.com"){let s=L(g(t));if(!s.ok||s.value.hasCredentials||s.value.query||s.value.fragment||P(s.value))return"";let i=L(g(n));if(!i.ok||s.value.scheme!==i.value.scheme||s.value.host?.value!==i.value.host?.value||s.value.port!==i.value.port)return"";let o=i.value.decodedSegments.filter(Boolean),a=s.value.decodedSegments;if(a.length<o.length||o.some((p,d)=>a[d]!==p))return"";let l=a.slice(o.length);return l.length!==5||!U(r,"github-owner@1")||!U(e,"github-repo@1")||!U(l[0],"github-owner@1")||!U(l[1],"github-repo@1")||l[0].toLowerCase()!==r.toLowerCase()||l[1].toLowerCase()!==e.toLowerCase()||l[2]!=="releases"||l[3]!=="tag"||!U(l[4],"release-tag@1")?"":l[4]}function be(t,r){let e=[];for(let n of O(g(t),"physical@1")){let s=F(g(n.text),"ascii-all@1");if(s.length<2)continue;let i=s.slice(1).map(a=>a.text).join(" ");if((i.startsWith("*")?i.slice(1):i)!==r)continue;let o=S(s[0].text,!1);if(!o)return null;e.push(o)}return e.length>0?e.every(n=>n===e[0])?e[0]:null:S(t.trim(),!1)}function Ie(t,r){let e=L(g(typeof t=="string"?t:t.href));return e.ok&&!e.value.hasCredentials&&!P(e.value)&&(e.value.scheme==="https"||r==="loopback"&&e.value.scheme==="http"&&e.value.host!==null&&(e.value.host.kind==="dns"?e.value.host.value==="localhost":V(e.value.host)))}export{Ie as allowedDownloadUrl,be as checksumFor,me as githubReleaseParts,U as installName,ve as isRemoteSource,ke as prefixedDigest,we as printableCredential,ye as releaseTagFromUrl,S as sha256Hex,ge as unsignedInteger,H as withoutTrailingSlashes};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmctl-ai/lmctl",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.466",
|
|
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",
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
"dist/cli/schema.sql",
|
|
22
22
|
"dist/schema.sql",
|
|
23
23
|
"dist/cli/lmscript.js",
|
|
24
|
+
"dist/cli/install-policy.js",
|
|
25
|
+
"dist/install-policy.js",
|
|
24
26
|
"dist/cli/data-profiles/",
|
|
25
27
|
"dist/data-profiles/",
|
|
26
28
|
"dist/dsl.js",
|