@burdenoff/cli-sdk 2026.529.1 → 2026.627.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/chunk-WXDQ3S5J.js +1 -0
  2. package/dist/modules/auth/index.js +4 -4
  3. package/dist/modules/billing/index.js +2 -2
  4. package/dist/modules/channels/index.js +2 -2
  5. package/dist/modules/conversations/index.js +2 -2
  6. package/dist/modules/crewfoundry/index.cjs +196 -0
  7. package/dist/modules/crewfoundry/index.d.cts +7 -0
  8. package/dist/modules/crewfoundry/index.d.ts +7 -0
  9. package/dist/modules/crewfoundry/index.js +196 -0
  10. package/dist/modules/devportal/index.js +2 -2
  11. package/dist/modules/export/index.js +2 -2
  12. package/dist/modules/files/index.js +4 -4
  13. package/dist/modules/ggnomad/index.cjs +140 -0
  14. package/dist/modules/ggnomad/index.d.cts +7 -0
  15. package/dist/modules/ggnomad/index.d.ts +7 -0
  16. package/dist/modules/ggnomad/index.js +140 -0
  17. package/dist/modules/groups/index.js +2 -2
  18. package/dist/modules/housingvista/index.cjs +137 -0
  19. package/dist/modules/housingvista/index.d.cts +7 -0
  20. package/dist/modules/housingvista/index.d.ts +7 -0
  21. package/dist/modules/housingvista/index.js +137 -0
  22. package/dist/modules/integrations/index.js +2 -2
  23. package/dist/modules/kadaikodi/index.cjs +226 -0
  24. package/dist/modules/kadaikodi/index.d.cts +7 -0
  25. package/dist/modules/kadaikodi/index.d.ts +7 -0
  26. package/dist/modules/kadaikodi/index.js +226 -0
  27. package/dist/modules/notifications/index.js +2 -2
  28. package/dist/modules/organizations/index.js +2 -2
  29. package/dist/modules/products/index.js +2 -2
  30. package/dist/modules/rbac/index.js +2 -2
  31. package/dist/modules/sandbox/index.js +1 -1
  32. package/dist/modules/scheduler/index.js +2 -2
  33. package/dist/modules/security/index.js +2 -2
  34. package/dist/modules/store/index.js +2 -2
  35. package/dist/modules/support/index.js +2 -2
  36. package/dist/modules/tags/index.js +2 -2
  37. package/dist/modules/tours/index.js +2 -2
  38. package/dist/modules/vibecontrols/index.js +4 -4
  39. package/dist/modules/workspaces/index.js +2 -2
  40. package/package.json +1 -1
  41. package/dist/chunk-LZQBJDKZ.js +0 -1
