MCPcopy
hub / github.com/coder/mux / createSlashCommandContext

Function createSlashCommandContext

src/browser/utils/chatCommands.test.ts:113–136  ·  view source on GitHub ↗
(
  overrides: Partial<SlashCommandContext> & Pick<SlashCommandContext, "api">
)

Source from the content-addressed store, hash-verified

111}
112
113function createSlashCommandContext(
114 overrides: Partial<SlashCommandContext> & Pick<SlashCommandContext, "api">
115): SlashCommandContext {
116 return {
117 workspaceId: "test-ws",
118 variant: "workspace",
119 projectPath: "/tmp/project",
120 setPreferredModel: mock(() => undefined),
121 setVimEnabled: mock((cb: (prev: boolean) => boolean) => cb(false)),
122 resetInputHeight: mock(() => undefined),
123 onTruncateHistory: mock(() => Promise.resolve(undefined)),
124 sendMessageOptions: {
125 model: "anthropic:claude-sonnet-4-6",
126 thinkingLevel: "off",
127 toolPolicy: [],
128 agentId: "exec",
129 },
130 setInput: mock(() => undefined),
131 setToast: mock(() => undefined),
132 setAttachments: mock(() => undefined),
133 setSendingState: mock(() => undefined),
134 ...overrides,
135 };
136}
137
138function createGoalCommandContext(api: SlashCommandContext["api"]): SlashCommandContext {
139 return createSlashCommandContext({

Callers 4

createGoalCommandContextFunction · 0.85
createClearContextFunction · 0.85
createModelSetContextFunction · 0.85

Calls 1

resolveMethod · 0.80

Tested by

no test coverage detected