@almadar/orb 4.3.0 → 4.7.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.
Files changed (84) hide show
  1. package/README.md +57 -19
  2. package/bin/{almadar → orb} +30 -24
  3. package/package.json +9 -9
  4. package/scripts/postinstall.js +25 -15
  5. package/shells/almadar-shell/package.json +17 -3
  6. package/shells/almadar-shell/packages/client/eslint.config.cjs +34 -1
  7. package/shells/almadar-shell/packages/client/package.json +28 -26
  8. package/shells/almadar-shell/packages/client/src/App.tsx +24 -6
  9. package/shells/almadar-shell/packages/client/src/config/firebase.ts +23 -2
  10. package/shells/almadar-shell/packages/client/src/config/mockAuth.ts +257 -0
  11. package/shells/almadar-shell/packages/client/src/features/auth/AuthContext.tsx +22 -9
  12. package/shells/almadar-shell/packages/client/src/features/auth/authService.ts +28 -7
  13. package/shells/almadar-shell/packages/client/src/features/auth/components/PersonaSwitcher.tsx +50 -0
  14. package/shells/almadar-shell/packages/client/src/features/auth/components/ProtectedRoute.tsx +9 -0
  15. package/shells/almadar-shell/packages/client/src/features/auth/index.ts +2 -1
  16. package/shells/almadar-shell/packages/client/src/features/auth/types.ts +18 -2
  17. package/shells/almadar-shell/packages/client/src/index.css +4 -20
  18. package/shells/almadar-shell/packages/client/tailwind.config.js +12 -2
  19. package/shells/almadar-shell/packages/server/eslint.config.cjs +4 -0
  20. package/shells/almadar-shell/packages/server/package.json +13 -9
  21. package/shells/almadar-shell/packages/server/pnpm-lock.yaml +4723 -0
  22. package/shells/almadar-shell/packages/server/src/app.ts +58 -3
  23. package/shells/almadar-shell/packages/server/src/hooks-providers.ts +11 -0
  24. package/shells/almadar-shell/packages/server/src/index.ts +41 -2
  25. package/shells/almadar-shell/packages/server/src/services/clients.ts +17 -0
  26. package/shells/almadar-shell/packages/server/src/sse.ts +20 -0
  27. package/shells/almadar-shell/packages/server/src/types/express.d.ts +3 -7
  28. package/shells/almadar-shell/packages/server/tsconfig.json +0 -1
  29. package/shells/almadar-shell/packages/shared/package.json +1 -0
  30. package/shells/almadar-shell/packages/shared/pnpm-lock.yaml +22 -0
  31. package/shells/almadar-shell/pnpm-lock.yaml +3996 -1110
  32. package/shells/almadar-shell-hono/LICENSE +72 -0
  33. package/shells/almadar-shell-hono/README.md +25 -0
  34. package/shells/almadar-shell-hono/locales/en.json +120 -0
  35. package/shells/almadar-shell-hono/package.json +37 -0
  36. package/shells/almadar-shell-hono/packages/client/eslint.config.cjs +23 -0
  37. package/shells/almadar-shell-hono/packages/client/index.html +13 -0
  38. package/shells/almadar-shell-hono/packages/client/package-lock.json +9750 -0
  39. package/shells/almadar-shell-hono/packages/client/package.json +61 -0
  40. package/shells/almadar-shell-hono/packages/client/postcss.config.js +6 -0
  41. package/shells/almadar-shell-hono/packages/client/src/App.tsx +80 -0
  42. package/shells/almadar-shell-hono/packages/client/src/config/firebase.ts +58 -0
  43. package/shells/almadar-shell-hono/packages/client/src/features/auth/AuthContext.tsx +144 -0
  44. package/shells/almadar-shell-hono/packages/client/src/features/auth/authService.ts +86 -0
  45. package/shells/almadar-shell-hono/packages/client/src/features/auth/components/Login.tsx +218 -0
  46. package/shells/almadar-shell-hono/packages/client/src/features/auth/components/ProtectedRoute.tsx +36 -0
  47. package/shells/almadar-shell-hono/packages/client/src/features/auth/components/UserProfile.tsx +68 -0
  48. package/shells/almadar-shell-hono/packages/client/src/features/auth/components/index.ts +3 -0
  49. package/shells/almadar-shell-hono/packages/client/src/features/auth/index.ts +13 -0
  50. package/shells/almadar-shell-hono/packages/client/src/features/auth/types.ts +24 -0
  51. package/shells/almadar-shell-hono/packages/client/src/index.css +35 -0
  52. package/shells/almadar-shell-hono/packages/client/src/main.tsx +8 -0
  53. package/shells/almadar-shell-hono/packages/client/src/navigation/index.ts +55 -0
  54. package/shells/almadar-shell-hono/packages/client/src/pages/index.ts +12 -0
  55. package/shells/almadar-shell-hono/packages/client/tailwind-preset.cjs +259 -0
  56. package/shells/almadar-shell-hono/packages/client/tailwind.config.js +24 -0
  57. package/shells/almadar-shell-hono/packages/client/tsconfig.json +33 -0
  58. package/shells/almadar-shell-hono/packages/client/vite.config.ts +50 -0
  59. package/shells/almadar-shell-hono/packages/server/eslint.config.cjs +19 -0
  60. package/shells/almadar-shell-hono/packages/server/package.json +38 -0
  61. package/shells/almadar-shell-hono/packages/server/pnpm-lock.yaml +4665 -0
  62. package/shells/almadar-shell-hono/packages/server/src/app.ts +70 -0
  63. package/shells/almadar-shell-hono/packages/server/src/hooks-providers.ts +11 -0
  64. package/shells/almadar-shell-hono/packages/server/src/index.ts +70 -0
  65. package/shells/almadar-shell-hono/packages/server/src/routes.ts +12 -0
  66. package/shells/almadar-shell-hono/packages/server/src/serve.ts +47 -0
  67. package/shells/almadar-shell-hono/packages/server/src/services/clients.ts +17 -0
  68. package/shells/almadar-shell-hono/packages/server/src/sse.ts +20 -0
  69. package/shells/almadar-shell-hono/packages/server/tsconfig.json +22 -0
  70. package/shells/almadar-shell-hono/packages/shared/package.json +25 -0
  71. package/shells/almadar-shell-hono/packages/shared/pnpm-lock.yaml +919 -0
  72. package/shells/almadar-shell-hono/packages/shared/src/index.ts +2 -0
  73. package/shells/almadar-shell-hono/packages/shared/tsconfig.json +17 -0
  74. package/shells/almadar-shell-hono/packages/shared/tsup.config.ts +10 -0
  75. package/shells/almadar-shell-hono/pnpm-lock.yaml +12539 -0
  76. package/shells/almadar-shell-hono/pnpm-workspace.yaml +2 -0
  77. package/shells/almadar-shell-hono/tsup.config.ts +13 -0
  78. package/shells/almadar-shell-hono/turbo.json +17 -0
  79. package/shells/almadar-shell-hono/vitest.config.ts +8 -0
  80. package/shells/orb-shell/README.md +1 -1
  81. package/shells/orb-shell/packages/client/package-lock.json +227 -27
  82. package/shells/orb-shell/packages/client/package.json +1 -1
  83. package/shells/orb-shell/packages/server/package-lock.json +1 -0
  84. package/shells/orb-shell/pnpm-lock.yaml +196 -10
