@artyfacts/claude 1.3.5 → 1.3.7
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/chunk-CNJCMX2D.mjs +787 -0
- package/dist/chunk-HD3C42LY.mjs +804 -0
- package/dist/cli.js +67 -18
- package/dist/cli.mjs +1 -1
- package/dist/index.js +67 -18
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/context.ts +24 -6
- package/src/executor.ts +48 -14
package/dist/cli.js
CHANGED
|
@@ -251,16 +251,34 @@ function buildPromptWithContext(context) {
|
|
|
251
251
|
|
|
252
252
|
Your job is to complete the assigned task. You have full context about the organization, project, and related work.
|
|
253
253
|
|
|
254
|
-
|
|
254
|
+
## Available Tools
|
|
255
|
+
|
|
256
|
+
You have access to Artyfacts MCP tools. USE THEM to complete your task:
|
|
257
|
+
|
|
258
|
+
- **create_artifact** - Create new artifacts (documents, specs, reports)
|
|
259
|
+
- **create_section** - Add sections to artifacts (content, tasks, decisions)
|
|
260
|
+
- **update_section** - Update existing sections
|
|
261
|
+
- **create_agent** - Create new AI agents with specific roles
|
|
262
|
+
- **list_artifacts** - Query existing artifacts
|
|
263
|
+
- **list_sections** - Query sections within an artifact
|
|
264
|
+
- **complete_task** - Mark a task as complete
|
|
265
|
+
- **block_task** - Block a task with a reason
|
|
266
|
+
- **create_blocker** - Create a decision blocker
|
|
267
|
+
|
|
268
|
+
IMPORTANT: When asked to create agents or update artifacts, USE THE TOOLS. Don't just describe what you would do - actually do it with the tools.
|
|
269
|
+
|
|
270
|
+
## Guidelines
|
|
271
|
+
|
|
255
272
|
- Be thorough but concise
|
|
256
|
-
-
|
|
257
|
-
- If the task requires
|
|
258
|
-
- If the task requires
|
|
273
|
+
- USE THE TOOLS to take action, don't just analyze
|
|
274
|
+
- If the task requires creating something, use create_artifact or create_section
|
|
275
|
+
- If the task requires creating agents, use create_agent
|
|
259
276
|
- If you cannot complete the task, explain why
|
|
260
277
|
|
|
261
278
|
Format your response as follows:
|
|
262
|
-
1. First,
|
|
263
|
-
2.
|
|
279
|
+
1. First, use the tools to complete the task
|
|
280
|
+
2. Then summarize what you did
|
|
281
|
+
3. End with a brief summary line starting with "SUMMARY:"`);
|
|
264
282
|
parts.push("");
|
|
265
283
|
parts.push("---");
|
|
266
284
|
parts.push("");
|
|
@@ -367,21 +385,35 @@ function createContextFetcher(config) {
|
|
|
367
385
|
var DEFAULT_TIMEOUT = 5 * 60 * 1e3;
|
|
368
386
|
var DEFAULT_SYSTEM_PROMPT = `You are an AI agent working within the Artyfacts task management system.
|
|
369
387
|
|
|
370
|
-
Your job is to complete tasks assigned to you
|
|
371
|
-
1. Understand the requirements from the task heading and content
|
|
372
|
-
2. Complete the task to the best of your ability
|
|
373
|
-
3. Provide a clear, actionable output
|
|
388
|
+
Your job is to complete tasks assigned to you using the available tools.
|
|
374
389
|
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
-
|
|
390
|
+
## Available Tools
|
|
391
|
+
|
|
392
|
+
You have access to Artyfacts MCP tools. USE THEM to complete your task:
|
|
393
|
+
|
|
394
|
+
- **create_artifact** - Create new artifacts (documents, specs, reports)
|
|
395
|
+
- **create_section** - Add sections to artifacts (content, tasks, decisions)
|
|
396
|
+
- **update_section** - Update existing sections
|
|
397
|
+
- **create_agent** - Create new AI agents with specific roles
|
|
398
|
+
- **list_artifacts** - Query existing artifacts
|
|
399
|
+
- **list_sections** - Query sections within an artifact
|
|
400
|
+
- **complete_task** - Mark a task as complete
|
|
401
|
+
- **block_task** - Block a task with a reason
|
|
402
|
+
- **create_blocker** - Create a decision blocker
|
|
403
|
+
|
|
404
|
+
IMPORTANT: When asked to create agents or update artifacts, USE THE TOOLS. Don't just describe what you would do - actually do it.
|
|
405
|
+
|
|
406
|
+
## Guidelines
|
|
407
|
+
|
|
408
|
+
- USE THE TOOLS to take action
|
|
409
|
+
- If creating something, use create_artifact or create_section
|
|
410
|
+
- If creating agents, use create_agent
|
|
380
411
|
- If you cannot complete the task, explain why
|
|
381
412
|
|
|
382
413
|
Format your response as follows:
|
|
383
|
-
1. First,
|
|
384
|
-
2.
|
|
414
|
+
1. First, use the tools to complete the task
|
|
415
|
+
2. Summarize what you accomplished
|
|
416
|
+
3. End with a brief summary line starting with "SUMMARY:"`;
|
|
385
417
|
var ClaudeExecutor = class {
|
|
386
418
|
config;
|
|
387
419
|
contextFetcher = null;
|
|
@@ -446,7 +478,24 @@ var ClaudeExecutor = class {
|
|
|
446
478
|
runClaude(prompt) {
|
|
447
479
|
return new Promise((resolve, reject) => {
|
|
448
480
|
const claudePath = this.config.claudePath || "claude";
|
|
449
|
-
const
|
|
481
|
+
const mcpConfig = {
|
|
482
|
+
mcpServers: {
|
|
483
|
+
artyfacts: {
|
|
484
|
+
command: "npx",
|
|
485
|
+
args: ["-y", "@artyfacts/mcp-server"],
|
|
486
|
+
env: {
|
|
487
|
+
ARTYFACTS_API_KEY: this.config.apiKey || process.env.ARTYFACTS_API_KEY || "",
|
|
488
|
+
ARTYFACTS_BASE_URL: this.config.baseUrl || "https://artyfacts.dev/api/v1"
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
};
|
|
493
|
+
const args = [
|
|
494
|
+
"--print",
|
|
495
|
+
"--mcp-config",
|
|
496
|
+
JSON.stringify(mcpConfig)
|
|
497
|
+
];
|
|
498
|
+
const proc = (0, import_child_process.spawn)(claudePath, args, {
|
|
450
499
|
stdio: ["pipe", "pipe", "pipe"],
|
|
451
500
|
timeout: this.config.timeout
|
|
452
501
|
});
|
package/dist/cli.mjs
CHANGED
package/dist/index.js
CHANGED
|
@@ -281,16 +281,34 @@ function buildPromptWithContext(context) {
|
|
|
281
281
|
|
|
282
282
|
Your job is to complete the assigned task. You have full context about the organization, project, and related work.
|
|
283
283
|
|
|
284
|
-
|
|
284
|
+
## Available Tools
|
|
285
|
+
|
|
286
|
+
You have access to Artyfacts MCP tools. USE THEM to complete your task:
|
|
287
|
+
|
|
288
|
+
- **create_artifact** - Create new artifacts (documents, specs, reports)
|
|
289
|
+
- **create_section** - Add sections to artifacts (content, tasks, decisions)
|
|
290
|
+
- **update_section** - Update existing sections
|
|
291
|
+
- **create_agent** - Create new AI agents with specific roles
|
|
292
|
+
- **list_artifacts** - Query existing artifacts
|
|
293
|
+
- **list_sections** - Query sections within an artifact
|
|
294
|
+
- **complete_task** - Mark a task as complete
|
|
295
|
+
- **block_task** - Block a task with a reason
|
|
296
|
+
- **create_blocker** - Create a decision blocker
|
|
297
|
+
|
|
298
|
+
IMPORTANT: When asked to create agents or update artifacts, USE THE TOOLS. Don't just describe what you would do - actually do it with the tools.
|
|
299
|
+
|
|
300
|
+
## Guidelines
|
|
301
|
+
|
|
285
302
|
- Be thorough but concise
|
|
286
|
-
-
|
|
287
|
-
- If the task requires
|
|
288
|
-
- If the task requires
|
|
303
|
+
- USE THE TOOLS to take action, don't just analyze
|
|
304
|
+
- If the task requires creating something, use create_artifact or create_section
|
|
305
|
+
- If the task requires creating agents, use create_agent
|
|
289
306
|
- If you cannot complete the task, explain why
|
|
290
307
|
|
|
291
308
|
Format your response as follows:
|
|
292
|
-
1. First,
|
|
293
|
-
2.
|
|
309
|
+
1. First, use the tools to complete the task
|
|
310
|
+
2. Then summarize what you did
|
|
311
|
+
3. End with a brief summary line starting with "SUMMARY:"`);
|
|
294
312
|
parts.push("");
|
|
295
313
|
parts.push("---");
|
|
296
314
|
parts.push("");
|
|
@@ -397,21 +415,35 @@ function createContextFetcher(config) {
|
|
|
397
415
|
var DEFAULT_TIMEOUT = 5 * 60 * 1e3;
|
|
398
416
|
var DEFAULT_SYSTEM_PROMPT = `You are an AI agent working within the Artyfacts task management system.
|
|
399
417
|
|
|
400
|
-
Your job is to complete tasks assigned to you
|
|
401
|
-
1. Understand the requirements from the task heading and content
|
|
402
|
-
2. Complete the task to the best of your ability
|
|
403
|
-
3. Provide a clear, actionable output
|
|
418
|
+
Your job is to complete tasks assigned to you using the available tools.
|
|
404
419
|
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
-
|
|
420
|
+
## Available Tools
|
|
421
|
+
|
|
422
|
+
You have access to Artyfacts MCP tools. USE THEM to complete your task:
|
|
423
|
+
|
|
424
|
+
- **create_artifact** - Create new artifacts (documents, specs, reports)
|
|
425
|
+
- **create_section** - Add sections to artifacts (content, tasks, decisions)
|
|
426
|
+
- **update_section** - Update existing sections
|
|
427
|
+
- **create_agent** - Create new AI agents with specific roles
|
|
428
|
+
- **list_artifacts** - Query existing artifacts
|
|
429
|
+
- **list_sections** - Query sections within an artifact
|
|
430
|
+
- **complete_task** - Mark a task as complete
|
|
431
|
+
- **block_task** - Block a task with a reason
|
|
432
|
+
- **create_blocker** - Create a decision blocker
|
|
433
|
+
|
|
434
|
+
IMPORTANT: When asked to create agents or update artifacts, USE THE TOOLS. Don't just describe what you would do - actually do it.
|
|
435
|
+
|
|
436
|
+
## Guidelines
|
|
437
|
+
|
|
438
|
+
- USE THE TOOLS to take action
|
|
439
|
+
- If creating something, use create_artifact or create_section
|
|
440
|
+
- If creating agents, use create_agent
|
|
410
441
|
- If you cannot complete the task, explain why
|
|
411
442
|
|
|
412
443
|
Format your response as follows:
|
|
413
|
-
1. First,
|
|
414
|
-
2.
|
|
444
|
+
1. First, use the tools to complete the task
|
|
445
|
+
2. Summarize what you accomplished
|
|
446
|
+
3. End with a brief summary line starting with "SUMMARY:"`;
|
|
415
447
|
var ClaudeExecutor = class {
|
|
416
448
|
config;
|
|
417
449
|
contextFetcher = null;
|
|
@@ -476,7 +508,24 @@ var ClaudeExecutor = class {
|
|
|
476
508
|
runClaude(prompt) {
|
|
477
509
|
return new Promise((resolve, reject) => {
|
|
478
510
|
const claudePath = this.config.claudePath || "claude";
|
|
479
|
-
const
|
|
511
|
+
const mcpConfig = {
|
|
512
|
+
mcpServers: {
|
|
513
|
+
artyfacts: {
|
|
514
|
+
command: "npx",
|
|
515
|
+
args: ["-y", "@artyfacts/mcp-server"],
|
|
516
|
+
env: {
|
|
517
|
+
ARTYFACTS_API_KEY: this.config.apiKey || process.env.ARTYFACTS_API_KEY || "",
|
|
518
|
+
ARTYFACTS_BASE_URL: this.config.baseUrl || "https://artyfacts.dev/api/v1"
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
};
|
|
523
|
+
const args = [
|
|
524
|
+
"--print",
|
|
525
|
+
"--mcp-config",
|
|
526
|
+
JSON.stringify(mcpConfig)
|
|
527
|
+
];
|
|
528
|
+
const proc = (0, import_child_process.spawn)(claudePath, args, {
|
|
480
529
|
stdio: ["pipe", "pipe", "pipe"],
|
|
481
530
|
timeout: this.config.timeout
|
|
482
531
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
promptForApiKey,
|
|
13
13
|
runDeviceAuth,
|
|
14
14
|
saveCredentials
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-HD3C42LY.mjs";
|
|
16
16
|
|
|
17
17
|
// node_modules/@anthropic-ai/sdk/internal/tslib.mjs
|
|
18
18
|
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
package/package.json
CHANGED
package/src/context.ts
CHANGED
|
@@ -108,16 +108,34 @@ export function buildPromptWithContext(context: TaskFullContext): string {
|
|
|
108
108
|
|
|
109
109
|
Your job is to complete the assigned task. You have full context about the organization, project, and related work.
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
## Available Tools
|
|
112
|
+
|
|
113
|
+
You have access to Artyfacts MCP tools. USE THEM to complete your task:
|
|
114
|
+
|
|
115
|
+
- **create_artifact** - Create new artifacts (documents, specs, reports)
|
|
116
|
+
- **create_section** - Add sections to artifacts (content, tasks, decisions)
|
|
117
|
+
- **update_section** - Update existing sections
|
|
118
|
+
- **create_agent** - Create new AI agents with specific roles
|
|
119
|
+
- **list_artifacts** - Query existing artifacts
|
|
120
|
+
- **list_sections** - Query sections within an artifact
|
|
121
|
+
- **complete_task** - Mark a task as complete
|
|
122
|
+
- **block_task** - Block a task with a reason
|
|
123
|
+
- **create_blocker** - Create a decision blocker
|
|
124
|
+
|
|
125
|
+
IMPORTANT: When asked to create agents or update artifacts, USE THE TOOLS. Don't just describe what you would do - actually do it with the tools.
|
|
126
|
+
|
|
127
|
+
## Guidelines
|
|
128
|
+
|
|
112
129
|
- Be thorough but concise
|
|
113
|
-
-
|
|
114
|
-
- If the task requires
|
|
115
|
-
- If the task requires
|
|
130
|
+
- USE THE TOOLS to take action, don't just analyze
|
|
131
|
+
- If the task requires creating something, use create_artifact or create_section
|
|
132
|
+
- If the task requires creating agents, use create_agent
|
|
116
133
|
- If you cannot complete the task, explain why
|
|
117
134
|
|
|
118
135
|
Format your response as follows:
|
|
119
|
-
1. First,
|
|
120
|
-
2.
|
|
136
|
+
1. First, use the tools to complete the task
|
|
137
|
+
2. Then summarize what you did
|
|
138
|
+
3. End with a brief summary line starting with "SUMMARY:"`);
|
|
121
139
|
|
|
122
140
|
parts.push('');
|
|
123
141
|
parts.push('---');
|
package/src/executor.ts
CHANGED
|
@@ -68,21 +68,35 @@ const DEFAULT_TIMEOUT = 5 * 60 * 1000; // 5 minutes
|
|
|
68
68
|
|
|
69
69
|
const DEFAULT_SYSTEM_PROMPT = `You are an AI agent working within the Artyfacts task management system.
|
|
70
70
|
|
|
71
|
-
Your job is to complete tasks assigned to you
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
71
|
+
Your job is to complete tasks assigned to you using the available tools.
|
|
72
|
+
|
|
73
|
+
## Available Tools
|
|
74
|
+
|
|
75
|
+
You have access to Artyfacts MCP tools. USE THEM to complete your task:
|
|
76
|
+
|
|
77
|
+
- **create_artifact** - Create new artifacts (documents, specs, reports)
|
|
78
|
+
- **create_section** - Add sections to artifacts (content, tasks, decisions)
|
|
79
|
+
- **update_section** - Update existing sections
|
|
80
|
+
- **create_agent** - Create new AI agents with specific roles
|
|
81
|
+
- **list_artifacts** - Query existing artifacts
|
|
82
|
+
- **list_sections** - Query sections within an artifact
|
|
83
|
+
- **complete_task** - Mark a task as complete
|
|
84
|
+
- **block_task** - Block a task with a reason
|
|
85
|
+
- **create_blocker** - Create a decision blocker
|
|
86
|
+
|
|
87
|
+
IMPORTANT: When asked to create agents or update artifacts, USE THE TOOLS. Don't just describe what you would do - actually do it.
|
|
88
|
+
|
|
89
|
+
## Guidelines
|
|
90
|
+
|
|
91
|
+
- USE THE TOOLS to take action
|
|
92
|
+
- If creating something, use create_artifact or create_section
|
|
93
|
+
- If creating agents, use create_agent
|
|
81
94
|
- If you cannot complete the task, explain why
|
|
82
95
|
|
|
83
96
|
Format your response as follows:
|
|
84
|
-
1. First,
|
|
85
|
-
2.
|
|
97
|
+
1. First, use the tools to complete the task
|
|
98
|
+
2. Summarize what you accomplished
|
|
99
|
+
3. End with a brief summary line starting with "SUMMARY:"`;
|
|
86
100
|
|
|
87
101
|
// ============================================================================
|
|
88
102
|
// Executor Class
|
|
@@ -167,9 +181,29 @@ export class ClaudeExecutor {
|
|
|
167
181
|
return new Promise((resolve, reject) => {
|
|
168
182
|
const claudePath = this.config.claudePath || 'claude';
|
|
169
183
|
|
|
184
|
+
// Build MCP config for Artyfacts tools
|
|
185
|
+
// claude --print doesn't auto-load MCP servers, so we pass them explicitly
|
|
186
|
+
const mcpConfig = {
|
|
187
|
+
mcpServers: {
|
|
188
|
+
artyfacts: {
|
|
189
|
+
command: 'npx',
|
|
190
|
+
args: ['-y', '@artyfacts/mcp-server'],
|
|
191
|
+
env: {
|
|
192
|
+
ARTYFACTS_API_KEY: this.config.apiKey || process.env.ARTYFACTS_API_KEY || '',
|
|
193
|
+
ARTYFACTS_BASE_URL: this.config.baseUrl || 'https://artyfacts.dev/api/v1',
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
};
|
|
198
|
+
|
|
170
199
|
// Use claude CLI with --print flag for non-interactive output
|
|
171
|
-
// Pass
|
|
172
|
-
const
|
|
200
|
+
// Pass MCP config to enable Artyfacts tools
|
|
201
|
+
const args = [
|
|
202
|
+
'--print',
|
|
203
|
+
'--mcp-config', JSON.stringify(mcpConfig),
|
|
204
|
+
];
|
|
205
|
+
|
|
206
|
+
const proc = spawn(claudePath, args, {
|
|
173
207
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
174
208
|
timeout: this.config.timeout,
|
|
175
209
|
});
|