skedyul 1.2.3 → 1.2.4
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 +115 -44
- package/dist/dockerfile.d.ts +1 -1
- package/dist/esm/index.mjs +2 -20
- package/dist/index.js +2 -20
- 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 path14 = 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 (path14.startsWith("/webhooks/") && webhookRegistry) {
|
|
3500
|
+
const handle = path14.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}${path14}${queryString}`;
|
|
3578
3578
|
webhookRequest = {
|
|
3579
3579
|
method,
|
|
3580
3580
|
url: webhookUrl,
|
|
3581
|
-
path:
|
|
3581
|
+
path: path14,
|
|
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 (path14 === "/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 (path14 === "/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}${path14}`;
|
|
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: path14,
|
|
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 (path14 === "/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 (path14 === "/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 (path14 === "/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 (path14 === "/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 (path14 === "/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 (path14 === "/health" && method === "GET") {
|
|
4032
4032
|
return createResponse(200, state.getHealthStatus(), headers);
|
|
4033
4033
|
}
|
|
4034
|
-
if (
|
|
4034
|
+
if (path14 === "/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, 'dedicated' -> CJS
|
|
7092
|
+
computeLayer: 'serverless', // 'serverless' -> ESM (.mjs), 'dedicated' -> CJS (.js)
|
|
7093
7093
|
build: {
|
|
7094
7094
|
external: ['twilio'], // Additional externals to exclude
|
|
7095
7095
|
},
|
|
@@ -7101,6 +7101,26 @@ 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
|
+
}
|
|
7104
7124
|
async function buildCommand(args2) {
|
|
7105
7125
|
if (args2.includes("--help") || args2.includes("-h")) {
|
|
7106
7126
|
printBuildHelp();
|
|
@@ -7122,6 +7142,8 @@ async function buildCommand(args2) {
|
|
|
7122
7142
|
process.exit(1);
|
|
7123
7143
|
}
|
|
7124
7144
|
console.log(`Loading config from ${path12.basename(configPath)}...`);
|
|
7145
|
+
const tempConfigPath = path12.join(cwd, ".skedyul-tsup.config.mjs");
|
|
7146
|
+
let createdTempConfig = false;
|
|
7125
7147
|
try {
|
|
7126
7148
|
const config = await loadConfig(configPath);
|
|
7127
7149
|
const computeLayer = config.computeLayer ?? "serverless";
|
|
@@ -7129,28 +7151,38 @@ async function buildCommand(args2) {
|
|
|
7129
7151
|
const baseExternals = ["skedyul", `skedyul/${computeLayer}`, "zod"];
|
|
7130
7152
|
const userExternals = config.build && "external" in config.build ? config.build.external ?? [] : [];
|
|
7131
7153
|
const allExternals = [...baseExternals, ...userExternals];
|
|
7132
|
-
const
|
|
7133
|
-
|
|
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
|
-
}
|
|
7154
|
+
const userTsupConfig = path12.join(cwd, "tsup.config.ts");
|
|
7155
|
+
const hasUserConfig = fs12.existsSync(userTsupConfig);
|
|
7148
7156
|
console.log(``);
|
|
7149
7157
|
console.log(`Building ${config.name ?? "integration"}...`);
|
|
7150
7158
|
console.log(` Compute layer: ${computeLayer}`);
|
|
7151
7159
|
console.log(` Format: ${format}`);
|
|
7160
|
+
console.log(` Output: dist/server/mcp_server.${format === "esm" ? "mjs" : "js"}`);
|
|
7152
7161
|
console.log(` Externals: ${allExternals.join(", ")}`);
|
|
7153
7162
|
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
|
+
}
|
|
7154
7186
|
const tsup = (0, import_child_process.spawn)("npx", tsupArgs, {
|
|
7155
7187
|
cwd,
|
|
7156
7188
|
stdio: "inherit",
|
|
@@ -7158,9 +7190,15 @@ async function buildCommand(args2) {
|
|
|
7158
7190
|
});
|
|
7159
7191
|
tsup.on("error", (error) => {
|
|
7160
7192
|
console.error("Failed to start tsup:", error.message);
|
|
7193
|
+
if (createdTempConfig && fs12.existsSync(tempConfigPath)) {
|
|
7194
|
+
fs12.unlinkSync(tempConfigPath);
|
|
7195
|
+
}
|
|
7161
7196
|
process.exit(1);
|
|
7162
7197
|
});
|
|
7163
7198
|
tsup.on("close", (code) => {
|
|
7199
|
+
if (createdTempConfig && fs12.existsSync(tempConfigPath)) {
|
|
7200
|
+
fs12.unlinkSync(tempConfigPath);
|
|
7201
|
+
}
|
|
7164
7202
|
if (code === 0) {
|
|
7165
7203
|
console.log(``);
|
|
7166
7204
|
console.log(`Build completed successfully!`);
|
|
@@ -7168,6 +7206,9 @@ async function buildCommand(args2) {
|
|
|
7168
7206
|
process.exit(code ?? 0);
|
|
7169
7207
|
});
|
|
7170
7208
|
} catch (error) {
|
|
7209
|
+
if (createdTempConfig && fs12.existsSync(tempConfigPath)) {
|
|
7210
|
+
fs12.unlinkSync(tempConfigPath);
|
|
7211
|
+
}
|
|
7171
7212
|
console.error(
|
|
7172
7213
|
"Error loading config:",
|
|
7173
7214
|
error instanceof Error ? error.message : String(error)
|
|
@@ -7180,6 +7221,7 @@ async function buildCommand(args2) {
|
|
|
7180
7221
|
var import_child_process2 = require("child_process");
|
|
7181
7222
|
var http3 = __toESM(require("http"));
|
|
7182
7223
|
var fs13 = __toESM(require("fs"));
|
|
7224
|
+
var path13 = __toESM(require("path"));
|
|
7183
7225
|
var SMOKE_TEST_PORT = 3456;
|
|
7184
7226
|
var HEALTH_CHECK_INTERVAL_MS = 500;
|
|
7185
7227
|
var HEALTH_CHECK_MAX_RETRIES = 30;
|
|
@@ -7202,20 +7244,21 @@ EXAMPLES
|
|
|
7202
7244
|
$ skedyul build && skedyul smoke-test
|
|
7203
7245
|
|
|
7204
7246
|
WHAT IT DOES
|
|
7205
|
-
1.
|
|
7206
|
-
2.
|
|
7207
|
-
3.
|
|
7208
|
-
4.
|
|
7209
|
-
5.
|
|
7247
|
+
1. Reads skedyul.config.ts to determine compute layer
|
|
7248
|
+
2. Spawns node dist/server/mcp_server.{mjs|js} based on compute layer
|
|
7249
|
+
3. Waits for the /health endpoint to respond
|
|
7250
|
+
4. Calls POST /mcp with tools/list JSON-RPC request
|
|
7251
|
+
5. Validates the response contains at least one tool
|
|
7252
|
+
6. Exits with code 0 (success) or 1 (failure)
|
|
7210
7253
|
`);
|
|
7211
7254
|
}
|
|
7212
|
-
function makeRequest(port,
|
|
7255
|
+
function makeRequest(port, path14, method, body) {
|
|
7213
7256
|
return new Promise((resolve8, reject) => {
|
|
7214
7257
|
const postData = body ? JSON.stringify(body) : void 0;
|
|
7215
7258
|
const options = {
|
|
7216
7259
|
hostname: "localhost",
|
|
7217
7260
|
port,
|
|
7218
|
-
path:
|
|
7261
|
+
path: path14,
|
|
7219
7262
|
method,
|
|
7220
7263
|
headers: {
|
|
7221
7264
|
"Content-Type": "application/json",
|
|
@@ -7300,13 +7343,41 @@ async function smokeTestCommand(args2) {
|
|
|
7300
7343
|
printSmokeTestHelp();
|
|
7301
7344
|
process.exit(0);
|
|
7302
7345
|
}
|
|
7303
|
-
const
|
|
7346
|
+
const cwd = process.cwd();
|
|
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}`;
|
|
7304
7366
|
if (!fs13.existsSync(serverPath)) {
|
|
7305
|
-
|
|
7306
|
-
|
|
7307
|
-
|
|
7367
|
+
const fallbackExt = serverExt === "mjs" ? "js" : "mjs";
|
|
7368
|
+
const fallbackPath = `dist/server/mcp_server.${fallbackExt}`;
|
|
7369
|
+
if (fs13.existsSync(fallbackPath)) {
|
|
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
|
+
}
|
|
7308
7378
|
}
|
|
7309
7379
|
console.log("[SmokeTest] Starting smoke test...");
|
|
7380
|
+
console.log(`[SmokeTest] Compute layer: ${computeLayer}`);
|
|
7310
7381
|
console.log(`[SmokeTest] Server path: ${serverPath}`);
|
|
7311
7382
|
console.log(`[SmokeTest] Port: ${SMOKE_TEST_PORT}`);
|
|
7312
7383
|
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 (optional - skedyul build will generate one if needed)\nCOPY tsup.config.t[s] ./\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 pnpm exec 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,26 +3907,8 @@ 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
|
|
3911
|
-
# BUILD_EXTERNAL is a comma-separated list of additional externals (e.g., "twilio,stripe")
|
|
3910
|
+
# Copy tsup.config.ts if it exists (optional - skedyul build will generate one if needed)
|
|
3912
3911
|
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
|
|
3930
3912
|
|
|
3931
3913
|
# Install dependencies (including dev deps for build), compile, smoke test, then prune
|
|
3932
3914
|
# Note: Using --no-frozen-lockfile since lockfile may not exist
|
|
@@ -3934,7 +3916,7 @@ RUN if [ ! -f tsup.config.ts ]; then \\
|
|
|
3934
3916
|
# Smoke test runs before pruning since skedyul CLI is a dev dependency
|
|
3935
3917
|
RUN pnpm install --no-frozen-lockfile && \\
|
|
3936
3918
|
pnpm run build && \\
|
|
3937
|
-
skedyul smoke-test && \\
|
|
3919
|
+
pnpm exec skedyul smoke-test && \\
|
|
3938
3920
|
pnpm prune --prod && \\
|
|
3939
3921
|
pnpm store prune && \\
|
|
3940
3922
|
rm -rf /tmp/* /var/cache/apk/* ~/.npm
|
package/dist/index.js
CHANGED
|
@@ -4072,26 +4072,8 @@ 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
|
|
4076
|
-
# BUILD_EXTERNAL is a comma-separated list of additional externals (e.g., "twilio,stripe")
|
|
4075
|
+
# Copy tsup.config.ts if it exists (optional - skedyul build will generate one if needed)
|
|
4077
4076
|
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
|
|
4095
4077
|
|
|
4096
4078
|
# Install dependencies (including dev deps for build), compile, smoke test, then prune
|
|
4097
4079
|
# Note: Using --no-frozen-lockfile since lockfile may not exist
|
|
@@ -4099,7 +4081,7 @@ RUN if [ ! -f tsup.config.ts ]; then \\
|
|
|
4099
4081
|
# Smoke test runs before pruning since skedyul CLI is a dev dependency
|
|
4100
4082
|
RUN pnpm install --no-frozen-lockfile && \\
|
|
4101
4083
|
pnpm run build && \\
|
|
4102
|
-
skedyul smoke-test && \\
|
|
4084
|
+
pnpm exec skedyul smoke-test && \\
|
|
4103
4085
|
pnpm prune --prod && \\
|
|
4104
4086
|
pnpm store prune && \\
|
|
4105
4087
|
rm -rf /tmp/* /var/cache/apk/* ~/.npm
|