Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: replace AgentRuntime to his interface to extend client #2388

Merged
merged 7 commits into from
Feb 23, 2025
Merged
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
6 changes: 3 additions & 3 deletions packages/client-direct/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Response format should be formatted in a JSON block like this:

export class DirectClient {
public app: express.Application;
private agents: Map<string, AgentRuntime>; // container management
private agents: Map<string, IAgentRuntime>; // container management
private server: any; // Store server instance
public startAgent: Function; // Store startAgent functor
public loadCharacterTryPath: Function; // Store loadCharacterTryPath functor
Expand Down Expand Up @@ -979,13 +979,13 @@ export class DirectClient {
}

// agent/src/index.ts:startAgent calls this
public registerAgent(runtime: AgentRuntime) {
public registerAgent(runtime: IAgentRuntime) {
// register any plugin endpoints?
// but once and only once
this.agents.set(runtime.agentId, runtime);
}

public unregisterAgent(runtime: AgentRuntime) {
public unregisterAgent(runtime: IAgentRuntime) {
this.agents.delete(runtime.agentId);
}

Expand Down
Loading