ai-first-os 1.10.0 → 2.0.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/README.md +33 -31
- package/core/CLAUDE.md +48 -12
- package/core/VERSION +1 -1
- package/core/install.sh +173 -52
- package/core/lib/bootstrap.sh +41 -26
- package/core/lib/build-indexes.sh +283 -0
- package/core/lib/capture.sh +126 -55
- package/core/lib/check-resolvable.sh +13 -2
- package/core/lib/close-session.sh +172 -119
- package/core/lib/common.sh +505 -92
- package/core/lib/focus-read.sh +94 -58
- package/core/lib/manual-link.sh +10 -8
- package/core/lib/markdown.py +2 -2
- package/core/lib/migrate-layout.sh +92 -0
- package/core/lib/migrate-root.sh +497 -0
- package/core/lib/migrate_layout.py +2000 -0
- package/core/lib/new-memory.sh +33 -44
- package/core/lib/new-product.sh +11 -13
- package/core/lib/new-workspace.sh +18 -9
- package/core/lib/orchestrator-init.sh +80 -0
- package/core/lib/pack-install.sh +44 -30
- package/core/lib/recall.sh +1 -1
- package/core/lib/recall_index.py +48 -6
- package/core/lib/remote-backup.sh +30 -20
- package/core/lib/rename-heads.sh +8 -8
- package/core/lib/rename-workspaces.sh +3 -3
- package/core/lib/session-read.sh +133 -73
- package/core/lib/session-start.sh +238 -221
- package/core/lib/supersede.sh +199 -3
- package/core/lib/sweep.sh +5 -0
- package/core/manual/COMO-FUNCIONA.md +169 -58
- package/core/manual/HOW-IT-WORKS.md +158 -57
- package/core/resolver.md +4 -2
- package/core/skills/bootstrap.md +63 -44
- package/core/skills/capture.md +15 -8
- package/core/skills/check-resolvable.md +1 -1
- package/core/skills/close-session.md +9 -5
- package/core/skills/grill.md +3 -3
- package/core/skills/migrate-layout.md +48 -0
- package/core/skills/migrate-root.md +64 -0
- package/core/skills/mount-repo.md +6 -6
- package/core/skills/new-memory.md +20 -18
- package/core/skills/new-product.md +4 -3
- package/core/skills/new-spec.md +6 -0
- package/core/skills/new-workspace.md +7 -5
- package/core/skills/orchestrator.md +101 -0
- package/core/skills/supersede.md +14 -0
- package/core/templates/node-repo/context/open-questions.md +3 -0
- package/core/templates/strings.md +396 -271
- package/core/templates/tree.md +22 -27
- package/package.json +1 -1
- package/core/lib/my-wiki-gates.sh +0 -137
- package/core/lib/my-wiki.sh +0 -202
- package/core/lib/my_wiki_build.py +0 -548
- package/core/lib/my_wiki_graph.py +0 -137
- package/core/lib/my_wiki_overview.py +0 -392
- package/core/skills/my-wiki.md +0 -103
- package/core/templates/my-wiki-graph.js +0 -431
- package/core/templates/my-wiki-overview.js +0 -174
- package/core/templates/my-wiki.html +0 -1017
|
@@ -1,392 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Overview: what is waiting for the person, as My Wiki's first screen (spec 062).
|
|
3
|
-
|
|
4
|
-
Internal. `my_wiki_build.py` imports it and hands it what it already read; this file opens two
|
|
5
|
-
things nobody else in the product opens — the Claude Code session logs and nothing more — and
|
|
6
|
-
returns one dictionary. It never writes: not to the brain, not to a session (C7).
|
|
7
|
-
|
|
8
|
-
WHAT A SESSION IS, AND WHAT IT IS NOT. Claude Code keeps one `.jsonl` per session under
|
|
9
|
-
`~/.claude/projects/<the brain's path, punctuation turned into dashes>/`. Every line is one record.
|
|
10
|
-
The records this file uses are four, and it ignores the rest:
|
|
11
|
-
|
|
12
|
-
`user` / `assistant` a turn, with `message.content` and `timestamp`
|
|
13
|
-
`ai-title` the title the app gave the session
|
|
14
|
-
`custom-title` the title the person gave it, which wins over the other one
|
|
15
|
-
|
|
16
|
-
THE FILE'S OWN mtime IS NOT ITS AGE. A backup or a sync touches every log at once; measured over a
|
|
17
|
-
real brain, most files carried an mtime days newer than their last record. The age of a session is
|
|
18
|
-
the timestamp of its last turn, and only that.
|
|
19
|
-
|
|
20
|
-
THERE IS NO RECORD OF THE PERSON HAVING READ A SESSION. It was looked for, in the logs, in their
|
|
21
|
-
sidecar files and in the app's own state, and it does not exist (spec 062, design-first). So an
|
|
22
|
-
answered turn and a read turn cannot be told apart, and this file does not pretend otherwise: a
|
|
23
|
-
session whose last turn is the agent's and does not ask anything comes out as `finished · unread`
|
|
24
|
-
WITH `unreadByDefault` set, and the page says on the screen that it is showing it for lack of the
|
|
25
|
-
datum, never as a fact about what the person read.
|
|
26
|
-
"""
|
|
27
|
-
|
|
28
|
-
import datetime
|
|
29
|
-
import json
|
|
30
|
-
import os
|
|
31
|
-
import re
|
|
32
|
-
|
|
33
|
-
# The delimiters of a pending question. A turn that ends in one is asking; the closing markdown a
|
|
34
|
-
# sentence may drag behind it (a bold marker, a quote, a bracket) is not part of the sentence.
|
|
35
|
-
TRAILING = " \t\r\n*`_\"')]}»”"
|
|
36
|
-
# A question that is asking for the approval of a spec is a Gate 1, not a question like any other:
|
|
37
|
-
# it is the one the supervision pattern of `CLAUDE.md` names, and it reads differently on the page.
|
|
38
|
-
GATE1_HINT = re.compile(r"\bgate ?-?1\b", re.IGNORECASE)
|
|
39
|
-
# What the session's first message writes to name the scope it works on, in both languages.
|
|
40
|
-
FOCUS_LEAD = re.compile(r"\b(?:foco|focus)\b[: ]+([^\n,.;]{2,60})", re.IGNORECASE)
|
|
41
|
-
WORD = re.compile(r"[a-z0-9][a-z0-9-]{2,}")
|
|
42
|
-
# A turn the harness injected rather than the person typing it: a command's output, a task
|
|
43
|
-
# notification, a system reminder. It is not the person answering, and it never opens a session.
|
|
44
|
-
INJECTED = ("<", "[Request interrupted", "Caveat:")
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
def _text(message):
|
|
48
|
-
content = (message or {}).get("content")
|
|
49
|
-
if isinstance(content, str):
|
|
50
|
-
return content
|
|
51
|
-
if isinstance(content, list):
|
|
52
|
-
return "".join(b.get("text", "") for b in content
|
|
53
|
-
if isinstance(b, dict) and b.get("type") == "text")
|
|
54
|
-
return ""
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
def _stamp(value):
|
|
58
|
-
if not value:
|
|
59
|
-
return None
|
|
60
|
-
try:
|
|
61
|
-
return datetime.datetime.fromisoformat(str(value).replace("Z", "+00:00"))
|
|
62
|
-
except ValueError:
|
|
63
|
-
return None
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
def _age(now, when):
|
|
67
|
-
"""How long ago, as a number and the unit it is counted in. The page puts the word on it."""
|
|
68
|
-
minutes = int(max(0, (now - when).total_seconds()) // 60)
|
|
69
|
-
if minutes < 60:
|
|
70
|
-
return {"n": minutes, "unit": "min"}
|
|
71
|
-
if minutes < 60 * 24:
|
|
72
|
-
return {"n": minutes // 60, "unit": "h"}
|
|
73
|
-
return {"n": minutes // (60 * 24), "unit": "d"}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
def _tail(text, cap=220):
|
|
77
|
-
"""The last sentence of a turn: what the agent is actually asking, never the whole answer."""
|
|
78
|
-
clean = " ".join(text.strip().split())
|
|
79
|
-
if len(clean) <= cap:
|
|
80
|
-
return clean
|
|
81
|
-
cut = clean[-cap:]
|
|
82
|
-
for sep in (". ", "? ", "! ", "— ", "· "):
|
|
83
|
-
i = cut.find(sep)
|
|
84
|
-
if 0 <= i < cap - 40:
|
|
85
|
-
return cut[i + len(sep):]
|
|
86
|
-
return "…" + cut
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
# ------------------------------------------------------------------ one session, read once
|
|
90
|
-
def read_session(path):
|
|
91
|
-
"""The four things a session says: its title, its first message, its last turn of each side.
|
|
92
|
-
|
|
93
|
-
The file is opened once, read forward and never written. A line that is not JSON is skipped:
|
|
94
|
-
a log the app is writing right now can end mid-line, and that is not a failure of this page.
|
|
95
|
-
"""
|
|
96
|
-
title = ""
|
|
97
|
-
first = ""
|
|
98
|
-
last_user = None
|
|
99
|
-
last_agent = None
|
|
100
|
-
try:
|
|
101
|
-
with open(path, "r", encoding="utf-8", errors="replace") as f:
|
|
102
|
-
for line in f:
|
|
103
|
-
line = line.strip()
|
|
104
|
-
if not line.startswith("{"):
|
|
105
|
-
continue
|
|
106
|
-
try:
|
|
107
|
-
rec = json.loads(line)
|
|
108
|
-
except ValueError:
|
|
109
|
-
continue
|
|
110
|
-
kind = rec.get("type")
|
|
111
|
-
if kind == "ai-title" and not title:
|
|
112
|
-
title = rec.get("aiTitle") or ""
|
|
113
|
-
continue
|
|
114
|
-
if kind == "custom-title":
|
|
115
|
-
title = rec.get("customTitle") or rec.get("title") or title
|
|
116
|
-
continue
|
|
117
|
-
if kind not in ("user", "assistant") or rec.get("isSidechain"):
|
|
118
|
-
continue
|
|
119
|
-
body = _text(rec.get("message")).strip()
|
|
120
|
-
if not body:
|
|
121
|
-
continue
|
|
122
|
-
when = _stamp(rec.get("timestamp"))
|
|
123
|
-
if kind == "user":
|
|
124
|
-
if rec.get("isMeta") or body.startswith(INJECTED):
|
|
125
|
-
continue
|
|
126
|
-
if not first:
|
|
127
|
-
first = body
|
|
128
|
-
if when:
|
|
129
|
-
last_user = when
|
|
130
|
-
elif when:
|
|
131
|
-
last_agent = (when, body)
|
|
132
|
-
except OSError:
|
|
133
|
-
return None
|
|
134
|
-
if last_agent is None and not first:
|
|
135
|
-
return None
|
|
136
|
-
return {"title": title, "first": first, "user": last_user, "agent": last_agent}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
# ------------------------------------------------------------------ the focus of a session (C3)
|
|
140
|
-
class Focus(object):
|
|
141
|
-
"""What the first message of a session names, resolved against the pages of the brain.
|
|
142
|
-
|
|
143
|
-
The rule is the startup's: the first message names the scope, and inside it the node. A message
|
|
144
|
-
that names a path the wiki has a page for wins; with no path, a slug of a node —the folder that
|
|
145
|
-
gives the node its identity— names it. Neither, and the session is grouped under *no focus*:
|
|
146
|
-
visible, never guessed.
|
|
147
|
-
"""
|
|
148
|
-
|
|
149
|
-
def __init__(self, pages, wsdir, head_file):
|
|
150
|
-
self.by_path = pages
|
|
151
|
-
self.by_slug = {}
|
|
152
|
-
for path, page in pages.items():
|
|
153
|
-
if page["kind"] not in ("entity", "initiative", "workspace"):
|
|
154
|
-
continue
|
|
155
|
-
base = os.path.basename(path)
|
|
156
|
-
slug = os.path.basename(os.path.dirname(path)) if base == head_file \
|
|
157
|
-
else os.path.splitext(base)[0]
|
|
158
|
-
slug = slug.lower()
|
|
159
|
-
# An entity loses to an initiative of the same name on purpose: the initiative is the
|
|
160
|
-
# stretch of work being done, and that is what a session is opened on.
|
|
161
|
-
if slug not in self.by_slug or page["kind"] == "initiative":
|
|
162
|
-
self.by_slug[slug] = path
|
|
163
|
-
|
|
164
|
-
def of(self, message):
|
|
165
|
-
if not message:
|
|
166
|
-
return ""
|
|
167
|
-
head = message[:600]
|
|
168
|
-
for path in self.by_path:
|
|
169
|
-
if path in head:
|
|
170
|
-
# A document is not a focus: the focus is the node it belongs to. A session opened
|
|
171
|
-
# on a research file is a session about the initiative that holds it.
|
|
172
|
-
page = self.by_path[path]
|
|
173
|
-
if page["kind"] in ("entity", "initiative", "workspace"):
|
|
174
|
-
return path
|
|
175
|
-
owner = page.get("owner") or ""
|
|
176
|
-
if owner in self.by_path:
|
|
177
|
-
return owner
|
|
178
|
-
return self._slug(head) or ""
|
|
179
|
-
lead = FOCUS_LEAD.search(head)
|
|
180
|
-
if lead:
|
|
181
|
-
hit = self._slug(lead.group(1))
|
|
182
|
-
if hit:
|
|
183
|
-
return hit
|
|
184
|
-
return self._slug(head) or ""
|
|
185
|
-
|
|
186
|
-
def _slug(self, text):
|
|
187
|
-
best = ""
|
|
188
|
-
for word in WORD.findall(text.lower()):
|
|
189
|
-
path = self.by_slug.get(word)
|
|
190
|
-
if path and (not best or len(word) > len(best[0])):
|
|
191
|
-
best = (word, path)
|
|
192
|
-
return best[1] if best else ""
|
|
193
|
-
|
|
194
|
-
def label(self, path, pages):
|
|
195
|
-
"""`Entity › Initiative`: what the node is about, and then the node. One jump, never a
|
|
196
|
-
chain — the same reach the focus read has."""
|
|
197
|
-
page = pages.get(path)
|
|
198
|
-
if not page:
|
|
199
|
-
return ""
|
|
200
|
-
parent = pages.get(page.get("about") or "")
|
|
201
|
-
if parent:
|
|
202
|
-
return parent["title"] + " › " + page["title"]
|
|
203
|
-
return page["title"]
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
# ------------------------------------------------------------------ threads (C2, C3, C8)
|
|
207
|
-
def threads(sessions_dir, now, days, pages, wsdir, head_file):
|
|
208
|
-
focus = Focus(pages, wsdir, head_file)
|
|
209
|
-
window = now - datetime.timedelta(days=days)
|
|
210
|
-
rows = []
|
|
211
|
-
try:
|
|
212
|
-
names = sorted(os.listdir(sessions_dir))
|
|
213
|
-
except OSError:
|
|
214
|
-
return None, rows
|
|
215
|
-
for name in names:
|
|
216
|
-
if not name.endswith(".jsonl"):
|
|
217
|
-
continue
|
|
218
|
-
got = read_session(os.path.join(sessions_dir, name))
|
|
219
|
-
if not got or not got["agent"]:
|
|
220
|
-
continue
|
|
221
|
-
when, body = got["agent"]
|
|
222
|
-
if when < window:
|
|
223
|
-
continue
|
|
224
|
-
# The person spoke last: the turn is theirs, and nothing is waiting for them here. This is
|
|
225
|
-
# the case the criterion asks to leave out.
|
|
226
|
-
if got["user"] and got["user"] > when:
|
|
227
|
-
continue
|
|
228
|
-
asking = body.rstrip(TRAILING).endswith("?")
|
|
229
|
-
if asking:
|
|
230
|
-
label = "gate1" if GATE1_HINT.search(body[-400:]) else "asks"
|
|
231
|
-
else:
|
|
232
|
-
label = "unread"
|
|
233
|
-
path = focus.of(got["first"])
|
|
234
|
-
rows.append({
|
|
235
|
-
"id": name[:-6],
|
|
236
|
-
"title": got["title"] or _tail(got["first"], 60),
|
|
237
|
-
"says": _tail(body),
|
|
238
|
-
"label": label,
|
|
239
|
-
"unreadByDefault": label == "unread",
|
|
240
|
-
"at": when.isoformat(),
|
|
241
|
-
"age": _age(now, when),
|
|
242
|
-
"focus": path,
|
|
243
|
-
"focusLabel": focus.label(path, pages) if path else "",
|
|
244
|
-
"ws": pages[path]["ws"] if path else "",
|
|
245
|
-
})
|
|
246
|
-
rows.sort(key=lambda r: r["at"], reverse=True)
|
|
247
|
-
groups, order = {}, []
|
|
248
|
-
for row in rows:
|
|
249
|
-
key = row["focus"]
|
|
250
|
-
if key not in groups:
|
|
251
|
-
groups[key] = {"focus": key, "label": row["focusLabel"], "threads": []}
|
|
252
|
-
order.append(key)
|
|
253
|
-
groups[key]["threads"].append(row)
|
|
254
|
-
# *No focus* goes last: it is the leftover, never the headline.
|
|
255
|
-
named = [k for k in order if k]
|
|
256
|
-
return len(names), [groups[k] for k in named + [k for k in order if not k]]
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
# ------------------------------------------------------------------ gates (C4)
|
|
260
|
-
def gates(rows, today):
|
|
261
|
-
out = []
|
|
262
|
-
for line in rows:
|
|
263
|
-
cells = line.split("\t")
|
|
264
|
-
if len(cells) < 5:
|
|
265
|
-
continue
|
|
266
|
-
when = cells[4].strip()
|
|
267
|
-
out.append({
|
|
268
|
-
"gate": cells[0].strip(),
|
|
269
|
-
"repo": cells[1].strip(),
|
|
270
|
-
"spec": cells[2].strip(),
|
|
271
|
-
"title": cells[3].strip(),
|
|
272
|
-
"date": when,
|
|
273
|
-
"branch": cells[5].strip() if len(cells) > 5 else "",
|
|
274
|
-
"days": _days_between(when, today),
|
|
275
|
-
})
|
|
276
|
-
out.sort(key=lambda g: (g["gate"], -(g["days"] if g["days"] is not None else -1), g["spec"]))
|
|
277
|
-
return out
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
def _days_between(when, today):
|
|
281
|
-
a, b = _date(when), _date(today)
|
|
282
|
-
if not a or not b:
|
|
283
|
-
return None
|
|
284
|
-
return (b - a).days
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
def _date(value):
|
|
288
|
-
try:
|
|
289
|
-
return datetime.date.fromisoformat(str(value)[:10])
|
|
290
|
-
except (ValueError, TypeError):
|
|
291
|
-
return None
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
# ------------------------------------------------------------------ waiting on others (C5)
|
|
295
|
-
def waiting(pages, ws, today, operator):
|
|
296
|
-
"""The `waiting_on:` of the workspace's live initiatives that is not the operator.
|
|
297
|
-
|
|
298
|
-
WHO COUNTS AS THE OPERATOR IS THE STARTUP'S RULE, not a second one: the literal `operador`, a
|
|
299
|
-
`gate-*`, or the operator's own name. Anything else is somebody else, and that is what this
|
|
300
|
-
block is for — a gate is already its own block above.
|
|
301
|
-
"""
|
|
302
|
-
op = (operator or "").strip().lower()
|
|
303
|
-
rows = []
|
|
304
|
-
for path, page in pages.items():
|
|
305
|
-
if page["kind"] != "initiative" or page["ws"] != ws:
|
|
306
|
-
continue
|
|
307
|
-
fm = page["fm"]
|
|
308
|
-
if (fm.get("status") or "").strip().lower() in ("closed", "cerrada", "cerrado"):
|
|
309
|
-
continue
|
|
310
|
-
who = (fm.get("waiting_on") or "").strip()
|
|
311
|
-
low = who.lower()
|
|
312
|
-
if not who or low == "operador" or low.startswith("gate-") or (op and low == op):
|
|
313
|
-
continue
|
|
314
|
-
rows.append({
|
|
315
|
-
"who": who,
|
|
316
|
-
"path": path,
|
|
317
|
-
"title": page["title"],
|
|
318
|
-
"reason": (fm.get("blocked") or "").strip(),
|
|
319
|
-
"days": _days_between(fm.get("updated", ""), today),
|
|
320
|
-
})
|
|
321
|
-
# Longest wait first: this block exists to surface the one that went stale, and a wait of a
|
|
322
|
-
# month is the one that needs a person, not the one from yesterday.
|
|
323
|
-
rows.sort(key=lambda r: (-(r["days"] if r["days"] is not None else -1), r["title"]))
|
|
324
|
-
return rows
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
# ------------------------------------------------------------------ this week (C6)
|
|
328
|
-
def week(pages, ws, today, span):
|
|
329
|
-
start = _date(today)
|
|
330
|
-
if not start:
|
|
331
|
-
return []
|
|
332
|
-
end = start + datetime.timedelta(days=span)
|
|
333
|
-
rows = []
|
|
334
|
-
for path, page in pages.items():
|
|
335
|
-
if page["ws"] != ws:
|
|
336
|
-
continue
|
|
337
|
-
owner = pages.get(page.get("owner") or "") or page
|
|
338
|
-
if owner["kind"] not in ("initiative", "entity", "workspace"):
|
|
339
|
-
continue
|
|
340
|
-
for section in page["sections"]:
|
|
341
|
-
if section["form"] != "tasks":
|
|
342
|
-
continue
|
|
343
|
-
for item in section["items"]:
|
|
344
|
-
if item.get("done"):
|
|
345
|
-
continue
|
|
346
|
-
day = _date(item.get("date", ""))
|
|
347
|
-
if not day or day < start or day > end:
|
|
348
|
-
continue
|
|
349
|
-
text = item.get("text", "").strip()
|
|
350
|
-
reason = ""
|
|
351
|
-
if " · " in text:
|
|
352
|
-
text, _, reason = text.partition(" · ")
|
|
353
|
-
rows.append({
|
|
354
|
-
"text": text.strip(),
|
|
355
|
-
"reason": reason.strip(),
|
|
356
|
-
"date": day.isoformat(),
|
|
357
|
-
"days": (day - start).days,
|
|
358
|
-
"path": owner["path"],
|
|
359
|
-
"node": owner["title"],
|
|
360
|
-
})
|
|
361
|
-
rows.sort(key=lambda r: (r["date"], r["node"], r["text"]))
|
|
362
|
-
return rows
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
# ------------------------------------------------------------------ the block the page receives
|
|
366
|
-
def build(pages, workspaces, wsdir, head_file, options, gate_rows):
|
|
367
|
-
now = _stamp(options.get("now")) or datetime.datetime.now(datetime.timezone.utc)
|
|
368
|
-
if now.tzinfo is None:
|
|
369
|
-
now = now.replace(tzinfo=datetime.timezone.utc)
|
|
370
|
-
today = options.get("today") or now.date().isoformat()
|
|
371
|
-
days = int(options.get("days") or 3)
|
|
372
|
-
span = int(options.get("week") or 7)
|
|
373
|
-
directory = options.get("sessions") or ""
|
|
374
|
-
|
|
375
|
-
seen, grouped = threads(directory, now, days, pages, wsdir, head_file) if directory \
|
|
376
|
-
else (None, [])
|
|
377
|
-
return {
|
|
378
|
-
"now": now.isoformat(),
|
|
379
|
-
"today": today,
|
|
380
|
-
"days": days,
|
|
381
|
-
"week": span,
|
|
382
|
-
# No sessions to read is not a failure: the brain may be worked from another machine, or
|
|
383
|
-
# from the app in the cloud. The page says so and shows the other three blocks (C7 of the
|
|
384
|
-
# spec's delegated criteria).
|
|
385
|
-
"sessions": {"dir": directory, "available": seen is not None, "files": seen or 0,
|
|
386
|
-
"readRecord": False},
|
|
387
|
-
"threads": grouped,
|
|
388
|
-
"gates": gates(gate_rows, today),
|
|
389
|
-
"waiting": {w["slug"]: waiting(pages, w["slug"], today, options.get("operator", ""))
|
|
390
|
-
for w in workspaces},
|
|
391
|
-
"week_items": {w["slug"]: week(pages, w["slug"], today, span) for w in workspaces},
|
|
392
|
-
}
|
package/core/skills/my-wiki.md
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
command: my-wiki
|
|
3
|
-
capability: See the brain as a navigable page, and publish it
|
|
4
|
-
description: Project the brain as one navigable page — a workspace selector, a shelf per entity type the tree declares, the initiatives hanging from the entity each one is about, the people, and a search that runs inside the page. It opens on Overview: the Claude Code threads that are waiting for you, the open gates, who you are waiting on and what has a date this week. Generated by script from the files and git, with no tokens of the model, and regenerated in seconds every time the brain changes. The script writes the page outside the brain and never publishes: the session publishes it with the Artifact tool and a person approves that.
|
|
5
|
-
description_es: Proyecta el cerebro como una sola página navegable — selector de espacio de trabajo, un estante por cada tipo de entidad que declara el árbol, las iniciativas colgando de la entidad de la que tratan, las personas y una búsqueda que corre adentro de la página. Abre en Panorama: los hilos de Claude Code que te esperan, los gates abiertos, a quién estás esperando y qué tiene fecha esta semana. La genera un script a partir de los archivos y de git, sin tokens del modelo, y se regenera en segundos cada vez que el cerebro cambia. El script escribe la página fuera del cerebro y nunca publica: la sesión la publica con la herramienta Artifact y eso lo aprueba una persona.
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# my-wiki — the brain, projected as a page a person reads
|
|
9
|
-
|
|
10
|
-
Obsidian shows every file of the brain in the order of the folders, machinery included. This skill
|
|
11
|
-
shows the same brain the way its owner thinks about it: entities on their shelves, the initiatives
|
|
12
|
-
under the entity they are about, the people, one search box — and, first of all, Overview: what is
|
|
13
|
-
waiting for a person right now.
|
|
14
|
-
|
|
15
|
-
**Nothing is written twice.** The page is a projection: it reads the files and git, and writes
|
|
16
|
-
nothing back. What it shows is wrong only when the brain is wrong.
|
|
17
|
-
|
|
18
|
-
## How it is run
|
|
19
|
-
|
|
20
|
-
```
|
|
21
|
-
.os/core/lib/my-wiki.sh --brain .
|
|
22
|
-
.os/core/lib/my-wiki.sh --brain . --out /tmp/my-wiki.html
|
|
23
|
-
.os/core/lib/my-wiki.sh --brain . --days 7 --week 14
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
`--out` names the destination file; with none, it goes to `$TMPDIR`. **A destination inside the
|
|
27
|
-
brain is refused**: the page is derived and disposable, and a generated file left inside the brain
|
|
28
|
-
would show up as work in every scan from then on. `--days` is the window of Overview's threads
|
|
29
|
-
(default 3) and `--week` the window of its dated tasks (default 7).
|
|
30
|
-
|
|
31
|
-
It prints the path it wrote, the size, and how many pages and workspaces the page carries.
|
|
32
|
-
|
|
33
|
-
## What the page shows
|
|
34
|
-
|
|
35
|
-
- **Overview, the first screen.** The Claude Code threads of the last days whose last turn is the
|
|
36
|
-
agent's — grouped by the focus each session named — the specs waiting for a Gate 1 and the
|
|
37
|
-
branches waiting for a merge, the `waiting_on:` that is somebody else, and the tasks with a date
|
|
38
|
-
inside the week. **Claude Code keeps no record of what a person opened**: a thread that finished
|
|
39
|
-
without asking anything is shown as *finished · unread*, and the page says on screen that it is
|
|
40
|
-
showing it for lack of that datum, never as a fact. A machine with no local sessions says so and
|
|
41
|
-
shows the other three blocks.
|
|
42
|
-
- **A workspace selector**, one page for every workspace of the brain. The root is never shown:
|
|
43
|
-
what lives there is machinery, and the machinery is not the person's work.
|
|
44
|
-
- **A shelf per entity type the tree declares** — whatever they are called in this brain. No type
|
|
45
|
-
is written into the skill: a brain that declares `patients/` gets a Patients shelf, and a brain
|
|
46
|
-
with no entity type at all gets its workspace with a notice and no invented shelves.
|
|
47
|
-
- **An initiative hangs from the entity its `about:` names.** One that declares none is listed
|
|
48
|
-
under *No entity* — visible, never hidden.
|
|
49
|
-
- **The sections of a page are the `##` of its file**, each with its shape: tasks when the lines
|
|
50
|
-
carry checkboxes, decisions when they start with a date, people when they point at `people/`,
|
|
51
|
-
and rendered prose for everything else.
|
|
52
|
-
- **Development**, only on a node with `repo:`: the specs by state and the last merge, read from
|
|
53
|
-
the local path `mounts.md` declares for that remote. A repo this machine has not mounted says so
|
|
54
|
-
and nothing fails.
|
|
55
|
-
- **What changed**, from `git log` over the window, grouped by entity and initiative.
|
|
56
|
-
- **Graph**, one screen more of the page (spec 061, its canvas rebuilt by spec 066 to the vara of
|
|
57
|
-
Obsidian): every page as a node on a `<canvas>` with its own physics — nodes settle by force,
|
|
58
|
-
drag one and it stays where it is dropped, the background pans, the wheel zooms centred on the
|
|
59
|
-
cursor, a double-click fits the whole graph. An edge for every `about:`, every path to another
|
|
60
|
-
page inside backticks and every path into `people/` — nothing else. Hover highlights a node's
|
|
61
|
-
neighbours and opens its page on click, *Show documents*/*Show people* filter a type without
|
|
62
|
-
recomputing the rest, and *How it grew* steps the graph through the first-commit date of every
|
|
63
|
-
page. No library loads from outside the page.
|
|
64
|
-
- **Search**, inside the page, over titles and bodies of the workspace being read.
|
|
65
|
-
- **Appearance** — accent, type, size, theme — changed from the page and remembered by the browser.
|
|
66
|
-
|
|
67
|
-
*Edit markdown* opens the note in Obsidian (`obsidian://open?vault=…&file=…`) and copies the path
|
|
68
|
-
to the clipboard at the same time: a published page runs in a sandbox that may refuse the scheme,
|
|
69
|
-
and the path is what the person needs either way.
|
|
70
|
-
|
|
71
|
-
## Publishing it
|
|
72
|
-
|
|
73
|
-
**The script never publishes.** The session does, with the **Artifact** tool, and the person
|
|
74
|
-
approves that turn:
|
|
75
|
-
|
|
76
|
-
1. Run the script and read the path it printed.
|
|
77
|
-
2. Publish that file with the Artifact tool, passing its path: title **My Wiki**, and the
|
|
78
|
-
comments capability, so the page can be commented on. The page carries its own favicon-less
|
|
79
|
-
head; the tool asks for one on a first publish.
|
|
80
|
-
3. Hand the person the URL, and say the page is private until they share it.
|
|
81
|
-
|
|
82
|
-
**A second run publishes to the same URL**, not to a new one: the same file path this session, or
|
|
83
|
-
the artifact's URL from a later session. A new URL every time turns the wiki into a pile of stale
|
|
84
|
-
copies.
|
|
85
|
-
|
|
86
|
-
**Publishing puts the content of the brain on claude.ai** — private by default, and off the
|
|
87
|
-
machine anyway. It is offered, never done on its own.
|
|
88
|
-
|
|
89
|
-
## Reading the comments afterwards
|
|
90
|
-
|
|
91
|
-
A comment on the published page is how the person sends something back: a correction, a task to
|
|
92
|
-
move, a document to rewrite. To read them, the session calls the Artifact tool with the page's URL
|
|
93
|
-
and the `comments` action; a thread the person sent to Claude is the one that can be replied to and
|
|
94
|
-
resolved.
|
|
95
|
-
|
|
96
|
-
**A comment is a request, not an edit.** What it asks for is applied to the file in the brain, in
|
|
97
|
-
the session, the way any other change is — and the page is regenerated and republished afterwards.
|
|
98
|
-
|
|
99
|
-
## What it does not do
|
|
100
|
-
|
|
101
|
-
It does not edit the brain, does not capture, does not mark a task done, and does not open a
|
|
102
|
-
thread of its own. It does not show the archive of a node, and it does not embed images or
|
|
103
|
-
attachments: it links to them.
|