@goscribe/server 1.2.0 → 1.3.1
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/check-difficulty.cjs +14 -0
- package/check-questions.cjs +14 -0
- package/db-summary.cjs +22 -0
- package/dist/context.d.ts +5 -1
- package/dist/lib/activity_human_description.d.ts +13 -0
- package/dist/lib/activity_human_description.js +221 -0
- package/dist/lib/activity_human_description.test.d.ts +1 -0
- package/dist/lib/activity_human_description.test.js +16 -0
- package/dist/lib/activity_log_service.d.ts +87 -0
- package/dist/lib/activity_log_service.js +276 -0
- package/dist/lib/activity_log_service.test.d.ts +1 -0
- package/dist/lib/activity_log_service.test.js +27 -0
- package/dist/lib/ai-session.d.ts +15 -2
- package/dist/lib/ai-session.js +147 -85
- package/dist/lib/constants.d.ts +13 -0
- package/dist/lib/constants.js +12 -0
- package/dist/lib/email.d.ts +11 -0
- package/dist/lib/email.js +193 -0
- package/dist/lib/env.d.ts +13 -0
- package/dist/lib/env.js +16 -0
- package/dist/lib/inference.d.ts +4 -1
- package/dist/lib/inference.js +3 -3
- package/dist/lib/logger.d.ts +4 -4
- package/dist/lib/logger.js +30 -8
- package/dist/lib/notification-service.d.ts +152 -0
- package/dist/lib/notification-service.js +473 -0
- package/dist/lib/notification-service.test.d.ts +1 -0
- package/dist/lib/notification-service.test.js +87 -0
- package/dist/lib/prisma.d.ts +2 -1
- package/dist/lib/prisma.js +5 -1
- package/dist/lib/pusher.d.ts +23 -0
- package/dist/lib/pusher.js +69 -5
- package/dist/lib/retry.d.ts +15 -0
- package/dist/lib/retry.js +37 -0
- package/dist/lib/storage.js +2 -2
- package/dist/lib/stripe.d.ts +9 -0
- package/dist/lib/stripe.js +36 -0
- package/dist/lib/subscription_service.d.ts +37 -0
- package/dist/lib/subscription_service.js +654 -0
- package/dist/lib/usage_service.d.ts +26 -0
- package/dist/lib/usage_service.js +59 -0
- package/dist/lib/worksheet-generation.d.ts +91 -0
- package/dist/lib/worksheet-generation.js +95 -0
- package/dist/lib/worksheet-generation.test.d.ts +1 -0
- package/dist/lib/worksheet-generation.test.js +20 -0
- package/dist/lib/workspace-access.d.ts +18 -0
- package/dist/lib/workspace-access.js +13 -0
- package/dist/routers/_app.d.ts +1349 -253
- package/dist/routers/_app.js +10 -0
- package/dist/routers/admin.d.ts +361 -0
- package/dist/routers/admin.js +633 -0
- package/dist/routers/annotations.d.ts +219 -0
- package/dist/routers/annotations.js +187 -0
- package/dist/routers/auth.d.ts +88 -7
- package/dist/routers/auth.js +339 -19
- package/dist/routers/chat.d.ts +6 -12
- package/dist/routers/copilot.d.ts +199 -0
- package/dist/routers/copilot.js +571 -0
- package/dist/routers/flashcards.d.ts +47 -81
- package/dist/routers/flashcards.js +143 -27
- package/dist/routers/members.d.ts +36 -7
- package/dist/routers/members.js +200 -19
- package/dist/routers/notifications.d.ts +99 -0
- package/dist/routers/notifications.js +127 -0
- package/dist/routers/payment.d.ts +89 -0
- package/dist/routers/payment.js +403 -0
- package/dist/routers/podcast.d.ts +8 -13
- package/dist/routers/podcast.js +54 -31
- package/dist/routers/studyguide.d.ts +1 -29
- package/dist/routers/studyguide.js +80 -71
- package/dist/routers/worksheets.d.ts +105 -38
- package/dist/routers/worksheets.js +258 -68
- package/dist/routers/workspace.d.ts +139 -60
- package/dist/routers/workspace.js +455 -315
- package/dist/scripts/purge-deleted-users.d.ts +1 -0
- package/dist/scripts/purge-deleted-users.js +149 -0
- package/dist/server.js +130 -10
- package/dist/services/flashcard-progress.service.d.ts +18 -66
- package/dist/services/flashcard-progress.service.js +51 -42
- package/dist/trpc.d.ts +20 -21
- package/dist/trpc.js +150 -1
- package/mcq-test.cjs +36 -0
- package/package.json +9 -2
- package/prisma/migrations/20260413143206_init/migration.sql +873 -0
- package/prisma/schema.prisma +471 -324
- package/src/context.ts +4 -1
- package/src/lib/activity_human_description.test.ts +28 -0
- package/src/lib/activity_human_description.ts +239 -0
- package/src/lib/activity_log_service.test.ts +37 -0
- package/src/lib/activity_log_service.ts +353 -0
- package/src/lib/ai-session.ts +79 -51
- package/src/lib/email.ts +213 -29
- package/src/lib/env.ts +23 -6
- package/src/lib/inference.ts +2 -2
- package/src/lib/notification-service.test.ts +106 -0
- package/src/lib/notification-service.ts +677 -0
- package/src/lib/prisma.ts +6 -1
- package/src/lib/pusher.ts +86 -2
- package/src/lib/stripe.ts +39 -0
- package/src/lib/subscription_service.ts +722 -0
- package/src/lib/usage_service.ts +74 -0
- package/src/lib/worksheet-generation.test.ts +31 -0
- package/src/lib/worksheet-generation.ts +139 -0
- package/src/routers/_app.ts +9 -0
- package/src/routers/admin.ts +710 -0
- package/src/routers/annotations.ts +41 -0
- package/src/routers/auth.ts +338 -28
- package/src/routers/copilot.ts +719 -0
- package/src/routers/flashcards.ts +201 -68
- package/src/routers/members.ts +280 -80
- package/src/routers/notifications.ts +142 -0
- package/src/routers/payment.ts +448 -0
- package/src/routers/podcast.ts +112 -83
- package/src/routers/studyguide.ts +12 -0
- package/src/routers/worksheets.ts +289 -66
- package/src/routers/workspace.ts +329 -122
- package/src/scripts/purge-deleted-users.ts +167 -0
- package/src/server.ts +137 -11
- package/src/services/flashcard-progress.service.ts +49 -37
- package/src/trpc.ts +184 -5
- package/test-generate.js +30 -0
- package/test-ratio.cjs +9 -0
- package/zod-test.cjs +22 -0
- package/prisma/migrations/20250826124819_add_worksheet_difficulty_and_estimated_time/migration.sql +0 -213
- package/prisma/migrations/20250826133236_add_worksheet_question_progress/migration.sql +0 -31
- package/prisma/seed.mjs +0 -135
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import type { Context } from "../context.js";
|
|
2
|
+
export declare const copilot: import("@trpc/server").TRPCBuiltRouter<{
|
|
3
|
+
ctx: Context;
|
|
4
|
+
meta: object;
|
|
5
|
+
errorShape: {
|
|
6
|
+
data: {
|
|
7
|
+
zodError: string | null;
|
|
8
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
9
|
+
httpStatus: number;
|
|
10
|
+
path?: string;
|
|
11
|
+
stack?: string;
|
|
12
|
+
};
|
|
13
|
+
message: string;
|
|
14
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
15
|
+
};
|
|
16
|
+
transformer: true;
|
|
17
|
+
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
18
|
+
listConversations: import("@trpc/server").TRPCQueryProcedure<{
|
|
19
|
+
input: {
|
|
20
|
+
workspaceId: string;
|
|
21
|
+
};
|
|
22
|
+
output: {
|
|
23
|
+
id: string;
|
|
24
|
+
title: string;
|
|
25
|
+
updatedAt: Date;
|
|
26
|
+
preview: string;
|
|
27
|
+
}[];
|
|
28
|
+
meta: object;
|
|
29
|
+
}>;
|
|
30
|
+
getConversation: import("@trpc/server").TRPCQueryProcedure<{
|
|
31
|
+
input: {
|
|
32
|
+
workspaceId: string;
|
|
33
|
+
conversationId: string;
|
|
34
|
+
};
|
|
35
|
+
output: {
|
|
36
|
+
id: string;
|
|
37
|
+
title: string;
|
|
38
|
+
messages: {
|
|
39
|
+
id: string;
|
|
40
|
+
role: string;
|
|
41
|
+
content: string;
|
|
42
|
+
createdAt: Date;
|
|
43
|
+
}[];
|
|
44
|
+
};
|
|
45
|
+
meta: object;
|
|
46
|
+
}>;
|
|
47
|
+
createConversation: import("@trpc/server").TRPCMutationProcedure<{
|
|
48
|
+
input: {
|
|
49
|
+
workspaceId: string;
|
|
50
|
+
title?: string | undefined;
|
|
51
|
+
};
|
|
52
|
+
output: {
|
|
53
|
+
id: string;
|
|
54
|
+
title: string;
|
|
55
|
+
updatedAt: Date;
|
|
56
|
+
};
|
|
57
|
+
meta: object;
|
|
58
|
+
}>;
|
|
59
|
+
deleteConversation: import("@trpc/server").TRPCMutationProcedure<{
|
|
60
|
+
input: {
|
|
61
|
+
workspaceId: string;
|
|
62
|
+
conversationId: string;
|
|
63
|
+
};
|
|
64
|
+
output: {
|
|
65
|
+
success: boolean;
|
|
66
|
+
};
|
|
67
|
+
meta: object;
|
|
68
|
+
}>;
|
|
69
|
+
ask: import("@trpc/server").TRPCMutationProcedure<{
|
|
70
|
+
input: {
|
|
71
|
+
context: {
|
|
72
|
+
workspaceId: string;
|
|
73
|
+
artifactId: string;
|
|
74
|
+
artifactType: "flashcards" | "worksheet" | "study-guide" | "notes";
|
|
75
|
+
documentContent: string;
|
|
76
|
+
selectedText?: string | undefined;
|
|
77
|
+
viewportText?: string | undefined;
|
|
78
|
+
cursorPosition?: {
|
|
79
|
+
start: number;
|
|
80
|
+
end: number;
|
|
81
|
+
} | undefined;
|
|
82
|
+
metadata?: {
|
|
83
|
+
flashcardId?: string | undefined;
|
|
84
|
+
questionId?: string | undefined;
|
|
85
|
+
documentId?: string | undefined;
|
|
86
|
+
} | undefined;
|
|
87
|
+
};
|
|
88
|
+
message: string;
|
|
89
|
+
conversationId?: string | undefined;
|
|
90
|
+
};
|
|
91
|
+
output: {
|
|
92
|
+
answer: string;
|
|
93
|
+
highlights: {
|
|
94
|
+
start: number;
|
|
95
|
+
end: number;
|
|
96
|
+
label?: string | undefined;
|
|
97
|
+
}[];
|
|
98
|
+
};
|
|
99
|
+
meta: object;
|
|
100
|
+
}>;
|
|
101
|
+
explainSelection: import("@trpc/server").TRPCMutationProcedure<{
|
|
102
|
+
input: {
|
|
103
|
+
context: {
|
|
104
|
+
workspaceId: string;
|
|
105
|
+
artifactId: string;
|
|
106
|
+
artifactType: "flashcards" | "worksheet" | "study-guide" | "notes";
|
|
107
|
+
documentContent: string;
|
|
108
|
+
selectedText?: string | undefined;
|
|
109
|
+
viewportText?: string | undefined;
|
|
110
|
+
cursorPosition?: {
|
|
111
|
+
start: number;
|
|
112
|
+
end: number;
|
|
113
|
+
} | undefined;
|
|
114
|
+
metadata?: {
|
|
115
|
+
flashcardId?: string | undefined;
|
|
116
|
+
questionId?: string | undefined;
|
|
117
|
+
documentId?: string | undefined;
|
|
118
|
+
} | undefined;
|
|
119
|
+
};
|
|
120
|
+
message?: string | undefined;
|
|
121
|
+
conversationId?: string | undefined;
|
|
122
|
+
};
|
|
123
|
+
output: {
|
|
124
|
+
answer: string;
|
|
125
|
+
};
|
|
126
|
+
meta: object;
|
|
127
|
+
}>;
|
|
128
|
+
suggestHighlights: import("@trpc/server").TRPCMutationProcedure<{
|
|
129
|
+
input: {
|
|
130
|
+
context: {
|
|
131
|
+
workspaceId: string;
|
|
132
|
+
artifactId: string;
|
|
133
|
+
artifactType: "flashcards" | "worksheet" | "study-guide" | "notes";
|
|
134
|
+
documentContent: string;
|
|
135
|
+
selectedText?: string | undefined;
|
|
136
|
+
viewportText?: string | undefined;
|
|
137
|
+
cursorPosition?: {
|
|
138
|
+
start: number;
|
|
139
|
+
end: number;
|
|
140
|
+
} | undefined;
|
|
141
|
+
metadata?: {
|
|
142
|
+
flashcardId?: string | undefined;
|
|
143
|
+
questionId?: string | undefined;
|
|
144
|
+
documentId?: string | undefined;
|
|
145
|
+
} | undefined;
|
|
146
|
+
};
|
|
147
|
+
message?: string | undefined;
|
|
148
|
+
conversationId?: string | undefined;
|
|
149
|
+
};
|
|
150
|
+
output: {
|
|
151
|
+
answer: string;
|
|
152
|
+
highlights: {
|
|
153
|
+
start: number;
|
|
154
|
+
end: number;
|
|
155
|
+
label?: string | undefined;
|
|
156
|
+
}[];
|
|
157
|
+
};
|
|
158
|
+
meta: object;
|
|
159
|
+
}>;
|
|
160
|
+
generateFlashcards: import("@trpc/server").TRPCMutationProcedure<{
|
|
161
|
+
input: {
|
|
162
|
+
context: {
|
|
163
|
+
workspaceId: string;
|
|
164
|
+
artifactId: string;
|
|
165
|
+
artifactType: "flashcards" | "worksheet" | "study-guide" | "notes";
|
|
166
|
+
documentContent: string;
|
|
167
|
+
selectedText?: string | undefined;
|
|
168
|
+
viewportText?: string | undefined;
|
|
169
|
+
cursorPosition?: {
|
|
170
|
+
start: number;
|
|
171
|
+
end: number;
|
|
172
|
+
} | undefined;
|
|
173
|
+
metadata?: {
|
|
174
|
+
flashcardId?: string | undefined;
|
|
175
|
+
questionId?: string | undefined;
|
|
176
|
+
documentId?: string | undefined;
|
|
177
|
+
} | undefined;
|
|
178
|
+
};
|
|
179
|
+
message?: string | undefined;
|
|
180
|
+
numCards?: number | undefined;
|
|
181
|
+
conversationId?: string | undefined;
|
|
182
|
+
};
|
|
183
|
+
output: {
|
|
184
|
+
answer: string;
|
|
185
|
+
artifactId: string;
|
|
186
|
+
flashcards: {
|
|
187
|
+
id: string;
|
|
188
|
+
createdAt: Date;
|
|
189
|
+
artifactId: string;
|
|
190
|
+
order: number;
|
|
191
|
+
front: string;
|
|
192
|
+
back: string;
|
|
193
|
+
tags: string[];
|
|
194
|
+
acceptedAnswers: string[];
|
|
195
|
+
}[];
|
|
196
|
+
};
|
|
197
|
+
meta: object;
|
|
198
|
+
}>;
|
|
199
|
+
}>>;
|