beddel 0.2.3 → 0.3.0

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 (110) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/agents/chat/chat.handler.d.ts +1 -1
  3. package/dist/agents/chat/chat.handler.d.ts.map +1 -1
  4. package/dist/agents/chat/chat.handler.js +9 -7
  5. package/dist/agents/chat/chat.handler.js.map +1 -1
  6. package/dist/agents/chat/chat.yaml +6 -8
  7. package/dist/agents/gemini-vectorize/gemini-vectorize.handler.d.ts +1 -1
  8. package/dist/agents/gemini-vectorize/gemini-vectorize.handler.d.ts.map +1 -1
  9. package/dist/agents/gemini-vectorize/gemini-vectorize.handler.js +16 -13
  10. package/dist/agents/gemini-vectorize/gemini-vectorize.handler.js.map +1 -1
  11. package/dist/agents/image/image.handler.d.ts +1 -1
  12. package/dist/agents/image/image.handler.d.ts.map +1 -1
  13. package/dist/agents/image/image.handler.js +9 -6
  14. package/dist/agents/image/image.handler.js.map +1 -1
  15. package/dist/agents/image/image.types.d.ts +1 -0
  16. package/dist/agents/image/image.types.d.ts.map +1 -1
  17. package/dist/agents/index.d.ts +11 -2
  18. package/dist/agents/index.d.ts.map +1 -1
  19. package/dist/agents/index.js +9 -3
  20. package/dist/agents/index.js.map +1 -1
  21. package/dist/agents/joker/joker.handler.d.ts +1 -1
  22. package/dist/agents/joker/joker.handler.d.ts.map +1 -1
  23. package/dist/agents/joker/joker.handler.js +7 -11
  24. package/dist/agents/joker/joker.handler.js.map +1 -1
  25. package/dist/agents/joker/joker.types.d.ts +1 -0
  26. package/dist/agents/joker/joker.types.d.ts.map +1 -1
  27. package/dist/agents/llm/index.d.ts +15 -0
  28. package/dist/agents/llm/index.d.ts.map +1 -0
  29. package/dist/agents/llm/index.js +20 -0
  30. package/dist/agents/llm/index.js.map +1 -0
  31. package/dist/agents/llm/llm.handler.d.ts +8 -0
  32. package/dist/agents/llm/llm.handler.d.ts.map +1 -0
  33. package/dist/agents/llm/llm.handler.js +64 -0
  34. package/dist/agents/llm/llm.handler.js.map +1 -0
  35. package/dist/agents/llm/llm.schema.d.ts +26 -0
  36. package/dist/agents/llm/llm.schema.d.ts.map +1 -0
  37. package/dist/agents/llm/llm.schema.js +23 -0
  38. package/dist/agents/llm/llm.schema.js.map +1 -0
  39. package/dist/agents/llm/llm.types.d.ts +34 -0
  40. package/dist/agents/llm/llm.types.d.ts.map +1 -0
  41. package/dist/agents/llm/llm.types.js +7 -0
  42. package/dist/agents/llm/llm.types.js.map +1 -0
  43. package/dist/agents/llm/llm.yaml +87 -0
  44. package/dist/agents/rag/rag.handler.d.ts +1 -0
  45. package/dist/agents/rag/rag.handler.d.ts.map +1 -1
  46. package/dist/agents/rag/rag.handler.js +15 -38
  47. package/dist/agents/rag/rag.handler.js.map +1 -1
  48. package/dist/agents/rag/rag.types.d.ts +2 -7
  49. package/dist/agents/rag/rag.types.d.ts.map +1 -1
  50. package/dist/agents/rag/rag.types.js +1 -0
  51. package/dist/agents/rag/rag.types.js.map +1 -1
  52. package/dist/agents/registry/agentRegistry.d.ts +5 -0
  53. package/dist/agents/registry/agentRegistry.d.ts.map +1 -1
  54. package/dist/agents/registry/agentRegistry.js +33 -1
  55. package/dist/agents/registry/agentRegistry.js.map +1 -1
  56. package/dist/agents/translator/translator.handler.d.ts +1 -1
  57. package/dist/agents/translator/translator.handler.d.ts.map +1 -1
  58. package/dist/agents/translator/translator.handler.js +11 -13
  59. package/dist/agents/translator/translator.handler.js.map +1 -1
  60. package/dist/agents/translator/translator.types.d.ts +1 -0
  61. package/dist/agents/translator/translator.types.d.ts.map +1 -1
  62. package/dist/index.d.ts +2 -0
  63. package/dist/index.d.ts.map +1 -1
  64. package/dist/index.js +3 -1
  65. package/dist/index.js.map +1 -1
  66. package/dist/runtime/declarativeAgentRuntime.d.ts +4 -4
  67. package/dist/runtime/declarativeAgentRuntime.d.ts.map +1 -1
  68. package/dist/runtime/declarativeAgentRuntime.js +14 -9
  69. package/dist/runtime/declarativeAgentRuntime.js.map +1 -1
  70. package/dist/runtime/index.d.ts +3 -1
  71. package/dist/runtime/index.d.ts.map +1 -1
  72. package/dist/runtime/index.js +6 -1
  73. package/dist/runtime/index.js.map +1 -1
  74. package/dist/runtime/llmProviderFactory.d.ts +47 -0
  75. package/dist/runtime/llmProviderFactory.d.ts.map +1 -0
  76. package/dist/runtime/llmProviderFactory.js +119 -0
  77. package/dist/runtime/llmProviderFactory.js.map +1 -0
  78. package/dist/runtime/workflowExecutor.d.ts +3 -2
  79. package/dist/runtime/workflowExecutor.d.ts.map +1 -1
  80. package/dist/runtime/workflowExecutor.js +21 -11
  81. package/dist/runtime/workflowExecutor.js.map +1 -1
  82. package/dist/shared/types/agent.types.d.ts +15 -2
  83. package/dist/shared/types/agent.types.d.ts.map +1 -1
  84. package/dist/shared/types/agent.types.js +11 -0
  85. package/dist/shared/types/agent.types.js.map +1 -1
  86. package/package.json +7 -5
  87. package/src/agents/chat/chat.handler.ts +15 -13
  88. package/src/agents/chat/chat.yaml +6 -8
  89. package/src/agents/gemini-vectorize/gemini-vectorize.handler.ts +18 -15
  90. package/src/agents/image/image.handler.ts +10 -6
  91. package/src/agents/image/image.types.ts +1 -0
  92. package/src/agents/index.ts +6 -2
  93. package/src/agents/joker/joker.handler.ts +7 -12
  94. package/src/agents/joker/joker.types.ts +1 -0
  95. package/src/agents/llm/index.ts +20 -0
  96. package/src/agents/llm/llm.handler.ts +82 -0
  97. package/src/agents/llm/llm.schema.ts +25 -0
  98. package/src/agents/llm/llm.types.ts +37 -0
  99. package/src/agents/llm/llm.yaml +87 -0
  100. package/src/agents/rag/rag.handler.ts +20 -44
  101. package/src/agents/rag/rag.types.ts +2 -8
  102. package/src/agents/registry/agentRegistry.ts +34 -1
  103. package/src/agents/translator/translator.handler.ts +11 -13
  104. package/src/agents/translator/translator.types.ts +1 -0
  105. package/src/index.ts +8 -0
  106. package/src/runtime/declarativeAgentRuntime.ts +14 -9
  107. package/src/runtime/index.ts +5 -0
  108. package/src/runtime/llmProviderFactory.ts +145 -0
  109. package/src/runtime/workflowExecutor.ts +23 -10
  110. package/src/shared/types/agent.types.ts +23 -3
@@ -7,6 +7,7 @@ import 'server-only';
7
7
 
8
8
  import type { ExecutionContext } from '../types/executionContext';
9
9
  import type { WorkflowStepType } from '../shared/types/agent.types';
10
+ import { LEGACY_STEP_TYPE_MAP } from '../shared/types/agent.types';
10
11
 
11
12
  // Import handlers from each agent
12
13
  import { executeJokeHandler } from '../agents/joker/joker.handler';
@@ -17,6 +18,7 @@ import { executeVectorizeHandler } from '../agents/gemini-vectorize/gemini-vecto
17
18
  import { executeChromaDBHandler } from '../agents/chromadb/chromadb.handler';
18
19
  import { executeGitMcpHandler } from '../agents/gitmcp/gitmcp.handler';
19
20
  import { executeRagHandler } from '../agents/rag/rag.handler';
21
+ import { executeLlmHandler } from '../agents/llm/llm.handler';
20
22
  import { executeChatHandler } from '../agents/chat/chat.handler';
21
23
 
22
24
  /**
@@ -30,10 +32,9 @@ type HandlerFunction = (
30
32
 
31
33
  /**
32
34
  * Map of workflow step types to their handlers
33
- * Maps both legacy (Portuguese) and new (English) step type names
35
+ * Preferred step type names only - legacy names resolved via LEGACY_STEP_TYPE_MAP
34
36
  */
