agent-message 0.1.4 → 0.3.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
@@ -15,6 +15,8 @@ Agent Message is a direct-message stack with three clients:
15
15
  - Web app (`web/`)
16
16
  - CLI (`cli/`)
17
17
 
18
+ The public deployment is available at `https://am.namjaeyoun.com`.
19
+
18
20
  ## Install With npm (macOS)
19
21
 
20
22
  Install the packaged app from npm on macOS (`arm64` and `x64`).
@@ -34,15 +36,19 @@ Default ports:
34
36
  For self-hosted local use, `agent-message start` creates and uses a local SQLite database by default.
35
37
  Managed cloud deployments should run the server with `DB_DRIVER=postgres` and `POSTGRES_DSN`.
36
38
  After `agent-message start`, open `http://127.0.0.1:45788` in your browser.
37
- The bundled CLI uses `https://am.namjaeyoun.com` by default unless you override `server_url` for self-hosting.
39
+ The bundled CLI uses `https://am.namjaeyoun.com` by default unless you override `server_url` for self-hosting, which matches the public deployment web app.
40
+ Starting the local stack does not silently rewrite CLI traffic; regular commands still follow `server_url` in config unless you pass `--server-url`.
38
41
  The bundled CLI continues to work from the same command:
39
42
 
40
43
  ```bash
41
- agent-message register alice 1234
42
- agent-message login alice 1234
44
+ agent-message onboard
45
+ agent-message register alice secret123
46
+ agent-message login alice secret123
47
+ agent-message config set master jay
43
48
  agent-message ls
44
49
  agent-message open bob
45
50
  agent-message send bob "hello"
51
+ agent-message send "status update for master"
46
52
  ```
47
53
 
48
54
  Port conventions:
@@ -255,14 +261,52 @@ Install the Agent Message CLI skill to give Claude Code full knowledge of this p
255
261
  npx skills add https://github.com/siisee11/agent-message --skill agent-message-cli
256
262
  ```
257
263
 
264
+ ## claude-message
265
+
266
+ `claude-message` is a companion wrapper for Claude Code, similar to `codex-message`, but it runs Claude through `claude -p --output-format json` and relays results over `agent-message`.
267
+
268
+ Behavior:
269
+ - Starts a fresh `agent-{chatId}` account with a generated password.
270
+ - Sends the `--to` user a startup message with the generated credentials.
271
+ - Reuses the returned Claude `session_id` and resumes later turns with `--resume`.
272
+ - Watches the DM thread for plain-text prompts, adds `👀` when a request is picked up, and posts the Claude result back as `json_render`.
273
+ - Replaces the inbound `👀` reaction with `✅` after a successful Claude turn.
274
+
275
+ Example:
276
+
277
+ ```bash
278
+ claude-message --to jay --model sonnet --permission-mode accept-edits
279
+ ```
280
+
281
+ Build from source:
282
+
283
+ ```bash
284
+ make claude-message-build
285
+ ./claude-message/target/debug/claude-message --to jay --model sonnet
286
+ ```
287
+
288
+ Useful flags:
289
+ - `--to jay`
290
+ - `--cwd /path/to/worktree`
291
+ - `--model sonnet`
292
+ - `--permission-mode accept-edits`
293
+ - `--allowed-tools Read,Edit`
294
+ - `--bare`
295
+
296
+ Notes:
297
+ - `claude-message` depends on a working local `claude` install and authentication.
298
+ - `claude-message` always runs Claude with `--dangerously-skip-permissions`.
299
+ - `--permission-mode` and `--allowed-tools` can still be used to shape tool behavior, but the wrapper no longer waits on Claude permission prompts.
300
+
258
301
  ## CLI Quickstart
259
302
 
260
303
  Run from `cli/`. By default the CLI talks to `https://am.namjaeyoun.com`. For self-hosting, pass `--server-url` or set `server_url` in config.
261
304
 
262
305
  ```bash
263
306
  cd cli
264
- go run . register alice 1234
265
- go run . login alice 1234
307
+ go run . onboard
308
+ go run . register alice secret123
309
+ go run . login alice secret123
266
310
  go run . profile list
267
311
  go run . profile switch alice
268
312
  ```
@@ -283,8 +327,8 @@ go run . edit 1 "edited text"
283
327
  go run . delete 1
284
328
 
285
329
  # Reactions
