@probemesh/sdk 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 (83) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +160 -0
  3. package/dist/chunk-257Y7LN2.js +827 -0
  4. package/dist/chunk-257Y7LN2.js.map +1 -0
  5. package/dist/chunk-2ASMVLG4.js +56 -0
  6. package/dist/chunk-2ASMVLG4.js.map +1 -0
  7. package/dist/chunk-2KWGHJYP.js +285 -0
  8. package/dist/chunk-2KWGHJYP.js.map +1 -0
  9. package/dist/chunk-3H7UGVI6.js +1117 -0
  10. package/dist/chunk-3H7UGVI6.js.map +1 -0
  11. package/dist/chunk-5Q3PDYIA.js +657 -0
  12. package/dist/chunk-5Q3PDYIA.js.map +1 -0
  13. package/dist/chunk-CXZOO3U4.js +550 -0
  14. package/dist/chunk-CXZOO3U4.js.map +1 -0
  15. package/dist/chunk-FRFBK4SY.js +270 -0
  16. package/dist/chunk-FRFBK4SY.js.map +1 -0
  17. package/dist/chunk-HJK52QJF.js +994 -0
  18. package/dist/chunk-HJK52QJF.js.map +1 -0
  19. package/dist/chunk-HNBDX7IU.js +705 -0
  20. package/dist/chunk-HNBDX7IU.js.map +1 -0
  21. package/dist/chunk-NYTV263W.js +116 -0
  22. package/dist/chunk-NYTV263W.js.map +1 -0
  23. package/dist/chunk-PXG54XOG.js +595 -0
  24. package/dist/chunk-PXG54XOG.js.map +1 -0
  25. package/dist/chunk-TDOBAMYM.js +607 -0
  26. package/dist/chunk-TDOBAMYM.js.map +1 -0
  27. package/dist/chunk-TV42EZSI.js +2157 -0
  28. package/dist/chunk-TV42EZSI.js.map +1 -0
  29. package/dist/chunk-UU2ZG7P7.js +408 -0
  30. package/dist/chunk-UU2ZG7P7.js.map +1 -0
  31. package/dist/chunk-WKN7QOCA.js +977 -0
  32. package/dist/chunk-WKN7QOCA.js.map +1 -0
  33. package/dist/chunk-ZJOLPBJJ.js +1091 -0
  34. package/dist/chunk-ZJOLPBJJ.js.map +1 -0
  35. package/dist/cli/audit-trail-export.cjs +1193 -0
  36. package/dist/cli/audit-trail-export.cjs.map +1 -0
  37. package/dist/cli/audit-trail-export.d.cts +1 -0
  38. package/dist/cli/audit-trail-export.d.ts +1 -0
  39. package/dist/cli/audit-trail-export.js +24 -0
  40. package/dist/cli/audit-trail-export.js.map +1 -0
  41. package/dist/cli/catalog-check.cjs +2687 -0
  42. package/dist/cli/catalog-check.cjs.map +1 -0
  43. package/dist/cli/catalog-check.d.cts +1 -0
  44. package/dist/cli/catalog-check.d.ts +1 -0
  45. package/dist/cli/catalog-check.js +26 -0
  46. package/dist/cli/catalog-check.js.map +1 -0
  47. package/dist/cli/probemesh-init.cjs +1049 -0
  48. package/dist/cli/probemesh-init.cjs.map +1 -0
  49. package/dist/cli/probemesh-init.d.cts +1 -0
  50. package/dist/cli/probemesh-init.d.ts +1 -0
  51. package/dist/cli/probemesh-init.js +22 -0
  52. package/dist/cli/probemesh-init.js.map +1 -0
  53. package/dist/cli/provider-conformance.cjs +6180 -0
  54. package/dist/cli/provider-conformance.cjs.map +1 -0
  55. package/dist/cli/provider-conformance.d.cts +1 -0
  56. package/dist/cli/provider-conformance.d.ts +1 -0
  57. package/dist/cli/provider-conformance.js +29 -0
  58. package/dist/cli/provider-conformance.js.map +1 -0
  59. package/dist/cli/provider-dossier-check.cjs +2978 -0
  60. package/dist/cli/provider-dossier-check.cjs.map +1 -0
  61. package/dist/cli/provider-dossier-check.d.cts +1 -0
  62. package/dist/cli/provider-dossier-check.d.ts +1 -0
  63. package/dist/cli/provider-dossier-check.js +27 -0
  64. package/dist/cli/provider-dossier-check.js.map +1 -0
  65. package/dist/cli/provider-dossier.cjs +1753 -0
  66. package/dist/cli/provider-dossier.cjs.map +1 -0
  67. package/dist/cli/provider-dossier.d.cts +1 -0
  68. package/dist/cli/provider-dossier.d.ts +1 -0
  69. package/dist/cli/provider-dossier.js +26 -0
  70. package/dist/cli/provider-dossier.js.map +1 -0
  71. package/dist/cli/x402-accept.cjs +6009 -0
  72. package/dist/cli/x402-accept.cjs.map +1 -0
  73. package/dist/cli/x402-accept.d.cts +1 -0
  74. package/dist/cli/x402-accept.d.ts +1 -0
  75. package/dist/cli/x402-accept.js +28 -0
  76. package/dist/cli/x402-accept.js.map +1 -0
  77. package/dist/index.cjs +13671 -0
  78. package/dist/index.cjs.map +1 -0
  79. package/dist/index.d.cts +2026 -0
  80. package/dist/index.d.ts +2026 -0
  81. package/dist/index.js +2560 -0
  82. package/dist/index.js.map +1 -0
  83. package/package.json +111 -0
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ProbeMesh
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
package/README.md ADDED
@@ -0,0 +1,160 @@
1
+ # ProbeMesh SDK
2
+
3
+ The ProbeMesh SDK makes paid API capabilities easier for agents and applications to call, route, verify, and audit.
4
+
5
+ This repository is the source of truth for the public npm package:
6
+
7
+ ```sh
8
+ pnpm add @probemesh/sdk
9
+ ```
10
+
11
+ Public website and developer docs live at [https://probemesh.io](https://probemesh.io). Internal product notes live in [ProbeMesh/internal](https://github.com/ProbeMesh/internal).
12
+
13
+ ## What Is Included
14
+
15
+ - Local SDK calls with `createProbeMesh(...)` and adapters.
16
+ - Provider Kit manifests and protocol adapters.
17
+ - Hosted router for paid calls, receipts, route metadata, timelines, fallback, safe manual retry, and audit artifacts.
18
+ - x402 sandbox, local facilitator, EVM signer, and opt-in testnet helpers.
19
+ - Payment option negotiation and deterministic payment strategy scoring.
20
+ - Provider conformance, x402 acceptance, onboarding dossiers, buyer dossier import, catalog policy, and audit trail CLIs.
21
+ - Integration templates via `probemesh-init`.
22
+
23
+ ## Quickstart
24
+
25
+ ```ts
26
+ import { createPriceLookupAdapter, createProbeMesh } from "@probemesh/sdk";
27
+
28
+ const probemesh = createProbeMesh({
29
+ adapters: [createPriceLookupAdapter()],
30
+ });
31
+
32
+ const response = await probemesh.call({
33
+ capability: "price-lookup",
34
+ input: {
35
+ symbol: "ETH",
36
+ currency: "USD",
37
+ },
38
+ constraints: {
39
+ maxCostUsd: 0.03,
40
+ requireReceipt: true,
41
+ },
42
+ });
43
+
44
+ console.log(response.provider.id, response.cost, response.receiptRefs);
45
+ ```
46
+
47
+ Repo-local demo:
48
+
49
+ ```sh
50
+ pnpm example:price
51
+ pnpm example:paid-price-lookup
52
+ ```
53
+
54
+ ## CLIs
55
+
56
+ The built package exposes:
57
+
58
+ - `probemesh-init`
59
+ - `probemesh-x402-accept`
60
+ - `probemesh-conformance`
61
+ - `probemesh-dossier`
62
+ - `probemesh-dossier-check`
63
+ - `probemesh-catalog-check`
64
+ - `probemesh-audit-trail-export`
65
+
66
+ Repo-local equivalents:
67
+
68
+ ```sh
69
+ pnpm template:init -- --list
70
+ pnpm accept:x402 -- --config examples/x402-acceptance.config.ts
71
+ pnpm conformance:provider -- --config examples/provider-conformance.config.ts
72
+ pnpm dossier:provider -- --config examples/provider-dossier.config.ts
73
+ pnpm check:dossiers -- --config examples/provider-dossier-check.config.ts
74
+ pnpm check:catalog -- --config examples/catalog-policy.config.ts
75
+ pnpm export:audit-trail -- --config examples/audit-trail-export.config.ts
76
+ ```
77
+
78
+ `examples/provider-dossier-check.config.ts` writes artifacts to `/tmp/probemesh-provider-dossier-check-artifacts` by default. Set `PROBEMESH_EXAMPLE_ARTIFACT_DIR` only when you intentionally want a different artifact directory.
79
+
80
+ ## Development
81
+
82
+ ```sh
83
+ pnpm install
84
+ pnpm test
85
+ pnpm typecheck
86
+ pnpm build
87
+ pnpm smoke:dist
88
+ pnpm release:verify
89
+ ```
90
+
91
+ Full local release gate:
92
+
93
+ ```sh
94
+ pnpm ci:release
95
+ pnpm dogfood:internal
96
+ ```
97
+
98
+ `pnpm dogfood:internal` packs the SDK tarball, generates the provider starter, rewrites that starter to use the local tarball before npm publish, runs provider acceptance/conformance/dossier flows, runs buyer/safety/audit examples, and verifies the repo stays clean.
99
+
100
+ ## Beta Release Readiness
101
+
102
+ The SDK is beta-ready locally, but it is not published until the manual npm
103
+ publish command is run by a release owner. No command in this repository
104
+ publishes automatically. The controlled beta flow is:
105
+
106
+ ```sh
107
+ pnpm install
108
+ pnpm build
109
+ pnpm ci:release
110
+ pnpm dogfood:internal
111
+ pnpm release:beta:dry-run
112
+ pnpm release:beta:candidate
113
+ pnpm release:beta:owner-check
114
+ npm publish --tag beta --access public
115
+ pnpm release:beta:postpublish:verify -- --version 0.1.0
116
+ ```
117
+
118
+ `pnpm release:beta:owner-check` requires npm login and performs read-only npm account/package checks before printing the final manual publish command.
119
+
120
+ ## Live x402 Testnet Runbook
121
+
122
+ Live x402 execution is opt-in and should use a dedicated disposable test wallet
123
+ only. For the full setup, wallet funding, expected output, and settlement-failure
124
+ handling checklist, see
125
+ [`docs/live-x402-testnet-runbook.md`](docs/live-x402-testnet-runbook.md).
126
+
127
+ Set the environment variables below before running the testnet examples:
128
+
129
+ ```sh
130
+ PROBEMESH_X402_EVM_PRIVATE_KEY=...
131
+ PROBEMESH_X402_PAY_TO=0x...
132
+ PROBEMESH_X402_ASSET=0x...
133
+ PROBEMESH_X402_NETWORK=eip155:84532
134
+ PROBEMESH_X402_FACILITATOR_URL=https://x402.org/facilitator
135
+ PROBEMESH_X402_RPC_URL=...
136
+ PROBEMESH_X402_AMOUNT=10000
137
+ ```
138
+
139
+ `PROBEMESH_X402_AMOUNT` is an integer in token base units. For the Base Sepolia
140
+ USDC test asset, `10000` is `0.01` USDC.
141
+
142
+ Then run:
143
+
144
+ ```sh
145
+ pnpm example:x402-evm-testnet
146
+ pnpm example:x402-acceptance
147
+ pnpm accept:x402 -- --config examples/x402-acceptance.config.ts
148
+ ```
149
+
150
+ A successful live run should produce `payment_proof`,
151
+ `settlement_confirmation`, and `provider_delivery` receipts; mark payment safety
152
+ as money-may-have-moved; block unsafe retry/fallback after payment evidence; and
153
+ avoid serializing private keys or payment headers in output artifacts.
154
+
155
+ ## Scope Boundaries
156
+
157
+ - The SDK is local/standalone by default and does not require ProbeMesh Cloud.
158
+ - Live x402/testnet execution is opt-in through environment variables.
159
+ - Dossier, catalog, policy, conformance, and audit artifacts are local metadata; they do not register providers or create marketplace listings.
160
+ - Publishing to npm remains manual.