@smartkomm/plexus-cli 0.1.323 → 0.1.324
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.mjs +1 -1
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -11995,7 +11995,7 @@ ${t.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 t.length>0?1:0}},B$=class extends xr{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 t=await(await this.caller()).mutation(S.platformAdmin.relinkAuthAccount,{email:this.email}),r=t.changed?`Relinked ${this.email} to live auth account ${t.authId}.`:`${this.email} already linked to the live auth account (no change).`;return this.report(t,r),0}};function vG(e,n){if(e===n)throw new g("Pass exactly one of --on or --off.");return e}s(vG,"requireOnOff");var xG=[R$,$$,E$,I$,O$,_$,C$,P$,N$,D$,Yu,F$,L$,M$,q$,K$,j$,V$,B$];function SG(e){return e.de??e.en??Object.values(e)[0]??""}s(SG,"titleDe");function Pne(e){return{id:e._id,kind:e.kind,status:e.status,title:SG(e.title).slice(0,50),assignee:e.assigneeUserId??"",group:e.queueGroupId??"",outcome:e.outcome??""}}s(Pne,"row");var Nne=["id","kind","status","title","assignee","group","outcome"],z$=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 n=await this.caller(),t=this.requireTenant(n),r=await n.query(S.workItems.list,{client:t,...this.mine?{mine:!0}:{},...this.application?{applicationId:ne(this.application,"application")}:{},...this.group?{queueGroupId:ne(this.group,"permission group")}:{},...this.assignee?{assigneeUserId:ne(this.assignee,"user")}:{},...this.openOnly?{openOnly:!0}:{}});return this.print(r,i=>i.map(Pne),Nne),0}},W$=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 n=await this.caller(),t=this.requireTenant(n),r=await n.query(S.workItems.get,{client:t,workItemId:ne(this.workItemId,"work item")});if(r===null)throw new g(`work-item ${this.workItemId} not found in tenant ${t}.`);return this.print(r,i=>[{field:"id",value:i._id},{field:"kind",value:i.kind},{field:"status",value:i.status},{field:"title",value:SG(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}},Y$=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 n=await this.caller(),t=this.requireTenant(n),r=await n.mutation(S.workItems.createManual,{client:t,title:this.title,...this.description?{description:this.description}:{},...this.application?{applicationId:ne(this.application,"application")}:{},...this.group?{queueGroupId:ne(this.group,"permission group")}:{},...this.assignee?{assigneeUserId:ne(this.assignee,"user")}:{}});return this.print({workItemId:r.workItemId},i=>[{field:"workItemId",value:i.workItemId}]),0}},H$=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 n=await this.caller(),t=this.requireTenant(n),r=await n.mutation(S.workItems.complete,{client:t,workItemId:ne(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}},J$=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 n=await this.caller(),t=this.requireTenant(n),r=await n.mutation(S.workItems.assign,{client:t,workItemId:ne(this.workItemId,"work item"),...this.user?{userId:ne(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}},AG=[z$,W$,Y$,H$,J$];var yl=[...GO,...kL,...EL,...P0,...L0,...C0,...dM,...gM,...hM,...kG,...xG,...wG,...XB,...oU,...cU,...rL,...oM,...sG,...VO,...v_,...VF,...kM,...wM,...xM,...TM,...rM,...B0,...AG,...zj,...DV,...QB,...FV,...UU,...QU,...uU,...bU,...SU,...$U,...IU,...eG,...uG,...u_];for(let e of yl){let n=e.paths?.[0];n===void 0||!Object.hasOwn(e,"usage")||e.usage===void 0||(e.usage={...e.usage,category:iI(e.usage.category,n.join(" "))})}var TG="0.1.323";function Q$(){return yl.flatMap(e=>(e.paths??[]).map(n=>{let t=n.join(" "),r=eI[Mo(t)];return{path:t,effect:gi(t),host:r===void 0?"shared":"terminal",...r===void 0?{}:{reason:r}}})).sort((e,n)=>e.path.localeCompare(n.path))}s(Q$,"plexusCommandCatalog");import Ps from"node:path";function Dne(e){let n=pn()?.workspaceRoot??process.cwd(),t=Ps.resolve(n,e),r=Ps.relative(n,t);if(Ps.isAbsolute(e)||r===".."||r.startsWith(`..${Ps.sep}`))throw new g("plexus: use a relative path inside the current workspace.");return{absolute:t,relative:r}}s(Dne,"workspacePath");function Fne(e){let{absolute:n,relative:t}=Dne(e.path??".");if(e.operation==="list"){if(!Te(n))return{files:[]};let r=[],i=s(o=>{for(let a of Vr(o,{withFileTypes:!0})){if(a.isSymbolicLink())throw new g("plexus: workspace symlinks are not supported.");let l=Ps.join(o,a.name);if(a.isDirectory()?i(l):r.push(Ps.relative(n,l)),r.length>200)throw new g("plexus: the workspace contains too many files. List a subdirectory.")}},"visit");return i(n),{files:r.sort()}}if(!t)throw new g("plexus: name a workspace file.");if(["read","search","edit"].includes(e.operation)){let r=Ce(n);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:t,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:t,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 Je(n,a,"utf8"),{path:t,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 Wn(Ps.dirname(n),{recursive:!0}),Je(n,e.content,"utf8"),{path:t,sizeBytes:Buffer.byteLength(e.content)}}if(e.operation==="remove")return Ls(n),{path:t,removed:!0};throw new g("plexus: unknown workspace operation.")}s(Fne,"plexusWorkspace");function RG(e){return s(async function(t,r){if(!r||typeof r!="object"||Array.isArray(r))throw new g("plexus: tool input must be an object.");let i=r,o=Ql[t];if(!o||!Object.hasOwn(Ql,t))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(t==="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(t==="plexus_skill"){if(typeof i.path!="string"||i.path.length>240||!Object.hasOwn(uw,i.path))throw new g("plexus: unknown skill reference. Start with SKILL.md.");return{path:i.path,content:uw[i.path],skillHash:op}}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 Fne(i)},"executePlexusAgentTool")}s(RG,"createPlexusAgentToolExecutor");var Lne=["--env","--tenant"];function $G(e){let n=[],t=[];for(let r=0;r<e.length;r++){let i=e[r];if(i==="--"){n.push(...e.slice(r));break}let o=Lne.find(l=>i===l||i.startsWith(`${l}=`)),a=e[r+1];o===void 0?n.push(i):i!==o?t.push({name:o,value:i.slice(o.length+1)}):a!==void 0&&!a.startsWith("-")?(t.push({name:o,value:a}),r++):n.push(i)}return{rest:n,given:t}}s($G,"splitGlobalOptions");function EG(e,n){let t=xy(e)==="offline";if(t&&gi(e)==="read")return n.map(i=>`plexus-cli: ${i.name} ${i.value} has no effect: \`${e}\` runs offline (this CLI's own files, no deployment).
|
|
11998
|
+
`);return t.length>0?1:0}},B$=class extends xr{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 t=await(await this.caller()).mutation(S.platformAdmin.relinkAuthAccount,{email:this.email}),r=t.changed?`Relinked ${this.email} to live auth account ${t.authId}.`:`${this.email} already linked to the live auth account (no change).`;return this.report(t,r),0}};function vG(e,n){if(e===n)throw new g("Pass exactly one of --on or --off.");return e}s(vG,"requireOnOff");var xG=[R$,$$,E$,I$,O$,_$,C$,P$,N$,D$,Yu,F$,L$,M$,q$,K$,j$,V$,B$];function SG(e){return e.de??e.en??Object.values(e)[0]??""}s(SG,"titleDe");function Pne(e){return{id:e._id,kind:e.kind,status:e.status,title:SG(e.title).slice(0,50),assignee:e.assigneeUserId??"",group:e.queueGroupId??"",outcome:e.outcome??""}}s(Pne,"row");var Nne=["id","kind","status","title","assignee","group","outcome"],z$=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 n=await this.caller(),t=this.requireTenant(n),r=await n.query(S.workItems.list,{client:t,...this.mine?{mine:!0}:{},...this.application?{applicationId:ne(this.application,"application")}:{},...this.group?{queueGroupId:ne(this.group,"permission group")}:{},...this.assignee?{assigneeUserId:ne(this.assignee,"user")}:{},...this.openOnly?{openOnly:!0}:{}});return this.print(r,i=>i.map(Pne),Nne),0}},W$=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 n=await this.caller(),t=this.requireTenant(n),r=await n.query(S.workItems.get,{client:t,workItemId:ne(this.workItemId,"work item")});if(r===null)throw new g(`work-item ${this.workItemId} not found in tenant ${t}.`);return this.print(r,i=>[{field:"id",value:i._id},{field:"kind",value:i.kind},{field:"status",value:i.status},{field:"title",value:SG(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}},Y$=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 n=await this.caller(),t=this.requireTenant(n),r=await n.mutation(S.workItems.createManual,{client:t,title:this.title,...this.description?{description:this.description}:{},...this.application?{applicationId:ne(this.application,"application")}:{},...this.group?{queueGroupId:ne(this.group,"permission group")}:{},...this.assignee?{assigneeUserId:ne(this.assignee,"user")}:{}});return this.print({workItemId:r.workItemId},i=>[{field:"workItemId",value:i.workItemId}]),0}},H$=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 n=await this.caller(),t=this.requireTenant(n),r=await n.mutation(S.workItems.complete,{client:t,workItemId:ne(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}},J$=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 n=await this.caller(),t=this.requireTenant(n),r=await n.mutation(S.workItems.assign,{client:t,workItemId:ne(this.workItemId,"work item"),...this.user?{userId:ne(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}},AG=[z$,W$,Y$,H$,J$];var yl=[...GO,...kL,...EL,...P0,...L0,...C0,...dM,...gM,...hM,...kG,...xG,...wG,...XB,...oU,...cU,...rL,...oM,...sG,...VO,...v_,...VF,...kM,...wM,...xM,...TM,...rM,...B0,...AG,...zj,...DV,...QB,...FV,...UU,...QU,...uU,...bU,...SU,...$U,...IU,...eG,...uG,...u_];for(let e of yl){let n=e.paths?.[0];n===void 0||!Object.hasOwn(e,"usage")||e.usage===void 0||(e.usage={...e.usage,category:iI(e.usage.category,n.join(" "))})}var TG="0.1.324";function Q$(){return yl.flatMap(e=>(e.paths??[]).map(n=>{let t=n.join(" "),r=eI[Mo(t)];return{path:t,effect:gi(t),host:r===void 0?"shared":"terminal",...r===void 0?{}:{reason:r}}})).sort((e,n)=>e.path.localeCompare(n.path))}s(Q$,"plexusCommandCatalog");import Ps from"node:path";function Dne(e){let n=pn()?.workspaceRoot??process.cwd(),t=Ps.resolve(n,e),r=Ps.relative(n,t);if(Ps.isAbsolute(e)||r===".."||r.startsWith(`..${Ps.sep}`))throw new g("plexus: use a relative path inside the current workspace.");return{absolute:t,relative:r}}s(Dne,"workspacePath");function Fne(e){let{absolute:n,relative:t}=Dne(e.path??".");if(e.operation==="list"){if(!Te(n))return{files:[]};let r=[],i=s(o=>{for(let a of Vr(o,{withFileTypes:!0})){if(a.isSymbolicLink())throw new g("plexus: workspace symlinks are not supported.");let l=Ps.join(o,a.name);if(a.isDirectory()?i(l):r.push(Ps.relative(n,l)),r.length>200)throw new g("plexus: the workspace contains too many files. List a subdirectory.")}},"visit");return i(n),{files:r.sort()}}if(!t)throw new g("plexus: name a workspace file.");if(["read","search","edit"].includes(e.operation)){let r=Ce(n);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:t,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:t,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 Je(n,a,"utf8"),{path:t,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 Wn(Ps.dirname(n),{recursive:!0}),Je(n,e.content,"utf8"),{path:t,sizeBytes:Buffer.byteLength(e.content)}}if(e.operation==="remove")return Ls(n),{path:t,removed:!0};throw new g("plexus: unknown workspace operation.")}s(Fne,"plexusWorkspace");function RG(e){return s(async function(t,r){if(!r||typeof r!="object"||Array.isArray(r))throw new g("plexus: tool input must be an object.");let i=r,o=Ql[t];if(!o||!Object.hasOwn(Ql,t))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(t==="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(t==="plexus_skill"){if(typeof i.path!="string"||i.path.length>240||!Object.hasOwn(uw,i.path))throw new g("plexus: unknown skill reference. Start with SKILL.md.");return{path:i.path,content:uw[i.path],skillHash:op}}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 Fne(i)},"executePlexusAgentTool")}s(RG,"createPlexusAgentToolExecutor");var Lne=["--env","--tenant"];function $G(e){let n=[],t=[];for(let r=0;r<e.length;r++){let i=e[r];if(i==="--"){n.push(...e.slice(r));break}let o=Lne.find(l=>i===l||i.startsWith(`${l}=`)),a=e[r+1];o===void 0?n.push(i):i!==o?t.push({name:o,value:i.slice(o.length+1)}):a!==void 0&&!a.startsWith("-")?(t.push({name:o,value:a}),r++):n.push(i)}return{rest:n,given:t}}s($G,"splitGlobalOptions");function EG(e,n){let t=xy(e)==="offline";if(t&&gi(e)==="read")return n.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(n.map(i=>i.name))].join(", ");throw new g(t?`\`${e}\` does not take ${r}: it never targets a chosen deployment \u2014 drop the option.`:`\`${e}\` does not take ${r}.`)}s(EG,"globalOptionNotes");var Wg=RG({inspectCommand:OG,executeCommand:_G});function Yg(){let e=new js({binaryLabel:"Plexus CLI",binaryName:"plexus-cli",binaryVersion:TG});e.register(Il.HelpCommand),e.register(Il.VersionCommand);for(let r of yl)e.register(r);function n(r,i){try{return{command:e.process(r,i),notes:[]}}catch(o){let{rest:a,given:l}=$G(r);if(l.length===0)throw o;let d;try{d=e.process(a,i)}catch{throw o}if(!yl.some(u=>d instanceof u))return{command:d,notes:[]};let c=d.path.join(" ");if(!Q$().some(u=>u.path===c))throw o;return{command:d,notes:EG(c,l)}}}s(n,"resolve");async function t(r,i){let o=i.stderr??process.stderr,a;try{a=n(r,i)}catch(l){return o.write(e.error(l,{colored:!1})),2}for(let l of a.notes)o.write(l);return Kne(a.command,o),e.run(a.command,i)}return s(t,"run"),{process(r,i){return n(r,i).command},run:t,async runExit(r,i){process.exitCode=await t(r,i)}}}s(Yg,"createPlexusCli");function Kne(e,n){let t=e.path.join(" "),r=e.constructor.paths?.[0]?.join(" ");r!==void 0&&t!==r&&Dl[t]===r&&cn(n,t,r),t in Dl&&gi(t)==="confirm"&&!Fl(e)&&n.write(`plexus-cli: \`${Dl[t]}\` only prints its plan without --confirm \u2014 nothing was changed.
|
|
12000
12000
|
`)}s(Kne,"noteRetiredPath");function OG(e){let n=Yg().process(bl(e),{executePlexusAgentTool:Wg}),t=n.path.join(" ");if(t.startsWith("agent "))throw new Error("plexus: nested agent transports are not allowed.");let r=Q$().find(l=>l.path===t);if(!r){if(t===""||t==="--help"||t==="--version")return{path:t,writes:!1,host:"shared"};throw new Error(`plexus: command ${t} has no host classification.`)}let i=n,o=r.effect==="callKind"?bh(Xa(el),i.fn??"",i.kind):void 0,a=Of(t,{confirm:Fl(n),callKind:o});return{...r,writes:a}}s(OG,"inspectPlexusCommand");async function _G(e,n){if(n)return iE(n,()=>_G(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 t="",r="",i=Yg();if(pn()){let l=OG(e.argv);if(l.host==="terminal")throw new Error(`plexus: this command requires a local machine. ${l.reason??""}`)}return{exitCode:await i.run(bl(e.argv),{executePlexusAgentTool:Wg,stdin:qne.from(e.stdin===void 0?[]:[e.stdin]),stdout:new IG({write(l,d,c){t+=String(l),c()}}),stderr:new IG({write(l,d,c){r+=String(l),c()}})}),stdout:t,stderr:r}}s(_G,"executePlexusCommand");tE();dE({source:jne.join(import.meta.dirname,"skill")});Yg().runExit(bl(process.argv.slice(2)),{executePlexusAgentTool:Wg});
|
|
12001
12001
|
//# sourceMappingURL=cli.mjs.map
|