@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/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
- Guidelines:
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
- - If the task requires code, provide working code
257
- - If the task requires analysis, provide structured findings
258
- - If the task requires a decision, explain your reasoning
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, provide your main output (the task deliverable)
263
- 2. End with a brief summary line starting with "SUMMARY:"`);
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. For each task:
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
- Guidelines:
376
- - Be thorough but concise
377
- - If the task requires code, provide working code
378
- - If the task requires analysis, provide structured findings
379
- - If the task requires a decision, explain your reasoning
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, provide your main output (the task deliverable)
384
- 2. End with a brief summary line starting with "SUMMARY:"`;
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 proc = (0, import_child_process.spawn)(claudePath, ["--print"], {
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
@@ -6,7 +6,7 @@ import {
6
6
  getCredentials,
7
7
  loadCredentials,
8
8
  promptForApiKey
9
- } from "./chunk-7ULDABOE.mjs";
9
+ } from "./chunk-HD3C42LY.mjs";
10
10
 
11
11
  // src/cli.ts
12
12
  import { Command } from "commander";
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
- Guidelines:
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
- - If the task requires code, provide working code
287
- - If the task requires analysis, provide structured findings
288
- - If the task requires a decision, explain your reasoning
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, provide your main output (the task deliverable)
293
- 2. End with a brief summary line starting with "SUMMARY:"`);
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. For each task:
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
- Guidelines:
406
- - Be thorough but concise
407
- - If the task requires code, provide working code
408
- - If the task requires analysis, provide structured findings
409
- - If the task requires a decision, explain your reasoning
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, provide your main output (the task deliverable)
414
- 2. End with a brief summary line starting with "SUMMARY:"`;
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 proc = (0, import_child_process.spawn)(claudePath, ["--print"], {
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-7ULDABOE.mjs";
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artyfacts/claude",
3
- "version": "1.3.5",
3
+ "version": "1.3.7",
4
4
  "description": "Claude adapter for Artyfacts - Execute tasks using Claude Code CLI",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
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
- Guidelines:
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
- - If the task requires code, provide working code
114
- - If the task requires analysis, provide structured findings
115
- - If the task requires a decision, explain your reasoning
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, provide your main output (the task deliverable)
120
- 2. End with a brief summary line starting with "SUMMARY:"`);
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. For each task:
72
- 1. Understand the requirements from the task heading and content
73
- 2. Complete the task to the best of your ability
74
- 3. Provide a clear, actionable output
75
-
76
- Guidelines:
77
- - Be thorough but concise
78
- - If the task requires code, provide working code
79
- - If the task requires analysis, provide structured findings
80
- - If the task requires a decision, explain your reasoning
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, provide your main output (the task deliverable)
85
- 2. End with a brief summary line starting with "SUMMARY:"`;
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 prompt via stdin
172
- const proc = spawn(claudePath, ['--print'], {
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
  });