@indigoai-us/hq-cli 5.345.58 → 5.345.59

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 (40) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/command-catalog.generated.d.ts +8 -0
  3. package/dist/command-catalog.generated.js +10 -0
  4. package/dist/commands/agent-kit.js +20 -10
  5. package/dist/commands/billing.d.ts +13 -0
  6. package/dist/commands/billing.js +31 -0
  7. package/dist/commands/db-dump.js +2 -2
  8. package/dist/commands/db-remote-deps.js +6 -0
  9. package/dist/commands/lanes-loop.js +3 -1
  10. package/dist/commands/lanes-questions.js +16 -0
  11. package/dist/commands/lanes-session-start.js +19 -3
  12. package/dist/commands/lanes-shared.d.ts +1 -0
  13. package/dist/commands/lanes.d.ts +3 -1
  14. package/dist/commands/lanes.js +52 -2
  15. package/dist/lib/agent-kit/inbox-poll-backoff-flag.d.ts +19 -0
  16. package/dist/lib/agent-kit/inbox-poll-backoff-flag.js +70 -0
  17. package/dist/lib/agent-kit/run/inbox.d.ts +7 -3
  18. package/dist/lib/agent-kit/run/inbox.js +45 -6
  19. package/dist/lib/agent-kit/run/stop-signals.d.ts +14 -0
  20. package/dist/lib/agent-kit/run/stop-signals.js +26 -0
  21. package/dist/lib/agent-kit/services.d.ts +2 -2
  22. package/dist/lib/agent-kit/services.js +5 -3
  23. package/dist/lib/anywhere-runtime-flag-key.d.ts +1 -0
  24. package/dist/lib/anywhere-runtime-flag-key.js +1 -0
  25. package/dist/lib/anywhere-runtime-revocation-marker.d.ts +4 -0
  26. package/dist/lib/anywhere-runtime-revocation-marker.js +26 -0
  27. package/dist/lib/daemon/run.d.ts +2 -0
  28. package/dist/lib/daemon/run.js +17 -4
  29. package/dist/lib/daemon/server.js +7 -0
  30. package/dist/lib/db/control-plane.d.ts +12 -1
  31. package/dist/lib/db/usage-format.d.ts +2 -1
  32. package/dist/lib/db/usage-format.js +19 -0
  33. package/dist/lib/install/provider-wrappers.js +13 -0
  34. package/dist/lib/lanes/loop.d.ts +23 -1
  35. package/dist/lib/lanes/loop.js +134 -19
  36. package/dist/lib/lanes/questions.d.ts +5 -0
  37. package/dist/lib/lanes/reconcile.js +3 -0
  38. package/dist/lib/lanes/story-ledger.js +30 -20
  39. package/dist/lib/lanes/types.js +1 -1
  40. package/package.json +1 -1
@@ -9,7 +9,8 @@ const LOCK_TIMEOUT_MS = 10_000;
9
9
  const LOCK_STALE_MS = 60_000;
10
10
  const LOCK_RETRY_MS = 10;
11
11
  const STORY_STATES = ["todo", "in_progress", "review", "waiting", "blocked", "done", "dropped"];
12
- const MANAGER_OWNED_STATES = new Set(["review", "done", "dropped"]);
12
+ const LEAD_CONTROLLED_STATES = new Set(["waiting", "blocked", "dropped"]);
13
+ const STORY_STATE_ORDER = ["todo", "in_progress", "review", "done"];
13
14
  const TERMINAL_STATES = new Set(["done", "failed", "interrupted", "cancelled", "killed"]);
14
15
  function projectFocusOverrides(value) {
15
16
  if (value === undefined)
@@ -561,6 +562,13 @@ function validPriorQuestions(value, storyId) {
561
562
  }
562
563
  return value;
563
564
  }
