cowriter 0.1.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 +283 -0
- package/assets/cowriter-header.png +0 -0
- package/frontend/app/api/cowriter/codex/route.ts +65 -0
- package/frontend/app/api/cowriter/cover/route.ts +45 -0
- package/frontend/app/api/cowriter/events/hub.ts +24 -0
- package/frontend/app/api/cowriter/events/route.ts +77 -0
- package/frontend/app/api/cowriter/route.ts +83 -0
- package/frontend/app/api/cowriter/selection/route.ts +69 -0
- package/frontend/app/api/cowriter/selection/store.ts +27 -0
- package/frontend/app/globals.css +274 -0
- package/frontend/app/layout.tsx +14 -0
- package/frontend/app/page.tsx +1554 -0
- package/frontend/components/ui.tsx +66 -0
- package/frontend/lib/highlight.ts +53 -0
- package/frontend/lib/markdown.ts +47 -0
- package/frontend/lib/project.ts +335 -0
- package/frontend/lib/skills.ts +15 -0
- package/frontend/lib/turndown-plugin-gfm.d.ts +5 -0
- package/frontend/lib/types.ts +143 -0
- package/frontend/lib/utils.ts +6 -0
- package/frontend/lib/writing-skills.json +58 -0
- package/frontend/next-env.d.ts +6 -0
- package/frontend/next.config.js +10 -0
- package/frontend/package.json +44 -0
- package/frontend/postcss.config.mjs +7 -0
- package/frontend/tsconfig.json +22 -0
- package/package.json +62 -0
- package/scripts/cowriter-ai.mjs +1126 -0
- package/templates/init/.codex/skills/cowriter/SKILL.md +273 -0
- package/templates/init/.codex/skills/cowriter/references/actions.md +52 -0
- package/templates/init/.codex/skills/cowriter/references/character-voice.md +23 -0
- package/templates/init/.codex/skills/cowriter/references/context-priming.md +15 -0
- package/templates/init/.codex/skills/cowriter/references/continuity-review.md +22 -0
- package/templates/init/.codex/skills/cowriter/references/import-existing.md +16 -0
- package/templates/init/.codex/skills/cowriter/references/onboarding.md +45 -0
- package/templates/init/.codex/skills/cowriter/references/project-model.md +45 -0
- package/templates/init/.codex/skills/cowriter/references/prose-diagnostics.md +33 -0
- package/templates/init/.codex/skills/cowriter/references/prose-review.md +22 -0
- package/templates/init/.codex/skills/cowriter/references/scene-planning.md +28 -0
- package/templates/init/.codex/skills/cowriter/references/state-updates.md +22 -0
- package/templates/init/.codex/skills/cowriter/references/title-brainstorming.md +27 -0
- package/templates/init/.cowriter/project.yaml +3 -0
- package/templates/init/.cowriter/reports/.gitkeep +1 -0
- package/templates/init/AGENTS.md +79 -0
- package/templates/init/chapters/001-opening.md +0 -0
- package/templates/init/characters/primary-character.yaml +6 -0
- package/templates/init/outline.yaml +4 -0
- package/templates/init/story.yaml +8 -0
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
color: #292524;
|
|
5
|
+
background: #f3efe7;
|
|
6
|
+
font-family: Geist, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
* {
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
html,
|
|
14
|
+
body {
|
|
15
|
+
min-width: 320px;
|
|
16
|
+
min-height: 100%;
|
|
17
|
+
margin: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
button,
|
|
21
|
+
input,
|
|
22
|
+
textarea {
|
|
23
|
+
font: inherit;
|
|
24
|
+
letter-spacing: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.font-book {
|
|
28
|
+
font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.book-stage {
|
|
32
|
+
background: #f3efe7;
|
|
33
|
+
padding: 1rem;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.book-page {
|
|
37
|
+
--book-page-width: min(6in, calc(100vw - 2rem), calc((100dvh - 5rem) * 2 / 3));
|
|
38
|
+
--book-content-width: 100%;
|
|
39
|
+
--book-page-gap: 1.2in;
|
|
40
|
+
--manuscript-page-offset: 0px;
|
|
41
|
+
width: var(--book-page-width);
|
|
42
|
+
height: calc(var(--book-page-width) * 1.5);
|
|
43
|
+
overflow: hidden;
|
|
44
|
+
border: 1px solid rgba(161, 161, 170, 0.6);
|
|
45
|
+
border-radius: 4px;
|
|
46
|
+
background: #fffdf8;
|
|
47
|
+
padding: 0.7in 0.58in 0.76in;
|
|
48
|
+
box-shadow:
|
|
49
|
+
0 30px 80px -48px rgba(87, 83, 78, 0.55),
|
|
50
|
+
inset 0 1px 0 rgba(255, 255, 255, 0.8);
|
|
51
|
+
touch-action: none;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.book-page--cover {
|
|
55
|
+
display: grid;
|
|
56
|
+
place-items: stretch;
|
|
57
|
+
padding: 0;
|
|
58
|
+
background: #e7e0d3;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.book-cover-image {
|
|
62
|
+
width: 100%;
|
|
63
|
+
height: 100%;
|
|
64
|
+
object-fit: contain;
|
|
65
|
+
user-select: none;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.book-page-clip {
|
|
69
|
+
height: 100%;
|
|
70
|
+
overflow: hidden;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.book-page-clip > div {
|
|
74
|
+
height: 100%;
|
|
75
|
+
min-height: 100%;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.book-page .ProseMirror {
|
|
79
|
+
width: var(--book-content-width);
|
|
80
|
+
height: 100%;
|
|
81
|
+
min-height: 100%;
|
|
82
|
+
max-height: 100%;
|
|
83
|
+
outline: none;
|
|
84
|
+
overflow: visible;
|
|
85
|
+
column-fill: auto;
|
|
86
|
+
column-gap: var(--book-page-gap);
|
|
87
|
+
column-width: var(--book-content-width);
|
|
88
|
+
font-size: 15px;
|
|
89
|
+
line-height: 1.62;
|
|
90
|
+
transform: translateX(calc(-1 * var(--manuscript-page-offset)));
|
|
91
|
+
transition: transform 220ms ease-out;
|
|
92
|
+
will-change: transform;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.book-page .ProseMirror p {
|
|
96
|
+
margin: 0 0 0.9em;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.book-page .ProseMirror blockquote {
|
|
100
|
+
margin: 0 0 1em;
|
|
101
|
+
padding: 0.02rem 0 0.02rem 0.85rem;
|
|
102
|
+
border-left: 2px solid rgba(120, 113, 108, 0.58);
|
|
103
|
+
color: #44403c;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.book-page .ProseMirror blockquote p:last-child {
|
|
107
|
+
margin-bottom: 0;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.book-page .ProseMirror table {
|
|
111
|
+
width: 100%;
|
|
112
|
+
margin: 0 0 1em;
|
|
113
|
+
border-collapse: collapse;
|
|
114
|
+
table-layout: fixed;
|
|
115
|
+
break-inside: avoid;
|
|
116
|
+
font-size: 13px;
|
|
117
|
+
line-height: 1.4;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.book-page .ProseMirror th,
|
|
121
|
+
.book-page .ProseMirror td {
|
|
122
|
+
position: relative;
|
|
123
|
+
min-width: 1em;
|
|
124
|
+
border: 1px solid rgba(120, 113, 108, 0.5);
|
|
125
|
+
padding: 0.28rem 0.38rem;
|
|
126
|
+
vertical-align: top;
|
|
127
|
+
word-break: break-word;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.book-page .ProseMirror th {
|
|
131
|
+
background: rgba(214, 211, 209, 0.35);
|
|
132
|
+
font-weight: 650;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.book-page .ProseMirror .selectedCell::after {
|
|
136
|
+
position: absolute;
|
|
137
|
+
inset: 0;
|
|
138
|
+
z-index: 2;
|
|
139
|
+
content: "";
|
|
140
|
+
pointer-events: none;
|
|
141
|
+
background: rgba(180, 83, 9, 0.16);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.book-page .ProseMirror ::selection {
|
|
145
|
+
background: rgba(180, 83, 9, 0.28);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.book-page .ProseMirror h1,
|
|
149
|
+
.book-page .ProseMirror h2,
|
|
150
|
+
.book-page .ProseMirror h3 {
|
|
151
|
+
margin: 0 0 1rem;
|
|
152
|
+
font-family: Geist, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
|
|
153
|
+
font-weight: 650;
|
|
154
|
+
line-height: 1.15;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.book-page .ProseMirror p.is-editor-empty:first-child::before {
|
|
158
|
+
color: #a1a1aa;
|
|
159
|
+
content: attr(data-placeholder);
|
|
160
|
+
float: left;
|
|
161
|
+
height: 0;
|
|
162
|
+
pointer-events: none;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.report-markdown {
|
|
166
|
+
font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
|
|
167
|
+
font-size: 15px;
|
|
168
|
+
line-height: 1.68;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.report-markdown h1,
|
|
172
|
+
.report-markdown h2,
|
|
173
|
+
.report-markdown h3 {
|
|
174
|
+
margin: 1.4rem 0 0.65rem;
|
|
175
|
+
font-family: Geist, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
|
|
176
|
+
font-weight: 650;
|
|
177
|
+
line-height: 1.18;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.report-markdown h1:first-child,
|
|
181
|
+
.report-markdown h2:first-child,
|
|
182
|
+
.report-markdown h3:first-child {
|
|
183
|
+
margin-top: 0;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.report-markdown h1 {
|
|
187
|
+
font-size: 1.45rem;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.report-markdown h2 {
|
|
191
|
+
font-size: 1.15rem;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.report-markdown h3 {
|
|
195
|
+
font-size: 1rem;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.report-markdown p,
|
|
199
|
+
.report-markdown ul,
|
|
200
|
+
.report-markdown ol,
|
|
201
|
+
.report-markdown blockquote,
|
|
202
|
+
.report-markdown pre,
|
|
203
|
+
.report-markdown table {
|
|
204
|
+
margin: 0 0 1rem;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.report-markdown ul,
|
|
208
|
+
.report-markdown ol {
|
|
209
|
+
padding-left: 1.35rem;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.report-markdown li + li {
|
|
213
|
+
margin-top: 0.25rem;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.report-markdown code {
|
|
217
|
+
border-radius: 3px;
|
|
218
|
+
background: rgba(68, 64, 60, 0.08);
|
|
219
|
+
padding: 0.06rem 0.22rem;
|
|
220
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
221
|
+
font-size: 0.88em;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.report-markdown pre {
|
|
225
|
+
overflow: auto;
|
|
226
|
+
border: 1px solid rgba(120, 113, 108, 0.25);
|
|
227
|
+
background: rgba(68, 64, 60, 0.06);
|
|
228
|
+
padding: 0.85rem;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.report-markdown pre code {
|
|
232
|
+
background: transparent;
|
|
233
|
+
padding: 0;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.report-markdown blockquote {
|
|
237
|
+
border-left: 2px solid rgba(120, 113, 108, 0.5);
|
|
238
|
+
padding-left: 0.85rem;
|
|
239
|
+
color: #57534e;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.report-markdown table {
|
|
243
|
+
width: 100%;
|
|
244
|
+
border-collapse: collapse;
|
|
245
|
+
font-family: Geist, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
|
|
246
|
+
font-size: 13px;
|
|
247
|
+
line-height: 1.45;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.report-markdown th,
|
|
251
|
+
.report-markdown td {
|
|
252
|
+
border: 1px solid rgba(120, 113, 108, 0.28);
|
|
253
|
+
padding: 0.4rem 0.5rem;
|
|
254
|
+
text-align: left;
|
|
255
|
+
vertical-align: top;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.report-markdown th {
|
|
259
|
+
background: rgba(214, 211, 209, 0.38);
|
|
260
|
+
font-weight: 650;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
@media (max-width: 1023px) {
|
|
264
|
+
.book-page {
|
|
265
|
+
--book-page-width: min(6in, calc(100vw - 2rem), calc((100dvh - 5rem) * 2 / 3));
|
|
266
|
+
padding: 0.45in 0.36in 0.5in;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
@media (prefers-reduced-motion: reduce) {
|
|
271
|
+
.book-page .ProseMirror {
|
|
272
|
+
transition: none;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "./globals.css";
|
|
2
|
+
|
|
3
|
+
export const metadata = {
|
|
4
|
+
title: "Cowriter",
|
|
5
|
+
description: "A local macOS story-writing app with Codex built in.",
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
9
|
+
return (
|
|
10
|
+
<html lang="en">
|
|
11
|
+
<body>{children}</body>
|
|
12
|
+
</html>
|
|
13
|
+
);
|
|
14
|
+
}
|