@de-otio/epimethian-mcp 6.1.0 → 6.2.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/cli/index.js +20 -17
- package/dist/cli/index.js.map +2 -2
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -35442,7 +35442,7 @@ async function getPage(pageId, includeBody) {
|
|
|
35442
35442
|
async function _rawCreatePage(spaceId, title, body, parentId, clientLabel) {
|
|
35443
35443
|
const cfg = await getConfig();
|
|
35444
35444
|
const pageBody = normalizeBodyForSubmit(body);
|
|
35445
|
-
const epimethianTag = `Epimethian v${"6.
|
|
35445
|
+
const epimethianTag = `Epimethian v${"6.2.0"}`;
|
|
35446
35446
|
const versionMsg = cfg.attribution && clientLabel ? `Created by ${clientLabel} (via ${epimethianTag})` : `Created by ${epimethianTag}`;
|
|
35447
35447
|
const payload = {
|
|
35448
35448
|
title,
|
|
@@ -35463,7 +35463,7 @@ async function _rawCreatePage(spaceId, title, body, parentId, clientLabel) {
|
|
|
35463
35463
|
async function _rawUpdatePage(pageId, opts) {
|
|
35464
35464
|
const cfg = await getConfig();
|
|
35465
35465
|
const newVersion = opts.version + 1;
|
|
35466
|
-
const epimethianTag = `Epimethian v${"6.
|
|
35466
|
+
const epimethianTag = `Epimethian v${"6.2.0"}`;
|
|
35467
35467
|
const effectiveClient = cfg.attribution ? opts.clientLabel : void 0;
|
|
35468
35468
|
let versionMessage;
|
|
35469
35469
|
if (opts.versionMessage && effectiveClient)
|
|
@@ -35738,8 +35738,11 @@ async function getContentState(pageId) {
|
|
|
35738
35738
|
try {
|
|
35739
35739
|
const res = await confluenceRequest(url.toString());
|
|
35740
35740
|
const data = await res.json();
|
|
35741
|
-
|
|
35742
|
-
|
|
35741
|
+
const state = data && typeof data === "object" && "contentState" in data ? data.contentState : data;
|
|
35742
|
+
if (!state || typeof state !== "object") return null;
|
|
35743
|
+
const s = state;
|
|
35744
|
+
if (typeof s.name !== "string" || typeof s.color !== "string") return null;
|
|
35745
|
+
return ContentStateSchema.parse({ name: s.name, color: s.color });
|
|
35743
35746
|
} catch (err) {
|
|
35744
35747
|
if (err instanceof ConfluenceApiError && err.status === 404) return null;
|
|
35745
35748
|
throw err;
|
|
@@ -47079,11 +47082,11 @@ function parseBudget(envValue, fallback) {
|
|
|
47079
47082
|
}
|
|
47080
47083
|
return n;
|
|
47081
47084
|
}
|
|
47082
|
-
var
|
|
47085
|
+
var WINDOW_MS, DEFAULT_SESSION_BUDGET, DEFAULT_HOURLY_BUDGET, WriteBudget, WRITE_BUDGET_EXCEEDED, WriteBudgetExceededError, writeBudget;
|
|
47083
47086
|
var init_write_budget = __esm({
|
|
47084
47087
|
"src/server/write-budget.ts"() {
|
|
47085
47088
|
"use strict";
|
|
47086
|
-
|
|
47089
|
+
WINDOW_MS = 15 * 60 * 1e3;
|
|
47087
47090
|
DEFAULT_SESSION_BUDGET = 100;
|
|
47088
47091
|
DEFAULT_HOURLY_BUDGET = 25;
|
|
47089
47092
|
WriteBudget = class {
|
|
@@ -47110,7 +47113,7 @@ var init_write_budget = __esm({
|
|
|
47110
47113
|
*/
|
|
47111
47114
|
consume() {
|
|
47112
47115
|
const now = Date.now();
|
|
47113
|
-
const cutoff = now -
|
|
47116
|
+
const cutoff = now - WINDOW_MS;
|
|
47114
47117
|
this.hourlyTimestamps = this.hourlyTimestamps.filter((ts) => ts >= cutoff);
|
|
47115
47118
|
const sessionLimit = this.sessionLimit;
|
|
47116
47119
|
if (sessionLimit > 0 && this.sessionCount >= sessionLimit) {
|
|
@@ -47124,10 +47127,10 @@ var init_write_budget = __esm({
|
|
|
47124
47127
|
const hourlyLimit = this.hourlyLimit;
|
|
47125
47128
|
if (hourlyLimit > 0 && this.hourlyTimestamps.length >= hourlyLimit) {
|
|
47126
47129
|
const oldest = this.hourlyTimestamps[0];
|
|
47127
|
-
const waitMs = Math.max(0, oldest +
|
|
47130
|
+
const waitMs = Math.max(0, oldest + WINDOW_MS - now);
|
|
47128
47131
|
const waitMin = Math.ceil(waitMs / 6e4);
|
|
47129
47132
|
throw new WriteBudgetExceededError(
|
|
47130
|
-
`
|
|
47133
|
+
`Rolling write budget exhausted: ${this.hourlyTimestamps.length} writes in the last 15 min, limit ${hourlyLimit}. Window opens again in ~${waitMin} min. Raise the cap with EPIMETHIAN_WRITE_BUDGET_HOURLY=<n> (or 0 to disable).`,
|
|
47131
47134
|
"hourly",
|
|
47132
47135
|
this.hourlyTimestamps.length,
|
|
47133
47136
|
hourlyLimit
|
|
@@ -47143,7 +47146,7 @@ var init_write_budget = __esm({
|
|
|
47143
47146
|
/** Current hourly counter (for observability). */
|
|
47144
47147
|
get hourly() {
|
|
47145
47148
|
const now = Date.now();
|
|
47146
|
-
const cutoff = now -
|
|
47149
|
+
const cutoff = now - WINDOW_MS;
|
|
47147
47150
|
this.hourlyTimestamps = this.hourlyTimestamps.filter((ts) => ts >= cutoff);
|
|
47148
47151
|
return this.hourlyTimestamps.length;
|
|
47149
47152
|
}
|
|
@@ -48701,7 +48704,7 @@ __export(upgrade_exports, {
|
|
|
48701
48704
|
runUpgrade: () => runUpgrade
|
|
48702
48705
|
});
|
|
48703
48706
|
async function runUpgrade() {
|
|
48704
|
-
const currentVersion = "6.
|
|
48707
|
+
const currentVersion = "6.2.0";
|
|
48705
48708
|
console.log(`epimethian-mcp upgrade: current version v${currentVersion}`);
|
|
48706
48709
|
let pending = await getPendingUpdate();
|
|
48707
48710
|
if (!pending) {
|
|
@@ -61784,7 +61787,7 @@ ${titleFenced}${echo2}`
|
|
|
61784
61787
|
inputSchema: {}
|
|
61785
61788
|
},
|
|
61786
61789
|
async () => {
|
|
61787
|
-
let text2 = `epimethian-mcp v${"6.
|
|
61790
|
+
let text2 = `epimethian-mcp v${"6.2.0"}`;
|
|
61788
61791
|
try {
|
|
61789
61792
|
const pending = await getPendingUpdate();
|
|
61790
61793
|
if (pending) {
|
|
@@ -61815,7 +61818,7 @@ ${label} update available: v${pending.current} \u2192 v${pending.latest}. Run \`
|
|
|
61815
61818
|
const pending = await getPendingUpdate();
|
|
61816
61819
|
if (!pending) {
|
|
61817
61820
|
return toolResult(
|
|
61818
|
-
`epimethian-mcp v${"6.
|
|
61821
|
+
`epimethian-mcp v${"6.2.0"} is already up to date.`
|
|
61819
61822
|
);
|
|
61820
61823
|
}
|
|
61821
61824
|
const output = await performUpgrade(pending.latest);
|
|
@@ -61837,7 +61840,7 @@ async function startRecoveryServer(profile) {
|
|
|
61837
61840
|
const server = new McpServer(
|
|
61838
61841
|
{
|
|
61839
61842
|
name: `confluence-${profile}-setup-needed`,
|
|
61840
|
-
version: "6.
|
|
61843
|
+
version: "6.2.0"
|
|
61841
61844
|
},
|
|
61842
61845
|
{
|
|
61843
61846
|
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.`
|
|
@@ -61888,21 +61891,21 @@ async function main() {
|
|
|
61888
61891
|
const serverName = config3.profile ? `confluence-${config3.profile}` : "confluence";
|
|
61889
61892
|
const server = new McpServer({
|
|
61890
61893
|
name: serverName,
|
|
61891
|
-
version: "6.
|
|
61894
|
+
version: "6.2.0"
|
|
61892
61895
|
});
|
|
61893
61896
|
await registerTools(server, config3);
|
|
61894
61897
|
const transport = new StdioServerTransport();
|
|
61895
61898
|
await server.connect(transport);
|
|
61896
61899
|
try {
|
|
61897
61900
|
const pending = await getPendingUpdate();
|
|
61898
|
-
if (pending && pending.current === "6.
|
|
61901
|
+
if (pending && pending.current === "6.2.0") {
|
|
61899
61902
|
console.error(
|
|
61900
61903
|
`epimethian-mcp: update available: v${pending.current} \u2192 v${pending.latest} (${pending.type}). Run \`epimethian-mcp upgrade\` to install.`
|
|
61901
61904
|
);
|
|
61902
61905
|
}
|
|
61903
61906
|
} catch {
|
|
61904
61907
|
}
|
|
61905
|
-
checkForUpdates("6.
|
|
61908
|
+
checkForUpdates("6.2.0").catch(() => {
|
|
61906
61909
|
});
|
|
61907
61910
|
}
|
|
61908
61911
|
|