sealed-lattice 0.0.9 → 0.0.10

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 CHANGED
@@ -1,102 +1,7 @@
1
- # sealed-lattice
1
+ # Sealed-lattice public package
2
2
 
3
- [![npm version](https://img.shields.io/npm/v/sealed-lattice?color=5FA04E)](https://www.npmjs.com/package/sealed-lattice)
4
- [![npm downloads](https://img.shields.io/npm/dm/sealed-lattice?color=5FA04E)](https://www.npmjs.com/package/sealed-lattice)
3
+ This package is the only published npm surface in the workspace.
5
4
 
6
- ---
7
-
8
- [![CI](https://img.shields.io/github/actions/workflow/status/Tenemo/sealed-lattice/ci.yml?branch=master&label=passing%20tests&color=5FA04E)](https://github.com/Tenemo/sealed-lattice/actions/workflows/ci.yml)
9
- [![Tests coverage](https://img.shields.io/endpoint?url=https://tenemo.github.io/sealed-lattice/coverage-badge.json)](https://tenemo.github.io/sealed-lattice/coverage-summary.json)
10
- [![Documentation build](https://img.shields.io/github/actions/workflow/status/Tenemo/sealed-lattice/pages.yml?branch=master&label=docs&color=5FA04E)](https://github.com/Tenemo/sealed-lattice/actions/workflows/pages.yml)
11
-
12
- ---
13
-
14
- [![Node version](https://img.shields.io/badge/node-%E2%89%A524.14.1-5FA04E?logo=node.js&logoColor=white)](https://nodejs.org/)
15
- [![License](https://img.shields.io/github/license/Tenemo/sealed-lattice?color=5FA04E)](LICENSE)
16
-
17
- ---
18
-
19
- `sealed-lattice` is a browser-native TypeScript package for post-quantum voting research prototypes.
20
-
21
- The current implementation ships:
22
-
23
- - a real `sha256Hex` helper on the safe root package
24
- - a typed `UnsupportedRuntimeError` for missing Web Crypto support
25
- - a hardened repo, docs, testing, and publish workflow around that narrow surface
26
- - a deliberately narrow public surface while the lattice-native architecture is still being proven
27
-
28
- This repository is a hardened research prototype. It is not audited production voting software.
29
-
30
- ## Release status
31
-
32
- This repository currently tracks the initial public `sealed-lattice` surface.
33
-
34
- The public surface is intentionally narrow while the repo, CI, docs, tests, coverage, and packaging experience are stabilized. Lattice cryptography, threshold flows, transport payloads, proofs, protocol types, and any future subpath structure are still being designed and are not frozen yet.
35
-
36
- ## Installation
37
-
38
- ```bash
39
- pnpm add sealed-lattice
40
- ```
41
-
42
- ## Runtime requirements
43
-
44
- - Use ESM imports such as `import { sha256Hex } from 'sealed-lattice'`. The published package does not expose CommonJS `require()` entry points.
45
- - Browsers need `globalThis.crypto.subtle.digest` and `TextEncoder`.
46
- - CI validates Chromium, Firefox, and WebKit on desktop, plus Chromium and WebKit in mobile emulation.
47
- - Node requires version `24.14.1` or newer with `globalThis.crypto`.
48
-
49
- ## Browser support
50
-
51
- - Use modern browsers that expose `globalThis.crypto.subtle.digest` and `TextEncoder`.
52
- - Install local browser runtimes with `pnpm exec playwright install chromium firefox webkit`.
53
- - Validate the current browser matrix with `pnpm run verify:browser-compat`.
54
- - The local compatibility probe runs the targets supported on your current platform. CI runs the full desktop and mobile-emulation matrix on macOS.
55
-
56
- ## Safe quickstart
57
-
58
- ```typescript
59
- import { sha256Hex } from "sealed-lattice";
60
-
61
- const digest = await sha256Hex("sealed-lattice");
62
-
63
- console.log(digest);
64
- ```
65
-
66
- The root package currently exposes only `sha256Hex` and `UnsupportedRuntimeError`.
67
-
68
- ## Public package boundary
69
-
70
- - `sealed-lattice`
71
-
72
- No additional public subpaths are promised yet. Future capability areas such as runtime helpers, serialization, transport, threshold coordination, proofs, and protocol types remain internal design space until the post-quantum flow and misuse-resistant contracts are stable.
73
-
74
- ## Documentation
75
-
76
- - Hosted documentation site: [tenemo.github.io/sealed-lattice](https://tenemo.github.io/sealed-lattice/)
77
- - Get started: [tenemo.github.io/sealed-lattice/guides/getting-started](https://tenemo.github.io/sealed-lattice/guides/getting-started/)
78
- - Browser and worker usage: [tenemo.github.io/sealed-lattice/guides/browser-and-worker-usage](https://tenemo.github.io/sealed-lattice/guides/browser-and-worker-usage/)
79
- - Runtime and compatibility: [tenemo.github.io/sealed-lattice/guides/runtime-and-compatibility](https://tenemo.github.io/sealed-lattice/guides/runtime-and-compatibility/)
80
- - Security and non-goals: [tenemo.github.io/sealed-lattice/guides/security-and-non-goals](https://tenemo.github.io/sealed-lattice/guides/security-and-non-goals/)
81
- - Protocol spec: [tenemo.github.io/sealed-lattice/spec](https://tenemo.github.io/sealed-lattice/spec/)
82
- - API reference: [tenemo.github.io/sealed-lattice/api](https://tenemo.github.io/sealed-lattice/api/)
83
-
84
- ## Development
85
-
86
- ```bash
87
- pnpm install
88
- pnpm run lint
89
- pnpm run tsc
90
- pnpm exec playwright install chromium firefox webkit
91
- pnpm run test
92
- pnpm run verify:browser-compat
93
- pnpm run verify:docs
94
- pnpm run docs:build:site
95
- pnpm run smoke:pack
96
- pnpm run smoke:pack:npm
97
- pnpm run build
98
- ```
99
-
100
- ## License
101
-
102
- This project is licensed under MPL-2.0. See [LICENSE](LICENSE).
5
+ The current public runtime facade is intentionally empty. The package exists so
6
+ packaging, documentation, smoke checks, and release workflow can stabilize
7
+ before broader protocol-facing APIs are introduced.
package/dist/index.d.ts CHANGED
@@ -1 +1 @@
1
- export { UnsupportedRuntimeError, sha256Hex } from './core/index.js';
1
+ export {};
package/dist/index.js CHANGED
@@ -1 +1,2 @@
1
- export { UnsupportedRuntimeError, sha256Hex } from './core/index.js';
1
+ export {};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,112 +1,44 @@
1
1
  {
2
- "name": "sealed-lattice",
3
- "version": "0.0.9",
4
- "description": "A browser-native TypeScript package for sealed-lattice research prototypes, currently shipping a narrow SHA-256 helper while the post-quantum architecture remains intentionally unfrozen.",
5
- "author": "Piotr Piech <piotr@piech.dev>",
6
- "license": "MPL-2.0",
7
- "main": "dist/index.js",
8
- "types": "dist/index.d.ts",
9
- "files": [
10
- "dist"
11
- ],
12
- "imports": {
13
- "#root": "./src/index.ts",
14
- "#core": "./src/core/index.ts"
15
- },
16
- "exports": {
17
- ".": {
18
- "types": "./dist/index.d.ts",
19
- "import": "./dist/index.js"
20
- }
21
- },
22
- "repository": {
23
- "type": "git",
24
- "url": "git+https://github.com/Tenemo/sealed-lattice.git"
25
- },
26
- "bugs": {
27
- "url": "https://github.com/Tenemo/sealed-lattice/issues"
28
- },
29
- "homepage": "https://tenemo.github.io/sealed-lattice/",
30
- "packageManager": "pnpm@10.33.0",
31
- "scripts": {
32
- "lint": "eslint . -c eslint.config.js",
33
- "eslint:fix": "eslint . --fix -c eslint.config.js",
34
- "check": "pnpm run lint && pnpm run tsc && knip && tsx ./tools/ci/verify-vectors.ts",
35
- "tsc": "tsc",
36
- "test:node": "vitest --project node --run",
37
- "test:browser": "vitest --project browser-desktop --project browser-mobile --run",
38
- "test": "pnpm run test:node && pnpm run test:browser",
39
- "test:watch": "vitest --project node --watch",
40
- "coverage:node": "vitest --project node --run --coverage",
41
- "coverage:badge": "pnpm run coverage:node && tsx ./tools/generate-coverage-badge.ts",
42
- "smoke:pack": "tsx ./tools/ci/verify-packed-package.ts",
43
- "smoke:pack:npm": "tsx ./tools/ci/verify-packed-package.ts --package-manager npm",
44
- "check:node": "pnpm run check && pnpm run test:node",
45
- "prebuild": "pnpm run check && pnpm run test",
46
- "build:dist": "pnpm exec del-cli dist && tsc --project tsconfig.build.json && tsx ./tools/build/rewrite-dist-relative-imports.ts",
47
- "build:ci": "pnpm run check:node && pnpm run build:dist",
48
- "build": "pnpm run build:dist",
49
- "vectors:core": "tsx ./tools/generate-core-vectors.ts",
50
- "verify:browser-compat": "tsx ./tools/ci/verify-browser-compat.ts",
51
- "docs:api": "pnpm exec del-cli docs/src/content/docs/api/reference && tsx ./node_modules/typedoc/bin/typedoc --options typedoc.config.mjs && tsx ./typedoc/postprocess-site-docs.ts",
52
- "docs:dev": "pnpm run docs:api && astro dev --root docs",
53
- "docs:build:site": "pnpm run docs:api && pnpm exec del-cli docs/dist && astro build --root docs --silent",
54
- "docs:preview": "pnpm run docs:build:site && astro preview --root docs",
55
- "verify:docs": "pnpm run docs:api && tsx ./typedoc/verify-docs.ts",
56
- "bench:micro": "tsx ./tools/benchmarks/microbench.ts",
57
- "prepare": "husky"
58
- },
59
- "devDependencies": {
60
- "@astrojs/mdx": "^5.0.3",
61
- "@astrojs/starlight": "^0.38.3",
62
- "@eslint/eslintrc": "^3.3.5",
63
- "@eslint/js": "^10.0.1",
64
- "@fontsource/ibm-plex-sans": "^5.2.8",
65
- "@fontsource/jetbrains-mono": "^5.2.8",
66
- "@types/node": "^25.6.0",
67
- "@typescript-eslint/eslint-plugin": "^8.58.2",
68
- "@typescript-eslint/parser": "^8.58.2",
69
- "@vitest/browser-playwright": "^4.1.4",
70
- "@vitest/coverage-v8": "^4.1.4",
71
- "astro": "^6.1.7",
72
- "del-cli": "^7.0.0",
73
- "eslint": "^10.2.0",
74
- "eslint-config-prettier": "^10.1.8",
75
- "eslint-plugin-import-x": "^4.16.2",
76
- "eslint-plugin-only-error": "^1.0.2",
77
- "eslint-plugin-prettier": "^5.5.5",
78
- "globals": "^17.5.0",
79
- "husky": "^9.1.7",
80
- "knip": "^6.4.1",
81
- "playwright": "^1.59.1",
82
- "prettier": "^3.8.3",
83
- "tsx": "^4.21.0",
84
- "typedoc": "^0.28.19",
85
- "typedoc-plugin-markdown": "^4.11.0",
86
- "typescript": "^6.0.2",
87
- "vite": "^8.0.8",
88
- "vitest": "^4.1.4"
89
- },
90
- "engines": {
91
- "node": ">=24.14.1"
92
- },
93
- "pnpm": {
94
- "onlyBuiltDependencies": [
95
- "esbuild",
96
- "unrs-resolver"
97
- ]
98
- },
99
- "type": "module",
100
- "keywords": [
101
- "cryptography",
102
- "security",
103
- "post-quantum",
104
- "lattice",
105
- "threshold-encryption",
106
- "research-prototype",
107
- "webcrypto",
108
- "typescript-cryptography",
109
- "data-protection",
110
- "privacy"
111
- ]
2
+ "name": "sealed-lattice",
3
+ "version": "0.0.10",
4
+ "description": "Published npm facade for the sealed-lattice library.",
5
+ "author": "Piotr Piech <piotr@piech.dev>",
6
+ "license": "MPL-2.0",
7
+ "type": "module",
8
+ "main": "dist/index.js",
9
+ "types": "dist/index.d.ts",
10
+ "files": [
11
+ "dist",
12
+ "README.md",
13
+ "LICENSE"
14
+ ],
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.ts",
18
+ "import": "./dist/index.js"
19
+ }
20
+ },
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "git+https://github.com/Tenemo/sealed-lattice.git"
24
+ },
25
+ "bugs": {
26
+ "url": "https://github.com/Tenemo/sealed-lattice/issues"
27
+ },
28
+ "homepage": "https://tenemo.github.io/sealed-lattice/",
29
+ "engines": {
30
+ "node": ">=24.14.1"
31
+ },
32
+ "scripts": {
33
+ "check": "tsc --project tsconfig.json --pretty false --noEmit",
34
+ "build": "pnpm exec del-cli dist tsconfig.tsbuildinfo && tsc --project tsconfig.json"
35
+ },
36
+ "keywords": [
37
+ "cryptography",
38
+ "security",
39
+ "post-quantum",
40
+ "lattice",
41
+ "threshold-encryption",
42
+ "voting"
43
+ ]
112
44
  }
@@ -1,2 +0,0 @@
1
- export declare const normalizeInputToBytes: (input: string | Uint8Array) => Uint8Array<ArrayBuffer>;
2
- export declare const bytesToHex: (bytes: Uint8Array) => string;
@@ -1,8 +0,0 @@
1
- const textEncoder = new TextEncoder();
2
- export const normalizeInputToBytes = (input) => {
3
- if (typeof input === 'string') {
4
- return Uint8Array.from(textEncoder.encode(input));
5
- }
6
- return Uint8Array.from(input);
7
- };
8
- export const bytesToHex = (bytes) => Array.from(bytes, (value) => value.toString(16).padStart(2, '0')).join('');
@@ -1,10 +0,0 @@
1
- type SupportedCrypto = Crypto & {
2
- subtle: SubtleCrypto;
3
- };
4
- export declare const getWebCrypto: () => SupportedCrypto;
5
- /**
6
- * Returns the lowercase hexadecimal SHA-256 digest of the provided text or
7
- * byte input.
8
- */
9
- export declare const sha256Hex: (input: string | Uint8Array) => Promise<string>;
10
- export {};
@@ -1,18 +0,0 @@
1
- import { bytesToHex, normalizeInputToBytes } from './bytes.js';
2
- import { UnsupportedRuntimeError } from './errors.js';
3
- const hasDigest = (value) => typeof value?.subtle?.digest === 'function';
4
- export const getWebCrypto = () => {
5
- const cryptoApi = globalThis.crypto;
6
- if (!hasDigest(cryptoApi)) {
7
- throw new UnsupportedRuntimeError();
8
- }
9
- return cryptoApi;
10
- };
11
- /**
12
- * Returns the lowercase hexadecimal SHA-256 digest of the provided text or
13
- * byte input.
14
- */
15
- export const sha256Hex = async (input) => {
16
- const digest = await getWebCrypto().subtle.digest('SHA-256', normalizeInputToBytes(input));
17
- return bytesToHex(new Uint8Array(digest));
18
- };
@@ -1,7 +0,0 @@
1
- /**
2
- * Error thrown when the current runtime does not provide the Web Crypto API
3
- * features required by the public package surface.
4
- */
5
- export declare class UnsupportedRuntimeError extends Error {
6
- constructor(message?: string);
7
- }
@@ -1,11 +0,0 @@
1
- /**
2
- * Error thrown when the current runtime does not provide the Web Crypto API
3
- * features required by the public package surface.
4
- */
5
- export class UnsupportedRuntimeError extends Error {
6
- constructor(message = 'sealed-lattice requires globalThis.crypto.subtle.digest.') {
7
- super(message);
8
- this.name = new.target.name;
9
- Object.setPrototypeOf(this, new.target.prototype);
10
- }
11
- }
@@ -1,3 +0,0 @@
1
- export { bytesToHex, normalizeInputToBytes } from './bytes.js';
2
- export { getWebCrypto, sha256Hex } from './crypto.js';
3
- export { UnsupportedRuntimeError } from './errors.js';
@@ -1,3 +0,0 @@
1
- export { bytesToHex, normalizeInputToBytes } from './bytes.js';
2
- export { getWebCrypto, sha256Hex } from './crypto.js';
3
- export { UnsupportedRuntimeError } from './errors.js';