@harborppm/cli 0.113.0 → 0.115.0
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/README.md +1 -1
- package/dist/app.mjs +1101 -385
- package/lib/cli.mjs +1 -1
- package/lib/format.mjs +94 -30
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -4912,7 +4912,7 @@ export async function run(argv, io = {}) {
|
|
|
4912
4912
|
"agent_update",
|
|
4913
4913
|
{ harbor, task, note, status: values.start ? "doing" : "review", agent: values.agent },
|
|
4914
4914
|
(r) =>
|
|
4915
|
-
`${r.updated.key ?? r.updated.title} is ${r.updated.status === "review" ? "in review for a person to check" : "in play"}, with ${r.commentedAs}'s note
|
|
4915
|
+
`${r.updated.key ?? r.updated.title} is ${r.updated.status === "review" ? "in review for a person to check" : "in play"}, with ${r.commentedAs}'s note.${r.toCheck ? ` ${r.toCheck}` : ""}`,
|
|
4916
4916
|
);
|
|
4917
4917
|
}
|
|
4918
4918
|
case "lifeboats": {
|
package/lib/format.mjs
CHANGED
|
@@ -48,7 +48,11 @@ export function taskLine(t, { today, mine = false, width } = {}) {
|
|
|
48
48
|
statusText(t),
|
|
49
49
|
t.due ? (late ? `late, due ${t.due}` : soon ? `due ${soon}` : `due ${t.due}`) : null,
|
|
50
50
|
t.priority && t.priority !== "medium" ? t.priority : null,
|
|
51
|
-
mine
|
|
51
|
+
mine
|
|
52
|
+
? null
|
|
53
|
+
: t.assignee
|
|
54
|
+
? `${t.assignee}${t.alsoOn?.length ? ` +${t.alsoOn.length}` : ""}`
|
|
55
|
+
: null,
|
|
52
56
|
t.project ?? null,
|
|
53
57
|
t.waitingOn ? `waits on ${t.waitingOn}` : null,
|
|
54
58
|
].filter(Boolean);
|
|
@@ -243,7 +247,8 @@ export function whoami(r, creds) {
|
|
|
243
247
|
* says nothing about itself, which means it's older than this CLI's whoami.
|
|
244
248
|
*/
|
|
245
249
|
export function serverLine(server) {
|
|
246
|
-
if (!server?.builtAt)
|
|
250
|
+
if (!server?.builtAt)
|
|
251
|
+
return "Server: an older build that doesn't say which; some commands may not be there yet.";
|
|
247
252
|
const at = `${monthDay(server.builtAt)} ${server.builtAt.slice(11, 16)} UTC`;
|
|
248
253
|
return `Server: built ${at}${server.commit ? ` from ${server.commit.slice(0, 7)}` : ""}.`;
|
|
249
254
|
}
|
|
@@ -695,7 +700,9 @@ export function barnaclesText(r) {
|
|
|
695
700
|
return head.join("\n");
|
|
696
701
|
}
|
|
697
702
|
if (!r.added) {
|
|
698
|
-
head.push(
|
|
703
|
+
head.push(
|
|
704
|
+
`Nothing added since the plan was set (${r.since.slice(0, 10)}): ${r.planned} task${r.planned === 1 ? "" : "s"}, as planned.`,
|
|
705
|
+
);
|
|
699
706
|
return head.join("\n");
|
|
700
707
|
}
|
|
701
708
|
head.push(`${r.headline} (${r.planned} planned, ${r.addedThisWeek} added this week).`);
|
|
@@ -703,7 +710,8 @@ export function barnaclesText(r) {
|
|
|
703
710
|
if (r.caveat) head.push(r.caveat);
|
|
704
711
|
const top = Math.max(1, ...r.byWeek.map((w) => w.added));
|
|
705
712
|
const weeks = r.byWeek.map(
|
|
706
|
-
(w) =>
|
|
713
|
+
(w) =>
|
|
714
|
+
` w/c ${w.weekOf} ${"█".repeat(Math.max(1, Math.round((w.added / top) * 20)))} ${w.added}`,
|
|
707
715
|
);
|
|
708
716
|
const who = r.byWho.map((w) => `${w.who ?? "not recorded"} ${w.added}`).join(", ");
|
|
709
717
|
const from =
|
|
@@ -882,7 +890,9 @@ export function landfallText(project, lf) {
|
|
|
882
890
|
if (lf.measure) lines.push(` Counting ${lf.measure}`);
|
|
883
891
|
if (lf.result) {
|
|
884
892
|
const value =
|
|
885
|
-
lf.value != null
|
|
893
|
+
lf.value != null
|
|
894
|
+
? ` · ${Number(lf.value).toLocaleString("en-US")}${lf.measure ? ` ${lf.measure}` : ""}`
|
|
895
|
+
: "";
|
|
886
896
|
lines.push(` Answer ${LANDFALL_RESULT[lf.result] ?? lf.result}${value}`);
|
|
887
897
|
if (lf.note) lines.push(` ${lf.note}`);
|
|
888
898
|
if (lf.answeredOn)
|
|
@@ -1068,6 +1078,10 @@ export function agentWorkText(r) {
|
|
|
1068
1078
|
"",
|
|
1069
1079
|
`${t.key ?? t.id} ${t.title} (${bits.join(", ")}${t.project ? `, ${t.project}` : ""})`,
|
|
1070
1080
|
);
|
|
1081
|
+
if (t.sentBack)
|
|
1082
|
+
lines.push(
|
|
1083
|
+
` Sent back by ${t.sentBack.by ?? "someone"}${t.sentBack.note ? `: ${t.sentBack.note}` : ", with no note."}`,
|
|
1084
|
+
);
|
|
1071
1085
|
if (t.notes) lines.push(...t.notes.split("\n").map((l) => ` ${l}`));
|
|
1072
1086
|
for (const c of t.checklist ?? []) lines.push(` [${c.done ? "x" : " "}] ${c.step}`);
|
|
1073
1087
|
for (const c of t.comments ?? []) lines.push(` ${c.author ?? "Someone"}: ${c.body}`);
|
|
@@ -1076,7 +1090,7 @@ export function agentWorkText(r) {
|
|
|
1076
1090
|
if (r.forReview?.length)
|
|
1077
1091
|
lines.push(
|
|
1078
1092
|
"",
|
|
1079
|
-
`Waiting for a person to check: ${r.forReview.map((t) => t.key ?? t.title).join(", ")}.`,
|
|
1093
|
+
`Waiting for a person to check: ${r.forReview.map((t) => `${t.key ?? t.title}${t.waitingOn ? ` (with ${t.waitingOn})` : ""}`).join(", ")}.`,
|
|
1080
1094
|
);
|
|
1081
1095
|
lines.push(
|
|
1082
1096
|
"",
|
|
@@ -1224,7 +1238,12 @@ export function scuttleText(r) {
|
|
|
1224
1238
|
for (const s of p.signs) lines.push(` ${s.text}`);
|
|
1225
1239
|
const frees = [
|
|
1226
1240
|
`${p.openTasks} open task${p.openTasks === 1 ? "" : "s"}`,
|
|
1227
|
-
p.crew.length
|
|
1241
|
+
p.crew.length
|
|
1242
|
+
? `with ${p.crew
|
|
1243
|
+
.map((c) => c.person)
|
|
1244
|
+
.filter(Boolean)
|
|
1245
|
+
.join(", ")}`
|
|
1246
|
+
: null,
|
|
1228
1247
|
p.hoursPerWeek ? `${p.hoursPerWeek}h a week logged` : null,
|
|
1229
1248
|
p.spendPerWeek ? `$${p.spendPerWeek.toLocaleString("en-US")} a week of spend` : null,
|
|
1230
1249
|
];
|
|
@@ -1292,13 +1311,15 @@ export function baselineData(p, { dryRun = false, reset = false } = {}) {
|
|
|
1292
1311
|
...(dryRun
|
|
1293
1312
|
? {
|
|
1294
1313
|
dryRun: true,
|
|
1295
|
-
wouldSet:
|
|
1314
|
+
wouldSet:
|
|
1315
|
+
!has || reset ? { baselineStart: p.starts ?? null, baselineEnd: p.ends ?? null } : null,
|
|
1296
1316
|
}
|
|
1297
1317
|
: {}),
|
|
1298
1318
|
};
|
|
1299
1319
|
}
|
|
1300
1320
|
|
|
1301
|
-
const span = (from, to) =>
|
|
1321
|
+
const span = (from, to) =>
|
|
1322
|
+
from ? `${monthDay(from)} – ${monthDay(to)}` : `ending ${monthDay(to)}`;
|
|
1302
1323
|
|
|
1303
1324
|
export function baselineText(b) {
|
|
1304
1325
|
const name = b.project;
|
|
@@ -1310,7 +1331,8 @@ export function baselineText(b) {
|
|
|
1310
1331
|
if (!b.wouldSet) {
|
|
1311
1332
|
return `${name} already has a baseline (${span(b.baselineStart, b.baselineEnd)}); --reset would replace it${now ? ` with ${now}` : ""}. Nothing changed.`;
|
|
1312
1333
|
}
|
|
1313
|
-
if (!now)
|
|
1334
|
+
if (!now)
|
|
1335
|
+
return `${name} has no start and end dates yet, so there's nothing to set as its baseline.`;
|
|
1314
1336
|
return `Would set ${name}'s baseline: ${now}${had ? `, replacing ${span(b.baselineStart, b.baselineEnd)}` : ""}. Nothing changed; leave out --dry-run to set it.`;
|
|
1315
1337
|
}
|
|
1316
1338
|
if (!had) {
|
|
@@ -1318,11 +1340,14 @@ export function baselineText(b) {
|
|
|
1318
1340
|
? `${name}: no baseline yet. harbor baseline "${name}" --set commits its dates now (${now}).`
|
|
1319
1341
|
: `${name}: no baseline yet, and no start and end dates to set one from.`;
|
|
1320
1342
|
}
|
|
1321
|
-
const moved =
|
|
1322
|
-
|
|
1343
|
+
const moved =
|
|
1344
|
+
now && (b.starts !== b.baselineStart || b.ends !== b.baselineEnd) && b.baselineStart;
|
|
1345
|
+
return [
|
|
1346
|
+
`${name}: ${had}`,
|
|
1347
|
+
...(moved ? [`Its dates now: ${now}. --reset makes those the baseline.`] : []),
|
|
1348
|
+
].join("\n");
|
|
1323
1349
|
}
|
|
1324
1350
|
|
|
1325
|
-
|
|
1326
1351
|
/** catch_up as the terminal shows it: the three to look at first, the calls made without you, what moved. */
|
|
1327
1352
|
export function catchupText(r) {
|
|
1328
1353
|
if (!r.you) return r.note ?? "Nothing to catch up on.";
|
|
@@ -1341,7 +1366,8 @@ export function catchupText(r) {
|
|
|
1341
1366
|
}
|
|
1342
1367
|
if (r.decisions.length) {
|
|
1343
1368
|
out.push("", "Decided without you:");
|
|
1344
|
-
for (const d of r.decisions)
|
|
1369
|
+
for (const d of r.decisions)
|
|
1370
|
+
out.push(` ${d.title}${d.by ? ` · ${d.by.split(" ")[0]}` : ""} (${monthDay(d.decidedAt)})`);
|
|
1345
1371
|
}
|
|
1346
1372
|
if (r.moved.length) {
|
|
1347
1373
|
out.push("", "What moved:");
|
|
@@ -1349,13 +1375,16 @@ export function catchupText(r) {
|
|
|
1349
1375
|
const bits = [
|
|
1350
1376
|
m.done ? `${m.done} done` : null,
|
|
1351
1377
|
m.added ? `${m.added} added` : null,
|
|
1352
|
-
m.health
|
|
1378
|
+
m.health
|
|
1379
|
+
? `now ${HEALTH[m.health.to] ?? m.health.to} (was ${HEALTH[m.health.from] ?? m.health.from})`
|
|
1380
|
+
: null,
|
|
1353
1381
|
].filter(Boolean);
|
|
1354
1382
|
out.push(` ${m.key ? `${m.key} ` : ""}${m.project}: ${bits.join(", ")}`);
|
|
1355
1383
|
}
|
|
1356
1384
|
}
|
|
1357
1385
|
const more = r.handed.length > r.lookFirst.filter((l) => l.kind === "handed").length;
|
|
1358
|
-
if (more)
|
|
1386
|
+
if (more)
|
|
1387
|
+
out.push("", `${r.handed.length} handed to you in all; harbor catchup --json lists them.`);
|
|
1359
1388
|
return out.join("\n");
|
|
1360
1389
|
}
|
|
1361
1390
|
|
|
@@ -1377,9 +1406,16 @@ export function templatesText(r) {
|
|
|
1377
1406
|
if (t.priority && t.priority !== "medium") bits.push(`${t.priority} priority`);
|
|
1378
1407
|
if (t.owner) bits.push(t.owner);
|
|
1379
1408
|
if (t.dueInDays != null)
|
|
1380
|
-
bits.push(
|
|
1381
|
-
|
|
1382
|
-
|
|
1409
|
+
bits.push(
|
|
1410
|
+
t.dueInDays === 0
|
|
1411
|
+
? "due the day it's made"
|
|
1412
|
+
: `due in ${t.dueInDays} ${t.dueInDays === 1 ? "day" : "days"}`,
|
|
1413
|
+
);
|
|
1414
|
+
if (t.checklist?.length)
|
|
1415
|
+
bits.push(`${t.checklist.length} checklist ${t.checklist.length === 1 ? "item" : "items"}`);
|
|
1416
|
+
lines.push(
|
|
1417
|
+
` ${t.name}${t.title !== t.name ? `: ${t.title}` : ""}${bits.length ? ` (${bits.join(", ")})` : ""}`,
|
|
1418
|
+
);
|
|
1383
1419
|
}
|
|
1384
1420
|
return lines.join("\n");
|
|
1385
1421
|
}
|
|
@@ -1389,8 +1425,15 @@ export function approvalsText(r) {
|
|
|
1389
1425
|
if (!list.length) return "Nothing is waiting on your approval.";
|
|
1390
1426
|
const lines = [`Waiting on your approval (${list.length}):`];
|
|
1391
1427
|
for (const t of list)
|
|
1392
|
-
lines.push(
|
|
1393
|
-
|
|
1428
|
+
lines.push(
|
|
1429
|
+
` ${t.key ?? t.id} ${t.title} (${t.askedByAgent ? "handed in" : "asked"} by ${t.askedBy ?? "someone"}${t.asked ? `, ${t.asked}` : ""}${t.askedByAgent ? "; an agent's work" : ""})`,
|
|
1430
|
+
);
|
|
1431
|
+
lines.push("", 'harbor approve TASK approves one; --changes "NOTE" sends it back.');
|
|
1432
|
+
if (list.some((t) => t.askedByAgent))
|
|
1433
|
+
lines.push(
|
|
1434
|
+
"An agent's work is approved on the website or in the terminal app (harbor), not here;",
|
|
1435
|
+
'--changes "NOTE" still sends it back.',
|
|
1436
|
+
);
|
|
1394
1437
|
return lines.join("\n");
|
|
1395
1438
|
}
|
|
1396
1439
|
|
|
@@ -1597,22 +1640,32 @@ export function directLineText(m) {
|
|
|
1597
1640
|
if (m.event === "left") return `· ${m.who} left · ${when}`;
|
|
1598
1641
|
if (m.event === "joined") return `· ${m.who} added ${m.detail ?? "someone"} · ${when}`;
|
|
1599
1642
|
if (m.event === "renamed")
|
|
1600
|
-
return m.detail
|
|
1643
|
+
return m.detail
|
|
1644
|
+
? `· ${m.who} named it “${m.detail}” · ${when}`
|
|
1645
|
+
: `· ${m.who} took its name off · ${when}`;
|
|
1601
1646
|
return `${m.who} · ${when}: ${(m.text ?? "").replace(/\s*\n\s*/g, " / ")}`;
|
|
1602
1647
|
}
|
|
1603
1648
|
|
|
1604
1649
|
/** read_direct: the chat's messages, oldest first. */
|
|
1605
1650
|
export function directText(r) {
|
|
1606
|
-
const head =
|
|
1651
|
+
const head =
|
|
1652
|
+
r.chat.kind === "pair"
|
|
1653
|
+
? `Chat with ${r.chat.title}`
|
|
1654
|
+
: `${r.chat.title} (${r.chat.with.join(", ")})`;
|
|
1607
1655
|
const list = r.messages ?? [];
|
|
1608
1656
|
if (!list.length) return `${head}\nNothing yet. Only the people in it can read it.`;
|
|
1609
|
-
return [
|
|
1657
|
+
return [
|
|
1658
|
+
head,
|
|
1659
|
+
...(r.more ? ["Earlier messages left out (--limit N shows more)."] : []),
|
|
1660
|
+
...list.map(directLineText),
|
|
1661
|
+
].join("\n");
|
|
1610
1662
|
}
|
|
1611
1663
|
|
|
1612
1664
|
/** direct_chats: your direct messages, newest first. */
|
|
1613
1665
|
export function chatsText(r) {
|
|
1614
1666
|
const chats = r.chats ?? [];
|
|
1615
|
-
if (!chats.length)
|
|
1667
|
+
if (!chats.length)
|
|
1668
|
+
return 'No direct messages yet. harbor chat @NAME "TEXT" writes to someone; @a,@b starts a group.';
|
|
1616
1669
|
const out = [`${chats.length} ${chats.length === 1 ? "chat" : "chats"} in ${r.harbor.name}`];
|
|
1617
1670
|
for (const c of chats) {
|
|
1618
1671
|
out.push(
|
|
@@ -1636,7 +1689,10 @@ export function convoysText(r) {
|
|
|
1636
1689
|
return 'No convoys yet. One program asks another with harbor convoy ask PROGRAM --to OTHER "WHAT" --by DATE.';
|
|
1637
1690
|
const lines = [`${r.convoys.length} ${r.convoys.length === 1 ? "convoy" : "convoys"}:`, ""];
|
|
1638
1691
|
for (const c of r.convoys)
|
|
1639
|
-
lines.push(
|
|
1692
|
+
lines.push(
|
|
1693
|
+
` ${c.from} asks ${c.to ?? "a deleted program"} for “${c.what}” by ${c.by.slice(0, 10)}`,
|
|
1694
|
+
` ${c.text}`,
|
|
1695
|
+
);
|
|
1640
1696
|
return lines.join("\n");
|
|
1641
1697
|
}
|
|
1642
1698
|
if (!r.waitingOn.length && !r.waitedOnBy.length)
|
|
@@ -1684,7 +1740,8 @@ export function saltsText(r) {
|
|
|
1684
1740
|
|
|
1685
1741
|
/** What harbor salts --risk, --task or --put-away did. */
|
|
1686
1742
|
export function heedSaltText(r) {
|
|
1687
|
-
if (r.putAway)
|
|
1743
|
+
if (r.putAway)
|
|
1744
|
+
return `Put away “${r.putAway}” (from ${r.from}); it won't show on ${r.project} again.`;
|
|
1688
1745
|
if (r.added === "risk") return `Added a risk to ${r.project}: “${r.title}” (from ${r.from}).`;
|
|
1689
1746
|
return `Added a task to ${r.project}${r.key ? ` as ${r.key}` : ""}: “${r.title}” (from ${r.from}).`;
|
|
1690
1747
|
}
|
|
@@ -1693,7 +1750,10 @@ export function heedSaltText(r) {
|
|
|
1693
1750
|
export function rankText(r) {
|
|
1694
1751
|
const lines = [];
|
|
1695
1752
|
if (r.kept && r.kept.order.length) {
|
|
1696
|
-
const who = [
|
|
1753
|
+
const who = [
|
|
1754
|
+
r.kept.by ? `by ${r.kept.by}` : null,
|
|
1755
|
+
r.kept.at ? `on ${r.kept.at.slice(0, 10)}` : null,
|
|
1756
|
+
]
|
|
1697
1757
|
.filter(Boolean)
|
|
1698
1758
|
.join(" ");
|
|
1699
1759
|
const from = r.kept.voters > 1 ? `, from ${r.kept.voters} people's answers` : "";
|
|
@@ -1711,9 +1771,13 @@ export function rankText(r) {
|
|
|
1711
1771
|
lines.push("");
|
|
1712
1772
|
const state = r.link.open ? "open" : "closed";
|
|
1713
1773
|
const counted = `${r.link.voters} ${r.link.voters === 1 ? "person" : "people"}, ${r.link.answers} ${r.link.answers === 1 ? "answer" : "answers"}`;
|
|
1714
|
-
lines.push(
|
|
1774
|
+
lines.push(
|
|
1775
|
+
`The ranking link made ${r.link.made.slice(0, 10)} is ${state}: ${counted}${r.link.url ? `\n ${r.link.url}` : ""}`,
|
|
1776
|
+
);
|
|
1715
1777
|
for (const p of r.link.standing)
|
|
1716
|
-
lines.push(
|
|
1778
|
+
lines.push(
|
|
1779
|
+
` ${p.place.padEnd(5)} ${p.project}${p.overNext ? ` · ${p.overNext} over the next` : ""}`,
|
|
1780
|
+
);
|
|
1717
1781
|
}
|
|
1718
1782
|
if (r.openProjects >= 2)
|
|
1719
1783
|
lines.push(
|