MCPcopy Index your code
hub / github.com/github/copilot-sdk / registerCommands

Method registerCommands

nodejs/src/session.ts:897–905  ·  view source on GitHub ↗

* Registers command handlers for this session. * * @param commands - An array of command definitions with handlers, or undefined to clear * @internal This method is typically called internally when creating/resuming a session.

(commands?: { name: string; handler: CommandHandler }[])

Source from the content-addressed store, hash-verified

895 * @internal This method is typically called internally when creating/resuming a session.
896 */
897 registerCommands(commands?: { name: string; handler: CommandHandler }[]): void {
898 this.commandHandlers.clear();
899 if (!commands) {
900 return;
901 }
902 for (const cmd of commands) {
903 this.commandHandlers.set(cmd.name, cmd.handler);
904 }
905 }
906
907 /**
908 * Registers the elicitation handler for this session.

Callers 2

initializeSessionMethod · 0.95
resumeSessionMethod · 0.95

Calls 2

clearMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected