@ostraagent/mcp 0.1.9 → 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.
package/README.md CHANGED
@@ -84,7 +84,7 @@ All settings are optional.
84
84
  | `OSTRA_ETH_RPC_URL` | `https://ethereum-rpc.publicnode.com` | An Ethereum mainnet RPC, for Chainlink's USDe / USD feed the strategies read before lending to a cash vault that can lend against USDe. `off`: no cash goes into such a vault. Never printed |
85
85
  | `OSTRA_RAETO_URL` | `https://api.raeto.cc` | Raeto's API. `off` turns the `raeto` tool off |
86
86
  | `OSTRA_PAD_INDEXER_URL` | `https://app.ostraagent.xyz` | Ostra's Ostrapad index, for `pad_search` by words. `off` turns that search off (a listing by agent id is still read from the chain) |
87
- | `OSTRA_IPFS_GATEWAYS` | Pinata's gateway, then ipfs.io | The IPFS gateways profiles and Ostrapad's files are read through, comma-separated, in the order they are tried (each URL ending in `/`). A raw CID is checked against the bytes, whichever gateway answers |
87
+ | `OSTRA_IPFS_GATEWAYS` | The Ostra uploader (`https://relayer.ostraagent.xyz/v1/ipfs/`), then Pinata's gateway, then ipfs.io | The IPFS gateways profiles and Ostrapad's files are read through, comma-separated, in the order they are tried (each URL ending in `/`). A raw CID is checked against the bytes, whichever gateway answers |
88
88
  | `OSTRA_DEPLOYMENT` | Ostra on Robinhood Chain mainnet | Path of another deployment record (JSON). With it, the four services default to off |
89
89
 
90
90
  On a local fork of mainnet (`OSTRA_RPC_URL` pointing at it), set the four services to `off`: they act on mainnet.
