jowork 0.3.1 → 0.3.3
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/{chunk-QGHJ45PL.js → chunk-RT242G6H.js} +1 -1
- package/dist/{chunk-ATAUWJYD.js → chunk-USSUIN3A.js} +2 -2
- package/dist/{chunk-DQW74UCN.js → chunk-Z6XBOSF4.js} +30 -4
- package/dist/cli.js +15 -8
- package/dist/{feishu-XW5T6ER2.js → feishu-GOYQF2LE.js} +1 -1
- package/dist/{server-WEADPUST.js → server-YXI4Z4MY.js} +1 -1
- package/dist/{setup-S2S2CHB2.js → setup-CQ5L3SHD.js} +5 -5
- package/dist/{sync-SRLFR5NA.js → sync-KUJT3PN5.js} +2 -2
- package/dist/transport.js +1 -1
- package/package.json +1 -1
|
@@ -349,7 +349,7 @@ function createJoWorkMcpServer(opts) {
|
|
|
349
349
|
try {
|
|
350
350
|
switch (src) {
|
|
351
351
|
case "feishu": {
|
|
352
|
-
const { syncFeishu } = await import("./feishu-
|
|
352
|
+
const { syncFeishu } = await import("./feishu-GOYQF2LE.js");
|
|
353
353
|
const { SyncContext } = await import("./context-ZNI3WOB7.js");
|
|
354
354
|
const feishuCtx = new SyncContext(sqlite, { info: () => {
|
|
355
355
|
}, warn: () => {
|
|
@@ -1089,7 +1089,7 @@ ${hot.summary}
|
|
|
1089
1089
|
try {
|
|
1090
1090
|
switch (src) {
|
|
1091
1091
|
case "feishu": {
|
|
1092
|
-
const { syncFeishu } = await import("./feishu-
|
|
1092
|
+
const { syncFeishu } = await import("./feishu-GOYQF2LE.js");
|
|
1093
1093
|
const { SyncContext } = await import("./context-ZNI3WOB7.js");
|
|
1094
1094
|
const feishuCtx = new SyncContext(sqlite, { info: () => {
|
|
1095
1095
|
}, warn: () => {
|
|
@@ -232,14 +232,40 @@ async function syncFeishuApprovals(ctx, data, logger = defaultLogger) {
|
|
|
232
232
|
const token = await getFeishuToken(appId, appSecret);
|
|
233
233
|
let approvals = 0, newObjects = 0;
|
|
234
234
|
try {
|
|
235
|
-
const
|
|
235
|
+
const defRes = await fetch("https://open.feishu.cn/open-apis/approval/v4/approvals?page_size=50", {
|
|
236
236
|
headers: { Authorization: `Bearer ${token}` }
|
|
237
237
|
});
|
|
238
|
-
if (!
|
|
239
|
-
|
|
238
|
+
if (!defRes.ok) {
|
|
239
|
+
if (defRes.status === 403 || defRes.status === 400) {
|
|
240
|
+
logger.warn("Approval sync requires approval:approval:readonly scope. Add it at https://open.feishu.cn/app \u2192 Permissions");
|
|
241
|
+
} else {
|
|
242
|
+
logger.warn(`Approval API error: HTTP ${defRes.status}`);
|
|
243
|
+
}
|
|
244
|
+
return { approvals, newObjects };
|
|
245
|
+
}
|
|
246
|
+
const defData = await defRes.json();
|
|
247
|
+
if (defData.code !== 0 || !defData.data?.items?.length) {
|
|
248
|
+
if (defData.code === 99991400 || defData.code === 99991002) {
|
|
249
|
+
logger.warn("Approval sync requires approval:approval:readonly scope. Add it at https://open.feishu.cn/app \u2192 Permissions");
|
|
250
|
+
}
|
|
240
251
|
return { approvals, newObjects };
|
|
241
252
|
}
|
|
242
|
-
const
|
|
253
|
+
const allInstances = [];
|
|
254
|
+
for (const def of defData.data.items) {
|
|
255
|
+
const res = await fetch("https://open.feishu.cn/open-apis/approval/v4/instances", {
|
|
256
|
+
method: "POST",
|
|
257
|
+
headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json" },
|
|
258
|
+
body: JSON.stringify({ approval_code: def.approval_code, page_size: 50 })
|
|
259
|
+
});
|
|
260
|
+
if (!res.ok) continue;
|
|
261
|
+
const resData2 = await res.json();
|
|
262
|
+
if (resData2.code !== 0) continue;
|
|
263
|
+
for (const inst of resData2.data.items ?? []) {
|
|
264
|
+
allInstances.push({ ...inst, approval_name: def.approval_name });
|
|
265
|
+
}
|
|
266
|
+
await new Promise((r) => setTimeout(r, 100));
|
|
267
|
+
}
|
|
268
|
+
const resData = { code: 0, data: { items: allInstances } };
|
|
243
269
|
if (resData.code !== 0 || !resData.data?.items) {
|
|
244
270
|
logger.warn(`Approval list returned code ${resData.code}`);
|
|
245
271
|
return { approvals, newObjects };
|
package/dist/cli.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
syncCommand,
|
|
6
6
|
syncFirebase,
|
|
7
7
|
syncPostHog
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-RT242G6H.js";
|
|
9
9
|
import {
|
|
10
10
|
linkAllUnprocessed,
|
|
11
11
|
syncGitLab,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
import {
|
|
24
24
|
PLUGIN_REGISTRY,
|
|
25
25
|
createJoWorkMcpServer
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-USSUIN3A.js";
|
|
27
27
|
import {
|
|
28
28
|
GoalManager
|
|
29
29
|
} from "./chunk-VX662YLA.js";
|
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
syncFeishuDocs,
|
|
54
54
|
syncFeishuLinks,
|
|
55
55
|
syncFeishuMeetings
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-Z6XBOSF4.js";
|
|
57
57
|
import "./chunk-RO3KK5RC.js";
|
|
58
58
|
import {
|
|
59
59
|
logError,
|
|
@@ -102,7 +102,7 @@ function initCommand(program2) {
|
|
|
102
102
|
default: true
|
|
103
103
|
}]);
|
|
104
104
|
if (continueSetup) {
|
|
105
|
-
const { runSetupWizard } = await import("./setup-
|
|
105
|
+
const { runSetupWizard } = await import("./setup-CQ5L3SHD.js");
|
|
106
106
|
await runSetupWizard();
|
|
107
107
|
} else {
|
|
108
108
|
console.log("");
|
|
@@ -1471,12 +1471,19 @@ async function connectPostHog(opts) {
|
|
|
1471
1471
|
}
|
|
1472
1472
|
console.log("Verifying PostHog credentials...");
|
|
1473
1473
|
try {
|
|
1474
|
-
const res = await fetch(`${host}/api/projects/${projectId}
|
|
1474
|
+
const res = await fetch(`${host}/api/projects/${projectId}/insights/?limit=1`, {
|
|
1475
1475
|
headers: { Authorization: `Bearer ${apiKey}` }
|
|
1476
1476
|
});
|
|
1477
1477
|
if (!res.ok) {
|
|
1478
1478
|
console.error(`PostHog auth failed: HTTP ${res.status}`);
|
|
1479
|
-
|
|
1479
|
+
if (res.status === 403) {
|
|
1480
|
+
console.error(" Hint: API key lacks read access. Use a Personal API Key (not project API key).");
|
|
1481
|
+
console.error(" Get one at: https://app.posthog.com/settings/user-api-keys");
|
|
1482
|
+
} else if (res.status === 401) {
|
|
1483
|
+
console.error(" Hint: API key invalid or expired.");
|
|
1484
|
+
} else {
|
|
1485
|
+
console.error(` Hint: Check project ID (current: ${projectId}) and API host (current: ${host})`);
|
|
1486
|
+
}
|
|
1480
1487
|
process.exit(1);
|
|
1481
1488
|
}
|
|
1482
1489
|
console.log("\u2713 PostHog credentials verified");
|
|
@@ -2095,7 +2102,7 @@ function dashboardCommand(program2) {
|
|
|
2095
2102
|
console.error("Error: JoWork not initialized. Run `jowork init` first.");
|
|
2096
2103
|
process.exit(1);
|
|
2097
2104
|
}
|
|
2098
|
-
const { startDashboard } = await import("./server-
|
|
2105
|
+
const { startDashboard } = await import("./server-YXI4Z4MY.js");
|
|
2099
2106
|
const port = opts.port ? parseInt(opts.port, 10) : void 0;
|
|
2100
2107
|
const dashboard = await startDashboard({ port });
|
|
2101
2108
|
const url = `http://127.0.0.1:${dashboard.port}`;
|
|
@@ -2822,7 +2829,7 @@ program.action(async () => {
|
|
|
2822
2829
|
const config = readConfig2();
|
|
2823
2830
|
if (!config.initialized || !existsSync18(dbPath2())) {
|
|
2824
2831
|
if (process.stdin.isTTY) {
|
|
2825
|
-
const { runSetupWizard } = await import("./setup-
|
|
2832
|
+
const { runSetupWizard } = await import("./setup-CQ5L3SHD.js");
|
|
2826
2833
|
await runSetupWizard();
|
|
2827
2834
|
} else {
|
|
2828
2835
|
console.log("JoWork is not initialized. Run `jowork init` in an interactive terminal.");
|
|
@@ -212,7 +212,7 @@ async function runSetupWizard() {
|
|
|
212
212
|
console.log("");
|
|
213
213
|
console.log(zh ? ` \u6B63\u5728\u540C\u6B65 ${connectedSources.length} \u4E2A\u6570\u636E\u6E90...` : ` Syncing ${connectedSources.length} source${connectedSources.length > 1 ? "s" : ""}...`);
|
|
214
214
|
console.log("");
|
|
215
|
-
const { runSync } = await import("./sync-
|
|
215
|
+
const { runSync } = await import("./sync-KUJT3PN5.js");
|
|
216
216
|
try {
|
|
217
217
|
await runSync(connectedSources);
|
|
218
218
|
} catch {
|
|
@@ -388,8 +388,8 @@ async function connectSource(source, inquirer) {
|
|
|
388
388
|
{ type: "input", name: "appId", message: zh ? "\u98DE\u4E66 App ID (cli_xxx):" : "Feishu App ID (cli_xxx):", when: !appId },
|
|
389
389
|
{ type: "input", name: "appSecret", message: zh ? "\u98DE\u4E66 App Secret:" : "Feishu App Secret:", when: !appSecret }
|
|
390
390
|
]);
|
|
391
|
-
appId = appId
|
|
392
|
-
appSecret = appSecret
|
|
391
|
+
appId = appId || answers.appId;
|
|
392
|
+
appSecret = appSecret || answers.appSecret;
|
|
393
393
|
}
|
|
394
394
|
if (!appId || !appSecret) {
|
|
395
395
|
done = true;
|
|
@@ -411,8 +411,8 @@ async function connectSource(source, inquirer) {
|
|
|
411
411
|
console.log(zh ? " \u2717 \u98DE\u4E66\u51ED\u8BC1\u65E0\u6548" : " \u2717 Invalid Feishu credentials");
|
|
412
412
|
if (!await askRetryOrSkip()) done = true;
|
|
413
413
|
else {
|
|
414
|
-
process.env["FEISHU_APP_ID"]
|
|
415
|
-
process.env["FEISHU_APP_SECRET"]
|
|
414
|
+
delete process.env["FEISHU_APP_ID"];
|
|
415
|
+
delete process.env["FEISHU_APP_SECRET"];
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
418
|
} catch {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runSync,
|
|
3
3
|
syncCommand
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-RT242G6H.js";
|
|
5
5
|
import "./chunk-HENAABEL.js";
|
|
6
6
|
import "./chunk-63AMINQC.js";
|
|
7
7
|
import "./chunk-EYP6WMFF.js";
|
|
@@ -9,7 +9,7 @@ import "./chunk-74AHY7X6.js";
|
|
|
9
9
|
import "./chunk-54SD5GBF.js";
|
|
10
10
|
import "./chunk-FX6Z3QHV.js";
|
|
11
11
|
import "./chunk-4PIT2GZ4.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-Z6XBOSF4.js";
|
|
13
13
|
import "./chunk-RO3KK5RC.js";
|
|
14
14
|
import "./chunk-MYDK7MWB.js";
|
|
15
15
|
import "./chunk-OXWWOKC7.js";
|
package/dist/transport.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jowork",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "AI Agent Infrastructure — let AI agents truly understand your work. Connect data sources, give agents awareness and goals. Local-first, one command.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "AGPL-3.0",
|