package/README.md CHANGED
@@ -1,45 +1,83 @@
1
- # @almadar/cli
1
+ # @almadar/orb
2
2
 
3
- Almadar CLI - Compile Almadar schemas to full-stack applications.
3
+ Orb CLI — compile .orb programs to full-stack applications.
4
4
 
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- npm install -g @almadar/cli
8
+ npm install -g @almadar/orb
9
+ ```
10
+
11
+ Or use the curl installer:
12
+
13
+ ```bash
14
+ curl -fsSL https://orb.almadar.io/install.sh | sh
9
15
  ```
10
16
 
11
17
  ## Usage
12
18
 
13
19
  ```bash
14
- # Validate a schema
15
- almadar validate schema.orb
20
+ # Validate an .orb file (0 errors, 0 warnings required)
21
+ orbital validate app.orb
16
22
 
17
- # Compile to TypeScript (React + Express)
18
- almadar compile schema.orb --shell typescript
23
+ # Lower .lolo syntax to .orb JSON IR
24
+ orbital emit-orb app.orb
19
25
 
20
- # Compile to Python (FastAPI + PyTorch)
21
- almadar compile schema.orb --shell python
26
+ # Compile to TypeScript shell
27
+ orbital compile app.orb --shell typescript
22
28
 
23
29
  # Start development server
