@lih-x-x/kmr 1.0.31 → 1.0.32

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
@@ -6,9 +6,9 @@ async function checkUpdate() {
6
6
  try {
7
7
  const res = await fetch(`https://registry.npmjs.org/${"@lih-x-x/kmr"}/latest`, { signal: AbortSignal.timeout(3e3) });
8
8
  const data = await res.json();
9
- if (data.version && data.version !== "1.0.31") {
9
+ if (data.version && data.version !== "1.0.32") {
10
10
  console.log(`
11
- \u2B06\uFE0F \u65B0\u7248\u672C\u53EF\u7528: ${"1.0.31"} \u2192 ${data.version}`);
11
+ \u2B06\uFE0F \u65B0\u7248\u672C\u53EF\u7528: ${"1.0.32"} \u2192 ${data.version}`);
12
12
  console.log(` \u8FD0\u884C npm install -g ${"@lih-x-x/kmr"} \u66F4\u65B0
13
13
  `);
14
14
  }
@@ -49,12 +49,13 @@ KMR\uFF08Key Meetings Record\uFF09\u2014 \u4F1A\u8BAE\u6316\u6398\u673A
49
49
  kmr \u542F\u52A8\u670D\u52A1\uFF08\u98DE\u4E66\u673A\u5668\u4EBA + Web \u7BA1\u7406\u754C\u9762\uFF09
50
50
  kmr list \u5217\u51FA\u6240\u6709\u4F1A\u8BAE\u8BB0\u5F55
51
51
  kmr show <id> \u67E5\u770B\u8BB0\u5F55\u8BE6\u60C5
52
+ kmr task \u67E5\u770B\u6240\u6709\u4EFB\u52A1
52
53
  kmr del <id> \u5220\u9664\u8BB0\u5F55
53
54
  kmr find <q> \u641C\u7D22\u4F1A\u8BAE\u8BB0\u5F55
54
55
  kmr --help \u663E\u793A\u5E2E\u52A9
55
56
  `);
56
57
  } else if (command === "--version" || command === "-v") {
57
- console.log("1.0.31");
58
+ console.log("1.0.32");
58
59
  } else if (command === "list") {
59
60
  const { loadConfig } = await import("./config-L2SVVMAR.js");
60
61
  const { JsonStore } = await import("./jsonStore-AL73KEUG.js");
@@ -95,6 +96,32 @@ KMR\uFF08Key Meetings Record\uFF09\u2014 \u4F1A\u8BAE\u6316\u6398\u673A
95
96
  process.exit(1);
96
97
  }
97
98
  console.log(JSON.stringify(record, null, 2));
99
+ } else if (command === "task") {
100
+ const { loadConfig } = await import("./config-L2SVVMAR.js");
101
+ const { JsonStore } = await import("./jsonStore-AL73KEUG.js");
102
+ const { createLarkClient } = await import("./client-CKWRSYEN.js");
103
+ const { TaskCreator } = await import("./taskCreator-QVSOLXXU.js");
104
+ const { syncTaskStatuses } = await import("./sync-E4SW7QFZ.js");
105
+ const config = loadConfig();
106
+ const store = new JsonStore(config.storage.dataDir);
107
+ const client = createLarkClient(config);
108
+ const taskCreator = new TaskCreator(client);
109
+ await syncTaskStatuses(store, taskCreator);
110
+ const meetings = await store.list();
111
+ let count = 0;
112
+ for (const m of meetings) {
113
+ if (!m.createdTasks) continue;
114
+ for (const t of m.createdTasks) {
115
+ const icon = t.status === "completed" ? "\u2705" : "\u23F3";
116
+ console.log(`${icon} ${t.summary}`);
117
+ console.log(` \u6765\u6E90\uFF1A${m.summary.title}`);
118
+ console.log(` \u521B\u5EFA\uFF1A${t.createdAt}${t.completedAt ? " | \u5B8C\u6210\uFF1A" + t.completedAt : ""}`);
119
+ if (t.url) console.log(` ${t.url}`);
120
+ console.log("");
121
+ count++;
122
+ }
123
+ }
124
+ if (count === 0) console.log("\u6682\u65E0\u5DF2\u521B\u5EFA\u7684\u4EFB\u52A1\u3002");
98
125
  } else if (command === "del") {
99
126
  const id = argv[3];
100
127
  if (!id) {
@@ -140,6 +167,7 @@ KMR\uFF08Key Meetings Record\uFF09\u2014 \u4F1A\u8BAE\u6316\u6398\u673A
140
167
  \u53EF\u7528\u547D\u4EE4:
141
168
  kmr list \u5217\u51FA\u6240\u6709\u4F1A\u8BAE\u8BB0\u5F55
142
169
  kmr show <id> \u67E5\u770B\u8BB0\u5F55\u8BE6\u60C5
170
+ kmr task \u67E5\u770B\u6240\u6709\u4EFB\u52A1
143
171
  kmr del <id> \u5220\u9664\u8BB0\u5F55
144
172
  kmr find <q> \u641C\u7D22\u4F1A\u8BAE\u8BB0\u5F55
145
173
  kmr --help \u663E\u793A\u5B8C\u6574\u5E2E\u52A9
package/dist/index.js CHANGED
@@ -307,6 +307,9 @@ function parseMessage(text) {
307
307
  if (/^\/(?:list|listall)$/i.test(trimmed) || /^(展示|列出|显示|查看)(所有|全部|历史)(记录|会议)/.test(trimmed)) {
308
308
  return { type: "list_all" /* LIST_ALL */, raw: text };
309
309
  }
310
+ if (/^\/task$/i.test(trimmed) || /^(展示|列出|显示|查看)(所有|全部)?(任务|待办)/.test(trimmed)) {
311
+ return { type: "list_tasks" /* LIST_TASKS */, raw: text };
312
+ }
310
313
  const findMatch = text.match(/^\/find\s+(.+)/);
311
314
  if (findMatch) {
312
315
  return {
@@ -847,6 +850,41 @@ async function main() {
847
850
  console.log(`[reply] \u5DF2\u53D1\u9001\u8BB0\u5F55\u5217\u8868`);
848
851
  break;
849
852
  }
853
+ case "list_tasks" /* LIST_TASKS */: {
854
+ console.log(`[process] \u5217\u51FA\u6240\u6709\u4EFB\u52A1`);
855
+ await syncTaskStatuses(store, taskCreator);
856
+ const meetings = await store.list();
857
+ const tasks = [];
858
+ for (const m of meetings) {
859
+ if (!m.createdTasks) continue;
860
+ for (const t of m.createdTasks) {
861
+ tasks.push({
862
+ summary: t.summary,
863
+ status: t.status || "open",
864
+ url: t.url,
865
+ createdAt: t.createdAt,
866
+ completedAt: t.completedAt,
867
+ meetingTitle: m.summary.title
868
+ });
869
+ }
870
+ }
871
+ if (tasks.length === 0) {
872
+ await messenger.replyText(messageId, "\u6682\u65E0\u5DF2\u521B\u5EFA\u7684\u4EFB\u52A1\u3002");
873
+ } else {
874
+ const lines = [`\u{1F4CB} \u5171 ${tasks.length} \u6761\u4EFB\u52A1\uFF1A`, ""];
875
+ for (const t of tasks) {
876
+ const icon = t.status === "completed" ? "\u2705" : "\u23F3";
877
+ lines.push(`${icon} ${t.summary}`);
878
+ lines.push(` \u6765\u6E90\uFF1A${t.meetingTitle}`);
879
+ lines.push(` \u521B\u5EFA\uFF1A${t.createdAt}${t.completedAt ? " | \u5B8C\u6210\uFF1A" + t.completedAt : ""}`);
880
+ if (t.url) lines.push(` ${t.url}`);
881
+ lines.push("");
882
+ }
883
+ await messenger.replyText(messageId, lines.join("\n"));
884
+ }
885
+ console.log(`[reply] \u5DF2\u53D1\u9001\u4EFB\u52A1\u5217\u8868`);
886
+ break;
887
+ }
850
888
  case "delete_record" /* DELETE_RECORD */: {
851
889
  console.log(`[process] \u5220\u9664\u8BB0\u5F55: id=${parsed.deleteId}`);
852
890
  const deleted = await store.delete(parsed.deleteId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lih-x-x/kmr",
3
- "version": "1.0.31",
3
+ "version": "1.0.32",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {