@pantheon.ai/agents 0.2.0 → 0.2.2

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 +6 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -396,7 +396,7 @@ var require_cli_options = /* @__PURE__ */ __commonJSMin(((exports, module) => {
396
396
 
397
397
  //#endregion
398
398
  //#region package.json
399
- var version = "0.2.0";
399
+ var version = "0.2.2";
400
400
 
401
401
  //#endregion
402
402
  //#region src/db/tidb.ts
@@ -721,7 +721,7 @@ function normalizeSkills(value) {
721
721
  function buildConfigSetupStep(options) {
722
722
  const prototypeRepoUrl = normalizeRepoUrl(options.prototypeRepoUrl);
723
723
  const skillsArg = JSON.stringify(options.skills.join(","));
724
- return `Execute shell: https://${prototypeRepoUrl.replace("github.com", "raw.githubusercontent.com")}/refs/heads/main/scripts/setup-${options.executeAgent}-agent.sh '${options.role}' '${skillsArg}' '${prototypeRepoUrl}'`;
724
+ return `Execute shell: ${prototypeRepoUrl.replace("github.com", "raw.githubusercontent.com")}/refs/heads/main/scripts/setup-${options.executeAgent}-agent.sh '${options.role}' '${skillsArg}' '${prototypeRepoUrl}'`;
725
725
  }
726
726
 
727
727
  //#endregion
@@ -2607,18 +2607,20 @@ async function configAgent(name, options) {
2607
2607
  if (!previousConfig) throw new Error(`Agent ${name} not configured for project ${options.projectId}.`);
2608
2608
  const task = await provider.getTask(options.taskId);
2609
2609
  if (!task) throw new Error(`Task ${options.taskId} not found.`);
2610
+ if (task.project_id !== options.projectId) throw new Error(`Task ${options.taskId} belongs to project ${task.project_id}, expected ${options.projectId}.`);
2610
2611
  if (task.type !== "default" || task.parent_task_id == null || task.status !== "completed") throw new Error(`Cannot use task ${options.taskId} (type = ${task.type}, type = ${task.status}) as configured base branch.`);
2612
+ const configuredBaseBranchId = task.branch_id;
2611
2613
  if (options.prompt) configTaskId = (await provider.createTask({
2612
2614
  task: options.prompt,
2613
2615
  project_id: options.projectId,
2614
- base_branch_id: baseBranchId,
2616
+ base_branch_id: configuredBaseBranchId,
2615
2617
  type: "reconfig",
2616
2618
  configVersion: previousConfig.config_version + 1
2617
2619
  })).id;
2618
2620
  else configTaskId = options.taskId;
2619
2621
  await provider.updateAgentConfig({
2620
2622
  project_id: previousConfig.project_id,
2621
- base_branch_id: previousConfig.base_branch_id,
2623
+ base_branch_id: configuredBaseBranchId,
2622
2624
  config_task_id: configTaskId,
2623
2625
  config_version: previousConfig.config_version + (options.prompt ? 2 : 1),
2624
2626
  concurrency,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pantheon.ai/agents",
3
3
  "type": "module",
4
- "version": "0.2.0",
4
+ "version": "0.2.2",
5
5
  "bin": {
6
6
  "pantheon-agents": "dist/index.js"
7
7
  },