skedyul 1.2.40 → 1.2.43

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.
Files changed (51) hide show
  1. package/dist/cli/commands/agents.d.ts +1 -0
  2. package/dist/cli/commands/chat.d.ts +1 -0
  3. package/dist/cli/commands/crm.d.ts +1 -0
  4. package/dist/cli/commands/skills.d.ts +1 -0
  5. package/dist/cli/index.js +17636 -6197
  6. package/dist/cli/utils/auth.js +495 -0
  7. package/dist/cli/utils/mock-context.d.ts +22 -0
  8. package/dist/cli/utils/sse.d.ts +100 -0
  9. package/dist/compiler/compiler.d.ts +12 -0
  10. package/dist/compiler/index.d.ts +2 -0
  11. package/dist/compiler/types.d.ts +173 -0
  12. package/dist/config/index.d.ts +1 -0
  13. package/dist/config/schema-loader.d.ts +156 -0
  14. package/dist/config/types/model.d.ts +28 -0
  15. package/dist/context/index.d.ts +2 -0
  16. package/dist/context/resolver.d.ts +51 -0
  17. package/dist/context/types.d.ts +217 -0
  18. package/dist/dedicated/server.js +60 -15
  19. package/dist/esm/index.mjs +9815 -458
  20. package/dist/events/index.d.ts +1 -0
  21. package/dist/events/types.d.ts +528 -0
  22. package/dist/index.d.ts +16 -0
  23. package/dist/index.js +9912 -458
  24. package/dist/memory/index.d.ts +4 -0
  25. package/dist/memory/service.d.ts +78 -0
  26. package/dist/memory/types.d.ts +169 -0
  27. package/dist/schemas/agent-schema-v3.d.ts +437 -0
  28. package/dist/schemas/agent-schema-v3.js +539 -0
  29. package/dist/schemas/agent-schema-v3.mjs +497 -0
  30. package/dist/schemas/agent-schema.d.ts +1504 -0
  31. package/dist/schemas/agent-schema.js +7896 -0
  32. package/dist/schemas/agent-schema.mjs +7867 -0
  33. package/dist/schemas/crm-schema.d.ts +448 -0
  34. package/dist/schemas/index.d.ts +2 -0
  35. package/dist/schemas.d.ts +69 -36
  36. package/dist/server.js +60 -15
  37. package/dist/serverless/server.mjs +60 -15
  38. package/dist/skills/index.d.ts +1 -0
  39. package/dist/skills/types.d.ts +355 -0
  40. package/dist/skills/types.js +281 -0
  41. package/dist/skills/types.mjs +234 -0
  42. package/dist/triggers/index.d.ts +2 -0
  43. package/dist/triggers/resolver.d.ts +31 -0
  44. package/dist/triggers/types.d.ts +313 -0
  45. package/dist/types/data-blocks.d.ts +105 -0
  46. package/dist/types/index.d.ts +3 -1
  47. package/dist/types/tool-response.d.ts +202 -0
  48. package/dist/types/tool.d.ts +157 -28
  49. package/dist/workflows/index.d.ts +1 -0
  50. package/dist/workflows/types.d.ts +295 -0
  51. package/package.json +19 -1
package/dist/schemas.d.ts CHANGED
@@ -34,19 +34,19 @@ export declare const FieldOwnerSchema: z.ZodEnum<{
34
34
  SHARED: "SHARED";
35
35
  }>;
