Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion apps/mail/components/ui/nav-main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { useCommandPalette } from '../context/command-palette-context.jsx';
import { LabelDialog } from '@/components/labels/label-dialog';
import { useActiveConnection } from '@/hooks/use-connections';
import { useMutation, useQuery } from '@tanstack/react-query';
import { useSearchValue } from '@/hooks/use-search-value.js';
import Intercom, { show } from '@intercom/messenger-js-sdk';
import { MessageSquare, OldPhone } from '../icons/icons';
import { useSidebar } from '../context/sidebar-context';
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/pipelines.effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ export const runThreadWorkflow = (
remove: labelsToRemove,
});
await agent.modifyLabels([threadId.toString()], labelsToAdd, labelsToRemove);
await agent.syncThread(threadId.toString());
await agent.syncThread({ threadId: threadId.toString() });
console.log('[THREAD_WORKFLOW] Successfully modified thread labels');
} else {
console.log('[THREAD_WORKFLOW] No label changes needed - labels already match');
Expand Down
6 changes: 1 addition & 5 deletions apps/server/src/routes/agent/mcp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { createDb } from '../../db';
import { generateText } from 'ai';
import z from 'zod';

export class ZeroMCP extends McpAgent<typeof env, {}, { userId: string }> {
export class ZeroMCP extends McpAgent<typeof env, Record<string, unknown>, { userId: string }> {
Copy link
Contributor

Choose a reason for hiding this comment

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

The change from {} to Record<string, unknown> improves type safety. Empty object types ({}) in TypeScript can be problematic as they allow any non-null value, which can lead to unexpected behavior. Record<string, unknown> explicitly defines an object with string keys and unknown values, providing better type constraints while maintaining flexibility. This aligns with best practices for TypeScript type definitions.

Spotted by Diamond (based on custom rules)

Is this helpful? React πŸ‘ or πŸ‘Ž to let us know.

server = new McpServer({
name: 'zero-mcp',
version: '1.0.0',
Expand All @@ -36,10 +36,6 @@ export class ZeroMCP extends McpAgent<typeof env, {}, { userId: string }> {

activeConnectionId: string | undefined;

constructor(ctx: DurableObjectState, env: Env) {
super(ctx, env);
}

async init(): Promise<void> {
const { db, conn } = createDb(env.HYPERDRIVE.connectionString);
const _connection = await db.query.connection.findFirst({
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/routes/agent/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class AgentRpcDO extends RpcTarget {
return result;
}

async syncThread(threadId: string) {
async syncThread({ threadId }: { threadId: string }) {
return await this.mainDo.syncThread({ threadId });
}

Expand Down