opedd-mcp 0.6.9 → 0.6.11
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/dist/index.js +22 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -141,8 +141,13 @@ function buildTools(has) {
|
|
|
141
141
|
"License types: 'human' = republication rights, 'ai' = training dataset rights, 'ai_inference' = inference/RAG rights.",
|
|
142
142
|
inputSchema: {
|
|
143
143
|
type: "object",
|
|
144
|
-
required: ["license_type"],
|
|
144
|
+
required: ["license_type", "terms_accepted"],
|
|
145
145
|
properties: {
|
|
146
|
+
terms_accepted: {
|
|
147
|
+
type: "boolean",
|
|
148
|
+
description: "REQUIRED. Set true only after the buyer (your principal) has accepted the Opedd licence terms at opedd.com/terms. " +
|
|
149
|
+
"The acceptance timestamp is recorded with the licence; purchases without genuine acceptance are rejected.",
|
|
150
|
+
},
|
|
146
151
|
article_url: {
|
|
147
152
|
type: "string",
|
|
148
153
|
description: "URL of the article to license (use this OR article_id)",
|
|
@@ -686,6 +691,10 @@ export async function dispatchTool(name, args, creds = ENV_CREDS) {
|
|
|
686
691
|
if (!article_url && !article_id) {
|
|
687
692
|
return err("Either article_url or article_id is required");
|
|
688
693
|
}
|
|
694
|
+
const termsAccepted = args.terms_accepted;
|
|
695
|
+
if (termsAccepted !== true) {
|
|
696
|
+
return err("terms_accepted must be true — confirm with the buyer that they accept the Opedd licence terms (opedd.com/terms) before purchasing.");
|
|
697
|
+
}
|
|
689
698
|
const buyerEmail = argEmail || creds.buyerEmail;
|
|
690
699
|
if (!buyerEmail) {
|
|
691
700
|
return err("buyer_email is required (or set the OPEDD_BUYER_EMAIL env var)");
|
|
@@ -698,6 +707,8 @@ export async function dispatchTool(name, args, creds = ENV_CREDS) {
|
|
|
698
707
|
const body = {
|
|
699
708
|
license_type,
|
|
700
709
|
buyer_email: buyerEmail,
|
|
710
|
+
// Genuine assent moment: the agent asserted terms_accepted=true just now.
|
|
711
|
+
terms_accepted_at: new Date().toISOString(),
|
|
701
712
|
payment: { method: "stripe_pm", payment_method_id: paymentMethodId },
|
|
702
713
|
...(article_id ? { article_id } : { article_url }),
|
|
703
714
|
...(buyer_name ? { buyer_name } : {}),
|
|
@@ -817,7 +828,6 @@ export async function dispatchTool(name, args, creds = ENV_CREDS) {
|
|
|
817
828
|
}
|
|
818
829
|
const { since, cursor, limit = 50 } = args;
|
|
819
830
|
const params = new URLSearchParams({
|
|
820
|
-
access_key: creds.accessKey,
|
|
821
831
|
format: "json",
|
|
822
832
|
limit: String(Math.min(Number(limit) || 50, 200)),
|
|
823
833
|
});
|
|
@@ -825,7 +835,11 @@ export async function dispatchTool(name, args, creds = ENV_CREDS) {
|
|
|
825
835
|
params.set("since", since);
|
|
826
836
|
if (cursor)
|
|
827
837
|
params.set("cursor", cursor);
|
|
828
|
-
|
|
838
|
+
// Security 2026-07-27: enterprise key travels in a header, not the
|
|
839
|
+
// query string (query strings are logged verbatim by proxies/edge).
|
|
840
|
+
const data = await opeddFetch(creds, `/enterprise-license?${params.toString()}`, {
|
|
841
|
+
headers: { "X-Enterprise-Key": creds.accessKey },
|
|
842
|
+
});
|
|
829
843
|
return ok(data);
|
|
830
844
|
}
|
|
831
845
|
// ── stream_feed_ndjson (Phase 11 M3) ───────────────────────────────────
|
|
@@ -835,7 +849,6 @@ export async function dispatchTool(name, args, creds = ENV_CREDS) {
|
|
|
835
849
|
}
|
|
836
850
|
const { since, cursor, limit = 200 } = args;
|
|
837
851
|
const params = new URLSearchParams({
|
|
838
|
-
access_key: creds.accessKey,
|
|
839
852
|
format: "ndjson",
|
|
840
853
|
limit: String(Math.min(Number(limit) || 200, 1000)),
|
|
841
854
|
});
|
|
@@ -843,7 +856,11 @@ export async function dispatchTool(name, args, creds = ENV_CREDS) {
|
|
|
843
856
|
params.set("since", since);
|
|
844
857
|
if (cursor)
|
|
845
858
|
params.set("cursor", cursor);
|
|
846
|
-
|
|
859
|
+
// Security 2026-07-27: enterprise key travels in a header, not the
|
|
860
|
+
// query string (query strings are logged verbatim by proxies/edge).
|
|
861
|
+
const data = await opeddFetchNdjson(creds, `/enterprise-license?${params.toString()}`, {
|
|
862
|
+
headers: { "X-Enterprise-Key": creds.accessKey },
|
|
863
|
+
});
|
|
847
864
|
return ok(data);
|
|
848
865
|
}
|
|
849
866
|
// ── get_audit_events (Phase 9.x + 10 M5 attestation) ───────────────────
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opedd-mcp",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.11",
|
|
4
4
|
"description": "Licensed, rights-cleared content for AI agents — verifiable license keys, on-chain proof, and EU AI Act attestation. The MCP alternative to unlicensed scraping for RAG and AI search.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|