32 lines
1023 B
JavaScript
32 lines
1023 B
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.getMiniProgramAIPaths = void 0;
|
|
const shared_1 = require("@vue/shared");
|
|
const manifest_1 = require("../manifest");
|
|
function getMiniProgramAIPaths(inputDir, platform) {
|
|
if (!inputDir || !platform) {
|
|
return [];
|
|
}
|
|
const manifestJson = (0, manifest_1.parseManifestJsonOnce)(inputDir);
|
|
const config = manifestJson[platform];
|
|
if (!config?.agent) {
|
|
return [];
|
|
}
|
|
const agentConfig = config.agent;
|
|
const paths = [];
|
|
const instruction = agentConfig.instruction;
|
|
if (instruction) {
|
|
paths.push(instruction);
|
|
}
|
|
const pageMetadata = agentConfig.pageMetadata;
|
|
if (pageMetadata) {
|
|
paths.push(pageMetadata);
|
|
}
|
|
const skills = agentConfig.skills;
|
|
if ((0, shared_1.isArray)(skills) && skills.length > 0) {
|
|
paths.push(...skills.map((skill) => skill.path).filter(Boolean));
|
|
}
|
|
return paths;
|
|
}
|
|
exports.getMiniProgramAIPaths = getMiniProgramAIPaths;
|