@specforge/mcp 3.3.5 → 3.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/autopilot/cli/index.js +1 -1
- package/dist/autopilot/cli/index.js.map +1 -1
- package/dist/tools/core/epic.d.ts.map +1 -1
- package/dist/tools/core/epic.js +1 -0
- package/dist/tools/core/epic.js.map +1 -1
- package/dist/tools/core/specification.d.ts.map +1 -1
- package/dist/tools/core/specification.js +1 -0
- package/dist/tools/core/specification.js.map +1 -1
- package/dist/tools/core/ticket.d.ts.map +1 -1
- package/dist/tools/core/ticket.js +1 -0
- package/dist/tools/core/ticket.js.map +1 -1
- package/package.json +1 -1
- package/dist/cli/templates/agents/content/core/sfag-implementer.d.ts +0 -8
- package/dist/cli/templates/agents/content/core/sfag-implementer.d.ts.map +0 -1
- package/dist/cli/templates/agents/content/core/sfag-implementer.js +0 -111
- package/dist/cli/templates/agents/content/core/sfag-implementer.js.map +0 -1
- package/dist/cli/templates/agents/content/task-type/sfag-api-implementer.d.ts +0 -8
- package/dist/cli/templates/agents/content/task-type/sfag-api-implementer.d.ts.map +0 -1
- package/dist/cli/templates/agents/content/task-type/sfag-api-implementer.js +0 -130
- package/dist/cli/templates/agents/content/task-type/sfag-api-implementer.js.map +0 -1
- package/dist/cli/templates/agents/content/task-type/sfag-docs-writer.d.ts +0 -8
- package/dist/cli/templates/agents/content/task-type/sfag-docs-writer.d.ts.map +0 -1
- package/dist/cli/templates/agents/content/task-type/sfag-docs-writer.js +0 -181
- package/dist/cli/templates/agents/content/task-type/sfag-docs-writer.js.map +0 -1
- package/dist/cli/templates/agents/content/task-type/sfag-frontend-builder.d.ts +0 -8
- package/dist/cli/templates/agents/content/task-type/sfag-frontend-builder.d.ts.map +0 -1
- package/dist/cli/templates/agents/content/task-type/sfag-frontend-builder.js +0 -139
- package/dist/cli/templates/agents/content/task-type/sfag-frontend-builder.js.map +0 -1
- package/dist/cli/templates/agents/content/task-type/sfag-infra-architect.d.ts +0 -8
- package/dist/cli/templates/agents/content/task-type/sfag-infra-architect.d.ts.map +0 -1
- package/dist/cli/templates/agents/content/task-type/sfag-infra-architect.js +0 -147
- package/dist/cli/templates/agents/content/task-type/sfag-infra-architect.js.map +0 -1
- package/dist/cli/templates/agents/content/task-type/sfag-schema-designer.d.ts +0 -8
- package/dist/cli/templates/agents/content/task-type/sfag-schema-designer.d.ts.map +0 -1
- package/dist/cli/templates/agents/content/task-type/sfag-schema-designer.js +0 -130
- package/dist/cli/templates/agents/content/task-type/sfag-schema-designer.js.map +0 -1
- package/dist/cli/templates/agents/content/task-type/sfag-test-writer.d.ts +0 -8
- package/dist/cli/templates/agents/content/task-type/sfag-test-writer.d.ts.map +0 -1
- package/dist/cli/templates/agents/content/task-type/sfag-test-writer.js +0 -169
- package/dist/cli/templates/agents/content/task-type/sfag-test-writer.js.map +0 -1
- package/dist/cli/templates/content/sf-autonomous.d.ts +0 -7
- package/dist/cli/templates/content/sf-autonomous.d.ts.map +0 -1
- package/dist/cli/templates/content/sf-autonomous.js +0 -78
- package/dist/cli/templates/content/sf-autonomous.js.map +0 -1
- package/dist/cli/templates/content/sf-create-epics.d.ts +0 -7
- package/dist/cli/templates/content/sf-create-epics.d.ts.map +0 -1
- package/dist/cli/templates/content/sf-create-epics.js +0 -129
- package/dist/cli/templates/content/sf-create-epics.js.map +0 -1
- package/dist/cli/templates/content/sf-create-spec.d.ts +0 -7
- package/dist/cli/templates/content/sf-create-spec.d.ts.map +0 -1
- package/dist/cli/templates/content/sf-create-spec.js +0 -136
- package/dist/cli/templates/content/sf-create-spec.js.map +0 -1
- package/dist/cli/templates/content/sf-create-tickets.d.ts +0 -7
- package/dist/cli/templates/content/sf-create-tickets.d.ts.map +0 -1
- package/dist/cli/templates/content/sf-create-tickets.js +0 -148
- package/dist/cli/templates/content/sf-create-tickets.js.map +0 -1
- package/dist/cli/templates/content/sf-epic.d.ts +0 -7
- package/dist/cli/templates/content/sf-epic.d.ts.map +0 -1
- package/dist/cli/templates/content/sf-epic.js +0 -69
- package/dist/cli/templates/content/sf-epic.js.map +0 -1
- package/dist/cli/templates/content/sf-import.d.ts +0 -7
- package/dist/cli/templates/content/sf-import.d.ts.map +0 -1
- package/dist/cli/templates/content/sf-import.js +0 -88
- package/dist/cli/templates/content/sf-import.js.map +0 -1
- package/dist/cli/templates/content/sf-next.d.ts +0 -7
- package/dist/cli/templates/content/sf-next.d.ts.map +0 -1
- package/dist/cli/templates/content/sf-next.js +0 -67
- package/dist/cli/templates/content/sf-next.js.map +0 -1
- package/dist/cli/templates/content/sf-review.d.ts +0 -7
- package/dist/cli/templates/content/sf-review.d.ts.map +0 -1
- package/dist/cli/templates/content/sf-review.js +0 -67
- package/dist/cli/templates/content/sf-review.js.map +0 -1
- package/dist/cli/templates/content/sf-ticket.d.ts +0 -7
- package/dist/cli/templates/content/sf-ticket.d.ts.map +0 -1
- package/dist/cli/templates/content/sf-ticket.js +0 -76
- package/dist/cli/templates/content/sf-ticket.js.map +0 -1
- package/dist/cli/templates/content/sf-validate.d.ts +0 -7
- package/dist/cli/templates/content/sf-validate.d.ts.map +0 -1
- package/dist/cli/templates/content/sf-validate.js +0 -78
- package/dist/cli/templates/content/sf-validate.js.map +0 -1
- package/dist/tools/core/context.d.ts +0 -7
- package/dist/tools/core/context.d.ts.map +0 -1
- package/dist/tools/core/context.js +0 -75
- package/dist/tools/core/context.js.map +0 -1
- package/dist/tools/core/job.d.ts +0 -7
- package/dist/tools/core/job.d.ts.map +0 -1
- package/dist/tools/core/job.js +0 -50
- package/dist/tools/core/job.js.map +0 -1
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SF-Validate Command Template
|
|
3
|
-
*
|
|
4
|
-
* Template for validating ticket system health.
|
|
5
|
-
*/
|
|
6
|
-
export const SF_VALIDATE_CONTENT = `# Validate Ticket System (SpecForge)
|
|
7
|
-
|
|
8
|
-
Run comprehensive health checks on the ticket system.
|
|
9
|
-
|
|
10
|
-
## Arguments
|
|
11
|
-
- \`$ARGUMENTS\` - Optional: Specification ID to validate
|
|
12
|
-
|
|
13
|
-
## Task
|
|
14
|
-
|
|
15
|
-
### 1. Get Specification Context
|
|
16
|
-
|
|
17
|
-
**MCP Calls:**
|
|
18
|
-
\`\`\`typescript
|
|
19
|
-
get_working_context()
|
|
20
|
-
|
|
21
|
-
if ($ARGUMENTS) {
|
|
22
|
-
set_working_context({ specificationId: "$ARGUMENTS" })
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
get_specification(specificationId)
|
|
26
|
-
\`\`\`
|
|
27
|
-
|
|
28
|
-
### 2. Load and Validate Data
|
|
29
|
-
|
|
30
|
-
**MCP Calls:**
|
|
31
|
-
\`\`\`typescript
|
|
32
|
-
list_epics({ specificationId })
|
|
33
|
-
list_tickets({ specificationId })
|
|
34
|
-
|
|
35
|
-
// Validate each ticket
|
|
36
|
-
for (const ticket of tickets) {
|
|
37
|
-
get_ticket(ticket.id)
|
|
38
|
-
// Check dependencies, status, fields
|
|
39
|
-
}
|
|
40
|
-
\`\`\`
|
|
41
|
-
|
|
42
|
-
### 3. Display Validation Results
|
|
43
|
-
|
|
44
|
-
**Output:**
|
|
45
|
-
\`\`\`
|
|
46
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
47
|
-
SYSTEM VALIDATION
|
|
48
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
49
|
-
Specification: {title}
|
|
50
|
-
|
|
51
|
-
CHECKS
|
|
52
|
-
─────────────────────────────────────────────────────────────────
|
|
53
|
-
✓ All epics have valid structure
|
|
54
|
-
✓ All tickets have required fields
|
|
55
|
-
✓ Dependency graph is acyclic
|
|
56
|
-
✓ Status transitions are valid
|
|
57
|
-
✓ No orphaned tickets
|
|
58
|
-
|
|
59
|
-
WARNINGS
|
|
60
|
-
─────────────────────────────────────────────────────────────────
|
|
61
|
-
⚠ E{n}-T{m}: Missing acceptance criteria
|
|
62
|
-
⚠ E{n}-T{m}: Long dependency chain (depth {n})
|
|
63
|
-
|
|
64
|
-
ERRORS
|
|
65
|
-
─────────────────────────────────────────────────────────────────
|
|
66
|
-
✗ E{n}-T{m}: Circular dependency detected
|
|
67
|
-
✗ E{n}-T{m}: Invalid dependency reference
|
|
68
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
69
|
-
|
|
70
|
-
Status: {errors ? 'FAILED' : 'PASSED'}
|
|
71
|
-
\`\`\`
|
|
72
|
-
|
|
73
|
-
## Notes
|
|
74
|
-
- Checks dependency graph integrity
|
|
75
|
-
- Validates ticket structure and fields
|
|
76
|
-
- Reports warnings and errors
|
|
77
|
-
`;
|
|
78
|
-
//# sourceMappingURL=sf-validate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sf-validate.js","sourceRoot":"","sources":["../../../../src/cli/templates/content/sf-validate.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuElC,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
-
import { ConsolidatedToolArgs, OperationHandler } from './types.js';
|
|
3
|
-
import { ApiClient } from '../../client/api-client.js';
|
|
4
|
-
export declare const contextTool: Tool;
|
|
5
|
-
export declare function createContextOperations(apiClient: ApiClient): Record<string, OperationHandler>;
|
|
6
|
-
export declare function createContextHandler(apiClient: ApiClient): (args: ConsolidatedToolArgs, userId: string) => Promise<unknown>;
|
|
7
|
-
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/tools/core/context.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAE1D,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD,eAAO,MAAM,WAAW,EAAE,IA+BzB,CAAC;AAUF,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAgC9F;AAED,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,SAAS,oEAGxD"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
// mcp/src/tools/core/context.ts
|
|
2
|
-
import { createOperationRouter } from './router.js';
|
|
3
|
-
export const contextTool = {
|
|
4
|
-
name: 'context',
|
|
5
|
-
description: `Get and manage context. Operations:
|
|
6
|
-
- working: Get current working context (project scope)
|
|
7
|
-
- implementation: Get implementation context for a ticket
|
|
8
|
-
- set: Set/update current working context`,
|
|
9
|
-
inputSchema: {
|
|
10
|
-
type: 'object',
|
|
11
|
-
properties: {
|
|
12
|
-
operation: {
|
|
13
|
-
type: 'string',
|
|
14
|
-
enum: ['working', 'implementation', 'set'],
|
|
15
|
-
description: 'The operation to perform',
|
|
16
|
-
},
|
|
17
|
-
// For set working context
|
|
18
|
-
projectId: { type: 'string', description: 'Project ID' },
|
|
19
|
-
specificationId: { type: 'string', description: 'Specification ID' },
|
|
20
|
-
epicId: { type: 'string', description: 'Epic ID' },
|
|
21
|
-
// For implementation context
|
|
22
|
-
ticketId: { type: 'string', description: 'Ticket ID for implementation context' },
|
|
23
|
-
depth: {
|
|
24
|
-
type: 'string',
|
|
25
|
-
enum: ['minimal', 'standard', 'full'],
|
|
26
|
-
description: 'Context depth level',
|
|
27
|
-
},
|
|
28
|
-
// Response options
|
|
29
|
-
format: { type: 'string', enum: ['json', 'toon'] },
|
|
30
|
-
responseMode: { type: 'string', enum: ['full', 'minimal', 'summary', 'id-only'] },
|
|
31
|
-
},
|
|
32
|
-
required: ['operation'],
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
function validateRequired(args, ...fields) {
|
|
36
|
-
for (const field of fields) {
|
|
37
|
-
if (args[field] === undefined || args[field] === null || args[field] === '') {
|
|
38
|
-
throw new Error(`${field} is required`);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
export function createContextOperations(apiClient) {
|
|
43
|
-
return {
|
|
44
|
-
working: async (_args, _userId) => {
|
|
45
|
-
// Note: In actual implementation, this uses client.getSessionId()
|
|
46
|
-
// For the consolidated tool, we pass through to the API
|
|
47
|
-
return await apiClient.call('get_working_context', {});
|
|
48
|
-
},
|
|
49
|
-
implementation: async (args, _userId) => {
|
|
50
|
-
validateRequired(args, 'ticketId');
|
|
51
|
-
const depth = args.depth || 'standard';
|
|
52
|
-
return await apiClient.call('get_implementation_context', {
|
|
53
|
-
ticketId: args.ticketId,
|
|
54
|
-
depth,
|
|
55
|
-
});
|
|
56
|
-
},
|
|
57
|
-
set: async (args, _userId) => {
|
|
58
|
-
// At least one context field should be provided
|
|
59
|
-
if (!args.projectId && !args.specificationId && !args.epicId && !args.ticketId) {
|
|
60
|
-
throw new Error('At least one of projectId, specificationId, epicId, or ticketId is required');
|
|
61
|
-
}
|
|
62
|
-
return await apiClient.call('set_working_context', {
|
|
63
|
-
projectId: args.projectId,
|
|
64
|
-
specificationId: args.specificationId,
|
|
65
|
-
epicId: args.epicId,
|
|
66
|
-
ticketId: args.ticketId,
|
|
67
|
-
});
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
export function createContextHandler(apiClient) {
|
|
72
|
-
const operations = createContextOperations(apiClient);
|
|
73
|
-
return createOperationRouter('context', operations);
|
|
74
|
-
}
|
|
75
|
-
//# sourceMappingURL=context.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","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EAAE,IAAI,CAAC,MAAM;gBACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ;aACxB,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,SAAoB;IACvD,MAAM,UAAU,GAAG,uBAAuB,CAAC,SAAS,CAAC,CAAC;IACtD,OAAO,qBAAqB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;AACtD,CAAC"}
|
package/dist/tools/core/job.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
-
import { ConsolidatedToolArgs, OperationHandler } from './types.js';
|
|
3
|
-
import { ApiClient } from '../../client/api-client.js';
|
|
4
|
-
export declare const jobTool: Tool;
|
|
5
|
-
export declare function createJobOperations(apiClient: ApiClient): Record<string, OperationHandler>;
|
|
6
|
-
export declare function createJobHandler(apiClient: ApiClient): (args: ConsolidatedToolArgs, userId: string) => Promise<unknown>;
|
|
7
|
-
//# sourceMappingURL=job.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"job.d.ts","sourceRoot":"","sources":["../../../src/tools/core/job.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAE1D,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD,eAAO,MAAM,OAAO,EAAE,IAmBrB,CAAC;AAUF,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAgB1F;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,SAAS,oEAGpD"}
|
package/dist/tools/core/job.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
// mcp/src/tools/core/job.ts
|
|
2
|
-
import { createOperationRouter } from './router.js';
|
|
3
|
-
export const jobTool = {
|
|
4
|
-
name: 'job',
|
|
5
|
-
description: `Manage async jobs. Operations:
|
|
6
|
-
- status: Get job status
|
|
7
|
-
- cancel: Cancel a running job`,
|
|
8
|
-
inputSchema: {
|
|
9
|
-
type: 'object',
|
|
10
|
-
properties: {
|
|
11
|
-
operation: {
|
|
12
|
-
type: 'string',
|
|
13
|
-
enum: ['status', 'cancel'],
|
|
14
|
-
description: 'The operation to perform',
|
|
15
|
-
},
|
|
16
|
-
jobId: { type: 'string', description: 'Job ID' },
|
|
17
|
-
// Response options
|
|
18
|
-
format: { type: 'string', enum: ['json', 'toon'] },
|
|
19
|
-
},
|
|
20
|
-
required: ['operation'],
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
function validateRequired(args, ...fields) {
|
|
24
|
-
for (const field of fields) {
|
|
25
|
-
if (args[field] === undefined || args[field] === null || args[field] === '') {
|
|
26
|
-
throw new Error(`${field} is required`);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
export function createJobOperations(apiClient) {
|
|
31
|
-
return {
|
|
32
|
-
status: async (args, _userId) => {
|
|
33
|
-
validateRequired(args, 'jobId');
|
|
34
|
-
return await apiClient.call('get_job_status', {
|
|
35
|
-
jobId: args.jobId,
|
|
36
|
-
});
|
|
37
|
-
},
|
|
38
|
-
cancel: async (args, _userId) => {
|
|
39
|
-
validateRequired(args, 'jobId');
|
|
40
|
-
return await apiClient.call('cancel_job', {
|
|
41
|
-
jobId: args.jobId,
|
|
42
|
-
});
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
export function createJobHandler(apiClient) {
|
|
47
|
-
const operations = createJobOperations(apiClient);
|
|
48
|
-
return createOperationRouter('job', operations);
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=job.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"job.js","sourceRoot":"","sources":["../../../src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