skedyul 1.2.2 → 1.2.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/cli/index.js +44 -115
- package/dist/dockerfile.d.ts +1 -1
- package/dist/esm/index.mjs +19 -1
- package/dist/index.js +19 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -3491,13 +3491,13 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
|
|
|
3491
3491
|
hasLoggedStartup = true;
|
|
3492
3492
|
}
|
|
3493
3493
|
try {
|
|
3494
|
-
const
|
|
3494
|
+
const path13 = event.path || event.rawPath || "/";
|
|
3495
3495
|
const method = event.httpMethod || event.requestContext?.http?.method || "POST";
|
|
3496
3496
|
if (method === "OPTIONS") {
|
|
3497
3497
|
return createResponse(200, { message: "OK" }, headers);
|
|
3498
3498
|
}
|
|
3499
|
-
if (
|
|
3500
|
-
const handle =
|
|
3499
|
+
if (path13.startsWith("/webhooks/") && webhookRegistry) {
|
|
3500
|
+
const handle = path13.slice("/webhooks/".length);
|
|
3501
3501
|
const webhookDef = webhookRegistry[handle];
|
|
3502
3502
|
if (!webhookDef) {
|
|
3503
3503
|
return createResponse(404, { error: `Webhook handler '${handle}' not found` }, headers);
|
|
@@ -3574,11 +3574,11 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
|
|
|
3574
3574
|
const protocol = forwardedProto ?? "https";
|
|
3575
3575
|
const host = event.headers?.host ?? event.headers?.Host ?? "localhost";
|
|
3576
3576
|
const queryString = event.queryStringParameters ? "?" + new URLSearchParams(event.queryStringParameters).toString() : "";
|
|
3577
|
-
const webhookUrl = `${protocol}://${host}${
|
|
3577
|
+
const webhookUrl = `${protocol}://${host}${path13}${queryString}`;
|
|
3578
3578
|
webhookRequest = {
|
|
3579
3579
|
method,
|
|
3580
3580
|
url: webhookUrl,
|
|
3581
|
-
path:
|
|
3581
|
+
path: path13,
|
|
3582
3582
|
headers: event.headers,
|
|
3583
3583
|
query: event.queryStringParameters ?? {},
|
|
3584
3584
|
body: parsedBody,
|
|
@@ -3621,7 +3621,7 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
|
|
|
3621
3621
|
body: body !== void 0 ? typeof body === "string" ? body : JSON.stringify(body) : ""
|
|
3622
3622
|
};
|
|
3623
3623
|
}
|
|
3624
|
-
if (
|
|
3624
|
+
if (path13 === "/core" && method === "POST") {
|
|
3625
3625
|
let coreBody;
|
|
3626
3626
|
try {
|
|
3627
3627
|
coreBody = event.body ? JSON.parse(event.body) : {};
|
|
@@ -3653,7 +3653,7 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
|
|
|
3653
3653
|
const result = await handleCoreMethod(coreMethod, coreBody.params);
|
|
3654
3654
|
return createResponse(result.status, result.payload, headers);
|
|
3655
3655
|
}
|
|
3656
|
-
if (
|
|
3656
|
+
if (path13 === "/core/webhook" && method === "POST") {
|
|
3657
3657
|
const rawWebhookBody = event.body ?? "";
|
|
3658
3658
|
let webhookBody;
|
|
3659
3659
|
try {
|
|
@@ -3668,14 +3668,14 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
|
|
|
3668
3668
|
const forwardedProto = event.headers?.["x-forwarded-proto"] ?? event.headers?.["X-Forwarded-Proto"];
|
|
3669
3669
|
const protocol = forwardedProto ?? "https";
|
|
3670
3670
|
const host = event.headers?.host ?? event.headers?.Host ?? "localhost";
|
|
3671
|
-
const webhookUrl = `${protocol}://${host}${
|
|
3671
|
+
const webhookUrl = `${protocol}://${host}${path13}`;
|
|
3672
3672
|
const coreWebhookRequest = {
|
|
3673
3673
|
method,
|
|
3674
3674
|
headers: event.headers ?? {},
|
|
3675
3675
|
body: webhookBody,
|
|
3676
3676
|
query: event.queryStringParameters ?? {},
|
|
3677
3677
|
url: webhookUrl,
|
|
3678
|
-
path:
|
|
3678
|
+
path: path13,
|
|
3679
3679
|
rawBody: rawWebhookBody ? Buffer.from(rawWebhookBody, "utf-8") : void 0
|
|
3680
3680
|
};
|
|
3681
3681
|
const webhookResponse = await coreApiService.dispatchWebhook(
|
|
@@ -3687,7 +3687,7 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
|
|
|
3687
3687
|
headers
|
|
3688
3688
|
);
|
|
3689
3689
|
}
|
|
3690
|
-
if (
|
|
3690
|
+
if (path13 === "/estimate" && method === "POST") {
|
|
3691
3691
|
let estimateBody;
|
|
3692
3692
|
try {
|
|
3693
3693
|
estimateBody = event.body ? JSON.parse(event.body) : {};
|
|
@@ -3753,7 +3753,7 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
|
|
|
3753
3753
|
);
|
|
3754
3754
|
}
|
|
3755
3755
|
}
|
|
3756
|
-
if (
|
|
3756
|
+
if (path13 === "/install" && method === "POST") {
|
|
3757
3757
|
if (!config.hooks?.install) {
|
|
3758
3758
|
return createResponse(404, { error: "Install handler not configured" }, headers);
|
|
3759
3759
|
}
|
|
@@ -3825,7 +3825,7 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
|
|
|
3825
3825
|
);
|
|
3826
3826
|
}
|
|
3827
3827
|
}
|
|
3828
|
-
if (
|
|
3828
|
+
if (path13 === "/uninstall" && method === "POST") {
|
|
3829
3829
|
if (!config.hooks?.uninstall) {
|
|
3830
3830
|
return createResponse(404, { error: "Uninstall handler not configured" }, headers);
|
|
3831
3831
|
}
|
|
@@ -3889,7 +3889,7 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
|
|
|
3889
3889
|
);
|
|
3890
3890
|
}
|
|
3891
3891
|
}
|
|
3892
|
-
if (
|
|
3892
|
+
if (path13 === "/provision" && method === "POST") {
|
|
3893
3893
|
console.log("[serverless] /provision endpoint called");
|
|
3894
3894
|
if (!config.hooks?.provision) {
|
|
3895
3895
|
console.log("[serverless] No provision handler configured");
|
|
@@ -3962,7 +3962,7 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
|
|
|
3962
3962
|
);
|
|
3963
3963
|
}
|
|
3964
3964
|
}
|
|
3965
|
-
if (
|
|
3965
|
+
if (path13 === "/oauth_callback" && method === "POST") {
|
|
3966
3966
|
if (!config.hooks?.oauth_callback) {
|
|
3967
3967
|
return createResponse(
|
|
3968
3968
|
404,
|
|
@@ -4028,10 +4028,10 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
|
|
|
4028
4028
|
);
|
|
4029
4029
|
}
|
|
4030
4030
|
}
|
|
4031
|
-
if (
|
|
4031
|
+
if (path13 === "/health" && method === "GET") {
|
|
4032
4032
|
return createResponse(200, state.getHealthStatus(), headers);
|
|
4033
4033
|
}
|
|
4034
|
-
if (
|
|
4034
|
+
if (path13 === "/mcp" && method === "POST") {
|
|
4035
4035
|
let body;
|
|
4036
4036
|
try {
|
|
4037
4037
|
body = event.body ? JSON.parse(event.body) : {};
|
|
@@ -7089,7 +7089,7 @@ CONFIGURATION
|
|
|
7089
7089
|
The build command reads from skedyul.config.ts:
|
|
7090
7090
|
|
|
7091
7091
|
export default defineConfig({
|
|
7092
|
-
computeLayer: 'serverless', // 'serverless' -> ESM
|
|
7092
|
+
computeLayer: 'serverless', // 'serverless' -> ESM, 'dedicated' -> CJS
|
|
7093
7093
|
build: {
|
|
7094
7094
|
external: ['twilio'], // Additional externals to exclude
|
|
7095
7095
|
},
|
|
@@ -7101,26 +7101,6 @@ CONFIGURATION
|
|
|
7101
7101
|
- zod
|
|
7102
7102
|
`);
|
|
7103
7103
|
}
|
|
7104
|
-
function generateTsupConfig(format, externals) {
|
|
7105
|
-
const externalsStr = externals.map((e) => `'${e}'`).join(", ");
|
|
7106
|
-
const outExtension = format === "esm" ? `outExtension({ format }) {
|
|
7107
|
-
return { js: '.mjs' }
|
|
7108
|
-
},` : "";
|
|
7109
|
-
return `import { defineConfig } from 'tsup'
|
|
7110
|
-
|
|
7111
|
-
export default defineConfig({
|
|
7112
|
-
entry: ['src/server/mcp_server.ts'],
|
|
7113
|
-
format: ['${format}'],
|
|
7114
|
-
target: 'node22',
|
|
7115
|
-
outDir: 'dist/server',
|
|
7116
|
-
clean: true,
|
|
7117
|
-
splitting: false,
|
|
7118
|
-
dts: false,
|
|
7119
|
-
${outExtension}
|
|
7120
|
-
external: [${externalsStr}],
|
|
7121
|
-
})
|
|
7122
|
-
`;
|
|
7123
|
-
}
|
|
7124
7104
|
async function buildCommand(args2) {
|
|
7125
7105
|
if (args2.includes("--help") || args2.includes("-h")) {
|
|
7126
7106
|
printBuildHelp();
|
|
@@ -7142,8 +7122,6 @@ async function buildCommand(args2) {
|
|
|
7142
7122
|
process.exit(1);
|
|
7143
7123
|
}
|
|
7144
7124
|
console.log(`Loading config from ${path12.basename(configPath)}...`);
|
|
7145
|
-
const tempConfigPath = path12.join(cwd, ".skedyul-tsup.config.mjs");
|
|
7146
|
-
let createdTempConfig = false;
|
|
7147
7125
|
try {
|
|
7148
7126
|
const config = await loadConfig(configPath);
|
|
7149
7127
|
const computeLayer = config.computeLayer ?? "serverless";
|
|
@@ -7151,38 +7129,28 @@ async function buildCommand(args2) {
|
|
|
7151
7129
|
const baseExternals = ["skedyul", `skedyul/${computeLayer}`, "zod"];
|
|
7152
7130
|
const userExternals = config.build && "external" in config.build ? config.build.external ?? [] : [];
|
|
7153
7131
|
const allExternals = [...baseExternals, ...userExternals];
|
|
7154
|
-
const
|
|
7155
|
-
|
|
7132
|
+
const tsupArgs = [
|
|
7133
|
+
"tsup",
|
|
7134
|
+
"src/server/mcp_server.ts",
|
|
7135
|
+
"--format",
|
|
7136
|
+
format,
|
|
7137
|
+
"--out-dir",
|
|
7138
|
+
"dist/server",
|
|
7139
|
+
"--target",
|
|
7140
|
+
"node22",
|
|
7141
|
+
"--clean",
|
|
7142
|
+
"--no-splitting",
|
|
7143
|
+
...allExternals.flatMap((ext) => ["--external", ext])
|
|
7144
|
+
];
|
|
7145
|
+
if (watch) {
|
|
7146
|
+
tsupArgs.push("--watch");
|
|
7147
|
+
}
|
|
7156
7148
|
console.log(``);
|
|
7157
7149
|
console.log(`Building ${config.name ?? "integration"}...`);
|
|
7158
7150
|
console.log(` Compute layer: ${computeLayer}`);
|
|
7159
7151
|
console.log(` Format: ${format}`);
|
|
7160
|
-
console.log(` Output: dist/server/mcp_server.${format === "esm" ? "mjs" : "js"}`);
|
|
7161
7152
|
console.log(` Externals: ${allExternals.join(", ")}`);
|
|
7162
7153
|
console.log(``);
|
|
7163
|
-
let tsupArgs;
|
|
7164
|
-
if (hasUserConfig) {
|
|
7165
|
-
tsupArgs = [
|
|
7166
|
-
"tsup",
|
|
7167
|
-
"--config",
|
|
7168
|
-
userTsupConfig
|
|
7169
|
-
];
|
|
7170
|
-
if (watch) {
|
|
7171
|
-
tsupArgs.push("--watch");
|
|
7172
|
-
}
|
|
7173
|
-
} else {
|
|
7174
|
-
const tsupConfigContent = generateTsupConfig(format, allExternals);
|
|
7175
|
-
fs12.writeFileSync(tempConfigPath, tsupConfigContent, "utf-8");
|
|
7176
|
-
createdTempConfig = true;
|
|
7177
|
-
tsupArgs = [
|
|
7178
|
-
"tsup",
|
|
7179
|
-
"--config",
|
|
7180
|
-
tempConfigPath
|
|
7181
|
-
];
|
|
7182
|
-
if (watch) {
|
|
7183
|
-
tsupArgs.push("--watch");
|
|
7184
|
-
}
|
|
7185
|
-
}
|
|
7186
7154
|
const tsup = (0, import_child_process.spawn)("npx", tsupArgs, {
|
|
7187
7155
|
cwd,
|
|
7188
7156
|
stdio: "inherit",
|
|
@@ -7190,15 +7158,9 @@ async function buildCommand(args2) {
|
|
|
7190
7158
|
});
|
|
7191
7159
|
tsup.on("error", (error) => {
|
|
7192
7160
|
console.error("Failed to start tsup:", error.message);
|
|
7193
|
-
if (createdTempConfig && fs12.existsSync(tempConfigPath)) {
|
|
7194
|
-
fs12.unlinkSync(tempConfigPath);
|
|
7195
|
-
}
|
|
7196
7161
|
process.exit(1);
|
|
7197
7162
|
});
|
|
7198
7163
|
tsup.on("close", (code) => {
|
|
7199
|
-
if (createdTempConfig && fs12.existsSync(tempConfigPath)) {
|
|
7200
|
-
fs12.unlinkSync(tempConfigPath);
|
|
7201
|
-
}
|
|
7202
7164
|
if (code === 0) {
|
|
7203
7165
|
console.log(``);
|
|
7204
7166
|
console.log(`Build completed successfully!`);
|
|
@@ -7206,9 +7168,6 @@ async function buildCommand(args2) {
|
|
|
7206
7168
|
process.exit(code ?? 0);
|
|
7207
7169
|
});
|
|
7208
7170
|
} catch (error) {
|
|
7209
|
-
if (createdTempConfig && fs12.existsSync(tempConfigPath)) {
|
|
7210
|
-
fs12.unlinkSync(tempConfigPath);
|
|
7211
|
-
}
|
|
7212
7171
|
console.error(
|
|
7213
7172
|
"Error loading config:",
|
|
7214
7173
|
error instanceof Error ? error.message : String(error)
|
|
@@ -7221,7 +7180,6 @@ async function buildCommand(args2) {
|
|
|
7221
7180
|
var import_child_process2 = require("child_process");
|
|
7222
7181
|
var http3 = __toESM(require("http"));
|
|
7223
7182
|
var fs13 = __toESM(require("fs"));
|
|
7224
|
-
var path13 = __toESM(require("path"));
|
|
7225
7183
|
var SMOKE_TEST_PORT = 3456;
|
|
7226
7184
|
var HEALTH_CHECK_INTERVAL_MS = 500;
|
|
7227
7185
|
var HEALTH_CHECK_MAX_RETRIES = 30;
|
|
@@ -7244,21 +7202,20 @@ EXAMPLES
|
|
|
7244
7202
|
$ skedyul build && skedyul smoke-test
|
|
7245
7203
|
|
|
7246
7204
|
WHAT IT DOES
|
|
7247
|
-
1.
|
|
7248
|
-
2.
|
|
7249
|
-
3.
|
|
7250
|
-
4.
|
|
7251
|
-
5.
|
|
7252
|
-
6. Exits with code 0 (success) or 1 (failure)
|
|
7205
|
+
1. Spawns node dist/server/mcp_server.js as a child process
|
|
7206
|
+
2. Waits for the /health endpoint to respond
|
|
7207
|
+
3. Calls POST /mcp with tools/list JSON-RPC request
|
|
7208
|
+
4. Validates the response contains at least one tool
|
|
7209
|
+
5. Exits with code 0 (success) or 1 (failure)
|
|
7253
7210
|
`);
|
|
7254
7211
|
}
|
|
7255
|
-
function makeRequest(port,
|
|
7212
|
+
function makeRequest(port, path13, method, body) {
|
|
7256
7213
|
return new Promise((resolve8, reject) => {
|
|
7257
7214
|
const postData = body ? JSON.stringify(body) : void 0;
|
|
7258
7215
|
const options = {
|
|
7259
7216
|
hostname: "localhost",
|
|
7260
7217
|
port,
|
|
7261
|
-
path:
|
|
7218
|
+
path: path13,
|
|
7262
7219
|
method,
|
|
7263
7220
|
headers: {
|
|
7264
7221
|
"Content-Type": "application/json",
|
|
@@ -7343,41 +7300,13 @@ async function smokeTestCommand(args2) {
|
|
|
7343
7300
|
printSmokeTestHelp();
|
|
7344
7301
|
process.exit(0);
|
|
7345
7302
|
}
|
|
7346
|
-
const
|
|
7347
|
-
let configPath = null;
|
|
7348
|
-
for (const name of CONFIG_FILE_NAMES) {
|
|
7349
|
-
const testPath = path13.join(cwd, name);
|
|
7350
|
-
if (fs13.existsSync(testPath)) {
|
|
7351
|
-
configPath = testPath;
|
|
7352
|
-
break;
|
|
7353
|
-
}
|
|
7354
|
-
}
|
|
7355
|
-
let computeLayer = "serverless";
|
|
7356
|
-
if (configPath) {
|
|
7357
|
-
try {
|
|
7358
|
-
const config = await loadConfig(configPath);
|
|
7359
|
-
computeLayer = config.computeLayer ?? "serverless";
|
|
7360
|
-
} catch (err) {
|
|
7361
|
-
console.warn(`[SmokeTest] Warning: Could not load config, defaulting to serverless mode`);
|
|
7362
|
-
}
|
|
7363
|
-
}
|
|
7364
|
-
const serverExt = computeLayer === "serverless" ? "mjs" : "js";
|
|
7365
|
-
let serverPath = `dist/server/mcp_server.${serverExt}`;
|
|
7303
|
+
const serverPath = "dist/server/mcp_server.js";
|
|
7366
7304
|
if (!fs13.existsSync(serverPath)) {
|
|
7367
|
-
|
|
7368
|
-
|
|
7369
|
-
|
|
7370
|
-
console.warn(`[SmokeTest] Warning: Expected ${serverPath} but found ${fallbackPath}`);
|
|
7371
|
-
console.warn(`[SmokeTest] Using ${fallbackPath} instead`);
|
|
7372
|
-
serverPath = fallbackPath;
|
|
7373
|
-
} else {
|
|
7374
|
-
console.error(`[SmokeTest] ERROR: ${serverPath} not found`);
|
|
7375
|
-
console.error('[SmokeTest] Run "skedyul build" first');
|
|
7376
|
-
process.exit(1);
|
|
7377
|
-
}
|
|
7305
|
+
console.error("[SmokeTest] ERROR: dist/server/mcp_server.js not found");
|
|
7306
|
+
console.error('[SmokeTest] Run "skedyul build" first');
|
|
7307
|
+
process.exit(1);
|
|
7378
7308
|
}
|
|
7379
7309
|
console.log("[SmokeTest] Starting smoke test...");
|
|
7380
|
-
console.log(`[SmokeTest] Compute layer: ${computeLayer}`);
|
|
7381
7310
|
console.log(`[SmokeTest] Server path: ${serverPath}`);
|
|
7382
7311
|
console.log(`[SmokeTest] Port: ${SMOKE_TEST_PORT}`);
|
|
7383
7312
|
let server2 = null;
|
package/dist/dockerfile.d.ts
CHANGED
|
@@ -13,4 +13,4 @@
|
|
|
13
13
|
* - BUILD_EXTERNAL: comma-separated list of external dependencies (e.g., 'twilio,stripe')
|
|
14
14
|
* - MCP_ENV_JSON: JSON string of environment variables to bake into the image
|
|
15
15
|
*/
|
|
16
|
-
export declare const DEFAULT_DOCKERFILE = "# =============================================================================\n# BUILDER STAGE - Common build for all targets\n# =============================================================================\nFROM public.ecr.aws/docker/library/node:22-alpine AS builder\n\nARG COMPUTE_LAYER=serverless\nARG BUILD_EXTERNAL=\"\"\nWORKDIR /app\n\n# Install pnpm\nRUN corepack enable && corepack prepare pnpm@latest --activate\n\n# Copy package files (lockfile is optional)\nCOPY package.json tsconfig.json skedyul.config.ts ./\nCOPY src ./src\n\n# Copy tsup.config.ts if it exists
|
|
16
|
+
export declare const DEFAULT_DOCKERFILE = "# =============================================================================\n# BUILDER STAGE - Common build for all targets\n# =============================================================================\nFROM public.ecr.aws/docker/library/node:22-alpine AS builder\n\nARG COMPUTE_LAYER=serverless\nARG BUILD_EXTERNAL=\"\"\nWORKDIR /app\n\n# Install pnpm\nRUN corepack enable && corepack prepare pnpm@latest --activate\n\n# Copy package files (lockfile is optional)\nCOPY package.json tsconfig.json skedyul.config.ts ./\nCOPY src ./src\n\n# Copy tsup.config.ts if it exists, otherwise generate based on COMPUTE_LAYER\n# BUILD_EXTERNAL is a comma-separated list of additional externals (e.g., \"twilio,stripe\")\nCOPY tsup.config.t[s] ./\nRUN if [ ! -f tsup.config.ts ]; then \\\n BASE_EXT=\"skedyul,zod\"; \\\n if [ \"$COMPUTE_LAYER\" = \"serverless\" ]; then \\\n BASE_EXT=\"skedyul,skedyul/serverless,zod\"; \\\n FORMAT=\"esm\"; \\\n else \\\n BASE_EXT=\"skedyul,skedyul/dedicated,zod\"; \\\n FORMAT=\"cjs\"; \\\n fi; \\\n if [ -n \"$BUILD_EXTERNAL\" ]; then \\\n ALL_EXT=\"$BASE_EXT,$BUILD_EXTERNAL\"; \\\n else \\\n ALL_EXT=\"$BASE_EXT\"; \\\n fi; \\\n EXT_ARRAY=$(echo \"$ALL_EXT\" | sed 's/,/\",\"/g'); \\\n printf 'import{defineConfig}from\"tsup\";export default defineConfig({entry:[\"src/server/mcp_server.ts\"],format:[\"%s\"],target:\"node22\",outDir:\"dist/server\",clean:true,splitting:false,dts:false,external:[\"%s\"]})' \"$FORMAT\" \"$EXT_ARRAY\" > tsup.config.ts; \\\n fi\n\n# Install dependencies (including dev deps for build), compile, smoke test, then prune\n# Note: Using --no-frozen-lockfile since lockfile may not exist\n# skedyul build reads computeLayer from skedyul.config.ts\n# Smoke test runs before pruning since skedyul CLI is a dev dependency\nRUN pnpm install --no-frozen-lockfile && \\\n pnpm run build && \\\n skedyul smoke-test && \\\n pnpm prune --prod && \\\n pnpm store prune && \\\n rm -rf /tmp/* /var/cache/apk/* ~/.npm\n\n# =============================================================================\n# DEDICATED STAGE - For local Docker and ECS deployments (HTTP server)\n# =============================================================================\nFROM public.ecr.aws/docker/library/node:22-alpine AS dedicated\n\nWORKDIR /app\n\n# Copy built artifacts\nCOPY --from=builder /app/node_modules ./node_modules\nCOPY --from=builder /app/dist ./dist\nCOPY --from=builder /app/package.json ./package.json\n\n# Allow overriding the baked-in MCP env at runtime\nARG MCP_ENV_JSON=\"{}\"\nENV MCP_ENV_JSON=${MCP_ENV_JSON}\n\n# Expose the HTTP port\nEXPOSE 3000\n\n# Run as HTTP server (dedicated mode auto-detected by absence of AWS_LAMBDA_FUNCTION_NAME)\nCMD [\"node\", \"dist/server/mcp_server.js\"]\n\n# =============================================================================\n# SERVERLESS STAGE - For AWS Lambda deployments\n# =============================================================================\nFROM public.ecr.aws/lambda/nodejs:22 AS serverless\n\nWORKDIR ${LAMBDA_TASK_ROOT}\n\nCOPY --from=builder /app/node_modules ./node_modules\nCOPY --from=builder /app/dist ./dist\nCOPY --from=builder /app/package.json ./package.json\n\n# Allow overriding the baked-in MCP env at runtime\nARG MCP_ENV_JSON=\"{}\"\nENV MCP_ENV_JSON=${MCP_ENV_JSON}\n\n# Lambda handler format\nCMD [\"dist/server/mcp_server.handler\"]\n\n# =============================================================================\n# DEFAULT - Use dedicated for local development, override with --target for production\n# =============================================================================\nFROM dedicated\n";
|
package/dist/esm/index.mjs
CHANGED
|
@@ -3907,8 +3907,26 @@ RUN corepack enable && corepack prepare pnpm@latest --activate
|
|
|
3907
3907
|
COPY package.json tsconfig.json skedyul.config.ts ./
|
|
3908
3908
|
COPY src ./src
|
|
3909
3909
|
|
|
3910
|
-
# Copy tsup.config.ts if it exists
|
|
3910
|
+
# Copy tsup.config.ts if it exists, otherwise generate based on COMPUTE_LAYER
|
|
3911
|
+
# BUILD_EXTERNAL is a comma-separated list of additional externals (e.g., "twilio,stripe")
|
|
3911
3912
|
COPY tsup.config.t[s] ./
|
|
3913
|
+
RUN if [ ! -f tsup.config.ts ]; then \\
|
|
3914
|
+
BASE_EXT="skedyul,zod"; \\
|
|
3915
|
+
if [ "$COMPUTE_LAYER" = "serverless" ]; then \\
|
|
3916
|
+
BASE_EXT="skedyul,skedyul/serverless,zod"; \\
|
|
3917
|
+
FORMAT="esm"; \\
|
|
3918
|
+
else \\
|
|
3919
|
+
BASE_EXT="skedyul,skedyul/dedicated,zod"; \\
|
|
3920
|
+
FORMAT="cjs"; \\
|
|
3921
|
+
fi; \\
|
|
3922
|
+
if [ -n "$BUILD_EXTERNAL" ]; then \\
|
|
3923
|
+
ALL_EXT="$BASE_EXT,$BUILD_EXTERNAL"; \\
|
|
3924
|
+
else \\
|
|
3925
|
+
ALL_EXT="$BASE_EXT"; \\
|
|
3926
|
+
fi; \\
|
|
3927
|
+
EXT_ARRAY=$(echo "$ALL_EXT" | sed 's/,/","/g'); \\
|
|
3928
|
+
printf 'import{defineConfig}from"tsup";export default defineConfig({entry:["src/server/mcp_server.ts"],format:["%s"],target:"node22",outDir:"dist/server",clean:true,splitting:false,dts:false,external:["%s"]})' "$FORMAT" "$EXT_ARRAY" > tsup.config.ts; \\
|
|
3929
|
+
fi
|
|
3912
3930
|
|
|
3913
3931
|
# Install dependencies (including dev deps for build), compile, smoke test, then prune
|
|
3914
3932
|
# Note: Using --no-frozen-lockfile since lockfile may not exist
|
package/dist/index.js
CHANGED
|
@@ -4072,8 +4072,26 @@ RUN corepack enable && corepack prepare pnpm@latest --activate
|
|
|
4072
4072
|
COPY package.json tsconfig.json skedyul.config.ts ./
|
|
4073
4073
|
COPY src ./src
|
|
4074
4074
|
|
|
4075
|
-
# Copy tsup.config.ts if it exists
|
|
4075
|
+
# Copy tsup.config.ts if it exists, otherwise generate based on COMPUTE_LAYER
|
|
4076
|
+
# BUILD_EXTERNAL is a comma-separated list of additional externals (e.g., "twilio,stripe")
|
|
4076
4077
|
COPY tsup.config.t[s] ./
|
|
4078
|
+
RUN if [ ! -f tsup.config.ts ]; then \\
|
|
4079
|
+
BASE_EXT="skedyul,zod"; \\
|
|
4080
|
+
if [ "$COMPUTE_LAYER" = "serverless" ]; then \\
|
|
4081
|
+
BASE_EXT="skedyul,skedyul/serverless,zod"; \\
|
|
4082
|
+
FORMAT="esm"; \\
|
|
4083
|
+
else \\
|
|
4084
|
+
BASE_EXT="skedyul,skedyul/dedicated,zod"; \\
|
|
4085
|
+
FORMAT="cjs"; \\
|
|
4086
|
+
fi; \\
|
|
4087
|
+
if [ -n "$BUILD_EXTERNAL" ]; then \\
|
|
4088
|
+
ALL_EXT="$BASE_EXT,$BUILD_EXTERNAL"; \\
|
|
4089
|
+
else \\
|
|
4090
|
+
ALL_EXT="$BASE_EXT"; \\
|
|
4091
|
+
fi; \\
|
|
4092
|
+
EXT_ARRAY=$(echo "$ALL_EXT" | sed 's/,/","/g'); \\
|
|
4093
|
+
printf 'import{defineConfig}from"tsup";export default defineConfig({entry:["src/server/mcp_server.ts"],format:["%s"],target:"node22",outDir:"dist/server",clean:true,splitting:false,dts:false,external:["%s"]})' "$FORMAT" "$EXT_ARRAY" > tsup.config.ts; \\
|
|
4094
|
+
fi
|
|
4077
4095
|
|
|
4078
4096
|
# Install dependencies (including dev deps for build), compile, smoke test, then prune
|
|
4079
4097
|
# Note: Using --no-frozen-lockfile since lockfile may not exist
|