@stratabook/mcp 0.2.9 → 0.2.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 ADDED
@@ -0,0 +1,118 @@
1
+ # Changelog
2
+
3
+ All notable changes to the Strata SDKs (`@stratabook/sdk`, `@stratabook/mcp`,
4
+ and the `strata-sdk` Rust crate) are recorded here. Versions move together.
5
+
6
+ ## 0.2.11
7
+
8
+ - Consume the exact TypeScript SDK 0.2.11 release containing the installed
9
+ maker-conformance CLI entrypoint fix.
10
+ - Make the zero-credential read-only path explicit in MCP initialization:
11
+ markets, books, marks, candles, trades, quotes, public portfolios, and maker
12
+ reads work immediately. Agents must not request session secrets in chat or
13
+ begin write onboarding unless the user asks to trade.
14
+
15
+ ## 0.2.10
16
+
17
+ - Consume the matching SDK conformance release. The safe deployment gate now
18
+ exercises hosted MCP discovery, maker reads, and fresh-request Strand and
19
+ Current preparations after every activation; funded mode proves the
20
+ restart-safe prepare/submit path with a real externally signed Current.
21
+
22
+ ## 0.2.9
23
+
24
+ - Correct the maker preparation terminology inherited from the SDK:
25
+ `transaction_version=0` is browser-safe native Solana v0, not legacy.
26
+ Runtime behavior is unchanged from 0.2.8.
27
+
28
+ ## 0.2.8
29
+
30
+ - Consume `@stratabook/sdk` 0.2.8 so hosted maker quickstarts request
31
+ browser-safe native-v0 preparations compatible with external wallets.
32
+
33
+ ## 0.2.7
34
+
35
+ - Consume `@stratabook/sdk` 0.2.7 so maker quickstarts accept the human base
36
+ symbol from the selected market label, including `SOL` for `SOL/USDC`, and
37
+ inherit its post-sign transaction-message invariant.
38
+
39
+ ## 0.2.6
40
+
41
+ - Carry verified maker preparations across stateless HTTP requests with the
42
+ returned `preparationToken`; submit validates all market, product, wallet,
43
+ operation, transaction, and control-ID bindings before using it.
44
+ - Add both maker quickstart tools to the canonical machine-readable harness.
45
+
46
+ ## 0.2.5
47
+
48
+ - Add `strata_market_making_prepare` and
49
+ `strata_market_making_submit_and_wait`. Agents now provide a market label,
50
+ product, spread, decimal base size, and duration, sign one exact transaction
51
+ externally, and receive chain-derived confirmation without managing arrays,
52
+ atoms, opaque IDs, tick math, or expiry slots.
53
+
54
+ ## 0.2.2
55
+
56
+ - Correct every Strand exposure and level-size tool input from `BaseLots` to
57
+ `BaseAtoms` so agents receive the actual on-chain unit.
58
+ - State explicitly that positive base-atom amounts are valid order sizes and
59
+ the market price denominator is not a minimum order size.
60
+
61
+ ## 0.2.0
62
+
63
+ The unattended-agent release: an external agent can now onboard, hold one
64
+ balance across markets, trade instantly under a user-owned safety slider, and see the book it
65
+ trades into — all without a human signing each action, and without any venue,
66
+ route, or pool ever crossing the boundary.
67
+
68
+ ### Onboarding & signing
69
+ - **One-signature onboarding.** `vault.setup` works for every user-bounded
70
+ market — register a capped, revocable session key with a single wallet
71
+ signature; the first deposit registers the session in the same owner-signed
72
+ transaction.
73
+ - **One signature per action.** `orders.prepare`, `algos.twap.prepare`, and
74
+ `execution.prepare` accept the operation itself and build immediately — the
75
+ session's transaction signature is the whole authorization. The signed-
76
+ challenge form still works. SDK one-call helpers (`orders.execute`,
77
+ `algos.execute`, `executeQuote`) sign and submit in one call with a built-in
78
+ transaction verifier; `sessionSignerFromSecretKey` turns a session secret
79
+ into a ready signer.
80
+ - **Sponsored Vault lifecycle** (`vault.relay`): the owner needs no SOL and no
81
+ RPC; Strata pays the fee (and pre-funds rent) when the wallet is low and
82
+ recovers exactly what it spent from later deposits, Jupiter-style.
83
+
84
+ ### Reads
85
+ - **One account read.** `GET /v2/account/{wallet}/portfolio` — balances,
86
+ positions, open orders, and recent fills across every live market in one
87
+ public read by wallet address (`account`/`portfolio`, `strata_portfolio`).
88
+ - **Order book, best bid/ask, and recent trades in MCP** — `strata_book`,
89
+ `strata_bbo`, `strata_trades` (already in the SDK `books` module).
90
+ - **Maker reads public by wallet** — status, reputation, and the fills stream
91
+ need no signature.
92
+ - **Exact-output market quotes** ("buy at least 1 SOL"): `amount_out_atoms` on
93
+ the same quote handle and execution flow.
94
+ - Sequenced **execution**, **TWAP**, and **maker fill** streams.
95
+
96
+ ### Autonomy (MCP)
97
+ - **Session-autonomy slider.** With a session key in the MCP's env
98
+ (`STRATA_SESSION_SECRET_KEY` + `STRATA_OWNER_WALLET`), `strata_execute_quote`,
99
+ `strata_order_execute`, and `strata_twap_execute` sign and submit within
100
+ `STRATA_AUTONOMY` = `ask` (default; prepare only) / `limits` (up to
101
+ `STRATA_AUTONOMY_MAX_USD_PER_TRADE` / `_PER_DAY` / `_MARKETS`) / `instant`.
102
+ `strata_autonomy` is read-only; nothing an agent calls raises its own
103
+ autonomy. Withdraw/policy/pause/revoke stay owner-only.
104
+
105
+ ### Other
106
+ - `strata_markets` carries each market's opaque `market_id` and asset ids.
107
+ - Account sequence is optional (server-resolved).
108
+ - Tolerance is named `maximum_tolerance_bps` and echoed on every quote (never
109
+ conflated with price impact).
110
+ - CLI: `session-keygen`, `account`, `execute-quote`, direct `twap-prepare` /
111
+ `execution-prepare`.
112
+
113
+ Nothing about venues, routes, pools, adapters, legs, counterparties, or how a fill was built, is exposed at any surface; the contract privacy gate enforces it.
114
+
115
+ ## 0.1.x
116
+
117
+ Initial public SDK: capabilities, markets, action graph, market quote, quote execution (challenge → prepare → submit), firm orders, and the
118
+ opaque market/asset contract.
package/README.md CHANGED
@@ -11,6 +11,16 @@ it does **not** mean quotes are inactive.
11
11
 
