@bragduck/mcp 1.7.0 → 1.8.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/README.md +29 -0
- package/dist/index.js +2006 -122
- package/dist/index.js.map +1 -1
- package/package.json +8 -4
- package/dist/api-client.d.ts +0 -29
- package/dist/api-client.js +0 -146
- package/dist/api-client.js.map +0 -1
- package/dist/auth.d.ts +0 -8
- package/dist/auth.js +0 -202
- package/dist/auth.js.map +0 -1
- package/dist/credentials.d.ts +0 -31
- package/dist/credentials.js +0 -150
- package/dist/credentials.js.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/org-preference.d.ts +0 -7
- package/dist/org-preference.js +0 -22
- package/dist/org-preference.js.map +0 -1
- package/dist/tools/link-brag-to-key-result.d.ts +0 -30
- package/dist/tools/link-brag-to-key-result.js +0 -81
- package/dist/tools/link-brag-to-key-result.js.map +0 -1
- package/dist/tools/list-brags.d.ts +0 -53
- package/dist/tools/list-brags.js +0 -110
- package/dist/tools/list-brags.js.map +0 -1
- package/dist/tools/list-objectives.d.ts +0 -15
- package/dist/tools/list-objectives.js +0 -66
- package/dist/tools/list-objectives.js.map +0 -1
- package/dist/tools/list-organisations.d.ts +0 -15
- package/dist/tools/list-organisations.js +0 -73
- package/dist/tools/list-organisations.js.map +0 -1
- package/dist/tools/list-stories.d.ts +0 -41
- package/dist/tools/list-stories.js +0 -103
- package/dist/tools/list-stories.js.map +0 -1
- package/dist/tools/log-brag.d.ts +0 -88
- package/dist/tools/log-brag.js +0 -175
- package/dist/tools/log-brag.js.map +0 -1
- package/dist/tools/log-story.d.ts +0 -81
- package/dist/tools/log-story.js +0 -122
- package/dist/tools/log-story.js.map +0 -1
- package/dist/tools/login.d.ts +0 -24
- package/dist/tools/login.js +0 -46
- package/dist/tools/login.js.map +0 -1
- package/dist/tools/preview-brag.d.ts +0 -71
- package/dist/tools/preview-brag.js +0 -103
- package/dist/tools/preview-brag.js.map +0 -1
- package/dist/tools/quick-brag.d.ts +0 -38
- package/dist/tools/quick-brag.js +0 -143
- package/dist/tools/quick-brag.js.map +0 -1
- package/dist/tools/save-org-preference.d.ts +0 -30
- package/dist/tools/save-org-preference.js +0 -47
- package/dist/tools/save-org-preference.js.map +0 -1
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
const IMPACT_LABELS = {
|
|
2
|
-
0: 'None (personal learning / routine)',
|
|
3
|
-
1: 'Low (individual contributor impact)',
|
|
4
|
-
2: 'Medium (team-level impact)',
|
|
5
|
-
3: 'High (organisation-level impact)',
|
|
6
|
-
};
|
|
7
|
-
const TYPE_EMOJIS = {
|
|
8
|
-
progress: '📈',
|
|
9
|
-
achievement: '🏆',
|
|
10
|
-
recognition: '🌟',
|
|
11
|
-
support: '🤝',
|
|
12
|
-
code: '💻',
|
|
13
|
-
leadership: '🧭',
|
|
14
|
-
learning: '📚',
|
|
15
|
-
collaboration: '👥',
|
|
16
|
-
challenge: '⚔️',
|
|
17
|
-
innovation: '💡',
|
|
18
|
-
meeting: '🗣️',
|
|
19
|
-
bug: '🐛',
|
|
20
|
-
others: '📌',
|
|
21
|
-
};
|
|
22
|
-
export const previewBragTool = {
|
|
23
|
-
name: 'preview_brag',
|
|
24
|
-
description: 'Show the user a formatted preview of a proposed brag BEFORE logging it. ' +
|
|
25
|
-
'Only call this when: (1) the user has confirmed they want to log a brag, ' +
|
|
26
|
-
'(2) you have assessed the achievement as bragable, and ' +
|
|
27
|
-
'(3) you have enough concrete detail to fill every required field without fabricating. ' +
|
|
28
|
-
'If any of those conditions are not met, do not call this — ask clarifying questions instead.',
|
|
29
|
-
inputSchema: {
|
|
30
|
-
type: 'object',
|
|
31
|
-
properties: {
|
|
32
|
-
title: {
|
|
33
|
-
type: 'string',
|
|
34
|
-
minLength: 10,
|
|
35
|
-
maxLength: 200,
|
|
36
|
-
description: 'Short title of the achievement (10-200 characters)',
|
|
37
|
-
},
|
|
38
|
-
description: {
|
|
39
|
-
type: 'string',
|
|
40
|
-
minLength: 50,
|
|
41
|
-
maxLength: 2000,
|
|
42
|
-
description: 'Detailed description of what was accomplished and its impact (50-2000 characters)',
|
|
43
|
-
},
|
|
44
|
-
type: {
|
|
45
|
-
type: 'string',
|
|
46
|
-
enum: [
|
|
47
|
-
'progress', 'achievement', 'recognition', 'support', 'code',
|
|
48
|
-
'leadership', 'learning', 'collaboration', 'challenge', 'innovation',
|
|
49
|
-
'meeting', 'bug', 'others',
|
|
50
|
-
],
|
|
51
|
-
description: 'Category that best fits this achievement',
|
|
52
|
-
},
|
|
53
|
-
impact_level: {
|
|
54
|
-
type: 'number',
|
|
55
|
-
enum: [0, 1, 2, 3],
|
|
56
|
-
description: '0=none, 1=low (individual), 2=medium (team), 3=high (org)',
|
|
57
|
-
},
|
|
58
|
-
impact_description: {
|
|
59
|
-
type: 'string',
|
|
60
|
-
description: 'Narrative of the impact. Start with scope (Individual/Team/Organization), ' +
|
|
61
|
-
'then 1-3 measurable outcomes.',
|
|
62
|
-
},
|
|
63
|
-
tags: {
|
|
64
|
-
type: 'array',
|
|
65
|
-
items: { type: 'string', minLength: 2, maxLength: 30 },
|
|
66
|
-
maxItems: 10,
|
|
67
|
-
description: 'Tags to categorise the brag',
|
|
68
|
-
},
|
|
69
|
-
references: {
|
|
70
|
-
type: 'array',
|
|
71
|
-
items: { type: 'string', format: 'uri' },
|
|
72
|
-
maxItems: 10,
|
|
73
|
-
description: 'URLs: PRs, tickets, commits, design docs, etc.',
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
required: ['title', 'description', 'type', 'impact_level', 'impact_description'],
|
|
77
|
-
},
|
|
78
|
-
};
|
|
79
|
-
export function handlePreviewBrag(input) {
|
|
80
|
-
const emoji = TYPE_EMOJIS[input.type] ?? '📌';
|
|
81
|
-
const impactLabel = IMPACT_LABELS[input.impact_level] ?? String(input.impact_level);
|
|
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).
|
|
84
|
-
return {
|
|
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
|
-
],
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
//# sourceMappingURL=preview-brag.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preview-brag.js","sourceRoot":"","sources":["../../src/tools/preview-brag.ts"],"names":[],"mappings":"AAAA,MAAM,aAAa,GAA2B;IAC5C,CAAC,EAAE,oCAAoC;IACvC,CAAC,EAAE,qCAAqC;IACxC,CAAC,EAAE,4BAA4B;IAC/B,CAAC,EAAE,kCAAkC;CACtC,CAAC;AAEF,MAAM,WAAW,GAA2B;IAC1C,QAAQ,EAAE,IAAI;IACd,WAAW,EAAE,IAAI;IACjB,WAAW,EAAE,IAAI;IACjB,OAAO,EAAE,IAAI;IACb,IAAI,EAAE,IAAI;IACV,UAAU,EAAE,IAAI;IAChB,QAAQ,EAAE,IAAI;IACd,aAAa,EAAE,IAAI;IACnB,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE,KAAK;IACd,GAAG,EAAE,IAAI;IACT,MAAM,EAAE,IAAI;CACb,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,cAAc;IACpB,WAAW,EACT,0EAA0E;QAC1E,2EAA2E;QAC3E,yDAAyD;QACzD,wFAAwF;QACxF,8FAA8F;IAChG,WAAW,EAAE;QACX,IAAI,EAAE,QA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AAoB,CAAC;KACjF;CACF,CAAC;AAYF,MAAM,UAAU,iBAAiB,CAC/B,KAAuB;IAEvB,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;IAC9C,MAAM,WAAW,GAAG,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAEpF,yEAAyE;IACzE,iFAAiF;IACjF,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;oBACnB,KAAK,EAAE,KAAK,CAAC,KAAK;oBAClB,IAAI,EAAE,GAAG,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE;oBAC9B,YAAY,EAAE,WAAW;oBACzB,cAAc,EAAE,KAAK,CAAC,kBAAkB;oBACxC,WAAW,EAAE,KAAK,CAAC,WAAW;oBAC9B,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG;oBACvE,UAAU,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"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export declare const quickBragTool: {
|
|
2
|
-
name: string;
|
|
3
|
-
description: string;
|
|
4
|
-
inputSchema: {
|
|
5
|
-
type: "object";
|
|
6
|
-
properties: {
|
|
7
|
-
text: {
|
|
8
|
-
type: string;
|
|
9
|
-
minLength: number;
|
|
10
|
-
maxLength: number;
|
|
11
|
-
description: string;
|
|
12
|
-
};
|
|
13
|
-
orgId: {
|
|
14
|
-
type: string;
|
|
15
|
-
description: string;
|
|
16
|
-
};
|
|
17
|
-
agent: {
|
|
18
|
-
type: string;
|
|
19
|
-
maxLength: number;
|
|
20
|
-
description: string;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
required: string[];
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
interface QuickBragInput {
|
|
27
|
-
text: string;
|
|
28
|
-
orgId?: string;
|
|
29
|
-
agent?: string;
|
|
30
|
-
}
|
|
31
|
-
export declare function handleQuickBrag(input: QuickBragInput): Promise<{
|
|
32
|
-
content: Array<{
|
|
33
|
-
type: string;
|
|
34
|
-
text: string;
|
|
35
|
-
}>;
|
|
36
|
-
isError?: boolean;
|
|
37
|
-
}>;
|
|
38
|
-
export {};
|
package/dist/tools/quick-brag.js
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import { apiRequest, requirePaidPlan } from '../api-client.js';
|
|
2
|
-
export const quickBragTool = {
|
|
3
|
-
name: 'quick_brag',
|
|
4
|
-
description: 'Log a brag from raw text. Accepts free-form text (a sentence, paragraph, or paste from a message/PR/doc) ' +
|
|
5
|
-
'and uses AI to extract and structure it into a proper brag. The AI will parse the text into a title, ' +
|
|
6
|
-
'description, type, impact, and tags, then log it. Use this when the user says "/brag" followed by text, ' +
|
|
7
|
-
'or pastes something and asks to log it as a brag.',
|
|
8
|
-
inputSchema: {
|
|
9
|
-
type: 'object',
|
|
10
|
-
properties: {
|
|
11
|
-
text: {
|
|
12
|
-
type: 'string',
|
|
13
|
-
minLength: 10,
|
|
14
|
-
maxLength: 5000,
|
|
15
|
-
description: 'Raw text describing the achievement. Can be a sentence, paragraph, paste from a PR description, ' +
|
|
16
|
-
'Slack message, commit message, or any free-form text. The AI will extract brag fields from it.',
|
|
17
|
-
},
|
|
18
|
-
orgId: {
|
|
19
|
-
type: 'string',
|
|
20
|
-
description: 'Organisation ID to associate the brag with (optional)',
|
|
21
|
-
},
|
|
22
|
-
agent: {
|
|
23
|
-
type: 'string',
|
|
24
|
-
maxLength: 50,
|
|
25
|
-
description: 'Optional AI agent/client name, e.g. "claude", "cursor", "copilot".',
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
required: ['text'],
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
function toAgentExternalType(agent) {
|
|
32
|
-
if (!agent)
|
|
33
|
-
return undefined;
|
|
34
|
-
const normalized = agent
|
|
35
|
-
.trim()
|
|
36
|
-
.toLowerCase()
|
|
37
|
-
.replace(/\s+/g, '-')
|
|
38
|
-
.replace(/[^a-z0-9_-]/g, '');
|
|
39
|
-
if (normalized.length === 0)
|
|
40
|
-
return undefined;
|
|
41
|
-
return `agent:${normalized.slice(0, 50)}`;
|
|
42
|
-
}
|
|
43
|
-
export async function handleQuickBrag(input) {
|
|
44
|
-
const planError = await requirePaidPlan();
|
|
45
|
-
if (planError)
|
|
46
|
-
return planError;
|
|
47
|
-
try {
|
|
48
|
-
// Step 1: Refine raw text into structured brag via AI
|
|
49
|
-
const refined = await apiRequest('/v1/brags/refine', {
|
|
50
|
-
method: 'POST',
|
|
51
|
-
body: { brags: [{ text: input.text }] },
|
|
52
|
-
});
|
|
53
|
-
if (!refined.refined_brags || refined.refined_brags.length === 0) {
|
|
54
|
-
return {
|
|
55
|
-
content: [{
|
|
56
|
-
type: 'text',
|
|
57
|
-
text: 'Could not extract a brag from the provided text. Try adding more detail about what was accomplished and its impact.',
|
|
58
|
-
}],
|
|
59
|
-
isError: true,
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
// Step 2: Log the refined brag
|
|
63
|
-
const extracted = refined.refined_brags[0];
|
|
64
|
-
const brag = {
|
|
65
|
-
title: extracted.refined_title,
|
|
66
|
-
description: extracted.refined_description,
|
|
67
|
-
tags: extracted.suggested_tags || [],
|
|
68
|
-
date: new Date().toISOString(),
|
|
69
|
-
visibility: 'private',
|
|
70
|
-
impactLevel: extracted.suggested_impactLevel,
|
|
71
|
-
impact_description: extracted.impact_description || '',
|
|
72
|
-
typeKey: extracted.suggested_type_key,
|
|
73
|
-
};
|
|
74
|
-
const allLinks = [
|
|
75
|
-
...(extracted.extracted_links || []),
|
|
76
|
-
...(extracted.attachments || []),
|
|
77
|
-
].filter(Boolean);
|
|
78
|
-
if (allLinks.length > 0)
|
|
79
|
-
brag.attachments = allLinks;
|
|
80
|
-
if (input.orgId)
|
|
81
|
-
brag.orgId = input.orgId;
|
|
82
|
-
const agentExternalType = toAgentExternalType(input.agent);
|
|
83
|
-
if (agentExternalType)
|
|
84
|
-
brag.externalType = agentExternalType;
|
|
85
|
-
const response = await apiRequest('/v1/brags', {
|
|
86
|
-
method: 'POST',
|
|
87
|
-
body: { brags: [brag], source: 'mcp' },
|
|
88
|
-
});
|
|
89
|
-
// Check for validation errors first
|
|
90
|
-
if (response.errors && response.errors.length > 0) {
|
|
91
|
-
const errorMessages = response.errors.map((e) => e.message).join('; ');
|
|
92
|
-
return {
|
|
93
|
-
content: [{
|
|
94
|
-
type: 'text',
|
|
95
|
-
text: `Failed to create brag: ${errorMessages}`,
|
|
96
|
-
}],
|
|
97
|
-
isError: true,
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
if (response.brags && response.brags.length > 0) {
|
|
101
|
-
const created = response.brags[0];
|
|
102
|
-
const lines = [
|
|
103
|
-
`Brag logged: "${created.title}"`,
|
|
104
|
-
`${created.url}`,
|
|
105
|
-
];
|
|
106
|
-
if (created.keyResultIds && created.keyResultIds.length > 0) {
|
|
107
|
-
lines.push(`Automatically linked to key result: ${created.keyResultIds[0]}`);
|
|
108
|
-
}
|
|
109
|
-
return {
|
|
110
|
-
content: [{
|
|
111
|
-
type: 'text',
|
|
112
|
-
text: lines.join('\n'),
|
|
113
|
-
}],
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
return {
|
|
117
|
-
content: [{
|
|
118
|
-
type: 'text',
|
|
119
|
-
text: 'Server returned no brag and no error detail',
|
|
120
|
-
}],
|
|
121
|
-
isError: true,
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
catch (error) {
|
|
125
|
-
if (error instanceof Error && (error.message === 'NOT_AUTHENTICATED' || error.message === 'TOKEN_EXPIRED')) {
|
|
126
|
-
return {
|
|
127
|
-
content: [{
|
|
128
|
-
type: 'text',
|
|
129
|
-
text: 'Not authenticated with BragDuck. Please call the "login" tool first.',
|
|
130
|
-
}],
|
|
131
|
-
isError: true,
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
return {
|
|
135
|
-
content: [{
|
|
136
|
-
type: 'text',
|
|
137
|
-
text: `Error: ${error instanceof Error ? error.message : String(error)}`,
|
|
138
|
-
}],
|
|
139
|
-
isError: true,
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
//# sourceMappingURL=quick-brag.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"quick-brag.js","sourceRoot":"","sources":["../../src/tools/quick-brag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAG/D,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,YAAY;IAClB,WAAW,EACT,2GAA2G;QAC3G,uGAAuG;QACvG,0GAA0G;QAC1G,mDAAmD;IACrD,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,SAAS,EAAE,EAAE;gBACb,SAAS,EAAE,IAAI;gBACf,WAAW,EACT,kGAAkG;oBAClG,gGAAgG;aACnG;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,uDAAuD;aACrE;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,SAAS,EAAE,EAAE;gBACb,WAAW,EAAE,oEAAoE;aAClF;SACF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,EAAE,CAAC;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,UAAU,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;iBACzE,CAAC;YACF,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { requirePaidPlan } from '../api-client.js';
|
|
2
|
-
import { saveOrgPreference } from '../org-preference.js';
|
|
3
|
-
export const saveOrgPreferenceTool = {
|
|
4
|
-
name: 'save_org_preference',
|
|
5
|
-
description: 'Save the organisation preference for the current working directory. ' +
|
|
6
|
-
'Call this after the user selects which company a brag belongs to, ' +
|
|
7
|
-
'so the same choice is remembered for future brags in this directory.',
|
|
8
|
-
inputSchema: {
|
|
9
|
-
type: 'object',
|
|
10
|
-
properties: {
|
|
11
|
-
orgId: {
|
|
12
|
-
type: 'string',
|
|
13
|
-
description: 'The organisation ID to save as the preference for this directory',
|
|
14
|
-
},
|
|
15
|
-
orgName: {
|
|
16
|
-
type: 'string',
|
|
17
|
-
description: 'The organisation name (for display purposes)',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
required: ['orgId', 'orgName'],
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
export async function handleSaveOrgPreference(input) {
|
|
24
|
-
const planError = await requirePaidPlan();
|
|
25
|
-
if (planError)
|
|
26
|
-
return planError;
|
|
27
|
-
try {
|
|
28
|
-
const cwd = process.cwd();
|
|
29
|
-
saveOrgPreference(cwd, input.orgId, input.orgName);
|
|
30
|
-
return {
|
|
31
|
-
content: [{
|
|
32
|
-
type: 'text',
|
|
33
|
-
text: `Saved: brags in this directory will be associated with **${input.orgName}**.`,
|
|
34
|
-
}],
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
catch (error) {
|
|
38
|
-
return {
|
|
39
|
-
content: [{
|
|
40
|
-
type: 'text',
|
|
41
|
-
text: `Failed to save preference: ${error instanceof Error ? error.message : String(error)}`,
|
|
42
|
-
}],
|
|
43
|
-
isError: true,
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=save-org-preference.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"save-org-preference.js","sourceRoot":"","sources":["../../src/tools/save-org-preference.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,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,IA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