@stratabook/mcp 0.1.8 → 0.1.10

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.
@@ -3,7 +3,7 @@ export declare const STRATA_AGENT_HARNESS: {
3
3
  readonly harness_version: "1.0";
4
4
  readonly contract_version: "1.1";
5
5
  readonly name: "Strata Agent Harness";
6
- readonly summary: "A capability-gated workflow and executable action graph for agents that discover, read market and account state, quote, prepare, externally sign, and submit Strata operations.";
6
+ readonly summary: "A capability-gated workflow and executable action graph for agents that discover, read, stream low-latency order commands, externally sign, and safely submit Strata operations.";
7
7
  readonly entrypoints: {
8
8
  readonly documentation: "https://stratabook.org/docs/agent-harness/";
9
9
  readonly capabilities: "https://api.stratabook.app/sonar/capabilities";
@@ -16,7 +16,7 @@ export declare const STRATA_AGENT_HARNESS: {
16
16
  };
17
17
  readonly interfaces: {
18
18
  readonly mcp_tool_order: readonly ["strata_capabilities", "strata_action_graph", "strata_markets", "strata_quote", "strata_execution_challenge", "strata_execution_prepare", "strata_execution_submit", "strata_order_challenge", "strata_order_prepare", "strata_order_submit", "strata_order_status"];
19
- readonly terminal: readonly ["npx -y @stratabook/sdk capabilities --json", "npx -y @stratabook/sdk action-graph --json", "npx -y @stratabook/sdk markets --json", "npx -y @stratabook/sdk quote --market SOL/USDC --side sell --amount-atoms 10000000 --json"];
19
+ readonly terminal: readonly ["npx -y @stratabook/sdk capabilities --json", "npx -y @stratabook/sdk action-graph --json", "npx -y @stratabook/sdk markets --json", "npx -y @stratabook/sdk quote --market SOL/USDC --side sell --amount-atoms 10000000 --json", "npx -y @stratabook/sdk order-slo --market-id MARKET_ID --owner-wallet OWNER_PUBLIC_KEY --json"];
20
20
  };
21
21
  readonly workflow: readonly [{
22
22
  readonly id: "discover_capabilities";
@@ -50,13 +50,22 @@ export declare const STRATA_AGENT_HARNESS: {
50
50
  readonly instruction: "Report consumed input, expected output, minimum output, fees by asset side, price impact, and remaining validity.";
51
51
  }, {
52
52
  readonly id: "authorize_writes";
53
- readonly instruction: "When prepare and submit are exposed, keep signing external to Strata: request canonical authorization bytes, sign them with the owner-configured signer, verify the prepared transaction preserves the quote or exact opaque order set, then submit the externally signed transaction with idempotency. Resting-order control supports place, cancel, bounded cancel-all, atomic replace, and atomic heterogeneous batches of up to six operations.";
53
+ readonly instruction: "When prepare and submit are exposed, keep signing external to Strata: request canonical authorization bytes, sign them with the owner-configured signer, verify the prepared transaction preserves the quote or exact opaque order set, then submit the externally signed transaction with idempotency. Resting-order control supports place, cancel, bounded cancel-all, atomic replace, and atomic heterogeneous batches of up to six operations. Every incoming resting order selects an explicit self-trade prevention policy; no policy permits a self-fill.";
54
+ }, {
55
+ readonly id: "stream_order_commands";
56
+ readonly instruction: "When orders.prepare and orders.submit advertise websocket transport, use the official SDK persistent order-command connection. Sign its owner/session/market challenge externally, require contiguous sequences and correlated request IDs, treat the submit result as RPC broadcast only, and consume the pushed terminal status without blocking the placement hot path.";
57
+ }, {
58
+ readonly id: "maintain_dead_man";
59
+ readonly instruction: "Before leaving resting exposure unattended, arm an exact externally verified and pre-signed cancel-all ticket, then maintain its SDK heartbeat. Dropping the guard or losing the agent must stop heartbeats and fail closed into cancellation; disarm only through an explicit owner-authorized action.";
60
+ }, {
61
+ readonly id: "certify_order_command_slo";
62
+ readonly instruction: "Use the official non-trading order-command certification harness before release and on the production schedule. Retain its machine-readable connection count, load, latency percentiles, sequence/error rate, thresholds, and pass/fail result; package support alone is not a latency claim.";
54
63
  }, {
55
64
  readonly id: "monitor_outcome";
56
- readonly instruction: "After an authorized submission, report the durable receipt or explicit failure. If the request times out or either process restarts, recover it with the same control ID and idempotency key. Never claim completion from preparation, signing, or an unconfirmed request.";
65
+ readonly instruction: "After an authorized submission, report the RPC-broadcast receipt and then the durable terminal status or explicit failure. If the request times out or either process restarts, recover it with the same control ID and idempotency key. Never claim chain completion from preparation, signing, or the immediate broadcast receipt.";
57
66
  }];
58
67
  readonly stop_conditions: readonly ["The required live capability is disabled or absent.", "The market is paused, unavailable, or has no reviewed operation path.", "Market, side, amount, decimals, tolerance, or signer authority is unavailable or ambiguous.", "The contract version is unsupported or a response contains unknown fields.", "A quote is expired or its market, side, amount, fee, minimum-output, or time binding is inconsistent.", "A requested operation exceeds the exposed tool, account, or policy scope.", "A user asks the agent to receive or expose wallet secrets, private keys, seed phrases, session keys, or production credentials."];
59
- readonly safety_rules: readonly ["Never request or accept wallet secrets, private keys, seed phrases, session keys, or production credentials in a prompt.", "Never call undocumented endpoints or reconstruct private Sonar behavior.", "Never silently widen slippage, refresh changed economics, substitute a market, or retry a non-retryable failure.", "Treat capability removal, revocation, expiry, and emergency disable as immediate stop signals.", "Capability and action-graph availability are authoritative for Strata operations; permission and signer policy remain controlled by the external agent owner."];
68
+ readonly safety_rules: readonly ["Never request or accept wallet secrets, private keys, seed phrases, session keys, or production credentials in a prompt.", "Never call undocumented endpoints or reconstruct private Sonar behavior.", "Never silently widen slippage, refresh changed economics, substitute a market, or retry a non-retryable failure.", "Never select a self-trade policy implicitly, suppress an order-command sequence gap, or disarm a dead-man ticket merely because the client is shutting down.", "Treat capability removal, revocation, expiry, and emergency disable as immediate stop signals.", "Capability and action-graph availability are authoritative for Strata operations; permission and signer policy remain controlled by the external agent owner."];
60
69
  };
61
70
  export declare const STRATA_AGENT_HARNESS_URI = "strata://agent-harness/v1";
62
71
  export declare const STRATA_ACTION_GRAPH: {
@@ -321,6 +330,36 @@ export declare const STRATA_ACTION_GRAPH: {
321
330
  readonly summary: "Receive the opaque order IDs, transaction signature, and submitted status.";
322
331
  readonly required_capabilities: readonly [];
323
332
  readonly available: true;
333
+ }, {
334
+ readonly id: "open_order_command_stream";
335
+ readonly kind: "prepare";
336
+ readonly summary: "Authenticate one persistent sequenced order channel for low-latency commands, explicit self-trade policy, and pushed confirmation.";
337
+ readonly required_capabilities: readonly ["orders.prepare", "orders.submit"];
338
+ readonly available: false;
339
+ readonly operation: {
340
+ readonly method: "WEBSOCKET";
341
+ readonly path: "/v2/markets/{market_id}/orders/stream";
342
+ };
343
+ }, {
344
+ readonly id: "maintain_dead_man";
345
+ readonly kind: "submit";
346
+ readonly summary: "Arm and heartbeat an exact pre-signed cancel-all that executes if the agent stops responding.";
347
+ readonly required_capabilities: readonly ["orders.prepare", "orders.submit"];
348
+ readonly available: false;
349
+ readonly operation: {
350
+ readonly method: "WEBSOCKET";
351
+ readonly path: "/v2/markets/{market_id}/orders/stream";
352
+ };
353
+ }, {
354
+ readonly id: "certify_order_command_slo";
355
+ readonly kind: "read";
356
+ readonly summary: "Measure authenticated command latency, concurrency, sequence integrity, and error rate without submitting a trade.";
357
+ readonly required_capabilities: readonly ["orders.prepare", "orders.submit"];
358
+ readonly available: false;
359
+ readonly operation: {
360
+ readonly method: "WEBSOCKET";
361
+ readonly path: "/v2/markets/{market_id}/orders/stream";
362
+ };
324
363
  }, {
325
364
  readonly id: "recover_order_status";
326
365
  readonly kind: "read";
@@ -413,6 +452,22 @@ export declare const STRATA_ACTION_GRAPH: {
413
452
  readonly from: "submit_execution";
414
453
  readonly to: "receive_receipt";
415
454
  readonly condition: "the execution ID and idempotency key match";
455
+ }, {
456
+ readonly from: "discover_platform_markets";
457
+ readonly to: "open_order_command_stream";
458
+ readonly condition: "orders.prepare and orders.submit advertise websocket transport and the owner-configured session signer is available";
459
+ }, {
460
+ readonly from: "open_order_command_stream";
461
+ readonly to: "request_order_challenge";
462
+ readonly condition: "signed socket authentication succeeds and an explicit self-trade prevention policy is selected";
463
+ }, {
464
+ readonly from: "open_order_command_stream";
465
+ readonly to: "maintain_dead_man";
466
+ readonly condition: "the exact cancel-all authorization and transaction are externally verified and signed";
467
+ }, {
468
+ readonly from: "open_order_command_stream";
469
+ readonly to: "certify_order_command_slo";
470
+ readonly condition: "a release or recurring production load certificate is required";
416
471
  }, {
417
472
  readonly from: "discover_platform_markets";
418
473
  readonly to: "request_order_challenge";
@@ -441,6 +496,10 @@ export declare const STRATA_ACTION_GRAPH: {
441
496
  readonly from: "submit_order_control";
442
497
  readonly to: "recover_order_status";
443
498
  readonly condition: "the submission result is ambiguous or either process restarted";
499
+ }, {
500
+ readonly from: "submit_order_control";
501
+ readonly to: "maintain_dead_man";
502
+ readonly condition: "the agent has resting exposure that must fail closed on disconnect";
444
503
  }, {
445
504
  readonly from: "recover_order_status";
446
505
  readonly to: "receive_order_receipt";
@@ -448,4 +507,4 @@ export declare const STRATA_ACTION_GRAPH: {
448
507
  }];
449
508
  };
450
509
  export declare const STRATA_ACTION_GRAPH_URI = "strata://action-graph/v1";
451
- export declare const STRATA_AGENT_HARNESS_INSTRUCTIONS = "Strata Agent Harness 1.0. Start every objective with strata_capabilities, then strata_action_graph, then strata_markets. Read strata://agent-harness/v1 and strata://action-graph/v1. 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 the market, side, exact input atoms, and tolerance before strata_quote. 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. If order 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, unavailable capabilities, paused markets, unsupported contracts, inconsistent bindings, expiry, or missing signer authority.";
510
+ export declare const STRATA_AGENT_HARNESS_INSTRUCTIONS = "Strata Agent Harness 1.0. Start every objective with strata_capabilities, then strata_action_graph, then strata_markets. Read strata://agent-harness/v1 and strata://action-graph/v1. 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 the market, side, exact input atoms, and tolerance before strata_quote. 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.";
@@ -4,7 +4,7 @@ export const STRATA_AGENT_HARNESS = {
4
4
  "harness_version": "1.0",
5
5
  "contract_version": "1.1",
6
6
  "name": "Strata Agent Harness",
7
- "summary": "A capability-gated workflow and executable action graph for agents that discover, read market and account state, quote, prepare, externally sign, and submit Strata operations.",
7
+ "summary": "A capability-gated workflow and executable action graph for agents that discover, read, stream low-latency order commands, externally sign, and safely submit Strata operations.",
8
8
  "entrypoints": {
9
9
  "documentation": "https://stratabook.org/docs/agent-harness/",
10
10
  "capabilities": "https://api.stratabook.app/sonar/capabilities",
@@ -33,7 +33,8 @@ export const STRATA_AGENT_HARNESS = {
33
33
  "npx -y @stratabook/sdk capabilities --json",
34
34
  "npx -y @stratabook/sdk action-graph --json",
35
35
  "npx -y @stratabook/sdk markets --json",
36
- "npx -y @stratabook/sdk quote --market SOL/USDC --side sell --amount-atoms 10000000 --json"
36
+ "npx -y @stratabook/sdk quote --market SOL/USDC --side sell --amount-atoms 10000000 --json",
37
+ "npx -y @stratabook/sdk order-slo --market-id MARKET_ID --owner-wallet OWNER_PUBLIC_KEY --json"
37
38
  ]
38
39
  },
39
40
  "workflow": [
@@ -79,11 +80,23 @@ export const STRATA_AGENT_HARNESS = {
79
80
  },
80
81
  {
81
82
  "id": "authorize_writes",
82
- "instruction": "When prepare and submit are exposed, keep signing external to Strata: request canonical authorization bytes, sign them with the owner-configured signer, verify the prepared transaction preserves the quote or exact opaque order set, then submit the externally signed transaction with idempotency. Resting-order control supports place, cancel, bounded cancel-all, atomic replace, and atomic heterogeneous batches of up to six operations."
83
+ "instruction": "When prepare and submit are exposed, keep signing external to Strata: request canonical authorization bytes, sign them with the owner-configured signer, verify the prepared transaction preserves the quote or exact opaque order set, then submit the externally signed transaction with idempotency. Resting-order control supports place, cancel, bounded cancel-all, atomic replace, and atomic heterogeneous batches of up to six operations. Every incoming resting order selects an explicit self-trade prevention policy; no policy permits a self-fill."
84
+ },
85
+ {
86
+ "id": "stream_order_commands",
87
+ "instruction": "When orders.prepare and orders.submit advertise websocket transport, use the official SDK persistent order-command connection. Sign its owner/session/market challenge externally, require contiguous sequences and correlated request IDs, treat the submit result as RPC broadcast only, and consume the pushed terminal status without blocking the placement hot path."
88
+ },
89
+ {
90
+ "id": "maintain_dead_man",
91
+ "instruction": "Before leaving resting exposure unattended, arm an exact externally verified and pre-signed cancel-all ticket, then maintain its SDK heartbeat. Dropping the guard or losing the agent must stop heartbeats and fail closed into cancellation; disarm only through an explicit owner-authorized action."
92
+ },
93
+ {
94
+ "id": "certify_order_command_slo",
95
+ "instruction": "Use the official non-trading order-command certification harness before release and on the production schedule. Retain its machine-readable connection count, load, latency percentiles, sequence/error rate, thresholds, and pass/fail result; package support alone is not a latency claim."
83
96
  },
84
97
  {
85
98
  "id": "monitor_outcome",
86
- "instruction": "After an authorized submission, report the durable receipt or explicit failure. If the request times out or either process restarts, recover it with the same control ID and idempotency key. Never claim completion from preparation, signing, or an unconfirmed request."
99
+ "instruction": "After an authorized submission, report the RPC-broadcast receipt and then the durable terminal status or explicit failure. If the request times out or either process restarts, recover it with the same control ID and idempotency key. Never claim chain completion from preparation, signing, or the immediate broadcast receipt."
87
100
  }
88
101
  ],
89
102
  "stop_conditions": [
@@ -99,6 +112,7 @@ export const STRATA_AGENT_HARNESS = {
99
112
  "Never request or accept wallet secrets, private keys, seed phrases, session keys, or production credentials in a prompt.",
100
113
  "Never call undocumented endpoints or reconstruct private Sonar behavior.",
101
114
  "Never silently widen slippage, refresh changed economics, substitute a market, or retry a non-retryable failure.",
115
+ "Never select a self-trade policy implicitly, suppress an order-command sequence gap, or disarm a dead-man ticket merely because the client is shutting down.",
102
116
  "Treat capability removal, revocation, expiry, and emergency disable as immediate stop signals.",
103
117
  "Capability and action-graph availability are authoritative for Strata operations; permission and signer policy remain controlled by the external agent owner."
104
118
  ]
@@ -428,6 +442,48 @@ export const STRATA_ACTION_GRAPH = {
428
442
  "required_capabilities": [],
429
443
  "available": true
430
444
  },
445
+ {
446
+ "id": "open_order_command_stream",
447
+ "kind": "prepare",
448
+ "summary": "Authenticate one persistent sequenced order channel for low-latency commands, explicit self-trade policy, and pushed confirmation.",
449
+ "required_capabilities": [
450
+ "orders.prepare",
451
+ "orders.submit"
452
+ ],
453
+ "available": false,
454
+ "operation": {
455
+ "method": "WEBSOCKET",
456
+ "path": "/v2/markets/{market_id}/orders/stream"
457
+ }
458
+ },
459
+ {
460
+ "id": "maintain_dead_man",
461
+ "kind": "submit",
462
+ "summary": "Arm and heartbeat an exact pre-signed cancel-all that executes if the agent stops responding.",
463
+ "required_capabilities": [
464
+ "orders.prepare",
465
+ "orders.submit"
466
+ ],
467
+ "available": false,
468
+ "operation": {
469
+ "method": "WEBSOCKET",
470
+ "path": "/v2/markets/{market_id}/orders/stream"
471
+ }
472
+ },
473
+ {
474
+ "id": "certify_order_command_slo",
475
+ "kind": "read",
476
+ "summary": "Measure authenticated command latency, concurrency, sequence integrity, and error rate without submitting a trade.",
477
+ "required_capabilities": [
478
+ "orders.prepare",
479
+ "orders.submit"
480
+ ],
481
+ "available": false,
482
+ "operation": {
483
+ "method": "WEBSOCKET",
484
+ "path": "/v2/markets/{market_id}/orders/stream"
485
+ }
486
+ },
431
487
  {
432
488
  "id": "recover_order_status",
433
489
  "kind": "read",
@@ -544,6 +600,26 @@ export const STRATA_ACTION_GRAPH = {
544
600
  "to": "receive_receipt",
545
601
  "condition": "the execution ID and idempotency key match"
546
602
  },
603
+ {
604
+ "from": "discover_platform_markets",
605
+ "to": "open_order_command_stream",
606
+ "condition": "orders.prepare and orders.submit advertise websocket transport and the owner-configured session signer is available"
607
+ },
608
+ {
609
+ "from": "open_order_command_stream",
610
+ "to": "request_order_challenge",
611
+ "condition": "signed socket authentication succeeds and an explicit self-trade prevention policy is selected"
612
+ },
613
+ {
614
+ "from": "open_order_command_stream",
615
+ "to": "maintain_dead_man",
616
+ "condition": "the exact cancel-all authorization and transaction are externally verified and signed"
617
+ },
618
+ {
619
+ "from": "open_order_command_stream",
620
+ "to": "certify_order_command_slo",
621
+ "condition": "a release or recurring production load certificate is required"
622
+ },
547
623
  {
548
624
  "from": "discover_platform_markets",
549
625
  "to": "request_order_challenge",
@@ -579,6 +655,11 @@ export const STRATA_ACTION_GRAPH = {
579
655
  "to": "recover_order_status",
580
656
  "condition": "the submission result is ambiguous or either process restarted"
581
657
  },
658
+ {
659
+ "from": "submit_order_control",
660
+ "to": "maintain_dead_man",
661
+ "condition": "the agent has resting exposure that must fail closed on disconnect"
662
+ },
582
663
  {
583
664
  "from": "recover_order_status",
584
665
  "to": "receive_order_receipt",
@@ -587,4 +668,4 @@ export const STRATA_ACTION_GRAPH = {
587
668
  ]
588
669
  };
589
670
  export const STRATA_ACTION_GRAPH_URI = "strata://action-graph/v1";
590
- export const STRATA_AGENT_HARNESS_INSTRUCTIONS = "Strata Agent Harness 1.0. Start every objective with strata_capabilities, then strata_action_graph, then strata_markets. Read strata://agent-harness/v1 and strata://action-graph/v1. 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 the market, side, exact input atoms, and tolerance before strata_quote. 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. If order 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, unavailable capabilities, paused markets, unsupported contracts, inconsistent bindings, expiry, or missing signer authority.";
671
+ export const STRATA_AGENT_HARNESS_INSTRUCTIONS = "Strata Agent Harness 1.0. Start every objective with strata_capabilities, then strata_action_graph, then strata_markets. Read strata://agent-harness/v1 and strata://action-graph/v1. 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 the market, side, exact input atoms, and tolerance before strata_quote. 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.1.8",
3
+ "version": "0.1.10",
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",
@@ -44,7 +44,7 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@modelcontextprotocol/sdk": "1.30.0",
47
- "@stratabook/sdk": "0.1.7",
47
+ "@stratabook/sdk": "0.1.9",
48
48
  "zod": "^3.25.76"
49
49
  },
50
50
  "devDependencies": {