feat: upgrade to @doist/comms-sdk@0.2.0#2
Conversation
Switches the SDK dependency from the local file: link to the published registry version, and migrates the CLI to the SDK's new shape. ## What changed - **SDK source**: `file:../comms-sdk-typescript` → `0.1.0-alpha.1` from npm - **Batch removed**: replaced every `client.batch(...)` site with direct `Promise.all(...)` of individual calls; dropped the `assertBatchData`, `buildBatchNameMap`, `getOptionalBatchData`, and `buildOptionalBatchNameMap` helpers in `src/lib/api.ts` - **String IDs**: thread, channel, comment, conversation, message, and group IDs are now base58 strings instead of numbers. `parseRef`, `resolveThreadId`/`resolveChannelId`/etc, URL parsing regexes, and all consumers updated accordingly. User and workspace IDs stay numeric. - **User schema rename**: `User.name` → `User.fullName`; `User.bot` and `User.defaultWorkspace` were removed from the SDK. Default-workspace resolution now uses `api.workspaces.getDefaultWorkspace()`. The display of `[bot]` was dropped since `userType` no longer carries that signal. - **Groups API**: every group method (`getGroup`, `updateGroup`, `deleteGroup`, `addUsers`, `removeUsers`) now requires `workspaceId` alongside the string `id`. Wrappers and callers in `commands/groups/*` updated. - **Away removed**: the SDK dropped `awayMode` / `AWAY_MODE_TYPES`, so the `tdc away ...` command tree is removed too. We'll bring it back if/when the API surfaces it again. - **Search v3 → v1**: `src/lib/search-api.ts` now hits `/api/v1/search` (was `/api/v3/search`) and uses string channel/conversation IDs. - **`COMMS_BASE_URL`**: new env var lets users point at staging / alternate hosts; threaded through the SDK client and the search-api fallback. - **buildUserNameMap helper**: replaces per-user batch lookups with a single `getWorkspaceUsers` call, scoped to the calling client so test mocks of `getCommsClient` apply. ## Smoke testing Verified against staging (workspace 48121) with `COMMS_BASE_URL` set: `tdc user`, `tdc workspaces`, `tdc users`, `tdc channels`, `tdc channel threads`, `tdc thread view`, `tdc inbox`, `tdc search`, `tdc view <url>`, and `tdc conversation unread` all return clean data. `tdc mentions` 400s on staging because the backend now requires a `query` arg even when `mention_self=true` — leaving that for PR2. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Regenerating the lockfile on darwin dropped the non-darwin rolldown optional bindings, so CI on ubuntu couldn't find `@rolldown/binding-linux-x64-gnu`. Reseeded the lockfile from `main` and re-resolved only `@doist/comms-sdk`, which keeps all 15 platform binding entries. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
doistbot
left a comment
There was a problem hiding this comment.
This update successfully migrates the CLI to the published @doist/comms-sdk alpha, updating entity IDs to strings and replacing legacy batch requests with parallel SDK calls. This modernization keeps the CLI in lock-step with upstream changes and simplifies the underlying data models. There are a few areas to refine, specifically optimizing the user map fetches to avoid loading full workspace directories for single conversations or groups, restoring lazy lookup optimizations, ensuring the AI skill documentation reflects the removal of the away command, and addressing minor test coverage and code deduplication details.
- Drop the "Away Status" section from `src/lib/skills/content.ts` and
regenerate `skills/comms-cli/SKILL.md` so the agent skill matches the
removed command tree.
- Extract `fetchUnreadThreadIds(client, workspaceId)` into
`src/lib/threads.ts`; `inbox.ts` and `channel/threads.ts` now share
one place to normalise the SDK's `{ data, version }` unread shape.
- Restore active-first lookup in `findDirectConversation`: only scan
archived conversations when the active page misses, instead of always
fetching both pages in parallel.
- `conversation/view.ts` and `groups/view.ts` switch from a workspace-wide
user fetch to per-ID `getUserById` calls so small reads don't pay for
the full directory; both fall back to `user:${id}` when a lookup fails.
- Add a regression test for the new `Promise.all` path in `inbox.ts` and a
graceful-fallback test for `conversation view` when participant lookups
reject. Move repeated `clearWorkspaceUserCache()` to one top-level
`beforeEach` in `conversation.test.ts`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a "Staging / alternate hosts" subsection under Setup explaining how to point the CLI at a non-production Comms instance. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0.2.0 is a release-pipeline bump with no API changes since 0.1.0-alpha.1 — typecheck, tests (615/615), and staging smoke pass unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
## 1.0.0 (2026-05-25) ### Features * add channel create and update commands ([#4](#4)) ([f097378](f097378)) * adopt cli-core DCR provider + account command attachers ([#5](#5)) ([4749a07](4749a07)) * bootstrap Comms CLI from twist-cli ([ea28735](ea28735)) * upgrade to @doist/comms-sdk@0.2.0 ([#2](#2)) ([ae4d6e1](ae4d6e1))
|
🎉 This PR is included in version 1.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Context
The CLI was bootstrapped from
twist-cliand still depended on@doist/comms-sdkthrough a localfile:../comms-sdk-typescriptpath.Since then, the SDK has changed in several ways:
User.nametoUser.fullNameUser.bot,User.defaultWorkspace, andawayMode/api/v3to/api/v1This PR moves the CLI to the published SDK package and updates all call sites so the CLI and SDK stay aligned.
What changed
package.jsonto use"@doist/comms-sdk": "0.1.0-alpha.1"from the registry instead of the localfile:dependency, then regenerated the lockfile.client.batch(...)calls withPromise.all(...)over direct client calls.src/lib/api.ts.refs.ts,public-channels.ts, command handlers, fixtures, and URL regexes.User.namewithUser.fullName.api.workspaces.getDefaultWorkspace().User.botis no longer exposed.{ id, workspaceId }.tdc away ..., since the SDK no longer exposesawayMode./api/v1/searchinstead of/api/v3/search.COMMS_BASE_URLsupport for both the SDK client and the search API fallback, so the CLI can target staging and alternate hosts.buildUserNameMap(workspaceId, client?), backed by a singlegetWorkspaceUserscall.Out of scope
tdc mentionscurrently returns400on staging because the backend now requires aqueryarg even whenmention_self=true. This will be fixed in the follow-up modernization PR.Test plan
npm run type-checkcleannpm run lint:checkcleannpm testpasses, 612/612npm run build48121, withCOMMS_BASE_URL:tdc usertdc workspacestdc users 48121tdc channels 48121tdc channel threads <id> 48121tdc thread view <id>tdc view <comms-url>tdc inbox 48121tdc conversation unread 48121tdc search smoke --workspace 48121🤖 Generated with Claude Code