Readonly
litExecutes a tool with the provided parameters.
The parameters for tool execution, excluding session signatures.
A promise that resolves to the tool execution response.
If the execution fails or if the delegatee is not properly initialized.
Retrieves stored credentials required by a tool.
Names of the required credentials.
Object containing found credentials and list of any missing credentials.
Retrieves all delegated PKPs (Programmable Key Pairs) for the Delegatee.
A promise that resolves to an array of DelegatedPkpInfo
objects.
If the tool policy registry contract, delegatee wallet, or Lit contracts are not initialized.
Get all registered tools and categorize them based on whether they have policies
Object containing:
Retrieves the policy for a specific tool.
The token ID of the PKP.
The IPFS CID of the tool.
An object containing the policy and version for the tool.
If the tool policy registry contract is not initialized.
Matches a user's intent to an appropriate permitted tool.
The token ID of the PKP.
The user's intent string.
The intent matcher implementation to use.
A promise that resolves to the matched tool and any extracted parameters.
If no matching tool is found or if the tool is not permitted.
Stores credentials for future tool executions.
Object containing credential key-value pairs to store.
If any credential value is not a string.
Static
createCreates an instance of the Delegatee
class.
Initializes the Lit node client, contracts, and capacity credit.
Optional
delegateePrivateKey: stringOptional. The private key for the Delegatee role.
Configuration for the agent, including the Lit network and debug mode.
A promise that resolves to an instance of the Delegatee
class.
If the Lit network is not provided or the private key is missing.
The
Delegatee
class is responsible for executing tools on behalf of the PKP Admin. They are limited to the tools and policies that the PKP Admin has permitted. The class manages the delegatee's authentication and wallet, retrieves permitted tools and their policies, executes tools within permitted boundaries, manages tool-specific credentials, and handles capacity credits for execution. It provides secure access to authorized tools while enforcing policy constraints set by the PKP Admin.