@opennous/cli 0.14.1 → 0.15.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/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/src/backfill.js +8 -1
- package/src/index.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @opennous/cli changelog
|
|
2
2
|
|
|
3
|
+
## 0.15.0
|
|
4
|
+
|
|
5
|
+
### Added: Slack in `backfill`
|
|
6
|
+
|
|
7
|
+
On a workspace that syncs its history, your Slack messages (DMs and group DMs with customers) wait
|
|
8
|
+
for a backfill like email does. `backfill` counts them before it asks, and reads them on your plan
|
|
9
|
+
(GET-1087).
|
|
10
|
+
|
|
3
11
|
## 0.14.1
|
|
4
12
|
|
|
5
13
|
### Fixed: carrying on with `backfill --workspace`
|
package/package.json
CHANGED
package/src/backfill.js
CHANGED
|
@@ -99,6 +99,12 @@ function runCommand({ cmd, args, input }, cwd) {
|
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
+
/** "Last 180 days: about 40 email threads, 3 meetings, 0 calls, 12 Slack conversations." Slack only when there is some. Pure. */
|
|
103
|
+
export function estimateLine(days, counts) {
|
|
104
|
+
const slack = counts?.slack ? `, ${counts.slack} Slack conversations` : "";
|
|
105
|
+
return `Last ${days} days: about ${counts?.email_thread ?? 0} email threads, ${counts?.meeting ?? 0} meetings, ${counts?.call ?? 0} calls${slack}.`;
|
|
106
|
+
}
|
|
107
|
+
|
|
102
108
|
/** Nothing to read in this window. Pure. */
|
|
103
109
|
export const emptyEstimate = (counts) => !Object.values(counts ?? {}).some((n) => n > 0);
|
|
104
110
|
|
|
@@ -106,7 +112,8 @@ export const emptyEstimate = (counts) => !Object.values(counts ?? {}).some((n) =
|
|
|
106
112
|
export function progressLine(reading, answered, rerun = RERUN) {
|
|
107
113
|
if (reading?.finished) return "Wrapping up: last summaries for your accounts.";
|
|
108
114
|
const stop = `Stop any time with Ctrl-C; run \`${rerun}\` again to carry on.`;
|
|
109
|
-
|
|
115
|
+
const what = { meetings: "meetings", slack: "Slack conversations" }[reading?.kind] ?? "email threads";
|
|
116
|
+
if (reading?.total) return `Read ${reading.done} of ${reading.total} ${what}. ${stop}`;
|
|
110
117
|
if (answered) return `${answered} reads done on your plan. ${stop}`;
|
|
111
118
|
return `Getting ready to read. This can take a few minutes. ${stop}`;
|
|
112
119
|
}
|
package/src/index.js
CHANGED
|
@@ -555,7 +555,7 @@ program
|
|
|
555
555
|
.option("--yes", "start without asking")
|
|
556
556
|
.option("--url <url>", "API base URL (default: https://api.opennous.cloud)")
|
|
557
557
|
.action(async (opts) => {
|
|
558
|
-
const { detectAgents, runBackfill, liveRun, emptyEstimate, rerunCommand, NO_AGENT } = await import("./backfill.js");
|
|
558
|
+
const { detectAgents, runBackfill, liveRun, emptyEstimate, estimateLine, rerunCommand, NO_AGENT } = await import("./backfill.js");
|
|
559
559
|
const days = Number(opts.days);
|
|
560
560
|
if (!Number.isInteger(days) || days < 1 || days > 730) {
|
|
561
561
|
console.error("--days must be a whole number from 1 to 730.");
|
|
@@ -601,7 +601,7 @@ program
|
|
|
601
601
|
return;
|
|
602
602
|
}
|
|
603
603
|
console.log(`\nWorkspace: ${workspace}`);
|
|
604
|
-
console.log(
|
|
604
|
+
console.log(estimateLine(days, est.counts));
|
|
605
605
|
console.log(`They're filtered first, then read on your ${agent} plan. None of it uses your OpenNous credits.`);
|
|
606
606
|
console.log("You can stop at any time and run this again: it carries on where it stopped.\n");
|
|
607
607
|
if (!opts.yes) {
|