286
- go run . react 1 👍
287
- go run . unreact 1 👍
330
+ go run . react <message-id> 👍
331
+ go run . unreact <message-id> 👍
288
332
 
289
333
  # Realtime watch
290
334
  go run . watch bob
@@ -292,12 +336,14 @@ go run . watch bob
292
336
 
293
337
  CLI config is stored at `~/.agent-message/config` by default.
294
338
  Each successful `login` or `register` also saves a named profile, and `go run . profile switch <username>` swaps the active account locally.
339
+ `go run . onboard` is the cloud-friendly shortcut: it interactively asks for username/password, logs in if the account exists, creates it if it does not, and sets that username as `master`.
295
340
  For a self-hosted server, set `server_url` once with `go run . config set server_url http://localhost:8080` or use `--server-url` per command.
341
+ To set a default recipient for agent reports, run `go run . config set master jay`; after that, `go run . send "done"` sends to `jay`, and `go run . send --to bob "done"` overrides it for one command.
296
342
 
297
343
  ## Validation and Constraints (Phase 7)
298
344
 
299
345
  - Username identity fields: `3-32` chars, allowed `[A-Za-z0-9._-]`
300
- - PIN: `4-6` numeric digits
346
+ - Password: `4-72` characters
301
347
  - Uploads:
302
348
  - max file size: `20 MB`
303
349
  - unsupported file types are rejected
@@ -430,6 +430,7 @@ function buildDevLaunchSpec(paths) {
430
430
  if (!existsSync(join(sourceWebDir, 'node_modules'))) {
431
431
  runForeground('npm', ['ci'], { cwd: sourceWebDir })
432
432
  }
433
+ runForeground('node', ['./scripts/generate-message-json-render-catalog-prompt.mjs'], { cwd: packageRoot })
433
434
  runForeground('npm', ['run', 'build'], { cwd: sourceWebDir })
434
435
 
435
436
  const serverBinaryPath = join(paths.binDir, 'agent-message-server')
@@ -463,8 +464,7 @@ function ensureTunnelTargetMatchesDefaults(options) {
463
464
 
464
465
  function delegateToBundledCli(args) {
465
466
  const cliBinary = resolveBinaryPath('agent-message-cli')
466
- const delegatedArgs = buildDelegatedCliArgs(args)
467
- const result = spawnSync(cliBinary, delegatedArgs, {
467
+ const result = spawnSync(cliBinary, args, {
468
468
  stdio: 'inherit',
469
469
  env: process.env,
470
470
  })
@@ -481,49 +481,6 @@ function delegateToBundledCli(args) {
481
481
  process.exit(result.status ?? 1)
482
482
  }
483
483
 
484
- function buildDelegatedCliArgs(args) {
485
- if (shouldSkipLocalServerOverride(args) || hasExplicitServerURL(args)) {
486
- return args
487
- }
488
-
489
- const localServerURL = readLocalServerURL()
490
- if (!localServerURL) {
491
- return args
492
- }
493
-
494
- return ['--server-url', localServerURL, ...args]
495
- }
496
-
497
- function shouldSkipLocalServerOverride(args) {
498
- const [command] = args
499
- return command === undefined || command === 'config' || command === 'profile'
500
- }
501
-
502
- function hasExplicitServerURL(args) {
503
- return args.some((arg) => arg === '--server-url' || arg.startsWith('--server-url='))
504
- }
505
-
506
- function readLocalServerURL() {
507
- const paths = runtimePaths(join(os.homedir(), '.agent-message'))
508
- const serverPid = readPidfile(paths.serverPidfile)
509
- if (serverPid === null || !isPidAlive(serverPid)) {
510
- return null
511
- }
512
-
513
- try {
514
- const raw = readFileSync(paths.stackMetadataPath, 'utf8')
515
- const metadata = JSON.parse(raw)
516
- const apiHost = typeof metadata.apiHost === 'string' ? metadata.apiHost.trim() : ''
517
- const apiPort = metadata.apiPort
518
- if (!apiHost || !Number.isInteger(apiPort) || apiPort <= 0 || apiPort > 65535) {
519
- return null
520
- }
521
- return `http://${apiHost}:${apiPort}`
522
- } catch {
523
- return null
524
- }
525
- }
526
-
527
484
  function writeStackMetadata(path, options) {
528
485
  const metadata = {
529
486
  apiHost: options.apiHost,