Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a32575c
refactor(apps): point AppsEngine facade and IAppServerOrchestrator to…
d-gubert Apr 16, 2026
6e9c471
refactor(meteor): migrate apps-engine/server/ imports to @rocket.chat…
d-gubert Apr 16, 2026
8f3e4f5
refactor(meteor): migrate apps-engine/client/ imports to @rocket.chat…
d-gubert Apr 16, 2026
00c8b0b
refactor(core-services): migrate apps-engine/server/ imports to @rock…
d-gubert Apr 16, 2026
1e8c2ce
refactor(apps-engine): promote cross-boundary types to definition layer
d-gubert Apr 16, 2026
fbcaeaf
refactor(apps): source room options and OAuth2Client from apps-engine…
d-gubert Apr 16, 2026
3a521fb
fix outdated import
d-gubert Apr 27, 2026
c84f992
fix(apps): export GetMessagesSortableFields as value, not type
Copilot Apr 28, 2026
9e03355
fix lint
d-gubert Apr 28, 2026
102bc2f
auto fix lint
d-gubert Apr 28, 2026
f7d2992
fix apps package.json
d-gubert Apr 28, 2026
6accfcb
fix messages converter
d-gubert Apr 28, 2026
3a733bf
fix apps package.json
d-gubert Apr 28, 2026
27ad74f
stop importing from deep index files
d-gubert Apr 28, 2026
6ba5857
fix type error in listeners bridge
d-gubert Apr 28, 2026
ad33f71
update yarn.lock
d-gubert Apr 28, 2026
77f8a12
fix: meteor bundled doesn't support "exports" mapping in package.json
d-gubert Apr 29, 2026
7c0c738
deno: add @types/node for lsp integration
d-gubert Apr 29, 2026
db5af43
refactor: adapt imports to use dist
d-gubert Apr 29, 2026
526575d
fix: deno-runtime import problems
d-gubert Apr 29, 2026
a7d44ea
enables test on apps
d-gubert Apr 29, 2026
e5c7324
refactor(apps): package json
d-gubert Apr 29, 2026
316730e
chore(ci): remove esbuild from apps packages' node_modules along with…
d-gubert Apr 29, 2026
e05c9cd
fix: remove apps-engine copying from Dockerfiles
d-gubert Apr 29, 2026
a7dcbfc
docs: apps-engine-migration.md
d-gubert May 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/actions/build-docker/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ runs:
find /tmp/build/bundle/programs/server/npm/node_modules/@esbuild -type d -name 'linux-*' -not -name "*-${swc_arch}" -exec rm -rf {} +

find /tmp/build/bundle/programs/server/npm/node_modules/@rocket.chat/apps-engine/node_modules/@esbuild -type d -name 'linux-*' -not -name "*-${swc_arch}" -exec rm -rf {} +

find /tmp/build/bundle/programs/server/npm/node_modules/@rocket.chat/apps/node_modules/@esbuild -type d -name 'linux-*' -not -name "*-${swc_arch}" -exec rm -rf {} +
fi

if [[ "$INPUT_PUBLISH_IMAGE" == 'true' ]]; then
Expand Down
5 changes: 2 additions & 3 deletions apps/meteor/app/apps/server/bridges/activation.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import type { IAppServerOrchestrator, AppStatus } from '@rocket.chat/apps';
import type { ProxiedApp } from '@rocket.chat/apps-engine/server/ProxiedApp';
import { AppActivationBridge as ActivationBridge } from '@rocket.chat/apps-engine/server/bridges/AppActivationBridge';
import type { ProxiedApp } from '@rocket.chat/apps/dist/server/ProxiedApp';
import { AppActivationBridge as ActivationBridge } from '@rocket.chat/apps/dist/server/bridges/AppActivationBridge';
import { UserStatus } from '@rocket.chat/core-typings';
import { Users } from '@rocket.chat/models';

