@harborppm/cli 0.104.0 → 0.106.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 +2 -0
- package/dist/app.mjs +4684 -3717
- package/lib/cli.mjs +37 -7
- package/lib/format.mjs +7 -0
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -40,6 +40,7 @@ import {
|
|
|
40
40
|
chatText,
|
|
41
41
|
chatLineText,
|
|
42
42
|
chatWhere,
|
|
43
|
+
digestText,
|
|
43
44
|
charterText,
|
|
44
45
|
landfallText,
|
|
45
46
|
loadLineCliText,
|
|
@@ -135,6 +136,8 @@ export const HELP = `harbor: Harbor from the terminal
|
|
|
135
136
|
what you're also on
|
|
136
137
|
harbor catchup [--since DATE] while you were away: handed to
|
|
137
138
|
you, decided, what moved
|
|
139
|
+
harbor digest [--program P] [--hours N] what changed in the last day on
|
|
140
|
+
your work, or in one program
|
|
138
141
|
harbor clock [NAME] [--zone ZONE|here|none] [--hours 9-17]
|
|
139
142
|
who's working now, or set your
|
|
140
143
|
(or NAME's) time zone and hours
|
|
@@ -1042,8 +1045,8 @@ const DETAIL = {
|
|
|
1042
1045
|
" harbor shore PROGRAM --url URL writes: posts go to this Slack, Discord,",
|
|
1043
1046
|
" Teams or Google Chat webhook address",
|
|
1044
1047
|
" harbor shore PROGRAM --on KINDS writes: turns posts on; KINDS are",
|
|
1045
|
-
" forecast, health, notes and
|
|
1046
|
-
" with commas",
|
|
1048
|
+
" forecast, health, notes, messages and",
|
|
1049
|
+
" digest, with commas",
|
|
1047
1050
|
" harbor shore PROGRAM --off KINDS writes: turns them off",
|
|
1048
1051
|
" harbor shore PROGRAM --test writes: sends a test post",
|
|
1049
1052
|
" harbor shore PROGRAM --remove writes: stops posting and forgets the",
|
|
@@ -1051,7 +1054,8 @@ const DETAIL = {
|
|
|
1051
1054
|
"",
|
|
1052
1055
|
" forecast is the morning harbor forecast, health a line when the program or",
|
|
1053
1056
|
" one of its projects changes health, notes a note for later when it opens,",
|
|
1054
|
-
" messages each new message or reply on the program or its projects
|
|
1057
|
+
" messages each new message or reply on the program or its projects, digest",
|
|
1058
|
+
" a morning post of what changed the day before (nothing on a quiet day).",
|
|
1055
1059
|
" Every post links back to Harbor. A new channel posts nothing until you turn",
|
|
1056
1060
|
" something on. The address is a secret: once saved, only a hint of it shows.",
|
|
1057
1061
|
],
|
|
@@ -1530,6 +1534,17 @@ const DETAIL = {
|
|
|
1530
1534
|
" counts tasks added from now on as growth. On the website a program's",
|
|
1531
1535
|
" Set baseline does the same for all its projects.",
|
|
1532
1536
|
],
|
|
1537
|
+
digest: [
|
|
1538
|
+
" harbor digest reads what changed in the last day",
|
|
1539
|
+
" on your projects",
|
|
1540
|
+
" harbor digest --program P reads it for one program",
|
|
1541
|
+
" harbor digest --hours 72 reads it further back (up to 168)",
|
|
1542
|
+
"",
|
|
1543
|
+
" Tasks finished and added, health that moved, risks and issues raised,",
|
|
1544
|
+
" decisions made, and where people talked: the same as the top of the",
|
|
1545
|
+
" Inbox, and the morning post harbor shore P --on digest sends to a",
|
|
1546
|
+
" program's chat channel.",
|
|
1547
|
+
],
|
|
1533
1548
|
catchup: [
|
|
1534
1549
|
" harbor catchup reads the catch-up the app opens on",
|
|
1535
1550
|
" harbor catchup --since DATE reads it from a day (YYYY-MM-DD)",
|
|
@@ -2808,10 +2823,12 @@ export async function run(argv, io = {}) {
|
|
|
2808
2823
|
.split(",")
|
|
2809
2824
|
.map((k) => k.trim().toLowerCase())
|
|
2810
2825
|
.filter(Boolean);
|
|
2811
|
-
const bad = list.find(
|
|
2826
|
+
const bad = list.find(
|
|
2827
|
+
(k) => !["forecast", "health", "notes", "messages", "digest"].includes(k),
|
|
2828
|
+
);
|
|
2812
2829
|
if (bad || !list.length)
|
|
2813
2830
|
throw new HarborError(
|
|
2814
|
-
`--${flag} takes forecast, health, notes or
|
|
2831
|
+
`--${flag} takes forecast, health, notes, messages or digest, with commas between.`,
|
|
2815
2832
|
);
|
|
2816
2833
|
return list;
|
|
2817
2834
|
};
|
|
@@ -2853,10 +2870,11 @@ export async function run(argv, io = {}) {
|
|
|
2853
2870
|
health: "health changes",
|
|
2854
2871
|
notes: "notes when they open",
|
|
2855
2872
|
messages: "messages",
|
|
2873
|
+
digest: "what changed each morning",
|
|
2856
2874
|
};
|
|
2857
|
-
const posts = ["forecast", "health", "notes", "messages"].filter((k) => r.hook[k]).map((k) => label[k]);
|
|
2875
|
+
const posts = ["forecast", "health", "notes", "messages", "digest"].filter((k) => r.hook[k]).map((k) => label[k]);
|
|
2858
2876
|
const lines = [
|
|
2859
|
-
`${r.program} posts to ${r.hook.service} (${r.hook.hint}): ${posts.length ? posts.join(", ") : "nothing yet; --on forecast,health,notes,messages turns posts on"}.`,
|
|
2877
|
+
`${r.program} posts to ${r.hook.service} (${r.hook.hint}): ${posts.length ? posts.join(", ") : "nothing yet; --on forecast,health,notes,messages,digest turns posts on"}.`,
|
|
2860
2878
|
];
|
|
2861
2879
|
if (r.hook.failures > 0)
|
|
2862
2880
|
lines.push(
|
|
@@ -4134,6 +4152,18 @@ export async function run(argv, io = {}) {
|
|
|
4134
4152
|
if (!of) throw new HarborError("Say what: a project, a task key like RR-42, or a milestone.");
|
|
4135
4153
|
return call("long_pole", { harbor, of }, whyText);
|
|
4136
4154
|
}
|
|
4155
|
+
case "digest": {
|
|
4156
|
+
const { positionals, values, harbor } = parse(spec([], ["program", "hours"]));
|
|
4157
|
+
none(positionals);
|
|
4158
|
+
const hours = values.hours === undefined ? undefined : Number(values.hours);
|
|
4159
|
+
if (hours !== undefined && (!Number.isInteger(hours) || hours < 1 || hours > 168))
|
|
4160
|
+
throw new HarborError("--hours is a whole number from 1 to 168.");
|
|
4161
|
+
return call(
|
|
4162
|
+
"daily_digest",
|
|
4163
|
+
{ harbor, ...(values.program ? { program: values.program } : {}), ...(hours ? { hours } : {}) },
|
|
4164
|
+
(r) => digestText(r, hours),
|
|
4165
|
+
);
|
|
4166
|
+
}
|
|
4137
4167
|
case "catchup": {
|
|
4138
4168
|
const { positionals, values, harbor } = parse(spec([], ["since"]));
|
|
4139
4169
|
none(positionals);
|
package/lib/format.mjs
CHANGED
|
@@ -1571,3 +1571,10 @@ export function reportsText(r) {
|
|
|
1571
1571
|
}
|
|
1572
1572
|
return out.join("\n");
|
|
1573
1573
|
}
|
|
1574
|
+
|
|
1575
|
+
/** daily_digest: a heading, then each line. */
|
|
1576
|
+
export function digestText(r, hours) {
|
|
1577
|
+
const span = !hours || hours === 24 ? "the last day" : `the last ${hours} hours`;
|
|
1578
|
+
if (r.quiet) return `Nothing changed on ${r.on} in ${span}.`;
|
|
1579
|
+
return [`What changed on ${r.on} in ${span}`, ...r.lines.map((l) => ` • ${l}`)].join("\n");
|
|
1580
|
+
}
|