@bragduck/mcp 1.4.7 → 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 CHANGED
@@ -8,6 +8,8 @@ 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,26 @@ 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 — PREVIEW + LOG\n' +
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' +
59
+ '\n' +
60
+ 'STEP 3 — PREVIEW + LOG\n' +
50
61
  'Compose the brag from all gathered context. ' +
51
62
  'Do NOT call preview_brag. Instead, in your response text render the brag fields ' +
52
63
  'as a markdown table with two columns (Field | Value), one row per field, in this order: ' +
53
- 'Title, Type, Impact Level, Impact Details, Description, Tags, References. ' +
54
- 'In the very same response, after the table, call log_brag with those field values. ' +
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). ' +
55
66
  'The native tool-permission prompt (Allow / Deny) that appears below the table IS the ' +
56
67
  'confirmation — do not add any text question. ' +
57
68
  'If the user denies or asks for changes, adjust and repeat this step.\n' +
58
69
  '\n' +
59
- 'STEP 3 — DONE\n' +
70
+ 'STEP 4 — DONE\n' +
60
71
  'Once log_brag is allowed and succeeds, confirm with one short sentence.\n' +
61
72
  '\n' +
62
73
  'GENERAL RULES\n' +
@@ -66,7 +77,7 @@ const server = new Server({
66
77
  });
67
78
  server.setRequestHandler(ListToolsRequestSchema, async () => {
68
79
  return {
69
- tools: [loginTool, logBragTool, listBragsTool, listObjectivesTool, linkBragToGoalTool],
80
+ tools: [loginTool, logBragTool, listBragsTool, listObjectivesTool, linkBragToGoalTool, listOrganisationsTool, saveOrgPreferenceTool],
70
81
  };
71
82
  });
72
83
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
@@ -84,6 +95,10 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
84
95
  return handleListObjectives();
85
96
  case 'link_brag_to_goal':
86
97
  return handleLinkBragToGoal(args);
98
+ case 'list_organisations':
99
+ return handleListOrganisations();
100
+ case 'save_org_preference':
101
+ return handleSaveOrgPreference(args);
87
102
  default:
88
103
  throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
89
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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AACH,CAAC,CAAC,CAAC;AAEH,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ interface OrgPreference {
2
+ orgId: string;
3
+ orgName: string;
4
+ }
5
+ export declare function getOrgPreference(cwd: string): OrgPreference | null;
6
+ export declare function saveOrgPreference(cwd: string, orgId: string, orgName: string): void;
7
+ export {};
@@ -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,MA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AG,SAAS,EAAE;iBAC3F,CAAC;SACH,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,KAAK,mBAAmB,IAAI,KAAK,CAAC,OAAO,KAAK,eAAe,CAAC,EAAE,CAAC;YAC3G,OAAO;gBACL,OAAO,EAAE,CAAC;wBACR,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,sEAAsE;qBAC7E,CAAC;gBACF,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;QACD,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"}
@@ -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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bragduck/mcp",
3
- "version": "1.4.7",
3
+ "version": "1.5.0",
4
4
  "description": "BragDuck MCP server for logging career achievements from AI agents",
5
5
  "type": "module",
6
6
  "bin": {