@almadar/orb 4.3.0 → 4.6.4

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 (61) 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 +1 -1
  6. package/shells/almadar-shell/packages/client/package.json +6 -6
  7. package/shells/almadar-shell/packages/client/src/App.tsx +0 -3
  8. package/shells/almadar-shell/packages/server/package.json +6 -5
  9. package/shells/almadar-shell/packages/shared/package.json +1 -0
  10. package/shells/almadar-shell/packages/shared/pnpm-lock.yaml +22 -0
  11. package/shells/almadar-shell/pnpm-lock.yaml +97 -85
  12. package/shells/almadar-shell-hono/LICENSE +72 -0
  13. package/shells/almadar-shell-hono/README.md +25 -0
  14. package/shells/almadar-shell-hono/locales/en.json +120 -0
  15. package/shells/almadar-shell-hono/package.json +31 -0
  16. package/shells/almadar-shell-hono/packages/client/eslint.config.cjs +23 -0
  17. package/shells/almadar-shell-hono/packages/client/index.html +13 -0
  18. package/shells/almadar-shell-hono/packages/client/package-lock.json +9750 -0
  19. package/shells/almadar-shell-hono/packages/client/package.json +61 -0
  20. package/shells/almadar-shell-hono/packages/client/postcss.config.js +6 -0
  21. package/shells/almadar-shell-hono/packages/client/src/App.tsx +84 -0
  22. package/shells/almadar-shell-hono/packages/client/src/config/firebase.ts +37 -0
  23. package/shells/almadar-shell-hono/packages/client/src/features/auth/AuthContext.tsx +139 -0
  24. package/shells/almadar-shell-hono/packages/client/src/features/auth/authService.ts +83 -0
  25. package/shells/almadar-shell-hono/packages/client/src/features/auth/components/Login.tsx +218 -0
  26. package/shells/almadar-shell-hono/packages/client/src/features/auth/components/ProtectedRoute.tsx +27 -0
  27. package/shells/almadar-shell-hono/packages/client/src/features/auth/components/UserProfile.tsx +68 -0
  28. package/shells/almadar-shell-hono/packages/client/src/features/auth/components/index.ts +3 -0
  29. package/shells/almadar-shell-hono/packages/client/src/features/auth/index.ts +13 -0
  30. package/shells/almadar-shell-hono/packages/client/src/features/auth/types.ts +24 -0
  31. package/shells/almadar-shell-hono/packages/client/src/index.css +35 -0
  32. package/shells/almadar-shell-hono/packages/client/src/main.tsx +8 -0
  33. package/shells/almadar-shell-hono/packages/client/src/navigation/index.ts +55 -0
  34. package/shells/almadar-shell-hono/packages/client/src/pages/index.ts +12 -0
  35. package/shells/almadar-shell-hono/packages/client/tailwind-preset.cjs +259 -0
  36. package/shells/almadar-shell-hono/packages/client/tailwind.config.js +21 -0
  37. package/shells/almadar-shell-hono/packages/client/tsconfig.json +33 -0
  38. package/shells/almadar-shell-hono/packages/client/vite.config.ts +50 -0
  39. package/shells/almadar-shell-hono/packages/server/eslint.config.cjs +19 -0
  40. package/shells/almadar-shell-hono/packages/server/package.json +38 -0
  41. package/shells/almadar-shell-hono/packages/server/pnpm-lock.yaml +4665 -0
  42. package/shells/almadar-shell-hono/packages/server/src/app.ts +31 -0
  43. package/shells/almadar-shell-hono/packages/server/src/index.ts +31 -0
  44. package/shells/almadar-shell-hono/packages/server/src/routes.ts +12 -0
  45. package/shells/almadar-shell-hono/packages/server/src/serve.ts +45 -0
  46. package/shells/almadar-shell-hono/packages/server/tsconfig.json +23 -0
  47. package/shells/almadar-shell-hono/packages/shared/package.json +25 -0
  48. package/shells/almadar-shell-hono/packages/shared/pnpm-lock.yaml +919 -0
  49. package/shells/almadar-shell-hono/packages/shared/src/index.ts +2 -0
  50. package/shells/almadar-shell-hono/packages/shared/tsconfig.json +17 -0
  51. package/shells/almadar-shell-hono/packages/shared/tsup.config.ts +10 -0
  52. package/shells/almadar-shell-hono/pnpm-lock.yaml +9426 -0
  53. package/shells/almadar-shell-hono/pnpm-workspace.yaml +2 -0
  54. package/shells/almadar-shell-hono/tsup.config.ts +13 -0
  55. package/shells/almadar-shell-hono/turbo.json +17 -0
  56. package/shells/almadar-shell-hono/vitest.config.ts +8 -0
  57. package/shells/orb-shell/README.md +1 -1
  58. package/shells/orb-shell/packages/client/package-lock.json +227 -27
  59. package/shells/orb-shell/packages/client/package.json +1 -1
  60. package/shells/orb-shell/packages/server/package-lock.json +1 -0
  61. 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.6.4",
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.6.4",
53
+ "@almadar/orb-darwin-arm64": "4.6.4",
54
+ "@almadar/orb-linux-x64": "4.6.4",
55
+ "@almadar/orb-linux-arm64": "4.6.4",
56
+ "@almadar/orb-windows-x64": "4.6.4"
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.7.3",
4
4
  "private": false,