36
36
  export declare const FilterOperatorSchema: z.ZodEnum<{
37
+ in: "in";
38
+ endsWith: "endsWith";
39
+ startsWith: "startsWith";
37
40
  eq: "eq";
38
41
  neq: "neq";
39
42
  gt: "gt";
40
43
  gte: "gte";
41
44
  lt: "lt";
42
45
  lte: "lte";
43
- in: "in";
44
46
  contains: "contains";
45
47
  notContains: "notContains";
46
48
  not_contains: "not_contains";
47
- startsWith: "startsWith";
48
49
  starts_with: "starts_with";
49
- endsWith: "endsWith";
50
50
  ends_with: "ends_with";
51
51
  isEmpty: "isEmpty";
52
52
  isNotEmpty: "isNotEmpty";
@@ -182,9 +182,9 @@ export declare const AppFieldVisibilitySchema: z.ZodObject<{
182
182
  filters: z.ZodOptional<z.ZodBoolean>;
183
183
  }, z.core.$strip>;
184
184
  export declare const FieldRequirementTypeSchema: z.ZodEnum<{
185
- required: "required";
186
185
  optional: "optional";
187
186
  on_create: "on_create";
187
+ required: "required";
188
188
  }>;
189
189
  export declare const ModelFieldDefinitionSchema: z.ZodObject<{
190
190
  handle: z.ZodString;
@@ -217,9 +217,9 @@ export declare const ModelFieldDefinitionSchema: z.ZodObject<{
217
217
  pattern: z.ZodOptional<z.ZodString>;
218
218
  }, z.core.$strip>, z.ZodString]>>;
219
219
  requirement: z.ZodOptional<z.ZodEnum<{
220
- required: "required";
221
220
  optional: "optional";
222
221
  on_create: "on_create";
222
+ required: "required";
223
223
  }>>;
224
224
  required: z.ZodOptional<z.ZodBoolean>;
225
225
  unique: z.ZodOptional<z.ZodBoolean>;
@@ -276,9 +276,9 @@ export declare const ModelDefinitionSchema: z.ZodObject<{
276
276
  pattern: z.ZodOptional<z.ZodString>;
277
277
  }, z.core.$strip>, z.ZodString]>>;
278
278
  requirement: z.ZodOptional<z.ZodEnum<{
279
- required: "required";
280
279
  optional: "optional";
281
280
  on_create: "on_create";
281
+ required: "required";
282
282
  }>>;
283
283
  required: z.ZodOptional<z.ZodBoolean>;
284
284
  unique: z.ZodOptional<z.ZodBoolean>;
@@ -364,8 +364,8 @@ export declare const RelationshipDefinitionSchema: z.ZodObject<{
364
364
  }, z.core.$strip>;
365
365
  /** Standard capability types for communication channels */
366
366
  export declare const ChannelCapabilityTypeSchema: z.ZodEnum<{
367
- messaging: "messaging";
368
367
  voice: "voice";
368
+ messaging: "messaging";
369
369
  video: "video";
370
370
  }>;
371
371
  /** Capability definition with display info and handler references */
@@ -545,12 +545,12 @@ export declare const PageTypeSchema: z.ZodEnum<{
545
545
  }>;
546
546
  export declare const PageBlockTypeSchema: z.ZodEnum<{
547
547
  list: "list";
548
- form: "form";
549
548
  spreadsheet: "spreadsheet";
549
+ form: "form";
550
+ card: "card";
550
551
  kanban: "kanban";
551
- calendar: "calendar";
552
552
  link: "link";
553
- card: "card";
553
+ calendar: "calendar";
554
554
  }>;
