@harborppm/cli 0.106.0 → 0.108.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 +3 -3
- package/dist/app.mjs +132 -14
- package/lib/cli.mjs +92 -52
- package/lib/format.mjs +14 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ harbor # name your harbor and its first project, and you're in
|
|
|
38
38
|
10. **Brief** (`0`): the weekly brief the website writes, for all portfolios or one (`p`), with how many programs sit at each health and the notes that opened; `f` swaps in the shipping forecast and `y` copies what's shown (in a terminal that lets apps copy; tmux needs `set-clipboard on`).
|
|
39
39
|
11. **Crew** (`C`): who's aboard and what each can do. The owner switches someone between editing and viewing (Enter), invites by email (`i`), copies (`y`) or withdraws (`w`) a letter still out, makes a read-only share link to a portfolio (`s`) and picks who gets its Monday update (`m`), and makes a project's intake form (`f`). Everyone sees the apps they connected (`d` disconnects one), turns their emails on or off, and opens Keep in the browser.
|
|
40
40
|
12. **Goals** (`G`): each portfolio's goals with how far along they are, off track in red, and their key results. `n` sets a goal; Enter on a goal renames it, gives it an owner, a due day or why it matters, adds a number key result or counts a program or project toward it; Enter on a number key result moves it; `d` removes the goal or key result.
|
|
41
|
-
13. **Reports** (`O`): the Reports page's dashboards, each chart drawn as bars with its numbers. `n` makes a dashboard (the first starts with a few charts), `a` adds a chart (what it counts, then how it's split), `[` `]` move one, `d` removes it.
|
|
41
|
+
13. **Reports** (`O`): the Reports page's dashboards, each chart drawn as bars with its numbers. `n` makes a dashboard (the first starts with a few charts), `a` adds a chart (what it counts, then how it's split), Enter renames a dashboard or chart, splits a chart another way or moves it, `[` `]` move one, `d` removes it.
|
|
42
42
|
|
|
43
43
|
`:` also opens three pages that aren't screens of their own. **Recently deleted** lists what was deleted in the last 30 days, and Enter brings one back (for editors; it says first when what it sat in is gone too). **Sheet links** lists yours, `n` makes one for a program (or, for the owner, the whole harbor) and copies it, since it shows only once, and `d` turns one off. **API keys** lists yours with when each was last used, and `d` revokes one; `n` opens the website, where a new key is made and shown once.
|
|
44
44
|
|
|
@@ -259,7 +259,7 @@ harbor agent report TASK "WHAT YOU DID" [--start] [--agent NAME]
|
|
|
259
259
|
|
|
260
260
|
`harbor fog` lists the open tasks nobody has opened, moved, edited or commented on for three weeks, longest first. `harbor fog --sweep` walks through them one at a time in a terminal: `k` still needed (clears the fog), `d` a new date, `x` drop it, `s` skip, `q` stop. On the board, in the app and on the website, those cards show dimmed.
|
|
261
261
|
|
|
262
|
-
`harbor watch` turns a narrow split or a tmux pane into a live ticker of your harbor: cards moving, comments, health changes, a line each as they happen, over the same live updates the website uses. Lines about your own work (your tasks, mentions of you, what you lead) are bright and the rest dim; `--bell` rings the terminal's bell when something of yours changes, and `--project` keeps to one project. It starts with the latest few changes and the time it began listening; `--since 14:30` (or a date) starts from then instead, on this computer's clock (`14:30Z` or `14:30 UTC` for UTC); the header names the time zone the ticker's times are in, and Harbor says "Nothing since 14:30 BST." when nothing has. A change the GitHub link made reads "Finished RR-4 … via GitHub", as History does. `q` stops; piped or with `--json` (one JSON object a line) it runs until it's killed, and `--once` prints what's there and returns, for scripts.
|
|
262
|
+
`harbor watch` turns a narrow split or a tmux pane into a live ticker of your harbor: cards moving, comments, health changes, a line each as they happen, over the same live updates the website uses. Lines about your own work (your tasks, mentions of you, what you lead) are bright and the rest dim; `--bell` rings the terminal's bell when something of yours changes, and `--project` keeps to one project. It starts with the latest few changes and the time it began listening; `--since 14:30` (or a date) starts from then instead, on this computer's clock (`14:30Z` or `14:30 UTC` for UTC); the header names the time zone the ticker's times are in, and Harbor says "Nothing since 14:30 BST." when nothing has. A change the GitHub link made reads "Finished RR-4 … via GitHub", as History does. `q` stops; piped or with `--json` (one JSON object a line) it runs until it's killed, and `--once` prints what's there and returns, for scripts. Harbor keeps the latest 40 changes, so a `--since` further back says where its list starts.
|
|
263
263
|
|
|
264
264
|
`harbor lifeboats` lists the work only one person has touched (a project, their corner of one, a task others wait on, their serious risks), numbered, each with someone who has room this week and already works nearby. `harbor lifeboats 2` puts that person on line 2 as a second pair of hands (`--person NAME` for someone else); `harbor follow RR-4 --person Sam` does it for one task. Following doesn't take the work over. `harbor raid "DECISION" --still-stands "WHY"` says a decision that came back for a look still stands.
|
|
265
265
|
|
|
@@ -269,7 +269,7 @@ Agents on the crew: put an AI app on People with Add an agent and assign it task
|
|
|
269
269
|
|
|
270
270
|
A task has one owner (`--assignee`), who answers for it and whose load it counts against, and anyone else on it with them (`--also "Sam, Aya"`): they see it under Also on in `harbor mine` and on Today, and count as knowing it. `harbor edit RR-4 --also none` leaves only the owner.
|
|
271
271
|
|
|
272
|
-
`harbor add --project Trail --comment "From Monday's call" < list.txt` adds one task per line of the file, each with the comment (every option applies to every line); `--dry-run` asks Harbor to add them on a copy it throws away, so it shows each task as it would really be (key, column, owner, priority, dates, parent, milestone), an open task that already has the title, and anything it would refuse and why; it exits 1 when something would be refused. `--unless-exists` adds a title only if the project has no open task by that name, so a retried script doesn't double up. `--json`
|
|
272
|
+
`harbor add --project Trail --comment "From Monday's call" < list.txt` adds one task per line of the file, each with the comment (every option applies to every line); `--dry-run` asks Harbor to add them on a copy it throws away, so it shows each task as it would really be (key, column, owner, priority, dates, parent, milestone), an open task that already has the title, and anything it would refuse and why; it exits 1 when something would be refused. The key it shows is a forecast, not held: an add from anyone in between takes it. `--unless-exists` adds a title only if the project has no open task by that name (done tasks aren't checked, so a weekly chore still goes in), so a retried script doesn't double up. `--json` has the dry run's shape, so a script reads both the same way: `tasks`, one entry a title with its key, and a skipped one marked `skipped` with the open task's key as `sameAs` (one title added alone also keeps `created`).
|
|
273
273
|
|
|
274
274
|
`harbor add "Book the venue @Quinn by Friday !high #Website"` reads the title in plain words, as the website's New task does: it adds "Book the venue" for Quinn, due Friday, high priority, in the Website project, and says what it read. A flag wins over the words (they stay in the title), `--literal` keeps the title exactly as typed, and `--due` takes the same words (`--due "next friday"`, `--due "in two weeks"`). In the full-screen app, `n` reads a new task's title the same way.
|
|
275
275
|
|
package/dist/app.mjs
CHANGED
|
@@ -5499,6 +5499,20 @@ function wrapLines(text, width) {
|
|
|
5499
5499
|
}
|
|
5500
5500
|
return out;
|
|
5501
5501
|
}
|
|
5502
|
+
/**
|
|
5503
|
+
* Text on at most `lines` lines no wider than `width`, the last ending in "…"
|
|
5504
|
+
* when some is left over: a board card's title, which must never run into the
|
|
5505
|
+
* card below.
|
|
5506
|
+
*/
|
|
5507
|
+
function clampLines(text, width, lines) {
|
|
5508
|
+
const w = Math.max(1, width);
|
|
5509
|
+
const all = wrapLines(text.replace(/\s+/g, " ").trim(), w).map((l) => l.slice(0, w));
|
|
5510
|
+
if (all.length <= lines) return all;
|
|
5511
|
+
const kept = all.slice(0, lines);
|
|
5512
|
+
const last = kept[lines - 1];
|
|
5513
|
+
kept[lines - 1] = (last.length >= w ? last.slice(0, w - 1) : last).trimEnd() + "…";
|
|
5514
|
+
return kept;
|
|
5515
|
+
}
|
|
5502
5516
|
/** The first of the month a day falls in. */
|
|
5503
5517
|
function monthOf(iso) {
|
|
5504
5518
|
return `${iso.slice(0, 7)}-01`;
|
|
@@ -5763,6 +5777,13 @@ function crewRows(crew, data, now) {
|
|
|
5763
5777
|
which: "assignments",
|
|
5764
5778
|
on: crew.email.assignments
|
|
5765
5779
|
});
|
|
5780
|
+
rows.push({
|
|
5781
|
+
kind: "email",
|
|
5782
|
+
text: "A sea shanty about the week, at the end of the Monday digest",
|
|
5783
|
+
detail: crew.email.shanty ? "on" : "off",
|
|
5784
|
+
which: "shanty",
|
|
5785
|
+
on: crew.email.shanty
|
|
5786
|
+
});
|
|
5766
5787
|
rows.push({
|
|
5767
5788
|
kind: "heading",
|
|
5768
5789
|
text: "Keep"
|
|
@@ -10110,6 +10131,13 @@ function withDashboard(list, input) {
|
|
|
10110
10131
|
createdAt: input.createdAt
|
|
10111
10132
|
}];
|
|
10112
10133
|
}
|
|
10134
|
+
function renamedDashboard(list, id, name) {
|
|
10135
|
+
const clean = cleanName(name);
|
|
10136
|
+
return list.map((d) => d.id === id ? {
|
|
10137
|
+
...d,
|
|
10138
|
+
name: clean
|
|
10139
|
+
} : d);
|
|
10140
|
+
}
|
|
10113
10141
|
function withoutDashboard(list, id) {
|
|
10114
10142
|
return list.filter((d) => d.id !== id);
|
|
10115
10143
|
}
|
|
@@ -10169,6 +10197,14 @@ function starterCharts(makeId) {
|
|
|
10169
10197
|
init_utils();
|
|
10170
10198
|
/** The longest bar a chart draws, in characters. */
|
|
10171
10199
|
const BAR = 24;
|
|
10200
|
+
/**
|
|
10201
|
+
* A value's bar, then a space: nothing for a zero (a block there reads as
|
|
10202
|
+
* something done), at least one block for anything above it.
|
|
10203
|
+
*/
|
|
10204
|
+
function barOf(value, top) {
|
|
10205
|
+
if (!(value > 0)) return "";
|
|
10206
|
+
return `${"█".repeat(Math.max(1, Math.round(value / Math.max(top, value) * BAR)))} `;
|
|
10207
|
+
}
|
|
10172
10208
|
/** Each dashboard and its charts as lines: a chart's name and total, then a bar a value. */
|
|
10173
10209
|
function reportRows(data, today) {
|
|
10174
10210
|
const out = [];
|
|
@@ -10203,7 +10239,7 @@ function reportRows(data, today) {
|
|
|
10203
10239
|
});
|
|
10204
10240
|
for (const s of r.slices) out.push({
|
|
10205
10241
|
key: `${chart.id}-${s.key}`,
|
|
10206
|
-
text: ` ${s.label.slice(0, label).padEnd(label)} ${
|
|
10242
|
+
text: ` ${s.label.slice(0, label).padEnd(label)} ${barOf(s.value, top)}${s.value}`,
|
|
10207
10243
|
plain: true
|
|
10208
10244
|
});
|
|
10209
10245
|
}
|
|
@@ -10274,6 +10310,10 @@ function ReportsView({ active, width, height, go }) {
|
|
|
10274
10310
|
}));
|
|
10275
10311
|
});
|
|
10276
10312
|
if (!cursor) return;
|
|
10313
|
+
if (key.return) {
|
|
10314
|
+
if (viewOnly) return go.notify("You can only view this harbor.");
|
|
10315
|
+
return chartMenu(go, cursor, change);
|
|
10316
|
+
}
|
|
10277
10317
|
if (input === "a") return addChart(go, cursor.dashboard, change);
|
|
10278
10318
|
if ((input === "[" || input === "]") && cursor.chart) return change((list) => movedChart(list, cursor.dashboard.id, cursor.chart.id, input === "[" ? -1 : 1));
|
|
10279
10319
|
if (input === "d") return go.confirm(cursor.chart ? `Remove the chart “${cursor.chart.title}”? u undoes it.` : `Delete the dashboard “${cursor.dashboard.name}” and its charts? u undoes it.`, () => change((list) => cursor.chart ? withoutChart(list, cursor.dashboard.id, cursor.chart.id) : withoutDashboard(list, cursor.dashboard.id)), cursor.chart ? "Remove" : "Delete");
|
|
@@ -10285,7 +10325,7 @@ function ReportsView({ active, width, height, go }) {
|
|
|
10285
10325
|
paddingX: 1,
|
|
10286
10326
|
children: [
|
|
10287
10327
|
/* @__PURE__ */ jsx(Heading, {
|
|
10288
|
-
right: "↑↓ · n dashboard · a chart · [ ] move · d remove",
|
|
10328
|
+
right: "↑↓ · Enter change · n dashboard · a chart · [ ] move · d remove",
|
|
10289
10329
|
children: "Reports"
|
|
10290
10330
|
}),
|
|
10291
10331
|
/* @__PURE__ */ jsx(Text, { children: " " }),
|
|
@@ -10301,6 +10341,62 @@ function ReportsView({ active, width, height, go }) {
|
|
|
10301
10341
|
]
|
|
10302
10342
|
});
|
|
10303
10343
|
}
|
|
10344
|
+
/** Enter on a dashboard or a chart: what can change about it, as on the website. */
|
|
10345
|
+
function chartMenu(go, { dashboard, chart }, change) {
|
|
10346
|
+
if (!chart) return go.pick(dashboard.name, [{
|
|
10347
|
+
label: "Rename it",
|
|
10348
|
+
value: "rename"
|
|
10349
|
+
}, {
|
|
10350
|
+
label: "Add a chart",
|
|
10351
|
+
value: "add"
|
|
10352
|
+
}], (what) => what === "add" ? addChart(go, dashboard, change) : go.ask("The dashboard's name", (name) => {
|
|
10353
|
+
if (name.trim()) change((list) => renamedDashboard(list, dashboard.id, name));
|
|
10354
|
+
}, dashboard.name));
|
|
10355
|
+
const { id, ...rest } = chart;
|
|
10356
|
+
const keep = (patch) => change((list) => withChart(list, dashboard.id, {
|
|
10357
|
+
...rest,
|
|
10358
|
+
...patch
|
|
10359
|
+
}, id));
|
|
10360
|
+
go.pick(chart.title, [
|
|
10361
|
+
{
|
|
10362
|
+
label: "Rename it",
|
|
10363
|
+
value: "rename"
|
|
10364
|
+
},
|
|
10365
|
+
{
|
|
10366
|
+
label: "Split it another way",
|
|
10367
|
+
value: "split"
|
|
10368
|
+
},
|
|
10369
|
+
{
|
|
10370
|
+
label: "Move it up",
|
|
10371
|
+
value: "up"
|
|
10372
|
+
},
|
|
10373
|
+
{
|
|
10374
|
+
label: "Move it down",
|
|
10375
|
+
value: "down"
|
|
10376
|
+
}
|
|
10377
|
+
], (what) => {
|
|
10378
|
+
if (what === "rename") return go.ask("The chart's title", (title) => {
|
|
10379
|
+
if (title.trim()) keep({ title: title.trim() });
|
|
10380
|
+
}, chart.title);
|
|
10381
|
+
if (what === "split") return go.pick(`${MEASURE_LABEL[chart.measure]}, split by`, groupsFor(chart.measure).filter((g) => g !== "field").map((g) => ({
|
|
10382
|
+
label: groupLabel(chart.measure, g),
|
|
10383
|
+
value: g
|
|
10384
|
+
})), (g) => {
|
|
10385
|
+
const groupBy = g;
|
|
10386
|
+
const titled = chart.title === defaultTitle(chart);
|
|
10387
|
+
keep({
|
|
10388
|
+
groupBy,
|
|
10389
|
+
field: void 0,
|
|
10390
|
+
view: defaultView(groupBy),
|
|
10391
|
+
title: titled ? defaultTitle({
|
|
10392
|
+
measure: chart.measure,
|
|
10393
|
+
groupBy
|
|
10394
|
+
}) : chart.title
|
|
10395
|
+
});
|
|
10396
|
+
});
|
|
10397
|
+
change((list) => movedChart(list, dashboard.id, chart.id, what === "up" ? -1 : 1));
|
|
10398
|
+
});
|
|
10399
|
+
}
|
|
10304
10400
|
function addChart(go, dashboard, change) {
|
|
10305
10401
|
go.pick(`A chart on ${dashboard.name}: what does it count?`, MEASURES.map((m) => ({
|
|
10306
10402
|
label: MEASURE_LABEL[m],
|
|
@@ -16588,9 +16684,9 @@ const HELP$1 = [
|
|
|
16588
16684
|
["v", "switch layout: board, list, budget, by project"],
|
|
16589
16685
|
["m R P t D", "milestone / risk / pre-mortem / dry dock / Done"],
|
|
16590
16686
|
["c a C S", "on a task: comment / step / yours / sounding"],
|
|
16591
|
-
["s T
|
|
16592
|
-
["
|
|
16593
|
-
["f / p", "
|
|
16687
|
+
["s T", "on a task: add a subtask / save as a template"],
|
|
16688
|
+
["M T", "on a project: messages / a task from a template"],
|
|
16689
|
+
["f c / f p", "Today: focus, check in · board: owner, priority"],
|
|
16594
16690
|
["q", "quit (saves first)"]
|
|
16595
16691
|
];
|
|
16596
16692
|
/**
|
|
@@ -23772,6 +23868,21 @@ function welcomeWhen(person, lastSeen, today) {
|
|
|
23772
23868
|
days
|
|
23773
23869
|
} : null;
|
|
23774
23870
|
}
|
|
23871
|
+
/**
|
|
23872
|
+
* The later of this device's mark and the last thing the person did in the
|
|
23873
|
+
* harbor by hand (its activity log and their comments), so time spent on the
|
|
23874
|
+
* website, a phone or the commands counts as having looked. Changes made for
|
|
23875
|
+
* them (`via` GitHub and the like) don't.
|
|
23876
|
+
*/
|
|
23877
|
+
function lastLooked(mark, data, personId) {
|
|
23878
|
+
let last = mark ?? null;
|
|
23879
|
+
const later = (at) => {
|
|
23880
|
+
if (at && (!last || at > last)) last = at;
|
|
23881
|
+
};
|
|
23882
|
+
for (const a of data.activity ?? []) if (a.personId === personId && !a.via) later(a.at);
|
|
23883
|
+
for (const c of data.comments ?? []) if (c.authorId === personId) later(c.createdAt);
|
|
23884
|
+
return last;
|
|
23885
|
+
}
|
|
23775
23886
|
|
|
23776
23887
|
// src/lib/welcome-back.ts
|
|
23777
23888
|
init_date_text();
|
|
@@ -30687,7 +30798,8 @@ function memoryCrew(account, harbor) {
|
|
|
30687
30798
|
}];
|
|
30688
30799
|
const email = {
|
|
30689
30800
|
weeklyDigest: true,
|
|
30690
|
-
assignments: true
|
|
30801
|
+
assignments: true,
|
|
30802
|
+
shanty: false
|
|
30691
30803
|
};
|
|
30692
30804
|
const keep = {
|
|
30693
30805
|
kept: false,
|
|
@@ -30795,6 +30907,7 @@ function memoryCrew(account, harbor) {
|
|
|
30795
30907
|
case "email":
|
|
30796
30908
|
if (act.weeklyDigest !== void 0) email.weeklyDigest = act.weeklyDigest;
|
|
30797
30909
|
if (act.assignments !== void 0) email.assignments = act.assignments;
|
|
30910
|
+
if (act.shanty !== void 0) email.shanty = act.shanty;
|
|
30798
30911
|
return view();
|
|
30799
30912
|
}
|
|
30800
30913
|
},
|
|
@@ -34296,7 +34409,8 @@ function ProjectView({ projectId, active, width, height, go, onBack }) {
|
|
|
34296
34409
|
priority: t.priority,
|
|
34297
34410
|
selected: on && view.start + i === r,
|
|
34298
34411
|
fog: fogWeeks(t),
|
|
34299
|
-
picked: picked.includes(t.id)
|
|
34412
|
+
picked: picked.includes(t.id),
|
|
34413
|
+
width: Math.max(1, w - 4)
|
|
34300
34414
|
}, t.id)),
|
|
34301
34415
|
view.start + view.items.length < c.tasks.length ? /* @__PURE__ */ jsxs(Text, {
|
|
34302
34416
|
color: theme.muted,
|
|
@@ -34338,10 +34452,11 @@ function ProjectView({ projectId, active, width, height, go, onBack }) {
|
|
|
34338
34452
|
});
|
|
34339
34453
|
}
|
|
34340
34454
|
/** One card on the board: its key, due date and owner, then the title on up to two lines. */
|
|
34341
|
-
function Card({ taskKey, title, owner, due, late, waits, priority, selected, fog = null, picked = false }) {
|
|
34455
|
+
function Card({ taskKey, title, owner, due, late, waits, priority, selected, fog = null, picked = false, width }) {
|
|
34342
34456
|
return /* @__PURE__ */ jsxs(Box, {
|
|
34343
34457
|
flexDirection: "column",
|
|
34344
34458
|
height: 3,
|
|
34459
|
+
overflow: "hidden",
|
|
34345
34460
|
children: [/* @__PURE__ */ jsxs(Text, {
|
|
34346
34461
|
wrap: "truncate-end",
|
|
34347
34462
|
inverse: selected,
|
|
@@ -34380,13 +34495,15 @@ function Card({ taskKey, title, owner, due, late, waits, priority, selected, fog
|
|
|
34380
34495
|
]
|
|
34381
34496
|
}), /* @__PURE__ */ jsx(Box, {
|
|
34382
34497
|
height: 2,
|
|
34383
|
-
|
|
34384
|
-
|
|
34498
|
+
flexDirection: "column",
|
|
34499
|
+
overflow: "hidden",
|
|
34500
|
+
children: clampLines(title, width, 2).map((line, i) => /* @__PURE__ */ jsx(Text, {
|
|
34501
|
+
wrap: "truncate-end",
|
|
34385
34502
|
bold: selected,
|
|
34386
34503
|
dimColor: fog != null && !selected,
|
|
34387
34504
|
color: selected ? theme.selected : fog != null ? theme.muted : void 0,
|
|
34388
|
-
children:
|
|
34389
|
-
})
|
|
34505
|
+
children: line
|
|
34506
|
+
}, i))
|
|
34390
34507
|
})]
|
|
34391
34508
|
});
|
|
34392
34509
|
}
|
|
@@ -35991,7 +36108,7 @@ function TaskPanel({ taskId, width, height, go, active = true, onClose }) {
|
|
|
35991
36108
|
/* @__PURE__ */ jsx(Box, { flexGrow: 1 }),
|
|
35992
36109
|
editor ?? /* @__PURE__ */ jsx(Text, {
|
|
35993
36110
|
color: theme.muted,
|
|
35994
|
-
wrap: "
|
|
36111
|
+
wrap: "wrap",
|
|
35995
36112
|
children: "↑↓ field · Enter change · o who's on it · c comment · C yours · a add step · e edit step · space tick · x done · S sounding · s subtask · T save as template · d delete · Esc close"
|
|
35996
36113
|
})
|
|
35997
36114
|
]
|
|
@@ -36613,7 +36730,8 @@ function App({ ui, startIn }) {
|
|
|
36613
36730
|
const s = store.getState();
|
|
36614
36731
|
const me = s.people.find((p) => p.id === s.currentUserId);
|
|
36615
36732
|
if (!seen || !me || !s.workspaceId || s.workspaceId === "local") return null;
|
|
36616
|
-
|
|
36733
|
+
const mark = seen.last(s.workspaceId);
|
|
36734
|
+
return welcomeWhen(me, mark ? lastLooked(mark, s, me.id) : null, today());
|
|
36617
36735
|
});
|
|
36618
36736
|
useEffect(() => {
|
|
36619
36737
|
const id = store.getState().workspaceId;
|
package/lib/cli.mjs
CHANGED
|
@@ -313,8 +313,8 @@ export const HELP = `harbor: Harbor from the terminal
|
|
|
313
313
|
harbor goal "TITLE" --new [--portfolio P] [--owner NAME] [--due DATE]
|
|
314
314
|
set a new goal (harbor help goal)
|
|
315
315
|
harbor milestones [PROGRAM] [--project P] [--done]
|
|
316
|
-
milestones soonest first
|
|
317
|
-
done, sign-off,
|
|
316
|
+
milestones soonest first, with
|
|
317
|
+
tasks done, sign-off, waits
|
|
318
318
|
harbor milestone "NAME" [--program P] [--due DATE] [--rename T]
|
|
319
319
|
[--reached|--open] [--signs-off NAME|none]
|
|
320
320
|
[--approve|--changes NOTE]
|
|
@@ -716,6 +716,24 @@ function wordsLine(r) {
|
|
|
716
716
|
return bits.length ? `Read from your words: ${bits.join(", ")}.` : null;
|
|
717
717
|
}
|
|
718
718
|
|
|
719
|
+
/**
|
|
720
|
+
* What the words in a title read as, field by field, with the words each came
|
|
721
|
+
* from (`from`), for --dry-run --json; null when they read as nothing.
|
|
722
|
+
*/
|
|
723
|
+
function wordsRead(r) {
|
|
724
|
+
const fields = [
|
|
725
|
+
["assignee", r.owner],
|
|
726
|
+
["due", r.due],
|
|
727
|
+
["priority", r.priority],
|
|
728
|
+
["project", r.project],
|
|
729
|
+
].filter(([, x]) => x);
|
|
730
|
+
if (!fields.length) return null;
|
|
731
|
+
return {
|
|
732
|
+
...Object.fromEntries(fields.map(([k, x]) => [k, x.value])),
|
|
733
|
+
from: Object.fromEntries(fields.map(([k, x]) => [k, x.text])),
|
|
734
|
+
};
|
|
735
|
+
}
|
|
736
|
+
|
|
719
737
|
/** --due given in words rather than as a date or +N, when it reads as a day. */
|
|
720
738
|
function dueWords(v) {
|
|
721
739
|
if (typeof v !== "string" || /^(\d{4}-\d{2}-\d{2}|\+\d{1,3})$/.test(v) || PILOT.has(v.toLowerCase())) return false;
|
|
@@ -911,12 +929,14 @@ const DETAIL = {
|
|
|
911
929
|
" priority, dates, parent and milestone, the words read from its title,",
|
|
912
930
|
" an open task that already has the title, and anything Harbor would",
|
|
913
931
|
" refuse (a full column, an unknown person) with why. It exits 1 when",
|
|
914
|
-
" something would be refused. --json lists the same under tasks.",
|
|
932
|
+
" something would be refused. --json lists the same under tasks. The key",
|
|
933
|
+
" is a forecast, not held for you: an add from anyone in between takes it.",
|
|
915
934
|
"",
|
|
916
935
|
" --unless-exists skips a title the project already has open (case and",
|
|
917
936
|
" spacing aside), saying which task it found; a done one doesn't count,",
|
|
918
|
-
" so a weekly chore is still added
|
|
919
|
-
"
|
|
937
|
+
" so a weekly chore is still added (only open tasks are checked). --json",
|
|
938
|
+
" has the dry run's shape: tasks, one a title, a skipped one marked",
|
|
939
|
+
" skipped with the open task's key as sameAs (one title also: created).",
|
|
920
940
|
"",
|
|
921
941
|
" --project can be left out when the harbor has one open project (First",
|
|
922
942
|
" voyage aside); the task goes there.",
|
|
@@ -1327,8 +1347,9 @@ const DETAIL = {
|
|
|
1327
1347
|
" soonest first",
|
|
1328
1348
|
" harbor milestones --project P reads: the milestones of P's program",
|
|
1329
1349
|
"",
|
|
1330
|
-
" Each says its due day and whether it's late, how many of the tasks
|
|
1331
|
-
" to it are done
|
|
1350
|
+
" Each says its due day and whether it's late, and how many of the tasks",
|
|
1351
|
+
" tied to it are done (a task ties with harbor add or edit --milestone).",
|
|
1352
|
+
" When it has them, who signs it off and where that stands, and the",
|
|
1332
1353
|
" projects it waits on. --done adds the reached ones.",
|
|
1333
1354
|
],
|
|
1334
1355
|
milestone: [
|
|
@@ -1443,7 +1464,9 @@ const DETAIL = {
|
|
|
1443
1464
|
" prints each new one as it lands. Lines about your own work (your tasks,",
|
|
1444
1465
|
" mentions of you, what you lead) are bright; the rest are dim. It runs",
|
|
1445
1466
|
" until q or Ctrl+C (or until it's killed, when piped or with --json);",
|
|
1446
|
-
" --once returns at once.
|
|
1467
|
+
" --once returns at once. Harbor keeps the latest 40 changes, so --since",
|
|
1468
|
+
" further back than those says where its list starts. Made for a narrow",
|
|
1469
|
+
" split or a tmux pane; it needs",
|
|
1447
1470
|
" full access (harbor login without --read-only).",
|
|
1448
1471
|
],
|
|
1449
1472
|
lifeboats: [
|
|
@@ -2930,6 +2953,26 @@ export async function run(argv, io = {}) {
|
|
|
2930
2953
|
if (!values.project && !reads.every((r) => r.project))
|
|
2931
2954
|
values.project = await onlyProject(client, harbor, "--project NAME or #NAME in the title");
|
|
2932
2955
|
const projectOf = (r) => values.project ?? r.project?.value;
|
|
2956
|
+
// One task as --json lists it, the same for a dry run and the real thing.
|
|
2957
|
+
const taskEntry = (t, title) => ({
|
|
2958
|
+
title: t?.title ?? title,
|
|
2959
|
+
...(t
|
|
2960
|
+
? {
|
|
2961
|
+
key: t.key ?? null,
|
|
2962
|
+
...(t.id ? { id: t.id } : {}),
|
|
2963
|
+
project: t.project,
|
|
2964
|
+
status: t.status,
|
|
2965
|
+
...(t.column ? { column: t.column } : {}),
|
|
2966
|
+
assignee: t.assignee,
|
|
2967
|
+
...(t.alsoOn ? { alsoOn: t.alsoOn } : {}),
|
|
2968
|
+
priority: t.priority,
|
|
2969
|
+
due: t.due,
|
|
2970
|
+
...(t.starts ? { starts: t.starts } : {}),
|
|
2971
|
+
...(t.subtaskOf ? { subtaskOf: t.subtaskOf } : {}),
|
|
2972
|
+
...(t.milestone ? { milestone: t.milestone } : {}),
|
|
2973
|
+
}
|
|
2974
|
+
: {}),
|
|
2975
|
+
});
|
|
2933
2976
|
// What create_task gets for one line, the same for a dry run and the real thing.
|
|
2934
2977
|
const argsFor = (words) => ({
|
|
2935
2978
|
project: projectOf(words),
|
|
@@ -2960,38 +3003,13 @@ export async function run(argv, io = {}) {
|
|
|
2960
3003
|
const unread =
|
|
2961
3004
|
values.literal && !fromTemplate ? await readTitles(client, harbor, titles, values) : null;
|
|
2962
3005
|
const lines = preview.tasks.map((p, i) => {
|
|
2963
|
-
const t = p.created;
|
|
2964
3006
|
const words = reads[i];
|
|
2965
3007
|
return {
|
|
2966
|
-
|
|
2967
|
-
...(t
|
|
2968
|
-
? {
|
|
2969
|
-
key: t.key ?? null,
|
|
2970
|
-
project: t.project,
|
|
2971
|
-
status: t.status,
|
|
2972
|
-
...(t.column ? { column: t.column } : {}),
|
|
2973
|
-
assignee: t.assignee,
|
|
2974
|
-
...(t.alsoOn ? { alsoOn: t.alsoOn } : {}),
|
|
2975
|
-
priority: t.priority,
|
|
2976
|
-
due: t.due,
|
|
2977
|
-
...(t.starts ? { starts: t.starts } : {}),
|
|
2978
|
-
...(t.subtaskOf ? { subtaskOf: t.subtaskOf } : {}),
|
|
2979
|
-
...(t.milestone ? { milestone: t.milestone } : {}),
|
|
2980
|
-
}
|
|
2981
|
-
: {}),
|
|
3008
|
+
...taskEntry(p.created, p.title ?? words.title),
|
|
2982
3009
|
...(values.template ? { template: values.template } : {}),
|
|
2983
3010
|
...(values.comment ? { comment: values.comment } : {}),
|
|
2984
|
-
...(words
|
|
2985
|
-
|
|
2986
|
-
read: {
|
|
2987
|
-
...(words.owner ? { assignee: words.owner.value, from: words.owner.text } : {}),
|
|
2988
|
-
...(words.due ? { due: words.due.value } : {}),
|
|
2989
|
-
...(words.priority ? { priority: words.priority.value } : {}),
|
|
2990
|
-
...(words.project ? { project: words.project.value } : {}),
|
|
2991
|
-
},
|
|
2992
|
-
}
|
|
2993
|
-
: {}),
|
|
2994
|
-
...(unread && wordsLine(unread[i]) ? { keptWords: wordsLine(unread[i]) } : {}),
|
|
3011
|
+
...(wordsRead(words) ? { read: wordsRead(words) } : {}),
|
|
3012
|
+
...(unread && wordsRead(unread[i]) ? { keptWords: wordsRead(unread[i]) } : {}),
|
|
2995
3013
|
...(p.sameAs ? { sameAs: p.sameAs } : {}),
|
|
2996
3014
|
...(p.sameAs && values["unless-exists"] ? { skipped: true } : {}),
|
|
2997
3015
|
...(p.refused ? { refused: p.refused } : {}),
|
|
@@ -3033,7 +3051,7 @@ export async function run(argv, io = {}) {
|
|
|
3033
3051
|
` ${bits.join(" · ")}`,
|
|
3034
3052
|
...(wordsLine(words) ? [` ${wordsLine(words)} --literal keeps them in the title.`] : []),
|
|
3035
3053
|
...(l.keptWords
|
|
3036
|
-
? [` --literal kept the words as typed. ${
|
|
3054
|
+
? [` --literal kept the words as typed. ${wordsLine(unread[i]).replace("Read from your words", "Without it, they'd read as")}`]
|
|
3037
3055
|
: []),
|
|
3038
3056
|
...(l.comment ? [` with your comment: ${l.comment}`] : []),
|
|
3039
3057
|
...(l.sameAs && !l.skipped
|
|
@@ -3045,7 +3063,7 @@ export async function run(argv, io = {}) {
|
|
|
3045
3063
|
out(
|
|
3046
3064
|
plain(
|
|
3047
3065
|
[
|
|
3048
|
-
`Would add ${n(would)}${skipped ? `, skip ${skipped}` : ""}${refused ? `; ${refused} would be refused` : ""}. Nothing changed.`,
|
|
3066
|
+
`Would add ${n(would)}${skipped ? `, skip ${skipped}` : ""}${refused ? `; ${refused} would be refused` : ""}. Nothing changed${lines.some((l) => l.key) ? ", and the keys aren't held" : ""}.`,
|
|
3049
3067
|
...body,
|
|
3050
3068
|
...(pilot ? [`--due pilot: ${pilot.says}`] : []),
|
|
3051
3069
|
].join("\n"),
|
|
@@ -3055,7 +3073,7 @@ export async function run(argv, io = {}) {
|
|
|
3055
3073
|
return refused ? 1 : 0;
|
|
3056
3074
|
}
|
|
3057
3075
|
const added = [];
|
|
3058
|
-
for (const words of reads) {
|
|
3076
|
+
for (const [i, words] of reads.entries()) {
|
|
3059
3077
|
const r = await client
|
|
3060
3078
|
.call("create_task", { harbor, ...argsFor(words) })
|
|
3061
3079
|
.catch((err) => {
|
|
@@ -3078,25 +3096,43 @@ export async function run(argv, io = {}) {
|
|
|
3078
3096
|
body: values.comment,
|
|
3079
3097
|
})
|
|
3080
3098
|
).commented;
|
|
3081
|
-
|
|
3082
|
-
|
|
3099
|
+
// The words read out of the title, field by field, and the title as typed.
|
|
3100
|
+
const read = wordsRead(words);
|
|
3101
|
+
if (read) r.read = { ...read, typed: titles[i] };
|
|
3083
3102
|
added.push(r);
|
|
3084
3103
|
}
|
|
3085
3104
|
await stalePromptCache(env);
|
|
3086
3105
|
const made = added.filter((r) => r.created);
|
|
3087
|
-
|
|
3088
|
-
//
|
|
3089
|
-
// `skipped`
|
|
3090
|
-
//
|
|
3091
|
-
|
|
3092
|
-
|
|
3106
|
+
// The dry run's shape, so a script reads both the same way: `tasks`
|
|
3107
|
+
// has one entry a title, a skipped one (--unless-exists found it open)
|
|
3108
|
+
// marked `skipped` with the open task's key as `sameAs`. One title added
|
|
3109
|
+
// alone also keeps `created`, as before.
|
|
3110
|
+
if (asJson) {
|
|
3111
|
+
const tasks = added.map((r, i) =>
|
|
3112
|
+
r.existing
|
|
3113
|
+
? { ...taskEntry(r.existing, titles[i]), sameAs: r.existing.key ?? r.existing.id, skipped: true }
|
|
3114
|
+
: {
|
|
3115
|
+
...taskEntry(r.created, titles[i]),
|
|
3116
|
+
...(values.template ? { template: values.template } : {}),
|
|
3117
|
+
...(r.comment ? { comment: r.comment } : {}),
|
|
3118
|
+
...(r.read ? { read: r.read } : {}),
|
|
3119
|
+
...(r.pilot ? { pilot: r.pilot } : {}),
|
|
3120
|
+
...(r.milestoneReached ? { milestoneReached: r.milestoneReached } : {}),
|
|
3121
|
+
...(r.milestoneReopened ? { milestoneReopened: r.milestoneReopened } : {}),
|
|
3122
|
+
},
|
|
3123
|
+
);
|
|
3124
|
+
const where = [...new Set(tasks.map((t) => t.project).filter(Boolean))];
|
|
3093
3125
|
out(
|
|
3094
3126
|
jsonText({
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3127
|
+
dryRun: false,
|
|
3128
|
+
literal: Boolean(values.literal),
|
|
3129
|
+
project: where.length === 1 ? where[0] : (values.project ?? null),
|
|
3130
|
+
titles: tasks.map((t) => t.title),
|
|
3131
|
+
tasks,
|
|
3132
|
+
...(made.length === 1 && added.length === 1 ? { created: made[0].created } : {}),
|
|
3098
3133
|
}),
|
|
3099
3134
|
);
|
|
3135
|
+
}
|
|
3100
3136
|
else
|
|
3101
3137
|
out(
|
|
3102
3138
|
plain(
|
|
@@ -3107,7 +3143,11 @@ export async function run(argv, io = {}) {
|
|
|
3107
3143
|
: [
|
|
3108
3144
|
`Added: ${taskLine(r.created, opts)}${r.comment ? ", with your comment" : ""}`,
|
|
3109
3145
|
// What the title's words said, so nothing is read without being seen.
|
|
3110
|
-
...(r.read
|
|
3146
|
+
...(r.read
|
|
3147
|
+
? [
|
|
3148
|
+
`You typed “${r.read.typed}”. ${wordsLine(reads[added.indexOf(r)])} --literal keeps the words in the title.`,
|
|
3149
|
+
]
|
|
3150
|
+
: []),
|
|
3111
3151
|
// --due in words ("next friday"): the day it became, weekday and all.
|
|
3112
3152
|
...(dueWords(values.due) ? [`--due ${values.due}: ${dayWithWeekday(dueDate(values.due))}.`] : []),
|
|
3113
3153
|
// Pilot speaks up only when a date was given that the queue says won't hold.
|
|
@@ -3900,7 +3940,7 @@ export async function run(argv, io = {}) {
|
|
|
3900
3940
|
return call(
|
|
3901
3941
|
"list_milestones",
|
|
3902
3942
|
{ harbor, program, project: values.project, done: Boolean(values.done) },
|
|
3903
|
-
milestonesText,
|
|
3943
|
+
(r) => milestonesText(r, { done: Boolean(values.done) }),
|
|
3904
3944
|
);
|
|
3905
3945
|
}
|
|
3906
3946
|
case "milestone": {
|
package/lib/format.mjs
CHANGED
|
@@ -1504,7 +1504,9 @@ export function milestoneLine(m, { program = true } = {}) {
|
|
|
1504
1504
|
m.reached ? "reached" : m.late ? `late, due ${m.due}` : `due ${m.due}`,
|
|
1505
1505
|
m.tasks
|
|
1506
1506
|
? `${m.tasks.done} of ${m.tasks.total} task${m.tasks.total === 1 ? "" : "s"} done`
|
|
1507
|
-
:
|
|
1507
|
+
: m.reached
|
|
1508
|
+
? null
|
|
1509
|
+
: "no tasks lead to it",
|
|
1508
1510
|
m.signOff
|
|
1509
1511
|
? `${m.signOff.by ?? "someone"} signs off: ${SIGN_OFF[m.signOff.status] ?? m.signOff.status}${m.signOff.note ? ` (“${m.signOff.note}”)` : ""}`
|
|
1510
1512
|
: null,
|
|
@@ -1517,8 +1519,12 @@ export function milestoneLine(m, { program = true } = {}) {
|
|
|
1517
1519
|
}
|
|
1518
1520
|
|
|
1519
1521
|
/** list_milestones: soonest first, the program named once when it's one. */
|
|
1520
|
-
export function milestonesText(r) {
|
|
1522
|
+
export function milestonesText(r, { done = false } = {}) {
|
|
1521
1523
|
const list = r.milestones ?? [];
|
|
1524
|
+
const noneReached =
|
|
1525
|
+
done && list.length && !list.some((m) => m.reached)
|
|
1526
|
+
? [`None ${r.program ? `in ${r.program} ` : ""}reached yet.`]
|
|
1527
|
+
: [];
|
|
1522
1528
|
const hidden = r.reachedHidden
|
|
1523
1529
|
? `${r.reachedHidden} reached ${r.reachedHidden === 1 ? "one" : "ones"} not shown (--done shows them).`
|
|
1524
1530
|
: "";
|
|
@@ -1532,6 +1538,7 @@ export function milestonesText(r) {
|
|
|
1532
1538
|
...(r.program ? [`${r.program}:`] : []),
|
|
1533
1539
|
...list.map((m) => `${r.program ? " " : ""}${milestoneLine(m, { program: !r.program })}`),
|
|
1534
1540
|
...(hidden ? [hidden] : []),
|
|
1541
|
+
...noneReached,
|
|
1535
1542
|
].join("\n");
|
|
1536
1543
|
}
|
|
1537
1544
|
|
|
@@ -1563,10 +1570,11 @@ export function reportsText(r) {
|
|
|
1563
1570
|
out.push(d.name);
|
|
1564
1571
|
if (!d.charts.length) out.push(" No charts on it yet.");
|
|
1565
1572
|
for (const c of d.charts) {
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
);
|
|
1573
|
+
// The line under says what the title doesn't: a starter chart's title already is "Open tasks by owner".
|
|
1574
|
+
const what = `${c.counts} by ${c.splitBy.toLowerCase()}`;
|
|
1575
|
+
const said = (c.title ?? "").toLowerCase().includes(what.toLowerCase());
|
|
1576
|
+
const sub = [said ? null : what, c.from ? `in ${c.from}` : null].filter(Boolean).join(", ");
|
|
1577
|
+
out.push(` ${c.text}`, ...(sub ? [` ${sub[0].toUpperCase()}${sub.slice(1)}`] : []));
|
|
1570
1578
|
}
|
|
1571
1579
|
}
|
|
1572
1580
|
return out.join("\n");
|