@burdenoff/cli-sdk 2026.1107.5 → 2026.1109.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.
- package/README.md +1 -1
- package/dist/{chunk-N5KCAJXG.js → chunk-6HSWVWQW.js} +3 -3
- package/dist/chunk-MT2F54AC.js +34 -0
- package/dist/chunk-WTNQ5PEC.js +1 -0
- package/dist/core/index.cjs +8 -8
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +1 -1
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{module-BwJmqefL.d.ts → module-CLaW1ycq.d.cts} +17 -1
- package/dist/{module-BwJmqefL.d.cts → module-CLaW1ycq.d.ts} +17 -1
- package/dist/modules/adaptercloud/index.cjs +8 -8
- package/dist/modules/adaptercloud/index.d.cts +1 -1
- package/dist/modules/adaptercloud/index.d.ts +1 -1
- package/dist/modules/adaptercloud/index.js +2 -2
- package/dist/modules/artistrybase/index.cjs +10 -10
- package/dist/modules/artistrybase/index.d.cts +1 -1
- package/dist/modules/artistrybase/index.d.ts +1 -1
- package/dist/modules/artistrybase/index.js +2 -2
- package/dist/modules/assethandler/index.cjs +6 -6
- package/dist/modules/assethandler/index.d.cts +1 -1
- package/dist/modules/assethandler/index.d.ts +1 -1
- package/dist/modules/assethandler/index.js +2 -2
- package/dist/modules/atheletebridge/index.cjs +8 -8
- package/dist/modules/atheletebridge/index.d.cts +1 -1
- package/dist/modules/atheletebridge/index.d.ts +1 -1
- package/dist/modules/atheletebridge/index.js +2 -2
- package/dist/modules/auth/index.cjs +5 -5
- package/dist/modules/auth/index.d.cts +1 -1
- package/dist/modules/auth/index.d.ts +1 -1
- package/dist/modules/auth/index.js +4 -4
- package/dist/modules/billing/index.cjs +5 -5
- package/dist/modules/billing/index.d.cts +1 -1
- package/dist/modules/billing/index.d.ts +1 -1
- package/dist/modules/billing/index.js +2 -2
- package/dist/modules/brainyrich/index.cjs +10 -10
- package/dist/modules/brainyrich/index.d.cts +1 -1
- package/dist/modules/brainyrich/index.d.ts +1 -1
- package/dist/modules/brainyrich/index.js +2 -2
- package/dist/modules/buildmyiq/index.cjs +6 -6
- package/dist/modules/buildmyiq/index.d.cts +1 -1
- package/dist/modules/buildmyiq/index.d.ts +1 -1
- package/dist/modules/buildmyiq/index.js +2 -2
- package/dist/modules/channels/index.cjs +11 -11
- package/dist/modules/channels/index.d.cts +1 -1
- package/dist/modules/channels/index.d.ts +1 -1
- package/dist/modules/channels/index.js +2 -2
- package/dist/modules/collabkin/index.cjs +7 -7
- package/dist/modules/collabkin/index.d.cts +1 -1
- package/dist/modules/collabkin/index.d.ts +1 -1
- package/dist/modules/collabkin/index.js +2 -2
- package/dist/modules/comradecircle/index.cjs +8 -8
- package/dist/modules/comradecircle/index.d.cts +1 -1
- package/dist/modules/comradecircle/index.d.ts +1 -1
- package/dist/modules/comradecircle/index.js +2 -2
- package/dist/modules/conversations/index.cjs +9 -9
- package/dist/modules/conversations/index.d.cts +1 -1
- package/dist/modules/conversations/index.d.ts +1 -1
- package/dist/modules/conversations/index.js +2 -2
- package/dist/modules/coolandlovely/index.cjs +7 -7
- package/dist/modules/coolandlovely/index.d.cts +1 -1
- package/dist/modules/coolandlovely/index.d.ts +1 -1
- package/dist/modules/coolandlovely/index.js +2 -2
- package/dist/modules/cosmicintersection/index.cjs +4 -4
- package/dist/modules/cosmicintersection/index.d.cts +1 -1
- package/dist/modules/cosmicintersection/index.d.ts +1 -1
- package/dist/modules/cosmicintersection/index.js +2 -2
- package/dist/modules/crewfoundry/index.cjs +19 -19
- package/dist/modules/crewfoundry/index.d.cts +1 -1
- package/dist/modules/crewfoundry/index.d.ts +1 -1
- package/dist/modules/crewfoundry/index.js +2 -2
- package/dist/modules/devportal/index.cjs +5 -5
- package/dist/modules/devportal/index.d.cts +1 -1
- package/dist/modules/devportal/index.d.ts +1 -1
- package/dist/modules/devportal/index.js +2 -2
- package/dist/modules/ecoimpacthub/index.cjs +7 -7
- package/dist/modules/ecoimpacthub/index.d.cts +1 -1
- package/dist/modules/ecoimpacthub/index.d.ts +1 -1
- package/dist/modules/ecoimpacthub/index.js +2 -2
- package/dist/modules/eventfullymanaged/index.cjs +24 -24
- package/dist/modules/eventfullymanaged/index.d.cts +1 -1
- package/dist/modules/eventfullymanaged/index.d.ts +1 -1
- package/dist/modules/eventfullymanaged/index.js +2 -2
- package/dist/modules/export/index.cjs +9 -9
- package/dist/modules/export/index.d.cts +1 -1
- package/dist/modules/export/index.d.ts +1 -1
- package/dist/modules/export/index.js +2 -2
- package/dist/modules/files/index.cjs +4 -4
- package/dist/modules/files/index.d.cts +1 -1
- package/dist/modules/files/index.d.ts +1 -1
- package/dist/modules/files/index.js +2 -2
- package/dist/modules/fluidgrids/index.cjs +8 -8
- package/dist/modules/fluidgrids/index.d.cts +1 -1
- package/dist/modules/fluidgrids/index.d.ts +1 -1
- package/dist/modules/fluidgrids/index.js +3 -3
- package/dist/modules/ggnomad/index.cjs +7 -7
- package/dist/modules/ggnomad/index.d.cts +1 -1
- package/dist/modules/ggnomad/index.d.ts +1 -1
- package/dist/modules/ggnomad/index.js +2 -2
- package/dist/modules/govcitizenhub/index.cjs +4 -4
- package/dist/modules/govcitizenhub/index.d.cts +1 -1
- package/dist/modules/govcitizenhub/index.d.ts +1 -1
- package/dist/modules/govcitizenhub/index.js +2 -2
- package/dist/modules/groups/index.cjs +8 -8
- package/dist/modules/groups/index.d.cts +1 -1
- package/dist/modules/groups/index.d.ts +1 -1
- package/dist/modules/groups/index.js +2 -2
- package/dist/modules/headshotmarketing/index.cjs +1 -1
- package/dist/modules/headshotmarketing/index.d.cts +1 -1
- package/dist/modules/headshotmarketing/index.d.ts +1 -1
- package/dist/modules/headshotmarketing/index.js +2 -2
- package/dist/modules/health/index.d.cts +1 -1
- package/dist/modules/health/index.d.ts +1 -1
- package/dist/modules/hookmovies/index.cjs +10 -10
- package/dist/modules/hookmovies/index.d.cts +1 -1
- package/dist/modules/hookmovies/index.d.ts +1 -1
- package/dist/modules/hookmovies/index.js +2 -2
- package/dist/modules/housingvista/index.cjs +8 -8
- package/dist/modules/housingvista/index.d.cts +1 -1
- package/dist/modules/housingvista/index.d.ts +1 -1
- package/dist/modules/housingvista/index.js +2 -2
- package/dist/modules/integrations/index.cjs +7 -7
- package/dist/modules/integrations/index.d.cts +1 -1
- package/dist/modules/integrations/index.d.ts +1 -1
- package/dist/modules/integrations/index.js +2 -2
- package/dist/modules/intelwatchtower/index.cjs +7 -7
- package/dist/modules/intelwatchtower/index.d.cts +1 -1
- package/dist/modules/intelwatchtower/index.d.ts +1 -1
- package/dist/modules/intelwatchtower/index.js +2 -2
- package/dist/modules/kadaikodi/index.cjs +6 -6
- package/dist/modules/kadaikodi/index.d.cts +1 -1
- package/dist/modules/kadaikodi/index.d.ts +1 -1
- package/dist/modules/kadaikodi/index.js +2 -2
- package/dist/modules/labsofscience/index.cjs +4 -4
- package/dist/modules/labsofscience/index.d.cts +1 -1
- package/dist/modules/labsofscience/index.d.ts +1 -1
- package/dist/modules/labsofscience/index.js +2 -2
- package/dist/modules/manufacturedops/index.cjs +3 -3
- package/dist/modules/manufacturedops/index.d.cts +1 -1
- package/dist/modules/manufacturedops/index.d.ts +1 -1
- package/dist/modules/manufacturedops/index.js +2 -2
- package/dist/modules/movethewheels/index.cjs +8 -8
- package/dist/modules/movethewheels/index.d.cts +1 -1
- package/dist/modules/movethewheels/index.d.ts +1 -1
- package/dist/modules/movethewheels/index.js +2 -2
- package/dist/modules/mybodyshield/index.cjs +5 -5
- package/dist/modules/mybodyshield/index.d.cts +1 -1
- package/dist/modules/mybodyshield/index.d.ts +1 -1
- package/dist/modules/mybodyshield/index.js +2 -2
- package/dist/modules/notifications/index.cjs +2 -2
- package/dist/modules/notifications/index.d.cts +1 -1
- package/dist/modules/notifications/index.d.ts +1 -1
- package/dist/modules/notifications/index.js +1 -1
- package/dist/modules/organizations/index.cjs +5 -5
- package/dist/modules/organizations/index.d.cts +1 -1
- package/dist/modules/organizations/index.d.ts +1 -1
- package/dist/modules/organizations/index.js +1 -1
- package/dist/modules/planmagnet/index.cjs +17 -17
- package/dist/modules/planmagnet/index.d.cts +1 -1
- package/dist/modules/planmagnet/index.d.ts +1 -1
- package/dist/modules/planmagnet/index.js +2 -2
- package/dist/modules/products/index.cjs +5 -5
- package/dist/modules/products/index.d.cts +1 -1
- package/dist/modules/products/index.d.ts +1 -1
- package/dist/modules/products/index.js +2 -2
- package/dist/modules/proserviceworld/index.cjs +6 -6
- package/dist/modules/proserviceworld/index.d.cts +1 -1
- package/dist/modules/proserviceworld/index.d.ts +1 -1
- package/dist/modules/proserviceworld/index.js +2 -2
- package/dist/modules/rbac/index.cjs +4 -4
- package/dist/modules/rbac/index.d.cts +1 -1
- package/dist/modules/rbac/index.d.ts +1 -1
- package/dist/modules/rbac/index.js +2 -2
- package/dist/modules/sandbox/index.cjs +11 -11
- package/dist/modules/sandbox/index.d.cts +1 -1
- package/dist/modules/sandbox/index.d.ts +1 -1
- package/dist/modules/sandbox/index.js +1 -1
- package/dist/modules/scheduler/index.cjs +14 -14
- package/dist/modules/scheduler/index.d.cts +1 -1
- package/dist/modules/scheduler/index.d.ts +1 -1
- package/dist/modules/scheduler/index.js +2 -2
- package/dist/modules/security/index.cjs +9 -9
- package/dist/modules/security/index.d.cts +1 -1
- package/dist/modules/security/index.d.ts +1 -1
- package/dist/modules/security/index.js +2 -2
- package/dist/modules/semanticfed/index.cjs +8 -8
- package/dist/modules/semanticfed/index.d.cts +1 -1
- package/dist/modules/semanticfed/index.d.ts +1 -1
- package/dist/modules/semanticfed/index.js +1 -1
- package/dist/modules/semanticfed-sql/index.cjs +4 -4
- package/dist/modules/semanticfed-sql/index.d.cts +1 -1
- package/dist/modules/semanticfed-sql/index.d.ts +1 -1
- package/dist/modules/semanticfed-sql/index.js +1 -1
- package/dist/modules/store/index.cjs +7 -7
- package/dist/modules/store/index.d.cts +1 -1
- package/dist/modules/store/index.d.ts +1 -1
- package/dist/modules/store/index.js +2 -2
- package/dist/modules/subscriberbot/index.cjs +1 -1
- package/dist/modules/subscriberbot/index.d.cts +1 -1
- package/dist/modules/subscriberbot/index.d.ts +1 -1
- package/dist/modules/subscriberbot/index.js +2 -2
- package/dist/modules/support/index.cjs +2 -2
- package/dist/modules/support/index.d.cts +1 -1
- package/dist/modules/support/index.d.ts +1 -1
- package/dist/modules/support/index.js +2 -2
- package/dist/modules/tags/index.cjs +7 -7
- package/dist/modules/tags/index.d.cts +1 -1
- package/dist/modules/tags/index.d.ts +1 -1
- package/dist/modules/tags/index.js +2 -2
- package/dist/modules/technospam/index.cjs +4 -4
- package/dist/modules/technospam/index.d.cts +1 -1
- package/dist/modules/technospam/index.d.ts +1 -1
- package/dist/modules/technospam/index.js +2 -2
- package/dist/modules/theculturepost/index.cjs +10 -10
- package/dist/modules/theculturepost/index.d.cts +1 -1
- package/dist/modules/theculturepost/index.d.ts +1 -1
- package/dist/modules/theculturepost/index.js +2 -2
- package/dist/modules/theglobalfuel/index.cjs +7 -7
- package/dist/modules/theglobalfuel/index.d.cts +1 -1
- package/dist/modules/theglobalfuel/index.d.ts +1 -1
- package/dist/modules/theglobalfuel/index.js +2 -2
- package/dist/modules/timecampus/index.cjs +8 -8
- package/dist/modules/timecampus/index.d.cts +1 -1
- package/dist/modules/timecampus/index.d.ts +1 -1
- package/dist/modules/timecampus/index.js +2 -2
- package/dist/modules/tours/index.cjs +3 -3
- package/dist/modules/tours/index.d.cts +1 -1
- package/dist/modules/tours/index.d.ts +1 -1
- package/dist/modules/tours/index.js +2 -2
- package/dist/modules/vibecontrols/index.cjs +27 -27
- package/dist/modules/vibecontrols/index.d.cts +1 -1
- package/dist/modules/vibecontrols/index.d.ts +1 -1
- package/dist/modules/vibecontrols/index.js +5 -5
- package/dist/modules/workspaces/index.cjs +6 -6
- package/dist/modules/workspaces/index.d.cts +1 -1
- package/dist/modules/workspaces/index.d.ts +1 -1
- package/dist/modules/workspaces/index.js +2 -2
- package/package.json +37 -28
- package/dist/chunk-2OISIPE6.js +0 -34
- package/dist/chunk-VL67DTWH.js +0 -1
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
items { id name slug tenantId organizationId }
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
`,variables:{limit:50}})});if(!s.ok){let t=await s.text().catch(()=>"Unknown error");throw new Error(`Failed to fetch workspaces (${s.status}): ${t}`)}let e=await s.json();if(e.errors?.length)throw new Error(`Failed to fetch workspaces: ${e.errors[0]?.message??"unknown error"}`);return e.data?.myWorkspaces?.items??[]}var u=class extends Error{exitCode;hint;constructor(i,o){super(i),this.name="CliUserError",this.exitCode=o?.exitCode??1,this.hint=o?.hint;}},k=class extends u{constructor(i,o){super(i,{exitCode:2,hint:o?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},m=class extends Error{cause;constructor(i,o){super(i),this.name="CliInternalError",this.cause=o;}};var A=null;function D(n){A=n;}function d(){if(!A)throw new m("vibecontrols module helpers used before setHelpersContext was called");return A}function se(){let n=d();if(!n.auth.isAuthenticated())throw new k("Authentication required.",{hint:`Run \`${n.productName} auth login\` to authenticate.`})}async function f(n,i){return se(),d().gql.workspace.request(n,i)}async function y(n,i){return d().gql.global.request(n,i)}function v(){d().gql.reset();}function c(n){let i=n instanceof Error?n.message:String(n);throw new u(i)}function l(n,i,o){d().output.formatAndOutput(n,i,o);}function g(n){d().output.printSuccess(n);}function
|
|
14
|
+
`,variables:{limit:50}})});if(!s.ok){let t=await s.text().catch(()=>"Unknown error");throw new Error(`Failed to fetch workspaces (${s.status}): ${t}`)}let e=await s.json();if(e.errors?.length)throw new Error(`Failed to fetch workspaces: ${e.errors[0]?.message??"unknown error"}`);return e.data?.myWorkspaces?.items??[]}var u=class extends Error{exitCode;hint;constructor(i,o){super(i),this.name="CliUserError",this.exitCode=o?.exitCode??1,this.hint=o?.hint;}},k=class extends u{constructor(i,o){super(i,{exitCode:2,hint:o?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},m=class extends Error{cause;constructor(i,o){super(i),this.name="CliInternalError",this.cause=o;}};var A=null;function D(n){A=n;}function d(){if(!A)throw new m("vibecontrols module helpers used before setHelpersContext was called");return A}function se(){let n=d();if(!n.auth.isAuthenticated())throw new k("Authentication required.",{hint:`Run \`${n.productName} auth login\` to authenticate.`})}async function f(n,i){return se(),d().gql.workspace.request(n,i)}async function y(n,i){return d().gql.global.request(n,i)}function v(){d().gql.reset();}function c(n){let i=n instanceof Error?n.message:String(n);throw new u(i)}function l(n,i,o){d().output.formatAndOutput(n,i,o);}function g(n){d().output.printSuccess(n);}function E(n){d().output.printInfo(n);}function b(n){d().output.printWarning(n);}function O(n){return d().output.formatStatus(n)}function R(n){return d().output.formatDate(n)}function x(n,i){return d().output.truncate(n,i)}function I(){return d()}function T(){return d().auth.read()}function S(n){d().auth.write(n);}function P(){return d().config.read()}function q(n){let i=n.command("workspace").description("Workspace context");i.command("current").description("Show current workspace").option("-f, --format <format>","Output format").action(o=>{let s=T(),e=s?.workspaceId??null;if(!e){E(`No workspace set. Run: ${I().productName} workspace set <id>`);return}l(o,{workspaceId:e,organizationId:s?.organizationId??"-",hasWorkspaceToken:!!s?.workspaceToken},{headers:["Key","Value"],rows:[["Workspace ID",e],["Organization ID",s?.organizationId??"-"],["Has Workspace Token",String(!!s?.workspaceToken)]]});}),i.command("set").description("Set workspace ID and issue workspace token").argument("<id>","Workspace ID").action(async o=>{try{let s=T();if(!s?.accessToken)throw new u(`Not authenticated. Run: ${I().productName} auth login`);let e=P(),t;E("Looking up workspace details...");try{let a=(await C(e.globalEndpoint,s.accessToken)).find(w=>w.id===o);a?t=a.organizationId:(b("Workspace not in your accessible list \u2014 using stored organization id as fallback"),t=s.organizationId);}catch{b("Could not fetch workspace details \u2014 using stored organization id"),t=s.organizationId;}if(s.accessToken&&t){E("Issuing workspace token...");try{let r=await h(e.workspaceEndpoint,s.accessToken,o,t);S({...s,workspaceId:o,organizationId:t,workspaceToken:r.token,workspaceTokenExpiresAt:new Date(r.expiresAt).getTime()}),v(),g(`Workspace set to: ${o} (token issued)`);return}catch(r){b(`Workspace token failed: ${r instanceof Error?r.message:String(r)}`);}}S({...s,workspaceId:o,organizationId:t}),v(),g(`Workspace set to: ${o}`);}catch(s){c(s);}}),i.command("list").description("List available workspaces").option("-f, --format <format>","Output format").action(async o=>{try{let s=T();if(!s?.accessToken)throw new u(`Not authenticated. Run: ${I().productName} auth login`);let e=P(),t=await C(e.globalEndpoint,s.accessToken);l(o,t,{headers:["ID","Name","Slug","Organization ID"],rows:t.map(r=>[r.id,r.name,r.slug,r.organizationId])});}catch(s){c(s);}});}var _=`
|
|
15
15
|
query GetWorkspace($id: ID!) {
|
|
16
16
|
workspace(id: $id) {
|
|
17
17
|
id name slug type tenantId organizationId region status memberCount createdAt updatedAt
|
|
@@ -40,23 +40,23 @@
|
|
|
40
40
|
total hasMore
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
`,
|
|
43
|
+
`,G=`
|
|
44
44
|
mutation AddWorkspaceMember($input: AddWorkspaceMemberInput!) {
|
|
45
45
|
addWorkspaceMember(input: $input) {
|
|
46
46
|
id userId role status
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
`,
|
|
49
|
+
`,F=`
|
|
50
50
|
mutation RemoveWorkspaceMember($id: ID!) {
|
|
51
51
|
removeWorkspaceMember(id: $id)
|
|
52
52
|
}
|
|
53
|
-
`,
|
|
53
|
+
`,U=`
|
|
54
54
|
mutation UpdateWorkspaceMemberRoles($input: UpdateWorkspaceMemberRolesInput!) {
|
|
55
55
|
updateWorkspaceMemberRoles(input: $input) {
|
|
56
56
|
id userId role
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
`,
|
|
59
|
+
`,z=`
|
|
60
60
|
query ListProjects($filter: ProjectFilterInput, $pagination: PaginationInput) {
|
|
61
61
|
projects(filter: $filter, pagination: $pagination) {
|
|
62
62
|
items { id name workspaceId status createdAt }
|
|
@@ -87,4 +87,4 @@
|
|
|
87
87
|
id action userId actorType resourceType resourceId description timestamp
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
`;function ce(n,i){let o;try{o=JSON.parse(i);}catch{throw new u(`${n} must be valid JSON`)}if(!o||typeof o!="object"||Array.isArray(o))throw new u(`${n} must be a JSON object`);return o}function H(n){n.command("get").description("Get a workspace by id").argument("<id>").option("-f, --format <format>").action(async(e,t)=>{try{let r=await y(_,{id:e});if(!r.workspace)throw new u(`Workspace ${e} not found`);l(t,r.workspace);}catch(r){c(r);}}),n.command("create").description("Create a workspace (global layer)").requiredOption("--name <name>").requiredOption("--slug <slug>","URL-safe workspace identifier").option("--tenant <id>","Target tenant id (defaults to the organization tenant)").option("--organization <id>","Owning organization id").option("-f, --format <format>").action(async e=>{try{let t={name:e.name,tenantId:e.tenant,organizationId:e.organization,slug:e.slug},r=await y(L,{input:t});g(`Workspace created: ${r.createWorkspace.name}`),l(e,r.createWorkspace);}catch(t){c(t);}}),n.command("update").description("Update a workspace").argument("<id>").option("--name <s>").option("--metadata <json>","Replace the workspace metadata (JSON object)").option("-f, --format <format>").action(async(e,t)=>{try{let r={};if(t.name&&(r.name=t.name),t.metadata!==void 0&&(r.metadata=ce("--metadata",t.metadata)),!Object.keys(r).length)throw new u("No updates specified");let a=await y(M,{id:e,input:r});g("Workspace updated"),l(t,a.updateWorkspace);}catch(r){c(r);}}),n.command("delete").description("Delete a workspace (workspace layer)").argument("<id>").action(async e=>{try{await f(j,{id:e}),g("Workspace deleted");}catch(t){c(t);}});let i=n.command("members").description("Workspace member management");i.command("list").description("List members of a workspace").requiredOption("--workspace <id>").option("--limit <n>","Page size",e=>parseInt(e,10),100).option("-f, --format <format>").action(async e=>{try{let t=await f(N,{workspaceId:e.workspace,pagination:{limit:e.limit,offset:0}});l(e,t.workspaceMembers.items,{headers:["ID","UserID","Role","Status","Joined"],rows:t.workspaceMembers.items.map(r=>[x(r.id,12),x(r.userId,12),r.role??"-",O(r.status),R(r.createdAt)])});}catch(t){c(t);}}),i.command("add").description("Add a member to a workspace").requiredOption("--workspace <id>").requiredOption("--user <userId>").option("--role <r>","MEMBER|ADMIN|OWNER","MEMBER").option("-f, --format <format>").action(async e=>{try{let t={workspaceId:e.workspace,userId:e.user,role:(e.role??"MEMBER").toUpperCase()},r=await f(
|
|
90
|
+
`;function ce(n,i){let o;try{o=JSON.parse(i);}catch{throw new u(`${n} must be valid JSON`)}if(!o||typeof o!="object"||Array.isArray(o))throw new u(`${n} must be a JSON object`);return o}function H(n){n.command("get").description("Get a workspace by id").argument("<id>").option("-f, --format <format>").action(async(e,t)=>{try{let r=await y(_,{id:e});if(!r.workspace)throw new u(`Workspace ${e} not found`);l(t,r.workspace);}catch(r){c(r);}}),n.command("create").description("Create a workspace (global layer)").requiredOption("--name <name>").requiredOption("--slug <slug>","URL-safe workspace identifier").option("--tenant <id>","Target tenant id (defaults to the organization tenant)").option("--organization <id>","Owning organization id").option("-f, --format <format>").action(async e=>{try{let t={name:e.name,tenantId:e.tenant,organizationId:e.organization,slug:e.slug},r=await y(L,{input:t});g(`Workspace created: ${r.createWorkspace.name}`),l(e,r.createWorkspace);}catch(t){c(t);}}),n.command("update").description("Update a workspace").argument("<id>").option("--name <s>").option("--metadata <json>","Replace the workspace metadata (JSON object)").option("-f, --format <format>").action(async(e,t)=>{try{let r={};if(t.name&&(r.name=t.name),t.metadata!==void 0&&(r.metadata=ce("--metadata",t.metadata)),!Object.keys(r).length)throw new u("No updates specified");let a=await y(M,{id:e,input:r});g("Workspace updated"),l(t,a.updateWorkspace);}catch(r){c(r);}}),n.command("delete").description("Delete a workspace (workspace layer)").argument("<id>").action(async e=>{try{await f(j,{id:e}),g("Workspace deleted");}catch(t){c(t);}});let i=n.command("members").description("Workspace member management");i.command("list").description("List members of a workspace").requiredOption("--workspace <id>").option("--limit <n>","Page size",e=>parseInt(e,10),100).option("-f, --format <format>").action(async e=>{try{let t=await f(N,{workspaceId:e.workspace,pagination:{limit:e.limit,offset:0}});l(e,t.workspaceMembers.items,{headers:["ID","UserID","Role","Status","Joined"],rows:t.workspaceMembers.items.map(r=>[x(r.id,12),x(r.userId,12),r.role??"-",O(r.status),R(r.createdAt)])});}catch(t){c(t);}}),i.command("add").description("Add a member to a workspace").requiredOption("--workspace <id>").requiredOption("--user <userId>").option("--role <r>","MEMBER|ADMIN|OWNER","MEMBER").option("-f, --format <format>").action(async e=>{try{let t={workspaceId:e.workspace,userId:e.user,role:(e.role??"MEMBER").toUpperCase()},r=await f(G,{input:t});g("Member added"),l(e,r.addWorkspaceMember);}catch(t){c(t);}}),i.command("remove").description("Remove a member by membership id").argument("<membershipId>").action(async e=>{try{await f(F,{id:e}),g("Member removed");}catch(t){c(t);}}),i.command("role").description("Update member role").requiredOption("--workspace <id>").requiredOption("--user <userId>").requiredOption("--role <r>").action(async e=>{try{let t={workspaceId:e.workspace,userId:e.user,roles:[e.role.toUpperCase()]};await f(U,{input:t}),g("Member role updated");}catch(t){c(t);}});let o=n.command("projects").description("Workspace projects");o.command("list").description("List projects").option("--workspace <id>").option("--limit <n>","Page size",e=>parseInt(e,10),100).option("-f, --format <format>").action(async e=>{try{let t={};e.workspace&&(t.workspaceId=e.workspace);let r=await f(z,{filter:Object.keys(t).length?t:void 0,pagination:{limit:e.limit,offset:0}});l(e,r.projects.items,{headers:["ID","Name","Workspace","Status","Created"],rows:r.projects.items.map(a=>[x(a.id,12),a.name,x(a.workspaceId,12),O(a.status),R(a.createdAt)])});}catch(t){c(t);}}),o.command("get").description("Get a project").argument("<id>").option("-f, --format <format>").action(async(e,t)=>{try{let r=await f(B,{id:e});if(!r.project)throw new u(`Project ${e} not found`);l(t,r.project);}catch(r){c(r);}}),o.command("create").description("Create a project").requiredOption("--workspace <id>").requiredOption("--name <name>").option("--description <s>").option("-f, --format <format>").action(async e=>{try{let t={workspaceId:e.workspace,name:e.name,description:e.description},r=await f(K,{input:t});g("Project created"),l(e,r.createProject);}catch(t){c(t);}}),n.command("invite").description("Workspace invitations").command("accept").description("Accept a workspace invitation").argument("<invitationId>").action(async e=>{try{await f(V,{id:e}),g("Invitation accepted");}catch(t){c(t);}}),n.command("activity").description("Workspace activity log").requiredOption("--workspace <id>").option("--limit <n>","Page size",e=>parseInt(e,10),100).option("-f, --format <format>").action(async e=>{try{let t=await f(J,{workspaceId:e.workspace,limit:e.limit,offset:0});l(e,t.getWorkspaceActivities);}catch(t){c(t);}});}var ue={id:"workspaces",version:"1.0.0",displayName:"Workspaces",dependsOn:["auth"],register(n,i){D(i),q(n);let o=n.commands.find(s=>s.name()==="workspace");if(!o)throw new m("workspace command group missing after registerWorkspaceCommands");H(o);}},Pt=ue;module.exports=Pt;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a,v as v$1,m,u,i,y,n,w,f,k,h as h$1,c,b,r,p,q as q$2}from'../../chunk-
|
|
1
|
+
import {a,v as v$1,m,u,i,y,n,w,f,k,h as h$1,c,b,r,p,q as q$2}from'../../chunk-WTNQ5PEC.js';import {s,q as q$1,h,g}from'../../chunk-MT2F54AC.js';function P(i$1){let c=i$1.command("workspace").description("Workspace context");c.command("current").description("Show current workspace").option("-f, --format <format>","Output format").action(a=>{let r=v$1(),t=r?.workspaceId??null;if(!t){m(`No workspace set. Run: ${u().productName} workspace set <id>`);return}i(a,{workspaceId:t,organizationId:r?.organizationId??"-",hasWorkspaceToken:!!r?.workspaceToken},{headers:["Key","Value"],rows:[["Workspace ID",t],["Organization ID",r?.organizationId??"-"],["Has Workspace Token",String(!!r?.workspaceToken)]]});}),c.command("set").description("Set workspace ID and issue workspace token").argument("<id>","Workspace ID").action(async a=>{try{let r=v$1();if(!r?.accessToken)throw new q$1(`Not authenticated. Run: ${u().productName} auth login`);let t=y(),e;m("Looking up workspace details...");try{let m=(await h(t.globalEndpoint,r.accessToken)).find(J=>J.id===a);m?e=m.organizationId:(n("Workspace not in your accessible list \u2014 using stored organization id as fallback"),e=r.organizationId);}catch{n("Could not fetch workspace details \u2014 using stored organization id"),e=r.organizationId;}if(r.accessToken&&e){m("Issuing workspace token...");try{let o=await g(t.workspaceEndpoint,r.accessToken,a,e);w({...r,workspaceId:a,organizationId:e,workspaceToken:o.token,workspaceTokenExpiresAt:new Date(o.expiresAt).getTime()}),f(),k(`Workspace set to: ${a} (token issued)`);return}catch(o){n(`Workspace token failed: ${o instanceof Error?o.message:String(o)}`);}}w({...r,workspaceId:a,organizationId:e}),f(),k(`Workspace set to: ${a}`);}catch(r){h$1(r);}}),c.command("list").description("List available workspaces").option("-f, --format <format>","Output format").action(async a=>{try{let r=v$1();if(!r?.accessToken)throw new q$1(`Not authenticated. Run: ${u().productName} auth login`);let t=y(),e=await h(t.globalEndpoint,r.accessToken);i(a,e,{headers:["ID","Name","Slug","Organization ID"],rows:e.map(o=>[o.id,o.name,o.slug,o.organizationId])});}catch(r){h$1(r);}});}var $=`
|
|
2
2
|
query GetWorkspace($id: ID!) {
|
|
3
3
|
workspace(id: $id) {
|
|
4
4
|
id name slug type tenantId organizationId region status memberCount createdAt updatedAt
|
|
@@ -74,4 +74,4 @@ import {a,v as v$1,m,u,i,y,n,w,f,k,h as h$1,c,b,r,p,q as q$2}from'../../chunk-VL
|
|
|
74
74
|
id action userId actorType resourceType resourceId description timestamp
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
`;function G(i,c){let a;try{a=JSON.parse(c);}catch{throw new
|
|
77
|
+
`;function G(i,c){let a;try{a=JSON.parse(c);}catch{throw new q$1(`${i} must be valid JSON`)}if(!a||typeof a!="object"||Array.isArray(a))throw new q$1(`${i} must be a JSON object`);return a}function B(i$1){i$1.command("get").description("Get a workspace by id").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let o=await c($,{id:t});if(!o.workspace)throw new q$1(`Workspace ${t} not found`);i(e,o.workspace);}catch(o){h$1(o);}}),i$1.command("create").description("Create a workspace (global layer)").requiredOption("--name <name>").requiredOption("--slug <slug>","URL-safe workspace identifier").option("--tenant <id>","Target tenant id (defaults to the organization tenant)").option("--organization <id>","Owning organization id").option("-f, --format <format>").action(async t=>{try{let e={name:t.name,tenantId:t.tenant,organizationId:t.organization,slug:t.slug},o=await c(S,{input:e});k(`Workspace created: ${o.createWorkspace.name}`),i(t,o.createWorkspace);}catch(e){h$1(e);}}),i$1.command("update").description("Update a workspace").argument("<id>").option("--name <s>").option("--metadata <json>","Replace the workspace metadata (JSON object)").option("-f, --format <format>").action(async(t,e)=>{try{let o={};if(e.name&&(o.name=e.name),e.metadata!==void 0&&(o.metadata=G("--metadata",e.metadata)),!Object.keys(o).length)throw new q$1("No updates specified");let m=await c(j,{id:t,input:o});k("Workspace updated"),i(e,m.updateWorkspace);}catch(o){h$1(o);}}),i$1.command("delete").description("Delete a workspace (workspace layer)").argument("<id>").action(async t=>{try{await b(_,{id:t}),k("Workspace deleted");}catch(e){h$1(e);}});let c$1=i$1.command("members").description("Workspace member management");c$1.command("list").description("List members of a workspace").requiredOption("--workspace <id>").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async t=>{try{let e=await b(D,{workspaceId:t.workspace,pagination:{limit:t.limit,offset:0}});i(t,e.workspaceMembers.items,{headers:["ID","UserID","Role","Status","Joined"],rows:e.workspaceMembers.items.map(o=>[r(o.id,12),r(o.userId,12),o.role??"-",p(o.status),q$2(o.createdAt)])});}catch(e){h$1(e);}}),c$1.command("add").description("Add a member to a workspace").requiredOption("--workspace <id>").requiredOption("--user <userId>").option("--role <r>","MEMBER|ADMIN|OWNER","MEMBER").option("-f, --format <format>").action(async t=>{try{let e={workspaceId:t.workspace,userId:t.user,role:(t.role??"MEMBER").toUpperCase()},o=await b(x,{input:e});k("Member added"),i(t,o.addWorkspaceMember);}catch(e){h$1(e);}}),c$1.command("remove").description("Remove a member by membership id").argument("<membershipId>").action(async t=>{try{await b(v,{id:t}),k("Member removed");}catch(e){h$1(e);}}),c$1.command("role").description("Update member role").requiredOption("--workspace <id>").requiredOption("--user <userId>").requiredOption("--role <r>").action(async t=>{try{let e={workspaceId:t.workspace,userId:t.user,roles:[t.role.toUpperCase()]};await b(z,{input:e}),k("Member role updated");}catch(e){h$1(e);}});let a=i$1.command("projects").description("Workspace projects");a.command("list").description("List projects").option("--workspace <id>").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async t=>{try{let e={};t.workspace&&(e.workspaceId=t.workspace);let o=await b(N,{filter:Object.keys(e).length?e:void 0,pagination:{limit:t.limit,offset:0}});i(t,o.projects.items,{headers:["ID","Name","Workspace","Status","Created"],rows:o.projects.items.map(m=>[r(m.id,12),m.name,r(m.workspaceId,12),p(m.status),q$2(m.createdAt)])});}catch(e){h$1(e);}}),a.command("get").description("Get a project").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let o=await b(K,{id:t});if(!o.project)throw new q$1(`Project ${t} not found`);i(e,o.project);}catch(o){h$1(o);}}),a.command("create").description("Create a project").requiredOption("--workspace <id>").requiredOption("--name <name>").option("--description <s>").option("-f, --format <format>").action(async t=>{try{let e={workspaceId:t.workspace,name:t.name,description:t.description},o=await b(L,{input:e});k("Project created"),i(t,o.createProject);}catch(e){h$1(e);}}),i$1.command("invite").description("Workspace invitations").command("accept").description("Accept a workspace invitation").argument("<invitationId>").action(async t=>{try{await b(q,{id:t}),k("Invitation accepted");}catch(e){h$1(e);}}),i$1.command("activity").description("Workspace activity log").requiredOption("--workspace <id>").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async t=>{try{let e=await b(U,{workspaceId:t.workspace,limit:t.limit,offset:0});i(t,e.getWorkspaceActivities);}catch(e){h$1(e);}});}var H={id:"workspaces",version:"1.0.0",displayName:"Workspaces",dependsOn:["auth"],register(i,c){a(c),P(i);let a$1=i.commands.find(r=>r.name()==="workspace");if(!a$1)throw new s("workspace command group missing after registerWorkspaceCommands");B(a$1);}},ut=H;export{ut as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@burdenoff/cli-sdk",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.1109.1",
|
|
4
4
|
"description": "Modular CLI SDK shared across all Burdenoff product CLIs (vibecontrols, botlit, fluidgrids, bigconsole, healthybowl, devportal, workspaces). Each module exports CliModule contract; product CLIs become thin shells that pick which modules to mount.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -31,18 +31,19 @@
|
|
|
31
31
|
"scripts": {
|
|
32
32
|
"dev": "TSUP_DEV=1 tsup --watch",
|
|
33
33
|
"build": "NODE_OPTIONS=--max-old-space-size=6144 tsup",
|
|
34
|
-
"
|
|
35
|
-
"lint": "eslint
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"test": "
|
|
41
|
-
"test:watch": "vitest",
|
|
42
|
-
"test:coverage": "bash scripts/build-limits.sh vitest run --coverage",
|
|
34
|
+
"lint": "eslint .",
|
|
35
|
+
"lint:check": "eslint .",
|
|
36
|
+
"format": "bun fmt src tests scripts",
|
|
37
|
+
"format:check": "bun fmt --check src tests scripts",
|
|
38
|
+
"test": "bun test",
|
|
39
|
+
"test:watch": "bun test --watch",
|
|
40
|
+
"test:coverage": "boff coverage-gate --run-tests",
|
|
43
41
|
"clean": "rimraf dist .eslintcache",
|
|
44
|
-
"sanity": "
|
|
45
|
-
"prepublishOnly": "bun run clean && bun run build"
|
|
42
|
+
"sanity": "boff sanity",
|
|
43
|
+
"prepublishOnly": "bun run clean && bun run build",
|
|
44
|
+
"type:check": "boff gate -- bun check --no-pretty",
|
|
45
|
+
"sanity:force": "boff sanity --force",
|
|
46
|
+
"audit": "bun audit --audit-level=high"
|
|
46
47
|
},
|
|
47
48
|
"keywords": [
|
|
48
49
|
"burdenoff",
|
|
@@ -60,7 +61,7 @@
|
|
|
60
61
|
"license": "UNLICENSED",
|
|
61
62
|
"repository": {
|
|
62
63
|
"type": "git",
|
|
63
|
-
"url": "git+https://github.com/
|
|
64
|
+
"url": "git+https://github.com/Algoshred/cli-sdk.git"
|
|
64
65
|
},
|
|
65
66
|
"bugs": {
|
|
66
67
|
"url": "https://github.com/algoshred/cli-sdk/issues"
|
|
@@ -79,26 +80,34 @@
|
|
|
79
80
|
"graphql-request": "^7.0.0"
|
|
80
81
|
},
|
|
81
82
|
"devDependencies": {
|
|
82
|
-
"@
|
|
83
|
-
"@
|
|
84
|
-
"@
|
|
85
|
-
"@vitest/coverage-v8": "^3.2.4",
|
|
83
|
+
"@burdenoff/toolchain": "2026.1107.14",
|
|
84
|
+
"@types/bun": "^1.4.4",
|
|
85
|
+
"@types/node": "^24.19.2",
|
|
86
86
|
"commander": "^14.0.3",
|
|
87
|
-
"eslint": "^9.39.
|
|
88
|
-
"
|
|
89
|
-
"eslint-plugin-prettier": "^5.5.5",
|
|
90
|
-
"globals": "^16.5.0",
|
|
91
|
-
"graphql": "^16.13.2",
|
|
87
|
+
"eslint": "^9.39.5",
|
|
88
|
+
"graphql": "^16.15.0",
|
|
92
89
|
"graphql-request": "^7.4.0",
|
|
93
|
-
"
|
|
94
|
-
"rimraf": "^6.1.3",
|
|
90
|
+
"rimraf": "^6.1.4",
|
|
95
91
|
"tsup": "^8.5.1",
|
|
96
|
-
"
|
|
97
|
-
"typescript": "^5.9.3",
|
|
98
|
-
"vitest": "^3.2.4"
|
|
92
|
+
"typescript": "^5.9.3"
|
|
99
93
|
},
|
|
100
94
|
"engines": {
|
|
101
95
|
"node": ">=24.11.0",
|
|
102
|
-
"bun": ">=1.
|
|
96
|
+
"bun": ">=1.4.4"
|
|
97
|
+
},
|
|
98
|
+
"packageManager": "bun@1.4.4",
|
|
99
|
+
"boff": {
|
|
100
|
+
"type": "cli",
|
|
101
|
+
"sanity": {
|
|
102
|
+
"formatPaths": [
|
|
103
|
+
"src",
|
|
104
|
+
"tests",
|
|
105
|
+
"scripts"
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
"coverage": {
|
|
109
|
+
"global": 90,
|
|
110
|
+
"diff": 80
|
|
111
|
+
}
|
|
103
112
|
}
|
|
104
113
|
}
|
package/dist/chunk-2OISIPE6.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import {existsSync,readFileSync,writeFileSync,chmodSync,unlinkSync,mkdirSync}from'fs';import {join}from'path';import {homedir}from'os';import {GraphQLClient}from'graphql-request';import x from'cross-fetch';import {Command}from'commander';var W=300*1e3;function O(e){let n=join(e,"auth.json");function r(){existsSync(e)||mkdirSync(e,{recursive:true,mode:448});}function t(){try{if(!existsSync(n))return null;let a=readFileSync(n,"utf8");return JSON.parse(a)}catch{return null}}function i(a){r(),writeFileSync(n,JSON.stringify(a,null,2),{encoding:"utf8",mode:384});try{chmodSync(n,384);}catch{}}function s(){try{existsSync(n)&&unlinkSync(n);}catch{}}function o(){let a=t();return a?.expiresAt?Date.now()>=a.expiresAt:false}function u(){let a=t();return a?.expiresAt?Date.now()+W>=a.expiresAt:false}function l(){let a=t();return a?.workspaceTokenExpiresAt?Date.now()>=a.workspaceTokenExpiresAt:false}function m(){let a=t();return a?.workspaceTokenExpiresAt?Date.now()+W>=a.workspaceTokenExpiresAt:false}function y(){return t()?.accessToken?!o():false}return {read:t,write:i,clear:s,isTokenExpired:o,isTokenExpiringSoon:u,isWorkspaceTokenExpired:l,isWorkspaceTokenExpiringSoon:m,isAuthenticated:y}}var ce=["workspaceEndpoint","globalEndpoint","oidcIssuer","clientId","defaultFormat","verbose","authServiceEndpoint","productOrigin"];function S(e){let n=join(homedir(),".config",e.configDirName),r=join(n,"config.json"),t={workspaceEndpoint:e.workspaceEndpointDefault,globalEndpoint:e.globalEndpointDefault};function i(){existsSync(n)||mkdirSync(n,{recursive:true,mode:448});}function s(c){if(e.envPrefix){let d=process.env[`${e.envPrefix}_${c}`];if(d)return d}let p=process.env[c];return p&&p.length>0?p:void 0}function o(c){if(!e.envPrefix)return;let p=process.env[`${e.envPrefix}_${c}`];return p&&p.length>0?p:void 0}function u(){let c={};try{existsSync(r)&&(c=JSON.parse(readFileSync(r,"utf8")));}catch{}return {...t,...c,workspaceEndpoint:s("WORKSPACE_ENDPOINT")??c.workspaceEndpoint??t.workspaceEndpoint,globalEndpoint:s("GLOBAL_ENDPOINT")??c.globalEndpoint??t.globalEndpoint,oidcIssuer:s("OIDC_ISSUER")??c.oidcIssuer,clientId:s("CLIENT_ID")??c.clientId,productOrigin:o("ORIGIN")??c.productOrigin}}function l(c){i(),writeFileSync(r,JSON.stringify(c,null,2),{encoding:"utf8"});try{chmodSync(r,384);}catch{}}function m(c){return u()[c]}function y(c,p){let d=u();d[c]=p,l(d);}function a(){let c=u(),p=c.clientId||e.oidcClientId,d=c.oidcIssuer;if(!d){let f=c.globalEndpoint;f.includes("localhost")||f.includes("127.0.0.1")?d=f.replace(/\/graphql$/,"").replace(/\/global\/graphql$/,"/global"):d=e.oidcIssuerProd??"https://graphql.burdenoff.com/global";}return {oidcIssuer:d,clientId:p}}function g(){let c=u();if(c.productOrigin)return c.productOrigin;if(e.productOrigins)try{let p=new URL(c.workspaceEndpoint).hostname.toLowerCase();return e.productOrigins[p]}catch{return}}return {read:u,write:l,get:m,set:y,path:()=>r,dir:()=>n,resolveOIDC:a,resolveProductOrigin:g}}async function ue(e){let n=`${e.oidcIssuer}/oidc/device/code`,r=new URLSearchParams({client_id:e.clientId,scope:"openid profile email offline_access"}),t=await x(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:r.toString()});if(!t.ok){let s=await t.text().catch(()=>"Unknown error");throw new Error(`Device code request failed (${t.status}): ${s}`)}let i=await t.json();return {deviceCode:i.device_code,userCode:i.user_code,verificationUri:i.verification_uri,verificationUriComplete:i.verification_uri_complete??null,expiresIn:i.expires_in,interval:i.interval??5}}async function le(e,n,r){let t=`${r.oidcIssuer}/oauth/device/token`,i=n;for(;;){await new Promise(l=>setTimeout(l,i*1e3));let s=await x(t,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:e,client_id:r.clientId}).toString()}),o=await s.json();if(s.ok&&o.access_token)return {accessToken:o.access_token,refreshToken:o.refresh_token??"",expiresIn:o.expires_in??3600};let u=o.error;switch(u){case "authorization_pending":continue;case "slow_down":i+=5;continue;case "expired_token":throw new Error("Device code has expired. Please try again.");case "access_denied":throw new Error("Authorization was denied by the user.");default:throw new Error(`Device code polling failed: ${o.error_description??u??"Unknown error"}`)}}}async function $(e,n,r,t){let s=await x(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:`
|
|
2
|
-
mutation AuthenticateApp($input: AuthenticateAppInput!) {
|
|
3
|
-
authenticateApp(input: $input) {
|
|
4
|
-
accessToken tokenType expiresIn scopes
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
`,variables:{input:{clientId:n,clientSecret:r,scopes:t}}})});if(!s.ok){let u=await s.text().catch(()=>"Unknown error");throw new Error(`App authentication failed (${s.status}): ${u}`)}let o=await s.json();if(o.errors?.length)throw new Error(`App authentication failed: ${o.errors[0]?.message??"unknown error"}`);if(!o.data?.authenticateApp?.accessToken)throw new Error("App authentication failed: no access token returned");return o.data.authenticateApp}async function P(e,n,r,t){let s=await x(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify({query:`
|
|
8
|
-
mutation IssueWorkspaceToken($input: IssueWorkspaceTokenInput!) {
|
|
9
|
-
issueWorkspaceToken(input: $input) {
|
|
10
|
-
success token expiresAt scopes
|
|
11
|
-
error { code message }
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
`,variables:{input:{workspaceId:r,organizationId:t}}})});if(!s.ok){let l=await s.text().catch(()=>"Unknown error");throw new Error(`Workspace token request failed (${s.status}): ${l}`)}let o=await s.json();if(o.errors?.length)throw new Error(`Workspace token failed: ${o.errors[0]?.message??"unknown error"}`);let u=o.data?.issueWorkspaceToken;if(!u?.success||!u.token){let l=u?.error?.message??"Unknown error";throw new Error(`Workspace token failed: ${l}`)}return {token:u.token,expiresAt:u.expiresAt??"",scopes:u.scopes??[]}}async function pe(e,n){let t=await x(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify({query:`
|
|
15
|
-
query MyWorkspaces($limit: Int) {
|
|
16
|
-
myWorkspaces(limit: $limit) {
|
|
17
|
-
items { id name slug tenantId organizationId }
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
`,variables:{limit:50}})});if(!t.ok){let s=await t.text().catch(()=>"Unknown error");throw new Error(`Failed to fetch workspaces (${t.status}): ${s}`)}let i=await t.json();if(i.errors?.length)throw new Error(`Failed to fetch workspaces: ${i.errors[0]?.message??"unknown error"}`);return i.data?.myWorkspaces?.items??[]}function de(e){try{let n=new URL(e);return n.protocol==="http:"||n.protocol==="https:"}catch{return false}}async function ge(e){try{if(!de(e))return !1;let{execFile:n}=await import('child_process'),r=process.platform,t,i;return r==="darwin"?(t="open",i=[e]):r==="win32"?(t="cmd",i=["/c","start","",e]):(t="xdg-open",i=[e]),new Promise(s=>{n(t,i,o=>{s(!o);});})}catch{return false}}var fe=3e4,z=3,me=1e3;function we(e){return new Promise(n=>setTimeout(n,e))}function he(e){if(e instanceof TypeError)return true;if(e&&typeof e=="object"&&"response"in e){let n=e.response;if(n&&typeof n.status=="number"&&n.status>=500)return true}return false}function V(e){if(e&&typeof e=="object"&&"response"in e){let n=e,r=n.response?.errors?.[0],t=r?.extensions?.originalError?.message;if(t)return t;if(r?.message)return r.message;let i=n.response?.status;return typeof i=="number"&&Number.isInteger(i)?`GraphQL request failed (HTTP ${i})`:"GraphQL request failed"}return e instanceof Error?e.message:String(e)}function T(e){let n={};return e?.accessToken&&(n.Authorization=`Bearer ${e.accessToken}`),e?.organizationId&&(n["x-org-id"]=e.organizationId),n}function H(e,n){let r=T(e);return n&&(r.Origin=n),e?.workspaceToken&&(r["X-Workspace-Authorization"]=`Bearer ${e.workspaceToken}`),e?.organizationId&&(r["x-org-id"]=e.organizationId),r}async function R(e,n,r){let t;for(let i=0;i<z;i++)try{let s=new AbortController,o=setTimeout(()=>s.abort(),fe);try{return await e.request({document:n,variables:r,signal:s.signal})}finally{clearTimeout(o);}}catch(s){if(t=s,s&&typeof s=="object"&&"response"in s){let o=s.response;if(o&&typeof o.status=="number"&&o.status>=400&&o.status<500)break}if(he(s)&&i<z-1){let o=me*Math.pow(2,i);await we(o);continue}break}throw new Error(V(t))}function L(e,n){let r=null,t=null;function i(){let a=e.read(),g=n.read();return r=new GraphQLClient(a.workspaceEndpoint),r.setHeaders(H(g,e.resolveProductOrigin())),t=new GraphQLClient(a.globalEndpoint),t.setHeaders(T(g)),{workspace:r,global:t}}async function s(){let a=n.read();if(!a)return;if(a.authMethod==="client_credentials"&&a.clientId&&a.clientSecret){let d=e.read();try{let f=await $(d.globalEndpoint,a.clientId,a.clientSecret);n.write({...a,accessToken:f.accessToken,expiresAt:Date.now()+f.expiresIn*1e3}),r=null,t=null;}catch{}return}if(!a.refreshToken)return;let g=e.read(),c=new GraphQLClient(g.globalEndpoint);c.setHeaders({Authorization:`Bearer ${a.accessToken}`});let p=`
|
|
21
|
-
mutation RefreshToken($token: String!) {
|
|
22
|
-
refreshToken(token: $token) {
|
|
23
|
-
accessToken
|
|
24
|
-
refreshToken
|
|
25
|
-
expiresIn
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
`;try{let f=(await c.request(p,{token:a.refreshToken})).refreshToken;n.write({...a,accessToken:f.accessToken,refreshToken:f.refreshToken,expiresAt:Date.now()+f.expiresIn*1e3}),r=null,t=null;}catch{}}async function o(){let a=n.read();if(!a?.accessToken||!a.workspaceId||!a.organizationId)return;let g=e.read();try{let c=await P(g.workspaceEndpoint,a.accessToken,a.workspaceId,a.organizationId);n.write({...a,workspaceToken:c.token,workspaceTokenExpiresAt:new Date(c.expiresAt).getTime()}),r=null;}catch{}}async function u(){n.isTokenExpiringSoon()&&await s(),n.read()?.workspaceToken&&n.isWorkspaceTokenExpiringSoon()&&await o();}return {workspace:{async request(a,g){await u();let{workspace:c}=r?{workspace:r}:i();return c.setHeaders(H(n.read(),e.resolveProductOrigin())),R(c,a,g)}},global:{async request(a,g){let{global:c}=t?{global:t}:i();return c.setHeaders(T(n.read())),R(c,a,g)}},workspaceAuthOnly:{async request(a,g){let c=e.read(),p=n.read(),d=new GraphQLClient(c.workspaceEndpoint),f=T(p),G=e.resolveProductOrigin();return G&&(f.Origin=G),d.setHeaders(f),R(d,a,g)}},reset(){r=null,t=null;}}}function _(){return !!(process.stdout.isTTY&&process.stdin.isTTY)}function B(e){if(e.format){let n=e.format.toLowerCase();if(n==="json"||n==="table"||n==="yaml")return n}return _()?"table":"json"}function D(e){console.log(JSON.stringify(e,null,2));}function J(e,n){if(e.length===0)return;let r=e.map((s,o)=>{let u=s.length;for(let l of n){let m=l[o]??"";m.length>u&&(u=m.length);}return Math.min(u,50)}),t=r.map(s=>"-".repeat(s+2)).join("+"),i=s=>s.map((o,u)=>` ${(o??"").padEnd(r[u]??0)} `).join("|");console.log(i(e)),console.log(t);for(let s of n)console.log(i(s));}function q(e,n){let r=" ".repeat(n),t=[];for(let[i,s]of Object.entries(e))if(s==null)t.push(`${r}${i}: null`);else if(Array.isArray(s)){t.push(`${r}${i}:`);for(let o of s)typeof o=="object"&&o!==null?(t.push(`${r} -`),t.push(q(o,n+2))):t.push(`${r} - ${String(o)}`);}else typeof s=="object"?(t.push(`${r}${i}:`),t.push(q(s,n+1))):t.push(`${r}${i}: ${String(s)}`);return t.join(`
|
|
29
|
-
`)}function Y(e){if(typeof e!="object"||e===null){console.log(String(e));return}console.log(q(e,0));}function ke(e){process.stdout.write(e.endsWith(`
|
|
30
|
-
`)?e:`${e}
|
|
31
|
-
`);}function ye(e){console.log(`\u2713 ${e}`);}function Q(e){console.error(`\u2717 ${e}`);}function Ce(e){console.warn(`! ${e}`);}function xe(e){console.log(`\u2139 ${e}`);}function be(e){if(!e)return "-";try{return new Date(e).toLocaleString()}catch{return e}}function ve(e){if(!e)return "-";switch(e.toUpperCase()){case "ACTIVE":case "RUNNING":case "HEALTHY":return `\u2713 ${e}`;case "INACTIVE":case "STOPPED":case "PENDING":return `\u25CB ${e}`;case "ERROR":return `\u2717 ${e}`;case "ARCHIVED":return `\u2192 ${e}`;case "STARTING":return `\u25B6 ${e}`;case "TERMINATED":return `\u25A0 ${e}`;default:return e}}function Te(e,n){return e?e.length<=n?e:e.substring(0,n-3)+"...":"-"}function Ie(e,n,r){switch(B(e)){case "json":D(n);break;case "yaml":Y(n);break;case "table":r?J(r.headers,r.rows):D(n);break}}async function Ee(e,n){return n?true:_()?new Promise(r=>{process.stdout.write(`${e} [y/N] `),process.stdin.setEncoding("utf8"),process.stdin.once("data",t=>{let i=t.trim().toLowerCase();r(i==="y"||i==="yes");}),process.stdin.resume();}):(Q(`${e} Use --force to skip confirmation.`),false)}var N={isInteractive:_,getFormat:B,formatAndOutput:Ie,printJson:D,printTable:J,printYaml:Y,printRaw:ke,printSuccess:ye,printError:Q,printWarning:Ce,printInfo:xe,formatDate:be,formatStatus:ve,truncate:Te,confirm:Ee};function j(e={}){let{verbose:n=false,quiet:r=false}=e;return {debug(t,...i){n&&console.error(`[debug] ${t}`,...i);},info(t,...i){r||console.error(`[info] ${t}`,...i);},warn(t,...i){console.error(`[warn] ${t}`,...i);},error(t,...i){console.error(`[error] ${t}`,...i);}}}function Ae(e){return e.includes("localhost")||e.includes("127.0.0.1")?"local":e.includes("alpha")||e.includes("staging")?"staging":"prod"}function Oe(e){return !!e&&typeof e.debug=="function"&&typeof e.info=="function"}function Se(e){let n=S(e.defaults),r=O(n.dir()),t=L(n,r),i=e.output??N,s=Oe(e.logger)?e.logger:j(e.logger),o=e.env??Ae(n.read().workspaceEndpoint);return {productName:e.productName,productVersion:e.productVersion,defaults:e.defaults,config:n,auth:r,gql:t,output:i,logger:s,env:o}}var C=class extends Error{exitCode;hint;constructor(n,r){super(n),this.name="CliUserError",this.exitCode=r?.exitCode??1,this.hint=r?.hint;}},b=class extends C{constructor(n,r){super(n,{exitCode:2,hint:r?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},k=class extends Error{cause;constructor(n,r){super(n),this.name="CliInternalError",this.cause=r;}};var I=class extends k{constructor(n,r){super(`Module '${n}' declares dependency on '${r}', but '${r}' is not in the module list.`),this.name="MissingDependencyError";}},E=class extends k{constructor(n){super(`Circular dependency detected among modules: ${n.join(" -> ")}`),this.name="CircularDependencyError";}};function F(e){let n=new Map;for(let o of e){if(n.has(o.id))throw new k(`Duplicate module id: '${o.id}'`);n.set(o.id,o);}for(let o of e)for(let u of o.dependsOn??[])if(!n.has(u))throw new I(o.id,u);let r=[],t=new Set,i=new Set;function s(o,u){if(!i.has(o.id)){if(t.has(o.id))throw new E([...u,o.id]);t.add(o.id);for(let l of o.dependsOn??[]){let m=n.get(l);m&&s(m,[...u,o.id]);}t.delete(o.id),i.add(o.id),r.push(o);}}for(let o of e)s(o,[]);return r}function Pe(e,n,r){let t=new Command;t.name(r.name).description(r.description??"").version(r.version,"-v, --version").option("-f, --format <format>","Output format (json, table, yaml)").option("--verbose","Enable verbose logging").option("--no-color","Disable colored output"),t.hook("preAction",(o,u)=>{let l=t.opts().format;if(typeof l!="string")return;u.options.some(y=>y.attributeName()==="format")&&u.getOptionValue("format")===void 0&&u.setOptionValue("format",l);});let i=F(n);for(let o of i)o.register(t,e);r.helpExamples?.length&&t.addHelpText("after",`
|
|
32
|
-
Examples:
|
|
33
|
-
`+r.helpExamples.map(o=>" "+o).join(`
|
|
34
|
-
`)),t.on("command:*",()=>{e.output.printError(`Invalid command: ${t.args.join(" ")}`),e.output.printInfo(`Run \`${r.name} --help\` for available commands.`),process.exit(1);});async function s(o=process.argv){try{await t.parseAsync(o),o.length<=2&&t.outputHelp();}catch(u){Re(e,u);}}return {program:t,run:s}}function Re(e,n){if(n instanceof b&&(e.output.printError(n.message),n.hint&&e.output.printInfo(n.hint),process.exit(n.exitCode)),n instanceof C&&(e.output.printError(n.message),n.hint&&e.output.printInfo(n.hint),process.exit(n.exitCode)),n instanceof k&&(e.output.printError(`Internal error: ${n.message}`),n.cause&&e.logger.debug("caused by:",n.cause),process.exit(70)),n&&typeof n=="object"&&"code"in n&&"exitCode"in n){let t=n.exitCode;process.exit(typeof t=="number"?t:0);}let r=n instanceof Error?n.message:String(n);e.output.printError(r),process.exit(1);}export{O as a,ce as b,S as c,ue as d,le as e,$ as f,P as g,pe as h,ge as i,V as j,L as k,N as l,j as m,Se as n,C as o,b as p,k as q,I as r,E as s,F as t,Pe as u};
|
package/dist/chunk-VL67DTWH.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {b as b$1,o as o$1,p as p$1,q as q$1}from'./chunk-2OISIPE6.js';var o=null;function b(t){o=t;}function e(){if(!o)throw new q$1("vibecontrols module helpers used before setHelpersContext was called");return o}function p(){let t=e();if(!t.auth.isAuthenticated())throw new p$1("Authentication required.",{hint:`Run \`${t.productName} auth login\` to authenticate.`})}async function w(t,n){return p(),e().gql.workspace.request(t,n)}async function T(t,n){return e().gql.global.request(t,n)}async function q(t,n){return e().gql.workspaceAuthOnly.request(t,n)}async function A(t,n){return e().gql.global.request(t,n)}function k(){e().gql.reset();}function v(t){return /^(error|fail|failed|failure|timeout|cancel)/i.test(t.status)||t.exitCode!==null&&t.exitCode!==void 0&&t.exitCode!==0?true:t.webhookStatusCode!==null&&t.webhookStatusCode!==void 0&&t.webhookStatusCode>=400}function S(t){let n=t instanceof Error?t.message:String(t);throw new o$1(n)}function E(t,n,a){e().output.formatAndOutput(t,n,a);}function I(){return e().output}function O(t){e().output.printSuccess(t);}function D(t){e().output.printError(t);}function y(t){e().output.printInfo(t);}function N(t){e().output.printWarning(t);}function R(t){e().output.printJson(t);}function F(t){return e().output.formatStatus(t)}function W(t){return e().output.formatDate(t)}function L(t,n){return e().output.truncate(t,n)}function V(t,n){return e().output.confirm(t,n)}function P(t,n){e().output.printTable(t,n);}function _(){return e()}function K(){return e().auth.read()}function G(t){e().auth.write(t);}function B(){e().auth.clear();}function Y(){return e().config.read()}function j(t){return e().config.get(t)}function H(t,n){e().config.set(t,n);}function J(){return e().config.path()}var U=b$1;function $(){return e().config.resolveOIDC()}function z(t){return t?t.expiresAt?Date.now()>=t.expiresAt:false:e().auth.isTokenExpired()}export{H as A,J as B,U as C,$ as D,z as E,b as a,w as b,T as c,q as d,A as e,k as f,v as g,S as h,E as i,I as j,O as k,D as l,y as m,N as n,R as o,F as p,W as q,L as r,V as s,P as t,_ as u,K as v,G as w,B as x,Y as y,j as z};
|