skedyul 0.2.72 → 0.2.74

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
- 1769638803329
1
+ 1769641857995
package/dist/config.d.ts CHANGED
@@ -447,6 +447,8 @@ export interface FormV2PropsDefinition {
447
447
  id?: string;
448
448
  fields: FormV2ComponentDefinition[];
449
449
  layout: FormLayoutConfigDefinition;
450
+ /** Optional actions that trigger MCP tool calls */
451
+ actions?: PageActionDefinition[];
450
452
  }
451
453
  /** Card block header definition */
452
454
  export interface CardBlockHeader {
package/dist/schemas.d.ts CHANGED
@@ -1357,6 +1357,19 @@ export declare const FormV2PropsDefinitionSchema: z.ZodObject<{
1357
1357
  }, z.core.$strip>>;
1358
1358
  }, z.core.$strip>>;
1359
1359
  }, z.core.$strip>;
1360
+ actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
1361
+ handle: z.ZodString;
1362
+ label: z.ZodString;
1363
+ handler: z.ZodString;
1364
+ icon: z.ZodOptional<z.ZodString>;
1365
+ variant: z.ZodOptional<z.ZodEnum<{
1366
+ primary: "primary";
1367
+ secondary: "secondary";
1368
+ destructive: "destructive";
1369
+ }>>;
1370
+ isDisabled: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
1371
+ isHidden: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
1372
+ }, z.core.$strip>>>;
1360
1373
  }, z.core.$strip>;
1361
1374
  /** Card block header definition */
1362
1375
  export declare const CardBlockHeaderSchema: z.ZodObject<{
@@ -1659,6 +1672,19 @@ export declare const CardBlockDefinitionSchema: z.ZodObject<{
1659
1672
  }, z.core.$strip>>;
1660
1673
  }, z.core.$strip>>;
1661
1674
  }, z.core.$strip>;
1675
+ actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
1676
+ handle: z.ZodString;
1677
+ label: z.ZodString;
1678
+ handler: z.ZodString;
1679
+ icon: z.ZodOptional<z.ZodString>;
1680
+ variant: z.ZodOptional<z.ZodEnum<{
1681
+ primary: "primary";
1682
+ secondary: "secondary";
1683
+ destructive: "destructive";
1684
+ }>>;
1685
+ isDisabled: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
1686
+ isHidden: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
1687
+ }, z.core.$strip>>>;
1662
1688
  }, z.core.$strip>;
1663
1689
  actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
1664
1690
  handle: z.ZodString;
@@ -2054,6 +2080,19 @@ export declare const PageBlockDefinitionSchema: z.ZodUnion<readonly [z.ZodObject
2054
2080
  }, z.core.$strip>>;
2055
2081
  }, z.core.$strip>>;
2056
2082
  }, z.core.$strip>;
2083
+ actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
2084
+ handle: z.ZodString;
2085
+ label: z.ZodString;
2086
+ handler: z.ZodString;
2087
+ icon: z.ZodOptional<z.ZodString>;
2088
+ variant: z.ZodOptional<z.ZodEnum<{
2089
+ primary: "primary";
2090
+ secondary: "secondary";
2091
+ destructive: "destructive";
2092
+ }>>;
2093
+ isDisabled: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
2094
+ isHidden: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
2095
+ }, z.core.$strip>>>;
2057
2096
  }, z.core.$strip>;
2058
2097
  actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
2059
2098
  handle: z.ZodString;
@@ -2530,6 +2569,19 @@ export declare const PageDefinitionSchema: z.ZodObject<{
2530
2569
  }, z.core.$strip>>;
2531
2570
  }, z.core.$strip>>;
2532
2571
  }, z.core.$strip>;
2572
+ actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
2573
+ handle: z.ZodString;
2574
+ label: z.ZodString;
2575
+ handler: z.ZodString;
2576
+ icon: z.ZodOptional<z.ZodString>;
2577
+ variant: z.ZodOptional<z.ZodEnum<{
2578
+ primary: "primary";
2579
+ secondary: "secondary";
2580
+ destructive: "destructive";
2581
+ }>>;
2582
+ isDisabled: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
2583
+ isHidden: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
2584
+ }, z.core.$strip>>>;
2533
2585
  }, z.core.$strip>;
2534
2586
  actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
2535
2587
  handle: z.ZodString;
@@ -3153,6 +3205,19 @@ export declare const ProvisionConfigSchema: z.ZodObject<{
3153
3205
  }, z.core.$strip>>;
3154
3206
  }, z.core.$strip>>;
3155
3207
  }, z.core.$strip>;