export class AppActivationBridge extends ActivationBridge {
// eslint-disable-next-line no-empty-function
constructor(private readonly orch: IAppServerOrchestrator) {
super();
}
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/app/apps/server/bridges/api.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { IAppServerOrchestrator } from '@rocket.chat/apps';
import { ApiBridge } from '@rocket.chat/apps/dist/server/bridges/ApiBridge';
import type { AppApi } from '@rocket.chat/apps/dist/server/managers/AppApi';
import type { RequestMethod } from '@rocket.chat/apps-engine/definition/accessors';
import type { IApiRequest, IApiEndpoint, IApi } from '@rocket.chat/apps-engine/definition/api';
import { ApiBridge } from '@rocket.chat/apps-engine/server/bridges/ApiBridge';
import type { AppApi } from '@rocket.chat/apps-engine/server/managers/AppApi';
import type { Response, Request, IRouter, RequestHandler } from 'express';
import express from 'express';
import { Meteor } from 'meteor/meteor';
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/apps/server/bridges/bridges.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AppBridges } from '@rocket.chat/apps-engine/server/bridges';
import { AppBridges } from '@rocket.chat/apps/dist/server/bridges/AppBridges';

import { AppActivationBridge } from './activation';
import { AppApisBridge } from './api';
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/apps/server/bridges/cloud.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { IAppServerOrchestrator } from '@rocket.chat/apps';
import { CloudWorkspaceBridge } from '@rocket.chat/apps/dist/server/bridges/CloudWorkspaceBridge';
import type { IWorkspaceToken } from '@rocket.chat/apps-engine/definition/cloud/IWorkspaceToken';
import { CloudWorkspaceBridge } from '@rocket.chat/apps-engine/server/bridges/CloudWorkspaceBridge';

import { getWorkspaceAccessTokenWithScope } from '../../../cloud/server';

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/apps/server/bridges/commands.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IAppServerOrchestrator, IAppsRoom, IAppsUser } from '@rocket.chat/apps';
import { CommandBridge } from '@rocket.chat/apps/dist/server/bridges/CommandBridge';
import type { ISlashCommand, ISlashCommandPreview, ISlashCommandPreviewItem } from '@rocket.chat/apps-engine/definition/slashcommands';
import { SlashCommandContext } from '@rocket.chat/apps-engine/definition/slashcommands';
import { CommandBridge } from '@rocket.chat/apps-engine/server/bridges/CommandBridge';
import type { IMessage, RequiredField, SlashCommand, SlashCommandCallbackParams } from '@rocket.chat/core-typings';

import { Utilities } from '../../../../ee/lib/misc/Utilities';
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/apps/server/bridges/contact.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { IAppServerOrchestrator } from '@rocket.chat/apps';
import { ContactBridge } from '@rocket.chat/apps/dist/server/bridges/ContactBridge';
import type { ILivechatContact } from '@rocket.chat/apps-engine/definition/livechat';
import { ContactBridge } from '@rocket.chat/apps-engine/server/bridges';

import { addContactEmail } from '../../../livechat/server/lib/contacts/addContactEmail';
import { verifyContactChannel } from '../../../livechat/server/lib/contacts/verifyContactChannel';
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/apps/server/bridges/details.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { IAppServerOrchestrator } from '@rocket.chat/apps';
import { AppDetailChangesBridge as DetailChangesBridge } from '@rocket.chat/apps/dist/server/bridges/AppDetailChangesBridge';
import type { ISetting } from '@rocket.chat/apps-engine/definition/settings';
import { AppDetailChangesBridge as DetailChangesBridge } from '@rocket.chat/apps-engine/server/bridges/AppDetailChangesBridge';

