@floatonnear/mcp 0.9.0 → 0.9.1

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.
Files changed (2) hide show
  1. package/dist/server.js +34 -3
  2. package/package.json +1 -1
package/dist/server.js CHANGED
@@ -223,9 +223,40 @@ const cfg = {
223
223
  // "configured" and unreachable.
224
224
  agentKeysPath: process.env.NEAR_VAULT_AGENT_KEYS ?? ".float/agent-keys.json",
225
225
  };
226
+ /**
227
+ * NO VAULT IS THE COMMONEST STATE, SO THE MESSAGE HAS TO BE AN ONRAMP.
228
+ *
229
+ * This said "NEAR_VAULT_CONTRACT is not set" — true, and a dead end. Measured
230
+ * 2026-11-12: an agent asked to pay someone got that from `vault_config` and
231
+ * `vault_tree`, concluded the NEAR rail was unavailable, then searched three
232
+ * unrelated wallets for something that could reach a `.near` address, and
233
+ * finally asked the user to paste a contract id. It never suggested MAKING a
234
+ * vault, because nothing in the failure told it that was possible without one.
235
+ *
236
+ * The WORKFLOW preamble already said "No vault yet? vault_create" and that was
237
+ * not enough: at the moment of failure an agent reads the ERROR, not the
238
+ * instructions it was handed at startup. So the routing belongs here.
239
+ *
240
+ * It is the FIRST thing a new install hits, and the product's answer is
241
+ * genuinely good: `vault_create` needs no key, no existing vault and no
242
+ * configuration. An error that does not say so turns the normal first step
243
+ * into a support question.
244
+ *
245
+ * Names BOTH cases — "you have none" and "you have one this client does not
246
+ * know about" — because the fix differs completely and the message cannot tell
247
+ * which it is.
248
+ */
226
249
  function requireVault() {
227
- if (!cfg.vault)
228
- throw new Error("NEAR_VAULT_CONTRACT is not set");
250
+ if (!cfg.vault) {
251
+ throw new Error("No vault is configured, so there is nothing to read yet. " +
252
+ "If the user does not have a vault, call vault_create — it needs NO key, no existing " +
253
+ "vault and no configuration, and returns a link they approve in their own wallet. That " +
254
+ "is the normal first step, not an error. " +
255
+ "If they DO have one, set NEAR_VAULT_CONTRACT to its address and restart the client " +
256
+ "(servers are read once at startup); vault_create with an `owner` reports the address " +
257
+ "the factory derives for them. " +
258
+ "Do not go looking for another way to send money — no other rail can reach a NEAR vault.");
259
+ }
229
260
  return cfg.vault;
230
261
  }
231
262
  function tokenFor(t) {
@@ -342,7 +373,7 @@ WORTH KNOWING
342
373
  An implicit account (a 64-character hex id) cannot own a vault at all. Tell the user to use a
343
374
  named account rather than retrying.
344
375
  Amounts are whole tokens in these tools (1.5 means 1.5 USDC), never base units.`;
345
- const server = new McpServer({ name: "float", version: "0.9.0" }, { instructions: INSTRUCTIONS });
376
+ const server = new McpServer({ name: "float", version: "0.9.1" }, { instructions: INSTRUCTIONS });
346
377
  // ----------------------------------------------------------------- reads
347
378
  /**
348
379
  * Wait for a create to land, and prove the result belongs to the user.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floatonnear/mcp",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "type": "module",
5
5
  "description": "MCP server for the hierarchical budget vault. The agent key signs request_payment only; owner methods emit unsigned payloads for wallet approval.",
6
6
  "license": "MIT",