@stellar-agent-services/dev-mcp 0.0.0-stage → 0.1.0

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 (47) 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 +548 -0
  19. package/repository/README.md +78 -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 +487 -0
  23. package/repository/docs/client-integration/README.md +137 -0
  24. package/repository/docs/dx-improvements.md +666 -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 +258 -0
  28. package/repository/docs/provider-setup-guide.md +348 -0
  29. package/repository/docs/provider-standard.md +724 -0
  30. package/repository/docs/recovery/README-AI.md +288 -0
  31. package/repository/docs/recovery/README.md +119 -0
  32. package/repository/docs/standard/README-AI.md +611 -0
  33. package/repository/docs/standard/README.md +108 -0
  34. package/repository/docs/verification.md +502 -0
  35. package/repository/examples/paid-service/README.md +24 -0
  36. package/repository/examples/python-upstream/README.md +44 -0
  37. package/repository/llms.txt +64 -0
  38. package/repository/packages/create-stellar-service/README.md +143 -0
  39. package/repository/packages/dev-mcp/README.md +51 -0
  40. package/repository/packages/payment-client/README.md +75 -0
  41. package/repository/packages/protocol/README.md +15 -0
  42. package/repository/packages/protocol/schemas/manifest.schema.json +272 -0
  43. package/repository/packages/protocol/test-vectors/README.md +45 -0
  44. package/repository/packages/provider-kit/README.md +507 -0
  45. package/repository/packages/provider-kit/schemas/gateway-config.schema.json +140 -0
  46. package/repository/packages/verifier/README.md +127 -0
  47. package/repository/plugins/stellar-agent-services/README.md +31 -0
