@rolexjs/mcp-server 0.8.0 → 0.9.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/index.js +142 -58
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import { z } from "zod";
|
|
|
6
6
|
import {
|
|
7
7
|
Rolex,
|
|
8
8
|
Organization,
|
|
9
|
+
Position,
|
|
9
10
|
INSTRUCTIONS,
|
|
10
11
|
DESC_SOCIETY,
|
|
11
12
|
DESC_ORGANIZATION,
|
|
@@ -41,7 +42,7 @@ var currentRole = null;
|
|
|
41
42
|
var currentRoleName = "";
|
|
42
43
|
var server = new FastMCP({
|
|
43
44
|
name: "Rolex MCP Server",
|
|
44
|
-
version: "0.
|
|
45
|
+
version: "0.2.0",
|
|
45
46
|
instructions: INSTRUCTIONS
|
|
46
47
|
});
|
|
47
48
|
function requireRole() {
|
|
@@ -50,6 +51,13 @@ function requireRole() {
|
|
|
50
51
|
}
|
|
51
52
|
return currentRole;
|
|
52
53
|
}
|
|
54
|
+
function requireNuwa() {
|
|
55
|
+
if (!currentRole || currentRoleName !== "nuwa") {
|
|
56
|
+
const who = currentRoleName || "none";
|
|
57
|
+
return `Permission denied. Only nuwa can use this tool. Current role: ${who}`;
|
|
58
|
+
}
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
53
61
|
function safeTool(toolName, fn) {
|
|
54
62
|
return async (args) => {
|
|
55
63
|
try {
|
|
@@ -63,91 +71,160 @@ server.addTool({
|
|
|
63
71
|
name: "society",
|
|
64
72
|
description: DESC_SOCIETY,
|
|
65
73
|
parameters: z.object({
|
|
66
|
-
operation: z.enum(["born", "found", "directory", "find", "teach"]).describe("The society operation to perform"),
|
|
67
|
-
name: z.string().optional().describe(
|
|
68
|
-
|
|
74
|
+
operation: z.enum(["born", "found", "establish", "directory", "find", "teach"]).describe("The society operation to perform"),
|
|
75
|
+
name: z.string().optional().describe(
|
|
76
|
+
"Role name (born/find/teach), organization name (found), or position name (establish)"
|
|
77
|
+
),
|
|
78
|
+
source: z.string().optional().describe(
|
|
79
|
+
"Gherkin feature source (born: persona, teach: knowledge, found: org description, establish: position duties)"
|
|
80
|
+
),
|
|
81
|
+
parent: z.string().optional().describe("Parent organization name (for found with nesting)"),
|
|
82
|
+
orgName: z.string().optional().describe("Organization name (for establish)"),
|
|
69
83
|
roleId: z.string().optional().describe("Target role name for teach operation"),
|
|
70
84
|
type: z.enum(["knowledge", "experience", "voice"]).optional().describe("Growth dimension for teach operation"),
|
|
71
85
|
dimensionName: z.string().optional().describe("Name for the knowledge being taught (e.g. 'distributed-systems')")
|
|
72
86
|
}),
|
|
73
|
-
execute: safeTool(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
87
|
+
execute: safeTool(
|
|
88
|
+
"society",
|
|
89
|
+
async ({ operation, name, source, parent, orgName, roleId, type, dimensionName }) => {
|
|
90
|
+
const denied = requireNuwa();
|
|
91
|
+
if (denied) return denied;
|
|
92
|
+
switch (operation) {
|
|
93
|
+
case "born": {
|
|
94
|
+
if (!name || !source) throw new Error("born requires: name, source");
|
|
95
|
+
const feature = rolex.born(name, source);
|
|
96
|
+
return next(`Role born: ${feature.name}`, NEXT.born);
|
|
97
|
+
}
|
|
98
|
+
case "found": {
|
|
99
|
+
if (!name) throw new Error("found requires: name");
|
|
100
|
+
rolex.found(name, source, parent);
|
|
101
|
+
return next(`Organization founded: ${name}`, NEXT.found);
|
|
102
|
+
}
|
|
103
|
+
case "establish": {
|
|
104
|
+
if (!name || !source || !orgName)
|
|
105
|
+
throw new Error("establish requires: name, source, orgName");
|
|
106
|
+
rolex.establish(name, source, orgName);
|
|
107
|
+
return next(`Position established: ${name} in ${orgName}`, NEXT.establish);
|
|
108
|
+
}
|
|
109
|
+
case "directory": {
|
|
110
|
+
const dir = rolex.directory();
|
|
111
|
+
const lines = [];
|
|
112
|
+
if (dir.organizations.length > 0) {
|
|
113
|
+
for (const org of dir.organizations) {
|
|
114
|
+
const parentStr = org.parent ? ` (parent: ${org.parent})` : "";
|
|
115
|
+
lines.push(`Organization: ${org.name}${parentStr}`);
|
|
116
|
+
if (org.positions.length > 0) {
|
|
117
|
+
lines.push(" Positions:");
|
|
118
|
+
for (const pos of org.positions) {
|
|
119
|
+
const posInfo = platform.getPosition(pos, org.name);
|
|
120
|
+
const holder = posInfo?.assignedRole ? ` \u2190 ${posInfo.assignedRole}` : " (vacant)";
|
|
121
|
+
lines.push(` - ${pos}${holder}`);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
if (org.members.length > 0) {
|
|
125
|
+
lines.push(" Members:");
|
|
126
|
+
for (const member of org.members) {
|
|
127
|
+
const role = dir.roles.find((r) => r.name === member);
|
|
128
|
+
const state = role ? ` [${role.state}]` : "";
|
|
129
|
+
const pos = role?.position ? ` \u2192 ${role.position}` : "";
|
|
130
|
+
lines.push(` - ${member}${state}${pos}`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
const freeRoles = dir.roles.filter((r) => r.state === "free");
|
|
136
|
+
if (freeRoles.length > 0) {
|
|
137
|
+
if (lines.length > 0) lines.push("");
|
|
138
|
+
lines.push("Free Roles:");
|
|
139
|
+
for (const role of freeRoles) {
|
|
140
|
+
lines.push(` - ${role.name}`);
|
|
95
141
|
}
|
|
96
142
|
}
|
|
143
|
+
return lines.join("\n") || "No roles or organizations found.";
|
|
97
144
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
145
|
+
case "find": {
|
|
146
|
+
if (!name) throw new Error("find requires: name");
|
|
147
|
+
const result = rolex.find(name);
|
|
148
|
+
if (result instanceof Organization) {
|
|
149
|
+
const info = result.info();
|
|
150
|
+
const parentStr = info.parent ? ` (parent: ${info.parent})` : "";
|
|
151
|
+
return `Organization: ${info.name}${parentStr}
|
|
152
|
+
Members: ${info.members.length}
|
|
153
|
+
Positions: ${info.positions.join(", ") || "none"}`;
|
|
154
|
+
}
|
|
155
|
+
if (result instanceof Position) {
|
|
156
|
+
const info = result.info();
|
|
157
|
+
return `Position: ${info.name} in ${info.org}
|
|
158
|
+
State: ${info.state}
|
|
159
|
+
Assigned: ${info.assignedRole || "none"}
|
|
160
|
+
Duties: ${info.duties.length}`;
|
|
104
161
|
}
|
|
162
|
+
const features = result.identity();
|
|
163
|
+
return renderFeatures(features);
|
|
105
164
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
if (result instanceof Organization) {
|
|
112
|
-
const info = result.info();
|
|
113
|
-
return `Organization: ${info.name} (${info.roles.length} roles)`;
|
|
165
|
+
case "teach": {
|
|
166
|
+
if (!roleId || !type || !dimensionName || !source)
|
|
167
|
+
throw new Error("teach requires: roleId, type, dimensionName, source");
|
|
168
|
+
const feature = rolex.teach(roleId, type, dimensionName, source);
|
|
169
|
+
return next(`Taught ${type}: ${feature.name}`, NEXT.teach);
|
|
114
170
|
}
|
|
115
|
-
|
|
116
|
-
|
|
171
|
+
default:
|
|
172
|
+
throw new Error(`Unknown society operation: ${operation}`);
|
|
117
173
|
}
|
|
118
|
-
case "teach": {
|
|
119
|
-
if (!roleId || !type || !dimensionName || !source)
|
|
120
|
-
throw new Error("teach requires: roleId, type, dimensionName, source");
|
|
121
|
-
const feature = rolex.teach(roleId, type, dimensionName, source);
|
|
122
|
-
return next(`Taught ${type}: ${feature.name}`, NEXT.teach);
|
|
123
|
-
}
|
|
124
|
-
default:
|
|
125
|
-
throw new Error(`Unknown society operation: ${operation}`);
|
|
126
174
|
}
|
|
127
|
-
|
|
175
|
+
)
|
|
128
176
|
});
|
|
129
177
|
server.addTool({
|
|
130
178
|
name: "organization",
|
|
131
179
|
description: DESC_ORGANIZATION,
|
|
132
180
|
parameters: z.object({
|
|
133
|
-
operation: z.enum(["hire", "fire"]).describe("The organization operation to perform"),
|
|
134
|
-
name: z.string().describe("Role name to hire or
|
|
181
|
+
operation: z.enum(["hire", "fire", "appoint", "dismiss"]).describe("The organization operation to perform"),
|
|
182
|
+
name: z.string().describe("Role name to hire, fire, appoint, or dismiss"),
|
|
183
|
+
position: z.string().optional().describe("Position name (for appoint)"),
|
|
184
|
+
orgName: z.string().optional().describe("Target organization name (for hire, required when multiple organizations exist)")
|
|
135
185
|
}),
|
|
136
|
-
execute: safeTool("organization", async ({ operation, name }) => {
|
|
186
|
+
execute: safeTool("organization", async ({ operation, name, position, orgName: targetOrg }) => {
|
|
187
|
+
const denied = requireNuwa();
|
|
188
|
+
if (denied) return denied;
|
|
137
189
|
const dir = rolex.directory();
|
|
138
190
|
if (dir.organizations.length === 0) {
|
|
139
191
|
throw new Error("No organization found. Call found() first.");
|
|
140
192
|
}
|
|
141
|
-
|
|
193
|
+
let orgName;
|
|
194
|
+
if (operation === "hire") {
|
|
195
|
+
if (targetOrg) {
|
|
196
|
+
orgName = targetOrg;
|
|
197
|
+
} else if (dir.organizations.length === 1) {
|
|
198
|
+
orgName = dir.organizations[0].name;
|
|
199
|
+
} else {
|
|
200
|
+
const orgNames = dir.organizations.map((o) => o.name).join(", ");
|
|
201
|
+
throw new Error(
|
|
202
|
+
`Multiple organizations exist (${orgNames}). Specify orgName to indicate which one.`
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
} else {
|
|
206
|
+
const assignment = platform.getAssignment(name);
|
|
207
|
+
orgName = assignment?.org ?? dir.organizations[0].name;
|
|
208
|
+
}
|
|
209
|
+
const org = rolex.find(orgName);
|
|
142
210
|
switch (operation) {
|
|
143
211
|
case "hire": {
|
|
144
212
|
org.hire(name);
|
|
145
|
-
return next(`Role hired: ${name}`, nextHire(name));
|
|
213
|
+
return next(`Role hired: ${name} \u2192 ${orgName}`, nextHire(name));
|
|
146
214
|
}
|
|
147
215
|
case "fire": {
|
|
148
216
|
org.fire(name);
|
|
149
217
|
return next(`Role fired: ${name}`, NEXT.fire);
|
|
150
218
|
}
|
|
219
|
+
case "appoint": {
|
|
220
|
+
if (!position) throw new Error("appoint requires: name, position");
|
|
221
|
+
org.appoint(name, position);
|
|
222
|
+
return next(`Role appointed: ${name} \u2192 ${position}`, NEXT.appoint);
|
|
223
|
+
}
|
|
224
|
+
case "dismiss": {
|
|
225
|
+
org.dismiss(name);
|
|
226
|
+
return next(`Role dismissed: ${name}`, NEXT.dismiss);
|
|
227
|
+
}
|
|
151
228
|
default:
|
|
152
229
|
throw new Error(`Unknown organization operation: ${operation}`);
|
|
153
230
|
}
|
|
@@ -164,7 +241,8 @@ server.addTool({
|
|
|
164
241
|
currentRoleName = roleId;
|
|
165
242
|
const features = currentRole.identity();
|
|
166
243
|
const { current } = currentRole.focus();
|
|
167
|
-
const
|
|
244
|
+
const assignment = platform.getAssignment(roleId);
|
|
245
|
+
const statusBar = renderStatusBar(roleId, current, assignment?.org, assignment?.position);
|
|
168
246
|
return `${statusBar}
|
|
169
247
|
|
|
170
248
|
${renderFeatures(features)}`;
|
|
@@ -195,7 +273,13 @@ server.addTool({
|
|
|
195
273
|
execute: safeTool("focus", async ({ name }) => {
|
|
196
274
|
const role = requireRole();
|
|
197
275
|
const { current, otherGoals } = role.focus(name);
|
|
198
|
-
const
|
|
276
|
+
const assignment = platform.getAssignment(currentRoleName);
|
|
277
|
+
const statusBar = renderStatusBar(
|
|
278
|
+
currentRoleName,
|
|
279
|
+
current,
|
|
280
|
+
assignment?.org,
|
|
281
|
+
assignment?.position
|
|
282
|
+
);
|
|
199
283
|
if (!current && otherGoals.length === 0)
|
|
200
284
|
return `${statusBar}
|
|
201
285
|
|
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 * Tools:\n * society — Admin: born, found, directory, find, teach\n * organization — Admin: hire, fire\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 INSTRUCTIONS,\n DESC_SOCIETY,\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.1.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\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\", \"directory\", \"find\", \"teach\"])\n .describe(\"The society operation to perform\"),\n name: z\n .string()\n .optional()\n .describe(\"Role name (born/find/teach) or organization name (found)\"),\n source: z\n .string()\n .optional()\n .describe(\"Gherkin feature source (born: persona, teach: knowledge)\"),\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(\"society\", async ({ operation, name, source, roleId, type, dimensionName }) => {\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);\n return next(`Organization founded: ${name}`, NEXT.found);\n }\n case \"directory\": {\n const dir = rolex.directory();\n const lines: string[] = [];\n\n // Organizations and their hired roles\n if (dir.organizations.length > 0) {\n for (const entry of dir.organizations) {\n const orgInstance = rolex.find(entry.name) as Organization;\n const info = orgInstance.info();\n lines.push(`Organization: ${info.name}`);\n for (const role of info.roles) {\n lines.push(` - ${role.name} (team: ${role.team})`);\n }\n }\n }\n\n // Unaffiliated roles (born but not hired)\n const unaffiliated = dir.roles.filter((r) => !r.team);\n if (unaffiliated.length > 0) {\n if (lines.length > 0) lines.push(\"\");\n lines.push(\"Roles:\");\n for (const role of unaffiliated) {\n lines.push(` - ${role.name}`);\n }\n }\n\n return lines.join(\"\\n\") || \"No roles or organizations found.\";\n }\n case \"find\": {\n if (!name) throw new Error(\"find requires: name\");\n const result = rolex.find(name);\n if (result instanceof Organization) {\n const info = result.info();\n return `Organization: ${info.name} (${info.roles.length} roles)`;\n }\n const features = (result as Role).identity();\n return renderFeatures(features);\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// ========== Organization (folded) ==========\n\nserver.addTool({\n name: \"organization\",\n description: DESC_ORGANIZATION,\n parameters: z.object({\n operation: z.enum([\"hire\", \"fire\"]).describe(\"The organization operation to perform\"),\n name: z.string().describe(\"Role name to hire or fire\"),\n }),\n execute: safeTool(\"organization\", async ({ operation, name }) => {\n const dir = rolex.directory();\n if (dir.organizations.length === 0) {\n throw new Error(\"No organization found. Call found() first.\");\n }\n const org = rolex.find(dir.organizations[0].name) as Organization;\n\n switch (operation) {\n case \"hire\": {\n org.hire(name);\n return next(`Role hired: ${name}`, nextHire(name));\n }\n case \"fire\": {\n org.fire(name);\n return next(`Role fired: ${name}`, NEXT.fire);\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 statusBar = renderStatusBar(roleId, current);\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 statusBar = renderStatusBar(currentRoleName, current);\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":";;;AAeA,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,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,EACnF;AACA,SAAO;AACT;AAMA,SAAS,SACP,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ACd,MAAM,EAAE,OAAO,CAAC,EAChB;AAAA,MACC;AAAA,IACF;AAAA,IACF,eAAe,EACZ,OAAO,EACP;AAAA,MACC;AAAA,IACF;AAAA,IACF,iBAAiB,EAAE,OAAO,EAAE,SAAS,+CAA+C;AAAA,EACtF,CAAC;AAAA,EACD,SAAS,SAAS,WAAW,OAAO,EAAE,iBAAiB,eAAe,gBAAgB,MAAM;AAC1F,UAAM,OAAO,YAAY;AACzB,UAAM,UAAU,KAAK,QAAQ,iBAAiB,eAAe,eAAe;AAC5E,WAAO;AAAA,MACL,cAAc,gBAAgB,MAAM,oCAA+B,QAAQ,IAAI;AAAA,MAC/E,KAAK;AAAA,IACP;AAAA,EACF,CAAC;AACH,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, directory, find, teach\n * organization — Admin: hire, fire, appoint, dismiss\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_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\", \"directory\", \"find\", \"teach\"])\n .describe(\"The society operation to perform\"),\n name: z\n .string()\n .optional()\n .describe(\n \"Role name (born/find/teach), organization name (found), or position name (establish)\"\n ),\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 \"directory\": {\n const dir = rolex.directory();\n const lines: string[] = [];\n\n // Organizations with positions and members\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 // Free roles (not in any org)\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 case \"find\": {\n if (!name) throw new Error(\"find requires: 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 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// ========== 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":";;;AAoBA,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,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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AAO,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":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rolexjs/mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
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.9.1",
|
|
45
|
+
"@rolexjs/local-platform": "^0.9.1",
|
|
46
46
|
"fastmcp": "^3.0.0",
|
|
47
47
|
"zod": "^3.25.0"
|
|
48
48
|
},
|