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
@@ -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 {