24
- almadar dev schema.orb
30
+ orbital dev app.orb
31
+ ```
32
+
33
+ ## Quick Example
34
+
35
+ ```lolo
36
+ orbital TaskApp {
37
+ entity Task [persistent: tasks] {
38
+ id : string!
39
+ title : string!
40
+ status : string = "pending"
41
+ }
42
+
43
+ trait TaskBrowser -> Task [interaction] {
44
+ state browsing {
45
+ INIT -> browsing
46
+ (fetch Task)
47
+ (render-ui main { type: "entity-table", entity: "Task", fields: ["title", "status"] })
48
+ CREATE -> creating
49
+ (render-ui modal { type: "modal", isOpen: true, title: "New Task",
50
+ children: [{ type: "form-section", entity: "Task", fields: ["title", "status"], mode: "create" }] })
51
+ }
52
+ state creating {
53
+ SAVE -> browsing
54
+ (persist create Task @payload.data)
55
+ (render-ui modal null)
56
+ CANCEL -> browsing
57
+ (render-ui modal null)
58
+ }
59
+ }
60
+
61
+ page "/tasks" -> TaskBrowser
62
+ }
25
63
  ```
26
64
 
27
65
  ## Commands
28
66
 
29
67
  | Command | Description |
30
68
  |---------|-------------|
31
- | `almadar validate <file>` | Validate an Almadar schema |
32
- | `almadar parse <file>` | Parse and display schema information |
33
- | `almadar compile <file>` | Compile schema to generated code |
34
- | `almadar serve <file>` | Start the Almadar server runtime |
35
- | `almadar gui <file>` | Start the Almadar desktop GUI |
36
- | `almadar dev <file>` | Start both server and client (dev mode) |
69
+ | `orbital validate <file>` | Validate an .orb file |
70
+ | `orbital emit-orb <file>` | Lower .lolo to .orb JSON (stdout) |
71
+ | `orbital compile <file>` | Compile to generated code |
72
+ | `orbital dev <file>` | Start development server |
73
+ | `orbital new <name>` | Create a new project |
37
74
 
38
75
  ## Documentation
39
76
 
40
- - [Getting Started](https://almadar.io/docs/en/getting-started)
41
- - [CLI Reference](https://almadar.io/docs/en/reference/cli)
77
+ - [Getting Started](https://orb.almadar.io/docs/getting-started/introduction)
78
+ - [CLI Reference](https://orb.almadar.io/docs/reference/cli)
79
+ - [Language Reference](https://orb.almadar.io/docs/core-concepts/entities)
42
80
 
43
81
  ## License
44
82
 
45
- MIT
83
+ BSL 1.1
@@ -4,19 +4,18 @@ const { execFileSync } = require('child_process');
4
4
  const path = require('path');
5
5
  const fs = require('fs');
6
6
 
7
- const BINARY_NAME = process.platform === 'win32' ? 'almadar.exe' : 'almadar';
7
+ const BINARY_NAME = process.platform === 'win32' ? 'orb.exe' : 'orb';
8
8
 
9
9
  function getBinaryPath() {
10
10
  const platform = process.platform;
11
11
  const arch = process.arch;
12
12
 
13
- // Map Node.js platform/arch to package names
14
13
  const platformMap = {
15
- 'darwin-x64': '@almadar/cli-darwin-x64',
16
- 'darwin-arm64': '@almadar/cli-darwin-arm64',
17
- 'linux-x64': '@almadar/cli-linux-x64',
18
- 'linux-arm64': '@almadar/cli-linux-arm64',
19
- 'win32-x64': '@almadar/cli-windows-x64',
14
+ 'darwin-x64': '@almadar/orb-darwin-x64',
15
+ 'darwin-arm64': '@almadar/orb-darwin-arm64',
16
+ 'linux-x64': '@almadar/orb-linux-x64',
17
+ 'linux-arm64': '@almadar/orb-linux-arm64',
18
+ 'win32-x64': '@almadar/orb-windows-x64',
20
19
  };
21
20
 
22
21
  const key = `${platform}-${arch}`;
@@ -24,64 +23,71 @@ function getBinaryPath() {
24
23
 
25
24
  if (!packageName) {
26
25
  console.error(`Unsupported platform: ${platform}-${arch}`);
27
- console.error('Supported platforms: darwin-x64, darwin-arm64, linux-x64, linux-arm64, win32-x64');
26
+ console.error('Supported: darwin-x64, darwin-arm64, linux-x64, linux-arm64, win32-x64');
28
27
  process.exit(1);
29
28
  }
30
29
 
31
- // Try to find the binary in node_modules
32
30
  const possiblePaths = [
33
- // Installed as dependency
34
31
  path.join(__dirname, '..', 'node_modules', packageName, BINARY_NAME),
35
- // Hoisted to parent node_modules
36
32
  path.join(__dirname, '..', '..', packageName, BINARY_NAME),
37
- // Global install
38
33
  path.join(__dirname, '..', '..', '..', packageName, BINARY_NAME),
39
34
  ];
40
35
 
41
36
  for (const binaryPath of possiblePaths) {
42
37
  if (fs.existsSync(binaryPath)) {
43
- return binaryPath;
38
+ return { binaryPath, platformDir: path.dirname(binaryPath) };
44
39
  }
45
40
  }
46
41
 
47
- console.error(`Could not find Almadar binary for ${platform}-${arch}`);
48
- console.error('Please try reinstalling: npm install -g @almadar/cli');
42
+ console.error(`Could not find Orb binary for ${platform}-${arch}`);
43
+ console.error('Try reinstalling: npm install -g @almadar/orb');
49
44
  process.exit(1);
50
45
  }
51
46
 
52
47
  function getShellsDir() {
53
- // If user has set ORBITAL_SHELLS_DIR, respect it
54
48
  if (process.env.ORBITAL_SHELLS_DIR) {
55
49
  return process.env.ORBITAL_SHELLS_DIR;
56
50
  }
57
51
 
58
- // Look for shells bundled with this package
59
52
  const possiblePaths = [
60
- // Shells in same package
61
53
  path.join(__dirname, '..', 'shells'),
62
- // Global install - shells might be one level up
63
- path.join(__dirname, '..', '..', '@almadar', 'cli', 'shells'),
54
+ path.join(__dirname, '..', '..', '@almadar', 'orb', 'shells'),
64
55
  ];
65
56
 
66
57
  for (const shellsPath of possiblePaths) {
67
- if (fs.existsSync(shellsPath) && fs.existsSync(path.join(shellsPath, 'typescript-shell'))) {
58
+ if (fs.existsSync(shellsPath) && (
59
+ fs.existsSync(path.join(shellsPath, 'almadar-shell')) ||
60
+ fs.existsSync(path.join(shellsPath, 'typescript-shell'))
61
+ )) {
68
62
  return shellsPath;
69
63
  }
70
64
  }
71
65
 
72
- // No bundled shells found - binary will use its fallback or error
73
66
  return null;
74
67
  }
75
68
 
76
- const binaryPath = getBinaryPath();
69
+ const { binaryPath, platformDir } = getBinaryPath();
77
70
  const shellsDir = getShellsDir();
78
71
 
79
- // Build environment with ORBITAL_SHELLS_DIR if we found shells
80
72
  const env = { ...process.env };
73
+
81
74
  if (shellsDir) {
82
75
  env.ORBITAL_SHELLS_DIR = shellsDir;
83
76
  }
84
77
 
78
+ // Bun runtime (sibling to Rust binary in platform package)
79
+ const bunName = process.platform === 'win32' ? 'bun.exe' : 'bun';
80
+ const bunPath = path.join(platformDir, bunName);
81
+ if (fs.existsSync(bunPath)) {
82
+ env.ORB_BUN_PATH = bunPath;
83
+ }
84
+
85
+ // Agent dist (agent/ directory in platform package)
86
+ const agentDir = path.join(platformDir, 'agent');
87
+ if (fs.existsSync(agentDir)) {
88
+ env.ORB_AGENT_DIR = agentDir;
89
+ }
90
+
85
91
  try {
86
92
  execFileSync(binaryPath, process.argv.slice(2), {
87
93
  stdio: 'inherit',
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@almadar/orb",
3
- "version": "4.3.0",
4
- "description": "Orb CLI - Compile Orbital schemas to full-stack applications",
3
+ "version": "4.7.0",
4
+ "description": "Orb CLI - deterministic when it can be, intelligent when it needs to be",
5
5
  "license": "BSL-1.1",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "https://github.com/almadar-io/almadar.git",
8
+ "url": "https://github.com/almadar-io/orb.git",
9
9
  "directory": "cli/npm"
10
10
  },
11
11
  "homepage": "https://orb.almadar.io",
12
12
  "bugs": {
13
- "url": "https://github.com/almadar-io/almadar/issues"
13
+ "url": "https://github.com/almadar-io/orb/issues"
14
14
  },
15
15
  "keywords": [
16
16
  "orb",
@@ -49,10 +49,10 @@
49
49
  "node": ">=16.0.0"
50
50
  },
51
51
  "optionalDependencies": {
52
- "@almadar/orb-darwin-x64": "4.3.0",
53
- "@almadar/orb-darwin-arm64": "4.3.0",
54
- "@almadar/orb-linux-x64": "4.3.0",
55
- "@almadar/orb-linux-arm64": "4.3.0",
56
- "@almadar/orb-windows-x64": "4.3.0"
52
+ "@almadar/orb-darwin-x64": "4.7.0",
53
+ "@almadar/orb-darwin-arm64": "4.7.0",
54
+ "@almadar/orb-linux-x64": "4.7.0",
55
+ "@almadar/orb-linux-arm64": "4.7.0",
56
+ "@almadar/orb-windows-x64": "4.7.0"
57
57
  }
58
58
  }
@@ -7,35 +7,45 @@ const platform = process.platform;
7
7
  const arch = process.arch;
8
8
 
9
9
  const platformMap = {
10
- 'darwin-x64': '@almadar/cli-darwin-x64',
11
- 'darwin-arm64': '@almadar/cli-darwin-arm64',
12
- 'linux-x64': '@almadar/cli-linux-x64',
13
- 'linux-arm64': '@almadar/cli-linux-arm64',
14
- 'win32-x64': '@almadar/cli-windows-x64',
10
+ 'darwin-x64': '@almadar/orb-darwin-x64',
11
+ 'darwin-arm64': '@almadar/orb-darwin-arm64',
12
+ 'linux-x64': '@almadar/orb-linux-x64',
13
+ 'linux-arm64': '@almadar/orb-linux-arm64',
14
+ 'win32-x64': '@almadar/orb-windows-x64',
15
15
  };
16
16
 
17
17
  const key = `${platform}-${arch}`;
18
18
  const packageName = platformMap[key];
19
19
 
20
20
  if (!packageName) {
21
- console.warn(`\n⚠️ Almadar CLI: No pre-built binary for ${platform}-${arch}`);
22
- console.warn(' You can build from source: https://github.com/almadar-io/almadar#building-from-source\n');
21
+ console.warn(`\n Orb CLI: No pre-built binary for ${platform}-${arch}`);
22
+ console.warn(' Build from source: https://github.com/almadar-io/orb#building-from-source\n');
23
23
  process.exit(0);
24
24
  }
25
25
 
26
- // Check if the platform-specific package was installed
27
26
  const possiblePaths = [
28
27
  path.join(__dirname, '..', 'node_modules', packageName),
29
28
  path.join(__dirname, '..', '..', packageName),
30
29
  path.join(__dirname, '..', '..', '..', packageName),
31
30
  ];
32
31
 
33
- const found = possiblePaths.some(p => fs.existsSync(p));
32
+ const platformDir = possiblePaths.find(p => fs.existsSync(p));
34
33
 
35
- if (found) {
36
- console.log(`✅ Almadar CLI installed for ${platform}-${arch}`);
37
- } else {
38
- console.warn(`\n⚠️ Almadar CLI: Platform package ${packageName} not found`);
39
- console.warn(' This may happen if optional dependencies were skipped.');
40
- console.warn(' Try: npm install -g @almadar/cli --include=optional\n');
34
+ if (!platformDir) {
35
+ console.warn(`\n Orb CLI: Platform package ${packageName} not found`);
36
+ console.warn(' Try: npm install -g @almadar/orb --include=optional\n');
37
+ process.exit(0);
41
38
  }
39
+
40
+ // Verify components
41
+ const binaryName = platform === 'win32' ? 'orb.exe' : 'orb';
42
+ const bunName = platform === 'win32' ? 'bun.exe' : 'bun';
43
+
44
+ const hasBinary = fs.existsSync(path.join(platformDir, binaryName));
45
+ const hasBun = fs.existsSync(path.join(platformDir, bunName));
46
+ const hasAgent = fs.existsSync(path.join(platformDir, 'agent', 'cli.js'));
47
+
48
+ console.log(`Orb CLI installed for ${platform}-${arch}:`);
49
+ console.log(` Binary: ${hasBinary ? 'ok' : 'missing'}`);
50
+ console.log(` Bun: ${hasBun ? 'ok' : 'not bundled (agent features require bun on PATH)'}`);
51
+ console.log(` Agent: ${hasAgent ? 'ok' : 'not bundled (agent features unavailable)'}`);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/shell",
3
- "version": "2.5.0",
3
+ "version": "2.107.0",
4
4
  "private": false,
5
5
  "description": "Minimal full-stack shell template for Almadar applications",
6
6
  "packageManager": "pnpm@10.30.3",
@@ -9,6 +9,7 @@
9
9
  "build": "pnpm run -r build",
10
10
  "typecheck": "turbo run typecheck",
11
11
  "lint": "turbo run lint",
12
+ "prepack": "node -e \"const fs=require('fs');if(fs.existsSync('packages'))for(const p of fs.readdirSync('packages'))for(const j of ['.turbo','package-lock.json']){const t='packages/'+p+'/'+j;if(fs.existsSync(t))fs.rmSync(t,{recursive:true,force:true});}\"",
12
13
  "prepare": "git rev-parse --git-dir > /dev/null 2>&1 && git config core.hooksPath .githooks || true"
13
14
  },
14
15
  "devDependencies": {
@@ -19,11 +20,24 @@
19
20
  "overrides": {
20
21
  "@tootallnate/once": "^3.0.1",
21
22
  "esbuild": "^0.25.0",
22
- "flatted": "^3.4.1"
23
+ "flatted": "^3.4.1",
24
+ "protobufjs": ">=7.5.8 <8",
25
+ "node-forge": "^1.4.0",
26
+ "fast-xml-parser": "^5.7.0",
27
+ "fast-xml-builder": ">=1.1.7",
28
+ "express>path-to-regexp": "0.1.13",
29
+ "qs": "^6.15.2",
30
+ "lodash-es": "^4.18.0"
23
31
  }
24
32
  },
25
33
  "files": [
26
- "dist"
34
+ "packages",
35
+ "locales",
36
+ "pnpm-workspace.yaml",
37
+ "turbo.json",
38
+ "pnpm-lock.yaml",
39
+ ".env.example",
40
+ ".gitignore"
27
41
  ],
28
42
  "repository": {
29
43
  "type": "git",
@@ -1,11 +1,31 @@
1
1
  "use strict";
2
2
  const tsParser = require("@typescript-eslint/parser");
3
3
  const almadarPlugin = require("@almadar/eslint-plugin");
4
+ // react-hooks plugin registered so the codegen-emitted
5
+ // `// eslint-disable-next-line react-hooks/exhaustive-deps` comments are
6
+ // well-formed (eslint errors on disable directives that reference
7
+ // unknown rules). The actual rules are left off — enabling them would
8
+ // surface a backlog of dep-array warnings the codegen knows are
9
+ // intentional. Tightening is a separate codegen-fix pass.
10
+ let reactHooksPlugin;
11
+ try {
12
+ reactHooksPlugin = require("eslint-plugin-react-hooks");
13
+ } catch (_) {
14
+ reactHooksPlugin = { rules: { "exhaustive-deps": { meta: {}, create: () => ({}) }, "rules-of-hooks": { meta: {}, create: () => ({}) } } };
15
+ }
4
16
 
