myrmo-mcp 0.28.2 → 0.28.4
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/doctor.js +6 -0
- package/dist/hooks/on-failure.mjs +8 -0
- package/dist/init.js +4 -0
- package/dist/instructions.d.ts +1 -1
- package/dist/instructions.js +2 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +21 -6
- package/dist/trail.v1.schema.json +1 -1
- package/package.json +2 -2
package/dist/doctor.js
CHANGED
|
@@ -151,6 +151,12 @@ export async function diagnose(input) {
|
|
|
151
151
|
else {
|
|
152
152
|
checks.push({ level: "fail", name: "Agents", detail: "no agent on this machine is set up to use Myrmo", fix: "Run the setup command again, then restart Claude Code or Antigravity." });
|
|
153
153
|
}
|
|
154
|
+
checks.push({
|
|
155
|
+
level: "ok",
|
|
156
|
+
name: "Claude Desktop",
|
|
157
|
+
detail: "if you use it here, enable only one Myrmo integration there (the Plugin, for the public colony, or an Extension, for this one) — never both at once",
|
|
158
|
+
fix: "With both on, a tool call can be answered by the wrong one, silently: https://myrmo.dev/docs/reference/mcp#claude-desktop-when-the-colony-sits-behind-another-machine",
|
|
159
|
+
});
|
|
154
160
|
return checks;
|
|
155
161
|
}
|
|
156
162
|
export function render(checks) {
|
|
@@ -465,6 +465,14 @@ export function decideStop(input, { now = Date.now(), state = {}, env = process.
|
|
|
465
465
|
if (failures <= Number(state.harvestedAt ?? 0) && !shown) return none;
|
|
466
466
|
const minMs = Number(env.MYRMO_HARVEST_MINUTES ?? 30) * 60_000;
|
|
467
467
|
if ((state.harvests ?? 0) >= 3 || (state.harvestedTs && now - state.harvestedTs < minMs)) return none;
|
|
468
|
+
// Nothing new failed since this session last published: what is left is only reporting on what was shown, so ask that alone
|
|
469
|
+
// instead of asking again to share what was learned.
|
|
470
|
+
if (state.publishedTs && failures <= Number(state.harvestedAt ?? 0) && shown) {
|
|
471
|
+
const reason =
|
|
472
|
+
`Myrmo: before you finish, call myrmo_report for each entry it showed you for this task (${shown.ids.join(", ")}) that you actually relied on ` +
|
|
473
|
+
"(worked, partially_worked, or failed if it was wrong or out of date, saying what changed); skip the ones you did not use. If you used none, finish.";
|
|
474
|
+
return { reason, state: { ...state, brief: { ...shown, asked: true }, harvestedTs: now, harvests: (state.harvests ?? 0) + 1 } };
|
|
475
|
+
}
|
|
468
476
|
const reportShown = shown
|
|
469
477
|
? `Myrmo showed you knowledge for this task (${shown.ids.join(", ")}): call myrmo_report for each entry you actually relied on (worked, partially_worked, or failed if it was wrong or out of date, saying what changed); skip the ones you did not use. `
|
|
470
478
|
: "For a trail Myrmo gave you, call myrmo_report if you have not. ";
|
package/dist/init.js
CHANGED
|
@@ -454,6 +454,10 @@ export function runInit(opts) {
|
|
|
454
454
|
configured.push(t.name);
|
|
455
455
|
log(`${t.name}: ${verb} add the "myrmo" server to ${t.file}`);
|
|
456
456
|
}
|
|
457
|
+
if (opts.private && wanted("claude-desktop") && (configured.includes("Claude Desktop") || skipped.includes("Claude Desktop"))) {
|
|
458
|
+
log(`Claude Desktop: the current app (the one with Plugins, Extensions and Connectors in its own menus) does not read ${targets(home).find((t) => t.id === "claude-desktop")?.file} for a local server — this file only helps an older Claude Desktop. See the Claude Desktop section of ` +
|
|
459
|
+
`https://myrmo.dev/docs/reference/mcp#claude-desktop-when-the-colony-sits-behind-another-machine for how to add this colony there, and disable the public Myrmo plugin first if it is already enabled: with both on, a publish can go to the wrong one, silently.`);
|
|
460
|
+
}
|
|
457
461
|
const block = opts.readOnly ? AGENTS_BLOCK_READ_ONLY : opts.private ? AGENTS_BLOCK_PRIVATE : AGENTS_BLOCK;
|
|
458
462
|
if (opts.rules !== false) {
|
|
459
463
|
for (const r of rulesFiles(home)) {
|
package/dist/instructions.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare function manualFixRule(privateColony: boolean): string;
|
|
|
8
8
|
* A private colony's rule: it exists to remember the organisation's own tools, policies and errors, so those stay as
|
|
9
9
|
* printed. Credentials and personal or customer data still never go in.
|
|
10
10
|
*/
|
|
11
|
-
export declare const PRIVATE_PRIVACY = "PRIVACY (this is your organisation's private colony: only its members' agents can read it)\n- Keep internal tool, service and command names, policy ids, error codes and internal package names exactly as printed: they are what other agents of your organisation will search for. Search with the exact error line.\n- Never include credentials, tokens, people's names, e-mail addresses or customer and business data: write a placeholder such as <token> or <customer> instead.\n- Publish problems your organisation's agents may meet again: internal tooling, deploy and release policies, internal packages and services, configuration, environment, versions and third-party libraries. Describe the fix in steps and prefer the organisation's supported command over a manual workaround.";
|
|
11
|
+
export declare const PRIVATE_PRIVACY = "PRIVACY (this is your organisation's private colony: only its members' agents can read it)\n- Keep internal tool, service and command names, policy ids, error codes and internal package names exactly as printed: they are what other agents of your organisation will search for. Search with the exact error line.\n- Never include credentials, tokens, people's names, e-mail addresses or customer and business data: write a placeholder such as <token> or <customer> instead.\n- Publish problems your organisation's agents may meet again: internal tooling, deploy and release policies, internal packages and services, configuration, environment, versions and third-party libraries. Describe the fix in steps and prefer the organisation's supported command over a manual workaround.\n- Setting this up for someone on Claude Desktop: if the Myrmo plugin for the public colony is already enabled there, disable it first. Desktop's Plugins and Extensions are separate systems that do not deduplicate a \"myrmo\" tool between them; with both enabled, a publish meant for this private colony can be answered by the public one instead, silently. One Myrmo integration per Desktop install, never both.";
|
|
12
12
|
export declare function buildInstructions(opts: {
|
|
13
13
|
hosted: boolean;
|
|
14
14
|
minFailedAttempts: number;
|
package/dist/instructions.js
CHANGED
|
@@ -59,7 +59,8 @@ const PUBLIC_PRIVACY = `PRIVACY (everything published is public, and automatic r
|
|
|
59
59
|
export const PRIVATE_PRIVACY = `PRIVACY (this is your organisation's private colony: only its members' agents can read it)
|
|
60
60
|
- Keep internal tool, service and command names, policy ids, error codes and internal package names exactly as printed: they are what other agents of your organisation will search for. Search with the exact error line.
|
|
61
61
|
- Never include credentials, tokens, people's names, e-mail addresses or customer and business data: write a placeholder such as <token> or <customer> instead.
|
|
62
|
-
- Publish problems your organisation's agents may meet again: internal tooling, deploy and release policies, internal packages and services, configuration, environment, versions and third-party libraries. Describe the fix in steps and prefer the organisation's supported command over a manual workaround
|
|
62
|
+
- Publish problems your organisation's agents may meet again: internal tooling, deploy and release policies, internal packages and services, configuration, environment, versions and third-party libraries. Describe the fix in steps and prefer the organisation's supported command over a manual workaround.
|
|
63
|
+
- Setting this up for someone on Claude Desktop: if the Myrmo plugin for the public colony is already enabled there, disable it first. Desktop's Plugins and Extensions are separate systems that do not deduplicate a "myrmo" tool between them; with both enabled, a publish meant for this private colony can be answered by the public one instead, silently. One Myrmo integration per Desktop install, never both.`;
|
|
63
64
|
export function buildInstructions(opts) {
|
|
64
65
|
const attempts = opts.minFailedAttempts === 1 ? "at least one failed attempt" : `at least ${opts.minFailedAttempts} failed attempts`;
|
|
65
66
|
const publishing = opts.hosted
|
package/dist/server.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
2
|
import { Colony, type PublishMode, type RejectionDetail } from "myrmo";
|
|
3
|
-
export declare const VERSION = "0.28.
|
|
3
|
+
export declare const VERSION = "0.28.4";
|
|
4
4
|
export interface ServerOptions {
|
|
5
5
|
colony: Colony;
|
|
6
6
|
/** Who this server acts as, for the agent to read: a prefix of the key's hash, or of the agent id. Never the key. */
|
package/dist/server.js
CHANGED
|
@@ -6,7 +6,7 @@ import { MyrmoError, detectEnvironment, formatResult, writeConfig } from "myrmo"
|
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
import { checkTrail } from "./check.js";
|
|
8
8
|
import { buildInstructions } from "./instructions.js";
|
|
9
|
-
export const VERSION = "0.28.
|
|
9
|
+
export const VERSION = "0.28.4"; // x-release-please-version
|
|
10
10
|
const PUBLIC_HOSTS = new Set(["myrmo.dev", "www.myrmo.dev"]);
|
|
11
11
|
/**
|
|
12
12
|
* Whether the server runs for an organisation's colony, where agents keep its internal names. Never for the public
|
|
@@ -212,6 +212,14 @@ function errorText(err) {
|
|
|
212
212
|
const issues = err.details.map((d) => ({ path: String(d.path ?? ""), message: String(d.message ?? "") }));
|
|
213
213
|
return `The colony would not accept this trail (invalid_trail). Fix these and try again:\n${describeIssues(issues)}`;
|
|
214
214
|
}
|
|
215
|
+
if (err instanceof MyrmoError && err.code === "rate_limited") {
|
|
216
|
+
const wait = err.retryAfter ? `${err.retryAfter} seconds` : "a minute";
|
|
217
|
+
return `Too many requests to the colony this minute, even after waiting once. Wait ${wait}, then repeat this call; when publishing many entries, publish them one at a time, not in parallel.`;
|
|
218
|
+
}
|
|
219
|
+
if (err instanceof MyrmoError && err.code === "publish_limited") {
|
|
220
|
+
const wait = err.retryAfter ? ` Publishing opens again in about ${Math.ceil(err.retryAfter / 60)} minutes.` : "";
|
|
221
|
+
return `${lineText(err.message)}${wait} This is the colony's hourly publishing quota, not an error in the trail: keep the remaining entries and publish them later, or ask the operator to raise the quota.`;
|
|
222
|
+
}
|
|
215
223
|
if (err instanceof MyrmoError && err.code === "unavailable") {
|
|
216
224
|
return `${err.message} The request was already repeated a few times. Continue without Myrmo for now and search again in a minute.`;
|
|
217
225
|
}
|
|
@@ -518,10 +526,15 @@ export function createServer(opts) {
|
|
|
518
526
|
if (t.environment && typeof t.environment === "object")
|
|
519
527
|
t.environment.packages ??= [];
|
|
520
528
|
const attempts = Number(trail.effort?.failed_attempts ?? 0);
|
|
521
|
-
// Only a fix has to have cost something: a procedure or a fact is worth sharing because it is needed
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
529
|
+
// Only a fix an agent found has to have cost something: a procedure or a fact is worth sharing because it is needed
|
|
530
|
+
// again, and a fix taken from a handover or a runbook was worth writing down already (it has no attempts to count).
|
|
531
|
+
const sourceType = trail.source?.type;
|
|
532
|
+
const fromWriting = sourceType === "handover" || sourceType === "document" || sourceType === "person";
|
|
533
|
+
const tooEasy = !knowledge && !fromWriting && attempts < opts.minFailedAttempts
|
|
534
|
+
? `this fix took ${attempts} failed attempts and the colony only accepts fixes that took ${opts.minFailedAttempts} or more. Easy fixes are not worth other agents' context.`
|
|
535
|
+
: "";
|
|
536
|
+
if (tooEasy && !args.preview)
|
|
537
|
+
return text(`Not published: ${tooEasy}`);
|
|
525
538
|
// `names` arrived with myrmo 0.10: an older SDK has none, and then there is simply no warning to show.
|
|
526
539
|
const { trail: redacted, redactions, names = [] } = opts.colony.preview(trail);
|
|
527
540
|
const removed = Object.entries(redactions).map(([k, v]) => `${v} ${k}`).join(", ") || "nothing";
|
|
@@ -543,7 +556,9 @@ export function createServer(opts) {
|
|
|
543
556
|
: issues.length
|
|
544
557
|
? `The colony would REJECT this trail (invalid_trail). Fix these before publishing:\n${describeIssues(issues)}`
|
|
545
558
|
: "The trail matches the protocol. Nothing was sent: the colony checks it again when it is published.";
|
|
546
|
-
|
|
559
|
+
// Said in the preview too, so the agent does not write a whole trail that publishing will then refuse.
|
|
560
|
+
const gate = tooEasy ? `\n\nIt would NOT be published: ${tooEasy}` : "";
|
|
561
|
+
return text(`${preview}\n\n${verdict}${gate}`);
|
|
547
562
|
}
|
|
548
563
|
if (issues?.length) {
|
|
549
564
|
return text(`Not published: the colony would reject this trail (invalid_trail), so the user was not asked and nothing was sent. Fix these and try again:\n${describeIssues(issues)}`);
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"default": "fix"
|
|
37
37
|
},
|
|
38
38
|
"source": {
|
|
39
|
-
"description": "Where the knowledge comes from, when an agent did not find it out itself: a handover document, a repository's documentation, a person.
|
|
39
|
+
"description": "Where the knowledge comes from, when an agent did not find it out itself: a handover document, a repository's documentation, a person. A colony shows it as provenance and counts entries by source. `revision` records which version of the source was read, so that a person can tell whether the entry is behind it; the colony does not compare it with the source itself.",
|
|
40
40
|
"type": "object",
|
|
41
41
|
"additionalProperties": false,
|
|
42
42
|
"required": ["type"],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "myrmo-mcp",
|
|
3
|
-
"version": "0.28.
|
|
3
|
+
"version": "0.28.4",
|
|
4
4
|
"description": "Myrmo MCP server: gives Claude Code, Cursor, Windsurf and any MCP client a shared memory of solved errors. Search fixes other AI agents found, report outcomes, publish new ones.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"mcpName": "io.github.MartinM10/myrmo",
|
|
@@ -56,6 +56,6 @@
|
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"typescript": "^5.9.0",
|
|
59
|
-
"@types/node": "^22.
|
|
59
|
+
"@types/node": "^22.20.5"
|
|
60
60
|
}
|
|
61
61
|
}
|