opencode-forgekeeper 1.0.0 → 2.0.0

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
@@ -296,8 +296,9 @@ title prefix. It doesn't poll or send review notifications, and the CLI shows no
296
296
 
297
297
  ## RPC
298
298
 
299
- The server registers an [RPC](https://opencode.ai/v2/docs/build/plugins/rpc) that the CLI
300
- uses, defined in `src/rpc.ts`:
299
+ The server registers an [RPC](https://opencode.ai/v2/docs/build/plugins/rpc) with the ID
300
+ `opencode-forgekeeper`, defined in `src/rpc.ts`. The CLI uses it, and other plugins can call
301
+ `target` and listen for `targetChanged`:
301
302
 
302
303
  - `target({ sessionID })` returns `{ url, issueUrl?, targets }` for explicit targets, and
303
304
  `{}` in branch mode. `targets` lists every target as `{ url, issueUrl? }`. `url` and
@@ -318,18 +319,25 @@ plugin instance watches its own sessions.
318
319
 
319
320
  ## Migrating from opencode-forge-session-title
320
321
 
321
- Replace `opencode-forge-session-title` with `opencode-forgekeeper` in `opencode.json`. Never
322
- load both: the server keeps `opencode-forge-session-title`'s plugin and RPC IDs, so the two
323
- would collide.
324
-
325
- | Entry point | Plugin ID | Stored state |
326
- | ----------- | ------------------------------ | ---------------------------------------------------------------------------------------- |
327
- | Server | `opencode-forge-session-title` | Session targets, owned title prefixes, human-review baselines, and pending notifications |
328
- | CLI | `pedropombeiro.forgekeeper` | None |
329
-
330
- Because the IDs match, stored targets carry over, and callers of the `target` RPC keep working.
331
- The server reads a session's single stored `target` as a list of one, and writes `targets` from
332
- the next change on.
322
+ Replace `opencode-forge-session-title` with `opencode-forgekeeper` in `opencode.json`. Upgrading
323
+ from `opencode-forgekeeper` 1.x works the same way, because 1.x used the same IDs as
324
+ `opencode-forge-session-title`.
325
+
326
+ | Entry point | Plugin ID | Stored state |
327
+ | ----------- | --------------------------- | ---------------------------------------------------------------------------------------- |
328
+ | Server | `opencode-forgekeeper` | Session targets, owned title prefixes, human-review baselines, and pending notifications |
329
+ | CLI | `pedropombeiro.forgekeeper` | None |
330
+
331
+ OpenCode scopes plugin storage by plugin ID, so nothing stored under the former ID,
332
+ `opencode-forge-session-title`, carries over:
333
+
334
+ - Sessions start in branch-based naming. Ask the agent to set their targets again.
335
+ - A title that kept a single-reference prefix from before, such as `[!456] Review`, can get a
336
+ second prefix, such as `[#12, !45] [!456] Review`. Remove the older one by hand. Older prefixes
337
+ with two references, such as `[#12, !45]`, are replaced automatically.
338
+ - The first look at each PR/MR records a new review baseline, so comments posted before then
339
+ aren't announced.
340
+ - Callers of the RPC need the new ID, `opencode-forgekeeper`.
333
341
 
334
342
  With default options, the new footer and review notifications start right away, and
335
343
  notifications resume the session. Set `reviewStatus` to `false` to keep only titles, or
package/dist/index.js CHANGED
@@ -917,7 +917,7 @@ var status = {
917
917
  required: ["enabled", "snapshot"]
918
918
  };
919
919
  var ForgeSessionRpc = {
920
- id: "opencode-forge-session-title",
920
+ id: "opencode-forgekeeper",
921
921
  methods: {
922
922
  target: {
923
923
  input: {
@@ -1805,7 +1805,6 @@ var FEEDBACK_PREFIX = "status/feedback/";
1805
1805
  var pendingPrefix = (sessionID) => `${PENDING_PREFIX}${encodeURIComponent(sessionID)}/`;
1806
1806
  var pendingKey = (sessionID, url) => `${pendingPrefix(sessionID)}${encodeURIComponent(url)}`;
1807
1807
  var feedbackRecordKey = (key2) => `${FEEDBACK_PREFIX}${encodeURIComponent(key2)}`;
1808
- var LEGACY_KEYS = ["status/humanReviewFeedback", "status/automatedReviewPending"];
1809
1808
  function userTitle(title, prefix) {
1810
1809
  if (!title || !prefix)
1811
1810
  return title;
@@ -1971,8 +1970,6 @@ async function setupStatus(ctx, settings, deps, host) {
1971
1970
  });
1972
1971
  invalidate = (sessionID) => service.invalidate(sessionID);
1973
1972
  write(async () => {
1974
- for (const key2 of LEGACY_KEYS)
1975
- await ctx.storage.remove(key2);
1976
1973
  const at = (deps.now ?? Date.now)();
1977
1974
  for (const { key: key2, value } of await scanAll(FEEDBACK_PREFIX)) {
1978
1975
  if (isExpired(value, at))
@@ -2095,7 +2092,7 @@ async function setupServer(ctx, lookups, status2) {
2095
2092
  async function stateFor(sessionID) {
2096
2093
  const started = revision(sessionID);
2097
2094
  const stored = await ctx.storage.get(`sessions/${sessionID}`) ?? {};
2098
- const targets = Array.isArray(stored.targets) ? stored.targets : stored.target ? [stored.target] : [];
2095
+ const targets = Array.isArray(stored.targets) ? stored.targets : [];
2099
2096
  if (revision(sessionID) === started)
2100
2097
  known.set(sessionID, targets);
2101
2098
  return { targets, ...stored.prefix ? { prefix: stored.prefix } : {} };
@@ -2299,7 +2296,7 @@ async function setupServer(ctx, lookups, status2) {
2299
2296
 
2300
2297
  // packages/forgekeeper/src/index.ts
2301
2298
  var src_default = {
2302
- id: "opencode-forge-session-title",
2299
+ id: "opencode-forgekeeper",
2303
2300
  async setup(ctx) {
2304
2301
  const hosts = hostsFrom(ctx.options ?? {});
2305
2302
  const stopped = new AbortController;
package/dist/tui.js CHANGED
@@ -883,7 +883,7 @@ var status = {
883
883
  required: ["enabled", "snapshot"]
884
884
  };
885
885
  var ForgeSessionRpc = {
886
- id: "opencode-forge-session-title",
886
+ id: "opencode-forgekeeper",
887
887
  methods: {
888
888
  target: {
889
889
  input: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-forgekeeper",
3
- "version": "1.0.0",
3
+ "version": "2.0.0",
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",