customer-map-codex-bridge 0.5.1 → 0.5.3
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/README.md +52 -40
- package/authorization-macos.applescript +35 -0
- package/authorization-windows.ps1 +300 -0
- package/codex-process.mjs +43 -0
- package/index.mjs +663 -616
- package/install-protocol-macos.sh +85 -0
- package/install-protocol-windows.ps1 +43 -0
- package/mail-action.mjs +363 -363
- package/package.json +26 -20
- package/protocol-install.mjs +35 -0
package/package.json
CHANGED
|
@@ -1,24 +1,30 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "customer-map-codex-bridge",
|
|
3
|
-
"version": "0.5.
|
|
4
|
-
"description": "Connect a locally authenticated Codex CLI to Customer Map.",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"bin": {
|
|
7
|
-
"customer-map-codex-bridge": "index.mjs"
|
|
8
|
-
},
|
|
1
|
+
{
|
|
2
|
+
"name": "customer-map-codex-bridge",
|
|
3
|
+
"version": "0.5.3",
|
|
4
|
+
"description": "Connect a locally authenticated Codex CLI to Customer Map.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"customer-map-codex-bridge": "index.mjs"
|
|
8
|
+
},
|
|
9
9
|
"files": [
|
|
10
10
|
"index.mjs",
|
|
11
|
+
"codex-process.mjs",
|
|
11
12
|
"mail-action.mjs",
|
|
13
|
+
"protocol-install.mjs",
|
|
14
|
+
"install-protocol-windows.ps1",
|
|
15
|
+
"install-protocol-macos.sh",
|
|
16
|
+
"authorization-windows.ps1",
|
|
17
|
+
"authorization-macos.applescript",
|
|
12
18
|
"README.md"
|
|
13
|
-
],
|
|
14
|
-
"engines": {
|
|
15
|
-
"node": ">=18"
|
|
16
|
-
},
|
|
17
|
-
"homepage": "https://www.customer-map.com",
|
|
18
|
-
"publishConfig": {
|
|
19
|
-
"access": "public"
|
|
20
|
-
},
|
|
21
|
-
"dependencies": {
|
|
22
|
-
"ws": "^8.21.0"
|
|
23
|
-
}
|
|
24
|
-
}
|
|
19
|
+
],
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=18"
|
|
22
|
+
},
|
|
23
|
+
"homepage": "https://www.customer-map.com",
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"ws": "^8.21.0"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
|
+
import process from 'node:process';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
|
|
6
|
+
const BRIDGE_DIRECTORY = dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
|
|
8
|
+
export function installCodexProtocolHandler(version) {
|
|
9
|
+
if (!/^\d+\.\d+\.\d+$/.test(String(version || ''))) {
|
|
10
|
+
throw new Error('Invalid Codex Bridge version for protocol installation');
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (process.platform === 'win32') {
|
|
14
|
+
runInstaller('powershell.exe', [
|
|
15
|
+
'-NoLogo', '-NoProfile', '-ExecutionPolicy', 'Bypass',
|
|
16
|
+
'-File', join(BRIDGE_DIRECTORY, 'install-protocol-windows.ps1'),
|
|
17
|
+
'-Version', version,
|
|
18
|
+
]);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (process.platform === 'darwin') {
|
|
23
|
+
runInstaller('/bin/sh', [join(BRIDGE_DIRECTORY, 'install-protocol-macos.sh'), version]);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
throw new Error('Click-to-authorize installation currently supports Windows and macOS.');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function runInstaller(command, args) {
|
|
31
|
+
const result = spawnSync(command, args, { stdio: 'inherit', windowsHide: false });
|
|
32
|
+
if (result.error) throw result.error;
|
|
33
|
+
if (result.signal) throw new Error(`Protocol installer stopped by ${result.signal}`);
|
|
34
|
+
if (result.status !== 0) throw new Error(`Protocol installer exited (${result.status ?? 'unknown'})`);
|
|
35
|
+
}
|