@gravity-rail/cli 0.18.0 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -12,10 +12,18 @@ gr members create -w $WORKSPACE --data '{"first_name":"Jane","email":"jane@examp
12
12
 
13
13
  ```sh
14
14
  npm install -g @gravity-rail/cli
15
+ # or one-shot
16
+ npx @gravity-rail/cli --help
15
17
  ```
16
18
 
17
19
  Requires Node.js 18+.
18
20
 
21
+ The published `gr` binary is a single self-contained file. Runtime
22
+ `dependencies` only list packages that exist on the public npm registry
23
+ (`@gravity-rail/sdk`). Build-only monorepo packages such as
24
+ `@gravity-rail/sandbox` (used when compiling code-interpreter bundles) stay in
25
+ `devDependencies` so `npx` / `npm install -g` do not try to fetch them.
26
+
19
27
  ## Authentication
20
28
 
21
29
  ### OAuth (interactive)
package/dist/gr.js CHANGED
@@ -3220,7 +3220,7 @@ var init_libphonenumber_js = __esm({
3220
3220
  }
3221
3221
  });
3222
3222
 
3223
- // ../sdk/dist/chunk-MP5ENP4Q.js
3223
+ // ../sdk/dist/chunk-PUIYXJSZ.js
3224
3224
  function sanitizePhoneForBackend(phoneNumber) {
3225
3225
  try {
3226
3226
  let parsed = parsePhoneNumber4(phoneNumber);
@@ -3386,6 +3386,7 @@ function createApiModules(apiKey, baseUrl3, customFetch) {
3386
3386
  hubspot: new HubspotApi(apiKey, baseUrl3, customFetch),
3387
3387
  features: new FeaturesApi(apiKey, baseUrl3, customFetch),
3388
3388
  files: new FilesApi(apiKey, baseUrl3, customFetch),
3389
+ projects: new ProjectsApi(apiKey, baseUrl3, customFetch),
3389
3390
  inboxes: new InboxesApi(apiKey, baseUrl3, customFetch),
3390
3391
  inquiries: new InquiriesApi(apiKey, baseUrl3, customFetch),
3391
3392
  journeys: new JourneysApi(apiKey, baseUrl3, customFetch),
@@ -3812,7 +3813,6 @@ function bindSitesMethods(target, sites) {
3812
3813
  target.siteSendEmailCode = sites.siteSendEmailCode.bind(sites);
3813
3814
  target.siteVerifyCode = sites.siteVerifyCode.bind(sites);
3814
3815
  target.siteGoogleOAuthInitiate = sites.siteGoogleOAuthInitiate.bind(sites);
3815
- target.crawlSite = sites.crawlSite.bind(sites);
3816
3816
  target.createSite = sites.createSite.bind(sites);
3817
3817
  target.updateSite = sites.updateSite.bind(sites);
3818
3818
  target.deleteSite = sites.deleteSite.bind(sites);
@@ -3872,6 +3872,11 @@ function bindFilesMethods(target, files) {
3872
3872
  target.getPublicFolder = files.getPublicFolder.bind(files);
3873
3873
  target.getPublicFolderFiles = files.getPublicFolderFiles.bind(files);
3874
3874
  }
3875
+ function bindProjectsMethods(target, projects) {
3876
+ target.getProjects = projects.getProjects.bind(projects);
3877
+ target.getProject = projects.getProject.bind(projects);
3878
+ target.getPlan = projects.getPlan.bind(projects);
3879
+ }
3875
3880
  function bindEventsMethods(target, events) {
3876
3881
  target.getEventRules = events.getEventRules.bind(events);
3877
3882
  target.getAvailableActions = events.getAvailableActions.bind(events);
@@ -4339,6 +4344,7 @@ function bindOrgMethods(target, org) {
4339
4344
  target.syncVoiceTrustProducts = org.syncVoiceTrustProducts.bind(org);
4340
4345
  target.createOrganizationWorkspace = org.createOrganizationWorkspace.bind(org);
4341
4346
  target.getOrgBillingCustomer = org.getOrgBillingCustomer.bind(org);
4347
+ target.getOrgWorkspaceUsage = org.getOrgWorkspaceUsage.bind(org);
4342
4348
  }
4343
4349
  function bindPronunciationsMethods(target, pronunciations) {
4344
4350
  target.getPronunciationEntries = pronunciations.getPronunciationEntries.bind(pronunciations);
@@ -4471,9 +4477,9 @@ function bindSupportRequestMethods(target, supportRequests) {
4471
4477
  target.reopenWorkspaceSupportRequest = supportRequests.reopenWorkspaceSupportRequest.bind(supportRequests);
4472
4478
  target.clickWorkspaceSupportRequestResource = supportRequests.clickWorkspaceSupportRequestResource.bind(supportRequests);
4473
4479
  }
4474
- var AbilitiesApi, AccessGrantsApi, AgentTasksApi, AgentsApi, AIModelsApi, ApiKeysApi, AppsApi, AssignmentsApi, VoiceApi, AuthApi, BuildersApi, CalendarsApi, CallsApi, CELApi, ChatsApi, ConfluenceApi, CustomToolkitsApi, DataTypesApi, DiscordBotsApi, SlackAppsApi, EventsApi, FeaturesApi, FhirConnectionsApi, InboundFaxStatus, DocumoFaxApi, HealthieApi, FilesApi, InboxesApi, InquiriesApi, AppConnectionsApi, McpServersApi, MemberImportValidationError, MembersApi, MondayIntegrationApi, NotificationRulesApi, OperatorApi, OrgApi, OAuthConnectionsApi, OAuthApi, PhoneNumbersApi, PronunciationsApi, PromptsApi, PersonasApi, QueriesApi, QualificationsApi, ReportsApi, SalesforceApi, ConnectionSyncApi, HubspotApi, SitesApi, SubscriptionsApi, SupportRequestsApi, CustomersApi, ResellersApi, SupervisorsApi, TasksApi, TemplatesApi, ToolkitsApi, JourneysApi, WorkflowsApi, WorkflowNotesApi, EventRuleEventType, DriverMode, WorkspaceInvitationsApi, WorkspacesApi, DashboardsApi, TeamsAppsApi, ExperimentsApi, PatientSyncConnectionsApi, ActivityTimelineApi, MotdApi, InterventionRequestsApi, MetricsApi, TrackedLinksApi, WORKSPACE_METHOD_NAMES, WORKSPACE_METHOD_NAME_SET, GravityRailClient, WIDGET_SLUGS, CHAT_TYPES, BUILTIN_ASSISTANT_CHAT_TYPES, MEMBER_AGENT_CHAT_TYPES;
4475
- var init_chunk_MP5ENP4Q = __esm({
4476
- "../sdk/dist/chunk-MP5ENP4Q.js"() {
4480
+ var AbilitiesApi, AccessGrantsApi, AgentTasksApi, AgentsApi, AIModelsApi, ApiKeysApi, AppsApi, AssignmentsApi, VoiceApi, AuthApi, BuildersApi, CalendarsApi, CallsApi, CELApi, ChatsApi, ConfluenceApi, CustomToolkitsApi, DataTypesApi, DiscordBotsApi, SlackAppsApi, EventsApi, FeaturesApi, FhirConnectionsApi, InboundFaxStatus, DocumoFaxApi, HealthieApi, FilesApi, InboxesApi, InquiriesApi, AppConnectionsApi, McpServersApi, MemberImportValidationError, MembersApi, MondayIntegrationApi, NotificationRulesApi, OperatorApi, OrgApi, OAuthConnectionsApi, OAuthApi, PhoneNumbersApi, PronunciationsApi, PromptsApi, PersonasApi, QueriesApi, QualificationsApi, ReportsApi, SalesforceApi, ConnectionSyncApi, HubspotApi, SitesApi, SubscriptionsApi, SupportRequestsApi, CustomersApi, ResellersApi, SupervisorsApi, TasksApi, TemplatesApi, ToolkitsApi, JourneysApi, WorkflowsApi, WorkflowNotesApi, EventRuleEventType, DriverMode, WorkspaceInvitationsApi, WorkspacesApi, DashboardsApi, TeamsAppsApi, ExperimentsApi, PatientSyncConnectionsApi, ActivityTimelineApi, MotdApi, InterventionRequestsApi, MetricsApi, ProjectsApi, TrackedLinksApi, WORKSPACE_METHOD_NAMES, WORKSPACE_METHOD_NAME_SET, GravityRailClient, WIDGET_SLUGS, CHAT_TYPES, BUILTIN_ASSISTANT_CHAT_TYPES, MEMBER_AGENT_CHAT_TYPES;
4481
+ var init_chunk_PUIYXJSZ = __esm({
4482
+ "../sdk/dist/chunk-PUIYXJSZ.js"() {
4477
4483
  init_chunk_PJFEGUHM();
4478
4484
  init_libphonenumber_js();
4479
4485
  AbilitiesApi = class extends BaseApiClient {
@@ -8871,9 +8877,9 @@ var init_chunk_MP5ENP4Q = __esm({
8871
8877
  /**
8872
8878
  * Update the settings an org admin owns: name, slug and contact details.
8873
8879
  *
8874
- * Deliberately NOT the admin organization update — `primary` and
8875
- * `enforceCreditLimit` are superuser-only and are not fields on this
8876
- * endpoint's request model at all.
8880
+ * Deliberately NOT the admin organization update — `enforceCreditLimit`
8881
+ * is superuser-only and is not a field on this endpoint's request model
8882
+ * at all.
8877
8883
  */
8878
8884
  async updateOrganizationSettings(orgIdOrUuid, data) {
8879
8885
  return this.fetch(`o/${orgIdOrUuid}`, {
@@ -8909,6 +8915,21 @@ var init_chunk_MP5ENP4Q = __esm({
8909
8915
  async getOrgBillingCustomer(orgIdOrUuid) {
8910
8916
  return this.fetch(`o/${orgIdOrUuid}/billing-customer`);
8911
8917
  }
8918
+ /**
8919
+ * Per-workspace usage for this organization's current credit window.
8920
+ *
8921
+ * Requires a billing role on the organization's billing customer — the
8922
+ * same gate `getOrgBillingCustomer().hasAccess` reports, and the one that
8923
+ * decides whether the billing tab is shown at all.
8924
+ *
8925
+ * `creditsUsed` is a real organization-wide total or it is null; it is
8926
+ * never a partial sum. There is deliberately no per-workspace "remaining"
8927
+ * figure — the caps belong to the organization, so `cap - oneWorkspace`
8928
+ * describes nothing.
8929
+ */
8930
+ async getOrgWorkspaceUsage(orgIdOrUuid) {
8931
+ return this.fetch(`o/${orgIdOrUuid}/usage/workspaces`);
8932
+ }
8912
8933
  /**
8913
8934
  * List members of an organization.
8914
8935
  */
@@ -10637,12 +10658,6 @@ var init_chunk_MP5ENP4Q = __esm({
10637
10658
  }
10638
10659
  return verifyResponse;
10639
10660
  }
10640
- /** Trigger a crawl of the site's external content source. */
10641
- async crawlSite(wid, siteId) {
10642
- return this.fetch(`w/${wid}/sites/${siteId}/crawl`, {
10643
- method: "POST"
10644
- });
10645
- }
10646
10661
  /** Create a new site in the workspace. */
10647
10662
  async createSite(wid, site) {
10648
10663
  return this.fetch(`w/${wid}/sites`, {
@@ -10784,8 +10799,8 @@ var init_chunk_MP5ENP4Q = __esm({
10784
10799
  });
10785
10800
  }
10786
10801
  /**
10787
- * List self-service, purchasable plans (org or workspace). Only plans with a
10788
- * paid Stripe price are returned. No auth required.
10802
+ * List self-service, purchasable organization plans or add-ons. Only products
10803
+ * with a Stripe Price are returned; zero-amount plans are allowed.
10789
10804
  */
10790
10805
  async listSelfServeProducts(productType2) {
10791
10806
  const qs = productType2 ? `?product_type=${productType2}` : "";
@@ -10820,7 +10835,13 @@ var init_chunk_MP5ENP4Q = __esm({
10820
10835
  }
10821
10836
  });
10822
10837
  }
10823
- /** Add a workspace to an existing subscription. */
10838
+ /**
10839
+ * Provision a new workspace under an existing org subscription.
10840
+ *
10841
+ * No product or period: the organization already holds the plan and the new
10842
+ * workspace bills through it. Returns before the workspace exists —
10843
+ * `provisioning: true` means poll for it.
10844
+ */
10824
10845
  async addWorkspaceToSubscription(subscriptionId, data) {
10825
10846
  return this.fetch(`subscriptions/${subscriptionId}/add-workspace`, {
10826
10847
  method: "POST",
@@ -12733,6 +12754,27 @@ var init_chunk_MP5ENP4Q = __esm({
12733
12754
  });
12734
12755
  }
12735
12756
  };
12757
+ ProjectsApi = class extends BaseApiClient {
12758
+ /** List projects (README frontmatter summaries). */
12759
+ async getProjects(wid, options = {}) {
12760
+ const params = new URLSearchParams();
12761
+ if (options.page !== void 0) params.append("page", options.page.toString());
12762
+ if (options.pageSize !== void 0) params.append("pageSize", options.pageSize.toString());
12763
+ return this.fetch(
12764
+ `w/${wid}/projects${params.toString() ? `?${params.toString()}` : ""}`
12765
+ );
12766
+ }
12767
+ /** One project: summary + present docs + plan summaries. */
12768
+ async getProject(wid, slug) {
12769
+ return this.fetch(`w/${wid}/projects/${encodeURIComponent(slug)}`);
12770
+ }
12771
+ /** One plan: summary + resolved process + flows + run state. */
12772
+ async getPlan(wid, slug, plan) {
12773
+ return this.fetch(
12774
+ `w/${wid}/projects/${encodeURIComponent(slug)}/plans/${encodeURIComponent(plan)}`
12775
+ );
12776
+ }
12777
+ };
12736
12778
  TrackedLinksApi = class extends BaseApiClient {
12737
12779
  /** Header counters plus whether shortening is configured and enabled. */
12738
12780
  async getTrackedLinkSummary(wid, options = {}) {
@@ -12884,7 +12926,6 @@ var init_chunk_MP5ENP4Q = __esm({
12884
12926
  "configureSalesforce",
12885
12927
  "convertEmail",
12886
12928
  "convertFile",
12887
- "crawlSite",
12888
12929
  "createAbility",
12889
12930
  "createAccessGrant",
12890
12931
  "createAgent",
@@ -13309,8 +13350,11 @@ var init_chunk_MP5ENP4Q = __esm({
13309
13350
  "getPhoneNumbers",
13310
13351
  "getPhoneUsageReport",
13311
13352
  "getPlatformApp",
13353
+ "getPlan",
13312
13354
  "getPresenceStatus",
13313
13355
  "getProducts",
13356
+ "getProject",
13357
+ "getProjects",
13314
13358
  "getPublicFile",
13315
13359
  "getPublicFolder",
13316
13360
  "getPublicFolderFiles",
@@ -14020,6 +14064,7 @@ var init_chunk_MP5ENP4Q = __esm({
14020
14064
  syncVoiceTrustProducts;
14021
14065
  createOrganizationWorkspace;
14022
14066
  getOrgBillingCustomer;
14067
+ getOrgWorkspaceUsage;
14023
14068
  getVapidPublicKey;
14024
14069
  registerPushSubscription;
14025
14070
  unregisterPushSubscription;
@@ -14119,7 +14164,6 @@ var init_chunk_MP5ENP4Q = __esm({
14119
14164
  siteSendEmailCode;
14120
14165
  siteVerifyCode;
14121
14166
  siteGoogleOAuthInitiate;
14122
- crawlSite;
14123
14167
  createSite;
14124
14168
  updateSite;
14125
14169
  deleteSite;
@@ -14140,6 +14184,9 @@ var init_chunk_MP5ENP4Q = __esm({
14140
14184
  // Files API
14141
14185
  getFiles;
14142
14186
  getFile;
14187
+ getProjects;
14188
+ getProject;
14189
+ getPlan;
14143
14190
  resolveFilePath;
14144
14191
  downloadFilesZip;
14145
14192
  createFile;
@@ -14675,6 +14722,7 @@ var init_chunk_MP5ENP4Q = __esm({
14675
14722
  bindAuthMethods(this, apis.auth, apis.assignments);
14676
14723
  bindSitesMethods(this, apis.sites);
14677
14724
  bindFilesMethods(this, apis.files);
14725
+ bindProjectsMethods(this, apis.projects);
14678
14726
  bindEventsMethods(this, apis.events);
14679
14727
  bindWorkflowsMethods(this, apis.workflows, apis.workflowNotes, apis.voice, apis.supervisors);
14680
14728
  bindCalendarsMethods(this, apis.calendars);
@@ -14850,7 +14898,7 @@ var init_chunk_2YLKG4TT = __esm({
14850
14898
  var SEARCHABLE_EVENT_RULE_SOURCE_FIELDS;
14851
14899
  var init_dist = __esm({
14852
14900
  "../sdk/dist/index.js"() {
14853
- init_chunk_MP5ENP4Q();
14901
+ init_chunk_PUIYXJSZ();
14854
14902
  init_chunk_2YLKG4TT();
14855
14903
  init_chunk_PJFEGUHM();
14856
14904
  SEARCHABLE_EVENT_RULE_SOURCE_FIELDS = [
@@ -19990,31 +20038,19 @@ var workspacesDomain = {
19990
20038
  description: "Organization UUID",
19991
20039
  required: true
19992
20040
  },
19993
- { name: "product", description: "Workspace plan product ID", required: true },
19994
20041
  { name: "name", description: "Workspace name", required: true },
19995
- { name: "period", description: "Billing period: 'month' or 'year'", default: "month" },
19996
20042
  { name: "slug", description: "Workspace slug (optional)" },
19997
20043
  { name: "template", description: "Template workspace UUID to clone (optional)" }
19998
20044
  ],
19999
- examples: ['gr workspaces create --org <org-uuid> --product 14 --name "Front Desk"'],
20045
+ examples: ['gr workspaces create --org <org-uuid> --name "Front Desk"'],
20000
20046
  handler: async ({ ctx, args }) => {
20001
20047
  const orgUuid = args.org ?? args["org-uuid"];
20002
20048
  const name = args.name;
20003
- const productRaw = args.product;
20004
20049
  if (!orgUuid) throw new CLIError("Missing required argument: --org <org-uuid>");
20005
20050
  if (!name) throw new CLIError("Missing required argument: --name");
20006
- if (!productRaw) {
20007
- throw new CLIError(
20008
- "Missing required argument: --product\nList workspace plans with: gr billing products --type workspace"
20009
- );
20010
- }
20011
- const payload = {
20012
- name,
20013
- productId: Number(productRaw),
20014
- planPeriod: args.period || "month"
20015
- };
20016
- if (args.slug) payload.slug = args.slug;
20017
- if (args.template) payload.templateWorkspaceUuid = args.template;
20051
+ const payload = { name };
20052
+ if (args.slug) payload.slug = String(args.slug);
20053
+ if (args.template) payload.templateWorkspaceUuid = String(args.template);
20018
20054
  try {
20019
20055
  const result2 = await requireAuth(ctx).apiClient.createOrganizationWorkspace(
20020
20056
  orgUuid,
@@ -25347,7 +25383,7 @@ function isTable(ctx) {
25347
25383
  }
25348
25384
  function productType(args) {
25349
25385
  const t = args.type ?? args["product-type"];
25350
- if (t === "org" || t === "workspace") return t;
25386
+ if (t === "org" || t === "addon") return t;
25351
25387
  return void 0;
25352
25388
  }
25353
25389
  var billingDomain = {
@@ -25361,7 +25397,7 @@ var billingDomain = {
25361
25397
  args: [
25362
25398
  {
25363
25399
  name: "type",
25364
- description: "Filter by plan type: 'org' or 'workspace'"
25400
+ description: "Filter by product type: 'org' or 'addon'"
25365
25401
  }
25366
25402
  ],
25367
25403
  examples: ["gr billing products --type org"],
@@ -25471,8 +25507,7 @@ Then check it landed:
25471
25507
  );
25472
25508
  hint(ctx, [
25473
25509
  "You have an active subscription. Add a workspace:",
25474
- " gr billing products --type workspace # pick a workspace plan",
25475
- ` gr workspaces create --org ${orgUuid} --product <id> --name "My Workspace"`
25510
+ ` gr workspaces create --org ${orgUuid} --name "My Workspace"`
25476
25511
  ]);
25477
25512
  }
25478
25513
  }
@@ -35146,7 +35181,7 @@ Flags for unattended turns:
35146
35181
  - \`--auto-approve\`: skip HITL tool approval where policy allows
35147
35182
  - \`--allow-write\`: required for create/update tools
35148
35183
 
35149
- The concierge can: list/create orgs, list org/workspace products, create Stripe checkout sessions, and \`create_workspace\`.
35184
+ The concierge can: list/create orgs, list organization plans and add-ons, create Stripe checkout sessions, and \`create_workspace\`.
35150
35185
 
35151
35186
  ## Manual CLI path (if not using concierge)
35152
35187
  1. \`gr whoami\` \u2014 confirm account
@@ -35730,7 +35765,7 @@ init_concierge_api();
35730
35765
 
35731
35766
  // package.json
35732
35767
  var package_default = {
35733
- version: "0.18.0"};
35768
+ version: "0.18.1"};
35734
35769
 
35735
35770
  // src/gr.ts
35736
35771
  var VERSION = package_default.version;