Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions packages/mcp-provider-dx-core/test/e2e/deploy_metadata.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { deployMetadataParams } from '../../src/tools/deploy_metadata.js';

describe('deploy_metadata', () => {
const client = new McpTestClient({
timeout: 120_000,
timeout: 180_000,
});

let testSession: TestSession;
Expand Down Expand Up @@ -230,7 +230,7 @@ describe('deploy_metadata', () => {
expect(deployResult.runTestsEnabled).to.be.true;
});

it('should deploy remote edit when ignoreConflicts is set to true', async () => {
it('should deploy remote edit when ignoreConflicts is set to true', async () => {
// deploy the whole project to ensure the file exists
const fullProjectDeploy = await client.callTool(deployMetadataSchema, {
name: 'deploy_metadata',
Expand Down Expand Up @@ -263,8 +263,8 @@ describe('deploy_metadata', () => {
authInfo: await AuthInfo.create({ username: orgUsername }),
});

const customApp = await conn.singleRecordQuery<{
Id: string;
const customApp = await conn.singleRecordQuery<{
Id: string;
Metadata: {
description: string | null;
};
Expand All @@ -277,7 +277,7 @@ describe('deploy_metadata', () => {

const updatedMetadata = {
...customApp.Metadata,
description: customApp.Metadata.description
description: customApp.Metadata.description
? `${customApp.Metadata.description} - Remote edit via Tooling API`
: 'Remote edit via Tooling API',
};
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@salesforce/mcp-provider-metadata-enrichment": "0.1.0",
"@salesforce/source-deploy-retrieve": "^12.31.7",
"@salesforce/source-tracking": "^7.8.2",
"@salesforce/telemetry": "6.4.1",
"@salesforce/telemetry": "^6.8.0",
"@salesforce/ts-types": "^2.0.11",
"zod": "^3.25.76"
},
Expand Down
6 changes: 6 additions & 0 deletions packages/mcp/src/sf-mcp-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ export class SfMcpServer extends McpServer implements ToolMethodSignatures {
isError: result.isError ?? false,
});

this.telemetry?.sendPdpEvent({
eventName: 'salesforceMcp.executed',
productFeatureId: 'aJCEE0000007Uiv4AE', // DX MCP Server
componentId: name, // MCP tool name
});

return result;
};

Expand Down
12 changes: 10 additions & 2 deletions packages/mcp/src/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { randomBytes } from 'node:crypto';
import { readFileSync } from 'node:fs';
import { join } from 'node:path';
import * as os from 'node:os';
import { Attributes, TelemetryReporter } from '@salesforce/telemetry';
import { Attributes, TelemetryReporter, PdpEvent } from '@salesforce/telemetry';
import { warn } from '@oclif/core/ux';
import { Config } from '@oclif/core';
import { TelemetryService } from '@salesforce/mcp-provider-api/src/index.js';
Expand Down Expand Up @@ -135,7 +135,15 @@ export class Telemetry implements TelemetryService {
...(isInternalHost() ? getInternalProperties() : {}),
});
} catch {
/* empty */
/* intentionally empty */
}
}

public sendPdpEvent(event: PdpEvent): void {
try {
this.reporter?.sendPdpEvent(event);
} catch {
/* intentionally empty */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure you don't want to log that this happened?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The telemetry App Insights ID gets injected at build time, which is checked before o11y is enabled. So you wouldnt see any logs at dev time, it would need to be while using a published version (from npm).

}
}

Expand Down
106 changes: 61 additions & 45 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2997,7 +2997,7 @@
semver "^7.5.4"
ts-retry-promise "^0.7.1"

"@salesforce/core@^8", "@salesforce/core@^8.10.3", "@salesforce/core@^8.19.0", "@salesforce/core@^8.19.1", "@salesforce/core@^8.23.1", "@salesforce/core@^8.23.4", "@salesforce/core@^8.24.0", "@salesforce/core@^8.24.3", "@salesforce/core@^8.8.0":
"@salesforce/core@^8", "@salesforce/core@^8.10.3", "@salesforce/core@^8.19.0", "@salesforce/core@^8.19.1", "@salesforce/core@^8.23.1", "@salesforce/core@^8.24.0", "@salesforce/core@^8.24.3", "@salesforce/core@^8.8.0":
version "8.24.3"
resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-8.24.3.tgz#c18fb2481ab212c460fd351520712a4fa8b4329f"
integrity sha512-E9k4G3S8svS6QtsPVhUvxr0VHWyzg7KxH8sYM0o5pk7QEUXZCKQEQE5VjQOa+Gl3jRyX6zv/8Cp4UpQ2ZszOVg==
Expand All @@ -3022,6 +3022,31 @@
ts-retry-promise "^0.8.1"
zod "^4.1.12"

"@salesforce/core@^8.26.3":
version "8.26.3"
resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-8.26.3.tgz#0b2502cacca8977f2ae95283d944771040eb7869"
integrity sha512-lPNFHjHFeC4V3KuH88xuVLGhAqmtM8meUcvyejNh8bQ5w642APKRTGDZ0pOnWHJAe5SQy7cSQ1WqvO3V73ouQw==
dependencies:
"@jsforce/jsforce-node" "^3.10.13"
"@salesforce/kit" "^3.2.4"
"@salesforce/ts-types" "^2.0.12"
ajv "^8.18.0"
change-case "^4.1.2"
fast-levenshtein "^3.0.0"
faye "^1.4.1"
form-data "^4.0.4"
js2xmlparser "^4.0.1"
jsonwebtoken "9.0.3"
jszip "3.10.1"
memfs "^4.30.1"
pino "^9.7.0"
pino-abstract-transport "^1.2.0"
pino-pretty "^11.3.0"
proper-lockfile "^4.1.2"
semver "^7.7.3"
ts-retry-promise "^0.8.1"
zod "^4.1.12"

"@salesforce/dev-config@^4.3.2":
version "4.3.2"
resolved "https://registry.yarnpkg.com/@salesforce/dev-config/-/dev-config-4.3.2.tgz#10047e2b8d289c93f157ab4243a1b1de57f2d6a2"
Expand Down Expand Up @@ -3177,10 +3202,10 @@
"@salesforce/ts-types" "^2.0.11"
fast-xml-parser "^5.3.4"

"@salesforce/o11y-reporter@1.6.0":
version "1.6.0"
resolved "https://registry.yarnpkg.com/@salesforce/o11y-reporter/-/o11y-reporter-1.6.0.tgz#b2c5e538d64337c44b69ce5ec8b43c55d6c409eb"
integrity sha512-FAdmfTtRlpuCwXSwPFrpp+mYn8h47EUAaHKL1PpVZYU+DoktVXrDoKTm3MxKRarcqtK1fc4PaO3UOcL5tIT1iA==
"@salesforce/o11y-reporter@1.8.1":
version "1.8.1"
resolved "https://registry.yarnpkg.com/@salesforce/o11y-reporter/-/o11y-reporter-1.8.1.tgz#19470752359a1931f207ecea98511451cfa626d7"
integrity sha512-zXfFWoNBxkBDPq96X7wJuO2E6T+VsY9sWVfqVnqA2bMrw4ix8hWkXa6IdEytXMCe8mMsaXwGD4Iua0WNzrYhWA==
dependencies:
o11y "^258.7.0"
o11y_schema "256.154.0"
Expand Down Expand Up @@ -3269,18 +3294,6 @@
isomorphic-git "^1.34.2"
ts-retry-promise "^0.8.1"

"@salesforce/telemetry@6.4.1":
version "6.4.1"
resolved "https://registry.yarnpkg.com/@salesforce/telemetry/-/telemetry-6.4.1.tgz#ad6cc5ae65d80f7c6317dd184523aee3a1e0d3aa"
integrity sha512-bfKRn7PShTKGe8SOUeXjWPchAGJ6vFbSRhMVq6Ty/5gSeSGegGl+cpA09fqLfBqzk9aLhP38E2VFNY7DsYhifA==
dependencies:
"@salesforce/core" "^8.23.4"
"@salesforce/kit" "^3.2.4"
"@salesforce/o11y-reporter" "1.6.0"
applicationinsights "^2.9.8"
got "^11"
proxy-agent "^6.5.0"

"@salesforce/telemetry@^4.0.0":
version "4.1.21"
resolved "https://registry.yarnpkg.com/@salesforce/telemetry/-/telemetry-4.1.21.tgz#5047652cec61c01d7b7aee04f3a9c371dbc88ebb"
Expand All @@ -3292,6 +3305,19 @@
got "^11"
proxy-agent "^6.3.1"

"@salesforce/telemetry@^6.8.0":
version "6.8.0"
resolved "https://registry.yarnpkg.com/@salesforce/telemetry/-/telemetry-6.8.0.tgz#37cc1badf112374580ef717b86080bf2f7a8343c"
integrity sha512-iUT4Svyqr7dPqHJZqK52XQT/prNnutRT/KmElihb39iQ6Kw7cDyH/OuKBF8I72s1vCeHMyc66DzoJ0XT/TFTrA==
dependencies:
"@salesforce/core" "^8.26.3"
"@salesforce/kit" "^3.2.4"
"@salesforce/o11y-reporter" "1.8.1"
applicationinsights "^2.9.8"
got "^11"
o11y_schema "^260.47.0"
proxy-agent "^6.5.0"

"@salesforce/ts-types@^2", "@salesforce/ts-types@^2.0.11", "@salesforce/ts-types@^2.0.12", "@salesforce/ts-types@^2.0.9":
version "2.0.12"
resolved "https://registry.yarnpkg.com/@salesforce/ts-types/-/ts-types-2.0.12.tgz#60420622812a7ec7e46d220667bc29b42dc247ff"
Expand Down Expand Up @@ -4605,6 +4631,16 @@ ajv@^8.0.1, ajv@^8.11.0, ajv@^8.12.0, ajv@^8.17.1:
json-schema-traverse "^1.0.0"
require-from-string "^2.0.2"

ajv@^8.18.0:
version "8.18.0"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.18.0.tgz#8864186b6738d003eb3a933172bb3833e10cefbc"
integrity sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==
dependencies:
fast-deep-equal "^3.1.3"
fast-uri "^3.0.1"
json-schema-traverse "^1.0.0"
require-from-string "^2.0.2"

ansi-colors@^4.1.1:
version "4.1.3"
resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b"
Expand Down Expand Up @@ -9065,6 +9101,11 @@ o11y_schema@256.154.0:
resolved "https://registry.yarnpkg.com/o11y_schema/-/o11y_schema-256.154.0.tgz#1f2f94f1e42d07e62a3e18e09b026345b057dc0c"
integrity sha512-czvU/9cibyZptbr0gLJSM70U7zLlhWC2D2L5e9nOG84Wnqmn4F5YzVjrH1ZQzAzDbBbtbeU6WTS3F/SHqtMQ5g==

o11y_schema@^260.47.0:
version "260.50.0"
resolved "https://registry.yarnpkg.com/o11y_schema/-/o11y_schema-260.50.0.tgz#e886a2c80f44f19c94562714c173f8b2468dae06"
integrity sha512-87ig+sAQ6ohHH0DmdX7I+sVcYpRXqRy676+VjBsrwkzwzMOCgKNmEGkxaTyqNZW5pJogdcvS8jy7zdcxuKyapQ==

object-assign@^4:
version "4.1.1"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
Expand Down Expand Up @@ -10773,16 +10814,7 @@ stop-iteration-iterator@^1.1.0:
es-errors "^1.3.0"
internal-slot "^1.1.0"

"string-width-cjs@npm:string-width@^4.2.0":
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"

string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand Down Expand Up @@ -10846,14 +10878,7 @@ string_decoder@~1.1.1:
dependencies:
safe-buffer "~5.1.0"

"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"

strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1:
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
Expand Down Expand Up @@ -11739,7 +11764,7 @@ workerpool@^9.2.0:
resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-9.3.4.tgz#f6c92395b2141afd78e2a889e80cb338fe9fca41"
integrity sha512-TmPRQYYSAnnDiEB0P/Ytip7bFGvqnSU6I2BcuSw7Hx+JSg/DsUi5ebYfc8GYaSdpuvOcEs6dXxPurOYpe9QFwg==

"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
Expand All @@ -11757,15 +11782,6 @@ wrap-ansi@^6.2.0:
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"
Expand Down