12
12
  ## Local stdio
13
13
 
14
+ Read-only use needs no wallet, key, autonomy setting, or environment variable.
15
+ For Codex, add Strata once and start asking for markets or quotes:
16
+
17
+ ```sh
18
+ codex mcp add strata -- npx -y @stratabook/mcp
19
+ ```
20
+
21
+ Do not paste a session secret into chat. Session setup is optional and appears
22
+ only when the user wants the local MCP to sign trading writes.
23
+
14
24
  ```sh
15
25
  npx -y @stratabook/mcp
16
26
  ```
@@ -107,6 +117,14 @@ available collateral while a control is live and returns it after the final
107
117
  control is disabled, exhausted, expired, or cancelled. Current follows Strata's
108
118
  live mark and needs no separate publisher transaction.
109
119
 
120
+ The matching TypeScript package ships `strata-maker-conformance`. Its default
121
+ `safe` mode exercises this hosted MCP's discovery, public maker reads, and
122
+ fresh-request Strand and Current preparations without signing or broadcasting.
123
+ The explicitly confirmed `funded` mode signs a Current preparation externally,
124
+ submits it in a separate MCP request, waits for chain-derived state, and stops
125
+ it through the same restart-safe continuation path. Production activation runs
126
+ the safe suite automatically and rolls back the MCP release if it fails.
127
+
110
128
  ## Hosted Streamable HTTP