3208
+ actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
3209
+ handle: z.ZodString;
3210
+ label: z.ZodString;
3211
+ handler: z.ZodString;
3212
+ icon: z.ZodOptional<z.ZodString>;
3213
+ variant: z.ZodOptional<z.ZodEnum<{
3214
+ primary: "primary";
3215
+ secondary: "secondary";
3216
+ destructive: "destructive";
3217
+ }>>;
3218
+ isDisabled: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
3219
+ isHidden: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
3220
+ }, z.core.$strip>>>;
3156
3221
  }, z.core.$strip>;
3157
3222
  actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
3158
3223
  handle: z.ZodString;
@@ -3759,6 +3824,19 @@ export declare const SkedyulConfigSchema: z.ZodObject<{
3759
3824
  }, z.core.$strip>>;
3760
3825
  }, z.core.$strip>>;
3761
3826
  }, z.core.$strip>;
3827
+ actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
3828
+ handle: z.ZodString;
3829
+ label: z.ZodString;
3830
+ handler: z.ZodString;
3831
+ icon: z.ZodOptional<z.ZodString>;
3832
+ variant: z.ZodOptional<z.ZodEnum<{
3833
+ primary: "primary";
3834
+ secondary: "secondary";
3835
+ destructive: "destructive";
3836
+ }>>;
3837
+ isDisabled: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
3838
+ isHidden: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
3839
+ }, z.core.$strip>>>;
3762
3840
  }, z.core.$strip>;
3763
3841
  actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
3764
3842
  handle: z.ZodString;
package/dist/schemas.js CHANGED
@@ -462,6 +462,8 @@ exports.FormV2PropsDefinitionSchema = zod_1.z.object({
462
462
  id: zod_1.z.string().optional(),
463
463
  fields: zod_1.z.array(exports.FormV2ComponentDefinitionSchema),
464
464
  layout: exports.FormLayoutConfigDefinitionSchema,
465
+ /** Optional actions that trigger MCP tool calls */
466
+ actions: zod_1.z.array(exports.PageActionDefinitionSchema).optional(),
465
467
  });
466
468
  /** Card block header definition */
467
469
  exports.CardBlockHeaderSchema = zod_1.z.object({
package/dist/server.js CHANGED
@@ -742,10 +742,18 @@ function createDedicatedServerInstance(config, tools, callTool, state, mcpServer
742
742
  // (same pattern as tool handler)
743
743
  const originalEnv = { ...process.env };
744
744
  Object.assign(process.env, requestEnv);
745
- // Invoke the handler
745
+ // Build request-scoped config for the skedyul client
746
+ // This uses AsyncLocalStorage to override the global config (same pattern as tools)
747
+ const requestConfig = {
748
+ baseUrl: requestEnv.SKEDYUL_API_URL ?? process.env.SKEDYUL_API_URL ?? '',
749
+ apiToken: requestEnv.SKEDYUL_API_TOKEN ?? process.env.SKEDYUL_API_TOKEN ?? '',
750
+ };
751
+ // Invoke the handler with request-scoped config
746
752
  let webhookResponse;
747
753
  try {
748
- webhookResponse = await webhookDef.handler(webhookRequest, webhookContext);
754
+ webhookResponse = await (0, client_1.runWithConfig)(requestConfig, async () => {
755
+ return await webhookDef.handler(webhookRequest, webhookContext);
756
+ });
749
757
  }
750
758
  catch (err) {
751
759
  console.error(`Webhook handler '${handle}' error:`, err);
@@ -1071,10 +1079,18 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
1071
1079
  // (same pattern as tool handler)
1072
1080
  const originalEnv = { ...process.env };
1073
1081
  Object.assign(process.env, requestEnv);
1074
- // Invoke the handler
1082
+ // Build request-scoped config for the skedyul client
1083
+ // This uses AsyncLocalStorage to override the global config (same pattern as tools)
1084
+ const requestConfig = {
1085
+ baseUrl: requestEnv.SKEDYUL_API_URL ?? process.env.SKEDYUL_API_URL ?? '',
1086
+ apiToken: requestEnv.SKEDYUL_API_TOKEN ?? process.env.SKEDYUL_API_TOKEN ?? '',
1087
+ };
1088
+ // Invoke the handler with request-scoped config
1075
1089
  let webhookResponse;
1076
1090
  try {
1077
- webhookResponse = await webhookDef.handler(webhookRequest, webhookContext);
1091
+ webhookResponse = await (0, client_1.runWithConfig)(requestConfig, async () => {
1092
+ return await webhookDef.handler(webhookRequest, webhookContext);
1093
+ });
1078
1094
  }
1079
1095
  catch (err) {
1080
1096
  console.error(`Webhook handler '${handle}' error:`, err);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skedyul",
3
- "version": "0.2.72",
3
+ "version": "0.2.74",
4
4
  "description": "The Skedyul SDK for Node.js",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",