@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.
Files changed (50) hide show
  1. package/README.md +29 -0
  2. package/dist/index.js +2006 -122
  3. package/dist/index.js.map +1 -1
  4. package/package.json +8 -4
  5. package/dist/api-client.d.ts +0 -29
  6. package/dist/api-client.js +0 -146
  7. package/dist/api-client.js.map +0 -1
  8. package/dist/auth.d.ts +0 -8
  9. package/dist/auth.js +0 -202
  10. package/dist/auth.js.map +0 -1
  11. package/dist/credentials.d.ts +0 -31
  12. package/dist/credentials.js +0 -150
  13. package/dist/credentials.js.map +0 -1
  14. package/dist/index.d.ts +0 -2
  15. package/dist/org-preference.d.ts +0 -7
  16. package/dist/org-preference.js +0 -22
  17. package/dist/org-preference.js.map +0 -1
  18. package/dist/tools/link-brag-to-key-result.d.ts +0 -30
  19. package/dist/tools/link-brag-to-key-result.js +0 -81
  20. package/dist/tools/link-brag-to-key-result.js.map +0 -1
  21. package/dist/tools/list-brags.d.ts +0 -53
  22. package/dist/tools/list-brags.js +0 -110
  23. package/dist/tools/list-brags.js.map +0 -1
  24. package/dist/tools/list-objectives.d.ts +0 -15
  25. package/dist/tools/list-objectives.js +0 -66
  26. package/dist/tools/list-objectives.js.map +0 -1
  27. package/dist/tools/list-organisations.d.ts +0 -15
  28. package/dist/tools/list-organisations.js +0 -73
  29. package/dist/tools/list-organisations.js.map +0 -1
  30. package/dist/tools/list-stories.d.ts +0 -41
  31. package/dist/tools/list-stories.js +0 -103
  32. package/dist/tools/list-stories.js.map +0 -1
  33. package/dist/tools/log-brag.d.ts +0 -88
  34. package/dist/tools/log-brag.js +0 -175
  35. package/dist/tools/log-brag.js.map +0 -1
  36. package/dist/tools/log-story.d.ts +0 -81
  37. package/dist/tools/log-story.js +0 -122
  38. package/dist/tools/log-story.js.map +0 -1
  39. package/dist/tools/login.d.ts +0 -24
  40. package/dist/tools/login.js +0 -46
  41. package/dist/tools/login.js.map +0 -1
  42. package/dist/tools/preview-brag.d.ts +0 -71
  43. package/dist/tools/preview-brag.js +0 -103
  44. package/dist/tools/preview-brag.js.map +0 -1
  45. package/dist/tools/quick-brag.d.ts +0 -38
  46. package/dist/tools/quick-brag.js +0 -143
  47. package/dist/tools/quick-brag.js.map +0 -1
  48. package/dist/tools/save-org-preference.d.ts +0 -30
  49. package/dist/tools/save-org-preference.js +0 -47
  50. package/dist/tools/save-org-preference.js.map +0 -1
