@lemmaoracle/agent 0.0.23

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/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@lemmaoracle/agent",
3
+ "version": "0.0.23",
4
+ "description": "Agent Identity + Authority Credential schema WASM for Lemma circuits",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "normalize/src/lib.rs",
17
+ "normalize/Cargo.toml",
18
+ "scripts/build-wasm.sh"
19
+ ],
20
+ "scripts": {
21
+ "build": "tsc -p tsconfig.json",
22
+ "build:wasm": "./scripts/build-wasm.sh",
23
+ "build:circuit": "cd circuits && npm run build",
24
+ "build:all": "tsc -p tsconfig.json && ./scripts/build-wasm.sh && cd circuits && npm run build",
25
+ "type-check": "tsc --noEmit",
26
+ "test": "cargo test --manifest-path normalize/Cargo.toml",
27
+ "test:ts": "vitest run",
28
+ "test:circuit": "cd circuits && npx vitest run",
29
+ "register": "tsx scripts/register-schema.ts",
30
+ "register:circuit": "tsx scripts/register-circuit.ts"
31
+ },
32
+ "keywords": [
33
+ "lemma",
34
+ "agent",
35
+ "identity",
36
+ "credential",
37
+ "authority",
38
+ "schema",
39
+ "wasm"
40
+ ],
41
+ "dependencies": {
42
+ "@lemmaoracle/sdk": "workspace:*",
43
+ "@lemmaoracle/spec": "workspace:*",
44
+ "poseidon-lite": "0.3.0",
45
+ "ramda": "0.30.1"
46
+ },
47
+ "devDependencies": {
48
+ "@types/ramda": "0.30.1",
49
+ "dotenv": "16.4.7",
50
+ "tsx": "^4.19.0",
51
+ "typescript": "5.8.3",
52
+ "vitest": "^3.1.1"
53
+ },
54
+ "author": "Lemma Oracle",
55
+ "license": "MIT"
56
+ }
@@ -0,0 +1,46 @@
1
+ #!/bin/bash
2
+ # Build WASM for Lemma agent schema
3
+
4
+ set -e
5
+
6
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
7
+ PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
8
+ NORMALIZE_DIR="$PROJECT_DIR/normalize"
9
+ OUT_DIR="$PROJECT_DIR/dist/wasm"
10
+
11
+ echo "🚀 Building agent schema WASM for Lemma..."
12
+
13
+ # Check for Rust
14
+ if ! command -v cargo &> /dev/null; then
15
+ echo "❌ Rust/cargo not found. Install from https://rustup.rs/"
16
+ exit 1
17
+ fi
18
+
19
+ # Check for wasm-pack (optional but recommended)
20
+ if ! command -v wasm-pack &> /dev/null; then
21
+ echo "⚠️ wasm-pack not found. Installing..."
22
+ curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
23
+ fi
24
+
25
+ # Create output directory if it doesn't exist
26
+ mkdir -p "$OUT_DIR"
27
+
28
+ # Build optimized WASM
29
+ echo "1. Building optimized WASM..."
30
+ echo " Building in: $NORMALIZE_DIR"
31
+ echo " Output to: $OUT_DIR"
32
+ wasm-pack build \
33
+ "$NORMALIZE_DIR" \
34
+ --target web \
35
+ --out-dir "$OUT_DIR" \
36
+ --release \
37
+ --scope lemma
38
+
39
+ echo "2. Renaming for Lemma compatibility..."
40
+ mv "$OUT_DIR/lemma_agent_bg.wasm" "$OUT_DIR/agent.wasm"
41
+ mv "$OUT_DIR/lemma_agent.js" "$OUT_DIR/agent.js"
42
+
43
+ echo "✅ WASM build complete!"
44
+ echo "📁 Output: $OUT_DIR"
45
+ echo "📦 Files generated:"
46
+ ls -la "$OUT_DIR/" 2>/dev/null || echo " ($OUT_DIR directory)"