@harborppm/cli 0.55.0 → 0.56.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.
Files changed (3) hide show
  1. package/README.md +4 -2
  2. package/lib/cli.mjs +37 -8
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -148,11 +148,13 @@ harbor project "NAME" --program P [--lead me|NAME] [--starts DATE]
148
148
  [--ends DATE] [--budget N] [--from "DONE PROJECT"]
149
149
  --from: dead reckoning, its tasks due when
150
150
  they really finished in that project
151
- harbor add "TITLE" --project P [--assignee me|NAME] [--due DATE]
151
+ harbor add "TITLE" --project P [--assignee me|NAME] [--due DATE|pilot]
152
152
  [--priority low|medium|high|urgent] [--status S] [--comment TEXT]
153
153
  [--over-limit] no TITLE: one title a line from stdin
154
+ --due pilot takes the date the owner's queue suggests;
155
+ a date that won't hold says so
154
156
  harbor start TASK | submit TASK | done TASK [--confirm] [--over-limit]
155
- harbor edit TASK [--title T] [--assignee me|none|NAME] [--due DATE|none]
157
+ harbor edit TASK [--title T] [--assignee me|none|NAME] [--due DATE|pilot|none]
156
158
  [--priority P] [--status S] [--notes TEXT]
157
159
  [--repeat weekly|biweekly|monthly|never]
158
160
  [--waits-on TASK,TASK|none] [--confirm] [--over-limit]
package/lib/cli.mjs CHANGED
@@ -135,15 +135,17 @@ export const HELP = `harbor: Harbor from the terminal
135
135
  [--ends DATE] [--budget N] [--from "DONE PROJECT"]
136
136
  --from: plan it from a finished
137
137
  project as that one really ran
138
- harbor add "TITLE" --project P [--assignee me|none|NAME] [--due DATE]
139
- [--priority low|medium|high|urgent] [--status S]
140
- [--comment TEXT] [--over-limit]
138
+ harbor add "TITLE" --project P [--assignee me|none|NAME]
139
+ [--due DATE|pilot] [--priority low|medium|high|urgent]
140
+ [--status S] [--comment TEXT] [--over-limit]
141
141
  with no TITLE: one title a line
142
- from stdin
142
+ from stdin; --due pilot takes the
143
+ date the owner's queue suggests
143
144
  harbor start TASK | submit TASK | done TASK [--confirm] [--over-limit]
144
145
  move a task to In play, In review
145
146
  or Done
146
- harbor edit TASK [--title T] [--assignee me|none|NAME] [--due DATE|none]
147
+ harbor edit TASK [--title T] [--assignee me|none|NAME]
148
+ [--due DATE|pilot|none]
147
149
  [--priority P] [--status S] [--notes TEXT]
148
150
  [--repeat weekly|biweekly|monthly|never]
149
151
  [--waits-on TASK,TASK|none] [--confirm] [--over-limit]
@@ -378,6 +380,21 @@ export function dueDate(v, today = new Date()) {
378
380
  return todayLocal(d);
379
381
  }
380
382
 
383
+ /** --due pilot: the date the owner's queue suggests, set by Harbor. */
384
+ const PILOT = new Set(["pilot", "suggested"]);
385
+ const duePilot = (v) => (v !== undefined && PILOT.has(v.toLowerCase()) ? true : undefined);
386
+
387
+ /** Pilot's word when the date given won't hold: what the queue says, why, and how to take it. */
388
+ function pilotLines(r, task) {
389
+ const p = r.pilot;
390
+ if (!p) return [];
391
+ const ref = task.key ?? task.id;
392
+ return [
393
+ `${p.says}: ${p.why.map((w, i) => (i ? w.charAt(0).toLowerCase() + w.slice(1) : w)).join("; ")}.`,
394
+ `harbor edit ${ref} --due pilot takes ${p.earliest}.`,
395
+ ];
396
+ }
397
+
381
398
  /** Harbor's tool fields, as the CLI's flags. */
382
399
  const FLAG = {
383
400
  due: "--due",
@@ -1991,7 +2008,8 @@ export async function run(argv, io = {}) {
1991
2008
  title,
1992
2009
  // Yours unless you say otherwise, as with n in the app.
1993
2010
  assignee: values.assignee ?? "me",
1994
- due: dueDate(values.due),
2011
+ due: duePilot(values.due) ? undefined : dueDate(values.due),
2012
+ suggestedDue: duePilot(values.due),
1995
2013
  priority: values.priority,
1996
2014
  status: values.status === undefined ? undefined : statusWord(values.status),
1997
2015
  overLimit: values["over-limit"] || undefined,
@@ -2018,7 +2036,13 @@ export async function run(argv, io = {}) {
2018
2036
  out(
2019
2037
  plain(
2020
2038
  added
2021
- .map((r) => `Added: ${taskLine(r.created, opts)}${r.comment ? ", with your comment" : ""}`)
2039
+ .map((r) =>
2040
+ [
2041
+ `Added: ${taskLine(r.created, opts)}${r.comment ? ", with your comment" : ""}`,
2042
+ // Pilot speaks up only when a date was given that the queue says won't hold.
2043
+ ...(values.due ? pilotLines(r, r.created) : []),
2044
+ ].join("\n"),
2045
+ )
2022
2046
  .join("\n"),
2023
2047
  ),
2024
2048
  );
@@ -2099,7 +2123,11 @@ export async function run(argv, io = {}) {
2099
2123
  task: one(positionals, "task key, like RR-42"),
2100
2124
  title: values.title,
2101
2125
  assignee: values.assignee,
2102
- due: values.due === undefined ? undefined : nullable(dueDate(values.due)),
2126
+ due:
2127
+ values.due === undefined || duePilot(values.due)
2128
+ ? undefined
2129
+ : nullable(dueDate(values.due)),
2130
+ suggestedDue: duePilot(values.due),
2103
2131
  priority: values.priority,
2104
2132
  status: values.status === undefined ? undefined : statusWord(values.status),
2105
2133
  description: values.notes,
@@ -2121,6 +2149,7 @@ export async function run(argv, io = {}) {
2121
2149
  `Updated: ${taskLine(r.updated, opts)}`,
2122
2150
  r.updated.waitsOn ? `Waits on ${r.updated.waitsOn.join(", ")}.` : null,
2123
2151
  r.updated.repeat ? `Repeats ${REPEAT_WORD[r.updated.repeat]}.` : null,
2152
+ ...(values.due && !duePilot(values.due) ? pilotLines(r, r.updated) : []),
2124
2153
  ]
2125
2154
  .filter(Boolean)
2126
2155
  .join("\n"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harborppm/cli",
3
- "version": "0.55.0",
3
+ "version": "0.56.0",
4
4
  "description": "Harbor from the terminal: a full-screen app with everything, plus commands for scripts and agents.",
5
5
  "keywords": [
6
6
  "harbor",