critiqs-react 0.3.0 → 0.4.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/AGENT_SETUP.md +198 -66
- package/README.md +214 -31
- package/bin/critiqs.mjs +3 -1
- package/dist/index.js +16877 -4770
- package/dist/server/index.d.ts +1 -87
- package/dist/server/index.js +1 -4889
- package/package.json +6 -5
- package/bin/cli.d.mts +0 -21
- package/bin/cli.mjs +0 -293
- package/bin/env.d.mts +0 -41
- package/bin/env.mjs +0 -384
- package/bin/init.d.mts +0 -126
- package/bin/init.mjs +0 -965
- package/bin/mcp.d.mts +0 -20
- package/bin/mcp.mjs +0 -314
- package/bin/setup.d.mts +0 -183
- package/bin/setup.mjs +0 -1054
- package/dist/backend/convex/_generated/api.d.ts +0 -95
- package/dist/backend/convex/_generated/api.js +0 -23
- package/dist/backend/convex/_generated/dataModel.d.ts +0 -60
- package/dist/backend/convex/_generated/server.d.ts +0 -162
- package/dist/backend/convex/_generated/server.js +0 -101
- package/dist/backend/convex/ai.ts +0 -93
- package/dist/backend/convex/aiSettings.ts +0 -43
- package/dist/backend/convex/auth.config.ts +0 -18
- package/dist/backend/convex/captureHttp.ts +0 -96
- package/dist/backend/convex/captures.ts +0 -167
- package/dist/backend/convex/crons.ts +0 -14
- package/dist/backend/convex/deviceSignIn.ts +0 -151
- package/dist/backend/convex/grouping.ts +0 -41
- package/dist/backend/convex/http.ts +0 -724
- package/dist/backend/convex/lib/ai.ts +0 -6
- package/dist/backend/convex/lib/links.ts +0 -12
- package/dist/backend/convex/lib/pages.ts +0 -207
- package/dist/backend/convex/lib/r2.ts +0 -75
- package/dist/backend/convex/lib/store.ts +0 -509
- package/dist/backend/convex/lib/tokens.ts +0 -101
- package/dist/backend/convex/lib/validators.ts +0 -73
- package/dist/backend/convex/lib/vendor/aws4fetch.js +0 -289
- package/dist/backend/convex/lib/vendor/critiqs_ai.js +0 -49081
- package/dist/backend/convex/lib/vendor/critiqs_core.js +0 -385
- package/dist/backend/convex/lib/vendor/critiqs_server.js +0 -3108
- package/dist/backend/convex/notificationEmails.ts +0 -61
- package/dist/backend/convex/notifications.ts +0 -182
- package/dist/backend/convex/plans.ts +0 -67
- package/dist/backend/convex/projects.ts +0 -46
- package/dist/backend/convex/schema.ts +0 -343
- package/dist/backend/convex/search.ts +0 -26
- package/dist/backend/convex/signIn.ts +0 -368
- package/dist/backend/convex/tags.ts +0 -68
- package/dist/backend/convex/threads.ts +0 -146
- package/dist/backend/convex/users.ts +0 -13
- package/dist/server/chunks/driver-n9zpr0k3.js +0 -21
- package/dist/server/chunks/index-9bg7tmnq.js +0 -522
- package/dist/server/chunks/index-askcfn7t.js +0 -148
- package/dist/server/chunks/providers-rv184xvj.js +0 -48444
- package/dist/server/chunks/token-kzddms7r.js +0 -63
- package/dist/server/chunks/token-util-k8bee1wc.js +0 -4
package/dist/server/index.d.ts
CHANGED
|
@@ -1,87 +1 @@
|
|
|
1
|
-
|
|
2
|
-
// app's own Node or Bun server, storing feedback in a SQLite file.
|
|
3
|
-
// Built-in SQLite requires Node.js 22.13 or later, or Bun; the setup CLI also supports Node.js 20.
|
|
4
|
-
|
|
5
|
-
/** Someone the host app has already signed in. */
|
|
6
|
-
export interface HostUser {
|
|
7
|
-
/** The host app's permanent ID for them. */
|
|
8
|
-
id: string;
|
|
9
|
-
name: string;
|
|
10
|
-
/** Where mention emails go; the host app vouches that it is theirs. */
|
|
11
|
-
email: string;
|
|
12
|
-
pictureUrl?: string | null;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/** The few calls Critiqs needs from a SQLite library. */
|
|
16
|
-
export interface SqlDriver {
|
|
17
|
-
exec(sql: string): void;
|
|
18
|
-
run(sql: string, params?: unknown[]): void;
|
|
19
|
-
get<T>(sql: string, params?: unknown[]): T | undefined;
|
|
20
|
-
all<T>(sql: string, params?: unknown[]): T[];
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface CritiqsHandlerOptions {
|
|
24
|
-
/** A SQLite file path (Bun's SQLite under Bun, node:sqlite under Node), or a driver. */
|
|
25
|
-
database: string | SqlDriver;
|
|
26
|
-
/** Where the handler is mounted; the component's `backend` is this path. Default `/critiqs`. */
|
|
27
|
-
basePath?: string;
|
|
28
|
-
/** Resend key and sender, for sign-in codes and mention emails. */
|
|
29
|
-
email?: { resendApiKey: string; from: string };
|
|
30
|
-
/**
|
|
31
|
-
* Uses the host app's own sign-in instead of Critiqs's email codes: returns
|
|
32
|
-
* who made the request, or null when nobody is signed in to the app.
|
|
33
|
-
*/
|
|
34
|
-
identify?: (request: Request) => HostUser | null | Promise<HostUser | null>;
|
|
35
|
-
/**
|
|
36
|
-
* Shows sign-in codes on screen instead of emailing them, only for requests
|
|
37
|
-
* whose connection comes from this computer (see `fetch`'s `remoteAddress`).
|
|
38
|
-
*/
|
|
39
|
-
developmentSignIn?: boolean;
|
|
40
|
-
/**
|
|
41
|
-
* AI for automatic tag grouping, natural-language search, and insights. The
|
|
42
|
-
* provider here is the default for every project; with `encryptionKey`,
|
|
43
|
-
* project owners can also connect their own provider in Critiqs, whose keys
|
|
44
|
-
* are stored encrypted. Read these from your server's environment; never
|
|
45
|
-
* put keys in browser code. Search and grouping still work without AI.
|
|
46
|
-
*/
|
|
47
|
-
ai?: CritiqsAiOptions;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export interface CritiqsAiOptions {
|
|
51
|
-
provider?: "openai" | "anthropic" | "google" | "gateway" | "compatible";
|
|
52
|
-
model?: string;
|
|
53
|
-
apiKey?: string;
|
|
54
|
-
/** The provider's address; required for an OpenAI-compatible endpoint, such as `http://localhost:11434/v1` for Ollama. */
|
|
55
|
-
baseURL?: string;
|
|
56
|
-
/** At least 32 random characters, such as from `openssl rand -base64 32`; lets owners store their own keys, encrypted. */
|
|
57
|
-
encryptionKey?: string;
|
|
58
|
-
/** Endpoint addresses owners may enter, such as `https://llm.example.com/v1`. */
|
|
59
|
-
allowedEndpoints?: string[];
|
|
60
|
-
/** Allows `http://` and private-network addresses among `allowedEndpoints`, for providers on your own network. */
|
|
61
|
-
allowLocalEndpoints?: boolean;
|
|
62
|
-
/** Longest a model request may take. Default 30 seconds. */
|
|
63
|
-
timeoutMs?: number;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export interface CritiqsHandler {
|
|
67
|
-
/**
|
|
68
|
-
* Answers requests under `basePath`; others get 404. `remoteAddress` is the
|
|
69
|
-
* connection's address (Bun: `server.requestIP(request)?.address`), which
|
|
70
|
-
* development sign-in needs to know a request comes from this computer.
|
|
71
|
-
*/
|
|
72
|
-
fetch(request: Request, connection?: { remoteAddress?: string }): Promise<Response>;
|
|
73
|
-
/** Sends due mention emails now; this also runs every minute. */
|
|
74
|
-
deliverMentionEmails(): Promise<void>;
|
|
75
|
-
/** Groups tags waiting for automatic grouping now; this also runs every minute. */
|
|
76
|
-
groupTags(): Promise<void>;
|
|
77
|
-
/** Stops the mention email and grouping timer. */
|
|
78
|
-
close(): void;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/** Creates Critiqs's request handler for a host app's server. */
|
|
82
|
-
export declare function createCritiqsHandler(options: CritiqsHandlerOptions): Promise<CritiqsHandler>;
|
|
83
|
-
|
|
84
|
-
/** The handler as a Node `(req, res)` listener, for `http.createServer` or Express. */
|
|
85
|
-
export declare function toNodeListener(
|
|
86
|
-
handler: CritiqsHandler,
|
|
87
|
-
): (request: import("node:http").IncomingMessage, response: import("node:http").ServerResponse) => Promise<void>;
|
|
1
|
+
export * from "critiqs/server";
|