codex-message 0.3.1 → 0.4.1
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
CHANGED
|
@@ -16,22 +16,29 @@ available on your `PATH`.
|
|
|
16
16
|
Behavior:
|
|
17
17
|
|
|
18
18
|
1. Starts a fresh `agent-{chatId}` account with a generated password.
|
|
19
|
-
2. Sends the
|
|
19
|
+
2. Sends the target user a startup message with the generated credentials.
|
|
20
20
|
3. Reuses one Codex app-server thread for the DM session.
|
|
21
21
|
4. Polls `agent-message read <user>` for new plain-text requests, adds a `👀` reaction to each accepted inbound DM, and relays it into `turn/start`.
|
|
22
|
-
5. For approval and input requests, sends readable `json_render` prompts back to
|
|
22
|
+
5. For approval and input requests, sends readable `json_render` prompts back to that user and waits for a text reply.
|
|
23
23
|
6. Sends final Codex results back as `json_render` reports and, after a successful turn completion, replaces the inbound `👀` reaction with `✅`.
|
|
24
24
|
|
|
25
|
+
If `--to` is omitted, `codex-message` uses the current `agent-message` `master` value.
|
|
26
|
+
|
|
25
27
|
Example:
|
|
26
28
|
|
|
27
29
|
```bash
|
|
28
|
-
|
|
30
|
+
agent-message config set master jay
|
|
31
|
+
codex-message --model gpt-5.4
|
|
32
|
+
codex-message --model gpt-5.4 --yolo
|
|
33
|
+
codex-message --to alice --model gpt-5.4
|
|
34
|
+
codex-message upgrade
|
|
29
35
|
```
|
|
30
36
|
|
|
31
37
|
Useful flags:
|
|
32
38
|
|
|
33
|
-
- `--to
|
|
39
|
+
- `--to <username>` overrides `agent-message` `master`
|
|
34
40
|
- `--cwd /path/to/worktree`
|
|
35
41
|
- `--approval-policy on-request`
|
|
36
42
|
- `--sandbox workspace-write`
|
|
37
43
|
- `--network-access`
|
|
44
|
+
- `--yolo` = `--approval-policy never` + `--sandbox danger-full-access`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { accessSync, constants, existsSync } from 'node:fs'
|
|
3
|
+
import { accessSync, constants, existsSync, readFileSync } from 'node:fs'
|
|
4
4
|
import { delimiter, dirname, join, resolve } from 'node:path'
|
|
5
5
|
import process from 'node:process'
|
|
6
6
|
import { spawnSync } from 'node:child_process'
|
|
@@ -9,6 +9,16 @@ import { fileURLToPath } from 'node:url'
|
|
|
9
9
|
const scriptDir = dirname(fileURLToPath(import.meta.url))
|
|
10
10
|
const packageRoot = resolve(scriptDir, '..', '..')
|
|
11
11
|
const runtimeBinDir = resolve(packageRoot, 'npm', 'runtime', 'bin')
|
|
12
|
+
const upgradeCommand = 'upgrade'
|
|
13
|
+
const packageJsonPath = resolve(packageRoot, 'package.json')
|
|
14
|
+
|
|
15
|
+
if (process.argv[2] === upgradeCommand) {
|
|
16
|
+
runGlobalUpgrade(['agent-message@latest', 'codex-message@latest'])
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (process.argv[2] === '--version') {
|
|
20
|
+
printVersion(packageJsonPath)
|
|
21
|
+
}
|
|
12
22
|
|
|
13
23
|
function resolveBinaryPath() {
|
|
14
24
|
if (process.platform !== 'darwin') {
|
|
@@ -48,6 +58,28 @@ function requireCommand(command, installHint) {
|
|
|
48
58
|
process.exit(1)
|
|
49
59
|
}
|
|
50
60
|
|
|
61
|
+
function runGlobalUpgrade(packages) {
|
|
62
|
+
const npmCommand = process.platform === 'win32' ? 'npm.cmd' : 'npm'
|
|
63
|
+
const result = spawnSync(npmCommand, ['install', '-g', ...packages], {
|
|
64
|
+
stdio: 'inherit',
|
|
65
|
+
cwd: process.cwd(),
|
|
66
|
+
env: process.env,
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
if (result.error) {
|
|
70
|
+
console.error(result.error.message)
|
|
71
|
+
process.exit(1)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
process.exit(result.status ?? 1)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function printVersion(path) {
|
|
78
|
+
const packageJson = JSON.parse(readFileSync(path, 'utf8'))
|
|
79
|
+
console.log(`${packageJson.name} ${packageJson.version}`)
|
|
80
|
+
process.exit(0)
|
|
81
|
+
}
|
|
82
|
+
|
|
51
83
|
const binaryPath = resolveBinaryPath()
|
|
52
84
|
if (!existsSync(binaryPath)) {
|
|
53
85
|
console.error(`packaged codex-message binary is missing at ${binaryPath}. Reinstall the package or rebuild the npm bundle.`)
|
|
Binary file
|
|
Binary file
|