skedyul 1.2.19 → 1.2.21

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/server.js CHANGED
@@ -709,10 +709,11 @@ function padEnd(str, length) {
709
709
  }
710
710
  return str + " ".repeat(length - str.length);
711
711
  }
712
- function printStartupLog(config, tools, webhookRegistry, port) {
712
+ function printStartupLog(config, tools, port) {
713
713
  if (process.env.NODE_ENV === "test") {
714
714
  return;
715
715
  }
716
+ const webhookRegistry = config.webhooks;
716
717
  const webhookCount = webhookRegistry ? Object.keys(webhookRegistry).length : 0;
717
718
  const webhookNames = webhookRegistry ? Object.keys(webhookRegistry) : [];
718
719
  const maxRequests = config.maxRequests ?? parseNumberEnv(process.env.MCP_MAX_REQUESTS) ?? null;
@@ -725,9 +726,9 @@ function printStartupLog(config, tools, webhookRegistry, port) {
725
726
  console.log(`\u2551 \u{1F680} Skedyul MCP Server Starting \u2551`);
726
727
  console.log(`\u2560${divider}\u2563`);
727
728
  console.log(`\u2551 \u2551`);
728
- console.log(`\u2551 \u{1F4E6} Server: ${padEnd(config.metadata.name, 49)}\u2551`);
729
- console.log(`\u2551 \u{1F3F7}\uFE0F Version: ${padEnd(config.metadata.version, 49)}\u2551`);
730
- console.log(`\u2551 \u26A1 Compute: ${padEnd(config.computeLayer, 49)}\u2551`);
729
+ console.log(`\u2551 \u{1F4E6} Server: ${padEnd(config.name, 49)}\u2551`);
730
+ console.log(`\u2551 \u{1F3F7}\uFE0F Version: ${padEnd(config.version ?? "N/A", 49)}\u2551`);
731
+ console.log(`\u2551 \u26A1 Compute: ${padEnd(config.computeLayer ?? "serverless", 49)}\u2551`);
731
732
  if (port) {
732
733
  console.log(`\u2551 \u{1F310} Port: ${padEnd(String(port), 49)}\u2551`);
733
734
  }
@@ -769,67 +770,40 @@ function printStartupLog(config, tools, webhookRegistry, port) {
769
770
  console.log("");
770
771
  }
771
772
 
772
- // src/config/resolve.ts
773
- async function resolveDynamicImport(value) {
774
- if (value === void 0 || value === null) {
775
- return void 0;
776
- }
777
- if (value instanceof Promise) {
778
- const resolved = await value;
779
- if (resolved && typeof resolved === "object" && "default" in resolved) {
780
- return resolved.default;
781
- }
782
- return resolved;
783
- }
784
- return value;
785
- }
786
- function serializeTools(registry) {
787
- return Object.entries(registry).map(([key, tool]) => ({
788
- name: tool.name || key,
789
- displayName: tool.label,
790
- description: tool.description,
791
- timeout: tool.timeout,
792
- retries: tool.retries
793
- }));
794
- }
795
- function serializeWebhooks(registry) {
796
- return Object.values(registry).map((webhook) => ({
797
- name: webhook.name,
798
- description: webhook.description,
799
- methods: webhook.methods ?? ["POST"],
800
- type: webhook.type ?? "WEBHOOK"
801
- }));
802
- }
803
- async function resolveConfig(config, registry, webhookRegistry) {
804
- const provision = await resolveDynamicImport(
805
- config.provision
806
- );
807
- const install = await resolveDynamicImport(
808
- config.install
809
- );
810
- const tools = serializeTools(registry);
811
- const webhooks = webhookRegistry ? serializeWebhooks(webhookRegistry) : [];
773
+ // src/server/config-serializer.ts
774
+ function serializeConfig(config) {
775
+ const registry = config.tools;
776
+ const webhookRegistry = config.webhooks;
812
777
  return {
813
778
  name: config.name,
814
779
  version: config.version,
815
780
  description: config.description,
816
781
  computeLayer: config.computeLayer,
817
- tools,
818
- webhooks,
819
- provision,
782
+ tools: registry ? Object.entries(registry).map(([key, tool]) => ({
783
+ name: tool.name || key,
784
+ description: tool.description,
785
+ timeout: tool.timeout,
786
+ retries: tool.retries
787
+ })) : [],
788
+ webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
789
+ name: w.name,
790
+ description: w.description,
791
+ methods: w.methods ?? ["POST"],
792
+ type: w.type ?? "WEBHOOK"
793
+ })) : [],
794
+ provision: isProvisionConfig(config.provision) ? config.provision : void 0,
820
795
  agents: config.agents
821
796
  };
822
797
  }
823
- function createMinimalConfig(name, version) {
824
- return {
825
- name,
826
- version
827
- };
798
+ function isProvisionConfig(value) {
799
+ return value !== void 0 && value !== null && !(value instanceof Promise);
828
800
  }
829
801
 
830
802
  // src/server/dedicated.ts
831
- function createDedicatedServerInstance(config, tools, callTool, state, mcpServer, registry, webhookRegistry) {
803
+ function createDedicatedServerInstance(config, tools, callTool, state, mcpServer) {
832
804
  const port = getListeningPort(config);
805
+ const registry = config.tools;
806
+ const webhookRegistry = config.webhooks;
833
807
  const httpServer = import_http2.default.createServer(
834
808
  async (req, res) => {
835
809
  function sendCoreResult(result) {
@@ -846,19 +820,7 @@ function createDedicatedServerInstance(config, tools, callTool, state, mcpServer
846
820
  return;
847
821
  }
848
822
  if (pathname === "/config" && req.method === "GET") {
849
- let appConfig = config.appConfig;
850
- if (!appConfig && config.appConfigLoader) {
851
- const loaded = await config.appConfigLoader();
852
- appConfig = loaded.default;
853
- }
854
- if (!appConfig) {
855
- appConfig = createMinimalConfig(
856
- config.metadata.name,
857
- config.metadata.version
858
- );
859
- }
860
- const serializedConfig = await resolveConfig(appConfig, registry, webhookRegistry);
861
- sendJSON(res, 200, serializedConfig);
823
+ sendJSON(res, 200, serializeConfig(config));
862
824
  return;
863
825
  }
864
826
  if (pathname.startsWith("/webhooks/") && webhookRegistry) {
@@ -1387,7 +1349,7 @@ function createDedicatedServerInstance(config, tools, callTool, state, mcpServer
1387
1349
  const finalPort = listenPort ?? port;
1388
1350
  return new Promise((resolve, reject) => {
1389
1351
  httpServer.listen(finalPort, () => {
1390
- printStartupLog(config, tools, webhookRegistry, finalPort);
1352
+ printStartupLog(config, tools, finalPort);
1391
1353
  resolve();
1392
1354
  });
1393
1355
  httpServer.once("error", reject);
@@ -1398,13 +1360,15 @@ function createDedicatedServerInstance(config, tools, callTool, state, mcpServer
1398
1360
  }
1399
1361
 
1400
1362
  // src/server/serverless.ts
1401
- function createServerlessInstance(config, tools, callTool, state, mcpServer, registry, webhookRegistry) {
1363
+ function createServerlessInstance(config, tools, callTool, state, mcpServer) {
1402
1364
  const headers = getDefaultHeaders(config.cors);
1365
+ const registry = config.tools;
1366
+ const webhookRegistry = config.webhooks;
1403
1367
  let hasLoggedStartup = false;
1404
1368
  return {
1405
1369
  async handler(event) {
1406
1370
  if (!hasLoggedStartup) {
1407
- printStartupLog(config, tools, webhookRegistry);
1371
+ printStartupLog(config, tools);
1408
1372
  hasLoggedStartup = true;
1409
1373
  }
1410
1374
  try {
@@ -1949,19 +1913,7 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
1949
1913
  return createResponse(200, state.getHealthStatus(), headers);
1950
1914
  }
1951
1915
  if (path === "/config" && method === "GET") {
1952
- let appConfig = config.appConfig;
1953
- if (!appConfig && config.appConfigLoader) {
1954
- const loaded = await config.appConfigLoader();
1955
- appConfig = loaded.default;
1956
- }
1957
- if (!appConfig) {
1958
- appConfig = createMinimalConfig(
1959
- config.metadata.name,
1960
- config.metadata.version
1961
- );
1962
- }
1963
- const serializedConfig = await resolveConfig(appConfig, registry, webhookRegistry);
1964
- return createResponse(200, serializedConfig, headers);
1916
+ return createResponse(200, serializeConfig(config), headers);
1965
1917
  }
1966
1918
  if (path === "/mcp" && method === "POST") {
1967
1919
  let body;
@@ -2179,9 +2131,11 @@ console.log("[skedyul-node/server] All imports complete");
2179
2131
  console.log("[skedyul-node/server] Installing context logger...");
2180
2132
  installContextLogger();
2181
2133
  console.log("[skedyul-node/server] Context logger installed");
2182
- function createSkedyulServer(config, registry, webhookRegistry) {
2134
+ function createSkedyulServer(config) {
2183
2135
  console.log("[createSkedyulServer] Step 1: mergeRuntimeEnv()");
2184
2136
  mergeRuntimeEnv();
2137
+ const registry = config.tools;
2138
+ const webhookRegistry = config.webhooks;
2185
2139
  console.log("[createSkedyulServer] Step 2: coreApi setup");
2186
2140
  if (config.coreApi?.service) {
2187
2141
  coreApiService.register(config.coreApi.service);
@@ -2193,7 +2147,7 @@ function createSkedyulServer(config, registry, webhookRegistry) {
2193
2147
  const tools = buildToolMetadata(registry);
2194
2148
  console.log("[createSkedyulServer] Step 3 done, tools:", tools.length);
2195
2149
  const toolNames = Object.values(registry).map((tool) => tool.name);
2196
- const runtimeLabel = config.computeLayer;
2150
+ const runtimeLabel = config.computeLayer ?? "serverless";
2197
2151
  const maxRequests = config.maxRequests ?? parseNumberEnv(process.env.MCP_MAX_REQUESTS) ?? null;
2198
2152
  const ttlExtendSeconds = config.ttlExtendSeconds ?? parseNumberEnv(process.env.MCP_TTL_EXTEND) ?? 3600;
2199
2153
  console.log("[createSkedyulServer] Step 4: createRequestState()");
@@ -2206,8 +2160,8 @@ function createSkedyulServer(config, registry, webhookRegistry) {
2206
2160
  console.log("[createSkedyulServer] Step 4 done");
2207
2161
  console.log("[createSkedyulServer] Step 5: new McpServer()");
2208
2162
  const mcpServer = new import_mcp.McpServer({
2209
- name: config.metadata.name,
2210
- version: config.metadata.version
2163
+ name: config.name,
2164
+ version: config.version ?? "0.0.0"
2211
2165
  });
2212
2166
  console.log("[createSkedyulServer] Step 5 done");
2213
2167
  const dedicatedShutdown = () => {
@@ -2335,13 +2289,11 @@ function createSkedyulServer(config, registry, webhookRegistry) {
2335
2289
  tools,
2336
2290
  callTool,
2337
2291
  state,
2338
- mcpServer,
2339
- registry,
2340
- webhookRegistry
2292
+ mcpServer
2341
2293
  );
2342
2294
  }
2343
2295
  console.log("[createSkedyulServer] Creating serverless instance");
2344
- const serverlessInstance = createServerlessInstance(config, tools, callTool, state, mcpServer, registry, webhookRegistry);
2296
+ const serverlessInstance = createServerlessInstance(config, tools, callTool, state, mcpServer);
2345
2297
  console.log("[createSkedyulServer] Serverless instance created successfully");
2346
2298
  return serverlessInstance;
2347
2299
  }
@@ -648,10 +648,11 @@ function padEnd(str, length) {
648
648
  }
649
649
  return str + " ".repeat(length - str.length);
650
650
  }
651
- function printStartupLog(config, tools, webhookRegistry, port) {
651
+ function printStartupLog(config, tools, port) {
652
652
  if (process.env.NODE_ENV === "test") {
653
653
  return;
654
654
  }
655
+ const webhookRegistry = config.webhooks;
655
656
  const webhookCount = webhookRegistry ? Object.keys(webhookRegistry).length : 0;
656
657
  const webhookNames = webhookRegistry ? Object.keys(webhookRegistry) : [];
657
658
  const maxRequests = config.maxRequests ?? parseNumberEnv(process.env.MCP_MAX_REQUESTS) ?? null;
@@ -664,9 +665,9 @@ function printStartupLog(config, tools, webhookRegistry, port) {
664
665
  console.log(`\u2551 \u{1F680} Skedyul MCP Server Starting \u2551`);
665
666
  console.log(`\u2560${divider}\u2563`);
666
667
  console.log(`\u2551 \u2551`);
667
- console.log(`\u2551 \u{1F4E6} Server: ${padEnd(config.metadata.name, 49)}\u2551`);
668
- console.log(`\u2551 \u{1F3F7}\uFE0F Version: ${padEnd(config.metadata.version, 49)}\u2551`);
669
- console.log(`\u2551 \u26A1 Compute: ${padEnd(config.computeLayer, 49)}\u2551`);
668
+ console.log(`\u2551 \u{1F4E6} Server: ${padEnd(config.name, 49)}\u2551`);
669
+ console.log(`\u2551 \u{1F3F7}\uFE0F Version: ${padEnd(config.version ?? "N/A", 49)}\u2551`);
670
+ console.log(`\u2551 \u26A1 Compute: ${padEnd(config.computeLayer ?? "serverless", 49)}\u2551`);
670
671
  if (port) {
671
672
  console.log(`\u2551 \u{1F310} Port: ${padEnd(String(port), 49)}\u2551`);
672
673
  }
@@ -708,67 +709,40 @@ function printStartupLog(config, tools, webhookRegistry, port) {
708
709
  console.log("");
709
710
  }
710
711
 
711
- // src/config/resolve.ts
712
- async function resolveDynamicImport(value) {
713
- if (value === void 0 || value === null) {
714
- return void 0;
715
- }
716
- if (value instanceof Promise) {
717
- const resolved = await value;
718
- if (resolved && typeof resolved === "object" && "default" in resolved) {
719
- return resolved.default;
720
- }
721
- return resolved;
722
- }
723
- return value;
724
- }
725
- function serializeTools(registry) {
726
- return Object.entries(registry).map(([key, tool]) => ({
727
- name: tool.name || key,
728
- displayName: tool.label,
729
- description: tool.description,
730
- timeout: tool.timeout,
731
- retries: tool.retries
732
- }));
733
- }
734
- function serializeWebhooks(registry) {
735
- return Object.values(registry).map((webhook) => ({
736
- name: webhook.name,
737
- description: webhook.description,
738
- methods: webhook.methods ?? ["POST"],
739
- type: webhook.type ?? "WEBHOOK"
740
- }));
741
- }
742
- async function resolveConfig(config, registry, webhookRegistry) {
743
- const provision = await resolveDynamicImport(
744
- config.provision
745
- );
746
- const install = await resolveDynamicImport(
747
- config.install
748
- );
749
- const tools = serializeTools(registry);
750
- const webhooks = webhookRegistry ? serializeWebhooks(webhookRegistry) : [];
712
+ // src/server/config-serializer.ts
713
+ function serializeConfig(config) {
714
+ const registry = config.tools;
715
+ const webhookRegistry = config.webhooks;
751
716
  return {
752
717
  name: config.name,
753
718
  version: config.version,
754
719
  description: config.description,
755
720
  computeLayer: config.computeLayer,
756
- tools,
757
- webhooks,
758
- provision,
721
+ tools: registry ? Object.entries(registry).map(([key, tool]) => ({
722
+ name: tool.name || key,
723
+ description: tool.description,
724
+ timeout: tool.timeout,
725
+ retries: tool.retries
726
+ })) : [],
727
+ webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
728
+ name: w.name,
729
+ description: w.description,
730
+ methods: w.methods ?? ["POST"],
731
+ type: w.type ?? "WEBHOOK"
732
+ })) : [],
733
+ provision: isProvisionConfig(config.provision) ? config.provision : void 0,
759
734
  agents: config.agents
760
735
  };
761
736
  }
762
- function createMinimalConfig(name, version) {
763
- return {
764
- name,
765
- version
766
- };
737
+ function isProvisionConfig(value) {
738
+ return value !== void 0 && value !== null && !(value instanceof Promise);
767
739
  }
768
740
 
769
741
  // src/server/dedicated.ts
770
- function createDedicatedServerInstance(config, tools, callTool, state, mcpServer, registry, webhookRegistry) {
742
+ function createDedicatedServerInstance(config, tools, callTool, state, mcpServer) {
771
743
  const port = getListeningPort(config);
744
+ const registry = config.tools;
745
+ const webhookRegistry = config.webhooks;
772
746
  const httpServer = http.createServer(
773
747
  async (req, res) => {
774
748
  function sendCoreResult(result) {
@@ -785,19 +759,7 @@ function createDedicatedServerInstance(config, tools, callTool, state, mcpServer
785
759
  return;
786
760
  }
787
761
  if (pathname === "/config" && req.method === "GET") {
788
- let appConfig = config.appConfig;
789
- if (!appConfig && config.appConfigLoader) {
790
- const loaded = await config.appConfigLoader();
791
- appConfig = loaded.default;
792
- }
793
- if (!appConfig) {
794
- appConfig = createMinimalConfig(
795
- config.metadata.name,
796
- config.metadata.version
797
- );
798
- }
799
- const serializedConfig = await resolveConfig(appConfig, registry, webhookRegistry);
800
- sendJSON(res, 200, serializedConfig);
762
+ sendJSON(res, 200, serializeConfig(config));
801
763
  return;
802
764
  }
803
765
  if (pathname.startsWith("/webhooks/") && webhookRegistry) {
@@ -1326,7 +1288,7 @@ function createDedicatedServerInstance(config, tools, callTool, state, mcpServer
1326
1288
  const finalPort = listenPort ?? port;
1327
1289
  return new Promise((resolve, reject) => {
1328
1290
  httpServer.listen(finalPort, () => {
1329
- printStartupLog(config, tools, webhookRegistry, finalPort);
1291
+ printStartupLog(config, tools, finalPort);
1330
1292
  resolve();
1331
1293
  });
1332
1294
  httpServer.once("error", reject);
@@ -1337,13 +1299,15 @@ function createDedicatedServerInstance(config, tools, callTool, state, mcpServer
1337
1299
  }
1338
1300
 
1339
1301
  // src/server/serverless.ts
1340
- function createServerlessInstance(config, tools, callTool, state, mcpServer, registry, webhookRegistry) {
1302
+ function createServerlessInstance(config, tools, callTool, state, mcpServer) {
1341
1303
  const headers = getDefaultHeaders(config.cors);
1304
+ const registry = config.tools;
1305
+ const webhookRegistry = config.webhooks;
1342
1306
  let hasLoggedStartup = false;
1343
1307
  return {
1344
1308
  async handler(event) {
1345
1309
  if (!hasLoggedStartup) {
1346
- printStartupLog(config, tools, webhookRegistry);
1310
+ printStartupLog(config, tools);
1347
1311
  hasLoggedStartup = true;
1348
1312
  }
1349
1313
  try {
@@ -1888,19 +1852,7 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
1888
1852
  return createResponse(200, state.getHealthStatus(), headers);
1889
1853
  }
1890
1854
  if (path === "/config" && method === "GET") {
1891
- let appConfig = config.appConfig;
1892
- if (!appConfig && config.appConfigLoader) {
1893
- const loaded = await config.appConfigLoader();
1894
- appConfig = loaded.default;
1895
- }
1896
- if (!appConfig) {
1897
- appConfig = createMinimalConfig(
1898
- config.metadata.name,
1899
- config.metadata.version
1900
- );
1901
- }
1902
- const serializedConfig = await resolveConfig(appConfig, registry, webhookRegistry);
1903
- return createResponse(200, serializedConfig, headers);
1855
+ return createResponse(200, serializeConfig(config), headers);
1904
1856
  }
1905
1857
  if (path === "/mcp" && method === "POST") {
1906
1858
  let body;
@@ -2118,9 +2070,11 @@ console.log("[skedyul-node/server] All imports complete");
2118
2070
  console.log("[skedyul-node/server] Installing context logger...");
2119
2071
  installContextLogger();
2120
2072
  console.log("[skedyul-node/server] Context logger installed");
2121
- function createSkedyulServer(config, registry, webhookRegistry) {
2073
+ function createSkedyulServer(config) {
2122
2074
  console.log("[createSkedyulServer] Step 1: mergeRuntimeEnv()");
2123
2075
  mergeRuntimeEnv();
2076
+ const registry = config.tools;
2077
+ const webhookRegistry = config.webhooks;
2124
2078
  console.log("[createSkedyulServer] Step 2: coreApi setup");
2125
2079
  if (config.coreApi?.service) {
2126
2080
  coreApiService.register(config.coreApi.service);
@@ -2132,7 +2086,7 @@ function createSkedyulServer(config, registry, webhookRegistry) {
2132
2086
  const tools = buildToolMetadata(registry);
2133
2087
  console.log("[createSkedyulServer] Step 3 done, tools:", tools.length);
2134
2088
  const toolNames = Object.values(registry).map((tool) => tool.name);
2135
- const runtimeLabel = config.computeLayer;
2089
+ const runtimeLabel = config.computeLayer ?? "serverless";
2136
2090
  const maxRequests = config.maxRequests ?? parseNumberEnv(process.env.MCP_MAX_REQUESTS) ?? null;
2137
2091
  const ttlExtendSeconds = config.ttlExtendSeconds ?? parseNumberEnv(process.env.MCP_TTL_EXTEND) ?? 3600;
2138
2092
  console.log("[createSkedyulServer] Step 4: createRequestState()");
@@ -2145,8 +2099,8 @@ function createSkedyulServer(config, registry, webhookRegistry) {
2145
2099
  console.log("[createSkedyulServer] Step 4 done");
2146
2100
  console.log("[createSkedyulServer] Step 5: new McpServer()");
2147
2101
  const mcpServer = new McpServer({
2148
- name: config.metadata.name,
2149
- version: config.metadata.version
2102
+ name: config.name,
2103
+ version: config.version ?? "0.0.0"
2150
2104
  });
2151
2105
  console.log("[createSkedyulServer] Step 5 done");
2152
2106
  const dedicatedShutdown = () => {
@@ -2274,13 +2228,11 @@ function createSkedyulServer(config, registry, webhookRegistry) {
2274
2228
  tools,
2275
2229
  callTool,
2276
2230
  state,
2277
- mcpServer,
2278
- registry,
2279
- webhookRegistry
2231
+ mcpServer
2280
2232
  );
2281
2233
  }
2282
2234
  console.log("[createSkedyulServer] Creating serverless instance");
2283
- const serverlessInstance = createServerlessInstance(config, tools, callTool, state, mcpServer, registry, webhookRegistry);
2235
+ const serverlessInstance = createServerlessInstance(config, tools, callTool, state, mcpServer);
2284
2236
  console.log("[createSkedyulServer] Serverless instance created successfully");
2285
2237
  return serverlessInstance;
2286
2238
  }
@@ -11,7 +11,7 @@ export type { ToolTrigger, ProvisionToolContext, FieldChangeToolContext, PageAct
11
11
  export { isProvisionContext, isRuntimeContext } from './tool-context';
12
12
  export type { ProvisionToolInput, BillingInfo, ToolResponseMeta, ToolEffect, ToolError, ToolExecutionResult, ToolSchemaWithJson, ToolSchema, ToolHandler, ToolDefinition, ToolRegistryEntry, ToolRegistry, ToolName, ToolMetadata, ToolCallResponse, } from './tool';
13
13
  export { ToolResponseMetaSchema } from './tool';
14
- export type { HealthStatus, ComputeLayer, ServerMetadata, CorsOptions, SkedyulServerConfig, DedicatedServerInstance, ServerlessServerInstance, SkedyulServerInstance, } from './server';
14
+ export type { HealthStatus, ComputeLayer, DedicatedServerInstance, ServerlessServerInstance, SkedyulServerInstance, } from './server';
15
15
  export type { InstallHandlerContext, InstallHandlerResponseOAuth, InstallHandlerResponseStandard, HasOAuthCallback, InstallHandlerResult, InstallHandler, UninstallHandlerContext, UninstallHandlerResult, UninstallHandler, OAuthCallbackContext, OAuthCallbackResult, OAuthCallbackHandler, ProvisionHandlerContext, ProvisionHandlerResult, ProvisionHandler, ServerHooksWithOAuth, ServerHooksWithoutOAuth, ServerHooks, } from './handlers';
16
16
  export type { APIGatewayProxyEvent, APIGatewayProxyResult } from './aws';
17
17
  export type { HandlerRawRequest, WebhookRequest, WebhookResponse, ProvisionWebhookContext, RuntimeWebhookContext, WebhookContext, WebhookHandler, WebhookLifecycleContext, CommunicationChannelLifecycleContext, WebhookLifecycleResult, WebhookLifecycleHook, WebhookType, WebhookDefinition, WebhookRegistry, WebhookName, WebhookMetadata, } from './webhook';
@@ -1,8 +1,5 @@
1
- import type { CoreApiConfig } from '../core/types';
2
- import type { ServerHooks } from './handlers';
3
1
  import type { APIGatewayProxyEvent, APIGatewayProxyResult } from './aws';
4
2
  import type { ComputeLayer } from '../config/types/compute';
5
- import type { SkedyulConfig } from '../config/app-config';
6
3
  export interface HealthStatus {
7
4
  status: 'running';
8
5
  requests: number;
@@ -14,36 +11,6 @@ export interface HealthStatus {
14
11
  tools: string[];
15
12
  }
16
13
  export type { ComputeLayer };
17
- export interface ServerMetadata {
18
- name: string;
19
- version: string;
20
- }
21
- export interface CorsOptions {
22
- allowOrigin?: string;
23
- allowMethods?: string;
24
- allowHeaders?: string;
25
- }
26
- export interface SkedyulServerConfig {
27
- computeLayer: ComputeLayer;
28
- metadata: ServerMetadata;
29
- defaultPort?: number;
30
- maxRequests?: number | null;
31
- ttlExtendSeconds?: number;
32
- cors?: CorsOptions;
33
- coreApi?: CoreApiConfig;
34
- /** Lifecycle hooks for install and provision handlers */
35
- hooks?: ServerHooks;
36
- /** Original app config from skedyul.config.ts for /config endpoint serialization */
37
- appConfig?: SkedyulConfig;
38
- /**
39
- * Lazy loader for app config - use this instead of appConfig to avoid bundling
40
- * provision/install configs at build time. The loader is called only when the
41
- * /config endpoint is accessed.
42
- */
43
- appConfigLoader?: () => Promise<{
44
- default: SkedyulConfig;
45
- }>;
46
- }
47
14
  export interface DedicatedServerInstance {
48
15
  listen(port?: number): Promise<void>;
49
16
  getHealthStatus(): HealthStatus;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skedyul",
3
- "version": "1.2.19",
3
+ "version": "1.2.21",
4
4
  "description": "The Skedyul SDK for Node.js",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,27 +0,0 @@
1
- /**
2
- * Config resolution utilities.
3
- *
4
- * This module provides functions to resolve dynamic imports in SkedyulConfig
5
- * and convert it to a serializable format for the /config endpoint.
6
- */
7
- import type { SkedyulConfig, SerializableSkedyulConfig } from './app-config';
8
- import type { ToolRegistry, WebhookRegistry } from '../types';
9
- /**
10
- * Resolves all dynamic imports in a SkedyulConfig and returns a serializable version.
11
- *
12
- * This function:
13
- * 1. Resolves dynamic imports for tools, webhooks, provision, and install
14
- * 2. Serializes tool and webhook registries to metadata arrays
15
- * 3. Returns a plain object suitable for JSON serialization
16
- *
17
- * @param config - The original SkedyulConfig (may contain dynamic imports)
18
- * @param registry - The resolved tool registry (already loaded by mcp_server.ts)
19
- * @param webhookRegistry - The resolved webhook registry (if any)
20
- * @returns A fully resolved and serializable config
21
- */
22
- export declare function resolveConfig(config: SkedyulConfig, registry: ToolRegistry, webhookRegistry?: WebhookRegistry): Promise<SerializableSkedyulConfig>;
23
- /**
24
- * Creates a minimal SkedyulConfig from server metadata.
25
- * Used as a fallback when appConfig is not provided.
26
- */
27
- export declare function createMinimalConfig(name: string, version?: string): SkedyulConfig;