@lih-x-x/kmr 1.0.57 → 1.0.58
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 +47 -4
- package/package.json +1 -1
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.
|
|
9
|
+
if (data.version && data.version !== "1.0.58") {
|
|
10
10
|
console.log(`
|
|
11
|
-
\u2B06\uFE0F \u65B0\u7248\u672C\u53EF\u7528: ${"1.0.
|
|
11
|
+
\u2B06\uFE0F \u65B0\u7248\u672C\u53EF\u7528: ${"1.0.58"} \u2192 ${data.version}`);
|
|
12
12
|
console.log(` \u8FD0\u884C npm install -g ${"@lih-x-x/kmr"} \u66F4\u65B0
|
|
13
13
|
`);
|
|
14
14
|
}
|
|
@@ -56,7 +56,7 @@ KMR\uFF08Key Meetings Record\uFF09\u2014 \u4F1A\u8BAE\u6316\u6398\u673A
|
|
|
56
56
|
kmr --help \u663E\u793A\u5E2E\u52A9
|
|
57
57
|
`);
|
|
58
58
|
} else if (command === "--version" || command === "-v") {
|
|
59
|
-
console.log("1.0.
|
|
59
|
+
console.log("1.0.58");
|
|
60
60
|
} else if (command === "list") {
|
|
61
61
|
const { loadConfig } = await import("./config-WIQGW5OC.js");
|
|
62
62
|
const { JsonStore } = await import("./jsonStore-AL73KEUG.js");
|
|
@@ -140,6 +140,7 @@ KMR\uFF08Key Meetings Record\uFF09\u2014 \u4F1A\u8BAE\u6316\u6398\u673A
|
|
|
140
140
|
let due;
|
|
141
141
|
let assignee;
|
|
142
142
|
let desc;
|
|
143
|
+
let meetingId;
|
|
143
144
|
const positional = [];
|
|
144
145
|
for (let i = 0; i < args.length; i++) {
|
|
145
146
|
if (args[i] === "--due" && args[i + 1]) {
|
|
@@ -148,22 +149,26 @@ KMR\uFF08Key Meetings Record\uFF09\u2014 \u4F1A\u8BAE\u6316\u6398\u673A
|
|
|
148
149
|
assignee = args[++i];
|
|
149
150
|
} else if (args[i] === "--desc" && args[i + 1]) {
|
|
150
151
|
desc = args[++i];
|
|
152
|
+
} else if (args[i] === "--meeting" && args[i + 1]) {
|
|
153
|
+
meetingId = args[++i];
|
|
151
154
|
} else {
|
|
152
155
|
positional.push(args[i]);
|
|
153
156
|
}
|
|
154
157
|
}
|
|
155
158
|
summary = positional.join(" ");
|
|
156
159
|
if (!summary) {
|
|
157
|
-
console.error("\u7528\u6CD5: kmr create-task <\u4EFB\u52A1\u6807\u9898> [--due YYYY-MM-DD] [--assignee \u59D3\u540D] [--desc \u63CF\u8FF0]");
|
|
160
|
+
console.error("\u7528\u6CD5: kmr create-task <\u4EFB\u52A1\u6807\u9898> [--due YYYY-MM-DD] [--assignee \u59D3\u540D] [--desc \u63CF\u8FF0] [--meeting <id>]");
|
|
158
161
|
process.exit(1);
|
|
159
162
|
}
|
|
160
163
|
const { loadConfig } = await import("./config-WIQGW5OC.js");
|
|
161
164
|
const { createLarkClient } = await import("./client-DFBBDD77.js");
|
|
162
165
|
const { TaskCreator } = await import("./taskCreator-TCI3VB5D.js");
|
|
163
166
|
const { UserResolver } = await import("./userResolver-DTWOTVP6.js");
|
|
167
|
+
const { JsonStore } = await import("./jsonStore-AL73KEUG.js");
|
|
164
168
|
const config = loadConfig();
|
|
165
169
|
const client = createLarkClient(config);
|
|
166
170
|
const taskCreator = new TaskCreator(client);
|
|
171
|
+
const store = new JsonStore(config.storage.dataDir);
|
|
167
172
|
let assigneeOpenId;
|
|
168
173
|
if (assignee) {
|
|
169
174
|
const userResolver = new UserResolver(client);
|
|
@@ -183,6 +188,44 @@ KMR\uFF08Key Meetings Record\uFF09\u2014 \u4F1A\u8BAE\u6316\u6398\u673A
|
|
|
183
188
|
const result = await taskCreator.createTask({ summary, due, description: desc, assigneeOpenId });
|
|
184
189
|
console.log(`\u2705 \u4EFB\u52A1\u5DF2\u521B\u5EFA: ${result.taskId}`);
|
|
185
190
|
if (result.url) console.log(` ${result.url}`);
|
|
191
|
+
const taskEntry = {
|
|
192
|
+
summary,
|
|
193
|
+
taskId: result.taskId,
|
|
194
|
+
url: result.url || "",
|
|
195
|
+
createdAt: (/* @__PURE__ */ new Date()).toLocaleString("sv").slice(0, 19),
|
|
196
|
+
status: "open"
|
|
197
|
+
};
|
|
198
|
+
if (meetingId) {
|
|
199
|
+
const record = await store.load(meetingId);
|
|
200
|
+
if (!record) {
|
|
201
|
+
console.error(`\u26A0\uFE0F \u672A\u627E\u5230\u4F1A\u8BAE\u8BB0\u5F55 "${meetingId}"\uFF0C\u4EFB\u52A1\u672A\u5173\u8054\u4FDD\u5B58`);
|
|
202
|
+
} else {
|
|
203
|
+
record.createdTasks = [...record.createdTasks || [], taskEntry];
|
|
204
|
+
await store.save(record);
|
|
205
|
+
console.log(` \u5DF2\u5173\u8054\u5230\u4F1A\u8BAE: ${record.summary.title}`);
|
|
206
|
+
}
|
|
207
|
+
} else {
|
|
208
|
+
const all = await store.list();
|
|
209
|
+
let standalone = all.find((r) => r.id === "__standalone__");
|
|
210
|
+
if (!standalone) {
|
|
211
|
+
standalone = {
|
|
212
|
+
id: "__standalone__",
|
|
213
|
+
documentUrl: "",
|
|
214
|
+
extractedAt: (/* @__PURE__ */ new Date()).toLocaleString("sv").slice(0, 19),
|
|
215
|
+
summary: { title: "\u72EC\u7ACB\u4EFB\u52A1", date: "", participants: [], keyPoints: [] },
|
|
216
|
+
todos: [],
|
|
217
|
+
risks: [],
|
|
218
|
+
projectRelations: [],
|
|
219
|
+
commitments: [],
|
|
220
|
+
reusableInsights: [],
|
|
221
|
+
createdTasks: [],
|
|
222
|
+
rawContent: ""
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
standalone.createdTasks = [...standalone.createdTasks || [], taskEntry];
|
|
226
|
+
await store.save(standalone);
|
|
227
|
+
console.log(` \u5DF2\u4FDD\u5B58\u5230\u72EC\u7ACB\u4EFB\u52A1\u8BB0\u5F55`);
|
|
228
|
+
}
|
|
186
229
|
} else if (command === "find") {
|
|
187
230
|
const query = argv.slice(3).join(" ");
|
|
188
231
|
if (!query) {
|