@stellar-agent-services/dev-mcp 0.0.0-stage → 0.1.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 (48) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +50 -2
  3. package/dist/docs.d.ts +35 -0
  4. package/dist/docs.d.ts.map +1 -0
  5. package/dist/docs.js +92 -0
  6. package/dist/docs.js.map +1 -0
  7. package/dist/index.d.ts +3 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +6 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/server.d.ts +14 -0
  12. package/dist/server.d.ts.map +1 -0
  13. package/dist/server.js +125 -0
  14. package/dist/server.js.map +1 -0
  15. package/package.json +40 -4
  16. package/repository/AGENTS.md +162 -0
  17. package/repository/CONTRIBUTING.md +95 -0
  18. package/repository/IMPLEMENTATION_PLAN.md +560 -0
  19. package/repository/README.md +80 -0
  20. package/repository/SECURITY.md +22 -0
  21. package/repository/apps/wallet/README.md +78 -0
  22. package/repository/docs/client-integration/README-AI.md +495 -0
  23. package/repository/docs/client-integration/README.md +138 -0
  24. package/repository/docs/dx-improvements.md +670 -0
  25. package/repository/docs/erc-compatibility.md +163 -0
  26. package/repository/docs/job-recovery.md +201 -0
  27. package/repository/docs/payment-client.md +290 -0
  28. package/repository/docs/provider-setup-guide.md +348 -0
  29. package/repository/docs/provider-standard.md +728 -0
  30. package/repository/docs/recovery/README-AI.md +288 -0
  31. package/repository/docs/recovery/README.md +119 -0
  32. package/repository/docs/sow-closeout.md +67 -0
  33. package/repository/docs/standard/README-AI.md +614 -0
  34. package/repository/docs/standard/README.md +108 -0
  35. package/repository/docs/verification.md +504 -0
  36. package/repository/examples/paid-service/README.md +33 -0
  37. package/repository/examples/python-upstream/README.md +44 -0
  38. package/repository/llms.txt +65 -0
  39. package/repository/packages/create-stellar-service/README.md +143 -0
  40. package/repository/packages/dev-mcp/README.md +51 -0
  41. package/repository/packages/payment-client/README.md +98 -0
  42. package/repository/packages/protocol/README.md +15 -0
  43. package/repository/packages/protocol/schemas/manifest.schema.json +272 -0
  44. package/repository/packages/protocol/test-vectors/README.md +45 -0
  45. package/repository/packages/provider-kit/README.md +509 -0
  46. package/repository/packages/provider-kit/schemas/gateway-config.schema.json +140 -0
  47. package/repository/packages/verifier/README.md +131 -0
  48. package/repository/plugins/stellar-agent-services/README.md +31 -0