111
129
 
112
130
  The managed public endpoint is:
@@ -551,4 +551,4 @@ export declare const STRATA_ACTION_GRAPH: {
551
551
  }];
552
552
  };
553
553
  export declare const STRATA_ACTION_GRAPH_URI = "strata://action-graph/v1";
554
- export declare const STRATA_AGENT_HARNESS_INSTRUCTIONS = "Strata Agent Harness 1.0. Start every objective with strata_capabilities, then strata_action_graph, then strata_platform_graph, then strata_status, then strata_markets. Read strata://agent-harness/v1, strata://action-graph/v1, and strata://platform-graph/v2. The external agent owner controls permission and signer authority. Strata accepts public keys, detached signatures, and signed transactions, never private keys or seed phrases. Resolve a market and side or catalog input/output asset IDs, plus exact input atoms and tolerance, before strata_quote or strata_swap_quote. When portfolio.read is live, read the owner's live Vault portfolio before sizing any action and treat null USD totals as an incomplete valuation, never as zero. When mm.status.read is live, reconcile the owner's own maker products, exposure, and dead-man guards through the authorized status read before and after every maker action, and when mm.fills.stream is live keep the official SDK's authenticated maker stream open to apply contiguous maker fills and exposure changes. For normal Strand or Current operation, prefer strata_market_making_prepare, sign only its prepared transaction externally, then pass its unchanged preparationToken with the signed transaction to strata_market_making_submit_and_wait; the token carries no signing authority and survives stateless HTTP requests. When algos.twap.stream is live, follow TWAP progress through the official SDK's sequenced TWAP stream instead of polling, and when execution.stream is live watch prepared execution handles through the sequenced execution stream. Before selecting a maker transport, read the externally authorized owner-scoped maker reputation record and follow its signed-quote eligibility, cadence, and tier-progress fields. Treat amounts as unsigned base-10 token atoms; check quote bindings, labelled fees, minimum output, and expiry. To execute or control a resting order: request a challenge, verify its quote or exact opaque order bindings, sign canonical authorization bytes externally, prepare, verify and sign the returned transaction externally, then submit with idempotency. When websocket order transport is live, prefer the official SDK persistent command stream, choose explicit self-trade prevention, keep its durable dead-man guard armed for resting exposure, and distinguish immediate RPC broadcast from pushed terminal chain status. If submission is ambiguous, recover durable status with the same control ID and idempotency key. Order control supports place, cancel, bounded cancel-all, atomic replace, and atomic heterogeneous batches of up to six operations. Stop on ambiguity, sequence gaps, unavailable capabilities, paused markets, unsupported contracts, inconsistent bindings, expiry, or missing signer authority.";
554
+ export declare const STRATA_AGENT_HARNESS_INSTRUCTIONS = "Strata read-only tools work immediately with no wallet, approval, session key, or environment setup. For market discovery, books, marks, candles, trades, quotes, public portfolios, maker status, or reputation, call the tools directly and never begin trading setup. Never request or accept a session secret in chat. A session is needed only when the user asks to sign a trading write; if it is missing, direct the user to https://stratabook.app/agents for out-of-chat setup. Revoke, withdraw, pause, and policy changes are owner-wallet actions and never use the session signer. Strata Agent Harness 1.0. Start every objective with strata_capabilities, then strata_action_graph, then strata_platform_graph, then strata_status, then strata_markets. Read strata://agent-harness/v1, strata://action-graph/v1, and strata://platform-graph/v2. The external agent owner controls permission and signer authority. Strata accepts public keys, detached signatures, and signed transactions, never private keys or seed phrases. Resolve a market and side or catalog input/output asset IDs, plus exact input atoms and tolerance, before strata_quote or strata_swap_quote. When portfolio.read is live, read the owner's live Vault portfolio before sizing any action and treat null USD totals as an incomplete valuation, never as zero. When mm.status.read is live, reconcile the owner's own maker products, exposure, and dead-man guards through the authorized status read before and after every maker action, and when mm.fills.stream is live keep the official SDK's authenticated maker stream open to apply contiguous maker fills and exposure changes. For normal Strand or Current operation, prefer strata_market_making_prepare, sign only its prepared transaction externally, then pass its unchanged preparationToken with the signed transaction to strata_market_making_submit_and_wait; the token carries no signing authority and survives stateless HTTP requests. When algos.twap.stream is live, follow TWAP progress through the official SDK's sequenced TWAP stream instead of polling, and when execution.stream is live watch prepared execution handles through the sequenced execution stream. Before selecting a maker transport, read the externally authorized owner-scoped maker reputation record and follow its signed-quote eligibility, cadence, and tier-progress fields. Treat amounts as unsigned base-10 token atoms; check quote bindings, labelled fees, minimum output, and expiry. To execute or control a resting order: request a challenge, verify its quote or exact opaque order bindings, sign canonical authorization bytes externally, prepare, verify and sign the returned transaction externally, then submit with idempotency. When websocket order transport is live, prefer the official SDK persistent command stream, choose explicit self-trade prevention, keep its durable dead-man guard armed for resting exposure, and distinguish immediate RPC broadcast from pushed terminal chain status. If submission is ambiguous, recover durable status with the same control ID and idempotency key. Order control supports place, cancel, bounded cancel-all, atomic replace, and atomic heterogeneous batches of up to six operations. Stop on ambiguity, sequence gaps, unavailable capabilities, paused markets, unsupported contracts, inconsistent bindings, expiry, or missing signer authority.";
@@ -788,4 +788,4 @@ export const STRATA_ACTION_GRAPH = {
788
788
  ]