555
555
  export declare const PageFieldTypeSchema: z.ZodEnum<{
556
556
  STRING: "STRING";
@@ -658,9 +658,9 @@ export declare const InputComponentDefinitionSchema: z.ZodObject<{
658
658
  helpText: z.ZodOptional<z.ZodString>;
659
659
  type: z.ZodOptional<z.ZodEnum<{
660
660
  number: "number";
661
+ email: "email";
661
662
  hidden: "hidden";
662
663
  text: "text";
663
- email: "email";
664
664
  password: "password";
665
665
  tel: "tel";
666
666
  url: "url";
@@ -981,9 +981,9 @@ export declare const FormV2ComponentDefinitionSchema: z.ZodDiscriminatedUnion<[z
981
981
  helpText: z.ZodOptional<z.ZodString>;
982
982
  type: z.ZodOptional<z.ZodEnum<{
983
983
  number: "number";
984
+ email: "email";
984
985
  hidden: "hidden";
985
986
  text: "text";
986
- email: "email";
987
987
  password: "password";
988
988
  tel: "tel";
989
989
  url: "url";
@@ -1263,9 +1263,9 @@ export declare const FormV2PropsDefinitionSchema: z.ZodObject<{
1263
1263
  helpText: z.ZodOptional<z.ZodString>;
1264
1264
  type: z.ZodOptional<z.ZodEnum<{
1265
1265
  number: "number";
1266
+ email: "email";
1266
1267
  hidden: "hidden";
1267
1268
  text: "text";
1268
- email: "email";
1269
1269
  password: "password";
1270
1270
  tel: "tel";
1271
1271
  url: "url";
@@ -1584,9 +1584,9 @@ export declare const CardBlockDefinitionSchema: z.ZodObject<{
1584
1584
  helpText: z.ZodOptional<z.ZodString>;
1585
1585
  type: z.ZodOptional<z.ZodEnum<{
1586
1586
  number: "number";
1587
+ email: "email";
1587
1588
  hidden: "hidden";
1588
1589
  text: "text";
1589
- email: "email";
1590
1590
  password: "password";
1591
1591
  tel: "tel";
1592
1592
  url: "url";
@@ -1953,11 +1953,11 @@ export declare const PageFieldDefinitionSchema: z.ZodType<PageFieldDefinition>;
1953
1953
  /** Legacy form block definition */
1954
1954
  export declare const LegacyFormBlockDefinitionSchema: z.ZodObject<{
1955
1955
  type: z.ZodEnum<{
1956
- form: "form";
1957
1956
  spreadsheet: "spreadsheet";
1957
+ form: "form";
1958
1958
  kanban: "kanban";
1959
- calendar: "calendar";
1960
1959
  link: "link";
1960
+ calendar: "calendar";
1961
1961
  }>;
1962
1962
  title: z.ZodOptional<z.ZodString>;
1963
1963
  fields: z.ZodOptional<z.ZodArray<z.ZodType<PageFieldDefinition, unknown, z.core.$ZodTypeInternals<PageFieldDefinition, unknown>>>>;
@@ -2003,9 +2003,9 @@ export declare const PageBlockDefinitionSchema: z.ZodUnion<readonly [z.ZodObject
2003
2003
  helpText: z.ZodOptional<z.ZodString>;
2004
2004
  type: z.ZodOptional<z.ZodEnum<{
2005
2005
  number: "number";
2006
+ email: "email";
2006
2007
  hidden: "hidden";
2007
2008
  text: "text";
2008
- email: "email";
2009
2009
  password: "password";
2010
2010
  tel: "tel";
2011
2011
  url: "url";
@@ -2334,11 +2334,11 @@ export declare const PageBlockDefinitionSchema: z.ZodUnion<readonly [z.ZodObject
2334
2334
  }, z.core.$strip>>>;
2335
2335
  }, z.core.$strip>, z.ZodObject<{
2336
2336
  type: z.ZodEnum<{
2337
- form: "form";
2338
2337
  spreadsheet: "spreadsheet";
2338
+ form: "form";
2339
2339
  kanban: "kanban";
2340
- calendar: "calendar";
2341
2340
  link: "link";
2341
+ calendar: "calendar";
2342
2342
  }>;
2343
2343
  title: z.ZodOptional<z.ZodString>;
2344
2344
  fields: z.ZodOptional<z.ZodArray<z.ZodType<PageFieldDefinition, unknown, z.core.$ZodTypeInternals<PageFieldDefinition, unknown>>>>;
@@ -2507,9 +2507,9 @@ export declare const PageDefinitionSchema: z.ZodObject<{
2507
2507
  helpText: z.ZodOptional<z.ZodString>;
2508
2508
  type: z.ZodOptional<z.ZodEnum<{
2509
2509
  number: "number";
2510
+ email: "email";
2510
2511
  hidden: "hidden";
2511
2512
  text: "text";
2512
- email: "email";
2513
2513
  password: "password";
2514
2514
  tel: "tel";
2515
2515
  url: "url";
@@ -2838,11 +2838,11 @@ export declare const PageDefinitionSchema: z.ZodObject<{
2838
2838
  }, z.core.$strip>>>;
2839
2839
  }, z.core.$strip>, z.ZodObject<{
2840
2840
  type: z.ZodEnum<{
2841
- form: "form";
2842
2841
  spreadsheet: "spreadsheet";
2842
+ form: "form";
2843
2843
  kanban: "kanban";
2844
- calendar: "calendar";
2845
2844
  link: "link";
2845
+ calendar: "calendar";
2846
2846
  }>;
2847
2847
  title: z.ZodOptional<z.ZodString>;
2848
2848
  fields: z.ZodOptional<z.ZodArray<z.ZodType<PageFieldDefinition, unknown, z.core.$ZodTypeInternals<PageFieldDefinition, unknown>>>>;
@@ -2989,9 +2989,9 @@ export declare const InstallConfigSchema: z.ZodObject<{
2989
2989
  pattern: z.ZodOptional<z.ZodString>;
2990
2990
  }, z.core.$strip>, z.ZodString]>>;
2991
2991
  requirement: z.ZodOptional<z.ZodEnum<{
2992
- required: "required";
2993
2992
  optional: "optional";
2994
2993
  on_create: "on_create";
2994
+ required: "required";
2995
2995
  }>>;
2996
2996
  required: z.ZodOptional<z.ZodBoolean>;
2997
2997
  unique: z.ZodOptional<z.ZodBoolean>;
@@ -3111,9 +3111,9 @@ export declare const ProvisionConfigSchema: z.ZodObject<{
3111
3111
  pattern: z.ZodOptional<z.ZodString>;
3112
3112
  }, z.core.$strip>, z.ZodString]>>;
3113
3113
  requirement: z.ZodOptional<z.ZodEnum<{
3114
- required: "required";
3115
3114
  optional: "optional";
3116
3115
  on_create: "on_create";
3116
+ required: "required";
3117
3117
  }>>;
3118
3118
  required: z.ZodOptional<z.ZodBoolean>;
3119
3119
  unique: z.ZodOptional<z.ZodBoolean>;
@@ -3354,9 +3354,9 @@ export declare const ProvisionConfigSchema: z.ZodObject<{
3354
3354
  helpText: z.ZodOptional<z.ZodString>;
3355
3355
  type: z.ZodOptional<z.ZodEnum<{
3356
3356
  number: "number";
3357
+ email: "email";
3357
3358
  hidden: "hidden";
3358
3359
  text: "text";
3359
- email: "email";
3360
3360
  password: "password";
3361
3361
  tel: "tel";
3362
3362
  url: "url";
@@ -3685,11 +3685,11 @@ export declare const ProvisionConfigSchema: z.ZodObject<{
3685
3685
  }, z.core.$strip>>>;
3686
3686
  }, z.core.$strip>, z.ZodObject<{
3687
3687
  type: z.ZodEnum<{
3688
- form: "form";
3689
3688
  spreadsheet: "spreadsheet";
3689
+ form: "form";
3690
3690
  kanban: "kanban";
3691
- calendar: "calendar";
3692
3691
  link: "link";
3692
+ calendar: "calendar";
3693
3693
  }>;
3694
3694
  title: z.ZodOptional<z.ZodString>;
3695
3695
  fields: z.ZodOptional<z.ZodArray<z.ZodType<PageFieldDefinition, unknown, z.core.$ZodTypeInternals<PageFieldDefinition, unknown>>>>;
@@ -3796,9 +3796,9 @@ export declare const SkedyulConfigSchema: z.ZodObject<{
3796
3796
  pattern: z.ZodOptional<z.ZodString>;
3797
3797
  }, z.core.$strip>, z.ZodString]>>;
3798
3798
  requirement: z.ZodOptional<z.ZodEnum<{
3799
- required: "required";
3800
3799
  optional: "optional";
3801
3800
  on_create: "on_create";
3801
+ required: "required";
3802
3802
  }>>;
3803
3803
  required: z.ZodOptional<z.ZodBoolean>;
3804
3804
  unique: z.ZodOptional<z.ZodBoolean>;
@@ -4039,9 +4039,9 @@ export declare const SkedyulConfigSchema: z.ZodObject<{
4039
4039
  helpText: z.ZodOptional<z.ZodString>;
4040
4040
  type: z.ZodOptional<z.ZodEnum<{
4041
4041
  number: "number";
4042
+ email: "email";
4042
4043
  hidden: "hidden";
4043
4044
  text: "text";
4044
- email: "email";
4045
4045
  password: "password";
4046
4046
  tel: "tel";
4047
4047
  url: "url";
@@ -4370,11 +4370,11 @@ export declare const SkedyulConfigSchema: z.ZodObject<{
4370
4370
  }, z.core.$strip>>>;
4371
4371
  }, z.core.$strip>, z.ZodObject<{
4372
4372
  type: z.ZodEnum<{
4373
- form: "form";
4374
4373
  spreadsheet: "spreadsheet";
4374
+ form: "form";
4375
4375
  kanban: "kanban";
4376
- calendar: "calendar";
4377
4376
  link: "link";
4377
+ calendar: "calendar";
4378
4378
  }>;
4379
4379
  title: z.ZodOptional<z.ZodString>;
4380
4380
  fields: z.ZodOptional<z.ZodArray<z.ZodType<PageFieldDefinition, unknown, z.core.$ZodTypeInternals<PageFieldDefinition, unknown>>>>;
@@ -4504,11 +4504,29 @@ export declare const MessageSendContactSchema: z.ZodObject<{
4504
4504
  id: z.ZodString;
4505
4505
  name: z.ZodOptional<z.ZodString>;
4506
4506
  }, z.core.$strip>;
4507
+ export declare const MessageSendRecipientSchema: z.ZodObject<{
4508
+ address: z.ZodString;
4509
+ name: z.ZodOptional<z.ZodString>;
4510
+ participantId: z.ZodOptional<z.ZodString>;
4511
+ contactId: z.ZodOptional<z.ZodString>;
4512
+ }, z.core.$strip>;
4513
+ export declare const MessageSendAttachmentSchema: z.ZodObject<{
4514
+ filename: z.ZodString;
4515
+ url: z.ZodString;
4516
+ mimeType: z.ZodString;
4517
+ size: z.ZodNumber;
4518
+ }, z.core.$strip>;
4507
4519
  export declare const MessageSendMessageSchema: z.ZodObject<{
4508
4520
  id: z.ZodString;
4509
4521
  content: z.ZodString;
4510
4522
  contentRaw: z.ZodOptional<z.ZodString>;
4511
4523
  title: z.ZodOptional<z.ZodString>;
4524
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
4525
+ filename: z.ZodString;
4526
+ url: z.ZodString;
4527
+ mimeType: z.ZodString;
4528
+ size: z.ZodNumber;
4529
+ }, z.core.$strip>>>;
4512
4530
  }, z.core.$strip>;
4513
4531
  export declare const MessageSendInputSchema: z.ZodObject<{
4514
4532
  channel: z.ZodObject<{
@@ -4516,19 +4534,31 @@ export declare const MessageSendInputSchema: z.ZodObject<{
4516
4534
  handle: z.ZodString;
4517
4535
  identifierValue: z.ZodString;
4518
4536
  }, z.core.$strip>;
4519
- subscription: z.ZodObject<{
4537
+ subscription: z.ZodOptional<z.ZodObject<{
4520
4538
  id: z.ZodString;
4521
4539
  identifierValue: z.ZodString;
4522
- }, z.core.$strip>;
4523
- contact: z.ZodObject<{
4540
+ }, z.core.$strip>>;
4541
+ contact: z.ZodOptional<z.ZodObject<{
4524
4542
  id: z.ZodString;
4525
4543
  name: z.ZodOptional<z.ZodString>;
4526
- }, z.core.$strip>;
4544
+ }, z.core.$strip>>;
4545
+ recipient: z.ZodOptional<z.ZodObject<{
4546
+ address: z.ZodString;
4547
+ name: z.ZodOptional<z.ZodString>;
4548
+ participantId: z.ZodOptional<z.ZodString>;
4549
+ contactId: z.ZodOptional<z.ZodString>;
4550
+ }, z.core.$strip>>;
4527
4551
  message: z.ZodObject<{
4528
4552
  id: z.ZodString;
4529
4553
  content: z.ZodString;
4530
4554
  contentRaw: z.ZodOptional<z.ZodString>;
4531
4555
  title: z.ZodOptional<z.ZodString>;
4556
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
4557
+ filename: z.ZodString;
4558
+ url: z.ZodString;
4559
+ mimeType: z.ZodString;
4560
+ size: z.ZodNumber;
4561
+ }, z.core.$strip>>>;
4532
4562
  }, z.core.$strip>;
4533
4563
  }, z.core.$strip>;
4534
4564
  export declare const MessageSendOutputSchema: z.ZodObject<{
@@ -4542,10 +4572,13 @@ export declare const MessageSendOutputSchema: z.ZodObject<{
4542
4572
  export type MessageSendChannel = z.infer<typeof MessageSendChannelSchema>;
4543
4573
  export type MessageSendSubscription = z.infer<typeof MessageSendSubscriptionSchema>;
4544
4574
  export type MessageSendContact = z.infer<typeof MessageSendContactSchema>;
4575
+ export type MessageSendRecipient = z.infer<typeof MessageSendRecipientSchema>;
4576
+ export type MessageSendAttachment = z.infer<typeof MessageSendAttachmentSchema>;
4545
4577
  export type MessageSendMessage = z.infer<typeof MessageSendMessageSchema>;
4546
4578
  export type MessageSendInput = z.infer<typeof MessageSendInputSchema>;
4547
4579
  export type MessageSendOutput = z.infer<typeof MessageSendOutputSchema>;
4548
4580
  export declare function isModelDependency(dep: ResourceDependency): dep is ModelDependency;
4549
4581
  export declare function isChannelDependency(dep: ResourceDependency): dep is ChannelDependency;
4550
4582
  export declare function isWorkflowDependency(dep: ResourceDependency): dep is WorkflowDependency;
4551
- export {};
4583
+ export { CRMFieldTypeSchema, CRMFieldRequirementSchema, CRMFieldOptionSchema, CRMFieldDefinitionSchema, CRMFieldSchemaZ, CRMModelSchemaZ, CRMCardinalitySchema, CRMOnDeleteSchema, CRMRelationshipLinkSchema, CRMRelationshipSchemaZ, CRMSchemaZ, defineSchema, validateCRMSchema, parseCRMSchema, safeParseCRMSchema, } from './schemas/index';
4584
+ export type { CRMFieldType, CRMFieldRequirement, CRMFieldOption, CRMFieldDefinition, CRMFieldSchema, CRMModelSchema, CRMCardinality, CRMOnDelete, CRMRelationshipLink, CRMRelationshipSchema, CRMSchema, CRMSchemaValidationResult, } from './schemas/index';
package/dist/server.js CHANGED
@@ -319,16 +319,20 @@ function createContextLogger() {
319
319
  // src/server/tool-handler.ts
320
320
  function buildToolMetadata(registry) {
321
321
  return Object.values(registry).map((tool) => {
322
- const timeout = typeof tool.timeout === "number" && tool.timeout > 0 ? tool.timeout : 1e4;
323
- const retries = typeof tool.retries === "number" && tool.retries >= 1 ? tool.retries : 1;
322
+ const toolConfig = tool.config ?? {};
323
+ const timeout = typeof toolConfig.timeout === "number" && toolConfig.timeout > 0 ? toolConfig.timeout : 1e4;
324
+ const retries = typeof toolConfig.retries === "number" && toolConfig.retries >= 1 ? toolConfig.retries : 1;
324
325
  return {
325
326
  name: tool.name,
326
327
  displayName: tool.label || tool.name,
327
328
  description: tool.description,
328
329
  inputSchema: getJsonSchemaFromToolSchema(tool.inputSchema),
329
330
  outputSchema: getJsonSchemaFromToolSchema(tool.outputSchema),
330
- timeout,
331
- retries
331
+ config: {
332
+ timeout,
333
+ retries,
334
+ completionHints: toolConfig.completionHints
335
+ }
332
336
  };
333
337
  });
334
338
  }
@@ -800,8 +804,8 @@ function serializeConfig(config) {
800
804
  tools: registry ? Object.entries(registry).map(([key, tool]) => ({
801
805
  name: tool.name || key,
802
806
  description: tool.description,
803
- timeout: tool.timeout,
804
- retries: tool.retries
807
+ timeout: tool.config?.timeout,
808
+ retries: tool.config?.retries
805
809
  })) : [],
806
810
  webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
807
811
  name: w.name,
@@ -1546,28 +1550,69 @@ async function handleMcpToolsCall(params, id, ctx) {
1546
1550
  invocation: toolInvocation
1547
1551
  });
1548
1552
  let result;
1549
- if (toolResult.error) {
1550
- const errorOutput = { error: toolResult.error };
1553
+ const isNewShapeFailure = "success" in toolResult && toolResult.success === false;
1554
+ const isLegacyErrorFailure = "error" in toolResult && toolResult.error != null;
1555
+ const isLegacyMetaFailure = "meta" in toolResult && toolResult.meta != null && typeof toolResult.meta === "object" && "success" in toolResult.meta && toolResult.meta.success === false;
1556
+ const isFailure = isNewShapeFailure || isLegacyErrorFailure || isLegacyMetaFailure;
1557
+ if (isFailure) {
1558
+ let errorOutput;
1559
+ if (isNewShapeFailure && "error" in toolResult) {
1560
+ errorOutput = {
1561
+ error: toolResult.error,
1562
+ retry: "retry" in toolResult ? toolResult.retry : void 0
1563
+ };
1564
+ } else if (isLegacyErrorFailure && "error" in toolResult) {
1565
+ errorOutput = { error: toolResult.error };
1566
+ } else if (isLegacyMetaFailure && "meta" in toolResult && toolResult.meta) {
1567
+ const meta = toolResult.meta;
1568
+ errorOutput = {
1569
+ error: {
1570
+ code: "TOOL_FAILED",
1571
+ message: meta.message ?? "Tool execution failed",
1572
+ category: "internal"
1573
+ }
1574
+ };
1575
+ } else {
1576
+ errorOutput = {
1577
+ error: {
1578
+ code: "TOOL_FAILED",
1579
+ message: "Tool execution failed",
1580
+ category: "internal"
1581
+ }
1582
+ };
1583
+ }
1551
1584
  result = {
1552
1585
  content: [{ type: "text", text: JSON.stringify(errorOutput) }],
1553
1586
  structuredContent: hasOutputSchema ? void 0 : errorOutput,
1554
1587
  isError: true,
1555
- billing: toolResult.billing
1588
+ billing: "billing" in toolResult ? toolResult.billing : void 0
1556
1589
  };
1557
1590
  } else {
1558
- const outputData = toolResult.output;
1591
+ const outputData = "output" in toolResult ? toolResult.output : null;
1592
+ const effect = "effect" in toolResult ? toolResult.effect : void 0;
1593
+ const warnings = "warnings" in toolResult ? toolResult.warnings : void 0;
1594
+ const pagination = "pagination" in toolResult ? toolResult.pagination : void 0;
1559
1595
  let structuredContent;
1560
1596
  if (outputData) {
1561
- structuredContent = { ...outputData, __effect: toolResult.effect };
1562
- } else if (toolResult.effect) {
1563
- structuredContent = { __effect: toolResult.effect };
1597
+ structuredContent = {
1598
+ ...outputData,
1599
+ __effect: effect,
1600
+ __warnings: warnings,
1601
+ __pagination: pagination
1602
+ };
1603
+ } else if (effect || warnings || pagination) {
1604
+ structuredContent = {
1605
+ __effect: effect,
1606
+ __warnings: warnings,
1607
+ __pagination: pagination
1608
+ };
1564
1609
  } else if (hasOutputSchema) {
1565
1610
  structuredContent = {};
1566
1611
  }
1567
1612
  result = {
1568
- content: [{ type: "text", text: JSON.stringify(toolResult.output) }],
1613
+ content: [{ type: "text", text: JSON.stringify(outputData) }],
1569
1614
  structuredContent,
1570
- billing: toolResult.billing
1615
+ billing: "billing" in toolResult ? toolResult.billing : void 0
1571
1616
  };
1572
1617
  }
1573
1618
  return {
@@ -280,16 +280,20 @@ function createContextLogger() {
280
280
  // src/server/tool-handler.ts
281
281
  function buildToolMetadata(registry) {
282
282
  return Object.values(registry).map((tool) => {
283
- const timeout = typeof tool.timeout === "number" && tool.timeout > 0 ? tool.timeout : 1e4;
284
- const retries = typeof tool.retries === "number" && tool.retries >= 1 ? tool.retries : 1;
283
+ const toolConfig = tool.config ?? {};
284
+ const timeout = typeof toolConfig.timeout === "number" && toolConfig.timeout > 0 ? toolConfig.timeout : 1e4;
285
+ const retries = typeof toolConfig.retries === "number" && toolConfig.retries >= 1 ? toolConfig.retries : 1;
285
286
  return {
286
287
  name: tool.name,
287
288
  displayName: tool.label || tool.name,
288
289
  description: tool.description,
289
290
  inputSchema: getJsonSchemaFromToolSchema(tool.inputSchema),
290
291
  outputSchema: getJsonSchemaFromToolSchema(tool.outputSchema),
291
- timeout,
292
- retries
292
+ config: {
293
+ timeout,
294
+ retries,
295
+ completionHints: toolConfig.completionHints
296
+ }
293
297
  };
294
298
  });
295
299
  }
@@ -761,8 +765,8 @@ function serializeConfig(config) {
761
765
  tools: registry ? Object.entries(registry).map(([key, tool]) => ({
762
766
  name: tool.name || key,
763
767
  description: tool.description,
764
- timeout: tool.timeout,
765
- retries: tool.retries
768
+ timeout: tool.config?.timeout,
769
+ retries: tool.config?.retries
766
770
  })) : [],
767
771
  webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
768
772
  name: w.name,
@@ -1507,28 +1511,69 @@ async function handleMcpToolsCall(params, id, ctx) {
1507
1511
  invocation: toolInvocation
1508
1512
  });
1509
1513
  let result;
1510
- if (toolResult.error) {
1511
- const errorOutput = { error: toolResult.error };
1514
+ const isNewShapeFailure = "success" in toolResult && toolResult.success === false;
1515
+ const isLegacyErrorFailure = "error" in toolResult && toolResult.error != null;
1516
+ const isLegacyMetaFailure = "meta" in toolResult && toolResult.meta != null && typeof toolResult.meta === "object" && "success" in toolResult.meta && toolResult.meta.success === false;
1517
+ const isFailure = isNewShapeFailure || isLegacyErrorFailure || isLegacyMetaFailure;
1518
+ if (isFailure) {
1519
+ let errorOutput;
1520
+ if (isNewShapeFailure && "error" in toolResult) {
1521
+ errorOutput = {
1522
+ error: toolResult.error,
1523
+ retry: "retry" in toolResult ? toolResult.retry : void 0
1524
+ };
1525
+ } else if (isLegacyErrorFailure && "error" in toolResult) {
1526
+ errorOutput = { error: toolResult.error };
1527
+ } else if (isLegacyMetaFailure && "meta" in toolResult && toolResult.meta) {
1528
+ const meta = toolResult.meta;
1529
+ errorOutput = {
1530
+ error: {
1531
+ code: "TOOL_FAILED",
1532
+ message: meta.message ?? "Tool execution failed",
1533
+ category: "internal"
1534
+ }
1535
+ };
1536
+ } else {
1537
+ errorOutput = {
1538
+ error: {
1539
+ code: "TOOL_FAILED",
1540
+ message: "Tool execution failed",
1541
+ category: "internal"
1542
+ }
1543
+ };
1544
+ }
1512
1545
  result = {
1513
1546
  content: [{ type: "text", text: JSON.stringify(errorOutput) }],
1514
1547
  structuredContent: hasOutputSchema ? void 0 : errorOutput,
1515
1548
  isError: true,
1516
- billing: toolResult.billing
1549
+ billing: "billing" in toolResult ? toolResult.billing : void 0
1517
1550
  };
1518
1551
  } else {
1519
- const outputData = toolResult.output;
1552
+ const outputData = "output" in toolResult ? toolResult.output : null;
1553
+ const effect = "effect" in toolResult ? toolResult.effect : void 0;
1554
+ const warnings = "warnings" in toolResult ? toolResult.warnings : void 0;
1555
+ const pagination = "pagination" in toolResult ? toolResult.pagination : void 0;
1520
1556
  let structuredContent;
1521
1557
  if (outputData) {
1522
- structuredContent = { ...outputData, __effect: toolResult.effect };
1523
- } else if (toolResult.effect) {
1524
- structuredContent = { __effect: toolResult.effect };
1558
+ structuredContent = {
1559
+ ...outputData,
1560
+ __effect: effect,
1561
+ __warnings: warnings,
1562
+ __pagination: pagination
1563
+ };
1564
+ } else if (effect || warnings || pagination) {
1565
+ structuredContent = {
1566
+ __effect: effect,
1567
+ __warnings: warnings,
1568
+ __pagination: pagination
1569
+ };
1525
1570
  } else if (hasOutputSchema) {
1526
1571
  structuredContent = {};
1527
1572
  }
1528
1573
  result = {
1529
- content: [{ type: "text", text: JSON.stringify(toolResult.output) }],
1574
+ content: [{ type: "text", text: JSON.stringify(outputData) }],
1530
1575
  structuredContent,
1531
- billing: toolResult.billing
1576
+ billing: "billing" in toolResult ? toolResult.billing : void 0
1532
1577
  };
1533
1578
  }
1534
1579
  return {
@@ -0,0 +1 @@
1
+ export { SKILL_SCHEMA_VERSION, SkillSourceSchema, SkillToolRequirementSchema, SkillExampleSchema, SkillEvaluationMetricSchema, SkillYAMLSchema, SkillRefSchema, SkillVersionWeightSchema, SkillMetadataSchema, ResolvedSkillSchema, type SkillSource, type SkillToolRequirement, type SkillExample, type SkillEvaluationMetric, type SkillYAML, type SkillRef, type SkillVersionWeight, type SkillMetadata, type ResolvedSkill, type SkillDiscoveryInfo, defineSkill, validateSkillYAML, formatSkillInstructions, formatSkillDiscovery, } from './types';