import { version } from "../package.js";
import { getWorkspaces } from "../file-matching.js";
import { formatPath } from "../utilities/formatting.js";
import { defineSource } from "../source.js";
//#region src/lib/sources/metascope.ts
const metascopeSource = defineSource({
	async discover(context) {
		return [context.options.path];
	},
	key: "metascope",
	async parse(input, context) {
		const { absolute, offline, path: basePath, recursive, respectIgnored, templateData, workspaces } = context.options;
		return {
			data: {
				durationMs: 0,
				options: {
					absolute,
					offline,
					path: formatPath(basePath, basePath, absolute),
					recursive,
					respectIgnored,
					templateData,
					workspaces
				},
				scannedAt: (/* @__PURE__ */ new Date()).toISOString(),
				version,
				workspaceDirectories: getWorkspaces(basePath, workspaces).map((directory) => formatPath(directory, basePath, absolute))
			},
			source: input
		};
	},
	phase: 1
});
//#endregion
export { metascopeSource };
