@burdenoff/cli-sdk 2026.1101.1 → 2026.1102.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/dist/{chunk-REBBLQFS.js → chunk-AYNNSLCL.js} +360 -379
- package/dist/modules/auth/index.cjs +31 -31
- package/dist/modules/auth/index.js +1 -1
- package/dist/modules/billing/index.cjs +18 -18
- package/dist/modules/billing/index.js +22 -22
- package/dist/modules/devportal/index.cjs +40 -34
- package/dist/modules/devportal/index.js +49 -43
- package/dist/modules/sandbox/index.cjs +27 -46
- package/dist/modules/sandbox/index.js +1 -1
- package/dist/modules/store/index.cjs +46 -40
- package/dist/modules/store/index.js +45 -39
- package/dist/modules/vibecontrols/index.cjs +332 -332
- package/dist/modules/vibecontrols/index.js +4 -4
- package/package.json +1 -1
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var l=class extends Error{exitCode;hint;constructor(
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var l=class extends Error{exitCode;hint;constructor(i,d){super(i),this.name="CliUserError",this.exitCode=d?.exitCode??1,this.hint=d?.hint;}},k=class extends l{constructor(i,d){super(i,{exitCode:2,hint:d?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},x=class extends Error{cause;constructor(i,d){super(i),this.name="CliInternalError",this.cause=d;}};var Y=null;function nt(o){Y=o;}function $(){if(!Y)throw new x("vibecontrols module helpers used before setHelpersContext was called");return Y}function ie(){let o=$();if(!o.auth.isAuthenticated())throw new k("Authentication required.",{hint:`Run \`${o.productName} auth login\` to authenticate.`})}async function r(o,i){return ie(),$().gql.workspace.request(o,i)}function s(o){let i=o instanceof Error?o.message:String(o);throw new l(i)}function a(o,i,d){$().output.formatAndOutput(o,i,d);}function u(o){$().output.printSuccess(o);}function ot(o){return $().output.formatStatus(o)}function it(o){return $().output.formatDate(o)}function rt(o,i){return $().output.truncate(o,i)}function j(o,i){return $().output.confirm(o,i)}function st(){return $()}var C=`
|
|
2
2
|
id name template mode status ttlSeconds
|
|
3
3
|
expiresAt stoppedAt
|
|
4
4
|
workspaceId createdAt updatedAt
|
|
5
|
-
`,
|
|
5
|
+
`,lt=`
|
|
6
6
|
query ListSandboxes($context: ContextInput!, $filter: SandboxFilterInput, $pagination: SandboxPaginationInput) {
|
|
7
7
|
listSandboxes(context: $context, filter: $filter, pagination: $pagination) {
|
|
8
8
|
items { ${C} } total hasMore
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
`,
|
|
11
|
+
`,It=`
|
|
12
12
|
query GetSandbox($context: ContextInput!, $id: ID!) {
|
|
13
13
|
getSandbox(context: $context, id: $id) { ${C} }
|
|
14
14
|
}
|
|
15
|
-
`,
|
|
15
|
+
`,gt=`
|
|
16
16
|
mutation CreateSandbox($input: CreateSandboxInput!) {
|
|
17
17
|
createSandbox(input: $input) { ${C} }
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
`,mt=`
|
|
20
20
|
mutation StopSandbox($context: ContextInput!, $id: ID!) {
|
|
21
21
|
stopSandbox(context: $context, id: $id) { ${C} }
|
|
22
22
|
}
|
|
23
|
-
`,
|
|
23
|
+
`,St=`
|
|
24
24
|
mutation DeleteSandbox($context: ContextInput!, $id: ID!) {
|
|
25
25
|
deleteSandbox(context: $context, id: $id)
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
`,$t=`
|
|
28
28
|
mutation ExtendSandboxTTL($context: ContextInput!, $id: ID!, $additionalSeconds: Int!) {
|
|
29
29
|
extendSandboxTTL(context: $context, id: $id, additionalSeconds: $additionalSeconds) {
|
|
30
30
|
${C}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
`,M=`
|
|
34
34
|
id name description template isDefault ttlSeconds
|
|
35
35
|
workspaceId createdAt updatedAt
|
|
36
|
-
`,
|
|
36
|
+
`,Tt=`
|
|
37
37
|
query ListSandboxTemplates(
|
|
38
38
|
$context: ContextInput!
|
|
39
39
|
$template: SandboxTemplate
|
|
@@ -43,55 +43,55 @@
|
|
|
43
43
|
items { ${M} } total hasMore
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
`,
|
|
46
|
+
`,Et=`
|
|
47
47
|
query GetSandboxTemplate($context: ContextInput!, $id: ID!) {
|
|
48
48
|
getSandboxTemplate(context: $context, id: $id) { ${M} }
|
|
49
49
|
}
|
|
50
|
-
`,
|
|
50
|
+
`,ft=`
|
|
51
51
|
mutation CreateSandboxTemplate($input: CreateSandboxTemplateInput!) {
|
|
52
52
|
createSandboxTemplate(input: $input) { ${M} }
|
|
53
53
|
}
|
|
54
|
-
`,
|
|
54
|
+
`,xt=`
|
|
55
55
|
mutation UpdateSandboxTemplate($input: UpdateSandboxTemplateInput!) {
|
|
56
56
|
updateSandboxTemplate(input: $input) { ${M} }
|
|
57
57
|
}
|
|
58
|
-
`,
|
|
58
|
+
`,At=`
|
|
59
59
|
mutation DeleteSandboxTemplate($context: ContextInput!, $id: ID!) {
|
|
60
60
|
deleteSandboxTemplate(context: $context, id: $id)
|
|
61
61
|
}
|
|
62
|
-
`,
|
|
62
|
+
`,Dt=`
|
|
63
63
|
query AvailableSandboxTags($query: String, $limit: Int) {
|
|
64
64
|
availableSandboxTags(query: $query, limit: $limit) {
|
|
65
65
|
id key label color
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
`,
|
|
68
|
+
`,bt=`
|
|
69
69
|
query GetSandboxTags($input: GetSandboxTagsInput!) {
|
|
70
70
|
getSandboxTags(input: $input) {
|
|
71
71
|
id entityId entityType tagId source assignedAt assignedBy
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
`,
|
|
74
|
+
`,Ct=`
|
|
75
75
|
mutation CreateSandboxTag($input: CreateSandboxTagInput!) {
|
|
76
76
|
createSandboxTag(input: $input) { id key label color }
|
|
77
77
|
}
|
|
78
|
-
`,
|
|
78
|
+
`,_t=`
|
|
79
79
|
mutation TagSandbox($input: TagSandboxInput!) {
|
|
80
80
|
tagSandbox(input: $input) {
|
|
81
81
|
id entityId tagId source assignedAt
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
`,
|
|
84
|
+
`,yt=`
|
|
85
85
|
mutation UntagSandbox($input: UntagSandboxInput!) {
|
|
86
86
|
untagSandbox(input: $input)
|
|
87
87
|
}
|
|
88
|
-
`,
|
|
88
|
+
`,kt=`
|
|
89
89
|
mutation ReplaceSandboxTags($input: ReplaceSandboxTagsInput!) {
|
|
90
90
|
replaceSandboxTags(input: $input) {
|
|
91
91
|
id entityId tagId source assignedAt
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
`,
|
|
94
|
+
`,Ot=`
|
|
95
95
|
query ListAllSandboxes(
|
|
96
96
|
$context: ContextInput!
|
|
97
97
|
$filter: SandboxFilterInput
|
|
@@ -101,31 +101,31 @@
|
|
|
101
101
|
items { ${C} } total hasMore
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
`,
|
|
104
|
+
`,Nt=`
|
|
105
105
|
query ListSandboxNodes($context: ContextInput!) {
|
|
106
106
|
listSandboxNodes(context: $context) {
|
|
107
107
|
name status allocatableCpu allocatableMemory sandboxPodCount labels
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
`,
|
|
110
|
+
`,ht=`
|
|
111
111
|
query GetActiveSandboxes($context: ContextInput!) {
|
|
112
112
|
getActiveSandboxes(context: $context) { ${C} }
|
|
113
113
|
}
|
|
114
|
-
`,
|
|
114
|
+
`,vt=`
|
|
115
115
|
query GetRecentSandboxActivity($context: ContextInput!, $limit: Int) {
|
|
116
116
|
getRecentSandboxActivity(context: $context, limit: $limit) {
|
|
117
117
|
items { id action actorId status sandboxName sandboxId createdAt }
|
|
118
118
|
total
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
`,
|
|
121
|
+
`,Rt=`
|
|
122
122
|
query GetSandboxStats($context: ContextInput!) {
|
|
123
123
|
getSandboxStats(context: $context) {
|
|
124
124
|
activeSandboxes totalCreated totalDeleted runningNow provisioningNow
|
|
125
125
|
stoppedNow expiredCount failedCount totalCpuUsed totalMemoryUsed
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
`,
|
|
128
|
+
`,Lt=`
|
|
129
129
|
query GetSandboxLogs(
|
|
130
130
|
$context: ContextInput!
|
|
131
131
|
$id: ID!
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
) {
|
|
135
135
|
getSandboxLogs(context: $context, id: $id, containerName: $containerName, tailLines: $tailLines)
|
|
136
136
|
}
|
|
137
|
-
`,
|
|
137
|
+
`,wt=`
|
|
138
138
|
query GetSandboxConfig($context: ContextInput!) {
|
|
139
139
|
getSandboxConfig(context: $context) {
|
|
140
140
|
id defaultTtlSeconds maxTtlSeconds allowedTemplates
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
workspaceId updatedAt
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
-
`,
|
|
146
|
+
`,Pt=`
|
|
147
147
|
mutation UpdateSandboxConfig($input: UpdateSandboxConfigInput!) {
|
|
148
148
|
updateSandboxConfig(input: $input) {
|
|
149
149
|
id defaultTtlSeconds maxTtlSeconds allowedTemplates
|
|
@@ -152,23 +152,4 @@
|
|
|
152
152
|
workspaceId updatedAt
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
|
|
156
|
-
id workspaceId format status requestedBy rowCount
|
|
157
|
-
downloadUrl errorMessage expiresAt createdAt updatedAt
|
|
158
|
-
`,Gt=`
|
|
159
|
-
mutation ExportSandboxes($input: ExportSandboxesInput!) {
|
|
160
|
-
exportSandboxes(input: $input) { ${Q} }
|
|
161
|
-
}
|
|
162
|
-
`,Bt=`
|
|
163
|
-
query GetSandboxExportJob($workspaceId: ID!, $jobId: ID!, $context: ContextInput!) {
|
|
164
|
-
getSandboxExportJob(workspaceId: $workspaceId, jobId: $jobId, context: $context) {
|
|
165
|
-
${Q}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
`,qt=`
|
|
169
|
-
query ListSandboxExportJobs($workspaceId: ID!, $context: ContextInput!, $pagination: SandboxPaginationInput) {
|
|
170
|
-
listSandboxExportJobs(workspaceId: $workspaceId, context: $context, pagination: $pagination) {
|
|
171
|
-
${Q}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
`;function c(){let o=ct().auth.read();if(!o?.workspaceId)throw new l("No workspace set. Run: vibecontrols workspace set <id>");return {workspaceId:o.workspaceId}}function zt(o){let s=o.command("sandbox").description("Manage sandboxes");s.command("list").description("List sandboxes").option("--status <status>","Filter by status").option("--template <template>","Filter by template").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>","Output format").action(async e=>{try{let t={};e.status&&(t.status=e.status.toUpperCase()),e.template&&(t.template=e.template.toUpperCase());let g=(await i(gt,{context:c(),filter:Object.keys(t).length?t:void 0,pagination:{limit:e.limit,offset:0}})).listSandboxes.items;a(e,g,{headers:["ID","Name","Template","Mode","Status","TTL","Created"],rows:g.map(E=>[at(E.id,12),E.name,E.template,E.mode,rt(E.status),E.ttlSeconds?`${E.ttlSeconds}s`:"-",st(E.createdAt)])});}catch(t){r(t);}}),s.command("get").description("Get sandbox details").argument("<id>").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await i(mt,{context:c(),id:e});if(!n.getSandbox)throw new l("Sandbox not found");a(t,n.getSandbox);}catch(n){r(n);}}),s.command("create").description("Create sandbox").requiredOption("--name <name>","Sandbox name").option("--template <template>","Template type","VIBECONTROLS").option("--mode <mode>","Mode (DEPLOYMENT or JOB)","DEPLOYMENT").option("--ttl <seconds>","TTL in seconds",parseInt).option("-f, --format <format>","Output format").action(async e=>{try{let t=await i(St,{input:{name:e.name,template:e.template.toUpperCase(),mode:e.mode.toUpperCase(),ttlSeconds:e.ttl,context:c()}});u("Sandbox created"),a(e,t.createSandbox);}catch(t){r(t);}}),s.command("stop").description("Stop sandbox").argument("<id>").action(async e=>{try{await i($t,{context:c(),id:e}),u("Sandbox stopped");}catch(t){r(t);}}),s.command("delete").description("Delete sandbox").argument("<id>").option("--force","Skip confirmation").action(async(e,t)=>{try{if(!await J("Delete this sandbox?",t.force))return;await i(Tt,{context:c(),id:e}),u("Sandbox deleted");}catch(n){r(n);}}),s.command("extend").description("Extend sandbox TTL").argument("<id>").option("--seconds <n>","Extend by seconds",parseInt).option("--minutes <n>","Extend by minutes",parseInt).option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n;if(t.seconds?n=t.seconds:t.minutes&&(n=t.minutes*60),!n)throw new l("Either --seconds or --minutes is required");let g=await i(Et,{context:c(),id:e,additionalSeconds:n});u(`Sandbox extended by ${n}s`),a(t,g.extendSandboxTTL);}catch(n){r(n);}});let d=s.command("templates").description("Manage sandbox templates");d.command("list").description("List sandbox templates").option("--template <kind>","Filter by template kind").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>","Output format").action(async e=>{try{let t=await i(ft,{context:c(),template:e.template?.toUpperCase(),pagination:{limit:e.limit,offset:0}});a(e,t.listSandboxTemplates.items);}catch(t){r(t);}}),d.command("get").description("Get template details").argument("<id>").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await i(xt,{context:c(),id:e});if(!n.getSandboxTemplate)throw new l("Template not found");a(t,n.getSandboxTemplate);}catch(n){r(n);}}),d.command("create").description("Create sandbox template").requiredOption("--name <name>","Template name").requiredOption("--template <kind>","Template kind").option("--description <desc>","Description").option("--default","Mark as default").option("--ttl <seconds>","Default TTL",parseInt).option("-f, --format <format>","Output format").action(async e=>{try{let t={name:e.name,template:e.template.toUpperCase(),context:c()};e.description&&(t.description=e.description),e.default&&(t.isDefault=!0),e.ttl!==void 0&&(t.ttlSeconds=e.ttl);let n=await i(At,{input:t});u("Template created"),a(e,n.createSandboxTemplate);}catch(t){r(t);}}),d.command("update").description("Update sandbox template").argument("<id>").option("--name <name>","New name").option("--description <desc>","New description").option("--default","Mark as default").option("--ttl <seconds>","New default TTL",parseInt).option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={id:e,context:c()};t.name&&(n.name=t.name),t.description&&(n.description=t.description),t.default!==void 0&&(n.isDefault=t.default),t.ttl!==void 0&&(n.ttlSeconds=t.ttl);let g=await i(bt,{input:n});u("Template updated"),a(t,g.updateSandboxTemplate);}catch(n){r(n);}}),d.command("delete").description("Delete sandbox template").argument("<id>").option("--force","Skip confirmation").action(async(e,t)=>{try{if(!await J("Delete this template?",t.force))return;await i(Dt,{context:c(),id:e}),u("Template deleted");}catch(n){r(n);}});let y=s.command("tags").description("Manage sandbox tags");y.command("list").description("List available sandbox tags").option("--query <q>","Search query").option("--limit <n>","Page size",parseInt).option("-f, --format <format>","Output format").action(async e=>{try{let t=await i(_t,{query:e.query,limit:e.limit});a(e,t.availableSandboxTags);}catch(t){r(t);}}),y.command("create").description("Create a new sandbox tag").requiredOption("--label <label>","Tag label").option("--color <color>","Tag color").option("-f, --format <format>","Output format").action(async e=>{try{let t={label:e.label};e.color&&(t.color=e.color);let n=await i(yt,{input:t});u("Tag created"),a(e,n.createSandboxTag);}catch(t){r(t);}}),y.command("attach").description("Attach a tag to a sandbox").requiredOption("--sandbox <id>","Sandbox ID").requiredOption("--tag <id>","Tag ID").option("-f, --format <format>","Output format").action(async e=>{try{let t=await i(kt,{input:{sandboxId:e.sandbox,tagId:e.tag}});u("Tag attached"),a(e,t.tagSandbox);}catch(t){r(t);}}),y.command("detach").description("Detach a tag from a sandbox").requiredOption("--sandbox <id>","Sandbox ID").requiredOption("--tag <id>","Tag ID").action(async e=>{try{await i(Ot,{input:{sandboxId:e.sandbox,tagId:e.tag}}),u("Tag detached");}catch(t){r(t);}}),y.command("get").description("Get tags assigned to a sandbox").requiredOption("--sandbox <id>","Sandbox ID").option("-f, --format <format>","Output format").action(async e=>{try{let t=await i(Ct,{input:{sandboxId:e.sandbox}});a(e,t.getSandboxTags);}catch(t){r(t);}}),y.command("replace").description("Replace all tags on a sandbox").requiredOption("--sandbox <id>","Sandbox ID").requiredOption("--tags <ids...>","Tag IDs (space separated)").option("-f, --format <format>","Output format").action(async e=>{try{let t=await i(Nt,{input:{sandboxId:e.sandbox,tagIds:e.tags}});u("Tags replaced"),a(e,t.replaceSandboxTags);}catch(t){r(t);}});let x=s.command("admin").description("Admin / observability ops");x.command("nodes").description("List sandbox nodes").option("-f, --format <format>","Output format").action(async e=>{try{let t=await i(vt,{context:c()});a(e,t.listSandboxNodes);}catch(t){r(t);}}),x.command("all").description("List all sandboxes (admin)").option("--status <status>","Filter by status").option("--template <template>","Filter by template").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>","Output format").action(async e=>{try{let t={};e.status&&(t.status=e.status.toUpperCase()),e.template&&(t.template=e.template.toUpperCase());let n=await i(ht,{context:c(),filter:Object.keys(t).length?t:void 0,pagination:{limit:e.limit,offset:0}});a(e,n.listAllSandboxes.items);}catch(t){r(t);}}),x.command("active").description("Get active sandboxes").option("-f, --format <format>","Output format").action(async e=>{try{let t=await i(Rt,{context:c()});a(e,t.getActiveSandboxes);}catch(t){r(t);}}),x.command("activity").description("Get recent sandbox activity").option("--limit <n>","Max items",parseInt,20).option("-f, --format <format>","Output format").action(async e=>{try{let t=await i(wt,{context:c(),limit:e.limit});a(e,t.getRecentSandboxActivity.items);}catch(t){r(t);}}),x.command("stats").description("Get sandbox stats").option("-f, --format <format>","Output format").action(async e=>{try{let t=await i(Lt,{context:c()});a(e,t.getSandboxStats);}catch(t){r(t);}}),x.command("logs").description("Get logs for a sandbox container").argument("<id>").requiredOption("--container <name>","Container name").option("--tail <n>","Tail lines",parseInt,100).action(async(e,t)=>{try{let n=await i(Pt,{context:c(),id:e,containerName:t.container,tailLines:t.tail});process.stdout.write(n.getSandboxLogs);}catch(n){r(n);}});let et=x.command("config").description("Sandbox config");et.command("get").description("Get sandbox config").option("-f, --format <format>","Output format").action(async e=>{try{let t=await i(Vt,{context:c()});a(e,t.getSandboxConfig);}catch(t){r(t);}}),et.command("set").description("Update sandbox config").option("--default-ttl <seconds>","Default TTL",parseInt).option("--max-ttl <seconds>","Max TTL",parseInt).option("--max-per-user <n>","Max concurrent per user",parseInt).option("--max-per-workspace <n>","Max concurrent per workspace",parseInt).option("-f, --format <format>","Output format").action(async e=>{try{let t={context:c()};e.defaultTtl!==void 0&&(t.defaultTtlSeconds=e.defaultTtl),e.maxTtl!==void 0&&(t.maxTtlSeconds=e.maxTtl),e.maxPerUser!==void 0&&(t.maxConcurrentPerUser=e.maxPerUser),e.maxPerWorkspace!==void 0&&(t.maxConcurrentPerWorkspace=e.maxPerWorkspace);let n=await i(Ut,{input:t});u("Config updated"),a(e,n.updateSandboxConfig);}catch(t){r(t);}});let j=s.command("export").description("Sandbox export jobs");j.command("create").description("Create a sandbox export job").requiredOption("--format <fmt>","Format (CSV or JSON)").option("--include-usage","Include usage events").option("-f, --format-out <format>","Output format").action(async e=>{try{let t=c(),n={workspaceId:t.workspaceId,format:e.format.toUpperCase(),context:t};e.includeUsage&&(n.includeUsageEvents=!0);let g=await i(Gt,{input:n});u("Export job created"),a({format:e.formatOut},g.exportSandboxes);}catch(t){r(t);}}),j.command("get").description("Get sandbox export job").argument("<jobId>").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=c(),g=await i(Bt,{workspaceId:n.workspaceId,jobId:e,context:n});a(t,g.getSandboxExportJob);}catch(n){r(n);}}),j.command("list").description("List sandbox export jobs").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>","Output format").action(async e=>{try{let t=c(),n=await i(qt,{workspaceId:t.workspaceId,context:t,pagination:{limit:e.limit,offset:0}});a(e,n.listSandboxExportJobs);}catch(t){r(t);}});}var le={id:"sandbox",version:"1.0.0",displayName:"Sandbox",dependsOn:["auth","workspaces"],register(o,s){it(s),zt(o);}},Jr=le;module.exports=Jr;
|
|
155
|
+
`;function c(){let o=st().auth.read();if(!o?.workspaceId)throw new l("No workspace set. Run: vibecontrols workspace set <id>");return {workspaceId:o.workspaceId}}function Kt(o){let i=o.command("sandbox").description("Manage sandboxes");i.command("list").description("List sandboxes").option("--status <status>","Filter by status").option("--template <template>","Filter by template").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>","Output format").action(async e=>{try{let t={};e.status&&(t.status=e.status.toUpperCase()),e.template&&(t.template=e.template.toUpperCase());let y=(await r(lt,{context:c(),filter:Object.keys(t).length?t:void 0,pagination:{limit:e.limit,offset:0}})).listSandboxes.items;a(e,y,{headers:["ID","Name","Template","Mode","Status","TTL","Created"],rows:y.map(T=>[rt(T.id,12),T.name,T.template,T.mode,ot(T.status),T.ttlSeconds?`${T.ttlSeconds}s`:"-",it(T.createdAt)])});}catch(t){s(t);}}),i.command("get").description("Get sandbox details").argument("<id>").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await r(It,{context:c(),id:e});if(!n.getSandbox)throw new l("Sandbox not found");a(t,n.getSandbox);}catch(n){s(n);}}),i.command("create").description("Create sandbox").requiredOption("--name <name>","Sandbox name").option("--template <template>","Template type","VIBECONTROLS").option("--mode <mode>","Mode (DEPLOYMENT or JOB)","DEPLOYMENT").option("--ttl <seconds>","TTL in seconds",parseInt).option("-f, --format <format>","Output format").action(async e=>{try{let t=await r(gt,{input:{name:e.name,template:e.template.toUpperCase(),mode:e.mode.toUpperCase(),ttlSeconds:e.ttl,context:c()}});u("Sandbox created"),a(e,t.createSandbox);}catch(t){s(t);}}),i.command("stop").description("Stop sandbox").argument("<id>").action(async e=>{try{await r(mt,{context:c(),id:e}),u("Sandbox stopped");}catch(t){s(t);}}),i.command("delete").description("Delete sandbox").argument("<id>").option("--force","Skip confirmation").action(async(e,t)=>{try{if(!await j("Delete this sandbox?",t.force))return;await r(St,{context:c(),id:e}),u("Sandbox deleted");}catch(n){s(n);}}),i.command("extend").description("Extend sandbox TTL").argument("<id>").option("--seconds <n>","Extend by seconds",parseInt).option("--minutes <n>","Extend by minutes",parseInt).option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n;if(t.seconds?n=t.seconds:t.minutes&&(n=t.minutes*60),!n)throw new l("Either --seconds or --minutes is required");let y=await r($t,{context:c(),id:e,additionalSeconds:n});u(`Sandbox extended by ${n}s`),a(t,y.extendSandboxTTL);}catch(n){s(n);}});let d=i.command("templates").description("Manage sandbox templates");d.command("list").description("List sandbox templates").option("--template <kind>","Filter by template kind").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>","Output format").action(async e=>{try{let t=await r(Tt,{context:c(),template:e.template?.toUpperCase(),pagination:{limit:e.limit,offset:0}});a(e,t.listSandboxTemplates.items);}catch(t){s(t);}}),d.command("get").description("Get template details").argument("<id>").option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n=await r(Et,{context:c(),id:e});if(!n.getSandboxTemplate)throw new l("Template not found");a(t,n.getSandboxTemplate);}catch(n){s(n);}}),d.command("create").description("Create sandbox template").requiredOption("--name <name>","Template name").requiredOption("--template <kind>","Template kind").option("--description <desc>","Description").option("--default","Mark as default").option("--ttl <seconds>","Default TTL",parseInt).option("-f, --format <format>","Output format").action(async e=>{try{let t={name:e.name,template:e.template.toUpperCase(),context:c()};e.description&&(t.description=e.description),e.default&&(t.isDefault=!0),e.ttl!==void 0&&(t.ttlSeconds=e.ttl);let n=await r(ft,{input:t});u("Template created"),a(e,n.createSandboxTemplate);}catch(t){s(t);}}),d.command("update").description("Update sandbox template").argument("<id>").option("--name <name>","New name").option("--description <desc>","New description").option("--default","Mark as default").option("--ttl <seconds>","New default TTL",parseInt).option("-f, --format <format>","Output format").action(async(e,t)=>{try{let n={id:e,context:c()};t.name&&(n.name=t.name),t.description&&(n.description=t.description),t.default!==void 0&&(n.isDefault=t.default),t.ttl!==void 0&&(n.ttlSeconds=t.ttl);let y=await r(xt,{input:n});u("Template updated"),a(t,y.updateSandboxTemplate);}catch(n){s(n);}}),d.command("delete").description("Delete sandbox template").argument("<id>").option("--force","Skip confirmation").action(async(e,t)=>{try{if(!await j("Delete this template?",t.force))return;await r(At,{context:c(),id:e}),u("Template deleted");}catch(n){s(n);}});let _=i.command("tags").description("Manage sandbox tags");_.command("list").description("List available sandbox tags").option("--query <q>","Search query").option("--limit <n>","Page size",parseInt).option("-f, --format <format>","Output format").action(async e=>{try{let t=await r(Dt,{query:e.query,limit:e.limit});a(e,t.availableSandboxTags);}catch(t){s(t);}}),_.command("create").description("Create a new sandbox tag").requiredOption("--label <label>","Tag label").option("--color <color>","Tag color").option("-f, --format <format>","Output format").action(async e=>{try{let t={label:e.label};e.color&&(t.color=e.color);let n=await r(Ct,{input:t});u("Tag created"),a(e,n.createSandboxTag);}catch(t){s(t);}}),_.command("attach").description("Attach a tag to a sandbox").requiredOption("--sandbox <id>","Sandbox ID").requiredOption("--tag <id>","Tag ID").option("-f, --format <format>","Output format").action(async e=>{try{let t=await r(_t,{input:{sandboxId:e.sandbox,tagId:e.tag}});u("Tag attached"),a(e,t.tagSandbox);}catch(t){s(t);}}),_.command("detach").description("Detach a tag from a sandbox").requiredOption("--sandbox <id>","Sandbox ID").requiredOption("--tag <id>","Tag ID").action(async e=>{try{await r(yt,{input:{sandboxId:e.sandbox,tagId:e.tag}}),u("Tag detached");}catch(t){s(t);}}),_.command("get").description("Get tags assigned to a sandbox").requiredOption("--sandbox <id>","Sandbox ID").option("-f, --format <format>","Output format").action(async e=>{try{let t=await r(bt,{input:{sandboxId:e.sandbox}});a(e,t.getSandboxTags);}catch(t){s(t);}}),_.command("replace").description("Replace all tags on a sandbox").requiredOption("--sandbox <id>","Sandbox ID").requiredOption("--tags <ids...>","Tag IDs (space separated)").option("-f, --format <format>","Output format").action(async e=>{try{let t=await r(kt,{input:{sandboxId:e.sandbox,tagIds:e.tags}});u("Tags replaced"),a(e,t.replaceSandboxTags);}catch(t){s(t);}});let f=i.command("admin").description("Admin / observability ops");f.command("nodes").description("List sandbox nodes").option("-f, --format <format>","Output format").action(async e=>{try{let t=await r(Nt,{context:c()});a(e,t.listSandboxNodes);}catch(t){s(t);}}),f.command("all").description("List all sandboxes (admin)").option("--status <status>","Filter by status").option("--template <template>","Filter by template").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>","Output format").action(async e=>{try{let t={};e.status&&(t.status=e.status.toUpperCase()),e.template&&(t.template=e.template.toUpperCase());let n=await r(Ot,{context:c(),filter:Object.keys(t).length?t:void 0,pagination:{limit:e.limit,offset:0}});a(e,n.listAllSandboxes.items);}catch(t){s(t);}}),f.command("active").description("Get active sandboxes").option("-f, --format <format>","Output format").action(async e=>{try{let t=await r(ht,{context:c()});a(e,t.getActiveSandboxes);}catch(t){s(t);}}),f.command("activity").description("Get recent sandbox activity").option("--limit <n>","Max items",parseInt,20).option("-f, --format <format>","Output format").action(async e=>{try{let t=await r(vt,{context:c(),limit:e.limit});a(e,t.getRecentSandboxActivity.items);}catch(t){s(t);}}),f.command("stats").description("Get sandbox stats").option("-f, --format <format>","Output format").action(async e=>{try{let t=await r(Rt,{context:c()});a(e,t.getSandboxStats);}catch(t){s(t);}}),f.command("logs").description("Get logs for a sandbox container").argument("<id>").requiredOption("--container <name>","Container name").option("--tail <n>","Tail lines",parseInt,100).action(async(e,t)=>{try{let n=await r(Lt,{context:c(),id:e,containerName:t.container,tailLines:t.tail});process.stdout.write(n.getSandboxLogs);}catch(n){s(n);}});let Z=f.command("config").description("Sandbox config");Z.command("get").description("Get sandbox config").option("-f, --format <format>","Output format").action(async e=>{try{let t=await r(wt,{context:c()});a(e,t.getSandboxConfig);}catch(t){s(t);}}),Z.command("set").description("Update sandbox config").option("--default-ttl <seconds>","Default TTL",parseInt).option("--max-ttl <seconds>","Max TTL",parseInt).option("--max-per-user <n>","Max concurrent per user",parseInt).option("--max-per-workspace <n>","Max concurrent per workspace",parseInt).option("-f, --format <format>","Output format").action(async e=>{try{let t={context:c()};e.defaultTtl!==void 0&&(t.defaultTtlSeconds=e.defaultTtl),e.maxTtl!==void 0&&(t.maxTtlSeconds=e.maxTtl),e.maxPerUser!==void 0&&(t.maxConcurrentPerUser=e.maxPerUser),e.maxPerWorkspace!==void 0&&(t.maxConcurrentPerWorkspace=e.maxPerWorkspace);let n=await r(Pt,{input:t});u("Config updated"),a(e,n.updateSandboxConfig);}catch(t){s(t);}});}var ae={id:"sandbox",version:"1.0.0",displayName:"Sandbox",dependsOn:["auth","workspaces"],register(o,i){nt(i),Kt(o);}},Wr=ae;module.exports=Wr;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {Nc,Oc,Pc,Qc,Rc,Sc,Tc,Uc,Vc,Wc,Xc,Yc,_c,$c,ad,Zc,bd,dd,cd,ed,fd,gd,hd,id,jd,kd,ld,md}from'../../chunk-REBBLQFS.js';import {a,b,h,p,n,o,g,i,q,s}from'../../chunk-W4JZR7RJ.js';import {o as o$1}from'../../chunk-YIY5IDXQ.js';function r(){let l=s().auth.read();if(!l?.workspaceId)throw new o$1("No workspace set. Run: vibecontrols workspace set <id>");return {workspaceId:l.workspaceId}}function Q(l){let d=l.command("sandbox").description("Manage sandboxes");d.command("list").description("List sandboxes").option("--status <status>","Filter by status").option("--template <template>","Filter by template").option("--limit <n>","Page size",n=>parseInt(n,10),50).option("-f, --format <format>","Output format").action(async n$1=>{try{let t={};n$1.status&&(t.status=n$1.status.toUpperCase()),n$1.template&&(t.template=n$1.template.toUpperCase());let c=(await b(Nc,{context:r(),filter:Object.keys(t).length?t:void 0,pagination:{limit:n$1.limit,offset:0}})).listSandboxes.items;h(n$1,c,{headers:["ID","Name","Template","Mode","Status","TTL","Created"],rows:c.map(m=>[p(m.id,12),m.name,m.template,m.mode,n(m.status),m.ttlSeconds?`${m.ttlSeconds}s`:"-",o(m.createdAt)])});}catch(t){g(t);}}),d.command("get").description("Get sandbox details").argument("<id>").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(Oc,{context:r(),id:n});if(!e.getSandbox)throw new o$1("Sandbox not found");h(t,e.getSandbox);}catch(e){g(e);}}),d.command("create").description("Create sandbox").requiredOption("--name <name>","Sandbox name").option("--template <template>","Template type","VIBECONTROLS").option("--mode <mode>","Mode (DEPLOYMENT or JOB)","DEPLOYMENT").option("--ttl <seconds>","TTL in seconds",parseInt).option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(Pc,{input:{name:n.name,template:n.template.toUpperCase(),mode:n.mode.toUpperCase(),ttlSeconds:n.ttl,context:r()}});i("Sandbox created"),h(n,t.createSandbox);}catch(t){g(t);}}),d.command("stop").description("Stop sandbox").argument("<id>").action(async n=>{try{await b(Qc,{context:r(),id:n}),i("Sandbox stopped");}catch(t){g(t);}}),d.command("delete").description("Delete sandbox").argument("<id>").option("--force","Skip confirmation").action(async(n,t)=>{try{if(!await q("Delete this sandbox?",t.force))return;await b(Rc,{context:r(),id:n}),i("Sandbox deleted");}catch(e){g(e);}}),d.command("extend").description("Extend sandbox TTL").argument("<id>").option("--seconds <n>","Extend by seconds",parseInt).option("--minutes <n>","Extend by minutes",parseInt).option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e;if(t.seconds?e=t.seconds:t.minutes&&(e=t.minutes*60),!e)throw new o$1("Either --seconds or --minutes is required");let c=await b(Sc,{context:r(),id:n,additionalSeconds:e});i(`Sandbox extended by ${e}s`),h(t,c.extendSandboxTTL);}catch(e){g(e);}});let f=d.command("templates").description("Manage sandbox templates");f.command("list").description("List sandbox templates").option("--template <kind>","Filter by template kind").option("--limit <n>","Page size",n=>parseInt(n,10),50).option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(Tc,{context:r(),template:n.template?.toUpperCase(),pagination:{limit:n.limit,offset:0}});h(n,t.listSandboxTemplates.items);}catch(t){g(t);}}),f.command("get").description("Get template details").argument("<id>").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(Uc,{context:r(),id:n});if(!e.getSandboxTemplate)throw new o$1("Template not found");h(t,e.getSandboxTemplate);}catch(e){g(e);}}),f.command("create").description("Create sandbox template").requiredOption("--name <name>","Template name").requiredOption("--template <kind>","Template kind").option("--description <desc>","Description").option("--default","Mark as default").option("--ttl <seconds>","Default TTL",parseInt).option("-f, --format <format>","Output format").action(async n=>{try{let t={name:n.name,template:n.template.toUpperCase(),context:r()};n.description&&(t.description=n.description),n.default&&(t.isDefault=!0),n.ttl!==void 0&&(t.ttlSeconds=n.ttl);let e=await b(Vc,{input:t});i("Template created"),h(n,e.createSandboxTemplate);}catch(t){g(t);}}),f.command("update").description("Update sandbox template").argument("<id>").option("--name <name>","New name").option("--description <desc>","New description").option("--default","Mark as default").option("--ttl <seconds>","New default TTL",parseInt).option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e={id:n,context:r()};t.name&&(e.name=t.name),t.description&&(e.description=t.description),t.default!==void 0&&(e.isDefault=t.default),t.ttl!==void 0&&(e.ttlSeconds=t.ttl);let c=await b(Wc,{input:e});i("Template updated"),h(t,c.updateSandboxTemplate);}catch(e){g(e);}}),f.command("delete").description("Delete sandbox template").argument("<id>").option("--force","Skip confirmation").action(async(n,t)=>{try{if(!await q("Delete this template?",t.force))return;await b(Xc,{context:r(),id:n}),i("Template deleted");}catch(e){g(e);}});let u=d.command("tags").description("Manage sandbox tags");u.command("list").description("List available sandbox tags").option("--query <q>","Search query").option("--limit <n>","Page size",parseInt).option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(Yc,{query:n.query,limit:n.limit});h(n,t.availableSandboxTags);}catch(t){g(t);}}),u.command("create").description("Create a new sandbox tag").requiredOption("--label <label>","Tag label").option("--color <color>","Tag color").option("-f, --format <format>","Output format").action(async n=>{try{let t={label:n.label};n.color&&(t.color=n.color);let e=await b(_c,{input:t});i("Tag created"),h(n,e.createSandboxTag);}catch(t){g(t);}}),u.command("attach").description("Attach a tag to a sandbox").requiredOption("--sandbox <id>","Sandbox ID").requiredOption("--tag <id>","Tag ID").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b($c,{input:{sandboxId:n.sandbox,tagId:n.tag}});i("Tag attached"),h(n,t.tagSandbox);}catch(t){g(t);}}),u.command("detach").description("Detach a tag from a sandbox").requiredOption("--sandbox <id>","Sandbox ID").requiredOption("--tag <id>","Tag ID").action(async n=>{try{await b(ad,{input:{sandboxId:n.sandbox,tagId:n.tag}}),i("Tag detached");}catch(t){g(t);}}),u.command("get").description("Get tags assigned to a sandbox").requiredOption("--sandbox <id>","Sandbox ID").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(Zc,{input:{sandboxId:n.sandbox}});h(n,t.getSandboxTags);}catch(t){g(t);}}),u.command("replace").description("Replace all tags on a sandbox").requiredOption("--sandbox <id>","Sandbox ID").requiredOption("--tags <ids...>","Tag IDs (space separated)").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(bd,{input:{sandboxId:n.sandbox,tagIds:n.tags}});i("Tags replaced"),h(n,t.replaceSandboxTags);}catch(t){g(t);}});let p$1=d.command("admin").description("Admin / observability ops");p$1.command("nodes").description("List sandbox nodes").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(dd,{context:r()});h(n,t.listSandboxNodes);}catch(t){g(t);}}),p$1.command("all").description("List all sandboxes (admin)").option("--status <status>","Filter by status").option("--template <template>","Filter by template").option("--limit <n>","Page size",n=>parseInt(n,10),50).option("-f, --format <format>","Output format").action(async n=>{try{let t={};n.status&&(t.status=n.status.toUpperCase()),n.template&&(t.template=n.template.toUpperCase());let e=await b(cd,{context:r(),filter:Object.keys(t).length?t:void 0,pagination:{limit:n.limit,offset:0}});h(n,e.listAllSandboxes.items);}catch(t){g(t);}}),p$1.command("active").description("Get active sandboxes").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(ed,{context:r()});h(n,t.getActiveSandboxes);}catch(t){g(t);}}),p$1.command("activity").description("Get recent sandbox activity").option("--limit <n>","Max items",parseInt,20).option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(fd,{context:r(),limit:n.limit});h(n,t.getRecentSandboxActivity.items);}catch(t){g(t);}}),p$1.command("stats").description("Get sandbox stats").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(gd,{context:r()});h(n,t.getSandboxStats);}catch(t){g(t);}}),p$1.command("logs").description("Get logs for a sandbox container").argument("<id>").requiredOption("--container <name>","Container name").option("--tail <n>","Tail lines",parseInt,100).action(async(n,t)=>{try{let e=await b(hd,{context:r(),id:n,containerName:t.container,tailLines:t.tail});process.stdout.write(e.getSandboxLogs);}catch(e){g(e);}});let S=p$1.command("config").description("Sandbox config");S.command("get").description("Get sandbox config").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(id,{context:r()});h(n,t.getSandboxConfig);}catch(t){g(t);}}),S.command("set").description("Update sandbox config").option("--default-ttl <seconds>","Default TTL",parseInt).option("--max-ttl <seconds>","Max TTL",parseInt).option("--max-per-user <n>","Max concurrent per user",parseInt).option("--max-per-workspace <n>","Max concurrent per workspace",parseInt).option("-f, --format <format>","Output format").action(async n=>{try{let t={context:r()};n.defaultTtl!==void 0&&(t.defaultTtlSeconds=n.defaultTtl),n.maxTtl!==void 0&&(t.maxTtlSeconds=n.maxTtl),n.maxPerUser!==void 0&&(t.maxConcurrentPerUser=n.maxPerUser),n.maxPerWorkspace!==void 0&&(t.maxConcurrentPerWorkspace=n.maxPerWorkspace);let e=await b(jd,{input:t});i("Config updated"),h(n,e.updateSandboxConfig);}catch(t){g(t);}});let x=d.command("export").description("Sandbox export jobs");x.command("create").description("Create a sandbox export job").requiredOption("--format <fmt>","Format (CSV or JSON)").option("--include-usage","Include usage events").option("-f, --format-out <format>","Output format").action(async n=>{try{let t=r(),e={workspaceId:t.workspaceId,format:n.format.toUpperCase(),context:t};n.includeUsage&&(e.includeUsageEvents=!0);let c=await b(kd,{input:e});i("Export job created"),h({format:n.formatOut},c.exportSandboxes);}catch(t){g(t);}}),x.command("get").description("Get sandbox export job").argument("<jobId>").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=r(),c=await b(ld,{workspaceId:e.workspaceId,jobId:n,context:e});h(t,c.getSandboxExportJob);}catch(e){g(e);}}),x.command("list").description("List sandbox export jobs").option("--limit <n>","Page size",n=>parseInt(n,10),50).option("-f, --format <format>","Output format").action(async n=>{try{let t=r(),e=await b(md,{workspaceId:t.workspaceId,context:t,pagination:{limit:n.limit,offset:0}});h(n,e.listSandboxExportJobs);}catch(t){g(t);}});}var nt={id:"sandbox",version:"1.0.0",displayName:"Sandbox",dependsOn:["auth","workspaces"],register(l,d){a(d),Q(l);}},ct=nt;export{ct as default};
|
|
1
|
+
import {Nc,Oc,Pc,Qc,Rc,Sc,Tc,Uc,Vc,Wc,Xc,Yc,_c,$c,ad,Zc,bd,dd,cd,ed,fd,gd,hd,id,jd}from'../../chunk-AYNNSLCL.js';import {a,b,h,p,n,o,g,i,q,s as s$1}from'../../chunk-W4JZR7RJ.js';import {o as o$1}from'../../chunk-YIY5IDXQ.js';function s(){let p=s$1().auth.read();if(!p?.workspaceId)throw new o$1("No workspace set. Run: vibecontrols workspace set <id>");return {workspaceId:p.workspaceId}}function $(p$1){let d=p$1.command("sandbox").description("Manage sandboxes");d.command("list").description("List sandboxes").option("--status <status>","Filter by status").option("--template <template>","Filter by template").option("--limit <n>","Page size",n=>parseInt(n,10),50).option("-f, --format <format>","Output format").action(async n$1=>{try{let t={};n$1.status&&(t.status=n$1.status.toUpperCase()),n$1.template&&(t.template=n$1.template.toUpperCase());let u=(await b(Nc,{context:s(),filter:Object.keys(t).length?t:void 0,pagination:{limit:n$1.limit,offset:0}})).listSandboxes.items;h(n$1,u,{headers:["ID","Name","Template","Mode","Status","TTL","Created"],rows:u.map(c=>[p(c.id,12),c.name,c.template,c.mode,n(c.status),c.ttlSeconds?`${c.ttlSeconds}s`:"-",o(c.createdAt)])});}catch(t){g(t);}}),d.command("get").description("Get sandbox details").argument("<id>").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(Oc,{context:s(),id:n});if(!e.getSandbox)throw new o$1("Sandbox not found");h(t,e.getSandbox);}catch(e){g(e);}}),d.command("create").description("Create sandbox").requiredOption("--name <name>","Sandbox name").option("--template <template>","Template type","VIBECONTROLS").option("--mode <mode>","Mode (DEPLOYMENT or JOB)","DEPLOYMENT").option("--ttl <seconds>","TTL in seconds",parseInt).option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(Pc,{input:{name:n.name,template:n.template.toUpperCase(),mode:n.mode.toUpperCase(),ttlSeconds:n.ttl,context:s()}});i("Sandbox created"),h(n,t.createSandbox);}catch(t){g(t);}}),d.command("stop").description("Stop sandbox").argument("<id>").action(async n=>{try{await b(Qc,{context:s(),id:n}),i("Sandbox stopped");}catch(t){g(t);}}),d.command("delete").description("Delete sandbox").argument("<id>").option("--force","Skip confirmation").action(async(n,t)=>{try{if(!await q("Delete this sandbox?",t.force))return;await b(Rc,{context:s(),id:n}),i("Sandbox deleted");}catch(e){g(e);}}),d.command("extend").description("Extend sandbox TTL").argument("<id>").option("--seconds <n>","Extend by seconds",parseInt).option("--minutes <n>","Extend by minutes",parseInt).option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e;if(t.seconds?e=t.seconds:t.minutes&&(e=t.minutes*60),!e)throw new o$1("Either --seconds or --minutes is required");let u=await b(Sc,{context:s(),id:n,additionalSeconds:e});i(`Sandbox extended by ${e}s`),h(t,u.extendSandboxTTL);}catch(e){g(e);}});let f=d.command("templates").description("Manage sandbox templates");f.command("list").description("List sandbox templates").option("--template <kind>","Filter by template kind").option("--limit <n>","Page size",n=>parseInt(n,10),50).option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(Tc,{context:s(),template:n.template?.toUpperCase(),pagination:{limit:n.limit,offset:0}});h(n,t.listSandboxTemplates.items);}catch(t){g(t);}}),f.command("get").description("Get template details").argument("<id>").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await b(Uc,{context:s(),id:n});if(!e.getSandboxTemplate)throw new o$1("Template not found");h(t,e.getSandboxTemplate);}catch(e){g(e);}}),f.command("create").description("Create sandbox template").requiredOption("--name <name>","Template name").requiredOption("--template <kind>","Template kind").option("--description <desc>","Description").option("--default","Mark as default").option("--ttl <seconds>","Default TTL",parseInt).option("-f, --format <format>","Output format").action(async n=>{try{let t={name:n.name,template:n.template.toUpperCase(),context:s()};n.description&&(t.description=n.description),n.default&&(t.isDefault=!0),n.ttl!==void 0&&(t.ttlSeconds=n.ttl);let e=await b(Vc,{input:t});i("Template created"),h(n,e.createSandboxTemplate);}catch(t){g(t);}}),f.command("update").description("Update sandbox template").argument("<id>").option("--name <name>","New name").option("--description <desc>","New description").option("--default","Mark as default").option("--ttl <seconds>","New default TTL",parseInt).option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e={id:n,context:s()};t.name&&(e.name=t.name),t.description&&(e.description=t.description),t.default!==void 0&&(e.isDefault=t.default),t.ttl!==void 0&&(e.ttlSeconds=t.ttl);let u=await b(Wc,{input:e});i("Template updated"),h(t,u.updateSandboxTemplate);}catch(e){g(e);}}),f.command("delete").description("Delete sandbox template").argument("<id>").option("--force","Skip confirmation").action(async(n,t)=>{try{if(!await q("Delete this template?",t.force))return;await b(Xc,{context:s(),id:n}),i("Template deleted");}catch(e){g(e);}});let l=d.command("tags").description("Manage sandbox tags");l.command("list").description("List available sandbox tags").option("--query <q>","Search query").option("--limit <n>","Page size",parseInt).option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(Yc,{query:n.query,limit:n.limit});h(n,t.availableSandboxTags);}catch(t){g(t);}}),l.command("create").description("Create a new sandbox tag").requiredOption("--label <label>","Tag label").option("--color <color>","Tag color").option("-f, --format <format>","Output format").action(async n=>{try{let t={label:n.label};n.color&&(t.color=n.color);let e=await b(_c,{input:t});i("Tag created"),h(n,e.createSandboxTag);}catch(t){g(t);}}),l.command("attach").description("Attach a tag to a sandbox").requiredOption("--sandbox <id>","Sandbox ID").requiredOption("--tag <id>","Tag ID").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b($c,{input:{sandboxId:n.sandbox,tagId:n.tag}});i("Tag attached"),h(n,t.tagSandbox);}catch(t){g(t);}}),l.command("detach").description("Detach a tag from a sandbox").requiredOption("--sandbox <id>","Sandbox ID").requiredOption("--tag <id>","Tag ID").action(async n=>{try{await b(ad,{input:{sandboxId:n.sandbox,tagId:n.tag}}),i("Tag detached");}catch(t){g(t);}}),l.command("get").description("Get tags assigned to a sandbox").requiredOption("--sandbox <id>","Sandbox ID").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(Zc,{input:{sandboxId:n.sandbox}});h(n,t.getSandboxTags);}catch(t){g(t);}}),l.command("replace").description("Replace all tags on a sandbox").requiredOption("--sandbox <id>","Sandbox ID").requiredOption("--tags <ids...>","Tag IDs (space separated)").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(bd,{input:{sandboxId:n.sandbox,tagIds:n.tags}});i("Tags replaced"),h(n,t.replaceSandboxTags);}catch(t){g(t);}});let m=d.command("admin").description("Admin / observability ops");m.command("nodes").description("List sandbox nodes").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(dd,{context:s()});h(n,t.listSandboxNodes);}catch(t){g(t);}}),m.command("all").description("List all sandboxes (admin)").option("--status <status>","Filter by status").option("--template <template>","Filter by template").option("--limit <n>","Page size",n=>parseInt(n,10),50).option("-f, --format <format>","Output format").action(async n=>{try{let t={};n.status&&(t.status=n.status.toUpperCase()),n.template&&(t.template=n.template.toUpperCase());let e=await b(cd,{context:s(),filter:Object.keys(t).length?t:void 0,pagination:{limit:n.limit,offset:0}});h(n,e.listAllSandboxes.items);}catch(t){g(t);}}),m.command("active").description("Get active sandboxes").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(ed,{context:s()});h(n,t.getActiveSandboxes);}catch(t){g(t);}}),m.command("activity").description("Get recent sandbox activity").option("--limit <n>","Max items",parseInt,20).option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(fd,{context:s(),limit:n.limit});h(n,t.getRecentSandboxActivity.items);}catch(t){g(t);}}),m.command("stats").description("Get sandbox stats").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(gd,{context:s()});h(n,t.getSandboxStats);}catch(t){g(t);}}),m.command("logs").description("Get logs for a sandbox container").argument("<id>").requiredOption("--container <name>","Container name").option("--tail <n>","Tail lines",parseInt,100).action(async(n,t)=>{try{let e=await b(hd,{context:s(),id:n,containerName:t.container,tailLines:t.tail});process.stdout.write(e.getSandboxLogs);}catch(e){g(e);}});let b$1=m.command("config").description("Sandbox config");b$1.command("get").description("Get sandbox config").option("-f, --format <format>","Output format").action(async n=>{try{let t=await b(id,{context:s()});h(n,t.getSandboxConfig);}catch(t){g(t);}}),b$1.command("set").description("Update sandbox config").option("--default-ttl <seconds>","Default TTL",parseInt).option("--max-ttl <seconds>","Max TTL",parseInt).option("--max-per-user <n>","Max concurrent per user",parseInt).option("--max-per-workspace <n>","Max concurrent per workspace",parseInt).option("-f, --format <format>","Output format").action(async n=>{try{let t={context:s()};n.defaultTtl!==void 0&&(t.defaultTtlSeconds=n.defaultTtl),n.maxTtl!==void 0&&(t.maxTtlSeconds=n.maxTtl),n.maxPerUser!==void 0&&(t.maxConcurrentPerUser=n.maxPerUser),n.maxPerWorkspace!==void 0&&(t.maxConcurrentPerWorkspace=n.maxPerWorkspace);let e=await b(jd,{input:t});i("Config updated"),h(n,e.updateSandboxConfig);}catch(t){g(t);}});}var K={id:"sandbox",version:"1.0.0",displayName:"Sandbox",dependsOn:["auth","workspaces"],register(p,d){a(d),$(p);}},it=K;export{it as default};
|
|
@@ -1,63 +1,69 @@
|
|
|
1
|
-
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var u=class extends Error{exitCode;hint;constructor(o,s){super(o),this.name="CliUserError",this.exitCode=s?.exitCode??1,this.hint=s?.hint;}};var l=class extends Error{cause;constructor(o,s){super(o),this.name="CliInternalError",this.cause=s;}};var h=null;function R(r){h=r;}function g(){if(!h)throw new l("vibecontrols module helpers used before setHelpersContext was called");return h}async function a(r,o){return g().gql.global.request(r,o)}function c(r){let o=r instanceof Error?r.message:String(r);throw new u(o)}function p(r,o,s){g().output.formatAndOutput(r,o,s);}function w(r){g().output.printSuccess(r);}function C(r){return g().output.formatStatus(r)}function y(r){return g().output.formatDate(r)}function f(r,o){return g().output.truncate(r,o)}var k=`
|
|
2
|
+
id name slug description price currency type status downloads
|
|
3
|
+
publisher { id name isVerified }
|
|
4
|
+
`,x=`
|
|
5
|
+
id currency subtotal total itemCount isEmpty
|
|
6
|
+
items { id productId productName variantId workspaceId quantity unitPrice subtotal }
|
|
7
|
+
`,I=`
|
|
8
|
+
id status total currency purchasedAt billingAccountId createdAt lineItems
|
|
9
|
+
`,$=`
|
|
10
|
+
query SearchStore($input: BrowseStoreInput!) {
|
|
11
|
+
browseStore(input: $input) {
|
|
12
|
+
products { ${k} }
|
|
13
|
+
totalCount hasMore nextCursor
|
|
7
14
|
}
|
|
8
|
-
|
|
15
|
+
}
|
|
16
|
+
`,D=`
|
|
9
17
|
query MyCart {
|
|
10
|
-
myCart {
|
|
11
|
-
id currency subtotal total itemCount isEmpty
|
|
12
|
-
items { id productId quantity }
|
|
13
|
-
}
|
|
18
|
+
myCart { ${x} }
|
|
14
19
|
}
|
|
15
|
-
`,
|
|
20
|
+
`,q=`
|
|
16
21
|
mutation AddToCart($input: AddToCartInput!) {
|
|
17
22
|
addToCart(input: $input) {
|
|
18
|
-
|
|
23
|
+
cart { ${x} }
|
|
24
|
+
errors { code field message }
|
|
19
25
|
}
|
|
20
26
|
}
|
|
21
|
-
`,
|
|
22
|
-
mutation RemoveFromCart($
|
|
23
|
-
removeFromCart(
|
|
24
|
-
|
|
27
|
+
`,P=`
|
|
28
|
+
mutation RemoveFromCart($cartItemId: String!) {
|
|
29
|
+
removeFromCart(cartItemId: $cartItemId) {
|
|
30
|
+
cart { ${x} }
|
|
31
|
+
errors { code field message }
|
|
25
32
|
}
|
|
26
33
|
}
|
|
27
|
-
`,
|
|
28
|
-
mutation
|
|
29
|
-
|
|
30
|
-
success
|
|
34
|
+
`,L=`
|
|
35
|
+
mutation Checkout($input: CheckoutInput!) {
|
|
36
|
+
checkout(input: $input) {
|
|
37
|
+
success
|
|
38
|
+
order { ${I} }
|
|
39
|
+
errors { code field message }
|
|
31
40
|
}
|
|
32
41
|
}
|
|
33
|
-
|
|
42
|
+
`,_=`
|
|
34
43
|
query GetOrders($limit: Int, $offset: Int, $status: OrderStatus) {
|
|
35
|
-
myOrders(limit: $limit, offset: $offset, status: $status) {
|
|
36
|
-
id status total currency createdAt
|
|
37
|
-
}
|
|
44
|
+
myOrders(limit: $limit, offset: $offset, status: $status) { ${I} }
|
|
38
45
|
}
|
|
39
|
-
`,
|
|
40
|
-
query
|
|
41
|
-
|
|
42
|
-
id status total currency paidAt billingAccountId
|
|
43
|
-
lineItems { productId quantity unitPrice }
|
|
44
|
-
}
|
|
46
|
+
`,N=`
|
|
47
|
+
query GetStoreOrder($id: ID!) {
|
|
48
|
+
getStoreOrder(id: $id) { ${I} }
|
|
45
49
|
}
|
|
46
|
-
`,
|
|
50
|
+
`,F=`
|
|
47
51
|
query GetInstalledProducts {
|
|
48
52
|
myStoreAppInstallations {
|
|
49
53
|
items { id productId workspaceId status version installedAt }
|
|
50
54
|
total hasMore
|
|
51
55
|
}
|
|
52
56
|
}
|
|
53
|
-
`,
|
|
54
|
-
mutation
|
|
55
|
-
|
|
57
|
+
`,G=`
|
|
58
|
+
mutation RecordAppUninstallation($productId: String!, $workspaceId: String!) {
|
|
59
|
+
recordAppUninstallation(productId: $productId, workspaceId: $workspaceId) {
|
|
60
|
+
id productId workspaceId status uninstalledAt
|
|
61
|
+
}
|
|
56
62
|
}
|
|
57
|
-
`,
|
|
58
|
-
query
|
|
59
|
-
|
|
60
|
-
id
|
|
63
|
+
`,M=`
|
|
64
|
+
query EntitlementSeats($entitlementId: ID!) {
|
|
65
|
+
entitlementSeats(entitlementId: $entitlementId) {
|
|
66
|
+
id entitlementId assigneeUserId assigneeEmail role assignedAt revokedAt revocationReason
|
|
61
67
|
}
|
|
62
68
|
}
|
|
63
|
-
`;function
|
|
69
|
+
`;function T(r){if(r&&r.length>0)throw new u(r.map(o=>o.message).join("; "))}function W(r){let o=r.command("store").description("Store: marketplace, cart, orders, installed apps");o.command("search").description("Search the store").argument("<query>").option("--type <t>").option("--category <c>").option("--limit <n>","Page size",t=>parseInt(t,10),20).option("-f, --format <format>").action(async(t,e)=>{try{let n={search:t};e.type&&(n.type=e.type.toUpperCase()),e.category&&(n.categories=[e.category]);let d={filter:n,pagination:{limit:e.limit,offset:0},sortBy:"RELEVANCE"},v=await a($,{input:d});p(e,v.browseStore.products,{headers:["ID","Name","Type","Price"],rows:v.browseStore.products.map(m=>[f(m.id,12),m.name,m.type??"-",`${m.price??"-"} ${m.currency??""}`.trim()])});}catch(n){c(n);}});let s=o.command("cart").description("Shopping cart");s.command("list").description("Show current cart").option("-f, --format <format>").action(async t=>{try{let e=await a(D);p(t,e.myCart);}catch(e){c(e);}}),s.command("add").description("Add a product to the cart").requiredOption("--product <id>").option("--quantity <n>","",t=>parseInt(t,10),1).option("--variant <id>").option("--workspace <id>","Workspace the product is bought for").option("-f, --format <format>").action(async t=>{try{let e={productId:t.product,quantity:t.quantity,variantId:t.variant,workspaceId:t.workspace},n=await a(q,{input:e});T(n.addToCart.errors),w("Added to cart"),p(t,n.addToCart.cart);}catch(e){c(e);}}),s.command("remove").description("Remove an item from the cart").requiredOption("--item <id>","Cart item id (from `store cart list`)").action(async t=>{try{let e=await a(P,{cartItemId:t.item});T(e.removeFromCart.errors),w("Item removed from cart");}catch(e){c(e);}}),s.command("checkout").description("Check out your cart").option("--account <id>","Billing account to charge").option("--payment-method <id>").option("--workspace <id>").option("--notes <s>").option("-f, --format <format>").action(async t=>{try{let e={billingAccountId:t.account,paymentMethodId:t.paymentMethod,workspaceId:t.workspace,notes:t.notes},n=await a(L,{input:e});T(n.checkout.errors),n.checkout.success&&w("Checkout complete"),p(t,n.checkout);}catch(e){c(e);}});let b=o.command("orders").description("Orders");b.command("list").description("List orders").option("--limit <n>","Page size",t=>parseInt(t,10),50).option("-f, --format <format>").action(async t=>{try{let e=await a(_,{limit:t.limit,offset:0});p(t,e.myOrders,{headers:["ID","Status","Total","Currency","Created"],rows:e.myOrders.map(n=>[f(n.id,12),C(n.status),String(n.total??"-"),n.currency??"-",y(n.createdAt)])});}catch(e){c(e);}}),b.command("get").description("Get an order").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let n=await a(N,{id:t});if(!n.getStoreOrder)throw new u(`Order ${t} not found`);p(e,n.getStoreOrder);}catch(n){c(n);}});let E=o.command("installed").description("Installed products");E.command("list").description("List the current user's installed store apps").option("-f, --format <format>").action(async t=>{try{let n=(await a(F)).myStoreAppInstallations.items;p(t,n,{headers:["InstallationID","ProductID","Workspace","Status","Version","Installed"],rows:n.map(d=>[f(d.id,12),f(d.productId,12),f(d.workspaceId,12),C(d.status),d.version??"-",y(d.installedAt)])});}catch(e){c(e);}}),E.command("uninstall").description("Record that a store product was uninstalled from a workspace").requiredOption("--product <id>").requiredOption("--workspace <id>").action(async t=>{try{await a(G,{productId:t.product,workspaceId:t.workspace}),w("Product uninstalled");}catch(e){c(e);}}),o.command("licenses").description("Licenses").command("list").description("List the license seats of an entitlement").requiredOption("--entitlement <id>").option("-f, --format <format>").action(async t=>{try{let e=await a(M,{entitlementId:t.entitlement});p(t,e.entitlementSeats);}catch(e){c(e);}});}var ee={id:"store",version:"1.0.0",displayName:"Store",dependsOn:["auth"],register(r,o){R(o),W(r);}},gt=ee;module.exports=gt;
|
|
@@ -1,63 +1,69 @@
|
|
|
1
|
-
import {a,c,h
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import {a,c,h,p,g,i,n,o}from'../../chunk-W4JZR7RJ.js';import {o as o$1}from'../../chunk-YIY5IDXQ.js';var f=`
|
|
2
|
+
id name slug description price currency type status downloads
|
|
3
|
+
publisher { id name isVerified }
|
|
4
|
+
`,C=`
|
|
5
|
+
id currency subtotal total itemCount isEmpty
|
|
6
|
+
items { id productId productName variantId workspaceId quantity unitPrice subtotal }
|
|
7
|
+
`,I=`
|
|
8
|
+
id status total currency purchasedAt billingAccountId createdAt lineItems
|
|
9
|
+
`,T=`
|
|
10
|
+
query SearchStore($input: BrowseStoreInput!) {
|
|
11
|
+
browseStore(input: $input) {
|
|
12
|
+
products { ${f} }
|
|
13
|
+
totalCount hasMore nextCursor
|
|
7
14
|
}
|
|
8
|
-
|
|
15
|
+
}
|
|
16
|
+
`,k=`
|
|
9
17
|
query MyCart {
|
|
10
|
-
myCart {
|
|
11
|
-
id currency subtotal total itemCount isEmpty
|
|
12
|
-
items { id productId quantity }
|
|
13
|
-
}
|
|
18
|
+
myCart { ${C} }
|
|
14
19
|
}
|
|
15
|
-
|
|
20
|
+
`,$=`
|
|
16
21
|
mutation AddToCart($input: AddToCartInput!) {
|
|
17
22
|
addToCart(input: $input) {
|
|
18
|
-
|
|
23
|
+
cart { ${C} }
|
|
24
|
+
errors { code field message }
|
|
19
25
|
}
|
|
20
26
|
}
|
|
21
|
-
`,
|
|
22
|
-
mutation RemoveFromCart($
|
|
23
|
-
removeFromCart(
|
|
24
|
-
|
|
27
|
+
`,_=`
|
|
28
|
+
mutation RemoveFromCart($cartItemId: String!) {
|
|
29
|
+
removeFromCart(cartItemId: $cartItemId) {
|
|
30
|
+
cart { ${C} }
|
|
31
|
+
errors { code field message }
|
|
25
32
|
}
|
|
26
33
|
}
|
|
27
|
-
`,
|
|
28
|
-
mutation
|
|
29
|
-
|
|
30
|
-
success
|
|
34
|
+
`,D=`
|
|
35
|
+
mutation Checkout($input: CheckoutInput!) {
|
|
36
|
+
checkout(input: $input) {
|
|
37
|
+
success
|
|
38
|
+
order { ${I} }
|
|
39
|
+
errors { code field message }
|
|
31
40
|
}
|
|
32
41
|
}
|
|
33
|
-
`,
|
|
42
|
+
`,b=`
|
|
34
43
|
query GetOrders($limit: Int, $offset: Int, $status: OrderStatus) {
|
|
35
|
-
myOrders(limit: $limit, offset: $offset, status: $status) {
|
|
36
|
-
id status total currency createdAt
|
|
37
|
-
}
|
|
44
|
+
myOrders(limit: $limit, offset: $offset, status: $status) { ${I} }
|
|
38
45
|
}
|
|
39
|
-
|
|
40
|
-
query
|
|
41
|
-
|
|
42
|
-
id status total currency paidAt billingAccountId
|
|
43
|
-
lineItems { productId quantity unitPrice }
|
|
44
|
-
}
|
|
46
|
+
`,v=`
|
|
47
|
+
query GetStoreOrder($id: ID!) {
|
|
48
|
+
getStoreOrder(id: $id) { ${I} }
|
|
45
49
|
}
|
|
46
|
-
`,
|
|
50
|
+
`,x=`
|
|
47
51
|
query GetInstalledProducts {
|
|
48
52
|
myStoreAppInstallations {
|
|
49
53
|
items { id productId workspaceId status version installedAt }
|
|
50
54
|
total hasMore
|
|
51
55
|
}
|
|
52
56
|
}
|
|
53
|
-
`,
|
|
54
|
-
mutation
|
|
55
|
-
|
|
57
|
+
`,q=`
|
|
58
|
+
mutation RecordAppUninstallation($productId: String!, $workspaceId: String!) {
|
|
59
|
+
recordAppUninstallation(productId: $productId, workspaceId: $workspaceId) {
|
|
60
|
+
id productId workspaceId status uninstalledAt
|
|
61
|
+
}
|
|
56
62
|
}
|
|
57
63
|
`,L=`
|
|
58
|
-
query
|
|
59
|
-
|
|
60
|
-
id
|
|
64
|
+
query EntitlementSeats($entitlementId: ID!) {
|
|
65
|
+
entitlementSeats(entitlementId: $entitlementId) {
|
|
66
|
+
id entitlementId assigneeUserId assigneeEmail role assignedAt revokedAt revocationReason
|
|
61
67
|
}
|
|
62
68
|
}
|
|
63
|
-
`;function
|
|
69
|
+
`;function S(c){if(c&&c.length>0)throw new o$1(c.map(s=>s.message).join("; "))}function M(c$1){let s=c$1.command("store").description("Store: marketplace, cart, orders, installed apps");s.command("search").description("Search the store").argument("<query>").option("--type <t>").option("--category <c>").option("--limit <n>","Page size",r=>parseInt(r,10),20).option("-f, --format <format>").action(async(r,t)=>{try{let e={search:r};t.type&&(e.type=t.type.toUpperCase()),t.category&&(e.categories=[t.category]);let a={filter:e,pagination:{limit:t.limit,offset:0},sortBy:"RELEVANCE"},h$1=await c(T,{input:a});h(t,h$1.browseStore.products,{headers:["ID","Name","Type","Price"],rows:h$1.browseStore.products.map(m=>[p(m.id,12),m.name,m.type??"-",`${m.price??"-"} ${m.currency??""}`.trim()])});}catch(e){g(e);}});let u=s.command("cart").description("Shopping cart");u.command("list").description("Show current cart").option("-f, --format <format>").action(async r=>{try{let t=await c(k);h(r,t.myCart);}catch(t){g(t);}}),u.command("add").description("Add a product to the cart").requiredOption("--product <id>").option("--quantity <n>","",r=>parseInt(r,10),1).option("--variant <id>").option("--workspace <id>","Workspace the product is bought for").option("-f, --format <format>").action(async r=>{try{let t={productId:r.product,quantity:r.quantity,variantId:r.variant,workspaceId:r.workspace},e=await c($,{input:t});S(e.addToCart.errors),i("Added to cart"),h(r,e.addToCart.cart);}catch(t){g(t);}}),u.command("remove").description("Remove an item from the cart").requiredOption("--item <id>","Cart item id (from `store cart list`)").action(async r=>{try{let t=await c(_,{cartItemId:r.item});S(t.removeFromCart.errors),i("Item removed from cart");}catch(t){g(t);}}),u.command("checkout").description("Check out your cart").option("--account <id>","Billing account to charge").option("--payment-method <id>").option("--workspace <id>").option("--notes <s>").option("-f, --format <format>").action(async r=>{try{let t={billingAccountId:r.account,paymentMethodId:r.paymentMethod,workspaceId:r.workspace,notes:r.notes},e=await c(D,{input:t});S(e.checkout.errors),e.checkout.success&&i("Checkout complete"),h(r,e.checkout);}catch(t){g(t);}});let w=s.command("orders").description("Orders");w.command("list").description("List orders").option("--limit <n>","Page size",r=>parseInt(r,10),50).option("-f, --format <format>").action(async r=>{try{let t=await c(b,{limit:r.limit,offset:0});h(r,t.myOrders,{headers:["ID","Status","Total","Currency","Created"],rows:t.myOrders.map(e=>[p(e.id,12),n(e.status),String(e.total??"-"),e.currency??"-",o(e.createdAt)])});}catch(t){g(t);}}),w.command("get").description("Get an order").argument("<id>").option("-f, --format <format>").action(async(r,t)=>{try{let e=await c(v,{id:r});if(!e.getStoreOrder)throw new o$1(`Order ${r} not found`);h(t,e.getStoreOrder);}catch(e){g(e);}});let R=s.command("installed").description("Installed products");R.command("list").description("List the current user's installed store apps").option("-f, --format <format>").action(async r=>{try{let e=(await c(x)).myStoreAppInstallations.items;h(r,e,{headers:["InstallationID","ProductID","Workspace","Status","Version","Installed"],rows:e.map(a=>[p(a.id,12),p(a.productId,12),p(a.workspaceId,12),n(a.status),a.version??"-",o(a.installedAt)])});}catch(t){g(t);}}),R.command("uninstall").description("Record that a store product was uninstalled from a workspace").requiredOption("--product <id>").requiredOption("--workspace <id>").action(async r=>{try{await c(q,{productId:r.product,workspaceId:r.workspace}),i("Product uninstalled");}catch(t){g(t);}}),s.command("licenses").description("Licenses").command("list").description("List the license seats of an entitlement").requiredOption("--entitlement <id>").option("-f, --format <format>").action(async r=>{try{let t=await c(L,{entitlementId:r.entitlement});h(r,t.entitlementSeats);}catch(t){g(t);}});}var G={id:"store",version:"1.0.0",displayName:"Store",dependsOn:["auth"],register(c,s){a(s),M(c);}},K=G;export{K as default};
|