codex-phone 1.0.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 (34) hide show
  1. package/LICENSE +11 -0
  2. package/README.md +278 -0
  3. package/dist/assets/AutomationsPanel-CVRRdwJX.css +1 -0
  4. package/dist/assets/AutomationsPanel-uscQHN1e.js +1 -0
  5. package/dist/assets/DirectoryHub-C8N1e8Jl.css +1 -0
  6. package/dist/assets/DirectoryHub-DPAFmuRH.js +2 -0
  7. package/dist/assets/ReviewPane-BZOe7axm.js +1 -0
  8. package/dist/assets/ReviewPane-CoYYQ3xu.css +1 -0
  9. package/dist/assets/ThreadConversation-BTpe8eca.js +39 -0
  10. package/dist/assets/ThreadConversation-DruQC3Ap.css +1 -0
  11. package/dist/assets/ThreadTerminalPanel-BTLjAaIQ.js +38 -0
  12. package/dist/assets/ThreadTerminalPanel-V1YtpglL.css +32 -0
  13. package/dist/assets/common-BeuopZEI.js +5 -0
  14. package/dist/assets/index-BzkJYDSJ.css +1 -0
  15. package/dist/assets/index-Dp2k2aGg.js +73 -0
  16. package/dist/assets/index.esm-CXKcZNKa.js +376 -0
  17. package/dist/assets/index.esm-ChJ56zLV.js +1651 -0
  18. package/dist/assets/index.esm-rglDf0Dn.js +16 -0
  19. package/dist/icons/apple-touch-icon.png +0 -0
  20. package/dist/icons/codexui-icon.svg +52 -0
  21. package/dist/icons/maskable-512x512.png +0 -0
  22. package/dist/icons/pwa-192x192.png +0 -0
  23. package/dist/icons/pwa-512x512.png +0 -0
  24. package/dist/icons/pwa-icon.svg +38 -0
  25. package/dist/icons/pwa-maskable.svg +36 -0
  26. package/dist/index.html +21 -0
  27. package/dist/manifest.webmanifest +36 -0
  28. package/dist/sw.js +92 -0
  29. package/dist-cli/index.js +15263 -0
  30. package/dist-cli/index.js.map +1 -0
  31. package/package.json +93 -0
  32. package/scripts/dev-random-home.cjs +21 -0
  33. package/scripts/dev.cjs +62 -0
  34. package/scripts/fix-pty-native-build.cjs +70 -0
