@join-pantheon/cli 0.35.2-rc.2 → 0.35.3-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.
@@ -110,6 +110,8 @@ struct TrayState {
110
110
  var runsToday = ""
111
111
  /// Pantheon processes here stuck without the relay for over two minutes, each with its fix (conn-report.ts)
112
112
  var stuck: [String] = []
113
+ /// goals this person opened with nothing left in them (settled.ts): shown collapsed, each with a one-click Close
114
+ var settled: [(id: String, title: String, space: String, quiet: String)] = []
113
115
  }
114
116
 
115
117
  /**
@@ -149,13 +151,23 @@ struct Item {
149
151
  var promise: Bool = false
150
152
  /// under "Your agents are handling": the request Take over / Stop act on (tray.ts run.ref), "" when neither applies
151
153
  var runRef: String = ""
154
+ /// a decision: how many answers it offers — "3 options" (tray.ts options), 0 when it states none
155
+ var options: Int = 0
156
+ /// under "Still needed?": why it may have gone — "its goal is closed" (tray.ts stale)
157
+ var stale: String = ""
158
+ /// a decision past its due date: still a card, said "overdue" (tray.ts overdue)
159
+ var overdue: Bool = false
160
+ /// a decision standing for earlier ones in its goal: how many are drawn under it (tray.ts earlier)
161
+ var earlier: Int = 0
162
+ /// an earlier decision in the same goal for the same person: the id of the card it is drawn under (tray.ts repeat_of)
163
+ var repeatOf: String = ""
152
164
 
153
165
  var isDecision: Bool { kind == "decision" }
154
166
  /// A tray-status from before lanes — or with a lane this helper does not know —
155
167
  /// draws as it did before lanes: a decision or owed row is a card, a wait is not.
156
168
  /// An unknown lane must never hide a row.
157
169
  var effectiveLane: String { Item.lanes.contains(lane) ? lane : (kind == "waiting" ? "waiting" : "now") }
158
- static let lanes: Set<String> = ["now", "handling", "waiting", "older"]
170
+ static let lanes: Set<String> = ["now", "handling", "waiting", "older", "stale"]
159
171
  var heading: String {
160
172
  switch kind {
161
173
  case "decision": return "Needs your decision"
@@ -175,6 +187,10 @@ struct Item {
175
187
  parts.append(promise ? "your agent committed to it" : effectiveLane == "handling" ? (claimed ? "your agent is on it" : "your worker picks it up") : "waiting on you")
176
188
  } else if !who.isEmpty { parts.append(who) }
177
189
  if when > 0 { parts.append(Item.age(when)) }
190
+ // "praneet · 2d ago · 3 options": the real asker, how long, and what answering takes (0.35.3).
191
+ if overdue { parts.append("overdue") }
192
+ if options > 1 { parts.append("\(options) options") }
193
+ if !stale.isEmpty { parts.append(stale) }
178
194
  if showSpace && !space.isEmpty { parts.append(space) }
179
195
  let head = parts.joined(separator: " · ")
180
196
  // The request a decision is holding up, said once, after who and when.
@@ -270,6 +286,11 @@ func trayState(_ j: [String: Any]) -> TrayState {
270
286
  }
271
287
  s.decisionsPrompt = j["decisions_prompt"] as? String ?? ""
272
288
  s.spaces = j["spaces"] as? [String] ?? []
289
+ for g in (j["settled_goals"] as? [[String: Any]] ?? []).prefix(50) {
290
+ if let id = g["id"] as? String, id.range(of: "^[A-Za-z0-9_-]{1,80}$", options: .regularExpression) != nil, let title = g["title"] as? String {
291
+ s.settled.append((id: id, title: String(title.prefix(200)), space: g["space"] as? String ?? "", quiet: g["quiet"] as? String ?? ""))
292
+ }
293
+ }
273
294
  for g in (j["gone_spaces"] as? [[String: Any]] ?? []) {
274
295
  if let space = g["space"] as? String, let line = g["line"] as? String, !space.isEmpty, !line.isEmpty { s.gone.append((space: space, line: line)) }
275
296
  }
@@ -295,7 +316,12 @@ func trayState(_ j: [String: Any]) -> TrayState {
295
316
  context: i["context"] as? String ?? "",
296
317
  claimed: i["claimed"] as? Bool ?? false,
297
318
  promise: i["promise"] as? Bool ?? false,
298
- runRef: (i["run"] as? [String: Any])?["ref"] as? String ?? ""
319
+ runRef: (i["run"] as? [String: Any])?["ref"] as? String ?? "",
320
+ options: min(9, max(0, (i["options"] as? Int) ?? Int((i["options"] as? Double) ?? 0))),
321
+ stale: String((i["stale"] as? String ?? "").prefix(80)),
322
+ overdue: i["overdue"] as? Bool ?? false,
323
+ earlier: max(0, (i["earlier"] as? Int) ?? Int((i["earlier"] as? Double) ?? 0)),
324
+ repeatOf: i["repeat_of"] as? String ?? ""
299
325
  ))
300
326
  }
301
327
  for d in (j["decisions"] as? [[String: Any]] ?? []) {
@@ -1014,8 +1040,14 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
1014
1040
 
1015
1041
  private var classicMenu: NSMenu?
1016
1042
  private var boardPanel: BoardPanel?
1017
- /// which of the board's counted lines are open ("handling", "waiting", "older", "later", "more")
1018
- private var boardOpen: Set<String> = []
1043
+ /// which of the board's counted lines are open ("handling", "waiting", "older", "stale", "later", "more",
1044
+ /// "more-now", "earlier|<team>|<id>") — closed until the person opens one; the lanes stay as they left them
1045
+ /// across launches (0.35.3: UserDefaults, a view preference on this Mac only).
1046
+ private var boardOpen: Set<String> = AppDelegate.savedOpen()
1047
+ static let openKey = "pantheon.boardOpen"
1048
+ static func savedOpen() -> Set<String> {
1049
+ Set((UserDefaults.standard.stringArray(forKey: openKey) ?? []).filter { !$0.hasPrefix("earlier|") }.prefix(64))
1050
+ }
1019
1051
  private var boardSignature = ""
1020
1052
  private var boardMonitor: Any?
1021
1053
  static let boardWidth: CGFloat = 470
@@ -1043,7 +1075,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
1043
1075
  // Everything the board draws from, not just which ids: a row moving lane (out
1044
1076
  // of the worker's window), a new repeat, a claim, or a Later coming due all
1045
1077
  // change what an open board must show.
1046
- "\(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.gone.map { $0.space }.joined(separator: ","))|\(state.agentProblem)|\(state.problemFixKind)|\(state.runsToday)|\(state.stuck.joined(separator: ","))|\(actionError ?? "")|\(workerAction ?? "")"
1078
+ "\(state.items.map { "\($0.id):\($0.effectiveLane):\($0.claimed):\($0.context):\($0.repeatOf):\($0.stale)" }.joined(separator: ","))|\(Later.active().keys.sorted().joined(separator: ","))|\(state.decisions.count)|\(state.online)|\(state.members)|\(state.workerRunning)|\(state.relayOk)|\(state.gone.map { $0.space }.joined(separator: ","))|\(state.settled.map { $0.id }.joined(separator: ","))|\(state.agentProblem)|\(state.problemFixKind)|\(state.runsToday)|\(state.stuck.joined(separator: ","))|\(actionError ?? "")|\(workerAction ?? "")"
1047
1079
  }
1048
1080
 
1049
1081
  @objc private func iconClicked(_ sender: Any?) {
@@ -1089,9 +1121,21 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
1089
1121
  /// Open or close one of the board's counted lines, and redraw.
1090
1122
  private func toggleBoardLine(_ key: String) {
1091
1123
  if boardOpen.contains(key) { boardOpen.remove(key) } else { boardOpen.insert(key) }
1124
+ // A row's "+N earlier" is about that row only: not kept. Every lane's choice is.
1125
+ UserDefaults.standard.set(boardOpen.filter { !$0.hasPrefix("earlier|") }.sorted(), forKey: AppDelegate.openKey)
1092
1126
  rebuildBoard()
1093
1127
  }
1094
1128
 
1129
+ /// The cards a board draws as cards: an earlier decision drawn under its newer one is not one of them (tray.ts repeat_of).
1130
+ private func topCards(_ cards: [Item]) -> [Item] {
1131
+ let ids = Set(cards.map { "\($0.space)|\($0.id)" })
1132
+ return cards.filter { $0.repeatOf.isEmpty || !ids.contains("\($0.space)|\($0.repeatOf)") }
1133
+ }
1134
+ /// The earlier decisions drawn under `top` ("+2 earlier in this goal"), each answered on its own.
1135
+ private func earlierOf(_ top: Item, in cards: [Item]) -> [Item] {
1136
+ cards.filter { $0.repeatOf == top.id && $0.space == top.space }
1137
+ }
1138
+
1095
1139
  /// The board as it would open now, drawn into a PNG (render mode, above).
1096
1140
  func renderBoard(to path: String) {
1097
1141
  state = fetchState()
@@ -1180,6 +1224,10 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
1180
1224
  let handling = state.items.filter { $0.effectiveLane == "handling" }
1181
1225
  let waiting = state.items.filter { $0.effectiveLane == "waiting" }
1182
1226
  let older = state.items.filter { $0.effectiveLane == "older" }
1227
+ let stale = state.items.filter { $0.effectiveLane == "stale" }
1228
+ // The first five cards across the board are drawn; the rest wait under "N more need you" (0.35.3).
1229
+ let top = topCards(cards)
1230
+ let shown = Set(top.prefix(5).map { "\($0.space)|\($0.id)" })
1183
1231
  // This computer can't take teammates' requests: not "nothing needs you" — it needs them.
1184
1232
  let problem = state.agentProblem
1185
1233
  // Short: the warning row below says what and why; the heading must leave the status text its room.
@@ -1204,7 +1252,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
1204
1252
  for line in state.stuck { rows.append(WarningView(lead: "Not connected", line: line, width: w)) }
1205
1253
  sep()
1206
1254
  // The heading already says nothing needs you: said again only what it does not.
1207
- if cards.isEmpty && state.decisionsOk && handling.isEmpty && waiting.isEmpty && older.isEmpty && putAway.isEmpty && problem.isEmpty {
1255
+ if cards.isEmpty && state.decisionsOk && handling.isEmpty && waiting.isEmpty && older.isEmpty && stale.isEmpty && putAway.isEmpty && problem.isEmpty {
1208
1256
  note("All clear — nothing open for your agents either")
1209
1257
  }
1210
1258
  // One block per team when there are several (Sid, 2 Oct: "it should
@@ -1215,15 +1263,36 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
1215
1263
  let teams: [String] = multi ? state.spaces : [""]
1216
1264
  for (ti, team) in teams.enumerated() {
1217
1265
  let mine = { (xs: [Item]) in multi ? xs.filter { $0.space == team } : xs }
1218
- let tCards = mine(cards), tHandling = mine(handling), tWaiting = mine(waiting), tOlder = mine(older), tLater = mine(putAway)
1266
+ let tCards = mine(cards), tHandling = mine(handling), tWaiting = mine(waiting), tOlder = mine(older), tLater = mine(putAway), tStale = mine(stale)
1219
1267
  if multi {
1220
- let restCount = tHandling.count + tWaiting.count + tOlder.count + tLater.count
1268
+ let restCount = tHandling.count + tWaiting.count + tOlder.count + tLater.count + tStale.count
1221
1269
  let detail = !tCards.isEmpty ? "\(tCards.count) need\(tCards.count == 1 ? "s" : "") you" : restCount > 0 ? "nothing needs you" : "all clear"
1222
1270
  if ti > 0 { rows.append(BoardSpacer(height: 6, width: w)) }
1223
1271
  rows.append(TeamHeaderView(name: team, detail: detail, tint: TeamHeaderView.tints[ti % TeamHeaderView.tints.count], width: w))
1224
1272
  }
1225
- for it in tCards { rows.append(RowView(item: it, width: w, showSpace: false, onOpen: openRow, onCopy: copyRow)) }
1273
+ // Each card, with the earlier decisions in its goal under one line of their own ("+2 earlier in this goal").
1274
+ let tTop = topCards(tCards)
1275
+ for it in tTop where shown.contains("\(it.space)|\(it.id)") {
1276
+ rows.append(RowView(item: it, width: w, showSpace: false, onOpen: openRow, onCopy: copyRow))
1277
+ let earlier = earlierOf(it, in: tCards)
1278
+ if !earlier.isEmpty {
1279
+ let key = "earlier|\(it.space)|\(it.id)"
1280
+ let open = boardOpen.contains(key)
1281
+ rows.append(ActionRow("+\(earlier.count) earlier in this goal", hint: open ? "hide" : "show", width: w, onClick: { [weak self] in self?.toggleBoardLine(key) }))
1282
+ if open { for e in earlier { rows.append(RowView(item: e, width: w, inTeamSection: true, showSpace: false, onOpen: openRow, onCopy: copyRow)) } }
1283
+ }
1284
+ }
1285
+ // Past the first five: one line, the true count, opened on demand — nothing hidden, nothing shouted.
1286
+ let rest = tTop.filter { !shown.contains("\($0.space)|\($0.id)") }
1287
+ if !rest.isEmpty {
1288
+ let key = multi ? "more-now|\(team)" : "more-now"
1289
+ let open = boardOpen.contains(key)
1290
+ let n = rest.reduce(0) { $0 + 1 + earlierOf($1, in: tCards).count }
1291
+ rows.append(ActionRow("\(n) more need\(n == 1 ? "s" : "") you", hint: open ? "hide" : "show", width: w, onClick: { [weak self] in self?.toggleBoardLine(key) }))
1292
+ if open { for it in rest { rows.append(RowView(item: it, width: w, inTeamSection: true, showSpace: false, onOpen: openRow, onCopy: copyRow)); for e in earlierOf(it, in: tCards) { rows.append(RowView(item: e, width: w, inTeamSection: true, showSpace: false, onOpen: openRow, onCopy: copyRow)) } } }
1293
+ }
1226
1294
  let lanes: [(key: String, title: String, items: [Item])] = [
1295
+ ("stale", "Still needed? · \(tStale.count)", tStale),
1227
1296
  ("handling", "Your agents are handling · \(tHandling.count)", tHandling),
1228
1297
  ("waiting", "Waiting on teammates · \(tWaiting.count)", tWaiting),
1229
1298
  ("older", "Older than a week · \(tOlder.count)", tOlder),
@@ -1238,6 +1307,17 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
1238
1307
  if open { for it in lane.items { rows.append(RowView(item: it, width: w, inTeamSection: true, showSpace: false, onOpen: openRow, onCopy: copyRow)) } }
1239
1308
  }
1240
1309
  }
1310
+ // Goals this person opened with nothing left in them (settled.ts): one collapsed line, a Close each. Never an alert.
1311
+ if !state.settled.isEmpty {
1312
+ sep()
1313
+ let open = boardOpen.contains("settled")
1314
+ rows.append(ActionRow("Settled — close it? · \(state.settled.count)", hint: open ? "hide" : "show", width: w, onClick: { [weak self] in self?.toggleBoardLine("settled") }))
1315
+ if open {
1316
+ for g in state.settled {
1317
+ act("Close “\(g.title.prefix(60))”", (multi && !g.space.isEmpty ? "\(g.space) · " : "") + g.quiet) { [weak self] in self?.closeSettled(g.id, g.space, g.title) }
1318
+ }
1319
+ }
1320
+ }
1241
1321
  // The prompt it hands over asks about every question waiting on this person,
1242
1322
  // put away or not, so the count is of all of them.
1243
1323
  if state.decisions.count > 1 {
@@ -1378,6 +1458,8 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
1378
1458
  let handling = state.items.filter { $0.effectiveLane == "handling" }
1379
1459
  let waiting = state.items.filter { $0.effectiveLane == "waiting" }
1380
1460
  let older = state.items.filter { $0.effectiveLane == "older" }
1461
+ let stale = state.items.filter { $0.effectiveLane == "stale" }
1462
+ let top = topCards(cards)
1381
1463
  let summary = NSMenuItem(title: state.member, action: nil, keyEquivalent: "")
1382
1464
  summary.isEnabled = false
1383
1465
  summary.view = HeaderView(lead: cards.isEmpty ? (state.agentProblem.isEmpty ? "Nothing needs you" : AppDelegate.problemHeading) : "\(cards.count) need\(cards.count == 1 ? "s" : "") you",
@@ -1394,11 +1476,32 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
1394
1476
  for line in state.stuck { for part in AppDelegate.wrap("Not connected: " + line, 100) { info(part) } }
1395
1477
  menu.addItem(.separator())
1396
1478
  let row = { (it: Item) -> NSMenuItem in self.menuRow(it, showSpace: multi) }
1397
- for it in cards { menu.addItem(row(it)) }
1398
- if cards.isEmpty && state.decisionsOk && handling.isEmpty && waiting.isEmpty && older.isEmpty && putAway.isEmpty && state.agentProblem.isEmpty {
1479
+ // The first five cards, each with the earlier decisions in its goal in a submenu of their own; the rest
1480
+ // (and the earlier ones under them) in one submenu — counted as the board panel and the web board count it.
1481
+ for it in top.prefix(5) {
1482
+ menu.addItem(row(it))
1483
+ let earlier = earlierOf(it, in: cards)
1484
+ if !earlier.isEmpty {
1485
+ let mi = NSMenuItem(title: "+\(earlier.count) earlier in this goal", action: nil, keyEquivalent: "")
1486
+ let sub = NSMenu()
1487
+ for e in earlier { sub.addItem(row(e)) }
1488
+ mi.submenu = sub
1489
+ menu.addItem(mi)
1490
+ }
1491
+ }
1492
+ let rest = top.dropFirst(5).flatMap { [$0] + earlierOf($0, in: cards) }
1493
+ if !rest.isEmpty {
1494
+ let mi = NSMenuItem(title: "\(rest.count) more need\(rest.count == 1 ? "s" : "") you", action: nil, keyEquivalent: "")
1495
+ let sub = NSMenu()
1496
+ for it in rest { sub.addItem(row(it)) }
1497
+ mi.submenu = sub
1498
+ menu.addItem(mi)
1499
+ }
1500
+ if cards.isEmpty && state.decisionsOk && handling.isEmpty && waiting.isEmpty && older.isEmpty && stale.isEmpty && putAway.isEmpty && state.agentProblem.isEmpty {
1399
1501
  info("All clear — nothing open for your agents either")
1400
1502
  }
1401
1503
  let lanes: [(String, [Item])] = [
1504
+ ("Still needed? · \(stale.count)", stale),
1402
1505
  ("Your agents are handling · \(handling.count)", handling),
1403
1506
  ("Waiting on teammates · \(waiting.count)", waiting),
1404
1507
  ("Older than a week · \(older.count)", older),
@@ -1412,6 +1515,18 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
1412
1515
  mi.submenu = sub
1413
1516
  menu.addItem(mi)
1414
1517
  }
1518
+ // Goals this person opened with nothing left in them (settled.ts): a submenu, a Close each.
1519
+ if !state.settled.isEmpty {
1520
+ let mi = NSMenuItem(title: "Settled — close it? · \(state.settled.count)", action: nil, keyEquivalent: "")
1521
+ let sub = NSMenu()
1522
+ for g in state.settled {
1523
+ let c = makeItem("Close “\(g.title.prefix(60))”" + (g.quiet.isEmpty ? "" : " — \(g.quiet)"), #selector(closeSettledItem(_:)))
1524
+ c.representedObject = [g.id, g.space, g.title]
1525
+ sub.addItem(c)
1526
+ }
1527
+ mi.submenu = sub
1528
+ menu.addItem(mi)
1529
+ }
1415
1530
  if state.decisions.count > 1 {
1416
1531
  menu.addItem(.separator())
1417
1532
  menu.addItem(makeItem("Review all \(state.decisions.count) questions in \(state.surfaceName)", #selector(openAllDecisions)))
@@ -2121,7 +2236,13 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
2121
2236
  row1.addArrangedSubview(button("Explain in \(state.surfaceName)", #selector(panelOpen),
2122
2237
  "Opens \(state.surfaceName) in the team's folder and asks it to lay out your options. It will not decide or reply for you."))
2123
2238
  if item.isDecision {
2124
- row1.addArrangedSubview(button("Mark done", #selector(panelDone), "Tells the agent you settled this in person, so it stops asking."))
2239
+ row1.addArrangedSubview(button("Mark done", #selector(panelDone(_:)), "Tells the agent you settled this in person, so it stops asking. You can add one line on what happened."))
2240
+ }
2241
+ // Under "Still needed?": the person says the question has gone. Never sent for them (0.35.3).
2242
+ if item.isDecision && item.effectiveLane == "stale" {
2243
+ let moot = button("No longer needed", #selector(panelDone(_:)), "Takes it off your board: your own agent's question is withdrawn; a teammate's is answered \"no longer needed\".")
2244
+ moot.tag = 1
2245
+ row1.addArrangedSubview(moot)
2125
2246
  }
2126
2247
  // Put away until tomorrow morning, on this machine — nothing is sent.
2127
2248
  if item.effectiveLane == "now" {
@@ -2608,12 +2729,41 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
2608
2729
  if boardPanel?.isVisible == true { rebuildBoard() }
2609
2730
  }
2610
2731
 
2611
- @objc private func panelDone() {
2732
+ /// Mark done's one optional line on what happened (0.35.3): whoever asked reads it in the answer.
2733
+ /// Empty is fine — it is sent as before; nil means the person cancelled, and nothing is sent.
2734
+ private func askOutcome() -> String? {
2735
+ let alert = NSAlert()
2736
+ alert.messageText = "Mark done"
2737
+ alert.informativeText = "What happened? Optional — one line. Whoever asked will read it."
2738
+ alert.addButton(withTitle: "Mark done")
2739
+ alert.addButton(withTitle: "Cancel")
2740
+ let field = NSTextField(frame: NSRect(x: 0, y: 0, width: 320, height: 24))
2741
+ field.placeholderString = "e.g. Agreed on a call: ship it Friday"
2742
+ field.stringValue = ""
2743
+ alert.accessoryView = field
2744
+ alert.window.initialFirstResponder = field
2745
+ // No activation of its own: it opens only from a click on the panel, which already has the keyboard.
2746
+ guard alert.runModal() == .alertFirstButtonReturn else { return nil }
2747
+ let line = field.stringValue.components(separatedBy: .newlines).joined(separator: " ").trimmingCharacters(in: .whitespacesAndNewlines)
2748
+ return String(line.prefix(300))
2749
+ }
2750
+
2751
+ /// Mark done (tag 0), or "No longer needed" (tag 1, under "Still needed?"): one path, the action written for `explain --queued`.
2752
+ /// Mark done asks for the optional line on what happened first; "No longer needed" sends no line.
2753
+ @objc private func panelDone(_ sender: NSButton) {
2754
+ let moot = sender.tag == 1
2612
2755
  guard let item = panelItem, item.isDecision else { return }
2613
2756
  if busyHere(panelKey(item)) { return }
2614
- setStatus("Marking it done…")
2615
- var payload: [String: Any] = ["action": "done", "decision": item.id, "space": item.space]
2757
+ var outcome = ""
2758
+ if !moot {
2759
+ guard let line = askOutcome() else { return }
2760
+ if busyHere(panelKey(item)) { return }
2761
+ outcome = line
2762
+ }
2763
+ setStatus(moot ? "Setting it aside…" : "Marking it done…")
2764
+ var payload: [String: Any] = ["action": moot ? "moot" : "done", "decision": item.id, "space": item.space]
2616
2765
  if !item.ref.isEmpty { payload["act"] = item.ref }
2766
+ if !outcome.isEmpty { payload["body"] = outcome }
2617
2767
  guard let aid = queueAction(payload) else {
2618
2768
  setStatus("Could not write the action. Use Show the thread instead.")
2619
2769
  return
@@ -2629,8 +2779,8 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
2629
2779
  // On the decision it was about (#110): never "Done" on another decision opened since.
2630
2780
  let v = self.queuedVerdict(r, aid)
2631
2781
  self.say(k, v.ok
2632
- ? "Done — it is no longer waiting on you." + self.settledNote(k, item)
2633
- : v.unsure || self.actionOutcome(r?.out).hasPrefix("not sent: ") ? v.why : "Could not mark it done. Use Show the thread instead.")
2782
+ ? (moot ? "Set aside — it is no longer on your board." : "Done — it is no longer waiting on you.") + self.settledNote(k, item)
2783
+ : v.unsure || self.actionOutcome(r?.out).hasPrefix("not sent: ") ? v.why : moot ? "Could not set it aside. Use Show the thread instead." : "Could not mark it done. Use Show the thread instead.")
2634
2784
  self.refresh()
2635
2785
  }
2636
2786
  }
@@ -2832,6 +2982,32 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
2832
2982
  return mi
2833
2983
  }
2834
2984
 
2985
+ @objc private func closeSettledItem(_ sender: NSMenuItem) {
2986
+ guard let v = sender.representedObject as? [String], v.count == 3 else { return }
2987
+ closeSettled(v[0], v[1], v[2])
2988
+ }
2989
+ /// Close on a settled goal (settled.ts): `pantheon goal close <id> --settled`, which asks the relay first that it is
2990
+ /// still open, still this person's and still settled — a goal that came alive meanwhile stays open.
2991
+ private func closeSettled(_ goal: String, _ space: String, _ title: String) {
2992
+ guard workerAction == nil else { return }
2993
+ workerAction = "Closing “\(title.prefix(40))”…"
2994
+ actionError = nil
2995
+ paint()
2996
+ if let menu = item.menu { menuNeedsUpdate(menu) }
2997
+ var args = ["goal", "close", goal, "--settled"]
2998
+ if !space.isEmpty { args += ["--space", space] }
2999
+ DispatchQueue.global().async {
3000
+ let result = run(pantheonBin, args, timeout: 60)
3001
+ DispatchQueue.main.async {
3002
+ self.workerAction = nil
3003
+ if result?.code != 0 {
3004
+ let why = (result?.out ?? "").split(separator: "\n").first(where: { $0.hasPrefix("not sent: ") }).map { String($0.dropFirst("not sent: ".count)) }
3005
+ self.reportFailure("Could not close it — " + (why ?? "open status in Terminal to see."))
3006
+ }
3007
+ self.refresh()
3008
+ }
3009
+ }
3010
+ }
2835
3011
  @objc private func forgetGoneItem(_ sender: NSMenuItem) {
2836
3012
  guard let pair = sender.representedObject as? [String], pair.count == 2 else { return }
2837
3013
  forgetTeam(pair[0], pair[1])
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "format": 1,
3
- "built_at": "2026-10-21T11:54:32.597Z",
3
+ "built_at": "2026-10-26T10:29:40.661Z",
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": "593d26e1ee08f6ffe23d691bf29a9b64b3a871a42f2661b8a3c0f9ce921852d0",
9
- "sha256": "4b3c933fd385031fca2615e21557fadae73f29de8f0718ea1de7f7fffb68db03",
8
+ "source_sha256": "b9beaac4b0a4fd58267c58343044742f356ffe709af85ae84f16a43e989dd897",
9
+ "sha256": "28436afa6d1f58d91598e0df79fbc4365fe08fa9425738b9ccfaa2c7b98cb380",
10
10
  "archs": [
11
11
  "arm64",
12
12
  "x86_64"
Binary file
@@ -452,7 +452,8 @@ function global:Read-Status($json) {
452
452
  $lane = [string]$i.lane
453
453
  $kind = [string]$i.kind
454
454
  # The board's cards: lane "now", or a row from an older CLI without lanes that is not a wait (menubar.swift effectiveLane).
455
- if ($lane -eq 'now' -or (@('now', 'handling', 'waiting', 'older') -notcontains $lane -and $kind -ne 'waiting')) { $need++ }
455
+ # "stale" (Still needed?, 0.35.3) is a decision that may have gone: on the board, not in the count.
456
+ if ($lane -eq 'now' -or (@('now', 'handling', 'waiting', 'older', 'stale') -notcontains $lane -and $kind -ne 'waiting')) { $need++ }
456
457
  }
457
458
  # A setup change waiting for the person (it is one of the items above, a card: counted there).
458
459
  $changes = @(Read-PendingChanges $j.pending_changes)
@@ -660,6 +660,23 @@ function Install-Pantheon {
660
660
  # one that signs in, and behind a TLS-inspecting proxy the relay's
661
661
  # certificate chains only to the company root in the Windows store.
662
662
  $line = ConvertTo-ArgLine (@($ca) + @($entry) + $Arguments)
663
+ # start and join end on "You're ready" or a list of what is left
664
+ # (finish-line.ts), and write which it was here: `pantheon doctor` is
665
+ # suggested only when something is left, or when nothing was written.
666
+ $State.ready = $false
667
+ $finishFile = Join-Path ([IO.Path]::GetTempPath()) ('pantheon-finish-' + [Guid]::NewGuid().ToString('N').Substring(0, 8))
668
+ $env:PANTHEON_FINISH_FILE = $finishFile
669
+ try {
670
+ Invoke-PantheonRun $nodeExe $line $Arguments
671
+ } finally {
672
+ try { if ((Test-Path -LiteralPath $finishFile) -and ([IO.File]::ReadAllText($finishFile).Trim() -eq 'ready')) { $State.ready = $true } } catch { $State.ready = $false }
673
+ Remove-Item -LiteralPath $finishFile -Force -ErrorAction SilentlyContinue
674
+ Remove-Item Env:PANTHEON_FINISH_FILE -ErrorAction SilentlyContinue
675
+ }
676
+ }
677
+
678
+ # The run itself: pantheon on this console, or, with no console, on an empty input.
679
+ function Invoke-PantheonRun([string]$nodeExe, [string]$line, [string[]]$Arguments) {
663
680
  $noConsole = $false
664
681
  try { $noConsole = [Console]::IsInputRedirected } catch { $noConsole = $false }
665
682
  if (-not $noConsole) {
@@ -1217,7 +1234,7 @@ function Install-Pantheon {
1217
1234
  }
1218
1235
  Say ''
1219
1236
  Invoke-PantheonHandoff $nodeExe $entry $ca $Arguments
1220
- if ($State.code -eq 0 -and -not $State.said) {
1237
+ if ($State.code -eq 0 -and -not $State.said -and -not $State.ready) {
1221
1238
  Say ''
1222
1239
  Say "Next, in this window: $(& $nextFor @('doctor')) (checks that everything works)"
1223
1240
  & $byPathNote
@@ -1239,7 +1256,7 @@ function Install-Pantheon {
1239
1256
  try {
1240
1257
  Say ''
1241
1258
  Invoke-PantheonHandoff $nodeExe $entry $caNow $Arguments
1242
- if ($State.code -eq 0 -and -not $State.said -and $nextFor) {
1259
+ if ($State.code -eq 0 -and -not $State.said -and -not $State.ready -and $nextFor) {
1243
1260
  Say ''
1244
1261
  Say "Next, in this window: $(& $nextFor @('doctor')) (checks that everything works)"
1245
1262
  & $byPathNote
@@ -713,15 +713,30 @@ export PATH
713
713
  # this terminal. Not exec, so there is a last line; Ctrl-C still reaches
714
714
  # pantheon (a trap is reset in a child, where an ignored signal would not be)
715
715
  # and this shell waits for it rather than dying first.
716
+ # start and join end on "You're ready" or a list of what is left (finish-line.ts),
717
+ # and write which it was here: `pantheon doctor` is suggested only when something
718
+ # is left -- or when nothing was written (another command, an older pantheon).
719
+ FINISH_FILE=$(mktemp 2>/dev/null || true)
720
+ if [ -n "$FINISH_FILE" ]; then
721
+ PANTHEON_FINISH_FILE=$FINISH_FILE
722
+ export PANTHEON_FINISH_FILE
723
+ fi
716
724
  finish() {
725
+ ready=""
726
+ if [ -n "$FINISH_FILE" ]; then
727
+ if [ "$(cat "$FINISH_FILE" 2>/dev/null)" = "ready" ]; then ready=1; fi
728
+ rm -f "$FINISH_FILE"
729
+ fi
717
730
  # 3: pantheon ended having said what happens next, and nothing failed -- a
718
731
  # seat move that waits for a teammate to confirm it (recover, or a join of a
719
732
  # team this person is already in). Its words stay the last ones, and the
720
733
  # install is not reported as failed.
721
734
  if [ "$1" -eq 3 ]; then exit 0; fi
722
735
  if [ "$1" -eq 0 ]; then
723
- say ""
724
- say "Next, in this terminal: $(next_line doctor) (checks that everything works)"
736
+ if [ -z "$ready" ]; then
737
+ say ""
738
+ say "Next, in this terminal: $(next_line doctor) (checks that everything works)"
739
+ fi
725
740
  by_path_note
726
741
  fi
727
742
  exit "$1"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@join-pantheon/cli",
3
- "version": "0.35.2-rc.2",
3
+ "version": "0.35.3-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": {