@acquis-consulting/asm 1.0.12 → 1.0.14

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 (36) hide show
  1. package/README.md +31 -0
  2. package/dist/index.js +10 -0
  3. package/dist/index.js.map +1 -1
  4. package/dist/tools/docsFetch.d.ts +25 -0
  5. package/dist/tools/docsFetch.js +51 -0
  6. package/dist/tools/docsFetch.js.map +1 -0
  7. package/dist/tools/docsListCollections.d.ts +44 -0
  8. package/dist/tools/docsListCollections.js +63 -0
  9. package/dist/tools/docsListCollections.js.map +1 -0
  10. package/dist/tools/docsSearch.d.ts +42 -0
  11. package/dist/tools/docsSearch.js +87 -0
  12. package/dist/tools/docsSearch.js.map +1 -0
  13. package/dist/tools/executeAnonymous.js +76 -7
  14. package/dist/tools/executeAnonymous.js.map +1 -1
  15. package/dist/tools/objectSchema.d.ts +7 -0
  16. package/dist/tools/objectSchema.js +40 -3
  17. package/dist/tools/objectSchema.js.map +1 -1
  18. package/dist/tools/trailheadFetch.d.ts +28 -0
  19. package/dist/tools/trailheadFetch.js +66 -0
  20. package/dist/tools/trailheadFetch.js.map +1 -0
  21. package/dist/tools/trailheadSearch.d.ts +94 -0
  22. package/dist/tools/trailheadSearch.js +112 -0
  23. package/dist/tools/trailheadSearch.js.map +1 -0
  24. package/dist/utils/index.d.ts +1 -1
  25. package/dist/utils/index.js +1 -1
  26. package/dist/utils/index.js.map +1 -1
  27. package/dist/utils/relatedComponents.d.ts +9 -0
  28. package/dist/utils/relatedComponents.js +227 -4
  29. package/dist/utils/relatedComponents.js.map +1 -1
  30. package/dist/utils/salesforceDocsClient.d.ts +2 -0
  31. package/dist/utils/salesforceDocsClient.js +43 -0
  32. package/dist/utils/salesforceDocsClient.js.map +1 -0
  33. package/dist/utils/trailheadClient.d.ts +7 -0
  34. package/dist/utils/trailheadClient.js +35 -0
  35. package/dist/utils/trailheadClient.js.map +1 -0
  36. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
1
  import { z } from 'zod/v4';
2
- import { toolResponse } from '../utils/index.js';
2
+ import { toolResponse, resolveObjectComponentId, fetchRelatedComponents, fetchValidationRulesForObject, fetchWorkflowRulesForObject, fetchApprovalProcessesForObject, fetchDuplicateRulesForObject, fetchAssignmentRulesForObject, fetchAutoResponseRulesForObject, fetchEscalationRulesForObject, fetchDescriptions, formatObjectDependentsSection, } from '../utils/index.js';
3
3
  export const objectSchemaTool = {
4
4
  name: 'salesforce_describe_object',
5
- description: 'Get the complete field-level schema of a Salesforce object including all fields, their types, relationships, and picklist values. Use salesforce_search_objects first to find the correct API name.',
5
+ description: 'Get the complete field-level schema of a Salesforce object including all fields, their types, relationships, and picklist values. Also shows related metadata (Apex Triggers, Flows, Validation Rules, Workflow Rules, Approval Processes, Duplicate Rules, Assignment/Auto-Response/Escalation Rules, and anything else) that references this object — set includeRelatedComponents to false to skip. Use salesforce_search_objects first to find the correct API name.',
6
6
  inputSchema: {
7
7
  type: 'object',
8
8
  properties: {
@@ -10,12 +10,16 @@ export const objectSchemaTool = {
10
10
  type: 'string',
11
11
  description: 'The Salesforce object API name (e.g., "Account", "Contact", "MyObject__c").',
12
12
  },
13
+ includeRelatedComponents: {
14
+ type: 'boolean',
15
+ description: 'Whether to include a section listing metadata components (Apex Triggers, Flows, Validation Rules, Workflow Rules, Approval Processes, Duplicate Rules, Assignment/Auto-Response/Escalation Rules, Apex Classes, etc.) that reference this object. Defaults to true.',
16
+ },
13
17
  },
14
18
  required: ['objectName'],
15
19
  },
16
20
  };
