@superforge/infra 0.0.0-stage → 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.
@@ -0,0 +1,58 @@
1
+ import { z } from "zod";
2
+ // What an app's server sends Infra for its toolbar, through `fileComment`
3
+ // (infra.ts): a comment someone logged in wrote about an element of a page,
4
+ // which the toolbar posted to the app's own /api/comments, with who they
5
+ // are. It's what Infra checks (Infra's README, "Comments"), and the
6
+ // stand-in checks it the same (stand-in.ts). An app's toolbar checks the
7
+ // comment itself with its own schema first, for its form to say what's
8
+ // wrong at once.
9
+ /** The most a comment says, in characters, as Infra takes it */
10
+ export const LONGEST_COMMENT = 5000;
11
+ /** How big one comment's body can be, in bytes, as Infra takes it */
12
+ export const COMMENT_BODY_LIMIT = 32 * 1024;
13
+ // A place or a length on the page, in whole CSS pixels: a page can be
14
+ // scrolled far, and an element can sit above its top
15
+ const coordinate = z.number().int().min(-1_000_000).max(10_000_000);
16
+ const length = z.number().int().min(0).max(10_000_000);
17
+ /**
18
+ * One call's body: what was written, the page's path and title, the
19
+ * element it's about (a CSS selector from the page's body, its tag, the
20
+ * text it shows or null, its `class`, and its box on the page), or null for
21
+ * the page as a whole, the window's size, the app's own ID for whoever
22
+ * filed it, never their email, and their browser's User-Agent, for what
23
+ * they were on, which Infra doesn't keep
24
+ */
25
+ export const filed_comment = z.object({
26
+ body: z.string().trim().min(1).max(LONGEST_COMMENT),
27
+ path: z
28
+ .string()
29
+ .max(2048)
30
+ .regex(/^\/[^?#]*$/),
31
+ title: z.string().trim().max(200).nullable(),
32
+ element: z
33
+ .object({
34
+ selector: z.string().trim().min(1).max(1000),
35
+ tag: z
36
+ .string()
37
+ .max(64)
38
+ .regex(/^[a-z][a-z0-9-]*$/),
39
+ text: z.string().max(1000).nullable(),
40
+ classes: z.string().max(1000).nullable(),
41
+ box: z.object({
42
+ x: coordinate,
43
+ y: coordinate,
44
+ width: length,
45
+ height: length
46
+ })
47
+ })
48
+ .nullable(),
49
+ viewport: z.object({ width: length, height: length }).nullable(),
50
+ user: z
51
+ .string()
52
+ .trim()
53
+ .min(1)
54
+ .max(128)
55
+ .refine((id) => !id.includes("@"), { message: "An email, not an ID" })
56
+ .nullable(),
57
+ user_agent: z.string().max(1024).nullable()
58
+ });
@@ -0,0 +1,8 @@
1
+ export { APP_ORIGIN_HEADER, requestOrigin } from "./agents.js";
2
+ export { chooseInfra, type InfraChoice } from "./choose.js";
3
+ export { INFRA_URL, infraClient } from "./client.js";
4
+ export { COMMENT_BODY_LIMIT, filed_comment, LONGEST_COMMENT } from "./comments.js";
5
+ export type { AgentConnection, AgentRefused, AgentRequest, AgentToken, CommentRefused, FiledComment, Infra, InfraProject, InfraUnavailable, KeptComment, LoginProof, StartedLogin, StartRefused, VerifyRefused } from "./infra.js";
6
+ export { AGENT_SCOPES, type AgentScope, MCP_PATH } from "./primitives.js";
7
+ export type { AsyncOperationResult, OperationResult } from "./results.js";
8
+ export { standInAgentToken, standInInfra, type WaitingLogin } from "./stand-in.js";
@@ -0,0 +1,15 @@
1
+ // @superforge/infra: Superforge Infra, the backend services Foundation and
2
+ // Skylevel apps run on, as an app's server calls it. README.md has how an
3
+ // app uses it.
4
+ // Claude's login to an app's MCP: where a request reached the app, which
5
+ // every token is bound to, and the path its MCP answers at
6
+ export { APP_ORIGIN_HEADER, requestOrigin } from "./agents.js";
7
+ // Calling Infra: the real one over HTTP with a project's key, the
8
+ // stand-in, Infra's test mode in memory, and choosing between them by how
9
+ // the server runs and the keys it has
10
+ export { chooseInfra } from "./choose.js";
11
+ export { INFRA_URL, infraClient } from "./client.js";
12
+ // What Infra takes of a comment from an app's toolbar
13
+ export { COMMENT_BODY_LIMIT, filed_comment, LONGEST_COMMENT } from "./comments.js";
14
+ export { AGENT_SCOPES, MCP_PATH } from "./primitives.js";
15
+ export { standInAgentToken, standInInfra } from "./stand-in.js";
@@ -0,0 +1,99 @@
1
+ import type { z } from "zod";
2
+ import type { AgentConnection, AgentToken, agent_refused, agent_request } from "./agents.js";
3
+ import type { comment_refused, infra_project, kept_comment, start_refused, started_login, verified_login, verify_refused } from "./answers.js";
4
+ import type { FiledComment } from "./comments.js";
5
+ import type { AgentScope } from "./primitives.js";
6
+ import type { AsyncOperationResult } from "./results.js";
7
+ /** A code typed with the address it went to, or a link's token */
8
+ export type LoginProof = {
9
+ email: string;
10
+ code: string;
11
+ } | {
12
+ token: string;
13
+ };
14
+ /** What an app asks of Infra, whichever answers: the real one or the stand-in */
15
+ export type Infra = {
16
+ /**
17
+ * Which project the key is for, its mode, and the domains its login
18
+ * emails link to (`domains`, null from an Infra that doesn't say),
19
+ * which Settings shows beside the app's own (an app's Settings).
20
+ */
21
+ project(): AsyncOperationResult<InfraProject, InfraUnavailable>;
22
+ /**
23
+ * Emails `email` a six-digit code, and a link back to the app's
24
+ * `/login` when `origin` is one of the project's domains or
25
+ * localhost. `ip` is the visitor's, which Infra's limits count.
26
+ */
27
+ startLogin(request: {
28
+ email: string;
29
+ ip: string;
30
+ origin: string | null;
31
+ }): AsyncOperationResult<StartedLogin, StartRefused | InfraUnavailable>;
32
+ /**
33
+ * Whose email `proof` is: the code typed with the address it went to,
34
+ * or the link's token. Either works once.
35
+ */
36
+ verifyLogin(proof: LoginProof): AsyncOperationResult<z.output<typeof verified_login>, VerifyRefused | InfraUnavailable>;
37
+ /**
38
+ * Sends Infra a comment someone logged in wrote about an element of a
39
+ * page, which the toolbar posted to the app's own /api/comments, with
40
+ * who they are (comments.ts). Infra keeps it, a test key's too, and
41
+ * answers its ID. It's never retried: a comment sent twice is kept
42
+ * twice.
43
+ */
44
+ fileComment(comment: FiledComment): AsyncOperationResult<KeptComment, CommentRefused | InfraUnavailable>;
45
+ /**
46
+ * Passes one of Claude's OAuth calls through to Infra (`path`, after
47
+ * `/oauth`: `/authorize`, `/token`, `/metadata`…), with the app's
48
+ * key and `origin`, and answers what Infra answers, as it is
49
+ */
50
+ passOAuth(request: Request, path: string, origin: string): Promise<Response>;
51
+ /** What the Allow page shows of a request Claude made */
52
+ agentRequest(request_id: string): AsyncOperationResult<AgentRequest, AgentRefused | InfraUnavailable>;
53
+ /**
54
+ * Someone on the team, by their email, allowed Claude's request: where
55
+ * their browser goes back to Claude, with the one-time code
56
+ */
57
+ allowAgent(request_id: string, allowed: {
58
+ email: string;
59
+ scopes: AgentScope[];
60
+ }): AsyncOperationResult<{
61
+ redirect_to: string;
62
+ }, AgentRefused | InfraUnavailable>;
63
+ /** Someone declined it: where their browser goes back to Claude */
64
+ denyAgent(request_id: string): AsyncOperationResult<{
65
+ redirect_to: string;
66
+ }, AgentRefused | InfraUnavailable>;
67
+ /** Someone's connections, oldest first, for their Connected list */
68
+ agentConnections(email: string): AsyncOperationResult<AgentConnection[], InfraUnavailable>;
69
+ /** Ends one connection: Claude can't refresh it */
70
+ endAgentConnection(connection_id: string): AsyncOperationResult<null, AgentRefused | InfraUnavailable>;
71
+ /** Ends all of someone's, as taking them off the team does */
72
+ endAgentConnections(email: string): AsyncOperationResult<number, InfraUnavailable>;
73
+ /**
74
+ * Whom a token Claude brings acts as, and what it may do, when Infra
75
+ * signed it for this app at `origin`, checked with Infra's public keys
76
+ */
77
+ checkAgentToken(token: string, origin: string): AsyncOperationResult<AgentToken, "invalid-token" | InfraUnavailable>;
78
+ };
79
+ export type InfraProject = z.output<typeof infra_project>;
80
+ export type StartedLogin = z.output<typeof started_login>;
81
+ export type StartRefused = z.output<typeof start_refused>;
82
+ export type VerifyRefused = z.output<typeof verify_refused>;
83
+ export type KeptComment = z.output<typeof kept_comment>;
84
+ export type CommentRefused = z.output<typeof comment_refused>;
85
+ export type AgentRequest = z.output<typeof agent_request>["request"];
86
+ export type AgentRefused = z.output<typeof agent_refused>;
87
+ export type { AgentConnection, AgentToken, FiledComment };
88
+ /**
89
+ * Infra couldn't be asked, and why, in plain words: no key in a build, a
90
+ * key it refused, an error this version of the package doesn't know, or an
91
+ * answer that didn't come or didn't make sense. `message` is Infra's own
92
+ * when it gave one, and says what fixes it when something does. It's
93
+ * logged where it happens; an app shows it to its own team, never to a
94
+ * visitor, who only learns that login isn't working.
95
+ */
96
+ export type InfraUnavailable = {
97
+ reason: "unavailable";
98
+ message: string;
99
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ /** A second, a minute, in milliseconds */
2
+ export declare const SECOND = 1000;
3
+ export declare const MINUTE: number;
4
+ /** 32 random bytes in base64url: a login link's token, as Infra makes one */
5
+ export declare function randomToken(): string;
6
+ /** What someone on an app's team can let Claude do through its MCP */
7
+ export declare const AGENT_SCOPES: readonly ["read", "act"];
8
+ export type AgentScope = (typeof AGENT_SCOPES)[number];
9
+ /**
10
+ * Where an app's MCP answers, which Infra logs Claude in to: the admin's,
11
+ * for the app's own team. Every token Claude holds is for it.
12
+ */
13
+ export declare const MCP_PATH = "/admin/mcp";
@@ -0,0 +1,20 @@
1
+ // What the package needs of what an app has in its own utilities, kept
2
+ // here so the package depends on nothing of an app's
3
+ /** A second, a minute, in milliseconds */
4
+ export const SECOND = 1000;
5
+ export const MINUTE = 60 * SECOND;
6
+ /** 32 random bytes in base64url: a login link's token, as Infra makes one */
7
+ export function randomToken() {
8
+ const bytes = crypto.getRandomValues(new Uint8Array(32));
9
+ return btoa(String.fromCharCode(...bytes))
10
+ .replaceAll("+", "-")
11
+ .replaceAll("/", "_")
12
+ .replaceAll("=", "");
13
+ }
14
+ /** What someone on an app's team can let Claude do through its MCP */
15
+ export const AGENT_SCOPES = ["read", "act"];
16
+ /**
17
+ * Where an app's MCP answers, which Infra logs Claude in to: the admin's,
18
+ * for the app's own team. Every token Claude holds is for it.
19
+ */
20
+ export const MCP_PATH = "/admin/mcp";
@@ -0,0 +1,14 @@
1
+ /**
2
+ * A result: `ok` with its `data`, or not, with its `error`. `throw` stays
3
+ * for the genuinely unexpected, so a caller holding one of these knows the
4
+ * failure is one it's meant to handle.
5
+ */
6
+ export type OperationResult<Data, Err> = {
7
+ ok: true;
8
+ data: Data;
9
+ } | {
10
+ ok: false;
11
+ error: Err;
12
+ };
13
+ /** What an async call that can fail in an expected way answers */
14
+ export type AsyncOperationResult<Data, Err> = Promise<OperationResult<Data, Err>>;
@@ -0,0 +1,6 @@
1
+ // What a call that can fail in an expected way answers: what it got, or
2
+ // why not. The templates declare the same two types globally
3
+ // (`source/globals.d.ts`); these are the package's own, exported, and the
4
+ // same shape, so TypeScript takes either for the other and an app never
5
+ // converts between them.
6
+ export {};
@@ -0,0 +1,43 @@
1
+ import type { Infra } from "./infra.js";
2
+ import { type AgentScope } from "./primitives.js";
3
+ /** A login the stand-in sent, waiting to be verified. */
4
+ export type WaitingLogin = {
5
+ email: string;
6
+ code: string;
7
+ token: string;
8
+ attempts: number;
9
+ expires_at: number;
10
+ };
11
+ /**
12
+ * Infra's test mode, in memory: what a test key gets from the real one,
13
+ * with no key and no network. Starting a login sends nothing and answers
14
+ * the code and the link, and verifying checks them as Infra does: each
15
+ * works once, for 15 minutes, and a code for five tries. No limits apply,
16
+ * as none do to a test key. A comment is checked as Infra checks it, and
17
+ * answered an ID, though nothing keeps it, where Infra keeps a test key's.
18
+ * Its project has the `domains` it's given, an app's website's. An app's
19
+ * tests always use it, so they never reach Infra, and so does a dev server
20
+ * with no test key (choose.ts). A build never does: anyone could log in
21
+ * as anyone, since the page shows the code. Its refusals say what Infra's
22
+ * say.
23
+ *
24
+ * `waiting` is where it keeps what it sent, by address: its own, or one
25
+ * that outlives a dev server's reloads. With `logs`, as a dev server has
26
+ * it, each comment is logged, since nothing keeps it.
27
+ */
28
+ export declare function standInInfra({ waiting, logs, domains }?: {
29
+ waiting?: Map<string, WaitingLogin>;
30
+ logs?: boolean;
31
+ domains?: string[];
32
+ }): Infra;
33
+ /**
34
+ * A token as Infra signs one, for a test to call the API as Claude does:
35
+ * acting as `email`, with `scopes`, for the app at `origin` (the tests'
36
+ * own is `http://localhost`), which the stand-in's `checkAgentToken` takes
37
+ */
38
+ export declare function standInAgentToken({ email, scopes, origin, expires_in }: {
39
+ email: string;
40
+ scopes?: AgentScope[];
41
+ origin?: string;
42
+ expires_in?: string;
43
+ }): Promise<string>;
@@ -0,0 +1,237 @@
1
+ import { createLocalJWKSet, exportJWK, generateKeyPair, SignJWT } from "jose";
2
+ import { checkToken, unavailableOAuth } from "./agents.js";
3
+ import { COMMENT_BODY_LIMIT, filed_comment } from "./comments.js";
4
+ import { MCP_PATH, MINUTE, randomToken } from "./primitives.js";
5
+ // How Infra treats a code: it works for 15 minutes and five tries, and a
6
+ // new one for the same address replaces it, link and all
7
+ const LIFETIME = 15 * MINUTE;
8
+ const ATTEMPTS = 5;
9
+ /**
10
+ * Infra's test mode, in memory: what a test key gets from the real one,
11
+ * with no key and no network. Starting a login sends nothing and answers
12
+ * the code and the link, and verifying checks them as Infra does: each
13
+ * works once, for 15 minutes, and a code for five tries. No limits apply,
14
+ * as none do to a test key. A comment is checked as Infra checks it, and
15
+ * answered an ID, though nothing keeps it, where Infra keeps a test key's.
16
+ * Its project has the `domains` it's given, an app's website's. An app's
17
+ * tests always use it, so they never reach Infra, and so does a dev server
18
+ * with no test key (choose.ts). A build never does: anyone could log in
19
+ * as anyone, since the page shows the code. Its refusals say what Infra's
20
+ * say.
21
+ *
22
+ * `waiting` is where it keeps what it sent, by address: its own, or one
23
+ * that outlives a dev server's reloads. With `logs`, as a dev server has
24
+ * it, each comment is logged, since nothing keeps it.
25
+ */
26
+ export function standInInfra({ waiting = new Map(), logs = false, domains = [] } = {}) {
27
+ return {
28
+ async project() {
29
+ return {
30
+ ok: true,
31
+ data: {
32
+ project: {
33
+ id: "sf_project_stand_in",
34
+ name: "Infra's stand-in",
35
+ domains
36
+ },
37
+ mode: "test"
38
+ }
39
+ };
40
+ },
41
+ async startLogin({ email, origin }) {
42
+ const sent = {
43
+ email,
44
+ code: randomCode(),
45
+ token: randomToken(),
46
+ attempts: 0,
47
+ expires_at: Date.now() + LIFETIME
48
+ };
49
+ waiting.set(email, sent);
50
+ return {
51
+ ok: true,
52
+ data: {
53
+ email,
54
+ with_link: origin !== null,
55
+ expires_at: new Date(sent.expires_at),
56
+ test: {
57
+ code: sent.code,
58
+ link: origin === null
59
+ ? null
60
+ : `${origin}/login#${sent.token}`
61
+ }
62
+ }
63
+ };
64
+ },
65
+ async verifyLogin(proof) {
66
+ if ("token" in proof) {
67
+ const sent = [...waiting.values()].find((each) => each.token === proof.token);
68
+ if (sent === undefined || sent.expires_at <= Date.now()) {
69
+ return { ok: false, error: NO_LINK };
70
+ }
71
+ else {
72
+ waiting.delete(sent.email);
73
+ return { ok: true, data: { email: sent.email } };
74
+ }
75
+ }
76
+ const sent = waiting.get(proof.email);
77
+ if (sent === undefined ||
78
+ sent.expires_at <= Date.now() ||
79
+ sent.attempts >= ATTEMPTS) {
80
+ return { ok: false, error: NO_CODE };
81
+ }
82
+ // Each guess counts, the right one too, as Infra counts them
83
+ sent.attempts += 1;
84
+ if (sent.code === proof.code) {
85
+ waiting.delete(sent.email);
86
+ return { ok: true, data: { email: sent.email } };
87
+ }
88
+ else if (sent.attempts < ATTEMPTS) {
89
+ const left = ATTEMPTS - sent.attempts;
90
+ return {
91
+ ok: false,
92
+ error: {
93
+ reason: "wrong-code",
94
+ attempts_left: left,
95
+ message: `That isn't the code Infra emailed this address. It can be tried ${left === 1 ? "once more" : `${left} more times`}.`
96
+ }
97
+ };
98
+ }
99
+ else {
100
+ return { ok: false, error: NO_CODE };
101
+ }
102
+ },
103
+ async fileComment(comment) {
104
+ const body = JSON.stringify(comment);
105
+ if (new TextEncoder().encode(body).byteLength > COMMENT_BODY_LIMIT) {
106
+ return {
107
+ ok: false,
108
+ error: {
109
+ reason: "too-large",
110
+ limit: COMMENT_BODY_LIMIT,
111
+ message: `This call's body is over ${COMMENT_BODY_LIMIT} bytes, the most Infra takes for it.`
112
+ }
113
+ };
114
+ }
115
+ const checked = filed_comment.safeParse(comment);
116
+ if (!checked.success) {
117
+ // The fields that failed, as Infra names them
118
+ const fields = checked.error.issues.map((issue) => issue.path.join("."));
119
+ return {
120
+ ok: false,
121
+ error: {
122
+ reason: "invalid",
123
+ fields,
124
+ message: `${fields.join(", ")} didn't fit what this call takes.`
125
+ }
126
+ };
127
+ }
128
+ if (logs) {
129
+ console.info("Infra's stand-in: a comment, which Infra would keep, and which nothing keeps here", checked.data);
130
+ }
131
+ return {
132
+ ok: true,
133
+ data: { id: crypto.randomUUID(), created_at: new Date() }
134
+ };
135
+ },
136
+ // Claude's login needs Infra: the stand-in logs nobody in, and
137
+ // only checks the tokens a test mints with `standInAgentToken`
138
+ async passOAuth() {
139
+ if (logs) {
140
+ console.info("Infra's stand-in can't log Claude in. Set INFRA_TEST_KEY to connect Claude to a dev server.");
141
+ }
142
+ return unavailableOAuth("This dev server has no Infra test key, so Claude can't log in to it. Ask Claude for one (the Superforge MCP's create_test_key) for INFRA_TEST_KEY in the checkout's .env.");
143
+ },
144
+ async agentRequest() {
145
+ return { ok: false, error: NO_REQUEST };
146
+ },
147
+ async allowAgent() {
148
+ return { ok: false, error: NO_REQUEST };
149
+ },
150
+ async denyAgent() {
151
+ return { ok: false, error: NO_REQUEST };
152
+ },
153
+ async agentConnections() {
154
+ return { ok: true, data: [] };
155
+ },
156
+ async endAgentConnection() {
157
+ return {
158
+ ok: false,
159
+ error: {
160
+ error: "not-found",
161
+ message: "Claude has no connection here with this ID: the stand-in connects no one."
162
+ }
163
+ };
164
+ },
165
+ async endAgentConnections() {
166
+ return { ok: true, data: 0 };
167
+ },
168
+ async checkAgentToken(token, origin) {
169
+ const { public_keys } = await standInKeys();
170
+ return await checkToken(public_keys, token, {
171
+ origin,
172
+ project: STAND_IN_PROJECT,
173
+ mode: "test"
174
+ });
175
+ }
176
+ };
177
+ }
178
+ // What the stand-in refuses with, in Infra's words
179
+ const NO_CODE = {
180
+ reason: "no-code",
181
+ message: `No code is waiting for this address: none was sent, it ran out after ${LIFETIME / MINUTE} minutes, it was used, or it was tried ${ATTEMPTS} times. Start a new login.`
182
+ };
183
+ const NO_LINK = {
184
+ reason: "no-link",
185
+ message: `That link has been used, ran out after ${LIFETIME / MINUTE} minutes, or isn't this project's. Start a new login.`
186
+ };
187
+ const NO_REQUEST = {
188
+ error: "not-found",
189
+ message: "No request of Claude's is waiting here: the stand-in logs no one in. Set INFRA_TEST_KEY to connect Claude to a dev server."
190
+ };
191
+ // The project the stand-in's tokens are for
192
+ const STAND_IN_PROJECT = "sf_project_stand_in";
193
+ let keys;
194
+ // A key pair of the stand-in's own, made the first time it's needed
195
+ function standInKeys() {
196
+ keys ??= generateKeyPair("ES256").then(async (pair) => ({
197
+ signing: pair.privateKey,
198
+ public_keys: createLocalJWKSet({
199
+ keys: [{ ...(await exportJWK(pair.publicKey)), kid: "stand-in" }]
200
+ })
201
+ }));
202
+ return keys;
203
+ }
204
+ /**
205
+ * A token as Infra signs one, for a test to call the API as Claude does:
206
+ * acting as `email`, with `scopes`, for the app at `origin` (the tests'
207
+ * own is `http://localhost`), which the stand-in's `checkAgentToken` takes
208
+ */
209
+ export async function standInAgentToken({ email, scopes = ["read", "act"], origin = "http://localhost", expires_in = "10m" }) {
210
+ const { signing } = await standInKeys();
211
+ return await new SignJWT({
212
+ scope: scopes.join(" "),
213
+ project: STAND_IN_PROJECT,
214
+ mode: "test",
215
+ connection: crypto.randomUUID()
216
+ })
217
+ .setProtectedHeader({ alg: "ES256", kid: "stand-in", typ: "at+jwt" })
218
+ .setIssuer(origin)
219
+ .setAudience(`${origin}${MCP_PATH}`)
220
+ .setSubject(email)
221
+ .setIssuedAt()
222
+ .setExpirationTime(expires_in)
223
+ .sign(signing);
224
+ }
225
+ /**
226
+ * Six random digits. A draw past the last whole million is drawn again, so
227
+ * the modulo doesn't make low codes likelier.
228
+ */
229
+ function randomCode() {
230
+ for (;;) {
231
+ // One number, which a one-number array always holds
232
+ const [draw = 0] = crypto.getRandomValues(new Uint32Array(1));
233
+ if (draw < 4_294_000_000) {
234
+ return String(draw % 1_000_000).padStart(6, "0");
235
+ }
236
+ }
237
+ }
package/package.json CHANGED
@@ -1,6 +1,48 @@
1
1
  {
2
- "name": "@superforge/infra",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
2
+ "name": "@superforge/infra",
3
+ "version": "0.1.0",
4
+ "description": "Superforge Infra, the backend services Foundation and Skylevel apps run on, as an app's server calls it",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/superforge-studio/infra.git"
10
+ },
11
+ "packageManager": "pnpm@10.17.0",
12
+ "engines": {
13
+ "node": ">=22"
14
+ },
15
+ "exports": {
16
+ ".": {
17
+ "types": "./output/index.d.ts",
18
+ "default": "./output/index.js"
19
+ }
20
+ },
21
+ "files": [
22
+ "output",
23
+ "!output/tests"
24
+ ],
25
+ "sideEffects": false,
26
+ "scripts": {
27
+ "build": "rm -rf output && tsc -p tsconfig.build.json",
28
+ "format": "biome check --write .",
29
+ "typecheck": "tsc --noEmit",
30
+ "test": "vitest run",
31
+ "check": "biome check . && tsc --noEmit && vitest run && pnpm build",
32
+ "prepublishOnly": "pnpm check"
33
+ },
34
+ "dependencies": {
35
+ "jose": "6.2.15"
36
+ },
37
+ "peerDependencies": {
38
+ "zod": "^4.6.7"
39
+ },
40
+ "devDependencies": {
41
+ "@biomejs/biome": "^2.6.2",
42
+ "@types/node": "^22.10.2",
43
+ "hono": "^4.13.13",
44
+ "typescript": "^6.0.2",
45
+ "vitest": "^5.0.5",
46
+ "zod": "^4.6.7"
47
+ }
48
+ }