package/dist/ostra-mcp.js CHANGED
@@ -18,7 +18,7 @@ var __export = (target, all) => {
18
18
  var define_OSTRA_PACKAGED_default;
19
19
  var init_define_OSTRA_PACKAGED = __esm({
20
20
  "<define:OSTRA_PACKAGED>"() {
21
- define_OSTRA_PACKAGED_default = { version: "0.1.9", deployment: { version: 1, chainId: 4663, fromBlock: "91991509", token: "0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168", batchSettlement: "0x4020074e9dF2ce1deE5A9C1b5c3f541D02a10003", vaultImplementation: "0xec0ca4A1393D91c42cA809F7F9dd82Bd597E8E58", vaultBeacon: "0xE9F525B9EaeE48d13AEd28fE146F48f2832a18a0", vaultFactory: "0x043a15c514CFE2c797d33520bFF91a5DCdbf2979", poolImplementation: "0xC04d4a222dC1C966640B977608bE29949b0648ec", poolBeacon: "0x30669Ca534921038a531BBE27116d85bB7406fFF", pool: "0x6ea80F2462e5Fd783B0Ec3B2c7BaC96795980CD6", splitFactory: "0xAAf54A483B2c7c2c5ecFc1eDED5ed1619C1bA882", beaconOwner: "0x55533a51d9bd9b06F2D179d919BB31995EF96E5e", registry: "0xcE6Cc1f93744f4090DA1444Bb8590d9206157506", vaultModule: "0x55A89fF907f5F5756470e2ec5Dc5E4E1C54Da770", launchpad: { hook: "0x63A784afb8905452aDceC471a45E555F5caE68cC", fees: "0x8e79671DC9729476614C78aFcf2345D4c1963801", launchpad: "0xfC57162C0e3f9773F97fEa8d276e957d7c43A6C5", creatorSplit: "0x987994dE6A1d5303B9e3F50977cB0321BA4D033B", dispatcher: "0x44Bb65164b2855f8E80B142d5Fb9bDb72E869986", locker: "0xb593812363bAd70Ee381c7B54c4FC82b0BA3A4A7", devBuy: "0x0e1Fd799E136dcfEcad5695B07Ac5DAc5B2fF4bc", vesting: "0xadD9C1995910457312c156E7D8120D1b447E179a", airdrop: "0xBC798D956aF4c2B104FFC6106d5322294Bc103bb", owner: "0x6569E27A95a6A3E92A311B4Cc6600fed56aA50A2" }, breaker: "0x2E33244dE6A64007204f763e9ef81FC33F1a8e01" }, swapDeployment: { chainId: 4663, fromBlock: "94940585", router: "0x5b9686f384A5Fb768B2360cF0B893F0d1E960B01", stake: "0xaDA4FaB9c8aB9165bf4d6cD9d4Da6d6b32Bb4BC6", buyback: "0xd86083031b7Af66ecD5C9c5e90D4C6d8E661F3f5", spendVerifier: "0x0a0E28a81DE6289e5044950163FfE95b37180e3B", privatePool: "0xe4250895Da2499602Cee4e178Fb46A0cF39F5b76" }, prover: { wasm: "0xd5f3069334ab49a2f955e4b4be9493b80c3f7b2a85f4ff2073a327ef5fbc2747", glue: "0x4bc8bef7c755c83daaf833623f85473a20a7c40b390d8d639d9e4353618a0537" }, relayerUrl: "https://relayer.ostraagent.xyz", keeperUrl: "https://keeper.ostraagent.xyz", aggregatorUrl: "https://aggregator.ostraagent.xyz", aiUrl: "https://ai.ostraagent.xyz" };
21
+ define_OSTRA_PACKAGED_default = { version: "0.1.10", deployment: { version: 1, chainId: 4663, fromBlock: "91991509", token: "0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168", batchSettlement: "0x4020074e9dF2ce1deE5A9C1b5c3f541D02a10003", vaultImplementation: "0xec0ca4A1393D91c42cA809F7F9dd82Bd597E8E58", vaultBeacon: "0xE9F525B9EaeE48d13AEd28fE146F48f2832a18a0", vaultFactory: "0x043a15c514CFE2c797d33520bFF91a5DCdbf2979", poolImplementation: "0xC04d4a222dC1C966640B977608bE29949b0648ec", poolBeacon: "0x30669Ca534921038a531BBE27116d85bB7406fFF", pool: "0x6ea80F2462e5Fd783B0Ec3B2c7BaC96795980CD6", splitFactory: "0xAAf54A483B2c7c2c5ecFc1eDED5ed1619C1bA882", beaconOwner: "0x55533a51d9bd9b06F2D179d919BB31995EF96E5e", registry: "0xcE6Cc1f93744f4090DA1444Bb8590d9206157506", vaultModule: "0x55A89fF907f5F5756470e2ec5Dc5E4E1C54Da770", launchpad: { hook: "0x63A784afb8905452aDceC471a45E555F5caE68cC", fees: "0x8e79671DC9729476614C78aFcf2345D4c1963801", launchpad: "0xfC57162C0e3f9773F97fEa8d276e957d7c43A6C5", creatorSplit: "0x987994dE6A1d5303B9e3F50977cB0321BA4D033B", dispatcher: "0x44Bb65164b2855f8E80B142d5Fb9bDb72E869986", locker: "0xb593812363bAd70Ee381c7B54c4FC82b0BA3A4A7", devBuy: "0x0e1Fd799E136dcfEcad5695B07Ac5DAc5B2fF4bc", vesting: "0xadD9C1995910457312c156E7D8120D1b447E179a", airdrop: "0xBC798D956aF4c2B104FFC6106d5322294Bc103bb", owner: "0x6569E27A95a6A3E92A311B4Cc6600fed56aA50A2" }, breaker: "0x2E33244dE6A64007204f763e9ef81FC33F1a8e01" }, swapDeployment: { chainId: 4663, fromBlock: "94940585", router: "0x5b9686f384A5Fb768B2360cF0B893F0d1E960B01", stake: "0xaDA4FaB9c8aB9165bf4d6cD9d4Da6d6b32Bb4BC6", buyback: "0xd86083031b7Af66ecD5C9c5e90D4C6d8E661F3f5", spendVerifier: "0x0a0E28a81DE6289e5044950163FfE95b37180e3B", privatePool: "0xe4250895Da2499602Cee4e178Fb46A0cF39F5b76" }, prover: { wasm: "0xd5f3069334ab49a2f955e4b4be9493b80c3f7b2a85f4ff2073a327ef5fbc2747", glue: "0x4bc8bef7c755c83daaf833623f85473a20a7c40b390d8d639d9e4353618a0537" }, relayerUrl: "https://relayer.ostraagent.xyz", keeperUrl: "https://keeper.ostraagent.xyz", aggregatorUrl: "https://aggregator.ostraagent.xyz", aiUrl: "https://ai.ostraagent.xyz" };
22
22
  }
23
23
  });
24
24
 
@@ -23030,7 +23030,7 @@ var init_ipfs = __esm({
23030
23030
  "use strict";
23031
23031
  init_define_OSTRA_PACKAGED();
23032
23032
  init_src();
23033
- IPFS_GATEWAYS = ["https://gateway.pinata.cloud/ipfs/", "https://ipfs.io/ipfs/"];
23033
+ IPFS_GATEWAYS = ["https://relayer.ostraagent.xyz/v1/ipfs/", "https://gateway.pinata.cloud/ipfs/", "https://ipfs.io/ipfs/"];
23034
23034
  IPFS_GATEWAY_TIMEOUT_MS = 2e4;
23035
23035
  }
23036
23036
  });
