@de-otio/epimethian-mcp 6.6.1 → 6.6.3

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
@@ -35481,7 +35481,7 @@ async function getPage(pageId, includeBody) {
35481
35481
  async function _rawCreatePage(spaceId, title, body, parentId, clientLabel) {
35482
35482
  const cfg = await getConfig();
35483
35483
  const pageBody = normalizeBodyForSubmit(body);
35484
- const epimethianTag = `Epimethian v${"6.6.1"}`;
35484
+ const epimethianTag = `Epimethian v${"6.6.3"}`;
35485
35485
  const versionMsg = cfg.attribution && clientLabel ? `Created by ${clientLabel} (via ${epimethianTag})` : `Created by ${epimethianTag}`;
35486
35486
  const payload = {
35487
35487
  title,
@@ -35502,7 +35502,7 @@ async function _rawCreatePage(spaceId, title, body, parentId, clientLabel) {
35502
35502
  async function _rawUpdatePage(pageId, opts) {
35503
35503
  const cfg = await getConfig();
35504
35504
  const newVersion = opts.version + 1;
35505
- const epimethianTag = `Epimethian v${"6.6.1"}`;
35505
+ const epimethianTag = `Epimethian v${"6.6.3"}`;
35506
35506
  const effectiveClient = cfg.attribution ? opts.clientLabel : void 0;
35507
35507
  let versionMessage;
35508
35508
  if (opts.versionMessage && effectiveClient)
@@ -47896,17 +47896,30 @@ Token tail: ...${last8} Expires: ${isoExpires} Audit ID: ${err.auditId}
47896
47896
  The token is single-use, bound to this exact diff and page version,
47897
47897
  and invalidated by any competing write to this page. If validation
47898
47898
  fails, mint a new one by re-calling without \`confirm_token\`.`;
47899
+ const tokenInText = process.env.EPIMETHIAN_TOKEN_IN_TEXT === "true";
47900
+ const finalText = tokenInText ? text2 + `
47901
+
47902
+ [FALLBACK] Full token (EPIMETHIAN_TOKEN_IN_TEXT=true): ${err.token}` : text2;
47899
47903
  const structuredContent = {
47904
+ kind: "confirmation_required",
47900
47905
  confirm_token: err.token,
47901
47906
  audit_id: err.auditId,
47902
47907
  expires_at: isoExpires,
47903
- page_id: params.pageId
47908
+ page_id: params.pageId,
47909
+ human_summary: err.humanSummary
47904
47910
  };
47905
47911
  if (params.deletionSummary) {
47906
- structuredContent.deletion_summary = params.deletionSummary;
47912
+ structuredContent.deletion_summary = {
47913
+ tocs: params.deletionSummary.tocs,
47914
+ links: params.deletionSummary.links,
47915
+ structured_macros: params.deletionSummary.structuredMacros,
47916
+ code_macros: params.deletionSummary.codeMacros,
47917
+ plain_elements: params.deletionSummary.plainElements,
47918
+ other: params.deletionSummary.other
47919
+ };
47907
47920
  }
47908
47921
  return {
47909
- content: [{ type: "text", text: text2 }],
47922
+ content: [{ type: "text", text: finalText }],
47910
47923
  isError: true,
47911
47924
  structuredContent
47912
47925
  };
@@ -48986,7 +48999,7 @@ var init_client_configs = __esm({
48986
48999
  null,
48987
49000
  2
48988
49001
  ),
48989
- warning: "VS Code extension \u2264 2.1.123 does not honour elicitation requests; if write tools fail with NO_USER_RESPONSE, set `EPIMETHIAN_BYPASS_ELICITATION=true`."
49002
+ warning: "VS Code extension \u2264 2.1.123 does not honour elicitation requests; if write tools fail with NO_USER_RESPONSE, set `EPIMETHIAN_BYPASS_ELICITATION=true`.\n\nv6.6.2 declares an `outputSchema` on every write tool, so a spec-compliant client should now surface the soft-confirm `structuredContent` to the agent. If your version of Claude Code drops content blocks when structuredContent is present (issue #15412), set `EPIMETHIAN_TOKEN_IN_TEXT=true` as a fallback \u2014 this restores the human-readable explanation by also putting the full token in the text block."
48990
49003
  },
48991
49004
  {
48992
49005
  id: "cursor",
@@ -49937,7 +49950,7 @@ __export(upgrade_exports, {
49937
49950
  runUpgrade: () => runUpgrade
49938
49951
  });
49939
49952
  async function runUpgrade() {
49940
- const currentVersion = "6.6.1";
49953
+ const currentVersion = "6.6.3";
49941
49954
  console.log(`epimethian-mcp upgrade: current version v${currentVersion}`);
49942
49955
  let pending = await getPendingUpdate();
49943
49956
  if (!pending) {
@@ -61110,6 +61123,67 @@ var versionField = external_exports.union([
61110
61123
  external_exports.literal("current")
61111
61124
  ]);
61112
61125
 
61126
+ // src/server/output-schema.ts
61127
+ init_zod();
61128
+ var deletionSummarySchema = external_exports.object({
61129
+ tocs: external_exports.number().int().nonnegative(),
61130
+ links: external_exports.number().int().nonnegative(),
61131
+ structured_macros: external_exports.number().int().nonnegative(),
61132
+ code_macros: external_exports.number().int().nonnegative(),
61133
+ plain_elements: external_exports.number().int().nonnegative(),
61134
+ other: external_exports.number().int().nonnegative()
61135
+ });
61136
+ var confirmationRequiredArm = external_exports.object({
61137
+ kind: external_exports.literal("confirmation_required"),
61138
+ confirm_token: external_exports.string().min(1),
61139
+ audit_id: external_exports.string().min(1),
61140
+ expires_at: external_exports.string().min(1),
61141
+ page_id: external_exports.string().min(1),
61142
+ human_summary: external_exports.string(),
61143
+ deletion_summary: deletionSummarySchema.optional()
61144
+ });
61145
+ var writeSuccessArm = external_exports.object({
61146
+ kind: external_exports.literal("written"),
61147
+ page_id: external_exports.string().min(1),
61148
+ new_version: external_exports.number().int().positive(),
61149
+ body_bytes_before: external_exports.number().int().nonnegative().optional(),
61150
+ body_bytes_after: external_exports.number().int().nonnegative().optional(),
61151
+ title: external_exports.string().optional()
61152
+ });
61153
+ var deleteSuccessArm = external_exports.object({
61154
+ kind: external_exports.literal("deleted"),
61155
+ page_id: external_exports.string().min(1),
61156
+ last_version: external_exports.number().int().positive().optional()
61157
+ });
61158
+ var writeOutputSchema = external_exports.object({
61159
+ kind: external_exports.enum(["written", "confirmation_required"]),
61160
+ page_id: external_exports.string().min(1),
61161
+ // success arm fields (all optional — present only on `written`)
61162
+ new_version: external_exports.number().int().positive().optional(),
61163
+ body_bytes_before: external_exports.number().int().nonnegative().optional(),
61164
+ body_bytes_after: external_exports.number().int().nonnegative().optional(),
61165
+ title: external_exports.string().optional(),
61166
+ // confirmation_required arm fields (all optional — present only
61167
+ // when `kind: "confirmation_required"`)
61168
+ confirm_token: external_exports.string().min(1).optional(),
61169
+ audit_id: external_exports.string().min(1).optional(),
61170
+ expires_at: external_exports.string().min(1).optional(),
61171
+ human_summary: external_exports.string().optional(),
61172
+ deletion_summary: deletionSummarySchema.optional()
61173
+ });
61174
+ var deleteOutputSchema = external_exports.object({
61175
+ kind: external_exports.enum(["deleted", "confirmation_required"]),
61176
+ page_id: external_exports.string().min(1),
61177
+ // success arm fields
61178
+ last_version: external_exports.number().int().positive().optional(),
61179
+ // confirmation_required arm fields
61180
+ confirm_token: external_exports.string().min(1).optional(),
61181
+ audit_id: external_exports.string().min(1).optional(),
61182
+ expires_at: external_exports.string().min(1).optional(),
61183
+ human_summary: external_exports.string().optional(),
61184
+ deletion_summary: deletionSummarySchema.optional()
61185
+ });
61186
+
61113
61187
  // src/server/index.ts
61114
61188
  init_update_orchestrator();
61115
61189
  init_tokeniser();
@@ -61876,6 +61950,11 @@ ${truncated}${truncationNote(origLen)}`
61876
61950
  source: sourceSchema,
61877
61951
  confirm_token: external_exports.string().optional().describe("Soft-confirmation token from a prior SOFT_CONFIRMATION_REQUIRED response. Single-use; bound to this exact diff and page version.")
61878
61952
  },
61953
+ // v6.6.2 §3.1 — declared so spec-compliant clients forward our
61954
+ // structuredContent payload to the agent (the soft-confirmation
61955
+ // round-trip relied on this from the start; v6.6.0/6.6.1 emitted
61956
+ // structuredContent without a schema so most clients dropped it).
61957
+ outputSchema: writeOutputSchema,
61879
61958
  annotations: { destructiveHint: false, idempotentHint: false }
61880
61959
  },
61881
61960
  async ({ page_id, title, version: version2, body, version_message, confirm_deletions, replace_body, confirm_shrinkage, confirm_structure_loss, allow_raw_html, confluence_base_url, source, confirm_token }) => {
@@ -61972,14 +62051,34 @@ ${truncated}${truncationNote(origLen)}`
61972
62051
  const badgeResult = await markPageUnverified(submitted.page.id, cfg);
61973
62052
  if (badgeResult.warning) warnings.push(badgeResult.warning);
61974
62053
  if (isTitleOnly) {
61975
- return toolResult(
62054
+ const titleOnlyResult = toolResult(
61976
62055
  appendWarnings(`Updated: ${submitted.page.title} (ID: ${submitted.page.id}, version: ${submitted.newVersion}, title only, body unchanged)`, warnings) + echo
61977
62056
  );
62057
+ return {
62058
+ ...titleOnlyResult,
62059
+ structuredContent: {
62060
+ kind: "written",
62061
+ page_id,
62062
+ new_version: submitted.newVersion,
62063
+ title: submitted.page.title
62064
+ }
62065
+ };
61978
62066
  }
61979
62067
  const removalNote = submitted.deletedTokens.length > 0 ? `; removed ${submitted.deletedTokens.length} preserved macro${submitted.deletedTokens.length === 1 ? "" : "s"}: ${submitted.deletedTokens.map((t) => t.fingerprint).join(", ")}` : "";
61980
- return toolResult(
62068
+ const bodyUpdateResult = toolResult(
61981
62069
  appendWarnings(`Updated: ${submitted.page.title} (ID: ${submitted.page.id}, version: ${submitted.newVersion}, body: ${submitted.oldLen}\u2192${submitted.newLen} chars${removalNote})`, warnings) + echo
61982
62070
  );
62071
+ return {
62072
+ ...bodyUpdateResult,
62073
+ structuredContent: {
62074
+ kind: "written",
62075
+ page_id,
62076
+ new_version: submitted.newVersion,
62077
+ body_bytes_before: submitted.oldLen,
62078
+ body_bytes_after: submitted.newLen,
62079
+ title: submitted.page.title
62080
+ }
62081
+ };
61983
62082
  } catch (err) {
61984
62083
  if (err instanceof SoftConfirmationRequiredError) {
61985
62084
  return formatSoftConfirmationResult(err, { pageId: page_id });
@@ -62005,6 +62104,10 @@ ${truncated}${truncationNote(origLen)}`
62005
62104
  source: sourceSchema,
62006
62105
  confirm_token: external_exports.string().optional().describe("Soft-confirmation token from a prior SOFT_CONFIRMATION_REQUIRED response. Single-use; bound to this exact page version.")
62007
62106
  },
62107
+ // v6.6.2 §3.1 — declared so spec-compliant clients forward our
62108
+ // structuredContent payload (especially the soft-confirm token)
62109
+ // to the agent.
62110
+ outputSchema: deleteOutputSchema,
62008
62111
  annotations: { destructiveHint: true, idempotentHint: true }
62009
62112
  },
62010
62113
  async ({ page_id, version: version2, source, confirm_token }) => {
@@ -62070,7 +62173,15 @@ ${truncated}${truncationNote(origLen)}`
62070
62173
  ...version2 !== void 0 ? { oldVersion: version2 } : {},
62071
62174
  source: effectiveSource
62072
62175
  });
62073
- return toolResult(`Deleted page ${page_id}` + echo);
62176
+ const deletedResult = toolResult(`Deleted page ${page_id}` + echo);
62177
+ return {
62178
+ ...deletedResult,
62179
+ structuredContent: {
62180
+ kind: "deleted",
62181
+ page_id,
62182
+ ...version2 !== void 0 ? { last_version: version2 } : {}
62183
+ }
62184
+ };
62074
62185
  } catch (err) {
62075
62186
  if (err instanceof SoftConfirmationRequiredError) {
62076
62187
  return formatSoftConfirmationResult(err, { pageId: page_id });
@@ -62114,6 +62225,9 @@ ${truncated}${truncationNote(origLen)}`
62114
62225
  confirm_deletions: external_exports.boolean().default(false).describe("Set to true to acknowledge that your markdown removes preserved macros, emoticons, or rich elements from this section. Required when any preserved element would be deleted."),
62115
62226
  confirm_token: external_exports.string().optional().describe("Soft-confirmation token from a prior SOFT_CONFIRMATION_REQUIRED response. Single-use; bound to this exact diff and page version.")
62116
62227
  },
62228
+ // v6.6.2 §3.1 — declared so spec-compliant clients forward our
62229
+ // structuredContent payload to the agent.
62230
+ outputSchema: writeOutputSchema,
62117
62231
  annotations: { destructiveHint: false, idempotentHint: false }
62118
62232
  },
62119
62233
  async ({ page_id, section, body, find_replace, version: version2, version_message, confirm_deletions, confirm_token }) => {
@@ -62187,12 +62301,23 @@ ${truncated}${truncationNote(origLen)}`
62187
62301
  const badgeResult2 = await markPageUnverified(submitted2.page.id, cfg);
62188
62302
  if (badgeResult2.warning) warnings2.push(badgeResult2.warning);
62189
62303
  const pairCount = find_replace.length;
62190
- return toolResult(
62304
+ const findReplaceResult = toolResult(
62191
62305
  appendWarnings(
62192
62306
  `Updated section "${section}" in: ${submitted2.page.title} (ID: ${submitted2.page.id}, version: ${submitted2.newVersion}; applied ${pairCount} find/replace substitution${pairCount === 1 ? "" : "s"})`,
62193
62307
  warnings2
62194
62308
  ) + echo
62195
62309
  );
62310
+ return {
62311
+ ...findReplaceResult,
62312
+ structuredContent: {
62313
+ kind: "written",
62314
+ page_id,
62315
+ new_version: submitted2.newVersion,
62316
+ body_bytes_before: submitted2.oldLen,
62317
+ body_bytes_after: submitted2.newLen,
62318
+ title: submitted2.page.title
62319
+ }
62320
+ };
62196
62321
  }
62197
62322
  if (confirm_deletions) {
62198
62323
  const deletionSummary = tryForecastDeletions(currentSectionBody, body, cfg.url);
@@ -62261,9 +62386,20 @@ ${truncated}${truncationNote(origLen)}`
62261
62386
  const badgeResult = await markPageUnverified(submitted.page.id, cfg);
62262
62387
  if (badgeResult.warning) warnings.push(badgeResult.warning);
62263
62388
  const removalNote = submitted.deletedTokens.length > 0 ? `; removed ${submitted.deletedTokens.length} preserved macro${submitted.deletedTokens.length === 1 ? "" : "s"}: ${submitted.deletedTokens.map((t) => t.fingerprint).join(", ")}` : "";
62264
- return toolResult(
62389
+ const sectionBodyResult = toolResult(
62265
62390
  appendWarnings(`Updated section "${section}" in: ${submitted.page.title} (ID: ${submitted.page.id}, version: ${submitted.newVersion}${removalNote})`, warnings) + echo
62266
62391
  );
62392
+ return {
62393
+ ...sectionBodyResult,
62394
+ structuredContent: {
62395
+ kind: "written",
62396
+ page_id,
62397
+ new_version: submitted.newVersion,
62398
+ body_bytes_before: submitted.oldLen,
62399
+ body_bytes_after: submitted.newLen,
62400
+ title: submitted.page.title
62401
+ }
62402
+ };
62267
62403
  } catch (err) {
62268
62404
  if (err instanceof SoftConfirmationRequiredError) {
62269
62405
  return formatSoftConfirmationResult(err, { pageId: page_id });
@@ -62451,6 +62587,9 @@ ${truncated}${truncationNote(origLen)}`
62451
62587
  confluence_base_url: external_exports.string().url().optional().describe("Override the Confluence base URL used by the link rewriter."),
62452
62588
  confirm_token: external_exports.string().optional().describe("Soft-confirmation token from a prior SOFT_CONFIRMATION_REQUIRED response. Single-use; bound to this exact diff and page version.")
62453
62589
  },
62590
+ // v6.6.2 \u00a73.1 \u2014 declared so spec-compliant clients forward our
62591
+ // structuredContent payload to the agent.
62592
+ outputSchema: writeOutputSchema,
62454
62593
  annotations: { destructiveHint: false, idempotentHint: false }
62455
62594
  },
62456
62595
  async ({ page_id, version: version2, content, separator, version_message, allow_raw_html, confluence_base_url }) => {
@@ -62471,7 +62610,18 @@ ${truncated}${truncationNote(origLen)}`
62471
62610
  if (labelResult.warning) warnings.push(labelResult.warning);
62472
62611
  const badgeResult = await markPageUnverified(page.id, cfg);
62473
62612
  if (badgeResult.warning) warnings.push(badgeResult.warning);
62474
- return toolResult(appendWarnings(`Prepended to: ${page.title} (ID: ${page.id}, version: ${newVersion}, body: ${oldLen}\u2192${newLen} chars)`, warnings) + echo);
62613
+ const prependResult = toolResult(appendWarnings(`Prepended to: ${page.title} (ID: ${page.id}, version: ${newVersion}, body: ${oldLen}\u2192${newLen} chars)`, warnings) + echo);
62614
+ return {
62615
+ ...prependResult,
62616
+ structuredContent: {
62617
+ kind: "written",
62618
+ page_id,
62619
+ new_version: newVersion,
62620
+ body_bytes_before: oldLen,
62621
+ body_bytes_after: newLen,
62622
+ title: page.title
62623
+ }
62624
+ };
62475
62625
  } catch (err) {
62476
62626
  if (err instanceof SoftConfirmationRequiredError) {
62477
62627
  return formatSoftConfirmationResult(err, { pageId: page_id });
@@ -62501,6 +62651,9 @@ ${truncated}${truncationNote(origLen)}`
62501
62651
  confluence_base_url: external_exports.string().url().optional().describe("Override the Confluence base URL used by the link rewriter."),
62502
62652
  confirm_token: external_exports.string().optional().describe("Soft-confirmation token from a prior SOFT_CONFIRMATION_REQUIRED response. Single-use; bound to this exact diff and page version.")
62503
62653
  },
62654
+ // v6.6.2 \u00a73.1 \u2014 declared so spec-compliant clients forward our
62655
+ // structuredContent payload to the agent.
62656
+ outputSchema: writeOutputSchema,
62504
62657
  annotations: { destructiveHint: false, idempotentHint: false }
62505
62658
  },
62506
62659
  async ({ page_id, version: version2, content, separator, version_message, allow_raw_html, confluence_base_url }) => {
@@ -62521,7 +62674,18 @@ ${truncated}${truncationNote(origLen)}`
62521
62674
  if (labelResult.warning) warnings.push(labelResult.warning);
62522
62675
  const badgeResult = await markPageUnverified(page.id, cfg);
62523
62676
  if (badgeResult.warning) warnings.push(badgeResult.warning);
62524
- return toolResult(appendWarnings(`Appended to: ${page.title} (ID: ${page.id}, version: ${newVersion}, body: ${oldLen}\u2192${newLen} chars)`, warnings) + echo);
62677
+ const appendResult = toolResult(appendWarnings(`Appended to: ${page.title} (ID: ${page.id}, version: ${newVersion}, body: ${oldLen}\u2192${newLen} chars)`, warnings) + echo);
62678
+ return {
62679
+ ...appendResult,
62680
+ structuredContent: {
62681
+ kind: "written",
62682
+ page_id,
62683
+ new_version: newVersion,
62684
+ body_bytes_before: oldLen,
62685
+ body_bytes_after: newLen,
62686
+ title: page.title
62687
+ }
62688
+ };
62525
62689
  } catch (err) {
62526
62690
  if (err instanceof SoftConfirmationRequiredError) {
62527
62691
  return formatSoftConfirmationResult(err, { pageId: page_id });
@@ -63680,7 +63844,7 @@ ${titleFenced}${echo2}`
63680
63844
  inputSchema: {}
63681
63845
  },
63682
63846
  async () => {
63683
- let text2 = `epimethian-mcp v${"6.6.1"}`;
63847
+ let text2 = `epimethian-mcp v${"6.6.3"}`;
63684
63848
  try {
63685
63849
  const pending = await getPendingUpdate();
63686
63850
  if (pending) {
@@ -63711,7 +63875,7 @@ ${label} update available: v${pending.current} \u2192 v${pending.latest}. Run \`
63711
63875
  const pending = await getPendingUpdate();
63712
63876
  if (!pending) {
63713
63877
  return toolResult(
63714
- `epimethian-mcp v${"6.6.1"} is already up to date.`
63878
+ `epimethian-mcp v${"6.6.3"} is already up to date.`
63715
63879
  );
63716
63880
  }
63717
63881
  const output = await performUpgrade(pending.latest);
@@ -63733,7 +63897,7 @@ async function startRecoveryServer(profile) {
63733
63897
  const server = new McpServer(
63734
63898
  {
63735
63899
  name: `confluence-${profile}-setup-needed`,
63736
- version: "6.6.1"
63900
+ version: "6.6.3"
63737
63901
  },
63738
63902
  {
63739
63903
  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.`
@@ -63784,21 +63948,21 @@ async function main() {
63784
63948
  const serverName = config3.profile ? `confluence-${config3.profile}` : "confluence";
63785
63949
  const server = new McpServer({
63786
63950
  name: serverName,
63787
- version: "6.6.1"
63951
+ version: "6.6.3"
63788
63952
  });
63789
63953
  await registerTools(server, config3);
63790
63954
  const transport = new StdioServerTransport();
63791
63955
  await server.connect(transport);
63792
63956
  try {
63793
63957
  const pending = await getPendingUpdate();
63794
- if (pending && pending.current === "6.6.1") {
63958
+ if (pending && pending.current === "6.6.3") {
63795
63959
  console.error(
63796
63960
  `epimethian-mcp: update available: v${pending.current} \u2192 v${pending.latest} (${pending.type}). Run \`epimethian-mcp upgrade\` to install.`
63797
63961
  );
63798
63962
  }
63799
63963
  } catch {
63800
63964
  }
63801
- checkForUpdates("6.6.1").catch(() => {
63965
+ checkForUpdates("6.6.3").catch(() => {
63802
63966
  });
63803
63967
  }
63804
63968