@burdenoff/cli-sdk 2026.1102.1 → 2026.1102.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/dist/chunk-O6UCQ5IT.js +1 -0
  2. package/dist/{chunk-AYNNSLCL.js → chunk-ZGT7IIOP.js} +409 -418
  3. package/dist/modules/adaptercloud/index.cjs +9 -6
  4. package/dist/modules/adaptercloud/index.js +7 -4
  5. package/dist/modules/artistrybase/index.js +2 -2
  6. package/dist/modules/assethandler/index.cjs +2 -2
  7. package/dist/modules/assethandler/index.js +2 -2
  8. package/dist/modules/atheletebridge/index.cjs +35 -21
  9. package/dist/modules/atheletebridge/index.js +33 -19
  10. package/dist/modules/auth/index.cjs +37 -37
  11. package/dist/modules/auth/index.js +33 -29
  12. package/dist/modules/billing/index.cjs +1 -1
  13. package/dist/modules/billing/index.js +2 -2
  14. package/dist/modules/brainyrich/index.cjs +44 -28
  15. package/dist/modules/brainyrich/index.js +47 -31
  16. package/dist/modules/buildmyiq/index.cjs +64 -67
  17. package/dist/modules/buildmyiq/index.js +60 -63
  18. package/dist/modules/channels/index.cjs +3 -3
  19. package/dist/modules/channels/index.js +2 -2
  20. package/dist/modules/collabkin/index.cjs +4 -4
  21. package/dist/modules/collabkin/index.js +2 -2
  22. package/dist/modules/comradecircle/index.cjs +24 -16
  23. package/dist/modules/comradecircle/index.js +20 -12
  24. package/dist/modules/conversations/index.cjs +7 -7
  25. package/dist/modules/conversations/index.js +2 -2
  26. package/dist/modules/coolandlovely/index.cjs +28 -15
  27. package/dist/modules/coolandlovely/index.js +30 -17
  28. package/dist/modules/cosmicintersection/index.cjs +6 -6
  29. package/dist/modules/cosmicintersection/index.js +2 -2
  30. package/dist/modules/crewfoundry/index.js +2 -2
  31. package/dist/modules/devportal/index.cjs +2 -2
  32. package/dist/modules/devportal/index.js +2 -2
  33. package/dist/modules/ecoimpacthub/index.cjs +23 -13
  34. package/dist/modules/ecoimpacthub/index.js +20 -10
  35. package/dist/modules/eventfullymanaged/index.cjs +74 -74
  36. package/dist/modules/eventfullymanaged/index.js +78 -78
  37. package/dist/modules/export/index.cjs +4 -4
  38. package/dist/modules/export/index.js +2 -2
  39. package/dist/modules/files/index.cjs +3 -3
  40. package/dist/modules/files/index.js +4 -4
  41. package/dist/modules/fluidgrids/index.cjs +16 -16
  42. package/dist/modules/fluidgrids/index.js +3 -3
  43. package/dist/modules/ggnomad/index.cjs +4 -4
  44. package/dist/modules/ggnomad/index.js +2 -2
  45. package/dist/modules/govcitizenhub/index.cjs +10 -7
  46. package/dist/modules/govcitizenhub/index.js +8 -5
  47. package/dist/modules/groups/index.cjs +4 -4
  48. package/dist/modules/groups/index.js +2 -2
  49. package/dist/modules/headshotmarketing/index.js +2 -2
  50. package/dist/modules/hookmovies/index.cjs +6 -6
  51. package/dist/modules/hookmovies/index.js +2 -2
  52. package/dist/modules/housingvista/index.cjs +3 -3
  53. package/dist/modules/housingvista/index.js +2 -2
  54. package/dist/modules/integrations/index.cjs +5 -5
  55. package/dist/modules/integrations/index.js +2 -2
  56. package/dist/modules/intelwatchtower/index.cjs +28 -16
  57. package/dist/modules/intelwatchtower/index.js +25 -13
  58. package/dist/modules/kadaikodi/index.cjs +2 -2
  59. package/dist/modules/kadaikodi/index.js +2 -2
  60. package/dist/modules/labsofscience/index.cjs +10 -6
  61. package/dist/modules/labsofscience/index.js +9 -5
  62. package/dist/modules/manufacturedops/index.cjs +35 -22
  63. package/dist/modules/manufacturedops/index.js +35 -22
  64. package/dist/modules/movethewheels/index.js +2 -2
  65. package/dist/modules/notifications/index.cjs +2 -2
  66. package/dist/modules/notifications/index.js +2 -2
  67. package/dist/modules/organizations/index.js +2 -2
  68. package/dist/modules/planmagnet/index.cjs +21 -21
  69. package/dist/modules/planmagnet/index.js +32 -32
  70. package/dist/modules/products/index.cjs +4 -4
  71. package/dist/modules/products/index.js +2 -2
  72. package/dist/modules/proserviceworld/index.cjs +18 -13
  73. package/dist/modules/proserviceworld/index.js +18 -13
  74. package/dist/modules/rbac/index.js +2 -2
  75. package/dist/modules/sandbox/index.cjs +17 -17
  76. package/dist/modules/sandbox/index.js +1 -1
  77. package/dist/modules/scheduler/index.cjs +2 -2
  78. package/dist/modules/scheduler/index.js +2 -2
  79. package/dist/modules/security/index.cjs +3 -3
  80. package/dist/modules/security/index.js +2 -2
  81. package/dist/modules/semanticfed/index.cjs +3 -3
  82. package/dist/modules/semanticfed/index.js +2 -2
  83. package/dist/modules/store/index.cjs +3 -3
  84. package/dist/modules/store/index.js +2 -2
  85. package/dist/modules/subscriberbot/index.cjs +43 -19
  86. package/dist/modules/subscriberbot/index.js +47 -23
  87. package/dist/modules/support/index.cjs +2 -2
  88. package/dist/modules/support/index.js +2 -2
  89. package/dist/modules/tags/index.js +2 -2
  90. package/dist/modules/technospam/index.cjs +18 -9
  91. package/dist/modules/technospam/index.js +18 -9
  92. package/dist/modules/theculturepost/index.cjs +27 -22
  93. package/dist/modules/theculturepost/index.js +32 -27
  94. package/dist/modules/theglobalfuel/index.cjs +65 -60
  95. package/dist/modules/theglobalfuel/index.js +65 -60
  96. package/dist/modules/timecampus/index.js +2 -2
  97. package/dist/modules/tours/index.cjs +2 -2
  98. package/dist/modules/tours/index.js +2 -2
  99. package/dist/modules/vibecontrols/index.cjs +563 -567
  100. package/dist/modules/vibecontrols/index.js +5 -4
  101. package/dist/modules/workspaces/index.cjs +4 -4
  102. package/dist/modules/workspaces/index.js +2 -2
  103. package/package.json +1 -1
  104. package/dist/chunk-W4JZR7RJ.js +0 -1
