Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8d8117b
feat(app): integrate @trycompai/design-system and update ESLint confi…
Marfuen Jan 12, 2026
d30c833
fix(app): update @trycompai/design-system to version 1.0.3 and remove…
Marfuen Jan 12, 2026
43dcaff
feat(app): enhance AppShellWrapper and AppSidebar with dropdown menus
Marfuen Jan 12, 2026
e2e2e48
feat(app): update @trycompai/design-system to version 1.0.4 and enhan…
Marfuen Jan 12, 2026
acdce7a
refactor(risk): remove unused layout and loading components, update p…
carhartlewis Jan 12, 2026
59fd240
Merge branch 'feat/implement-new-design-system' of https://github.com…
carhartlewis Jan 12, 2026
e05b0dc
feat(policies): implement new PolicyTabs and PoliciesTableDS components
Marfuen Jan 12, 2026
294398d
feat(policies): simplify layout structure and enhance policy overview…
Marfuen Jan 12, 2026
b091a68
feat(app): update @trycompai/design-system to version 1.0.8 and enhan…
Marfuen Jan 12, 2026
42d8496
feat(app): update @trycompai/design-system to version 1.0.11 and enha…
Marfuen Jan 12, 2026
d44c563
feat(policies): refactor PolicyDetails layout for improved structure
Marfuen Jan 12, 2026
27222ee
feat(policies): enhance policy overview and details layout with new f…
Marfuen Jan 12, 2026
9c92ccb
feat(app): update @trycompai/design-system to version 1.0.19 and refa…
Marfuen Jan 13, 2026
ef43279
feat(app): update @trycompai/design-system to version 1.0.20 and enha…
Marfuen Jan 13, 2026
863aca3
feat(app): update @trycompai/design-system to version 1.0.21 and impr…
Marfuen Jan 13, 2026
9f36c67
feat(comments): replace Dialog with AlertDialog for delete confirmation
Marfuen Jan 13, 2026
02929ef
chore: rest of pages layouts fixed
Marfuen Jan 14, 2026
96ca669
style(app): format code for better readability and consistency
Marfuen Jan 14, 2026
8a4ca6a
feat(chat): add status and submit handler to EmptyState component
Marfuen Jan 14, 2026
d28b9ce
feat(app): update @trycompai/design-system to version 1.0.28 and enha…
Marfuen Jan 14, 2026
9969695
style(ui): ensure newline at end of package.json file
Marfuen Jan 14, 2026
cbb273b
feat(ui): enhance loading and table components with new layout and em…
Marfuen Jan 19, 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
12 changes: 6 additions & 6 deletions .cursor/mcp.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"mcpServers": {
"trigger": {
"command": "npx",
"args": [
"trigger.dev@latest",
"mcp",
"--dev-only"
]
"args": ["trigger.dev@latest", "mcp", "--dev-only"]
},
"trycompai": {
"command": "npx",
"args": ["-y", "@trycompai/design-system-mcp@latest"]
}
}
}
}
184 changes: 0 additions & 184 deletions ENTERPRISE_API_AUTOMATION_VERSIONING.md

This file was deleted.

