skedyul 0.3.13 → 0.3.15

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 CHANGED
@@ -1 +1 @@
1
- 1771646139683
1
+ 1771726722708
@@ -424,17 +424,27 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
424
424
  }
425
425
  // Handle /provision endpoint for provision handlers
426
426
  if (path === '/provision' && method === 'POST') {
427
+ console.log('[serverless] /provision endpoint called');
427
428
  if (!config.hooks?.provision) {
429
+ console.log('[serverless] No provision handler configured');
428
430
  return (0, utils_1.createResponse)(404, { error: 'Provision handler not configured' }, headers);
429
431
  }
430
432
  let provisionBody;
431
433
  try {
432
434
  provisionBody = event.body ? JSON.parse(event.body) : {};
435
+ console.log('[serverless] Provision body parsed:', {
436
+ hasEnv: !!provisionBody.env,
437
+ hasContext: !!provisionBody.context,
438
+ appId: provisionBody.context?.app?.id,
439
+ versionId: provisionBody.context?.app?.versionId,
440
+ });
433
441
  }
434
442
  catch {
443
+ console.log('[serverless] Failed to parse provision body');
435
444
  return (0, utils_1.createResponse)(400, { error: { code: -32700, message: 'Parse error' } }, headers);
436
445
  }
437
446
  if (!provisionBody.context?.app) {
447
+ console.log('[serverless] Missing app context in provision body');
438
448
  return (0, utils_1.createResponse)(400, { error: { code: -32602, message: 'Missing context (app required)' } }, headers);
439
449
  }
440
450
  // SECURITY: Merge process.env (baked-in secrets) with request env (API token).
@@ -459,6 +469,7 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
459
469
  baseUrl: mergedEnv.SKEDYUL_API_URL ?? '',
460
470
  apiToken: mergedEnv.SKEDYUL_API_TOKEN ?? '',
461
471
  };
472
+ console.log('[serverless] Calling provision handler...');
462
473
  try {
463
474
  const provisionHook = config.hooks.provision;
464
475
  const provisionHandler = typeof provisionHook === 'function'
@@ -469,9 +480,11 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
469
480
  return await provisionHandler(provisionContext);
470
481
  });
471
482
  });
483
+ console.log('[serverless] Provision handler completed successfully');
472
484
  return (0, utils_1.createResponse)(200, result, headers);
473
485
  }
474
486
  catch (err) {
487
+ console.error('[serverless] Provision handler failed:', err instanceof Error ? err.message : String(err));
475
488
  return (0, utils_1.createResponse)(500, {
476
489
  error: {
477
490
  code: -32603,
@@ -572,13 +585,14 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
572
585
  else if (rpcMethod === 'tools/call') {
573
586
  const toolName = params?.name;
574
587
  // Support both formats:
575
- // 1. Skedyul format: { inputs: {...}, context: {...}, env: {...} }
588
+ // 1. Skedyul format: { inputs: {...}, context: {...}, env: {...}, invocation: {...} }
576
589
  // 2. Standard MCP format: { ...directArgs }
577
590
  const rawArgs = (params?.arguments ?? {});
578
- const hasSkedyulFormat = 'inputs' in rawArgs || 'env' in rawArgs || 'context' in rawArgs;
591
+ const hasSkedyulFormat = 'inputs' in rawArgs || 'env' in rawArgs || 'context' in rawArgs || 'invocation' in rawArgs;
579
592
  const toolInputs = hasSkedyulFormat ? (rawArgs.inputs ?? {}) : rawArgs;
580
593
  const toolContext = hasSkedyulFormat ? rawArgs.context : undefined;
581
594
  const toolEnv = hasSkedyulFormat ? rawArgs.env : undefined;
595
+ const toolInvocation = hasSkedyulFormat ? rawArgs.invocation : undefined;
582
596
  // Find tool by name (check both registry key and tool.name)
583
597
  let toolKey = null;
584
598
  let tool = null;
@@ -610,6 +624,7 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
610
624
  inputs: validatedInputs,
611
625
  context: toolContext,
612
626
  env: toolEnv,
627
+ invocation: toolInvocation,
613
628
  });
614
629
  // Transform internal format to MCP protocol format
615
630
  // Note: effect is embedded in structuredContent as __effect
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skedyul",
3
- "version": "0.3.13",
3
+ "version": "0.3.15",
4
4
  "description": "The Skedyul SDK for Node.js",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",