@smartkomm/plexus-cli 0.1.329 → 0.1.330

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.
Files changed (2) hide show
  1. package/dist/cli.mjs +1 -1
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -11995,7 +11995,7 @@ ${n.length} unusable ${o}:
11995
11995
  `),r.length>0&&this.context.stdout.write(` ${r.length} linkable \u2014 plexus-cli platform users relink-auth <email>
11996
11996
  `),i.length>0&&this.context.stdout.write(` ${i.length} without any login account \u2014 plexus-cli platform users provision --tenant <slug> --email <email> --name <name>
11997
11997
  `)}else this.context.stdout.write(`No unusable identities.
11998
- `);return n.length>0?1:0}},gE=class extends Rr{static{s(this,"UsersRelinkAuthCommand")}static paths=[["platform","users","relink-auth"],["users","relink-auth"]];static usage=E.Usage({category:"Users",description:"Relink a user's identity row to its live Better Auth account (heals an orphan)."});email=f.String({required:!0});async execute(){let n=await(await this.caller()).mutation(S.platformAdmin.relinkAuthAccount,{email:this.email}),r=n.changed?`Relinked ${this.email} to live auth account ${n.authId}.`:`${this.email} already linked to the live auth account (no change).`;return this.report(n,r),0}};function xz(e,t){if(e===t)throw new g("Pass exactly one of --on or --off.");return e}s(xz,"requireOnOff");var Sz=[X$,eE,tE,nE,rE,iE,oE,sE,aE,lE,of,dE,cE,uE,fE,pE,mE,hE,gE];function Az(e){return e.de??e.en??Object.values(e)[0]??""}s(Az,"titleDe");function Pte(e){return{id:e._id,kind:e.kind,status:e.status,title:Az(e.title).slice(0,50),assignee:e.assigneeUserId??"",group:e.queueGroupId??"",outcome:e.outcome??""}}s(Pte,"row");var Cte=["id","kind","status","title","assignee","group","outcome"],kE=class extends P{static{s(this,"WorkItemsListCommand")}static paths=[["work-items","list"]];static usage=E.Usage({category:"Work-Items",description:"List work-items for the active tenant (filter by --mine/--application/--group)."});mine=f.Boolean("--mine",!1,{description:"Only items assigned to me."});application=f.String("--application",{description:"Filter by application id."});group=f.String("--group",{description:"Filter by team (permission-group) id."});assignee=f.String("--assignee",{description:"Filter by assignee users._id."});openOnly=f.Boolean("--open-only",!1,{description:"Only open items."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.query(S.workItems.list,{client:n,...this.mine?{mine:!0}:{},...this.application?{applicationId:te(this.application,"application")}:{},...this.group?{queueGroupId:te(this.group,"permission group")}:{},...this.assignee?{assigneeUserId:te(this.assignee,"user")}:{},...this.openOnly?{openOnly:!0}:{}});return this.print(r,i=>i.map(Pte),Cte),0}},bE=class extends P{static{s(this,"WorkItemsShowCommand")}static paths=[["work-items","show"]];static usage=E.Usage({category:"Work-Items",description:"Show one work-item by id."});workItemId=f.String({required:!0,name:"workItemId"});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.query(S.workItems.get,{client:n,workItemId:te(this.workItemId,"work item")});if(r===null)throw new g(`work-item ${this.workItemId} not found in tenant ${n}.`);return this.print(r,i=>[{field:"id",value:i._id},{field:"kind",value:i.kind},{field:"status",value:i.status},{field:"title",value:Az(i.title)},{field:"assignee",value:i.assigneeUserId??""},{field:"group",value:i.queueGroupId??""},{field:"application",value:i.applicationId??""},{field:"node",value:i.nodeId??""},{field:"outcome",value:i.outcome??""}]),0}},vE=class extends P{static{s(this,"WorkItemsCreateCommand")}static paths=[["work-items","create"]];static usage=E.Usage({category:"Work-Items",description:"Create a manual task work-item."});title=f.String("--title",{required:!0,description:"Task title."});description=f.String("--description",{description:"Task description."});application=f.String("--application",{description:"Link to an application id."});group=f.String("--group",{description:"Team (permission-group) id whose queue holds the task."});assignee=f.String("--assignee",{description:"Assignee users._id."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.mutation(S.workItems.createManual,{client:n,title:this.title,...this.description?{description:this.description}:{},...this.application?{applicationId:te(this.application,"application")}:{},...this.group?{queueGroupId:te(this.group,"permission group")}:{},...this.assignee?{assigneeUserId:te(this.assignee,"user")}:{}});return this.print({workItemId:r.workItemId},i=>[{field:"workItemId",value:i.workItemId}]),0}},xE=class extends P{static{s(this,"WorkItemsCompleteCommand")}static paths=[["work-items","complete"]];static usage=E.Usage({category:"Work-Items",description:"Complete a work-item (optionally with an outcome)."});workItemId=f.String({required:!0,name:"workItemId"});outcome=f.String("--outcome",{description:"Outcome id to record."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.mutation(S.workItems.complete,{client:n,workItemId:te(this.workItemId,"work item"),...this.outcome?{outcome:this.outcome}:{}});return this.print({workItemId:r.workItemId,status:"done"},i=>[{field:"workItemId",value:i.workItemId},{field:"status",value:i.status}]),0}},SE=class extends P{static{s(this,"WorkItemsAssignCommand")}static paths=[["work-items","assign"]];static usage=E.Usage({category:"Work-Items",description:"Assign a work-item to a user (omit --user to unassign)."});workItemId=f.String({required:!0,name:"workItemId"});user=f.String("--user",{description:"Assignee users._id (omit to clear)."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.mutation(S.workItems.assign,{client:n,workItemId:te(this.workItemId,"work item"),...this.user?{userId:te(this.user,"user")}:{}});return this.print({workItemId:r.workItemId,assignee:this.user??"(cleared)"},i=>[{field:"workItemId",value:i.workItemId},{field:"assignee",value:i.assignee}]),0}},Tz=[kE,bE,vE,xE,SE];var Al=[...w_,...M0,...W0,...ZM,...nq,...QM,...Eq,...Dq,...Cq,...bz,...Sz,...kz,...eG,...sG,...uG,...x0,...Aq,...az,...h_,...Y_,...a0,...Mq,...Lq,...jq,...Uq,...xq,...lq,...Tz,...uB,...eU,...ZU,...tU,...GG,...ZG,...fG,...vG,...AG,...EG,...OG,...tz,...fz,...M_];for(let e of Al){let t=e.paths?.[0];t===void 0||!Object.hasOwn(e,"usage")||e.usage===void 0||(e.usage={...e.usage,category:_I(e.usage.category,t.join(" "))})}var Rz="0.1.329";function AE(){return Al.flatMap(e=>(e.paths??[]).map(t=>{let n=t.join(" "),r=$I[Uo(n)];return{path:n,effect:bi(n),host:r===void 0?"shared":"terminal",...r===void 0?{}:{reason:r}}})).sort((e,t)=>e.path.localeCompare(t.path))}s(AE,"plexusCommandCatalog");import Ks from"node:path";function Dte(e){let t=mt()?.workspaceRoot??process.cwd(),n=Ks.resolve(t,e),r=Ks.relative(t,n);if(Ks.isAbsolute(e)||r===".."||r.startsWith(`..${Ks.sep}`))throw new g("plexus: use a relative path inside the current workspace.");return{absolute:n,relative:r}}s(Dte,"workspacePath");function Fte(e){let{absolute:t,relative:n}=Dte(e.path??".");if(e.operation==="list"){if(!Re(t))return{files:[]};let r=[],i=s(o=>{for(let a of Wr(o,{withFileTypes:!0})){if(a.isSymbolicLink())throw new g("plexus: workspace symlinks are not supported.");let l=Ks.join(o,a.name);if(a.isDirectory()?i(l):r.push(Ks.relative(t,l)),r.length>200)throw new g("plexus: the workspace contains too many files. List a subdirectory.")}},"visit");return i(t),{files:r.sort()}}if(!n)throw new g("plexus: name a workspace file.");if(["read","search","edit"].includes(e.operation)){let r=Ne(t);if(r.length>10*1024*1024)throw new g("plexus: the workspace file exceeds 10 MB.");let i=new TextDecoder("utf-8",{fatal:!0}).decode(r);if(e.operation==="read"){let l=e.offset??0,d=e.maxChars??8e3,c=i.slice(l,l+d);return{path:n,content:c,...l||c.length<i.length?{offset:l,nextOffset:l+c.length<i.length?l+c.length:null,totalCharacters:i.length}:{}}}if(e.operation==="search"){if(!e.query)throw new g("plexus: search needs a nonempty query.");let l=[],d=e.offset??0;for(;l.length<10;){let c=i.indexOf(e.query,d);if(c<0)break;l.push({offset:c,text:i.slice(Math.max(0,c-160),c+e.query.length+240)}),d=c+e.query.length}return{path:n,matches:l,nextOffset:l.length===10?d:null}}if(!e.oldText||typeof e.content!="string")throw new g("plexus: edit needs oldText and replacement content.");let o=i.indexOf(e.oldText);if(o<0||o!==i.lastIndexOf(e.oldText))throw new g("plexus: oldText must match exactly once. Read the current file and choose unique context.");let a=i.slice(0,o)+e.content+i.slice(o+e.oldText.length);if(Buffer.byteLength(a)>10*1024*1024)throw new g("plexus: the edited file exceeds 10 MB.");return Qe(t,a,"utf8"),{path:n,sizeBytes:Buffer.byteLength(a)}}if(e.operation==="write"){if(typeof e.content!="string"||Buffer.byteLength(e.content)>1e6)throw new g("plexus: file content is missing or too large.");return zt(Ks.dirname(t),{recursive:!0}),Qe(t,e.content,"utf8"),{path:n,sizeBytes:Buffer.byteLength(e.content)}}if(e.operation==="remove")return Us(t),{path:n,removed:!0};throw new g("plexus: unknown workspace operation.")}s(Fte,"plexusWorkspace");function $z(e){return s(async function(n,r){if(!r||typeof r!="object"||Array.isArray(r))throw new g("plexus: tool input must be an object.");let i=r,o=id[n];if(!o||!Object.hasOwn(id,n))throw new g("plexus: unknown agent tool.");if(Object.keys(i).some(a=>!Object.hasOwn(o.inputSchema.properties,a)))throw new g("plexus: unexpected tool argument.");if(n==="plexus"){if(!Array.isArray(i.argv)||i.argv.some(a=>typeof a!="string")||i.stdin!==void 0&&typeof i.stdin!="string")throw new g("plexus: invalid command input.");return e.inspectCommand(i.argv),e.executeCommand({argv:i.argv,...i.stdin===void 0?{}:{stdin:i.stdin}})}if(n==="plexus_skill"){if(typeof i.path!="string"||i.path.length>240||!Object.hasOwn(Nw,i.path))throw new g("plexus: unknown skill reference. Start with SKILL.md.");return{path:i.path,content:Nw[i.path],skillHash:yp}}if(typeof i.operation!="string"||!["list","read","search","edit","write","remove"].includes(i.operation)||i.path!==void 0&&(typeof i.path!="string"||i.path.length>500)||i.content!==void 0&&(typeof i.content!="string"||i.content.length>1e6)||i.oldText!==void 0&&(typeof i.oldText!="string"||i.oldText.length>1e6)||i.query!==void 0&&(typeof i.query!="string"||!i.query.length||i.query.length>1e3)||i.offset!==void 0&&(typeof i.offset!="number"||!Number.isSafeInteger(i.offset)||i.offset<0)||i.maxChars!==void 0&&(typeof i.maxChars!="number"||!Number.isSafeInteger(i.maxChars)||i.maxChars<1||i.maxChars>24e3))throw new g("plexus: invalid workspace input.");return Fte(i)},"executePlexusAgentTool")}s($z,"createPlexusAgentToolExecutor");var Lte=["--env","--tenant"];function Ez(e){let t=[],n=[];for(let r=0;r<e.length;r++){let i=e[r];if(i==="--"){t.push(...e.slice(r));break}let o=Lte.find(l=>i===l||i.startsWith(`${l}=`)),a=e[r+1];o===void 0?t.push(i):i!==o?n.push({name:o,value:i.slice(o.length+1)}):a!==void 0&&!a.startsWith("-")?(n.push({name:o,value:a}),r++):t.push(i)}return{rest:t,given:n}}s(Ez,"splitGlobalOptions");function Iz(e,t){let n=Gy(e)==="offline";if(n&&bi(e)==="read")return t.map(i=>`plexus-cli: ${i.name} ${i.value} has no effect: \`${e}\` runs offline (this CLI's own files, no deployment).
11998
+ `);return n.length>0?1:0}},gE=class extends Rr{static{s(this,"UsersRelinkAuthCommand")}static paths=[["platform","users","relink-auth"],["users","relink-auth"]];static usage=E.Usage({category:"Users",description:"Relink a user's identity row to its live Better Auth account (heals an orphan)."});email=f.String({required:!0});async execute(){let n=await(await this.caller()).mutation(S.platformAdmin.relinkAuthAccount,{email:this.email}),r=n.changed?`Relinked ${this.email} to live auth account ${n.authId}.`:`${this.email} already linked to the live auth account (no change).`;return this.report(n,r),0}};function xz(e,t){if(e===t)throw new g("Pass exactly one of --on or --off.");return e}s(xz,"requireOnOff");var Sz=[X$,eE,tE,nE,rE,iE,oE,sE,aE,lE,of,dE,cE,uE,fE,pE,mE,hE,gE];function Az(e){return e.de??e.en??Object.values(e)[0]??""}s(Az,"titleDe");function Pte(e){return{id:e._id,kind:e.kind,status:e.status,title:Az(e.title).slice(0,50),assignee:e.assigneeUserId??"",group:e.queueGroupId??"",outcome:e.outcome??""}}s(Pte,"row");var Cte=["id","kind","status","title","assignee","group","outcome"],kE=class extends P{static{s(this,"WorkItemsListCommand")}static paths=[["work-items","list"]];static usage=E.Usage({category:"Work-Items",description:"List work-items for the active tenant (filter by --mine/--application/--group)."});mine=f.Boolean("--mine",!1,{description:"Only items assigned to me."});application=f.String("--application",{description:"Filter by application id."});group=f.String("--group",{description:"Filter by team (permission-group) id."});assignee=f.String("--assignee",{description:"Filter by assignee users._id."});openOnly=f.Boolean("--open-only",!1,{description:"Only open items."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.query(S.workItems.list,{client:n,...this.mine?{mine:!0}:{},...this.application?{applicationId:te(this.application,"application")}:{},...this.group?{queueGroupId:te(this.group,"permission group")}:{},...this.assignee?{assigneeUserId:te(this.assignee,"user")}:{},...this.openOnly?{openOnly:!0}:{}});return this.print(r,i=>i.map(Pte),Cte),0}},bE=class extends P{static{s(this,"WorkItemsShowCommand")}static paths=[["work-items","show"]];static usage=E.Usage({category:"Work-Items",description:"Show one work-item by id."});workItemId=f.String({required:!0,name:"workItemId"});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.query(S.workItems.get,{client:n,workItemId:te(this.workItemId,"work item")});if(r===null)throw new g(`work-item ${this.workItemId} not found in tenant ${n}.`);return this.print(r,i=>[{field:"id",value:i._id},{field:"kind",value:i.kind},{field:"status",value:i.status},{field:"title",value:Az(i.title)},{field:"assignee",value:i.assigneeUserId??""},{field:"group",value:i.queueGroupId??""},{field:"application",value:i.applicationId??""},{field:"node",value:i.nodeId??""},{field:"outcome",value:i.outcome??""}]),0}},vE=class extends P{static{s(this,"WorkItemsCreateCommand")}static paths=[["work-items","create"]];static usage=E.Usage({category:"Work-Items",description:"Create a manual task work-item."});title=f.String("--title",{required:!0,description:"Task title."});description=f.String("--description",{description:"Task description."});application=f.String("--application",{description:"Link to an application id."});group=f.String("--group",{description:"Team (permission-group) id whose queue holds the task."});assignee=f.String("--assignee",{description:"Assignee users._id."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.mutation(S.workItems.createManual,{client:n,title:this.title,...this.description?{description:this.description}:{},...this.application?{applicationId:te(this.application,"application")}:{},...this.group?{queueGroupId:te(this.group,"permission group")}:{},...this.assignee?{assigneeUserId:te(this.assignee,"user")}:{}});return this.print({workItemId:r.workItemId},i=>[{field:"workItemId",value:i.workItemId}]),0}},xE=class extends P{static{s(this,"WorkItemsCompleteCommand")}static paths=[["work-items","complete"]];static usage=E.Usage({category:"Work-Items",description:"Complete a work-item (optionally with an outcome)."});workItemId=f.String({required:!0,name:"workItemId"});outcome=f.String("--outcome",{description:"Outcome id to record."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.mutation(S.workItems.complete,{client:n,workItemId:te(this.workItemId,"work item"),...this.outcome?{outcome:this.outcome}:{}});return this.print({workItemId:r.workItemId,status:"done"},i=>[{field:"workItemId",value:i.workItemId},{field:"status",value:i.status}]),0}},SE=class extends P{static{s(this,"WorkItemsAssignCommand")}static paths=[["work-items","assign"]];static usage=E.Usage({category:"Work-Items",description:"Assign a work-item to a user (omit --user to unassign)."});workItemId=f.String({required:!0,name:"workItemId"});user=f.String("--user",{description:"Assignee users._id (omit to clear)."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.mutation(S.workItems.assign,{client:n,workItemId:te(this.workItemId,"work item"),...this.user?{userId:te(this.user,"user")}:{}});return this.print({workItemId:r.workItemId,assignee:this.user??"(cleared)"},i=>[{field:"workItemId",value:i.workItemId},{field:"assignee",value:i.assignee}]),0}},Tz=[kE,bE,vE,xE,SE];var Al=[...w_,...M0,...W0,...ZM,...nq,...QM,...Eq,...Dq,...Cq,...bz,...Sz,...kz,...eG,...sG,...uG,...x0,...Aq,...az,...h_,...Y_,...a0,...Mq,...Lq,...jq,...Uq,...xq,...lq,...Tz,...uB,...eU,...ZU,...tU,...GG,...ZG,...fG,...vG,...AG,...EG,...OG,...tz,...fz,...M_];for(let e of Al){let t=e.paths?.[0];t===void 0||!Object.hasOwn(e,"usage")||e.usage===void 0||(e.usage={...e.usage,category:_I(e.usage.category,t.join(" "))})}var Rz="0.1.330";function AE(){return Al.flatMap(e=>(e.paths??[]).map(t=>{let n=t.join(" "),r=$I[Uo(n)];return{path:n,effect:bi(n),host:r===void 0?"shared":"terminal",...r===void 0?{}:{reason:r}}})).sort((e,t)=>e.path.localeCompare(t.path))}s(AE,"plexusCommandCatalog");import Ks from"node:path";function Dte(e){let t=mt()?.workspaceRoot??process.cwd(),n=Ks.resolve(t,e),r=Ks.relative(t,n);if(Ks.isAbsolute(e)||r===".."||r.startsWith(`..${Ks.sep}`))throw new g("plexus: use a relative path inside the current workspace.");return{absolute:n,relative:r}}s(Dte,"workspacePath");function Fte(e){let{absolute:t,relative:n}=Dte(e.path??".");if(e.operation==="list"){if(!Re(t))return{files:[]};let r=[],i=s(o=>{for(let a of Wr(o,{withFileTypes:!0})){if(a.isSymbolicLink())throw new g("plexus: workspace symlinks are not supported.");let l=Ks.join(o,a.name);if(a.isDirectory()?i(l):r.push(Ks.relative(t,l)),r.length>200)throw new g("plexus: the workspace contains too many files. List a subdirectory.")}},"visit");return i(t),{files:r.sort()}}if(!n)throw new g("plexus: name a workspace file.");if(["read","search","edit"].includes(e.operation)){let r=Ne(t);if(r.length>10*1024*1024)throw new g("plexus: the workspace file exceeds 10 MB.");let i=new TextDecoder("utf-8",{fatal:!0}).decode(r);if(e.operation==="read"){let l=e.offset??0,d=e.maxChars??8e3,c=i.slice(l,l+d);return{path:n,content:c,...l||c.length<i.length?{offset:l,nextOffset:l+c.length<i.length?l+c.length:null,totalCharacters:i.length}:{}}}if(e.operation==="search"){if(!e.query)throw new g("plexus: search needs a nonempty query.");let l=[],d=e.offset??0;for(;l.length<10;){let c=i.indexOf(e.query,d);if(c<0)break;l.push({offset:c,text:i.slice(Math.max(0,c-160),c+e.query.length+240)}),d=c+e.query.length}return{path:n,matches:l,nextOffset:l.length===10?d:null}}if(!e.oldText||typeof e.content!="string")throw new g("plexus: edit needs oldText and replacement content.");let o=i.indexOf(e.oldText);if(o<0||o!==i.lastIndexOf(e.oldText))throw new g("plexus: oldText must match exactly once. Read the current file and choose unique context.");let a=i.slice(0,o)+e.content+i.slice(o+e.oldText.length);if(Buffer.byteLength(a)>10*1024*1024)throw new g("plexus: the edited file exceeds 10 MB.");return Qe(t,a,"utf8"),{path:n,sizeBytes:Buffer.byteLength(a)}}if(e.operation==="write"){if(typeof e.content!="string"||Buffer.byteLength(e.content)>1e6)throw new g("plexus: file content is missing or too large.");return zt(Ks.dirname(t),{recursive:!0}),Qe(t,e.content,"utf8"),{path:n,sizeBytes:Buffer.byteLength(e.content)}}if(e.operation==="remove")return Us(t),{path:n,removed:!0};throw new g("plexus: unknown workspace operation.")}s(Fte,"plexusWorkspace");function $z(e){return s(async function(n,r){if(!r||typeof r!="object"||Array.isArray(r))throw new g("plexus: tool input must be an object.");let i=r,o=id[n];if(!o||!Object.hasOwn(id,n))throw new g("plexus: unknown agent tool.");if(Object.keys(i).some(a=>!Object.hasOwn(o.inputSchema.properties,a)))throw new g("plexus: unexpected tool argument.");if(n==="plexus"){if(!Array.isArray(i.argv)||i.argv.some(a=>typeof a!="string")||i.stdin!==void 0&&typeof i.stdin!="string")throw new g("plexus: invalid command input.");return e.inspectCommand(i.argv),e.executeCommand({argv:i.argv,...i.stdin===void 0?{}:{stdin:i.stdin}})}if(n==="plexus_skill"){if(typeof i.path!="string"||i.path.length>240||!Object.hasOwn(Nw,i.path))throw new g("plexus: unknown skill reference. Start with SKILL.md.");return{path:i.path,content:Nw[i.path],skillHash:yp}}if(typeof i.operation!="string"||!["list","read","search","edit","write","remove"].includes(i.operation)||i.path!==void 0&&(typeof i.path!="string"||i.path.length>500)||i.content!==void 0&&(typeof i.content!="string"||i.content.length>1e6)||i.oldText!==void 0&&(typeof i.oldText!="string"||i.oldText.length>1e6)||i.query!==void 0&&(typeof i.query!="string"||!i.query.length||i.query.length>1e3)||i.offset!==void 0&&(typeof i.offset!="number"||!Number.isSafeInteger(i.offset)||i.offset<0)||i.maxChars!==void 0&&(typeof i.maxChars!="number"||!Number.isSafeInteger(i.maxChars)||i.maxChars<1||i.maxChars>24e3))throw new g("plexus: invalid workspace input.");return Fte(i)},"executePlexusAgentTool")}s($z,"createPlexusAgentToolExecutor");var Lte=["--env","--tenant"];function Ez(e){let t=[],n=[];for(let r=0;r<e.length;r++){let i=e[r];if(i==="--"){t.push(...e.slice(r));break}let o=Lte.find(l=>i===l||i.startsWith(`${l}=`)),a=e[r+1];o===void 0?t.push(i):i!==o?n.push({name:o,value:i.slice(o.length+1)}):a!==void 0&&!a.startsWith("-")?(n.push({name:o,value:a}),r++):t.push(i)}return{rest:t,given:n}}s(Ez,"splitGlobalOptions");function Iz(e,t){let n=Gy(e)==="offline";if(n&&bi(e)==="read")return t.map(i=>`plexus-cli: ${i.name} ${i.value} has no effect: \`${e}\` runs offline (this CLI's own files, no deployment).
11999
11999
  `);let r=[...new Set(t.map(i=>i.name))].join(", ");throw new g(n?`\`${e}\` does not take ${r}: it never targets a chosen deployment \u2014 drop the option.`:`\`${e}\` does not take ${r}.`)}s(Iz,"globalOptionNotes");var gy=$z({inspectCommand:_z,executeCommand:Nz});function yy(){let e=new Ys({binaryLabel:"Plexus CLI",binaryName:"plexus-cli",binaryVersion:Rz});e.register(Fl.HelpCommand),e.register(Fl.VersionCommand);for(let r of Al)e.register(r);function t(r,i){try{return{command:e.process(r,i),notes:[]}}catch(o){let{rest:a,given:l}=Ez(r);if(l.length===0)throw o;let d;try{d=e.process(a,i)}catch{throw o}if(!Al.some(u=>d instanceof u))return{command:d,notes:[]};let c=d.path.join(" ");if(!AE().some(u=>u.path===c))throw o;return{command:d,notes:Iz(c,l)}}}s(t,"resolve");async function n(r,i){let o=i.stderr??process.stderr,a;try{a=t(r,i)}catch(l){return o.write(e.error(l,{colored:!1})),2}for(let l of a.notes)o.write(l);return Kte(a.command,o),e.run(a.command,i)}return s(n,"run"),{process(r,i){return t(r,i).command},run:n,async runExit(r,i){process.exitCode=await n(r,i)}}}s(yy,"createPlexusCli");function Kte(e,t){let n=e.path.join(" "),r=e.constructor.paths?.[0]?.join(" ");r!==void 0&&n!==r&&Vl[n]===r&&ft(t,n,r),n in Vl&&bi(n)==="confirm"&&!Bl(e)&&t.write(`plexus-cli: \`${Vl[n]}\` only prints its plan without --confirm \u2014 nothing was changed.
12000
12000
  `)}s(Kte,"noteRetiredPath");function _z(e){let t=yy().process($l(e),{executePlexusAgentTool:gy}),n=t.path.join(" ");if(n.startsWith("agent "))throw new Error("plexus: nested agent transports are not allowed.");let r=AE().find(l=>l.path===n);if(!r){if(n===""||n==="--help"||n==="--version")return{path:n,writes:!1,host:"shared"};throw new Error(`plexus: command ${n} has no host classification.`)}let i=t,o=r.effect==="callKind"?Eh(ol(sl),i.fn??"",i.kind):void 0,a=Kf(n,{confirm:Bl(t),callKind:o});return{...r,writes:a}}s(_z,"inspectPlexusCommand");async function Nz(e,t){if(t)return _E(t,()=>Nz(e));if(!Array.isArray(e.argv)||e.argv.length===0||e.argv.length>128||e.argv.some(l=>typeof l!="string"||l.length>128e3)||(e.stdin?.length??0)>1e6)throw new Error("plexus: invalid command invocation.");let n="",r="",i=yy();if(mt()){let l=_z(e.argv);if(l.host==="terminal")throw new Error(`plexus: this command requires a local machine. ${l.reason??""}`)}return{exitCode:await i.run($l(e.argv),{executePlexusAgentTool:gy,stdin:qte.from(e.stdin===void 0?[]:[e.stdin]),stdout:new Oz({write(l,d,c){n+=String(l),c()}}),stderr:new Oz({write(l,d,c){r+=String(l),c()}})}),stdout:n,stderr:r}}s(Nz,"executePlexusCommand");IE();FE({source:jte.join(import.meta.dirname,"skill")});yy().runExit($l(process.argv.slice(2)),{executePlexusAgentTool:gy});
12001
12001
  //# sourceMappingURL=cli.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartkomm/plexus-cli",
3
- "version": "0.1.329",
3
+ "version": "0.1.330",
4
4
  "description": "Unified Plexus admin + admission-offer config CLI (Convex backend).",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",