skedyul 0.2.140 → 0.2.142
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/.build-stamp +1 -1
- package/dist/server.js +26 -10
- package/dist/types.d.ts +14 -2
- package/package.json +1 -1
package/dist/.build-stamp
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1770543492164
|
package/dist/server.js
CHANGED
|
@@ -257,13 +257,17 @@ async function handleCoreMethod(method, params) {
|
|
|
257
257
|
};
|
|
258
258
|
}
|
|
259
259
|
function buildToolMetadata(registry) {
|
|
260
|
-
return Object.values(registry).map((tool) =>
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
260
|
+
return Object.values(registry).map((tool) => {
|
|
261
|
+
const timeout = typeof tool.timeout === 'number' && tool.timeout > 0 ? tool.timeout : 10000;
|
|
262
|
+
return {
|
|
263
|
+
name: tool.name,
|
|
264
|
+
displayName: tool.label || tool.name,
|
|
265
|
+
description: tool.description,
|
|
266
|
+
inputSchema: getJsonSchemaFromToolSchema(tool.inputSchema),
|
|
267
|
+
outputSchema: getJsonSchemaFromToolSchema(tool.outputSchema),
|
|
268
|
+
timeout, // Default to 10 seconds
|
|
269
|
+
};
|
|
270
|
+
});
|
|
267
271
|
}
|
|
268
272
|
function createRequestState(maxRequests, ttlExtendSeconds, runtimeLabel, toolNames) {
|
|
269
273
|
let requestCount = 0;
|
|
@@ -909,8 +913,12 @@ function createDedicatedServerInstance(config, tools, callTool, state, mcpServer
|
|
|
909
913
|
'',
|
|
910
914
|
};
|
|
911
915
|
try {
|
|
916
|
+
const installHook = config.hooks.install;
|
|
917
|
+
const installHandler = typeof installHook === 'function'
|
|
918
|
+
? installHook
|
|
919
|
+
: installHook.handler;
|
|
912
920
|
const result = await (0, client_1.runWithConfig)(installRequestConfig, async () => {
|
|
913
|
-
return await
|
|
921
|
+
return await installHandler(installContext);
|
|
914
922
|
});
|
|
915
923
|
sendJSON(res, 200, {
|
|
916
924
|
env: result.env ?? {},
|
|
@@ -973,8 +981,12 @@ function createDedicatedServerInstance(config, tools, callTool, state, mcpServer
|
|
|
973
981
|
apiToken: requestEnv.SKEDYUL_API_TOKEN ?? process.env.SKEDYUL_API_TOKEN ?? '',
|
|
974
982
|
};
|
|
975
983
|
try {
|
|
984
|
+
const provisionHook = config.hooks.provision;
|
|
985
|
+
const provisionHandler = typeof provisionHook === 'function'
|
|
986
|
+
? provisionHook
|
|
987
|
+
: provisionHook.handler;
|
|
976
988
|
const result = await (0, client_1.runWithConfig)(provisionRequestConfig, async () => {
|
|
977
|
-
return await
|
|
989
|
+
return await provisionHandler(provisionContext);
|
|
978
990
|
});
|
|
979
991
|
sendJSON(res, 200, result);
|
|
980
992
|
}
|
|
@@ -1441,8 +1453,12 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
|
|
|
1441
1453
|
'',
|
|
1442
1454
|
};
|
|
1443
1455
|
try {
|
|
1456
|
+
const installHook = config.hooks.install;
|
|
1457
|
+
const installHandler = typeof installHook === 'function'
|
|
1458
|
+
? installHook
|
|
1459
|
+
: installHook.handler;
|
|
1444
1460
|
const result = await (0, client_1.runWithConfig)(installRequestConfig, async () => {
|
|
1445
|
-
return await
|
|
1461
|
+
return await installHandler(installContext);
|
|
1446
1462
|
});
|
|
1447
1463
|
return createResponse(200, { env: result.env ?? {}, redirect: result.redirect }, headers);
|
|
1448
1464
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -131,6 +131,8 @@ export interface ToolDefinition<Input = unknown, Output = unknown, InputSchema e
|
|
|
131
131
|
inputSchema: ToolSchema<InputSchema>;
|
|
132
132
|
handler: ToolHandler<Input, Output>;
|
|
133
133
|
outputSchema?: ToolSchema<OutputSchema>;
|
|
134
|
+
/** Timeout in milliseconds. Defaults to 10000 (10 seconds) if not specified. */
|
|
135
|
+
timeout?: number;
|
|
134
136
|
[key: string]: unknown;
|
|
135
137
|
}
|
|
136
138
|
export interface ToolRegistryEntry {
|
|
@@ -150,6 +152,8 @@ export interface ToolMetadata {
|
|
|
150
152
|
description: string;
|
|
151
153
|
inputSchema?: Record<string, unknown>;
|
|
152
154
|
outputSchema?: Record<string, unknown>;
|
|
155
|
+
/** Timeout in milliseconds. Defaults to 10000 (10 seconds) if not specified. */
|
|
156
|
+
timeout?: number;
|
|
153
157
|
}
|
|
154
158
|
export interface HealthStatus {
|
|
155
159
|
status: 'running';
|
|
@@ -177,9 +181,17 @@ export interface CorsOptions {
|
|
|
177
181
|
*/
|
|
178
182
|
export interface ServerHooks {
|
|
179
183
|
/** Called during app installation to validate/normalize env and perform setup */
|
|
180
|
-
install?: InstallHandler
|
|
184
|
+
install?: InstallHandler | {
|
|
185
|
+
handler: InstallHandler;
|
|
186
|
+
/** Timeout in milliseconds. Defaults to 60000 (1 minute) if not specified. */
|
|
187
|
+
timeout?: number;
|
|
188
|
+
};
|
|
181
189
|
/** Called after app version provisioning to set up version-level resources */
|
|
182
|
-
provision?: ProvisionHandler
|
|
190
|
+
provision?: ProvisionHandler | {
|
|
191
|
+
handler: ProvisionHandler;
|
|
192
|
+
/** Timeout in milliseconds. Defaults to 300000 (5 minutes) if not specified. */
|
|
193
|
+
timeout?: number;
|
|
194
|
+
};
|
|
183
195
|
}
|
|
184
196
|
export interface SkedyulServerConfig {
|
|
185
197
|
computeLayer: ComputeLayer;
|