@balchemyai/agent-sdk 0.3.9 → 0.3.11
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/CHANGELOG.md +49 -2
- package/README.md +20 -1
- package/dist/index.d.ts +9 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -1
- package/dist/index.js.map +1 -1
- package/docs/DEPLOYMENT.md +6 -4
- package/docs/QUICKSTART.md +41 -30
- package/docs/partner-integration-checklist.md +16 -1
- package/docs/release-policy.md +8 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,48 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
+
## [0.3.11] — 2026-07-01
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Recover the `0.3.10` npm release by restoring the complete SDK root export
|
|
15
|
+
surface for `BalchemyClient`, `agentReadinessReport`, `agentContextSnapshot`,
|
|
16
|
+
`agentMarketBrief`, `agentCandidateReport`, and `agentRiskReport`.
|
|
17
|
+
- Keep the paired `balchemy` CLI dependency aligned with
|
|
18
|
+
`@balchemyai/agent-sdk@0.3.11`.
|
|
19
|
+
|
|
20
|
+
### Notes
|
|
21
|
+
|
|
22
|
+
- `0.3.10` was published with an incomplete SDK root export surface; consumers
|
|
23
|
+
should use `0.3.11` instead.
|
|
24
|
+
- No live-trade proof, Base live coverage, or source-owner payout rails are
|
|
25
|
+
claimed by this package release.
|
|
26
|
+
- Publish `@balchemyai/agent-sdk@0.3.11` before `balchemy@0.3.11` so the CLI
|
|
27
|
+
dependency resolves from npm semver.
|
|
28
|
+
|
|
29
|
+
## [0.3.10] — 2026-06-30
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
|
|
33
|
+
- Prepare the SDK and CLI package line for the next coordinated patch release.
|
|
34
|
+
- Align package examples and docs with default MCP exposure, safe read wrappers,
|
|
35
|
+
Hub Access, walletless setup, and live-armed fail-closed boundaries.
|
|
36
|
+
- Remove the CLI automatic npm registry update check from launch paths and stop
|
|
37
|
+
package docs/templates from suggesting global installs.
|
|
38
|
+
- Build CLI package output from a production `tsconfig` so package dist does not
|
|
39
|
+
include compiled test artifacts.
|
|
40
|
+
|
|
41
|
+
### Notes
|
|
42
|
+
|
|
43
|
+
- This is a release-prep source entry only. npm publish, public mirror sync, and
|
|
44
|
+
live package install proof remain separate release steps.
|
|
45
|
+
- The published `0.3.10` package pair has an incomplete SDK root export surface;
|
|
46
|
+
use `0.3.11` instead.
|
|
47
|
+
- No live-trade proof, Base live coverage, or source-owner payout rails are
|
|
48
|
+
claimed by this package release.
|
|
49
|
+
- Publish `@balchemyai/agent-sdk@0.3.10` before `balchemy@0.3.10` so the CLI
|
|
50
|
+
dependency resolves from npm semver.
|
|
51
|
+
|
|
10
52
|
## [0.3.7] — 2026-06-08
|
|
11
53
|
|
|
12
54
|
### Fixed
|
|
@@ -221,8 +263,13 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|
|
221
263
|
- `getIdentityTokenRevokeStatus()` — check revocation status
|
|
222
264
|
- `connectMcp()` — instantiate a typed MCP client
|
|
223
265
|
- `BalchemyMcpClient` — JSON-RPC MCP client with automatic retry and SSE envelope parsing
|
|
224
|
-
-
|
|
225
|
-
|
|
266
|
+
- Historical early typed helpers were narrowed in later releases. Current
|
|
267
|
+
public convenience methods are the safe helper surface: `askBot`,
|
|
268
|
+
`agentStatus`, `agentReadinessReport`, `agentContextSnapshot`,
|
|
269
|
+
`agentMarketBrief`, `agentCandidateReport`, and `agentRiskReport`.
|
|
270
|
+
- Direct quote, swap, wallet mutation, and privileged instruction helpers are
|
|
271
|
+
not exposed as typed public SDK methods. Use `tools/list` and `callTool()`
|
|
272
|
+
for the current scoped MCP surface.
|
|
226
273
|
- `requestSeed()` — disabled stub (throws `AgentSdkError` deterministically)
|
|
227
274
|
- `listTools()`, `callTool()`, `ping()`
|
|
228
275
|
- `connectMcp()` — factory shortcut for `BalchemyMcpClient`
|
package/README.md
CHANGED
|
@@ -8,6 +8,15 @@ Balchemy does not ask an inner model to make trade decisions. Your outer LLM
|
|
|
8
8
|
chooses tools. Balchemy checks policy, executes through the authorized path, and
|
|
9
9
|
keeps the record.
|
|
10
10
|
|
|
11
|
+
## Release Line
|
|
12
|
+
|
|
13
|
+
This source tree is prepared for `@balchemyai/agent-sdk@0.3.11`. npm publish,
|
|
14
|
+
public mirror sync, and live package installation proof happen in separate
|
|
15
|
+
release steps; this README does not claim that `0.3.11` has already been
|
|
16
|
+
published.
|
|
17
|
+
|
|
18
|
+
`0.3.11` fixes the incomplete SDK root export surface shipped in `0.3.10`.
|
|
19
|
+
|
|
11
20
|
## Install
|
|
12
21
|
|
|
13
22
|
```sh
|
|
@@ -24,6 +33,9 @@ const sdk = new BalchemyAgentSdk({
|
|
|
24
33
|
});
|
|
25
34
|
```
|
|
26
35
|
|
|
36
|
+
`BalchemyClient` is exported as an alias for `BalchemyAgentSdk` for consumers
|
|
37
|
+
that use the shorter root import name.
|
|
38
|
+
|
|
27
39
|
`apiBaseUrl` includes `/api` and has no trailing slash.
|
|
28
40
|
|
|
29
41
|
## Auth Path 1: SIWE
|
|
@@ -126,12 +138,19 @@ hidden unless they are returned by `tools/list` for that bot.
|
|
|
126
138
|
|
|
127
139
|
Use `agent_status` for read-scope runtime state. Safe read wrappers are
|
|
128
140
|
`agent_context_snapshot`, `agent_market_brief`, `agent_candidate_report`, and
|
|
129
|
-
`agent_risk_report`. Runtime mutation uses manage-scope `agent_control`.
|
|
141
|
+
`agent_risk_report`. Runtime mutation uses manage-scope `agent_control`. The SDK
|
|
142
|
+
root also exports `agentReadinessReport`, `agentContextSnapshot`,
|
|
143
|
+
`agentMarketBrief`, `agentCandidateReport`, and `agentRiskReport` helpers that
|
|
144
|
+
delegate to a connected `BalchemyMcpClient`.
|
|
130
145
|
|
|
131
146
|
`AgentLoop` fails closed before `trade_command`: local `shadowMode=false` is not
|
|
132
147
|
enough. The backend runtime must report `autonomous_runtime.mode=live_armed`,
|
|
133
148
|
`armed=true`, and `paused=false` from a fresh `agent_status` response.
|
|
134
149
|
|
|
150
|
+
The public SDK does not claim live-trade proof, Base live coverage, or
|
|
151
|
+
source-owner payout rails. Treat those as runtime/backend facts that must be
|
|
152
|
+
verified from current advertised tools and production evidence before use.
|
|
153
|
+
|
|
135
154
|
## Errors
|
|
136
155
|
|
|
137
156
|
All SDK methods throw `AgentSdkError` on failure.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { BalchemyMcpClient } from "./mcp/mcp-client";
|
|
2
|
-
import type {
|
|
2
|
+
import type { AgentAssetReportArgs, AgentMarketBriefArgs, AgentReadinessReportArgs, SafeToolSessionArgs } from "./mcp/mcp-client";
|
|
3
|
+
import type { AgentSdkConfig, IdentityTokenRevokeResponse, IdentityTokenRevokeStatusInput, McpCallToolResponse, OnboardWithIdentityInput, OnboardWithSiweInput, OnboardingResponse, RevokeIdentityTokenInput, RequestSiweNonceInput, SiweNonceResponse } from "./types";
|
|
3
4
|
export type { AgentSdkConfig, AgentOnboardingMode, AgentScope, IdentityAccess, OnboardWithIdentityInput, OnboardWithSiweInput, OnboardingResponse, RevokeIdentityTokenInput, IdentityTokenRevokeStatusInput, IdentityTokenRevokeResponse, RequestSiweNonceInput, SiweNonceResponse, McpTool, McpListToolsResponse, McpCallToolResponse, AgentResponse, McpToolExtensions, McpToolWithMetadata, } from "./types";
|
|
4
5
|
export type { AgentSdkErrorCode } from "./errors/error-codes";
|
|
5
6
|
export { AgentSdkError } from "./errors/agent-sdk-error";
|
|
6
7
|
export { BalchemyMcpClient, connectMcp, getToolText, parseToolJson, isToolError } from "./mcp/mcp-client";
|
|
7
|
-
export type { AskBotArgs, McpBatchToolCallInput, McpBatchToolCallResult, McpHealthResponse, } from "./mcp/mcp-client";
|
|
8
|
+
export type { AgentAssetReportArgs, AgentMarketBriefArgs, AgentReadinessReportArgs, AskBotArgs, McpBatchToolCallInput, McpBatchToolCallResult, McpHealthResponse, SafeToolSessionArgs, } from "./mcp/mcp-client";
|
|
8
9
|
export { SseEventStream } from "./streaming/sse-event-stream";
|
|
9
10
|
export type { SseEvent, SseStreamOptions } from "./streaming/sse-event-stream";
|
|
10
11
|
export type { StoredToken, TokenRefreshFn, TokenStoreOptions, } from "./auth/token-store";
|
|
@@ -18,6 +19,11 @@ export { AnthropicAdapter } from './agent-loop/llm-adapters/anthropic';
|
|
|
18
19
|
export { checkTradeAmount, checkTradeRate, checkAllRules } from './agent-loop/rule-checker';
|
|
19
20
|
export type { RuleCheckResult } from './agent-loop/rule-checker';
|
|
20
21
|
export type { AgentLoopConfig, AgentStatus, AgentLoopStatus, AgentEvent, AgentDecision, BehaviorRuleLimits, LlmAdapter, LlmMessage, LlmResponse, LlmProvider, } from './agent-loop/types';
|
|
22
|
+
export declare function agentReadinessReport(client: BalchemyMcpClient, args?: AgentReadinessReportArgs): Promise<McpCallToolResponse>;
|
|
23
|
+
export declare function agentContextSnapshot(client: BalchemyMcpClient, args?: SafeToolSessionArgs): Promise<McpCallToolResponse>;
|
|
24
|
+
export declare function agentMarketBrief(client: BalchemyMcpClient, args?: AgentMarketBriefArgs): Promise<McpCallToolResponse>;
|
|
25
|
+
export declare function agentCandidateReport(client: BalchemyMcpClient, args: AgentAssetReportArgs): Promise<McpCallToolResponse>;
|
|
26
|
+
export declare function agentRiskReport(client: BalchemyMcpClient, args: AgentAssetReportArgs): Promise<McpCallToolResponse>;
|
|
21
27
|
export declare class BalchemyAgentSdk {
|
|
22
28
|
private readonly onboarding;
|
|
23
29
|
constructor(config: AgentSdkConfig);
|
|
@@ -33,4 +39,5 @@ export declare class BalchemyAgentSdk {
|
|
|
33
39
|
fetchFn?: typeof fetch;
|
|
34
40
|
}): BalchemyMcpClient;
|
|
35
41
|
}
|
|
42
|
+
export { BalchemyAgentSdk as BalchemyClient };
|
|
36
43
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAc,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAK,EACV,cAAc,EACd,2BAA2B,EAC3B,8BAA8B,EAC9B,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAClB,wBAAwB,EACxB,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB,YAAY,EACV,cAAc,EACd,mBAAmB,EACnB,UAAU,EACV,cAAc,EACd,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAClB,wBAAwB,EACxB,8BAA8B,EAC9B,2BAA2B,EAC3B,qBAAqB,EACrB,iBAAiB,EACjB,OAAO,EACP,oBAAoB,EACpB,mBAAmB,EACnB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC1G,YAAY,EACV,UAAU,EACV,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAc,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EACV,cAAc,EACd,2BAA2B,EAC3B,8BAA8B,EAC9B,mBAAmB,EACn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AC;IAIxB,mBAAmB,CACvB,KAAK,EAAE,wBAAwB,GAC9B,OAAO,CAAC,2BAA2B,CAAC;IAIjC,4BAA4B,CAChC,KAAK,EAAE,8BAA8B,GACpC,OAAO,CAAC,2BAA2B,CAAC;IAIvC,UAAU,CAAC,MAAM,EAAE;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,OAAO,KAAK,CAAC;KACxB,GAAG,iBAAiB;CAGtB;AAED,OAAO,EAAE,gBAAgB,IAAI,cAAc,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BalchemyAgentSdk = exports.checkAllRules = exports.checkTradeRate = exports.checkTradeAmount = exports.AnthropicAdapter = exports.OpenAiAdapter = exports.WebhookReceiver = exports.DecisionHandler = exports.LlmCostTracker = exports.AgentLoop = exports.TokenStore = exports.SseEventStream = exports.isToolError = exports.parseToolJson = exports.getToolText = exports.connectMcp = exports.BalchemyMcpClient = exports.AgentSdkError = void 0;
|
|
3
|
+
exports.BalchemyClient = exports.BalchemyAgentSdk = exports.checkAllRules = exports.checkTradeRate = exports.checkTradeAmount = exports.AnthropicAdapter = exports.OpenAiAdapter = exports.WebhookReceiver = exports.DecisionHandler = exports.LlmCostTracker = exports.AgentLoop = exports.TokenStore = exports.SseEventStream = exports.isToolError = exports.parseToolJson = exports.getToolText = exports.connectMcp = exports.BalchemyMcpClient = exports.AgentSdkError = void 0;
|
|
4
|
+
exports.agentReadinessReport = agentReadinessReport;
|
|
5
|
+
exports.agentContextSnapshot = agentContextSnapshot;
|
|
6
|
+
exports.agentMarketBrief = agentMarketBrief;
|
|
7
|
+
exports.agentCandidateReport = agentCandidateReport;
|
|
8
|
+
exports.agentRiskReport = agentRiskReport;
|
|
4
9
|
const http_client_1 = require("./client/http-client");
|
|
5
10
|
const onboarding_1 = require("./auth/onboarding");
|
|
6
11
|
const mcp_client_1 = require("./mcp/mcp-client");
|
|
@@ -33,6 +38,21 @@ var rule_checker_1 = require("./agent-loop/rule-checker");
|
|
|
33
38
|
Object.defineProperty(exports, "checkTradeAmount", { enumerable: true, get: function () { return rule_checker_1.checkTradeAmount; } });
|
|
34
39
|
Object.defineProperty(exports, "checkTradeRate", { enumerable: true, get: function () { return rule_checker_1.checkTradeRate; } });
|
|
35
40
|
Object.defineProperty(exports, "checkAllRules", { enumerable: true, get: function () { return rule_checker_1.checkAllRules; } });
|
|
41
|
+
function agentReadinessReport(client, args = {}) {
|
|
42
|
+
return client.agentReadinessReport(args);
|
|
43
|
+
}
|
|
44
|
+
function agentContextSnapshot(client, args = {}) {
|
|
45
|
+
return client.agentContextSnapshot(args);
|
|
46
|
+
}
|
|
47
|
+
function agentMarketBrief(client, args = {}) {
|
|
48
|
+
return client.agentMarketBrief(args);
|
|
49
|
+
}
|
|
50
|
+
function agentCandidateReport(client, args) {
|
|
51
|
+
return client.agentCandidateReport(args);
|
|
52
|
+
}
|
|
53
|
+
function agentRiskReport(client, args) {
|
|
54
|
+
return client.agentRiskReport(args);
|
|
55
|
+
}
|
|
36
56
|
class BalchemyAgentSdk {
|
|
37
57
|
onboarding;
|
|
38
58
|
constructor(config) {
|
|
@@ -64,4 +84,5 @@ class BalchemyAgentSdk {
|
|
|
64
84
|
}
|
|
65
85
|
}
|
|
66
86
|
exports.BalchemyAgentSdk = BalchemyAgentSdk;
|
|
87
|
+
exports.BalchemyClient = BalchemyAgentSdk;
|
|
67
88
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;A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's "Background Worker" service type (not Web Servi
|
|
|
104
104
|
|
|
105
105
|
If you prefer to run the agent directly as a system service:
|
|
106
106
|
|
|
107
|
-
**1. Install
|
|
107
|
+
**1. Install locally in the agent directory:**
|
|
108
108
|
|
|
109
109
|
```bash
|
|
110
|
-
|
|
110
|
+
cd /home/ubuntu/agent
|
|
111
|
+
npm init -y
|
|
112
|
+
npm install --omit=dev balchemy@0.3.11 @balchemyai/agent-sdk@0.3.11
|
|
111
113
|
```
|
|
112
114
|
|
|
113
115
|
**2. Create a systemd unit file:**
|
|
@@ -122,7 +124,7 @@ After=network.target
|
|
|
122
124
|
Type=simple
|
|
123
125
|
User=ubuntu
|
|
124
126
|
WorkingDirectory=/home/ubuntu/agent
|
|
125
|
-
ExecStart=/
|
|
127
|
+
ExecStart=/home/ubuntu/agent/node_modules/.bin/balchemy start /home/ubuntu/agent/agent.config.yaml
|
|
126
128
|
EnvironmentFile=/home/ubuntu/agent/.env
|
|
127
129
|
Restart=always
|
|
128
130
|
RestartSec=10
|
|
@@ -186,7 +188,7 @@ logging:
|
|
|
186
188
|
|
|
187
189
|
**Agent starts but makes no decisions:**
|
|
188
190
|
- Verify your API key has `trade` scope (Hub > API Keys > Scopes)
|
|
189
|
-
- Check that
|
|
191
|
+
- Check that setup is complete and the backend reports the expected runtime mode
|
|
190
192
|
- Lower `min_confidence` in `behavior_rules`
|
|
191
193
|
|
|
192
194
|
**Budget exhausted quickly:**
|
package/docs/QUICKSTART.md
CHANGED
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
# Balchemy Agent — Quickstart
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Connect a local CLI/SDK runner to a Balchemy Hub agent in under 5 minutes.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
## Prerequisites
|
|
8
8
|
|
|
9
9
|
- Node.js 18+ (or Docker)
|
|
10
|
-
- A Balchemy account with at least one agent
|
|
11
|
-
|
|
10
|
+
- A Balchemy account with at least one Hub agent, or an explicit walletless
|
|
11
|
+
onboarding flow
|
|
12
|
+
- A scoped MCP/API key from Hub > Agents > your agent > Access/API Keys
|
|
12
13
|
- An LLM API key (Anthropic or OpenAI)
|
|
13
14
|
|
|
14
15
|
---
|
|
15
16
|
|
|
16
|
-
## Step 1: Create
|
|
17
|
+
## Step 1: Create or select a Hub agent
|
|
17
18
|
|
|
18
19
|
1. Go to [balchemy.ai](https://balchemy.ai) and sign in
|
|
19
20
|
2. Open Hub > Agents > New Agent
|
|
20
|
-
3. Complete the setup wizard
|
|
21
|
-
4.
|
|
22
|
-
5.
|
|
21
|
+
3. Complete the setup wizard enough to create the agent and runtime state
|
|
22
|
+
4. Open the agent Access/API key flow
|
|
23
|
+
5. Copy the MCP endpoint: `https://api.balchemy.ai/mcp/YOUR_PUBLIC_ID`
|
|
24
|
+
6. Generate a scoped API key and copy it (shown once)
|
|
23
25
|
|
|
24
26
|
---
|
|
25
27
|
|
|
@@ -30,36 +32,41 @@ npx balchemy
|
|
|
30
32
|
```
|
|
31
33
|
|
|
32
34
|
The wizard asks:
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
- Strategy preset
|
|
35
|
+
- LLM provider, API key, and model
|
|
36
|
+
- New walletless agent or existing MCP endpoint/API key
|
|
37
|
+
- Strategy preset and natural-language behavior rules
|
|
38
|
+
- Whether to open the local cockpit
|
|
38
39
|
|
|
39
|
-
|
|
40
|
+
New walletless agents are provisioned first. Root/recovery wallet binding and
|
|
41
|
+
chain-specific setup happen later through the authenticated MCP setup flow.
|
|
42
|
+
Existing agents can be resumed from the encrypted local agent store.
|
|
40
43
|
|
|
41
44
|
---
|
|
42
45
|
|
|
43
|
-
## Step 3: Start the
|
|
46
|
+
## Step 3: Start the local runner
|
|
44
47
|
|
|
45
48
|
```bash
|
|
46
49
|
npx balchemy start
|
|
47
50
|
```
|
|
48
51
|
|
|
49
|
-
You should see:
|
|
50
|
-
|
|
51
|
-
```
|
|
52
|
-
Starting Balchemy agent from: /path/to/agent.config.yaml
|
|
53
|
-
[agent] Running. Press Ctrl+C to stop.
|
|
54
|
-
[agent] status=running events=0 decisions=0 trades=0 llmCost=$0.0000/5
|
|
55
|
-
```
|
|
56
|
-
|
|
57
52
|
The agent:
|
|
58
53
|
1. Connects to the Balchemy SSE event stream
|
|
59
54
|
2. Receives market signals and platform events
|
|
60
|
-
3.
|
|
61
|
-
|
|
62
|
-
|
|
55
|
+
3. Fetches fresh `agent_status` and behavior rules before asking your LLM to
|
|
56
|
+
decide whether to buy, sell, hold, block, or mark data degraded
|
|
57
|
+
4. Blocks trade calls in `shadow`, `live_unarmed`, `paused`, stale status, or
|
|
58
|
+
missing-rule states
|
|
59
|
+
5. Calls `trade_command` only when local live mode and backend runtime are both
|
|
60
|
+
live-armed and the policy/approval path allows it
|
|
61
|
+
6. Can be monitored and adjusted through the Balchemy CLI cockpit (`npx balchemy`)
|
|
62
|
+
|
|
63
|
+
`shadow_mode` remains the safe default. Setting local `shadow_mode: false` is
|
|
64
|
+
not enough to trade; the backend must report `autonomous_runtime.mode` as
|
|
65
|
+
`live_armed`, `armed=true`, and `paused=false`.
|
|
66
|
+
|
|
67
|
+
This quickstart does not claim live-trade proof, Base live coverage, or
|
|
68
|
+
source-owner payout rails. Verify those from current runtime/backend evidence
|
|
69
|
+
before relying on them.
|
|
63
70
|
|
|
64
71
|
---
|
|
65
72
|
|
|
@@ -83,11 +90,6 @@ The generated `docker-compose.yml` runs the agent with:
|
|
|
83
90
|
```typescript
|
|
84
91
|
import { AgentLoop } from '@balchemyai/agent-sdk';
|
|
85
92
|
|
|
86
|
-
// From YAML config file
|
|
87
|
-
const loop = AgentLoop.fromConfig('./agent.config.yaml');
|
|
88
|
-
await loop.start();
|
|
89
|
-
|
|
90
|
-
// Or inline config
|
|
91
93
|
const statusEvents: string[] = [];
|
|
92
94
|
const decisionEvents: unknown[] = [];
|
|
93
95
|
const errorEvents: string[] = [];
|
|
@@ -106,6 +108,15 @@ const loop2 = new AgentLoop({
|
|
|
106
108
|
await loop2.start();
|
|
107
109
|
```
|
|
108
110
|
|
|
111
|
+
The SDK constructs `AgentLoop` from explicit config. Use `npx balchemy start`
|
|
112
|
+
when you want the CLI to load `agent.config.yaml` for you.
|
|
113
|
+
|
|
114
|
+
For read-first integrations, use `connectMcp()`/`listTools()` and call only the
|
|
115
|
+
runtime-advertised tools. Safe read wrappers include `agent_status`,
|
|
116
|
+
`agent_context_snapshot`, `agent_market_brief`, `agent_candidate_report`, and
|
|
117
|
+
`agent_risk_report`. Raw provider, approval, withdrawal, swap-bypass, and
|
|
118
|
+
privileged manage surfaces are not public SDK helpers.
|
|
119
|
+
|
|
109
120
|
---
|
|
110
121
|
|
|
111
122
|
## Strategy presets
|
|
@@ -11,7 +11,11 @@
|
|
|
11
11
|
- [ ] Enable at least one onboarding mode (`siwe` or `walletless`)
|
|
12
12
|
- [ ] Verify `POST /api/public/erc8004/onboarding/siwe`
|
|
13
13
|
- [ ] Verify `POST /api/public/erc8004/onboarding/identity` (if walletless enabled)
|
|
14
|
-
- [ ]
|
|
14
|
+
- [ ] For Hub-managed agents, use the Hub agent Access/API key flow and the
|
|
15
|
+
returned `POST /mcp/{publicId}` endpoint
|
|
16
|
+
- [ ] For walletless onboarding, complete the explicit MCP flow:
|
|
17
|
+
`walletless/init` -> `walletless/provision` -> `walletless/bind-wallet`
|
|
18
|
+
-> `setup_agent`
|
|
15
19
|
- [ ] Validate replay protection (token/jti reuse rejection)
|
|
16
20
|
|
|
17
21
|
## Headers and Claims
|
|
@@ -25,6 +29,17 @@
|
|
|
25
29
|
- [ ] Onboarding route limits configured and monitored
|
|
26
30
|
- [ ] Discovery feed and health endpoint limits configured
|
|
27
31
|
|
|
32
|
+
## MCP Exposure Boundaries
|
|
33
|
+
|
|
34
|
+
- [ ] Treat `balchemy-backend/src/core/tools/mcp-exposure.policy.ts` as the
|
|
35
|
+
public MCP exposure source of truth
|
|
36
|
+
- [ ] Confirm default public tools and granular read-only tools are distinct
|
|
37
|
+
- [ ] Do not document raw provider, wallet mutation, withdrawal, approval,
|
|
38
|
+
swap-bypass, or privileged manage helpers as public SDK APIs unless they
|
|
39
|
+
are advertised by `tools/list` for the caller and scope
|
|
40
|
+
- [ ] Confirm live actions fail closed unless the backend runtime is
|
|
41
|
+
`live_armed`, `armed=true`, `paused=false`, and policy/approval gates pass
|
|
42
|
+
|
|
28
43
|
## Operational
|
|
29
44
|
|
|
30
45
|
- [ ] JWKS endpoint reachable (`/.well-known/jwks.json`)
|
package/docs/release-policy.md
CHANGED
|
@@ -17,6 +17,14 @@
|
|
|
17
17
|
2. Onboarding smoke examples updated.
|
|
18
18
|
3. Changelog entry added.
|
|
19
19
|
4. Backward compatibility review complete for public exports.
|
|
20
|
+
5. Package build output resolves every exported path and CLI bin.
|
|
21
|
+
6. `npm pack --dry-run --json` or equivalent package preview passes.
|
|
22
|
+
7. Clean install/import smoke passes in an approved container, VPS, or CI
|
|
23
|
+
context.
|
|
24
|
+
|
|
25
|
+
Publishing is not complete until the npm publish goal succeeds and the registry
|
|
26
|
+
serves the intended versions. Release-prep commits must not claim publish
|
|
27
|
+
completion.
|
|
20
28
|
|
|
21
29
|
## Deprecation Rule
|
|
22
30
|
|