@edicarlos.lds/businessmap-mcp 2.3.0 → 3.1.0
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/CONTRIBUTING.md +73 -0
- package/README.md +24 -4
- package/SECURITY.md +36 -0
- package/dist/client/businessmap-client.d.ts +17 -100
- package/dist/client/businessmap-client.d.ts.map +1 -1
- package/dist/client/businessmap-client.js +63 -283
- package/dist/client/businessmap-client.js.map +1 -1
- package/dist/client/businessmap-error.d.ts +16 -0
- package/dist/client/businessmap-error.d.ts.map +1 -0
- package/dist/client/businessmap-error.js +43 -0
- package/dist/client/businessmap-error.js.map +1 -0
- package/dist/client/modules/board-client.d.ts.map +1 -1
- package/dist/client/modules/board-client.js +16 -2
- package/dist/client/modules/board-client.js.map +1 -1
- package/dist/client/modules/card-client.d.ts +19 -5
- package/dist/client/modules/card-client.d.ts.map +1 -1
- package/dist/client/modules/card-client.js +61 -13
- package/dist/client/modules/card-client.js.map +1 -1
- package/dist/client/modules/custom-field-client.js +1 -1
- package/dist/client/modules/custom-field-client.js.map +1 -1
- package/dist/client/modules/doc-client.d.ts +44 -0
- package/dist/client/modules/doc-client.d.ts.map +1 -0
- package/dist/client/modules/doc-client.js +73 -0
- package/dist/client/modules/doc-client.js.map +1 -0
- package/dist/client/modules/index.d.ts +1 -0
- package/dist/client/modules/index.d.ts.map +1 -1
- package/dist/client/modules/index.js +1 -0
- package/dist/client/modules/index.js.map +1 -1
- package/dist/config/environment.d.ts +3 -0
- package/dist/config/environment.d.ts.map +1 -1
- package/dist/config/environment.js +60 -1
- package/dist/config/environment.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -9
- package/dist/index.js.map +1 -1
- package/dist/schemas/card-schemas.d.ts +111 -85
- package/dist/schemas/card-schemas.d.ts.map +1 -1
- package/dist/schemas/card-schemas.js +39 -162
- package/dist/schemas/card-schemas.js.map +1 -1
- package/dist/schemas/common-schemas.d.ts +10 -4
- package/dist/schemas/common-schemas.d.ts.map +1 -1
- package/dist/schemas/common-schemas.js +25 -0
- package/dist/schemas/common-schemas.js.map +1 -1
- package/dist/schemas/doc-schemas.d.ts +176 -0
- package/dist/schemas/doc-schemas.d.ts.map +1 -0
- package/dist/schemas/doc-schemas.js +141 -0
- package/dist/schemas/doc-schemas.js.map +1 -0
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/setup-schemas.d.ts +418 -0
- package/dist/schemas/setup-schemas.d.ts.map +1 -1
- package/dist/schemas/setup-schemas.js +30 -7
- package/dist/schemas/setup-schemas.js.map +1 -1
- package/dist/schemas/workspace-schemas.d.ts +3 -0
- package/dist/schemas/workspace-schemas.d.ts.map +1 -1
- package/dist/schemas/workspace-schemas.js +6 -0
- package/dist/schemas/workspace-schemas.js.map +1 -1
- package/dist/server/http.d.ts +7 -1
- package/dist/server/http.d.ts.map +1 -1
- package/dist/server/http.js +140 -31
- package/dist/server/http.js.map +1 -1
- package/dist/server/mcp-server.d.ts.map +1 -1
- package/dist/server/mcp-server.js +2 -1
- package/dist/server/mcp-server.js.map +1 -1
- package/dist/server/resources/board-resources.js +2 -2
- package/dist/server/resources/board-resources.js.map +1 -1
- package/dist/server/resources/card-resources.d.ts.map +1 -1
- package/dist/server/resources/card-resources.js +26 -2
- package/dist/server/resources/card-resources.js.map +1 -1
- package/dist/server/resources/workspace-resources.js +1 -1
- package/dist/server/resources/workspace-resources.js.map +1 -1
- package/dist/server/tools/base-tool.d.ts +39 -0
- package/dist/server/tools/base-tool.d.ts.map +1 -1
- package/dist/server/tools/base-tool.js +130 -0
- package/dist/server/tools/base-tool.js.map +1 -1
- package/dist/server/tools/board-tools.d.ts +0 -13
- package/dist/server/tools/board-tools.d.ts.map +1 -1
- package/dist/server/tools/board-tools.js +168 -257
- package/dist/server/tools/board-tools.js.map +1 -1
- package/dist/server/tools/card-tools.d.ts +6 -42
- package/dist/server/tools/card-tools.d.ts.map +1 -1
- package/dist/server/tools/card-tools.js +506 -702
- package/dist/server/tools/card-tools.js.map +1 -1
- package/dist/server/tools/custom-field-tools.d.ts +1 -2
- package/dist/server/tools/custom-field-tools.d.ts.map +1 -1
- package/dist/server/tools/custom-field-tools.js +8 -16
- package/dist/server/tools/custom-field-tools.js.map +1 -1
- package/dist/server/tools/doc-tools.d.ts +15 -0
- package/dist/server/tools/doc-tools.d.ts.map +1 -0
- package/dist/server/tools/doc-tools.js +307 -0
- package/dist/server/tools/doc-tools.js.map +1 -0
- package/dist/server/tools/index.d.ts +1 -0
- package/dist/server/tools/index.d.ts.map +1 -1
- package/dist/server/tools/index.js +1 -0
- package/dist/server/tools/index.js.map +1 -1
- package/dist/server/tools/setup-tools.d.ts +13 -2
- package/dist/server/tools/setup-tools.d.ts.map +1 -1
- package/dist/server/tools/setup-tools.js +145 -96
- package/dist/server/tools/setup-tools.js.map +1 -1
- package/dist/server/tools/user-tools.d.ts +0 -4
- package/dist/server/tools/user-tools.d.ts.map +1 -1
- package/dist/server/tools/user-tools.js +36 -65
- package/dist/server/tools/user-tools.js.map +1 -1
- package/dist/server/tools/utility-tools.d.ts +0 -2
- package/dist/server/tools/utility-tools.d.ts.map +1 -1
- package/dist/server/tools/utility-tools.js +15 -28
- package/dist/server/tools/utility-tools.js.map +1 -1
- package/dist/server/tools/workflow-tools.d.ts +0 -8
- package/dist/server/tools/workflow-tools.d.ts.map +1 -1
- package/dist/server/tools/workflow-tools.js +84 -139
- package/dist/server/tools/workflow-tools.js.map +1 -1
- package/dist/server/tools/workspace-tools.d.ts +0 -4
- package/dist/server/tools/workspace-tools.d.ts.map +1 -1
- package/dist/server/tools/workspace-tools.js +35 -65
- package/dist/server/tools/workspace-tools.js.map +1 -1
- package/dist/types/base.d.ts +1 -0
- package/dist/types/base.d.ts.map +1 -1
- package/dist/types/card.d.ts +21 -5
- package/dist/types/card.d.ts.map +1 -1
- package/dist/types/doc.d.ts +96 -0
- package/dist/types/doc.d.ts.map +1 -0
- package/dist/types/doc.js +3 -0
- package/dist/types/doc.js.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/workspace.d.ts +1 -0
- package/dist/types/workspace.d.ts.map +1 -1
- package/dist/utils/logger.d.ts +7 -12
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +73 -10
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/request-context.d.ts +7 -0
- package/dist/utils/request-context.d.ts.map +1 -0
- package/dist/utils/request-context.js +9 -0
- package/dist/utils/request-context.js.map +1 -0
- package/docs/LOGGING.md +15 -0
- package/docs/MIDDLEWARE.md +26 -4
- package/docs/TOOLS.md +43 -8
- package/package.json +4 -1
|
@@ -1,68 +1,96 @@
|
|
|
1
|
-
import { configureBoardStructureSchema, createBoardsInWorkspaceSchema, } from '../../schemas/index.js';
|
|
1
|
+
import { configureBoardStructureSchema, createBoardsInWorkspaceSchema, createWorkspacesAndBoardsSchema, } from '../../schemas/index.js';
|
|
2
2
|
import { logger } from '../../utils/logger.js';
|
|
3
|
-
import {
|
|
3
|
+
import { WRITE, registerTool } from './base-tool.js';
|
|
4
4
|
export class SetupToolHandler {
|
|
5
5
|
registerTools(server, client, readOnlyMode) {
|
|
6
|
-
if (
|
|
7
|
-
|
|
8
|
-
this.registerConfigureBoardStructure(server, client);
|
|
6
|
+
if (readOnlyMode) {
|
|
7
|
+
return;
|
|
9
8
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
try {
|
|
9
|
+
registerTool(server, {
|
|
10
|
+
name: 'create_workspaces_and_boards',
|
|
11
|
+
title: 'Create Workspaces and Boards',
|
|
12
|
+
description: 'Create one or more workspaces (max 3) together with their boards and full board structure (workflows, renamed default columns, extra columns and lanes) in a single batch call',
|
|
13
|
+
schema: createWorkspacesAndBoardsSchema,
|
|
14
|
+
annotations: WRITE,
|
|
15
|
+
errorContext: 'creating workspaces and boards',
|
|
16
|
+
handler: async ({ workspaces }) => {
|
|
19
17
|
const reports = [];
|
|
20
|
-
for (const
|
|
21
|
-
|
|
22
|
-
try {
|
|
23
|
-
const board = await client.createBoard({
|
|
24
|
-
name: boardConfig.name,
|
|
25
|
-
workspace_id,
|
|
26
|
-
...(boardConfig.description && { description: boardConfig.description }),
|
|
27
|
-
});
|
|
28
|
-
if (board.board_id === undefined) {
|
|
29
|
-
throw new Error('Board was created but the API did not return a board_id');
|
|
30
|
-
}
|
|
31
|
-
report.board_id = board.board_id;
|
|
32
|
-
for (const workflowConfig of boardConfig.workflows ?? []) {
|
|
33
|
-
report.workflows.push(await this.applyWorkflowConfig(client, board.board_id, workflowConfig));
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
catch (error) {
|
|
37
|
-
report.error = error instanceof Error ? error.message : 'Unknown error';
|
|
38
|
-
}
|
|
39
|
-
reports.push(report);
|
|
18
|
+
for (const workspaceConfig of workspaces) {
|
|
19
|
+
reports.push(await this.createWorkspaceWithBoards(client, workspaceConfig));
|
|
40
20
|
}
|
|
41
|
-
return
|
|
42
|
-
}
|
|
43
|
-
catch (error) {
|
|
44
|
-
return createErrorResponse(error, 'creating boards in workspace');
|
|
45
|
-
}
|
|
21
|
+
return { workspaces: reports };
|
|
22
|
+
},
|
|
46
23
|
});
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
24
|
+
registerTool(server, {
|
|
25
|
+
name: 'create_boards_in_workspace',
|
|
26
|
+
title: 'Create Boards in Workspace',
|
|
27
|
+
description: 'Create one or more boards (max 3) with their full structure (workflows, renamed default columns, extra columns and lanes) in an existing workspace, in a single batch call',
|
|
28
|
+
schema: createBoardsInWorkspaceSchema,
|
|
29
|
+
annotations: WRITE,
|
|
30
|
+
errorContext: 'creating boards in workspace',
|
|
31
|
+
handler: async ({ workspace_id, boards }) => {
|
|
32
|
+
const reports = await this.createBoardsWithStructure(client, workspace_id, boards);
|
|
33
|
+
return { workspace_id, boards: reports };
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
registerTool(server, {
|
|
37
|
+
name: 'configure_board_structure',
|
|
50
38
|
title: 'Configure Board Structure',
|
|
51
39
|
description: 'Configure the structure of an existing board in a single batch call: create or rename workflows, rename the built-in Requested/In Progress/Done columns, and add extra columns and lanes',
|
|
52
|
-
|
|
53
|
-
annotations:
|
|
54
|
-
|
|
55
|
-
|
|
40
|
+
schema: configureBoardStructureSchema,
|
|
41
|
+
annotations: WRITE,
|
|
42
|
+
errorContext: 'configuring board structure',
|
|
43
|
+
handler: async ({ board_id, workflows }) => {
|
|
56
44
|
const reports = [];
|
|
57
45
|
for (const workflowConfig of workflows) {
|
|
58
46
|
reports.push(await this.applyWorkflowConfig(client, board_id, workflowConfig));
|
|
59
47
|
}
|
|
60
|
-
return
|
|
48
|
+
return { board_id, workflows: reports };
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
async createWorkspaceWithBoards(client, workspaceConfig) {
|
|
53
|
+
const report = { name: workspaceConfig.name, boards: [] };
|
|
54
|
+
try {
|
|
55
|
+
const workspace = await client.workspaces.createWorkspace({
|
|
56
|
+
name: workspaceConfig.name,
|
|
57
|
+
...(workspaceConfig.type !== undefined && { type: workspaceConfig.type }),
|
|
58
|
+
});
|
|
59
|
+
if (workspace.workspace_id === undefined) {
|
|
60
|
+
throw new Error('Workspace was created but the API did not return a workspace_id');
|
|
61
|
+
}
|
|
62
|
+
report.workspace_id = workspace.workspace_id;
|
|
63
|
+
report.boards = await this.createBoardsWithStructure(client, workspace.workspace_id, workspaceConfig.boards ?? []);
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
report.error = errorMessage(error);
|
|
67
|
+
}
|
|
68
|
+
return report;
|
|
69
|
+
}
|
|
70
|
+
async createBoardsWithStructure(client, workspaceId, boards) {
|
|
71
|
+
const reports = [];
|
|
72
|
+
for (const boardConfig of boards) {
|
|
73
|
+
const report = { name: boardConfig.name, workflows: [] };
|
|
74
|
+
try {
|
|
75
|
+
const board = await client.boards.createBoard({
|
|
76
|
+
name: boardConfig.name,
|
|
77
|
+
workspace_id: workspaceId,
|
|
78
|
+
...(boardConfig.description && { description: boardConfig.description }),
|
|
79
|
+
});
|
|
80
|
+
if (board.board_id === undefined) {
|
|
81
|
+
throw new Error('Board was created but the API did not return a board_id');
|
|
82
|
+
}
|
|
83
|
+
report.board_id = board.board_id;
|
|
84
|
+
for (const workflowConfig of boardConfig.workflows ?? []) {
|
|
85
|
+
report.workflows.push(await this.applyWorkflowConfig(client, board.board_id, workflowConfig));
|
|
86
|
+
}
|
|
61
87
|
}
|
|
62
88
|
catch (error) {
|
|
63
|
-
|
|
89
|
+
report.error = errorMessage(error);
|
|
64
90
|
}
|
|
65
|
-
|
|
91
|
+
reports.push(report);
|
|
92
|
+
}
|
|
93
|
+
return reports;
|
|
66
94
|
}
|
|
67
95
|
async applyWorkflowConfig(client, boardId, config) {
|
|
68
96
|
const report = {
|
|
@@ -72,14 +100,28 @@ export class SetupToolHandler {
|
|
|
72
100
|
created_lanes: [],
|
|
73
101
|
errors: [],
|
|
74
102
|
};
|
|
103
|
+
const workflowId = await this.resolveWorkflow(client, boardId, config, report);
|
|
104
|
+
if (workflowId === undefined) {
|
|
105
|
+
return report;
|
|
106
|
+
}
|
|
107
|
+
const columnIdsByName = await this.renameDefaultColumns(client, boardId, workflowId, config, report);
|
|
108
|
+
await this.createColumns(client, boardId, workflowId, config, columnIdsByName, report);
|
|
109
|
+
await this.createLanes(client, boardId, workflowId, config, report);
|
|
110
|
+
if (report.errors.length > 0) {
|
|
111
|
+
logger.warn(`Board ${boardId} structure setup finished with ${report.errors.length} error(s)`);
|
|
112
|
+
}
|
|
113
|
+
return report;
|
|
114
|
+
}
|
|
115
|
+
/** Resolve the target workflow: create a new one or rename an existing one */
|
|
116
|
+
async resolveWorkflow(client, boardId, config, report) {
|
|
75
117
|
let workflowId = config.workflow_id;
|
|
76
118
|
try {
|
|
77
119
|
if (workflowId === undefined) {
|
|
78
120
|
if (config.type === undefined) {
|
|
79
121
|
report.errors.push('Provide workflow_id (existing) or type (to create a new workflow).');
|
|
80
|
-
return
|
|
122
|
+
return undefined;
|
|
81
123
|
}
|
|
82
|
-
const workflow = await client.createWorkflow(boardId, {
|
|
124
|
+
const workflow = await client.workflows.createWorkflow(boardId, {
|
|
83
125
|
type: config.type,
|
|
84
126
|
...(config.name && { name: config.name }),
|
|
85
127
|
});
|
|
@@ -87,37 +129,49 @@ export class SetupToolHandler {
|
|
|
87
129
|
report.created = true;
|
|
88
130
|
}
|
|
89
131
|
else if (config.name) {
|
|
90
|
-
await client.updateWorkflow(boardId, workflowId, { name: config.name });
|
|
132
|
+
await client.workflows.updateWorkflow(boardId, workflowId, { name: config.name });
|
|
91
133
|
}
|
|
92
134
|
report.workflow_id = workflowId;
|
|
135
|
+
return workflowId;
|
|
93
136
|
}
|
|
94
137
|
catch (error) {
|
|
95
|
-
report.errors.push(`workflow: ${error
|
|
96
|
-
return
|
|
138
|
+
report.errors.push(`workflow: ${errorMessage(error)}`);
|
|
139
|
+
return undefined;
|
|
97
140
|
}
|
|
98
|
-
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Rename the built-in section columns and return a name -> column_id map of the
|
|
144
|
+
* workflow's existing columns (used for parent resolution when creating sub-columns)
|
|
145
|
+
*/
|
|
146
|
+
async renameDefaultColumns(client, boardId, workflowId, config, report) {
|
|
99
147
|
const columnIdsByName = new Map();
|
|
100
|
-
if (config.default_columns?.length
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
148
|
+
if (!config.default_columns?.length && !config.columns?.some((c) => c.parent_column_name)) {
|
|
149
|
+
return columnIdsByName;
|
|
150
|
+
}
|
|
151
|
+
try {
|
|
152
|
+
const structure = await client.boards.getCurrentBoardStructure(boardId);
|
|
153
|
+
for (const [columnId, column] of Object.entries(structure.columns)) {
|
|
154
|
+
if (column.workflow_id !== workflowId) {
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
columnIdsByName.set(column.name, Number(columnId));
|
|
158
|
+
// Rename built-in columns by section (top-level columns only)
|
|
159
|
+
const rename = config.default_columns?.find((dc) => dc.section === column.section && !column.parent_column_id);
|
|
160
|
+
if (rename && !report.renamed_default_columns.includes(rename.name)) {
|
|
161
|
+
await client.boards.updateColumn(boardId, Number(columnId), { name: rename.name });
|
|
162
|
+
columnIdsByName.delete(column.name);
|
|
163
|
+
columnIdsByName.set(rename.name, Number(columnId));
|
|
164
|
+
report.renamed_default_columns.push(rename.name);
|
|
115
165
|
}
|
|
116
|
-
}
|
|
117
|
-
catch (error) {
|
|
118
|
-
report.errors.push(`default_columns: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
119
166
|
}
|
|
120
167
|
}
|
|
168
|
+
catch (error) {
|
|
169
|
+
report.errors.push(`default_columns: ${errorMessage(error)}`);
|
|
170
|
+
}
|
|
171
|
+
return columnIdsByName;
|
|
172
|
+
}
|
|
173
|
+
/** Create the extra columns (main or sub-columns resolved by parent name) */
|
|
174
|
+
async createColumns(client, boardId, workflowId, config, columnIdsByName, report) {
|
|
121
175
|
for (const column of config.columns ?? []) {
|
|
122
176
|
try {
|
|
123
177
|
const parentColumnId = column.parent_column_name
|
|
@@ -127,34 +181,30 @@ export class SetupToolHandler {
|
|
|
127
181
|
report.errors.push(`column "${column.name}": parent column "${column.parent_column_name}" not found`);
|
|
128
182
|
continue;
|
|
129
183
|
}
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}
|
|
138
|
-
: {
|
|
139
|
-
workflow_id: workflowId,
|
|
140
|
-
section: column.section ?? 3,
|
|
141
|
-
position: column.position ?? 0,
|
|
142
|
-
name: column.name,
|
|
143
|
-
...(column.limit !== undefined && { limit: column.limit }),
|
|
144
|
-
...(column.description && { description: column.description }),
|
|
145
|
-
});
|
|
184
|
+
const sharedFields = {
|
|
185
|
+
position: column.position ?? 0,
|
|
186
|
+
name: column.name,
|
|
187
|
+
...(column.limit !== undefined && { limit: column.limit }),
|
|
188
|
+
...(column.description && { description: column.description }),
|
|
189
|
+
};
|
|
190
|
+
const created = await client.boards.createColumn(boardId, parentColumnId !== undefined
|
|
191
|
+
? { parent_column_id: parentColumnId, ...sharedFields }
|
|
192
|
+
: { workflow_id: workflowId, section: column.section ?? 3, ...sharedFields });
|
|
146
193
|
if (created.column_id !== undefined) {
|
|
147
194
|
columnIdsByName.set(column.name, created.column_id);
|
|
148
195
|
}
|
|
149
196
|
report.created_columns.push(column.name);
|
|
150
197
|
}
|
|
151
198
|
catch (error) {
|
|
152
|
-
report.errors.push(`column "${column.name}": ${error
|
|
199
|
+
report.errors.push(`column "${column.name}": ${errorMessage(error)}`);
|
|
153
200
|
}
|
|
154
201
|
}
|
|
202
|
+
}
|
|
203
|
+
/** Create the extra lanes */
|
|
204
|
+
async createLanes(client, boardId, workflowId, config, report) {
|
|
155
205
|
for (const lane of config.lanes ?? []) {
|
|
156
206
|
try {
|
|
157
|
-
await client.createLane(boardId, {
|
|
207
|
+
await client.boards.createLane(boardId, {
|
|
158
208
|
workflow_id: workflowId,
|
|
159
209
|
position: lane.position ?? 0,
|
|
160
210
|
name: lane.name,
|
|
@@ -163,13 +213,12 @@ export class SetupToolHandler {
|
|
|
163
213
|
report.created_lanes.push(lane.name);
|
|
164
214
|
}
|
|
165
215
|
catch (error) {
|
|
166
|
-
report.errors.push(`lane "${lane.name}": ${error
|
|
216
|
+
report.errors.push(`lane "${lane.name}": ${errorMessage(error)}`);
|
|
167
217
|
}
|
|
168
218
|
}
|
|
169
|
-
if (report.errors.length > 0) {
|
|
170
|
-
logger.warn(`Board ${boardId} structure setup finished with ${report.errors.length} error(s)`);
|
|
171
|
-
}
|
|
172
|
-
return report;
|
|
173
219
|
}
|
|
174
220
|
}
|
|
221
|
+
function errorMessage(error) {
|
|
222
|
+
return error instanceof Error ? error.message : 'Unknown error';
|
|
223
|
+
}
|
|
175
224
|
//# sourceMappingURL=setup-tools.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-tools.js","sourceRoot":"","sources":["../../../src/server/tools/setup-tools.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,
|
|
1
|
+
{"version":3,"file":"setup-tools.js","sourceRoot":"","sources":["../../../src/server/tools/setup-tools.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,EAC7B,+BAA+B,GAGhC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAmB,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AA4BtE,MAAM,OAAO,gBAAgB;IAC3B,aAAa,CAAC,MAAiB,EAAE,MAAyB,EAAE,YAAqB;QAC/E,IAAI,YAAY,EAAE,CAAC;YACjB,OAAO;QACT,CAAC;QAED,YAAY,CAAC,MAAM,EAAE;YACnB,IAAI,EAAE,8BAA8B;YACpC,KAAK,EAAE,8BAA8B;YACrC,WAAW,EACT,gLAAgL;YAClL,MAAM,EAAE,+BAA+B;YACvC,WAAW,EAAE,KAAK;YAClB,YAAY,EAAE,gCAAgC;YAC9C,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE;gBAChC,MAAM,OAAO,GAAG,EAAE,CAAC;gBACnB,KAAK,MAAM,eAAe,IAAI,UAAU,EAAE,CAAC;oB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AAM,CAAC,KAAK,IAAI,EAAE,EAAE,CAAC;YACtC,IAAI,CAAC;gBACH,MAAM,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE;oBACtC,WAAW,EAAE,UAAU;oBACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,CAAC;oBAC5B,IAAI,EAAE,IAAI,CAAC,IAAI;oBACf,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;iBACzC,CAAC,CAAC;gBACH,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACvC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,MAAM,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACpE,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAED,SAAS,YAAY,CAAC,KAAc;IAClC,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;AAClE,CAAC"}
|
|
@@ -3,9 +3,5 @@ import { BusinessMapClient } from '../../client/businessmap-client.js';
|
|
|
3
3
|
import { BaseToolHandler } from './base-tool.js';
|
|
4
4
|
export declare class UserToolHandler implements BaseToolHandler {
|
|
5
5
|
registerTools(server: McpServer, client: BusinessMapClient, readOnlyMode: boolean): void;
|
|
6
|
-
private registerListUsers;
|
|
7
|
-
private registerGetUser;
|
|
8
|
-
private registerGetCurrentUser;
|
|
9
|
-
private registerInviteUser;
|
|
10
6
|
}
|
|
11
7
|
//# sourceMappingURL=user-tools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-tools.d.ts","sourceRoot":"","sources":["../../../src/server/tools/user-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAOvE,OAAO,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"user-tools.d.ts","sourceRoot":"","sources":["../../../src/server/tools/user-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAOvE,OAAO,EAAE,eAAe,EAAkC,MAAM,gBAAgB,CAAC;AAEjF,qBAAa,eAAgB,YAAW,eAAe;IACrD,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,iBAAiB,EAAE,YAAY,EAAE,OAAO,GAAG,IAAI;CAmDzF"}
|
|
@@ -1,80 +1,51 @@
|
|
|
1
1
|
import { getCurrentUserSchema, getUserSchema, inviteUserSchema, listUsersSchema, } from '../../schemas/user-schemas.js';
|
|
2
|
-
import {
|
|
2
|
+
import { READ_ONLY, WRITE, registerTool } from './base-tool.js';
|
|
3
3
|
export class UserToolHandler {
|
|
4
4
|
registerTools(server, client, readOnlyMode) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
this.registerGetCurrentUser(server, client);
|
|
8
|
-
if (!readOnlyMode) {
|
|
9
|
-
this.registerInviteUser(server, client);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
registerListUsers(server, client) {
|
|
13
|
-
server.registerTool('list_users', {
|
|
5
|
+
registerTool(server, {
|
|
6
|
+
name: 'list_users',
|
|
14
7
|
title: 'List Users',
|
|
15
8
|
description: 'Get a list of all users',
|
|
16
|
-
|
|
17
|
-
annotations:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const users = await client.getUsers();
|
|
21
|
-
return createSuccessResponse(users);
|
|
22
|
-
}
|
|
23
|
-
catch (error) {
|
|
24
|
-
return createErrorResponse(error, 'fetching users');
|
|
25
|
-
}
|
|
9
|
+
schema: listUsersSchema,
|
|
10
|
+
annotations: READ_ONLY,
|
|
11
|
+
errorContext: 'fetching users',
|
|
12
|
+
handler: () => client.users.getUsers(),
|
|
26
13
|
});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
server.registerTool('get_user', {
|
|
14
|
+
registerTool(server, {
|
|
15
|
+
name: 'get_user',
|
|
30
16
|
title: 'Get User',
|
|
31
17
|
description: 'Get details of a specific user',
|
|
32
|
-
|
|
33
|
-
annotations:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const user = await client.getUser(user_id);
|
|
37
|
-
return createSuccessResponse(user);
|
|
38
|
-
}
|
|
39
|
-
catch (error) {
|
|
40
|
-
return createErrorResponse(error, 'fetching user');
|
|
41
|
-
}
|
|
18
|
+
schema: getUserSchema,
|
|
19
|
+
annotations: READ_ONLY,
|
|
20
|
+
errorContext: 'fetching user',
|
|
21
|
+
handler: ({ user_id }) => client.users.getUser(user_id),
|
|
42
22
|
});
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
server.registerTool('get_current_user', {
|
|
23
|
+
registerTool(server, {
|
|
24
|
+
name: 'get_current_user',
|
|
46
25
|
title: 'Get Current User',
|
|
47
26
|
description: 'Get details of the current logged user',
|
|
48
|
-
|
|
49
|
-
annotations:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const currentUser = await client.getCurrentUser();
|
|
53
|
-
return createSuccessResponse(currentUser);
|
|
54
|
-
}
|
|
55
|
-
catch (error) {
|
|
56
|
-
return createErrorResponse(error, 'fetching current user');
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
registerInviteUser(server, client) {
|
|
61
|
-
server.registerTool('invite_user', {
|
|
62
|
-
title: 'Invite User',
|
|
63
|
-
description: 'Add and invite a new user by email. Sends an invitation email with a link to set their password and log in.',
|
|
64
|
-
inputSchema: inviteUserSchema.shape,
|
|
65
|
-
}, async ({ email, do_not_send_confirmation_email }) => {
|
|
66
|
-
try {
|
|
67
|
-
const params = { email };
|
|
68
|
-
if (do_not_send_confirmation_email !== undefined) {
|
|
69
|
-
params['do_not_send_confirmation_email'] = do_not_send_confirmation_email;
|
|
70
|
-
}
|
|
71
|
-
const user = await client.inviteUser(params);
|
|
72
|
-
return createSuccessResponse(user, 'User invited successfully:');
|
|
73
|
-
}
|
|
74
|
-
catch (error) {
|
|
75
|
-
return createErrorResponse(error, 'inviting user');
|
|
76
|
-
}
|
|
27
|
+
schema: getCurrentUserSchema,
|
|
28
|
+
annotations: READ_ONLY,
|
|
29
|
+
errorContext: 'fetching current user',
|
|
30
|
+
handler: () => client.users.getCurrentUser(),
|
|
77
31
|
});
|
|
32
|
+
if (!readOnlyMode) {
|
|
33
|
+
registerTool(server, {
|
|
34
|
+
name: 'invite_user',
|
|
35
|
+
title: 'Invite User',
|
|
36
|
+
description: 'Add and invite a new user by email. Sends an invitation email with a link to set their password and log in.',
|
|
37
|
+
schema: inviteUserSchema,
|
|
38
|
+
annotations: WRITE,
|
|
39
|
+
errorContext: 'inviting user',
|
|
40
|
+
successMessage: 'User invited successfully:',
|
|
41
|
+
handler: ({ email, do_not_send_confirmation_email }) => client.users.inviteUser({
|
|
42
|
+
email,
|
|
43
|
+
...(do_not_send_confirmation_email !== undefined && {
|
|
44
|
+
do_not_send_confirmation_email,
|
|
45
|
+
}),
|
|
46
|
+
}),
|
|
47
|
+
});
|
|
48
|
+
}
|
|
78
49
|
}
|
|
79
50
|
}
|
|
80
51
|
//# sourceMappingURL=user-tools.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-tools.js","sourceRoot":"","sources":["../../../src/server/tools/user-tools.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,eAAe,GAChB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAmB,
|
|
1
|
+
{"version":3,"file":"user-tools.js","sourceRoot":"","sources":["../../../src/server/tools/user-tools.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,oB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,MAAM,EAAE,gBAAgB;gBACxB,WAAW,EAAE,KAAK;gBAClB,YAAY,EAAE,eAAe;gBAC7B,cAAc,EAAE,4BAA4B;gBAC5C,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,8BAA8B,EAAE,EAAE,EAAE,CACrD,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC;oBACtB,KAAK;oBACL,GAAG,CAAC,8BAA8B,KAAK,SAAS,IAAI;wBAClD,8BAA8B;qBAC/B,CAAC;iBACH,CAAC;aACL,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF"}
|
|
@@ -3,7 +3,5 @@ import { BusinessMapClient } from '../../client/businessmap-client.js';
|
|
|
3
3
|
import { BaseToolHandler } from './base-tool.js';
|
|
4
4
|
export declare class UtilityToolHandler implements BaseToolHandler {
|
|
5
5
|
registerTools(server: McpServer, client: BusinessMapClient): void;
|
|
6
|
-
private registerHealthCheck;
|
|
7
|
-
private registerGetApiInfo;
|
|
8
6
|
}
|
|
9
7
|
//# sourceMappingURL=utility-tools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utility-tools.d.ts","sourceRoot":"","sources":["../../../src/server/tools/utility-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAEvE,OAAO,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"utility-tools.d.ts","sourceRoot":"","sources":["../../../src/server/tools/utility-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAEvE,OAAO,EAAE,eAAe,EAA2B,MAAM,gBAAgB,CAAC;AAE1E,qBAAa,kBAAmB,YAAW,eAAe;IACxD,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,iBAAiB,GAAG,IAAI;CA+BlE"}
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import { getApiInfoSchema, healthCheckSchema } from '../../schemas/utility-schemas.js';
|
|
2
|
-
import {
|
|
2
|
+
import { READ_ONLY, registerTool } from './base-tool.js';
|
|
3
3
|
export class UtilityToolHandler {
|
|
4
4
|
registerTools(server, client) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
registerHealthCheck(server, client) {
|
|
9
|
-
server.registerTool('health_check', {
|
|
5
|
+
registerTool(server, {
|
|
6
|
+
name: 'health_check',
|
|
10
7
|
title: 'Health Check',
|
|
11
8
|
description: 'Check the connection to BusinessMap API',
|
|
12
|
-
|
|
13
|
-
annotations:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const isHealthy = await client.healthCheck();
|
|
9
|
+
schema: healthCheckSchema,
|
|
10
|
+
annotations: READ_ONLY,
|
|
11
|
+
errorContext: 'health check failed',
|
|
12
|
+
handler: async () => {
|
|
13
|
+
const isHealthy = await client.utility.healthCheck();
|
|
17
14
|
return {
|
|
18
15
|
content: [
|
|
19
16
|
{
|
|
@@ -22,26 +19,16 @@ export class UtilityToolHandler {
|
|
|
22
19
|
},
|
|
23
20
|
],
|
|
24
21
|
};
|
|
25
|
-
}
|
|
26
|
-
catch (error) {
|
|
27
|
-
return createErrorResponse(error, 'health check failed');
|
|
28
|
-
}
|
|
22
|
+
},
|
|
29
23
|
});
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
server.registerTool('get_api_info', {
|
|
24
|
+
registerTool(server, {
|
|
25
|
+
name: 'get_api_info',
|
|
33
26
|
title: 'Get API Info',
|
|
34
27
|
description: 'Get information about the BusinessMap API',
|
|
35
|
-
|
|
36
|
-
annotations:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const apiInfo = await client.getApiInfo();
|
|
40
|
-
return createSuccessResponse(apiInfo);
|
|
41
|
-
}
|
|
42
|
-
catch (error) {
|
|
43
|
-
return createErrorResponse(error, 'fetching API info');
|
|
44
|
-
}
|
|
28
|
+
schema: getApiInfoSchema,
|
|
29
|
+
annotations: READ_ONLY,
|
|
30
|
+
errorContext: 'fetching API info',
|
|
31
|
+
handler: () => client.utility.getApiInfo(),
|
|
45
32
|
});
|
|
46
33
|
}
|
|
47
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utility-tools.js","sourceRoot":"","sources":["../../../src/server/tools/utility-tools.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EAAmB,
|
|
1
|
+
{"version":3,"file":"utility-tools.js","sourceRoot":"","sources":["../../../src/server/tools/utility-tools.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EAAmB,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE1E,MAAM,OAAO,kBAAkB;IAC7B,aAAa,CAAC,MAAiB,EAAE,MAAyB;QACxD,YAAY,CAAC,MAAM,EAAE;YACnB,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,yCAAyC;YACtD,MAAM,EAAE,iBAAiB;YACzB,WAAW,EAAE,SAAS;YACtB,YAAY,EAAE,qBAAqB;YACnC,OAAO,EAAE,KAAK,IAAI,EAAE;gBAClB,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;gBACrD,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAe;4BACrB,IAAI,EAAE,2BAA2B,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,EAAE;yBACvE;qBACF;iBACF,CAAC;YACJ,CAAC;SACF,CAAC,CAAC;QAEH,YAAY,CAAC,MAAM,EAAE;YACnB,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,2CAA2C;YACxD,MAAM,EAAE,gBAAgB;YACxB,WAAW,EAAE,SAAS;YACtB,YAAY,EAAE,mBAAmB;YACjC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,EAAE;SAC3C,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -3,13 +3,5 @@ import { BusinessMapClient } from '../../client/businessmap-client.js';
|
|
|
3
3
|
import { BaseToolHandler } from './base-tool.js';
|
|
4
4
|
export declare class WorkflowToolHandler implements BaseToolHandler {
|
|
5
5
|
registerTools(server: McpServer, client: BusinessMapClient, readOnlyMode: boolean): void;
|
|
6
|
-
private registerListWorkflows;
|
|
7
|
-
private registerGetWorkflow;
|
|
8
|
-
private registerCreateWorkflow;
|
|
9
|
-
private registerUpdateWorkflow;
|
|
10
|
-
private registerLinkRelatedWorkflow;
|
|
11
|
-
private registerUnlinkRelatedWorkflow;
|
|
12
|
-
private registerGetWorkflowCycleTimeColumns;
|
|
13
|
-
private registerGetWorkflowEffectiveCycleTimeColumns;
|
|
14
6
|
}
|
|
15
7
|
//# sourceMappingURL=workflow-tools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-tools.d.ts","sourceRoot":"","sources":["../../../src/server/tools/workflow-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"workflow-tools.d.ts","sourceRoot":"","sources":["../../../src/server/tools/workflow-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAWvE,OAAO,EACL,eAAe,EAMhB,MAAM,gBAAgB,CAAC;AAExB,qBAAa,mBAAoB,YAAW,eAAe;IACzD,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,iBAAiB,EAAE,YAAY,EAAE,OAAO,GAAG,IAAI;CAoHzF"}
|