@temporalabs/treasury 0.1.1 → 0.1.3

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 (103) hide show
  1. package/NOTICE +4 -2
  2. package/README.md +100 -44
  3. package/THIRD_PARTY_NOTICES.connect-page.md +7836 -0
  4. package/THIRD_PARTY_NOTICES.md +543 -162
  5. package/dist/cli.d.ts +6 -0
  6. package/dist/cli.js +243 -0
  7. package/dist/cli.js.map +1 -0
  8. package/dist/client.d.ts +366 -239
  9. package/dist/client.js +202 -25
  10. package/dist/client.js.map +1 -1
  11. package/dist/config/earn.d.ts +48 -12
  12. package/dist/config/earn.js +48 -12
  13. package/dist/config/earn.js.map +1 -1
  14. package/dist/connect/ack.d.ts +76 -0
  15. package/dist/connect/ack.js +147 -0
  16. package/dist/connect/ack.js.map +1 -0
  17. package/dist/connect/commands.d.ts +81 -0
  18. package/dist/connect/commands.js +555 -0
  19. package/dist/connect/commands.js.map +1 -0
  20. package/dist/connect/config.d.ts +24 -0
  21. package/dist/connect/config.js +35 -0
  22. package/dist/connect/config.js.map +1 -0
  23. package/dist/connect/gate-solana.d.ts +8 -0
  24. package/dist/connect/gate-solana.js +147 -0
  25. package/dist/connect/gate-solana.js.map +1 -0
  26. package/dist/connect/gate.d.ts +37 -0
  27. package/dist/connect/gate.js +115 -0
  28. package/dist/connect/gate.js.map +1 -0
  29. package/dist/connect/http.d.ts +60 -0
  30. package/dist/connect/http.js +235 -0
  31. package/dist/connect/http.js.map +1 -0
  32. package/dist/connect/open.d.ts +2 -0
  33. package/dist/connect/open.js +35 -0
  34. package/dist/connect/open.js.map +1 -0
  35. package/dist/connect/page.d.ts +5 -0
  36. package/dist/connect/page.js +69 -0
  37. package/dist/connect/page.js.map +1 -0
  38. package/dist/connect/session.d.ts +39 -0
  39. package/dist/connect/session.js +198 -0
  40. package/dist/connect/session.js.map +1 -0
  41. package/dist/connect/solana.d.ts +73 -0
  42. package/dist/connect/solana.js +267 -0
  43. package/dist/connect/solana.js.map +1 -0
  44. package/dist/connect/verify.d.ts +37 -0
  45. package/dist/connect/verify.js +89 -0
  46. package/dist/connect/verify.js.map +1 -0
  47. package/dist/connect-page.js +5143 -0
  48. package/dist/disclosures.d.ts +22 -6
  49. package/dist/disclosures.js +34 -8
  50. package/dist/disclosures.js.map +1 -1
  51. package/dist/earn/commands.d.ts +46 -0
  52. package/dist/earn/commands.js +556 -0
  53. package/dist/earn/commands.js.map +1 -0
  54. package/dist/earn/solana.d.ts +278 -0
  55. package/dist/earn/solana.js +302 -0
  56. package/dist/earn/solana.js.map +1 -0
  57. package/dist/guide.d.ts +15 -0
  58. package/dist/guide.js +50 -0
  59. package/dist/guide.js.map +1 -0
  60. package/dist/links.d.ts +2 -0
  61. package/dist/links.js +40 -14
  62. package/dist/links.js.map +1 -1
  63. package/dist/position.d.ts +9 -6
  64. package/dist/position.js +39 -19
  65. package/dist/position.js.map +1 -1
  66. package/dist/preflight.d.ts +9 -0
  67. package/dist/preflight.js +14 -3
  68. package/dist/preflight.js.map +1 -1
  69. package/dist/quote.js +24 -7
  70. package/dist/quote.js.map +1 -1
  71. package/dist/redact.d.ts +3 -3
  72. package/dist/redact.js +3 -3
  73. package/dist/redact.js.map +1 -1
  74. package/dist/registry-schema.d.ts +82 -5
  75. package/dist/registry-schema.js +105 -15
  76. package/dist/registry-schema.js.map +1 -1
  77. package/dist/registry.d.ts +50 -7
  78. package/dist/registry.js +122 -21
  79. package/dist/registry.js.map +1 -1
  80. package/dist/solana/constants.d.ts +49 -0
  81. package/dist/solana/constants.js +50 -0
  82. package/dist/solana/constants.js.map +1 -0
  83. package/dist/solana/kvault.d.ts +99 -0
  84. package/dist/solana/kvault.js +192 -0
  85. package/dist/solana/kvault.js.map +1 -0
  86. package/dist/solana/layout.d.ts +143 -0
  87. package/dist/solana/layout.js +209 -0
  88. package/dist/solana/layout.js.map +1 -0
  89. package/dist/solana/rpc.d.ts +24 -0
  90. package/dist/solana/rpc.js +66 -0
  91. package/dist/solana/rpc.js.map +1 -0
  92. package/dist/solana/vault.d.ts +153 -0
  93. package/dist/solana/vault.js +324 -0
  94. package/dist/solana/vault.js.map +1 -0
  95. package/dist/{mcp-server.mjs → treasury.mjs} +41101 -49486
  96. package/dist/version.js +5 -10
  97. package/dist/version.js.map +1 -1
  98. package/llms.txt +621 -0
  99. package/package.json +12 -9
  100. package/registry/vaults.json +218 -4
  101. package/dist/mcp/server.d.ts +0 -8
  102. package/dist/mcp/server.js +0 -368
  103. package/dist/mcp/server.js.map +0 -1
