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 +1 -1
- package/dist/server.js +16 -24
- package/package.json +1 -1
package/dist/.build-stamp
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
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 (
|
|
319
|
+
if (rawContext.field) {
|
|
324
320
|
trigger = 'field_change';
|
|
325
321
|
}
|
|
326
|
-
else if (
|
|
322
|
+
else if (rawContext.fieldValues) {
|
|
327
323
|
trigger = 'page_action';
|
|
328
324
|
}
|
|
329
|
-
else if (
|
|
330
|
-
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:
|
|
336
|
-
workplace:
|
|
337
|
-
field
|
|
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(
|
|
341
|
+
const functionResult = await fn(inputs, executionContext);
|
|
350
342
|
const billing = normalizeBilling(functionResult.billing);
|
|
351
343
|
return {
|
|
352
344
|
output: functionResult.output,
|