5
17
  module.exports = [
6
18
  { ignores: ["dist/**", "node_modules/**", "**/*.test.ts", "**/*.test.tsx"] },
7
19
  {
8
20
  files: ["src/**/*.ts", "src/**/*.tsx"],
21
+ // The codegen emits `// eslint-disable-next-line react-hooks/exhaustive-deps`
22
+ // ahead of every mount-only effect's `[]` dep array. Until the real
23
+ // `eslint-plugin-react-hooks` is wired (it would fire the rule and
24
+ // make these directives meaningful), the shim's no-op create() means
25
+ // the rule never reports — so ESLint flags the directives as
26
+ // "Unused eslint-disable directive". That's a false alarm at this
27
+ // stage; suppress it so the strict-error rule set still hard-fails.
28
+ linterOptions: { reportUnusedDisableDirectives: "off" },
9
29
  languageOptions: {
10
30
  parser: tsParser,
11
31
  parserOptions: {
@@ -14,9 +34,22 @@ module.exports = [
14
34
  sourceType: "module",
15
35
  },
16
36
  },
17
- plugins: { almadar: almadarPlugin },
37
+ plugins: { almadar: almadarPlugin, "react-hooks": reactHooksPlugin },
18
38
  rules: {
39
+ // Zero escape hatches in emitted shell code. Each rule pairs with a
40
+ // codegen-template fix in orbital-rust (see docs/Almadar_Compiler_Gaps.md):
41
+ // - no-as-any: catches `as any` casts.
42
+ // - no-unknown-type: catches `: unknown` annotations.
43
+ // Service results are typed via the integrations
44
+ // contract; every other "unknown" is a typed
45
+ // shape the codegen knows.
46
+ // - no-record-string-unknown: catches `as Record<string, unknown>` casts
47
+ // the codegen used to index into entity rows by
48
+ // string key. The entity has a typed interface
49
+ // — emit against that.
19
50
  "almadar/no-as-any": "error",
51
+ "almadar/no-unknown-type": "error",
52
+ "almadar/no-record-string-unknown": "error",
20
53
  "almadar/no-import-generated": "error",
21
54
  },
22
55
  },
@@ -1,59 +1,61 @@
1
1
  {
2
2
  "name": "@almadar/shell-client",
3
- "version": "1.0.0",
3
+ "version": "2.13.15",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
8
8
  "build": "tsc && vite build",
9
9
  "typecheck": "tsc --noEmit",
10
- "lint": "eslint src/",
10
+ "lint": "eslint --max-warnings 0 src/",
11
11
  "preview": "vite preview",
12
12
  "test": "vitest run --passWithNoTests",
13
13
  "test:watch": "vitest"
14
14
  },
15
15
  "dependencies": {
16
- "@almadar/ui": ">=2.34.1",
17
- "@almadar/syntax": ">=1.1.0",
18
- "@almadar/evaluator": ">=2.6.0",
19
- "@almadar/patterns": ">=2.8.12",
20
- "@almadar/core": ">=2.9.0",
21
- "firebase": "^11.4.0",
16
+ "@almadar/core": "^10.92.0",
17
+ "@almadar/evaluator": "^2.45.0",
18
+ "@almadar/logger": "^1.12.0",
19
+ "@almadar/patterns": "^2.101.0",
20
+ "@almadar/syntax": "^1.17.0",
21
+ "@almadar/ui": "^6.19.0",
22
+ "@monaco-editor/react": "^4.7.0",
23
+ "@react-three/drei": "^9.92.0",
24
+ "@react-three/fiber": "^9.0.0",
25
+ "@react-three/postprocessing": "^3.0.0",
22
26
  "@tanstack/react-query": "^5.67.3",
27
+ "firebase": "^11.4.0",
28
+ "leaflet": "^1.9.4",
29
+ "lucide-react": "^0.344.0",
30
+ "monaco-editor": "^0.52.2",
31
+ "postprocessing": "^6.39.0",
23
32
  "react": "^19.0.0",
24
33
  "react-dom": "^19.0.0",
25
- "react-router-dom": "^7.3.0",
26
- "zustand": "^5.0.3",
34
+ "react-force-graph-2d": "^1.25.5",
35
+ "react-leaflet": "^4.2.1",
27
36
  "react-markdown": "^9.0.1",
28
- "remark-gfm": "^4.0.1",
29
- "remark-math": "^6.0.0",
37
+ "react-router-dom": "^7.3.0",
30
38
  "rehype-katex": "^7.0.1",
31
39
  "rehype-raw": "^7.0.0",
32
- "react-force-graph-2d": "^1.25.5",
33
- "@monaco-editor/react": "^4.7.0",
34
- "monaco-editor": "^0.52.2",
35
- "leaflet": "^1.9.4",
36
- "react-leaflet": "^4.2.1",
37
- "lucide-react": "^0.344.0",
40
+ "remark-gfm": "^4.0.1",
41
+ "remark-math": "^6.0.0",
38
42
  "three": "^0.160.0",
39
- "@react-three/fiber": "^9.0.0",
40
- "@react-three/drei": "^9.92.0",
41
- "@react-three/postprocessing": "^3.0.0",
42
- "postprocessing": "^6.39.0"
43
+ "zustand": "^5.0.3"
43
44
  },
44
45
  "devDependencies": {
45
- "@almadar/eslint-plugin": ">=2.3.0",
46
- "@typescript-eslint/parser": "8.56.0",
47
- "eslint": "10.0.0",
48
- "@testing-library/react": "^16.1.0",
46
+ "@almadar/eslint-plugin": "^2.18.0",
49
47
  "@testing-library/jest-dom": "^6.6.3",
48
+ "@testing-library/react": "^16.1.0",
50
49
  "@types/react": "^19.0.0",
51
50
  "@types/react-dom": "^19.0.0",
51
+ "@typescript-eslint/parser": "8.56.0",
52
52
  "@vitejs/plugin-react": "^4.3.4",
53
53
  "autoprefixer": "^10.4.20",
54
+ "eslint": "10.0.0",
54
55
  "jsdom": "^25.0.1",
55
56
  "postcss": "^8.5.3",
56
57
  "tailwindcss": "^3.4.17",
58
+ "@tailwindcss/container-queries": "^0.1.1",
57
59
  "typescript": "^5.7.3",
58
60
  "vite": "^6.2.1",
59
61
  "vitest": "^2.1.9"
@@ -11,15 +11,19 @@
11
11
  * - react-router is optional for URL bookmarkability
12
12
  */
13
13
 
14
+ import React from 'react';
14
15
  import { BrowserRouter, Routes, Route } from 'react-router-dom';
15
16
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
16
17
  import { ThemeProvider, UISlotProvider } from '@almadar/ui/context';
17
- import { UISlotComponent, NotifyListener } from '@almadar/ui/components';
18
+ import { UISlotComponent } from '@almadar/ui/components';
18
19
  import {
19
- EntityStoreProvider,
20
20
  EventBusProvider,
21
+ UserProvider,
21
22
  VerificationProvider,
22
23
  } from '@almadar/ui/providers';
24
+ import { normalizeUserContext } from '@almadar/core';
25
+ import { AuthProvider, useAuthContext } from './features/auth';
26
+ import { PersonaSwitcher } from './features/auth/components/PersonaSwitcher';
23
27
  import { NavigationProvider } from '@almadar/ui/renderer';
24
28
  import { I18nProvider, createTranslate } from '@almadar/ui/hooks';
25
29
  import defaultLocale from '@almadar/ui/locales/en.json';
@@ -44,12 +48,25 @@ const queryClient = new QueryClient({
44
48
  },
45
49
  });
46
50
 
51
+ /**
52
+ * Bridges the signed-in viewer into `UserProvider`. Generated trait hooks read
53
+ * `@user.x` through `useUser()`, so without this every role gate takes its
54
+ * negative branch and every "only mine" list renders empty — with no error, since
55
+ * `useUser()` falls back to anonymous. `normalizeUserContext` maps the provider's
56
+ * `uid`/`displayName` onto the `id`/`name` the behaviors read.
57
+ */
58
+ function ViewerProvider({ children }: { children: React.ReactNode }) {
59
+ const { user } = useAuthContext();
60
+ return <UserProvider user={normalizeUserContext(user) ?? null}>{children}</UserProvider>;
61
+ }
62
+
47
63
  function App() {
48
64
  return (
49
65
  <I18nProvider value={i18nValue}>
50
66
  <QueryClientProvider client={queryClient}>
51
- <ThemeProvider>
52
- <EntityStoreProvider>
67
+ <ThemeProvider defaultTheme="minimalist">
68
+ <AuthProvider>
69
+ <ViewerProvider>
53
70
  <EventBusProvider>
54
71
  <VerificationProvider>
55
72
  <UISlotProvider>
@@ -68,13 +85,14 @@ function App() {
68
85
  {/* Portal slots rendered by compiled trait views via CompiledPortal */}
69
86
  {/* Toast notifications (non-overlapping, always safe to render here) */}
70
87
  <UISlotComponent slot="toast" portal />
71
- <NotifyListener />
88
+ <PersonaSwitcher />
72
89
  </BrowserRouter>
73
90
  </NavigationProvider>
74
91
  </UISlotProvider>
75
92
  </VerificationProvider>
76
93
  </EventBusProvider>
77
- </EntityStoreProvider>
94
+ </ViewerProvider>
95
+ </AuthProvider>
78
96
  </ThemeProvider>
79
97
  </QueryClientProvider>
80
98
  </I18nProvider>
@@ -1,8 +1,8 @@
1
1
  import { initializeApp, getApps, getApp, FirebaseApp } from 'firebase/app';
2
2
  import { getAuth, Auth } from 'firebase/auth';
3
3
 
4
- let app: FirebaseApp;
5
- let auth: Auth;
4
+ let app: FirebaseApp | undefined;
5
+ let auth: Auth | undefined;
6
6
 
7
7
  export async function initializeFirebase(): Promise<void> {
8
8
  if (getApps().length > 0) {
@@ -30,8 +30,29 @@ export async function initializeFirebase(): Promise<void> {
30
30
  };
31
31
  }
32
32
 
33
+ // No credentials anywhere — auth stays disabled instead of crashing
34
+ // the app boot with auth/invalid-api-key.
35
+ if (!config.apiKey) {
36
+ console.warn('Firebase not configured — auth disabled (set VITE_APP_FIREBASE_* env vars)');
37
+ return;
38
+ }
39
+
33
40
  app = initializeApp(config);
34
41
  auth = getAuth(app);
35
42
  }
36
43
 
44
+ export function requireAuth(): Auth {
45
+ if (!auth) {
46
+ throw new Error('Firebase auth is not configured — set VITE_APP_FIREBASE_* env vars');
47
+ }
48
+ return auth;
49
+ }
50
+
51
+ // True once Firebase initialized with real credentials. When false the
52
+ // app runs in auth-disabled mode: route guards pass through and sign-in
53
+ // actions report the missing config instead of crashing the boot.
54
+ export function isAuthEnabled(): boolean {
55
+ return auth !== undefined;
56
+ }
57
+
37
58
  export { auth, app };