@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.
- package/dist/chunk-O6UCQ5IT.js +1 -0
- package/dist/{chunk-AYNNSLCL.js → chunk-ZGT7IIOP.js} +409 -418
- package/dist/modules/adaptercloud/index.cjs +9 -6
- package/dist/modules/adaptercloud/index.js +7 -4
- package/dist/modules/artistrybase/index.js +2 -2
- package/dist/modules/assethandler/index.cjs +2 -2
- package/dist/modules/assethandler/index.js +2 -2
- package/dist/modules/atheletebridge/index.cjs +35 -21
- package/dist/modules/atheletebridge/index.js +33 -19
- package/dist/modules/auth/index.cjs +37 -37
- package/dist/modules/auth/index.js +33 -29
- package/dist/modules/billing/index.cjs +1 -1
- package/dist/modules/billing/index.js +2 -2
- package/dist/modules/brainyrich/index.cjs +44 -28
- package/dist/modules/brainyrich/index.js +47 -31
- package/dist/modules/buildmyiq/index.cjs +64 -67
- package/dist/modules/buildmyiq/index.js +60 -63
- package/dist/modules/channels/index.cjs +3 -3
- package/dist/modules/channels/index.js +2 -2
- package/dist/modules/collabkin/index.cjs +4 -4
- package/dist/modules/collabkin/index.js +2 -2
- package/dist/modules/comradecircle/index.cjs +24 -16
- package/dist/modules/comradecircle/index.js +20 -12
- package/dist/modules/conversations/index.cjs +7 -7
- package/dist/modules/conversations/index.js +2 -2
- package/dist/modules/coolandlovely/index.cjs +28 -15
- package/dist/modules/coolandlovely/index.js +30 -17
- package/dist/modules/cosmicintersection/index.cjs +6 -6
- package/dist/modules/cosmicintersection/index.js +2 -2
- package/dist/modules/crewfoundry/index.js +2 -2
- package/dist/modules/devportal/index.cjs +2 -2
- package/dist/modules/devportal/index.js +2 -2
- package/dist/modules/ecoimpacthub/index.cjs +23 -13
- package/dist/modules/ecoimpacthub/index.js +20 -10
- package/dist/modules/eventfullymanaged/index.cjs +74 -74
- package/dist/modules/eventfullymanaged/index.js +78 -78
- package/dist/modules/export/index.cjs +4 -4
- package/dist/modules/export/index.js +2 -2
- package/dist/modules/files/index.cjs +3 -3
- package/dist/modules/files/index.js +4 -4
- package/dist/modules/fluidgrids/index.cjs +16 -16
- package/dist/modules/fluidgrids/index.js +3 -3
- package/dist/modules/ggnomad/index.cjs +4 -4
- package/dist/modules/ggnomad/index.js +2 -2
- package/dist/modules/govcitizenhub/index.cjs +10 -7
- package/dist/modules/govcitizenhub/index.js +8 -5
- package/dist/modules/groups/index.cjs +4 -4
- package/dist/modules/groups/index.js +2 -2
- package/dist/modules/headshotmarketing/index.js +2 -2
- package/dist/modules/hookmovies/index.cjs +6 -6
- package/dist/modules/hookmovies/index.js +2 -2
- package/dist/modules/housingvista/index.cjs +3 -3
- package/dist/modules/housingvista/index.js +2 -2
- package/dist/modules/integrations/index.cjs +5 -5
- package/dist/modules/integrations/index.js +2 -2
- package/dist/modules/intelwatchtower/index.cjs +28 -16
- package/dist/modules/intelwatchtower/index.js +25 -13
- package/dist/modules/kadaikodi/index.cjs +2 -2
- package/dist/modules/kadaikodi/index.js +2 -2
- package/dist/modules/labsofscience/index.cjs +10 -6
- package/dist/modules/labsofscience/index.js +9 -5
- package/dist/modules/manufacturedops/index.cjs +35 -22
- package/dist/modules/manufacturedops/index.js +35 -22
- package/dist/modules/movethewheels/index.js +2 -2
- package/dist/modules/notifications/index.cjs +2 -2
- package/dist/modules/notifications/index.js +2 -2
- package/dist/modules/organizations/index.js +2 -2
- package/dist/modules/planmagnet/index.cjs +21 -21
- package/dist/modules/planmagnet/index.js +32 -32
- package/dist/modules/products/index.cjs +4 -4
- package/dist/modules/products/index.js +2 -2
- package/dist/modules/proserviceworld/index.cjs +18 -13
- package/dist/modules/proserviceworld/index.js +18 -13
- package/dist/modules/rbac/index.js +2 -2
- package/dist/modules/sandbox/index.cjs +17 -17
- package/dist/modules/sandbox/index.js +1 -1
- package/dist/modules/scheduler/index.cjs +2 -2
- package/dist/modules/scheduler/index.js +2 -2
- package/dist/modules/security/index.cjs +3 -3
- package/dist/modules/security/index.js +2 -2
- package/dist/modules/semanticfed/index.cjs +3 -3
- package/dist/modules/semanticfed/index.js +2 -2
- package/dist/modules/store/index.cjs +3 -3
- package/dist/modules/store/index.js +2 -2
- package/dist/modules/subscriberbot/index.cjs +43 -19
- package/dist/modules/subscriberbot/index.js +47 -23
- package/dist/modules/support/index.cjs +2 -2
- package/dist/modules/support/index.js +2 -2
- package/dist/modules/tags/index.js +2 -2
- package/dist/modules/technospam/index.cjs +18 -9
- package/dist/modules/technospam/index.js +18 -9
- package/dist/modules/theculturepost/index.cjs +27 -22
- package/dist/modules/theculturepost/index.js +32 -27
- package/dist/modules/theglobalfuel/index.cjs +65 -60
- package/dist/modules/theglobalfuel/index.js +65 -60
- package/dist/modules/timecampus/index.js +2 -2
- package/dist/modules/tours/index.cjs +2 -2
- package/dist/modules/tours/index.js +2 -2
- package/dist/modules/vibecontrols/index.cjs +563 -567
- package/dist/modules/vibecontrols/index.js +5 -4
- package/dist/modules/workspaces/index.cjs +4 -4
- package/dist/modules/workspaces/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-W4JZR7RJ.js +0 -1
|
@@ -50,8 +50,11 @@
|
|
|
50
50
|
`,P=`
|
|
51
51
|
query SubListPlans($providerId: ID) {
|
|
52
52
|
subListPlans(providerId: $providerId) {
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
items {
|
|
54
|
+
id providerId name description amount currency interval features isActive createdAt
|
|
55
|
+
updatedAt workspaceId
|
|
56
|
+
}
|
|
57
|
+
pageInfo { cursor hasMore }
|
|
55
58
|
}
|
|
56
59
|
}
|
|
57
60
|
`,D=`
|
|
@@ -125,16 +128,21 @@
|
|
|
125
128
|
`,W=`
|
|
126
129
|
query SubListRenewalEvents($relationshipId: ID, $upcomingOnly: Boolean) {
|
|
127
130
|
subListRenewalEvents(relationshipId: $relationshipId, upcomingOnly: $upcomingOnly) {
|
|
128
|
-
|
|
129
|
-
|
|
131
|
+
items {
|
|
132
|
+
id relationshipId eventType detail amount currency occursAt notified createdAt
|
|
133
|
+
updatedAt workspaceId
|
|
134
|
+
}
|
|
135
|
+
pageInfo { cursor hasMore }
|
|
130
136
|
}
|
|
131
137
|
}
|
|
132
138
|
`,F=`
|
|
133
139
|
query SubListAssets($relationshipId: ID!) {
|
|
134
140
|
subListAssets(relationshipId: $relationshipId) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
141
|
+
items {
|
|
142
|
+
id relationshipId name type secretRef expiresAt createdAt updatedAt workspaceId
|
|
143
|
+
file { id }
|
|
144
|
+
}
|
|
145
|
+
pageInfo { cursor hasMore }
|
|
138
146
|
}
|
|
139
147
|
}
|
|
140
148
|
`,G=`
|
|
@@ -147,8 +155,11 @@
|
|
|
147
155
|
`,H=`
|
|
148
156
|
query SubListEntitlements($relationshipId: ID!) {
|
|
149
157
|
subListEntitlements(relationshipId: $relationshipId) {
|
|
150
|
-
|
|
151
|
-
|
|
158
|
+
items {
|
|
159
|
+
id relationshipId name description type quota unit used isActive createdAt updatedAt
|
|
160
|
+
workspaceId
|
|
161
|
+
}
|
|
162
|
+
pageInfo { cursor hasMore }
|
|
152
163
|
}
|
|
153
164
|
}
|
|
154
165
|
`,V=`
|
|
@@ -188,8 +199,11 @@
|
|
|
188
199
|
`,K=`
|
|
189
200
|
query SubListPaymentInstruments($ownerId: ID) {
|
|
190
201
|
subListPaymentInstruments(ownerId: $ownerId) {
|
|
191
|
-
|
|
192
|
-
|
|
202
|
+
items {
|
|
203
|
+
id ownerId label type status brand last4 expiryMonth expiryYear isDefault createdAt
|
|
204
|
+
updatedAt workspaceId
|
|
205
|
+
}
|
|
206
|
+
pageInfo { cursor hasMore }
|
|
193
207
|
}
|
|
194
208
|
}
|
|
195
209
|
`,z=`
|
|
@@ -206,8 +220,11 @@
|
|
|
206
220
|
`,Q=`
|
|
207
221
|
query SubListChannels($ownerId: ID) {
|
|
208
222
|
subListChannels(ownerId: $ownerId) {
|
|
209
|
-
|
|
210
|
-
|
|
223
|
+
items {
|
|
224
|
+
id ownerId type address label status ingestEnabled verifiedAt createdAt updatedAt
|
|
225
|
+
workspaceId
|
|
226
|
+
}
|
|
227
|
+
pageInfo { cursor hasMore }
|
|
211
228
|
}
|
|
212
229
|
}
|
|
213
230
|
`,X=`
|
|
@@ -270,7 +287,8 @@
|
|
|
270
287
|
`,it=`
|
|
271
288
|
query SubListAgents($kind: SubAgentKind, $ownerId: ID, $status: SubAgentStatus) {
|
|
272
289
|
subListAgents(kind: $kind, ownerId: $ownerId, status: $status) {
|
|
273
|
-
id ownerId name description kind status lastRunAt createdAt
|
|
290
|
+
items { id ownerId name description kind status lastRunAt createdAt }
|
|
291
|
+
pageInfo { cursor hasMore }
|
|
274
292
|
}
|
|
275
293
|
}
|
|
276
294
|
`,ot=`
|
|
@@ -288,8 +306,11 @@
|
|
|
288
306
|
`,at=`
|
|
289
307
|
query SubListPolicies($agentId: ID) {
|
|
290
308
|
subListPolicies(agentId: $agentId) {
|
|
291
|
-
|
|
292
|
-
|
|
309
|
+
items {
|
|
310
|
+
id agentId name description action condition isEnabled triggerCount lastTriggeredAt
|
|
311
|
+
createdAt updatedAt workspaceId
|
|
312
|
+
}
|
|
313
|
+
pageInfo { cursor hasMore }
|
|
293
314
|
}
|
|
294
315
|
}
|
|
295
316
|
`,ut=`
|
|
@@ -302,8 +323,11 @@
|
|
|
302
323
|
`,ct=`
|
|
303
324
|
query SubListWorkflows($status: SubWorkflowStatus) {
|
|
304
325
|
subListWorkflows(status: $status) {
|
|
305
|
-
|
|
306
|
-
|
|
326
|
+
items {
|
|
327
|
+
id name description triggerEvent status runCount lastRunAt createdAt updatedAt
|
|
328
|
+
workspaceId
|
|
329
|
+
}
|
|
330
|
+
pageInfo { cursor hasMore }
|
|
307
331
|
}
|
|
308
332
|
}
|
|
309
333
|
`,dt=`
|
|
@@ -322,4 +346,4 @@
|
|
|
322
346
|
query SubHealth {
|
|
323
347
|
subHealth
|
|
324
348
|
}
|
|
325
|
-
`;function y(i,r){try{return JSON.parse(r)}catch{throw new l(`--${i} must be valid JSON`)}}function p(i){let r=Number.parseInt(i,10);if(Number.isNaN(r))throw new l(`Expected an integer but got "${i}"`);return r}function f(i){let r=Number.parseFloat(i);if(Number.isNaN(r))throw new l(`Expected a number but got "${i}"`);return r}function b(i){return i.split(",").map(r=>r.trim()).filter(r=>r.length>0)}function mt(i){let r=i.command("providers").description("SubscriberBot provider registry (vendors / publishers / services)");r.command("list").description("List / search providers in the registry").option("--category <c>","Filter by provider category").option("--status <s>","Filter by provider status").option("--search <q>","Free-text search").option("--limit <n>","Page size",p,50).option("--offset <n>","Offset",p,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(x,{category:t.category?t.category.toUpperCase():void 0,status:t.status?t.status.toUpperCase():void 0,search:t.search,pagination:{limit:t.limit,offset:t.offset}});s(t,e.subListProviders.items,{headers:["ID","Name","Category","Status","Region","Churn"],rows:e.subListProviders.items.map(n=>[c(n.id,12),n.name,n.category,n.status,n.region??"-",n.churnRiskScore!=null?String(n.churnRiskScore):"-"])});}catch(e){o(e);}}),r.command("get").description("Get a provider by id").argument("<id>","Provider ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(R,{id:t});if(!n.subProvider)throw new l(`Provider ${t} not found`);s(e,n.subProvider);}catch(n){o(n);}}),r.command("create").description("Create a provider").requiredOption("--name <name>","Provider name").option("--category <c>","Provider category","OTHER").option("--status <s>","Provider status","UNVERIFIED").option("--slug <slug>","URL slug").option("--description <s>","Description").option("--industry <s>","Industry").option("--language <s>","Language").option("--region <s>","Region").option("--website-url <url>","Website URL").option("--logo-file-id <id>","Logo file ID").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name,category:(t.category??"OTHER").toUpperCase(),status:(t.status??"UNVERIFIED").toUpperCase()};t.slug&&(e.slug=t.slug),t.description&&(e.description=t.description),t.industry&&(e.industry=t.industry),t.language&&(e.language=t.language),t.region&&(e.region=t.region),t.websiteUrl&&(e.websiteUrl=t.websiteUrl),t.logoFileId&&(e.logoFileId=t.logoFileId),t.tags&&(e.tags=b(t.tags));let n=await a(T,{input:e});u(`Provider created: ${n.subCreateProvider.name}`),s(t,n.subCreateProvider);}catch(e){o(e);}}),r.command("update").description("Update a provider").argument("<id>","Provider ID").option("--name <name>","Provider name").option("--category <c>","Provider category").option("--status <s>","Provider status").option("--slug <slug>","URL slug").option("--description <s>","Description").option("--industry <s>","Industry").option("--language <s>","Language").option("--region <s>","Region").option("--website-url <url>","Website URL").option("--logo-file-id <id>","Logo file ID").option("--churn-risk-score <n>","Churn risk score",p).option("--vendor-health-score <n>","Vendor health score",p).option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.name&&(n.name=e.name),e.category&&(n.category=e.category.toUpperCase()),e.status&&(n.status=e.status.toUpperCase()),e.slug&&(n.slug=e.slug),e.description!==void 0&&(n.description=e.description),e.industry&&(n.industry=e.industry),e.language&&(n.language=e.language),e.region&&(n.region=e.region),e.websiteUrl&&(n.websiteUrl=e.websiteUrl),e.logoFileId&&(n.logoFileId=e.logoFileId),e.churnRiskScore!==void 0&&(n.churnRiskScore=e.churnRiskScore),e.vendorHealthScore!==void 0&&(n.vendorHealthScore=e.vendorHealthScore),e.tags&&(n.tags=b(e.tags)),!Object.keys(n).length)throw new l("No updates specified");let C=await a(O,{id:t,input:n});u("Provider updated"),s(e,C.subUpdateProvider);}catch(n){o(n);}}),r.command("archive").description("Archive (soft-delete) a provider").argument("<id>","Provider ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(L,{id:t});u(`Provider ${t} archived`),s(e,{archived:n.subArchiveProvider});}catch(n){o(n);}});}function gt(i){let r=i.command("plans").description("SubscriberBot provider plans");r.command("list").description("List plans (optionally filtered by provider)").option("--provider <id>","Filter by provider ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(P,{providerId:t.provider});s(t,e.subListPlans,{headers:["ID","Name","Amount","Currency","Interval","Active"],rows:e.subListPlans.map(n=>[c(n.id,12),n.name,String(n.amount),n.currency,n.interval,n.isActive?"yes":"no"])});}catch(e){o(e);}}),r.command("create").description("Create a plan for a provider").requiredOption("--provider <id>","Provider ID").requiredOption("--name <name>","Plan name").option("--amount <n>","Amount",f).option("--currency <c>","Currency code").option("--interval <i>","Billing interval","MONTHLY").option("--description <s>","Description").option("--features <csv>","Comma-separated feature list").option("-f, --format <format>","Output format").action(async t=>{try{let e={providerId:t.provider,name:t.name,interval:(t.interval??"MONTHLY").toUpperCase()};t.amount!==void 0&&(e.amount=t.amount),t.currency&&(e.currency=t.currency),t.description&&(e.description=t.description),t.features&&(e.features=b(t.features));let n=await a(D,{input:e});u(`Plan created: ${n.subCreatePlan.name}`),s(t,n.subCreatePlan);}catch(e){o(e);}});}function ft(i){let r=i.command("relationships").description("SubscriberBot subscriptions, memberships & recurring relationships");r.command("list").description("List relationships").option("--kind <k>","Filter by relationship kind").option("--owner <id>","Filter by owner ID").option("--provider <id>","Filter by provider ID").option("--status <s>","Filter by relationship status").option("--limit <n>","Page size",p,50).option("--offset <n>","Offset",p,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(N,{kind:t.kind?t.kind.toUpperCase():void 0,ownerId:t.owner,providerId:t.provider,status:t.status?t.status.toUpperCase():void 0,pagination:{limit:t.limit,offset:t.offset}});s(t,e.subListRelationships.items,{headers:["ID","Label","Kind","Status","Amount","Renews"],rows:e.subListRelationships.items.map(n=>[c(n.id,12),n.label,n.kind,n.status,`${n.amount} ${n.currency}`,g(n.renewsAt)])});}catch(e){o(e);}}),r.command("get").description("Get a relationship by id").argument("<id>","Relationship ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a($,{id:t});if(!n.subRelationship)throw new l(`Relationship ${t} not found`);s(e,n.subRelationship);}catch(n){o(n);}}),r.command("create").description("Create a relationship (subscription / membership / \u2026)").requiredOption("--label <label>","Human-readable label").option("--kind <k>","Relationship kind","SUBSCRIPTION").option("--status <s>","Relationship status","ACTIVE").option("--owner <id>","Owner ID").option("--provider <id>","Provider ID").option("--plan <id>","Plan ID").option("--amount <n>","Amount",f).option("--currency <c>","Currency code").option("--interval <i>","Billing interval","MONTHLY").option("--discovery-source <s>","Discovery source","MANUAL").option("--no-auto-renew","Disable auto-renew").option("--notes <s>","Notes").option("--tags <csv>","Comma-separated tags").option("--started-at <iso>","Started at (ISO date)").option("--renews-at <iso>","Renews at (ISO date)").option("--trial-ends-at <iso>","Trial end (ISO date)").option("-f, --format <format>","Output format").action(async t=>{try{let e={label:t.label,kind:(t.kind??"SUBSCRIPTION").toUpperCase(),status:(t.status??"ACTIVE").toUpperCase(),interval:(t.interval??"MONTHLY").toUpperCase(),discoverySource:(t.discoverySource??"MANUAL").toUpperCase(),autoRenew:t.autoRenew!==!1};t.owner&&(e.ownerId=t.owner),t.provider&&(e.providerId=t.provider),t.plan&&(e.planId=t.plan),t.amount!==void 0&&(e.amount=t.amount),t.currency&&(e.currency=t.currency),t.notes&&(e.notes=t.notes),t.tags&&(e.tags=b(t.tags)),t.startedAt&&(e.startedAt=t.startedAt),t.renewsAt&&(e.renewsAt=t.renewsAt),t.trialEndsAt&&(e.trialEndsAt=t.trialEndsAt);let n=await a(_,{input:e});u(`Relationship created: ${n.subCreateRelationship.label}`),s(t,n.subCreateRelationship);}catch(e){o(e);}}),r.command("update").description("Update a relationship").argument("<id>","Relationship ID").option("--label <label>","Label").option("--kind <k>","Relationship kind").option("--provider <id>","Provider ID").option("--plan <id>","Plan ID").option("--amount <n>","Amount",f).option("--currency <c>","Currency code").option("--interval <i>","Billing interval").option("--auto-renew <bool>","true|false",t=>t==="true").option("--health-score <n>","Health score",p).option("--notes <s>","Notes").option("--tags <csv>","Comma-separated tags").option("--started-at <iso>","Started at (ISO date)").option("--renews-at <iso>","Renews at (ISO date)").option("--trial-ends-at <iso>","Trial end (ISO date)").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.label&&(n.label=e.label),e.kind&&(n.kind=e.kind.toUpperCase()),e.provider&&(n.providerId=e.provider),e.plan&&(n.planId=e.plan),e.amount!==void 0&&(n.amount=e.amount),e.currency&&(n.currency=e.currency),e.interval&&(n.interval=e.interval.toUpperCase()),e.autoRenew!==void 0&&(n.autoRenew=e.autoRenew),e.healthScore!==void 0&&(n.healthScore=e.healthScore),e.notes!==void 0&&(n.notes=e.notes),e.tags&&(n.tags=b(e.tags)),e.startedAt&&(n.startedAt=e.startedAt),e.renewsAt&&(n.renewsAt=e.renewsAt),e.trialEndsAt&&(n.trialEndsAt=e.trialEndsAt),!Object.keys(n).length)throw new l("No updates specified");let C=await a(q,{id:t,input:n});u("Relationship updated"),s(e,C.subUpdateRelationship);}catch(n){o(n);}}),r.command("cancel").description("Cancel a relationship").argument("<id>","Relationship ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(M,{id:t});u(`Relationship cancelled: ${n.subCancelRelationship.label}`),s(e,n.subCancelRelationship);}catch(n){o(n);}}),r.command("transition").description("Advance a relationship through its lifecycle").argument("<id>","Relationship ID").requiredOption("--status <s>","ACTIVE|TRIAL|PAST_DUE|PAUSED|CANCELLED|EXPIRED|LAPSED").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(U,{id:t,status:e.status.toUpperCase()});u(`Relationship status set to ${n.subTransitionRelationship.status}`),s(e,n.subTransitionRelationship);}catch(n){o(n);}}),r.command("renewals").description("List renewal events").option("--relationship <id>","Filter by relationship ID").option("--upcoming-only","Only upcoming events").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(W,{relationshipId:t.relationship,upcomingOnly:t.upcomingOnly?!0:void 0});s(t,e.subListRenewalEvents,{headers:["ID","Relationship","Type","Amount","Occurs","Notified"],rows:e.subListRenewalEvents.map(n=>[c(n.id,12),c(n.relationshipId,12),n.eventType,n.amount!=null?`${n.amount} ${n.currency??""}`.trim():"-",g(n.occursAt),n.notified?"yes":"no"])});}catch(e){o(e);}});}function bt(i){let r=i.command("assets").description("SubscriberBot relationship assets (contracts, licenses, credentials, \u2026)");r.command("list").description("List assets for a relationship").requiredOption("--relationship <id>","Relationship ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(F,{relationshipId:t.relationship});s(t,e.subListAssets,{headers:["ID","Name","Type","Secret","Expires"],rows:e.subListAssets.map(n=>[c(n.id,12),n.name,n.type,n.secretRef?"yes":"no",g(n.expiresAt)])});}catch(e){o(e);}}),r.command("create").description("Create an asset on a relationship").requiredOption("--relationship <id>","Relationship ID").requiredOption("--name <name>","Asset name").option("--type <t>","Asset type","RECEIPT").option("--file-id <id>","Referenced file ID (blob lives in wspace-files-svc)").option("--secret-ref <ref>","Secret reference").option("--expires-at <iso>","Expiry (ISO date)").option("-f, --format <format>","Output format").action(async t=>{try{let e={relationshipId:t.relationship,name:t.name,type:(t.type??"RECEIPT").toUpperCase()};t.fileId&&(e.fileId=t.fileId),t.secretRef&&(e.secretRef=t.secretRef),t.expiresAt&&(e.expiresAt=t.expiresAt);let n=await a(G,{input:e});u(`Asset created: ${n.subCreateAsset.name}`),s(t,n.subCreateAsset);}catch(e){o(e);}});}function It(i){let r=i.command("entitlements").description("SubscriberBot relationship entitlements (seats, quotas, features, \u2026)");r.command("list").description("List entitlements for a relationship").requiredOption("--relationship <id>","Relationship ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(H,{relationshipId:t.relationship});s(t,e.subListEntitlements,{headers:["ID","Name","Type","Used","Quota","Active"],rows:e.subListEntitlements.map(n=>[c(n.id,12),n.name,n.type,String(n.used),n.quota!=null?String(n.quota):"-",n.isActive?"yes":"no"])});}catch(e){o(e);}}),r.command("create").description("Create an entitlement on a relationship").requiredOption("--relationship <id>","Relationship ID").requiredOption("--name <name>","Entitlement name").option("--type <t>","Entitlement type","FEATURE_ACCESS").option("--description <s>","Description").option("--quota <n>","Quota",p).option("--unit <u>","Quota unit").option("-f, --format <format>","Output format").action(async t=>{try{let e={relationshipId:t.relationship,name:t.name,type:(t.type??"FEATURE_ACCESS").toUpperCase()};t.description&&(e.description=t.description),t.quota!==void 0&&(e.quota=t.quota),t.unit&&(e.unit=t.unit);let n=await a(V,{input:e});u(`Entitlement created: ${n.subCreateEntitlement.name}`),s(t,n.subCreateEntitlement);}catch(e){o(e);}});}function ht(i){let r=i.command("invoices").description("SubscriberBot invoices");r.command("list").description("List invoices").option("--relationship <id>","Filter by relationship ID").option("--status <s>","Filter by invoice status").option("--limit <n>","Page size",p,50).option("--offset <n>","Offset",p,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(j,{relationshipId:t.relationship,status:t.status?t.status.toUpperCase():void 0,pagination:{limit:t.limit,offset:t.offset}});s(t,e.subListInvoices.items,{headers:["ID","Number","Status","Total","Currency","Due"],rows:e.subListInvoices.items.map(n=>[c(n.id,12),n.number??"-",n.status,String(n.total),n.currency,g(n.dueDate)])});}catch(e){o(e);}}),r.command("create").description("Create an invoice on a relationship").requiredOption("--relationship <id>","Relationship ID").option("--number <n>","Invoice number").option("--status <s>","Invoice status","ISSUED").option("--currency <c>","Currency code").option("--subtotal <n>","Subtotal",f).option("--tax-amount <n>","Tax amount",f).option("--total <n>","Total",f).option("--line-items <json>","Line items JSON").option("--issue-date <iso>","Issue date (ISO date)").option("--due-date <iso>","Due date (ISO date)").option("--payment-instrument <id>","Payment instrument ID").option("--file-id <id>","Referenced file ID (invoice PDF in wspace-files-svc)").option("-f, --format <format>","Output format").action(async t=>{try{let e={relationshipId:t.relationship,status:(t.status??"ISSUED").toUpperCase()};t.number&&(e.number=t.number),t.currency&&(e.currency=t.currency),t.subtotal!==void 0&&(e.subtotal=t.subtotal),t.taxAmount!==void 0&&(e.taxAmount=t.taxAmount),t.total!==void 0&&(e.total=t.total),t.lineItems&&(e.lineItems=y("line-items",t.lineItems)),t.issueDate&&(e.issueDate=t.issueDate),t.dueDate&&(e.dueDate=t.dueDate),t.paymentInstrument&&(e.paymentInstrumentId=t.paymentInstrument),t.fileId&&(e.fileId=t.fileId);let n=await a(B,{input:e});u(`Invoice created: ${n.subCreateInvoice.number??n.subCreateInvoice.id}`),s(t,n.subCreateInvoice);}catch(e){o(e);}}),r.command("mark-paid").description("Mark an invoice as paid").argument("<id>","Invoice ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(Y,{id:t});u(`Invoice marked paid: ${n.subMarkInvoicePaid.number??n.subMarkInvoicePaid.id}`),s(e,n.subMarkInvoicePaid);}catch(n){o(n);}});}function yt(i){let r=i.command("payment-instruments").description("SubscriberBot payment instruments (cards, wallets, bank accounts, \u2026)");r.command("list").description("List payment instruments").option("--owner <id>","Filter by owner ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(K,{ownerId:t.owner});s(t,e.subListPaymentInstruments,{headers:["ID","Label","Type","Status","Brand","Last4","Default"],rows:e.subListPaymentInstruments.map(n=>[c(n.id,12),n.label,n.type,n.status,n.brand??"-",n.last4??"-",n.isDefault?"yes":"no"])});}catch(e){o(e);}}),r.command("create").description("Add a payment instrument").requiredOption("--label <label>","Label").option("--type <t>","Payment instrument type","CARD").option("--owner <id>","Owner ID").option("--brand <b>","Card/instrument brand").option("--last4 <n>","Last 4 digits").option("--expiry-month <n>","Expiry month",p).option("--expiry-year <n>","Expiry year",p).option("--processor-token <t>","Processor token").option("--default","Mark as default").option("-f, --format <format>","Output format").action(async t=>{try{let e={label:t.label,type:(t.type??"CARD").toUpperCase(),isDefault:t.default===!0};t.owner&&(e.ownerId=t.owner),t.brand&&(e.brand=t.brand),t.last4&&(e.last4=t.last4),t.expiryMonth!==void 0&&(e.expiryMonth=t.expiryMonth),t.expiryYear!==void 0&&(e.expiryYear=t.expiryYear),t.processorToken&&(e.processorToken=t.processorToken);let n=await a(z,{input:e});u(`Payment instrument added: ${n.subCreatePaymentInstrument.label}`),s(t,n.subCreatePaymentInstrument);}catch(e){o(e);}}),r.command("remove").description("Remove a payment instrument").argument("<id>","Payment instrument ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(J,{id:t});u(`Payment instrument ${t} removed`),s(e,{removed:n.subRemovePaymentInstrument});}catch(n){o(n);}});}function wt(i){let r=i.command("channels").description("SubscriberBot communication channels (email, sms, slack, webhook, \u2026)");r.command("list").description("List communication channels").option("--owner <id>","Filter by owner ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(Q,{ownerId:t.owner});s(t,e.subListChannels,{headers:["ID","Type","Address","Label","Status","Ingest"],rows:e.subListChannels.map(n=>[c(n.id,12),n.type,n.address,n.label??"-",n.status,n.ingestEnabled?"yes":"no"])});}catch(e){o(e);}}),r.command("create").description("Create a communication channel").requiredOption("--address <addr>","Channel address (email, phone, webhook URL, \u2026)").option("--type <t>","Channel type","EMAIL").option("--owner <id>","Owner ID").option("--label <label>","Label").option("--no-ingest","Disable message ingestion").option("-f, --format <format>","Output format").action(async t=>{try{let e={address:t.address,type:(t.type??"EMAIL").toUpperCase(),ingestEnabled:t.ingest!==!1};t.owner&&(e.ownerId=t.owner),t.label&&(e.label=t.label);let n=await a(X,{input:e});u(`Channel created: ${n.subCreateChannel.address}`),s(t,n.subCreateChannel);}catch(e){o(e);}}),r.command("verify").description("Mark a channel as verified").argument("<id>","Channel ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(Z,{id:t});u(`Channel verified: ${n.subVerifyChannel.address}`),s(e,n.subVerifyChannel);}catch(n){o(n);}});}function Ct(i){let r=i.command("inbox").description("SubscriberBot universal inbox (merged subscription communications)");r.command("list").description("List inbox messages").option("--category <c>","Filter by message category").option("--channel <id>","Filter by channel ID").option("--relationship <id>","Filter by relationship ID").option("--unread-only","Only unread messages").option("--limit <n>","Page size",p,50).option("--offset <n>","Offset",p,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(tt,{category:t.category?t.category.toUpperCase():void 0,channelId:t.channel,relationshipId:t.relationship,unreadOnly:t.unreadOnly?!0:void 0,pagination:{limit:t.limit,offset:t.offset}});s(t,e.subListInboxMessages.items,{headers:["ID","Subject","Category","Read","Action","Received"],rows:e.subListInboxMessages.items.map(n=>[c(n.id,12),c(n.subject??"-",30),n.category,n.isRead?"yes":"no",n.actionRequired?"yes":"no",g(n.receivedAt)])});}catch(e){o(e);}}),r.command("ingest").description("Ingest a message into the universal inbox").requiredOption("--channel <id>","Channel ID").requiredOption("--received-at <iso>","Received at (ISO date)").option("--category <c>","Message category","OTHER").option("--relationship <id>","Relationship ID").option("--subject <s>","Subject").option("--preview <s>","Preview text").option("--external-id <id>","External message ID").option("--category-confidence <n>","Category confidence (0-100)",p).option("--action-required","Flag as action required").option("-f, --format <format>","Output format").action(async t=>{try{let e={channelId:t.channel,receivedAt:t.receivedAt,category:(t.category??"OTHER").toUpperCase(),actionRequired:t.actionRequired===!0};t.relationship&&(e.relationshipId=t.relationship),t.subject&&(e.subject=t.subject),t.preview&&(e.preview=t.preview),t.externalId&&(e.externalId=t.externalId),t.categoryConfidence!==void 0&&(e.categoryConfidence=t.categoryConfidence);let n=await a(et,{input:e});u(`Message ingested: ${n.subIngestMessage.id}`),s(t,n.subIngestMessage);}catch(e){o(e);}}),r.command("mark-read").description("Mark a message as read").argument("<id>","Message ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(nt,{id:t});u(`Message ${t} marked read`),s(e,n.subMarkMessageRead);}catch(n){o(n);}});}function At(i){let r=i.command("agents").description("SubscriberBot AI agents & their automation policies");r.command("list").description("List AI agents").option("--kind <k>","Filter by agent kind").option("--owner <id>","Filter by owner ID").option("--status <s>","Filter by agent status").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(it,{kind:t.kind?t.kind.toUpperCase():void 0,ownerId:t.owner,status:t.status?t.status.toUpperCase():void 0});s(t,e.subListAgents,{headers:["ID","Name","Kind","Status","Description"],rows:e.subListAgents.map(n=>[c(n.id,12),n.name,n.kind,n.status,c(n.description??"-",30)])});}catch(e){o(e);}}),r.command("get").description("Get an agent by id").argument("<id>","Agent ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(rt,{id:t});if(!n.subAgent)throw new l(`Agent ${t} not found`);s(e,n.subAgent);}catch(n){o(n);}}),r.command("create").description("Create an AI agent").requiredOption("--name <name>","Agent name").option("--kind <k>","Agent kind","DISCOVERY").option("--status <s>","Agent status","SUGGEST_ONLY").option("--owner <id>","Owner ID").option("--description <s>","Description").option("--config <json>","Agent config JSON").option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name,kind:(t.kind??"DISCOVERY").toUpperCase(),status:(t.status??"SUGGEST_ONLY").toUpperCase()};t.owner&&(e.ownerId=t.owner),t.description&&(e.description=t.description),t.config&&(e.config=y("config",t.config));let n=await a(ot,{input:e});u(`Agent created: ${n.subCreateAgent.name}`),s(t,n.subCreateAgent);}catch(e){o(e);}}),r.command("set-status").description("Change an agent's operating posture").argument("<id>","Agent ID").requiredOption("--status <s>","DISABLED|SUGGEST_ONLY|AUTONOMOUS").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(st,{id:t,status:e.status.toUpperCase()});u(`Agent status set to ${n.subSetAgentStatus.status}`),s(e,n.subSetAgentStatus);}catch(n){o(n);}}),r.command("list-policies").description("List policies (optionally filtered by agent)").option("--agent <id>","Filter by agent ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(at,{agentId:t.agent});s(t,e.subListPolicies,{headers:["ID","Name","Action","Enabled","Triggers"],rows:e.subListPolicies.map(n=>[c(n.id,12),n.name,n.action,n.isEnabled?"yes":"no",String(n.triggerCount??0)])});}catch(e){o(e);}}),r.command("create-policy").description("Create an automation policy for an agent").requiredOption("--agent <id>","Agent ID").requiredOption("--name <name>","Policy name").option("--action <a>","Policy action","ALERT").option("--description <s>","Description").option("--condition <json>","Condition JSON").option("--no-enabled","Create disabled").option("-f, --format <format>","Output format").action(async t=>{try{let e={agentId:t.agent,name:t.name,action:(t.action??"ALERT").toUpperCase(),isEnabled:t.enabled!==!1};t.description&&(e.description=t.description),t.condition&&(e.condition=y("condition",t.condition));let n=await a(ut,{input:e});u(`Policy created: ${n.subCreatePolicy.name}`),s(t,n.subCreatePolicy);}catch(e){o(e);}});}function vt(i){let r=i.command("workflows").description("SubscriberBot automation workflows");r.command("list").description("List workflows").option("--status <s>","Filter by workflow status").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(ct,{status:t.status?t.status.toUpperCase():void 0});s(t,e.subListWorkflows,{headers:["ID","Name","Trigger","Status","Runs"],rows:e.subListWorkflows.map(n=>[c(n.id,12),n.name,n.triggerEvent,n.status,String(n.runCount??0)])});}catch(e){o(e);}}),r.command("create").description("Create a workflow").requiredOption("--name <name>","Workflow name").requiredOption("--trigger-event <e>","Trigger event").option("--description <s>","Description").option("--steps <json>","Steps JSON").option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name,triggerEvent:t.triggerEvent};t.description&&(e.description=t.description),t.steps&&(e.steps=y("steps",t.steps));let n=await a(dt,{input:e});u(`Workflow created: ${n.subCreateWorkflow.name}`),s(t,n.subCreateWorkflow);}catch(e){o(e);}}),r.command("activate").description("Activate a workflow").argument("<id>","Workflow ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(pt,{id:t});u(`Workflow activated: ${n.subActivateWorkflow.name}`),s(e,n.subActivateWorkflow);}catch(n){o(n);}});}function Et(i){i.command("health").description("SubscriberBot service health check (public)").option("-f, --format <format>","Output format").action(async r=>{try{let t=await v(lt);u(t.subHealth),s(r,{health:t.subHealth});}catch(t){o(t);}});}var qt={id:"subscriberbot",version:"1.0.0",displayName:"SubscriberBot",dependsOn:["auth","workspaces"],register(i,r){S(r);let t=i.command("subscriberbot").description("SubscriberBot universal subscription & relationship management");mt(t),gt(t),ft(t),bt(t),It(t),ht(t),yt(t),wt(t),Ct(t),At(t),vt(t),Et(t);}},Gn=qt;module.exports=Gn;
|
|
349
|
+
`;function y(i,r){try{return JSON.parse(r)}catch{throw new l(`--${i} must be valid JSON`)}}function p(i){let r=Number.parseInt(i,10);if(Number.isNaN(r))throw new l(`Expected an integer but got "${i}"`);return r}function f(i){let r=Number.parseFloat(i);if(Number.isNaN(r))throw new l(`Expected a number but got "${i}"`);return r}function b(i){return i.split(",").map(r=>r.trim()).filter(r=>r.length>0)}function mt(i){let r=i.command("providers").description("SubscriberBot provider registry (vendors / publishers / services)");r.command("list").description("List / search providers in the registry").option("--category <c>","Filter by provider category").option("--status <s>","Filter by provider status").option("--search <q>","Free-text search").option("--limit <n>","Page size",p,50).option("--offset <n>","Offset",p,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(x,{category:t.category?t.category.toUpperCase():void 0,status:t.status?t.status.toUpperCase():void 0,search:t.search,pagination:{limit:t.limit,offset:t.offset}});s(t,e.subListProviders.items,{headers:["ID","Name","Category","Status","Region","Churn"],rows:e.subListProviders.items.map(n=>[c(n.id,12),n.name,n.category,n.status,n.region??"-",n.churnRiskScore!=null?String(n.churnRiskScore):"-"])});}catch(e){o(e);}}),r.command("get").description("Get a provider by id").argument("<id>","Provider ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(R,{id:t});if(!n.subProvider)throw new l(`Provider ${t} not found`);s(e,n.subProvider);}catch(n){o(n);}}),r.command("create").description("Create a provider").requiredOption("--name <name>","Provider name").option("--category <c>","Provider category","OTHER").option("--status <s>","Provider status","UNVERIFIED").option("--slug <slug>","URL slug").option("--description <s>","Description").option("--industry <s>","Industry").option("--language <s>","Language").option("--region <s>","Region").option("--website-url <url>","Website URL").option("--logo-file-id <id>","Logo file ID").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name,category:(t.category??"OTHER").toUpperCase(),status:(t.status??"UNVERIFIED").toUpperCase()};t.slug&&(e.slug=t.slug),t.description&&(e.description=t.description),t.industry&&(e.industry=t.industry),t.language&&(e.language=t.language),t.region&&(e.region=t.region),t.websiteUrl&&(e.websiteUrl=t.websiteUrl),t.logoFileId&&(e.logoFileId=t.logoFileId),t.tags&&(e.tags=b(t.tags));let n=await a(T,{input:e});u(`Provider created: ${n.subCreateProvider.name}`),s(t,n.subCreateProvider);}catch(e){o(e);}}),r.command("update").description("Update a provider").argument("<id>","Provider ID").option("--name <name>","Provider name").option("--category <c>","Provider category").option("--status <s>","Provider status").option("--slug <slug>","URL slug").option("--description <s>","Description").option("--industry <s>","Industry").option("--language <s>","Language").option("--region <s>","Region").option("--website-url <url>","Website URL").option("--logo-file-id <id>","Logo file ID").option("--churn-risk-score <n>","Churn risk score",p).option("--vendor-health-score <n>","Vendor health score",p).option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.name&&(n.name=e.name),e.category&&(n.category=e.category.toUpperCase()),e.status&&(n.status=e.status.toUpperCase()),e.slug&&(n.slug=e.slug),e.description!==void 0&&(n.description=e.description),e.industry&&(n.industry=e.industry),e.language&&(n.language=e.language),e.region&&(n.region=e.region),e.websiteUrl&&(n.websiteUrl=e.websiteUrl),e.logoFileId&&(n.logoFileId=e.logoFileId),e.churnRiskScore!==void 0&&(n.churnRiskScore=e.churnRiskScore),e.vendorHealthScore!==void 0&&(n.vendorHealthScore=e.vendorHealthScore),e.tags&&(n.tags=b(e.tags)),!Object.keys(n).length)throw new l("No updates specified");let C=await a(O,{id:t,input:n});u("Provider updated"),s(e,C.subUpdateProvider);}catch(n){o(n);}}),r.command("archive").description("Archive (soft-delete) a provider").argument("<id>","Provider ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(L,{id:t});u(`Provider ${t} archived`),s(e,{archived:n.subArchiveProvider});}catch(n){o(n);}});}function gt(i){let r=i.command("plans").description("SubscriberBot provider plans");r.command("list").description("List plans (optionally filtered by provider)").option("--provider <id>","Filter by provider ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(P,{providerId:t.provider});s(t,e.subListPlans.items,{headers:["ID","Name","Amount","Currency","Interval","Active"],rows:e.subListPlans.items.map(n=>[c(n.id,12),n.name,String(n.amount),n.currency,n.interval,n.isActive?"yes":"no"])});}catch(e){o(e);}}),r.command("create").description("Create a plan for a provider").requiredOption("--provider <id>","Provider ID").requiredOption("--name <name>","Plan name").option("--amount <n>","Amount",f).option("--currency <c>","Currency code").option("--interval <i>","Billing interval","MONTHLY").option("--description <s>","Description").option("--features <csv>","Comma-separated feature list").option("-f, --format <format>","Output format").action(async t=>{try{let e={providerId:t.provider,name:t.name,interval:(t.interval??"MONTHLY").toUpperCase()};t.amount!==void 0&&(e.amount=t.amount),t.currency&&(e.currency=t.currency),t.description&&(e.description=t.description),t.features&&(e.features=b(t.features));let n=await a(D,{input:e});u(`Plan created: ${n.subCreatePlan.name}`),s(t,n.subCreatePlan);}catch(e){o(e);}});}function ft(i){let r=i.command("relationships").description("SubscriberBot subscriptions, memberships & recurring relationships");r.command("list").description("List relationships").option("--kind <k>","Filter by relationship kind").option("--owner <id>","Filter by owner ID").option("--provider <id>","Filter by provider ID").option("--status <s>","Filter by relationship status").option("--limit <n>","Page size",p,50).option("--offset <n>","Offset",p,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(N,{kind:t.kind?t.kind.toUpperCase():void 0,ownerId:t.owner,providerId:t.provider,status:t.status?t.status.toUpperCase():void 0,pagination:{limit:t.limit,offset:t.offset}});s(t,e.subListRelationships.items,{headers:["ID","Label","Kind","Status","Amount","Renews"],rows:e.subListRelationships.items.map(n=>[c(n.id,12),n.label,n.kind,n.status,`${n.amount} ${n.currency}`,g(n.renewsAt)])});}catch(e){o(e);}}),r.command("get").description("Get a relationship by id").argument("<id>","Relationship ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a($,{id:t});if(!n.subRelationship)throw new l(`Relationship ${t} not found`);s(e,n.subRelationship);}catch(n){o(n);}}),r.command("create").description("Create a relationship (subscription / membership / \u2026)").requiredOption("--label <label>","Human-readable label").option("--kind <k>","Relationship kind","SUBSCRIPTION").option("--status <s>","Relationship status","ACTIVE").option("--owner <id>","Owner ID").option("--provider <id>","Provider ID").option("--plan <id>","Plan ID").option("--amount <n>","Amount",f).option("--currency <c>","Currency code").option("--interval <i>","Billing interval","MONTHLY").option("--discovery-source <s>","Discovery source","MANUAL").option("--no-auto-renew","Disable auto-renew").option("--notes <s>","Notes").option("--tags <csv>","Comma-separated tags").option("--started-at <iso>","Started at (ISO date)").option("--renews-at <iso>","Renews at (ISO date)").option("--trial-ends-at <iso>","Trial end (ISO date)").option("-f, --format <format>","Output format").action(async t=>{try{let e={label:t.label,kind:(t.kind??"SUBSCRIPTION").toUpperCase(),status:(t.status??"ACTIVE").toUpperCase(),interval:(t.interval??"MONTHLY").toUpperCase(),discoverySource:(t.discoverySource??"MANUAL").toUpperCase(),autoRenew:t.autoRenew!==!1};t.owner&&(e.ownerId=t.owner),t.provider&&(e.providerId=t.provider),t.plan&&(e.planId=t.plan),t.amount!==void 0&&(e.amount=t.amount),t.currency&&(e.currency=t.currency),t.notes&&(e.notes=t.notes),t.tags&&(e.tags=b(t.tags)),t.startedAt&&(e.startedAt=t.startedAt),t.renewsAt&&(e.renewsAt=t.renewsAt),t.trialEndsAt&&(e.trialEndsAt=t.trialEndsAt);let n=await a(_,{input:e});u(`Relationship created: ${n.subCreateRelationship.label}`),s(t,n.subCreateRelationship);}catch(e){o(e);}}),r.command("update").description("Update a relationship").argument("<id>","Relationship ID").option("--label <label>","Label").option("--kind <k>","Relationship kind").option("--provider <id>","Provider ID").option("--plan <id>","Plan ID").option("--amount <n>","Amount",f).option("--currency <c>","Currency code").option("--interval <i>","Billing interval").option("--auto-renew <bool>","true|false",t=>t==="true").option("--health-score <n>","Health score",p).option("--notes <s>","Notes").option("--tags <csv>","Comma-separated tags").option("--started-at <iso>","Started at (ISO date)").option("--renews-at <iso>","Renews at (ISO date)").option("--trial-ends-at <iso>","Trial end (ISO date)").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.label&&(n.label=e.label),e.kind&&(n.kind=e.kind.toUpperCase()),e.provider&&(n.providerId=e.provider),e.plan&&(n.planId=e.plan),e.amount!==void 0&&(n.amount=e.amount),e.currency&&(n.currency=e.currency),e.interval&&(n.interval=e.interval.toUpperCase()),e.autoRenew!==void 0&&(n.autoRenew=e.autoRenew),e.healthScore!==void 0&&(n.healthScore=e.healthScore),e.notes!==void 0&&(n.notes=e.notes),e.tags&&(n.tags=b(e.tags)),e.startedAt&&(n.startedAt=e.startedAt),e.renewsAt&&(n.renewsAt=e.renewsAt),e.trialEndsAt&&(n.trialEndsAt=e.trialEndsAt),!Object.keys(n).length)throw new l("No updates specified");let C=await a(q,{id:t,input:n});u("Relationship updated"),s(e,C.subUpdateRelationship);}catch(n){o(n);}}),r.command("cancel").description("Cancel a relationship").argument("<id>","Relationship ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(M,{id:t});u(`Relationship cancelled: ${n.subCancelRelationship.label}`),s(e,n.subCancelRelationship);}catch(n){o(n);}}),r.command("transition").description("Advance a relationship through its lifecycle").argument("<id>","Relationship ID").requiredOption("--status <s>","ACTIVE|TRIAL|PAST_DUE|PAUSED|CANCELLED|EXPIRED|LAPSED").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(U,{id:t,status:e.status.toUpperCase()});u(`Relationship status set to ${n.subTransitionRelationship.status}`),s(e,n.subTransitionRelationship);}catch(n){o(n);}}),r.command("renewals").description("List renewal events").option("--relationship <id>","Filter by relationship ID").option("--upcoming-only","Only upcoming events").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(W,{relationshipId:t.relationship,upcomingOnly:t.upcomingOnly?!0:void 0});s(t,e.subListRenewalEvents.items,{headers:["ID","Relationship","Type","Amount","Occurs","Notified"],rows:e.subListRenewalEvents.items.map(n=>[c(n.id,12),c(n.relationshipId,12),n.eventType,n.amount!=null?`${n.amount} ${n.currency??""}`.trim():"-",g(n.occursAt),n.notified?"yes":"no"])});}catch(e){o(e);}});}function bt(i){let r=i.command("assets").description("SubscriberBot relationship assets (contracts, licenses, credentials, \u2026)");r.command("list").description("List assets for a relationship").requiredOption("--relationship <id>","Relationship ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(F,{relationshipId:t.relationship});s(t,e.subListAssets.items,{headers:["ID","Name","Type","Secret","Expires"],rows:e.subListAssets.items.map(n=>[c(n.id,12),n.name,n.type,n.secretRef?"yes":"no",g(n.expiresAt)])});}catch(e){o(e);}}),r.command("create").description("Create an asset on a relationship").requiredOption("--relationship <id>","Relationship ID").requiredOption("--name <name>","Asset name").option("--type <t>","Asset type","RECEIPT").option("--file-id <id>","Referenced file ID (blob lives in wspace-files-svc)").option("--secret-ref <ref>","Secret reference").option("--expires-at <iso>","Expiry (ISO date)").option("-f, --format <format>","Output format").action(async t=>{try{let e={relationshipId:t.relationship,name:t.name,type:(t.type??"RECEIPT").toUpperCase()};t.fileId&&(e.fileId=t.fileId),t.secretRef&&(e.secretRef=t.secretRef),t.expiresAt&&(e.expiresAt=t.expiresAt);let n=await a(G,{input:e});u(`Asset created: ${n.subCreateAsset.name}`),s(t,n.subCreateAsset);}catch(e){o(e);}});}function It(i){let r=i.command("entitlements").description("SubscriberBot relationship entitlements (seats, quotas, features, \u2026)");r.command("list").description("List entitlements for a relationship").requiredOption("--relationship <id>","Relationship ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(H,{relationshipId:t.relationship});s(t,e.subListEntitlements.items,{headers:["ID","Name","Type","Used","Quota","Active"],rows:e.subListEntitlements.items.map(n=>[c(n.id,12),n.name,n.type,String(n.used),n.quota!=null?String(n.quota):"-",n.isActive?"yes":"no"])});}catch(e){o(e);}}),r.command("create").description("Create an entitlement on a relationship").requiredOption("--relationship <id>","Relationship ID").requiredOption("--name <name>","Entitlement name").option("--type <t>","Entitlement type","FEATURE_ACCESS").option("--description <s>","Description").option("--quota <n>","Quota",p).option("--unit <u>","Quota unit").option("-f, --format <format>","Output format").action(async t=>{try{let e={relationshipId:t.relationship,name:t.name,type:(t.type??"FEATURE_ACCESS").toUpperCase()};t.description&&(e.description=t.description),t.quota!==void 0&&(e.quota=t.quota),t.unit&&(e.unit=t.unit);let n=await a(V,{input:e});u(`Entitlement created: ${n.subCreateEntitlement.name}`),s(t,n.subCreateEntitlement);}catch(e){o(e);}});}function ht(i){let r=i.command("invoices").description("SubscriberBot invoices");r.command("list").description("List invoices").option("--relationship <id>","Filter by relationship ID").option("--status <s>","Filter by invoice status").option("--limit <n>","Page size",p,50).option("--offset <n>","Offset",p,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(j,{relationshipId:t.relationship,status:t.status?t.status.toUpperCase():void 0,pagination:{limit:t.limit,offset:t.offset}});s(t,e.subListInvoices.items,{headers:["ID","Number","Status","Total","Currency","Due"],rows:e.subListInvoices.items.map(n=>[c(n.id,12),n.number??"-",n.status,String(n.total),n.currency,g(n.dueDate)])});}catch(e){o(e);}}),r.command("create").description("Create an invoice on a relationship").requiredOption("--relationship <id>","Relationship ID").option("--number <n>","Invoice number").option("--status <s>","Invoice status","ISSUED").option("--currency <c>","Currency code").option("--subtotal <n>","Subtotal",f).option("--tax-amount <n>","Tax amount",f).option("--total <n>","Total",f).option("--line-items <json>","Line items JSON").option("--issue-date <iso>","Issue date (ISO date)").option("--due-date <iso>","Due date (ISO date)").option("--payment-instrument <id>","Payment instrument ID").option("--file-id <id>","Referenced file ID (invoice PDF in wspace-files-svc)").option("-f, --format <format>","Output format").action(async t=>{try{let e={relationshipId:t.relationship,status:(t.status??"ISSUED").toUpperCase()};t.number&&(e.number=t.number),t.currency&&(e.currency=t.currency),t.subtotal!==void 0&&(e.subtotal=t.subtotal),t.taxAmount!==void 0&&(e.taxAmount=t.taxAmount),t.total!==void 0&&(e.total=t.total),t.lineItems&&(e.lineItems=y("line-items",t.lineItems)),t.issueDate&&(e.issueDate=t.issueDate),t.dueDate&&(e.dueDate=t.dueDate),t.paymentInstrument&&(e.paymentInstrumentId=t.paymentInstrument),t.fileId&&(e.fileId=t.fileId);let n=await a(B,{input:e});u(`Invoice created: ${n.subCreateInvoice.number??n.subCreateInvoice.id}`),s(t,n.subCreateInvoice);}catch(e){o(e);}}),r.command("mark-paid").description("Mark an invoice as paid").argument("<id>","Invoice ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(Y,{id:t});u(`Invoice marked paid: ${n.subMarkInvoicePaid.number??n.subMarkInvoicePaid.id}`),s(e,n.subMarkInvoicePaid);}catch(n){o(n);}});}function yt(i){let r=i.command("payment-instruments").description("SubscriberBot payment instruments (cards, wallets, bank accounts, \u2026)");r.command("list").description("List payment instruments").option("--owner <id>","Filter by owner ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(K,{ownerId:t.owner});s(t,e.subListPaymentInstruments.items,{headers:["ID","Label","Type","Status","Brand","Last4","Default"],rows:e.subListPaymentInstruments.items.map(n=>[c(n.id,12),n.label,n.type,n.status,n.brand??"-",n.last4??"-",n.isDefault?"yes":"no"])});}catch(e){o(e);}}),r.command("create").description("Add a payment instrument").requiredOption("--label <label>","Label").option("--type <t>","Payment instrument type","CARD").option("--owner <id>","Owner ID").option("--brand <b>","Card/instrument brand").option("--last4 <n>","Last 4 digits").option("--expiry-month <n>","Expiry month",p).option("--expiry-year <n>","Expiry year",p).option("--processor-token <t>","Processor token").option("--default","Mark as default").option("-f, --format <format>","Output format").action(async t=>{try{let e={label:t.label,type:(t.type??"CARD").toUpperCase(),isDefault:t.default===!0};t.owner&&(e.ownerId=t.owner),t.brand&&(e.brand=t.brand),t.last4&&(e.last4=t.last4),t.expiryMonth!==void 0&&(e.expiryMonth=t.expiryMonth),t.expiryYear!==void 0&&(e.expiryYear=t.expiryYear),t.processorToken&&(e.processorToken=t.processorToken);let n=await a(z,{input:e});u(`Payment instrument added: ${n.subCreatePaymentInstrument.label}`),s(t,n.subCreatePaymentInstrument);}catch(e){o(e);}}),r.command("remove").description("Remove a payment instrument").argument("<id>","Payment instrument ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(J,{id:t});u(`Payment instrument ${t} removed`),s(e,{removed:n.subRemovePaymentInstrument});}catch(n){o(n);}});}function wt(i){let r=i.command("channels").description("SubscriberBot communication channels (email, sms, slack, webhook, \u2026)");r.command("list").description("List communication channels").option("--owner <id>","Filter by owner ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(Q,{ownerId:t.owner});s(t,e.subListChannels.items,{headers:["ID","Type","Address","Label","Status","Ingest"],rows:e.subListChannels.items.map(n=>[c(n.id,12),n.type,n.address,n.label??"-",n.status,n.ingestEnabled?"yes":"no"])});}catch(e){o(e);}}),r.command("create").description("Create a communication channel").requiredOption("--address <addr>","Channel address (email, phone, webhook URL, \u2026)").option("--type <t>","Channel type","EMAIL").option("--owner <id>","Owner ID").option("--label <label>","Label").option("--no-ingest","Disable message ingestion").option("-f, --format <format>","Output format").action(async t=>{try{let e={address:t.address,type:(t.type??"EMAIL").toUpperCase(),ingestEnabled:t.ingest!==!1};t.owner&&(e.ownerId=t.owner),t.label&&(e.label=t.label);let n=await a(X,{input:e});u(`Channel created: ${n.subCreateChannel.address}`),s(t,n.subCreateChannel);}catch(e){o(e);}}),r.command("verify").description("Mark a channel as verified").argument("<id>","Channel ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(Z,{id:t});u(`Channel verified: ${n.subVerifyChannel.address}`),s(e,n.subVerifyChannel);}catch(n){o(n);}});}function Ct(i){let r=i.command("inbox").description("SubscriberBot universal inbox (merged subscription communications)");r.command("list").description("List inbox messages").option("--category <c>","Filter by message category").option("--channel <id>","Filter by channel ID").option("--relationship <id>","Filter by relationship ID").option("--unread-only","Only unread messages").option("--limit <n>","Page size",p,50).option("--offset <n>","Offset",p,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(tt,{category:t.category?t.category.toUpperCase():void 0,channelId:t.channel,relationshipId:t.relationship,unreadOnly:t.unreadOnly?!0:void 0,pagination:{limit:t.limit,offset:t.offset}});s(t,e.subListInboxMessages.items,{headers:["ID","Subject","Category","Read","Action","Received"],rows:e.subListInboxMessages.items.map(n=>[c(n.id,12),c(n.subject??"-",30),n.category,n.isRead?"yes":"no",n.actionRequired?"yes":"no",g(n.receivedAt)])});}catch(e){o(e);}}),r.command("ingest").description("Ingest a message into the universal inbox").requiredOption("--channel <id>","Channel ID").requiredOption("--received-at <iso>","Received at (ISO date)").option("--category <c>","Message category","OTHER").option("--relationship <id>","Relationship ID").option("--subject <s>","Subject").option("--preview <s>","Preview text").option("--external-id <id>","External message ID").option("--category-confidence <n>","Category confidence (0-100)",p).option("--action-required","Flag as action required").option("-f, --format <format>","Output format").action(async t=>{try{let e={channelId:t.channel,receivedAt:t.receivedAt,category:(t.category??"OTHER").toUpperCase(),actionRequired:t.actionRequired===!0};t.relationship&&(e.relationshipId=t.relationship),t.subject&&(e.subject=t.subject),t.preview&&(e.preview=t.preview),t.externalId&&(e.externalId=t.externalId),t.categoryConfidence!==void 0&&(e.categoryConfidence=t.categoryConfidence);let n=await a(et,{input:e});u(`Message ingested: ${n.subIngestMessage.id}`),s(t,n.subIngestMessage);}catch(e){o(e);}}),r.command("mark-read").description("Mark a message as read").argument("<id>","Message ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(nt,{id:t});u(`Message ${t} marked read`),s(e,n.subMarkMessageRead);}catch(n){o(n);}});}function At(i){let r=i.command("agents").description("SubscriberBot AI agents & their automation policies");r.command("list").description("List AI agents").option("--kind <k>","Filter by agent kind").option("--owner <id>","Filter by owner ID").option("--status <s>","Filter by agent status").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(it,{kind:t.kind?t.kind.toUpperCase():void 0,ownerId:t.owner,status:t.status?t.status.toUpperCase():void 0});s(t,e.subListAgents.items,{headers:["ID","Name","Kind","Status","Description"],rows:e.subListAgents.items.map(n=>[c(n.id,12),n.name,n.kind,n.status,c(n.description??"-",30)])});}catch(e){o(e);}}),r.command("get").description("Get an agent by id").argument("<id>","Agent ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(rt,{id:t});if(!n.subAgent)throw new l(`Agent ${t} not found`);s(e,n.subAgent);}catch(n){o(n);}}),r.command("create").description("Create an AI agent").requiredOption("--name <name>","Agent name").option("--kind <k>","Agent kind","DISCOVERY").option("--status <s>","Agent status","SUGGEST_ONLY").option("--owner <id>","Owner ID").option("--description <s>","Description").option("--config <json>","Agent config JSON").option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name,kind:(t.kind??"DISCOVERY").toUpperCase(),status:(t.status??"SUGGEST_ONLY").toUpperCase()};t.owner&&(e.ownerId=t.owner),t.description&&(e.description=t.description),t.config&&(e.config=y("config",t.config));let n=await a(ot,{input:e});u(`Agent created: ${n.subCreateAgent.name}`),s(t,n.subCreateAgent);}catch(e){o(e);}}),r.command("set-status").description("Change an agent's operating posture").argument("<id>","Agent ID").requiredOption("--status <s>","DISABLED|SUGGEST_ONLY|AUTONOMOUS").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(st,{id:t,status:e.status.toUpperCase()});u(`Agent status set to ${n.subSetAgentStatus.status}`),s(e,n.subSetAgentStatus);}catch(n){o(n);}}),r.command("list-policies").description("List policies (optionally filtered by agent)").option("--agent <id>","Filter by agent ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(at,{agentId:t.agent});s(t,e.subListPolicies.items,{headers:["ID","Name","Action","Enabled","Triggers"],rows:e.subListPolicies.items.map(n=>[c(n.id,12),n.name,n.action,n.isEnabled?"yes":"no",String(n.triggerCount??0)])});}catch(e){o(e);}}),r.command("create-policy").description("Create an automation policy for an agent").requiredOption("--agent <id>","Agent ID").requiredOption("--name <name>","Policy name").option("--action <a>","Policy action","ALERT").option("--description <s>","Description").option("--condition <json>","Condition JSON").option("--no-enabled","Create disabled").option("-f, --format <format>","Output format").action(async t=>{try{let e={agentId:t.agent,name:t.name,action:(t.action??"ALERT").toUpperCase(),isEnabled:t.enabled!==!1};t.description&&(e.description=t.description),t.condition&&(e.condition=y("condition",t.condition));let n=await a(ut,{input:e});u(`Policy created: ${n.subCreatePolicy.name}`),s(t,n.subCreatePolicy);}catch(e){o(e);}});}function vt(i){let r=i.command("workflows").description("SubscriberBot automation workflows");r.command("list").description("List workflows").option("--status <s>","Filter by workflow status").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(ct,{status:t.status?t.status.toUpperCase():void 0});s(t,e.subListWorkflows.items,{headers:["ID","Name","Trigger","Status","Runs"],rows:e.subListWorkflows.items.map(n=>[c(n.id,12),n.name,n.triggerEvent,n.status,String(n.runCount??0)])});}catch(e){o(e);}}),r.command("create").description("Create a workflow").requiredOption("--name <name>","Workflow name").requiredOption("--trigger-event <e>","Trigger event").option("--description <s>","Description").option("--steps <json>","Steps JSON").option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name,triggerEvent:t.triggerEvent};t.description&&(e.description=t.description),t.steps&&(e.steps=y("steps",t.steps));let n=await a(dt,{input:e});u(`Workflow created: ${n.subCreateWorkflow.name}`),s(t,n.subCreateWorkflow);}catch(e){o(e);}}),r.command("activate").description("Activate a workflow").argument("<id>","Workflow ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(pt,{id:t});u(`Workflow activated: ${n.subActivateWorkflow.name}`),s(e,n.subActivateWorkflow);}catch(n){o(n);}});}function kt(i){i.command("health").description("SubscriberBot service health check (public)").option("-f, --format <format>","Output format").action(async r=>{try{let t=await v(lt);u(t.subHealth),s(r,{health:t.subHealth});}catch(t){o(t);}});}var qt={id:"subscriberbot",version:"1.0.0",displayName:"SubscriberBot",dependsOn:["auth","workspaces"],register(i,r){S(r);let t=i.command("subscriberbot").description("SubscriberBot universal subscription & relationship management");mt(t),gt(t),ft(t),bt(t),It(t),ht(t),yt(t),wt(t),Ct(t),At(t),vt(t),kt(t);}},Gn=qt;module.exports=Gn;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a,b as b$1,h,
|
|
1
|
+
import {a,b as b$1,i,r,h,k as k$1,q as q$1,d}from'../../chunk-O6UCQ5IT.js';import {o}from'../../chunk-YIY5IDXQ.js';var C=`
|
|
2
2
|
query SubGetProvider($id: ID!) {
|
|
3
3
|
subProvider(id: $id) {
|
|
4
4
|
id name slug description category status industry language region
|
|
@@ -50,8 +50,11 @@ import {a,b as b$1,h,p as p$1,g,i,o as o$1,d}from'../../chunk-W4JZR7RJ.js';impor
|
|
|
50
50
|
`,k=`
|
|
51
51
|
query SubListPlans($providerId: ID) {
|
|
52
52
|
subListPlans(providerId: $providerId) {
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
items {
|
|
54
|
+
id providerId name description amount currency interval features isActive createdAt
|
|
55
|
+
updatedAt workspaceId
|
|
56
|
+
}
|
|
57
|
+
pageInfo { cursor hasMore }
|
|
55
58
|
}
|
|
56
59
|
}
|
|
57
60
|
`,O=`
|
|
@@ -125,30 +128,38 @@ import {a,b as b$1,h,p as p$1,g,i,o as o$1,d}from'../../chunk-W4JZR7RJ.js';impor
|
|
|
125
128
|
`,N=`
|
|
126
129
|
query SubListRenewalEvents($relationshipId: ID, $upcomingOnly: Boolean) {
|
|
127
130
|
subListRenewalEvents(relationshipId: $relationshipId, upcomingOnly: $upcomingOnly) {
|
|
128
|
-
|
|
129
|
-
|
|
131
|
+
items {
|
|
132
|
+
id relationshipId eventType detail amount currency occursAt notified createdAt
|
|
133
|
+
updatedAt workspaceId
|
|
134
|
+
}
|
|
135
|
+
pageInfo { cursor hasMore }
|
|
130
136
|
}
|
|
131
137
|
}
|
|
132
|
-
`,
|
|
138
|
+
`,M=`
|
|
133
139
|
query SubListAssets($relationshipId: ID!) {
|
|
134
140
|
subListAssets(relationshipId: $relationshipId) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
141
|
+
items {
|
|
142
|
+
id relationshipId name type secretRef expiresAt createdAt updatedAt workspaceId
|
|
143
|
+
file { id }
|
|
144
|
+
}
|
|
145
|
+
pageInfo { cursor hasMore }
|
|
138
146
|
}
|
|
139
147
|
}
|
|
140
|
-
`,
|
|
148
|
+
`,_=`
|
|
141
149
|
mutation SubCreateAsset($input: SubCreateAssetInput!) {
|
|
142
150
|
subCreateAsset(input: $input) {
|
|
143
151
|
id relationshipId name type secretRef expiresAt createdAt
|
|
144
152
|
file { id }
|
|
145
153
|
}
|
|
146
154
|
}
|
|
147
|
-
`,
|
|
155
|
+
`,U=`
|
|
148
156
|
query SubListEntitlements($relationshipId: ID!) {
|
|
149
157
|
subListEntitlements(relationshipId: $relationshipId) {
|
|
150
|
-
|
|
151
|
-
|
|
158
|
+
items {
|
|
159
|
+
id relationshipId name description type quota unit used isActive createdAt updatedAt
|
|
160
|
+
workspaceId
|
|
161
|
+
}
|
|
162
|
+
pageInfo { cursor hasMore }
|
|
152
163
|
}
|
|
153
164
|
}
|
|
154
165
|
`,q=`
|
|
@@ -188,8 +199,11 @@ import {a,b as b$1,h,p as p$1,g,i,o as o$1,d}from'../../chunk-W4JZR7RJ.js';impor
|
|
|
188
199
|
`,V=`
|
|
189
200
|
query SubListPaymentInstruments($ownerId: ID) {
|
|
190
201
|
subListPaymentInstruments(ownerId: $ownerId) {
|
|
191
|
-
|
|
192
|
-
|
|
202
|
+
items {
|
|
203
|
+
id ownerId label type status brand last4 expiryMonth expiryYear isDefault createdAt
|
|
204
|
+
updatedAt workspaceId
|
|
205
|
+
}
|
|
206
|
+
pageInfo { cursor hasMore }
|
|
193
207
|
}
|
|
194
208
|
}
|
|
195
209
|
`,G=`
|
|
@@ -206,8 +220,11 @@ import {a,b as b$1,h,p as p$1,g,i,o as o$1,d}from'../../chunk-W4JZR7RJ.js';impor
|
|
|
206
220
|
`,Y=`
|
|
207
221
|
query SubListChannels($ownerId: ID) {
|
|
208
222
|
subListChannels(ownerId: $ownerId) {
|
|
209
|
-
|
|
210
|
-
|
|
223
|
+
items {
|
|
224
|
+
id ownerId type address label status ingestEnabled verifiedAt createdAt updatedAt
|
|
225
|
+
workspaceId
|
|
226
|
+
}
|
|
227
|
+
pageInfo { cursor hasMore }
|
|
211
228
|
}
|
|
212
229
|
}
|
|
213
230
|
`,j=`
|
|
@@ -270,7 +287,8 @@ import {a,b as b$1,h,p as p$1,g,i,o as o$1,d}from'../../chunk-W4JZR7RJ.js';impor
|
|
|
270
287
|
`,Z=`
|
|
271
288
|
query SubListAgents($kind: SubAgentKind, $ownerId: ID, $status: SubAgentStatus) {
|
|
272
289
|
subListAgents(kind: $kind, ownerId: $ownerId, status: $status) {
|
|
273
|
-
id ownerId name description kind status lastRunAt createdAt
|
|
290
|
+
items { id ownerId name description kind status lastRunAt createdAt }
|
|
291
|
+
pageInfo { cursor hasMore }
|
|
274
292
|
}
|
|
275
293
|
}
|
|
276
294
|
`,tt=`
|
|
@@ -288,8 +306,11 @@ import {a,b as b$1,h,p as p$1,g,i,o as o$1,d}from'../../chunk-W4JZR7RJ.js';impor
|
|
|
288
306
|
`,nt=`
|
|
289
307
|
query SubListPolicies($agentId: ID) {
|
|
290
308
|
subListPolicies(agentId: $agentId) {
|
|
291
|
-
|
|
292
|
-
|
|
309
|
+
items {
|
|
310
|
+
id agentId name description action condition isEnabled triggerCount lastTriggeredAt
|
|
311
|
+
createdAt updatedAt workspaceId
|
|
312
|
+
}
|
|
313
|
+
pageInfo { cursor hasMore }
|
|
293
314
|
}
|
|
294
315
|
}
|
|
295
316
|
`,it=`
|
|
@@ -302,8 +323,11 @@ import {a,b as b$1,h,p as p$1,g,i,o as o$1,d}from'../../chunk-W4JZR7RJ.js';impor
|
|
|
302
323
|
`,rt=`
|
|
303
324
|
query SubListWorkflows($status: SubWorkflowStatus) {
|
|
304
325
|
subListWorkflows(status: $status) {
|
|
305
|
-
|
|
306
|
-
|
|
326
|
+
items {
|
|
327
|
+
id name description triggerEvent status runCount lastRunAt createdAt updatedAt
|
|
328
|
+
workspaceId
|
|
329
|
+
}
|
|
330
|
+
pageInfo { cursor hasMore }
|
|
307
331
|
}
|
|
308
332
|
}
|
|
309
333
|
`,st=`
|
|
@@ -322,4 +346,4 @@ import {a,b as b$1,h,p as p$1,g,i,o as o$1,d}from'../../chunk-W4JZR7RJ.js';impor
|
|
|
322
346
|
query SubHealth {
|
|
323
347
|
subHealth
|
|
324
348
|
}
|
|
325
|
-
`;function y(d,i){try{return JSON.parse(i)}catch{throw new o(`--${d} must be valid JSON`)}}function p(d){let i=Number.parseInt(d,10);if(Number.isNaN(i))throw new o(`Expected an integer but got "${d}"`);return i}function b(d){let i=Number.parseFloat(d);if(Number.isNaN(i))throw new o(`Expected a number but got "${d}"`);return i}function I(d){return d.split(",").map(i=>i.trim()).filter(i=>i.length>0)}function dt(d){let i$1=d.command("providers").description("SubscriberBot provider registry (vendors / publishers / services)");i$1.command("list").description("List / search providers in the registry").option("--category <c>","Filter by provider category").option("--status <s>","Filter by provider status").option("--search <q>","Free-text search").option("--limit <n>","Page size",p,50).option("--offset <n>","Offset",p,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(R,{category:t.category?t.category.toUpperCase():void 0,status:t.status?t.status.toUpperCase():void 0,search:t.search,pagination:{limit:t.limit,offset:t.offset}});h(t,e.subListProviders.items,{headers:["ID","Name","Category","Status","Region","Churn"],rows:e.subListProviders.items.map(n=>[p$1(n.id,12),n.name,n.category,n.status,n.region??"-",n.churnRiskScore!=null?String(n.churnRiskScore):"-"])});}catch(e){g(e);}}),i$1.command("get").description("Get a provider by id").argument("<id>","Provider ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(C,{id:t});if(!n.subProvider)throw new o(`Provider ${t} not found`);h(e,n.subProvider);}catch(n){g(n);}}),i$1.command("create").description("Create a provider").requiredOption("--name <name>","Provider name").option("--category <c>","Provider category","OTHER").option("--status <s>","Provider status","UNVERIFIED").option("--slug <slug>","URL slug").option("--description <s>","Description").option("--industry <s>","Industry").option("--language <s>","Language").option("--region <s>","Region").option("--website-url <url>","Website URL").option("--logo-file-id <id>","Logo file ID").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name,category:(t.category??"OTHER").toUpperCase(),status:(t.status??"UNVERIFIED").toUpperCase()};t.slug&&(e.slug=t.slug),t.description&&(e.description=t.description),t.industry&&(e.industry=t.industry),t.language&&(e.language=t.language),t.region&&(e.region=t.region),t.websiteUrl&&(e.websiteUrl=t.websiteUrl),t.logoFileId&&(e.logoFileId=t.logoFileId),t.tags&&(e.tags=I(t.tags));let n=await b$1(S,{input:e});i(`Provider created: ${n.subCreateProvider.name}`),h(t,n.subCreateProvider);}catch(e){g(e);}}),i$1.command("update").description("Update a provider").argument("<id>","Provider ID").option("--name <name>","Provider name").option("--category <c>","Provider category").option("--status <s>","Provider status").option("--slug <slug>","URL slug").option("--description <s>","Description").option("--industry <s>","Industry").option("--language <s>","Language").option("--region <s>","Region").option("--website-url <url>","Website URL").option("--logo-file-id <id>","Logo file ID").option("--churn-risk-score <n>","Churn risk score",p).option("--vendor-health-score <n>","Vendor health score",p).option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.name&&(n.name=e.name),e.category&&(n.category=e.category.toUpperCase()),e.status&&(n.status=e.status.toUpperCase()),e.slug&&(n.slug=e.slug),e.description!==void 0&&(n.description=e.description),e.industry&&(n.industry=e.industry),e.language&&(n.language=e.language),e.region&&(n.region=e.region),e.websiteUrl&&(n.websiteUrl=e.websiteUrl),e.logoFileId&&(n.logoFileId=e.logoFileId),e.churnRiskScore!==void 0&&(n.churnRiskScore=e.churnRiskScore),e.vendorHealthScore!==void 0&&(n.vendorHealthScore=e.vendorHealthScore),e.tags&&(n.tags=I(e.tags)),!Object.keys(n).length)throw new o("No updates specified");let h$1=await b$1(v,{id:t,input:n});i("Provider updated"),h(e,h$1.subUpdateProvider);}catch(n){g(n);}}),i$1.command("archive").description("Archive (soft-delete) a provider").argument("<id>","Provider ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(E,{id:t});i(`Provider ${t} archived`),h(e,{archived:n.subArchiveProvider});}catch(n){g(n);}});}function ut(d){let i$1=d.command("plans").description("SubscriberBot provider plans");i$1.command("list").description("List plans (optionally filtered by provider)").option("--provider <id>","Filter by provider ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(k,{providerId:t.provider});h(t,e.subListPlans,{headers:["ID","Name","Amount","Currency","Interval","Active"],rows:e.subListPlans.map(n=>[p$1(n.id,12),n.name,String(n.amount),n.currency,n.interval,n.isActive?"yes":"no"])});}catch(e){g(e);}}),i$1.command("create").description("Create a plan for a provider").requiredOption("--provider <id>","Provider ID").requiredOption("--name <name>","Plan name").option("--amount <n>","Amount",b).option("--currency <c>","Currency code").option("--interval <i>","Billing interval","MONTHLY").option("--description <s>","Description").option("--features <csv>","Comma-separated feature list").option("-f, --format <format>","Output format").action(async t=>{try{let e={providerId:t.provider,name:t.name,interval:(t.interval??"MONTHLY").toUpperCase()};t.amount!==void 0&&(e.amount=t.amount),t.currency&&(e.currency=t.currency),t.description&&(e.description=t.description),t.features&&(e.features=I(t.features));let n=await b$1(O,{input:e});i(`Plan created: ${n.subCreatePlan.name}`),h(t,n.subCreatePlan);}catch(e){g(e);}});}function pt(d){let i$1=d.command("relationships").description("SubscriberBot subscriptions, memberships & recurring relationships");i$1.command("list").description("List relationships").option("--kind <k>","Filter by relationship kind").option("--owner <id>","Filter by owner ID").option("--provider <id>","Filter by provider ID").option("--status <s>","Filter by relationship status").option("--limit <n>","Page size",p,50).option("--offset <n>","Offset",p,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(T,{kind:t.kind?t.kind.toUpperCase():void 0,ownerId:t.owner,providerId:t.provider,status:t.status?t.status.toUpperCase():void 0,pagination:{limit:t.limit,offset:t.offset}});h(t,e.subListRelationships.items,{headers:["ID","Label","Kind","Status","Amount","Renews"],rows:e.subListRelationships.items.map(n=>[p$1(n.id,12),n.label,n.kind,n.status,`${n.amount} ${n.currency}`,o$1(n.renewsAt)])});}catch(e){g(e);}}),i$1.command("get").description("Get a relationship by id").argument("<id>","Relationship ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(L,{id:t});if(!n.subRelationship)throw new o(`Relationship ${t} not found`);h(e,n.subRelationship);}catch(n){g(n);}}),i$1.command("create").description("Create a relationship (subscription / membership / \u2026)").requiredOption("--label <label>","Human-readable label").option("--kind <k>","Relationship kind","SUBSCRIPTION").option("--status <s>","Relationship status","ACTIVE").option("--owner <id>","Owner ID").option("--provider <id>","Provider ID").option("--plan <id>","Plan ID").option("--amount <n>","Amount",b).option("--currency <c>","Currency code").option("--interval <i>","Billing interval","MONTHLY").option("--discovery-source <s>","Discovery source","MANUAL").option("--no-auto-renew","Disable auto-renew").option("--notes <s>","Notes").option("--tags <csv>","Comma-separated tags").option("--started-at <iso>","Started at (ISO date)").option("--renews-at <iso>","Renews at (ISO date)").option("--trial-ends-at <iso>","Trial end (ISO date)").option("-f, --format <format>","Output format").action(async t=>{try{let e={label:t.label,kind:(t.kind??"SUBSCRIPTION").toUpperCase(),status:(t.status??"ACTIVE").toUpperCase(),interval:(t.interval??"MONTHLY").toUpperCase(),discoverySource:(t.discoverySource??"MANUAL").toUpperCase(),autoRenew:t.autoRenew!==!1};t.owner&&(e.ownerId=t.owner),t.provider&&(e.providerId=t.provider),t.plan&&(e.planId=t.plan),t.amount!==void 0&&(e.amount=t.amount),t.currency&&(e.currency=t.currency),t.notes&&(e.notes=t.notes),t.tags&&(e.tags=I(t.tags)),t.startedAt&&(e.startedAt=t.startedAt),t.renewsAt&&(e.renewsAt=t.renewsAt),t.trialEndsAt&&(e.trialEndsAt=t.trialEndsAt);let n=await b$1(P,{input:e});i(`Relationship created: ${n.subCreateRelationship.label}`),h(t,n.subCreateRelationship);}catch(e){g(e);}}),i$1.command("update").description("Update a relationship").argument("<id>","Relationship ID").option("--label <label>","Label").option("--kind <k>","Relationship kind").option("--provider <id>","Provider ID").option("--plan <id>","Plan ID").option("--amount <n>","Amount",b).option("--currency <c>","Currency code").option("--interval <i>","Billing interval").option("--auto-renew <bool>","true|false",t=>t==="true").option("--health-score <n>","Health score",p).option("--notes <s>","Notes").option("--tags <csv>","Comma-separated tags").option("--started-at <iso>","Started at (ISO date)").option("--renews-at <iso>","Renews at (ISO date)").option("--trial-ends-at <iso>","Trial end (ISO date)").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.label&&(n.label=e.label),e.kind&&(n.kind=e.kind.toUpperCase()),e.provider&&(n.providerId=e.provider),e.plan&&(n.planId=e.plan),e.amount!==void 0&&(n.amount=e.amount),e.currency&&(n.currency=e.currency),e.interval&&(n.interval=e.interval.toUpperCase()),e.autoRenew!==void 0&&(n.autoRenew=e.autoRenew),e.healthScore!==void 0&&(n.healthScore=e.healthScore),e.notes!==void 0&&(n.notes=e.notes),e.tags&&(n.tags=I(e.tags)),e.startedAt&&(n.startedAt=e.startedAt),e.renewsAt&&(n.renewsAt=e.renewsAt),e.trialEndsAt&&(n.trialEndsAt=e.trialEndsAt),!Object.keys(n).length)throw new o("No updates specified");let h$1=await b$1(D,{id:t,input:n});i("Relationship updated"),h(e,h$1.subUpdateRelationship);}catch(n){g(n);}}),i$1.command("cancel").description("Cancel a relationship").argument("<id>","Relationship ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1($,{id:t});i(`Relationship cancelled: ${n.subCancelRelationship.label}`),h(e,n.subCancelRelationship);}catch(n){g(n);}}),i$1.command("transition").description("Advance a relationship through its lifecycle").argument("<id>","Relationship ID").requiredOption("--status <s>","ACTIVE|TRIAL|PAST_DUE|PAUSED|CANCELLED|EXPIRED|LAPSED").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(x,{id:t,status:e.status.toUpperCase()});i(`Relationship status set to ${n.subTransitionRelationship.status}`),h(e,n.subTransitionRelationship);}catch(n){g(n);}}),i$1.command("renewals").description("List renewal events").option("--relationship <id>","Filter by relationship ID").option("--upcoming-only","Only upcoming events").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(N,{relationshipId:t.relationship,upcomingOnly:t.upcomingOnly?!0:void 0});h(t,e.subListRenewalEvents,{headers:["ID","Relationship","Type","Amount","Occurs","Notified"],rows:e.subListRenewalEvents.map(n=>[p$1(n.id,12),p$1(n.relationshipId,12),n.eventType,n.amount!=null?`${n.amount} ${n.currency??""}`.trim():"-",o$1(n.occursAt),n.notified?"yes":"no"])});}catch(e){g(e);}});}function ct(d){let i$1=d.command("assets").description("SubscriberBot relationship assets (contracts, licenses, credentials, \u2026)");i$1.command("list").description("List assets for a relationship").requiredOption("--relationship <id>","Relationship ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(_,{relationshipId:t.relationship});h(t,e.subListAssets,{headers:["ID","Name","Type","Secret","Expires"],rows:e.subListAssets.map(n=>[p$1(n.id,12),n.name,n.type,n.secretRef?"yes":"no",o$1(n.expiresAt)])});}catch(e){g(e);}}),i$1.command("create").description("Create an asset on a relationship").requiredOption("--relationship <id>","Relationship ID").requiredOption("--name <name>","Asset name").option("--type <t>","Asset type","RECEIPT").option("--file-id <id>","Referenced file ID (blob lives in wspace-files-svc)").option("--secret-ref <ref>","Secret reference").option("--expires-at <iso>","Expiry (ISO date)").option("-f, --format <format>","Output format").action(async t=>{try{let e={relationshipId:t.relationship,name:t.name,type:(t.type??"RECEIPT").toUpperCase()};t.fileId&&(e.fileId=t.fileId),t.secretRef&&(e.secretRef=t.secretRef),t.expiresAt&&(e.expiresAt=t.expiresAt);let n=await b$1(U,{input:e});i(`Asset created: ${n.subCreateAsset.name}`),h(t,n.subCreateAsset);}catch(e){g(e);}});}function mt(d){let i$1=d.command("entitlements").description("SubscriberBot relationship entitlements (seats, quotas, features, \u2026)");i$1.command("list").description("List entitlements for a relationship").requiredOption("--relationship <id>","Relationship ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(M,{relationshipId:t.relationship});h(t,e.subListEntitlements,{headers:["ID","Name","Type","Used","Quota","Active"],rows:e.subListEntitlements.map(n=>[p$1(n.id,12),n.name,n.type,String(n.used),n.quota!=null?String(n.quota):"-",n.isActive?"yes":"no"])});}catch(e){g(e);}}),i$1.command("create").description("Create an entitlement on a relationship").requiredOption("--relationship <id>","Relationship ID").requiredOption("--name <name>","Entitlement name").option("--type <t>","Entitlement type","FEATURE_ACCESS").option("--description <s>","Description").option("--quota <n>","Quota",p).option("--unit <u>","Quota unit").option("-f, --format <format>","Output format").action(async t=>{try{let e={relationshipId:t.relationship,name:t.name,type:(t.type??"FEATURE_ACCESS").toUpperCase()};t.description&&(e.description=t.description),t.quota!==void 0&&(e.quota=t.quota),t.unit&&(e.unit=t.unit);let n=await b$1(q,{input:e});i(`Entitlement created: ${n.subCreateEntitlement.name}`),h(t,n.subCreateEntitlement);}catch(e){g(e);}});}function lt(d){let i$1=d.command("invoices").description("SubscriberBot invoices");i$1.command("list").description("List invoices").option("--relationship <id>","Filter by relationship ID").option("--status <s>","Filter by invoice status").option("--limit <n>","Page size",p,50).option("--offset <n>","Offset",p,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(W,{relationshipId:t.relationship,status:t.status?t.status.toUpperCase():void 0,pagination:{limit:t.limit,offset:t.offset}});h(t,e.subListInvoices.items,{headers:["ID","Number","Status","Total","Currency","Due"],rows:e.subListInvoices.items.map(n=>[p$1(n.id,12),n.number??"-",n.status,String(n.total),n.currency,o$1(n.dueDate)])});}catch(e){g(e);}}),i$1.command("create").description("Create an invoice on a relationship").requiredOption("--relationship <id>","Relationship ID").option("--number <n>","Invoice number").option("--status <s>","Invoice status","ISSUED").option("--currency <c>","Currency code").option("--subtotal <n>","Subtotal",b).option("--tax-amount <n>","Tax amount",b).option("--total <n>","Total",b).option("--line-items <json>","Line items JSON").option("--issue-date <iso>","Issue date (ISO date)").option("--due-date <iso>","Due date (ISO date)").option("--payment-instrument <id>","Payment instrument ID").option("--file-id <id>","Referenced file ID (invoice PDF in wspace-files-svc)").option("-f, --format <format>","Output format").action(async t=>{try{let e={relationshipId:t.relationship,status:(t.status??"ISSUED").toUpperCase()};t.number&&(e.number=t.number),t.currency&&(e.currency=t.currency),t.subtotal!==void 0&&(e.subtotal=t.subtotal),t.taxAmount!==void 0&&(e.taxAmount=t.taxAmount),t.total!==void 0&&(e.total=t.total),t.lineItems&&(e.lineItems=y("line-items",t.lineItems)),t.issueDate&&(e.issueDate=t.issueDate),t.dueDate&&(e.dueDate=t.dueDate),t.paymentInstrument&&(e.paymentInstrumentId=t.paymentInstrument),t.fileId&&(e.fileId=t.fileId);let n=await b$1(H,{input:e});i(`Invoice created: ${n.subCreateInvoice.number??n.subCreateInvoice.id}`),h(t,n.subCreateInvoice);}catch(e){g(e);}}),i$1.command("mark-paid").description("Mark an invoice as paid").argument("<id>","Invoice ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(F,{id:t});i(`Invoice marked paid: ${n.subMarkInvoicePaid.number??n.subMarkInvoicePaid.id}`),h(e,n.subMarkInvoicePaid);}catch(n){g(n);}});}function gt(d){let i$1=d.command("payment-instruments").description("SubscriberBot payment instruments (cards, wallets, bank accounts, \u2026)");i$1.command("list").description("List payment instruments").option("--owner <id>","Filter by owner ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(V,{ownerId:t.owner});h(t,e.subListPaymentInstruments,{headers:["ID","Label","Type","Status","Brand","Last4","Default"],rows:e.subListPaymentInstruments.map(n=>[p$1(n.id,12),n.label,n.type,n.status,n.brand??"-",n.last4??"-",n.isDefault?"yes":"no"])});}catch(e){g(e);}}),i$1.command("create").description("Add a payment instrument").requiredOption("--label <label>","Label").option("--type <t>","Payment instrument type","CARD").option("--owner <id>","Owner ID").option("--brand <b>","Card/instrument brand").option("--last4 <n>","Last 4 digits").option("--expiry-month <n>","Expiry month",p).option("--expiry-year <n>","Expiry year",p).option("--processor-token <t>","Processor token").option("--default","Mark as default").option("-f, --format <format>","Output format").action(async t=>{try{let e={label:t.label,type:(t.type??"CARD").toUpperCase(),isDefault:t.default===!0};t.owner&&(e.ownerId=t.owner),t.brand&&(e.brand=t.brand),t.last4&&(e.last4=t.last4),t.expiryMonth!==void 0&&(e.expiryMonth=t.expiryMonth),t.expiryYear!==void 0&&(e.expiryYear=t.expiryYear),t.processorToken&&(e.processorToken=t.processorToken);let n=await b$1(G,{input:e});i(`Payment instrument added: ${n.subCreatePaymentInstrument.label}`),h(t,n.subCreatePaymentInstrument);}catch(e){g(e);}}),i$1.command("remove").description("Remove a payment instrument").argument("<id>","Payment instrument ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(B,{id:t});i(`Payment instrument ${t} removed`),h(e,{removed:n.subRemovePaymentInstrument});}catch(n){g(n);}});}function ft(d){let i$1=d.command("channels").description("SubscriberBot communication channels (email, sms, slack, webhook, \u2026)");i$1.command("list").description("List communication channels").option("--owner <id>","Filter by owner ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(Y,{ownerId:t.owner});h(t,e.subListChannels,{headers:["ID","Type","Address","Label","Status","Ingest"],rows:e.subListChannels.map(n=>[p$1(n.id,12),n.type,n.address,n.label??"-",n.status,n.ingestEnabled?"yes":"no"])});}catch(e){g(e);}}),i$1.command("create").description("Create a communication channel").requiredOption("--address <addr>","Channel address (email, phone, webhook URL, \u2026)").option("--type <t>","Channel type","EMAIL").option("--owner <id>","Owner ID").option("--label <label>","Label").option("--no-ingest","Disable message ingestion").option("-f, --format <format>","Output format").action(async t=>{try{let e={address:t.address,type:(t.type??"EMAIL").toUpperCase(),ingestEnabled:t.ingest!==!1};t.owner&&(e.ownerId=t.owner),t.label&&(e.label=t.label);let n=await b$1(j,{input:e});i(`Channel created: ${n.subCreateChannel.address}`),h(t,n.subCreateChannel);}catch(e){g(e);}}),i$1.command("verify").description("Mark a channel as verified").argument("<id>","Channel ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(K,{id:t});i(`Channel verified: ${n.subVerifyChannel.address}`),h(e,n.subVerifyChannel);}catch(n){g(n);}});}function bt(d){let i$1=d.command("inbox").description("SubscriberBot universal inbox (merged subscription communications)");i$1.command("list").description("List inbox messages").option("--category <c>","Filter by message category").option("--channel <id>","Filter by channel ID").option("--relationship <id>","Filter by relationship ID").option("--unread-only","Only unread messages").option("--limit <n>","Page size",p,50).option("--offset <n>","Offset",p,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(J,{category:t.category?t.category.toUpperCase():void 0,channelId:t.channel,relationshipId:t.relationship,unreadOnly:t.unreadOnly?!0:void 0,pagination:{limit:t.limit,offset:t.offset}});h(t,e.subListInboxMessages.items,{headers:["ID","Subject","Category","Read","Action","Received"],rows:e.subListInboxMessages.items.map(n=>[p$1(n.id,12),p$1(n.subject??"-",30),n.category,n.isRead?"yes":"no",n.actionRequired?"yes":"no",o$1(n.receivedAt)])});}catch(e){g(e);}}),i$1.command("ingest").description("Ingest a message into the universal inbox").requiredOption("--channel <id>","Channel ID").requiredOption("--received-at <iso>","Received at (ISO date)").option("--category <c>","Message category","OTHER").option("--relationship <id>","Relationship ID").option("--subject <s>","Subject").option("--preview <s>","Preview text").option("--external-id <id>","External message ID").option("--category-confidence <n>","Category confidence (0-100)",p).option("--action-required","Flag as action required").option("-f, --format <format>","Output format").action(async t=>{try{let e={channelId:t.channel,receivedAt:t.receivedAt,category:(t.category??"OTHER").toUpperCase(),actionRequired:t.actionRequired===!0};t.relationship&&(e.relationshipId=t.relationship),t.subject&&(e.subject=t.subject),t.preview&&(e.preview=t.preview),t.externalId&&(e.externalId=t.externalId),t.categoryConfidence!==void 0&&(e.categoryConfidence=t.categoryConfidence);let n=await b$1(z,{input:e});i(`Message ingested: ${n.subIngestMessage.id}`),h(t,n.subIngestMessage);}catch(e){g(e);}}),i$1.command("mark-read").description("Mark a message as read").argument("<id>","Message ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(Q,{id:t});i(`Message ${t} marked read`),h(e,n.subMarkMessageRead);}catch(n){g(n);}});}function It(d){let i$1=d.command("agents").description("SubscriberBot AI agents & their automation policies");i$1.command("list").description("List AI agents").option("--kind <k>","Filter by agent kind").option("--owner <id>","Filter by owner ID").option("--status <s>","Filter by agent status").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(Z,{kind:t.kind?t.kind.toUpperCase():void 0,ownerId:t.owner,status:t.status?t.status.toUpperCase():void 0});h(t,e.subListAgents,{headers:["ID","Name","Kind","Status","Description"],rows:e.subListAgents.map(n=>[p$1(n.id,12),n.name,n.kind,n.status,p$1(n.description??"-",30)])});}catch(e){g(e);}}),i$1.command("get").description("Get an agent by id").argument("<id>","Agent ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(X,{id:t});if(!n.subAgent)throw new o(`Agent ${t} not found`);h(e,n.subAgent);}catch(n){g(n);}}),i$1.command("create").description("Create an AI agent").requiredOption("--name <name>","Agent name").option("--kind <k>","Agent kind","DISCOVERY").option("--status <s>","Agent status","SUGGEST_ONLY").option("--owner <id>","Owner ID").option("--description <s>","Description").option("--config <json>","Agent config JSON").option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name,kind:(t.kind??"DISCOVERY").toUpperCase(),status:(t.status??"SUGGEST_ONLY").toUpperCase()};t.owner&&(e.ownerId=t.owner),t.description&&(e.description=t.description),t.config&&(e.config=y("config",t.config));let n=await b$1(tt,{input:e});i(`Agent created: ${n.subCreateAgent.name}`),h(t,n.subCreateAgent);}catch(e){g(e);}}),i$1.command("set-status").description("Change an agent's operating posture").argument("<id>","Agent ID").requiredOption("--status <s>","DISABLED|SUGGEST_ONLY|AUTONOMOUS").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(et,{id:t,status:e.status.toUpperCase()});i(`Agent status set to ${n.subSetAgentStatus.status}`),h(e,n.subSetAgentStatus);}catch(n){g(n);}}),i$1.command("list-policies").description("List policies (optionally filtered by agent)").option("--agent <id>","Filter by agent ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(nt,{agentId:t.agent});h(t,e.subListPolicies,{headers:["ID","Name","Action","Enabled","Triggers"],rows:e.subListPolicies.map(n=>[p$1(n.id,12),n.name,n.action,n.isEnabled?"yes":"no",String(n.triggerCount??0)])});}catch(e){g(e);}}),i$1.command("create-policy").description("Create an automation policy for an agent").requiredOption("--agent <id>","Agent ID").requiredOption("--name <name>","Policy name").option("--action <a>","Policy action","ALERT").option("--description <s>","Description").option("--condition <json>","Condition JSON").option("--no-enabled","Create disabled").option("-f, --format <format>","Output format").action(async t=>{try{let e={agentId:t.agent,name:t.name,action:(t.action??"ALERT").toUpperCase(),isEnabled:t.enabled!==!1};t.description&&(e.description=t.description),t.condition&&(e.condition=y("condition",t.condition));let n=await b$1(it,{input:e});i(`Policy created: ${n.subCreatePolicy.name}`),h(t,n.subCreatePolicy);}catch(e){g(e);}});}function yt(d){let i$1=d.command("workflows").description("SubscriberBot automation workflows");i$1.command("list").description("List workflows").option("--status <s>","Filter by workflow status").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(rt,{status:t.status?t.status.toUpperCase():void 0});h(t,e.subListWorkflows,{headers:["ID","Name","Trigger","Status","Runs"],rows:e.subListWorkflows.map(n=>[p$1(n.id,12),n.name,n.triggerEvent,n.status,String(n.runCount??0)])});}catch(e){g(e);}}),i$1.command("create").description("Create a workflow").requiredOption("--name <name>","Workflow name").requiredOption("--trigger-event <e>","Trigger event").option("--description <s>","Description").option("--steps <json>","Steps JSON").option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name,triggerEvent:t.triggerEvent};t.description&&(e.description=t.description),t.steps&&(e.steps=y("steps",t.steps));let n=await b$1(st,{input:e});i(`Workflow created: ${n.subCreateWorkflow.name}`),h(t,n.subCreateWorkflow);}catch(e){g(e);}}),i$1.command("activate").description("Activate a workflow").argument("<id>","Workflow ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(ot,{id:t});i(`Workflow activated: ${n.subActivateWorkflow.name}`),h(e,n.subActivateWorkflow);}catch(n){g(n);}});}function ht(d$1){d$1.command("health").description("SubscriberBot service health check (public)").option("-f, --format <format>","Output format").action(async i$1=>{try{let t=await d(at);i(t.subHealth),h(i$1,{health:t.subHealth});}catch(t){g(t);}});}var At={id:"subscriberbot",version:"1.0.0",displayName:"SubscriberBot",dependsOn:["auth","workspaces"],register(d,i){a(i);let t=d.command("subscriberbot").description("SubscriberBot universal subscription & relationship management");dt(t),ut(t),pt(t),ct(t),mt(t),lt(t),gt(t),ft(t),bt(t),It(t),yt(t),ht(t);}},we=At;export{we as default};
|
|
349
|
+
`;function y(u,i){try{return JSON.parse(i)}catch{throw new o(`--${u} must be valid JSON`)}}function p(u){let i=Number.parseInt(u,10);if(Number.isNaN(i))throw new o(`Expected an integer but got "${u}"`);return i}function b(u){let i=Number.parseFloat(u);if(Number.isNaN(i))throw new o(`Expected a number but got "${u}"`);return i}function I(u){return u.split(",").map(i=>i.trim()).filter(i=>i.length>0)}function ut(u){let i$1=u.command("providers").description("SubscriberBot provider registry (vendors / publishers / services)");i$1.command("list").description("List / search providers in the registry").option("--category <c>","Filter by provider category").option("--status <s>","Filter by provider status").option("--search <q>","Free-text search").option("--limit <n>","Page size",p,50).option("--offset <n>","Offset",p,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(R,{category:t.category?t.category.toUpperCase():void 0,status:t.status?t.status.toUpperCase():void 0,search:t.search,pagination:{limit:t.limit,offset:t.offset}});i(t,e.subListProviders.items,{headers:["ID","Name","Category","Status","Region","Churn"],rows:e.subListProviders.items.map(n=>[r(n.id,12),n.name,n.category,n.status,n.region??"-",n.churnRiskScore!=null?String(n.churnRiskScore):"-"])});}catch(e){h(e);}}),i$1.command("get").description("Get a provider by id").argument("<id>","Provider ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(C,{id:t});if(!n.subProvider)throw new o(`Provider ${t} not found`);i(e,n.subProvider);}catch(n){h(n);}}),i$1.command("create").description("Create a provider").requiredOption("--name <name>","Provider name").option("--category <c>","Provider category","OTHER").option("--status <s>","Provider status","UNVERIFIED").option("--slug <slug>","URL slug").option("--description <s>","Description").option("--industry <s>","Industry").option("--language <s>","Language").option("--region <s>","Region").option("--website-url <url>","Website URL").option("--logo-file-id <id>","Logo file ID").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name,category:(t.category??"OTHER").toUpperCase(),status:(t.status??"UNVERIFIED").toUpperCase()};t.slug&&(e.slug=t.slug),t.description&&(e.description=t.description),t.industry&&(e.industry=t.industry),t.language&&(e.language=t.language),t.region&&(e.region=t.region),t.websiteUrl&&(e.websiteUrl=t.websiteUrl),t.logoFileId&&(e.logoFileId=t.logoFileId),t.tags&&(e.tags=I(t.tags));let n=await b$1(S,{input:e});k$1(`Provider created: ${n.subCreateProvider.name}`),i(t,n.subCreateProvider);}catch(e){h(e);}}),i$1.command("update").description("Update a provider").argument("<id>","Provider ID").option("--name <name>","Provider name").option("--category <c>","Provider category").option("--status <s>","Provider status").option("--slug <slug>","URL slug").option("--description <s>","Description").option("--industry <s>","Industry").option("--language <s>","Language").option("--region <s>","Region").option("--website-url <url>","Website URL").option("--logo-file-id <id>","Logo file ID").option("--churn-risk-score <n>","Churn risk score",p).option("--vendor-health-score <n>","Vendor health score",p).option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.name&&(n.name=e.name),e.category&&(n.category=e.category.toUpperCase()),e.status&&(n.status=e.status.toUpperCase()),e.slug&&(n.slug=e.slug),e.description!==void 0&&(n.description=e.description),e.industry&&(n.industry=e.industry),e.language&&(n.language=e.language),e.region&&(n.region=e.region),e.websiteUrl&&(n.websiteUrl=e.websiteUrl),e.logoFileId&&(n.logoFileId=e.logoFileId),e.churnRiskScore!==void 0&&(n.churnRiskScore=e.churnRiskScore),e.vendorHealthScore!==void 0&&(n.vendorHealthScore=e.vendorHealthScore),e.tags&&(n.tags=I(e.tags)),!Object.keys(n).length)throw new o("No updates specified");let h=await b$1(v,{id:t,input:n});k$1("Provider updated"),i(e,h.subUpdateProvider);}catch(n){h(n);}}),i$1.command("archive").description("Archive (soft-delete) a provider").argument("<id>","Provider ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(E,{id:t});k$1(`Provider ${t} archived`),i(e,{archived:n.subArchiveProvider});}catch(n){h(n);}});}function dt(u){let i$1=u.command("plans").description("SubscriberBot provider plans");i$1.command("list").description("List plans (optionally filtered by provider)").option("--provider <id>","Filter by provider ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(k,{providerId:t.provider});i(t,e.subListPlans.items,{headers:["ID","Name","Amount","Currency","Interval","Active"],rows:e.subListPlans.items.map(n=>[r(n.id,12),n.name,String(n.amount),n.currency,n.interval,n.isActive?"yes":"no"])});}catch(e){h(e);}}),i$1.command("create").description("Create a plan for a provider").requiredOption("--provider <id>","Provider ID").requiredOption("--name <name>","Plan name").option("--amount <n>","Amount",b).option("--currency <c>","Currency code").option("--interval <i>","Billing interval","MONTHLY").option("--description <s>","Description").option("--features <csv>","Comma-separated feature list").option("-f, --format <format>","Output format").action(async t=>{try{let e={providerId:t.provider,name:t.name,interval:(t.interval??"MONTHLY").toUpperCase()};t.amount!==void 0&&(e.amount=t.amount),t.currency&&(e.currency=t.currency),t.description&&(e.description=t.description),t.features&&(e.features=I(t.features));let n=await b$1(O,{input:e});k$1(`Plan created: ${n.subCreatePlan.name}`),i(t,n.subCreatePlan);}catch(e){h(e);}});}function pt(u){let i$1=u.command("relationships").description("SubscriberBot subscriptions, memberships & recurring relationships");i$1.command("list").description("List relationships").option("--kind <k>","Filter by relationship kind").option("--owner <id>","Filter by owner ID").option("--provider <id>","Filter by provider ID").option("--status <s>","Filter by relationship status").option("--limit <n>","Page size",p,50).option("--offset <n>","Offset",p,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(T,{kind:t.kind?t.kind.toUpperCase():void 0,ownerId:t.owner,providerId:t.provider,status:t.status?t.status.toUpperCase():void 0,pagination:{limit:t.limit,offset:t.offset}});i(t,e.subListRelationships.items,{headers:["ID","Label","Kind","Status","Amount","Renews"],rows:e.subListRelationships.items.map(n=>[r(n.id,12),n.label,n.kind,n.status,`${n.amount} ${n.currency}`,q$1(n.renewsAt)])});}catch(e){h(e);}}),i$1.command("get").description("Get a relationship by id").argument("<id>","Relationship ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(L,{id:t});if(!n.subRelationship)throw new o(`Relationship ${t} not found`);i(e,n.subRelationship);}catch(n){h(n);}}),i$1.command("create").description("Create a relationship (subscription / membership / \u2026)").requiredOption("--label <label>","Human-readable label").option("--kind <k>","Relationship kind","SUBSCRIPTION").option("--status <s>","Relationship status","ACTIVE").option("--owner <id>","Owner ID").option("--provider <id>","Provider ID").option("--plan <id>","Plan ID").option("--amount <n>","Amount",b).option("--currency <c>","Currency code").option("--interval <i>","Billing interval","MONTHLY").option("--discovery-source <s>","Discovery source","MANUAL").option("--no-auto-renew","Disable auto-renew").option("--notes <s>","Notes").option("--tags <csv>","Comma-separated tags").option("--started-at <iso>","Started at (ISO date)").option("--renews-at <iso>","Renews at (ISO date)").option("--trial-ends-at <iso>","Trial end (ISO date)").option("-f, --format <format>","Output format").action(async t=>{try{let e={label:t.label,kind:(t.kind??"SUBSCRIPTION").toUpperCase(),status:(t.status??"ACTIVE").toUpperCase(),interval:(t.interval??"MONTHLY").toUpperCase(),discoverySource:(t.discoverySource??"MANUAL").toUpperCase(),autoRenew:t.autoRenew!==!1};t.owner&&(e.ownerId=t.owner),t.provider&&(e.providerId=t.provider),t.plan&&(e.planId=t.plan),t.amount!==void 0&&(e.amount=t.amount),t.currency&&(e.currency=t.currency),t.notes&&(e.notes=t.notes),t.tags&&(e.tags=I(t.tags)),t.startedAt&&(e.startedAt=t.startedAt),t.renewsAt&&(e.renewsAt=t.renewsAt),t.trialEndsAt&&(e.trialEndsAt=t.trialEndsAt);let n=await b$1(P,{input:e});k$1(`Relationship created: ${n.subCreateRelationship.label}`),i(t,n.subCreateRelationship);}catch(e){h(e);}}),i$1.command("update").description("Update a relationship").argument("<id>","Relationship ID").option("--label <label>","Label").option("--kind <k>","Relationship kind").option("--provider <id>","Provider ID").option("--plan <id>","Plan ID").option("--amount <n>","Amount",b).option("--currency <c>","Currency code").option("--interval <i>","Billing interval").option("--auto-renew <bool>","true|false",t=>t==="true").option("--health-score <n>","Health score",p).option("--notes <s>","Notes").option("--tags <csv>","Comma-separated tags").option("--started-at <iso>","Started at (ISO date)").option("--renews-at <iso>","Renews at (ISO date)").option("--trial-ends-at <iso>","Trial end (ISO date)").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.label&&(n.label=e.label),e.kind&&(n.kind=e.kind.toUpperCase()),e.provider&&(n.providerId=e.provider),e.plan&&(n.planId=e.plan),e.amount!==void 0&&(n.amount=e.amount),e.currency&&(n.currency=e.currency),e.interval&&(n.interval=e.interval.toUpperCase()),e.autoRenew!==void 0&&(n.autoRenew=e.autoRenew),e.healthScore!==void 0&&(n.healthScore=e.healthScore),e.notes!==void 0&&(n.notes=e.notes),e.tags&&(n.tags=I(e.tags)),e.startedAt&&(n.startedAt=e.startedAt),e.renewsAt&&(n.renewsAt=e.renewsAt),e.trialEndsAt&&(n.trialEndsAt=e.trialEndsAt),!Object.keys(n).length)throw new o("No updates specified");let h=await b$1(D,{id:t,input:n});k$1("Relationship updated"),i(e,h.subUpdateRelationship);}catch(n){h(n);}}),i$1.command("cancel").description("Cancel a relationship").argument("<id>","Relationship ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1($,{id:t});k$1(`Relationship cancelled: ${n.subCancelRelationship.label}`),i(e,n.subCancelRelationship);}catch(n){h(n);}}),i$1.command("transition").description("Advance a relationship through its lifecycle").argument("<id>","Relationship ID").requiredOption("--status <s>","ACTIVE|TRIAL|PAST_DUE|PAUSED|CANCELLED|EXPIRED|LAPSED").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(x,{id:t,status:e.status.toUpperCase()});k$1(`Relationship status set to ${n.subTransitionRelationship.status}`),i(e,n.subTransitionRelationship);}catch(n){h(n);}}),i$1.command("renewals").description("List renewal events").option("--relationship <id>","Filter by relationship ID").option("--upcoming-only","Only upcoming events").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(N,{relationshipId:t.relationship,upcomingOnly:t.upcomingOnly?!0:void 0});i(t,e.subListRenewalEvents.items,{headers:["ID","Relationship","Type","Amount","Occurs","Notified"],rows:e.subListRenewalEvents.items.map(n=>[r(n.id,12),r(n.relationshipId,12),n.eventType,n.amount!=null?`${n.amount} ${n.currency??""}`.trim():"-",q$1(n.occursAt),n.notified?"yes":"no"])});}catch(e){h(e);}});}function ct(u){let i$1=u.command("assets").description("SubscriberBot relationship assets (contracts, licenses, credentials, \u2026)");i$1.command("list").description("List assets for a relationship").requiredOption("--relationship <id>","Relationship ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(M,{relationshipId:t.relationship});i(t,e.subListAssets.items,{headers:["ID","Name","Type","Secret","Expires"],rows:e.subListAssets.items.map(n=>[r(n.id,12),n.name,n.type,n.secretRef?"yes":"no",q$1(n.expiresAt)])});}catch(e){h(e);}}),i$1.command("create").description("Create an asset on a relationship").requiredOption("--relationship <id>","Relationship ID").requiredOption("--name <name>","Asset name").option("--type <t>","Asset type","RECEIPT").option("--file-id <id>","Referenced file ID (blob lives in wspace-files-svc)").option("--secret-ref <ref>","Secret reference").option("--expires-at <iso>","Expiry (ISO date)").option("-f, --format <format>","Output format").action(async t=>{try{let e={relationshipId:t.relationship,name:t.name,type:(t.type??"RECEIPT").toUpperCase()};t.fileId&&(e.fileId=t.fileId),t.secretRef&&(e.secretRef=t.secretRef),t.expiresAt&&(e.expiresAt=t.expiresAt);let n=await b$1(_,{input:e});k$1(`Asset created: ${n.subCreateAsset.name}`),i(t,n.subCreateAsset);}catch(e){h(e);}});}function mt(u){let i$1=u.command("entitlements").description("SubscriberBot relationship entitlements (seats, quotas, features, \u2026)");i$1.command("list").description("List entitlements for a relationship").requiredOption("--relationship <id>","Relationship ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(U,{relationshipId:t.relationship});i(t,e.subListEntitlements.items,{headers:["ID","Name","Type","Used","Quota","Active"],rows:e.subListEntitlements.items.map(n=>[r(n.id,12),n.name,n.type,String(n.used),n.quota!=null?String(n.quota):"-",n.isActive?"yes":"no"])});}catch(e){h(e);}}),i$1.command("create").description("Create an entitlement on a relationship").requiredOption("--relationship <id>","Relationship ID").requiredOption("--name <name>","Entitlement name").option("--type <t>","Entitlement type","FEATURE_ACCESS").option("--description <s>","Description").option("--quota <n>","Quota",p).option("--unit <u>","Quota unit").option("-f, --format <format>","Output format").action(async t=>{try{let e={relationshipId:t.relationship,name:t.name,type:(t.type??"FEATURE_ACCESS").toUpperCase()};t.description&&(e.description=t.description),t.quota!==void 0&&(e.quota=t.quota),t.unit&&(e.unit=t.unit);let n=await b$1(q,{input:e});k$1(`Entitlement created: ${n.subCreateEntitlement.name}`),i(t,n.subCreateEntitlement);}catch(e){h(e);}});}function lt(u){let i$1=u.command("invoices").description("SubscriberBot invoices");i$1.command("list").description("List invoices").option("--relationship <id>","Filter by relationship ID").option("--status <s>","Filter by invoice status").option("--limit <n>","Page size",p,50).option("--offset <n>","Offset",p,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(W,{relationshipId:t.relationship,status:t.status?t.status.toUpperCase():void 0,pagination:{limit:t.limit,offset:t.offset}});i(t,e.subListInvoices.items,{headers:["ID","Number","Status","Total","Currency","Due"],rows:e.subListInvoices.items.map(n=>[r(n.id,12),n.number??"-",n.status,String(n.total),n.currency,q$1(n.dueDate)])});}catch(e){h(e);}}),i$1.command("create").description("Create an invoice on a relationship").requiredOption("--relationship <id>","Relationship ID").option("--number <n>","Invoice number").option("--status <s>","Invoice status","ISSUED").option("--currency <c>","Currency code").option("--subtotal <n>","Subtotal",b).option("--tax-amount <n>","Tax amount",b).option("--total <n>","Total",b).option("--line-items <json>","Line items JSON").option("--issue-date <iso>","Issue date (ISO date)").option("--due-date <iso>","Due date (ISO date)").option("--payment-instrument <id>","Payment instrument ID").option("--file-id <id>","Referenced file ID (invoice PDF in wspace-files-svc)").option("-f, --format <format>","Output format").action(async t=>{try{let e={relationshipId:t.relationship,status:(t.status??"ISSUED").toUpperCase()};t.number&&(e.number=t.number),t.currency&&(e.currency=t.currency),t.subtotal!==void 0&&(e.subtotal=t.subtotal),t.taxAmount!==void 0&&(e.taxAmount=t.taxAmount),t.total!==void 0&&(e.total=t.total),t.lineItems&&(e.lineItems=y("line-items",t.lineItems)),t.issueDate&&(e.issueDate=t.issueDate),t.dueDate&&(e.dueDate=t.dueDate),t.paymentInstrument&&(e.paymentInstrumentId=t.paymentInstrument),t.fileId&&(e.fileId=t.fileId);let n=await b$1(H,{input:e});k$1(`Invoice created: ${n.subCreateInvoice.number??n.subCreateInvoice.id}`),i(t,n.subCreateInvoice);}catch(e){h(e);}}),i$1.command("mark-paid").description("Mark an invoice as paid").argument("<id>","Invoice ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(F,{id:t});k$1(`Invoice marked paid: ${n.subMarkInvoicePaid.number??n.subMarkInvoicePaid.id}`),i(e,n.subMarkInvoicePaid);}catch(n){h(n);}});}function gt(u){let i$1=u.command("payment-instruments").description("SubscriberBot payment instruments (cards, wallets, bank accounts, \u2026)");i$1.command("list").description("List payment instruments").option("--owner <id>","Filter by owner ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(V,{ownerId:t.owner});i(t,e.subListPaymentInstruments.items,{headers:["ID","Label","Type","Status","Brand","Last4","Default"],rows:e.subListPaymentInstruments.items.map(n=>[r(n.id,12),n.label,n.type,n.status,n.brand??"-",n.last4??"-",n.isDefault?"yes":"no"])});}catch(e){h(e);}}),i$1.command("create").description("Add a payment instrument").requiredOption("--label <label>","Label").option("--type <t>","Payment instrument type","CARD").option("--owner <id>","Owner ID").option("--brand <b>","Card/instrument brand").option("--last4 <n>","Last 4 digits").option("--expiry-month <n>","Expiry month",p).option("--expiry-year <n>","Expiry year",p).option("--processor-token <t>","Processor token").option("--default","Mark as default").option("-f, --format <format>","Output format").action(async t=>{try{let e={label:t.label,type:(t.type??"CARD").toUpperCase(),isDefault:t.default===!0};t.owner&&(e.ownerId=t.owner),t.brand&&(e.brand=t.brand),t.last4&&(e.last4=t.last4),t.expiryMonth!==void 0&&(e.expiryMonth=t.expiryMonth),t.expiryYear!==void 0&&(e.expiryYear=t.expiryYear),t.processorToken&&(e.processorToken=t.processorToken);let n=await b$1(G,{input:e});k$1(`Payment instrument added: ${n.subCreatePaymentInstrument.label}`),i(t,n.subCreatePaymentInstrument);}catch(e){h(e);}}),i$1.command("remove").description("Remove a payment instrument").argument("<id>","Payment instrument ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(B,{id:t});k$1(`Payment instrument ${t} removed`),i(e,{removed:n.subRemovePaymentInstrument});}catch(n){h(n);}});}function ft(u){let i$1=u.command("channels").description("SubscriberBot communication channels (email, sms, slack, webhook, \u2026)");i$1.command("list").description("List communication channels").option("--owner <id>","Filter by owner ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(Y,{ownerId:t.owner});i(t,e.subListChannels.items,{headers:["ID","Type","Address","Label","Status","Ingest"],rows:e.subListChannels.items.map(n=>[r(n.id,12),n.type,n.address,n.label??"-",n.status,n.ingestEnabled?"yes":"no"])});}catch(e){h(e);}}),i$1.command("create").description("Create a communication channel").requiredOption("--address <addr>","Channel address (email, phone, webhook URL, \u2026)").option("--type <t>","Channel type","EMAIL").option("--owner <id>","Owner ID").option("--label <label>","Label").option("--no-ingest","Disable message ingestion").option("-f, --format <format>","Output format").action(async t=>{try{let e={address:t.address,type:(t.type??"EMAIL").toUpperCase(),ingestEnabled:t.ingest!==!1};t.owner&&(e.ownerId=t.owner),t.label&&(e.label=t.label);let n=await b$1(j,{input:e});k$1(`Channel created: ${n.subCreateChannel.address}`),i(t,n.subCreateChannel);}catch(e){h(e);}}),i$1.command("verify").description("Mark a channel as verified").argument("<id>","Channel ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(K,{id:t});k$1(`Channel verified: ${n.subVerifyChannel.address}`),i(e,n.subVerifyChannel);}catch(n){h(n);}});}function bt(u){let i$1=u.command("inbox").description("SubscriberBot universal inbox (merged subscription communications)");i$1.command("list").description("List inbox messages").option("--category <c>","Filter by message category").option("--channel <id>","Filter by channel ID").option("--relationship <id>","Filter by relationship ID").option("--unread-only","Only unread messages").option("--limit <n>","Page size",p,50).option("--offset <n>","Offset",p,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(J,{category:t.category?t.category.toUpperCase():void 0,channelId:t.channel,relationshipId:t.relationship,unreadOnly:t.unreadOnly?!0:void 0,pagination:{limit:t.limit,offset:t.offset}});i(t,e.subListInboxMessages.items,{headers:["ID","Subject","Category","Read","Action","Received"],rows:e.subListInboxMessages.items.map(n=>[r(n.id,12),r(n.subject??"-",30),n.category,n.isRead?"yes":"no",n.actionRequired?"yes":"no",q$1(n.receivedAt)])});}catch(e){h(e);}}),i$1.command("ingest").description("Ingest a message into the universal inbox").requiredOption("--channel <id>","Channel ID").requiredOption("--received-at <iso>","Received at (ISO date)").option("--category <c>","Message category","OTHER").option("--relationship <id>","Relationship ID").option("--subject <s>","Subject").option("--preview <s>","Preview text").option("--external-id <id>","External message ID").option("--category-confidence <n>","Category confidence (0-100)",p).option("--action-required","Flag as action required").option("-f, --format <format>","Output format").action(async t=>{try{let e={channelId:t.channel,receivedAt:t.receivedAt,category:(t.category??"OTHER").toUpperCase(),actionRequired:t.actionRequired===!0};t.relationship&&(e.relationshipId=t.relationship),t.subject&&(e.subject=t.subject),t.preview&&(e.preview=t.preview),t.externalId&&(e.externalId=t.externalId),t.categoryConfidence!==void 0&&(e.categoryConfidence=t.categoryConfidence);let n=await b$1(z,{input:e});k$1(`Message ingested: ${n.subIngestMessage.id}`),i(t,n.subIngestMessage);}catch(e){h(e);}}),i$1.command("mark-read").description("Mark a message as read").argument("<id>","Message ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(Q,{id:t});k$1(`Message ${t} marked read`),i(e,n.subMarkMessageRead);}catch(n){h(n);}});}function It(u){let i$1=u.command("agents").description("SubscriberBot AI agents & their automation policies");i$1.command("list").description("List AI agents").option("--kind <k>","Filter by agent kind").option("--owner <id>","Filter by owner ID").option("--status <s>","Filter by agent status").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(Z,{kind:t.kind?t.kind.toUpperCase():void 0,ownerId:t.owner,status:t.status?t.status.toUpperCase():void 0});i(t,e.subListAgents.items,{headers:["ID","Name","Kind","Status","Description"],rows:e.subListAgents.items.map(n=>[r(n.id,12),n.name,n.kind,n.status,r(n.description??"-",30)])});}catch(e){h(e);}}),i$1.command("get").description("Get an agent by id").argument("<id>","Agent ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(X,{id:t});if(!n.subAgent)throw new o(`Agent ${t} not found`);i(e,n.subAgent);}catch(n){h(n);}}),i$1.command("create").description("Create an AI agent").requiredOption("--name <name>","Agent name").option("--kind <k>","Agent kind","DISCOVERY").option("--status <s>","Agent status","SUGGEST_ONLY").option("--owner <id>","Owner ID").option("--description <s>","Description").option("--config <json>","Agent config JSON").option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name,kind:(t.kind??"DISCOVERY").toUpperCase(),status:(t.status??"SUGGEST_ONLY").toUpperCase()};t.owner&&(e.ownerId=t.owner),t.description&&(e.description=t.description),t.config&&(e.config=y("config",t.config));let n=await b$1(tt,{input:e});k$1(`Agent created: ${n.subCreateAgent.name}`),i(t,n.subCreateAgent);}catch(e){h(e);}}),i$1.command("set-status").description("Change an agent's operating posture").argument("<id>","Agent ID").requiredOption("--status <s>","DISABLED|SUGGEST_ONLY|AUTONOMOUS").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(et,{id:t,status:e.status.toUpperCase()});k$1(`Agent status set to ${n.subSetAgentStatus.status}`),i(e,n.subSetAgentStatus);}catch(n){h(n);}}),i$1.command("list-policies").description("List policies (optionally filtered by agent)").option("--agent <id>","Filter by agent ID").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(nt,{agentId:t.agent});i(t,e.subListPolicies.items,{headers:["ID","Name","Action","Enabled","Triggers"],rows:e.subListPolicies.items.map(n=>[r(n.id,12),n.name,n.action,n.isEnabled?"yes":"no",String(n.triggerCount??0)])});}catch(e){h(e);}}),i$1.command("create-policy").description("Create an automation policy for an agent").requiredOption("--agent <id>","Agent ID").requiredOption("--name <name>","Policy name").option("--action <a>","Policy action","ALERT").option("--description <s>","Description").option("--condition <json>","Condition JSON").option("--no-enabled","Create disabled").option("-f, --format <format>","Output format").action(async t=>{try{let e={agentId:t.agent,name:t.name,action:(t.action??"ALERT").toUpperCase(),isEnabled:t.enabled!==!1};t.description&&(e.description=t.description),t.condition&&(e.condition=y("condition",t.condition));let n=await b$1(it,{input:e});k$1(`Policy created: ${n.subCreatePolicy.name}`),i(t,n.subCreatePolicy);}catch(e){h(e);}});}function yt(u){let i$1=u.command("workflows").description("SubscriberBot automation workflows");i$1.command("list").description("List workflows").option("--status <s>","Filter by workflow status").option("-f, --format <format>","Output format").action(async t=>{try{let e=await b$1(rt,{status:t.status?t.status.toUpperCase():void 0});i(t,e.subListWorkflows.items,{headers:["ID","Name","Trigger","Status","Runs"],rows:e.subListWorkflows.items.map(n=>[r(n.id,12),n.name,n.triggerEvent,n.status,String(n.runCount??0)])});}catch(e){h(e);}}),i$1.command("create").description("Create a workflow").requiredOption("--name <name>","Workflow name").requiredOption("--trigger-event <e>","Trigger event").option("--description <s>","Description").option("--steps <json>","Steps JSON").option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name,triggerEvent:t.triggerEvent};t.description&&(e.description=t.description),t.steps&&(e.steps=y("steps",t.steps));let n=await b$1(st,{input:e});k$1(`Workflow created: ${n.subCreateWorkflow.name}`),i(t,n.subCreateWorkflow);}catch(e){h(e);}}),i$1.command("activate").description("Activate a workflow").argument("<id>","Workflow ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await b$1(ot,{id:t});k$1(`Workflow activated: ${n.subActivateWorkflow.name}`),i(e,n.subActivateWorkflow);}catch(n){h(n);}});}function ht(u){u.command("health").description("SubscriberBot service health check (public)").option("-f, --format <format>","Output format").action(async i$1=>{try{let t=await d(at);k$1(t.subHealth),i(i$1,{health:t.subHealth});}catch(t){h(t);}});}var At={id:"subscriberbot",version:"1.0.0",displayName:"SubscriberBot",dependsOn:["auth","workspaces"],register(u,i){a(i);let t=u.command("subscriberbot").description("SubscriberBot universal subscription & relationship management");ut(t),dt(t),pt(t),ct(t),mt(t),lt(t),gt(t),ft(t),bt(t),It(t),yt(t),ht(t);}},we=At;export{we as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var c=class extends Error{exitCode;hint;constructor(o,s){super(o),this.name="CliUserError",this.exitCode=s?.exitCode??1,this.hint=s?.hint;}};var l=class extends Error{cause;constructor(o,s){super(o),this.name="CliInternalError",this.cause=s;}};var k=null;function
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var c=class extends Error{exitCode;hint;constructor(o,s){super(o),this.name="CliUserError",this.exitCode=s?.exitCode??1,this.hint=s?.hint;}};var l=class extends Error{cause;constructor(o,s){super(o),this.name="CliInternalError",this.cause=s;}};var k=null;function x(t){k=t;}function d(){if(!k)throw new l("vibecontrols module helpers used before setHelpersContext was called");return k}async function u(t,o){return d().gql.global.request(t,o)}function p(t){let o=t instanceof Error?t.message:String(t);throw new c(o)}function g(t,o,s){d().output.formatAndOutput(t,o,s);}function f(t){d().output.printSuccess(t);}function y(t){return d().output.formatStatus(t)}function T(t){return d().output.formatDate(t)}function m(t,o){return d().output.truncate(t,o)}var b=`
|
|
2
2
|
query ListSupportTickets($filter: SupportTicketFilterInput, $limit: Int, $offset: Int) {
|
|
3
3
|
supportTickets(filter: $filter, limit: $limit, offset: $offset) {
|
|
4
4
|
nodes { id ticketNumber subject status priority category createdAt }
|
|
@@ -42,4 +42,4 @@
|
|
|
42
42
|
id title slug helpfulnessScore
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
`;function R(t){let o=t.command("support").description("Support tickets & knowledge base"),s=o.command("tickets").description("Manage support tickets");s.command("list").description("List support tickets").option("--status <s>").option("--priority <p>").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>").action(async e=>{try{let n={};e.status&&(n.status=e.status.toUpperCase()),e.priority&&(n.priority=e.priority.toUpperCase());let r=await u(b,{filter:Object.keys(n).length?n:void 0,limit:e.limit,offset:0});g(e,r.supportTickets.nodes,{headers:["#","Subject","Status","Priority","Category","Created"],rows:r.supportTickets.nodes.map(a=>[a.ticketNumber??m(a.id,8),m(a.subject??"-",40),
|
|
45
|
+
`;function R(t){let o=t.command("support").description("Support tickets & knowledge base"),s=o.command("tickets").description("Manage support tickets");s.command("list").description("List support tickets").option("--status <s>").option("--priority <p>").option("--limit <n>","Page size",e=>parseInt(e,10),50).option("-f, --format <format>").action(async e=>{try{let n={};e.status&&(n.status=e.status.toUpperCase()),e.priority&&(n.priority=e.priority.toUpperCase());let r=await u(b,{filter:Object.keys(n).length?n:void 0,limit:e.limit,offset:0});g(e,r.supportTickets.nodes,{headers:["#","Subject","Status","Priority","Category","Created"],rows:r.supportTickets.nodes.map(a=>[a.ticketNumber??m(a.id,8),m(a.subject??"-",40),y(a.status),a.priority??"-",a.category??"-",T(a.createdAt)])});}catch(n){p(n);}}),s.command("get").description("Get a support ticket").argument("<id>").option("-f, --format <format>").action(async(e,n)=>{try{let r=await u(E,{id:e});if(!r.supportTicket)throw new c(`Ticket ${e} not found`);g(n,r.supportTicket);}catch(r){p(r);}}),s.command("create").description("Open a support ticket").requiredOption("--subject <s>").requiredOption("--description <s>").option("--priority <p>","LOW|NORMAL|HIGH|URGENT","NORMAL").option("--category <c>","TECHNICAL_SUPPORT|BILLING|FEATURE_REQUEST|OTHER","TECHNICAL_SUPPORT").option("-f, --format <format>").action(async e=>{try{let n={subject:e.subject,description:e.description,priority:(e.priority??"NORMAL").toUpperCase(),category:(e.category??"TECHNICAL_SUPPORT").toUpperCase()},r=await u(I,{input:n});f(`Ticket created: ${r.createSupportTicket.ticketNumber??r.createSupportTicket.id}`),g(e,r.createSupportTicket);}catch(n){p(n);}}),s.command("comment").description("Add a comment to a ticket").argument("<ticketId>").requiredOption("--message <s>").option("--internal","Internal staff-only comment",false).action(async(e,n)=>{try{let r={ticketId:e,message:n.message,isInternal:!!n.internal};await u(S,{input:r}),f("Comment added");}catch(r){p(r);}}),s.command("resolve").description("Mark a ticket as resolved (precursor to close)").argument("<id>").option("--resolution <s>","Optional resolution note").action(async(e,n)=>{try{await u(A,{id:e,resolution:n.resolution}),f("Ticket resolved");}catch(r){p(r);}}),s.command("close").description("Close a support ticket").argument("<id>").action(async e=>{try{await u(v,{id:e}),f("Ticket closed");}catch(n){p(n);}}),o.command("kb").description("Knowledge base search").command("search").description("Search knowledge base articles").argument("<query>").option("--limit <n>","Page size",e=>parseInt(e,10),20).option("-f, --format <format>").action(async(e,n)=>{try{let r=await u(O,{query:e,limit:n.limit,offset:0});g(n,r.searchKnowledgeBase,{headers:["Slug","Title","Score"],rows:r.searchKnowledgeBase.map(a=>[a.slug,m(a.title,60),String(a.helpfulnessScore)])});}catch(r){p(r);}});}var M={id:"support",version:"1.0.0",displayName:"Support",dependsOn:["auth"],register(t,o){x(o),R(t);}},et=M;module.exports=et;
|