789
789
  };
790
790
  export const STRATA_ACTION_GRAPH_URI = "strata://action-graph/v1";
791
- export const STRATA_AGENT_HARNESS_INSTRUCTIONS = "Strata Agent Harness 1.0. Start every objective with strata_capabilities, then strata_action_graph, then strata_platform_graph, then strata_status, then strata_markets. Read strata://agent-harness/v1, strata://action-graph/v1, and strata://platform-graph/v2. The external agent owner controls permission and signer authority. Strata accepts public keys, detached signatures, and signed transactions, never private keys or seed phrases. Resolve a market and side or catalog input/output asset IDs, plus exact input atoms and tolerance, before strata_quote or strata_swap_quote. When portfolio.read is live, read the owner's live Vault portfolio before sizing any action and treat null USD totals as an incomplete valuation, never as zero. When mm.status.read is live, reconcile the owner's own maker products, exposure, and dead-man guards through the authorized status read before and after every maker action, and when mm.fills.stream is live keep the official SDK's authenticated maker stream open to apply contiguous maker fills and exposure changes. For normal Strand or Current operation, prefer strata_market_making_prepare, sign only its prepared transaction externally, then pass its unchanged preparationToken with the signed transaction to strata_market_making_submit_and_wait; the token carries no signing authority and survives stateless HTTP requests. When algos.twap.stream is live, follow TWAP progress through the official SDK's sequenced TWAP stream instead of polling, and when execution.stream is live watch prepared execution handles through the sequenced execution stream. Before selecting a maker transport, read the externally authorized owner-scoped maker reputation record and follow its signed-quote eligibility, cadence, and tier-progress fields. Treat amounts as unsigned base-10 token atoms; check quote bindings, labelled fees, minimum output, and expiry. To execute or control a resting order: request a challenge, verify its quote or exact opaque order bindings, sign canonical authorization bytes externally, prepare, verify and sign the returned transaction externally, then submit with idempotency. When websocket order transport is live, prefer the official SDK persistent command stream, choose explicit self-trade prevention, keep its durable dead-man guard armed for resting exposure, and distinguish immediate RPC broadcast from pushed terminal chain status. If submission is ambiguous, recover durable status with the same control ID and idempotency key. Order control supports place, cancel, bounded cancel-all, atomic replace, and atomic heterogeneous batches of up to six operations. Stop on ambiguity, sequence gaps, unavailable capabilities, paused markets, unsupported contracts, inconsistent bindings, expiry, or missing signer authority.";
791
+ export const STRATA_AGENT_HARNESS_INSTRUCTIONS = "Strata read-only tools work immediately with no wallet, approval, session key, or environment setup. For market discovery, books, marks, candles, trades, quotes, public portfolios, maker status, or reputation, call the tools directly and never begin trading setup. Never request or accept a session secret in chat. A session is needed only when the user asks to sign a trading write; if it is missing, direct the user to https://stratabook.app/agents for out-of-chat setup. Revoke, withdraw, pause, and policy changes are owner-wallet actions and never use the session signer. Strata Agent Harness 1.0. Start every objective with strata_capabilities, then strata_action_graph, then strata_platform_graph, then strata_status, then strata_markets. Read strata://agent-harness/v1, strata://action-graph/v1, and strata://platform-graph/v2. The external agent owner controls permission and signer authority. Strata accepts public keys, detached signatures, and signed transactions, never private keys or seed phrases. Resolve a market and side or catalog input/output asset IDs, plus exact input atoms and tolerance, before strata_quote or strata_swap_quote. When portfolio.read is live, read the owner's live Vault portfolio before sizing any action and treat null USD totals as an incomplete valuation, never as zero. When mm.status.read is live, reconcile the owner's own maker products, exposure, and dead-man guards through the authorized status read before and after every maker action, and when mm.fills.stream is live keep the official SDK's authenticated maker stream open to apply contiguous maker fills and exposure changes. For normal Strand or Current operation, prefer strata_market_making_prepare, sign only its prepared transaction externally, then pass its unchanged preparationToken with the signed transaction to strata_market_making_submit_and_wait; the token carries no signing authority and survives stateless HTTP requests. When algos.twap.stream is live, follow TWAP progress through the official SDK's sequenced TWAP stream instead of polling, and when execution.stream is live watch prepared execution handles through the sequenced execution stream. Before selecting a maker transport, read the externally authorized owner-scoped maker reputation record and follow its signed-quote eligibility, cadence, and tier-progress fields. Treat amounts as unsigned base-10 token atoms; check quote bindings, labelled fees, minimum output, and expiry. To execute or control a resting order: request a challenge, verify its quote or exact opaque order bindings, sign canonical authorization bytes externally, prepare, verify and sign the returned transaction externally, then submit with idempotency. When websocket order transport is live, prefer the official SDK persistent command stream, choose explicit self-trade prevention, keep its durable dead-man guard armed for resting exposure, and distinguish immediate RPC broadcast from pushed terminal chain status. If submission is ambiguous, recover durable status with the same control ID and idempotency key. Order control supports place, cancel, bounded cancel-all, atomic replace, and atomic heterogeneous batches of up to six operations. Stop on ambiguity, sequence gaps, unavailable capabilities, paused markets, unsupported contracts, inconsistent bindings, expiry, or missing signer authority.";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stratabook/mcp",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "description": "Connect AI agents to Strata markets and Sonar quotes with MCP.",
5
5
  "type": "module",
6
6
  "license": "MIT OR Apache-2.0",
@@ -33,7 +33,8 @@
33
33
  "dist/src",
34
34
  "README.md",
35
35
  "LICENSE-APACHE",
36
- "LICENSE-MIT"
36
+ "LICENSE-MIT",
37
+ "CHANGELOG.md"
37
38
  ],
38
39
  "scripts": {
39
40
  "build": "tsc -p tsconfig.json",
@@ -44,7 +45,7 @@
44
45
  },
45
46
  "dependencies": {
46
47
  "@modelcontextprotocol/sdk": "1.30.0",
47
- "@stratabook/sdk": "0.2.9",
48
+ "@stratabook/sdk": "0.2.11",
48
49
  "zod": "^3.25.76"
49
50
  },
50
51
  "devDependencies": {