@kyan-du/agent-wechat-cli 0.14.3 → 0.14.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/dist/cli.js CHANGED
@@ -7635,6 +7635,15 @@ var downloadFileParamsSchema = external_exports.object({
7635
7635
  var downloadFileResultSchema = openChatResultSchema.extend({
7636
7636
  clicked: external_exports.boolean().optional()
7637
7637
  });
7638
+ var materializeChatHistoryParamsSchema = external_exports.object({
7639
+ chatId: external_exports.string().min(1),
7640
+ title: external_exports.string().min(1).optional(),
7641
+ localId: external_exports.number().int().optional(),
7642
+ executionTimeoutMs: external_exports.number().int().positive().optional()
7643
+ });
7644
+ var materializeChatHistoryResultSchema = openChatResultSchema.extend({
7645
+ clicked: external_exports.boolean().optional()
7646
+ });
7638
7647
  var idempotencyKeySchema = external_exports.string().min(1).max(128).regex(/^[A-Za-z0-9._:-]+$/);
7639
7648
  var forwardedMessageNodeSchema = external_exports.lazy(() => external_exports.object({
7640
7649
  sender: external_exports.string().optional(),
@@ -7748,7 +7757,8 @@ var mediaResultSchema = external_exports.object({
7748
7757
  format: external_exports.string(),
7749
7758
  filename: external_exports.string(),
7750
7759
  source: external_exports.enum(["original", "thumbnail"]).optional(),
7751
- errorCode: external_exports.string().optional()
7760
+ errorCode: external_exports.string().optional(),
7761
+ items: external_exports.array(external_exports.lazy(() => mediaResultSchema)).optional()
7752
7762
  });
7753
7763
  var agentConfigSchema = external_exports.object({
7754
7764
  maxTurns: external_exports.number().int().positive().default(30),
@@ -7832,6 +7842,17 @@ var WeChatClient = class {
7832
7842
  await throwHttpError(res);
7833
7843
  return res.json();
7834
7844
  }
7845
+ async put(path6, body, signal) {
7846
+ const res = await fetch(`${this.base}${path6}`, {
7847
+ method: "PUT",
7848
+ headers: this.headers,
7849
+ body: body != null ? JSON.stringify(body) : void 0,
7850
+ signal
7851
+ });
7852
+ if (!res.ok)
7853
+ await throwHttpError(res);
7854
+ return res.json();
7855
+ }
7835
7856
  // ---- Status ----
7836
7857
  async status() {
7837
7858
  return this.get("/api/status");
@@ -7853,12 +7874,18 @@ var WeChatClient = class {
7853
7874
  return this.post("/api/status/auth/reset");
7854
7875
  }
7855
7876
  // ---- Chats ----
7856
- async listChatsPage(limit, cursor, unreadOnly) {
7857
- const page = await this.get(`/api/chats${qs({ limit, cursor, unreadOnly })}`);
7877
+ async listChatsPage(limit, cursor, unreadOnly, interestOnly) {
7878
+ const page = await this.get(`/api/chats${qs({ limit, cursor, unreadOnly, interestOnly })}`);
7858
7879
  if (page.errorCode)
7859
7880
  throw new WeChatHttpError(400, "Bad Request", page.errorCode, page.errorCode);
7860
7881
  return page;
7861
7882
  }
7883
+ async getMonitorInterest() {
7884
+ return this.get("/api/interest");
7885
+ }
7886
+ async setMonitorInterest(interest) {
7887
+ return this.put("/api/interest", interest);
7888
+ }
7862
7889
  async listChats(limit) {
7863
7890
  return (await this.listChatsPage(limit)).items;
7864
7891
  }
@@ -7877,6 +7904,10 @@ var WeChatClient = class {
7877
7904
  async downloadFile(chatId, filename, signal, executionTimeoutMs) {
7878
7905
  return this.post(`/api/chats/${encodeURIComponent(chatId)}/download-file${qs({ filename, executionTimeoutMs })}`, void 0, signal);
7879
7906
  }
7907
+ async materializeChatHistory(chatId, options, signal) {
7908
+ const { title, localId, executionTimeoutMs } = options ?? {};
7909
+ return this.post(`/api/chats/${encodeURIComponent(chatId)}/materialize-chat-history${qs({ title, localId, executionTimeoutMs })}`, void 0, signal);
7910
+ }
7880
7911
  async listGroupMembersPage(groupId, limit, cursor) {
7881
7912
  const page = groupMembersPageSchema.parse(await this.get(`/api/groups/${encodeURIComponent(groupId)}/members${qs({ limit, cursor })}`));
7882
7913
  if (page.errorCode)
@@ -9748,7 +9779,7 @@ function checkCliUpgrade(currentVersion, readLatest = () => execFileSync2("npm",
9748
9779
  }
9749
9780
 
9750
9781
  // src/cli.ts
9751
- var VERSION = false ? "0.0.0-test" : "0.14.3";
9782
+ var VERSION = false ? "0.0.0-test" : "0.14.4";
9752
9783
  var MAX_UPLOAD_BYTES = 50 * 1024 * 1024;
9753
9784
  function readToken() {
9754
9785
  try {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "cliVersion": "0.14.3",
3
+ "cliVersion": "0.14.4",
4
4
  "repository": "ghcr.io/kyan-du/agent-wechat",
5
5
  "apiVersion": 1,
6
6
  "allowedReferences": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kyan-du/agent-wechat-cli",
3
- "version": "0.14.3",
3
+ "version": "0.14.4",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "wx": "./dist/cli.js"