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.
- package/CHANGELOG.md +35 -0
- package/dist/agents/chat/chat.handler.d.ts +1 -1
- package/dist/agents/chat/chat.handler.d.ts.map +1 -1
- package/dist/agents/chat/chat.handler.js +9 -7
- package/dist/agents/chat/chat.handler.js.map +1 -1
- package/dist/agents/chat/chat.yaml +6 -8
- package/dist/agents/gemini-vectorize/gemini-vectorize.handler.d.ts +1 -1
- package/dist/agents/gemini-vectorize/gemini-vectorize.handler.d.ts.map +1 -1
- package/dist/agents/gemini-vectorize/gemini-vectorize.handler.js +16 -13
- package/dist/agents/gemini-vectorize/gemini-vectorize.handler.js.map +1 -1
- package/dist/agents/image/image.handler.d.ts +1 -1
- package/dist/agents/image/image.handler.d.ts.map +1 -1
- package/dist/agents/image/image.handler.js +9 -6
- package/dist/agents/image/image.handler.js.map +1 -1
- package/dist/agents/image/image.types.d.ts +1 -0
- package/dist/agents/image/image.types.d.ts.map +1 -1
- package/dist/agents/index.d.ts +11 -2
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +9 -3
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/joker/joker.handler.d.ts +1 -1
- package/dist/agents/joker/joker.handler.d.ts.map +1 -1
- package/dist/agents/joker/joker.handler.js +7 -11
- package/dist/agents/joker/joker.handler.js.map +1 -1
- package/dist/agents/joker/joker.types.d.ts +1 -0
- package/dist/agents/joker/joker.types.d.ts.map +1 -1
- package/dist/agents/llm/index.d.ts +15 -0
- package/dist/agents/llm/index.d.ts.map +1 -0
- package/dist/agents/llm/index.js +20 -0
- package/dist/agents/llm/index.js.map +1 -0
- package/dist/agents/llm/llm.handler.d.ts +8 -0
- package/dist/agents/llm/llm.handler.d.ts.map +1 -0
- package/dist/agents/llm/llm.handler.js +64 -0
- package/dist/agents/llm/llm.handler.js.map +1 -0
- package/dist/agents/llm/llm.schema.d.ts +26 -0
- package/dist/agents/llm/llm.schema.d.ts.map +1 -0
- package/dist/agents/llm/llm.schema.js +23 -0
- package/dist/agents/llm/llm.schema.js.map +1 -0
- package/dist/agents/llm/llm.types.d.ts +34 -0
- package/dist/agents/llm/llm.types.d.ts.map +1 -0
- package/dist/agents/llm/llm.types.js +7 -0
- package/dist/agents/llm/llm.types.js.map +1 -0
- package/dist/agents/llm/llm.yaml +87 -0
- package/dist/agents/rag/rag.handler.d.ts +1 -0
- package/dist/agents/rag/rag.handler.d.ts.map +1 -1
- package/dist/agents/rag/rag.handler.js +15 -38
- package/dist/agents/rag/rag.handler.js.map +1 -1
- package/dist/agents/rag/rag.types.d.ts +2 -7
- package/dist/agents/rag/rag.types.d.ts.map +1 -1
- package/dist/agents/rag/rag.types.js +1 -0
- package/dist/agents/rag/rag.types.js.map +1 -1
- package/dist/agents/registry/agentRegistry.d.ts +5 -0
- package/dist/agents/registry/agentRegistry.d.ts.map +1 -1
- package/dist/agents/registry/agentRegistry.js +33 -1
- package/dist/agents/registry/agentRegistry.js.map +1 -1
- package/dist/agents/translator/translator.handler.d.ts +1 -1
- package/dist/agents/translator/translator.handler.d.ts.map +1 -1
- package/dist/agents/translator/translator.handler.js +11 -13
- package/dist/agents/translator/translator.handler.js.map +1 -1
- package/dist/agents/translator/translator.types.d.ts +1 -0
- package/dist/agents/translator/translator.types.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/runtime/declarativeAgentRuntime.d.ts +4 -4
- package/dist/runtime/declarativeAgentRuntime.d.ts.map +1 -1
- package/dist/runtime/declarativeAgentRuntime.js +14 -9
- package/dist/runtime/declarativeAgentRuntime.js.map +1 -1
- package/dist/runtime/index.d.ts +3 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +6 -1
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/llmProviderFactory.d.ts +47 -0
- package/dist/runtime/llmProviderFactory.d.ts.map +1 -0
- package/dist/runtime/llmProviderFactory.js +119 -0
- package/dist/runtime/llmProviderFactory.js.map +1 -0
- package/dist/runtime/workflowExecutor.d.ts +3 -2
- package/dist/runtime/workflowExecutor.d.ts.map +1 -1
- package/dist/runtime/workflowExecutor.js +21 -11
- package/dist/runtime/workflowExecutor.js.map +1 -1
- package/dist/shared/types/agent.types.d.ts +15 -2
- package/dist/shared/types/agent.types.d.ts.map +1 -1
- package/dist/shared/types/agent.types.js +11 -0
- package/dist/shared/types/agent.types.js.map +1 -1
- package/package.json +7 -5
- package/src/agents/chat/chat.handler.ts +15 -13
- package/src/agents/chat/chat.yaml +6 -8
- package/src/agents/gemini-vectorize/gemini-vectorize.handler.ts +18 -15
- package/src/agents/image/image.handler.ts +10 -6
- package/src/agents/image/image.types.ts +1 -0
- package/src/agents/index.ts +6 -2
- package/src/agents/joker/joker.handler.ts +7 -12
- package/src/agents/joker/joker.types.ts +1 -0
- package/src/agents/llm/index.ts +20 -0
- package/src/agents/llm/llm.handler.ts +82 -0
- package/src/agents/llm/llm.schema.ts +25 -0
- package/src/agents/llm/llm.types.ts +37 -0
- package/src/agents/llm/llm.yaml +87 -0
- package/src/agents/rag/rag.handler.ts +20 -44
- package/src/agents/rag/rag.types.ts +2 -8
- package/src/agents/registry/agentRegistry.ts +34 -1
- package/src/agents/translator/translator.handler.ts +11 -13
- package/src/agents/translator/translator.types.ts +1 -0
- package/src/index.ts +8 -0
- package/src/runtime/declarativeAgentRuntime.ts +14 -9
- package/src/runtime/index.ts +5 -0
- package/src/runtime/llmProviderFactory.ts +145 -0
- package/src/runtime/workflowExecutor.ts +23 -10
- 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
|
-
*
|
|
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
|
|
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
|
-
*
|
|
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
|
-
//
|
|
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 (
|
|
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
|
*/
|