Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.2.34 #163

Merged
merged 26 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ jobs:
run: yarn
- name: Build
run: yarn build:message-kit
- name: Test client
run: yarn test:client
continue-on-error: true
env:
KEY: ${{ secrets.KEY }}
TEST_ENCRYPTION_KEY: ${{ secrets.TEST_ENCRYPTION_KEY }}
- name: Test parsing
run: yarn test:parsing
continue-on-error: true
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
- name: Test client
run: yarn test:client
- name: Test v3
run: yarn test:v3
- name: Test v2
run: yarn test:v2
- name: Test Frames
run: yarn test:frames
- name: Test Prompting
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ This is the official repository for [MessageKit](https://message-kit.org/). Powe
- [`message-kit`](/packages/message-kit): A kit for quickly building messaging apps
- [`create-message-kit`](/packages/create-message-kit): A CLI for creating new apps easily
- [`framekit`](/packages/framekit): A suite for backend frames
- ['xmtp](/packages/xmtp/): A secure agent sdk
- [`xmtp-client`](/packages/xmtp-client/): Client sided agent sdk
- [`docs`](/packages/docs): Documentation for MessageKit

## Contributing
Expand Down
14 changes: 14 additions & 0 deletions community/plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,20 @@
"icon": "📒",
"author": "humanagent"
},
{
"href": "/plugins/xmtp",
"title": "xmtp",
"description": "Use Xmtp to send E2EE messages.",
"icon": "💬",
"author": "ephemeraHQ"
},
{
"href": "/plugins/xmtp-groups",
"title": "Xmtp Groups",
"description": "Use Xmtp Groups to manage groups.",
"icon": "🧑‍🧑‍🧒",
"author": "ephemeraHQ"
},
{
"href": "/plugins/gpt",
"title": "GPT",
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "message-kit-monorepo",
"version": "1.2.33",
"version": "1.2.35",
"private": true,
"type": "module",
"workspaces": [
Expand All @@ -13,28 +13,28 @@
"build:message-kit": "turbo run build --filter=./packages/message-kit --force",
"build:packages": "turbo run build --filter='./packages/*' --filter='!./packages/message-kit'",
"build:templates": "turbo run build --filter='./templates/*'",
"build:xmtp": "turbo run build --filter=./packages/xmtp --force",
"build:xmtp-client": "turbo run build --filter=./packages/xmtp-client --force",
"bump": "node scripts/update-version.js -t patch",
"changeset": "yarn copy && changeset add --type patch",
"clean": "turbo run clean && rm -rf node_modules && rm -rf .turbo && rm -rf packages/message-kit/dist && rm -rf packages/message-kit/.turbo && rm -rf packages/docs/dist && yarn cache clean",
"cli": "node packages/create-message-kit/index.js",
"copy": "node scripts/copyTemplates.js",
"dev": "cd packages/message-kit && yarn build:watch",
"dev": "yarn build:xmtp && cd packages/message-kit && yarn build:watch",
"docs": "cd packages/docs && yarn dev",
"domain": "ngrok http --hostname=frames.ngrok.app 3000",
"format": "turbo run format",
"framekit": "cd packages/framekit && yarn dev",
"framekit": "yarn build:xmtp-client && cd packages/framekit && yarn dev",
"play": "cd templates/playground && yarn dev",
"publish": "node scripts/publish.js",
"publish": "yarn install && yarn build && yarn copy && node scripts/publish.js",
"templates": "node scripts/devTemplates.js",
"test": "FORCE_COLOR=1 turbo run test --force --concurrency=1",
"test:client": "cd packages/message-kit/tests && yarn test:client",
"test:client": "cd packages/xmtp/tests && yarn test:client",
"test:flow": "cd packages/message-kit/tests && yarn test:flow",
"test:framekit": "cd packages/message-kit/tests && yarn test:framekit",
"test:intent": "cd packages/message-kit/tests && yarn test:intent",
"test:parsing": "cd packages/message-kit/tests && yarn test:parsing",
"test:prompt": "cd packages/message-kit/tests && yarn test:prompt",
"test:v2": "cd packages/message-kit/tests && yarn test:v2",
"test:v3": "cd packages/message-kit/tests && yarn test:v3",
"typecheck": "FORCE_COLOR=1 turbo run typecheck"
},
"resolutions": {
Expand Down
9 changes: 1 addition & 8 deletions packages/create-message-kit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { default as fs } from "fs-extra";
import { isCancel } from "@clack/prompts";
import { detect } from "detect-package-manager";
import pc from "picocolors";
const defVersion = "1.2.33";
const __dirname = dirname(fileURLToPath(import.meta.url));

// Read package.json to get the version
Expand All @@ -26,13 +25,7 @@ program
log.info(pc.cyan(`pkgManager detected: ${pkgManager}`));

log.info(pc.cyan(`Welcome to MessageKit CLI v${version}!`));
if (version !== defVersion) {
log.warn(
pc.red(
"You are using a version of the CLI that is not compatible with the latest MessageKit. Please update to the latest version.",
),
);
}

const coolLogo = `
███╗ ███╗███████╗███████╗███████╗ █████╗ ██████╗ ███████╗██╗ ██╗██╗████████╗
████╗ ████║██╔════╝██╔════╝██╔════╝██╔══██╗██╔════╝ ██╔════╝██║ ██╔╝██║╚══██╔══╝
Expand Down
2 changes: 1 addition & 1 deletion packages/create-message-kit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-message-kit",
"version": "1.2.33",
"version": "1.2.35",
"license": "MIT",
"type": "module",
"main": "index.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/docs/pages/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
- **New Features**

- Introduced a new `Video` component for enhanced documentation presentation.
- Added a new `XmtpPlugin` class for managing conversations and groups using the XMTP protocol.
- Added a new `XMTP` class for managing conversations and groups using the XMTP protocol.
- Enhanced `FrameKit` functionality for simplified receipt generation and wallet interactions.
- Added a `getWalletCount` method to the `LocalStorage` class for counting wallet files.
- Implemented a new content type for agent messages, including encoding and decoding logic.
Expand Down Expand Up @@ -435,7 +435,7 @@ Overall, these changes aim to enhance the functionality of GPT-based agents, imp
- Replaced one-to-one with Agent example
- Documented `skills`
- Renamed examples as templates
- How to use a second `xmtpClient` client
- How to use a second `createClient` client
- Optional parameters concepts/structure#optional-parameters
- Added changelog

Expand Down
19 changes: 4 additions & 15 deletions packages/docs/pages/concepts/agents.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,15 @@ agent/
This is the main function that runs the listener.

```jsx
import { Agent, run, type Context } from "@xmtp/message-kit";

const agent: Agent = {
name: "Agent Name",
tag: "@bot",
description: "Agent Description",
skills: [skill1, skill2]
};
//starts the agent
run(agent);
// [!include ~/../../templates/simple/src/index.ts]
```

### Config

```tsx
const agent: Agent = {
config: {
/* Optional properties */
},
};
config: {
/* Optional properties */
}
```

- `privateKey`: the private key of the agent wallet, like any normal wallet private key.
Expand Down
19 changes: 7 additions & 12 deletions packages/docs/pages/concepts/xmtp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

[XMTP](https://xmtp.org/) is the protocol that MessageKit uses to send and receive messages.

> Check out the [XMTP AI](/plugins/xmtp) plugins for more information.

## Context

The `Context` object is a core component that provides access to all XMTP messaging functionality. It handles conversations, groups, and messages.
Expand Down Expand Up @@ -32,15 +34,8 @@ Contains information about the current message:
- `sender`: Address of message sender
- `sent`: Timestamp when message was sent
- `typeId`: Type of message

#### Clients

- `client`: V3 XMTP client instance
- `v2client`: V2 XMTP client instance
- `version`: Current client version

#### Conversation

- `conversation`: Current conversation object with messaging methods

#### Group (V3 Only)
Expand All @@ -56,7 +51,7 @@ Group chat information including:
Each messages comes with a sender object that contains the address, name, and avatar of the sender.

```tsx
interface AbstractedMember {
interface Member {
// Unique identifier for the user's inbox
inboxId: string;

Expand Down Expand Up @@ -86,15 +81,15 @@ const { sender } = context.message;
MessageKit provides wrapped versions of XMTP clients for easier integration:

```tsx
import { V2Client, V3Client } from "@xmtp/message-kit";
import { V2Client, V3Client } from "xmtp";
```

You can create new client instances using the `xmtpClient` helper:
You can create new client instances using the `createClient` helper:

```tsx
import { xmtpClient } from "@xmtp/message-kit";
import { createClient } from "xmtp";

const { v2client } = await xmtpClient({
const { v2client } = await createClient({
// Optional configuration
});
```
Expand Down
4 changes: 2 additions & 2 deletions packages/docs/pages/plugins/cron.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ Run a node cron daily to send message to users

```tsx [src/plugins/cron.ts]
import cron from "node-cron";
import { xmtpClient } from "@xmtp/message-kit";
import { createClient } from "xmtp";
import { RedisClientType } from "@redis/client";

export async function startCron(redisClient: RedisClientType) {
// Daily task
const client = await xmtpClient();
const client = await createClient();
console.log("Starting daily cron");
cron.schedule(
"0 0 * * *", // Daily or every 5 seconds in debug mode
Expand Down
4 changes: 2 additions & 2 deletions packages/docs/pages/plugins/stackso.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export type { StackClient };
## Example handler

```tsx [src/handler/loyalty.ts]
import { Context, AbstractedMember } from "@xmtp/message-kit";
import { Context, Member } from "@xmtp/message-kit";
import { getStackClient } from "../plugins/stack.js";

export async function handler(context: Context, fake?: boolean) {
Expand Down Expand Up @@ -76,7 +76,7 @@ export async function handler(context: Context, fake?: boolean) {
} else if (typeId === "group_updated") {
const { initiatedByInboxId, addedInboxes } = params;
const adminAddress = members?.find(
(member: AbstractedMember) => member.inboxId === initiatedByInboxId,
(member: Member) => member.inboxId === initiatedByInboxId,
);
if (addedInboxes && addedInboxes.length > 0) {
//if add someone to the group
Expand Down
19 changes: 19 additions & 0 deletions packages/docs/pages/plugins/xmtp-groups.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# XMTP Groups

This is a simple abstracted plugin to manage groups on XMTP.

## Description

Interact with XMTP Groups.

## Install libraries

```bash [cmd]
npm install @xmtp/node-sdk
```

## Usage

```tsx
// [!include ~/../../templates/gated-group/src/plugins/xmtp-groups.ts]
```
Loading
Loading