ework-web 0.10.69 → 0.10.70

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.ts +16 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ework-web",
3
- "version": "0.10.69",
3
+ "version": "0.10.70",
4
4
  "type": "module",
5
5
  "description": "ework-web — standalone multi-project issue tracker. Local SQLite-backed, no external API dependency. Bun + TypeScript + SSR HTML.",
6
6
  "license": "MIT",
package/src/index.ts CHANGED
@@ -1339,6 +1339,22 @@ async function handle(req: Request, url: URL, ip: string, ctx: { authed: boolean
1339
1339
  }
1340
1340
  }
1341
1341
 
1342
+ if (url.pathname === "/api/v1/dispatch-state" && req.method === "GET") {
1343
+ const owner = url.searchParams.get("owner") ?? "";
1344
+ const repo = url.searchParams.get("repo") ?? "";
1345
+ const number = url.searchParams.get("number") ?? "";
1346
+ if (!owner || !repo || !number) return json({ error: "owner, repo, number required" }, 400);
1347
+ const project = await getProject(owner, repo);
1348
+ if (!project) return json({ dispatchOff: false, aiStatus: "" });
1349
+ const issue = await getIssueWithMeta(project.id, Number(number));
1350
+ const cfgKv = await getConfigAll();
1351
+ const globalOff = cfgKv["dispatchEnabled"] === "false";
1352
+ const projectOff = cfgKv[`dispatchOff:${owner}/${repo}`] === "1";
1353
+ const aiStatus = issue?.ai_status ?? "";
1354
+ const issueOff = aiStatus === "dispatch_off" || aiStatus === "halted";
1355
+ return json({ dispatchOff: globalOff || projectOff || issueOff, aiStatus });
1356
+ }
1357
+
1342
1358
  if (url.pathname === "/api/router/strategy") {
1343
1359
  if (!ctx.user || ctx.user.is_admin !== 1) return json({ error: "admin required" }, 403);
1344
1360
  const routerUrl = cfg.daemonWebhookUrl.replace(/\/$/, "");