ai-agentmanager 1.43.0 → 1.44.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 +7 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/public/actions.js +14 -4
- package/public/app.js +14 -5
- package/public/index.html +1 -0
- package/public/style.css +7 -0
- package/src/actions.js +6 -0
- package/src/cli.js +7 -4
- package/src/today.js +11 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.44.0 (2026-11-12)
|
|
4
|
+
|
|
5
|
+
- **Whose session is this?** Expanded, in full screen and on a phone, the terminal bar shows the agent's name on the left, on every tab (Claude, Code, Shell, Browser). It follows a rename, and its tooltip has the agent's task.
|
|
6
|
+
- **Due in Actions.** A **Due** tab lists every action with a due date that isn't done or removed, soonest first with overdue ones at the top; ones without a fixed date ("next sprint") come last. Due dates read "overdue 3 days", "due tomorrow", "due Friday" (the tooltip has what was said), overdue ones are red, and the tab is outlined red when something is overdue. `agentmgr actions --due` prints the same list.
|
|
7
|
+
- **Due dates are read from when they were asked.** "By Friday" asked last week is that Friday, now overdue, not the next one; Actions and Today agree.
|
|
8
|
+
- **Overlaps in a panel of their own.** An agent's overlaps with other agents are behind **⚔ Overlaps** (with the count) in its detail, next to Overview and Questions, instead of taking room on the page. The agent list's ⚔ marker and the Inbox are unchanged.
|
|
9
|
+
|
|
3
10
|
## 1.43.0 (2026-11-11)
|
|
4
11
|
|
|
5
12
|
- **An MCP session of its own.** Each folder (your home folder or an agent's workspace) gets one Claude Code process for MCP, separate from any agent's session. Listing servers, signing in, reconnecting and calling a tool make no model call and don't interrupt an agent. It closes after 15 minutes unused; **Refresh all** starts a new one.
|
package/README.md
CHANGED
|
@@ -642,7 +642,7 @@ For each agent with its own branch, AI Agent Manager works out which files and l
|
|
|
642
642
|
- **same lines**: both edit the same region, within a few lines (likely a merge conflict). Only judged when both branched from the same commit.
|
|
643
643
|
- **same file**: both edit the file, in different places.
|
|
644
644
|
|
|
645
|
-
The suggested merge order puts an agent whose PR is merged or open first; otherwise the smaller change lands first, so the other has less to rebase. **Tell** sends an agent a short note naming the other agent, the files and the order. Attempts in one race, and a fork and its source, are expected to overlap, so they aren't flagged.
|
|
645
|
+
The suggested merge order puts an agent whose PR is merged or open first; otherwise the smaller change lands first, so the other has less to rebase. An agent's overlaps are behind **⚔ Overlaps** in its detail (with how many), in a panel of their own; the Inbox lists each on the agent that should rebase. **Tell** sends an agent a short note naming the other agent, the files and the order. Attempts in one race, and a fork and its source, are expected to overlap, so they aren't flagged.
|
|
646
646
|
|
|
647
647
|
## Stuck detection
|
|
648
648
|
|
package/package.json
CHANGED
package/public/actions.js
CHANGED
|
@@ -10,6 +10,7 @@ const SAVED = 'agentmgr.actionsFilter';
|
|
|
10
10
|
const PROJECT = 'agentmgr.actionsProject';
|
|
11
11
|
const FILTERS = [
|
|
12
12
|
['open', 'Open'],
|
|
13
|
+
['due', 'Due'],
|
|
13
14
|
['assigned', 'Assigned'],
|
|
14
15
|
['questions', 'Questions'],
|
|
15
16
|
['skipped', 'Skipped'],
|
|
@@ -27,6 +28,11 @@ const STATES = [
|
|
|
27
28
|
['remove', 'Remove', 'Not mine, or not needed: off the list (under Removed)'],
|
|
28
29
|
];
|
|
29
30
|
const ICON = { slack: '💬', gemini: '📝', other: '•' };
|
|
31
|
+
// Still yours to handle: what the Due list shows (done and removed ones are off it).
|
|
32
|
+
const PENDING = new Set(['open', 'assigned', 'skipped', 'snoozed']);
|
|
33
|
+
const late = (r) => Boolean(r.dueAt) && /^overdue/.test(r.dueWords ?? '');
|
|
34
|
+
// Soonest first, overdue at the top; a due date that can't be told ("next sprint") after the dated ones.
|
|
35
|
+
const byDue = (x, y) => (x.dueAt ? 0 : 1) - (y.dueAt ? 0 : 1) || String(x.dueAt ?? '').localeCompare(String(y.dueAt ?? '')) || String(y.when).localeCompare(String(x.when));
|
|
30
36
|
|
|
31
37
|
export function initActions({ api, $, esc, ago, toast, openAgent, projects = () => [] }) {
|
|
32
38
|
let editing = null; // the question whose answer is being edited
|
|
@@ -73,7 +79,7 @@ export function initActions({ api, $, esc, ago, toast, openAgent, projects = ()
|
|
|
73
79
|
function row(r) {
|
|
74
80
|
const opts = STATES.map(([v, label, title]) => `<option value="${v}" title="${esc(title)}" ${r.status === v ? 'selected' : ''}>${label}</option>`).join('');
|
|
75
81
|
const where = r.link ? `<a href="${esc(r.link)}" target="_blank" rel="noopener" title="Open where it was asked">${esc(r.sourceLabel)} ↗</a>` : esc(r.sourceLabel);
|
|
76
|
-
const meta = [`${ICON[r.source] ?? '•'} ${where}`, r.from && `from <b>${esc(r.from)}</b>`, r.due && `<span class="action-due"
|
|
82
|
+
const meta = [`${ICON[r.source] ?? '•'} ${where}`, r.from && `from <b>${esc(r.from)}</b>`, r.due && `<span class="action-due${late(r) ? ' late' : ''}" title="${esc(`Said: ${r.due}${r.dueAt ? ` (${new Date(r.dueAt).toLocaleDateString([], { weekday: 'short', month: 'short', day: 'numeric' })})` : ''}`)}">${esc(r.dueWords ?? `due ${r.due}`)}</span>`, `<span title="${esc(new Date(r.when).toLocaleString())}">${esc(ago(r.when))}</span>`].filter(Boolean).join(' · ');
|
|
77
83
|
const agent = r.agent ? `<button class="link" data-act-open="${esc(r.agent.id)}" title="Open the agent doing it">${esc(r.agent.name)}</button>` : '';
|
|
78
84
|
const talk = r.discussion
|
|
79
85
|
? `<button class="small" data-act-open="${esc(r.discussion.id)}" title="Open the conversation about it">💬 Open talk</button>`
|
|
@@ -91,16 +97,18 @@ export function initActions({ api, $, esc, ago, toast, openAgent, projects = ()
|
|
|
91
97
|
body.innerHTML = '<p class="hint">Loading…</p>';
|
|
92
98
|
return;
|
|
93
99
|
}
|
|
94
|
-
const inGroup = (r, g) => (g === 'all' ? r.group !== 'removed' : g === 'questions' ? r.kind === 'question' && r.group === 'open' : r.group === g);
|
|
100
|
+
const inGroup = (r, g) => (g === 'all' ? r.group !== 'removed' : g === 'questions' ? r.kind === 'question' && r.group === 'open' : g === 'due' ? Boolean(r.due) && PENDING.has(r.group) : r.group === g);
|
|
95
101
|
const count = (g) => data.rows.filter((r) => inGroup(r, g)).length;
|
|
96
102
|
const rows = data.rows.filter((r) => inGroup(r, filter));
|
|
103
|
+
if (filter === 'due') rows.sort(byDue);
|
|
104
|
+
const overdue = data.rows.filter((r) => inGroup(r, 'due') && late(r)).length;
|
|
97
105
|
const f = data.features ?? {};
|
|
98
106
|
const from = [f.slack && 'Slack', f.gemini && 'meeting notes (Notes by Gemini)'].filter(Boolean).join(' and ');
|
|
99
107
|
const list = projects();
|
|
100
108
|
body.innerHTML = `
|
|
101
109
|
<div class="issues-head">
|
|
102
110
|
<h2>Actions</h2>
|
|
103
|
-
<div class="chips" role="tablist">${FILTERS.map(([k, label]) => `<button class="chip ${k === filter ? 'active' : ''}" role="tab" aria-selected="${k === filter}" data-act-filter="${k}">${label} <span class="count">${count(k)}</span></button>`).join('')}</div>
|
|
111
|
+
<div class="chips" role="tablist">${FILTERS.map(([k, label]) => `<button class="chip ${k === filter ? 'active' : ''}${k === 'due' && overdue ? ' late' : ''}" role="tab" aria-selected="${k === filter}" data-act-filter="${k}"${k === 'due' ? ` title="With a due date and not done yet, soonest first${overdue ? `: ${overdue} overdue` : ''}"` : ''}>${label} <span class="count">${count(k)}</span></button>`).join('')}</div>
|
|
104
112
|
<span class="spacer"></span>
|
|
105
113
|
<label class="hint" title="Where an agent works when you assign an action to one">Agents in <select data-act-project class="small">
|
|
106
114
|
<option value="">pick a project</option>
|
|
@@ -122,7 +130,9 @@ export function initActions({ api, $, esc, ago, toast, openAgent, projects = ()
|
|
|
122
130
|
? `Nothing yet. With the Assistant running and "Things asked of me in Slack and in meeting notes" on, what's asked of you shows up here after its next check (or: agentmgr actions add).`
|
|
123
131
|
: filter === 'open'
|
|
124
132
|
? 'Nothing left to decide.'
|
|
125
|
-
:
|
|
133
|
+
: filter === 'due'
|
|
134
|
+
? 'Nothing with a due date is waiting on you.'
|
|
135
|
+
: 'None here.',
|
|
126
136
|
)}</p>`}`;
|
|
127
137
|
keys.redraw();
|
|
128
138
|
}
|
package/public/app.js
CHANGED
|
@@ -1810,10 +1810,11 @@ for (const root of [$('#inbox-view'), $('#detail-body'), $('#needs-body')]) {
|
|
|
1810
1810
|
root.addEventListener('submit', onNeedSubmit);
|
|
1811
1811
|
}
|
|
1812
1812
|
|
|
1813
|
-
// ------------------------------------------------------------------ overview and
|
|
1813
|
+
// ------------------------------------------------------------------ overview, questions and overlaps panels
|
|
1814
1814
|
|
|
1815
1815
|
const openQuestions = (a) => (a.questions ?? []).filter((q) => !q.answer).length;
|
|
1816
|
-
let needsOpen = null; // { id, kind: 'overview' | 'questions' }
|
|
1816
|
+
let needsOpen = null; // { id, kind: 'overview' | 'questions' | 'overlaps' }
|
|
1817
|
+
const NEEDS_TITLE = { overview: 'Overview', questions: 'Questions', overlaps: 'Overlaps' };
|
|
1817
1818
|
|
|
1818
1819
|
function openNeeds(id, kind) {
|
|
1819
1820
|
needsOpen = { id, kind };
|
|
@@ -1826,10 +1827,14 @@ function renderNeeds() {
|
|
|
1826
1827
|
if (!needsOpen) return;
|
|
1827
1828
|
const a = agents.get(needsOpen.id);
|
|
1828
1829
|
if (!a) return $('#needs-dialog').close();
|
|
1829
|
-
$('#needs-title').textContent = `${needsOpen.kind
|
|
1830
|
+
$('#needs-title').textContent = `${NEEDS_TITLE[needsOpen.kind]}: ${a.name}`;
|
|
1830
1831
|
let html;
|
|
1831
1832
|
if (needsOpen.kind === 'overview') {
|
|
1832
1833
|
html = a.aiReview?.verdict ? needCard({ a, kind: 'review', key: `review:${a.id}` }, { inDetail: true }) : '<p class="hint">No AI review yet.</p>';
|
|
1834
|
+
} else if (needsOpen.kind === 'overlaps') {
|
|
1835
|
+
// Every overlap, also the ones where the other agent is the one to rebase.
|
|
1836
|
+
const items = needsFor(a, { both: true }).filter((it) => it.kind === 'conflict');
|
|
1837
|
+
html = items.length ? items.map((it) => needCard(it, { inDetail: true })).join('') : '<p class="hint">No overlaps with other agents now.</p>';
|
|
1833
1838
|
} else {
|
|
1834
1839
|
const open = (a.questions ?? []).filter((q) => !q.answer);
|
|
1835
1840
|
const answered = (a.questions ?? []).filter((q) => q.answer);
|
|
@@ -2294,6 +2299,7 @@ function renderDetail() {
|
|
|
2294
2299
|
${noRepo(a) ? '' : `<button data-act="changes" ${a.workdir && a.status !== 'preparing' ? '' : 'disabled'} title="Read its changes, comment on lines for the agent, commit and open a pull request">Review changes${a.git?.dirtyFiles ? ` <span class="count">${a.git.dirtyFiles}</span>` : ''}</button>`}
|
|
2295
2300
|
${a.aiReview?.verdict ? `<button data-act="overview" title="The AI review: what's done, what's missing, the risks">Overview${a.aiReview.seen ? '' : ' <span class="count">new</span>'}</button>` : ''}
|
|
2296
2301
|
${a.questions?.length ? `<button data-act="questions" title="What the agent asked you, and your answers">Questions${openQuestions(a) ? ` <span class="count">${openQuestions(a)}</span>` : ''}</button>` : ''}
|
|
2302
|
+
${a.conflicts?.length ? `<button data-act="overlaps" title="Other agents changing the same files: which, who should merge first, and what to do">⚔ Overlaps <span class="count">${a.conflicts.length}</span></button>` : ''}
|
|
2297
2303
|
<button data-act="mcp" ${a.workdir && a.status !== 'preparing' ? '' : 'disabled'} title="The MCP servers and tools Claude Code has in this agent's folder; run one in its session or once in the workspace">MCP tools</button>
|
|
2298
2304
|
<button data-act="fork" ${a.workdir && a.git?.branch ? '' : 'disabled'} title="A new agent with this one's code and conversation, in its own worktree, to try another approach">Fork</button>
|
|
2299
2305
|
<button data-act="edit" title="Change its name, request, project, priority, permission mode or model">Edit</button>
|
|
@@ -2338,8 +2344,8 @@ function renderDetail() {
|
|
|
2338
2344
|
${a.builds ? builtUi.panel(a) : ''}
|
|
2339
2345
|
${a.forkOf ? `<div class="bl-banner">⑂ Forked from <a href="#${a.forkOf.agentId}" data-goto="${a.forkOf.agentId}">${esc(a.forkOf.name)}</a>${a.forkOf.checkpoint ? ` at checkpoint ${a.forkOf.checkpoint}` : ''} ${ago(a.forkOf.at)}</div>` : ''}
|
|
2340
2346
|
${(() => {
|
|
2341
|
-
// The AI review and the
|
|
2342
|
-
const items = needsFor(a, { both: true }).filter((it) =>
|
|
2347
|
+
// The AI review, the questions and the overlaps have their own panels (Overview, Questions, Overlaps).
|
|
2348
|
+
const items = needsFor(a, { both: true }).filter((it) => !['review', 'question', 'conflict'].includes(it.kind));
|
|
2343
2349
|
return items.length ? `<div class="needs">${items.map((it) => needCard(it, { inDetail: true })).join('')}</div>` : '';
|
|
2344
2350
|
})()}
|
|
2345
2351
|
${a.outbox ? `<div class="hint outbox-note">✉ ${a.outbox} message${a.outbox > 1 ? 's' : ''} waiting to be typed into the session when the agent is idle</div>` : ''}
|
|
@@ -2662,6 +2668,8 @@ const term = {
|
|
|
2662
2668
|
renderTabs() {
|
|
2663
2669
|
renderSignIn();
|
|
2664
2670
|
const a = this.agentId && agents.get(this.agentId);
|
|
2671
|
+
// Whose session this is, for when the detail above is out of view (expanded, full screen, phone).
|
|
2672
|
+
Object.assign($('#term-agent'), { textContent: a?.name ?? '', title: a ? `${a.name}${a.intent && a.intent !== a.name ? `\n${a.intent}` : ''}` : '' });
|
|
2665
2673
|
// The agent's own session tab is named after its engine (Codex, Muse Code, …).
|
|
2666
2674
|
$('.term-tab[data-kind="claude"]').textContent = ENGINE_LABEL[a?.engine] ?? 'Claude';
|
|
2667
2675
|
sidePane?.follow(this.agentId);
|
|
@@ -3888,6 +3896,7 @@ $('#detail-body').addEventListener('click', async (e) => {
|
|
|
3888
3896
|
return reviewUi.open(a.id);
|
|
3889
3897
|
case 'overview':
|
|
3890
3898
|
case 'questions':
|
|
3899
|
+
case 'overlaps':
|
|
3891
3900
|
return openNeeds(a.id, btn.dataset.act);
|
|
3892
3901
|
case 'mcp':
|
|
3893
3902
|
return mcpUi.open(a.id);
|
package/public/index.html
CHANGED
|
@@ -132,6 +132,7 @@
|
|
|
132
132
|
<div class="splitter split-term" id="split-term" role="separator" aria-orientation="horizontal" title="Drag to resize the terminal; double-click to reset"></div>
|
|
133
133
|
<div class="term-wrap" id="term-wrap" hidden>
|
|
134
134
|
<div class="term-bar">
|
|
135
|
+
<span id="term-agent" class="term-agent"></span>
|
|
135
136
|
<div class="term-tabs" role="tablist">
|
|
136
137
|
<button class="term-tab" data-kind="claude" role="tab">Claude</button>
|
|
137
138
|
<button class="term-tab" data-kind="code" role="tab" title="The agent's files: browse, edit, search and compare (Monaco, the editor in VS Code)">Code</button>
|
package/public/style.css
CHANGED
|
@@ -181,6 +181,10 @@ body.term-max .topbar, body.term-max .sidebar, body.term-max .split-side,
|
|
|
181
181
|
body.term-max #detail-body, body.term-max .split-term, body.term-max #placeholder { display: none !important; }
|
|
182
182
|
body.term-max .layout { grid-template-columns: 1fr; }
|
|
183
183
|
.term-wrap:fullscreen { width: 100vw; height: 100vh; }
|
|
184
|
+
/* The agent's name in the terminal bar, only when the detail with its name is out of view. */
|
|
185
|
+
.term-agent { display: none; flex-shrink: 0; max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: #e6edf3; padding-right: 8px; border-right: 1px solid #30363d; }
|
|
186
|
+
body.term-max .term-agent, .term-wrap:fullscreen .term-agent { display: inline-block; }
|
|
187
|
+
.term-agent:empty { display: none !important; }
|
|
184
188
|
.term-bar button.on { background: #262c38; border-color: #58a6ff; }
|
|
185
189
|
.sidebar { border-right: 1px solid var(--border); overflow-y: auto; background: var(--panel); }
|
|
186
190
|
.side-tabs { display: flex; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--panel); z-index: 2; }
|
|
@@ -545,6 +549,7 @@ dialog::backdrop { background: rgba(0, 0, 0, .45); }
|
|
|
545
549
|
/* On a phone the terminal takes the whole screen; "Hide terminal" goes back. */
|
|
546
550
|
.detail.with-term .term-wrap { position: fixed; inset: 0; z-index: 5; min-height: 0; padding-top: env(safe-area-inset-top); }
|
|
547
551
|
.term-bar #term-title { display: none; }
|
|
552
|
+
.detail.with-term .term-agent { display: inline-block; max-width: 45vw; }
|
|
548
553
|
/* The tabs get a row of their own, so + Shell and + Browser aren't squeezed out of view. */
|
|
549
554
|
.term-bar { flex-wrap: wrap; row-gap: 6px; }
|
|
550
555
|
.term-bar > .term-tabs { flex: 1 0 100%; }
|
|
@@ -1447,6 +1452,8 @@ table.issues tr.kb-on td:first-child { box-shadow: inset 3px 0 0 var(--accent);
|
|
|
1447
1452
|
.actions-table .action-text { font-weight: 600; color: var(--text); }
|
|
1448
1453
|
.actions-table .action-meta { margin-top: 3px; }
|
|
1449
1454
|
.actions-table .action-due { color: var(--yellow); font-weight: 600; }
|
|
1455
|
+
.actions-table .action-due.late { color: var(--red); }
|
|
1456
|
+
.issues-head .chip.late:not(.active) { border-color: var(--red); color: var(--red); }
|
|
1450
1457
|
.actions-table tr.action-skip td:not(.issue-action), .actions-table tr.action-remove td:not(.issue-action), .actions-table tr.action-done td:not(.issue-action) { opacity: 0.65; }
|
|
1451
1458
|
|
|
1452
1459
|
/* Report a problem or idea */
|
package/src/actions.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
// is ever sent to Slack or anywhere else from here.
|
|
8
8
|
|
|
9
9
|
import crypto from 'node:crypto';
|
|
10
|
+
import { actionDue, dueWords } from './today.js';
|
|
10
11
|
|
|
11
12
|
export const ACTION_SOURCES = { slack: 'Slack', gemini: 'Meeting notes', other: 'Other' };
|
|
12
13
|
export const ACTION_STATES = ['open', 'assign', 'skip', 'snooze', 'done', 'remove'];
|
|
@@ -126,8 +127,10 @@ export class MyActions {
|
|
|
126
127
|
rows() {
|
|
127
128
|
const order = Object.fromEntries(Object.values(GROUP).map((g, i) => [g, i]));
|
|
128
129
|
this.wake();
|
|
130
|
+
const now = new Date();
|
|
129
131
|
return this.all
|
|
130
132
|
.map((a) => {
|
|
133
|
+
const due = actionDue(a, now);
|
|
131
134
|
const agent = a.agentId ? this.manager.store?.get?.(a.agentId) ?? null : null;
|
|
132
135
|
const talk = a.discussId ? this.manager.store?.get?.(a.discussId) ?? null : null;
|
|
133
136
|
return {
|
|
@@ -139,6 +142,9 @@ export class MyActions {
|
|
|
139
142
|
from: a.from,
|
|
140
143
|
when: a.when,
|
|
141
144
|
due: a.due,
|
|
145
|
+
// The due date as a time, and in words ("overdue 2 days", "due Friday"), when it can be told.
|
|
146
|
+
dueAt: due?.toISOString() ?? null,
|
|
147
|
+
dueWords: dueWords(due, now),
|
|
142
148
|
context: a.context,
|
|
143
149
|
status: a.status,
|
|
144
150
|
group: GROUP[a.status] ?? 'open',
|
package/src/cli.js
CHANGED
|
@@ -734,18 +734,21 @@ export async function main(argv) {
|
|
|
734
734
|
const actionsCmd = program.command('actions').description("Your action items from Slack and meeting notes (the assistant finds them): decide on each one");
|
|
735
735
|
actionsCmd
|
|
736
736
|
.command('ls', { isDefault: true })
|
|
737
|
-
.description('The open ones (--all for the decided ones too)')
|
|
737
|
+
.description('The open ones (--all for the decided ones too, --due for the dues)')
|
|
738
738
|
.option('--all', 'also assigned, skipped, done and removed')
|
|
739
|
+
.option('--due', 'the ones with a due date not done yet, soonest first (overdue at the top)')
|
|
739
740
|
.option('--json', 'print JSON')
|
|
740
741
|
.action(async (opts) => {
|
|
741
742
|
await daemon();
|
|
742
743
|
const v = await api('GET', '/actions');
|
|
743
|
-
const rows = opts.
|
|
744
|
+
const rows = opts.due
|
|
745
|
+
? v.rows.filter((r) => r.due && ['open', 'assigned', 'skipped', 'snoozed'].includes(r.group)).sort((x, y) => (x.dueAt ? 0 : 1) - (y.dueAt ? 0 : 1) || String(x.dueAt ?? '').localeCompare(String(y.dueAt ?? '')))
|
|
746
|
+
: opts.all ? v.rows : v.rows.filter((r) => r.group === 'open');
|
|
744
747
|
if (opts.json) return console.log(JSON.stringify({ ...v, rows }, null, 2));
|
|
745
|
-
if (!rows.length) return console.log(dim(opts.all ? 'No action items yet.' : 'Nothing open. --all shows the decided ones.'));
|
|
748
|
+
if (!rows.length) return console.log(dim(opts.due ? 'Nothing with a due date is waiting on you.' : opts.all ? 'No action items yet.' : 'Nothing open. --all shows the decided ones.'));
|
|
746
749
|
for (const r of rows) {
|
|
747
750
|
console.log(`${bold(r.id)} ${r.group === 'open' ? yellow(r.text) : r.text}${r.group === 'open' ? '' : dim(` [${r.status}]`)}`);
|
|
748
|
-
console.log(dim(` ${[r.sourceLabel, r.from && `from ${r.from}`, r.due && `due ${r.due}
|
|
751
|
+
console.log(dim(` ${[r.sourceLabel, r.from && `from ${r.from}`, r.due && (/^overdue/.test(r.dueWords ?? '') ? red(r.dueWords) : (r.dueWords ?? `due ${r.due}`)), r.link].filter(Boolean).join(' · ')}`));
|
|
749
752
|
}
|
|
750
753
|
});
|
|
751
754
|
actionsCmd
|
package/src/today.js
CHANGED
|
@@ -32,6 +32,15 @@ export function dueAt(due, now = new Date()) {
|
|
|
32
32
|
return null;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
/**
|
|
36
|
+
* When an action is due: its words read from when it was asked, so "by Friday" said last week is
|
|
37
|
+
* that Friday (overdue now), not the next one. From `now` when it isn't known when it was asked.
|
|
38
|
+
*/
|
|
39
|
+
export function actionDue(a, now = new Date()) {
|
|
40
|
+
const asked = a?.when ? new Date(a.when) : null;
|
|
41
|
+
return dueAt(a?.due, asked && Number.isFinite(asked.getTime()) ? asked : now);
|
|
42
|
+
}
|
|
43
|
+
|
|
35
44
|
/** "overdue 2 days", "due today", "due tomorrow", "due Friday", or null. */
|
|
36
45
|
export function dueWords(at, now = new Date()) {
|
|
37
46
|
if (!at) return null;
|
|
@@ -87,12 +96,12 @@ export function todayItems({ inbox = [], issues = [], actions = [], reviews = []
|
|
|
87
96
|
if (a.group !== 'open') continue;
|
|
88
97
|
// A question put to you: asked directly is pressing; copied or mentioned can wait a little.
|
|
89
98
|
if (a.kind === 'question') {
|
|
90
|
-
const at =
|
|
99
|
+
const at = actionDue(a, now);
|
|
91
100
|
const why = [a.cc ? `you're copied${a.from ? `; ${a.from} asked` : ''}` : a.from ? `${a.from} asked you` : 'asked of you', a.sourceLabel && `in ${a.sourceLabel}`, dueWords(at, now), a.answer ? 'answer drafted' : 'no answer drafted yet'].filter(Boolean).join(' · ');
|
|
92
101
|
items.push({ id: `action:${a.id}`, kind: 'ask', label: a.cc ? "CC'd" : 'Asked you', title: a.question || a.text, why, score: a.cc ? 44 : at && at.getTime() < now.getTime() + DAY ? 16 : 22, at: a.when ?? null, url: a.link ?? null, actionId: a.id, draft: a.answer ?? null });
|
|
93
102
|
continue;
|
|
94
103
|
}
|
|
95
|
-
const at =
|
|
104
|
+
const at = actionDue(a, now);
|
|
96
105
|
const words = dueWords(at, now);
|
|
97
106
|
const late = at && at.getTime() < now.getTime();
|
|
98
107
|
const soon = at && !late && at.getTime() - now.getTime() < DAY;
|