skedyul 1.2.17 → 1.2.18
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 +70 -34
- package/dist/config/index.d.ts +1 -0
- package/dist/config/resolve.d.ts +27 -0
- package/dist/dedicated/server.js +70 -34
- package/dist/esm/index.mjs +72 -34
- package/dist/index.d.ts +1 -1
- package/dist/index.js +74 -34
- package/dist/server.js +70 -34
- package/dist/serverless/server.mjs +70 -34
- package/dist/types/server.d.ts +3 -0
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -2951,6 +2951,64 @@ function printStartupLog(config, tools, webhookRegistry, port) {
|
|
|
2951
2951
|
console.log("");
|
|
2952
2952
|
}
|
|
2953
2953
|
|
|
2954
|
+
// src/config/resolve.ts
|
|
2955
|
+
async function resolveDynamicImport(value) {
|
|
2956
|
+
if (value === void 0 || value === null) {
|
|
2957
|
+
return void 0;
|
|
2958
|
+
}
|
|
2959
|
+
if (value instanceof Promise) {
|
|
2960
|
+
const resolved = await value;
|
|
2961
|
+
if (resolved && typeof resolved === "object" && "default" in resolved) {
|
|
2962
|
+
return resolved.default;
|
|
2963
|
+
}
|
|
2964
|
+
return resolved;
|
|
2965
|
+
}
|
|
2966
|
+
return value;
|
|
2967
|
+
}
|
|
2968
|
+
function serializeTools(registry) {
|
|
2969
|
+
return Object.entries(registry).map(([key, tool]) => ({
|
|
2970
|
+
name: tool.name || key,
|
|
2971
|
+
displayName: tool.label,
|
|
2972
|
+
description: tool.description,
|
|
2973
|
+
timeout: tool.timeout,
|
|
2974
|
+
retries: tool.retries
|
|
2975
|
+
}));
|
|
2976
|
+
}
|
|
2977
|
+
function serializeWebhooks(registry) {
|
|
2978
|
+
return Object.values(registry).map((webhook) => ({
|
|
2979
|
+
name: webhook.name,
|
|
2980
|
+
description: webhook.description,
|
|
2981
|
+
methods: webhook.methods ?? ["POST"],
|
|
2982
|
+
type: webhook.type ?? "WEBHOOK"
|
|
2983
|
+
}));
|
|
2984
|
+
}
|
|
2985
|
+
async function resolveConfig(config, registry, webhookRegistry) {
|
|
2986
|
+
const provision = await resolveDynamicImport(
|
|
2987
|
+
config.provision
|
|
2988
|
+
);
|
|
2989
|
+
const install = await resolveDynamicImport(
|
|
2990
|
+
config.install
|
|
2991
|
+
);
|
|
2992
|
+
const tools = serializeTools(registry);
|
|
2993
|
+
const webhooks = webhookRegistry ? serializeWebhooks(webhookRegistry) : [];
|
|
2994
|
+
return {
|
|
2995
|
+
name: config.name,
|
|
2996
|
+
version: config.version,
|
|
2997
|
+
description: config.description,
|
|
2998
|
+
computeLayer: config.computeLayer,
|
|
2999
|
+
tools,
|
|
3000
|
+
webhooks,
|
|
3001
|
+
provision,
|
|
3002
|
+
agents: config.agents
|
|
3003
|
+
};
|
|
3004
|
+
}
|
|
3005
|
+
function createMinimalConfig(name, version) {
|
|
3006
|
+
return {
|
|
3007
|
+
name,
|
|
3008
|
+
version
|
|
3009
|
+
};
|
|
3010
|
+
}
|
|
3011
|
+
|
|
2954
3012
|
// src/server/dedicated.ts
|
|
2955
3013
|
function createDedicatedServerInstance(config, tools, callTool, state, mcpServer, registry, webhookRegistry) {
|
|
2956
3014
|
const port = getListeningPort(config);
|
|
@@ -2970,23 +3028,12 @@ function createDedicatedServerInstance(config, tools, callTool, state, mcpServer
|
|
|
2970
3028
|
return;
|
|
2971
3029
|
}
|
|
2972
3030
|
if (pathname === "/config" && req.method === "GET") {
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
description: tool.description,
|
|
2980
|
-
timeout: tool.timeout,
|
|
2981
|
-
retries: tool.retries,
|
|
2982
|
-
triggers: tool.triggers
|
|
2983
|
-
})),
|
|
2984
|
-
webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
|
|
2985
|
-
name: w.name,
|
|
2986
|
-
description: w.description,
|
|
2987
|
-
methods: w.methods
|
|
2988
|
-
})) : []
|
|
2989
|
-
});
|
|
3031
|
+
const appConfig = config.appConfig ?? createMinimalConfig(
|
|
3032
|
+
config.metadata.name,
|
|
3033
|
+
config.metadata.version
|
|
3034
|
+
);
|
|
3035
|
+
const serializedConfig = await resolveConfig(appConfig, registry, webhookRegistry);
|
|
3036
|
+
sendJSON(res, 200, serializedConfig);
|
|
2990
3037
|
return;
|
|
2991
3038
|
}
|
|
2992
3039
|
if (pathname.startsWith("/webhooks/") && webhookRegistry) {
|
|
@@ -4077,23 +4124,12 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
|
|
|
4077
4124
|
return createResponse(200, state.getHealthStatus(), headers);
|
|
4078
4125
|
}
|
|
4079
4126
|
if (path14 === "/config" && method === "GET") {
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
description: tool.description,
|
|
4087
|
-
timeout: tool.timeout,
|
|
4088
|
-
retries: tool.retries,
|
|
4089
|
-
triggers: tool.triggers
|
|
4090
|
-
})),
|
|
4091
|
-
webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
|
|
4092
|
-
name: w.name,
|
|
4093
|
-
description: w.description,
|
|
4094
|
-
methods: w.methods
|
|
4095
|
-
})) : []
|
|
4096
|
-
}, headers);
|
|
4127
|
+
const appConfig = config.appConfig ?? createMinimalConfig(
|
|
4128
|
+
config.metadata.name,
|
|
4129
|
+
config.metadata.version
|
|
4130
|
+
);
|
|
4131
|
+
const serializedConfig = await resolveConfig(appConfig, registry, webhookRegistry);
|
|
4132
|
+
return createResponse(200, serializedConfig, headers);
|
|
4097
4133
|
}
|
|
4098
4134
|
if (path14 === "/mcp" && method === "POST") {
|
|
4099
4135
|
let body;
|
package/dist/config/index.d.ts
CHANGED
|
@@ -13,4 +13,5 @@ export type { InstallConfig, ProvisionConfig, BuildConfig, SkedyulConfig, Serial
|
|
|
13
13
|
export { defineConfig } from './app-config';
|
|
14
14
|
export { defineModel, defineChannel, definePage, defineWorkflow, defineAgent, defineEnv, defineNavigation, } from './define';
|
|
15
15
|
export { CONFIG_FILE_NAMES, loadConfig, validateConfig } from './loader';
|
|
16
|
+
export { resolveConfig, createMinimalConfig } from './resolve';
|
|
16
17
|
export { getAllEnvKeys, getRequiredInstallEnvKeys } from './utils';
|
|
@@ -0,0 +1,27 @@
|
|
|
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;
|
package/dist/dedicated/server.js
CHANGED
|
@@ -769,6 +769,64 @@ function printStartupLog(config, tools, webhookRegistry, port) {
|
|
|
769
769
|
console.log("");
|
|
770
770
|
}
|
|
771
771
|
|
|
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) : [];
|
|
812
|
+
return {
|
|
813
|
+
name: config.name,
|
|
814
|
+
version: config.version,
|
|
815
|
+
description: config.description,
|
|
816
|
+
computeLayer: config.computeLayer,
|
|
817
|
+
tools,
|
|
818
|
+
webhooks,
|
|
819
|
+
provision,
|
|
820
|
+
agents: config.agents
|
|
821
|
+
};
|
|
822
|
+
}
|
|
823
|
+
function createMinimalConfig(name, version) {
|
|
824
|
+
return {
|
|
825
|
+
name,
|
|
826
|
+
version
|
|
827
|
+
};
|
|
828
|
+
}
|
|
829
|
+
|
|
772
830
|
// src/server/dedicated.ts
|
|
773
831
|
function createDedicatedServerInstance(config, tools, callTool, state, mcpServer, registry, webhookRegistry) {
|
|
774
832
|
const port = getListeningPort(config);
|
|
@@ -788,23 +846,12 @@ function createDedicatedServerInstance(config, tools, callTool, state, mcpServer
|
|
|
788
846
|
return;
|
|
789
847
|
}
|
|
790
848
|
if (pathname === "/config" && req.method === "GET") {
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
description: tool.description,
|
|
798
|
-
timeout: tool.timeout,
|
|
799
|
-
retries: tool.retries,
|
|
800
|
-
triggers: tool.triggers
|
|
801
|
-
})),
|
|
802
|
-
webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
|
|
803
|
-
name: w.name,
|
|
804
|
-
description: w.description,
|
|
805
|
-
methods: w.methods
|
|
806
|
-
})) : []
|
|
807
|
-
});
|
|
849
|
+
const appConfig = config.appConfig ?? createMinimalConfig(
|
|
850
|
+
config.metadata.name,
|
|
851
|
+
config.metadata.version
|
|
852
|
+
);
|
|
853
|
+
const serializedConfig = await resolveConfig(appConfig, registry, webhookRegistry);
|
|
854
|
+
sendJSON(res, 200, serializedConfig);
|
|
808
855
|
return;
|
|
809
856
|
}
|
|
810
857
|
if (pathname.startsWith("/webhooks/") && webhookRegistry) {
|
|
@@ -1895,23 +1942,12 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
|
|
|
1895
1942
|
return createResponse(200, state.getHealthStatus(), headers);
|
|
1896
1943
|
}
|
|
1897
1944
|
if (path === "/config" && method === "GET") {
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
description: tool.description,
|
|
1905
|
-
timeout: tool.timeout,
|
|
1906
|
-
retries: tool.retries,
|
|
1907
|
-
triggers: tool.triggers
|
|
1908
|
-
})),
|
|
1909
|
-
webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
|
|
1910
|
-
name: w.name,
|
|
1911
|
-
description: w.description,
|
|
1912
|
-
methods: w.methods
|
|
1913
|
-
})) : []
|
|
1914
|
-
}, headers);
|
|
1945
|
+
const appConfig = config.appConfig ?? createMinimalConfig(
|
|
1946
|
+
config.metadata.name,
|
|
1947
|
+
config.metadata.version
|
|
1948
|
+
);
|
|
1949
|
+
const serializedConfig = await resolveConfig(appConfig, registry, webhookRegistry);
|
|
1950
|
+
return createResponse(200, serializedConfig, headers);
|
|
1915
1951
|
}
|
|
1916
1952
|
if (path === "/mcp" && method === "POST") {
|
|
1917
1953
|
let body;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -2455,6 +2455,64 @@ function printStartupLog(config, tools, webhookRegistry, port) {
|
|
|
2455
2455
|
console.log("");
|
|
2456
2456
|
}
|
|
2457
2457
|
|
|
2458
|
+
// src/config/resolve.ts
|
|
2459
|
+
async function resolveDynamicImport(value) {
|
|
2460
|
+
if (value === void 0 || value === null) {
|
|
2461
|
+
return void 0;
|
|
2462
|
+
}
|
|
2463
|
+
if (value instanceof Promise) {
|
|
2464
|
+
const resolved = await value;
|
|
2465
|
+
if (resolved && typeof resolved === "object" && "default" in resolved) {
|
|
2466
|
+
return resolved.default;
|
|
2467
|
+
}
|
|
2468
|
+
return resolved;
|
|
2469
|
+
}
|
|
2470
|
+
return value;
|
|
2471
|
+
}
|
|
2472
|
+
function serializeTools(registry) {
|
|
2473
|
+
return Object.entries(registry).map(([key, tool]) => ({
|
|
2474
|
+
name: tool.name || key,
|
|
2475
|
+
displayName: tool.label,
|
|
2476
|
+
description: tool.description,
|
|
2477
|
+
timeout: tool.timeout,
|
|
2478
|
+
retries: tool.retries
|
|
2479
|
+
}));
|
|
2480
|
+
}
|
|
2481
|
+
function serializeWebhooks(registry) {
|
|
2482
|
+
return Object.values(registry).map((webhook2) => ({
|
|
2483
|
+
name: webhook2.name,
|
|
2484
|
+
description: webhook2.description,
|
|
2485
|
+
methods: webhook2.methods ?? ["POST"],
|
|
2486
|
+
type: webhook2.type ?? "WEBHOOK"
|
|
2487
|
+
}));
|
|
2488
|
+
}
|
|
2489
|
+
async function resolveConfig(config, registry, webhookRegistry) {
|
|
2490
|
+
const provision = await resolveDynamicImport(
|
|
2491
|
+
config.provision
|
|
2492
|
+
);
|
|
2493
|
+
const install = await resolveDynamicImport(
|
|
2494
|
+
config.install
|
|
2495
|
+
);
|
|
2496
|
+
const tools = serializeTools(registry);
|
|
2497
|
+
const webhooks = webhookRegistry ? serializeWebhooks(webhookRegistry) : [];
|
|
2498
|
+
return {
|
|
2499
|
+
name: config.name,
|
|
2500
|
+
version: config.version,
|
|
2501
|
+
description: config.description,
|
|
2502
|
+
computeLayer: config.computeLayer,
|
|
2503
|
+
tools,
|
|
2504
|
+
webhooks,
|
|
2505
|
+
provision,
|
|
2506
|
+
agents: config.agents
|
|
2507
|
+
};
|
|
2508
|
+
}
|
|
2509
|
+
function createMinimalConfig(name, version) {
|
|
2510
|
+
return {
|
|
2511
|
+
name,
|
|
2512
|
+
version
|
|
2513
|
+
};
|
|
2514
|
+
}
|
|
2515
|
+
|
|
2458
2516
|
// src/server/dedicated.ts
|
|
2459
2517
|
function createDedicatedServerInstance(config, tools, callTool, state, mcpServer, registry, webhookRegistry) {
|
|
2460
2518
|
const port = getListeningPort(config);
|
|
@@ -2474,23 +2532,12 @@ function createDedicatedServerInstance(config, tools, callTool, state, mcpServer
|
|
|
2474
2532
|
return;
|
|
2475
2533
|
}
|
|
2476
2534
|
if (pathname === "/config" && req.method === "GET") {
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
description: tool.description,
|
|
2484
|
-
timeout: tool.timeout,
|
|
2485
|
-
retries: tool.retries,
|
|
2486
|
-
triggers: tool.triggers
|
|
2487
|
-
})),
|
|
2488
|
-
webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
|
|
2489
|
-
name: w.name,
|
|
2490
|
-
description: w.description,
|
|
2491
|
-
methods: w.methods
|
|
2492
|
-
})) : []
|
|
2493
|
-
});
|
|
2535
|
+
const appConfig = config.appConfig ?? createMinimalConfig(
|
|
2536
|
+
config.metadata.name,
|
|
2537
|
+
config.metadata.version
|
|
2538
|
+
);
|
|
2539
|
+
const serializedConfig = await resolveConfig(appConfig, registry, webhookRegistry);
|
|
2540
|
+
sendJSON(res, 200, serializedConfig);
|
|
2494
2541
|
return;
|
|
2495
2542
|
}
|
|
2496
2543
|
if (pathname.startsWith("/webhooks/") && webhookRegistry) {
|
|
@@ -3581,23 +3628,12 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
|
|
|
3581
3628
|
return createResponse(200, state.getHealthStatus(), headers);
|
|
3582
3629
|
}
|
|
3583
3630
|
if (path2 === "/config" && method === "GET") {
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
description: tool.description,
|
|
3591
|
-
timeout: tool.timeout,
|
|
3592
|
-
retries: tool.retries,
|
|
3593
|
-
triggers: tool.triggers
|
|
3594
|
-
})),
|
|
3595
|
-
webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
|
|
3596
|
-
name: w.name,
|
|
3597
|
-
description: w.description,
|
|
3598
|
-
methods: w.methods
|
|
3599
|
-
})) : []
|
|
3600
|
-
}, headers);
|
|
3631
|
+
const appConfig = config.appConfig ?? createMinimalConfig(
|
|
3632
|
+
config.metadata.name,
|
|
3633
|
+
config.metadata.version
|
|
3634
|
+
);
|
|
3635
|
+
const serializedConfig = await resolveConfig(appConfig, registry, webhookRegistry);
|
|
3636
|
+
return createResponse(200, serializedConfig, headers);
|
|
3601
3637
|
}
|
|
3602
3638
|
if (path2 === "/mcp" && method === "POST") {
|
|
3603
3639
|
let body;
|
|
@@ -4298,6 +4334,7 @@ export {
|
|
|
4298
4334
|
communicationChannel,
|
|
4299
4335
|
configure,
|
|
4300
4336
|
createContextLogger,
|
|
4337
|
+
createMinimalConfig,
|
|
4301
4338
|
createServerHookContext,
|
|
4302
4339
|
createToolCallContext,
|
|
4303
4340
|
createWebhookContext,
|
|
@@ -4324,6 +4361,7 @@ export {
|
|
|
4324
4361
|
isWorkflowDependency,
|
|
4325
4362
|
loadConfig,
|
|
4326
4363
|
report,
|
|
4364
|
+
resolveConfig,
|
|
4327
4365
|
resource,
|
|
4328
4366
|
runWithConfig,
|
|
4329
4367
|
safeParseConfig,
|
package/dist/index.d.ts
CHANGED
|
@@ -15,5 +15,5 @@ declare const _default: {
|
|
|
15
15
|
z: typeof z;
|
|
16
16
|
};
|
|
17
17
|
export default _default;
|
|
18
|
-
export { defineConfig, defineModel, defineChannel, definePage, defineWorkflow, defineAgent, defineEnv, defineNavigation, loadConfig, validateConfig, CONFIG_FILE_NAMES, getAllEnvKeys, getRequiredInstallEnvKeys, } from './config';
|
|
18
|
+
export { defineConfig, defineModel, defineChannel, definePage, defineWorkflow, defineAgent, defineEnv, defineNavigation, loadConfig, validateConfig, resolveConfig, createMinimalConfig, CONFIG_FILE_NAMES, getAllEnvKeys, getRequiredInstallEnvKeys, } from './config';
|
|
19
19
|
export type { SkedyulConfig, SerializableSkedyulConfig, InstallConfig, ProvisionConfig, BaseDefinition, Scope, FieldOwner, Visibility, ComputeLayer, StructuredFilter, FilterOperator, FilterCondition, FieldOption, EnvVariable, EnvSchema, FieldType, Cardinality, OnDelete, InlineFieldDefinition, FieldVisibility, FieldDefinition, ModelDefinition, RelationshipLink, RelationshipDefinition, CapabilityType, ChannelCapability, ChannelFieldPermissions, ChannelField, ChannelDefinition, WorkflowActionInput, WorkflowAction, WorkflowDefinition, AgentDefinition, NavigationItem, NavigationSection, NavigationSidebar, BreadcrumbItem, NavigationBreadcrumb, NavigationConfig, ContextMode, ContextItemModel, ContextItemTool, ContextItem, ContextDefinition, FormStyleProps, ButtonVariant, ButtonSize, ButtonProps, RelationshipExtension, FormHeader, ActionDefinition, ModalFormDefinition, InputComponent, TextareaComponent, SelectComponent, ComboboxComponent, CheckboxComponent, DatePickerComponent, TimePickerComponent, StatusIndicator, FieldSettingComponent, ImageSettingComponent, FileSettingComponent, ListItemTemplate, ListComponent, EmptyFormComponent, AlertComponent, FormComponent, FormLayoutColumn, FormLayoutRow, FormLayoutConfig, FormProps, CardHeader, CardBlock, ListBlock, ModelMapperBlock, BlockDefinition, PageType, PageDefinition, HttpMethod, WebhookRequest, WebhookHandlerContext, WebhookHandlerResponse, WebhookHandlerFn, WebhookHandlerDefinition, Webhooks, WebhookHandlerMetadata, ModelDependency, ChannelDependency, WorkflowDependency, ResourceDependency, } from './config';
|
package/dist/index.js
CHANGED
|
@@ -136,6 +136,7 @@ __export(index_exports, {
|
|
|
136
136
|
communicationChannel: () => communicationChannel,
|
|
137
137
|
configure: () => configure,
|
|
138
138
|
createContextLogger: () => createContextLogger,
|
|
139
|
+
createMinimalConfig: () => createMinimalConfig,
|
|
139
140
|
createServerHookContext: () => createServerHookContext,
|
|
140
141
|
createToolCallContext: () => createToolCallContext,
|
|
141
142
|
createWebhookContext: () => createWebhookContext,
|
|
@@ -162,6 +163,7 @@ __export(index_exports, {
|
|
|
162
163
|
isWorkflowDependency: () => isWorkflowDependency,
|
|
163
164
|
loadConfig: () => loadConfig,
|
|
164
165
|
report: () => report,
|
|
166
|
+
resolveConfig: () => resolveConfig,
|
|
165
167
|
resource: () => resource,
|
|
166
168
|
runWithConfig: () => runWithConfig,
|
|
167
169
|
safeParseConfig: () => safeParseConfig,
|
|
@@ -2621,6 +2623,64 @@ function printStartupLog(config, tools, webhookRegistry, port) {
|
|
|
2621
2623
|
console.log("");
|
|
2622
2624
|
}
|
|
2623
2625
|
|
|
2626
|
+
// src/config/resolve.ts
|
|
2627
|
+
async function resolveDynamicImport(value) {
|
|
2628
|
+
if (value === void 0 || value === null) {
|
|
2629
|
+
return void 0;
|
|
2630
|
+
}
|
|
2631
|
+
if (value instanceof Promise) {
|
|
2632
|
+
const resolved = await value;
|
|
2633
|
+
if (resolved && typeof resolved === "object" && "default" in resolved) {
|
|
2634
|
+
return resolved.default;
|
|
2635
|
+
}
|
|
2636
|
+
return resolved;
|
|
2637
|
+
}
|
|
2638
|
+
return value;
|
|
2639
|
+
}
|
|
2640
|
+
function serializeTools(registry) {
|
|
2641
|
+
return Object.entries(registry).map(([key, tool]) => ({
|
|
2642
|
+
name: tool.name || key,
|
|
2643
|
+
displayName: tool.label,
|
|
2644
|
+
description: tool.description,
|
|
2645
|
+
timeout: tool.timeout,
|
|
2646
|
+
retries: tool.retries
|
|
2647
|
+
}));
|
|
2648
|
+
}
|
|
2649
|
+
function serializeWebhooks(registry) {
|
|
2650
|
+
return Object.values(registry).map((webhook2) => ({
|
|
2651
|
+
name: webhook2.name,
|
|
2652
|
+
description: webhook2.description,
|
|
2653
|
+
methods: webhook2.methods ?? ["POST"],
|
|
2654
|
+
type: webhook2.type ?? "WEBHOOK"
|
|
2655
|
+
}));
|
|
2656
|
+
}
|
|
2657
|
+
async function resolveConfig(config, registry, webhookRegistry) {
|
|
2658
|
+
const provision = await resolveDynamicImport(
|
|
2659
|
+
config.provision
|
|
2660
|
+
);
|
|
2661
|
+
const install = await resolveDynamicImport(
|
|
2662
|
+
config.install
|
|
2663
|
+
);
|
|
2664
|
+
const tools = serializeTools(registry);
|
|
2665
|
+
const webhooks = webhookRegistry ? serializeWebhooks(webhookRegistry) : [];
|
|
2666
|
+
return {
|
|
2667
|
+
name: config.name,
|
|
2668
|
+
version: config.version,
|
|
2669
|
+
description: config.description,
|
|
2670
|
+
computeLayer: config.computeLayer,
|
|
2671
|
+
tools,
|
|
2672
|
+
webhooks,
|
|
2673
|
+
provision,
|
|
2674
|
+
agents: config.agents
|
|
2675
|
+
};
|
|
2676
|
+
}
|
|
2677
|
+
function createMinimalConfig(name, version) {
|
|
2678
|
+
return {
|
|
2679
|
+
name,
|
|
2680
|
+
version
|
|
2681
|
+
};
|
|
2682
|
+
}
|
|
2683
|
+
|
|
2624
2684
|
// src/server/dedicated.ts
|
|
2625
2685
|
function createDedicatedServerInstance(config, tools, callTool, state, mcpServer, registry, webhookRegistry) {
|
|
2626
2686
|
const port = getListeningPort(config);
|
|
@@ -2640,23 +2700,12 @@ function createDedicatedServerInstance(config, tools, callTool, state, mcpServer
|
|
|
2640
2700
|
return;
|
|
2641
2701
|
}
|
|
2642
2702
|
if (pathname === "/config" && req.method === "GET") {
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
description: tool.description,
|
|
2650
|
-
timeout: tool.timeout,
|
|
2651
|
-
retries: tool.retries,
|
|
2652
|
-
triggers: tool.triggers
|
|
2653
|
-
})),
|
|
2654
|
-
webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
|
|
2655
|
-
name: w.name,
|
|
2656
|
-
description: w.description,
|
|
2657
|
-
methods: w.methods
|
|
2658
|
-
})) : []
|
|
2659
|
-
});
|
|
2703
|
+
const appConfig = config.appConfig ?? createMinimalConfig(
|
|
2704
|
+
config.metadata.name,
|
|
2705
|
+
config.metadata.version
|
|
2706
|
+
);
|
|
2707
|
+
const serializedConfig = await resolveConfig(appConfig, registry, webhookRegistry);
|
|
2708
|
+
sendJSON(res, 200, serializedConfig);
|
|
2660
2709
|
return;
|
|
2661
2710
|
}
|
|
2662
2711
|
if (pathname.startsWith("/webhooks/") && webhookRegistry) {
|
|
@@ -3747,23 +3796,12 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
|
|
|
3747
3796
|
return createResponse(200, state.getHealthStatus(), headers);
|
|
3748
3797
|
}
|
|
3749
3798
|
if (path2 === "/config" && method === "GET") {
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
description: tool.description,
|
|
3757
|
-
timeout: tool.timeout,
|
|
3758
|
-
retries: tool.retries,
|
|
3759
|
-
triggers: tool.triggers
|
|
3760
|
-
})),
|
|
3761
|
-
webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
|
|
3762
|
-
name: w.name,
|
|
3763
|
-
description: w.description,
|
|
3764
|
-
methods: w.methods
|
|
3765
|
-
})) : []
|
|
3766
|
-
}, headers);
|
|
3799
|
+
const appConfig = config.appConfig ?? createMinimalConfig(
|
|
3800
|
+
config.metadata.name,
|
|
3801
|
+
config.metadata.version
|
|
3802
|
+
);
|
|
3803
|
+
const serializedConfig = await resolveConfig(appConfig, registry, webhookRegistry);
|
|
3804
|
+
return createResponse(200, serializedConfig, headers);
|
|
3767
3805
|
}
|
|
3768
3806
|
if (path2 === "/mcp" && method === "POST") {
|
|
3769
3807
|
let body;
|
|
@@ -4465,6 +4503,7 @@ var index_default = { z: import_v44.z };
|
|
|
4465
4503
|
communicationChannel,
|
|
4466
4504
|
configure,
|
|
4467
4505
|
createContextLogger,
|
|
4506
|
+
createMinimalConfig,
|
|
4468
4507
|
createServerHookContext,
|
|
4469
4508
|
createToolCallContext,
|
|
4470
4509
|
createWebhookContext,
|
|
@@ -4490,6 +4529,7 @@ var index_default = { z: import_v44.z };
|
|
|
4490
4529
|
isWorkflowDependency,
|
|
4491
4530
|
loadConfig,
|
|
4492
4531
|
report,
|
|
4532
|
+
resolveConfig,
|
|
4493
4533
|
resource,
|
|
4494
4534
|
runWithConfig,
|
|
4495
4535
|
safeParseConfig,
|
package/dist/server.js
CHANGED
|
@@ -769,6 +769,64 @@ function printStartupLog(config, tools, webhookRegistry, port) {
|
|
|
769
769
|
console.log("");
|
|
770
770
|
}
|
|
771
771
|
|
|
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) : [];
|
|
812
|
+
return {
|
|
813
|
+
name: config.name,
|
|
814
|
+
version: config.version,
|
|
815
|
+
description: config.description,
|
|
816
|
+
computeLayer: config.computeLayer,
|
|
817
|
+
tools,
|
|
818
|
+
webhooks,
|
|
819
|
+
provision,
|
|
820
|
+
agents: config.agents
|
|
821
|
+
};
|
|
822
|
+
}
|
|
823
|
+
function createMinimalConfig(name, version) {
|
|
824
|
+
return {
|
|
825
|
+
name,
|
|
826
|
+
version
|
|
827
|
+
};
|
|
828
|
+
}
|
|
829
|
+
|
|
772
830
|
// src/server/dedicated.ts
|
|
773
831
|
function createDedicatedServerInstance(config, tools, callTool, state, mcpServer, registry, webhookRegistry) {
|
|
774
832
|
const port = getListeningPort(config);
|
|
@@ -788,23 +846,12 @@ function createDedicatedServerInstance(config, tools, callTool, state, mcpServer
|
|
|
788
846
|
return;
|
|
789
847
|
}
|
|
790
848
|
if (pathname === "/config" && req.method === "GET") {
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
description: tool.description,
|
|
798
|
-
timeout: tool.timeout,
|
|
799
|
-
retries: tool.retries,
|
|
800
|
-
triggers: tool.triggers
|
|
801
|
-
})),
|
|
802
|
-
webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
|
|
803
|
-
name: w.name,
|
|
804
|
-
description: w.description,
|
|
805
|
-
methods: w.methods
|
|
806
|
-
})) : []
|
|
807
|
-
});
|
|
849
|
+
const appConfig = config.appConfig ?? createMinimalConfig(
|
|
850
|
+
config.metadata.name,
|
|
851
|
+
config.metadata.version
|
|
852
|
+
);
|
|
853
|
+
const serializedConfig = await resolveConfig(appConfig, registry, webhookRegistry);
|
|
854
|
+
sendJSON(res, 200, serializedConfig);
|
|
808
855
|
return;
|
|
809
856
|
}
|
|
810
857
|
if (pathname.startsWith("/webhooks/") && webhookRegistry) {
|
|
@@ -1895,23 +1942,12 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
|
|
|
1895
1942
|
return createResponse(200, state.getHealthStatus(), headers);
|
|
1896
1943
|
}
|
|
1897
1944
|
if (path === "/config" && method === "GET") {
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
description: tool.description,
|
|
1905
|
-
timeout: tool.timeout,
|
|
1906
|
-
retries: tool.retries,
|
|
1907
|
-
triggers: tool.triggers
|
|
1908
|
-
})),
|
|
1909
|
-
webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
|
|
1910
|
-
name: w.name,
|
|
1911
|
-
description: w.description,
|
|
1912
|
-
methods: w.methods
|
|
1913
|
-
})) : []
|
|
1914
|
-
}, headers);
|
|
1945
|
+
const appConfig = config.appConfig ?? createMinimalConfig(
|
|
1946
|
+
config.metadata.name,
|
|
1947
|
+
config.metadata.version
|
|
1948
|
+
);
|
|
1949
|
+
const serializedConfig = await resolveConfig(appConfig, registry, webhookRegistry);
|
|
1950
|
+
return createResponse(200, serializedConfig, headers);
|
|
1915
1951
|
}
|
|
1916
1952
|
if (path === "/mcp" && method === "POST") {
|
|
1917
1953
|
let body;
|
|
@@ -708,6 +708,64 @@ function printStartupLog(config, tools, webhookRegistry, port) {
|
|
|
708
708
|
console.log("");
|
|
709
709
|
}
|
|
710
710
|
|
|
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) : [];
|
|
751
|
+
return {
|
|
752
|
+
name: config.name,
|
|
753
|
+
version: config.version,
|
|
754
|
+
description: config.description,
|
|
755
|
+
computeLayer: config.computeLayer,
|
|
756
|
+
tools,
|
|
757
|
+
webhooks,
|
|
758
|
+
provision,
|
|
759
|
+
agents: config.agents
|
|
760
|
+
};
|
|
761
|
+
}
|
|
762
|
+
function createMinimalConfig(name, version) {
|
|
763
|
+
return {
|
|
764
|
+
name,
|
|
765
|
+
version
|
|
766
|
+
};
|
|
767
|
+
}
|
|
768
|
+
|
|
711
769
|
// src/server/dedicated.ts
|
|
712
770
|
function createDedicatedServerInstance(config, tools, callTool, state, mcpServer, registry, webhookRegistry) {
|
|
713
771
|
const port = getListeningPort(config);
|
|
@@ -727,23 +785,12 @@ function createDedicatedServerInstance(config, tools, callTool, state, mcpServer
|
|
|
727
785
|
return;
|
|
728
786
|
}
|
|
729
787
|
if (pathname === "/config" && req.method === "GET") {
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
description: tool.description,
|
|
737
|
-
timeout: tool.timeout,
|
|
738
|
-
retries: tool.retries,
|
|
739
|
-
triggers: tool.triggers
|
|
740
|
-
})),
|
|
741
|
-
webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
|
|
742
|
-
name: w.name,
|
|
743
|
-
description: w.description,
|
|
744
|
-
methods: w.methods
|
|
745
|
-
})) : []
|
|
746
|
-
});
|
|
788
|
+
const appConfig = config.appConfig ?? createMinimalConfig(
|
|
789
|
+
config.metadata.name,
|
|
790
|
+
config.metadata.version
|
|
791
|
+
);
|
|
792
|
+
const serializedConfig = await resolveConfig(appConfig, registry, webhookRegistry);
|
|
793
|
+
sendJSON(res, 200, serializedConfig);
|
|
747
794
|
return;
|
|
748
795
|
}
|
|
749
796
|
if (pathname.startsWith("/webhooks/") && webhookRegistry) {
|
|
@@ -1834,23 +1881,12 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
|
|
|
1834
1881
|
return createResponse(200, state.getHealthStatus(), headers);
|
|
1835
1882
|
}
|
|
1836
1883
|
if (path === "/config" && method === "GET") {
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
description: tool.description,
|
|
1844
|
-
timeout: tool.timeout,
|
|
1845
|
-
retries: tool.retries,
|
|
1846
|
-
triggers: tool.triggers
|
|
1847
|
-
})),
|
|
1848
|
-
webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
|
|
1849
|
-
name: w.name,
|
|
1850
|
-
description: w.description,
|
|
1851
|
-
methods: w.methods
|
|
1852
|
-
})) : []
|
|
1853
|
-
}, headers);
|
|
1884
|
+
const appConfig = config.appConfig ?? createMinimalConfig(
|
|
1885
|
+
config.metadata.name,
|
|
1886
|
+
config.metadata.version
|
|
1887
|
+
);
|
|
1888
|
+
const serializedConfig = await resolveConfig(appConfig, registry, webhookRegistry);
|
|
1889
|
+
return createResponse(200, serializedConfig, headers);
|
|
1854
1890
|
}
|
|
1855
1891
|
if (path === "/mcp" && method === "POST") {
|
|
1856
1892
|
let body;
|
package/dist/types/server.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { CoreApiConfig } from '../core/types';
|
|
|
2
2
|
import type { ServerHooks } from './handlers';
|
|
3
3
|
import type { APIGatewayProxyEvent, APIGatewayProxyResult } from './aws';
|
|
4
4
|
import type { ComputeLayer } from '../config/types/compute';
|
|
5
|
+
import type { SkedyulConfig } from '../config/app-config';
|
|
5
6
|
export interface HealthStatus {
|
|
6
7
|
status: 'running';
|
|
7
8
|
requests: number;
|
|
@@ -32,6 +33,8 @@ export interface SkedyulServerConfig {
|
|
|
32
33
|
coreApi?: CoreApiConfig;
|
|
33
34
|
/** Lifecycle hooks for install and provision handlers */
|
|
34
35
|
hooks?: ServerHooks;
|
|
36
|
+
/** Original app config from skedyul.config.ts for /config endpoint serialization */
|
|
37
|
+
appConfig?: SkedyulConfig;
|
|
35
38
|
}
|
|
36
39
|
export interface DedicatedServerInstance {
|
|
37
40
|
listen(port?: number): Promise<void>;
|