@carlonicora/nextjs-jsonapi 1.113.0 → 1.114.0
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/{AssistantInterface-B1c8FhGA.d.mts → AssistantInterface-B56qznuH.d.mts} +2 -0
- package/dist/{AssistantInterface-BBUHxOCd.d.ts → AssistantInterface-CHiJIYDY.d.ts} +2 -0
- package/dist/{AssistantMessageInterface-DrgHDjZ5.d.mts → AssistantMessageInterface-BuUZFkE5.d.mts} +16 -1
- package/dist/{AssistantMessageInterface-BNzf1etU.d.ts → AssistantMessageInterface-CQwh5tEb.d.ts} +16 -1
- package/dist/{BlockNoteEditor-DOAPXS7S.js → BlockNoteEditor-DT5L5AAB.js} +19 -19
- package/dist/{BlockNoteEditor-DOAPXS7S.js.map → BlockNoteEditor-DT5L5AAB.js.map} +1 -1
- package/dist/{BlockNoteEditor-F3HSL4LX.mjs → BlockNoteEditor-HIEAHXR4.mjs} +4 -4
- package/dist/billing/index.js +346 -346
- package/dist/billing/index.mjs +3 -3
- package/dist/{chunk-6XWW67F2.js → chunk-4BUZUKER.js} +7 -7
- package/dist/{chunk-6XWW67F2.js.map → chunk-4BUZUKER.js.map} +1 -1
- package/dist/{chunk-U2HR57MY.js → chunk-7EQ46GUL.js} +76 -25
- package/dist/chunk-7EQ46GUL.js.map +1 -0
- package/dist/{chunk-CWVYU4YZ.mjs → chunk-DJSH6VHF.mjs} +2 -2
- package/dist/{chunk-ZYPNVEHB.mjs → chunk-FBTTIGLL.mjs} +53 -2
- package/dist/{chunk-ZYPNVEHB.mjs.map → chunk-FBTTIGLL.mjs.map} +1 -1
- package/dist/{chunk-CI36BXIG.mjs → chunk-TVOW47AP.mjs} +75 -20
- package/dist/chunk-TVOW47AP.mjs.map +1 -0
- package/dist/{chunk-UBFVV2DA.js → chunk-VA2KFKHD.js} +881 -826
- package/dist/chunk-VA2KFKHD.js.map +1 -0
- package/dist/client/index.js +4 -4
- package/dist/client/index.mjs +3 -3
- package/dist/components/index.d.mts +24 -7
- package/dist/components/index.d.ts +24 -7
- package/dist/components/index.js +4 -4
- package/dist/components/index.mjs +3 -3
- package/dist/contexts/index.d.mts +7 -2
- package/dist/contexts/index.d.ts +7 -2
- package/dist/contexts/index.js +4 -4
- package/dist/contexts/index.mjs +3 -3
- package/dist/core/index.d.mts +26 -4
- package/dist/core/index.d.ts +26 -4
- package/dist/core/index.js +2 -2
- package/dist/core/index.mjs +1 -1
- package/dist/features/help/index.js +36 -36
- package/dist/features/help/index.mjs +3 -3
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/index.mjs +2 -2
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +1 -1
- package/package.json +1 -1
- package/src/features/assistant/components/containers/AssistantContainer.tsx +18 -2
- package/src/features/assistant/components/parts/AssistantEmptyState.tsx +22 -1
- package/src/features/assistant/components/parts/AssistantThread.tsx +12 -1
- package/src/features/assistant/contexts/AssistantContext.tsx +42 -9
- package/src/features/assistant/contexts/__tests__/AssistantContext.spec.tsx +94 -3
- package/src/features/assistant/data/Assistant.ts +6 -0
- package/src/features/assistant/data/AssistantInterface.ts +2 -0
- package/src/features/assistant/data/AssistantService.ts +38 -0
- package/src/features/assistant/data/__tests__/Assistant.spec.ts +30 -0
- package/src/features/assistant-message/AssistantMessageModule.ts +2 -0
- package/src/features/assistant-message/components/MessageItem.tsx +26 -4
- package/src/features/assistant-message/components/MessageList.tsx +4 -2
- package/src/features/assistant-message/data/AssistantMessage.ts +21 -1
- package/src/features/assistant-message/data/AssistantMessageInterface.ts +16 -0
- package/dist/chunk-CI36BXIG.mjs.map +0 -1
- package/dist/chunk-U2HR57MY.js.map +0 -1
- package/dist/chunk-UBFVV2DA.js.map +0 -1
- /package/dist/{BlockNoteEditor-F3HSL4LX.mjs.map → BlockNoteEditor-HIEAHXR4.mjs.map} +0 -0
- /package/dist/{chunk-CWVYU4YZ.mjs.map → chunk-DJSH6VHF.mjs.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunk4BUZUKERjs = require('./chunk-4BUZUKER.js');
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -199,7 +199,7 @@ var _chunk6XWW67F2js = require('./chunk-6XWW67F2.js');
|
|
|
199
199
|
|
|
200
200
|
|
|
201
201
|
|
|
202
|
-
var
|
|
202
|
+
var _chunk7EQ46GULjs = require('./chunk-7EQ46GUL.js');
|
|
203
203
|
require('./chunk-LXKSUWAV.js');
|
|
204
204
|
require('./chunk-IBS6NI7D.js');
|
|
205
205
|
|
|
@@ -423,5 +423,5 @@ require('./chunk-7QVYU63E.js');
|
|
|
423
423
|
|
|
424
424
|
|
|
425
425
|
|
|
426
|
-
exports.ACTION_TYPES = _chunk6XWW67F2js.ACTION_TYPES; exports.AVAILABLE_OAUTH_SCOPES = _chunkU2HR57MYjs.AVAILABLE_OAUTH_SCOPES; exports.AbstractApiData = _chunkU2HR57MYjs.AbstractApiData; exports.AbstractService = _chunkU2HR57MYjs.AbstractService; exports.Action = _chunkU2HR57MYjs.Action; exports.Assistant = _chunkU2HR57MYjs.Assistant; exports.AssistantMessage = _chunkU2HR57MYjs.AssistantMessage; exports.AssistantMessageModule = _chunkU2HR57MYjs.AssistantMessageModule; exports.AssistantMessageService = _chunkU2HR57MYjs.AssistantMessageService; exports.AssistantModule = _chunkU2HR57MYjs.AssistantModule; exports.AssistantService = _chunkU2HR57MYjs.AssistantService; exports.AuditLog = _chunkU2HR57MYjs.AuditLog; exports.AuditLogModule = _chunkU2HR57MYjs.AuditLogModule; exports.AuditLogService = _chunkU2HR57MYjs.AuditLogService; exports.Auth = _chunkU2HR57MYjs.Auth; exports.AuthComponent = _chunkU2HR57MYjs.AuthComponent; exports.AuthModule = _chunkU2HR57MYjs.AuthModule; exports.AuthService = _chunkU2HR57MYjs.AuthService; exports.AuthorModule = _chunkU2HR57MYjs.AuthorModule; exports.BackupCodeVerify = _chunkU2HR57MYjs.BackupCodeVerify; exports.BackupCodeVerifyModule = _chunkU2HR57MYjs.BackupCodeVerifyModule; exports.Billing = _chunkU2HR57MYjs.Billing; exports.BillingModule = _chunkU2HR57MYjs.BillingModule; exports.BillingService = _chunkU2HR57MYjs.BillingService; exports.BlockNoteDiffUtil = _chunkU2HR57MYjs.BlockNoteDiffUtil; exports.BlockNoteWordDiffRendererUtil = _chunkU2HR57MYjs.BlockNoteWordDiffRendererUtil; exports.COMPANY_ADMINISTRATOR_ROLE_ID = _chunk6XWW67F2js.COMPANY_ADMINISTRATOR_ROLE_ID; exports.Chunk = _chunkU2HR57MYjs.Chunk; exports.ChunkModule = _chunkU2HR57MYjs.ChunkModule; exports.ClientAbstractService = _chunkU2HR57MYjs.ClientAbstractService; exports.ClientHttpMethod = _chunkU2HR57MYjs.ClientHttpMethod; exports.Company = _chunkU2HR57MYjs.Company; exports.CompanyFields = _chunkU2HR57MYjs.CompanyFields; exports.CompanyModule = _chunkU2HR57MYjs.CompanyModule; exports.CompanyService = _chunkU2HR57MYjs.CompanyService; exports.Content = _chunkU2HR57MYjs.Content; exports.ContentFields = _chunkU2HR57MYjs.ContentFields; exports.ContentModule = _chunkU2HR57MYjs.ContentModule; exports.ContentService = _chunkU2HR57MYjs.ContentService; exports.DEFAULT_GRANT_TYPES = _chunkU2HR57MYjs.DEFAULT_GRANT_TYPES; exports.DataClass = _chunkJ5LROFGLjs.DataClassRegistry; exports.DataClassRegistry = _chunkJ5LROFGLjs.DataClassRegistry; exports.EndpointCreator = _chunkU2HR57MYjs.EndpointCreator; exports.Feature = _chunkU2HR57MYjs.Feature; exports.FeatureModule = _chunkU2HR57MYjs.FeatureModule; exports.FeatureService = _chunkU2HR57MYjs.FeatureService; exports.HowTo = _chunkU2HR57MYjs.HowTo; exports.HowToFields = _chunkU2HR57MYjs.HowToFields; exports.HowToModule = _chunkU2HR57MYjs.HowToModule; exports.HowToService = _chunkU2HR57MYjs.HowToService; exports.HttpMethod = _chunkU2HR57MYjs.HttpMethod; exports.InvoiceStatus = _chunkU2HR57MYjs.InvoiceStatus; exports.JsonApiDataFactory = _chunkJ5LROFGLjs.JsonApiDataFactory; exports.Module = _chunkU2HR57MYjs.Module; exports.ModuleModule = _chunkU2HR57MYjs.ModuleModule; exports.ModulePaths = _chunkU2HR57MYjs.ModulePaths; exports.ModulePathsModule = _chunkU2HR57MYjs.ModulePathsModule; exports.ModuleRegistrar = _chunkU2HR57MYjs.ModuleRegistrar; exports.ModuleRegistry = _chunkU2HR57MYjs.ModuleRegistry; exports.Modules = _chunkU2HR57MYjs.Modules; exports.Notification = _chunkU2HR57MYjs.Notification; exports.NotificationFields = _chunkU2HR57MYjs.NotificationFields; exports.NotificationModule = _chunkU2HR57MYjs.NotificationModule; exports.NotificationService = _chunkU2HR57MYjs.NotificationService; exports.OAUTH_SCOPE_DISPLAY = _chunkU2HR57MYjs.OAUTH_SCOPE_DISPLAY; exports.OAuthClient = _chunkU2HR57MYjs.OAuthClient; exports.OAuthModule = _chunkU2HR57MYjs.OAuthModule; exports.OAuthService = _chunkU2HR57MYjs.OAuthService; exports.Passkey = _chunkU2HR57MYjs.Passkey; exports.PasskeyAuthenticationOptions = _chunkU2HR57MYjs.PasskeyAuthenticationOptions; exports.PasskeyAuthenticationOptionsModule = _chunkU2HR57MYjs.PasskeyAuthenticationOptionsModule; exports.PasskeyModule = _chunkU2HR57MYjs.PasskeyModule; exports.PasskeyRegistrationOptions = _chunkU2HR57MYjs.PasskeyRegistrationOptions; exports.PasskeyRegistrationOptionsModule = _chunkU2HR57MYjs.PasskeyRegistrationOptionsModule; exports.PasskeyRegistrationVerify = _chunkU2HR57MYjs.PasskeyRegistrationVerify; exports.PasskeyRegistrationVerifyModule = _chunkU2HR57MYjs.PasskeyRegistrationVerifyModule; exports.PasskeyRename = _chunkU2HR57MYjs.PasskeyRename; exports.PasskeyRenameModule = _chunkU2HR57MYjs.PasskeyRenameModule; exports.PasskeyVerifyLogin = _chunkU2HR57MYjs.PasskeyVerifyLogin; exports.PasskeyVerifyLoginModule = _chunkU2HR57MYjs.PasskeyVerifyLoginModule; exports.PaymentMethod = _chunkU2HR57MYjs.PaymentMethod; exports.PermissionMapping = _chunkU2HR57MYjs.PermissionMapping; exports.PermissionMappingModule = _chunkU2HR57MYjs.PermissionMappingModule; exports.Push = _chunkU2HR57MYjs.Push; exports.PushModule = _chunkU2HR57MYjs.PushModule; exports.PushService = _chunkU2HR57MYjs.PushService; exports.RbacMatrixModel = _chunkU2HR57MYjs.RbacMatrixModel; exports.RbacMatrixModule = _chunkU2HR57MYjs.RbacMatrixModule; exports.RbacService = _chunk6XWW67F2js.RbacService; exports.ReferralModule = _chunkU2HR57MYjs.ReferralModule; exports.ReferralService = _chunkU2HR57MYjs.ReferralService; exports.ReferralStats = _chunkU2HR57MYjs.ReferralStats; exports.ReferralStatsModule = _chunkU2HR57MYjs.ReferralStatsModule; exports.RehydrationFactory = _chunkU2HR57MYjs.RehydrationFactory; exports.Role = _chunkU2HR57MYjs.Role; exports.RoleFields = _chunkU2HR57MYjs.RoleFields; exports.RoleModule = _chunkU2HR57MYjs.RoleModule; exports.RoleService = _chunkU2HR57MYjs.RoleService; exports.S3 = _chunkU2HR57MYjs.S3; exports.S3Module = _chunkU2HR57MYjs.S3Module; exports.S3Service = _chunkU2HR57MYjs.S3Service; exports.StripeCustomer = _chunkU2HR57MYjs.StripeCustomer; exports.StripeCustomerModule = _chunkU2HR57MYjs.StripeCustomerModule; exports.StripeCustomerService = _chunkU2HR57MYjs.StripeCustomerService; exports.StripeInvoice = _chunkU2HR57MYjs.StripeInvoice; exports.StripeInvoiceModule = _chunkU2HR57MYjs.StripeInvoiceModule; exports.StripeInvoiceService = _chunkU2HR57MYjs.StripeInvoiceService; exports.StripePaymentMethodModule = _chunkU2HR57MYjs.StripePaymentMethodModule; exports.StripePrice = _chunkU2HR57MYjs.StripePrice; exports.StripePriceModule = _chunkU2HR57MYjs.StripePriceModule; exports.StripePriceService = _chunkU2HR57MYjs.StripePriceService; exports.StripeProduct = _chunkU2HR57MYjs.StripeProduct; exports.StripeProductModule = _chunkU2HR57MYjs.StripeProductModule; exports.StripeProductService = _chunkU2HR57MYjs.StripeProductService; exports.StripePromotionCode = _chunkU2HR57MYjs.StripePromotionCode; exports.StripePromotionCodeModule = _chunkU2HR57MYjs.StripePromotionCodeModule; exports.StripePromotionCodeService = _chunkU2HR57MYjs.StripePromotionCodeService; exports.StripeSubscription = _chunkU2HR57MYjs.StripeSubscription; exports.StripeSubscriptionModule = _chunkU2HR57MYjs.StripeSubscriptionModule; exports.StripeSubscriptionService = _chunkU2HR57MYjs.StripeSubscriptionService; exports.StripeUsage = _chunkU2HR57MYjs.StripeUsage; exports.StripeUsageModule = _chunkU2HR57MYjs.StripeUsageModule; exports.StripeUsageService = _chunkU2HR57MYjs.StripeUsageService; exports.SubscriptionStatus = _chunkU2HR57MYjs.SubscriptionStatus; exports.TableOptions = _chunkU2HR57MYjs.TableOptions; exports.TotpAuthenticator = _chunkU2HR57MYjs.TotpAuthenticator; exports.TotpAuthenticatorModule = _chunkU2HR57MYjs.TotpAuthenticatorModule; exports.TotpSetup = _chunkU2HR57MYjs.TotpSetup; exports.TotpSetupModule = _chunkU2HR57MYjs.TotpSetupModule; exports.TotpVerify = _chunkU2HR57MYjs.TotpVerify; exports.TotpVerifyLogin = _chunkU2HR57MYjs.TotpVerifyLogin; exports.TotpVerifyLoginModule = _chunkU2HR57MYjs.TotpVerifyLoginModule; exports.TotpVerifyModule = _chunkU2HR57MYjs.TotpVerifyModule; exports.TwoFactorChallenge = _chunkU2HR57MYjs.TwoFactorChallenge; exports.TwoFactorChallengeModule = _chunkU2HR57MYjs.TwoFactorChallengeModule; exports.TwoFactorEnable = _chunkU2HR57MYjs.TwoFactorEnable; exports.TwoFactorEnableModule = _chunkU2HR57MYjs.TwoFactorEnableModule; exports.TwoFactorService = _chunkU2HR57MYjs.TwoFactorService; exports.TwoFactorStatus = _chunkU2HR57MYjs.TwoFactorStatus; exports.TwoFactorStatusModule = _chunkU2HR57MYjs.TwoFactorStatusModule; exports.User = _chunkU2HR57MYjs.User; exports.UserFields = _chunkU2HR57MYjs.UserFields; exports.UserModule = _chunkU2HR57MYjs.UserModule; exports.UserService = _chunkU2HR57MYjs.UserService; exports.Waitlist = _chunkU2HR57MYjs.Waitlist; exports.WaitlistModule = _chunkU2HR57MYjs.WaitlistModule; exports.WaitlistService = _chunkU2HR57MYjs.WaitlistService; exports.WaitlistStats = _chunkU2HR57MYjs.WaitlistStats; exports.WaitlistStatsModule = _chunkU2HR57MYjs.WaitlistStatsModule; exports.checkPermissions = _chunkU2HR57MYjs.checkPermissions; exports.checkPermissionsFromServer = _chunkU2HR57MYjs.checkPermissionsFromServer; exports.clearLastApiTotal = _chunkU2HR57MYjs.clearLastApiTotal; exports.cn = _chunkU2HR57MYjs.cn; exports.composeRefs = _chunkU2HR57MYjs.composeRefs; exports.configureAuth = _chunkU2HR57MYjs.configureAuth; exports.configureI18n = _chunk6XWW67F2js.configureI18n; exports.configureJsonApi = _chunk6XWW67F2js.configureJsonApi; exports.configureLogin = _chunk6XWW67F2js.configureLogin; exports.configureReferral = _chunk6XWW67F2js.configureReferral; exports.configureRoles = _chunk6XWW67F2js.configureRoles; exports.configureWaitlist = _chunk6XWW67F2js.configureWaitlist; exports.createJsonApiInclusion = _chunkU2HR57MYjs.createJsonApiInclusion; exports.dismissToast = _chunkU2HR57MYjs.dismissToast; exports.entityObjectSchema = _chunkU2HR57MYjs.entityObjectSchema; exports.exists = _chunkU2HR57MYjs.exists; exports.formatDate = _chunkU2HR57MYjs.formatDate; exports.formatLocalDate = _chunkU2HR57MYjs.formatLocalDate; exports.getApiUrl = _chunk6XWW67F2js.getApiUrl; exports.getAppUrl = _chunk6XWW67F2js.getAppUrl; exports.getBootstrapper = _chunkJ5LROFGLjs.getBootstrapper; exports.getClientGlobalErrorHandler = _chunkU2HR57MYjs.getClientGlobalErrorHandler; exports.getGlobalErrorHandler = _chunkU2HR57MYjs.getGlobalErrorHandler; exports.getIcon = _chunkU2HR57MYjs.getIcon; exports.getIconByModule = _chunkU2HR57MYjs.getIconByModule; exports.getIconByModuleName = _chunkU2HR57MYjs.getIconByModuleName; exports.getInitials = _chunkU2HR57MYjs.getInitials; exports.getLastApiTotal = _chunkU2HR57MYjs.getLastApiTotal; exports.getLucideIcon = _chunkU2HR57MYjs.getLucideIcon; exports.getLucideIconByModule = _chunkU2HR57MYjs.getLucideIconByModule; exports.getLucideIconByModuleName = _chunkU2HR57MYjs.getLucideIconByModuleName; exports.getPublicApiUrl = _chunk6XWW67F2js.getPublicApiUrl; exports.getReferralConfig = _chunk6XWW67F2js.getReferralConfig; exports.getRoleId = _chunk6XWW67F2js.getRoleId; exports.getStripePublishableKey = _chunk6XWW67F2js.getStripePublishableKey; exports.getTableComponents = _chunkU2HR57MYjs.getTableComponents; exports.getTableOptions = _chunkU2HR57MYjs.getTableOptions; exports.getTokenHandler = _chunkU2HR57MYjs.getTokenHandler; exports.getTrackablePages = _chunk6XWW67F2js.getTrackablePages; exports.getValueFromPath = _chunkU2HR57MYjs.getValueFromPath; exports.getWaitlistConfig = _chunk6XWW67F2js.getWaitlistConfig; exports.hasBootstrapper = _chunkJ5LROFGLjs.hasBootstrapper; exports.isReferralEnabled = _chunk6XWW67F2js.isReferralEnabled; exports.isRolesConfigured = _chunk6XWW67F2js.isRolesConfigured; exports.rehydrate = _chunkU2HR57MYjs.rehydrate; exports.rehydrateList = _chunkU2HR57MYjs.rehydrateList; exports.resetBootstrapStore = _chunkJ5LROFGLjs.resetBootstrapStore; exports.setBootstrapper = _chunkJ5LROFGLjs.setBootstrapper; exports.setClientGlobalErrorHandler = _chunkU2HR57MYjs.setClientGlobalErrorHandler; exports.setGlobalErrorHandler = _chunkU2HR57MYjs.setGlobalErrorHandler; exports.showCustomToast = _chunkU2HR57MYjs.showCustomToast; exports.showError = _chunkU2HR57MYjs.showError; exports.showToast = _chunkU2HR57MYjs.showToast; exports.translateData = _chunkJ5LROFGLjs.translateData; exports.translateResponse = _chunkJ5LROFGLjs.translateResponse; exports.tryBootstrap = _chunkJ5LROFGLjs.tryBootstrap; exports.useComposedRefs = _chunkU2HR57MYjs.useComposedRefs; exports.useIsMobile = _chunkU2HR57MYjs.useIsMobile; exports.userObjectSchema = _chunkU2HR57MYjs.userObjectSchema;
|
|
426
|
+
exports.ACTION_TYPES = _chunk4BUZUKERjs.ACTION_TYPES; exports.AVAILABLE_OAUTH_SCOPES = _chunk7EQ46GULjs.AVAILABLE_OAUTH_SCOPES; exports.AbstractApiData = _chunk7EQ46GULjs.AbstractApiData; exports.AbstractService = _chunk7EQ46GULjs.AbstractService; exports.Action = _chunk7EQ46GULjs.Action; exports.Assistant = _chunk7EQ46GULjs.Assistant; exports.AssistantMessage = _chunk7EQ46GULjs.AssistantMessage; exports.AssistantMessageModule = _chunk7EQ46GULjs.AssistantMessageModule; exports.AssistantMessageService = _chunk7EQ46GULjs.AssistantMessageService; exports.AssistantModule = _chunk7EQ46GULjs.AssistantModule; exports.AssistantService = _chunk7EQ46GULjs.AssistantService; exports.AuditLog = _chunk7EQ46GULjs.AuditLog; exports.AuditLogModule = _chunk7EQ46GULjs.AuditLogModule; exports.AuditLogService = _chunk7EQ46GULjs.AuditLogService; exports.Auth = _chunk7EQ46GULjs.Auth; exports.AuthComponent = _chunk7EQ46GULjs.AuthComponent; exports.AuthModule = _chunk7EQ46GULjs.AuthModule; exports.AuthService = _chunk7EQ46GULjs.AuthService; exports.AuthorModule = _chunk7EQ46GULjs.AuthorModule; exports.BackupCodeVerify = _chunk7EQ46GULjs.BackupCodeVerify; exports.BackupCodeVerifyModule = _chunk7EQ46GULjs.BackupCodeVerifyModule; exports.Billing = _chunk7EQ46GULjs.Billing; exports.BillingModule = _chunk7EQ46GULjs.BillingModule; exports.BillingService = _chunk7EQ46GULjs.BillingService; exports.BlockNoteDiffUtil = _chunk7EQ46GULjs.BlockNoteDiffUtil; exports.BlockNoteWordDiffRendererUtil = _chunk7EQ46GULjs.BlockNoteWordDiffRendererUtil; exports.COMPANY_ADMINISTRATOR_ROLE_ID = _chunk4BUZUKERjs.COMPANY_ADMINISTRATOR_ROLE_ID; exports.Chunk = _chunk7EQ46GULjs.Chunk; exports.ChunkModule = _chunk7EQ46GULjs.ChunkModule; exports.ClientAbstractService = _chunk7EQ46GULjs.ClientAbstractService; exports.ClientHttpMethod = _chunk7EQ46GULjs.ClientHttpMethod; exports.Company = _chunk7EQ46GULjs.Company; exports.CompanyFields = _chunk7EQ46GULjs.CompanyFields; exports.CompanyModule = _chunk7EQ46GULjs.CompanyModule; exports.CompanyService = _chunk7EQ46GULjs.CompanyService; exports.Content = _chunk7EQ46GULjs.Content; exports.ContentFields = _chunk7EQ46GULjs.ContentFields; exports.ContentModule = _chunk7EQ46GULjs.ContentModule; exports.ContentService = _chunk7EQ46GULjs.ContentService; exports.DEFAULT_GRANT_TYPES = _chunk7EQ46GULjs.DEFAULT_GRANT_TYPES; exports.DataClass = _chunkJ5LROFGLjs.DataClassRegistry; exports.DataClassRegistry = _chunkJ5LROFGLjs.DataClassRegistry; exports.EndpointCreator = _chunk7EQ46GULjs.EndpointCreator; exports.Feature = _chunk7EQ46GULjs.Feature; exports.FeatureModule = _chunk7EQ46GULjs.FeatureModule; exports.FeatureService = _chunk7EQ46GULjs.FeatureService; exports.HowTo = _chunk7EQ46GULjs.HowTo; exports.HowToFields = _chunk7EQ46GULjs.HowToFields; exports.HowToModule = _chunk7EQ46GULjs.HowToModule; exports.HowToService = _chunk7EQ46GULjs.HowToService; exports.HttpMethod = _chunk7EQ46GULjs.HttpMethod; exports.InvoiceStatus = _chunk7EQ46GULjs.InvoiceStatus; exports.JsonApiDataFactory = _chunkJ5LROFGLjs.JsonApiDataFactory; exports.Module = _chunk7EQ46GULjs.Module; exports.ModuleModule = _chunk7EQ46GULjs.ModuleModule; exports.ModulePaths = _chunk7EQ46GULjs.ModulePaths; exports.ModulePathsModule = _chunk7EQ46GULjs.ModulePathsModule; exports.ModuleRegistrar = _chunk7EQ46GULjs.ModuleRegistrar; exports.ModuleRegistry = _chunk7EQ46GULjs.ModuleRegistry; exports.Modules = _chunk7EQ46GULjs.Modules; exports.Notification = _chunk7EQ46GULjs.Notification; exports.NotificationFields = _chunk7EQ46GULjs.NotificationFields; exports.NotificationModule = _chunk7EQ46GULjs.NotificationModule; exports.NotificationService = _chunk7EQ46GULjs.NotificationService; exports.OAUTH_SCOPE_DISPLAY = _chunk7EQ46GULjs.OAUTH_SCOPE_DISPLAY; exports.OAuthClient = _chunk7EQ46GULjs.OAuthClient; exports.OAuthModule = _chunk7EQ46GULjs.OAuthModule; exports.OAuthService = _chunk7EQ46GULjs.OAuthService; exports.Passkey = _chunk7EQ46GULjs.Passkey; exports.PasskeyAuthenticationOptions = _chunk7EQ46GULjs.PasskeyAuthenticationOptions; exports.PasskeyAuthenticationOptionsModule = _chunk7EQ46GULjs.PasskeyAuthenticationOptionsModule; exports.PasskeyModule = _chunk7EQ46GULjs.PasskeyModule; exports.PasskeyRegistrationOptions = _chunk7EQ46GULjs.PasskeyRegistrationOptions; exports.PasskeyRegistrationOptionsModule = _chunk7EQ46GULjs.PasskeyRegistrationOptionsModule; exports.PasskeyRegistrationVerify = _chunk7EQ46GULjs.PasskeyRegistrationVerify; exports.PasskeyRegistrationVerifyModule = _chunk7EQ46GULjs.PasskeyRegistrationVerifyModule; exports.PasskeyRename = _chunk7EQ46GULjs.PasskeyRename; exports.PasskeyRenameModule = _chunk7EQ46GULjs.PasskeyRenameModule; exports.PasskeyVerifyLogin = _chunk7EQ46GULjs.PasskeyVerifyLogin; exports.PasskeyVerifyLoginModule = _chunk7EQ46GULjs.PasskeyVerifyLoginModule; exports.PaymentMethod = _chunk7EQ46GULjs.PaymentMethod; exports.PermissionMapping = _chunk7EQ46GULjs.PermissionMapping; exports.PermissionMappingModule = _chunk7EQ46GULjs.PermissionMappingModule; exports.Push = _chunk7EQ46GULjs.Push; exports.PushModule = _chunk7EQ46GULjs.PushModule; exports.PushService = _chunk7EQ46GULjs.PushService; exports.RbacMatrixModel = _chunk7EQ46GULjs.RbacMatrixModel; exports.RbacMatrixModule = _chunk7EQ46GULjs.RbacMatrixModule; exports.RbacService = _chunk4BUZUKERjs.RbacService; exports.ReferralModule = _chunk7EQ46GULjs.ReferralModule; exports.ReferralService = _chunk7EQ46GULjs.ReferralService; exports.ReferralStats = _chunk7EQ46GULjs.ReferralStats; exports.ReferralStatsModule = _chunk7EQ46GULjs.ReferralStatsModule; exports.RehydrationFactory = _chunk7EQ46GULjs.RehydrationFactory; exports.Role = _chunk7EQ46GULjs.Role; exports.RoleFields = _chunk7EQ46GULjs.RoleFields; exports.RoleModule = _chunk7EQ46GULjs.RoleModule; exports.RoleService = _chunk7EQ46GULjs.RoleService; exports.S3 = _chunk7EQ46GULjs.S3; exports.S3Module = _chunk7EQ46GULjs.S3Module; exports.S3Service = _chunk7EQ46GULjs.S3Service; exports.StripeCustomer = _chunk7EQ46GULjs.StripeCustomer; exports.StripeCustomerModule = _chunk7EQ46GULjs.StripeCustomerModule; exports.StripeCustomerService = _chunk7EQ46GULjs.StripeCustomerService; exports.StripeInvoice = _chunk7EQ46GULjs.StripeInvoice; exports.StripeInvoiceModule = _chunk7EQ46GULjs.StripeInvoiceModule; exports.StripeInvoiceService = _chunk7EQ46GULjs.StripeInvoiceService; exports.StripePaymentMethodModule = _chunk7EQ46GULjs.StripePaymentMethodModule; exports.StripePrice = _chunk7EQ46GULjs.StripePrice; exports.StripePriceModule = _chunk7EQ46GULjs.StripePriceModule; exports.StripePriceService = _chunk7EQ46GULjs.StripePriceService; exports.StripeProduct = _chunk7EQ46GULjs.StripeProduct; exports.StripeProductModule = _chunk7EQ46GULjs.StripeProductModule; exports.StripeProductService = _chunk7EQ46GULjs.StripeProductService; exports.StripePromotionCode = _chunk7EQ46GULjs.StripePromotionCode; exports.StripePromotionCodeModule = _chunk7EQ46GULjs.StripePromotionCodeModule; exports.StripePromotionCodeService = _chunk7EQ46GULjs.StripePromotionCodeService; exports.StripeSubscription = _chunk7EQ46GULjs.StripeSubscription; exports.StripeSubscriptionModule = _chunk7EQ46GULjs.StripeSubscriptionModule; exports.StripeSubscriptionService = _chunk7EQ46GULjs.StripeSubscriptionService; exports.StripeUsage = _chunk7EQ46GULjs.StripeUsage; exports.StripeUsageModule = _chunk7EQ46GULjs.StripeUsageModule; exports.StripeUsageService = _chunk7EQ46GULjs.StripeUsageService; exports.SubscriptionStatus = _chunk7EQ46GULjs.SubscriptionStatus; exports.TableOptions = _chunk7EQ46GULjs.TableOptions; exports.TotpAuthenticator = _chunk7EQ46GULjs.TotpAuthenticator; exports.TotpAuthenticatorModule = _chunk7EQ46GULjs.TotpAuthenticatorModule; exports.TotpSetup = _chunk7EQ46GULjs.TotpSetup; exports.TotpSetupModule = _chunk7EQ46GULjs.TotpSetupModule; exports.TotpVerify = _chunk7EQ46GULjs.TotpVerify; exports.TotpVerifyLogin = _chunk7EQ46GULjs.TotpVerifyLogin; exports.TotpVerifyLoginModule = _chunk7EQ46GULjs.TotpVerifyLoginModule; exports.TotpVerifyModule = _chunk7EQ46GULjs.TotpVerifyModule; exports.TwoFactorChallenge = _chunk7EQ46GULjs.TwoFactorChallenge; exports.TwoFactorChallengeModule = _chunk7EQ46GULjs.TwoFactorChallengeModule; exports.TwoFactorEnable = _chunk7EQ46GULjs.TwoFactorEnable; exports.TwoFactorEnableModule = _chunk7EQ46GULjs.TwoFactorEnableModule; exports.TwoFactorService = _chunk7EQ46GULjs.TwoFactorService; exports.TwoFactorStatus = _chunk7EQ46GULjs.TwoFactorStatus; exports.TwoFactorStatusModule = _chunk7EQ46GULjs.TwoFactorStatusModule; exports.User = _chunk7EQ46GULjs.User; exports.UserFields = _chunk7EQ46GULjs.UserFields; exports.UserModule = _chunk7EQ46GULjs.UserModule; exports.UserService = _chunk7EQ46GULjs.UserService; exports.Waitlist = _chunk7EQ46GULjs.Waitlist; exports.WaitlistModule = _chunk7EQ46GULjs.WaitlistModule; exports.WaitlistService = _chunk7EQ46GULjs.WaitlistService; exports.WaitlistStats = _chunk7EQ46GULjs.WaitlistStats; exports.WaitlistStatsModule = _chunk7EQ46GULjs.WaitlistStatsModule; exports.checkPermissions = _chunk7EQ46GULjs.checkPermissions; exports.checkPermissionsFromServer = _chunk7EQ46GULjs.checkPermissionsFromServer; exports.clearLastApiTotal = _chunk7EQ46GULjs.clearLastApiTotal; exports.cn = _chunk7EQ46GULjs.cn; exports.composeRefs = _chunk7EQ46GULjs.composeRefs; exports.configureAuth = _chunk7EQ46GULjs.configureAuth; exports.configureI18n = _chunk4BUZUKERjs.configureI18n; exports.configureJsonApi = _chunk4BUZUKERjs.configureJsonApi; exports.configureLogin = _chunk4BUZUKERjs.configureLogin; exports.configureReferral = _chunk4BUZUKERjs.configureReferral; exports.configureRoles = _chunk4BUZUKERjs.configureRoles; exports.configureWaitlist = _chunk4BUZUKERjs.configureWaitlist; exports.createJsonApiInclusion = _chunk7EQ46GULjs.createJsonApiInclusion; exports.dismissToast = _chunk7EQ46GULjs.dismissToast; exports.entityObjectSchema = _chunk7EQ46GULjs.entityObjectSchema; exports.exists = _chunk7EQ46GULjs.exists; exports.formatDate = _chunk7EQ46GULjs.formatDate; exports.formatLocalDate = _chunk7EQ46GULjs.formatLocalDate; exports.getApiUrl = _chunk4BUZUKERjs.getApiUrl; exports.getAppUrl = _chunk4BUZUKERjs.getAppUrl; exports.getBootstrapper = _chunkJ5LROFGLjs.getBootstrapper; exports.getClientGlobalErrorHandler = _chunk7EQ46GULjs.getClientGlobalErrorHandler; exports.getGlobalErrorHandler = _chunk7EQ46GULjs.getGlobalErrorHandler; exports.getIcon = _chunk7EQ46GULjs.getIcon; exports.getIconByModule = _chunk7EQ46GULjs.getIconByModule; exports.getIconByModuleName = _chunk7EQ46GULjs.getIconByModuleName; exports.getInitials = _chunk7EQ46GULjs.getInitials; exports.getLastApiTotal = _chunk7EQ46GULjs.getLastApiTotal; exports.getLucideIcon = _chunk7EQ46GULjs.getLucideIcon; exports.getLucideIconByModule = _chunk7EQ46GULjs.getLucideIconByModule; exports.getLucideIconByModuleName = _chunk7EQ46GULjs.getLucideIconByModuleName; exports.getPublicApiUrl = _chunk4BUZUKERjs.getPublicApiUrl; exports.getReferralConfig = _chunk4BUZUKERjs.getReferralConfig; exports.getRoleId = _chunk4BUZUKERjs.getRoleId; exports.getStripePublishableKey = _chunk4BUZUKERjs.getStripePublishableKey; exports.getTableComponents = _chunk7EQ46GULjs.getTableComponents; exports.getTableOptions = _chunk7EQ46GULjs.getTableOptions; exports.getTokenHandler = _chunk7EQ46GULjs.getTokenHandler; exports.getTrackablePages = _chunk4BUZUKERjs.getTrackablePages; exports.getValueFromPath = _chunk7EQ46GULjs.getValueFromPath; exports.getWaitlistConfig = _chunk4BUZUKERjs.getWaitlistConfig; exports.hasBootstrapper = _chunkJ5LROFGLjs.hasBootstrapper; exports.isReferralEnabled = _chunk4BUZUKERjs.isReferralEnabled; exports.isRolesConfigured = _chunk4BUZUKERjs.isRolesConfigured; exports.rehydrate = _chunk7EQ46GULjs.rehydrate; exports.rehydrateList = _chunk7EQ46GULjs.rehydrateList; exports.resetBootstrapStore = _chunkJ5LROFGLjs.resetBootstrapStore; exports.setBootstrapper = _chunkJ5LROFGLjs.setBootstrapper; exports.setClientGlobalErrorHandler = _chunk7EQ46GULjs.setClientGlobalErrorHandler; exports.setGlobalErrorHandler = _chunk7EQ46GULjs.setGlobalErrorHandler; exports.showCustomToast = _chunk7EQ46GULjs.showCustomToast; exports.showError = _chunk7EQ46GULjs.showError; exports.showToast = _chunk7EQ46GULjs.showToast; exports.translateData = _chunkJ5LROFGLjs.translateData; exports.translateResponse = _chunkJ5LROFGLjs.translateResponse; exports.tryBootstrap = _chunkJ5LROFGLjs.tryBootstrap; exports.useComposedRefs = _chunk7EQ46GULjs.useComposedRefs; exports.useIsMobile = _chunk7EQ46GULjs.useIsMobile; exports.userObjectSchema = _chunk7EQ46GULjs.userObjectSchema;
|
|
427
427
|
//# sourceMappingURL=index.js.map
|
package/dist/index.mjs
CHANGED
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
getWaitlistConfig,
|
|
19
19
|
isReferralEnabled,
|
|
20
20
|
isRolesConfigured
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-DJSH6VHF.mjs";
|
|
22
22
|
import {
|
|
23
23
|
AVAILABLE_OAUTH_SCOPES,
|
|
24
24
|
AbstractApiData,
|
|
@@ -199,7 +199,7 @@ import {
|
|
|
199
199
|
useComposedRefs,
|
|
200
200
|
useIsMobile,
|
|
201
201
|
userObjectSchema
|
|
202
|
-
} from "./chunk-
|
|
202
|
+
} from "./chunk-FBTTIGLL.mjs";
|
|
203
203
|
import "./chunk-AUXK7QSA.mjs";
|
|
204
204
|
import "./chunk-C7C7VY4F.mjs";
|
|
205
205
|
import {
|
package/dist/server/index.js
CHANGED
|
@@ -15,7 +15,7 @@ var _chunkIOLU4ASDjs = require('../chunk-IOLU4ASD.js');
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunk7EQ46GULjs = require('../chunk-7EQ46GUL.js');
|
|
19
19
|
require('../chunk-LXKSUWAV.js');
|
|
20
20
|
require('../chunk-IBS6NI7D.js');
|
|
21
21
|
|
|
@@ -86,7 +86,7 @@ var ServerSession = class {
|
|
|
86
86
|
if (!rawModules) return false;
|
|
87
87
|
const modules = JSON.parse(_pako2.default.ungzip(Buffer.from(rawModules, "base64"), { to: "string" }));
|
|
88
88
|
const selectedModule = modules.find((module) => module.id === params.module.moduleId);
|
|
89
|
-
return
|
|
89
|
+
return _chunk7EQ46GULjs.checkPermissionsFromServer.call(void 0, {
|
|
90
90
|
module: params.module,
|
|
91
91
|
action: params.action,
|
|
92
92
|
data: params.data,
|
|
@@ -296,5 +296,5 @@ _chunk7QVYU63Ejs.__name.call(void 0, ServerJsonApiDelete, "ServerJsonApiDelete")
|
|
|
296
296
|
|
|
297
297
|
|
|
298
298
|
|
|
299
|
-
exports.ServerAuthService =
|
|
299
|
+
exports.ServerAuthService = _chunk7EQ46GULjs.AuthService; exports.ServerCompanyService = _chunk7EQ46GULjs.CompanyService; exports.ServerContentService = _chunk7EQ46GULjs.ContentService; exports.ServerFeatureService = _chunk7EQ46GULjs.FeatureService; exports.ServerJsonApiDelete = ServerJsonApiDelete; exports.ServerJsonApiGet = ServerJsonApiGet; exports.ServerJsonApiPatch = ServerJsonApiPatch; exports.ServerJsonApiPost = ServerJsonApiPost; exports.ServerJsonApiPut = ServerJsonApiPut; exports.ServerNotificationService = _chunk7EQ46GULjs.NotificationService; exports.ServerPushService = _chunk7EQ46GULjs.PushService; exports.ServerRoleService = _chunk7EQ46GULjs.RoleService; exports.ServerS3Service = _chunk7EQ46GULjs.S3Service; exports.ServerSession = ServerSession; exports.ServerUserService = _chunk7EQ46GULjs.UserService; exports.configureServerJsonApi = configureServerJsonApi; exports.getServerApiUrl = getServerApiUrl; exports.getServerAppUrl = getServerAppUrl; exports.getServerToken = _chunkYUO55Q5Ajs.getServerToken; exports.getServerTrackablePages = getServerTrackablePages; exports.invalidateCacheTag = invalidateCacheTag; exports.invalidateCacheTags = invalidateCacheTags; exports.serverRequest = _chunkIOLU4ASDjs.serverRequest;
|
|
300
300
|
//# sourceMappingURL=index.js.map
|
package/dist/server/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { RoundPageContainer } from "../../../../components/containers/RoundPageContainer";
|
|
4
4
|
import { Modules } from "../../../../core";
|
|
5
|
+
import type { ApprovalActionRenderer } from "../../../assistant-message/components/MessageItem";
|
|
5
6
|
import { useAssistantContext } from "../../contexts/AssistantContext";
|
|
6
7
|
import { AssistantSidebar } from "../parts/AssistantSidebar";
|
|
7
8
|
import { AssistantEmptyState } from "../parts/AssistantEmptyState";
|
|
@@ -9,7 +10,17 @@ import { AssistantThreadHeader } from "../parts/AssistantThreadHeader";
|
|
|
9
10
|
import { AssistantThread } from "../parts/AssistantThread";
|
|
10
11
|
import { AssistantComposer } from "../parts/AssistantComposer";
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
interface Props {
|
|
14
|
+
/**
|
|
15
|
+
* Optional renderer for `approval-request` messages (operator engine). The
|
|
16
|
+
* approval card component lives in the consuming app, which registers the
|
|
17
|
+
* AssistantAction module; without this prop those messages fall back to the
|
|
18
|
+
* plain markdown bubble.
|
|
19
|
+
*/
|
|
20
|
+
renderApprovalAction?: ApprovalActionRenderer;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function AssistantContainer({ renderApprovalAction }: Props = {}) {
|
|
13
24
|
const ctx = useAssistantContext();
|
|
14
25
|
const showThread = !!ctx.assistant || ctx.sending || ctx.messages.length > 0;
|
|
15
26
|
|
|
@@ -24,7 +35,11 @@ export function AssistantContainer() {
|
|
|
24
35
|
/>
|
|
25
36
|
<main className="flex flex-1 flex-col">
|
|
26
37
|
{!showThread ? (
|
|
27
|
-
<AssistantEmptyState
|
|
38
|
+
<AssistantEmptyState
|
|
39
|
+
onSend={ctx.sendMessage}
|
|
40
|
+
operatorMode={ctx.operatorMode}
|
|
41
|
+
onOperatorModeChange={ctx.setOperatorMode}
|
|
42
|
+
/>
|
|
28
43
|
) : (
|
|
29
44
|
<>
|
|
30
45
|
{ctx.assistant ? (
|
|
@@ -45,6 +60,7 @@ export function AssistantContainer() {
|
|
|
45
60
|
onSelectFollowUp={ctx.sendMessage}
|
|
46
61
|
failedMessageIds={ctx.failedMessageIds}
|
|
47
62
|
onRetry={ctx.retrySend}
|
|
63
|
+
renderApprovalAction={renderApprovalAction}
|
|
48
64
|
/>
|
|
49
65
|
<AssistantComposer onSend={ctx.sendMessage} disabled={ctx.sending} />
|
|
50
66
|
</>
|
|
@@ -3,15 +3,23 @@
|
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import { useTranslations } from "next-intl";
|
|
5
5
|
import { Sparkles } from "lucide-react";
|
|
6
|
+
import { Label, Switch } from "../../../../shadcnui";
|
|
6
7
|
import { AssistantComposer } from "./AssistantComposer";
|
|
7
8
|
|
|
8
9
|
interface Props {
|
|
9
10
|
onSend: (content: string) => Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Operator engine toggle (durable, approval-gated runs). Rendered only when
|
|
13
|
+
* `onOperatorModeChange` is provided; the default (responder) flow stays
|
|
14
|
+
* unchanged otherwise.
|
|
15
|
+
*/
|
|
16
|
+
operatorMode?: boolean;
|
|
17
|
+
onOperatorModeChange?: (value: boolean) => void;
|
|
10
18
|
}
|
|
11
19
|
|
|
12
20
|
const STARTER_KEYS = ["a", "b", "c", "d"] as const;
|
|
13
21
|
|
|
14
|
-
export function AssistantEmptyState({ onSend }: Props) {
|
|
22
|
+
export function AssistantEmptyState({ onSend, operatorMode = false, onOperatorModeChange }: Props) {
|
|
15
23
|
const t = useTranslations();
|
|
16
24
|
const [draft, setDraft] = useState("");
|
|
17
25
|
|
|
@@ -26,6 +34,19 @@ export function AssistantEmptyState({ onSend }: Props) {
|
|
|
26
34
|
<p className="text-muted-foreground mt-1 text-sm">{t("features.assistant.empty_state.subtitle")}</p>
|
|
27
35
|
</div>
|
|
28
36
|
<AssistantComposer value={draft} onValueChange={setDraft} onSend={onSend} />
|
|
37
|
+
{onOperatorModeChange && (
|
|
38
|
+
<div className="flex items-center justify-end gap-2">
|
|
39
|
+
<Switch
|
|
40
|
+
id="assistant-operator-mode"
|
|
41
|
+
size="sm"
|
|
42
|
+
checked={operatorMode}
|
|
43
|
+
onCheckedChange={(checked) => onOperatorModeChange(checked === true)}
|
|
44
|
+
/>
|
|
45
|
+
<Label htmlFor="assistant-operator-mode" className="text-muted-foreground text-xs">
|
|
46
|
+
{t("features.assistant.operator_mode")}
|
|
47
|
+
</Label>
|
|
48
|
+
</div>
|
|
49
|
+
)}
|
|
29
50
|
<div className="grid grid-cols-2 gap-2">
|
|
30
51
|
{STARTER_KEYS.map((k) => {
|
|
31
52
|
const text = t(`features.assistant.starters.${k}`);
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { useEffect, useRef } from "react";
|
|
4
4
|
import type { AssistantMessageInterface } from "../../../assistant-message/data/AssistantMessageInterface";
|
|
5
5
|
import { MessageList } from "../../../assistant-message/components/MessageList";
|
|
6
|
+
import type { ApprovalActionRenderer } from "../../../assistant-message/components/MessageItem";
|
|
6
7
|
import { AssistantStatusLine } from "./AssistantStatusLine";
|
|
7
8
|
|
|
8
9
|
interface Props {
|
|
@@ -12,9 +13,18 @@ interface Props {
|
|
|
12
13
|
onSelectFollowUp: (q: string) => void;
|
|
13
14
|
failedMessageIds?: Set<string>;
|
|
14
15
|
onRetry?: (tempId: string) => void;
|
|
16
|
+
renderApprovalAction?: ApprovalActionRenderer;
|
|
15
17
|
}
|
|
16
18
|
|
|
17
|
-
export function AssistantThread({
|
|
19
|
+
export function AssistantThread({
|
|
20
|
+
messages,
|
|
21
|
+
sending,
|
|
22
|
+
status,
|
|
23
|
+
onSelectFollowUp,
|
|
24
|
+
failedMessageIds,
|
|
25
|
+
onRetry,
|
|
26
|
+
renderApprovalAction,
|
|
27
|
+
}: Props) {
|
|
18
28
|
const endRef = useRef<HTMLDivElement>(null);
|
|
19
29
|
|
|
20
30
|
useEffect(() => {
|
|
@@ -28,6 +38,7 @@ export function AssistantThread({ messages, sending, status, onSelectFollowUp, f
|
|
|
28
38
|
onSelectFollowUp={onSelectFollowUp}
|
|
29
39
|
failedMessageIds={failedMessageIds}
|
|
30
40
|
onRetry={onRetry}
|
|
41
|
+
renderApprovalAction={renderApprovalAction}
|
|
31
42
|
/>
|
|
32
43
|
{sending && <AssistantStatusLine status={status} />}
|
|
33
44
|
<div ref={endRef} />
|
|
@@ -26,6 +26,11 @@ interface AssistantContextValue {
|
|
|
26
26
|
startNew(): void;
|
|
27
27
|
renameThread(id: string, title: string): Promise<void>;
|
|
28
28
|
deleteThread(id: string): Promise<void>;
|
|
29
|
+
/** When true, create/append route to the operator-engine endpoints. */
|
|
30
|
+
operatorMode: boolean;
|
|
31
|
+
setOperatorMode(value: boolean): void;
|
|
32
|
+
/** Appends a message returned outside the send flow (e.g. an approve/deny resume). */
|
|
33
|
+
appendResolvedMessage(message: AssistantMessageInterface): void;
|
|
29
34
|
}
|
|
30
35
|
|
|
31
36
|
const AssistantContext = createContext<AssistantContextValue | undefined>(undefined);
|
|
@@ -77,6 +82,12 @@ export function AssistantProvider({ children, dehydratedAssistant, dehydratedMes
|
|
|
77
82
|
const [sending, setSending] = useState<boolean>(false);
|
|
78
83
|
const [status, setStatus] = useState<string | undefined>(undefined);
|
|
79
84
|
const [failedMessageIds, setFailedMessageIds] = useState<Set<string>>(() => new Set());
|
|
85
|
+
// The engine is persisted on the Assistant resource: an existing operator
|
|
86
|
+
// thread must keep routing to the operator endpoints after a reload, so the
|
|
87
|
+
// initial mode is derived from the hydrated thread instead of defaulting off.
|
|
88
|
+
const [operatorMode, setOperatorMode] = useState<boolean>(
|
|
89
|
+
() => dehydratedAssistant?.jsonApi?.attributes?.engine === "operator",
|
|
90
|
+
);
|
|
80
91
|
const { socket } = useSocketContext();
|
|
81
92
|
|
|
82
93
|
const sendMessage = useCallback(
|
|
@@ -101,11 +112,14 @@ export function AssistantProvider({ children, dehydratedAssistant, dehydratedMes
|
|
|
101
112
|
|
|
102
113
|
try {
|
|
103
114
|
if (!assistant) {
|
|
104
|
-
const
|
|
115
|
+
const input = {
|
|
105
116
|
firstMessage: trimmed,
|
|
106
117
|
howToMode: opts?.howToMode,
|
|
107
118
|
limitToHowToId: opts?.limitToHowToId,
|
|
108
|
-
}
|
|
119
|
+
};
|
|
120
|
+
const created = operatorMode
|
|
121
|
+
? await AssistantService.createOperator(input)
|
|
122
|
+
: await AssistantService.create(input);
|
|
109
123
|
const msgs = await AssistantMessageService.findByAssistant({ assistantId: created.id });
|
|
110
124
|
setAssistant(created);
|
|
111
125
|
setMessages(msgs);
|
|
@@ -114,12 +128,17 @@ export function AssistantProvider({ children, dehydratedAssistant, dehydratedMes
|
|
|
114
128
|
window.history.replaceState(null, "", `/assistants/${created.id}`);
|
|
115
129
|
}
|
|
116
130
|
} else {
|
|
117
|
-
const result =
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
131
|
+
const result = operatorMode
|
|
132
|
+
? await AssistantService.appendMessageOperator({
|
|
133
|
+
assistantId: assistant.id,
|
|
134
|
+
content: trimmed,
|
|
135
|
+
})
|
|
136
|
+
: await AssistantService.appendMessage({
|
|
137
|
+
assistantId: assistant.id,
|
|
138
|
+
content: trimmed,
|
|
139
|
+
howToMode: opts?.howToMode,
|
|
140
|
+
limitToHowToId: opts?.limitToHowToId,
|
|
141
|
+
});
|
|
123
142
|
setMessages((prev) => [...stripOptimistic(prev), ...result]);
|
|
124
143
|
}
|
|
125
144
|
} catch {
|
|
@@ -134,9 +153,13 @@ export function AssistantProvider({ children, dehydratedAssistant, dehydratedMes
|
|
|
134
153
|
setStatus(undefined);
|
|
135
154
|
}
|
|
136
155
|
},
|
|
137
|
-
[assistant, messages, socket],
|
|
156
|
+
[assistant, messages, socket, operatorMode],
|
|
138
157
|
);
|
|
139
158
|
|
|
159
|
+
const appendResolvedMessage = useCallback((message: AssistantMessageInterface) => {
|
|
160
|
+
setMessages((prev) => (prev.some((m) => m.id === message.id) ? prev : [...prev, message]));
|
|
161
|
+
}, []);
|
|
162
|
+
|
|
140
163
|
const retrySend = useCallback(
|
|
141
164
|
async (tempId: string) => {
|
|
142
165
|
const failed = messages.find((m) => m.id === tempId);
|
|
@@ -163,6 +186,10 @@ export function AssistantProvider({ children, dehydratedAssistant, dehydratedMes
|
|
|
163
186
|
]);
|
|
164
187
|
setAssistant(target);
|
|
165
188
|
setMessages(msgs);
|
|
189
|
+
// Route follow-up sends by the thread's persisted engine: operator
|
|
190
|
+
// threads stay on the operator endpoints, everything else (engine
|
|
191
|
+
// absent) keeps the default responder flow.
|
|
192
|
+
setOperatorMode(target.engine === "operator");
|
|
166
193
|
if (manageUrl && typeof window !== "undefined") {
|
|
167
194
|
window.history.replaceState(null, "", `/assistants/${id}`);
|
|
168
195
|
}
|
|
@@ -180,6 +207,7 @@ export function AssistantProvider({ children, dehydratedAssistant, dehydratedMes
|
|
|
180
207
|
setAssistant(undefined);
|
|
181
208
|
setMessages([]);
|
|
182
209
|
setFailedMessageIds(new Set());
|
|
210
|
+
setOperatorMode(false);
|
|
183
211
|
if (manageUrl && typeof window !== "undefined") {
|
|
184
212
|
window.history.replaceState(null, "", "/assistants");
|
|
185
213
|
}
|
|
@@ -228,6 +256,9 @@ export function AssistantProvider({ children, dehydratedAssistant, dehydratedMes
|
|
|
228
256
|
startNew,
|
|
229
257
|
renameThread,
|
|
230
258
|
deleteThread,
|
|
259
|
+
operatorMode,
|
|
260
|
+
setOperatorMode,
|
|
261
|
+
appendResolvedMessage,
|
|
231
262
|
}),
|
|
232
263
|
[
|
|
233
264
|
assistant,
|
|
@@ -243,6 +274,8 @@ export function AssistantProvider({ children, dehydratedAssistant, dehydratedMes
|
|
|
243
274
|
startNew,
|
|
244
275
|
renameThread,
|
|
245
276
|
deleteThread,
|
|
277
|
+
operatorMode,
|
|
278
|
+
appendResolvedMessage,
|
|
246
279
|
],
|
|
247
280
|
);
|
|
248
281
|
|
|
@@ -18,22 +18,32 @@ function wrapper({ children }: { children: React.ReactNode }) {
|
|
|
18
18
|
return <AssistantProvider>{children}</AssistantProvider>;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
function buildAssistantStub({ id, title = "Stub" }: { id: string; title?: string }) {
|
|
22
|
-
return {
|
|
21
|
+
function buildAssistantStub({ id, title = "Stub", engine }: { id: string; title?: string; engine?: string }) {
|
|
22
|
+
return {
|
|
23
|
+
id,
|
|
24
|
+
title,
|
|
25
|
+
engine,
|
|
26
|
+
messageCount: 0,
|
|
27
|
+
type: "assistants",
|
|
28
|
+
createdAt: new Date(),
|
|
29
|
+
updatedAt: new Date(),
|
|
30
|
+
} as any;
|
|
23
31
|
}
|
|
24
32
|
|
|
25
33
|
function buildAssistantDehydrated({
|
|
26
34
|
id,
|
|
27
35
|
title = "Stub",
|
|
36
|
+
engine,
|
|
28
37
|
}: {
|
|
29
38
|
id: string;
|
|
30
39
|
title?: string;
|
|
40
|
+
engine?: string;
|
|
31
41
|
}): JsonApiHydratedDataInterface {
|
|
32
42
|
return {
|
|
33
43
|
jsonApi: {
|
|
34
44
|
type: "assistants",
|
|
35
45
|
id,
|
|
36
|
-
attributes: { title, messageCount: 0 },
|
|
46
|
+
attributes: { title, messageCount: 0, ...(engine !== undefined ? { engine } : {}) },
|
|
37
47
|
},
|
|
38
48
|
included: [],
|
|
39
49
|
};
|
|
@@ -123,6 +133,87 @@ describe("AssistantContext", () => {
|
|
|
123
133
|
expect(replaceState).toHaveBeenCalledWith(null, "", "/assistants/a-3");
|
|
124
134
|
});
|
|
125
135
|
|
|
136
|
+
it("selectThread on an operator thread enables operatorMode and routes follow-ups to the operator endpoint", async () => {
|
|
137
|
+
const target = buildAssistantStub({ id: "a-op", title: "Operator", engine: "operator" });
|
|
138
|
+
AssistantService.findOne = vi.fn().mockResolvedValue(target);
|
|
139
|
+
AssistantMessageService.findByAssistant = vi.fn().mockResolvedValue([]);
|
|
140
|
+
AssistantService.appendMessage = vi.fn().mockResolvedValue([]);
|
|
141
|
+
AssistantService.appendMessageOperator = vi.fn().mockResolvedValue([]);
|
|
142
|
+
vi.spyOn(window.history, "replaceState").mockImplementation(() => {});
|
|
143
|
+
|
|
144
|
+
const { result } = renderHook(() => useAssistantContext(), {
|
|
145
|
+
wrapper: ({ children }) => <AssistantProvider>{children}</AssistantProvider>,
|
|
146
|
+
});
|
|
147
|
+
await act(async () => {
|
|
148
|
+
await result.current.selectThread("a-op");
|
|
149
|
+
});
|
|
150
|
+
expect(result.current.operatorMode).toBe(true);
|
|
151
|
+
|
|
152
|
+
await act(async () => {
|
|
153
|
+
await result.current.sendMessage("continue");
|
|
154
|
+
});
|
|
155
|
+
expect(AssistantService.appendMessageOperator).toHaveBeenCalledWith({ assistantId: "a-op", content: "continue" });
|
|
156
|
+
expect(AssistantService.appendMessage).not.toHaveBeenCalled();
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
it("selectThread on a responder thread (engine absent) resets operatorMode and keeps the responder endpoint", async () => {
|
|
160
|
+
const operatorThread = buildAssistantStub({ id: "a-op", engine: "operator" });
|
|
161
|
+
const responderThread = buildAssistantStub({ id: "a-resp" });
|
|
162
|
+
AssistantService.findOne = vi.fn().mockResolvedValueOnce(operatorThread).mockResolvedValueOnce(responderThread);
|
|
163
|
+
AssistantMessageService.findByAssistant = vi.fn().mockResolvedValue([]);
|
|
164
|
+
AssistantService.appendMessage = vi.fn().mockResolvedValue([]);
|
|
165
|
+
AssistantService.appendMessageOperator = vi.fn().mockResolvedValue([]);
|
|
166
|
+
vi.spyOn(window.history, "replaceState").mockImplementation(() => {});
|
|
167
|
+
|
|
168
|
+
const { result } = renderHook(() => useAssistantContext(), {
|
|
169
|
+
wrapper: ({ children }) => <AssistantProvider>{children}</AssistantProvider>,
|
|
170
|
+
});
|
|
171
|
+
await act(async () => {
|
|
172
|
+
await result.current.selectThread("a-op");
|
|
173
|
+
});
|
|
174
|
+
expect(result.current.operatorMode).toBe(true);
|
|
175
|
+
await act(async () => {
|
|
176
|
+
await result.current.selectThread("a-resp");
|
|
177
|
+
});
|
|
178
|
+
expect(result.current.operatorMode).toBe(false);
|
|
179
|
+
|
|
180
|
+
await act(async () => {
|
|
181
|
+
await result.current.sendMessage("hello");
|
|
182
|
+
});
|
|
183
|
+
expect(AssistantService.appendMessage).toHaveBeenCalledWith(
|
|
184
|
+
expect.objectContaining({ assistantId: "a-resp", content: "hello" }),
|
|
185
|
+
);
|
|
186
|
+
expect(AssistantService.appendMessageOperator).not.toHaveBeenCalled();
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
it("hydrating an operator thread (reload) initialises operatorMode and routes sends to the operator endpoint", async () => {
|
|
190
|
+
const existing = buildAssistantDehydrated({ id: "a-op", title: "Operator", engine: "operator" });
|
|
191
|
+
AssistantService.appendMessage = vi.fn().mockResolvedValue([]);
|
|
192
|
+
AssistantService.appendMessageOperator = vi.fn().mockResolvedValue([]);
|
|
193
|
+
|
|
194
|
+
const { result } = renderHook(() => useAssistantContext(), {
|
|
195
|
+
wrapper: ({ children }) => <AssistantProvider dehydratedAssistant={existing}>{children}</AssistantProvider>,
|
|
196
|
+
});
|
|
197
|
+
expect(result.current.operatorMode).toBe(true);
|
|
198
|
+
|
|
199
|
+
await act(async () => {
|
|
200
|
+
await result.current.sendMessage("after reload");
|
|
201
|
+
});
|
|
202
|
+
expect(AssistantService.appendMessageOperator).toHaveBeenCalledWith({
|
|
203
|
+
assistantId: "a-op",
|
|
204
|
+
content: "after reload",
|
|
205
|
+
});
|
|
206
|
+
expect(AssistantService.appendMessage).not.toHaveBeenCalled();
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
it("hydrating a responder thread (engine absent) keeps operatorMode off", () => {
|
|
210
|
+
const existing = buildAssistantDehydrated({ id: "a-resp", title: "Responder" });
|
|
211
|
+
const { result } = renderHook(() => useAssistantContext(), {
|
|
212
|
+
wrapper: ({ children }) => <AssistantProvider dehydratedAssistant={existing}>{children}</AssistantProvider>,
|
|
213
|
+
});
|
|
214
|
+
expect(result.current.operatorMode).toBe(false);
|
|
215
|
+
});
|
|
216
|
+
|
|
126
217
|
it("renameThread calls the service + updates active assistant title", async () => {
|
|
127
218
|
AssistantService.rename = vi.fn().mockResolvedValue(undefined);
|
|
128
219
|
const active = buildAssistantDehydrated({ id: "a-1", title: "Old" });
|
|
@@ -4,6 +4,7 @@ import { AssistantInput, AssistantInterface } from "./AssistantInterface";
|
|
|
4
4
|
export class Assistant extends AbstractApiData implements AssistantInterface {
|
|
5
5
|
private _title?: string;
|
|
6
6
|
private _messageCount?: number;
|
|
7
|
+
private _engine?: string;
|
|
7
8
|
|
|
8
9
|
get title(): string {
|
|
9
10
|
return this._title ?? "";
|
|
@@ -13,9 +14,14 @@ export class Assistant extends AbstractApiData implements AssistantInterface {
|
|
|
13
14
|
return this._messageCount ?? 0;
|
|
14
15
|
}
|
|
15
16
|
|
|
17
|
+
get engine(): string | undefined {
|
|
18
|
+
return this._engine;
|
|
19
|
+
}
|
|
20
|
+
|
|
16
21
|
rehydrate(data: JsonApiHydratedDataInterface): this {
|
|
17
22
|
super.rehydrate(data);
|
|
18
23
|
this._title = data.jsonApi.attributes?.title;
|
|
24
|
+
this._engine = data.jsonApi.attributes?.engine;
|
|
19
25
|
const fromMeta = data.jsonApi.meta?.messageCount;
|
|
20
26
|
const fromAttrs = data.jsonApi.attributes?.messageCount;
|
|
21
27
|
this._messageCount = typeof fromMeta === "number" ? fromMeta : typeof fromAttrs === "number" ? fromAttrs : 0;
|
|
@@ -10,4 +10,6 @@ export type AssistantInput = {
|
|
|
10
10
|
export interface AssistantInterface extends ApiDataInterface {
|
|
11
11
|
get title(): string;
|
|
12
12
|
get messageCount(): number;
|
|
13
|
+
/** Agent engine the thread runs on — `"operator"` or undefined (responder). */
|
|
14
|
+
get engine(): string | undefined;
|
|
13
15
|
}
|
|
@@ -31,6 +31,20 @@ export class AssistantService extends AbstractService {
|
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Creates an assistant whose first turn runs on the operator engine
|
|
36
|
+
* (durable checkpointing + approval gates). Mirrors `create()` against the
|
|
37
|
+
* standalone operator module's create route (`POST operator`).
|
|
38
|
+
*/
|
|
39
|
+
static async createOperator(params: AssistantInput): Promise<AssistantInterface> {
|
|
40
|
+
return this.callApi({
|
|
41
|
+
type: Modules.Assistant,
|
|
42
|
+
method: HttpMethod.POST,
|
|
43
|
+
endpoint: new EndpointCreator({ endpoint: "operator" }).generate(),
|
|
44
|
+
input: params,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
34
48
|
/**
|
|
35
49
|
* Sends a new user message to an existing assistant thread. The agent turn
|
|
36
50
|
* runs synchronously; the response is a two-element list: [user, assistant].
|
|
@@ -63,6 +77,30 @@ export class AssistantService extends AbstractService {
|
|
|
63
77
|
});
|
|
64
78
|
}
|
|
65
79
|
|
|
80
|
+
/**
|
|
81
|
+
* Operator-engine variant of `appendMessage()`. Targets
|
|
82
|
+
* `POST operator/:assistantId/assistant-messages`; the turn may freeze on a
|
|
83
|
+
* destructive tool call, in which case the returned list ends with an
|
|
84
|
+
* `approval-request` assistant message linked to a pending AssistantAction.
|
|
85
|
+
*/
|
|
86
|
+
static async appendMessageOperator(params: {
|
|
87
|
+
assistantId: string;
|
|
88
|
+
content: string;
|
|
89
|
+
}): Promise<AssistantMessageInterface[]> {
|
|
90
|
+
const message = new AssistantMessage();
|
|
91
|
+
return this.callApi<AssistantMessageInterface[]>({
|
|
92
|
+
type: Modules.AssistantMessage,
|
|
93
|
+
method: HttpMethod.POST,
|
|
94
|
+
endpoint: new EndpointCreator({
|
|
95
|
+
endpoint: "operator",
|
|
96
|
+
id: params.assistantId,
|
|
97
|
+
childEndpoint: Modules.AssistantMessage,
|
|
98
|
+
}).generate(),
|
|
99
|
+
input: message.createAppendMessageJsonApi({ content: params.content }),
|
|
100
|
+
overridesJsonApiCreation: true,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
66
104
|
static async rename(params: { id: string; title: string }): Promise<void> {
|
|
67
105
|
await this.callApi({
|
|
68
106
|
type: Modules.Assistant,
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { Assistant } from "../Assistant";
|
|
3
|
+
|
|
4
|
+
describe("Assistant model", () => {
|
|
5
|
+
it("rehydrates engine from attributes (operator thread)", () => {
|
|
6
|
+
const assistant = new Assistant().rehydrate({
|
|
7
|
+
jsonApi: { type: "assistants", id: "a-1", attributes: { title: "T", engine: "operator" } },
|
|
8
|
+
included: [],
|
|
9
|
+
});
|
|
10
|
+
expect(assistant.engine).toBe("operator");
|
|
11
|
+
expect(assistant.title).toBe("T");
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it("leaves engine undefined when the attribute is absent (responder thread)", () => {
|
|
15
|
+
const assistant = new Assistant().rehydrate({
|
|
16
|
+
jsonApi: { type: "assistants", id: "a-2", attributes: { title: "T" } },
|
|
17
|
+
included: [],
|
|
18
|
+
});
|
|
19
|
+
expect(assistant.engine).toBeUndefined();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it("preserves engine through dehydrate/rehydrate round-trips", () => {
|
|
23
|
+
const original = new Assistant().rehydrate({
|
|
24
|
+
jsonApi: { type: "assistants", id: "a-3", attributes: { title: "T", engine: "operator" } },
|
|
25
|
+
included: [],
|
|
26
|
+
});
|
|
27
|
+
const roundTripped = new Assistant().rehydrate(original.dehydrate());
|
|
28
|
+
expect(roundTripped.engine).toBe("operator");
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -21,8 +21,10 @@ export const AssistantMessageModule = (factory: ModuleFactory) =>
|
|
|
21
21
|
`suggestedQuestions`,
|
|
22
22
|
`inputTokens`,
|
|
23
23
|
`outputTokens`,
|
|
24
|
+
`messageType`,
|
|
24
25
|
`references`,
|
|
25
26
|
`citations`,
|
|
27
|
+
`action`,
|
|
26
28
|
]),
|
|
27
29
|
createJsonApiInclusion("chunks", [`content`, `nodeId`, `nodeType`, `imagePath`, `source`]),
|
|
28
30
|
createJsonApiInclusion("users", [`name`, `avatar`]),
|