@kernel.chat/kbot 2.22.3 → 2.23.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/dist/a2a.d.ts +131 -0
- package/dist/a2a.d.ts.map +1 -0
- package/dist/a2a.js +504 -0
- package/dist/a2a.js.map +1 -0
- package/dist/guardrails.d.ts +61 -0
- package/dist/guardrails.d.ts.map +1 -0
- package/dist/guardrails.js +447 -0
- package/dist/guardrails.js.map +1 -0
- package/dist/handoffs.d.ts +54 -0
- package/dist/handoffs.d.ts.map +1 -0
- package/dist/handoffs.js +257 -0
- package/dist/handoffs.js.map +1 -0
- package/dist/marketplace.d.ts +55 -0
- package/dist/marketplace.d.ts.map +1 -1
- package/dist/marketplace.js +502 -0
- package/dist/marketplace.js.map +1 -1
- package/dist/tools/browser-agent.d.ts +47 -0
- package/dist/tools/browser-agent.d.ts.map +1 -0
- package/dist/tools/browser-agent.js +509 -0
- package/dist/tools/browser-agent.js.map +1 -0
- package/dist/tools/composio.d.ts +11 -0
- package/dist/tools/composio.d.ts.map +1 -0
- package/dist/tools/composio.js +488 -0
- package/dist/tools/composio.js.map +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +9 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/workflows.d.ts +92 -0
- package/dist/workflows.d.ts.map +1 -0
- package/dist/workflows.js +619 -0
- package/dist/workflows.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { type AgentOptions } from './agent.js';
|
|
2
|
+
export interface WorkflowNode {
|
|
3
|
+
id: string;
|
|
4
|
+
type: 'agent' | 'tool' | 'condition' | 'parallel' | 'human';
|
|
5
|
+
agent?: string;
|
|
6
|
+
tool?: string;
|
|
7
|
+
prompt?: string;
|
|
8
|
+
condition?: string;
|
|
9
|
+
children?: string[];
|
|
10
|
+
retryOnFail?: boolean;
|
|
11
|
+
maxRetries?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface WorkflowEdge {
|
|
14
|
+
from: string;
|
|
15
|
+
to: string;
|
|
16
|
+
label?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface Workflow {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
description: string;
|
|
22
|
+
version: string;
|
|
23
|
+
author: string;
|
|
24
|
+
nodes: WorkflowNode[];
|
|
25
|
+
edges: WorkflowEdge[];
|
|
26
|
+
variables: Record<string, string>;
|
|
27
|
+
createdAt: string;
|
|
28
|
+
updatedAt: string;
|
|
29
|
+
}
|
|
30
|
+
export interface WorkflowRun {
|
|
31
|
+
workflowId: string;
|
|
32
|
+
status: 'running' | 'completed' | 'failed' | 'paused';
|
|
33
|
+
currentNode: string;
|
|
34
|
+
results: Record<string, string>;
|
|
35
|
+
startedAt: string;
|
|
36
|
+
completedAt?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Create an empty workflow with the given name and description.
|
|
40
|
+
*/
|
|
41
|
+
export declare function createWorkflow(name: string, description: string): Workflow;
|
|
42
|
+
/**
|
|
43
|
+
* Add a node to a workflow. Returns the mutated workflow.
|
|
44
|
+
*/
|
|
45
|
+
export declare function addNode(workflow: Workflow, node: WorkflowNode): Workflow;
|
|
46
|
+
/**
|
|
47
|
+
* Connect two nodes with a directed edge. Returns the mutated workflow.
|
|
48
|
+
*/
|
|
49
|
+
export declare function addEdge(workflow: Workflow, from: string, to: string, label?: string): Workflow;
|
|
50
|
+
/**
|
|
51
|
+
* Save a workflow to ~/.kbot/workflows/<id>.json
|
|
52
|
+
*/
|
|
53
|
+
export declare function saveWorkflow(workflow: Workflow): Promise<string>;
|
|
54
|
+
/**
|
|
55
|
+
* Load a workflow from disk by ID.
|
|
56
|
+
*/
|
|
57
|
+
export declare function loadWorkflow(id: string): Promise<Workflow>;
|
|
58
|
+
/**
|
|
59
|
+
* List all saved workflows.
|
|
60
|
+
*/
|
|
61
|
+
export declare function listWorkflows(): Promise<Array<{
|
|
62
|
+
id: string;
|
|
63
|
+
name: string;
|
|
64
|
+
description: string;
|
|
65
|
+
updatedAt: string;
|
|
66
|
+
}>>;
|
|
67
|
+
/**
|
|
68
|
+
* Export a workflow as shareable JSON string.
|
|
69
|
+
*/
|
|
70
|
+
export declare function exportWorkflow(workflow: Workflow): string;
|
|
71
|
+
/**
|
|
72
|
+
* Execute a complete workflow through kbot's agent system.
|
|
73
|
+
*
|
|
74
|
+
* Walks the topologically-sorted node list. Parallel nodes execute their
|
|
75
|
+
* children concurrently. Condition nodes branch based on expression evaluation.
|
|
76
|
+
* Human nodes pause for user input.
|
|
77
|
+
*/
|
|
78
|
+
export declare function executeWorkflow(workflow: Workflow, agentOpts: AgentOptions, variables?: Record<string, string>): Promise<WorkflowRun>;
|
|
79
|
+
/**
|
|
80
|
+
* Convert kbot planner output (array of step descriptions) into a workflow graph.
|
|
81
|
+
* Creates a linear chain of agent nodes with edges between sequential steps.
|
|
82
|
+
*/
|
|
83
|
+
export declare function planToWorkflow(planSteps: string[], name?: string): Workflow;
|
|
84
|
+
/**
|
|
85
|
+
* Export a workflow as a Mermaid diagram syntax for visualization.
|
|
86
|
+
*/
|
|
87
|
+
export declare function toMermaid(workflow: Workflow): string;
|
|
88
|
+
/**
|
|
89
|
+
* Register workflow management tools for agent access.
|
|
90
|
+
*/
|
|
91
|
+
export declare function registerWorkflowTools(): void;
|
|
92
|
+
//# sourceMappingURL=workflows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../src/workflows.ts"],"names":[],"mappings":"AAUA,OAAO,EAAY,KAAK,YAAY,EAAsB,MAAM,YAAY,CAAA;AAY5E,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,OAAO,CAAA;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CA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