@codecollab.co/oz 0.2.2

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 (3) hide show
  1. package/README.md +34 -0
  2. package/bin/oz.js +120 -0
  3. package/package.json +28 -0
package/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # @codecollab.co/oz
2
+
3
+ Oz is an open-source, lightweight, AI-native terminal emulator (ADE - agentic development environment). It integrates a GPU-accelerated WebGL terminal, code editor, file explorer, source control manager, and a first-class AI agent subsystem that runs against your own keys or local inference engines.
4
+
5
+ This package is a multi-platform CLI launcher for the desktop application. When run for the first time, it automatically fetches, extracts, and runs the precompiled desktop binary for your current operating system and architecture.
6
+
7
+ ## Installation
8
+
9
+ Install globally via npm or pnpm:
10
+
11
+ ```bash
12
+ npm install -g @codecollab.co/oz
13
+ # or
14
+ pnpm add -g @codecollab.co/oz
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ Launch the Oz desktop application directly from your shell:
20
+
21
+ ```bash
22
+ oz
23
+ ```
24
+
25
+ Or run without global installation:
26
+
27
+ ```bash
28
+ npx @codecollab.co/oz
29
+ ```
30
+
31
+ ## Documentation & Source Code
32
+
33
+ For the full codebase, roadmap, and build options, visit the GitHub repository:
34
+ [github.com/codecollab-co/oz](https://github.com/codecollab-co/oz)
package/bin/oz.js ADDED
@@ -0,0 +1,120 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const os = require('os');
6
+ const { spawn, execSync } = require('child_process');
7
+ const https = require('https');
8
+
9
+ const VERSION = require('../package.json').version;
10
+ const REPO = "codecollab-co/oz";
11
+
12
+ const homeDir = os.homedir();
13
+ const ozDir = path.join(homeDir, '.oz');
14
+ const binDir = path.join(ozDir, 'bin', VERSION);
15
+
16
+ const platform = os.platform();
17
+ const arch = os.arch();
18
+
19
+ let binaryName = '';
20
+ let artifactName = '';
21
+
22
+ if (platform === 'darwin') {
23
+ binaryName = 'Oz.app/Contents/MacOS/oz';
24
+ artifactName = arch === 'arm64' ? 'Oz_aarch64.app.tar.gz' : 'Oz_x64.app.tar.gz';
25
+ } else if (platform === 'linux') {
26
+ binaryName = 'oz';
27
+ artifactName = 'oz_linux_x64.zip';
28
+ } else if (platform === 'win32') {
29
+ binaryName = 'oz.exe';
30
+ artifactName = 'oz_windows_x64.zip';
31
+ } else {
32
+ console.error(`Unsupported platform: ${platform}`);
33
+ process.exit(1);
34
+ }
35
+
36
+ const binaryPath = path.join(binDir, binaryName);
37
+
38
+ if (fs.existsSync(binaryPath)) {
39
+ runBinary();
40
+ } else {
41
+ downloadAndExtract();
42
+ }
43
+
44
+ function runBinary() {
45
+ const args = process.argv.slice(2);
46
+ const child = spawn(binaryPath, args, { stdio: 'inherit' });
47
+ child.on('close', (code) => {
48
+ process.exit(code);
49
+ });
50
+ }
51
+
52
+ function downloadAndExtract() {
53
+ console.log(`Oz is not downloaded yet. Downloading version v${VERSION} for ${platform}-${arch}...`);
54
+ if (!fs.existsSync(binDir)) {
55
+ fs.mkdirSync(binDir, { recursive: true });
56
+ }
57
+
58
+ const url = `https://github.com/${REPO}/releases/download/v${VERSION}/${artifactName}`;
59
+ const archivePath = path.join(binDir, artifactName);
60
+ const file = fs.createWriteStream(archivePath);
61
+
62
+ function get(url) {
63
+ https.get(url, (response) => {
64
+ if (response.statusCode === 302 || response.statusCode === 301) {
65
+ get(response.headers.location);
66
+ return;
67
+ }
68
+ if (response.statusCode !== 200) {
69
+ console.error(`Failed to download binary: HTTP ${response.statusCode}`);
70
+ process.exit(1);
71
+ }
72
+
73
+ const totalSize = parseInt(response.headers['content-length'], 10) || 0;
74
+ let downloaded = 0;
75
+
76
+ response.on('data', (chunk) => {
77
+ downloaded += chunk.length;
78
+ if (totalSize > 0) {
79
+ const percent = ((downloaded / totalSize) * 100).toFixed(1);
80
+ process.stdout.write(`\rDownloading: ${percent}%`);
81
+ } else {
82
+ process.stdout.write(`\rDownloading: ${(downloaded / 1024 / 1024).toFixed(2)} MB`);
83
+ }
84
+ });
85
+
86
+ response.pipe(file);
87
+
88
+ file.on('finish', () => {
89
+ file.close(() => {
90
+ console.log('\nDownload complete. Extracting files...');
91
+ try {
92
+ if (platform === 'darwin') {
93
+ execSync(`tar -xzf "${archivePath}" -C "${binDir}"`);
94
+ } else if (platform === 'linux') {
95
+ execSync(`unzip -o "${archivePath}" -d "${binDir}"`);
96
+ } else if (platform === 'win32') {
97
+ execSync(`powershell -Command "Expand-Archive -Path '${archivePath}' -DestinationPath '${binDir}' -Force"`);
98
+ }
99
+ fs.unlinkSync(archivePath);
100
+
101
+ if (platform !== 'win32') {
102
+ fs.chmodSync(binaryPath, 0o755);
103
+ }
104
+ console.log('Extraction complete. Launching Oz...');
105
+ runBinary();
106
+ } catch (err) {
107
+ console.error('Failed to extract files:', err.message);
108
+ process.exit(1);
109
+ }
110
+ });
111
+ });
112
+ }).on('error', (err) => {
113
+ try { fs.unlinkSync(archivePath); } catch {}
114
+ console.error('Download error:', err.message);
115
+ process.exit(1);
116
+ });
117
+ }
118
+
119
+ get(url);
120
+ }
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@codecollab.co/oz",
3
+ "version": "0.2.2",
4
+ "description": "Oz — an open-source AI-native terminal emulator CLI launcher",
5
+ "main": "bin/oz.js",
6
+ "bin": {
7
+ "oz": "bin/oz.js"
8
+ },
9
+ "publishConfig": {
10
+ "access": "public"
11
+ },
12
+ "engines": {
13
+ "node": ">=18"
14
+ },
15
+ "license": "Apache-2.0",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/codecollab-co/oz.git"
19
+ },
20
+ "keywords": [
21
+ "terminal",
22
+ "tauri",
23
+ "rust",
24
+ "react",
25
+ "ai",
26
+ "agentic"
27
+ ]
28
+ }