@burdenoff/cli-sdk 2026.525.1 → 2026.525.2
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/chunk-REBBLQFS.js +1551 -0
- package/dist/modules/auth/index.cjs +34 -34
- package/dist/modules/auth/index.js +1 -1
- package/dist/modules/conversations/index.cjs +125 -7
- package/dist/modules/conversations/index.js +124 -6
- package/dist/modules/export/index.cjs +63 -5
- package/dist/modules/export/index.js +63 -5
- package/dist/modules/integrations/index.cjs +92 -8
- package/dist/modules/integrations/index.js +92 -8
- package/dist/modules/sandbox/index.cjs +154 -13
- package/dist/modules/sandbox/index.js +1 -1
- package/dist/modules/scheduler/index.cjs +116 -6
- package/dist/modules/scheduler/index.js +116 -6
- package/dist/modules/vibecontrols/index.cjs +871 -336
- package/dist/modules/vibecontrols/index.js +6 -2
- package/package.json +1 -1
- package/dist/chunk-MRONTCXQ.js +0 -879
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
import {a as a$1,b as b$1,k,c,d,f as f$1,g as g$1,e,h as h$1,i,j,l,m as m$1,n as n$1,o as o$2,p as p$1,q,r,s as s$1,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,Q,R,S,T,U,V,W,X,Y,Z,_,$,aa,ba,ca,da,P,ea,fa,ga,ha,ia,ja,ka,la,ma,na,oa,pa,qa,ra,sa,ta,ua,va,wa,xa,ya,Aa,Ba,za,Ca,Da,Ea,Fa,Ga,Ha,Ia,Ja,Ka,La,Ma,Na,Qa,Oa,Pa,Ra,Ta,Ua,Va,Sa,Xa,Wa,Ya,cb,Za,_a,$a,ab,bb,db,fb,eb,gb,hb,ib,jb,kb,lb,mb,nb,ob,pb,qb,rb,sb,tb,ub,vb,wb,xb,yb,zb,Ab,Bb,Cb,Db,Eb,Fb,Gb,Hb,Ib,Jb,Kb,Zb,_b,$b,ac,bc,cc,dc,ec,fc,gc,hc,ic,jc,kc,lc,mc,nc,oc,pc,qc,rc,sc,tc,uc,vc,wc,xc,yc,zc,Ac,Lb,Mb,Nb,Ob,Pb,Qb,Rb,Sb,Ub,Tb,Vb,Wb,Xb,Yb,Jc}from'../../chunk-MRONTCXQ.js';import {a,b,g,o,m,n,f,h,p,i as i$1,s,z as z$1,x as x$1,w as w$1,v as v$1,l as l$1,q as q$1,y as y$1}from'../../chunk-KTKHJORN.js';import {o as o$1}from'../../chunk-RNWXATAC.js';function ro(m$2){let o$3=m$2.command("agents").description("Agent management");o$3.command("list").description("List agents").option("--active","Only active agents").option("--platform <p>","Filter by platform").option("-f, --format <format>","Output format").action(async e=>{try{let t={};e.active&&(t.isActive=!0),e.platform&&(t.platform=e.platform);let n$1=await b(a$1,{filter:Object.keys(t).length?t:void 0});g(e,n$1.vibecontrolsAgents,{headers:["ID","Name","Hostname","Platform","Status","Last Heartbeat"],rows:n$1.vibecontrolsAgents.map(a=>[o(a.id,12),a.name,a.hostname,a.platform,m(a.isActive?"ACTIVE":"INACTIVE"),n(a.lastHeartbeat)])});}catch(t){f(t);}}),o$3.command("get").description("Get agent by ID").argument("<id>","Agent ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(b$1,{id:e});if(!n.vibecontrolsAgent)throw new o$1("Agent not found");g(t,n.vibecontrolsAgent);}catch(n){f(n);}}),o$3.command("create").description("Create agent").requiredOption("--name <n>","Name").requiredOption("--hostname <h>","Hostname").requiredOption("--platform <p>","Platform").requiredOption("--arch <a>","Architecture").requiredOption("--agent-version <v>","Agent version").option("--tunnel-url <u>","Tunnel URL").option("-f, --format <format>","Output format").action(async e=>{try{let t=await b(k,{input:{name:e.name,hostname:e.hostname,platform:e.platform,architecture:e.arch,version:e.agentVersion,tunnelUrl:e.tunnelUrl}});h("Agent created"),g(e,t.registerVibecontrolsAgent);}catch(t){f(t);}}),o$3.command("update").description("Update agent").argument("<id>","Agent ID").option("--name <n>","Name").option("--tunnel-url <u>","Tunnel URL").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={};if(t.name&&(n.name=t.name),t.tunnelUrl&&(n.tunnelUrl=t.tunnelUrl),!Object.keys(n).length)throw new o$1("No updates specified");let a=await b(c,{id:e,input:n});h("Agent updated"),g(t,a.updateVibecontrolsAgent);}catch(n){f(n);}}),o$3.command("delete").description("Delete agent").argument("<id>","Agent ID").option("--force","Skip confirmation").action(async(e,t)=>{try{if(!await p("Delete this agent?",t.force))return;await b(d,{id:e}),h("Agent deleted");}catch(n){f(n);}}),o$3.command("probe").description("Probe agent connectivity").argument("<id>","Agent ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(f$1,{id:e});g(t,n.probeAgentConnection);}catch(n){f(n);}}),o$3.command("health").description("Health check all agents").option("-f, --format <format>","Output format").action(async e=>{try{let n=(await b(g$1)).vibecontrolsAgentHealthProbes;g(e,n,{headers:["Agent","Name","Healthy","Version","Uptime"],rows:n.map(a=>[o(a.agentId,12),a.agentName,m(a.healthy?"HEALTHY":"ERROR"),a.agentVersion??"-",a.uptime!=null?Math.round(a.uptime)+"s":"-"])});}catch(t){f(t);}}),o$3.command("heartbeat").description("Send heartbeat").argument("<id>","Agent ID").action(async e$1=>{try{await b(e,{id:e$1}),h("Heartbeat sent");}catch(t){f(t);}}),o$3.command("plugins").description("List plugins").argument("<id>","Agent ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(h$1,{agentId:e});g(t,n.agentPlugins);}catch(n){f(n);}}),o$3.command("install-plugin").description("Install plugin").argument("<agentId>").argument("<packageName>").action(async(e,t)=>{try{let n=await b(i,{agentId:e,packageName:t});n.installAgentPlugin.success?h(`Plugin ${t} installed`):i$1(n.installAgentPlugin.error??"Failed");}catch(n){f(n);}}),o$3.command("remove-plugin").description("Remove plugin").argument("<agentId>").argument("<packageName>").action(async(e,t)=>{try{let n=await b(j,{agentId:e,packageName:t});n.removeAgentPlugin.success?h(`Plugin ${t} removed`):i$1(n.removeAgentPlugin.error??"Failed");}catch(n){f(n);}}),o$3.command("register").description("Register a new agent").requiredOption("--hostname <h>","Hostname").requiredOption("--name <n>","Name").option("--platform <p>","Platform").option("--arch <a>","Architecture").option("--agent-version <v>","Agent version").option("-f, --format <format>","Output format").action(async e=>{try{let t=await b(k,{input:{hostname:e.hostname,name:e.name,platform:e.platform,architecture:e.arch,version:e.agentVersion}});h("Agent registered"),g(e,t.registerAgent);}catch(t){f(t);}}),o$3.command("deactivate").description("Deactivate agent").argument("<id>","Agent ID").action(async e=>{try{await b(l,{id:e}),h("Agent deactivated");}catch(t){f(t);}}),o$3.command("push-gateway-auth").description("Push gateway auth credentials").requiredOption("--agent-id <id>","Agent ID").requiredOption("--client-id <cid>","Client ID").requiredOption("--client-secret <cs>","Client secret").action(async e=>{try{await b(m$1,{input:{agentId:e.agentId,clientId:e.clientId,clientSecret:e.clientSecret}}),h("Gateway auth pushed");}catch(t){f(t);}}),o$3.command("setup-gateway-auth").description("Setup gateway auth for agent").requiredOption("--agent-id <id>","Agent ID").action(async e=>{try{await b(n$1,{input:{agentId:e.agentId}}),h("Gateway auth setup complete");}catch(t){f(t);}}),o$3.command("update-version").description("Update agent version").argument("<agentId>","Agent ID").argument("<version>","Version").action(async(e,t)=>{try{await b(o$2,{agentId:e,version:t}),h("Agent version updated");}catch(n){f(n);}}),o$3.command("connect-target").description("Connect agent to target").argument("<sourceAgentId>","Source agent ID").argument("<targetId>","Target ID").requiredOption("--protocol <p>","Protocol").action(async(e,t,n)=>{try{await b(p$1,{sourceAgentId:e,targetId:t,protocol:n.protocol}),h("Agent connected to target");}catch(a){f(a);}}),o$3.command("disconnect-target").description("Disconnect agent from target").argument("<connectionId>","Connection ID").action(async e=>{try{await b(q,{connectionId:e}),h("Agent disconnected from target");}catch(t){f(t);}}),o$3.command("graph").description("Get agent graph").option("--root-agent-id <id>","Root agent ID").option("-f, --format <format>","Output format").action(async e=>{try{let t=s(),n=await b(r,{rootAgentId:e.rootAgentId,workspaceId:t?.workspaceId});g(e,n.agentGraph);}catch(t){f(t);}});}function ao(m$1){let o$2=m$1.command("vibes").description("Vibe management");o$2.command("list").description("List vibes").option("--status <s>","Filter by status").option("--type <t>","Filter by type").option("--agent <id>","Filter by agent").option("-f, --format <format>","Output format").action(async e=>{try{let t={};e.status&&(t.status=e.status.toUpperCase()),e.type&&(t.type=e.type.toUpperCase()),e.agent&&(t.agentId=e.agent);let a=(await b(s$1,{filter:Object.keys(t).length?t:void 0})).vibes.items;g(e,a,{headers:["ID","Name","Type","Status","Path","Created"],rows:a.map(d=>[o(d.id,12),d.name,d.type,m(d.status),o(d.path,30),n(d.createdAt)])});}catch(t){f(t);}}),o$2.command("get").description("Get vibe by ID").argument("<id>").option("-f, --format <format>","Output format").action(async(e,t$1)=>{try{let n=await b(t,{id:e});if(!n.vibe)throw new o$1("Vibe not found");g(t$1,n.vibe);}catch(n){f(n);}}),o$2.command("create").description("Create vibe").requiredOption("--name <n>","Name").requiredOption("--path <p>","Path").requiredOption("--type <t>","Type (PROJECT, REPOSITORY, etc.)").option("--agent <id>","Agent ID").option("--description <d>","Description").option("-f, --format <format>","Output format").action(async e=>{try{let t=await b(u,{input:{name:e.name,path:e.path,type:e.type.toUpperCase(),agentId:e.agent,description:e.description}});h("Vibe created"),g(e,t.createVibe);}catch(t){f(t);}}),o$2.command("update").description("Update vibe").argument("<id>").option("--name <n>","Name").option("--description <d>","Description").option("--status <s>","Status").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={};if(t.name&&(n.name=t.name),t.description&&(n.description=t.description),t.status&&(n.status=t.status.toUpperCase()),!Object.keys(n).length)throw new o$1("No updates specified");let a=await b(v,{id:e,input:n});h("Vibe updated"),g(t,a.updateVibe);}catch(n){f(n);}}),o$2.command("delete").description("Delete vibe").argument("<id>").option("--force","Skip confirmation").action(async(e,t)=>{try{if(!await p("Delete this vibe?",t.force))return;await b(w,{id:e}),h("Vibe deleted");}catch(n){f(n);}}),o$2.command("archive").description("Archive vibe").argument("<id>").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(x,{id:e});h("Vibe archived"),g(t,n.archiveVibe);}catch(n){f(n);}}),o$2.command("restore").description("Restore archived vibe").argument("<id>").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(y,{id:e});h("Vibe restored"),g(t,n.restoreVibe);}catch(n){f(n);}}),o$2.command("hierarchy").description("Get vibe hierarchy").option("--root <id>","Root vibe ID").option("-f, --format <format>","Output format").action(async e=>{try{let t=await b(z,{rootId:e.root});g(e,t.vibeHierarchy);}catch(t){f(t);}}),o$2.command("search").description("Search vibes").argument("<query>").option("--limit <n>","Max results",parseInt).option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(A,{query:e,limit:t.limit});g(t,n.searchVibes);}catch(n){f(n);}}),o$2.command("move").description("Move vibe to new parent").argument("<id>","Vibe ID").option("--parent <parentId>","New parent ID (omit to remove parent)").action(async(e,t)=>{try{let n=await b(B,{id:e,newParentId:t.parent||null});h("Vibe moved"),g({},n.moveVibe);}catch(n){f(n);}}),o$2.command("set-status").description("Set vibe status").argument("<id>","Vibe ID").argument("<status>","New status").action(async(e,t)=>{try{await b(C,{id:e,status:t.toUpperCase()}),h("Vibe status updated");}catch(n){f(n);}}),o$2.command("update-git").description("Update vibe git info").argument("<id>","Vibe ID").option("--branch <b>","Branch").option("--remote <r>","Remote").option("--status <s>","Status").action(async(e,t)=>{try{let n={};t.branch&&(n.branch=t.branch),t.remote&&(n.remote=t.remote),t.status&&(n.status=t.status);let a=await b(D,{id:e,input:n});h("Vibe git info updated"),g({},a.updateVibeGit);}catch(n){f(n);}});}function so(m$1){let o$2=m$1.command("sessions").description("Session management");o$2.command("list").description("List sessions").option("--status <s>","Filter by status").option("--type <t>","Filter by type").option("--vibe <id>","Filter by vibe").option("--agent <id>","Filter by agent").option("-f, --format <format>","Output format").action(async e=>{try{let t={};e.status&&(t.status=e.status.toUpperCase()),e.type&&(t.type=e.type.toUpperCase()),e.vibe&&(t.vibeId=e.vibe),e.agent&&(t.agentId=e.agent);let a=(await b(E,{filter:Object.keys(t).length?t:void 0})).sessions.items;g(e,a,{headers:["ID","Name","Type","Status","Agent","Started"],rows:a.map(d=>[o(d.id,12),d.name,d.type,m(d.status),o(d.agentId,12),n(d.startedAt)])});}catch(t){f(t);}}),o$2.command("get").description("Get session").argument("<id>").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(F,{id:e});if(!n.session)throw new o$1("Session not found");g(t,n.session);}catch(n){f(n);}}),o$2.command("create").description("Create session").requiredOption("--name <n>","Name").requiredOption("--agent <id>","Agent ID").requiredOption("--type <t>","Type (TMUX, SSH, TERMINAL, SCRIPT, CUSTOM)").option("--vibe <id>","Vibe ID").option("--command <c>","Command").option("-f, --format <format>","Output format").action(async e=>{try{let t=await b(G,{input:{name:e.name,agentId:e.agent,type:e.type.toUpperCase(),vibeId:e.vibe,command:e.command}});h("Session created"),g(e,t.createSession);}catch(t){f(t);}}),o$2.command("start").description("Start session").argument("<id>").action(async e=>{try{await b(H,{id:e}),h("Session started");}catch(t){f(t);}}),o$2.command("stop").description("Stop session").argument("<id>").action(async e=>{try{await b(I,{id:e}),h("Session stopped");}catch(t){f(t);}}),o$2.command("restart").description("Restart session").argument("<id>").action(async e=>{try{await b(J,{id:e}),h("Session restarted");}catch(t){f(t);}}),o$2.command("terminate").description("Terminate session").argument("<id>").option("--force","Skip confirmation").action(async(e,t)=>{try{if(!await p("Terminate this session?",t.force))return;await b(K,{id:e}),h("Session terminated");}catch(n){f(n);}}),o$2.command("output").description("Get session output").argument("<id>").option("--lines <n>","Number of lines",parseInt).option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(L,{id:e,lines:t.lines});n.sessionOutput?console.log(n.sessionOutput):i$1("No output");}catch(n){f(n);}}),o$2.command("send-input").description("Send input to session").argument("<id>").argument("<input>").action(async(e,t)=>{try{await b(M,{id:e,input:t}),h("Input sent");}catch(n){f(n);}}),o$2.command("start-terminal").description("Start web terminal").argument("<id>").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(N,{id:e});h("Terminal started"),g(t,n.startSessionTerminal);}catch(n){f(n);}}),o$2.command("stop-terminal").description("Stop web terminal").argument("<id>").action(async e=>{try{await b(O,{id:e}),h("Terminal stopped");}catch(t){f(t);}}),o$2.command("active").description("List active sessions").option("--vibe <id>","Filter by vibe").option("-f, --format <format>","Output format").action(async e=>{try{let t=await b(Q,{vibeId:e.vibe});g(e,t.activeSessions);}catch(t){f(t);}}),o$2.command("health-check").description("Check health of all sessions").option("-f, --format <format>","Output format").action(async e=>{try{let t=await b(R);h("Health check complete"),g(e,t.checkSessionHealth);}catch(t){f(t);}}),o$2.command("share").description("Share session with user").argument("<sessionId>","Session ID").requiredOption("--user-id <uid>","User ID").option("--permission <p>","Permission (VIEW/INTERACT)","VIEW").action(async(e,t)=>{try{await b(S,{input:{sessionId:e,sharedWithId:t.userId,permission:t.permission}}),h("Session shared");}catch(n){f(n);}}),o$2.command("create-share-link").description("Create share link").argument("<sessionId>","Session ID").option("--permission <p>","Permission (VIEW/INTERACT)","VIEW").action(async(e,t)=>{try{let n=await b(T,{input:{sessionId:e,permission:t.permission}});h("Share link created"),g({},n.createSessionShareLink);}catch(n){f(n);}}),o$2.command("revoke-share").description("Revoke session share").argument("<id>","Share ID").action(async e=>{try{await b(U,{id:e}),h("Session share revoked");}catch(t){f(t);}}),o$2.command("revoke-share-link").description("Revoke session share link").argument("<id>","Share link ID").action(async e=>{try{await b(V,{id:e}),h("Share link revoked");}catch(t){f(t);}}),o$2.command("update-share").description("Update session share permission").argument("<id>","Share ID").requiredOption("--permission <p>","Permission (VIEW/INTERACT)").action(async(e,t)=>{try{await b(W,{id:e,input:{permission:t.permission}}),h("Session share updated");}catch(n){f(n);}}),o$2.command("join").description("Join shared session").argument("<sessionId>","Session ID").action(async e=>{try{await b(X,{input:{sessionId:e}}),h("Joined session");}catch(t){f(t);}}),o$2.command("leave").description("Leave shared session").argument("<sessionId>","Session ID").action(async e=>{try{await b(Y,{sessionId:e}),h("Left session");}catch(t){f(t);}}),o$2.command("request-control").description("Request session control").argument("<sessionId>","Session ID").action(async e=>{try{await b(Z,{sessionId:e}),h("Control requested");}catch(t){f(t);}}),o$2.command("release-control").description("Release session control").argument("<sessionId>","Session ID").action(async e=>{try{await b(_,{sessionId:e}),h("Control released");}catch(t){f(t);}}),o$2.command("transfer-control").description("Transfer session control").argument("<sessionId>","Session ID").requiredOption("--to-user <uid>","Target user ID").action(async(e,t)=>{try{await b($,{sessionId:e,toUserId:t.toUser}),h("Control transferred");}catch(n){f(n);}}),o$2.command("shares").description("List session shares").argument("<sessionId>","Session ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(aa,{sessionId:e});g(t,n.sessionShares);}catch(n){f(n);}}),o$2.command("share-links").description("List session share links").argument("<sessionId>","Session ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(ba,{sessionId:e});g(t,n.sessionShareLinks);}catch(n){f(n);}}),o$2.command("collaborators").description("List session collaborators").argument("<sessionId>","Session ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(ca,{sessionId:e});g(t,n.sessionCollaborators);}catch(n){f(n);}}),o$2.command("shared-with-me").description("List sessions shared with me").option("-f, --format <format>","Output format").action(async e=>{try{let t=await b(da);g(e,t.sessionsSharedWithMe);}catch(t){f(t);}}),o$2.command("restart-terminal").description("Restart session terminal").argument("<id>","Session ID").action(async e=>{try{await b(P,{id:e}),h("Terminal restarted");}catch(t){f(t);}}),o$2.command("bulk-restart").description("Bulk restart sessions").requiredOption("--ids <ids>","Session IDs (comma-separated)").option("--force","Skip confirmation").action(async e=>{try{await b(ea,{ids:e.ids.split(",").map(t=>t.trim()),force:e.force}),h("Sessions restarted");}catch(t){f(t);}}),o$2.command("bulk-stop").description("Bulk stop sessions").requiredOption("--ids <ids>","Session IDs (comma-separated)").option("--force","Skip confirmation").action(async e=>{try{await b(fa,{ids:e.ids.split(",").map(t=>t.trim()),force:e.force}),h("Sessions stopped");}catch(t){f(t);}}),o$2.command("bulk-terminate").description("Bulk terminate sessions").requiredOption("--ids <ids>","Session IDs (comma-separated)").option("--force","Skip confirmation").action(async e=>{try{if(!await p("Terminate these sessions?",e.force))return;await b(ga,{ids:e.ids.split(",").map(t=>t.trim())}),h("Sessions terminated");}catch(t){f(t);}});}function co(m){let o$2=m.command("notes").description("Note management");o$2.command("list").description("List notes").option("--vibe <id>","Filter by vibe").option("--pinned","Show only pinned").option("--tags <tags>","Filter by tags (comma-separated)").option("-f, --format <format>","Output format").action(async e=>{try{let t={};e.vibe&&(t.vibeId=e.vibe),e.pinned&&(t.isPinned=!0),e.tags&&(t.tags=e.tags.split(",").map(a=>a.trim()));let n$1=await b(ha,{filter:Object.keys(t).length?t:void 0});g(e,n$1.notes.items,{headers:["ID","Title","Pinned","Tags","Created"],rows:n$1.notes.items.map(a=>[o(a.id,12),a.title,a.isPinned?"Yes":"No",(a.tags??[]).join(", "),n(a.createdAt)])});}catch(t){f(t);}}),o$2.command("get").description("Get note").argument("<id>").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(ia,{id:e});if(!n.note)throw new o$1("Note not found");g(t,n.note);}catch(n){f(n);}}),o$2.command("create").description("Create note").requiredOption("--title <t>","Title").requiredOption("--content <c>","Content").option("--vibe <id>","Vibe ID").option("--tags <tags>","Tags (comma-separated)").option("-f, --format <format>","Output format").action(async e=>{try{let t=await b(ja,{input:{title:e.title,content:e.content,vibeId:e.vibe,tags:e.tags?.split(",").map(n=>n.trim())}});h("Note created"),g(e,t.createNote);}catch(t){f(t);}}),o$2.command("update").description("Update note").argument("<id>").option("--title <t>","Title").option("--content <c>","Content").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={};if(t.title&&(n.title=t.title),t.content&&(n.content=t.content),!Object.keys(n).length)throw new o$1("No updates specified");let a=await b(ka,{id:e,input:n});h("Note updated"),g(t,a.updateNote);}catch(n){f(n);}}),o$2.command("delete").description("Delete note").argument("<id>").option("--force","Skip confirmation").action(async(e,t)=>{try{if(!await p("Delete this note?",t.force))return;await b(la,{id:e}),h("Note deleted");}catch(n){f(n);}}),o$2.command("search").description("Search notes").argument("<query>").option("--vibe <id>","Scope to vibe").option("--limit <n>","Max results",parseInt).option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(ma,{query:e,vibeId:t.vibe,limit:t.limit});g(t,n.searchNotes);}catch(n){f(n);}}),o$2.command("pin").description("Pin a note").argument("<id>").action(async e=>{try{await b(na,{id:e}),h("Note pinned");}catch(t){f(t);}}),o$2.command("unpin").description("Unpin a note").argument("<id>").action(async e=>{try{await b(oa,{id:e}),h("Note unpinned");}catch(t){f(t);}}),o$2.command("tag").description("Tag a note").argument("<noteId>","Note ID").argument("<tag>","Tag").action(async(e,t)=>{try{await b(pa,{input:{noteId:e,tag:t}}),h("Note tagged");}catch(n){f(n);}}),o$2.command("untag").description("Remove tag from note").argument("<noteId>","Note ID").argument("<tag>","Tag").action(async(e,t)=>{try{await b(qa,{input:{noteId:e,tag:t}}),h("Tag removed");}catch(n){f(n);}}),o$2.command("replace-tags").description("Replace all tags on a note").argument("<noteId>","Note ID").requiredOption("--tags <tags>","Tags (comma-separated)").action(async(e,t)=>{try{await b(ra,{input:{noteId:e,tags:t.tags.split(",").map(n=>n.trim())}}),h("Tags replaced");}catch(n){f(n);}}),o$2.command("create-tag").description("Create a note tag").argument("<name>","Tag name").action(async e=>{try{await b(sa,{input:{name:e}}),h("Tag created");}catch(t){f(t);}}),o$2.command("available-tags").description("List available note tags").option("--query <q>","Search query").option("--limit <n>","Max results",parseInt).option("-f, --format <format>","Output format").action(async e=>{try{let t=await b(ta,{query:e.query,limit:e.limit});g(e,t.availableNoteTags);}catch(t){f(t);}}),o$2.command("get-tags").description("Get tags for a note").argument("<noteId>","Note ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(ua,{noteId:e});g(t,n.noteTags);}catch(n){f(n);}}),o$2.command("related-tags").description("Get related tags for a note").argument("<noteId>","Note ID").option("--limit <n>","Max results",parseInt).option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(va,{noteId:e,limit:t.limit});g(t,n.relatedNoteTags);}catch(n){f(n);}}),o$2.command("bulk-delete").description("Bulk delete notes").requiredOption("--ids <ids>","Note IDs (comma-separated)").option("--force","Skip confirmation").action(async e=>{try{if(!await p("Delete these notes?",e.force))return;await b(wa,{ids:e.ids.split(",").map(t=>t.trim())}),h("Notes deleted");}catch(t){f(t);}});}function mo(m){let o=m.command("config").description("Backend configuration management");o.command("list").description("List configs").requiredOption("--scope <s>","Scope (WORKSPACE, VIBE, SESSION, AGENT, USER, GLOBAL)").option("--scope-id <id>","Scope entity ID").option("-f, --format <format>","Output format").action(async e=>{try{let t=await b(xa,{scope:e.scope.toUpperCase(),scopeId:e.scopeId});g(e,t.configurationsByScope);}catch(t){f(t);}}),o.command("get").description("Get config value").argument("<key>").requiredOption("--scope <s>","Scope").option("--scope-id <id>","Scope ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(ya,{key:e,scope:t.scope.toUpperCase(),scopeId:t.scopeId});if(!n.configuration)throw new o$1("Config not found");g(t,n.configuration);}catch(n){f(n);}}),o.command("set").description("Set config value").argument("<key>").argument("<value>").requiredOption("--scope <s>","Scope").option("--scope-id <id>","Scope ID").option("--secret","Mark as secret").option("-f, --format <format>","Output format").action(async(e,t,n)=>{try{let a;try{a=JSON.parse(t);}catch{a=t;}let d=await b(Aa,{key:e,scope:n.scope.toUpperCase(),scopeId:n.scopeId,value:a,isSecret:n.secret});h("Config set"),g(n,d.setConfiguration);}catch(a){f(a);}}),o.command("delete").description("Delete config").argument("<key>").requiredOption("--scope <s>","Scope").option("--scope-id <id>","Scope ID").action(async(e,t)=>{try{await b(Ba,{key:e,scope:t.scope.toUpperCase(),scopeId:t.scopeId}),h("Config deleted");}catch(n){f(n);}}),o.command("value").description("Get raw config value").argument("<key>").requiredOption("--scope <s>","Scope").option("--scope-id <id>","Scope ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(za,{key:e,scope:t.scope.toUpperCase(),scopeId:t.scopeId});console.log(n.configurationValue);}catch(n){f(n);}}),o.command("bulk-set").description("Bulk set configs").requiredOption("--scope <s>","Scope").option("--scope-id <id>","Scope ID").requiredOption("--input <json>","JSON array of [{key,value,isSecret?}]").option("-f, --format <format>","Output format").action(async e=>{try{let t=await b(Ca,{configurations:JSON.parse(e.input),scope:e.scope.toUpperCase(),scopeId:e.scopeId});h("Configs set"),g(e,t.bulkSetConfigurations);}catch(t){f(t);}}),o.command("bulk-delete").description("Bulk delete configs").requiredOption("--scope <s>","Scope").option("--scope-id <id>","Scope ID").requiredOption("--keys <keys>","Comma-separated keys").option("--force","Skip confirmation").action(async e=>{try{if(!await p("Delete these configs?",e.force))return;await b(Da,{keys:e.keys.split(",").map(t=>t.trim()),scope:e.scope.toUpperCase(),scopeId:e.scopeId}),h("Configs deleted");}catch(t){f(t);}});}function po(m){let o$2=m.command("webhooks").description("Webhook management");o$2.command("list").description("List webhooks").option("--active","Only active").option("-f, --format <format>","Output format").action(async e=>{try{let t=e.active?{isActive:!0}:void 0,n=await b(Ea,{filter:t});g(e,n.webhooks.items,{headers:["ID","Name","URL","Active","Events","Deliveries"],rows:n.webhooks.items.map(a=>[o(a.id,12),a.name,o(a.url,30),a.isActive?"Yes":"No",(a.events??[]).join(", "),String(a.deliveryCount??0)])});}catch(t){f(t);}}),o$2.command("get").description("Get webhook").argument("<id>").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(Fa,{id:e});if(!n.webhook)throw new o$1("Webhook not found");g(t,n.webhook);}catch(n){f(n);}}),o$2.command("create").description("Create webhook").requiredOption("--name <n>","Name").requiredOption("--url <u>","URL").requiredOption("--events <events>","Events (comma-separated)").option("-f, --format <format>","Output format").action(async e=>{try{let t=await b(Ga,{input:{name:e.name,url:e.url,events:e.events.split(",").map(n=>n.trim())}});h("Webhook created"),g(e,t.createWebhook);}catch(t){f(t);}}),o$2.command("update").description("Update webhook").argument("<id>").option("--name <n>","Name").option("--url <u>","URL").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={};if(t.name&&(n.name=t.name),t.url&&(n.url=t.url),!Object.keys(n).length)throw new o$1("No updates specified");let a=await b(Ha,{id:e,input:n});h("Webhook updated"),g(t,a.updateWebhook);}catch(n){f(n);}}),o$2.command("delete").description("Delete webhook").argument("<id>").option("--force","Skip confirmation").action(async(e,t)=>{try{if(!await p("Delete this webhook?",t.force))return;await b(Ia,{id:e}),h("Webhook deleted");}catch(n){f(n);}}),o$2.command("test").description("Test webhook").argument("<id>").action(async e=>{try{await b(Ja,{id:e}),h("Webhook test sent");}catch(t){f(t);}}),o$2.command("active").description("List active webhooks").option("-f, --format <format>","Output format").action(async e=>{try{let t=await b(Ka);g(e,t.activeWebhooks);}catch(t){f(t);}}),o$2.command("by-event").description("List webhooks by event").argument("<event>").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(La,{event:e});g(t,n.webhooksByEvent);}catch(n){f(n);}}),o$2.command("trigger").description("Trigger webhook").argument("<id>").option("--payload <json>","JSON payload").action(async(e,t)=>{try{await b(Ma,{id:e,payload:t.payload?JSON.parse(t.payload):void 0}),h("Webhook triggered");}catch(n){f(n);}}),o$2.command("reset-failures").description("Reset webhook failures").argument("<id>").action(async e=>{try{await b(Na,{id:e}),h("Webhook failures reset");}catch(t){f(t);}});}function Oo(m,o="HTTPS"){if(!m)return o;let e=m.toUpperCase();if(e==="HTTP"||e==="HTTPS"||e==="TCP"||e==="UDP")return e;throw new Error(`Invalid protocol: ${m} (expected http|https|tcp|udp)`)}function uo(m){return (m??"PROD").toUpperCase()==="ALPHA"?"ALPHA":"PROD"}function go(m){let o=m.command("tunnels").description("Tunnel management (VibeTunnels)");o.command("providers").description("List tunnel providers with capabilities").option("-f, --format <format>","Output format").action(async t=>{try{let n=await b(Qa);g(t,n.tunnelProviders);}catch(n){f(n);}}),o.command("list").description("List tunnels in the workspace").option("--provider <key>","Filter by provider (vibetunnels|cloudflare)").option("--status <status>","Filter by status").option("--search <query>","Search by name/slug").option("-f, --format <format>","Output format").action(async t=>{try{let n={};t.provider&&(n.providerKey=t.provider.toUpperCase()),t.status&&(n.status=[t.status.toUpperCase()]),t.search&&(n.search=t.search);let a=await b(Oa,{filter:n});if(t.format){g(t,a.tunnels);return}for(let d of a.tunnels.items){let f=d.primaryDomain?.hostname??"(no domain)";console.log(`${d.id} ${d.slug} ${d.providerKey} ${d.status} ${f} ${d.protocol}:${d.localPort}`);}console.log(`
|
|
2
|
-
${a.tunnels.total} total`);}catch(n){f(n);}}),o.command("get").description("Get a tunnel by ID").argument("<id>").option("-f, --format <format>").action(async(t,n)=>{try{let a=await b(Pa,{id:t});if(!a.tunnel)throw new o$1(`Tunnel ${t} not found`);g(n,a.tunnel);}catch(a){f(a);}}),o.command("create").description("Create a tunnel (DRAFT \u2014 start with `vibe tunnels start`)").requiredOption("--agent <id>","Agent ID").requiredOption("--name <name>","Tunnel name").requiredOption("--port <p>","Local port",parseInt).option("--provider <key>","Provider key (vibetunnels|cloudflare)","VIBETUNNELS").option("--protocol <p>","http|https|tcp|udp","https").option("--host <host>","Local host","127.0.0.1").option("--subdomain <label>","Reserve a *.vibetunnels.com subdomain").option("--env <env>","alpha|prod for managed subdomain","prod").option("--description <text>").option("-f, --format <format>").action(async t=>{try{let n={agentId:t.agent,name:t.name,description:t.description,providerKey:t.provider.toUpperCase(),protocol:Oo(t.protocol),localPort:t.port,localHost:t.host,managedSubdomain:t.subdomain,environment:uo(t.env)},a=await b(Ra,{input:n});h(`Tunnel created: ${a.createTunnel.slug}`),g(t,a.createTunnel);}catch(n){f(n);}}),o.command("start").description("Start a tunnel").argument("<id>").action(async t=>{try{await b(Ta,{id:t}),h("Tunnel started");}catch(n){f(n);}}),o.command("stop").description("Stop a tunnel").argument("<id>").action(async t=>{try{await b(Ua,{id:t}),h("Tunnel stopped");}catch(n){f(n);}}),o.command("rotate").description("Rotate tunnel credentials").argument("<id>").action(async t=>{try{await b(Va,{id:t}),h("Tunnel credentials rotated");}catch(n){f(n);}}),o.command("delete").description("Delete a tunnel").argument("<id>").option("--force","Skip confirmation").action(async(t,n)=>{try{if(!await p("Delete this tunnel?",n.force))return;await b(Sa,{id:t}),h("Tunnel deleted");}catch(a){f(a);}}),o.command("sessions").description("List sessions for a tunnel").argument("<tunnelId>").option("-f, --format <format>").action(async(t,n)=>{try{let a=await b(Xa,{tunnelId:t});g(n,a);}catch(a){f(a);}}),o.command("issue-session").description("Issue a short-lived token for a tunnel (printed once)").argument("<tunnelId>").option("--ttl <seconds>","TTL in seconds",t=>parseInt(t,10)).action(async(t,n)=>{try{let a=await b(Wa,{tunnelId:t,ttlSeconds:n.ttl});console.log("Session issued. The token below is shown exactly once."),console.log(`Session ID: ${a.issueTunnelSession.session.id}`),console.log(`Token: ${a.issueTunnelSession.token}`),console.log(`Expires: ${a.issueTunnelSession.session.expiresAt}`),console.log(`Agent hint: ${JSON.stringify(a.issueTunnelSession.agentConfigHint,null,2)}`);}catch(a){f(a);}}),o.command("revoke-session").description("Revoke an active tunnel session").argument("<sessionId>").option("--reason <text>").action(async(t,n)=>{try{await b(Ya,{sessionId:t,reason:n.reason??"revoked via CLI"}),h("Session revoked");}catch(a){f(a);}});let e=o.command("domains").description("Manage tunnel domains");e.command("list").description("List domains (optionally scoped to a tunnel)").option("--tunnel <id>","Tunnel ID").option("-f, --format <format>").action(async t=>{try{let n=await b(cb,{tunnelId:t.tunnel??null});g(t,n);}catch(n){f(n);}}),e.command("reserve").description("Reserve a managed *.vibetunnels.com subdomain").requiredOption("--label <label>","Subdomain label").option("--env <env>","alpha|prod","prod").action(async t=>{try{let n=await b(Za,{input:{label:t.label,environment:uo(t.env)}});h(`Reserved ${n.reserveTunnelSubdomain.hostname}`);}catch(n){f(n);}}),e.command("add-custom").description("Register a user-owned custom domain (TXT verification required)").argument("<hostname>").action(async t=>{try{let n=await b(_a,{input:{hostname:t}});console.log(`Registered ${n.registerCustomTunnelDomain.hostname}.`),console.log(`Create a TXT record at ${n.registerCustomTunnelDomain.challengeRecordName} containing:`),console.log(` ${n.registerCustomTunnelDomain.challengeToken}`);}catch(n){f(n);}}),e.command("attach").description("Attach a (verified) domain to a tunnel").argument("<tunnelId>").argument("<domainId>").option("--primary","Mark as primary domain").action(async(t,n,a)=>{try{await b($a,{tunnelId:t,domainId:n,makePrimary:!!a.primary}),h("Domain attached");}catch(d){f(d);}}),e.command("detach").description("Detach a domain from a tunnel").argument("<tunnelId>").argument("<domainId>").action(async(t,n)=>{try{await b(ab,{tunnelId:t,domainId:n}),h("Domain detached");}catch(a){f(a);}}),e.command("verify").description("Force verification check for a custom domain").argument("<domainId>").action(async t=>{try{let n=await b(bb,{domainId:t});console.log(`Status: ${n.verifyTunnelDomain.verificationStatus}`),n.verifyTunnelDomain.lastCheckError&&console.log(`Error: ${n.verifyTunnelDomain.lastCheckError}`);}catch(n){f(n);}});}function fo(m){let o=m.command("ui-session").description("UI session state");o.command("get").description("Get current UI session").option("-f, --format <format>","Output format").action(async e=>{try{let t=await b(db);g(e,t.uiSession);}catch(t){f(t);}}),o.command("clear").description("Clear UI session").action(async()=>{try{await b(fb),h("UI session cleared");}catch(e){f(e);}}),o.command("get-by-id").description("Get UI session by ID").argument("<id>").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(eb,{id:e});g(t,n.uiSessionById);}catch(n){f(n);}}),o.command("set-active-vibe").description("Set active vibe").argument("<vibeId>").action(async e=>{try{await b(gb,{vibeId:e}),h("Active vibe updated");}catch(t){f(t);}}),o.command("set-active-session").description("Set active session").argument("<sessionId>").action(async e=>{try{await b(hb,{sessionId:e}),h("Active session updated");}catch(t){f(t);}}),o.command("add-recent-vibe").description("Add recent vibe").argument("<vibeId>").action(async e=>{try{await b(ib,{vibeId:e}),h("Recent vibe added");}catch(t){f(t);}}),o.command("add-recent-session").description("Add recent session").argument("<sessionId>").action(async e=>{try{await b(jb,{sessionId:e}),h("Recent session added");}catch(t){f(t);}});}function lo(m){let o=m.command("cli-config").description("CLI configuration");o.command("set").description("Set CLI config value").argument("<key>").argument("<value>").action((e,t)=>{if(!z$1.includes(e))throw new o$1(`Unknown key: ${e}. Valid keys: ${z$1.join(", ")}`);x$1(e,t),h(`${e} = ${t}`);}),o.command("get").description("Get CLI config value").argument("<key>").action(e=>{let t=w$1(e);if(t===void 0)throw new o$1(`Key not set: ${e}`);console.log(t);}),o.command("list").description("Show all CLI config").option("-f, --format <format>","Output format").action(e=>{let t=v$1();if(e.format==="json"){l$1(t);return}let n=Object.entries(t).filter(([,a])=>a!==void 0);q$1(["Key","Value"],n.map(([a,d])=>[a,String(d)]));}),o.command("path").description("Show config file path").action(()=>{console.log(y$1());});}function yo(){let m=s()?.workspaceId;if(!m)throw new o$1("No workspace set. Run: vibecontrols workspace set <id>");return m}function Io(m$1){let o$2=m$1.command("targets").description("Target management (SSH/RDP/VNC)");o$2.command("list").description("List targets").option("--type <type>","Filter by type (DIRECT,SSH,RDP,VNC)").option("--limit <n>","Limit results",parseInt).option("--offset <n>","Offset results",parseInt).option("-f, --format <format>","Output format").action(async e=>{try{let t=yo(),n={};e.type&&(n.type=e.type.toUpperCase());let d=(await b(kb,{workspaceId:t,filter:Object.keys(n).length?n:void 0,limit:e.limit,offset:e.offset})).targets.items;g(e,d,{headers:["ID","Name","Type","Host","Port","Status"],rows:d.map(f=>[o(f.id,12),f.name,f.type,f.host,String(f.port??"-"),m(f.status)])});}catch(t){f(t);}}),o$2.command("get").description("Get target by ID").argument("<id>","Target ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(lb,{id:e});if(!n.target)throw new o$1("Target not found");g(t,n.target);}catch(n){f(n);}}),o$2.command("create").description("Create target").requiredOption("--name <n>","Name").requiredOption("--type <t>","Type (DIRECT,SSH,RDP,VNC)").requiredOption("--host <h>","Host address").requiredOption("--port <p>","Port",parseInt).option("--username <u>","Username").option("--protocol <p>","Protocol").option("--agent-id <id>","Agent ID").option("-f, --format <format>","Output format").action(async e=>{try{let t=yo(),n={name:e.name,type:e.type.toUpperCase(),host:e.host,port:e.port};e.username&&(n.username=e.username),e.protocol&&(n.protocol=e.protocol),e.agentId&&(n.agentId=e.agentId);let a=await b(mb,{workspaceId:t,input:n});h("Target created"),g(e,a.createTarget);}catch(t){f(t);}}),o$2.command("update").description("Update target").argument("<id>","Target ID").option("--name <n>","Name").option("--host <h>","Host address").option("--port <p>","Port",parseInt).option("--username <u>","Username").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={};if(t.name&&(n.name=t.name),t.host&&(n.host=t.host),t.port&&(n.port=t.port),t.username&&(n.username=t.username),!Object.keys(n).length)throw new o$1("No updates specified");let a=await b(nb,{id:e,input:n});h("Target updated"),g(t,a.updateTarget);}catch(n){f(n);}}),o$2.command("delete").description("Delete target").argument("<id>","Target ID").option("--force","Skip confirmation").action(async(e,t)=>{try{if(!await p("Delete this target?",t.force))return;await b(ob,{id:e}),h("Target deleted");}catch(n){f(n);}}),o$2.command("test").description("Test target connectivity").argument("<id>","Target ID").action(async e=>{try{let t=await b(pb,{id:e});t.testTarget.success?h(`Connection successful (${t.testTarget.latencyMs??"-"}ms)`):i$1(t.testTarget.error??"Connection failed");}catch(t){f(t);}}),o$2.command("scan-ssh").description("Scan SSH config for targets").requiredOption("--agent-id <id>","Agent ID").option("--config-path <path>","SSH config file path").option("-f, --format <format>","Output format").action(async e=>{try{let t=await b(qb,{agentId:e.agentId,configPath:e.configPath});h(`Found ${t.scanSSHConfig.length} target(s)`),g(e,t.scanSSHConfig);}catch(t){f(t);}}),o$2.command("install-agent").description("Install agent on target").requiredOption("--source-agent-id <id>","Source agent ID").requiredOption("--target-id <id>","Target ID").option("--agent-port <port>","Agent port",parseInt).action(async e=>{try{let t=await b(rb,{sourceAgentId:e.sourceAgentId,targetId:e.targetId,agentPort:e.agentPort});t.installAgentOnTarget.success?h("Agent installed on target"):i$1(t.installAgentOnTarget.error??"Installation failed");}catch(t){f(t);}}),o$2.command("uninstall-agent").description("Uninstall agent from target").argument("<targetId>","Target ID").action(async e=>{try{let t=await b(sb,{targetId:e});t.uninstallAgentFromTarget.success?h("Agent uninstalled from target"):i$1(t.uninstallAgentFromTarget.error??"Uninstall failed");}catch(t){f(t);}}),o$2.command("start-terminal").description("Start terminal on target").argument("<targetId>","Target ID").option("--shell <shell>","Shell to use").action(async(e,t)=>{try{let n=await b(tb,{targetId:e,shell:t.shell});h("Terminal started"),console.log(`Session ID: ${n.startTerminal.sessionId}`),console.log(`ttyd URL: ${n.startTerminal.ttydUrl}`);}catch(n){f(n);}}),o$2.command("stop-terminal").description("Stop terminal session").argument("<sessionId>","Session ID").action(async e=>{try{await b(ub,{sessionId:e}),h("Terminal stopped");}catch(t){f(t);}});}function ho(m){let o$2=m.command("vibedeck").description("VibeDeck management");o$2.command("list").description("List vibedecks").option("-f, --format <format>","Output format").action(async e=>{try{let n$1=(await b(vb)).vibeDecks.items;g(e,n$1,{headers:["ID","Name","Default","Created"],rows:n$1.map(a=>[o(a.id,12),a.name,a.isDefault?"Yes":"No",n(a.createdAt)])});}catch(t){f(t);}}),o$2.command("get").description("Get vibedeck").argument("<id>").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(wb,{id:e});if(!n.vibeDeck)throw new o$1("VibeDeck not found");g(t,n.vibeDeck);}catch(n){f(n);}}),o$2.command("default").description("Get default vibedeck").option("-f, --format <format>","Output format").action(async e=>{try{let t=await b(xb);if(!t.defaultVibeDeck)throw new o$1("No default VibeDeck found");g(e,t.defaultVibeDeck);}catch(t){f(t);}}),o$2.command("create").description("Create vibedeck").requiredOption("--name <n>","Name").option("--description <d>","Description").option("-f, --format <format>","Output format").action(async e=>{try{let t=await b(yb,{input:{name:e.name,description:e.description}});h("VibeDeck created"),g(e,t.createVibeDeck);}catch(t){f(t);}}),o$2.command("update").description("Update vibedeck").argument("<id>").option("--name <n>","Name").option("--description <d>","Description").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={};if(t.name&&(n.name=t.name),t.description&&(n.description=t.description),!Object.keys(n).length)throw new o$1("No updates specified");let a=await b(zb,{id:e,input:n});h("VibeDeck updated"),g(t,a.updateVibeDeck);}catch(n){f(n);}}),o$2.command("duplicate").description("Duplicate vibedeck").argument("<id>").option("--name <n>","New name").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(Ab,{id:e,name:t.name});h("VibeDeck duplicated"),g(t,n.duplicateVibeDeck);}catch(n){f(n);}}),o$2.command("delete").description("Delete vibedeck").argument("<id>").option("--force","Skip confirmation").action(async(e,t)=>{try{if(!await p("Delete this VibeDeck?",t.force))return;await b(Bb,{id:e}),h("VibeDeck deleted");}catch(n){f(n);}}),o$2.command("set-default").description("Set default vibedeck").argument("<id>").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(Cb,{id:e});h("Default VibeDeck updated"),g(t,n.setDefaultVibeDeck);}catch(n){f(n);}}),o$2.command("buttons").description("List vibedeck buttons").requiredOption("--deck-id <id>","VibeDeck ID").option("-f, --format <format>","Output format").action(async e=>{try{let n=(await b(Db,{filter:{vibeDeckId:e.deckId}})).vibeDeckButtons.items;g(e,n,{headers:["ID","Label","Type","Position","Command"],rows:n.map(a=>[o(a.id,12),a.label,a.type,`${a.row},${a.column}`,o(a.command??"",30)])});}catch(t){f(t);}}),o$2.command("button").description("Get vibedeck button").argument("<id>").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(Eb,{id:e});if(!n.vibeDeckButton)throw new o$1("Button not found");g(t,n.vibeDeckButton);}catch(n){f(n);}}),o$2.command("create-button").description("Create vibedeck button").requiredOption("--deck-id <id>","VibeDeck ID").requiredOption("--label <l>","Label").requiredOption("--type <t>","Type (COMMAND, SCRIPT, WEBHOOK)").option("--command <c>","Command").option("--script <s>","Script").option("--webhook-url <u>","Webhook URL").option("--icon <i>","Icon").option("--color <c>","Color").option("--row <n>","Row position",parseInt).option("--column <n>","Column position",parseInt).option("--action-id <id>","Link to an Action").option("-f, --format <format>","Output format").action(async e=>{try{let t={vibeDeckId:e.deckId,label:e.label,type:e.type.toUpperCase()};e.command&&(t.command=e.command),e.script&&(t.script=e.script),e.webhookUrl&&(t.webhookUrl=e.webhookUrl),e.icon&&(t.icon=e.icon),e.color&&(t.color=e.color),e.row!==void 0&&(t.row=e.row),e.column!==void 0&&(t.column=e.column),e.actionId&&(t.actionId=e.actionId);let n=await b(Fb,{input:t});h("Button created"),g(e,n.createVibeDeckButton);}catch(t){f(t);}}),o$2.command("update-button").description("Update vibedeck button").argument("<id>").option("--label <l>","Label").option("--command <c>","Command").option("--icon <i>","Icon").option("--color <c>","Color").option("--action-id <id>","Link to an Action").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={};if(t.label&&(n.label=t.label),t.command&&(n.command=t.command),t.icon&&(n.icon=t.icon),t.color&&(n.color=t.color),t.actionId&&(n.actionId=t.actionId),!Object.keys(n).length)throw new o$1("No updates specified");let a=await b(Gb,{id:e,input:n});h("Button updated"),g(t,a.updateVibeDeckButton);}catch(n){f(n);}}),o$2.command("delete-button").description("Delete vibedeck button").argument("<id>").option("--force","Skip confirmation").action(async(e,t)=>{try{if(!await p("Delete this button?",t.force))return;await b(Hb,{id:e}),h("Button deleted");}catch(n){f(n);}}),o$2.command("move-button").description("Move vibedeck button").argument("<id>").requiredOption("--row <n>","Row position",parseInt).requiredOption("--column <n>","Column position",parseInt).option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(Ib,{id:e,input:{row:t.row,column:t.column}});h("Button moved"),g(t,n.moveVibeDeckButton);}catch(n){f(n);}}),o$2.command("reorder-buttons").description("Reorder vibedeck buttons").argument("<vibeDeckId>").requiredOption("--positions <json>","Positions as JSON array").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n;try{n=JSON.parse(t.positions);}catch{throw new o$1("Invalid JSON for --positions")}let a=await b(Jb,{vibeDeckId:e,positions:n});h("Buttons reordered"),g(t,a.reorderVibeDeckButtons);}catch(n){f(n);}}),o$2.command("execute-button").description("Execute vibedeck button").argument("<id>").requiredOption("--agent-id <id>","Agent ID").action(async(e,t)=>{try{let a=(await b(Kb,{id:e,agentId:t.agentId})).executeVibeDeckButton;if(a.success)h(a.output??"Button executed successfully");else throw new o$1(a.error??"Execution failed")}catch(n){f(n);}});}function So(m){let o$2=m.command("ai-tool-events").description("AI tool event tracking");o$2.command("list").description("List AI tool events").option("--agent-id <id>","Filter by agent").option("--tool-name <name>","Filter by tool name").option("-f, --format <format>","Output format").action(async e=>{try{let t={};e.agentId&&(t.agentId=e.agentId),e.toolName&&(t.toolName=e.toolName);let a=(await b(Zb,{filter:Object.keys(t).length?t:void 0})).aiToolEvents.items;g(e,a,{headers:["ID","Tool","Event Type","Model","Tokens","Duration","Created"],rows:a.map(d=>[o(d.id,12),d.toolName,d.eventType,d.model??"-",String(d.tokenCount??"-"),String(d.duration??"-"),n(d.createdAt)])});}catch(t){f(t);}}),o$2.command("get").description("Get AI tool event").argument("<id>","Event ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(_b,{id:e});if(!n.aiToolEvent)throw new o$1("AI tool event not found");g(t,n.aiToolEvent);}catch(n){f(n);}}),o$2.command("recent").description("Recent AI tool events").requiredOption("--agent-id <id>","Filter by agent").option("--limit <n>","Max results",parseInt).option("-f, --format <format>","Output format").action(async e=>{try{let t=await b($b,{agentId:e.agentId,limit:e.limit});g(e,t.recentAiToolEvents);}catch(t){f(t);}}),o$2.command("create").description("Create AI tool event").requiredOption("--agent-id <id>","Agent ID").requiredOption("--tool-name <name>","Tool name").requiredOption("--event-type <type>","Event type").option("--model <model>","Model name").option("--input <input>","Input data").option("--output <output>","Output data").option("--token-count <n>","Token count",parseInt).option("--duration <ms>","Duration in ms",parseInt).option("-f, --format <format>","Output format").action(async e=>{try{let t=await b(ac,{input:{agentId:e.agentId,toolName:e.toolName,eventType:e.eventType,model:e.model,input:e.input,output:e.output,tokenCount:e.tokenCount,duration:e.duration}});h("AI tool event created"),g(e,t.createAiToolEvent);}catch(t){f(t);}}),o$2.command("cleanup").description("Delete old AI tool events").requiredOption("--before-date <date>","Delete events before this date").option("--force","Skip confirmation").action(async e=>{try{if(!await p(`Delete all AI tool events before ${e.beforeDate}?`,e.force))return;let t=await b(bc,{beforeDate:e.beforeDate});h("Old AI tool events deleted"),g({},t.deleteOldAiToolEvents);}catch(t){f(t);}});}function Eo(m){let o$2=m.command("docs").description("Documentation site management");o$2.command("sites").description("List documentation sites").option("-f, --format <format>","Output format").action(async e=>{try{let n$1=(await b(cc)).docsSites.items;g(e,n$1,{headers:["ID","Vibe ID","Name","Visibility","Created"],rows:n$1.map(a=>[o(a.id,12),o(a.vibeId,12),a.name,a.visibility,n(a.createdAt)])});}catch(t){f(t);}}),o$2.command("site").description("Get documentation site").argument("<vibeId>","Vibe ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(dc,{vibeId:e});if(!n.docsSite)throw new o$1("Docs site not found");g(t,n.docsSite);}catch(n){f(n);}}),o$2.command("create-site").description("Create documentation site").requiredOption("--vibe-id <id>","Vibe ID").requiredOption("--name <name>","Site name").option("--description <desc>","Description").option("--visibility <v>","Visibility (PRIVATE/PUBLIC)").option("-f, --format <format>","Output format").action(async e=>{try{let t=await b(ec,{input:{vibeId:e.vibeId,name:e.name,description:e.description,visibility:e.visibility}});h("Docs site created"),g(e,t.createDocsSite);}catch(t){f(t);}}),o$2.command("update-site").description("Update documentation site").argument("<id>","Site ID").option("--name <name>","Name").option("--description <desc>","Description").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={};if(t.name&&(n.name=t.name),t.description&&(n.description=t.description),!Object.keys(n).length)throw new o$1("No updates specified");let a=await b(fc,{id:e,input:n});h("Docs site updated"),g(t,a.updateDocsSite);}catch(n){f(n);}}),o$2.command("set-visibility").description("Set site visibility").argument("<id>","Site ID").argument("<visibility>","PRIVATE or PUBLIC").option("-f, --format <format>","Output format").action(async(e,t,n)=>{try{let a=await b(gc,{id:e,visibility:t});h(`Visibility set to ${t}`),g(n,a.updateDocsSiteVisibility);}catch(a){f(a);}}),o$2.command("delete-site").description("Delete documentation site").argument("<id>","Site ID").option("--force","Skip confirmation").action(async(e,t)=>{try{if(!await p("Delete this docs site?",t.force))return;await b(hc,{id:e}),h("Docs site deleted");}catch(n){f(n);}}),o$2.command("pages").description("List pages for a site").argument("<siteId>","Site ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(ic,{siteId:e});g(t,n.docsPages);}catch(n){f(n);}}),o$2.command("page").description("Get a page").argument("<id>","Page ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(jc,{id:e});if(!n.docsPage)throw new o$1("Page not found");g(t,n.docsPage);}catch(n){f(n);}}),o$2.command("create-page").description("Create a page").requiredOption("--site-id <id>","Site ID").requiredOption("--title <title>","Page title").option("--slug <slug>","Page slug").option("--content <content>","Page content").option("--parent-id <id>","Parent page ID").option("-f, --format <format>","Output format").action(async e=>{try{let t=await b(kc,{input:{siteId:e.siteId,title:e.title,slug:e.slug,content:e.content,parentId:e.parentId}});h("Page created"),g(e,t.createDocsPage);}catch(t){f(t);}}),o$2.command("update-page").description("Update a page").argument("<id>","Page ID").option("--title <title>","Title").option("--content <content>","Content").option("--slug <slug>","Slug").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={};if(t.title&&(n.title=t.title),t.content&&(n.content=t.content),t.slug&&(n.slug=t.slug),!Object.keys(n).length)throw new o$1("No updates specified");let a=await b(lc,{id:e,input:n});h("Page updated"),g(t,a.updateDocsPage);}catch(n){f(n);}}),o$2.command("delete-page").description("Delete a page").argument("<id>","Page ID").option("--force","Skip confirmation").action(async(e,t)=>{try{if(!await p("Delete this page?",t.force))return;await b(mc,{id:e}),h("Page deleted");}catch(n){f(n);}}),o$2.command("reorder-pages").description("Reorder pages").argument("<siteId>","Site ID").requiredOption("--pages <json>","Page order as JSON array").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=JSON.parse(t.pages),a=await b(nc,{siteId:e,pages:n});h("Pages reordered"),g(t,a.reorderDocsPages);}catch(n){f(n);}}),o$2.command("revisions").description("List revisions for a site").argument("<siteId>","Site ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(oc,{siteId:e});g(t,n.docsRevisions);}catch(n){f(n);}}),o$2.command("revision").description("Get a revision").argument("<id>","Revision ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(pc,{id:e});if(!n.docsRevision)throw new o$1("Revision not found");g(t,n.docsRevision);}catch(n){f(n);}}),o$2.command("content").description("Get docs content").argument("<siteId>","Site ID").option("--path <path>","Content path").action(async(e,t)=>{try{let n=await b(qc,{siteId:e,path:t.path});n.docsContent?console.log(n.docsContent):i$1("No content found");}catch(n){f(n);}}),o$2.command("compile").description("Compile documentation site").argument("<siteId>","Site ID").option("--publish","Publish after compile").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(rc,{siteId:e,publish:t.publish??!1});h("Docs site compiled"),g(t,n.compileDocsSite);}catch(n){f(n);}}),o$2.command("publish").description("Publish a revision").argument("<revisionId>","Revision ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(sc,{revisionId:e});h("Revision published"),g(t,n.publishDocsRevision);}catch(n){f(n);}}),o$2.command("rollback").description("Rollback to a revision").argument("<siteId>","Site ID").argument("<revisionId>","Revision ID").option("--force","Skip confirmation").action(async(e,t,n)=>{try{if(!await p(`Rollback site to revision ${t}?`,n.force))return;let a=await b(tc,{siteId:e,revisionId:t});h("Rollback complete"),g({},a.rollbackDocsRevision);}catch(a){f(a);}}),o$2.command("signed-url").description("Generate signed URL for a site").argument("<siteId>","Site ID").action(async e=>{try{let t=await b(uc,{siteId:e});console.log(t.generateDocsSignedUrl);}catch(t){f(t);}});}function To(m){let o$2=m.command("audit").description("Audit log management");o$2.command("list").description("List audit logs").option("--action <action>","Filter by action").option("--resource-type <type>","Filter by resource type").option("--status <status>","Filter by status").option("--actor-id <id>","Filter by actor").option("--from <date>","From date").option("--to <date>","To date").option("-f, --format <format>","Output format").action(async e=>{try{let t={};e.action&&(t.action=e.action),e.resourceType&&(t.resourceType=e.resourceType),e.status&&(t.status=e.status),e.actorId&&(t.actorId=e.actorId),e.from&&(t.from=e.from),e.to&&(t.to=e.to);let a=(await b(vc,{filter:Object.keys(t).length?t:void 0})).vibeAuditLogs.items;g(e,a,{headers:["ID","Action","Resource","Resource ID","Actor","Status","Created"],rows:a.map(d=>[o(d.id,12),d.action,d.resourceType,o(d.resourceId,12),o(d.actorId,12),d.status,n(d.createdAt)])});}catch(t){f(t);}}),o$2.command("get").description("Get audit log").argument("<id>","Audit log ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(wc,{id:e});if(!n.vibeAuditLog)throw new o$1("Audit log not found");g(t,n.vibeAuditLog);}catch(n){f(n);}}),o$2.command("stats").description("Get audit log statistics").option("--action <action>","Filter by action").option("--resource-type <type>","Filter by resource type").option("--status <status>","Filter by status").option("--actor-id <id>","Filter by actor").option("--from <date>","From date").option("--to <date>","To date").option("-f, --format <format>","Output format").action(async e=>{try{let t={};e.action&&(t.action=e.action),e.resourceType&&(t.resourceType=e.resourceType),e.status&&(t.status=e.status),e.actorId&&(t.actorId=e.actorId),e.from&&(t.from=e.from),e.to&&(t.to=e.to);let n=await b(xc,{filter:Object.keys(t).length?t:void 0});g(e,n.vibeAuditLogStats);}catch(t){f(t);}}),o$2.command("delete").description("Delete audit log").argument("<id>","Audit log ID").option("--reason <reason>","Deletion reason").option("--force","Skip confirmation").action(async(e,t)=>{try{if(!await p("Delete this audit log?",t.force))return;await b(yc,{id:e,reason:t.reason}),h("Audit log deleted");}catch(n){f(n);}}),o$2.command("bulk-delete").description("Bulk delete audit logs").requiredOption("--ids <ids>","Comma-separated IDs").option("--reason <reason>","Deletion reason").option("--force","Skip confirmation").action(async e=>{try{let t=e.ids.split(",").map(n=>n.trim());if(!await p(`Delete ${t.length} audit logs?`,e.force))return;await b(zc,{ids:t,reason:e.reason}),h(`${t.length} audit logs deleted`);}catch(t){f(t);}}),o$2.command("export").description("Export audit logs").option("--action <action>","Filter by action").option("--resource-type <type>","Filter by resource type").option("--status <status>","Filter by status").option("--actor-id <id>","Filter by actor").option("--from <date>","From date").option("--to <date>","To date").option("--export-format <fmt>","Export format (csv/json)","json").action(async e=>{try{let t={};e.action&&(t.action=e.action),e.resourceType&&(t.resourceType=e.resourceType),e.status&&(t.status=e.status),e.actorId&&(t.actorId=e.actorId),e.from&&(t.from=e.from),e.to&&(t.to=e.to);let n=await b(Ac,{filter:Object.keys(t).length?t:void 0,exportFormat:e.exportFormat});console.log(n.exportVibeAuditLogs);}catch(t){f(t);}});}function bo(m$1){let o$2=m$1.command("action").description("Vibe Actions management");o$2.command("list").description("List actions").option("--type <type>","Filter by action type (COMMAND, SCRIPT, WEBHOOK, WORKFLOW)").option("--trigger <trigger>","Filter by trigger type (MANUAL, SCHEDULED, EVENT, ON_DEMAND)").option("--category <category>","Filter by category").option("-f, --format <format>","Output format").action(async e=>{try{let t={};e.type&&(t.actionType=e.type.toUpperCase()),e.trigger&&(t.triggerType=e.trigger.toUpperCase()),e.category&&(t.category=e.category);let a=(await b(Lb,{filter:Object.keys(t).length?t:void 0})).actions.items;g(e,a,{headers:["ID","Name","Type","Trigger","Source","Category"],rows:a.map(d=>[o(d.id,12),d.displayName??d.name,d.actionType,d.triggerType,d.sourceType,d.category??"-"])});}catch(t){f(t);}}),o$2.command("get").description("Get action details").argument("<id>").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(Mb,{id:e});if(!n.action)throw new o$1("Action not found");g(t,n.action);}catch(n){f(n);}}),o$2.command("create").description("Create action").requiredOption("--name <n>","Name").option("--display-name <n>","Display name").option("--description <d>","Description").option("--type <t>","Action type (COMMAND, SCRIPT, WEBHOOK, WORKFLOW)","COMMAND").option("--trigger <t>","Trigger type (MANUAL, SCHEDULED, EVENT, ON_DEMAND)","MANUAL").option("--command <c>","Command to execute").option("--working-directory <d>","Working directory for command").option("--script <s>","Script content").option("--script-interpreter <i>","Script interpreter (e.g. bash, python)").option("--webhook-url <u>","Webhook URL").option("--webhook-method <m>","Webhook HTTP method").option("--schedule <s>","Cron schedule expression").option("--category <c>","Category").option("--tags <t>","Comma-separated tags").option("--target-agent-id <id>","Target agent ID").option("--timeout <ms>","Timeout in milliseconds",parseInt).option("--retry-count <n>","Retry count",parseInt).option("--confirmation-required","Require confirmation before execution").option("-f, --format <format>","Output format").action(async e=>{try{let t={name:e.name,actionType:(e.type??"COMMAND").toUpperCase(),triggerType:(e.trigger??"MANUAL").toUpperCase()};e.displayName&&(t.displayName=e.displayName),e.description&&(t.description=e.description),e.command&&(t.command=e.command),e.workingDirectory&&(t.workingDirectory=e.workingDirectory),e.script&&(t.script=e.script),e.scriptInterpreter&&(t.scriptInterpreter=e.scriptInterpreter),e.webhookUrl&&(t.webhookUrl=e.webhookUrl),e.webhookMethod&&(t.webhookMethod=e.webhookMethod),e.schedule&&(t.schedule=e.schedule),e.category&&(t.category=e.category),e.tags&&(t.tags=e.tags.split(",").map(a=>a.trim())),e.targetAgentId&&(t.targetAgentId=e.targetAgentId),e.timeout!==void 0&&(t.timeoutMs=e.timeout),e.retryCount!==void 0&&(t.retryCount=e.retryCount),e.confirmationRequired&&(t.confirmationRequired=!0);let n=await b(Nb,{input:t});h("Action created"),g(e,n.createAction);}catch(t){f(t);}}),o$2.command("update").description("Update action").argument("<id>").option("--name <n>","Name").option("--display-name <n>","Display name").option("--description <d>","Description").option("--type <t>","Action type (COMMAND, SCRIPT, WEBHOOK, WORKFLOW)").option("--trigger <t>","Trigger type (MANUAL, SCHEDULED, EVENT, ON_DEMAND)").option("--command <c>","Command to execute").option("--working-directory <d>","Working directory for command").option("--script <s>","Script content").option("--script-interpreter <i>","Script interpreter").option("--webhook-url <u>","Webhook URL").option("--webhook-method <m>","Webhook HTTP method").option("--schedule <s>","Cron schedule expression").option("--category <c>","Category").option("--tags <t>","Comma-separated tags").option("--target-agent-id <id>","Target agent ID").option("--timeout <ms>","Timeout in milliseconds",parseInt).option("--retry-count <n>","Retry count",parseInt).option("--confirmation-required","Require confirmation before execution").option("--no-confirmation-required","Disable confirmation requirement").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={};if(t.name&&(n.name=t.name),t.displayName&&(n.displayName=t.displayName),t.description&&(n.description=t.description),t.type&&(n.actionType=t.type.toUpperCase()),t.trigger&&(n.triggerType=t.trigger.toUpperCase()),t.command&&(n.command=t.command),t.workingDirectory&&(n.workingDirectory=t.workingDirectory),t.script&&(n.script=t.script),t.scriptInterpreter&&(n.scriptInterpreter=t.scriptInterpreter),t.webhookUrl&&(n.webhookUrl=t.webhookUrl),t.webhookMethod&&(n.webhookMethod=t.webhookMethod),t.schedule&&(n.schedule=t.schedule),t.category&&(n.category=t.category),t.tags&&(n.tags=t.tags.split(",").map(d=>d.trim())),t.targetAgentId&&(n.targetAgentId=t.targetAgentId),t.timeout!==void 0&&(n.timeoutMs=t.timeout),t.retryCount!==void 0&&(n.retryCount=t.retryCount),t.confirmationRequired!==void 0&&(n.confirmationRequired=t.confirmationRequired),!Object.keys(n).length)throw new o$1("No updates specified");let a=await b(Ob,{id:e,input:n});h("Action updated"),g(t,a.updateAction);}catch(n){f(n);}}),o$2.command("delete").description("Delete action").argument("<id>").option("--force","Skip confirmation").action(async(e,t)=>{try{if(!await p("Delete this action?",t.force))return;await b(Pb,{id:e}),h("Action deleted");}catch(n){f(n);}}),o$2.command("duplicate").description("Duplicate action").argument("<id>").argument("[name]").option("-f, --format <format>","Output format").action(async(e,t,n)=>{try{let a=await b(Qb,{id:e,name:t});h("Action duplicated"),g(n,a.duplicateAction);}catch(a){f(a);}}),o$2.command("execute").description("Execute action").argument("<id>").option("--agent-id <id>","Target agent ID").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={};t.agentId&&(n.agentId=t.agentId);let d=(await b(Rb,{id:e,input:Object.keys(n).length?n:void 0})).executeAction,f=d.status;f==="SUCCESS"?h(`Action executed successfully${d.durationMs?` (${d.durationMs}ms)`:""}`):f==="RUNNING"||f==="PENDING"?h(`Action execution started (${f})`):i$1(d.errorMessage??`Execution ${f}`),g(t,d);}catch(n){f(n);}}),o$2.command("install").description("Install action from store").argument("<storeItemId>").option("--version <v>","Version to install").option("--name <n>","Custom name for installed action").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(Sb,{storeItemId:e,version:t.version,name:t.name});h("Action installed from store"),g(t,n.installActionFromStore);}catch(n){f(n);}}),o$2.command("history").description("List action execution history").argument("[actionId]").option("--status <s>","Filter by status (PENDING, RUNNING, SUCCESS, FAILURE, TIMEOUT, CANCELLED)").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n$1={};e&&(n$1.actionId=e),t.status&&(n$1.status=t.status.toUpperCase());let d=(await b(Ub,{filter:Object.keys(n$1).length?n$1:void 0})).actionExecutions.items;g(t,d,{headers:["ID","Action ID","Status","Trigger","Duration","Started"],rows:d.map(f=>[o(f.id,12),o(f.actionId,12),m(f.status),f.triggerType,f.durationMs?`${f.durationMs}ms`:"-",n(f.startedAt)])});}catch(n){f(n);}}),o$2.command("cancel-execution").description("Cancel a running action execution").argument("<id>").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(Tb,{id:e});h("Action execution cancelled"),g(t,n.cancelActionExecution);}catch(n){f(n);}}),o$2.command("execution").description("Get action execution details").argument("<id>").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await b(Vb,{id:e});if(!n.actionExecution)throw new o$1("Action execution not found");g(t,n.actionExecution);}catch(n){f(n);}}),o$2.command("schedule").description("Create a scheduled job for an action").argument("<actionId>","Action ID to schedule").option("--cron <expr>","Cron expression (for CRON schedule type)").option("--timezone <tz>","Timezone for the schedule","UTC").option("--schedule-type <type>","Schedule type (CRON, ONE_TIME, FIXED_INTERVAL)","CRON").option("--scheduled-at <date>","ISO date for ONE_TIME schedule").option("--interval <n>","Interval value (for FIXED_INTERVAL)",parseInt).option("--interval-unit <unit>","Interval unit (MINUTES, HOURS, DAYS)").option("--start-date <date>","Schedule start date (ISO)").option("--end-date <date>","Schedule end date (ISO)").option("--name <name>","Name for the scheduled job").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={actionId:e,scheduleType:(t.scheduleType??"CRON").toUpperCase()};t.cron&&(n.cronExpression=t.cron),t.timezone&&(n.timezone=t.timezone),t.scheduledAt&&(n.scheduledAt=t.scheduledAt),t.interval!==void 0&&(n.interval=t.interval),t.intervalUnit&&(n.intervalUnit=t.intervalUnit.toUpperCase()),t.startDate&&(n.startDate=t.startDate),t.endDate&&(n.endDate=t.endDate),t.name&&(n.name=t.name);let a=await b(Wb,{input:n});h("Scheduled job created"),g(t,a.createScheduledJob);}catch(n){f(n);}}),o$2.command("unschedule").description("Delete a scheduled job").argument("<scheduledJobId>","Scheduled job ID to delete").option("--force","Skip confirmation").action(async(e,t)=>{try{if(!await p("Delete this scheduled job?",t.force))return;await b(Xb,{id:e}),h("Scheduled job deleted");}catch(n){f(n);}}),o$2.command("schedules").description("List scheduled jobs").option("--action-id <id>","Filter by action ID").option("-f, --format <format>","Output format").action(async e=>{try{let t={};e.actionId&&(t.actionId=e.actionId);let a=(await b(Yb,{filter:Object.keys(t).length?t:void 0})).scheduledJobs.jobs;g(e,a,{headers:["ID","Name","Type","Status","Action ID","Cron","Next Run"],rows:a.map(d=>[o(d.id,12),d.name??"-",d.scheduleType,m(d.status),o(d.actionId,12),d.cronExpression??"-",d.nextExecutionAt?n(d.nextExecutionAt):"-"])});}catch(t){f(t);}});}function wo(m){let o=m.command("analytics").description("VibeControls analytics");o.command("overview").description("Show analytics overview for all entities").option("--start-date <date>","Start date (ISO format)",new Date(Date.now()-10080*60*1e3).toISOString()).option("--end-date <date>","End date (ISO format)",new Date().toISOString()).option("--granularity <g>","Granularity (HOUR, DAY, WEEK, MONTH)","DAY").option("--agent-id <id>","Filter by agent ID").option("--vibe-id <id>","Filter by vibe ID").option("-f, --format <format>","Output format").action(async e=>{try{let t=await b(Jc,{input:{startDate:e.startDate,endDate:e.endDate,granularity:e.granularity,agentId:e.agentId||void 0,vibeId:e.vibeId||void 0}});g(e,t.vibecontrolsAnalytics);}catch(t){f(t);}}),o.command("agents").description("Show agent analytics").option("--start-date <date>","Start date (ISO format)",new Date(Date.now()-10080*60*1e3).toISOString()).option("--end-date <date>","End date (ISO format)",new Date().toISOString()).option("--granularity <g>","Granularity","DAY").option("-f, --format <format>","Output format").action(async e=>{try{let t=await b(Jc,{input:{startDate:e.startDate,endDate:e.endDate,granularity:e.granularity,entityTypes:["AGENT"]}});g(e,t.vibecontrolsAnalytics.agents);}catch(t){f(t);}}),o.command("sessions").description("Show session analytics").option("--start-date <date>","Start date (ISO format)",new Date(Date.now()-10080*60*1e3).toISOString()).option("--end-date <date>","End date (ISO format)",new Date().toISOString()).option("--granularity <g>","Granularity","DAY").option("--agent-id <id>","Filter by agent ID").option("--vibe-id <id>","Filter by vibe ID").option("-f, --format <format>","Output format").action(async e=>{try{let t=await b(Jc,{input:{startDate:e.startDate,endDate:e.endDate,granularity:e.granularity,entityTypes:["SESSION"],agentId:e.agentId||void 0,vibeId:e.vibeId||void 0}});g(e,t.vibecontrolsAnalytics.sessions);}catch(t){f(t);}}),o.command("actions").description("Show action analytics").option("--start-date <date>","Start date (ISO format)",new Date(Date.now()-10080*60*1e3).toISOString()).option("--end-date <date>","End date (ISO format)",new Date().toISOString()).option("--granularity <g>","Granularity","DAY").option("-f, --format <format>","Output format").action(async e=>{try{let t=await b(Jc,{input:{startDate:e.startDate,endDate:e.endDate,granularity:e.granularity,entityTypes:["ACTION"]}});g(e,t.vibecontrolsAnalytics.actions);}catch(t){f(t);}});}var Do={id:"vibecontrols",version:"1.0.0",displayName:"VibeControls",dependsOn:["auth","workspaces"],register(m,o){a(o),ro(m),ao(m),so(m),co(m),mo(m),po(m),go(m),fo(m),lo(m),Io(m),ho(m),So(m),Eo(m),To(m),bo(m),wo(m);}},tr=Do;export{tr as default};
|
|
1
|
+
import {a as a$1,b as b$1,k as k$1,c,d,f as f$1,g as g$1,e,h as h$1,i,j,l,m as m$1,n as n$1,o as o$2,p as p$1,q,r,s as s$1,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,Q,R,S,T,U,V,W,X,Y,Z,_,$,aa,ba,ca,da,P,ea,fa,ga,Qd,ha,ia,ja,ka,la,ma,na,oa,pa,qa,ra,sa,ta,ua,va,wa,xa,ya,Aa,Ba,za,Ca,Da,Ea,Fa,Ga,Ha,Ia,Ja,Ka,La,Ma,Na,Qa,Oa,Pa,Ra,Ua,Va,Wa,Ta,Ya,Xa,Za,db,_a,$a,ab,bb,cb,fb,kb,eb,Sa,gb,hb,ib,jb,lb,mb,nb,pb,ob,qb,rb,sb,tb,ub,vb,wb,xb,yb,zb,Ab,Bb,Cb,Db,Eb,Fb,Gb,Hb,Ib,Jb,Kb,Lb,Mb,Nb,Ob,Pb,Qb,Rb,Sb,Tb,Ub,Zd,_d,$d,ae,be,ce,de,hc,ic,jc,kc,lc,mc,nc,oc,pc,qc,rc,sc,tc,uc,vc,wc,xc,yc,zc,Ac,Bc,Cc,Dc,Ec,Fc,Gc,Hc,Ic,Jc,Kc,Vb,Wb,Xb,Yb,Zb,_b,$b,ac,cc,bc,dc,ec,fc,gc,Rd,Sd,Td,Ud,Vd,Wd,Xd,Yd,nd,od,pd,qd,rd,sd,td,ud,vd,wd,xd,yd,zd,Ad,Bd,Cd,Dd,Ed,Fd,Gd,Hd,Id,Jd,Kd,Ld,Md,Nd,Od,Pd,ee,qe,he,ge,fe,me,ne,ie,re,je,ke,le,se,oe,pe,te,ue,ye,ve,we,xe,ze,Ae,Be,Ce,De,Ee,Fe,Ge,Ke,Le,Me,Ne,He,Ie,Je,Oe}from'../../chunk-REBBLQFS.js';import {a,b,g,o,m,n,f,h,p,i as i$1,s,z as z$1,x as x$1,w as w$1,v as v$1,l as l$1,q as q$1,y as y$1}from'../../chunk-KTKHJORN.js';import {o as o$1}from'../../chunk-RNWXATAC.js';function xo(m$2){let a=m$2.command("agents").description("Agent management");a.command("list").description("List agents").option("--active","Only active agents").option("--platform <p>","Filter by platform").option("-f, --format <format>","Output format").action(async n$1=>{try{let t={};n$1.active&&(t.isActive=!0),n$1.platform&&(t.platform=n$1.platform);let e=await b(a$1,{filter:Object.keys(t).length?t:void 0});g(n$1,e.vibecontrolsAgents,{headers:["ID","Name","Hostname","Platform","Status","Last Heartbeat"],rows:e.vibecontrolsAgents.map(i=>[o(i.id,12),i.name,i.hostname,i.platform,m(i.isActive?"ACTIVE":"INACTIVE"),n(i.lastHeartbeat)])});}catch(t){f(t);}}),a.command("get").description("Get agent by ID").argument("<id>","Agent ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(b$1,{id:n});if(!e.vibecontrolsAgent)throw new o$1("Agent not found");g(t,e.vibecontrolsAgent);}catch(e){f(e);}}),a.command("create").description("Create agent").requiredOption("--name <n>","Name").requiredOption("--hostname <h>","Hostname").requiredOption("--platform <p>","Platform").requiredOption("--arch <a>","Architecture").requiredOption("--agent-version <v>","Agent version").option("--tunnel-url <u>","Tunnel URL").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(k$1,{input:{name:n.name,hostname:n.hostname,platform:n.platform,architecture:n.arch,version:n.agentVersion,tunnelUrl:n.tunnelUrl}});h("Agent created"),g(n,t.registerVibecontrolsAgent);}catch(t){f(t);}}),a.command("update").description("Update agent").argument("<id>","Agent ID").option("--name <n>","Name").option("--tunnel-url <u>","Tunnel URL").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e={};if(t.name&&(e.name=t.name),t.tunnelUrl&&(e.tunnelUrl=t.tunnelUrl),!Object.keys(e).length)throw new o$1("No updates specified");let i=await b(c,{id:n,input:e});h("Agent updated"),g(t,i.updateVibecontrolsAgent);}catch(e){f(e);}}),a.command("delete").description("Delete agent").argument("<id>","Agent ID").option("--force","Skip confirmation").action(async(n,t)=>{try{if(!await p("Delete this agent?",t.force))return;await b(d,{id:n}),h("Agent deleted");}catch(e){f(e);}}),a.command("probe").description("Probe agent connectivity").argument("<id>","Agent ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(f$1,{id:n});g(t,e.probeAgentConnection);}catch(e){f(e);}}),a.command("health").description("Health check all agents").option("-f, --format <format>","Output format").action(async n=>{try{let e=(await b(g$1)).vibecontrolsAgentHealthProbes;g(n,e,{headers:["Agent","Name","Healthy","Version","Uptime"],rows:e.map(i=>[o(i.agentId,12),i.agentName,m(i.healthy?"HEALTHY":"ERROR"),i.agentVersion??"-",i.uptime!=null?Math.round(i.uptime)+"s":"-"])});}catch(t){f(t);}}),a.command("heartbeat").description("Send heartbeat").argument("<id>","Agent ID").action(async n=>{try{await b(e,{id:n}),h("Heartbeat sent");}catch(t){f(t);}}),a.command("plugins").description("List plugins").argument("<id>","Agent ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(h$1,{agentId:n});g(t,e.agentPlugins);}catch(e){f(e);}}),a.command("install-plugin").description("Install plugin").argument("<agentId>").argument("<packageName>").action(async(n,t)=>{try{let e=await b(i,{agentId:n,packageName:t});e.installAgentPlugin.success?h(`Plugin ${t} installed`):i$1(e.installAgentPlugin.error??"Failed");}catch(e){f(e);}}),a.command("remove-plugin").description("Remove plugin").argument("<agentId>").argument("<packageName>").action(async(n,t)=>{try{let e=await b(j,{agentId:n,packageName:t});e.removeAgentPlugin.success?h(`Plugin ${t} removed`):i$1(e.removeAgentPlugin.error??"Failed");}catch(e){f(e);}}),a.command("register").description("Register a new agent").requiredOption("--hostname <h>","Hostname").requiredOption("--name <n>","Name").option("--platform <p>","Platform").option("--arch <a>","Architecture").option("--agent-version <v>","Agent version").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(k$1,{input:{hostname:n.hostname,name:n.name,platform:n.platform,architecture:n.arch,version:n.agentVersion}});h("Agent registered"),g(n,t.registerAgent);}catch(t){f(t);}}),a.command("deactivate").description("Deactivate agent").argument("<id>","Agent ID").action(async n=>{try{await b(l,{id:n}),h("Agent deactivated");}catch(t){f(t);}}),a.command("push-gateway-auth").description("Push gateway auth credentials").requiredOption("--agent-id <id>","Agent ID").requiredOption("--client-id <cid>","Client ID").requiredOption("--client-secret <cs>","Client secret").action(async n=>{try{await b(m$1,{input:{agentId:n.agentId,clientId:n.clientId,clientSecret:n.clientSecret}}),h("Gateway auth pushed");}catch(t){f(t);}}),a.command("setup-gateway-auth").description("Setup gateway auth for agent").requiredOption("--agent-id <id>","Agent ID").action(async n=>{try{await b(n$1,{input:{agentId:n.agentId}}),h("Gateway auth setup complete");}catch(t){f(t);}}),a.command("update-version").description("Update agent version").argument("<agentId>","Agent ID").argument("<version>","Version").action(async(n,t)=>{try{await b(o$2,{agentId:n,version:t}),h("Agent version updated");}catch(e){f(e);}}),a.command("connect-target").description("Connect agent to target").argument("<sourceAgentId>","Source agent ID").argument("<targetId>","Target ID").requiredOption("--protocol <p>","Protocol").action(async(n,t,e)=>{try{await b(p$1,{sourceAgentId:n,targetId:t,protocol:e.protocol}),h("Agent connected to target");}catch(i){f(i);}}),a.command("disconnect-target").description("Disconnect agent from target").argument("<connectionId>","Connection ID").action(async n=>{try{await b(q,{connectionId:n}),h("Agent disconnected from target");}catch(t){f(t);}}),a.command("graph").description("Get agent graph").option("--root-agent-id <id>","Root agent ID").option("-f, --format <format>","Output format").action(async n=>{try{let t=s(),e=await b(r,{rootAgentId:n.rootAgentId,workspaceId:t?.workspaceId});g(n,e.agentGraph);}catch(t){f(t);}});}function jo(m$1){let a=m$1.command("vibes").description("Vibe management");a.command("list").description("List vibes").option("--status <s>","Filter by status").option("--type <t>","Filter by type").option("--agent <id>","Filter by agent").option("-f, --format <format>","Output format").action(async n$1=>{try{let t={};n$1.status&&(t.status=n$1.status.toUpperCase()),n$1.type&&(t.type=n$1.type.toUpperCase()),n$1.agent&&(t.agentId=n$1.agent);let i=(await b(s$1,{filter:Object.keys(t).length?t:void 0})).vibes.items;g(n$1,i,{headers:["ID","Name","Type","Status","Path","Created"],rows:i.map(s=>[o(s.id,12),s.name,s.type,m(s.status),o(s.path,30),n(s.createdAt)])});}catch(t){f(t);}}),a.command("get").description("Get vibe by ID").argument("<id>").option("-f, --format <format>","Output format").action(async(n,t$1)=>{try{let e=await b(t,{id:n});if(!e.vibe)throw new o$1("Vibe not found");g(t$1,e.vibe);}catch(e){f(e);}}),a.command("create").description("Create vibe").requiredOption("--name <n>","Name").requiredOption("--path <p>","Path").requiredOption("--type <t>","Type (PROJECT, REPOSITORY, etc.)").option("--agent <id>","Agent ID").option("--description <d>","Description").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(u,{input:{name:n.name,path:n.path,type:n.type.toUpperCase(),agentId:n.agent,description:n.description}});h("Vibe created"),g(n,t.createVibe);}catch(t){f(t);}}),a.command("update").description("Update vibe").argument("<id>").option("--name <n>","Name").option("--description <d>","Description").option("--status <s>","Status").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e={};if(t.name&&(e.name=t.name),t.description&&(e.description=t.description),t.status&&(e.status=t.status.toUpperCase()),!Object.keys(e).length)throw new o$1("No updates specified");let i=await b(v,{id:n,input:e});h("Vibe updated"),g(t,i.updateVibe);}catch(e){f(e);}}),a.command("delete").description("Delete vibe").argument("<id>").option("--force","Skip confirmation").action(async(n,t)=>{try{if(!await p("Delete this vibe?",t.force))return;await b(w,{id:n}),h("Vibe deleted");}catch(e){f(e);}}),a.command("archive").description("Archive vibe").argument("<id>").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(x,{id:n});h("Vibe archived"),g(t,e.archiveVibe);}catch(e){f(e);}}),a.command("restore").description("Restore archived vibe").argument("<id>").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(y,{id:n});h("Vibe restored"),g(t,e.restoreVibe);}catch(e){f(e);}}),a.command("hierarchy").description("Get vibe hierarchy").option("--root <id>","Root vibe ID").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(z,{rootId:n.root});g(n,t.vibeHierarchy);}catch(t){f(t);}}),a.command("search").description("Search vibes").argument("<query>").option("--limit <n>","Max results",parseInt).option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(A,{query:n,limit:t.limit});g(t,e.searchVibes);}catch(e){f(e);}}),a.command("move").description("Move vibe to new parent").argument("<id>","Vibe ID").option("--parent <parentId>","New parent ID (omit to remove parent)").action(async(n,t)=>{try{let e=await b(B,{id:n,newParentId:t.parent||null});h("Vibe moved"),g({},e.moveVibe);}catch(e){f(e);}}),a.command("set-status").description("Set vibe status").argument("<id>","Vibe ID").argument("<status>","New status").action(async(n,t)=>{try{await b(C,{id:n,status:t.toUpperCase()}),h("Vibe status updated");}catch(e){f(e);}}),a.command("update-git").description("Update vibe git info").argument("<id>","Vibe ID").option("--branch <b>","Branch").option("--remote <r>","Remote").option("--status <s>","Status").action(async(n,t)=>{try{let e={};t.branch&&(e.branch=t.branch),t.remote&&(e.remote=t.remote),t.status&&(e.status=t.status);let i=await b(D,{id:n,input:e});h("Vibe git info updated"),g({},i.updateVibeGit);}catch(e){f(e);}});}function Yo(m$1){let a=m$1.command("sessions").description("Session management");a.command("list").description("List sessions").option("--status <s>","Filter by status").option("--type <t>","Filter by type").option("--vibe <id>","Filter by vibe").option("--agent <id>","Filter by agent").option("-f, --format <format>","Output format").action(async n$1=>{try{let t={};n$1.status&&(t.status=n$1.status.toUpperCase()),n$1.type&&(t.type=n$1.type.toUpperCase()),n$1.vibe&&(t.vibeId=n$1.vibe),n$1.agent&&(t.agentId=n$1.agent);let i=(await b(E,{filter:Object.keys(t).length?t:void 0})).sessions.items;g(n$1,i,{headers:["ID","Name","Type","Status","Agent","Started"],rows:i.map(s=>[o(s.id,12),s.name,s.type,m(s.status),o(s.agentId,12),n(s.startedAt)])});}catch(t){f(t);}}),a.command("get").description("Get session").argument("<id>").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(F,{id:n});if(!e.session)throw new o$1("Session not found");g(t,e.session);}catch(e){f(e);}}),a.command("create").description("Create session").requiredOption("--name <n>","Name").requiredOption("--agent <id>","Agent ID").requiredOption("--type <t>","Type (TMUX, SSH, TERMINAL, SCRIPT, CUSTOM)").option("--vibe <id>","Vibe ID").option("--command <c>","Command").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(G,{input:{name:n.name,agentId:n.agent,type:n.type.toUpperCase(),vibeId:n.vibe,command:n.command}});h("Session created"),g(n,t.createSession);}catch(t){f(t);}}),a.command("start").description("Start session").argument("<id>").action(async n=>{try{await b(H,{id:n}),h("Session started");}catch(t){f(t);}}),a.command("stop").description("Stop session").argument("<id>").action(async n=>{try{await b(I,{id:n}),h("Session stopped");}catch(t){f(t);}}),a.command("restart").description("Restart session").argument("<id>").action(async n=>{try{await b(J,{id:n}),h("Session restarted");}catch(t){f(t);}}),a.command("terminate").description("Terminate session").argument("<id>").option("--force","Skip confirmation").action(async(n,t)=>{try{if(!await p("Terminate this session?",t.force))return;await b(K,{id:n}),h("Session terminated");}catch(e){f(e);}}),a.command("output").description("Get session output").argument("<id>").option("--lines <n>","Number of lines",parseInt).option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(L,{id:n,lines:t.lines});e.sessionOutput?console.log(e.sessionOutput):i$1("No output");}catch(e){f(e);}}),a.command("send-input").description("Send input to session").argument("<id>").argument("<input>").action(async(n,t)=>{try{await b(M,{id:n,input:t}),h("Input sent");}catch(e){f(e);}}),a.command("start-terminal").description("Start web terminal").argument("<id>").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(N,{id:n});h("Terminal started"),g(t,e.startSessionTerminal);}catch(e){f(e);}}),a.command("stop-terminal").description("Stop web terminal").argument("<id>").action(async n=>{try{await b(O,{id:n}),h("Terminal stopped");}catch(t){f(t);}}),a.command("active").description("List active sessions").option("--vibe <id>","Filter by vibe").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(Q,{vibeId:n.vibe});g(n,t.activeSessions);}catch(t){f(t);}}),a.command("health-check").description("Check health of all sessions").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(R);h("Health check complete"),g(n,t.checkSessionHealth);}catch(t){f(t);}}),a.command("share").description("Share session with user").argument("<sessionId>","Session ID").requiredOption("--user-id <uid>","User ID").option("--permission <p>","Permission (VIEW/INTERACT)","VIEW").action(async(n,t)=>{try{await b(S,{input:{sessionId:n,sharedWithId:t.userId,permission:t.permission}}),h("Session shared");}catch(e){f(e);}}),a.command("create-share-link").description("Create share link").argument("<sessionId>","Session ID").option("--permission <p>","Permission (VIEW/INTERACT)","VIEW").action(async(n,t)=>{try{let e=await b(T,{input:{sessionId:n,permission:t.permission}});h("Share link created"),g({},e.createSessionShareLink);}catch(e){f(e);}}),a.command("revoke-share").description("Revoke session share").argument("<id>","Share ID").action(async n=>{try{await b(U,{id:n}),h("Session share revoked");}catch(t){f(t);}}),a.command("revoke-share-link").description("Revoke session share link").argument("<id>","Share link ID").action(async n=>{try{await b(V,{id:n}),h("Share link revoked");}catch(t){f(t);}}),a.command("update-share").description("Update session share permission").argument("<id>","Share ID").requiredOption("--permission <p>","Permission (VIEW/INTERACT)").action(async(n,t)=>{try{await b(W,{id:n,input:{permission:t.permission}}),h("Session share updated");}catch(e){f(e);}}),a.command("join").description("Join shared session").argument("<sessionId>","Session ID").action(async n=>{try{await b(X,{input:{sessionId:n}}),h("Joined session");}catch(t){f(t);}}),a.command("leave").description("Leave shared session").argument("<sessionId>","Session ID").action(async n=>{try{await b(Y,{sessionId:n}),h("Left session");}catch(t){f(t);}}),a.command("request-control").description("Request session control").argument("<sessionId>","Session ID").action(async n=>{try{await b(Z,{sessionId:n}),h("Control requested");}catch(t){f(t);}}),a.command("release-control").description("Release session control").argument("<sessionId>","Session ID").action(async n=>{try{await b(_,{sessionId:n}),h("Control released");}catch(t){f(t);}}),a.command("transfer-control").description("Transfer session control").argument("<sessionId>","Session ID").requiredOption("--to-user <uid>","Target user ID").action(async(n,t)=>{try{await b($,{sessionId:n,toUserId:t.toUser}),h("Control transferred");}catch(e){f(e);}}),a.command("shares").description("List session shares").argument("<sessionId>","Session ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(aa,{sessionId:n});g(t,e.sessionShares);}catch(e){f(e);}}),a.command("share-links").description("List session share links").argument("<sessionId>","Session ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(ba,{sessionId:n});g(t,e.sessionShareLinks);}catch(e){f(e);}}),a.command("collaborators").description("List session collaborators").argument("<sessionId>","Session ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(ca,{sessionId:n});g(t,e.sessionCollaborators);}catch(e){f(e);}}),a.command("shared-with-me").description("List sessions shared with me").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(da);g(n,t.sessionsSharedWithMe);}catch(t){f(t);}}),a.command("restart-terminal").description("Restart session terminal").argument("<id>","Session ID").action(async n=>{try{await b(P,{id:n}),h("Terminal restarted");}catch(t){f(t);}}),a.command("bulk-restart").description("Bulk restart sessions").requiredOption("--ids <ids>","Session IDs (comma-separated)").option("--force","Skip confirmation").action(async n=>{try{await b(ea,{ids:n.ids.split(",").map(t=>t.trim()),force:n.force}),h("Sessions restarted");}catch(t){f(t);}}),a.command("bulk-stop").description("Bulk stop sessions").requiredOption("--ids <ids>","Session IDs (comma-separated)").option("--force","Skip confirmation").action(async n=>{try{await b(fa,{ids:n.ids.split(",").map(t=>t.trim()),force:n.force}),h("Sessions stopped");}catch(t){f(t);}}),a.command("bulk-terminate").description("Bulk terminate sessions").requiredOption("--ids <ids>","Session IDs (comma-separated)").option("--force","Skip confirmation").action(async n=>{try{if(!await p("Terminate these sessions?",n.force))return;await b(ga,{ids:n.ids.split(",").map(t=>t.trim())}),h("Sessions terminated");}catch(t){f(t);}}),a.command("export").description("Export sessions (CSV or JSON)").option("--format <fmt>","Output format: CSV or JSON","JSON").option("--status <s>","Filter by status").option("--type <t>","Filter by type").option("--vibe <id>","Filter by vibe").option("--agent <id>","Filter by agent").action(async n=>{try{let t={};n.status&&(t.status=n.status.toUpperCase()),n.type&&(t.type=n.type.toUpperCase()),n.vibe&&(t.vibeId=n.vibe),n.agent&&(t.agentId=n.agent);let e=(n.format??"JSON").toUpperCase();if(e!=="CSV"&&e!=="JSON")throw new o$1("--format must be CSV or JSON");let i=await b(Qd,{input:{filter:Object.keys(t).length?t:void 0,format:e}});process.stdout.write(i.exportSessions.data),i.exportSessions.data.endsWith(`
|
|
2
|
+
`)||process.stdout.write(`
|
|
3
|
+
`),h(`Exported ${i.exportSessions.count} sessions (${i.exportSessions.format})`);}catch(t){f(t);}});}function Jo(m){let a=m.command("notes").description("Note management");a.command("list").description("List notes").option("--vibe <id>","Filter by vibe").option("--pinned","Show only pinned").option("--tags <tags>","Filter by tags (comma-separated)").option("-f, --format <format>","Output format").action(async n$1=>{try{let t={};n$1.vibe&&(t.vibeId=n$1.vibe),n$1.pinned&&(t.isPinned=!0),n$1.tags&&(t.tags=n$1.tags.split(",").map(i=>i.trim()));let e=await b(ha,{filter:Object.keys(t).length?t:void 0});g(n$1,e.notes.items,{headers:["ID","Title","Pinned","Tags","Created"],rows:e.notes.items.map(i=>[o(i.id,12),i.title,i.isPinned?"Yes":"No",(i.tags??[]).join(", "),n(i.createdAt)])});}catch(t){f(t);}}),a.command("get").description("Get note").argument("<id>").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(ia,{id:n});if(!e.note)throw new o$1("Note not found");g(t,e.note);}catch(e){f(e);}}),a.command("create").description("Create note").requiredOption("--title <t>","Title").requiredOption("--content <c>","Content").option("--vibe <id>","Vibe ID").option("--tags <tags>","Tags (comma-separated)").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(ja,{input:{title:n.title,content:n.content,vibeId:n.vibe,tags:n.tags?.split(",").map(e=>e.trim())}});h("Note created"),g(n,t.createNote);}catch(t){f(t);}}),a.command("update").description("Update note").argument("<id>").option("--title <t>","Title").option("--content <c>","Content").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e={};if(t.title&&(e.title=t.title),t.content&&(e.content=t.content),!Object.keys(e).length)throw new o$1("No updates specified");let i=await b(ka,{id:n,input:e});h("Note updated"),g(t,i.updateNote);}catch(e){f(e);}}),a.command("delete").description("Delete note").argument("<id>").option("--force","Skip confirmation").action(async(n,t)=>{try{if(!await p("Delete this note?",t.force))return;await b(la,{id:n}),h("Note deleted");}catch(e){f(e);}}),a.command("search").description("Search notes").argument("<query>").option("--vibe <id>","Scope to vibe").option("--limit <n>","Max results",parseInt).option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(ma,{query:n,vibeId:t.vibe,limit:t.limit});g(t,e.searchNotes);}catch(e){f(e);}}),a.command("pin").description("Pin a note").argument("<id>").action(async n=>{try{await b(na,{id:n}),h("Note pinned");}catch(t){f(t);}}),a.command("unpin").description("Unpin a note").argument("<id>").action(async n=>{try{await b(oa,{id:n}),h("Note unpinned");}catch(t){f(t);}}),a.command("tag").description("Tag a note").argument("<noteId>","Note ID").argument("<tag>","Tag").action(async(n,t)=>{try{await b(pa,{input:{noteId:n,tag:t}}),h("Note tagged");}catch(e){f(e);}}),a.command("untag").description("Remove tag from note").argument("<noteId>","Note ID").argument("<tag>","Tag").action(async(n,t)=>{try{await b(qa,{input:{noteId:n,tag:t}}),h("Tag removed");}catch(e){f(e);}}),a.command("replace-tags").description("Replace all tags on a note").argument("<noteId>","Note ID").requiredOption("--tags <tags>","Tags (comma-separated)").action(async(n,t)=>{try{await b(ra,{input:{noteId:n,tags:t.tags.split(",").map(e=>e.trim())}}),h("Tags replaced");}catch(e){f(e);}}),a.command("create-tag").description("Create a note tag").argument("<name>","Tag name").action(async n=>{try{await b(sa,{input:{name:n}}),h("Tag created");}catch(t){f(t);}}),a.command("available-tags").description("List available note tags").option("--query <q>","Search query").option("--limit <n>","Max results",parseInt).option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(ta,{query:n.query,limit:n.limit});g(n,t.availableNoteTags);}catch(t){f(t);}}),a.command("get-tags").description("Get tags for a note").argument("<noteId>","Note ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(ua,{noteId:n});g(t,e.noteTags);}catch(e){f(e);}}),a.command("related-tags").description("Get related tags for a note").argument("<noteId>","Note ID").option("--limit <n>","Max results",parseInt).option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(va,{noteId:n,limit:t.limit});g(t,e.relatedNoteTags);}catch(e){f(e);}}),a.command("bulk-delete").description("Bulk delete notes").requiredOption("--ids <ids>","Note IDs (comma-separated)").option("--force","Skip confirmation").action(async n=>{try{if(!await p("Delete these notes?",n.force))return;await b(wa,{ids:n.ids.split(",").map(t=>t.trim())}),h("Notes deleted");}catch(t){f(t);}});}function Xo(m){let a={};return m.limit!==void 0&&(a.limit=Number(m.limit)),m.offset!==void 0&&(a.offset=Number(m.offset)),Object.keys(a).length>0?a:void 0}function zo(m){let a=m.command("security").description("Security scans, findings, providers, exceptions");a.command("providers").description("List configured security providers").option("-f, --format <format>","Output format").action(async s=>{try{let p=await b(ee);g(s,p.securityProviders);}catch(p){f(p);}}),a.command("set-provider").description("Configure a security provider for a vibe + stage").requiredOption("--vibe-id <id>").requiredOption("--stage <stage>").requiredOption("--provider-key <key>").option("--config <json>","Provider-specific config as JSON").option("-f, --format <format>","Output format").action(async s=>{try{let p={vibeId:s.vibeId,stage:s.stage.toUpperCase(),providerKey:s.providerKey};s.config&&(p.config=JSON.parse(s.config));let g$1=await b(qe,{input:p});h("Security provider set"),g(s,g$1.setSecurityProvider);}catch(p){f(p);}});let n=a.command("scans").description("Security scan runs");n.command("list").description("List my (default) or all scans").option("--scope <scope>","mine | all","mine").option("--vibe-id <id>").option("--status <status>").option("--stage <stage>").option("--conclusion <conclusion>").option("--limit <n>").option("--offset <n>").option("-f, --format <format>","Output format").action(async s=>{try{let p={};s.vibeId&&(p.vibeId=s.vibeId),s.status&&(p.status=s.status.toUpperCase()),s.stage&&(p.stage=s.stage.toUpperCase()),s.conclusion&&(p.conclusion=s.conclusion.toUpperCase());let g$1=s.scope==="all"?he:ge,T=await b(g$1,{filter:Object.keys(p).length>0?p:void 0,pagination:Xo(s)});g(s,s.scope==="all"?T.allSecurityScans:T.mySecurityScans);}catch(p){f(p);}}),n.command("get").description("Get a security scan run").argument("<id>").option("-f, --format <format>","Output format").action(async(s,p)=>{try{let g$1=await b(fe,{id:s});if(!g$1.securityScan)throw new o$1("Scan not found");g(p,g$1.securityScan);}catch(g){f(g);}}),n.command("run").description("Run a security scan for a vibe at a stage").requiredOption("--vibe-id <id>").requiredOption("--stage <stage>").option("-f, --format <format>","Output format").action(async s=>{try{let p=await b(me,{vibeId:s.vibeId,stage:s.stage.toUpperCase()});h("Scan triggered"),g(s,p.runSecurityScan);}catch(p){f(p);}}),n.command("cancel").description("Cancel an in-flight security scan").argument("<id>").option("-f, --format <format>","Output format").action(async(s,p)=>{try{let g$1=await b(ne,{id:s});h("Scan cancelled"),g(p,g$1.cancelSecurityScan);}catch(g){f(g);}});let t=a.command("findings").description("Security findings");t.command("list").description("List security findings").option("--vibe-id <id>").option("--status <status>").option("--severity <severity>").option("--category <category>").option("--search <text>").option("--limit <n>").option("--offset <n>").option("-f, --format <format>","Output format").action(async s=>{try{let p={};s.vibeId&&(p.vibeId=s.vibeId),s.status&&(p.status=s.status.toUpperCase()),s.severity&&(p.severity=s.severity.toUpperCase()),s.category&&(p.category=s.category.toUpperCase()),s.search&&(p.search=s.search);let g$1=await b(ie,{filter:Object.keys(p).length>0?p:void 0,pagination:Xo(s)});g(s,g$1.securityFindings);}catch(p){f(p);}}),t.command("update-status").description("Update finding workflow status").argument("<id>").requiredOption("--status <status>","OPEN | ACCEPTED | SUPPRESSED | FIXED | FALSE_POSITIVE").option("-f, --format <format>","Output format").action(async(s,p)=>{try{let g$1=await b(re,{id:s,status:p.status.toUpperCase()});h("Finding status updated"),g(p,g$1.updateSecurityFindingStatus);}catch(g){f(g);}}),a.command("policy-decision").description("Fetch OPA policy decision for a scan run").requiredOption("--scan-run-id <id>").option("-f, --format <format>","Output format").action(async s=>{try{let p=await b(je,{scanRunId:s.scanRunId});g(s,p.securityPolicyDecision);}catch(p){f(p);}}),a.command("status").description("Security posture for a vibe").argument("<vibeId>").option("-f, --format <format>","Output format").action(async(s,p)=>{try{let g$1=await b(ke,{vibeId:s});g(p,g$1.securityStatus);}catch(g){f(g);}});let e=a.command("repo-config").description("Repository security policy config");e.command("get").argument("<vibeId>").option("-f, --format <format>","Output format").action(async(s,p)=>{try{let g$1=await b(le,{vibeId:s});g(p,g$1.repositorySecurityConfig);}catch(g){f(g);}}),e.command("update").argument("<vibeId>").option("--policy-level <level>","ADVISORY | WARN | BLOCK").option("--enabled-stages <csv>","Comma-separated stages").option("--plugin-assignments <json>").option("--config-yaml-equivalent <json>").option("-f, --format <format>","Output format").action(async(s,p)=>{try{let g$1={};p.policyLevel&&(g$1.policyLevel=p.policyLevel.toUpperCase()),p.enabledStages&&(g$1.enabledStages=p.enabledStages.split(",").map(hr=>hr.trim().toUpperCase())),p.pluginAssignments&&(g$1.pluginAssignments=JSON.parse(p.pluginAssignments)),p.configYamlEquivalent&&(g$1.configYamlEquivalent=JSON.parse(p.configYamlEquivalent));let T=await b(se,{vibeId:s,input:g$1});h("Repository security config updated"),g(p,T.updateRepositorySecurityConfig);}catch(g){f(g);}});let i=a.command("exceptions").description("Security exception waivers");i.command("create").requiredOption("--vibe-id <id>").requiredOption("--finding-fingerprint <fp>").requiredOption("--reason <reason>").requiredOption("--expires-at <iso>").option("--compensating-controls <text>").option("-f, --format <format>","Output format").action(async s=>{try{let p={vibeId:s.vibeId,findingFingerprint:s.findingFingerprint,reason:s.reason,expiresAt:s.expiresAt};s.compensatingControls&&(p.compensatingControls=s.compensatingControls);let g$1=await b(oe,{input:p});h("Exception created"),g(s,g$1.createSecurityException);}catch(p){f(p);}}),i.command("revoke").argument("<id>").option("--force").action(async(s,p$1)=>{try{if(!await p(`Revoke exception ${s}?`,p$1.force))return;await b(pe,{id:s}),h("Exception revoked");}catch(g){f(g);}}),a.command("evidence-presign").description("Get a presigned URL for evidence upload").requiredOption("--scan-run-id <id>").requiredOption("--sha256 <hex>").requiredOption("--size-bytes <n>").requiredOption("--type <type>","SBOM_CYCLONEDX | SBOM_SPDX | SARIF | GRYPE_JSON | COSIGN_BUNDLE | OPA_DECISION | PROVENANCE").option("-f, --format <format>","Output format").action(async s=>{try{let p=await b(te,{scanRunId:s.scanRunId,sha256:s.sha256,sizeBytes:Number(s.sizeBytes),type:s.type.toUpperCase()});g(s,p.presignSecurityEvidence);}catch(p){f(p);}});}function Zo(m){let a=m.command("ci").description("CI/CD pipeline status (via GitOps providers)");a.command("status").description("Get CI status for a provider on an agent").requiredOption("--provider-id <id>").requiredOption("--agent-id <id>").option("--limit <n>").option("-f, --format <format>","Output format").action(async e=>{try{let i=await b(ue,{providerId:e.providerId,agentId:e.agentId,limit:e.limit!==void 0?Number(e.limit):void 0});g(e,i.getCIStatus);}catch(i){f(i);}}),a.command("refresh-status").description("Force refresh CI status snapshot").requiredOption("--provider-id <id>").requiredOption("--agent-id <id>").option("-f, --format <format>","Output format").action(async e=>{try{let i=await b(ye,{providerId:e.providerId,agentId:e.agentId});h("CI status refreshed"),g(e,i.refreshCIStatus);}catch(i){f(i);}});let n=a.command("pipelines").description("CI pipeline runs");n.command("list").requiredOption("--provider-id <id>").requiredOption("--agent-id <id>").option("--branch <branch>").option("--limit <n>").option("-f, --format <format>","Output format").action(async e=>{try{let i=await b(ve,{providerId:e.providerId,agentId:e.agentId,branch:e.branch,limit:e.limit!==void 0?Number(e.limit):void 0});g(e,i.getCIPipelineRuns);}catch(i){f(i);}}),n.command("details").argument("<runId>").requiredOption("--provider-id <id>").requiredOption("--agent-id <id>").option("-f, --format <format>","Output format").action(async(e,i)=>{try{let s=await b(we,{providerId:i.providerId,agentId:i.agentId,runId:e});g(i,s.getCIPipelineDetails);}catch(s){f(s);}});let t=a.command("repo-stats").description("Repository statistics");t.command("get").requiredOption("--provider-id <id>").requiredOption("--agent-id <id>").option("-f, --format <format>","Output format").action(async e=>{try{let i=await b(xe,{providerId:e.providerId,agentId:e.agentId});g(e,i.getRepoStats);}catch(i){f(i);}}),t.command("refresh").requiredOption("--provider-id <id>").requiredOption("--agent-id <id>").option("-f, --format <format>","Output format").action(async e=>{try{let i=await b(ze,{providerId:e.providerId,agentId:e.agentId});h("Repo stats refreshed"),g(e,i.refreshRepoStats);}catch(i){f(i);}});}function Qo(m){let a=m.command("gitops").description("GitOps provider connections");a.command("list").description("List GitOps providers").option("--provider-type <t>","GITHUB | GITLAB | BITBUCKET | AZURE_DEVOPS").option("--is-active <bool>").option("--vibe-id <id>").option("--limit <n>").option("--offset <n>").option("-f, --format <format>","Output format").action(async n=>{try{let t={};n.providerType&&(t.providerType=n.providerType.toUpperCase()),n.isActive!==void 0&&(t.isActive=n.isActive==="true"),n.vibeId&&(t.vibeId=n.vibeId);let e={};n.limit!==void 0&&(e.limit=Number(n.limit)),n.offset!==void 0&&(e.offset=Number(n.offset));let i=await b(Ae,{filter:Object.keys(t).length>0?t:void 0,pagination:Object.keys(e).length>0?e:void 0});g(n,i.listGitopsProviders);}catch(t){f(t);}}),a.command("get").argument("<id>").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(Be,{id:n});if(!e.getGitopsProvider)throw new o$1("Provider not found");g(t,e.getGitopsProvider);}catch(e){f(e);}}),a.command("create").requiredOption("--name <name>").requiredOption("--provider-type <t>","GITHUB | GITLAB | BITBUCKET | AZURE_DEVOPS").requiredOption("--repo-url <url>").option("--vibe-id <id>").option("--is-active <bool>").option("--metadata <json>").option("-f, --format <format>","Output format").action(async n=>{try{let t={name:n.name,providerType:n.providerType.toUpperCase(),repoUrl:n.repoUrl};n.vibeId&&(t.vibeId=n.vibeId),n.isActive!==void 0&&(t.isActive=n.isActive==="true"),n.metadata&&(t.metadata=JSON.parse(n.metadata));let e=await b(Ce,{input:t});h("GitOps provider created"),g(n,e.createGitopsProvider);}catch(t){f(t);}}),a.command("update").argument("<id>").option("--name <name>").option("--repo-url <url>").option("--vibe-id <id>").option("--is-active <bool>").option("--metadata <json>").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e={};t.name&&(e.name=t.name),t.repoUrl&&(e.repoUrl=t.repoUrl),t.vibeId&&(e.vibeId=t.vibeId),t.isActive!==void 0&&(e.isActive=t.isActive==="true"),t.metadata&&(e.metadata=JSON.parse(t.metadata));let i=await b(De,{id:n,input:e});h("GitOps provider updated"),g(t,i.updateGitopsProvider);}catch(e){f(e);}}),a.command("delete").argument("<id>").option("--force").action(async(n,t)=>{try{if(!await p(`Delete GitOps provider ${n}?`,t.force))return;await b(Ee,{id:n}),h("GitOps provider deleted");}catch(e){f(e);}});}function tr(m){let a=m.command("settings").description("User settings and preferences");a.command("mine").description("Get full settings bundle for the current user").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b(Fe);g(t,e.mySettings);}catch(e){f(e);}}),a.command("category").description("Get a single settings category").argument("<category>","PREFERENCES | NOTIFICATIONS | WORKSPACE_DEFAULTS | PROFILE | SECURITY | ADVANCED").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await b(Ge,{category:t.toUpperCase()});g(e,i.mySettingsByCategory);}catch(i){f(i);}}),a.command("reset").description("Reset a settings category to workspace defaults").argument("<category>").option("--force").action(async(t,e)=>{try{if(!await p(`Reset ${t}?`,e.force))return;await b(Ke,{category:t.toUpperCase()}),h("Settings reset");}catch(i){f(i);}}),a.command("update-preferences").description("Update UI preferences").option("--theme <theme>").option("--ui-density <density>").option("--sidebar-collapsed <bool>").option("--code-font <font>").option("--code-font-size <n>").option("--preferred-ide-command <cmd>").option("--default-agent-for-vibe <json>").option("--vibe-ide-overrides <json>").option("--vibe-detail-tab-order <json>").option("-f, --format <format>","Output format").action(async t=>{try{let e={};t.theme&&(e.theme=t.theme),t.uiDensity&&(e.uiDensity=t.uiDensity),t.sidebarCollapsed!==void 0&&(e.sidebarCollapsed=t.sidebarCollapsed==="true"),t.codeFont&&(e.codeFont=t.codeFont),t.codeFontSize!==void 0&&(e.codeFontSize=Number(t.codeFontSize)),t.preferredIdeCommand&&(e.preferredIdeCommand=t.preferredIdeCommand),t.defaultAgentForVibe&&(e.defaultAgentForVibe=JSON.parse(t.defaultAgentForVibe)),t.vibeIdeOverrides&&(e.vibeIdeOverrides=JSON.parse(t.vibeIdeOverrides)),t.vibeDetailTabOrder&&(e.vibeDetailTabOrder=JSON.parse(t.vibeDetailTabOrder));let i=await b(Le,{input:e});h("Preferences updated"),g(t,i.updatePreferences);}catch(e){f(e);}}),a.command("update-notifications").description("Update notification preferences").option("--email-digest <bool>").option("--digest-frequency <freq>","daily | weekly | none").option("--agent-offline <bool>").option("--session-error <bool>").option("--vibe-status-change <bool>").option("-f, --format <format>","Output format").action(async t=>{try{let e={};t.emailDigest!==void 0&&(e.emailDigest=t.emailDigest==="true"),t.digestFrequency&&(e.digestFrequency=t.digestFrequency),t.agentOffline!==void 0&&(e.agentOffline=t.agentOffline==="true"),t.sessionError!==void 0&&(e.sessionError=t.sessionError==="true"),t.vibeStatusChange!==void 0&&(e.vibeStatusChange=t.vibeStatusChange==="true");let i=await b(Me,{input:e});h("Notification preferences updated"),g(t,i.updateNotificationPreferences);}catch(e){f(e);}}),a.command("update-workspace-defaults").description("Update workspace defaults (admin)").option("--default-agent <id>").option("--default-session-type <t>").option("--default-vibe-type <t>").option("--default-env-vars <text>").option("--auto-start-sessions <bool>").option("--auto-git-sync <bool>").option("--agent-heartbeat-interval <n>").option("--agent-max-sessions <n>").option("--agent-auto-reconnect <bool>").option("--auto-update <bool>").option("--telemetry-enabled <bool>").option("--log-level <level>").option("-f, --format <format>","Output format").action(async t=>{try{let e={};t.defaultAgent&&(e.defaultAgent=t.defaultAgent),t.defaultSessionType&&(e.defaultSessionType=t.defaultSessionType),t.defaultVibeType&&(e.defaultVibeType=t.defaultVibeType),t.defaultEnvVars&&(e.defaultEnvironmentVariables=t.defaultEnvVars),t.autoStartSessions!==void 0&&(e.autoStartSessions=t.autoStartSessions==="true"),t.autoGitSync!==void 0&&(e.autoGitSync=t.autoGitSync==="true"),t.agentHeartbeatInterval!==void 0&&(e.agentHeartbeatInterval=Number(t.agentHeartbeatInterval)),t.agentMaxSessions!==void 0&&(e.agentMaxSessions=Number(t.agentMaxSessions)),t.agentAutoReconnect!==void 0&&(e.agentAutoReconnect=t.agentAutoReconnect==="true"),t.autoUpdate!==void 0&&(e.autoUpdate=t.autoUpdate==="true"),t.telemetryEnabled!==void 0&&(e.telemetryEnabled=t.telemetryEnabled==="true"),t.logLevel&&(e.logLevel=t.logLevel);let i=await b(Ne,{input:e});h("Workspace defaults updated"),g(t,i.updateWorkspaceDefaults);}catch(e){f(e);}});let n=a.command("secrets").description("Settings secrets (encrypted KV)");n.command("list").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b(He);g(t,e.listSettingsSecrets);}catch(e){f(e);}}),n.command("set").argument("<key>").argument("<value>").option("-f, --format <format>","Output format").action(async(t,e,i)=>{try{let s=await b(Ie,{input:{key:t,value:e}});h("Secret set"),g(i,s.setSettingsSecret);}catch(s){f(s);}}),n.command("delete").argument("<key>").option("--force").action(async(t,e)=>{try{if(!await p(`Delete secret ${t}?`,e.force))return;await b(Je,{key:t}),h("Secret deleted");}catch(i){f(i);}}),a.command("resolve-integration-token").description("Resolve a decrypted integration token for an agent").argument("<connectionId>").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await b(Oe,{connectionId:t});g(e,i.vibecontrolsResolveIntegrationToken);}catch(i){f(i);}});}function er(m){let a=m.command("config").description("Backend configuration management");zo(a),Zo(a),Qo(a),tr(a),a.command("list").description("List configs").requiredOption("--scope <s>","Scope (WORKSPACE, VIBE, SESSION, AGENT, USER, GLOBAL)").option("--scope-id <id>","Scope entity ID").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(xa,{scope:n.scope.toUpperCase(),scopeId:n.scopeId});g(n,t.configurationsByScope);}catch(t){f(t);}}),a.command("get").description("Get config value").argument("<key>").requiredOption("--scope <s>","Scope").option("--scope-id <id>","Scope ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(ya,{key:n,scope:t.scope.toUpperCase(),scopeId:t.scopeId});if(!e.configuration)throw new o$1("Config not found");g(t,e.configuration);}catch(e){f(e);}}),a.command("set").description("Set config value").argument("<key>").argument("<value>").requiredOption("--scope <s>","Scope").option("--scope-id <id>","Scope ID").option("--secret","Mark as secret").option("-f, --format <format>","Output format").action(async(n,t,e)=>{try{let i;try{i=JSON.parse(t);}catch{i=t;}let s=await b(Aa,{key:n,scope:e.scope.toUpperCase(),scopeId:e.scopeId,value:i,isSecret:e.secret});h("Config set"),g(e,s.setConfiguration);}catch(i){f(i);}}),a.command("delete").description("Delete config").argument("<key>").requiredOption("--scope <s>","Scope").option("--scope-id <id>","Scope ID").action(async(n,t)=>{try{await b(Ba,{key:n,scope:t.scope.toUpperCase(),scopeId:t.scopeId}),h("Config deleted");}catch(e){f(e);}}),a.command("value").description("Get raw config value").argument("<key>").requiredOption("--scope <s>","Scope").option("--scope-id <id>","Scope ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(za,{key:n,scope:t.scope.toUpperCase(),scopeId:t.scopeId});console.log(e.configurationValue);}catch(e){f(e);}}),a.command("bulk-set").description("Bulk set configs").requiredOption("--scope <s>","Scope").option("--scope-id <id>","Scope ID").requiredOption("--input <json>","JSON array of [{key,value,isSecret?}]").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(Ca,{configurations:JSON.parse(n.input),scope:n.scope.toUpperCase(),scopeId:n.scopeId});h("Configs set"),g(n,t.bulkSetConfigurations);}catch(t){f(t);}}),a.command("bulk-delete").description("Bulk delete configs").requiredOption("--scope <s>","Scope").option("--scope-id <id>","Scope ID").requiredOption("--keys <keys>","Comma-separated keys").option("--force","Skip confirmation").action(async n=>{try{if(!await p("Delete these configs?",n.force))return;await b(Da,{keys:n.keys.split(",").map(t=>t.trim()),scope:n.scope.toUpperCase(),scopeId:n.scopeId}),h("Configs deleted");}catch(t){f(t);}});}function nr(m){let a=m.command("webhooks").description("Webhook management");a.command("list").description("List webhooks").option("--active","Only active").option("-f, --format <format>","Output format").action(async n=>{try{let t=n.active?{isActive:!0}:void 0,e=await b(Ea,{filter:t});g(n,e.webhooks.items,{headers:["ID","Name","URL","Active","Events","Deliveries"],rows:e.webhooks.items.map(i=>[o(i.id,12),i.name,o(i.url,30),i.isActive?"Yes":"No",(i.events??[]).join(", "),String(i.deliveryCount??0)])});}catch(t){f(t);}}),a.command("get").description("Get webhook").argument("<id>").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(Fa,{id:n});if(!e.webhook)throw new o$1("Webhook not found");g(t,e.webhook);}catch(e){f(e);}}),a.command("create").description("Create webhook").requiredOption("--name <n>","Name").requiredOption("--url <u>","URL").requiredOption("--events <events>","Events (comma-separated)").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(Ga,{input:{name:n.name,url:n.url,events:n.events.split(",").map(e=>e.trim())}});h("Webhook created"),g(n,t.createWebhook);}catch(t){f(t);}}),a.command("update").description("Update webhook").argument("<id>").option("--name <n>","Name").option("--url <u>","URL").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e={};if(t.name&&(e.name=t.name),t.url&&(e.url=t.url),!Object.keys(e).length)throw new o$1("No updates specified");let i=await b(Ha,{id:n,input:e});h("Webhook updated"),g(t,i.updateWebhook);}catch(e){f(e);}}),a.command("delete").description("Delete webhook").argument("<id>").option("--force","Skip confirmation").action(async(n,t)=>{try{if(!await p("Delete this webhook?",t.force))return;await b(Ia,{id:n}),h("Webhook deleted");}catch(e){f(e);}}),a.command("test").description("Test webhook").argument("<id>").action(async n=>{try{await b(Ja,{id:n}),h("Webhook test sent");}catch(t){f(t);}}),a.command("active").description("List active webhooks").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(Ka);g(n,t.activeWebhooks);}catch(t){f(t);}}),a.command("by-event").description("List webhooks by event").argument("<event>").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(La,{event:n});g(t,e.webhooksByEvent);}catch(e){f(e);}}),a.command("trigger").description("Trigger webhook").argument("<id>").option("--payload <json>","JSON payload").action(async(n,t)=>{try{await b(Ma,{id:n,payload:t.payload?JSON.parse(t.payload):void 0}),h("Webhook triggered");}catch(e){f(e);}}),a.command("reset-failures").description("Reset webhook failures").argument("<id>").action(async n=>{try{await b(Na,{id:n}),h("Webhook failures reset");}catch(t){f(t);}});}function Sr(m,a="HTTPS"){if(!m)return a;let n=m.toUpperCase();if(n==="HTTP"||n==="HTTPS"||n==="TCP"||n==="UDP")return n;throw new Error(`Invalid protocol: ${m} (expected http|https|tcp|udp)`)}function k(m){return (m??"PROD").toUpperCase()==="ALPHA"?"ALPHA":"PROD"}function ir(m){let a=m.command("tunnels").description("Tunnel management (VibeTunnels)");a.command("providers").description("List tunnel providers with capabilities").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b(Qa);g(t,e.tunnelProviders);}catch(e){f(e);}}),a.command("list").description("List tunnels in the workspace").option("--provider <key>","Filter by provider (vibetunnels|cloudflare)").option("--status <status>","Filter by status").option("--search <query>","Search by name/slug").option("-f, --format <format>","Output format").action(async t=>{try{let e={};t.provider&&(e.providerKey=t.provider.toUpperCase()),t.status&&(e.status=[t.status.toUpperCase()]),t.search&&(e.search=t.search);let i=await b(Oa,{filter:e});if(t.format){g(t,i.tunnels);return}for(let s of i.tunnels.items){let p=s.primaryDomain?.hostname??"(no domain)";console.log(`${s.id} ${s.slug} ${s.providerKey} ${s.status} ${p} ${s.protocol}:${s.localPort}`);}console.log(`
|
|
4
|
+
${i.tunnels.total} total`);}catch(e){f(e);}}),a.command("get").description("Get a tunnel by ID").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let i=await b(Pa,{id:t});if(!i.tunnel)throw new o$1(`Tunnel ${t} not found`);g(e,i.tunnel);}catch(i){f(i);}}),a.command("create").description("Create a tunnel (DRAFT \u2014 start with `vibe tunnels start`)").requiredOption("--agent <id>","Agent ID").requiredOption("--name <name>","Tunnel name").requiredOption("--port <p>","Local port",parseInt).option("--provider <key>","Provider key (vibetunnels|cloudflare)","VIBETUNNELS").option("--protocol <p>","http|https|tcp|udp","https").option("--host <host>","Local host","127.0.0.1").option("--subdomain <label>","Reserve a *.vibetunnels.com subdomain").option("--env <env>","alpha|prod for managed subdomain","prod").option("--description <text>").option("-f, --format <format>").action(async t=>{try{let e={agentId:t.agent,name:t.name,description:t.description,providerKey:t.provider.toUpperCase(),protocol:Sr(t.protocol),localPort:t.port,localHost:t.host,managedSubdomain:t.subdomain,environment:k(t.env)},i=await b(Ra,{input:e});h(`Tunnel created: ${i.createTunnel.slug}`),g(t,i.createTunnel);}catch(e){f(e);}}),a.command("start").description("Start a tunnel").argument("<id>").action(async t=>{try{await b(Ua,{id:t}),h("Tunnel started");}catch(e){f(e);}}),a.command("stop").description("Stop a tunnel").argument("<id>").action(async t=>{try{await b(Va,{id:t}),h("Tunnel stopped");}catch(e){f(e);}}),a.command("rotate").description("Rotate tunnel credentials").argument("<id>").action(async t=>{try{await b(Wa,{id:t}),h("Tunnel credentials rotated");}catch(e){f(e);}}),a.command("delete").description("Delete a tunnel").argument("<id>").option("--force","Skip confirmation").action(async(t,e)=>{try{if(!await p("Delete this tunnel?",e.force))return;await b(Ta,{id:t}),h("Tunnel deleted");}catch(i){f(i);}}),a.command("sessions").description("List sessions for a tunnel").argument("<tunnelId>").option("-f, --format <format>").action(async(t,e)=>{try{let i=await b(Ya,{tunnelId:t});g(e,i);}catch(i){f(i);}}),a.command("issue-session").description("Issue a short-lived token for a tunnel (printed once)").argument("<tunnelId>").option("--ttl <seconds>","TTL in seconds",t=>parseInt(t,10)).action(async(t,e)=>{try{let i=await b(Xa,{tunnelId:t,ttlSeconds:e.ttl});console.log("Session issued. The token below is shown exactly once."),console.log(`Session ID: ${i.issueTunnelSession.session.id}`),console.log(`Token: ${i.issueTunnelSession.token}`),console.log(`Expires: ${i.issueTunnelSession.session.expiresAt}`),console.log(`Agent hint: ${JSON.stringify(i.issueTunnelSession.agentConfigHint,null,2)}`);}catch(i){f(i);}}),a.command("revoke-session").description("Revoke an active tunnel session").argument("<sessionId>").option("--reason <text>").action(async(t,e)=>{try{await b(Za,{sessionId:t,reason:e.reason??"revoked via CLI"}),h("Session revoked");}catch(i){f(i);}});let n=a.command("domains").description("Manage tunnel domains");n.command("list").description("List domains (optionally scoped to a tunnel)").option("--tunnel <id>","Tunnel ID").option("-f, --format <format>").action(async t=>{try{let e=await b(db,{tunnelId:t.tunnel??null});g(t,e);}catch(e){f(e);}}),n.command("reserve").description("Reserve a managed *.vibetunnels.com subdomain").requiredOption("--label <label>","Subdomain label").option("--env <env>","alpha|prod","prod").action(async t=>{try{let e=await b(_a,{input:{label:t.label,environment:k(t.env)}});h(`Reserved ${e.reserveTunnelSubdomain.hostname}`);}catch(e){f(e);}}),n.command("add-custom").description("Register a user-owned custom domain (TXT verification required)").argument("<hostname>").action(async t=>{try{let e=await b($a,{input:{hostname:t}});console.log(`Registered ${e.registerCustomTunnelDomain.hostname}.`),console.log(`Create a TXT record at ${e.registerCustomTunnelDomain.challengeRecordName} containing:`),console.log(` ${e.registerCustomTunnelDomain.challengeToken}`);}catch(e){f(e);}}),n.command("attach").description("Attach a (verified) domain to a tunnel").argument("<tunnelId>").argument("<domainId>").option("--primary","Mark as primary domain").action(async(t,e,i)=>{try{await b(ab,{tunnelId:t,domainId:e,makePrimary:!!i.primary}),h("Domain attached");}catch(s){f(s);}}),n.command("detach").description("Detach a domain from a tunnel").argument("<tunnelId>").argument("<domainId>").action(async(t,e)=>{try{await b(bb,{tunnelId:t,domainId:e}),h("Domain detached");}catch(i){f(i);}}),n.command("verify").description("Force verification check for a custom domain").argument("<domainId>").action(async t=>{try{let e=await b(cb,{domainId:t});console.log(`Status: ${e.verifyTunnelDomain.verificationStatus}`),e.verifyTunnelDomain.lastCheckError&&console.log(`Error: ${e.verifyTunnelDomain.lastCheckError}`);}catch(e){f(e);}}),n.command("get").description("Get a tunnel domain by ID").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let i=await b(fb,{id:t});g(e,i);}catch(i){f(i);}}),n.command("delete").description("Delete a tunnel domain (detach + drop record)").argument("<domainId>").option("--force","Skip confirmation").action(async(t,e)=>{try{if(!await p("Delete this tunnel domain?",e.force))return;await b(kb,{domainId:t}),h("Tunnel domain deleted");}catch(i){f(i);}}),a.command("by-slug").description("Get a tunnel by its workspace-unique slug").argument("<slug>").option("-f, --format <format>").action(async(t,e)=>{try{let i=await b(eb,{slug:t});if(!i.tunnelBySlug)throw new o$1(`Tunnel with slug ${t} not found`);g(e,i.tunnelBySlug);}catch(i){f(i);}}),a.command("update").description("Update a tunnel (name, host, port, basic auth, metadata)").argument("<id>").option("--name <name>").option("--description <text>").option("--host <host>").option("--port <port>","Local port",t=>parseInt(t,10)).option("--tls-mode <mode>","FULL|STRICT|NONE").option("--basic-auth-user <user>").option("--basic-auth-password <pw>").action(async(t,e)=>{try{let i={};if(e.name!==void 0&&(i.name=e.name),e.description!==void 0&&(i.description=e.description),e.host!==void 0&&(i.localHost=e.host),e.port!==void 0&&(i.localPort=e.port),e.tlsMode!==void 0&&(i.tlsMode=e.tlsMode.toUpperCase()),e.basicAuthUser!==void 0&&(i.basicAuthUser=e.basicAuthUser),e.basicAuthPassword!==void 0&&(i.basicAuthPassword=e.basicAuthPassword),Object.keys(i).length===0)throw new o$1("Pass at least one field to update");await b(Sa,{id:t,input:i}),h("Tunnel updated");}catch(i){f(i);}}),a.command("provider").description("Get a single tunnel provider by key").argument("<key>","vibetunnels|cloudflare").option("-f, --format <format>").action(async(t,e)=>{try{let i=await b(gb,{key:t.toUpperCase()});g(e,i);}catch(i){f(i);}}),a.command("shards").description("List tunnel server shards (frps instances)").option("--env <env>","alpha|prod").option("-f, --format <format>").action(async t=>{try{let e=await b(hb,{environment:t.env?k(t.env):null});g(t,e);}catch(e){f(e);}}),a.command("usage").description("Hourly usage buckets for a tunnel in a time range").argument("<tunnelId>").requiredOption("--from <iso>","ISO8601 start").requiredOption("--to <iso>","ISO8601 end").option("-f, --format <format>").action(async(t,e)=>{try{let i=await b(ib,{tunnelId:t,from:e.from,to:e.to});g(e,i);}catch(i){f(i);}}),a.command("audit").description("Audit log entries scoped to a tunnel").argument("<tunnelId>").option("--limit <n>","Pagination limit",t=>parseInt(t,10)).option("--offset <n>","Pagination offset",t=>parseInt(t,10)).option("-f, --format <format>").action(async(t,e)=>{try{let i={};e.limit!==void 0&&(i.limit=e.limit),e.offset!==void 0&&(i.offset=e.offset);let s=await b(jb,{tunnelId:t,pagination:Object.keys(i).length>0?i:null});g(e,s);}catch(i){f(i);}}),a.command("probe-agent").description("Probe an agent tunnel URL for health + identity").requiredOption("--url <url>","Agent tunnel URL (https://...)").option("--api-key <key>","Agent API key").option("-f, --format <format>").action(async t=>{try{let e=await b(lb,{url:t.url,agentApiKey:t.apiKey??null});g(t,e);}catch(e){f(e);}}),a.command("add-agent-from-tunnel").description("Zero-config: probe a tunnel URL + register an agent in one shot").requiredOption("--url <url>","Public HTTPS tunnel URL").requiredOption("--api-key <key>","Agent inbound API key (x-agent-api-key)").option("--name <name>","Override display name").option("--scopes <list>","Comma-separated OAuth scopes").option("--target <id>","Optional target to attach the agent to").option("--skip-devportal-app","Skip creating DevPortal application").option("-f, --format <format>").action(async t=>{try{let e={tunnelUrl:t.url,apiKey:t.apiKey};t.name!==void 0&&(e.name=t.name),t.scopes!==void 0&&(e.scopes=t.scopes.split(",").map(s=>s.trim()).filter(Boolean)),t.target!==void 0&&(e.targetId=t.target),t.skipDevportalApp&&(e.skipDevportalApp=!0);let i=await b(mb,{input:e});g(t,i);}catch(e){f(e);}});}function or(m){let a=m.command("ui-session").description("UI session state");a.command("get").description("Get current UI session").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(nb);g(n,t.uiSession);}catch(t){f(t);}}),a.command("clear").description("Clear UI session").action(async()=>{try{await b(pb),h("UI session cleared");}catch(n){f(n);}}),a.command("get-by-id").description("Get UI session by ID").argument("<id>").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(ob,{id:n});g(t,e.uiSessionById);}catch(e){f(e);}}),a.command("set-active-vibe").description("Set active vibe").argument("<vibeId>").action(async n=>{try{await b(qb,{vibeId:n}),h("Active vibe updated");}catch(t){f(t);}}),a.command("set-active-session").description("Set active session").argument("<sessionId>").action(async n=>{try{await b(rb,{sessionId:n}),h("Active session updated");}catch(t){f(t);}}),a.command("add-recent-vibe").description("Add recent vibe").argument("<vibeId>").action(async n=>{try{await b(sb,{vibeId:n}),h("Recent vibe added");}catch(t){f(t);}}),a.command("add-recent-session").description("Add recent session").argument("<sessionId>").action(async n=>{try{await b(tb,{sessionId:n}),h("Recent session added");}catch(t){f(t);}});}function rr(m){let a=m.command("cli-config").description("CLI configuration");a.command("set").description("Set CLI config value").argument("<key>").argument("<value>").action((n,t)=>{if(!z$1.includes(n))throw new o$1(`Unknown key: ${n}. Valid keys: ${z$1.join(", ")}`);x$1(n,t),h(`${n} = ${t}`);}),a.command("get").description("Get CLI config value").argument("<key>").action(n=>{let t=w$1(n);if(t===void 0)throw new o$1(`Key not set: ${n}`);console.log(t);}),a.command("list").description("Show all CLI config").option("-f, --format <format>","Output format").action(n=>{let t=v$1();if(n.format==="json"){l$1(t);return}let e=Object.entries(t).filter(([,i])=>i!==void 0);q$1(["Key","Value"],e.map(([i,s])=>[i,String(s)]));}),a.command("path").description("Show config file path").action(()=>{console.log(y$1());});}function ar(){let m=s()?.workspaceId;if(!m)throw new o$1("No workspace set. Run: vibecontrols workspace set <id>");return m}function sr(m$1){let a=m$1.command("targets").description("Target management (SSH/RDP/VNC)");a.command("list").description("List targets").option("--type <type>","Filter by type (DIRECT,SSH,RDP,VNC)").option("--limit <n>","Limit results",parseInt).option("--offset <n>","Offset results",parseInt).option("-f, --format <format>","Output format").action(async n=>{try{let t=ar(),e={};n.type&&(e.type=n.type.toUpperCase());let s=(await b(ub,{workspaceId:t,filter:Object.keys(e).length?e:void 0,limit:n.limit,offset:n.offset})).targets.items;g(n,s,{headers:["ID","Name","Type","Host","Port","Status"],rows:s.map(p=>[o(p.id,12),p.name,p.type,p.host,String(p.port??"-"),m(p.status)])});}catch(t){f(t);}}),a.command("get").description("Get target by ID").argument("<id>","Target ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(vb,{id:n});if(!e.target)throw new o$1("Target not found");g(t,e.target);}catch(e){f(e);}}),a.command("create").description("Create target").requiredOption("--name <n>","Name").requiredOption("--type <t>","Type (DIRECT,SSH,RDP,VNC)").requiredOption("--host <h>","Host address").requiredOption("--port <p>","Port",parseInt).option("--username <u>","Username").option("--protocol <p>","Protocol").option("--agent-id <id>","Agent ID").option("-f, --format <format>","Output format").action(async n=>{try{let t=ar(),e={name:n.name,type:n.type.toUpperCase(),host:n.host,port:n.port};n.username&&(e.username=n.username),n.protocol&&(e.protocol=n.protocol),n.agentId&&(e.agentId=n.agentId);let i=await b(wb,{workspaceId:t,input:e});h("Target created"),g(n,i.createTarget);}catch(t){f(t);}}),a.command("update").description("Update target").argument("<id>","Target ID").option("--name <n>","Name").option("--host <h>","Host address").option("--port <p>","Port",parseInt).option("--username <u>","Username").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e={};if(t.name&&(e.name=t.name),t.host&&(e.host=t.host),t.port&&(e.port=t.port),t.username&&(e.username=t.username),!Object.keys(e).length)throw new o$1("No updates specified");let i=await b(xb,{id:n,input:e});h("Target updated"),g(t,i.updateTarget);}catch(e){f(e);}}),a.command("delete").description("Delete target").argument("<id>","Target ID").option("--force","Skip confirmation").action(async(n,t)=>{try{if(!await p("Delete this target?",t.force))return;await b(yb,{id:n}),h("Target deleted");}catch(e){f(e);}}),a.command("test").description("Test target connectivity").argument("<id>","Target ID").action(async n=>{try{let t=await b(zb,{id:n});t.testTarget.success?h(`Connection successful (${t.testTarget.latencyMs??"-"}ms)`):i$1(t.testTarget.error??"Connection failed");}catch(t){f(t);}}),a.command("scan-ssh").description("Scan SSH config for targets").requiredOption("--agent-id <id>","Agent ID").option("--config-path <path>","SSH config file path").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(Ab,{agentId:n.agentId,configPath:n.configPath});h(`Found ${t.scanSSHConfig.length} target(s)`),g(n,t.scanSSHConfig);}catch(t){f(t);}}),a.command("install-agent").description("Install agent on target").requiredOption("--source-agent-id <id>","Source agent ID").requiredOption("--target-id <id>","Target ID").option("--agent-port <port>","Agent port",parseInt).action(async n=>{try{let t=await b(Bb,{sourceAgentId:n.sourceAgentId,targetId:n.targetId,agentPort:n.agentPort});t.installAgentOnTarget.success?h("Agent installed on target"):i$1(t.installAgentOnTarget.error??"Installation failed");}catch(t){f(t);}}),a.command("uninstall-agent").description("Uninstall agent from target").argument("<targetId>","Target ID").action(async n=>{try{let t=await b(Cb,{targetId:n});t.uninstallAgentFromTarget.success?h("Agent uninstalled from target"):i$1(t.uninstallAgentFromTarget.error??"Uninstall failed");}catch(t){f(t);}}),a.command("start-terminal").description("Start terminal on target").argument("<targetId>","Target ID").option("--shell <shell>","Shell to use").action(async(n,t)=>{try{let e=await b(Db,{targetId:n,shell:t.shell});h("Terminal started"),console.log(`Session ID: ${e.startTerminal.sessionId}`),console.log(`ttyd URL: ${e.startTerminal.ttydUrl}`);}catch(e){f(e);}}),a.command("stop-terminal").description("Stop terminal session").argument("<sessionId>","Session ID").action(async n=>{try{await b(Eb,{sessionId:n}),h("Terminal stopped");}catch(t){f(t);}});}function cr(m){let a=m.command("vibedeck").description("VibeDeck management");a.command("list").description("List vibedecks").option("-f, --format <format>","Output format").action(async t=>{try{let i=(await b(Fb)).vibeDecks.items;g(t,i,{headers:["ID","Name","Default","Created"],rows:i.map(s=>[o(s.id,12),s.name,s.isDefault?"Yes":"No",n(s.createdAt)])});}catch(e){f(e);}}),a.command("get").description("Get vibedeck").argument("<id>").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await b(Gb,{id:t});if(!i.vibeDeck)throw new o$1("VibeDeck not found");g(e,i.vibeDeck);}catch(i){f(i);}}),a.command("default").description("Get default vibedeck").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b(Hb);if(!e.defaultVibeDeck)throw new o$1("No default VibeDeck found");g(t,e.defaultVibeDeck);}catch(e){f(e);}}),a.command("create").description("Create vibedeck").requiredOption("--name <n>","Name").option("--description <d>","Description").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b(Ib,{input:{name:t.name,description:t.description}});h("VibeDeck created"),g(t,e.createVibeDeck);}catch(e){f(e);}}),a.command("update").description("Update vibedeck").argument("<id>").option("--name <n>","Name").option("--description <d>","Description").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i={};if(e.name&&(i.name=e.name),e.description&&(i.description=e.description),!Object.keys(i).length)throw new o$1("No updates specified");let s=await b(Jb,{id:t,input:i});h("VibeDeck updated"),g(e,s.updateVibeDeck);}catch(i){f(i);}}),a.command("duplicate").description("Duplicate vibedeck").argument("<id>").option("--name <n>","New name").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await b(Kb,{id:t,name:e.name});h("VibeDeck duplicated"),g(e,i.duplicateVibeDeck);}catch(i){f(i);}}),a.command("delete").description("Delete vibedeck").argument("<id>").option("--force","Skip confirmation").action(async(t,e)=>{try{if(!await p("Delete this VibeDeck?",e.force))return;await b(Lb,{id:t}),h("VibeDeck deleted");}catch(i){f(i);}}),a.command("set-default").description("Set default vibedeck").argument("<id>").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await b(Mb,{id:t});h("Default VibeDeck updated"),g(e,i.setDefaultVibeDeck);}catch(i){f(i);}}),a.command("buttons").description("List vibedeck buttons").requiredOption("--deck-id <id>","VibeDeck ID").option("-f, --format <format>","Output format").action(async t=>{try{let i=(await b(Nb,{filter:{vibeDeckId:t.deckId}})).vibeDeckButtons.items;g(t,i,{headers:["ID","Label","Type","Position","Command"],rows:i.map(s=>[o(s.id,12),s.label,s.type,`${s.row},${s.column}`,o(s.command??"",30)])});}catch(e){f(e);}}),a.command("button").description("Get vibedeck button").argument("<id>").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await b(Ob,{id:t});if(!i.vibeDeckButton)throw new o$1("Button not found");g(e,i.vibeDeckButton);}catch(i){f(i);}}),a.command("create-button").description("Create vibedeck button").requiredOption("--deck-id <id>","VibeDeck ID").requiredOption("--label <l>","Label").requiredOption("--type <t>","Type (COMMAND, SCRIPT, WEBHOOK)").option("--command <c>","Command").option("--script <s>","Script").option("--webhook-url <u>","Webhook URL").option("--icon <i>","Icon").option("--color <c>","Color").option("--row <n>","Row position",parseInt).option("--column <n>","Column position",parseInt).option("--action-id <id>","Link to an Action").option("-f, --format <format>","Output format").action(async t=>{try{let e={vibeDeckId:t.deckId,label:t.label,type:t.type.toUpperCase()};t.command&&(e.command=t.command),t.script&&(e.script=t.script),t.webhookUrl&&(e.webhookUrl=t.webhookUrl),t.icon&&(e.icon=t.icon),t.color&&(e.color=t.color),t.row!==void 0&&(e.row=t.row),t.column!==void 0&&(e.column=t.column),t.actionId&&(e.actionId=t.actionId);let i=await b(Pb,{input:e});h("Button created"),g(t,i.createVibeDeckButton);}catch(e){f(e);}}),a.command("update-button").description("Update vibedeck button").argument("<id>").option("--label <l>","Label").option("--command <c>","Command").option("--icon <i>","Icon").option("--color <c>","Color").option("--action-id <id>","Link to an Action").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i={};if(e.label&&(i.label=e.label),e.command&&(i.command=e.command),e.icon&&(i.icon=e.icon),e.color&&(i.color=e.color),e.actionId&&(i.actionId=e.actionId),!Object.keys(i).length)throw new o$1("No updates specified");let s=await b(Qb,{id:t,input:i});h("Button updated"),g(e,s.updateVibeDeckButton);}catch(i){f(i);}}),a.command("delete-button").description("Delete vibedeck button").argument("<id>").option("--force","Skip confirmation").action(async(t,e)=>{try{if(!await p("Delete this button?",e.force))return;await b(Rb,{id:t}),h("Button deleted");}catch(i){f(i);}}),a.command("move-button").description("Move vibedeck button").argument("<id>").requiredOption("--row <n>","Row position",parseInt).requiredOption("--column <n>","Column position",parseInt).option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await b(Sb,{id:t,input:{row:e.row,column:e.column}});h("Button moved"),g(e,i.moveVibeDeckButton);}catch(i){f(i);}}),a.command("reorder-buttons").description("Reorder vibedeck buttons").argument("<vibeDeckId>").requiredOption("--positions <json>","Positions as JSON array").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i;try{i=JSON.parse(e.positions);}catch{throw new o$1("Invalid JSON for --positions")}let s=await b(Tb,{vibeDeckId:t,positions:i});h("Buttons reordered"),g(e,s.reorderVibeDeckButtons);}catch(i){f(i);}}),a.command("execute-button").description("Execute vibedeck button").argument("<id>").requiredOption("--agent-id <id>","Agent ID").action(async(t,e)=>{try{let s=(await b(Ub,{id:t,agentId:e.agentId})).executeVibeDeckButton;if(s.success)h(s.output??"Button executed successfully");else throw new o$1(s.error??"Execution failed")}catch(i){f(i);}});let n$1=a.command("share-links").description("VibeDeck share-link management");n$1.command("list").description("List share-links for a vibedeck").argument("<vibeDeckId>","VibeDeck ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await b(Zd,{vibeDeckId:t});g(e,i.vibeDeckShareLinks,{headers:["ID","Name","Permission","Status","Visibility","Uses","Expires"],rows:i.vibeDeckShareLinks.map(s=>[o(s.id,12),s.name??"-",s.permission,s.status,s.visibility,String(s.useCount??0),s.expiresAt?n(s.expiresAt):"-"])});}catch(i){f(i);}}),n$1.command("create").description("Create a share-link").requiredOption("--vibe-deck-id <id>","VibeDeck ID").option("--name <name>","Friendly name").option("--permission <p>","EXECUTE or VIEW","EXECUTE").option("--visibility <v>","SIGNED_LINK | PUBLIC | RESTRICTED","SIGNED_LINK").option("--password <pwd>","Password protect").option("--max-uses <n>","Max uses",t=>parseInt(t,10)).option("--expires-in-hours <n>","Hours until expiry",t=>parseInt(t,10)).option("--allow-iframe","Allow iframe embedding").action(async t=>{try{let e={vibeDeckId:t.vibeDeckId,permission:(t.permission??"EXECUTE").toUpperCase(),visibility:(t.visibility??"SIGNED_LINK").toUpperCase()};t.name&&(e.name=t.name),t.password&&(e.password=t.password),t.maxUses!==void 0&&(e.maxUses=t.maxUses),t.expiresInHours!==void 0&&(e.expiresInHours=t.expiresInHours),t.allowIframe&&(e.allowIframe=!0);let i=await b(_d,{input:e});h(`Created share-link ${i.createVibeDeckShareLink.id} \u2014 ${i.createVibeDeckShareLink.shareUrl}`);}catch(e){f(e);}}),n$1.command("update").description("Update a share-link").argument("<id>","Share-link ID").option("--name <name>").option("--permission <p>").option("--visibility <v>").option("--password <pwd>").option("--max-uses <n>","",t=>parseInt(t,10)).option("--expires-at <iso>").option("--allow-iframe <bool>").action(async(t,e)=>{try{let i={};e.name&&(i.name=e.name),e.permission&&(i.permission=e.permission.toUpperCase()),e.visibility&&(i.visibility=e.visibility.toUpperCase()),e.password&&(i.password=e.password),e.maxUses!==void 0&&(i.maxUses=e.maxUses),e.expiresAt&&(i.expiresAt=e.expiresAt),e.allowIframe!==void 0&&(i.allowIframe=e.allowIframe==="true"),await b($d,{id:t,input:i}),h("Share-link updated");}catch(i){f(i);}}),n$1.command("revoke").description("Revoke a share-link").argument("<id>","Share-link ID").option("--force","Skip confirmation").action(async(t,e)=>{try{if(!await p("Revoke this share-link?",e.force))return;await b(ae,{id:t}),h("Share-link revoked");}catch(i){f(i);}}),n$1.command("validate").description("Validate a share-link token").argument("<token>").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await b(be,{token:t});g(e,i.validateVibeDeckShareLink);}catch(i){f(i);}}),n$1.command("get-shared").description("Fetch the public shared vibedeck via a token").argument("<token>").option("--password <pwd>").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await b(ce,{token:t,password:e.password});g(e,i.sharedVibeDeck);}catch(i){f(i);}}),n$1.command("execute-shared-button").description("Execute a button on a shared vibedeck").argument("<token>").requiredOption("--button-id <id>","Button ID").option("--password <pwd>").action(async(t,e)=>{try{let s=(await b(de,{token:t,buttonId:e.buttonId,password:e.password})).executeSharedVibeDeckButton;if(s.success)h(s.output??"Executed");else throw new o$1(s.error??"Execution failed")}catch(i){f(i);}});}function dr(m){let a=m.command("ai-tool-events").description("AI tool event tracking");a.command("list").description("List AI tool events").option("--agent-id <id>","Filter by agent").option("--tool-name <name>","Filter by tool name").option("-f, --format <format>","Output format").action(async n$1=>{try{let t={};n$1.agentId&&(t.agentId=n$1.agentId),n$1.toolName&&(t.toolName=n$1.toolName);let i=(await b(hc,{filter:Object.keys(t).length?t:void 0})).aiToolEvents.items;g(n$1,i,{headers:["ID","Tool","Event Type","Model","Tokens","Duration","Created"],rows:i.map(s=>[o(s.id,12),s.toolName,s.eventType,s.model??"-",String(s.tokenCount??"-"),String(s.duration??"-"),n(s.createdAt)])});}catch(t){f(t);}}),a.command("get").description("Get AI tool event").argument("<id>","Event ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(ic,{id:n});if(!e.aiToolEvent)throw new o$1("AI tool event not found");g(t,e.aiToolEvent);}catch(e){f(e);}}),a.command("recent").description("Recent AI tool events").requiredOption("--agent-id <id>","Filter by agent").option("--limit <n>","Max results",parseInt).option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(jc,{agentId:n.agentId,limit:n.limit});g(n,t.recentAiToolEvents);}catch(t){f(t);}}),a.command("create").description("Create AI tool event").requiredOption("--agent-id <id>","Agent ID").requiredOption("--tool-name <name>","Tool name").requiredOption("--event-type <type>","Event type").option("--model <model>","Model name").option("--input <input>","Input data").option("--output <output>","Output data").option("--token-count <n>","Token count",parseInt).option("--duration <ms>","Duration in ms",parseInt).option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(kc,{input:{agentId:n.agentId,toolName:n.toolName,eventType:n.eventType,model:n.model,input:n.input,output:n.output,tokenCount:n.tokenCount,duration:n.duration}});h("AI tool event created"),g(n,t.createAiToolEvent);}catch(t){f(t);}}),a.command("cleanup").description("Delete old AI tool events").requiredOption("--before-date <date>","Delete events before this date").option("--force","Skip confirmation").action(async n=>{try{if(!await p(`Delete all AI tool events before ${n.beforeDate}?`,n.force))return;let t=await b(lc,{beforeDate:n.beforeDate});h("Old AI tool events deleted"),g({},t.deleteOldAiToolEvents);}catch(t){f(t);}});}function pr(m){let a=m.command("docs").description("Documentation site management");a.command("sites").description("List documentation sites").option("-f, --format <format>","Output format").action(async n$1=>{try{let e=(await b(mc)).docsSites.items;g(n$1,e,{headers:["ID","Vibe ID","Name","Visibility","Created"],rows:e.map(i=>[o(i.id,12),o(i.vibeId,12),i.name,i.visibility,n(i.createdAt)])});}catch(t){f(t);}}),a.command("site").description("Get documentation site").argument("<vibeId>","Vibe ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(nc,{vibeId:n});if(!e.docsSite)throw new o$1("Docs site not found");g(t,e.docsSite);}catch(e){f(e);}}),a.command("create-site").description("Create documentation site").requiredOption("--vibe-id <id>","Vibe ID").requiredOption("--name <name>","Site name").option("--description <desc>","Description").option("--visibility <v>","Visibility (PRIVATE/PUBLIC)").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(oc,{input:{vibeId:n.vibeId,name:n.name,description:n.description,visibility:n.visibility}});h("Docs site created"),g(n,t.createDocsSite);}catch(t){f(t);}}),a.command("update-site").description("Update documentation site").argument("<id>","Site ID").option("--name <name>","Name").option("--description <desc>","Description").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e={};if(t.name&&(e.name=t.name),t.description&&(e.description=t.description),!Object.keys(e).length)throw new o$1("No updates specified");let i=await b(pc,{id:n,input:e});h("Docs site updated"),g(t,i.updateDocsSite);}catch(e){f(e);}}),a.command("set-visibility").description("Set site visibility").argument("<id>","Site ID").argument("<visibility>","PRIVATE or PUBLIC").option("-f, --format <format>","Output format").action(async(n,t,e)=>{try{let i=await b(qc,{id:n,visibility:t});h(`Visibility set to ${t}`),g(e,i.updateDocsSiteVisibility);}catch(i){f(i);}}),a.command("delete-site").description("Delete documentation site").argument("<id>","Site ID").option("--force","Skip confirmation").action(async(n,t)=>{try{if(!await p("Delete this docs site?",t.force))return;await b(rc,{id:n}),h("Docs site deleted");}catch(e){f(e);}}),a.command("pages").description("List pages for a site").argument("<siteId>","Site ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(sc,{siteId:n});g(t,e.docsPages);}catch(e){f(e);}}),a.command("page").description("Get a page").argument("<id>","Page ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(tc,{id:n});if(!e.docsPage)throw new o$1("Page not found");g(t,e.docsPage);}catch(e){f(e);}}),a.command("create-page").description("Create a page").requiredOption("--site-id <id>","Site ID").requiredOption("--title <title>","Page title").option("--slug <slug>","Page slug").option("--content <content>","Page content").option("--parent-id <id>","Parent page ID").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(uc,{input:{siteId:n.siteId,title:n.title,slug:n.slug,content:n.content,parentId:n.parentId}});h("Page created"),g(n,t.createDocsPage);}catch(t){f(t);}}),a.command("update-page").description("Update a page").argument("<id>","Page ID").option("--title <title>","Title").option("--content <content>","Content").option("--slug <slug>","Slug").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e={};if(t.title&&(e.title=t.title),t.content&&(e.content=t.content),t.slug&&(e.slug=t.slug),!Object.keys(e).length)throw new o$1("No updates specified");let i=await b(vc,{id:n,input:e});h("Page updated"),g(t,i.updateDocsPage);}catch(e){f(e);}}),a.command("delete-page").description("Delete a page").argument("<id>","Page ID").option("--force","Skip confirmation").action(async(n,t)=>{try{if(!await p("Delete this page?",t.force))return;await b(wc,{id:n}),h("Page deleted");}catch(e){f(e);}}),a.command("reorder-pages").description("Reorder pages").argument("<siteId>","Site ID").requiredOption("--pages <json>","Page order as JSON array").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=JSON.parse(t.pages),i=await b(xc,{siteId:n,pages:e});h("Pages reordered"),g(t,i.reorderDocsPages);}catch(e){f(e);}}),a.command("revisions").description("List revisions for a site").argument("<siteId>","Site ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(yc,{siteId:n});g(t,e.docsRevisions);}catch(e){f(e);}}),a.command("revision").description("Get a revision").argument("<id>","Revision ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(zc,{id:n});if(!e.docsRevision)throw new o$1("Revision not found");g(t,e.docsRevision);}catch(e){f(e);}}),a.command("content").description("Get docs content").argument("<siteId>","Site ID").option("--path <path>","Content path").action(async(n,t)=>{try{let e=await b(Ac,{siteId:n,path:t.path});e.docsContent?console.log(e.docsContent):i$1("No content found");}catch(e){f(e);}}),a.command("compile").description("Compile documentation site").argument("<siteId>","Site ID").option("--publish","Publish after compile").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(Bc,{siteId:n,publish:t.publish??!1});h("Docs site compiled"),g(t,e.compileDocsSite);}catch(e){f(e);}}),a.command("publish").description("Publish a revision").argument("<revisionId>","Revision ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(Cc,{revisionId:n});h("Revision published"),g(t,e.publishDocsRevision);}catch(e){f(e);}}),a.command("rollback").description("Rollback to a revision").argument("<siteId>","Site ID").argument("<revisionId>","Revision ID").option("--force","Skip confirmation").action(async(n,t,e)=>{try{if(!await p(`Rollback site to revision ${t}?`,e.force))return;let i=await b(Dc,{siteId:n,revisionId:t});h("Rollback complete"),g({},i.rollbackDocsRevision);}catch(i){f(i);}}),a.command("signed-url").description("Generate signed URL for a site").argument("<siteId>","Site ID").action(async n=>{try{let t=await b(Ec,{siteId:n});console.log(t.generateDocsSignedUrl);}catch(t){f(t);}});}function mr(m){let a=m.command("audit").description("Audit log management");a.command("list").description("List audit logs").option("--action <action>","Filter by action").option("--resource-type <type>","Filter by resource type").option("--status <status>","Filter by status").option("--actor-id <id>","Filter by actor").option("--from <date>","From date").option("--to <date>","To date").option("-f, --format <format>","Output format").action(async n$1=>{try{let t={};n$1.action&&(t.action=n$1.action),n$1.resourceType&&(t.resourceType=n$1.resourceType),n$1.status&&(t.status=n$1.status),n$1.actorId&&(t.actorId=n$1.actorId),n$1.from&&(t.from=n$1.from),n$1.to&&(t.to=n$1.to);let i=(await b(Fc,{filter:Object.keys(t).length?t:void 0})).vibeAuditLogs.items;g(n$1,i,{headers:["ID","Action","Resource","Resource ID","Actor","Status","Created"],rows:i.map(s=>[o(s.id,12),s.action,s.resourceType,o(s.resourceId,12),o(s.actorId,12),s.status,n(s.createdAt)])});}catch(t){f(t);}}),a.command("get").description("Get audit log").argument("<id>","Audit log ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(Gc,{id:n});if(!e.vibeAuditLog)throw new o$1("Audit log not found");g(t,e.vibeAuditLog);}catch(e){f(e);}}),a.command("stats").description("Get audit log statistics").option("--action <action>","Filter by action").option("--resource-type <type>","Filter by resource type").option("--status <status>","Filter by status").option("--actor-id <id>","Filter by actor").option("--from <date>","From date").option("--to <date>","To date").option("-f, --format <format>","Output format").action(async n=>{try{let t={};n.action&&(t.action=n.action),n.resourceType&&(t.resourceType=n.resourceType),n.status&&(t.status=n.status),n.actorId&&(t.actorId=n.actorId),n.from&&(t.from=n.from),n.to&&(t.to=n.to);let e=await b(Hc,{filter:Object.keys(t).length?t:void 0});g(n,e.vibeAuditLogStats);}catch(t){f(t);}}),a.command("delete").description("Delete audit log").argument("<id>","Audit log ID").option("--reason <reason>","Deletion reason").option("--force","Skip confirmation").action(async(n,t)=>{try{if(!await p("Delete this audit log?",t.force))return;await b(Ic,{id:n,reason:t.reason}),h("Audit log deleted");}catch(e){f(e);}}),a.command("bulk-delete").description("Bulk delete audit logs").requiredOption("--ids <ids>","Comma-separated IDs").option("--reason <reason>","Deletion reason").option("--force","Skip confirmation").action(async n=>{try{let t=n.ids.split(",").map(e=>e.trim());if(!await p(`Delete ${t.length} audit logs?`,n.force))return;await b(Jc,{ids:t,reason:n.reason}),h(`${t.length} audit logs deleted`);}catch(t){f(t);}}),a.command("export").description("Export audit logs").option("--action <action>","Filter by action").option("--resource-type <type>","Filter by resource type").option("--status <status>","Filter by status").option("--actor-id <id>","Filter by actor").option("--from <date>","From date").option("--to <date>","To date").option("--export-format <fmt>","Export format (csv/json)","json").action(async n=>{try{let t={};n.action&&(t.action=n.action),n.resourceType&&(t.resourceType=n.resourceType),n.status&&(t.status=n.status),n.actorId&&(t.actorId=n.actorId),n.from&&(t.from=n.from),n.to&&(t.to=n.to);let e=await b(Kc,{filter:Object.keys(t).length?t:void 0,exportFormat:n.exportFormat});console.log(e.exportVibeAuditLogs);}catch(t){f(t);}});}function ur(m$1){let a=m$1.command("action").description("Vibe Actions management");a.command("list").description("List actions").option("--type <type>","Filter by action type (COMMAND, SCRIPT, WEBHOOK, WORKFLOW)").option("--trigger <trigger>","Filter by trigger type (MANUAL, SCHEDULED, EVENT, ON_DEMAND)").option("--category <category>","Filter by category").option("-f, --format <format>","Output format").action(async t=>{try{let e={};t.type&&(e.actionType=t.type.toUpperCase()),t.trigger&&(e.triggerType=t.trigger.toUpperCase()),t.category&&(e.category=t.category);let s=(await b(Vb,{filter:Object.keys(e).length?e:void 0})).actions.items;g(t,s,{headers:["ID","Name","Type","Trigger","Source","Category"],rows:s.map(p=>[o(p.id,12),p.displayName??p.name,p.actionType,p.triggerType,p.sourceType,p.category??"-"])});}catch(e){f(e);}}),a.command("get").description("Get action details").argument("<id>").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await b(Wb,{id:t});if(!i.action)throw new o$1("Action not found");g(e,i.action);}catch(i){f(i);}}),a.command("create").description("Create action").requiredOption("--name <n>","Name").option("--display-name <n>","Display name").option("--description <d>","Description").option("--type <t>","Action type (COMMAND, SCRIPT, WEBHOOK, WORKFLOW)","COMMAND").option("--trigger <t>","Trigger type (MANUAL, SCHEDULED, EVENT, ON_DEMAND)","MANUAL").option("--command <c>","Command to execute").option("--working-directory <d>","Working directory for command").option("--script <s>","Script content").option("--script-interpreter <i>","Script interpreter (e.g. bash, python)").option("--webhook-url <u>","Webhook URL").option("--webhook-method <m>","Webhook HTTP method").option("--schedule <s>","Cron schedule expression").option("--category <c>","Category").option("--tags <t>","Comma-separated tags").option("--target-agent-id <id>","Target agent ID").option("--timeout <ms>","Timeout in milliseconds",parseInt).option("--retry-count <n>","Retry count",parseInt).option("--confirmation-required","Require confirmation before execution").option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name,actionType:(t.type??"COMMAND").toUpperCase(),triggerType:(t.trigger??"MANUAL").toUpperCase()};t.displayName&&(e.displayName=t.displayName),t.description&&(e.description=t.description),t.command&&(e.command=t.command),t.workingDirectory&&(e.workingDirectory=t.workingDirectory),t.script&&(e.script=t.script),t.scriptInterpreter&&(e.scriptInterpreter=t.scriptInterpreter),t.webhookUrl&&(e.webhookUrl=t.webhookUrl),t.webhookMethod&&(e.webhookMethod=t.webhookMethod),t.schedule&&(e.schedule=t.schedule),t.category&&(e.category=t.category),t.tags&&(e.tags=t.tags.split(",").map(s=>s.trim())),t.targetAgentId&&(e.targetAgentId=t.targetAgentId),t.timeout!==void 0&&(e.timeoutMs=t.timeout),t.retryCount!==void 0&&(e.retryCount=t.retryCount),t.confirmationRequired&&(e.confirmationRequired=!0);let i=await b(Xb,{input:e});h("Action created"),g(t,i.createAction);}catch(e){f(e);}}),a.command("update").description("Update action").argument("<id>").option("--name <n>","Name").option("--display-name <n>","Display name").option("--description <d>","Description").option("--type <t>","Action type (COMMAND, SCRIPT, WEBHOOK, WORKFLOW)").option("--trigger <t>","Trigger type (MANUAL, SCHEDULED, EVENT, ON_DEMAND)").option("--command <c>","Command to execute").option("--working-directory <d>","Working directory for command").option("--script <s>","Script content").option("--script-interpreter <i>","Script interpreter").option("--webhook-url <u>","Webhook URL").option("--webhook-method <m>","Webhook HTTP method").option("--schedule <s>","Cron schedule expression").option("--category <c>","Category").option("--tags <t>","Comma-separated tags").option("--target-agent-id <id>","Target agent ID").option("--timeout <ms>","Timeout in milliseconds",parseInt).option("--retry-count <n>","Retry count",parseInt).option("--confirmation-required","Require confirmation before execution").option("--no-confirmation-required","Disable confirmation requirement").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i={};if(e.name&&(i.name=e.name),e.displayName&&(i.displayName=e.displayName),e.description&&(i.description=e.description),e.type&&(i.actionType=e.type.toUpperCase()),e.trigger&&(i.triggerType=e.trigger.toUpperCase()),e.command&&(i.command=e.command),e.workingDirectory&&(i.workingDirectory=e.workingDirectory),e.script&&(i.script=e.script),e.scriptInterpreter&&(i.scriptInterpreter=e.scriptInterpreter),e.webhookUrl&&(i.webhookUrl=e.webhookUrl),e.webhookMethod&&(i.webhookMethod=e.webhookMethod),e.schedule&&(i.schedule=e.schedule),e.category&&(i.category=e.category),e.tags&&(i.tags=e.tags.split(",").map(p=>p.trim())),e.targetAgentId&&(i.targetAgentId=e.targetAgentId),e.timeout!==void 0&&(i.timeoutMs=e.timeout),e.retryCount!==void 0&&(i.retryCount=e.retryCount),e.confirmationRequired!==void 0&&(i.confirmationRequired=e.confirmationRequired),!Object.keys(i).length)throw new o$1("No updates specified");let s=await b(Yb,{id:t,input:i});h("Action updated"),g(e,s.updateAction);}catch(i){f(i);}}),a.command("delete").description("Delete action").argument("<id>").option("--force","Skip confirmation").action(async(t,e)=>{try{if(!await p("Delete this action?",e.force))return;await b(Zb,{id:t}),h("Action deleted");}catch(i){f(i);}}),a.command("duplicate").description("Duplicate action").argument("<id>").argument("[name]").option("-f, --format <format>","Output format").action(async(t,e,i)=>{try{let s=await b(_b,{id:t,name:e});h("Action duplicated"),g(i,s.duplicateAction);}catch(s){f(s);}}),a.command("execute").description("Execute action").argument("<id>").option("--agent-id <id>","Target agent ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i={};e.agentId&&(i.agentId=e.agentId);let p=(await b($b,{id:t,input:Object.keys(i).length?i:void 0})).executeAction,g$1=p.status;g$1==="SUCCESS"?h(`Action executed successfully${p.durationMs?` (${p.durationMs}ms)`:""}`):g$1==="RUNNING"||g$1==="PENDING"?h(`Action execution started (${g$1})`):i$1(p.errorMessage??`Execution ${g$1}`),g(e,p);}catch(i){f(i);}}),a.command("install").description("Install action from store").argument("<storeItemId>").option("--version <v>","Version to install").option("--name <n>","Custom name for installed action").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await b(ac,{storeItemId:t,version:e.version,name:e.name});h("Action installed from store"),g(e,i.installActionFromStore);}catch(i){f(i);}}),a.command("history").description("List action execution history").argument("[actionId]").option("--status <s>","Filter by status (PENDING, RUNNING, SUCCESS, FAILURE, TIMEOUT, CANCELLED)").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i={};t&&(i.actionId=t),e.status&&(i.status=e.status.toUpperCase());let p=(await b(cc,{filter:Object.keys(i).length?i:void 0})).actionExecutions.items;g(e,p,{headers:["ID","Action ID","Status","Trigger","Duration","Started"],rows:p.map(g=>[o(g.id,12),o(g.actionId,12),m(g.status),g.triggerType,g.durationMs?`${g.durationMs}ms`:"-",n(g.startedAt)])});}catch(i){f(i);}}),a.command("cancel-execution").description("Cancel a running action execution").argument("<id>").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await b(bc,{id:t});h("Action execution cancelled"),g(e,i.cancelActionExecution);}catch(i){f(i);}}),a.command("execution").description("Get action execution details").argument("<id>").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await b(dc,{id:t});if(!i.actionExecution)throw new o$1("Action execution not found");g(e,i.actionExecution);}catch(i){f(i);}}),a.command("schedule").description("Create a scheduled job for an action").argument("<actionId>","Action ID to schedule").option("--cron <expr>","Cron expression (for CRON schedule type)").option("--timezone <tz>","Timezone for the schedule","UTC").option("--schedule-type <type>","Schedule type (CRON, ONE_TIME, FIXED_INTERVAL)","CRON").option("--scheduled-at <date>","ISO date for ONE_TIME schedule").option("--interval <n>","Interval value (for FIXED_INTERVAL)",parseInt).option("--interval-unit <unit>","Interval unit (MINUTES, HOURS, DAYS)").option("--start-date <date>","Schedule start date (ISO)").option("--end-date <date>","Schedule end date (ISO)").option("--name <name>","Name for the scheduled job").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i={actionId:t,scheduleType:(e.scheduleType??"CRON").toUpperCase()};e.cron&&(i.cronExpression=e.cron),e.timezone&&(i.timezone=e.timezone),e.scheduledAt&&(i.scheduledAt=e.scheduledAt),e.interval!==void 0&&(i.interval=e.interval),e.intervalUnit&&(i.intervalUnit=e.intervalUnit.toUpperCase()),e.startDate&&(i.startDate=e.startDate),e.endDate&&(i.endDate=e.endDate),e.name&&(i.name=e.name);let s=await b(ec,{input:i});h("Scheduled job created"),g(e,s.createScheduledJob);}catch(i){f(i);}}),a.command("unschedule").description("Delete a scheduled job").argument("<scheduledJobId>","Scheduled job ID to delete").option("--force","Skip confirmation").action(async(t,e)=>{try{if(!await p("Delete this scheduled job?",e.force))return;await b(fc,{id:t}),h("Scheduled job deleted");}catch(i){f(i);}}),a.command("schedules").description("List scheduled jobs").option("--action-id <id>","Filter by action ID").option("-f, --format <format>","Output format").action(async t=>{try{let e={};t.actionId&&(e.actionId=t.actionId);let s=(await b(gc,{filter:Object.keys(e).length?e:void 0})).scheduledJobs.jobs;g(t,s,{headers:["ID","Name","Type","Status","Action ID","Cron","Next Run"],rows:s.map(p=>[o(p.id,12),p.name??"-",p.scheduleType,m(p.status),o(p.actionId,12),p.cronExpression??"-",p.nextExecutionAt?n(p.nextExecutionAt):"-"])});}catch(e){f(e);}});let n$1=a.command("ai-prompts").description("AI prompt templates");n$1.command("list").description("List AI prompts").option("--category <c>","Filter by category").option("--status <s>","Filter by status (ACTIVE, ARCHIVED, DRAFT)").option("--shared","Only shared prompts").option("--search <q>","Search text").option("-f, --format <format>","Output format").action(async t=>{try{let e={};t.category&&(e.category=t.category.toUpperCase()),t.status&&(e.status=t.status.toUpperCase()),t.shared&&(e.isShared=!0),t.search&&(e.search=t.search);let s=(await b(Rd,{filter:Object.keys(e).length?e:void 0})).aiPrompts.items;g(t,s,{headers:["ID","Name","Category","Status","Shared","Uses","Updated"],rows:s.map(p=>[o(p.id,12),p.name,p.category,m(p.status),p.isShared?"yes":"no",String(p.usageCount??0),n(p.updatedAt)])});}catch(e){f(e);}}),n$1.command("get").description("Get an AI prompt").argument("<id>","Prompt ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let i=await b(Sd,{id:t});if(!i.aiPrompt){i$1("Prompt not found");return}g(e,i.aiPrompt);}catch(i){f(i);}}),n$1.command("create").description("Create a new AI prompt").requiredOption("--name <name>","Prompt name").requiredOption("--content <content>","Prompt content/template").option("--description <desc>","Description").option("--category <cat>","Category","GENERAL").option("--status <s>","Status","ACTIVE").option("--shared","Share with workspace").option("--tags <tags>","Comma-separated tags").option("--variables <json>","Variables (JSON)").action(async t=>{try{let e={name:t.name,content:t.content,category:(t.category??"GENERAL").toUpperCase(),status:(t.status??"ACTIVE").toUpperCase()};if(t.description&&(e.description=t.description),t.shared&&(e.isShared=!0),t.tags&&(e.tags=t.tags.split(",").map(s=>s.trim())),t.variables)try{e.variables=JSON.parse(t.variables);}catch{throw new o$1("--variables must be valid JSON")}let i=await b(Td,{input:e});h(`Created prompt ${i.createAIPrompt.id}`);}catch(e){f(e);}}),n$1.command("update").description("Update an AI prompt").argument("<id>","Prompt ID").option("--name <name>").option("--content <content>").option("--description <desc>").option("--category <cat>").option("--status <s>").option("--shared <bool>").option("--tags <tags>","Comma-separated tags").option("--variables <json>").action(async(t,e)=>{try{let i={};if(e.name&&(i.name=e.name),e.content&&(i.content=e.content),e.description&&(i.description=e.description),e.category&&(i.category=e.category.toUpperCase()),e.status&&(i.status=e.status.toUpperCase()),e.shared!==void 0&&(i.isShared=e.shared==="true"),e.tags&&(i.tags=e.tags.split(",").map(s=>s.trim())),e.variables)try{i.variables=JSON.parse(e.variables);}catch{throw new o$1("--variables must be valid JSON")}await b(Ud,{id:t,input:i}),h("Prompt updated");}catch(i){f(i);}}),n$1.command("delete").description("Delete an AI prompt").argument("<id>","Prompt ID").option("--force","Skip confirmation").action(async(t,e)=>{try{if(!await p("Delete this prompt?",e.force))return;await b(Vd,{id:t}),h("Prompt deleted");}catch(i){f(i);}}),n$1.command("duplicate").description("Duplicate an AI prompt").argument("<id>","Prompt ID").requiredOption("--name <name>","Name for the duplicate").action(async(t,e)=>{try{let i=await b(Wd,{id:t,name:e.name});h(`Duplicated to ${i.duplicateAIPrompt.id}`);}catch(i){f(i);}}),n$1.command("render").description("Render an AI prompt with variables").argument("<id>","Prompt ID").option("--variables <json>","Variables (JSON)").action(async(t,e)=>{try{let i;if(e.variables)try{i=JSON.parse(e.variables);}catch{throw new o$1("--variables must be valid JSON")}let s=await b(Xd,{id:t,variables:i});process.stdout.write(s.renderAIPrompt.rendered),s.renderAIPrompt.rendered.endsWith(`
|
|
5
|
+
`)||process.stdout.write(`
|
|
6
|
+
`);}catch(i){f(i);}}),n$1.command("record-usage").description("Increment usage counter for a prompt").argument("<id>","Prompt ID").action(async t=>{try{await b(Yd,{id:t}),h("Usage recorded");}catch(e){f(e);}});}function gr(m){let a=m.command("analytics").description("VibeControls analytics");a.command("overview").description("Show analytics overview for all entities").option("--start-date <date>","Start date (ISO format)",new Date(Date.now()-10080*60*1e3).toISOString()).option("--end-date <date>","End date (ISO format)",new Date().toISOString()).option("--granularity <g>","Granularity (HOUR, DAY, WEEK, MONTH)","DAY").option("--agent-id <id>","Filter by agent ID").option("--vibe-id <id>","Filter by vibe ID").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(nd,{input:{startDate:n.startDate,endDate:n.endDate,granularity:n.granularity,agentId:n.agentId||void 0,vibeId:n.vibeId||void 0}});g(n,t.vibecontrolsAnalytics);}catch(t){f(t);}}),a.command("agents").description("Show agent analytics").option("--start-date <date>","Start date (ISO format)",new Date(Date.now()-10080*60*1e3).toISOString()).option("--end-date <date>","End date (ISO format)",new Date().toISOString()).option("--granularity <g>","Granularity","DAY").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(nd,{input:{startDate:n.startDate,endDate:n.endDate,granularity:n.granularity,entityTypes:["AGENT"]}});g(n,t.vibecontrolsAnalytics.agents);}catch(t){f(t);}}),a.command("sessions").description("Show session analytics").option("--start-date <date>","Start date (ISO format)",new Date(Date.now()-10080*60*1e3).toISOString()).option("--end-date <date>","End date (ISO format)",new Date().toISOString()).option("--granularity <g>","Granularity","DAY").option("--agent-id <id>","Filter by agent ID").option("--vibe-id <id>","Filter by vibe ID").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(nd,{input:{startDate:n.startDate,endDate:n.endDate,granularity:n.granularity,entityTypes:["SESSION"],agentId:n.agentId||void 0,vibeId:n.vibeId||void 0}});g(n,t.vibecontrolsAnalytics.sessions);}catch(t){f(t);}}),a.command("actions").description("Show action analytics").option("--start-date <date>","Start date (ISO format)",new Date(Date.now()-10080*60*1e3).toISOString()).option("--end-date <date>","End date (ISO format)",new Date().toISOString()).option("--granularity <g>","Granularity","DAY").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(nd,{input:{startDate:n.startDate,endDate:n.endDate,granularity:n.granularity,entityTypes:["ACTION"]}});g(n,t.vibecontrolsAnalytics.actions);}catch(t){f(t);}});}function fr(m){let a=m.command("catalogs").description("Service catalog (component + vibe groupings)");a.command("list").description("List catalogs").option("--search <q>","Search query").option("--visibility <v>","Filter by visibility (PUBLIC|PRIVATE|INTERNAL)").option("--tags <tags>","Comma-separated tags").option("-f, --format <format>","Output format").action(async n$1=>{try{let t={};n$1.search&&(t.search=n$1.search),n$1.visibility&&(t.visibility=n$1.visibility.toUpperCase()),n$1.tags&&(t.tags=n$1.tags.split(",").map(s=>s.trim()));let i=(await b(od,{filter:Object.keys(t).length?t:void 0})).vibecontrolsCatalogs.items;g(n$1,i,{headers:["ID","Name","Visibility","Components","Vibes","Created"],rows:i.map(s=>[o(s.id,12),s.name,s.visibility,String(s.componentCount??0),String(s.vibeCount??0),n(s.createdAt)])});}catch(t){f(t);}}),a.command("get").description("Get catalog").argument("<id>").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(pd,{id:n});if(!e.vibecontrolsCatalog)throw new o$1("Catalog not found");g(t,e.vibecontrolsCatalog);}catch(e){f(e);}}),a.command("dependency-graph").description("Dependency graph for a catalog").argument("<catalogId>").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(qd,{catalogId:n});g(t,e.vibecontrolsCatalogDependencyGraph);}catch(e){f(e);}}),a.command("sbom").description("SBOM for a catalog").argument("<catalogId>").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(rd,{catalogId:n});g(t,e.vibecontrolsCatalogSBOM);}catch(e){f(e);}}),a.command("create").description("Create catalog").requiredOption("--name <n>","Catalog name").option("--description <d>","Description").option("--visibility <v>","Visibility (PUBLIC|PRIVATE|INTERNAL)","PRIVATE").option("--owner-id <id>","Owner actor ID").option("--owner-name <n>","Owner display name").option("--tags <tags>","Comma-separated tags").action(async n=>{try{let t={name:n.name};n.description&&(t.description=n.description),n.visibility&&(t.visibility=n.visibility.toUpperCase()),n.ownerId&&(t.ownerId=n.ownerId),n.ownerName&&(t.ownerName=n.ownerName),n.tags&&(t.tags=n.tags.split(",").map(i=>i.trim()));let e=await b(sd,{input:t});h(`Catalog created: ${e.createVibecontrolsCatalog.name} (${e.createVibecontrolsCatalog.id})`);}catch(t){f(t);}}),a.command("update").description("Update catalog").argument("<id>").option("--name <n>","Name").option("--description <d>","Description").option("--visibility <v>","Visibility").option("--tags <tags>","Comma-separated tags").action(async(n,t)=>{try{let e={};t.name&&(e.name=t.name),t.description!==void 0&&(e.description=t.description),t.visibility&&(e.visibility=t.visibility.toUpperCase()),t.tags&&(e.tags=t.tags.split(",").map(i=>i.trim())),await b(td,{id:n,input:e}),h(`Catalog ${n} updated`);}catch(e){f(e);}}),a.command("delete").description("Delete catalog (soft)").argument("<id>").option("-y, --yes","Skip confirmation").action(async(n,t)=>{try{if(!t.yes&&!await p(`Delete catalog ${n}?`))return;await b(ud,{id:n}),h(`Catalog ${n} deleted`);}catch(e){f(e);}}),a.command("add-component").description("Add a component to a catalog").requiredOption("--catalog <id>","Catalog ID").requiredOption("--component <id>","Component ID").action(async n=>{try{await b(vd,{catalogId:n.catalog,componentId:n.component}),h(`Component ${n.component} added to catalog ${n.catalog}`);}catch(t){f(t);}}),a.command("remove-component").description("Remove a component from a catalog").requiredOption("--catalog <id>","Catalog ID").requiredOption("--component <id>","Component ID").action(async n=>{try{await b(wd,{catalogId:n.catalog,componentId:n.component}),h(`Component ${n.component} removed from catalog ${n.catalog}`);}catch(t){f(t);}}),a.command("add-vibe").description("Add a vibe to a catalog").requiredOption("--catalog <id>","Catalog ID").requiredOption("--vibe <id>","Vibe ID").action(async n=>{try{await b(xd,{catalogId:n.catalog,vibeId:n.vibe}),h(`Vibe ${n.vibe} added to catalog ${n.catalog}`);}catch(t){f(t);}}),a.command("remove-vibe").description("Remove a vibe from a catalog").requiredOption("--catalog <id>","Catalog ID").requiredOption("--vibe <id>","Vibe ID").action(async n=>{try{await b(yd,{catalogId:n.catalog,vibeId:n.vibe}),h(`Vibe ${n.vibe} removed from catalog ${n.catalog}`);}catch(t){f(t);}});}function lr(m){let a=m.command("components").description("Software components registry");a.command("list").description("List components").option("--search <q>","Search query").option("--type <t>","Filter by type").option("--lifecycle <l>","Filter by lifecycle").option("--team <id>","Filter by team ID").option("--tags <tags>","Comma-separated tags").option("-f, --format <format>","Output format").action(async n$1=>{try{let t={};n$1.search&&(t.search=n$1.search),n$1.type&&(t.type=n$1.type.toUpperCase()),n$1.lifecycle&&(t.lifecycle=n$1.lifecycle.toUpperCase()),n$1.team&&(t.teamId=n$1.team),n$1.tags&&(t.tags=n$1.tags.split(",").map(s=>s.trim()));let i=(await b(zd,{filter:Object.keys(t).length?t:void 0})).vibecontrolsComponents.items;g(n$1,i,{headers:["ID","Name","Type","Lifecycle","Version","Created"],rows:i.map(s=>[o(s.id,12),s.name,s.type,s.lifecycle,s.version??"",n(s.createdAt)])});}catch(t){f(t);}}),a.command("get").description("Get component").argument("<id>").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(Ad,{id:n});if(!e.vibecontrolsComponent)throw new o$1("Component not found");g(t,e.vibecontrolsComponent);}catch(e){f(e);}}),a.command("create").description("Create component").requiredOption("--name <n>","Component name").option("--description <d>","Description").option("--type <t>","Component type").option("--lifecycle <l>","Lifecycle stage").option("--version <v>","Version").option("--language <l>","Primary language").option("--framework <f>","Primary framework").option("--repository-url <u>","Repository URL").option("--documentation-url <u>","Documentation URL").option("--owner-id <id>","Owner ID").option("--owner-name <n>","Owner display name").option("--team-id <id>","Team ID").option("--tags <tags>","Comma-separated tags").action(async n=>{try{let t={name:n.name};n.description&&(t.description=n.description),n.type&&(t.type=n.type.toUpperCase()),n.lifecycle&&(t.lifecycle=n.lifecycle.toUpperCase()),n.version&&(t.version=n.version),n.language&&(t.language=n.language),n.framework&&(t.framework=n.framework),n.repositoryUrl&&(t.repositoryUrl=n.repositoryUrl),n.documentationUrl&&(t.documentationUrl=n.documentationUrl),n.ownerId&&(t.ownerId=n.ownerId),n.ownerName&&(t.ownerName=n.ownerName),n.teamId&&(t.teamId=n.teamId),n.tags&&(t.tags=n.tags.split(",").map(i=>i.trim()));let e=await b(Bd,{input:t});h(`Component created: ${e.createVibecontrolsComponent.name} (${e.createVibecontrolsComponent.id})`);}catch(t){f(t);}}),a.command("update").description("Update component").argument("<id>").option("--name <n>","Name").option("--description <d>","Description").option("--lifecycle <l>","Lifecycle").option("--version <v>","Version").option("--repository-url <u>","Repository URL").option("--documentation-url <u>","Documentation URL").option("--tags <tags>","Comma-separated tags").action(async(n,t)=>{try{let e={};t.name&&(e.name=t.name),t.description!==void 0&&(e.description=t.description),t.lifecycle&&(e.lifecycle=t.lifecycle.toUpperCase()),t.version&&(e.version=t.version),t.repositoryUrl&&(e.repositoryUrl=t.repositoryUrl),t.documentationUrl&&(e.documentationUrl=t.documentationUrl),t.tags&&(e.tags=t.tags.split(",").map(i=>i.trim())),await b(Cd,{id:n,input:e}),h(`Component ${n} updated`);}catch(e){f(e);}}),a.command("delete").description("Delete component (soft)").argument("<id>").option("-y, --yes","Skip confirmation").action(async(n,t)=>{try{if(!t.yes&&!await p(`Delete component ${n}?`))return;await b(Dd,{id:n}),h(`Component ${n} deleted`);}catch(e){f(e);}}),a.command("fork-github-repo").description("Fork or create a GitHub repo for this workspace").requiredOption("--repo-name <n>","Name of the new repository").requiredOption("--scope <s>","USER or ORG").option("--org-name <n>","GitHub org (required when scope=ORG)").option("--source-repo-url <u>","Source repo URL to fork").option("--description <d>","Description").option("--connection-id <id>","OAuth connection ID").option("--token <t>","Personal access token (if no connection)").action(async n=>{try{let t={repoName:n.repoName,scope:n.scope.toUpperCase()};n.orgName&&(t.orgName=n.orgName),n.sourceRepoUrl&&(t.sourceRepoUrl=n.sourceRepoUrl),n.description&&(t.description=n.description),n.connectionId&&(t.connectionId=n.connectionId),n.token&&(t.token=n.token);let e=await b(Ed,{input:t});h(`${e.forkVibecontrolsGitHubRepo.isForked?"Forked":"Created"}: ${e.forkVibecontrolsGitHubRepo.repoUrl}`);}catch(t){f(t);}}),a.command("publish-as-template").description("Publish a component as a reusable template").requiredOption("--component <id>","Component ID").requiredOption("--name <n>","Template name").option("--description <d>","Description").option("--category <c>","Template category").option("--version <v>","Version").option("--setup-instructions <s>","Markdown setup instructions").option("--source-repository-url <u>","Source repository URL").option("--tags <tags>","Comma-separated tags").action(async n=>{try{let t={name:n.name};n.description&&(t.description=n.description),n.category&&(t.category=n.category.toUpperCase()),n.version&&(t.version=n.version),n.setupInstructions&&(t.setupInstructions=n.setupInstructions),n.sourceRepositoryUrl&&(t.sourceRepositoryUrl=n.sourceRepositoryUrl),n.tags&&(t.tags=n.tags.split(",").map(i=>i.trim()));let e=await b(Fd,{componentId:n.component,input:t});h(`Template published: ${e.publishVibecontrolsComponentAsTemplate.name} (${e.publishVibecontrolsComponentAsTemplate.id})`);}catch(t){f(t);}});}function yr(m){let a=m.command("templates").description("Reusable component templates");a.command("list").description("List templates").option("--search <q>","Search query").option("--category <c>","Filter by category").option("--status <s>","Filter by status").option("--tags <tags>","Comma-separated tags").option("-f, --format <format>","Output format").action(async n$1=>{try{let t={};n$1.search&&(t.search=n$1.search),n$1.category&&(t.category=n$1.category.toUpperCase()),n$1.status&&(t.status=n$1.status.toUpperCase()),n$1.tags&&(t.tags=n$1.tags.split(",").map(s=>s.trim()));let i=(await b(Gd,{filter:Object.keys(t).length?t:void 0})).vibecontrolsTemplates.items;g(n$1,i,{headers:["ID","Name","Category","Status","Clones","Created"],rows:i.map(s=>[o(s.id,12),s.name,s.category,s.status,String(s.cloneCount??0),n(s.createdAt)])});}catch(t){f(t);}}),a.command("get").description("Get template").argument("<id>").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(Hd,{id:n});if(!e.vibecontrolsTemplate)throw new o$1("Template not found");g(t,e.vibecontrolsTemplate);}catch(e){f(e);}}),a.command("update").description("Update template").argument("<id>").option("--name <n>","Name").option("--description <d>","Description").option("--category <c>","Category").option("--status <s>","Status").option("--version <v>","Version").option("--setup-instructions <s>","Markdown setup instructions").option("--source-repository-url <u>","Source repository URL").option("--tags <tags>","Comma-separated tags").action(async(n,t)=>{try{let e={};t.name&&(e.name=t.name),t.description!==void 0&&(e.description=t.description),t.category&&(e.category=t.category.toUpperCase()),t.status&&(e.status=t.status.toUpperCase()),t.version&&(e.version=t.version),t.setupInstructions&&(e.setupInstructions=t.setupInstructions),t.sourceRepositoryUrl&&(e.sourceRepositoryUrl=t.sourceRepositoryUrl),t.tags&&(e.tags=t.tags.split(",").map(i=>i.trim())),await b(Id,{id:n,input:e}),h(`Template ${n} updated`);}catch(e){f(e);}}),a.command("delete").description("Delete template (soft)").argument("<id>").option("-y, --yes","Skip confirmation").action(async(n,t)=>{try{if(!t.yes&&!await p(`Delete template ${n}?`))return;await b(Jd,{id:n}),h(`Template ${n} deleted`);}catch(e){f(e);}}),a.command("instantiate").description("Instantiate template into a new component").requiredOption("--template <id>","Template ID").requiredOption("--name <n>","Name of the new component").option("--description <d>","Description of the new component").option("--workspace-id <id>","Target workspace (defaults to current)").option("--variable-values <json>","JSON for variableValues override").action(async n=>{try{let t={name:n.name};if(n.description&&(t.description=n.description),n.workspaceId&&(t.workspaceId=n.workspaceId),n.variableValues)try{t.variableValues=JSON.parse(n.variableValues);}catch{throw new o$1("--variable-values must be valid JSON")}let e=await b(Kd,{templateId:n.template,input:t});h(`Component created: ${e.instantiateVibecontrolsTemplate.name} (${e.instantiateVibecontrolsTemplate.id})`);}catch(t){f(t);}});}function Ir(m){let a=m.command("scorecards").description("Scorecards (polymorphic \u2014 vibe/catalog/component)");a.command("get").description("Get scorecard for an owner").requiredOption("--owner-id <id>","Owner entity ID").requiredOption("--owner-type <t>","CATALOG | COMPONENT | VIBE").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(Ld,{ownerId:n.ownerId,ownerType:n.ownerType.toUpperCase()});g(n,t.vibecontrolsScorecard??{});}catch(t){f(t);}}),a.command("upsert").description("Create or update a scorecard for an owner").requiredOption("--owner-id <id>","Owner entity ID").requiredOption("--owner-type <t>","CATALOG | COMPONENT | VIBE").action(async n=>{try{let t={ownerId:n.ownerId,ownerType:n.ownerType.toUpperCase()},e=await b(Md,{input:t});h(`Scorecard upserted: ${e.upsertVibecontrolsScorecard.id}`);}catch(t){f(t);}}),a.command("add-metric").description("Add a metric to a scorecard").requiredOption("--scorecard <id>","Scorecard ID").requiredOption("--name <n>","Metric name").option("--description <d>","Description").option("--type <t>","Metric type").option("--status <s>","Status").option("--value <v>","Current value",parseFloat).option("--threshold <t>","Target threshold",parseFloat).option("--unit <u>","Unit").option("--iframe-url <u>","Iframe embed URL").option("--iframe-height <h>","Iframe height (px)",n=>parseInt(n,10)).action(async n=>{try{let t={name:n.name};n.description&&(t.description=n.description),n.type&&(t.type=n.type.toUpperCase()),n.status&&(t.status=n.status.toUpperCase()),n.value!==void 0&&(t.value=n.value),n.threshold!==void 0&&(t.threshold=n.threshold),n.unit&&(t.unit=n.unit),n.iframeUrl&&(t.iframeUrl=n.iframeUrl),n.iframeHeight!==void 0&&(t.iframeHeight=n.iframeHeight);let e=await b(Nd,{scorecardId:n.scorecard,input:t});h(`Metric added: ${e.addVibecontrolsScorecardMetric.name} (${e.addVibecontrolsScorecardMetric.id})`);}catch(t){f(t);}}),a.command("update-metric").description("Update a scorecard metric").argument("<id>").option("--name <n>","Name").option("--description <d>","Description").option("--status <s>","Status").option("--value <v>","Current value",parseFloat).option("--threshold <t>","Threshold",parseFloat).option("--unit <u>","Unit").action(async(n,t)=>{try{let e={};t.name&&(e.name=t.name),t.description!==void 0&&(e.description=t.description),t.status&&(e.status=t.status.toUpperCase()),t.value!==void 0&&(e.value=t.value),t.threshold!==void 0&&(e.threshold=t.threshold),t.unit&&(e.unit=t.unit),await b(Od,{id:n,input:e}),h(`Metric ${n} updated`);}catch(e){f(e);}}),a.command("remove-metric").description("Remove a scorecard metric (soft)").argument("<id>").action(async n=>{try{await b(Pd,{id:n}),h(`Metric ${n} removed`);}catch(t){f(t);}});}var br={id:"vibecontrols",version:"1.0.0",displayName:"VibeControls",dependsOn:["auth","workspaces"],register(m,a$1){a(a$1),xo(m),jo(m),Yo(m),Jo(m),er(m),nr(m),ir(m),or(m),rr(m),sr(m),cr(m),dr(m),pr(m),mr(m),ur(m),gr(m),fr(m),lr(m),yr(m),Ir(m);}},Ns=br;export{Ns as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@burdenoff/cli-sdk",
|
|
3
|
-
"version": "2026.525.
|
|
3
|
+
"version": "2026.525.2",
|
|
4
4
|
"description": "Modular CLI SDK shared across all Burdenoff product CLIs (vibecontrols, botlit, fluidgrids, bigconsole, healthybowl, devportal, workspaces). Each module exports CliModule contract; product CLIs become thin shells that pick which modules to mount.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|