@@ -1,88 +0,0 @@
1
- export declare const logBragTool: {
2
- name: string;
3
- description: string;
4
- inputSchema: {
5
- type: "object";
6
- properties: {
7
- title: {
8
- type: string;
9
- minLength: number;
10
- maxLength: number;
11
- description: string;
12
- };
13
- description: {
14
- type: string;
15
- minLength: number;
16
- maxLength: number;
17
- description: string;
18
- };
19
- tags: {
20
- type: string;
21
- items: {
22
- type: string;
23
- minLength: number;
24
- maxLength: number;
25
- };
26
- maxItems: number;
27
- description: string;
28
- };
29
- date: {
30
- type: string;
31
- description: string;
32
- };
33
- impact_level: {
34
- type: string;
35
- enum: number[];
36
- description: string;
37
- };
38
- impact_description: {
39
- type: string;
40
- description: string;
41
- };
42
- type: {
43
- type: string;
44
- enum: string[];
45
- description: string;
46
- };
47
- references: {
48
- type: string;
49
- items: {
50
- type: string;
51
- format: string;
52
- };
53
- maxItems: number;
54
- description: string;
55
- };
56
- orgId: {
57
- type: string;
58
- description: string;
59
- };
60
- agent: {
61
- type: string;
62
- maxLength: number;
63
- description: string;
64
- };
65
- };
66
- required: string[];
67
- };
68
- };
69
- interface LogBragInput {
70
- title: string;
71
- description: string;
72
- type: string;
73
- impact_level: number;
74
- impact_description: string;
75
- tags?: string[];
76
- date?: string;
77
- references?: string[];
78
- orgId?: string;
79
- agent?: string;
80
- }
81
- export declare function handleLogBrag(input: LogBragInput): Promise<{
82
- content: Array<{
83
- type: string;
84
- text: string;
85
- }>;
86
- isError?: boolean;
87
- }>;
88
- export {};
@@ -1,175 +0,0 @@
1
- import { apiRequest, requirePaidPlan } from '../api-client.js';
2
- export const logBragTool = {
3
- name: 'log_brag',
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.',
7
- inputSchema: {
8
- type: 'object',
9
- properties: {
10
- title: {
11
- type: 'string',
12
- minLength: 10,
13
- maxLength: 200,
14
- description: 'Short title of the achievement (must be 10-200 characters)',
15
- },
16
- description: {
17
- type: 'string',
18
- minLength: 50,
19
- maxLength: 2000,
20
- description: 'Detailed description of what was accomplished and its impact (must be 50-2000 characters)',
21
- },
22
- tags: {
23
- type: 'array',
24
- items: { type: 'string', minLength: 2, maxLength: 30 },
25
- maxItems: 10,
26
- description: 'Tags to categorize the brag (e.g., "performance", "leadership", "backend"). Each tag must be 2-30 characters. Maximum 10 tags.',
27
- },
28
- date: {
29
- type: 'string',
30
- description: 'ISO datetime string for when this happened (defaults to now)',
31
- },
32
- impact_level: {
33
- type: 'number',
34
- enum: [0, 1, 2, 3],
35
- description: 'Impact level of the achievement. ' +
36
- '0 = none (personal learning, routine tasks). ' +
37
- '1 = low (individual contributor impact, fixed small bug). ' +
38
- '2 = medium (team-level impact, improved team process, led project). ' +
39
- '3 = high (organization-level impact, reduced costs, improved key metrics).',
40
- },
41
- impact_description: {
42
- type: 'string',
43
- description: 'Narrative description of the impact. ' +
44
- 'Start with scope (Individual/Team/Organization/Company-wide), ' +
45
- 'then include 1-3 measurable outcomes. ' +
46
- 'Example: "Team impact: Reduced deploy time by 60%, unblocking 4 engineers"',
47
- },
48
- type: {
49
- type: 'string',
50
- enum: [
51
- 'progress',
52
- 'achievement',
53
- 'recognition',
54
- 'support',
55
- 'code',
56
- 'leadership',
57
- 'learning',
58
- 'collaboration',
59
- 'challenge',
60
- 'innovation',
61
- 'meeting',
62
- 'bug',
63
- 'others',
64
- ],
65
- description: 'Type of achievement. Choose the most appropriate category for this brag.',
66
- },
67
- references: {
68
- type: 'array',
69
- items: { type: 'string', format: 'uri' },
70
- maxItems: 10,
71
- description: 'URLs to reference materials for this achievement. ' +
72
- 'Include any relevant links that provide context or proof: ' +
73
- 'pull request URLs, Jira/Linear tickets, commit URLs, design docs, Notion pages, etc. ' +
74
- 'Example: ["https://github.com/org/repo/pull/123", "https://jira.company.com/browse/PROJ-456"]',
75
- },
76
- orgId: {
77
- type: 'string',
78
- description: 'Organisation ID to associate the brag with',
79
- },
80
- agent: {
81
- type: 'string',
82
- maxLength: 50,
83
- description: 'Optional AI agent/client name for MCP-origin brags, e.g. "claude", "codex", "cursor", or "copilot".',
84
- },
85
- },
86
- required: ['title', 'description', 'type', 'impact_level', 'impact_description', 'references'],
87
- },
88
- };
89
- function toAgentExternalType(agent) {
90
- if (!agent)
91
- return undefined;
92
- const normalized = agent
93
- .trim()
94
- .toLowerCase()
95
- .replace(/\s+/g, '-')
96
- .replace(/[^a-z0-9_-]/g, '');
97
- if (normalized.length === 0)
98
- return undefined;
99
- return `agent:${normalized.slice(0, 50)}`;
100
- }
101
- export async function handleLogBrag(input) {
102
- const planError = await requirePaidPlan();
103
- if (planError)
104
- return planError;
105
- try {
106
- const brag = {
107
- title: input.title,
108
- message: input.description,
109
- description: input.description,
110
- tags: input.tags || [],
111
- date: input.date || new Date().toISOString(),
112
- visibility: 'private',
113
- };
114
- if (input.impact_level !== undefined)
115
- brag.impactLevel = input.impact_level;
116
- if (input.impact_description)
117
- brag.impact_description = input.impact_description;
118
- if (input.type)
119
- brag.typeKey = input.type;
120
- if (input.references && input.references.length > 0)
121
- brag.attachments = input.references;
122
- if (input.orgId)
123
- brag.orgId = input.orgId;
124
- const agentExternalType = toAgentExternalType(input.agent);
125
- if (agentExternalType)
126
- brag.externalType = agentExternalType;
127
- const response = await apiRequest('/v1/brags', {
128
- method: 'POST',
129
- body: { brags: [brag], source: 'mcp' },
130
- });
131
- if (response.brags && response.brags.length > 0) {
132
- const created = response.brags[0];
133
- const lines = [`Brag logged: "${created.title}"\nView it at: ${created.url}`];
134
- if (created.keyResultIds && created.keyResultIds.length > 0) {
135
- lines.push(`Automatically linked to key result: ${created.keyResultIds[0]}`);
136
- }
137
- return {
138
- content: [{
139
- type: 'text',
140
- text: lines.join('\n'),
141
- }],
142
- };
143
- }
144
- // Creation failed — surface the first error message from the server
145
- const firstError = response.errors && response.errors.length > 0
146
- ? response.errors[0].message
147
- : 'Server returned no brag and no error detail';
148
- return {
149
- content: [{
150
- type: 'text',
151
- text: `Failed to create brag: ${firstError}`,
152
- }],
153
- isError: true,
154
- };
155
- }
156
- catch (error) {
157
- if (error instanceof Error && (error.message === 'NOT_AUTHENTICATED' || error.message === 'TOKEN_EXPIRED')) {
158
- return {
159
- content: [{
160
- type: 'text',
161
- text: 'Not authenticated with BragDuck. Please call the "login" tool first.',
162
- }],
163
- isError: true,
164
- };
165
- }
166
- return {
167
- content: [{
168
- type: 'text',
169
- text: `Failed to create brag: ${error instanceof Error ? error.message : String(error)}`,
170
- }],
171
- isError: true,
172
- };
173
- }
174
- }
175
- //# sourceMappingURL=log-brag.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"log-brag.js","sourceRoot":"","sources":["../../src/tools/log-brag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAG/D,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;gBACd,SAAS,EAAE,EAAE;gBACb,SAAS,EAAE,GAAG;gBACd,WAAW,EAAE,4DAA4D;aAC1E;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,SAAS,EAAE,EAAE;gBACb,SAAS,EAAE,IAAI;gBACf,WAAW,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,oEAAoE;QACpE,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;YAC9D,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO;YAC5B,CAAC,CAAC,6CAA6C,CAAC;QAClD,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,0BAA0B,UAAU,EAAE;iBAC7C,CAAC;YACF,OAAO,EAAE,IAAI;SACd,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,0BAA0B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;iBACzF,CAAC;YACF,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -1,81 +0,0 @@
1
- export declare const logStoryTool: {
2
- name: string;
3
- description: string;
4
- inputSchema: {
5
- type: "object";
6
- properties: {
7
- title: {
8
- type: string;
9
- minLength: number;
10
- maxLength: number;
11
- description: string;
12
- };
13
- situation: {
14
- type: string;
15
- minLength: number;
16
- description: string;
17
- };
18
- task: {
19
- type: string;
20
- minLength: number;
21
- description: string;
22
- };
23
- action: {
24
- type: string;
25
- minLength: number;
26
- description: string;
27
- };
28
- result: {
29
- type: string;
30
- minLength: number;
31
- description: string;
32
- };
33
- competencies: {
34
- type: string;
35
- items: {
36
- type: string;
37
- minLength: number;
38
- maxLength: number;
39
- };
40
- maxItems: number;
41
- description: string;
42
- };
43
- bragIds: {
44
- type: string;
45
- items: {
46
- type: string;
47
- };
48
- maxItems: number;
49
- description: string;
50
- };
51
- orgId: {
52
- type: string;
53
- description: string;
54
- };
55
- category: {
56
- type: string;
57
- description: string;
58
- };
59
- };
60
- required: string[];
61
- };
62
- };
63
- interface LogStoryInput {
64
- title: string;
65
- situation: string;
66
- task: string;
67
- action: string;
68
- result: string;
69
- competencies?: string[];
70
- bragIds?: string[];
71
- orgId?: string;
72
- category?: string;
73
- }
74
- export declare function handleLogStory(input: LogStoryInput): Promise<{
75
- content: Array<{
76
- type: string;
77
- text: string;
78
- }>;
79
- isError?: boolean;
80
- }>;
81
- export {};
@@ -1,122 +0,0 @@
1
- import { apiRequest, requirePaidPlan } from '../api-client.js';
2
- import { getUserInfo } from '../credentials.js';
3
- export const logStoryTool = {
4
- name: 'log_story',
5
- description: 'Save a STAR-formatted interview story to BragDuck. ' +
6
- 'Use this when the user discusses interview prep, behavioral questions, or asks to save a story. ' +
7
- 'Each story has Situation, Task, Action, Result fields plus competency tags. ' +
8
- 'Call this in the same response as a preview — the tool permission prompt (Allow/Deny) ' +
9
- 'that appears to the user IS the confirmation.',
10
- inputSchema: {
11
- type: 'object',
12
- properties: {
13
- title: {
14
- type: 'string',
15
- minLength: 5,
16
- maxLength: 200,
17
- description: 'Short title for the story (e.g., "Led migration to microservices")',
18
- },
19
- situation: {
20
- type: 'string',
21
- minLength: 10,
22
- description: 'The context and background — what was happening, what was the environment',
23
- },
24
- task: {
25
- type: 'string',
26
- minLength: 10,
27
- description: 'What was your specific responsibility or challenge',
28
- },
29
- action: {
30
- type: 'string',
31
- minLength: 10,
32
- description: 'What you specifically did — the steps you took',
33
- },
34
- result: {
35
- type: 'string',
36
- minLength: 10,
37
- description: 'The outcome — measurable impact, what changed, what you learned',
38
- },
39
- competencies: {
40
- type: 'array',
41
- items: { type: 'string', minLength: 2, maxLength: 50 },
42
- maxItems: 20,
43
- description: 'Skills or competencies this story demonstrates (e.g., "leadership", "system design", "conflict resolution")',
44
- },
45
- bragIds: {
46
- type: 'array',
47
- items: { type: 'string' },
48
- maxItems: 20,
49
- description: 'IDs of BragDuck brags that back this story',
50
- },
51
- orgId: {
52
- type: 'string',
53
- description: 'Organisation ID to associate the story with',
54
- },
55
- category: {
56
- type: 'string',
57
- description: 'Interview category this story demonstrates (e.g. leadership, technical_excellence, problem_solving, innovation, teamwork, communication, project_delivery, customer_impact, mentorship, process_improvement)',
58
- },
59
- },
60
- required: ['title', 'situation', 'task', 'action', 'result'],
61
- },
62
- };
63
- export async function handleLogStory(input) {
64
- const planError = await requirePaidPlan();
65
- if (planError)
66
- return planError;
67
- try {
68
- const userInfo = getUserInfo();
69
- if (!userInfo) {
70
- return {
71
- content: [{
72
- type: 'text',
73
- text: 'Not authenticated with BragDuck. Please call the "login" tool first.',
74
- }],
75
- isError: true,
76
- };
77
- }
78
- const body = {
79
- title: input.title,
80
- situation: input.situation,
81
- task: input.task,
82
- action: input.action,
83
- result: input.result,
84
- competencies: input.competencies || [],
85
- bragIds: input.bragIds || [],
86
- source: 'mcp',
87
- };
88
- if (input.orgId)
89
- body.orgId = input.orgId;
90
- if (input.category)
91
- body.category = input.category;
92
- const story = await apiRequest(`/v1/users/${userInfo.id}/stories`, { method: 'POST', body });
93
- const competencyLine = story.competencies.length > 0
94
- ? `\nCompetencies: ${story.competencies.join(', ')}`
95
- : '';
96
- return {
97
- content: [{
98
- type: 'text',
99
- text: `Story saved: "${story.title}"${competencyLine}`,
100
- }],
101
- };
102
- }
103
- catch (error) {
104
- if (error instanceof Error && (error.message === 'NOT_AUTHENTICATED' || error.message === 'TOKEN_EXPIRED')) {
105
- return {
106
- content: [{
107
- type: 'text',
108
- text: 'Not authenticated with BragDuck. Please call the "login" tool first.',
109
- }],
110
- isError: true,
111
- };
112
- }
113
- return {
114
- content: [{
115
- type: 'text',
116
- text: `Failed to save story: ${error instanceof Error ? error.message : String(error)}`,
117
- }],
118
- isError: true,
119
- };
120
- }
121
- }
122
- //# sourceMappingURL=log-story.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"log-story.js","sourceRoot":"","sources":["../../src/tools/log-story.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,WAAW;IACjB,WAAW,EACT,qDAAqD;QACrD,kGAAkG;QAClG,8EAA8E;QAC9E,wFAAwF;QACxF,+CAA+C;IACjD,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,SAAS,EAAE,CAAC;gBACZ,SAAS,EAAE,GAAG;gBACd,WAAW,EAAE,oEAAoE;aAClF;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,SAAS,EAAE,EAAE;gBACb,WAAW,EAAE,2EAA2E;aACzF;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,SAAS,EAAE,EAAE;gBACb,WAAW,EAAE,oDAAoD;aAClE;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,SAAS,EAAE,EAAE;gBACb,WAAW,EAAE,gDAAgD;aAC9D;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,SAAS,EAAE,EAAE;gBACb,WAAW,EAAE,iEAAiE;aAC/E;YACD,YAAY,EAAE;gBACZ,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;gBACtD,QAAQ,E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{
5
- type: "object";
6
- properties: {
7
- force: {
8
- type: string;
9
- description: string;
10
- };
11
- };
12
- };
13
- };
14
- interface LoginInput {
15
- force?: boolean;
16
- }
17
- export declare function handleLogin(input?: LoginInput): Promise<{
18
- content: Array<{
19
- type: string;
20
- text: string;
21
- }>;
22
- isError?: boolean;
23
- }>;
24
- export {};
@@ -1,46 +0,0 @@
1
- import { login } from '../auth.js';
2
- import { getAccessToken } from '../credentials.js';
3
- export const loginTool = {
4
- name: 'login',
5
- description: 'Authenticate with BragDuck. Opens the browser for sign-in/sign-up. ' +
6
- 'Call this when other tools return an authentication error.',
7
- inputSchema: {
8
- type: 'object',
9
- properties: {
10
- force: {
11
- type: 'boolean',
12
- description: 'Force re-authentication even if already logged in',
13
- },
14
- },
15
- },
16
- };
17
- export async function handleLogin(input) {
18
- // Check if already authenticated (skip if force=true)
19
- if (!input?.force) {
20
- const existingToken = getAccessToken();
21
- if (existingToken) {
22
- return {
23
- content: [{ type: 'text', text: 'Already authenticated with BragDuck.' }],
24
- };
25
- }
26
- }
27
- try {
28
- const user = await login();
29
- return {
30
- content: [{
31
- type: 'text',
32
- text: `Authenticated as ${user.name} (${user.email}). You can now log brags and manage objectives.`,
33
- }],
34
- };
35
- }
36
- catch (error) {
37
- return {
38
- content: [{
39
- type: 'text',
40
- text: `Authentication failed: ${error instanceof Error ? error.message : String(error)}`,
41
- }],
42
- isError: true,
43
- };
44
- }
45
- }
46
- //# sourceMappingURL=login.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/tools/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,IAAI,EAAE,OAAO;IACb,WAAW,EACT,qEAAqE;QACrE,4DAA4D;IAC9D,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,mDAAmD;aACjE;SACF;KACF;CACF,CAAC;AAMF,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,KAAkB;IAElB,sDAAsD;IACtD,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC;QAClB,MAAM,aAAa,GAAG,cAAc,EAAE,CAAC;QACvC,IAAI,aAAa,EAAE,CAAC;YAClB,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,sCAAsC,EAAE,CAAC;aAC1E,CAAC;QACJ,CAAC;IACH,CAAC;IAED,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,KAAK,EAAE,CAAC;QAC3B,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,oBAAoB,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,iDAAiD;iBACpG,CAAC;SACH,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,0BAA0B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;iBACzF,CAAC;YACF,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -1,71 +0,0 @@
1
- export declare const previewBragTool: {
2
- name: string;
3
- description: string;
4
- inputSchema: {
5
- type: "object";
6
- properties: {
7
- title: {
8
- type: string;
9
- minLength: number;
10
- maxLength: number;
11
- description: string;
12
- };
13
- description: {
14
- type: string;
15
- minLength: number;
16
- maxLength: number;
17
- description: string;
18
- };
19
- type: {
20
- type: string;
21
- enum: string[];
22
- description: string;
23
- };
24
- impact_level: {
25
- type: string;
26
- enum: number[];
27
- description: string;
28
- };
29
- impact_description: {
30
- type: string;
31
- description: string;
32
- };
33
- tags: {
34
- type: string;
35
- items: {
36
- type: string;
37
- minLength: number;
38
- maxLength: number;
39
- };
40
- maxItems: number;
41
- description: string;
42
- };
43
- references: {
44
- type: string;
45
- items: {
46
- type: string;
47
- format: string;
48
- };
49
- maxItems: number;
50
- description: string;
51
- };
52
- };
53
- required: string[];
54
- };
55
- };
56
- interface PreviewBragInput {
57
- title: string;
58
- description: string;
59
- type: string;
60
- impact_level: number;
61
- impact_description: string;
62
- tags?: string[];
63
- references?: string[];
64
- }
65
- export declare function handlePreviewBrag(input: PreviewBragInput): {
66
- content: Array<{
67
- type: string;
68
- text: string;
69
- }>;
70
- };
71
- export {};