@@ -0,0 +1 @@
1
+ import {b as b$1,o,p,q as q$1}from'./chunk-TCBALVP4.js';var r=null;function T(t){r=t;}function e(){if(!r)throw new q$1("vibecontrols module helpers used before setHelpersContext was called");return r}function c(){let t=e();if(!t.auth.isAuthenticated())throw new p(`Authentication required. Run \`${t.productName} auth login\`.`)}async function q(t,n){return c(),e().gql.workspace.request(t,n)}async function w(t,n){return e().gql.global.request(t,n)}async function b(t,n){return e().gql.workspaceAuthOnly.request(t,n)}async function A(t,n){return e().gql.global.request(t,n)}function v(){e().gql.reset();}function I(t){let n=t instanceof Error?t.message:String(t);throw new o(n)}function k(t,n,p){e().output.formatAndOutput(t,n,p);}function E(t){e().output.printSuccess(t);}function O(t){e().output.printError(t);}function S(t){e().output.printInfo(t);}function D(t){e().output.printWarning(t);}function y(t){e().output.printJson(t);}function N(t){return e().output.formatStatus(t)}function R(t){return e().output.formatDate(t)}function W(t,n){return e().output.truncate(t,n)}function F(t,n){return e().output.confirm(t,n)}function L(t,n){e().output.printTable(t,n);}function V(){return e()}function P(){return e().auth.read()}function _(t){e().auth.write(t);}function K(){e().auth.clear();}function G(){return e().config.read()}function Y(t){return e().config.get(t)}function j(t,n){e().config.set(t,n);}function H(){return e().config.path()}var J=b$1;function B(){return e().config.resolveOIDC()}function U(t){return t?t.expiresAt?Date.now()>=t.expiresAt:false:e().auth.isTokenExpired()}export{J as A,B,U as C,T as a,q as b,w as c,b as d,A as e,v as f,I as g,k as h,E as i,O as j,S as k,D as l,y as m,N as n,R as o,W as p,F as q,L as r,V as s,P as t,_ as u,K as v,G as w,Y as x,j as y,H as z};
@@ -1,6 +1,6 @@
1
- import {Lc,Mc}from'../../chunk-REBBLQFS.js';import {a,f,s,d,k,u,e,h,v,B,n,g,t,c,o as o$1,m,l,j,A}from'../../chunk-LZQBJDKZ.js';import {q,o,f as f$1,h as h$1,g as g$1,d as d$1,i,e as e$1}from'../../chunk-TCBALVP4.js';function X(s$1){let u$1=s$1.command("auth").description("Authentication commands");u$1.command("login").description("Authenticate with VibeControls").option("--client-credentials","Authenticate as an app with client ID and secret").option("--workspace-id <id>","Workspace ID (for app auth)").action(async i=>{try{i.clientCredentials?await Ce(i.workspaceId):await Ue();}catch(r){f(r);}}),u$1.command("logout").description("Revoke tokens and clear stored auth").action(async()=>{try{if(s()?.accessToken)try{await d(Lc);}catch{k("Server-side logout failed, clearing local tokens");}u(),e(),h("Logged out successfully");}catch(i){f(i);}}),u$1.command("status").description("Show current auth state").option("-f, --format <format>","Output format (json, table)").action(i=>{let r=s(),p=v(),I=!!r?.accessToken,m=r?.accessToken?B(r):false,f=r?.expiresAt?n(new Date(r.expiresAt).toISOString()):"-",h=r?.authMethod==="client_credentials"?"Client Credentials":"OAuth2 Device Code",e=r?.workspaceTokenExpiresAt?n(new Date(r.workspaceTokenExpiresAt).toISOString()):"-";g(i,{authenticated:I,method:h,expired:m,expiresAt:f,workspaceId:r?.workspaceId??"-",organizationId:r?.organizationId??"-",workspaceTokenExpiresAt:e,workspaceEndpoint:p.workspaceEndpoint,globalEndpoint:p.globalEndpoint},{headers:["Key","Value"],rows:[["Authenticated",String(I)],["Method",h],["Expired",String(m)],["Expires At",f],["Workspace ID",r?.workspaceId??"-"],["Organization ID",r?.organizationId??"-"],["Workspace Token Expires",e],["Workspace Endpoint",p.workspaceEndpoint],["Global Endpoint",p.globalEndpoint]]});}),u$1.command("token").description("Print access token to stdout").option("--workspace","Print workspace token instead").action(i=>{let r=s();if(i.workspace){if(!r?.workspaceToken)throw new o("No workspace token. Set a workspace: vibecontrols workspace set <id>");process.stdout.write(r.workspaceToken);return}if(!r?.accessToken)throw new o("Not authenticated. Run: vibecontrols auth login");process.stdout.write(r.accessToken);}),u$1.command("refresh").description("Force token refresh").action(async()=>{try{let i=s();if(!i?.refreshToken&&i?.authMethod!=="client_credentials")throw new o("No refresh token available. Run: vibecontrols auth login");if(i?.authMethod==="client_credentials"&&i.clientId&&i.clientSecret){let I=v(),m=await f$1(I.globalEndpoint,i.clientId,i.clientSecret);t({...i,accessToken:m.accessToken,expiresAt:Date.now()+m.expiresIn*1e3}),e(),h("App token refreshed successfully"),i.workspaceId&&i.organizationId&&await J();return}let p=(await d(Mc,{token:i.refreshToken})).refreshToken;t({...i,accessToken:p.accessToken,refreshToken:p.refreshToken,expiresAt:Date.now()+p.expiresIn*1e3}),e(),h("Token refreshed successfully"),i.workspaceId&&i.organizationId&&await J();}catch(i){f(i);}});}async function J(){let s$1=s();if(!s$1?.accessToken||!s$1.workspaceId||!s$1.organizationId)return;let u=v();try{let i=await g$1(u.workspaceEndpoint,s$1.accessToken,s$1.workspaceId,s$1.organizationId);t({...s$1,workspaceToken:i.token,workspaceTokenExpiresAt:new Date(i.expiresAt).getTime()}),e(),h("Workspace token refreshed");}catch{k("Workspace token refresh failed \u2014 workspace operations may require re-login");}}async function Ue(){let s=v(),{oidcIssuer:u,clientId:i$1}=A(),r={...s,oidcIssuer:u,clientId:i$1};j("Starting device code authentication...");let p=await d$1(r);console.log(""),console.log(` Open: ${p.verificationUri}`),console.log(` Code: ${p.userCode}`),console.log(""),await i(p.verificationUriComplete??p.verificationUri)?j("Browser opened"):k("Could not open browser \u2014 open the URL manually"),j("Waiting for authorization...");let m=await e$1(p.deviceCode,p.interval,r),f=m.accessToken,h$2=Date.now()+m.expiresIn*1e3;j("Fetching workspaces...");try{let e$1=await h$1(s.globalEndpoint,f);if(e$1.length===0){t({accessToken:f,refreshToken:m.refreshToken,expiresAt:h$2,authMethod:"device_code"}),e(),h("Authentication successful (no workspaces found)");return}let t$1=e$1[0];if(e$1.length>1){console.log(`
2
- Available workspaces:`),e$1.forEach((O,$)=>console.log(` ${$+1}. ${O.name} (${O.slug})`));let A=(await import('readline')).createInterface({input:process.stdin,output:process.stdout}),g=await new Promise(O=>{A.question(`
3
- Select workspace [1-${e$1.length}]: `,$=>{A.close(),O($.trim());});}),S=parseInt(g,10)-1;S>=0&&S<e$1.length&&(t$1=e$1[S]);}j(`Using workspace: ${t$1.name} (${t$1.id})`);let n=await g$1(s.workspaceEndpoint,f,t$1.id,t$1.organizationId);t({accessToken:f,refreshToken:m.refreshToken,expiresAt:h$2,workspaceToken:n.token,workspaceTokenExpiresAt:new Date(n.expiresAt).getTime(),workspaceId:t$1.id,organizationId:t$1.organizationId,authMethod:"device_code"}),e(),h("Authentication successful");}catch(e$1){t({accessToken:f,refreshToken:m.refreshToken,expiresAt:h$2,authMethod:"device_code"}),e(),h("Authentication successful"),k(`Workspace token not obtained: ${e$1 instanceof Error?e$1.message:String(e$1)}`),j("Set workspace manually: vibecontrols workspace set <id>");}}async function Ce(s){let u=v(),r=(await import('readline')).createInterface({input:process.stdin,output:process.stdout}),p=await new Promise(A=>{r.question("Client ID: ",g=>A(g.trim()));}),I=await new Promise(A=>{r.question("Client Secret: ",g=>{r.close(),A(g.trim());});});if(!p||!I)throw new o("Client ID and secret cannot be empty");j("Authenticating app...");let m=await f$1(u.globalEndpoint,p,I),f=m.accessToken,h$2=Date.now()+m.expiresIn*1e3,e$1,t$1,n=s,l;if(n)try{let g=(await h$1(u.globalEndpoint,f)).find(S=>S.id===n);if(g){l=g.organizationId;let S=await g$1(u.workspaceEndpoint,f,n,l);e$1=S.token,t$1=new Date(S.expiresAt).getTime(),j(`Workspace token issued for: ${g.name}`);}else k(`Workspace ${n} not found \u2014 skipping workspace token`),n=void 0;}catch(A){k(`Workspace token failed: ${A instanceof Error?A.message:String(A)}`);}t({accessToken:f,refreshToken:"",expiresAt:h$2,workspaceToken:e$1,workspaceTokenExpiresAt:t$1,workspaceId:n,organizationId:l,authMethod:"client_credentials",clientId:p,clientSecret:I}),e(),h("App authentication successful");}var Q=`
1
+ import {Lc,Mc}from'../../chunk-REBBLQFS.js';import {a,g,t,e,l,v,f,i,w,C,o,h,u,c,p,n,m,k,B}from'../../chunk-WXDQ3S5J.js';import {q,o as o$1,f as f$1,h as h$1,g as g$1,d,i as i$1,e as e$1}from'../../chunk-TCBALVP4.js';function X(s){let u$1=s.command("auth").description("Authentication commands");u$1.command("login").description("Authenticate with VibeControls").option("--client-credentials","Authenticate as an app with client ID and secret").option("--workspace-id <id>","Workspace ID (for app auth)").action(async i=>{try{i.clientCredentials?await Ce(i.workspaceId):await Ue();}catch(r){g(r);}}),u$1.command("logout").description("Revoke tokens and clear stored auth").action(async()=>{try{if(t()?.accessToken)try{await e(Lc);}catch{l("Server-side logout failed, clearing local tokens");}v(),f(),i("Logged out successfully");}catch(i){g(i);}}),u$1.command("status").description("Show current auth state").option("-f, --format <format>","Output format (json, table)").action(i=>{let r=t(),p=w(),I=!!r?.accessToken,m=r?.accessToken?C(r):false,f=r?.expiresAt?o(new Date(r.expiresAt).toISOString()):"-",h$1=r?.authMethod==="client_credentials"?"Client Credentials":"OAuth2 Device Code",e=r?.workspaceTokenExpiresAt?o(new Date(r.workspaceTokenExpiresAt).toISOString()):"-";h(i,{authenticated:I,method:h$1,expired:m,expiresAt:f,workspaceId:r?.workspaceId??"-",organizationId:r?.organizationId??"-",workspaceTokenExpiresAt:e,workspaceEndpoint:p.workspaceEndpoint,globalEndpoint:p.globalEndpoint},{headers:["Key","Value"],rows:[["Authenticated",String(I)],["Method",h$1],["Expired",String(m)],["Expires At",f],["Workspace ID",r?.workspaceId??"-"],["Organization ID",r?.organizationId??"-"],["Workspace Token Expires",e],["Workspace Endpoint",p.workspaceEndpoint],["Global Endpoint",p.globalEndpoint]]});}),u$1.command("token").description("Print access token to stdout").option("--workspace","Print workspace token instead").action(i=>{let r=t();if(i.workspace){if(!r?.workspaceToken)throw new o$1("No workspace token. Set a workspace: vibecontrols workspace set <id>");process.stdout.write(r.workspaceToken);return}if(!r?.accessToken)throw new o$1("Not authenticated. Run: vibecontrols auth login");process.stdout.write(r.accessToken);}),u$1.command("refresh").description("Force token refresh").action(async()=>{try{let i$1=t();if(!i$1?.refreshToken&&i$1?.authMethod!=="client_credentials")throw new o$1("No refresh token available. Run: vibecontrols auth login");if(i$1?.authMethod==="client_credentials"&&i$1.clientId&&i$1.clientSecret){let I=w(),m=await f$1(I.globalEndpoint,i$1.clientId,i$1.clientSecret);u({...i$1,accessToken:m.accessToken,expiresAt:Date.now()+m.expiresIn*1e3}),f(),i("App token refreshed successfully"),i$1.workspaceId&&i$1.organizationId&&await J();return}let p=(await e(Mc,{token:i$1.refreshToken})).refreshToken;u({...i$1,accessToken:p.accessToken,refreshToken:p.refreshToken,expiresAt:Date.now()+p.expiresIn*1e3}),f(),i("Token refreshed successfully"),i$1.workspaceId&&i$1.organizationId&&await J();}catch(i){g(i);}});}async function J(){let s=t();if(!s?.accessToken||!s.workspaceId||!s.organizationId)return;let u$1=w();try{let i$1=await g$1(u$1.workspaceEndpoint,s.accessToken,s.workspaceId,s.organizationId);u({...s,workspaceToken:i$1.token,workspaceTokenExpiresAt:new Date(i$1.expiresAt).getTime()}),f(),i("Workspace token refreshed");}catch{l("Workspace token refresh failed \u2014 workspace operations may require re-login");}}async function Ue(){let s=w(),{oidcIssuer:u$1,clientId:i$2}=B(),r={...s,oidcIssuer:u$1,clientId:i$2};k("Starting device code authentication...");let p=await d(r);console.log(""),console.log(` Open: ${p.verificationUri}`),console.log(` Code: ${p.userCode}`),console.log(""),await i$1(p.verificationUriComplete??p.verificationUri)?k("Browser opened"):l("Could not open browser \u2014 open the URL manually"),k("Waiting for authorization...");let m=await e$1(p.deviceCode,p.interval,r),f$1=m.accessToken,h=Date.now()+m.expiresIn*1e3;k("Fetching workspaces...");try{let e=await h$1(s.globalEndpoint,f$1);if(e.length===0){u({accessToken:f$1,refreshToken:m.refreshToken,expiresAt:h,authMethod:"device_code"}),f(),i("Authentication successful (no workspaces found)");return}let t=e[0];if(e.length>1){console.log(`
2
+ Available workspaces:`),e.forEach((O,$)=>console.log(` ${$+1}. ${O.name} (${O.slug})`));let A=(await import('readline')).createInterface({input:process.stdin,output:process.stdout}),g=await new Promise(O=>{A.question(`
3
+ Select workspace [1-${e.length}]: `,$=>{A.close(),O($.trim());});}),S=parseInt(g,10)-1;S>=0&&S<e.length&&(t=e[S]);}k(`Using workspace: ${t.name} (${t.id})`);let n=await g$1(s.workspaceEndpoint,f$1,t.id,t.organizationId);u({accessToken:f$1,refreshToken:m.refreshToken,expiresAt:h,workspaceToken:n.token,workspaceTokenExpiresAt:new Date(n.expiresAt).getTime(),workspaceId:t.id,organizationId:t.organizationId,authMethod:"device_code"}),f(),i("Authentication successful");}catch(e){u({accessToken:f$1,refreshToken:m.refreshToken,expiresAt:h,authMethod:"device_code"}),f(),i("Authentication successful"),l(`Workspace token not obtained: ${e instanceof Error?e.message:String(e)}`),k("Set workspace manually: vibecontrols workspace set <id>");}}async function Ce(s){let u$1=w(),r=(await import('readline')).createInterface({input:process.stdin,output:process.stdout}),p=await new Promise(A=>{r.question("Client ID: ",g=>A(g.trim()));}),I=await new Promise(A=>{r.question("Client Secret: ",g=>{r.close(),A(g.trim());});});if(!p||!I)throw new o$1("Client ID and secret cannot be empty");k("Authenticating app...");let m=await f$1(u$1.globalEndpoint,p,I),f$2=m.accessToken,h=Date.now()+m.expiresIn*1e3,e,t,n=s,l$1;if(n)try{let g=(await h$1(u$1.globalEndpoint,f$2)).find(S=>S.id===n);if(g){l$1=g.organizationId;let S=await g$1(u$1.workspaceEndpoint,f$2,n,l$1);e=S.token,t=new Date(S.expiresAt).getTime(),k(`Workspace token issued for: ${g.name}`);}else l(`Workspace ${n} not found \u2014 skipping workspace token`),n=void 0;}catch(A){l(`Workspace token failed: ${A instanceof Error?A.message:String(A)}`);}u({accessToken:f$2,refreshToken:"",expiresAt:h,workspaceToken:e,workspaceTokenExpiresAt:t,workspaceId:n,organizationId:l$1,authMethod:"client_credentials",clientId:p,clientSecret:I}),f(),i("App authentication successful");}var Q=`
4
4
  query currentUser {
5
5
  currentUser {
6
6
  id email firstName lastName username phoneNumber name
@@ -157,4 +157,4 @@ Select workspace [1-${e$1.length}]: `,$=>{A.close(),O($.trim());});}),S=parseInt
157
157
  id email firstName lastName username role status
158
158
  }
159
159
  }
160
- `;function Te(s){let u=s.command("profile").description("Current user profile");u.command("show").description("Show current user").option("-f, --format <format>").action(async e=>{try{let t=await c(Q);g(e,t.currentUser);}catch(t){f(t);}}),u.command("update").description("Update current user profile").option("--first-name <s>").option("--last-name <s>").option("--name <s>").option("--username <s>").option("--phone <s>").option("--timezone <s>").option("--language <s>").option("-f, --format <format>").action(async e=>{try{let t={};if(e.firstName&&(t.firstName=e.firstName),e.lastName&&(t.lastName=e.lastName),e.name&&(t.name=e.name),e.username&&(t.username=e.username),e.phone&&(t.phoneNumber=e.phone),e.timezone&&(t.timezone=e.timezone),e.language&&(t.language=e.language),!Object.keys(t).length)throw new o("No updates specified");let n=await c(Z,{input:t});h("Profile updated"),g(e,n.updateCurrentUserProfile);}catch(t){f(t);}});let i=s.command("security").description("Account security overview");i.command("audit-log").description("Recent auth audit events for the current user").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>").action(async e=>{try{let t=await c(K,{pagination:{limit:e.limit,offset:0}});g(e,t.authAuditLogs,{headers:["When","Action","Resource","IP"],rows:t.authAuditLogs.map(n$1=>[n(n$1.createdAt),n$1.action,n$1.resource??"-",n$1.ipAddress??"-"])});}catch(t){f(t);}}),i.command("sessions").description("Active sessions for the current user").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>").action(async e=>{try{let t=await c(ee,{pagination:{limit:e.limit,offset:0}});g(e,t.activeSessions,{headers:["ID","Status","IP","LastActivity","Current"],rows:t.activeSessions.map(n$1=>[o$1(n$1.id,12),m(n$1.status),n$1.ipAddress??"-",n(n$1.lastActivityAt),String(!!n$1.isCurrent)])});}catch(t){f(t);}});let r=s.command("mfa").description("Multi-factor authentication");r.command("list").description("List MFA methods enrolled for the current user").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>").action(async e=>{try{let t=await c(te,{pagination:{limit:e.limit,offset:0}});g(e,t.currentUserMFAMethods,{headers:["Method","Status","Created"],rows:t.currentUserMFAMethods.map(n$1=>[n$1.method,m(n$1.status),n(n$1.createdAt)])});}catch(t){f(t);}}),r.command("enroll").description("Begin MFA enrollment (TOTP/SMS/EMAIL)").requiredOption("--method <m>","TOTP|SMS|EMAIL").option("-f, --format <format>").action(async e=>{try{let t=await c(ne,{method:e.method.toUpperCase()});e.format?g(e,t.setupMFA):(h("MFA enrollment started"),l(t.setupMFA),j("Save your backup codes; verify with `auth mfa verify --code <CODE>`."));}catch(t){f(t);}}),r.command("verify").description("Verify MFA enrollment code").requiredOption("--code <code>").action(async e=>{try{await c(ie,{code:e.code}),h("MFA enabled");}catch(t){f(t);}}),r.command("disable").description("Disable MFA for the current user").action(async()=>{try{await c(re),h("MFA disabled");}catch(e){f(e);}});let p=s.command("api-keys").description("API key management");p.command("list").description("List your API keys").option("--app <id>","Restrict to keys for an app id").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>").action(async e=>{try{let t=e.app?se:oe,n$1=e.app?{appId:e.app,pagination:{limit:e.limit,offset:0}}:{pagination:{limit:e.limit,offset:0}},l=await c(t,n$1),A=l.myApiKeys??l.appApiKeys??[];g(e,A,{headers:["ID","Name","Prefix","App","Scopes","LastUsed"],rows:A.map(g=>[o$1(g.id,12),g.name??"-",g.prefix??"-",g.appName??"-",Array.isArray(g.scopes)?g.scopes.join(","):"-",n(g.lastUsedAt)])});}catch(t){f(t);}}),p.command("create").description("Generate a new API key").requiredOption("--name <name>").requiredOption("--app <appId>","Owning app id").option("--scope <scope>","Comma-separated scopes").option("--expires <iso>","ISO expiry").option("-f, --format <format>").action(async e=>{try{let t={name:e.name,appId:e.app,scope:e.scope?e.scope.split(","):void 0,expiresAt:e.expires},n=await c(ae,{input:t});h("API key generated. Store the secret \u2014 it is only shown once."),l(n.generateAPIKey);}catch(t){f(t);}}),p.command("revoke").description("Revoke an API key").argument("<keyId>").action(async e=>{try{await c(ce,{keyId:e}),h("API key revoked");}catch(t){f(t);}}),p.command("rotate").description("Rotate an API key (returns new secret)").argument("<keyId>").action(async e=>{try{let t=await c(pe,{keyId:e});h("API key rotated"),l(t.rotateAPIKey);}catch(t){f(t);}}),s.command("audit-log").description("Auth audit log").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>").action(async e=>{try{let t=await c(K,{pagination:{limit:e.limit,offset:0}});g(e,t.authAuditLogs);}catch(t){f(t);}});let I=s.command("delegations").description("Delegation management");I.command("list").description("Delegations granted to the current user").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>").action(async e=>{try{let t=await c(de,{pagination:{limit:e.limit,offset:0}});g(e,t.currentUserDelegations);}catch(t){f(t);}}),I.command("grant").description("Grant a delegation to an app").requiredOption("--app <appId>").requiredOption("--user <userId>","User to delegate as").option("--scope <s>","Comma-separated scopes").option("--workspace <ids>","Comma-separated workspace ids").option("--expires <iso>").option("-f, --format <format>").action(async e=>{try{let t={appId:e.app,userId:e.user,scopes:e.scope?e.scope.split(","):void 0,workspaceIds:e.workspace?e.workspace.split(","):void 0,expiresAt:e.expires},n=await c(me,{input:t});h("Delegation granted"),g(e,n.grantDelegation);}catch(t){f(t);}}),I.command("revoke").description("Revoke a delegation").argument("<id>").option("--reason <text>").action(async(e,t)=>{try{await c(ue,{id:e,reason:t.reason}),h("Delegation revoked");}catch(n){f(n);}});let m$1=s.command("apps").description("OAuth/system app management");m$1.command("list").description("Apps owned by the current user").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>").action(async e=>{try{let t=await c(le,{pagination:{limit:e.limit,offset:0}});g(e,t.currentUserApps,{headers:["ID","ClientID","Name","Type","Status"],rows:t.currentUserApps.map(n=>[o$1(n.id,12),o$1(n.clientId,24),n.name??"-",n.type??"-",m(n.status)])});}catch(t){f(t);}}),m$1.command("get").description("Get an app by id").argument("<id>").option("-f, --format <format>").action(async(e,t)=>{try{let n=await c(ge,{id:e});if(!n.app)throw new o(`App ${e} not found`);g(t,n.app);}catch(n){f(n);}}),m$1.command("create").description("Create an OAuth app").requiredOption("--name <s>").option("--description <s>").option("--type <t>","OAUTH|SYSTEM","OAUTH").option("--actor-type <t>","USER|APP|SERVICE","APP").option("--redirect <urls>","Comma-separated redirect URIs").option("--scopes <s>","Comma-separated scopes").option("-f, --format <format>").action(async e=>{try{let t={name:e.name,description:e.description,type:(e.type??"OAUTH").toUpperCase(),actorType:(e.actorType??"APP").toUpperCase(),redirectUris:e.redirect?e.redirect.split(","):void 0,scopes:e.scopes?e.scopes.split(","):void 0},n=await c(fe,{input:t});h("App created. Client secret only shown once."),l(n.createApp);}catch(t){f(t);}}),m$1.command("update").description("Update an app").argument("<id>").option("--name <s>").option("--description <s>").option("--redirect <urls>","Comma-separated redirect URIs").option("--scopes <s>","Comma-separated scopes").option("--status <s>").option("-f, --format <format>").action(async(e,t)=>{try{let n={};if(t.name&&(n.name=t.name),t.description!==void 0&&(n.description=t.description),t.redirect&&(n.redirectUris=t.redirect.split(",")),t.scopes&&(n.scopes=t.scopes.split(",")),t.status&&(n.status=t.status.toUpperCase()),!Object.keys(n).length)throw new o("No updates specified");let l=await c(Ae,{id:e,input:n});h("App updated"),g(t,l.updateApp);}catch(n){f(n);}}),m$1.command("deactivate").description("Deactivate an app").argument("<id>").action(async e=>{try{await c(Ie,{id:e}),h("App deactivated");}catch(t){f(t);}});let f$1=s.command("sso").description("SSO (SAML/OIDC) configuration");f$1.command("get").description("Get SSO config for a tenant").requiredOption("--tenant <id>").option("-f, --format <format>").action(async e=>{try{let t=await c(he,{tenantId:e.tenant});g(e,t.getSSOConfig);}catch(t){f(t);}}),f$1.command("save").description("Save (upsert) SSO config for a tenant").requiredOption("--tenant <id>").requiredOption("--entity <s>","EntityID / Issuer").requiredOption("--sso-url <url>").option("--slo-url <url>").option("--certificate <pem>","X.509 certificate PEM").option("--enabled","Enable after save",false).option("-f, --format <format>").action(async e=>{try{let t={entityId:e.entity,ssoUrl:e.ssoUrl,sloUrl:e.sloUrl,certificate:e.certificate,enabled:!!e.enabled},n=await c(ye,{tenantId:e.tenant,input:t});h("SSO config saved"),g(e,n.saveSSOConfig);}catch(t){f(t);}}),f$1.command("delete").description("Delete SSO config for a tenant").requiredOption("--tenant <id>").action(async e=>{try{await c(we,{tenantId:e.tenant}),h("SSO config deleted");}catch(t){f(t);}});let h$1=s.command("users").description("User admin (requires admin permissions)");h$1.command("list").description("List users (admin)").option("--email <s>").option("--username <s>").option("--role <s>").option("--status <s>").option("--search <s>").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>").action(async e=>{try{let t={};e.email&&(t.email=e.email),e.username&&(t.username=e.username),e.role&&(t.role=e.role.toUpperCase()),e.status&&(t.status=e.status.toUpperCase()),e.search&&(t.search=e.search);let n$1=await c(ke,{filter:Object.keys(t).length?t:void 0,pagination:{limit:e.limit,offset:0}});g(e,n$1.users.users,{headers:["ID","Email","Username","Role","Status","Created"],rows:n$1.users.users.map(l=>[o$1(l.id,12),l.email,l.username??"-",l.role??"-",m(l.status),n(l.createdAt)])});}catch(t){f(t);}}),h$1.command("get").description("Get user by id (admin)").argument("<id>").option("-f, --format <format>").action(async(e,t)=>{try{let n=await c(Ee,{id:e});if(!n.user)throw new o(`User ${e} not found`);g(t,n.user);}catch(n){f(n);}}),h$1.command("update").description("Update a user (admin)").argument("<id>").option("--first-name <s>").option("--last-name <s>").option("--username <s>").option("--phone <s>").option("--role <s>").option("--status <s>").option("--email-verified <bool>").option("-f, --format <format>").action(async(e,t)=>{try{let n={};if(t.firstName&&(n.firstName=t.firstName),t.lastName&&(n.lastName=t.lastName),t.username&&(n.username=t.username),t.phone&&(n.phoneNumber=t.phone),t.role&&(n.role=t.role.toUpperCase()),t.status&&(n.status=t.status.toUpperCase()),t.emailVerified!==void 0&&(n.emailVerified=t.emailVerified==="true"),!Object.keys(n).length)throw new o("No updates specified");let l=await c(Se,{id:e,input:n});h("User updated"),g(t,l.updateUser);}catch(n){f(n);}});}var Re={id:"auth",version:"1.0.0",displayName:"Authentication",register(s,u){a(u),X(s);let i=s.commands.find(r=>r.name()==="auth");if(!i)throw new q("auth command group missing after registerAuthCommands");Te(i);}},Ye=Re;export{Ye as default};
160
+ `;function Te(s){let u=s.command("profile").description("Current user profile");u.command("show").description("Show current user").option("-f, --format <format>").action(async e=>{try{let t=await c(Q);h(e,t.currentUser);}catch(t){g(t);}}),u.command("update").description("Update current user profile").option("--first-name <s>").option("--last-name <s>").option("--name <s>").option("--username <s>").option("--phone <s>").option("--timezone <s>").option("--language <s>").option("-f, --format <format>").action(async e=>{try{let t={};if(e.firstName&&(t.firstName=e.firstName),e.lastName&&(t.lastName=e.lastName),e.name&&(t.name=e.name),e.username&&(t.username=e.username),e.phone&&(t.phoneNumber=e.phone),e.timezone&&(t.timezone=e.timezone),e.language&&(t.language=e.language),!Object.keys(t).length)throw new o$1("No updates specified");let n=await c(Z,{input:t});i("Profile updated"),h(e,n.updateCurrentUserProfile);}catch(t){g(t);}});let i$1=s.command("security").description("Account security overview");i$1.command("audit-log").description("Recent auth audit events for the current user").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>").action(async e=>{try{let t=await c(K,{pagination:{limit:e.limit,offset:0}});h(e,t.authAuditLogs,{headers:["When","Action","Resource","IP"],rows:t.authAuditLogs.map(n=>[o(n.createdAt),n.action,n.resource??"-",n.ipAddress??"-"])});}catch(t){g(t);}}),i$1.command("sessions").description("Active sessions for the current user").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>").action(async e=>{try{let t=await c(ee,{pagination:{limit:e.limit,offset:0}});h(e,t.activeSessions,{headers:["ID","Status","IP","LastActivity","Current"],rows:t.activeSessions.map(n$1=>[p(n$1.id,12),n(n$1.status),n$1.ipAddress??"-",o(n$1.lastActivityAt),String(!!n$1.isCurrent)])});}catch(t){g(t);}});let r=s.command("mfa").description("Multi-factor authentication");r.command("list").description("List MFA methods enrolled for the current user").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>").action(async e=>{try{let t=await c(te,{pagination:{limit:e.limit,offset:0}});h(e,t.currentUserMFAMethods,{headers:["Method","Status","Created"],rows:t.currentUserMFAMethods.map(n$1=>[n$1.method,n(n$1.status),o(n$1.createdAt)])});}catch(t){g(t);}}),r.command("enroll").description("Begin MFA enrollment (TOTP/SMS/EMAIL)").requiredOption("--method <m>","TOTP|SMS|EMAIL").option("-f, --format <format>").action(async e=>{try{let t=await c(ne,{method:e.method.toUpperCase()});e.format?h(e,t.setupMFA):(i("MFA enrollment started"),m(t.setupMFA),k("Save your backup codes; verify with `auth mfa verify --code <CODE>`."));}catch(t){g(t);}}),r.command("verify").description("Verify MFA enrollment code").requiredOption("--code <code>").action(async e=>{try{await c(ie,{code:e.code}),i("MFA enabled");}catch(t){g(t);}}),r.command("disable").description("Disable MFA for the current user").action(async()=>{try{await c(re),i("MFA disabled");}catch(e){g(e);}});let p$1=s.command("api-keys").description("API key management");p$1.command("list").description("List your API keys").option("--app <id>","Restrict to keys for an app id").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>").action(async e=>{try{let t=e.app?se:oe,n=e.app?{appId:e.app,pagination:{limit:e.limit,offset:0}}:{pagination:{limit:e.limit,offset:0}},l=await c(t,n),A=l.myApiKeys??l.appApiKeys??[];h(e,A,{headers:["ID","Name","Prefix","App","Scopes","LastUsed"],rows:A.map(g=>[p(g.id,12),g.name??"-",g.prefix??"-",g.appName??"-",Array.isArray(g.scopes)?g.scopes.join(","):"-",o(g.lastUsedAt)])});}catch(t){g(t);}}),p$1.command("create").description("Generate a new API key").requiredOption("--name <name>").requiredOption("--app <appId>","Owning app id").option("--scope <scope>","Comma-separated scopes").option("--expires <iso>","ISO expiry").option("-f, --format <format>").action(async e=>{try{let t={name:e.name,appId:e.app,scope:e.scope?e.scope.split(","):void 0,expiresAt:e.expires},n=await c(ae,{input:t});i("API key generated. Store the secret \u2014 it is only shown once."),m(n.generateAPIKey);}catch(t){g(t);}}),p$1.command("revoke").description("Revoke an API key").argument("<keyId>").action(async e=>{try{await c(ce,{keyId:e}),i("API key revoked");}catch(t){g(t);}}),p$1.command("rotate").description("Rotate an API key (returns new secret)").argument("<keyId>").action(async e=>{try{let t=await c(pe,{keyId:e});i("API key rotated"),m(t.rotateAPIKey);}catch(t){g(t);}}),s.command("audit-log").description("Auth audit log").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>").action(async e=>{try{let t=await c(K,{pagination:{limit:e.limit,offset:0}});h(e,t.authAuditLogs);}catch(t){g(t);}});let I=s.command("delegations").description("Delegation management");I.command("list").description("Delegations granted to the current user").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>").action(async e=>{try{let t=await c(de,{pagination:{limit:e.limit,offset:0}});h(e,t.currentUserDelegations);}catch(t){g(t);}}),I.command("grant").description("Grant a delegation to an app").requiredOption("--app <appId>").requiredOption("--user <userId>","User to delegate as").option("--scope <s>","Comma-separated scopes").option("--workspace <ids>","Comma-separated workspace ids").option("--expires <iso>").option("-f, --format <format>").action(async e=>{try{let t={appId:e.app,userId:e.user,scopes:e.scope?e.scope.split(","):void 0,workspaceIds:e.workspace?e.workspace.split(","):void 0,expiresAt:e.expires},n=await c(me,{input:t});i("Delegation granted"),h(e,n.grantDelegation);}catch(t){g(t);}}),I.command("revoke").description("Revoke a delegation").argument("<id>").option("--reason <text>").action(async(e,t)=>{try{await c(ue,{id:e,reason:t.reason}),i("Delegation revoked");}catch(n){g(n);}});let m$1=s.command("apps").description("OAuth/system app management");m$1.command("list").description("Apps owned by the current user").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>").action(async e=>{try{let t=await c(le,{pagination:{limit:e.limit,offset:0}});h(e,t.currentUserApps,{headers:["ID","ClientID","Name","Type","Status"],rows:t.currentUserApps.map(n$1=>[p(n$1.id,12),p(n$1.clientId,24),n$1.name??"-",n$1.type??"-",n(n$1.status)])});}catch(t){g(t);}}),m$1.command("get").description("Get an app by id").argument("<id>").option("-f, --format <format>").action(async(e,t)=>{try{let n=await c(ge,{id:e});if(!n.app)throw new o$1(`App ${e} not found`);h(t,n.app);}catch(n){g(n);}}),m$1.command("create").description("Create an OAuth app").requiredOption("--name <s>").option("--description <s>").option("--type <t>","OAUTH|SYSTEM","OAUTH").option("--actor-type <t>","USER|APP|SERVICE","APP").option("--redirect <urls>","Comma-separated redirect URIs").option("--scopes <s>","Comma-separated scopes").option("-f, --format <format>").action(async e=>{try{let t={name:e.name,description:e.description,type:(e.type??"OAUTH").toUpperCase(),actorType:(e.actorType??"APP").toUpperCase(),redirectUris:e.redirect?e.redirect.split(","):void 0,scopes:e.scopes?e.scopes.split(","):void 0},n=await c(fe,{input:t});i("App created. Client secret only shown once."),m(n.createApp);}catch(t){g(t);}}),m$1.command("update").description("Update an app").argument("<id>").option("--name <s>").option("--description <s>").option("--redirect <urls>","Comma-separated redirect URIs").option("--scopes <s>","Comma-separated scopes").option("--status <s>").option("-f, --format <format>").action(async(e,t)=>{try{let n={};if(t.name&&(n.name=t.name),t.description!==void 0&&(n.description=t.description),t.redirect&&(n.redirectUris=t.redirect.split(",")),t.scopes&&(n.scopes=t.scopes.split(",")),t.status&&(n.status=t.status.toUpperCase()),!Object.keys(n).length)throw new o$1("No updates specified");let l=await c(Ae,{id:e,input:n});i("App updated"),h(t,l.updateApp);}catch(n){g(n);}}),m$1.command("deactivate").description("Deactivate an app").argument("<id>").action(async e=>{try{await c(Ie,{id:e}),i("App deactivated");}catch(t){g(t);}});let f=s.command("sso").description("SSO (SAML/OIDC) configuration");f.command("get").description("Get SSO config for a tenant").requiredOption("--tenant <id>").option("-f, --format <format>").action(async e=>{try{let t=await c(he,{tenantId:e.tenant});h(e,t.getSSOConfig);}catch(t){g(t);}}),f.command("save").description("Save (upsert) SSO config for a tenant").requiredOption("--tenant <id>").requiredOption("--entity <s>","EntityID / Issuer").requiredOption("--sso-url <url>").option("--slo-url <url>").option("--certificate <pem>","X.509 certificate PEM").option("--enabled","Enable after save",false).option("-f, --format <format>").action(async e=>{try{let t={entityId:e.entity,ssoUrl:e.ssoUrl,sloUrl:e.sloUrl,certificate:e.certificate,enabled:!!e.enabled},n=await c(ye,{tenantId:e.tenant,input:t});i("SSO config saved"),h(e,n.saveSSOConfig);}catch(t){g(t);}}),f.command("delete").description("Delete SSO config for a tenant").requiredOption("--tenant <id>").action(async e=>{try{await c(we,{tenantId:e.tenant}),i("SSO config deleted");}catch(t){g(t);}});let h$1=s.command("users").description("User admin (requires admin permissions)");h$1.command("list").description("List users (admin)").option("--email <s>").option("--username <s>").option("--role <s>").option("--status <s>").option("--search <s>").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>").action(async e=>{try{let t={};e.email&&(t.email=e.email),e.username&&(t.username=e.username),e.role&&(t.role=e.role.toUpperCase()),e.status&&(t.status=e.status.toUpperCase()),e.search&&(t.search=e.search);let n$1=await c(ke,{filter:Object.keys(t).length?t:void 0,pagination:{limit:e.limit,offset:0}});h(e,n$1.users.users,{headers:["ID","Email","Username","Role","Status","Created"],rows:n$1.users.users.map(l=>[p(l.id,12),l.email,l.username??"-",l.role??"-",n(l.status),o(l.createdAt)])});}catch(t){g(t);}}),h$1.command("get").description("Get user by id (admin)").argument("<id>").option("-f, --format <format>").action(async(e,t)=>{try{let n=await c(Ee,{id:e});if(!n.user)throw new o$1(`User ${e} not found`);h(t,n.user);}catch(n){g(n);}}),h$1.command("update").description("Update a user (admin)").argument("<id>").option("--first-name <s>").option("--last-name <s>").option("--username <s>").option("--phone <s>").option("--role <s>").option("--status <s>").option("--email-verified <bool>").option("-f, --format <format>").action(async(e,t)=>{try{let n={};if(t.firstName&&(n.firstName=t.firstName),t.lastName&&(n.lastName=t.lastName),t.username&&(n.username=t.username),t.phone&&(n.phoneNumber=t.phone),t.role&&(n.role=t.role.toUpperCase()),t.status&&(n.status=t.status.toUpperCase()),t.emailVerified!==void 0&&(n.emailVerified=t.emailVerified==="true"),!Object.keys(n).length)throw new o$1("No updates specified");let l=await c(Se,{id:e,input:n});i("User updated"),h(t,l.updateUser);}catch(n){g(n);}});}var Re={id:"auth",version:"1.0.0",displayName:"Authentication",register(s,u){a(u),X(s);let i=s.commands.find(r=>r.name()==="auth");if(!i)throw new q("auth command group missing after registerAuthCommands");Te(i);}},Ye=Re;export{Ye as default};
@@ -1,4 +1,4 @@
1
- import {a,c,g,o,m as m$1,n,f,h as h$1,j}from'../../chunk-LZQBJDKZ.js';import {o as o$1}from'../../chunk-TCBALVP4.js';var A=`
1
+ import {a,c,h as h$1,p,n,o,g,i,k}from'../../chunk-WXDQ3S5J.js';import {o as o$1}from'../../chunk-TCBALVP4.js';var A=`
2
2
  query GetDefaultBillingAccount {
3
3
  getDefaultBillingAccount {
4
4
  id creditAmount currency
@@ -102,4 +102,4 @@ import {a,c,g,o,m as m$1,n,f,h as h$1,j}from'../../chunk-LZQBJDKZ.js';import {o
102
102
  id name limits currentUsageSum reusable
103
103
  }
104
104
  }
105
- `;async function m(){let d=await c(A);if(!d.getDefaultBillingAccount?.id)throw new o$1("No default billing account on file. Pass --account <id> explicitly.");return d.getDefaultBillingAccount.id}function z(d){let s=d.command("billing").description("Billing: subscriptions, invoices, credits"),l=s.command("subscriptions").description("Subscriptions");l.command("list").description("List active subscriptions").option("--account <id>","Billing account id (defaults to current)").option("-f, --format <format>").action(async t=>{try{let n$1=t.account??await m(),i=await c(D,{billingAccountId:n$1});g(t,i.getActiveSubscriptions,{headers:["ID","Status","Plan","Seats","NextBilling"],rows:i.getActiveSubscriptions.map(e=>[o(e.id,12),m$1(e.status),e.plan?.name??"-",String(e.seatCount??"-"),n(e.nextBillingDate)])});}catch(n){f(n);}}),l.command("get").description("Get a subscription").argument("<id>").option("-f, --format <format>").action(async(t,n)=>{try{let i=await c(h,{id:t});if(!i.getSubscription)throw new o$1(`Subscription ${t} not found`);g(n,i.getSubscription);}catch(i){f(i);}}),l.command("upgrade").description("Change subscription seat count").argument("<id>").requiredOption("--seats <n>","Target seat count",t=>parseInt(t,10)).option("-f, --format <format>").action(async(t,n)=>{try{let i={subscriptionId:t,seatCount:n.seats},e=await c(_,{input:i});h$1(`Seat count updated to ${e.updateSubscriptionSeats.seatCount}`),g(n,e.updateSubscriptionSeats);}catch(i){f(i);}}),l.command("cancel").description("Cancel a subscription").argument("<id>").option("--reason <s>").action(async(t,n)=>{try{let i={subscriptionId:t,reason:n.reason},e=await c(R,{input:i});h$1("Subscription canceled"),g({},e.cancelSubscription);}catch(i){f(i);}});let P=s.command("plans").description("Plans");P.command("list").description("List available plans").option("--product <id>").option("-f, --format <format>").action(async t=>{try{let n={};t.product&&(n.productId=t.product);let i=await c(N,{filter:Object.keys(n).length?n:void 0});g(t,i.getAllPlans,{headers:["ID","Name","Price","Currency","Duration"],rows:i.getAllPlans.map(e=>[o(e.id,12),e.name,String(e.price??"-"),e.currency??"-",e.duration??"-"])});}catch(n){f(n);}}),P.command("get").description("Get a plan").argument("<id>").option("-f, --format <format>").action(async(t,n)=>{try{let i=await c(v,{id:t});if(!i.getPlan)throw new o$1(`Plan ${t} not found`);g(n,i.getPlan);}catch(i){f(i);}}),s.command("addons").description("Addons").command("list").description("List addons").option("--product <id>").option("--limit <n>","Page size",t=>parseInt(t,10),50).option("-f, --format <format>").action(async t=>{try{let n={};t.product&&(n.productId=t.product);let i=await c(G,{filter:Object.keys(n).length?n:void 0,limit:t.limit});g(t,i.getAllAddOns);}catch(n){f(n);}});let g$1=s.command("invoices").description("Invoices");g$1.command("list").description("List invoices").option("--account <id>").option("--page <n>","",t=>parseInt(t,10),1).option("--page-size <n>","",t=>parseInt(t,10),20).option("-f, --format <format>").action(async t=>{try{let n$1=t.account??await m(),i=await c(O,{billingAccountId:n$1,page:t.page,pageSize:t.pageSize});g(t,i.getPaginatedInvoices.invoices,{headers:["ID","#","Status","Total","Currency","Paid"],rows:i.getPaginatedInvoices.invoices.map(e=>[o(e.id,12),e.invoiceNumber??"-",m$1(e.status),String(e.total??"-"),e.currency??"-",n(e.paidAt)])});}catch(n){f(n);}}),g$1.command("get").description("Get an invoice").argument("<id>").option("-f, --format <format>").action(async(t,n)=>{try{let i=await c(S,{id:t});if(!i.getInvoice)throw new o$1(`Invoice ${t} not found`);g(n,i.getInvoice);}catch(i){f(i);}}),g$1.command("download").description("Print invoice PDF URL (browser-only download)").argument("<id>").action(async t=>{try{let n=await c(S,{id:t});if(!n.getInvoice?.pdfUrl)throw new o$1(`Invoice ${t} has no pdfUrl`);j("PDF URL:"),console.log(n.getInvoice.pdfUrl);}catch(n){f(n);}});let f$1=s.command("payment-methods").description("Payment methods");f$1.command("list").description("List payment methods").option("--account <id>").option("-f, --format <format>").action(async t=>{try{let n=t.account??await m(),i=await c($,{billingAccountId:n});g(t,i.getPaymentMethods,{headers:["ID","Type","Brand","Last4","Default","Verified"],rows:i.getPaymentMethods.map(e=>[o(e.id,12),e.type,e.brand??"-",e.last4??"-",String(!!e.isDefault),String(!!e.isVerified)])});}catch(n){f(n);}}),f$1.command("add").description("Add a payment method (card metadata only \u2014 providers handle secrets)").requiredOption("--type <t>","CREDIT_CARD|BANK|UPI","CREDIT_CARD").requiredOption("--last4 <s>").option("--brand <s>","Visa|MasterCard|...").option("--expiry-month <n>","",t=>parseInt(t,10)).option("--expiry-year <n>","",t=>parseInt(t,10)).option("--account <id>").option("--default","Make it the default").option("-f, --format <format>").action(async t=>{try{let i={billingAccountId:t.account??await m(),type:t.type.toUpperCase(),last4:t.last4,brand:t.brand,expiryMonth:t.expiryMonth,expiryYear:t.expiryYear,isDefault:!!t.default},e=await c(x,{input:i});h$1("Payment method added"),g(t,e.addPaymentMethod);}catch(n){f(n);}}),f$1.command("remove").description("Remove a payment method").argument("<id>").action(async t=>{try{await c(M,{id:t}),h$1("Payment method removed");}catch(n){f(n);}});let I=s.command("credits").description("Credits & withdrawal");I.command("balance").description("Show current credit balance").option("-f, --format <format>").action(async t=>{try{let n=await c(A);g(t,n.getDefaultBillingAccount);}catch(n){f(n);}}),I.command("grant").description("Grant credits to a billing account (admin)").requiredOption("--account <id>").requiredOption("--amount <n>","Amount",t=>parseFloat(t)).option("--reason <s>").action(async t=>{try{let n={billingAccountId:t.account,amount:t.amount,reason:t.reason??"cli-grant"};await c(L,{input:n}),h$1("Credits granted");}catch(n){f(n);}}),I.command("withdraw").description("Request a credit withdrawal").requiredOption("--account <id>").requiredOption("--amount <n>","Amount",t=>parseFloat(t)).requiredOption("--payout <id>","Payout account id").action(async t=>{try{let n={billingAccountId:t.account,creditAmount:t.amount,payoutAccountId:t.payout};await c(U,{input:n}),h$1("Withdrawal requested");}catch(n){f(n);}}),s.command("refunds").description("Pending refunds").option("--page <n>","",t=>parseInt(t,10),0).option("--page-size <n>","",t=>parseInt(t,10),20).option("-f, --format <format>").action(async t=>{try{let n=await c(B,{page:t.page,pageSize:t.pageSize});g(t,n.getPendingRefunds.records);}catch(n){f(n);}}),s.command("quota").description("Quotas for a subscription").argument("<subscriptionId>").option("-f, --format <format>").action(async(t,n)=>{try{let i=await c(q,{subscriptionId:t});g(n,i.getAllQuotasOfSub);}catch(i){f(i);}});}var V={id:"billing",version:"1.0.0",displayName:"Billing",dependsOn:["auth"],register(d,s){a(s),z(d);}},J=V;export{J as default};
105
+ `;async function m(){let d=await c(A);if(!d.getDefaultBillingAccount?.id)throw new o$1("No default billing account on file. Pass --account <id> explicitly.");return d.getDefaultBillingAccount.id}function z(d){let s=d.command("billing").description("Billing: subscriptions, invoices, credits"),l=s.command("subscriptions").description("Subscriptions");l.command("list").description("List active subscriptions").option("--account <id>","Billing account id (defaults to current)").option("-f, --format <format>").action(async t=>{try{let n$1=t.account??await m(),i=await c(D,{billingAccountId:n$1});h$1(t,i.getActiveSubscriptions,{headers:["ID","Status","Plan","Seats","NextBilling"],rows:i.getActiveSubscriptions.map(e=>[p(e.id,12),n(e.status),e.plan?.name??"-",String(e.seatCount??"-"),o(e.nextBillingDate)])});}catch(n){g(n);}}),l.command("get").description("Get a subscription").argument("<id>").option("-f, --format <format>").action(async(t,n)=>{try{let i=await c(h,{id:t});if(!i.getSubscription)throw new o$1(`Subscription ${t} not found`);h$1(n,i.getSubscription);}catch(i){g(i);}}),l.command("upgrade").description("Change subscription seat count").argument("<id>").requiredOption("--seats <n>","Target seat count",t=>parseInt(t,10)).option("-f, --format <format>").action(async(t,n)=>{try{let i$1={subscriptionId:t,seatCount:n.seats},e=await c(_,{input:i$1});i(`Seat count updated to ${e.updateSubscriptionSeats.seatCount}`),h$1(n,e.updateSubscriptionSeats);}catch(i){g(i);}}),l.command("cancel").description("Cancel a subscription").argument("<id>").option("--reason <s>").action(async(t,n)=>{try{let i$1={subscriptionId:t,reason:n.reason},e=await c(R,{input:i$1});i("Subscription canceled"),h$1({},e.cancelSubscription);}catch(i){g(i);}});let P=s.command("plans").description("Plans");P.command("list").description("List available plans").option("--product <id>").option("-f, --format <format>").action(async t=>{try{let n={};t.product&&(n.productId=t.product);let i=await c(N,{filter:Object.keys(n).length?n:void 0});h$1(t,i.getAllPlans,{headers:["ID","Name","Price","Currency","Duration"],rows:i.getAllPlans.map(e=>[p(e.id,12),e.name,String(e.price??"-"),e.currency??"-",e.duration??"-"])});}catch(n){g(n);}}),P.command("get").description("Get a plan").argument("<id>").option("-f, --format <format>").action(async(t,n)=>{try{let i=await c(v,{id:t});if(!i.getPlan)throw new o$1(`Plan ${t} not found`);h$1(n,i.getPlan);}catch(i){g(i);}}),s.command("addons").description("Addons").command("list").description("List addons").option("--product <id>").option("--limit <n>","Page size",t=>parseInt(t,10),50).option("-f, --format <format>").action(async t=>{try{let n={};t.product&&(n.productId=t.product);let i=await c(G,{filter:Object.keys(n).length?n:void 0,limit:t.limit});h$1(t,i.getAllAddOns);}catch(n){g(n);}});let g$1=s.command("invoices").description("Invoices");g$1.command("list").description("List invoices").option("--account <id>").option("--page <n>","",t=>parseInt(t,10),1).option("--page-size <n>","",t=>parseInt(t,10),20).option("-f, --format <format>").action(async t=>{try{let n$1=t.account??await m(),i=await c(O,{billingAccountId:n$1,page:t.page,pageSize:t.pageSize});h$1(t,i.getPaginatedInvoices.invoices,{headers:["ID","#","Status","Total","Currency","Paid"],rows:i.getPaginatedInvoices.invoices.map(e=>[p(e.id,12),e.invoiceNumber??"-",n(e.status),String(e.total??"-"),e.currency??"-",o(e.paidAt)])});}catch(n){g(n);}}),g$1.command("get").description("Get an invoice").argument("<id>").option("-f, --format <format>").action(async(t,n)=>{try{let i=await c(S,{id:t});if(!i.getInvoice)throw new o$1(`Invoice ${t} not found`);h$1(n,i.getInvoice);}catch(i){g(i);}}),g$1.command("download").description("Print invoice PDF URL (browser-only download)").argument("<id>").action(async t=>{try{let n=await c(S,{id:t});if(!n.getInvoice?.pdfUrl)throw new o$1(`Invoice ${t} has no pdfUrl`);k("PDF URL:"),console.log(n.getInvoice.pdfUrl);}catch(n){g(n);}});let f=s.command("payment-methods").description("Payment methods");f.command("list").description("List payment methods").option("--account <id>").option("-f, --format <format>").action(async t=>{try{let n=t.account??await m(),i=await c($,{billingAccountId:n});h$1(t,i.getPaymentMethods,{headers:["ID","Type","Brand","Last4","Default","Verified"],rows:i.getPaymentMethods.map(e=>[p(e.id,12),e.type,e.brand??"-",e.last4??"-",String(!!e.isDefault),String(!!e.isVerified)])});}catch(n){g(n);}}),f.command("add").description("Add a payment method (card metadata only \u2014 providers handle secrets)").requiredOption("--type <t>","CREDIT_CARD|BANK|UPI","CREDIT_CARD").requiredOption("--last4 <s>").option("--brand <s>","Visa|MasterCard|...").option("--expiry-month <n>","",t=>parseInt(t,10)).option("--expiry-year <n>","",t=>parseInt(t,10)).option("--account <id>").option("--default","Make it the default").option("-f, --format <format>").action(async t=>{try{let i$1={billingAccountId:t.account??await m(),type:t.type.toUpperCase(),last4:t.last4,brand:t.brand,expiryMonth:t.expiryMonth,expiryYear:t.expiryYear,isDefault:!!t.default},e=await c(x,{input:i$1});i("Payment method added"),h$1(t,e.addPaymentMethod);}catch(n){g(n);}}),f.command("remove").description("Remove a payment method").argument("<id>").action(async t=>{try{await c(M,{id:t}),i("Payment method removed");}catch(n){g(n);}});let I=s.command("credits").description("Credits & withdrawal");I.command("balance").description("Show current credit balance").option("-f, --format <format>").action(async t=>{try{let n=await c(A);h$1(t,n.getDefaultBillingAccount);}catch(n){g(n);}}),I.command("grant").description("Grant credits to a billing account (admin)").requiredOption("--account <id>").requiredOption("--amount <n>","Amount",t=>parseFloat(t)).option("--reason <s>").action(async t=>{try{let n={billingAccountId:t.account,amount:t.amount,reason:t.reason??"cli-grant"};await c(L,{input:n}),i("Credits granted");}catch(n){g(n);}}),I.command("withdraw").description("Request a credit withdrawal").requiredOption("--account <id>").requiredOption("--amount <n>","Amount",t=>parseFloat(t)).requiredOption("--payout <id>","Payout account id").action(async t=>{try{let n={billingAccountId:t.account,creditAmount:t.amount,payoutAccountId:t.payout};await c(U,{input:n}),i("Withdrawal requested");}catch(n){g(n);}}),s.command("refunds").description("Pending refunds").option("--page <n>","",t=>parseInt(t,10),0).option("--page-size <n>","",t=>parseInt(t,10),20).option("-f, --format <format>").action(async t=>{try{let n=await c(B,{page:t.page,pageSize:t.pageSize});h$1(t,n.getPendingRefunds.records);}catch(n){g(n);}}),s.command("quota").description("Quotas for a subscription").argument("<subscriptionId>").option("-f, --format <format>").action(async(t,n)=>{try{let i=await c(q,{subscriptionId:t});h$1(n,i.getAllQuotasOfSub);}catch(i){g(i);}});}var V={id:"billing",version:"1.0.0",displayName:"Billing",dependsOn:["auth"],register(d,s){a(s),z(d);}},J=V;export{J as default};
@@ -1,4 +1,4 @@
1
- import {a,c,g,o,m,f,r,h,n}from'../../chunk-LZQBJDKZ.js';import {o as o$1}from'../../chunk-TCBALVP4.js';var y=`
1
+ import {a,c,h,p,n,g,s,i,o as o$1}from'../../chunk-WXDQ3S5J.js';import {o}from'../../chunk-TCBALVP4.js';var y=`
2
2
  query GetChannels($filter: ChannelFilterInput, $pagination: ChannelPaginationInput) {
3
3
  getChannels(filter: $filter, pagination: $pagination) {
4
4
  items { id name platform adapterType status connectionHealth priority createdAt }
@@ -67,4 +67,4 @@ import {a,c,g,o,m,f,r,h,n}from'../../chunk-LZQBJDKZ.js';import {o as o$1}from'..
67
67
  mutation DeleteChannelConnection($id: ID!) {
68
68
  deleteConnection(id: $id)
69
69
  }
70
- `;function H(m$1){let r$1=m$1.command("channels").description("Multi-platform message channels (email/SMS/Slack/etc.)");r$1.command("list").description("List channels").option("--platform <p>").option("--status <s>").option("--limit <n>","Page size",t=>parseInt(t,10),50).option("-f, --format <format>").action(async t=>{try{let n={};t.platform&&(n.platform=t.platform.toUpperCase()),t.status&&(n.status=t.status.toUpperCase());let e=await c(y,{filter:Object.keys(n).length?n:void 0,pagination:{limit:t.limit,offset:0}});g(t,e.getChannels.items,{headers:["ID","Name","Platform","Status","Priority"],rows:e.getChannels.items.map(a=>[o(a.id,12),a.name,a.platform,m(a.status),String(a.priority??"-")])});}catch(n){f(n);}}),r$1.command("get").description("Get a channel").argument("<id>").option("-f, --format <format>").action(async(t,n)=>{try{let e=await c(I,{id:t});if(!e.getChannel)throw new o$1(`Channel ${t} not found`);g(n,e.getChannel);}catch(e){f(e);}}),r$1.command("create").description("Create a channel").requiredOption("--name <s>").requiredOption("--platform <p>","EMAIL|SMS|SLACK|TEAMS|DISCORD|WHATSAPP|WEBHOOK").option("--organization <id>","Organization id (defaults to current actor org)").option("--adapter <t>").option("-f, --format <format>").action(async t=>{try{let n=t.organization??r().auth.read()?.organizationId;if(!n)throw new o$1("No organization context. Pass --organization <id> or set auth.organizationId.");let e={name:t.name,platform:t.platform.toUpperCase(),organizationId:n,adapterType:t.adapter?t.adapter.toUpperCase():void 0},a=await c(N,{input:e});h("Channel created"),g(t,a.createChannel);}catch(n){f(n);}}),r$1.command("delete").description("Delete a channel").argument("<id>").action(async t=>{try{await c(A,{id:t}),h("Channel deleted");}catch(n){f(n);}}),r$1.command("send").description("Send a message via a channel").argument("<channelId>").requiredOption("--content <s>").option("--recipient <id>","External recipient id (e.g. email)").option("--subject <s>").option("-f, --format <format>").action(async(t,n)=>{try{let e={channelId:t,content:n.content,recipientId:n.recipient,subject:n.subject},a=await c(T,{input:e});a.sendMessage.success&&h(`Sent: ${a.sendMessage.messageId??"(no id)"}`),g(n,a.sendMessage);}catch(e){f(e);}}),r$1.command("deliveries").description("Recent delivery attempts for a channel").argument("<channelId>").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async(t,n)=>{try{let e=await c(_,{channelId:t,limit:n.limit});g(n,e.getChannelDeliveryAttempts.items);}catch(e){f(e);}}),r$1.command("users").description("Users connected to this channel").argument("<channelId>").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async(t,n)=>{try{let e=await c(S,{channelId:t,pagination:{limit:n.limit,offset:0}});g(n,e.listUserPlatformConnectionsByChannel.items);}catch(e){f(e);}}),r$1.command("webhooks").description("Channel webhook events").command("list").description("List webhook events for a channel").argument("<channelId>").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async(t,n$1)=>{try{let e=await c(O,{channelId:t,limit:n$1.limit});g(n$1,e.getChannelWebhookEvents.items,{headers:["ID","Event","Status","When"],rows:e.getChannelWebhookEvents.items.map(a=>[o(a.id,12),a.eventType,m(a.status),n(a.createdAt)])});}catch(e){f(e);}});let l=r$1.command("connections").description("Channel connections (OAuth/API keys)");l.command("list").description("List connections for an organization").requiredOption("--organization <id>").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async t=>{try{let n=await c($,{organizationId:t.organization,pagination:{limit:t.limit,offset:0}});g(t,n.getConnectionsByOrganization.items);}catch(n){f(n);}}),l.command("create").description("Create a channel connection").requiredOption("--channel <id>").requiredOption("--auth-type <t>","OAUTH|API_KEY|WEBHOOK").option("-f, --format <format>").action(async t=>{try{let n={channelId:t.channel,authType:t.authType.toUpperCase()},e=await c(L,{input:n});h("Connection created"),g(t,e.createConnection);}catch(n){f(n);}}),l.command("delete").description("Delete a connection").argument("<id>").action(async t=>{try{await c(w,{id:t}),h("Connection deleted");}catch(n){f(n);}});}var D={id:"channels",version:"1.0.0",displayName:"Channels",dependsOn:["auth"],register(m,r){a(r),H(m);}},P=D;export{P as default};
70
+ `;function H(m){let r=m.command("channels").description("Multi-platform message channels (email/SMS/Slack/etc.)");r.command("list").description("List channels").option("--platform <p>").option("--status <s>").option("--limit <n>","Page size",t=>parseInt(t,10),50).option("-f, --format <format>").action(async t=>{try{let n$1={};t.platform&&(n$1.platform=t.platform.toUpperCase()),t.status&&(n$1.status=t.status.toUpperCase());let e=await c(y,{filter:Object.keys(n$1).length?n$1:void 0,pagination:{limit:t.limit,offset:0}});h(t,e.getChannels.items,{headers:["ID","Name","Platform","Status","Priority"],rows:e.getChannels.items.map(a=>[p(a.id,12),a.name,a.platform,n(a.status),String(a.priority??"-")])});}catch(n){g(n);}}),r.command("get").description("Get a channel").argument("<id>").option("-f, --format <format>").action(async(t,n)=>{try{let e=await c(I,{id:t});if(!e.getChannel)throw new o(`Channel ${t} not found`);h(n,e.getChannel);}catch(e){g(e);}}),r.command("create").description("Create a channel").requiredOption("--name <s>").requiredOption("--platform <p>","EMAIL|SMS|SLACK|TEAMS|DISCORD|WHATSAPP|WEBHOOK").option("--organization <id>","Organization id (defaults to current actor org)").option("--adapter <t>").option("-f, --format <format>").action(async t=>{try{let n=t.organization??s().auth.read()?.organizationId;if(!n)throw new o("No organization context. Pass --organization <id> or set auth.organizationId.");let e={name:t.name,platform:t.platform.toUpperCase(),organizationId:n,adapterType:t.adapter?t.adapter.toUpperCase():void 0},a=await c(N,{input:e});i("Channel created"),h(t,a.createChannel);}catch(n){g(n);}}),r.command("delete").description("Delete a channel").argument("<id>").action(async t=>{try{await c(A,{id:t}),i("Channel deleted");}catch(n){g(n);}}),r.command("send").description("Send a message via a channel").argument("<channelId>").requiredOption("--content <s>").option("--recipient <id>","External recipient id (e.g. email)").option("--subject <s>").option("-f, --format <format>").action(async(t,n)=>{try{let e={channelId:t,content:n.content,recipientId:n.recipient,subject:n.subject},a=await c(T,{input:e});a.sendMessage.success&&i(`Sent: ${a.sendMessage.messageId??"(no id)"}`),h(n,a.sendMessage);}catch(e){g(e);}}),r.command("deliveries").description("Recent delivery attempts for a channel").argument("<channelId>").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async(t,n)=>{try{let e=await c(_,{channelId:t,limit:n.limit});h(n,e.getChannelDeliveryAttempts.items);}catch(e){g(e);}}),r.command("users").description("Users connected to this channel").argument("<channelId>").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async(t,n)=>{try{let e=await c(S,{channelId:t,pagination:{limit:n.limit,offset:0}});h(n,e.listUserPlatformConnectionsByChannel.items);}catch(e){g(e);}}),r.command("webhooks").description("Channel webhook events").command("list").description("List webhook events for a channel").argument("<channelId>").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async(t,n$1)=>{try{let e=await c(O,{channelId:t,limit:n$1.limit});h(n$1,e.getChannelWebhookEvents.items,{headers:["ID","Event","Status","When"],rows:e.getChannelWebhookEvents.items.map(a=>[p(a.id,12),a.eventType,n(a.status),o$1(a.createdAt)])});}catch(e){g(e);}});let l=r.command("connections").description("Channel connections (OAuth/API keys)");l.command("list").description("List connections for an organization").requiredOption("--organization <id>").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async t=>{try{let n=await c($,{organizationId:t.organization,pagination:{limit:t.limit,offset:0}});h(t,n.getConnectionsByOrganization.items);}catch(n){g(n);}}),l.command("create").description("Create a channel connection").requiredOption("--channel <id>").requiredOption("--auth-type <t>","OAUTH|API_KEY|WEBHOOK").option("-f, --format <format>").action(async t=>{try{let n={channelId:t.channel,authType:t.authType.toUpperCase()},e=await c(L,{input:n});i("Connection created"),h(t,e.createConnection);}catch(n){g(n);}}),l.command("delete").description("Delete a connection").argument("<id>").action(async t=>{try{await c(w,{id:t}),i("Connection deleted");}catch(n){g(n);}});}var D={id:"channels",version:"1.0.0",displayName:"Channels",dependsOn:["auth"],register(m,r){a(r),H(m);}},P=D;export{P as default};
@@ -1,4 +1,4 @@
1
- import {a,b as b$1,g,o,n,f,r,h as h$1}from'../../chunk-LZQBJDKZ.js';import {o as o$1}from'../../chunk-TCBALVP4.js';var l=`
1
+ import {a,b as b$1,h as h$1,p,o,g,s,i}from'../../chunk-WXDQ3S5J.js';import {o as o$1}from'../../chunk-TCBALVP4.js';var l=`
2
2
  query ListConversations($filter: ConversationFilter, $first: Int, $after: String) {
3
3
  conversations(filter: $filter, first: $first, after: $after) {
4
4
  edges { node { id title type description createdAt updatedAt unreadCount } }
@@ -152,4 +152,4 @@ import {a,b as b$1,g,o,n,f,r,h as h$1}from'../../chunk-LZQBJDKZ.js';import {o as
152
152
  conversation { id title type }
153
153
  }
154
154
  }
155
- `;function Q(d){let o$2=d.command("conversations").description("Conversation management");o$2.command("list").description("List conversations").option("--type <t>","Filter by type (DIRECT|GROUP|CHANNEL)").option("--limit <n>","Page size",n=>parseInt(n,10),50).option("-f, --format <format>").action(async n$1=>{try{let t={};n$1.type&&(t.type=n$1.type.toUpperCase());let i=(await b$1(l,{filter:Object.keys(t).length?t:void 0,first:n$1.limit})).conversations.edges.map(p=>p.node);g(n$1,i,{headers:["ID","Title","Type","Unread","Created"],rows:i.map(p=>[o(p.id,12),p.title??"-",p.type??"-",String(p.unreadCount??0),n(p.createdAt)])});}catch(t){f(t);}}),o$2.command("get").description("Get a conversation").argument("<id>").option("-f, --format <format>").action(async(n,t)=>{try{let e=await b$1(R,{id:n});if(!e.conversation)throw new o$1(`Conversation ${n} not found`);g(t,e.conversation);}catch(e){f(e);}}),o$2.command("create").description("Create a conversation").requiredOption("--title <s>").requiredOption("--participants <ids>","Comma-separated participant userIds (required by schema)").option("--description <s>").option("--type <t>","DIRECT|GROUP|CHANNEL","GROUP").option("-f, --format <format>").action(async n=>{try{let t=r().auth.read();if(!t?.workspaceId)throw new o$1("No workspace set. Run: vibecontrols workspace set <id>");let e={title:n.title,description:n.description,type:(n.type??"GROUP").toUpperCase(),participantIds:n.participants.split(","),workspaceId:t.workspaceId},i=await b$1(N,{input:e});h$1("Conversation created"),g(n,i.createConversation.conversation);}catch(t){f(t);}}),o$2.command("update").description("Update a conversation").argument("<id>").option("--title <s>").option("--description <s>").option("-f, --format <format>").action(async(n,t)=>{try{let e={id:n};if(t.title&&(e.title=t.title),t.description!==void 0&&(e.description=t.description),Object.keys(e).length===1)throw new o$1("No updates specified");let i=await b$1(T,{input:e});h$1("Conversation updated"),g(t,i.updateConversation.conversation);}catch(e){f(e);}}),o$2.command("delete").description("Delete a conversation").argument("<id>").action(async n=>{try{await b$1(y,{id:n}),h$1("Conversation deleted");}catch(t){f(t);}}),o$2.command("send").description("Send a message to a conversation").argument("<conversationId>").requiredOption("--content <text>").option("--parent <messageId>","Reply parent").option("-f, --format <format>").action(async(n,t)=>{try{let e={conversationId:n,content:{text:t.content},type:"TEXT",parentMessageId:t.parent},i=await b$1(O,{input:e});h$1("Message sent"),g(t,i.sendMessage.message);}catch(e){f(e);}}),Z(o$2),tt(o$2),et(o$2),nt(o$2),ot(o$2),it(o$2);}function Z(d){let o$1=d.command("messages").description("Message operations");o$1.command("edit").description("Edit a message").argument("<id>").requiredOption("--content <text>").option("--reason <s>").option("-f, --format <format>").action(async(n,t)=>{try{let e={id:n,content:{text:t.content}};t.reason&&(e.reason=t.reason);let i=await b$1(S,{input:e});h$1("Message edited"),g(t,i.editMessage);}catch(e){f(e);}}),o$1.command("delete").description("Delete a message").argument("<id>").option("--hard","Hard delete (default: soft)").action(async(n,t)=>{try{await b$1($,{id:n,hard:t.hard??!1}),h$1("Message deleted");}catch(e){f(e);}}),o$1.command("forward").description("Forward a message to another conversation").argument("<messageId>").requiredOption("--to <targetConversationId>").option("-f, --format <format>").action(async(n,t)=>{try{let e=await b$1(D,{messageId:n,targetConversationId:t.to});h$1("Message forwarded"),g(t,e.forwardMessage.message);}catch(e){f(e);}}),o$1.command("pin").description("Pin a message").argument("<messageId>").action(async n=>{try{await b$1(M,{messageId:n}),h$1("Message pinned");}catch(t){f(t);}}),o$1.command("unpin").description("Unpin a message").argument("<messageId>").action(async n=>{try{await b$1(_,{messageId:n}),h$1("Message unpinned");}catch(t){f(t);}}),o$1.command("search").description("Search messages").requiredOption("--query <s>").option("--conversation <id>","Restrict to a conversation").option("--limit <n>","Page size",n=>parseInt(n,10),50).option("-f, --format <format>").action(async n$1=>{try{let e=(await b$1(h,{query:n$1.query,conversationId:n$1.conversation,first:n$1.limit})).searchMessages.edges.map(i=>i.node);g(n$1,e,{headers:["ID","Conversation","Author","Created"],rows:e.map(i=>[o(i.id,12),o(i.conversationId??"-",12),o(i.authorId??"-",12),n(i.createdAt)])});}catch(t){f(t);}});}function tt(d){let o=d.command("drafts").description("Draft message operations");o.command("get").description("Get the actor\u2019s draft for a conversation").argument("<conversationId>").option("-f, --format <format>").action(async(n,t)=>{try{let e=await b$1(x,{conversationId:n});if(!e.draft){h$1("No draft saved");return}g(t,e.draft);}catch(e){f(e);}}),o.command("save").description("Save (upsert) a draft for a conversation").argument("<conversationId>").requiredOption("--content <text>").option("--parent <messageId>").option("-f, --format <format>").action(async(n,t)=>{try{let e={conversationId:n,content:{text:t.content}};t.parent&&(e.parentMessageId=t.parent);let i=await b$1(w,{input:e});h$1("Draft saved"),g(t,i.saveDraft);}catch(e){f(e);}}),o.command("delete").description("Delete the actor\u2019s draft for a conversation").argument("<conversationId>").action(async n=>{try{await b$1(P,{conversationId:n}),h$1("Draft deleted");}catch(t){f(t);}});}function et(d){let o=d.command("reactions").description("Reaction operations");o.command("add").description("Add an emoji reaction to a message").argument("<messageId>").requiredOption("--emoji <e>").option("-f, --format <format>").action(async(n,t)=>{try{let e=await b$1(U,{messageId:n,emoji:t.emoji});h$1("Reaction added"),g(t,e.addReaction);}catch(e){f(e);}}),o.command("remove").description("Remove an emoji reaction from a message").argument("<messageId>").requiredOption("--emoji <e>").action(async(n,t)=>{try{await b$1(V,{messageId:n,emoji:t.emoji}),h$1("Reaction removed");}catch(e){f(e);}});}function nt(d){let o=d.command("participants").description("Participant operations");o.command("add").description("Add a participant to a conversation").argument("<conversationId>").requiredOption("--user <userId>").option("--role <role>","ADMIN | MODERATOR | MEMBER | GUEST").option("-f, --format <format>").action(async(n,t)=>{try{let e={conversationId:n,userId:t.user};t.role&&(e.role=t.role.toUpperCase());let i=await b$1(k,{input:e});h$1("Participant added"),g(t,i.addParticipant);}catch(e){f(e);}}),o.command("remove").description("Remove a participant from a conversation").argument("<conversationId>").requiredOption("--user <userId>").option("--reason <s>").action(async(n,t)=>{try{let e={conversationId:n,userId:t.user};t.reason&&(e.reason=t.reason),await b$1(L,{input:e}),h$1("Participant removed");}catch(e){f(e);}}),o.command("role").description("Update a participant\u2019s role").argument("<conversationId>").requiredOption("--user <userId>").requiredOption("--role <role>","ADMIN | MODERATOR | MEMBER | GUEST").action(async(n,t)=>{try{await b$1(G,{input:{conversationId:n,userId:t.user,role:t.role.toUpperCase()}}),h$1("Participant role updated");}catch(e){f(e);}});}function ot(d){let o=(t,e,i,p)=>{d.command(t).description(e).argument("<id>").action(async I=>{try{await b$1(i,{id:I}),h$1(p);}catch(g){f(g);}});},n=(t,e,i,p)=>{d.command(t).description(e).argument("<conversationId>").action(async I=>{try{await b$1(i,{conversationId:I}),h$1(p);}catch(g){f(g);}});};o("archive","Archive a conversation",j,"Archived"),o("unarchive","Unarchive a conversation",b,"Unarchived"),d.command("mute").description("Mute a conversation").argument("<conversationId>").option("--until <iso>","ISO timestamp; omit for indefinite").action(async(t,e)=>{try{await b$1(F,{conversationId:t,until:e.until}),h$1("Muted");}catch(i){f(i);}}),n("unmute","Unmute a conversation",H,"Unmuted"),n("pin","Pin a conversation",K,"Pinned"),n("unpin","Unpin a conversation",J,"Unpinned"),d.command("read").description("Mark a conversation as read").argument("<conversationId>").option("--message <messageId>","Mark read up to this message (defaults to latest)").action(async(t,e)=>{try{await b$1(B,{conversationId:t,messageId:e.message}),h$1("Marked as read");}catch(i){f(i);}}),n("leave","Leave a conversation",q,"Left conversation");}function it(d){let o=d.command("invites").description("Invite link operations");o.command("create").description("Create an invite link for a conversation").argument("<conversationId>").option("--max-uses <n>","Maximum number of uses",n=>parseInt(n,10)).option("--expires-at <iso>","ISO expiry timestamp").option("-f, --format <format>").action(async(n,t)=>{try{let e={conversationId:n};t.maxUses!==void 0&&(e.maxUses=t.maxUses),t.expiresAt&&(e.expiresAt=t.expiresAt);let i=await b$1(W,{input:e});h$1("Invite link created"),g(t,i.createInviteLink);}catch(e){f(e);}}),o.command("join").description("Join a conversation via invite code").argument("<code>").action(async n=>{try{await b$1(z,{code:n}),h$1("Joined via invite link");}catch(t){f(t);}}),o.command("validate").description("Validate an invite code").argument("<code>").option("-f, --format <format>").action(async(n,t)=>{try{let e=await b$1(X,{code:n});g(t,e.validateInviteLink);}catch(e){f(e);}});}var at={id:"conversations",version:"1.0.0",displayName:"Conversations",dependsOn:["auth","workspaces"],register(d,o){a(o),Q(d);}},ut=at;export{ut as default};
155
+ `;function Q(d){let o$2=d.command("conversations").description("Conversation management");o$2.command("list").description("List conversations").option("--type <t>","Filter by type (DIRECT|GROUP|CHANNEL)").option("--limit <n>","Page size",n=>parseInt(n,10),50).option("-f, --format <format>").action(async n=>{try{let t={};n.type&&(t.type=n.type.toUpperCase());let i=(await b$1(l,{filter:Object.keys(t).length?t:void 0,first:n.limit})).conversations.edges.map(p=>p.node);h$1(n,i,{headers:["ID","Title","Type","Unread","Created"],rows:i.map(p$1=>[p(p$1.id,12),p$1.title??"-",p$1.type??"-",String(p$1.unreadCount??0),o(p$1.createdAt)])});}catch(t){g(t);}}),o$2.command("get").description("Get a conversation").argument("<id>").option("-f, --format <format>").action(async(n,t)=>{try{let e=await b$1(R,{id:n});if(!e.conversation)throw new o$1(`Conversation ${n} not found`);h$1(t,e.conversation);}catch(e){g(e);}}),o$2.command("create").description("Create a conversation").requiredOption("--title <s>").requiredOption("--participants <ids>","Comma-separated participant userIds (required by schema)").option("--description <s>").option("--type <t>","DIRECT|GROUP|CHANNEL","GROUP").option("-f, --format <format>").action(async n=>{try{let t=s().auth.read();if(!t?.workspaceId)throw new o$1("No workspace set. Run: vibecontrols workspace set <id>");let e={title:n.title,description:n.description,type:(n.type??"GROUP").toUpperCase(),participantIds:n.participants.split(","),workspaceId:t.workspaceId},i$1=await b$1(N,{input:e});i("Conversation created"),h$1(n,i$1.createConversation.conversation);}catch(t){g(t);}}),o$2.command("update").description("Update a conversation").argument("<id>").option("--title <s>").option("--description <s>").option("-f, --format <format>").action(async(n,t)=>{try{let e={id:n};if(t.title&&(e.title=t.title),t.description!==void 0&&(e.description=t.description),Object.keys(e).length===1)throw new o$1("No updates specified");let i$1=await b$1(T,{input:e});i("Conversation updated"),h$1(t,i$1.updateConversation.conversation);}catch(e){g(e);}}),o$2.command("delete").description("Delete a conversation").argument("<id>").action(async n=>{try{await b$1(y,{id:n}),i("Conversation deleted");}catch(t){g(t);}}),o$2.command("send").description("Send a message to a conversation").argument("<conversationId>").requiredOption("--content <text>").option("--parent <messageId>","Reply parent").option("-f, --format <format>").action(async(n,t)=>{try{let e={conversationId:n,content:{text:t.content},type:"TEXT",parentMessageId:t.parent},i$1=await b$1(O,{input:e});i("Message sent"),h$1(t,i$1.sendMessage.message);}catch(e){g(e);}}),Z(o$2),tt(o$2),et(o$2),nt(o$2),ot(o$2),it(o$2);}function Z(d){let o$1=d.command("messages").description("Message operations");o$1.command("edit").description("Edit a message").argument("<id>").requiredOption("--content <text>").option("--reason <s>").option("-f, --format <format>").action(async(n,t)=>{try{let e={id:n,content:{text:t.content}};t.reason&&(e.reason=t.reason);let i$1=await b$1(S,{input:e});i("Message edited"),h$1(t,i$1.editMessage);}catch(e){g(e);}}),o$1.command("delete").description("Delete a message").argument("<id>").option("--hard","Hard delete (default: soft)").action(async(n,t)=>{try{await b$1($,{id:n,hard:t.hard??!1}),i("Message deleted");}catch(e){g(e);}}),o$1.command("forward").description("Forward a message to another conversation").argument("<messageId>").requiredOption("--to <targetConversationId>").option("-f, --format <format>").action(async(n,t)=>{try{let e=await b$1(D,{messageId:n,targetConversationId:t.to});i("Message forwarded"),h$1(t,e.forwardMessage.message);}catch(e){g(e);}}),o$1.command("pin").description("Pin a message").argument("<messageId>").action(async n=>{try{await b$1(M,{messageId:n}),i("Message pinned");}catch(t){g(t);}}),o$1.command("unpin").description("Unpin a message").argument("<messageId>").action(async n=>{try{await b$1(_,{messageId:n}),i("Message unpinned");}catch(t){g(t);}}),o$1.command("search").description("Search messages").requiredOption("--query <s>").option("--conversation <id>","Restrict to a conversation").option("--limit <n>","Page size",n=>parseInt(n,10),50).option("-f, --format <format>").action(async n=>{try{let e=(await b$1(h,{query:n.query,conversationId:n.conversation,first:n.limit})).searchMessages.edges.map(i=>i.node);h$1(n,e,{headers:["ID","Conversation","Author","Created"],rows:e.map(i=>[p(i.id,12),p(i.conversationId??"-",12),p(i.authorId??"-",12),o(i.createdAt)])});}catch(t){g(t);}});}function tt(d){let o=d.command("drafts").description("Draft message operations");o.command("get").description("Get the actor\u2019s draft for a conversation").argument("<conversationId>").option("-f, --format <format>").action(async(n,t)=>{try{let e=await b$1(x,{conversationId:n});if(!e.draft){i("No draft saved");return}h$1(t,e.draft);}catch(e){g(e);}}),o.command("save").description("Save (upsert) a draft for a conversation").argument("<conversationId>").requiredOption("--content <text>").option("--parent <messageId>").option("-f, --format <format>").action(async(n,t)=>{try{let e={conversationId:n,content:{text:t.content}};t.parent&&(e.parentMessageId=t.parent);let i$1=await b$1(w,{input:e});i("Draft saved"),h$1(t,i$1.saveDraft);}catch(e){g(e);}}),o.command("delete").description("Delete the actor\u2019s draft for a conversation").argument("<conversationId>").action(async n=>{try{await b$1(P,{conversationId:n}),i("Draft deleted");}catch(t){g(t);}});}function et(d){let o=d.command("reactions").description("Reaction operations");o.command("add").description("Add an emoji reaction to a message").argument("<messageId>").requiredOption("--emoji <e>").option("-f, --format <format>").action(async(n,t)=>{try{let e=await b$1(U,{messageId:n,emoji:t.emoji});i("Reaction added"),h$1(t,e.addReaction);}catch(e){g(e);}}),o.command("remove").description("Remove an emoji reaction from a message").argument("<messageId>").requiredOption("--emoji <e>").action(async(n,t)=>{try{await b$1(V,{messageId:n,emoji:t.emoji}),i("Reaction removed");}catch(e){g(e);}});}function nt(d){let o=d.command("participants").description("Participant operations");o.command("add").description("Add a participant to a conversation").argument("<conversationId>").requiredOption("--user <userId>").option("--role <role>","ADMIN | MODERATOR | MEMBER | GUEST").option("-f, --format <format>").action(async(n,t)=>{try{let e={conversationId:n,userId:t.user};t.role&&(e.role=t.role.toUpperCase());let i$1=await b$1(k,{input:e});i("Participant added"),h$1(t,i$1.addParticipant);}catch(e){g(e);}}),o.command("remove").description("Remove a participant from a conversation").argument("<conversationId>").requiredOption("--user <userId>").option("--reason <s>").action(async(n,t)=>{try{let e={conversationId:n,userId:t.user};t.reason&&(e.reason=t.reason),await b$1(L,{input:e}),i("Participant removed");}catch(e){g(e);}}),o.command("role").description("Update a participant\u2019s role").argument("<conversationId>").requiredOption("--user <userId>").requiredOption("--role <role>","ADMIN | MODERATOR | MEMBER | GUEST").action(async(n,t)=>{try{await b$1(G,{input:{conversationId:n,userId:t.user,role:t.role.toUpperCase()}}),i("Participant role updated");}catch(e){g(e);}});}function ot(d){let o=(t,e,i$1,p)=>{d.command(t).description(e).argument("<id>").action(async I=>{try{await b$1(i$1,{id:I}),i(p);}catch(g$1){g(g$1);}});},n=(t,e,i$1,p)=>{d.command(t).description(e).argument("<conversationId>").action(async I=>{try{await b$1(i$1,{conversationId:I}),i(p);}catch(g$1){g(g$1);}});};o("archive","Archive a conversation",j,"Archived"),o("unarchive","Unarchive a conversation",b,"Unarchived"),d.command("mute").description("Mute a conversation").argument("<conversationId>").option("--until <iso>","ISO timestamp; omit for indefinite").action(async(t,e)=>{try{await b$1(F,{conversationId:t,until:e.until}),i("Muted");}catch(i){g(i);}}),n("unmute","Unmute a conversation",H,"Unmuted"),n("pin","Pin a conversation",K,"Pinned"),n("unpin","Unpin a conversation",J,"Unpinned"),d.command("read").description("Mark a conversation as read").argument("<conversationId>").option("--message <messageId>","Mark read up to this message (defaults to latest)").action(async(t,e)=>{try{await b$1(B,{conversationId:t,messageId:e.message}),i("Marked as read");}catch(i){g(i);}}),n("leave","Leave a conversation",q,"Left conversation");}function it(d){let o=d.command("invites").description("Invite link operations");o.command("create").description("Create an invite link for a conversation").argument("<conversationId>").option("--max-uses <n>","Maximum number of uses",n=>parseInt(n,10)).option("--expires-at <iso>","ISO expiry timestamp").option("-f, --format <format>").action(async(n,t)=>{try{let e={conversationId:n};t.maxUses!==void 0&&(e.maxUses=t.maxUses),t.expiresAt&&(e.expiresAt=t.expiresAt);let i$1=await b$1(W,{input:e});i("Invite link created"),h$1(t,i$1.createInviteLink);}catch(e){g(e);}}),o.command("join").description("Join a conversation via invite code").argument("<code>").action(async n=>{try{await b$1(z,{code:n}),i("Joined via invite link");}catch(t){g(t);}}),o.command("validate").description("Validate an invite code").argument("<code>").option("-f, --format <format>").action(async(n,t)=>{try{let e=await b$1(X,{code:n});h$1(t,e.validateInviteLink);}catch(e){g(e);}});}var at={id:"conversations",version:"1.0.0",displayName:"Conversations",dependsOn:["auth","workspaces"],register(d,o){a(o),Q(d);}},ut=at;export{ut as default};
@@ -0,0 +1,196 @@
1
+ 'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var u=class extends Error{exitCode;hint;constructor(o,n){super(o),this.name="CliUserError",this.exitCode=n?.exitCode??1,this.hint=n?.hint;}},h=class extends u{constructor(o,n){super(o,{exitCode:2,hint:n?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},E=class extends Error{cause;constructor(o,n){super(o),this.name="CliInternalError",this.cause=n;}};var x=null;function F(s){x=s;}function I(){if(!x)throw new E("vibecontrols module helpers used before setHelpersContext was called");return x}function Ge(){let s=I();if(!s.auth.isAuthenticated())throw new h(`Authentication required. Run \`${s.productName} auth login\`.`)}async function c(s,o){return Ge(),I().gql.workspace.request(s,o)}async function O(s,o){return I().gql.workspaceAuthOnly.request(s,o)}function a(s){let o=s instanceof Error?s.message:String(s);throw new u(o)}function p(s,o,n){I().output.formatAndOutput(s,o,n);}function l(s){I().output.printSuccess(s);}function d(s,o){return I().output.truncate(s,o)}var v=`
2
+ id firstName lastName email phone position department location type status
3
+ salary performanceScore managerId avatar startDate workspaceId
4
+ `,T=`
5
+ id firstName lastName email phone position experience currentCompany skills
6
+ source status rating resumeUrl notes appliedDate workspaceId
7
+ `,S=`
8
+ id title department description type experienceLevel location requirements
9
+ benefits salaryMin salaryMax applicants status postedDate deadline workspaceId
10
+ `,b=`
11
+ id employeeId employeeName department type reason startDate endDate days
12
+ status approverName workspaceId
13
+ `,R=`
14
+ id title content author authorRole category priority isPinned tags viewCount
15
+ createdAt workspaceId
16
+ `,U=`
17
+ id title message type category read actionUrl createdAt workspaceId
18
+ `,W=`
19
+ id name contactPerson email phone industry status projects revenue since workspaceId
20
+ `,B=`
21
+ id title description category level instructor duration modules enrolled
22
+ completed rating skills status thumbnail workspaceId
23
+ `,j=`
24
+ id name headId headName employeeCount budget location status workspaceId
25
+ `,G=`
26
+ id candidateId candidateName position type interviewerName date time status
27
+ rating feedback workspaceId
28
+ `,J=`
29
+ id number clientName amount status issueDate dueDate items workspaceId
30
+ `,V=`
31
+ id title description level duration courses enrolled completionRate workspaceId
32
+ `,H=`
33
+ id title description category provider price priceType deliveryTime rating
34
+ reviews skills status workspaceId
35
+ `,Y=`
36
+ id employeeId employeeName department period grossPay deductions netPay
37
+ status paymentMethod payDate workspaceId
38
+ `,K=`
39
+ id name description status priority progress budget spent startDate endDate
40
+ managerId managerName teamId teamName tasks completedTasks workspaceId
41
+ `,z=`
42
+ id name description department leadId leadName memberCount members
43
+ projectCount status createdAt workspaceId
44
+ `,Q=`
45
+ id employeeId employeeName date clockIn clockOut totalHours overtime project
46
+ status workspaceId
47
+ `,X=`
48
+ id name category contactPerson email phone contractValue rating status workspaceId
49
+ `,A=`
50
+ query CrewfoundryBootstrap {
51
+ crewfoundryBootstrap {
52
+ employees { ${v} }
53
+ candidates { ${T} }
54
+ jobPostings { ${S} }
55
+ leaveRequests { ${b} }
56
+ announcements { ${R} }
57
+ notifications { ${U} }
58
+ clients { ${W} }
59
+ courses { ${B} }
60
+ departments { ${j} }
61
+ interviews { ${G} }
62
+ invoices { ${J} }
63
+ learningPaths { ${V} }
64
+ marketplaceServices { ${H} }
65
+ payrollRecords { ${Y} }
66
+ projects { ${K} }
67
+ teams { ${z} }
68
+ timeEntries { ${Q} }
69
+ vendors { ${X} }
70
+ }
71
+ }
72
+ `,L=`
73
+ query CrewfoundryListEmployees {
74
+ crewfoundryBootstrap { employees { ${v} } }
75
+ }
76
+ `,N=`
77
+ query CrewfoundryListCandidates {
78
+ crewfoundryBootstrap { candidates { ${T} } }
79
+ }
80
+ `,D=`
81
+ query CrewfoundryListJobPostings {
82
+ crewfoundryBootstrap { jobPostings { ${S} } }
83
+ }
84
+ `,_=`
85
+ query CrewfoundryListLeaveRequests {
86
+ crewfoundryBootstrap { leaveRequests { ${b} } }
87
+ }
88
+ `,P=`
89
+ query CrewfoundryListAnnouncements {
90
+ crewfoundryBootstrap { announcements { ${R} } }
91
+ }
92
+ `,Z=`
93
+ query CrewfoundryListNotifications {
94
+ crewfoundryBootstrap { notifications { ${U} } }
95
+ }
96
+ `,ee=`
97
+ query CrewfoundryListClients {
98
+ crewfoundryBootstrap { clients { ${W} } }
99
+ }
100
+ `,te=`
101
+ query CrewfoundryListCourses {
102
+ crewfoundryBootstrap { courses { ${B} } }
103
+ }
104
+ `,ne=`
105
+ query CrewfoundryListDepartments {
106
+ crewfoundryBootstrap { departments { ${j} } }
107
+ }
108
+ `,re=`
109
+ query CrewfoundryListInterviews {
110
+ crewfoundryBootstrap { interviews { ${G} } }
111
+ }
112
+ `,oe=`
113
+ query CrewfoundryListInvoices {
114
+ crewfoundryBootstrap { invoices { ${J} } }
115
+ }
116
+ `,ie=`
117
+ query CrewfoundryListLearningPaths {
118
+ crewfoundryBootstrap { learningPaths { ${V} } }
119
+ }
120
+ `,se=`
121
+ query CrewfoundryListMarketplaceServices {
122
+ crewfoundryBootstrap { marketplaceServices { ${H} } }
123
+ }
124
+ `,ae=`
125
+ query CrewfoundryListPayrollRecords {
126
+ crewfoundryBootstrap { payrollRecords { ${Y} } }
127
+ }
128
+ `,pe=`
129
+ query CrewfoundryListProjects {
130
+ crewfoundryBootstrap { projects { ${K} } }
131
+ }
132
+ `,ce=`
133
+ query CrewfoundryListTeams {
134
+ crewfoundryBootstrap { teams { ${z} } }
135
+ }
136
+ `,ue=`
137
+ query CrewfoundryListTimeEntries {
138
+ crewfoundryBootstrap { timeEntries { ${Q} } }
139
+ }
140
+ `,de=`
141
+ query CrewfoundryListVendors {
142
+ crewfoundryBootstrap { vendors { ${X} } }
143
+ }
144
+ `,me=`
145
+ mutation CrewfoundryCreateEmployee($input: CreateCrewEmployeeInput!) {
146
+ createCrewEmployee(input: $input) { ${v} }
147
+ }
148
+ `,le=`
149
+ mutation CrewfoundryUpdateEmployee($id: ID!, $input: UpdateCrewEmployeeInput!) {
150
+ updateCrewEmployee(id: $id, input: $input) { ${v} }
151
+ }
152
+ `,fe=`
153
+ mutation CrewfoundryRemoveEmployee($id: ID!) {
154
+ removeCrewEmployee(id: $id)
155
+ }
156
+ `,ge=`
157
+ mutation CrewfoundryCreateCandidate($input: CreateCrewCandidateInput!) {
158
+ createCrewCandidate(input: $input) { ${T} }
159
+ }
160
+ `,ye=`
161
+ mutation CrewfoundryUpdateCandidate($id: ID!, $input: UpdateCrewCandidateInput!) {
162
+ updateCrewCandidate(id: $id, input: $input) { ${T} }
163
+ }
164
+ `,we=`
165
+ mutation CrewfoundryCreateJobPosting($input: CreateCrewJobPostingInput!) {
166
+ createCrewJobPosting(input: $input) { ${S} }
167
+ }
168
+ `,Ce=`
169
+ mutation CrewfoundryUpdateJobPosting($id: ID!, $input: UpdateCrewJobPostingInput!) {
170
+ updateCrewJobPosting(id: $id, input: $input) { ${S} }
171
+ }
172
+ `,Ee=`
173
+ mutation CrewfoundryCreateLeaveRequest($input: CreateCrewLeaveRequestInput!) {
174
+ createCrewLeaveRequest(input: $input) { ${b} }
175
+ }
176
+ `,he=`
177
+ mutation CrewfoundryUpdateLeaveRequest($id: ID!, $input: UpdateCrewLeaveRequestInput!) {
178
+ updateCrewLeaveRequest(id: $id, input: $input) { ${b} }
179
+ }
180
+ `,Ie=`
181
+ mutation CrewfoundryCreateAnnouncement($input: CreateCrewAnnouncementInput!) {
182
+ createCrewAnnouncement(input: $input) { ${R} }
183
+ }
184
+ `,ke=`
185
+ mutation CrewfoundryMarkNotificationRead($id: ID!) {
186
+ markCrewNotificationRead(id: $id)
187
+ }
188
+ `,ve=`
189
+ mutation CrewfoundryMarkAllNotificationsRead {
190
+ markAllCrewNotificationsRead
191
+ }
192
+ `,Te=`
193
+ query CrewfoundryHealth {
194
+ _empty
195
+ }
196
+ `;function y(s){let o=Number.parseInt(s,10);if(Number.isNaN(o))throw new u(`Expected an integer but got "${s}"`);return o}function g(s){let o=Number.parseFloat(s);if(Number.isNaN(o))throw new u(`Expected a number but got "${s}"`);return o}function w(s){return s.split(",").map(o=>o.trim()).filter(o=>o.length>0)}function Se(s){let o=s.command("employees").description("Crewfoundry employees");o.command("list").description("List employees").option("--department <d>","Filter by department").option("--status <s>","Filter by status").option("-f, --format <format>","Output format").action(async n=>{try{let e=(await c(L)).crewfoundryBootstrap.employees;n.department&&(e=e.filter(r=>r.department===n.department)),n.status&&(e=e.filter(r=>r.status===n.status)),p(n,e,{headers:["ID","Name","Email","Department","Position","Status"],rows:e.map(r=>[d(r.id,12),`${r.firstName} ${r.lastName}`,r.email,r.department,r.position,r.status])});}catch(t){a(t);}}),o.command("get").description("Get an employee by id").argument("<id>","Employee ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let r=(await c(L)).crewfoundryBootstrap.employees.find(f=>f.id===n);if(!r)throw new u(`Employee ${n} not found`);p(t,r);}catch(e){a(e);}}),o.command("create").description("Create an employee").requiredOption("--first-name <s>","First name").requiredOption("--last-name <s>","Last name").requiredOption("--email <s>","Email").requiredOption("--phone <s>","Phone").requiredOption("--position <s>","Position").requiredOption("--department <s>","Department").requiredOption("--location <s>","Location").requiredOption("--salary <n>","Salary",g).option("--type <s>","Employment type (e.g. full-time)","full-time").option("--status <s>","Status","active").option("--performance-score <n>","Performance score",g,0).option("--manager-id <id>","Manager ID").option("--avatar <url>","Avatar URL").option("--start-date <iso>","Start date (ISO)").option("-f, --format <format>","Output format").action(async n=>{try{let t={firstName:n.firstName,lastName:n.lastName,email:n.email,phone:n.phone,position:n.position,department:n.department,location:n.location,salary:n.salary,type:n.type??"full-time",status:n.status??"active",performanceScore:n.performanceScore??0,startDate:n.startDate??new Date().toISOString()};n.managerId&&(t.managerId=n.managerId),n.avatar&&(t.avatar=n.avatar);let e=await c(me,{input:t});l(`Employee created: ${e.createCrewEmployee.firstName} ${e.createCrewEmployee.lastName}`),p(n,e.createCrewEmployee);}catch(t){a(t);}}),o.command("update").description("Update an employee").argument("<id>","Employee ID").option("--first-name <s>","First name").option("--last-name <s>","Last name").option("--email <s>","Email").option("--phone <s>","Phone").option("--position <s>","Position").option("--department <s>","Department").option("--location <s>","Location").option("--salary <n>","Salary",g).option("--type <s>","Employment type").option("--status <s>","Status").option("--performance-score <n>","Performance score",g).option("--manager-id <id>","Manager ID").option("--avatar <url>","Avatar URL").option("--start-date <iso>","Start date (ISO)").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e={};if(t.firstName&&(e.firstName=t.firstName),t.lastName&&(e.lastName=t.lastName),t.email&&(e.email=t.email),t.phone&&(e.phone=t.phone),t.position&&(e.position=t.position),t.department&&(e.department=t.department),t.location&&(e.location=t.location),t.salary!==void 0&&(e.salary=t.salary),t.type&&(e.type=t.type),t.status&&(e.status=t.status),t.performanceScore!==void 0&&(e.performanceScore=t.performanceScore),t.managerId&&(e.managerId=t.managerId),t.avatar&&(e.avatar=t.avatar),t.startDate&&(e.startDate=t.startDate),!Object.keys(e).length)throw new u("No updates specified");let r=await c(le,{id:n,input:e});l("Employee updated"),p(t,r.updateCrewEmployee);}catch(e){a(e);}}),o.command("remove").description("Remove an employee").argument("<id>","Employee ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await c(fe,{id:n});if(!e.removeCrewEmployee)throw new u(`Employee ${n} could not be removed`);l(`Employee ${n} removed`),p(t,{removed:e.removeCrewEmployee});}catch(e){a(e);}});}function be(s){let o=s.command("candidates").description("Crewfoundry recruiting candidates");o.command("list").description("List candidates").option("--status <s>","Filter by status").option("--position <p>","Filter by position").option("-f, --format <format>","Output format").action(async n=>{try{let e=(await c(N)).crewfoundryBootstrap.candidates;n.status&&(e=e.filter(r=>r.status===n.status)),n.position&&(e=e.filter(r=>r.position===n.position)),p(n,e,{headers:["ID","Name","Position","Source","Status","Rating"],rows:e.map(r=>[d(r.id,12),`${r.firstName} ${r.lastName}`,r.position,r.source,r.status,String(r.rating)])});}catch(t){a(t);}}),o.command("get").description("Get a candidate by id").argument("<id>","Candidate ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let r=(await c(N)).crewfoundryBootstrap.candidates.find(f=>f.id===n);if(!r)throw new u(`Candidate ${n} not found`);p(t,r);}catch(e){a(e);}}),o.command("create").description("Create a candidate").requiredOption("--first-name <s>","First name").requiredOption("--last-name <s>","Last name").requiredOption("--email <s>","Email").requiredOption("--phone <s>","Phone").requiredOption("--position <s>","Position").requiredOption("--source <s>","Source").option("--experience <n>","Years of experience",y,0).option("--rating <n>","Rating",g,0).option("--status <s>","Status","new").option("--current-company <s>","Current company").option("--skills <csv>","Comma-separated skills").option("--resume-url <url>","Resume URL").option("--notes <s>","Notes").option("--applied-date <iso>","Applied date (ISO)").option("-f, --format <format>","Output format").action(async n=>{try{let t={firstName:n.firstName,lastName:n.lastName,email:n.email,phone:n.phone,position:n.position,source:n.source,experience:n.experience??0,rating:n.rating??0,status:n.status??"new",skills:n.skills?w(n.skills):[],appliedDate:n.appliedDate??new Date().toISOString()};n.currentCompany&&(t.currentCompany=n.currentCompany),n.resumeUrl&&(t.resumeUrl=n.resumeUrl),n.notes&&(t.notes=n.notes);let e=await c(ge,{input:t});l(`Candidate created: ${e.createCrewCandidate.firstName} ${e.createCrewCandidate.lastName}`),p(n,e.createCrewCandidate);}catch(t){a(t);}}),o.command("update").description("Update a candidate").argument("<id>","Candidate ID").option("--first-name <s>","First name").option("--last-name <s>","Last name").option("--email <s>","Email").option("--phone <s>","Phone").option("--position <s>","Position").option("--source <s>","Source").option("--experience <n>","Years of experience",y).option("--rating <n>","Rating",g).option("--status <s>","Status").option("--current-company <s>","Current company").option("--skills <csv>","Comma-separated skills").option("--resume-url <url>","Resume URL").option("--notes <s>","Notes").option("--applied-date <iso>","Applied date (ISO)").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e={};if(t.firstName&&(e.firstName=t.firstName),t.lastName&&(e.lastName=t.lastName),t.email&&(e.email=t.email),t.phone&&(e.phone=t.phone),t.position&&(e.position=t.position),t.source&&(e.source=t.source),t.experience!==void 0&&(e.experience=t.experience),t.rating!==void 0&&(e.rating=t.rating),t.status&&(e.status=t.status),t.currentCompany&&(e.currentCompany=t.currentCompany),t.skills&&(e.skills=w(t.skills)),t.resumeUrl&&(e.resumeUrl=t.resumeUrl),t.notes&&(e.notes=t.notes),t.appliedDate&&(e.appliedDate=t.appliedDate),!Object.keys(e).length)throw new u("No updates specified");let r=await c(ye,{id:n,input:e});l("Candidate updated"),p(t,r.updateCrewCandidate);}catch(e){a(e);}});}function xe(s){let o=s.command("job-postings").description("Crewfoundry job postings");o.command("list").description("List job postings").option("--department <d>","Filter by department").option("--status <s>","Filter by status").option("-f, --format <format>","Output format").action(async n=>{try{let e=(await c(D)).crewfoundryBootstrap.jobPostings;n.department&&(e=e.filter(r=>r.department===n.department)),n.status&&(e=e.filter(r=>r.status===n.status)),p(n,e,{headers:["ID","Title","Department","Type","Applicants","Status"],rows:e.map(r=>[d(r.id,12),r.title,r.department,r.type,String(r.applicants),r.status])});}catch(t){a(t);}}),o.command("get").description("Get a job posting by id").argument("<id>","Job posting ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let r=(await c(D)).crewfoundryBootstrap.jobPostings.find(f=>f.id===n);if(!r)throw new u(`Job posting ${n} not found`);p(t,r);}catch(e){a(e);}}),o.command("create").description("Create a job posting").requiredOption("--title <s>","Title").requiredOption("--department <s>","Department").requiredOption("--description <s>","Description").requiredOption("--experience-level <s>","Experience level").requiredOption("--location <s>","Location").requiredOption("--type <s>","Employment type (e.g. full-time)").option("--applicants <n>","Applicant count",y,0).option("--salary-min <n>","Minimum salary",g,0).option("--salary-max <n>","Maximum salary",g,0).option("--status <s>","Status","open").option("--requirements <csv>","Comma-separated requirements").option("--benefits <csv>","Comma-separated benefits").option("--posted-date <iso>","Posted date (ISO)").option("--deadline <iso>","Deadline (ISO)").option("-f, --format <format>","Output format").action(async n=>{try{let t={title:n.title,department:n.department,description:n.description,experienceLevel:n.experienceLevel,location:n.location,type:n.type,applicants:n.applicants??0,salaryMin:n.salaryMin??0,salaryMax:n.salaryMax??0,status:n.status??"open",requirements:n.requirements?w(n.requirements):[],benefits:n.benefits?w(n.benefits):[],postedDate:n.postedDate??new Date().toISOString()};n.deadline&&(t.deadline=n.deadline);let e=await c(we,{input:t});l(`Job posting created: ${e.createCrewJobPosting.title}`),p(n,e.createCrewJobPosting);}catch(t){a(t);}}),o.command("update").description("Update a job posting").argument("<id>","Job posting ID").option("--title <s>","Title").option("--department <s>","Department").option("--description <s>","Description").option("--experience-level <s>","Experience level").option("--location <s>","Location").option("--type <s>","Employment type").option("--applicants <n>","Applicant count",y).option("--salary-min <n>","Minimum salary",g).option("--salary-max <n>","Maximum salary",g).option("--status <s>","Status").option("--requirements <csv>","Comma-separated requirements").option("--benefits <csv>","Comma-separated benefits").option("--posted-date <iso>","Posted date (ISO)").option("--deadline <iso>","Deadline (ISO)").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e={};if(t.title&&(e.title=t.title),t.department&&(e.department=t.department),t.description&&(e.description=t.description),t.experienceLevel&&(e.experienceLevel=t.experienceLevel),t.location&&(e.location=t.location),t.type&&(e.type=t.type),t.applicants!==void 0&&(e.applicants=t.applicants),t.salaryMin!==void 0&&(e.salaryMin=t.salaryMin),t.salaryMax!==void 0&&(e.salaryMax=t.salaryMax),t.status&&(e.status=t.status),t.requirements&&(e.requirements=w(t.requirements)),t.benefits&&(e.benefits=w(t.benefits)),t.postedDate&&(e.postedDate=t.postedDate),t.deadline&&(e.deadline=t.deadline),!Object.keys(e).length)throw new u("No updates specified");let r=await c(Ce,{id:n,input:e});l("Job posting updated"),p(t,r.updateCrewJobPosting);}catch(e){a(e);}});}function Oe(s){let o=s.command("leave-requests").description("Crewfoundry leave requests");o.command("list").description("List leave requests").option("--employee <id>","Filter by employee ID").option("--status <s>","Filter by status").option("-f, --format <format>","Output format").action(async n=>{try{let e=(await c(_)).crewfoundryBootstrap.leaveRequests;n.employee&&(e=e.filter(r=>r.employeeId===n.employee)),n.status&&(e=e.filter(r=>r.status===n.status)),p(n,e,{headers:["ID","Employee","Type","Days","Status"],rows:e.map(r=>[d(r.id,12),r.employeeName,r.type,String(r.days),r.status])});}catch(t){a(t);}}),o.command("get").description("Get a leave request by id").argument("<id>","Leave request ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let r=(await c(_)).crewfoundryBootstrap.leaveRequests.find(f=>f.id===n);if(!r)throw new u(`Leave request ${n} not found`);p(t,r);}catch(e){a(e);}}),o.command("create").description("Create a leave request").requiredOption("--employee-id <id>","Employee ID").requiredOption("--employee-name <s>","Employee name").requiredOption("--department <s>","Department").requiredOption("--type <s>","Leave type").requiredOption("--reason <s>","Reason").requiredOption("--start-date <iso>","Start date (ISO)").requiredOption("--end-date <iso>","End date (ISO)").option("--days <n>","Number of days",y,1).option("--status <s>","Status","pending").option("--approver-name <s>","Approver name").option("-f, --format <format>","Output format").action(async n=>{try{let t={employeeId:n.employeeId,employeeName:n.employeeName,department:n.department,type:n.type,reason:n.reason,startDate:n.startDate,endDate:n.endDate,days:n.days??1,status:n.status??"pending"};n.approverName&&(t.approverName=n.approverName);let e=await c(Ee,{input:t});l(`Leave request created for ${e.createCrewLeaveRequest.employeeName}`),p(n,e.createCrewLeaveRequest);}catch(t){a(t);}}),o.command("update").description("Update a leave request").argument("<id>","Leave request ID").option("--employee-id <id>","Employee ID").option("--employee-name <s>","Employee name").option("--department <s>","Department").option("--type <s>","Leave type").option("--reason <s>","Reason").option("--start-date <iso>","Start date (ISO)").option("--end-date <iso>","End date (ISO)").option("--days <n>","Number of days",y).option("--status <s>","Status").option("--approver-name <s>","Approver name").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e={};if(t.employeeId&&(e.employeeId=t.employeeId),t.employeeName&&(e.employeeName=t.employeeName),t.department&&(e.department=t.department),t.type&&(e.type=t.type),t.reason&&(e.reason=t.reason),t.startDate&&(e.startDate=t.startDate),t.endDate&&(e.endDate=t.endDate),t.days!==void 0&&(e.days=t.days),t.status&&(e.status=t.status),t.approverName&&(e.approverName=t.approverName),!Object.keys(e).length)throw new u("No updates specified");let r=await c(he,{id:n,input:e});l("Leave request updated"),p(t,r.updateCrewLeaveRequest);}catch(e){a(e);}});}function Re(s){let o=s.command("announcements").description("Crewfoundry announcements");o.command("list").description("List announcements").option("--category <c>","Filter by category").option("--pinned-only","Only pinned announcements").option("-f, --format <format>","Output format").action(async n=>{try{let e=(await c(P)).crewfoundryBootstrap.announcements;n.category&&(e=e.filter(r=>r.category===n.category)),n.pinnedOnly&&(e=e.filter(r=>r.isPinned)),p(n,e,{headers:["ID","Title","Author","Category","Priority","Pinned"],rows:e.map(r=>[d(r.id,12),r.title,r.author,r.category,r.priority,r.isPinned?"yes":"no"])});}catch(t){a(t);}}),o.command("get").description("Get an announcement by id").argument("<id>","Announcement ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let r=(await c(P)).crewfoundryBootstrap.announcements.find(f=>f.id===n);if(!r)throw new u(`Announcement ${n} not found`);p(t,r);}catch(e){a(e);}}),o.command("create").description("Create an announcement").requiredOption("--title <s>","Title").requiredOption("--content <s>","Content").requiredOption("--author <s>","Author").requiredOption("--author-role <s>","Author role").requiredOption("--category <s>","Category").requiredOption("--priority <s>","Priority").option("--pinned","Pin the announcement").option("--view-count <n>","Initial view count",y,0).option("--tags <csv>","Comma-separated tags").option("--created-at <iso>","Created at (ISO)").option("-f, --format <format>","Output format").action(async n=>{try{let t={title:n.title,content:n.content,author:n.author,authorRole:n.authorRole,category:n.category,priority:n.priority,isPinned:n.pinned??!1,viewCount:n.viewCount??0,tags:n.tags?w(n.tags):[],createdAt:n.createdAt??new Date().toISOString()},e=await c(Ie,{input:t});l(`Announcement created: ${e.createCrewAnnouncement.title}`),p(n,e.createCrewAnnouncement);}catch(t){a(t);}});}function Ae(s){let o=s.command("notifications").description("Crewfoundry notifications");o.command("list").description("List notifications").option("--category <c>","Filter by category").option("--unread-only","Only unread notifications").option("-f, --format <format>","Output format").action(async n=>{try{let e=(await c(Z)).crewfoundryBootstrap.notifications;n.category&&(e=e.filter(r=>r.category===n.category)),n.unreadOnly&&(e=e.filter(r=>!r.read)),p(n,e,{headers:["ID","Title","Type","Category","Read"],rows:e.map(r=>[d(r.id,12),r.title,r.type,r.category,r.read?"yes":"no"])});}catch(t){a(t);}}),o.command("mark-read").description("Mark a notification as read").argument("<id>","Notification ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await c(ke,{id:n});if(!e.markCrewNotificationRead)throw new u(`Notification ${n} could not be marked read`);l(`Notification ${n} marked read`),p(t,{read:e.markCrewNotificationRead});}catch(e){a(e);}}),o.command("mark-all-read").description("Mark all notifications as read").option("-f, --format <format>","Output format").action(async n=>{try{let t=await c(ve);l("All notifications marked read"),p(n,{read:t.markAllCrewNotificationsRead});}catch(t){a(t);}});}function i(s){return s==null?"-":String(s)}function Le(s){let o=s.command("directory").description("Crewfoundry read-only collections (clients, projects, teams, finance, learning)"),n=async(t,e,r,f)=>{try{let q=(await c(t)).crewfoundryBootstrap[e];p(r,q,{headers:f.headers,rows:q.map(f.row)});}catch(k){a(k);}};o.command("clients").description("List clients").option("-f, --format <format>","Output format").action(t=>n(ee,"clients",t,{headers:["ID","Name","Industry","Status","Projects","Revenue"],row:e=>[d(e.id,12),i(e.name),i(e.industry),i(e.status),i(e.projects),i(e.revenue)]})),o.command("courses").description("List training courses").option("-f, --format <format>","Output format").action(t=>n(te,"courses",t,{headers:["ID","Title","Category","Level","Enrolled","Status"],row:e=>[d(e.id,12),i(e.title),i(e.category),i(e.level),i(e.enrolled),i(e.status)]})),o.command("departments").description("List departments").option("-f, --format <format>","Output format").action(t=>n(ne,"departments",t,{headers:["ID","Name","Head","Employees","Budget","Status"],row:e=>[d(e.id,12),i(e.name),i(e.headName),i(e.employeeCount),i(e.budget),i(e.status)]})),o.command("interviews").description("List interviews").option("-f, --format <format>","Output format").action(t=>n(re,"interviews",t,{headers:["ID","Candidate","Position","Type","Status","Interviewer"],row:e=>[d(e.id,12),i(e.candidateName),i(e.position),i(e.type),i(e.status),i(e.interviewerName)]})),o.command("invoices").description("List invoices").option("-f, --format <format>","Output format").action(t=>n(oe,"invoices",t,{headers:["ID","Number","Client","Amount","Status"],row:e=>[d(e.id,12),i(e.number),i(e.clientName),i(e.amount),i(e.status)]})),o.command("learning-paths").description("List learning paths").option("-f, --format <format>","Output format").action(t=>n(ie,"learningPaths",t,{headers:["ID","Title","Level","Enrolled","Completion %"],row:e=>[d(e.id,12),i(e.title),i(e.level),i(e.enrolled),i(e.completionRate)]})),o.command("marketplace-services").description("List marketplace services").option("-f, --format <format>","Output format").action(t=>n(se,"marketplaceServices",t,{headers:["ID","Title","Category","Provider","Price","Rating"],row:e=>[d(e.id,12),i(e.title),i(e.category),i(e.provider),i(e.price),i(e.rating)]})),o.command("payroll").description("List payroll records").option("-f, --format <format>","Output format").action(t=>n(ae,"payrollRecords",t,{headers:["ID","Employee","Period","Gross","Net","Status"],row:e=>[d(e.id,12),i(e.employeeName),i(e.period),i(e.grossPay),i(e.netPay),i(e.status)]})),o.command("projects").description("List projects").option("-f, --format <format>","Output format").action(t=>n(pe,"projects",t,{headers:["ID","Name","Status","Priority","Progress","Budget"],row:e=>[d(e.id,12),i(e.name),i(e.status),i(e.priority),i(e.progress),i(e.budget)]})),o.command("teams").description("List teams").option("-f, --format <format>","Output format").action(t=>n(ce,"teams",t,{headers:["ID","Name","Department","Lead","Members","Status"],row:e=>[d(e.id,12),i(e.name),i(e.department),i(e.leadName),i(e.memberCount),i(e.status)]})),o.command("time-entries").description("List time entries").option("-f, --format <format>","Output format").action(t=>n(ue,"timeEntries",t,{headers:["ID","Employee","Date","Hours","Overtime","Status"],row:e=>[d(e.id,12),i(e.employeeName),i(e.date),i(e.totalHours),i(e.overtime),i(e.status)]})),o.command("vendors").description("List vendors").option("-f, --format <format>","Output format").action(t=>n(de,"vendors",t,{headers:["ID","Name","Category","Contract Value","Rating","Status"],row:e=>[d(e.id,12),i(e.name),i(e.category),i(e.contractValue),i(e.rating),i(e.status)]}));}function Ne(s){let o=s.command("analytics").description("Crewfoundry analytics & bootstrap");o.command("bootstrap").description("Fetch the full Crewfoundry workspace snapshot (all collections)").option("-f, --format <format>","Output format").action(async n=>{try{let t=await c(A);p(n,t.crewfoundryBootstrap);}catch(t){a(t);}}),o.command("summary").description("Per-collection counts derived from the bootstrap snapshot").option("-f, --format <format>","Output format").action(async n=>{try{let e=(await c(A)).crewfoundryBootstrap,r={employees:e.employees.length,candidates:e.candidates.length,jobPostings:e.jobPostings.length,leaveRequests:e.leaveRequests.length,announcements:e.announcements.length,notifications:e.notifications.length,clients:e.clients.length,courses:e.courses.length,departments:e.departments.length,interviews:e.interviews.length,invoices:e.invoices.length,learningPaths:e.learningPaths.length,marketplaceServices:e.marketplaceServices.length,payrollRecords:e.payrollRecords.length,projects:e.projects.length,teams:e.teams.length,timeEntries:e.timeEntries.length,vendors:e.vendors.length};p(n,r,{headers:["Collection","Count"],rows:Object.entries(r).map(([f,k])=>[f,String(k)])});}catch(t){a(t);}}),s.command("health").description("Crewfoundry service health check (public)").option("-f, --format <format>","Output format").action(async n=>{try{let e=(await O(Te))._empty??"ok";l(`crewfoundry: ${e}`),p(n,{health:e});}catch(t){a(t);}});}var Je={id:"crewfoundry",version:"1.0.0",displayName:"Crewfoundry",dependsOn:["auth","workspaces"],register(s,o){F(o);let n=s.command("crewfoundry").description("Crewfoundry workforce & HR operations");Se(n),be(n),xe(n),Oe(n),Re(n),Ae(n),Le(n),Ne(n);}},Pn=Je;module.exports=Pn;
@@ -0,0 +1,7 @@
1
+ import { C as CliModule } from '../../module-DxCuik6L.cjs';
2
+ import 'commander';
3
+ import 'graphql-request';
4
+
5
+ declare const crewfoundryModule: CliModule;
6
+
7
+ export { crewfoundryModule as default };
@@ -0,0 +1,7 @@
1
+ import { C as CliModule } from '../../module-DxCuik6L.js';
2
+ import 'commander';
3
+ import 'graphql-request';
4
+
5
+ declare const crewfoundryModule: CliModule;
6
+
7
+ export { crewfoundryModule as default };