Skip to content

feat(boss/chatmsg): add --raw to expose full JD card body#1720

Closed
GreyC wants to merge 17 commits into
jackwener:mainfrom
GreyC:pr/issue-13-chatmsg-raw
Closed

feat(boss/chatmsg): add --raw to expose full JD card body#1720
GreyC wants to merge 17 commits into
jackwener:mainfrom
GreyC:pr/issue-13-chatmsg-raw

Conversation

@GreyC
Copy link
Copy Markdown
Contributor

@GreyC GreyC commented May 22, 2026

Summary

boss chatmsg --side geek currently truncates non-text bodies to 120 chars in mapGeekMsg, destroying JD cards. This PR adds a --raw flag that emits structured per-message objects with the full body preserved, so callers can extract body.jobDesc.url and other fields needed for boss detail.

Closes GreyC#13.

Changes

  • clis/boss/chatmsg.js — add --raw boolean arg; both mapBossMsg / mapGeekMsg now accept { raw } and append security_id + full body to the row when raw is true; threaded the flag through all four call sites (boss-side, geek-side, auto-recruiter, auto-fallback-geek)
  • clis/boss/chatmsg.test.js — 3 new tests in a --raw mode (JD card exposure) block using a JD-card fixture with a long body.jobDesc.content
  • cli-manifest.json — rebuilt; the new raw arg lands inside the boss/chatmsg entry

Design notes

  • Columns unchanged at ['from', 'type', 'text', 'time']. src/output.ts's renderJson/renderYaml ignore the columns array (they stringify the full object), while renderTable/renderMarkdown/renderCsv/renderPlain use it. Raw mode's extra fields therefore surface naturally in --fmt json/yaml (the intended consumption path for JD card extraction by boss detail) while the table view keeps showing the same four columns — no regression for existing callers
  • Raw mode is a pure superset of compact output: it adds security_id + body alongside the existing four fields, doesn't replace text. Callers parsing JSON output continue to work
  • JD fixture content placement: long content lives under body.jobDesc.content (not top-level body.content) so mapGeekMsg's m.body?.content short-circuit can't catch it — this guarantees the JSON.stringify(...).slice(0, 120) truncation branch is exercised by the compact-mode regression test

Test plan

  • npx vitest run clis/boss/chatmsg.test.js → 14/14 pass (11 previous + 3 new)
  • npx vitest run clis/boss/ → full boss suite 29/29 pass
  • npm run typecheck → clean
  • npm run build-manifestraw arg lands in cli-manifest.json
  • Live verify on a job-seeker profile with a chat containing a JD card

🤖 Generated with Claude Code

Jeff Chen and others added 17 commits May 11, 2026 01:25
Migrate multi-profile support to upstream contextId routing
Add fallback extraction for Facebook feed posts when [role=article] nodes exist but contain empty text. Includes diagnostic errors, content/author cleanup, nested-container dedupe, and an evaluate-script syntax regression test.
Closes #9.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…e, dedup auto path

- Regenerate cli-manifest.json so --side is recognized by the CLI
- readEncryptSystemId: expand to script tags, broader window scan, localStorage
  values; return '' instead of throwing so API can surface its own error
- chatlist: slice labelList before fetchGeekFriendInfoList to skip unnecessary batch calls
- chatmsg: refactor bossChatMsg to accept optional friend, eliminating duplication in auto path

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…rmance entries

Add Option 1 (Vue app runtime state) and Option 2 (performance resource entries)
as the primary extraction paths, demoting the previous guesswork approaches to
fallbacks. The page itself issues geekFilterByLabel with encryptSystemId already
in the URL, so performance.getEntriesByType('resource') gives a deterministic
source. Pinia stores and $route.query cover the Vue runtime state path.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ved flag

The live geek historyMsg API returns received:true for all messages
including outgoing ones. Determine direction by comparing m.from.uid
against the boss numeric uid instead.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
feat(boss): add job-seeker side for chatlist and chatmsg
# Conflicts:
#	extension/src/background.test.ts
#	skills/opencli-browser/SKILL.md
#	src/cli.ts
Captures conventions the upstream maintainer enforces by amending PRs
before merging (observed across jackwener#1538-jackwener#1542): typed errors, fail-fast
arg validation, imperative func over pipeline, JSON.parse type guards,
merge-then-filter, scored Array.find replacement, stale socket guards,
error-path tests, lifecycle docs, manifest rebuild.

Claude Code auto-loads CLAUDE.md; AGENTS.md points other AI tools to it.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
# Conflicts:
#	clis/boss/chatlist.js
#	clis/boss/chatlist.test.js
#	clis/boss/chatmsg.js
#	clis/boss/chatmsg.test.js
#	clis/boss/utils.js
#	clis/facebook/feed.js
#	clis/facebook/feed.test.js
#	docs/guide/browser-bridge.md
#	docs/zh/guide/browser-bridge.md
#	extension/dist/background.js
#	extension/src/background.test.ts
#	extension/src/background.ts
#	skills/opencli-browser/SKILL.md
@GreyC
Copy link
Copy Markdown
Contributor Author

GreyC commented May 22, 2026

Misfiled — should be on the GreyC/OpenCLI fork first. Reopening there.

@GreyC GreyC closed this May 22, 2026
@GreyC GreyC deleted the pr/issue-13-chatmsg-raw branch May 22, 2026 08:09
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.

boss chatmsg: expose full JD card body instead of truncating non-text messages

1 participant