Skip to content

Bug: UseAgentUpdate enum is not exportedΒ #43

@blove

Description

@blove

πŸ› Bug: UseAgentUpdate enum is not exported, causing TypeScript errors

♻️ Reproduction Steps

  1. Use useAgent with updates parameter:
    const { agent } = useAgent({
      agentId: 'plan',
      updates: ['OnStateChanged'],
    });
  2. TypeScript error: Type '"OnStateChanged"' is not assignable to type 'UseAgentUpdate'.

βœ… Expected Behavior

The UseAgentUpdate enum should be exported and usable:

import { useAgent, UseAgentUpdate } from '@copilotkitnext/react';

const { agent } = useAgent({
  agentId: 'plan',
  updates: [UseAgentUpdate.OnStateChanged],
});

The enum is defined in index.d.ts (lines 498-502) but not exported (line 636).

❌ Actual Behavior

TypeScript error forces users to use as any workaround:

updates: ['OnStateChanged' as any];

𝌚 CopilotKit Version

β”œβ”€β”€ @copilotkitnext/[email protected]
β”œβ”€β”€ @copilotkitnext/[email protected]

πŸ“„ Logs (Optional)

Type '"OnStateChanged"' is not assignable to type 'UseAgentUpdate'.

Fix: Export UseAgentUpdate enum from @copilotkitnext/react.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions