create-pmos 0.594.0 → 0.596.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/package.json +39 -27
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/changelog.json +38 -0
- package/workspace/fixtures/transcript-task-tools.jsonl +5 -0
- package/workspace/guide/notes.md +2 -2
- package/workspace/guide/scheduled-tasks-and-cli.md +3 -1
- package/workspace/guide/settings-and-switches.md +35 -3
- package/workspace/lib/calendar-events.js +5 -1
- package/workspace/lib/connector-directory.js +70 -0
- package/workspace/lib/goal-chat.js +1 -1
- package/workspace/lib/refresh-run.js +23 -9
- package/workspace/lib/refresh.js +64 -19
- package/workspace/lib/schedule-cli.js +2 -2
- package/workspace/lib/schedule-logic.js +8 -2
- package/workspace/lib/transcript-steps.js +66 -17
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/cozy-conndir.js +67 -0
- package/workspace/public/pm/cozy-ev.css +52 -0
- package/workspace/public/pm/cozy-evmodel.js +45 -6
- package/workspace/public/pm/cozy-schedwork.js +201 -0
- package/workspace/public/pm/cozy-settings.js +106 -17
- package/workspace/public/pm/cozy-vw-mtg.css +3 -0
- package/workspace/public/pm/premium-vw-doc.css +0 -3
- package/workspace/public/pm/small-vw.js +1 -0
- package/workspace/server.js +52 -0
- package/workspace/test-lists/connectors-directory.json +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.596.0",
|
|
4
4
|
"description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -33,6 +33,44 @@
|
|
|
33
33
|
"audit"
|
|
34
34
|
],
|
|
35
35
|
"pmosChanges": [
|
|
36
|
+
{
|
|
37
|
+
"v": "0.596.0",
|
|
38
|
+
"at": "2026-11-18T03:21:21.557Z",
|
|
39
|
+
"f": 4,
|
|
40
|
+
"prs": [
|
|
41
|
+
{
|
|
42
|
+
"n": 1333,
|
|
43
|
+
"t": "Settings › Connectors as a directory you can connect from",
|
|
44
|
+
"s": "Settings › Connectors as a directory you can connect from",
|
|
45
|
+
"k": "new"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"v": "0.595.0",
|
|
51
|
+
"at": "2026-11-18T02:36:22.728Z",
|
|
52
|
+
"f": 4,
|
|
53
|
+
"prs": [
|
|
54
|
+
{
|
|
55
|
+
"n": 1336,
|
|
56
|
+
"t": "Keep the meeting share popover's cozy fonts out of the console type check",
|
|
57
|
+
"s": "Keep the meeting share popover's cozy fonts out of the console type check",
|
|
58
|
+
"k": "fix"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"n": 1334,
|
|
62
|
+
"t": "Show a session's task list from TaskCreate/TaskUpdate",
|
|
63
|
+
"s": "Show a session's task list from TaskCreate/TaskUpdate",
|
|
64
|
+
"k": "fix"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"n": 1337,
|
|
68
|
+
"t": "Scheduled work shows how often and when next, and the PM sets it",
|
|
69
|
+
"s": "Scheduled work shows how often and when next, and the PM sets it",
|
|
70
|
+
"k": "new"
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
},
|
|
36
74
|
{
|
|
37
75
|
"v": "0.594.0",
|
|
38
76
|
"at": "2026-11-18T02:08:44.140Z",
|
|
@@ -272,32 +310,6 @@
|
|
|
272
310
|
"k": "new"
|
|
273
311
|
}
|
|
274
312
|
]
|
|
275
|
-
},
|
|
276
|
-
{
|
|
277
|
-
"v": "0.576.0",
|
|
278
|
-
"at": "2026-11-16T11:57:06.812Z",
|
|
279
|
-
"f": 4,
|
|
280
|
-
"prs": [
|
|
281
|
-
{
|
|
282
|
-
"n": 1308,
|
|
283
|
-
"t": "Close the nine ADLC agent-factory gaps",
|
|
284
|
-
"s": "Close the nine ADLC agent-factory gaps",
|
|
285
|
-
"k": "new"
|
|
286
|
-
}
|
|
287
|
-
]
|
|
288
|
-
},
|
|
289
|
-
{
|
|
290
|
-
"v": "0.575.0",
|
|
291
|
-
"at": "2026-11-16T11:43:16.900Z",
|
|
292
|
-
"f": 4,
|
|
293
|
-
"prs": [
|
|
294
|
-
{
|
|
295
|
-
"n": 1307,
|
|
296
|
-
"t": "A live meeting's agenda as 3 to 5 topics",
|
|
297
|
-
"s": "A live meeting's agenda as 3 to 5 topics",
|
|
298
|
-
"k": "new"
|
|
299
|
-
}
|
|
300
|
-
]
|
|
301
313
|
}
|
|
302
314
|
]
|
|
303
315
|
}
|
package/payload/KIT-VERSION
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Eval calibration log"
|
|
4
4
|
description: "Append-only record of every PM override of an evaluator verdict."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-11-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-18T03:21:17Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Health budgets"
|
|
4
4
|
description: "Closed registry of health-budget anchors (D59), edited only by the PM."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-11-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-18T03:21:17Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Discoveries and friction log"
|
|
4
4
|
description: "Append-only record of what runs discovered and where the process rubbed."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-11-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-18T03:21:17Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,42 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.596.0",
|
|
4
|
+
"at": "2026-11-18T03:21:21.557Z",
|
|
5
|
+
"f": 4,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1333,
|
|
9
|
+
"t": "Settings › Connectors as a directory you can connect from",
|
|
10
|
+
"s": "Settings › Connectors as a directory you can connect from",
|
|
11
|
+
"k": "new"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"v": "0.595.0",
|
|
17
|
+
"at": "2026-11-18T02:36:22.728Z",
|
|
18
|
+
"f": 4,
|
|
19
|
+
"prs": [
|
|
20
|
+
{
|
|
21
|
+
"n": 1336,
|
|
22
|
+
"t": "Keep the meeting share popover's cozy fonts out of the console type check",
|
|
23
|
+
"s": "Keep the meeting share popover's cozy fonts out of the console type check",
|
|
24
|
+
"k": "fix"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"n": 1334,
|
|
28
|
+
"t": "Show a session's task list from TaskCreate/TaskUpdate",
|
|
29
|
+
"s": "Show a session's task list from TaskCreate/TaskUpdate",
|
|
30
|
+
"k": "fix"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"n": 1337,
|
|
34
|
+
"t": "Scheduled work shows how often and when next, and the PM sets it",
|
|
35
|
+
"s": "Scheduled work shows how often and when next, and the PM sets it",
|
|
36
|
+
"k": "new"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
},
|
|
2
40
|
{
|
|
3
41
|
"v": "0.594.0",
|
|
4
42
|
"at": "2026-11-18T02:08:44.140Z",
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{"parentUuid":"redacted","isSidechain":false,"message":{"model":"redacted","id":"msg_redacted","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_01BbbihWtz7wBTGd7RJMKqcK","name":"TaskCreate","input":{"subject":"Read task tools in transcript-steps","description":"Sample task to capture transcript format","activeForm":"Reading task tools"},"caller":{"type":"direct"}}],"container":null,"stop_reason":"tool_use","stop_sequence":null,"stop_details":null,"input_transformations":[],"diagnostics":null,"context_management":null},"toolInputStreamMs":795,"wireToolInputs":{"toolu_01BbbihWtz7wBTGd7RJMKqcK":{"subject":"Read task tools in transcript-steps","description":"Sample task to capture transcript format","activeForm":"Reading task tools"}},"serverClassifierRequest":"d9033f24-83f8-4a76-b09d-7e249cbe86e5","apiBlockIndex":1,"requestId":"redacted","requestedModel":"redacted","promptCacheRequested":"1h","type":"assistant","uuid":"redacted","timestamp":"2026-11-18T01:34:36.493Z","advisorModel":"redacted","effort":"medium","perTurnEffort":"medium","madeBy":"model","userType":"external","entrypoint":"remote_projects","cwd":"redacted","sessionId":"redacted","version":"2.1.327","gitBranch":"redacted"}
|
|
2
|
+
{"parentUuid":"redacted","isSidechain":false,"promptId":"redacted","type":"user","message":{"role":"user","content":[{"tool_use_id":"toolu_01BbbihWtz7wBTGd7RJMKqcK","type":"tool_result","content":"Task #1 created successfully: Read task tools in transcript-steps"}]},"uuid":"redacted","timestamp":"2026-11-18T01:34:36.520Z","toolUseResult":{"task":{"id":"1","subject":"Read task tools in transcript-steps","description":"Sample task to capture transcript format"}},"sourceToolAssistantUUID":"cd69d7d8-babd-4368-aed7-d684da36c322","permissionDecision":{"decision":"accept","source":"config"},"userType":"external","entrypoint":"remote_projects","cwd":"redacted","sessionId":"redacted","version":"2.1.327","gitBranch":"redacted"}
|
|
3
|
+
{"parentUuid":"redacted","isSidechain":false,"message":{"model":"redacted","id":"msg_redacted","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_01GbD6GBFPq5HquRTySNf94c","name":"TaskUpdate","input":{"taskId":"1","status":"in_progress"},"caller":{"type":"direct"}}],"container":null,"stop_reason":"tool_use","stop_sequence":null,"stop_details":null,"input_transformations":[],"diagnostics":null,"context_management":null},"toolInputStreamMs":351,"wireToolInputs":{"toolu_01GbD6GBFPq5HquRTySNf94c":{"taskId":"1","status":"in_progress"}},"serverClassifierRequest":"5d9e04b1-b67c-49a5-bc34-82de33755a60","apiBlockIndex":0,"requestId":"redacted","requestedModel":"redacted","promptCacheRequested":"1h","type":"assistant","uuid":"redacted","timestamp":"2026-11-18T01:34:37.520Z","advisorModel":"redacted","effort":"medium","perTurnEffort":"medium","madeBy":"model","userType":"external","entrypoint":"remote_projects","cwd":"redacted","sessionId":"redacted","version":"2.1.327","gitBranch":"redacted"}
|
|
4
|
+
{"parentUuid":"redacted","isSidechain":false,"promptId":"redacted","type":"user","message":{"role":"user","content":[{"tool_use_id":"toolu_01GbD6GBFPq5HquRTySNf94c","type":"tool_result","content":"Updated task #1 status"}]},"uuid":"redacted","timestamp":"2026-11-18T01:34:37.550Z","toolUseResult":{"success":true,"taskId":"1","updatedFields":["status"],"statusChange":{"from":"pending","to":"in_progress"}},"sourceToolAssistantUUID":"6f18e661-8949-4b89-8fe8-1ea270973df2","permissionDecision":{"decision":"accept","source":"config"},"userType":"external","entrypoint":"remote_projects","cwd":"redacted","sessionId":"redacted","version":"2.1.327","gitBranch":"redacted"}
|
|
5
|
+
{"parentUuid":"redacted","isSidechain":false,"message":{"model":"redacted","id":"msg_redacted","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_redacted_bash","name":"Bash","input":{"command":"ls"},"caller":{"type":"direct"}}],"container":null,"stop_reason":"tool_use","stop_sequence":null,"stop_details":null,"input_transformations":[],"diagnostics":null,"context_management":null},"toolInputStreamMs":351,"wireToolInputs":{"toolu_01GbD6GBFPq5HquRTySNf94c":{"taskId":"1","status":"in_progress"}},"serverClassifierRequest":"5d9e04b1-b67c-49a5-bc34-82de33755a60","apiBlockIndex":0,"requestId":"redacted","requestedModel":"redacted","promptCacheRequested":"1h","type":"assistant","uuid":"redacted","timestamp":"2026-11-18T01:34:37.520Z","advisorModel":"redacted","effort":"medium","perTurnEffort":"medium","madeBy":"model","userType":"external","entrypoint":"remote_projects","cwd":"redacted","sessionId":"redacted","version":"2.1.327","gitBranch":"redacted"}
|
package/workspace/guide/notes.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Guide
|
|
3
3
|
title: "Notes: record a meeting, and present while it records"
|
|
4
4
|
description: "Record a meeting on this machine, the notes caught and checked, presenting while it records, and the Chrome extension over Google Meet."
|
|
5
|
-
timestamp: 2026-11-
|
|
5
|
+
timestamp: 2026-11-18
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Notes
|
|
@@ -395,7 +395,7 @@ To take notes for a calendar event, open the meeting from Your day or the calend
|
|
|
395
395
|
|
|
396
396
|
You can share a meeting note with people who do not use PMOS. They get a read-only page. Nothing is sent for you.
|
|
397
397
|
|
|
398
|
-
1. Open a meeting that has notes. Press the share icon, next to **⋯**.
|
|
398
|
+
1. Open a meeting that has notes. Press the share icon, next to **⋯**. A popover opens under it, in the same fonts and colours as the meeting page.
|
|
399
399
|
2. Under **What goes out**, PMOS turns on Summary, Decisions, Next steps and Questions. Facts mentioned and Since the last one stay off. Press a chip to change it. The transcript, the recording and the screen shots never go out.
|
|
400
400
|
3. The **✦** row tells you what PMOS kept back. Press it to see the list:
|
|
401
401
|
- **Stays inside**: your own to-dos and rules, and lines about a team or a person who was not in the meeting. Press the eye on a line to let it go out.
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
type: Guide
|
|
3
3
|
title: "Scheduled tasks"
|
|
4
4
|
description: "How scheduled tasks run a skill in a terminal session, and their limits."
|
|
5
|
-
timestamp: 2026-11-
|
|
5
|
+
timestamp: 2026-11-18
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Scheduled tasks
|
|
9
9
|
|
|
10
10
|
A scheduled task runs a skill at a set time. The workspace starts a terminal session in the repository and types the skill into it.
|
|
11
11
|
|
|
12
|
+
A task repeats every hour (at the minute of its time), every day, every week, every 2 weeks or every month, or runs once. Settings › Connectors › **Scheduled work** lists your tasks with their next run, and each task's page turns it on or off, changes how often it repeats and runs it now.
|
|
13
|
+
|
|
12
14
|
## Limits
|
|
13
15
|
|
|
14
16
|
A schedule fires only while the workspace server runs. If the server is stopped, the workspace skips the missed slot. It does not catch up later. A one-time task has a 15-minute grace window.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Guide
|
|
3
3
|
title: "Settings, switches and data freshness"
|
|
4
4
|
description: "What each section of Settings holds, every PMOS_ environment variable, and how the workspace keeps each source up to date."
|
|
5
|
-
timestamp: 2026-11-
|
|
5
|
+
timestamp: 2026-11-18
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Settings, switches and data freshness
|
|
@@ -13,7 +13,7 @@ Press the round menu button at the bottom of any page, then the **Settings** ico
|
|
|
13
13
|
|---|---|
|
|
14
14
|
| General | The theme (Light, Dark or Auto), whether the Viewer opens as a column or a popup, the products Home, the Board and Intelligence read, when Your day ends, the Your impact switch, and that agents write to Jira only after you press Commit. When a new PMOS is ready, a card here says so. Under **Extras**, **Adler ›** and **Jev and Laya ›** open their own settings (see below). |
|
|
15
15
|
| PMOS | **How PMOS decides** for each kind of change, the calls that are **Always yours**, and PMOS's **Lessons**. Then the Claude profile that new sessions start with, the Anthropic API key for PMOS's own runs, Sharpen prompts, and **Checks**: when PMOS grills an initiative by itself and the monthly credit for its checks. |
|
|
16
|
-
| Connectors | Every connector your Claude session has. A switch chooses only what PMOS reads on its own. PMOS reads and never posts. |
|
|
16
|
+
| Connectors | Every connector your Claude session has, and a directory of services you can connect. A switch chooses only what PMOS reads on its own. PMOS reads and never posts. |
|
|
17
17
|
| Workspaces | The repositories PMOS works in. Remove forgets the address only; the folder is not deleted. Add one by its folder path. The **Workflows ›** row opens the stages each kind of initiative goes through, inside Settings, which then takes the whole window. See [Workflows](statuses.md). |
|
|
18
18
|
| Updates | The version of the app and of each workspace's kit, the check for updates, and what changed. |
|
|
19
19
|
|
|
@@ -331,7 +331,39 @@ On Home, the Board and Intelligence, the sources list is in **Settings › Conne
|
|
|
331
331
|
- A row that is well shows its name and when PMOS last read it, for example **Initiatives** · 3 h ago. A source that is old shows ↻ too, while PMOS reads it again by itself. When a read found nothing new, the row says **Checked 10:42 · same since 09:15**.
|
|
332
332
|
- PMOS's background work that failed, and Git sync when it fails, are rows of the same list. A failed read of a source is the reason on that source's row.
|
|
333
333
|
|
|
334
|
-
|
|
334
|
+
### Scheduled work: how often and when next
|
|
335
|
+
|
|
336
|
+
A source that PMOS reads on a schedule says how often and when it reads next on its row, for example **Calendar** · Every 30 min in working hours · next 10:00. When PMOS missed a read, because PMOS was not running or the computer slept, the row is amber and says when, for example **Read yesterday 17:31 · missed 09:00**, with ↻ to read it now. A source on time has no colour.
|
|
337
|
+
|
|
338
|
+
Press › on a row to open its page:
|
|
339
|
+
|
|
340
|
+
| Row | What it does |
|
|
341
|
+
|---|---|
|
|
342
|
+
| Active | On or off. Off: PMOS does not read it on its own. |
|
|
343
|
+
| Next run | When PMOS reads it next. |
|
|
344
|
+
| Repeats | Only when you press read, every 15 min, 30 min, hour, 2 hours or 4 hours, every day, working days, or once a week. A day-based choice has **At** (and **On** for once a week). |
|
|
345
|
+
| Working hours only | For the every-N choices: read only inside your working hours. |
|
|
346
|
+
| History | The last five runs, with the result. |
|
|
347
|
+
| ▶ | Read it now. |
|
|
348
|
+
|
|
349
|
+
On a day with 3 or more meetings, PMOS proposes ✦ **Read it more often on meeting days**: Calendar every 15 min on such days, other days as set. Nothing changes until you press ✓. **Undo** puts the old rhythm back, and ✕ hides the proposal for today.
|
|
350
|
+
|
|
351
|
+
The **Scheduled work** row under the sources lists everything that runs on a schedule: what PMOS reads, PMOS's own jobs (the day check, the initiative driver, signals) and your own scheduled tasks, each with its next run. Your own tasks can repeat every hour, every day, every week, every 2 weeks or every month.
|
|
352
|
+
|
|
353
|
+
When all is well, there is no other line. ↻ in the Connectors header is **Refresh all**. The (i) button says what PMOS reads and that it never posts. Under the list is the connectors directory:
|
|
354
|
+
|
|
355
|
+
- **Search** and the category chips (Mail and calendar, Chat, Tickets, Code, Docs and files, Design, Analytics) filter the directory.
|
|
356
|
+
- **Connected · N** lists every connector your Claude session has, each with its switch. A connector that backs a Briefing source (for example Gmail for Mail) has that source's switch. ⌄ folds the group.
|
|
357
|
+
- **More sources** lists the Briefing sources that no connector backs yet, with their switches.
|
|
358
|
+
- **For you** shows at most 3 services that PMOS suggests: services your initiatives link, then services that go with what you already use.
|
|
359
|
+
- **All connectors** lists the other services.
|
|
360
|
+
|
|
361
|
+
PMOS cannot add a connector, because it keeps no passwords or keys. To connect a service:
|
|
362
|
+
|
|
363
|
+
1. Press **+** on its row. Your Claude account's connector page (claude.ai/settings/connectors) opens in a new tab, and the row says **Waiting for** the service.
|
|
364
|
+
2. Add the connector there and sign in.
|
|
365
|
+
3. PMOS checks every 5 seconds for 2 minutes. When it sees the connector, it says so. If it does not see it in that time, the connector shows when your next session starts.
|
|
366
|
+
4. When a new connector appears, a ✦ card says what PMOS proposes to read from it. Nothing reads it until you press ✓. ✕ means not now. When a source needs you, the Connectors tab has an amber dot, an amber box at the top of the other Settings sections names it, and the place menu opens Settings at Connectors. PMOS repairs the other problems by itself, so you do not see a box for them (see below).
|
|
335
367
|
|
|
336
368
|
### When a source cannot be read: PMOS repairs it first
|
|
337
369
|
|
|
@@ -119,4 +119,8 @@ const eventsOn = (events, day) => listOf(events).filter((e) => e.date === day);
|
|
|
119
119
|
/** Today's meetings (the Record menu): eventsOn the local day of `now`. */
|
|
120
120
|
const todayOf = (events, now = Date.now()) => eventsOn(events, localDate(now));
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
/** How many meetings the local day of `dayMs` has: timed events shorter than 12 hours (an all-day event is not a meeting). The meeting-day
|
|
123
|
+
* rhythm of Settings › Connectors reads it (lib/refresh.js `busy`, batch 31 item 2). Pure. */
|
|
124
|
+
const meetingsOn = (events, dayMs) => eventsOn(events, localDate(dayMs)).filter((e) => e.minutes > 0 && e.minutes < 720).length;
|
|
125
|
+
|
|
126
|
+
module.exports = { readAll, oneEach, asEvent, localIso, todayOf, eventsOn, listOf, menuShape, meetingsOn };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* connector-directory.js — what Settings › Connectors needs from the server to be a directory (initiative connectors-directory;
|
|
3
|
+
* canvas CnA, CnB). Pure, except notice(), which takes its file reads and writes as arguments so the tests drive it.
|
|
4
|
+
*
|
|
5
|
+
* CONNECT_URL the connector page of the Claude account. PMOS never connects a service itself: it holds no
|
|
6
|
+
* key and no token. The + on a row opens this page; the PM adds the connector there.
|
|
7
|
+
* signalsOf(texts) → [catalog ids] the PM's initiative records point at (a github.com link → 'github'), for ✦ For you
|
|
8
|
+
* notice(prev, names, now) → { state, fresh } which connector names are new since the last read. The first read only
|
|
9
|
+
* remembers what is there (no flood of proposals). A new name becomes one pending proposal.
|
|
10
|
+
* decide(state, name, verdict) → { state, found } ✓ or Not now takes the proposal away; nothing else changes it
|
|
11
|
+
* proposalFor(name, source) → { name, label, source, reads, patch } what ✦ proposes for a new connector: the brief source
|
|
12
|
+
* it backs, else its own switch. The patch is what ✓ saves; until ✓ nothing reads it.
|
|
13
|
+
* probeNames(sources) → the connected names `claude mcp list` reported (lib/project-onboard.js parseMcpList)
|
|
14
|
+
*/
|
|
15
|
+
const { connectorLabel } = require('./proactive.js');
|
|
16
|
+
|
|
17
|
+
const CONNECT_URL = 'https://claude.ai/settings/connectors';
|
|
18
|
+
const MAX_PENDING = 20, MAX_SEEN = 200, MAX_TEXT = 65536;
|
|
19
|
+
|
|
20
|
+
// A link in an initiative record → the catalog id the directory knows it by (pm/cozy-conndir.js CATALOG).
|
|
21
|
+
const SIGNAL_DOMAINS = [
|
|
22
|
+
[/github\.com\//i, 'github'], [/\.atlassian\.net\/(browse|jira)/i, 'jira'], [/\.atlassian\.net\/wiki/i, 'confluence'],
|
|
23
|
+
[/notion\.(so|site)\//i, 'notion'], [/figma\.com\//i, 'figma'], [/linear\.app\//i, 'linear'], [/docs\.google\.com\/|drive\.google\.com\//i, 'gdrive'],
|
|
24
|
+
[/calendar\.google\.com\//i, 'gcal'], [/slack\.com\/(archives|app)/i, 'slack'], [/miro\.com\//i, 'miro'],
|
|
25
|
+
[/asana\.com\//i, 'asana'], [/intercom\.com\//i, 'intercom'],
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
function signalsOf(texts) {
|
|
29
|
+
const hits = new Map();
|
|
30
|
+
for (const t of Array.isArray(texts) ? texts : []) {
|
|
31
|
+
const s = String(t || '').slice(0, MAX_TEXT);
|
|
32
|
+
for (const [re, id] of SIGNAL_DOMAINS) if (re.test(s)) hits.set(id, (hits.get(id) || 0) + 1);
|
|
33
|
+
}
|
|
34
|
+
return [...hits.entries()].sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0])).map(([id, n]) => ({ id, n }));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const cleanState = (s) => ({
|
|
38
|
+
seen: Array.isArray(s && s.seen) ? s.seen.filter((x) => typeof x === 'string').slice(0, MAX_SEEN) : null,
|
|
39
|
+
pending: Array.isArray(s && s.pending) ? s.pending.filter((x) => x && typeof x.name === 'string').slice(0, MAX_PENDING) : [],
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
function notice(prev, names, now = Date.now()) {
|
|
43
|
+
const st = cleanState(prev);
|
|
44
|
+
const list = [...new Set((Array.isArray(names) ? names : []).filter((x) => typeof x === 'string' && x))];
|
|
45
|
+
if (st.seen === null) return { state: { seen: list.slice(0, MAX_SEEN), pending: [] }, fresh: [] }; // the first read remembers only
|
|
46
|
+
const seen = new Set(st.seen);
|
|
47
|
+
const fresh = list.filter((n) => !seen.has(n));
|
|
48
|
+
const pending = [...st.pending.filter((p) => list.includes(p.name)), ...fresh.map((name) => ({ name, at: new Date(now).toISOString() }))].slice(-MAX_PENDING);
|
|
49
|
+
return { state: { seen: [...new Set([...st.seen, ...list])].slice(-MAX_SEEN), pending }, fresh };
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function decide(prev, name, verdict) {
|
|
53
|
+
const st = cleanState(prev);
|
|
54
|
+
if (verdict !== 'approve' && verdict !== 'dismiss') return { state: st, found: false };
|
|
55
|
+
const found = st.pending.some((p) => p.name === name);
|
|
56
|
+
return { state: { seen: st.seen || [], pending: st.pending.filter((p) => p.name !== name) }, found };
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const SOURCE_READS = { calendar: 'your meetings for the Briefing', mail: 'mail that needs you for the Briefing', slack: 'threads that mention you for the Briefing',
|
|
60
|
+
jira: 'the tasks of your initiatives for the Briefing and the Board', confluence: 'pages your initiatives link', github: 'pull requests and checks for the Briefing',
|
|
61
|
+
drive: 'documents your initiatives link', figma: 'design comments your initiatives link', wispr: 'meeting notes for the Briefing' };
|
|
62
|
+
function proposalFor(name, source) {
|
|
63
|
+
const label = connectorLabel(name) || name;
|
|
64
|
+
if (source && SOURCE_READS[source]) return { name, label, source, reads: 'read ' + SOURCE_READS[source], patch: { briefSources: { [source]: true } } };
|
|
65
|
+
return { name, label, source: null, reads: 'keep it on, so a reader can use it when one comes', patch: { connectors: { [name]: true } } };
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const probeNames = (sources) => (Array.isArray(sources) ? sources : []).filter((s) => s && s.status === 'connected' && s.id).map((s) => String(s.id));
|
|
69
|
+
|
|
70
|
+
module.exports = { CONNECT_URL, SIGNAL_DOMAINS, signalsOf, notice, decide, proposalFor, probeNames, MAX_PENDING };
|
|
@@ -72,7 +72,7 @@ function startMessage(draft) {
|
|
|
72
72
|
JSON.stringify(draft),
|
|
73
73
|
'Do whatever the goal needs, as the PM would. Do not stop to ask for approval, feedback or a choice: pick the sensible option yourself, say in one line what you chose, and go on. Merging follows the PM\'s standing rule (merge once required CI is green).',
|
|
74
74
|
'Stop for the PM only when the work cannot go on without them: a sign-in or secret only they have, or a message that goes to other people. Then do every other open point first, and end with needs-you and exactly what you need.',
|
|
75
|
-
'Keep your to-do list (TodoWrite) as the done points, word for word, one item each. Mark the one you work on in_progress, and mark it completed the moment it is met, so the PM sees each point tick as you go.',
|
|
75
|
+
'Keep your to-do list (TodoWrite, or TaskCreate and TaskUpdate) as the done points, word for word, one item each. Mark the one you work on in_progress, and mark it completed the moment it is met, so the PM sees each point tick as you go.',
|
|
76
76
|
'At the end of each message about this goal, add a fenced pmos-goal block: {"step":"progress","state":"working|done|needs-you","met":["done points met"],"open":["done points still open"]}. Copy each done point word for word. Report done only after you checked every point.',
|
|
77
77
|
// batch 22 item 13 (Wawan, 2026-11-01): "6 of 6 met" while the report the goal asked for was only proposed
|
|
78
78
|
'A done point that names a thing to make (a report, slides, a deck, a document) is met only when that thing exists where the PM reads it, opened and checked by you. A proposal, a plan or a draft waiting for a PM press does not meet it: that point stays open, and you end with needs-you and the one press.',
|
|
@@ -91,6 +91,17 @@ function create(host) {
|
|
|
91
91
|
}
|
|
92
92
|
const win = () => { const d = (host.proactive() || {}).dayCheck || {}; return { start: d.start || '08:00', end: d.end || '18:00' }; };
|
|
93
93
|
const quiet = () => { const q = (host.proactive() || {}).quiet; return q && q.start && q.end ? q : null; };
|
|
94
|
+
// batch 31 item 2: how many meetings a day has (the meeting-day rhythm of a schedule with `busy`); none when the host cannot say
|
|
95
|
+
// The calendar files of the state dir (lib/calendar-events.js) are read at most once a minute; a host may answer instead (tests).
|
|
96
|
+
let calAt = 0, calEvents = [];
|
|
97
|
+
const busyDay = (dayMs) => {
|
|
98
|
+
try {
|
|
99
|
+
if (host.busyDay) return Number(host.busyDay(dayMs)) || 0;
|
|
100
|
+
const CE = require('./calendar-events.js'), t = now();
|
|
101
|
+
if (Math.abs(t - calAt) > 60000) { calAt = t; try { calEvents = CE.readAll(dir, { now: t }); } catch { calEvents = []; } }
|
|
102
|
+
return CE.meetingsOn(calEvents, dayMs);
|
|
103
|
+
} catch { return 0; }
|
|
104
|
+
};
|
|
94
105
|
const log = () => R.foldLog(R.readLog(dir));
|
|
95
106
|
/* self-heal (feedback batch 26 item 7): one repair record per skill source that reads a tool, in <state>/source-heal.json */
|
|
96
107
|
const healFile = () => path.join(dir, H.FILE);
|
|
@@ -109,7 +120,7 @@ function create(host) {
|
|
|
109
120
|
if (st.waiting_since || st.pending) return 'waiting';
|
|
110
121
|
const src = R.BY_ID.get(id);
|
|
111
122
|
if (src && src.run === 'skill') {
|
|
112
|
-
const slot = R.lastSlot(x.s, t, win());
|
|
123
|
+
const slot = R.lastSlot(x.s, t, win(), busyDay);
|
|
113
124
|
if (slot != null && (st.last_slot == null || slot > st.last_slot) && t - slot < 2 * 3600 * 1000) return 'due';
|
|
114
125
|
}
|
|
115
126
|
return 'ok';
|
|
@@ -297,7 +308,7 @@ function create(host) {
|
|
|
297
308
|
for (const src of R.SOURCES.filter((x) => x.run === 'skill')) {
|
|
298
309
|
const cur = R.readState(dir);
|
|
299
310
|
const st = { ...(cur[src.id] || {}), running: running(cur[src.id]) };
|
|
300
|
-
const d = R.decide(src, st, { now: t, settings: set, rules, win: win(), quiet: quiet(), runningCount: runningCount(cur), inputState: inputStateFn(set, cur, t), first });
|
|
311
|
+
const d = R.decide(src, st, { now: t, settings: set, rules, win: win(), busyDay, quiet: quiet(), runningCount: runningCount(cur), inputState: inputStateFn(set, cur, t), first });
|
|
301
312
|
if (d.act === 'none') continue;
|
|
302
313
|
const ws = (set.sources[src.id] && set.sources[src.id].ws) || (st.pending && st.pending.ws) || host.homeWs();
|
|
303
314
|
if (d.act === 'skip') {
|
|
@@ -372,7 +383,7 @@ function create(host) {
|
|
|
372
383
|
const due = [];
|
|
373
384
|
for (const src of R.SOURCES.filter((x) => x.run === 'skill' && x.group === 'tools')) {
|
|
374
385
|
const st = { ...(cur[src.id] || {}), running: running(cur[src.id]) };
|
|
375
|
-
const d = R.decide(src, st, { now: t, settings: set, rules, win: win(), quiet: quiet(), runningCount: runningCount(cur), inputState: inputStateFn(set, cur, t), first });
|
|
386
|
+
const d = R.decide(src, st, { now: t, settings: set, rules, win: win(), busyDay, quiet: quiet(), runningCount: runningCount(cur), inputState: inputStateFn(set, cur, t), first });
|
|
376
387
|
if (d.act === 'start' && AUTO.has(d.trigger) && !d.pressed) due.push({ src, d, ws: (set.sources[src.id] && set.sources[src.id].ws) || host.homeWs() });
|
|
377
388
|
}
|
|
378
389
|
const byWs = new Map();
|
|
@@ -491,8 +502,8 @@ function create(host) {
|
|
|
491
502
|
if (id === 'repo' && typeof patch.on === 'boolean') { try { host.setRepoWatch(patch.on); } catch (e) { warn('repository watch', e); } }
|
|
492
503
|
R.writeSettings(dir, set);
|
|
493
504
|
// A schedule change starts the clock from now: a slot that passed before the change is not run late.
|
|
494
|
-
if (norm && id !== 'daycheck') { const st = R.readState(dir); const sl = R.lastSlot(norm.s, now(), win()); st[id] = { ...(st[id] || {}), last_slot: sl, retry_at: null }; R.writeState(dir, st); }
|
|
495
|
-
if (patch.on === true && src.run === 'skill') { const st = R.readState(dir); const sl = R.lastSlot(cur.s, now(), win()); st[id] = { ...(st[id] || {}), last_slot: sl }; R.writeState(dir, st); }
|
|
505
|
+
if (norm && id !== 'daycheck') { const st = R.readState(dir); const sl = R.lastSlot(norm.s, now(), win(), busyDay); st[id] = { ...(st[id] || {}), last_slot: sl, retry_at: null }; R.writeState(dir, st); }
|
|
506
|
+
if (patch.on === true && src.run === 'skill') { const st = R.readState(dir); const sl = R.lastSlot(cur.s, now(), win(), busyDay); st[id] = { ...(st[id] || {}), last_slot: sl }; R.writeState(dir, st); }
|
|
496
507
|
return { ok: true, source: id };
|
|
497
508
|
}
|
|
498
509
|
function setRules(patch) {
|
|
@@ -508,7 +519,7 @@ function create(host) {
|
|
|
508
519
|
if (id === 'brief' && set.sources.tools && !set.sources.tools.on) { set.sources.tools.on = true; if (ws && !set.sources.tools.ws) set.sources.tools.ws = ws; }
|
|
509
520
|
set.migrated = true;
|
|
510
521
|
R.writeSettings(dir, set);
|
|
511
|
-
if (!was) { const st = R.readState(dir); st[id] = { ...(st[id] || {}), last_slot: R.lastSlot(cur.s, now(), win()) }; R.writeState(dir, st); }
|
|
522
|
+
if (!was) { const st = R.readState(dir); st[id] = { ...(st[id] || {}), last_slot: R.lastSlot(cur.s, now(), win(), busyDay) }; R.writeState(dir, st); }
|
|
512
523
|
return !was;
|
|
513
524
|
}
|
|
514
525
|
|
|
@@ -587,7 +598,7 @@ function create(host) {
|
|
|
587
598
|
for (const [k, v] of Object.entries(state)) view[k] = { ...v, running: running(v) };
|
|
588
599
|
let fr = []; try { fr = host.freshRows(ws) || []; } catch { fr = []; }
|
|
589
600
|
const fresh = new Map(fr.filter((x) => FRESH_OF[x.id]).map((x) => [x.id, x]));
|
|
590
|
-
return R.rowsOf({ now: t, settings: set, state: view, log: log(), fresh, win: win(), quiet: quiet(), jobSchedule: host.jobSchedule || null, ws });
|
|
601
|
+
return R.rowsOf({ now: t, settings: set, state: view, log: log(), fresh, win: win(), busyDay, quiet: quiet(), jobSchedule: host.jobSchedule || null, ws });
|
|
591
602
|
}
|
|
592
603
|
function rows(ws) { const set = settings(); return { rules: set.rules, quiet: quiet(), window: win(), rows: rowsFor(ws, set, now()) }; }
|
|
593
604
|
/** What lib/freshness.js shows as a skill's schedule, now that the schedule lives here. */
|
|
@@ -595,8 +606,11 @@ function create(host) {
|
|
|
595
606
|
const id = R.SKILL_OF.get(skill); if (!id) return null;
|
|
596
607
|
const set = settings(); const x = set.sources[id]; const st = R.readState(dir)[id] || {};
|
|
597
608
|
const l = log().lastRun(id);
|
|
598
|
-
const next = x.on ? R.nextSlot(x.s, now(), win()) : null;
|
|
599
|
-
|
|
609
|
+
const next = x.on ? R.nextSlot(x.s, now(), win(), busyDay) : null;
|
|
610
|
+
const missed = x.on ? R.missedSlot(x.s, now(), win(), { lastStart: l && l.start_at ? Date.parse(l.start_at) : NaN, running: running(st) || !!st.pending || !!st.waiting_since, busyDay,
|
|
611
|
+
handled: st.last_slot, skipped: (slot) => log().runs(id, 5).some((y) => y.result === 'skipped' && Date.parse(y.start_at) >= slot) }) : null;
|
|
612
|
+
// batch 31 item 2: `refresh` names the Settings › Connectors item page; `missed_at` turns the row line amber and shows ↻
|
|
613
|
+
return { refresh: id, cadence: x.on ? R.textOf(x.s) : 'off', time: null, day: null, next_run: next ? new Date(next).toISOString() : null, missed_at: missed ? new Date(missed).toISOString() : null,
|
|
600
614
|
last_run: l ? l.start_at : null, last_status: l ? (l.result === 'failed' ? 'fail' : l.result === 'done' ? 'ok' : 'started') : st.last_result || null,
|
|
601
615
|
checked_at: st.seen && st.seen.at ? new Date(st.seen.at).toISOString() : null,
|
|
602
616
|
same_since: st.seen && st.seen.since && st.seen.at > st.seen.since ? new Date(st.seen.since).toISOString() : null };
|