@sprucelabs/spruce-cli
Version:
Command line interface for building Spruce skills.
66 lines • 2.47 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.renderDoors = renderDoors;
exports.chooseOnboardingAdventure = chooseOnboardingAdventure;
const spruce_skill_utils_1 = require("@sprucelabs/spruce-skill-utils");
const script = [
'Hey there! 👋',
"I'm Sprucebot. 🌲🤖",
"I'll be your narrator on this journey to creating your first experience.",
async (player) => {
await player.ui.waitForEnter('Lets get started...');
},
async (player) => {
player.ui.clear();
},
async (player) => {
await renderDoors(player.ui);
},
'You are strolling through the forest when you stumble into a clearing.',
'You see two heavy, thick, doors.',
'They are free standing. You walk around them a few times before...',
'You see words scribed onto each.',
'The door to the left says, "Quick start. 2.5 hours."',
'The door to the right says, "Immersive. 2-3 weeks."',
'"What, 2 and a half hours is not \'Quick\', my robot friend!", you chuckle aloud.',
'"And also, two to three week onboarding!?, What the actual sh**!?"',
"You don't even have time for a 2 hour onboarding, much less 2-3 weeks!",
'But, you take pride in your work and the things you build.',
"And also... maybe on the other side of these doors is that opportunity everyone's been talking about!",
async (player) => {
return await chooseOnboardingAdventure(player);
},
];
async function renderDoors(ui) {
await ui.renderImage(spruce_skill_utils_1.diskUtil.resolvePath(__dirname, '../../../../docs/images/doors.jpg'), {
width: 100,
height: 35,
});
}
async function chooseOnboardingAdventure(player) {
const answer = await player.ui.prompt({
type: 'select',
label: 'Which door do you choose?',
isRequired: true,
options: {
choices: [
{
label: 'Left door (30 minutes)',
value: 'short',
},
{
label: 'Right door (4-6 weeks)',
value: 'immersive',
},
],
},
});
switch (answer) {
case 'immersive':
return player.redirect('onboarding.immersive');
case 'short':
return player.redirect('onboarding.short');
}
}
exports.default = script;
//# sourceMappingURL=onboarding.first.script.js.map
;