@@ -1,4 +1,4 @@
1
- import {a,b,h as h$1,p,n,o,g,i as i$1,k,s}from'../../chunk-W4JZR7RJ.js';import {o as o$1}from'../../chunk-YIY5IDXQ.js';import {writeFile}from'fs/promises';var J=`
1
+ import {a,b,i as i$1,r,p,q,h as h$1,k,m,u}from'../../chunk-O6UCQ5IT.js';import {o}from'../../chunk-YIY5IDXQ.js';import {writeFile}from'fs/promises';var J=`
2
2
  query ListExportJobs($context: ContextInput!, $filter: ExportJobFilterInput, $pagination: ExportPaginationInput) {
3
3
  listExportJobs(context: $context, filter: $filter, pagination: $pagination) {
4
4
  edges { node {
@@ -92,4 +92,4 @@ import {a,b,h as h$1,p,n,o,g,i as i$1,k,s}from'../../chunk-W4JZR7RJ.js';import {
92
92
  downloadUrl downloadExpiresAt
93
93
  }
94
94
  }
95
- `;function i(){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 X(l){let m=l.command("export").description("Workspace data export jobs"),u=m.command("jobs").description("Export job lifecycle");u.command("list").description("List export jobs").option("--status <s>").option("--limit <n>","Page size",t=>parseInt(t,10),50).option("-f, --format <format>").action(async t=>{try{let e={};t.status&&(e.status=t.status.toUpperCase());let n$1=(await b(J,{context:i(),filter:Object.keys(e).length?e:void 0,pagination:{first:t.limit}})).listExportJobs.edges.map(p=>p.node);h$1(t,n$1,{headers:["ID","Name","Status","Progress","Started"],rows:n$1.map(p$1=>[p(p$1.id,12),p$1.name??"-",n(p$1.status),`${p$1.processedEntities??0}/${p$1.totalEntities??"-"}`,o(p$1.startedAt)])});}catch(e){g(e);}}),u.command("get").description("Get an export job").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let o=await b(E,{context:i(),id:t});if(!o.getExportJob)throw new o$1(`Export job ${t} not found`);h$1(e,o.getExportJob);}catch(o){g(o);}}),u.command("create").description("Create an export job").requiredOption("--name <s>").requiredOption("--types <t>","Comma-separated entity types").option("--format <fmt>","JSON|CSV|ZIP","JSON").option("--include-media","Include media files",false).option("--include-metadata","Include metadata",true).option("--from <iso>","Date range start").option("--to <iso>","Date range end").option("-f, --format-output <format>").action(async t=>{try{let e={name:t.name,entityTypes:t.types.split(","),format:(t.format??"JSON").toUpperCase(),includeMedia:!!t.includeMedia,includeMetadata:t.includeMetadata!==!1,dateRangeStart:t.from,dateRangeEnd:t.to},o=await b(O,{context:i(),input:e});i$1(`Export job created: ${o.createExportJob.id}`),h$1({format:t.formatOutput},o.createExportJob);}catch(e){g(e);}}),u.command("cancel").description("Cancel a running export job").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let o=await b(R,{context:i(),id:t});i$1(`Export job cancelled: ${o.cancelExportJob.id}`),h$1(e,o.cancelExportJob);}catch(o){g(o);}}),u.command("delete").description("Delete an export job").argument("<id>").action(async t=>{try{if(!(await b(A,{context:i(),id:t})).deleteExportJob)throw new o$1(`Failed to delete export job ${t}`);i$1(`Export job deleted: ${t}`);}catch(e){g(e);}}),u.command("retry").description("Retry a failed export job").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let o=await b(M,{context:i(),id:t});i$1(`Export job retry queued: ${o.retryExportJob.id}`),h$1(e,o.retryExportJob);}catch(o){g(o);}}),m.command("entities").description("List entity types available for export").option("--limit <n>","Page size",t=>parseInt(t,10),50).option("-f, --format <format>").action(async t=>{try{let o=(await b(L,{context:i(),pagination:{first:t.limit}})).getAvailableExportEntities.edges.map(n=>n.node);h$1(t,o,{headers:["Type","Display","Enabled","DateRange","Media","Size"],rows:o.map(n=>[n.entityType,n.displayName,n.enabled?"yes":"no",n.supportsDateRange?"yes":"no",n.supportsMediaExport?"yes":"no",n.estimatedSize??"-"])});}catch(e){g(e);}}),m.command("part").description("Get an export part by id").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let o=await b(S,{context:i(),id:t});if(!o.getExportPart)throw new o$1(`Export part ${t} not found`);h$1(e,o.getExportPart);}catch(o){g(o);}}),m.command("download").description("Download a completed export job to a local path").argument("<jobId>").requiredOption("--to <path>","Local file path to write").action(async(t,e)=>{try{let o=await b(E,{context:i(),id:t});if(!o.getExportJob)throw new o$1(`Export job ${t} not found`);let n=o.getExportJob.downloadUrl;if(!n)throw new o$1(`Job ${t} has no downloadUrl yet (status=${o.getExportJob.status??"UNKNOWN"}).`);k(`Downloading from ${n}`);let p=await fetch(n);if(!p.ok)throw new o$1(`Download failed: ${p.status} ${p.statusText}`);let f=Buffer.from(await p.arrayBuffer());await writeFile(e.to,f),i$1(`Saved ${f.length} bytes to ${e.to}`);}catch(o){g(o);}});let x=m.command("templates").description("Export templates");x.command("list").description("List export templates").option("--limit <n>","Page size",t=>parseInt(t,10),50).option("-f, --format <format>").action(async t=>{try{let e=await b(P,{context:i(),pagination:{first:t.limit}});h$1(t,e.listExportTemplates.edges.map(o=>o.node));}catch(e){g(e);}}),x.command("get").description("Get an export template").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let o=await b(_,{context:i(),id:t});if(!o.getExportTemplate)throw new o$1(`Template ${t} not found`);h$1(e,o.getExportTemplate);}catch(o){g(o);}}),x.command("create").description("Create an export template").requiredOption("--name <s>").requiredOption("--types <t>","Comma-separated entity types").option("--description <s>").option("--format <fmt>","JSON|CSV","JSON").option("--include-media","Include media files",false).option("--include-metadata","Include metadata",true).option("-f, --format-output <format>").action(async t=>{try{let e={name:t.name,entityTypes:t.types.split(","),format:(t.format??"JSON").toUpperCase(),includeMedia:!!t.includeMedia,includeMetadata:t.includeMetadata!==!1};t.description&&(e.description=t.description);let o=await b(N,{context:i(),input:e});i$1(`Template created: ${o.createExportTemplate.id}`),h$1({format:t.formatOutput},o.createExportTemplate);}catch(e){g(e);}}),x.command("update").description("Update an export template").argument("<id>").option("--name <s>").option("--description <s>").option("--types <t>","Comma-separated entity types").option("--format <fmt>","JSON|CSV").option("--include-media <bool>","true|false").option("--include-metadata <bool>","true|false").option("--default <bool>","Set isDefault: true|false").option("-f, --format-output <format>").action(async(t,e)=>{try{let o={};e.name&&(o.name=e.name),e.description&&(o.description=e.description),e.types&&(o.entityTypes=e.types.split(",")),e.format&&(o.format=e.format.toUpperCase()),e.includeMedia!==void 0&&(o.includeMedia=e.includeMedia==="true"),e.includeMetadata!==void 0&&(o.includeMetadata=e.includeMetadata==="true"),e.default!==void 0&&(o.isDefault=e.default==="true");let n=await b(h,{context:i(),id:t,input:o});i$1(`Template updated: ${n.updateExportTemplate.id}`),h$1({format:e.formatOutput},n.updateExportTemplate);}catch(o){g(o);}}),x.command("delete").description("Delete an export template").argument("<id>").action(async t=>{try{if(!(await b(D,{context:i(),id:t})).deleteExportTemplate)throw new o$1(`Failed to delete template ${t}`);i$1(`Template deleted: ${t}`);}catch(e){g(e);}});}var U={id:"export",version:"1.0.0",displayName:"Export",dependsOn:["auth","workspaces"],register(l,m){a(m),X(l);}},W=U;export{W as default};
95
+ `;function i(){let l=u().auth.read();if(!l?.workspaceId)throw new o("No workspace set. Run: vibecontrols workspace set <id>");return {workspaceId:l.workspaceId}}function X(l){let m$1=l.command("export").description("Workspace data export jobs"),u=m$1.command("jobs").description("Export job lifecycle");u.command("list").description("List export jobs").option("--status <s>").option("--limit <n>","Page size",t=>parseInt(t,10),50).option("-f, --format <format>").action(async t=>{try{let e={};t.status&&(e.status=t.status.toUpperCase());let n=(await b(J,{context:i(),filter:Object.keys(e).length?e:void 0,pagination:{first:t.limit}})).listExportJobs.edges.map(p=>p.node);i$1(t,n,{headers:["ID","Name","Status","Progress","Started"],rows:n.map(p$1=>[r(p$1.id,12),p$1.name??"-",p(p$1.status),`${p$1.processedEntities??0}/${p$1.totalEntities??"-"}`,q(p$1.startedAt)])});}catch(e){h$1(e);}}),u.command("get").description("Get an export job").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let o$1=await b(E,{context:i(),id:t});if(!o$1.getExportJob)throw new o(`Export job ${t} not found`);i$1(e,o$1.getExportJob);}catch(o){h$1(o);}}),u.command("create").description("Create an export job").requiredOption("--name <s>").requiredOption("--types <t>","Comma-separated entity types").option("--format <fmt>","JSON|CSV|ZIP","JSON").option("--include-media","Include media files",false).option("--include-metadata","Include metadata",true).option("--from <iso>","Date range start").option("--to <iso>","Date range end").option("-f, --format-output <format>").action(async t=>{try{let e={name:t.name,entityTypes:t.types.split(","),format:(t.format??"JSON").toUpperCase(),includeMedia:!!t.includeMedia,includeMetadata:t.includeMetadata!==!1,dateRangeStart:t.from,dateRangeEnd:t.to},o=await b(O,{context:i(),input:e});k(`Export job created: ${o.createExportJob.id}`),i$1({format:t.formatOutput},o.createExportJob);}catch(e){h$1(e);}}),u.command("cancel").description("Cancel a running export job").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let o=await b(R,{context:i(),id:t});k(`Export job cancelled: ${o.cancelExportJob.id}`),i$1(e,o.cancelExportJob);}catch(o){h$1(o);}}),u.command("delete").description("Delete an export job").argument("<id>").action(async t=>{try{if(!(await b(A,{context:i(),id:t})).deleteExportJob)throw new o(`Failed to delete export job ${t}`);k(`Export job deleted: ${t}`);}catch(e){h$1(e);}}),u.command("retry").description("Retry a failed export job").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let o=await b(M,{context:i(),id:t});k(`Export job retry queued: ${o.retryExportJob.id}`),i$1(e,o.retryExportJob);}catch(o){h$1(o);}}),m$1.command("entities").description("List entity types available for export").option("--limit <n>","Page size",t=>parseInt(t,10),50).option("-f, --format <format>").action(async t=>{try{let o=(await b(L,{context:i(),pagination:{first:t.limit}})).getAvailableExportEntities.edges.map(n=>n.node);i$1(t,o,{headers:["Type","Display","Enabled","DateRange","Media","Size"],rows:o.map(n=>[n.entityType,n.displayName,n.enabled?"yes":"no",n.supportsDateRange?"yes":"no",n.supportsMediaExport?"yes":"no",n.estimatedSize??"-"])});}catch(e){h$1(e);}}),m$1.command("part").description("Get an export part by id").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let o$1=await b(S,{context:i(),id:t});if(!o$1.getExportPart)throw new o(`Export part ${t} not found`);i$1(e,o$1.getExportPart);}catch(o){h$1(o);}}),m$1.command("download").description("Download a completed export job to a local path").argument("<jobId>").requiredOption("--to <path>","Local file path to write").action(async(t,e)=>{try{let o$1=await b(E,{context:i(),id:t});if(!o$1.getExportJob)throw new o(`Export job ${t} not found`);let n=o$1.getExportJob.downloadUrl;if(!n)throw new o(`Job ${t} has no downloadUrl yet (status=${o$1.getExportJob.status??"UNKNOWN"}).`);m(`Downloading from ${n}`);let p=await fetch(n);if(!p.ok)throw new o(`Download failed: ${p.status} ${p.statusText}`);let f=Buffer.from(await p.arrayBuffer());await writeFile(e.to,f),k(`Saved ${f.length} bytes to ${e.to}`);}catch(o){h$1(o);}});let x=m$1.command("templates").description("Export templates");x.command("list").description("List export templates").option("--limit <n>","Page size",t=>parseInt(t,10),50).option("-f, --format <format>").action(async t=>{try{let e=await b(P,{context:i(),pagination:{first:t.limit}});i$1(t,e.listExportTemplates.edges.map(o=>o.node));}catch(e){h$1(e);}}),x.command("get").description("Get an export template").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let o$1=await b(_,{context:i(),id:t});if(!o$1.getExportTemplate)throw new o(`Template ${t} not found`);i$1(e,o$1.getExportTemplate);}catch(o){h$1(o);}}),x.command("create").description("Create an export template").requiredOption("--name <s>").requiredOption("--types <t>","Comma-separated entity types").option("--description <s>").option("--format <fmt>","JSON|CSV","JSON").option("--include-media","Include media files",false).option("--include-metadata","Include metadata",true).option("-f, --format-output <format>").action(async t=>{try{let e={name:t.name,entityTypes:t.types.split(","),format:(t.format??"JSON").toUpperCase(),includeMedia:!!t.includeMedia,includeMetadata:t.includeMetadata!==!1};t.description&&(e.description=t.description);let o=await b(N,{context:i(),input:e});k(`Template created: ${o.createExportTemplate.id}`),i$1({format:t.formatOutput},o.createExportTemplate);}catch(e){h$1(e);}}),x.command("update").description("Update an export template").argument("<id>").option("--name <s>").option("--description <s>").option("--types <t>","Comma-separated entity types").option("--format <fmt>","JSON|CSV").option("--include-media <bool>","true|false").option("--include-metadata <bool>","true|false").option("--default <bool>","Set isDefault: true|false").option("-f, --format-output <format>").action(async(t,e)=>{try{let o={};e.name&&(o.name=e.name),e.description&&(o.description=e.description),e.types&&(o.entityTypes=e.types.split(",")),e.format&&(o.format=e.format.toUpperCase()),e.includeMedia!==void 0&&(o.includeMedia=e.includeMedia==="true"),e.includeMetadata!==void 0&&(o.includeMetadata=e.includeMetadata==="true"),e.default!==void 0&&(o.isDefault=e.default==="true");let n=await b(h,{context:i(),id:t,input:o});k(`Template updated: ${n.updateExportTemplate.id}`),i$1({format:e.formatOutput},n.updateExportTemplate);}catch(o){h$1(o);}}),x.command("delete").description("Delete an export template").argument("<id>").action(async t=>{try{if(!(await b(D,{context:i(),id:t})).deleteExportTemplate)throw new o(`Failed to delete template ${t}`);k(`Template deleted: ${t}`);}catch(e){h$1(e);}});}var U={id:"export",version:"1.0.0",displayName:"Export",dependsOn:["auth","workspaces"],register(l,m){a(m),X(l);}},W=U;export{W as default};
@@ -1,4 +1,4 @@
1
- 'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var fs=require('fs'),path=require('path'),crypto=require('crypto');var u=class extends Error{exitCode;hint;constructor(r,a){super(r),this.name="CliUserError",this.exitCode=a?.exitCode??1,this.hint=a?.hint;}},m=class extends u{constructor(r,a){super(r,{exitCode:2,hint:a?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},g=class extends Error{cause;constructor(r,a){super(r),this.name="CliInternalError",this.cause=a;}};var C=null;function E(n){C=n;}function w(){if(!C)throw new g("vibecontrols module helpers used before setHelpersContext was called");return C}function H(){let n=w();if(!n.auth.isAuthenticated())throw new m("Authentication required.",{hint:`Run \`${n.productName} auth login\` to authenticate.`})}async function l(n,r){return H(),w().gql.workspace.request(n,r)}function p(n){let r=n instanceof Error?n.message:String(n);throw new u(r)}function d(n,r,a){w().output.formatAndOutput(n,r,a);}function h(n){w().output.printSuccess(n);}function x(n){w().output.printInfo(n);}function y(n,r){return w().output.truncate(n,r)}var v=`
1
+ 'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var fs=require('fs'),path=require('path'),crypto=require('crypto');var u=class extends Error{exitCode;hint;constructor(r,a){super(r),this.name="CliUserError",this.exitCode=a?.exitCode??1,this.hint=a?.hint;}},m=class extends u{constructor(r,a){super(r,{exitCode:2,hint:a?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},g=class extends Error{cause;constructor(r,a){super(r),this.name="CliInternalError",this.cause=a;}};var k=null;function T(n){k=n;}function w(){if(!k)throw new g("vibecontrols module helpers used before setHelpersContext was called");return k}function H(){let n=w();if(!n.auth.isAuthenticated())throw new m("Authentication required.",{hint:`Run \`${n.productName} auth login\` to authenticate.`})}async function l(n,r){return H(),w().gql.workspace.request(n,r)}function p(n){let r=n instanceof Error?n.message:String(n);throw new u(r)}function d(n,r,a){w().output.formatAndOutput(n,r,a);}function h(n){w().output.printSuccess(n);}function x(n){w().output.printInfo(n);}function y(n,r){return w().output.truncate(n,r)}var v=`
2
2
  query BrowseFolderRoot($pagination: PaginationInput) {
3
3
  getFilesInFolder(pagination: $pagination) {
4
4
  files { id name size mimeType extension createdAt }
@@ -59,6 +59,6 @@
59
59
  query GetFileDownloadUrl($id: ID!, $expiresIn: Int) {
60
60
  getFileDownloadUrl(id: $id, expiresIn: $expiresIn)
61
61
  }
62
- `;function F(n){let r=n.command("files").description("Workspace file management");r.command("browse").description("Browse a folder (defaults to root)").argument("[folderId]").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async(t,e)=>{try{let o={limit:e.limit,offset:0};if(t){let i=await l(A,{folderId:t,pagination:o});if(e.format){d(e,{folder:i.getFolder,files:i.getFilesInFolder.files});return}i.getFolder&&x(`Folder: ${i.getFolder.name}`);for(let c of i.getFilesInFolder.files){let k=c.size?`${c.size}b`:"-";console.log(` \u{1F4C4} ${y(c.id,12)} ${c.name} ${k} ${c.mimeType??"-"}`);}console.log(`
62
+ `;function F(n){let r=n.command("files").description("Workspace file management");r.command("browse").description("Browse a folder (defaults to root)").argument("[folderId]").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async(t,e)=>{try{let o={limit:e.limit,offset:0};if(t){let i=await l(A,{folderId:t,pagination:o});if(e.format){d(e,{folder:i.getFolder,files:i.getFilesInFolder.files});return}i.getFolder&&x(`Folder: ${i.getFolder.name}`);for(let c of i.getFilesInFolder.files){let C=c.size?`${c.size}b`:"-";console.log(` \u{1F4C4} ${y(c.id,12)} ${c.name} ${C} ${c.mimeType??"-"}`);}console.log(`
63
63
  ${i.getFilesInFolder.total} files`);return}let f=await l(v,{pagination:o});if(e.format){d(e,{files:f.getFilesInFolder.files});return}for(let i of f.getFilesInFolder.files){let c=i.size?`${i.size}b`:"-";console.log(` \u{1F4C4} ${y(i.id,12)} ${i.name} ${c} ${i.mimeType??"-"}`);}console.log(`
64
- ${f.getFilesInFolder.total} files`);}catch(o){p(o);}}),r.command("upload").description("Upload a local file (initiates a multipart session)").argument("<path>","Local file path").option("--folder <folderId>","Target folder id").option("--visibility <v>","PRIVATE|WORKSPACE|PUBLIC","WORKSPACE").option("-f, --format <format>").action(async(t,e)=>{try{let o=fs.statSync(t),f=path.basename(t),i=path.extname(t).slice(1)||void 0,c=fs.readFileSync(t),k=crypto.createHash("sha256").update(c).digest("hex"),P={fileName:f,fileSize:o.size,mimeType:"application/octet-stream",extension:i,folderId:e.folder,sha256Hash:k,visibility:(e.visibility??"WORKSPACE").toUpperCase()},I=await l(O,{input:P});x("Upload session created. PUT the local bytes to the returned URL(s)."),d(e,I.initiateUpload),x(`After uploading, complete with: vibecontrols files upload-complete --session ${I.initiateUpload.session.id}`);}catch(o){p(o);}}),r.command("upload-complete").description("Complete an in-flight upload session").requiredOption("--session <id>","Session id from `files upload`").option("--folder <folderId>").option("--description <s>").option("-f, --format <format>").action(async t=>{try{let e=await l(S,{input:{sessionId:t.session,folderId:t.folder,description:t.description}});h(`Upload complete: ${e.completeUpload.fileId}`),d(t,e.completeUpload.file);}catch(e){p(e);}}),r.command("get").description("Get a file by id").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let o=await l(D,{id:t});if(!o.getFile)throw new u(`File ${t} not found`);d(e,o.getFile);}catch(o){p(o);}}),r.command("download").description("Get a pre-signed download URL for a file").argument("<id>").option("--expires <seconds>","URL expiry in seconds",t=>parseInt(t,10)).option("-f, --format <format>").action(async(t,e)=>{try{let o=await l(L,{id:t,expiresIn:e.expires});if(e.format){d(e,{url:o.getFileDownloadUrl});return}h("Download URL:"),console.log(o.getFileDownloadUrl);}catch(o){p(o);}});let a=r.command("share").description("Manage file shares");a.command("create").description("Create a share link for a file").argument("<fileId>").option("--access <a>","VIEW|DOWNLOAD","DOWNLOAD").option("--expires <iso>","Expiry timestamp").option("--password <p>").option("--max-downloads <n>","",t=>parseInt(t,10)).option("-f, --format <format>").action(async(t,e)=>{try{let o={fileId:t,shareType:"PUBLIC_LINK",accessLevel:(e.access??"DOWNLOAD").toUpperCase(),expiresAt:e.expires,password:e.password,maxDownloads:e.maxDownloads},f=await l(R,{input:o});h("Share created"),d(e,f.createShare);}catch(o){p(o);}}),a.command("revoke").description("Revoke a share by id").argument("<shareId>").action(async t=>{try{await l($,{id:t}),h("Share revoked");}catch(e){p(e);}});}var ee={id:"files",version:"1.0.0",displayName:"Files",dependsOn:["auth","workspaces"],register(n,r){E(r),F(n);}},ft=ee;module.exports=ft;
64
+ ${f.getFilesInFolder.total} files`);}catch(o){p(o);}}),r.command("upload").description("Upload a local file (initiates a multipart session)").argument("<path>","Local file path").option("--folder <folderId>","Target folder id").option("--visibility <v>","PRIVATE|WORKSPACE|PUBLIC","WORKSPACE").option("-f, --format <format>").action(async(t,e)=>{try{let o=fs.statSync(t),f=path.basename(t),i=path.extname(t).slice(1)||void 0,c=fs.readFileSync(t),C=crypto.createHash("sha256").update(c).digest("hex"),P={fileName:f,fileSize:o.size,mimeType:"application/octet-stream",extension:i,folderId:e.folder,sha256Hash:C,visibility:(e.visibility??"WORKSPACE").toUpperCase()},I=await l(O,{input:P});x("Upload session created. PUT the local bytes to the returned URL(s)."),d(e,I.initiateUpload),x(`After uploading, complete with: vibecontrols files upload-complete --session ${I.initiateUpload.session.id}`);}catch(o){p(o);}}),r.command("upload-complete").description("Complete an in-flight upload session").requiredOption("--session <id>","Session id from `files upload`").option("--folder <folderId>").option("--description <s>").option("-f, --format <format>").action(async t=>{try{let e=await l(S,{input:{sessionId:t.session,folderId:t.folder,description:t.description}});h(`Upload complete: ${e.completeUpload.fileId}`),d(t,e.completeUpload.file);}catch(e){p(e);}}),r.command("get").description("Get a file by id").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let o=await l(D,{id:t});if(!o.getFile)throw new u(`File ${t} not found`);d(e,o.getFile);}catch(o){p(o);}}),r.command("download").description("Get a pre-signed download URL for a file").argument("<id>").option("--expires <seconds>","URL expiry in seconds",t=>parseInt(t,10)).option("-f, --format <format>").action(async(t,e)=>{try{let o=await l(L,{id:t,expiresIn:e.expires});if(e.format){d(e,{url:o.getFileDownloadUrl});return}h("Download URL:"),console.log(o.getFileDownloadUrl);}catch(o){p(o);}});let a=r.command("share").description("Manage file shares");a.command("create").description("Create a share link for a file").argument("<fileId>").option("--access <a>","VIEW|DOWNLOAD","DOWNLOAD").option("--expires <iso>","Expiry timestamp").option("--password <p>").option("--max-downloads <n>","",t=>parseInt(t,10)).option("-f, --format <format>").action(async(t,e)=>{try{let o={fileId:t,shareType:"PUBLIC_LINK",accessLevel:(e.access??"DOWNLOAD").toUpperCase(),expiresAt:e.expires,password:e.password,maxDownloads:e.maxDownloads},f=await l(R,{input:o});h("Share created"),d(e,f.createShare);}catch(o){p(o);}}),a.command("revoke").description("Revoke a share by id").argument("<shareId>").action(async t=>{try{await l($,{id:t}),h("Share revoked");}catch(e){p(e);}});}var ee={id:"files",version:"1.0.0",displayName:"Files",dependsOn:["auth","workspaces"],register(n,r){T(r),F(n);}},ft=ee;module.exports=ft;
@@ -1,4 +1,4 @@
1
- import {a,b,h as h$1,k,p,g,i}from'../../chunk-W4JZR7RJ.js';import {o}from'../../chunk-YIY5IDXQ.js';import {statSync,readFileSync}from'fs';import {basename,extname}from'path';import {createHash}from'crypto';var h=`
1
+ import {a,b,i,m,r,h as h$1,k}from'../../chunk-O6UCQ5IT.js';import {o}from'../../chunk-YIY5IDXQ.js';import {statSync,readFileSync}from'fs';import {basename,extname}from'path';import {createHash}from'crypto';var h=`
2
2
  query BrowseFolderRoot($pagination: PaginationInput) {
3
3
  getFilesInFolder(pagination: $pagination) {
4
4
  files { id name size mimeType extension createdAt }
@@ -59,6 +59,6 @@ import {a,b,h as h$1,k,p,g,i}from'../../chunk-W4JZR7RJ.js';import {o}from'../../
59
59
  query GetFileDownloadUrl($id: ID!, $expiresIn: Int) {
60
60
  getFileDownloadUrl(id: $id, expiresIn: $expiresIn)
61
61
  }
62
- `;function D(c){let s=c.command("files").description("Workspace file management");s.command("browse").description("Browse a folder (defaults to root)").argument("[folderId]").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async(t,e)=>{try{let o={limit:e.limit,offset:0};if(t){let i=await b(x,{folderId:t,pagination:o});if(e.format){h$1(e,{folder:i.getFolder,files:i.getFilesInFolder.files});return}i.getFolder&&k(`Folder: ${i.getFolder.name}`);for(let n of i.getFilesInFolder.files){let f=n.size?`${n.size}b`:"-";console.log(` \u{1F4C4} ${p(n.id,12)} ${n.name} ${f} ${n.mimeType??"-"}`);}console.log(`
63
- ${i.getFilesInFolder.total} files`);return}let d=await b(h,{pagination:o});if(e.format){h$1(e,{files:d.getFilesInFolder.files});return}for(let i of d.getFilesInFolder.files){let n=i.size?`${i.size}b`:"-";console.log(` \u{1F4C4} ${p(i.id,12)} ${i.name} ${n} ${i.mimeType??"-"}`);}console.log(`
64
- ${d.getFilesInFolder.total} files`);}catch(o){g(o);}}),s.command("upload").description("Upload a local file (initiates a multipart session)").argument("<path>","Local file path").option("--folder <folderId>","Target folder id").option("--visibility <v>","PRIVATE|WORKSPACE|PUBLIC","WORKSPACE").option("-f, --format <format>").action(async(t,e)=>{try{let o=statSync(t),d=basename(t),i=extname(t).slice(1)||void 0,n=readFileSync(t),f=createHash("sha256").update(n).digest("hex"),L={fileName:d,fileSize:o.size,mimeType:"application/octet-stream",extension:i,folderId:e.folder,sha256Hash:f,visibility:(e.visibility??"WORKSPACE").toUpperCase()},I=await b(E,{input:L});k("Upload session created. PUT the local bytes to the returned URL(s)."),h$1(e,I.initiateUpload),k(`After uploading, complete with: vibecontrols files upload-complete --session ${I.initiateUpload.session.id}`);}catch(o){g(o);}}),s.command("upload-complete").description("Complete an in-flight upload session").requiredOption("--session <id>","Session id from `files upload`").option("--folder <folderId>").option("--description <s>").option("-f, --format <format>").action(async t=>{try{let e=await b(R,{input:{sessionId:t.session,folderId:t.folder,description:t.description}});i(`Upload complete: ${e.completeUpload.fileId}`),h$1(t,e.completeUpload.file);}catch(e){g(e);}}),s.command("get").description("Get a file by id").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let o$1=await b(C,{id:t});if(!o$1.getFile)throw new o(`File ${t} not found`);h$1(e,o$1.getFile);}catch(o){g(o);}}),s.command("download").description("Get a pre-signed download URL for a file").argument("<id>").option("--expires <seconds>","URL expiry in seconds",t=>parseInt(t,10)).option("-f, --format <format>").action(async(t,e)=>{try{let o=await b(A,{id:t,expiresIn:e.expires});if(e.format){h$1(e,{url:o.getFileDownloadUrl});return}i("Download URL:"),console.log(o.getFileDownloadUrl);}catch(o){g(o);}});let u=s.command("share").description("Manage file shares");u.command("create").description("Create a share link for a file").argument("<fileId>").option("--access <a>","VIEW|DOWNLOAD","DOWNLOAD").option("--expires <iso>","Expiry timestamp").option("--password <p>").option("--max-downloads <n>","",t=>parseInt(t,10)).option("-f, --format <format>").action(async(t,e)=>{try{let o={fileId:t,shareType:"PUBLIC_LINK",accessLevel:(e.access??"DOWNLOAD").toUpperCase(),expiresAt:e.expires,password:e.password,maxDownloads:e.maxDownloads},d=await b($,{input:o});i("Share created"),h$1(e,d.createShare);}catch(o){g(o);}}),u.command("revoke").description("Revoke a share by id").argument("<shareId>").action(async t=>{try{await b(O,{id:t}),i("Share revoked");}catch(e){g(e);}});}var B={id:"files",version:"1.0.0",displayName:"Files",dependsOn:["auth","workspaces"],register(c,s){a(s),D(c);}},V=B;export{V as default};
62
+ `;function D(c){let s=c.command("files").description("Workspace file management");s.command("browse").description("Browse a folder (defaults to root)").argument("[folderId]").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async(t,e)=>{try{let o={limit:e.limit,offset:0};if(t){let i$1=await b(x,{folderId:t,pagination:o});if(e.format){i(e,{folder:i$1.getFolder,files:i$1.getFilesInFolder.files});return}i$1.getFolder&&m(`Folder: ${i$1.getFolder.name}`);for(let n of i$1.getFilesInFolder.files){let f=n.size?`${n.size}b`:"-";console.log(` \u{1F4C4} ${r(n.id,12)} ${n.name} ${f} ${n.mimeType??"-"}`);}console.log(`
63
+ ${i$1.getFilesInFolder.total} files`);return}let d=await b(h,{pagination:o});if(e.format){i(e,{files:d.getFilesInFolder.files});return}for(let i of d.getFilesInFolder.files){let n=i.size?`${i.size}b`:"-";console.log(` \u{1F4C4} ${r(i.id,12)} ${i.name} ${n} ${i.mimeType??"-"}`);}console.log(`
64
+ ${d.getFilesInFolder.total} files`);}catch(o){h$1(o);}}),s.command("upload").description("Upload a local file (initiates a multipart session)").argument("<path>","Local file path").option("--folder <folderId>","Target folder id").option("--visibility <v>","PRIVATE|WORKSPACE|PUBLIC","WORKSPACE").option("-f, --format <format>").action(async(t,e)=>{try{let o=statSync(t),d=basename(t),i$1=extname(t).slice(1)||void 0,n=readFileSync(t),f=createHash("sha256").update(n).digest("hex"),L={fileName:d,fileSize:o.size,mimeType:"application/octet-stream",extension:i$1,folderId:e.folder,sha256Hash:f,visibility:(e.visibility??"WORKSPACE").toUpperCase()},I=await b(E,{input:L});m("Upload session created. PUT the local bytes to the returned URL(s)."),i(e,I.initiateUpload),m(`After uploading, complete with: vibecontrols files upload-complete --session ${I.initiateUpload.session.id}`);}catch(o){h$1(o);}}),s.command("upload-complete").description("Complete an in-flight upload session").requiredOption("--session <id>","Session id from `files upload`").option("--folder <folderId>").option("--description <s>").option("-f, --format <format>").action(async t=>{try{let e=await b(R,{input:{sessionId:t.session,folderId:t.folder,description:t.description}});k(`Upload complete: ${e.completeUpload.fileId}`),i(t,e.completeUpload.file);}catch(e){h$1(e);}}),s.command("get").description("Get a file by id").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let o$1=await b(C,{id:t});if(!o$1.getFile)throw new o(`File ${t} not found`);i(e,o$1.getFile);}catch(o){h$1(o);}}),s.command("download").description("Get a pre-signed download URL for a file").argument("<id>").option("--expires <seconds>","URL expiry in seconds",t=>parseInt(t,10)).option("-f, --format <format>").action(async(t,e)=>{try{let o=await b(A,{id:t,expiresIn:e.expires});if(e.format){i(e,{url:o.getFileDownloadUrl});return}k("Download URL:"),console.log(o.getFileDownloadUrl);}catch(o){h$1(o);}});let u=s.command("share").description("Manage file shares");u.command("create").description("Create a share link for a file").argument("<fileId>").option("--access <a>","VIEW|DOWNLOAD","DOWNLOAD").option("--expires <iso>","Expiry timestamp").option("--password <p>").option("--max-downloads <n>","",t=>parseInt(t,10)).option("-f, --format <format>").action(async(t,e)=>{try{let o={fileId:t,shareType:"PUBLIC_LINK",accessLevel:(e.access??"DOWNLOAD").toUpperCase(),expiresAt:e.expires,password:e.password,maxDownloads:e.maxDownloads},d=await b($,{input:o});k("Share created"),i(e,d.createShare);}catch(o){h$1(o);}}),u.command("revoke").description("Revoke a share by id").argument("<shareId>").action(async t=>{try{await b(O,{id:t}),k("Share revoked");}catch(e){h$1(e);}});}var B={id:"files",version:"1.0.0",displayName:"Files",dependsOn:["auth","workspaces"],register(c,s){a(s),D(c);}},V=B;export{V as default};
@@ -1,10 +1,10 @@
1
- 'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var fs=require('fs'),readline=require('readline'),stream=require('stream');var u=class extends Error{exitCode;hint;constructor(n,e){super(n),this.name="CliUserError",this.exitCode=e?.exitCode??1,this.hint=e?.hint;}},v=class extends u{constructor(n,e){super(n,{exitCode:2,hint:e?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},T=class extends Error{cause;constructor(n,e){super(n),this.name="CliInternalError",this.cause=e;}};var N=null;function X(i){N=i;}function S(){if(!N)throw new T("vibecontrols module helpers used before setHelpersContext was called");return N}function Et(){let i=S();if(!i.auth.isAuthenticated())throw new v("Authentication required.",{hint:`Run \`${i.productName} auth login\` to authenticate.`})}async function a(i,n){return Et(),S().gql.workspace.request(i,n)}function c(i,n,e){S().output.formatAndOutput(i,n,e);}function l(i){S().output.printSuccess(i);}function k(i){return S().output.formatDate(i)}function w(i,n){return S().output.truncate(i,n)}function F(i,n){return S().output.confirm(i,n)}var b=`
1
+ 'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var fs=require('fs'),readline=require('readline'),stream=require('stream');var u=class extends Error{exitCode;hint;constructor(n,e){super(n),this.name="CliUserError",this.exitCode=e?.exitCode??1,this.hint=e?.hint;}},v=class extends u{constructor(n,e){super(n,{exitCode:2,hint:e?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},T=class extends Error{cause;constructor(n,e){super(n),this.name="CliInternalError",this.cause=e;}};var N=null;function X(i){N=i;}function S(){if(!N)throw new T("vibecontrols module helpers used before setHelpersContext was called");return N}function bt(){let i=S();if(!i.auth.isAuthenticated())throw new v("Authentication required.",{hint:`Run \`${i.productName} auth login\` to authenticate.`})}async function a(i,n){return bt(),S().gql.workspace.request(i,n)}function c(i,n,e){S().output.formatAndOutput(i,n,e);}function l(i){S().output.printSuccess(i);}function k(i){return S().output.formatDate(i)}function w(i,n){return S().output.truncate(i,n)}function F(i,n){return S().output.confirm(i,n)}var E=`
2
2
  id workflowKey name description version status category tags icon isActive
