@gethmy/agent 1.10.3 → 1.10.4

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.js CHANGED
@@ -399,6 +399,11 @@ var init_types = __esm(() => {
399
399
  model: "opus",
400
400
  escalateModel: "claude-fable-5",
401
401
  escalateAfterAttempts: 2,
402
+ tiers: {
403
+ simple: "claude-haiku-4-5",
404
+ advanced: "claude-sonnet-4-6",
405
+ research: "claude-opus-4-8"
406
+ },
402
407
  reviewModel: "sonnet",
403
408
  maxTurns: 80,
404
409
  reviewMaxTurns: 60,
@@ -3434,6 +3439,19 @@ var init_review_completion = __esm(() => {
3434
3439
 
3435
3440
  // ../harmony-shared/dist/cardLinks.js
3436
3441
  var init_cardLinks = () => {};
3442
+ // ../harmony-shared/dist/classification.js
3443
+ function escalateTier(tier) {
3444
+ const i = MODEL_TIERS.indexOf(tier);
3445
+ return MODEL_TIERS[Math.min(i + 1, MODEL_TIERS.length - 1)];
3446
+ }
3447
+ function isModelTier(v) {
3448
+ return typeof v === "string" && MODEL_TIERS.includes(v);
3449
+ }
3450
+ var MODEL_TIERS;
3451
+ var init_classification = __esm(() => {
3452
+ MODEL_TIERS = ["simple", "advanced", "research"];
3453
+ });
3454
+
3437
3455
  // ../harmony-shared/dist/commentSerializer.js
3438
3456
  function sanitizeHeaderField(value) {
3439
3457
  return value.replace(/[\]\r\n|<>]/g, " ").trim() || "—";
@@ -3645,6 +3663,7 @@ var init_types2 = () => {};
3645
3663
  // ../harmony-shared/dist/index.js
3646
3664
  var init_dist = __esm(() => {
3647
3665
  init_cardLinks();
3666
+ init_classification();
3648
3667
  init_commentSerializer();
3649
3668
  init_constants();
3650
3669
  init_logger();
@@ -4930,11 +4949,31 @@ var init_unblock = __esm(() => {
4930
4949
  });
4931
4950
 
4932
4951
  // src/model-tier.ts
4933
- function chooseImplementModel(claude, priority, attempts) {
4934
- const highPriority = priority === "high" || priority === "urgent";
4952
+ function chooseImplementModel(claude, card, attempts) {
4953
+ if (card.model_override) {
4954
+ return { model: card.model_override, escalated: false, source: "override" };
4955
+ }
4956
+ if (isModelTier(card.model_tier)) {
4957
+ const retry = attempts >= claude.escalateAfterAttempts;
4958
+ const tier = retry ? escalateTier(card.model_tier) : card.model_tier;
4959
+ const mapped = claude.tiers?.[tier];
4960
+ return {
4961
+ model: mapped && mapped.length > 0 ? mapped : claude.model,
4962
+ escalated: retry,
4963
+ source: "tier"
4964
+ };
4965
+ }
4966
+ const highPriority = card.priority === "high" || card.priority === "urgent";
4935
4967
  const escalated = highPriority || attempts >= claude.escalateAfterAttempts;
4936
- return { model: escalated ? claude.escalateModel : claude.model, escalated };
4968
+ return {
4969
+ model: escalated ? claude.escalateModel : claude.model,
4970
+ escalated,
4971
+ source: "policy"
4972
+ };
4937
4973
  }
4974
+ var init_model_tier = __esm(() => {
4975
+ init_dist();
4976
+ });
4938
4977
 
4939
4978
  // src/prompt.ts
4940
4979
  async function buildPrompt(enriched, branchName, worktreePath, client, workspaceId, projectId) {
@@ -5377,9 +5416,9 @@ class Worker {
5377
5416
  }
5378
5417
  selectImplementModel(card) {
5379
5418
  const attempts = this.stateStore.getCard(card.id)?.attempts ?? 1;
5380
- const { model, escalated } = chooseImplementModel(this.config.claude, card.priority, attempts);
5381
- if (escalated) {
5382
- log.info(this.tag, `Escalating implement model to "${model}" (attempts=${attempts}, priority=${card.priority ?? "none"})`);
5419
+ const { model, escalated, source } = chooseImplementModel(this.config.claude, card, attempts);
5420
+ if (source !== "policy" || escalated) {
5421
+ log.info(this.tag, `Implement model "${model}" (source=${source}, escalated=${escalated}, attempts=${attempts}, priority=${card.priority ?? "none"}, tier=${card.model_tier ?? "none"})`);
5383
5422
  }
5384
5423
  return model;
5385
5424
  }
@@ -5715,6 +5754,7 @@ var init_worker = __esm(() => {
5715
5754
  init_completion();
5716
5755
  init_error_classifier();
5717
5756
  init_log();
5757
+ init_model_tier();
5718
5758
  init_plan_phase();
5719
5759
  init_process_group();
5720
5760
  init_progress_tracker();
package/dist/index.js CHANGED
@@ -398,6 +398,11 @@ var init_types = __esm(() => {
398
398
  model: "opus",
399
399
  escalateModel: "claude-fable-5",
400
400
  escalateAfterAttempts: 2,
401
+ tiers: {
402
+ simple: "claude-haiku-4-5",
403
+ advanced: "claude-sonnet-4-6",
404
+ research: "claude-opus-4-8"
405
+ },
401
406
  reviewModel: "sonnet",
402
407
  maxTurns: 80,
403
408
  reviewMaxTurns: 60,
@@ -3433,6 +3438,19 @@ var init_review_completion = __esm(() => {
3433
3438
 
3434
3439
  // ../harmony-shared/dist/cardLinks.js
3435
3440
  var init_cardLinks = () => {};
3441
+ // ../harmony-shared/dist/classification.js
3442
+ function escalateTier(tier) {
3443
+ const i = MODEL_TIERS.indexOf(tier);
3444
+ return MODEL_TIERS[Math.min(i + 1, MODEL_TIERS.length - 1)];
3445
+ }
3446
+ function isModelTier(v) {
3447
+ return typeof v === "string" && MODEL_TIERS.includes(v);
3448
+ }
3449
+ var MODEL_TIERS;
3450
+ var init_classification = __esm(() => {
3451
+ MODEL_TIERS = ["simple", "advanced", "research"];
3452
+ });
3453
+
3436
3454
  // ../harmony-shared/dist/commentSerializer.js
3437
3455
  function sanitizeHeaderField(value) {
3438
3456
  return value.replace(/[\]\r\n|<>]/g, " ").trim() || "—";
@@ -3644,6 +3662,7 @@ var init_types2 = () => {};
3644
3662
  // ../harmony-shared/dist/index.js
3645
3663
  var init_dist = __esm(() => {
3646
3664
  init_cardLinks();
3665
+ init_classification();
3647
3666
  init_commentSerializer();
3648
3667
  init_constants();
3649
3668
  init_logger();
@@ -4929,11 +4948,31 @@ var init_unblock = __esm(() => {
4929
4948
  });
4930
4949
 
4931
4950
  // src/model-tier.ts
4932
- function chooseImplementModel(claude, priority, attempts) {
4933
- const highPriority = priority === "high" || priority === "urgent";
4951
+ function chooseImplementModel(claude, card, attempts) {
4952
+ if (card.model_override) {
4953
+ return { model: card.model_override, escalated: false, source: "override" };
4954
+ }
4955
+ if (isModelTier(card.model_tier)) {
4956
+ const retry = attempts >= claude.escalateAfterAttempts;
4957
+ const tier = retry ? escalateTier(card.model_tier) : card.model_tier;
4958
+ const mapped = claude.tiers?.[tier];
4959
+ return {
4960
+ model: mapped && mapped.length > 0 ? mapped : claude.model,
4961
+ escalated: retry,
4962
+ source: "tier"
4963
+ };
4964
+ }
4965
+ const highPriority = card.priority === "high" || card.priority === "urgent";
4934
4966
  const escalated = highPriority || attempts >= claude.escalateAfterAttempts;
4935
- return { model: escalated ? claude.escalateModel : claude.model, escalated };
4967
+ return {
4968
+ model: escalated ? claude.escalateModel : claude.model,
4969
+ escalated,
4970
+ source: "policy"
4971
+ };
4936
4972
  }
4973
+ var init_model_tier = __esm(() => {
4974
+ init_dist();
4975
+ });
4937
4976
 
4938
4977
  // src/prompt.ts
4939
4978
  async function buildPrompt(enriched, branchName, worktreePath, client, workspaceId, projectId) {
@@ -5376,9 +5415,9 @@ class Worker {
5376
5415
  }
5377
5416
  selectImplementModel(card) {
5378
5417
  const attempts = this.stateStore.getCard(card.id)?.attempts ?? 1;
5379
- const { model, escalated } = chooseImplementModel(this.config.claude, card.priority, attempts);
5380
- if (escalated) {
5381
- log.info(this.tag, `Escalating implement model to "${model}" (attempts=${attempts}, priority=${card.priority ?? "none"})`);
5418
+ const { model, escalated, source } = chooseImplementModel(this.config.claude, card, attempts);
5419
+ if (source !== "policy" || escalated) {
5420
+ log.info(this.tag, `Implement model "${model}" (source=${source}, escalated=${escalated}, attempts=${attempts}, priority=${card.priority ?? "none"}, tier=${card.model_tier ?? "none"})`);
5382
5421
  }
5383
5422
  return model;
5384
5423
  }
@@ -5714,6 +5753,7 @@ var init_worker = __esm(() => {
5714
5753
  init_completion();
5715
5754
  init_error_classifier();
5716
5755
  init_log();
5756
+ init_model_tier();
5717
5757
  init_plan_phase();
5718
5758
  init_process_group();
5719
5759
  init_progress_tracker();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gethmy/agent",
3
- "version": "1.10.3",
3
+ "version": "1.10.4",
4
4
  "description": "Push-based agent daemon for Harmony — watches board assignments and spawns Claude CLI workers",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",