@nanocollective/roster 0.1.0-beta.19 → 0.1.0-beta.21
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/README.md +8 -0
- package/dist/{agents-Q2DSTLOQ.js → agents-POITEZRI.js} +1 -1
- package/dist/{chunk-JH3LQ34C.js → chunk-FF2WBNNW.js} +18 -1
- package/dist/{chunk-UEZPQ5PV.js → chunk-GDAJPOHK.js} +2 -2
- package/dist/cli.js +1089 -211
- package/dist/{compose-H43W3QI5.js → compose-5DBEHSEV.js} +1 -1
- package/dist/{connectors-U5VT5W2I.js → connectors-5E5ZMGZV.js} +1 -1
- package/dist/worker/assets/assets/css/routines.css +40 -0
- package/dist/worker/assets/assets/js/app.js +4 -1
- package/dist/worker/assets/assets/js/icons.js +2 -0
- package/dist/worker/assets/assets/js/state.js +1 -0
- package/dist/worker/assets/assets/js/views/home.js +1 -0
- package/dist/worker/assets/assets/js/views/routines.js +378 -0
- package/dist/worker/assets/index.html +4 -0
- package/dist/worker/index.js +415 -50
- package/docs/README.md +1 -0
- package/docs/commands.md +45 -0
- package/docs/concepts.md +1 -0
- package/docs/getting-started.md +14 -0
- package/docs/hosting.md +2 -2
- package/docs/portal.md +11 -0
- package/docs/routines.md +65 -0
- package/docs/security.md +5 -3
- package/docs/session-workflow.md +2 -1
- package/docs/staff-yaml.md +1 -0
- package/package.json +1 -1
- package/templates/brain/.gitattributes +3 -0
- package/templates/brain/.github/workflows/%%STAFF%%-daily.yaml +16 -9
- package/templates/brain/staff.yaml +3 -0
- package/templates/ops/.gitattributes +3 -0
- package/templates/ops/.github/workflows/session.yaml +8 -1
- package/templates/ops/compose.mjs +20 -0
- package/templates/ops/prompts/daily.md +21 -0
- package/templates/portal/css/routines.css +40 -0
- package/templates/portal/index.html +4 -0
- package/templates/portal/js/app.js +4 -1
- package/templates/portal/js/icons.js +2 -0
- package/templates/portal/js/state.js +1 -0
- package/templates/portal/js/views/home.js +1 -0
- package/templates/portal/js/views/routines.js +378 -0
- package/templates/skill/SKILL.md +115 -0
package/docs/README.md
CHANGED
|
@@ -29,6 +29,7 @@ Read in this order.
|
|
|
29
29
|
| [Concepts](concepts.md) | The three things you need to know, then the detail. |
|
|
30
30
|
| [Choosing a coding agent](agents.md) | Claude, Codex, Nanocoder, or anything with a command line. |
|
|
31
31
|
| [Connectors](connectors.md) | Give staff outside services: Sentry, Linear, Stripe and more. |
|
|
32
|
+
| [Routines](routines.md) | More times staff wake beyond the daily round, each with its own job. |
|
|
32
33
|
| [Writing a charter](writing-a-charter.md) | The one file nothing can generate for you. |
|
|
33
34
|
| [Extending it](extending.md) | The four seams, and which one to reach for. |
|
|
34
35
|
| [Memory](memory.md) | The grammar, and why deleting is the maintenance. |
|
package/docs/commands.md
CHANGED
|
@@ -16,6 +16,33 @@ Every command that changes anything prints a plan and changes nothing unless you
|
|
|
16
16
|
`portal` is the exception: it is interactive, and each change there is a button you press after
|
|
17
17
|
seeing what it will do.
|
|
18
18
|
|
|
19
|
+
## `roster setup`
|
|
20
|
+
|
|
21
|
+
Where setup has got to, and the one thing to do next. Every step is read from GitHub and from
|
|
22
|
+
disk each time, so it never disagrees with the world and it is safe to run as often as you like.
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
--json the steps as JSON: each with done, who (agent or human), do and command
|
|
26
|
+
--join <org> check out an org that already runs roster, here
|
|
27
|
+
--add-repo <name> add a repo in the org to org.yaml as a product the staff work on
|
|
28
|
+
--dir <path> where the workspace is, or would be
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
This is what the [SKILL.md install](getting-started.md#with-your-coding-agent) follows: a coding
|
|
32
|
+
agent runs `roster setup --json`, does `next`, and runs it again until `ready` is true. A step
|
|
33
|
+
for a human is one only you can do: signing in, confirming on GitHub, a credential typed in your
|
|
34
|
+
own terminal.
|
|
35
|
+
|
|
36
|
+
## `roster skill install`
|
|
37
|
+
|
|
38
|
+
Saves Roster's SKILL.md for each coding agent on this machine (Claude Code in
|
|
39
|
+
`~/.claude/skills/roster`, Codex in `~/.codex/skills/roster`), so a later session knows how to
|
|
40
|
+
run Roster without being told. It is the same file as https://roster.nanocollective.org/SKILL.md.
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
--print print the file instead
|
|
44
|
+
```
|
|
45
|
+
|
|
19
46
|
## `roster fix`
|
|
20
47
|
|
|
21
48
|
Every scanner's findings, as one brief you paste into a coding agent working in this workspace.
|
|
@@ -180,6 +207,24 @@ work, so its "unproven" warning goes away. It is a real run and spends what a sc
|
|
|
180
207
|
would, which is why it needs `--apply`. The staff card and Health have the same as
|
|
181
208
|
**Run once now**.
|
|
182
209
|
|
|
210
|
+
## `roster routine <handle>`
|
|
211
|
+
|
|
212
|
+
When a staff member wakes beyond the daily round, and what they do then. With no action it
|
|
213
|
+
lists their daily round and routines.
|
|
214
|
+
|
|
215
|
+
```
|
|
216
|
+
add --name <n> --at <cron> --do <text> a new routine; --do-file <path> reads the text from a file
|
|
217
|
+
remove <id> take one away
|
|
218
|
+
daily <cron> move the daily round
|
|
219
|
+
run <id> start one routine now
|
|
220
|
+
--apply write, commit and push the brain repo
|
|
221
|
+
--ops <dir> ops repo directory
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Times are five-field cron in UTC. A change writes `staff.yaml`, `routines/<id>.md` and the
|
|
225
|
+
daily caller together, so the schedule GitHub fires on is always the one in the manifest. The
|
|
226
|
+
portal's **Routines** screen does the same with a picker. See [routines](routines.md).
|
|
227
|
+
|
|
183
228
|
## `roster retire <handle>`
|
|
184
229
|
|
|
185
230
|
Stop a staff member without destroying anything.
|
package/docs/concepts.md
CHANGED
|
@@ -131,6 +131,7 @@ What starts a run:
|
|
|
131
131
|
| Trigger | Runs | Counts against `max_runs_per_day` |
|
|
132
132
|
|---|---|---|
|
|
133
133
|
| the schedule | `daily` | no |
|
|
134
|
+
| a [routine](routines.md)'s time | `daily`, framed as that routine | no |
|
|
134
135
|
| **Run once now**, or Actions → Run workflow | `daily` | no |
|
|
135
136
|
| a person writing `@handle` on the staff member's tracker | `mention` | no |
|
|
136
137
|
| a peer opening an issue there with their `from-<handle>` label | `mention`, framed as a peer's ask | yes |
|
package/docs/getting-started.md
CHANGED
|
@@ -20,6 +20,20 @@ each a conversation of twenty to thirty minutes with your own AI. The rest is ab
|
|
|
20
20
|
clicks and waiting for the run. Those two files are what make the staff worth running, so that
|
|
21
21
|
hour is the part not to rush.
|
|
22
22
|
|
|
23
|
+
## With your coding agent
|
|
24
|
+
|
|
25
|
+
Paste this into Claude Code, Codex, Cursor or Gemini CLI on your computer:
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
set up https://roster.nanocollective.org/SKILL.md
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The agent installs roster and walks through the same steps as below, one at a time. It runs
|
|
32
|
+
`roster setup --json` to see what is next, interviews you for the business, priorities and
|
|
33
|
+
charter using the same briefs, and hands you the parts only you can do: signing in to `gh`,
|
|
34
|
+
confirming each GitHub App, and typing your agent's credential in your own terminal. It never
|
|
35
|
+
asks for a token in chat. When it is done it opens the portal.
|
|
36
|
+
|
|
23
37
|
## Before you start
|
|
24
38
|
|
|
25
39
|
- **`gh`, [signed in](https://cli.github.com)**, as someone who owns the organisation. Setting
|
package/docs/hosting.md
CHANGED
|
@@ -39,8 +39,8 @@ That includes anyone marked `view_only`, who can read everything and wake nobody
|
|
|
39
39
|
[org.yaml](org-yaml.md#human-and-humans).
|
|
40
40
|
|
|
41
41
|
- Sign-in is GitHub's own OAuth flow, through an OAuth App your org creates for the portal.
|
|
42
|
-
The token it hands back is that person's, scoped `repo` and `
|
|
43
|
-
`gh` holds on their machine.
|
|
42
|
+
The token it hands back is that person's, scoped `repo`, `notifications` and `workflow`, the
|
|
43
|
+
same kind `gh` holds on their machine.
|
|
44
44
|
- Everything they do is as themselves. A reply is theirs, a merge is theirs, and what they can
|
|
45
45
|
read is what GitHub lets them read.
|
|
46
46
|
- Somebody who signs in and is not one of the humans, or cannot read the ops repo, is turned
|
package/docs/portal.md
CHANGED
|
@@ -419,6 +419,17 @@ checks it again, stores it as a GitHub secret and commits `org.yaml`.
|
|
|
419
419
|
Notion signs in instead, on the [hosted portal](hosting.md) only: **Sign in to Notion** goes to
|
|
420
420
|
Notion and comes back here.
|
|
421
421
|
|
|
422
|
+
## Routines
|
|
423
|
+
|
|
424
|
+
When each staff member wakes, and what they do then. Each has a **Daily round** with
|
|
425
|
+
**Change time**, then their routines. Each routine shows its name, when it runs, and the
|
|
426
|
+
start of what it says to do, with **Run now**, **Edit** and **Remove**.
|
|
427
|
+
|
|
428
|
+
**New routine** opens the editor: who, a name, when (days of the week, a day of the month, or a
|
|
429
|
+
cron), and what to do. A preview below says it as a sentence while you type. **Save** writes
|
|
430
|
+
`staff.yaml`, `routines/<id>.md` and the daily caller in one commit, as you. See
|
|
431
|
+
[routines](routines.md).
|
|
432
|
+
|
|
422
433
|
## Brain
|
|
423
434
|
|
|
424
435
|
Memory and the file tree, merged, because they were always the same thing: both manifests
|
package/docs/routines.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Routines"
|
|
3
|
+
description: "When staff wake beyond the daily round, and what they do then."
|
|
4
|
+
sidebar_order: 24
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Routines
|
|
8
|
+
|
|
9
|
+
Every staff member has a **daily round**: the scheduled session where they boot, work and hand
|
|
10
|
+
off. A **routine** is one more time they wake, with a job of its own. For example:
|
|
11
|
+
|
|
12
|
+
- every Monday at 09:00, plan the week
|
|
13
|
+
- on the 1st of the month, write last month's numbers into a report
|
|
14
|
+
- every Friday at 16:00, tidy the tracker and close what is done
|
|
15
|
+
|
|
16
|
+
Make them on the portal's **Routines** screen: who, a name, when, and what to do in your own
|
|
17
|
+
words. A preview shows the routine as a sentence while you type. **Run now** starts one
|
|
18
|
+
straight away, which is the way to try one out.
|
|
19
|
+
|
|
20
|
+
From a terminal:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
roster routine cto add --name "Monday plan" --at "0 9 * * 1" \
|
|
24
|
+
--do "Plan the week: read last week's status issue and this month's priorities, then open one issue per thing to ship, ranked." --apply
|
|
25
|
+
roster routine cto # list them
|
|
26
|
+
roster routine cto run monday-plan
|
|
27
|
+
roster routine cto daily "0 7 * * 1-5" --apply # move the daily round
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## What a routine run does
|
|
31
|
+
|
|
32
|
+
A routine run is a daily session whose prompt opens with the routine's name and your words. The
|
|
33
|
+
staff member boots as usual, so they know where things stand, then does what the routine asks
|
|
34
|
+
instead of the rest of the daily round. They record it as a daily run would: `STATE.md`, their
|
|
35
|
+
memory and the status issue. In **Runs** and on **Home** it shows as "cto routine monday-plan".
|
|
36
|
+
|
|
37
|
+
A routine is not held to `max_runs_per_day`. That limit is for runs nobody asked for, and a
|
|
38
|
+
routine is one you asked for at a set time.
|
|
39
|
+
|
|
40
|
+
## Where it lives
|
|
41
|
+
|
|
42
|
+
Each routine is in two places in the staff member's brain repo:
|
|
43
|
+
|
|
44
|
+
- `staff.yaml`, under `routines:`, has its id and its time:
|
|
45
|
+
`- { id: monday-plan, schedule: "0 9 * * 1" }`
|
|
46
|
+
- `routines/monday-plan.md` has its name as the heading, then what to do.
|
|
47
|
+
|
|
48
|
+
Both are compiled into the daily caller's `on.schedule`, one cron line per routine. When the
|
|
49
|
+
schedule fires, the cron that fired (`github.event.schedule`) says which routine it was. Nothing
|
|
50
|
+
polls between runs, so a routine costs nothing until it runs.
|
|
51
|
+
|
|
52
|
+
The portal and `roster routine` write the three files in one commit, as you. That includes the
|
|
53
|
+
caller under `.github/workflows/`, so on the hosted portal you sign in with GitHub's `workflow`
|
|
54
|
+
permission. If you signed in before routines existed, sign out and sign in again.
|
|
55
|
+
|
|
56
|
+
## Rules
|
|
57
|
+
|
|
58
|
+
- **Times are UTC.** The editor shows your local time beside it.
|
|
59
|
+
- **Two schedules cannot share a minute.** GitHub fires once for a cron listed twice, so the
|
|
60
|
+
second would never run. Move one by a minute.
|
|
61
|
+
- **GitHub runs scheduled workflows late when it is busy**, sometimes by tens of minutes. A
|
|
62
|
+
routine is for "around then", not to the second.
|
|
63
|
+
- **Upgrade first.** Routines need the session workflow from roster 0.1.0-beta.20 or later in
|
|
64
|
+
the ops repo. Saving one before `roster upgrade --apply` is refused with that message, rather
|
|
65
|
+
than writing a caller that would fail.
|
package/docs/security.md
CHANGED
|
@@ -173,9 +173,11 @@ single use, since there is no store to remember it in, but it lasts five minutes
|
|
|
173
173
|
without the PKCE verifier only the client holds. The tools cannot merge, approve, hire or change
|
|
174
174
|
the org.
|
|
175
175
|
|
|
176
|
-
**The OAuth scopes.** `repo` and `
|
|
177
|
-
tokens cannot read notifications, and unread in the portal is GitHub's own unread, kept
|
|
178
|
-
with the website and your phone.
|
|
176
|
+
**The OAuth scopes.** `repo`, `notifications` and `workflow`. A GitHub App would be narrower,
|
|
177
|
+
but its tokens cannot read notifications, and unread in the portal is GitHub's own unread, kept
|
|
178
|
+
in step with the website and your phone. `workflow` is for [routines](routines.md): a routine's
|
|
179
|
+
time is a line in the daily caller under `.github/workflows/`, and GitHub refuses any change
|
|
180
|
+
there from a token without it. `gh` on your own machine already has it.
|
|
179
181
|
|
|
180
182
|
## Connectors
|
|
181
183
|
|
package/docs/session-workflow.md
CHANGED
|
@@ -33,7 +33,8 @@ repositories in this organisation**. Without it, callers fail with "workflow not
|
|
|
33
33
|
| `allowed_tools` | string | `Bash,Read,Write,Edit,Glob,Grep,WebFetch,WebSearch` | Tool permissions, for agents that take them. |
|
|
34
34
|
| `issue_number` | string | `""` | Trigger context. |
|
|
35
35
|
| `comment_id` | string | `""` | Trigger context. |
|
|
36
|
-
| `trigger` | string | `""` | What started the run: `daily`, `manual`, `follow-on`, `mention` or `peer`. Passed to the prompt. |
|
|
36
|
+
| `trigger` | string | `""` | What started the run: `daily`, `routine`, `manual`, `follow-on`, `mention` or `peer`. Passed to the prompt. |
|
|
37
|
+
| `routine` | string | `""` | The routine this run is, by id. The prompt reads `routines/<id>.md` from the brain. See [routines](routines.md). |
|
|
37
38
|
| `max_runs_per_day` | number | `6` | How many `peer` and `follow-on` runs may start in a UTC day. Mentions are never counted. |
|
|
38
39
|
| `secret_prefix` | string | `""` | The prefix of this staff member's App secrets, so `CTO` reads `CTO_APP_ID`. |
|
|
39
40
|
| `public_secret_prefix` | string | `""` | The same for the public App. |
|
package/docs/staff-yaml.md
CHANGED
|
@@ -69,6 +69,7 @@ labels:
|
|
|
69
69
|
| Field | Default | Means |
|
|
70
70
|
|---|---|---|
|
|
71
71
|
| `schedule` | none | Cron for the daily run. Rendered into the caller. |
|
|
72
|
+
| `routines` | `[]` | More times to wake, each `{ id, schedule }`, with what to do in `routines/<id>.md`. Rendered into the caller's schedule. See [routines](routines.md). |
|
|
72
73
|
| `model` | org default | Model id. |
|
|
73
74
|
| `timeout_minutes` | 90 | Ceiling on the daily session. |
|
|
74
75
|
| `mention_timeout_minutes` | 90 | Ceiling on a mention run. |
|
package/package.json
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
name: %%STAFF_UPPER%% daily run
|
|
2
2
|
|
|
3
|
-
# Generated by roster. The body lives in %%OPS_REPO%%/.github/workflows/session.yaml.
|
|
4
|
-
#
|
|
5
|
-
#
|
|
3
|
+
# Generated by roster from staff.yaml. The body lives in %%OPS_REPO%%/.github/workflows/session.yaml.
|
|
4
|
+
# The schedule is staff.yaml's `schedule:` (the daily round) and `routines:`; change those, in
|
|
5
|
+
# the portal or with `roster routine`, rather than this file.
|
|
6
6
|
#
|
|
7
7
|
# NOTE: %%TOKENS%% are filled by `roster hire`; GitHub's own ${{ }} are left alone.
|
|
8
8
|
|
|
9
|
-
# The trigger
|
|
10
|
-
# by this name.
|
|
11
|
-
run-name: "%%STAFF%% ${{ github.event_name == 'schedule' && 'daily' || inputs.trigger || 'manual' }}"
|
|
9
|
+
# The trigger, as the Actions list shows it: "cto daily", "cto routine monday-plan". The daily
|
|
10
|
+
# limit counts follow-on runs by this name.
|
|
11
|
+
run-name: "%%STAFF%% ${{ github.event_name == 'schedule' && (%%ROUTINE%% != '' && format('routine {0}', %%ROUTINE%%) || 'daily') || inputs.routine != '' && format('routine {0}', inputs.routine) || inputs.trigger || 'manual' }}"
|
|
12
12
|
|
|
13
13
|
on:
|
|
14
|
+
# The daily round first, then one line per routine. The cron that fired says which it was.
|
|
14
15
|
schedule:
|
|
15
|
-
|
|
16
|
+
%%SCHEDULES%%
|
|
16
17
|
# By hand, from Run once now, or as a follow-on: a daily run that ended with the next step
|
|
17
|
-
# ready starts one more, up to max_runs_per_day.
|
|
18
|
+
# ready starts one more, up to max_runs_per_day. `routine` runs one routine now.
|
|
18
19
|
workflow_dispatch:
|
|
19
20
|
inputs:
|
|
20
21
|
trigger:
|
|
@@ -22,6 +23,11 @@ on:
|
|
|
22
23
|
required: false
|
|
23
24
|
default: manual
|
|
24
25
|
type: string
|
|
26
|
+
routine:
|
|
27
|
+
description: "a routine's id, to run that routine now"
|
|
28
|
+
required: false
|
|
29
|
+
default: ""
|
|
30
|
+
type: string
|
|
25
31
|
|
|
26
32
|
# A second run while one is in flight would fight it over the tracker and the branch state. A
|
|
27
33
|
# follow-on is started from inside the run before it, so it waits here until that one ends.
|
|
@@ -46,7 +52,8 @@ jobs:
|
|
|
46
52
|
with:
|
|
47
53
|
staff: %%STAFF%%
|
|
48
54
|
kind: daily
|
|
49
|
-
trigger: ${{ github.event_name == 'schedule' && 'daily' || inputs.trigger || 'manual' }}
|
|
55
|
+
trigger: ${{ github.event_name == 'schedule' && (%%ROUTINE%% != '' && 'routine' || 'daily') || inputs.routine != '' && 'routine' || inputs.trigger || 'manual' }}
|
|
56
|
+
routine: ${{ github.event_name == 'schedule' && %%ROUTINE%% || inputs.routine || '' }}
|
|
50
57
|
max_runs_per_day: %%MAX_RUNS%%
|
|
51
58
|
ops_repo: %%OPS_REPO%%
|
|
52
59
|
model: %%MODEL%%
|
|
@@ -10,6 +10,9 @@ brain: %%BRAIN%%
|
|
|
10
10
|
status_issue: %%STATUS_ISSUE%%
|
|
11
11
|
|
|
12
12
|
schedule: "%%SCHEDULE%%"
|
|
13
|
+
# Times this staff member wakes beyond the daily round, each with its own job in
|
|
14
|
+
# routines/<id>.md. Times are UTC. Edit them in the portal or with `roster routine`.
|
|
15
|
+
routines: []
|
|
13
16
|
model: %%MODEL%%
|
|
14
17
|
timeout_minutes: %%TIMEOUT%%
|
|
15
18
|
mention_timeout_minutes: %%MENTION_TIMEOUT%%
|
|
@@ -19,7 +19,7 @@ on:
|
|
|
19
19
|
required: false
|
|
20
20
|
default: daily
|
|
21
21
|
type: string
|
|
22
|
-
# What started the run: daily | manual | follow-on | mention | peer. Peer and follow-on
|
|
22
|
+
# What started the run: daily | routine | manual | follow-on | mention | peer. Peer and follow-on
|
|
23
23
|
# runs start without a person asking, so they are the ones held to max_runs_per_day.
|
|
24
24
|
trigger:
|
|
25
25
|
required: false
|
|
@@ -62,6 +62,12 @@ on:
|
|
|
62
62
|
required: false
|
|
63
63
|
default: ""
|
|
64
64
|
type: string
|
|
65
|
+
# The routine this run is, by id: routines/<id>.md in the brain says what to do. Empty on
|
|
66
|
+
# the daily round, and on a caller generated before routines existed.
|
|
67
|
+
routine:
|
|
68
|
+
required: false
|
|
69
|
+
default: ""
|
|
70
|
+
type: string
|
|
65
71
|
# Trigger context. Empty on a scheduled run; set when a comment woke us.
|
|
66
72
|
issue_number:
|
|
67
73
|
required: false
|
|
@@ -355,6 +361,7 @@ jobs:
|
|
|
355
361
|
"repo":"${{ github.repository }}",
|
|
356
362
|
"actor":"${{ github.actor }}",
|
|
357
363
|
"trigger":"${{ inputs.trigger }}",
|
|
364
|
+
"routine":"${{ inputs.routine }}",
|
|
358
365
|
"previous_status_issue":"${{ steps.week.outputs.previous }}"}
|
|
359
366
|
run: |
|
|
360
367
|
node roster-ops/compose.mjs --staff "${{ inputs.staff }}" --kind "${{ inputs.kind }}" --ops roster-ops --brains . > .roster-prompt.txt
|
|
@@ -366,6 +366,25 @@ export function compose({
|
|
|
366
366
|
follow_on: trigger === "follow-on",
|
|
367
367
|
};
|
|
368
368
|
|
|
369
|
+
// A routine run carries the routine's id; what to do is the person's own words in
|
|
370
|
+
// routines/<id>.md. Read as a value, never rendered as a template, like the in-flight list.
|
|
371
|
+
const routineId = String(event.routine ?? "");
|
|
372
|
+
let routine = null;
|
|
373
|
+
if (/^[a-z0-9][a-z0-9-]{0,39}$/.test(routineId)) {
|
|
374
|
+
const file = join(brainDir, "routines", `${routineId}.md`);
|
|
375
|
+
if (existsSync(file)) {
|
|
376
|
+
const text = readFileSync(file, "utf8").trimStart();
|
|
377
|
+
const heading = /^#\s+(.+)\n?/.exec(text);
|
|
378
|
+
routine = {
|
|
379
|
+
id: routineId,
|
|
380
|
+
title: heading ? heading[1].trim() : routineId,
|
|
381
|
+
body: (heading ? text.slice(heading[0].length) : text).trim(),
|
|
382
|
+
};
|
|
383
|
+
} else {
|
|
384
|
+
routine = { id: routineId, title: routineId, body: "", missing: true };
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
369
388
|
// What people have open on the product repos, gathered by inflight.mjs just before this runs.
|
|
370
389
|
// Read as a value and never rendered as a template: it is PR titles, which are a person's
|
|
371
390
|
// words, and a `{{` in one must not be able to break composition.
|
|
@@ -398,6 +417,7 @@ export function compose({
|
|
|
398
417
|
peers,
|
|
399
418
|
peer: peers[0] ?? null,
|
|
400
419
|
kind,
|
|
420
|
+
routine,
|
|
401
421
|
// Convenience strings the fragments lean on, computed once here so a
|
|
402
422
|
// fragment never has to do string work.
|
|
403
423
|
peer_list: peers.map((p) => `- \`${p.dir}/\` - the ${p.name}'s brain`).join("\n"),
|
|
@@ -8,6 +8,27 @@ your brain. Reconstitute yourself, do a day's work, hand off.
|
|
|
8
8
|
|
|
9
9
|
{{>? staff:prompts/boot.md}}
|
|
10
10
|
|
|
11
|
+
{{#if routine}}
|
|
12
|
+
## This run is a routine: {{routine.title}}
|
|
13
|
+
|
|
14
|
+
{{human.name}} set this routine up to run at a set time, and it is the job of this run, in place
|
|
15
|
+
of the daily round. Boot as below so you know where things stand, then do what it asks. Record
|
|
16
|
+
what you did the way a daily run would: in `{{staff.dir}}/STATE.md`, your memory, and
|
|
17
|
+
#{{staff.status_issue}}. Do not start the rest of the daily round's work unless the routine says to.
|
|
18
|
+
{{/if}}
|
|
19
|
+
|
|
20
|
+
{{#if routine.missing}}
|
|
21
|
+
`{{staff.dir}}/routines/{{routine.id}}.md` is missing, so there is nothing to do. Say so in
|
|
22
|
+
#{{staff.status_issue}}, naming the routine, and end the run.
|
|
23
|
+
{{/if}}
|
|
24
|
+
{{#if routine.body}}
|
|
25
|
+
What {{human.name}} asked for, as written:
|
|
26
|
+
|
|
27
|
+
<routine>
|
|
28
|
+
{{routine.body}}
|
|
29
|
+
</routine>
|
|
30
|
+
{{/if}}
|
|
31
|
+
|
|
11
32
|
{{#if event.follow_on}}
|
|
12
33
|
**This is a follow-on run.** The last run ended with the next step ready and started this one.
|
|
13
34
|
Boot as usual; `{{staff.dir}}/STATE.md` says what it is.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/* Routines: each staff member's daily round and routines, as rows, and the editor sheet. */
|
|
2
|
+
|
|
3
|
+
.routhead{display:flex;align-items:center;justify-content:space-between;gap:12px;max-width:880px}
|
|
4
|
+
.routhead h1{margin:0}
|
|
5
|
+
.routlist{margin-bottom:6px}
|
|
6
|
+
.routrow{grid-template-columns:32px minmax(0,1fr) auto}
|
|
7
|
+
.routwhen{font-size:13px;color:var(--ink-dim)}
|
|
8
|
+
.routbody{font-size:13px;color:var(--ink-faint);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;
|
|
9
|
+
overflow:hidden;white-space:pre-line}
|
|
10
|
+
.routadd{display:flex;align-items:center;gap:8px;padding:11px 16px;border:0;border-top:1px solid var(--line);
|
|
11
|
+
background:none;color:var(--accent);font:500 13px var(--sans);cursor:pointer;text-align:left;--ic:14px}
|
|
12
|
+
.routadd:hover{background:var(--accent-soft)}
|
|
13
|
+
|
|
14
|
+
.routform{display:flex;flex-direction:column;gap:16px}
|
|
15
|
+
.routform .sheettitle{margin-bottom:0}
|
|
16
|
+
.routfield{display:flex;flex-direction:column;gap:7px}
|
|
17
|
+
.routfield input[type=text]{width:100%;box-sizing:border-box}
|
|
18
|
+
.routtodo{min-height:160px;font:14px/1.55 var(--sans)}
|
|
19
|
+
.routwho,.routdays{display:flex;flex-wrap:wrap;gap:6px}
|
|
20
|
+
.routchip{padding:6px 12px;border:1px solid var(--border-strong);border-radius:999px;background:var(--bg-elev);
|
|
21
|
+
color:var(--ink);font:500 13px var(--sans);cursor:pointer;transition:background .12s var(--ease),border-color .12s var(--ease)}
|
|
22
|
+
.routchip:hover{border-color:var(--accent)}
|
|
23
|
+
.routchip.on{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
|
|
24
|
+
.routwhenpick{display:flex;flex-direction:column;gap:10px;align-items:flex-start}
|
|
25
|
+
.routwhenpick [hidden]{display:none}
|
|
26
|
+
.routsaid{color:var(--ink-dim);font-size:12.5px}
|
|
27
|
+
|
|
28
|
+
/* The sentence the routine will be, as it is typed. */
|
|
29
|
+
.routpreview{display:grid;grid-template-columns:32px minmax(0,1fr);gap:12px;padding:14px 16px;
|
|
30
|
+
border:1px solid var(--line);border-radius:var(--r-lg);background:var(--panel);box-shadow:var(--shadow-sm)}
|
|
31
|
+
.routpreview b{font:600 14px var(--sans);letter-spacing:-.01em}
|
|
32
|
+
.routpreview p{margin:6px 0 0;font-size:13.5px;line-height:1.55;color:var(--ink-dim);white-space:pre-wrap;
|
|
33
|
+
max-height:9em;overflow:hidden}
|
|
34
|
+
|
|
35
|
+
@media (max-width:640px){
|
|
36
|
+
.routrow{grid-template-columns:32px minmax(0,1fr)}
|
|
37
|
+
.routrow .connacts{grid-column:1 / -1;flex-wrap:wrap}
|
|
38
|
+
}
|
|
39
|
+
.routwhenpick select{width:auto}
|
|
40
|
+
.routhead + div > .connhead:first-child{margin-top:20px}
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
<link rel="stylesheet" href="/assets/css/runs.css">
|
|
22
22
|
<link rel="stylesheet" href="/assets/css/setup.css">
|
|
23
23
|
<link rel="stylesheet" href="/assets/css/connectors.css">
|
|
24
|
+
<link rel="stylesheet" href="/assets/css/routines.css">
|
|
24
25
|
</head>
|
|
25
26
|
<body>
|
|
26
27
|
<div class="app">
|
|
@@ -57,6 +58,9 @@
|
|
|
57
58
|
<button class="nav" id="staffnav" data-view="staff">
|
|
58
59
|
<span class="ic" data-icon="person"></span> Staff
|
|
59
60
|
</button>
|
|
61
|
+
<button class="nav" id="routinesnav" data-view="routines" title="When the staff wake up, and what they do then">
|
|
62
|
+
<span class="ic" data-icon="clock"></span> Routines
|
|
63
|
+
</button>
|
|
60
64
|
<button class="nav" id="connectorsnav" data-view="connectors" title="Outside services the staff can use">
|
|
61
65
|
<span class="ic" data-icon="plug"></span> Connectors
|
|
62
66
|
</button>
|
|
@@ -19,6 +19,7 @@ import { ORG_WIDE, S, VIEWS, applyHash, humanLabel, readHash, writeHash } from "
|
|
|
19
19
|
import { viewBrain } from "./views/brain.js";
|
|
20
20
|
import { viewChanged } from "./views/changed.js";
|
|
21
21
|
import { viewConnectors } from "./views/connectors.js";
|
|
22
|
+
import { viewRoutines } from "./views/routines.js";
|
|
22
23
|
import { viewDocs } from "./views/docs.js";
|
|
23
24
|
import { viewGraph } from "./views/graph.js";
|
|
24
25
|
import { viewHealth } from "./views/health.js";
|
|
@@ -41,6 +42,7 @@ const SCREEN = {
|
|
|
41
42
|
org: viewOrg,
|
|
42
43
|
staff: viewStaff,
|
|
43
44
|
connectors: viewConnectors,
|
|
45
|
+
routines: viewRoutines,
|
|
44
46
|
docs: viewDocs,
|
|
45
47
|
brain: viewBrain,
|
|
46
48
|
memory: viewBrain,
|
|
@@ -67,6 +69,7 @@ const NAV = [
|
|
|
67
69
|
["#inboxnav", "inbox"],
|
|
68
70
|
["#runsnav", "runs"],
|
|
69
71
|
["#staffnav", "staff"],
|
|
72
|
+
["#routinesnav", "routines"],
|
|
70
73
|
["#connectorsnav", "connectors"],
|
|
71
74
|
["#orgnav", "org"],
|
|
72
75
|
["#docsnav", "docs"],
|
|
@@ -111,7 +114,7 @@ export async function boot() {
|
|
|
111
114
|
/* Every one of these reads a tenant, so during setup they answer 409 and the sidebar is a
|
|
112
115
|
row of four dead ends beside an empty Staff heading. There is one thing to do on this
|
|
113
116
|
screen; the navigation comes back with the org. */
|
|
114
|
-
for (const el of document.querySelectorAll("#sidesearch, #homenav, #inboxnav, #runsnav, #orgnav, #staffnav, #connectorsnav, #docsnav, #refreshall, .sect, #stafflist")) {
|
|
117
|
+
for (const el of document.querySelectorAll("#sidesearch, #homenav, #inboxnav, #runsnav, #orgnav, #staffnav, #routinesnav, #connectorsnav, #docsnav, #refreshall, .sect, #stafflist")) {
|
|
115
118
|
el.hidden = true;
|
|
116
119
|
}
|
|
117
120
|
for (const slot of document.querySelectorAll("[data-icon]")) {
|
|
@@ -83,6 +83,8 @@ const PATHS = {
|
|
|
83
83
|
"<path d=\"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48\" />",
|
|
84
84
|
"person":
|
|
85
85
|
"<circle cx=\"12\" cy=\"8\" r=\"5\" /> <path d=\"M20 21a8 8 0 0 0-16 0\" />",
|
|
86
|
+
"clock":
|
|
87
|
+
"<circle cx=\"12\" cy=\"12\" r=\"10\" /> <path d=\"M12 6v6l4 2\" />",
|
|
86
88
|
"play":
|
|
87
89
|
"<path d=\"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z\" />",
|
|
88
90
|
// The pair for the lightbox's zoom controls. `dash` above is the other half.
|
|
@@ -489,6 +489,7 @@ function whatRun(r) {
|
|
|
489
489
|
const on = r.issue ? titleOn(r) : "";
|
|
490
490
|
if (r.trigger === "mention") return r.issue ? `Answering #${r.issue}${on}` : "Answering a message";
|
|
491
491
|
if (r.trigger === "peer") return r.issue ? `Helping a colleague with #${r.issue}${on}` : "Helping a colleague";
|
|
492
|
+
if (r.trigger === "routine") return r.routine ? `Running the ${r.routine} routine` : "Running a routine";
|
|
492
493
|
return (
|
|
493
494
|
{
|
|
494
495
|
daily: "Doing their daily work",
|