opencode-forgekeeper 2.3.0 → 2.4.1

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/README.md CHANGED
@@ -226,7 +226,9 @@ For each explicit target that is an open PR/MR, the server tells the agent about
226
226
  A target that merges or closes gets no more notifications, and a notification waiting for a
227
227
  retry is dropped.
228
228
  Each notification is a queued synthetic message, followed by a toast in the CLIs that have
229
- shown the session. The message resumes the session unless `resumeSession` is `false`.
229
+ shown the session. With session tabs on, those CLIs also reopen the session's tab if you
230
+ closed it, without leaving the session you're in. The message resumes the session unless
231
+ `resumeSession` is `false`.
230
232
  Messages include the full URL of each PR/MR. PRs/MRs from the title or the branch don't get
231
233
  notifications.
232
234
 
@@ -386,6 +388,7 @@ notifications resume the session. Set `reviewStatus` to `false` to keep only tit
386
388
  and a PR/MR's source branch.
387
389
  - `src/status-client.ts` holds the CLI's leases, snapshots, and per-directory settings.
388
390
  `src/tui.tsx` connects it to the RPC and renders the footer, dialog, commands, and notices.
391
+ `src/notice.ts` decides which notices a CLI shows and which tabs it reopens.
389
392
  - `src/forge.ts` defines the forge-neutral types, the `Forge` adapter interface, and
390
393
  `ForgeTraits` with its optional `automatedReview` and `feedback` capabilities.
391
394
  - `src/gitlab-feedback.ts` and `src/github-feedback.ts` read each forge's comments for its
package/dist/index.js CHANGED
@@ -1552,7 +1552,7 @@ function createFeedbackWatcher(options) {
1552
1552
  remember(key2, { announced: ids }, now());
1553
1553
  } catch (error) {
1554
1554
  retryAt.set(key2, now() + RETRY_DELAY2);
1555
- options.onSendError?.(error);
1555
+ options.onSendError?.(error, sessionID);
1556
1556
  } finally {
1557
1557
  for (const id of ids)
1558
1558
  reserved.delete(`${key2} ${id}`);
@@ -2303,10 +2303,11 @@ async function setupStatus(ctx, settings, deps, host) {
2303
2303
  notice({ sessionID, ...feedbackToast(request, comments), variant: "info" });
2304
2304
  },
2305
2305
  onFetchError: (error) => reportOnce("feedback-fetch", "Could not check PR/MR review feedback", error),
2306
- onSendError: (error) => {
2306
+ onSendError: (error, sessionID) => {
2307
2307
  const reason = error instanceof Error ? error.message : String(error);
2308
2308
  notice({
2309
- message: `Could not tell the session about review feedback: ${reason}`,
2309
+ sessionID,
2310
+ message: `Could not tell the session about review feedback: ${reason}. Retrying in 10 minutes.`,
2310
2311
  variant: "error"
2311
2312
  });
2312
2313
  }
package/dist/tui.js CHANGED
@@ -1106,6 +1106,20 @@ function detailsMessage(snapshot) {
1106
1106
  `);
1107
1107
  }
1108
1108
 
1109
+ // packages/forgekeeper/src/notice.ts
1110
+ function showNotice(notice, host) {
1111
+ const { sessionID } = notice;
1112
+ if (sessionID && !host.hasShown(sessionID))
1113
+ return;
1114
+ if (sessionID && notice.variant === "info")
1115
+ host.openTab(sessionID);
1116
+ host.toast({
1117
+ ...notice.title ? { title: notice.title } : {},
1118
+ message: notice.message,
1119
+ variant: notice.variant
1120
+ });
1121
+ }
1122
+
1109
1123
  // packages/forgekeeper/src/rpc.ts
1110
1124
  var urls = {
1111
1125
  url: { type: "string" },
@@ -2066,28 +2080,18 @@ var tui_default = {
2066
2080
  return null;
2067
2081
  }
2068
2082
  });
2069
- const stops = [
2070
- rpc.events.on("status", (event) => {
2071
- const {
2072
- directory,
2073
- key: key2,
2074
- snapshot: snapshot2
2075
- } = event.data;
2076
- client.receive(directory, key2, snapshot2);
2077
- }),
2078
- rpc.events.on("notice", (event) => {
2079
- const notice = event.data;
2080
- if (notice.sessionID && !client.hasShown(notice.sessionID))
2081
- return;
2082
- context.ui.toast.show({
2083
- ...notice.title ? {
2084
- title: notice.title
2085
- } : {},
2086
- message: notice.message,
2087
- variant: notice.variant
2088
- });
2089
- })
2090
- ];
2083
+ const stops = [rpc.events.on("status", (event) => {
2084
+ const {
2085
+ directory,
2086
+ key: key2,
2087
+ snapshot: snapshot2
2088
+ } = event.data;
2089
+ client.receive(directory, key2, snapshot2);
2090
+ }), rpc.events.on("notice", (event) => showNotice(event.data, {
2091
+ hasShown: client.hasShown,
2092
+ openTab: (sessionID) => context.ui.tabs.open(sessionID),
2093
+ toast: context.ui.toast.show
2094
+ }))];
2091
2095
  return () => {
2092
2096
  clearInterval(heartbeat);
2093
2097
  for (const stop of stops)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-forgekeeper",
3
- "version": "2.3.0",
3
+ "version": "2.4.1",
4
4
  "description": "OpenCode plugin that tracks each session's GitHub and GitLab issues and PRs/MRs: title prefixes, a PR/MR status footer, and review notifications",
5
5
  "author": {
6
6
  "name": "Pedro Pombeiro",