@de-otio/epimethian-mcp 6.0.0 → 6.0.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/dist/cli/index.js CHANGED
@@ -35206,7 +35206,7 @@ async function getPage(pageId, includeBody) {
35206
35206
  async function _rawCreatePage(spaceId, title, body, parentId, clientLabel) {
35207
35207
  const cfg = await getConfig();
35208
35208
  const pageBody = normalizeBodyForSubmit(body);
35209
- const epimethianTag = `Epimethian v${"6.0.0"}`;
35209
+ const epimethianTag = `Epimethian v${"6.0.1"}`;
35210
35210
  const versionMsg = cfg.attribution && clientLabel ? `Created by ${clientLabel} (via ${epimethianTag})` : `Created by ${epimethianTag}`;
35211
35211
  const payload = {
35212
35212
  title,
@@ -35231,7 +35231,7 @@ async function _rawCreatePage(spaceId, title, body, parentId, clientLabel) {
35231
35231
  async function _rawUpdatePage(pageId, opts) {
35232
35232
  const cfg = await getConfig();
35233
35233
  const newVersion = opts.version + 1;
35234
- const epimethianTag = `Epimethian v${"6.0.0"}`;
35234
+ const epimethianTag = `Epimethian v${"6.0.1"}`;
35235
35235
  const effectiveClient = cfg.attribution ? opts.clientLabel : void 0;
35236
35236
  let versionMessage;
35237
35237
  if (opts.versionMessage && effectiveClient)
@@ -46240,7 +46240,7 @@ function extractRawAcBlocks(md) {
46240
46240
  function escapeRegex2(s) {
46241
46241
  return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
46242
46242
  }
46243
- function extractConfluenceSchemeLinks(md) {
46243
+ function extractConfluenceSchemeLinks(md, confluenceBaseUrl) {
46244
46244
  const links = /* @__PURE__ */ new Map();
46245
46245
  let idx = 0;
46246
46246
  const processed = md.replace(
@@ -46248,7 +46248,18 @@ function extractConfluenceSchemeLinks(md) {
46248
46248
  (_match, text2, href) => {
46249
46249
  const rest = href.slice("confluence://".length);
46250
46250
  const slashIdx = rest.indexOf("/");
46251
- if (slashIdx === -1) return _match;
46251
+ if (slashIdx === -1) {
46252
+ if (!/^\d+$/.test(rest)) return _match;
46253
+ if (!confluenceBaseUrl) {
46254
+ throw new ConverterError(
46255
+ `confluence://${rest} cannot be rewritten: no Confluence base URL is configured. Either configure one (the harness normally injects this), or use the confluence://SPACE_KEY/PAGE_TITLE form instead.`,
46256
+ "CONFLUENCE_LINK_NO_BASE_URL"
46257
+ );
46258
+ }
46259
+ const base = confluenceBaseUrl.replace(/\/+$/, "");
46260
+ const absoluteUrl = `${base}/wiki/pages/viewpage.action?pageId=${rest}`;
46261
+ return `[${text2}](${absoluteUrl})`;
46262
+ }
46252
46263
  const spaceKey = rest.slice(0, slashIdx);
46253
46264
  let pageTitle;
46254
46265
  try {
@@ -46386,7 +46397,7 @@ function markdownToStorage(md, opts) {
46386
46397
  mdi
46387
46398
  );
46388
46399
  const { processed: mdWithoutAcBlocks, blocks: acBlocks } = extractRawAcBlocks(mdWithoutColumns);
46389
- const { processed: mdWithoutConfluenceLinks, links: confluenceLinks } = extractConfluenceSchemeLinks(mdWithoutAcBlocks);
46400
+ const { processed: mdWithoutConfluenceLinks, links: confluenceLinks } = extractConfluenceSchemeLinks(mdWithoutAcBlocks, opts?.confluenceBaseUrl);
46390
46401
  let html;
46391
46402
  try {
46392
46403
  html = mdi.render(mdWithoutConfluenceLinks);
@@ -48338,7 +48349,7 @@ __export(upgrade_exports, {
48338
48349
  runUpgrade: () => runUpgrade
48339
48350
  });
48340
48351
  async function runUpgrade() {
48341
- const currentVersion = "6.0.0";
48352
+ const currentVersion = "6.0.1";
48342
48353
  console.log(`epimethian-mcp upgrade: current version v${currentVersion}`);
48343
48354
  let pending = await getPendingUpdate();
48344
48355
  if (!pending) {
@@ -61136,7 +61147,7 @@ ${lines.join("\n")}${echo2}`
61136
61147
  "resolve_page_link",
61137
61148
  {
61138
61149
  description: withUntrustedNote(
61139
- "Resolve a Confluence page to its stable content ID and URL given a page title and space key. Returns { contentId, url, spaceKey, title } for the matched page. Use this to obtain the contentId for <ac:link> page references via the confluence:// markdown scheme when authoring pages. Policy: if multiple pages share the same title in the space the first match is returned with a notice; use the exact page URL to disambiguate if needed."
61150
+ "Resolve a Confluence page to its stable content ID and URL given a page title and space key. Returns { contentId, url, spaceKey, title } for the matched page. When authoring pages, use the returned values to construct a confluence:// markdown link in either form: `[text](confluence://SPACE_KEY/PAGE_TITLE)` (preferred \u2014 produces an <ac:link> reference that follows the page across renames) or `[text](confluence://CONTENT_ID)` (produces a plain anchor to the page's stable URL). Policy: if multiple pages share the same title in the space the first match is returned with a notice; use the exact page URL to disambiguate if needed."
61140
61151
  ),
61141
61152
  inputSchema: {
61142
61153
  title: external_exports.string().min(1).describe("Exact page title to look up."),
@@ -61180,7 +61191,7 @@ ${titleFenced}${echo2}`
61180
61191
  inputSchema: {}
61181
61192
  },
61182
61193
  async () => {
61183
- let text2 = `epimethian-mcp v${"6.0.0"}`;
61194
+ let text2 = `epimethian-mcp v${"6.0.1"}`;
61184
61195
  try {
61185
61196
  const pending = await getPendingUpdate();
61186
61197
  if (pending) {
@@ -61211,7 +61222,7 @@ ${label} update available: v${pending.current} \u2192 v${pending.latest}. Run \`
61211
61222
  const pending = await getPendingUpdate();
61212
61223
  if (!pending) {
61213
61224
  return toolResult(
61214
- `epimethian-mcp v${"6.0.0"} is already up to date.`
61225
+ `epimethian-mcp v${"6.0.1"} is already up to date.`
61215
61226
  );
61216
61227
  }
61217
61228
  const output = await performUpgrade(pending.latest);
@@ -61233,7 +61244,7 @@ async function startRecoveryServer(profile) {
61233
61244
  const server = new McpServer(
61234
61245
  {
61235
61246
  name: `confluence-${profile}-setup-needed`,
61236
- version: "6.0.0"
61247
+ version: "6.0.1"
61237
61248
  },
61238
61249
  {
61239
61250
  instructions: `The Confluence profile "${profile}" referenced by CONFLUENCE_PROFILE has no keychain entry, so no Confluence tools are available. Call the setup_profile tool for instructions to create it.`
@@ -61284,21 +61295,21 @@ async function main() {
61284
61295
  const serverName = config3.profile ? `confluence-${config3.profile}` : "confluence";
61285
61296
  const server = new McpServer({
61286
61297
  name: serverName,
61287
- version: "6.0.0"
61298
+ version: "6.0.1"
61288
61299
  });
61289
61300
  await registerTools(server, config3);
61290
61301
  const transport = new StdioServerTransport();
61291
61302
  await server.connect(transport);
61292
61303
  try {
61293
61304
  const pending = await getPendingUpdate();
61294
- if (pending && pending.current === "6.0.0") {
61305
+ if (pending && pending.current === "6.0.1") {
61295
61306
  console.error(
61296
61307
  `epimethian-mcp: update available: v${pending.current} \u2192 v${pending.latest} (${pending.type}). Run \`epimethian-mcp upgrade\` to install.`
61297
61308
  );
61298
61309
  }
61299
61310
  } catch {
61300
61311
  }
61301
- checkForUpdates("6.0.0").catch(() => {
61312
+ checkForUpdates("6.0.1").catch(() => {
61302
61313
  });
61303
61314
  }
61304
61315