3
3
  totalVersions projectId createdAt updatedAt
4
4
  `,Z=`
5
5
  query FluidgridsListWorkflows($input: ListWorkflowDefinitionsInput!) {
6
6
  workflowDefinitions(input: $input) {
7
- items { ${b} }
7
+ items { ${E} }
8
8
  total
9
9
  hasMore
10
10
  }
@@ -12,7 +12,7 @@
12
12
  `,D=`
13
13
  query FluidgridsGetWorkflow($id: ID, $workflowKey: String, $version: String) {
14
14
  workflowDefinition(id: $id, workflowKey: $workflowKey, version: $version) {
15
- ${b}
15
+ ${E}
16
16
  alias
17
17
  definitionJson
18
18
  context
@@ -20,15 +20,15 @@
20
20
  }
21
21
  `,ee=`
22
22
  query FluidgridsWorkflowVersions($workflowKey: String!) {
23
- workflowVersions(workflowKey: $workflowKey) { ${b} }
23
+ workflowVersions(workflowKey: $workflowKey) { ${E} }
24
24
  }
25
25
  `,te=`
26
26
  mutation FluidgridsCreateWorkflow($input: CreateWorkflowDefinitionInput!) {
27
- createWorkflowDefinition(input: $input) { ${b} }
27
+ createWorkflowDefinition(input: $input) { ${E} }
28
28
  }
29
29
  `,oe=`
30
30
  mutation FluidgridsUpdateWorkflow($id: ID!, $input: UpdateWorkflowDefinitionInput!) {
31
- updateWorkflowDefinition(id: $id, input: $input) { ${b} }
31
+ updateWorkflowDefinition(id: $id, input: $input) { ${E} }
32
32
  }
33
33
  `,ne=`
34
34
  mutation FluidgridsDeleteWorkflow($workflowKey: String!, $version: String) {
@@ -46,15 +46,15 @@
46
46
  }
47
47
  `,ie=`
48
48
  mutation FluidgridsPublishWorkflow($id: ID!) {
49
- publishWorkflow(id: $id) { ${b} }
49
+ publishWorkflow(id: $id) { ${E} }
50
50
  }
51
51
  `,se=`
52
52
  mutation FluidgridsActivateWorkflow($id: ID!) {
53
- activateWorkflowDefinition(id: $id) { ${b} }
53
+ activateWorkflowDefinition(id: $id) { ${E} }
54
54
  }
55
55
  `,ae=`
56
56
  mutation FluidgridsDeactivateWorkflow($id: ID!) {
57
- deactivateWorkflowDefinition(id: $id) { ${b} }
57
+ deactivateWorkflowDefinition(id: $id) { ${E} }
58
58
  }
59
59
  `,ue=`
60
60
  mutation FluidgridsDuplicateWorkflow(
@@ -65,19 +65,19 @@
65
65
  duplicateWorkflow(workflowKey: $workflowKey, version: $version, input: $input) {
66
66
  success
67
67
  message
68
- workflow { ${b} }
68
+ workflow { ${E} }
69
69
  }
70
70
  }
71
71
  `,de=`
72
72
  mutation FluidgridsArchiveWorkflow($id: ID!) {
73
- archiveWorkflow(id: $id) { ${b} }
73
+ archiveWorkflow(id: $id) { ${E} }
74
74
  }
75
75
  `,ce=`
76
76
  mutation FluidgridsImportWorkflowTemplate($input: ImportWorkflowTemplateInput!) {
77
77
  importWorkflowTemplate(input: $input) {
78
78
  success
79
79
  message
80
- workflow { ${b} }
80
+ workflow { ${E} }
81
81
  }
82
82
  }
83
83
  `,le=`
@@ -175,7 +175,7 @@
175
175
  pagination { total limit offset hasMore }
176
176
  }
177
177
  }
