@apiosk/mcp 1.7.0 → 2.0.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.
- package/README.md +83 -612
- package/assets/brand/apiosk-a-20260921.png +0 -0
- package/assets/brand/apple-touch-icon.png +0 -0
- package/assets/brand/favicon-dark.ico +0 -0
- package/assets/brand/favicon-light.ico +0 -0
- package/assets/brand/favicon.ico +0 -0
- package/assets/brand/icon-192.png +0 -0
- package/assets/brand/icon-512.png +0 -0
- package/assets/brand/icon-maskable-512.png +0 -0
- package/assets/brand/inter-OFL.txt +93 -0
- package/assets/brand/inter-latin-400-normal.woff2 +0 -0
- package/assets/brand/inter-latin-500-normal.woff2 +0 -0
- package/assets/brand/inter-latin-600-normal.woff2 +0 -0
- package/assets/brand/mark-20260905-transparent.svg +1 -0
- package/assets/brand/mark-20260918.svg +1 -0
- package/assets/brand/mark-black-20260918.svg +1 -0
- package/assets/brand/mark-dark-20260905-transparent.png +0 -0
- package/assets/brand/mark-dark-20260918.png +0 -0
- package/assets/brand/mark-dark-96.png +0 -0
- package/assets/brand/mark-light-20260905-transparent.png +0 -0
- package/assets/brand/mark-light-20260918.png +0 -0
- package/assets/brand/mark-light-96.png +0 -0
- package/assets/brand/wordmark-black-320.png +0 -0
- package/assets/brand/wordmark-white-320.png +0 -0
- package/docs/branding.md +11 -0
- package/docs/marketplace-submission-2026-04-08.md +4 -0
- package/docs/marketplace-submission-2026-08-20.md +157 -0
- package/docs/openai-plugin-submission-2026-09-05.md +143 -0
- package/dxt.json +26 -22
- package/index.mjs +3 -1
- package/logo-optimized-light.png +0 -0
- package/package.json +14 -14
- package/plugin/apiosk/.codex-plugin/plugin.json +45 -0
- package/plugin/apiosk/.mcp.json +8 -0
- package/plugin/apiosk/assets/icon-dark.png +0 -0
- package/plugin/apiosk/assets/icon.png +0 -0
- package/plugin/apiosk/assets/icon.svg +1 -0
- package/plugin/apiosk/assets/logo.png +0 -0
- package/plugin/apiosk/skills/apiosk/SKILL.md +33 -0
- package/plugin/apiosk/skills/apiosk/agents/openai.yaml +12 -0
- package/server.json +58 -24
- package/server.mjs +136 -151
- package/src/approval-feedback.mjs +21 -0
- package/src/brand-routes.mjs +28 -0
- package/src/create-server.mjs +160 -46
- package/src/display-money.mjs +20 -0
- package/src/display-text.mjs +67 -0
- package/src/gateway-client.mjs +42 -0
- package/src/gateway-v2-ask.mjs +50 -0
- package/src/gateway-v2-card-account.mjs +23 -0
- package/src/gateway-v2-card-actions.mjs +67 -0
- package/src/gateway-v2-card-answer-text.mjs +130 -0
- package/src/gateway-v2-card-answer.mjs +68 -0
- package/src/gateway-v2-card-blocks.mjs +166 -0
- package/src/gateway-v2-card-body.mjs +259 -0
- package/src/gateway-v2-card-budget.mjs +21 -0
- package/src/gateway-v2-card-cbs.mjs +56 -0
- package/src/gateway-v2-card-choices.mjs +4 -0
- package/src/gateway-v2-card-clarification.mjs +25 -0
- package/src/gateway-v2-card-compact.mjs +34 -0
- package/src/gateway-v2-card-events.mjs +41 -0
- package/src/gateway-v2-card-presentation.mjs +125 -0
- package/src/gateway-v2-card-research.mjs +63 -0
- package/src/gateway-v2-card-result.mjs +32 -0
- package/src/gateway-v2-card-search.mjs +39 -0
- package/src/gateway-v2-card-sources.mjs +32 -0
- package/src/gateway-v2-card-style.mjs +76 -0
- package/src/gateway-v2-card-verdict.mjs +66 -0
- package/src/gateway-v2-card.mjs +91 -0
- package/src/gateway-v2-contracts.json +66 -0
- package/src/gateway-v2-instructions.md +113 -0
- package/src/gateway-v2-recovery.mjs +18 -0
- package/src/gateway-v2-report-links.mjs +14 -0
- package/src/gateway-v2-workflows.mjs +17 -0
- package/src/gateway-v2.mjs +179 -0
- package/src/oauth.mjs +402 -1949
- package/src/observability.mjs +19 -3
- package/src/result-presentation.mjs +9 -0
- package/src/runtime.mjs +24 -3670
- package/src/source-groups.mjs +91 -0
- package/src/source-value-format.mjs +25 -0
- package/src/tool-result.mjs +20 -0
- package/src/ui-bridge.mjs +185 -0
- package/src/well-known-routes.mjs +132 -0
- package/src/assets/wallet-accounts.mjs +0 -20513
- package/src/assets/walletconnect-provider.mjs +0 -6319
- package/src/discovery.mjs +0 -929
- package/src/external-fetch.mjs +0 -203
- package/src/funding-options.mjs +0 -255
- package/src/gateway-management.mjs +0 -107
- package/src/hosted-payment.mjs +0 -552
- package/src/hosted-wallets.mjs +0 -530
- package/src/listing-metadata.mjs +0 -287
- package/src/local-config.mjs +0 -256
- package/src/payment-guidance.mjs +0 -298
- package/src/publisher.mjs +0 -1288
- package/src/result-canvas.mjs +0 -16
- package/src/source-registry.mjs +0 -215
- package/src/wallet-store.mjs +0 -476
- package/src/x402-inspect.mjs +0 -361
package/src/result-canvas.mjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export const APIO_RESULT_CANVAS_URI = "ui://apiosk/result-canvas.html";
|
|
2
|
-
|
|
3
|
-
// Generic, credential-free result renderer. Paid data is fetched server-side by
|
|
4
|
-
// apiosk_execute; only structuredContent reaches this sandboxed UI.
|
|
5
|
-
export const APIO_RESULT_CANVAS_HTML = `<!doctype html>
|
|
6
|
-
<html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
|
7
|
-
<style>
|
|
8
|
-
:root{color-scheme:light dark;font-family:Inter,ui-sans-serif,system-ui,sans-serif}body{margin:0;padding:16px;background:transparent;color:CanvasText}.shell{border:1px solid color-mix(in srgb,CanvasText 14%,transparent);border-radius:16px;padding:16px;background:color-mix(in srgb,Canvas 94%,transparent)}h2{font-size:16px;margin:0 0 4px}.muted{opacity:.65;font-size:12px}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:10px;margin-top:14px}.metric{padding:12px;border-radius:12px;background:color-mix(in srgb,CanvasText 6%,transparent)}.metric b{display:block;font-size:20px;margin-top:5px}.metric span{font-size:11px;opacity:.65;overflow-wrap:anywhere}canvas{width:100%;height:180px;margin-top:14px}pre{white-space:pre-wrap;word-break:break-word;font:12px ui-monospace,SFMono-Regular,monospace;max-height:260px;overflow:auto;margin:14px 0 0}.hidden{display:none}</style></head>
|
|
9
|
-
<body><main class="shell"><h2 id="title">Apiosk result</h2><div class="muted">Paid data fetched securely through Apiosk</div><div id="metrics" class="grid"></div><canvas id="chart" class="hidden" height="180"></canvas><pre id="json"></pre></main>
|
|
10
|
-
<script>
|
|
11
|
-
const metrics=document.getElementById('metrics'),chart=document.getElementById('chart'),json=document.getElementById('json');
|
|
12
|
-
function unwrap(v){if(!v||typeof v!=='object')return v;return v.result&&typeof v.result==='object'?v.result:v.data&&typeof v.data==='object'?v.data:v}
|
|
13
|
-
function flatten(v,p='',out=[]){if(!v||typeof v!=='object'||out.length>18)return out;for(const [k,x] of Object.entries(v)){const key=p?p+'.'+k:k;if(typeof x==='number'&&Number.isFinite(x))out.push([key,x]);else if(x&&typeof x==='object'&&!Array.isArray(x))flatten(x,key,out)}return out}
|
|
14
|
-
function render(value){const data=unwrap(value);if(data==null)return;const nums=flatten(data);metrics.replaceChildren(...nums.slice(0,8).map(([k,v])=>{const d=document.createElement('div');d.className='metric';const s=document.createElement('span');s.textContent=k;const b=document.createElement('b');b.textContent=new Intl.NumberFormat(undefined,{maximumFractionDigits:2}).format(v);d.append(s,b);return d}));json.textContent=JSON.stringify(data,null,2);if(nums.length>1){chart.classList.remove('hidden');const dpr=devicePixelRatio||1,w=chart.clientWidth||600,h=180;chart.width=w*dpr;chart.height=h*dpr;const c=chart.getContext('2d');c.scale(dpr,dpr);const vals=nums.slice(0,10),max=Math.max(...vals.map(x=>Math.abs(x[1])),1),bw=w/vals.length*.62,gap=w/vals.length;c.fillStyle=getComputedStyle(document.body).color;c.globalAlpha=.72;vals.forEach((x,i)=>{const bh=Math.max(2,Math.abs(x[1])/max*(h-34));c.fillRect(i*gap+gap*.19,h-bh-18,bw,bh)});c.globalAlpha=1}else chart.classList.add('hidden')}
|
|
15
|
-
function current(){return window.openai?.toolOutput??window.openai?.structuredContent??null}render(current());window.addEventListener('openai:set_globals',e=>render(e.detail?.globals?.toolOutput??e.detail?.toolOutput));
|
|
16
|
-
</script></body></html>`;
|
package/src/source-registry.mjs
DELETED
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
// Curated x402 discovery-source registry.
|
|
2
|
-
//
|
|
3
|
-
// These are discovery systems themselves, not Apiosk catalog listings. Keeping
|
|
4
|
-
// them in the MCP means `apiosk_search({search: "x402scan"})` can return the
|
|
5
|
-
// source and its callable endpoints directly even when GET /v1/apis has no API
|
|
6
|
-
// listing with that name. Paid endpoints are described, never called here.
|
|
7
|
-
|
|
8
|
-
const SOURCES = [
|
|
9
|
-
{
|
|
10
|
-
id: "coinbase-bazaar",
|
|
11
|
-
name: "Coinbase x402 Bazaar",
|
|
12
|
-
aliases: ["bazaar", "cdp bazaar", "coinbase discovery"],
|
|
13
|
-
discover_source: "bazaar",
|
|
14
|
-
layer: "discovery",
|
|
15
|
-
summary: "Public x402 resource index used by Coinbase CDP.",
|
|
16
|
-
cost: "free",
|
|
17
|
-
wire_method: "free-rest",
|
|
18
|
-
endpoints: [
|
|
19
|
-
{ role: "list", url: "https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources", payment_required: false },
|
|
20
|
-
{ role: "search", url_template: "https://api.cdp.coinbase.com/platform/v2/x402/discovery/search?query={query}", payment_required: false },
|
|
21
|
-
{ role: "mcp", url: "https://api.cdp.coinbase.com/platform/v2/x402/discovery/mcp", payment_required: false },
|
|
22
|
-
],
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
id: "x402-list",
|
|
26
|
-
name: "x402-list.com",
|
|
27
|
-
aliases: ["x402 list", "x402-list.com"],
|
|
28
|
-
discover_source: "x402-list",
|
|
29
|
-
layer: "discovery",
|
|
30
|
-
summary: "Service-level public x402 directory; resource offers need a live 402 inspection.",
|
|
31
|
-
cost: "2,000 free GET requests per IP/day, then $0.01 per request",
|
|
32
|
-
wire_method: "free-rest-metered",
|
|
33
|
-
endpoints: [
|
|
34
|
-
{ role: "search", url_template: "https://x402-list.com/api/v1/services?q={query}", payment_required: false, may_become_paid: true },
|
|
35
|
-
{ role: "mcp", url: "https://mcp.x402-list.com/mcp", payment_required: false },
|
|
36
|
-
],
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
id: "x402-direct",
|
|
40
|
-
name: "x402.direct",
|
|
41
|
-
aliases: ["x402 direct", "x402.direct"],
|
|
42
|
-
discover_source: "x402-direct",
|
|
43
|
-
layer: "discovery",
|
|
44
|
-
summary: "x402 service directory with crawler-derived trust scores.",
|
|
45
|
-
cost: "free list; paid search costs $0.001",
|
|
46
|
-
wire_method: "free-rest-plus-paid-search",
|
|
47
|
-
endpoints: [
|
|
48
|
-
{ role: "list", url: "https://x402.direct/api/services?limit=25&sort=score", payment_required: false },
|
|
49
|
-
{ role: "search", url_template: "https://x402.direct/api/search?q={query}", payment_required: true, price_usdc: 0.001, executable_via: "apiosk_inspect_x402_then_apiosk_fetch_paid" },
|
|
50
|
-
],
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
id: "agentic-market",
|
|
54
|
-
name: "Agentic.Market",
|
|
55
|
-
aliases: ["agentic market", "coinbase agentic market"],
|
|
56
|
-
discover_source: "agentic-market",
|
|
57
|
-
layer: "discovery",
|
|
58
|
-
summary: "Public Coinbase Agentic.Market service directory.",
|
|
59
|
-
cost: "free",
|
|
60
|
-
wire_method: "free-rest",
|
|
61
|
-
endpoints: [
|
|
62
|
-
{ role: "search", url_template: "https://api.agentic.market/v1/services/search?q={query}", payment_required: false },
|
|
63
|
-
{ role: "list", url: "https://api.agentic.market/v1/services", payment_required: false },
|
|
64
|
-
],
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
id: "thirdweb",
|
|
68
|
-
name: "thirdweb Payments x402 discovery",
|
|
69
|
-
aliases: ["thirdweb discovery", "thirdweb payments", "thirdweb facilitator"],
|
|
70
|
-
discover_source: "thirdweb",
|
|
71
|
-
layer: "aggregator",
|
|
72
|
-
summary: "Public thirdweb x402 discovery index; execution requires provider-specific payment/auth.",
|
|
73
|
-
cost: "free discovery",
|
|
74
|
-
wire_method: "free-rest",
|
|
75
|
-
endpoints: [
|
|
76
|
-
{ role: "search", url_template: "https://api.thirdweb.com/v1/payments/x402/discovery/resources?query={query}", payment_required: false },
|
|
77
|
-
{ role: "mcp", url: "https://api.thirdweb.com/mcp?tools=fetchWithPayment,listPayableServices", payment_required: false, auth_required: true },
|
|
78
|
-
],
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
id: "payai",
|
|
82
|
-
name: "PayAI facilitator discovery",
|
|
83
|
-
aliases: ["payai", "payai facilitator"],
|
|
84
|
-
discover_source: "payai",
|
|
85
|
-
layer: "facilitator",
|
|
86
|
-
summary: "Public multi-chain x402 resource mirror exposed by the PayAI facilitator.",
|
|
87
|
-
cost: "free discovery",
|
|
88
|
-
wire_method: "free-rest",
|
|
89
|
-
endpoints: [
|
|
90
|
-
{ role: "list", url: "https://facilitator.payai.network/discovery/resources", payment_required: false },
|
|
91
|
-
],
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
id: "x402engine",
|
|
95
|
-
name: "x402engine",
|
|
96
|
-
aliases: ["x402 engine", "x402engine.app"],
|
|
97
|
-
discover_source: "x402engine",
|
|
98
|
-
layer: "aggregator",
|
|
99
|
-
summary: "Direct manifest of paid AI, media, code, crypto, web, and travel endpoints.",
|
|
100
|
-
cost: "free discovery; each resource is pay-per-call",
|
|
101
|
-
wire_method: "free-rest",
|
|
102
|
-
endpoints: [
|
|
103
|
-
{ role: "manifest", url: "https://x402engine.app/.well-known/x402.json", payment_required: false },
|
|
104
|
-
{ role: "mcp", url: "https://x402engine.app/mcp", payment_required: false },
|
|
105
|
-
],
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
id: "anchor-x402",
|
|
109
|
-
name: "anchor-x402",
|
|
110
|
-
aliases: ["anchor x402", "anchor-x402.com"],
|
|
111
|
-
discover_source: "anchor-x402",
|
|
112
|
-
layer: "provider",
|
|
113
|
-
summary: "Direct manifest of commodity primitives, verification, and LLM endpoints.",
|
|
114
|
-
cost: "free discovery; each resource is pay-per-call",
|
|
115
|
-
wire_method: "free-rest",
|
|
116
|
-
endpoints: [
|
|
117
|
-
{ role: "manifest", url: "https://api.anchor-x402.com/.well-known/x402", payment_required: false },
|
|
118
|
-
],
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
id: "apify",
|
|
122
|
-
name: "Apify x402 prepaid access",
|
|
123
|
-
aliases: ["apify", "apify actors", "apify mcp"],
|
|
124
|
-
discover_source: "apify",
|
|
125
|
-
layer: "aggregator",
|
|
126
|
-
summary: "Buy an x402 prepaid token, then use it with the Apify Actor marketplace.",
|
|
127
|
-
cost: "minimum $1 prepaid token",
|
|
128
|
-
wire_method: "paid-rest",
|
|
129
|
-
endpoints: [
|
|
130
|
-
{ role: "buy_prepaid_token", url: "https://agi.apify.com/protocols/x402/prepaid-tokens?amount=1¤cy=usd", payment_required: true, price_usdc: 1, executable_via: "apiosk_inspect_x402_then_apiosk_fetch_paid" },
|
|
131
|
-
{ role: "actor_catalog", url_template: "https://api.apify.com/v2/store?search={query}&limit=25", payment_required: false },
|
|
132
|
-
{ role: "mcp", url: "https://mcp.apify.com", payment_required: false, auth_required: true },
|
|
133
|
-
],
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
id: "x402scan",
|
|
137
|
-
name: "x402scan",
|
|
138
|
-
aliases: ["x402 scan", "merit x402scan", "x402scan.com"],
|
|
139
|
-
discover_source: "x402scan",
|
|
140
|
-
layer: "discovery",
|
|
141
|
-
summary: "Paid x402 resource explorer and full-text search API.",
|
|
142
|
-
cost: "$0.01 list; $0.02 search",
|
|
143
|
-
wire_method: "paid-rest",
|
|
144
|
-
endpoints: [
|
|
145
|
-
{ role: "list", url: "https://www.x402scan.com/api/x402/resources", payment_required: true, price_usdc: 0.01, executable_via: "apiosk_inspect_x402_then_apiosk_fetch_paid" },
|
|
146
|
-
{ role: "search", url_template: "https://www.x402scan.com/api/x402/resources/search?q={query}", payment_required: true, price_usdc: 0.02, executable_via: "apiosk_inspect_x402_then_apiosk_fetch_paid" },
|
|
147
|
-
{ role: "openapi", url: "https://www.x402scan.com/openapi.json", payment_required: false },
|
|
148
|
-
],
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
id: "x402list-fun",
|
|
152
|
-
name: "x402list.fun",
|
|
153
|
-
aliases: ["x402list", "x402 list fun", "x402list.fun"],
|
|
154
|
-
discover_source: null,
|
|
155
|
-
layer: "discovery",
|
|
156
|
-
summary: "Large paid MCP-only x402 directory.",
|
|
157
|
-
cost: "$0.001 per MCP search",
|
|
158
|
-
wire_method: "paid-mcp",
|
|
159
|
-
endpoints: [
|
|
160
|
-
{ role: "mcp", url: "https://x402list.fun/mcp", payment_required: true, price_usdc: 0.001, executable_via: "external_mcp_client_required" },
|
|
161
|
-
],
|
|
162
|
-
},
|
|
163
|
-
];
|
|
164
|
-
|
|
165
|
-
function normalize(value) {
|
|
166
|
-
return String(value ?? "")
|
|
167
|
-
.toLowerCase()
|
|
168
|
-
.replace(/[^a-z0-9]+/g, " ")
|
|
169
|
-
.trim();
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
function publicSource(source) {
|
|
173
|
-
const { aliases: _aliases, ...rest } = source;
|
|
174
|
-
return structuredClone(rest);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
export function listKnownSources() {
|
|
178
|
-
return SOURCES.map(publicSource);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
export function searchKnownSources(query, { limit = 12 } = {}) {
|
|
182
|
-
const needle = normalize(query);
|
|
183
|
-
if (!needle) return [];
|
|
184
|
-
const tokens = needle.split(/\s+/).filter((token) => token.length >= 2);
|
|
185
|
-
|
|
186
|
-
return SOURCES
|
|
187
|
-
.map((source) => {
|
|
188
|
-
const names = [source.id, source.name, ...(source.aliases || [])].map(normalize);
|
|
189
|
-
const haystack = normalize([
|
|
190
|
-
...names,
|
|
191
|
-
source.summary,
|
|
192
|
-
source.layer,
|
|
193
|
-
source.wire_method,
|
|
194
|
-
source.cost,
|
|
195
|
-
].join(" "));
|
|
196
|
-
let score = 0;
|
|
197
|
-
if (names.includes(needle)) score += 100;
|
|
198
|
-
if (names.some((name) => name.includes(needle))) score += 50;
|
|
199
|
-
for (const token of tokens) {
|
|
200
|
-
if (names.some((name) => name.includes(token))) score += 10;
|
|
201
|
-
else if (haystack.includes(token)) score += 2;
|
|
202
|
-
}
|
|
203
|
-
return { source, score };
|
|
204
|
-
})
|
|
205
|
-
.filter(({ score }) => score > 0)
|
|
206
|
-
.sort((a, b) => b.score - a.score || a.source.name.localeCompare(b.source.name))
|
|
207
|
-
.slice(0, Math.max(1, Math.min(25, Math.floor(limit))))
|
|
208
|
-
.map(({ source }) => publicSource(source));
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
export function materializeEndpoint(endpoint, query) {
|
|
212
|
-
if (!endpoint?.url_template) return endpoint?.url || null;
|
|
213
|
-
return endpoint.url_template.replace("{query}", encodeURIComponent(String(query ?? "")));
|
|
214
|
-
}
|
|
215
|
-
|