opencode-athena 0.12.0 → 0.12.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.
@@ -1204,7 +1204,7 @@ var GIT_WRITE_COMMANDS = [
1204
1204
  "git commit",
1205
1205
  "git push",
1206
1206
  "git checkout -b",
1207
- "git branch ",
1207
+ "git branch",
1208
1208
  "git switch -c",
1209
1209
  "git switch --create",
1210
1210
  "git merge",
@@ -1261,7 +1261,7 @@ function createToolHooks(ctx, tracker, config) {
1261
1261
  }
1262
1262
  };
1263
1263
  }
1264
- async function handleStoryLoaded(ctx, tracker, config, sessionID, output) {
1264
+ async function handleStoryLoaded(_ctx, tracker, config, _sessionID, output) {
1265
1265
  try {
1266
1266
  const result = JSON.parse(output.output);
1267
1267
  if (!result.storyId || !result.story) {
@@ -1286,7 +1286,6 @@ async function handleStoryLoaded(ctx, tracker, config, sessionID, output) {
1286
1286
  newTodos: newBmadTodos.length,
1287
1287
  totalTracked: mergedTodos.length
1288
1288
  });
1289
- await autoInjectTodos(ctx, sessionID, newBmadTodos);
1290
1289
  } else {
1291
1290
  log5.debug("No BMAD todos found in story", { storyId: result.storyId });
1292
1291
  }
@@ -1294,35 +1293,6 @@ async function handleStoryLoaded(ctx, tracker, config, sessionID, output) {
1294
1293
  log5.warn("Failed to process story for todo sync", { error: String(error) });
1295
1294
  }
1296
1295
  }
1297
- async function autoInjectTodos(ctx, sessionID, todos) {
1298
- const client = ctx.client;
1299
- const session = client?.session;
1300
- const updateFn = session?.update;
1301
- if (!updateFn) {
1302
- log5.debug("OpenCode client session.update API not available");
1303
- return;
1304
- }
1305
- try {
1306
- await updateFn({
1307
- path: { id: sessionID },
1308
- body: {
1309
- update: {
1310
- sessionUpdate: "plan",
1311
- entries: todos.map((todo) => ({
1312
- priority: todo.priority || "medium",
1313
- status: todo.status === "cancelled" ? "completed" : todo.status,
1314
- content: todo.content
1315
- }))
1316
- }
1317
- }
1318
- });
1319
- log5.debug("Auto-injected BMAD todos via OpenCode API", { count: todos.length });
1320
- } catch (error) {
1321
- log5.debug("Could not auto-inject todos (API call failed)", {
1322
- error: String(error)
1323
- });
1324
- }
1325
- }
1326
1296
  async function handleTodoWritten(ctx, tracker, config, output) {
1327
1297
  const todos = extractTodosFromOutput(output);
1328
1298
  if (!todos || todos.length === 0) {
@@ -5139,7 +5109,7 @@ async function analyzeStoryComplexity2(storyContent) {
5139
5109
  return {
5140
5110
  isSimple,
5141
5111
  reason: isSimple ? `Simple story: ${acceptanceCriteriaCount} ACs, CRUD-only, no security/data concerns` : `Complex story: ${acceptanceCriteriaCount} ACs, security=${hasSecurityConcerns}, data=${hasDataModelChanges}, API=${hasApiChanges}`,
5142
- recommendedModel: isSimple ? "anthropic/claude-3-5-haiku-20241022" : "openai/gpt-5.2",
5112
+ recommendedModel: "",
5143
5113
  factors: {
5144
5114
  acceptanceCriteriaCount,
5145
5115
  hasSecurityConcerns,
@@ -5150,7 +5120,7 @@ async function analyzeStoryComplexity2(storyContent) {
5150
5120
  };
5151
5121
  }
5152
5122
  function selectReviewModel(config, complexity) {
5153
- return complexity.isSimple ? "anthropic/claude-3-5-haiku-20241022" : config.models.oracle;
5123
+ return complexity.isSimple ? config.models.librarian : config.models.oracle;
5154
5124
  }
5155
5125
  function buildEpicReviewPrompt(epicNumber, storyContents, architectureContent) {
5156
5126
  const storiesText = storyContents.map((s) => `## Story ${s.id}
@@ -6974,7 +6944,43 @@ function mergeConfigs(...configs) {
6974
6944
  }
6975
6945
  }
6976
6946
  if (config.models) {
6977
- result.models = { ...result.models, ...config.models };
6947
+ if (config.models.sisyphus !== void 0) result.models.sisyphus = config.models.sisyphus;
6948
+ if (config.models.oracle !== void 0) result.models.oracle = config.models.oracle;
6949
+ if (config.models.librarian !== void 0) result.models.librarian = config.models.librarian;
6950
+ if (config.models.frontend !== void 0) result.models.frontend = config.models.frontend;
6951
+ if (config.models.documentWriter !== void 0)
6952
+ result.models.documentWriter = config.models.documentWriter;
6953
+ if (config.models.multimodalLooker !== void 0)
6954
+ result.models.multimodalLooker = config.models.multimodalLooker;
6955
+ if (config.models.settings !== void 0) {
6956
+ result.models.settings = result.models.settings || {};
6957
+ const resultSettings = result.models.settings;
6958
+ const configSettings = config.models.settings;
6959
+ for (const agentKey of [
6960
+ "sisyphus",
6961
+ "oracle",
6962
+ "librarian",
6963
+ "frontend",
6964
+ "documentWriter",
6965
+ "multimodalLooker"
6966
+ ]) {
6967
+ if (configSettings[agentKey] !== void 0) {
6968
+ resultSettings[agentKey] = {
6969
+ ...resultSettings[agentKey] || {},
6970
+ ...configSettings[agentKey]
6971
+ };
6972
+ }
6973
+ }
6974
+ if (configSettings.overrides !== void 0) {
6975
+ resultSettings.overrides = {
6976
+ ...resultSettings.overrides || {},
6977
+ ...configSettings.overrides
6978
+ };
6979
+ }
6980
+ }
6981
+ if (config.models.custom !== void 0) {
6982
+ result.models.custom = config.models.custom;
6983
+ }
6978
6984
  }
6979
6985
  if (config.bmad) {
6980
6986
  result.bmad = { ...result.bmad, ...config.bmad };
@@ -6985,6 +6991,29 @@ function mergeConfigs(...configs) {
6985
6991
  if (config.mcps) {
6986
6992
  result.mcps = { ...result.mcps, ...config.mcps };
6987
6993
  }
6994
+ if (config.routing) {
6995
+ if (config.routing.providerPriority !== void 0) {
6996
+ result.routing.providerPriority = config.routing.providerPriority;
6997
+ }
6998
+ if (config.routing.modelFamilyPriority !== void 0) {
6999
+ result.routing.modelFamilyPriority = {
7000
+ ...result.routing.modelFamilyPriority,
7001
+ ...config.routing.modelFamilyPriority
7002
+ };
7003
+ }
7004
+ if (config.routing.agentOverrides !== void 0) {
7005
+ result.routing.agentOverrides = {
7006
+ ...result.routing.agentOverrides,
7007
+ ...config.routing.agentOverrides
7008
+ };
7009
+ }
7010
+ if (config.routing.fallbackBehavior !== void 0) {
7011
+ result.routing.fallbackBehavior = {
7012
+ ...result.routing.fallbackBehavior,
7013
+ ...config.routing.fallbackBehavior
7014
+ };
7015
+ }
7016
+ }
6988
7017
  }
6989
7018
  return result;
6990
7019
  }