package/package.json ADDED
@@ -0,0 +1,93 @@
1
+ {
2
+ "name": "codex-phone",
3
+ "version": "1.0.0",
4
+ "description": "A lightweight web interface for Codex that runs on top of the Codex app-server, allowing remote access from any browser",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "Pavel Voronin, Igor Levochkin",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/friuns2/codexui.git"
11
+ },
12
+ "homepage": "https://github.com/friuns2/codexui#readme",
13
+ "bugs": {
14
+ "url": "https://github.com/friuns2/codexui/issues"
15
+ },
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "keywords": [
20
+ "codex",
21
+ "openai",
22
+ "web-ui",
23
+ "remote",
24
+ "cli"
25
+ ],
26
+ "engines": {
27
+ "node": ">=18"
28
+ },
29
+ "bin": {
30
+ "codex-phone": "dist-cli/index.js"
31
+ },
32
+ "files": [
33
+ "dist/",
34
+ "dist-cli/",
35
+ "scripts/dev.cjs",
36
+ "scripts/dev-random-home.cjs",
37
+ "scripts/fix-pty-native-build.cjs"
38
+ ],
39
+ "pnpm": {
40
+ "onlyBuiltDependencies": [
41
+ "@firebase/util",
42
+ "esbuild",
43
+ "node-pty",
44
+ "protobufjs"
45
+ ]
46
+ },
47
+ "scripts": {
48
+ "dev": "node scripts/dev.cjs",
49
+ "dev2": "node scripts/dev-random-home.cjs",
50
+ "dev:open": "pnpm run build:cli && sh -c 'pnpm run dev & VPID=$!; node dist-cli/index.js --open-project \"${1:-.}\"; wait $VPID' --",
51
+ "build:frontend": "vue-tsc --noEmit && vite build",
52
+ "build:cli": "tsup",
53
+ "build": "npm run build:frontend && npm run build:cli",
54
+ "postinstall": "node scripts/fix-pty-native-build.cjs",
55
+ "test:unit": "vitest run",
56
+ "preview": "vite preview",
57
+ "prepublishOnly": "npm run build",
58
+ "profile:browser": "node scripts/profile-browser-runtime.cjs",
59
+ "profile:thread": "PROFILE_ROUTE='#/thread/019da7c0-4e12-7a91-837c-f7c11cc8ab6c' node scripts/profile-browser-runtime.cjs"
60
+ },
61
+ "dependencies": {
62
+ "@composio/client": "0.1.0-alpha.66",
63
+ "@xterm/addon-fit": "^0.11.0",
64
+ "@xterm/xterm": "^6.0.0",
65
+ "commander": "^13.1.0",
66
+ "express": "^5.1.0",
67
+ "firebase": "^12.2.1",
68
+ "highlight.js": "^11.11.1",
69
+ "qrcode-terminal": "^0.12.0",
70
+ "ws": "^8.18.3"
71
+ },
72
+ "optionalDependencies": {
73
+ "node-pty": "^1.1.0"
74
+ },
75
+ "devDependencies": {
76
+ "@playwright/test": "^1.59.1",
77
+ "@tailwindcss/vite": "^4.1.18",
78
+ "@types/express": "^5.0.0",
79
+ "@types/node": "^22.13.2",
80
+ "@types/qrcode-terminal": "^0.12.2",
81
+ "@types/ws": "^8.18.1",
82
+ "@vitejs/plugin-vue": "^5.2.1",
83
+ "playwright": "^1.59.1",
84
+ "tailwindcss": "^4.1.18",
85
+ "tsup": "^8.4.0",
86
+ "typescript": "^5.7.3",
87
+ "vite": "^6.1.0",
88
+ "vitest": "^4.1.5",
89
+ "vue": "^3.5.13",
90
+ "vue-router": "^4.6.4",
91
+ "vue-tsc": "^2.2.0"
92
+ }
93
+ }
@@ -0,0 +1,21 @@
1
+ const { mkdtempSync } = require('node:fs')
2
+ const { tmpdir } = require('node:os')
3
+ const { join } = require('node:path')
4
+ const { spawnSync } = require('node:child_process')
5
+
6
+ const codexHome = mkdtempSync(join(tmpdir(), 'codexapp-dev-home-'))
7
+ console.log(`Using temporary CODEX_HOME: ${codexHome}`)
8
+
9
+ const result = spawnSync(process.execPath, [join(__dirname, 'dev.cjs'), ...process.argv.slice(2)], {
10
+ stdio: 'inherit',
11
+ env: {
12
+ ...process.env,
13
+ CODEX_HOME: codexHome,
14
+ },
15
+ })
16
+
17
+ if (result.error) {
18
+ throw result.error
19
+ }
20
+
21
+ process.exit(result.status ?? 1)
@@ -0,0 +1,62 @@
1
+ const { execFileSync, spawnSync } = require('node:child_process')
2
+ const { existsSync } = require('node:fs')
3
+ const { join } = require('node:path')
4
+
5
+ function isAndroidRuntime() {
6
+ if (process.platform === 'android') return true
7
+ if (process.env.TERMUX_VERSION) return true
8
+ if (process.env.PREFIX?.includes('/com.termux/')) return true
9
+ if (existsSync('/system/build.prop')) return true
10
+ try {
11
+ return execFileSync('uname', ['-r'], { encoding: 'utf8' }).toLowerCase().includes('android')
12
+ } catch {
13
+ return false
14
+ }
15
+ }
16
+
17
+ function run(command, args, options = {}) {
18
+ const result = spawnSync(command, args, {
19
+ stdio: 'inherit',
20
+ env: {
21
+ ...process.env,
22
+ CODEXUI_SANDBOX_MODE: process.env.CODEXUI_SANDBOX_MODE || 'danger-full-access',
23
+ CODEXUI_APPROVAL_POLICY: process.env.CODEXUI_APPROVAL_POLICY || 'never',
24
+ },
25
+ ...options,
26
+ })
27
+ if (result.error) {
28
+ throw result.error
29
+ }
30
+ process.exit(result.status ?? 1)
31
+ }
32
+
33
+ const passthroughArgs = process.argv.slice(2)
34
+ const viteBinPath = join(process.cwd(), 'node_modules', '.bin', process.platform === 'win32' ? 'vite.cmd' : 'vite')
35
+ const vueTscBinPath = join(process.cwd(), 'node_modules', '.bin', process.platform === 'win32' ? 'vue-tsc.cmd' : 'vue-tsc')
36
+
37
+ if (isAndroidRuntime()) {
38
+ const cliPath = join(process.cwd(), 'dist-cli', 'index.js')
39
+ if (!existsSync(cliPath)) {
40
+ run('pnpm', ['run', 'build:cli'])
41
+ }
42
+ run('node', [
43
+ cliPath,
44
+ '--no-open',
45
+ '--no-tunnel',
46
+ '--no-login',
47
+ '--no-password',
48
+ ...passthroughArgs,
49
+ ])
50
+ }
51
+
52
+ if (!existsSync(viteBinPath) || !existsSync(vueTscBinPath)) {
53
+ const install = spawnSync('pnpm', ['install'], { stdio: 'inherit', env: process.env })
54
+ if (install.error) {
55
+ throw install.error
56
+ }
57
+ if (install.status !== 0) {
58
+ process.exit(install.status ?? 1)
59
+ }
60
+ }
61
+
62
+ run(viteBinPath, passthroughArgs)
@@ -0,0 +1,70 @@
1
+ const { chmodSync, existsSync, lstatSync, readFileSync, realpathSync, rmSync, writeFileSync } = require('node:fs')
2
+ const { dirname, join } = require('node:path')
3
+ const { spawnSync } = require('node:child_process')
4
+
5
+ const PTY_PACKAGES = [
6
+ 'node-pty',
7
+ ]
8
+
9
+ function packageRoot(name) {
10
+ try {
11
+ return dirname(require.resolve(`${name}/package.json`))
12
+ } catch {
13
+ return null
14
+ }
15
+ }
16
+
17
+ function isBrokenSymlink(path) {
18
+ try {
19
+ return lstatSync(path).isSymbolicLink() && !existsSync(realpathSync(path))
20
+ } catch {
21
+ try {
22
+ return lstatSync(path).isSymbolicLink() && !existsSync(path)
23
+ } catch {
24
+ return false
25
+ }
26
+ }
27
+ }
28
+
29
+ function patchMakefile(makefile) {
30
+ const source = readFileSync(makefile, 'utf8')
31
+ const patched = source.replace(
32
+ /^cmd_copy = ln -f "\$<" "\$@" 2>\/dev\/null \|\| \(rm -rf "\$@" && cp -af "\$<" "\$@"\)$/m,
33
+ 'cmd_copy = rm -rf "$@" && cp -af "$<" "$@"',
34
+ )
35
+ if (patched !== source) {
36
+ writeFileSync(makefile, patched)
37
+ }
38
+ }
39
+
40
+ function ensureSpawnHelperExecutable(root) {
41
+ if (process.platform !== 'darwin' && process.platform !== 'linux') return
42
+ const helperPath = join(root, 'prebuilds', `${process.platform}-${process.arch}`, 'spawn-helper')
43
+ if (existsSync(helperPath)) {
44
+ chmodSync(helperPath, 0o755)
45
+ }
46
+ }
47
+
48
+ for (const name of PTY_PACKAGES) {
49
+ const root = packageRoot(name)
50
+ if (!root) continue
51
+ ensureSpawnHelperExecutable(root)
52
+
53
+ const buildDir = join(root, 'build')
54
+ const makefile = join(buildDir, 'Makefile')
55
+ const binary = join(buildDir, 'Release', 'pty.node')
56
+ if (!existsSync(makefile) || !isBrokenSymlink(binary)) continue
57
+
58
+ try {
59
+ patchMakefile(makefile)
60
+ rmSync(binary, { force: true })
61
+ const result = spawnSync('make', ['BUILDTYPE=Release', '-C', buildDir], {
62
+ stdio: 'inherit',
63
+ })
64
+ if (result.status !== 0) {
65
+ console.warn(`[postinstall] Failed to repair ${name} native PTY build`)
66
+ }
67
+ } catch (error) {
68
+ console.warn(`[postinstall] Failed to repair ${name} native PTY build: ${error.message}`)
69
+ }
70
+ }