@@ -24569,7 +24569,7 @@ function jobView(j) {
24569
24569
  deliverable: j.deliverable === ZERO324 ? null : padCidFromDigest(j.deliverable)
24570
24570
  };
24571
24571
  }
24572
- var PAD_DIR, PAD_READ_MAX_BYTES, READ_TIMEOUT_MS, SPEND_GAS_HEADROOM3, EIP1271_MAGIC2, erc1271Abi2, tokenUriAbi, ZERO324, PadResentError, PadService;
24572
+ var PAD_DIR, PAD_READ_MAX_BYTES, READ_TIMEOUT_MS, SPEND_GAS_HEADROOM3, PAD_DISCOVER_RESCAN_BLOCKS, PAD_CURSOR_VERSION, EIP1271_MAGIC2, erc1271Abi2, tokenUriAbi, ZERO324, PadResentError, PadService;
24573
24573
  var init_pad2 = __esm({
24574
24574
  "../core/src/pad.ts"() {
24575
24575
  "use strict";
@@ -24583,6 +24583,8 @@ var init_pad2 = __esm({
24583
24583
  PAD_READ_MAX_BYTES = 65536;
24584
24584
  READ_TIMEOUT_MS = 2e4;
24585
24585
  SPEND_GAS_HEADROOM3 = 100000n;
24586
+ PAD_DISCOVER_RESCAN_BLOCKS = 3000n;
24587
+ PAD_CURSOR_VERSION = 2;
24586
24588
  EIP1271_MAGIC2 = "0x1626ba7e";
24587
24589
  erc1271Abi2 = [
24588
24590
  { type: "function", name: "isValidSignature", stateMutability: "view", inputs: [{ name: "hash", type: "bytes32" }, { name: "signature", type: "bytes" }], outputs: [{ name: "", type: "bytes4" }] }
@@ -25148,14 +25150,21 @@ var init_pad2 = __esm({
25148
25150
  // -------------------------------------------------------------------------------------------------------------
25149
25151
  // Reads and the sweep
25150
25152
  // -------------------------------------------------------------------------------------------------------------
25151
- /** Finds jobs addressed to this agent's vault (as provider, drawn evaluator or panel member) and records them. */
25153
+ /**
25154
+ * Finds jobs addressed to this agent's vault (as provider, drawn evaluator or panel member) and records them. The
25155
+ * logs are read up to the logs RPC's own head (another RPC's head can be ahead of the blocks it has logs for: those
25156
+ * blocks would be passed over for good), and the last PAD_DISCOVER_RESCAN_BLOCKS are read again on the next pass,
25157
+ * as the evaluator bot does (keeper pad-evaluator.ts). A cursor written before 0.1.10 (no version: its head came
25158
+ * from the other RPC) is not trusted: the scan starts again from OstraPad's deployment block, once.
25159
+ */
25152
25160
  async #discover(vault) {
25153
25161
  const f = this.#folder();
25154
25162
  await f.ensure();
25155
25163
  const logs = this.#p.logsClient ?? this.#p.client;
25156
- const head = (await this.#p.client.getBlock({ blockTag: "latest" })).number;
25164
+ const head = await logs.getBlockNumber({ cacheTime: 0 });
25157
25165
  const cursorText = await f.read("cursor.json");
25158
- const from = cursorText === void 0 ? OSTRAPAD_FROM_BLOCK : BigInt(JSON.parse(cursorText).next);
25166
+ const cursor = cursorText === void 0 ? null : JSON.parse(cursorText);
25167
+ const from = cursor === null || cursor.version !== PAD_CURSOR_VERSION ? OSTRAPAD_FROM_BLOCK : BigInt(cursor.next);
25159
25168
  if (from > head) return;
25160
25169
  const found = /* @__PURE__ */ new Map();
25161
25170
  for (const l of await getLogsChunked(logs, { address: this.#pad, event: PAD_EVENTS.JobCreated, args: { provider: vault }, fromBlock: from, toBlock: head })) found.set(l.args.jobId, "provider");
@@ -25165,7 +25174,8 @@ var init_pad2 = __esm({
25165
25174
  if (a.panel.some((m) => getAddress25(m) === vault) && !found.has(a.jobId)) found.set(a.jobId, "evaluator");
25166
25175
  }
25167
25176
  for (const [id, role] of found) if (await this.#record(id) === null) await this.#save({ id, role, steps: {}, at: Math.floor(Date.now() / 1e3) });
25168
- await f.write("cursor.json", JSON.stringify({ next: (head + 1n).toString() }));
25177
+ const rescan = head + 1n - PAD_DISCOVER_RESCAN_BLOCKS;
25178
+ await f.write("cursor.json", JSON.stringify({ version: PAD_CURSOR_VERSION, next: (rescan > from ? rescan : from).toString() }));
25169
25179
  }
25170
25180
  /** The jobs this agent is a party to, with their state on chain and what can be done next; `jobId`: one job, with its order and delivery files. */
25171
25181
  async jobs(a = {}) {
@@ -25193,7 +25203,7 @@ var init_pad2 = __esm({
25193
25203
  const r = await this.#record(id);
25194
25204
  if (r?.terms !== void 0) return r.terms.description;
25195
25205
  const logs = this.#p.logsClient ?? this.#p.client;
25196
- const found = await getLogsChunked(logs, { address: this.#pad, event: PAD_EVENTS.JobCreated, args: { jobId: id }, fromBlock: OSTRAPAD_FROM_BLOCK, toBlock: (await this.#p.client.getBlock({ blockTag: "latest" })).number });
25206
+ const found = await getLogsChunked(logs, { address: this.#pad, event: PAD_EVENTS.JobCreated, args: { jobId: id }, fromBlock: OSTRAPAD_FROM_BLOCK, toBlock: await logs.getBlockNumber({ cacheTime: 0 }) });
25197
25207
  const log2 = found[0];
25198
25208
  if (log2 === void 0) return null;
25199
25209
  return (await padTermsFromTransaction(this.#p.client, log2.transactionHash, id, this.#pad))?.description ?? null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ostraagent/mcp",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "Ostra Agent's MCP server (stdio): the post-quantum privacy vault for AI agents. One vault to pay, earn, work and hire on Ostrapad, and stay private on Robinhood Chain, with no ETH (the Ostra relayer sends its transactions, paid in USDG).",
5
5
  "keywords": [
6
6
  "mcp",