ai-first-os 1.9.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/LICENSE +21 -0
- package/README.md +226 -0
- package/bin/ai-first-os.js +72 -0
- package/core/CLAUDE.md +148 -0
- package/core/VERSION +1 -0
- package/core/agents/ambiguous-spec.md +39 -0
- package/core/agents/complete-spec.md +36 -0
- package/core/agents/scout.md +25 -0
- package/core/install.sh +243 -0
- package/core/lib/archive.sh +347 -0
- package/core/lib/bootstrap.sh +276 -0
- package/core/lib/capture.sh +188 -0
- package/core/lib/check-resolvable.sh +172 -0
- package/core/lib/close-session.sh +741 -0
- package/core/lib/common.sh +1773 -0
- package/core/lib/focus-read.sh +282 -0
- package/core/lib/manual-link.sh +111 -0
- package/core/lib/markdown.py +304 -0
- package/core/lib/migrate-backlogs.sh +207 -0
- package/core/lib/migrate-canonicals.sh +523 -0
- package/core/lib/mount-repo.sh +543 -0
- package/core/lib/my-wiki-gates.sh +137 -0
- package/core/lib/my-wiki.sh +202 -0
- package/core/lib/my_wiki_build.py +548 -0
- package/core/lib/my_wiki_graph.py +137 -0
- package/core/lib/my_wiki_overview.py +392 -0
- package/core/lib/new-memory.sh +160 -0
- package/core/lib/new-product.sh +122 -0
- package/core/lib/new-workspace.sh +105 -0
- package/core/lib/pack-install.sh +114 -0
- package/core/lib/recall.sh +235 -0
- package/core/lib/recall_index.py +295 -0
- package/core/lib/remote-backup.sh +84 -0
- package/core/lib/rename-heads.sh +354 -0
- package/core/lib/rename-workspaces.sh +271 -0
- package/core/lib/session-read.sh +203 -0
- package/core/lib/session-start.sh +854 -0
- package/core/lib/supersede.sh +436 -0
- package/core/lib/sweep.sh +473 -0
- package/core/manual/COMO-FUNCIONA.md +251 -0
- package/core/manual/HOW-IT-WORKS.md +250 -0
- package/core/resolver.md +30 -0
- package/core/skills/archive.md +95 -0
- package/core/skills/bootstrap.md +226 -0
- package/core/skills/capture.md +65 -0
- package/core/skills/check-resolvable.md +38 -0
- package/core/skills/close-session.md +108 -0
- package/core/skills/grill.md +74 -0
- package/core/skills/mount-repo.md +97 -0
- package/core/skills/my-wiki.md +103 -0
- package/core/skills/new-memory.md +76 -0
- package/core/skills/new-product.md +55 -0
- package/core/skills/new-spec.md +114 -0
- package/core/skills/new-workspace.md +53 -0
- package/core/skills/recall.md +64 -0
- package/core/skills/rename-heads.md +72 -0
- package/core/skills/rename-workspaces.md +43 -0
- package/core/skills/supersede.md +83 -0
- package/core/skills/sweep.md +40 -0
- package/core/templates/my-wiki-graph.js +431 -0
- package/core/templates/my-wiki-overview.js +174 -0
- package/core/templates/my-wiki.html +1017 -0
- package/core/templates/node-folder/README.md +11 -0
- package/core/templates/node-folder/resolver.md +9 -0
- package/core/templates/node-light.md +22 -0
- package/core/templates/node-product/README.md +8 -0
- package/core/templates/node-repo/README.md +14 -0
- package/core/templates/node-repo/context/README.md +22 -0
- package/core/templates/node-repo/context/competitors.md +8 -0
- package/core/templates/node-repo/context/glossary.md +8 -0
- package/core/templates/node-repo/context/open-questions.md +9 -0
- package/core/templates/node-repo/context/opportunities.md +9 -0
- package/core/templates/node-repo/context/problem.md +8 -0
- package/core/templates/node-repo/context/scope.md +8 -0
- package/core/templates/node-repo/context/users.md +8 -0
- package/core/templates/node-repo/context/vision.md +8 -0
- package/core/templates/node-repo/resolver.md +14 -0
- package/core/templates/operator.md +17 -0
- package/core/templates/person.md +10 -0
- package/core/templates/repo-scaffold/ARCHITECTURE.md +3 -0
- package/core/templates/repo-scaffold/CLAUDE.md +23 -0
- package/core/templates/repo-scaffold/decisions.md +3 -0
- package/core/templates/repo-scaffold/evals-run.sh +14 -0
- package/core/templates/repo-scaffold/gitignore +3 -0
- package/core/templates/repo-scaffold/settings.json +8 -0
- package/core/templates/root-resolver.md +5 -0
- package/core/templates/strings.md +1361 -0
- package/core/templates/tree.md +59 -0
- package/core/templates/voice.md +5 -0
- package/package.json +23 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/* Overview: what is waiting for the person, as the page's first screen (spec 062).
|
|
2
|
+
|
|
3
|
+
It is its own block on purpose. `wiki-core` is the DOM-free logic the suite runs headlessly and
|
|
4
|
+
`wiki-view` is the shell; this one is the first screen's view, and it exposes one function so
|
|
5
|
+
the shell reaches it with a single line. Its icons live here too: the screen's four headings are
|
|
6
|
+
the only place they are used, and the shell's own map stays as it was. */
|
|
7
|
+
var WIKI_OVERVIEW = (function () {
|
|
8
|
+
var ICONS = {
|
|
9
|
+
grid: '<rect x="3" y="3" width="7" height="7" rx="1.5"/><rect x="14" y="3" width="7" height="7" rx="1.5"/><rect x="3" y="14" width="7" height="7" rx="1.5"/><rect x="14" y="14" width="7" height="7" rx="1.5"/>',
|
|
10
|
+
message: '<path d="M21 12a8 8 0 0 1-11 7.4L4 21l1.6-5A8 8 0 1 1 21 12z"/>',
|
|
11
|
+
gate: '<path d="M4 22V4a1 1 0 0 1 1-1h11l-2 4 2 4H5"/>',
|
|
12
|
+
clock: '<circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/>',
|
|
13
|
+
calendar: '<rect x="3" y="4" width="18" height="17" rx="2"/><path d="M8 2v4M16 2v4M3 10h18"/>'
|
|
14
|
+
};
|
|
15
|
+
function svg(name, size) {
|
|
16
|
+
return '<svg width="' + (size || 18) + '" height="' + (size || 18) + '" viewBox="0 0 24 24" ' +
|
|
17
|
+
'fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" ' +
|
|
18
|
+
'stroke-linejoin="round">' + (ICONS[name] || ICONS.grid) + '</svg>';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* How long ago, with the word the catalog gives it. The number is the builder's; the unit it is
|
|
22
|
+
counted in is a key, never a literal — the page speaks the brain's language. */
|
|
23
|
+
function ago(T, age) {
|
|
24
|
+
if (!age) return '';
|
|
25
|
+
var word = age.unit === 'min' ? T('WIKI_AGO_MIN', 'min')
|
|
26
|
+
: age.unit === 'h' ? T('WIKI_AGO_HOUR', 'h') : T('WIKI_AGO_DAY', 'd');
|
|
27
|
+
return age.n + ' ' + word;
|
|
28
|
+
}
|
|
29
|
+
function days(T, n) {
|
|
30
|
+
if (n === null || n === undefined) return '';
|
|
31
|
+
return n + ' ' + T('WIKI_AGO_DAY', 'd');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function labelChip(T, esc, label) {
|
|
35
|
+
if (label === 'asks') return '<span class="chip hot">' + esc(T('WIKI_THREAD_ASKS', 'asks you')) + '</span>';
|
|
36
|
+
if (label === 'gate1') return '<span class="chip wait">' + esc(T('WIKI_THREAD_GATE1', 'Gate 1')) + '</span>';
|
|
37
|
+
return '<span class="chip ok">' + esc(T('WIKI_THREAD_UNREAD', 'finished · unread')) + '</span>';
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function threadRow(T, esc, href, t) {
|
|
41
|
+
var h = ['<div class="li">'];
|
|
42
|
+
h.push('<span style="width:8px;height:8px;border-radius:999px;background:var(--accent);display:inline-block;margin-top:7px;flex-shrink:0"></span>');
|
|
43
|
+
// A thread has no URL a browser can open, so it offers the two things that exist: its focus
|
|
44
|
+
// page in the wiki, and the command that resumes it in Claude Code, copied on click.
|
|
45
|
+
var cmd = 'claude --resume ' + t.id;
|
|
46
|
+
h.push('<div style="min-width:0;flex:1"><div class="t">' + esc(t.title) + '</div>');
|
|
47
|
+
h.push('<div class="d">' + esc(t.says) + '</div>');
|
|
48
|
+
h.push('<div class="d" style="margin-top:6px;display:flex;gap:10px;flex-wrap:wrap">' +
|
|
49
|
+
(t.focus ? '<a href="' + href(t.focus) + '">' + esc(t.focusLabel || t.focus) + '</a>' : '') +
|
|
50
|
+
'<a href="#" class="resume" data-resume="' + esc(cmd) + '" title="' + esc(cmd) + '">' + esc(T('WIKI_THREAD_RESUME', 'Copy the command to resume it')) + '</a>' +
|
|
51
|
+
'</div></div>');
|
|
52
|
+
h.push('<div style="display:flex;flex-direction:column;align-items:flex-end;gap:4px;flex-shrink:0">');
|
|
53
|
+
h.push(labelChip(T, esc, t.label));
|
|
54
|
+
h.push('<span class="muted" style="font-size:12px">' + esc(ago(T, t.age)) + '</span></div>');
|
|
55
|
+
return h.join('') + '</div>';
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function threads(T, esc, href, o) {
|
|
59
|
+
var h = ['<h2>' + svg('message') + ' ' + esc(T('WIKI_THREADS', 'Threads waiting for you')) +
|
|
60
|
+
' <span class="muted" style="font-weight:400;font-size:13px">' +
|
|
61
|
+
esc(T('WIKI_THREADS_WINDOW', 'last %s days · grouped by focus').replace('%s', o.days)) +
|
|
62
|
+
'</span></h2>'];
|
|
63
|
+
if (!o.sessions.available) {
|
|
64
|
+
h.push('<div class="note">' + esc(T('WIKI_NO_SESSIONS',
|
|
65
|
+
'No local Claude Code sessions to read on this machine.')) + '</div>');
|
|
66
|
+
return h.join('');
|
|
67
|
+
}
|
|
68
|
+
if (!o.threads.length) {
|
|
69
|
+
h.push('<div class="note">' + esc(T('WIKI_NO_THREADS', 'No thread is waiting for you.')) + '</div>');
|
|
70
|
+
return h.join('');
|
|
71
|
+
}
|
|
72
|
+
h.push('<div class="card" style="padding:4px 16px">');
|
|
73
|
+
var unread = 0;
|
|
74
|
+
o.threads.forEach(function (g) {
|
|
75
|
+
h.push('<div class="grp" style="padding:10px 0 2px">' +
|
|
76
|
+
(g.focus ? '<a href="' + href(g.focus) + '" style="color:inherit">' + esc(g.label) + '</a>' : esc(g.label || T('WIKI_NO_FOCUS', 'No focus'))) + '</div>');
|
|
77
|
+
g.threads.forEach(function (t) {
|
|
78
|
+
if (t.unreadByDefault) unread++;
|
|
79
|
+
h.push(threadRow(T, esc, href, t));
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
h.push('</div>');
|
|
83
|
+
/* The page says WHY a thread is here when the reason is a missing datum, not a fact: there is
|
|
84
|
+
no record of what the person read, so a finished turn is shown, and shown as unverified. */
|
|
85
|
+
if (unread) {
|
|
86
|
+
h.push('<div class="note" style="margin-top:10px">' + esc(T('WIKI_UNREAD_WHY',
|
|
87
|
+
'Claude Code keeps no record of what you opened: a finished thread is shown as unread for lack of that datum.')) +
|
|
88
|
+
'</div>');
|
|
89
|
+
}
|
|
90
|
+
return h.join('');
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function gates(T, esc, o) {
|
|
94
|
+
var h = ['<div class="card"><h2 style="margin:0 0 8px">' + svg('gate') + ' ' +
|
|
95
|
+
esc(T('WIKI_GATES', 'Gates')) + '</h2>'];
|
|
96
|
+
if (!o.gates.length) {
|
|
97
|
+
h.push('<div class="d">' + esc(T('WIKI_NO_GATES', 'No gate is open.')) + '</div>');
|
|
98
|
+
}
|
|
99
|
+
o.gates.forEach(function (g) {
|
|
100
|
+
var chip = g.gate === '2'
|
|
101
|
+
? '<span class="chip wait">' + esc(T('WIKI_GATE_2', 'Gate 2 · merge')) + '</span>'
|
|
102
|
+
: '<span class="chip wait">' + esc(T('WIKI_GATE_1', 'Gate 1')) + '</span>';
|
|
103
|
+
var detail = esc(g.repo);
|
|
104
|
+
if (g.branch) detail += ' · ' + esc(g.branch);
|
|
105
|
+
if (g.days !== null && g.days !== undefined) detail += ' · ' + esc(days(T, g.days));
|
|
106
|
+
h.push('<div class="li"><div><div class="t">' + esc(g.title) + '</div>' +
|
|
107
|
+
'<div class="d">' + detail + '</div></div>' + chip + '</div>');
|
|
108
|
+
});
|
|
109
|
+
return h.join('') + '</div>';
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function waiting(T, esc, href, rows) {
|
|
113
|
+
var h = ['<div class="card"><h2 style="margin:0 0 8px">' + svg('clock') + ' ' +
|
|
114
|
+
esc(T('WIKI_WAITING_OTHERS', 'Waiting on others')) + '</h2>'];
|
|
115
|
+
if (!rows.length) {
|
|
116
|
+
h.push('<div class="d">' + esc(T('WIKI_NO_WAITING', 'Nobody owes you an answer.')) + '</div>');
|
|
117
|
+
}
|
|
118
|
+
rows.forEach(function (r) {
|
|
119
|
+
var detail = r.reason ? esc(r.reason) + ' · ' : '';
|
|
120
|
+
h.push('<div class="li"><div><div class="t">' + esc(r.who) + '</div><div class="d">' +
|
|
121
|
+
detail + '<a href="' + href(r.path) + '">' + esc(r.title) + '</a></div></div>' +
|
|
122
|
+
'<span class="chip' + (r.days !== null && r.days >= 14 ? ' hot' : '') + '">' +
|
|
123
|
+
esc(days(T, r.days)) + '</span></div>');
|
|
124
|
+
});
|
|
125
|
+
return h.join('') + '</div>';
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function week(T, esc, href, rows, span) {
|
|
129
|
+
var h = ['<h2>' + svg('calendar') + ' ' + esc(T('WIKI_THIS_WEEK', 'This week')) +
|
|
130
|
+
' <span class="muted" style="font-weight:400;font-size:13px">' +
|
|
131
|
+
esc(T('WIKI_WEEK_WINDOW', 'next %s days').replace('%s', span)) + '</span></h2>'];
|
|
132
|
+
if (!rows.length) {
|
|
133
|
+
return h.join('') + '<div class="note">' +
|
|
134
|
+
esc(T('WIKI_NO_WEEK', 'Nothing has a date this week.')) + '</div>';
|
|
135
|
+
}
|
|
136
|
+
h.push('<div class="card" style="padding:4px 16px">');
|
|
137
|
+
rows.forEach(function (r) {
|
|
138
|
+
var detail = '<a href="' + href(r.path) + '">' + esc(r.node) + '</a>';
|
|
139
|
+
if (r.reason) detail += ' · ' + esc(r.reason);
|
|
140
|
+
h.push('<div class="li"><div><div class="t">' + esc(r.text) + '</div><div class="d">' +
|
|
141
|
+
detail + '</div></div><span class="chip' + (r.days <= 1 ? ' hot' : ' wait') + '">' +
|
|
142
|
+
esc(r.date) + '</span></div>');
|
|
143
|
+
});
|
|
144
|
+
return h.join('') + '</div>';
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/* The screen. It takes what the shell already has —the payload, the workspace on screen, the
|
|
148
|
+
catalog and the two helpers— and gives back HTML: no DOM, no state of its own. */
|
|
149
|
+
function view(DATA, w, T, esc, href) {
|
|
150
|
+
var o = DATA.overview;
|
|
151
|
+
if (!o) return '<h1>' + esc(T('WIKI_OVERVIEW', 'Overview')) + '</h1>';
|
|
152
|
+
var slug = w ? w.slug : '';
|
|
153
|
+
var asks = 0;
|
|
154
|
+
o.threads.forEach(function (g) {
|
|
155
|
+
g.threads.forEach(function (t) { if (t.label !== 'unread') asks++; });
|
|
156
|
+
});
|
|
157
|
+
var wait = (o.waiting[slug] || []), days7 = (o.week_items[slug] || []);
|
|
158
|
+
var h = ['<h1>' + esc(T('WIKI_OVERVIEW', 'Overview')) + '</h1>'];
|
|
159
|
+
h.push('<div class="meta"><span>' + esc(w ? w.title : '') + '</span><span>·</span><span>' +
|
|
160
|
+
esc(o.today) + '</span>');
|
|
161
|
+
h.push('<span class="chip hot">' + asks + ' ' + esc(T('WIKI_COUNT_THREADS', 'threads wait for you')) + '</span>');
|
|
162
|
+
h.push('<span class="chip wait">' + o.gates.length + ' ' + esc(T('WIKI_COUNT_GATES', 'gates')) + '</span>');
|
|
163
|
+
h.push('<span class="chip">' + wait.length + ' ' + esc(T('WIKI_COUNT_WAITING', 'waiting on others')) + '</span>');
|
|
164
|
+
h.push('</div>');
|
|
165
|
+
h.push(threads(T, esc, href, o));
|
|
166
|
+
h.push('<div class="cards" style="margin-top:22px">' + gates(T, esc, o) +
|
|
167
|
+
waiting(T, esc, href, wait) + '</div>');
|
|
168
|
+
h.push(week(T, esc, href, days7, o.week));
|
|
169
|
+
return h.join('');
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return {view: view, icon: svg};
|
|
173
|
+
})();
|
|
174
|
+
if (typeof module !== 'undefined' && module.exports) { module.exports = WIKI_OVERVIEW; }
|