@actwith-ai/mcp-server 0.1.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/ACTWITH.md +152 -0
- package/README.md +290 -0
- package/dist/client.d.ts +866 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +959 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +247 -0
- package/dist/index.js.map +1 -0
- package/dist/init.d.ts +10 -0
- package/dist/init.d.ts.map +1 -0
- package/dist/init.js +222 -0
- package/dist/init.js.map +1 -0
- package/dist/resources/index.d.ts +35 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +292 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/tools/artifacts.d.ts +12 -0
- package/dist/tools/artifacts.d.ts.map +1 -0
- package/dist/tools/artifacts.js +462 -0
- package/dist/tools/artifacts.js.map +1 -0
- package/dist/tools/contexts.d.ts +15 -0
- package/dist/tools/contexts.d.ts.map +1 -0
- package/dist/tools/contexts.js +188 -0
- package/dist/tools/contexts.js.map +1 -0
- package/dist/tools/discovery.d.ts +11 -0
- package/dist/tools/discovery.d.ts.map +1 -0
- package/dist/tools/discovery.js +249 -0
- package/dist/tools/discovery.js.map +1 -0
- package/dist/tools/identity.d.ts +15 -0
- package/dist/tools/identity.d.ts.map +1 -0
- package/dist/tools/identity.js +237 -0
- package/dist/tools/identity.js.map +1 -0
- package/dist/tools/index.d.ts +29 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +228 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/memory.d.ts +11 -0
- package/dist/tools/memory.d.ts.map +1 -0
- package/dist/tools/memory.js +349 -0
- package/dist/tools/memory.js.map +1 -0
- package/dist/tools/patterns.d.ts +17 -0
- package/dist/tools/patterns.d.ts.map +1 -0
- package/dist/tools/patterns.js +874 -0
- package/dist/tools/patterns.js.map +1 -0
- package/dist/tools/reputation.d.ts +11 -0
- package/dist/tools/reputation.d.ts.map +1 -0
- package/dist/tools/reputation.js +175 -0
- package/dist/tools/reputation.js.map +1 -0
- package/dist/tools/tasks.d.ts +11 -0
- package/dist/tools/tasks.d.ts.map +1 -0
- package/dist/tools/tasks.js +549 -0
- package/dist/tools/tasks.js.map +1 -0
- package/dist/tools/topics.d.ts +13 -0
- package/dist/tools/topics.d.ts.map +1 -0
- package/dist/tools/topics.js +561 -0
- package/dist/tools/topics.js.map +1 -0
- package/dist/tools/workspace.d.ts +10 -0
- package/dist/tools/workspace.d.ts.map +1 -0
- package/dist/tools/workspace.js +183 -0
- package/dist/tools/workspace.js.map +1 -0
- package/package.json +59 -0
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Artifact Tools for MCP Server
|
|
3
|
+
*
|
|
4
|
+
* Tools for managing work products: documents, data, code, etc.
|
|
5
|
+
* Artifacts have stages (input → draft → review → final → approved).
|
|
6
|
+
*/
|
|
7
|
+
export const artifactTools = [
|
|
8
|
+
{
|
|
9
|
+
name: "artifacts",
|
|
10
|
+
description: "List work products (documents, data, code) in the workspace. " +
|
|
11
|
+
"Filter by type, stage, tag, or context.",
|
|
12
|
+
inputSchema: {
|
|
13
|
+
type: "object",
|
|
14
|
+
properties: {
|
|
15
|
+
type: {
|
|
16
|
+
type: "string",
|
|
17
|
+
enum: ["document", "image", "data", "code", "binary"],
|
|
18
|
+
description: "Filter by artifact type",
|
|
19
|
+
},
|
|
20
|
+
stage: {
|
|
21
|
+
type: "string",
|
|
22
|
+
enum: ["input", "draft", "review", "final", "approved"],
|
|
23
|
+
description: "Filter by stage",
|
|
24
|
+
},
|
|
25
|
+
tag: {
|
|
26
|
+
type: "string",
|
|
27
|
+
description: "Filter by tag (returns artifacts with this tag)",
|
|
28
|
+
},
|
|
29
|
+
context_id: {
|
|
30
|
+
type: "string",
|
|
31
|
+
description: "Filter by work context ID",
|
|
32
|
+
},
|
|
33
|
+
space_level: {
|
|
34
|
+
type: "boolean",
|
|
35
|
+
description: "Only show space-level artifacts (not in any context)",
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: "artifact_details",
|
|
42
|
+
description: "Get details about a specific artifact including its metadata.",
|
|
43
|
+
inputSchema: {
|
|
44
|
+
type: "object",
|
|
45
|
+
properties: {
|
|
46
|
+
artifact_id: {
|
|
47
|
+
type: "string",
|
|
48
|
+
description: "The artifact ID",
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
required: ["artifact_id"],
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "artifact_content",
|
|
56
|
+
description: "Read the content of an artifact.",
|
|
57
|
+
inputSchema: {
|
|
58
|
+
type: "object",
|
|
59
|
+
properties: {
|
|
60
|
+
artifact_id: {
|
|
61
|
+
type: "string",
|
|
62
|
+
description: "The artifact ID",
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
required: ["artifact_id"],
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "create_artifact",
|
|
70
|
+
description: "Create a new artifact (document, data, code, etc). " +
|
|
71
|
+
"Useful for storing work products that should be tracked.",
|
|
72
|
+
inputSchema: {
|
|
73
|
+
type: "object",
|
|
74
|
+
properties: {
|
|
75
|
+
name: {
|
|
76
|
+
type: "string",
|
|
77
|
+
description: 'Name of the artifact (e.g., "requirements.md")',
|
|
78
|
+
},
|
|
79
|
+
type: {
|
|
80
|
+
type: "string",
|
|
81
|
+
enum: ["document", "image", "data", "code", "binary"],
|
|
82
|
+
description: "Type of artifact",
|
|
83
|
+
},
|
|
84
|
+
content_type: {
|
|
85
|
+
type: "string",
|
|
86
|
+
description: 'MIME type (e.g., "text/markdown", "application/json")',
|
|
87
|
+
},
|
|
88
|
+
content: {
|
|
89
|
+
description: "The artifact content",
|
|
90
|
+
},
|
|
91
|
+
description: {
|
|
92
|
+
type: "string",
|
|
93
|
+
description: "Optional description",
|
|
94
|
+
},
|
|
95
|
+
stage: {
|
|
96
|
+
type: "string",
|
|
97
|
+
enum: ["input", "draft", "review", "final", "approved"],
|
|
98
|
+
description: "Initial stage (default: draft)",
|
|
99
|
+
},
|
|
100
|
+
context_id: {
|
|
101
|
+
type: "string",
|
|
102
|
+
description: "Work context ID (if omitted, creates at space level)",
|
|
103
|
+
},
|
|
104
|
+
tags: {
|
|
105
|
+
type: "array",
|
|
106
|
+
items: { type: "string" },
|
|
107
|
+
description: "Tags for categorization (e.g., ['api', 'auth'])",
|
|
108
|
+
},
|
|
109
|
+
insight: {
|
|
110
|
+
type: "string",
|
|
111
|
+
description: "Why this artifact exists and what it's for (aids discovery)",
|
|
112
|
+
},
|
|
113
|
+
source_artifact_ids: {
|
|
114
|
+
type: "array",
|
|
115
|
+
items: { type: "string" },
|
|
116
|
+
description: "IDs of artifacts this was created from (lineage)",
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
required: ["name", "type", "content_type"],
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: "update_artifact",
|
|
124
|
+
description: "Update an artifact's content (creates a new version).",
|
|
125
|
+
inputSchema: {
|
|
126
|
+
type: "object",
|
|
127
|
+
properties: {
|
|
128
|
+
artifact_id: {
|
|
129
|
+
type: "string",
|
|
130
|
+
description: "The artifact ID",
|
|
131
|
+
},
|
|
132
|
+
content: {
|
|
133
|
+
description: "The new content",
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
required: ["artifact_id", "content"],
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: "update_artifact_metadata",
|
|
141
|
+
description: "Update an artifact's metadata (name, description, tags, insight). " +
|
|
142
|
+
"Does not create a new version.",
|
|
143
|
+
inputSchema: {
|
|
144
|
+
type: "object",
|
|
145
|
+
properties: {
|
|
146
|
+
artifact_id: {
|
|
147
|
+
type: "string",
|
|
148
|
+
description: "The artifact ID",
|
|
149
|
+
},
|
|
150
|
+
name: {
|
|
151
|
+
type: "string",
|
|
152
|
+
description: "New name for the artifact",
|
|
153
|
+
},
|
|
154
|
+
description: {
|
|
155
|
+
type: "string",
|
|
156
|
+
description: "New description",
|
|
157
|
+
},
|
|
158
|
+
tags: {
|
|
159
|
+
type: "array",
|
|
160
|
+
items: { type: "string" },
|
|
161
|
+
description: "New tags (replaces existing)",
|
|
162
|
+
},
|
|
163
|
+
insight: {
|
|
164
|
+
type: "string",
|
|
165
|
+
description: "New insight (why this exists)",
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
required: ["artifact_id"],
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
name: "advance_artifact",
|
|
173
|
+
description: "Move an artifact to the next stage (e.g., draft → review → final).",
|
|
174
|
+
inputSchema: {
|
|
175
|
+
type: "object",
|
|
176
|
+
properties: {
|
|
177
|
+
artifact_id: {
|
|
178
|
+
type: "string",
|
|
179
|
+
description: "The artifact ID",
|
|
180
|
+
},
|
|
181
|
+
stage: {
|
|
182
|
+
type: "string",
|
|
183
|
+
enum: ["input", "draft", "review", "final", "approved"],
|
|
184
|
+
description: "New stage",
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
required: ["artifact_id", "stage"],
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
name: "promote_artifact",
|
|
192
|
+
description: "Promote a context-level artifact to space level. " +
|
|
193
|
+
"Makes it available across all contexts as accumulated knowledge.",
|
|
194
|
+
inputSchema: {
|
|
195
|
+
type: "object",
|
|
196
|
+
properties: {
|
|
197
|
+
artifact_id: {
|
|
198
|
+
type: "string",
|
|
199
|
+
description: "The artifact ID to promote",
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
required: ["artifact_id"],
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
name: "artifact_versions",
|
|
207
|
+
description: "Get version history for an artifact. " +
|
|
208
|
+
"Shows all previous versions with timestamps and who made each change.",
|
|
209
|
+
inputSchema: {
|
|
210
|
+
type: "object",
|
|
211
|
+
properties: {
|
|
212
|
+
artifact_id: {
|
|
213
|
+
type: "string",
|
|
214
|
+
description: "The artifact ID",
|
|
215
|
+
},
|
|
216
|
+
limit: {
|
|
217
|
+
type: "number",
|
|
218
|
+
description: "Max versions to return (default: 20)",
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
required: ["artifact_id"],
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
name: "artifact_version_content",
|
|
226
|
+
description: "Read the content of a specific version of an artifact. " +
|
|
227
|
+
"Use artifact_versions first to see available versions.",
|
|
228
|
+
inputSchema: {
|
|
229
|
+
type: "object",
|
|
230
|
+
properties: {
|
|
231
|
+
artifact_id: {
|
|
232
|
+
type: "string",
|
|
233
|
+
description: "The artifact ID",
|
|
234
|
+
},
|
|
235
|
+
version: {
|
|
236
|
+
type: "number",
|
|
237
|
+
description: "Version number to retrieve",
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
required: ["artifact_id", "version"],
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: "artifact_restore",
|
|
245
|
+
description: "Restore an artifact to a previous version. " +
|
|
246
|
+
"Creates a new version with the content from the specified old version.",
|
|
247
|
+
inputSchema: {
|
|
248
|
+
type: "object",
|
|
249
|
+
properties: {
|
|
250
|
+
artifact_id: {
|
|
251
|
+
type: "string",
|
|
252
|
+
description: "The artifact ID",
|
|
253
|
+
},
|
|
254
|
+
version: {
|
|
255
|
+
type: "number",
|
|
256
|
+
description: "Version number to restore to",
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
required: ["artifact_id", "version"],
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
];
|
|
263
|
+
// Tool name aliases for backwards compatibility
|
|
264
|
+
const TOOL_ALIASES = {
|
|
265
|
+
actwith_artifact_list: "artifacts",
|
|
266
|
+
actwith_artifact_get: "artifact_details",
|
|
267
|
+
actwith_artifact_content: "artifact_content",
|
|
268
|
+
actwith_artifact_create: "create_artifact",
|
|
269
|
+
actwith_artifact_update: "update_artifact",
|
|
270
|
+
actwith_artifact_stage: "advance_artifact",
|
|
271
|
+
actwith_artifact_promote: "promote_artifact",
|
|
272
|
+
};
|
|
273
|
+
export function normalizeArtifactToolName(name) {
|
|
274
|
+
return TOOL_ALIASES[name] || name;
|
|
275
|
+
}
|
|
276
|
+
export async function handleArtifactTool(client, name, args) {
|
|
277
|
+
const normalizedName = normalizeArtifactToolName(name);
|
|
278
|
+
switch (normalizedName) {
|
|
279
|
+
case "artifacts": {
|
|
280
|
+
const { type, stage, tag, context_id, space_level } = args;
|
|
281
|
+
const artifacts = await client.artifactsList({
|
|
282
|
+
type,
|
|
283
|
+
stage,
|
|
284
|
+
tag,
|
|
285
|
+
contextId: context_id,
|
|
286
|
+
spaceLevel: space_level,
|
|
287
|
+
});
|
|
288
|
+
return {
|
|
289
|
+
success: true,
|
|
290
|
+
count: artifacts.length,
|
|
291
|
+
artifacts: artifacts.map((a) => ({
|
|
292
|
+
id: a.id,
|
|
293
|
+
name: a.name,
|
|
294
|
+
type: a.type,
|
|
295
|
+
stage: a.stage,
|
|
296
|
+
contentType: a.contentType,
|
|
297
|
+
sizeBytes: a.sizeBytes,
|
|
298
|
+
version: a.version,
|
|
299
|
+
tags: a.tags,
|
|
300
|
+
insight: a.insight,
|
|
301
|
+
updatedAt: new Date(a.updatedAt * 1000).toISOString(),
|
|
302
|
+
})),
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
case "artifact_details": {
|
|
306
|
+
const { artifact_id } = args;
|
|
307
|
+
const artifact = await client.artifactGet(artifact_id);
|
|
308
|
+
if (!artifact) {
|
|
309
|
+
return {
|
|
310
|
+
success: false,
|
|
311
|
+
message: `Artifact "${artifact_id}" not found`,
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
return {
|
|
315
|
+
success: true,
|
|
316
|
+
artifact: {
|
|
317
|
+
id: artifact.id,
|
|
318
|
+
name: artifact.name,
|
|
319
|
+
description: artifact.description,
|
|
320
|
+
type: artifact.type,
|
|
321
|
+
stage: artifact.stage,
|
|
322
|
+
contentType: artifact.contentType,
|
|
323
|
+
sizeBytes: artifact.sizeBytes,
|
|
324
|
+
version: artifact.version,
|
|
325
|
+
createdBy: artifact.createdBy,
|
|
326
|
+
tags: artifact.tags,
|
|
327
|
+
insight: artifact.insight,
|
|
328
|
+
sourceArtifactIds: artifact.sourceArtifactIds,
|
|
329
|
+
createdAt: new Date(artifact.createdAt * 1000).toISOString(),
|
|
330
|
+
updatedAt: new Date(artifact.updatedAt * 1000).toISOString(),
|
|
331
|
+
},
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
case "artifact_content": {
|
|
335
|
+
const { artifact_id } = args;
|
|
336
|
+
const result = await client.artifactGetContent(artifact_id);
|
|
337
|
+
if (!result) {
|
|
338
|
+
return {
|
|
339
|
+
success: false,
|
|
340
|
+
message: `Artifact "${artifact_id}" not found or has no content`,
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
return {
|
|
344
|
+
success: true,
|
|
345
|
+
contentType: result.contentType,
|
|
346
|
+
content: result.content,
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
case "create_artifact": {
|
|
350
|
+
const { name, type, content_type, content, description, stage, context_id, tags, insight, source_artifact_ids, } = args;
|
|
351
|
+
const artifact = await client.artifactCreate({
|
|
352
|
+
name,
|
|
353
|
+
type,
|
|
354
|
+
contentType: content_type,
|
|
355
|
+
content,
|
|
356
|
+
description,
|
|
357
|
+
stage,
|
|
358
|
+
contextId: context_id,
|
|
359
|
+
tags,
|
|
360
|
+
insight,
|
|
361
|
+
sourceArtifactIds: source_artifact_ids,
|
|
362
|
+
});
|
|
363
|
+
return {
|
|
364
|
+
success: true,
|
|
365
|
+
message: `Created artifact "${name}"`,
|
|
366
|
+
artifact: {
|
|
367
|
+
id: artifact.id,
|
|
368
|
+
name: artifact.name,
|
|
369
|
+
version: artifact.version,
|
|
370
|
+
},
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
case "update_artifact": {
|
|
374
|
+
const { artifact_id, content } = args;
|
|
375
|
+
const result = await client.artifactUpdateContent(artifact_id, content);
|
|
376
|
+
return {
|
|
377
|
+
success: true,
|
|
378
|
+
message: `Updated artifact, now at version ${result.version}`,
|
|
379
|
+
version: result.version,
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
case "update_artifact_metadata": {
|
|
383
|
+
const { artifact_id, name, description, tags, insight } = args;
|
|
384
|
+
await client.artifactUpdateMetadata(artifact_id, {
|
|
385
|
+
name,
|
|
386
|
+
description,
|
|
387
|
+
tags,
|
|
388
|
+
insight,
|
|
389
|
+
});
|
|
390
|
+
const updates = [];
|
|
391
|
+
if (name)
|
|
392
|
+
updates.push("name");
|
|
393
|
+
if (description)
|
|
394
|
+
updates.push("description");
|
|
395
|
+
if (tags)
|
|
396
|
+
updates.push("tags");
|
|
397
|
+
if (insight)
|
|
398
|
+
updates.push("insight");
|
|
399
|
+
return {
|
|
400
|
+
success: true,
|
|
401
|
+
message: `Updated artifact metadata: ${updates.join(", ") || "no changes"}`,
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
case "advance_artifact": {
|
|
405
|
+
const { artifact_id, stage } = args;
|
|
406
|
+
await client.artifactUpdateStage(artifact_id, stage);
|
|
407
|
+
return {
|
|
408
|
+
success: true,
|
|
409
|
+
message: `Artifact advanced to "${stage}" stage`,
|
|
410
|
+
};
|
|
411
|
+
}
|
|
412
|
+
case "promote_artifact": {
|
|
413
|
+
const { artifact_id } = args;
|
|
414
|
+
await client.artifactPromote(artifact_id);
|
|
415
|
+
return {
|
|
416
|
+
success: true,
|
|
417
|
+
message: "Artifact promoted to space level (now available across all contexts)",
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
case "artifact_versions": {
|
|
421
|
+
const { artifact_id, limit = 20 } = args;
|
|
422
|
+
const result = await client.artifactVersions(artifact_id, { limit });
|
|
423
|
+
return {
|
|
424
|
+
success: true,
|
|
425
|
+
artifactName: result.artifactName,
|
|
426
|
+
currentVersion: result.currentVersion,
|
|
427
|
+
totalVersions: result.total,
|
|
428
|
+
versions: result.versions.map((v) => ({
|
|
429
|
+
version: v.version,
|
|
430
|
+
sizeBytes: v.sizeBytes,
|
|
431
|
+
changeSummary: v.changeSummary,
|
|
432
|
+
createdBy: v.createdBy,
|
|
433
|
+
createdAt: new Date(v.createdAt * 1000).toISOString(),
|
|
434
|
+
})),
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
case "artifact_version_content": {
|
|
438
|
+
const { artifact_id, version } = args;
|
|
439
|
+
const result = await client.artifactVersionContent(artifact_id, version);
|
|
440
|
+
return {
|
|
441
|
+
success: true,
|
|
442
|
+
version: result.version,
|
|
443
|
+
contentType: result.contentType,
|
|
444
|
+
content: result.content,
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
case "artifact_restore": {
|
|
448
|
+
const { artifact_id, version } = args;
|
|
449
|
+
const result = await client.artifactRestore(artifact_id, version);
|
|
450
|
+
return {
|
|
451
|
+
success: true,
|
|
452
|
+
message: `Restored artifact to version ${version}`,
|
|
453
|
+
previousVersion: result.previousVersion,
|
|
454
|
+
newVersion: result.newVersion,
|
|
455
|
+
restoredFrom: result.restoredFrom,
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
default:
|
|
459
|
+
throw new Error(`Unknown artifact tool: ${name}`);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
//# sourceMappingURL=artifacts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../src/tools/artifacts.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,MAAM,CAAC,MAAM,aAAa,GA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M,CAAC,sBAAsB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;YAEzE,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,WAAW,EAAE,MAAM,CAAC,WAAW;gBAC/B,OAAO,EAAE,MAAM,CAAC,OAAO;aACxB,CAAC;QACJ,CAAC;QAED,KAAK,kBAAkB,CAAC,CAAC,CAAC;YACxB,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,IAGhC,CAAC;YAEF,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,eAAe,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;YAElE,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,gCAAgC,OAAO,EAAE;gBAClD,eAAe,EAAE,MAAM,CAAC,eAAe;gBACvC,UAAU,EAAE,MAAM,CAAC,UAAU;gBAC7B,YAAY,EAAE,MAAM,CAAC,YAAY;aAClC,CAAC;QACJ,CAAC;QAED;YACE,MAAM,IAAI,KAAK,CAAC,0BAA0B,IAAI,EAAE,CAAC,CAAC;IACtD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Work Context Tools for MCP Server
|
|
3
|
+
*
|
|
4
|
+
* Tools for managing bounded work contexts within a space.
|
|
5
|
+
* Contexts are like projects or sprints - they have a lifecycle.
|
|
6
|
+
*
|
|
7
|
+
* Context IS the Goal - it defines WHAT we're trying to achieve.
|
|
8
|
+
* Tasks within the context define HOW we achieve it.
|
|
9
|
+
*/
|
|
10
|
+
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
11
|
+
import { ActwithClient } from "../client.js";
|
|
12
|
+
export declare const contextTools: Tool[];
|
|
13
|
+
export declare function normalizeContextToolName(name: string): string;
|
|
14
|
+
export declare function handleContextTool(client: ActwithClient, name: string, args: Record<string, unknown>): Promise<unknown>;
|
|
15
|
+
//# sourceMappingURL=contexts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contexts.d.ts","sourceRoot":"","sources":["../../src/tools/contexts.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,eAAO,MAAM,YAAY,EAAE,IAAI,EAkF9B,CAAC;AAcF,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,OAAO,CAAC,CA2GlB"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Work Context Tools for MCP Server
|
|
3
|
+
*
|
|
4
|
+
* Tools for managing bounded work contexts within a space.
|
|
5
|
+
* Contexts are like projects or sprints - they have a lifecycle.
|
|
6
|
+
*
|
|
7
|
+
* Context IS the Goal - it defines WHAT we're trying to achieve.
|
|
8
|
+
* Tasks within the context define HOW we achieve it.
|
|
9
|
+
*/
|
|
10
|
+
export const contextTools = [
|
|
11
|
+
{
|
|
12
|
+
name: "projects",
|
|
13
|
+
description: "List work contexts (projects/sprints) in your workspace. " +
|
|
14
|
+
"Filter by status: active, completed, or archived.",
|
|
15
|
+
inputSchema: {
|
|
16
|
+
type: "object",
|
|
17
|
+
properties: {
|
|
18
|
+
status: {
|
|
19
|
+
type: "string",
|
|
20
|
+
enum: ["active", "completed", "archived"],
|
|
21
|
+
description: "Filter by status (default: all)",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: "project_details",
|
|
28
|
+
description: "Get details about a specific work context/project.",
|
|
29
|
+
inputSchema: {
|
|
30
|
+
type: "object",
|
|
31
|
+
properties: {
|
|
32
|
+
context_id: {
|
|
33
|
+
type: "string",
|
|
34
|
+
description: "The context ID",
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
required: ["context_id"],
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: "start_project",
|
|
42
|
+
description: "Create a new work context (project/goal). " +
|
|
43
|
+
"The context defines WHAT you're trying to achieve. " +
|
|
44
|
+
"Tasks within it define HOW. Include success criteria for measurable outcomes.",
|
|
45
|
+
inputSchema: {
|
|
46
|
+
type: "object",
|
|
47
|
+
properties: {
|
|
48
|
+
name: {
|
|
49
|
+
type: "string",
|
|
50
|
+
description: 'Name of the project/goal (e.g., "Reduce food waste by 50%")',
|
|
51
|
+
},
|
|
52
|
+
description: {
|
|
53
|
+
type: "string",
|
|
54
|
+
description: "What this project is about",
|
|
55
|
+
},
|
|
56
|
+
success_criteria: {
|
|
57
|
+
type: "string",
|
|
58
|
+
description: 'What does "done" look like? Measurable outcome (e.g., "Waste rate reduced from 40% to 20%, verified by Q4 audit")',
|
|
59
|
+
},
|
|
60
|
+
target_metric: {
|
|
61
|
+
type: "string",
|
|
62
|
+
description: 'Quantifiable target (e.g., "50% reduction", "100K users")',
|
|
63
|
+
},
|
|
64
|
+
due_at: {
|
|
65
|
+
type: "number",
|
|
66
|
+
description: "Optional deadline (Unix timestamp)",
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
required: ["name"],
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: "finish_project",
|
|
74
|
+
description: "Mark a work context as completed. " +
|
|
75
|
+
"Completed contexts remain accessible but are no longer active.",
|
|
76
|
+
inputSchema: {
|
|
77
|
+
type: "object",
|
|
78
|
+
properties: {
|
|
79
|
+
context_id: {
|
|
80
|
+
type: "string",
|
|
81
|
+
description: "The context ID to complete",
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
required: ["context_id"],
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
];
|
|
88
|
+
// Tool name aliases for backwards compatibility
|
|
89
|
+
const TOOL_ALIASES = {
|
|
90
|
+
actwith_context_list: "projects",
|
|
91
|
+
actwith_context_get: "project_details",
|
|
92
|
+
actwith_context_create: "start_project",
|
|
93
|
+
actwith_context_complete: "finish_project",
|
|
94
|
+
work_contexts: "projects",
|
|
95
|
+
context_details: "project_details",
|
|
96
|
+
create_context: "start_project",
|
|
97
|
+
complete_context: "finish_project",
|
|
98
|
+
};
|
|
99
|
+
export function normalizeContextToolName(name) {
|
|
100
|
+
return TOOL_ALIASES[name] || name;
|
|
101
|
+
}
|
|
102
|
+
export async function handleContextTool(client, name, args) {
|
|
103
|
+
const normalizedName = normalizeContextToolName(name);
|
|
104
|
+
switch (normalizedName) {
|
|
105
|
+
case "projects": {
|
|
106
|
+
const { status } = args;
|
|
107
|
+
const contexts = await client.contextsList(status);
|
|
108
|
+
return {
|
|
109
|
+
success: true,
|
|
110
|
+
count: contexts.length,
|
|
111
|
+
projects: contexts.map((ctx) => ({
|
|
112
|
+
id: ctx.id,
|
|
113
|
+
name: ctx.name,
|
|
114
|
+
description: ctx.description,
|
|
115
|
+
status: ctx.status,
|
|
116
|
+
artifactCount: ctx.artifactCount,
|
|
117
|
+
taskCount: ctx.taskCount,
|
|
118
|
+
createdAt: new Date(ctx.createdAt * 1000).toISOString(),
|
|
119
|
+
})),
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
case "project_details": {
|
|
123
|
+
const { context_id } = args;
|
|
124
|
+
const context = await client.contextGet(context_id);
|
|
125
|
+
if (!context) {
|
|
126
|
+
return {
|
|
127
|
+
success: false,
|
|
128
|
+
message: `Project "${context_id}" not found`,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
return {
|
|
132
|
+
success: true,
|
|
133
|
+
project: {
|
|
134
|
+
id: context.id,
|
|
135
|
+
name: context.name,
|
|
136
|
+
description: context.description,
|
|
137
|
+
status: context.status,
|
|
138
|
+
// Goal fields
|
|
139
|
+
successCriteria: context.successCriteria,
|
|
140
|
+
targetMetric: context.targetMetric,
|
|
141
|
+
progress: context.progress,
|
|
142
|
+
// Dates
|
|
143
|
+
dueAt: context.dueAt
|
|
144
|
+
? new Date(context.dueAt * 1000).toISOString()
|
|
145
|
+
: null,
|
|
146
|
+
// Stats
|
|
147
|
+
artifactCount: context.artifactCount,
|
|
148
|
+
taskCount: context.taskCount,
|
|
149
|
+
createdAt: new Date(context.createdAt * 1000).toISOString(),
|
|
150
|
+
completedAt: context.completedAt
|
|
151
|
+
? new Date(context.completedAt * 1000).toISOString()
|
|
152
|
+
: null,
|
|
153
|
+
},
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
case "start_project": {
|
|
157
|
+
const { name, description, success_criteria, target_metric, due_at } = args;
|
|
158
|
+
const context = await client.contextCreate(name, description, due_at, {
|
|
159
|
+
successCriteria: success_criteria,
|
|
160
|
+
targetMetric: target_metric,
|
|
161
|
+
});
|
|
162
|
+
return {
|
|
163
|
+
success: true,
|
|
164
|
+
message: `Created project "${name}"`,
|
|
165
|
+
project: {
|
|
166
|
+
id: context.id,
|
|
167
|
+
name: context.name,
|
|
168
|
+
successCriteria: success_criteria,
|
|
169
|
+
targetMetric: target_metric,
|
|
170
|
+
},
|
|
171
|
+
tip: success_criteria
|
|
172
|
+
? undefined
|
|
173
|
+
: "Tip: Add success_criteria to make your goal measurable!",
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
case "finish_project": {
|
|
177
|
+
const { context_id } = args;
|
|
178
|
+
await client.contextComplete(context_id);
|
|
179
|
+
return {
|
|
180
|
+
success: true,
|
|
181
|
+
message: "Project marked as completed",
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
default:
|
|
185
|
+
throw new Error(`Unknown context tool: ${name}`);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
//# sourceMappingURL=contexts.js.map
|