codex-mobile-re 0.1.88
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/LICENSE +11 -0
- package/README.md +278 -0
- package/dist/assets/AutomationsPanel-Dp8RsslP.js +1 -0
- package/dist/assets/AutomationsPanel-VRBbmMYW.css +1 -0
- package/dist/assets/DirectoryHub-BOxKTf5g.js +2 -0
- package/dist/assets/DirectoryHub-CIkiWzxh.css +1 -0
- package/dist/assets/ReviewPane-BI8SWSDv.js +1 -0
- package/dist/assets/ReviewPane-Q55bhcnB.css +1 -0
- package/dist/assets/ThreadConversation-DYiDMOhU.js +39 -0
- package/dist/assets/ThreadConversation-DoR0Kazk.css +1 -0
- package/dist/assets/ThreadTerminalPanel-CgxRx_qQ.js +38 -0
- package/dist/assets/ThreadTerminalPanel-O7IxAyfy.css +32 -0
- package/dist/assets/common-BeuopZEI.js +5 -0
- package/dist/assets/index-8nj0j9KO.css +1 -0
- package/dist/assets/index-BrpaGwQT.js +86 -0
- package/dist/assets/index.esm-Bx2Y2PLG.js +376 -0
- package/dist/assets/index.esm-Cxn_LBGD.js +16 -0
- package/dist/assets/index.esm-DYMAm9mq.js +1666 -0
- package/dist/assets/sanitizeHtml-LuNwludj.js +1 -0
- package/dist/icons/apple-touch-icon.png +0 -0
- package/dist/icons/codexui-icon.svg +52 -0
- package/dist/icons/maskable-512x512.png +0 -0
- package/dist/icons/pwa-192x192.png +0 -0
- package/dist/icons/pwa-512x512.png +0 -0
- package/dist/icons/pwa-icon.svg +38 -0
- package/dist/icons/pwa-maskable.svg +36 -0
- package/dist/index.html +21 -0
- package/dist/manifest.webmanifest +36 -0
- package/dist/sw.js +92 -0
- package/dist-cli/index.js +16110 -0
- package/dist-cli/index.js.map +1 -0
- package/package.json +84 -0
- package/scripts/dev-random-home.cjs +21 -0
- package/scripts/dev.cjs +69 -0
- package/scripts/fix-pty-native-build.cjs +70 -0
package/package.json
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "codex-mobile-re",
|
|
3
|
+
"version": "0.1.88",
|
|
4
|
+
"description": "Mobile-first web interface and gateway for Codex app-server (fork rebuild of codexapp)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "Pavel Voronin, Igor Levochkin",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/cattails-lgao/codex-mobile.git"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/cattails-lgao/codex-mobile#readme",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/cattails-lgao/codex-mobile/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-mobile-re": "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
|
+
"dependencies": {
|
|
40
|
+
"@composio/client": "0.1.0-alpha.66",
|
|
41
|
+
"@xterm/addon-fit": "^0.11.0",
|
|
42
|
+
"@xterm/xterm": "^6.0.0",
|
|
43
|
+
"commander": "^13.1.0",
|
|
44
|
+
"express": "^5.1.0",
|
|
45
|
+
"firebase": "^12.2.1",
|
|
46
|
+
"highlight.js": "^11.11.1",
|
|
47
|
+
"qrcode-terminal": "^0.12.0",
|
|
48
|
+
"ws": "^8.18.3"
|
|
49
|
+
},
|
|
50
|
+
"optionalDependencies": {
|
|
51
|
+
"node-pty": "^1.1.0"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@playwright/test": "^1.59.1",
|
|
55
|
+
"@tailwindcss/vite": "^4.1.18",
|
|
56
|
+
"@types/express": "^5.0.0",
|
|
57
|
+
"@types/node": "^22.13.2",
|
|
58
|
+
"@types/qrcode-terminal": "^0.12.2",
|
|
59
|
+
"@types/ws": "^8.18.1",
|
|
60
|
+
"@vitejs/plugin-vue": "^5.2.1",
|
|
61
|
+
"playwright": "^1.59.1",
|
|
62
|
+
"tailwindcss": "^4.1.18",
|
|
63
|
+
"tsup": "^8.4.0",
|
|
64
|
+
"typescript": "^5.7.3",
|
|
65
|
+
"vite": "^6.1.0",
|
|
66
|
+
"vitest": "^4.1.5",
|
|
67
|
+
"vue": "^3.5.13",
|
|
68
|
+
"vue-router": "^4.6.4",
|
|
69
|
+
"vue-tsc": "^2.2.0"
|
|
70
|
+
},
|
|
71
|
+
"scripts": {
|
|
72
|
+
"dev": "node scripts/dev.cjs",
|
|
73
|
+
"dev2": "node scripts/dev-random-home.cjs",
|
|
74
|
+
"dev:open": "pnpm run build:cli && sh -c 'pnpm run dev & VPID=$!; node dist-cli/index.js --open-project \"${1:-.}\"; wait $VPID' --",
|
|
75
|
+
"build:frontend": "vue-tsc --noEmit && vite build",
|
|
76
|
+
"build:cli": "tsup",
|
|
77
|
+
"build": "pnpm run build:frontend && pnpm run build:cli",
|
|
78
|
+
"postinstall": "node scripts/fix-pty-native-build.cjs",
|
|
79
|
+
"test:unit": "vitest run",
|
|
80
|
+
"preview": "vite preview",
|
|
81
|
+
"profile:browser": "node scripts/profile-browser-runtime.cjs",
|
|
82
|
+
"profile:thread": "PROFILE_ROUTE='#/thread/019da7c0-4e12-7a91-837c-f7c11cc8ab6c' node scripts/profile-browser-runtime.cjs"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -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)
|
package/scripts/dev.cjs
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
// Windows .cmd/.bat shims (e.g. vite.cmd) require a shell since Node 20.12,
|
|
21
|
+
// otherwise spawnSync fails with EINVAL.
|
|
22
|
+
shell: process.platform === 'win32',
|
|
23
|
+
env: {
|
|
24
|
+
...process.env,
|
|
25
|
+
CODEXUI_SANDBOX_MODE: process.env.CODEXUI_SANDBOX_MODE || 'danger-full-access',
|
|
26
|
+
// Do not force a default here: with no env value the runtime falls back
|
|
27
|
+
// to the `approval_policy` in CODEX_HOME/config.toml (defaulting to
|
|
28
|
+
// 'never' only when the file is absent), so policy changes made in the
|
|
29
|
+
// settings UI actually take effect on the running app-server.
|
|
30
|
+
...(process.env.CODEXUI_APPROVAL_POLICY ? { CODEXUI_APPROVAL_POLICY: process.env.CODEXUI_APPROVAL_POLICY } : {}),
|
|
31
|
+
},
|
|
32
|
+
...options,
|
|
33
|
+
})
|
|
34
|
+
if (result.error) {
|
|
35
|
+
throw result.error
|
|
36
|
+
}
|
|
37
|
+
process.exit(result.status ?? 1)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const passthroughArgs = process.argv.slice(2)
|
|
41
|
+
const viteBinPath = join(process.cwd(), 'node_modules', '.bin', process.platform === 'win32' ? 'vite.cmd' : 'vite')
|
|
42
|
+
const vueTscBinPath = join(process.cwd(), 'node_modules', '.bin', process.platform === 'win32' ? 'vue-tsc.cmd' : 'vue-tsc')
|
|
43
|
+
|
|
44
|
+
if (isAndroidRuntime()) {
|
|
45
|
+
const cliPath = join(process.cwd(), 'dist-cli', 'index.js')
|
|
46
|
+
if (!existsSync(cliPath)) {
|
|
47
|
+
run('pnpm', ['run', 'build:cli'])
|
|
48
|
+
}
|
|
49
|
+
run('node', [
|
|
50
|
+
cliPath,
|
|
51
|
+
'--no-open',
|
|
52
|
+
'--no-tunnel',
|
|
53
|
+
'--no-login',
|
|
54
|
+
'--no-password',
|
|
55
|
+
...passthroughArgs,
|
|
56
|
+
])
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (!existsSync(viteBinPath) || !existsSync(vueTscBinPath)) {
|
|
60
|
+
const install = spawnSync('pnpm', ['install'], { stdio: 'inherit', env: process.env })
|
|
61
|
+
if (install.error) {
|
|
62
|
+
throw install.error
|
|
63
|
+
}
|
|
64
|
+
if (install.status !== 0) {
|
|
65
|
+
process.exit(install.status ?? 1)
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
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
|
+
}
|