CtrlK
BlogDocsLog inGet started
Tessl Logo

pubnub/pubnub-chat

Build chat applications with PubNub Chat SDK

Does it follow best practices?

Evaluation100%

1.14x

Agent success when using this tile

Validation for skill structure

Overview
Skills
Evals
Files

task.mdevals/scenario-2/

Direct Messaging Service Module

Context

You are building a messaging application using the PubNub Chat SDK. Users can initiate one-on-one conversations with any other user in the system. The same two users may open their conversation many times throughout a session, and the application should handle this efficiently without redundant operations. Users may or may not already exist in the PubNub system when a conversation is initiated.

Task

Write a JavaScript module (dm-service.js) that provides:

  1. A function to open a direct conversation between the current user and another user, given the other user's ID and display name
  2. Efficient handling when the same conversation is opened multiple times during a session
  3. Proper handling when the target user does not yet exist in the system

Assume a Chat SDK instance is passed in during initialization.

Expected Outputs

  • A dm-service.js file with a class or set of functions for managing direct message conversations.

Install with Tessl CLI

npx tessl i pubnub/pubnub-chat

evals

SKILL.md

tile.json