@polka-codes/cli 0.6.6 → 0.6.7

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 (2) hide show
  1. package/dist/index.js +11 -11
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -24629,7 +24629,7 @@ var {
24629
24629
  Help
24630
24630
  } = import__.default;
24631
24631
  // package.json
24632
- var version = "0.6.6";
24632
+ var version = "0.6.7";
24633
24633
 
24634
24634
  // ../../node_modules/@anthropic-ai/sdk/version.mjs
24635
24635
  var VERSION = "0.36.2";
@@ -45368,6 +45368,7 @@ var agentSchema = providerModelSchema.extend({
45368
45368
  }).optional()
45369
45369
  });
45370
45370
  var configSchema = z2.object({
45371
+ agent: z2.string().optional(),
45371
45372
  providers: z2.record(z2.string(), z2.object({
45372
45373
  apiKey: z2.string().optional(),
45373
45374
  defaultModel: z2.string().optional()
@@ -45491,7 +45492,7 @@ function getEnv(override) {
45491
45492
 
45492
45493
  // src/options.ts
45493
45494
  function addSharedOptions(command) {
45494
- return command.option("-c --config <paths>", "Path to config file(s)", (value, prev) => prev.concat(value), []).option("--api-provider <provider>", "API provider").option("--model <model>", "Model ID").option("--api-key <key>", "API key").option("--max-messages <iterations>", "Maximum number of messages to send. Default to 50", Number.parseInt, 50).option("--budget <budget>", "Budget for the AI service. Default to $10", Number.parseFloat).option("-v --verbose", "Enable verbose output. Use -v for level 1, -vv for level 2", (value, prev) => prev + 1, 0).option("-d --base-dir <path>", "Base directory to run commands in");
45495
+ return command.option("-c --config <paths>", "Path to config file(s)", (value, prev) => prev.concat(value), []).option("--api-provider <provider>", "API provider").option("--model <model>", "Model ID").option("--api-key <key>", "API key").option("--max-messages <iterations>", "Maximum number of messages to send. Default to 50", Number.parseInt, 50).option("--budget <budget>", "Budget for the AI service. Default to $10", Number.parseFloat).option("-v --verbose", "Enable verbose output. Use -v for level 1, -vv for level 2", (value, prev) => prev + 1, 0).option("-d --base-dir <path>", "Base directory to run commands in").option("--agent <agent>", "Initial agent to use (default: architect)");
45495
45496
  }
45496
45497
  function parseOptions(options, cwdArg, home = os2.homedir(), env = getEnv()) {
45497
45498
  let cwd = cwdArg;
@@ -45533,7 +45534,8 @@ function parseOptions(options, cwdArg, home = os2.homedir(), env = getEnv()) {
45533
45534
  budget: options.budget ?? (env.POLKA_BUDGET ? Number.parseFloat(env.POLKA_BUDGET) : undefined) ?? config.budget ?? 10,
45534
45535
  verbose: options.verbose ?? 0,
45535
45536
  config,
45536
- providerConfig
45537
+ providerConfig,
45538
+ agent: options.agent ?? config.agent ?? "architect"
45537
45539
  };
45538
45540
  }
45539
45541
 
@@ -46129,13 +46131,12 @@ ${event.systemPrompt}`);
46129
46131
  // src/commands/chat.ts
46130
46132
  var runChat = async (opts, command) => {
46131
46133
  const options = command?.parent?.opts() ?? opts ?? {};
46132
- const { config, providerConfig, maxMessageCount, verbose, budget } = parseOptions(options);
46134
+ const { config, providerConfig, maxMessageCount, verbose, budget, agent } = parseOptions(options);
46133
46135
  if (!process.stdin.isTTY) {
46134
46136
  console.error("Error: Terminal is not interactive. Please run this command in an interactive terminal.");
46135
46137
  process.exit(1);
46136
46138
  }
46137
- const startAgent = architectAgentInfo.name;
46138
- let { provider: provider2, model, apiKey } = providerConfig.getConfigForAgent(startAgent) ?? {};
46139
+ let { provider: provider2, model, apiKey } = providerConfig.getConfigForAgent(agent) ?? {};
46139
46140
  if (!provider2) {
46140
46141
  const newConfig = await configPrompt({ provider: provider2, model, apiKey });
46141
46142
  provider2 = newConfig.provider;
@@ -46163,7 +46164,7 @@ var runChat = async (opts, command) => {
46163
46164
  const reason = await runner.continueTask(message);
46164
46165
  exitReason = reason;
46165
46166
  } else {
46166
- const reason = await runner.startTask(message);
46167
+ const reason = await runner.startTask(message, agent);
46167
46168
  exitReason = reason;
46168
46169
  }
46169
46170
  switch (exitReason.type) {
@@ -47191,9 +47192,8 @@ async function runTask(taskArg, _options, command) {
47191
47192
  process.exit(1);
47192
47193
  }
47193
47194
  }
47194
- const { config, providerConfig, verbose, maxMessageCount, budget } = parseOptions(command.opts());
47195
- const startAgent = architectAgentInfo.name;
47196
- const { provider: provider2, model } = providerConfig.getConfigForAgent(startAgent) ?? {};
47195
+ const { config, providerConfig, verbose, maxMessageCount, budget, agent } = parseOptions(command.opts());
47196
+ const { provider: provider2, model } = providerConfig.getConfigForAgent(agent) ?? {};
47197
47197
  if (!provider2 || !model) {
47198
47198
  console.error("Provider and model must be configured");
47199
47199
  process.exit(1);
@@ -47209,7 +47209,7 @@ async function runTask(taskArg, _options, command) {
47209
47209
  eventCallback: printEvent(verbose),
47210
47210
  enableCache: true
47211
47211
  });
47212
- await runner.startTask(task, startAgent);
47212
+ await runner.startTask(task, agent);
47213
47213
  runner.printUsage();
47214
47214
  }
47215
47215
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polka-codes/cli",
3
- "version": "0.6.6",
3
+ "version": "0.6.7",
4
4
  "license": "AGPL-3.0",
5
5
  "author": "github@polka.codes",
6
6
  "type": "module",