@tool-bridge/server 0.21.1 → 0.23.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/dist/admin.js +170 -0
- package/dist/airtable-VMQVXLHK.js +790 -0
- package/dist/{alt_text_generator_ai-W7O34SNG.js → alt_text_generator_ai-FTWY4RU4.js} +12 -11
- package/dist/{amap-VOX4T2AW.js → amap-OK5VBHYC.js} +221 -220
- package/dist/anthropic-S67AZFZ3.js +203 -0
- package/dist/apify-ZE6MYQI3.js +248 -0
- package/dist/brave_search-TG2M2KOD.js +302 -0
- package/dist/chunk-2JNAI4OC.js +161 -0
- package/dist/{chunk-KMTT3I6D.js → chunk-4XJPN3DY.js} +19392 -26136
- package/dist/chunk-5ICRY3VU.js +8432 -0
- package/dist/chunk-7CTWGTDU.js +302 -0
- package/dist/chunk-BADVCN6K.js +378 -0
- package/dist/{chunk-XYBU3WZH.js → chunk-TDAWLMDE.js} +3 -3
- package/dist/chunk-U7PTOA3U.js +7320 -0
- package/dist/{chunk-E6JCVKW6.js → chunk-VWRUGUSU.js} +3 -3
- package/dist/{chunk-ATK45BXV.js → chunk-WJHG6OK7.js} +4 -2
- package/dist/circleci-3L3WJVSK.js +389 -0
- package/dist/clerk-EZPF2V7T.js +1019 -0
- package/dist/cohere-U27DPO64.js +185 -0
- package/dist/{confluence-B3EWPZVE.js → confluence-G2KL6ERH.js} +105 -104
- package/dist/{convertapi-EUWSQYPF.js → convertapi-L4CLJ2M3.js} +32 -31
- package/dist/{currencyapi-KVTIK3GL.js → currencyapi-YPYXG7YY.js} +71 -71
- package/dist/deepseek-6HT6WF3M.js +210 -0
- package/dist/docker_hub-LPE3PCVB.js +933 -0
- package/dist/dropbox-V56ABHTA.js +1305 -0
- package/dist/dub-6OKQ7MHT.js +680 -0
- package/dist/e2b-JS2U2QFU.js +278 -0
- package/dist/exa-DPWVYXSP.js +332 -0
- package/dist/{fal_ai-23E7JPNT.js → fal_ai-DK6Y27ZF.js} +81 -80
- package/dist/{feishu-7QRIDUV6.js → feishu-K7EGSRF3.js} +528 -572
- package/dist/{feishu_custom_bot-TJ4K7QNJ.js → feishu_custom_bot-2JUGFYNG.js} +57 -53
- package/dist/figma-FT5I7ITD.js +777 -0
- package/dist/firehydrant-EIKLKHX2.js +563 -0
- package/dist/{fixer-BWON27UO.js → fixer-U5QXIAKD.js} +34 -33
- package/dist/fly-T3JYFZ2M.js +469 -0
- package/dist/{front-QCGXYEDJ.js → front-D72MGVOR.js} +104 -104
- package/dist/geocodio-BOTD5TI5.js +213 -0
- package/dist/ghost-KYP7SZGB.js +338 -0
- package/dist/github-AGMZT3VY.js +5421 -0
- package/dist/gmail-BLJNJOBG.js +1887 -0
- package/dist/googlecalendar-GTHWNCF6.js +2524 -0
- package/dist/{googledocs-BUHL4J2H.js → googledocs-6EEDMEBQ.js} +341 -340
- package/dist/{grafana-GLU2DWF2.js → grafana-GMW6EKSQ.js} +221 -220
- package/dist/graphhopper-6OLGBDGB.js +325 -0
- package/dist/index.d.ts +1132 -332
- package/dist/index.js +31 -14
- package/dist/{ip2proxy-EZ64Y4ZH.js → ip2proxy-4QN42E6T.js} +28 -27
- package/dist/ipgeolocation_io-SK4XKDA2.js +315 -0
- package/dist/ipqualityscore-6ANBPXKT.js +279 -0
- package/dist/{jina_ai-EFBHTBXL.js → jina_ai-IHPSVRM5.js} +23 -23
- package/dist/{jira-HQSHAA5K.js → jira-46KKM4LC.js} +118 -117
- package/dist/langsmith-JZA345I5.js +593 -0
- package/dist/lemlist-43IV7DK6.js +289 -0
- package/dist/{linear-K7RYFYAD.js → linear-5LFH7XNL.js} +327 -326
- package/dist/logsnag-5RMYAHIL.js +150 -0
- package/dist/main.js +57 -280
- package/dist/{mattermost-S2BRCWLQ.js → mattermost-XFL6SHGG.js} +59 -58
- package/dist/mem0-NYO4DTP6.js +544 -0
- package/dist/memos-37MPQOLV.js +744 -0
- package/dist/{metabase-MMSEPCOF.js → metabase-KYBKZFMG.js} +90 -89
- package/dist/mistral_ai-6PL3K4PM.js +1196 -0
- package/dist/{mother_duck-H7PCQNZ2.js → mother_duck-2NH7W5M5.js} +94 -93
- package/dist/ngrok-UO6CDYCA.js +356 -0
- package/dist/{notes-PFMKRO33.js → notes-I3P32WP4.js} +11 -9
- package/dist/notion-BEAJFUOE.js +940 -0
- package/dist/open_exchange_rates-CMF62JB4.js +215 -0
- package/dist/openai-IHOMKVND.js +800 -0
- package/dist/opengraph_io-ZQ2FGLHX.js +362 -0
- package/dist/openrouter-HXLW3NR5.js +441 -0
- package/dist/outline-ELCP4NEU.js +599 -0
- package/dist/paddle-O77LALVN.js +454 -0
- package/dist/perplexity-JCU654QV.js +220 -0
- package/dist/pinecone-W5W4LRKL.js +571 -0
- package/dist/{pipedrive-Y2O7QGFF.js → pipedrive-ITMJLLPZ.js} +99 -98
- package/dist/polar-R33XU4L3.js +395 -0
- package/dist/posthog-JVNTOLTV.js +3464 -0
- package/dist/postmark-6SBG7HWV.js +427 -0
- package/dist/{prerender-MENYM2TY.js → prerender-GPNKTNFC.js} +31 -30
- package/dist/{pubmed-GOXUVVH5.js → pubmed-UP6ZEEIH.js} +239 -238
- package/dist/{railway-V2SID4WV.js → railway-KWEWXHTY.js} +118 -117
- package/dist/readwise-BLATSMC3.js +470 -0
- package/dist/render-QYRVIXII.js +461 -0
- package/dist/{replicate-756MXPYX.js → replicate-JYTWH4NF.js} +81 -80
- package/dist/{resend-ZKH3BTBI.js → resend-L5N75SZM.js} +20 -16
- package/dist/rootly-MHCPEQ26.js +336 -0
- package/dist/{scrapfly-NSRHFDIQ.js → scrapfly-PTPGYSJM.js} +62 -61
- package/dist/{scrapingbee-OQHLAVEY.js → scrapingbee-JN6UH5PY.js} +56 -56
- package/dist/{screenshot_fyi-DVWG3AXC.js → screenshot_fyi-4QRVSV55.js} +16 -16
- package/dist/semantic_scholar-LRSWA2GE.js +611 -0
- package/dist/{sentry-546MNDJG.js → sentry-2G6PF5W6.js} +208 -207
- package/dist/{shodan-C3OON3Z3.js → shodan-WKKPP5C6.js} +62 -61
- package/dist/shopify-64YDK5T2.js +610 -0
- package/dist/stripe-QAIGGOTF.js +585 -0
- package/dist/{supabase-U2SL4D63.js → supabase-WHTGR6ND.js} +245 -244
- package/dist/tavily-QIXCDDWO.js +326 -0
- package/dist/telegram-E6G7CWI6.js +1767 -0
- package/dist/{telnyx-CXQ4EZUX.js → telnyx-ZDVVS7PK.js} +57 -56
- package/dist/todoist-DMYF3G7J.js +664 -0
- package/dist/trello-HY2RYIRP.js +1080 -0
- package/dist/turso-HAQWMGRP.js +416 -0
- package/dist/{twilio-4PDBJKWX.js → twilio-MLXYPHJE.js} +70 -69
- package/dist/umami-DZHBLPVG.js +389 -0
- package/dist/unsplash-GS2OPXKE.js +351 -0
- package/dist/{upstash_redis-G4LQBYHA.js → upstash_redis-XMXWTNAJ.js} +51 -50
- package/dist/uptimerobot-TF5WRZ4G.js +483 -0
- package/dist/v2ex-2BVXAPDF.js +667 -0
- package/dist/vercel-YMJGQYJE.js +1076 -0
- package/dist/{wolfram_alpha_api-3G4PUJWB.js → wolfram_alpha_api-I56SXWFZ.js} +36 -35
- package/dist/wordpress-R7TDFZ2P.js +812 -0
- package/dist/workos-HDNHWVMS.js +664 -0
- package/dist/zhihu-LX6AGGDS.js +254 -0
- package/package.json +18 -9
- package/dist/airtable-LLZDFN7M.js +0 -789
- package/dist/anthropic-G23NN3X5.js +0 -202
- package/dist/apify-Y3SS734K.js +0 -247
- package/dist/brave_search-ZC7OAPSZ.js +0 -301
- package/dist/chunk-R6P4XAE5.js +0 -248
- package/dist/chunk-U7B6DS2O.js +0 -977
- package/dist/chunk-UZM2RXZH.js +0 -23436
- package/dist/circleci-3BAX5FCG.js +0 -388
- package/dist/clerk-6LEM6TNU.js +0 -1019
- package/dist/cloudflare_dns-KINYTJUD.js +0 -588
- package/dist/cohere-XCJ5AJ6B.js +0 -185
- package/dist/deepseek-PC5YGNC5.js +0 -209
- package/dist/docker_hub-C3MA5FU6.js +0 -932
- package/dist/dropbox-XBV7Z2IR.js +0 -1304
- package/dist/dub-LDOFG3HC.js +0 -679
- package/dist/e2b-JMCPSVBW.js +0 -277
- package/dist/exa-RAK7O7RD.js +0 -331
- package/dist/figma-E6IX5DTH.js +0 -773
- package/dist/firehydrant-ZBLPQREE.js +0 -562
- package/dist/fly-ZH3HFCZJ.js +0 -468
- package/dist/geocodio-YGNI7DA4.js +0 -212
- package/dist/ghost-EVSGKH2Q.js +0 -337
- package/dist/github-MA2BGRCJ.js +0 -5420
- package/dist/gmail-E5E6AADE.js +0 -1886
- package/dist/googlecalendar-BTLFPXTD.js +0 -2523
- package/dist/graphhopper-WSMB3TCD.js +0 -324
- package/dist/ipgeolocation_io-AA7HAS22.js +0 -315
- package/dist/ipqualityscore-BHJXVTJT.js +0 -277
- package/dist/langsmith-5W6SCT6F.js +0 -592
- package/dist/lemlist-HJWH6UMK.js +0 -288
- package/dist/logsnag-4KFOHL37.js +0 -150
- package/dist/mem0-CAW43CIC.js +0 -543
- package/dist/memos-TWEGPKFM.js +0 -740
- package/dist/mistral_ai-64BGZQHP.js +0 -1195
- package/dist/ngrok-GQCUGZKJ.js +0 -356
- package/dist/notion-DQWZWP4N.js +0 -936
- package/dist/open_exchange_rates-QMMD735E.js +0 -214
- package/dist/openai-W6PX32NZ.js +0 -799
- package/dist/opengraph_io-HNDBXYNW.js +0 -361
- package/dist/openrouter-JJYMEAUL.js +0 -437
- package/dist/outline-MCBNQZYY.js +0 -595
- package/dist/paddle-D2SKLUDN.js +0 -453
- package/dist/perplexity-XIFMKUAE.js +0 -219
- package/dist/pinecone-HUFTALV2.js +0 -570
- package/dist/polar-TYTOMOSR.js +0 -394
- package/dist/posthog-43JAR3VW.js +0 -3463
- package/dist/postmark-KL2QJYSG.js +0 -426
- package/dist/readwise-CI4GIMMJ.js +0 -469
- package/dist/render-SUBJ6YRZ.js +0 -460
- package/dist/rootly-CD2LJHPI.js +0 -336
- package/dist/semantic_scholar-T4A252KW.js +0 -610
- package/dist/shopify-Y2HN2MCQ.js +0 -609
- package/dist/stripe-VE3CD3AY.js +0 -584
- package/dist/tavily-KCZHK6HE.js +0 -326
- package/dist/telegram-3URFBCMY.js +0 -1766
- package/dist/todoist-HNPWNYTD.js +0 -663
- package/dist/trello-3W2MIXRP.js +0 -1079
- package/dist/turso-2EQF7C2Z.js +0 -415
- package/dist/umami-5REN7TGP.js +0 -388
- package/dist/unsplash-EIXL424F.js +0 -350
- package/dist/uptimerobot-KNJ3EYLY.js +0 -482
- package/dist/v2ex-RHJ234PZ.js +0 -666
- package/dist/vercel-AS6NCIC7.js +0 -1075
- package/dist/wordpress-KNDAAUV7.js +0 -811
- package/dist/workos-R6UITSJ7.js +0 -663
- package/dist/zhihu-AGK4HILK.js +0 -253
|
@@ -0,0 +1,461 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createAuthedClient
|
|
3
|
+
} from "./chunk-TDAWLMDE.js";
|
|
4
|
+
import "./chunk-VWRUGUSU.js";
|
|
5
|
+
import {
|
|
6
|
+
trimmedText
|
|
7
|
+
} from "./chunk-JXHMDBAY.js";
|
|
8
|
+
import {
|
|
9
|
+
createProviderPlugin,
|
|
10
|
+
upstreamError
|
|
11
|
+
} from "./chunk-WJHG6OK7.js";
|
|
12
|
+
import "./chunk-2JNAI4OC.js";
|
|
13
|
+
import "./chunk-BADVCN6K.js";
|
|
14
|
+
import {
|
|
15
|
+
TBError
|
|
16
|
+
} from "./chunk-5ICRY3VU.js";
|
|
17
|
+
import "./chunk-U67V476Y.js";
|
|
18
|
+
|
|
19
|
+
// ../plugins/src/render/api.ts
|
|
20
|
+
var SERVICE = "render";
|
|
21
|
+
var API_BASE = "https://api.render.com/v1";
|
|
22
|
+
function pathSegment(value, field) {
|
|
23
|
+
const parsed = trimmedText(value);
|
|
24
|
+
if (parsed === void 0) throw new TBError("invalid_argument", `${field} \u4E0D\u80FD\u4E3A\u7A7A`);
|
|
25
|
+
return encodeURIComponent(parsed);
|
|
26
|
+
}
|
|
27
|
+
function firstString(...values) {
|
|
28
|
+
for (const value of values) {
|
|
29
|
+
if (typeof value === "string" && value !== "") return value;
|
|
30
|
+
}
|
|
31
|
+
return void 0;
|
|
32
|
+
}
|
|
33
|
+
function errorMessage(context) {
|
|
34
|
+
if (context.bodyKind === "empty") return `Render \u8FD4\u56DE HTTP ${context.status}`;
|
|
35
|
+
if (context.bodyKind !== "json") return String(context.data);
|
|
36
|
+
const payload = context.data;
|
|
37
|
+
if (payload !== null && typeof payload === "object" && !Array.isArray(payload)) {
|
|
38
|
+
const object = payload;
|
|
39
|
+
const direct = firstString(object.message, object.error, object.detail, object.title);
|
|
40
|
+
if (direct !== void 0) return direct;
|
|
41
|
+
const errors = object.errors;
|
|
42
|
+
if (Array.isArray(errors) && errors.length > 0) {
|
|
43
|
+
const first = errors[0];
|
|
44
|
+
if (typeof first === "string" && first !== "") return first;
|
|
45
|
+
if (first !== null && typeof first === "object" && !Array.isArray(first)) {
|
|
46
|
+
const nested = firstString(first.message, first.error, first.detail);
|
|
47
|
+
if (nested !== void 0) return nested;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return `Render \u8FD4\u56DE HTTP ${context.status}`;
|
|
52
|
+
}
|
|
53
|
+
var http = createAuthedClient({
|
|
54
|
+
baseUrl: `${API_BASE}/`,
|
|
55
|
+
service: SERVICE,
|
|
56
|
+
auth: { kind: "bearer" },
|
|
57
|
+
headers: { accept: "application/json" },
|
|
58
|
+
// errors 数组与 bodyKind 分叉(非 JSON 原文 String 化不 trim),标准键序提取表达不了,整段覆写。
|
|
59
|
+
mapError: (context) => upstreamError(context.status, errorMessage(context)),
|
|
60
|
+
mapTransportError: ({ message }) => new TBError(
|
|
61
|
+
"unavailable",
|
|
62
|
+
message === void 0 ? "Render \u8BF7\u6C42\u5931\u8D25" : `Render \u8BF7\u6C42\u5931\u8D25: ${message}`,
|
|
63
|
+
{ retryable: true }
|
|
64
|
+
)
|
|
65
|
+
});
|
|
66
|
+
async function send(ctx, input) {
|
|
67
|
+
const query = Object.entries(input.query ?? {}).flatMap(([key, value]) => {
|
|
68
|
+
if (Array.isArray(value)) return value.length === 0 ? [] : [[key, value.join(",")]];
|
|
69
|
+
return [[key, value]];
|
|
70
|
+
});
|
|
71
|
+
return await http.request(ctx, {
|
|
72
|
+
method: input.method ?? "GET",
|
|
73
|
+
path: input.path,
|
|
74
|
+
query,
|
|
75
|
+
...input.body === void 0 ? {} : { json: input.body },
|
|
76
|
+
invalidJson: "text"
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
async function requestJson(ctx, input) {
|
|
80
|
+
const response = await send(ctx, input);
|
|
81
|
+
if (response.bodyKind !== "json") {
|
|
82
|
+
throw new TBError("unavailable", "Render \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94", { retryable: true });
|
|
83
|
+
}
|
|
84
|
+
return response.data;
|
|
85
|
+
}
|
|
86
|
+
async function requestAck(ctx, input) {
|
|
87
|
+
await send(ctx, input);
|
|
88
|
+
}
|
|
89
|
+
function unwrapCursorList(payload, key) {
|
|
90
|
+
if (!Array.isArray(payload)) {
|
|
91
|
+
throw new TBError("unavailable", "Render \u5217\u8868\u54CD\u5E94\u4E0D\u662F\u6570\u7EC4", { retryable: true });
|
|
92
|
+
}
|
|
93
|
+
const items = [];
|
|
94
|
+
let nextCursor = null;
|
|
95
|
+
for (const entry of payload) {
|
|
96
|
+
if (entry === null || typeof entry !== "object" || Array.isArray(entry)) {
|
|
97
|
+
throw new TBError("unavailable", "Render \u5217\u8868\u9879\u4E0D\u662F\u5BF9\u8C61", { retryable: true });
|
|
98
|
+
}
|
|
99
|
+
const record = entry;
|
|
100
|
+
const value = record[key];
|
|
101
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) {
|
|
102
|
+
throw new TBError("unavailable", `Render \u54CD\u5E94\u7F3A\u5C11 ${key}`, { retryable: true });
|
|
103
|
+
}
|
|
104
|
+
items.push(value);
|
|
105
|
+
nextCursor = trimmedText(typeof record.cursor === "string" ? record.cursor : void 0) ?? nextCursor;
|
|
106
|
+
}
|
|
107
|
+
return { items, nextCursor };
|
|
108
|
+
}
|
|
109
|
+
async function getCurrentUser(_input, ctx) {
|
|
110
|
+
return await requestJson(ctx, { path: "/users" });
|
|
111
|
+
}
|
|
112
|
+
async function listWorkspaces(input, ctx) {
|
|
113
|
+
const payload = await requestJson(ctx, {
|
|
114
|
+
path: "/owners",
|
|
115
|
+
query: {
|
|
116
|
+
name: input.name,
|
|
117
|
+
email: input.email,
|
|
118
|
+
cursor: trimmedText(input.cursor),
|
|
119
|
+
limit: input.limit
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
const { items, nextCursor } = unwrapCursorList(payload, "owner");
|
|
123
|
+
return { workspaces: items, nextCursor };
|
|
124
|
+
}
|
|
125
|
+
async function listServices(input, ctx) {
|
|
126
|
+
const payload = await requestJson(ctx, {
|
|
127
|
+
path: "/services",
|
|
128
|
+
query: {
|
|
129
|
+
name: input.name,
|
|
130
|
+
type: input.type,
|
|
131
|
+
ownerId: input.ownerId,
|
|
132
|
+
suspended: input.suspended,
|
|
133
|
+
includePreviews: input.includePreviews,
|
|
134
|
+
cursor: trimmedText(input.cursor),
|
|
135
|
+
limit: input.limit
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
const { items, nextCursor } = unwrapCursorList(payload, "service");
|
|
139
|
+
return { services: items, nextCursor };
|
|
140
|
+
}
|
|
141
|
+
async function getService(input, ctx) {
|
|
142
|
+
return await requestJson(ctx, { path: `/services/${pathSegment(input.serviceId, "serviceId")}` });
|
|
143
|
+
}
|
|
144
|
+
async function listDeploys(input, ctx) {
|
|
145
|
+
const payload = await requestJson(ctx, {
|
|
146
|
+
path: `/services/${pathSegment(input.serviceId, "serviceId")}/deploys`,
|
|
147
|
+
query: {
|
|
148
|
+
status: input.status,
|
|
149
|
+
cursor: trimmedText(input.cursor),
|
|
150
|
+
limit: input.limit
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
const { items, nextCursor } = unwrapCursorList(payload, "deploy");
|
|
154
|
+
return { deploys: items, nextCursor };
|
|
155
|
+
}
|
|
156
|
+
async function triggerDeploy(input, ctx) {
|
|
157
|
+
const serviceId = pathSegment(input.serviceId, "serviceId");
|
|
158
|
+
if (input.deployMode !== void 0 && (input.commitId !== void 0 || input.imageUrl !== void 0 || input.clearCache !== void 0)) {
|
|
159
|
+
throw new TBError("invalid_argument", "deployMode \u4E0D\u80FD\u4E0E commitId\u3001imageUrl\u3001clearCache \u540C\u65F6\u7ED9");
|
|
160
|
+
}
|
|
161
|
+
const response = await send(ctx, {
|
|
162
|
+
path: `/services/${serviceId}/deploys`,
|
|
163
|
+
method: "POST",
|
|
164
|
+
// clearCache 没给时上游也显式发 do_not_clear(而不是省略),保持等价。
|
|
165
|
+
body: {
|
|
166
|
+
clearCache: input.clearCache === true ? "clear" : "do_not_clear",
|
|
167
|
+
...trimmedText(input.commitId) === void 0 ? {} : { commitId: trimmedText(input.commitId) },
|
|
168
|
+
...trimmedText(input.imageUrl) === void 0 ? {} : { imageUrl: trimmedText(input.imageUrl) },
|
|
169
|
+
...input.deployMode === void 0 ? {} : { deployMode: input.deployMode }
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
if (response.status === 202) return { queued: true, serviceId: input.serviceId };
|
|
173
|
+
if (response.bodyKind !== "json") {
|
|
174
|
+
throw new TBError("unavailable", "Render \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94", { retryable: true });
|
|
175
|
+
}
|
|
176
|
+
return response.data;
|
|
177
|
+
}
|
|
178
|
+
async function rollbackDeploy(input, ctx) {
|
|
179
|
+
const serviceId = pathSegment(input.serviceId, "serviceId");
|
|
180
|
+
const deployId = trimmedText(input.deployId);
|
|
181
|
+
if (deployId === void 0) throw new TBError("invalid_argument", "deployId \u4E0D\u80FD\u4E3A\u7A7A");
|
|
182
|
+
return await requestJson(ctx, {
|
|
183
|
+
path: `/services/${serviceId}/rollback`,
|
|
184
|
+
method: "POST",
|
|
185
|
+
body: { deployId }
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
async function restartService(input, ctx) {
|
|
189
|
+
await requestAck(ctx, {
|
|
190
|
+
path: `/services/${pathSegment(input.serviceId, "serviceId")}/restart`,
|
|
191
|
+
method: "POST"
|
|
192
|
+
});
|
|
193
|
+
return { ok: true, serviceId: input.serviceId, action: "restart" };
|
|
194
|
+
}
|
|
195
|
+
async function suspendService(input, ctx) {
|
|
196
|
+
await requestAck(ctx, {
|
|
197
|
+
path: `/services/${pathSegment(input.serviceId, "serviceId")}/suspend`,
|
|
198
|
+
method: "POST"
|
|
199
|
+
});
|
|
200
|
+
return { ok: true, serviceId: input.serviceId, action: "suspend" };
|
|
201
|
+
}
|
|
202
|
+
async function resumeService(input, ctx) {
|
|
203
|
+
await requestAck(ctx, {
|
|
204
|
+
path: `/services/${pathSegment(input.serviceId, "serviceId")}/resume`,
|
|
205
|
+
method: "POST"
|
|
206
|
+
});
|
|
207
|
+
return { ok: true, serviceId: input.serviceId, action: "resume" };
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// ../plugins/src/render/schema.ts
|
|
211
|
+
import { z } from "zod/v4";
|
|
212
|
+
var getCurrentUserInput = z.strictObject({}).describe("Action input.");
|
|
213
|
+
var getCurrentUserOutput = z.strictObject({
|
|
214
|
+
email: z.email().describe("Email address of the authenticated Render user.").optional(),
|
|
215
|
+
name: z.string().describe("Display name of the authenticated Render user.").optional()
|
|
216
|
+
}).describe("Render user.");
|
|
217
|
+
var listWorkspacesInput = z.strictObject({
|
|
218
|
+
name: z.array(z.string().min(1)).min(1).describe("Only return resources with one of these exact names.").optional(),
|
|
219
|
+
email: z.array(z.email().describe("Workspace owner email.")).min(1).describe("Only return workspaces owned by one of these email addresses.").optional(),
|
|
220
|
+
cursor: z.string().min(1).describe("Pagination cursor returned by a previous Render response.").optional(),
|
|
221
|
+
limit: z.int().min(1).max(100).describe("Maximum number of results to return.").optional()
|
|
222
|
+
});
|
|
223
|
+
var listWorkspacesOutput = z.strictObject({
|
|
224
|
+
workspaces: z.array(z.looseObject({
|
|
225
|
+
id: z.string().describe("Unique identifier of the workspace.").optional(),
|
|
226
|
+
name: z.string().describe("Workspace display name.").optional(),
|
|
227
|
+
email: z.email().describe("Primary email address of the workspace.").optional(),
|
|
228
|
+
type: z.enum(["user", "team"]).describe("Workspace type.").optional(),
|
|
229
|
+
ipAllowList: z.array(z.looseObject({}).describe("Object returned by Render.")).describe("IP allow list entries configured for the workspace, when present.").optional(),
|
|
230
|
+
twoFactorAuthEnabled: z.boolean().describe("Whether two-factor authentication is enabled for the workspace owner.").optional()
|
|
231
|
+
}).describe("Render workspace.")).describe("Workspaces returned by Render.").optional(),
|
|
232
|
+
nextCursor: z.string().describe("Cursor for the next page of workspaces, or null when there is no next page.").nullable().optional()
|
|
233
|
+
}).describe("Paginated Render workspace list.");
|
|
234
|
+
var listServicesInput = z.strictObject({
|
|
235
|
+
name: z.array(z.string().min(1)).min(1).describe("Only return resources with one of these exact names.").optional(),
|
|
236
|
+
type: z.array(z.enum(["static_site", "web_service", "private_service", "background_worker", "cron_job"]).describe("Type of service on Render.")).min(1).describe("Only return services with these types.").optional(),
|
|
237
|
+
ownerId: z.array(z.string().min(1)).min(1).describe("Only return resources for one of these workspace IDs.").optional(),
|
|
238
|
+
suspended: z.array(z.enum(["suspended", "not_suspended"]).describe("Suspension state reported by Render.")).min(1).describe("Only return services in one of these suspension states.").optional(),
|
|
239
|
+
includePreviews: z.boolean().describe("Whether preview services should be included in the response.").optional(),
|
|
240
|
+
cursor: z.string().min(1).describe("Pagination cursor returned by a previous Render response.").optional(),
|
|
241
|
+
limit: z.int().min(1).max(100).describe("Maximum number of results to return.").optional()
|
|
242
|
+
});
|
|
243
|
+
var listServicesOutput = z.strictObject({
|
|
244
|
+
services: z.array(z.looseObject({
|
|
245
|
+
id: z.string().describe("Unique identifier of the service.").optional(),
|
|
246
|
+
name: z.string().describe("Name of the service.").optional(),
|
|
247
|
+
ownerId: z.string().describe("Workspace ID that owns the service.").optional(),
|
|
248
|
+
type: z.enum(["static_site", "web_service", "private_service", "background_worker", "cron_job"]).describe("Type of service on Render.").optional(),
|
|
249
|
+
createdAt: z.string().describe("Timestamp in ISO 8601 format.").optional(),
|
|
250
|
+
dashboardUrl: z.string().describe("Dashboard URL for the service.").optional(),
|
|
251
|
+
updatedAt: z.string().describe("Timestamp in ISO 8601 format.").optional(),
|
|
252
|
+
suspended: z.enum(["suspended", "not_suspended"]).describe("Suspension state reported by Render.").optional(),
|
|
253
|
+
suspenders: z.array(z.enum(["admin", "billing", "user", "parent_service", "stuck_crashlooping", "hipaa_enablement", "unknown"]).describe("Reason why the service is suspended.")).describe("Suspension reasons reported for the service.").optional(),
|
|
254
|
+
autoDeploy: z.enum(["yes", "no"]).describe("Whether Render auto-deploys changes for the service.").optional(),
|
|
255
|
+
notifyOnFail: z.enum(["default", "notify", "ignore"]).describe("Notification setting when a deploy fails.").optional(),
|
|
256
|
+
slug: z.string().describe("URL-friendly slug of the service.").optional(),
|
|
257
|
+
serviceDetails: z.looseObject({}).describe("Object returned by Render.").optional(),
|
|
258
|
+
rootDir: z.string().describe("Repository root directory configured for the service.").optional(),
|
|
259
|
+
branch: z.string().describe("Git branch used by the service, when present.").optional(),
|
|
260
|
+
buildFilter: z.looseObject({}).describe("Object returned by Render.").optional(),
|
|
261
|
+
environmentId: z.string().describe("Environment ID attached to the service, when present.").optional(),
|
|
262
|
+
imagePath: z.string().describe("Docker image path used by the service, when present.").optional(),
|
|
263
|
+
registryCredential: z.looseObject({}).describe("Object returned by Render.").optional(),
|
|
264
|
+
repo: z.string().describe("Source repository URL for the service, when present.").optional()
|
|
265
|
+
}).describe("Render service.")).describe("Services returned by Render.").optional(),
|
|
266
|
+
nextCursor: z.string().describe("Cursor for the next page of services, or null when there is no next page.").nullable().optional()
|
|
267
|
+
}).describe("Paginated Render service list.");
|
|
268
|
+
var getServiceInput = z.strictObject({
|
|
269
|
+
serviceId: z.string().min(1).describe("The unique identifier of the Render service.").optional()
|
|
270
|
+
});
|
|
271
|
+
var getServiceOutput = z.looseObject({
|
|
272
|
+
id: z.string().describe("Unique identifier of the service.").optional(),
|
|
273
|
+
name: z.string().describe("Name of the service.").optional(),
|
|
274
|
+
ownerId: z.string().describe("Workspace ID that owns the service.").optional(),
|
|
275
|
+
type: z.enum(["static_site", "web_service", "private_service", "background_worker", "cron_job"]).describe("Type of service on Render.").optional(),
|
|
276
|
+
createdAt: z.string().describe("Timestamp in ISO 8601 format.").optional(),
|
|
277
|
+
dashboardUrl: z.string().describe("Dashboard URL for the service.").optional(),
|
|
278
|
+
updatedAt: z.string().describe("Timestamp in ISO 8601 format.").optional(),
|
|
279
|
+
suspended: z.enum(["suspended", "not_suspended"]).describe("Suspension state reported by Render.").optional(),
|
|
280
|
+
suspenders: z.array(z.enum(["admin", "billing", "user", "parent_service", "stuck_crashlooping", "hipaa_enablement", "unknown"]).describe("Reason why the service is suspended.")).describe("Suspension reasons reported for the service.").optional(),
|
|
281
|
+
autoDeploy: z.enum(["yes", "no"]).describe("Whether Render auto-deploys changes for the service.").optional(),
|
|
282
|
+
notifyOnFail: z.enum(["default", "notify", "ignore"]).describe("Notification setting when a deploy fails.").optional(),
|
|
283
|
+
slug: z.string().describe("URL-friendly slug of the service.").optional(),
|
|
284
|
+
serviceDetails: z.looseObject({}).describe("Object returned by Render.").optional(),
|
|
285
|
+
rootDir: z.string().describe("Repository root directory configured for the service.").optional(),
|
|
286
|
+
branch: z.string().describe("Git branch used by the service, when present.").optional(),
|
|
287
|
+
buildFilter: z.looseObject({}).describe("Object returned by Render.").optional(),
|
|
288
|
+
environmentId: z.string().describe("Environment ID attached to the service, when present.").optional(),
|
|
289
|
+
imagePath: z.string().describe("Docker image path used by the service, when present.").optional(),
|
|
290
|
+
registryCredential: z.looseObject({}).describe("Object returned by Render.").optional(),
|
|
291
|
+
repo: z.string().describe("Source repository URL for the service, when present.").optional()
|
|
292
|
+
}).describe("Render service.");
|
|
293
|
+
var listDeploysInput = z.strictObject({
|
|
294
|
+
serviceId: z.string().min(1).describe("The unique identifier of the Render service."),
|
|
295
|
+
status: z.array(z.enum(["created", "queued", "build_in_progress", "update_in_progress", "live", "deactivated", "build_failed", "update_failed", "canceled", "pre_deploy_in_progress", "pre_deploy_failed"]).describe("Deploy status reported by Render.")).min(1).describe("Only return deploys with these statuses.").optional(),
|
|
296
|
+
cursor: z.string().min(1).describe("Pagination cursor returned by a previous Render response.").optional(),
|
|
297
|
+
limit: z.int().min(1).max(100).describe("Maximum number of results to return.").optional()
|
|
298
|
+
});
|
|
299
|
+
var listDeploysOutput = z.strictObject({
|
|
300
|
+
deploys: z.array(z.looseObject({
|
|
301
|
+
id: z.string().describe("Unique identifier of the deploy.").optional(),
|
|
302
|
+
commit: z.looseObject({}).describe("Object returned by Render.").optional(),
|
|
303
|
+
image: z.looseObject({}).describe("Object returned by Render.").optional(),
|
|
304
|
+
status: z.enum(["created", "queued", "build_in_progress", "update_in_progress", "live", "deactivated", "build_failed", "update_failed", "canceled", "pre_deploy_in_progress", "pre_deploy_failed"]).describe("Deploy status reported by Render.").optional(),
|
|
305
|
+
trigger: z.string().describe("Event that triggered the deploy.").optional(),
|
|
306
|
+
startedAt: z.string().describe("Timestamp in ISO 8601 format.").optional(),
|
|
307
|
+
finishedAt: z.string().describe("Timestamp in ISO 8601 format.").optional(),
|
|
308
|
+
createdAt: z.string().describe("Timestamp in ISO 8601 format.").optional(),
|
|
309
|
+
updatedAt: z.string().describe("Timestamp in ISO 8601 format.").optional()
|
|
310
|
+
}).describe("Render deploy.")).describe("Deploys returned by Render.").optional(),
|
|
311
|
+
nextCursor: z.string().describe("Cursor for the next page of deploys, or null when there is no next page.").nullable().optional()
|
|
312
|
+
}).describe("Paginated Render deploy list.");
|
|
313
|
+
var triggerDeployInput = z.strictObject({
|
|
314
|
+
serviceId: z.string().min(1).describe("The unique identifier of the Render service."),
|
|
315
|
+
clearCache: z.boolean().describe("Whether Render should clear the build cache before deploying.").optional(),
|
|
316
|
+
commitId: z.string().min(1).describe("Specific Git commit SHA to deploy instead of the latest commit.").optional(),
|
|
317
|
+
imageUrl: z.string().min(1).describe("Image URL to deploy for an image-backed service.").optional(),
|
|
318
|
+
deployMode: z.enum(["deploy_only", "build_and_deploy"]).describe("Deployment behavior to use when triggering a deploy.").optional()
|
|
319
|
+
}).describe("Input for triggering a Render deploy. deployMode cannot be combined with commitId, imageUrl, or clearCache.");
|
|
320
|
+
var triggerDeployOutput = z.union([z.looseObject({
|
|
321
|
+
id: z.string().describe("Unique identifier of the deploy.").optional(),
|
|
322
|
+
commit: z.looseObject({}).describe("Object returned by Render.").optional(),
|
|
323
|
+
image: z.looseObject({}).describe("Object returned by Render.").optional(),
|
|
324
|
+
status: z.enum(["created", "queued", "build_in_progress", "update_in_progress", "live", "deactivated", "build_failed", "update_failed", "canceled", "pre_deploy_in_progress", "pre_deploy_failed"]).describe("Deploy status reported by Render.").optional(),
|
|
325
|
+
trigger: z.string().describe("Event that triggered the deploy.").optional(),
|
|
326
|
+
startedAt: z.string().describe("Timestamp in ISO 8601 format.").optional(),
|
|
327
|
+
finishedAt: z.string().describe("Timestamp in ISO 8601 format.").optional(),
|
|
328
|
+
createdAt: z.string().describe("Timestamp in ISO 8601 format.").optional(),
|
|
329
|
+
updatedAt: z.string().describe("Timestamp in ISO 8601 format.").optional()
|
|
330
|
+
}).describe("Render deploy."), z.strictObject({
|
|
331
|
+
queued: z.boolean().describe("Whether the deploy request was accepted and queued.").optional(),
|
|
332
|
+
serviceId: z.string().min(1).describe("The unique identifier of the Render service.").optional()
|
|
333
|
+
}).describe("Acknowledgement for a queued Render deploy request.")]);
|
|
334
|
+
var rollbackDeployInput = z.strictObject({
|
|
335
|
+
serviceId: z.string().min(1).describe("The unique identifier of the Render service.").optional(),
|
|
336
|
+
deployId: z.string().min(1).describe("The unique identifier of the Render deploy.").optional()
|
|
337
|
+
});
|
|
338
|
+
var rollbackDeployOutput = z.looseObject({
|
|
339
|
+
id: z.string().describe("Unique identifier of the deploy.").optional(),
|
|
340
|
+
commit: z.looseObject({}).describe("Object returned by Render.").optional(),
|
|
341
|
+
image: z.looseObject({}).describe("Object returned by Render.").optional(),
|
|
342
|
+
status: z.enum(["created", "queued", "build_in_progress", "update_in_progress", "live", "deactivated", "build_failed", "update_failed", "canceled", "pre_deploy_in_progress", "pre_deploy_failed"]).describe("Deploy status reported by Render.").optional(),
|
|
343
|
+
trigger: z.string().describe("Event that triggered the deploy.").optional(),
|
|
344
|
+
startedAt: z.string().describe("Timestamp in ISO 8601 format.").optional(),
|
|
345
|
+
finishedAt: z.string().describe("Timestamp in ISO 8601 format.").optional(),
|
|
346
|
+
createdAt: z.string().describe("Timestamp in ISO 8601 format.").optional(),
|
|
347
|
+
updatedAt: z.string().describe("Timestamp in ISO 8601 format.").optional()
|
|
348
|
+
}).describe("Render deploy.");
|
|
349
|
+
var restartServiceInput = z.strictObject({
|
|
350
|
+
serviceId: z.string().min(1).describe("The unique identifier of the Render service.").optional()
|
|
351
|
+
});
|
|
352
|
+
var restartServiceOutput = z.strictObject({
|
|
353
|
+
ok: z.boolean().describe("Whether the lifecycle operation request was accepted.").optional(),
|
|
354
|
+
serviceId: z.string().min(1).describe("The unique identifier of the Render service.").optional(),
|
|
355
|
+
action: z.enum(["restart", "suspend", "resume"]).describe("Lifecycle action requested.").optional()
|
|
356
|
+
}).describe("Acknowledgement for a Render lifecycle operation.");
|
|
357
|
+
var suspendServiceInput = z.strictObject({
|
|
358
|
+
serviceId: z.string().min(1).describe("The unique identifier of the Render service.").optional()
|
|
359
|
+
});
|
|
360
|
+
var suspendServiceOutput = z.strictObject({
|
|
361
|
+
ok: z.boolean().describe("Whether the lifecycle operation request was accepted.").optional(),
|
|
362
|
+
serviceId: z.string().min(1).describe("The unique identifier of the Render service.").optional(),
|
|
363
|
+
action: z.enum(["restart", "suspend", "resume"]).describe("Lifecycle action requested.").optional()
|
|
364
|
+
}).describe("Acknowledgement for a Render lifecycle operation.");
|
|
365
|
+
var resumeServiceInput = z.strictObject({
|
|
366
|
+
serviceId: z.string().min(1).describe("The unique identifier of the Render service.").optional()
|
|
367
|
+
});
|
|
368
|
+
var resumeServiceOutput = z.strictObject({
|
|
369
|
+
ok: z.boolean().describe("Whether the lifecycle operation request was accepted.").optional(),
|
|
370
|
+
serviceId: z.string().min(1).describe("The unique identifier of the Render service.").optional(),
|
|
371
|
+
action: z.enum(["restart", "suspend", "resume"]).describe("Lifecycle action requested.").optional()
|
|
372
|
+
}).describe("Acknowledgement for a Render lifecycle operation.");
|
|
373
|
+
var renderActions = {
|
|
374
|
+
get_current_user: {
|
|
375
|
+
description: "Get the currently authenticated Render user profile.",
|
|
376
|
+
effect: "read",
|
|
377
|
+
inputSchema: getCurrentUserInput,
|
|
378
|
+
outputSchema: z.toJSONSchema(getCurrentUserOutput, { io: "output", unrepresentable: "any" })
|
|
379
|
+
},
|
|
380
|
+
list_workspaces: {
|
|
381
|
+
description: "List Render workspaces available to the authenticated API key.",
|
|
382
|
+
effect: "read",
|
|
383
|
+
inputSchema: listWorkspacesInput,
|
|
384
|
+
outputSchema: z.toJSONSchema(listWorkspacesOutput, { io: "output", unrepresentable: "any" })
|
|
385
|
+
},
|
|
386
|
+
list_services: {
|
|
387
|
+
description: "List Render services with optional workspace, type, and suspension filters.",
|
|
388
|
+
effect: "read",
|
|
389
|
+
inputSchema: listServicesInput,
|
|
390
|
+
outputSchema: z.toJSONSchema(listServicesOutput, { io: "output", unrepresentable: "any" })
|
|
391
|
+
},
|
|
392
|
+
get_service: {
|
|
393
|
+
description: "Get Render service details by service ID.",
|
|
394
|
+
effect: "read",
|
|
395
|
+
inputSchema: getServiceInput,
|
|
396
|
+
outputSchema: z.toJSONSchema(getServiceOutput, { io: "output", unrepresentable: "any" })
|
|
397
|
+
},
|
|
398
|
+
list_deploys: {
|
|
399
|
+
description: "List recent Render deploys for a service.",
|
|
400
|
+
effect: "read",
|
|
401
|
+
inputSchema: listDeploysInput,
|
|
402
|
+
outputSchema: z.toJSONSchema(listDeploysOutput, { io: "output", unrepresentable: "any" })
|
|
403
|
+
},
|
|
404
|
+
trigger_deploy: {
|
|
405
|
+
description: "Trigger a new deploy for a Render service.",
|
|
406
|
+
effect: "write",
|
|
407
|
+
inputSchema: triggerDeployInput,
|
|
408
|
+
outputSchema: z.toJSONSchema(triggerDeployOutput, { io: "output", unrepresentable: "any" })
|
|
409
|
+
},
|
|
410
|
+
rollback_deploy: {
|
|
411
|
+
description: "Trigger a rollback to a previous deploy for a Render service.",
|
|
412
|
+
effect: "write",
|
|
413
|
+
inputSchema: rollbackDeployInput,
|
|
414
|
+
outputSchema: z.toJSONSchema(rollbackDeployOutput, { io: "output", unrepresentable: "any" })
|
|
415
|
+
},
|
|
416
|
+
restart_service: {
|
|
417
|
+
description: "Restart a Render service.",
|
|
418
|
+
effect: "write",
|
|
419
|
+
inputSchema: restartServiceInput,
|
|
420
|
+
outputSchema: z.toJSONSchema(restartServiceOutput, { io: "output", unrepresentable: "any" })
|
|
421
|
+
},
|
|
422
|
+
suspend_service: {
|
|
423
|
+
description: "Suspend a Render service.",
|
|
424
|
+
effect: "write",
|
|
425
|
+
inputSchema: suspendServiceInput,
|
|
426
|
+
outputSchema: z.toJSONSchema(suspendServiceOutput, { io: "output", unrepresentable: "any" })
|
|
427
|
+
},
|
|
428
|
+
resume_service: {
|
|
429
|
+
description: "Resume a suspended Render service.",
|
|
430
|
+
effect: "write",
|
|
431
|
+
inputSchema: resumeServiceInput,
|
|
432
|
+
outputSchema: z.toJSONSchema(resumeServiceOutput, { io: "output", unrepresentable: "any" })
|
|
433
|
+
}
|
|
434
|
+
};
|
|
435
|
+
|
|
436
|
+
// ../plugins/src/render/index.ts
|
|
437
|
+
function createRenderPlugin() {
|
|
438
|
+
return createProviderPlugin({
|
|
439
|
+
description: "Render",
|
|
440
|
+
actions: renderActions,
|
|
441
|
+
// 上游的 credentialValidators 就打 /users;get_current_user 是它的同一个调用。
|
|
442
|
+
credentialProbe: "get_current_user",
|
|
443
|
+
handlers: {
|
|
444
|
+
get_current_user: getCurrentUser,
|
|
445
|
+
list_workspaces: listWorkspaces,
|
|
446
|
+
list_services: listServices,
|
|
447
|
+
get_service: getService,
|
|
448
|
+
list_deploys: listDeploys,
|
|
449
|
+
trigger_deploy: triggerDeploy,
|
|
450
|
+
rollback_deploy: rollbackDeploy,
|
|
451
|
+
restart_service: restartService,
|
|
452
|
+
suspend_service: suspendService,
|
|
453
|
+
resume_service: resumeService
|
|
454
|
+
}
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
var render_default = createRenderPlugin();
|
|
458
|
+
export {
|
|
459
|
+
createRenderPlugin,
|
|
460
|
+
render_default as default
|
|
461
|
+
};
|