@@ -0,0 +1,78 @@
1
+ # Stellar Agent Services
2
+
3
+ Phase 2 of [Stellar Agent Search](https://github.com/berkingurcan/stellar-agent-search). It makes it easy for
4
+ developers to offer paid AI services on Stellar, and easy for users to find, hire and pay them safely.
5
+
6
+ Stellar Agent Search finds and evaluates agents (read-only, keyless). This repository adds the provider and
7
+ payment side:
8
+
9
+ | Package | Purpose |
10
+ | --- | --- |
11
+ | [`packages/protocol`](packages/protocol) | Provider Standard v1 as code (manifest, jobs, receipts) |
12
+ | [`packages/provider-kit`](packages/provider-kit) | Turn a function, or an existing API in any language (gateway mode), into a paid service: pricing, x402 USDC payments, Job Recovery, capacity and queuing |
13
+ | [`packages/payment-client`](packages/payment-client) | Buyer side: approval, spending controls, payment, recovery (proof of concept) |
14
+ | [`packages/verifier`](packages/verifier) | Checks a provider against the standard (C1–C7), issues verification receipts and badges, publishes to the Stellar 8004 Validation Registry. `verifier watch` answers validation requests by itself. |
15
+ | [`packages/dev-mcp`](packages/dev-mcp) | MCP server for coding agents: spec rules, docs, manifest validation, unpaid provider checks. It never pays. |
16
+ | [`packages/create-stellar-service`](packages/create-stellar-service) | `npm create stellar-service`: a new project (an existing API, a TypeScript or a Python service), ready to run, try and deploy |
17
+ | [`apps/wallet`](apps/wallet) | Web page where a person approves and pays a service (testnet) |
18
+ | [`examples/paid-service`](examples/paid-service) | Sample provider and template for pilot providers |
19
+ | [`examples/python-upstream`](examples/python-upstream) | An existing Python API made a paid service with gateway mode |
20
+
21
+ **Status:** Week 3 of the plan. A paid call works end to end, from a provider (library or gateway mode, with a
22
+ durable job queue) to the payment client's CLI and web page. Job Recovery is complete in code: providers decide
23
+ uncertain payments from on-chain data ([docs/job-recovery.md](docs/job-recovery.md)). The verifier runs every check
24
+ (C1–C7), proves payments on chain, and issues receipts, badges and Validation Registry responses
25
+ ([docs/verification.md](docs/verification.md)). The plan is in
26
+ [IMPLEMENTATION_PLAN.md](IMPLEMENTATION_PLAN.md). Development runs on Stellar **testnet**.
27
+
28
+ To offer a service, start with [`npm create stellar-service`](packages/create-stellar-service), then:
29
+
30
+ ```bash
31
+ npm create stellar-service my-service
32
+ cd my-service
33
+ npm run dev # runs it, paid to a throwaway testnet account: no wallet needed yet
34
+ npm run try # pays for one call with test money
35
+ npm run launch # goes live: one approval in your wallet registers and verifies it, then Fly.io
36
+ npm run status # where it stands, and what to run next
37
+ ```
38
+
39
+ The [provider setup guide](docs/provider-setup-guide.md) explains each step.
40
+
41
+ **The standard in short:** [for people](docs/standard/README.md) and [for AI coding agents](docs/standard/README-AI.md).
42
+ The full text is [docs/provider-standard.md](docs/provider-standard.md).
43
+
44
+ ## For AI coding agents
45
+
46
+ - [AGENTS.md](AGENTS.md) picks a path (new service, existing API, another language, paying client, verification,
47
+ contributing) and names its reference, rules and definition of done. `CLAUDE.md` points to it.
48
+ - [llms.txt](llms.txt) indexes every document, and [llms-full.txt](llms-full.txt) holds them all in one file.
49
+ - The [Claude Code plugin](plugins/stellar-agent-services) adds a skill for each path:
50
+ `/plugin marketplace add AlgoriaLabs/stellar-agent-services`.
51
+ - The [MCP server](packages/dev-mcp) answers spec questions and checks manifests and providers.
52
+
53
+ ## Compatibility
54
+
55
+ We stay compatible with ERC-8126 (agent verification) and ERC-8196 (agent authenticated wallet). See
56
+ [docs/erc-compatibility.md](docs/erc-compatibility.md). Copies of both specs are in [docs/references/](docs/references).
57
+
58
+ ## Development
59
+
60
+ ```bash
61
+ npm install
62
+ npm run typecheck
63
+ npm test
64
+ ```
65
+
66
+ Requires Node 22.13 or later (`.node-version` pins 24).
67
+
68
+ ## Security
69
+
70
+ See [SECURITY.md](SECURITY.md). In short:
71
+
72
+ - discovery and provider servers hold no keys
73
+ - only the payment client signs, once, after explicit approval
74
+ - nobody pays twice for one job
75
+
76
+ ## License
77
+
78
+ MIT
@@ -0,0 +1,22 @@
1
+ # Security
2
+
3
+ These boundaries apply to every package in this repository.
4
+
5
+ 1. **Discovery holds no keys.** `stellar-agent-search` stays read-only and keyless. It may import only the
6
+ dependency-free `protocol` package.
7
+ 2. **Provider runtimes hold no keys.** A provider server knows only its `payTo` public address. Owner
8
+ operations are signed in the owner's own wallet, on an approval page the CLI serves on 127.0.0.1 behind a
9
+ one-time token, or with `--source` through the Stellar CLI keychain; never through environment variables. The
10
+ CLI checks that a signed transaction is the one it built before sending it. In gateway mode, the only
11
+ credential is the upstream API's own key, if it has one, and never a Stellar secret key. The only keys the CLI
12
+ makes are throwaway testnet ones, held in memory and never written: `provider-kit try`'s payer, and the payout
13
+ account `provider-kit dev` makes while `PAY_TO` is empty. That key signs the account's USDC trustline and is
14
+ dropped; the provider gets only the public address.
15
+ 3. **Only the payment client signs payments**, once per approved job, after the user approves the exact
16
+ price, recipient, asset and network.
17
+ 4. **Never pay twice.** The job identity is fixed before payment. Recovery never re-sends a payment
18
+ credential, and an uncertain settlement is never re-charged.
19
+ 5. **Fail closed.** Unknown or unverifiable states stop the flow.
20
+ 6. **One network per flow.** Testnet and mainnet are never mixed in one run.
21
+
22
+ To report a vulnerability, contact the maintainers privately rather than opening a public issue.
@@ -0,0 +1,78 @@
1
+ # Agent Wallet (web approval page)
2
+
3
+ The page where a person sees the exact payment and approves it before anything is paid: the "web app" surface
4
+ of the payment client ([docs/payment-client.md](../../docs/payment-client.md)). It is a static page with no
5
+ backend. Every safety step runs in [`packages/payment-client`](../../packages/payment-client), in the browser.
6
+
7
+ **Status: minimal page (Week 1), Stellar testnet only.** It creates a test wallet, loads any Provider Standard v1
8
+ provider, builds the request form from the service's input schema, shows the approval screen, pays once, confirms
9
+ the transfer on chain and recovers lost jobs.
10
+
11
+ ## Run it
12
+
13
+ ```bash
14
+ npm install && npm run build # builds the packages the page uses
15
+
16
+ # The sample provider (any public G... address with a USDC trustline receives the payments)
17
+ PAY_TO=G... node examples/paid-service/dist/server.js
18
+
19
+ # The page, on http://localhost:5173
20
+ npm run dev --workspace @stellar-agent-services/wallet
21
+ ```
22
+
23
+ Then:
24
+
25
+ 1. **Create test wallet.** This makes a key in the browser, gets test XLM from Friendbot and buys 5 test USDC on
26
+ the testnet exchange.
27
+ 2. **Use localhost:8787.** This loads the sample provider's manifest.
28
+ 3. **Pick a service and review the payment.** The approval screen shows the price, the full payee address, when you
29
+ are charged, and the challenge and spending-limit checks.
30
+ 4. **Approve.** The page follows the payment and shows "Paid" only once the `transfer` on chain matches what you
31
+ approved.
32
+
33
+ To show spending control, set the limit per payment to 0.01 and review `delayed-report` (0.02): the payment is
34
+ blocked before anything is signed.
35
+
36
+ For the Job Recovery demo, start the provider with `DRILL_LOSE_RESPONSE=1 REPORT_DELAY_SECONDS=10` and pay
37
+ `delayed-report`. The page says it can't tell whether the payment went through. **Recover job** then collects
38
+ the result with no second payment.
39
+
40
+ `npm run build --workspace @stellar-agent-services/wallet` writes the static page to `apps/wallet/dist`.
41
+
42
+ ## How it keeps payments safe
43
+
44
+ - **Core.** The page never decides whether something is paid. It calls `quote()`, `pay()`, `decline()` and
45
+ `recover()` on the core, and the core runs every check (docs/payment-client.md, "One payment, step by step").
46
+ - **Decline by default.** Closing the approval screen in any way declines: the Decline button, the close button,
47
+ or Escape. The Decline button has the focus, so a stray Enter never pays.
48
+ - **Journal.** The journal and job tokens live in IndexedDB (`@stellar-agent-services/payment-client/browser`).
49
+ - Writes use strict durability, so `sending` is on disk before the paid request goes out.
50
+ - The page runs in one tab at a time (a Web Lock), so the journal has one writer.
51
+ - If the journal can't be opened, nothing can be paid.
52
+ - **Key.** The test wallet's key is in this browser's site storage. That is fine for test money, never for real
53
+ money: real wallets will plug in as signers (Stellar Wallets Kit, passkey accounts).
54
+ - **No outside code.** The page loads no third-party code, and a Content Security Policy blocks inline and outside
55
+ scripts. `'unsafe-eval'` is allowed for Ajv, which compiles the manifest schema.
56
+ - **Local providers.** `http://localhost` providers are accepted only while the page itself runs on localhost, as
57
+ with `stellar-pay --dev`.
58
+
59
+ ## Files
60
+
61
+ | File | Contents |
62
+ | --- | --- |
63
+ | `src/lib/agent-wallet.svelte.ts` | The page's state and actions on top of the core; follows the journal for progress |
64
+ | `src/lib/schema-form.ts` | A service's `inputSchema` → form fields; anything else gets a JSON editor |
65
+ | `src/lib/jobs.ts` | Each job's state from the journal, for Recent payments |
66
+ | `src/lib/stellar.ts` | Test wallet balances and funding (Horizon, Friendbot, testnet exchange) |
67
+ | `src/lib/storage.ts` | The test wallet, the spending policy and service titles in site storage |
68
+ | `src/lib/format.ts` | Amounts, addresses and times for people |
69
+ | `src/components/` | `PayFlow` (provider, service, request), `ApprovalDialog`, `PaymentCard`, `WalletCard`, `LimitsCard`, `RecentPayments` |
70
+
71
+ ## Not done yet
72
+
73
+ - Signers other than the test key: Stellar Wallets Kit (Freighter and others) and passkey accounts.
74
+ - Approval links from the MCP server, so an agent above its budget can send its human here.
75
+ - Verification badges on the approval screen (they need the verifier).
76
+ - Paying without a prompt below an amount (`autoApproveUpTo`). The page always asks.
77
+ - Precompiling the manifest validator, so the CSP can drop `'unsafe-eval'`.
78
+ - Hosting: any static host works, and it should send `frame-ancestors 'none'` as a header.