@gravity-rail/cli 0.56.0 → 0.57.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/gr.js CHANGED
@@ -3164,7 +3164,7 @@ var init_libphonenumber_js = __esm({
3164
3164
  }
3165
3165
  });
3166
3166
 
3167
- // ../sdk/dist/chunk-BQOKENBF.js
3167
+ // ../sdk/dist/chunk-YDC4OVZE.js
3168
3168
  function resourceWorkflowsPath(wid, ...segments) {
3169
3169
  const tail = segments.map((segment) => encodeURIComponent(String(segment))).join("/");
3170
3170
  const base = `w/${encodeURIComponent(wid)}/resource-workflows`;
@@ -3404,6 +3404,7 @@ function createApiModules(apiKey, baseUrl3, customFetch) {
3404
3404
  patientSyncConnections: new PatientSyncConnectionsApi(apiKey, baseUrl3, customFetch),
3405
3405
  healthie: new HealthieApi(apiKey, baseUrl3, customFetch),
3406
3406
  documoFax: new DocumoFaxApi(apiKey, baseUrl3, customFetch),
3407
+ claimMd: new ClaimMdApi(apiKey, baseUrl3, customFetch),
3407
3408
  hubspot: new HubspotApi(apiKey, baseUrl3, customFetch),
3408
3409
  features: new FeaturesApi(apiKey, baseUrl3, customFetch),
3409
3410
  files: new FilesApi(apiKey, baseUrl3, customFetch),
@@ -3545,6 +3546,7 @@ function bindChatsMethods(target, chats) {
3545
3546
  target.updateChat = chats.updateChat.bind(chats);
3546
3547
  target.getChatModelOverride = chats.getChatModelOverride.bind(chats);
3547
3548
  target.updateChatModelOverride = chats.updateChatModelOverride.bind(chats);
3549
+ target.setChatStar = chats.setChatStar.bind(chats);
3548
3550
  target.updateChatMute = chats.updateChatMute.bind(chats);
3549
3551
  target.summarizeChat = chats.summarizeChat.bind(chats);
3550
3552
  target.getChatMessages = chats.getChatMessages.bind(chats);
@@ -3579,8 +3581,8 @@ function bindChatsMethods(target, chats) {
3579
3581
  }
3580
3582
  function bindCallsMethods(target, calls, cel) {
3581
3583
  target.getPhoneCalls = calls.getPhoneCalls.bind(calls);
3584
+ target.getPhoneCallByUuid = calls.getPhoneCallByUuid.bind(calls);
3582
3585
  target.getMessageTiming = calls.getMessageTiming.bind(calls);
3583
- target.getRecordingInfo = calls.getRecordingInfo.bind(calls);
3584
3586
  target.getEdgeCaptureInfo = calls.getEdgeCaptureInfo.bind(calls);
3585
3587
  target.getCallRecordingDownloadUrl = calls.getCallRecordingDownloadUrl.bind(calls);
3586
3588
  target.getCelContext = cel.getCelContext.bind(cel);
@@ -3806,6 +3808,7 @@ function bindWorkspacesMethods(target, workspaces, signupRequests) {
3806
3808
  target.getWorkspaceScopes = workspaces.getWorkspaceScopes.bind(workspaces);
3807
3809
  target.getUsageDashboard = workspaces.getUsageDashboard.bind(workspaces);
3808
3810
  target.getVapidPublicKey = workspaces.getVapidPublicKey.bind(workspaces);
3811
+ target.testPushSubscription = workspaces.testPushSubscription.bind(workspaces);
3809
3812
  target.registerPushSubscription = workspaces.registerPushSubscription.bind(workspaces);
3810
3813
  target.unregisterPushSubscription = workspaces.unregisterPushSubscription.bind(workspaces);
3811
3814
  target.listPushSubscriptions = workspaces.listPushSubscriptions.bind(workspaces);
@@ -4114,6 +4117,7 @@ function bindCommunicationsMethods(target, phoneNumbers, inboxes, notificationRu
4114
4117
  target.createPhoneNumber = phoneNumbers.createPhoneNumber.bind(phoneNumbers);
4115
4118
  target.updatePhoneNumber = phoneNumbers.updatePhoneNumber.bind(phoneNumbers);
4116
4119
  target.getArchiveBlockers = phoneNumbers.getArchiveBlockers.bind(phoneNumbers);
4120
+ target.getPhoneNumberSetupStatus = phoneNumbers.getPhoneNumberSetupStatus.bind(phoneNumbers);
4117
4121
  target.archivePhoneNumber = phoneNumbers.archivePhoneNumber.bind(phoneNumbers);
4118
4122
  target.getPhoneNumberCalls = phoneNumbers.getPhoneNumberCalls.bind(phoneNumbers);
4119
4123
  target.getPhoneNumberOutboundAnalyticsSummary = phoneNumbers.getPhoneNumberOutboundAnalyticsSummary.bind(phoneNumbers);
@@ -4146,6 +4150,7 @@ function bindCommunicationsMethods(target, phoneNumbers, inboxes, notificationRu
4146
4150
  target.sendInboxEmail = inboxes.sendInboxEmail.bind(inboxes);
4147
4151
  target.previewInboxEmail = inboxes.previewInboxEmail.bind(inboxes);
4148
4152
  target.previewEmailReply = inboxes.previewEmailReply.bind(inboxes);
4153
+ target.getInboxOutboundEmailStats = inboxes.getInboxOutboundEmailStats.bind(inboxes);
4149
4154
  target.getNotificationRules = notificationRules.getNotificationRules.bind(notificationRules);
4150
4155
  target.createNotificationRule = notificationRules.createNotificationRule.bind(notificationRules);
4151
4156
  target.updateNotificationRule = notificationRules.updateNotificationRule.bind(notificationRules);
@@ -4254,7 +4259,7 @@ function bindAppsMethods(target, apps, builders, inquiries, oauth, oauthConnecti
4254
4259
  target.getOAuthAuthorizationUrl = oauthConnections.getAuthorizationUrl.bind(oauthConnections);
4255
4260
  target.disconnectOAuthProvider = oauthConnections.disconnect.bind(oauthConnections);
4256
4261
  }
4257
- function bindIntegrationsMethods(target, mondayIntegration, discordBots, slackApps, teamsApps, fhirConnections, patientSyncConnections, healthie, documoFax, salesforce, hubspot, appConnections, connectionSync, confluence) {
4262
+ function bindIntegrationsMethods(target, mondayIntegration, discordBots, slackApps, teamsApps, fhirConnections, patientSyncConnections, healthie, documoFax, claimMd, salesforce, hubspot, appConnections, connectionSync, confluence) {
4258
4263
  target.getMondayBoards = mondayIntegration.getBoards.bind(mondayIntegration);
4259
4264
  target.getMondayBoardColumns = mondayIntegration.getBoardColumns.bind(mondayIntegration);
4260
4265
  target.getMondayBoardGroups = mondayIntegration.getBoardGroups.bind(mondayIntegration);
@@ -4304,6 +4309,8 @@ function bindIntegrationsMethods(target, mondayIntegration, discordBots, slackAp
4304
4309
  target.deleteSlackApp = slackApps.deleteSlackApp.bind(slackApps);
4305
4310
  target.getSlackThreads = slackApps.getSlackThreads.bind(slackApps);
4306
4311
  target.getSlackInstallations = slackApps.getSlackInstallations.bind(slackApps);
4312
+ target.removeSlackAccount = slackApps.removeSlackAccount.bind(slackApps);
4313
+ target.removeSlackInstallation = slackApps.removeSlackInstallation.bind(slackApps);
4307
4314
  target.getSlackChannelChoices = slackApps.getSlackChannelChoices.bind(slackApps);
4308
4315
  target.getSlackEntryPoints = slackApps.getSlackEntryPoints.bind(slackApps);
4309
4316
  target.connectSlackEntryPoint = slackApps.connectSlackEntryPoint.bind(slackApps);
@@ -4347,8 +4354,9 @@ function bindIntegrationsMethods(target, mondayIntegration, discordBots, slackAp
4347
4354
  target.fhirGetEncounterSyncRuns = fhirConnections.fhirGetEncounterSyncRuns.bind(fhirConnections);
4348
4355
  target.fhirRefreshEncounterPatient = fhirConnections.fhirRefreshEncounterPatient.bind(fhirConnections);
4349
4356
  target.fhirBackfillEncounterSync = fhirConnections.fhirBackfillEncounterSync.bind(fhirConnections);
4350
- target.fhirStartOnboardingImport = fhirConnections.fhirStartOnboardingImport.bind(fhirConnections);
4351
- target.fhirGetOnboardingImportStatus = fhirConnections.fhirGetOnboardingImportStatus.bind(fhirConnections);
4357
+ target.getAthenaPlatformApp = fhirConnections.getAthenaPlatformApp.bind(fhirConnections);
4358
+ target.verifyAthenaAccess = fhirConnections.verifyAthenaAccess.bind(fhirConnections);
4359
+ target.connectAthena = fhirConnections.connectAthena.bind(fhirConnections);
4352
4360
  target.configurePatientSync = patientSyncConnections.configurePatientSync.bind(patientSyncConnections);
4353
4361
  target.getPatientSyncStatus = patientSyncConnections.getPatientSyncStatus.bind(patientSyncConnections);
4354
4362
  target.deletePatientSyncConnection = patientSyncConnections.deletePatientSyncConnection.bind(patientSyncConnections);
@@ -4359,6 +4367,10 @@ function bindIntegrationsMethods(target, mondayIntegration, discordBots, slackAp
4359
4367
  target.configureDocumoFax = documoFax.configureDocumoFax.bind(documoFax);
4360
4368
  target.verifyDocumoFax = documoFax.verifyDocumoFax.bind(documoFax);
4361
4369
  target.rotateDocumoFaxCredentials = documoFax.rotateDocumoFaxCredentials.bind(documoFax);
4370
+ target.getClaimMdStatus = claimMd.getClaimMdStatus.bind(claimMd);
4371
+ target.installClaimMd = claimMd.installClaimMd.bind(claimMd);
4372
+ target.configureClaimMd = claimMd.configureClaimMd.bind(claimMd);
4373
+ target.verifyClaimMdKey = claimMd.verifyClaimMdKey.bind(claimMd);
4362
4374
  target.configureHealthie = healthie.configureHealthie.bind(healthie);
4363
4375
  target.getHealthieStatus = healthie.getHealthieStatus.bind(healthie);
4364
4376
  target.listHealthieProviders = healthie.listHealthieProviders.bind(healthie);
@@ -4420,6 +4432,10 @@ function bindIntegrationsMethods(target, mondayIntegration, discordBots, slackAp
4420
4432
  target.searchHubspotRecords = hubspot.searchHubspotRecords.bind(hubspot);
4421
4433
  target.importHubspotMembers = hubspot.importHubspotMembers.bind(hubspot);
4422
4434
  target.getHubspotContactProperties = hubspot.getHubspotContactProperties.bind(hubspot);
4435
+ target.getHubspotDealProperties = hubspot.getHubspotDealProperties.bind(hubspot);
4436
+ target.getHubspotForms = hubspot.getHubspotForms.bind(hubspot);
4437
+ target.getHubspotMeetingLinks = hubspot.getHubspotMeetingLinks.bind(hubspot);
4438
+ target.getHubspotObjectProperties = hubspot.getHubspotObjectProperties.bind(hubspot);
4423
4439
  target.getHubspotManagedRules = hubspot.getHubspotManagedRules.bind(hubspot);
4424
4440
  target.getHubspotSyncLogs = hubspot.getHubspotSyncLogs.bind(hubspot);
4425
4441
  target.getHubspotTransformPresets = hubspot.getHubspotTransformPresets.bind(hubspot);
@@ -4431,7 +4447,23 @@ function bindIntegrationsMethods(target, mondayIntegration, discordBots, slackAp
4431
4447
  target.getSyncRuns = connectionSync.getSyncRuns.bind(connectionSync);
4432
4448
  target.getSyncRunItems = connectionSync.getSyncRunItems.bind(connectionSync);
4433
4449
  target.getMemberSyncSummary = connectionSync.getMemberSyncSummary.bind(connectionSync);
4450
+ target.getConnectionFieldHomes = connectionSync.getConnectionFieldHomes.bind(connectionSync);
4451
+ target.getInboundRecordStatus = connectionSync.getInboundRecordStatus.bind(connectionSync);
4452
+ target.getConnectionWritePreview = connectionSync.getConnectionWritePreview.bind(connectionSync);
4434
4453
  target.clearConnectionMemberExclusion = connectionSync.clearConnectionMemberExclusion.bind(connectionSync);
4454
+ target.linkUnlinkedMembersByIdentity = connectionSync.linkUnlinkedMembersByIdentity.bind(connectionSync);
4455
+ target.listSubsetImports = connectionSync.listSubsetImports.bind(connectionSync);
4456
+ target.getSubsetImport = connectionSync.getSubsetImport.bind(connectionSync);
4457
+ target.createSubsetImport = connectionSync.createSubsetImport.bind(connectionSync);
4458
+ target.updateSubsetImport = connectionSync.updateSubsetImport.bind(connectionSync);
4459
+ target.deleteSubsetImport = connectionSync.deleteSubsetImport.bind(connectionSync);
4460
+ target.previewSubsetImportSelection = connectionSync.previewSubsetImportSelection.bind(connectionSync);
4461
+ target.previewSubsetImport = connectionSync.previewSubsetImport.bind(connectionSync);
4462
+ target.runSubsetImport = connectionSync.runSubsetImport.bind(connectionSync);
4463
+ target.cancelSubsetImport = connectionSync.cancelSubsetImport.bind(connectionSync);
4464
+ target.listSubsetImportRuns = connectionSync.listSubsetImportRuns.bind(connectionSync);
4465
+ target.listSubsetImportVendorLists = connectionSync.listSubsetImportVendorLists.bind(connectionSync);
4466
+ target.listSubsetImportFilterFields = connectionSync.listSubsetImportFilterFields.bind(connectionSync);
4435
4467
  target.listAvailableAppConnections = appConnections.listAvailableAppConnections.bind(appConnections);
4436
4468
  target.listAppConnections = appConnections.listAppConnections.bind(appConnections);
4437
4469
  target.enablePlatformApp = appConnections.enablePlatformApp.bind(appConnections);
@@ -4578,6 +4610,7 @@ function bindJourneysMethods(target, journeys) {
4578
4610
  target.getJourneyV2Validation = journeys.getJourneyV2Validation.bind(journeys);
4579
4611
  target.getJourneyFilterOptions = journeys.getJourneyFilterOptions.bind(journeys);
4580
4612
  target.getJourneyHealth = journeys.getJourneyHealth.bind(journeys);
4613
+ target.getJourneySendEstimate = journeys.getJourneySendEstimate.bind(journeys);
4581
4614
  target.cloneJourneyAsV2 = journeys.cloneJourneyAsV2.bind(journeys);
4582
4615
  target.createJourney = journeys.createJourney.bind(journeys);
4583
4616
  target.updateJourney = journeys.updateJourney.bind(journeys);
@@ -4620,11 +4653,14 @@ function bindQualificationsMethods(target, qualifications) {
4620
4653
  target.deleteScenario = qualifications.deleteScenario.bind(qualifications);
4621
4654
  target.listTestChatRuns = qualifications.listTestChatRuns.bind(qualifications);
4622
4655
  target.listScenarioHealthSummaries = qualifications.listScenarioHealthSummaries.bind(qualifications);
4656
+ target.getChatTestRun = qualifications.getChatTestRun.bind(qualifications);
4623
4657
  target.getTestChatRun = qualifications.getTestChatRun.bind(qualifications);
4624
4658
  target.listChatCapturedEffects = qualifications.listChatCapturedEffects.bind(qualifications);
4625
4659
  target.listChatRecordChanges = qualifications.listChatRecordChanges.bind(qualifications);
4626
4660
  target.takeTestChatRunEmailTurn = qualifications.takeTestChatRunEmailTurn.bind(qualifications);
4627
4661
  target.takeTestChatRunSmsTurn = qualifications.takeTestChatRunSmsTurn.bind(qualifications);
4662
+ target.captureScenarioDraft = qualifications.captureScenarioDraft.bind(qualifications);
4663
+ target.promoteTestChatFeedback = qualifications.promoteTestChatFeedback.bind(qualifications);
4628
4664
  target.startTestChatRun = qualifications.startTestChatRun.bind(qualifications);
4629
4665
  target.evaluateTestChatRun = qualifications.evaluateTestChatRun.bind(qualifications);
4630
4666
  target.endTestChatRun = qualifications.endTestChatRun.bind(qualifications);
@@ -4632,6 +4668,9 @@ function bindQualificationsMethods(target, qualifications) {
4632
4668
  function bindPersonasMethods(target, personas) {
4633
4669
  target.listPersonas = personas.listPersonas.bind(personas);
4634
4670
  target.getPersona = personas.getPersona.bind(personas);
4671
+ target.getPersonaTestMember = personas.getPersonaTestMember.bind(personas);
4672
+ target.createPersonaTestMember = personas.createPersonaTestMember.bind(personas);
4673
+ target.resetPersonaTestMember = personas.resetPersonaTestMember.bind(personas);
4635
4674
  target.createPersona = personas.createPersona.bind(personas);
4636
4675
  target.updatePersona = personas.updatePersona.bind(personas);
4637
4676
  target.archivePersona = personas.archivePersona.bind(personas);
@@ -4720,9 +4759,9 @@ function getRevisionState(workflow, revision) {
4720
4759
  state: revision?.publishedAt != null ? "published" : "draft"
4721
4760
  };
4722
4761
  }
4723
- var AbilitiesApi, ResourceWorkflowsApi, BundlesApi, InstallationsApi, 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, RoutingRulesApi, SalesforceApi, ConnectionSyncApi, HubspotApi, SitesApi, SubscriptionsApi, SupportRequestsApi, CustomersApi, ResellersApi, SupervisorsApi, TasksApi, TemplatesApi, ToolkitsApi, JourneysApi, WorkflowsApi, WorkflowNotesApi, EventRuleObjectType, EventRuleEventType, EventRuleActionType, DriverMode, MEMBER_RELATIONSHIP_KINDS, WorkspaceInvitationsApi, WorkspacesApi, DashboardsApi, DevicesApi, TeamsAppsApi, ExperimentsApi, PatientSyncConnectionsApi, ActivityApi, MotdApi, InterventionRequestsApi, MetricsApi, DataReportsApi, ProjectsApi, TrackedLinksApi, WORKSPACE_METHOD_NAMES, WORKSPACE_METHOD_NAME_SET, GravityRailClient, WIDGET_SLUGS, CHAT_TYPES, BUILTIN_ASSISTANT_CHAT_TYPES, MEMBER_AGENT_CHAT_TYPES, ActivityGrain, ActivityGroupBy, ActivityOpenItemOrder, ActivityWindowBasis;
4724
- var init_chunk_BQOKENBF = __esm({
4725
- "../sdk/dist/chunk-BQOKENBF.js"() {
4762
+ var AbilitiesApi, ResourceWorkflowsApi, BundlesApi, InstallationsApi, 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, RoutingRulesApi, SalesforceApi, ConnectionSyncApi, HubspotApi, SitesApi, SubscriptionsApi, SupportRequestsApi, CustomersApi, ResellersApi, SupervisorsApi, TasksApi, TemplatesApi, ToolkitsApi, JourneysApi, WorkflowsApi, WorkflowNotesApi, EventRuleObjectType, EventRuleEventType, EventRuleActionType, DriverMode, MEMBER_RELATIONSHIP_KINDS, WorkspaceInvitationsApi, WorkspacesApi, DashboardsApi, DevicesApi, TeamsAppsApi, ExperimentsApi, PatientSyncConnectionsApi, ClaimMdApi, ActivityApi, MotdApi, InterventionRequestsApi, MetricsApi, DataReportsApi, ProjectsApi, TrackedLinksApi, WORKSPACE_METHOD_NAMES, WORKSPACE_METHOD_NAME_SET, GravityRailClient, WIDGET_SLUGS, CHAT_TYPES, BUILTIN_ASSISTANT_CHAT_TYPES, MEMBER_AGENT_CHAT_TYPES, ActivityGrain, ActivityGroupBy, ActivityOpenItemOrder, ActivityWindowBasis;
4763
+ var init_chunk_YDC4OVZE = __esm({
4764
+ "../sdk/dist/chunk-YDC4OVZE.js"() {
4726
4765
  init_chunk_GCN4OMYU();
4727
4766
  init_libphonenumber_js();
4728
4767
  AbilitiesApi = class extends BaseApiClient {
@@ -5283,11 +5322,15 @@ var init_chunk_BQOKENBF = __esm({
5283
5322
  return this.fetch("ai-models/manager");
5284
5323
  }
5285
5324
  /**
5286
- * Get available realtime AI models
5325
+ * Get available realtime AI models.
5326
+ *
5327
+ * `includeHidden` also lists models no longer offered for new selection
5328
+ * (deprecated, flagged `hidden: true`), so a saved selection can be named.
5287
5329
  */
5288
- async getRealtimeModels(provider) {
5330
+ async getRealtimeModels(provider, options) {
5289
5331
  const searchParams = new URLSearchParams();
5290
5332
  if (provider) searchParams.append("provider", provider);
5333
+ if (options?.includeHidden) searchParams.append("includeHidden", "true");
5291
5334
  const queryString = searchParams.toString();
5292
5335
  const url = queryString ? `ai-models/realtime?${queryString}` : "ai-models/realtime";
5293
5336
  return this.fetch(url);
@@ -6265,6 +6308,18 @@ var init_chunk_BQOKENBF = __esm({
6265
6308
  `w/${wid}/calls${params.toString() ? `?${params.toString()}` : ""}`
6266
6309
  );
6267
6310
  }
6311
+ /**
6312
+ * Get one phone call by uuid — the subject a `call.*` Activity event names.
6313
+ *
6314
+ * Authorization is the call's own chat (`chats:read`, then the chat access
6315
+ * policy), so a call with no chat, or one the caller's chat access does not
6316
+ * reach, is a 404. The response carries `chatId`/`chatUuid`, the terminal
6317
+ * disposition axes and `workflowId`, which is what an Activity call card
6318
+ * needs to show the call's outcome and link to its conversation.
6319
+ */
6320
+ async getPhoneCallByUuid(wid, uuid) {
6321
+ return this.fetch(`w/${wid}/calls/by-uuid/${encodeURIComponent(uuid)}`);
6322
+ }
6268
6323
  /**
6269
6324
  * Get message timing data for a chat recording. `source` selects whose
6270
6325
  * timeline the offsets are measured against; omitted means `standard`.
@@ -6285,19 +6340,11 @@ var init_chunk_BQOKENBF = __esm({
6285
6340
  async getEdgeCaptureInfo(wid, chatId) {
6286
6341
  return this.fetch(`w/${wid}/recordings/chat/${chatId}/edge-capture`);
6287
6342
  }
6288
- /**
6289
- * Get PHI-safe provenance metadata for the recording served by
6290
- * `/audio.wav` — source, encryption, channels, duration, status, etc.
6291
- * Staff-only Twilio SIDs are present only for superusers. Returns 404
6292
- * when the chat has no native recording row.
6293
- */
6294
- async getRecordingInfo(wid, chatId) {
6295
- return this.fetch(`w/${wid}/recordings/chat/${chatId}/info`);
6296
- }
6297
6343
  /**
6298
6344
  * Get a single short-lived presigned URL to download the complete call
6299
- * recording as one file: the playable Twilio-native recording, else the
6300
- * complete internal recording. 404 when neither is available.
6345
+ * recording as one file: the complete internal recording, else the newest
6346
+ * ready stored recording (`twilio_native` or `legacy_chunks`). 404 when
6347
+ * neither is available.
6301
6348
  */
6302
6349
  async getCallRecordingDownloadUrl(wid, chatId, options = {}) {
6303
6350
  const params = new URLSearchParams();
@@ -6610,6 +6657,13 @@ var init_chunk_BQOKENBF = __esm({
6610
6657
  body: JSON.stringify(override)
6611
6658
  });
6612
6659
  }
6660
+ /** Set the authenticated Member's personal star without changing Chat access. */
6661
+ async setChatStar(wid, id, isStarred) {
6662
+ return this.fetch(`w/${wid}/chats/${id}/star`, {
6663
+ method: "PUT",
6664
+ body: JSON.stringify({ isStarred })
6665
+ });
6666
+ }
6613
6667
  /** Update the mute status of a chat. */
6614
6668
  async updateChatMute(wid, id, muted, muteReason, muteExpiresOnInbound) {
6615
6669
  return this.fetch(`w/${wid}/chats/${id}/mute`, {
@@ -7460,9 +7514,21 @@ var init_chunk_BQOKENBF = __esm({
7460
7514
  }
7461
7515
  };
7462
7516
  SlackAppsApi = class extends BaseApiClient {
7463
- async getSlackChannelChoices(wid, appId, cursor) {
7517
+ async removeSlackAccount(wid, appId, credentialId) {
7518
+ return this.fetch(`w/${wid}/app-connections/slack/apps/${appId}/accounts/${credentialId}`, {
7519
+ method: "DELETE"
7520
+ });
7521
+ }
7522
+ async removeSlackInstallation(wid, appId, installationId) {
7523
+ return this.fetch(
7524
+ `w/${wid}/app-connections/slack/apps/${appId}/installations/${installationId}`,
7525
+ { method: "DELETE" }
7526
+ );
7527
+ }
7528
+ async getSlackChannelChoices(wid, appId, cursor, teamId) {
7464
7529
  const params = new URLSearchParams({ appId: String(appId) });
7465
7530
  if (cursor) params.set("cursor", cursor);
7531
+ if (teamId) params.set("teamId", teamId);
7466
7532
  return this.fetch(
7467
7533
  `w/${wid}/app-connections/slack/channel-choices?${params}`
7468
7534
  );
@@ -7471,6 +7537,8 @@ var init_chunk_BQOKENBF = __esm({
7471
7537
  const params = new URLSearchParams();
7472
7538
  if (options.appId) params.set("appId", String(options.appId));
7473
7539
  if (options.workflowId) params.set("workflowId", String(options.workflowId));
7540
+ if (options.offset !== void 0) params.set("offset", String(options.offset));
7541
+ if (options.limit !== void 0) params.set("limit", String(options.limit));
7474
7542
  return this.fetch(`w/${wid}/app-connections/slack/entry-points?${params}`);
7475
7543
  }
7476
7544
  async connectSlackEntryPoint(wid, data) {
@@ -7489,6 +7557,9 @@ var init_chunk_BQOKENBF = __esm({
7489
7557
  if (options.sortBy) params.append("sortBy", options.sortBy);
7490
7558
  if (options.sortOrder) params.append("sortOrder", options.sortOrder);
7491
7559
  if (options.search) params.append("search", options.search);
7560
+ if (options.agentId !== void 0) params.set("agentId", String(options.agentId));
7561
+ if (options.workflowId !== void 0) params.set("workflowId", String(options.workflowId));
7562
+ if (options.managed !== void 0) params.set("managed", String(options.managed));
7492
7563
  return this.fetch(
7493
7564
  `w/${wid}/app-connections/slack/apps${params.toString() ? `?${params.toString()}` : ""}`
7494
7565
  );
@@ -7543,6 +7614,8 @@ var init_chunk_BQOKENBF = __esm({
7543
7614
  const params = new URLSearchParams();
7544
7615
  if (options.page) params.append("page", options.page.toString());
7545
7616
  if (options.pageSize) params.append("pageSize", options.pageSize.toString());
7617
+ if (options.search) params.set("search", options.search);
7618
+ if (options.connection) params.set("connection", options.connection);
7546
7619
  return this.fetch(
7547
7620
  `w/${wid}/app-connections/slack/apps/${appId}/installations${params.toString() ? `?${params.toString()}` : ""}`
7548
7621
  );
@@ -7554,6 +7627,8 @@ var init_chunk_BQOKENBF = __esm({
7554
7627
  const params = new URLSearchParams();
7555
7628
  if (options.page) params.append("page", options.page.toString());
7556
7629
  if (options.pageSize) params.append("pageSize", options.pageSize.toString());
7630
+ if (options.teamId) params.set("teamId", options.teamId);
7631
+ if (options.search) params.set("search", options.search);
7557
7632
  return this.fetch(
7558
7633
  `w/${wid}/app-connections/slack/apps/${appId}/accounts${params.toString() ? `?${params.toString()}` : ""}`
7559
7634
  );
@@ -7831,6 +7906,36 @@ var init_chunk_BQOKENBF = __esm({
7831
7906
  body: JSON.stringify(data)
7832
7907
  });
7833
7908
  }
7909
+ /**
7910
+ * Which environments of the shared Gravity Rail athenahealth app this
7911
+ * deployment can use. Requires `apps:read`.
7912
+ */
7913
+ async getAthenaPlatformApp(wid) {
7914
+ return this.fetch(
7915
+ `w/${wid}/app-connections/fhir/athena/platform-app`
7916
+ );
7917
+ }
7918
+ /**
7919
+ * Check that the Gravity Rail athenahealth app can reach a practice in an
7920
+ * environment. Saves nothing. Requires `apps:write`.
7921
+ */
7922
+ async verifyAthenaAccess(wid, data) {
7923
+ return this.fetch(
7924
+ `w/${wid}/app-connections/fhir/athena/verify-access`,
7925
+ { method: "POST", body: JSON.stringify(data) }
7926
+ );
7927
+ }
7928
+ /**
7929
+ * Create an athenahealth connection through the shared Gravity Rail app.
7930
+ * The server re-runs the access probe and answers 400 with
7931
+ * `detail: { code, message }` when it fails. Requires `apps:write`.
7932
+ */
7933
+ async connectAthena(wid, data) {
7934
+ return this.fetch(`w/${wid}/app-connections/fhir/athena/connections`, {
7935
+ method: "POST",
7936
+ body: JSON.stringify(data)
7937
+ });
7938
+ }
7834
7939
  /**
7835
7940
  * Update an existing FHIR connection configuration.
7836
7941
  */
@@ -8049,36 +8154,6 @@ var init_chunk_BQOKENBF = __esm({
8049
8154
  { method: "POST", body: JSON.stringify(data) }
8050
8155
  );
8051
8156
  }
8052
- /**
8053
- * Start, resume, override or preview (dry run) an athenahealth connection's
8054
- * onboarding import. The body is exactly the three mode flags; the server
8055
- * traverses the connection's configured department/status pairs. Returns
8056
- * 202 with the Temporal workflow and run ids. Requires `workspace:admin`.
8057
- */
8058
- async fhirStartOnboardingImport(wid, connectionId, data = {}) {
8059
- const body = {
8060
- dryRun: data.dryRun ?? false,
8061
- resume: data.resume ?? false,
8062
- override: data.override ?? false
8063
- };
8064
- return this.fetch(
8065
- `w/${wid}/app-connections/fhir/connections/${connectionId}/onboarding-import`,
8066
- {
8067
- method: "POST",
8068
- body: JSON.stringify(body)
8069
- }
8070
- );
8071
- }
8072
- /**
8073
- * Read an athenahealth connection's onboarding-import progress (durable,
8074
- * approximate totals) and its known Temporal execution. GET-only: never
8075
- * starts or resumes work. Requires `workspace:admin`.
8076
- */
8077
- async fhirGetOnboardingImportStatus(wid, connectionId) {
8078
- return this.fetch(
8079
- `w/${wid}/app-connections/fhir/connections/${connectionId}/onboarding-import`
8080
- );
8081
- }
8082
8157
  };
8083
8158
  InboundFaxStatus = {
8084
8159
  pending: "pending",
@@ -8699,6 +8774,23 @@ var init_chunk_BQOKENBF = __esm({
8699
8774
  );
8700
8775
  return response.arrayBuffer();
8701
8776
  }
8777
+ /**
8778
+ * Reply and bounce rates for the emails one inbox sent in a period.
8779
+ *
8780
+ * `dateFrom` (inclusive) and `dateTo` (exclusive) are ISO 8601 instants with
8781
+ * an offset and must be passed together, at most 90 days apart; omit both
8782
+ * for the server's rolling last 30 days. Requires `inboxes:read` and
8783
+ * `analytics:read` plus admin access to the inbox. Aggregates only.
8784
+ */
8785
+ async getInboxOutboundEmailStats(wid, inboxId, period = {}) {
8786
+ const params = new URLSearchParams();
8787
+ if (period.dateFrom) params.append("date_from", period.dateFrom);
8788
+ if (period.dateTo) params.append("date_to", period.dateTo);
8789
+ const query = params.toString();
8790
+ return this.fetch(
8791
+ `w/${wid}/inboxes/${inboxId}/outbound-email-stats${query ? `?${query}` : ""}`
8792
+ );
8793
+ }
8702
8794
  /** List email threads in an inbox. */
8703
8795
  async getInboxThreads(wid, inboxId) {
8704
8796
  return this.fetch(`w/${wid}/inboxes/${inboxId}/threads`);
@@ -10689,6 +10781,18 @@ var init_chunk_BQOKENBF = __esm({
10689
10781
  async listA2PBrands(orgUuid) {
10690
10782
  return this.fetch(`o/${orgUuid}/a2p-brands`);
10691
10783
  }
10784
+ /**
10785
+ * Poll Twilio for one brand now and record its brand and campaign statuses,
10786
+ * as the scheduled sync would. Returns the brand as recorded afterwards,
10787
+ * without the live workflow fields `getA2PBrand` adds.
10788
+ */
10789
+ async syncA2PBrand(orgUuid, brandUuid) {
10790
+ return this.fetch(
10791
+ `o/${orgUuid}/a2p-brands/${brandUuid}/sync`,
10792
+ // Empty JSON body is the CSRF barrier the route requires (GRA-6284).
10793
+ { method: "POST", body: JSON.stringify({}) }
10794
+ );
10795
+ }
10692
10796
  /**
10693
10797
  * Live per-brand campaign use-case eligibility. Approved brands only — a
10694
10798
  * brand still under TCR review comes back as a structured 412 the picker
@@ -11139,6 +11243,14 @@ var init_chunk_BQOKENBF = __esm({
11139
11243
  async getPhoneNumber(wid, id) {
11140
11244
  return this.fetch(`w/${wid}/phone-numbers/${id}`);
11141
11245
  }
11246
+ /**
11247
+ * What this number still needs from its organization: the texting and
11248
+ * caller ID registration states of the business it belongs to. States only —
11249
+ * readable with `phones:read`, so it carries none of the business's forms.
11250
+ */
11251
+ async getPhoneNumberSetupStatus(wid, id) {
11252
+ return this.fetch(`w/${wid}/phone-numbers/${id}/setup-status`);
11253
+ }
11142
11254
  /** Create a new phone number record. */
11143
11255
  async createPhoneNumber(wid, phoneNumber) {
11144
11256
  return this.fetch(`w/${wid}/phone-numbers`, {
@@ -11447,6 +11559,21 @@ var init_chunk_BQOKENBF = __esm({
11447
11559
  async getPersona(wid, id) {
11448
11560
  return this.fetch(`w/${wid}/personas/${id}`);
11449
11561
  }
11562
+ async getPersonaTestMember(wid, id) {
11563
+ return this.fetch(`w/${wid}/personas/${id}/test-member`);
11564
+ }
11565
+ async createPersonaTestMember(wid, id) {
11566
+ return this.fetch(`w/${wid}/personas/${id}/test-member`, {
11567
+ method: "POST",
11568
+ body: JSON.stringify({})
11569
+ });
11570
+ }
11571
+ async resetPersonaTestMember(wid, id) {
11572
+ return this.fetch(`w/${wid}/personas/${id}/test-member/reset`, {
11573
+ method: "POST",
11574
+ body: JSON.stringify({})
11575
+ });
11576
+ }
11450
11577
  async createPersona(wid, data) {
11451
11578
  return this.fetch(`w/${wid}/personas`, {
11452
11579
  method: "POST",
@@ -11505,6 +11632,21 @@ var init_chunk_BQOKENBF = __esm({
11505
11632
  }
11506
11633
  };
11507
11634
  QualificationsApi = class extends BaseApiClient {
11635
+ /** Copy an authorized test Chat prefix into an editable Scenario draft. */
11636
+ async captureScenarioDraft(wid, chatId, throughMessageId) {
11637
+ return this.fetch(`w/${wid}/qualifications/chats/${chatId}/scenario-draft`, {
11638
+ method: "POST",
11639
+ body: JSON.stringify({ throughMessageId })
11640
+ });
11641
+ }
11642
+ /** Pause before the next Persona turn; a current Agent reply may finish. */
11643
+ /** Turn feedback into an explicitly authored rubric on the same Workflow. */
11644
+ async promoteTestChatFeedback(wid, runId, request) {
11645
+ return this.fetch(`w/${wid}/qualifications/test-chat-runs/${runId}/feedback/criterion`, {
11646
+ method: "POST",
11647
+ body: JSON.stringify(request)
11648
+ });
11649
+ }
11508
11650
  /** List qualifications in a workspace, paginated. */
11509
11651
  async getQualifications(wid, params) {
11510
11652
  const query = new URLSearchParams();
@@ -11596,6 +11738,12 @@ var init_chunk_BQOKENBF = __esm({
11596
11738
  `w/${wid}/qualifications/workflows/${workflowId}/scenario-health-summaries${qs}`
11597
11739
  );
11598
11740
  }
11741
+ /** The saved run of a test Chat, including its driver and completion state. */
11742
+ async getChatTestRun(wid, chatId) {
11743
+ return this.fetch(
11744
+ `w/${wid}/qualifications/chats/${chatId}/test-chat-run`
11745
+ );
11746
+ }
11599
11747
  async getTestChatRun(wid, runId) {
11600
11748
  return this.fetch(`w/${wid}/qualifications/test-chat-runs/${runId}`);
11601
11749
  }
@@ -11876,9 +12024,9 @@ var init_chunk_BQOKENBF = __esm({
11876
12024
  });
11877
12025
  }
11878
12026
  /**
11879
- * Start a durable run that links unlinked members by Salesforce Id / email
11880
- * and hydrates them. One run per connection; a second start while one is
11881
- * in flight is 409.
12027
+ * @deprecated Use `linkUnlinkedMembersByIdentity(wid, connectionId)`, which
12028
+ * serves every connector that links by identity. This calls the retained
12029
+ * Salesforce-only route and will be removed once no caller remains.
11882
12030
  */
11883
12031
  async linkUnlinkedSalesforceMembersByIdentity(wid) {
11884
12032
  return this.fetch(
@@ -12003,6 +12151,20 @@ var init_chunk_BQOKENBF = __esm({
12003
12151
  { method: "PUT", body: JSON.stringify(data) }
12004
12152
  );
12005
12153
  }
12154
+ async getConnectionFieldHomes(wid, connectionId) {
12155
+ return this.fetch(`w/${wid}/app-connections/${connectionId}/field-homes`);
12156
+ }
12157
+ /** Each inbound record source's latest pass: closed status, times and counts. */
12158
+ async getInboundRecordStatus(wid, connectionId) {
12159
+ return this.fetch(
12160
+ `w/${wid}/app-connections/${connectionId}/inbound-records/status`
12161
+ );
12162
+ }
12163
+ async getConnectionWritePreview(wid, connectionId, memberId) {
12164
+ return this.fetch(
12165
+ `w/${wid}/app-connections/${connectionId}/write-preview/members/${memberId}`
12166
+ );
12167
+ }
12006
12168
  async getConnectionSyncCheckpoint(wid, connectionId, direction = "inbound", syncKey = "default") {
12007
12169
  const query = new URLSearchParams({
12008
12170
  direction,
@@ -12065,6 +12227,108 @@ var init_chunk_BQOKENBF = __esm({
12065
12227
  { method: "DELETE" }
12066
12228
  );
12067
12229
  }
12230
+ /**
12231
+ * Start a durable run that links the connection's unlinked members to
12232
+ * remote records by identity (email, phone, or the vendor's own key) and
12233
+ * hydrates them. Served for any connector that declares a remote identity
12234
+ * resolver (Salesforce, HubSpot); another connector is 400. One run per
12235
+ * connection: a second start while one is in flight is 409.
12236
+ */
12237
+ async linkUnlinkedMembersByIdentity(wid, connectionId) {
12238
+ return this.fetch(
12239
+ `w/${wid}/app-connections/${connectionId}/link-unlinked-by-identity`,
12240
+ { method: "POST", body: JSON.stringify({}) }
12241
+ );
12242
+ }
12243
+ // --- Saved subset imports (Integration Standard IM-1..IM-4) ---------------
12244
+ subsetImportsPath(wid, connectionId, suffix2 = "") {
12245
+ return `w/${wid}/app-connections/${connectionId}/subset-imports${suffix2}`;
12246
+ }
12247
+ /** The connection's saved imports, newest first, and the kinds it accepts. */
12248
+ async listSubsetImports(wid, connectionId) {
12249
+ return this.fetch(this.subsetImportsPath(wid, connectionId));
12250
+ }
12251
+ async getSubsetImport(wid, connectionId, importId) {
12252
+ return this.fetch(
12253
+ this.subsetImportsPath(wid, connectionId, `/${encodeURIComponent(importId)}`)
12254
+ );
12255
+ }
12256
+ /** Save a named selection. Saving never reads the vendor or imports. */
12257
+ async createSubsetImport(wid, connectionId, data) {
12258
+ return this.fetch(this.subsetImportsPath(wid, connectionId), {
12259
+ method: "POST",
12260
+ body: JSON.stringify(data)
12261
+ });
12262
+ }
12263
+ /** Replace a saved selection. A changed selection resets its progress. */
12264
+ async updateSubsetImport(wid, connectionId, importId, data) {
12265
+ return this.fetch(
12266
+ this.subsetImportsPath(wid, connectionId, `/${encodeURIComponent(importId)}`),
12267
+ { method: "PUT", body: JSON.stringify(data) }
12268
+ );
12269
+ }
12270
+ /** Remove a saved import. Its Members and links stay. */
12271
+ async deleteSubsetImport(wid, connectionId, importId) {
12272
+ await this.fetch(
12273
+ this.subsetImportsPath(wid, connectionId, `/${encodeURIComponent(importId)}`),
12274
+ { method: "DELETE" }
12275
+ );
12276
+ }
12277
+ /** Count and sample an unsaved selection. Never writes. */
12278
+ async previewSubsetImportSelection(wid, connectionId, selection) {
12279
+ return this.fetch(
12280
+ this.subsetImportsPath(wid, connectionId, "/preview"),
12281
+ { method: "POST", body: JSON.stringify({ selection }) }
12282
+ );
12283
+ }
12284
+ /** Count and sample a saved selection. Never writes. */
12285
+ async previewSubsetImport(wid, connectionId, importId) {
12286
+ return this.fetch(
12287
+ this.subsetImportsPath(wid, connectionId, `/${encodeURIComponent(importId)}/preview`),
12288
+ // The CSRF barrier refuses a body-less POST (422); `{}` is the request.
12289
+ { method: "POST", body: JSON.stringify({}) }
12290
+ );
12291
+ }
12292
+ /**
12293
+ * Start the import in the background (202). A failed or cancelled import
12294
+ * resumes where it stopped unless `restart` is true.
12295
+ */
12296
+ async runSubsetImport(wid, connectionId, importId, options) {
12297
+ return this.fetch(
12298
+ this.subsetImportsPath(wid, connectionId, `/${encodeURIComponent(importId)}/run`),
12299
+ { method: "POST", body: JSON.stringify({ restart: options?.restart ?? false }) }
12300
+ );
12301
+ }
12302
+ /** Ask a running import to stop (202); its progress is kept for a resume. */
12303
+ async cancelSubsetImport(wid, connectionId, importId) {
12304
+ return this.fetch(
12305
+ this.subsetImportsPath(wid, connectionId, `/${encodeURIComponent(importId)}/cancel`),
12306
+ // The CSRF barrier refuses a body-less POST (422); `{}` is the request.
12307
+ { method: "POST", body: JSON.stringify({}) }
12308
+ );
12309
+ }
12310
+ /** The connection's import-run history, newest first (counts only). */
12311
+ async listSubsetImportRuns(wid, connectionId, limit = 20) {
12312
+ return this.fetch(
12313
+ this.subsetImportsPath(wid, connectionId, `/runs?limit=${limit}`)
12314
+ );
12315
+ }
12316
+ /** Vendor lists a `vendor_list` import can name (configuration only). */
12317
+ async listSubsetImportVendorLists(wid, connectionId, options) {
12318
+ const query = new URLSearchParams({
12319
+ query: options?.query ?? "",
12320
+ limit: String(options?.limit ?? 50)
12321
+ });
12322
+ return this.fetch(
12323
+ this.subsetImportsPath(wid, connectionId, `/vendor-lists?${query}`)
12324
+ );
12325
+ }
12326
+ /** Remote fields a `field_filter` import can name, with their operators. */
12327
+ async listSubsetImportFilterFields(wid, connectionId) {
12328
+ return this.fetch(
12329
+ this.subsetImportsPath(wid, connectionId, "/filter-fields")
12330
+ );
12331
+ }
12068
12332
  };
12069
12333
  HubspotApi = class extends BaseApiClient {
12070
12334
  /**
@@ -12168,6 +12432,35 @@ var init_chunk_BQOKENBF = __esm({
12168
12432
  `w/${wid}/app-connections/hubspot/sync-settings/hs-properties`
12169
12433
  );
12170
12434
  }
12435
+ /** Mappable HubSpot deal property definitions (deal inbound record sources). */
12436
+ async getHubspotDealProperties(wid) {
12437
+ return this.fetch(
12438
+ `w/${wid}/app-connections/hubspot/sync-settings/hs-properties?objectType=deals`
12439
+ );
12440
+ }
12441
+ /** The portal's Meetings booking links, or `missing_scope` without the scheduler scope. */
12442
+ async getHubspotMeetingLinks(wid) {
12443
+ return this.fetch(
12444
+ `w/${wid}/app-connections/hubspot/sync-settings/meeting-links`
12445
+ );
12446
+ }
12447
+ /** The portal's forms and their fields, or `missing_scope` without the `forms` scope. */
12448
+ async getHubspotForms(wid) {
12449
+ return this.fetch(
12450
+ `w/${wid}/app-connections/hubspot/sync-settings/forms`
12451
+ );
12452
+ }
12453
+ /**
12454
+ * Raw HubSpot property definitions for one CRM object type
12455
+ * (`GET /get_properties/{objectType}`), as HubSpot's properties API
12456
+ * returns them. Use `getHubspotContactProperties` for the sync-mappable
12457
+ * contact property list the field mapper shows.
12458
+ */
12459
+ async getHubspotObjectProperties(wid, objectType) {
12460
+ return this.fetch(
12461
+ `w/${wid}/app-connections/hubspot/get_properties/${encodeURIComponent(objectType)}`
12462
+ );
12463
+ }
12171
12464
  async getHubspotManagedRules(wid) {
12172
12465
  return this.fetch(`w/${wid}/app-connections/hubspot/managed-rules`);
12173
12466
  }
@@ -13186,6 +13479,17 @@ var init_chunk_BQOKENBF = __esm({
13186
13479
  async getJourneyHealth(wid, journeyId) {
13187
13480
  return this.fetch(`w/${wid}/journeys/${journeyId}/health`);
13188
13481
  }
13482
+ /**
13483
+ * How many days the journey's texts take at the workspace's current sending
13484
+ * limits — advice for the publish and enroll confirmations, never a gate.
13485
+ * `additionalMembers` is the size of a batch about to be enrolled.
13486
+ */
13487
+ async getJourneySendEstimate(wid, journeyId, additionalMembers = 0) {
13488
+ const query = new URLSearchParams({ additionalMembers: String(additionalMembers) });
13489
+ return this.fetch(
13490
+ `w/${wid}/journeys/${journeyId}/send-estimate?${query.toString()}`
13491
+ );
13492
+ }
13189
13493
  /** Create a step within a journey. */
13190
13494
  async createStep(wid, journeyId, data) {
13191
13495
  return this.fetch(`w/${wid}/journeys/${journeyId}/steps`, {
@@ -14352,13 +14656,10 @@ var init_chunk_BQOKENBF = __esm({
14352
14656
  }
14353
14657
  /** Register a Web Push subscription for the current user. */
14354
14658
  async registerPushSubscription(wid, subscription) {
14355
- return this.fetch(
14356
- `w/${wid}/push-subscriptions`,
14357
- {
14358
- method: "POST",
14359
- body: JSON.stringify(subscription)
14360
- }
14361
- );
14659
+ return this.fetch(`w/${wid}/push-subscriptions`, {
14660
+ method: "POST",
14661
+ body: JSON.stringify(subscription)
14662
+ });
14362
14663
  }
14363
14664
  /** Unregister a Web Push subscription by endpoint URL. */
14364
14665
  async unregisterPushSubscription(wid, endpoint) {
@@ -14373,6 +14674,14 @@ var init_chunk_BQOKENBF = __esm({
14373
14674
  async listPushSubscriptions(wid) {
14374
14675
  return this.fetch(`w/${wid}/push-subscriptions`);
14375
14676
  }
14677
+ /** Submit a fixed generic test to an owned browser registration. */
14678
+ async testPushSubscription(wid, subscriptionId) {
14679
+ const body = {};
14680
+ return this.fetch(
14681
+ `w/${wid}/push-subscriptions/${subscriptionId}/test`,
14682
+ { method: "POST", body: JSON.stringify(body) }
14683
+ );
14684
+ }
14376
14685
  /** List org domains available for workspace email inbox routing. */
14377
14686
  async getWorkspaceEmailDomains(wid) {
14378
14687
  return this.fetch(`w/${wid}/domains/for-email`);
@@ -15104,6 +15413,31 @@ var init_chunk_BQOKENBF = __esm({
15104
15413
  return this.fetch(`w/${wid}/app-connections/patientsync/`, { method: "DELETE" });
15105
15414
  }
15106
15415
  };
15416
+ ClaimMdApi = class extends BaseApiClient {
15417
+ async getClaimMdStatus(wid) {
15418
+ return this.fetch(`w/${wid}/app-connections/claim-md/status`);
15419
+ }
15420
+ /** Sends `{}` deliberately: the route requires a JSON body as a CSRF barrier. */
15421
+ async installClaimMd(wid) {
15422
+ return this.fetch(`w/${wid}/app-connections/claim-md/install`, {
15423
+ method: "POST",
15424
+ body: JSON.stringify({})
15425
+ });
15426
+ }
15427
+ async configureClaimMd(wid, data) {
15428
+ return this.fetch(`w/${wid}/app-connections/claim-md/configure`, {
15429
+ method: "POST",
15430
+ body: JSON.stringify(data)
15431
+ });
15432
+ }
15433
+ /** Checks a pasted AccountKey without storing it. */
15434
+ async verifyClaimMdKey(wid, data) {
15435
+ return this.fetch(`w/${wid}/app-connections/claim-md/verify`, {
15436
+ method: "POST",
15437
+ body: JSON.stringify(data)
15438
+ });
15439
+ }
15440
+ };
15107
15441
  ActivityApi = class extends BaseApiClient {
15108
15442
  /** The account mount: this caller's whole estate, at any grain. */
15109
15443
  async queryActivity(request) {
@@ -15626,6 +15960,7 @@ var init_chunk_BQOKENBF = __esm({
15626
15960
  "cancelCalendarEvent",
15627
15961
  "cancelChatCallback",
15628
15962
  "cancelCredentialUpdateInvite",
15963
+ "cancelSubsetImport",
15629
15964
  "checkAvailability",
15630
15965
  "checkSiteDomainAvailability",
15631
15966
  "checkSiteSlugAvailability",
@@ -15640,6 +15975,7 @@ var init_chunk_BQOKENBF = __esm({
15640
15975
  "commentOnWorkspaceSupportRequest",
15641
15976
  "completeDiscordLink",
15642
15977
  "configureConfluence",
15978
+ "configureClaimMd",
15643
15979
  "configureDocumoFax",
15644
15980
  "configureHealthie",
15645
15981
  "configurePatientSync",
@@ -15647,6 +15983,7 @@ var init_chunk_BQOKENBF = __esm({
15647
15983
  "configureMondayConnection",
15648
15984
  "configureSalesforce",
15649
15985
  "configureZendeskConnection",
15986
+ "connectAthena",
15650
15987
  "convertEmail",
15651
15988
  "convertFile",
15652
15989
  "createAbility",
@@ -15655,6 +15992,15 @@ var init_chunk_BQOKENBF = __esm({
15655
15992
  "createApiKey",
15656
15993
  "createAssignment",
15657
15994
  "bindInstallationSlots",
15995
+ "createSubsetImport",
15996
+ "deleteSubsetImport",
15997
+ "getSubsetImport",
15998
+ "listSubsetImportFilterFields",
15999
+ "listSubsetImportRuns",
16000
+ "listSubsetImports",
16001
+ "listSubsetImportVendorLists",
16002
+ "previewSubsetImport",
16003
+ "previewSubsetImportSelection",
15658
16004
  "restoreInstallationForm",
15659
16005
  "createBundle",
15660
16006
  "createCalendar",
@@ -15663,6 +16009,7 @@ var init_chunk_BQOKENBF = __esm({
15663
16009
  "createCalendarSchedule",
15664
16010
  "createChat",
15665
16011
  "createChatInteractionSession",
16012
+ "runSubsetImport",
15666
16013
  "transitionChatInteractionSession",
15667
16014
  "createChatCompletion",
15668
16015
  "createChatFilter",
@@ -15843,7 +16190,6 @@ var init_chunk_BQOKENBF = __esm({
15843
16190
  "fhirGetCsvImportSettings",
15844
16191
  "fhirGetEncounterSyncRuns",
15845
16192
  "fhirGetEncounterSyncStatus",
15846
- "fhirGetOnboardingImportStatus",
15847
16193
  "fhirImportPatient",
15848
16194
  "fhirLinkMember",
15849
16195
  "fhirListLinkedMembers",
@@ -15852,7 +16198,6 @@ var init_chunk_BQOKENBF = __esm({
15852
16198
  "fhirSearchLocations",
15853
16199
  "fhirSearchPatients",
15854
16200
  "fhirSearchPractitioners",
15855
- "fhirStartOnboardingImport",
15856
16201
  "fhirSyncMember",
15857
16202
  "fhirUnlinkMember",
15858
16203
  "fhirUpdateCsvImportSettings",
@@ -15878,6 +16223,7 @@ var init_chunk_BQOKENBF = __esm({
15878
16223
  "getAnonymousResolutions",
15879
16224
  "getApiKeys",
15880
16225
  "getArchiveBlockers",
16226
+ "getAthenaPlatformApp",
15881
16227
  "getAssignment",
15882
16228
  "getAssignmentCelContext",
15883
16229
  "getAssignmentMessages",
@@ -15940,9 +16286,12 @@ var init_chunk_BQOKENBF = __esm({
15940
16286
  "getClientWorkspace",
15941
16287
  "getConfigurationHealth",
15942
16288
  "getConfluenceStatus",
16289
+ "getConnectionFieldHomes",
16290
+ "getInboundRecordStatus",
15943
16291
  "getConnectionSyncCapabilities",
15944
16292
  "getConnectionSyncCheckpoint",
15945
16293
  "getConnectionSyncConfig",
16294
+ "getConnectionWritePreview",
15946
16295
  "getCredentialUpdateInvites",
15947
16296
  "getCurrentMember",
15948
16297
  "clearMemberWorkflowVoice",
@@ -15979,6 +16328,7 @@ var init_chunk_BQOKENBF = __esm({
15979
16328
  "getDiscordBots",
15980
16329
  "getDiscordGuilds",
15981
16330
  "getDiscordThreads",
16331
+ "getClaimMdStatus",
15982
16332
  "getDocumoFaxSetup",
15983
16333
  "listDocumoFaxes",
15984
16334
  "getDocumoFaxStatus",
@@ -16007,6 +16357,7 @@ var init_chunk_BQOKENBF = __esm({
16007
16357
  "getSiteSourceTemplates",
16008
16358
  "getThemeSettings",
16009
16359
  "importSiteSourceZip",
16360
+ "installClaimMd",
16010
16361
  "installDocumoFax",
16011
16362
  "previewDataReport",
16012
16363
  "previewQuery",
@@ -16043,7 +16394,11 @@ var init_chunk_BQOKENBF = __esm({
16043
16394
  "getHealthieStatus",
16044
16395
  "getPatientSyncStatus",
16045
16396
  "getHubspotContactProperties",
16397
+ "getHubspotDealProperties",
16398
+ "getHubspotForms",
16399
+ "getHubspotMeetingLinks",
16046
16400
  "getHubspotManagedRules",
16401
+ "getHubspotObjectProperties",
16047
16402
  "getHubspotReconciliationMatches",
16048
16403
  "getHubspotStatus",
16049
16404
  "getHubspotSyncLogs",
@@ -16055,6 +16410,7 @@ var init_chunk_BQOKENBF = __esm({
16055
16410
  "getInbox",
16056
16411
  "getInboxEmail",
16057
16412
  "getInboxEmails",
16413
+ "getInboxOutboundEmailStats",
16058
16414
  "getInboxThreads",
16059
16415
  "getInboxes",
16060
16416
  "getInterventionRequests",
@@ -16064,6 +16420,7 @@ var init_chunk_BQOKENBF = __esm({
16064
16420
  "getJourneyHealth",
16065
16421
  "getJourneyMembers",
16066
16422
  "getJourneyNotes",
16423
+ "getJourneySendEstimate",
16067
16424
  "getJourneyV2Validation",
16068
16425
  "getJourneys",
16069
16426
  "getLinkablePhones",
@@ -16124,11 +16481,16 @@ var init_chunk_BQOKENBF = __esm({
16124
16481
  "getPage",
16125
16482
  "getPageBySlug",
16126
16483
  "getPersona",
16484
+ "getPersonaTestMember",
16485
+ "createPersonaTestMember",
16486
+ "resetPersonaTestMember",
16127
16487
  "getPhoneCalls",
16488
+ "getPhoneCallByUuid",
16128
16489
  "getPhoneNumber",
16129
16490
  "getPhoneNumberCalls",
16130
16491
  "getPhoneNumberFaxes",
16131
16492
  "getPhoneNumberMessages",
16493
+ "getPhoneNumberSetupStatus",
16132
16494
  "getPhoneNumberVoicemails",
16133
16495
  "getPhoneNumbers",
16134
16496
  "getPhoneUsageReport",
@@ -16144,7 +16506,6 @@ var init_chunk_BQOKENBF = __esm({
16144
16506
  "getPublicProducts",
16145
16507
  "getQualification",
16146
16508
  "getQualifications",
16147
- "getRecordingInfo",
16148
16509
  "getResellerWorkspaces",
16149
16510
  "getRoutine",
16150
16511
  "getRoutineConfigEvents",
@@ -16171,6 +16532,8 @@ var init_chunk_BQOKENBF = __esm({
16171
16532
  "getSlackAppAccounts",
16172
16533
  "getSlackApps",
16173
16534
  "getSlackInstallations",
16535
+ "removeSlackAccount",
16536
+ "removeSlackInstallation",
16174
16537
  "getSlackThreads",
16175
16538
  "getStepMemberCounts",
16176
16539
  "getStepMembers",
@@ -16187,6 +16550,7 @@ var init_chunk_BQOKENBF = __esm({
16187
16550
  "getTeamsConversations",
16188
16551
  "getTeamsInstallations",
16189
16552
  "getTemplateContext",
16553
+ "getChatTestRun",
16190
16554
  "getTestChatRun",
16191
16555
  "getThreadEmails",
16192
16556
  "getTool",
@@ -16260,6 +16624,7 @@ var init_chunk_BQOKENBF = __esm({
16260
16624
  "linkMemberToMonday",
16261
16625
  "linkMemberToSalesforce",
16262
16626
  "linkPhoneNumber",
16627
+ "linkUnlinkedMembersByIdentity",
16263
16628
  "linkUnlinkedSalesforceMembersByIdentity",
16264
16629
  "listAbilities",
16265
16630
  "listAnonymousFormSubmissions",
@@ -16343,6 +16708,7 @@ var init_chunk_BQOKENBF = __esm({
16343
16708
  "reenrollMember",
16344
16709
  "renameFieldSlug",
16345
16710
  "registerLinkedRolesMetadata",
16711
+ "testPushSubscription",
16346
16712
  "registerPushSubscription",
16347
16713
  "reindexFolder",
16348
16714
  "releasePhoneNumber",
@@ -16354,6 +16720,7 @@ var init_chunk_BQOKENBF = __esm({
16354
16720
  "reorderMenuItems",
16355
16721
  "reconcileInstallation",
16356
16722
  "setInstallationPolicy",
16723
+ "updateSubsetImport",
16357
16724
  "upgradeInstallation",
16358
16725
  "replaceBundleDraft",
16359
16726
  "replyToEmail",
@@ -16389,6 +16756,8 @@ var init_chunk_BQOKENBF = __esm({
16389
16756
  "startHubspotOAuth",
16390
16757
  "startSalesforceOAuth",
16391
16758
  "startSyncRun",
16759
+ "captureScenarioDraft",
16760
+ "promoteTestChatFeedback",
16392
16761
  "startTestChatRun",
16393
16762
  "summarizeChat",
16394
16763
  "syncCalendarWithGoogle",
@@ -16428,6 +16797,7 @@ var init_chunk_BQOKENBF = __esm({
16428
16797
  "updateChatFilter",
16429
16798
  "updateChatLabel",
16430
16799
  "updateChatModelOverride",
16800
+ "setChatStar",
16431
16801
  "updateChatMute",
16432
16802
  "updateClientWorkspace",
16433
16803
  "updateConnection",
@@ -16507,6 +16877,8 @@ var init_chunk_BQOKENBF = __esm({
16507
16877
  "validateDataTypeSlug",
16508
16878
  "validateQuery",
16509
16879
  "validateWorkflowName",
16880
+ "verifyAthenaAccess",
16881
+ "verifyClaimMdKey",
16510
16882
  "verifyDocumoFax"
16511
16883
  ];
16512
16884
  WORKSPACE_METHOD_NAME_SET = new Set(WORKSPACE_METHOD_NAMES);
@@ -16560,6 +16932,7 @@ var init_chunk_BQOKENBF = __esm({
16560
16932
  updateChat;
16561
16933
  getChatModelOverride;
16562
16934
  updateChatModelOverride;
16935
+ setChatStar;
16563
16936
  updateChatMute;
16564
16937
  summarizeChat;
16565
16938
  getChatMessages;
@@ -16593,8 +16966,8 @@ var init_chunk_BQOKENBF = __esm({
16593
16966
  getChatFilterCount;
16594
16967
  // Calls API
16595
16968
  getPhoneCalls;
16969
+ getPhoneCallByUuid;
16596
16970
  getMessageTiming;
16597
- getRecordingInfo;
16598
16971
  getEdgeCaptureInfo;
16599
16972
  getCallRecordingDownloadUrl;
16600
16973
  getCelContext;
@@ -16739,11 +17112,14 @@ var init_chunk_BQOKENBF = __esm({
16739
17112
  deleteScenario;
16740
17113
  listTestChatRuns;
16741
17114
  listScenarioHealthSummaries;
17115
+ getChatTestRun;
16742
17116
  getTestChatRun;
16743
17117
  listChatCapturedEffects;
16744
17118
  listChatRecordChanges;
16745
17119
  takeTestChatRunEmailTurn;
16746
17120
  takeTestChatRunSmsTurn;
17121
+ captureScenarioDraft;
17122
+ promoteTestChatFeedback;
16747
17123
  startTestChatRun;
16748
17124
  evaluateTestChatRun;
16749
17125
  endTestChatRun;
@@ -16757,6 +17133,9 @@ var init_chunk_BQOKENBF = __esm({
16757
17133
  previewDataReport;
16758
17134
  listPersonas;
16759
17135
  getPersona;
17136
+ getPersonaTestMember;
17137
+ createPersonaTestMember;
17138
+ resetPersonaTestMember;
16760
17139
  createPersona;
16761
17140
  updatePersona;
16762
17141
  archivePersona;
@@ -16827,6 +17206,7 @@ var init_chunk_BQOKENBF = __esm({
16827
17206
  getJourneyV2Validation;
16828
17207
  getJourneyFilterOptions;
16829
17208
  getJourneyHealth;
17209
+ getJourneySendEstimate;
16830
17210
  cloneJourneyAsV2;
16831
17211
  createJourney;
16832
17212
  updateJourney;
@@ -17053,6 +17433,7 @@ var init_chunk_BQOKENBF = __esm({
17053
17433
  setWorkspaceLabels;
17054
17434
  previewWorkspaceScope;
17055
17435
  getVapidPublicKey;
17436
+ testPushSubscription;
17056
17437
  registerPushSubscription;
17057
17438
  unregisterPushSubscription;
17058
17439
  listPushSubscriptions;
@@ -17332,6 +17713,7 @@ var init_chunk_BQOKENBF = __esm({
17332
17713
  createPhoneNumber;
17333
17714
  updatePhoneNumber;
17334
17715
  getArchiveBlockers;
17716
+ getPhoneNumberSetupStatus;
17335
17717
  archivePhoneNumber;
17336
17718
  getPhoneNumberCalls;
17337
17719
  getPhoneNumberOutboundAnalyticsSummary;
@@ -17364,6 +17746,7 @@ var init_chunk_BQOKENBF = __esm({
17364
17746
  sendInboxEmail;
17365
17747
  previewInboxEmail;
17366
17748
  previewEmailReply;
17749
+ getInboxOutboundEmailStats;
17367
17750
  getNotificationRules;
17368
17751
  createNotificationRule;
17369
17752
  updateNotificationRule;
@@ -17528,6 +17911,8 @@ var init_chunk_BQOKENBF = __esm({
17528
17911
  deleteSlackApp;
17529
17912
  getSlackThreads;
17530
17913
  getSlackInstallations;
17914
+ removeSlackAccount;
17915
+ removeSlackInstallation;
17531
17916
  getSlackChannelChoices;
17532
17917
  getSlackEntryPoints;
17533
17918
  connectSlackEntryPoint;
@@ -17573,8 +17958,9 @@ var init_chunk_BQOKENBF = __esm({
17573
17958
  fhirGetEncounterSyncRuns;
17574
17959
  fhirRefreshEncounterPatient;
17575
17960
  fhirBackfillEncounterSync;
17576
- fhirStartOnboardingImport;
17577
- fhirGetOnboardingImportStatus;
17961
+ getAthenaPlatformApp;
17962
+ verifyAthenaAccess;
17963
+ connectAthena;
17578
17964
  // Healthie API
17579
17965
  getDocumoFaxStatus;
17580
17966
  getDocumoFaxSetup;
@@ -17583,6 +17969,10 @@ var init_chunk_BQOKENBF = __esm({
17583
17969
  configureDocumoFax;
17584
17970
  verifyDocumoFax;
17585
17971
  rotateDocumoFaxCredentials;
17972
+ getClaimMdStatus;
17973
+ installClaimMd;
17974
+ configureClaimMd;
17975
+ verifyClaimMdKey;
17586
17976
  configurePatientSync;
17587
17977
  getPatientSyncStatus;
17588
17978
  deletePatientSyncConnection;
@@ -17650,6 +18040,10 @@ var init_chunk_BQOKENBF = __esm({
17650
18040
  searchHubspotRecords;
17651
18041
  importHubspotMembers;
17652
18042
  getHubspotContactProperties;
18043
+ getHubspotDealProperties;
18044
+ getHubspotForms;
18045
+ getHubspotMeetingLinks;
18046
+ getHubspotObjectProperties;
17653
18047
  getHubspotManagedRules;
17654
18048
  getHubspotSyncLogs;
17655
18049
  getHubspotTransformPresets;
@@ -17662,7 +18056,23 @@ var init_chunk_BQOKENBF = __esm({
17662
18056
  getSyncRuns;
17663
18057
  getSyncRunItems;
17664
18058
  getMemberSyncSummary;
18059
+ getConnectionFieldHomes;
18060
+ getInboundRecordStatus;
18061
+ getConnectionWritePreview;
17665
18062
  clearConnectionMemberExclusion;
18063
+ linkUnlinkedMembersByIdentity;
18064
+ listSubsetImports;
18065
+ getSubsetImport;
18066
+ createSubsetImport;
18067
+ updateSubsetImport;
18068
+ deleteSubsetImport;
18069
+ previewSubsetImportSelection;
18070
+ previewSubsetImport;
18071
+ runSubsetImport;
18072
+ cancelSubsetImport;
18073
+ listSubsetImportRuns;
18074
+ listSubsetImportVendorLists;
18075
+ listSubsetImportFilterFields;
17666
18076
  // App Connections API
17667
18077
  listAvailableAppConnections;
17668
18078
  listAppConnections;
@@ -17799,6 +18209,7 @@ var init_chunk_BQOKENBF = __esm({
17799
18209
  apis.patientSyncConnections,
17800
18210
  apis.healthie,
17801
18211
  apis.documoFax,
18212
+ apis.claimMd,
17802
18213
  apis.salesforce,
17803
18214
  apis.hubspot,
17804
18215
  apis.appConnections,
@@ -17928,9 +18339,9 @@ var init_chunk_BQOKENBF = __esm({
17928
18339
  }
17929
18340
  });
17930
18341
 
17931
- // ../sdk/dist/chunk-HXVJF54M.js
17932
- var init_chunk_HXVJF54M = __esm({
17933
- "../sdk/dist/chunk-HXVJF54M.js"() {
18342
+ // ../sdk/dist/chunk-D5VNVTUQ.js
18343
+ var init_chunk_D5VNVTUQ = __esm({
18344
+ "../sdk/dist/chunk-D5VNVTUQ.js"() {
17934
18345
  }
17935
18346
  });
17936
18347
 
@@ -17985,8 +18396,8 @@ var init_chunk_6KPGCPGW = __esm({
17985
18396
  var SEARCHABLE_EVENT_RULE_SOURCE_FIELDS, ActivityEventType, EntityKind;
17986
18397
  var init_dist = __esm({
17987
18398
  "../sdk/dist/index.js"() {
17988
- init_chunk_BQOKENBF();
17989
- init_chunk_HXVJF54M();
18399
+ init_chunk_YDC4OVZE();
18400
+ init_chunk_D5VNVTUQ();
17990
18401
  init_chunk_6KPGCPGW();
17991
18402
  init_chunk_GCN4OMYU();
17992
18403
  SEARCHABLE_EVENT_RULE_SOURCE_FIELDS = [
@@ -18011,6 +18422,7 @@ var init_dist = __esm({
18011
18422
  importcompleted: "import.completed",
18012
18423
  assignmentstarted: "assignment.started",
18013
18424
  assignmentconcluded: "assignment.concluded",
18425
+ assignmenttask_entered: "assignment.task_entered",
18014
18426
  journeyenrolled: "journey.enrolled",
18015
18427
  journeyunenrolled: "journey.unenrolled",
18016
18428
  journeycompleted: "journey.completed",
@@ -18021,6 +18433,8 @@ var init_dist = __esm({
18021
18433
  chathuman_replied: "chat.human_replied",
18022
18434
  chatcall_ended: "chat.call_ended",
18023
18435
  chatsummary: "chat.summary",
18436
+ messagesent: "message.sent",
18437
+ membermessage_received: "member.message_received",
18024
18438
  escalationopened: "escalation.opened",
18025
18439
  escalationresolved: "escalation.resolved",
18026
18440
  callstarted: "call.started",
@@ -20570,6 +20984,28 @@ function findNearestGit(startDir) {
20570
20984
  dir = parent;
20571
20985
  }
20572
20986
  }
20987
+ function nativeWorktreePorts(envPath) {
20988
+ let content;
20989
+ try {
20990
+ content = readFileSync(envPath, "utf-8");
20991
+ } catch {
20992
+ return void 0;
20993
+ }
20994
+ const wanted = /* @__PURE__ */ new Set(["GR_PROVISIONED_RUNTIME", "API_NGINX_PORT", "FRONTEND_PORT"]);
20995
+ const values = /* @__PURE__ */ new Map();
20996
+ for (const line of content.split(/\r?\n/)) {
20997
+ const match = /^\s*([A-Z_][A-Z0-9_]*)=(.*)$/.exec(line);
20998
+ const key = match?.[1];
20999
+ const raw = match?.[2];
21000
+ if (key === void 0 || raw === void 0 || !wanted.has(key)) continue;
21001
+ values.set(key, raw.trim().replace(/^(['"])(.*)\1$/, "$2"));
21002
+ }
21003
+ if (values.get("GR_PROVISIONED_RUNTIME") !== "native") return void 0;
21004
+ const apiPort = parsePortToken(values.get("API_NGINX_PORT"));
21005
+ const frontendPort = parsePortToken(values.get("FRONTEND_PORT"));
21006
+ if (apiPort === void 0 || frontendPort === void 0) return void 0;
21007
+ return { envPath, ports: { apiPort, frontendPort } };
21008
+ }
20573
21009
  function unresolved(root, overridePath, reason) {
20574
21010
  return { kind: "unresolved-worktree", root, overridePath, reason };
20575
21011
  }
@@ -20588,7 +21024,17 @@ function classifyCheckout(startDir = process.cwd()) {
20588
21024
  return { kind: "non-worktree", root: git?.root };
20589
21025
  }
20590
21026
  const overridePath = join(git.root, OVERRIDE_FILENAME);
21027
+ const envPath = join(git.root, ENV_FILENAME);
20591
21028
  if (!existsSync(overridePath)) {
21029
+ const native = nativeWorktreePorts(envPath);
21030
+ if (native) {
21031
+ return {
21032
+ kind: "resolved-worktree",
21033
+ root: git.root,
21034
+ overridePath: native.envPath,
21035
+ ...native.ports
21036
+ };
21037
+ }
20592
21038
  return unresolved(
20593
21039
  git.root,
20594
21040
  overridePath,
@@ -20685,6 +21131,12 @@ function getEnvironmentConfig(env, options = {}) {
20685
21131
  frontendUrl: explicitFrontend || config.frontendUrl
20686
21132
  };
20687
21133
  }
21134
+ if (process.env.ENVIRONMENT === "dev-cloud") {
21135
+ return {
21136
+ apiUrl: explicitApi || DEV_CLOUD_POD_DEV.apiUrl,
21137
+ frontendUrl: explicitFrontend || DEV_CLOUD_POD_DEV.frontendUrl
21138
+ };
21139
+ }
20688
21140
  const checkout = classifyCheckout(options.startDir ?? process.cwd());
20689
21141
  if (checkout.kind === "non-worktree") {
20690
21142
  return {
@@ -20707,7 +21159,7 @@ function getEnvironmentConfig(env, options = {}) {
20707
21159
  }
20708
21160
  return { apiUrl: explicitApi, frontendUrl: explicitFrontend };
20709
21161
  }
20710
- var ENVIRONMENTS, CALLBACK_PORT, CALLBACK_PATH, REDIRECT_URI, API_CONTAINER_PORT, FRONTEND_CONTAINER_PORT, WORKTREE_SETUP_MARKER, OVERRIDE_FILENAME, OVERRIDE_SEQUENCE_TAG, COMPOSE_OVERRIDE_SCHEMA, WorktreeConfigError;
21162
+ var ENVIRONMENTS, DEV_CLOUD_POD_DEV, CALLBACK_PORT, CALLBACK_PATH, REDIRECT_URI, API_CONTAINER_PORT, FRONTEND_CONTAINER_PORT, WORKTREE_SETUP_MARKER, OVERRIDE_FILENAME, ENV_FILENAME, OVERRIDE_SEQUENCE_TAG, COMPOSE_OVERRIDE_SCHEMA, WorktreeConfigError;
20711
21163
  var init_config = __esm({
20712
21164
  "src/cli-utils/config.ts"() {
20713
21165
  init_js_yaml();
@@ -20725,6 +21177,10 @@ var init_config = __esm({
20725
21177
  frontendUrl: "https://app.gr-staging.com"
20726
21178
  }
20727
21179
  };
21180
+ DEV_CLOUD_POD_DEV = {
21181
+ apiUrl: "http://127.0.0.1:5050",
21182
+ frontendUrl: "http://127.0.0.1:3000"
21183
+ };
20728
21184
  CALLBACK_PORT = 31337;
20729
21185
  CALLBACK_PATH = "/oauth/callback";
20730
21186
  REDIRECT_URI = `http://localhost:${CALLBACK_PORT}${CALLBACK_PATH}`;
@@ -20732,6 +21188,7 @@ var init_config = __esm({
20732
21188
  FRONTEND_CONTAINER_PORT = 3e3;
20733
21189
  WORKTREE_SETUP_MARKER = "worktree-setup.sh";
20734
21190
  OVERRIDE_FILENAME = "docker-compose.override.yml";
21191
+ ENV_FILENAME = ".env";
20735
21192
  OVERRIDE_SEQUENCE_TAG = defineSequenceTag("!override", {
20736
21193
  create: () => [],
20737
21194
  addItem: (carrier, item) => {
@@ -20755,7 +21212,7 @@ var init_config = __esm({
20755
21212
 
20756
21213
  // ../../node_modules/graceful-fs/polyfills.js
20757
21214
  var require_polyfills = __commonJS({
20758
- "../../node_modules/graceful-fs/polyfills.js"(exports$1, module) {
21215
+ "../../node_modules/graceful-fs/polyfills.js"(exports, module) {
20759
21216
  var constants = __require("constants");
20760
21217
  var origCwd = process.cwd;
20761
21218
  var cwd = null;
@@ -21043,7 +21500,7 @@ var require_polyfills = __commonJS({
21043
21500
 
21044
21501
  // ../../node_modules/graceful-fs/legacy-streams.js
21045
21502
  var require_legacy_streams = __commonJS({
21046
- "../../node_modules/graceful-fs/legacy-streams.js"(exports$1, module) {
21503
+ "../../node_modules/graceful-fs/legacy-streams.js"(exports, module) {
21047
21504
  var Stream = __require("stream").Stream;
21048
21505
  module.exports = legacy;
21049
21506
  function legacy(fs3) {
@@ -21139,7 +21596,7 @@ var require_legacy_streams = __commonJS({
21139
21596
 
21140
21597
  // ../../node_modules/graceful-fs/clone.js
21141
21598
  var require_clone = __commonJS({
21142
- "../../node_modules/graceful-fs/clone.js"(exports$1, module) {
21599
+ "../../node_modules/graceful-fs/clone.js"(exports, module) {
21143
21600
  module.exports = clone;
21144
21601
  var getPrototypeOf = Object.getPrototypeOf || function(obj) {
21145
21602
  return obj.__proto__;
@@ -21161,7 +21618,7 @@ var require_clone = __commonJS({
21161
21618
 
21162
21619
  // ../../node_modules/graceful-fs/graceful-fs.js
21163
21620
  var require_graceful_fs = __commonJS({
21164
- "../../node_modules/graceful-fs/graceful-fs.js"(exports$1, module) {
21621
+ "../../node_modules/graceful-fs/graceful-fs.js"(exports, module) {
21165
21622
  var fs3 = __require("fs");
21166
21623
  var polyfills = require_polyfills();
21167
21624
  var legacy = require_legacy_streams();
@@ -21531,7 +21988,7 @@ var require_graceful_fs = __commonJS({
21531
21988
 
21532
21989
  // ../../node_modules/proper-lockfile/node_modules/retry/lib/retry_operation.js
21533
21990
  var require_retry_operation = __commonJS({
21534
- "../../node_modules/proper-lockfile/node_modules/retry/lib/retry_operation.js"(exports$1, module) {
21991
+ "../../node_modules/proper-lockfile/node_modules/retry/lib/retry_operation.js"(exports, module) {
21535
21992
  function RetryOperation(timeouts, options) {
21536
21993
  if (typeof options === "boolean") {
21537
21994
  options = { forever: options };
@@ -21662,17 +22119,17 @@ var require_retry_operation = __commonJS({
21662
22119
 
21663
22120
  // ../../node_modules/proper-lockfile/node_modules/retry/lib/retry.js
21664
22121
  var require_retry = __commonJS({
21665
- "../../node_modules/proper-lockfile/node_modules/retry/lib/retry.js"(exports$1) {
22122
+ "../../node_modules/proper-lockfile/node_modules/retry/lib/retry.js"(exports) {
21666
22123
  var RetryOperation = require_retry_operation();
21667
- exports$1.operation = function(options) {
21668
- var timeouts = exports$1.timeouts(options);
22124
+ exports.operation = function(options) {
22125
+ var timeouts = exports.timeouts(options);
21669
22126
  return new RetryOperation(timeouts, {
21670
22127
  forever: options && options.forever,
21671
22128
  unref: options && options.unref,
21672
22129
  maxRetryTime: options && options.maxRetryTime
21673
22130
  });
21674
22131
  };
21675
- exports$1.timeouts = function(options) {
22132
+ exports.timeouts = function(options) {
21676
22133
  if (options instanceof Array) {
21677
22134
  return [].concat(options);
21678
22135
  }
@@ -21701,13 +22158,13 @@ var require_retry = __commonJS({
21701
22158
  });
21702
22159
  return timeouts;
21703
22160
  };
21704
- exports$1.createTimeout = function(attempt, opts) {
22161
+ exports.createTimeout = function(attempt, opts) {
21705
22162
  var random = opts.randomize ? Math.random() + 1 : 1;
21706
22163
  var timeout = Math.round(random * opts.minTimeout * Math.pow(opts.factor, attempt));
21707
22164
  timeout = Math.min(timeout, opts.maxTimeout);
21708
22165
  return timeout;
21709
22166
  };
21710
- exports$1.wrap = function(obj, options, methods) {
22167
+ exports.wrap = function(obj, options, methods) {
21711
22168
  if (options instanceof Array) {
21712
22169
  methods = options;
21713
22170
  options = null;
@@ -21724,7 +22181,7 @@ var require_retry = __commonJS({
21724
22181
  var method = methods[i];
21725
22182
  var original = obj[method];
21726
22183
  obj[method] = function retryWrapper(original2) {
21727
- var op = exports$1.operation(options);
22184
+ var op = exports.operation(options);
21728
22185
  var args = Array.prototype.slice.call(arguments, 1);
21729
22186
  var callback = args.pop();
21730
22187
  args.push(function(err) {
@@ -21748,14 +22205,14 @@ var require_retry = __commonJS({
21748
22205
 
21749
22206
  // ../../node_modules/proper-lockfile/node_modules/retry/index.js
21750
22207
  var require_retry2 = __commonJS({
21751
- "../../node_modules/proper-lockfile/node_modules/retry/index.js"(exports$1, module) {
22208
+ "../../node_modules/proper-lockfile/node_modules/retry/index.js"(exports, module) {
21752
22209
  module.exports = require_retry();
21753
22210
  }
21754
22211
  });
21755
22212
 
21756
22213
  // ../../node_modules/signal-exit/signals.js
21757
22214
  var require_signals = __commonJS({
21758
- "../../node_modules/signal-exit/signals.js"(exports$1, module) {
22215
+ "../../node_modules/signal-exit/signals.js"(exports, module) {
21759
22216
  module.exports = [
21760
22217
  "SIGABRT",
21761
22218
  "SIGALRM",
@@ -21792,7 +22249,7 @@ var require_signals = __commonJS({
21792
22249
 
21793
22250
  // ../../node_modules/signal-exit/index.js
21794
22251
  var require_signal_exit = __commonJS({
21795
- "../../node_modules/signal-exit/index.js"(exports$1, module) {
22252
+ "../../node_modules/signal-exit/index.js"(exports, module) {
21796
22253
  var process2 = global.process;
21797
22254
  var processOk = function(process3) {
21798
22255
  return process3 && typeof process3 === "object" && typeof process3.removeListener === "function" && typeof process3.emit === "function" && typeof process3.reallyExit === "function" && typeof process3.listeners === "function" && typeof process3.kill === "function" && typeof process3.pid === "number" && typeof process3.on === "function";
@@ -21951,7 +22408,7 @@ var require_signal_exit = __commonJS({
21951
22408
 
21952
22409
  // ../../node_modules/proper-lockfile/lib/mtime-precision.js
21953
22410
  var require_mtime_precision = __commonJS({
21954
- "../../node_modules/proper-lockfile/lib/mtime-precision.js"(exports$1, module) {
22411
+ "../../node_modules/proper-lockfile/lib/mtime-precision.js"(exports, module) {
21955
22412
  var cacheSymbol = /* @__PURE__ */ Symbol();
21956
22413
  function probe(file, fs3, callback) {
21957
22414
  const cachedPrecision = fs3[cacheSymbol];
@@ -21992,7 +22449,7 @@ var require_mtime_precision = __commonJS({
21992
22449
 
21993
22450
  // ../../node_modules/proper-lockfile/lib/lockfile.js
21994
22451
  var require_lockfile = __commonJS({
21995
- "../../node_modules/proper-lockfile/lib/lockfile.js"(exports$1, module) {
22452
+ "../../node_modules/proper-lockfile/lib/lockfile.js"(exports, module) {
21996
22453
  var path4 = __require("path");
21997
22454
  var fs3 = require_graceful_fs();
21998
22455
  var retry = require_retry2();
@@ -22228,7 +22685,7 @@ var require_lockfile = __commonJS({
22228
22685
 
22229
22686
  // ../../node_modules/proper-lockfile/lib/adapter.js
22230
22687
  var require_adapter = __commonJS({
22231
- "../../node_modules/proper-lockfile/lib/adapter.js"(exports$1, module) {
22688
+ "../../node_modules/proper-lockfile/lib/adapter.js"(exports, module) {
22232
22689
  var fs3 = require_graceful_fs();
22233
22690
  function createSyncFs(fs4) {
22234
22691
  const methods = ["mkdir", "realpath", "stat", "rmdir", "utimes"];
@@ -22292,7 +22749,7 @@ var require_adapter = __commonJS({
22292
22749
 
22293
22750
  // ../../node_modules/proper-lockfile/index.js
22294
22751
  var require_proper_lockfile = __commonJS({
22295
- "../../node_modules/proper-lockfile/index.js"(exports$1, module) {
22752
+ "../../node_modules/proper-lockfile/index.js"(exports, module) {
22296
22753
  var lockfile2 = require_lockfile();
22297
22754
  var { toPromise, toSync, toSyncOptions } = require_adapter();
22298
22755
  async function lock(file, options) {
@@ -22331,7 +22788,7 @@ var init_package = __esm({
22331
22788
  "package.json"() {
22332
22789
  package_default = {
22333
22790
  name: "@gravity-rail/cli",
22334
- version: "0.56.0",
22791
+ version: "0.57.1",
22335
22792
  description: "Gravity Rail CLI \u2014 manage workspaces from the command line",
22336
22793
  type: "module",
22337
22794
  bin: {
@@ -22389,17 +22846,18 @@ var init_package = __esm({
22389
22846
  "@types/proper-lockfile": "^4.1.4",
22390
22847
  jest: "^30.5.2",
22391
22848
  "ts-jest": "29.4.9",
22392
- tsup: "^8.5.1",
22849
+ tsup: "^9.0.0",
22393
22850
  typescript: "^6.0.3",
22394
22851
  undici: "6.28.1"
22395
22852
  }
22396
22853
  };
22397
22854
  }
22398
22855
  });
22399
- var DEFAULT_PROFILE, CredentialsManager;
22856
+ var DEFAULT_PROFILE, LOOPBACK_HOSTNAMES, CredentialsManager;
22400
22857
  var init_credentials_manager = __esm({
22401
22858
  "src/cli-utils/credentials-manager.ts"() {
22402
22859
  DEFAULT_PROFILE = "default";
22860
+ LOOPBACK_HOSTNAMES = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "[::1]"]);
22403
22861
  CredentialsManager = class {
22404
22862
  cacheDir;
22405
22863
  apiUrl;
@@ -22496,7 +22954,7 @@ var init_credentials_manager = __esm({
22496
22954
  const url = new URL(this.apiUrl);
22497
22955
  const port = url.port;
22498
22956
  if (port && port !== "80" && port !== "443") {
22499
- const isCanonicalLocalDev = url.hostname === "localhost" && port === "5050" || url.hostname.endsWith("gravityrail.test") && port === "5054";
22957
+ const isCanonicalLocalDev = LOOPBACK_HOSTNAMES.has(url.hostname) && port === "5050" || url.hostname.endsWith("gravityrail.test") && port === "5054";
22500
22958
  if (!isCanonicalLocalDev) {
22501
22959
  return join(this.cacheDir, `credentials-${env}-${port}.json`);
22502
22960
  }
@@ -24564,7 +25022,7 @@ function commandNeedsJsonBody(cmd, parsedArgs) {
24564
25022
  }
24565
25023
  return false;
24566
25024
  }
24567
- if (cmd.acceptsJsonInput === true) {
25025
+ if (cmd.acceptsJsonInput === true || cmd.pipesJsonInput !== void 0) {
24568
25026
  return true;
24569
25027
  }
24570
25028
  if (parsedArgs.data !== void 0 || parsedArgs.file !== void 0) {
@@ -24585,7 +25043,19 @@ function commandNeedsJsonBody(cmd, parsedArgs) {
24585
25043
  }
24586
25044
  return false;
24587
25045
  }
24588
- async function readJsonInput(args) {
25046
+ var PIPED_INPUT_FIRST_BYTE_WAIT_MS = 6e4;
25047
+ function commandAwaitsPipedInput(cmd, parsedArgs) {
25048
+ if (parsedArgs.data !== void 0 || parsedArgs.file !== void 0) return false;
25049
+ const declared = cmd.pipesJsonInput;
25050
+ return typeof declared === "function" ? declared(parsedArgs) : declared === true;
25051
+ }
25052
+ async function readCommandJsonInput(cmd, parsedArgs) {
25053
+ if (!commandNeedsJsonBody(cmd, parsedArgs)) return void 0;
25054
+ return readJsonInput(parsedArgs, {
25055
+ pipedInputWaitMs: commandAwaitsPipedInput(cmd, parsedArgs) ? PIPED_INPUT_FIRST_BYTE_WAIT_MS : 0
25056
+ });
25057
+ }
25058
+ async function readJsonInput(args, options = {}) {
24589
25059
  const dataStr = args.data;
24590
25060
  const filePath = args.file;
24591
25061
  if (dataStr) {
@@ -24616,15 +25086,17 @@ async function readJsonInput(args) {
24616
25086
  if (process.stdin.isTTY === true) {
24617
25087
  return void 0;
24618
25088
  }
24619
- return readStdinIfPiped();
25089
+ return readStdinIfPiped(options.pipedInputWaitMs ?? 0);
24620
25090
  }
24621
- function readStdinIfPiped() {
25091
+ function readStdinIfPiped(firstByteWaitMs) {
24622
25092
  return new Promise((resolve3, reject) => {
24623
25093
  let data = "";
24624
25094
  let settled = false;
25095
+ let idleTimer;
24625
25096
  const finish2 = (value) => {
24626
25097
  if (settled) return;
24627
25098
  settled = true;
25099
+ if (idleTimer) clearTimeout(idleTimer);
24628
25100
  resolve3(value);
24629
25101
  };
24630
25102
  const flush = () => {
@@ -24653,6 +25125,15 @@ function readStdinIfPiped() {
24653
25125
  flush();
24654
25126
  return;
24655
25127
  }
25128
+ if (firstByteWaitMs > 0) {
25129
+ idleTimer = setTimeout(() => {
25130
+ if (!data) {
25131
+ process.stdin.pause();
25132
+ finish2(void 0);
25133
+ }
25134
+ }, firstByteWaitMs);
25135
+ return;
25136
+ }
24656
25137
  finish2(void 0);
24657
25138
  });
24658
25139
  });
@@ -25420,9 +25901,9 @@ Optional
25420
25901
  systemPrompt (string) Base instructions / identity
25421
25902
  chatModelConfig (object|null) Chat model overrides (temperature, thinking, \u2026)
25422
25903
  realtimeModelId (string|null) Voice/realtime model (see \`gr ai-models realtime\`)
25423
- e.g. "xai:realtime:voice-agent-2" (Grok Voice Think Fast 2)
25424
- or opt in to "xai:realtime:voice-agent-3" (Grok Voice
25425
- 3.0; not yet cleared for strict-routing workflows)
25904
+ e.g. "xai:realtime:voice-agent-3" (Grok Voice 3, the
25905
+ default; not yet cleared for strict-routing workflows).
25906
+ "xai:realtime:voice-agent-2" is deprecated.
25426
25907
  Native models auto-fill tts=native + default voice when
25427
25908
  realtimeModelConfig is omitted.
25428
25909
  realtimeModelConfig (object|null) Realtime config. Native example:
@@ -25440,11 +25921,7 @@ Attach an agent\u2019s models/identity to a workflow (draft), then publish:
25440
25921
  gr workflows update --id <wf> -d '{"copyFromAgentId": <agentId>}'
25441
25922
  gr workflows publish --workflow-id <wf>
25442
25923
 
25443
- One-shot workflow voice WITHOUT creating an agent (preferred for "use Grok Voice 2"):
25444
- gr workflows update --id <wf> -d '{"realtimeModelId":"xai:realtime:voice-agent-2"}'
25445
- gr workflows publish --workflow-id <wf>
25446
-
25447
- Opt a workflow into Grok Voice 3.0 (same xAI voices as 2.0; not the default):
25924
+ One-shot workflow voice WITHOUT creating an agent (preferred for "use Grok Voice 3"):
25448
25925
  gr workflows update --id <wf> -d '{"realtimeModelId":"xai:realtime:voice-agent-3"}'
25449
25926
  gr workflows publish --workflow-id <wf>
25450
25927
 
@@ -25472,11 +25949,10 @@ ${AGENT_FIELD_REFERENCE}`,
25472
25949
  updateHelp: `Update an agent. All fields optional.
25473
25950
  ${AGENT_FIELD_REFERENCE}`,
25474
25951
  createExamples: [
25475
- `gr agents create -d '{"name":"Support","chatModelId":"openai:chat:gpt-6-luna","realtimeModelId":"xai:realtime:voice-agent-2"}'`,
25952
+ `gr agents create -d '{"name":"Support","chatModelId":"openai:chat:gpt-6-luna","realtimeModelId":"xai:realtime:voice-agent-3"}'`,
25476
25953
  "gr agents create --file agent.json"
25477
25954
  ],
25478
25955
  updateExamples: [
25479
- `gr agents update --id 42 -d '{"realtimeModelId":"xai:realtime:voice-agent-2"}'`,
25480
25956
  `gr agents update --id 42 -d '{"realtimeModelId":"xai:realtime:voice-agent-3"}'`,
25481
25957
  "gr agents update --id 42 --file agent.json"
25482
25958
  ]
@@ -27355,23 +27831,24 @@ Assistant / models (live on the DRAFT revision \u2014 publish to go live)
27355
27831
  chatModelId (string) Text chat model (see \`gr ai-models chat\`)
27356
27832
  chatModelConfig (object|null) Chat model overrides
27357
27833
  realtimeModelId (string|null) Voice/realtime model (see \`gr ai-models realtime\`)
27358
- create: omit \u2192 xai:realtime:voice-agent-2 with
27359
- voice xai:voice:cosmo; null = voice off
27834
+ create: omit \u2192 xai:realtime:voice-agent-3 with
27835
+ voice xai:voice:cosmo; null = voice off.
27836
+ routingMode "strict": omit \u2192 no voice (use
27837
+ custom:realtime:composable)
27360
27838
  update: null = voice off
27361
27839
  One-shot switch (keeps the stored voice and
27362
27840
  call settings; resets only a voice the new
27363
27841
  model cannot use):
27364
- {"realtimeModelId":"xai:realtime:voice-agent-2"}
27365
- Opt in to Grok Voice 3.0 (not the default; not yet
27366
- cleared for routingMode "strict"; same xAI voices):
27367
27842
  {"realtimeModelId":"xai:realtime:voice-agent-3"}
27843
+ Grok Voice 3 is not yet cleared for routingMode
27844
+ "strict". voice-agent-2 is deprecated.
27368
27845
  On create, a native model id with no stored or
27369
27846
  copied config gets tts=native + that
27370
27847
  provider's fallback voice. A composable id
27371
27848
  still needs its own config. On update,
27372
27849
  omitting the config keeps the stored one.
27373
27850
  Explicit config replaces it:
27374
- {"realtimeModelId":"xai:realtime:voice-agent-2",
27851
+ {"realtimeModelId":"xai:realtime:voice-agent-3",
27375
27852
  "realtimeModelConfig":{"ttsModel":"native",
27376
27853
  "voiceModel":"xai:voice:ara"}}
27377
27854
  realtimeModelConfig (object|null) Realtime config. Omit on update to keep the
@@ -32584,7 +33061,7 @@ var bundlesDomain = {
32584
33061
  },
32585
33062
  {
32586
33063
  path: ["bundles", "draft", "set"],
32587
- description: 'Replace draft items from {"items": [...]}; an optional "links": [{"label", "url"}] replaces the draft links. Use --expected-generation from draft get to protect edits.',
33064
+ description: 'Replace draft items from {"items": [...]}. Journey items require {"key", "kind":"journey", "journeyUuid"}; the server captures the source Journey. An optional "links": [{"label", "url"}] replaces the draft links. Use --expected-generation from draft get to protect edits.',
32588
33065
  requiresWorkspace: true,
32589
33066
  mutates: true,
32590
33067
  args: [BUNDLE_ARG, GENERATION_ARG],
@@ -33966,9 +34443,9 @@ var REALTIME_AUDIO_USD_PER_MIN = {
33966
34443
  "xai:realtime:voice-agent": 0.05,
33967
34444
  // Grok Voice Think Fast 1
33968
34445
  "xai:realtime:voice-agent-2": 0.08,
33969
- // Grok Voice Think Fast 2 (pinned grok-voice-2.0)
34446
+ // Grok Voice 2 (pinned grok-voice-2.0)
33970
34447
  "xai:realtime:voice-agent-3": 0.08
33971
- // Grok Voice 3.0 — same audio rate as 2.0
34448
+ // Grok Voice 3 — same audio rate as 2.0
33972
34449
  };
33973
34450
  var DEFAULT_REALTIME_AUDIO_USD_PER_MIN = 0.08;
33974
34451
  var EST_AUDIO_MIN_PER_RUN = 3;
@@ -34047,6 +34524,10 @@ function runToBatchRow(job, workflowId, run, error, batchLabel, pinnedRevisionId
34047
34524
  ...job.realtime ? { realtime_model_id: job.modelId } : {},
34048
34525
  ...batchLabel ? { batch_label: batchLabel } : {},
34049
34526
  run_id: run?.id,
34527
+ lane: run?.lane ?? null,
34528
+ outcome: run?.outcome ?? null,
34529
+ assistant_chat_model_id: run?.assistantChatModelId ?? null,
34530
+ assistant_realtime_model_id: run?.assistantRealtimeModelId ?? null,
34050
34531
  error,
34051
34532
  failure_reason: run?.failureReason ?? null,
34052
34533
  passed: run?.passed ?? null,
@@ -34341,7 +34822,15 @@ var SCENARIO_COLUMNS = [
34341
34822
  COL.id(),
34342
34823
  COL.name(),
34343
34824
  { header: "PERSONA", getValue: (item) => item.personaName ?? "" },
34344
- { header: "CHANNEL", getValue: (item) => item.channel ?? "" }
34825
+ { header: "CHANNEL", getValue: (item) => item.channel ?? "" },
34826
+ {
34827
+ header: "SEED",
34828
+ getValue: (item) => {
34829
+ const turns = Array.isArray(item.seedTurns) ? item.seedTurns.length : 0;
34830
+ if (turns === 0) return "";
34831
+ return item.singleTurn ? `${turns} turns, single-turn` : `${turns} turns`;
34832
+ }
34833
+ }
34345
34834
  ];
34346
34835
  var RUN_COLUMNS = [
34347
34836
  COL.id(),
@@ -34433,7 +34922,7 @@ var qualificationsDomain = {
34433
34922
  },
34434
34923
  {
34435
34924
  path: ["qualifications", "scenarios", "create"],
34436
- description: "Create a scenario on a qualification (pass JSON via --data)",
34925
+ description: 'Create a scenario on a qualification (pass JSON via --data). Seed history: "seedTurns": [{"speaker": "member"|"agent", "content": "..."}]; "singleTurn": true grades only the Agent reply to the last seeded member turn',
34437
34926
  mutates: true,
34438
34927
  requiresWorkspace: true,
34439
34928
  args: [{ name: "qualification-id", description: "Qualification ID", required: true }],
@@ -34448,7 +34937,7 @@ var qualificationsDomain = {
34448
34937
  },
34449
34938
  {
34450
34939
  path: ["qualifications", "scenarios", "update"],
34451
- description: "Update a scenario (pass JSON via --data)",
34940
+ description: 'Update a scenario (pass JSON via --data). "seedTurns": [] clears the seed history; "singleTurn" needs seed turns that end on a member turn',
34452
34941
  mutates: true,
34453
34942
  requiresWorkspace: true,
34454
34943
  args: [{ name: "id", description: "Scenario ID", required: true }],
@@ -36377,6 +36866,7 @@ function bareLabel(ref) {
36377
36866
  return `${ref.kind}:${shortUuid(ref.uuid)}`;
36378
36867
  }
36379
36868
  var MAX_REFS_PER_BATCH = 500;
36869
+ var MAX_WORKSPACES_PER_BATCH = 25;
36380
36870
  function batchResolution(ref, entry) {
36381
36871
  if (entry.status === "resolved") {
36382
36872
  return { label: entry.label || bareLabel(ref), status: "resolved" };
@@ -36471,28 +36961,40 @@ var ActivityRefResolver = class {
36471
36961
  /**
36472
36962
  * One org call per chunk, each carrying whole workspace groups.
36473
36963
  *
36474
- * The server's cap is over the whole request rather than per workspace, and
36475
- * it accepts each workspace at most once per request — so a group larger
36476
- * than the cap is split across requests, and smaller groups ride together
36477
- * until the next one would not fit.
36964
+ * The server caps a grouped request at both 500 refs and 25 workspaces, and
36965
+ * accepts each workspace at most once per request. So a group larger than
36966
+ * the ref cap is split across requests, smaller groups ride together until
36967
+ * the next one would not fit either bound, and no request names a workspace
36968
+ * twice.
36478
36969
  */
36479
36970
  async primeOrg(orgUuid, groups) {
36480
36971
  const chunks = [];
36481
- let current = [];
36482
- let size = 0;
36972
+ let current = /* @__PURE__ */ new Map();
36973
+ let refsInChunk = 0;
36974
+ const flush = () => {
36975
+ if (current.size === 0) return;
36976
+ chunks.push(
36977
+ [...current].map(
36978
+ ([workspaceUuid, refs]) => [workspaceUuid, refs]
36979
+ )
36980
+ );
36981
+ current = /* @__PURE__ */ new Map();
36982
+ refsInChunk = 0;
36983
+ };
36483
36984
  for (const [workspaceUuid, refs] of groups) {
36484
- for (let start = 0; start < refs.length; start += MAX_REFS_PER_BATCH) {
36485
- const slice = refs.slice(start, start + MAX_REFS_PER_BATCH);
36486
- if (size + slice.length > MAX_REFS_PER_BATCH && current.length > 0) {
36487
- chunks.push(current);
36488
- current = [];
36489
- size = 0;
36985
+ for (let start = 0; start < refs.length; ) {
36986
+ if (!current.has(workspaceUuid) && current.size === MAX_WORKSPACES_PER_BATCH) {
36987
+ flush();
36490
36988
  }
36491
- current.push([workspaceUuid, slice]);
36492
- size += slice.length;
36989
+ const room = MAX_REFS_PER_BATCH - refsInChunk;
36990
+ const slice = refs.slice(start, start + room);
36991
+ current.set(workspaceUuid, slice);
36992
+ refsInChunk += slice.length;
36993
+ start += slice.length;
36994
+ if (refsInChunk === MAX_REFS_PER_BATCH) flush();
36493
36995
  }
36494
36996
  }
36495
- if (current.length > 0) chunks.push(current);
36997
+ flush();
36496
36998
  for (const chunk of chunks) {
36497
36999
  const key = `org:${orgUuid}|${chunk.map(
36498
37000
  ([workspaceUuid, refs]) => `${workspaceUuid}:${refs.map((ref) => `${ref.kind}|${ref.uuid}`).sort().join(",")}`
@@ -37151,7 +37653,7 @@ var COLUMNS15 = [
37151
37653
  ];
37152
37654
  var aiModelsDomain = {
37153
37655
  name: "ai-models",
37154
- description: `List available AI models (chat, realtime/voice stacks, speaker voices). Use realtime ids as workflow/agent realtimeModelId; voice ids go in realtimeModelConfig.voiceModel. One-shot workflow voice: gr workflows update -d '{"realtimeModelId":"xai:realtime:voice-agent-2"}' then publish.`,
37656
+ description: `List available AI models (chat, realtime/voice stacks, speaker voices). Use realtime ids as workflow/agent realtimeModelId; voice ids go in realtimeModelConfig.voiceModel. One-shot workflow voice: gr workflows update -d '{"realtimeModelId":"xai:realtime:voice-agent-3"}' then publish.`,
37155
37657
  commands: [
37156
37658
  {
37157
37659
  path: ["ai-models", "list"],
@@ -37173,7 +37675,7 @@ var aiModelsDomain = {
37173
37675
  },
37174
37676
  {
37175
37677
  path: ["ai-models", "realtime"],
37176
- description: "List realtime/voice stacks (use as realtimeModelId). e.g. xai:realtime:voice-agent-2 = Grok Voice Think Fast 2 (default); xai:realtime:voice-agent-3 = Grok Voice 3.0 (explicit opt-in)",
37678
+ description: "List realtime/voice stacks (use as realtimeModelId). e.g. xai:realtime:voice-agent-3 = Grok Voice 3 (default). Deprecated models (xai:realtime:voice-agent-2) are not listed.",
37177
37679
  requiresWorkspace: false,
37178
37680
  handler: async ({ ctx }) => {
37179
37681
  const result2 = await requireAuth(ctx).apiClient.getRealtimeModels();
@@ -38492,7 +38994,9 @@ var memberMemoriesDomain = {
38492
38994
  { name: "key", description: "Memory key", required: true },
38493
38995
  {
38494
38996
  name: "type",
38495
- description: "Memory type (basic, preferences, semantic, summaries, episodic)"
38997
+ // The API refuses preferences and semantic deletes (a Member cannot
38998
+ // be shown to own those AgentCore records), so they are not offered.
38999
+ description: "Memory type (basic, summaries, episodic)"
38496
39000
  }
38497
39001
  ],
38498
39002
  handler: async ({ ctx, workspace, args }) => {
@@ -42275,6 +42779,92 @@ async function streamSyncRun(response, verbose) {
42275
42779
  console.log(JSON.stringify(lastRun, null, 2));
42276
42780
  }
42277
42781
  }
42782
+ var SYNC_RUN_OPTION_ARGS = [
42783
+ { name: "dry-run", description: "Test sync without making changes", isFlag: true },
42784
+ {
42785
+ name: "full-resync",
42786
+ description: "Clear checkpoints and re-sync all records",
42787
+ isFlag: true
42788
+ },
42789
+ { name: "quiet", description: "Only output final result JSON", isFlag: true },
42790
+ { name: "entity-type", description: "Scope to entity type: member or record" },
42791
+ {
42792
+ name: "board-id",
42793
+ description: "Scope to a single board mapping (requires --entity-type)"
42794
+ },
42795
+ {
42796
+ name: "record-limit",
42797
+ description: "Cap the run to a preview sample (1..200). Requires --dry-run and --entity-type."
42798
+ }
42799
+ ];
42800
+ var VALID_ENTITY_TYPES = ["member", "record"];
42801
+ function parseSyncRunOptions(args) {
42802
+ const dryRun = args["dry-run"] === true;
42803
+ const fullResync = args["full-resync"] === true;
42804
+ const quiet = args["quiet"] === true;
42805
+ const rawEntityType = args["entity-type"];
42806
+ let entityType;
42807
+ if (rawEntityType) {
42808
+ if (!VALID_ENTITY_TYPES.includes(rawEntityType)) {
42809
+ throw new CLIError(
42810
+ `Invalid --entity-type "${rawEntityType}". Allowed values: ${VALID_ENTITY_TYPES.join(", ")}`
42811
+ );
42812
+ }
42813
+ entityType = rawEntityType;
42814
+ }
42815
+ const boardId = args["board-id"];
42816
+ const rawRecordLimit = args["record-limit"];
42817
+ let recordLimit;
42818
+ if (rawRecordLimit !== void 0 && rawRecordLimit !== "") {
42819
+ const parsed = Number(rawRecordLimit);
42820
+ if (!Number.isInteger(parsed) || parsed < 1 || parsed > 200) {
42821
+ throw new CLIError(
42822
+ `Invalid --record-limit "${rawRecordLimit}". Must be an integer between 1 and 200.`
42823
+ );
42824
+ }
42825
+ if (!dryRun) {
42826
+ throw new CLIError("--record-limit requires --dry-run: capped runs are preview-only.");
42827
+ }
42828
+ if (entityType === void 0) {
42829
+ throw new CLIError(
42830
+ "--record-limit requires --entity-type: capped previews must target a single entity type."
42831
+ );
42832
+ }
42833
+ recordLimit = parsed;
42834
+ }
42835
+ if (fullResync && (dryRun || recordLimit !== void 0)) {
42836
+ throw new CLIError(
42837
+ "--full-resync is incompatible with --dry-run / --record-limit: checkpoint reset must happen on a non-preview run."
42838
+ );
42839
+ }
42840
+ return { dryRun, fullResync, quiet, entityType, boardId, recordLimit };
42841
+ }
42842
+ async function runSyncAndStream(ctx, workspace, connectionId, options) {
42843
+ const { dryRun, fullResync, quiet, entityType, boardId, recordLimit } = options;
42844
+ if (!quiet) {
42845
+ const flags = [
42846
+ dryRun && "(dry run)",
42847
+ fullResync && "(full re-sync)",
42848
+ entityType && `(${entityType} only)`,
42849
+ boardId && `(board ${boardId})`,
42850
+ recordLimit !== void 0 && `(limit ${recordLimit})`
42851
+ ].filter(Boolean).join(" ");
42852
+ console.error(`Starting sync for connection ${connectionId}${flags ? ` ${flags}` : ""}...`);
42853
+ }
42854
+ const response = await requireAuth(ctx).apiClient.startSyncRun(workspace, connectionId, {
42855
+ dryRun,
42856
+ resetCheckpoints: fullResync,
42857
+ entityType,
42858
+ boardId,
42859
+ recordLimit
42860
+ });
42861
+ if (!response.ok) {
42862
+ const text = await response.text();
42863
+ console.error(`Sync failed: ${response.status} ${text}`);
42864
+ process.exit(1);
42865
+ }
42866
+ await streamSyncRun(response, !quiet);
42867
+ }
42278
42868
  var syncDomain = {
42279
42869
  name: "sync",
42280
42870
  description: "Run and monitor connection syncs",
@@ -42284,22 +42874,7 @@ var syncDomain = {
42284
42874
  description: "Start a sync run and stream progress (SSE)",
42285
42875
  args: [
42286
42876
  { name: "connection-id", description: "Connection ID", required: true },
42287
- { name: "dry-run", description: "Test sync without making changes", isFlag: true },
42288
- {
42289
- name: "full-resync",
42290
- description: "Clear checkpoints and re-sync all records",
42291
- isFlag: true
42292
- },
42293
- { name: "quiet", description: "Only output final result JSON", isFlag: true },
42294
- { name: "entity-type", description: "Scope to entity type: member or record" },
42295
- {
42296
- name: "board-id",
42297
- description: "Scope to a single board mapping (requires --entity-type)"
42298
- },
42299
- {
42300
- name: "record-limit",
42301
- description: "Cap the run to a preview sample (1..200). Requires --dry-run and --entity-type."
42302
- }
42877
+ ...SYNC_RUN_OPTION_ARGS
42303
42878
  ],
42304
42879
  examples: [
42305
42880
  "sync run --connection-id 6",
@@ -42313,76 +42888,7 @@ var syncDomain = {
42313
42888
  mutates: true,
42314
42889
  handler: async ({ ctx, args, workspace }) => {
42315
42890
  const connectionId = requireNumber(args, "connection-id");
42316
- const dryRun = args["dry-run"] === true;
42317
- const fullResync = args["full-resync"] === true;
42318
- const quiet = args["quiet"] === true;
42319
- const VALID_ENTITY_TYPES = ["member", "record"];
42320
- const rawEntityType = args["entity-type"];
42321
- let entityType;
42322
- if (rawEntityType) {
42323
- if (!VALID_ENTITY_TYPES.includes(rawEntityType)) {
42324
- throw new CLIError(
42325
- `Invalid --entity-type "${rawEntityType}". Allowed values: ${VALID_ENTITY_TYPES.join(", ")}`
42326
- );
42327
- }
42328
- entityType = rawEntityType;
42329
- }
42330
- const boardId = args["board-id"];
42331
- const rawRecordLimit = args["record-limit"];
42332
- let recordLimit;
42333
- if (rawRecordLimit !== void 0 && rawRecordLimit !== "") {
42334
- const parsed = Number(rawRecordLimit);
42335
- if (!Number.isInteger(parsed) || parsed < 1 || parsed > 200) {
42336
- throw new CLIError(
42337
- `Invalid --record-limit "${rawRecordLimit}". Must be an integer between 1 and 200.`
42338
- );
42339
- }
42340
- if (!dryRun) {
42341
- throw new CLIError(
42342
- "--record-limit requires --dry-run: capped runs are preview-only."
42343
- );
42344
- }
42345
- if (entityType === void 0) {
42346
- throw new CLIError(
42347
- "--record-limit requires --entity-type: capped previews must target a single entity type."
42348
- );
42349
- }
42350
- recordLimit = parsed;
42351
- }
42352
- if (fullResync && (dryRun || recordLimit !== void 0)) {
42353
- throw new CLIError(
42354
- "--full-resync is incompatible with --dry-run / --record-limit: checkpoint reset must happen on a non-preview run."
42355
- );
42356
- }
42357
- if (!quiet) {
42358
- const flags = [
42359
- dryRun && "(dry run)",
42360
- fullResync && "(full re-sync)",
42361
- entityType && `(${entityType} only)`,
42362
- boardId && `(board ${boardId})`,
42363
- recordLimit !== void 0 && `(limit ${recordLimit})`
42364
- ].filter(Boolean).join(" ");
42365
- console.error(
42366
- `Starting sync for connection ${connectionId}${flags ? ` ${flags}` : ""}...`
42367
- );
42368
- }
42369
- const response = await requireAuth(ctx).apiClient.startSyncRun(
42370
- workspace,
42371
- connectionId,
42372
- {
42373
- dryRun,
42374
- resetCheckpoints: fullResync,
42375
- entityType,
42376
- boardId,
42377
- recordLimit
42378
- }
42379
- );
42380
- if (!response.ok) {
42381
- const text = await response.text();
42382
- console.error(`Sync failed: ${response.status} ${text}`);
42383
- process.exit(1);
42384
- }
42385
- await streamSyncRun(response, !quiet);
42891
+ await runSyncAndStream(ctx, workspace, connectionId, parseSyncRunOptions(args));
42386
42892
  }
42387
42893
  },
42388
42894
  {
@@ -43154,71 +43660,6 @@ var ENCOUNTER_RUN_COLUMNS = [
43154
43660
  getValue: (item) => summarizeReasons(item.attribution?.collections, "errorReasonCounts")
43155
43661
  }
43156
43662
  ];
43157
- var ONBOARDING_START_COLUMNS = [
43158
- { header: "MODE", getValue: (item) => item.mode ?? "" },
43159
- { header: "WORKFLOW ID", getValue: (item) => item.workflowId ?? "" },
43160
- { header: "RUN ID", getValue: (item) => item.runId ?? "" }
43161
- ];
43162
- var ONBOARDING_PAIR_COLUMNS = [
43163
- { header: "DEPARTMENT", getValue: (item) => String(item.departmentId ?? "") },
43164
- { header: "PATIENT STATUS", getValue: (item) => item.patientStatus ?? "" },
43165
- { header: "STATUS", getValue: (item) => item.status ?? "" },
43166
- { header: "STOP REASON", getValue: (item) => item.stopReason ?? "" },
43167
- { header: "GEN", getValue: (item) => String(item.generation ?? "") },
43168
- { header: "NEXT OFFSET", getValue: (item) => String(item.nextOffset ?? "") },
43169
- { header: "PAGES (RUN)", getValue: (item) => String(item.pagesDone ?? 0) },
43170
- { header: "~FETCHED", getValue: (item) => String(item.totals?.fetched ?? 0) },
43171
- { header: "~APPLIED", getValue: (item) => String(item.totals?.applied ?? 0) },
43172
- { header: "~SKIPPED", getValue: (item) => String(item.totals?.skipped ?? 0) },
43173
- { header: "~FAILED", getValue: (item) => String(item.totals?.failed ?? 0) },
43174
- { header: "RUN ID", getValue: (item) => item.runId ?? "" }
43175
- ];
43176
- var RESUMABLE_PAIR_STATUSES = /* @__PURE__ */ new Set([
43177
- "failed",
43178
- "aborted",
43179
- "truncated",
43180
- "pending",
43181
- "running",
43182
- "waiting"
43183
- ]);
43184
- function onboardingStatusLines(status, connectionId) {
43185
- const lines = [];
43186
- const execution = status.execution;
43187
- if (execution) {
43188
- const failure = execution.failureCode ? ` (failure: ${execution.failureCode})` : "";
43189
- lines.push(
43190
- `Temporal execution: ${execution.workflowId} run ${execution.runId ?? "-"} \u2014 ${execution.status}${failure}`
43191
- );
43192
- } else {
43193
- lines.push("Temporal execution: none recorded");
43194
- }
43195
- if (status.waitingUntil) {
43196
- lines.push(
43197
- `Waiting for the operator window (21:00\u201308:00 America/New_York) until ${status.waitingUntil}`
43198
- );
43199
- }
43200
- if (status.preview) {
43201
- const previewPairs = status.preview.pairs ?? [];
43202
- const admitted = previewPairs.reduce((n, p) => n + (p.totals?.admitted ?? 0), 0);
43203
- const notAdmitted = previewPairs.reduce(
43204
- (n, p) => n + (p.totals?.notAdmitted ?? 0),
43205
- 0
43206
- );
43207
- lines.push(
43208
- `Latest preview: ${previewPairs.length} pair(s), ~${admitted} admission-eligible (incl. already-linked), ~${notAdmitted} not admitted (read-only)`
43209
- );
43210
- }
43211
- lines.push("Counts are approximate.");
43212
- const unfinished = (status.pairs ?? []).some(
43213
- (p) => p.inCurrentCohort && RESUMABLE_PAIR_STATUSES.has(p.status) && p.runId
43214
- );
43215
- if (unfinished && execution?.status !== "running") {
43216
- lines.push(
43217
- `Unfinished pairs continue only on an explicit resume: gr fhir-connections onboarding-import start --id ${connectionId} --resume --allow-write`
43218
- );
43219
- }
43220
- return lines;
43221
- }
43222
43663
  var fhirConnectionsDomain = {
43223
43664
  name: "fhir-connections",
43224
43665
  description: "Manage FHIR connections",
@@ -43276,77 +43717,6 @@ var fhirConnectionsDomain = {
43276
43717
  );
43277
43718
  outputData(runs, ctx, ENCOUNTER_RUN_COLUMNS);
43278
43719
  }
43279
- },
43280
- {
43281
- // athenahealth onboarding import (PR-C): one explicit, audited
43282
- // operator execution per connection, at most 50 pages per pair per
43283
- // run. Thin over the SDK; the server decides everything.
43284
- path: ["fhir-connections", "onboarding-import", "start"],
43285
- description: "Start an athenahealth onboarding import (or --resume / --override / --dry-run preview)",
43286
- requiresWorkspace: true,
43287
- mutates: true,
43288
- args: [
43289
- { name: "id", description: "FHIR connection ID", required: true },
43290
- {
43291
- name: "dry-run",
43292
- description: "Preview: read and classify admission only, write no Members",
43293
- isFlag: true
43294
- },
43295
- {
43296
- name: "resume",
43297
- description: "Continue unfinished (failed, truncated, aborted) pairs at their stored frontier",
43298
- isFlag: true
43299
- },
43300
- {
43301
- name: "override",
43302
- description: "Rescan completed pairs from offset 0 under a new generation",
43303
- isFlag: true
43304
- }
43305
- ],
43306
- examples: [
43307
- "fhir-connections onboarding-import start --id 12 --dry-run --allow-write",
43308
- "fhir-connections onboarding-import start --id 12 --allow-write",
43309
- "fhir-connections onboarding-import start --id 12 --resume --allow-write"
43310
- ],
43311
- handler: async ({ ctx, workspace, args }) => {
43312
- const connectionId = requireNumber(args, "id");
43313
- const started = await requireAuth(ctx).apiClient.fhirStartOnboardingImport(
43314
- workspace,
43315
- connectionId,
43316
- {
43317
- dryRun: args["dry-run"] === true,
43318
- resume: args["resume"] === true,
43319
- override: args["override"] === true
43320
- }
43321
- );
43322
- outputSingle(started, ctx, ONBOARDING_START_COLUMNS);
43323
- hint(ctx, [
43324
- `Started. Follow progress with: gr fhir-connections onboarding-import status --id ${connectionId}`
43325
- ]);
43326
- }
43327
- },
43328
- {
43329
- path: ["fhir-connections", "onboarding-import", "status"],
43330
- description: "Show athenahealth onboarding-import progress and its Temporal execution (read-only)",
43331
- requiresWorkspace: true,
43332
- args: [{ name: "id", description: "FHIR connection ID", required: true }],
43333
- examples: [
43334
- "fhir-connections onboarding-import status --id 12",
43335
- "fhir-connections onboarding-import status --id 12 --output-format json"
43336
- ],
43337
- handler: async ({ ctx, workspace, args }) => {
43338
- const connectionId = requireNumber(args, "id");
43339
- const status = await requireAuth(ctx).apiClient.fhirGetOnboardingImportStatus(
43340
- workspace,
43341
- connectionId
43342
- );
43343
- if (ctx.jq || (ctx.outputFormat ?? "table") !== "table") {
43344
- outputSingle(status, ctx);
43345
- return;
43346
- }
43347
- outputData(status.pairs, ctx, ONBOARDING_PAIR_COLUMNS);
43348
- hint(ctx, onboardingStatusLines(status, connectionId));
43349
- }
43350
43720
  }
43351
43721
  ]
43352
43722
  };
@@ -43683,6 +44053,316 @@ init_errors();
43683
44053
  init_output();
43684
44054
  init_pagination();
43685
44055
  init_context();
44056
+
44057
+ // src/domains/integrations/connection-commands.ts
44058
+ init_errors();
44059
+ init_output();
44060
+ init_context();
44061
+ var POLL_INTERVAL_MIN_MINUTES = 15;
44062
+ var POLL_INTERVAL_MAX_MINUTES = 1440;
44063
+ function connectionIdArg(target) {
44064
+ return {
44065
+ name: "connection-id",
44066
+ description: `Connection ID (default: the workspace's ${target.label} connection)`
44067
+ };
44068
+ }
44069
+ async function resolveConnectionId(ctx, workspace, target, args) {
44070
+ const explicit = optionalNumber(args, "connection-id");
44071
+ if (explicit !== void 0) return explicit;
44072
+ const connections = await requireAuth(ctx).apiClient.listAppConnections(workspace);
44073
+ const matches = connections.filter((c) => c.connectionType === target.connectionType);
44074
+ if (matches.length === 0) {
44075
+ throw new CLIError(
44076
+ `No ${target.label} connection in this workspace. Run: gr ${target.command} install`
44077
+ );
44078
+ }
44079
+ if (matches.length > 1) {
44080
+ const ids = matches.map((c) => c.id).join(", ");
44081
+ throw new CLIError(
44082
+ `This workspace has ${matches.length} ${target.label} connections (${ids}). Pass --connection-id.`
44083
+ );
44084
+ }
44085
+ return matches[0].id;
44086
+ }
44087
+ function parsePollInterval(raw) {
44088
+ const minutes = Number(raw);
44089
+ if (!Number.isInteger(minutes) || minutes < POLL_INTERVAL_MIN_MINUTES || minutes > POLL_INTERVAL_MAX_MINUTES) {
44090
+ throw new CLIError(
44091
+ `Invalid --poll-interval "${String(raw)}". Must be a whole number of minutes between ${POLL_INTERVAL_MIN_MINUTES} and ${POLL_INTERVAL_MAX_MINUTES}.`
44092
+ );
44093
+ }
44094
+ return minutes;
44095
+ }
44096
+ function connectionCommands(target) {
44097
+ const c = target.command;
44098
+ const connectionId = connectionIdArg(target);
44099
+ return [
44100
+ {
44101
+ path: [c, "sync-config", "get"],
44102
+ description: `Get the ${target.label} sync configuration`,
44103
+ requiresWorkspace: true,
44104
+ args: [connectionId],
44105
+ handler: async ({ ctx, workspace, args }) => {
44106
+ const id = await resolveConnectionId(ctx, workspace, target, args);
44107
+ const result2 = await requireAuth(ctx).apiClient.getConnectionSyncConfig(workspace, id);
44108
+ outputSingle(result2, ctx);
44109
+ }
44110
+ },
44111
+ {
44112
+ path: [c, "sync-config", "set"],
44113
+ // `sync-config get -o json | … | sync-config set` pipes the whole
44114
+ // configuration; with --poll-interval alone there is no body to wait for.
44115
+ pipesJsonInput: (args) => args["poll-interval"] === void 0,
44116
+ description: `Replace the ${target.label} sync configuration (--data), or change one setting of the saved configuration (--poll-interval)`,
44117
+ mutates: true,
44118
+ requiresWorkspace: true,
44119
+ args: [
44120
+ connectionId,
44121
+ {
44122
+ name: "poll-interval",
44123
+ description: `Inbound poll cadence in minutes (${POLL_INTERVAL_MIN_MINUTES}..${POLL_INTERVAL_MAX_MINUTES}). Without --data, updates the saved configuration.`
44124
+ }
44125
+ ],
44126
+ examples: [
44127
+ `gr ${c} sync-config get -w <ws> -o json > sync-config.json`,
44128
+ `gr ${c} sync-config set -w <ws> --allow-write --file sync-config.json`,
44129
+ `gr ${c} sync-config set -w <ws> --allow-write --poll-interval 60`
44130
+ ],
44131
+ handler: async ({ ctx, workspace, args, data }) => {
44132
+ const rawInterval = args["poll-interval"];
44133
+ const hasInterval = rawInterval !== void 0 && rawInterval !== "";
44134
+ if (!data && !hasInterval) {
44135
+ throw new CLIError(
44136
+ "Pass the configuration (--data, --file, or stdin) or --poll-interval"
44137
+ );
44138
+ }
44139
+ if (data !== void 0 && (typeof data !== "object" || data === null || Array.isArray(data) || Object.keys(data).length === 0)) {
44140
+ throw new CLIError(
44141
+ "The configuration must be a non-empty JSON object (start from `sync-config get -o json`)"
44142
+ );
44143
+ }
44144
+ const minutes = hasInterval ? parsePollInterval(rawInterval) : void 0;
44145
+ const api = requireAuth(ctx).apiClient;
44146
+ const id = await resolveConnectionId(ctx, workspace, target, args);
44147
+ const base = data ?? await api.getConnectionSyncConfig(workspace, id);
44148
+ const config = minutes === void 0 ? base : { ...base, inboundPollIntervalMinutes: minutes };
44149
+ const result2 = await api.updateConnectionSyncConfig(workspace, id, config);
44150
+ outputSingle(result2, ctx);
44151
+ }
44152
+ },
44153
+ {
44154
+ path: [c, "sync", "capabilities"],
44155
+ description: `What the ${target.label} sync engine supports (entities, directions, modes)`,
44156
+ requiresWorkspace: true,
44157
+ args: [connectionId],
44158
+ handler: async ({ ctx, workspace, args }) => {
44159
+ const id = await resolveConnectionId(ctx, workspace, target, args);
44160
+ const result2 = await requireAuth(ctx).apiClient.getConnectionSyncCapabilities(
44161
+ workspace,
44162
+ id
44163
+ );
44164
+ outputSingle(result2, ctx);
44165
+ }
44166
+ },
44167
+ {
44168
+ path: [c, "sync", "run"],
44169
+ description: `Start a ${target.label} sync run and stream its progress`,
44170
+ mutates: true,
44171
+ requiresWorkspace: true,
44172
+ args: [connectionId, ...SYNC_RUN_OPTION_ARGS],
44173
+ examples: [
44174
+ `gr ${c} sync run -w <ws> --allow-write --dry-run --entity-type member --record-limit 5`,
44175
+ `gr ${c} sync run -w <ws> --allow-write`,
44176
+ `gr ${c} sync run -w <ws> --allow-write --full-resync --quiet`
44177
+ ],
44178
+ handler: async ({ ctx, workspace, args }) => {
44179
+ const options = parseSyncRunOptions(args);
44180
+ const id = await resolveConnectionId(ctx, workspace, target, args);
44181
+ await runSyncAndStream(ctx, workspace, id, options);
44182
+ }
44183
+ },
44184
+ {
44185
+ path: [c, "sync", "runs"],
44186
+ description: `List recent ${target.label} sync runs`,
44187
+ requiresWorkspace: true,
44188
+ args: [connectionId, { name: "limit", description: "Max runs to return (default 20)" }],
44189
+ handler: async ({ ctx, workspace, args }) => {
44190
+ const id = await resolveConnectionId(ctx, workspace, target, args);
44191
+ const runs = await requireAuth(ctx).apiClient.getSyncRuns(
44192
+ workspace,
44193
+ id,
44194
+ optionalNumber(args, "limit") ?? 20
44195
+ );
44196
+ outputData(runs, ctx, RUN_COLUMNS2);
44197
+ }
44198
+ },
44199
+ {
44200
+ path: [c, "sync", "run-items"],
44201
+ description: `List the items of one ${target.label} sync run`,
44202
+ requiresWorkspace: true,
44203
+ args: [
44204
+ connectionId,
44205
+ { name: "run-id", description: "Run ID (from sync runs)", required: true },
44206
+ { name: "limit", description: "Max items to return (default 500)" }
44207
+ ],
44208
+ handler: async ({ ctx, workspace, args }) => {
44209
+ const runId = requireString(args, "run-id");
44210
+ const id = await resolveConnectionId(ctx, workspace, target, args);
44211
+ const items = await requireAuth(ctx).apiClient.getSyncRunItems(
44212
+ workspace,
44213
+ id,
44214
+ runId,
44215
+ optionalNumber(args, "limit") ?? 500
44216
+ );
44217
+ outputData(items, ctx, ITEM_COLUMNS2);
44218
+ }
44219
+ },
44220
+ {
44221
+ path: [c, "sync", "checkpoint"],
44222
+ description: `Show the ${target.label} sync checkpoint (where the next run resumes)`,
44223
+ requiresWorkspace: true,
44224
+ args: [
44225
+ connectionId,
44226
+ { name: "direction", description: "'inbound' (default) or 'outbound'" },
44227
+ { name: "sync-key", description: "Sync key (default 'default')" }
44228
+ ],
44229
+ handler: async ({ ctx, workspace, args }) => {
44230
+ const direction = args["direction"] ?? "inbound";
44231
+ if (direction !== "inbound" && direction !== "outbound") {
44232
+ throw new CLIError(
44233
+ `--direction must be 'inbound' or 'outbound', got '${direction}'`
44234
+ );
44235
+ }
44236
+ const id = await resolveConnectionId(ctx, workspace, target, args);
44237
+ const result2 = await requireAuth(ctx).apiClient.getConnectionSyncCheckpoint(
44238
+ workspace,
44239
+ id,
44240
+ direction,
44241
+ args["sync-key"] ?? "default"
44242
+ );
44243
+ outputSingle(result2, ctx);
44244
+ }
44245
+ },
44246
+ {
44247
+ path: [c, "sync", "member-summary"],
44248
+ description: `Count members by ${target.label} sync state (linked, failed, never synced)`,
44249
+ requiresWorkspace: true,
44250
+ args: [connectionId],
44251
+ handler: async ({ ctx, workspace, args }) => {
44252
+ const id = await resolveConnectionId(ctx, workspace, target, args);
44253
+ const result2 = await requireAuth(ctx).apiClient.getMemberSyncSummary(workspace, id);
44254
+ outputSingle(result2, ctx);
44255
+ }
44256
+ },
44257
+ {
44258
+ path: [c, "field-keys"],
44259
+ description: `List the Member field keys the ${target.label} connection holds values for`,
44260
+ requiresWorkspace: true,
44261
+ args: [connectionId],
44262
+ handler: async ({ ctx, workspace, args }) => {
44263
+ const id = await resolveConnectionId(ctx, workspace, target, args);
44264
+ const result2 = await requireAuth(ctx).apiClient.listConnectionMemberFieldKeys(
44265
+ workspace,
44266
+ id
44267
+ );
44268
+ outputData(result2.keys, ctx);
44269
+ }
44270
+ },
44271
+ {
44272
+ path: [c, "reconciliation", "relink"],
44273
+ description: `Let sync re-link a member you unlinked from ${target.label} (clears the manual-unlink exclusion). Idempotent: cleared=false when there was none.`,
44274
+ mutates: true,
44275
+ requiresWorkspace: true,
44276
+ args: [connectionId, { name: "member-id", description: "Member ID", required: true }],
44277
+ handler: async ({ ctx, workspace, args }) => {
44278
+ const memberId = requireNumber(args, "member-id");
44279
+ const id = await resolveConnectionId(ctx, workspace, target, args);
44280
+ const result2 = await requireAuth(ctx).apiClient.clearConnectionMemberExclusion(
44281
+ workspace,
44282
+ id,
44283
+ memberId
44284
+ );
44285
+ outputSingle(result2, ctx);
44286
+ }
44287
+ },
44288
+ {
44289
+ path: [c, "reconciliation", "link-by-identity"],
44290
+ description: `Start the background run that links unlinked members to their ${target.label} records by identity, then syncs them. Prints the run's workflowId. Refused (400) when the connector has no identity resolver, and (409) while the connection is disabled or a run is already in flight.`,
44291
+ mutates: true,
44292
+ requiresWorkspace: true,
44293
+ args: [connectionId],
44294
+ examples: [
44295
+ `gr ${c} reconciliation link-by-identity -w <ws> --allow-write`,
44296
+ `gr ${c} reconciliation linked -w <ws> # check the new links afterwards`
44297
+ ],
44298
+ handler: async ({ ctx, workspace, args }) => {
44299
+ const id = await resolveConnectionId(ctx, workspace, target, args);
44300
+ const result2 = await requireAuth(ctx).apiClient.linkUnlinkedMembersByIdentity(
44301
+ workspace,
44302
+ id
44303
+ );
44304
+ outputSingle(result2, ctx);
44305
+ }
44306
+ }
44307
+ ];
44308
+ }
44309
+
44310
+ // src/domains/integrations/hubspot.ts
44311
+ var HUBSPOT = {
44312
+ command: "hubspot",
44313
+ label: "HubSpot",
44314
+ connectionType: "hubspot_connection"
44315
+ };
44316
+ var OBJECT_TYPES = ["contacts", "companies", "deals"];
44317
+ var SEARCHABLE_OBJECT_TYPES = ["contacts", "companies"];
44318
+ var SEARCH_COLUMNS = [
44319
+ { header: "ID", getValue: (item) => item.id ?? "" },
44320
+ { header: "TYPE", getValue: (item) => item.objectType ?? "" },
44321
+ { header: "NAME", getValue: (item) => item.name ?? "" },
44322
+ { header: "EMAIL", getValue: (item) => item.email ?? "" },
44323
+ {
44324
+ header: "MEMBER",
44325
+ getValue: (item) => item.existingMember ? `${item.existingMember.memberId} (${item.existingMember.matchType})` : ""
44326
+ }
44327
+ ];
44328
+ var MATCH_COLUMNS2 = [
44329
+ { header: "MEMBER", getValue: (item) => String(item.memberId ?? "") },
44330
+ { header: "RECORD", getValue: (item) => item.hubspotRecordId ?? "" },
44331
+ { header: "MATCH", getValue: (item) => item.matchType ?? "" },
44332
+ { header: "OBJECT", getValue: (item) => item.objectType ?? "" }
44333
+ ];
44334
+ var LINKED_COLUMNS2 = [
44335
+ { header: "MEMBER", getValue: (item) => String(item.memberId ?? "") },
44336
+ { header: "RECORD", getValue: (item) => item.hubspotRecordId ?? "" },
44337
+ { header: "NAME", getValue: (item) => item.memberName ?? "" },
44338
+ { header: "LAST SYNC", getValue: (item) => item.lastSyncStatus ?? "" }
44339
+ ];
44340
+ var IMPORT_COLUMNS = [
44341
+ { header: "HUBSPOT ID", getValue: (item) => item.hubspotId ?? "" },
44342
+ { header: "MEMBER", getValue: (item) => String(item.memberId ?? "") },
44343
+ { header: "OK", getValue: (item) => item.success ? "yes" : "no" },
44344
+ { header: "ERROR", getValue: (item) => item.error ?? "" }
44345
+ ];
44346
+ function importRecordsFrom(data) {
44347
+ const body = data;
44348
+ const rows = Array.isArray(body) ? body : Array.isArray(body?.records) ? body.records : Array.isArray(body?.results) ? body.results : void 0;
44349
+ if (!rows) {
44350
+ throw new CLIError(
44351
+ 'JSON input must be {"records":[...]}, a `gr hubspot search -o json` response, or an array'
44352
+ );
44353
+ }
44354
+ return rows.map((row, index) => {
44355
+ const hubspotId = row?.hubspotId ?? row?.id;
44356
+ if (!hubspotId) throw new CLIError(`Record ${index} has no hubspotId (or id)`);
44357
+ return {
44358
+ hubspotId: String(hubspotId),
44359
+ name: row.name ?? null,
44360
+ email: row.email ?? null,
44361
+ phone: row.phone ?? null,
44362
+ objectType: row.objectType ?? "contacts"
44363
+ };
44364
+ });
44365
+ }
43686
44366
  var hubspotDomain = {
43687
44367
  name: "hubspot",
43688
44368
  description: "HubSpot CRM integration",
@@ -43694,18 +44374,21 @@ var hubspotDomain = {
43694
44374
  requiresWorkspace: true,
43695
44375
  examples: [
43696
44376
  "# When the response shows platformAppAvailable=true, the workspace connects through",
43697
- "# the shared Gravity Rail HubSpot app: install, then authorize. That's all.",
43698
- "gr hubspot install -w <ws> --allow-write",
43699
- "gr hubspot authorize -w <ws> --allow-write # then open the returned authorizeUrl",
44377
+ "# the shared Gravity Rail HubSpot app: one command, then open the authorizeUrl.",
44378
+ "gr hubspot connect -w <ws> --allow-write",
43700
44379
  "",
43701
44380
  "# To use your own HubSpot app instead (a Projects-platform app; HubSpot no longer",
43702
44381
  "# allows new private or developer apps):",
43703
44382
  '# 1. install -> creates the connection; the response includes the OAuth "callbackUrl"',
43704
44383
  "# 2. in HubSpot: give your app that callbackUrl as a Redirect URL, with CRM scopes",
43705
- "# (contacts/companies/deals read+write). Copy the Client ID + Secret.",
44384
+ "# (contacts/companies/deals read+write), plus crm.lists.read and",
44385
+ "# crm.objects.owners.read, forms, and scheduler.meetings.meeting-link.read",
44386
+ "# as OPTIONAL scopes (HubSpot rejects the authorize",
44387
+ "# request if the app lacks them).",
44388
+ "# Copy the Client ID + Secret.",
43706
44389
  "# 3. configure -> save that Client ID / Secret",
43707
44390
  '# 4. authorize -> returns an "authorizeUrl"; open it to grant access.',
43708
- "gr hubspot status -w <ws> # read back callbackUrl + configured/connected",
44391
+ "gr hubspot install -w <ws> --allow-write",
43709
44392
  `gr hubspot configure -w <ws> --allow-write -d '{"clientId":"...","clientSecret":"..."}'`,
43710
44393
  "gr hubspot authorize -w <ws> --allow-write # then open the returned authorizeUrl"
43711
44394
  ],
@@ -43714,6 +44397,33 @@ var hubspotDomain = {
43714
44397
  outputSingle(result2, ctx);
43715
44398
  }
43716
44399
  },
44400
+ {
44401
+ path: ["hubspot", "connect"],
44402
+ description: "Install HubSpot if needed and start OAuth: prints the authorizeUrl to open and the exact callbackUrl the HubSpot app must allow",
44403
+ mutates: true,
44404
+ requiresWorkspace: true,
44405
+ examples: ["gr hubspot connect -w <ws> --allow-write"],
44406
+ handler: async ({ ctx, workspace }) => {
44407
+ const api = requireAuth(ctx).apiClient;
44408
+ const installed = await api.installHubspot(workspace);
44409
+ if (!installed.configured) {
44410
+ outputSingle(installed, ctx);
44411
+ throw new CLIError(
44412
+ "HubSpot is installed but has no app credentials. Register the callbackUrl above on your HubSpot app, then run: gr hubspot configure, then gr hubspot connect"
44413
+ );
44414
+ }
44415
+ const started = await api.startHubspotOAuth(workspace);
44416
+ outputSingle(
44417
+ {
44418
+ connectionId: started.connectionId,
44419
+ usesPlatformApp: started.usesPlatformApp,
44420
+ callbackUrl: started.callbackUrl,
44421
+ authorizeUrl: started.authorizeUrl
44422
+ },
44423
+ ctx
44424
+ );
44425
+ }
44426
+ },
43717
44427
  {
43718
44428
  path: ["hubspot", "status"],
43719
44429
  description: "Get HubSpot connection status (shows configured/connected state + the OAuth callback URL)",
@@ -43725,6 +44435,8 @@ var hubspotDomain = {
43725
44435
  },
43726
44436
  {
43727
44437
  path: ["hubspot", "configure"],
44438
+ // Reads its body from --data, --file or piped stdin.
44439
+ acceptsJsonInput: true,
43728
44440
  description: "Configure HubSpot credentials (setup step 3): save the Client ID / Secret",
43729
44441
  mutates: true,
43730
44442
  requiresWorkspace: true,
@@ -43752,7 +44464,7 @@ var hubspotDomain = {
43752
44464
  },
43753
44465
  {
43754
44466
  path: ["hubspot", "disconnect"],
43755
- description: "Disconnect HubSpot",
44467
+ description: "Disconnect HubSpot: clear the stored OAuth tokens and return the connection to setup (HubSpot keeps the app install)",
43756
44468
  mutates: true,
43757
44469
  requiresWorkspace: true,
43758
44470
  handler: async ({ ctx, workspace }) => {
@@ -43791,121 +44503,270 @@ var hubspotDomain = {
43791
44503
  }
43792
44504
  },
43793
44505
  {
43794
- path: ["hubspot", "sync-config"],
43795
- description: "Get HubSpot sync configuration",
44506
+ path: ["hubspot", "search"],
44507
+ description: "Search HubSpot contacts or companies; each result shows the workspace member it matches",
43796
44508
  requiresWorkspace: true,
43797
- handler: async ({ ctx, workspace }) => {
43798
- const conns = await requireAuth(ctx).apiClient.listAppConnections(workspace);
43799
- const conn = conns.find((c) => c.connectionType === "hubspot_connection");
43800
- if (!conn) throw new CLIError("No HubSpot connection found");
43801
- const result2 = await requireAuth(ctx).apiClient.getConnectionSyncConfig(
43802
- workspace,
43803
- conn.id
43804
- );
43805
- outputSingle(result2, ctx);
44509
+ args: [
44510
+ {
44511
+ name: "query",
44512
+ description: "Contacts whose email, or companies whose name, contains this text; empty lists all"
44513
+ },
44514
+ { name: "object-type", description: "'contacts' (default) or 'companies'" },
44515
+ { name: "limit", description: "Max results (1..100, default 20)" },
44516
+ {
44517
+ name: "after",
44518
+ description: "Cursor from a previous page (nextCursor); only without --query"
44519
+ }
44520
+ ],
44521
+ examples: [
44522
+ "gr hubspot search -w <ws> --query smith",
44523
+ "gr hubspot search -w <ws> --object-type companies --limit 50"
44524
+ ],
44525
+ handler: async ({ ctx, workspace, args }) => {
44526
+ const objectType = args["object-type"] ?? "contacts";
44527
+ if (!SEARCHABLE_OBJECT_TYPES.includes(objectType)) {
44528
+ throw new CLIError(
44529
+ `--object-type must be one of ${SEARCHABLE_OBJECT_TYPES.join(", ")}, got '${objectType}'`
44530
+ );
44531
+ }
44532
+ if (args["query"] && args["after"]) {
44533
+ throw new CLIError("--after pages only the listing without --query");
44534
+ }
44535
+ const result2 = await requireAuth(ctx).apiClient.searchHubspotRecords(workspace, {
44536
+ query: args["query"] ?? "",
44537
+ objectType,
44538
+ limit: optionalNumber(args, "limit") ?? 20,
44539
+ ...args["after"] ? { after: String(args["after"]) } : {}
44540
+ });
44541
+ if (ctx.outputFormat !== "table") {
44542
+ outputSingle(result2, ctx);
44543
+ return;
44544
+ }
44545
+ outputData(result2.results, ctx, SEARCH_COLUMNS);
44546
+ if (result2.hasMore && result2.nextCursor && !args["query"]) {
44547
+ console.error(`More results: --after ${result2.nextCursor}`);
44548
+ }
43806
44549
  }
43807
44550
  },
43808
44551
  {
43809
- path: ["hubspot", "update-sync-config"],
43810
- description: "Update HubSpot sync configuration",
44552
+ path: ["hubspot", "import-members"],
44553
+ // Its input is usually the previous command's output: wait for the pipe.
44554
+ pipesJsonInput: true,
44555
+ description: "Create (or update and link) workspace members from HubSpot records (max 100 per call)",
43811
44556
  mutates: true,
43812
44557
  requiresWorkspace: true,
43813
- handler: async ({ ctx, workspace, data }) => {
43814
- if (!data) throw new CLIError("JSON data required (--data, --file, or stdin)");
43815
- const conns = await requireAuth(ctx).apiClient.listAppConnections(workspace);
43816
- const conn = conns.find((c) => c.connectionType === "hubspot_connection");
43817
- if (!conn) throw new CLIError("No HubSpot connection found");
43818
- const result2 = await requireAuth(ctx).apiClient.updateConnectionSyncConfig(
43819
- workspace,
43820
- conn.id,
43821
- data
43822
- );
43823
- outputSingle(result2, ctx);
44558
+ args: [
44559
+ {
44560
+ name: "member-role-id",
44561
+ description: "Member role for new members (overrides memberRoleId in the body)"
44562
+ },
44563
+ {
44564
+ name: "ids",
44565
+ description: "Comma-separated HubSpot IDs: import only these rows of the input"
44566
+ },
44567
+ { name: "add-to-org", description: "Also add new members to the org", isFlag: true },
44568
+ {
44569
+ name: "org-role",
44570
+ description: "Org role with --add-to-org: 'member' (default), 'admin', 'owner'"
44571
+ }
44572
+ ],
44573
+ examples: [
44574
+ "gr hubspot search -w <ws> --query smith -o json \\",
44575
+ " | gr hubspot import-members -w <ws> --member-role-id 3 --allow-write",
44576
+ "gr hubspot search -w <ws> -o json > found.json",
44577
+ "gr hubspot import-members -w <ws> --file found.json --ids 101,102 --member-role-id 3 --allow-write"
44578
+ ],
44579
+ handler: async ({ ctx, workspace, args, data }) => {
44580
+ if (!data) {
44581
+ throw new CLIError(
44582
+ "JSON input required (--data, --file, or stdin): pipe `gr hubspot search -o json`"
44583
+ );
44584
+ }
44585
+ let records = importRecordsFrom(data);
44586
+ const rawIds = args["ids"];
44587
+ if (rawIds) {
44588
+ const wanted = new Set(
44589
+ rawIds.split(",").map((id) => id.trim()).filter(Boolean)
44590
+ );
44591
+ records = records.filter((r) => wanted.has(r.hubspotId));
44592
+ const missing = [...wanted].filter((id) => !records.some((r) => r.hubspotId === id));
44593
+ if (missing.length > 0) {
44594
+ throw new CLIError(`--ids not found in the input: ${missing.join(", ")}`);
44595
+ }
44596
+ }
44597
+ if (records.length === 0) throw new CLIError("No records to import");
44598
+ if (records.length > 100) {
44599
+ throw new CLIError(`At most 100 records per import; got ${records.length}`);
44600
+ }
44601
+ const bodyRoleId = data?.memberRoleId;
44602
+ const memberRoleId = optionalNumber(args, "member-role-id") ?? (typeof bodyRoleId === "number" ? bodyRoleId : void 0);
44603
+ if (memberRoleId === void 0) {
44604
+ throw new CLIError("--member-role-id is required (see: gr member-roles list)");
44605
+ }
44606
+ const addToOrg = args["add-to-org"] === true || data?.addToOrg === true;
44607
+ const orgRole = args["org-role"] ?? data?.orgRole;
44608
+ const result2 = await requireAuth(ctx).apiClient.importHubspotMembers(workspace, {
44609
+ records,
44610
+ memberRoleId,
44611
+ addToOrg,
44612
+ ...orgRole ? { orgRole } : {}
44613
+ });
44614
+ if (ctx.outputFormat !== "table") {
44615
+ outputSingle(result2, ctx);
44616
+ return;
44617
+ }
44618
+ outputData(result2.results, ctx, IMPORT_COLUMNS);
44619
+ console.error(`Imported ${result2.imported}, failed ${result2.failed}`);
43824
44620
  }
43825
44621
  },
43826
44622
  {
43827
- path: ["hubspot", "reconciliation"],
43828
- description: "Find matching HubSpot contacts for workspace members",
44623
+ path: ["hubspot", "reconciliation", "matches"],
44624
+ description: "Find unlinked members with a likely HubSpot record (by email/phone); queries HubSpot",
43829
44625
  requiresWorkspace: true,
43830
44626
  args: [
43831
- { name: "offset", description: "Pagination offset" },
43832
- { name: "limit", description: "Max results" }
44627
+ { name: "offset", description: "Scan offset (default 0)" },
44628
+ { name: "limit", description: "Max members to scan (default 50, max 200)" }
43833
44629
  ],
43834
44630
  handler: async ({ ctx, workspace, args }) => {
43835
- const offset = args["offset"] ? Number(args["offset"]) : void 0;
43836
- const limit = args["limit"] ? Number(args["limit"]) : void 0;
43837
44631
  const result2 = await requireAuth(ctx).apiClient.getHubspotReconciliationMatches(
43838
44632
  workspace,
43839
- {
43840
- offset,
43841
- limit
43842
- }
44633
+ { offset: optionalNumber(args, "offset"), limit: optionalNumber(args, "limit") }
43843
44634
  );
43844
- outputData(result2, ctx);
44635
+ outputData(result2, ctx, MATCH_COLUMNS2);
43845
44636
  }
43846
44637
  },
43847
44638
  {
43848
- path: ["hubspot", "linked-members"],
43849
- description: "List members linked to HubSpot contacts",
44639
+ path: ["hubspot", "reconciliation", "linked"],
44640
+ description: "List members linked to HubSpot records",
43850
44641
  requiresWorkspace: true,
43851
- args: LIST_PAGINATION_ARGS,
44642
+ args: [
44643
+ ...LIST_PAGINATION_ARGS,
44644
+ { name: "search", description: "Filter by member name/email/phone or HubSpot ID" }
44645
+ ],
43852
44646
  handler: async ({ ctx, workspace, args }) => {
43853
44647
  const pag = parsePaginationArgs(args);
44648
+ const search = args["search"] ? String(args["search"]) : void 0;
44649
+ const api = requireAuth(ctx).apiClient;
43854
44650
  if (pag.all) {
43855
44651
  const allItems = await fetchAllPages(
43856
- ({ page, pageSize }) => requireAuth(ctx).apiClient.getLinkedHubspotMembers(workspace, { page, pageSize })
44652
+ ({ page, pageSize }) => api.getLinkedHubspotMembers(workspace, { page, pageSize, search })
43857
44653
  );
43858
- outputData(allItems, ctx);
44654
+ outputData(allItems, ctx, LINKED_COLUMNS2);
43859
44655
  return;
43860
44656
  }
43861
- const options = {};
43862
- if (pag.page) options.page = pag.page;
43863
- if (pag.pageSize) options.pageSize = pag.pageSize;
43864
- const result2 = await requireAuth(ctx).apiClient.getLinkedHubspotMembers(
43865
- workspace,
43866
- options
43867
- );
43868
- outputData(listResult(result2, true), ctx);
44657
+ const result2 = await api.getLinkedHubspotMembers(workspace, {
44658
+ ...pag.page ? { page: pag.page } : {},
44659
+ ...pag.pageSize ? { pageSize: pag.pageSize } : {},
44660
+ ...search ? { search } : {}
44661
+ });
44662
+ outputData(listResult(result2, true), ctx, LINKED_COLUMNS2);
43869
44663
  }
43870
44664
  },
43871
44665
  {
43872
- path: ["hubspot", "link-member"],
43873
- description: "Link a member to a HubSpot contact",
44666
+ path: ["hubspot", "reconciliation", "link"],
44667
+ description: "Link a member to a HubSpot record",
43874
44668
  mutates: true,
43875
44669
  requiresWorkspace: true,
43876
44670
  args: [
43877
44671
  { name: "member-id", description: "Member ID", required: true },
43878
- { name: "contact-id", description: "HubSpot contact ID", required: true }
44672
+ { name: "record-id", description: "HubSpot record ID", required: true },
44673
+ { name: "object-type", description: "HubSpot object type (default 'contacts')" }
44674
+ ],
44675
+ examples: [
44676
+ "gr hubspot reconciliation link -w <ws> --member-id 42 --record-id 101 --allow-write"
43879
44677
  ],
43880
44678
  handler: async ({ ctx, workspace, args }) => {
44679
+ const objectType = args["object-type"] ? String(args["object-type"]) : void 0;
43881
44680
  const result2 = await requireAuth(ctx).apiClient.linkMemberToHubspot(workspace, {
43882
44681
  memberId: requireNumber(args, "member-id"),
43883
- hubspotRecordId: requireString(args, "contact-id")
44682
+ hubspotRecordId: requireString(args, "record-id"),
44683
+ ...objectType ? { objectType } : {}
44684
+ });
44685
+ outputSingle(result2, ctx);
44686
+ }
44687
+ },
44688
+ {
44689
+ path: ["hubspot", "reconciliation", "link-bulk"],
44690
+ // Its input is usually the previous command's output: wait for the pipe.
44691
+ pipesJsonInput: true,
44692
+ description: 'Link many members at once. Body: {"links":[{"memberId":1,"recordId":"101"}]} (hubspotRecordId is accepted too); `reconciliation matches -o json` pipes in',
44693
+ mutates: true,
44694
+ requiresWorkspace: true,
44695
+ examples: [
44696
+ "gr hubspot reconciliation matches -w <ws> -o json \\",
44697
+ " | gr hubspot reconciliation link-bulk -w <ws> --allow-write"
44698
+ ],
44699
+ handler: async ({ ctx, workspace, data }) => {
44700
+ const body = data;
44701
+ const rows = Array.isArray(body) ? body : body?.links;
44702
+ if (!Array.isArray(rows) || rows.length === 0) {
44703
+ throw new CLIError('JSON input must be {"links":[...]} or an array of matches');
44704
+ }
44705
+ const links = rows.map((row, index) => {
44706
+ const memberId = Number(row?.memberId);
44707
+ const recordId = row?.recordId ?? row?.hubspotRecordId;
44708
+ if (!Number.isInteger(memberId) || !recordId) {
44709
+ throw new CLIError(
44710
+ `links[${index}] needs a numeric memberId and a recordId (or hubspotRecordId)`
44711
+ );
44712
+ }
44713
+ return {
44714
+ memberId,
44715
+ hubspotRecordId: String(recordId),
44716
+ ...row.objectType ? { objectType: String(row.objectType) } : {}
44717
+ };
44718
+ });
44719
+ const result2 = await requireAuth(ctx).apiClient.bulkLinkMembersToHubspot(workspace, {
44720
+ links
43884
44721
  });
43885
44722
  outputSingle(result2, ctx);
43886
44723
  }
43887
44724
  },
43888
44725
  {
43889
- path: ["hubspot", "unlink-member"],
43890
- description: "Unlink a member from HubSpot",
44726
+ path: ["hubspot", "reconciliation", "unlink"],
44727
+ description: "Unlink a member from HubSpot (sync will not re-link them until reconciliation relink)",
43891
44728
  mutates: true,
43892
44729
  requiresWorkspace: true,
43893
44730
  args: [{ name: "member-id", description: "Member ID", required: true }],
43894
44731
  handler: async ({ ctx, workspace, args }) => {
43895
- await requireAuth(ctx).apiClient.unlinkMemberFromHubspot(
44732
+ const result2 = await requireAuth(ctx).apiClient.unlinkMemberFromHubspot(
43896
44733
  workspace,
43897
44734
  requireNumber(args, "member-id")
43898
44735
  );
43899
- process.stdout.write("Unlinked member from HubSpot\n");
44736
+ outputSingle(result2, ctx);
43900
44737
  }
43901
44738
  },
43902
44739
  {
43903
- path: ["hubspot", "contact-properties"],
43904
- description: "List available HubSpot contact properties",
44740
+ path: ["hubspot", "properties"],
44741
+ description: "List HubSpot property definitions: the sync-mappable contact properties by default, or every property of --object-type as HubSpot defines it",
43905
44742
  requiresWorkspace: true,
43906
- handler: async ({ ctx, workspace }) => {
43907
- const result2 = await requireAuth(ctx).apiClient.getHubspotContactProperties(workspace);
43908
- outputData(result2, ctx);
44743
+ args: [
44744
+ {
44745
+ name: "object-type",
44746
+ description: "Raw HubSpot schema for 'contacts', 'companies' or 'deals'"
44747
+ }
44748
+ ],
44749
+ examples: [
44750
+ "gr hubspot properties -w <ws>",
44751
+ "gr hubspot properties -w <ws> --object-type deals -o json"
44752
+ ],
44753
+ handler: async ({ ctx, workspace, args }) => {
44754
+ const objectType = args["object-type"];
44755
+ const api = requireAuth(ctx).apiClient;
44756
+ if (objectType === void 0) {
44757
+ outputData(await api.getHubspotContactProperties(workspace), ctx);
44758
+ return;
44759
+ }
44760
+ if (!OBJECT_TYPES.includes(objectType)) {
44761
+ throw new CLIError(
44762
+ `--object-type must be one of ${OBJECT_TYPES.join(", ")}, got '${objectType}'`
44763
+ );
44764
+ }
44765
+ const result2 = await api.getHubspotObjectProperties(
44766
+ workspace,
44767
+ objectType
44768
+ );
44769
+ outputSingle(result2, ctx);
43909
44770
  }
43910
44771
  },
43911
44772
  {
@@ -43917,6 +44778,22 @@ var hubspotDomain = {
43917
44778
  outputData(result2, ctx);
43918
44779
  }
43919
44780
  },
44781
+ {
44782
+ path: ["hubspot", "sync", "logs"],
44783
+ description: "List HubSpot managed-rule executions (newest first, cursor-paged)",
44784
+ requiresWorkspace: true,
44785
+ args: [
44786
+ { name: "page-size", description: "Rows per page" },
44787
+ { name: "cursor", description: "Cursor from a previous page (nextCursor)" }
44788
+ ],
44789
+ handler: async ({ ctx, workspace, args }) => {
44790
+ const result2 = await requireAuth(ctx).apiClient.getHubspotSyncLogs(workspace, {
44791
+ pageSize: optionalNumber(args, "page-size"),
44792
+ cursor: args["cursor"] ? String(args["cursor"]) : void 0
44793
+ });
44794
+ outputSingle(result2, ctx);
44795
+ }
44796
+ },
43920
44797
  {
43921
44798
  path: ["hubspot", "transform-presets"],
43922
44799
  description: "List available HubSpot field transform presets",
@@ -43925,7 +44802,8 @@ var hubspotDomain = {
43925
44802
  const result2 = await requireAuth(ctx).apiClient.getHubspotTransformPresets(workspace);
43926
44803
  outputData(result2, ctx);
43927
44804
  }
43928
- }
44805
+ },
44806
+ ...connectionCommands(HUBSPOT)
43929
44807
  ]
43930
44808
  };
43931
44809
 
@@ -44209,37 +45087,39 @@ var salesforceDomain = {
44209
45087
  commands: [
44210
45088
  {
44211
45089
  path: ["salesforce", "install"],
44212
- description: "Install Salesforce (setup step 1): create the connection and get its OAuth callback URL",
45090
+ description: "Install Salesforce (setup step 1): create the connection for an environment, then authorize",
44213
45091
  mutates: true,
44214
45092
  requiresWorkspace: true,
44215
45093
  args: [
44216
45094
  {
44217
- name: "instance-url",
44218
- description: "Salesforce login host (default https://login.salesforce.com; sandbox: https://test.salesforce.com; Developer Edition/custom domain: your org's My Domain login URL)"
45095
+ name: "environment",
45096
+ description: "Salesforce environment: production (default) or sandbox"
45097
+ },
45098
+ {
45099
+ name: "my-domain",
45100
+ description: "The org's My Domain host (e.g. acme.my.salesforce.com), only for an org that blocks login.salesforce.com / test.salesforce.com"
44219
45101
  }
44220
45102
  ],
44221
45103
  examples: [
44222
- "# Salesforce setup is a 4-step flow \u2014 this command is step 1:",
44223
- '# 1. install -> creates the connection; the response includes the OAuth "callbackUrl"',
44224
- "# 2. in Salesforce: create a Connected App (or External Client App) whose Callback URL",
44225
- "# is that callbackUrl, with OAuth scopes: api, refresh_token offline_access, openid,",
44226
- "# id profile email address phone. Copy the Consumer Key + Consumer Secret.",
44227
- "# 3. configure -> save that Client ID / Secret (and instance URL)",
44228
- '# 4. authorize -> returns an "authorizeUrl"; open it to grant access. status then',
44229
- "# reports configured=true and connected=true.",
45104
+ "# One-click setup through the shared Gravity Rail Salesforce app:",
45105
+ "# 1. install -> creates the connection for the chosen environment",
45106
+ '# 2. authorize -> returns an "authorizeUrl"; open it, sign in and approve access.',
45107
+ "# status then reports connected=true.",
45108
+ "# Advanced (own app): run configure between install and authorize, with an app whose",
45109
+ '# Callback URL is the status "callbackUrl".',
44230
45110
  "",
44231
45111
  "gr salesforce install -w <ws> --allow-write",
44232
- "gr salesforce install -w <ws> --instance-url https://test.salesforce.com --allow-write # sandbox",
44233
- "gr salesforce status -w <ws> # read back callbackUrl + configured/connected",
44234
- `gr salesforce configure -w <ws> --allow-write -d '{"clientId":"...","clientSecret":"...","instanceUrl":"https://login.salesforce.com"}'`,
44235
- "gr salesforce authorize -w <ws> --allow-write # then open the returned authorizeUrl"
45112
+ "gr salesforce install -w <ws> --environment sandbox --allow-write",
45113
+ "gr salesforce authorize -w <ws> --allow-write # then open the returned authorizeUrl",
45114
+ "gr salesforce status -w <ws>"
44236
45115
  ],
44237
45116
  handler: async ({ ctx, workspace, args }) => {
44238
- const instanceUrl = args["instance-url"];
44239
- const result2 = await requireAuth(ctx).apiClient.installSalesforce(
44240
- workspace,
44241
- typeof instanceUrl === "string" ? { instanceUrl } : void 0
44242
- );
45117
+ const environment = args["environment"];
45118
+ const myDomain = args["my-domain"];
45119
+ const result2 = await requireAuth(ctx).apiClient.installSalesforce(workspace, {
45120
+ ...typeof environment === "string" ? { environment } : {},
45121
+ ...typeof myDomain === "string" ? { myDomain } : {}
45122
+ });
44243
45123
  outputSingle(result2, ctx);
44244
45124
  }
44245
45125
  },
@@ -44254,12 +45134,12 @@ var salesforceDomain = {
44254
45134
  },
44255
45135
  {
44256
45136
  path: ["salesforce", "configure"],
44257
- description: "Configure Salesforce credentials (setup step 3): save the Client ID / Secret + instance URL",
45137
+ description: "Advanced: save your own Salesforce app's Client ID / Secret and environment, then open the returned authorizeUrl",
44258
45138
  mutates: true,
44259
45139
  requiresWorkspace: true,
44260
45140
  examples: [
44261
45141
  "gr salesforce configure -w <ws> --allow-write \\",
44262
- ` -d '{"clientId":"3MVG9...","clientSecret":"1A2B...","instanceUrl":"https://login.salesforce.com"}'`
45142
+ ` -d '{"clientId":"3MVG9...","clientSecret":"1A2B...","environment":"production"}'`
44263
45143
  ],
44264
45144
  handler: async ({ ctx, workspace, data }) => {
44265
45145
  if (!data) throw new CLIError("JSON data required (--data, --file, or stdin)");
@@ -44272,7 +45152,7 @@ var salesforceDomain = {
44272
45152
  },
44273
45153
  {
44274
45154
  path: ["salesforce", "authorize"],
44275
- description: "Authorize Salesforce via OAuth (setup step 4): returns an authorizeUrl to open in a browser",
45155
+ description: "Authorize Salesforce via OAuth (setup step 2): returns an authorizeUrl to open in a browser",
44276
45156
  mutates: true,
44277
45157
  requiresWorkspace: true,
44278
45158
  handler: async ({ ctx, workspace }) => {
@@ -49359,7 +50239,7 @@ async function main() {
49359
50239
  process.stderr.write("Error: --workspace (-w) is required\n");
49360
50240
  process.exit(1);
49361
50241
  }
49362
- const data = commandNeedsJsonBody(cmd, parsedArgs) ? await readJsonInput(parsedArgs) : void 0;
50242
+ const data = await readCommandJsonInput(cmd, parsedArgs);
49363
50243
  hctx = { ctx, args: parsedArgs, workspace, data };
49364
50244
  } else {
49365
50245
  const baseCtx = createPublicContext(opts);