@sprucelabs/spruce-cli
Version:
Command line interface for building Spruce skills.
31 lines • 1.57 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const spruce_skill_utils_1 = require("@sprucelabs/spruce-skill-utils");
const AbstractWriter_1 = __importDefault(require("../../../writers/AbstractWriter"));
class AgentWriter extends AbstractWriter_1.default {
async writePlugin(cwd) {
const destination = spruce_skill_utils_1.diskUtil.resolveHashSprucePath(cwd, 'features', 'agent.plugin.ts');
const pluginContents = this.templates.agentPlugin();
const results = await this.writeFileIfChangedMixinResults(destination, pluginContents, 'Supports your skill with registering ai agents.');
return results;
}
async writeSystemPrompt(destinationDir, options) {
const { name } = options;
const destination = this.resolveSystemPromptPath(destinationDir);
const promptContents = this.templates.agentSystemPrompt({
name,
});
const results = await this.writeFileIfChangedMixinResults(destination, promptContents, `The prompt file that defines how your AI Platform Agent behaves.`);
return results;
}
resolveSystemPromptPath(destinationDir) {
const filename = 'SYSTEM_PROMPT.md';
const destination = spruce_skill_utils_1.diskUtil.resolvePath(destinationDir, 'agents', filename);
return destination;
}
}
exports.default = AgentWriter;
//# sourceMappingURL=AgentWriter.js.map