@tool-bridge/server 0.1.1 → 0.3.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/airtable-V6446SVY.js +792 -0
- package/dist/alt_text_generator_ai-HV7JZPDT.js +72 -0
- package/dist/amap-TTTVB6WS.js +755 -0
- package/dist/anthropic-JH3RA363.js +224 -0
- package/dist/apify-ETNN7ITU.js +262 -0
- package/dist/brave_search-3DDR2MMB.js +322 -0
- package/dist/chunk-CSJEZHQO.js +252 -0
- package/dist/chunk-JLTYA2B3.js +20121 -0
- package/dist/chunk-K7FVSFUX.js +333 -0
- package/dist/{chunk-MQEYFCJB.js → chunk-KGYJEEBI.js} +2770 -21574
- package/dist/circleci-MX3TX3HC.js +409 -0
- package/dist/clerk-MRPORVF4.js +1036 -0
- package/dist/cloudflare_dns-OWP7DD7L.js +605 -0
- package/dist/cohere-GPECP66S.js +197 -0
- package/dist/confluence-BN7LZ6BC.js +436 -0
- package/dist/convertapi-SBEOFOFQ.js +161 -0
- package/dist/currencyapi-P2YY7Y7P.js +306 -0
- package/dist/deepseek-MWB3NYIN.js +205 -0
- package/dist/docker_hub-3JSCIGQ3.js +946 -0
- package/dist/dropbox-RFIBDAXO.js +1308 -0
- package/dist/dub-YVP57ELQ.js +706 -0
- package/dist/e2b-NFSUHTZR.js +305 -0
- package/dist/exa-KTDY6IV3.js +360 -0
- package/dist/fal_ai-OCUENLNQ.js +405 -0
- package/dist/feishu-5CWBQ7E5.js +225 -0
- package/dist/feishu_custom_bot-ZJR22OK6.js +240 -0
- package/dist/figma-YULGANSA.js +798 -0
- package/dist/firehydrant-2V6YSYAP.js +573 -0
- package/dist/fixer-LTCDB3CJ.js +171 -0
- package/dist/fly-IXPKMAML.js +478 -0
- package/dist/front-KRFB4M5X.js +379 -0
- package/dist/geocodio-VVURKYHQ.js +236 -0
- package/dist/ghost-6J2RIOUB.js +341 -0
- package/dist/github-5Z6KQRYH.js +5410 -0
- package/dist/gmail-KU4NZ7VA.js +1894 -0
- package/dist/googlecalendar-X44DFFXG.js +2539 -0
- package/dist/googledocs-WSGLPKSF.js +1322 -0
- package/dist/grafana-4PKSSDXY.js +817 -0
- package/dist/graphhopper-DF65ZNGK.js +336 -0
- package/dist/index.d.ts +181 -2
- package/dist/index.js +2 -1
- package/dist/ip2proxy-UCAQ5P2J.js +118 -0
- package/dist/ipgeolocation_io-UX6FCA2S.js +333 -0
- package/dist/ipqualityscore-MKTRXIZJ.js +287 -0
- package/dist/jina_ai-MRHPCSV5.js +119 -0
- package/dist/jira-EG7ZPOIW.js +627 -0
- package/dist/langsmith-FNO3RCOZ.js +597 -0
- package/dist/lemlist-SN6BJHSG.js +298 -0
- package/dist/linear-H3VU4PSD.js +2163 -0
- package/dist/logsnag-OY2JJT2H.js +167 -0
- package/dist/main.js +246 -2
- package/dist/mattermost-C5SQ7PGD.js +320 -0
- package/dist/mem0-LMLE5BFC.js +567 -0
- package/dist/memos-UWFAMBZC.js +781 -0
- package/dist/metabase-SRYDSDJ6.js +365 -0
- package/dist/mistral_ai-YNIJ7VDM.js +1195 -0
- package/dist/mother_duck-CPGOFEXE.js +322 -0
- package/dist/ngrok-CDJFBSOM.js +375 -0
- package/dist/notes-DIVFH3P3.js +109 -0
- package/dist/notion-HGDKS4HK.js +945 -0
- package/dist/open_exchange_rates-COHHYJDD.js +216 -0
- package/dist/openai-4TRT66GW.js +795 -0
- package/dist/opengraph_io-YKVW4PXI.js +377 -0
- package/dist/openrouter-6CV7B7V5.js +444 -0
- package/dist/outline-YWDUK5F7.js +604 -0
- package/dist/paddle-MEU7HWDZ.js +464 -0
- package/dist/perplexity-MRQUDBIC.js +238 -0
- package/dist/pinecone-JI7X2TAF.js +599 -0
- package/dist/pipedrive-6JQPAW23.js +453 -0
- package/dist/polar-7BF56CMC.js +400 -0
- package/dist/posthog-YPU5ADEN.js +3462 -0
- package/dist/postmark-BEU5OFKU.js +441 -0
- package/dist/prerender-UT5GOOZH.js +180 -0
- package/dist/pubmed-3SGOE24Q.js +1052 -0
- package/dist/railway-CEK4GLRQ.js +452 -0
- package/dist/readwise-DXQUQU67.js +482 -0
- package/dist/render-7TGAU5AW.js +473 -0
- package/dist/replicate-VICFSQ5A.js +347 -0
- package/dist/resend-3E76WK3O.js +100 -0
- package/dist/rootly-36GY46BY.js +345 -0
- package/dist/scrapfly-VDVUYAHX.js +289 -0
- package/dist/scrapingbee-3KTPMAVY.js +247 -0
- package/dist/screenshot_fyi-LKG62C3J.js +116 -0
- package/dist/semantic_scholar-4WREECYO.js +626 -0
- package/dist/sentry-HUQTGXOV.js +1139 -0
- package/dist/shodan-SGRKU4KS.js +303 -0
- package/dist/shopify-YCZ4L5HT.js +620 -0
- package/dist/stripe-OEBKMELB.js +583 -0
- package/dist/supabase-I3DBY7L4.js +937 -0
- package/dist/tavily-B2YHCNRD.js +349 -0
- package/dist/telegram-2VYJELZX.js +1773 -0
- package/dist/telnyx-HHXD3CXL.js +237 -0
- package/dist/todoist-PHFDEEIS.js +672 -0
- package/dist/trello-WUSAK6YN.js +1091 -0
- package/dist/turso-FW56U2B3.js +432 -0
- package/dist/twilio-M5JI7XHA.js +321 -0
- package/dist/umami-HAYODRC4.js +411 -0
- package/dist/unsplash-EDPTNEHJ.js +364 -0
- package/dist/upstash_redis-GC2CLIWD.js +299 -0
- package/dist/uptimerobot-XMSNYLIT.js +481 -0
- package/dist/v2ex-KU4ECD65.js +672 -0
- package/dist/vercel-THPCEFHW.js +1096 -0
- package/dist/wolfram_alpha_api-WHHTH4GU.js +212 -0
- package/dist/wordpress-O6TQEQNF.js +822 -0
- package/dist/workos-A3VHHWI3.js +681 -0
- package/dist/zhihu-BJAI64YJ.js +273 -0
- package/package.json +5 -4
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createProviderPlugin,
|
|
3
|
+
guardedFetch,
|
|
4
|
+
requireApiKey,
|
|
5
|
+
upstreamError
|
|
6
|
+
} from "./chunk-CSJEZHQO.js";
|
|
7
|
+
import "./chunk-K7FVSFUX.js";
|
|
8
|
+
import {
|
|
9
|
+
TBError,
|
|
10
|
+
external_exports
|
|
11
|
+
} from "./chunk-JLTYA2B3.js";
|
|
12
|
+
import "./chunk-MLKGABMK.js";
|
|
13
|
+
|
|
14
|
+
// ../plugins/src/railway/api.ts
|
|
15
|
+
var SERVICE = "railway";
|
|
16
|
+
var GRAPHQL_URL = "https://backboard.railway.com/graphql/v2";
|
|
17
|
+
var DEFAULT_DEPLOYMENT_LIMIT = 20;
|
|
18
|
+
var DEFAULT_LOG_LIMIT = 500;
|
|
19
|
+
function record(value) {
|
|
20
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
21
|
+
}
|
|
22
|
+
function text(value) {
|
|
23
|
+
if (typeof value !== "string") return void 0;
|
|
24
|
+
const trimmed = value.trim();
|
|
25
|
+
return trimmed === "" ? void 0 : trimmed;
|
|
26
|
+
}
|
|
27
|
+
function compact(input) {
|
|
28
|
+
return Object.fromEntries(Object.entries(input).filter(([, value]) => value !== void 0));
|
|
29
|
+
}
|
|
30
|
+
function responseError(message) {
|
|
31
|
+
return new TBError("unavailable", message, { retryable: true });
|
|
32
|
+
}
|
|
33
|
+
function required(value, field) {
|
|
34
|
+
const result = text(value);
|
|
35
|
+
if (result === void 0) throw new TBError("invalid_argument", `${field} \u662F\u5FC5\u586B\u7684`);
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
function errorMessages(payload) {
|
|
39
|
+
const errors = record(payload)?.errors;
|
|
40
|
+
if (!Array.isArray(errors)) return void 0;
|
|
41
|
+
const messages = errors.map((error) => text(record(error)?.message)).filter((message) => message !== void 0);
|
|
42
|
+
return messages.length > 0 ? messages.join("; ") : void 0;
|
|
43
|
+
}
|
|
44
|
+
function errorText(payload, status) {
|
|
45
|
+
const body = record(payload);
|
|
46
|
+
return errorMessages(payload) ?? text(body?.message) ?? text(body?.error) ?? text(body?.detail) ?? text(body?.title) ?? `Railway \u8FD4\u56DE HTTP ${status}`;
|
|
47
|
+
}
|
|
48
|
+
async function graphql(ctx, query, variables) {
|
|
49
|
+
const response = await guardedFetch(GRAPHQL_URL, {
|
|
50
|
+
method: "POST",
|
|
51
|
+
headers: {
|
|
52
|
+
"accept": "application/json",
|
|
53
|
+
"authorization": `Bearer ${requireApiKey(ctx, SERVICE)}`,
|
|
54
|
+
"content-type": "application/json"
|
|
55
|
+
},
|
|
56
|
+
body: JSON.stringify(variables === void 0 ? { query } : { query, variables })
|
|
57
|
+
});
|
|
58
|
+
const body = await response.text();
|
|
59
|
+
let payload;
|
|
60
|
+
if (body.trim() !== "") {
|
|
61
|
+
try {
|
|
62
|
+
payload = JSON.parse(body);
|
|
63
|
+
} catch {
|
|
64
|
+
if (response.ok) throw responseError("Railway \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94");
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (!response.ok) throw upstreamError(response.status, errorText(payload, response.status));
|
|
68
|
+
const envelope = record(payload);
|
|
69
|
+
if (envelope === void 0) throw responseError("Railway GraphQL \u54CD\u5E94\u4E0D\u662F\u5BF9\u8C61");
|
|
70
|
+
const failure = errorMessages(envelope);
|
|
71
|
+
if (failure !== void 0) throw new TBError("invalid_argument", failure);
|
|
72
|
+
const data = record(envelope.data);
|
|
73
|
+
if (data === void 0) throw responseError("Railway GraphQL \u54CD\u5E94\u7F3A data");
|
|
74
|
+
return data;
|
|
75
|
+
}
|
|
76
|
+
function nodes(value) {
|
|
77
|
+
const edges = record(value)?.edges;
|
|
78
|
+
if (!Array.isArray(edges)) return [];
|
|
79
|
+
return edges.flatMap((edge) => {
|
|
80
|
+
const node = record(record(edge)?.node);
|
|
81
|
+
return node === void 0 ? [] : [node];
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function requireValue(value, message) {
|
|
85
|
+
if (value === void 0 || value === null) throw responseError(message);
|
|
86
|
+
return value;
|
|
87
|
+
}
|
|
88
|
+
function workspaceId(ctx) {
|
|
89
|
+
return text(ctx.config?.workspaceId);
|
|
90
|
+
}
|
|
91
|
+
var PROJECT_FIELDS = "id name description createdAt updatedAt";
|
|
92
|
+
var DEPLOYMENT_FIELDS = "id status createdAt url staticUrl";
|
|
93
|
+
async function listProjects(_input, ctx) {
|
|
94
|
+
const workspace = workspaceId(ctx);
|
|
95
|
+
const data = workspace === void 0 ? await graphql(ctx, `query projects {
|
|
96
|
+
projects {
|
|
97
|
+
edges { node { ${PROJECT_FIELDS} } }
|
|
98
|
+
}
|
|
99
|
+
}`) : await graphql(ctx, `query workspaceProjects($workspaceId: String!) {
|
|
100
|
+
projects(workspaceId: $workspaceId) {
|
|
101
|
+
edges { node { ${PROJECT_FIELDS} } }
|
|
102
|
+
}
|
|
103
|
+
}`, { workspaceId: workspace });
|
|
104
|
+
return { projects: nodes(data.projects) };
|
|
105
|
+
}
|
|
106
|
+
async function getProject(input, ctx) {
|
|
107
|
+
const data = await graphql(ctx, `query project($id: String!) {
|
|
108
|
+
project(id: $id) {
|
|
109
|
+
id
|
|
110
|
+
name
|
|
111
|
+
description
|
|
112
|
+
createdAt
|
|
113
|
+
services { edges { node { id name icon } } }
|
|
114
|
+
environments { edges { node { id name } } }
|
|
115
|
+
}
|
|
116
|
+
}`, { id: required(input.projectId, "projectId") });
|
|
117
|
+
const project = requireValue(record(data.project), "Railway \u6CA1\u6709\u8FD4\u56DE project");
|
|
118
|
+
return {
|
|
119
|
+
project: compact({
|
|
120
|
+
id: project.id,
|
|
121
|
+
name: project.name,
|
|
122
|
+
// 上游把缺席的 description 显式归一成 null(出参声明里它是 nullable 的)。
|
|
123
|
+
description: project.description ?? null,
|
|
124
|
+
createdAt: project.createdAt,
|
|
125
|
+
services: nodes(project.services),
|
|
126
|
+
environments: nodes(project.environments)
|
|
127
|
+
})
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
async function getServiceInstance(input, ctx) {
|
|
131
|
+
const data = await graphql(ctx, `query serviceInstance($serviceId: String!, $environmentId: String!) {
|
|
132
|
+
serviceInstance(serviceId: $serviceId, environmentId: $environmentId) {
|
|
133
|
+
id
|
|
134
|
+
serviceName
|
|
135
|
+
startCommand
|
|
136
|
+
buildCommand
|
|
137
|
+
rootDirectory
|
|
138
|
+
healthcheckPath
|
|
139
|
+
region
|
|
140
|
+
numReplicas
|
|
141
|
+
restartPolicyType
|
|
142
|
+
restartPolicyMaxRetries
|
|
143
|
+
latestDeployment { ${DEPLOYMENT_FIELDS} }
|
|
144
|
+
}
|
|
145
|
+
}`, {
|
|
146
|
+
serviceId: required(input.serviceId, "serviceId"),
|
|
147
|
+
environmentId: required(input.environmentId, "environmentId")
|
|
148
|
+
});
|
|
149
|
+
return {
|
|
150
|
+
serviceInstance: requireValue(record(data.serviceInstance), "Railway \u6CA1\u6709\u8FD4\u56DE serviceInstance")
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
async function listDeployments(input, ctx) {
|
|
154
|
+
const data = await graphql(ctx, `query deployments($input: DeploymentListInput!, $first: Int) {
|
|
155
|
+
deployments(input: $input, first: $first) {
|
|
156
|
+
edges { node { ${DEPLOYMENT_FIELDS} } }
|
|
157
|
+
}
|
|
158
|
+
}`, {
|
|
159
|
+
input: {
|
|
160
|
+
projectId: required(input.projectId, "projectId"),
|
|
161
|
+
serviceId: required(input.serviceId, "serviceId"),
|
|
162
|
+
environmentId: required(input.environmentId, "environmentId")
|
|
163
|
+
},
|
|
164
|
+
first: input.limit ?? DEFAULT_DEPLOYMENT_LIMIT
|
|
165
|
+
});
|
|
166
|
+
return { deployments: nodes(data.deployments) };
|
|
167
|
+
}
|
|
168
|
+
async function getDeployment(input, ctx) {
|
|
169
|
+
const data = await graphql(ctx, `query deployment($id: String!) {
|
|
170
|
+
deployment(id: $id) {
|
|
171
|
+
${DEPLOYMENT_FIELDS} meta canRedeploy canRollback
|
|
172
|
+
}
|
|
173
|
+
}`, { id: required(input.deploymentId, "deploymentId") });
|
|
174
|
+
return { deployment: requireValue(record(data.deployment), "Railway \u6CA1\u6709\u8FD4\u56DE deployment") };
|
|
175
|
+
}
|
|
176
|
+
async function getDeploymentLogs(input, ctx) {
|
|
177
|
+
const data = await graphql(ctx, `query deploymentLogs(
|
|
178
|
+
$deploymentId: String!
|
|
179
|
+
$limit: Int
|
|
180
|
+
$filter: String
|
|
181
|
+
$startDate: DateTime
|
|
182
|
+
$endDate: DateTime
|
|
183
|
+
) {
|
|
184
|
+
deploymentLogs(
|
|
185
|
+
deploymentId: $deploymentId
|
|
186
|
+
limit: $limit
|
|
187
|
+
filter: $filter
|
|
188
|
+
startDate: $startDate
|
|
189
|
+
endDate: $endDate
|
|
190
|
+
) {
|
|
191
|
+
timestamp message severity
|
|
192
|
+
}
|
|
193
|
+
}`, compact({
|
|
194
|
+
deploymentId: required(input.deploymentId, "deploymentId"),
|
|
195
|
+
limit: input.limit ?? DEFAULT_LOG_LIMIT,
|
|
196
|
+
filter: text(input.filter),
|
|
197
|
+
startDate: text(input.startDate),
|
|
198
|
+
endDate: text(input.endDate)
|
|
199
|
+
}));
|
|
200
|
+
return { logs: Array.isArray(data.deploymentLogs) ? data.deploymentLogs : [] };
|
|
201
|
+
}
|
|
202
|
+
async function deployService(input, ctx) {
|
|
203
|
+
const data = await graphql(
|
|
204
|
+
ctx,
|
|
205
|
+
`mutation serviceInstanceDeployV2($serviceId: String!, $environmentId: String!, $commitSha: String) {
|
|
206
|
+
serviceInstanceDeployV2(serviceId: $serviceId, environmentId: $environmentId, commitSha: $commitSha)
|
|
207
|
+
}`,
|
|
208
|
+
compact({
|
|
209
|
+
serviceId: required(input.serviceId, "serviceId"),
|
|
210
|
+
environmentId: required(input.environmentId, "environmentId"),
|
|
211
|
+
commitSha: text(input.commitSha)
|
|
212
|
+
})
|
|
213
|
+
);
|
|
214
|
+
return {
|
|
215
|
+
deploymentId: requireValue(data.serviceInstanceDeployV2, "Railway \u6CA1\u6709\u8FD4\u56DE deployment id")
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
async function upsertVariable(input, ctx) {
|
|
219
|
+
const data = await graphql(ctx, `mutation variableUpsert($input: VariableUpsertInput!) {
|
|
220
|
+
variableUpsert(input: $input)
|
|
221
|
+
}`, {
|
|
222
|
+
input: compact({
|
|
223
|
+
projectId: required(input.projectId, "projectId"),
|
|
224
|
+
environmentId: required(input.environmentId, "environmentId"),
|
|
225
|
+
serviceId: text(input.serviceId),
|
|
226
|
+
name: required(input.name, "name"),
|
|
227
|
+
// 变量值不透明:空串与前后空白都要原样写进去。
|
|
228
|
+
value: input.value,
|
|
229
|
+
skipDeploys: input.skipDeploys
|
|
230
|
+
})
|
|
231
|
+
});
|
|
232
|
+
return { updated: requireValue(data.variableUpsert, "Railway \u6CA1\u6709\u8FD4\u56DE\u53D8\u91CF\u66F4\u65B0\u7ED3\u679C") };
|
|
233
|
+
}
|
|
234
|
+
async function rollbackDeployment(input, ctx) {
|
|
235
|
+
const data = await graphql(ctx, `mutation deploymentRollback($id: String!) {
|
|
236
|
+
deploymentRollback(id: $id) { ${DEPLOYMENT_FIELDS} }
|
|
237
|
+
}`, { id: required(input.deploymentId, "deploymentId") });
|
|
238
|
+
return { deployment: requireValue(record(data.deploymentRollback), "Railway \u6CA1\u6709\u8FD4\u56DE\u56DE\u6EDA\u540E\u7684 deployment") };
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// ../plugins/src/railway/schema.ts
|
|
242
|
+
var listProjectsInput = external_exports.strictObject({}).describe("Input for listing Railway projects.");
|
|
243
|
+
var listProjectsOutput = external_exports.strictObject({
|
|
244
|
+
projects: external_exports.array(external_exports.strictObject({
|
|
245
|
+
id: external_exports.string().min(1).describe("Railway project ID."),
|
|
246
|
+
name: external_exports.string().min(1).describe("Project name."),
|
|
247
|
+
description: external_exports.string().describe("Project description.").nullable().optional(),
|
|
248
|
+
createdAt: external_exports.iso.datetime({ offset: true }).describe("When the project was created.").optional(),
|
|
249
|
+
updatedAt: external_exports.iso.datetime({ offset: true }).describe("When the project was last updated.").optional()
|
|
250
|
+
}).describe("A Railway project.")).describe("Railway projects.").optional()
|
|
251
|
+
}).describe("Railway projects available to the token.");
|
|
252
|
+
var getProjectInput = external_exports.strictObject({
|
|
253
|
+
projectId: external_exports.string().min(1).describe("Railway project ID.").optional()
|
|
254
|
+
}).describe("Input for retrieving a Railway project.");
|
|
255
|
+
var getProjectOutput = external_exports.strictObject({
|
|
256
|
+
project: external_exports.strictObject({
|
|
257
|
+
id: external_exports.string().min(1).describe("Railway project ID."),
|
|
258
|
+
name: external_exports.string().min(1).describe("Project name."),
|
|
259
|
+
description: external_exports.string().describe("Project description.").nullable().optional(),
|
|
260
|
+
createdAt: external_exports.iso.datetime({ offset: true }).describe("When the project was created.").optional(),
|
|
261
|
+
services: external_exports.array(external_exports.strictObject({
|
|
262
|
+
id: external_exports.string().min(1).describe("Railway service ID."),
|
|
263
|
+
name: external_exports.string().min(1).describe("Service name."),
|
|
264
|
+
icon: external_exports.string().describe("Service icon URL or identifier.").nullable().optional()
|
|
265
|
+
}).describe("A Railway service.")).describe("Services in the project."),
|
|
266
|
+
environments: external_exports.array(external_exports.strictObject({
|
|
267
|
+
id: external_exports.string().min(1).describe("Railway environment ID.").optional(),
|
|
268
|
+
name: external_exports.string().min(1).describe("Environment name.").optional()
|
|
269
|
+
}).describe("A Railway environment.")).describe("Environments in the project.")
|
|
270
|
+
}).describe("Railway project details.").optional()
|
|
271
|
+
}).describe("A Railway project with related resources.");
|
|
272
|
+
var getServiceInstanceInput = external_exports.strictObject({
|
|
273
|
+
serviceId: external_exports.string().min(1).describe("Railway service ID.").optional(),
|
|
274
|
+
environmentId: external_exports.string().min(1).describe("Railway environment ID.").optional()
|
|
275
|
+
}).describe("Input for retrieving a Railway service instance.");
|
|
276
|
+
var getServiceInstanceOutput = external_exports.strictObject({
|
|
277
|
+
serviceInstance: external_exports.looseObject({
|
|
278
|
+
id: external_exports.string().min(1).describe("Railway service instance ID."),
|
|
279
|
+
serviceName: external_exports.string().min(1).describe("Service name."),
|
|
280
|
+
startCommand: external_exports.string().describe("Configured start command.").nullable().optional(),
|
|
281
|
+
buildCommand: external_exports.string().describe("Configured build command.").nullable().optional(),
|
|
282
|
+
rootDirectory: external_exports.string().describe("Configured repository root directory.").nullable().optional(),
|
|
283
|
+
healthcheckPath: external_exports.string().describe("Configured health check path.").nullable().optional(),
|
|
284
|
+
region: external_exports.string().describe("Deployment region.").nullable().optional(),
|
|
285
|
+
numReplicas: external_exports.int().describe("Configured replica count.").nullable().optional(),
|
|
286
|
+
restartPolicyType: external_exports.string().describe("Restart policy type.").nullable().optional(),
|
|
287
|
+
restartPolicyMaxRetries: external_exports.int().describe("Maximum restart attempts.").nullable().optional(),
|
|
288
|
+
latestDeployment: external_exports.strictObject({
|
|
289
|
+
id: external_exports.string().min(1).describe("Railway deployment ID."),
|
|
290
|
+
status: external_exports.string().min(1).describe("Current Railway deployment status."),
|
|
291
|
+
createdAt: external_exports.iso.datetime({ offset: true }).describe("When the deployment was created.").optional(),
|
|
292
|
+
url: external_exports.string().describe("Deployment URL.").nullable().optional(),
|
|
293
|
+
staticUrl: external_exports.string().describe("Static deployment URL.").nullable().optional()
|
|
294
|
+
}).describe("A Railway deployment.").nullable().optional()
|
|
295
|
+
}).describe("A Railway service instance.").optional()
|
|
296
|
+
}).describe("Railway service instance configuration.");
|
|
297
|
+
var listDeploymentsInput = external_exports.strictObject({
|
|
298
|
+
projectId: external_exports.string().min(1).describe("Railway project ID."),
|
|
299
|
+
serviceId: external_exports.string().min(1).describe("Railway service ID."),
|
|
300
|
+
environmentId: external_exports.string().min(1).describe("Railway environment ID."),
|
|
301
|
+
limit: external_exports.int().min(1).max(100).default(20).describe("Maximum number of deployments to return.").optional()
|
|
302
|
+
}).describe("Filters for Railway deployments.");
|
|
303
|
+
var listDeploymentsOutput = external_exports.strictObject({
|
|
304
|
+
deployments: external_exports.array(external_exports.strictObject({
|
|
305
|
+
id: external_exports.string().min(1).describe("Railway deployment ID."),
|
|
306
|
+
status: external_exports.string().min(1).describe("Current Railway deployment status."),
|
|
307
|
+
createdAt: external_exports.iso.datetime({ offset: true }).describe("When the deployment was created.").optional(),
|
|
308
|
+
url: external_exports.string().describe("Deployment URL.").nullable().optional(),
|
|
309
|
+
staticUrl: external_exports.string().describe("Static deployment URL.").nullable().optional()
|
|
310
|
+
}).describe("A Railway deployment.")).describe("Railway deployments ordered by the provider.").optional()
|
|
311
|
+
}).describe("Recent Railway deployments.");
|
|
312
|
+
var getDeploymentInput = external_exports.strictObject({
|
|
313
|
+
deploymentId: external_exports.string().min(1).describe("Railway deployment ID.").optional()
|
|
314
|
+
}).describe("Input for retrieving a Railway deployment.");
|
|
315
|
+
var getDeploymentOutput = external_exports.strictObject({
|
|
316
|
+
deployment: external_exports.strictObject({
|
|
317
|
+
id: external_exports.string().min(1).describe("Railway deployment ID."),
|
|
318
|
+
status: external_exports.string().min(1).describe("Current Railway deployment status."),
|
|
319
|
+
createdAt: external_exports.iso.datetime({ offset: true }).describe("When the deployment was created.").optional(),
|
|
320
|
+
url: external_exports.string().describe("Deployment URL.").nullable().optional(),
|
|
321
|
+
staticUrl: external_exports.string().describe("Static deployment URL.").nullable().optional(),
|
|
322
|
+
canRedeploy: external_exports.boolean().describe("Whether Railway allows this deployment to be redeployed.").optional(),
|
|
323
|
+
canRollback: external_exports.boolean().describe("Whether Railway allows a rollback to this deployment.").optional(),
|
|
324
|
+
meta: external_exports.looseObject({}).describe("Provider-defined deployment metadata.").nullable().optional()
|
|
325
|
+
}).describe("Detailed Railway deployment information.").optional()
|
|
326
|
+
}).describe("A Railway deployment.");
|
|
327
|
+
var getDeploymentLogsInput = external_exports.strictObject({
|
|
328
|
+
deploymentId: external_exports.string().min(1).describe("Railway deployment ID."),
|
|
329
|
+
limit: external_exports.int().min(1).max(5e3).default(500).describe("Maximum number of log entries to return.").optional(),
|
|
330
|
+
filter: external_exports.string().min(1).describe("Railway log filter expression.").optional(),
|
|
331
|
+
startDate: external_exports.iso.datetime({ offset: true }).describe("Start of the log time range.").optional(),
|
|
332
|
+
endDate: external_exports.iso.datetime({ offset: true }).describe("End of the log time range.").optional()
|
|
333
|
+
}).describe("Filters for Railway deployment logs.");
|
|
334
|
+
var getDeploymentLogsOutput = external_exports.strictObject({
|
|
335
|
+
logs: external_exports.array(external_exports.strictObject({
|
|
336
|
+
timestamp: external_exports.string().min(1).describe("Provider timestamp for the log entry."),
|
|
337
|
+
message: external_exports.string().describe("Log message."),
|
|
338
|
+
severity: external_exports.string().describe("Log severity.").nullable().optional()
|
|
339
|
+
}).describe("A Railway runtime log entry.")).describe("Railway runtime log entries.").optional()
|
|
340
|
+
}).describe("Runtime log entries for a Railway deployment.");
|
|
341
|
+
var deployServiceInput = external_exports.strictObject({
|
|
342
|
+
serviceId: external_exports.string().min(1).describe("Railway service ID."),
|
|
343
|
+
environmentId: external_exports.string().min(1).describe("Railway environment ID."),
|
|
344
|
+
commitSha: external_exports.string().min(1).describe("Commit SHA from the repository connected to the Railway service.").optional()
|
|
345
|
+
}).describe("Input for deploying a Railway service.");
|
|
346
|
+
var deployServiceOutput = external_exports.strictObject({
|
|
347
|
+
deploymentId: external_exports.string().min(1).describe("Railway deployment ID.").optional()
|
|
348
|
+
}).describe("The triggered Railway deployment.");
|
|
349
|
+
var upsertVariableInput = external_exports.strictObject({
|
|
350
|
+
projectId: external_exports.string().min(1).describe("Railway project ID."),
|
|
351
|
+
serviceId: external_exports.string().min(1).describe("Railway service ID.").optional(),
|
|
352
|
+
environmentId: external_exports.string().min(1).describe("Railway environment ID."),
|
|
353
|
+
name: external_exports.string().min(1).max(255).regex(new RegExp("^[A-Za-z_][A-Za-z0-9_]*$")).describe("Variable name."),
|
|
354
|
+
value: external_exports.string().describe("Variable value. This may contain a Railway variable reference."),
|
|
355
|
+
skipDeploys: external_exports.boolean().describe("Do not automatically redeploy after updating the variable.").optional()
|
|
356
|
+
}).describe("Input for creating or updating a Railway variable.");
|
|
357
|
+
var upsertVariableOutput = external_exports.strictObject({
|
|
358
|
+
updated: external_exports.boolean().describe("Whether Railway accepted the variable update.").optional()
|
|
359
|
+
}).describe("Result of updating a Railway variable.");
|
|
360
|
+
var rollbackDeploymentInput = external_exports.strictObject({
|
|
361
|
+
deploymentId: external_exports.string().min(1).describe("Rollback-capable Railway deployment ID.").optional()
|
|
362
|
+
}).describe("Input for rolling back a Railway deployment.");
|
|
363
|
+
var rollbackDeploymentOutput = external_exports.strictObject({
|
|
364
|
+
deployment: external_exports.strictObject({
|
|
365
|
+
id: external_exports.string().min(1).describe("Railway deployment ID."),
|
|
366
|
+
status: external_exports.string().min(1).describe("Current Railway deployment status."),
|
|
367
|
+
createdAt: external_exports.iso.datetime({ offset: true }).describe("When the deployment was created.").optional(),
|
|
368
|
+
url: external_exports.string().describe("Deployment URL.").nullable().optional(),
|
|
369
|
+
staticUrl: external_exports.string().describe("Static deployment URL.").nullable().optional()
|
|
370
|
+
}).describe("A Railway deployment.").optional()
|
|
371
|
+
}).describe("The Railway deployment created by the rollback.");
|
|
372
|
+
var railwayActions = {
|
|
373
|
+
list_projects: {
|
|
374
|
+
description: "List Railway projects available to the configured account or workspace token.",
|
|
375
|
+
effect: "read",
|
|
376
|
+
inputSchema: listProjectsInput,
|
|
377
|
+
outputSchema: external_exports.toJSONSchema(listProjectsOutput, { io: "output", unrepresentable: "any" })
|
|
378
|
+
},
|
|
379
|
+
get_project: {
|
|
380
|
+
description: "Get a Railway project together with its services and environments.",
|
|
381
|
+
effect: "read",
|
|
382
|
+
inputSchema: getProjectInput,
|
|
383
|
+
outputSchema: external_exports.toJSONSchema(getProjectOutput, { io: "output", unrepresentable: "any" })
|
|
384
|
+
},
|
|
385
|
+
get_service_instance: {
|
|
386
|
+
description: "Get Railway service configuration and its latest deployment in one environment.",
|
|
387
|
+
effect: "read",
|
|
388
|
+
inputSchema: getServiceInstanceInput,
|
|
389
|
+
outputSchema: external_exports.toJSONSchema(getServiceInstanceOutput, { io: "output", unrepresentable: "any" })
|
|
390
|
+
},
|
|
391
|
+
list_deployments: {
|
|
392
|
+
description: "List recent Railway deployments for a service and environment.",
|
|
393
|
+
effect: "read",
|
|
394
|
+
inputSchema: listDeploymentsInput,
|
|
395
|
+
outputSchema: external_exports.toJSONSchema(listDeploymentsOutput, { io: "output", unrepresentable: "any" })
|
|
396
|
+
},
|
|
397
|
+
get_deployment: {
|
|
398
|
+
description: "Get one Railway deployment and its redeploy and rollback capabilities.",
|
|
399
|
+
effect: "read",
|
|
400
|
+
inputSchema: getDeploymentInput,
|
|
401
|
+
outputSchema: external_exports.toJSONSchema(getDeploymentOutput, { io: "output", unrepresentable: "any" })
|
|
402
|
+
},
|
|
403
|
+
get_deployment_logs: {
|
|
404
|
+
description: "Read runtime logs for a Railway deployment with optional text and time filters.",
|
|
405
|
+
effect: "read",
|
|
406
|
+
inputSchema: getDeploymentLogsInput,
|
|
407
|
+
outputSchema: external_exports.toJSONSchema(getDeploymentLogsOutput, { io: "output", unrepresentable: "any" })
|
|
408
|
+
},
|
|
409
|
+
deploy_service: {
|
|
410
|
+
description: "Trigger a Railway deployment for a service, optionally at a specific connected-repository commit.",
|
|
411
|
+
effect: "write",
|
|
412
|
+
inputSchema: deployServiceInput,
|
|
413
|
+
outputSchema: external_exports.toJSONSchema(deployServiceOutput, { io: "output", unrepresentable: "any" })
|
|
414
|
+
},
|
|
415
|
+
upsert_variable: {
|
|
416
|
+
description: "Create or update one Railway variable for an environment or service.",
|
|
417
|
+
effect: "write",
|
|
418
|
+
inputSchema: upsertVariableInput,
|
|
419
|
+
outputSchema: external_exports.toJSONSchema(upsertVariableOutput, { io: "output", unrepresentable: "any" })
|
|
420
|
+
},
|
|
421
|
+
rollback_deployment: {
|
|
422
|
+
description: "Roll a Railway service back to a deployment that Railway marks as rollback-capable.",
|
|
423
|
+
effect: "write",
|
|
424
|
+
inputSchema: rollbackDeploymentInput,
|
|
425
|
+
outputSchema: external_exports.toJSONSchema(rollbackDeploymentOutput, { io: "output", unrepresentable: "any" })
|
|
426
|
+
}
|
|
427
|
+
};
|
|
428
|
+
|
|
429
|
+
// ../plugins/src/railway/index.ts
|
|
430
|
+
function createRailwayPlugin() {
|
|
431
|
+
return createProviderPlugin({
|
|
432
|
+
description: "Railway",
|
|
433
|
+
credentialProbe: "list_projects",
|
|
434
|
+
actions: railwayActions,
|
|
435
|
+
handlers: {
|
|
436
|
+
list_projects: listProjects,
|
|
437
|
+
get_project: getProject,
|
|
438
|
+
get_service_instance: getServiceInstance,
|
|
439
|
+
list_deployments: listDeployments,
|
|
440
|
+
get_deployment: getDeployment,
|
|
441
|
+
get_deployment_logs: getDeploymentLogs,
|
|
442
|
+
deploy_service: deployService,
|
|
443
|
+
upsert_variable: upsertVariable,
|
|
444
|
+
rollback_deployment: rollbackDeployment
|
|
445
|
+
}
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
var railway_default = createRailwayPlugin();
|
|
449
|
+
export {
|
|
450
|
+
createRailwayPlugin,
|
|
451
|
+
railway_default as default
|
|
452
|
+
};
|