panopticon-cli 0.5.3 → 0.5.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/index.js CHANGED
@@ -36,7 +36,7 @@ import {
36
36
  wakeSpecialist,
37
37
  wakeSpecialistOrQueue,
38
38
  wakeSpecialistWithTask
39
- } from "../chunk-2V2DQ3IX.js";
39
+ } from "../chunk-ID4OYXVH.js";
40
40
  import {
41
41
  cleanupTemplateFiles,
42
42
  ensureProjectCerts,
@@ -84,7 +84,7 @@ import {
84
84
  saveSessionId,
85
85
  spawnAgent,
86
86
  stopAgent
87
- } from "../chunk-D67AQTHF.js";
87
+ } from "../chunk-KY2E2Q3T.js";
88
88
  import {
89
89
  checkHook,
90
90
  clearHook,
@@ -2627,7 +2627,7 @@ async function doneCommand(id, options = {}) {
2627
2627
  const issueId = id.replace(/^agent-/i, "").toUpperCase();
2628
2628
  const agentId = `agent-${issueId.toLowerCase()}`;
2629
2629
  if (!options.force) {
2630
- const { getAgentState: getAgentState2 } = await import("../agents-DMPT32H7.js");
2630
+ const { getAgentState: getAgentState2 } = await import("../agents-HNMF52RM.js");
2631
2631
  const agentState = getAgentState2(agentId);
2632
2632
  const workspacePath = agentState?.workspace;
2633
2633
  if (workspacePath && existsSync13(workspacePath)) {
@@ -2726,7 +2726,7 @@ async function doneCommand(id, options = {}) {
2726
2726
  console.log(chalk12.dim(" LINEAR_API_KEY not set - skipping status update"));
2727
2727
  }
2728
2728
  }
2729
- const { getAgentState: getAgentState2, saveAgentState: saveAgentState2 } = await import("../agents-DMPT32H7.js");
2729
+ const { getAgentState: getAgentState2, saveAgentState: saveAgentState2 } = await import("../agents-HNMF52RM.js");
2730
2730
  const existingState = getAgentState2(agentId);
2731
2731
  if (existingState) {
2732
2732
  existingState.status = "stopped";
@@ -5271,7 +5271,7 @@ Previous state: ${issue.state}`
5271
5271
  console.log(chalk21.green(`\u2713 ${issue.identifier} reopened and ready for re-work`));
5272
5272
  console.log("");
5273
5273
  try {
5274
- const { getAgentState: getAgentState2 } = await import("../agents-DMPT32H7.js");
5274
+ const { getAgentState: getAgentState2 } = await import("../agents-HNMF52RM.js");
5275
5275
  const agentId = `agent-${id.toLowerCase()}`;
5276
5276
  const agentState = getAgentState2(agentId);
5277
5277
  const agentRunning = agentState?.status === "running" || agentState?.status === "starting";
@@ -11579,6 +11579,7 @@ var MERGE_STUCK_STALENESS_MS = 2 * 60 * 1e3;
11579
11579
  var MERGE_STUCK_COOLDOWN_MS = 10 * 60 * 1e3;
11580
11580
  var MERGE_STUCK_MAX_ATTEMPTS = 3;
11581
11581
  var mergeStuckCooldowns = /* @__PURE__ */ new Map();
11582
+ var mergeReadyNotifier = null;
11582
11583
  async function checkReadyForMergeStuck() {
11583
11584
  const actions = [];
11584
11585
  try {
@@ -11588,7 +11589,6 @@ async function checkReadyForMergeStuck() {
11588
11589
  const content = readFileSync36(REVIEW_STATUS_FILE, "utf-8");
11589
11590
  const statuses = JSON.parse(content);
11590
11591
  const now = Date.now();
11591
- const apiPort = process.env.API_PORT || process.env.PORT || "3011";
11592
11592
  const state = loadState();
11593
11593
  const attemptCounts = state.mergeStuckAttempts ?? {};
11594
11594
  let stateModified = false;
@@ -11606,10 +11606,19 @@ async function checkReadyForMergeStuck() {
11606
11606
  continue;
11607
11607
  }
11608
11608
  const ageMin = Math.round((now - new Date(status.updatedAt).getTime()) / 6e4);
11609
- const msg = `${key} is readyForMerge (age: ${ageMin}m) \u2014 waiting for human approval`;
11610
- actions.push(msg);
11611
- console.log(`[deacon] ${msg}`);
11609
+ console.warn(`[deacon] readyForMerge stuck for ${key} (age: ${ageMin}m, attempts: ${attempts}) \u2014 merge requires manual action via MERGE button`);
11612
11610
  mergeStuckCooldowns.set(key, now);
11611
+ attemptCounts[key] = attempts + 1;
11612
+ stateModified = true;
11613
+ const msg = `Stuck-merge: ${key} has been readyForMerge for ${ageMin}m \u2014 click MERGE to proceed`;
11614
+ if (mergeReadyNotifier) {
11615
+ mergeReadyNotifier(status.issueId ?? key);
11616
+ actions.push(msg);
11617
+ console.log(`[deacon] merge:ready notification sent for ${key}`);
11618
+ } else {
11619
+ actions.push(msg);
11620
+ console.warn(`[deacon] No mergeReadyNotifier registered \u2014 dashboard will not be notified for ${key}`);
11621
+ }
11613
11622
  }
11614
11623
  if (stateModified) {
11615
11624
  state.mergeStuckAttempts = attemptCounts;
@@ -11898,7 +11907,7 @@ async function runPatrol() {
11898
11907
  if (nextTask) {
11899
11908
  console.log(`[deacon] Auto-resuming suspended ${specialist.name} for queued task: ${nextTask.payload.issueId}`);
11900
11909
  try {
11901
- const { resumeAgent } = await import("../agents-DMPT32H7.js");
11910
+ const { resumeAgent } = await import("../agents-HNMF52RM.js");
11902
11911
  const message = `# Queued Work
11903
11912
 
11904
11913
  Processing queued task: ${nextTask.payload.issueId}`;
@@ -13871,7 +13880,7 @@ import { promisify as promisify19 } from "util";
13871
13880
  var execAsync19 = promisify19(exec19);
13872
13881
  async function listLogsCommand(project2, type, options) {
13873
13882
  try {
13874
- const { listRunLogs } = await import("../specialist-logs-QREUJ4HN.js");
13883
+ const { listRunLogs } = await import("../specialist-logs-CJKXM3SR.js");
13875
13884
  const limit = options.limit ? parseInt(options.limit) : 10;
13876
13885
  const runs = listRunLogs(project2, type, { limit });
13877
13886
  if (options.json) {
@@ -13916,7 +13925,7 @@ View a specific run: pan specialists logs ${project2} ${type} <runId>
13916
13925
  }
13917
13926
  async function viewLogCommand(project2, type, runId, options) {
13918
13927
  try {
13919
- const { getRunLog, parseLogMetadata, getRunLogPath } = await import("../specialist-logs-QREUJ4HN.js");
13928
+ const { getRunLog, parseLogMetadata, getRunLogPath } = await import("../specialist-logs-CJKXM3SR.js");
13920
13929
  const content = getRunLog(project2, type, runId);
13921
13930
  if (!content) {
13922
13931
  console.error(`\u274C Run log not found: ${runId}`);
@@ -13940,8 +13949,8 @@ async function viewLogCommand(project2, type, runId, options) {
13940
13949
  }
13941
13950
  async function tailLogCommand(project2, type) {
13942
13951
  try {
13943
- const { getRunLogPath } = await import("../specialist-logs-QREUJ4HN.js");
13944
- const { getProjectSpecialistMetadata } = await import("../specialists-2DBBXRCK.js");
13952
+ const { getRunLogPath } = await import("../specialist-logs-CJKXM3SR.js");
13953
+ const { getProjectSpecialistMetadata } = await import("../specialists-NXYD4Z62.js");
13945
13954
  const metadata = getProjectSpecialistMetadata(project2, type);
13946
13955
  if (!metadata.currentRun) {
13947
13956
  console.error(`\u274C No active run for ${project2}/${type}`);
@@ -14010,7 +14019,7 @@ async function cleanupLogsCommand(projectOrAll, type, options) {
14010
14019
  console.log(" Use --force to confirm.");
14011
14020
  process.exit(1);
14012
14021
  }
14013
- const { cleanupAllLogs } = await import("../specialist-logs-QREUJ4HN.js");
14022
+ const { cleanupAllLogs } = await import("../specialist-logs-CJKXM3SR.js");
14014
14023
  console.log("\u{1F9F9} Cleaning up old logs for all projects...\n");
14015
14024
  const results = cleanupAllLogs();
14016
14025
  console.log(`
@@ -14037,7 +14046,7 @@ async function cleanupLogsCommand(projectOrAll, type, options) {
14037
14046
  console.log(" Use --force to confirm.");
14038
14047
  process.exit(1);
14039
14048
  }
14040
- const { cleanupOldLogs } = await import("../specialist-logs-QREUJ4HN.js");
14049
+ const { cleanupOldLogs } = await import("../specialist-logs-CJKXM3SR.js");
14041
14050
  const { getSpecialistRetention } = await import("../projects-KVM3MN3Y.js");
14042
14051
  const retention = getSpecialistRetention(projectOrAll);
14043
14052
  console.log(`\u{1F9F9} Cleaning up old logs for ${projectOrAll}/${type}...`);