@agentcash/discovery 0.1.2 → 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.
- package/README.md +20 -0
- package/dist/cli.cjs +4 -1
- package/dist/cli.js +4 -1
- package/dist/index.cjs +495 -24
- package/dist/index.d.cts +85 -1
- package/dist/index.d.ts +85 -1
- package/dist/index.js +491 -23
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -75,6 +75,7 @@ import {
|
|
|
75
75
|
auditContextHarness,
|
|
76
76
|
discover,
|
|
77
77
|
discoverDetailed,
|
|
78
|
+
validatePaymentRequiredDetailed,
|
|
78
79
|
type HarnessClientId,
|
|
79
80
|
} from '@agentcash/discovery';
|
|
80
81
|
|
|
@@ -96,6 +97,16 @@ const harness = await auditContextHarness({
|
|
|
96
97
|
contextWindowTokens: 200000,
|
|
97
98
|
compatMode: 'on',
|
|
98
99
|
});
|
|
100
|
+
|
|
101
|
+
const validation = validatePaymentRequiredDetailed(payload, {
|
|
102
|
+
compatMode: 'strict',
|
|
103
|
+
metadata: {
|
|
104
|
+
title: 'Example API',
|
|
105
|
+
description: 'Sample description',
|
|
106
|
+
favicon: 'https://example.com/favicon.ico',
|
|
107
|
+
ogImages: [{ url: 'https://example.com/og.png' }],
|
|
108
|
+
},
|
|
109
|
+
});
|
|
99
110
|
```
|
|
100
111
|
|
|
101
112
|
## MCP Adapter Contract
|
|
@@ -144,6 +155,11 @@ Behavior:
|
|
|
144
155
|
- `discover(...)` stops at first valid non-empty stage.
|
|
145
156
|
- `discoverDetailed(...)` runs full waterfall and merges deterministically.
|
|
146
157
|
|
|
158
|
+
Validation behavior:
|
|
159
|
+
|
|
160
|
+
- `validatePaymentRequiredDetailed(...)` uses Coinbase `@x402/core` schemas as the structural base gate.
|
|
161
|
+
- Product policy diagnostics (network/schema/metadata) are layered on top with stable issue codes.
|
|
162
|
+
|
|
147
163
|
## Compatibility Modes
|
|
148
164
|
|
|
149
165
|
- `on` (default): legacy adapters enabled.
|
|
@@ -195,3 +211,7 @@ Output:
|
|
|
195
211
|
## Deeper Docs
|
|
196
212
|
|
|
197
213
|
Architecture and planning artifacts live in `.claude/`.
|
|
214
|
+
|
|
215
|
+
Validation design doc:
|
|
216
|
+
|
|
217
|
+
- `docs/VALIDATION_DIAGNOSTICS_DESIGN_2026-03-03.md`
|
package/dist/cli.cjs
CHANGED
|
@@ -637,7 +637,7 @@ function renderJson(run, options) {
|
|
|
637
637
|
}
|
|
638
638
|
|
|
639
639
|
// src/mmm-enabled.ts
|
|
640
|
-
var isMmmEnabled = () => "0.1.
|
|
640
|
+
var isMmmEnabled = () => "0.1.3".includes("-mmm");
|
|
641
641
|
|
|
642
642
|
// src/core/constants.ts
|
|
643
643
|
var OPENAPI_PATH_CANDIDATES = ["/openapi.json", "/.well-known/openapi.json"];
|
|
@@ -2025,6 +2025,9 @@ async function runDiscovery({
|
|
|
2025
2025
|
};
|
|
2026
2026
|
}
|
|
2027
2027
|
|
|
2028
|
+
// src/validation/payment-required.ts
|
|
2029
|
+
var import_schemas = require("@x402/core/schemas");
|
|
2030
|
+
|
|
2028
2031
|
// src/harness.ts
|
|
2029
2032
|
var INTENT_TRIGGERS = ["x402", "mpp", "pay for", "micropayment", "agentic commerce"];
|
|
2030
2033
|
var CLIENT_PROFILES = {
|
package/dist/cli.js
CHANGED
|
@@ -611,7 +611,7 @@ function renderJson(run, options) {
|
|
|
611
611
|
}
|
|
612
612
|
|
|
613
613
|
// src/mmm-enabled.ts
|
|
614
|
-
var isMmmEnabled = () => "0.1.
|
|
614
|
+
var isMmmEnabled = () => "0.1.3".includes("-mmm");
|
|
615
615
|
|
|
616
616
|
// src/core/constants.ts
|
|
617
617
|
var OPENAPI_PATH_CANDIDATES = ["/openapi.json", "/.well-known/openapi.json"];
|
|
@@ -1999,6 +1999,9 @@ async function runDiscovery({
|
|
|
1999
1999
|
};
|
|
2000
2000
|
}
|
|
2001
2001
|
|
|
2002
|
+
// src/validation/payment-required.ts
|
|
2003
|
+
import { parsePaymentRequired } from "@x402/core/schemas";
|
|
2004
|
+
|
|
2002
2005
|
// src/harness.ts
|
|
2003
2006
|
var INTENT_TRIGGERS = ["x402", "mpp", "pay for", "micropayment", "agentic commerce"];
|
|
2004
2007
|
var CLIENT_PROFILES = {
|