jazz-ai 0.1.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/LICENSE +21 -0
- package/README.md +182 -0
- package/dist/cli/commands/auth.d.ts +18 -0
- package/dist/cli/commands/auth.d.ts.map +1 -0
- package/dist/cli/commands/auth.js +128 -0
- package/dist/cli/commands/auth.js.map +1 -0
- package/dist/cli/commands/chat-agent.d.ts +18 -0
- package/dist/cli/commands/chat-agent.d.ts.map +1 -0
- package/dist/cli/commands/chat-agent.js +421 -0
- package/dist/cli/commands/chat-agent.js.map +1 -0
- package/dist/cli/commands/edit-agent.d.ts +10 -0
- package/dist/cli/commands/edit-agent.d.ts.map +1 -0
- package/dist/cli/commands/edit-agent.js +310 -0
- package/dist/cli/commands/edit-agent.js.map +1 -0
- package/dist/cli/commands/task-agent.d.ts +126 -0
- package/dist/cli/commands/task-agent.d.ts.map +1 -0
- package/dist/cli/commands/task-agent.js +345 -0
- package/dist/cli/commands/task-agent.js.map +1 -0
- package/dist/core/agent/agent-prompt.d.ts +47 -0
- package/dist/core/agent/agent-prompt.d.ts.map +1 -0
- package/dist/core/agent/agent-prompt.js +146 -0
- package/dist/core/agent/agent-prompt.js.map +1 -0
- package/dist/core/agent/agent-runner.d.ts +63 -0
- package/dist/core/agent/agent-runner.d.ts.map +1 -0
- package/dist/core/agent/agent-runner.js +346 -0
- package/dist/core/agent/agent-runner.js.map +1 -0
- package/dist/core/agent/agent-service.d.ts +164 -0
- package/dist/core/agent/agent-service.d.ts.map +1 -0
- package/dist/core/agent/agent-service.js +463 -0
- package/dist/core/agent/agent-service.js.map +1 -0
- package/dist/core/agent/gmail-agent.d.ts +17 -0
- package/dist/core/agent/gmail-agent.d.ts.map +1 -0
- package/dist/core/agent/gmail-agent.js +191 -0
- package/dist/core/agent/gmail-agent.js.map +1 -0
- package/dist/core/agent/prompts/default/v1.d.ts +2 -0
- package/dist/core/agent/prompts/default/v1.d.ts.map +1 -0
- package/dist/core/agent/prompts/default/v1.js +202 -0
- package/dist/core/agent/prompts/default/v1.js.map +1 -0
- package/dist/core/agent/prompts/default/v2.d.ts +2 -0
- package/dist/core/agent/prompts/default/v2.d.ts.map +1 -0
- package/dist/core/agent/prompts/default/v2.js +72 -0
- package/dist/core/agent/prompts/default/v2.js.map +1 -0
- package/dist/core/agent/prompts/gmail/v1.d.ts +2 -0
- package/dist/core/agent/prompts/gmail/v1.d.ts.map +1 -0
- package/dist/core/agent/prompts/gmail/v1.js +206 -0
- package/dist/core/agent/prompts/gmail/v1.js.map +1 -0
- package/dist/core/agent/prompts/gmail/v2.d.ts +2 -0
- package/dist/core/agent/prompts/gmail/v2.d.ts.map +1 -0
- package/dist/core/agent/prompts/gmail/v2.js +59 -0
- package/dist/core/agent/prompts/gmail/v2.js.map +1 -0
- package/dist/core/agent/tools/base-tool.d.ts +161 -0
- package/dist/core/agent/tools/base-tool.d.ts.map +1 -0
- package/dist/core/agent/tools/base-tool.js +153 -0
- package/dist/core/agent/tools/base-tool.js.map +1 -0
- package/dist/core/agent/tools/fs-tools.d.ts +21 -0
- package/dist/core/agent/tools/fs-tools.d.ts.map +1 -0
- package/dist/core/agent/tools/fs-tools.js +1210 -0
- package/dist/core/agent/tools/fs-tools.js.map +1 -0
- package/dist/core/agent/tools/git-tools.d.ts +63 -0
- package/dist/core/agent/tools/git-tools.d.ts.map +1 -0
- package/dist/core/agent/tools/git-tools.js +600 -0
- package/dist/core/agent/tools/git-tools.js.map +1 -0
- package/dist/core/agent/tools/gmail-tools.d.ts +22 -0
- package/dist/core/agent/tools/gmail-tools.d.ts.map +1 -0
- package/dist/core/agent/tools/gmail-tools.js +779 -0
- package/dist/core/agent/tools/gmail-tools.js.map +1 -0
- package/dist/core/agent/tools/register-tools.d.ts +13 -0
- package/dist/core/agent/tools/register-tools.d.ts.map +1 -0
- package/dist/core/agent/tools/register-tools.js +169 -0
- package/dist/core/agent/tools/register-tools.js.map +1 -0
- package/dist/core/agent/tools/shell-tools.d.ts +19 -0
- package/dist/core/agent/tools/shell-tools.d.ts.map +1 -0
- package/dist/core/agent/tools/shell-tools.js +367 -0
- package/dist/core/agent/tools/shell-tools.js.map +1 -0
- package/dist/core/agent/tools/tool-registry.d.ts +62 -0
- package/dist/core/agent/tools/tool-registry.d.ts.map +1 -0
- package/dist/core/agent/tools/tool-registry.js +187 -0
- package/dist/core/agent/tools/tool-registry.js.map +1 -0
- package/dist/core/agent/tools/web-search-tools.d.ts +39 -0
- package/dist/core/agent/tools/web-search-tools.d.ts.map +1 -0
- package/dist/core/agent/tools/web-search-tools.js +220 -0
- package/dist/core/agent/tools/web-search-tools.js.map +1 -0
- package/dist/core/types/errors.d.ts +300 -0
- package/dist/core/types/errors.d.ts.map +1 -0
- package/dist/core/types/errors.js +115 -0
- package/dist/core/types/errors.js.map +1 -0
- package/dist/core/types/index.d.ts +208 -0
- package/dist/core/types/index.d.ts.map +1 -0
- package/dist/core/types/index.js +30 -0
- package/dist/core/types/index.js.map +1 -0
- package/dist/core/utils/error-handler.d.ts +114 -0
- package/dist/core/utils/error-handler.d.ts.map +1 -0
- package/dist/core/utils/error-handler.js +551 -0
- package/dist/core/utils/error-handler.js.map +1 -0
- package/dist/core/utils/markdown-renderer.d.ts +52 -0
- package/dist/core/utils/markdown-renderer.d.ts.map +1 -0
- package/dist/core/utils/markdown-renderer.js +134 -0
- package/dist/core/utils/markdown-renderer.js.map +1 -0
- package/dist/main.d.ts +3 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +255 -0
- package/dist/main.js.map +1 -0
- package/dist/services/config.d.ts +29 -0
- package/dist/services/config.d.ts.map +1 -0
- package/dist/services/config.js +204 -0
- package/dist/services/config.js.map +1 -0
- package/dist/services/gmail.d.ts +197 -0
- package/dist/services/gmail.d.ts.map +1 -0
- package/dist/services/gmail.js +592 -0
- package/dist/services/gmail.js.map +1 -0
- package/dist/services/llm/ai-sdk-service.d.ts +5 -0
- package/dist/services/llm/ai-sdk-service.d.ts.map +1 -0
- package/dist/services/llm/ai-sdk-service.js +326 -0
- package/dist/services/llm/ai-sdk-service.js.map +1 -0
- package/dist/services/llm/context-manager.d.ts +51 -0
- package/dist/services/llm/context-manager.d.ts.map +1 -0
- package/dist/services/llm/context-manager.js +269 -0
- package/dist/services/llm/context-manager.js.map +1 -0
- package/dist/services/llm/types.d.ts +114 -0
- package/dist/services/llm/types.d.ts.map +1 -0
- package/dist/services/llm/types.js +51 -0
- package/dist/services/llm/types.js.map +1 -0
- package/dist/services/logger.d.ts +28 -0
- package/dist/services/logger.d.ts.map +1 -0
- package/dist/services/logger.js +267 -0
- package/dist/services/logger.js.map +1 -0
- package/dist/services/shell.d.ts +37 -0
- package/dist/services/shell.d.ts.map +1 -0
- package/dist/services/shell.js +197 -0
- package/dist/services/shell.js.map +1 -0
- package/dist/services/storage/file.d.ts +37 -0
- package/dist/services/storage/file.d.ts.map +1 -0
- package/dist/services/storage/file.js +221 -0
- package/dist/services/storage/file.js.map +1 -0
- package/dist/services/storage/inMemory.d.ts +25 -0
- package/dist/services/storage/inMemory.d.ts.map +1 -0
- package/dist/services/storage/inMemory.js +106 -0
- package/dist/services/storage/inMemory.js.map +1 -0
- package/dist/services/storage/service.d.ts +26 -0
- package/dist/services/storage/service.d.ts.map +1 -0
- package/dist/services/storage/service.js +48 -0
- package/dist/services/storage/service.js.map +1 -0
- package/package.json +92 -0
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.editAgentCommand = editAgentCommand;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const effect_1 = require("effect");
|
|
6
|
+
const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
|
|
7
|
+
const agent_prompt_1 = require("../../core/agent/agent-prompt");
|
|
8
|
+
const agent_service_1 = require("../../core/agent/agent-service");
|
|
9
|
+
const tool_registry_1 = require("../../core/agent/tools/tool-registry");
|
|
10
|
+
const types_1 = require("../../services/llm/types");
|
|
11
|
+
/**
|
|
12
|
+
* Interactive agent edit command
|
|
13
|
+
*/
|
|
14
|
+
function editAgentCommand(agentId) {
|
|
15
|
+
return effect_1.Effect.gen(function* () {
|
|
16
|
+
console.log("✏️ Welcome to the Jazz Agent Edit Wizard!");
|
|
17
|
+
console.log("Let's update your agent step by step.\n");
|
|
18
|
+
const agentService = yield* agent_service_1.AgentServiceTag;
|
|
19
|
+
const agent = yield* agentService.getAgent(agentId);
|
|
20
|
+
console.log(`📋 Current Agent: ${agent.name}`);
|
|
21
|
+
console.log(` ID: ${agent.id}`);
|
|
22
|
+
console.log(` Description: ${agent.description}`);
|
|
23
|
+
console.log(` Status: ${agent.status}`);
|
|
24
|
+
console.log(` Type: ${agent.config.agentType || "N/A"}`);
|
|
25
|
+
console.log(` LLM Provider: ${agent.config.llmProvider || "N/A"}`);
|
|
26
|
+
console.log(` LLM Model: ${agent.config.llmModel || "N/A"}`);
|
|
27
|
+
console.log(` Tools: ${agent.config.tools?.length || 0} tools`);
|
|
28
|
+
console.log(` Created: ${agent.createdAt.toISOString()}`);
|
|
29
|
+
console.log(` Updated: ${agent.updatedAt.toISOString()}\n`);
|
|
30
|
+
// Get available LLM providers and models
|
|
31
|
+
const llmService = yield* types_1.LLMServiceTag;
|
|
32
|
+
const providers = yield* llmService.listProviders();
|
|
33
|
+
// Get available agent types
|
|
34
|
+
const agentTypes = yield* agent_prompt_1.agentPromptBuilder.listTemplates();
|
|
35
|
+
// Get available tools by category
|
|
36
|
+
const toolRegistry = yield* tool_registry_1.ToolRegistryTag;
|
|
37
|
+
const toolsByCategory = yield* toolRegistry.listToolsByCategory();
|
|
38
|
+
// Prompt for updates
|
|
39
|
+
const editAnswers = yield* effect_1.Effect.promise(() => promptForAgentUpdates(agent, providers, agentTypes, toolsByCategory));
|
|
40
|
+
// Build updated configuration
|
|
41
|
+
const updatedConfig = {
|
|
42
|
+
...agent.config,
|
|
43
|
+
...(editAnswers.agentType && { agentType: editAnswers.agentType }),
|
|
44
|
+
...(editAnswers.llmProvider && { llmProvider: editAnswers.llmProvider }),
|
|
45
|
+
...(editAnswers.llmModel && { llmModel: editAnswers.llmModel }),
|
|
46
|
+
...(editAnswers.reasoningEffort && { reasoningEffort: editAnswers.reasoningEffort }),
|
|
47
|
+
...(editAnswers.tools && { tools: editAnswers.tools }),
|
|
48
|
+
...(editAnswers.timeout && { timeout: editAnswers.timeout }),
|
|
49
|
+
...(editAnswers.maxRetries !== undefined ||
|
|
50
|
+
editAnswers.retryDelay !== undefined ||
|
|
51
|
+
editAnswers.retryBackoff
|
|
52
|
+
? {
|
|
53
|
+
retryPolicy: {
|
|
54
|
+
maxRetries: editAnswers.maxRetries ?? agent.config.retryPolicy?.maxRetries ?? 3,
|
|
55
|
+
delay: editAnswers.retryDelay ?? agent.config.retryPolicy?.delay ?? 1000,
|
|
56
|
+
backoff: editAnswers.retryBackoff ?? agent.config.retryPolicy?.backoff ?? "exponential",
|
|
57
|
+
},
|
|
58
|
+
}
|
|
59
|
+
: {}),
|
|
60
|
+
};
|
|
61
|
+
// Build update object
|
|
62
|
+
const updates = {
|
|
63
|
+
...(editAnswers.name && { name: editAnswers.name }),
|
|
64
|
+
...(editAnswers.description && { description: editAnswers.description }),
|
|
65
|
+
...(editAnswers.status && { status: editAnswers.status }),
|
|
66
|
+
config: updatedConfig,
|
|
67
|
+
};
|
|
68
|
+
// Update the agent
|
|
69
|
+
const updatedAgent = yield* agentService.updateAgent(agentId, updates);
|
|
70
|
+
// Display success message
|
|
71
|
+
console.log("\n✅ Agent updated successfully!");
|
|
72
|
+
console.log(` ID: ${updatedAgent.id}`);
|
|
73
|
+
console.log(` Name: ${updatedAgent.name}`);
|
|
74
|
+
console.log(` Description: ${updatedAgent.description}`);
|
|
75
|
+
console.log(` Status: ${updatedAgent.status}`);
|
|
76
|
+
console.log(` Type: ${updatedConfig.agentType || "N/A"}`);
|
|
77
|
+
console.log(` LLM Provider: ${updatedConfig.llmProvider || "N/A"}`);
|
|
78
|
+
console.log(` LLM Model: ${updatedConfig.llmModel || "N/A"}`);
|
|
79
|
+
console.log(` Tools: ${updatedConfig.tools?.length || 0} tools`);
|
|
80
|
+
console.log(` Updated: ${updatedAgent.updatedAt.toISOString()}`);
|
|
81
|
+
console.log("\nYou can now chat with your updated agent using:");
|
|
82
|
+
console.log(`jazz agent chat ${updatedAgent.id}`);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Prompt for agent updates
|
|
87
|
+
*/
|
|
88
|
+
async function promptForAgentUpdates(currentAgent, providers, agentTypes, toolsByCategory) {
|
|
89
|
+
const answers = {};
|
|
90
|
+
// Ask what to update
|
|
91
|
+
const { fieldsToUpdate } = await inquirer_1.default.prompt([
|
|
92
|
+
{
|
|
93
|
+
type: "checkbox",
|
|
94
|
+
name: "fieldsToUpdate",
|
|
95
|
+
message: "What would you like to update?",
|
|
96
|
+
choices: [
|
|
97
|
+
{ name: "Name", value: "name" },
|
|
98
|
+
{ name: "Description", value: "description" },
|
|
99
|
+
{ name: "Status", value: "status" },
|
|
100
|
+
{ name: "Agent Type", value: "agentType" },
|
|
101
|
+
{ name: "LLM Provider", value: "llmProvider" },
|
|
102
|
+
{ name: "LLM Model", value: "llmModel" },
|
|
103
|
+
{ name: "Tools", value: "tools" },
|
|
104
|
+
{ name: "Timeout", value: "timeout" },
|
|
105
|
+
{ name: "Retry Policy", value: "retryPolicy" },
|
|
106
|
+
],
|
|
107
|
+
},
|
|
108
|
+
]);
|
|
109
|
+
if (fieldsToUpdate.length === 0) {
|
|
110
|
+
console.log("No fields selected for update. Exiting...");
|
|
111
|
+
return answers;
|
|
112
|
+
}
|
|
113
|
+
// Update name
|
|
114
|
+
if (fieldsToUpdate.includes("name")) {
|
|
115
|
+
const { name } = await inquirer_1.default.prompt([
|
|
116
|
+
{
|
|
117
|
+
type: "input",
|
|
118
|
+
name: "name",
|
|
119
|
+
message: "Enter new agent name:",
|
|
120
|
+
default: currentAgent.name,
|
|
121
|
+
validate: (input) => {
|
|
122
|
+
if (!input.trim()) {
|
|
123
|
+
return "Agent name cannot be empty";
|
|
124
|
+
}
|
|
125
|
+
if (input.length > 100) {
|
|
126
|
+
return "Agent name must be 100 characters or less";
|
|
127
|
+
}
|
|
128
|
+
return true;
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
]);
|
|
132
|
+
answers.name = name;
|
|
133
|
+
}
|
|
134
|
+
// Update description
|
|
135
|
+
if (fieldsToUpdate.includes("description")) {
|
|
136
|
+
const { description } = await inquirer_1.default.prompt([
|
|
137
|
+
{
|
|
138
|
+
type: "input",
|
|
139
|
+
name: "description",
|
|
140
|
+
message: "Enter new agent description:",
|
|
141
|
+
default: currentAgent.description,
|
|
142
|
+
validate: (input) => {
|
|
143
|
+
if (!input.trim()) {
|
|
144
|
+
return "Agent description cannot be empty";
|
|
145
|
+
}
|
|
146
|
+
if (input.length > 500) {
|
|
147
|
+
return "Agent description must be 500 characters or less";
|
|
148
|
+
}
|
|
149
|
+
return true;
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
]);
|
|
153
|
+
answers.description = description;
|
|
154
|
+
}
|
|
155
|
+
// Update status
|
|
156
|
+
if (fieldsToUpdate.includes("status")) {
|
|
157
|
+
const { status } = await inquirer_1.default.prompt([
|
|
158
|
+
{
|
|
159
|
+
type: "list",
|
|
160
|
+
name: "status",
|
|
161
|
+
message: "Select new agent status:",
|
|
162
|
+
choices: [
|
|
163
|
+
{ name: "Idle (ready to run)", value: "idle" },
|
|
164
|
+
{ name: "Running (currently executing)", value: "running" },
|
|
165
|
+
{ name: "Paused (temporarily stopped)", value: "paused" },
|
|
166
|
+
{ name: "Error (failed with error)", value: "error" },
|
|
167
|
+
{ name: "Completed (finished successfully)", value: "completed" },
|
|
168
|
+
],
|
|
169
|
+
default: currentAgent.status,
|
|
170
|
+
},
|
|
171
|
+
]);
|
|
172
|
+
answers.status = status;
|
|
173
|
+
}
|
|
174
|
+
// Update agent type
|
|
175
|
+
if (fieldsToUpdate.includes("agentType")) {
|
|
176
|
+
const { agentType } = await inquirer_1.default.prompt([
|
|
177
|
+
{
|
|
178
|
+
type: "list",
|
|
179
|
+
name: "agentType",
|
|
180
|
+
message: "Select agent type:",
|
|
181
|
+
choices: agentTypes.map((type) => ({ name: type, value: type })),
|
|
182
|
+
default: currentAgent.config.agentType || agentTypes[0],
|
|
183
|
+
},
|
|
184
|
+
]);
|
|
185
|
+
answers.agentType = agentType;
|
|
186
|
+
}
|
|
187
|
+
// Update LLM provider
|
|
188
|
+
if (fieldsToUpdate.includes("llmProvider")) {
|
|
189
|
+
const { llmProvider } = await inquirer_1.default.prompt([
|
|
190
|
+
{
|
|
191
|
+
type: "list",
|
|
192
|
+
name: "llmProvider",
|
|
193
|
+
message: "Select LLM provider:",
|
|
194
|
+
choices: providers.map((provider) => ({ name: provider, value: provider })),
|
|
195
|
+
default: currentAgent.config.llmProvider || providers[0],
|
|
196
|
+
},
|
|
197
|
+
]);
|
|
198
|
+
answers.llmProvider = llmProvider;
|
|
199
|
+
// Update LLM model based on provider
|
|
200
|
+
if (fieldsToUpdate.includes("llmModel")) {
|
|
201
|
+
// Note: This would need to be handled in the Effect context
|
|
202
|
+
// For now, we'll skip the model selection in the prompt
|
|
203
|
+
console.log("LLM model selection will be handled during agent update");
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
// Update tools
|
|
207
|
+
if (fieldsToUpdate.includes("tools")) {
|
|
208
|
+
const { toolCategories } = await inquirer_1.default.prompt([
|
|
209
|
+
{
|
|
210
|
+
type: "checkbox",
|
|
211
|
+
name: "toolCategories",
|
|
212
|
+
message: "Select tool categories:",
|
|
213
|
+
choices: Object.keys(toolsByCategory).map((category) => ({
|
|
214
|
+
name: `${category} (${toolsByCategory[category]?.length || 0} tools)`,
|
|
215
|
+
value: category,
|
|
216
|
+
})),
|
|
217
|
+
default: [], // Don't pre-select any categories
|
|
218
|
+
},
|
|
219
|
+
]);
|
|
220
|
+
// Convert selected categories to actual tool names
|
|
221
|
+
const selectedTools = [];
|
|
222
|
+
for (const category of toolCategories) {
|
|
223
|
+
const toolsInCategory = toolsByCategory[category] || [];
|
|
224
|
+
selectedTools.push(...toolsInCategory);
|
|
225
|
+
}
|
|
226
|
+
answers.tools = selectedTools;
|
|
227
|
+
}
|
|
228
|
+
// Update timeout
|
|
229
|
+
if (fieldsToUpdate.includes("timeout")) {
|
|
230
|
+
const { timeout } = await inquirer_1.default.prompt([
|
|
231
|
+
{
|
|
232
|
+
type: "input",
|
|
233
|
+
name: "timeout",
|
|
234
|
+
message: "Enter timeout in milliseconds (0 for no timeout):",
|
|
235
|
+
default: String(currentAgent.config.timeout || 30000),
|
|
236
|
+
validate: (input) => {
|
|
237
|
+
const num = parseInt(input, 10);
|
|
238
|
+
if (isNaN(num)) {
|
|
239
|
+
return "Please enter a valid number";
|
|
240
|
+
}
|
|
241
|
+
if (num < 0) {
|
|
242
|
+
return "Timeout must be 0 or greater";
|
|
243
|
+
}
|
|
244
|
+
if (num > 300000) {
|
|
245
|
+
return "Timeout must be 300 seconds or less";
|
|
246
|
+
}
|
|
247
|
+
return true;
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
]);
|
|
251
|
+
answers.timeout = parseInt(timeout, 10);
|
|
252
|
+
}
|
|
253
|
+
// Update retry policy
|
|
254
|
+
if (fieldsToUpdate.includes("retryPolicy")) {
|
|
255
|
+
const { maxRetries } = await inquirer_1.default.prompt([
|
|
256
|
+
{
|
|
257
|
+
type: "input",
|
|
258
|
+
name: "maxRetries",
|
|
259
|
+
message: "Enter maximum retry attempts:",
|
|
260
|
+
default: String(currentAgent.config.retryPolicy?.maxRetries || 3),
|
|
261
|
+
validate: (input) => {
|
|
262
|
+
const num = parseInt(input, 10);
|
|
263
|
+
if (isNaN(num)) {
|
|
264
|
+
return "Please enter a valid number";
|
|
265
|
+
}
|
|
266
|
+
if (num < 0 || num > 10) {
|
|
267
|
+
return "Max retries must be between 0 and 10";
|
|
268
|
+
}
|
|
269
|
+
return true;
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
]);
|
|
273
|
+
const { retryDelay } = await inquirer_1.default.prompt([
|
|
274
|
+
{
|
|
275
|
+
type: "input",
|
|
276
|
+
name: "retryDelay",
|
|
277
|
+
message: "Enter retry delay in milliseconds:",
|
|
278
|
+
default: String(currentAgent.config.retryPolicy?.delay || 1000),
|
|
279
|
+
validate: (input) => {
|
|
280
|
+
const num = parseInt(input, 10);
|
|
281
|
+
if (isNaN(num)) {
|
|
282
|
+
return "Please enter a valid number";
|
|
283
|
+
}
|
|
284
|
+
if (num < 100 || num > 60000) {
|
|
285
|
+
return "Retry delay must be between 100ms and 60000ms";
|
|
286
|
+
}
|
|
287
|
+
return true;
|
|
288
|
+
},
|
|
289
|
+
},
|
|
290
|
+
]);
|
|
291
|
+
const { retryBackoff } = await inquirer_1.default.prompt([
|
|
292
|
+
{
|
|
293
|
+
type: "list",
|
|
294
|
+
name: "retryBackoff",
|
|
295
|
+
message: "Select retry backoff strategy:",
|
|
296
|
+
choices: [
|
|
297
|
+
{ name: "Linear (constant delay)", value: "linear" },
|
|
298
|
+
{ name: "Exponential (increasing delay)", value: "exponential" },
|
|
299
|
+
{ name: "Fixed (same delay each time)", value: "fixed" },
|
|
300
|
+
],
|
|
301
|
+
default: currentAgent.config.retryPolicy?.backoff || "exponential",
|
|
302
|
+
},
|
|
303
|
+
]);
|
|
304
|
+
answers.maxRetries = parseInt(maxRetries, 10);
|
|
305
|
+
answers.retryDelay = parseInt(retryDelay, 10);
|
|
306
|
+
answers.retryBackoff = retryBackoff;
|
|
307
|
+
}
|
|
308
|
+
return answers;
|
|
309
|
+
}
|
|
310
|
+
//# sourceMappingURL=edit-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit-agent.js","sourceRoot":"","sources":["../../../src/cli/commands/edit-agent.ts"],"names":[],"mappings":";;AAoCA,4CA8FC;;AAlID,mCAAgC;AA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/agent/agent-service";
|
|
3
|
+
import { AgentAlreadyExistsError, AgentConfigurationError, StorageError, StorageNotFoundError, ValidationError } from "../../core/types/errors";
|
|
4
|
+
import type { GmailService } from "../../services/gmail";
|
|
5
|
+
/**
|
|
6
|
+
* CLI commands for task-based agent management
|
|
7
|
+
*
|
|
8
|
+
* These commands handle traditional automation agents that execute predefined tasks
|
|
9
|
+
* like Gmail operations, shell commands, API calls, etc. They focus on workflow
|
|
10
|
+
* automation rather than conversational AI interactions.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Create a new agent via CLI command
|
|
14
|
+
*
|
|
15
|
+
* Creates a new agent with the specified name, description, and configuration options.
|
|
16
|
+
* The command validates input parameters and displays success information including
|
|
17
|
+
* the agent ID, configuration details, and timestamps.
|
|
18
|
+
*
|
|
19
|
+
* @param name - The unique name for the agent
|
|
20
|
+
* @param description - A description of what the agent does
|
|
21
|
+
* @param options - Configuration options including timeout, retry policy settings
|
|
22
|
+
* @returns An Effect that resolves when the agent is created successfully
|
|
23
|
+
*
|
|
24
|
+
* @throws {StorageError} When there's an error saving the agent
|
|
25
|
+
* @throws {AgentAlreadyExistsError} When an agent with the same name already exists
|
|
26
|
+
* @throws {AgentConfigurationError} When the configuration is invalid
|
|
27
|
+
* @throws {ValidationError} When input validation fails
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* yield* createAgentCommand(
|
|
32
|
+
* "email-processor",
|
|
33
|
+
* "Processes incoming emails",
|
|
34
|
+
* { timeout: 30000, maxRetries: 3, retryDelay: 1000 }
|
|
35
|
+
* );
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare function createAgentCommand(name: string, description: string, options: {
|
|
39
|
+
description?: string;
|
|
40
|
+
timeout?: number;
|
|
41
|
+
maxRetries?: number;
|
|
42
|
+
retryDelay?: number;
|
|
43
|
+
retryBackoff?: "linear" | "exponential" | "fixed";
|
|
44
|
+
}): Effect.Effect<void, StorageError | AgentAlreadyExistsError | AgentConfigurationError | ValidationError, AgentService>;
|
|
45
|
+
/**
|
|
46
|
+
* List all agents via CLI command
|
|
47
|
+
*
|
|
48
|
+
* Retrieves and displays all available agents in a formatted table showing
|
|
49
|
+
* their ID, name, description, status, and creation date.
|
|
50
|
+
*
|
|
51
|
+
* @returns An Effect that resolves when the agents are listed successfully
|
|
52
|
+
*
|
|
53
|
+
* @throws {StorageError} When there's an error accessing storage
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```typescript
|
|
57
|
+
* yield* listAgentsCommand();
|
|
58
|
+
* // Output: Table showing all agents with their details
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export declare function listAgentsCommand(): Effect.Effect<void, StorageError, AgentService>;
|
|
62
|
+
/**
|
|
63
|
+
* Run an agent via CLI command
|
|
64
|
+
*
|
|
65
|
+
* Executes the specified agent, including all its configured tasks. Supports
|
|
66
|
+
* dry-run mode for testing and watch mode for continuous execution. For Gmail
|
|
67
|
+
* tasks, it displays formatted email results including subject, sender, date,
|
|
68
|
+
* and snippet information.
|
|
69
|
+
*
|
|
70
|
+
* @param agentId - The unique identifier of the agent to run
|
|
71
|
+
* @param options - Execution options including watch and dry-run modes
|
|
72
|
+
* @returns An Effect that resolves when the agent execution completes
|
|
73
|
+
*
|
|
74
|
+
* @throws {StorageError} When there's an error accessing storage
|
|
75
|
+
* @throws {StorageNotFoundError} When the agent with the given ID doesn't exist
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```typescript
|
|
79
|
+
* yield* runAgentCommand("agent-123", { dryRun: true });
|
|
80
|
+
* // Output: Shows what would be executed without actually running
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
export declare function runAgentCommand(agentId: string, options: {
|
|
84
|
+
watch?: boolean;
|
|
85
|
+
dryRun?: boolean;
|
|
86
|
+
}): Effect.Effect<void, StorageError | StorageNotFoundError, AgentService | GmailService>;
|
|
87
|
+
/**
|
|
88
|
+
* Delete an agent via CLI command
|
|
89
|
+
*
|
|
90
|
+
* Removes the specified agent from storage after confirming the deletion.
|
|
91
|
+
* This operation is irreversible and will permanently delete the agent
|
|
92
|
+
* and all its associated data.
|
|
93
|
+
*
|
|
94
|
+
* @param agentId - The unique identifier of the agent to delete
|
|
95
|
+
* @returns An Effect that resolves when the agent is deleted successfully
|
|
96
|
+
*
|
|
97
|
+
* @throws {StorageError} When there's an error accessing storage
|
|
98
|
+
* @throws {StorageNotFoundError} When the agent with the given ID doesn't exist
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```typescript
|
|
102
|
+
* yield* deleteAgentCommand("agent-123");
|
|
103
|
+
* // Output: Confirmation message and deletion success
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
export declare function deleteAgentCommand(agentId: string): Effect.Effect<void, StorageError | StorageNotFoundError, AgentService>;
|
|
107
|
+
/**
|
|
108
|
+
* Get agent details via CLI command
|
|
109
|
+
*
|
|
110
|
+
* Retrieves and displays detailed information about a specific agent including
|
|
111
|
+
* its configuration, tasks, and metadata in a formatted output.
|
|
112
|
+
*
|
|
113
|
+
* @param agentId - The unique identifier of the agent to retrieve
|
|
114
|
+
* @returns An Effect that resolves when the agent details are displayed
|
|
115
|
+
*
|
|
116
|
+
* @throws {StorageError} When there's an error accessing storage
|
|
117
|
+
* @throws {StorageNotFoundError} When the agent with the given ID doesn't exist
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```typescript
|
|
121
|
+
* yield* getAgentCommand("agent-123");
|
|
122
|
+
* // Output: Detailed agent information including config and tasks
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
export declare function getAgentCommand(agentId: string): Effect.Effect<void, StorageError | StorageNotFoundError, AgentService>;
|
|
126
|
+
//# sourceMappingURL=task-agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-agent.d.ts","sourceRoot":"","sources":["../../../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