@agishub/mcp 2.1.2 → 2.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/dist/stdio.js +164 -10
- package/package.json +1 -1
package/dist/stdio.js
CHANGED
|
@@ -36549,18 +36549,19 @@ async function snapshot2(o, env2) {
|
|
|
36549
36549
|
}
|
|
36550
36550
|
|
|
36551
36551
|
// src/services/web/handlers.ts
|
|
36552
|
+
var FREE_MAX_CHARS = 8e3;
|
|
36552
36553
|
async function extract3(ctx) {
|
|
36553
36554
|
const { url, render, include_links, include_images, max_chars } = ctx.input;
|
|
36554
36555
|
const mcp = ctx.transport === "mcp";
|
|
36556
|
+
const effectiveMax = mcp ? Math.min(max_chars ?? FREE_MAX_CHARS, FREE_MAX_CHARS) : max_chars;
|
|
36555
36557
|
const result = await extract2(
|
|
36556
|
-
{ url, render: mcp ? false : render, include_links, include_images, max_chars },
|
|
36558
|
+
{ url, render: mcp ? false : render, include_links, include_images, max_chars: effectiveMax },
|
|
36557
36559
|
ctx.env
|
|
36558
36560
|
);
|
|
36559
|
-
if (mcp
|
|
36560
|
-
|
|
36561
|
-
|
|
36562
|
-
|
|
36563
|
-
};
|
|
36561
|
+
if (mcp) {
|
|
36562
|
+
const capped = result.truncated === true;
|
|
36563
|
+
const nudge = render && capped ? "Free MCP tier: static fetch, capped at 8,000 chars. For JavaScript rendering and the full document, use the paid HTTP endpoint POST /v1/web-scraper (x402, $0.004)." : render ? "JavaScript rendering is only on the paid HTTP endpoint POST /v1/web-scraper (x402, $0.004). Returned the static fetch." : capped ? "Free MCP tier: output capped at 8,000 chars. For the full document use the paid HTTP endpoint POST /v1/web-scraper (x402, $0.004)." : void 0;
|
|
36564
|
+
return nudge ? { ...result, tier: "free", note: nudge } : result;
|
|
36564
36565
|
}
|
|
36565
36566
|
return result;
|
|
36566
36567
|
}
|
|
@@ -39643,11 +39644,11 @@ var Observable = function() {
|
|
|
39643
39644
|
return this;
|
|
39644
39645
|
};
|
|
39645
39646
|
Observable2.prototype.pipe = function() {
|
|
39646
|
-
var
|
|
39647
|
+
var operations14 = [];
|
|
39647
39648
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
39648
|
-
|
|
39649
|
+
operations14[_i] = arguments[_i];
|
|
39649
39650
|
}
|
|
39650
|
-
return pipeFromArray(
|
|
39651
|
+
return pipeFromArray(operations14)(this);
|
|
39651
39652
|
};
|
|
39652
39653
|
Observable2.prototype.toPromise = function(promiseCtor) {
|
|
39653
39654
|
var _this = this;
|
|
@@ -57727,6 +57728,150 @@ var browserService = {
|
|
|
57727
57728
|
operations: operations12
|
|
57728
57729
|
};
|
|
57729
57730
|
|
|
57731
|
+
// src/services/feedback/schemas.ts
|
|
57732
|
+
init_zod();
|
|
57733
|
+
var request_feature = external_exports.object({
|
|
57734
|
+
title: external_exports.string().min(3).max(120).describe(
|
|
57735
|
+
"A short, specific title for the request, e.g. 'Add a PDF-merge tool' or 'Support Solana in crypto.price'."
|
|
57736
|
+
),
|
|
57737
|
+
details: external_exports.string().min(10).max(4e3).describe(
|
|
57738
|
+
"What you want and why: the new service, the improvement to an existing one, or the bug. Be concrete about the use case so it can be prioritized."
|
|
57739
|
+
),
|
|
57740
|
+
type: external_exports.enum(["new_service", "improvement", "bug", "other"]).default("other").describe(
|
|
57741
|
+
"The kind of request: a brand-new service, an improvement to an existing one, a bug report, or other feedback."
|
|
57742
|
+
),
|
|
57743
|
+
service: external_exports.string().max(60).optional().describe("Optional: the existing service/tool this relates to, e.g. 'crypto.price' or 'web.extract'."),
|
|
57744
|
+
contact: external_exports.string().max(200).optional().describe(
|
|
57745
|
+
"Optional: how the team can reach you for follow-up \u2014 an email, an X/GitHub handle, or a wallet address. Leave empty to stay anonymous."
|
|
57746
|
+
)
|
|
57747
|
+
});
|
|
57748
|
+
|
|
57749
|
+
// src/services/feedback/core/github.ts
|
|
57750
|
+
var GQL = "https://api.github.com/graphql";
|
|
57751
|
+
var OWNER = "agishub";
|
|
57752
|
+
var REPO = "agishub-mcp";
|
|
57753
|
+
var CATEGORY = "Ideas";
|
|
57754
|
+
var cachedIds = null;
|
|
57755
|
+
async function gql(token, query, variables) {
|
|
57756
|
+
const r = await fetch(GQL, {
|
|
57757
|
+
method: "POST",
|
|
57758
|
+
headers: {
|
|
57759
|
+
authorization: `Bearer ${token}`,
|
|
57760
|
+
"content-type": "application/json",
|
|
57761
|
+
// GitHub rejects API requests without a User-Agent.
|
|
57762
|
+
"user-agent": "agishub-mcp"
|
|
57763
|
+
},
|
|
57764
|
+
body: JSON.stringify({ query, variables })
|
|
57765
|
+
});
|
|
57766
|
+
const json = await r.json().catch(() => ({}));
|
|
57767
|
+
if (!r.ok || json.errors?.length) {
|
|
57768
|
+
const msg = json.errors?.map((e) => e.message).join("; ") || `HTTP ${r.status}`;
|
|
57769
|
+
throw new Error(`GitHub API error: ${msg}`);
|
|
57770
|
+
}
|
|
57771
|
+
return json.data;
|
|
57772
|
+
}
|
|
57773
|
+
async function resolveIds(token) {
|
|
57774
|
+
if (cachedIds) return cachedIds;
|
|
57775
|
+
const data = await gql(
|
|
57776
|
+
token,
|
|
57777
|
+
`query($owner:String!,$repo:String!){
|
|
57778
|
+
repository(owner:$owner,name:$repo){
|
|
57779
|
+
id
|
|
57780
|
+
discussionCategories(first:25){ nodes{ id name } }
|
|
57781
|
+
}
|
|
57782
|
+
}`,
|
|
57783
|
+
{ owner: OWNER, repo: REPO }
|
|
57784
|
+
);
|
|
57785
|
+
const cats = data.repository.discussionCategories.nodes;
|
|
57786
|
+
const cat = cats.find((c) => c.name === CATEGORY) ?? cats[0];
|
|
57787
|
+
if (!cat) throw new Error("The repository has Discussions enabled but no categories.");
|
|
57788
|
+
cachedIds = { repositoryId: data.repository.id, categoryId: cat.id };
|
|
57789
|
+
return cachedIds;
|
|
57790
|
+
}
|
|
57791
|
+
async function createDiscussion(token, input) {
|
|
57792
|
+
const { repositoryId, categoryId } = await resolveIds(token);
|
|
57793
|
+
const data = await gql(
|
|
57794
|
+
token,
|
|
57795
|
+
`mutation($repositoryId:ID!,$categoryId:ID!,$title:String!,$body:String!){
|
|
57796
|
+
createDiscussion(input:{repositoryId:$repositoryId,categoryId:$categoryId,title:$title,body:$body}){
|
|
57797
|
+
discussion{ url number }
|
|
57798
|
+
}
|
|
57799
|
+
}`,
|
|
57800
|
+
{ repositoryId, categoryId, title: input.title, body: input.body }
|
|
57801
|
+
);
|
|
57802
|
+
return data.createDiscussion.discussion;
|
|
57803
|
+
}
|
|
57804
|
+
|
|
57805
|
+
// src/services/feedback/core/notify.ts
|
|
57806
|
+
async function notifyTeam(env2, args) {
|
|
57807
|
+
const key = env2.RESEND_API_KEY;
|
|
57808
|
+
const from2 = env2.FEEDBACK_EMAIL_FROM;
|
|
57809
|
+
const to = env2.FEEDBACK_NOTIFY_EMAIL || "jmavid@gmail.com";
|
|
57810
|
+
if (!key || !from2) return;
|
|
57811
|
+
try {
|
|
57812
|
+
await fetch("https://api.resend.com/emails", {
|
|
57813
|
+
method: "POST",
|
|
57814
|
+
headers: { authorization: `Bearer ${key}`, "content-type": "application/json" },
|
|
57815
|
+
body: JSON.stringify({ from: from2, to, subject: args.subject, text: args.text })
|
|
57816
|
+
});
|
|
57817
|
+
} catch {
|
|
57818
|
+
}
|
|
57819
|
+
}
|
|
57820
|
+
|
|
57821
|
+
// src/services/feedback/handlers.ts
|
|
57822
|
+
var IDEAS_BOARD = "https://github.com/agishub/agishub-mcp/discussions/categories/ideas";
|
|
57823
|
+
var LABEL = {
|
|
57824
|
+
new_service: "New service",
|
|
57825
|
+
improvement: "Improvement",
|
|
57826
|
+
bug: "Bug report",
|
|
57827
|
+
other: "Feedback"
|
|
57828
|
+
};
|
|
57829
|
+
async function feedback_request_feature(ctx) {
|
|
57830
|
+
const { title, details, type, service, contact } = ctx.input;
|
|
57831
|
+
const label = LABEL[type] ?? "Feedback";
|
|
57832
|
+
const token = ctx.env?.GITHUB_TOKEN;
|
|
57833
|
+
if (!token) {
|
|
57834
|
+
return {
|
|
57835
|
+
ok: false,
|
|
57836
|
+
message: "The request channel is not fully configured yet. Please post your request on the community board.",
|
|
57837
|
+
board: IDEAS_BOARD
|
|
57838
|
+
};
|
|
57839
|
+
}
|
|
57840
|
+
const body = [
|
|
57841
|
+
details.trim(),
|
|
57842
|
+
"",
|
|
57843
|
+
"---",
|
|
57844
|
+
`**Type:** ${label}`,
|
|
57845
|
+
service ? `**Related service:** \`${service}\`` : "",
|
|
57846
|
+
contact ? `**Contact:** ${contact}` : "",
|
|
57847
|
+
"*Submitted by an agent via the AgisHub API (`feedback.request_feature`).*"
|
|
57848
|
+
].filter(Boolean).join("\n");
|
|
57849
|
+
const discussion = await createDiscussion(token, { title: `[${label}] ${title}`, body });
|
|
57850
|
+
await notifyTeam(ctx.env, {
|
|
57851
|
+
subject: `New AgisHub request: [${label}] ${title}`,
|
|
57852
|
+
text: `${body}
|
|
57853
|
+
|
|
57854
|
+
Discussion: ${discussion.url}`
|
|
57855
|
+
});
|
|
57856
|
+
return {
|
|
57857
|
+
ok: true,
|
|
57858
|
+
message: "Thanks \u2014 your request was posted to the AgisHub roadmap and the team was notified.",
|
|
57859
|
+
url: discussion.url,
|
|
57860
|
+
number: discussion.number
|
|
57861
|
+
};
|
|
57862
|
+
}
|
|
57863
|
+
|
|
57864
|
+
// src/services/feedback/operations.ts
|
|
57865
|
+
var operations13 = {
|
|
57866
|
+
request_feature: defineOperation(request_feature, feedback_request_feature)
|
|
57867
|
+
};
|
|
57868
|
+
|
|
57869
|
+
// src/services/feedback/index.ts
|
|
57870
|
+
var feedbackService = {
|
|
57871
|
+
name: "feedback",
|
|
57872
|
+
operations: operations13
|
|
57873
|
+
};
|
|
57874
|
+
|
|
57730
57875
|
// src/services/index.ts
|
|
57731
57876
|
var services = [
|
|
57732
57877
|
timezoneService,
|
|
@@ -57740,7 +57885,8 @@ var services = [
|
|
|
57740
57885
|
cryptoService,
|
|
57741
57886
|
ragService,
|
|
57742
57887
|
webhookService,
|
|
57743
|
-
browserService
|
|
57888
|
+
browserService,
|
|
57889
|
+
feedbackService
|
|
57744
57890
|
];
|
|
57745
57891
|
var byId = /* @__PURE__ */ new Map();
|
|
57746
57892
|
for (const svc of services) {
|
|
@@ -58041,6 +58187,14 @@ var catalog = {
|
|
|
58041
58187
|
description: "Generate an image from a text prompt (returned base64-encoded PNG)."
|
|
58042
58188
|
}
|
|
58043
58189
|
},
|
|
58190
|
+
feedback: {
|
|
58191
|
+
request_feature: {
|
|
58192
|
+
channels: ["mcp"],
|
|
58193
|
+
visibility: "public",
|
|
58194
|
+
tags: ["feedback", "feature-request", "roadmap", "support", "community"],
|
|
58195
|
+
description: "Request a new service, an improvement to an existing tool, or report a bug to the AgisHub team. Use this whenever the capability you need doesn't exist yet, an existing tool falls short, or something is broken \u2014 describe what you want and the use case. Free. Your request is posted to the public AgisHub roadmap and the team is notified, so agents (and their humans) can ask for new functionality directly."
|
|
58196
|
+
}
|
|
58197
|
+
},
|
|
58044
58198
|
link: {
|
|
58045
58199
|
shorten: {
|
|
58046
58200
|
channels: ["mcp", "http"],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agishub/mcp",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.3",
|
|
4
4
|
"mcpName": "com.agishub/mcp",
|
|
5
5
|
"description": "AgisHub MCP — pay-per-call tools for AI agents (x402, USDC on Base). Timezone, world clock, date math & scheduling; free via MCP, paid via HTTP. No API key.",
|
|
6
6
|
"keywords": [
|