@artyfacts/mcp-server 1.1.3 → 1.1.5
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/bin/artyfacts-mcp.js +2 -0
- package/dist/chunk-GOOQPNGV.js +631 -0
- package/dist/chunk-TEUGXQOH.js +633 -0
- package/dist/index.cjs +21 -8
- package/dist/index.js +1 -1
- package/dist/server.cjs +21 -8
- package/dist/server.d.cts +2 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +1 -1
- package/package.json +1 -1
- package/src/server.ts +22 -8
package/dist/index.cjs
CHANGED
|
@@ -100,6 +100,7 @@ var ARTYFACTS_TOOLS = [
|
|
|
100
100
|
title: { type: "string", description: "Artifact title" },
|
|
101
101
|
type: { type: "string", description: "Artifact type: goal, spec, research, report, experiment, decision, doc" },
|
|
102
102
|
content: { type: "string", description: "Markdown content" },
|
|
103
|
+
goal_id: { type: "string", description: "The goal UUID this artifact belongs to \u2014 always pass this when working on a task" },
|
|
103
104
|
parent_id: { type: "string", description: "Parent artifact ID for nested artifacts" },
|
|
104
105
|
tags: { type: "array", items: { type: "string" }, description: "Tags for categorization" }
|
|
105
106
|
},
|
|
@@ -313,7 +314,8 @@ var ARTYFACTS_TOOLS = [
|
|
|
313
314
|
delegate_tasks: { type: "boolean", description: "Can assign tasks to other agents" }
|
|
314
315
|
}
|
|
315
316
|
},
|
|
316
|
-
systemPrompt: { type: "string", description: "System prompt for the agent" }
|
|
317
|
+
systemPrompt: { type: "string", description: "System prompt for the agent" },
|
|
318
|
+
reportsToAgentId: { type: "string", description: 'Agent ID or UUID of the parent agent this agent reports to. Use agent slugs like "chief-of-staff" for readability.' }
|
|
317
319
|
},
|
|
318
320
|
required: ["agentId", "name", "role", "description"]
|
|
319
321
|
}
|
|
@@ -406,18 +408,23 @@ var ARTYFACTS_TOOLS = [
|
|
|
406
408
|
}
|
|
407
409
|
];
|
|
408
410
|
var ArtyfactsApiClient = class {
|
|
409
|
-
constructor(baseUrl, apiKey) {
|
|
411
|
+
constructor(baseUrl, apiKey, agentId) {
|
|
410
412
|
this.baseUrl = baseUrl;
|
|
411
413
|
this.apiKey = apiKey;
|
|
414
|
+
this.agentId = agentId;
|
|
412
415
|
}
|
|
413
416
|
async request(method, path, body) {
|
|
414
417
|
const url = `${this.baseUrl}${path}`;
|
|
418
|
+
const headers = {
|
|
419
|
+
"Authorization": `Bearer ${this.apiKey}`,
|
|
420
|
+
"Content-Type": "application/json"
|
|
421
|
+
};
|
|
422
|
+
if (this.agentId) {
|
|
423
|
+
headers["X-Agent-Id"] = this.agentId;
|
|
424
|
+
}
|
|
415
425
|
const response = await fetch(url, {
|
|
416
426
|
method,
|
|
417
|
-
headers
|
|
418
|
-
"Authorization": `Bearer ${this.apiKey}`,
|
|
419
|
-
"Content-Type": "application/json"
|
|
420
|
-
},
|
|
427
|
+
headers,
|
|
421
428
|
body: body ? JSON.stringify(body) : void 0
|
|
422
429
|
});
|
|
423
430
|
if (!response.ok) {
|
|
@@ -429,6 +436,9 @@ var ArtyfactsApiClient = class {
|
|
|
429
436
|
get(path) {
|
|
430
437
|
return this.request("GET", path);
|
|
431
438
|
}
|
|
439
|
+
getAgentId() {
|
|
440
|
+
return this.agentId;
|
|
441
|
+
}
|
|
432
442
|
post(path, body) {
|
|
433
443
|
return this.request("POST", path, body);
|
|
434
444
|
}
|
|
@@ -468,6 +478,7 @@ var toolHandlers = {
|
|
|
468
478
|
title: args.title,
|
|
469
479
|
type: args.type || "document/sectioned",
|
|
470
480
|
artifact_type: args.artifact_type || args.type || "doc",
|
|
481
|
+
goal_id: args.goal_id,
|
|
471
482
|
parent_id: args.parent_id,
|
|
472
483
|
tags: args.tags
|
|
473
484
|
},
|
|
@@ -476,7 +487,7 @@ var toolHandlers = {
|
|
|
476
487
|
body: args.content
|
|
477
488
|
} : void 0,
|
|
478
489
|
source: {
|
|
479
|
-
agent_id: "mcp-agent"
|
|
490
|
+
agent_id: client.getAgentId() || "mcp-agent"
|
|
480
491
|
}
|
|
481
492
|
};
|
|
482
493
|
return client.post("/artifacts", envelope);
|
|
@@ -532,6 +543,7 @@ var toolHandlers = {
|
|
|
532
543
|
name: args.name,
|
|
533
544
|
role: args.role,
|
|
534
545
|
description: args.description,
|
|
546
|
+
reportsToAgentId: args.reportsToAgentId,
|
|
535
547
|
permissions: args.permissions || { write: true, delete: false, delegate_tasks: false },
|
|
536
548
|
metadata: {
|
|
537
549
|
capabilities: args.capabilities || [],
|
|
@@ -580,7 +592,8 @@ var ArtyfactsMcpServer = class {
|
|
|
580
592
|
this.config = config;
|
|
581
593
|
this.client = new ArtyfactsApiClient(
|
|
582
594
|
config.baseUrl || "https://artyfacts.dev/api/v1",
|
|
583
|
-
config.apiKey
|
|
595
|
+
config.apiKey,
|
|
596
|
+
config.agentId
|
|
584
597
|
);
|
|
585
598
|
this.server = new import_server.Server(
|
|
586
599
|
{
|
package/dist/index.js
CHANGED
package/dist/server.cjs
CHANGED
|
@@ -98,6 +98,7 @@ var ARTYFACTS_TOOLS = [
|
|
|
98
98
|
title: { type: "string", description: "Artifact title" },
|
|
99
99
|
type: { type: "string", description: "Artifact type: goal, spec, research, report, experiment, decision, doc" },
|
|
100
100
|
content: { type: "string", description: "Markdown content" },
|
|
101
|
+
goal_id: { type: "string", description: "The goal UUID this artifact belongs to \u2014 always pass this when working on a task" },
|
|
101
102
|
parent_id: { type: "string", description: "Parent artifact ID for nested artifacts" },
|
|
102
103
|
tags: { type: "array", items: { type: "string" }, description: "Tags for categorization" }
|
|
103
104
|
},
|
|
@@ -311,7 +312,8 @@ var ARTYFACTS_TOOLS = [
|
|
|
311
312
|
delegate_tasks: { type: "boolean", description: "Can assign tasks to other agents" }
|
|
312
313
|
}
|
|
313
314
|
},
|
|
314
|
-
systemPrompt: { type: "string", description: "System prompt for the agent" }
|
|
315
|
+
systemPrompt: { type: "string", description: "System prompt for the agent" },
|
|
316
|
+
reportsToAgentId: { type: "string", description: 'Agent ID or UUID of the parent agent this agent reports to. Use agent slugs like "chief-of-staff" for readability.' }
|
|
315
317
|
},
|
|
316
318
|
required: ["agentId", "name", "role", "description"]
|
|
317
319
|
}
|
|
@@ -404,18 +406,23 @@ var ARTYFACTS_TOOLS = [
|
|
|
404
406
|
}
|
|
405
407
|
];
|
|
406
408
|
var ArtyfactsApiClient = class {
|
|
407
|
-
constructor(baseUrl, apiKey) {
|
|
409
|
+
constructor(baseUrl, apiKey, agentId) {
|
|
408
410
|
this.baseUrl = baseUrl;
|
|
409
411
|
this.apiKey = apiKey;
|
|
412
|
+
this.agentId = agentId;
|
|
410
413
|
}
|
|
411
414
|
async request(method, path, body) {
|
|
412
415
|
const url = `${this.baseUrl}${path}`;
|
|
416
|
+
const headers = {
|
|
417
|
+
"Authorization": `Bearer ${this.apiKey}`,
|
|
418
|
+
"Content-Type": "application/json"
|
|
419
|
+
};
|
|
420
|
+
if (this.agentId) {
|
|
421
|
+
headers["X-Agent-Id"] = this.agentId;
|
|
422
|
+
}
|
|
413
423
|
const response = await fetch(url, {
|
|
414
424
|
method,
|
|
415
|
-
headers
|
|
416
|
-
"Authorization": `Bearer ${this.apiKey}`,
|
|
417
|
-
"Content-Type": "application/json"
|
|
418
|
-
},
|
|
425
|
+
headers,
|
|
419
426
|
body: body ? JSON.stringify(body) : void 0
|
|
420
427
|
});
|
|
421
428
|
if (!response.ok) {
|
|
@@ -427,6 +434,9 @@ var ArtyfactsApiClient = class {
|
|
|
427
434
|
get(path) {
|
|
428
435
|
return this.request("GET", path);
|
|
429
436
|
}
|
|
437
|
+
getAgentId() {
|
|
438
|
+
return this.agentId;
|
|
439
|
+
}
|
|
430
440
|
post(path, body) {
|
|
431
441
|
return this.request("POST", path, body);
|
|
432
442
|
}
|
|
@@ -466,6 +476,7 @@ var toolHandlers = {
|
|
|
466
476
|
title: args.title,
|
|
467
477
|
type: args.type || "document/sectioned",
|
|
468
478
|
artifact_type: args.artifact_type || args.type || "doc",
|
|
479
|
+
goal_id: args.goal_id,
|
|
469
480
|
parent_id: args.parent_id,
|
|
470
481
|
tags: args.tags
|
|
471
482
|
},
|
|
@@ -474,7 +485,7 @@ var toolHandlers = {
|
|
|
474
485
|
body: args.content
|
|
475
486
|
} : void 0,
|
|
476
487
|
source: {
|
|
477
|
-
agent_id: "mcp-agent"
|
|
488
|
+
agent_id: client.getAgentId() || "mcp-agent"
|
|
478
489
|
}
|
|
479
490
|
};
|
|
480
491
|
return client.post("/artifacts", envelope);
|
|
@@ -530,6 +541,7 @@ var toolHandlers = {
|
|
|
530
541
|
name: args.name,
|
|
531
542
|
role: args.role,
|
|
532
543
|
description: args.description,
|
|
544
|
+
reportsToAgentId: args.reportsToAgentId,
|
|
533
545
|
permissions: args.permissions || { write: true, delete: false, delegate_tasks: false },
|
|
534
546
|
metadata: {
|
|
535
547
|
capabilities: args.capabilities || [],
|
|
@@ -578,7 +590,8 @@ var ArtyfactsMcpServer = class {
|
|
|
578
590
|
this.config = config;
|
|
579
591
|
this.client = new ArtyfactsApiClient(
|
|
580
592
|
config.baseUrl || "https://artyfacts.dev/api/v1",
|
|
581
|
-
config.apiKey
|
|
593
|
+
config.apiKey,
|
|
594
|
+
config.agentId
|
|
582
595
|
);
|
|
583
596
|
this.server = new import_server.Server(
|
|
584
597
|
{
|
package/dist/server.d.cts
CHANGED
|
@@ -12,6 +12,8 @@ interface McpServerConfig {
|
|
|
12
12
|
apiKey: string;
|
|
13
13
|
/** Artyfacts API base URL */
|
|
14
14
|
baseUrl?: string;
|
|
15
|
+
/** Agent slug (e.g. 'chief-of-staff') — used to attribute writes to the correct agent */
|
|
16
|
+
agentId?: string;
|
|
15
17
|
/** Server name */
|
|
16
18
|
name?: string;
|
|
17
19
|
/** Server version */
|
package/dist/server.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ interface McpServerConfig {
|
|
|
12
12
|
apiKey: string;
|
|
13
13
|
/** Artyfacts API base URL */
|
|
14
14
|
baseUrl?: string;
|
|
15
|
+
/** Agent slug (e.g. 'chief-of-staff') — used to attribute writes to the correct agent */
|
|
16
|
+
agentId?: string;
|
|
15
17
|
/** Server name */
|
|
16
18
|
name?: string;
|
|
17
19
|
/** Server version */
|
package/dist/server.js
CHANGED
package/package.json
CHANGED
package/src/server.ts
CHANGED
|
@@ -22,6 +22,8 @@ export interface McpServerConfig {
|
|
|
22
22
|
apiKey: string;
|
|
23
23
|
/** Artyfacts API base URL */
|
|
24
24
|
baseUrl?: string;
|
|
25
|
+
/** Agent slug (e.g. 'chief-of-staff') — used to attribute writes to the correct agent */
|
|
26
|
+
agentId?: string;
|
|
25
27
|
/** Server name */
|
|
26
28
|
name?: string;
|
|
27
29
|
/** Server version */
|
|
@@ -104,6 +106,7 @@ const ARTYFACTS_TOOLS: Tool[] = [
|
|
|
104
106
|
title: { type: 'string', description: 'Artifact title' },
|
|
105
107
|
type: { type: 'string', description: 'Artifact type: goal, spec, research, report, experiment, decision, doc' },
|
|
106
108
|
content: { type: 'string', description: 'Markdown content' },
|
|
109
|
+
goal_id: { type: 'string', description: 'The goal UUID this artifact belongs to — always pass this when working on a task' },
|
|
107
110
|
parent_id: { type: 'string', description: 'Parent artifact ID for nested artifacts' },
|
|
108
111
|
tags: { type: 'array', items: { type: 'string' }, description: 'Tags for categorization' },
|
|
109
112
|
},
|
|
@@ -321,6 +324,7 @@ const ARTYFACTS_TOOLS: Tool[] = [
|
|
|
321
324
|
}
|
|
322
325
|
},
|
|
323
326
|
systemPrompt: { type: 'string', description: 'System prompt for the agent' },
|
|
327
|
+
reportsToAgentId: { type: 'string', description: 'Agent ID or UUID of the parent agent this agent reports to. Use agent slugs like "chief-of-staff" for readability.' },
|
|
324
328
|
},
|
|
325
329
|
required: ['agentId', 'name', 'role', 'description'],
|
|
326
330
|
},
|
|
@@ -423,18 +427,24 @@ const ARTYFACTS_TOOLS: Tool[] = [
|
|
|
423
427
|
class ArtyfactsApiClient {
|
|
424
428
|
constructor(
|
|
425
429
|
private baseUrl: string,
|
|
426
|
-
private apiKey: string
|
|
430
|
+
private apiKey: string,
|
|
431
|
+
private agentId?: string
|
|
427
432
|
) {}
|
|
428
433
|
|
|
429
434
|
async request(method: string, path: string, body?: unknown): Promise<unknown> {
|
|
430
435
|
const url = `${this.baseUrl}${path}`;
|
|
431
|
-
|
|
436
|
+
|
|
437
|
+
const headers: Record<string, string> = {
|
|
438
|
+
'Authorization': `Bearer ${this.apiKey}`,
|
|
439
|
+
'Content-Type': 'application/json',
|
|
440
|
+
};
|
|
441
|
+
if (this.agentId) {
|
|
442
|
+
headers['X-Agent-Id'] = this.agentId;
|
|
443
|
+
}
|
|
444
|
+
|
|
432
445
|
const response = await fetch(url, {
|
|
433
446
|
method,
|
|
434
|
-
headers
|
|
435
|
-
'Authorization': `Bearer ${this.apiKey}`,
|
|
436
|
-
'Content-Type': 'application/json',
|
|
437
|
-
},
|
|
447
|
+
headers,
|
|
438
448
|
body: body ? JSON.stringify(body) : undefined,
|
|
439
449
|
});
|
|
440
450
|
|
|
@@ -447,6 +457,7 @@ class ArtyfactsApiClient {
|
|
|
447
457
|
}
|
|
448
458
|
|
|
449
459
|
get(path: string) { return this.request('GET', path); }
|
|
460
|
+
getAgentId() { return this.agentId; }
|
|
450
461
|
post(path: string, body?: unknown) { return this.request('POST', path, body); }
|
|
451
462
|
patch(path: string, body?: unknown) { return this.request('PATCH', path, body); }
|
|
452
463
|
delete(path: string) { return this.request('DELETE', path); }
|
|
@@ -490,6 +501,7 @@ const toolHandlers: Record<string, ToolHandler> = {
|
|
|
490
501
|
title: args.title,
|
|
491
502
|
type: args.type || 'document/sectioned',
|
|
492
503
|
artifact_type: args.artifact_type || args.type || 'doc',
|
|
504
|
+
goal_id: args.goal_id,
|
|
493
505
|
parent_id: args.parent_id,
|
|
494
506
|
tags: args.tags,
|
|
495
507
|
},
|
|
@@ -498,7 +510,7 @@ const toolHandlers: Record<string, ToolHandler> = {
|
|
|
498
510
|
body: args.content,
|
|
499
511
|
} : undefined,
|
|
500
512
|
source: {
|
|
501
|
-
agent_id: 'mcp-agent',
|
|
513
|
+
agent_id: client.getAgentId() || 'mcp-agent',
|
|
502
514
|
},
|
|
503
515
|
};
|
|
504
516
|
return client.post('/artifacts', envelope);
|
|
@@ -559,6 +571,7 @@ const toolHandlers: Record<string, ToolHandler> = {
|
|
|
559
571
|
name: args.name,
|
|
560
572
|
role: args.role,
|
|
561
573
|
description: args.description,
|
|
574
|
+
reportsToAgentId: args.reportsToAgentId,
|
|
562
575
|
permissions: args.permissions || { write: true, delete: false, delegate_tasks: false },
|
|
563
576
|
metadata: {
|
|
564
577
|
capabilities: args.capabilities || [],
|
|
@@ -616,7 +629,8 @@ export class ArtyfactsMcpServer {
|
|
|
616
629
|
this.config = config;
|
|
617
630
|
this.client = new ArtyfactsApiClient(
|
|
618
631
|
config.baseUrl || 'https://artyfacts.dev/api/v1',
|
|
619
|
-
config.apiKey
|
|
632
|
+
config.apiKey,
|
|
633
|
+
config.agentId
|
|
620
634
|
);
|
|
621
635
|
|
|
622
636
|
this.server = new Server(
|