17
21
  export async function handleObjectSchema(conn, args) {
18
- const { objectName } = args;
22
+ const { objectName, includeRelatedComponents } = args;
19
23
  const desc = await conn.describe(objectName);
20
24
  const lines = [];
21
25
  lines.push(`## ${desc.label} (${desc.name}) — ${desc.custom ? 'Custom' : 'Standard'} Object\n`);
@@ -52,10 +56,43 @@ export async function handleObjectSchema(conn, args) {
52
56
  }
53
57
  }
54
58
  }
59
+ if (includeRelatedComponents !== false) {
60
+ try {
61
+ const componentId = await resolveObjectComponentId(conn, desc.name);
62
+ const children = componentId ? (await fetchRelatedComponents(conn, componentId)).children : [];
63
+ const supplements = await Promise.all([
64
+ fetchValidationRulesForObject(conn, desc.name),
65
+ fetchWorkflowRulesForObject(conn, desc.name),
66
+ fetchApprovalProcessesForObject(conn, desc.name),
67
+ fetchDuplicateRulesForObject(conn, desc.name),
68
+ fetchAssignmentRulesForObject(conn, desc.name),
69
+ fetchAutoResponseRulesForObject(conn, desc.name),
70
+ fetchEscalationRulesForObject(conn, desc.name),
71
+ ]);
72
+ const seenIds = new Set(children.map((c) => c.id));
73
+ const merged = [...children];
74
+ for (const extra of supplements.flat()) {
75
+ if (!seenIds.has(extra.id)) {
76
+ seenIds.add(extra.id);
77
+ merged.push(extra);
78
+ }
79
+ }
80
+ if (merged.length > 0) {
81
+ const described = await fetchDescriptions(conn, merged);
82
+ const section = formatObjectDependentsSection(described);
83
+ if (section)
84
+ lines.push(section);
85
+ }
86
+ }
87
+ catch (err) {
88
+ console.error(`[objectSchema] related components lookup failed for ${objectName}: ${err.message}`);
89
+ }
90
+ }
55
91
  return toolResponse(lines.join('\n'));
56
92
  }
57
93
  export const objectSchemaSchema = {
58
94
  objectName: z.string().describe('The Salesforce object API name (e.g., "Account", "Contact", "MyObject__c").'),
95
+ includeRelatedComponents: z.boolean().optional().describe('Whether to include a section listing metadata components (Apex Triggers, Flows, Validation Rules, Workflow Rules, Approval Processes, Duplicate Rules, Assignment/Auto-Response/Escalation Rules, Apex Classes, etc.) that reference this object. Defaults to true.'),
59
96
  };
