skedyul 0.1.49 ā 0.1.53
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 +29 -1
- package/package.json +1 -1
package/dist/.build-stamp
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1768796516934
|
package/dist/server.js
CHANGED
|
@@ -314,6 +314,11 @@ function createCallToolHandler(registry, state, onMaxRequests) {
|
|
|
314
314
|
const inputs = (args.inputs ?? {});
|
|
315
315
|
// Get context from args.context (separate from inputs)
|
|
316
316
|
const rawContext = (args.context ?? {});
|
|
317
|
+
// Debug logging for tool handler
|
|
318
|
+
console.log('\nš§ callTool processing:');
|
|
319
|
+
console.log(' Full args received:', JSON.stringify(args, null, 2));
|
|
320
|
+
console.log(' args.context:', JSON.stringify(args.context, null, 2));
|
|
321
|
+
console.log(' rawContext:', JSON.stringify(rawContext, null, 2));
|
|
317
322
|
// Determine trigger type from context
|
|
318
323
|
let trigger = 'agent';
|
|
319
324
|
if (rawContext.field) {
|
|
@@ -337,6 +342,14 @@ function createCallToolHandler(registry, state, onMaxRequests) {
|
|
|
337
342
|
env: process.env,
|
|
338
343
|
mode: estimateMode ? 'estimate' : 'execute',
|
|
339
344
|
};
|
|
345
|
+
console.log(' Built executionContext:', JSON.stringify({
|
|
346
|
+
trigger: executionContext.trigger,
|
|
347
|
+
appInstallationId: executionContext.appInstallationId,
|
|
348
|
+
workplace: executionContext.workplace,
|
|
349
|
+
field: executionContext.field,
|
|
350
|
+
fieldValues: executionContext.fieldValues,
|
|
351
|
+
mode: executionContext.mode,
|
|
352
|
+
}, null, 2));
|
|
340
353
|
// Call handler with two arguments: (input, context)
|
|
341
354
|
const functionResult = await fn(inputs, executionContext);
|
|
342
355
|
const billing = normalizeBilling(functionResult.billing);
|
|
@@ -554,13 +567,20 @@ function createSkedyulServer(config, registry, webhookRegistry) {
|
|
|
554
567
|
inputSchema: wrappedInputSchema,
|
|
555
568
|
outputSchema: outputZodSchema,
|
|
556
569
|
}, async (args) => {
|
|
557
|
-
// Args are in Skedyul format: { inputs: {...}, env: {...} }
|
|
570
|
+
// Args are in Skedyul format: { inputs: {...}, context: {...}, env: {...} }
|
|
558
571
|
const rawArgs = args;
|
|
559
572
|
const toolInputs = (rawArgs.inputs ?? {});
|
|
573
|
+
const toolContext = rawArgs.context;
|
|
560
574
|
const toolEnv = rawArgs.env;
|
|
575
|
+
// Debug logging for MCP SDK tool calls
|
|
576
|
+
console.log('\nš MCP SDK registerTool handler:');
|
|
577
|
+
console.log(' Tool:', toolName);
|
|
578
|
+
console.log(' Raw args:', JSON.stringify(rawArgs, null, 2));
|
|
579
|
+
console.log(' Extracted context:', JSON.stringify(toolContext, null, 2));
|
|
561
580
|
const validatedInputs = inputZodSchema ? inputZodSchema.parse(toolInputs) : toolInputs;
|
|
562
581
|
const result = await callTool(toolKey, {
|
|
563
582
|
inputs: validatedInputs,
|
|
583
|
+
context: toolContext,
|
|
564
584
|
env: toolEnv,
|
|
565
585
|
});
|
|
566
586
|
// Handle error case
|
|
@@ -1103,6 +1123,14 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
|
|
|
1103
1123
|
const toolInputs = hasSkedyulFormat ? (rawArgs.inputs ?? {}) : rawArgs;
|
|
1104
1124
|
const toolContext = hasSkedyulFormat ? rawArgs.context : undefined;
|
|
1105
1125
|
const toolEnv = hasSkedyulFormat ? rawArgs.env : undefined;
|
|
1126
|
+
// Debug logging for MCP tool calls
|
|
1127
|
+
console.log('\nš MCP tools/call received:');
|
|
1128
|
+
console.log(' Tool:', toolName);
|
|
1129
|
+
console.log(' Raw arguments:', JSON.stringify(rawArgs, null, 2));
|
|
1130
|
+
console.log(' Skedyul format detected:', hasSkedyulFormat);
|
|
1131
|
+
console.log(' Extracted inputs:', JSON.stringify(toolInputs, null, 2));
|
|
1132
|
+
console.log(' Extracted context:', JSON.stringify(toolContext, null, 2));
|
|
1133
|
+
console.log(' Extracted env keys:', toolEnv ? Object.keys(toolEnv) : 'none');
|
|
1106
1134
|
// Find tool by name (check both registry key and tool.name)
|
|
1107
1135
|
let toolKey = null;
|
|
1108
1136
|
let tool = null;
|