@bragduck/mcp 1.4.4 → 1.5.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/dist/index.js +28 -12
- package/dist/index.js.map +1 -1
- package/dist/org-preference.d.ts +7 -0
- package/dist/org-preference.js +22 -0
- package/dist/org-preference.js.map +1 -0
- package/dist/tools/list-organisations.d.ts +15 -0
- package/dist/tools/list-organisations.js +70 -0
- package/dist/tools/list-organisations.js.map +1 -0
- package/dist/tools/log-brag.js +3 -2
- package/dist/tools/log-brag.js.map +1 -1
- package/dist/tools/preview-brag.js +18 -20
- package/dist/tools/preview-brag.js.map +1 -1
- package/dist/tools/save-org-preference.d.ts +30 -0
- package/dist/tools/save-org-preference.js +43 -0
- package/dist/tools/save-org-preference.js.map +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4,10 +4,12 @@ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
|
|
|
4
4
|
import { CallToolRequestSchema, ErrorCode, ListToolsRequestSchema, McpError, } from '@modelcontextprotocol/sdk/types.js';
|
|
5
5
|
import { loginTool, handleLogin } from './tools/login.js';
|
|
6
6
|
import { logBragTool, handleLogBrag } from './tools/log-brag.js';
|
|
7
|
-
import {
|
|
7
|
+
import { handlePreviewBrag } from './tools/preview-brag.js';
|
|
8
8
|
import { listBragsTool, handleListBrags } from './tools/list-brags.js';
|
|
9
9
|
import { listObjectivesTool, handleListObjectives } from './tools/list-objectives.js';
|
|
10
10
|
import { linkBragToGoalTool, handleLinkBragToGoal } from './tools/link-brag-to-goal.js';
|
|
11
|
+
import { listOrganisationsTool, handleListOrganisations } from './tools/list-organisations.js';
|
|
12
|
+
import { saveOrgPreferenceTool, handleSaveOrgPreference } from './tools/save-org-preference.js';
|
|
11
13
|
const server = new Server({
|
|
12
14
|
name: 'bragduck',
|
|
13
15
|
version: '1.0.0',
|
|
@@ -46,17 +48,27 @@ const server = new Server({
|
|
|
46
48
|
'Stop the interview as soon as you have enough to write a strong brag. ' +
|
|
47
49
|
'Never ask more than 4 questions total.\n' +
|
|
48
50
|
'\n' +
|
|
49
|
-
'STEP 2 —
|
|
50
|
-
'
|
|
51
|
-
'
|
|
52
|
-
'
|
|
53
|
-
'
|
|
54
|
-
'
|
|
55
|
-
'
|
|
56
|
-
'If the user
|
|
51
|
+
'STEP 2 — SELECT ORGANISATION\n' +
|
|
52
|
+
'Before composing the brag, determine which company it belongs to:\n' +
|
|
53
|
+
'1. Call list_organisations. It returns the org list AND any saved preference for the current directory.\n' +
|
|
54
|
+
'2. If a saved preference exists, use that orgId silently — do not ask the user.\n' +
|
|
55
|
+
'3. If no saved preference, present the org list to the user and ask: "Which company does this belong to?" ' +
|
|
56
|
+
' Wait for their answer, then call save_org_preference with the chosen orgId and orgName.\n' +
|
|
57
|
+
'4. If the user has only one organisation, select it automatically and save the preference.\n' +
|
|
58
|
+
'5. If the user has no organisations, skip this step and proceed without an orgId.\n' +
|
|
57
59
|
'\n' +
|
|
58
|
-
'STEP 3 — LOG\n' +
|
|
59
|
-
'
|
|
60
|
+
'STEP 3 — PREVIEW + LOG\n' +
|
|
61
|
+
'Compose the brag from all gathered context. ' +
|
|
62
|
+
'Do NOT call preview_brag. Instead, in your response text render the brag fields ' +
|
|
63
|
+
'as a markdown table with two columns (Field | Value), one row per field, in this order: ' +
|
|
64
|
+
'Title, Type, Impact Level, Impact Details, Description, Tags, References, Organisation. ' +
|
|
65
|
+
'In the very same response, after the table, call log_brag with those field values (including orgId). ' +
|
|
66
|
+
'The native tool-permission prompt (Allow / Deny) that appears below the table IS the ' +
|
|
67
|
+
'confirmation — do not add any text question. ' +
|
|
68
|
+
'If the user denies or asks for changes, adjust and repeat this step.\n' +
|
|
69
|
+
'\n' +
|
|
70
|
+
'STEP 4 — DONE\n' +
|
|
71
|
+
'Once log_brag is allowed and succeeds, confirm with one short sentence.\n' +
|
|
60
72
|
'\n' +
|
|
61
73
|
'GENERAL RULES\n' +
|
|
62
74
|
'- Never fabricate details, metrics, or links. If unsure, ask.\n' +
|
|
@@ -65,7 +77,7 @@ const server = new Server({
|
|
|
65
77
|
});
|
|
66
78
|
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
67
79
|
return {
|
|
68
|
-
tools: [loginTool,
|
|
80
|
+
tools: [loginTool, logBragTool, listBragsTool, listObjectivesTool, linkBragToGoalTool, listOrganisationsTool, saveOrgPreferenceTool],
|
|
69
81
|
};
|
|
70
82
|
});
|
|
71
83
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
@@ -83,6 +95,10 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
83
95
|
return handleListObjectives();
|
|
84
96
|
case 'link_brag_to_goal':
|
|
85
97
|
return handleLinkBragToGoal(args);
|
|
98
|
+
case 'list_organisations':
|
|
99
|
+
return handleListOrganisations();
|
|
100
|
+
case 'save_org_preference':
|
|
101
|
+
return handleSaveOrgPreference(args);
|
|
86
102
|
default:
|
|
87
103
|
throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
|
|
88
104
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,SAAS,EACT,sBAAsB,EACtB,QAAQ,GACT,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,2CA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oBAAoB;YACvB,OAAO,uBAAuB,EAAE,CAAC;QACnC,KAAK,qBAAqB;YACxB,OAAO,uBAAuB,CAAC,IAAW,CAAC,CAAC;QAC9C;YACE,MAAM,IAAI,QAAQ,CAAC,SAAS,CAAC,cAAc,EAAE,iBAAiB,IAAI,EAAE,CAAC,CAAC;IAC1E,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import Conf from 'conf';
|
|
2
|
+
const APP_NAME = 'bragduck';
|
|
3
|
+
function getConfig() {
|
|
4
|
+
return new Conf({ projectName: APP_NAME });
|
|
5
|
+
}
|
|
6
|
+
export function getOrgPreference(cwd) {
|
|
7
|
+
try {
|
|
8
|
+
const config = getConfig();
|
|
9
|
+
const prefs = config.get('orgPreferences') || {};
|
|
10
|
+
return prefs[cwd] || null;
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export function saveOrgPreference(cwd, orgId, orgName) {
|
|
17
|
+
const config = getConfig();
|
|
18
|
+
const prefs = config.get('orgPreferences') || {};
|
|
19
|
+
prefs[cwd] = { orgId, orgName };
|
|
20
|
+
config.set('orgPreferences', prefs);
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=org-preference.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"org-preference.js","sourceRoot":"","sources":["../src/org-preference.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,QAAQ,GAAG,UAAU,CAAC;AAS5B,SAAS,SAAS;IAChB,OAAO,IAAI,IAAI,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,GAAW;IAC1C,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,KAAK,GAAI,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAoB,IAAI,EAAE,CAAC;QACrE,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,GAAW,EAAE,KAAa,EAAE,OAAe;IAC3E,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,KAAK,GAAI,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAoB,IAAI,EAAE,CAAC;IACrE,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;IAChC,MAAM,CAAC,GAAG,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const listOrganisationsTool: {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: "object";
|
|
6
|
+
properties: {};
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export declare function handleListOrganisations(): Promise<{
|
|
10
|
+
content: Array<{
|
|
11
|
+
type: string;
|
|
12
|
+
text: string;
|
|
13
|
+
}>;
|
|
14
|
+
isError?: boolean;
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { apiRequest } from '../api-client.js';
|
|
2
|
+
import { getUserInfo } from '../credentials.js';
|
|
3
|
+
import { getOrgPreference } from '../org-preference.js';
|
|
4
|
+
export const listOrganisationsTool = {
|
|
5
|
+
name: 'list_organisations',
|
|
6
|
+
description: 'List the user\'s organisations (companies) from BragDuck. ' +
|
|
7
|
+
'Also returns the saved organisation preference for the current working directory, if any. ' +
|
|
8
|
+
'Use this before logging a brag to determine which company to associate it with.',
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {},
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
export async function handleListOrganisations() {
|
|
15
|
+
try {
|
|
16
|
+
const userInfo = getUserInfo();
|
|
17
|
+
if (!userInfo) {
|
|
18
|
+
return {
|
|
19
|
+
content: [{
|
|
20
|
+
type: 'text',
|
|
21
|
+
text: 'Not authenticated with BragDuck. Please call the "login" tool first.',
|
|
22
|
+
}],
|
|
23
|
+
isError: true,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
const response = await apiRequest(`/v1/users/${userInfo.id}/organisations`);
|
|
27
|
+
if (response.items.length === 0) {
|
|
28
|
+
return {
|
|
29
|
+
content: [{
|
|
30
|
+
type: 'text',
|
|
31
|
+
text: 'No organisations found. You can add companies in the BragDuck web app.',
|
|
32
|
+
}],
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
const cwd = process.cwd();
|
|
36
|
+
const saved = getOrgPreference(cwd);
|
|
37
|
+
const lines = response.items.map((org) => {
|
|
38
|
+
const status = org.current ? 'current' : 'former';
|
|
39
|
+
return `- **${org.name}** (ID: ${org.id}, role: ${org.role}, ${status})`;
|
|
40
|
+
});
|
|
41
|
+
const savedLine = saved
|
|
42
|
+
? `\nSaved preference for this directory: **${saved.orgName}** (ID: ${saved.orgId})`
|
|
43
|
+
: '\nNo saved preference for this directory.';
|
|
44
|
+
return {
|
|
45
|
+
content: [{
|
|
46
|
+
type: 'text',
|
|
47
|
+
text: `Found ${response.items.length} organisation(s):\n\n${lines.join('\n')}${savedLine}`,
|
|
48
|
+
}],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
if (error instanceof Error && (error.message === 'NOT_AUTHENTICATED' || error.message === 'TOKEN_EXPIRED')) {
|
|
53
|
+
return {
|
|
54
|
+
content: [{
|
|
55
|
+
type: 'text',
|
|
56
|
+
text: 'Not authenticated with BragDuck. Please call the "login" tool first.',
|
|
57
|
+
}],
|
|
58
|
+
isError: true,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
content: [{
|
|
63
|
+
type: 'text',
|
|
64
|
+
text: `Failed to list organisations: ${error instanceof Error ? error.message : String(error)}`,
|
|
65
|
+
}],
|
|
66
|
+
isError: true,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=list-organisations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-organisations.js","sourceRoot":"","sources":["../../src/tools/list-organisations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAexD,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EACT,4DAA4D;QAC5D,4FAA4F;QAC5F,iFAAiF;IACnF,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE,EAAE;KACf;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,uBAAuB;IAI3C,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;QAC/B,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,OAAO;gBACL,OAAO,EAAE,CAAC;wBACR,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,sEAAsE;qBAC7E,CAAC;gBACF,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,UAAU,CAC/B,aAAa,QAAQ,CAAC,EAAE,gBAAgB,CACzC,CAAC;QAEF,IAAI,QAAQ,CAAC,KAAK,CAAC,MAAM,KAAK,CAA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D,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,iCAAiC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;iBAChG,CAAC;YACF,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/dist/tools/log-brag.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { apiRequest } from '../api-client.js';
|
|
2
2
|
export const logBragTool = {
|
|
3
3
|
name: 'log_brag',
|
|
4
|
-
description: 'Persist a career achievement (brag) to BragDuck
|
|
5
|
-
'
|
|
4
|
+
description: 'Persist a career achievement (brag) to BragDuck. ' +
|
|
5
|
+
'Call this in the same response as the preview table — the tool permission prompt (Allow/Deny) ' +
|
|
6
|
+
'that appears to the user IS the confirmation. Do not ask the user to type anything.',
|
|
6
7
|
inputSchema: {
|
|
7
8
|
type: 'object',
|
|
8
9
|
properties: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-brag.js","sourceRoot":"","sources":["../../src/tools/log-brag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,UAAU;IAChB,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"log-brag.js","sourceRoot":"","sources":["../../src/tools/log-brag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,UAAU;IAChB,WAAW,EACT,mDAAmD;QACnD,gGAAgG;QAChG,qFAAqF;IACvF,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;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
const impactLabel = IMPACT_LABELS[input.impact_level] ?? String(input.impact_level);
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
? input.references.join(', ')
|
|
85
|
-
: '—';
|
|
86
|
-
const lines = [
|
|
87
|
-
'## BragDuck — Preview',
|
|
88
|
-
'',
|
|
89
|
-
'| Field | Value |',
|
|
90
|
-
'|---|---|',
|
|
91
|
-
`| **Title** | ${input.title} |`,
|
|
92
|
-
`| **Type** | ${emoji} ${input.type} |`,
|
|
93
|
-
`| **Impact level** | ${impactLabel} |`,
|
|
94
|
-
`| **Impact details** | ${input.impact_description} |`,
|
|
95
|
-
`| **Description** | ${input.description.replace(/\n/g, ' ')} |`,
|
|
96
|
-
`| **Tags** | ${tagsValue} |`,
|
|
97
|
-
`| **References** | ${refsValue} |`,
|
|
98
|
-
'',
|
|
99
|
-
'**Does this look good? Approve to log it, or tell me what to change.**',
|
|
100
|
-
];
|
|
82
|
+
// Return structured data so the AI renders the table natively in its own
|
|
83
|
+
// response (AI-generated markdown renders correctly; tool-result text does not).
|
|
101
84
|
return {
|
|
102
|
-
content: [
|
|
85
|
+
content: [
|
|
86
|
+
{
|
|
87
|
+
type: 'text',
|
|
88
|
+
text: JSON.stringify({
|
|
89
|
+
title: input.title,
|
|
90
|
+
type: `${emoji} ${input.type}`,
|
|
91
|
+
impact_level: impactLabel,
|
|
92
|
+
impact_details: input.impact_description,
|
|
93
|
+
description: input.description,
|
|
94
|
+
tags: input.tags && input.tags.length > 0 ? input.tags.join(', ') : '—',
|
|
95
|
+
references: input.references && input.references.length > 0
|
|
96
|
+
? input.references.join(', ')
|
|
97
|
+
: '—',
|
|
98
|
+
}),
|
|
99
|
+
},
|
|
100
|
+
],
|
|
103
101
|
};
|
|
104
102
|
}
|
|
105
103
|
//# sourceMappingURL=preview-brag.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview-brag.js","sourceRoot":"","sources":["../../src/tools/preview-brag.ts"],"names":[],"mappings":"AAAA,MAAM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AAU,EACR,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC;wBAC7C,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;wBAC7B,CAAC,CAAC,GAAG;iBACV,CAAC;aACH;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const saveOrgPreferenceTool: {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: "object";
|
|
6
|
+
properties: {
|
|
7
|
+
orgId: {
|
|
8
|
+
type: string;
|
|
9
|
+
description: string;
|
|
10
|
+
};
|
|
11
|
+
orgName: {
|
|
12
|
+
type: string;
|
|
13
|
+
description: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
required: string[];
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
interface SaveOrgPreferenceInput {
|
|
20
|
+
orgId: string;
|
|
21
|
+
orgName: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function handleSaveOrgPreference(input: SaveOrgPreferenceInput): Promise<{
|
|
24
|
+
content: Array<{
|
|
25
|
+
type: string;
|
|
26
|
+
text: string;
|
|
27
|
+
}>;
|
|
28
|
+
isError?: boolean;
|
|
29
|
+
}>;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { saveOrgPreference } from '../org-preference.js';
|
|
2
|
+
export const saveOrgPreferenceTool = {
|
|
3
|
+
name: 'save_org_preference',
|
|
4
|
+
description: 'Save the organisation preference for the current working directory. ' +
|
|
5
|
+
'Call this after the user selects which company a brag belongs to, ' +
|
|
6
|
+
'so the same choice is remembered for future brags in this directory.',
|
|
7
|
+
inputSchema: {
|
|
8
|
+
type: 'object',
|
|
9
|
+
properties: {
|
|
10
|
+
orgId: {
|
|
11
|
+
type: 'string',
|
|
12
|
+
description: 'The organisation ID to save as the preference for this directory',
|
|
13
|
+
},
|
|
14
|
+
orgName: {
|
|
15
|
+
type: 'string',
|
|
16
|
+
description: 'The organisation name (for display purposes)',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
required: ['orgId', 'orgName'],
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
export async function handleSaveOrgPreference(input) {
|
|
23
|
+
try {
|
|
24
|
+
const cwd = process.cwd();
|
|
25
|
+
saveOrgPreference(cwd, input.orgId, input.orgName);
|
|
26
|
+
return {
|
|
27
|
+
content: [{
|
|
28
|
+
type: 'text',
|
|
29
|
+
text: `Saved: brags in this directory will be associated with **${input.orgName}**.`,
|
|
30
|
+
}],
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
return {
|
|
35
|
+
content: [{
|
|
36
|
+
type: 'text',
|
|
37
|
+
text: `Failed to save preference: ${error instanceof Error ? error.message : String(error)}`,
|
|
38
|
+
}],
|
|
39
|
+
isError: true,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=save-org-preference.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"save-org-preference.js","sourceRoot":"","sources":["../../src/tools/save-org-preference.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EACT,sEAAsE;QACtE,oEAAoE;QACpE,sEAAsE;IACxE,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kEAAkE;aAChF;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,8CAA8C;aAC5D;SACF;QACD,QAAQ,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC;KAC/B;CACF,CAAC;AAOF,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,KAA6B;IAE7B,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAC1B,iBAAiB,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QACnD,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,4DAA4D,KAAK,CAAC,OAAO,KAAK;iBACrF,CAAC;SACH,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,8BAA8B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;iBAC7F,CAAC;YACF,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC"}
|