@burdenoff/cli-sdk 2026.1101.1 → 2026.1102.2
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-REBBLQFS.js → chunk-ZGT7IIOP.js} +494 -522
- package/dist/modules/adaptercloud/index.cjs +4 -4
- package/dist/modules/adaptercloud/index.js +2 -2
- 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 +8 -8
- package/dist/modules/atheletebridge/index.js +2 -2
- package/dist/modules/auth/index.cjs +37 -37
- package/dist/modules/auth/index.js +33 -29
- package/dist/modules/billing/index.cjs +18 -18
- package/dist/modules/billing/index.js +22 -22
- package/dist/modules/brainyrich/index.cjs +44 -28
- package/dist/modules/brainyrich/index.js +47 -31
- package/dist/modules/buildmyiq/index.js +2 -2
- 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 +6 -6
- package/dist/modules/comradecircle/index.js +2 -2
- package/dist/modules/conversations/index.cjs +7 -7
- package/dist/modules/conversations/index.js +2 -2
- package/dist/modules/coolandlovely/index.cjs +2 -2
- package/dist/modules/coolandlovely/index.js +2 -2
- 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 +40 -34
- package/dist/modules/devportal/index.js +49 -43
- package/dist/modules/ecoimpacthub/index.cjs +5 -5
- package/dist/modules/ecoimpacthub/index.js +2 -2
- package/dist/modules/eventfullymanaged/index.cjs +12 -12
- package/dist/modules/eventfullymanaged/index.js +2 -2
- 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 +4 -4
- package/dist/modules/govcitizenhub/index.js +2 -2
- 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 +5 -5
- package/dist/modules/intelwatchtower/index.js +2 -2
- package/dist/modules/kadaikodi/index.cjs +2 -2
- package/dist/modules/kadaikodi/index.js +2 -2
- package/dist/modules/labsofscience/index.cjs +3 -3
- package/dist/modules/labsofscience/index.js +2 -2
- package/dist/modules/manufacturedops/index.cjs +2 -2
- package/dist/modules/manufacturedops/index.js +2 -2
- 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.js +2 -2
- package/dist/modules/products/index.cjs +4 -4
- package/dist/modules/products/index.js +2 -2
- package/dist/modules/proserviceworld/index.cjs +2 -2
- package/dist/modules/proserviceworld/index.js +2 -2
- package/dist/modules/rbac/index.js +2 -2
- package/dist/modules/sandbox/index.cjs +32 -51
- 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 +46 -40
- package/dist/modules/store/index.js +45 -39
- package/dist/modules/subscriberbot/index.cjs +1 -1
- package/dist/modules/subscriberbot/index.js +2 -2
- 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 +2 -2
- package/dist/modules/technospam/index.js +2 -2
- package/dist/modules/theculturepost/index.js +2 -2
- package/dist/modules/theglobalfuel/index.cjs +2 -2
- package/dist/modules/theglobalfuel/index.js +2 -2
- 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 +573 -577
- 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
|
@@ -322,4 +322,4 @@
|
|
|
322
322
|
query SubHealth {
|
|
323
323
|
subHealth
|
|
324
324
|
}
|
|
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;
|
|
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 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
|
|
@@ -322,4 +322,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
322
|
query SubHealth {
|
|
323
323
|
subHealth
|
|
324
324
|
}
|
|
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};
|
|
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}});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 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});i(t,e.subListPlans,{headers:["ID","Name","Amount","Currency","Interval","Active"],rows:e.subListPlans.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(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}});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,{headers:["ID","Relationship","Type","Amount","Occurs","Notified"],rows:e.subListRenewalEvents.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(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});i(t,e.subListAssets,{headers:["ID","Name","Type","Secret","Expires"],rows:e.subListAssets.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(U,{input:e});k$1(`Asset created: ${n.subCreateAsset.name}`),i(t,n.subCreateAsset);}catch(e){h(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});i(t,e.subListEntitlements,{headers:["ID","Name","Type","Used","Quota","Active"],rows:e.subListEntitlements.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(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}});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(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});i(t,e.subListPaymentInstruments,{headers:["ID","Label","Type","Status","Brand","Last4","Default"],rows:e.subListPaymentInstruments.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(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});i(t,e.subListChannels,{headers:["ID","Type","Address","Label","Status","Ingest"],rows:e.subListChannels.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(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}});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(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});i(t,e.subListAgents,{headers:["ID","Name","Kind","Status","Description"],rows:e.subListAgents.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,{headers:["ID","Name","Action","Enabled","Triggers"],rows:e.subListPolicies.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(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});i(t,e.subListWorkflows,{headers:["ID","Name","Trigger","Status","Runs"],rows:e.subListWorkflows.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(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);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(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};
|
|
@@ -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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a,c,
|
|
1
|
+
import {a,c,i,r,p,q,h,k as k$1}from'../../chunk-O6UCQ5IT.js';import {o}from'../../chunk-YIY5IDXQ.js';var k=`
|
|
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 @@ import {a,c,h,p,n,o,g,i}from'../../chunk-W4JZR7RJ.js';import {o as o$1}from'../.
|
|
|
42
42
|
id title slug helpfulnessScore
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
`;function P(m){let p$1=m.command("support").description("Support tickets & knowledge base"),n
|
|
45
|
+
`;function P(m){let p$1=m.command("support").description("Support tickets & knowledge base"),n=p$1.command("tickets").description("Manage support tickets");n.command("list").description("List support tickets").option("--status <s>").option("--priority <p>").option("--limit <n>","Page size",t=>parseInt(t,10),50).option("-f, --format <format>").action(async t=>{try{let e={};t.status&&(e.status=t.status.toUpperCase()),t.priority&&(e.priority=t.priority.toUpperCase());let r$1=await c(k,{filter:Object.keys(e).length?e:void 0,limit:t.limit,offset:0});i(t,r$1.supportTickets.nodes,{headers:["#","Subject","Status","Priority","Category","Created"],rows:r$1.supportTickets.nodes.map(i=>[i.ticketNumber??r(i.id,8),r(i.subject??"-",40),p(i.status),i.priority??"-",i.category??"-",q(i.createdAt)])});}catch(e){h(e);}}),n.command("get").description("Get a support ticket").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let r=await c(C,{id:t});if(!r.supportTicket)throw new o(`Ticket ${t} not found`);i(e,r.supportTicket);}catch(r){h(r);}}),n.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 t=>{try{let e={subject:t.subject,description:t.description,priority:(t.priority??"NORMAL").toUpperCase(),category:(t.category??"TECHNICAL_SUPPORT").toUpperCase()},r=await c(y,{input:e});k$1(`Ticket created: ${r.createSupportTicket.ticketNumber??r.createSupportTicket.id}`),i(t,r.createSupportTicket);}catch(e){h(e);}}),n.command("comment").description("Add a comment to a ticket").argument("<ticketId>").requiredOption("--message <s>").option("--internal","Internal staff-only comment",false).action(async(t,e)=>{try{let r={ticketId:t,message:e.message,isInternal:!!e.internal};await c(E,{input:r}),k$1("Comment added");}catch(r){h(r);}}),n.command("resolve").description("Mark a ticket as resolved (precursor to close)").argument("<id>").option("--resolution <s>","Optional resolution note").action(async(t,e)=>{try{await c(I,{id:t,resolution:e.resolution}),k$1("Ticket resolved");}catch(r){h(r);}}),n.command("close").description("Close a support ticket").argument("<id>").action(async t=>{try{await c(R,{id:t}),k$1("Ticket closed");}catch(e){h(e);}}),p$1.command("kb").description("Knowledge base search").command("search").description("Search knowledge base articles").argument("<query>").option("--limit <n>","Page size",t=>parseInt(t,10),20).option("-f, --format <format>").action(async(t,e)=>{try{let r$1=await c(O,{query:t,limit:e.limit,offset:0});i(e,r$1.searchKnowledgeBase,{headers:["Slug","Title","Score"],rows:r$1.searchKnowledgeBase.map(i=>[i.slug,r(i.title,60),String(i.helpfulnessScore)])});}catch(r){h(r);}});}var b={id:"support",version:"1.0.0",displayName:"Support",dependsOn:["auth"],register(m,p){a(p),P(m);}},N=b;export{N as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a,b as b$1,h as h$1,
|
|
1
|
+
import {a,b as b$1,i,r,h as h$1,k as k$1,u}from'../../chunk-O6UCQ5IT.js';import {o}from'../../chunk-YIY5IDXQ.js';var I=`
|
|
2
2
|
query TagsList($filter: TagFilterInput, $pagination: TagsPaginationInput) {
|
|
3
3
|
getTags(filter: $filter, pagination: $pagination) {
|
|
4
4
|
items { id key label description scope displayOrder }
|
|
@@ -51,4 +51,4 @@ import {a,b as b$1,h as h$1,p,g as g$1,i,s}from'../../chunk-W4JZR7RJ.js';import
|
|
|
51
51
|
mutation DeleteTagRelation($id: ID!) {
|
|
52
52
|
deleteTagRelation(id: $id)
|
|
53
53
|
}
|
|
54
|
-
`;function g(){let c=
|
|
54
|
+
`;function g(){let c=u().auth.read();if(!c?.workspaceId)throw new o("No workspace set. Run: vibecontrols workspace set <id>");return {workspaceId:c.workspaceId}}function k(c){let o$1=c.command("tags").description("Tag management");o$1.command("list").description("List tags in current workspace").option("--scope <s>","WORKSPACE|GLOBAL|VIBE").option("--search <q>").option("--limit <n>","Page size",t=>parseInt(t,10),100).option("-f, --format <format>").action(async t=>{try{let e={workspaceId:g().workspaceId};t.scope&&(e.scope=t.scope.toUpperCase()),t.search&&(e.search=t.search);let a=await b$1(I,{filter:e,pagination:{limit:t.limit,offset:0}});i(t,a.getTags.items,{headers:["ID","Key","Label","Scope","Order"],rows:a.getTags.items.map(s=>[r(s.id,12),s.key,s.label,s.scope??"-",String(s.displayOrder??"-")])});}catch(e){h$1(e);}}),o$1.command("get").description("Get a tag by id").argument("<id>").option("-f, --format <format>").action(async(t,e)=>{try{let a=await b$1(A,{id:t});if(!a.getTag)throw new o(`Tag ${t} not found`);i(e,a.getTag);}catch(a){h$1(a);}}),o$1.command("create").description("Create a tag in the current workspace").requiredOption("--key <key>").requiredOption("--label <label>").requiredOption("--vocabulary <id>","Vocabulary id (required by schema)").option("--description <s>").option("--color <hex>").option("--icon <s>").option("--scope <s>","WORKSPACE|GLOBAL|VIBE","WORKSPACE").option("--parent <id>").option("-f, --format <format>").action(async t=>{try{let e={context:g(),key:t.key,label:t.label,vocabularyId:t.vocabulary,description:t.description,color:t.color,icon:t.icon,scope:(t.scope??"WORKSPACE").toUpperCase(),parentId:t.parent},a=await b$1(E,{input:e});k$1(`Tag created: ${a.createTag.label}`),i(t,a.createTag);}catch(e){h$1(e);}}),o$1.command("update").description("Update a tag").argument("<id>").option("--label <s>").option("--description <s>").option("--color <hex>").option("--icon <s>").option("--parent <id>").option("--display-order <n>","",t=>parseInt(t,10)).option("-f, --format <format>").action(async(t,e)=>{try{let a={context:g()};if(e.label&&(a.label=e.label),e.description!==void 0&&(a.description=e.description),e.color&&(a.color=e.color),e.icon&&(a.icon=e.icon),e.parent&&(a.parentId=e.parent),e.displayOrder!==void 0&&(a.displayOrder=e.displayOrder),Object.keys(a).length===1)throw new o("No updates specified");let s=await b$1(R,{id:t,input:a});k$1("Tag updated"),i(e,s.updateTag);}catch(a){h$1(a);}}),o$1.command("delete").description("Delete a tag").argument("<id>").action(async t=>{try{await b$1(b,{id:t}),k$1("Tag deleted");}catch(e){h$1(e);}}),o$1.command("analytics").description("Tag usage analytics").argument("<tagId>").requiredOption("--from <iso>","Start date").requiredOption("--to <iso>","End date").option("-f, --format <format>").action(async(t,e)=>{try{let a=await b$1(w,{tagId:t,startDate:e.from,endDate:e.to});i(e,a.getTagAnalytics);}catch(a){h$1(a);}});let l=o$1.command("permissions").description("Tag relations / permissions");l.command("list").description("List related tags").argument("<tagId>").option("-f, --format <format>").action(async(t,e)=>{try{let a=await b$1(C,{tagId:t});i(e,a.getRelatedTags);}catch(a){h$1(a);}}),l.command("grant").description("Create a tag relation").requiredOption("--from <tagId>").requiredOption("--to <tagId>").requiredOption("--type <relation>","SYNONYM|ANTONYM|BROADER|NARROWER|RELATED|IMPLIES|EXCLUDES").option("--bidirectional","Mirror in both directions",false).option("-f, --format <format>").action(async t=>{try{let e={context:g(),fromTagId:t.from,toTagId:t.to,relationType:t.type.toUpperCase(),bidirectional:!!t.bidirectional},a=await b$1(O,{input:e});k$1("Tag relation created"),i(t,a.createTagRelation);}catch(e){h$1(e);}}),l.command("revoke").description("Delete a tag relation").argument("<relationId>").action(async t=>{try{await b$1(h,{id:t}),k$1("Tag relation deleted");}catch(e){h$1(e);}});}var L={id:"tags",version:"1.0.0",displayName:"Tags",dependsOn:["auth","workspaces"],register(c,o){a(o),k(c);}},N=L;export{N as default};
|