create-message-kit 1.1.8-beta.3 → 1.1.8-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -79,6 +79,10 @@ async function addPackagejson(destDir, name, pkgManager) {
79
79
  dependencies: {
80
80
  "@xmtp/message-kit": "latest",
81
81
  },
82
+ devDependencies: {
83
+ "@types/node": "latest",
84
+ typescript: "latest",
85
+ },
82
86
  engines: {
83
87
  node: ">=20",
84
88
  },
@@ -205,19 +209,23 @@ yarn-error.log*
205
209
  }
206
210
  async function detectPackageManager() {
207
211
  try {
208
- // Check for npm_config_user_agent first
209
- const userAgent = process.env.npm_config_user_agent;
210
-
211
212
  // Check if running through bun create
212
- if (process.env.BUN_CREATE === "true") {
213
+ if (process.env.BUN_CREATE === "true" || process.env._?.includes("bun")) {
213
214
  return "bun";
214
215
  }
215
216
 
217
+ const userAgent = process.env.npm_config_user_agent;
218
+
216
219
  // Check if running through npm init
217
220
  if (userAgent?.startsWith("npm")) {
218
221
  return "npm";
219
222
  }
220
223
 
224
+ // Check for Bun in process.argv
225
+ if (process.argv.some((arg) => arg.includes("bun"))) {
226
+ return "bun";
227
+ }
228
+
221
229
  // Fallback to detect for other cases
222
230
  const pkgManager = await detect();
223
231
  let version = "";
@@ -231,7 +239,6 @@ async function detectPackageManager() {
231
239
 
232
240
  return pkgManager + version;
233
241
  } catch (error) {
234
- // Fallback to npm if detection fails
235
242
  return "npm";
236
243
  }
237
244
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-message-kit",
3
- "version": "1.1.8-beta.3",
3
+ "version": "1.1.8-beta.4",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -56,6 +56,7 @@ export async function handleEns(
56
56
  }
57
57
  // Generate URL for the ens
58
58
  let url_ens = ensUrl + domain;
59
+ context.send(`${url_ens}`);
59
60
  return { code: 200, message: `${url_ens}` };
60
61
  } else if (skill == "info") {
61
62
  const { domain } = params;
@@ -1,26 +1,14 @@
1
1
  import { run, HandlerContext } from "@xmtp/message-kit";
2
- import { textGeneration, processMultilineResponse } from "@xmtp/message-kit";
2
+ import { agentRun } from "@xmtp/message-kit";
3
3
  import { agent_prompt } from "./prompt.js";
4
4
 
5
5
  run(async (context: HandlerContext) => {
6
6
  const {
7
- message: {
8
- content: { text, params },
9
- sender,
10
- },
7
+ message: { sender },
11
8
  } = context;
12
9
 
13
- try {
14
- let userPrompt = params?.prompt ?? text;
15
-
16
- const { reply } = await textGeneration(
17
- sender.address,
18
- userPrompt,
19
- await agent_prompt(sender.address),
20
- );
21
- await processMultilineResponse(sender.address, reply, context);
22
- } catch (error) {
23
- console.error("Error during OpenAI call:", error);
24
- await context.send("An error occurred while processing your request.");
25
- }
10
+ agentRun(context, async (address: string) => {
11
+ const result = (await agent_prompt(address)) ?? "No response available";
12
+ return result;
13
+ });
26
14
  });
@@ -15,6 +15,7 @@ run(async (context: HandlerContext) => {
15
15
  context.send("gm");
16
16
  return;
17
17
  }
18
+
18
19
  const {
19
20
  message: {
20
21
  content: { text, params },
@@ -5,7 +5,7 @@ export async function agent_prompt(senderAddress: string) {
5
5
 
6
6
  ### Context
7
7
 
8
- You are a helpful bot agent that lives inside a web3 messaging group that helps interpret user requests and execute commands.
8
+ You are a helpful agent that lives inside a web3 messaging group that helps interpret user requests and execute commands.
9
9
  The message was sent by @${senderAddress}
10
10
 
11
11