@mixrpay/agent-sdk 0.8.6 → 0.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -4
- package/dist/index.cjs +638 -1
- package/dist/index.d.cts +670 -3
- package/dist/index.d.ts +670 -3
- package/dist/index.js +638 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -129,8 +129,14 @@ interface PaymentEvent {
|
|
|
129
129
|
* Information about a session key.
|
|
130
130
|
*/
|
|
131
131
|
interface SessionKeyInfo {
|
|
132
|
-
/** The session key's address (
|
|
132
|
+
/** The session key's derived address (used for signing requests) */
|
|
133
133
|
address: string;
|
|
134
|
+
/**
|
|
135
|
+
* The wallet address this session key is authorized to spend from.
|
|
136
|
+
* This is the human's funded wallet, NOT your agent's external wallet.
|
|
137
|
+
* All charges are deducted from this wallet.
|
|
138
|
+
*/
|
|
139
|
+
walletAddress: string | null;
|
|
134
140
|
/** Whether the session key is currently valid */
|
|
135
141
|
isValid: boolean;
|
|
136
142
|
/** Spending limits configured for this session key */
|
|
@@ -379,7 +385,7 @@ interface SessionStats {
|
|
|
379
385
|
*/
|
|
380
386
|
|
|
381
387
|
/** Current SDK version */
|
|
382
|
-
declare const SDK_VERSION = "0.8.
|
|
388
|
+
declare const SDK_VERSION = "0.8.7";
|
|
383
389
|
/** Supported networks */
|
|
384
390
|
declare const NETWORKS: {
|
|
385
391
|
readonly BASE_MAINNET: {
|
|
@@ -1453,6 +1459,143 @@ declare class AgentWallet {
|
|
|
1453
1459
|
* ```
|
|
1454
1460
|
*/
|
|
1455
1461
|
getJitInstance(instanceId: string): Promise<JitInstance>;
|
|
1462
|
+
/**
|
|
1463
|
+
* Use a configured skill by deploying a JIT MCP server with your saved API keys.
|
|
1464
|
+
*
|
|
1465
|
+
* Skills are configured on the MixrPay dashboard with your API keys stored securely.
|
|
1466
|
+
* When you call useSkill(), MixrPay deploys an ephemeral MCP server with your keys
|
|
1467
|
+
* injected server-side - your keys are never exposed to the agent.
|
|
1468
|
+
*
|
|
1469
|
+
* @param skillId - The skill ID (e.g., 'github', 'notion', 'spotify')
|
|
1470
|
+
* @param options - Optional configuration
|
|
1471
|
+
* @returns Skill endpoint and available tools
|
|
1472
|
+
*
|
|
1473
|
+
* @example
|
|
1474
|
+
* ```typescript
|
|
1475
|
+
* // Use the GitHub skill
|
|
1476
|
+
* const github = await wallet.useSkill('github');
|
|
1477
|
+
*
|
|
1478
|
+
* console.log('Endpoint:', github.endpoint);
|
|
1479
|
+
* console.log('Tools:', github.tools);
|
|
1480
|
+
* console.log('Expires:', github.expiresAt);
|
|
1481
|
+
*
|
|
1482
|
+
* // Connect to the MCP endpoint and call tools
|
|
1483
|
+
* // The exact method depends on your MCP client
|
|
1484
|
+
* ```
|
|
1485
|
+
*
|
|
1486
|
+
* @example
|
|
1487
|
+
* ```typescript
|
|
1488
|
+
* // Use Notion with custom TTL
|
|
1489
|
+
* const notion = await wallet.useSkill('notion', { ttlHours: 48 });
|
|
1490
|
+
* ```
|
|
1491
|
+
*
|
|
1492
|
+
* @throws {MixrPayError} If skill is not configured or deployment fails
|
|
1493
|
+
*/
|
|
1494
|
+
useSkill(skillId: string, options?: UseSkillOptions): Promise<UseSkillResult>;
|
|
1495
|
+
/**
|
|
1496
|
+
* List all available skills and their configuration status.
|
|
1497
|
+
*
|
|
1498
|
+
* @returns Array of skills with status
|
|
1499
|
+
*
|
|
1500
|
+
* @example
|
|
1501
|
+
* ```typescript
|
|
1502
|
+
* const skills = await wallet.listSkills();
|
|
1503
|
+
*
|
|
1504
|
+
* // Find configured skills
|
|
1505
|
+
* const configured = skills.filter(s => s.status === 'configured');
|
|
1506
|
+
* console.log(`${configured.length} skills ready to use`);
|
|
1507
|
+
*
|
|
1508
|
+
* // Find skills that need configuration
|
|
1509
|
+
* const needsConfig = skills.filter(s => s.status === 'not_configured' && s.envVars.length > 0);
|
|
1510
|
+
* for (const skill of needsConfig) {
|
|
1511
|
+
* console.log(`${skill.name} needs: ${skill.envVars.map(v => v.label).join(', ')}`);
|
|
1512
|
+
* }
|
|
1513
|
+
* ```
|
|
1514
|
+
*/
|
|
1515
|
+
listSkills(): Promise<SkillInfo[]>;
|
|
1516
|
+
/**
|
|
1517
|
+
* Get apps connected via Composio (Gmail, Slack, GitHub, etc.).
|
|
1518
|
+
*
|
|
1519
|
+
* Use this to discover which apps the owner has connected before
|
|
1520
|
+
* attempting to use them via `wallet.useSkill('composio')`.
|
|
1521
|
+
*
|
|
1522
|
+
* @returns Object with connected app names and connection details
|
|
1523
|
+
*
|
|
1524
|
+
* @example
|
|
1525
|
+
* ```typescript
|
|
1526
|
+
* const apps = await wallet.getConnectedApps();
|
|
1527
|
+
*
|
|
1528
|
+
* if (apps.connected.length === 0) {
|
|
1529
|
+
* console.log('No apps connected. Ask your owner to connect apps at the dashboard.');
|
|
1530
|
+
* } else {
|
|
1531
|
+
* console.log('Connected apps:', apps.connected.join(', '));
|
|
1532
|
+
*
|
|
1533
|
+
* if (apps.connected.includes('gmail')) {
|
|
1534
|
+
* // Safe to use Composio for Gmail
|
|
1535
|
+
* const { endpoint, tools } = await wallet.useSkill('composio');
|
|
1536
|
+
* // tools will include 'gmail_read_emails', 'gmail_send_email', etc.
|
|
1537
|
+
* }
|
|
1538
|
+
* }
|
|
1539
|
+
* ```
|
|
1540
|
+
*/
|
|
1541
|
+
getConnectedApps(): Promise<ConnectedAppsResult>;
|
|
1542
|
+
/**
|
|
1543
|
+
* Get configuration status for a specific skill.
|
|
1544
|
+
*
|
|
1545
|
+
* @param skillId - The skill ID
|
|
1546
|
+
* @returns Skill configuration status
|
|
1547
|
+
*
|
|
1548
|
+
* @example
|
|
1549
|
+
* ```typescript
|
|
1550
|
+
* const status = await wallet.getSkillStatus('github');
|
|
1551
|
+
*
|
|
1552
|
+
* if (status.status === 'configured') {
|
|
1553
|
+
* console.log('GitHub is ready!');
|
|
1554
|
+
* console.log('Configured vars:', status.configuredVars);
|
|
1555
|
+
* } else {
|
|
1556
|
+
* console.log('Please configure GitHub at the MixrPay dashboard');
|
|
1557
|
+
* }
|
|
1558
|
+
* ```
|
|
1559
|
+
*/
|
|
1560
|
+
getSkillStatus(skillId: string): Promise<SkillStatus>;
|
|
1561
|
+
/**
|
|
1562
|
+
* Configure a skill with API keys.
|
|
1563
|
+
*
|
|
1564
|
+
* This allows agents to save API keys received via chat to the MixrPay platform.
|
|
1565
|
+
* Keys are encrypted at rest and will be available for use on subsequent deploy/redeploy.
|
|
1566
|
+
*
|
|
1567
|
+
* @param skillId - The skill ID (e.g., 'web-search', 'github', 'notion') or custom skill with 'custom-' prefix
|
|
1568
|
+
* @param envVars - Environment variables with API keys (e.g., { BRAVE_API_KEY: 'xxx' })
|
|
1569
|
+
* @returns Configuration result with list of configured variables
|
|
1570
|
+
*
|
|
1571
|
+
* @example Predefined skill
|
|
1572
|
+
* ```typescript
|
|
1573
|
+
* // User provides API key in chat, agent saves it
|
|
1574
|
+
* const result = await wallet.configureSkill('web-search', {
|
|
1575
|
+
* BRAVE_API_KEY: 'BSA_abc123xyz',
|
|
1576
|
+
* });
|
|
1577
|
+
*
|
|
1578
|
+
* console.log('Configured:', result.configuredVars);
|
|
1579
|
+
* // After next redeploy, the skill will be enabled with this key
|
|
1580
|
+
* ```
|
|
1581
|
+
*
|
|
1582
|
+
* @example Custom API key
|
|
1583
|
+
* ```typescript
|
|
1584
|
+
* // For APIs not in predefined skills, use custom- prefix
|
|
1585
|
+
* // User: "Here's my Polymarket API key: pk_abc123"
|
|
1586
|
+
* const result = await wallet.configureSkill('custom-polymarket', {
|
|
1587
|
+
* POLYMARKET_API_KEY: 'pk_abc123',
|
|
1588
|
+
* });
|
|
1589
|
+
*
|
|
1590
|
+
* // The key is now available in the agent's environment
|
|
1591
|
+
* // Access via: process.env.POLYMARKET_API_KEY
|
|
1592
|
+
* ```
|
|
1593
|
+
*/
|
|
1594
|
+
configureSkill(skillId: string, envVars: Record<string, string>): Promise<{
|
|
1595
|
+
success: boolean;
|
|
1596
|
+
skillId: string;
|
|
1597
|
+
configuredVars: string[];
|
|
1598
|
+
}>;
|
|
1456
1599
|
/**
|
|
1457
1600
|
* Search the Glama MCP server directory.
|
|
1458
1601
|
*
|
|
@@ -1507,6 +1650,165 @@ declare class AgentWallet {
|
|
|
1507
1650
|
* Parse Glama server response data.
|
|
1508
1651
|
*/
|
|
1509
1652
|
private parseGlamaServer;
|
|
1653
|
+
/**
|
|
1654
|
+
* Deploy a JIT Task Agent - a serverless agent that executes a specific task.
|
|
1655
|
+
*
|
|
1656
|
+
* JIT Task Agents run on Cloudflare Workers and execute an agentic loop
|
|
1657
|
+
* (LLM + tools) within a budget cap. They self-destruct when complete.
|
|
1658
|
+
*
|
|
1659
|
+
* @param options - Task agent deployment options
|
|
1660
|
+
* @returns Deployed task agent instance with endpoints
|
|
1661
|
+
*
|
|
1662
|
+
* @example Basic usage
|
|
1663
|
+
* ```typescript
|
|
1664
|
+
* const result = await wallet.deployTaskAgent({
|
|
1665
|
+
* name: 'Research Agent',
|
|
1666
|
+
* prompt: 'Research the top 5 AI startups in San Francisco',
|
|
1667
|
+
* budgetUsd: 5.00,
|
|
1668
|
+
* tools: ['platform/exa-search', 'platform/firecrawl-scrape'],
|
|
1669
|
+
* });
|
|
1670
|
+
*
|
|
1671
|
+
* console.log('Task ID:', result.instance.id);
|
|
1672
|
+
* console.log('Status URL:', result.instance.statusUrl);
|
|
1673
|
+
* ```
|
|
1674
|
+
*
|
|
1675
|
+
* @example With auto-run
|
|
1676
|
+
* ```typescript
|
|
1677
|
+
* const result = await wallet.deployTaskAgent({
|
|
1678
|
+
* name: 'Data Collector',
|
|
1679
|
+
* prompt: 'Collect pricing data from competitor websites',
|
|
1680
|
+
* budgetUsd: 10.00,
|
|
1681
|
+
* tools: ['platform/firecrawl-scrape'],
|
|
1682
|
+
* autoRun: true, // Start immediately
|
|
1683
|
+
* });
|
|
1684
|
+
*
|
|
1685
|
+
* // Wait for completion
|
|
1686
|
+
* const finalResult = await wallet.waitForTaskAgent(result.instance.id);
|
|
1687
|
+
* console.log('Result:', finalResult.result);
|
|
1688
|
+
* ```
|
|
1689
|
+
*/
|
|
1690
|
+
deployTaskAgent(options: DeployTaskAgentOptions): Promise<DeployTaskAgentResult>;
|
|
1691
|
+
/**
|
|
1692
|
+
* Get the status of a JIT Task Agent.
|
|
1693
|
+
*
|
|
1694
|
+
* @param instanceId - The task agent instance ID
|
|
1695
|
+
* @returns Current status and details
|
|
1696
|
+
*
|
|
1697
|
+
* @example
|
|
1698
|
+
* ```typescript
|
|
1699
|
+
* const status = await wallet.getTaskAgentStatus('cuid_abc123');
|
|
1700
|
+
* console.log('Status:', status.status);
|
|
1701
|
+
* console.log('Iterations:', status.iterations.current, '/', status.iterations.max);
|
|
1702
|
+
* console.log('Spent:', status.budget.spentUsd, '/', status.budget.totalUsd);
|
|
1703
|
+
* ```
|
|
1704
|
+
*/
|
|
1705
|
+
getTaskAgentStatus(instanceId: string): Promise<TaskAgentStatus>;
|
|
1706
|
+
/**
|
|
1707
|
+
* Trigger execution of a JIT Task Agent.
|
|
1708
|
+
*
|
|
1709
|
+
* Only works for agents in 'active' status (not yet started).
|
|
1710
|
+
*
|
|
1711
|
+
* @param instanceId - The task agent instance ID
|
|
1712
|
+
* @returns Trigger result
|
|
1713
|
+
*
|
|
1714
|
+
* @example
|
|
1715
|
+
* ```typescript
|
|
1716
|
+
* // Deploy without auto-run
|
|
1717
|
+
* const { instance } = await wallet.deployTaskAgent({
|
|
1718
|
+
* name: 'Research',
|
|
1719
|
+
* prompt: 'Research AI trends',
|
|
1720
|
+
* budgetUsd: 5.00,
|
|
1721
|
+
* });
|
|
1722
|
+
*
|
|
1723
|
+
* // Later, trigger execution
|
|
1724
|
+
* await wallet.triggerTaskAgent(instance.id);
|
|
1725
|
+
* ```
|
|
1726
|
+
*/
|
|
1727
|
+
triggerTaskAgent(instanceId: string): Promise<{
|
|
1728
|
+
success: boolean;
|
|
1729
|
+
status: string;
|
|
1730
|
+
}>;
|
|
1731
|
+
/**
|
|
1732
|
+
* Cancel a JIT Task Agent.
|
|
1733
|
+
*
|
|
1734
|
+
* Stops execution and marks the task as cancelled.
|
|
1735
|
+
* Cannot cancel tasks that are already completed/failed.
|
|
1736
|
+
*
|
|
1737
|
+
* @param instanceId - The task agent instance ID
|
|
1738
|
+
* @returns Cancel result
|
|
1739
|
+
*
|
|
1740
|
+
* @example
|
|
1741
|
+
* ```typescript
|
|
1742
|
+
* await wallet.cancelTaskAgent('cuid_abc123');
|
|
1743
|
+
* console.log('Task cancelled');
|
|
1744
|
+
* ```
|
|
1745
|
+
*/
|
|
1746
|
+
cancelTaskAgent(instanceId: string): Promise<{
|
|
1747
|
+
success: boolean;
|
|
1748
|
+
status: string;
|
|
1749
|
+
}>;
|
|
1750
|
+
/**
|
|
1751
|
+
* List JIT Task Agents for the authenticated user.
|
|
1752
|
+
*
|
|
1753
|
+
* Returns deployed task agents with optional filtering by status,
|
|
1754
|
+
* plan, or task. Includes pagination and summary statistics.
|
|
1755
|
+
*
|
|
1756
|
+
* @param options - Optional filter and pagination parameters
|
|
1757
|
+
* @returns List of task agents with pagination and stats
|
|
1758
|
+
*
|
|
1759
|
+
* @example List all task agents
|
|
1760
|
+
* ```typescript
|
|
1761
|
+
* const { taskAgents, pagination, stats } = await wallet.listTaskAgents();
|
|
1762
|
+
* console.log(`${pagination.total} total agents, ${stats.active} active`);
|
|
1763
|
+
* ```
|
|
1764
|
+
*
|
|
1765
|
+
* @example Filter by status
|
|
1766
|
+
* ```typescript
|
|
1767
|
+
* const { taskAgents } = await wallet.listTaskAgents({ status: 'running' });
|
|
1768
|
+
* for (const agent of taskAgents) {
|
|
1769
|
+
* console.log(`${agent.name}: $${agent.budget.spentUsd}/$${agent.budget.totalUsd}`);
|
|
1770
|
+
* }
|
|
1771
|
+
* ```
|
|
1772
|
+
*
|
|
1773
|
+
* @example Filter by plan
|
|
1774
|
+
* ```typescript
|
|
1775
|
+
* const { taskAgents } = await wallet.listTaskAgents({ planId: 'plan_abc' });
|
|
1776
|
+
* ```
|
|
1777
|
+
*/
|
|
1778
|
+
listTaskAgents(options?: ListTaskAgentsOptions): Promise<ListTaskAgentsResult>;
|
|
1779
|
+
/**
|
|
1780
|
+
* Wait for a JIT Task Agent to complete.
|
|
1781
|
+
*
|
|
1782
|
+
* Polls the status until the task reaches a terminal state
|
|
1783
|
+
* (completed, failed, cancelled, budget_exceeded, expired).
|
|
1784
|
+
*
|
|
1785
|
+
* @param instanceId - The task agent instance ID
|
|
1786
|
+
* @param options - Wait options
|
|
1787
|
+
* @returns Final task result
|
|
1788
|
+
*
|
|
1789
|
+
* @example
|
|
1790
|
+
* ```typescript
|
|
1791
|
+
* const result = await wallet.waitForTaskAgent('cuid_abc123', {
|
|
1792
|
+
* pollIntervalMs: 2000,
|
|
1793
|
+
* timeoutMs: 300000, // 5 minutes
|
|
1794
|
+
* });
|
|
1795
|
+
*
|
|
1796
|
+
* if (result.status === 'completed') {
|
|
1797
|
+
* console.log('Result:', result.result);
|
|
1798
|
+
* } else {
|
|
1799
|
+
* console.log('Failed:', result.error);
|
|
1800
|
+
* }
|
|
1801
|
+
* ```
|
|
1802
|
+
*/
|
|
1803
|
+
waitForTaskAgent(instanceId: string, options?: WaitForTaskAgentOptions): Promise<TaskAgentResult>;
|
|
1804
|
+
/**
|
|
1805
|
+
* Parse task agent instance from API response.
|
|
1806
|
+
*/
|
|
1807
|
+
private parseTaskAgentInstance;
|
|
1808
|
+
/**
|
|
1809
|
+
* Parse task agent status from API response.
|
|
1810
|
+
*/
|
|
1811
|
+
private parseTaskAgentStatus;
|
|
1510
1812
|
/**
|
|
1511
1813
|
* Simple LLM completion - single-turn, no tools.
|
|
1512
1814
|
*
|
|
@@ -2303,6 +2605,115 @@ interface JitInstance {
|
|
|
2303
2605
|
/** Creation time */
|
|
2304
2606
|
createdAt: Date;
|
|
2305
2607
|
}
|
|
2608
|
+
/**
|
|
2609
|
+
* Options for using a skill
|
|
2610
|
+
*/
|
|
2611
|
+
interface UseSkillOptions {
|
|
2612
|
+
/** Time-to-live in hours for the MCP server (default: 24, max: 48) */
|
|
2613
|
+
ttlHours?: number;
|
|
2614
|
+
}
|
|
2615
|
+
/**
|
|
2616
|
+
* Result from using a skill
|
|
2617
|
+
*/
|
|
2618
|
+
interface UseSkillResult {
|
|
2619
|
+
/** Skill ID */
|
|
2620
|
+
skillId: string;
|
|
2621
|
+
/** MCP server endpoint URL */
|
|
2622
|
+
endpoint: string;
|
|
2623
|
+
/** Available tool names */
|
|
2624
|
+
tools: string[];
|
|
2625
|
+
/** When the MCP server expires */
|
|
2626
|
+
expiresAt: Date;
|
|
2627
|
+
/** JIT instance ID for reference */
|
|
2628
|
+
instanceId: string;
|
|
2629
|
+
}
|
|
2630
|
+
/**
|
|
2631
|
+
* Skill information from the skills list
|
|
2632
|
+
*/
|
|
2633
|
+
interface SkillInfo {
|
|
2634
|
+
/** Skill ID */
|
|
2635
|
+
id: string;
|
|
2636
|
+
/** Display name */
|
|
2637
|
+
name: string;
|
|
2638
|
+
/** Short description */
|
|
2639
|
+
description: string;
|
|
2640
|
+
/** Category */
|
|
2641
|
+
category: string;
|
|
2642
|
+
/** Category display name */
|
|
2643
|
+
categoryName: string;
|
|
2644
|
+
/** Icon name */
|
|
2645
|
+
icon: string;
|
|
2646
|
+
/** Whether this is a built-in skill */
|
|
2647
|
+
builtIn: boolean;
|
|
2648
|
+
/** Whether this skill requires MCP deployment */
|
|
2649
|
+
requiresMcp: boolean;
|
|
2650
|
+
/** Whether this skill is available */
|
|
2651
|
+
available: boolean;
|
|
2652
|
+
/** Configuration status */
|
|
2653
|
+
status: 'not_configured' | 'configured' | 'error';
|
|
2654
|
+
/** Last used timestamp */
|
|
2655
|
+
lastUsedAt?: string;
|
|
2656
|
+
/** Error message if status is 'error' */
|
|
2657
|
+
errorMessage?: string;
|
|
2658
|
+
/** Environment variables required */
|
|
2659
|
+
envVars: Array<{
|
|
2660
|
+
name: string;
|
|
2661
|
+
label: string;
|
|
2662
|
+
description: string;
|
|
2663
|
+
required: boolean;
|
|
2664
|
+
isSecret: boolean;
|
|
2665
|
+
configured: boolean;
|
|
2666
|
+
}>;
|
|
2667
|
+
}
|
|
2668
|
+
/**
|
|
2669
|
+
* Skill configuration status
|
|
2670
|
+
*/
|
|
2671
|
+
interface SkillStatus {
|
|
2672
|
+
/** Skill ID */
|
|
2673
|
+
skillId: string;
|
|
2674
|
+
/** Configuration status */
|
|
2675
|
+
status: 'not_configured' | 'configured' | 'error';
|
|
2676
|
+
/** Names of configured environment variables */
|
|
2677
|
+
configuredVars: string[];
|
|
2678
|
+
/** Last used timestamp */
|
|
2679
|
+
lastUsedAt?: Date;
|
|
2680
|
+
/** Error message if status is 'error' */
|
|
2681
|
+
errorMessage?: string;
|
|
2682
|
+
}
|
|
2683
|
+
/**
|
|
2684
|
+
* Connected apps information from Composio
|
|
2685
|
+
*/
|
|
2686
|
+
interface ConnectedAppsResult {
|
|
2687
|
+
/** Array of connected app IDs (e.g., ['gmail', 'slack', 'github']) */
|
|
2688
|
+
connected: string[];
|
|
2689
|
+
/** Full connection details */
|
|
2690
|
+
connections: Array<{
|
|
2691
|
+
id: string;
|
|
2692
|
+
app: string;
|
|
2693
|
+
app_name: string;
|
|
2694
|
+
type: 'oauth' | 'api_key';
|
|
2695
|
+
status: string;
|
|
2696
|
+
account_name: string | null;
|
|
2697
|
+
connected_at: string;
|
|
2698
|
+
}>;
|
|
2699
|
+
/** OAuth connections only */
|
|
2700
|
+
oauthConnections: Array<{
|
|
2701
|
+
id: string;
|
|
2702
|
+
app: string;
|
|
2703
|
+
app_name: string;
|
|
2704
|
+
status: string;
|
|
2705
|
+
account_name: string | null;
|
|
2706
|
+
connected_at: string;
|
|
2707
|
+
}>;
|
|
2708
|
+
/** API key connections only */
|
|
2709
|
+
apiKeyConnections: Array<{
|
|
2710
|
+
id: string;
|
|
2711
|
+
app: string;
|
|
2712
|
+
app_name: string;
|
|
2713
|
+
status: string;
|
|
2714
|
+
connected_at: string;
|
|
2715
|
+
}>;
|
|
2716
|
+
}
|
|
2306
2717
|
/**
|
|
2307
2718
|
* MCP server from the Glama directory
|
|
2308
2719
|
*/
|
|
@@ -2541,6 +2952,262 @@ interface AgentRunStatusResult {
|
|
|
2541
2952
|
/** When the run completed */
|
|
2542
2953
|
completedAt?: Date;
|
|
2543
2954
|
}
|
|
2955
|
+
/**
|
|
2956
|
+
* Options for deploying a JIT Task Agent
|
|
2957
|
+
*/
|
|
2958
|
+
interface DeployTaskAgentOptions {
|
|
2959
|
+
/** Display name for the task agent */
|
|
2960
|
+
name: string;
|
|
2961
|
+
/** The task prompt - what the agent should accomplish */
|
|
2962
|
+
prompt: string;
|
|
2963
|
+
/** Custom system prompt (optional) */
|
|
2964
|
+
systemPrompt?: string;
|
|
2965
|
+
/** LLM model to use (default: claude-sonnet-4-5) */
|
|
2966
|
+
model?: string;
|
|
2967
|
+
/** MCP tools to enable (e.g., ['platform/exa-search']) */
|
|
2968
|
+
tools?: string[];
|
|
2969
|
+
/** Budget cap in USD (min: $0.01, max: $1000) */
|
|
2970
|
+
budgetUsd: number;
|
|
2971
|
+
/** Time-to-live in hours (default: 24, max: 48) */
|
|
2972
|
+
ttlHours?: number;
|
|
2973
|
+
/** Maximum iterations (default: 10, max: 50) */
|
|
2974
|
+
maxIterations?: number;
|
|
2975
|
+
/** Optional plan ID for Mission Control integration */
|
|
2976
|
+
planId?: string;
|
|
2977
|
+
/** Optional task ID for Mission Control integration */
|
|
2978
|
+
taskId?: string;
|
|
2979
|
+
/** Idempotency key to prevent duplicate deploys */
|
|
2980
|
+
idempotencyKey?: string;
|
|
2981
|
+
/** Start execution immediately (default: false) */
|
|
2982
|
+
autoRun?: boolean;
|
|
2983
|
+
}
|
|
2984
|
+
/**
|
|
2985
|
+
* Result from deploying a JIT Task Agent
|
|
2986
|
+
*/
|
|
2987
|
+
interface DeployTaskAgentResult {
|
|
2988
|
+
/** The deployed task agent instance */
|
|
2989
|
+
instance: TaskAgentInstance;
|
|
2990
|
+
/** Whether this was an idempotent return */
|
|
2991
|
+
idempotent: boolean;
|
|
2992
|
+
/** Request ID for debugging */
|
|
2993
|
+
requestId: string;
|
|
2994
|
+
}
|
|
2995
|
+
/**
|
|
2996
|
+
* A deployed JIT Task Agent instance
|
|
2997
|
+
*/
|
|
2998
|
+
interface TaskAgentInstance {
|
|
2999
|
+
/** Unique instance ID */
|
|
3000
|
+
id: string;
|
|
3001
|
+
/** Display name */
|
|
3002
|
+
name: string;
|
|
3003
|
+
/** Base endpoint URL */
|
|
3004
|
+
endpointUrl: string;
|
|
3005
|
+
/** Status check URL */
|
|
3006
|
+
statusUrl: string;
|
|
3007
|
+
/** Trigger execution URL */
|
|
3008
|
+
triggerUrl: string;
|
|
3009
|
+
/** Cancel URL */
|
|
3010
|
+
cancelUrl: string;
|
|
3011
|
+
/** Result URL */
|
|
3012
|
+
resultUrl: string;
|
|
3013
|
+
/** Current status */
|
|
3014
|
+
status: string;
|
|
3015
|
+
/** Budget in USD */
|
|
3016
|
+
budgetUsd: number;
|
|
3017
|
+
/** When the instance expires */
|
|
3018
|
+
expiresAt: Date;
|
|
3019
|
+
/** Spawn depth (for nested agents) */
|
|
3020
|
+
depth: number;
|
|
3021
|
+
/** Maximum iterations allowed */
|
|
3022
|
+
maxIterations: number;
|
|
3023
|
+
}
|
|
3024
|
+
/**
|
|
3025
|
+
* Full status of a JIT Task Agent
|
|
3026
|
+
*/
|
|
3027
|
+
interface TaskAgentStatus {
|
|
3028
|
+
/** Unique instance ID */
|
|
3029
|
+
id: string;
|
|
3030
|
+
/** Display name */
|
|
3031
|
+
name: string;
|
|
3032
|
+
/** The task prompt */
|
|
3033
|
+
prompt: string;
|
|
3034
|
+
/** LLM model */
|
|
3035
|
+
model: string;
|
|
3036
|
+
/** Enabled tools */
|
|
3037
|
+
tools: string[];
|
|
3038
|
+
/** Current status */
|
|
3039
|
+
status: string;
|
|
3040
|
+
/** Budget tracking */
|
|
3041
|
+
budget: {
|
|
3042
|
+
totalUsd: number;
|
|
3043
|
+
spentUsd: number;
|
|
3044
|
+
remainingUsd: number;
|
|
3045
|
+
};
|
|
3046
|
+
/** Iteration tracking */
|
|
3047
|
+
iterations: {
|
|
3048
|
+
current: number;
|
|
3049
|
+
max: number;
|
|
3050
|
+
};
|
|
3051
|
+
/** Usage statistics */
|
|
3052
|
+
usage: {
|
|
3053
|
+
toolCalls: number;
|
|
3054
|
+
inputTokens: number;
|
|
3055
|
+
outputTokens: number;
|
|
3056
|
+
};
|
|
3057
|
+
/** Final result (if completed) */
|
|
3058
|
+
result?: string;
|
|
3059
|
+
/** Error message (if failed) */
|
|
3060
|
+
error?: string;
|
|
3061
|
+
/** Spawn depth */
|
|
3062
|
+
depth: number;
|
|
3063
|
+
/** Plan ID (if linked) */
|
|
3064
|
+
planId?: string;
|
|
3065
|
+
/** Task ID (if linked) */
|
|
3066
|
+
taskId?: string;
|
|
3067
|
+
/** Endpoint URLs */
|
|
3068
|
+
endpoints: {
|
|
3069
|
+
statusUrl: string;
|
|
3070
|
+
triggerUrl: string;
|
|
3071
|
+
cancelUrl: string;
|
|
3072
|
+
resultUrl: string;
|
|
3073
|
+
};
|
|
3074
|
+
/** TTL in hours */
|
|
3075
|
+
ttlHours: number;
|
|
3076
|
+
/** When the instance expires */
|
|
3077
|
+
expiresAt: Date;
|
|
3078
|
+
/** When the instance was created */
|
|
3079
|
+
createdAt: Date;
|
|
3080
|
+
/** When execution started */
|
|
3081
|
+
startedAt?: Date;
|
|
3082
|
+
/** When execution completed */
|
|
3083
|
+
completedAt?: Date;
|
|
3084
|
+
}
|
|
3085
|
+
/**
|
|
3086
|
+
* Options for waiting for a task agent to complete
|
|
3087
|
+
*/
|
|
3088
|
+
interface WaitForTaskAgentOptions {
|
|
3089
|
+
/** Poll interval in milliseconds (default: 2000) */
|
|
3090
|
+
pollIntervalMs?: number;
|
|
3091
|
+
/** Timeout in milliseconds (default: 300000 = 5 minutes) */
|
|
3092
|
+
timeoutMs?: number;
|
|
3093
|
+
}
|
|
3094
|
+
/**
|
|
3095
|
+
* Final result from a completed JIT Task Agent
|
|
3096
|
+
*/
|
|
3097
|
+
interface TaskAgentResult {
|
|
3098
|
+
/** Instance ID */
|
|
3099
|
+
id: string;
|
|
3100
|
+
/** Final status */
|
|
3101
|
+
status: 'completed' | 'failed' | 'cancelled' | 'budget_exceeded' | 'expired';
|
|
3102
|
+
/** Result text (if completed) */
|
|
3103
|
+
result?: string;
|
|
3104
|
+
/** Error message (if failed) */
|
|
3105
|
+
error?: string;
|
|
3106
|
+
/** Total USD spent */
|
|
3107
|
+
spentUsd: number;
|
|
3108
|
+
/** Number of iterations executed */
|
|
3109
|
+
iterations: number;
|
|
3110
|
+
/** Number of tool calls made */
|
|
3111
|
+
toolCalls: number;
|
|
3112
|
+
/** When execution completed */
|
|
3113
|
+
completedAt?: Date;
|
|
3114
|
+
}
|
|
3115
|
+
/**
|
|
3116
|
+
* Options for listing JIT Task Agents
|
|
3117
|
+
*/
|
|
3118
|
+
interface ListTaskAgentsOptions {
|
|
3119
|
+
/** Filter by status (e.g., 'running', 'completed', 'failed') */
|
|
3120
|
+
status?: string;
|
|
3121
|
+
/** Filter by plan ID */
|
|
3122
|
+
planId?: string;
|
|
3123
|
+
/** Filter by task ID */
|
|
3124
|
+
taskId?: string;
|
|
3125
|
+
/** Maximum results to return (default: 50, max: 100) */
|
|
3126
|
+
limit?: number;
|
|
3127
|
+
/** Pagination offset (default: 0) */
|
|
3128
|
+
offset?: number;
|
|
3129
|
+
}
|
|
3130
|
+
/**
|
|
3131
|
+
* Result from listing JIT Task Agents
|
|
3132
|
+
*/
|
|
3133
|
+
interface ListTaskAgentsResult {
|
|
3134
|
+
/** Array of task agents */
|
|
3135
|
+
taskAgents: TaskAgentListItem[];
|
|
3136
|
+
/** Pagination info */
|
|
3137
|
+
pagination: {
|
|
3138
|
+
total: number;
|
|
3139
|
+
limit: number;
|
|
3140
|
+
offset: number;
|
|
3141
|
+
hasMore: boolean;
|
|
3142
|
+
};
|
|
3143
|
+
/** Summary statistics */
|
|
3144
|
+
stats: {
|
|
3145
|
+
active: number;
|
|
3146
|
+
completed: number;
|
|
3147
|
+
failed: number;
|
|
3148
|
+
totalSpentUsd: number;
|
|
3149
|
+
};
|
|
3150
|
+
}
|
|
3151
|
+
/**
|
|
3152
|
+
* A task agent summary in a list response
|
|
3153
|
+
*/
|
|
3154
|
+
interface TaskAgentListItem {
|
|
3155
|
+
/** Unique instance ID */
|
|
3156
|
+
id: string;
|
|
3157
|
+
/** Display name */
|
|
3158
|
+
name: string;
|
|
3159
|
+
/** Task prompt (truncated to 200 chars) */
|
|
3160
|
+
prompt: string;
|
|
3161
|
+
/** LLM model */
|
|
3162
|
+
model: string;
|
|
3163
|
+
/** Enabled tools */
|
|
3164
|
+
tools: string[];
|
|
3165
|
+
/** Current status */
|
|
3166
|
+
status: string;
|
|
3167
|
+
/** Budget tracking */
|
|
3168
|
+
budget: {
|
|
3169
|
+
totalUsd: number;
|
|
3170
|
+
spentUsd: number;
|
|
3171
|
+
remainingUsd: number;
|
|
3172
|
+
};
|
|
3173
|
+
/** Iteration tracking */
|
|
3174
|
+
iterations: {
|
|
3175
|
+
current: number;
|
|
3176
|
+
max: number;
|
|
3177
|
+
};
|
|
3178
|
+
/** Usage statistics */
|
|
3179
|
+
usage: {
|
|
3180
|
+
toolCalls: number;
|
|
3181
|
+
inputTokens: number;
|
|
3182
|
+
outputTokens: number;
|
|
3183
|
+
};
|
|
3184
|
+
/** Final result (truncated to 500 chars, if completed) */
|
|
3185
|
+
result?: string;
|
|
3186
|
+
/** Error message (if failed) */
|
|
3187
|
+
error?: string;
|
|
3188
|
+
/** Spawn depth */
|
|
3189
|
+
depth: number;
|
|
3190
|
+
/** Linked plan (if any) */
|
|
3191
|
+
plan: {
|
|
3192
|
+
id: string;
|
|
3193
|
+
title: string;
|
|
3194
|
+
} | null;
|
|
3195
|
+
/** Linked task (if any) */
|
|
3196
|
+
task: {
|
|
3197
|
+
id: string;
|
|
3198
|
+
title: string;
|
|
3199
|
+
} | null;
|
|
3200
|
+
/** TTL in hours */
|
|
3201
|
+
ttlHours: number;
|
|
3202
|
+
/** When the instance expires */
|
|
3203
|
+
expiresAt: Date;
|
|
3204
|
+
/** When the instance was created */
|
|
3205
|
+
createdAt: Date;
|
|
3206
|
+
/** When execution started */
|
|
3207
|
+
startedAt?: Date;
|
|
3208
|
+
/** When execution completed */
|
|
3209
|
+
completedAt?: Date;
|
|
3210
|
+
}
|
|
2544
3211
|
|
|
2545
3212
|
/**
|
|
2546
3213
|
* MixrPay Agent SDK - Custom Errors
|
|
@@ -2982,4 +3649,4 @@ declare function isMixrPayError(error: unknown): error is MixrPayError;
|
|
|
2982
3649
|
*/
|
|
2983
3650
|
declare function getErrorMessage(error: unknown): string;
|
|
2984
3651
|
|
|
2985
|
-
export { type AgentClaimInviteOptions, type AgentClaimInviteResult, type AgentMessage, type AgentRunConfig, type AgentRunEvent, type AgentRunOptions, type AgentRunResult, type AgentRunStatusResult, AgentWallet, type AgentWalletConfig, type AvailableBudget, type CallMerchantApiOptions, type ChargeResult, type ChildSession, type CompleteOptions, type CompleteResult, type DeployJitMcpOptions, type DeployJitMcpResult, type DiagnosticsResult, type GlamaImportData, type GlamaSearchResult, type GlamaServer, InsufficientBalanceError, InvalidSessionKeyError, type JitInstance, MerchantNotAllowedError, MixrPayError, type PaymentEvent, PaymentFailedError, SDK_VERSION, type SessionAuthorization, SessionExpiredError, SessionKeyExpiredError, type SessionKeyInfo, SessionLimitExceededError, SessionNotFoundError, SessionRevokedError, type SessionStats, type SpawnChildOptions, type SpawnChildResult, SpendingLimitExceededError, type SpendingStats, X402ProtocolError, getErrorMessage, isMixrPayError };
|
|
3652
|
+
export { type AgentClaimInviteOptions, type AgentClaimInviteResult, type AgentMessage, type AgentRunConfig, type AgentRunEvent, type AgentRunOptions, type AgentRunResult, type AgentRunStatusResult, AgentWallet, type AgentWalletConfig, type AvailableBudget, type CallMerchantApiOptions, type ChargeResult, type ChildSession, type CompleteOptions, type CompleteResult, type DeployJitMcpOptions, type DeployJitMcpResult, type DiagnosticsResult, type GlamaImportData, type GlamaSearchResult, type GlamaServer, InsufficientBalanceError, InvalidSessionKeyError, type JitInstance, MerchantNotAllowedError, MixrPayError, type PaymentEvent, PaymentFailedError, SDK_VERSION, type SessionAuthorization, SessionExpiredError, SessionKeyExpiredError, type SessionKeyInfo, SessionLimitExceededError, SessionNotFoundError, SessionRevokedError, type SessionStats, type SkillInfo, type SkillStatus, type SpawnChildOptions, type SpawnChildResult, SpendingLimitExceededError, type SpendingStats, type UseSkillOptions, type UseSkillResult, X402ProtocolError, getErrorMessage, isMixrPayError };
|