60
97
  export const objectSchemaDescriptor = {
61
98
  name: 'salesforce_describe_object',
@@ -1 +1 @@
1
- {"version":3,"file":"objectSchema.js","sourceRoot":"","sources":["../../src/tools/objectSchema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,CAAC,MAA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AAI,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6EAA6E,CAAC;IAC9G,wBAAwB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,qQAAqQ,CAAC;CACjU,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,IAAI,EAAE,4BAA4B;IAClC,WAAW,EAAE,gBAAgB,CAAC,WAAW;IACzC,MAAM,EAAE,kBAAkB;IAC1B,OAAO,EAAE,kBAAkB;CAC5B,CAAC"}
@@ -0,0 +1,28 @@
1
+ import type { Tool } from '@modelcontextprotocol/sdk/types.js';
2
+ import { z } from 'zod/v4';
3
+ export declare const trailheadFetchTool: Tool;
4
+ export interface TrailheadFetchArgs {
5
+ apiName: string;
6
+ expand?: boolean;
7
+ }
8
+ export declare function handleTrailheadFetch(args: TrailheadFetchArgs): Promise<{
9
+ content: {
10
+ type: "text";
11
+ text: string;
12
+ }[];
13
+ isError: boolean;
14
+ }>;
15
+ export declare const trailheadFetchSchema: {
16
+ apiName: z.ZodString;
17
+ expand: z.ZodOptional<z.ZodBoolean>;
18
+ };
19
+ export declare const trailheadFetchDescriptor: {
20
+ name: string;
21
+ description: string | undefined;
22
+ schema: {
23
+ apiName: z.ZodString;
24
+ expand: z.ZodOptional<z.ZodBoolean>;
25
+ };
26
+ handler: typeof handleTrailheadFetch;
27
+ noConnection: boolean;
28
+ };
@@ -0,0 +1,66 @@
1
+ import { z } from 'zod/v4';
2
+ import { callTrailheadMcpTool } from '../utils/trailheadClient.js';
3
+ import { toolResponse } from '../utils/errors.js';
4
+ export const trailheadFetchTool = {
5
+ name: 'salesforce_trailhead_fetch',
6
+ description: 'Fetch the full content of a Salesforce Trailhead module, project, trail, trailmix, superbadge, or badge via ' +
7
+ 'the public Trailhead MCP server. Pass the apiName returned by salesforce_trailhead_search.',
8
+ inputSchema: {
9
+ type: 'object',
10
+ properties: {
11
+ apiName: {
12
+ type: 'string',
13
+ description: 'The apiName (slug) of the content to fetch, from salesforce_trailhead_search results, e.g. "quickstart-apex".',
14
+ },
15
+ expand: {
16
+ type: 'boolean',
17
+ description: 'Expand a trail to include full child-module content. Can produce a very large response. Default false.',
18
+ },
19
+ },
20
+ required: ['apiName'],
21
+ },
22
+ };
23
+ export async function handleTrailheadFetch(args) {
24
+ try {
25
+ const params = { apiName: args.apiName };
26
+ if (args.expand !== undefined)
27
+ params.expand = args.expand;
28
+ const { structuredContent, content } = await callTrailheadMcpTool('fetch_content', params);
29
+ const title = structuredContent?.title ?? args.apiName;
30
+ const type = structuredContent?.type;
31
+ const url = structuredContent?.url;
32
+ const pointTotal = structuredContent?.pointTotal;
33
+ const minuteTotal = structuredContent?.minuteTotal;
34
+ const header = [
35
+ `# ${title}`,
36
+ type ? `Type: ${type}` : null,
37
+ url ? `URL: ${url}` : null,
38
+ pointTotal || minuteTotal ? `Points: ${pointTotal ?? '?'} | Minutes: ${minuteTotal ?? '?'}` : null,
39
+ '',
40
+ ].filter(Boolean).join('\n');
41
+ const markdown = structuredContent?.markdown;
42
+ if (markdown) {
43
+ return toolResponse(`${header}\n${markdown}`);
44
+ }
45
+ const rawText = (content ?? []).map((c) => c.text).filter(Boolean).join('\n');
46
+ if (rawText) {
47
+ return toolResponse(`${header}\n${rawText}`);
48
+ }
49
+ return toolResponse(`No content returned for "${args.apiName}".`, true);
50
+ }
51
+ catch (error) {
52
+ return toolResponse(`salesforce_trailhead_fetch failed: ${error.message}`, true);
53
+ }
54
+ }
55
+ export const trailheadFetchSchema = {
56
+ apiName: z.string().describe('The apiName (slug) of the content to fetch, from salesforce_trailhead_search results, e.g. "quickstart-apex".'),
57
+ expand: z.boolean().describe('Expand a trail to include full child-module content. Can produce a very large response. Default false.').optional(),
58
+ };
59
+ export const trailheadFetchDescriptor = {
60
+ name: 'salesforce_trailhead_fetch',
61
+ description: trailheadFetchTool.description,
62
+ schema: trailheadFetchSchema,
63
+ handler: handleTrailheadFetch,
64
+ noConnection: true,
65
+ };
66
+ //# sourceMappingURL=trailheadFetch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trailheadFetch.js","sourceRoot":"","sources":["../../src/tools/trailheadFetch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,CAAC,MAAM,kBAAkB,GAAS;IACtC,IAAI,EAAE,4BAA4B;IAClC,WAAW,EACT,8GAA8G;QAC9G,4FAA4F;IAC9F,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,+GAA+G;aAC7H;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,wGAAwG;aACtH;SACF;QACD,QAAQ,EAAE,CAAC,SAAS,CAAC;KACtB;CACF,CAAC;AAOF,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,IAAwB;IACjE,IAAI,CAAC;QACH,MAAM,MAAM,GAAwB,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC;QAC9D,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS;YAAE,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAE3D,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,GAAG,MAAM,oBAAoB,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;QAE3F,MAAM,KAAK,GAAG,iBAAiB,EAAE,KAAK,IAAI,IAAI,CAAC,OAAO,CAAC;QACvD,MAAM,IAAI,GAAG,iBAAiB,EAAE,IAAI,CAAC;QACr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H,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+GAA+G,CAAC;IAC7I,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,wGAAwG,CAAC,CAAC,QAAQ,EAAE;CAClJ,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,IAAI,EAAE,4BAA4B;IAClC,WAAW,EAAE,kBAAkB,CAAC,WAAW;IAC3C,MAAM,EAAE,oBAAoB;IAC5B,OAAO,EAAE,oBAAoB;IAC7B,YAAY,EAAE,IAAI;CACnB,CAAC"}
@@ -0,0 +1,94 @@
1
+ import type { Tool } from '@modelcontextprotocol/sdk/types.js';
2
+ import { z } from 'zod/v4';
3
+ declare const ROLES: readonly ["Administrator", "Architect", "Business Analyst", "Consultant", "Customer Service Professional", "Cybersecurity", "Data Analyst", "Designer", "Developer", "End User", "Marketer", "Sales Professional"];
4
+ declare const LEVELS: readonly ["Foundational", "Intermediate", "Advanced"];
5
+ declare const CONTENT_TYPES: readonly ["MODULE", "PROJECT", "TRAIL", "TRAILMIX", "SUPERBADGE", "BADGE", "TRAILHEAD_JOURNEY"];
6
+ export declare const trailheadSearchTool: Tool;
7
+ export interface TrailheadSearchArgs {
8
+ query: string;
9
+ first?: number;
10
+ roles?: Array<typeof ROLES[number]>;
11
+ levels?: Array<typeof LEVELS[number]>;
12
+ types?: Array<typeof CONTENT_TYPES[number]>;
13
+ locale?: string;
14
+ }
15
+ export declare function handleTrailheadSearch(args: TrailheadSearchArgs): Promise<{
16
+ content: {
17
+ type: "text";
18
+ text: string;
19
+ }[];
20
+ isError: boolean;
21
+ }>;
22
+ export declare const trailheadSearchSchema: {
23
+ query: z.ZodString;
24
+ first: z.ZodOptional<z.ZodNumber>;
25
+ roles: z.ZodOptional<z.ZodArray<z.ZodEnum<{
26
+ Administrator: "Administrator";
27
+ Architect: "Architect";
28
+ "Business Analyst": "Business Analyst";
29
+ Consultant: "Consultant";
30
+ "Customer Service Professional": "Customer Service Professional";
31
+ Cybersecurity: "Cybersecurity";
32
+ "Data Analyst": "Data Analyst";
33
+ Designer: "Designer";
34
+ Developer: "Developer";
35
+ "End User": "End User";
36
+ Marketer: "Marketer";
37
+ "Sales Professional": "Sales Professional";
38
+ }>>>;
39
+ levels: z.ZodOptional<z.ZodArray<z.ZodEnum<{
40
+ Foundational: "Foundational";
41
+ Intermediate: "Intermediate";
42
+ Advanced: "Advanced";
43
+ }>>>;
44
+ types: z.ZodOptional<z.ZodArray<z.ZodEnum<{
45
+ MODULE: "MODULE";
46
+ PROJECT: "PROJECT";
47
+ TRAIL: "TRAIL";
48
+ TRAILMIX: "TRAILMIX";
49
+ SUPERBADGE: "SUPERBADGE";
50
+ BADGE: "BADGE";
51
+ TRAILHEAD_JOURNEY: "TRAILHEAD_JOURNEY";
52
+ }>>>;
53
+ locale: z.ZodOptional<z.ZodString>;
54
+ };
55
+ export declare const trailheadSearchDescriptor: {
56
+ name: string;
57
+ description: string | undefined;
58
+ schema: {
59
+ query: z.ZodString;
60
+ first: z.ZodOptional<z.ZodNumber>;
61
+ roles: z.ZodOptional<z.ZodArray<z.ZodEnum<{
62
+ Administrator: "Administrator";
63
+ Architect: "Architect";
64
+ "Business Analyst": "Business Analyst";
65
+ Consultant: "Consultant";
66
+ "Customer Service Professional": "Customer Service Professional";
67
+ Cybersecurity: "Cybersecurity";
68
+ "Data Analyst": "Data Analyst";
69
+ Designer: "Designer";
70
+ Developer: "Developer";
71
+ "End User": "End User";
72
+ Marketer: "Marketer";
73
+ "Sales Professional": "Sales Professional";
74
+ }>>>;
75
+ levels: z.ZodOptional<z.ZodArray<z.ZodEnum<{
76
+ Foundational: "Foundational";
77
+ Intermediate: "Intermediate";
78
+ Advanced: "Advanced";
79
+ }>>>;
80
+ types: z.ZodOptional<z.ZodArray<z.ZodEnum<{
81
+ MODULE: "MODULE";
82
+ PROJECT: "PROJECT";
83
+ TRAIL: "TRAIL";
84
+ TRAILMIX: "TRAILMIX";
85
+ SUPERBADGE: "SUPERBADGE";
86
+ BADGE: "BADGE";
87
+ TRAILHEAD_JOURNEY: "TRAILHEAD_JOURNEY";
88
+ }>>>;
89
+ locale: z.ZodOptional<z.ZodString>;
90
+ };
91
+ handler: typeof handleTrailheadSearch;
92
+ noConnection: boolean;
93
+ };
94
+ export {};
@@ -0,0 +1,112 @@
1
+ import { z } from 'zod/v4';
2
+ import { callTrailheadMcpTool } from '../utils/trailheadClient.js';
3
+ import { toolResponse } from '../utils/errors.js';
4
+ const ROLES = [
5
+ 'Administrator', 'Architect', 'Business Analyst', 'Consultant',
6
+ 'Customer Service Professional', 'Cybersecurity', 'Data Analyst',
7
+ 'Designer', 'Developer', 'End User', 'Marketer', 'Sales Professional',
8
+ ];
9
+ const LEVELS = ['Foundational', 'Intermediate', 'Advanced'];
10
+ const CONTENT_TYPES = ['MODULE', 'PROJECT', 'TRAIL', 'TRAILMIX', 'SUPERBADGE', 'BADGE', 'TRAILHEAD_JOURNEY'];
11
+ export const trailheadSearchTool = {
12
+ name: 'salesforce_trailhead_search',
13
+ description: 'Search official Salesforce Trailhead learning content (modules, projects, trails, trailmixes, superbadges, ' +
14
+ 'badges, and Trailhead Journeys) via the public Trailhead MCP server. Returns matching items with an apiName ' +
15
+ 'you can pass to salesforce_trailhead_fetch for the full content. No Salesforce org connection or Trailhead ' +
16
+ 'login is required — content is public and no user progress or points are collected. Use this when a user asks ' +
17
+ 'for Trailhead recommendations, learning paths, certification/superbadge prep, or "is there a Trailhead module ' +
18
+ 'for X".',
19
+ inputSchema: {
20
+ type: 'object',
21
+ properties: {
22
+ query: {
23
+ type: 'string',
24
+ description: 'Search query terms, e.g. "Agentforce" or "Apex Triggers".',
25
+ },
26
+ first: {
27
+ type: 'number',
28
+ description: 'Number of results to return (1-12). Default 6.',
29
+ },
30
+ roles: {
31
+ type: 'array',
32
+ items: { type: 'string', enum: [...ROLES] },
33
+ description: 'Optional filter by role(s).',
34
+ },
35
+ levels: {
36
+ type: 'array',
37
+ items: { type: 'string', enum: [...LEVELS] },
38
+ description: 'Optional filter by difficulty level(s).',
39
+ },
40
+ types: {
41
+ type: 'array',
42
+ items: { type: 'string', enum: [...CONTENT_TYPES] },
43
+ description: 'Optional filter by content type(s).',
44
+ },
45
+ locale: {
46
+ type: 'string',
47
+ description: 'Query locale context, e.g. "en-US", "de-DE", "ja-JP". Default "en-US".',
48
+ },
49
+ },
50
+ required: ['query'],
51
+ },
52
+ };
53
+ export async function handleTrailheadSearch(args) {
54
+ try {
55
+ const params = {
56
+ query: args.query,
57
+ first: args.first ?? 6,
58
+ };
59
+ if (args.roles?.length)
60
+ params.roles = args.roles;
61
+ if (args.levels?.length)
62
+ params.levels = args.levels;
63
+ if (args.types?.length)
64
+ params.types = args.types;
65
+ if (args.locale)
66
+ params.locale = args.locale;
67
+ const { structuredContent, content } = await callTrailheadMcpTool('content_search', params);
68
+ const results = structuredContent?.results;
69
+ if (Array.isArray(results) && results.length > 0) {
70
+ const lines = [`Found ${results.length} match(es) for "${args.query}":`, ''];
71
+ for (const item of results) {
72
+ const type = item.type ?? 'UNKNOWN';
73
+ const title = item.title ?? 'No Title';
74
+ lines.push(`### ${title} (${type})`);
75
+ lines.push(`- apiName (pass to salesforce_trailhead_fetch): ${item.apiName ?? 'unknown'}`);
76
+ if (item.pointTotal || item.minuteTotal) {
77
+ lines.push(`- Points: ${item.pointTotal ?? '?'} | Minutes: ${item.minuteTotal ?? '?'}`);
78
+ }
79
+ if (item.url)
80
+ lines.push(`- URL: ${item.url}`);
81
+ if (item.description)
82
+ lines.push(`- ${String(item.description).trim().slice(0, 500)}`);
83
+ lines.push('');
84
+ }
85
+ return toolResponse(lines.join('\n').trimEnd());
86
+ }
87
+ const rawText = (content ?? []).map((c) => c.text).filter(Boolean).join('\n');
88
+ if (rawText) {
89
+ return toolResponse(`(raw response, no structured results)\n\n${rawText}`);
90
+ }
91
+ return toolResponse(`No Trailhead content matches found for "${args.query}".`);
92
+ }
93
+ catch (error) {
94
+ return toolResponse(`salesforce_trailhead_search failed: ${error.message}`, true);
95
+ }
96
+ }
97
+ export const trailheadSearchSchema = {
98
+ query: z.string().describe('Search query terms, e.g. "Agentforce" or "Apex Triggers".'),
99
+ first: z.number().describe('Number of results to return (1-12). Default 6.').optional(),
100
+ roles: z.array(z.enum(ROLES)).describe('Optional filter by role(s).').optional(),
101
+ levels: z.array(z.enum(LEVELS)).describe('Optional filter by difficulty level(s).').optional(),
102
+ types: z.array(z.enum(CONTENT_TYPES)).describe('Optional filter by content type(s).').optional(),
103
+ locale: z.string().describe('Query locale context, e.g. "en-US", "de-DE", "ja-JP". Default "en-US".').optional(),
104
+ };
105
+ export const trailheadSearchDescriptor = {
106
+ name: 'salesforce_trailhead_search',
107
+ description: trailheadSearchTool.description,
108
+ schema: trailheadSearchSchema,
109
+ handler: handleTrailheadSearch,
110
+ noConnection: true,
111
+ };
112
+ //# sourceMappingURL=trailheadSearch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trailheadSearch.js","sourceRoot":"","sources":["../../src/tools/trailheadSearch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,KAAK,GAAG;IACZ,eAAe,EAAE,WAAW,EAAE,kBAAkB,EAAE,YAAY;IAC9D,+BAA+B,EAAE,eAAe,EAAE,cAAc;IAChE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,oBAAoB;CAC7D,CAAC;AACX,MAAM,MAAM,GAAG,CAAC,cAAc,EAAE,cAAc,EAAE,UAAU,CAAU,CAAC;AACrE,MAAM,aAAa,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE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AC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,6BAA6B,CAAC,CAAC,QAAQ,EAAE;IAChF,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,yCAAyC,CAAC,CAAC,QAAQ,EAAE;IAC9F,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,qCAAqC,CAAC,CAAC,QAAQ,EAAE;IAChG,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wEAAwE,CAAC,CAAC,QAAQ,EAAE;CACjH,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,IAAI,EAAE,6BAA6B;IACnC,WAAW,EAAE,mBAAmB,CAAC,WAAW;IAC5C,MAAM,EAAE,qBAAqB;IAC7B,OAAO,EAAE,qBAAqB;IAC9B,YAAY,EAAE,IAAI;CACnB,CAAC"}
@@ -1,4 +1,4 @@
1
1
  export { createConnection } from './connection.js';
2
2
  export { formatMetadataErrors, toolResponse } from './errors.js';
3
3
  export { compressApexLog } from './logCompressor.js';
4
- export { resolveComponentId, fetchRelatedComponents, fetchDescriptions, formatRelatedComponentsSection } from './relatedComponents.js';
4
+ export { resolveComponentId, resolveObjectComponentId, fetchRelatedComponents, fetchValidationRulesForObject, fetchWorkflowRulesForObject, fetchApprovalProcessesForObject, fetchDuplicateRulesForObject, fetchAssignmentRulesForObject, fetchAutoResponseRulesForObject, fetchEscalationRulesForObject, fetchDescriptions, formatRelatedComponentsSection, formatObjectDependentsSection, } from './relatedComponents.js';
@@ -1,5 +1,5 @@
1
1
  export { createConnection } from './connection.js';
2
2
  export { formatMetadataErrors, toolResponse } from './errors.js';
3
3
  export { compressApexLog } from './logCompressor.js';
4
- export { resolveComponentId, fetchRelatedComponents, fetchDescriptions, formatRelatedComponentsSection } from './relatedComponents.js';
4
+ export { resolveComponentId, resolveObjectComponentId, fetchRelatedComponents, fetchValidationRulesForObject, fetchWorkflowRulesForObject, fetchApprovalProcessesForObject, fetchDuplicateRulesForObject, fetchAssignmentRulesForObject, fetchAutoResponseRulesForObject, fetchEscalationRulesForObject, fetchDescriptions, formatRelatedComponentsSection, formatObjectDependentsSection, } from './relatedComponents.js';
5
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,sBAAsB,EACtB,6BAA6B,EAC7B,2BAA2B,EAC3B,+BAA+B,EAC/B,4BAA4B,EAC5B,6BAA6B,EAC7B,+BAA+B,EAC/B,6BAA6B,EAC7B,iBAAiB,EACjB,8BAA8B,EAC9B,6BAA6B,GAC9B,MAAM,wBAAwB,CAAC"}
@@ -10,7 +10,16 @@ interface RelatedComponentsResult {
10
10
  children: RelatedComponent[];
11
11
  }
12
12
  export declare function resolveComponentId(conn: Connection, metadataType: string, fullName: string): Promise<string | null>;
13
+ export declare function resolveObjectComponentId(conn: Connection, objectApiName: string): Promise<string | null>;
14
+ export declare function fetchValidationRulesForObject(conn: Connection, objectApiName: string): Promise<RelatedComponent[]>;
15
+ export declare function fetchWorkflowRulesForObject(conn: Connection, objectApiName: string): Promise<RelatedComponent[]>;
16
+ export declare function fetchApprovalProcessesForObject(conn: Connection, objectApiName: string): Promise<RelatedComponent[]>;
17
+ export declare function fetchDuplicateRulesForObject(conn: Connection, objectApiName: string): Promise<RelatedComponent[]>;
18
+ export declare function fetchAssignmentRulesForObject(conn: Connection, objectApiName: string): Promise<RelatedComponent[]>;
19
+ export declare function fetchAutoResponseRulesForObject(conn: Connection, objectApiName: string): Promise<RelatedComponent[]>;
20
+ export declare function fetchEscalationRulesForObject(conn: Connection, objectApiName: string): Promise<RelatedComponent[]>;
13
21
  export declare function fetchRelatedComponents(conn: Connection, componentId: string): Promise<RelatedComponentsResult>;
14
22
  export declare function fetchDescriptions(conn: Connection, components: RelatedComponent[]): Promise<RelatedComponent[]>;
15
23
  export declare function formatRelatedComponentsSection(parents: RelatedComponent[], children: RelatedComponent[]): string;
24
+ export declare function formatObjectDependentsSection(components: RelatedComponent[]): string;
16
25
  export {};