jowork 0.3.2 → 0.3.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.
@@ -26,7 +26,7 @@ import {
26
26
  syncFeishuDocs,
27
27
  syncFeishuLinks,
28
28
  syncFeishuMeetings
29
- } from "./chunk-DQW74UCN.js";
29
+ } from "./chunk-Z6XBOSF4.js";
30
30
  import {
31
31
  formatAnalytics,
32
32
  formatMessages
@@ -349,7 +349,7 @@ function createJoWorkMcpServer(opts) {
349
349
  try {
350
350
  switch (src) {
351
351
  case "feishu": {
352
- const { syncFeishu } = await import("./feishu-XW5T6ER2.js");
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-XW5T6ER2.js");
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 res = await fetch("https://open.feishu.cn/open-apis/approval/v4/instances?page_size=50", {
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 (!res.ok || res.status === 400) {
239
- logger.warn("Approval sync requires approval:approval:readonly scope. Add it at https://open.feishu.cn/app \u2192 Permissions");
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 resData = await res.json();
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-QGHJ45PL.js";
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-ATAUWJYD.js";
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-DQW74UCN.js";
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-GDFYCCH3.js");
105
+ const { runSetupWizard } = await import("./setup-CQ5L3SHD.js");
106
106
  await runSetupWizard();
107
107
  } else {
108
108
  console.log("");
@@ -2102,7 +2102,7 @@ function dashboardCommand(program2) {
2102
2102
  console.error("Error: JoWork not initialized. Run `jowork init` first.");
2103
2103
  process.exit(1);
2104
2104
  }
2105
- const { startDashboard } = await import("./server-WEADPUST.js");
2105
+ const { startDashboard } = await import("./server-YXI4Z4MY.js");
2106
2106
  const port = opts.port ? parseInt(opts.port, 10) : void 0;
2107
2107
  const dashboard = await startDashboard({ port });
2108
2108
  const url = `http://127.0.0.1:${dashboard.port}`;
@@ -2791,18 +2791,9 @@ function isInstalled(packageName) {
2791
2791
  }
2792
2792
 
2793
2793
  // src/cli.ts
2794
- import { createRequire } from "module";
2795
2794
  process.env["I18NEXT_DISABLE_BANNER"] = "1";
2796
2795
  var program = new Command();
2797
- var __require = createRequire(import.meta.url);
2798
- var PKG_VERSION = (() => {
2799
- try {
2800
- return __require("../package.json").version;
2801
- } catch {
2802
- return "0.3.0";
2803
- }
2804
- })();
2805
- program.name("jowork").description("AI Agent Infrastructure \u2014 let AI agents truly understand your work").version(PKG_VERSION);
2796
+ program.name("jowork").description("AI Agent Infrastructure \u2014 let AI agents truly understand your work").version("0.3.4");
2806
2797
  initCommand(program);
2807
2798
  serveCommand(program);
2808
2799
  registerCommand(program);
@@ -2829,7 +2820,7 @@ program.action(async () => {
2829
2820
  const config = readConfig2();
2830
2821
  if (!config.initialized || !existsSync18(dbPath2())) {
2831
2822
  if (process.stdin.isTTY) {
2832
- const { runSetupWizard } = await import("./setup-GDFYCCH3.js");
2823
+ const { runSetupWizard } = await import("./setup-CQ5L3SHD.js");
2833
2824
  await runSetupWizard();
2834
2825
  } else {
2835
2826
  console.log("JoWork is not initialized. Run `jowork init` in an interactive terminal.");
@@ -5,7 +5,7 @@ import {
5
5
  syncFeishuDocs,
6
6
  syncFeishuLinks,
7
7
  syncFeishuMeetings
8
- } from "./chunk-DQW74UCN.js";
8
+ } from "./chunk-Z6XBOSF4.js";
9
9
  import "./chunk-RO3KK5RC.js";
10
10
  import "./chunk-MYDK7MWB.js";
11
11
  import {
@@ -27,7 +27,7 @@ import {
27
27
  syncFeishuApprovals,
28
28
  syncFeishuDocs,
29
29
  syncFeishuMeetings
30
- } from "./chunk-DQW74UCN.js";
30
+ } from "./chunk-Z6XBOSF4.js";
31
31
  import "./chunk-RO3KK5RC.js";
32
32
  import {
33
33
  logError,
@@ -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-SRLFR5NA.js");
215
+ const { runSync } = await import("./sync-KUJT3PN5.js");
216
216
  try {
217
217
  await runSync(connectedSources);
218
218
  } catch {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  runSync,
3
3
  syncCommand
4
- } from "./chunk-QGHJ45PL.js";
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-DQW74UCN.js";
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
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createJoWorkMcpServer
3
- } from "./chunk-ATAUWJYD.js";
3
+ } from "./chunk-USSUIN3A.js";
4
4
  import "./chunk-VX662YLA.js";
5
5
  import "./chunk-54SD5GBF.js";
6
6
  import "./chunk-FX6Z3QHV.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jowork",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
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",