pm-slack-standup 2026.6.2 → 2026.6.4
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 +24 -1
- package/README.md +70 -14
- package/dist/index.d.ts +229 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +595 -125
- package/dist/index.js.map +1 -1
- package/manifest.json +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,29 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 2026.6.
|
|
3
|
+
## 2026.6.4 - 2026-06-04
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Blocker inference, yesterday/today split, multi-channel, fallback-to-stdout, custom section labels ([pm-slack-standup-8s6b](https://github.com/unbraind/pm-slack-standup/blob/main/.agents/pm/features/pm-slack-standup-8s6b.toon))
|
|
8
|
+
|
|
9
|
+
## 2026.06.03 - 2026-06-02
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Deep feature expansion: multi-format output, grouping, sections, date windows ([pm-slack-standup-h64p](https://github.com/unbraind/pm-slack-standup/blob/main/.agents/pm/features/pm-slack-standup-h64p.toon))
|
|
14
|
+
- Add --days relative date window alongside --since ([pm-slack-standup-5sow](https://github.com/unbraind/pm-slack-standup/blob/main/.agents/pm/tasks/pm-slack-standup-5sow.toon))
|
|
15
|
+
- Add --sections selection/ordering with dedicated Blocked section ([pm-slack-standup-jimx](https://github.com/unbraind/pm-slack-standup/blob/main/.agents/pm/tasks/pm-slack-standup-jimx.toon))
|
|
16
|
+
- Add --group-by sprint and type \(extend assignee/status\) ([pm-slack-standup-f4m6](https://github.com/unbraind/pm-slack-standup/blob/main/.agents/pm/tasks/pm-slack-standup-f4m6.toon))
|
|
17
|
+
- Add --format slack\|blockkit\|markdown\|plain unified output ([pm-slack-standup-dgyy](https://github.com/unbraind/pm-slack-standup/blob/main/.agents/pm/tasks/pm-slack-standup-dgyy.toon))
|
|
18
|
+
|
|
19
|
+
### Other
|
|
20
|
+
|
|
21
|
+
- Keep slack message text byte-identical; --format governs printed output only \(blockkit JSON no longer always dumped in dry-run\) ([pm-slack-standup-rttw](https://github.com/unbraind/pm-slack-standup/blob/main/.agents/pm/decisions/pm-slack-standup-rttw.toon))
|
|
22
|
+
- Block Kit schema: single header \(150ch\), one mrkdwn section per bucket \(3000ch truncation\), divider + context footer ([pm-slack-standup-rpty](https://github.com/unbraind/pm-slack-standup/blob/main/.agents/pm/decisions/pm-slack-standup-rpty.toon))
|
|
23
|
+
- Export pure helpers + node:test unit suite \(formatters/grouping/window\) ([pm-slack-standup-uf4j](https://github.com/unbraind/pm-slack-standup/blob/main/.agents/pm/tasks/pm-slack-standup-uf4j.toon))
|
|
24
|
+
- Missing-creds real post -\> CommandError \(exit 1\); no network in dry-run ([pm-slack-standup-m9ze](https://github.com/unbraind/pm-slack-standup/blob/main/.agents/pm/tasks/pm-slack-standup-m9ze.toon))
|
|
25
|
+
|
|
26
|
+
## 2026.06.02 - 2026-06-02
|
|
4
27
|
|
|
5
28
|
### Added
|
|
6
29
|
|
package/README.md
CHANGED
|
@@ -5,12 +5,19 @@ A [pm-cli](https://github.com/unbraind/pm-cli) extension that posts your current
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
7
|
- Posts WIP, Blocked, Up Next (and optional Done) items to Slack as a rich **Block Kit** message (header, one section per bucket, context footer) with an automatic plain-text fallback
|
|
8
|
-
-
|
|
9
|
-
-
|
|
8
|
+
- **Four output formats** (`--format`): `slack` (Slack mrkdwn, the default), `blockkit` (the raw Block Kit `blocks` JSON), `markdown` (GitHub/CommonMark), and `plain` text
|
|
9
|
+
- **`--dry-run`** — build and print the message in the chosen format **without** posting to Slack (no network call is made)
|
|
10
|
+
- Group section items by `status` (default), `assignee`, `sprint`, or `type` (`--group-by`)
|
|
11
|
+
- Choose which sections to render and in what order with `--sections` (`in_progress`, `blocked`, `done`, `up_next`); a dedicated **Blocked** section always surfaces blocked items
|
|
12
|
+
- **Impediment inference** — the Blocked section surfaces not only `status=blocked` items but any open/in-progress item carrying a `blocked_by` dependency (top-level or in `dependencies[]`), so dependency-blocked work is never hidden
|
|
13
|
+
- **Yesterday/Today split** (`--yesterday`) — split the Done section into **Done Yesterday** / **Done Today** by the local-day boundary (implies `--include-done`)
|
|
14
|
+
- **Multi-channel posting** (`--channels #a,#b`) — post the same standup to several channel names and/or webhook URLs in one run, each message labelled with its own channel
|
|
15
|
+
- **`--fallback-to-stdout`** — if a Slack post fails, print the rendered standup to stdout (exit 0) instead of erroring out, so the work isn't lost on a transport failure
|
|
16
|
+
- **Custom section labels** (`--section-labels`) — override any section's title and/or emoji, e.g. `in_progress=Rolling,blocked=🔥 On Fire`
|
|
17
|
+
- Scope the "recently closed / Done" window with `--since <iso>` **or** `--days <n>` (relative)
|
|
10
18
|
- Map pm authors to Slack handles so they get mentioned (`--mention-map`)
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
- Webhook URL configurable via flag or environment variable; missing webhook is a graceful no-op (never blocks a workflow)
|
|
19
|
+
- `pm standup export` — write the standup to a file as Markdown or JSON (the JSON form includes the full Block Kit payload for archiving or re-posting)
|
|
20
|
+
- `--channel` override; webhook URL configurable via flag or environment variable. A real post with **no webhook configured** fails with a clear, structured error (exit 1) rather than crashing — use `--dry-run` to preview without credentials
|
|
14
21
|
|
|
15
22
|
## Installation
|
|
16
23
|
|
|
@@ -58,12 +65,35 @@ pm standup [flags]
|
|
|
58
65
|
|------|------|---------|-------------|
|
|
59
66
|
| `--webhook <url>` | string | — | Slack incoming webhook URL (overrides `PM_SLACK_WEBHOOK`) |
|
|
60
67
|
| `--channel <name>` | string | — | Channel name shown in the message (e.g. `#team-eng`) |
|
|
61
|
-
| `--dry-run` | boolean | `false` |
|
|
68
|
+
| `--dry-run` | boolean | `false` | Build and print the message in the chosen format **without** posting |
|
|
69
|
+
| `--format <fmt>` | string | `slack` | Output format: `slack` (mrkdwn) \| `blockkit` (JSON) \| `markdown` \| `plain` |
|
|
62
70
|
| `--include-done` | boolean | `false` | Include recently-closed items in a Done section |
|
|
63
|
-
| `--since <iso>` | string | — | ISO date/time window;
|
|
64
|
-
| `--
|
|
71
|
+
| `--since <iso>` | string | — | ISO date/time window; scopes the Done section to items updated since then |
|
|
72
|
+
| `--days <n>` | number | — | Relative window: scope Done to items updated in the last N days (combines with `--since`, more restrictive bound wins) |
|
|
73
|
+
| `--group-by <field>` | string | `status` | Group section items by `status` \| `assignee` \| `sprint` \| `type` |
|
|
74
|
+
| `--sections <list>` | string | all | Comma list of sections to render/order: `in_progress`, `blocked`, `done`, `up_next` |
|
|
65
75
|
| `--mention-map <map>` | string | — | Map pm authors to Slack handles, e.g. `alice=@alice,bob=@bob` |
|
|
66
|
-
| `--
|
|
76
|
+
| `--yesterday` | boolean | `false` | Split Done into **Done Yesterday** / **Done Today** by local day (implies `--include-done`) |
|
|
77
|
+
| `--channels <list>` | string | — | Post the same standup to multiple targets: comma list of `#channel` names and/or full webhook URLs |
|
|
78
|
+
| `--fallback-to-stdout` | boolean | `false` | If the Slack post fails, print the rendered standup to stdout (exit 0) instead of erroring |
|
|
79
|
+
| `--section-labels <map>` | string | — | Override section titles/emoji, e.g. `in_progress=Rolling,blocked=🔥 On Fire` |
|
|
80
|
+
|
|
81
|
+
> **Note on `text`:** the legacy `--format text` value is still accepted as an alias for `plain`.
|
|
82
|
+
|
|
83
|
+
### Output formats
|
|
84
|
+
|
|
85
|
+
`--format` selects what the command prints (in `--dry-run`) and how it renders the Slack message text:
|
|
86
|
+
|
|
87
|
+
- **`slack`** (default) — Slack mrkdwn (`*bold*`, `_italic_`). The message posted to Slack is unchanged from previous versions.
|
|
88
|
+
- **`blockkit`** — the raw Slack Block Kit `{ "blocks": [...] }` JSON, ready to POST to `chat.postMessage` or paste into Block Kit Builder.
|
|
89
|
+
- **`markdown`** — GitHub/CommonMark with `#`/`##` headings and `-` bullets, for issues, wikis, or PR comments.
|
|
90
|
+
- **`plain`** — emphasis-free plain text for email or terminals.
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
pm standup --dry-run --format blockkit # raw Block Kit JSON
|
|
94
|
+
pm standup --dry-run --format markdown --include-done # CommonMark
|
|
95
|
+
pm standup --dry-run --format plain --days 7 # plain text, last 7 days
|
|
96
|
+
```
|
|
67
97
|
|
|
68
98
|
## Export
|
|
69
99
|
|
|
@@ -96,7 +126,33 @@ pm standup --channel '#team-eng' --dry-run
|
|
|
96
126
|
|
|
97
127
|
**Include done items and use plain text format:**
|
|
98
128
|
```bash
|
|
99
|
-
pm standup --include-done --format
|
|
129
|
+
pm standup --include-done --format plain
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
**Group by sprint, only In Progress + Blocked:**
|
|
133
|
+
```bash
|
|
134
|
+
pm standup --dry-run --group-by sprint --sections in_progress,blocked
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**Split Done by yesterday/today:**
|
|
138
|
+
```bash
|
|
139
|
+
pm standup --dry-run --yesterday --format plain
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Post to multiple channels at once:**
|
|
143
|
+
```bash
|
|
144
|
+
pm standup --channels '#team-eng,#standups'
|
|
145
|
+
pm standup --channels 'https://hooks.slack.com/services/AAA,https://hooks.slack.com/services/BBB'
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**Never lose the standup if Slack is down:**
|
|
149
|
+
```bash
|
|
150
|
+
pm standup --fallback-to-stdout # prints the message to stdout (exit 0) if the post fails
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
**Rename sections / change emoji:**
|
|
154
|
+
```bash
|
|
155
|
+
pm standup --dry-run --section-labels 'in_progress=Rolling,blocked=🔥 On Fire'
|
|
100
156
|
```
|
|
101
157
|
|
|
102
158
|
**Full explicit invocation:**
|
|
@@ -132,7 +188,7 @@ pm standup \
|
|
|
132
188
|
• [Chore] Update dependencies (priority 3)
|
|
133
189
|
```
|
|
134
190
|
|
|
135
|
-
### Plain Text (`--format
|
|
191
|
+
### Plain Text (`--format plain`)
|
|
136
192
|
|
|
137
193
|
```
|
|
138
194
|
📊 pm standup — 2026-05-09
|
|
@@ -173,10 +229,10 @@ npm run dev # watch mode
|
|
|
173
229
|
|
|
174
230
|
## How It Works
|
|
175
231
|
|
|
176
|
-
1. Reads every item once via `pm --path <root> list-all --json --include-body` and buckets them locally into In Progress, Blocked, open (Up Next) and optionally Done.
|
|
232
|
+
1. Reads every item once via `pm --path <root> list-all --json --include-body` and buckets them locally into In Progress, Blocked, open (Up Next) and optionally Done. Any open/in-progress item with a `blocked_by` dependency (top-level or in `dependencies[]`) is re-bucketed into Blocked; closed items are never re-surfaced as blocked.
|
|
177
233
|
2. Sorts open items by priority (ascending) and takes the top 3 as "Up Next".
|
|
178
|
-
3. Builds a Slack Block Kit `blocks` array (header + a section per bucket + context footer) plus a plain-text `fallback`, optionally grouped by assignee and annotated with Slack mentions.
|
|
179
|
-
4.
|
|
234
|
+
3. Builds a Slack Block Kit `blocks` array (header + a section per bucket + context footer) plus a plain-text `fallback`, optionally grouped by assignee and annotated with Slack mentions. Section titles/emoji can be overridden with `--section-labels`, and `--yesterday` expands Done into Done Yesterday / Done Today.
|
|
235
|
+
4. In `--dry-run`, prints the message in the chosen `--format` and exits without any network call. Otherwise posts `{ text, blocks }` to each target (the base webhook plus any `--channels`) using Node.js native `https`. A missing webhook (on a real post) raises a structured `CommandError`; a failed post does too **unless** `--fallback-to-stdout` is set, in which case the rendered standup is printed to stdout and the command exits 0.
|
|
180
236
|
|
|
181
237
|
## License
|
|
182
238
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,232 @@
|
|
|
1
|
+
export declare class CommandError extends Error {
|
|
2
|
+
exitCode: number;
|
|
3
|
+
constructor(message: string, exitCode?: number);
|
|
4
|
+
}
|
|
5
|
+
export interface PmDependency {
|
|
6
|
+
id?: string;
|
|
7
|
+
kind?: string;
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
}
|
|
10
|
+
export interface PmItem {
|
|
11
|
+
id: string;
|
|
12
|
+
title: string;
|
|
13
|
+
status: string;
|
|
14
|
+
type?: string;
|
|
15
|
+
priority?: number;
|
|
16
|
+
tags?: string[];
|
|
17
|
+
milestone?: string;
|
|
18
|
+
release?: string;
|
|
19
|
+
sprint?: string;
|
|
20
|
+
assignee?: string;
|
|
21
|
+
author?: string;
|
|
22
|
+
body?: string;
|
|
23
|
+
created_at?: string;
|
|
24
|
+
updated_at?: string;
|
|
25
|
+
blocked_by?: string;
|
|
26
|
+
dependencies?: PmDependency[];
|
|
27
|
+
}
|
|
28
|
+
export type Format = "slack" | "blockkit" | "markdown" | "plain";
|
|
29
|
+
export type GroupBy = "status" | "assignee" | "sprint" | "type";
|
|
30
|
+
export type SectionKey = "in_progress" | "blocked" | "done" | "up_next";
|
|
31
|
+
export declare const ALL_SECTIONS: readonly SectionKey[];
|
|
32
|
+
export interface StandupData {
|
|
33
|
+
wip: PmItem[];
|
|
34
|
+
blocked: PmItem[];
|
|
35
|
+
done: PmItem[];
|
|
36
|
+
upNext: PmItem[];
|
|
37
|
+
total: number;
|
|
38
|
+
doneYesterday?: PmItem[];
|
|
39
|
+
doneToday?: PmItem[];
|
|
40
|
+
}
|
|
41
|
+
export interface StandupOptions {
|
|
42
|
+
channel?: string;
|
|
43
|
+
format: Format;
|
|
44
|
+
includeDone: boolean;
|
|
45
|
+
since?: string;
|
|
46
|
+
groupBy: GroupBy;
|
|
47
|
+
sections: SectionKey[];
|
|
48
|
+
mentionMap: Record<string, string>;
|
|
49
|
+
splitYesterday: boolean;
|
|
50
|
+
sectionLabels: Partial<Record<SectionKey, SectionLabelOverride>>;
|
|
51
|
+
}
|
|
52
|
+
export interface SectionLabelOverride {
|
|
53
|
+
emoji?: string;
|
|
54
|
+
title?: string;
|
|
55
|
+
}
|
|
56
|
+
export declare function readBoolOption(options: Record<string, unknown>, key: string): boolean;
|
|
57
|
+
export declare function readStrOption(options: Record<string, unknown>, key: string): string | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Parse a `--mention-map` spec mapping pm authors to Slack handles.
|
|
60
|
+
* Accepts `author=@handle,other=@h2` (commas) or semicolon separators.
|
|
61
|
+
* A leading `@` on the handle is optional and normalized on.
|
|
62
|
+
*/
|
|
63
|
+
export declare function parseMentionMap(spec: string | undefined): Record<string, string>;
|
|
64
|
+
/**
|
|
65
|
+
* Normalize a `--format` value. Accepts the four public formats plus the
|
|
66
|
+
* legacy `text` alias (== `plain`). Unknown values raise a USAGE CommandError.
|
|
67
|
+
*/
|
|
68
|
+
export declare function parseFormat(raw: string | undefined): Format;
|
|
69
|
+
export declare function parseGroupBy(raw: string | undefined): GroupBy;
|
|
70
|
+
/**
|
|
71
|
+
* Parse a `--sections` spec (comma/semicolon list) into an ordered, de-duped
|
|
72
|
+
* list of section keys. Empty spec → all sections in default order. An
|
|
73
|
+
* unknown token is a USAGE error rather than a silent drop.
|
|
74
|
+
*/
|
|
75
|
+
export declare function parseSections(spec: string | undefined): SectionKey[];
|
|
76
|
+
/**
|
|
77
|
+
* Parse a `--section-labels` spec overriding section titles (and optionally
|
|
78
|
+
* an emoji). Accepts `key=Label,other=Label2` (comma/semicolon separated).
|
|
79
|
+
* The label value may itself lead with an emoji + space, e.g.
|
|
80
|
+
* `blocked=🔥 On Fire` sets emoji "🔥" and title "On Fire"; a label with no
|
|
81
|
+
* leading emoji keeps the section's default emoji and only changes the title.
|
|
82
|
+
* Keys use the same aliases as `--sections` (wip→in_progress, etc.).
|
|
83
|
+
* Unknown keys are a USAGE error rather than a silent drop.
|
|
84
|
+
*/
|
|
85
|
+
export declare function parseSectionLabels(spec: string | undefined): Partial<Record<SectionKey, SectionLabelOverride>>;
|
|
86
|
+
/**
|
|
87
|
+
* Parse a `--channels` spec (comma/semicolon list) into an ordered, de-duped
|
|
88
|
+
* list of channel targets. Each target is either a Slack channel name
|
|
89
|
+
* (e.g. `#team-eng`) or a full webhook URL — multi-channel posting accepts
|
|
90
|
+
* both (a name is shown in the message; a URL is POSTed to). Empty → [].
|
|
91
|
+
*/
|
|
92
|
+
export declare function parseChannels(spec: string | undefined): string[];
|
|
93
|
+
/** True when a channel token is a full webhook URL rather than a name. */
|
|
94
|
+
export declare function isWebhookUrl(token: string): boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Resolve the "recently closed" window start (ms epoch) from `--since` and/or
|
|
97
|
+
* `--days`. `--since` is an explicit ISO date/time; `--days <n>` is N days
|
|
98
|
+
* before now. If both are given the *later* (more restrictive) bound wins.
|
|
99
|
+
* Returns NaN when neither is set (no windowing). Invalid input → USAGE error.
|
|
100
|
+
*/
|
|
101
|
+
export declare function resolveSinceMs(since: string | undefined, days: number | undefined, now?: number): number;
|
|
102
|
+
export declare function parseDays(raw: string | undefined): number | undefined;
|
|
103
|
+
/**
|
|
104
|
+
* Read every item once via `list-all --json --include-body`, then bucket by
|
|
105
|
+
* status locally. This is a single pm invocation (vs. four list-by-status
|
|
106
|
+
* calls) and gives us bodies + assignee + timestamps for grouping/windowing.
|
|
107
|
+
*/
|
|
108
|
+
export declare function fetchAllItems(pmRoot: string): PmItem[];
|
|
109
|
+
/**
|
|
110
|
+
* True when an item's last activity falls within the [sinceMs, now] window.
|
|
111
|
+
* NaN sinceMs means "no window" → always true.
|
|
112
|
+
*/
|
|
113
|
+
export declare function withinWindow(item: PmItem, sinceMs: number): boolean;
|
|
114
|
+
/**
|
|
115
|
+
* True when an item carries a `blocked_by` dependency, regardless of its
|
|
116
|
+
* status. pm surfaces this either as a top-level `blocked_by` string (item ID
|
|
117
|
+
* or free-text reason) or as one/more `dependencies` entries with
|
|
118
|
+
* `kind: "blocked_by"`. Used to surface impediments that are NOT explicitly
|
|
119
|
+
* status=blocked under the Blocked section.
|
|
120
|
+
*/
|
|
121
|
+
export declare function hasBlockedByDep(item: PmItem): boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Local-day key (YYYY-MM-DD in the host's local timezone) for an item's last
|
|
124
|
+
* activity. Used by the `--yesterday` split. Falls back to created_at, then
|
|
125
|
+
* to the empty string when no timestamp is parseable.
|
|
126
|
+
*/
|
|
127
|
+
export declare function localDayKey(item: PmItem): string;
|
|
128
|
+
/** Local-day key (YYYY-MM-DD) for a given epoch-ms instant. */
|
|
129
|
+
export declare function localDayKeyOf(ms: number): string;
|
|
130
|
+
/**
|
|
131
|
+
* Bucket items into standup sections.
|
|
132
|
+
* `sinceMs` (epoch ms, NaN = no window) filters the Done section to items
|
|
133
|
+
* updated within the window; WIP/blocked/up-next always reflect current state.
|
|
134
|
+
*/
|
|
135
|
+
export declare function buildStandupData(items: PmItem[], opts: StandupOptions, sinceMs?: number, now?: number): StandupData;
|
|
136
|
+
interface SectionDef {
|
|
137
|
+
key: SectionKey;
|
|
138
|
+
emoji: string;
|
|
139
|
+
title: string;
|
|
140
|
+
items: PmItem[];
|
|
141
|
+
emptyNote: string | null;
|
|
142
|
+
withPriority: boolean;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Resolve the ordered, selected section definitions for the given data.
|
|
146
|
+
* `in_progress` and `blocked` always render (even empty, with their note);
|
|
147
|
+
* `done` and `up_next` only render when they hold items — preserving the
|
|
148
|
+
* historical message shape. `--sections` filters which keys are eligible.
|
|
149
|
+
*
|
|
150
|
+
* When `--yesterday` is active and Done has items, the single Done section is
|
|
151
|
+
* expanded into "Done Yesterday" + "Done Today" (only the non-empty subsets
|
|
152
|
+
* render), preserving the section's position in the ordering.
|
|
153
|
+
*/
|
|
154
|
+
export declare function resolveSections(data: StandupData, opts: StandupOptions): SectionDef[];
|
|
155
|
+
export declare function itemText(item: PmItem, mentionMap: Record<string, string>, withPriority?: boolean): string;
|
|
156
|
+
/**
|
|
157
|
+
* Group a list of items by the configured field (assignee, sprint or type).
|
|
158
|
+
* Items missing the field bucket under a synthetic "_none" key (rendered as a
|
|
159
|
+
* friendly label). Returns entries sorted by group key for stable output.
|
|
160
|
+
*/
|
|
161
|
+
export declare function groupItems(items: PmItem[], groupBy: GroupBy): Array<[string, PmItem[]]>;
|
|
162
|
+
/**
|
|
163
|
+
* Render the standup as a single text blob for the chosen non-Block-Kit
|
|
164
|
+
* format. `slack` is byte-identical to the historical output (mrkdwn);
|
|
165
|
+
* `plain` drops emphasis punctuation; `markdown` uses `#`/`**`/`-`.
|
|
166
|
+
*/
|
|
167
|
+
export declare function buildTextMessage(data: StandupData, opts: StandupOptions): string;
|
|
168
|
+
export interface SlackBlock {
|
|
169
|
+
type: string;
|
|
170
|
+
[key: string]: unknown;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Build a Slack Block Kit `blocks` array: a header, a section per selected
|
|
174
|
+
* standup bucket and a context footer. Returns the blocks plus a plain-text
|
|
175
|
+
* `fallback` Slack renders in notifications and old clients.
|
|
176
|
+
*
|
|
177
|
+
* Block Kit schema choices: a single `header` block (plain_text, capped at
|
|
178
|
+
* Slack's 150-char limit), one `section`/`mrkdwn` block per bucket (Slack
|
|
179
|
+
* caps section text at 3000 chars — long buckets are truncated with an
|
|
180
|
+
* ellipsis to stay valid), a `divider`, then a `context` footer summarizing
|
|
181
|
+
* counts / window / grouping.
|
|
182
|
+
*/
|
|
183
|
+
export declare function buildBlockKit(data: StandupData, opts: StandupOptions): {
|
|
184
|
+
blocks: SlackBlock[];
|
|
185
|
+
fallback: string;
|
|
186
|
+
};
|
|
187
|
+
/**
|
|
188
|
+
* Render the standup in whichever `--format` was selected, as the string the
|
|
189
|
+
* command prints (dry-run) or the exporter writes. `blockkit` returns the
|
|
190
|
+
* pretty-printed `{ blocks }` JSON; everything else returns text.
|
|
191
|
+
*/
|
|
192
|
+
export declare function renderStandup(data: StandupData, opts: StandupOptions): string;
|
|
193
|
+
/** One resolved post target: the webhook URL to POST to + the channel name. */
|
|
194
|
+
export interface PostTarget {
|
|
195
|
+
webhookUrl: string;
|
|
196
|
+
/** Channel name shown in the message (may differ per target). */
|
|
197
|
+
channel?: string;
|
|
198
|
+
}
|
|
199
|
+
export interface PostResultEntry {
|
|
200
|
+
channel?: string;
|
|
201
|
+
ok: boolean;
|
|
202
|
+
error?: string;
|
|
203
|
+
}
|
|
204
|
+
/** A poster sends one payload to one webhook. Injectable for testing. */
|
|
205
|
+
export type Poster = (webhookUrl: string, payload: Record<string, unknown>) => Promise<void>;
|
|
206
|
+
/**
|
|
207
|
+
* Resolve the ordered list of post targets from `--webhook`/env + `--channel`
|
|
208
|
+
* + `--channels`. Each `--channels` token is either a `#name` (posted to the
|
|
209
|
+
* base webhook, just changing the displayed channel) or a full webhook URL
|
|
210
|
+
* (posted to that URL). When no `--channels` is given, a single target using
|
|
211
|
+
* the base webhook + `--channel` is returned. De-dupes (webhook,channel) pairs.
|
|
212
|
+
*/
|
|
213
|
+
export declare function resolvePostTargets(baseWebhook: string, baseChannel: string | undefined, channels: string[]): PostTarget[];
|
|
214
|
+
/**
|
|
215
|
+
* Post the standup to every resolved target, re-rendering per target so each
|
|
216
|
+
* channel's message shows its own channel name. Returns a per-target result;
|
|
217
|
+
* never throws — the caller decides how to treat failures (e.g. fallback to
|
|
218
|
+
* stdout). The `poster` is injectable so this is testable without a network.
|
|
219
|
+
*/
|
|
220
|
+
export declare function postStandupTargets(targets: PostTarget[], data: StandupData, baseOpts: StandupOptions, poster: Poster): Promise<PostResultEntry[]>;
|
|
221
|
+
/**
|
|
222
|
+
* Resolve every standup option except the render `format`, which differs
|
|
223
|
+
* between the command (slack|blockkit|markdown|plain) and the exporter
|
|
224
|
+
* (md|json file format). Callers supply the format they want.
|
|
225
|
+
*/
|
|
226
|
+
export declare function resolveStandupOptions(options: Record<string, unknown>, format: Format): {
|
|
227
|
+
opts: StandupOptions;
|
|
228
|
+
sinceMs: number;
|
|
229
|
+
};
|
|
1
230
|
declare const _default: {
|
|
2
231
|
name: string;
|
|
3
232
|
version: string;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../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