hotsheet 0.6.0 → 0.6.2

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
@@ -3073,6 +3073,47 @@ apiRoutes.post("/channel/trigger", async (c) => {
3073
3073
  const ok = await triggerChannel2(dataDir2, serverPort, body.message);
3074
3074
  return c.json({ ok });
3075
3075
  });
3076
+ apiRoutes.get("/channel/permission", async (c) => {
3077
+ const { getChannelPort: getChannelPort2 } = await Promise.resolve().then(() => (init_channel_config(), channel_config_exports));
3078
+ const dataDir2 = c.get("dataDir");
3079
+ const port2 = getChannelPort2(dataDir2);
3080
+ if (!port2) return c.json({ pending: null });
3081
+ try {
3082
+ const res = await fetch(`http://127.0.0.1:${port2}/permission`);
3083
+ const data = await res.json();
3084
+ return c.json(data);
3085
+ } catch {
3086
+ return c.json({ pending: null });
3087
+ }
3088
+ });
3089
+ apiRoutes.post("/channel/permission/respond", async (c) => {
3090
+ const { getChannelPort: getChannelPort2 } = await Promise.resolve().then(() => (init_channel_config(), channel_config_exports));
3091
+ const dataDir2 = c.get("dataDir");
3092
+ const port2 = getChannelPort2(dataDir2);
3093
+ if (!port2) return c.json({ error: "Channel not available" }, 503);
3094
+ const body = await c.req.json();
3095
+ try {
3096
+ const res = await fetch(`http://127.0.0.1:${port2}/permission/respond`, {
3097
+ method: "POST",
3098
+ headers: { "Content-Type": "application/json" },
3099
+ body: JSON.stringify(body)
3100
+ });
3101
+ return c.json(await res.json());
3102
+ } catch {
3103
+ return c.json({ error: "Failed to reach channel server" }, 503);
3104
+ }
3105
+ });
3106
+ apiRoutes.post("/channel/permission/dismiss", async (c) => {
3107
+ const { getChannelPort: getChannelPort2 } = await Promise.resolve().then(() => (init_channel_config(), channel_config_exports));
3108
+ const dataDir2 = c.get("dataDir");
3109
+ const port2 = getChannelPort2(dataDir2);
3110
+ if (!port2) return c.json({ ok: true });
3111
+ try {
3112
+ await fetch(`http://127.0.0.1:${port2}/permission/dismiss`, { method: "POST" });
3113
+ } catch {
3114
+ }
3115
+ return c.json({ ok: true });
3116
+ });
3076
3117
  apiRoutes.post("/channel/done", async (_c) => {
3077
3118
  channelDoneFlag = true;
3078
3119
  notifyChange();
@@ -3746,6 +3787,15 @@ pageRoutes.get("/", (c) => {
3746
3787
  /* @__PURE__ */ jsx("div", { className: "settings-hint", id: "check-updates-status" })
3747
3788
  ] })
3748
3789
  ] })
3790
+ ] }) }),
3791
+ /* @__PURE__ */ jsx("div", { className: "permission-overlay", id: "permission-overlay", style: "display:none", children: /* @__PURE__ */ jsx("div", { className: "permission-overlay-content", children: [
3792
+ /* @__PURE__ */ jsx("div", { className: "permission-overlay-text", children: "Claude is waiting for permission" }),
3793
+ /* @__PURE__ */ jsx("div", { className: "permission-overlay-detail", id: "permission-overlay-detail" }),
3794
+ /* @__PURE__ */ jsx("div", { className: "permission-overlay-actions", children: [
3795
+ /* @__PURE__ */ jsx("button", { className: "permission-overlay-btn permission-allow", id: "permission-allow-btn", children: "Allow" }),
3796
+ /* @__PURE__ */ jsx("button", { className: "permission-overlay-btn permission-deny", id: "permission-deny-btn", children: "Deny" }),
3797
+ /* @__PURE__ */ jsx("button", { className: "permission-overlay-btn permission-dismiss", id: "permission-dismiss-btn", children: "Dismiss" })
3798
+ ] })
3749
3799
  ] }) })
3750
3800
  ] });
3751
3801
  return c.html(html.toString());