565
+ function canonicalStoryState(value) {
566
+ if (value === "in_review" || value === "verification")
567
+ return "review";
568
+ return typeof value === "string" && STORY_STATES.includes(value)
569
+ ? value
570
+ : undefined;
571
+ }
564
572
  function setLaneStatusFields(story, lane, laneStoryStatus, isCurrentAttribution) {
565
573
  const laneStatus = story.lane_status;
566
574
  if (laneStatus !== undefined && !isJsonObject(laneStatus)) {
@@ -615,29 +623,31 @@ function setLaneStatusFields(story, lane, laneStoryStatus, isCurrentAttribution)
615
623
  else {
616
624
  delete story.pending_questions;
617
625
  }
618
- if (story.state === "in_review" || story.state === "verification") {
619
- story.state = "review";
620
- }
621
- if (MANAGER_OWNED_STATES.has(String(story.state))) {
622
- // A manager decision always wins over lane-derived status.
623
- }
624
- else if (blockers.length > 0) {
625
- story.state = "blocked";
626
- }
627
- else if (laneStoryStatus === "review") {
628
- story.state = "review";
629
- }
630
- else if (laneStoryStatus === "done") {
626
+ const currentState = canonicalStoryState(story.state) ?? canonicalStoryState(story.status);
627
+ const currentStates = currentState === undefined ? [] : [currentState];
628
+ const laneProgressState = laneStoryStatus === "review"
629
+ ? "review"
630
+ : laneStoryStatus === "done"
631
+ ? "done"
632
+ : laneStoryStatus === "in_progress" || lane.state === "queued" || lane.state === "running" || lane.state === "awaiting_input"
633
+ ? "in_progress"
634
+ : undefined;
635
+ const currentProgressState = STORY_STATE_ORDER.reduce((highest, state) => currentStates.includes(state) || laneProgressState === state ? state : highest, undefined);
636
+ const laneManagedBlocked = isJsonObject(laneStatus) && isJsonObject(laneStatus.saved);
637
+ const leadControlledState = currentStates.find((state) => LEAD_CONTROLLED_STATES.has(state) && !(state === "blocked" && laneManagedBlocked));
638
+ if (currentStates.includes("done"))
631
639
  story.state = "done";
640
+ else if (leadControlledState !== undefined)
641
+ story.state = leadControlledState;
642
+ else if (blockers.length > 0 && currentProgressState !== "review" && currentProgressState !== "done") {
643
+ story.state = "blocked";
632
644
  }
633
- else if (laneStoryStatus === "in_progress" || lane.state === "queued" || lane.state === "running" || lane.state === "awaiting_input") {
634
- story.state = "in_progress";
645
+ else if (currentProgressState !== undefined) {
646
+ story.state = currentProgressState;
635
647
  }
636
648
  else if (saved !== undefined && story.state === "blocked") {
637
- const previous = saved.state;
638
- story.state = typeof previous === "string" && STORY_STATES.includes(previous)
639
- ? previous
640
- : "in_progress";
649
+ const previous = canonicalStoryState(saved.state);
650
+ story.state = previous ?? "in_progress";
641
651
  }
642
652
  if (typeof story.state === "string" && STORY_STATES.includes(story.state)) {
643
653
  story.status = story.state;
@@ -236,7 +236,7 @@ export const LANE_FIELD_WRITERS = {
236
236
  priority: ["command"], worker: ["creator", "command"], worker_path: ["creator", "command"], worker_pack: ["creator", "command"], worker_profile: ["creator", "command"], worker_profile_hash: ["creator", "command", "spawn"], registry_worker: ["creator", "command", "spawn"], registry_worker_approval_history: ["command", "watcher", "reconcile"], worker_profile_repin_history: ["command"], worker_profile_ignored: ["creator", "command", "spawn"], worker_policy_delivery: ["command", "spawn"],
237
237
  keep_alive: ["creator", "command"], keep_alive_standing: ["command"], keep_alive_opted_in_at: ["creator", "command"], keep_alive_blocked_reason: ["command", "reconcile"], keep_alive_resume_count: ["command", "reconcile", "spawn"], keep_alive_history: ["reconcile"], keep_alive_blocked_resume_streak: ["reconcile", "spawn", "watcher"], keep_alive_last_resume_at: ["command", "reconcile", "spawn"], keep_alive_next_eligible_at: ["command", "reconcile", "spawn"], keep_alive_exhausted_at: ["command", "reconcile", "spawn"], loop_mode: ["creator"],
238
238
  provider: ["creator", "command"], provider_source: ["creator", "command"], account: ["creator", "spawn", "command", "watcher", "reconcile"], account_source: ["creator", "command"], profile_settings_pinned: ["command"], account_selection: ["creator", "command"], admission_accounts: ["creator", "command"], account_history: ["command", "spawn", "watcher", "reconcile"], failed_resume_history: ["command"], fallback_question_cancellation_failures: ["command"], pending_resume: ["command", "spawn", "watcher", "reconcile"], placement_default: ["creator"], host: ["creator", "command"], origin_host: ["creator"], origin_host_source: ["creator"],
239
- version: ["creator"], created_at: ["creator"], updated_at: ["creator"], ended_at: ["reconcile"], envelope_summary: ["reconcile"], attribution_history: ["command", "watcher", "reconcile"], story_switch_pending: ["command", "watcher", "reconcile"], story_switch_unacknowledged: ["watcher", "reconcile"],
239
+ version: ["creator"], created_at: ["creator"], updated_at: ["creator"], ended_at: ["reconcile"], envelope_summary: ["reconcile"], attribution_history: ["command", "watcher", "reconcile"], story_switch_pending: ["command", "watcher", "reconcile"], story_switch_unacknowledged: ["command", "watcher", "reconcile"],
240
240
  last_envelope: ["watcher", "reconcile"], model: ["creator", "spawn", "command"], model_source: ["creator", "spawn", "command"], effort: ["creator", "spawn", "command"], effort_source: ["creator", "spawn", "command"], fast_mode: ["spawn"],
241
241
  last_message_at: ["creator", "command"], status_gate: ["spawn", "watcher"], status_gate_history: ["watcher", "reconcile"], blocker_freshness_state: ["watcher"], kr_freshness_state: ["watcher"], last_compaction: ["spawn"], story_complete: ["watcher", "reconcile"], story_complete_reason: ["watcher", "reconcile"], story_status: ["watcher", "reconcile"],
242
242
  overdue: ["reconcile"], overdue_at: ["reconcile"], last_host_report_at: ["watcher", "spawn", "reconcile"], stalled: ["watcher"], stalled_at: ["watcher"], stalled_reason: ["watcher"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indigoai-us/hq-cli",
3
- "version": "5.345.58",
3
+ "version": "5.345.59",
4
4
  "description": "HQ by Indigo management CLI — modules and cloud sync",
5
5
  "main": "dist/index.js",
6
6
  "bin": {