skedyul 1.2.19 → 1.2.23
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 +512 -731
- package/dist/config/app-config.d.ts +26 -2
- package/dist/config/index.d.ts +1 -2
- package/dist/config/types/env.d.ts +8 -2
- package/dist/config/types/form.d.ts +10 -6
- package/dist/config/types/index.d.ts +0 -1
- package/dist/config/types/page.d.ts +2 -2
- package/dist/config/types/webhook.d.ts +2 -1
- package/dist/dedicated/server.js +503 -766
- package/dist/esm/index.mjs +503 -720
- package/dist/index.d.ts +2 -3
- package/dist/index.js +503 -722
- package/dist/server/config-serializer.d.ts +12 -0
- package/dist/server/dedicated.d.ts +3 -2
- package/dist/server/handlers/index.d.ts +12 -0
- package/dist/server/handlers/install-handler.d.ts +9 -0
- package/dist/server/handlers/oauth-callback-handler.d.ts +9 -0
- package/dist/server/handlers/provision-handler.d.ts +9 -0
- package/dist/server/handlers/types.d.ts +101 -0
- package/dist/server/handlers/uninstall-handler.d.ts +9 -0
- package/dist/server/handlers/webhook-handler.d.ts +28 -0
- package/dist/server/index.d.ts +15 -6
- package/dist/server/serverless.d.ts +3 -2
- package/dist/server/startup-logger.d.ts +3 -2
- package/dist/server/tool-handler.d.ts +1 -1
- package/dist/server/utils/http.d.ts +3 -2
- package/dist/server.d.ts +1 -1
- package/dist/server.js +503 -766
- package/dist/serverless/server.mjs +503 -744
- package/dist/types/handlers.d.ts +6 -24
- package/dist/types/index.d.ts +4 -4
- package/dist/types/server.d.ts +1 -34
- package/dist/types/shared.d.ts +5 -0
- package/dist/types/tool.d.ts +5 -7
- package/dist/types/webhook.d.ts +14 -6
- package/package.json +1 -1
- package/dist/config/resolve.d.ts +0 -27
- package/dist/config/types/compute.d.ts +0 -9
package/dist/types/handlers.d.ts
CHANGED
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
import type { WebhookRequest } from './webhook';
|
|
2
2
|
import type { InvocationContext } from './invocation';
|
|
3
|
+
import type { AppInfoWithHandles, AppInfo, WorkplaceInfo } from './shared';
|
|
3
4
|
import type { ContextLogger } from '../server/logger';
|
|
4
5
|
export interface InstallHandlerContext {
|
|
5
6
|
env: Record<string, string>;
|
|
6
|
-
workplace:
|
|
7
|
-
id: string;
|
|
8
|
-
subdomain: string;
|
|
9
|
-
};
|
|
7
|
+
workplace: WorkplaceInfo;
|
|
10
8
|
appInstallationId: string;
|
|
11
|
-
app:
|
|
12
|
-
id: string;
|
|
13
|
-
versionId: string;
|
|
14
|
-
handle: string;
|
|
15
|
-
versionHandle: string;
|
|
16
|
-
};
|
|
9
|
+
app: AppInfoWithHandles;
|
|
17
10
|
/** Invocation context for log traceability */
|
|
18
11
|
invocation?: InvocationContext;
|
|
19
12
|
/** Context-aware logger that automatically includes invocation context */
|
|
@@ -34,17 +27,9 @@ export type InstallHandlerResult<Hooks extends ServerHooks = ServerHooks> = HasO
|
|
|
34
27
|
export type InstallHandler<Hooks extends ServerHooks = ServerHooks> = (ctx: InstallHandlerContext) => Promise<InstallHandlerResult<Hooks>>;
|
|
35
28
|
export interface UninstallHandlerContext {
|
|
36
29
|
env: Record<string, string>;
|
|
37
|
-
workplace:
|
|
38
|
-
id: string;
|
|
39
|
-
subdomain: string;
|
|
40
|
-
};
|
|
30
|
+
workplace: WorkplaceInfo;
|
|
41
31
|
appInstallationId: string;
|
|
42
|
-
app:
|
|
43
|
-
id: string;
|
|
44
|
-
versionId: string;
|
|
45
|
-
handle: string;
|
|
46
|
-
versionHandle: string;
|
|
47
|
-
};
|
|
32
|
+
app: AppInfoWithHandles;
|
|
48
33
|
/** Invocation context for log traceability */
|
|
49
34
|
invocation?: InvocationContext;
|
|
50
35
|
/** Context-aware logger that automatically includes invocation context */
|
|
@@ -69,10 +54,7 @@ export interface OAuthCallbackResult {
|
|
|
69
54
|
export type OAuthCallbackHandler = (ctx: OAuthCallbackContext) => Promise<OAuthCallbackResult>;
|
|
70
55
|
export interface ProvisionHandlerContext {
|
|
71
56
|
env: Record<string, string>;
|
|
72
|
-
app:
|
|
73
|
-
id: string;
|
|
74
|
-
versionId: string;
|
|
75
|
-
};
|
|
57
|
+
app: AppInfo;
|
|
76
58
|
/** Invocation context for log traceability */
|
|
77
59
|
invocation?: InvocationContext;
|
|
78
60
|
/** Context-aware logger that automatically includes invocation context */
|
package/dist/types/index.d.ts
CHANGED
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
* This maintains backward compatibility while organizing types
|
|
5
5
|
* into smaller, focused modules.
|
|
6
6
|
*/
|
|
7
|
-
export type { AppInfo, WorkplaceInfo, RequestInfo } from './shared';
|
|
7
|
+
export type { AppInfo, AppInfoWithHandles, WorkplaceInfo, RequestInfo } from './shared';
|
|
8
8
|
export type { InvocationType, ServerHookHandle, InvocationContext, } from './invocation';
|
|
9
9
|
export { createToolCallContext, createServerHookContext, createWebhookContext, createWorkflowStepContext, } from './invocation';
|
|
10
10
|
export type { ToolTrigger, ProvisionToolContext, FieldChangeToolContext, PageActionToolContext, FormSubmitToolContext, AgentToolContext, WorkflowToolContext, ToolExecutionContext, } from './tool-context';
|
|
11
11
|
export { isProvisionContext, isRuntimeContext } from './tool-context';
|
|
12
|
-
export type {
|
|
12
|
+
export type { 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,
|
|
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
|
-
export type { HandlerRawRequest, WebhookRequest, WebhookResponse, ProvisionWebhookContext, RuntimeWebhookContext, WebhookContext, WebhookHandler, WebhookLifecycleContext, CommunicationChannelLifecycleContext, WebhookLifecycleResult, WebhookLifecycleHook, WebhookType, WebhookDefinition, WebhookRegistry, WebhookName, WebhookMetadata, } from './webhook';
|
|
17
|
+
export type { WebhookWireRequest, HandlerRawRequest, WebhookRequest, WebhookResponse, ProvisionWebhookContext, RuntimeWebhookContext, WebhookContext, WebhookHandler, WebhookLifecycleContext, CommunicationChannelLifecycleContext, WebhookLifecycleResult, WebhookLifecycleHook, WebhookInvocationMode, WebhookType, WebhookDefinition, WebhookRegistry, WebhookName, WebhookMetadata, } from './webhook';
|
|
18
18
|
export { isRuntimeWebhookContext } from './webhook';
|
|
19
19
|
export type { MCPError, MCPContentItem, MCPResult, MCPResponse, MCPRequest, } from './mcp-protocol';
|
package/dist/types/server.d.ts
CHANGED
|
@@ -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
|
-
import type { ComputeLayer } from '../config/types/
|
|
5
|
-
import type { SkedyulConfig } from '../config/app-config';
|
|
2
|
+
import type { ComputeLayer } from '../config/types/base';
|
|
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/dist/types/shared.d.ts
CHANGED
|
@@ -3,6 +3,11 @@ export interface AppInfo {
|
|
|
3
3
|
id: string;
|
|
4
4
|
versionId: string;
|
|
5
5
|
}
|
|
6
|
+
/** Extended app info with handles - present in install/uninstall contexts */
|
|
7
|
+
export interface AppInfoWithHandles extends AppInfo {
|
|
8
|
+
handle: string;
|
|
9
|
+
versionHandle: string;
|
|
10
|
+
}
|
|
6
11
|
/** Workplace info - present in runtime contexts */
|
|
7
12
|
export interface WorkplaceInfo {
|
|
8
13
|
id: string;
|
package/dist/types/tool.d.ts
CHANGED
|
@@ -91,10 +91,8 @@ export interface ToolMetadata {
|
|
|
91
91
|
/** Maximum retry attempts. Defaults to 1 (no retries) if not specified. */
|
|
92
92
|
retries?: number;
|
|
93
93
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
effect?: ToolEffect;
|
|
100
|
-
}
|
|
94
|
+
/**
|
|
95
|
+
* Response from a tool call.
|
|
96
|
+
* Alias for ToolExecutionResult<unknown> for backwards compatibility.
|
|
97
|
+
*/
|
|
98
|
+
export type ToolCallResponse = ToolExecutionResult<unknown>;
|
package/dist/types/webhook.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { ContextLogger } from '../server/logger';
|
|
|
6
6
|
* This is the wire format used by both webhooks and OAuth callbacks.
|
|
7
7
|
* It gets converted to the rich WebhookRequest type at parse time.
|
|
8
8
|
*/
|
|
9
|
-
export interface
|
|
9
|
+
export interface WebhookWireRequest {
|
|
10
10
|
method: string;
|
|
11
11
|
url: string;
|
|
12
12
|
path: string;
|
|
@@ -14,6 +14,10 @@ export interface HandlerRawRequest {
|
|
|
14
14
|
query: Record<string, string>;
|
|
15
15
|
body: string;
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated Use WebhookWireRequest instead.
|
|
19
|
+
*/
|
|
20
|
+
export type HandlerRawRequest = WebhookWireRequest;
|
|
17
21
|
/** Raw HTTP request received by webhooks */
|
|
18
22
|
export interface WebhookRequest {
|
|
19
23
|
method: string;
|
|
@@ -87,21 +91,25 @@ export interface WebhookLifecycleResult {
|
|
|
87
91
|
*/
|
|
88
92
|
export type WebhookLifecycleHook<TContext = WebhookLifecycleContext> = (context: TContext) => Promise<WebhookLifecycleResult | null | undefined> | WebhookLifecycleResult | null | undefined;
|
|
89
93
|
/**
|
|
90
|
-
* Webhook invocation
|
|
94
|
+
* Webhook invocation mode - determines how responses are handled.
|
|
91
95
|
* - WEBHOOK: Fire-and-forget. Returns 200 immediately, processes asynchronously.
|
|
92
96
|
* - CALLBACK: Waits for handler response and returns it to the caller (e.g., Twilio TwiML).
|
|
93
97
|
*/
|
|
94
|
-
export type
|
|
98
|
+
export type WebhookInvocationMode = 'WEBHOOK' | 'CALLBACK';
|
|
99
|
+
/**
|
|
100
|
+
* @deprecated Use WebhookInvocationMode instead.
|
|
101
|
+
*/
|
|
102
|
+
export type WebhookType = WebhookInvocationMode;
|
|
95
103
|
export interface WebhookDefinition {
|
|
96
104
|
name: string;
|
|
97
105
|
description: string;
|
|
98
106
|
/** HTTP methods this webhook accepts. Defaults to ['POST'] */
|
|
99
107
|
methods?: ('GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH')[];
|
|
100
108
|
/**
|
|
101
|
-
* Invocation
|
|
109
|
+
* Invocation mode. Defaults to 'WEBHOOK' (fire-and-forget).
|
|
102
110
|
* Use 'CALLBACK' when the caller expects the handler's response (e.g., Twilio TwiML).
|
|
103
111
|
*/
|
|
104
|
-
type?:
|
|
112
|
+
type?: WebhookInvocationMode;
|
|
105
113
|
handler: WebhookHandler;
|
|
106
114
|
onAppInstalled?: WebhookLifecycleHook;
|
|
107
115
|
onAppUninstalled?: WebhookLifecycleHook;
|
|
@@ -117,6 +125,6 @@ export interface WebhookMetadata {
|
|
|
117
125
|
name: string;
|
|
118
126
|
description: string;
|
|
119
127
|
methods: string[];
|
|
120
|
-
type:
|
|
128
|
+
type: WebhookInvocationMode;
|
|
121
129
|
}
|
|
122
130
|
export {};
|
package/package.json
CHANGED
package/dist/config/resolve.d.ts
DELETED
|
@@ -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;
|