Skip to content

feat: one cli-core without an override, Telegram's deletion rule and skill on the Messenger, the contract cases - #212

Merged
leemour merged 2 commits into
mainfrom
feat/cli-messaging-0.98
Oct 1, 2026
Merged

leemour merged 2 commits into
mainfrom
feat/cli-messaging-0.98

Conversation

@leemour

@leemour leemour commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

Task

Plan items 3 and 10 of cli-messaging's "port for N messengers" plan, and one copy of cli-core without the pnpm override. #211 merged the cli-messaging 0.98.0 bump while this PR was being built, so this PR is rebased onto #211 and no longer bumps anything.

Why

  • cli-messaging 0.98.0 takes @leemour/cli-core as a peer dependency (>=0.13.0 <0.16.0). With that, the override that forced one copy is no longer needed.
  • The store applies Telegram's rule for a deletion that names no chat by checking the provider's name. The plan moves that rule into tg's Messenger, so the breaking release can remove the Telegram branch from the store.
  • The MCP server serves a CLI's SKILL.md as <cli>://skill only when the Messenger names it.
  • cli-messaging ships contract cases for an adapter; tg had never run them.

What

  • The overrides entry for cli-core is removed. tg's 0.15.0 pin (from fix(docs): commands that change only this computer get their own label #211) is inside the peer range, and pnpm why @leemour/cli-core finds one version. tg commands --json is byte-for-byte the same as main's, including all 56 mutates: true marks and the 12 local marks.
  • TELEGRAM.deletedWithoutChat: the predicate is the same rule the store applies today. The store's two tests for that rule are ported to src/commands/context.test.ts and run with the predicate. A table covers channel, gigagroup, monoforum, a chat stored by its id alone, and Saved Messages.
  • TELEGRAM.skill = new URL("../../skills/tg-cli/SKILL.md", import.meta.url), exported as SKILL; tg skill uses the same constant. The file resolves from dist/commands/context.js (checked after pnpm build).
  • src/telegram/adapter.contract.test.ts runs contractCases over TelegramAdapter. A seeded stand-in for mtcute's TelegramClient holds the seed with Telegram's id shapes: a one-to-one chat's id is the person's, and a supergroup's starts with -100. It keeps what is sent and drops a repeated random_id. It pages with mtcute's own getHistory logic over Telegram's messages.getHistory offsets. 22 pass, 1 skipped: feed, because tg has no PushedHistory.
  • Fix found by the suite: contact left out the one-to-one chat, because Telegram's common chats are groups only. That chat is now in the list, newest first with the rest. The changelog has it under Fixed.

Testing

  • pnpm lint && pnpm typecheck && pnpm test: 439 passed, 1 skipped.
  • pnpm test:matrix, pnpm docs:check, pnpm parity:check, pnpm smoke:bun, pnpm version:check and pnpm install --frozen-lockfile all pass. docs/commands.md regenerates unchanged.
  • A mutation check: breaking the + 1 in around's offset makes the around case fail.
  • Nothing was run against live Telegram.

🤖 Generated with Claude Code

leemour and others added 2 commits October 1, 2026 23:54
…skill on the Messenger

- cli-messaging 0.98.0 takes @leemour/cli-core as a peer (>=0.13.0
  <0.16.0), and tg's 0.15.0 pin fits it, so the pnpm override that forced
  one copy goes. `pnpm why @leemour/cli-core` finds one version, and
  `tg commands --json` is byte-for-byte main's.
- TELEGRAM.deletedWithoutChat carries the rule the store applied for
  Telegram by name: a deletion without its chat lands only in chats whose
  ids count per account. The store's own tests for it are ported here and
  run with the predicate.
- TELEGRAM.skill names skills/tg-cli/SKILL.md, so `tg mcp` serves it as
  tg://skill; `tg skill` takes the same URL.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A seeded client stands in for mtcute's TelegramClient: it holds the
contract seed with Telegram's id shapes (a one-to-one chat's id is the
person's, a supergroup's starts -100), keeps what is sent, drops a
repeated random_id, and pages with mtcute's own getHistory logic over
Telegram's messages.getHistory offsets. 22 cases pass; `feed` is skipped,
because tg's adapter has no PushedHistory.

The suite found one gap: `contact` left out the one-to-one chat, since
Telegram's common chats are groups only. It is now among them, newest
first like the rest.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@leemour leemour changed the title feat: cli-messaging 0.98.0, one cli-core, Telegram's deletion rule and skill on the Messenger, the contract cases feat: one cli-core without an override, Telegram's deletion rule and skill on the Messenger, the contract cases Oct 1, 2026
@leemour
leemour force-pushed the feat/cli-messaging-0.98 branch from ba73dad to d368acf Compare October 1, 2026 21:55
@leemour
leemour merged commit 69b74cc into main Oct 1, 2026
5 checks passed
leemour added a commit that referenced this pull request Oct 1, 2026
…ts, the shared bot commands (#215)

The weekly breaking release. TELEGRAM_CAPABILITIES and its Capabilities
import go: the type is gone from cli-messaging (#372); the adapter
already has the four ServerReads methods, and deletedWithoutChat was set
in #212.

- messages search: words, best match first, the query language,
  --newest, --context and --source (in:max / in:all). A test drives the
  three options; docs/archive.md's search section says what they do.
- models text list|download and the shared bot watch / callbacks /
  commands / webhooks come with it. The bot ones refuse ("a Telegram bot
  cannot …") until tg's adapter has them, in the next P8 PR; their
  options are in the test matrix's untested list with that reason.
- pnpm-workspace.yaml: 0.99.0 and @leemour/cli-messaging-onnx@1.0.0 (a
  new dependency) skip the minimum release age.
- docs/commands.md and docs/dev/test-matrix.md regenerated.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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