@rolexjs/mcp-server 0.10.0 → 0.11.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 +17 -16
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
DESC_SOCIETY,
|
|
12
12
|
DESC_DIRECTORY,
|
|
13
13
|
DESC_ORGANIZATION,
|
|
14
|
-
|
|
14
|
+
DESC_SYNTHESIZE,
|
|
15
15
|
DESC_IDENTITY,
|
|
16
16
|
DESC_FOCUS,
|
|
17
17
|
DESC_WANT,
|
|
@@ -254,19 +254,16 @@ ${renderFeatures(features)}`;
|
|
|
254
254
|
})
|
|
255
255
|
});
|
|
256
256
|
server.addTool({
|
|
257
|
-
name: "
|
|
258
|
-
description:
|
|
257
|
+
name: "synthesize",
|
|
258
|
+
description: DESC_SYNTHESIZE,
|
|
259
259
|
parameters: z.object({
|
|
260
|
-
|
|
261
|
-
"Growth dimension: knowledge (what I know), experience (what I've lived), voice (how I'm perceived)"
|
|
262
|
-
),
|
|
263
|
-
name: z.string().describe("Name for this growth (used as filename, e.g. 'distributed-systems')"),
|
|
260
|
+
name: z.string().describe("Name for this experience (used as filename, e.g. 'auth-system-lessons')"),
|
|
264
261
|
source: z.string().describe("Gherkin feature source text")
|
|
265
262
|
}),
|
|
266
|
-
execute: safeTool("
|
|
263
|
+
execute: safeTool("synthesize", async ({ name, source }) => {
|
|
267
264
|
const role = requireRole();
|
|
268
|
-
const feature = role.
|
|
269
|
-
return next(`
|
|
265
|
+
const feature = role.synthesize(name, source);
|
|
266
|
+
return next(`Experience synthesized: ${feature.name}`, NEXT.synthesize);
|
|
270
267
|
})
|
|
271
268
|
});
|
|
272
269
|
server.addTool({
|
|
@@ -353,7 +350,7 @@ server.addTool({
|
|
|
353
350
|
description: DESC_ACHIEVE,
|
|
354
351
|
parameters: z.object({
|
|
355
352
|
experience: z.string().optional().describe(
|
|
356
|
-
"Optional Gherkin feature source capturing what was learned \u2014 auto-saved as experience
|
|
353
|
+
"Optional Gherkin feature source capturing what was learned \u2014 auto-saved as experience synthesis"
|
|
357
354
|
)
|
|
358
355
|
}),
|
|
359
356
|
execute: safeTool("achieve", async ({ experience }) => {
|
|
@@ -368,7 +365,7 @@ server.addTool({
|
|
|
368
365
|
description: DESC_ABANDON,
|
|
369
366
|
parameters: z.object({
|
|
370
367
|
experience: z.string().optional().describe(
|
|
371
|
-
"Optional Gherkin feature source capturing what was learned \u2014 auto-saved as experience
|
|
368
|
+
"Optional Gherkin feature source capturing what was learned \u2014 auto-saved as experience synthesis"
|
|
372
369
|
)
|
|
373
370
|
}),
|
|
374
371
|
execute: safeTool("abandon", async ({ experience }) => {
|
|
@@ -403,14 +400,18 @@ server.addTool({
|
|
|
403
400
|
name: "finish",
|
|
404
401
|
description: DESC_FINISH,
|
|
405
402
|
parameters: z.object({
|
|
406
|
-
name: z.string().describe("Task name to mark as done")
|
|
403
|
+
name: z.string().describe("Task name to mark as done"),
|
|
404
|
+
experience: z.string().optional().describe(
|
|
405
|
+
"Optional Gherkin feature source capturing what was learned \u2014 auto-saved as experience synthesis"
|
|
406
|
+
)
|
|
407
407
|
}),
|
|
408
|
-
execute: safeTool("finish", async ({ name }) => {
|
|
408
|
+
execute: safeTool("finish", async ({ name, experience }) => {
|
|
409
409
|
const role = requireRole();
|
|
410
|
-
role.finish(name);
|
|
410
|
+
role.finish(name, experience);
|
|
411
411
|
const { current } = role.focus();
|
|
412
412
|
const remaining = current ? current.tasks.filter((t) => !t.tags?.some((tag) => tag.name === "@done")).length : -1;
|
|
413
|
-
|
|
413
|
+
const msg = experience ? `Task finished: ${name}. Experience captured.` : `Task finished: ${name}`;
|
|
414
|
+
return next(msg, remaining >= 0 ? nextFinish(remaining) : NEXT.achieve);
|
|
414
415
|
})
|
|
415
416
|
});
|
|
416
417
|
server.start({
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @rolexjs/mcp-server\n *\n * MCP server for Rolex — Role-Driven Development.\n *\n * Three-entity architecture:\n * Role = WHO (identity, goals)\n * Organization = WHERE (structure, nesting)\n * Position = WHAT (duties, boundaries)\n *\n * Tools:\n * society — Admin: born, found, establish, teach\n * organization — Admin: hire, fire, appoint, dismiss\n * directory — Lookup: list all / find by name (all roles)\n * identity — Activate a role\n * growup/focus/want/plan/todo/achieve/abandon/finish — Role lifecycle\n *\n * Usage:\n * rolex-mcp [.rolex-dir]\n */\n\nimport { FastMCP } from \"fastmcp\";\nimport { z } from \"zod\";\nimport {\n Rolex,\n Organization,\n Role,\n Position,\n INSTRUCTIONS,\n DESC_SOCIETY,\n DESC_DIRECTORY,\n DESC_ORGANIZATION,\n DESC_GROWUP,\n DESC_IDENTITY,\n DESC_FOCUS,\n DESC_WANT,\n DESC_PLAN,\n DESC_TODO,\n DESC_ACHIEVE,\n DESC_ABANDON,\n DESC_REFLECT,\n DESC_FINISH,\n renderFeatures,\n renderFeature,\n renderStatusBar,\n renderError,\n next,\n NEXT,\n nextHire,\n nextFinish,\n bootstrap,\n} from \"rolexjs\";\nimport { LocalPlatform } from \"@rolexjs/local-platform\";\n\nimport { join } from \"node:path\";\nimport { homedir } from \"node:os\";\n\nconst DEFAULT_ROLEX_DIR = join(homedir(), \".rolex\");\nconst rolexDir = process.argv[2] || process.env.ROLEX_DIR || DEFAULT_ROLEX_DIR;\nconst platform = new LocalPlatform(rolexDir);\nbootstrap(platform);\nconst rolex = new Rolex(platform);\n\nlet currentRole: Role | null = null;\nlet currentRoleName: string = \"\";\n\nconst server = new FastMCP({\n name: \"Rolex MCP Server\",\n version: \"0.2.0\",\n instructions: INSTRUCTIONS,\n});\n\n// ========== Helpers ==========\n\nfunction requireRole(): Role {\n if (!currentRole) {\n throw new Error(\"No active role. Call identity(roleId) first to activate a role.\");\n }\n return currentRole;\n}\n\nfunction requireNuwa(): string | null {\n if (!currentRole || currentRoleName !== \"nuwa\") {\n const who = currentRoleName || \"none\";\n return `Permission denied. Only nuwa can use this tool. Current role: ${who}`;\n }\n return null;\n}\n\n/**\n * Wrap a tool execute function with unified error handling.\n * Catches errors and renders them as formatted markdown.\n */\nfunction safeTool<T>(\n toolName: string,\n fn: (args: T) => Promise<string>\n): (args: T) => Promise<string> {\n return async (args: T) => {\n try {\n return await fn(args);\n } catch (error) {\n throw new Error(renderError(toolName, error));\n }\n };\n}\n\n// ========== Society (folded) ==========\n\nserver.addTool({\n name: \"society\",\n description: DESC_SOCIETY,\n parameters: z.object({\n operation: z\n .enum([\"born\", \"found\", \"establish\", \"teach\"])\n .describe(\"The society operation to perform\"),\n name: z\n .string()\n .optional()\n .describe(\"Role name (born/teach), organization name (found), or position name (establish)\"),\n source: z\n .string()\n .optional()\n .describe(\n \"Gherkin feature source (born: persona, teach: knowledge, found: org description, establish: position duties)\"\n ),\n parent: z.string().optional().describe(\"Parent organization name (for found with nesting)\"),\n orgName: z.string().optional().describe(\"Organization name (for establish)\"),\n roleId: z.string().optional().describe(\"Target role name for teach operation\"),\n type: z\n .enum([\"knowledge\", \"experience\", \"voice\"])\n .optional()\n .describe(\"Growth dimension for teach operation\"),\n dimensionName: z\n .string()\n .optional()\n .describe(\"Name for the knowledge being taught (e.g. 'distributed-systems')\"),\n }),\n execute: safeTool(\n \"society\",\n async ({ operation, name, source, parent, orgName, roleId, type, dimensionName }) => {\n const denied = requireNuwa();\n if (denied) return denied;\n switch (operation) {\n case \"born\": {\n if (!name || !source) throw new Error(\"born requires: name, source\");\n const feature = rolex.born(name, source);\n return next(`Role born: ${feature.name}`, NEXT.born);\n }\n case \"found\": {\n if (!name) throw new Error(\"found requires: name\");\n rolex.found(name, source, parent);\n return next(`Organization founded: ${name}`, NEXT.found);\n }\n case \"establish\": {\n if (!name || !source || !orgName)\n throw new Error(\"establish requires: name, source, orgName\");\n rolex.establish(name, source, orgName);\n return next(`Position established: ${name} in ${orgName}`, NEXT.establish);\n }\n case \"teach\": {\n if (!roleId || !type || !dimensionName || !source)\n throw new Error(\"teach requires: roleId, type, dimensionName, source\");\n const feature = rolex.teach(roleId, type, dimensionName, source);\n return next(`Taught ${type}: ${feature.name}`, NEXT.teach);\n }\n default:\n throw new Error(`Unknown society operation: ${operation}`);\n }\n }\n ),\n});\n\n// ========== Directory (all roles) ==========\n\nserver.addTool({\n name: \"directory\",\n description: DESC_DIRECTORY,\n parameters: z.object({\n name: z\n .string()\n .optional()\n .describe(\"Role, organization, or position name to look up. If omitted, lists everything.\"),\n }),\n execute: safeTool(\"directory\", async ({ name }) => {\n if (name) {\n const result = rolex.find(name);\n if (result instanceof Organization) {\n const info = result.info();\n const parentStr = info.parent ? ` (parent: ${info.parent})` : \"\";\n return `Organization: ${info.name}${parentStr}\\nMembers: ${info.members.length}\\nPositions: ${info.positions.join(\", \") || \"none\"}`;\n }\n if (result instanceof Position) {\n const info = result.info();\n return `Position: ${info.name} in ${info.org}\\nState: ${info.state}\\nAssigned: ${info.assignedRole || \"none\"}\\nDuties: ${info.duties.length}`;\n }\n const features = (result as Role).identity();\n return renderFeatures(features);\n }\n\n const dir = rolex.directory();\n const lines: string[] = [];\n\n if (dir.organizations.length > 0) {\n for (const org of dir.organizations) {\n const parentStr = org.parent ? ` (parent: ${org.parent})` : \"\";\n lines.push(`Organization: ${org.name}${parentStr}`);\n\n if (org.positions.length > 0) {\n lines.push(\" Positions:\");\n for (const pos of org.positions) {\n const posInfo = platform.getPosition(pos, org.name);\n const holder = posInfo?.assignedRole ? ` ← ${posInfo.assignedRole}` : \" (vacant)\";\n lines.push(` - ${pos}${holder}`);\n }\n }\n\n if (org.members.length > 0) {\n lines.push(\" Members:\");\n for (const member of org.members) {\n const role = dir.roles.find((r) => r.name === member);\n const state = role ? ` [${role.state}]` : \"\";\n const pos = role?.position ? ` → ${role.position}` : \"\";\n lines.push(` - ${member}${state}${pos}`);\n }\n }\n }\n }\n\n const freeRoles = dir.roles.filter((r) => r.state === \"free\");\n if (freeRoles.length > 0) {\n if (lines.length > 0) lines.push(\"\");\n lines.push(\"Free Roles:\");\n for (const role of freeRoles) {\n lines.push(` - ${role.name}`);\n }\n }\n\n return lines.join(\"\\n\") || \"No roles or organizations found.\";\n }),\n});\n\n// ========== Organization (folded) ==========\n\nserver.addTool({\n name: \"organization\",\n description: DESC_ORGANIZATION,\n parameters: z.object({\n operation: z\n .enum([\"hire\", \"fire\", \"appoint\", \"dismiss\"])\n .describe(\"The organization operation to perform\"),\n name: z.string().describe(\"Role name to hire, fire, appoint, or dismiss\"),\n position: z.string().optional().describe(\"Position name (for appoint)\"),\n orgName: z\n .string()\n .optional()\n .describe(\"Target organization name (for hire, required when multiple organizations exist)\"),\n }),\n execute: safeTool(\"organization\", async ({ operation, name, position, orgName: targetOrg }) => {\n const denied = requireNuwa();\n if (denied) return denied;\n // Find the first org, or the org the role belongs to\n const dir = rolex.directory();\n if (dir.organizations.length === 0) {\n throw new Error(\"No organization found. Call found() first.\");\n }\n\n // Resolve target organization\n let orgName: string;\n if (operation === \"hire\") {\n if (targetOrg) {\n orgName = targetOrg;\n } else if (dir.organizations.length === 1) {\n orgName = dir.organizations[0].name;\n } else {\n const orgNames = dir.organizations.map((o) => o.name).join(\", \");\n throw new Error(\n `Multiple organizations exist (${orgNames}). Specify orgName to indicate which one.`\n );\n }\n } else {\n const assignment = platform.getAssignment(name);\n orgName = assignment?.org ?? dir.organizations[0].name;\n }\n\n const org = rolex.find(orgName) as Organization;\n\n switch (operation) {\n case \"hire\": {\n org.hire(name);\n return next(`Role hired: ${name} → ${orgName}`, nextHire(name));\n }\n case \"fire\": {\n org.fire(name);\n return next(`Role fired: ${name}`, NEXT.fire);\n }\n case \"appoint\": {\n if (!position) throw new Error(\"appoint requires: name, position\");\n org.appoint(name, position);\n return next(`Role appointed: ${name} → ${position}`, NEXT.appoint);\n }\n case \"dismiss\": {\n org.dismiss(name);\n return next(`Role dismissed: ${name}`, NEXT.dismiss);\n }\n default:\n throw new Error(`Unknown organization operation: ${operation}`);\n }\n }),\n});\n\n// ========== Role Activation ==========\n\nserver.addTool({\n name: \"identity\",\n description: DESC_IDENTITY,\n parameters: z.object({\n roleId: z.string().describe(\"Role name (e.g. 'sean')\"),\n }),\n execute: safeTool(\"identity\", async ({ roleId }) => {\n currentRole = rolex.role(roleId);\n currentRoleName = roleId;\n const features = currentRole.identity();\n const { current } = currentRole.focus();\n const assignment = platform.getAssignment(roleId);\n const statusBar = renderStatusBar(roleId, current, assignment?.org, assignment?.position);\n return `${statusBar}\\n\\n${renderFeatures(features)}`;\n }),\n});\n\n// ========== Role Tools ==========\n\nserver.addTool({\n name: \"growup\",\n description: DESC_GROWUP,\n parameters: z.object({\n type: z\n .enum([\"knowledge\", \"experience\", \"voice\"])\n .describe(\n \"Growth dimension: knowledge (what I know), experience (what I've lived), voice (how I'm perceived)\"\n ),\n name: z\n .string()\n .describe(\"Name for this growth (used as filename, e.g. 'distributed-systems')\"),\n source: z.string().describe(\"Gherkin feature source text\"),\n }),\n execute: safeTool(\"growup\", async ({ type, name, source }) => {\n const role = requireRole();\n const feature = role.growup(type, name, source);\n return next(`Growth added (${type}): ${feature.name}`, NEXT.growup);\n }),\n});\n\nserver.addTool({\n name: \"focus\",\n description: DESC_FOCUS,\n parameters: z.object({\n name: z.string().optional().describe(\"Optional goal name to switch focus to\"),\n }),\n execute: safeTool(\"focus\", async ({ name }) => {\n const role = requireRole();\n const { current, otherGoals } = role.focus(name);\n\n const assignment = platform.getAssignment(currentRoleName);\n const statusBar = renderStatusBar(\n currentRoleName,\n current,\n assignment?.org,\n assignment?.position\n );\n\n if (!current && otherGoals.length === 0)\n return `${statusBar}\\n\\nNo active goal. Use want() to set a new goal.`;\n\n const parts: string[] = [statusBar];\n\n if (current) {\n parts.push(renderFeature(current));\n if (current.plan) {\n parts.push(renderFeature(current.plan));\n }\n for (const task of current.tasks) {\n parts.push(renderFeature(task));\n }\n }\n\n if (otherGoals.length > 0) {\n parts.push(\"Other active goals:\");\n for (const g of otherGoals) {\n parts.push(` - ${g.name}`);\n }\n }\n\n return parts.join(\"\\n\\n\");\n }),\n});\n\nserver.addTool({\n name: \"want\",\n description: DESC_WANT,\n parameters: z.object({\n name: z.string().describe(\"Goal name (used as directory name, e.g. 'local-platform')\"),\n source: z.string().describe(\"Gherkin feature source text for the goal\"),\n testable: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"Whether this goal's scenarios should become persistent automated verification\"),\n }),\n execute: safeTool(\"want\", async ({ name, source, testable }) => {\n const role = requireRole();\n const goal = role.want(name, source, testable);\n return next(`Goal created: ${goal.name}`, NEXT.want);\n }),\n});\n\nserver.addTool({\n name: \"plan\",\n description: DESC_PLAN,\n parameters: z.object({\n source: z.string().describe(\"Gherkin feature source text for the plan\"),\n }),\n execute: safeTool(\"plan\", async ({ source }) => {\n const role = requireRole();\n const p = role.plan(source);\n return next(`Plan created: ${p.name}`, NEXT.plan);\n }),\n});\n\nserver.addTool({\n name: \"todo\",\n description: DESC_TODO,\n parameters: z.object({\n name: z.string().describe(\"Task name (used as filename, e.g. 'implement-loader')\"),\n source: z.string().describe(\"Gherkin feature source text for the task\"),\n testable: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"Whether this task's scenarios should become unit or integration tests\"),\n }),\n execute: safeTool(\"todo\", async ({ name, source, testable }) => {\n const role = requireRole();\n const task = role.todo(name, source, testable);\n return next(`Task created: ${task.name}`, NEXT.todo);\n }),\n});\n\nserver.addTool({\n name: \"achieve\",\n description: DESC_ACHIEVE,\n parameters: z.object({\n experience: z\n .string()\n .optional()\n .describe(\n \"Optional Gherkin feature source capturing what was learned — auto-saved as experience growup\"\n ),\n }),\n execute: safeTool(\"achieve\", async ({ experience }) => {\n const role = requireRole();\n role.achieve(experience);\n const msg = experience ? \"Goal achieved. Experience captured.\" : \"Goal achieved.\";\n return next(msg, NEXT.achieve);\n }),\n});\n\nserver.addTool({\n name: \"abandon\",\n description: DESC_ABANDON,\n parameters: z.object({\n experience: z\n .string()\n .optional()\n .describe(\n \"Optional Gherkin feature source capturing what was learned — auto-saved as experience growup\"\n ),\n }),\n execute: safeTool(\"abandon\", async ({ experience }) => {\n const role = requireRole();\n role.abandon(experience);\n const msg = experience ? \"Goal abandoned. Experience captured.\" : \"Goal abandoned.\";\n return next(msg, NEXT.abandon);\n }),\n});\n\nserver.addTool({\n name: \"reflect\",\n description: DESC_REFLECT,\n parameters: z.object({\n experienceNames: z\n .array(z.string())\n .describe(\n \"Names of experience files to distill (without .experience.identity.feature suffix)\"\n ),\n knowledgeName: z\n .string()\n .describe(\n \"Name for the resulting knowledge (used as filename, e.g. 'authentication-principles')\"\n ),\n knowledgeSource: z.string().describe(\"Gherkin feature source text for the knowledge\"),\n }),\n execute: safeTool(\"reflect\", async ({ experienceNames, knowledgeName, knowledgeSource }) => {\n const role = requireRole();\n const feature = role.reflect(experienceNames, knowledgeName, knowledgeSource);\n return next(\n `Reflected: ${experienceNames.length} experience(s) → knowledge \"${feature.name}\"`,\n NEXT.reflect\n );\n }),\n});\n\nserver.addTool({\n name: \"finish\",\n description: DESC_FINISH,\n parameters: z.object({\n name: z.string().describe(\"Task name to mark as done\"),\n }),\n execute: safeTool(\"finish\", async ({ name }) => {\n const role = requireRole();\n role.finish(name);\n\n // Dynamic hint: check remaining tasks\n const { current } = role.focus();\n const remaining = current\n ? current.tasks.filter((t) => !t.tags?.some((tag) => tag.name === \"@done\")).length\n : -1;\n return next(`Task finished: ${name}`, remaining >= 0 ? nextFinish(remaining) : NEXT.achieve);\n }),\n});\n\nserver.start({\n transportType: \"stdio\",\n});\n"],"mappings":";;;AAqBA,SAAS,eAAe;AACxB,SAAS,SAAS;AAClB;AAAA,EACE;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AA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ACH,CAAC;AAED,OAAO,QAAQ;AAAA,EACb,MAAM;AAAA,EACN,aAAa;AAAA,EACb,YAAY,EAAE,OAAO;AAAA,IACnB,MAAM,EAAE,OAAO,EAAE,SAAS,2BAA2B;AAAA,EACvD,CAAC;AAAA,EACD,SAAS,SAAS,UAAU,OAAO,EAAE,KAAK,MAAM;AAC9C,UAAM,OAAO,YAAY;AACzB,SAAK,OAAO,IAAI;AAGhB,UAAM,EAAE,QAAQ,IAAI,KAAK,MAAM;AAC/B,UAAM,YAAY,UACd,QAAQ,MAAM,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,CAAC,QAAQ,IAAI,SAAS,OAAO,CAAC,EAAE,SAC1E;AACJ,WAAO,KAAK,kBAAkB,IAAI,IAAI,aAAa,IAAI,WAAW,SAAS,IAAI,KAAK,OAAO;AAAA,EAC7F,CAAC;AACH,CAAC;AAED,OAAO,MAAM;AAAA,EACX,eAAe;AACjB,CAAC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @rolexjs/mcp-server\n *\n * MCP server for Rolex — Role-Driven Development.\n *\n * Three-entity architecture:\n * Role = WHO (identity, goals)\n * Organization = WHERE (structure, nesting)\n * Position = WHAT (duties, boundaries)\n *\n * Tools:\n * society — Admin: born, found, establish, teach\n * organization — Admin: hire, fire, appoint, dismiss\n * directory — Lookup: list all / find by name (all roles)\n * identity — Activate a role\n * synthesize/focus/want/plan/todo/achieve/abandon/finish — Role lifecycle\n *\n * Usage:\n * rolex-mcp [.rolex-dir]\n */\n\nimport { FastMCP } from \"fastmcp\";\nimport { z } from \"zod\";\nimport {\n Rolex,\n Organization,\n Role,\n Position,\n INSTRUCTIONS,\n DESC_SOCIETY,\n DESC_DIRECTORY,\n DESC_ORGANIZATION,\n DESC_SYNTHESIZE,\n DESC_IDENTITY,\n DESC_FOCUS,\n DESC_WANT,\n DESC_PLAN,\n DESC_TODO,\n DESC_ACHIEVE,\n DESC_ABANDON,\n DESC_REFLECT,\n DESC_FINISH,\n renderFeatures,\n renderFeature,\n renderStatusBar,\n renderError,\n next,\n NEXT,\n nextHire,\n nextFinish,\n bootstrap,\n} from \"rolexjs\";\nimport { LocalPlatform } from \"@rolexjs/local-platform\";\n\nimport { join } from \"node:path\";\nimport { homedir } from \"node:os\";\n\nconst DEFAULT_ROLEX_DIR = join(homedir(), \".rolex\");\nconst rolexDir = process.argv[2] || process.env.ROLEX_DIR || DEFAULT_ROLEX_DIR;\nconst platform = new LocalPlatform(rolexDir);\nbootstrap(platform);\nconst rolex = new Rolex(platform);\n\nlet currentRole: Role | null = null;\nlet currentRoleName: string = \"\";\n\nconst server = new FastMCP({\n name: \"Rolex MCP Server\",\n version: \"0.2.0\",\n instructions: INSTRUCTIONS,\n});\n\n// ========== Helpers ==========\n\nfunction requireRole(): Role {\n if (!currentRole) {\n throw new Error(\"No active role. Call identity(roleId) first to activate a role.\");\n }\n return currentRole;\n}\n\nfunction requireNuwa(): string | null {\n if (!currentRole || currentRoleName !== \"nuwa\") {\n const who = currentRoleName || \"none\";\n return `Permission denied. Only nuwa can use this tool. Current role: ${who}`;\n }\n return null;\n}\n\n/**\n * Wrap a tool execute function with unified error handling.\n * Catches errors and renders them as formatted markdown.\n */\nfunction safeTool<T>(\n toolName: string,\n fn: (args: T) => Promise<string>\n): (args: T) => Promise<string> {\n return async (args: T) => {\n try {\n return await fn(args);\n } catch (error) {\n throw new Error(renderError(toolName, error));\n }\n };\n}\n\n// ========== Society (folded) ==========\n\nserver.addTool({\n name: \"society\",\n description: DESC_SOCIETY,\n parameters: z.object({\n operation: z\n .enum([\"born\", \"found\", \"establish\", \"teach\"])\n .describe(\"The society operation to perform\"),\n name: z\n .string()\n .optional()\n .describe(\"Role name (born/teach), organization name (found), or position name (establish)\"),\n source: z\n .string()\n .optional()\n .describe(\n \"Gherkin feature source (born: persona, teach: knowledge, found: org description, establish: position duties)\"\n ),\n parent: z.string().optional().describe(\"Parent organization name (for found with nesting)\"),\n orgName: z.string().optional().describe(\"Organization name (for establish)\"),\n roleId: z.string().optional().describe(\"Target role name for teach operation\"),\n type: z\n .enum([\"knowledge\", \"experience\", \"voice\"])\n .optional()\n .describe(\"Growth dimension for teach operation\"),\n dimensionName: z\n .string()\n .optional()\n .describe(\"Name for the knowledge being taught (e.g. 'distributed-systems')\"),\n }),\n execute: safeTool(\n \"society\",\n async ({ operation, name, source, parent, orgName, roleId, type, dimensionName }) => {\n const denied = requireNuwa();\n if (denied) return denied;\n switch (operation) {\n case \"born\": {\n if (!name || !source) throw new Error(\"born requires: name, source\");\n const feature = rolex.born(name, source);\n return next(`Role born: ${feature.name}`, NEXT.born);\n }\n case \"found\": {\n if (!name) throw new Error(\"found requires: name\");\n rolex.found(name, source, parent);\n return next(`Organization founded: ${name}`, NEXT.found);\n }\n case \"establish\": {\n if (!name || !source || !orgName)\n throw new Error(\"establish requires: name, source, orgName\");\n rolex.establish(name, source, orgName);\n return next(`Position established: ${name} in ${orgName}`, NEXT.establish);\n }\n case \"teach\": {\n if (!roleId || !type || !dimensionName || !source)\n throw new Error(\"teach requires: roleId, type, dimensionName, source\");\n const feature = rolex.teach(roleId, type, dimensionName, source);\n return next(`Taught ${type}: ${feature.name}`, NEXT.teach);\n }\n default:\n throw new Error(`Unknown society operation: ${operation}`);\n }\n }\n ),\n});\n\n// ========== Directory (all roles) ==========\n\nserver.addTool({\n name: \"directory\",\n description: DESC_DIRECTORY,\n parameters: z.object({\n name: z\n .string()\n .optional()\n .describe(\"Role, organization, or position name to look up. If omitted, lists everything.\"),\n }),\n execute: safeTool(\"directory\", async ({ name }) => {\n if (name) {\n const result = rolex.find(name);\n if (result instanceof Organization) {\n const info = result.info();\n const parentStr = info.parent ? ` (parent: ${info.parent})` : \"\";\n return `Organization: ${info.name}${parentStr}\\nMembers: ${info.members.length}\\nPositions: ${info.positions.join(\", \") || \"none\"}`;\n }\n if (result instanceof Position) {\n const info = result.info();\n return `Position: ${info.name} in ${info.org}\\nState: ${info.state}\\nAssigned: ${info.assignedRole || \"none\"}\\nDuties: ${info.duties.length}`;\n }\n const features = (result as Role).identity();\n return renderFeatures(features);\n }\n\n const dir = rolex.directory();\n const lines: string[] = [];\n\n if (dir.organizations.length > 0) {\n for (const org of dir.organizations) {\n const parentStr = org.parent ? ` (parent: ${org.parent})` : \"\";\n lines.push(`Organization: ${org.name}${parentStr}`);\n\n if (org.positions.length > 0) {\n lines.push(\" Positions:\");\n for (const pos of org.positions) {\n const posInfo = platform.getPosition(pos, org.name);\n const holder = posInfo?.assignedRole ? ` ← ${posInfo.assignedRole}` : \" (vacant)\";\n lines.push(` - ${pos}${holder}`);\n }\n }\n\n if (org.members.length > 0) {\n lines.push(\" Members:\");\n for (const member of org.members) {\n const role = dir.roles.find((r) => r.name === member);\n const state = role ? ` [${role.state}]` : \"\";\n const pos = role?.position ? ` → ${role.position}` : \"\";\n lines.push(` - ${member}${state}${pos}`);\n }\n }\n }\n }\n\n const freeRoles = dir.roles.filter((r) => r.state === \"free\");\n if (freeRoles.length > 0) {\n if (lines.length > 0) lines.push(\"\");\n lines.push(\"Free Roles:\");\n for (const role of freeRoles) {\n lines.push(` - ${role.name}`);\n }\n }\n\n return lines.join(\"\\n\") || \"No roles or organizations found.\";\n }),\n});\n\n// ========== Organization (folded) ==========\n\nserver.addTool({\n name: \"organization\",\n description: DESC_ORGANIZATION,\n parameters: z.object({\n operation: z\n .enum([\"hire\", \"fire\", \"appoint\", \"dismiss\"])\n .describe(\"The organization operation to perform\"),\n name: z.string().describe(\"Role name to hire, fire, appoint, or dismiss\"),\n position: z.string().optional().describe(\"Position name (for appoint)\"),\n orgName: z\n .string()\n .optional()\n .describe(\"Target organization name (for hire, required when multiple organizations exist)\"),\n }),\n execute: safeTool(\"organization\", async ({ operation, name, position, orgName: targetOrg }) => {\n const denied = requireNuwa();\n if (denied) return denied;\n // Find the first org, or the org the role belongs to\n const dir = rolex.directory();\n if (dir.organizations.length === 0) {\n throw new Error(\"No organization found. Call found() first.\");\n }\n\n // Resolve target organization\n let orgName: string;\n if (operation === \"hire\") {\n if (targetOrg) {\n orgName = targetOrg;\n } else if (dir.organizations.length === 1) {\n orgName = dir.organizations[0].name;\n } else {\n const orgNames = dir.organizations.map((o) => o.name).join(\", \");\n throw new Error(\n `Multiple organizations exist (${orgNames}). Specify orgName to indicate which one.`\n );\n }\n } else {\n const assignment = platform.getAssignment(name);\n orgName = assignment?.org ?? dir.organizations[0].name;\n }\n\n const org = rolex.find(orgName) as Organization;\n\n switch (operation) {\n case \"hire\": {\n org.hire(name);\n return next(`Role hired: ${name} → ${orgName}`, nextHire(name));\n }\n case \"fire\": {\n org.fire(name);\n return next(`Role fired: ${name}`, NEXT.fire);\n }\n case \"appoint\": {\n if (!position) throw new Error(\"appoint requires: name, position\");\n org.appoint(name, position);\n return next(`Role appointed: ${name} → ${position}`, NEXT.appoint);\n }\n case \"dismiss\": {\n org.dismiss(name);\n return next(`Role dismissed: ${name}`, NEXT.dismiss);\n }\n default:\n throw new Error(`Unknown organization operation: ${operation}`);\n }\n }),\n});\n\n// ========== Role Activation ==========\n\nserver.addTool({\n name: \"identity\",\n description: DESC_IDENTITY,\n parameters: z.object({\n roleId: z.string().describe(\"Role name (e.g. 'sean')\"),\n }),\n execute: safeTool(\"identity\", async ({ roleId }) => {\n currentRole = rolex.role(roleId);\n currentRoleName = roleId;\n const features = currentRole.identity();\n const { current } = currentRole.focus();\n const assignment = platform.getAssignment(roleId);\n const statusBar = renderStatusBar(roleId, current, assignment?.org, assignment?.position);\n return `${statusBar}\\n\\n${renderFeatures(features)}`;\n }),\n});\n\n// ========== Role Tools ==========\n\nserver.addTool({\n name: \"synthesize\",\n description: DESC_SYNTHESIZE,\n parameters: z.object({\n name: z\n .string()\n .describe(\"Name for this experience (used as filename, e.g. 'auth-system-lessons')\"),\n source: z.string().describe(\"Gherkin feature source text\"),\n }),\n execute: safeTool(\"synthesize\", async ({ name, source }) => {\n const role = requireRole();\n const feature = role.synthesize(name, source);\n return next(`Experience synthesized: ${feature.name}`, NEXT.synthesize);\n }),\n});\n\nserver.addTool({\n name: \"focus\",\n description: DESC_FOCUS,\n parameters: z.object({\n name: z.string().optional().describe(\"Optional goal name to switch focus to\"),\n }),\n execute: safeTool(\"focus\", async ({ name }) => {\n const role = requireRole();\n const { current, otherGoals } = role.focus(name);\n\n const assignment = platform.getAssignment(currentRoleName);\n const statusBar = renderStatusBar(\n currentRoleName,\n current,\n assignment?.org,\n assignment?.position\n );\n\n if (!current && otherGoals.length === 0)\n return `${statusBar}\\n\\nNo active goal. Use want() to set a new goal.`;\n\n const parts: string[] = [statusBar];\n\n if (current) {\n parts.push(renderFeature(current));\n if (current.plan) {\n parts.push(renderFeature(current.plan));\n }\n for (const task of current.tasks) {\n parts.push(renderFeature(task));\n }\n }\n\n if (otherGoals.length > 0) {\n parts.push(\"Other active goals:\");\n for (const g of otherGoals) {\n parts.push(` - ${g.name}`);\n }\n }\n\n return parts.join(\"\\n\\n\");\n }),\n});\n\nserver.addTool({\n name: \"want\",\n description: DESC_WANT,\n parameters: z.object({\n name: z.string().describe(\"Goal name (used as directory name, e.g. 'local-platform')\"),\n source: z.string().describe(\"Gherkin feature source text for the goal\"),\n testable: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"Whether this goal's scenarios should become persistent automated verification\"),\n }),\n execute: safeTool(\"want\", async ({ name, source, testable }) => {\n const role = requireRole();\n const goal = role.want(name, source, testable);\n return next(`Goal created: ${goal.name}`, NEXT.want);\n }),\n});\n\nserver.addTool({\n name: \"plan\",\n description: DESC_PLAN,\n parameters: z.object({\n source: z.string().describe(\"Gherkin feature source text for the plan\"),\n }),\n execute: safeTool(\"plan\", async ({ source }) => {\n const role = requireRole();\n const p = role.plan(source);\n return next(`Plan created: ${p.name}`, NEXT.plan);\n }),\n});\n\nserver.addTool({\n name: \"todo\",\n description: DESC_TODO,\n parameters: z.object({\n name: z.string().describe(\"Task name (used as filename, e.g. 'implement-loader')\"),\n source: z.string().describe(\"Gherkin feature source text for the task\"),\n testable: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"Whether this task's scenarios should become unit or integration tests\"),\n }),\n execute: safeTool(\"todo\", async ({ name, source, testable }) => {\n const role = requireRole();\n const task = role.todo(name, source, testable);\n return next(`Task created: ${task.name}`, NEXT.todo);\n }),\n});\n\nserver.addTool({\n name: \"achieve\",\n description: DESC_ACHIEVE,\n parameters: z.object({\n experience: z\n .string()\n .optional()\n .describe(\n \"Optional Gherkin feature source capturing what was learned — auto-saved as experience synthesis\"\n ),\n }),\n execute: safeTool(\"achieve\", async ({ experience }) => {\n const role = requireRole();\n role.achieve(experience);\n const msg = experience ? \"Goal achieved. Experience captured.\" : \"Goal achieved.\";\n return next(msg, NEXT.achieve);\n }),\n});\n\nserver.addTool({\n name: \"abandon\",\n description: DESC_ABANDON,\n parameters: z.object({\n experience: z\n .string()\n .optional()\n .describe(\n \"Optional Gherkin feature source capturing what was learned — auto-saved as experience synthesis\"\n ),\n }),\n execute: safeTool(\"abandon\", async ({ experience }) => {\n const role = requireRole();\n role.abandon(experience);\n const msg = experience ? \"Goal abandoned. Experience captured.\" : \"Goal abandoned.\";\n return next(msg, NEXT.abandon);\n }),\n});\n\nserver.addTool({\n name: \"reflect\",\n description: DESC_REFLECT,\n parameters: z.object({\n experienceNames: z\n .array(z.string())\n .describe(\n \"Names of experience files to distill (without .experience.identity.feature suffix)\"\n ),\n knowledgeName: z\n .string()\n .describe(\n \"Name for the resulting knowledge (used as filename, e.g. 'authentication-principles')\"\n ),\n knowledgeSource: z.string().describe(\"Gherkin feature source text for the knowledge\"),\n }),\n execute: safeTool(\"reflect\", async ({ experienceNames, knowledgeName, knowledgeSource }) => {\n const role = requireRole();\n const feature = role.reflect(experienceNames, knowledgeName, knowledgeSource);\n return next(\n `Reflected: ${experienceNames.length} experience(s) → knowledge \"${feature.name}\"`,\n NEXT.reflect\n );\n }),\n});\n\nserver.addTool({\n name: \"finish\",\n description: DESC_FINISH,\n parameters: z.object({\n name: z.string().describe(\"Task name to mark as done\"),\n experience: z\n .string()\n .optional()\n .describe(\n \"Optional Gherkin feature source capturing what was learned — auto-saved as experience synthesis\"\n ),\n }),\n execute: safeTool(\"finish\", async ({ name, experience }) => {\n const role = requireRole();\n role.finish(name, experience);\n\n // Dynamic hint: check remaining tasks\n const { current } = role.focus();\n const remaining = current\n ? current.tasks.filter((t) => !t.tags?.some((tag) => tag.name === \"@done\")).length\n : -1;\n const msg = experience\n ? `Task finished: ${name}. Experience captured.`\n : `Task finished: ${name}`;\n return next(msg, remaining >= 0 ? nextFinish(remaining) : NEXT.achieve);\n }),\n});\n\nserver.start({\n transportType: \"stdio\",\n});\n"],"mappings":";;;AAqBA,SAAS,eAAe;AACxB,SAAS,SAAS;AAClB;AAAA,EACE;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,qBAAqB;AAE9B,SAAS,YAAY;AACrB,SAAS,eAAe;AAExB,IAAM,oBAAoB,KAAK,QAAQ,GAAG,QAAQ;AAClD,IAAM,WAAW,QAAQ,KAAK,CAAC,KAAK,QAAQ,IAAI,aAAa;AAC7D,IAAM,WAAW,IAAI,cAAc,QAAQ;AAC3C,UAAU,QAAQ;AAClB,IAAM,QAAQ,IAAI,MAAM,QAAQ;AAEhC,IAAI,cAA2B;AAC/B,IAAI,kBAA0B;AAE9B,IAAM,SAAS,IAAI,QAAQ;AAAA,EACzB,MAAM;AAAA,EACN,SAAS;AAAA,EACT,cAAc;AAChB,CAAC;AAID,SAAS,cAAoB;AAC3B,MAAI,CAAC,aAAa;AAChB,UAAM,IAAI,MAAM,iEAAiE;AAAA,E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e;AACjB,CAAC;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rolexjs/mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "MCP server for Rolex — expose RDD role management as MCP tools",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rolex",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"clean": "rm -rf dist"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"rolexjs": "^0.
|
|
45
|
-
"@rolexjs/local-platform": "^0.
|
|
44
|
+
"rolexjs": "^0.11.0",
|
|
45
|
+
"@rolexjs/local-platform": "^0.11.0",
|
|
46
46
|
"fastmcp": "^3.0.0",
|
|
47
47
|
"zod": "^3.25.0"
|
|
48
48
|
},
|