Skip to content

Phase 4: nemar admin mail CLI - #1940

Merged
neuromechanist merged 10 commits into
feature/issue-1893-epic-email-cffrom
feature/issue-1897-phase4-cli-mail
Oct 24, 2026
Merged

neuromechanist merged 10 commits into
feature/issue-1893-epic-email-cffrom
feature/issue-1897-phase4-cli-mail

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Summary

Adds nemar admin mail, the command line over the support-ticket admin API from Phase 3 (#1930). It is the one tool human admins and the nemarAdmin agent use to work tickets; nothing in it distinguishes the two.

  • list, show, reply, note, assign, status, close, escalate, queues (list/set), away (show/set/clear), reprocess.
  • --json on every command: the API body on stdout, {error, code} on stderr.
  • Replies always carry an Idempotency-Key; one is generated and printed before sending when none is given, and a lost or uncertain send tells the caller to retry with that key. A non-TTY reply without --yes is refused and sends nothing.
  • Exit codes: 0 ok, 1 API or network error, 2 usage or refused confirmation, 3 not found or not visible.
  • Ticket text comes from outside, so all human output goes through a new terminalSafeText, which keeps newlines and tabs and escapes every other control and bidi character. --json stays verbatim.
  • Users may be named as me, none, an id, or a username.

Closes #1897
Part of epic #1893

Test plan

  • test/admin-mail-cli.test.ts: 31 tests spawning the real CLI against a local HTTP fixture (filters, paging, hostile-text escaping, idempotency keys, non-TTY refusal, retry guidance, user resolution, exit codes, queue and availability bodies)
  • test/terminal-safe-text.unit.test.ts: 6 tests
  • typecheck, lint, export-surface, route-inventory, help-tier and CI-tier tests
  • CI
  • Staging at the single epic merge: list shows the test ticket, reply round trip, security@ hidden from an admin key

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR1940

Version: 0.10.24-PR1940.f9f5925
Commit: f9f5925


🤖 Updated on each push.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A failed name lookup partway through show, queues or away no longer leaves a partial render on stdout. --json detection in usage errors ignores arguments after --.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The server answers every repeat of a reply_delivery_unknown key the same way and never sends it, so the CLI no longer tells the caller to retry with it. It says to read the thread and that only a new key sends again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
neuromechanist and others added 2 commits October 24, 2026 11:39
The display escape set now covers Unicode category Cf (soft hyphen, invisible operators, tag characters) and the invisible look-alikes outside it (combining grapheme joiner, Hangul fillers, variation selectors). Astral code points are written as \u{...}.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
ReplyResponse.message_id is the stored row id, a number; the contract said string. Adds NoteResponse for the note route.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@neuromechanist
neuromechanist merged commit 0b6ba25 into feature/issue-1893-epic-email-cf Oct 24, 2026
14 checks passed
@neuromechanist
neuromechanist deleted the feature/issue-1897-phase4-cli-mail branch October 24, 2026 19:13

This branch was previously deployed

1 inactive deployment
npm — f9f59251 Deployed Oct 24, 2026 by neuromechanist via publish #3917
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant