@criptonlabs/agent-apis-core 0.0.0-stage → 0.5.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.
- package/CHANGELOG.md +24 -0
- package/LICENSE +202 -0
- package/NOTICE +7 -0
- package/README.md +119 -2
- package/dist/ai-sdk.d.ts +11 -0
- package/dist/ai-sdk.js +13 -0
- package/dist/cli.d.ts +12 -0
- package/dist/cli.js +190 -0
- package/dist/definition-BLpEK-gY.d.ts +17 -0
- package/dist/eliza.d.ts +58 -0
- package/dist/eliza.js +77 -0
- package/dist/error-json-8HSAKj2F.js +367 -0
- package/dist/index.d.ts +425 -0
- package/dist/index.js +1612 -0
- package/dist/mastra.d.ts +5 -0
- package/dist/mastra.js +16 -0
- package/dist/mcp.d.ts +18 -0
- package/dist/mcp.js +39 -0
- package/dist/peer-C3vrIcft.d.ts +3 -0
- package/dist/peer-Dz8TQyTy.js +13 -0
- package/dist/submission-DWdNJiWU.d.ts +115 -0
- package/package.json +100 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# @criptonlabs/agent-apis-core
|
|
2
|
+
|
|
3
|
+
## 0.5.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- The README's configuration table lists every variable `readCommonEnv` reads: `CRIPTON_CREDITS_TOKEN`, `CRIPTON_TOPUP_MAX` and `CRIPTON_TOPUP_BUDGET` were missing.
|
|
8
|
+
|
|
9
|
+
## 0.5.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- First public release on npm. Network-independent core for the typed clients of the hosted Criptonlabs Agent APIs (https://api.criptonlabs.com), shared by the XRP Ledger and Solana kits and meant for authors of network kits.
|
|
14
|
+
|
|
15
|
+
- **HTTP client**: `ApiClient` calls the free and pro route namespaces of a network, validates responses against the schemas a kit supplies, exposes the response `meta`, applies timeouts and reports `priceOf` and `spent`. Redirects are never followed, and API response bodies are limited to 1 MiB.
|
|
16
|
+
- **x402 per-call payments**: payment is opt-in. The client never pays without a payer and a mandatory `maxPerCall`, and it refuses a call whose price exceeds `maxPerCall` or would exceed `sessionBudget`, before anything is signed. Prices are read from the API at runtime, and limits last one process. A paid retry that gets no answer counts as spent, is never retried and raises `payment-outcome-unknown`.
|
|
17
|
+
- **Payer contract**: `X402Payer` lets a network supply its own payer, with optional decimal amount conversion so limits compare like for like and an optional `exclusive` section so payments of one wallet are signed one at a time.
|
|
18
|
+
- **Prepaid credits**: paid calls spend credits only with a configured credit token or, when it is on, Sign-In-With-X; a bundle is bought only through `topup`, within its own `maxAmount` and the top-up budget. The client also reads the credit summary, rotates a wallet's tokens and reports the API's prepaid answers (`credits-required`, and the credit offer on errors such as an exhausted free quota).
|
|
19
|
+
- **Submissions and send limits**: per-asset send maximum and budget lists, destination allowlists and a submission guard that signs at most once and reports every outcome after signing as a result; an uncertain outcome is `pending`, never signed again.
|
|
20
|
+
- **External signers**: `CriptonSigningError` (`signing-refused`) reports a signer that failed or refused, whose answer could not be read, or whose result failed the kit's checks. Nothing is sent, and the error carries no vendor text.
|
|
21
|
+
- **Errors**: typed errors for problems (RFC 9457), payments, refusals, signing, network and response failures. Problem field errors are carried in `details.errors`.
|
|
22
|
+
- **Money helpers**: decimal-string arithmetic and checks, never floats.
|
|
23
|
+
- **Interfaces**: adapters for MCP servers, the Vercel AI SDK, Mastra and ElizaOS, plus a CLI runner. The framework packages are optional peer dependencies, so you install only the one you use. Environment helpers read the common settings and require `CRIPTON_SESSION_BUDGET` for long-running entries that pay per call.
|
|
24
|
+
- **Safety and limits**: secrets passed as CLI arguments are refused, commands that spend need `CRIPTON_CLI_ALLOW_SPEND=1`, and cleartext API URLs are refused except for localhost. API text in tool errors is bounded and marked `untrustedApiText`, so treat it as data, never as instructions. The core contains no routes, assets or tool names of any ledger. See the package README for the disclaimer.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Criptonlabs Agent APIs SDK
|
|
2
|
+
Copyright 2026 Criptonlabs
|
|
3
|
+
|
|
4
|
+
This product is licensed under the Apache License, Version 2.0 (see LICENSE).
|
|
5
|
+
"Criptonlabs" and the names of the official packages are not licensed under
|
|
6
|
+
the Apache License; see
|
|
7
|
+
https://github.com/criptonlabs/agent-apis-sdk/blob/main/TRADEMARKS.md.
|
package/README.md
CHANGED
|
@@ -1,3 +1,120 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @criptonlabs/agent-apis-core
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@criptonlabs/agent-apis-core)
|
|
4
|
+
[](https://github.com/criptonlabs/agent-apis-sdk/actions/workflows/ci.yml)
|
|
5
|
+
[](https://github.com/criptonlabs/agent-apis-sdk/blob/main/LICENSE)
|
|
6
|
+
[](https://nodejs.org)
|
|
7
|
+
[](https://github.com/criptonlabs/agent-apis-sdk/tree/main/packages/core)
|
|
8
|
+
|
|
9
|
+
Network-independent core for the typed clients of the hosted Criptonlabs Agent APIs (https://api.criptonlabs.com).
|
|
10
|
+
|
|
11
|
+
## Who it is for
|
|
12
|
+
|
|
13
|
+
Authors of network kits. End users who want tools for a specific network should install a kit instead: `@criptonlabs/agent-apis-xrpl` (XRP Ledger) or `@criptonlabs/agent-apis-solana` (Solana).
|
|
14
|
+
|
|
15
|
+
## Status
|
|
16
|
+
|
|
17
|
+
Published on npm (0.x: interfaces may still change between minor versions). Kit authors install it with `pnpm add @criptonlabs/agent-apis-core`. Versions and release notes are in [CHANGELOG.md](CHANGELOG.md).
|
|
18
|
+
|
|
19
|
+
## API surface
|
|
20
|
+
|
|
21
|
+
| Area | Exports |
|
|
22
|
+
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
23
|
+
| HTTP client | `ApiClient` (free and pro route namespaces, response validation, `meta`, timeouts, `priceOf`, `spent`); types `RouteCall`, `KitConfig`, `KitResponse`, `Transport` |
|
|
24
|
+
| Network descriptor | `NetworkDescriptor` (`network`, `productToken`, `routeTimeoutsMs?`); each kit supplies its own |
|
|
25
|
+
| x402 payer | `X402Payer` contract (`selectOption`, `createPaymentHeaders`, optional `decimalAmount(option)`: the option's amount in decimal asset units; absent means the offered amount already is decimal; optional `exclusive(task)`: runs signing and the paid retry one payment at a time, absent means payments may overlap), `PaymentConfig` (`payer`, `maxPerCall`, `sessionBudget?`), `PaymentReceipt`, `PaymentOption` |
|
|
26
|
+
| Errors | `CriptonKitError` and `CriptonValidationError`, `CriptonProblemError`, `CriptonPaymentError`, `CriptonRefusalError`, `CriptonSigningError` (`signing-refused`), `CriptonNetworkError`, `CriptonResponseError`, `MissingPeerDependencyError`; `KitErrorJson`, `PrepaidSignals`, `ProblemFieldError`, `PrepaidOffer`, `PrepaidBundle` |
|
|
27
|
+
| Money helpers | `add`, `sub`, `cmp`, `isDecimal`, `assertDecimal`, `maxDecimals`, `mulPow10`, `divPow10`, `addPercentFloor` (decimal strings, never floats) |
|
|
28
|
+
| Environment | `readCommonEnv`, `buildPaymentConfig`, `assertSecureUrl`, `assertLongRunningBudget`, `destinationListOf`, `boundedApiText` |
|
|
29
|
+
| Tools | `ToolDefinition`, `ToolAnnotations`, `CriptonToolError` (AI SDK and Mastra rejection); `loadPeer`, `PeerImporter` |
|
|
30
|
+
| Adapters | `createMcpServer`, `startMcpServer` (`/mcp`); `toAiSdkTools` (`/ai-sdk`); `toMastraTools` (`/mastra`); `toElizaResult`, `extractElizaFields` and the structural `Eliza*Like` types (`/eliza`) |
|
|
31
|
+
| CLI runner | `runCli`, `exitCodeFor`, `cliSpendAllowed`, `CLI_SPEND_VARIABLE`, `CliCommand` (`spends` marks a command that spends funds), `CliIo` (`/cli`) |
|
|
32
|
+
|
|
33
|
+
Entry points: `@criptonlabs/agent-apis-core` (also re-exports every symbol above), `/mcp`, `/ai-sdk`, `/mastra`, `/eliza`, `/cli`.
|
|
34
|
+
|
|
35
|
+
The framework packages (`@modelcontextprotocol/server`, `ai`, `@mastra/core`, `@elizaos/core`) are optional peer dependencies; install only the one you use. A missing one raises `MissingPeerDependencyError` when its adapter loads it (MCP, Mastra).
|
|
36
|
+
|
|
37
|
+
## Configuration
|
|
38
|
+
|
|
39
|
+
Read by `readCommonEnv`:
|
|
40
|
+
|
|
41
|
+
| Variable | Default | Meaning |
|
|
42
|
+
| ------------------------ | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
|
43
|
+
| `CRIPTON_API_URL` | `https://api.criptonlabs.com` | API base URL; `https:` (`http:` only for `localhost`, `127.0.0.1` and `[::1]`). |
|
|
44
|
+
| `CRIPTON_TIER` | `free` | `free` or `pro`. |
|
|
45
|
+
| `CRIPTON_MAX_PER_CALL` | unset | Per-call spend cap, decimal string. Mandatory to pay. |
|
|
46
|
+
| `CRIPTON_SESSION_BUDGET` | unset | Total spend cap for the session, decimal string. Required for long-running entries built from the environment with per-call payment. |
|
|
47
|
+
| `CRIPTON_CREDITS_TOKEN` | unset | Prepaid credit token (`clc_...`). Needs tier `pro`; an invalid value fails without echoing it. |
|
|
48
|
+
| `CRIPTON_TOPUP_MAX` | unset | Per-purchase cap for credit top-ups, decimal string. Set together with `CRIPTON_TOPUP_BUDGET`. |
|
|
49
|
+
| `CRIPTON_TOPUP_BUDGET` | unset | Cap on a process's credit top-ups, decimal string. Set together with `CRIPTON_TOPUP_MAX`. |
|
|
50
|
+
|
|
51
|
+
Network-specific variables (payer seed and so on) are defined by each kit.
|
|
52
|
+
|
|
53
|
+
## Transport
|
|
54
|
+
|
|
55
|
+
Redirects are never followed: a 3xx answers `CriptonProblemError` with code `unexpected-status`. API response bodies are limited to 1 MiB: a larger data body answers `invalid-response`, a larger problem body `unexpected-status`. A custom `Transport` should not follow redirects either.
|
|
56
|
+
|
|
57
|
+
## Spend limits
|
|
58
|
+
|
|
59
|
+
Payment is opt-in. Without a payer and `maxPerCall` the client never pays. It refuses a call whose price exceeds `maxPerCall` or would exceed `sessionBudget`. The price compared is the amount the API offers, which is the gross price (VAT included when the API quotes it). Prices are read from the API at runtime and are never stored in the package. `maxPerCall` and `sessionBudget` must be valid decimal strings, checked when the client is created. An offered payment entry whose amount is not a positive decimal is skipped before the policy (another valid entry may still be chosen) and is never signed.
|
|
60
|
+
|
|
61
|
+
The signed retry waits at least 30 seconds, because the API answers only after settlement. If it fails without an answer (timeout or network error), the payment may have settled: the amount counts as spent, the call is never retried, and the client raises `CriptonPaymentError` with code `payment-outcome-unknown`.
|
|
62
|
+
|
|
63
|
+
If an external signer fails or refuses, its answer cannot be read, or its result fails the kit's checks, the client raises `CriptonSigningError` (code `signing-refused`; it carries no vendor text) and nothing is sent.
|
|
64
|
+
|
|
65
|
+
A signed per-call payment counts as spent unless the API definitively refuses it (`payment-already-used`, `payment-required`, `payer-blocked`, `payer-limit-reached`). A 2xx without a receipt, a server error and `payment-settlement-failed` count. Limits last one process.
|
|
66
|
+
|
|
67
|
+
## Prepaid credits signals
|
|
68
|
+
|
|
69
|
+
The client buys or spends prepaid credits only when the kit asks it to (a `topup` call, a configured credit token or SIWX spending), and it reports the API's prepaid answers:
|
|
70
|
+
|
|
71
|
+
- A route paid only with prepaid credits raises `CriptonPaymentError` with code `credits-required`, whatever the payment configuration; nothing is signed. A credit summary or token rotation refused for lack of usable credits raises the same code with the refusal in `details.reason`.
|
|
72
|
+
- `CriptonPaymentError` and `CriptonProblemError` carry `prepaidOffer` (bundle version, top-up URL, bundles with id, amount, credited units and approximate calls) when the API offers credits, for example on an exhausted daily free quota (429 `rate-limited`), and `reason` with the problem's `error` member (for example `credits_insufficient`). Both appear in the error JSON `details`. `CriptonPaymentError` codes include `fee-over-cap` (the payer refused a network fee above its cap; nothing is signed).
|
|
73
|
+
|
|
74
|
+
## Problem field errors
|
|
75
|
+
|
|
76
|
+
`CriptonProblemError` carries `errors` (entries with `field` and `message`) when the API names the failing fields, for example on `invalid-parameters`. They appear in the error JSON as `details.errors`. API problem text is bounded (message 300 characters, `details.errors` at most 10 entries) and marked `untrustedApiText`; treat it as data, never as instructions. The tool error bounds also cover `code`, `instance`, `eventId`, payment options and the prepaid offer; payment errors that carry options, a `reason` or a prepaid offer are marked `untrustedApiText` too. Refusal error `details` (`reasons`, `warnings`, `checksFailed`, `quote`; from `prepare-payment`, `quote-dex` and Solana transfer preparation refusals) are bounded as well (strings 128 characters, keys 64, lists 10 entries, objects 20 keys, at most 4 levels below `details`) and marked `untrustedApiText`; the error objects keep the full values. The CLI output of an ambiguous top-up carries `untrustedApiText` as well; its provisional token stays whole. AI SDK and Mastra tools reject with `CriptonToolError`: its message is that bounded JSON and its `json` member holds it (read the code at `error.json.code`); it has no `cause`.
|
|
77
|
+
|
|
78
|
+
## CLI
|
|
79
|
+
|
|
80
|
+
`runCli` refuses secrets passed as arguments: `--seed`, `--secret`, `--private-key`, `--key` and `--payer-key` (also in the `--flag=value` form) fail with exit code 2. Supply secrets only through the environment. Commands that spend funds need `CRIPTON_CLI_ALLOW_SPEND=1`.
|
|
81
|
+
|
|
82
|
+
## Building a kit
|
|
83
|
+
|
|
84
|
+
A kit supplies a network descriptor, the route operations with their response schemas and, optionally, an x402 payer; the core does HTTP, problem errors, payment and limits.
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
import { ApiClient, type X402Payer } from "@criptonlabs/agent-apis-core";
|
|
88
|
+
import { z } from "zod";
|
|
89
|
+
|
|
90
|
+
const api = new ApiClient(
|
|
91
|
+
{ network: "mynet", productToken: "my-kit/0.1.0" }, // calls /v1/mynet/* (or /v1/pro/mynet/*)
|
|
92
|
+
{ tier: "free" },
|
|
93
|
+
);
|
|
94
|
+
const slot = await api.request({
|
|
95
|
+
route: "slot/latest",
|
|
96
|
+
schema: z.object({ slot: z.number(), meta: z.object({ stale: z.boolean() }) }),
|
|
97
|
+
});
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
A payer implements `X402Payer`: `selectOption` picks one of the API's options (or `null`), `createPaymentHeaders` signs it, and `decimalAmount` converts an atomic offer to decimal units so `maxPerCall` and `sessionBudget` compare like for like. A payer whose payments must not overlap defines `exclusive(task)`: the client runs signing and the paid retry of every payment (per call or top-up) inside it, so the next payment starts only after the previous paid retry answers, fails or gets no answer, or its signing fails. If `exclusive` rejects before running the task (for example with `CriptonPaymentError` code `payment-busy`), the call raises that error and nothing is signed or counted. See `packages/xrpl` and `packages/solana` for complete kits.
|
|
101
|
+
|
|
102
|
+
## Network-specific code
|
|
103
|
+
|
|
104
|
+
None. The core contains no routes, assets or tool names of any ledger.
|
|
105
|
+
|
|
106
|
+
## License
|
|
107
|
+
|
|
108
|
+
Apache License 2.0, see [LICENSE](LICENSE) and [NOTICE](NOTICE). Names and marks are covered by the [trademark policy](https://github.com/criptonlabs/agent-apis-sdk/blob/main/TRADEMARKS.md).
|
|
109
|
+
|
|
110
|
+
## Disclaimer
|
|
111
|
+
|
|
112
|
+
This package is free, open-source software released under the Apache License 2.0. It is not a product or service for sale: nobody is charged for downloading, installing or using it, and nobody is required to use it.
|
|
113
|
+
|
|
114
|
+
- The only charges that exist are made by the hosted Criptonlabs Agent APIs for their paid calls, and only when you configure payment yourself. Any payment is between you and the API, under the conditions the API publishes in its [Terms of Use](https://api.criptonlabs.com/terms); this kit is designed to sign only the payments you authorize, within the limits you set, but it cannot guarantee that it does so in every case.
|
|
115
|
+
- The software is experimental and provided "as is" and "as available", without warranty of any kind, as stated in sections 7 and 8 of the `LICENSE`. API data and tool output, including prices, fees, liquidity, slippage, verdicts, scores and readiness checks, are estimates derived from on-chain and third-party data and may be inaccurate, incomplete, stale, delayed or unavailable; check `meta.stale` and verify independently before relying on them.
|
|
116
|
+
- Nothing in this kit or its output is financial, investment, legal, tax or accounting advice, a recommendation to buy, sell or hold any asset, or an offer or solicitation to buy or sell any asset. Where a tool description names a decision (for example trading, holding or providing liquidity), it says what the data is about, not what you should do; any decision is yours alone.
|
|
117
|
+
- You are solely responsible for how you or your agents use the kit, for your keys and seeds, for its configuration and every limit you set or leave unset, for every transaction you sign or submit, and for checking that its output fits your use case. You assume all risks, including the total loss of funds.
|
|
118
|
+
- Third parties named or used by this kit, including blockchain networks and their node and RPC providers, stablecoin issuers, x402 facilitators, signers and custody vendors such as Privy, and AI frameworks and clients, are not affiliated with or endorsed by this kit's authors or the hosted API. Their availability, policies, fees and failures are theirs, not ours; their names and marks belong to their owners.
|
|
119
|
+
- You are responsible for every action your agent takes, including actions caused by malicious or misleading input such as prompt injection.
|
|
120
|
+
- To the maximum extent permitted by applicable law, the authors, copyright holders and contributors are not liable for any loss or damage, direct or indirect, including any loss of funds, lost profits or lost data, arising from the use, misuse, modification or inability to use this software, including defects or bugs, inaccurate or stale data from the API or any upstream source, the behaviour of blockchain networks, failures of third-party signers or services, actions taken by an agent (including through prompt injection), or any modified copy or fork. Nothing here limits any liability that applicable law does not allow to be limited.
|
package/dist/ai-sdk.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { r as ToolDefinition } from "./definition-BLpEK-gY.js";
|
|
3
|
+
interface AiSdkTool {
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: z.ZodType;
|
|
6
|
+
/** Present (true) only on a tool that signs and sends a transaction: the AI SDK asks the user first. */
|
|
7
|
+
needsApproval?: boolean;
|
|
8
|
+
execute(input: unknown): Promise<unknown>;
|
|
9
|
+
}
|
|
10
|
+
export declare function toAiSdkTools(tools: readonly ToolDefinition<unknown, unknown>[]): Record<string, AiSdkTool>;
|
|
11
|
+
export type { AiSdkTool };
|
package/dist/ai-sdk.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { i as runBounded } from "./error-json-8HSAKj2F.js";
|
|
2
|
+
// src/interfaces/ai-sdk/tools.ts
|
|
3
|
+
function toAiSdkTools(tools) {
|
|
4
|
+
const map = {};
|
|
5
|
+
for (const tool of tools) map[tool.name] = {
|
|
6
|
+
description: tool.description,
|
|
7
|
+
inputSchema: tool.inputSchema,
|
|
8
|
+
...tool.annotations.destructiveHint ? { needsApproval: true } : {},
|
|
9
|
+
execute: (input) => runBounded(() => tool.run(input))
|
|
10
|
+
};
|
|
11
|
+
return map;
|
|
12
|
+
}
|
|
13
|
+
export { toAiSdkTools };
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { d as CliCommand, f as CliIo, h as runCli, m as cliSpendAllowed, t as SubmissionStatus, u as CLI_SPEND_VARIABLE } from "./submission-DWdNJiWU.js";
|
|
2
|
+
type CliArgs = Parameters<CliCommand["run"]>[0];
|
|
3
|
+
/** A string option's value; undefined when absent or not a string. */
|
|
4
|
+
export declare function optionText(args: CliArgs, name: string): string | undefined;
|
|
5
|
+
/** A string option as `Number(value)`; undefined when absent. */
|
|
6
|
+
export declare function optionNumber(args: CliArgs, name: string): number | undefined;
|
|
7
|
+
/** The object without its undefined members, typed as `R`. */
|
|
8
|
+
export declare function withoutUndefined<R extends object>(value: object): R;
|
|
9
|
+
export declare function exitCodeFor(error: unknown): 1 | 2 | 3 | 4 | 5;
|
|
10
|
+
/** 0 `confirmed`; 3 `failed`, `expired` and `rejected` (nothing delivered); 5 `pending` (unknown). */
|
|
11
|
+
export declare function submissionExitCode(status: SubmissionStatus): 0 | 3 | 5;
|
|
12
|
+
export { CLI_SPEND_VARIABLE, type CliCommand, type CliIo, cliSpendAllowed, runCli };
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { a as toErrorJson, c as CriptonPaymentError, d as CriptonResponseError, l as CriptonProblemError, n as boundedApiText, p as CriptonValidationError, r as optionalText, s as CriptonNetworkError, u as CriptonRefusalError } from "./error-json-8HSAKj2F.js";
|
|
2
|
+
import { parseArgs } from "node:util";
|
|
3
|
+
// src/interfaces/cli/args.ts
|
|
4
|
+
/** A string option's value; undefined when absent or not a string. */
|
|
5
|
+
function optionText(args, name) {
|
|
6
|
+
const value = args.values[name];
|
|
7
|
+
return typeof value === "string" ? value : void 0;
|
|
8
|
+
}
|
|
9
|
+
/** A string option as `Number(value)`; undefined when absent. */
|
|
10
|
+
function optionNumber(args, name) {
|
|
11
|
+
const value = optionText(args, name);
|
|
12
|
+
return value === void 0 ? void 0 : Number(value);
|
|
13
|
+
}
|
|
14
|
+
/** The object without its undefined members, typed as `R`. */
|
|
15
|
+
function withoutUndefined(value) {
|
|
16
|
+
return Object.fromEntries(Object.entries(value).filter(([, v]) => v !== void 0));
|
|
17
|
+
}
|
|
18
|
+
// src/interfaces/cli/exit-codes.ts
|
|
19
|
+
function exitCodeFor(error) {
|
|
20
|
+
if (error instanceof CriptonValidationError) return 2;
|
|
21
|
+
if (error instanceof CriptonPaymentError || error instanceof CriptonRefusalError) return 3;
|
|
22
|
+
if (error instanceof CriptonProblemError || error instanceof CriptonResponseError) return 4;
|
|
23
|
+
if (error instanceof CriptonNetworkError) return 5;
|
|
24
|
+
return 1;
|
|
25
|
+
}
|
|
26
|
+
const SUBMISSION_EXIT_CODES = {
|
|
27
|
+
confirmed: 0,
|
|
28
|
+
failed: 3,
|
|
29
|
+
expired: 3,
|
|
30
|
+
rejected: 3,
|
|
31
|
+
pending: 5
|
|
32
|
+
};
|
|
33
|
+
/** 0 `confirmed`; 3 `failed`, `expired` and `rejected` (nothing delivered); 5 `pending` (unknown). */
|
|
34
|
+
function submissionExitCode(status) {
|
|
35
|
+
return SUBMISSION_EXIT_CODES[status];
|
|
36
|
+
}
|
|
37
|
+
// src/interfaces/cli/runner.ts
|
|
38
|
+
/** The operator's opt-in for commands that spend. */
|
|
39
|
+
const CLI_SPEND_VARIABLE = "CRIPTON_CLI_ALLOW_SPEND";
|
|
40
|
+
const SECRET_FLAGS = [
|
|
41
|
+
"--seed",
|
|
42
|
+
"--secret",
|
|
43
|
+
"--private-key",
|
|
44
|
+
"--key",
|
|
45
|
+
"--payer-key",
|
|
46
|
+
"--token",
|
|
47
|
+
"--credits-token"
|
|
48
|
+
];
|
|
49
|
+
const CREDIT_TOKEN_PREFIX = "clc_";
|
|
50
|
+
const PENDING_TOKEN_NOTICE = "The provisional credit token becomes valid only if the payment is reconciled.";
|
|
51
|
+
const USAGE_NOTICE = "Provided as is, without warranty; not financial advice. See the package README Disclaimer and https://api.criptonlabs.com/terms.";
|
|
52
|
+
function usage(commands) {
|
|
53
|
+
return `Usage: <command> [options]\nCommands:\n${commands.map((c) => ` ${c.name} ${c.description}`).join("\n")}\n${USAGE_NOTICE}\n`;
|
|
54
|
+
}
|
|
55
|
+
/** A secret flag, or any argument that holds a credit token. */
|
|
56
|
+
function isSecretArgument(arg) {
|
|
57
|
+
if (arg.includes(CREDIT_TOKEN_PREFIX)) return true;
|
|
58
|
+
return SECRET_FLAGS.some((flag) => arg === flag || arg.startsWith(`${flag}=`));
|
|
59
|
+
}
|
|
60
|
+
function line(text) {
|
|
61
|
+
return text.endsWith("\n") ? text : `${text}\n`;
|
|
62
|
+
}
|
|
63
|
+
function formatJson(value, json) {
|
|
64
|
+
return `${json ? JSON.stringify(value) : JSON.stringify(value, null, 2)}\n`;
|
|
65
|
+
}
|
|
66
|
+
function isCliReveal(result) {
|
|
67
|
+
if (typeof result !== "object" || result === null) return false;
|
|
68
|
+
const { reveal, notice } = result;
|
|
69
|
+
return typeof reveal === "object" && reveal !== null && typeof notice === "string";
|
|
70
|
+
}
|
|
71
|
+
function printResult(result, json, io) {
|
|
72
|
+
if (!isCliReveal(result)) {
|
|
73
|
+
io.stdout(formatJson(result, json));
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
io.stdout(formatJson(result.reveal, json));
|
|
77
|
+
io.stderr(line(result.notice));
|
|
78
|
+
}
|
|
79
|
+
function successExitCode(command, result) {
|
|
80
|
+
return command.exitCodeOf === void 0 ? 0 : command.exitCodeOf(result);
|
|
81
|
+
}
|
|
82
|
+
/** Bounds of the API text in the ambiguous top-up output. */
|
|
83
|
+
const AMBIGUOUS_CODE_MAX = 64;
|
|
84
|
+
const AMBIGUOUS_EVENT_ID_MAX = 128;
|
|
85
|
+
/**
|
|
86
|
+
* The ambiguous top-up output: `code` and `eventId` bounded, the provisional token
|
|
87
|
+
* whole (the user must copy it exactly), marked as untrusted API text.
|
|
88
|
+
*/
|
|
89
|
+
function ambiguousTopupJson(error, pendingToken) {
|
|
90
|
+
return {
|
|
91
|
+
code: boundedApiText(error.code, AMBIGUOUS_CODE_MAX),
|
|
92
|
+
...optionalText("eventId", error.eventId, AMBIGUOUS_EVENT_ID_MAX),
|
|
93
|
+
pendingToken,
|
|
94
|
+
untrustedApiText: true
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
/** Prints an error and returns its exit code; an ambiguous top-up reveals its provisional token once. */
|
|
98
|
+
function printError(error, json, io) {
|
|
99
|
+
if (error instanceof CriptonProblemError && error.pendingToken !== void 0) {
|
|
100
|
+
io.stdout(formatJson(ambiguousTopupJson(error, error.pendingToken), json));
|
|
101
|
+
io.stderr(line(PENDING_TOKEN_NOTICE));
|
|
102
|
+
return 4;
|
|
103
|
+
}
|
|
104
|
+
const errorJson = toErrorJson(error);
|
|
105
|
+
if (json) io.stdout(`${JSON.stringify(errorJson)}\n`);
|
|
106
|
+
else io.stderr(`${errorJson.code}: ${errorJson.message}\n`);
|
|
107
|
+
return exitCodeFor(error);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Whether commands that spend may run: `true` for `1`, `false` when absent or empty.
|
|
111
|
+
* Any other value raises `CriptonValidationError`, so a typo such as `true` fails loudly.
|
|
112
|
+
*/
|
|
113
|
+
function cliSpendAllowed(env) {
|
|
114
|
+
const value = env[CLI_SPEND_VARIABLE];
|
|
115
|
+
if (value === void 0 || value === "") return false;
|
|
116
|
+
if (value === "1") return true;
|
|
117
|
+
throw new CriptonValidationError(CLI_SPEND_VARIABLE, `${CLI_SPEND_VARIABLE} must be 1 or unset`);
|
|
118
|
+
}
|
|
119
|
+
/** Refuses a spending command without the opt-in, and any command with an invalid opt-in value. */
|
|
120
|
+
function assertSpendAllowed(command, env) {
|
|
121
|
+
if (cliSpendAllowed(env) || command.spends !== true) return;
|
|
122
|
+
throw new CriptonValidationError(CLI_SPEND_VARIABLE, `${command.name} spends funds; set ${CLI_SPEND_VARIABLE}=1 to allow it`);
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* The checks before option parsing, in order: secret arguments, the command lookup, `--help`, then
|
|
126
|
+
* the spend opt-in, whose refusal reads `--json` from the raw arguments. A number is
|
|
127
|
+
* the exit code to return.
|
|
128
|
+
*/
|
|
129
|
+
function prepare(commands, argv, env, io) {
|
|
130
|
+
if (argv.some(isSecretArgument)) {
|
|
131
|
+
io.stderr("Secrets must not be passed as arguments; use environment variables.\n");
|
|
132
|
+
return 2;
|
|
133
|
+
}
|
|
134
|
+
const [name, ...rest] = argv;
|
|
135
|
+
const command = commands.find((c) => c.name === name);
|
|
136
|
+
if (command === void 0) {
|
|
137
|
+
io.stderr(usage(commands));
|
|
138
|
+
return 2;
|
|
139
|
+
}
|
|
140
|
+
if (rest.includes("--help")) {
|
|
141
|
+
io.stdout(line(command.help ?? command.description));
|
|
142
|
+
return 0;
|
|
143
|
+
}
|
|
144
|
+
try {
|
|
145
|
+
assertSpendAllowed(command, env);
|
|
146
|
+
} catch (error) {
|
|
147
|
+
return printError(error, rest.includes("--json"), io);
|
|
148
|
+
}
|
|
149
|
+
return {
|
|
150
|
+
command,
|
|
151
|
+
rest
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
function parseOptions(command, rest) {
|
|
155
|
+
try {
|
|
156
|
+
return parseArgs({
|
|
157
|
+
args: rest,
|
|
158
|
+
options: {
|
|
159
|
+
...command.options,
|
|
160
|
+
json: { type: "boolean" }
|
|
161
|
+
},
|
|
162
|
+
strict: true,
|
|
163
|
+
allowPositionals: true
|
|
164
|
+
});
|
|
165
|
+
} catch {
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
async function runCli(commands, argv, env, io) {
|
|
170
|
+
const prepared = prepare(commands, argv, env, io);
|
|
171
|
+
if (typeof prepared === "number") return prepared;
|
|
172
|
+
const { command, rest } = prepared;
|
|
173
|
+
const parsed = parseOptions(command, rest);
|
|
174
|
+
if (parsed === void 0) {
|
|
175
|
+
io.stderr(`Invalid arguments for ${command.name}\n${usage(commands)}`);
|
|
176
|
+
return 2;
|
|
177
|
+
}
|
|
178
|
+
const json = parsed.values.json === true;
|
|
179
|
+
try {
|
|
180
|
+
const result = await command.run({
|
|
181
|
+
values: parsed.values,
|
|
182
|
+
positionals: parsed.positionals
|
|
183
|
+
}, env);
|
|
184
|
+
printResult(result, json, io);
|
|
185
|
+
return successExitCode(command, result);
|
|
186
|
+
} catch (error) {
|
|
187
|
+
return printError(error, json, io);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
export { CLI_SPEND_VARIABLE, cliSpendAllowed, exitCodeFor, optionNumber, optionText, runCli, submissionExitCode, withoutUndefined };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
interface ToolAnnotations {
|
|
3
|
+
readOnlyHint: boolean;
|
|
4
|
+
destructiveHint: boolean;
|
|
5
|
+
idempotentHint: boolean;
|
|
6
|
+
openWorldHint: boolean;
|
|
7
|
+
}
|
|
8
|
+
/** Annotations of a tool that signs and sends a transaction from the agent's wallet. */
|
|
9
|
+
declare const SIGNING_ANNOTATIONS: ToolAnnotations;
|
|
10
|
+
interface ToolDefinition<I, O> {
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
inputSchema: z.ZodType<I>;
|
|
14
|
+
annotations: ToolAnnotations;
|
|
15
|
+
run(input: I): Promise<O>;
|
|
16
|
+
}
|
|
17
|
+
export { ToolAnnotations as n, ToolDefinition as r, SIGNING_ANNOTATIONS as t };
|