codex-message 0.4.0 → 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,27 @@ 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 `--to` user a startup message with the generated credentials.
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 Jay and waits for a text reply.
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
- codex-message --to jay --model gpt-5.4
29
- codex-message --to jay --model gpt-5.4 --yolo
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
30
35
  ```
31
36
 
32
37
  Useful flags:
33
38
 
34
- - `--to jay`
39
+ - `--to <username>` overrides `agent-message` `master`
35
40
  - `--cwd /path/to/worktree`
36
41
  - `--approval-policy on-request`
37
42
  - `--sandbox workspace-write`
@@ -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.`)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codex-message",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Codex wrapper for agent-message on macOS",
5
5
  "type": "module",
6
6
  "bin": {