export class AppDetailChangesBridge extends DetailChangesBridge {
constructor(private readonly orch: IAppServerOrchestrator) {
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/apps/server/bridges/email.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { IAppServerOrchestrator } from '@rocket.chat/apps';
import { EmailBridge } from '@rocket.chat/apps/dist/server/bridges/EmailBridge';
import type { IEmail } from '@rocket.chat/apps-engine/definition/email';
import { EmailBridge } from '@rocket.chat/apps-engine/server/bridges';

import * as Mailer from '../../../mailer/server/api';
import { settings } from '../../../settings/server';
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/apps/server/bridges/environmental.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { IAppServerOrchestrator } from '@rocket.chat/apps';
import { EnvironmentalVariableBridge } from '@rocket.chat/apps-engine/server/bridges/EnvironmentalVariableBridge';
import { EnvironmentalVariableBridge } from '@rocket.chat/apps/dist/server/bridges/EnvironmentalVariableBridge';

export class AppEnvironmentalVariableBridge extends EnvironmentalVariableBridge {
allowed: Array<string>;
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/apps/server/bridges/experimental.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { IAppServerOrchestrator } from '@rocket.chat/apps';
import { ExperimentalBridge } from '@rocket.chat/apps-engine/server/bridges';
import { ExperimentalBridge } from '@rocket.chat/apps/dist/server/bridges/ExperimentalBridge';

export class AppExperimentalBridge extends ExperimentalBridge {
constructor(protected readonly orch: IAppServerOrchestrator) {
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/app/apps/server/bridges/http.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IAppServerOrchestrator } from '@rocket.chat/apps';
import type { IHttpBridgeRequestInfo } from '@rocket.chat/apps/dist/server/bridges/HttpBridge';
import { HttpBridge } from '@rocket.chat/apps/dist/server/bridges/HttpBridge';
import type { IHttpResponse } from '@rocket.chat/apps-engine/definition/accessors';
import type { IHttpBridgeRequestInfo } from '@rocket.chat/apps-engine/server/bridges';
import { HttpBridge } from '@rocket.chat/apps-engine/server/bridges/HttpBridge';
import { serverFetch as fetch, type ExtendedFetchOptions } from '@rocket.chat/server-fetch';
import { censorUrl } from '@rocket.chat/tools';

Expand Down
4 changes: 1 addition & 3 deletions apps/meteor/app/apps/server/bridges/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
import { RealAppBridges } from './bridges';

export { RealAppBridges };
export * from './bridges';
2 changes: 1 addition & 1 deletion apps/meteor/app/apps/server/bridges/internal.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { IAppServerOrchestrator, IAppsSetting } from '@rocket.chat/apps';
import { InternalBridge } from '@rocket.chat/apps-engine/server/bridges/InternalBridge';
import { InternalBridge } from '@rocket.chat/apps/dist/server/bridges/InternalBridge';
import type { ISetting, ISubscription } from '@rocket.chat/core-typings';
import { Settings, Subscriptions } from '@rocket.chat/models';
import { isTruthy } from '@rocket.chat/tools';
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/apps/server/bridges/internalFederation.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { IInternalFederationBridge } from '@rocket.chat/apps-engine/server/bridges/IInternalFederationBridge';
import type { IInternalFederationBridge } from '@rocket.chat/apps/dist/server/bridges/IInternalFederationBridge';
import { FederationKeys } from '@rocket.chat/models';

export class AppInternalFederationBridge implements IInternalFederationBridge {
Expand Down
27 changes: 10 additions & 17 deletions apps/meteor/app/apps/server/bridges/livechat.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { IAppServerOrchestrator, IAppsLivechatMessage, IAppsMessage } from '@rocket.chat/apps';
import type { IAppServerOrchestrator, IAppsLivechatMessage } from '@rocket.chat/apps';
import { LivechatBridge } from '@rocket.chat/apps/dist/server/bridges/LivechatBridge';
import type { IExtraRoomParams } from '@rocket.chat/apps-engine/definition/accessors/ILivechatCreator';
import type {
IVisitorExternalIdentifier,
Expand All @@ -10,8 +11,7 @@ import type {
} from '@rocket.chat/apps-engine/definition/livechat';
import type { IMessage as IAppsEngineMessage } from '@rocket.chat/apps-engine/definition/messages';
import type { IUser } from '@rocket.chat/apps-engine/definition/users';
import { LivechatBridge } from '@rocket.chat/apps-engine/server/bridges/LivechatBridge';
import type { ILivechatDepartment, IOmnichannelRoom, SelectedAgent, IMessage, ILivechatVisitor } from '@rocket.chat/core-typings';
import type { ILivechatDepartment, IOmnichannelRoom, SelectedAgent, ILivechatVisitor } from '@rocket.chat/core-typings';
import { OmnichannelSourceType } from '@rocket.chat/core-typings';
import { LivechatVisitors, LivechatRooms, LivechatDepartment, Users } from '@rocket.chat/models';
import { registerGuest } from '@rocket.chat/omni-core';
Expand All @@ -29,12 +29,6 @@ import { online } from '../../../livechat/server/lib/service-status';
import { transfer } from '../../../livechat/server/lib/transfer';
import { settings } from '../../../settings/server';

declare module '@rocket.chat/apps/dist/converters/IAppMessagesConverter' {
export interface IAppMessagesConverter {
convertMessage(message: IMessage, cacheObj?: object): Promise<IAppsMessage>;
}
}

declare module '@rocket.chat/apps-engine/definition/accessors/ILivechatCreator' {
interface IExtraRoomParams {
customFields?: Record<string, unknown>;
Expand Down Expand Up @@ -65,7 +59,7 @@ export class AppLivechatBridge extends LivechatBridge {

// #TODO: #AppsEngineTypes - Remove explicit types and typecasts once the apps-engine definition/implementation mismatch is fixed.
const guest = this.orch.getConverters().get('visitors').convertAppVisitor(message.visitor);
const appMessage = (await this.orch.getConverters().get('messages').convertAppMessage(message)) as IMessage | undefined;
const appMessage = await this.orch.getConverters().get('messages').convertAppMessage(message);
const livechatMessage = appMessage as ILivechatMessage | undefined;

const msg = await sendMessage({
Expand Down Expand Up @@ -129,13 +123,12 @@ export class AppLivechatBridge extends LivechatBridge {
type: OmnichannelSourceType.APP,
id: appId,
alias: this.orch.getManager()?.getOneById(appId)?.getName(),
...(source &&
source.type === 'app' && {
sidebarIcon: source.sidebarIcon,
defaultIcon: source.defaultIcon,
label: source.label,
destination: source.destination,
}),
...(source?.type === 'app' && {
sidebarIcon: source.sidebarIcon,
defaultIcon: source.defaultIcon,
label: source.label,
destination: source.destination,
}),
},
},
agent: agentRoom,
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/app/apps/server/bridges/messages.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { IAppServerOrchestrator, IAppsMessage, IAppsUser } from '@rocket.chat/apps';
import type { ITypingDescriptor } from '@rocket.chat/apps/dist/server/bridges/MessageBridge';
import { MessageBridge } from '@rocket.chat/apps/dist/server/bridges/MessageBridge';
import type { Reaction } from '@rocket.chat/apps-engine/definition/messages';
import type { IRoom } from '@rocket.chat/apps-engine/definition/rooms';
import type { ITypingDescriptor } from '@rocket.chat/apps-engine/server/bridges/MessageBridge';
import { MessageBridge } from '@rocket.chat/apps-engine/server/bridges/MessageBridge';
import { api } from '@rocket.chat/core-services';
import type { IMessage } from '@rocket.chat/core-typings';
import { Users, Subscriptions } from '@rocket.chat/models';
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/apps/server/bridges/moderation.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IAppServerOrchestrator } from '@rocket.chat/apps';
import { ModerationBridge } from '@rocket.chat/apps/dist/server/bridges/ModerationBridge';
import type { IMessage } from '@rocket.chat/apps-engine/definition/messages';
import type { IUser } from '@rocket.chat/apps-engine/definition/users';
import { ModerationBridge } from '@rocket.chat/apps-engine/server/bridges/ModerationBridge';
import { ModerationReports } from '@rocket.chat/models';

import { reportMessage } from '../../../../server/lib/moderation/reportMessage';
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/apps/server/bridges/oauthApps.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { randomUUID } from 'crypto';

import type { IAppServerOrchestrator } from '@rocket.chat/apps';
import { OAuthAppsBridge } from '@rocket.chat/apps/dist/server/bridges/OAuthAppsBridge';
import type { IOAuthApp, IOAuthAppParams } from '@rocket.chat/apps-engine/definition/accessors/IOAuthApp';
import { OAuthAppsBridge } from '@rocket.chat/apps-engine/server/bridges/OAuthAppsBridge';
import type { IOAuthApps } from '@rocket.chat/core-typings';
import { OAuthApps, Users } from '@rocket.chat/models';
import { Random } from '@rocket.chat/random';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { IAppServerOrchestrator } from '@rocket.chat/apps';
import { OutboundMessageBridge } from '@rocket.chat/apps/dist/server/bridges/OutboundMessagesBridge';
import type {
IOutboundEmailMessageProvider,
IOutboundMessageProviders,
IOutboundPhoneMessageProvider,
} from '@rocket.chat/apps-engine/definition/outboundCommunication';
import { OutboundMessageBridge } from '@rocket.chat/apps-engine/server/bridges';

import { getOutboundService } from '../../../livechat/server/lib/outboundcommunication';

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/apps/server/bridges/persistence.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { IAppServerOrchestrator } from '@rocket.chat/apps';
import { PersistenceBridge } from '@rocket.chat/apps/dist/server/bridges/PersistenceBridge';
import type { RocketChatAssociationRecord } from '@rocket.chat/apps-engine/definition/metadata';
import { PersistenceBridge } from '@rocket.chat/apps-engine/server/bridges/PersistenceBridge';
import type { InsertOneResult } from 'mongodb';

export class AppPersistenceBridge extends PersistenceBridge {
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/apps/server/bridges/roles.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { IAppServerOrchestrator, IAppsRole } from '@rocket.chat/apps';
import { RoleBridge } from '@rocket.chat/apps-engine/server/bridges';
import { RoleBridge } from '@rocket.chat/apps/dist/server/bridges/RoleBridge';
import type { IRole } from '@rocket.chat/core-typings';
import { Roles } from '@rocket.chat/models';

Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/app/apps/server/bridges/rooms.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { IAppServerOrchestrator } from '@rocket.chat/apps';
import type { GetMessagesOptions, GetRoomsFilters, GetRoomsOptions } from '@rocket.chat/apps/dist/server/bridges/RoomBridge';
import { RoomBridge } from '@rocket.chat/apps/dist/server/bridges/RoomBridge';
import type { IMessage, IMessageRaw } from '@rocket.chat/apps-engine/definition/messages';
import type { IRoom, IRoomRaw } from '@rocket.chat/apps-engine/definition/rooms';
import { RoomType } from '@rocket.chat/apps-engine/definition/rooms';
import type { IUser } from '@rocket.chat/apps-engine/definition/users';
import type { GetMessagesOptions, GetRoomsFilters, GetRoomsOptions } from '@rocket.chat/apps-engine/server/bridges/RoomBridge';
import { RoomBridge } from '@rocket.chat/apps-engine/server/bridges/RoomBridge';
import type { ISubscription, IUser as ICoreUser, IRoom as ICoreRoom, IMessage as ICoreMessage } from '@rocket.chat/core-typings';
import { Subscriptions, Users, Rooms, Messages } from '@rocket.chat/models';
import type { FindOptions, Sort } from 'mongodb';
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/app/apps/server/bridges/scheduler.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Job } from '@rocket.chat/agenda';
import { Agenda } from '@rocket.chat/agenda';
import type { IAppServerOrchestrator } from '@rocket.chat/apps';
import { SchedulerBridge } from '@rocket.chat/apps/dist/server/bridges/SchedulerBridge';
import type { IProcessor, IOnetimeSchedule, IRecurringSchedule, IJobContext } from '@rocket.chat/apps-engine/definition/scheduler';
import { StartupType } from '@rocket.chat/apps-engine/definition/scheduler';
import { SchedulerBridge } from '@rocket.chat/apps-engine/server/bridges/SchedulerBridge';
import { ObjectId } from 'bson';
import { MongoInternals } from 'meteor/mongo';

Expand Down Expand Up @@ -90,7 +90,7 @@ export class AppSchedulerBridge extends SchedulerBridge {
});

if (runAfterRegister.length) {
return Promise.all(runAfterRegister) as Promise<Array<string>>;
return Promise.all(runAfterRegister);
}
}

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/apps/server/bridges/settings.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Apps, type IAppServerOrchestrator } from '@rocket.chat/apps';
import { ServerSettingBridge } from '@rocket.chat/apps/dist/server/bridges/ServerSettingBridge';
import type { IReadSettingPermission } from '@rocket.chat/apps-engine/definition/permissions/IPermission';
import type { ISetting } from '@rocket.chat/apps-engine/definition/settings';
import { ServerSettingBridge } from '@rocket.chat/apps-engine/server/bridges/ServerSettingBridge';
import { Settings } from '@rocket.chat/models';

import { updateAuditedByApp } from '../../../../server/settings/lib/auditedSettingUpdates';
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/apps/server/bridges/thread.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { IAppServerOrchestrator } from '@rocket.chat/apps';
import { ThreadBridge } from '@rocket.chat/apps/dist/server/bridges/ThreadBridge';
import type { IMessage } from '@rocket.chat/apps-engine/definition/messages';
import { ThreadBridge } from '@rocket.chat/apps-engine/server/bridges/ThreadBridge';

export class AppThreadBridge extends ThreadBridge {
constructor(private readonly orch: IAppServerOrchestrator) {
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/apps/server/bridges/uiInteraction.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IAppServerOrchestrator } from '@rocket.chat/apps';
import { UiInteractionBridge as AppsEngineUiInteractionBridge } from '@rocket.chat/apps/dist/server/bridges/UiInteractionBridge';
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot May 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify that the dist paths imported by bridge files exist under packages/apps

fd -e ts -e js . packages/apps/dist/server/bridges/ 2>/dev/null | head -30

# Also confirm the package.json exports/typesVersions cover these paths
cat packages/apps/package.json | grep -A 30 '"exports"'
cat packages/apps/package.json | grep -A 30 '"typesVersions"'

Repository: RocketChat/Rocket.Chat

Length of output: 48


🏁 Script executed:

#!/bin/bash
# First, find where the packages/apps directory is
find . -maxdepth 3 -type d -name "apps" | grep -E "(packages|node_modules)" | head -20

Repository: RocketChat/Rocket.Chat

Length of output: 82


🏁 Script executed:

#!/bin/bash
# Check if packages/apps exists and what's in it
ls -la packages/ 2>/dev/null | head -20

Repository: RocketChat/Rocket.Chat

Length of output: 1213


🏁 Script executed:

#!/bin/bash
# Find the actual uiInteraction.ts file to see what it imports
find . -name "uiInteraction.ts" -type f | grep -v node_modules | head -5

Repository: RocketChat/Rocket.Chat

Length of output: 121


🏁 Script executed:

#!/bin/bash
# Look for any dist/server/bridges directories in the repository
find . -path "*/dist/server/bridges" -type d 2>/dev/null

Repository: RocketChat/Rocket.Chat

Length of output: 48


🏁 Script executed:

#!/bin/bash
# Read the actual import statement in the file
cat -n ./apps/meteor/app/apps/server/bridges/uiInteraction.ts | head -20

Repository: RocketChat/Rocket.Chat

Length of output: 1112


🏁 Script executed:

#!/bin/bash
# Explore packages/apps structure
ls -la packages/apps/

Repository: RocketChat/Rocket.Chat

Length of output: 734


🏁 Script executed:

#!/bin/bash
# Check packages/apps/package.json for exports
cat packages/apps/package.json

Repository: RocketChat/Rocket.Chat

Length of output: 1806


🏁 Script executed:

#!/bin/bash
# Explore packages/apps/src structure to see if server/bridges exists
find packages/apps/src -type f -name "*.ts" | grep -i bridge | head -20

Repository: RocketChat/Rocket.Chat

Length of output: 1140


🏁 Script executed:

#!/bin/bash
# Get full directory structure of packages/apps/src
tree -L 3 packages/apps/src 2>/dev/null || find packages/apps/src -type d | head -30

Repository: RocketChat/Rocket.Chat

Length of output: 6932


🏁 Script executed:

#!/bin/bash
# Find all imports from `@rocket.chat/apps/dist` in the codebase
rg "@rocket.chat/apps/dist" --type ts --type tsx -n | head -40

Repository: RocketChat/Rocket.Chat

Length of output: 94


🏁 Script executed:

#!/bin/bash
# Check if there's a tsconfig that defines the compilation output path
cat packages/apps/tsconfig.json

Repository: RocketChat/Rocket.Chat

Length of output: 349


🏁 Script executed:

#!/bin/bash
# Find all imports from `@rocket.chat/apps/dist` pattern
rg "@rocket.chat/apps/dist" --type ts -n | head -50

Repository: RocketChat/Rocket.Chat

Length of output: 7572


🏁 Script executed:

#!/bin/bash
# Count how many files in the bridges directory follow this import pattern
grep -r "@rocket.chat/apps/dist/server/bridges" apps/meteor/app/apps/server/bridges/ | wc -l

Repository: RocketChat/Rocket.Chat

Length of output: 69


Add formal exports map to packages/apps/package.json to document and stabilize deep-import paths.

The deep imports from @rocket.chat/apps/dist/server/bridges/ and similar paths are valid—the source files exist at packages/apps/src/server/bridges/ and TypeScript will compile them to the expected dist structure. However, this pattern is used extensively across 40+ files (bridges, storage, managers, client) and currently bypasses the package's exports configuration. While the paths will work with the current build setup, adding explicit exports entries would formalize these APIs and protect against accidental breaking changes to the build output structure.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/meteor/app/apps/server/bridges/uiInteraction.ts` at line 2, The code is
using deep-imports like
'@rocket.chat/apps/dist/server/bridges/UiInteractionBridge' (see
UiInteractionBridge import in apps/server/bridges/uiInteraction.ts) which bypass
the package's exports map; update packages/apps/package.json to add explicit
"exports" subpath entries that expose the compiled dist paths used across the
repo (at minimum map "./dist/server/bridges/UiInteractionBridge" and the broader
"./dist/server/bridges/*" plus analogous entries for "./dist/server/storage/*",
"./dist/server/managers/*" and "./dist/client/*"), ensuring the exported targets
include both the JS entry and typings where applicable so existing imports
continue to resolve without relying on implicit build output layout.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meteor's bundler does not respect the exports keyword on package.json files. For now we'll need to keep the deep imports

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@d-gubert, thanks for the clarification! That makes total sense — since Meteor's bundler ignores the exports field in package.json, the deep dist/ imports are the correct approach here and no changes are needed.


✏️ Learnings added
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 40186
File: apps/meteor/app/apps/server/bridges/uiInteraction.ts:2-2
Timestamp: 2026-05-06T20:47:53.078Z
Learning: In the RocketChat/Rocket.Chat repository, Meteor's bundler does not respect the `exports` keyword in `package.json` files. Deep imports (e.g., `rocket.chat/apps/dist/server/bridges/UiInteractionBridge`) must be used instead of relying on `exports` subpath mappings. Do not suggest adding `exports` map entries to packages consumed by Meteor (e.g., `packages/apps/package.json`) as a fix for deep imports.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 40256
File: apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx:121-149
Timestamp: 2026-05-06T12:21:44.083Z
Learning: Field wrappers in rocket.chat/fuselage-forms (Field, FieldLabel, FieldRow, FieldError, FieldHint) auto-create htmlFor/id associations, aria-describedby, and role="alert" for errors. Do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers. This automatic wiring does not apply to plain rocket.chat/fuselage components, which require explicit ID wiring per the accessibility docs. In code reviews, prefer using fuselage-forms wrappers for form fields and verify there is no unnecessary manual ID/aria wiring in files that use these wrappers. If a component uses plain fuselage components, ensure proper id wiring as per docs.

import type { IUIKitInteraction } from '@rocket.chat/apps-engine/definition/uikit';
import type { IUser } from '@rocket.chat/apps-engine/definition/users';
import { UiInteractionBridge as AppsEngineUiInteractionBridge } from '@rocket.chat/apps-engine/server/bridges/UiInteractionBridge';
import { api } from '@rocket.chat/core-services';
import type * as UiKit from '@rocket.chat/ui-kit';

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/apps/server/bridges/uploads.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IAppServerOrchestrator } from '@rocket.chat/apps';
import { UploadBridge } from '@rocket.chat/apps/dist/server/bridges/UploadBridge';
import type { IUpload } from '@rocket.chat/apps-engine/definition/uploads';
import type { IUploadDetails } from '@rocket.chat/apps-engine/definition/uploads/IUploadDetails';
import { UploadBridge } from '@rocket.chat/apps-engine/server/bridges/UploadBridge';

import { determineFileType } from '../../../../ee/lib/misc/determineFileType';
import { FileUpload } from '../../../file-upload/server';
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/apps/server/bridges/users.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { IAppServerOrchestrator } from '@rocket.chat/apps';
import { UserBridge } from '@rocket.chat/apps/dist/server/bridges/UserBridge';
import type { IUserCreationOptions, IUser, UserType } from '@rocket.chat/apps-engine/definition/users';
import { UserBridge } from '@rocket.chat/apps-engine/server/bridges/UserBridge';
import { Presence } from '@rocket.chat/core-services';
import type { UserStatus } from '@rocket.chat/core-typings';
import { Subscriptions, Users } from '@rocket.chat/models';
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/apps/server/bridges/videoConferences.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IAppServerOrchestrator } from '@rocket.chat/apps';
import { VideoConferenceBridge } from '@rocket.chat/apps/dist/server/bridges/VideoConferenceBridge';
import type { IVideoConfProvider } from '@rocket.chat/apps-engine/definition/videoConfProviders';
import type { AppVideoConference, VideoConference } from '@rocket.chat/apps-engine/definition/videoConferences';
import { VideoConferenceBridge } from '@rocket.chat/apps-engine/server/bridges/VideoConferenceBridge';
import { VideoConf } from '@rocket.chat/core-services';

import { videoConfProviders } from '../../../../server/lib/videoConfProviders';
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/statistics/server/lib/getAppsStatistics.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Apps } from '@rocket.chat/apps';
import { AppInstallationSource } from '@rocket.chat/apps/dist/server/storage/IAppStorageItem';
import { AppStatus, AppStatusUtils } from '@rocket.chat/apps-engine/definition/AppStatus';
import { AppInstallationSource } from '@rocket.chat/apps-engine/server/storage';
import mem from 'mem';

import { SystemLogger } from '../../../../server/lib/logger/system';
Expand Down
5 changes: 3 additions & 2 deletions apps/meteor/client/apps/RealAppsEngineUIHost.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { AppsEngineUIHost } from '@rocket.chat/apps-engine/client/AppsEngineUIHost';
import type { IExternalComponentRoomInfo, IExternalComponentUserInfo } from '@rocket.chat/apps-engine/client/definition';
import { AppsEngineUIHost } from '@rocket.chat/apps/dist/client/AppsEngineUIHost';
import type { IExternalComponentRoomInfo } from '@rocket.chat/apps/dist/client/definition/IExternalComponentRoomInfo';
import type { IExternalComponentUserInfo } from '@rocket.chat/apps/dist/client/definition/IExternalComponentUserInfo';

import { getUserAvatarURL } from '../../app/utils/client/getUserAvatarURL';
import { sdk } from '../../app/utils/client/lib/SDKClient';
Expand Down
Loading
Loading