libdocs-mcp
Version:
Multi-agent MCP server providing smart documentation lookup, repository analysis, and web research with relevance-focused filtering
33 lines (31 loc) • 1.3 kB
JavaScript
import { getCurrentDateTimeZone } from "./date-C9YPN4Jt.js";
//#region src/mastra/utils/context.ts
/**
* Return a small XML-like snippet containing environment details.
*
* This function obtains the current local date/time (including timezone)
* and formats it into a simple <environment_details> block suitable for
* embedding in generated documentation or logs.
*
* @returns A string containing the environment details in XML-like format.
*/
function getEnvironmentDetails(now = /* @__PURE__ */ new Date()) {
return `<environment_details>\n<current_time>${getCurrentDateTimeZone(now)}</current_time>\n</environment_details>`;
}
/**
* Wrap the given message in a simple XML-like <message> block and
* append the current environment details.
*
* This is useful for producing messages that include the original content
* alongside timestamp/timezone context for logging or documentation.
*
* @param message - The main message content to wrap.
* @returns A combined string containing the message and environment details.
*/
function wrapMessage(message, now = /* @__PURE__ */ new Date()) {
const query = `<message>\n${message}\n</message>`;
const environmentDetails = getEnvironmentDetails(now);
return `${query}\n\n${environmentDetails}`;
}
//#endregion
export { getEnvironmentDetails, wrapMessage };