create-feltkit 0.4.0 → 0.5.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.
Files changed (74) hide show
  1. package/bin/create.js +3 -3
  2. package/package.json +4 -4
  3. package/scaffold.d.ts +1 -1
  4. package/scaffold.js +8 -5
  5. package/template/README.md +72 -177
  6. package/template/_gitignore +4 -0
  7. package/template/agent/agent.ts +28 -0
  8. package/template/agent/channels/eve.ts +6 -0
  9. package/template/agent/instructions.md +24 -0
  10. package/template/agent/lib/deterministic.ts +46 -0
  11. package/template/agent/lib/feltkit-capabilities.json +294 -0
  12. package/template/agent/tools/crew_artifacts_create.ts +4 -0
  13. package/template/agent/tools/crew_context_read.ts +4 -0
  14. package/template/agent/tools/crew_context_record.ts +4 -0
  15. package/template/agent/tools/crew_context_search.ts +4 -0
  16. package/template/agent/tools/crew_decisions_propose.ts +4 -0
  17. package/template/agent/tools/crew_tasks_add.ts +6 -0
  18. package/template/agent/tools/crew_tasks_list.ts +4 -0
  19. package/template/agent/tools/crew_tasks_note.ts +4 -0
  20. package/template/agent/tools/crew_workspace_overview.ts +4 -0
  21. package/template/agent/tools/crew_workstreams_update.ts +6 -0
  22. package/template/agent/tools/web_fetch.ts +1 -0
  23. package/template/agent/tools/web_search.ts +3 -0
  24. package/template/feltkit/_generated/api.ts +8 -4
  25. package/template/feltkit/activity.ts +26 -0
  26. package/template/feltkit/app.ts +147 -54
  27. package/template/feltkit/boards.ts +10 -0
  28. package/template/feltkit/decisions.ts +99 -0
  29. package/template/feltkit/knowledge.ts +119 -0
  30. package/template/feltkit/model.ts +96 -0
  31. package/template/feltkit/work.ts +45 -0
  32. package/template/feltkit/workspace.ts +171 -0
  33. package/template/index.html +1 -1
  34. package/template/native/App.tsx +249 -0
  35. package/template/package.json +11 -5
  36. package/template/shared/rules.ts +23 -0
  37. package/template/src/App.tsx +177 -528
  38. package/template/src/screens/activity.tsx +66 -0
  39. package/template/src/screens/agent.tsx +188 -0
  40. package/template/src/screens/context.tsx +71 -0
  41. package/template/src/screens/decisions.tsx +89 -0
  42. package/template/src/screens/home.tsx +140 -0
  43. package/template/src/screens/team.tsx +13 -0
  44. package/template/src/screens/work.tsx +149 -0
  45. package/template/src/styles.css +201 -118
  46. package/template/src/ui.tsx +179 -0
  47. package/template/tests/crew.test.ts +111 -0
  48. package/template/tsconfig.json +18 -3
  49. package/template-managed/Dockerfile +2 -2
  50. package/template-managed/README.md +1 -1
  51. package/template-managed/package.json +3 -3
  52. package/template-tasks/README.md +383 -0
  53. package/template-tasks/_gitignore +12 -0
  54. package/template-tasks/feltkit/_generated/api.ts +10 -0
  55. package/template-tasks/feltkit/app.ts +73 -0
  56. package/template-tasks/index.html +17 -0
  57. package/template-tasks/native/App.tsx +220 -0
  58. package/template-tasks/native/native.json +5 -0
  59. package/template-tasks/package.json +30 -0
  60. package/template-tasks/public/apple-touch-icon.png +0 -0
  61. package/template-tasks/public/favicon.png +0 -0
  62. package/template-tasks/public/theme.js +7 -0
  63. package/template-tasks/shared/rules.ts +18 -0
  64. package/template-tasks/src/App.tsx +557 -0
  65. package/template-tasks/src/main.tsx +17 -0
  66. package/template-tasks/src/styles.css +134 -0
  67. package/template-tasks/src/theme.tsx +58 -0
  68. package/template-tasks/tsconfig.json +16 -0
  69. package/template-tasks/vite.config.ts +6 -0
  70. /package/{template → template-tasks}/feltkit/inbox.ts +0 -0
  71. /package/{template → template-tasks}/feltkit/projects.ts +0 -0
  72. /package/{template → template-tasks}/feltkit/tasks.ts +0 -0
  73. /package/{template → template-tasks}/public/feltkit-mark.png +0 -0
  74. /package/{template → template-tasks}/tests/tasks.test.ts +0 -0