@@ -2,13 +2,29 @@
2
2
  * The disclosures a distribution surface presents before a depositor's first deposit.
3
3
  * An agent skill IS a distribution surface, so `earn_terms` returns these verbatim and the
4
4
  * skill instructs the agent to show them and get an explicit acknowledgement before building a
5
- * first deposit. They are written for the vaults this registry actually offers — Tempora test
6
- * vaults on ERC-4626 chassis on Base — and say what is true of those, not of a fund that has not
7
- * launched. Change them when the offering changes, and nowhere else.
5
+ * first deposit. They are written for the vaults this registry actually offers — Tempora Labs test
6
+ * vaults on ERC-4626 chassis on Base, Arbitrum One, Robinhood Chain, Ethereum and Monad, and a Kamino
7
+ * vault on Solana — and say what is true of those, not of a fund that has not launched. Change them when the offering changes,
8
+ * and nowhere else.
8
9
  */
9
10
  export declare const DISCLOSURES: {
10
- readonly source: "Agent Treasury — pre-deposit disclosures, 2026-09-15";
11
+ readonly source: "Agent Treasury — pre-deposit disclosures, 2026-09-15 (wording revised 2026-10-04: Tempora Labs named in full; 2026-10-12: withdrawals subject to liquidity, and the Solana co-signer)";
11
12
  readonly presentBefore: "the depositor's first deposit, on every distribution surface";
12
- readonly items: readonly ["EVERY VAULT THIS CLIENT OFFERS TODAY IS A TEST VAULT — unproven, and named as such on-chain. They exist to exercise the product, not to hold savings. Deposit only an amount you are fully prepared to lose entirely, and do not move significant funds into one.", "This is a smart-contract vault, not a bank deposit. No deposit insurance of any kind applies.", "The share token's value is a function of the vault's underlying holdings and is not guaranteed. It can go down.", "The vault holds positions in third-party protocols, each of which carries smart-contract, custody, and mechanism risk that Tempora does not control.", "Any yield figure is a measurement over a past window, not a promise. Historical performance is not indicative of future results.", "A withdrawal is served from the vault's liquid balance and then by unwinding its positions. In stressed conditions part of a position may not be withdrawable immediately; earn_balance reports what is exitable now, simulated at the current block.", "Deposits into a whitelist-gated vault are accepted only from accounts the fund has admitted. Withdrawals are public: an account that holds shares can always leave.", "The vault's current holdings, weights and fees are on-chain and publicly readable at the vault's address.", "The default vault is a Tempora-curated destination. Tempora can set fees on it as curator (a management fee and a performance fee, both readable on-chain; check them before depositing). This client offers it because it is Tempora's, not because it is the best-yielding vault available."];
13
- readonly clientNotes: readonly ["This client prepares unsigned calls only. It cannot sign, send, or move funds; the operator's own signer does that, and the operator is responsible for what it signs.", "Geography: the operator is responsible for the depositor's eligibility in its own jurisdiction. This client has no geographic signal and makes no representation about eligibility."];
13
+ readonly items: readonly ["EVERY VAULT THIS CLIENT OFFERS TODAY IS A TEST VAULT — unproven, and named as such on-chain. They exist to exercise the product, not to hold savings. Deposit only an amount you are fully prepared to lose entirely, and do not move significant funds into one.", "This is a smart-contract vault, not a bank deposit. No deposit insurance of any kind applies.", "The share token's value is a function of the vault's underlying holdings and is not guaranteed. It can go down.", "The vault holds positions in third-party protocols, each of which carries smart-contract, custody, and mechanism risk that Tempora Labs does not control.", "Any yield figure is a measurement over a past window, not a promise. Historical performance is not indicative of future results.", "A withdrawal is served from the vault's liquid balance and then by unwinding its positions. In stressed conditions part of a position may not be withdrawable immediately; earn_balance reports what is exitable now, simulated at the current block.", "Deposits into a whitelist-gated vault are accepted only from accounts the fund has admitted. Withdrawals are not gated: an account that holds shares can leave, subject to the vault's liquidity. On Solana, Kamino's program can require a co-signer on every withdrawal, which would stop exits until it co-signs; none is required today.", "The vault's current holdings, weights and fees are on-chain and publicly readable at the vault's address.", "Each default vault, and the demo vault, is a destination curated by Tempora Labs. Tempora Labs can set fees on it as curator (a management fee and a performance fee, both readable on-chain; check them before depositing). This client offers it because it is a Tempora Labs vault, not because it is the best-yielding vault available."];
14
+ readonly clientNotes: readonly ["This client never signs, sends, or moves funds. Every transaction is signed by the operator's own wallet (through `connect`) or the operator's own signer, and the operator is responsible for what it signs.", "Geography: the operator is responsible for the depositor's eligibility in its own jurisdiction. This client has no geographic signal and makes no representation about eligibility."];
15
+ /**
16
+ * The same points in plain words, for the acknowledgement an operator reads before every signing
17
+ * page (`connect/ack.ts`). A person has to read this each time, so it is short; `items` and
18
+ * `clientNotes` above stay the full text, which `earn_terms` returns. Keep the two in step: a
19
+ * point added above needs its plain sentence here. The first item above (every vault is a test
20
+ * vault; deposit only what you can lose) has none: the acknowledgement prints the vault's own
21
+ * `warning` from the registry, which says it, and `registry.test.ts` holds every row to that.
22
+ */
23
+ readonly plain: {
24
+ readonly deposit: readonly ["This is not a bank deposit, and there is no deposit insurance.", "The value of your shares is not guaranteed. It can go down.", "Your money goes into third-party protocols that Tempora Labs does not control. They can fail.", "Any yield you see is past performance, not a promise.", "You can withdraw, but in stressed markets part of your money may not come out right away.", "Tempora Labs runs this vault and can charge fees on it. It is offered because it is a Tempora Labs vault, not because it pays the most. Its holdings and fees are public on-chain."];
25
+ /** Added before a deposit into a vault whose registry row is not open to every account. */
26
+ readonly gatedDeposit: "This vault only accepts deposits from accounts Tempora Labs has admitted. If yours is not one, the deposit will fail.";
27
+ readonly always: readonly ["This software never signs or moves your money. You approve every transaction in your own wallet, and you are responsible for what you approve.", "You are responsible for being allowed to use this where you live."];
28
+ readonly fullTerms: "Ask your agent for the full terms at any time.";
29
+ };
14
30
  };
@@ -2,27 +2,53 @@
2
2
  * The disclosures a distribution surface presents before a depositor's first deposit.
3
3
  * An agent skill IS a distribution surface, so `earn_terms` returns these verbatim and the
4
4
  * skill instructs the agent to show them and get an explicit acknowledgement before building a
5
- * first deposit. They are written for the vaults this registry actually offers — Tempora test
6
- * vaults on ERC-4626 chassis on Base — and say what is true of those, not of a fund that has not
7
- * launched. Change them when the offering changes, and nowhere else.
5
+ * first deposit. They are written for the vaults this registry actually offers — Tempora Labs test
6
+ * vaults on ERC-4626 chassis on Base, Arbitrum One, Robinhood Chain, Ethereum and Monad, and a Kamino
7
+ * vault on Solana — and say what is true of those, not of a fund that has not launched. Change them when the offering changes,
8
+ * and nowhere else.
8
9
  */
9
10
  export const DISCLOSURES = {
10
- source: "Agent Treasury — pre-deposit disclosures, 2026-09-15",
11
+ source: "Agent Treasury — pre-deposit disclosures, 2026-09-15 (wording revised 2026-10-04: Tempora Labs named in full; 2026-10-12: withdrawals subject to liquidity, and the Solana co-signer)",
11
12
  presentBefore: "the depositor's first deposit, on every distribution surface",
12
13
  items: [
13
14
  "EVERY VAULT THIS CLIENT OFFERS TODAY IS A TEST VAULT — unproven, and named as such on-chain. They exist to exercise the product, not to hold savings. Deposit only an amount you are fully prepared to lose entirely, and do not move significant funds into one.",
14
15
  "This is a smart-contract vault, not a bank deposit. No deposit insurance of any kind applies.",
15
16
  "The share token's value is a function of the vault's underlying holdings and is not guaranteed. It can go down.",
16
- "The vault holds positions in third-party protocols, each of which carries smart-contract, custody, and mechanism risk that Tempora does not control.",
17
+ "The vault holds positions in third-party protocols, each of which carries smart-contract, custody, and mechanism risk that Tempora Labs does not control.",
17
18
  "Any yield figure is a measurement over a past window, not a promise. Historical performance is not indicative of future results.",
18
19
  "A withdrawal is served from the vault's liquid balance and then by unwinding its positions. In stressed conditions part of a position may not be withdrawable immediately; earn_balance reports what is exitable now, simulated at the current block.",
19
- "Deposits into a whitelist-gated vault are accepted only from accounts the fund has admitted. Withdrawals are public: an account that holds shares can always leave.",
20
+ "Deposits into a whitelist-gated vault are accepted only from accounts the fund has admitted. Withdrawals are not gated: an account that holds shares can leave, subject to the vault's liquidity. On Solana, Kamino's program can require a co-signer on every withdrawal, which would stop exits until it co-signs; none is required today.",
20
21
  "The vault's current holdings, weights and fees are on-chain and publicly readable at the vault's address.",
21
- "The default vault is a Tempora-curated destination. Tempora can set fees on it as curator (a management fee and a performance fee, both readable on-chain; check them before depositing). This client offers it because it is Tempora's, not because it is the best-yielding vault available.",
22
+ "Each default vault, and the demo vault, is a destination curated by Tempora Labs. Tempora Labs can set fees on it as curator (a management fee and a performance fee, both readable on-chain; check them before depositing). This client offers it because it is a Tempora Labs vault, not because it is the best-yielding vault available.",
22
23
  ],
23
24
  clientNotes: [
24
- "This client prepares unsigned calls only. It cannot sign, send, or move funds; the operator's own signer does that, and the operator is responsible for what it signs.",
25
+ "This client never signs, sends, or moves funds. Every transaction is signed by the operator's own wallet (through `connect`) or the operator's own signer, and the operator is responsible for what it signs.",
25
26
  "Geography: the operator is responsible for the depositor's eligibility in its own jurisdiction. This client has no geographic signal and makes no representation about eligibility.",
26
27
  ],
28
+ /**
29
+ * The same points in plain words, for the acknowledgement an operator reads before every signing
30
+ * page (`connect/ack.ts`). A person has to read this each time, so it is short; `items` and
31
+ * `clientNotes` above stay the full text, which `earn_terms` returns. Keep the two in step: a
32
+ * point added above needs its plain sentence here. The first item above (every vault is a test
33
+ * vault; deposit only what you can lose) has none: the acknowledgement prints the vault's own
34
+ * `warning` from the registry, which says it, and `registry.test.ts` holds every row to that.
35
+ */
36
+ plain: {
37
+ deposit: [
38
+ "This is not a bank deposit, and there is no deposit insurance.",
39
+ "The value of your shares is not guaranteed. It can go down.",
40
+ "Your money goes into third-party protocols that Tempora Labs does not control. They can fail.",
41
+ "Any yield you see is past performance, not a promise.",
42
+ "You can withdraw, but in stressed markets part of your money may not come out right away.",
43
+ "Tempora Labs runs this vault and can charge fees on it. It is offered because it is a Tempora Labs vault, not because it pays the most. Its holdings and fees are public on-chain.",
44
+ ],
45
+ /** Added before a deposit into a vault whose registry row is not open to every account. */
46
+ gatedDeposit: "This vault only accepts deposits from accounts Tempora Labs has admitted. If yours is not one, the deposit will fail.",
47
+ always: [
48
+ "This software never signs or moves your money. You approve every transaction in your own wallet, and you are responsible for what you approve.",
49
+ "You are responsible for being allowed to use this where you live.",
50
+ ],
51
+ fullTerms: "Ask your agent for the full terms at any time.",
52
+ },
27
53
  };
