@rizom/brain 0.2.0-alpha.18 → 0.2.0-alpha.20

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rizom/brain",
3
- "version": "0.2.0-alpha.18",
3
+ "version": "0.2.0-alpha.20",
4
4
  "description": "Brain runtime + CLI — scaffold, run, and manage AI brain instances",
5
5
  "type": "module",
6
6
  "bin": {
@@ -19,15 +19,18 @@
19
19
  "./deploy": {
20
20
  "types": "./dist/deploy.d.ts",
21
21
  "import": "./dist/deploy.js"
22
- }
22
+ },
23
+ "./tsconfig.instance.json": "./tsconfig.instance.json"
23
24
  },
24
25
  "files": [
25
26
  "dist",
26
- "templates"
27
+ "templates",
28
+ "tsconfig.instance.json"
27
29
  ],
28
30
  "scripts": {
29
31
  "build": "bun scripts/build.ts",
30
32
  "prepublishOnly": "bun scripts/build.ts",
33
+ "dev:start": "bun dist/brain.js start",
31
34
  "typecheck": "tsc --noEmit",
32
35
  "test": "bun test",
33
36
  "lint": "eslint . --ext .ts"
@@ -62,7 +65,6 @@
62
65
  "@brains/site-default": "workspace:*",
63
66
  "@brains/site-personal": "workspace:*",
64
67
  "@brains/site-professional": "workspace:*",
65
- "@brains/site-rizom": "workspace:*",
66
68
  "@brains/theme-default": "workspace:*",
67
69
  "@brains/theme-rizom": "workspace:*",
68
70
  "@brains/typescript-config": "workspace:*",
@@ -4,25 +4,17 @@ FROM oven/bun:${BUN_VERSION}-slim AS runtime
4
4
  WORKDIR /app
5
5
 
6
6
  RUN apt-get update && apt-get install -y --no-install-recommends \
7
- curl ca-certificates git gnupg debian-keyring debian-archive-keyring apt-transport-https \
8
- && curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg \
9
- && curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | tee /etc/apt/sources.list.d/caddy-stable.list \
10
- && apt-get update && apt-get install -y --no-install-recommends caddy libcap2-bin \
11
- && setcap cap_net_bind_service=+ep $(which caddy) \
7
+ curl ca-certificates git \
12
8
  && rm -rf /var/lib/apt/lists/*
13
9
 
14
- COPY deploy/Caddyfile /etc/caddy/Caddyfile
15
-
16
- RUN mkdir -p /srv/fallback && \
17
- printf '<!doctype html><html><head><meta charset="utf-8"><title>brain</title></head><body></body></html>\n' \
18
- > /srv/fallback/index.html
19
-
20
10
  ENV XDG_DATA_HOME=/data
21
11
  ENV XDG_CONFIG_HOME=/config
22
12
  RUN mkdir -p /app/data /app/cache /app/brain-data && \
23
13
  chmod -R 777 /app/data /app/cache /app/brain-data
24
14
 
25
- CMD ["sh", "-c", "caddy start --config /etc/caddy/Caddyfile && exec ./node_modules/.bin/brain start"]
15
+ EXPOSE 8080
16
+
17
+ CMD ["./node_modules/.bin/brain", "start"]
26
18
 
27
19
  # --- standalone: bake full project into image (brain-cli deploy) ---
28
20
  FROM runtime AS standalone
@@ -13,7 +13,7 @@ proxy:
13
13
  hosts:
14
14
  - <%= ENV['BRAIN_DOMAIN'] %>
15
15
  - <%= ENV['PREVIEW_DOMAIN'] %>
16
- app_port: 80
16
+ app_port: 8080
17
17
  healthcheck:
18
18
  path: /health
19
19
 
@@ -0,0 +1,31 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "display": "Rizom Brain Instance",
4
+ "compilerOptions": {
5
+ "esModuleInterop": true,
6
+ "forceConsistentCasingInFileNames": true,
7
+ "isolatedModules": true,
8
+ "moduleResolution": "bundler",
9
+ "resolveJsonModule": true,
10
+ "noUnusedLocals": true,
11
+ "noUnusedParameters": true,
12
+ "noImplicitAny": true,
13
+ "exactOptionalPropertyTypes": true,
14
+ "noImplicitReturns": true,
15
+ "noFallthroughCasesInSwitch": true,
16
+ "noUncheckedIndexedAccess": true,
17
+ "noPropertyAccessFromIndexSignature": true,
18
+ "allowUnreachableCode": false,
19
+ "allowUnusedLabels": false,
20
+ "noImplicitOverride": true,
21
+ "preserveWatchOutput": true,
22
+ "skipLibCheck": true,
23
+ "strict": true,
24
+ "target": "ES2022",
25
+ "module": "ESNext",
26
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
27
+ "jsx": "react-jsx",
28
+ "jsxImportSource": "preact",
29
+ "noEmit": true
30
+ }
31
+ }
@@ -1,72 +0,0 @@
1
- # Internal Caddy — path-based routing to brain services.
2
- # kamal-proxy terminates TLS externally; this runs inside the container.
3
- :80 {
4
- @preview host preview.* *-preview.*
5
- handle @preview {
6
- reverse_proxy localhost:4321
7
-
8
- header {
9
- X-Frame-Options "SAMEORIGIN"
10
- X-Content-Type-Options "nosniff"
11
- Referrer-Policy "strict-origin-when-cross-origin"
12
- }
13
- }
14
-
15
- # Health endpoint
16
- handle /health {
17
- reverse_proxy localhost:3333
18
- }
19
-
20
- # MCP endpoint
21
- handle /mcp* {
22
- reverse_proxy localhost:3333
23
-
24
- header {
25
- X-Content-Type-Options "nosniff"
26
- Access-Control-Allow-Origin "*"
27
- Access-Control-Allow-Methods "GET, POST, DELETE, OPTIONS"
28
- Access-Control-Allow-Headers "Content-Type, Authorization, MCP-Session-Id"
29
- }
30
- }
31
-
32
- # A2A endpoints
33
- handle /.well-known/agent-card.json {
34
- reverse_proxy localhost:3334
35
- }
36
-
37
- handle /a2a {
38
- reverse_proxy localhost:3334
39
-
40
- header {
41
- X-Content-Type-Options "nosniff"
42
- Access-Control-Allow-Origin "*"
43
- Access-Control-Allow-Methods "GET, POST, OPTIONS"
44
- Access-Control-Allow-Headers "Content-Type, Authorization"
45
- }
46
- }
47
-
48
- # Plugin API routes
49
- handle /api/* {
50
- reverse_proxy localhost:3335
51
- }
52
-
53
- @root path /
54
- handle @root {
55
- redir /.well-known/agent-card.json 302
56
- }
57
-
58
- # Production site: prefer the webserver when present; otherwise fall back
59
- # to the A2A interface so core-only deployments never return a bare 502.
60
- handle {
61
- reverse_proxy localhost:8080 localhost:3334 {
62
- lb_policy first
63
- lb_retries 1
64
- }
65
-
66
- header {
67
- X-Frame-Options "SAMEORIGIN"
68
- X-Content-Type-Options "nosniff"
69
- Referrer-Policy "strict-origin-when-cross-origin"
70
- }
71
- }
72
- }