@@ -0,0 +1,149 @@
1
+ import { useState } from "react";
2
+ import { useAuth, useMutation, useQueryState } from "@feltdb/feltkit/react";
3
+ import { api } from "../../feltkit/_generated/api";
4
+ import { ago, Empty, Failure, TASK_STATUS, useRun, who, WS_STATUS } from "../ui";
5
+ import { useMembers } from "../App";
6
+
7
+ const ORDER = ["in_progress", "claimed", "ready", "open", "blocked", "completed", "failed", "cancelled"];
8
+
9
+ /** Work by workstream. Tasks are Boards threads: claims, progress, results, dependencies and follow-ups are Boards'. */
10
+ export function Work({ workstreams }: { workstreams: any[] }) {
11
+ const [selected, setSelected] = useState<string>(workstreams[0]?.id);
12
+ const [taskId, setTaskId] = useState<string | null>(null);
13
+ const w = workstreams.find((x) => x.id === selected) ?? workstreams[0];
14
+ if (!w) return <Empty title="No workstreams yet" />;
15
+ return (
16
+ <div className="stack loose">
17
+ <div className="page-head"><div><div className="eyebrow">Work</div><h1>{w.name}</h1><p className="muted small" style={{ marginTop: 6, maxWidth: "70ch" }}>{w.outcome}</p></div><WorkstreamStatus w={w} /></div>
18
+ <div className="work">
19
+ <div className="stack tight streams" aria-label="Workstreams">
20
+ {workstreams.map((x) => (
21
+ <button key={x.id} aria-current={x.id === w.id} onClick={() => setSelected(x.id)}>
22
+ <span className="row"><span className={`dot-status s-${x.status}`} /><span className="small clip" style={{ fontWeight: 600 }}>{x.name}</span></span>
23
+ <span className="tiny muted">{x.done}/{x.tasks} done{x.blocked ? ` · ${x.blocked} blocked` : ""}</span>
24
+ </button>
25
+ ))}
26
+ </div>
27
+ <Tasks channelId={w.channelId} onOpen={setTaskId} />
28
+ </div>
29
+ {taskId ? <Task id={taskId} onClose={() => setTaskId(null)} /> : null}
30
+ </div>
31
+ );
32
+ }
33
+
34
+ function WorkstreamStatus({ w }: { w: any }) {
35
+ const auth = useAuth();
36
+ const update = useMutation(api.workspace.updateWorkstream);
37
+ const { busy, error, run } = useRun();
38
+ if (!auth.can("crew.plan")) return <span className="badge">{WS_STATUS[w.status]}</span>;
39
+ return (
40
+ <div className="stack tight">
41
+ <label className="row small"><span className={`dot-status s-${w.status}`} /><span className="sr">Workstream status</span>
42
+ <select className="select" value={w.status} disabled={busy} onChange={(e) => run(() => update({ workstreamId: w.id, status: e.target.value as any, note: "Changed in Work", version: w.version }))}>
43
+ {Object.entries(WS_STATUS).map(([k, v]) => <option key={k} value={k}>{v}</option>)}
44
+ </select>
45
+ </label>
46
+ <Failure error={error} />
47
+ </div>
48
+ );
49
+ }
50
+
51
+ function Tasks({ channelId, onOpen }: { channelId: string; onOpen(id: string): void }) {
52
+ const auth = useAuth();
53
+ const members = useMembers();
54
+ const threads = useQueryState(api.boards.listThreads, { channelId, kind: "task", limit: 500 });
55
+ const create = useMutation(api.boards.createThread);
56
+ const [title, setTitle] = useState("");
57
+ const { busy, error, run } = useRun();
58
+ const rows = ((threads.data ?? []) as any[]).slice().sort((a, b) => ORDER.indexOf(a.status) - ORDER.indexOf(b.status));
59
+ return (
60
+ <section className="panel">
61
+ {auth.can("boards.post") ? (
62
+ <form className="composer" style={{ borderTop: 0, borderBottom: "1px solid var(--line)" }} onSubmit={(e) => { e.preventDefault(); void run(async () => { await create({ channelId, kind: "task", title: title.trim(), labels: [], metadata: {} }); setTitle(""); }); }}>
63
+ <label className="sr" htmlFor="new-task">New task</label>
64
+ <input id="new-task" className="input grow" value={title} onChange={(e) => setTitle(e.target.value)} placeholder="Add a task" maxLength={200} />
65
+ <button className="btn primary" disabled={busy || !title.trim()}>Add</button>
66
+ </form>
67
+ ) : null}
68
+ <Failure error={error ?? threads.error} />
69
+ <div className="list">
70
+ {rows.map((t) => (
71
+ <button key={t.id} className="task" onClick={() => onOpen(t.id)}>
72
+ <span className={`check ${t.status === "completed" ? "done" : t.status === "in_progress" || t.status === "claimed" ? "active" : t.status === "blocked" ? "blocked" : ""}`} aria-hidden>{t.status === "completed" ? "✓" : ""}</span>
73
+ <span className="grow"><span className="clip" style={{ display: "block", textDecoration: t.status === "completed" ? "line-through" : undefined, color: t.status === "completed" ? "var(--muted)" : undefined }}>{t.title}</span>
74
+ <span className="row tiny muted">{TASK_STATUS[t.status] ?? t.status}{t.claim?.holder ? <span>· {who({ id: t.claim.holder }, members)}</span> : null}{t.messageCount ? <span>· {t.messageCount} notes</span> : null}{t.metadata?.starter ? <span className="badge outline">starter</span> : null}</span>
75
+ </span>
76
+ </button>
77
+ ))}
78
+ {threads.data && rows.length === 0 ? <Empty title="No tasks in this workstream">Add one above, or ask the agent to propose a plan.</Empty> : null}
79
+ </div>
80
+ </section>
81
+ );
82
+ }
83
+
84
+ function Task({ id, onClose }: { id: string; onClose(): void }) {
85
+ const auth = useAuth();
86
+ const members = useMembers();
87
+ const t = useQueryState(api.boards.getThread, { threadId: id });
88
+ const claim = useMutation(api.boards.claimTask);
89
+ const release = useMutation(api.boards.releaseTask);
90
+ const progress = useMutation(api.boards.reportProgress);
91
+ const complete = useMutation(api.boards.completeTask);
92
+ const transition = useMutation(api.boards.transitionThread);
93
+ const post = useMutation(api.boards.postMessage);
94
+ const followup = useMutation(api.boards.scheduleFollowup);
95
+ const [text, setText] = useState("");
96
+ const [summary, setSummary] = useState("");
97
+ const { busy, error, run } = useRun();
98
+ const data = t.data as any;
99
+ const thread = data?.thread;
100
+ const mine = thread?.claim?.holder === auth.user?.id;
101
+ const canWork = auth.can("boards.work");
102
+ return (
103
+ <>
104
+ <div className="drawer-bg" onClick={onClose} />
105
+ <aside className="drawer" role="dialog" aria-label="Task">
106
+ <div className="panel-head"><span className="badge">{thread ? TASK_STATUS[thread.status] ?? thread.status : "…"}</span><button className="btn ghost small" onClick={onClose} aria-label="Close">Close</button></div>
107
+ {!thread ? <Failure error={t.error} /> : (
108
+ <div className="drawer-body">
109
+ <div className="stack tight"><h2 style={{ fontSize: 20 }}>{thread.title}</h2>{thread.body ? <p className="small muted" style={{ whiteSpace: "pre-wrap" }}>{thread.body}</p> : null}
110
+ <p className="tiny muted">Created by {who(thread.createdBy, members)} {ago(thread.createdAt)}{thread.metadata?.starter ? " · starter task" : ""}</p></div>
111
+ {thread.result ? <div className="msg"><strong className="small">Result</strong><span className="small">{thread.result.summary}</span><span className="tiny muted">{who(thread.result.by, members)} · {ago(thread.result.at)}</span></div> : null}
112
+ {canWork ? (
113
+ <div className="row wrap">
114
+ {(thread.status === "ready" || thread.status === "open") && <button className="btn primary" disabled={busy} onClick={() => run(() => claim({ threadId: id }))}>Claim</button>}
115
+ {mine && thread.status === "claimed" && <button className="btn" disabled={busy} onClick={() => run(() => progress({ threadId: id, text: "Started." }))}>Start</button>}
116
+ {mine && <button className="btn" disabled={busy} onClick={() => run(() => release({ threadId: id }))}>Release</button>}
117
+ {thread.status !== "blocked" && thread.status !== "completed" && <button className="btn" disabled={busy} onClick={() => run(() => transition({ threadId: id, action: "block", reason: "Blocked from Work" }))}>Block</button>}
118
+ {thread.status === "blocked" && <button className="btn" disabled={busy} onClick={() => run(() => transition({ threadId: id, action: "unblock" }))}>Unblock</button>}
119
+ {thread.status === "completed" && <button className="btn" disabled={busy} onClick={() => run(() => transition({ threadId: id, action: "reopen" }))}>Reopen</button>}
120
+ <button className="btn ghost" disabled={busy} onClick={() => run(() => followup({ threadId: id, at: Date.now() + 24 * 3_600_000, note: `Follow up on "${thread.title}"` }))}>Remind me tomorrow</button>
121
+ </div>
122
+ ) : null}
123
+ {mine && (thread.status === "claimed" || thread.status === "in_progress") ? (
124
+ <form className="stack tight" onSubmit={(e) => { e.preventDefault(); void run(async () => { await complete({ threadId: id, summary: summary.trim() }); setSummary(""); }); }}>
125
+ <label className="small" htmlFor="summary" style={{ fontWeight: 600 }}>Evidence of completion</label>
126
+ <textarea id="summary" className="textarea" value={summary} onChange={(e) => setSummary(e.target.value)} placeholder="What was done, and where the result is" required />
127
+ <div><button className="btn primary" disabled={busy || !summary.trim()}>Complete</button></div>
128
+ </form>
129
+ ) : null}
130
+ <Failure error={error} />
131
+ <div className="stack tight">
132
+ <h3>Notes</h3>
133
+ {(data.messages ?? []).map((m: any) => <div key={m.id} className={`msg ${m.author?.type === "agent" ? "agent" : ""}`}><span className="tiny muted">{who(m.author, members)} · {ago(m.createdAt ?? m.at)}</span><span className="small" style={{ whiteSpace: "pre-wrap" }}>{m.text}</span></div>)}
134
+ {!(data.messages ?? []).length ? <p className="small muted">No notes yet.</p> : null}
135
+ {auth.can("boards.post") ? (
136
+ <form className="row" onSubmit={(e) => { e.preventDefault(); void run(async () => { await post({ threadId: id, text: text.trim() }); setText(""); }); }}>
137
+ <label className="sr" htmlFor="note">Add a note</label>
138
+ <input id="note" className="input grow" value={text} onChange={(e) => setText(e.target.value)} placeholder="Add a note" />
139
+ <button className="btn" disabled={busy || !text.trim()}>Post</button>
140
+ </form>
141
+ ) : null}
142
+ </div>
143
+ {(data.followups ?? []).length ? <div className="stack tight"><h3>Follow-ups</h3>{data.followups.map((f: any) => <div key={f.id} className="small row"><span className="badge">{f.state}</span>{f.note}<span className="tiny muted">{new Date(f.dueAt).toLocaleString()}</span></div>)}</div> : null}
144
+ </div>
145
+ )}
146
+ </aside>
147
+ </>
148
+ );
149
+ }
@@ -1,134 +1,217 @@
1
+ /* Crew: one visual language. Tokens first; light and dark from the same names (src/theme.tsx sets data-theme). */
1
2
  :root {
2
- /* Light or dark: the system's setting unless the top bar's theme switch chose one
3
- (data-theme on <html>). Each color is light-dark(light, dark). */
4
3
  color-scheme: light dark;
5
- --bg: light-dark(#f7f7f5, #111312);
6
- --surface: light-dark(#ffffff, #181b1a);
7
- --ink: light-dark(#1b1d1c, #eceeed);
8
- --muted: light-dark(#6b706d, #9aa19d);
9
- --line: light-dark(#e4e5e1, #2a2f2c);
10
- --accent: light-dark(#166534, #4ade80);
11
- --accent-ink: light-dark(#ffffff, #052e16);
12
- --accent-soft: light-dark(#e8f3ec, #15301f);
13
- --warn-soft: light-dark(#fef3c7, #2b2210);
14
- --danger-soft: light-dark(#fef3f2, #2a1513);
15
- --danger-line: light-dark(#fecdca, #55201b);
16
- --danger: light-dark(#b42318, #f97066);
17
- --warn: light-dark(#92400e, #fbbf24);
18
- --radius: 10px;
19
- --shadow: 0 1px 2px light-dark(rgba(16, 24, 20, 0.06), transparent), 0 2px 8px light-dark(rgba(16, 24, 20, 0.04), transparent);
20
- font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
21
- color: var(--ink);
22
- background: var(--bg);
23
- font-size: 15px;
24
- line-height: 1.5;
25
- -webkit-font-smoothing: antialiased;
4
+ --bg: light-dark(#f6f5f1, #111214);
5
+ --panel: light-dark(#ffffff, #18191c);
6
+ --panel-2: light-dark(#fbfaf7, #1d1e22);
7
+ --ink: light-dark(#1d1c19, #ecebe7);
8
+ --ink-2: light-dark(#4a4842, #b9b7b0);
9
+ --muted: light-dark(#7a776e, #8a8880);
10
+ --line: light-dark(#e7e4dc, #2a2b30);
11
+ --line-strong: light-dark(#d6d2c7, #383a40);
12
+ --accent: light-dark(#2f5d50, #7fc4ad);
13
+ --accent-ink: light-dark(#ffffff, #0d1a16);
14
+ --accent-soft: light-dark(#e6efe9, #1c2c27);
15
+ --agent: light-dark(#5b4bb7, #a99cf0);
16
+ --agent-soft: light-dark(#eeebfa, #25213a);
17
+ --warn: light-dark(#9a5b00, #e3ae5a);
18
+ --warn-soft: light-dark(#fbf0dc, #2e2516);
19
+ --danger: light-dark(#a4302a, #f08b84);
20
+ --danger-soft: light-dark(#fbe7e5, #321b1a);
21
+ --ok: light-dark(#2d6a3e, #7fcf95);
22
+ --ok-soft: light-dark(#e5f2e8, #19291d);
23
+ --radius: 12px;
24
+ --radius-sm: 8px;
25
+ --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 4px 16px rgb(0 0 0 / 0.04);
26
+ --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
27
+ --serif: "Iowan Old Style", "Source Serif 4", Georgia, serif;
26
28
  }
27
29
  :root[data-theme="light"] { color-scheme: light; }
28
30
  :root[data-theme="dark"] { color-scheme: dark; }
31
+
29
32
  * { box-sizing: border-box; }
30
- body { margin: 0; }
31
- button, input, select, textarea { font: inherit; color: inherit; }
32
- .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
33
+ html, body, #root { height: 100%; }
34
+ body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
35
+ a { color: var(--accent); }
36
+ button, input, textarea, select { font: inherit; color: inherit; }
37
+ h1, h2, h3 { margin: 0; line-height: 1.25; }
38
+ h1 { font-family: var(--serif); font-weight: 600; font-size: 28px; letter-spacing: -0.01em; }
39
+ h2 { font-size: 17px; font-weight: 650; }
40
+ h3 { font-size: 14px; font-weight: 650; }
41
+ p { margin: 0; }
33
42
  .muted { color: var(--muted); }
34
- .shell { min-height: 100vh; display: flex; flex-direction: column; }
43
+ .small { font-size: 13px; }
44
+ .tiny { font-size: 12px; }
45
+ .row { display: flex; align-items: center; gap: 8px; }
46
+ .row.wrap { flex-wrap: wrap; }
47
+ .spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
48
+ .stack { display: grid; gap: 12px; }
49
+ .stack.tight { gap: 6px; }
50
+ .stack.loose { gap: 20px; }
51
+ .grow { flex: 1; min-width: 0; }
52
+ .clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
53
+ .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
35
54
 
36
- .topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 2; }
37
- .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
38
- .mark { display: block; width: 30px; height: 30px; }
39
- .env { font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
40
- .env-prod { background: var(--warn-soft); color: var(--warn); }
41
- .topbar-right { display: flex; align-items: center; gap: 14px; }
42
- .live { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
43
- .live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
44
- .live.on .dot { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18); }
45
- .identity select { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
46
- .dashboard-link { font-size: 13px; color: var(--muted); text-decoration: none; }
47
- .dashboard-link:hover { color: var(--ink); }
48
- .theme-toggle { display: inline-flex; padding: 2px; gap: 2px; border: 1px solid var(--line); border-radius: 8px; }
49
- .theme-toggle button { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
50
- .theme-toggle button:hover { color: var(--ink); }
51
- .theme-toggle button.on { background: var(--accent-soft); color: var(--accent); }
52
- .theme-toggle button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
55
+ /* Shell */
56
+ .shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100%; }
57
+ .side { border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; align-self: start; height: 100vh; background: var(--panel-2); }
58
+ .brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font-weight: 700; letter-spacing: -0.01em; }
59
+ .brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 14px; }
60
+ .nav { display: grid; gap: 2px; }
61
+ .nav button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: var(--radius-sm); cursor: pointer; text-align: left; color: var(--ink-2); }
62
+ .nav button:hover { background: var(--line); color: var(--ink); }
63
+ .nav button[aria-current="page"] { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }
64
+ .nav .count { margin-left: auto; font-size: 12px; background: var(--warn-soft); color: var(--warn); border-radius: 999px; padding: 0 7px; font-weight: 600; }
65
+ .side-foot { margin-top: auto; display: grid; gap: 10px; padding: 0 6px; }
66
+ .main { min-width: 0; padding: 28px clamp(16px, 4vw, 44px) 80px; max-width: 1180px; width: 100%; }
67
+ .page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
68
+ .eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
69
+ .tabs { display: none; }
53
70
 
54
- .notice { margin: 12px 20px 0; padding: 10px 14px; border-radius: var(--radius); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
55
- .notice.error { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger-line); }
56
- .notice.info { background: var(--accent-soft); color: var(--accent); }
71
+ @media (max-width: 820px) {
72
+ .shell { grid-template-columns: 1fr; }
73
+ .side { display: none; }
74
+ .main { padding: 18px 16px 96px; }
75
+ .tabs { display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; bottom: 0; left: 0; right: 0; background: var(--panel); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 20; }
76
+ .tabs button { border: 0; background: none; display: grid; justify-items: center; gap: 2px; font-size: 11px; color: var(--muted); padding: 4px 0; position: relative; }
77
+ .tabs button[aria-current="page"] { color: var(--accent); font-weight: 600; }
78
+ .tabs .dot { position: absolute; top: 2px; right: calc(50% - 16px); width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
79
+ .mobile-head { display: flex !important; }
80
+ h1 { font-size: 23px; }
81
+ }
82
+ .mobile-head { display: none; align-items: center; justify-content: space-between; margin-bottom: 14px; }
57
83
 
58
- .workspace { flex: 1; display: grid; grid-template-columns: 260px 1fr; min-height: 0; }
59
- .sidebar { border-right: 1px solid var(--line); padding: 20px 12px; display: flex; flex-direction: column; gap: 6px; }
60
- .sidebar-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 0 10px 6px; }
61
- .sidebar nav { display: flex; flex-direction: column; gap: 2px; }
62
- .project { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; text-align: left; }
63
- .project:hover { background: var(--surface); }
64
- .project.active { background: var(--surface); box-shadow: var(--shadow); font-weight: 600; }
65
- .project-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
66
- .count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
67
- .new-project input { width: 100%; margin-top: 8px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 8px; background: transparent; }
68
- .new-project input:focus { border-style: solid; outline: 2px solid var(--accent-soft); }
69
- .hint { font-size: 13px; color: var(--muted); padding: 8px 10px; }
84
+ /* Surfaces */
85
+ .panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
86
+ .panel-pad { padding: 18px 20px; }
87
+ .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
88
+ .list { display: grid; }
89
+ .list > * + * { border-top: 1px solid var(--line); }
90
+ .item { padding: 12px 18px; display: flex; gap: 12px; align-items: flex-start; }
91
+ .item.click { cursor: pointer; width: 100%; text-align: left; background: none; border: 0; }
92
+ .item.click:hover { background: var(--panel-2); }
93
+ .grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
94
+ @media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }
70
95
 
71
- .main { padding: 28px 36px 60px; max-width: 860px; width: 100%; }
72
- .project-header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
73
- h1 { font-size: 24px; letter-spacing: -0.01em; margin: 0; }
74
- .add-task input { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
75
- .add-task input:focus, .title-input:focus, .note-form input:focus, textarea:focus, .inline-form input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
96
+ /* Mission */
97
+ .mission { padding: 22px 24px; display: grid; gap: 14px; background: linear-gradient(180deg, var(--panel), var(--panel-2)); }
98
+ .mission-outcome { font-family: var(--serif); font-size: 18px; line-height: 1.45; color: var(--ink-2); max-width: 70ch; }
99
+ .stage { display: flex; gap: 6px; flex-wrap: wrap; }
100
+ .stage span { font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
101
+ .stage span.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
102
+ .stage span.past { color: var(--ink-2); background: var(--accent-soft); border-color: transparent; }
103
+ .measures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: var(--radius-sm); overflow: hidden; }
104
+ .measures > div { background: var(--panel); padding: 10px 12px; }
105
+ .measures strong { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
106
+ @media (max-width: 600px) { .measures { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
76
107
 
77
- .tasks { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-direction: column; gap: 6px; }
78
- .task { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
79
- .task.open { box-shadow: var(--shadow); }
80
- .task-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
81
- .task-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; flex: none; }
82
- .title { flex: 1; text-align: left; border: 0; background: none; padding: 2px 0; cursor: pointer; }
83
- .task.done .title { color: var(--muted); text-decoration: line-through; }
84
- .title-input { flex: 1; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
85
- .by { font-size: 12px; }
86
- .task-detail { border-top: 1px solid var(--line); padding: 14px 16px 16px 42px; display: flex; flex-direction: column; gap: 14px; }
87
- .field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
88
- textarea { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); resize: vertical; color: var(--ink); }
89
- .notes-title { font-size: 13px; font-weight: 600; }
90
- .note { padding: 8px 10px; border-left: 2px solid var(--accent); background: var(--bg); border-radius: 0 8px 8px 0; margin-top: 6px; }
91
- .note-meta { font-size: 12px; }
92
- .note-text { white-space: pre-wrap; }
93
- .note-form, .inline-form { display: flex; gap: 8px; margin-top: 8px; }
94
- .note-form input, .inline-form input { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
95
- .row-end { display: flex; justify-content: flex-end; }
96
- .small-text { font-size: 13px; margin: 4px 0; }
108
+ /* Next action */
109
+ .next { display: flex; gap: 16px; align-items: center; padding: 16px 18px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
110
+ .next .grow p { color: var(--ink-2); font-size: 14px; }
111
+ @media (max-width: 600px) { .next { flex-direction: column; align-items: stretch; } }
97
112
 
98
- button.primary { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 8px; padding: 8px 14px; font-weight: 600; cursor: pointer; }
99
- button.secondary { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; cursor: pointer; }
100
- button.secondary:hover { border-color: var(--muted); }
101
- button:disabled { opacity: 0.5; cursor: default; }
102
- button.ghost { background: none; border: 0; cursor: pointer; color: inherit; font-size: 18px; line-height: 1; }
103
- button.icon { color: var(--muted); font-size: 14px; opacity: 0; }
104
- .task-row:hover .icon, .task-row .icon:focus { opacity: 1; }
105
- .danger-link { background: none; border: 0; color: var(--danger); cursor: pointer; font-size: 13px; }
106
- .wide { width: 100%; text-align: left; }
107
- .stack { display: flex; flex-direction: column; gap: 8px; }
108
- code.block { display: block; padding: 8px 10px; border-radius: 6px; background: rgba(127, 127, 127, 0.12); font-size: 12px; word-break: break-all; }
113
+ /* Badges and pills */
114
+ .badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; line-height: 18px; padding: 1px 8px; border-radius: 999px; background: var(--line); color: var(--ink-2); white-space: nowrap; font-weight: 550; }
115
+ .badge.agent { background: var(--agent-soft); color: var(--agent); }
116
+ .badge.ok { background: var(--ok-soft); color: var(--ok); }
117
+ .badge.warn { background: var(--warn-soft); color: var(--warn); }
118
+ .badge.danger { background: var(--danger-soft); color: var(--danger); }
119
+ .badge.accent { background: var(--accent-soft); color: var(--accent); }
120
+ .badge.outline { background: none; border: 1px dashed var(--line-strong); }
121
+ .dot-status { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
122
+ .s-not-started { background: var(--line-strong); }
123
+ .s-on-track { background: var(--ok); }
124
+ .s-at-risk { background: var(--warn); }
125
+ .s-blocked { background: var(--danger); }
126
+ .s-done { background: var(--accent); }
127
+ .meter { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; display: flex; }
128
+ .meter i { display: block; height: 100%; }
129
+ .meter .m-done { background: var(--accent); }
130
+ .meter .m-active { background: var(--agent); }
131
+ .meter .m-blocked { background: var(--danger); }
109
132
 
110
- .empty { margin-top: 12vh; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
111
- .empty.small { margin-top: 36px; }
112
- .empty p { margin: 0; }
113
- .center { flex: 1; display: grid; place-items: center; padding: 40px; }
114
- .card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; box-shadow: var(--shadow); }
115
- .narrow { width: min(420px, 100%); }
116
- .card h1 { margin-bottom: 8px; }
117
- .error-text { color: var(--danger); }
118
- .pad { padding: 12px 0; }
119
- .footer { padding: 14px 20px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); text-align: center; }
133
+ /* Controls */
134
+ .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--panel); cursor: pointer; font-weight: 550; font-size: 14px; white-space: nowrap; }
135
+ .btn:hover { border-color: var(--ink-2); }
136
+ .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
137
+ .btn.primary:hover { filter: brightness(1.05); }
138
+ .btn.agent { background: var(--agent); border-color: var(--agent); color: #fff; }
139
+ .btn.danger { color: var(--danger); }
140
+ .btn.ghost { border-color: transparent; background: none; }
141
+ .btn.small { padding: 4px 10px; font-size: 13px; }
142
+ .btn:disabled { opacity: 0.55; cursor: default; }
143
+ .field { display: grid; gap: 5px; }
144
+ .field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
145
+ .input, .textarea, .select { width: 100%; padding: 9px 11px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--panel); }
146
+ .textarea { min-height: 84px; resize: vertical; }
147
+ .input:focus, .textarea:focus, .select:focus, .btn:focus-visible, button:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 1px; }
148
+ .chips { display: flex; gap: 6px; flex-wrap: wrap; }
149
+ .chip { border: 1px solid var(--line-strong); background: var(--panel); border-radius: 999px; padding: 4px 12px; font-size: 13px; cursor: pointer; }
150
+ .chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
151
+ .error { color: var(--danger); background: var(--danger-soft); padding: 8px 12px; border-radius: var(--radius-sm); font-size: 14px; }
152
+ .empty { padding: 28px 20px; text-align: center; color: var(--muted); display: grid; gap: 8px; justify-items: center; }
153
+ .empty strong { color: var(--ink); font-weight: 600; }
120
154
 
121
- @media (max-width: 720px) {
122
- .workspace { grid-template-columns: 1fr; }
123
- .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
124
- .main { padding: 20px 16px 48px; }
125
- .topbar { flex-wrap: wrap; padding: 10px 16px; }
126
- .topbar-right { flex-wrap: wrap; gap: 10px; min-width: 0; }
127
- .identity, .identity select { max-width: 100%; min-width: 0; }
128
- .task-detail { padding-left: 16px; }
129
- }
155
+ /* Work */
156
+ .work { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
157
+ @media (max-width: 820px) { .work { grid-template-columns: 1fr; } }
158
+ .streams button { display: grid; gap: 6px; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid transparent; border-radius: var(--radius-sm); background: none; cursor: pointer; }
159
+ .streams button[aria-current="true"] { background: var(--panel); border-color: var(--line); box-shadow: var(--shadow); }
160
+ @media (max-width: 820px) { .streams { display: flex; overflow-x: auto; gap: 6px; } .streams button { min-width: 170px; } }
161
+ .task { display: flex; align-items: center; gap: 12px; padding: 11px 16px; width: 100%; border: 0; background: none; text-align: left; cursor: pointer; }
162
+ .task:hover { background: var(--panel-2); }
163
+ .check { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-strong); flex: none; display: grid; place-items: center; font-size: 11px; }
164
+ .check.done { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
165
+ .check.active { border-color: var(--agent); background: var(--agent-soft); }
166
+ .check.blocked { border-color: var(--danger); }
167
+ .drawer-bg { position: fixed; inset: 0; background: rgb(0 0 0 / 0.25); z-index: 30; }
168
+ .drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: var(--panel); border-left: 1px solid var(--line); z-index: 31; display: flex; flex-direction: column; box-shadow: -8px 0 32px rgb(0 0 0 / 0.08); }
169
+ .drawer-body { overflow: auto; padding: 18px 20px; display: grid; gap: 16px; align-content: start; }
170
+ .msg { display: grid; gap: 3px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--line); }
171
+ .msg.agent { background: var(--agent-soft); border-color: transparent; }
172
+
173
+ /* Context and decisions */
174
+ .ctx-title { font-weight: 600; }
175
+ .ctx-body { color: var(--ink-2); font-size: 14px; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
176
+ .ctx-body.full { -webkit-line-clamp: unset; display: block; }
177
+ .decision { padding: 16px 18px; display: grid; gap: 8px; }
178
+ .decision blockquote { margin: 0; padding-left: 12px; border-left: 3px solid var(--accent); font-family: var(--serif); font-size: 16px; }
179
+ .superseded { opacity: 0.7; }
130
180
 
131
- /* Account sign-in (auth.accounts) */
132
- button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
133
- button.ghost.signout { font-size: 14px; }
134
- .card form.stack input { padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
181
+ /* Agent */
182
+ .agent-head { display: flex; gap: 14px; align-items: center; padding: 18px 20px; }
183
+ .agent-avatar { width: 42px; height: 42px; border-radius: 12px; background: var(--agent); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
184
+ .transcript { display: grid; gap: 10px; padding: 16px 18px; max-height: 62vh; overflow: auto; }
185
+ .bubble { padding: 10px 14px; border-radius: 14px; max-width: 85%; white-space: pre-wrap; font-size: 14px; }
186
+ .bubble.user { background: var(--accent); color: var(--accent-ink); justify-self: end; border-bottom-right-radius: 4px; }
187
+ .bubble.assistant { background: var(--panel-2); border: 1px solid var(--line); justify-self: start; border-bottom-left-radius: 4px; }
188
+ .call { display: grid; gap: 4px; font-size: 13px; padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--panel); justify-self: stretch; }
189
+ .call code { font-size: 12px; color: var(--ink-2); word-break: break-word; }
190
+ .approval { border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-soft); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 10px; }
191
+ .composer { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); }
192
+ .composer .textarea { min-height: 44px; height: 44px; }
193
+ .suggest { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 12px; }
194
+
195
+ /* Activity */
196
+ .tl-item { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; padding: 10px 18px; align-items: start; }
197
+ .tl-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--line); font-size: 13px; }
198
+ .tl-icon.agent { background: var(--agent-soft); color: var(--agent); }
199
+ .tl-icon.person { background: var(--accent-soft); color: var(--accent); }
200
+
201
+ /* Onboarding and auth */
202
+ .center { min-height: 100%; display: grid; place-items: center; padding: 32px 16px; }
203
+ .welcome { width: min(640px, 100%); display: grid; gap: 22px; }
204
+ .choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
205
+ .choice button { text-align: left; padding: 16px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--panel); cursor: pointer; display: grid; gap: 6px; }
206
+ .choice button[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
207
+ @media (max-width: 600px) { .choice { grid-template-columns: 1fr; } }
208
+ .live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
209
+ .live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
210
+ .live.off::before { background: var(--warn); }
211
+
212
+ /* Theme switch (src/theme.tsx) */
213
+ .theme-toggle { display: inline-flex; padding: 2px; gap: 2px; border: 1px solid var(--line); border-radius: 8px; width: max-content; }
214
+ .theme-toggle button { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
215
+ .theme-toggle button:hover { color: var(--ink); }
216
+ .theme-toggle button.on { background: var(--accent-soft); color: var(--accent); }
217
+ .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }