create-message-kit 1.1.7-beta.5 → 1.1.7-beta.6

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-message-kit",
3
- "version": "1.1.7-beta.5",
3
+ "version": "1.1.7-beta.6",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -1,7 +1,7 @@
1
1
  import { HandlerContext, SkillResponse } from "@xmtp/message-kit";
2
- import { getUserInfo, clearInfoCache, isOnXMTP } from "../lib/resolver.js";
2
+ import { getUserInfo, clearInfoCache, isOnXMTP } from "@xmtp/message-kit";
3
3
  import { isAddress } from "viem";
4
- import { clearMemory } from "../lib/gpt.js";
4
+ import { clearMemory } from "@xmtp/message-kit";
5
5
 
6
6
  export const frameUrl = "https://ens.steer.fun/";
7
7
  export const ensUrl = "https://app.ens.domains/";
@@ -86,13 +86,7 @@ export async function handleEns(
86
86
  }
87
87
  message += `\n\nWould you like to tip the domain owner for getting there first 🤣?`;
88
88
  message = message.trim();
89
- if (
90
- await isOnXMTP(
91
- context.v2client,
92
- data?.ensInfo?.ens,
93
- data?.ensInfo?.address,
94
- )
95
- ) {
89
+ if (await isOnXMTP(context.client, context.v2client, sender?.address)) {
96
90
  await context.send(
97
91
  `Ah, this domains is in XMTP, you can message it directly: https://converse.xyz/dm/${domain}`,
98
92
  );
@@ -1,7 +1,7 @@
1
1
  import { run, HandlerContext } from "@xmtp/message-kit";
2
- import { textGeneration, processMultilineResponse } from "./lib/gpt.js";
2
+ import { textGeneration, processMultilineResponse } from "@xmtp/message-kit";
3
3
  import { agent_prompt } from "./prompt.js";
4
- import { getUserInfo } from "./lib/resolver.js";
4
+ import { getUserInfo } from "@xmtp/message-kit";
5
5
 
6
6
  run(async (context: HandlerContext) => {
7
7
  /*All the skills are handled through the skills file*/
@@ -1,6 +1,11 @@
1
1
  import { skills } from "./skills.js";
2
- import { UserInfo, PROMPT_USER_CONTENT } from "./lib/resolver.js";
3
- import { PROMPT_RULES, PROMPT_SKILLS_AND_EXAMPLES } from "./lib/gpt.js";
2
+ import {
3
+ getUserInfo,
4
+ UserInfo,
5
+ PROMPT_USER_CONTENT,
6
+ PROMPT_RULES,
7
+ PROMPT_SKILLS_AND_EXAMPLES,
8
+ } from "@xmtp/message-kit";
4
9
 
5
10
  export async function agent_prompt(userInfo: UserInfo) {
6
11
  let { address, ensDomain, converseUsername, preferredName } = userInfo;
@@ -1,4 +1,4 @@
1
- import { handleEns } from "./handler/ens";
1
+ import { handleEns } from "./handler/ens.js";
2
2
  import type { SkillGroup } from "@xmtp/message-kit";
3
3
 
4
4
  export const skills: SkillGroup[] = [
@@ -1,5 +1,5 @@
1
1
  import { HandlerContext, AbstractedMember } from "@xmtp/message-kit";
2
- import { textGeneration } from "../lib/gpt.js";
2
+ import { textGeneration } from "@xmtp/message-kit";
3
3
 
4
4
  export async function handler(context: HandlerContext) {
5
5
  if (!process?.env?.OPEN_AI_API_KEY) {
@@ -1,5 +1,5 @@
1
1
  import { HandlerContext, AbstractedMember } from "@xmtp/message-kit";
2
- import { getUserInfo } from "../lib/resolver.js";
2
+ import { getUserInfo } from "@xmtp/message-kit";
3
3
 
4
4
  export async function handler(context: HandlerContext) {
5
5
  const {
@@ -1,5 +1,5 @@
1
1
  import { HandlerContext } from "@xmtp/message-kit";
2
- import { getUserInfo } from "../lib/resolver.js";
2
+ import { getUserInfo } from "@xmtp/message-kit";
3
3
 
4
4
  // Main handler function for processing commands
5
5
  export async function handler(context: HandlerContext) {