@join-pantheon/cli 0.33.7 → 0.33.9-rc.1

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.
@@ -10,6 +10,8 @@
10
10
  * Terminal runs — no automation permission needed
11
11
  * Show details prints the act and the decision in Terminal
12
12
  * Fix it here (a failed run) opens a Terminal where the work is, steps shown
13
+ * Sign in (your agent is signed out) opens a Terminal that asks, then signs it in
14
+ * Show me how (no agent CLI, a sandbox that cannot start) shows this computer's steps
13
15
  * Done (decisions) answers it as handled, silently — the reminders stop
14
16
  * Dismiss / × closes
15
17
  *
@@ -17,6 +19,10 @@
17
19
  *
18
20
  * pantheon-hud post --json '<notice json>'
19
21
  *
22
+ * and what it would draw for one, without drawing anything (for tests):
23
+ *
24
+ * pantheon-hud buttons --json '<notice json>'
25
+ *
20
26
  * The older positional form is still accepted so a freshly upgraded CLI and a
21
27
  * not-yet-rebuilt helper (or the reverse) keep working during an upgrade:
22
28
  *
@@ -35,7 +41,8 @@ struct Tool: Decodable { let id: String; let label: String; let kind: String?; l
35
41
  struct Primary: Decodable { let label: String; let `default`: String; let tools: [Tool]; let prompt: String }
36
42
  struct Details: Decodable { let act: String?; let decision: String? }
37
43
  /// The one thing a person could do about a failed run: where, and which steps.
38
- struct Fix: Decodable { let label: String; let dir: String; let lines: [String]; let why: String }
44
+ /// `kind` "sign_in" / "how": a readiness alert's one button (no pull-down); the CLI runs only its own fixed steps for it.
45
+ struct Fix: Decodable { let label: String; let dir: String; let lines: [String]; let why: String; let kind: String?; let agent: String? }
39
46
  struct Notice: Decodable {
40
47
  let kind: String
41
48
  let who: String
@@ -56,6 +63,45 @@ struct Notice: Decodable {
56
63
  let pantheon: String?
57
64
  }
58
65
 
66
+ /// The panel's buttons, decided in one place: what `post` draws and what `buttons` prints.
67
+ enum MainAction { case details, legacyOpen, fix }
68
+ enum ButtonPlan {
69
+ /// the "Open in …" pull-down, then whichever of Show details, the fix, Done apply, then Dismiss
70
+ case pulldown(String, [String])
71
+ /// one main button, then Dismiss
72
+ case single(String, MainAction)
73
+ /// no buttons: the panel closes with ×
74
+ case none
75
+ }
76
+ func buttonPlan(_ n: Notice, legacy: Bool) -> ButtonPlan {
77
+ if let p = n.primary {
78
+ var rest: [String] = []
79
+ if n.details != nil { rest.append("Show details") }
80
+ if let f = n.fix { rest.append(f.label) }
81
+ if n.details?.decision != nil { rest.append("Done") }
82
+ return .pulldown(p.label, rest)
83
+ }
84
+ if legacy { return .single("Open your agent", .legacyOpen) }
85
+ // A readiness alert ("Your agent is signed out"): its fix IS the action — Sign in, or Show me how.
86
+ // Only for those kinds: a failed run without a pull-down keeps its "Show details", as before 0.33.9.
87
+ if let f = n.fix, let k = f.kind, k == "sign_in" || k == "how" { return .single(f.label, .fix) }
88
+ if n.details != nil { return .single("Show details", .details) }
89
+ return .none
90
+ }
91
+ func buttonTitles(_ plan: ButtonPlan) -> [String] {
92
+ switch plan {
93
+ case .pulldown(let label, let rest): return [label] + rest + ["Dismiss"]
94
+ case .single(let title, _): return [title, "Dismiss"]
95
+ case .none: return []
96
+ }
97
+ }
98
+
99
+ if args.count >= 4, args[1] == "buttons", args[2] == "--json", let data = args[3].data(using: .utf8) {
100
+ guard let n = try? JSONDecoder().decode(Notice.self, from: data) else { fputs("not a notice\n", stderr); exit(65) }
101
+ for t in buttonTitles(buttonPlan(n, legacy: false)) { print(t) }
102
+ exit(0)
103
+ }
104
+
59
105
  var notice: Notice
60
106
  var legacyBundle: String? = nil
61
107
  var legacyPrompt = ""
@@ -169,6 +215,11 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
169
215
  /// moment to take another unattended action on someone's machine.
170
216
  @objc func fixIt(_ sender: Any?) {
171
217
  guard let f = notice.fix else { NSApp.terminate(nil); return }
218
+ if let k = f.kind, k == "sign_in" || k == "how" {
219
+ // The CLI decides the steps from its own table for this kind and agent — no lines are passed.
220
+ act(["action": "fix", "fix_kind": k, "agent": f.agent as Any, "why": f.why].compactMapValues { $0 is NSNull ? nil : $0 }, command: "pantheon-details.command")
221
+ return
222
+ }
172
223
  act(["action": "fix", "dir": f.dir, "lines": f.lines, "why": f.why], command: "pantheon-details.command")
173
224
  }
174
225
 
@@ -266,7 +317,8 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
266
317
  }
267
318
 
268
319
  // actions
269
- if let p = notice.primary {
320
+ let plan = buttonPlan(notice, legacy: legacyBundle != nil)
321
+ if case .pulldown = plan, let p = notice.primary {
270
322
  let pull = NSPopUpButton(frame: .zero, pullsDown: true)
271
323
  pull.translatesAutoresizingMaskIntoConstraints = false
272
324
  pull.bezelStyle = .rounded
@@ -318,8 +370,8 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
318
370
  dis.translatesAutoresizingMaskIntoConstraints = false
319
371
  root.addSubview(dis)
320
372
  constraints += [dis.leadingAnchor.constraint(equalTo: trailing.trailingAnchor, constant: 14), dis.centerYAnchor.constraint(equalTo: pull.centerYAnchor)]
321
- } else if notice.details != nil || legacyBundle != nil {
322
- let main = NSButton(title: legacyBundle != nil ? "Open your agent" : "Show details", target: self, action: legacyBundle != nil ? #selector(legacyOpen(_:)) : #selector(showDetails(_:)))
373
+ } else if case .single(let title, let what) = plan {
374
+ let main = NSButton(title: title, target: self, action: what == .legacyOpen ? #selector(legacyOpen(_:)) : what == .fix ? #selector(fixIt(_:)) : #selector(showDetails(_:)))
323
375
  main.bezelStyle = .rounded; main.font = .systemFont(ofSize: 12, weight: .semibold)
324
376
  main.translatesAutoresizingMaskIntoConstraints = false
325
377
  let dis = NSButton(title: "Dismiss", target: self, action: #selector(dismiss(_:)))
@@ -331,7 +383,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
331
383
  dis.leadingAnchor.constraint(equalTo: main.trailingAnchor, constant: 14), dis.centerYAnchor.constraint(equalTo: main.centerYAnchor),
332
384
  ]
333
385
  }
334
- if notice.primary == nil && notice.details == nil && legacyBundle == nil {
386
+ if case .none = plan {
335
387
  constraints.append(body.bottomAnchor.constraint(equalTo: root.bottomAnchor, constant: -16))
336
388
  }
337
389
  NSLayoutConstraint.activate(constraints)
@@ -22,6 +22,27 @@ import AppKit
22
22
 
23
23
  let argv = CommandLine.arguments
24
24
  if argv.count == 2, argv[1] == "version" { print("2"); exit(0) }
25
+ /// `pantheon-tray measure-warning <lead> <line>`: how the board's warning row lays the text out —
26
+ /// "<text width> <row height> <one line's height>" — measured, nothing drawn (for tests).
27
+ /// `pantheon-tray measure-header <lead> <rest>`: "<text width> <room>" for the board's heading line (HeaderView).
28
+ if argv.count == 4, argv[1] == "measure-header" {
29
+ let t = NSMutableAttributedString(string: argv[2], attributes: [.font: NSFont.systemFont(ofSize: 12, weight: .semibold)])
30
+ t.append(NSAttributedString(string: " " + argv[3], attributes: [.font: NSFont.systemFont(ofSize: 12, weight: .regular)]))
31
+ print("\(Int(ceil(t.size().width))) \(Int(AppDelegate.boardWidth - 24))")
32
+ exit(0)
33
+ }
34
+ /// `pantheon-tray wrap <width> <text>`: the right-click menu's lines for a long line, one per output line.
35
+ if argv.count == 4, argv[1] == "wrap", let n = Int(argv[2]) {
36
+ for l in AppDelegate.wrap(argv[3], n) { print(l) }
37
+ exit(0)
38
+ }
39
+ if argv.count == 4, argv[1] == "measure-warning" {
40
+ let t = WarningView.attributed(lead: argv[2], line: argv[3])
41
+ let w = AppDelegate.boardWidth
42
+ let one = ceil(WarningView.attributed(lead: "x", line: "").boundingRect(with: NSSize(width: 10_000, height: 100), options: [.usesLineFragmentOrigin, .usesFontLeading]).height)
43
+ print("\(Int(w - WarningView.inset - 16)) \(Int(WarningView.height(t, width: w))) \(Int(one))")
44
+ exit(0)
45
+ }
25
46
  guard argv.count >= 2 else {
26
47
  fputs("usage: pantheon-tray <path-to-pantheon> [poll-seconds]\n", stderr)
27
48
  exit(64)
@@ -49,6 +70,9 @@ struct TrayState {
49
70
  var notifierRunning = false
50
71
  var hookOn = false
51
72
  var workerState = ""
73
+ /// why this computer can't take teammates' requests, with the fix (signed out, no agent CLI), and the words that lead it
74
+ var agentProblem = ""
75
+ var agentProblemLead = "Unattended work can't run"
52
76
  var surfaceName = "agent"
53
77
  var surfaceBundleID = ""
54
78
  var decisionsPrompt = ""
@@ -164,6 +188,8 @@ func fetchState() -> TrayState {
164
188
  s.notifierRunning = j["notifier_running"] as? Bool ?? false
165
189
  s.hookOn = j["hook_on"] as? Bool ?? false
166
190
  s.workerState = j["worker_state"] as? String ?? ""
191
+ s.agentProblem = j["agent_problem"] as? String ?? ""
192
+ if let lead = j["agent_problem_lead"] as? String, !lead.isEmpty { s.agentProblemLead = lead }
167
193
  s.surfaceName = j["surface_name"] as? String ?? "agent"
168
194
  s.surfaceBundleID = j["surface_bundle_id"] as? String ?? ""
169
195
  s.decisionsPrompt = j["decisions_prompt"] as? String ?? ""
@@ -540,6 +566,43 @@ final class ActionRow: NSView {
540
566
  }
541
567
  }
542
568
 
569
+ /// A warning across the whole board, wrapped to as many lines as it needs: this
570
+ /// computer can't take teammates' requests, and the fix (readiness-alert.ts). Its
571
+ /// height is measured from the text at the board's width, so nothing is cut.
572
+ final class WarningView: NSView {
573
+ private let text: NSAttributedString
574
+ static let inset: CGFloat = 26
575
+ static func attributed(lead: String, line: String) -> NSAttributedString {
576
+ let a = NSMutableAttributedString(string: lead + ": ", attributes: [.font: NSFont.systemFont(ofSize: 12.5, weight: .semibold), .foregroundColor: NSColor.labelColor])
577
+ a.append(NSAttributedString(string: line, attributes: [.font: NSFont.systemFont(ofSize: 12.5), .foregroundColor: NSColor.labelColor]))
578
+ let para = NSMutableParagraphStyle(); para.lineBreakMode = .byWordWrapping
579
+ a.addAttribute(.paragraphStyle, value: para, range: NSRange(location: 0, length: a.length))
580
+ return a
581
+ }
582
+ /// The height the text needs at `width`, measured — the row is that plus its padding.
583
+ static func height(_ text: NSAttributedString, width: CGFloat) -> CGFloat {
584
+ let inner = width - inset - 16
585
+ return ceil(text.boundingRect(with: NSSize(width: inner, height: 10_000), options: [.usesLineFragmentOrigin, .usesFontLeading]).height) + 16
586
+ }
587
+ init(lead: String, line: String, width: CGFloat) {
588
+ text = WarningView.attributed(lead: lead, line: line)
589
+ super.init(frame: NSRect(x: 0, y: 0, width: width, height: WarningView.height(text, width: width)))
590
+ autoresizingMask = [.width]
591
+ setAccessibilityRole(.staticText)
592
+ setAccessibilityLabel("\(lead): \(line)")
593
+ }
594
+ required init?(coder: NSCoder) { return nil }
595
+ override var isFlipped: Bool { true }
596
+ override func draw(_ dirtyRect: NSRect) {
597
+ let band = NSRect(x: 6, y: 2, width: bounds.width - 12, height: bounds.height - 4)
598
+ NSColor.systemOrange.withAlphaComponent(0.16).setFill()
599
+ NSBezierPath(roundedRect: band, xRadius: 6, yRadius: 6).fill()
600
+ NSColor.systemOrange.setFill()
601
+ NSBezierPath(roundedRect: NSRect(x: 12, y: 8, width: 4, height: bounds.height - 16), xRadius: 2, yRadius: 2).fill()
602
+ text.draw(with: NSRect(x: WarningView.inset, y: 8, width: bounds.width - WarningView.inset - 16, height: bounds.height - 16), options: [.usesLineFragmentOrigin, .usesFontLeading])
603
+ }
604
+ }
605
+
543
606
  final class BoardSeparator: NSView {
544
607
  init(width: CGFloat) { super.init(frame: NSRect(x: 0, y: 0, width: width, height: 9)); autoresizingMask = [.width] }
545
608
  required init?(coder: NSCoder) { return nil }
@@ -619,6 +682,18 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
619
682
  private var boardSignature = ""
620
683
  private var boardMonitor: Any?
621
684
  static let boardWidth: CGFloat = 470
685
+ /** The board's heading while this computer can't take requests: no longer than "Nothing needs you", so the status beside it is never cut. */
686
+ static let problemHeading = "Needs you"
687
+ /** Words into lines of at most `width` characters; a word longer than a line goes on a line of its own, whole — nothing is dropped. */
688
+ static func wrap(_ text: String, _ width: Int) -> [String] {
689
+ var lines: [String] = [], line = ""
690
+ for w in text.split(separator: " ", omittingEmptySubsequences: true).map(String.init) {
691
+ if !line.isEmpty && line.count + 1 + w.count > width { lines.append(line); line = "" }
692
+ line = line.isEmpty ? w : line + " " + w
693
+ }
694
+ if !line.isEmpty { lines.append(line) }
695
+ return lines
696
+ }
622
697
 
623
698
  /// The cards: what needs this person now, less what they put away for later.
624
699
  /// The badge, the tooltip and both boards' headers all count these, so they agree.
@@ -631,7 +706,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
631
706
  // Everything the board draws from, not just which ids: a row moving lane (out
632
707
  // of the worker's window), a new repeat, a claim, or a Later coming due all
633
708
  // change what an open board must show.
634
- "\(state.items.map { "\($0.id):\($0.effectiveLane):\($0.claimed):\($0.context)" }.joined(separator: ","))|\(Later.active().keys.sorted().joined(separator: ","))|\(state.decisions.count)|\(state.online)|\(state.members)|\(state.workerRunning)|\(state.relayOk)|\(actionError ?? "")|\(workerAction ?? "")"
709
+ "\(state.items.map { "\($0.id):\($0.effectiveLane):\($0.claimed):\($0.context)" }.joined(separator: ","))|\(Later.active().keys.sorted().joined(separator: ","))|\(state.decisions.count)|\(state.online)|\(state.members)|\(state.workerRunning)|\(state.relayOk)|\(state.agentProblem)|\(actionError ?? "")|\(workerAction ?? "")"
635
710
  }
636
711
 
637
712
  @objc private func iconClicked(_ sender: Any?) {
@@ -767,14 +842,18 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
767
842
  let handling = state.items.filter { $0.effectiveLane == "handling" }
768
843
  let waiting = state.items.filter { $0.effectiveLane == "waiting" }
769
844
  let older = state.items.filter { $0.effectiveLane == "older" }
770
- let need = cards.isEmpty ? "Nothing needs you" : "\(cards.count) need\(cards.count == 1 ? "s" : "") you"
845
+ // This computer can't take teammates' requests: not "nothing needs you" — it needs them.
846
+ let problem = state.agentProblem
847
+ // Short: the warning row below says what and why; the heading must leave the status text its room.
848
+ let need = cards.isEmpty ? (problem.isEmpty ? "Nothing needs you" : AppDelegate.problemHeading) : "\(cards.count) need\(cards.count == 1 ? "s" : "") you"
771
849
  let where_ = multi ? "\(state.spaces.count) teams" : state.space
772
850
  rows.append(HeaderView(lead: need, rest: "\(state.member) · \(where_) · " + (state.relayOk ? "\(state.online) of \(state.members) online" : "connection unavailable"), width: w))
851
+ if !problem.isEmpty { rows.append(WarningView(lead: state.agentProblemLead, line: problem, width: w)) }
773
852
  if !state.relayOk { note("Could not reach: \(state.unavailableSpaces.joined(separator: ", "))") }
774
853
  if !state.decisionsOk { note("Some of this could not be checked — the list may be incomplete") }
775
854
  sep()
776
855
  // The heading already says nothing needs you: said again only what it does not.
777
- if cards.isEmpty && state.decisionsOk && handling.isEmpty && waiting.isEmpty && older.isEmpty && putAway.isEmpty {
856
+ if cards.isEmpty && state.decisionsOk && handling.isEmpty && waiting.isEmpty && older.isEmpty && putAway.isEmpty && problem.isEmpty {
778
857
  note("All clear — nothing open for your agents either")
779
858
  }
780
859
  // One block per team when there are several (Sid, 2 Oct: "it should
@@ -816,7 +895,8 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
816
895
  }
817
896
  sep()
818
897
  if let action = workerAction { note(action) }
819
- else if state.workerRunning { act("Pause unattended work", state.workerState) { [weak self] in self?.pauseWorker() } }
898
+ // The problem has its own row at the top: the hint here would cut it to a word.
899
+ else if state.workerRunning { act("Pause unattended work", problem.isEmpty ? state.workerState : "can't run now") { [weak self] in self?.pauseWorker() } }
820
900
  else if state.workerInstalled { act("Resume unattended work", "paused") { [weak self] in self?.resumeWorker() } }
821
901
  else { note("Unattended work is not set up — pantheon service install worker") }
822
902
  }
@@ -905,9 +985,10 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
905
985
  item.button?.image = markImage(mode)
906
986
  let unknown = hasLoaded && (!state.reachable || (state.configured && !state.decisionsOk))
907
987
  let need = hasLoaded ? boardCards.count : 0
908
- item.button?.title = actionError != nil ? " !" : need == 0 ? (unknown ? " !" : "") : " \(need)\(unknown ? "+" : "")"
988
+ let problem = hasLoaded && !state.agentProblem.isEmpty
989
+ item.button?.title = actionError != nil ? " !" : need == 0 ? (unknown || problem ? " !" : "") : " \(need)\(unknown ? "+" : "")"
909
990
  item.button?.imagePosition = .imageLeading
910
- let summary = !hasLoaded ? "Checking status…" : !state.reachable ? "Unable to check status" : !state.configured ? "Not joined to a team yet" : !state.decisionsOk ? "Unable to check every decision" : need == 0 ? "Nothing needs you" : "\(need) need\(need == 1 ? "s" : "") you"
991
+ let summary = !hasLoaded ? "Checking status…" : !state.reachable ? "Unable to check status" : !state.configured ? "Not joined to a team yet" : !state.decisionsOk ? "Unable to check every decision" : problem && need == 0 ? state.agentProblemLead : need == 0 ? "Nothing needs you" : "\(need) need\(need == 1 ? "s" : "") you"
911
992
  item.button?.toolTip = "Pantheon — " + (actionError ?? summary)
912
993
  item.button?.setAccessibilityLabel("Pantheon — " + (actionError ?? summary))
913
994
  }
@@ -943,7 +1024,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
943
1024
  let older = state.items.filter { $0.effectiveLane == "older" }
944
1025
  let summary = NSMenuItem(title: state.member, action: nil, keyEquivalent: "")
945
1026
  summary.isEnabled = false
946
- summary.view = HeaderView(lead: cards.isEmpty ? "Nothing needs you" : "\(cards.count) need\(cards.count == 1 ? "s" : "") you",
1027
+ summary.view = HeaderView(lead: cards.isEmpty ? (state.agentProblem.isEmpty ? "Nothing needs you" : AppDelegate.problemHeading) : "\(cards.count) need\(cards.count == 1 ? "s" : "") you",
947
1028
  rest: "\(state.member) · " + (multi ? "\(state.spaces.count) teams" : state.space) + " · " + (state.relayOk ? "\(state.online) of \(state.members) online" : "connection unavailable"),
948
1029
  width: RowView.rowWidth)
949
1030
  menu.addItem(summary)
@@ -952,7 +1033,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
952
1033
  menu.addItem(.separator())
953
1034
  let row = { (it: Item) -> NSMenuItem in self.menuRow(it, showSpace: multi) }
954
1035
  for it in cards { menu.addItem(row(it)) }
955
- if cards.isEmpty && state.decisionsOk && handling.isEmpty && waiting.isEmpty && older.isEmpty && putAway.isEmpty {
1036
+ if cards.isEmpty && state.decisionsOk && handling.isEmpty && waiting.isEmpty && older.isEmpty && putAway.isEmpty && state.agentProblem.isEmpty {
956
1037
  info("All clear — nothing open for your agents either")
957
1038
  }
958
1039
  let lanes: [(String, [Item])] = [
@@ -975,7 +1056,8 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
975
1056
  }
976
1057
  menu.addItem(.separator())
977
1058
  info(state.workerRunning ? "Unattended work is on" : state.workerInstalled ? "Unattended work is paused" : "Unattended work is not set up")
978
- if !state.workerState.isEmpty && state.workerRunning { info(state.workerState) }
1059
+ // Wrapped, never cut: the problem line ("…signed out — open Terminal, type …") runs past one menu row.
1060
+ if !state.workerState.isEmpty && state.workerRunning { for part in AppDelegate.wrap(state.workerState, 100) { info(part) } }
979
1061
  if let action = workerAction {
980
1062
  info(action)
981
1063
  } else if state.workerRunning {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "format": 1,
3
- "built_at": "2026-10-13T06:04:13.698Z",
3
+ "built_at": "2026-10-13T14:42:49.532Z",
4
4
  "swiftc": "Apple Swift version 6.3.3 (swiftlang-6.3.3.1.3 clang-2100.1.1.101)",
5
5
  "helpers": {
6
6
  "pantheon-tray": {
7
7
  "source": "menubar.swift",
8
- "source_sha256": "f079629099a81f9b679ef4133d897ceb09025f675099c5f941951604df3531fa",
9
- "sha256": "cc081120555f528c83b38951663d37e8394e3a3e119a19b0bb3b2a737f4d617f",
8
+ "source_sha256": "bd540c2476d8a621ac612ad39fd33c034127dcce4631cb3c8bf03733093ce920",
9
+ "sha256": "ca52eedd9f5fee1031c7f99d81d876f7bc308c2e8b0bc044d37dadc5096102d8",
10
10
  "archs": [
11
11
  "arm64",
12
12
  "x86_64"
@@ -16,8 +16,8 @@
16
16
  },
17
17
  "pantheon-hud": {
18
18
  "source": "main.swift",
19
- "source_sha256": "ffda2f8dbec3144ac902f952df1048affce6ec0e6f1b2c65ff87643a484c55c6",
20
- "sha256": "2a943f9b8c401362e7940d92874b3b647fb718ad1cdc0104ddd81d97dfd7365b",
19
+ "source_sha256": "d3e4b3df9442901ffc5eb95d4679fe08e428f0f67b1f3f86d68ed7ea036de691",
20
+ "sha256": "ac6ae123243ecd4a0d2628476451e3da1574025b3b58f688633a9185d158d54b",
21
21
  "archs": [
22
22
  "arm64",
23
23
  "x86_64"
Binary file
Binary file
@@ -106,7 +106,7 @@ $global:PT = @{
106
106
  dash = [string][char]0x2014; dot = [string][char]0x00B7; ellipsis = [string][char]0x2026
107
107
  state = @{
108
108
  loaded = $false; reachable = $false; configured = $false; relayOk = $false; decisionsOk = $true
109
- member = ''; space = ''; spaces = @(); need = 0; workerRunning = $false; workerInstalled = $false
109
+ member = ''; space = ''; spaces = @(); need = 0; workerRunning = $false; workerInstalled = $false; agentProblem = ''; agentProblemLead = ''
110
110
  }
111
111
  icons = @{}
112
112
  }
@@ -430,6 +430,9 @@ function global:Read-Status([string]$json) {
430
430
  decisionsOk = ($null -eq $j.decisions_ok -or [bool]$j.decisions_ok)
431
431
  member = [string]$j.member; space = [string]$j.space; spaces = @($j.spaces | Where-Object { $_ })
432
432
  need = $need; workerRunning = [bool]$j.worker_running; workerInstalled = [bool]$j.worker_installed
433
+ # Why this computer cannot take requests, with the fix (signed out, no agent CLI): the heading, the icon and a menu line say it.
434
+ agentProblem = $(if ($j.agent_problem -is [string]) { $p = ([string]$j.agent_problem) -replace '[\x00-\x1f\x7f-\x9f\u200e\u200f\u202a-\u202e\u2066-\u2069]', ''; if ($p.Length -gt 200) { $p.Substring(0, 199) + $PT.ellipsis } else { $p } } else { '' })
435
+ agentProblemLead = $(if ($j.agent_problem_lead) { [string]$j.agent_problem_lead } else { "Unattended work can't run" })
433
436
  }
434
437
  }
435
438
 
@@ -440,6 +443,7 @@ function global:Get-Summary {
440
443
  if (-not $s.configured) { return 'Not joined to a team yet' }
441
444
  if (-not $s.relayOk) { return 'Connection unavailable' }
442
445
  if (-not $s.decisionsOk) { return 'Unable to check every decision' }
446
+ if ($s.agentProblem -and $s.need -eq 0) { return $s.agentProblemLead }
443
447
  if ($s.need -eq 0) { return 'Nothing needs you' }
444
448
  if ($s.need -eq 1) { return '1 needs you' }
445
449
  return "$($s.need) need you"
@@ -489,6 +493,19 @@ function global:Get-TrayIcon([int]$count, [string]$mode) {
489
493
  } else {
490
494
  $g.DrawImage($base, 0, 0, $w, $h)
491
495
  }
496
+ if ($mode -eq 'warn' -and $shown -eq 0) {
497
+ # This computer can't take requests (signed out, no agent CLI): an amber "!" in the corner.
498
+ $d = [int]([Math]::Ceiling($w * 0.62))
499
+ $x = $w - $d; $y = $h - $d
500
+ $brush = New-Object System.Drawing.SolidBrush ([System.Drawing.Color]::FromArgb(255, 230, 145, 0))
501
+ $g.FillEllipse($brush, $x, $y, $d - 1, $d - 1)
502
+ $font = New-Object System.Drawing.Font 'Segoe UI', ([Math]::Max(6, $d * 0.62)), ([System.Drawing.FontStyle]::Bold), ([System.Drawing.GraphicsUnit]::Pixel)
503
+ $fmt = New-Object System.Drawing.StringFormat
504
+ $fmt.Alignment = [System.Drawing.StringAlignment]::Center
505
+ $fmt.LineAlignment = [System.Drawing.StringAlignment]::Center
506
+ $g.DrawString('!', $font, [System.Drawing.Brushes]::White, (New-Object System.Drawing.RectangleF $x, ($y + 0.5), $d, $d), $fmt)
507
+ $font.Dispose(); $brush.Dispose(); $fmt.Dispose()
508
+ }
492
509
  if ($shown -gt 0) {
493
510
  # The count, on a red badge in the corner: what needs the person.
494
511
  $d = [int]([Math]::Ceiling($w * 0.62))
@@ -510,9 +527,19 @@ function global:Get-TrayIcon([int]$count, [string]$mode) {
510
527
  return $made
511
528
  }
512
529
 
530
+ # The icon's state: off (no relay, no team), warn (this computer can't take requests), full, idle.
531
+ function global:Get-TrayMode {
532
+ $s = $PT.state
533
+ if (-not $s.loaded) { return 'idle' }
534
+ if (-not $s.reachable -or -not $s.configured -or -not $s.relayOk) { return 'off' }
535
+ if ($s.agentProblem) { return 'warn' }
536
+ if ($s.workerRunning) { return 'full' }
537
+ return 'idle'
538
+ }
539
+
513
540
  function global:Update-Tray {
514
541
  $s = $PT.state
515
- $mode = if (-not $s.loaded) { 'idle' } elseif (-not $s.reachable -or -not $s.configured -or -not $s.relayOk) { 'off' } elseif ($s.workerRunning) { 'full' } else { 'idle' }
542
+ $mode = Get-TrayMode
516
543
  $count = if ($s.loaded -and $s.reachable) { $s.need } else { 0 }
517
544
  $PT.tray.Icon = Get-TrayIcon $count $mode
518
545
  # The tooltip holds 63 characters at most (it throws beyond that).
@@ -639,6 +666,9 @@ function global:Build-Menu {
639
666
  $head = Get-Summary
640
667
  if ($who.Count) { $head = $head + ' ' + $PT.dot + ' ' + ($who -join (' ' + $PT.dot + ' ')) }
641
668
  Add-MenuItem $head $null $false $false
669
+ # Not greyed out: a click opens status, which says it in full with the fix.
670
+ # The heading already says it cannot run (when nothing else needs you): the row says why, and the fix.
671
+ if ($s.agentProblem) { Add-MenuItem $(if ($s.need -eq 0) { $s.agentProblem } else { $s.agentProblemLead + ': ' + $s.agentProblem }) { Open-PantheonConsole 'Pantheon status' 'status' } $true }
642
672
  [void]$menu.Items.Add((New-Object System.Windows.Forms.ToolStripSeparator))
643
673
  Add-MenuItem 'Open board' { Open-Board } $true
644
674
  [void]$menu.Items.Add((New-Object System.Windows.Forms.ToolStripSeparator))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@join-pantheon/cli",
3
- "version": "0.33.7",
3
+ "version": "0.33.9-rc.1",
4
4
  "description": "Let your coding agent collaborate directly with your teammates' agents — ask, agree an interface, and deliver, without a human relaying messages.",
5
5
  "type": "module",
6
6
  "bin": {