create-message-kit 1.2.33 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -1,18 +1,3 @@
1
- # create-message-kit
1
+ # MessageKit
2
2
 
3
- Is a command-line interface tool designed to help developers create and manage their custom build configurations easily.
4
-
5
- To install it run the following command:
6
-
7
- ```bash
8
- bun create message-kit
9
- ```
10
-
11
- ```bash
12
- npx create-message-kit@latest
13
- ```
14
-
15
- ```bash
16
- yarn create message-kit
17
- // use yarn create message-kit@latest in yarn > v2
18
- ```
3
+ See [MessageKit](https://message-kit.org/) quickstart
package/index.js CHANGED
@@ -7,7 +7,6 @@ import { default as fs } from "fs-extra";
7
7
  import { isCancel } from "@clack/prompts";
8
8
  import { detect } from "detect-package-manager";
9
9
  import pc from "picocolors";
10
- const defVersion = "1.2.33";
11
10
  const __dirname = dirname(fileURLToPath(import.meta.url));
12
11
 
13
12
  // Read package.json to get the version
@@ -26,13 +25,7 @@ program
26
25
  log.info(pc.cyan(`pkgManager detected: ${pkgManager}`));
27
26
 
28
27
  log.info(pc.cyan(`Welcome to MessageKit CLI v${version}!`));
29
- if (version !== defVersion) {
30
- log.warn(
31
- pc.red(
32
- "You are using a version of the CLI that is not compatible with the latest MessageKit. Please update to the latest version.",
33
- ),
34
- );
35
- }
28
+
36
29
  const coolLogo = `
37
30
  ███╗ ███╗███████╗███████╗███████╗ █████╗ ██████╗ ███████╗██╗ ██╗██╗████████╗
38
31
  ████╗ ████║██╔════╝██╔════╝██╔════╝██╔══██╗██╔════╝ ██╔════╝██║ ██╔╝██║╚══██╔══╝
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-message-kit",
3
- "version": "1.2.33",
3
+ "version": "1.3.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -1,4 +1,4 @@
1
- import { run, Agent } from "@xmtp/message-kit";
1
+ import { createAgent } from "@xmtp/message-kit";
2
2
  import { checkDomain } from "./skills/check.js";
3
3
  import { cool } from "./skills/cool.js";
4
4
  import { info } from "./skills/info.js";
@@ -6,11 +6,9 @@ import { register } from "./skills/register.js";
6
6
  import { renew } from "./skills/renew.js";
7
7
  import { pay } from "./skills/pay.js";
8
8
 
9
- export const agent: Agent = {
9
+ export const agent = createAgent({
10
10
  name: "Ens Agent",
11
11
  tag: "@bot",
12
12
  description: "A ens agent with a lot of skills.",
13
13
  skills: [checkDomain, cool, info, register, renew, pay],
14
- };
15
-
16
- run(agent);
14
+ }).run();
@@ -1,4 +1,4 @@
1
- import { Context, FrameKit, getUserInfo, Skill } from "@xmtp/message-kit";
1
+ import { Context, baselinks, Skill } from "@xmtp/message-kit";
2
2
 
3
3
  export const pay: Skill[] = [
4
4
  {
@@ -44,17 +44,17 @@ export async function handler(context: Context) {
44
44
  message: {
45
45
  content: {
46
46
  skill,
47
- params: { amount, token, username },
47
+ params: { amount, username },
48
48
  },
49
49
  },
50
50
  } = context;
51
51
  let receiverAddress = username?.address;
52
52
  if (skill === "tip") {
53
53
  let tipAmount = 1;
54
- const url = await FrameKit.requestPayment(receiverAddress, tipAmount);
55
- await context.dm(url);
54
+ const url = baselinks.paymentLink(receiverAddress, tipAmount);
55
+ await context.send({ message: url, originalMessage: context.message });
56
56
  } else if (skill === "pay") {
57
- const url = await FrameKit.requestPayment(receiverAddress, amount, token);
58
- await context.dm(url);
57
+ const url = baselinks.paymentLink(receiverAddress, amount);
58
+ await context.send({ message: url, originalMessage: context.message });
59
59
  }
60
60
  }
@@ -1,7 +1,7 @@
1
- import { run, Agent, concierge } from "@xmtp/message-kit";
1
+ import { concierge, createAgent } from "@xmtp/message-kit";
2
2
  import { degen } from "./vibes/degen.js";
3
3
 
4
- const agent: Agent = {
4
+ export const agent = createAgent({
5
5
  name: "Human Agent",
6
6
  tag: "@bot",
7
7
  description: "An agent that performs payments and transfers in usdc. .",
@@ -12,6 +12,6 @@ const agent: Agent = {
12
12
  config: {
13
13
  walletService: true,
14
14
  },
15
- };
15
+ }).run();
16
+
16
17
 
17
- run(agent);
@@ -1,7 +1,7 @@
1
1
  // [!region index]
2
- import { run, agentReply, Context, Agent } from "@xmtp/message-kit";
2
+ import { agentReply, Context, createAgent } from "@xmtp/message-kit";
3
3
 
4
- export const agent: Agent = {
4
+ export const agent = createAgent({
5
5
  name: "GPT Bot",
6
6
  description: "Use GPT to generate text responses.",
7
7
  tag: "@bot",
@@ -10,7 +10,5 @@ export const agent: Agent = {
10
10
  await agentReply(context);
11
11
  // [!region final]
12
12
  },
13
- };
14
-
15
- run(agent);
13
+ }).run();
16
14
  // [!endregion final]