@suronai/sdk 0.1.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/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # @suronai/sdk
2
+
3
+ App SDK for Suron — call `await vault()` on boot to load your secrets via Telegram approval.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @suronai/sdk
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ Add two lines at the very top of your app entry point, before any `process.env` access:
14
+
15
+ ```typescript
16
+ import { vault } from '@suronai/sdk'
17
+ await vault()
18
+
19
+ // All process.env values are now available:
20
+ console.log(process.env.DATABASE_URL)
21
+ ```
22
+
23
+ ## Requirements
24
+
25
+ - `SURON_API_URL` env var pointing to your Convex deployment (e.g. `https://happy-animal-123.convex.site`)
26
+ - `.suron.json` in the working directory (created by `suron init`)
27
+ - Encrypted `.env` in the working directory (created by `suron init`)
28
+
29
+ ## Options
30
+
31
+ ```typescript
32
+ await vault({
33
+ configPath: '/custom/path', // directory containing .suron.json, default: cwd
34
+ timeout: 300_000, // ms to wait for approval, default: 5 minutes
35
+ pollInterval: 3_000, // ms between /status polls, default: 3s
36
+ })
37
+ ```
38
+
39
+ ## Errors
40
+
41
+ | Class | When |
42
+ |---|---|
43
+ | `SuronConfigError` | `.suron.json` missing or malformed, or `SURON_API_URL` not set |
44
+ | `SuronAppNotFoundError` | App not registered (`suron init` not run) |
45
+ | `SuronRateLimitError` | More than 20 boot requests in 1 hour |
46
+ | `SuronDeniedError` | You tapped Deny in Telegram |
47
+ | `SuronTimeoutError` | No approval received within timeout |
48
+
49
+ ## Security
50
+
51
+ The SDK never reads `~/.suron`. It only reads `.suron.json` for the `app_id`, and it never handles the `MASTER_KEY` — that lives exclusively inside the Convex deployment.
@@ -0,0 +1,2 @@
1
+ export declare function decryptEnv(privateKey: string): void;
2
+ //# sourceMappingURL=decrypt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decrypt.d.ts","sourceRoot":"","sources":["../src/decrypt.ts"],"names":[],"mappings":"AAEA,wBAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAOnD"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ // Wraps dotenvx programmatic API to decrypt .env using the private key
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.decryptEnv = decryptEnv;
5
+ function decryptEnv(privateKey) {
6
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
7
+ const dotenvx = require("@dotenvx/dotenvx");
8
+ dotenvx.config({ DOTENV_PRIVATE_KEY: privateKey });
9
+ }
10
+ //# sourceMappingURL=decrypt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decrypt.js","sourceRoot":"","sources":["../src/decrypt.ts"],"names":[],"mappings":";AAAA,uEAAuE;;AAEvE,gCAOC;AAPD,SAAgB,UAAU,CAAC,UAAkB;IAC3C,8DAA8D;IAC9D,MAAM,OAAO,GAAG,OAAO,CAAC,kBAAkB,CAEzC,CAAC;IAEF,OAAO,CAAC,MAAM,CAAC,EAAE,kBAAkB,EAAE,UAAU,EAAE,CAAC,CAAC;AACrD,CAAC"}
@@ -0,0 +1,14 @@
1
+ export declare class SuronError extends Error {
2
+ constructor(message: string);
3
+ }
4
+ export declare class SuronConfigError extends SuronError {
5
+ }
6
+ export declare class SuronAppNotFoundError extends SuronError {
7
+ }
8
+ export declare class SuronRateLimitError extends SuronError {
9
+ }
10
+ export declare class SuronDeniedError extends SuronError {
11
+ }
12
+ export declare class SuronTimeoutError extends SuronError {
13
+ }
14
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,UAAW,SAAQ,KAAK;gBACvB,OAAO,EAAE,MAAM;CAK5B;AAED,qBAAa,gBAAiB,SAAQ,UAAU;CAAG;AACnD,qBAAa,qBAAsB,SAAQ,UAAU;CAAG;AACxD,qBAAa,mBAAoB,SAAQ,UAAU;CAAG;AACtD,qBAAa,gBAAiB,SAAQ,UAAU;CAAG;AACnD,qBAAa,iBAAkB,SAAQ,UAAU;CAAG"}
package/dist/errors.js ADDED
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SuronTimeoutError = exports.SuronDeniedError = exports.SuronRateLimitError = exports.SuronAppNotFoundError = exports.SuronConfigError = exports.SuronError = void 0;
4
+ class SuronError extends Error {
5
+ constructor(message) {
6
+ super(message);
7
+ this.name = this.constructor.name;
8
+ Object.setPrototypeOf(this, new.target.prototype);
9
+ }
10
+ }
11
+ exports.SuronError = SuronError;
12
+ class SuronConfigError extends SuronError {
13
+ }
14
+ exports.SuronConfigError = SuronConfigError;
15
+ class SuronAppNotFoundError extends SuronError {
16
+ }
17
+ exports.SuronAppNotFoundError = SuronAppNotFoundError;
18
+ class SuronRateLimitError extends SuronError {
19
+ }
20
+ exports.SuronRateLimitError = SuronRateLimitError;
21
+ class SuronDeniedError extends SuronError {
22
+ }
23
+ exports.SuronDeniedError = SuronDeniedError;
24
+ class SuronTimeoutError extends SuronError {
25
+ }
26
+ exports.SuronTimeoutError = SuronTimeoutError;
27
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";;;AAAA,MAAa,UAAW,SAAQ,KAAK;IACnC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;QAClC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACpD,CAAC;CACF;AAND,gCAMC;AAED,MAAa,gBAAiB,SAAQ,UAAU;CAAG;AAAnD,4CAAmD;AACnD,MAAa,qBAAsB,SAAQ,UAAU;CAAG;AAAxD,sDAAwD;AACxD,MAAa,mBAAoB,SAAQ,UAAU;CAAG;AAAtD,kDAAsD;AACtD,MAAa,gBAAiB,SAAQ,UAAU;CAAG;AAAnD,4CAAmD;AACnD,MAAa,iBAAkB,SAAQ,UAAU;CAAG;AAApD,8CAAoD"}
@@ -0,0 +1,4 @@
1
+ export { vault } from "./vault";
2
+ export type { VaultOptions } from "./vault";
3
+ export { SuronError, SuronConfigError, SuronAppNotFoundError, SuronRateLimitError, SuronDeniedError, SuronTimeoutError, } from "./errors";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,UAAU,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SuronTimeoutError = exports.SuronDeniedError = exports.SuronRateLimitError = exports.SuronAppNotFoundError = exports.SuronConfigError = exports.SuronError = exports.vault = void 0;
4
+ var vault_1 = require("./vault");
5
+ Object.defineProperty(exports, "vault", { enumerable: true, get: function () { return vault_1.vault; } });
6
+ var errors_1 = require("./errors");
7
+ Object.defineProperty(exports, "SuronError", { enumerable: true, get: function () { return errors_1.SuronError; } });
8
+ Object.defineProperty(exports, "SuronConfigError", { enumerable: true, get: function () { return errors_1.SuronConfigError; } });
9
+ Object.defineProperty(exports, "SuronAppNotFoundError", { enumerable: true, get: function () { return errors_1.SuronAppNotFoundError; } });
10
+ Object.defineProperty(exports, "SuronRateLimitError", { enumerable: true, get: function () { return errors_1.SuronRateLimitError; } });
11
+ Object.defineProperty(exports, "SuronDeniedError", { enumerable: true, get: function () { return errors_1.SuronDeniedError; } });
12
+ Object.defineProperty(exports, "SuronTimeoutError", { enumerable: true, get: function () { return errors_1.SuronTimeoutError; } });
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,iCAAgC;AAAvB,8FAAA,KAAK,OAAA;AAEd,mCAOkB;AANhB,oGAAA,UAAU,OAAA;AACV,0GAAA,gBAAgB,OAAA;AAChB,+GAAA,qBAAqB,OAAA;AACrB,6GAAA,mBAAmB,OAAA;AACnB,0GAAA,gBAAgB,OAAA;AAChB,2GAAA,iBAAiB,OAAA"}
package/dist/poll.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export declare function pollUntilApproved(apiUrl: string, request_id: string, timeout?: number, pollInterval?: number): Promise<void>;
2
+ //# sourceMappingURL=poll.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"poll.d.ts","sourceRoot":"","sources":["../src/poll.ts"],"names":[],"mappings":"AAKA,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,OAAO,SAAqB,EAC5B,YAAY,SAA2B,GACtC,OAAO,CAAC,IAAI,CAAC,CA2Bf"}
package/dist/poll.js ADDED
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pollUntilApproved = pollUntilApproved;
4
+ const errors_1 = require("./errors");
5
+ const DEFAULT_TIMEOUT_MS = 300000; // 5 minutes
6
+ const DEFAULT_POLL_INTERVAL_MS = 3000; // 3 seconds
7
+ async function pollUntilApproved(apiUrl, request_id, timeout = DEFAULT_TIMEOUT_MS, pollInterval = DEFAULT_POLL_INTERVAL_MS) {
8
+ const deadline = Date.now() + timeout;
9
+ while (Date.now() < deadline) {
10
+ await sleep(pollInterval);
11
+ const res = await fetch(`${apiUrl}/status?request_id=${encodeURIComponent(request_id)}`);
12
+ if (!res.ok) {
13
+ // Transient error — keep polling
14
+ continue;
15
+ }
16
+ const data = (await res.json());
17
+ if (data.status === "approved")
18
+ return;
19
+ if (data.status === "denied") {
20
+ throw new errors_1.SuronDeniedError("Boot denied. You tapped Deny in Telegram.");
21
+ }
22
+ // status === "pending" — keep polling
23
+ }
24
+ throw new errors_1.SuronTimeoutError(`No Telegram approval received within ${timeout / 1000}s timeout.`);
25
+ }
26
+ function sleep(ms) {
27
+ return new Promise((resolve) => setTimeout(resolve, ms));
28
+ }
29
+ //# sourceMappingURL=poll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"poll.js","sourceRoot":"","sources":["../src/poll.ts"],"names":[],"mappings":";;AAKA,8CAgCC;AArCD,qCAA+D;AAE/D,MAAM,kBAAkB,GAAG,MAAO,CAAC,CAAC,YAAY;AAChD,MAAM,wBAAwB,GAAG,IAAK,CAAC,CAAC,YAAY;AAE7C,KAAK,UAAU,iBAAiB,CACrC,MAAc,EACd,UAAkB,EAClB,OAAO,GAAG,kBAAkB,EAC5B,YAAY,GAAG,wBAAwB;IAEvC,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC;IAEtC,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ,EAAE,CAAC;QAC7B,MAAM,KAAK,CAAC,YAAY,CAAC,CAAC;QAE1B,MAAM,GAAG,GAAG,MAAM,KAAK,CACrB,GAAG,MAAM,sBAAsB,kBAAkB,CAAC,UAAU,CAAC,EAAE,CAChE,CAAC;QAEF,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;YACZ,iCAAiC;YACjC,SAAS;QACX,CAAC;QAED,MAAM,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAuB,CAAC;QAEtD,IAAI,IAAI,CAAC,MAAM,KAAK,UAAU;YAAE,OAAO;QACvC,IAAI,IAAI,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC7B,MAAM,IAAI,yBAAgB,CAAC,2CAA2C,CAAC,CAAC;QAC1E,CAAC;QACD,sCAAsC;IACxC,CAAC;IAED,MAAM,IAAI,0BAAiB,CACzB,wCAAwC,OAAO,GAAG,IAAI,YAAY,CACnE,CAAC;AACJ,CAAC;AAED,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC"}
@@ -0,0 +1,7 @@
1
+ export interface VaultOptions {
2
+ configPath?: string;
3
+ timeout?: number;
4
+ pollInterval?: number;
5
+ }
6
+ export declare function vault(options?: VaultOptions): Promise<void>;
7
+ //# sourceMappingURL=vault.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vault.d.ts","sourceRoot":"","sources":["../src/vault.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,YAAY;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AA0ED,wBAAsB,KAAK,CAAC,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiCrE"}
package/dist/vault.js ADDED
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.vault = vault;
4
+ const fs_1 = require("fs");
5
+ const path_1 = require("path");
6
+ const errors_1 = require("./errors");
7
+ const poll_1 = require("./poll");
8
+ const decrypt_1 = require("./decrypt");
9
+ function readSuronJson(dir) {
10
+ const path = (0, path_1.join)(dir, ".suron.json");
11
+ if (!(0, fs_1.existsSync)(path)) {
12
+ throw new errors_1.SuronConfigError(`.suron.json not found in ${dir}. Run: suron init`);
13
+ }
14
+ let raw;
15
+ try {
16
+ raw = (0, fs_1.readFileSync)(path, "utf-8");
17
+ }
18
+ catch (err) {
19
+ throw new errors_1.SuronConfigError(`.suron.json could not be read: ${err}`);
20
+ }
21
+ try {
22
+ const parsed = JSON.parse(raw);
23
+ if (!parsed.app || !parsed.id) {
24
+ throw new errors_1.SuronConfigError(".suron.json is missing 'app' or 'id' field");
25
+ }
26
+ return parsed;
27
+ }
28
+ catch (err) {
29
+ if (err instanceof errors_1.SuronConfigError)
30
+ throw err;
31
+ throw new errors_1.SuronConfigError(".suron.json is malformed JSON");
32
+ }
33
+ }
34
+ async function requestAccess(apiUrl, app_id) {
35
+ const res = await fetch(`${apiUrl}/request-access`, {
36
+ method: "POST",
37
+ headers: { "Content-Type": "application/json" },
38
+ body: JSON.stringify({ app_id }),
39
+ });
40
+ if (res.status === 404) {
41
+ throw new errors_1.SuronAppNotFoundError("App not found in Suron. Run: suron init");
42
+ }
43
+ if (res.status === 429) {
44
+ throw new errors_1.SuronRateLimitError("Rate limit exceeded. Max 20 boot requests per app per hour.");
45
+ }
46
+ if (!res.ok) {
47
+ const text = await res.text().catch(() => "");
48
+ throw new Error(`Suron /request-access failed (${res.status}): ${text}`);
49
+ }
50
+ const data = (await res.json());
51
+ return data.request_id;
52
+ }
53
+ async function fetchKey(apiUrl, request_id) {
54
+ const res = await fetch(`${apiUrl}/fetch-key`, {
55
+ method: "POST",
56
+ headers: { "Content-Type": "application/json" },
57
+ body: JSON.stringify({ request_id }),
58
+ });
59
+ if (!res.ok) {
60
+ const data = (await res.json().catch(() => ({})));
61
+ throw new Error(`Suron /fetch-key failed (${res.status}): ${data.error ?? "unknown"}`);
62
+ }
63
+ const data = (await res.json());
64
+ return data.private_key;
65
+ }
66
+ async function vault(options = {}) {
67
+ const { configPath = process.cwd(), timeout = 300000, pollInterval = 3000, } = options;
68
+ const apiUrl = process.env.SURON_API_URL?.replace(/\/$/, "") ??
69
+ (() => {
70
+ throw new errors_1.SuronConfigError("SURON_API_URL environment variable is not set. Set it to your Convex deployment URL (ending in .convex.site)");
71
+ })();
72
+ const config = readSuronJson(configPath);
73
+ const request_id = await requestAccess(apiUrl, config.id);
74
+ process.stdout.write(`[suron] Waiting for Telegram approval for "${config.app}" ...\n`);
75
+ await (0, poll_1.pollUntilApproved)(apiUrl, request_id, timeout, pollInterval);
76
+ const private_key = await fetchKey(apiUrl, request_id);
77
+ (0, decrypt_1.decryptEnv)(private_key);
78
+ // Overwrite reference so GC can reclaim it
79
+ private_key = "";
80
+ process.stdout.write(`[suron] Secrets loaded for "${config.app}"\n`);
81
+ }
82
+ //# sourceMappingURL=vault.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vault.js","sourceRoot":"","sources":["../src/vault.ts"],"names":[],"mappings":";;AA8FA,sBAiCC;AA/HD,2BAA8C;AAC9C,+BAA4B;AAC5B,qCAIkB;AAClB,iCAA2C;AAC3C,uCAAuC;AAcvC,SAAS,aAAa,CAAC,GAAW;IAChC,MAAM,IAAI,GAAG,IAAA,WAAI,EAAC,GAAG,EAAE,aAAa,CAAC,CAAC;IACtC,IAAI,CAAC,IAAA,eAAU,EAAC,IAAI,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,yBAAgB,CACxB,4BAA4B,GAAG,mBAAmB,CACnD,CAAC;IACJ,CAAC;IACD,IAAI,GAAW,CAAC;IAChB,IAAI,CAAC;QACH,GAAG,GAAG,IAAA,iBAAY,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACpC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,IAAI,yBAAgB,CAAC,kCAAkC,GAAG,EAAE,CAAC,CAAC;IACtE,CAAC;IACD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAgB,CAAC;QAC9C,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;YAC9B,MAAM,IAAI,yBAAgB,CAAC,4CAA4C,CAAC,CAAC;QAC3E,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,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AAM,WAAW,GAAG,MAAM,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAEvD,IAAA,oBAAU,EAAC,WAAW,CAAC,CAAC;IAExB,2CAA2C;IAC1C,WAAiC,GAAG,EAAE,CAAC;IAExC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,+BAA+B,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC;AACvE,CAAC"}
package/package.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "@suronai/sdk",
3
+ "version": "0.1.1",
4
+ "description": "App SDK for Suron — await vault() to load secrets",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "scripts": {
11
+ "build": "tsc",
12
+ "dev": "tsc --watch",
13
+ "clean": "rimraf dist"
14
+ },
15
+ "dependencies": {
16
+ "@dotenvx/dotenvx": "^1.0.0"
17
+ },
18
+ "devDependencies": {
19
+ "typescript": "^5.4.0",
20
+ "@types/node": "^20.0.0",
21
+ "rimraf": "^5.0.0"
22
+ },
23
+ "engines": {
24
+ "node": ">=18.0.0"
25
+ }
26
+ }