Core extension api

From forcedotcom/salesforcedx-vscode · View interactive version

Core extension api is an AI agent skill from the GitHub repository forcedotcom/salesforcedx-vscode. Public API exported by salesforcedx-vscode-core activate(). Use when modifying SalesforceVSCodeCoreApi, the api object in activate(), exports from core index.ts, services sub-object, or evaluating whether a change to core is breaking. Also use when someone asks "does anything use X" for a core expor

How to use this skill

Skill file

Core Extension Public API

packages/salesforcedx-vscode-core/src/index.ts — activate() returns SalesforceVSCodeCoreApi.

Consumers access via:

const ext = vscode.extensions.getExtension<SalesforceVSCodeCoreApi>(
  'salesforce.salesforcedx-vscode-core'
);
const api = ext.exports;

Also consumed indirectly via CODE0.

Public API — external consumers depend on this

See external-consumers for full list and search commands.

Breaking (check consumers first):

Non-breaking: add new fields.

API surface

Top-level (instances/functions)

workspaceContextUtils

WorkspaceContext is only services.WorkspaceContext, not a top-level activate() field.

Note: the top-level channelService field was removed (W-23348840). Consumers must use services.ChannelService.

Note: the top-level telemetryService field was removed (W-24265117). Callers use services.TelemetryService.getInstance or sf.vscode.core.get.telemetry.

Note: the top-level getUserId field was removed (W-24265117). No API replacement.

`services` (class constructors with static methods)

ChannelService (.getInstance(name)),
TelemetryService (.getInstance(name)),
WorkspaceContext (.getInstance()), CommandEventDispatcher (.getInstance())

External consumers predominantly use services.*. The .getInstance() signatures are public contract.

Before changing

  1. Read external-consumers
  2. Grep monorepo: \.exports\.MEMBER — catches direct access outside wrapper files
  3. Search org:

```bash

gh api -X GET "search/code?q=SYMBOL+org:forcedotcom&per_page=30" \

--jq '.items[] | "\(.repository.name): \(.path)"'

# also search salesforcecli org

gh api -X GET "search/code?q=SYMBOL+org:salesforcecli&per_page=30" \

--jq '.items[] | "\(.repository.name): \(.path)"'

# also search for exports.SYMBOL (direct access pattern)

gh api -X GET "search/code?q=exports.SYMBOL+org:forcedotcom&per_page=30" \

--jq '.items[] | "\(.repository.name): \(.path)"'

```

  1. Read private repos: gh api repos/forcedotcom/REPO/contents/PATH --jq '.content' | base64 -d
  2. Removing something unused in monorepo? Confirm unused externally too
  3. Changing behavior? Check consumer version gates and minimum versions

Consumer patterns

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.