15 changes: 10 additions & 5 deletions apps/api/src/assistant-chat/assistant-chat.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ import type { AssistantChatMessage } from './assistant-chat.types';
export class AssistantChatController {
constructor(private readonly assistantChatService: AssistantChatService) {}

private getUserScopedContext(auth: AuthContextType): { organizationId: string; userId: string } {
private getUserScopedContext(auth: AuthContextType): {
organizationId: string;
userId: string;
} {
// Defensive checks (should already be guaranteed by HybridAuthGuard + AuthContext decorator)
if (!auth.organizationId) {
throw new BadRequestException('Organization ID is required');
Expand Down Expand Up @@ -69,7 +72,9 @@ export class AssistantChatController {
},
},
})
async getHistory(@AuthContext() auth: AuthContextType): Promise<{ messages: AssistantChatMessage[] }> {
async getHistory(
@AuthContext() auth: AuthContextType,
): Promise<{ messages: AssistantChatMessage[] }> {
const { organizationId, userId } = this.getUserScopedContext(auth);

const messages = await this.assistantChatService.getHistory({
Expand Down Expand Up @@ -105,7 +110,9 @@ export class AssistantChatController {
summary: 'Clear assistant chat history',
description: 'Deletes the current user-scoped assistant chat history.',
})
async clearHistory(@AuthContext() auth: AuthContextType): Promise<{ success: true }> {
async clearHistory(
@AuthContext() auth: AuthContextType,
): Promise<{ success: true }> {
const { organizationId, userId } = this.getUserScopedContext(auth);

await this.assistantChatService.clearHistory({
Expand All @@ -116,5 +123,3 @@ export class AssistantChatController {
return { success: true };
}
}


10 changes: 7 additions & 3 deletions apps/api/src/assistant-chat/assistant-chat.dto.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsArray, IsIn, IsNumber, IsString, ValidateNested } from 'class-validator';
import {
IsArray,
IsIn,
IsNumber,
IsString,
ValidateNested,
} from 'class-validator';
import { Type } from 'class-transformer';

export class AssistantChatMessageDto {
Expand Down Expand Up @@ -27,5 +33,3 @@ export class SaveAssistantChatHistoryDto {
@Type(() => AssistantChatMessageDto)
messages!: AssistantChatMessageDto[];
}


2 changes: 0 additions & 2 deletions apps/api/src/assistant-chat/assistant-chat.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@ import { AssistantChatService } from './assistant-chat.service';
providers: [AssistantChatService],
})
export class AssistantChatModule {}


20 changes: 14 additions & 6 deletions apps/api/src/assistant-chat/assistant-chat.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ type GetAssistantChatKeyParams = {
userId: string;
};

const getAssistantChatKey = ({ organizationId, userId }: GetAssistantChatKeyParams): string => {
const getAssistantChatKey = ({
organizationId,
userId,
}: GetAssistantChatKeyParams): string => {
return `assistant-chat:v1:${organizationId}:${userId}`;
};

Expand All @@ -27,17 +30,24 @@ export class AssistantChatService {
* Default TTL is 7 days. This is intended to behave like "session context"
* rather than a long-term, searchable archive.
*/
private readonly ttlSeconds = Number(process.env.ASSISTANT_CHAT_TTL_SECONDS ?? 60 * 60 * 24 * 7);
private readonly ttlSeconds = Number(
process.env.ASSISTANT_CHAT_TTL_SECONDS ?? 60 * 60 * 24 * 7,
);

async getHistory(params: GetAssistantChatKeyParams): Promise<AssistantChatMessage[]> {
async getHistory(
params: GetAssistantChatKeyParams,
): Promise<AssistantChatMessage[]> {
const key = getAssistantChatKey(params);
const raw = await assistantChatRedisClient.get<unknown>(key);
const parsed = StoredMessagesSchema.safeParse(raw);
if (!parsed.success) return [];
return parsed.data;
}

async saveHistory(params: GetAssistantChatKeyParams, messages: AssistantChatMessage[]): Promise<void> {
async saveHistory(
params: GetAssistantChatKeyParams,
messages: AssistantChatMessage[],
): Promise<void> {
const key = getAssistantChatKey(params);
// Always validate before writing to keep the cache shape stable.
const validated = StoredMessagesSchema.parse(messages);
Expand All @@ -49,5 +59,3 @@ export class AssistantChatService {
await assistantChatRedisClient.del(key);
}
}


2 changes: 0 additions & 2 deletions apps/api/src/assistant-chat/assistant-chat.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ export type AssistantChatMessage = {
text: string;
createdAt: number;
};


11 changes: 7 additions & 4 deletions apps/api/src/assistant-chat/upstash-redis.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ class InMemoryRedis {
return record.value as T;
}

async set(key: string, value: unknown, options?: { ex?: number }): Promise<'OK'> {
async set(
key: string,
value: unknown,
options?: { ex?: number },
): Promise<'OK'> {
const expiresAt = options?.ex ? Date.now() + options.ex * 1000 : undefined;
this.storage.set(key, { value, expiresAt });
return 'OK';
Expand All @@ -32,7 +36,8 @@ class InMemoryRedis {
}

const hasUpstashConfig =
!!process.env.UPSTASH_REDIS_REST_URL && !!process.env.UPSTASH_REDIS_REST_TOKEN;
!!process.env.UPSTASH_REDIS_REST_URL &&
!!process.env.UPSTASH_REDIS_REST_TOKEN;

export const assistantChatRedisClient: Pick<Redis, 'get' | 'set' | 'del'> =
hasUpstashConfig
Expand All @@ -41,5 +46,3 @@ export const assistantChatRedisClient: Pick<Redis, 'get' | 'set' | 'del'> =
token: process.env.UPSTASH_REDIS_REST_TOKEN!,
})
: (new InMemoryRedis() as unknown as Pick<Redis, 'get' | 'set' | 'del'>);


2 changes: 0 additions & 2 deletions apps/api/src/auth/internal-token.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,3 @@ export class InternalTokenGuard implements CanActivate {
return true;
}
}


10 changes: 7 additions & 3 deletions apps/api/src/comments/comment-mention-notifier.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ async function buildFallbackCommentContext(params: {
});

if (taskItem) {
const parentRoutePath = taskItem.entityType === 'vendor' ? 'vendors' : 'risk';
const parentRoutePath =
taskItem.entityType === 'vendor' ? 'vendors' : 'risk';
const url = new URL(
`${appUrl}/${organizationId}/${parentRoutePath}/${taskItem.entityId}`,
);
Expand Down Expand Up @@ -291,7 +292,11 @@ export class CommentMentionNotifierService {

// Check if user is unsubscribed from comment mention notifications
// Note: We'll use 'taskMentions' preference for now, or create a new 'commentMentions' preference
const isUnsubscribed = await isUserUnsubscribed(db, user.email, 'taskMentions');
const isUnsubscribed = await isUserUnsubscribed(
db,
user.email,
'taskMentions',
);
if (isUnsubscribed) {
this.logger.log(
`Skipping mention notification: user ${user.email} is unsubscribed from mentions`,
Expand Down Expand Up @@ -375,4 +380,3 @@ export class CommentMentionNotifierService {
}
}
}

4 changes: 3 additions & 1 deletion apps/api/src/comments/comments.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,9 @@ export class CommentsService {

// Notify mentioned users
if (createCommentDto.content && userId) {
const mentionedUserIds = extractMentionedUserIds(createCommentDto.content);
const mentionedUserIds = extractMentionedUserIds(
createCommentDto.content,
);
if (mentionedUserIds.length > 0) {
// Fire-and-forget: notification failures should not block comment creation
void this.mentionNotifier.notifyMentionedUsers({
Expand Down
Loading