stuntman 0.2.4 → 0.2.5

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 CHANGED
@@ -95,6 +95,8 @@ npx stuntman fund 0xTokenAddress 500
95
95
 
96
96
  ## Agent frameworks
97
97
 
98
+ Clone-and-run examples for each framework, plus plain Python, are in [`examples/`](examples).
99
+
98
100
  ### Virtuals GAME
99
101
 
100
102
  Virtuals GAME agents practice two ways. Agents whose plugins send their own transactions: sign the agent wallet up with `stuntman witness --key-env WALLET_PRIVATE_KEY` and point the plugin's `RPC_PROVIDER_URL` at the endpoint it prints. TypeScript GAME agents can also add Stuntman as a worker:
@@ -125,17 +127,37 @@ const agentkit = await AgentKit.from({
125
127
 
126
128
  The wallet provider is AgentKit's viem wallet on Robinhood Chain, pointed at a Stuntman endpoint: AgentKit transactions are practiced, never broadcast. `stuntman connect agentkit` prints the setup.
127
129
 
130
+ ### OpenAI Agents SDK
131
+
132
+ ```ts
133
+ import { stuntmanTools, PRACTICE_INSTRUCTIONS } from 'stuntman/openai'; // npm install stuntman @openai/agents zod
134
+ const agent = new Agent({ name: 'Trader', instructions: PRACTICE_INSTRUCTIONS, tools: await stuntmanTools({ endpoint }) });
135
+ ```
136
+
137
+ ### LangChain and LangGraph
138
+
139
+ ```ts
140
+ import { stuntmanTools, PRACTICE_INSTRUCTIONS } from 'stuntman/langchain'; // npm install stuntman langchain @langchain/core
141
+ const agent = createAgent({ model: 'openai:gpt-5', systemPrompt: PRACTICE_INSTRUCTIONS, tools: await stuntmanTools({ endpoint }) });
142
+ ```
143
+
144
+ Standard LangChain tools, so they also work in LangGraph's `ToolNode`.
145
+
128
146
  ### Priors
129
147
 
130
148
  Point Priors' MCP server at a Stuntman endpoint and its on-chain transactions (borrows, stock trades) are practiced, never broadcast. Keep `PRIORS_MAX_SPEND_USD=0` while practicing: `pay_url` pays over HTTPS, outside any RPC. Repaying a practice loan isn't carried forward yet. `stuntman connect priors` prints the setup, and every Stuntman record also shows the agent's Priors credit record.
131
149
 
132
150
  ### OpenClaw
133
151
 
134
- The Stuntman skill is in `skills/stuntman`. Until it is listed on ClawHub, copy that folder into `~/.openclaw/skills/`.
152
+ `npx stuntman connect openclaw --install` copies the Stuntman skill into `~/.openclaw/skills/stuntman` (pass `--dir` for another skills folder). The skill's source is in `skills/stuntman`.
153
+
154
+ ## Attesta GPU rentals
155
+
156
+ Attesta rents GPUs to agents, paid in USDG through Bull streams. Point the agent's Attesta base URL at `http://127.0.0.1:8545/attesta` (or `<witness endpoint>/attesta`) and its RPC at Stuntman. Catalog and quotes come from Attesta; sign-in, previews, launches and the Bull payments are practiced, and nothing reaches Attesta or the chain. Sending the same stream twice is refused, and closing early returns unvested practice USDG. `stuntman connect attesta` prints the setup.
135
157
 
136
158
  ## Witnessed practice
137
159
 
138
- Practice on your own machine is private, so nobody else can trust it. `stuntman witness` moves your agent's takes to Stuntman's server: each one is simulated at the latest block, signed by the witness and added to a public record at `stuntmanhq.xyz/a/<address>`. Takes are only ever added, never removed.
160
+ Every agent's first 25 witnessed takes are free. Practice on your own machine is private, so nobody else can trust it. `stuntman witness` moves your agent's takes to Stuntman's server: each one is simulated at the latest block, signed by the witness and added to a public record at `stuntmanhq.xyz/a/<address>`. Takes are only ever added, never removed.
139
161
 
140
162
  ```bash
141
163
  stuntman witness # sign up the practice account; the MCP tools switch over
@@ -151,7 +173,7 @@ Agents that send their own transactions use the printed endpoint as their RPC ad
151
173
  stuntman init --address <wallet> | --new [--rpc <url>] [--eth <amount>]
152
174
  stuntman mcp MCP server over stdio
153
175
  stuntman rpc [--port 8545] Practice RPC
154
- stuntman connect [claude|codex|json|raxol|virtuals|eliza|agentkit|openclaw|priors]
176
+ stuntman connect [claude|codex|json|raxol|virtuals|eliza|agentkit|openai|langchain|attesta|openclaw|priors]
155
177
  stuntman takes [--limit 20] [--json]
156
178
  stuntman take <id> [--json]
157
179
  stuntman balances [token ...]
package/dist/agentkit.js CHANGED
@@ -17,7 +17,7 @@ import { createRequire } from 'node:module';
17
17
  import { createWalletClient, defineChain, http } from 'viem';
18
18
  import { privateKeyToAccount } from 'viem/accounts';
19
19
  import { DEFAULT_CHAIN_ID } from './config.js';
20
- import { practiceActions } from './practice.js';
20
+ import { practiceTools } from './practice.js';
21
21
  const requireHere = createRequire(import.meta.url);
22
22
  async function loadAgentKit() {
23
23
  let path;
@@ -63,53 +63,5 @@ export async function stuntmanWalletProvider(options) {
63
63
  export async function stuntmanActionProvider(options = {}) {
64
64
  const endpoint = options.endpoint ?? process.env.STUNTMAN_ENDPOINT ?? DEFAULT_ENDPOINT;
65
65
  const { ak, z } = await loadAgentKit();
66
- const a = practiceActions(endpoint);
67
- const text = (out) => (typeof out === 'string' ? out : out.ok ? out.text : `Failed: ${out.text}`);
68
- const safe = (fn) => async (args) => {
69
- try {
70
- return text(await fn(args ?? {}));
71
- }
72
- catch (err) {
73
- return `Failed: ${err.message}`;
74
- }
75
- };
76
- return ak.customActionProvider([
77
- {
78
- name: 'stuntman_practice_status',
79
- description: 'Show the practice account on Robinhood Chain, recent practice results, and whether takes are witnessed on a public record. Every transaction this agent sends is practice: simulated, never broadcast.',
80
- schema: z.object({}),
81
- invoke: safe(() => a.status()),
82
- },
83
- {
84
- name: 'stuntman_practice_balances',
85
- description: 'Practice balances of ETH and tokens on Robinhood Chain. These are practice money, not real funds.',
86
- schema: z.object({}),
87
- invoke: safe(() => a.balances()),
88
- },
89
- {
90
- name: 'stuntman_practice_takes',
91
- description: 'Recent practice takes, newest first, with results and the reason for any failure.',
92
- schema: z.object({ limit: z.number().int().min(1).max(50).optional().describe('How many takes, up to 50. Default 10.') }),
93
- invoke: safe((args) => a.takes(Number(args.limit ?? 10))),
94
- },
95
- {
96
- name: 'stuntman_send_practice_transaction',
97
- description: 'Send any transaction in practice: simulated at the latest block of Robinhood Chain with practice money, never broadcast. Returns whether it filled and what changed.',
98
- schema: z.object({
99
- to: z.string().optional().describe('Contract or wallet address. Leave out to deploy a contract.'),
100
- data: z.string().optional().describe('Calldata as 0x hex. Leave out for a plain ETH send.'),
101
- value: z.string().optional().describe('ETH to send, in wei as a whole number.'),
102
- }),
103
- invoke: safe((args) => a.send(args.to, args.data, args.value)),
104
- },
105
- {
106
- name: 'stuntman_add_practice_money',
107
- description: 'Add practice money on a witness endpoint. It shows on the public record.',
108
- schema: z.object({
109
- asset: z.string().describe('ETH or a token address'),
110
- amount: z.string().describe('Amount in whole units, for example 1 or 250.5'),
111
- }),
112
- invoke: safe((args) => a.fund(args.asset, args.amount)),
113
- },
114
- ]);
66
+ return ak.customActionProvider(practiceTools(endpoint, z).map((t) => ({ name: t.name, description: t.description, schema: t.schema, invoke: t.run })));
115
67
  }