skedyul 0.1.47 → 0.1.48

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
- 1768787444775
1
+ 1768788925890
package/dist/server.js CHANGED
@@ -310,43 +310,35 @@ function createCallToolHandler(registry, state, onMaxRequests) {
310
310
  const originalEnv = { ...process.env };
311
311
  Object.assign(process.env, requestEnv);
312
312
  try {
313
- const rawInputs = (args.inputs ?? {});
314
- // Extract context from inputs if present (for field_change/page_action triggers)
315
- const inputContext = rawInputs.context;
316
- // Create clean inputs without the nested context
317
- const cleanInputs = { ...rawInputs };
318
- if (inputContext) {
319
- delete cleanInputs.context;
320
- }
321
- // Determine trigger type from input context
313
+ // Get tool inputs (clean, no context)
314
+ const inputs = (args.inputs ?? {});
315
+ // Get context from args.context (separate from inputs)
316
+ const rawContext = (args.context ?? {});
317
+ // Determine trigger type from context
322
318
  let trigger = 'agent';
323
- if (inputContext?.fieldHandle) {
319
+ if (rawContext.field) {
324
320
  trigger = 'field_change';
325
321
  }
326
- else if (inputContext?.fieldValues) {
322
+ else if (rawContext.fieldValues) {
327
323
  trigger = 'page_action';
328
324
  }
329
- else if (inputContext?.trigger) {
330
- trigger = inputContext.trigger;
325
+ else if (rawContext.trigger) {
326
+ trigger = rawContext.trigger;
331
327
  }
328
+ // Extract field info if present
329
+ const field = rawContext.field;
332
330
  // Build standardized execution context
333
331
  const executionContext = {
334
332
  trigger,
335
- appInstallationId: inputContext?.appInstallationId,
336
- workplace: inputContext?.workplace,
337
- field: inputContext?.fieldHandle
338
- ? {
339
- handle: inputContext.fieldHandle,
340
- type: inputContext.fieldType,
341
- pageHandle: inputContext.pageHandle,
342
- }
343
- : undefined,
344
- fieldValues: inputContext?.fieldValues,
333
+ appInstallationId: rawContext.appInstallationId,
334
+ workplace: rawContext.workplace,
335
+ field,
336
+ fieldValues: rawContext.fieldValues,
345
337
  env: process.env,
346
338
  mode: estimateMode ? 'estimate' : 'execute',
347
339
  };
348
340
  // Call handler with two arguments: (input, context)
349
- const functionResult = await fn(cleanInputs, executionContext);
341
+ const functionResult = await fn(inputs, executionContext);
350
342
  const billing = normalizeBilling(functionResult.billing);
351
343
  return {
352
344
  output: functionResult.output,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skedyul",
3
- "version": "0.1.47",
3
+ "version": "0.1.48",
4
4
  "description": "The Skedyul SDK for Node.js",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",