@copilotkit/react-core
Version:
<img src="https://github.com/user-attachments/assets/0a6b64d9-e193-4940-a3f6-60334ac34084" alt="banner" style="border-radius: 12px; border: 2px solid #d6d4fa;" />
74 lines (73 loc) • 2.05 kB
JavaScript
import {
__async,
__spreadValues
} from "../chunk-SKC7AJIV.mjs";
// src/test-helpers/copilot-context.ts
var noop = () => {
};
var copilotApiConfig = {
chatApiEndpoint: "http://localhost",
headers: {}
};
function createTestCopilotContext(overrides = {}) {
return __spreadValues({
actions: {},
setAction: noop,
removeAction: noop,
setRegisteredActions: () => "action-id",
removeRegisteredAction: noop,
chatComponentsCache: { current: { actions: {}, coAgentStateRenders: {} } },
getFunctionCallHandler: () => () => __async(this, null, function* () {
}),
addContext: () => "context-id",
removeContext: noop,
getAllContext: () => [],
getContextString: () => "",
addDocumentContext: () => "document-id",
removeDocumentContext: noop,
getDocumentsContext: () => [],
isLoading: false,
setIsLoading: noop,
chatSuggestionConfiguration: {},
addChatSuggestionConfiguration: noop,
removeChatSuggestionConfiguration: noop,
chatInstructions: "",
setChatInstructions: noop,
additionalInstructions: [],
setAdditionalInstructions: noop,
copilotApiConfig,
showDevConsole: false,
coagentStates: {},
setCoagentStates: noop,
coagentStatesRef: { current: {} },
setCoagentStatesWithRef: noop,
agentSession: null,
setAgentSession: noop,
agentLock: null,
threadId: "",
setThreadId: noop,
runId: null,
setRunId: noop,
chatAbortControllerRef: { current: null },
forwardedParameters: {},
availableAgents: [],
extensions: {},
setExtensions: noop,
interruptActions: {},
setInterruptAction: noop,
removeInterruptAction: noop,
interruptEventQueue: {},
addInterruptEvent: noop,
resolveInterruptEvent: noop,
onError: noop,
bannerError: null,
setBannerError: noop,
internalErrorHandlers: {},
setInternalErrorHandler: noop,
removeInternalErrorHandler: noop
}, overrides);
}
export {
createTestCopilotContext
};
//# sourceMappingURL=copilot-context.mjs.map