28
54
  //# sourceMappingURL=disclosures.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"disclosures.js","sourceRoot":"","sources":["../src/disclosures.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,MAAM,EAAE,sDAAsD;IAC9D,aAAa,EAAE,8DAA8D;IAC7E,KAAK,EAAE;QACL,mQAAmQ;QACnQ,+FAA+F;QAC/F,iHAAiH;QACjH,sJAAsJ;QACtJ,kIAAkI;QAClI,uPAAuP;QACvP,qKAAqK;QACrK,2GAA2G;QAC3G,+RAA+R;KAChS;IACD,WAAW,EAAE;QACX,wKAAwK;QACxK,qLAAqL;KACtL;CACO,CAAC"}
1
+ {"version":3,"file":"disclosures.js","sourceRoot":"","sources":["../src/disclosures.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,MAAM,EAAE,uLAAuL;IAC/L,aAAa,EAAE,8DAA8D;IAC7E,KAAK,EAAE;QACL,mQAAmQ;QACnQ,+FAA+F;QAC/F,iHAAiH;QACjH,2JAA2J;QAC3J,kIAAkI;QAClI,uPAAuP;QACvP,8UAA8U;QAC9U,2GAA2G;QAC3G,6UAA6U;KAC9U;IACD,WAAW,EAAE;QACX,+MAA+M;QAC/M,qLAAqL;KACtL;IACD;;;;;;;OAOG;IACH,KAAK,EAAE;QACL,OAAO,EAAE;YACP,gEAAgE;YAChE,6DAA6D;YAC7D,+FAA+F;YAC/F,uDAAuD;YACvD,2FAA2F;YAC3F,oLAAoL;SACrL;QACD,2FAA2F;QAC3F,YAAY,EAAE,uHAAuH;QACrI,MAAM,EAAE;YACN,gJAAgJ;YAChJ,mEAAmE;SACpE;QACD,SAAS,EAAE,gDAAgD;KAC5D;CACO,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Agent Treasury — the earn commands (earn skill), run headless by `src/cli.ts` as `treasury earn <command>`.
3
+ *
4
+ * Read commands, quotes, and UNSIGNED call builders only. There is no `sign` and no `send` command, and
5
+ * there will not be one here: the skill supplies intent, the consumer supplies the signer. Anything
6
+ * that holds a key lives outside this process and receives the calls these commands emit.
7
+ *
8
+ * Eight commands. Each is keyed by its tool name, `earn_`-prefixed so later skills can sit beside it
9
+ * in one namespace; on the command line `earn_quote` is `treasury earn quote`:
10
+ *
11
+ * earn_vaults earn_terms earn_quote (direction) earn_status (no args = health)
12
+ * earn_balance earn_claim earn_prepare_deposit earn_prepare_withdraw
13
+ *
14
+ * Three contracts worth stating here because they are easy to erode:
15
+ *
16
+ * 1. `earn_prepare_*` return an ENVELOPE, `{ requires_signature, status: "unsigned", calls }`,
17
+ * not a bare array. This cannot stop a model reporting "deposited" — nothing at this boundary
18
+ * can — but it makes an unsigned build structurally distinguishable from a completed one, so a
19
+ * consumer or a test can assert on it. Wrapped HERE only: `buildDeposit`/`buildWithdraw` still
20
+ * return arrays, so a direct library consumer (see docs/runbooks/sign_and_send.md) gets the
21
+ * naked calls exactly as before.
22
+ * 2. The address argument is `account` everywhere. It was `depositor`, `owner` and `principal` in
23
+ * three different tools. `receiver` stays distinct because it genuinely is: `account` owns the
24
+ * shares, `receiver` is where the money lands.
25
+ * 3. A vault lives on ONE chain, and every tool that takes `vault` also takes `chain`. Naming a
26
+ * chain alone selects that chain's default vault; naming both and having them disagree is
27
+ * refused (`resolveVault`), never settled by picking one. Every response that names a vault says
28
+ * which chain it is on, because a prepared call is only correct on that chain.
29
+ */
30
+ import { z } from "zod";
31
+ /**
32
+ * What a signer must do for these calls to land exactly once. Every rule but the first is a failure
33
+ * measured on a real Base round trip, not a precaution (2026-09-13, two runs through these tools).
34
+ * The first exists because the registry spans chains: a call's `to` is an address, and an address
35
+ * with no contract on the chain it is sent on accepts the transaction and does nothing.
36
+ * These commands cannot enforce any of them — they never sign — so they state them with every build.
37
+ */
38
+ export declare const SIGNER_RULES: readonly ["Send each call on the chain its `chainId` names, and on no other: check the signer's network before signing. Sent on a different chain, a call can be mined there without doing anything — the approve or the deposit never happened, and gas was still spent.", "Before signing, check every call's destination against the addresses the operator gave: `to`, and the receiver/owner named in `description`. Do not sign a call whose destination you did not confirm.", "Set the nonce explicitly from eth_getTransactionCount(account, \"pending\") immediately before each send. A load-balanced RPC can hand a signing library a stale nonce, and the send is then rejected as \"nonce too low\" (measured 2026-09-14, mainnet.base.org).", "Set the gas limit to the call's gasAdvice (estimate × 1.5).", "Wait for each receipt before sending the next call, and poll for it on a provider that serves receipts: a public endpoint may refuse eth_getTransactionReceipt (measured 2026-09-14, publicnode). A failed receipt poll does not mean the transaction failed.", "If a send or receipt poll fails for any reason other than an on-chain revert, read the account's nonce on a DIFFERENT provider before re-sending. A nonce that moved means the transaction was accepted; re-sending it would repeat the deposit or withdrawal."];
39
+ /** One command: what `--help` prints, the arguments it takes, and the handler that answers with JSON text. */
40
+ export interface Command {
41
+ title: string;
42
+ description: string;
43
+ inputSchema: z.ZodObject<z.ZodRawShape>;
44
+ handler: (args: never) => Promise<string>;
45
+ }
46
+ export declare function buildCommands(): Record<string, Command>;