178
- `,Ee=`
178
+ `,be=`
179
179
  query FluidgridsGetNode($nodeType: String!, $nodeVersion: String!) {
180
180
  nodeEndpointConfig(nodeType: $nodeType, nodeVersion: $nodeVersion) {
181
181
  ${ke}
@@ -187,7 +187,7 @@
187
187
  id name description status providerId credentialSource externalAccountId
188
188
  externalAccountName externalAccountEmail grantedScopes lastUsedAt lastHealthCheck
189
189
  errorMessage createdAt updatedAt
190
- `,be=`
190
+ `,Ee=`
191
191
  query FluidgridsListCredentials(
192
192
  $filter: ConnectionFilterInput
193
193
  $pagination: IntegrationsPaginationInput
@@ -397,5 +397,5 @@
397
397
  query FluidgridsSystemConfig {
398
398
  systemConfig { version revision environment deploymentType hostname hostIp }
399
399
  }
400
- `;function p(i,n){if(!/^\d+$/.test(i))throw new u(`Invalid value '${i}' for ${n}: expected a non-negative integer.`);let e=Number(i);if(!Number.isSafeInteger(e))throw new u(`Invalid value '${i}' for ${n}: expected a non-negative integer.`);return e}function y(i,n,e){if(i===void 0)return;let t=e.find(o=>o===i);if(t===void 0)throw new u(`Invalid value '${i}' for ${n}. Allowed: ${e.join(", ")}`);return t}function x(i,n){let e;try{e=JSON.parse(i);}catch{throw new u(`${n} must be valid JSON.`)}if(!Ct(e))throw new u(`${n} must be a JSON object.`);return e}function h(i){let n;try{n=fs.readFileSync(i,"utf8");}catch(e){let t=e instanceof Error?e.message:String(e);throw new u(`Cannot read ${i}: ${t}`)}return x(n,i)}function R(i,n){if(i!==void 0){if(!i.trim())throw new u(`${n} cannot be empty.`);return i}}function E(i,n,e){if(i==null)throw new u(`${n} ${e} not found (NOT_FOUND)`);return i}function Ct(i){return i!==null&&typeof i=="object"&&!Array.isArray(i)}function Be(i,n=[]){return [...n,i]}async function I(i,n){if(!await F(i,n))throw new u("Aborted: nothing was changed.")}var K=["DRAFT","ACTIVE","ARCHIVED","DEPRECATED"],q=["PENDING","RUNNING","WAITING","COMPLETED","FAILED","CANCELLED","TERMINATED"],He=["COMPLETED","FAILED","CANCELLED","TERMINATED"],G=["DEBUG","INFO","WARN","ERROR"],J=["BUILTIN","CUSTOM","STORE"],M=["AVAILABLE","DEPRECATED","DISABLED"],V=["ACTIVE","PAUSED","DISABLED","ARCHIVED"],B=["ACTIVE","INACTIVE","PENDING_AUTH","ERROR","EXPIRED","REVOKED"],H=["workflow","run","node","event"];function Ye(i){return {headers:["ID","Key","Name","Version","Status","Active","Updated"],rows:i.map(n=>[w(n.id,12),n.workflowKey,w(n.name,32),n.version,n.status,n.isActive?"yes":"no",k(n.updatedAt)])}}function ze(i){let n=i.command("workflows").description("FluidGrids workflow definitions");n.command("list").description("List workflow definitions").option("-l, --limit <n>","Page size","20").option("-o, --offset <n>","Offset","0").option("-s, --status <status>",`Filter by status (${K.join("|")})`).option("--category <category>","Filter by category").option("--tag <tag>","Filter by tag (repeatable)",Be).option("--latest-only","Only the latest version of each workflow key").option("-f, --format <format>","Output format (json, table, yaml)").action(async t=>{let o={limit:p(t.limit,"--limit"),offset:p(t.offset,"--offset")},r=y(t.status,"--status",K);r&&(o.status=r),t.category&&(o.category=t.category),t.tag?.length&&(o.tags=t.tag),t.latestOnly&&(o.latestOnly=true);let s=await a(Z,{input:o});c(t,s.workflowDefinitions.items,Ye(s.workflowDefinitions.items));}),n.command("get").description("Get a workflow definition by ID, or by key with --key").argument("[id]","Workflow definition ID").option("--key <workflowKey>","Look up by workflow key instead of ID").option("--wf-version <version>","Version to fetch with --key").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,o)=>{if(!t&&!o.key)throw new u("Pass a workflow ID or --key <workflowKey>.");if(t&&o.key)throw new u("Pass either a workflow ID or --key, not both.");let r=await a(D,t?{id:t}:{workflowKey:o.key,version:o.wfVersion});c(o,E(r.workflowDefinition,"Workflow",t??o.key??""));}),n.command("versions").description("List every stored version of a workflow key").argument("<workflowKey>","Workflow key").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,o)=>{let r=await a(ee,{workflowKey:t});c(o,r.workflowVersions,Ye(r.workflowVersions));}),n.command("create").description("Create a workflow definition from a CreateWorkflowDefinitionInput JSON file").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,o)=>{let r=h(t),s=await a(te,{input:r});l(`Workflow created: ${s.createWorkflowDefinition.workflowKey}`),c(o,s.createWorkflowDefinition);}),n.command("update").description("Update a workflow definition from an UpdateWorkflowDefinitionInput JSON file").argument("<id>","Workflow definition ID").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,o,r)=>{let s=h(o),d=await a(oe,{id:t,input:s});l("Workflow updated"),c(r,d.updateWorkflowDefinition);}),n.command("delete").description("Delete a workflow (every version, or one with --wf-version)").argument("<workflowKey>","Workflow key").option("--wf-version <version>","Delete only this version").option("--force","Skip the confirmation prompt").action(async(t,o)=>{let r=o.wfVersion?`${t}@${o.wfVersion}`:`${t} (all versions)`;if(await I(`Delete workflow ${r}?`,o.force),!(await a(ne,{workflowKey:t,version:o.wfVersion})).deleteWorkflowDefinition)throw new u(`Workflow ${r} was not deleted.`);l(`Workflow ${r} deleted`);}),n.command("trigger").description("Trigger a workflow run").argument("<workflowKey>","Workflow key").requiredOption("--wf-version <version>","Workflow version").requiredOption("--trigger-node <id>","Trigger node ID").option("-i, --input <json>","Trigger data as a JSON object").option("--stop-at-node <id>","Stop the run after this node").option("--test","Run in TEST mode instead of PRODUCTION").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,o)=>{let r={workflowKey:t,version:R(o.wfVersion,"--wf-version"),triggerNodeId:R(o.triggerNode,"--trigger-node")};o.input!==void 0&&(r.triggerData=x(o.input,"--input")),o.stopAtNode&&(r.stopAtNodeId=o.stopAtNode),o.test&&(r.mode="TEST");let s=await a(re,{input:r});c(o,s.triggerWorkflow);}),n.command("duplicate").description("Duplicate a workflow version under a new key").argument("<workflowKey>","Source workflow key").argument("<version>","Source version").requiredOption("--new-key <key>","Workflow key for the copy").option("--new-version <version>","Version for the copy").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,o,r)=>{let s={newWorkflowKey:R(r.newKey,"--new-key")};r.newVersion&&(s.newVersion=r.newVersion);let d=await a(ue,{workflowKey:t,version:o,input:s});if(!d.duplicateWorkflow.success)throw new u(d.duplicateWorkflow.message??"Duplicate failed.");c(r,d.duplicateWorkflow.workflow??d.duplicateWorkflow);});let e=[["publish","Publish a workflow definition version",ie,"publishWorkflow"],["activate","Make a workflow definition version the active one",se,"activateWorkflowDefinition"],["deactivate","Deactivate a workflow definition version",ae,"deactivateWorkflowDefinition"],["archive","Archive a workflow definition version",de,"archiveWorkflow"]];for(let[t,o,r,s]of e)n.command(t).description(o).argument("<id>","Workflow definition ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(d,m)=>{let g=(await a(r,{id:d}))[s];if(!g)throw new u(`Workflow ${d}: ${t} returned no result.`);l(`Workflow ${g.workflowKey}@${g.version}: ${g.status}`),c(m,g);});n.command("import").description("Import a workflow from a store template (ImportWorkflowTemplateInput JSON)").argument("<file>","Path to the template input JSON").option("--name <name>","Override the workflow name").option("--description <text>","Override the description").option("--icon <icon>","Override the icon").option("--category <category>","Override the category").option("--project-id <id>","Scope to a project").option("--source-template-id <id>","Source template ID (lineage)").option("--context <json>","Context metadata as a JSON object").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,o)=>{let r={...h(t)},s=R(o.name,"--name"),d=R(o.projectId,"--project-id"),m=R(o.sourceTemplateId,"--source-template-id");s!==void 0&&(r.name=s),o.description!==void 0&&(r.description=o.description),o.icon!==void 0&&(r.icon=o.icon),o.category!==void 0&&(r.category=o.category),d!==void 0&&(r.projectId=d),m!==void 0&&(r.sourceTemplateId=m),o.context!==void 0&&(r.context=x(o.context,"--context"));let C=await a(ce,{input:r});if(!C.importWorkflowTemplate.success)throw new u(C.importWorkflowTemplate.message??"Import failed.");l("Workflow imported"),c(o,C.importWorkflowTemplate.workflow??C.importWorkflowTemplate);});}var It=100;function Qe(i){return {headers:["ID","Workflow","Version","Status","Progress","Started","Completed"],rows:i.map(n=>[w(n.id,12),n.workflowKey,n.version,n.status,`${Math.round(n.progress)}%`,k(n.startedAt),k(n.completedAt)])}}async function L(i){let n=await a(pe,{id:i});return E(n.workflowRun,"Run",i)}function Tt(i){return He.some(n=>n===i.toUpperCase())}async function St(i,n,e,t,o){if(t===0)return [];let r=[],s=new Set,d=0,m=0;for(;r.length<t;){let g=(await a(_,{input:{workflowKey:n,status:e,limit:It,offset:d}})).workflowRuns;if(g.items.length===0){if(g.hasMore)throw new u("Run listing returned an empty page before the end.");break}for(let $ of g.items)if(!($.workflowId!==i||s.has($.id))){if(s.add($.id),m<o){m++;continue}if(r.push($),r.length===t)break}if(d+=g.items.length,!g.hasMore)break}return r}function Ot(i,n,e){let t=e.filter(d=>d.nodeId===n);if(t.length===0)throw new u(`Node ${n} not found in run ${i} (NOT_FOUND)`);let o=t.filter(d=>["FAILED","TIMEOUT"].includes(d.status.toUpperCase()));if(o.length===0)throw new u(`Node ${n} is not failed in run ${i} (INVALID_STATE)`);let[r,...s]=o;if(!r||s.length>0)throw new u(`Node ${n} is ambiguous in run ${i}; retry a specific node state.`);return r}function Rt(i){return new Promise(n=>setTimeout(n,i))}function Xe(i){let n=i.command("runs").description("FluidGrids workflow runs");n.command("list").description("List workflow runs").option("-l, --limit <n>","Page size","20").option("-o, --offset <n>","Offset","0").option("-s, --status <status>",`Filter by status (${q.join("|")})`).option("--workflow-key <key>","Filter by workflow key").option("--workflow-id <id>","Filter by exact workflow definition ID (scans all pages)").option("-f, --format <format>","Output format (json, table, yaml)").action(async e=>{let t=p(e.limit,"--limit"),o=p(e.offset,"--offset"),r=y(e.status,"--status",q);if(e.workflowId&&e.workflowKey)throw new u("Use either --workflow-id or --workflow-key, not both.");if(e.workflowId){let m=await a(D,{id:e.workflowId}),C=E(m.workflowDefinition,"Workflow",e.workflowId),g=await St(e.workflowId,C.workflowKey,r,t,o);c(e,g,Qe(g));return}let s={limit:t,offset:o};r&&(s.status=r),e.workflowKey&&(s.workflowKey=e.workflowKey);let d=await a(_,{input:s});c(e,d.workflowRuns.items,Qe(d.workflowRuns.items));}),n.command("get").description("Get a run (with node states)").argument("<id>","Run ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{c(t,await L(e));}),n.command("cancel").description("Cancel a run").argument("<id>","Run ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=await a(me,{id:e});l(`Run ${e}: ${o.cancelWorkflowRun.status}`),c(t,o.cancelWorkflowRun);}),n.command("pause").description("Pause a run").argument("<id>","Run ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=await a(ge,{id:e});l(`Run ${e}: ${o.pauseWorkflowRun.status}`),c(t,o.pauseWorkflowRun);}),n.command("resume").description("Resume a paused or waiting run").argument("<id>","Run ID").option("--payload <json>","JSON object delivered to the waiting node").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=t.payload===void 0?void 0:x(t.payload,"--payload"),r=await a(we,{id:e,payload:o});if(!r.resumeWorkflowRun.success)throw new u(r.resumeWorkflowRun.message);c(t,r.resumeWorkflowRun);}),n.command("wait").description("Poll a run until it reaches a terminal status").argument("<id>","Run ID").option("--timeout <ms>","Give up after this many milliseconds","300000").option("--poll-interval <ms>","Delay between polls in milliseconds","1000").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=p(t.timeout,"--timeout"),r=p(t.pollInterval,"--poll-interval"),s=Date.now(),d=await L(e);for(;!Tt(d.status);){if(Date.now()-s>o)throw new u(`Timed out waiting for run ${e} (last status ${d.status}).`);await Rt(r),d=await L(e);}c(t,d);}),n.command("logs").description("Get run logs (one cursor page)").argument("<id>","Run ID").option("--level <level>",`Minimum level (${G.join("|")})`).option("--node-id <id>","Only this graph node").option("--search <text>","Only lines containing this text").option("--include-child-runs","Include sub-workflow runs").option("--limit <n>","Page size, 1 to 1000").option("--after <cursor>","Continue after a nextCursor from an earlier page").option("--page-info","Print the whole page (lines + cursor) instead of only lines").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=y(t.level,"--level",G),r=t.limit===void 0?void 0:p(t.limit,"--limit");if(r!==void 0&&(r<1||r>1e3))throw new u(`Invalid value '${t.limit}' for --limit: expected 1 to 1000.`);if(t.after!==void 0&&!t.after.trim())throw new u("--after cursor cannot be empty.");let d=(await a(fe,{runId:e,nodeId:t.nodeId,minLevel:o,limit:r,after:t.after,search:t.search,includeChildRuns:t.includeChildRuns})).workflowRunLogs;if(t.pageInfo){c(t,d);return}c(t,d.lines,{headers:["Time","Level","Node","Message"],rows:d.lines.map(m=>[k(m.timestamp),m.level,m.nodeId??"-",w(m.message,100)])});}),n.command("retry-node").description("Retry one failed node of a run (run ID + graph node ID)").argument("<runId>","Run ID").argument("<nodeId>","Graph node ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t,o)=>{let r=await L(e),s=Ot(e,t,r.nodeStates??[]),d=await a(ye,{id:s.id,nodeId:t});l(`Node ${t} retry: ${d.retryNode.status}`),c(o,d.retryNode);});}function Ze(i){let n=i.command("nodes").description("FluidGrids node catalogue");n.command("list").description("List node endpoint configurations").option("-l, --limit <n>","Page size","20").option("-o, --offset <n>","Offset","0").option("-t, --node-type <type>","Filter by node type").option("--publish-type <type>",`Filter by publish type (${J.join("|")})`).option("--status <status>",`Filter by status (${M.join("|")})`).option("-f, --format <format>","Output format (json, table, yaml)").action(async e=>{let o=(await a(he,{nodeType:e.nodeType,publishType:y(e.publishType,"--publish-type",J),status:y(e.status,"--status",M),pagination:{limit:p(e.limit,"--limit"),offset:p(e.offset,"--offset")}})).nodeEndpointConfigs.configs;c(e,o,{headers:["Type","Version","Name","Category","Publish","Status","Latest"],rows:o.map(r=>[r.nodeType,r.nodeVersion,r.name,r.category??"-",r.publishType,r.status,r.isLatest?"yes":"no"])});}),n.command("get").description("Get a node endpoint configuration by type and version").argument("<nodeType>","Node type").argument("<nodeVersion>","Node version").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t,o)=>{let r=await a(Ee,{nodeType:e,nodeVersion:t});c(o,E(r.nodeEndpointConfig,"Node",`${e}@${t}`));});}var At=/^[A-Za-z_][A-Za-z0-9_]*$/;async function $t(i,n=process.stdin,e=process.stderr){if(!n.isTTY)throw new u("A terminal is required to prompt for a secret.");let t=new stream.Writable({write(r,s,d){d();}}),o=readline.createInterface({input:n,output:t,terminal:true});e.write(`${i}: `);try{return await new Promise(r=>{o.question("",r);})}finally{o.close(),e.write(`
401
- `);}}async function et(i,n,e,t=process.env,o=$t){if(i!==void 0){if(!At.test(i))throw new u(`Invalid environment variable name for ${e}.`);let s=t[i];if(!s?.trim())throw new u(`The environment variable selected by ${e} is empty or unset.`);return s}if(!process.stdin.isTTY)throw new u(`An interactive terminal or ${e} is required to supply ${n}.`);let r=await o(n);if(!r.trim())throw new u(`${n} cannot be empty.`);return r}async function tt(i,n,e){try{let o=(await a(i,{input:e}))[n];if(o===void 0)throw new Error("empty response");return o}catch{throw new u("Connection authentication failed; verify the connection and secret.")}}function ot(i){let n=i.command("credentials").description("FluidGrids credentials (integration connections)");n.command("list").description("List credentials").option("-l, --limit <n>","Page size","20").option("-o, --offset <n>","Offset","0").option("-p, --provider-id <id>","Filter by provider ID").option("-s, --status <status>",`Filter by status (${B.join("|")})`).option("--search <text>","Filter by name").option("-f, --format <format>","Output format (json, table, yaml)").action(async e=>{let t={};e.providerId&&(t.providerId=e.providerId);let o=y(e.status,"--status",B);o&&(t.status=o),e.search&&(t.search=e.search);let s=(await a(be,{filter:Object.keys(t).length>0?t:void 0,pagination:{limit:p(e.limit,"--limit"),offset:p(e.offset,"--offset")}})).getConnections.items;c(e,s,{headers:["ID","Name","Provider","Status","Last used"],rows:s.map(d=>[w(d.id,12),d.name,d.provider?.key??d.providerId,d.status,k(d.lastUsedAt)])});}),n.command("get").description("Get a credential").argument("<id>","Credential (connection) ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=await a(Ce,{id:e});c(t,E(o.getConnection,"Credential",e));}),n.command("types").description("List the credential types (integration providers) you can create").option("-l, --limit <n>","Page size","50").option("-o, --offset <n>","Offset","0").option("--search <text>","Filter by name").option("-f, --format <format>","Output format (json, table, yaml)").action(async e=>{let t=await a(Ie,{filter:e.search?{search:e.search}:void 0,pagination:{limit:p(e.limit,"--limit"),offset:p(e.offset,"--offset")}}),o=t.getProviders.items;c(e,t.getProviders,{headers:["ID","Key","Name","Category","Auth","Enabled"],rows:o.map(r=>[w(r.id,12),r.key,r.name,r.category,r.authType,r.isEnabled?"yes":"no"])});}),n.command("create").description("Create a credential shell from a CreateConnectionInput JSON file (no secrets; attach one with auth-api-key / auth-basic)").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=h(e),r=await a(Te,{input:o});l(`Credential created: ${r.createConnection.id}`),c(t,r.createConnection);}),n.command("update").description("Update a credential (name, description, config) from a JSON file").argument("<id>","Credential (connection) ID").argument("<file>","Path to the UpdateConnectionInput JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t,o)=>{let r=h(t),s=await a(ve,{id:e,input:r});l("Credential updated"),c(o,s.updateConnection);}),n.command("delete").description("Delete a credential (the vault secret is kept unless --delete-vault-secret)").argument("<id>","Credential (connection) ID").option("--delete-vault-secret","Also delete the backing vault secret").option("--force","Skip the confirmation prompt").action(async(e,t)=>{if(await I(`Delete credential ${e}?`,t.force),!(await a(xe,{id:e,deleteVaultSecret:t.deleteVaultSecret?true:void 0})).deleteConnection)throw new u(`Credential ${e} was not deleted.`);l(`Credential ${e} deleted`);}),n.command("test").description("Test a credential against its provider").argument("<id>","Credential (connection) ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=await a(Ae,{connectionId:e});c(t,o.testConnection);}),n.command("auth-api-key").description("Attach a provider API key to a credential (hidden prompt or named env var)").argument("<id>","Credential (connection) ID").option("--api-key-env <name>","Read the API key from this environment variable").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=await et(t.apiKeyEnv,"API key","--api-key-env"),r=await tt(Oe,"authenticateWithApiKey",{connectionId:e,apiKey:o});l(`Credential ${e}: ${r.status}`),c(t,r);}),n.command("auth-basic").description("Attach provider basic-auth credentials (hidden prompt or named env var)").argument("<id>","Credential (connection) ID").argument("<username>","Provider username").option("--password-env <name>","Read the password from this environment variable").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t,o)=>{if(!t.trim())throw new u("Provider username cannot be empty.");let r=await et(o.passwordEnv,"Password","--password-env"),s=await tt(Re,"authenticateWithBasicAuth",{connectionId:e,username:t,password:r});l(`Credential ${e}: ${s.status}`),c(o,s);});}function nt(i){let n=i.command("webhooks").description("FluidGrids inbound webhooks (event registrations)");n.command("list").description("List webhooks").option("--workflow-key <key>","Filter by workflow key").option("-s, --status <status>",`Filter by status (${V.join("|")})`).option("-f, --format <format>","Output format (json, table, yaml)").action(async e=>{let t=await a($e,{status:y(e.status,"--status",V),workflowKey:e.workflowKey});c(e,t.eventRegistrations,{headers:["ID","Name","Workflow","Trigger node","Status","Triggers","Last"],rows:t.eventRegistrations.map(o=>[w(o.id,12),o.name??"-",o.workflowKey,o.triggerNodeId,o.isActive?o.status:`${o.status} (inactive)`,String(o.totalTriggers),k(o.lastTriggeredAt)])});}),n.command("get").description("Get a webhook").argument("<id>","Event registration ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=await a(De,{id:e});c(t,E(o.eventRegistration,"Webhook",e));}),n.command("create").description("Create a webhook from a CreateEventRegistrationInput JSON file").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=h(e),r=await a(We,{input:o});l(`Webhook created: ${r.createEventRegistration.id}`),c(t,r.createEventRegistration);}),n.command("update").description("Update a webhook from an UpdateEventRegistrationInput JSON file").argument("<id>","Event registration ID").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t,o)=>{let r=h(t),s=await a(Le,{id:e,input:r});l("Webhook updated"),c(o,s.updateEventRegistration);}),n.command("delete").description("Delete a webhook").argument("<id>","Event registration ID").option("--force","Skip the confirmation prompt").action(async(e,t)=>{if(await I(`Delete webhook ${e}?`,t.force),!(await a(Ne,{id:e})).deleteEventRegistration)throw new u(`Webhook ${e} was not deleted.`);l(`Webhook ${e} deleted`);});for(let[e,t]of [["activate",true],["deactivate",false]])n.command(e).description(`${t?"Activate":"Deactivate"} a webhook`).argument("<id>","Event registration ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(o,r)=>{let s=await a(Fe,{id:o,isActive:t});l(`Webhook ${o} ${t?"activated":"deactivated"}`),c(r,s.toggleEventRegistration);});}function Y(i){if(!i.success)throw new u(i.message||"Scheduled job update failed.");return i}function rt(i){let n=i.command("scheduled-jobs").description("FluidGrids scheduled workflow runs (cron)");n.command("list").description("List scheduled jobs").option("-l, --limit <n>","Page size","20").option("-o, --offset <n>","Offset","0").option("--workflow-key <key>","Filter by workflow key").option("--enabled","Only enabled jobs").option("--disabled","Only disabled jobs").option("-f, --format <format>","Output format (json, table, yaml)").action(async e=>{if(e.enabled&&e.disabled)throw new u("Use either --enabled or --disabled, not both.");let o=(await a(_e,{enabled:e.enabled?true:e.disabled?false:void 0,workflowKey:e.workflowKey,pagination:{limit:p(e.limit,"--limit"),offset:p(e.offset,"--offset")}})).workflowScheduledJobs.jobs;c(e,o,{headers:["ID","Name","Workflow","Version","Schedule","Enabled","Next run"],rows:o.map(r=>[w(r.id,12),r.name,r.workflowKey,r.version,r.schedule,r.enabled?"yes":"no",k(r.nextRun)])});}),n.command("get").description("Get a scheduled job").argument("<jobId>","Scheduled job ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=await a(Pe,{jobId:e});c(t,E(o.workflowScheduledJob,"Scheduled job",e));}),n.command("create").description("Create a scheduled job from a ScheduledJobInput JSON file").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=h(e),r=await a(je,{input:o}),s=Y(r.createWorkflowScheduledJob);l(s.message||"Scheduled job created"),c(t,s.job??s);}),n.command("update").description("Update a scheduled job from a WorkflowUpdateScheduledJobInput JSON file").argument("<jobId>","Scheduled job ID").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t,o)=>{let r=h(t),s=await a(U,{jobId:e,input:r}),d=Y(s.updateWorkflowScheduledJob);l(d.message||"Scheduled job updated"),c(o,d.job??d);}),n.command("delete").description("Delete a scheduled job").argument("<jobId>","Scheduled job ID").option("--force","Skip the confirmation prompt").action(async(e,t)=>{await I(`Delete scheduled job ${e}?`,t.force);let o=await a(Ue,{jobId:e});if(!o.deleteWorkflowScheduledJob.success)throw new u(o.deleteWorkflowScheduledJob.message||"Delete failed.");l(`Scheduled job ${e} deleted`);});for(let[e,t]of [["pause",false],["resume",true]])n.command(e).description(`${t?"Resume":"Pause"} a scheduled job`).argument("<jobId>","Scheduled job ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(o,r)=>{let s=await a(U,{jobId:o,input:{enabled:t}}),d=Y(s.updateWorkflowScheduledJob);l(`Scheduled job ${o} ${t?"resumed":"paused"}`),c(r,d.job??d);});}function it(i,n){if(Number.isNaN(Date.parse(i)))throw new u(`Invalid value '${i}' for ${n}: expected an ISO 8601 date.`);return i}function st(i){let n=i.command("dashboard").description("FluidGrids dashboard metrics");n.command("summary").description("Workflow, run and node counters (incl. 24h / 7d / 30d windows)").option("-p, --project <id>","Scope to a project").option("-f, --format <format>","Output format (json, table, yaml)").action(async e=>{let t=await a(Ke,{projectId:e.project});c(e,t.dashboardSummary);}),n.command("usage").description("Workflow and node execution metrics for a date range").requiredOption("--start <date>","Range start (ISO 8601)").requiredOption("--end <date>","Range end (ISO 8601)").option("-f, --format <format>","Output format (json, table, yaml)").action(async e=>{let t=it(e.start,"--start"),o=it(e.end,"--end");if(Date.parse(t)>Date.parse(o))throw new u("--start must not be after --end.");let r=await a(qe,{input:{startDate:t,endDate:o}});c(e,r.usageMetrics);});}function at(i){i.command("search").description("Search FluidGrids workflows, runs, nodes").command("query").description("Search across FluidGrids entities").argument("<query>","Search text").option("-t, --type <type>",`Restrict to one entity type (${H.join("|")})`).option("-l, --limit <n>","Page size","20").option("-o, --offset <n>","Offset","0").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{if(!e.trim())throw new u("Search text cannot be empty.");let o=y(t.type,"--type",H),r=p(t.limit,"--limit"),s=p(t.offset,"--offset"),d=o?(await a(Me,{entityType:o,query:e,limit:r,offset:s})).searchByEntityType:(await a(Je,{input:{query:e,limit:r,offset:s}})).search;c(t,d);});}function ut(i){i.command("admin").description("FluidGrids administration").command("system-info").description("Deployment information (version, revision, environment) of the workflow service").option("-f, --format <format>","Output format (json, table, yaml)").action(async e=>{let t=await a(Ve);c(e,t.systemConfig);});}var Dt={id:"fluidgrids",version:"1.0.0",displayName:"FluidGrids",dependsOn:["auth","workspaces"],register(i,n){X(n),ze(i),Xe(i),Ze(i),ot(i),nt(i),rt(i),st(i),at(i),ut(i);}},$n=Dt;module.exports=$n;
400
+ `;function p(i,n){if(!/^\d+$/.test(i))throw new u(`Invalid value '${i}' for ${n}: expected a non-negative integer.`);let e=Number(i);if(!Number.isSafeInteger(e))throw new u(`Invalid value '${i}' for ${n}: expected a non-negative integer.`);return e}function y(i,n,e){if(i===void 0)return;let t=e.find(o=>o===i);if(t===void 0)throw new u(`Invalid value '${i}' for ${n}. Allowed: ${e.join(", ")}`);return t}function x(i,n){let e;try{e=JSON.parse(i);}catch{throw new u(`${n} must be valid JSON.`)}if(!Ct(e))throw new u(`${n} must be a JSON object.`);return e}function h(i){let n;try{n=fs.readFileSync(i,"utf8");}catch(e){let t=e instanceof Error?e.message:String(e);throw new u(`Cannot read ${i}: ${t}`)}return x(n,i)}function R(i,n){if(i!==void 0){if(!i.trim())throw new u(`${n} cannot be empty.`);return i}}function b(i,n,e){if(i==null)throw new u(`${n} ${e} not found (NOT_FOUND)`);return i}function Ct(i){return i!==null&&typeof i=="object"&&!Array.isArray(i)}function Be(i,n=[]){return [...n,i]}async function I(i,n){if(!await F(i,n))throw new u("Aborted: nothing was changed.")}var K=["DRAFT","ACTIVE","ARCHIVED","DEPRECATED"],q=["PENDING","RUNNING","WAITING","COMPLETED","FAILED","CANCELLED","TERMINATED"],He=["COMPLETED","FAILED","CANCELLED","TERMINATED"],G=["DEBUG","INFO","WARN","ERROR"],J=["BUILTIN","CUSTOM","STORE"],M=["AVAILABLE","DEPRECATED","DISABLED"],V=["ACTIVE","PAUSED","DISABLED","ARCHIVED"],B=["ACTIVE","INACTIVE","PENDING_AUTH","ERROR","EXPIRED","REVOKED"],H=["workflow","run","node","event"];function Ye(i){return {headers:["ID","Key","Name","Version","Status","Active","Updated"],rows:i.map(n=>[w(n.id,12),n.workflowKey,w(n.name,32),n.version,n.status,n.isActive?"yes":"no",k(n.updatedAt)])}}function ze(i){let n=i.command("workflows").description("FluidGrids workflow definitions");n.command("list").description("List workflow definitions").option("-l, --limit <n>","Page size","20").option("-o, --offset <n>","Offset","0").option("-s, --status <status>",`Filter by status (${K.join("|")})`).option("--category <category>","Filter by category").option("--tag <tag>","Filter by tag (repeatable)",Be).option("--latest-only","Only the latest version of each workflow key").option("-f, --format <format>","Output format (json, table, yaml)").action(async t=>{let o={limit:p(t.limit,"--limit"),offset:p(t.offset,"--offset")},r=y(t.status,"--status",K);r&&(o.status=r),t.category&&(o.category=t.category),t.tag?.length&&(o.tags=t.tag),t.latestOnly&&(o.latestOnly=true);let s=await a(Z,{input:o});c(t,s.workflowDefinitions.items,Ye(s.workflowDefinitions.items));}),n.command("get").description("Get a workflow definition by ID, or by key with --key").argument("[id]","Workflow definition ID").option("--key <workflowKey>","Look up by workflow key instead of ID").option("--wf-version <version>","Version to fetch with --key").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,o)=>{if(!t&&!o.key)throw new u("Pass a workflow ID or --key <workflowKey>.");if(t&&o.key)throw new u("Pass either a workflow ID or --key, not both.");let r=await a(D,t?{id:t}:{workflowKey:o.key,version:o.wfVersion});c(o,b(r.workflowDefinition,"Workflow",t??o.key??""));}),n.command("versions").description("List every stored version of a workflow key").argument("<workflowKey>","Workflow key").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,o)=>{let r=await a(ee,{workflowKey:t});c(o,r.workflowVersions,Ye(r.workflowVersions));}),n.command("create").description("Create a workflow definition from a CreateWorkflowDefinitionInput JSON file").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,o)=>{let r=h(t),s=await a(te,{input:r});l(`Workflow created: ${s.createWorkflowDefinition.workflowKey}`),c(o,s.createWorkflowDefinition);}),n.command("update").description("Update a workflow definition from an UpdateWorkflowDefinitionInput JSON file").argument("<id>","Workflow definition ID").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,o,r)=>{let s=h(o),d=await a(oe,{id:t,input:s});l("Workflow updated"),c(r,d.updateWorkflowDefinition);}),n.command("delete").description("Delete a workflow (every version, or one with --wf-version)").argument("<workflowKey>","Workflow key").option("--wf-version <version>","Delete only this version").option("--force","Skip the confirmation prompt").action(async(t,o)=>{let r=o.wfVersion?`${t}@${o.wfVersion}`:`${t} (all versions)`;if(await I(`Delete workflow ${r}?`,o.force),!(await a(ne,{workflowKey:t,version:o.wfVersion})).deleteWorkflowDefinition)throw new u(`Workflow ${r} was not deleted.`);l(`Workflow ${r} deleted`);}),n.command("trigger").description("Trigger a workflow run").argument("<workflowKey>","Workflow key").requiredOption("--wf-version <version>","Workflow version").requiredOption("--trigger-node <id>","Trigger node ID").option("-i, --input <json>","Trigger data as a JSON object").option("--stop-at-node <id>","Stop the run after this node").option("--test","Run in TEST mode instead of PRODUCTION").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,o)=>{let r={workflowKey:t,version:R(o.wfVersion,"--wf-version"),triggerNodeId:R(o.triggerNode,"--trigger-node")};o.input!==void 0&&(r.triggerData=x(o.input,"--input")),o.stopAtNode&&(r.stopAtNodeId=o.stopAtNode),o.test&&(r.mode="TEST");let s=await a(re,{input:r});c(o,s.triggerWorkflow);}),n.command("duplicate").description("Duplicate a workflow version under a new key").argument("<workflowKey>","Source workflow key").argument("<version>","Source version").requiredOption("--new-key <key>","Workflow key for the copy").option("--new-version <version>","Version for the copy").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,o,r)=>{let s={newWorkflowKey:R(r.newKey,"--new-key")};r.newVersion&&(s.newVersion=r.newVersion);let d=await a(ue,{workflowKey:t,version:o,input:s});if(!d.duplicateWorkflow.success)throw new u(d.duplicateWorkflow.message??"Duplicate failed.");c(r,d.duplicateWorkflow.workflow??d.duplicateWorkflow);});let e=[["publish","Publish a workflow definition version",ie,"publishWorkflow"],["activate","Make a workflow definition version the active one",se,"activateWorkflowDefinition"],["deactivate","Deactivate a workflow definition version",ae,"deactivateWorkflowDefinition"],["archive","Archive a workflow definition version",de,"archiveWorkflow"]];for(let[t,o,r,s]of e)n.command(t).description(o).argument("<id>","Workflow definition ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(d,m)=>{let g=(await a(r,{id:d}))[s];if(!g)throw new u(`Workflow ${d}: ${t} returned no result.`);l(`Workflow ${g.workflowKey}@${g.version}: ${g.status}`),c(m,g);});n.command("import").description("Import a workflow from a store template (ImportWorkflowTemplateInput JSON)").argument("<file>","Path to the template input JSON").option("--name <name>","Override the workflow name").option("--description <text>","Override the description").option("--icon <icon>","Override the icon").option("--category <category>","Override the category").option("--project-id <id>","Scope to a project").option("--source-template-id <id>","Source template ID (lineage)").option("--context <json>","Context metadata as a JSON object").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,o)=>{let r={...h(t)},s=R(o.name,"--name"),d=R(o.projectId,"--project-id"),m=R(o.sourceTemplateId,"--source-template-id");s!==void 0&&(r.name=s),o.description!==void 0&&(r.description=o.description),o.icon!==void 0&&(r.icon=o.icon),o.category!==void 0&&(r.category=o.category),d!==void 0&&(r.projectId=d),m!==void 0&&(r.sourceTemplateId=m),o.context!==void 0&&(r.context=x(o.context,"--context"));let C=await a(ce,{input:r});if(!C.importWorkflowTemplate.success)throw new u(C.importWorkflowTemplate.message??"Import failed.");l("Workflow imported"),c(o,C.importWorkflowTemplate.workflow??C.importWorkflowTemplate);});}var It=100;function Qe(i){return {headers:["ID","Workflow","Version","Status","Progress","Started","Completed"],rows:i.map(n=>[w(n.id,12),n.workflowKey,n.version,n.status,`${Math.round(n.progress)}%`,k(n.startedAt),k(n.completedAt)])}}async function L(i){let n=await a(pe,{id:i});return b(n.workflowRun,"Run",i)}function Tt(i){return He.some(n=>n===i.toUpperCase())}async function St(i,n,e,t,o){if(t===0)return [];let r=[],s=new Set,d=0,m=0;for(;r.length<t;){let g=(await a(_,{input:{workflowKey:n,status:e,limit:It,offset:d}})).workflowRuns;if(g.items.length===0){if(g.hasMore)throw new u("Run listing returned an empty page before the end.");break}for(let $ of g.items)if(!($.workflowId!==i||s.has($.id))){if(s.add($.id),m<o){m++;continue}if(r.push($),r.length===t)break}if(d+=g.items.length,!g.hasMore)break}return r}function Ot(i,n,e){let t=e.filter(d=>d.nodeId===n);if(t.length===0)throw new u(`Node ${n} not found in run ${i} (NOT_FOUND)`);let o=t.filter(d=>["FAILED","TIMEOUT"].includes(d.status.toUpperCase()));if(o.length===0)throw new u(`Node ${n} is not failed in run ${i} (INVALID_STATE)`);let[r,...s]=o;if(!r||s.length>0)throw new u(`Node ${n} is ambiguous in run ${i}; retry a specific node state.`);return r}function Rt(i){return new Promise(n=>setTimeout(n,i))}function Xe(i){let n=i.command("runs").description("FluidGrids workflow runs");n.command("list").description("List workflow runs").option("-l, --limit <n>","Page size","20").option("-o, --offset <n>","Offset","0").option("-s, --status <status>",`Filter by status (${q.join("|")})`).option("--workflow-key <key>","Filter by workflow key").option("--workflow-id <id>","Filter by exact workflow definition ID (scans all pages)").option("-f, --format <format>","Output format (json, table, yaml)").action(async e=>{let t=p(e.limit,"--limit"),o=p(e.offset,"--offset"),r=y(e.status,"--status",q);if(e.workflowId&&e.workflowKey)throw new u("Use either --workflow-id or --workflow-key, not both.");if(e.workflowId){let m=await a(D,{id:e.workflowId}),C=b(m.workflowDefinition,"Workflow",e.workflowId),g=await St(e.workflowId,C.workflowKey,r,t,o);c(e,g,Qe(g));return}let s={limit:t,offset:o};r&&(s.status=r),e.workflowKey&&(s.workflowKey=e.workflowKey);let d=await a(_,{input:s});c(e,d.workflowRuns.items,Qe(d.workflowRuns.items));}),n.command("get").description("Get a run (with node states)").argument("<id>","Run ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{c(t,await L(e));}),n.command("cancel").description("Cancel a run").argument("<id>","Run ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=await a(me,{id:e});l(`Run ${e}: ${o.cancelWorkflowRun.status}`),c(t,o.cancelWorkflowRun);}),n.command("pause").description("Pause a run").argument("<id>","Run ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=await a(ge,{id:e});l(`Run ${e}: ${o.pauseWorkflowRun.status}`),c(t,o.pauseWorkflowRun);}),n.command("resume").description("Resume a paused or waiting run").argument("<id>","Run ID").option("--payload <json>","JSON object delivered to the waiting node").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=t.payload===void 0?void 0:x(t.payload,"--payload"),r=await a(we,{id:e,payload:o});if(!r.resumeWorkflowRun.success)throw new u(r.resumeWorkflowRun.message);c(t,r.resumeWorkflowRun);}),n.command("wait").description("Poll a run until it reaches a terminal status").argument("<id>","Run ID").option("--timeout <ms>","Give up after this many milliseconds","300000").option("--poll-interval <ms>","Delay between polls in milliseconds","1000").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=p(t.timeout,"--timeout"),r=p(t.pollInterval,"--poll-interval"),s=Date.now(),d=await L(e);for(;!Tt(d.status);){if(Date.now()-s>o)throw new u(`Timed out waiting for run ${e} (last status ${d.status}).`);await Rt(r),d=await L(e);}c(t,d);}),n.command("logs").description("Get run logs (one cursor page)").argument("<id>","Run ID").option("--level <level>",`Minimum level (${G.join("|")})`).option("--node-id <id>","Only this graph node").option("--search <text>","Only lines containing this text").option("--include-child-runs","Include sub-workflow runs").option("--limit <n>","Page size, 1 to 1000").option("--after <cursor>","Continue after a nextCursor from an earlier page").option("--page-info","Print the whole page (lines + cursor) instead of only lines").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=y(t.level,"--level",G),r=t.limit===void 0?void 0:p(t.limit,"--limit");if(r!==void 0&&(r<1||r>1e3))throw new u(`Invalid value '${t.limit}' for --limit: expected 1 to 1000.`);if(t.after!==void 0&&!t.after.trim())throw new u("--after cursor cannot be empty.");let d=(await a(fe,{runId:e,nodeId:t.nodeId,minLevel:o,limit:r,after:t.after,search:t.search,includeChildRuns:t.includeChildRuns})).workflowRunLogs;if(t.pageInfo){c(t,d);return}c(t,d.lines,{headers:["Time","Level","Node","Message"],rows:d.lines.map(m=>[k(m.timestamp),m.level,m.nodeId??"-",w(m.message,100)])});}),n.command("retry-node").description("Retry one failed node of a run (run ID + graph node ID)").argument("<runId>","Run ID").argument("<nodeId>","Graph node ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t,o)=>{let r=await L(e),s=Ot(e,t,r.nodeStates??[]),d=await a(ye,{id:s.id,nodeId:t});l(`Node ${t} retry: ${d.retryNode.status}`),c(o,d.retryNode);});}function Ze(i){let n=i.command("nodes").description("FluidGrids node catalogue");n.command("list").description("List node endpoint configurations").option("-l, --limit <n>","Page size","20").option("-o, --offset <n>","Offset","0").option("-t, --node-type <type>","Filter by node type").option("--publish-type <type>",`Filter by publish type (${J.join("|")})`).option("--status <status>",`Filter by status (${M.join("|")})`).option("-f, --format <format>","Output format (json, table, yaml)").action(async e=>{let o=(await a(he,{nodeType:e.nodeType,publishType:y(e.publishType,"--publish-type",J),status:y(e.status,"--status",M),pagination:{limit:p(e.limit,"--limit"),offset:p(e.offset,"--offset")}})).nodeEndpointConfigs.configs;c(e,o,{headers:["Type","Version","Name","Category","Publish","Status","Latest"],rows:o.map(r=>[r.nodeType,r.nodeVersion,r.name,r.category??"-",r.publishType,r.status,r.isLatest?"yes":"no"])});}),n.command("get").description("Get a node endpoint configuration by type and version").argument("<nodeType>","Node type").argument("<nodeVersion>","Node version").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t,o)=>{let r=await a(be,{nodeType:e,nodeVersion:t});c(o,b(r.nodeEndpointConfig,"Node",`${e}@${t}`));});}var At=/^[A-Za-z_][A-Za-z0-9_]*$/;async function $t(i,n=process.stdin,e=process.stderr){if(!n.isTTY)throw new u("A terminal is required to prompt for a secret.");let t=new stream.Writable({write(r,s,d){d();}}),o=readline.createInterface({input:n,output:t,terminal:true});e.write(`${i}: `);try{return await new Promise(r=>{o.question("",r);})}finally{o.close(),e.write(`
401
+ `);}}async function et(i,n,e,t=process.env,o=$t){if(i!==void 0){if(!At.test(i))throw new u(`Invalid environment variable name for ${e}.`);let s=t[i];if(!s?.trim())throw new u(`The environment variable selected by ${e} is empty or unset.`);return s}if(!process.stdin.isTTY)throw new u(`An interactive terminal or ${e} is required to supply ${n}.`);let r=await o(n);if(!r.trim())throw new u(`${n} cannot be empty.`);return r}async function tt(i,n,e){try{let o=(await a(i,{input:e}))[n];if(o===void 0)throw new Error("empty response");return o}catch{throw new u("Connection authentication failed; verify the connection and secret.")}}function ot(i){let n=i.command("credentials").description("FluidGrids credentials (integration connections)");n.command("list").description("List credentials").option("-l, --limit <n>","Page size","20").option("-o, --offset <n>","Offset","0").option("-p, --provider-id <id>","Filter by provider ID").option("-s, --status <status>",`Filter by status (${B.join("|")})`).option("--search <text>","Filter by name").option("-f, --format <format>","Output format (json, table, yaml)").action(async e=>{let t={};e.providerId&&(t.providerId=e.providerId);let o=y(e.status,"--status",B);o&&(t.status=o),e.search&&(t.search=e.search);let s=(await a(Ee,{filter:Object.keys(t).length>0?t:void 0,pagination:{limit:p(e.limit,"--limit"),offset:p(e.offset,"--offset")}})).getConnections.items;c(e,s,{headers:["ID","Name","Provider","Status","Last used"],rows:s.map(d=>[w(d.id,12),d.name,d.provider?.key??d.providerId,d.status,k(d.lastUsedAt)])});}),n.command("get").description("Get a credential").argument("<id>","Credential (connection) ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=await a(Ce,{id:e});c(t,b(o.getConnection,"Credential",e));}),n.command("types").description("List the credential types (integration providers) you can create").option("-l, --limit <n>","Page size","50").option("-o, --offset <n>","Offset","0").option("--search <text>","Filter by name").option("-f, --format <format>","Output format (json, table, yaml)").action(async e=>{let t=await a(Ie,{filter:e.search?{search:e.search}:void 0,pagination:{limit:p(e.limit,"--limit"),offset:p(e.offset,"--offset")}}),o=t.getProviders.items;c(e,t.getProviders,{headers:["ID","Key","Name","Category","Auth","Enabled"],rows:o.map(r=>[w(r.id,12),r.key,r.name,r.category,r.authType,r.isEnabled?"yes":"no"])});}),n.command("create").description("Create a credential shell from a CreateConnectionInput JSON file (no secrets; attach one with auth-api-key / auth-basic)").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=h(e),r=await a(Te,{input:o});l(`Credential created: ${r.createConnection.id}`),c(t,r.createConnection);}),n.command("update").description("Update a credential (name, description, config) from a JSON file").argument("<id>","Credential (connection) ID").argument("<file>","Path to the UpdateConnectionInput JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t,o)=>{let r=h(t),s=await a(ve,{id:e,input:r});l("Credential updated"),c(o,s.updateConnection);}),n.command("delete").description("Delete a credential (the vault secret is kept unless --delete-vault-secret)").argument("<id>","Credential (connection) ID").option("--delete-vault-secret","Also delete the backing vault secret").option("--force","Skip the confirmation prompt").action(async(e,t)=>{if(await I(`Delete credential ${e}?`,t.force),!(await a(xe,{id:e,deleteVaultSecret:t.deleteVaultSecret?true:void 0})).deleteConnection)throw new u(`Credential ${e} was not deleted.`);l(`Credential ${e} deleted`);}),n.command("test").description("Test a credential against its provider").argument("<id>","Credential (connection) ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=await a(Ae,{connectionId:e});c(t,o.testConnection);}),n.command("auth-api-key").description("Attach a provider API key to a credential (hidden prompt or named env var)").argument("<id>","Credential (connection) ID").option("--api-key-env <name>","Read the API key from this environment variable").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=await et(t.apiKeyEnv,"API key","--api-key-env"),r=await tt(Oe,"authenticateWithApiKey",{connectionId:e,apiKey:o});l(`Credential ${e}: ${r.status}`),c(t,r);}),n.command("auth-basic").description("Attach provider basic-auth credentials (hidden prompt or named env var)").argument("<id>","Credential (connection) ID").argument("<username>","Provider username").option("--password-env <name>","Read the password from this environment variable").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t,o)=>{if(!t.trim())throw new u("Provider username cannot be empty.");let r=await et(o.passwordEnv,"Password","--password-env"),s=await tt(Re,"authenticateWithBasicAuth",{connectionId:e,username:t,password:r});l(`Credential ${e}: ${s.status}`),c(o,s);});}function nt(i){let n=i.command("webhooks").description("FluidGrids inbound webhooks (event registrations)");n.command("list").description("List webhooks").option("--workflow-key <key>","Filter by workflow key").option("-s, --status <status>",`Filter by status (${V.join("|")})`).option("-f, --format <format>","Output format (json, table, yaml)").action(async e=>{let t=await a($e,{status:y(e.status,"--status",V),workflowKey:e.workflowKey});c(e,t.eventRegistrations,{headers:["ID","Name","Workflow","Trigger node","Status","Triggers","Last"],rows:t.eventRegistrations.map(o=>[w(o.id,12),o.name??"-",o.workflowKey,o.triggerNodeId,o.isActive?o.status:`${o.status} (inactive)`,String(o.totalTriggers),k(o.lastTriggeredAt)])});}),n.command("get").description("Get a webhook").argument("<id>","Event registration ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=await a(De,{id:e});c(t,b(o.eventRegistration,"Webhook",e));}),n.command("create").description("Create a webhook from a CreateEventRegistrationInput JSON file").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=h(e),r=await a(We,{input:o});l(`Webhook created: ${r.createEventRegistration.id}`),c(t,r.createEventRegistration);}),n.command("update").description("Update a webhook from an UpdateEventRegistrationInput JSON file").argument("<id>","Event registration ID").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t,o)=>{let r=h(t),s=await a(Le,{id:e,input:r});l("Webhook updated"),c(o,s.updateEventRegistration);}),n.command("delete").description("Delete a webhook").argument("<id>","Event registration ID").option("--force","Skip the confirmation prompt").action(async(e,t)=>{if(await I(`Delete webhook ${e}?`,t.force),!(await a(Ne,{id:e})).deleteEventRegistration)throw new u(`Webhook ${e} was not deleted.`);l(`Webhook ${e} deleted`);});for(let[e,t]of [["activate",true],["deactivate",false]])n.command(e).description(`${t?"Activate":"Deactivate"} a webhook`).argument("<id>","Event registration ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(o,r)=>{let s=await a(Fe,{id:o,isActive:t});l(`Webhook ${o} ${t?"activated":"deactivated"}`),c(r,s.toggleEventRegistration);});}function Y(i){if(!i.success)throw new u(i.message||"Scheduled job update failed.");return i}function rt(i){let n=i.command("scheduled-jobs").description("FluidGrids scheduled workflow runs (cron)");n.command("list").description("List scheduled jobs").option("-l, --limit <n>","Page size","20").option("-o, --offset <n>","Offset","0").option("--workflow-key <key>","Filter by workflow key").option("--enabled","Only enabled jobs").option("--disabled","Only disabled jobs").option("-f, --format <format>","Output format (json, table, yaml)").action(async e=>{if(e.enabled&&e.disabled)throw new u("Use either --enabled or --disabled, not both.");let o=(await a(_e,{enabled:e.enabled?true:e.disabled?false:void 0,workflowKey:e.workflowKey,pagination:{limit:p(e.limit,"--limit"),offset:p(e.offset,"--offset")}})).workflowScheduledJobs.jobs;c(e,o,{headers:["ID","Name","Workflow","Version","Schedule","Enabled","Next run"],rows:o.map(r=>[w(r.id,12),r.name,r.workflowKey,r.version,r.schedule,r.enabled?"yes":"no",k(r.nextRun)])});}),n.command("get").description("Get a scheduled job").argument("<jobId>","Scheduled job ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=await a(Pe,{jobId:e});c(t,b(o.workflowScheduledJob,"Scheduled job",e));}),n.command("create").description("Create a scheduled job from a ScheduledJobInput JSON file").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{let o=h(e),r=await a(je,{input:o}),s=Y(r.createWorkflowScheduledJob);l(s.message||"Scheduled job created"),c(t,s.job??s);}),n.command("update").description("Update a scheduled job from a WorkflowUpdateScheduledJobInput JSON file").argument("<jobId>","Scheduled job ID").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t,o)=>{let r=h(t),s=await a(U,{jobId:e,input:r}),d=Y(s.updateWorkflowScheduledJob);l(d.message||"Scheduled job updated"),c(o,d.job??d);}),n.command("delete").description("Delete a scheduled job").argument("<jobId>","Scheduled job ID").option("--force","Skip the confirmation prompt").action(async(e,t)=>{await I(`Delete scheduled job ${e}?`,t.force);let o=await a(Ue,{jobId:e});if(!o.deleteWorkflowScheduledJob.success)throw new u(o.deleteWorkflowScheduledJob.message||"Delete failed.");l(`Scheduled job ${e} deleted`);});for(let[e,t]of [["pause",false],["resume",true]])n.command(e).description(`${t?"Resume":"Pause"} a scheduled job`).argument("<jobId>","Scheduled job ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(o,r)=>{let s=await a(U,{jobId:o,input:{enabled:t}}),d=Y(s.updateWorkflowScheduledJob);l(`Scheduled job ${o} ${t?"resumed":"paused"}`),c(r,d.job??d);});}function it(i,n){if(Number.isNaN(Date.parse(i)))throw new u(`Invalid value '${i}' for ${n}: expected an ISO 8601 date.`);return i}function st(i){let n=i.command("dashboard").description("FluidGrids dashboard metrics");n.command("summary").description("Workflow, run and node counters (incl. 24h / 7d / 30d windows)").option("-p, --project <id>","Scope to a project").option("-f, --format <format>","Output format (json, table, yaml)").action(async e=>{let t=await a(Ke,{projectId:e.project});c(e,t.dashboardSummary);}),n.command("usage").description("Workflow and node execution metrics for a date range").requiredOption("--start <date>","Range start (ISO 8601)").requiredOption("--end <date>","Range end (ISO 8601)").option("-f, --format <format>","Output format (json, table, yaml)").action(async e=>{let t=it(e.start,"--start"),o=it(e.end,"--end");if(Date.parse(t)>Date.parse(o))throw new u("--start must not be after --end.");let r=await a(qe,{input:{startDate:t,endDate:o}});c(e,r.usageMetrics);});}function at(i){i.command("search").description("Search FluidGrids workflows, runs, nodes").command("query").description("Search across FluidGrids entities").argument("<query>","Search text").option("-t, --type <type>",`Restrict to one entity type (${H.join("|")})`).option("-l, --limit <n>","Page size","20").option("-o, --offset <n>","Offset","0").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,t)=>{if(!e.trim())throw new u("Search text cannot be empty.");let o=y(t.type,"--type",H),r=p(t.limit,"--limit"),s=p(t.offset,"--offset"),d=o?(await a(Me,{entityType:o,query:e,limit:r,offset:s})).searchByEntityType:(await a(Je,{input:{query:e,limit:r,offset:s}})).search;c(t,d);});}function ut(i){i.command("admin").description("FluidGrids administration").command("system-info").description("Deployment information (version, revision, environment) of the workflow service").option("-f, --format <format>","Output format (json, table, yaml)").action(async e=>{let t=await a(Ve);c(e,t.systemConfig);});}var Dt={id:"fluidgrids",version:"1.0.0",displayName:"FluidGrids",dependsOn:["auth","workspaces"],register(i,n){X(n),ze(i),Xe(i),Ze(i),ot(i),nt(i),rt(i),st(i),at(i),ut(i);}},$n=Dt;module.exports=$n;
@@ -1,4 +1,4 @@
1
- import {a,b,h as h$1,i,o as o$1,p as p$1,q as q$1}from'../../chunk-W4JZR7RJ.js';import {o}from'../../chunk-YIY5IDXQ.js';import {readFileSync}from'fs';import {createInterface}from'readline';import {Writable}from'stream';var E=`
1
+ import {a,b,i,k as k$1,q as q$1,r,s}from'../../chunk-O6UCQ5IT.js';import {o}from'../../chunk-YIY5IDXQ.js';import {readFileSync}from'fs';import {createInterface}from'readline';import {Writable}from'stream';var E=`
2
2
  id workflowKey name description version status category tags icon isActive
3
3
  totalVersions projectId createdAt updatedAt
4
4
  `,q=`
@@ -397,5 +397,5 @@ import {a,b,h as h$1,i,o as o$1,p as p$1,q as q$1}from'../../chunk-W4JZR7RJ.js';
397
397
  query FluidgridsSystemConfig {
398
398
  systemConfig { version revision environment deploymentType hostname hostIp }
399
399
  }
400
- `;function p(r,i){if(!/^\d+$/.test(r))throw new o(`Invalid value '${r}' for ${i}: expected a non-negative integer.`);let t=Number(r);if(!Number.isSafeInteger(t))throw new o(`Invalid value '${r}' for ${i}: expected a non-negative integer.`);return t}function w(r,i,t){if(r===void 0)return;let e=t.find(o=>o===r);if(e===void 0)throw new o(`Invalid value '${r}' for ${i}. Allowed: ${t.join(", ")}`);return e}function C(r,i){let t;try{t=JSON.parse(r);}catch{throw new o(`${i} must be valid JSON.`)}if(!re(t))throw new o(`${i} must be a JSON object.`);return t}function k(r){let i;try{i=readFileSync(r,"utf8");}catch(t){let e=t instanceof Error?t.message:String(t);throw new o(`Cannot read ${r}: ${e}`)}return C(i,r)}function T(r,i){if(r!==void 0){if(!r.trim())throw new o(`${i} cannot be empty.`);return r}}function h(r,i,t){if(r==null)throw new o(`${i} ${t} not found (NOT_FOUND)`);return r}function re(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}function Jt(r,i=[]){return [...i,r]}async function I(r,i){if(!await q$1(r,i))throw new o("Aborted: nothing was changed.")}var U=["DRAFT","ACTIVE","ARCHIVED","DEPRECATED"],j=["PENDING","RUNNING","WAITING","COMPLETED","FAILED","CANCELLED","TERMINATED"],Mt=["COMPLETED","FAILED","CANCELLED","TERMINATED"],K=["DEBUG","INFO","WARN","ERROR"],P=["BUILTIN","CUSTOM","STORE"],J=["AVAILABLE","DEPRECATED","DISABLED"],M=["ACTIVE","PAUSED","DISABLED","ARCHIVED"],G=["ACTIVE","INACTIVE","PENDING_AUTH","ERROR","EXPIRED","REVOKED"],V=["workflow","run","node","event"];function Gt(r){return {headers:["ID","Key","Name","Version","Status","Active","Updated"],rows:r.map(i=>[p$1(i.id,12),i.workflowKey,p$1(i.name,32),i.version,i.status,i.isActive?"yes":"no",o$1(i.updatedAt)])}}function Vt(r){let i$1=r.command("workflows").description("FluidGrids workflow definitions");i$1.command("list").description("List workflow definitions").option("-l, --limit <n>","Page size","20").option("-o, --offset <n>","Offset","0").option("-s, --status <status>",`Filter by status (${U.join("|")})`).option("--category <category>","Filter by category").option("--tag <tag>","Filter by tag (repeatable)",Jt).option("--latest-only","Only the latest version of each workflow key").option("-f, --format <format>","Output format (json, table, yaml)").action(async e=>{let o={limit:p(e.limit,"--limit"),offset:p(e.offset,"--offset")},n=w(e.status,"--status",U);n&&(o.status=n),e.category&&(o.category=e.category),e.tag?.length&&(o.tags=e.tag),e.latestOnly&&(o.latestOnly=true);let s=await b(q,{input:o});h$1(e,s.workflowDefinitions.items,Gt(s.workflowDefinitions.items));}),i$1.command("get").description("Get a workflow definition by ID, or by key with --key").argument("[id]","Workflow definition ID").option("--key <workflowKey>","Look up by workflow key instead of ID").option("--wf-version <version>","Version to fetch with --key").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,o$1)=>{if(!e&&!o$1.key)throw new o("Pass a workflow ID or --key <workflowKey>.");if(e&&o$1.key)throw new o("Pass either a workflow ID or --key, not both.");let n=await b(v,e?{id:e}:{workflowKey:o$1.key,version:o$1.wfVersion});h$1(o$1,h(n.workflowDefinition,"Workflow",e??o$1.key??""));}),i$1.command("versions").description("List every stored version of a workflow key").argument("<workflowKey>","Workflow key").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,o)=>{let n=await b(Y,{workflowKey:e});h$1(o,n.workflowVersions,Gt(n.workflowVersions));}),i$1.command("create").description("Create a workflow definition from a CreateWorkflowDefinitionInput JSON file").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,o)=>{let n=k(e),s=await b(z,{input:n});i(`Workflow created: ${s.createWorkflowDefinition.workflowKey}`),h$1(o,s.createWorkflowDefinition);}),i$1.command("update").description("Update a workflow definition from an UpdateWorkflowDefinitionInput JSON file").argument("<id>","Workflow definition ID").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,o,n)=>{let s=k(o),d=await b(Z,{id:e,input:s});i("Workflow updated"),h$1(n,d.updateWorkflowDefinition);}),i$1.command("delete").description("Delete a workflow (every version, or one with --wf-version)").argument("<workflowKey>","Workflow key").option("--wf-version <version>","Delete only this version").option("--force","Skip the confirmation prompt").action(async(e,o$1)=>{let n=o$1.wfVersion?`${e}@${o$1.wfVersion}`:`${e} (all versions)`;if(await I(`Delete workflow ${n}?`,o$1.force),!(await b(Q,{workflowKey:e,version:o$1.wfVersion})).deleteWorkflowDefinition)throw new o(`Workflow ${n} was not deleted.`);i(`Workflow ${n} deleted`);}),i$1.command("trigger").description("Trigger a workflow run").argument("<workflowKey>","Workflow key").requiredOption("--wf-version <version>","Workflow version").requiredOption("--trigger-node <id>","Trigger node ID").option("-i, --input <json>","Trigger data as a JSON object").option("--stop-at-node <id>","Stop the run after this node").option("--test","Run in TEST mode instead of PRODUCTION").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,o)=>{let n={workflowKey:e,version:T(o.wfVersion,"--wf-version"),triggerNodeId:T(o.triggerNode,"--trigger-node")};o.input!==void 0&&(n.triggerData=C(o.input,"--input")),o.stopAtNode&&(n.stopAtNodeId=o.stopAtNode),o.test&&(n.mode="TEST");let s=await b(X,{input:n});h$1(o,s.triggerWorkflow);}),i$1.command("duplicate").description("Duplicate a workflow version under a new key").argument("<workflowKey>","Source workflow key").argument("<version>","Source version").requiredOption("--new-key <key>","Workflow key for the copy").option("--new-version <version>","Version for the copy").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,o$1,n)=>{let s={newWorkflowKey:T(n.newKey,"--new-key")};n.newVersion&&(s.newVersion=n.newVersion);let d=await b(nt,{workflowKey:e,version:o$1,input:s});if(!d.duplicateWorkflow.success)throw new o(d.duplicateWorkflow.message??"Duplicate failed.");h$1(n,d.duplicateWorkflow.workflow??d.duplicateWorkflow);});let t=[["publish","Publish a workflow definition version",tt,"publishWorkflow"],["activate","Make a workflow definition version the active one",et,"activateWorkflowDefinition"],["deactivate","Deactivate a workflow definition version",ot,"deactivateWorkflowDefinition"],["archive","Archive a workflow definition version",it,"archiveWorkflow"]];for(let[e,o$1,n,s]of t)i$1.command(e).description(o$1).argument("<id>","Workflow definition ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(d,f)=>{let m=(await b(n,{id:d}))[s];if(!m)throw new o(`Workflow ${d}: ${e} returned no result.`);i(`Workflow ${m.workflowKey}@${m.version}: ${m.status}`),h$1(f,m);});i$1.command("import").description("Import a workflow from a store template (ImportWorkflowTemplateInput JSON)").argument("<file>","Path to the template input JSON").option("--name <name>","Override the workflow name").option("--description <text>","Override the description").option("--icon <icon>","Override the icon").option("--category <category>","Override the category").option("--project-id <id>","Scope to a project").option("--source-template-id <id>","Source template ID (lineage)").option("--context <json>","Context metadata as a JSON object").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,o$1)=>{let n={...k(e)},s=T(o$1.name,"--name"),d=T(o$1.projectId,"--project-id"),f=T(o$1.sourceTemplateId,"--source-template-id");s!==void 0&&(n.name=s),o$1.description!==void 0&&(n.description=o$1.description),o$1.icon!==void 0&&(n.icon=o$1.icon),o$1.category!==void 0&&(n.category=o$1.category),d!==void 0&&(n.projectId=d),f!==void 0&&(n.sourceTemplateId=f),o$1.context!==void 0&&(n.context=C(o$1.context,"--context"));let S=await b(rt,{input:n});if(!S.importWorkflowTemplate.success)throw new o(S.importWorkflowTemplate.message??"Import failed.");i("Workflow imported"),h$1(o$1,S.importWorkflowTemplate.workflow??S.importWorkflowTemplate);});}var se=100;function Bt(r){return {headers:["ID","Workflow","Version","Status","Progress","Started","Completed"],rows:r.map(i=>[p$1(i.id,12),i.workflowKey,i.version,i.status,`${Math.round(i.progress)}%`,o$1(i.startedAt),o$1(i.completedAt)])}}async function A(r){let i=await b(at,{id:r});return h(i.workflowRun,"Run",r)}function ae(r){return Mt.some(i=>i===r.toUpperCase())}async function de(r,i,t,e,o$1){if(e===0)return [];let n=[],s=new Set,d=0,f=0;for(;n.length<e;){let m=(await b(F,{input:{workflowKey:i,status:t,limit:se,offset:d}})).workflowRuns;if(m.items.length===0){if(m.hasMore)throw new o("Run listing returned an empty page before the end.");break}for(let D of m.items)if(!(D.workflowId!==r||s.has(D.id))){if(s.add(D.id),f<o$1){f++;continue}if(n.push(D),n.length===e)break}if(d+=m.items.length,!m.hasMore)break}return n}function le(r,i,t){let e=t.filter(d=>d.nodeId===i);if(e.length===0)throw new o(`Node ${i} not found in run ${r} (NOT_FOUND)`);let o$1=e.filter(d=>["FAILED","TIMEOUT"].includes(d.status.toUpperCase()));if(o$1.length===0)throw new o(`Node ${i} is not failed in run ${r} (INVALID_STATE)`);let[n,...s]=o$1;if(!n||s.length>0)throw new o(`Node ${i} is ambiguous in run ${r}; retry a specific node state.`);return n}function ue(r){return new Promise(i=>setTimeout(i,r))}function Ht(r){let i$1=r.command("runs").description("FluidGrids workflow runs");i$1.command("list").description("List workflow runs").option("-l, --limit <n>","Page size","20").option("-o, --offset <n>","Offset","0").option("-s, --status <status>",`Filter by status (${j.join("|")})`).option("--workflow-key <key>","Filter by workflow key").option("--workflow-id <id>","Filter by exact workflow definition ID (scans all pages)").option("-f, --format <format>","Output format (json, table, yaml)").action(async t=>{let e=p(t.limit,"--limit"),o$1=p(t.offset,"--offset"),n=w(t.status,"--status",j);if(t.workflowId&&t.workflowKey)throw new o("Use either --workflow-id or --workflow-key, not both.");if(t.workflowId){let f=await b(v,{id:t.workflowId}),S=h(f.workflowDefinition,"Workflow",t.workflowId),m=await de(t.workflowId,S.workflowKey,n,e,o$1);h$1(t,m,Bt(m));return}let s={limit:e,offset:o$1};n&&(s.status=n),t.workflowKey&&(s.workflowKey=t.workflowKey);let d=await b(F,{input:s});h$1(t,d.workflowRuns.items,Bt(d.workflowRuns.items));}),i$1.command("get").description("Get a run (with node states)").argument("<id>","Run ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{h$1(e,await A(t));}),i$1.command("cancel").description("Cancel a run").argument("<id>","Run ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o=await b(lt,{id:t});i(`Run ${t}: ${o.cancelWorkflowRun.status}`),h$1(e,o.cancelWorkflowRun);}),i$1.command("pause").description("Pause a run").argument("<id>","Run ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o=await b(ut,{id:t});i(`Run ${t}: ${o.pauseWorkflowRun.status}`),h$1(e,o.pauseWorkflowRun);}),i$1.command("resume").description("Resume a paused or waiting run").argument("<id>","Run ID").option("--payload <json>","JSON object delivered to the waiting node").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o$1=e.payload===void 0?void 0:C(e.payload,"--payload"),n=await b(ct,{id:t,payload:o$1});if(!n.resumeWorkflowRun.success)throw new o(n.resumeWorkflowRun.message);h$1(e,n.resumeWorkflowRun);}),i$1.command("wait").description("Poll a run until it reaches a terminal status").argument("<id>","Run ID").option("--timeout <ms>","Give up after this many milliseconds","300000").option("--poll-interval <ms>","Delay between polls in milliseconds","1000").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o$1=p(e.timeout,"--timeout"),n=p(e.pollInterval,"--poll-interval"),s=Date.now(),d=await A(t);for(;!ae(d.status);){if(Date.now()-s>o$1)throw new o(`Timed out waiting for run ${t} (last status ${d.status}).`);await ue(n),d=await A(t);}h$1(e,d);}),i$1.command("logs").description("Get run logs (one cursor page)").argument("<id>","Run ID").option("--level <level>",`Minimum level (${K.join("|")})`).option("--node-id <id>","Only this graph node").option("--search <text>","Only lines containing this text").option("--include-child-runs","Include sub-workflow runs").option("--limit <n>","Page size, 1 to 1000").option("--after <cursor>","Continue after a nextCursor from an earlier page").option("--page-info","Print the whole page (lines + cursor) instead of only lines").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o$2=w(e.level,"--level",K),n=e.limit===void 0?void 0:p(e.limit,"--limit");if(n!==void 0&&(n<1||n>1e3))throw new o(`Invalid value '${e.limit}' for --limit: expected 1 to 1000.`);if(e.after!==void 0&&!e.after.trim())throw new o("--after cursor cannot be empty.");let d=(await b(dt,{runId:t,nodeId:e.nodeId,minLevel:o$2,limit:n,after:e.after,search:e.search,includeChildRuns:e.includeChildRuns})).workflowRunLogs;if(e.pageInfo){h$1(e,d);return}h$1(e,d.lines,{headers:["Time","Level","Node","Message"],rows:d.lines.map(f=>[o$1(f.timestamp),f.level,f.nodeId??"-",p$1(f.message,100)])});}),i$1.command("retry-node").description("Retry one failed node of a run (run ID + graph node ID)").argument("<runId>","Run ID").argument("<nodeId>","Graph node ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e,o)=>{let n=await A(t),s=le(t,e,n.nodeStates??[]),d=await b(pt,{id:s.id,nodeId:e});i(`Node ${e} retry: ${d.retryNode.status}`),h$1(o,d.retryNode);});}function qt(r){let i=r.command("nodes").description("FluidGrids node catalogue");i.command("list").description("List node endpoint configurations").option("-l, --limit <n>","Page size","20").option("-o, --offset <n>","Offset","0").option("-t, --node-type <type>","Filter by node type").option("--publish-type <type>",`Filter by publish type (${P.join("|")})`).option("--status <status>",`Filter by status (${J.join("|")})`).option("-f, --format <format>","Output format (json, table, yaml)").action(async t=>{let o=(await b(mt,{nodeType:t.nodeType,publishType:w(t.publishType,"--publish-type",P),status:w(t.status,"--status",J),pagination:{limit:p(t.limit,"--limit"),offset:p(t.offset,"--offset")}})).nodeEndpointConfigs.configs;h$1(t,o,{headers:["Type","Version","Name","Category","Publish","Status","Latest"],rows:o.map(n=>[n.nodeType,n.nodeVersion,n.name,n.category??"-",n.publishType,n.status,n.isLatest?"yes":"no"])});}),i.command("get").description("Get a node endpoint configuration by type and version").argument("<nodeType>","Node type").argument("<nodeVersion>","Node version").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e,o)=>{let n=await b(gt,{nodeType:t,nodeVersion:e});h$1(o,h(n.nodeEndpointConfig,"Node",`${t}@${e}`));});}var fe=/^[A-Za-z_][A-Za-z0-9_]*$/;async function me(r,i=process.stdin,t=process.stderr){if(!i.isTTY)throw new o("A terminal is required to prompt for a secret.");let e=new Writable({write(n,s,d){d();}}),o$1=createInterface({input:i,output:e,terminal:true});t.write(`${r}: `);try{return await new Promise(n=>{o$1.question("",n);})}finally{o$1.close(),t.write(`
401
- `);}}async function Yt(r,i,t,e=process.env,o$1=me){if(r!==void 0){if(!fe.test(r))throw new o(`Invalid environment variable name for ${t}.`);let s=e[r];if(!s?.trim())throw new o(`The environment variable selected by ${t} is empty or unset.`);return s}if(!process.stdin.isTTY)throw new o(`An interactive terminal or ${t} is required to supply ${i}.`);let n=await o$1(i);if(!n.trim())throw new o(`${i} cannot be empty.`);return n}async function zt(r,i,t){try{let o=(await b(r,{input:t}))[i];if(o===void 0)throw new Error("empty response");return o}catch{throw new o("Connection authentication failed; verify the connection and secret.")}}function Zt(r){let i$1=r.command("credentials").description("FluidGrids credentials (integration connections)");i$1.command("list").description("List credentials").option("-l, --limit <n>","Page size","20").option("-o, --offset <n>","Offset","0").option("-p, --provider-id <id>","Filter by provider ID").option("-s, --status <status>",`Filter by status (${G.join("|")})`).option("--search <text>","Filter by name").option("-f, --format <format>","Output format (json, table, yaml)").action(async t=>{let e={};t.providerId&&(e.providerId=t.providerId);let o=w(t.status,"--status",G);o&&(e.status=o),t.search&&(e.search=t.search);let s=(await b(wt,{filter:Object.keys(e).length>0?e:void 0,pagination:{limit:p(t.limit,"--limit"),offset:p(t.offset,"--offset")}})).getConnections.items;h$1(t,s,{headers:["ID","Name","Provider","Status","Last used"],rows:s.map(d=>[p$1(d.id,12),d.name,d.provider?.key??d.providerId,d.status,o$1(d.lastUsedAt)])});}),i$1.command("get").description("Get a credential").argument("<id>","Credential (connection) ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o=await b(yt,{id:t});h$1(e,h(o.getConnection,"Credential",t));}),i$1.command("types").description("List the credential types (integration providers) you can create").option("-l, --limit <n>","Page size","50").option("-o, --offset <n>","Offset","0").option("--search <text>","Filter by name").option("-f, --format <format>","Output format (json, table, yaml)").action(async t=>{let e=await b(kt,{filter:t.search?{search:t.search}:void 0,pagination:{limit:p(t.limit,"--limit"),offset:p(t.offset,"--offset")}}),o=e.getProviders.items;h$1(t,e.getProviders,{headers:["ID","Key","Name","Category","Auth","Enabled"],rows:o.map(n=>[p$1(n.id,12),n.key,n.name,n.category,n.authType,n.isEnabled?"yes":"no"])});}),i$1.command("create").description("Create a credential shell from a CreateConnectionInput JSON file (no secrets; attach one with auth-api-key / auth-basic)").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o=k(t),n=await b(ht,{input:o});i(`Credential created: ${n.createConnection.id}`),h$1(e,n.createConnection);}),i$1.command("update").description("Update a credential (name, description, config) from a JSON file").argument("<id>","Credential (connection) ID").argument("<file>","Path to the UpdateConnectionInput JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e,o)=>{let n=k(e),s=await b(St,{id:t,input:n});i("Credential updated"),h$1(o,s.updateConnection);}),i$1.command("delete").description("Delete a credential (the vault secret is kept unless --delete-vault-secret)").argument("<id>","Credential (connection) ID").option("--delete-vault-secret","Also delete the backing vault secret").option("--force","Skip the confirmation prompt").action(async(t,e)=>{if(await I(`Delete credential ${t}?`,e.force),!(await b(It,{id:t,deleteVaultSecret:e.deleteVaultSecret?true:void 0})).deleteConnection)throw new o(`Credential ${t} was not deleted.`);i(`Credential ${t} deleted`);}),i$1.command("test").description("Test a credential against its provider").argument("<id>","Credential (connection) ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o=await b(Ot,{connectionId:t});h$1(e,o.testConnection);}),i$1.command("auth-api-key").description("Attach a provider API key to a credential (hidden prompt or named env var)").argument("<id>","Credential (connection) ID").option("--api-key-env <name>","Read the API key from this environment variable").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o=await Yt(e.apiKeyEnv,"API key","--api-key-env"),n=await zt(Rt,"authenticateWithApiKey",{connectionId:t,apiKey:o});i(`Credential ${t}: ${n.status}`),h$1(e,n);}),i$1.command("auth-basic").description("Attach provider basic-auth credentials (hidden prompt or named env var)").argument("<id>","Credential (connection) ID").argument("<username>","Provider username").option("--password-env <name>","Read the password from this environment variable").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e,o$1)=>{if(!e.trim())throw new o("Provider username cannot be empty.");let n=await Yt(o$1.passwordEnv,"Password","--password-env"),s=await zt(bt,"authenticateWithBasicAuth",{connectionId:t,username:e,password:n});i(`Credential ${t}: ${s.status}`),h$1(o$1,s);});}function Qt(r){let i$1=r.command("webhooks").description("FluidGrids inbound webhooks (event registrations)");i$1.command("list").description("List webhooks").option("--workflow-key <key>","Filter by workflow key").option("-s, --status <status>",`Filter by status (${M.join("|")})`).option("-f, --format <format>","Output format (json, table, yaml)").action(async t=>{let e=await b(Tt,{status:w(t.status,"--status",M),workflowKey:t.workflowKey});h$1(t,e.eventRegistrations,{headers:["ID","Name","Workflow","Trigger node","Status","Triggers","Last"],rows:e.eventRegistrations.map(o=>[p$1(o.id,12),o.name??"-",o.workflowKey,o.triggerNodeId,o.isActive?o.status:`${o.status} (inactive)`,String(o.totalTriggers),o$1(o.lastTriggeredAt)])});}),i$1.command("get").description("Get a webhook").argument("<id>","Event registration ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o=await b(Ct,{id:t});h$1(e,h(o.eventRegistration,"Webhook",t));}),i$1.command("create").description("Create a webhook from a CreateEventRegistrationInput JSON file").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o=k(t),n=await b($t,{input:o});i(`Webhook created: ${n.createEventRegistration.id}`),h$1(e,n.createEventRegistration);}),i$1.command("update").description("Update a webhook from an UpdateEventRegistrationInput JSON file").argument("<id>","Event registration ID").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e,o)=>{let n=k(e),s=await b(Dt,{id:t,input:n});i("Webhook updated"),h$1(o,s.updateEventRegistration);}),i$1.command("delete").description("Delete a webhook").argument("<id>","Event registration ID").option("--force","Skip the confirmation prompt").action(async(t,e)=>{if(await I(`Delete webhook ${t}?`,e.force),!(await b(vt,{id:t})).deleteEventRegistration)throw new o(`Webhook ${t} was not deleted.`);i(`Webhook ${t} deleted`);});for(let[t,e]of [["activate",true],["deactivate",false]])i$1.command(t).description(`${e?"Activate":"Deactivate"} a webhook`).argument("<id>","Event registration ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(o,n)=>{let s=await b(Wt,{id:o,isActive:e});i(`Webhook ${o} ${e?"activated":"deactivated"}`),h$1(n,s.toggleEventRegistration);});}function B(r){if(!r.success)throw new o(r.message||"Scheduled job update failed.");return r}function Xt(r){let i$1=r.command("scheduled-jobs").description("FluidGrids scheduled workflow runs (cron)");i$1.command("list").description("List scheduled jobs").option("-l, --limit <n>","Page size","20").option("-o, --offset <n>","Offset","0").option("--workflow-key <key>","Filter by workflow key").option("--enabled","Only enabled jobs").option("--disabled","Only disabled jobs").option("-f, --format <format>","Output format (json, table, yaml)").action(async t=>{if(t.enabled&&t.disabled)throw new o("Use either --enabled or --disabled, not both.");let o$2=(await b(At,{enabled:t.enabled?true:t.disabled?false:void 0,workflowKey:t.workflowKey,pagination:{limit:p(t.limit,"--limit"),offset:p(t.offset,"--offset")}})).workflowScheduledJobs.jobs;h$1(t,o$2,{headers:["ID","Name","Workflow","Version","Schedule","Enabled","Next run"],rows:o$2.map(n=>[p$1(n.id,12),n.name,n.workflowKey,n.version,n.schedule,n.enabled?"yes":"no",o$1(n.nextRun)])});}),i$1.command("get").description("Get a scheduled job").argument("<jobId>","Scheduled job ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o=await b(Nt,{jobId:t});h$1(e,h(o.workflowScheduledJob,"Scheduled job",t));}),i$1.command("create").description("Create a scheduled job from a ScheduledJobInput JSON file").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o=k(t),n=await b(Ft,{input:o}),s=B(n.createWorkflowScheduledJob);i(s.message||"Scheduled job created"),h$1(e,s.job??s);}),i$1.command("update").description("Update a scheduled job from a WorkflowUpdateScheduledJobInput JSON file").argument("<jobId>","Scheduled job ID").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e,o)=>{let n=k(e),s=await b(x,{jobId:t,input:n}),d=B(s.updateWorkflowScheduledJob);i(d.message||"Scheduled job updated"),h$1(o,d.job??d);}),i$1.command("delete").description("Delete a scheduled job").argument("<jobId>","Scheduled job ID").option("--force","Skip the confirmation prompt").action(async(t,e)=>{await I(`Delete scheduled job ${t}?`,e.force);let o$1=await b(Lt,{jobId:t});if(!o$1.deleteWorkflowScheduledJob.success)throw new o(o$1.deleteWorkflowScheduledJob.message||"Delete failed.");i(`Scheduled job ${t} deleted`);});for(let[t,e]of [["pause",false],["resume",true]])i$1.command(t).description(`${e?"Resume":"Pause"} a scheduled job`).argument("<jobId>","Scheduled job ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(o,n)=>{let s=await b(x,{jobId:o,input:{enabled:e}}),d=B(s.updateWorkflowScheduledJob);i(`Scheduled job ${o} ${e?"resumed":"paused"}`),h$1(n,d.job??d);});}function te(r,i){if(Number.isNaN(Date.parse(r)))throw new o(`Invalid value '${r}' for ${i}: expected an ISO 8601 date.`);return r}function ee(r){let i=r.command("dashboard").description("FluidGrids dashboard metrics");i.command("summary").description("Workflow, run and node counters (incl. 24h / 7d / 30d windows)").option("-p, --project <id>","Scope to a project").option("-f, --format <format>","Output format (json, table, yaml)").action(async t=>{let e=await b(_t,{projectId:t.project});h$1(t,e.dashboardSummary);}),i.command("usage").description("Workflow and node execution metrics for a date range").requiredOption("--start <date>","Range start (ISO 8601)").requiredOption("--end <date>","Range end (ISO 8601)").option("-f, --format <format>","Output format (json, table, yaml)").action(async t=>{let e=te(t.start,"--start"),o$1=te(t.end,"--end");if(Date.parse(e)>Date.parse(o$1))throw new o("--start must not be after --end.");let n=await b(xt,{input:{startDate:e,endDate:o$1}});h$1(t,n.usageMetrics);});}function oe(r){r.command("search").description("Search FluidGrids workflows, runs, nodes").command("query").description("Search across FluidGrids entities").argument("<query>","Search text").option("-t, --type <type>",`Restrict to one entity type (${V.join("|")})`).option("-l, --limit <n>","Page size","20").option("-o, --offset <n>","Offset","0").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{if(!t.trim())throw new o("Search text cannot be empty.");let o$1=w(e.type,"--type",V),n=p(e.limit,"--limit"),s=p(e.offset,"--offset"),d=o$1?(await b(Kt,{entityType:o$1,query:t,limit:n,offset:s})).searchByEntityType:(await b(jt,{input:{query:t,limit:n,offset:s}})).search;h$1(e,d);});}function ne(r){r.command("admin").description("FluidGrids administration").command("system-info").description("Deployment information (version, revision, environment) of the workflow service").option("-f, --format <format>","Output format (json, table, yaml)").action(async t=>{let e=await b(Pt);h$1(t,e.systemConfig);});}var ge={id:"fluidgrids",version:"1.0.0",displayName:"FluidGrids",dependsOn:["auth","workspaces"],register(r,i){a(i),Vt(r),Ht(r),qt(r),Zt(r),Qt(r),Xt(r),ee(r),oe(r),ne(r);}},uo=ge;export{uo as default};
400
+ `;function p(r,i){if(!/^\d+$/.test(r))throw new o(`Invalid value '${r}' for ${i}: expected a non-negative integer.`);let t=Number(r);if(!Number.isSafeInteger(t))throw new o(`Invalid value '${r}' for ${i}: expected a non-negative integer.`);return t}function w(r,i,t){if(r===void 0)return;let e=t.find(o=>o===r);if(e===void 0)throw new o(`Invalid value '${r}' for ${i}. Allowed: ${t.join(", ")}`);return e}function C(r,i){let t;try{t=JSON.parse(r);}catch{throw new o(`${i} must be valid JSON.`)}if(!re(t))throw new o(`${i} must be a JSON object.`);return t}function k(r){let i;try{i=readFileSync(r,"utf8");}catch(t){let e=t instanceof Error?t.message:String(t);throw new o(`Cannot read ${r}: ${e}`)}return C(i,r)}function T(r,i){if(r!==void 0){if(!r.trim())throw new o(`${i} cannot be empty.`);return r}}function h(r,i,t){if(r==null)throw new o(`${i} ${t} not found (NOT_FOUND)`);return r}function re(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}function Jt(r,i=[]){return [...i,r]}async function I(r,i){if(!await s(r,i))throw new o("Aborted: nothing was changed.")}var U=["DRAFT","ACTIVE","ARCHIVED","DEPRECATED"],j=["PENDING","RUNNING","WAITING","COMPLETED","FAILED","CANCELLED","TERMINATED"],Mt=["COMPLETED","FAILED","CANCELLED","TERMINATED"],K=["DEBUG","INFO","WARN","ERROR"],P=["BUILTIN","CUSTOM","STORE"],J=["AVAILABLE","DEPRECATED","DISABLED"],M=["ACTIVE","PAUSED","DISABLED","ARCHIVED"],G=["ACTIVE","INACTIVE","PENDING_AUTH","ERROR","EXPIRED","REVOKED"],V=["workflow","run","node","event"];function Gt(r$1){return {headers:["ID","Key","Name","Version","Status","Active","Updated"],rows:r$1.map(i=>[r(i.id,12),i.workflowKey,r(i.name,32),i.version,i.status,i.isActive?"yes":"no",q$1(i.updatedAt)])}}function Vt(r){let i$1=r.command("workflows").description("FluidGrids workflow definitions");i$1.command("list").description("List workflow definitions").option("-l, --limit <n>","Page size","20").option("-o, --offset <n>","Offset","0").option("-s, --status <status>",`Filter by status (${U.join("|")})`).option("--category <category>","Filter by category").option("--tag <tag>","Filter by tag (repeatable)",Jt).option("--latest-only","Only the latest version of each workflow key").option("-f, --format <format>","Output format (json, table, yaml)").action(async e=>{let o={limit:p(e.limit,"--limit"),offset:p(e.offset,"--offset")},n=w(e.status,"--status",U);n&&(o.status=n),e.category&&(o.category=e.category),e.tag?.length&&(o.tags=e.tag),e.latestOnly&&(o.latestOnly=true);let s=await b(q,{input:o});i(e,s.workflowDefinitions.items,Gt(s.workflowDefinitions.items));}),i$1.command("get").description("Get a workflow definition by ID, or by key with --key").argument("[id]","Workflow definition ID").option("--key <workflowKey>","Look up by workflow key instead of ID").option("--wf-version <version>","Version to fetch with --key").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,o$1)=>{if(!e&&!o$1.key)throw new o("Pass a workflow ID or --key <workflowKey>.");if(e&&o$1.key)throw new o("Pass either a workflow ID or --key, not both.");let n=await b(v,e?{id:e}:{workflowKey:o$1.key,version:o$1.wfVersion});i(o$1,h(n.workflowDefinition,"Workflow",e??o$1.key??""));}),i$1.command("versions").description("List every stored version of a workflow key").argument("<workflowKey>","Workflow key").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,o)=>{let n=await b(Y,{workflowKey:e});i(o,n.workflowVersions,Gt(n.workflowVersions));}),i$1.command("create").description("Create a workflow definition from a CreateWorkflowDefinitionInput JSON file").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,o)=>{let n=k(e),s=await b(z,{input:n});k$1(`Workflow created: ${s.createWorkflowDefinition.workflowKey}`),i(o,s.createWorkflowDefinition);}),i$1.command("update").description("Update a workflow definition from an UpdateWorkflowDefinitionInput JSON file").argument("<id>","Workflow definition ID").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,o,n)=>{let s=k(o),d=await b(Z,{id:e,input:s});k$1("Workflow updated"),i(n,d.updateWorkflowDefinition);}),i$1.command("delete").description("Delete a workflow (every version, or one with --wf-version)").argument("<workflowKey>","Workflow key").option("--wf-version <version>","Delete only this version").option("--force","Skip the confirmation prompt").action(async(e,o$1)=>{let n=o$1.wfVersion?`${e}@${o$1.wfVersion}`:`${e} (all versions)`;if(await I(`Delete workflow ${n}?`,o$1.force),!(await b(Q,{workflowKey:e,version:o$1.wfVersion})).deleteWorkflowDefinition)throw new o(`Workflow ${n} was not deleted.`);k$1(`Workflow ${n} deleted`);}),i$1.command("trigger").description("Trigger a workflow run").argument("<workflowKey>","Workflow key").requiredOption("--wf-version <version>","Workflow version").requiredOption("--trigger-node <id>","Trigger node ID").option("-i, --input <json>","Trigger data as a JSON object").option("--stop-at-node <id>","Stop the run after this node").option("--test","Run in TEST mode instead of PRODUCTION").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,o)=>{let n={workflowKey:e,version:T(o.wfVersion,"--wf-version"),triggerNodeId:T(o.triggerNode,"--trigger-node")};o.input!==void 0&&(n.triggerData=C(o.input,"--input")),o.stopAtNode&&(n.stopAtNodeId=o.stopAtNode),o.test&&(n.mode="TEST");let s=await b(X,{input:n});i(o,s.triggerWorkflow);}),i$1.command("duplicate").description("Duplicate a workflow version under a new key").argument("<workflowKey>","Source workflow key").argument("<version>","Source version").requiredOption("--new-key <key>","Workflow key for the copy").option("--new-version <version>","Version for the copy").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,o$1,n)=>{let s={newWorkflowKey:T(n.newKey,"--new-key")};n.newVersion&&(s.newVersion=n.newVersion);let d=await b(nt,{workflowKey:e,version:o$1,input:s});if(!d.duplicateWorkflow.success)throw new o(d.duplicateWorkflow.message??"Duplicate failed.");i(n,d.duplicateWorkflow.workflow??d.duplicateWorkflow);});let t=[["publish","Publish a workflow definition version",tt,"publishWorkflow"],["activate","Make a workflow definition version the active one",et,"activateWorkflowDefinition"],["deactivate","Deactivate a workflow definition version",ot,"deactivateWorkflowDefinition"],["archive","Archive a workflow definition version",it,"archiveWorkflow"]];for(let[e,o$1,n,s]of t)i$1.command(e).description(o$1).argument("<id>","Workflow definition ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(d,f)=>{let m=(await b(n,{id:d}))[s];if(!m)throw new o(`Workflow ${d}: ${e} returned no result.`);k$1(`Workflow ${m.workflowKey}@${m.version}: ${m.status}`),i(f,m);});i$1.command("import").description("Import a workflow from a store template (ImportWorkflowTemplateInput JSON)").argument("<file>","Path to the template input JSON").option("--name <name>","Override the workflow name").option("--description <text>","Override the description").option("--icon <icon>","Override the icon").option("--category <category>","Override the category").option("--project-id <id>","Scope to a project").option("--source-template-id <id>","Source template ID (lineage)").option("--context <json>","Context metadata as a JSON object").option("-f, --format <format>","Output format (json, table, yaml)").action(async(e,o$1)=>{let n={...k(e)},s=T(o$1.name,"--name"),d=T(o$1.projectId,"--project-id"),f=T(o$1.sourceTemplateId,"--source-template-id");s!==void 0&&(n.name=s),o$1.description!==void 0&&(n.description=o$1.description),o$1.icon!==void 0&&(n.icon=o$1.icon),o$1.category!==void 0&&(n.category=o$1.category),d!==void 0&&(n.projectId=d),f!==void 0&&(n.sourceTemplateId=f),o$1.context!==void 0&&(n.context=C(o$1.context,"--context"));let S=await b(rt,{input:n});if(!S.importWorkflowTemplate.success)throw new o(S.importWorkflowTemplate.message??"Import failed.");k$1("Workflow imported"),i(o$1,S.importWorkflowTemplate.workflow??S.importWorkflowTemplate);});}var se=100;function Bt(r$1){return {headers:["ID","Workflow","Version","Status","Progress","Started","Completed"],rows:r$1.map(i=>[r(i.id,12),i.workflowKey,i.version,i.status,`${Math.round(i.progress)}%`,q$1(i.startedAt),q$1(i.completedAt)])}}async function A(r){let i=await b(at,{id:r});return h(i.workflowRun,"Run",r)}function ae(r){return Mt.some(i=>i===r.toUpperCase())}async function de(r,i,t,e,o$1){if(e===0)return [];let n=[],s=new Set,d=0,f=0;for(;n.length<e;){let m=(await b(F,{input:{workflowKey:i,status:t,limit:se,offset:d}})).workflowRuns;if(m.items.length===0){if(m.hasMore)throw new o("Run listing returned an empty page before the end.");break}for(let D of m.items)if(!(D.workflowId!==r||s.has(D.id))){if(s.add(D.id),f<o$1){f++;continue}if(n.push(D),n.length===e)break}if(d+=m.items.length,!m.hasMore)break}return n}function le(r,i,t){let e=t.filter(d=>d.nodeId===i);if(e.length===0)throw new o(`Node ${i} not found in run ${r} (NOT_FOUND)`);let o$1=e.filter(d=>["FAILED","TIMEOUT"].includes(d.status.toUpperCase()));if(o$1.length===0)throw new o(`Node ${i} is not failed in run ${r} (INVALID_STATE)`);let[n,...s]=o$1;if(!n||s.length>0)throw new o(`Node ${i} is ambiguous in run ${r}; retry a specific node state.`);return n}function ue(r){return new Promise(i=>setTimeout(i,r))}function Ht(r$1){let i$1=r$1.command("runs").description("FluidGrids workflow runs");i$1.command("list").description("List workflow runs").option("-l, --limit <n>","Page size","20").option("-o, --offset <n>","Offset","0").option("-s, --status <status>",`Filter by status (${j.join("|")})`).option("--workflow-key <key>","Filter by workflow key").option("--workflow-id <id>","Filter by exact workflow definition ID (scans all pages)").option("-f, --format <format>","Output format (json, table, yaml)").action(async t=>{let e=p(t.limit,"--limit"),o$1=p(t.offset,"--offset"),n=w(t.status,"--status",j);if(t.workflowId&&t.workflowKey)throw new o("Use either --workflow-id or --workflow-key, not both.");if(t.workflowId){let f=await b(v,{id:t.workflowId}),S=h(f.workflowDefinition,"Workflow",t.workflowId),m=await de(t.workflowId,S.workflowKey,n,e,o$1);i(t,m,Bt(m));return}let s={limit:e,offset:o$1};n&&(s.status=n),t.workflowKey&&(s.workflowKey=t.workflowKey);let d=await b(F,{input:s});i(t,d.workflowRuns.items,Bt(d.workflowRuns.items));}),i$1.command("get").description("Get a run (with node states)").argument("<id>","Run ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{i(e,await A(t));}),i$1.command("cancel").description("Cancel a run").argument("<id>","Run ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o=await b(lt,{id:t});k$1(`Run ${t}: ${o.cancelWorkflowRun.status}`),i(e,o.cancelWorkflowRun);}),i$1.command("pause").description("Pause a run").argument("<id>","Run ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o=await b(ut,{id:t});k$1(`Run ${t}: ${o.pauseWorkflowRun.status}`),i(e,o.pauseWorkflowRun);}),i$1.command("resume").description("Resume a paused or waiting run").argument("<id>","Run ID").option("--payload <json>","JSON object delivered to the waiting node").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o$1=e.payload===void 0?void 0:C(e.payload,"--payload"),n=await b(ct,{id:t,payload:o$1});if(!n.resumeWorkflowRun.success)throw new o(n.resumeWorkflowRun.message);i(e,n.resumeWorkflowRun);}),i$1.command("wait").description("Poll a run until it reaches a terminal status").argument("<id>","Run ID").option("--timeout <ms>","Give up after this many milliseconds","300000").option("--poll-interval <ms>","Delay between polls in milliseconds","1000").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o$1=p(e.timeout,"--timeout"),n=p(e.pollInterval,"--poll-interval"),s=Date.now(),d=await A(t);for(;!ae(d.status);){if(Date.now()-s>o$1)throw new o(`Timed out waiting for run ${t} (last status ${d.status}).`);await ue(n),d=await A(t);}i(e,d);}),i$1.command("logs").description("Get run logs (one cursor page)").argument("<id>","Run ID").option("--level <level>",`Minimum level (${K.join("|")})`).option("--node-id <id>","Only this graph node").option("--search <text>","Only lines containing this text").option("--include-child-runs","Include sub-workflow runs").option("--limit <n>","Page size, 1 to 1000").option("--after <cursor>","Continue after a nextCursor from an earlier page").option("--page-info","Print the whole page (lines + cursor) instead of only lines").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o$1=w(e.level,"--level",K),n=e.limit===void 0?void 0:p(e.limit,"--limit");if(n!==void 0&&(n<1||n>1e3))throw new o(`Invalid value '${e.limit}' for --limit: expected 1 to 1000.`);if(e.after!==void 0&&!e.after.trim())throw new o("--after cursor cannot be empty.");let d=(await b(dt,{runId:t,nodeId:e.nodeId,minLevel:o$1,limit:n,after:e.after,search:e.search,includeChildRuns:e.includeChildRuns})).workflowRunLogs;if(e.pageInfo){i(e,d);return}i(e,d.lines,{headers:["Time","Level","Node","Message"],rows:d.lines.map(f=>[q$1(f.timestamp),f.level,f.nodeId??"-",r(f.message,100)])});}),i$1.command("retry-node").description("Retry one failed node of a run (run ID + graph node ID)").argument("<runId>","Run ID").argument("<nodeId>","Graph node ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e,o)=>{let n=await A(t),s=le(t,e,n.nodeStates??[]),d=await b(pt,{id:s.id,nodeId:e});k$1(`Node ${e} retry: ${d.retryNode.status}`),i(o,d.retryNode);});}function qt(r){let i$1=r.command("nodes").description("FluidGrids node catalogue");i$1.command("list").description("List node endpoint configurations").option("-l, --limit <n>","Page size","20").option("-o, --offset <n>","Offset","0").option("-t, --node-type <type>","Filter by node type").option("--publish-type <type>",`Filter by publish type (${P.join("|")})`).option("--status <status>",`Filter by status (${J.join("|")})`).option("-f, --format <format>","Output format (json, table, yaml)").action(async t=>{let o=(await b(mt,{nodeType:t.nodeType,publishType:w(t.publishType,"--publish-type",P),status:w(t.status,"--status",J),pagination:{limit:p(t.limit,"--limit"),offset:p(t.offset,"--offset")}})).nodeEndpointConfigs.configs;i(t,o,{headers:["Type","Version","Name","Category","Publish","Status","Latest"],rows:o.map(n=>[n.nodeType,n.nodeVersion,n.name,n.category??"-",n.publishType,n.status,n.isLatest?"yes":"no"])});}),i$1.command("get").description("Get a node endpoint configuration by type and version").argument("<nodeType>","Node type").argument("<nodeVersion>","Node version").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e,o)=>{let n=await b(gt,{nodeType:t,nodeVersion:e});i(o,h(n.nodeEndpointConfig,"Node",`${t}@${e}`));});}var fe=/^[A-Za-z_][A-Za-z0-9_]*$/;async function me(r,i=process.stdin,t=process.stderr){if(!i.isTTY)throw new o("A terminal is required to prompt for a secret.");let e=new Writable({write(n,s,d){d();}}),o$1=createInterface({input:i,output:e,terminal:true});t.write(`${r}: `);try{return await new Promise(n=>{o$1.question("",n);})}finally{o$1.close(),t.write(`
401
+ `);}}async function Yt(r,i,t,e=process.env,o$1=me){if(r!==void 0){if(!fe.test(r))throw new o(`Invalid environment variable name for ${t}.`);let s=e[r];if(!s?.trim())throw new o(`The environment variable selected by ${t} is empty or unset.`);return s}if(!process.stdin.isTTY)throw new o(`An interactive terminal or ${t} is required to supply ${i}.`);let n=await o$1(i);if(!n.trim())throw new o(`${i} cannot be empty.`);return n}async function zt(r,i,t){try{let o=(await b(r,{input:t}))[i];if(o===void 0)throw new Error("empty response");return o}catch{throw new o("Connection authentication failed; verify the connection and secret.")}}function Zt(r$1){let i$1=r$1.command("credentials").description("FluidGrids credentials (integration connections)");i$1.command("list").description("List credentials").option("-l, --limit <n>","Page size","20").option("-o, --offset <n>","Offset","0").option("-p, --provider-id <id>","Filter by provider ID").option("-s, --status <status>",`Filter by status (${G.join("|")})`).option("--search <text>","Filter by name").option("-f, --format <format>","Output format (json, table, yaml)").action(async t=>{let e={};t.providerId&&(e.providerId=t.providerId);let o=w(t.status,"--status",G);o&&(e.status=o),t.search&&(e.search=t.search);let s=(await b(wt,{filter:Object.keys(e).length>0?e:void 0,pagination:{limit:p(t.limit,"--limit"),offset:p(t.offset,"--offset")}})).getConnections.items;i(t,s,{headers:["ID","Name","Provider","Status","Last used"],rows:s.map(d=>[r(d.id,12),d.name,d.provider?.key??d.providerId,d.status,q$1(d.lastUsedAt)])});}),i$1.command("get").description("Get a credential").argument("<id>","Credential (connection) ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o=await b(yt,{id:t});i(e,h(o.getConnection,"Credential",t));}),i$1.command("types").description("List the credential types (integration providers) you can create").option("-l, --limit <n>","Page size","50").option("-o, --offset <n>","Offset","0").option("--search <text>","Filter by name").option("-f, --format <format>","Output format (json, table, yaml)").action(async t=>{let e=await b(kt,{filter:t.search?{search:t.search}:void 0,pagination:{limit:p(t.limit,"--limit"),offset:p(t.offset,"--offset")}}),o=e.getProviders.items;i(t,e.getProviders,{headers:["ID","Key","Name","Category","Auth","Enabled"],rows:o.map(n=>[r(n.id,12),n.key,n.name,n.category,n.authType,n.isEnabled?"yes":"no"])});}),i$1.command("create").description("Create a credential shell from a CreateConnectionInput JSON file (no secrets; attach one with auth-api-key / auth-basic)").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o=k(t),n=await b(ht,{input:o});k$1(`Credential created: ${n.createConnection.id}`),i(e,n.createConnection);}),i$1.command("update").description("Update a credential (name, description, config) from a JSON file").argument("<id>","Credential (connection) ID").argument("<file>","Path to the UpdateConnectionInput JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e,o)=>{let n=k(e),s=await b(St,{id:t,input:n});k$1("Credential updated"),i(o,s.updateConnection);}),i$1.command("delete").description("Delete a credential (the vault secret is kept unless --delete-vault-secret)").argument("<id>","Credential (connection) ID").option("--delete-vault-secret","Also delete the backing vault secret").option("--force","Skip the confirmation prompt").action(async(t,e)=>{if(await I(`Delete credential ${t}?`,e.force),!(await b(It,{id:t,deleteVaultSecret:e.deleteVaultSecret?true:void 0})).deleteConnection)throw new o(`Credential ${t} was not deleted.`);k$1(`Credential ${t} deleted`);}),i$1.command("test").description("Test a credential against its provider").argument("<id>","Credential (connection) ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o=await b(Ot,{connectionId:t});i(e,o.testConnection);}),i$1.command("auth-api-key").description("Attach a provider API key to a credential (hidden prompt or named env var)").argument("<id>","Credential (connection) ID").option("--api-key-env <name>","Read the API key from this environment variable").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o=await Yt(e.apiKeyEnv,"API key","--api-key-env"),n=await zt(Rt,"authenticateWithApiKey",{connectionId:t,apiKey:o});k$1(`Credential ${t}: ${n.status}`),i(e,n);}),i$1.command("auth-basic").description("Attach provider basic-auth credentials (hidden prompt or named env var)").argument("<id>","Credential (connection) ID").argument("<username>","Provider username").option("--password-env <name>","Read the password from this environment variable").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e,o$1)=>{if(!e.trim())throw new o("Provider username cannot be empty.");let n=await Yt(o$1.passwordEnv,"Password","--password-env"),s=await zt(bt,"authenticateWithBasicAuth",{connectionId:t,username:e,password:n});k$1(`Credential ${t}: ${s.status}`),i(o$1,s);});}function Qt(r$1){let i$1=r$1.command("webhooks").description("FluidGrids inbound webhooks (event registrations)");i$1.command("list").description("List webhooks").option("--workflow-key <key>","Filter by workflow key").option("-s, --status <status>",`Filter by status (${M.join("|")})`).option("-f, --format <format>","Output format (json, table, yaml)").action(async t=>{let e=await b(Tt,{status:w(t.status,"--status",M),workflowKey:t.workflowKey});i(t,e.eventRegistrations,{headers:["ID","Name","Workflow","Trigger node","Status","Triggers","Last"],rows:e.eventRegistrations.map(o=>[r(o.id,12),o.name??"-",o.workflowKey,o.triggerNodeId,o.isActive?o.status:`${o.status} (inactive)`,String(o.totalTriggers),q$1(o.lastTriggeredAt)])});}),i$1.command("get").description("Get a webhook").argument("<id>","Event registration ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o=await b(Ct,{id:t});i(e,h(o.eventRegistration,"Webhook",t));}),i$1.command("create").description("Create a webhook from a CreateEventRegistrationInput JSON file").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o=k(t),n=await b($t,{input:o});k$1(`Webhook created: ${n.createEventRegistration.id}`),i(e,n.createEventRegistration);}),i$1.command("update").description("Update a webhook from an UpdateEventRegistrationInput JSON file").argument("<id>","Event registration ID").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e,o)=>{let n=k(e),s=await b(Dt,{id:t,input:n});k$1("Webhook updated"),i(o,s.updateEventRegistration);}),i$1.command("delete").description("Delete a webhook").argument("<id>","Event registration ID").option("--force","Skip the confirmation prompt").action(async(t,e)=>{if(await I(`Delete webhook ${t}?`,e.force),!(await b(vt,{id:t})).deleteEventRegistration)throw new o(`Webhook ${t} was not deleted.`);k$1(`Webhook ${t} deleted`);});for(let[t,e]of [["activate",true],["deactivate",false]])i$1.command(t).description(`${e?"Activate":"Deactivate"} a webhook`).argument("<id>","Event registration ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(o,n)=>{let s=await b(Wt,{id:o,isActive:e});k$1(`Webhook ${o} ${e?"activated":"deactivated"}`),i(n,s.toggleEventRegistration);});}function B(r){if(!r.success)throw new o(r.message||"Scheduled job update failed.");return r}function Xt(r$1){let i$1=r$1.command("scheduled-jobs").description("FluidGrids scheduled workflow runs (cron)");i$1.command("list").description("List scheduled jobs").option("-l, --limit <n>","Page size","20").option("-o, --offset <n>","Offset","0").option("--workflow-key <key>","Filter by workflow key").option("--enabled","Only enabled jobs").option("--disabled","Only disabled jobs").option("-f, --format <format>","Output format (json, table, yaml)").action(async t=>{if(t.enabled&&t.disabled)throw new o("Use either --enabled or --disabled, not both.");let o$1=(await b(At,{enabled:t.enabled?true:t.disabled?false:void 0,workflowKey:t.workflowKey,pagination:{limit:p(t.limit,"--limit"),offset:p(t.offset,"--offset")}})).workflowScheduledJobs.jobs;i(t,o$1,{headers:["ID","Name","Workflow","Version","Schedule","Enabled","Next run"],rows:o$1.map(n=>[r(n.id,12),n.name,n.workflowKey,n.version,n.schedule,n.enabled?"yes":"no",q$1(n.nextRun)])});}),i$1.command("get").description("Get a scheduled job").argument("<jobId>","Scheduled job ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o=await b(Nt,{jobId:t});i(e,h(o.workflowScheduledJob,"Scheduled job",t));}),i$1.command("create").description("Create a scheduled job from a ScheduledJobInput JSON file").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{let o=k(t),n=await b(Ft,{input:o}),s=B(n.createWorkflowScheduledJob);k$1(s.message||"Scheduled job created"),i(e,s.job??s);}),i$1.command("update").description("Update a scheduled job from a WorkflowUpdateScheduledJobInput JSON file").argument("<jobId>","Scheduled job ID").argument("<file>","Path to the input JSON").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e,o)=>{let n=k(e),s=await b(x,{jobId:t,input:n}),d=B(s.updateWorkflowScheduledJob);k$1(d.message||"Scheduled job updated"),i(o,d.job??d);}),i$1.command("delete").description("Delete a scheduled job").argument("<jobId>","Scheduled job ID").option("--force","Skip the confirmation prompt").action(async(t,e)=>{await I(`Delete scheduled job ${t}?`,e.force);let o$1=await b(Lt,{jobId:t});if(!o$1.deleteWorkflowScheduledJob.success)throw new o(o$1.deleteWorkflowScheduledJob.message||"Delete failed.");k$1(`Scheduled job ${t} deleted`);});for(let[t,e]of [["pause",false],["resume",true]])i$1.command(t).description(`${e?"Resume":"Pause"} a scheduled job`).argument("<jobId>","Scheduled job ID").option("-f, --format <format>","Output format (json, table, yaml)").action(async(o,n)=>{let s=await b(x,{jobId:o,input:{enabled:e}}),d=B(s.updateWorkflowScheduledJob);k$1(`Scheduled job ${o} ${e?"resumed":"paused"}`),i(n,d.job??d);});}function te(r,i){if(Number.isNaN(Date.parse(r)))throw new o(`Invalid value '${r}' for ${i}: expected an ISO 8601 date.`);return r}function ee(r){let i$1=r.command("dashboard").description("FluidGrids dashboard metrics");i$1.command("summary").description("Workflow, run and node counters (incl. 24h / 7d / 30d windows)").option("-p, --project <id>","Scope to a project").option("-f, --format <format>","Output format (json, table, yaml)").action(async t=>{let e=await b(_t,{projectId:t.project});i(t,e.dashboardSummary);}),i$1.command("usage").description("Workflow and node execution metrics for a date range").requiredOption("--start <date>","Range start (ISO 8601)").requiredOption("--end <date>","Range end (ISO 8601)").option("-f, --format <format>","Output format (json, table, yaml)").action(async t=>{let e=te(t.start,"--start"),o$1=te(t.end,"--end");if(Date.parse(e)>Date.parse(o$1))throw new o("--start must not be after --end.");let n=await b(xt,{input:{startDate:e,endDate:o$1}});i(t,n.usageMetrics);});}function oe(r){r.command("search").description("Search FluidGrids workflows, runs, nodes").command("query").description("Search across FluidGrids entities").argument("<query>","Search text").option("-t, --type <type>",`Restrict to one entity type (${V.join("|")})`).option("-l, --limit <n>","Page size","20").option("-o, --offset <n>","Offset","0").option("-f, --format <format>","Output format (json, table, yaml)").action(async(t,e)=>{if(!t.trim())throw new o("Search text cannot be empty.");let o$1=w(e.type,"--type",V),n=p(e.limit,"--limit"),s=p(e.offset,"--offset"),d=o$1?(await b(Kt,{entityType:o$1,query:t,limit:n,offset:s})).searchByEntityType:(await b(jt,{input:{query:t,limit:n,offset:s}})).search;i(e,d);});}function ne(r){r.command("admin").description("FluidGrids administration").command("system-info").description("Deployment information (version, revision, environment) of the workflow service").option("-f, --format <format>","Output format (json, table, yaml)").action(async t=>{let e=await b(Pt);i(t,e.systemConfig);});}var ge={id:"fluidgrids",version:"1.0.0",displayName:"FluidGrids",dependsOn:["auth","workspaces"],register(r,i){a(i),Vt(r),Ht(r),qt(r),Zt(r),Qt(r),Xt(r),ee(r),oe(r),ne(r);}},uo=ge;export{uo as default};