5
5
  "description": "Minimal full-stack shell template for Almadar applications",
6
6
  "packageManager": "pnpm@10.30.3",
@@ -13,11 +13,11 @@
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",
16
+ "@almadar/ui": ">=4.4.1",
17
+ "@almadar/syntax": ">=1.4.0",
18
+ "@almadar/evaluator": ">=2.9.2",
19
+ "@almadar/patterns": ">=2.18.1",
20
+ "@almadar/core": ">=5.8.0",
21
21
  "firebase": "^11.4.0",
22
22
  "@tanstack/react-query": "^5.67.3",
23
23
  "react": "^19.0.0",
@@ -42,7 +42,7 @@
42
42
  "postprocessing": "^6.39.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@almadar/eslint-plugin": ">=2.3.0",
45
+ "@almadar/eslint-plugin": ">=2.8.0",
46
46
  "@typescript-eslint/parser": "8.56.0",
47
47
  "eslint": "10.0.0",
48
48
  "@testing-library/react": "^16.1.0",
@@ -16,7 +16,6 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
16
16
  import { ThemeProvider, UISlotProvider } from '@almadar/ui/context';
17
17
  import { UISlotComponent, NotifyListener } from '@almadar/ui/components';
18
18
  import {
19
- EntityStoreProvider,
20
19
  EventBusProvider,
21
20
  VerificationProvider,
22
21
  } from '@almadar/ui/providers';
@@ -49,7 +48,6 @@ function App() {
49
48
  <I18nProvider value={i18nValue}>
50
49
  <QueryClientProvider client={queryClient}>
51
50
  <ThemeProvider>
52
- <EntityStoreProvider>
53
51
  <EventBusProvider>
54
52
  <VerificationProvider>
55
53
  <UISlotProvider>
@@ -74,7 +72,6 @@ function App() {
74
72
  </UISlotProvider>
75
73
  </VerificationProvider>
76
74
  </EventBusProvider>
77
- </EntityStoreProvider>
78
75
  </ThemeProvider>
79
76
  </QueryClientProvider>
80
77
  </I18nProvider>
@@ -13,10 +13,11 @@
13
13
  "test:watch": "vitest"
14
14
  },
15
15
  "dependencies": {
16
- "@almadar/server": ">=2.1.5",
17
- "@almadar/evaluator": ">=2.6.0",
18
- "@almadar/core": ">=2.9.0",
19
- "@almadar/integrations": ">=2.3.0",
16
+ "@almadar/server": ">=2.5.0",
17
+ "@almadar/runtime": ">=4.13.2",
18
+ "@almadar/evaluator": ">=2.9.2",
19
+ "@almadar/core": ">=5.8.0",
20
+ "@almadar/integrations": ">=2.6.1",
20
21
  "cors": "^2.8.5",
21
22
  "dotenv": "^16.4.7",
22
23
  "express": "^4.21.2",
@@ -24,7 +25,7 @@
24
25
  "zod": "^3.22.0"
25
26
  },
26
27
  "devDependencies": {
27
- "@almadar/eslint-plugin": ">=2.3.0",
28
+ "@almadar/eslint-plugin": ">=2.8.0",
28
29
  "@typescript-eslint/parser": "8.56.0",
29
30
  "@types/cors": "^2.8.17",
30
31
  "@types/express": "^5.0.0",
@@ -5,6 +5,7 @@
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
7
7
  "dependencies": {
8
+ "@almadar/core": ">=5.8.0",
8
9
  "zod": "^3.22.0"
9
10
  }
10
11
  }
@@ -0,0 +1,22 @@
1
+ lockfileVersion: '9.0'
2
+
3
+ settings:
4
+ autoInstallPeers: true
5
+ excludeLinksFromLockfile: false
6
+
7
+ importers:
8
+
9
+ .:
10
+ dependencies:
11
+ zod:
12
+ specifier: ^3.22.0
13
+ version: 3.25.76
14
+
15
+ packages:
16
+
17
+ zod@3.25.76:
18
+ resolution: {integrity: sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==}
19
+
20
+ snapshots:
21
+
22
+ zod@3.25.76: {}