@deimoscloud/coreai 0.1.9 → 0.1.10
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/index.js +1 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +6 -1
- package/.prettierrc +0 -9
- package/AGENT_SPEC.md +0 -347
- package/ARCHITECTURE.md +0 -547
- package/DRAFT_PRD.md +0 -1440
- package/IMPLEMENTATION_PLAN.md +0 -256
- package/PRODUCT.md +0 -473
- package/WORKFLOWS.md +0 -295
- package/commands/core/check-inbox.md +0 -34
- package/commands/core/delegate.md +0 -30
- package/commands/core/git-commit.md +0 -144
- package/commands/core/pr-create.md +0 -193
- package/commands/core/review.md +0 -56
- package/commands/core/sprint-status.md +0 -65
- package/commands/optional/docs-update.md +0 -200
- package/commands/optional/jira-create.md +0 -200
- package/commands/optional/jira-transition.md +0 -184
- package/commands/optional/worktree-cleanup.md +0 -167
- package/commands/optional/worktree-setup.md +0 -110
- package/eslint.config.js +0 -29
- package/jest.config.js +0 -22
- package/knowledge-library/README.md +0 -118
- package/knowledge-library/android-engineer/context/current.txt +0 -42
- package/knowledge-library/android-engineer/control/decisions.txt +0 -9
- package/knowledge-library/android-engineer/control/dependencies.txt +0 -19
- package/knowledge-library/android-engineer/control/objectives.txt +0 -26
- package/knowledge-library/android-engineer/history/.gitkeep +0 -0
- package/knowledge-library/android-engineer/inbox/processed/.gitkeep +0 -0
- package/knowledge-library/android-engineer/outbox/.gitkeep +0 -0
- package/knowledge-library/android-engineer/tech/.gitkeep +0 -0
- package/knowledge-library/architecture.txt +0 -61
- package/knowledge-library/backend-engineer/context/current.txt +0 -42
- package/knowledge-library/backend-engineer/control/decisions.txt +0 -9
- package/knowledge-library/backend-engineer/control/dependencies.txt +0 -19
- package/knowledge-library/backend-engineer/control/objectives.txt +0 -26
- package/knowledge-library/backend-engineer/history/.gitkeep +0 -0
- package/knowledge-library/backend-engineer/inbox/processed/.gitkeep +0 -0
- package/knowledge-library/backend-engineer/outbox/.gitkeep +0 -0
- package/knowledge-library/backend-engineer/tech/.gitkeep +0 -0
- package/knowledge-library/context.txt +0 -52
- package/knowledge-library/devops-engineer/context/current.txt +0 -42
- package/knowledge-library/devops-engineer/control/decisions.txt +0 -9
- package/knowledge-library/devops-engineer/control/dependencies.txt +0 -19
- package/knowledge-library/devops-engineer/control/objectives.txt +0 -26
- package/knowledge-library/devops-engineer/history/.gitkeep +0 -0
- package/knowledge-library/devops-engineer/inbox/processed/.gitkeep +0 -0
- package/knowledge-library/devops-engineer/outbox/.gitkeep +0 -0
- package/knowledge-library/devops-engineer/tech/.gitkeep +0 -0
- package/knowledge-library/engineering-manager/context/current.txt +0 -40
- package/knowledge-library/engineering-manager/control/decisions.txt +0 -9
- package/knowledge-library/engineering-manager/control/objectives.txt +0 -27
- package/knowledge-library/engineering-manager/history/.gitkeep +0 -0
- package/knowledge-library/engineering-manager/inbox/processed/.gitkeep +0 -0
- package/knowledge-library/engineering-manager/outbox/.gitkeep +0 -0
- package/knowledge-library/engineering-manager/tech/.gitkeep +0 -0
- package/knowledge-library/prd.txt +0 -81
- package/knowledge-library/product-manager/context/current.txt +0 -42
- package/knowledge-library/product-manager/control/decisions.txt +0 -9
- package/knowledge-library/product-manager/control/dependencies.txt +0 -19
- package/knowledge-library/product-manager/control/objectives.txt +0 -26
- package/knowledge-library/product-manager/history/.gitkeep +0 -0
- package/knowledge-library/product-manager/inbox/processed/.gitkeep +0 -0
- package/knowledge-library/product-manager/outbox/.gitkeep +0 -0
- package/knowledge-library/product-manager/tech/.gitkeep +0 -0
- package/knowledge-library/qa-engineer/context/current.txt +0 -42
- package/knowledge-library/qa-engineer/control/decisions.txt +0 -9
- package/knowledge-library/qa-engineer/control/dependencies.txt +0 -19
- package/knowledge-library/qa-engineer/control/objectives.txt +0 -26
- package/knowledge-library/qa-engineer/history/.gitkeep +0 -0
- package/knowledge-library/qa-engineer/inbox/processed/.gitkeep +0 -0
- package/knowledge-library/qa-engineer/outbox/.gitkeep +0 -0
- package/knowledge-library/qa-engineer/tech/.gitkeep +0 -0
- package/knowledge-library/security-engineer/context/current.txt +0 -42
- package/knowledge-library/security-engineer/control/decisions.txt +0 -9
- package/knowledge-library/security-engineer/control/dependencies.txt +0 -19
- package/knowledge-library/security-engineer/control/objectives.txt +0 -26
- package/knowledge-library/security-engineer/history/.gitkeep +0 -0
- package/knowledge-library/security-engineer/inbox/processed/.gitkeep +0 -0
- package/knowledge-library/security-engineer/outbox/.gitkeep +0 -0
- package/knowledge-library/security-engineer/tech/.gitkeep +0 -0
- package/knowledge-library/solutions-architect/context/current.txt +0 -42
- package/knowledge-library/solutions-architect/control/decisions.txt +0 -9
- package/knowledge-library/solutions-architect/control/dependencies.txt +0 -19
- package/knowledge-library/solutions-architect/control/objectives.txt +0 -26
- package/knowledge-library/solutions-architect/history/.gitkeep +0 -0
- package/knowledge-library/solutions-architect/inbox/processed/.gitkeep +0 -0
- package/knowledge-library/solutions-architect/outbox/.gitkeep +0 -0
- package/knowledge-library/solutions-architect/tech/.gitkeep +0 -0
- package/knowledge-library/wearos-engineer/context/current.txt +0 -42
- package/knowledge-library/wearos-engineer/control/decisions.txt +0 -9
- package/knowledge-library/wearos-engineer/control/dependencies.txt +0 -19
- package/knowledge-library/wearos-engineer/control/objectives.txt +0 -26
- package/knowledge-library/wearos-engineer/history/.gitkeep +0 -0
- package/knowledge-library/wearos-engineer/inbox/processed/.gitkeep +0 -0
- package/knowledge-library/wearos-engineer/outbox/.gitkeep +0 -0
- package/knowledge-library/wearos-engineer/tech/.gitkeep +0 -0
- package/scripts/add-agent.sh +0 -323
- package/scripts/install.sh +0 -354
- package/src/adapters/factory.test.ts +0 -386
- package/src/adapters/factory.ts +0 -305
- package/src/adapters/index.ts +0 -113
- package/src/adapters/interfaces.ts +0 -268
- package/src/adapters/mcp/client.test.ts +0 -130
- package/src/adapters/mcp/client.ts +0 -451
- package/src/adapters/mcp/discovery.test.ts +0 -315
- package/src/adapters/mcp/discovery.ts +0 -340
- package/src/adapters/mcp/index.ts +0 -66
- package/src/adapters/mcp/mapper.test.ts +0 -218
- package/src/adapters/mcp/mapper.ts +0 -536
- package/src/adapters/mcp/registry.test.ts +0 -433
- package/src/adapters/mcp/registry.ts +0 -550
- package/src/adapters/mcp/types.ts +0 -258
- package/src/adapters/native/filesystem.test.ts +0 -350
- package/src/adapters/native/filesystem.ts +0 -393
- package/src/adapters/native/github.test.ts +0 -173
- package/src/adapters/native/github.ts +0 -627
- package/src/adapters/native/index.ts +0 -22
- package/src/adapters/native/selector.test.ts +0 -224
- package/src/adapters/native/selector.ts +0 -150
- package/src/adapters/types.ts +0 -270
- package/src/agents/compiler.test.ts +0 -410
- package/src/agents/compiler.ts +0 -424
- package/src/agents/index.ts +0 -37
- package/src/agents/loader.test.ts +0 -319
- package/src/agents/loader.ts +0 -143
- package/src/agents/resolver.test.ts +0 -282
- package/src/agents/resolver.ts +0 -262
- package/src/agents/types.ts +0 -97
- package/src/cache/index.ts +0 -38
- package/src/cache/interfaces.ts +0 -283
- package/src/cache/manager.test.ts +0 -266
- package/src/cache/manager.ts +0 -388
- package/src/cache/provider.test.ts +0 -485
- package/src/cache/provider.ts +0 -745
- package/src/cache/types.test.ts +0 -192
- package/src/cache/types.ts +0 -313
- package/src/cli/commands/build.test.ts +0 -248
- package/src/cli/commands/build.ts +0 -284
- package/src/cli/commands/cache.test.ts +0 -221
- package/src/cli/commands/cache.ts +0 -229
- package/src/cli/commands/index.ts +0 -63
- package/src/cli/commands/init.test.ts +0 -173
- package/src/cli/commands/init.ts +0 -296
- package/src/cli/commands/skills.test.ts +0 -272
- package/src/cli/commands/skills.ts +0 -348
- package/src/cli/commands/status.test.ts +0 -392
- package/src/cli/commands/status.ts +0 -332
- package/src/cli/commands/sync.test.ts +0 -213
- package/src/cli/commands/sync.ts +0 -251
- package/src/cli/commands/validate.test.ts +0 -216
- package/src/cli/commands/validate.ts +0 -340
- package/src/cli/index.test.ts +0 -190
- package/src/cli/index.ts +0 -493
- package/src/commands/context.test.ts +0 -163
- package/src/commands/context.ts +0 -111
- package/src/commands/index.ts +0 -56
- package/src/commands/loader.test.ts +0 -273
- package/src/commands/loader.ts +0 -355
- package/src/commands/registry.test.ts +0 -384
- package/src/commands/registry.ts +0 -248
- package/src/commands/runner.test.ts +0 -297
- package/src/commands/runner.ts +0 -222
- package/src/commands/types.ts +0 -361
- package/src/config/index.ts +0 -19
- package/src/config/loader.test.ts +0 -262
- package/src/config/loader.ts +0 -188
- package/src/config/types.ts +0 -154
- package/src/context/index.ts +0 -14
- package/src/context/loader.test.ts +0 -334
- package/src/context/loader.ts +0 -357
- package/src/index.test.ts +0 -13
- package/src/index.ts +0 -268
- package/src/knowledge-library/index.ts +0 -44
- package/src/knowledge-library/manager.test.ts +0 -536
- package/src/knowledge-library/manager.ts +0 -804
- package/src/knowledge-library/types.ts +0 -432
- package/src/skills/generator.test.ts +0 -602
- package/src/skills/generator.ts +0 -491
- package/src/skills/index.ts +0 -27
- package/src/skills/templates.ts +0 -520
- package/src/skills/types.ts +0 -251
- package/templates/completion-report.md +0 -72
- package/templates/feedback.md +0 -56
- package/templates/project-files/CLAUDE.md.template +0 -109
- package/templates/project-files/coreai.json.example +0 -47
- package/templates/project-files/mcp.json.template +0 -20
- package/templates/review-complete.md +0 -64
- package/templates/review-request.md +0 -67
- package/templates/task-assignment.md +0 -51
- package/tsconfig.build.json +0 -4
- package/tsconfig.json +0 -26
- package/tsup.config.ts +0 -23
package/src/adapters/index.ts
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Adapters Module
|
|
3
|
-
*
|
|
4
|
-
* Provides adapter interfaces and factory for integrating with external services.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
// Types
|
|
8
|
-
export type {
|
|
9
|
-
AdapterType,
|
|
10
|
-
AdapterImplementation,
|
|
11
|
-
AdapterInfo,
|
|
12
|
-
IssueStatus,
|
|
13
|
-
PullRequestStatus,
|
|
14
|
-
ReviewDecision,
|
|
15
|
-
Issue,
|
|
16
|
-
CreateIssueData,
|
|
17
|
-
UpdateIssueData,
|
|
18
|
-
IssueQuery,
|
|
19
|
-
PullRequest,
|
|
20
|
-
CreatePullRequestData,
|
|
21
|
-
PullRequestQuery,
|
|
22
|
-
Review,
|
|
23
|
-
CreateReviewData,
|
|
24
|
-
ReviewComment,
|
|
25
|
-
DocumentationPage,
|
|
26
|
-
DocumentationQuery,
|
|
27
|
-
StateEntry,
|
|
28
|
-
StateOptions,
|
|
29
|
-
AdapterErrorCode,
|
|
30
|
-
} from './types.js';
|
|
31
|
-
|
|
32
|
-
export { AdapterError } from './types.js';
|
|
33
|
-
|
|
34
|
-
// Interfaces
|
|
35
|
-
export type {
|
|
36
|
-
BaseAdapter,
|
|
37
|
-
IssueTrackerAdapter,
|
|
38
|
-
GitProviderAdapter,
|
|
39
|
-
DocumentationProviderAdapter,
|
|
40
|
-
StateProviderAdapter,
|
|
41
|
-
Adapter,
|
|
42
|
-
} from './interfaces.js';
|
|
43
|
-
|
|
44
|
-
// Factory
|
|
45
|
-
export type { AdapterFactoryOptions } from './factory.js';
|
|
46
|
-
|
|
47
|
-
export { AdapterFactory, createAdapterFactory, createAdapterInfo } from './factory.js';
|
|
48
|
-
|
|
49
|
-
// MCP Integration
|
|
50
|
-
export type {
|
|
51
|
-
McpTransportType,
|
|
52
|
-
StdioServerConfig,
|
|
53
|
-
HttpServerConfig,
|
|
54
|
-
McpServerConfig,
|
|
55
|
-
McpServerDefinition,
|
|
56
|
-
McpConfigFile,
|
|
57
|
-
McpServerInfo,
|
|
58
|
-
McpCapabilities,
|
|
59
|
-
McpTool,
|
|
60
|
-
McpResource,
|
|
61
|
-
McpToolResult,
|
|
62
|
-
McpContent,
|
|
63
|
-
McpTextContent,
|
|
64
|
-
McpImageContent,
|
|
65
|
-
McpResourceContent,
|
|
66
|
-
McpErrorCode,
|
|
67
|
-
McpClientOptions,
|
|
68
|
-
DiscoveryOptions,
|
|
69
|
-
ToolMapping,
|
|
70
|
-
ServerMapping,
|
|
71
|
-
ServerEntry,
|
|
72
|
-
ServerStatus,
|
|
73
|
-
RegistryEvents,
|
|
74
|
-
RegistryOptions,
|
|
75
|
-
ServerStatusSummary,
|
|
76
|
-
RegistryStatus,
|
|
77
|
-
} from './mcp/index.js';
|
|
78
|
-
|
|
79
|
-
export {
|
|
80
|
-
McpError,
|
|
81
|
-
McpClient,
|
|
82
|
-
createMockMcpClient,
|
|
83
|
-
discoverMcpServers,
|
|
84
|
-
loadServersFromFile,
|
|
85
|
-
parseServersFromConfig,
|
|
86
|
-
validateServerConfig,
|
|
87
|
-
findMcpConfigFile,
|
|
88
|
-
getDefaultMcpConfigPath,
|
|
89
|
-
findKnownServerMappings,
|
|
90
|
-
autoDiscoverMappings,
|
|
91
|
-
getMappingsForServer,
|
|
92
|
-
groupMappingsByAdapter,
|
|
93
|
-
McpRegistry,
|
|
94
|
-
createRegistry,
|
|
95
|
-
} from './mcp/index.js';
|
|
96
|
-
|
|
97
|
-
// Native Adapters
|
|
98
|
-
export type {
|
|
99
|
-
FilesystemAdapterOptions,
|
|
100
|
-
GitHubAdapterOptions,
|
|
101
|
-
NativeAdapterSelectorOptions,
|
|
102
|
-
NativeAdapterAvailability,
|
|
103
|
-
} from './native/index.js';
|
|
104
|
-
|
|
105
|
-
export {
|
|
106
|
-
FilesystemAdapter,
|
|
107
|
-
createFilesystemAdapter,
|
|
108
|
-
GitHubAdapter,
|
|
109
|
-
createGitHubAdapter,
|
|
110
|
-
registerNativeAdapters,
|
|
111
|
-
checkNativeAdapterAvailability,
|
|
112
|
-
parseGitHubRemote,
|
|
113
|
-
} from './native/index.js';
|
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Adapter Interfaces
|
|
3
|
-
*
|
|
4
|
-
* Abstract interfaces for integration adapters that can be implemented
|
|
5
|
-
* via MCP servers or native API clients.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import type {
|
|
9
|
-
AdapterInfo,
|
|
10
|
-
Issue,
|
|
11
|
-
IssueQuery,
|
|
12
|
-
CreateIssueData,
|
|
13
|
-
UpdateIssueData,
|
|
14
|
-
IssueStatus,
|
|
15
|
-
PullRequest,
|
|
16
|
-
PullRequestQuery,
|
|
17
|
-
CreatePullRequestData,
|
|
18
|
-
Review,
|
|
19
|
-
CreateReviewData,
|
|
20
|
-
DocumentationPage,
|
|
21
|
-
DocumentationQuery,
|
|
22
|
-
StateEntry,
|
|
23
|
-
StateOptions,
|
|
24
|
-
} from './types.js';
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Base interface that all adapters implement
|
|
28
|
-
*/
|
|
29
|
-
export interface BaseAdapter {
|
|
30
|
-
/**
|
|
31
|
-
* Get adapter metadata
|
|
32
|
-
*/
|
|
33
|
-
getInfo(): AdapterInfo;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Check if the adapter is connected and available
|
|
37
|
-
*/
|
|
38
|
-
isConnected(): boolean;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Connect to the service (if needed)
|
|
42
|
-
*/
|
|
43
|
-
connect(): Promise<void>;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Disconnect from the service
|
|
47
|
-
*/
|
|
48
|
-
disconnect(): Promise<void>;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Issue Tracker Adapter
|
|
53
|
-
*
|
|
54
|
-
* For integrating with issue tracking systems like Jira, Linear, GitHub Issues, etc.
|
|
55
|
-
*/
|
|
56
|
-
export interface IssueTrackerAdapter extends BaseAdapter {
|
|
57
|
-
/**
|
|
58
|
-
* Get a single issue by ID or key
|
|
59
|
-
*/
|
|
60
|
-
getIssue(idOrKey: string): Promise<Issue>;
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* List issues matching the query
|
|
64
|
-
*/
|
|
65
|
-
listIssues(query?: IssueQuery): Promise<Issue[]>;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Create a new issue
|
|
69
|
-
*/
|
|
70
|
-
createIssue(data: CreateIssueData): Promise<Issue>;
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Update an existing issue
|
|
74
|
-
*/
|
|
75
|
-
updateIssue(idOrKey: string, data: UpdateIssueData): Promise<Issue>;
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Transition an issue to a new status
|
|
79
|
-
*/
|
|
80
|
-
transitionIssue(idOrKey: string, status: IssueStatus): Promise<Issue>;
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Add a comment to an issue
|
|
84
|
-
*/
|
|
85
|
-
addComment(idOrKey: string, comment: string): Promise<void>;
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Get available transitions/statuses for an issue
|
|
89
|
-
*/
|
|
90
|
-
getTransitions?(idOrKey: string): Promise<IssueStatus[]>;
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Assign an issue to a user
|
|
94
|
-
*/
|
|
95
|
-
assignIssue?(idOrKey: string, assignee: string): Promise<Issue>;
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Link two issues together
|
|
99
|
-
*/
|
|
100
|
-
linkIssues?(sourceKey: string, targetKey: string, linkType: string): Promise<void>;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Git Provider Adapter
|
|
105
|
-
*
|
|
106
|
-
* For integrating with Git hosting services like GitHub, GitLab, Bitbucket, etc.
|
|
107
|
-
*/
|
|
108
|
-
export interface GitProviderAdapter extends BaseAdapter {
|
|
109
|
-
/**
|
|
110
|
-
* Get a pull request by ID or number
|
|
111
|
-
*/
|
|
112
|
-
getPullRequest(idOrNumber: string | number): Promise<PullRequest>;
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* List pull requests matching the query
|
|
116
|
-
*/
|
|
117
|
-
listPullRequests(query?: PullRequestQuery): Promise<PullRequest[]>;
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Create a new pull request
|
|
121
|
-
*/
|
|
122
|
-
createPullRequest(data: CreatePullRequestData): Promise<PullRequest>;
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Update a pull request
|
|
126
|
-
*/
|
|
127
|
-
updatePullRequest?(
|
|
128
|
-
idOrNumber: string | number,
|
|
129
|
-
data: Partial<CreatePullRequestData>
|
|
130
|
-
): Promise<PullRequest>;
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Merge a pull request
|
|
134
|
-
*/
|
|
135
|
-
mergePullRequest(
|
|
136
|
-
idOrNumber: string | number,
|
|
137
|
-
options?: { method?: 'merge' | 'squash' | 'rebase'; message?: string }
|
|
138
|
-
): Promise<void>;
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Close a pull request without merging
|
|
142
|
-
*/
|
|
143
|
-
closePullRequest(idOrNumber: string | number): Promise<void>;
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Add a review to a pull request
|
|
147
|
-
*/
|
|
148
|
-
addReview(idOrNumber: string | number, review: CreateReviewData): Promise<Review>;
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Get reviews for a pull request
|
|
152
|
-
*/
|
|
153
|
-
getReviews?(idOrNumber: string | number): Promise<Review[]>;
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Request reviewers for a pull request
|
|
157
|
-
*/
|
|
158
|
-
requestReviewers?(idOrNumber: string | number, reviewers: string[]): Promise<void>;
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Add a comment to a pull request
|
|
162
|
-
*/
|
|
163
|
-
addPullRequestComment?(idOrNumber: string | number, comment: string): Promise<void>;
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Get the diff for a pull request
|
|
167
|
-
*/
|
|
168
|
-
getPullRequestDiff?(idOrNumber: string | number): Promise<string>;
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* Get files changed in a pull request
|
|
172
|
-
*/
|
|
173
|
-
getPullRequestFiles?(idOrNumber: string | number): Promise<string[]>;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* Documentation Provider Adapter
|
|
178
|
-
*
|
|
179
|
-
* For integrating with documentation systems like Confluence, Notion, GitHub Wiki, etc.
|
|
180
|
-
*/
|
|
181
|
-
export interface DocumentationProviderAdapter extends BaseAdapter {
|
|
182
|
-
/**
|
|
183
|
-
* Get a documentation page by ID
|
|
184
|
-
*/
|
|
185
|
-
getPage(id: string): Promise<DocumentationPage>;
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Get page content (may be separate from metadata in some systems)
|
|
189
|
-
*/
|
|
190
|
-
getPageContent(id: string): Promise<string>;
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* Search for documentation pages
|
|
194
|
-
*/
|
|
195
|
-
searchPages(query: DocumentationQuery): Promise<DocumentationPage[]>;
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* List pages in a space or parent
|
|
199
|
-
*/
|
|
200
|
-
listPages?(parentId?: string): Promise<DocumentationPage[]>;
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* Create a new page
|
|
204
|
-
*/
|
|
205
|
-
createPage?(title: string, content: string, parentId?: string): Promise<DocumentationPage>;
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* Update an existing page
|
|
209
|
-
*/
|
|
210
|
-
updatePage?(id: string, title?: string, content?: string): Promise<DocumentationPage>;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* State Provider Adapter
|
|
215
|
-
*
|
|
216
|
-
* For managing local state like KnowledgeLibrary, which may be stored
|
|
217
|
-
* on the filesystem, in a cloud bucket, or in a documentation system.
|
|
218
|
-
*/
|
|
219
|
-
export interface StateProviderAdapter extends BaseAdapter {
|
|
220
|
-
/**
|
|
221
|
-
* Read content from a path
|
|
222
|
-
*/
|
|
223
|
-
read(path: string, options?: StateOptions): Promise<string>;
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* Write content to a path
|
|
227
|
-
*/
|
|
228
|
-
write(path: string, content: string, options?: StateOptions): Promise<void>;
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* Check if a path exists
|
|
232
|
-
*/
|
|
233
|
-
exists(path: string): Promise<boolean>;
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* List entries in a directory
|
|
237
|
-
*/
|
|
238
|
-
list(path: string): Promise<StateEntry[]>;
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* Delete a file or directory
|
|
242
|
-
*/
|
|
243
|
-
delete(path: string, options?: StateOptions): Promise<void>;
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* Create a directory
|
|
247
|
-
*/
|
|
248
|
-
mkdir?(path: string, options?: StateOptions): Promise<void>;
|
|
249
|
-
|
|
250
|
-
/**
|
|
251
|
-
* Move/rename a file or directory
|
|
252
|
-
*/
|
|
253
|
-
move?(source: string, destination: string): Promise<void>;
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* Copy a file or directory
|
|
257
|
-
*/
|
|
258
|
-
copy?(source: string, destination: string): Promise<void>;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* Union type of all adapter types
|
|
263
|
-
*/
|
|
264
|
-
export type Adapter =
|
|
265
|
-
| IssueTrackerAdapter
|
|
266
|
-
| GitProviderAdapter
|
|
267
|
-
| DocumentationProviderAdapter
|
|
268
|
-
| StateProviderAdapter;
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { McpClient, createMockMcpClient } from './client.js';
|
|
2
|
-
import { McpError } from './types.js';
|
|
3
|
-
import type { McpTool, McpResource } from './types.js';
|
|
4
|
-
|
|
5
|
-
describe('MCP Client', () => {
|
|
6
|
-
describe('McpClient', () => {
|
|
7
|
-
it('should create client with server name and config', () => {
|
|
8
|
-
const client = new McpClient('test-server', {
|
|
9
|
-
transport: 'stdio',
|
|
10
|
-
command: 'node',
|
|
11
|
-
args: ['server.js'],
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
expect(client).toBeInstanceOf(McpClient);
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
it('should not be connected initially', () => {
|
|
18
|
-
const client = new McpClient('test', { transport: 'stdio', command: 'test' });
|
|
19
|
-
expect(client.isConnected()).toBe(false);
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should return null for server info when not connected', () => {
|
|
23
|
-
const client = new McpClient('test', { transport: 'stdio', command: 'test' });
|
|
24
|
-
expect(client.getServerInfo()).toBeNull();
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it('should throw when calling methods without connection', async () => {
|
|
28
|
-
const client = new McpClient('test', { transport: 'stdio', command: 'test' });
|
|
29
|
-
|
|
30
|
-
await expect(client.listTools()).rejects.toThrow(McpError);
|
|
31
|
-
await expect(client.listResources()).rejects.toThrow(McpError);
|
|
32
|
-
await expect(client.callTool('test')).rejects.toThrow(McpError);
|
|
33
|
-
await expect(client.readResource('test://uri')).rejects.toThrow(McpError);
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
it('should throw for unsupported transport', async () => {
|
|
37
|
-
const client = new McpClient('test', { transport: 'http', url: 'http://example.com' });
|
|
38
|
-
|
|
39
|
-
await expect(client.connect()).rejects.toThrow(McpError);
|
|
40
|
-
await expect(client.connect()).rejects.toThrow('Unsupported transport type');
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
describe('createMockMcpClient', () => {
|
|
45
|
-
it('should create a mock client', () => {
|
|
46
|
-
const client = createMockMcpClient('mock-server');
|
|
47
|
-
expect(client).toBeInstanceOf(McpClient);
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
it('should connect successfully', async () => {
|
|
51
|
-
const client = createMockMcpClient('mock-server');
|
|
52
|
-
await client.connect();
|
|
53
|
-
|
|
54
|
-
expect(client.isConnected()).toBe(true);
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
it('should return server info after connecting', async () => {
|
|
58
|
-
const client = createMockMcpClient('mock-server');
|
|
59
|
-
await client.connect();
|
|
60
|
-
|
|
61
|
-
const info = client.getServerInfo();
|
|
62
|
-
expect(info).not.toBeNull();
|
|
63
|
-
expect(info?.name).toBe('mock-server');
|
|
64
|
-
expect(info?.version).toBe('1.0.0');
|
|
65
|
-
expect(info?.connected).toBe(true);
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
it('should return provided tools', async () => {
|
|
69
|
-
const mockTools: McpTool[] = [
|
|
70
|
-
{ name: 'tool1', inputSchema: { type: 'object' } },
|
|
71
|
-
{ name: 'tool2', inputSchema: { type: 'object' }, description: 'A tool' },
|
|
72
|
-
];
|
|
73
|
-
|
|
74
|
-
const client = createMockMcpClient('mock-server', mockTools);
|
|
75
|
-
await client.connect();
|
|
76
|
-
|
|
77
|
-
const tools = await client.listTools();
|
|
78
|
-
expect(tools).toHaveLength(2);
|
|
79
|
-
expect(tools[0].name).toBe('tool1');
|
|
80
|
-
expect(tools[1].name).toBe('tool2');
|
|
81
|
-
expect(tools[1].description).toBe('A tool');
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
it('should return provided resources', async () => {
|
|
85
|
-
const mockResources: McpResource[] = [
|
|
86
|
-
{ uri: 'file://test.txt', name: 'Test File' },
|
|
87
|
-
{ uri: 'db://records', name: 'Records', description: 'Database records' },
|
|
88
|
-
];
|
|
89
|
-
|
|
90
|
-
const client = createMockMcpClient('mock-server', [], mockResources);
|
|
91
|
-
await client.connect();
|
|
92
|
-
|
|
93
|
-
const resources = await client.listResources();
|
|
94
|
-
expect(resources).toHaveLength(2);
|
|
95
|
-
expect(resources[0].uri).toBe('file://test.txt');
|
|
96
|
-
expect(resources[1].name).toBe('Records');
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
it('should return empty arrays by default', async () => {
|
|
100
|
-
const client = createMockMcpClient('mock-server');
|
|
101
|
-
await client.connect();
|
|
102
|
-
|
|
103
|
-
const tools = await client.listTools();
|
|
104
|
-
const resources = await client.listResources();
|
|
105
|
-
|
|
106
|
-
expect(tools).toHaveLength(0);
|
|
107
|
-
expect(resources).toHaveLength(0);
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
describe('McpError', () => {
|
|
112
|
-
it('should create error with message and code', () => {
|
|
113
|
-
const error = new McpError('Connection failed', 'connection_failed');
|
|
114
|
-
expect(error.message).toBe('Connection failed');
|
|
115
|
-
expect(error.code).toBe('connection_failed');
|
|
116
|
-
expect(error.name).toBe('McpError');
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
it('should include server name', () => {
|
|
120
|
-
const error = new McpError('Error', 'protocol_error', 'github');
|
|
121
|
-
expect(error.server).toBe('github');
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
it('should include cause', () => {
|
|
125
|
-
const cause = new Error('Original error');
|
|
126
|
-
const error = new McpError('Wrapped', 'network_error', undefined, cause);
|
|
127
|
-
expect(error.cause).toBe(cause);
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
});
|