@nanocollective/roster 0.1.0-beta.7 → 0.1.0-beta.9
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/dist/cli.js +20 -5
- package/dist/worker/assets/assets/css/home.css +2 -0
- package/dist/worker/assets/assets/js/views/home.js +58 -28
- package/dist/worker/index.js +1 -1
- package/docs/architecture.md +22 -3
- package/docs/concepts.md +1 -1
- package/docs/developing.md +1 -1
- package/docs/memory.md +2 -1
- package/docs/portal.md +2 -1
- package/docs/session-workflow.md +10 -6
- package/docs/staff-yaml.md +5 -2
- package/package.json +1 -1
- package/templates/brain/CHARTER.md +2 -2
- package/templates/brain/STATE.md +16 -0
- package/templates/brain/memory/INDEX.md +1 -1
- package/templates/ops/.github/workflows/session.yaml +14 -1
- package/templates/ops/org/voice.md +2 -1
- package/templates/ops/prompts/daily.md +29 -11
- package/templates/ops/prompts/mention.md +5 -2
- package/templates/ops/status-week.mjs +169 -0
- package/templates/portal/css/home.css +2 -0
- package/templates/portal/js/views/home.js +58 -28
package/dist/cli.js
CHANGED
|
@@ -2122,6 +2122,7 @@ function buildPlan(ws, org, handle, opts, parseYaml3) {
|
|
|
2122
2122
|
handle,
|
|
2123
2123
|
...ASK_KINDS,
|
|
2124
2124
|
"keep-open",
|
|
2125
|
+
"status",
|
|
2125
2126
|
"build",
|
|
2126
2127
|
"blocked",
|
|
2127
2128
|
...peers.map((p) => `from-${p.handle}`)
|
|
@@ -2381,12 +2382,15 @@ async function applyPlan(ws, plan2, opts) {
|
|
|
2381
2382
|
"-X",
|
|
2382
2383
|
"POST",
|
|
2383
2384
|
"-f",
|
|
2384
|
-
|
|
2385
|
+
`title=${statusTitle(/* @__PURE__ */ new Date())}`,
|
|
2385
2386
|
"-f",
|
|
2386
2387
|
`body=${statusBody(staff)}`,
|
|
2387
|
-
// A sweep closes anything with nothing left to do on it. This one never runs out
|
|
2388
|
+
// A sweep closes anything with nothing left to do on it. This one never runs out, until
|
|
2389
|
+
// next week's replaces it.
|
|
2388
2390
|
"-f",
|
|
2389
|
-
"labels[]=keep-open"
|
|
2391
|
+
"labels[]=keep-open",
|
|
2392
|
+
"-f",
|
|
2393
|
+
"labels[]=status"
|
|
2390
2394
|
]);
|
|
2391
2395
|
if (issue.ok && issue.data?.number) {
|
|
2392
2396
|
await ghJson([
|
|
@@ -2499,9 +2503,20 @@ ${line.trimEnd()}
|
|
|
2499
2503
|
lines.splice(i, 0, line.trimEnd());
|
|
2500
2504
|
return lines.join("\n");
|
|
2501
2505
|
}
|
|
2506
|
+
function statusTitle(now) {
|
|
2507
|
+
const monday = new Date(
|
|
2508
|
+
Date.UTC(
|
|
2509
|
+
now.getUTCFullYear(),
|
|
2510
|
+
now.getUTCMonth(),
|
|
2511
|
+
now.getUTCDate() - (now.getUTCDay() + 6) % 7
|
|
2512
|
+
)
|
|
2513
|
+
);
|
|
2514
|
+
const month = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" ")[monday.getUTCMonth()];
|
|
2515
|
+
return `\u{1F4CD} Where we are: week of ${monday.getUTCDate()} ${month}`;
|
|
2516
|
+
}
|
|
2502
2517
|
function statusBody(staff) {
|
|
2503
2518
|
return [
|
|
2504
|
-
`**${staff.name}'s
|
|
2519
|
+
`**${staff.name}'s status this week. Rewritten every run; a new issue opens each Monday.**`,
|
|
2505
2520
|
"",
|
|
2506
2521
|
"| | The ask |",
|
|
2507
2522
|
"|---|---|",
|
|
@@ -5633,7 +5648,7 @@ Nothing to fix. \`roster doctor\` is clean.
|
|
|
5633
5648
|
"them is reverted by the next `roster upgrade`, and the mistake is invisible until it is",
|
|
5634
5649
|
"expensive. Do not touch:",
|
|
5635
5650
|
"",
|
|
5636
|
-
`- \`${ws.opsName}/compose.mjs\`, \`agents.mjs\`, \`runner-plan.mjs\`, \`inflight.mjs\`, \`run-record.mjs\` \u2014 vendored from the framework.`,
|
|
5651
|
+
`- \`${ws.opsName}/compose.mjs\`, \`agents.mjs\`, \`runner-plan.mjs\`, \`inflight.mjs\`, \`run-record.mjs\`, \`status-week.mjs\` \u2014 vendored from the framework.`,
|
|
5637
5652
|
`- \`${ws.opsName}/.github/workflows/\` and any brain's \`.github/workflows/\` \u2014 generated, and`,
|
|
5638
5653
|
" GitHub App tokens cannot push changes there in any case.",
|
|
5639
5654
|
`- \`${ws.opsName}/.roster/\` \u2014 the recorded merge base.`,
|
|
@@ -88,6 +88,8 @@
|
|
|
88
88
|
.homereport:focus-visible{outline:2px solid var(--accent);outline-offset:0}
|
|
89
89
|
.homereportwho{display:flex;flex-direction:column;gap:2px;min-width:0}
|
|
90
90
|
.homereportwho .meta{padding-left:21px}
|
|
91
|
+
.homereportask{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding-left:21px;margin-top:6px}
|
|
92
|
+
.homereportask .meta{padding-left:0}
|
|
91
93
|
.homereportbody p{margin:0 0 4px;color:var(--ink-dim);font-size:13px;line-height:1.5}
|
|
92
94
|
.homereportbody p:first-child{color:var(--ink)}
|
|
93
95
|
.homereportbody a{color:var(--accent)}
|
|
@@ -55,35 +55,10 @@ export function viewHome(m) {
|
|
|
55
55
|
const page = el("div", { className: "home" });
|
|
56
56
|
page.append(askBox(staff));
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
const reporters = staff.filter((x) => x.brain && x.statusIssue);
|
|
59
|
+
if (reporters.length) {
|
|
59
60
|
page.append(section("Latest reports"));
|
|
60
|
-
|
|
61
|
-
for (const r of h.reports) {
|
|
62
|
-
/* The report is markdown the staff member wrote, with links to the work it names. The
|
|
63
|
-
whole report opens their status issue, where it was posted; a link inside it goes
|
|
64
|
-
where it points. */
|
|
65
|
-
const row = el("div", { className: "homereport homeclick", tabIndex: 0, role: "button" }, [
|
|
66
|
-
el("div", { className: "homereportwho" }, [
|
|
67
|
-
el("span", { className: "homewho2" }, [icon(staffIcon(r.staff), "ic"), el("b", { textContent: r.staff.name })]),
|
|
68
|
-
el("span", { className: "meta", textContent: ago(r.at) }),
|
|
69
|
-
]),
|
|
70
|
-
el("div", {
|
|
71
|
-
className: "md homereportbody",
|
|
72
|
-
innerHTML: mdlite(r.lines.join("\n\n"), { repo: r.staff.brain }),
|
|
73
|
-
}),
|
|
74
|
-
]);
|
|
75
|
-
row.onclick = (ev) => {
|
|
76
|
-
if (!ev.target.closest("a, button")) openThread(r.item);
|
|
77
|
-
};
|
|
78
|
-
row.onkeydown = (ev) => {
|
|
79
|
-
if (ev.target === row && (ev.key === "Enter" || ev.key === " ")) {
|
|
80
|
-
ev.preventDefault();
|
|
81
|
-
openThread(r.item);
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
box.append(row);
|
|
85
|
-
}
|
|
86
|
-
page.append(box);
|
|
61
|
+
page.append(el("div", { className: "card homereports" }, reporters.map((s) => reportRow(s, h.reports))));
|
|
87
62
|
}
|
|
88
63
|
|
|
89
64
|
page.append(section("Needs you", h.needs.length));
|
|
@@ -116,6 +91,61 @@ export function viewHome(m) {
|
|
|
116
91
|
m.append(page);
|
|
117
92
|
}
|
|
118
93
|
|
|
94
|
+
/* ------------------------------- reports -------------------------------- */
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* One staff member's last report, or a line saying there is none today, with a button that asks
|
|
98
|
+
* for one. The report is markdown the staff member wrote, with links to the work it names. The
|
|
99
|
+
* whole row opens their status issue, where it was posted; a link inside it goes where it points.
|
|
100
|
+
*/
|
|
101
|
+
function reportRow(s, reports) {
|
|
102
|
+
const r = reports.find((x) => x.staff.handle === s.handle);
|
|
103
|
+
const item = r?.item ?? { repo: s.brain, number: s.statusIssue, kind: "issue" };
|
|
104
|
+
const note = el("span", { className: "meta" });
|
|
105
|
+
const ask = el("button", { className: "ghbtn", textContent: "Ask for a report" });
|
|
106
|
+
ask.onclick = async () => {
|
|
107
|
+
ask.disabled = true;
|
|
108
|
+
note.className = "meta";
|
|
109
|
+
note.textContent = "Asking…";
|
|
110
|
+
try {
|
|
111
|
+
await post({
|
|
112
|
+
action: "comment",
|
|
113
|
+
repo: s.brain,
|
|
114
|
+
number: s.statusIssue,
|
|
115
|
+
body: `${s.mention ?? "@" + s.handle} Report, please.`,
|
|
116
|
+
});
|
|
117
|
+
ask.remove();
|
|
118
|
+
note.textContent = `Asked. ${s.name} replies in a few minutes.`;
|
|
119
|
+
refreshSoon();
|
|
120
|
+
} catch (e) {
|
|
121
|
+
note.textContent = String(e.message || e);
|
|
122
|
+
note.className = "meta err";
|
|
123
|
+
ask.disabled = false;
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const row = el("div", { className: "homereport homeclick", tabIndex: 0, role: "button" }, [
|
|
128
|
+
el("div", { className: "homereportwho" }, [
|
|
129
|
+
el("span", { className: "homewho2" }, [icon(staffIcon(s), "ic"), el("b", { textContent: s.name })]),
|
|
130
|
+
el("span", { className: "meta", textContent: r ? ago(r.at) : "No report today" }),
|
|
131
|
+
el("div", { className: "homereportask" }, [ask, note]),
|
|
132
|
+
]),
|
|
133
|
+
r
|
|
134
|
+
? el("div", { className: "md homereportbody", innerHTML: mdlite(r.lines.join("\n\n"), { repo: s.brain }) })
|
|
135
|
+
: el("div"),
|
|
136
|
+
]);
|
|
137
|
+
row.onclick = (ev) => {
|
|
138
|
+
if (!ev.target.closest("a, button")) openThread(item);
|
|
139
|
+
};
|
|
140
|
+
row.onkeydown = (ev) => {
|
|
141
|
+
if (ev.target === row && (ev.key === "Enter" || ev.key === " ")) {
|
|
142
|
+
ev.preventDefault();
|
|
143
|
+
openThread(item);
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
return row;
|
|
147
|
+
}
|
|
148
|
+
|
|
119
149
|
/* ------------------------------- asking -------------------------------- */
|
|
120
150
|
|
|
121
151
|
function askBox(staff) {
|