mirror of
https://github.com/d0zingcat/solana-agent-kit.git
synced 2026-05-21 07:36:45 +00:00
fix: naming
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import { Action } from "../types/action";
|
||||
import { SolanaAgentKit } from "../agent";
|
||||
import { actions } from "../actions";
|
||||
import { ACTIONS } from "../actions";
|
||||
|
||||
/**
|
||||
* Find an action by its name or one of its similes
|
||||
*/
|
||||
export function findAction(query: string): Action | undefined {
|
||||
const normalizedQuery = query.toLowerCase().trim();
|
||||
return actions.find(
|
||||
return Object.values(ACTIONS).find(
|
||||
(action) =>
|
||||
action.name.toLowerCase() === normalizedQuery ||
|
||||
action.similes.some((simile) => simile.toLowerCase() === normalizedQuery),
|
||||
|
||||
Reference in New Issue
Block a user