@agent-wechat/agent-wechat 2.0.0 → 2.2.0

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.
Files changed (2) hide show
  1. package/dist/index.js +18 -16
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -4379,7 +4379,7 @@ function createNativeLoginTool(account, dependencies = {}) {
4379
4379
  catalogMode: "direct-only",
4380
4380
  description: "Check WeChat status, start or resume native login, or wait for the same login operation. Show the returned QR image to the user to scan and approve on their phone; do not generate a replacement QR. Repeated start reuses an active operation. For a new operation, force uses QR instead of saved trust. timeoutMs bounds the wait. Disconnect retains saved trust. Logout reports its durable native outcome; it does not promise saved-device revocation. Forget requires confirm=true and removes local authentication while retaining history.",
4381
4381
  parameters: { type: "object", additionalProperties: false, properties: {
4382
- action: { type: "string", enum: actions },
4382
+ action: { type: "string", enum: actions, description: "Login step to run; the tool description explains each one." },
4383
4383
  force: { type: "boolean", description: "With start, use QR instead of saved trust for a new login. An active login is still reused." },
4384
4384
  timeoutMs: { type: "integer", minimum: 1e3, maximum: 3e5, description: "Wait bound in milliseconds; defaults to 30000. Start returns as soon as a QR is available." },
4385
4385
  confirm: { type: "boolean", description: "Required true for forget." }
@@ -4960,10 +4960,11 @@ function registerNativeFacade(api, config) {
4960
4960
  // src/native-history-tools.ts
4961
4961
  import { resolveStableChannelMessageIngress as resolveStableChannelMessageIngress2 } from "openclaw/plugin-sdk/channel-ingress-runtime";
4962
4962
  import { imageResultFromFile } from "openclaw/plugin-sdk/channel-actions";
4963
- var pageSchema = { limit: { type: "integer", minimum: 1, maximum: 50, default: 20 }, cursor: { type: "string", maxLength: 8192, description: "Opaque nextCursor from the same tool and query; do not invent one." } };
4963
+ var pageSchema = { limit: { type: "integer", minimum: 1, maximum: 50, default: 20, description: "Maximum number of results on this page." }, cursor: { type: "string", maxLength: 8192, description: "Opaque nextCursor from the same tool and query; do not invent one." } };
4964
4964
  var names2 = ["wechat_history", "wechat_search", "wechat_message", "wechat_media"];
4965
4965
  var archiveNames = ["wechat_archive_threads", "wechat_archive_search", "wechat_archive_history", "wechat_archive_message", "wechat_archive_media"];
4966
- var messageIdSchema = { type: "string", minLength: 1, maxLength: 4096 };
4966
+ var messageIdSchema = { type: "string", minLength: 1, maxLength: 4096, description: "Exact opaque message ID from an earlier result." };
4967
+ var threadIdSchema = { type: "string", minLength: 1, maxLength: 4096, description: "Exact thread ID from wechat_archive_threads." };
4967
4968
  var qualities = ["best", "original", "standard", "thumbnail", "normal", "encoded"];
4968
4969
  function object3(value) {
4969
4970
  if (!value || typeof value !== "object" || Array.isArray(value)) throw Error("Expected tool arguments");
@@ -5214,16 +5215,17 @@ function createLookupTools(context, dependencies, archive) {
5214
5215
  return { content: [{ type: "text", text: JSON.stringify(result) }], details: result };
5215
5216
  }
5216
5217
  });
5217
- const querySchema = { type: "string", minLength: 1, maxLength: 256 };
5218
+ const querySchema = { type: "string", minLength: 1, maxLength: 256, description: "Case-insensitive text to find in message text." };
5219
+ const threadQuerySchema = { ...querySchema, description: "Case-insensitive text to match against thread IDs and display names." };
5218
5220
  const mediaSchema = {
5219
5221
  messageId: messageIdSchema,
5220
5222
  download: { type: "boolean", default: true, description: "Set false to use cached media only without requesting a WeChat transfer." },
5221
5223
  quality: { type: "string", enum: qualities, default: "best", description: "best uses the best cached image, normal video or decoded voice. Explicit variants are strict and may be unavailable." }
5222
5224
  };
5223
5225
  if (archive) return [
5224
- tool(archiveNames[0], "threads", "List or find locally stored threads across the configured WeChat account. Optional case-insensitive query matches thread IDs and display names. Includes groups and peers, with opaque pagination; no read marking.", { query: querySchema, ...pageSchema }),
5225
- tool(archiveNames[1], "search", "Search locally stored messages across every thread in the configured WeChat account, including other senders. Optional threadId narrows the search. Follow nextCursor with the same query and thread selection; no remote backfill or read marking.", { query: querySchema, threadId: messageIdSchema, ...pageSchema }, ["query"]),
5226
- tool(archiveNames[2], "history", "Read the locally stored history of any thread in the configured WeChat account, newest first, without sender filtering or read marking. Use wechat_archive_threads to find thread IDs.", { threadId: messageIdSchema, ...pageSchema }, ["threadId"]),
5226
+ tool(archiveNames[0], "threads", "List or find locally stored threads across the configured WeChat account. Optional case-insensitive query matches thread IDs and display names. Includes groups and peers, with opaque pagination; no read marking.", { query: threadQuerySchema, ...pageSchema }),
5227
+ tool(archiveNames[1], "search", "Search locally stored messages across every thread in the configured WeChat account, including other senders. Optional threadId narrows the search. Follow nextCursor with the same query and thread selection; no remote backfill or read marking.", { query: querySchema, threadId: threadIdSchema, ...pageSchema }, ["query"]),
5228
+ tool(archiveNames[2], "history", "Read the locally stored history of any thread in the configured WeChat account, newest first, without sender filtering or read marking. Use wechat_archive_threads to find thread IDs.", { threadId: threadIdSchema, ...pageSchema }, ["threadId"]),
5227
5229
  tool(archiveNames[3], "message", "Look up a stored message in any thread of the configured WeChat account by its exact opaque message ID. Use wechat_archive_media to retrieve its attachment.", { messageId: messageIdSchema }, ["messageId"]),
5228
5230
  tool(archiveNames[4], "media", "Retrieve an attachment or quoted text/image/link from any thread in the configured WeChat account by its message ID. Use the parent quote message ID for quotes. Returns verified managed file paths and an image preview for vision. Cached bytes first; missing media requests a bounded server-owned download unless download=false. Preserve pending/expired/unavailable results and never automatically retry retryable=false. No sends or read marking.", mediaSchema, ["messageId"])
5229
5231
  ];
@@ -5278,9 +5280,9 @@ function createNativeShareTools(context, dependencies = {}) {
5278
5280
  label: "Send WeChat share",
5279
5281
  description: "Send a URL share card to the current WeChat conversation, with an explicit title, URL, optional description and public thumbnail URL. Does not fetch or summarize the linked page. Use one idempotencyKey per intended share and reuse it after timeouts; never retry an uncertain send with a new key. Returns a durable send ID and state. Accepted means server acceptance; recipient rendering requires verification.",
5280
5282
  parameters: { type: "object", additionalProperties: false, required: ["title", "url", "idempotencyKey"], properties: {
5281
- title: { type: "string", minLength: 1, maxLength: 16384 },
5282
- url: { type: "string", minLength: 1, maxLength: 8192 },
5283
- description: { type: "string", maxLength: 16384 },
5283
+ title: { type: "string", minLength: 1, maxLength: 16384, description: "Card title shown in the chat." },
5284
+ url: { type: "string", minLength: 1, maxLength: 8192, description: "Link the card opens." },
5285
+ description: { type: "string", maxLength: 16384, description: "Optional summary shown under the title." },
5284
5286
  thumbnailUrl: { type: "string", minLength: 1, maxLength: 8192, description: "Public HTTP(S) image URL advertised as the card thumbnail; no upload or page scraping." },
5285
5287
  idempotencyKey: { type: "string", minLength: 1, maxLength: 200, description: "Stable unique key for this logical share. Reuse the same key and identical fields when inspecting/retrying this request." }
5286
5288
  } },
@@ -5505,8 +5507,8 @@ function createNativeGroupTools(context, dependencies = {}) {
5505
5507
  description: "Read cached group information and one page of members for the configured WeChat account. Available only to the trusted OpenClaw owner. Does not create groups, invite people or change settings. Cached member absence does not prove non-membership.",
5506
5508
  parameters: { type: "object", additionalProperties: false, properties: {
5507
5509
  groupId: { type: "string", minLength: 10, maxLength: 256, description: "Exact ordinary group username ending in @chatroom." },
5508
- limit: { type: "integer", minimum: 1, maximum: 100 },
5509
- cursor: { type: "string", maxLength: 8192 },
5510
+ limit: { type: "integer", minimum: 1, maximum: 100, description: "Maximum number of members on this page." },
5511
+ cursor: { type: "string", maxLength: 8192, description: "Opaque nextCursor from the previous wechat_group_info result; do not invent one." },
5510
5512
  username: { type: "string", minLength: 1, maxLength: 256, description: "Optionally inspect one exact member instead of listing a page." }
5511
5513
  }, required: ["groupId"] },
5512
5514
  execute: async (_callId, input, signal) => {
@@ -8423,10 +8425,10 @@ function registerNativeCallTool(api, service) {
8423
8425
  catalogMode: "direct-only",
8424
8426
  description: "Check voice-call status, dial an authorized contact, start or join a configured voice conference, invite allowed contacts to its owned conference, or hang up. Use action hangup when asked to leave the current call; in a conference it removes only this agent, leaving the room open for others. Owner-authorized call consultations can control their call without the separate chat-requester allowlist. Destination and group allowlists, host tool policy and approvals still apply. Join requires a current invitation and never creates a room. Invitations do not promote a direct call. Never retry an uncertain operation without the user's request. Do not claim an action was attempted before executing it.",
8425
8427
  parameters: { type: "object", additionalProperties: false, required: ["action"], properties: {
8426
- action: { type: "string", enum: ["status", "dial", "conference_start", "conference_join", "invite", "hangup"] },
8427
- contactId: { type: "string", minLength: 1, maxLength: 200 },
8428
- groupId: { type: "string", minLength: 1, maxLength: 200 },
8429
- contactIds: { type: "array", minItems: 1, maxItems: 100, uniqueItems: true, items: { type: "string", minLength: 1, maxLength: 200 } }
8428
+ action: { type: "string", enum: ["status", "dial", "conference_start", "conference_join", "invite", "hangup"], description: "Call operation to run; the tool description explains each one." },
8429
+ contactId: { type: "string", minLength: 1, maxLength: 200, description: "Contact to dial. Required for dial." },
8430
+ groupId: { type: "string", minLength: 1, maxLength: 200, description: "Group of the configured voice conference. Required for conference_start and conference_join." },
8431
+ contactIds: { type: "array", minItems: 1, maxItems: 100, uniqueItems: true, items: { type: "string", minLength: 1, maxLength: 200 }, description: "Contacts to invite. Required for conference_start and invite." }
8430
8432
  } },
8431
8433
  execute: async (_id, args, signal) => {
8432
8434
  if (!args || typeof args !== "object" || Array.isArray(args)) throw Error("Invalid calling arguments");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-wechat/agent-wechat",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "files": [