md-annotator-opencode 0.6.0 → 0.7.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/dist/index.js CHANGED
@@ -26965,12 +26965,28 @@ function getHeartbeatTimeoutMs() {
26965
26965
  }
26966
26966
  return DEFAULT_HEARTBEAT_TIMEOUT_MS;
26967
26967
  }
26968
+ function getPlantumlServerUrl() {
26969
+ const envUrl = process.env.PLANTUML_SERVER_URL;
26970
+ if (envUrl) {
26971
+ return envUrl.replace(/\/+$/, "");
26972
+ }
26973
+ return "https://www.plantuml.com/plantuml";
26974
+ }
26975
+ function getKrokiServerUrl() {
26976
+ const envUrl = process.env.KROKI_SERVER_URL;
26977
+ if (envUrl) {
26978
+ return envUrl.replace(/\/+$/, "");
26979
+ }
26980
+ return "https://kroki.io";
26981
+ }
26968
26982
  var config = {
26969
26983
  port: getServerPort(),
26970
26984
  browser: process.env.MD_ANNOTATOR_BROWSER || null,
26971
26985
  heartbeatTimeoutMs: getHeartbeatTimeoutMs(),
26972
26986
  forceExitTimeoutMs: 5e3,
26973
- jsonLimit: "10mb"
26987
+ jsonLimit: "10mb",
26988
+ plantumlServerUrl: getPlantumlServerUrl(),
26989
+ krokiServerUrl: getKrokiServerUrl()
26974
26990
  };
26975
26991
 
26976
26992
  // ../../server/routes.js
@@ -27028,16 +27044,37 @@ function formatAnnotation(ann, block, heading) {
27028
27044
  `;
27029
27045
  } else {
27030
27046
  output2 += `> ${(ann.text ?? "").replace(/\n/g, "\n> ")}
27047
+ `;
27048
+ }
27049
+ return output2 + "\n";
27050
+ }
27051
+ if (ann.targetType === "pinpoint") {
27052
+ const isDeletion = ann.type === "DELETION";
27053
+ const label = isDeletion ? "Remove block" : "Comment on block";
27054
+ let output2 = `${heading} ${label} (Line ${blockStartLine})
27055
+ `;
27056
+ const preview = ((block == null ? void 0 : block.content) || ann.originalText || "").slice(0, 200);
27057
+ output2 += `\`\`\`
27058
+ ${preview}
27059
+ \`\`\`
27060
+ `;
27061
+ if (isDeletion) {
27062
+ output2 += `> User wants this block removed from the document.
27063
+ `;
27064
+ } else {
27065
+ output2 += `> ${(ann.text ?? "").replace(/\n/g, "\n> ")}
27031
27066
  `;
27032
27067
  }
27033
27068
  return output2 + "\n";
27034
27069
  }
27035
27070
  if (ann.targetType === "diagram") {
27036
27071
  const isDeletion = ann.type === "DELETION";
27037
- const label = isDeletion ? "Remove Mermaid diagram" : "Comment on Mermaid diagram";
27072
+ const diagramLang = (block == null ? void 0 : block.language) === "plantuml" ? "PlantUML" : "Mermaid";
27073
+ const fence = (block == null ? void 0 : block.language) === "plantuml" ? "plantuml" : "mermaid";
27074
+ const label = isDeletion ? `Remove ${diagramLang} diagram` : `Comment on ${diagramLang} diagram`;
27038
27075
  let output2 = `${heading} ${label} (Line ${blockStartLine})
27039
27076
  `;
27040
- output2 += `\`\`\`mermaid
27077
+ output2 += `\`\`\`${fence}
27041
27078
  ${(block == null ? void 0 : block.content) || ann.originalText}
27042
27079
  \`\`\`
27043
27080
  `;
@@ -27272,7 +27309,7 @@ function createApiRouter(filePaths, resolveDecision, origin = "cli", stores = []
27272
27309
  };
27273
27310
  })
27274
27311
  );
27275
- res.json(success({ files, origin }));
27312
+ res.json(success({ files, origin, config: { plantumlServerUrl: config.plantumlServerUrl, krokiServerUrl: config.krokiServerUrl } }));
27276
27313
  } catch (error) {
27277
27314
  res.status(500).json(failure(error.message));
27278
27315
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "md-annotator-opencode",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "OpenCode plugin for interactive markdown annotation",
5
5
  "license": "MIT",
6
6
  "type": "module",