@ai-code-agents/cli 0.1.0-beta.1 → 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/dist/cli.cjs CHANGED
@@ -25,193 +25,159 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
25
25
 
26
26
  // src/cli.ts
27
27
  var import_extra_typings = require("@commander-js/extra-typings");
28
+ var import_cli_utils7 = require("@felixarntz/cli-utils");
28
29
  var import_dotenv = __toESM(require("dotenv"), 1);
29
30
 
30
- // src/util/logger.ts
31
- var import_node_util = require("util");
32
- var createStyledText = (style) => (text) => (0, import_node_util.styleText)(style, text);
33
- var formatBold = createStyledText("bold");
34
- var colorError = createStyledText("red");
35
- var colorWarning = createStyledText("yellowBright");
36
- var colorSuccess = createStyledText("green");
37
- var colorDebug = createStyledText("cyan");
38
- var formatLogMessage = (text, level) => {
39
- switch (level) {
40
- case 0 /* DEBUG */:
41
- return colorDebug(text);
42
- case 2 /* SUCCESS */:
43
- return formatBold(colorSuccess(`\u2705 ${text}`));
44
- case 3 /* WARN */:
45
- return formatBold(colorWarning(`\u26A0\uFE0F ${text}`));
46
- case 4 /* ERROR */:
47
- return formatBold(colorError(`\u274C ${text}`));
48
- default:
49
- return text;
50
- }
51
- };
52
- var DEFAULT_LOG_LEVEL = 1 /* INFO */;
53
- var CURRENT_LOG_LEVEL = process.env["NODE_ENV"] === "development" || process.env["DEBUG"] === "true" ? 0 /* DEBUG */ : process.env["SILENT"] === "true" ? 5 /* SILENT */ : DEFAULT_LOG_LEVEL;
54
- var Logger = class {
55
- /**
56
- * Logs a debug message.
57
- *
58
- * @param text - The message to log.
59
- */
60
- debug(text) {
61
- this.log(text, 0 /* DEBUG */);
62
- }
63
- /**
64
- * Logs an info message.
65
- *
66
- * @param text - The message to log.
67
- */
68
- info(text) {
69
- this.log(text, 1 /* INFO */);
70
- }
71
- /**
72
- * Logs a success message.
73
- *
74
- * @param text - The message to log.
75
- */
76
- success(text) {
77
- this.log(text, 2 /* SUCCESS */);
78
- }
79
- /**
80
- * Logs a warning message.
81
- *
82
- * @param text - The message to log.
83
- */
84
- warn(text) {
85
- this.log(text, 3 /* WARN */);
86
- }
87
- /**
88
- * Logs an error message.
89
- *
90
- * @param text - The message to log.
91
- */
92
- error(text) {
93
- this.log(text, 4 /* ERROR */);
94
- }
95
- /**
96
- * Logs a message with a log level.
97
- *
98
- * @param text - The message to log.
99
- * @param level - The log level. Defaults to LogLevel.INFO.
100
- */
101
- log(text, level = 1 /* INFO */) {
102
- if (level < CURRENT_LOG_LEVEL) {
103
- return;
31
+ // src/commands/docker-code-agent.ts
32
+ var import_ai_code_agents2 = require("ai-code-agents");
33
+ var import_cli_utils2 = require("@felixarntz/cli-utils");
34
+
35
+ // src/util/create-and-run-code-agent.ts
36
+ var import_ai_code_agents = require("ai-code-agents");
37
+ var import_cli_utils = require("@felixarntz/cli-utils");
38
+ var createAndRunCodeAgent = async (options6) => {
39
+ const {
40
+ environment,
41
+ environmentToolsDefinition,
42
+ model,
43
+ prompt,
44
+ system,
45
+ maxSteps = 10,
46
+ directory
47
+ } = options6;
48
+ const modelSuffix = model ? ` (using model ${model})` : "";
49
+ import_cli_utils.logger.debug(
50
+ `Running task prompt in ${environment.name} about code in ${directory}${modelSuffix}...`
51
+ );
52
+ const agent = (0, import_ai_code_agents.createCodeAgent)({
53
+ model,
54
+ environment,
55
+ environmentToolsDefinition,
56
+ maxSteps,
57
+ instructions: system,
58
+ logStep: (log) => {
59
+ import_cli_utils.logger.debug("\n" + log);
104
60
  }
105
- process.stderr.write(`${formatLogMessage(text, level)}
106
- `);
107
- }
61
+ });
62
+ const result = await agent.generate({ prompt });
63
+ const { text } = result;
64
+ (0, import_cli_utils.output)(text);
108
65
  };
109
- var logger = new Logger();
110
66
 
111
- // src/util/commander.ts
112
- var getArgs = (handlerArgs) => {
113
- if (handlerArgs.length <= 2) {
114
- return [];
67
+ // src/commands/docker-code-agent.ts
68
+ var name = "docker-code-agent";
69
+ var description = "Runs a code agent in a Docker container to perform a specified task.";
70
+ var actualOptions = [
71
+ {
72
+ argname: "-p, --prompt <prompt>",
73
+ description: "Task prompt for the agent",
74
+ required: true
75
+ },
76
+ {
77
+ argname: "-m, --model <model>",
78
+ description: "Model to use for the agent",
79
+ required: true
80
+ },
81
+ {
82
+ argname: "-d, --directory <directory>",
83
+ description: "Directory with the project to work on",
84
+ parse: (value) => (0, import_cli_utils2.normalizeAbsolutePath)(value),
85
+ required: true
86
+ },
87
+ {
88
+ argname: "-t, --tools <tools>",
89
+ description: "Tools to allow the agent to use in the environment",
90
+ choices: import_ai_code_agents2.EnvironmentToolSafetyLevels,
91
+ defaults: "readonly"
92
+ },
93
+ {
94
+ argname: "-i, --container-id <container-id>",
95
+ description: "ID of the Docker container",
96
+ required: true
97
+ },
98
+ {
99
+ argname: "-s, --system <system>",
100
+ description: "System instruction to guide the agent"
115
101
  }
116
- return handlerArgs.slice(0, -2).map(String);
117
- };
118
- var getOpt = (handlerArgs) => {
119
- if (handlerArgs.length <= 1) {
120
- return {};
102
+ ];
103
+ var options = (0, import_cli_utils2.injectFileOptionsForCommander)(actualOptions, [
104
+ "prompt",
105
+ "system"
106
+ ]).map((option) => (0, import_cli_utils2.stripOptionFieldsForCommander)(option));
107
+ var parseOptions = (opt) => {
108
+ const config = {
109
+ prompt: String(opt["prompt"]),
110
+ model: opt["model"] ? String(opt["model"]) : "",
111
+ containerId: String(opt["container-id"]),
112
+ directory: opt["directory"] ? String(opt["directory"]) : "",
113
+ tools: opt["tools"] ? opt["tools"] : "readonly"
114
+ };
115
+ if (opt["system"]) {
116
+ config.system = String(opt["system"]);
121
117
  }
122
- return handlerArgs[handlerArgs.length - 2];
118
+ return config;
123
119
  };
124
- var withOptions = (command, options2) => {
125
- options2.forEach(
126
- ({
127
- description: description2,
128
- argname,
129
- positional,
130
- required,
131
- defaults,
132
- choices,
133
- parse,
134
- variadic
135
- }) => {
136
- if (positional) {
137
- const variadicSuffix = variadic ? "..." : "";
138
- const argument = command.createArgument(
139
- required ? `<${argname}${variadicSuffix}>` : `[${argname}${variadicSuffix}]`,
140
- description2
141
- );
142
- if (defaults) {
143
- argument.default(defaults);
144
- }
145
- if (typeof parse === "function") {
146
- argument.argParser(parse);
147
- }
148
- if (choices) {
149
- argument.choices(choices);
150
- }
151
- command.addArgument(argument);
152
- return;
153
- }
154
- const option = command.createOption(argname, description2);
155
- if (required) {
156
- option.makeOptionMandatory(true);
157
- }
158
- if (defaults) {
159
- option.default(defaults);
160
- }
161
- if (typeof parse === "function") {
162
- option.argParser(parse);
163
- }
164
- if (choices) {
165
- option.choices(choices);
166
- }
167
- command.addOption(option);
168
- }
120
+ var handler = async (...handlerArgs) => {
121
+ const { prompt, model, directory, tools, containerId, system } = parseOptions(
122
+ await (0, import_cli_utils2.promptMissingOptions)(
123
+ actualOptions,
124
+ await (0, import_cli_utils2.parseFileOptions)((0, import_cli_utils2.getOpt)(handlerArgs), ["prompt", "system"])
125
+ )
169
126
  );
170
- return command;
171
- };
172
- var withErrorHandling = (handler2) => async (...handlerArgs) => {
173
- try {
174
- const result = handler2(...handlerArgs);
175
- if (result instanceof Promise) {
176
- await result;
177
- }
178
- } catch (error) {
179
- if (error instanceof Error) {
180
- logger.error(error.message);
181
- }
182
- process.exitCode = 1;
183
- }
127
+ await createAndRunCodeAgent({
128
+ environment: (0, import_ai_code_agents2.createEnvironment)("docker", {
129
+ directoryPath: directory,
130
+ containerId
131
+ }),
132
+ environmentToolsDefinition: tools,
133
+ model,
134
+ prompt,
135
+ system,
136
+ directory
137
+ });
184
138
  };
185
139
 
186
- // src/commands/code-agent.ts
187
- var import_ai_code_agents = require("ai-code-agents");
140
+ // src/commands/just-bash-code-agent.ts
141
+ var import_ai_code_agents4 = require("ai-code-agents");
142
+ var import_just_bash = require("@ai-code-agents/just-bash");
143
+ var import_cli_utils3 = require("@felixarntz/cli-utils");
188
144
 
189
- // src/util/paths.ts
145
+ // src/util/read-local-directory-files.ts
190
146
  var import_node_path = __toESM(require("path"), 1);
191
- function normalizeAbsolutePath(filePath, rootDir = void 0) {
192
- if (!rootDir) {
193
- rootDir = process.cwd();
147
+ var import_ai_code_agents3 = require("ai-code-agents");
148
+ var readLocalDirectoryFiles = async (directoryPath) => {
149
+ const env = new import_ai_code_agents3.UnsafeLocalEnvironment({ directoryPath });
150
+ const getProjectFileStructureTool = new import_ai_code_agents3.GetProjectFileStructureTool(env);
151
+ const readManyFilesTool = new import_ai_code_agents3.ReadManyFilesTool(env);
152
+ const { files } = await getProjectFileStructureTool.execute(
153
+ { excludeGitIgnored: true },
154
+ {}
155
+ );
156
+ if (files.length === 0) {
157
+ return {};
194
158
  }
195
- if (import_node_path.default.isAbsolute(filePath)) {
196
- return filePath;
159
+ const readResult = await readManyFilesTool.execute(
160
+ { paths: files },
161
+ {}
162
+ );
163
+ const result = {};
164
+ for (const [, fileResult] of Object.entries(readResult)) {
165
+ const relativePath = import_node_path.default.relative(
166
+ directoryPath,
167
+ import_node_path.default.resolve(directoryPath, fileResult.path)
168
+ );
169
+ result[relativePath] = fileResult.content;
197
170
  }
198
- return import_node_path.default.join(rootDir, filePath);
199
- }
200
-
201
- // src/util/output.ts
202
- function output(text) {
203
- process.stdout.write(`${text}
204
- `);
205
- }
171
+ return result;
172
+ };
206
173
 
207
- // src/commands/code-agent.ts
208
- var name = "code-agent";
209
- var description = "Runs a code agent to perform a specified task.";
210
- var options = [
174
+ // src/commands/just-bash-code-agent.ts
175
+ var name2 = "just-bash-code-agent";
176
+ var description2 = "Runs a code agent using a simulated bash environment to perform a specified task.";
177
+ var actualOptions2 = [
211
178
  {
212
- argname: "task",
213
- description: "Task for the agent",
214
- positional: true,
179
+ argname: "-p, --prompt <prompt>",
180
+ description: "Task prompt for the agent",
215
181
  required: true
216
182
  },
217
183
  {
@@ -219,91 +185,289 @@ var options = [
219
185
  description: "Model to use for the agent",
220
186
  required: true
221
187
  },
222
- {
223
- argname: "-e, --environment <environment>",
224
- description: "Environment type to use",
225
- choices: import_ai_code_agents.EnvironmentNames,
226
- required: true
227
- },
228
188
  {
229
189
  argname: "-d, --directory <directory>",
230
190
  description: "Directory with the project to work on",
231
- parse: (value) => normalizeAbsolutePath(value),
191
+ parse: (value) => (0, import_cli_utils3.normalizeAbsolutePath)(value),
232
192
  required: true
233
193
  },
234
194
  {
235
195
  argname: "-t, --tools <tools>",
236
- description: "ID of the environment, if relevant (e.g. Docker container ID)",
237
- choices: import_ai_code_agents.EnvironmentToolSafetyLevels,
238
- default: "readonly"
196
+ description: "Tools to allow the agent to use in the environment",
197
+ choices: import_ai_code_agents4.EnvironmentToolSafetyLevels,
198
+ defaults: "readonly"
239
199
  },
240
200
  {
241
- argname: "-i, --environment-id <environment-id>",
242
- description: "ID of the environment, if relevant (e.g. Docker container ID)"
201
+ argname: "-l, --local-directory <local-directory>",
202
+ description: "Local directory to mount into the simulated environment (reads all files excluding gitignored)",
203
+ parse: (value) => (0, import_cli_utils3.normalizeAbsolutePath)(value)
243
204
  },
244
205
  {
245
206
  argname: "-s, --system <system>",
246
207
  description: "System instruction to guide the agent"
247
208
  }
248
209
  ];
249
- var parseOptions = (opt) => {
210
+ var options2 = (0, import_cli_utils3.injectFileOptionsForCommander)(actualOptions2, [
211
+ "prompt",
212
+ "system"
213
+ ]).map((option) => (0, import_cli_utils3.stripOptionFieldsForCommander)(option));
214
+ var parseOptions2 = (opt) => {
250
215
  const config = {
216
+ prompt: String(opt["prompt"]),
251
217
  model: opt["model"] ? String(opt["model"]) : "",
252
- environment: opt["environment"],
253
218
  directory: opt["directory"] ? String(opt["directory"]) : "",
254
219
  tools: opt["tools"] ? opt["tools"] : "readonly"
255
220
  };
256
- if (opt["environment-id"]) {
257
- config.environmentId = String(opt["environment-id"]);
221
+ if (opt["local-directory"]) {
222
+ config.localDirectory = String(opt["local-directory"]);
258
223
  }
259
224
  if (opt["system"]) {
260
225
  config.system = String(opt["system"]);
261
226
  }
262
227
  return config;
263
228
  };
264
- var handler = async (...handlerArgs) => {
265
- const [task] = getArgs(handlerArgs);
266
- const { model, environment, directory, tools, environmentId, system } = parseOptions(getOpt(handlerArgs));
267
- const modelSuffix = model ? ` (using model ${model})` : "";
268
- logger.debug(
269
- `Running task "${task}" in ${environment} about code in ${directory}${modelSuffix}...`
229
+ var handler2 = async (...handlerArgs) => {
230
+ const { prompt, model, directory, tools, localDirectory, system } = parseOptions2(
231
+ await (0, import_cli_utils3.promptMissingOptions)(
232
+ actualOptions2,
233
+ await (0, import_cli_utils3.parseFileOptions)((0, import_cli_utils3.getOpt)(handlerArgs), ["prompt", "system"])
234
+ )
270
235
  );
271
- const environmentConfig = createEnvironmentConfig(
272
- environment,
273
- directory,
274
- environmentId
236
+ const files = localDirectory ? await readLocalDirectoryFiles(localDirectory) : void 0;
237
+ await createAndRunCodeAgent({
238
+ environment: import_just_bash.JustBashEnvironment.create({
239
+ directoryPath: directory,
240
+ bashOptions: files ? { files } : void 0
241
+ }),
242
+ environmentToolsDefinition: tools,
243
+ model,
244
+ prompt,
245
+ system,
246
+ directory
247
+ });
248
+ };
249
+
250
+ // src/commands/mock-filesystem-code-agent.ts
251
+ var import_ai_code_agents5 = require("ai-code-agents");
252
+ var import_cli_utils4 = require("@felixarntz/cli-utils");
253
+ var name3 = "mock-filesystem-code-agent";
254
+ var description3 = "Runs a code agent on a mock filesystem to perform a specified task.";
255
+ var actualOptions3 = [
256
+ {
257
+ argname: "-p, --prompt <prompt>",
258
+ description: "Task prompt for the agent",
259
+ required: true
260
+ },
261
+ {
262
+ argname: "-m, --model <model>",
263
+ description: "Model to use for the agent",
264
+ required: true
265
+ },
266
+ {
267
+ argname: "-d, --directory <directory>",
268
+ description: "Directory with the project to work on",
269
+ parse: (value) => (0, import_cli_utils4.normalizeAbsolutePath)(value),
270
+ required: true
271
+ },
272
+ {
273
+ argname: "-t, --tools <tools>",
274
+ description: "Tools to allow the agent to use in the environment",
275
+ choices: import_ai_code_agents5.EnvironmentToolSafetyLevels,
276
+ defaults: "readonly"
277
+ },
278
+ {
279
+ argname: "-s, --system <system>",
280
+ description: "System instruction to guide the agent"
281
+ }
282
+ ];
283
+ var options3 = (0, import_cli_utils4.injectFileOptionsForCommander)(actualOptions3, [
284
+ "prompt",
285
+ "system"
286
+ ]).map((option) => (0, import_cli_utils4.stripOptionFieldsForCommander)(option));
287
+ var parseOptions3 = (opt) => {
288
+ const config = {
289
+ prompt: String(opt["prompt"]),
290
+ model: opt["model"] ? String(opt["model"]) : "",
291
+ directory: opt["directory"] ? String(opt["directory"]) : "",
292
+ tools: opt["tools"] ? opt["tools"] : "readonly"
293
+ };
294
+ if (opt["system"]) {
295
+ config.system = String(opt["system"]);
296
+ }
297
+ return config;
298
+ };
299
+ var handler3 = async (...handlerArgs) => {
300
+ const { prompt, model, directory, tools, system } = parseOptions3(
301
+ await (0, import_cli_utils4.promptMissingOptions)(
302
+ actualOptions3,
303
+ await (0, import_cli_utils4.parseFileOptions)((0, import_cli_utils4.getOpt)(handlerArgs), ["prompt", "system"])
304
+ )
275
305
  );
276
- const agent = (0, import_ai_code_agents.createCodeAgent)({
306
+ await createAndRunCodeAgent({
307
+ environment: (0, import_ai_code_agents5.createEnvironment)("mock-filesystem", {
308
+ directoryPath: directory
309
+ }),
310
+ environmentToolsDefinition: tools,
277
311
  model,
278
- environment: (0, import_ai_code_agents.createEnvironment)(environment, environmentConfig),
312
+ prompt,
313
+ system,
314
+ directory
315
+ });
316
+ };
317
+
318
+ // src/commands/node-filesystem-code-agent.ts
319
+ var import_ai_code_agents6 = require("ai-code-agents");
320
+ var import_cli_utils5 = require("@felixarntz/cli-utils");
321
+ var name4 = "node-filesystem-code-agent";
322
+ var description4 = "Runs a code agent locally using Node to perform a specified task.";
323
+ var actualOptions4 = [
324
+ {
325
+ argname: "-p, --prompt <prompt>",
326
+ description: "Task prompt for the agent",
327
+ required: true
328
+ },
329
+ {
330
+ argname: "-m, --model <model>",
331
+ description: "Model to use for the agent",
332
+ required: true
333
+ },
334
+ {
335
+ argname: "-d, --directory <directory>",
336
+ description: "Directory with the project to work on",
337
+ parse: (value) => (0, import_cli_utils5.normalizeAbsolutePath)(value),
338
+ required: true
339
+ },
340
+ {
341
+ argname: "-t, --tools <tools>",
342
+ description: "Tools to allow the agent to use in the environment",
343
+ choices: import_ai_code_agents6.EnvironmentToolSafetyLevels,
344
+ defaults: "readonly"
345
+ },
346
+ {
347
+ argname: "-s, --system <system>",
348
+ description: "System instruction to guide the agent"
349
+ }
350
+ ];
351
+ var options4 = (0, import_cli_utils5.injectFileOptionsForCommander)(actualOptions4, [
352
+ "prompt",
353
+ "system"
354
+ ]).map((option) => (0, import_cli_utils5.stripOptionFieldsForCommander)(option));
355
+ var parseOptions4 = (opt) => {
356
+ const config = {
357
+ prompt: String(opt["prompt"]),
358
+ model: opt["model"] ? String(opt["model"]) : "",
359
+ directory: opt["directory"] ? String(opt["directory"]) : "",
360
+ tools: opt["tools"] ? opt["tools"] : "readonly"
361
+ };
362
+ if (opt["system"]) {
363
+ config.system = String(opt["system"]);
364
+ }
365
+ return config;
366
+ };
367
+ var handler4 = async (...handlerArgs) => {
368
+ const { prompt, model, directory, tools, system } = parseOptions4(
369
+ await (0, import_cli_utils5.promptMissingOptions)(
370
+ actualOptions4,
371
+ await (0, import_cli_utils5.parseFileOptions)((0, import_cli_utils5.getOpt)(handlerArgs), ["prompt", "system"])
372
+ )
373
+ );
374
+ await createAndRunCodeAgent({
375
+ environment: (0, import_ai_code_agents6.createEnvironment)("node-filesystem", {
376
+ directoryPath: directory
377
+ }),
279
378
  environmentToolsDefinition: tools,
280
- maxSteps: 10,
281
- logStep: (log) => {
282
- logger.debug("\n" + log);
283
- },
284
- system
379
+ model,
380
+ prompt,
381
+ system,
382
+ directory
285
383
  });
286
- const result = await agent.generate({ prompt: task });
287
- const { text } = result;
288
- output(text);
289
384
  };
290
- var createEnvironmentConfig = (environment, directory, environmentId) => {
385
+
386
+ // src/commands/unsafe-local-code-agent.ts
387
+ var import_ai_code_agents7 = require("ai-code-agents");
388
+ var import_cli_utils6 = require("@felixarntz/cli-utils");
389
+ var name5 = "unsafe-local-code-agent";
390
+ var description5 = "Runs a code agent locally to perform a specified task.";
391
+ var actualOptions5 = [
392
+ {
393
+ argname: "-p, --prompt <prompt>",
394
+ description: "Task prompt for the agent",
395
+ required: true
396
+ },
397
+ {
398
+ argname: "-m, --model <model>",
399
+ description: "Model to use for the agent",
400
+ required: true
401
+ },
402
+ {
403
+ argname: "-d, --directory <directory>",
404
+ description: "Directory with the project to work on",
405
+ parse: (value) => (0, import_cli_utils6.normalizeAbsolutePath)(value),
406
+ required: true
407
+ },
408
+ {
409
+ argname: "-t, --tools <tools>",
410
+ description: "Tools to allow the agent to use in the environment",
411
+ choices: import_ai_code_agents7.EnvironmentToolSafetyLevels,
412
+ defaults: "readonly"
413
+ },
414
+ {
415
+ argname: "-s, --system <system>",
416
+ description: "System instruction to guide the agent"
417
+ }
418
+ ];
419
+ var options5 = (0, import_cli_utils6.injectFileOptionsForCommander)(actualOptions5, [
420
+ "prompt",
421
+ "system"
422
+ ]).map((option) => (0, import_cli_utils6.stripOptionFieldsForCommander)(option));
423
+ var parseOptions5 = (opt) => {
291
424
  const config = {
292
- directoryPath: directory
425
+ prompt: String(opt["prompt"]),
426
+ model: opt["model"] ? String(opt["model"]) : "",
427
+ directory: opt["directory"] ? String(opt["directory"]) : "",
428
+ tools: opt["tools"] ? opt["tools"] : "readonly"
293
429
  };
294
- if (environment === "docker" && environmentId) {
295
- return {
296
- ...config,
297
- containerId: environmentId
298
- };
430
+ if (opt["system"]) {
431
+ config.system = String(opt["system"]);
299
432
  }
300
433
  return config;
301
434
  };
435
+ var handler5 = async (...handlerArgs) => {
436
+ const { prompt, model, directory, tools, system } = parseOptions5(
437
+ await (0, import_cli_utils6.promptMissingOptions)(
438
+ actualOptions5,
439
+ await (0, import_cli_utils6.parseFileOptions)((0, import_cli_utils6.getOpt)(handlerArgs), ["prompt", "system"])
440
+ )
441
+ );
442
+ await createAndRunCodeAgent({
443
+ environment: (0, import_ai_code_agents7.createEnvironment)("unsafe-local", {
444
+ directoryPath: directory
445
+ }),
446
+ environmentToolsDefinition: tools,
447
+ model,
448
+ prompt,
449
+ system,
450
+ directory
451
+ });
452
+ };
302
453
 
303
454
  // src/cli.ts
304
455
  function initialize() {
305
456
  import_dotenv.default.config();
306
- withOptions(import_extra_typings.program.command(name), options).description(description).action(withErrorHandling(handler));
457
+ (0, import_cli_utils7.withOptions)(import_extra_typings.program.command(name), options).description(description).action((0, import_cli_utils7.withErrorHandling)(handler));
458
+ (0, import_cli_utils7.withOptions)(import_extra_typings.program.command(name2), options2).description(description2).action((0, import_cli_utils7.withErrorHandling)(handler2));
459
+ (0, import_cli_utils7.withOptions)(
460
+ import_extra_typings.program.command(name3),
461
+ options3
462
+ ).description(description3).action((0, import_cli_utils7.withErrorHandling)(handler3));
463
+ (0, import_cli_utils7.withOptions)(
464
+ import_extra_typings.program.command(name4),
465
+ options4
466
+ ).description(description4).action((0, import_cli_utils7.withErrorHandling)(handler4));
467
+ (0, import_cli_utils7.withOptions)(
468
+ import_extra_typings.program.command(name5),
469
+ options5
470
+ ).description(description5).action((0, import_cli_utils7.withErrorHandling)(handler5));
307
471
  }
308
472
  function run() {
309
473
  import_extra_typings.program.parse();