35
37
  const handlerMap: Record<string, HandlerFunction> = {
36
- // English step types (preferred)
37
38
  'joke': executeJokeHandler,
38
39
  'translation': executeTranslationHandler,
39
40
  'image': executeImageHandler,
@@ -42,14 +43,24 @@ const handlerMap: Record<string, HandlerFunction> = {
42
43
  'chromadb': executeChromaDBHandler,
43
44
  'gitmcp': executeGitMcpHandler,
44
45
  'rag': executeRagHandler,
46
+ 'llm': executeLlmHandler,
45
47
  'chat': executeChatHandler,
46
- // Legacy step types (for backward compatibility)
47
- 'genkit-joke': executeJokeHandler,
48
- 'genkit-translation': executeTranslationHandler,
49
- 'genkit-image': executeImageHandler,
50
- 'gemini-vectorize': executeVectorizeHandler,
51
48
  };
52
49
 
50
+ /**
51
+ * Resolve step type, handling legacy names with deprecation warning
52
+ */
53
+ function resolveStepType(stepType: string, context: ExecutionContext): string {
54
+ if (stepType in LEGACY_STEP_TYPE_MAP) {
55
+ const preferred = LEGACY_STEP_TYPE_MAP[stepType];
56
+ context.log(
57
+ `[DEPRECATION WARNING] Step type '${stepType}' is deprecated. Use '${preferred}' instead.`
58
+ );
59
+ return preferred;
60
+ }
61
+ return stepType;
62
+ }
63
+
53
64
  /**
54
65
  * Execute a workflow step by delegating to the appropriate handler
55
66
  */
@@ -59,7 +70,8 @@ export async function executeWorkflowStep(
59
70
  props: Record<string, string>,
60
71
  context: ExecutionContext
61
72
  ): Promise<unknown> {
62
- const handler = handlerMap[stepType];
73
+ const resolvedType = resolveStepType(stepType, context);
74
+ const handler = handlerMap[resolvedType];
63
75
  if (!handler) {
64
76
  throw new Error(`Unknown workflow step type: ${stepType}`);
65
77
  }
@@ -74,10 +86,10 @@ export function getAvailableStepTypes(): string[] {
74
86
  }
75
87
 
76
88
  /**
77
- * Check if a step type is supported
89
+ * Check if a step type is supported (including legacy names)
78
90
  */
79
91
  export function isStepTypeSupported(stepType: string): boolean {
80
- return stepType in handlerMap;
92
+ return stepType in handlerMap || stepType in LEGACY_STEP_TYPE_MAP;
81
93
  }
82
94
 
83
95
  // Export individual handlers for direct use
@@ -90,5 +102,6 @@ export {
90
102
  executeChromaDBHandler,
91
103
  executeGitMcpHandler,
92
104
  executeRagHandler,
105
+ executeLlmHandler,
93
106
  executeChatHandler,
94
107
  };
@@ -44,10 +44,18 @@ export interface ExecutionStep {
44
44
 
45
45
  /**
46
46
  * Workflow step types supported by the runtime
47
- * Includes both English (preferred) and legacy (Portuguese) names
47
+ *
48
+ * PREFERRED: Use the English step type names (joke, translation, image, vectorize)
49
+ *
50
+ * DEPRECATED: The following legacy names are supported for backward compatibility
51
+ * but will be removed in a future major version:
52
+ * - genkit-joke → use 'joke'
53
+ * - genkit-translation → use 'translation'
54
+ * - genkit-image → use 'image'
55
+ * - gemini-vectorize → use 'vectorize'
48
56
  */
49
57
  export type WorkflowStepType =
50
- // English step types (preferred)
58
+ // Preferred step types (use these)
51
59
  | 'joke'
52
60
  | 'translation'
53
61
  | 'image'
@@ -56,16 +64,28 @@ export type WorkflowStepType =
56
64
  | 'chromadb'
57
65
  | 'gitmcp'
58
66
  | 'rag'
67
+ | 'llm'
59
68
  | 'chat'
60
69
  | 'output-generator'
61
70
  | 'builtin-agent'
62
71
  | 'custom-action'
63
- // Legacy step types (backward compatibility)
72
+ // Legacy step types (deprecated - will be removed in v1.0)
64
73
  | 'genkit-joke'
65
74
  | 'genkit-translation'
66
75
  | 'genkit-image'
67
76
  | 'gemini-vectorize';
68
77
 
78
+ /**
79
+ * Maps legacy step type names to their preferred equivalents
80
+ * @deprecated Use preferred step type names directly
81
+ */
82
+ export const LEGACY_STEP_TYPE_MAP: Record<string, WorkflowStepType> = {
83
+ 'genkit-joke': 'joke',
84
+ 'genkit-translation': 'translation',
85
+ 'genkit-image': 'image',
86
+ 'gemini-vectorize': 'vectorize',
87
+ };
88
+
69
89
  /**
70
90
  * Agent categories for organization
71
91
  */