@@ -0,0 +1,272 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://algorialabs.github.io/stellar-agent-services/schemas/provider/1/manifest.schema.json",
4
+ "$comment": "The $id is provisional until the v1 freeze. Rule ids such as [M5] refer to docs/provider-standard.md.",
5
+ "title": "Provider Standard v1 manifest",
6
+ "description": "Describes a paid AI service on Stellar: its services, prices, payment option and job endpoints. Unknown fields are allowed and ignored [M8]. Some rules need code as well (§2.4): M1, M3, M5 (same origin), M7, S6, S9 and P11.",
7
+ "type": "object",
8
+ "required": ["standard", "provider", "baseUrl", "payment", "services"],
9
+ "properties": {
10
+ "standard": {
11
+ "description": "[M8] A manifest with a different major version is rejected.",
12
+ "const": "stellar-agent-services/provider@1"
13
+ },
14
+ "provider": { "$ref": "#/$defs/provider" },
15
+ "baseUrl": {
16
+ "description": "[M5] Job endpoints live under it. HTTPS, no user info, query, fragment, empty path segment or trailing slash. Same origin as the manifest URL, which is checked in code.",
17
+ "type": "string",
18
+ "maxLength": 300,
19
+ "pattern": "^https://[^\\s/?#@]+(/[^\\s/?#]+)*$"
20
+ },
21
+ "payment": { "$ref": "#/$defs/payment" },
22
+ "jobs": { "$ref": "#/$defs/jobs" },
23
+ "services": {
24
+ "type": "array",
25
+ "minItems": 1,
26
+ "maxItems": 25,
27
+ "items": { "$ref": "#/$defs/service" }
28
+ },
29
+ "extensions": { "$ref": "#/$defs/extensions" }
30
+ },
31
+ "$defs": {
32
+ "provider": {
33
+ "type": "object",
34
+ "required": ["name"],
35
+ "properties": {
36
+ "name": { "$ref": "#/$defs/line", "type": "string", "minLength": 1, "maxLength": 120 },
37
+ "description": { "$ref": "#/$defs/text", "type": "string", "maxLength": 500 },
38
+ "homepage": { "$ref": "#/$defs/httpsUrl" },
39
+ "agentId": {
40
+ "description": "Stellar 8004 agent id (u32), needed for the identity check (§7).",
41
+ "type": "integer",
42
+ "minimum": 0,
43
+ "maximum": 4294967295
44
+ },
45
+ "termsUrl": { "$ref": "#/$defs/httpsUrl" },
46
+ "dataUse": {
47
+ "type": "object",
48
+ "properties": {
49
+ "storesInputs": {
50
+ "description": "Whether inputs are kept after the job finishes.",
51
+ "type": "boolean"
52
+ },
53
+ "trainsOnInputs": {
54
+ "description": "Whether inputs are used to train models.",
55
+ "type": "boolean"
56
+ }
57
+ }
58
+ }
59
+ }
60
+ },
61
+ "payment": {
62
+ "type": "object",
63
+ "required": ["protocol", "x402Version", "accepts"],
64
+ "properties": {
65
+ "protocol": { "const": "x402" },
66
+ "x402Version": { "const": 2 },
67
+ "accepts": {
68
+ "description": "[P1] Exactly one payment option in v1.",
69
+ "type": "array",
70
+ "minItems": 1,
71
+ "maxItems": 1,
72
+ "items": { "$ref": "#/$defs/paymentOption" }
73
+ }
74
+ }
75
+ },
76
+ "paymentOption": {
77
+ "description": "x402 v2 PaymentRequirements field names, without amount, which comes from each service's price [P1].",
78
+ "type": "object",
79
+ "required": ["scheme", "network", "asset", "payTo", "maxTimeoutSeconds", "extra"],
80
+ "properties": {
81
+ "scheme": { "const": "exact" },
82
+ "network": { "enum": ["stellar:testnet", "stellar:pubnet"] },
83
+ "asset": {
84
+ "description": "The USDC Stellar Asset Contract for the network.",
85
+ "type": "string"
86
+ },
87
+ "payTo": {
88
+ "description": "A G... account or C... contract address. Its checksum is checked in code [P11].",
89
+ "type": "string",
90
+ "pattern": "^[GC][A-D][A-Z2-7]{54}$"
91
+ },
92
+ "amount": false,
93
+ "maxTimeoutSeconds": { "type": "integer", "minimum": 30, "maximum": 300 },
94
+ "extra": {
95
+ "type": "object",
96
+ "required": ["areFeesSponsored"],
97
+ "properties": {
98
+ "areFeesSponsored": { "const": true }
99
+ }
100
+ }
101
+ },
102
+ "allOf": [
103
+ {
104
+ "if": {
105
+ "type": "object",
106
+ "required": ["network"],
107
+ "properties": { "network": { "const": "stellar:testnet" } }
108
+ },
109
+ "then": {
110
+ "type": "object",
111
+ "properties": { "asset": { "const": "CBIELTK6YBZJU5UP2WWQEUCYKLPU6AUNZ2BQ4WWFEIE3USCIHMXQDAMA" } }
112
+ }
113
+ },
114
+ {
115
+ "if": {
116
+ "type": "object",
117
+ "required": ["network"],
118
+ "properties": { "network": { "const": "stellar:pubnet" } }
119
+ },
120
+ "then": {
121
+ "type": "object",
122
+ "properties": { "asset": { "const": "CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75" } }
123
+ }
124
+ }
125
+ ]
126
+ },
127
+ "jobs": {
128
+ "type": "object",
129
+ "properties": {
130
+ "retentionSeconds": {
131
+ "description": "How long results stay retrievable.",
132
+ "type": "integer",
133
+ "minimum": 3600,
134
+ "default": 86400
135
+ }
136
+ }
137
+ },
138
+ "service": {
139
+ "type": "object",
140
+ "required": ["name", "description", "price", "inputSchema", "outputSchema"],
141
+ "properties": {
142
+ "name": {
143
+ "description": "Unique in the manifest [M7]. A URL path segment, an MCP tool name and an LLM function name.",
144
+ "type": "string",
145
+ "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
146
+ },
147
+ "title": { "$ref": "#/$defs/line", "type": "string", "minLength": 1, "maxLength": 120 },
148
+ "description": { "$ref": "#/$defs/text", "type": "string", "minLength": 1, "maxLength": 1000 },
149
+ "price": {
150
+ "type": "object",
151
+ "required": ["amount"],
152
+ "properties": {
153
+ "amount": {
154
+ "description": "A positive integer in the asset's base units. USDC has 7 decimals, so \"100000\" is 0.01 USDC.",
155
+ "type": "string",
156
+ "pattern": "^[1-9][0-9]{0,37}$"
157
+ }
158
+ }
159
+ },
160
+ "charge": {
161
+ "description": "When the user is charged (§3.2).",
162
+ "enum": ["on-success", "upfront"],
163
+ "default": "upfront"
164
+ },
165
+ "expectedDurationSeconds": { "type": "integer", "minimum": 1 },
166
+ "inputSchema": { "$ref": "#/$defs/objectSchema" },
167
+ "outputSchema": { "$ref": "#/$defs/objectSchema" },
168
+ "examples": {
169
+ "description": "Each input and output must match the service's schemas, which is checked in code [S9].",
170
+ "type": "array",
171
+ "maxItems": 5,
172
+ "items": {
173
+ "type": "object",
174
+ "required": ["input", "output"],
175
+ "properties": {
176
+ "input": { "type": "object" },
177
+ "output": { "type": "object" }
178
+ }
179
+ }
180
+ },
181
+ "maxInputBytes": { "type": "integer", "minimum": 1, "maximum": 10485760, "default": 1048576 },
182
+ "tags": {
183
+ "type": "array",
184
+ "maxItems": 10,
185
+ "uniqueItems": true,
186
+ "items": { "type": "string", "pattern": "^[a-z0-9-]{1,32}$" }
187
+ },
188
+ "capacity": {
189
+ "description": "How much load the service takes (§5.8). Hints only: the provider's 429, 503 and queue answers are what count.",
190
+ "type": "object",
191
+ "properties": {
192
+ "concurrency": {
193
+ "description": "Jobs the service runs at the same time.",
194
+ "type": "integer",
195
+ "minimum": 1
196
+ },
197
+ "maxQueueWaitSeconds": {
198
+ "description": "Longest a new job may expect to wait in the queue; beyond it, create-job answers 503. 0 means no queue.",
199
+ "type": "integer",
200
+ "minimum": 0
201
+ }
202
+ }
203
+ },
204
+ "extensions": { "$ref": "#/$defs/extensions" }
205
+ },
206
+ "if": {
207
+ "type": "object",
208
+ "required": ["charge"],
209
+ "properties": { "charge": { "const": "on-success" } }
210
+ },
211
+ "then": { "type": "object", "required": ["expectedDurationSeconds"] }
212
+ },
213
+ "objectSchema": {
214
+ "description": "[S4] A JSON Schema 2020-12 schema whose root is \"type\": \"object\". [S5] It references nothing outside itself. Its size is checked in code [S6].",
215
+ "allOf": [
216
+ { "$ref": "https://json-schema.org/draft/2020-12/schema" },
217
+ { "$ref": "#/$defs/localReferencesOnly" },
218
+ {
219
+ "type": "object",
220
+ "required": ["type"],
221
+ "properties": { "type": { "const": "object" } }
222
+ }
223
+ ]
224
+ },
225
+ "localReferencesOnly": {
226
+ "description": "[S5] Wherever they appear, $ref and $dynamicRef start with \"#\", and $schema is JSON Schema 2020-12. Deliberately conservative: it also applies inside const, enum, default and examples.",
227
+ "if": { "type": "object" },
228
+ "then": {
229
+ "type": "object",
230
+ "properties": {
231
+ "$ref": { "$ref": "#/$defs/localReference" },
232
+ "$dynamicRef": { "$ref": "#/$defs/localReference" },
233
+ "$schema": {
234
+ "if": { "type": "string" },
235
+ "then": { "type": "string", "const": "https://json-schema.org/draft/2020-12/schema" },
236
+ "else": { "$ref": "#/$defs/localReferencesOnly" }
237
+ }
238
+ },
239
+ "additionalProperties": { "$ref": "#/$defs/localReferencesOnly" }
240
+ },
241
+ "else": {
242
+ "if": { "type": "array" },
243
+ "then": { "type": "array", "items": { "$ref": "#/$defs/localReferencesOnly" } }
244
+ }
245
+ },
246
+ "localReference": {
247
+ "if": { "type": "string" },
248
+ "then": { "type": "string", "pattern": "^#" },
249
+ "else": { "$ref": "#/$defs/localReferencesOnly" }
250
+ },
251
+ "httpsUrl": {
252
+ "description": "[M6] An HTTPS URL of at most 300 characters, without user info.",
253
+ "type": "string",
254
+ "maxLength": 300,
255
+ "pattern": "^https://[^\\s/?#@]+([/?#]\\S*)?$"
256
+ },
257
+ "line": {
258
+ "description": "Text without control characters.",
259
+ "type": "string",
260
+ "pattern": "^[^\u0000-\u001f\u007f]*$"
261
+ },
262
+ "text": {
263
+ "description": "Text that may contain tabs and newlines but no other control characters.",
264
+ "type": "string",
265
+ "pattern": "^[^\u0000-\u0008\u000b-\u001f\u007f]*$"
266
+ },
267
+ "extensions": {
268
+ "description": "[X1] Fields outside this standard. Keys SHOULD be reverse-DNS names such as com.example.sla.",
269
+ "type": "object"
270
+ }
271
+ }
272
+ }
@@ -0,0 +1,45 @@
1
+ # Provider Standard v1 test vectors
2
+
3
+ Known-answer tests for [Provider Standard v1](../../../docs/provider-standard.md). An implementation in any
4
+ language can check itself against these files. `packages/protocol` runs all of them in its own tests.
5
+
6
+ | File | What it pins | Spec |
7
+ | --- | --- | --- |
8
+ | `canonical-json.json` | RFC 8785 canonical JSON and its SHA-256, including the RFC's own examples | §5.3, verification receipts |
9
+ | `binding-hash.json` | The job binding hash | §5.3 |
10
+ | `headers.json` | `Idempotency-Key` and `Job-Token` formats | §5.2 |
11
+ | `manifests.json` | Manifest validation: the JSON Schema and the rules it can't express | §2.4 |
12
+ | `challenges.json` | Checking an x402 challenge against the approved manifest | §4.2 |
13
+ | `job-states.json` | Allowed job state transitions and the `charged` value of each state | §5.6 |
14
+ | `problems.json` | Error codes, their HTTP status and Retry-After, and job failure codes | §6 |
15
+ | `validation-requests.json` | Validation request documents: their canonical bytes, `request_hash` and `data:` URI, and the JSON Schema | [verification.md](../../../docs/verification.md#stellar-8004-validation-registry) |
16
+
17
+ ## Conventions
18
+
19
+ - **Patches.** `manifests.json` and `challenges.json` describe each case as a small change to a base document,
20
+ using the `add`, `replace` and `remove` operations of JSON Patch (RFC 6902). A last path segment of `-`
21
+ appends to an array.
22
+ - **Violations.** Each `{ "rule", "pointer" }` is a rule id from the spec and a JSON Pointer (RFC 6901) to the
23
+ offending value, or to where a missing field belongs. Compare them as a set. Messages are not part of the
24
+ vectors.
25
+ - **`checkedBy`.** In `manifests.json`, `"schema"` cases fail the
26
+ [manifest JSON Schema](../schemas/manifest.schema.json). `"code"` cases pass it and fail only the rules JSON
27
+ Schema can't express. If you validate in code only, every invalid case must still fail.
28
+ - **Numbers** are IEEE 754 doubles, as I-JSON requires. Integers beyond ±(2^53 − 1) aren't interoperable, so the
29
+ vectors avoid them. Services should send such values as strings.
30
+ - **Duplicate keys** make a document invalid I-JSON, but many parsers can't detect them, so no vector covers
31
+ them.
32
+
33
+ ## How they were made
34
+
35
+ The expected values were generated once and checked before they were written:
36
+ - canonical JSON against the independent [`canonicalize`](https://github.com/erdtman/canonicalize) package by an
37
+ RFC 8785 author;
38
+ - the RFC 8785 examples (§3.2.2, §3.2.3, Appendix B) against the text of the RFC;
39
+ - hashes against a second SHA-256 implementation;
40
+ - every manifest and challenge case against Ajv with the JSON Schema, and against `packages/protocol`;
41
+ - validation requests with Python's `json`, `hashlib` and `base64` modules, apart from `packages/protocol`, and the
42
+ hashes again with `shasum`;
43
+ - job states and error codes by hand from the tables in §5.6 and §6.
44
+
45
+ When you change a vector, run `npm test` and review the diff by hand.