feat: Add Be and tbd skill, also added Roadmap file

This commit is contained in:
2026-05-10 16:32:12 -04:00
parent 3500ade13f
commit 0bb8885802
29587 changed files with 10611695 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
{
"logUncaughtExceptions": true,
"logUnhandledRejections": true,
"stackTraceLimit": 30,
"outputs": {
"console": {
"outputFileAndLine": false
},
"syslog": {
"port": 514,
"target": "127.0.0.1",
"outputFileAndLine": false
},
"file": {
"filename": null,
"size": "10M",
"compress": true,
"outputFileAndLine": false
}
},
"namespaces": {
"": {
"console": "info",
"syslog": "info",
"file": "none"
}
}
}

File diff suppressed because one or more lines are too long

40
Skills/@be/node_modules/jibo/README.md generated vendored Normal file
View File

@@ -0,0 +1,40 @@
# jibo
Main entry point into the Jibo API.
## Installation
Install using NPM.
```bash
yarn install jibo --save
```
## Usage
To initialize Jibo and related services, call `jibo.init`. The first argument to `init` is the DOM ID of the `<div>` element that will contain the rendering view for jibo.
### index.html
```html
<div id="face"></div>
<script src="main.js"></script>
```
### main.js
```js
const jibo = require ('jibo');
const Status = jibo.bt.Status;
// 'face' is the DOM ID where to add face rendering
jibo.init('face', (err) => {
if (err) {
return console.error(err);
}
// Run a behavior tree and handle the result
jibo.bt.run('./behaviors/main', (status) => {
console.log('Finished with status: %s', status);
});
});
```

1
Skills/@be/node_modules/jibo/crunch.txt generated vendored Normal file
View File

@@ -0,0 +1 @@
resources/buttons/images/

199
Skills/@be/node_modules/jibo/lib/docs/Runtime.js generated vendored Normal file
View File

@@ -0,0 +1,199 @@
/**
* Enum of RunMode types.
*
* ```
* jibo.RunMode.SIMULATOR
* ```
*
* @typedef module:jibo.Runtime#RunMode
* @prop {string} SIMULATOR Running in the simulator.
* @prop {string} REMOTELY Running in remote mode.
* @prop {string} ON_ROBOT Running on the robot.
* @prop {string} UNIT_TESTS Running in dev mode, no SSM.
*/
/** Running in the simulator. */
/** Running in remote mode. */
/** Running on the robot. */
/** Running in dev mode, no SSM */
/**
* Internal object for an installed plugin
*/
/**
* @prop {jibo.animdb} animdb The Jibo Animation Database.
* @prop {jibo.bt} bt SDK behaviors and decorators.
* @prop {jibo.context} context Context Service (on robot context provider for Cloud).
* @prop {jibo.embodied} embodied Jibo Embodied Dialog.
* @prop {jibo.emotion} emotion Jibo Emotion System.
* @prop {jibo.expression} expression Jibo's expression client.
* @prop {jibo.face} face API to jibo's face.
* @prop {jibo.flow} flow API for the Jibo Flow Editor.
* @prop {jibo.globalEvents} globalEvents Typed global events for events module.
* @prop {jibo.kb} kb Knowledge Base API
* @prop {jibo.loader} loader Load skill assets.
* @prop {jibo.lps} lps Jibo's Local Perceptual Space.
* @prop {jibo.media} media Jibo's Media API (camera and pictures).
* @prop {jibo.mim} mim Jibo's multimodal interaction manager.
* @prop {jibo.sound} sound Manage playback of audio media.
* @prop {jibo.system} system Non-motion related body services.
* @prop {jibo.timer} timer Jibo's main update loop.
* @prop {jibo.tts} tts Text-to-speech.
* @prop {jibo.utils} utils Utility methods for animation, audio, and pathing.
* @prop {jibo.versions} versions Versions for skills-service-manager, platform, and jibo.
* @module jibo
* @description The Jibo SDK singleton.
*/
/**
* `true` if Jibo is currently being initialized.
* @name module:jibo.Runtime.isInitializing
* @type {Boolean}
* @readOnly
* @default false
*/
/**
* `true` if Jibo has finished being initialized.
* @name module:jibo.Runtime.isInitialized
* @type {Boolean}
* @readOnly
* @default false
*/
/**
* Runtime is running in Electron-based environment.
* @name module:jibo.Runtime.electron
* @type {Boolean}
* @readOnly
*/
/**
* Collection of installed plugins.
* @name module:jibo.Runtime._plugins
* @type {Boolean}
* @readOnly
* @private
*/
/**
* Singleton instance of jibo.
* @name module:jibo.Runtime._instance
* @type {jibo.Runtime}
* @readOnly
* @private
*/
/**
* Current version of the Jibo Runtime.
* @name module:jibo.Runtime#version
* @type {String}
* @readOnly
*/
/**
* Electron IPCRenderer context of the Jibo Runtime.
* @name module:jibo.Runtime#electronContext
* @type {Object}
* @readOnly
*/
/** For the SDK tool */
/**
* @name module:jibo.Runtime#behaviorEmitter
* @type {BehaviorEmitter}
* @private
*/
/**
* @name module:jibo.Runtime#session
* @type {SessionManager}
* @private
*/
/**
* @name module:jibo.Runtime#systemManager
* @type {SystemManager}
* @private
*/
/**
// * @name module:jibo.Runtime#visualize
// * @type {Object}
// * @private
// */
/**
* Initialization options
* @name module:jibo.Runtime#options
* @type {Object}
* @private
*/
/**
* @description
* Initializes the jibo SDK.
*
* ```
* let jibo = require('jibo');
* jibo.init('face', (e) => {
* if (e) return console.error(e);
* // Setup!
* });
* ```
* @method module:jibo.Runtime#init
* @param {Object|Function|String|HTMLElement} [options] Either the options, canvas DOM ID or DOM Element for canvas or callback
* @param {DOMElement|String} [options.display] Either the canvas DOM or DOM ID
* @param {Function} [callback] Called when the SDK is finished initializing.
*/
/**
* Register an external plugin with the jibo runtime.
* @method module:jibo.Runtime#registerPlugin
* @private
* @param {jibo.PluginConstructor} pluginClass The class definition.
* @param {String} id The identifier of the plugin.
* @param {Object} [options] Additional register options or the API name.
* @param {Boolean} [options.api=false] If the plugin is also an API on jibo.
* @param {String[]} [options.depends] The plugin dependencies.
* @param {Boolean} [options.electron=false] If the plugin is electron-only.
*/
/**
* Stores which mode the current skill is running. It can be: `jibo.RunMode.SIMULATOR`, `jibo.RunMode.REMOTELY`, or `jibo.RunMode.ON_ROBOT`.
*
* ```
* let jibo = require('jibo');
* if( jibo.runMode === jibo.RunMode.SIMULATOR ){
* // ...
* }
* ```
* @name module:jibo.Runtime.runMode
* @type {RunMode}
* @readOnly
*/
/**
* Setup plugins to create the jibo API.
* @method module:jibo.Runtime#_installPlugins
* @private
*/
/**
* Setup plugins to create the jibo API.
* @method module:jibo.Runtime#_initPlugins
* @private
*/
/**
* Gets singleton instance of Jibo.
* @name module:jibo.Runtime.instance
* @type {jibo}
* @private
* @readOnly
*/

135
Skills/@be/node_modules/jibo/lib/docs/bt/BaseElement.js generated vendored Normal file
View File

@@ -0,0 +1,135 @@
/**
* @class BaseElement
* @memberof jibo.bt
* @private
* @description Parent class for Behavior and Decorator.
*
* Subclasses: {@link jibo.bt.behaviors.Behavior|Behavior}, {@link jibo.bt.behaviors.ParentBehavior|ParentBehavior}, {@link jibo.bt.behaviors.Decorator|Decorator}
*
* @param {Object} [options] Options for the behavior
*/
/**
* The list of options
* @name jibo.bt.Behavior#options
* @type {Object}
* @readOnly
*/
/**
* The list of options
* @name jibo.bt.Decorator#options
* @type {Object}
* @readOnly
*/
/**
* The current internal status of the element
* @name jibo.bt.BaseElement#_currentStatus
* @type {String}
* @private
*/
/**
* Instance of the blackboard
* @name jibo.bt.Behavior#blackboard
* @type {jibo.bt.Blackboard}
* @readOnly
*/
/**
* Instance of the blackboard
* @name jibo.bt.Decorator#blackboard
* @type {jibo.bt.Blackboard}
* @readOnly
*/
/**
* Instance of the behavior emitter
* @name jibo.bt.Behavior#emitter
* @type {jibo.bt.BehaviorEmitter}
* @readOnly
*/
/**
* Instance of the behavior emitter
* @name jibo.bt.Decorator#emitter
* @type {jibo.bt.BehaviorEmitter}
* @readOnly
*/
/**
* Name of the asset pack
* @name jibo.bt.Behavior#assetPack
* @type {String}
* @readOnly
*/
/**
* Name of the asset pack
* @name jibo.bt.Decorator#assetPack
* @type {String}
* @readOnly
*/
/**
* Name of the behavior
* @name jibo.bt.Behavior#name
* @type {String}
* @readOnly
*/
/**
* Name of the behavior
* @name jibo.bt.Decorator#name
* @type {String}
* @readOnly
*/
/**
* Get the current status
* @name jibo.bt.Behavior#currentStatus
* @type {String}
* @readOnly
*/
/**
* Get the current status
* @name jibo.bt.Decorator#currentStatus
* @type {String}
* @readOnly
*/
/**
* Stops the behavior or decorator, must override
* @method jibo.bt.Behavior#stop
* @return {Promise<void>} A promise that resolves after any asynchronous cleanup has been performed.
*/
/**
* Stops the behavior or decorator, must override
* @method jibo.bt.Decorator#stop
* @return {Promise<void>} A promise that resolves after any asynchronous cleanup has been performed.
*/
/**
* Destroys the behavior, removes all references.
* @method jibo.bt.Behavior#destroy
*/
/**
* Destroys the decorator, removes all references.
* @method jibo.bt.Decorator#destroy
*/
/**
* Stops and Destroys the behavior or decorator
* @method jibo.bt.Behavior#stopAndDestroy
* @return {Promise<void>} A promise that resolves after any asynchronous cleanup has been performed.
*/
/**
* Stops and Destroys the behavior or decorator
* @method jibo.bt.Decorator#stopAndDestroy
* @return {Promise<void>} A promise that resolves after any asynchronous cleanup has been performed.
*/

91
Skills/@be/node_modules/jibo/lib/docs/bt/Behavior.js generated vendored Normal file
View File

@@ -0,0 +1,91 @@
/**
* @class Behavior
* @memberof jibo.bt
* @description The baseclass to all behaviors.
*
* Subclasses: {@link jibo.bt.behaviors}
* @param {Object} [options] Options for the behavior
* @param {String} [options.name=''] Name of the behavior instance
* @param {Array<jibo.bt.Decorator>} [options.decorators=[]] Decorators
* @param {jibo.bt.Blackboard} [options.blackboard=null] Blackboard instance
* @param {jibo.bt.BehaviorEmitter} [options.emitter=null] Emitter instance
* @param {String} [options.assetPack=''] Name of the asset pack
* @param {Object} [defaultOptions] Defaults for options
*/
/**
* Reference to the composite parent behavior
* @name jibo.bt.Behavior#parent
* @type {jibo.bt.ParentBehavior}
* @readOnly
*/
/**
* List of decorators to wait on start
* @name jibo.bt.Behavior#waitDecorators
* @type {Array<jibo.bt.Decorator>}
* @private
*/
/**
* Number of wait decorators
* @name jibo.bt.Behavior#waitDecoratorsLength
* @type {int}
* @private
*/
/**
* Destroy this
*/
/**
* Collection of decorators
* @name jibo.bt.Behavior#decorators
* @type {Array<jibo.bt.Decorator>}
* @readOnly
*/
/**
* Starts the behavior or decorator
* @method jibo.bt.Behavior#start
* @returns {Boolean} `true` if this element is started successfully. `false` otherwise.
*/
/**
* Called every frame. Must be overridden in subclass.
* @method jibo.bt.Behavior#update
* @returns {jibo.bt.Status} The current status of this behavior.
*/
/**
* Internal pause the behavior
* @method jibo.bt.Behavior#_pause
* @private
*/
/**
* Internal unpause the behavior
* @method jibo.bt.Behavior#_unpause
* @private
*/
/**
* Internal start the behavior
* @method jibo.bt.Behavior#_start
* @private
* @return {Boolean} Status result
*/
/**
* Internal stop the behavior
* @method jibo.bt.Behavior#_stop
* @return {Promise<void>} A promise that resolves after any asynchronous cleanup has been performed.
* @private
*/
/**
* Internal update the behavior
* @method jibo.bt.Behavior#_update
* @private
* @return {jibo.bt.Status} Resulting status
*/

View File

@@ -0,0 +1,5 @@
/**
* @class BehaviorEmitter
* @extends EventEmitter
* @memberof jibo.bt
*/

View File

@@ -0,0 +1,85 @@
/**
* @class BehaviorTree
* @extends EventEmitter
* @memberof jibo.bt
* @description Object for controlling the playback of the behavior tree.
*
* @param {jibo.bt.Behavior} root The root behavior of the tree.
* @param {jibo.bt.Blackboard} blackboard Reference to the global Blackboard instance.
* @param {Object} notepad Reference to a temporary object to use.
* @param {Object} result Reference to the tree's result.
* @param {jibo.bt.BehaviorEmitter} emitter Reference to the behavior's emitter.
*/
/**
* Get the current status of the behavior tree
* @name jibo.bt.BehaviorTree#currentStatus
* @type {jibo.bt.Status}
* @readOnly
*/
/**
* Start the behavior tree.
* @method jibo.bt.BehaviorTree#start
* @return {Boolean} Status result
*/
/**
* When behavior tree starts
* @event jibo.bt.BehaviorTree#start
*/
/**
* Stop the behavior tree.
* @method jibo.bt.BehaviorTree#stop
* @return {Promise<void>} A promise that resolves after any asynchronous cleanup has been performed.
*/
/**
* When behavior tree stops
* @event jibo.bt.BehaviorTree#stop
*/
/**
* Pause the behavior tree.
* @private
* @method jibo.bt.BehaviorTree#pause
*/
/**
* When behavior tree pauses
* @event jibo.bt.BehaviorTree#pause
*/
/**
* Resume the behavior tree.
* @private
* @method jibo.bt.BehaviorTree#pause
*/
/**
* When behavior tree resumes
* @event jibo.bt.BehaviorTree#unpause
*/
/**
* Called every frame.
* @method jibo.bt.BehaviorTree#update
* @returns {jibo.bt.Status} The current status of this behavior.
*/
/**
* Destroy and don't use after this
* @method jibo.bt.BehaviorTree#destroy
*/
/**
* When behavior tree is destroyed
* @event jibo.bt.BehaviorTree#destroy
*/
/**
* Stop and destroy, don't use after this
* @method jibo.bt.BehaviorTree#stopAndDestroy
* @return {Promise<void>} A promise that resolves after any asynchronous cleanup has been performed.
*/

View File

@@ -0,0 +1,4 @@
/**
* @class Blackboard
* @memberof jibo.bt
*/

60
Skills/@be/node_modules/jibo/lib/docs/bt/Decorator.js generated vendored Normal file
View File

@@ -0,0 +1,60 @@
/**
* @class Decorator
* @memberof jibo.bt
* @description Baseclass for all decorators. Decorators can force a behavior to succeed or fail. They can restart
* a behavior once it's failed or succeeded, and they can modify when a behavior starts.
*
* Subclasses: {@link jibo.bt.decorators}
* @param {Object} [options] Options for the decorator
* @param {String} [options.name=''] Name of the decorator instance
* @param {jibo.bt.Blackboard} [options.blackboard=null] Blackobard instance
* @param {jibo.bt.BehaviorEmitter} [options.emitter=null] Emitter instance
* @param {String} [options.assetPack=''] Name of the asset pack
* @param {Object} [defaultOptions] Defaults for options
*/
/**
* The parent behavior
* @name jibo.bt.Decorator#behavior
* @type {Behavior}
* @readOnly
*/
/**
* Starts the behavior or decorator
* @method jibo.bt.Decorator#start
* @returns {Boolean|Status.WAIT} `true` if this element is started successfully. `false` otherwise. `Status.WAIT` will be returned if the decorated behavior should not start yet.
*/
/**
* Called every frame. Gives a chance for this decorator to change the status of a behavior.
* @method jibo.bt.Decorator#update
* @param result {jibo.bt.Status} The current status of the behavior this decorator is decorating.
* @returns {jibo.bt.Status} The modified status of the behavior this decorator is decorating.
*/
/**
* Destroy this
*/
/**
* Internal start from the behavior tree level
* @method jibo.bt.Decorator#_start
* @private
* @return {Boolean} Success
*/
/**
* Internal stop from the behavior tree level
* @method jibo.bt.Decorator#_stop
* @return {Promise<void>} A promise that resolves after any asynchronous cleanup has been performed.
* @private
*/
/**
* Internal update from the behavior tree level
* @method jibo.bt.Decorator#_update
* @private
* @param {jibo.bt.Status} result
* @return {jibo.bt.Status} resulting status
*/

86
Skills/@be/node_modules/jibo/lib/docs/bt/Factory.js generated vendored Normal file
View File

@@ -0,0 +1,86 @@
/**
* @class BehaviorConstructor
* @memberof jibo.bt
* @description Abstract type alias (needed by the Factory function) for the constructors of the behavior and decorator classes.
*/
/**
* Utility methods for registering behaviors and creating behaviors trees.
* @namespace jibo.bt
*/
/**
* Map of behaviors
* @name jibo.bt#_behaviors
* @type {Object}
* @private
*/
/**
* The default blackboard
* @name jibo.bt#blackboard
* @type {jibo.bt.Blackboard}
* @private
*/
/**
* Register a behavior or decorator globally
* @name jibo.bt#register
* @method
* @param {String} name The PascalCased name for the behavior
* @param {String} namespace This behavior's namespace. Pass in a globally unique name for this namesapce.
* @param {Module} classRef Class reference for the behavior or decorator
*/
/**
* Add all behaviors
* @method jibo.bt#registerCore
* @private
*/
/**
* Creates a runnable behavior tree from a bt file import.
* @method jibo.bt#create
* @param {String|Function} uri Relative or absolute path to a `.bt` file or module export of behavior tree.
* @param {Object} [overrides] Options for populating behavior tree globals.
* @param {jibo.bt.Blackboard} [overrides.blackboard] Override the default blackboard object for this behavior tree.
* @param {Object} [overrides.notepad] Provide your own notepad object instead of the default one.
* @param {String} [overrides.assetPack] The asset pack name to use for loading assets in this tree.
* @returns {jibo.bt.BehaviorTree}
*/
/**
* Creates and runs a runnable behavior tree from a bt file import.
* ```
* const jibo = require('jibo');
* jibo.init('face', (err) => {
* jibo.bt.run('./behaviors/main', function(status){});
* });
*
* // Other supported APIs
* jibo.bt.run('./behaviors/main');
* jibo.bt.run('./behaviors/main', (status) => {});
* const overrides = {};
* jibo.bt.run('./behaviors/main', overrides);
* jibo.bt.run('./behaviors/main', overrides, (status) => {});
* ```
*
* @method jibo.bt#run
* @param {String|Function} uri Relative or absolute path to a `.bt` file or module export of behavior tree.
* @param {Object} [overrides] Options for populating behavior tree globals.
* @param {jibo.bt.Blackboard} [overrides.blackboard] Override the default blackboard object for this behavior tree.
* @param {Object} [overrides.notepad] Provide your own notepad object instead of the default one.
* @param {String} [overrides.assetPack] The asset pack name to use for loading assets in this tree.
* @param {Function} onFinishedCallback The callback which gets called when the behavior tree has reached a status of FAILED, SUCCEEDED, or INTERRUPTED.
* @param {Status} status The status which the behavior tree finished with.
* @returns {jibo.bt.BehaviorTree}
*/
/**
* Resolves the path in relation to a calleeDirname directory. If the supplied uri is an absolute path, the uri is
* returned unmodified
* @param {String} calleeDirname The directory name where the uri is relative to
* @param {String} uri The relative or absolute uri to a file in relation to the calleeDirname
* @returns {String} The result absolute path
*
*/

View File

@@ -0,0 +1,29 @@
/**
* @class ParentBehavior
* @extends jibo.bt.Behavior
* @memberof jibo.bt
* @description The baseclass to all behaviors that contain a collection of child Behaviors.
*
* Subclasses: {@link jibo.bt.behaviors.Parallel|Parallel}, {@link jibo.bt.behaviors.Random|Random}, {@link jibo.bt.behaviors.Sequence|Sequence}, {@link jibo.bt.behaviors.Switch|Switch}
*
* @param {Object} [options] See {@link jibo.bt.Behavior|Behavior} for all options.
* @param {Array<jibo.bt.Behavior>} [options.children=[]] Child behaviors
* @param {Object} [defaultOptions] Defaults for options
*/
/**
* Destroy this
*/
/**
* Set the collection of children
* @name jibo.bt.ParentBehavior#children
* @type {Array<jibo.bt.Behavior>}
*/
/**
* Internal stop the behavior
* @method jibo.bt.ParentBehavior#_stop
* @return {Promise<void>} A promise that resolves after any asynchronous cleanup has been performed.
* @private
*/

64
Skills/@be/node_modules/jibo/lib/docs/bt/Status.js generated vendored Normal file
View File

@@ -0,0 +1,64 @@
/**
* Enumeration of behavior states
* @class Status
* @memberof jibo.bt
*/
/**
* The behavior or flow succeeded.
* @name jibo.bt.Status.SUCCEEDED
* @type {String}
* @readOnly
* @default "SUCCEEDED"
*/
/**
* The behavior or flow failed.
* @name jibo.bt.Status.FAILED
* @type {String}
* @readOnly
* @default "FAILED"
*/
/**
* The behavior or flow was interrupted.
* @name jibo.bt.Status.INTERRUPTED
* @type {String}
* @readOnly
* @default "INTERRUPTED"
*/
/**
* The behavior is in progress and hasn't returned.
* (Not returned for flows)
* @name jibo.bt.Status.IN_PROGRESS
* @type {String}
* @readOnly
* @default "IN_PROGRESS"
*/
/**
* The behavior is in an invalid state.
* (Not returned for flows)
* @name jibo.bt.Status.INVALID
* @type {String}
* @readOnly
* @default "INVALID"
*/
/**
* Don't update the state.
* (Not returned for flows)
* @name jibo.bt.Status.PAUSED
* @type {String}
* @readOnly
* @default "PAUSED"
*/
/**
* Only used by decorators.
* @name jibo.bt.Status.WAIT
* @type {String}
* @readOnly
* @default "WAIT"
*/

View File

@@ -0,0 +1,7 @@
/**
* @class Blink
* @extends jibo.bt.Behavior
* @memberof jibo.bt.behaviors
* @description Plays a single blink animation. Succeeds immediately.
* @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options.
*/

View File

@@ -0,0 +1,9 @@
/**
* @class ExecuteScript
* @extends jibo.bt.Behavior
* @memberof jibo.bt.behaviors
* @description
* Executes arbitrary synchronous JavaScript.
* @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options.
* @param {Function} options.exec Function to execute.
*/

View File

@@ -0,0 +1,17 @@
/**
* @callback jibo.bt.behaviors.ExecuteScriptAsync~ExecuteFunction
* @description This behavior calls this function. ExecuteScriptAsync will succeed or fail only when one of the
* two callbacks are called.
* @param {Function} succeed Call this function when you want this behavior to succeed.
* @param {Function} fail Call this function when you want this behavior to fail.
*/
/**
* @class ExecuteScriptAsync
* @extends jibo.bt.Behavior
* @memberof jibo.bt.behaviors
* @description Asynchronously executes JavaScript.
* @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options.
* @param {jibo.bt.behaviors.ExecuteScriptAsync~ExecuteFunction} options.exec Function to execute. Behavior will not stop unless one of the callbacks
* are called.
*/

View File

@@ -0,0 +1,32 @@
/**
* @typedef {Object} jibo.bt.behaviors.Listen~Options
* @property {boolean} heyJibo Listen for "Hey, Jibo" first.
* @property {boolean} detectEnd Listen for end of speech.
* @property {boolean} incremental Return incremental ASR results as they are streamed from the cloud.
* @property {String} authenticateSpeaker Authenticates against that person.
*/
/**
* Function that returns the options object.
* @callback jibo.bt.behaviors.Listen~GetOptions
* @returns {jibo.bt.behaviors.Listen~Options}
*/
/**
* Function that returns the options object.
* @callback jibo.bt.behaviors.Listen~OnResult
* @param {jibo.bt.ListenEmitter} listener Use this instance to listen for listen events.
*/
/**
* @deprecated
* @class Listen
* @extends jibo.bt.Behavior
* @memberof jibo.bt.behaviors
* @description Performs audio speech recognition and applies and parses the results according to a rules file.
* @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options.
* @param {jibo.bt.behaviors.Listen~GetOptions} options.getOptions Returns the options object.
* @param {String} options.rule Path the to `.rule` file. This assumes the path starts at `${project}/rules`.
* @param {jibo.bt.behaviors.Listen~OnResult} options.onResult Called and passed a {@link jibo.bt.behaviors.ListenEmitter|ListenEmitter} object. Events are fired from the Listener
* at certain points in this behavior's lifecycle.
*/

View File

@@ -0,0 +1,29 @@
/**
* @typedef {Object} jibo.bt.behaviors.ListenEmbedded~Options
*/
/**
* Called when the {@link jibo.bt.EmbeddedListenEmitter|EmbeddedListenEmitter} is constructed.
* @callback jibo.bt.behaviors.ListenEmbedded~OnResult
* @param {jibo.bt.EmbeddedListenEmitter} listener Use this instance to listen for listen events.
*/
/**
* @deprecated
* @class ListenEmbedded
* @extends jibo.bt.Behavior
* @memberof jibo.bt.behaviors
* @description Succeeds when when the specified audio phrase is spotted.
* @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options.
* @param {jibo.bt.behaviors.ListenEmbedded~Rules} options.rule The embedded rule to listen for.
* @param {jibo.bt.behaviors.ListenEmbedded~OnResult} options.onResult Called and passed a {@link jibo.bt.EmbeddedListenEmitter|EmbeddedListenEmitter} object. Events are
* fired from the emitter at certain points in this behavior's lifecycle.
*/
/**
* Enum for embedded listen rule types.
* @name jibo.bt.behaviors.ListenEmbedded#Rules
* @readOnly
* @type {enum}
* @prop {string} HEY_jibo Listed for "Hey Jibo".
*/

View File

@@ -0,0 +1,33 @@
/**
* @typedef {Object} jibo.bt.behaviors.ListenJs~Options
* @property {boolean} heyJibo Listen for "Hey, Jibo" first.
* @property {boolean} detectEnd Listen for end of speech.
* @property {boolean} incremental Return incremental ASR results as they are streamed from the cloud.
* @property {String} authenticateSpeaker Authenticates against that person.
*/
/**
* Function that returns the options object.
* @callback jibo.bt.behaviors.ListenJs~GetOptions
* @returns {jibo.bt.behaviors.ListenJs~Options}
*/
/**
* Called when the {@link jibo.bt.behaviors.ListenEmitter|ListenEmitter} is constructed.
* @callback jibo.bt.behaviors.ListenJs~OnResult
* @param {jibo.bt.ListenEmitter} listener Use this instance to listen for listen events.
*/
/**
* @deprecated
* @class ListenJs
* @extends jibo.bt.Behavior
* @memberof jibo.bt.behaviors
* @description Performs audio speech recognition and applies and parses the results according to a rules file.
* @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options.
* @param {jibo.bt.behaviors.ListenJs~GetOptions} options.getOptions Returns the options object.
* @param {Function} options.getRule This function returns a string representation of a rule. Use this behavior to dynamically generate rules files instead
* of loading a rule file from disk.
* @param {jibo.bt.behaviors.ListenJs~OnResult} options.onResult Called and passed a {@link jibo.bt.behaviors.ListenEmitter|ListenEmitter} object. Events are fired from the Listener
* at certain points in this behavior's lifecycle.
*/

View File

@@ -0,0 +1,23 @@
/**
* @class Point3D
* @memberof jibo.bt.behaviors.LookAt
* @description Defines a point in 3D space.
* @prop {number} x The forward-facing vector in Jibo's coordinate frame (meters).
* @prop {number} y The left-facing vector in Jibo's coordinate frame (meters).
* @prop {number} z The up-facing vector in Jibo's coordinate frame (meters).
*/
/**
* @class LookAt
* @extends jibo.bt.Behavior
* @memberof jibo.bt.behaviors
* @description Makes Jibo look at a 3D point in space.
* `LookAt` has two modes. In single-shot mode, this behavior makes Jibo look at the 3D point returned
* by `getTarget` and succeeds when Jibo reaches his this target. In continuous mode, `getTarget` is
* called every frame, and this behavior will remain in progress indefinitely until explicitly stopped by a
* parent bahevior or a decorator.
* @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options.
* @param {Function} options.getTarget Returns a {@link jibo.bt.behaviors.LookAt.Point3D} object.
* @param {boolean} [options.isContinuous=false] `true` if this behavior is in continous-mode. `false` if in single-shot look-at.
* @param {Function} options.config Called and passed a {@link LookatBuilder} object for configuration purposes. Do not call {@link LookatBuilder#startLookat}. This is called automatically by the behavior.
*/

View File

@@ -0,0 +1,57 @@
/**
* Load or generate the menu configuration data. For the menu to function, the button actions must
* be an 'utterance' or 'press' event - no other button actions will be responded to.
* @callback jibo.bt.behaviors.Menu~GetConfig
* @param {Function} callback When config has been loaded or generated, pass it to this callback.
*/
/**
* Called when a Menu times out or closes. Return value finds an exception handler within the flow. *Unhandled exceptions use the default behavior of returning to Jibo's idle state.
* @callback jibo.bt.behaviors.Menu~OnMenuClosed
* @param {boolean} timedOut `true` if the menu timed out, `false` if it was closed by the user.
* @param {jibo.face.views.MenuView} menu Created menu. Use to read menu position or any other information before the menu closes.
* @param {Function} overrideMenuTransition Override the transition out of the menu. Pass a [ChangeOptions]{@link jibo.face.views~ChangeOptions} to control the transition, or `remain` in order to leave the menu in place.
* @param {String} results.exception (Flow Only) Exception for the closed menu; either `~InteractionError.MenuTimeout` or `~InteractionError.MenuClosed`.
*/
/**
* Called when an item has been chosen.
* @callback jibo.bt.behaviors.Menu~OnItemChosen
* @param {any} results Either the listen results or the button press event, depending on how the menu is configured.
* @param {jibo.face.views.MenuView} menu Created menu. Use to read menu position or any other information before the menu closes.
* @param {Function} overrideMenuTransition Call to override the transition out of the menu. Pass a [ChangeOptions]{@link jibo.face.views~ChangeOptions} to control the transition, or `remain` in order to leave the menu in place.
*/
/**
* Called to confirm that a positional selection makes sense, allowing custom handling to select certain types of items, if desired. This is called when a user says something like 'open the one on the right', and is called before the onItemChosen callback.
* @callback jibo.bt.behaviors.Menu~OnPositionalSelect
* @param {jibo.mim.AsrResult} commandASR Data from NLU service.
* @param {Number} intendedIndex Index that the menu plans to use for selection.
* @param {jibo.face.views.MenuView} menu Created menu. Use to read button data, if you didn't keep track of it yourself.
* @returns {number} An item index to change what will be selected, or NaN to select nothing. Returning undefined will use the default behavior (selecting intendedIndex).
*/
/**
* @class Menu
* @extends jibo.bt.Behavior
* @memberof jibo.bt.behaviors
* @description A single stage menu.
* @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options.
* @param {jibo.bt.behaviors.Menu~GetConfig} options.getConfig Load or generate the menu config data.
* @param {jibo.bt.behaviors.Menu~OnMenuClosed} options.onMenuClosed Called if the menu times out or is closed.
* @param {jibo.bt.behaviors.Menu~OnItemChosen} options.onItemChosen Called when the user picks an item from the list.
* @param {jibo.bt.behaviors.Menu~OnPositionalSelect} options.onPositionalSelect Called when the user uses a positional selection voice command
*/
/**
* Callback for button 'press' events from the menu.
* @method jibo.bt.Menu#onPressEvent
* @param {any} event Whatever the press event from the menu was, as defined in the view config.
* @private
*/
/**
* Callback for when the list is closed for any reason.
* @method jibo.bt.Menu#onListClosed
* @private
*/

View File

@@ -0,0 +1,327 @@
/**
* @class ListenBundle
* @memberof jibo.mim
* @description Internal bundle of listen specific data.
* @private
*/
/**
* Timeout duration in milliseconds. If NaN, do not timeout.
* @name jibo.mim.ListenBundle#timeout
* @type {Number}
*/
/**
* Beginning of timeout in epoch time. Timeout is triggered when the difference between this
* time and current time is greater than timeout.
* @name jibo.mim.ListenBundle#startTime
* @type {Number}
*/
/**
* Listener from jibo.mim#listenDelegate.
* @name jibo.mim.ListenBundle#listener
* @type {any}
*/
/**
* If we had failed to get a listener previously. Skill will be exited on another failure.
* @name jibo.mim.ListenBundle#failedToGetListener
* @type {boolean}
*/
/**
* @class MimStates
* @memberof jibo.mim
* @description Bundle all the Mim's state machine states, with strong typing. Each
* property of MimStates is a State from jibo-state-machine. All actions are performed
* by functions of the Mim class.
* @private
*/
/**
* Return prompt data for MIM. Properties are used as variables
* for MIM condition evaluation and prompt text insertion.
* @callback jibo.bt.behaviors.Mim~GetPromptData
* @returns {any}
*/
/**
* Called on listen complete during Optional Response or Question, before the MIM analyzes the
* result. Allows skills to implement their own check on the result to tell the MIM how to handle it.
* @callback jibo.bt.behaviors.Mim~CheckResult
* @param {jibo.jetstream.types.ListenResult} result Data from NLU service.
*/
/**
* Called when an Optional Response or Question MIM completes successfully.
* Optional Response MIMs always complete;
* check `options.state.lastResultState` to see if user responded.
* @callback jibo.bt.behaviors.Mim~OnSuccess
* @param {any} results Bundles data from MIM.
* @param {jibo.jetstream.types.ListenResult} results.asrResults Data from NLU service.
* @param {jibo.mim.SpeakerIds} results.speakerIds If available, the ID of the speaker.
* @param {jibo.mim.MimState} results.state Current state of the MIM.
* @param {String} results.firstGrammarTag (Flow use only) The value of the first rule slot (results.asrResults.entities[results.asrResults.slotActions[0]]). The default transition from a MIM. If a listen has multiple potential slots, this value should not be considered reliable.
*/
/**
* (Flow use only) Called when a Question MIM fails entirely. Either the user did not
* respond to Jibo or Jibo could not understand the user and has run out of error prompts.
* Return value finds an error handler within the flow. Unhandled
* errors use Jibo's standard MIM exception handling.
* @callback jibo.bt.behaviors.Mim~OnFailure
* @param {any} results Bundles data from MIM.
* @param {jibo.jetstream.types.ListenResult} results.asrResults Data from NLU service.
* @param {jibo.mim.SpeakerIds} results.speakerIds If available, the ID of the speaker.
* @param {jibo.mim.MimState} results.state Current state of the MIM.
* @param {String} results.exception Exception for this failure; either `~InteractionError.noMatch` or `~InteractionError.noInput`.
*/
/**
* (Internal to Menu behavior only) Called to confirm that a positional selection makes sense, allowing custom handling to select certain types of items, if desired.
* @callback jibo.bt.behaviors.Mim~OnPositionalSelect
* @param {jibo.jetstream.types.ListenResult} commandASR Data from NLU service.
* @param {Number} intendedIndex Index that the menu plans to use for selection.
* @param {jibo.face.views.MenuView} menu Created menu. Use to read button data, if you didn't keep track of it yourself.
* @returns {number} Return an item index to change what will be selected, or null to select nothing. Returning undefined will use the default behavior (selecting intendedIndex).
* @private
*/
/**
* @class Mim
* @extends jibo.bt.Behavior
* @memberof jibo.bt.behaviors
* @description Perform a dialogue interaction. Can be an announcement, an
* announcement with optional user response, or a
* question and attempt to get answer from the user.
* @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options.
* @param {String} options.mimPath Path to the MIM file to use.
* @param {jibo.bt.behaviors.Mim~GetPromptData} options.getPromptData Returns the prompt variable data.
* @param {jibo.bt.behaviors.Mim~CheckResult} options.checkResult Called and passed data about what the Mim is hearing when a listen is complete. Optional Response and Question MIMs only.
* @param {jibo.bt.behaviors.Mim~OnSuccess} options.onSuccess Called and passed data about what the Mim heard when it completes. Optional Response and Question MIMs only.
* @param {jibo.bt.behaviors.Mim~OnFailure} options.onFailure Called and passed data about what the Mim heard or did not hear when it completes. Question MIMs only.
*/
/**
* Stops the MIM. The optional parameter here is considered private - this should be used
* like the stop() method it inherits from Behavior, with no parameters.
* @method jibo.bt.Mim#stop
* @param {boolean} [isMenuTap] If the stop() was due to tapping a menu button.
* @private
*/
/**
* If this Mim has an active view, pops the top view from the list and destroys this Mim's
* active view.
* @method jibo.bt.Mim#removeView
* @private
* @param {string} intent Reason for removing the view - 'success', 'failure', or null if view should never be left blank.
*/
/**
* Remove combinedRuleHandle and ruleHandle from NLU memory.
* @method jibo.bt.Mim#unloadRules
* @private
*/
/**
* Cleans up global event listeners that the MIM added.
* @method jibo.bt.Mim#cleanUpEvents
* @private
*/
/**
* Opens the MIM's GUI if it is not already open.
* @method jibo.bt.Mim#openGUI
* @private
*/
/**
* Callback for events from `jibo.mim.openGUI`. Opens the GUI, if it is not already open.
* @method jibo.bt.Mim#onOpenGUIEvent
* @private
*/
/**
* Callback for events from `jibo.mim.handleSpeech`. Stops active speech or listen to parse a
* spoofed utterance.
* @method jibo.bt.Mim#onSpeechEvent
* @param {string} utterance The spoofed utterance in need of parsing.
* @private
*/
/**
* Callback for events from `jibo.mim.end`. Ends the MIM immediately.
* @method jibo.bt.Mim#onEndEvent
* @param {any} data Not currently used. In the future, data about how the MIM should end.
* @private
*/
/**
* Callback for events from `jibo.mim.heyJibo`. Handles barge in via "Hey Jibo".
* @method jibo.bt.Mim#onHeyJiboHeard
* @private
*/
/**
* State entry for states.loadConfig. Load .mim file(s) and then go to states.loadRule for OR/Q
* mims or states.choosePrompt for AN mims.
* @method jibo.bt.Mim#loadMim
* @private
*/
/**
* State entry for states.loadRule. Load .mim file(s) and then go to states.loadRule for OR/Q
* mims or states.choosePrompt for AN mims. Sets up loading of rule for mim and unionizing it
* with mim global rule as a Promise. Immediately go to states.choosePrompt.
* @method jibo.bt.Mim#loadRule
* @private
*/
/**
* State entry for states.choosePrompt. Choose prompt text to be played. Go to states.listen
* if no prompt or silent prompt chosen. Go to states.speak to speak the prompt.
* @method jibo.bt.Mim#choosePrompt
* @private
*/
/**
* State entry for states.speak. Speaks the chosen prompt through the TTS system. When finished,
* goes to states.reportResults for an AN mim or states.listen for an OR/Q mim.
* @method jibo.bt.Mim#speak
* @private
*/
/**
* State interuption for states.speak. Stops jibo.mim#speakDelegate playback.
* @method jibo.bt.Mim#stopSpeaking
* @private
*/
/**
* State entry for states.listen. Starts a listener from jibo.mim#listenDelegate.
* If appropriate, starts timeout. If appropriate, displays the mim GUI. When listen completes,
* transitions to states.analyzeResults for mim results or states.analyzeMimGlobal for mim
* global commands.
* @method jibo.bt.Mim#startListen
* @private
*/
/**
* Callback for screen interaction. Resets timeouts during listen.
* @method jibo.bt.Mim#resetTimeout
* @private
*/
/**
* State interuption for states.listen. Stops listener and removes mim GUI if present.
* @method jibo.bt.Mim#stopListen
* @private
*/
/**
* State exit for states.listen. Stops listener and removes screen touch listeners.
* @method jibo.bt.Mim#listenExit
* @private
*/
/**
* State update for states.listen. Tracks timeout. If timeout triggered, change state to
* states.analyzeResults.
* @method jibo.bt.Mim#updateListen
* @private
*/
/**
* State entry for states.analyzeMimGlobal. If global command is 'repeat', go to
* states.choosePrompt. Otherwise, redirect to states.analyzeResults.
* @method jibo.bt.Mim#analyzeMimGlobal
* @private
*/
/**
* State entry for states.analyzeMenuGlobal. If global command is 'left' or right' and GUI is
* active, scroll list and return to states.listen. Otherwise, redirect to
* states.analyzeResults.
* @method jibo.bt.Mim#analyzeMenuGlobal
* @private
*/
/**
* State entry for states.parseSpoof. Perform NLU parse on utterance text from GUI, followed * by going to states.reportResults.
* @method jibo.bt.Mim#parseSpoofedUtterance
* @private
*/
/**
* State entry for states.analyzeResults. Analyze results to determine if result of listen is
* 'noMatch', 'noInput', or 'match'. If result is 'match' or mim has run out of error prompts,
* go to states.reportResults. Otherwise, go to states.choosePrompt.
* @method jibo.bt.Mim#analyzeResults
* @private
*/
/**
* State entry for states.reportResults. If mim has failed due to noInput or noMatch errors,
* call onFailure to allow flow to handle exception. If exception not handled, go to
* states.handleException. If mim successful, call onSuccess and end Mim behavior.
* @method jibo.bt.Mim#reportResults
* @private
*/
/**
* State entry for states.handleException. Begins global mim exception flow for either 'noInput'
* or 'noMatch' failures.
* @method jibo.bt.Mim#handleException
* @private
*/
/**
* State update for states.handleException. Update exception flow. If flow is complete act upon
* flow result. If flow result is 'exit', exit skill and return to be/idle. If flow result is
* 'restart', go to states.choosePrompt.
* @method jibo.bt.Mim#updateException
* @private
*/
/**
* State interuption for states.handleException. Stop and clean up exception flow. Remove any
* flow created view.
* @method jibo.bt.Mim#stopException
* @private
*/
/**
* Display text that mim rules could not match. Provided to noMatch exception flow as a
* callback.
* @method jibo.bt.Mim#showInputText
* @param {string} notMatchedText Text from speech to text that NLU could not match.
* @private
*/
/**
* Remove text display created during noMatch exception flow.
* @method jibo.bt.Mim#hideInputText
* @private
*/
/**
* State entry for states.waitForHJEnd. Begins waiting for the Hey Jibo listen to end in a way
* that the MIM should recover from.
* @method jibo.bt.Mim#waitForHJEnd
* @private
*/
/**
* Standard method to tell the waitForHJEnd state to go back to prompt selection.
* @method jibo.bt.Mim#recoverFromHJ
* @private
*/
/**
* State interuption and exiting for states.waitForHJEnd. Removesevent listeners added in the
* state entry.
* @method jibo.bt.Mim#hjEnded
* @private
*/

View File

@@ -0,0 +1,7 @@
/**
* @class Null
* @extends jibo.bt.Behavior
* @memberof jibo.bt.behaviors
* @description `Null` has no behavior. It will remain in-progress until a decorator changes its state.
* @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options.
*/

View File

@@ -0,0 +1,10 @@
/**
* @class Parallel
* @extends jibo.bt.ParentBehavior
* @memberof jibo.bt.behaviors
* @description Runs its child nodes in parallel. Returns with `Status.FAILED` if one of the children failed
* and `Status.SUCCEEDED` if all children succeeded.
* @param {Object} options See {@link jibo.bt.Behavior} for all options.
* @param {boolean} options.succeedOnOne If the Parallel should succeed when the first child succeeds.
* @param {Array<jibo.bt.Behavior>} [options.children=[]] An array of the Parallel's child behaviors.
*/

View File

@@ -0,0 +1,15 @@
/**
* @class PlayAnimation
* @extends jibo.bt.Behavior
* @memberof jibo.bt.behaviors
* @description Plays the animation specified by `animPath`, `animName` or `animQuery`.
* Succeeds when the animation is finished playing. Playing an
* animation consists of two phases: the transition phase and the play phase. The transition phase will
* transition Jibo from his current position to the start position of the specified animation. The play
* phase plays the animation with the current configuration.
* @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options.
* @param {String} options.animPath The path to the `.keys` file. This behavior assumes `${project}/animations` is the root for
* all the animations.
* @param {Function} options.config Called and passed a {@link AnimationBuilder} object for configuration purposes. Do not call
* {@link AnimationBuilder#play}. This is done automatically by the behavior.
*/

View File

@@ -0,0 +1,10 @@
/**
* @class PlayAudio
* @extends jibo.bt.Behavior
* @memberof jibo.bt.behaviors
* @description Plays the audio specified by `audioPath`. Succeeds when the audio file is finished playing.
* @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options.
* @param {String} options.audioPath The path to any audo file format supported by HTML5 Audio. This behaviuor assumes `${project}/audio`
* is the root for all the audio files.
* @param {Boolean} options.cache=true `true` to cache the audio. `false` to play once and destroy.
*/

View File

@@ -0,0 +1,8 @@
/**
* @class Random
* @extends jibo.bt.ParentBehavior
* @memberof jibo.bt.behaviors
* @description On start, will choose a random node in its children and run that node.
* @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options.
* @param {Array<jibo.bt.Behavior>} [options.children=[]] An array of child behaviors.
*/

View File

@@ -0,0 +1,18 @@
/**
* Function that returns the options object.
* @callback jibo.bt.behaviors.ReadBarcode~onBarcode
* @param {string|null} error `null` if no error.
* @param {Object} data The result of the barcode if one is found.
* @param {number} data.type The type of barcode found. The types are 0 (EAN8), 1 (UPCE), 2 (ISBN10), 3 (UPCA), 4 (EAN13),
* 5 (ISBN13), 6 (Interleaved 2 of 5), 7 (Code 39), 8 (PDF417), 9 (QR-Code), 10 (Code 128).
* @param {String} data.content The payload of the detected barcode.
*/
/**
* @class ReadBarcode
* @extends jibo.bt.Behavior
* @memberof jibo.bt.behaviors
* @description Makes Jibo take a photo and search for a barcode or QR code in that image.
* @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options.
* @param {jibo.bt.behaviors.ReadBarcode~onBarcode} options.onBarcode Called after Jibo takes a picture. The results are passed to this function.
*/

View File

@@ -0,0 +1,9 @@
/**
* @class Sequence
* @extends jibo.bt.ParentBehavior
* @memberof jibo.bt.behaviors
* @description `Sequence` Runs its child nodes in sequence until one fails. Fails if one of the children fails
* and succeeds if all its children succeeded.
* @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options.
* @param {Array<jibo.bt.Behavior>} [options.children=[]] - An array of child behaviors.
*/

View File

@@ -0,0 +1,14 @@
/**
* @class Subtree
* @extends jibo.bt.Behavior
* @memberof jibo.bt.behaviors
* @description Encapsulates an external subtree file (`.bt` file) into a single behavior. This behavior fails if the
* `.bt` tree fails, and succeeds if that tree succeeds.
* @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options.
* @param {String} options.behaviorPath The path to the `.bt` file this behavior encapsulates. This assumes the root
* of all `.bt` files is in `${project}/behaviors`.
* @param {Function} options.getNotepad Returns an object that will become this referenced tree's notepad. Think of this as the
* arguments to this subtree.
* @param {Function} options.onResult Called when the external tree either fails or succeeds. A result object is passed as an argument.
* This result object is populated by the external tree. Think of this as the return value.
*/

View File

@@ -0,0 +1,14 @@
/**
* @class SubtreeJs
* @extends jibo.bt.Behavior
* @memberof jibo.bt.behaviors
* @description Encapsulates an external subtree file (`.bt` file) into a single behavior. This behavior fails if the
* `.bt` tree fails and succeeds if that tree succeeds.
* @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options.
* @param {Function} options.getFileName Returns the path to the `.bt` file this behavior encapsulates. This assumes the root
* of all `.bt` files is in `${project}/behaviors`.
* @param {Function} options.getNotepad Returns an object that will become this referenced tree's notepad. Think of this as the
* arguments to this subtree.
* @param {Function} options.onResult Called when the external tree either fails or succeeds. A result object is passed as an argument.
* This result object is populated by the external tree. Think of this as the return value.
*/

View File

@@ -0,0 +1,9 @@
/**
* @class Switch
* @extends jibo.bt.ParentBehavior
* @memberof jibo.bt.behaviors
* @description Runs its child nodes in sequence until one succeeds. Fails if all of the children failed
* and succeeds if one child succeeded.
* @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options.
* @param {Array<jibo.bt.Behavior>} [options.children=[]] - An array of the Switch's child behaviors.
*/

View File

@@ -0,0 +1,22 @@
/**
* Callback for when Jibo takes a photo.
* ```
* let behavior = TakePhoto(2, 2, (url) => {
* let img = new Image();
* img.src = url;
* });
* ```
* @callback jibo.bt.behaviors.TakePhoto~OnPhoto
* @param {String} url The image URL.
*/
/**
* @class TakePhoto
* @extends jibo.bt.Behavior
* @memberof jibo.bt.behaviors
* @description Makes Jibo take a photo and will return a URL to get the contents of that photo.
* @param {Object} options Options
* @param {number} options.resolution `1` for a 672x380 photo. `2` for 1280x720 photo. `3` for 1920x1080 photo. `4` for 2688x1520 photo.
* @param {jibo.bt.behaviors.TakePhoto~OnPhoto} options.onPhoto Called after Jibo takes a picture. The image URL is passed to this function.
* @param {boolean} [options.noDistortion=true] Removes camera distortion from photo.
*/

View File

@@ -0,0 +1,9 @@
/**
* @class TextToSpeech
* @extends jibo.bt.Behavior
* @memberof jibo.bt.behaviors
* @description Makes Jibo speak.
* @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options.
* @param {String} options.words The words for Jibo to speak.
* @param {Function} options.onWord Called each time a word is spoken. The word that is spoken is passed as an argument.
*/

View File

@@ -0,0 +1,9 @@
/**
* @class TextToSpeechJs
* @extends jibo.bt.Behavior
* @memberof jibo.bt.behaviors
* @description Makes Jibo speak.
* @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options.
* @param {Function} options.getWords Function that returns a string of the words for Jibo to speak.
* @param {Function} options.onWord Called each time a word is spoken. The word that is spoken is passed as an argument.
*/

View File

@@ -0,0 +1,14 @@
/**
* @callback jibo.bt.behaviors.TimeoutJs~GetTime
* @returns {number} Time in milliseconds until the behavior succeeds.
*/
/**
* @class TimeoutJs
* @extends jibo.bt.Behavior
* @memberof jibo.bt.behaviors
* @description
* Succeeds only after the specified amount of time.
* @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options.
* @param {jibo.bt.behaviors.TimeoutJs~GetTime} options.getTime - Time in milliseconds until `TimeoutJs` succeeds.
*/

View File

@@ -0,0 +1,4 @@
/**
* Behavior Tree behavior classes.
* @namespace jibo.bt.behaviors
*/

View File

@@ -0,0 +1,16 @@
/**
* @callback jibo.bt.decorators.Case~CaseConditional
* @returns {boolean} Return `true` to succeed the decorated behavior. `false` otherwise.
*/
/**
* @class Case
* @extends jibo.bt.Decorator
* @memberof jibo.bt.decorators
* @description
* Performs a single check before the behavior it's decorating starts. If that check fails, `Case` fails the
* behavior. Useful for decorating behaviors under a {@link jibo.bt.behaviors.Switch|Switch} behavior.
* @param {Object} options See {@link jibo.bt.Decorator|Decorator} for all options.
* @param {jibo.bt.decorators.Case~CaseConditional} options.conditional Function called every frame.
* Return `false` when you want component to fail.
*/

View File

@@ -0,0 +1,18 @@
/**
* @callback jibo.bt.decorators.FailOnCondition~FailOnConditionConditional
* @extends jibo.bt.Behavior
* @returns {boolean} `true` when you want component to Fail.
*/
/**
* @class FailOnCondition
* @extends jibo.bt.Decorator
* @memberof jibo.bt.decorators
* @description Explicitly interrupts the behavior it's decorating and returns Status.FAILED if the
* conditional evaluates to `true`.
* @param {Object} options See {@link jibo.bt.Decorator|Decorator} for all options.
* @param {Function} [options.init] Function called at the start of this behavior. Used to initialize any
* variables or data.
* @param {jibo.bt.decorators.FailOnCondition~FailOnConditionConditional} options.conditional Function called every frame. Return `true`
* when you want component to fail.
*/

View File

@@ -0,0 +1,15 @@
/**
* @callback jibo.bt.decorators.StartOnAnimEvent~StartOnEventOnReceived
* @argument {AnimationInstance} instance The animation instance the event was dispatched from.
* @argument {Object} payload A payload defined in the `.keys` file.
*/
/**
* @class StartOnAnimEvent
* @extends jibo.bt.Decorator
* @memberof jibo.bt.decorators
* @description
* `StartOnAnimEvent` will begin the execution of its behavior when an animation fires an event from its event layer.
* @param {String} options.eventName - Name of the event this behavior listens for.
* @param {jibo.bt.decorators.StartOnAnimEvent~StartOnEventOnReceived} options.onReceived - Callback for when `eventName` is dispatched.
*/

View File

@@ -0,0 +1,17 @@
/**
* @callback jibo.bt.decorators.StartOnCondition~StartOnConditionConditional
* @returns {Boolean} `true` when you want component to start.
*/
/**
* @class StartOnCondition
* @extends jibo.bt.Decorator
* @memberof jibo.bt.decorators
* @description
* Prevents the behavior it's decorating from starting until its conditional evaluates to
* true.
* @param {Object} options See {@link jibo.bt.Decorator|Decorator} for all options.
* @param {Function} [options.init] Function called at the start of this behavior. Used to initialize any
* variables or data.
* @argument {jibo.bt.decorators.StartOnCondition~StartOnConditionConditional} options.conditional - The conditional to evaluate.
*/

View File

@@ -0,0 +1,11 @@
/**
* @class StartOnEvent
* @extends jibo.bt.Decorator
* @memberof jibo.bt.decorators
* @description
* Prevents the behavior it's decorating from starting until an event is emitter from a behavior tree's
* global `emitter`.
* @param {Object} options See {@link jibo.bt.Decorator|Decorator} for all options.
* @param {String} options.eventName - The name of the event to listen for.
* @param {Function} options.onEvent - called when the event is fired. Any payload with the event is passed in.
*/

View File

@@ -0,0 +1,18 @@
/**
* @callback jibo.bt.decorators.SucceedOnCondition~SucceedOnConditionConditional
* @returns {Boolean} `true` to succeed the decorated behavior. `false` otherwise.
*/
/**
* @class SucceedOnCondition
* @extends jibo.bt.Decorator
* @memberof jibo.bt.decorators
* @description
* Explicitly interrupts the behavior it's decorating and returns Status.SUCCEEDED if the
* conditional evaluates to `true`.
* @param {Object} options See {@link jibo.bt.Decorator|Decorator} for all options.
* @param {Function} [options.init] Function called at the start of this behavior. Used to initialize any
* variables or data.
* @param {jibo.bt.decorators.SucceedOnCondition~SucceedOnConditionConditional} options.conditional Function called every frame. Return `true`
* to force behavior to succeed.
*/

View File

@@ -0,0 +1,44 @@
/**
* @class EmbeddedListenEmitter
* @description Passed to the {@link jibo.bt.decorators.SucceedOnEmbedded~OnResult} function of the {@link jibo.bt.decorators.SucceedOnEmbedded|SucceedOnEmbedded} behavior.
* @extends EventEmitter
* @memberof jibo.bt
*/
/**
* @typedef {Object} jibo.bt.decorators.SucceedOnEmbedded~Options
*/
/**
* Called when the {@link jibo.bt.EmbeddedListenEmitter|EmbeddedListenEmitter} is constructed.
* @callback jibo.bt.decorators.SucceedOnEmbedded~OnResult
* @param {jibo.bt.EmbeddedListenEmitter} listener Use this instance to listen for listen events.
*/
/**
* @class SucceedOnEmbedded
* @extends jibo.bt.Decorator
* @memberof jibo.bt.decorators
* @description Succeeds the behavior its decorating when the specified audio phrase is spotted.
* @param {Object} options See {@link jibo.bt.Decorator|Decorator} for all options.
* @param {jibo.bt.decorators.SucceedOnEmbedded.Rules} options.rule The embedded rule to listen for.
* @param {jibo.bt.decorators.SucceedOnEmbedded~OnResult} options.onResult Called and passed a {@link jibo.bt.EmbeddedListenEmitter|EmbeddedListenEmitter} object. Events are
* fired from the emitter at certain points in this behavior's lifecycle.
*/
/**
* Embedded listen rule types.
* @name jibo.bt.decorators.SucceedOnEmbedded.Rules
* @property {String} HEY_jibo Listen for "Hey, Jibo"
* @static
* @enum {String}
*/
/** Listen for "Hey Jibo" */
/**
* Fired when the phrase is spotted.
* @event jibo.bt.EmbeddedListenEmitter#hey-jibo
* @param {Object} result Reference to the behavior's result.
* @param {Array} speakers Text independent speaker ID results.
*/

View File

@@ -0,0 +1,11 @@
/**
* @class SucceedOnEvent
* @extends jibo.bt.Decorator
* @memberof jibo.bt.decorators
* @description
* Succeeds the behavior it's decorating when an event is emitter from a behavior tree's
* global `emitter`.
* @param {Object} options See {@link jibo.bt.Decorator|Decorator} for all options.
* @param {String} options.eventName - The name of the event to listen for.
* @param {Function} options.onEvent - Called when the event is fired. Any payload with the event is passed in.
*/

View File

@@ -0,0 +1,31 @@
/**
* @typedef {Object} jibo.bt.decorators.SucceedOnListen~Options
* @property {boolean} heyJibo Listen for "Hey, Jibo" first.
* @property {boolean} detectEnd Listen for end of speech.
* @property {boolean} incremental Return incremental ASR results as they are streamed from the cloud.
* @property {String} authenticateSpeaker Authenticates against that person.
*/
/**
* Function that returns the options object.
* @callback jibo.bt.decorators.SucceedOnListen~GetOptions
* @returns {jibo.bt.decorators.SucceedOnListen~Options}
*/
/**
* Called when the {@link jibo.bt.behaviors.ListenEmitter|ListenEmitter} is constructed.
* @callback jibo.bt.decorators.SucceedOnListen~OnResult
* @param {jibo.bt.ListenEmitter} listener Use this instance to listen for listen events.
*/
/**
* @class SucceedOnListen
* @extends jibo.bt.Decorator
* @memberof jibo.bt.decorators
* @description Performs audio speech recognition and applies and parses the results according to a rules file.
* @param {Object} options See {@link jibo.bt.Decorator|Decorator} for all options.
* @param {jibo.bt.decorators.SucceedOnListen~GetOptions} options.getOptions Returns the options object.
* @param {String} options.rule Path the to `.rule` file. This assumes the path starts at `${project}/rules`.
* @param {jibo.bt.decorators.SucceedOnListen~OnResult} options.onResult Called and passed a {@link jibo.bt.behaviors.ListenEmitter|ListenEmitter} object. Events are fired from the Listener
* at certain points in this behavior's lifecycle.
*/

View File

@@ -0,0 +1,47 @@
/**
* @class ListenEmitter
* @description Used to listen for cloud events.
* @extends EventEmitter
* @memberof jibo.bt
*/
/**
* @typedef {Object} jibo.bt.decorators.SucceedOnListenJs~Options
* @property {boolean} heyJibo Listen for "Hey, Jibo" first.
* @property {boolean} detectEnd Listen for end of speech.
* @property {boolean} incremental Return incremental ASR results as they are streamed from the cloud.
* @property {String} authenticateSpeaker Authenticates against that person.
*/
/**
* Function that returns the options object.
* @callback jibo.bt.decorators.SucceedOnListenJs~GetOptions
* @returns {jibo.bt.decorators.SucceedOnListenJs~Options}
*/
/**
* Called when the {@link jibo.bt.behaviors.ListenEmitter|ListenEmitter} is constructed.
* @callback jibo.bt.decorators.SucceedOnListenJs~OnResult
* @param {jibo.bt.ListenEmitter} listener Use this instance to listen for listen events.
*/
/**
* @class SucceedOnListenJs
* @extends jibo.bt.Decorator
* @memberof jibo.bt.decorators
* @description Performs audio speech recognition and applies and parses the results according to a rules file.
* @param {Object} options See {@link jibo.bt.Decorator|Decorator} for all options.
* @param {jibo.bt.decorators.SucceedOnListenJs~GetOptions} options.getOptions Returns the options object.
* @param {Function} options.getRule This function returns a string representation of a rule. Use this decorator to dynamically generate rules files instead
* of loading a rule file from disk.
* @param {jibo.bt.decorators.SucceedOnListenJs~OnResult} options.onResult Called and passed a {@link jibo.bt.behaviors.ListenEmitter|ListenEmitter} object. Events are fired from the Listener
* at certain points in this behavior's lifecycle.
*/
/**
* Definition of the reusable dialog listen behavior class
*/
/**
* Only gets called when stopped from Behavior tree
*/

View File

@@ -0,0 +1,8 @@
/**
* @class TimeoutFail
* @extends jibo.bt.Decorator
* @memberof jibo.bt.decorators
* @description Forces the behavior it's decorating to fail after the specified amount of time.
* @param {Object} options See {@link jibo.bt.Decorator|Decorator} for all options.
* @param {number} options.timeout - Time in milliseconds until `TimeoutFail` forces the behavior it's decorarting to fail.
*/

View File

@@ -0,0 +1,9 @@
/**
* @class TimeoutSucceed
* @extends jibo.bt.Decorator
* @memberof jibo.bt.decorators
* @description
* Forces the behavior it's decorating to succeed after the specified amount of time.
* @param {Object} options See {@link jibo.bt.Decorator|Decorator} for all options.
* @param {number} options.timeout - Time in milliseconds until `TimeoutSucceed` forces the behavior it's decorating to succeed.
*/

View File

@@ -0,0 +1,14 @@
/**
* @callback jibo.bt.decorators.TimeoutSucceedJs~GetTime
* @returns {number} Time in milliseconds.
*/
/**
* @class TimeoutSucceedJs
* @extends jibo.bt.Decorator
* @memberof jibo.bt.decorators
* @description
* `TimeoutSucceedJs` forces the behavior it's decorating to succeed after the specified amount of time.
* @param {Object} options See {@link jibo.bt.Decorator|Decorator} for all options.
* @param {jibo.bt.decorators.TimeoutSucceedJs~GetTime} options.getTime - Time in milliseconds until `TimeoutJs` forces the behavior it's decorating to succeed.
*/

View File

@@ -0,0 +1,17 @@
/**
* @callback jibo.bt.decorators.WhileCondition~Conditional
* @returns {boolean} `true` when you want component to restart.
*/
/**
* @class WhileCondition
* @extends jibo.bt.Decorator
* @memberof jibo.bt.decorators
* @description When `WhileCondition`'s component succeeds, `WhileCondition`
* will evaluate its conditional. If it evaluates to `true`, `WhileCondition` will
* start its component again. If the conditional evaluates to `false`, `WhileCondition`
* returns the status of its component.
* @param {Object} options See {@link jibo.bt.Decorator|Decorator} for all options.
* @param {Function} [options.init] - Initialization function.
* @param {jibo.bt.decorators.WhileCondition~Conditional} options.conditional - The conditional to evaluate.
*/

View File

@@ -0,0 +1,4 @@
/**
* Behavior Tree decorator classes.
* @namespace jibo.bt.decorators
*/

View File

@@ -0,0 +1,16 @@
/**
* @interface jibo.bt.behaviors.Mim~AsrMetadata
* @private
* @description Type of metadata supplied to ASR about MIM listens. Not exposed outside the library.
* @prop {String} interactionId - UUID for that instance of a MIM.
* @prop {String} mimId - ID for the MIM file being used.
* @prop {String} mimType - The type of MIM.
* @prop {String} skill - The name of the skill in use.
* @prop {String} mimState - The state of the MIM.
* @prop {Number} noMatches - The number of no match errors that the MIM has had.
* @prop {Number} noInput - The number of no input errors that the MIM has had.
* @prop {String} lastPromptId - The ID of the last MIM prompt to play.
* @prop {String} [activityName] - Flow only: The name of the MIM activity in the flow.
* @prop {String} [activityId] - Flow only: The uuid of the MIM activity in the flow.
* @prop {String} [flowFile] - Flow only: The flow file that the MIM activity is in.
*/

View File

@@ -0,0 +1,70 @@
/**
* MIM configuration data generated from the .mim files.
* @class MimConfig
* @memberof jibo.mim
* @private
*/
/**
* Promised loading of a single .mim file.
* @method jibo.mim.MimConfig~load
* @param {string} filePath Path to the .mim file.
* @returns {Promise<MimConfig>} Promise to load a new MimConfig instance.
* @static
*/
/**
* If the Mim has a gui available, either as sampleUtterances or guiConfig.
* @name jibo.mim.MimConfig~hasGui
* @type {Boolean}
* @readOnly
*/
/**
* Find a prompt by id and get the original prompt text for it.
* @method jibo.mim.MimConfig#getOriginalPromptText
* @param {string} id Prompt id to get the text for.
* @return {String} The original prompt text string.
*/
/**
* Pick a prompt and get the text for it.
* @method jibo.mim.MimConfig~getPromptText
* @param {jibo.mim.MimState} mimState State of the active MIM.
* @param {any} promptData Dictionary of variables to use for condition evaluation and text replacement.
* @param {jibo.kb.Node} [rotationNode] Node used to store data
* @return {Object} An object with 'text', 'id', and 'autoRuleOverride' properties.
*/
/**
* Generate a view config object for the MIM GUI, using the javascript code from the .mim file.
* @method jibo.mim.MimConfig~getJavascriptGUI
* @param {any} promptData Prompt data for the MIM
* @return {any} The generated view config object
*/
/**
* See if MimConfig has error prompts of the corresponding type and index.
* @method jibo.mim.MimConfig~hasErrorPrompt
* @param {String} error The error type
* @param {Number} index The prompt index
* @return {Boolean}
*/
/**
* See if MimConfig has at least one verbose prompt.
* @method jibo.mim.MimConfig~hasVerbosePrompt
* @return {Boolean}
*/
/**
* See if MimConfig has at least one truncated prompt.
* @method jibo.mim.MimConfig~hasTruncatedPrompt
* @return {Boolean}
*/
/**
* See if MimConfig has at least one thanks prompt.
* @method jibo.mim.MimConfig~hasThanksPrompt
* @return {Boolean}
*/

View File

@@ -0,0 +1,149 @@
/**
* Singleton for hooking into the MIM system.
* @namespace jibo.mim
*/
/**
* The default listen delegate class, for extending to make more advanced delegates.
* @name jibo.mim~GlobalListenDelegate
* @type {jibo.mim.GlobalListener}
* @private
*/
/**
* In the currently active MIM, respond to a 'hey jibo' happening. MIMs could listen to
* GlobalListen directly, but getting events through here allows us to limit the event to
* the currently active MIM, in case a MIM is running another MIM.
* @name jibo.mim#heyJibo
* @type {Event}
* @private
*/
/**
* In the currently active MIM, respond to the completion of a HJ event in which the MIM should
* continue. This includes HJ Only, HJ No Match, and Non Interrupting Global events.
* @name jibo.mim#heyJiboComplete
* @type {Event}
* @private
*/
/**
* If a Hey Jibo event currently active. Used by MIMs to determine when they started during an
* active HJ event.
* @name jibo.mim#isHeyJiboActive
* @type {boolean}
* @private
*/
/**
* If `true`, Question MIMs time out after the specfied `timeout` when run in the simulator.
* If `false` (default), time out when `enter` key is pressed.
* @name jibo.mim~timeoutIgnoresSimulator
* @type {Boolean}
*/
/**
* MimRepeatManager instance with loaded MIM data.
* @name jibo.mim~repeat
* @type {jibo.mim.MimRepeatManager}
* @private
*/
/**
* Promise to load MIM data used by all MIMs as global prompts.
* @name jibo.mim~globalMimLoad
* @type {Promise<void>}
* @private
*/
/**
* MIM data used by potentially all MIMs as response to the 'thanks' MIM global.
* @name jibo.mim~thanksResponse
* @type {jibo.mim.MimConfig}
* @private
*/
/**
* Listen delegate to be used by all MIMs to handle listening.
* @name jibo.mim~listenDelegate
* @type {ListenDelegate}
* @private
*/
/**
* Speaking delegate to be used by all MIMs to handle speech.
* @name jibo.mim~speakDelegate
* @type {SpeakDelegate}
* @private
*/
/**
* Root node of the KB model used to store prompt rotation info for MIMs within the `jibo`
* module.
* @name jibo.mim~jiboRotationNode
* @type {jibo.kb.Node}
* @private
*/
/**
* KB Models for each skill. These are kept in memory, because it isn't that much memory, and
* gives us slightly faster access when we use multiple MIMs from one skill. Also, right now
* everything lives in one process that never shuts down, and it won't matter when we have
* each skill in a separate process.
* @name jibo.mim~kbModels
* @type {Object.<string, jibo.kb.Model>}
* @private
*/
/**
* Loads the root node of a KB slice specific to an asset pack, so that data about prompt
* rotation can be persisted.
* @method jibo.mim~loadMimKB
* @param {string} assetPack The name of the skill/asset pack that the MIM is loaded from.
* @return {Promise<jibo.kb.Node>} The root node for that asset pack.
* @private
*/
/**
* Start loading any assets the Mims need. Called on creation of the first Mim. Mim does not
* wait for asset load to complete before continuing.
* @method jibo.mim~loadMimAssets
* @private
*/
/**
* Attach listeners for HJ and HJ ending events
* @method jibo.mim~attachHJListeners
* @private
*/
/**
* Callback for Hey Jibo events from the listening service.
* @method jibo.mim~onHeyJiboHeard
* @private
*/
/**
* Listener for Hey Jibo Only events, for recovering from the MIM's waitForHJEnd state.
* @method jibo.mim#onHJOnly
* @private
*/
/**
* Listener for Hey Jibo No Match events, for recovering from the MIM's waitForHJEnd state.
* @method jibo.mim#onHJNoMatch
* @private
*/
/**
* Listener for Non Interrupting Global events, for recovering from the MIM's waitForHJEnd state.
* @method jibo.mim#onShortGlobal
* @private
*/
/**
* Listener for the end of HJ listens that don't allow a MIM to continue - skill relaunches,
* interrupting globals, etc.
* @method jibo.mim#onHJEnd
* @private
*/

View File

@@ -0,0 +1,12 @@
/**
* Individual prompt within a MIM. Generated by MimConfig from the .mim file.
* @class MimPrompt
* @memberof jibo.mim
* @private
*/
/**
* Get prompt data. Returns the prompt property.
* @method jibo.mim.MimPrompt~getPromptText
* @returns {String} The prompt
*/

View File

@@ -0,0 +1,46 @@
/**
* Define how an individual repeat request should be handled.
* @class MimRepeat
* @memberof jibo.mim
* @private
*/
/**
* Prepend prompt to whatever Jibo repeats. Play alone if it's the last repeat allowed.
* @name jibo.mim.MimRepeat#result
* @type {String}
* @readOnly
*/
/**
* Take specified action after prompt is played. If 'cached', use exact prompt played when Mim
* was entered. If 'verbose', play verbose prompt or fall back to cached prompt. If 'exit', do
* not play a prompt & quit skill.
* @name jibo.mim.MimRepeat#result
* @type {String}
* @readOnly
*/
/**
* Manage how Mim repeat requests are handled.
* Instantiate this class to start loading the Announcement Mims to use when Jibo is asked to repeat
* himself.
* @class MimRepeatManager
* @memberof jibo.mim
* @private
*/
/**
* Maximum number of repeats allowed before before skill should exit.
* @name jibo.mim.MimRepeatManager#maxRepeat
* @type {Number}
* @readOnly
*/
/**
* Starts loading the default list SFX, for use by lists and Mim GUIs.
* @method jibo.mim.MimRepeatManager~getRepeat
* @param {String} mimType The type of the current Mim (question, announcement, optional-response).
* @param {Number} repeatCount The number of times that the user has requested a repeat (starting at 1 for the first time).
* @returns {jibo.mim.MimRepeat} Information on how to handle the repeat request.
*/

View File

@@ -0,0 +1,104 @@
/**
* Enum of the different states that a MIM could be in. This controls what prompt is played.
* @typedef jibo.mim~States
* @prop ENTRY {string} 'entry'
* @prop MATCH {string} 'match'
* @prop NO_MATCH {string} 'noMatch'
* @prop NO_INPUT {string} 'noInput'
* @prop REPEAT {string} 'repeat'
* @prop THANKS {string} 'thanks'
* @prop HOLD_RETURN {string} 'holdReturn'
* @prop VERBOSE {string} 'verbose'
* @prop TRUNCATED {string} 'truncated'
* @prop MENU_CLOSED {string} 'MenuClosed' - Only used as an exit state, when the MIM GUI is closed.
*/
/**
* Keep track of the state of the active MIM. Returned by MIM callbacks.
* @class MimState
* @memberof jibo.mim
*/
/**
* Number of no-input errors that have happened.
* @name jibo.mim.MimState~noInputCount
* @type {Number}
*/
/**
* Number of no-match errors that have happened.
* @name jibo.mim.MimState~noMatchCount
* @type {Number}
*/
/**
* Type of the MIM result.
* @name jibo.mim.MimState~lastResultState
* @type {jibo.mim~States}
*/
/**
* `true` if the MIM has succeeded.
* @name jibo.mim.MimState~success
* @type {Boolean}
*/
/**
* `true` if the MIM has failed (too many no inputs or no matches).
* @name jibo.mim.MimState~failure
* @type {Boolean}
*/
/**
* The last used prompt text.
* @name jibo.mim.MimState~promptText
* @type {String}
* @private
*/
/**
* The auto rule override settings of the last used prompt.
* @name jibo.mim.MimState~promptAutoRules
* @type {String}
* @private
*/
/**
* Reset the MimState so that a mim can be restarted.
* @method jibo.mim.MimState~reset
* @private
*/
/**
* If the MIM is complete, due to success or failure.
* @name jibo.mim.MimState~done
* @type {Boolean}
*/
/**
* Total number of (no input, no match) errors that has happened during this MIM.
* @name jibo.mim.MimState~errors
* @type {Number}
*/
/**
* Increase the number of misses due to no-input errors that this MIM has had.
* Also inform the MimManager that an error happened.
* @method jibo.mim.MimState~incrementNoInputCount
* @private
*/
/**
* Increase the number of misses due to no-match errors that this MIM has had.
* Also inform the MimManager that an error happened.
* @method jibo.mim.MimState~incrementNoMatchCount
* @private
*/
/**
* Compare the MIM state to the config file to see if a GUI should be shown.
* @method jibo.mim.MimState~shouldShowGUI
* @param {jibo.mim.MimConfig} config The config for the active MIM.
* @return {Boolean} `true` if the MIM's GUI should be shown.
* @private
*/

View File

@@ -0,0 +1,29 @@
/**
* Items for weighted rotation require an id and a weight.
* @private
*/
/**
* Because we need to modify weights, these will be created for each weighted item during
* selection. Not exposed outside WeightedRotation.ts
* @private
*/
/**
* Selects an item from a list, using weighting and enforced rotation.
* @param {WeightedItem[]} itemList The list of items to choose from.
* @param {Function} validCheck Function to see if an individual item is valid.
* @param {Object} [usedDict] Dictionary of used items, passed in by reference. If null, enforced
* rotation is not used.
* @private
*/
/**
* Selects an item from a list, using weighting and enforced rotation (if usedDict is passed in).
* Is not exposed otuside of WeightedRotation.ts
* @param {WeightedItem[]} items The list of items to choose from.
* @param {WeightedItem[]} usedItems List of already used items, to add to if needed
* @param {Object} [usedDict] Dictionary of used items, passed in by reference. If null, enforced
* rotation is not used.
* @private
*/

View File

@@ -0,0 +1,13 @@
/**
* An interface for analytics objects for MIM usage.
* @memberof jibo.mim.analytics
* @private
*/
/**
* A default analytics object that does nothing. This is to be replaced by Be, which knows about
* the correct way to handle the analytics events.
* @class EmptyAnalytics
* @memberof jibo.mim.analytics
* @private
*/

View File

@@ -0,0 +1,54 @@
/**
* Interface describing data that is attached to each MIM analytics event.
* @private
*/
/**
* Enum for different ways that MIMs can exit
* @private
*/
/**
* Enum for states in which the MIM could be interrupted (that we care about)
* @private
*/
/**
* Enum for different methods of input for MIMs
* @private
*/
/**
* Value for properties where they are not relevant or there is no data available.
* @private
*/
/**
* Sends analytics event for the end of a MIM
* @private
*/
/**
* Sends analytics event for the beginning of a MIM
* @private
*/
/**
* Sends analytics event for a user response that does not end the MIM (like thanks/repeat)
* @private
*/
/**
* Sends analytics event for a user response that wouldn't end the MIM, but it isn't being handled for some reason
* @private
*/
/**
* Sends analytics event for a No Match error
* @private
*/
/**
* Sends analytics event for a No Input error
* @private
*/

View File

@@ -0,0 +1,18 @@
/**
* Delegate for speaking using the standard TTS system.
* @class BasicSpeakDelegate
* @memberof jibo.mim
* @private
*/
/**
* Speak text, passing the options directly to the TTS system.
* @method jibo.mim.BasicSpeakDelegate#stop
* @param {any} options Speech options, including text.
* @return {Promise}
*/
/**
* Stop the TTS.
* @method jibo.mim.BasicSpeakDelegate#stop
*/

View File

@@ -0,0 +1,43 @@
/**
* Delegate for MimManager to use global listening for all listening.
* @class GlobalListener
* @memberof jibo.mim
* @private
*/
/**
* Sets the ambient listen mode.
* @method jibo.mim.GlobalListener#setAmbientMode
* @param {string} mode Option from {jibo.embodied.listen#AmbientListenMode} to set the mode to.
* @static
*/
/**
* Sets the active listen mode.
* @method jibo.mim.GlobalListener#enterActiveMode
* @param {string} mode Option from {jibo.embodied.listen#ActiveListenMode} to set the active mode to.
* @param {jibo.embodied.listen.ActiveModeOptions} [options] - Configuration Options consumed by the different Active Modes
* @returns {Promise<jibo.embodied.listen#RequestStatus>} Resolves once Embodied Listen is in
* requested Active Mode or interrupted by another Active Mode request.
* @static
*/
/**
* Sets the active listen mode.
* @method jibo.mim.GlobalListener#exitActiveMode
* @returns {Promise<void>} Resolves when Embodied Listen returns to Idle
* @static
*/
/**
* Create a GlobalListener instance to use.
* @method jibo.mim.GlobalListener#create
* @param {jibo.jetstream.types.LocalTurnOptions} options The listening options.
* @returns {GlobalListener} The GlobalListener instance.
* @static
*/
/**
* Stop listening.
* @method jibo.mim.GlobalListener#stop
*/

573
Skills/@be/node_modules/jibo/lib/docs/deprecation.js generated vendored Normal file
View File

@@ -0,0 +1,573 @@
/**
* @class
* @name SerialTimer
* @memberof jibo.utils
* @see jibo.utils.perf.SerialTimer
* @deprecated since version 2.1.0
* @private
*/
/**
* @class
* @name ParallelTimer
* @memberof jibo.utils
* @see jibo.utils.perf.ParallelTimer
* @deprecated since version 2.1.0
* @private
*/
/**
* @name jibo.bodySettings
* @deprecated since 1.1.0
* @see jibo.settings
*/
/**
* @name jibo.body
* @deprecated since 4.2.6
* @see jibo.settings
*/
/**
* @name jibo.audio
* @deprecated since 4.2.6
* @see jibo.settings
*/
/**
* Gets the base directory and the name of the project.
* @method jibo.utils.PathUtils~getBaseDirectory
* @deprecated since 3.1.0
* @see jibo.utils.PathUtils#findRoot
*/
/**
* Gets the project root running jibo.
* @method jibo.utils.PathUtils~getProjectRoot
* @deprecated since 3.1.0
* @see jibo.utils.PathUtils#findRoot
*/
/** Load a list of nodes by id. All KBs in this Model will be
* searched, in order, for each id in the array. An empty array is
* returned (via callback) if none of the ids are found. If
* callback is omitted a promise is returned instead.
*
* @method jibo.kb.Model#loadList
* @memberof jibo.kb
* @see jibo.kb.Model#load
* @deprecated since version 6.0.0
*/
/** Fetch a list of nodes by id from cache synchronously. Use on
* models created with `begin()` and preloaded with nodes.
*
* @method jibo.kb.Model#fetchList
* @memberof jibo.kb
* @see jibo.kb.Model#fetch
* @deprecated since version 6.0.0
*/
/**
* @name jibo.bt.factory
* @deprecated since 1.1.0
* @see jibo.bt
*/
/**
* Current status of the behavior tree.
* @type {String}
* @name jibo.bt.BehaviorTree~status
* @deprecated since 4.0.0
* @see jibo.bt.BehaviorTree#currentStatus
*/
/**
* Same constant as `ViewManager.TRANS_UP`, made accessible via `jibo.face.views` for convenience
* @method jibo.rendering.gui.ViewManager#UP
* @deprecated since 7.8.4
* @see jibo.face.views.TRANSITION.UP
*/
/**
* Same constant as `ViewManager.TRANS_DOWN`, made accessible via `jibo.face.views` for convenience
* @method jibo.rendering.gui.ViewManager#DOWN
* @deprecated since 7.8.4
* @see jibo.face.views.TRANSITION.DOWN
*/
/**
* Same constant as `ViewManager.TRANS_RIGHT`, made accessible via `jibo.face.views` for convenience
* @method jibo.rendering.gui.ViewManager#RIGHT
* @deprecated since 7.8.4
* @see jibo.face.views.TRANSITION.RIGHT
*/
/**
* Same constant as `ViewManager.TRANS_LEFT`, made accessible via `jibo.face.views` for convenience
* @method jibo.rendering.gui.ViewManager#LEFT
* @deprecated since 7.8.4
* @see jibo.face.views.TRANSITION.LEFT
*/
/**
* Same constant as `ViewManager.TRANS_IN`, made accessible via `jibo.face.views` for convenience
* @method jibo.rendering.gui.ViewManager#IN
* @deprecated since 7.8.4
* @see jibo.face.views.TRANSITION.IN
*/
/**
* Same constant as `ViewManager.TRANS_OUT`, made accessible via `jibo.face.views` for convenience
* @method jibo.rendering.gui.ViewManager#OUT
* @deprecated since 7.8.4
* @see jibo.face.views.TRANSITION.OUT
*/
/**
* Same constant as `ViewManager.TRANS_NONE`, made accessible via `jibo.face.views` for convenience
* @method jibo.rendering.gui.ViewManager#NONE
* @deprecated since 7.8.4
* @see jibo.face.views.TRANSITION.NONE
*/
/**
* Transition type for view components to move upwards.
* @method jibo.rendering.gui.ViewManager~TRANS_UP
* @deprecated since 7.8.4
* @see jibo.face.views.TRANSITION.UP
*/
/**
* Transition type for view components to move downwards.
* @method jibo.rendering.gui.ViewManager~TRANS_DOWN
* @deprecated since 7.8.4
* @see jibo.face.views.TRANSITION.DOWN
*/
/**
* Transition type for view to move right.
* @method jibo.rendering.gui.ViewManager~TRANS_RIGHT
* @deprecated since 7.8.4
* @see jibo.face.views.TRANSITION.RIGHT
*/
/**
* Transition type for view to move left.
* @method jibo.rendering.gui.ViewManager~TRANS_LEFT
* @deprecated since 7.8.4
* @see jibo.face.views.TRANSITION.LEFT
*/
/**
* Transition type for view to fade and scale in from center of screen.
* @method jibo.rendering.gui.ViewManager~TRANS_IN
* @deprecated since 7.8.4
* @see jibo.face.views.TRANSITION.IN
*/
/**
* Transition type for view to or from eye.
* Use in conjunction with custom View transitions.
* @method jibo.rendering.gui.ViewManager~TRANS_EYE
* @deprecated since 7.8.4
* @see jibo.face.views.TRANSITION.EYE
*/
/**
* Transition type for view to fade and scale out from center of screens.
* @method jibo.rendering.gui.ViewManager~TRANS_OUT
* @deprecated since 7.8.4
* @see jibo.face.views.TRANSITION.OUT
*/
/**
* Transition type for no transition.
* @method jibo.rendering.gui.ViewManager~TRANS_NONE
* @deprecated since 7.8.4
* @see jibo.face.views.TRANSITION.NONE
*/
/**
* Transition type for no transition.
* @method jibo.rendering.gui.ViewManager~NONE
* @deprecated since 4.1.0
* @see jibo.face.views#NONE
*/
/**
* View status triggered once view's init method has been called.
* The same constant is statically accessible via `STATE.INITIALIZED`.
* @name jibo.face.views#INITIALIZED
* @deprecated since 8.1.0
* @see jibo.face.views.STATE.INITIALIZED
*/
/**
* View status triggered once initial data has been loaded and configurations set.
* The same constant is statically accessible via `STATE.DATA_LOADED`.
* @name jibo.face.views#DATA_LOADED
* @deprecated since 8.1.0
* @see jibo.face.views.STATE.DATA_LOADED
*/
/**
* View status triggered once initial assets have been loaded.
* The same constant is statically accessible via `STATE.ASSETS_LOADED`.
* @name jibo.face.views#ASSETS_LOADED
* @deprecated since 8.1.0
* @see jibo.face.views.STATE.ASSETS_LOADED
*/
/**
* View status triggered once loading is complete, at point of dispatch View should be ready for use.
* The same constant is statically accessible via `STATE.LOADED`.
* @name jibo.face.views#LOADED
* @deprecated since 8.1.0
* @see jibo.face.views.STATE.LOADED
*/
/**
* View status triggered once View has completed its opening transition.
* The same constant is statically accessible via `STATE.OPENED`.
* @name jibo.face.views#OPENED
* @deprecated since 8.1.0
* @see jibo.face.views.STATE.OPENED
*/
/**
* View status triggered once View has completed its closing transition.
* The same constant is statically accessible via `STATE.CLOSED`.
* @name jibo.face.views#CLOSED
* @deprecated since 8.1.0
* @see jibo.face.views.STATE.CLOSED
*/
/**
* Category for views that contain an interactive user interface.
* The same constant is statically accessible via `CATEGORY.GUI`.
* @name jibo.face.views#CATEGORY_GUI
* @deprecated since 8.1.0
* @see jibo.face.views.CATEGORY.GUI
*/
/**
* Category for views that are primarily used for display and not for interaction.
* The same constant is statically accessible via `CATEGORY.DISPLAY`.
* @name jibo.face.views#CATEGORY_DISPLAY
* @deprecated since 8.1.0
* @see jibo.face.views.CATEGORY.DISPLAY
*/
/**
* Category for EyeView type views.
* The same constant is statically accessible via `CATEGORY.EYE`.
* @name jibo.face.views#CATEGORY_EYE
* @deprecated since 8.1.0
* @see jibo.face.views.CATEGORY.EYE
*/
/**
* Tap gesture type.
* The same constant is statically accessible via `GESTURE.TAP`.
* @name jibo.face.views.TAP
* @deprecated since 8.1.0
* @see jibo.face.views.GESTURE.TAP
*/
/**
* Swipe down gesture type.
* Swipes currently only works for Views.
* The same constant is statically accessible via `GESTURE.SWIPE_DOWN`.
* @name jibo.face.views.SWIPE
* @deprecated since 8.1.0
* @see jibo.face.views.GESTURE.SWIPE_DOWN
*/
/**
* Option for setting custom transitions.
* Use with `View.setTransitions` to define custom transitions for adding a View to the view stack.
* @type {number}
* @name jibo.face.views.STACK_ADD
* @deprecated since 8.1.0
* @see jibo.face.views~STACK_DIRECTION
*/
/**
* Option for setting custom transitions.
* Use with `View.addTransition` to define custom transitions for removing a View from the view stack
* @type {number}
* @name jibo.face.views.STACK_REMOVE
* @deprecated since 8.1.0
* @see jibo.face.views~STACK_DIRECTION
*/
/**
* Option for setting custom transitions.
* Use with `View.addTransition` to define custom transitions where views are swapped,
* this would be when the currentvIew is removed and a new one is added so that the view stack length remians unchanged.
* @type {number}
* @name jibo.face.views.STACK_SWAP
* @deprecated since 8.1.0
* @see jibo.face.views~STACK_DIRECTION
*/
/**
* Close all currently active views and open the 'root' view (EyeView).
* @method jibo.face.views#closeAll
* @deprecated 4.1.0
* @see jibo.face.views#removeAll
*/
/**
* Close all currently active views up to the root, then add View.
* @method jibo.face.views#closeAllThenAdd
* @deprecated since 4.1.0
* @see jibo.face.views#removeAllThenAdd
*/
/**
* Close all currently active views up to the root view but do not open the root view, instead leave an empty screen.
* @method jibo.face.views#closeAllLeaveEmpty
* @deprecated since 4.1.0
* @see jibo.face.views#removeAllLeaveEmpty
*/
/**
* Remove the currently displayed View, but do not open the view beneath so that the display is left empty.
* Use when you don't know what the next view will be (i.e. switching skills).
* If current view paused the previous view, proceed as if removeView has been called
* @method jibo.face.views#removeViewLeaveEmpty
* @deprecated since 5.0.0
* @see jibo.face.views#changeView
*/
/**
* Close all currently active views up to the root, then add {@link jibo.face.views.View}.
* The newly added view will be one above the root once opened.ed
* @method jibo.face.views#removeAllThenAdd
* @deprecated since 5.0.0
* @see jibo.face.views#changeView
*/
/**
* Close all currently active views up to root view. Do not open root; leave screen empty.
* Use when next view is unknown, i.e.switching between skills.
* @method jibo.face.views#removeAllLeaveEmpty
* @deprecated since 5.0.0
* @see jibo.face.views#changeView
*/
/**
* Close all currently active views and open the 'root' view ({@link jibo.face.views.EyeView}).
* @method jibo.face.views#removeAll
* @deprecated since 5.0.0
* @see jibo.face.views#changeView
*/
/**
* Tap gesture type.
* @name jibo.face.views.TouchManager.TAP
* @deprecated since 8.1.0
* @see jibo.face.views.GESTURE.TAP
*/
/**
* Swipe down gesture type.
* @name jibo.face.views.TouchManager.SWIPE
* @deprecated since 8.1.0
* @see jibo.face.views.GESTURE.SWIPE_DOWN
*/
/**
* Pan horizontal gesture type.
* @name jibo.face.views.TouchManager.PAN
* @deprecated since 8.1.0
* @see jibo.face.views.GESTURE.PAN
*/
/**
* Setup View to trigger its actions list when the hitArea ia clicked.
* @method jibo.face.views#setupScreenClick
* @deprecated since 5.5.2
* @see jibo.face.views.View#setupScreenClick
*/
/**
* Intialize the data.
* @method jibo.face.views.View~INITIALIZED
* @deprecated since 8.1.0
* @see jibo.face.views~STATE.INITIALIZED
*/
/**
* State set and emitted once initial data has been loaded and configurations set.
* @method jibo.face.views.View~DATA_LOADED
* @deprecated since 8.1.0
* @see jibo.face.views~STATE.DATA_LOADED
*/
/**
* State set and emitted once initial assets have been loaded.
* @method jibo.face.views.View~ASSETS_LOADED
* @deprecated since 8.1.0
* @see jibo.face.views~STATE.ASSETS_LOADED
*/
/**
* State set and emitted once loading is complete, at point of dispatch View should be ready for use.
* @method jibo.face.views.View~LOADED
* @deprecated since 8.1.0
* @see jibo.face.views~STATE.LOADED
*/
/**
* State set and emitted once View has completed its opening transition.
* @method jibo.face.views.View~OPENED
* @deprecated since 8.1.0
* @see jibo.face.views~STATE.OPENED
*/
/**
* State set and emitted once View has completed its closing transition.
* @method jibo.face.views.View~CLOSED
* @deprecated since 8.1.0
* @see jibo.face.views~STATE.CLOSED
*/
/**
* State set and emitted View has been destroyed.
* @method jibo.face.views.View~DESTROYED
* @deprecated since 8.1.0
* @see jibo.face.views~STATE.DESTROYED
*/
/**
* Event emitted if there is a load error.
* @method jibo.face.views.View~LOAD_ERROR
* @deprecated since 8.1.0
* @see jibo.face.views~STATE.LOAD_ERROR
*/
/**
* Category for views that contain an interactive user interface.
* @name jibo.face.views.View.CATEGORY_GUI
* @deprecated since 8.1.0
* @see jibo.face.views~CATEGORY.GUI
*/
/**
* Category for views that are primarily used for display and not for interfacing.
* @name jibo.face.views.View.CATEGORY_DISPLAY
* @deprecated since 8.1.0
* @see jibo.face.views~CATEGORY.DISPLAY
*/
/**
* Category for EyeView type views.
* @name jibo.face.views.View.CATEGORY_EYE
* @deprecated since 8.1.0
* @see jibo.face.views~CATEGORY.EYE
*/
/**
* @method
* @name jibo.bt~addBehavior
* @deprecated since 0.10.0
* @see jibo.bt#register
*/
/**
* Creates a behavior.
* @method
* @name jibo.bt~createBehavior
* @see jibo.bt#register
* @deprecated since 0.10.0
*/
/**
* Creates a decorator.
* @method
* @name jibo.bt~createDecorator
* @see jibo.bt#register
* @deprecated since 0.10.0
*/
/**
* @method
* @name jibo.bt~registerBehavior
* @deprecated since 1.1.0
* @see jibo.bt#register
*/
/**
* @method
* @name jibo.bt~registerDecorator
* @deprecated since 1.1.0
* @see jibo.bt#register
*/
/**
* Creates a behavior.
* @method
* @name jibo.bt.Behavior~setDecorators
* @deprecated since 1.1.0
* @see jibo.bt.Behavior#decorators
*/
/**
* Creates a behavior.
* @method
* @name jibo.bt.Behavior~getName
* @deprecated since 1.1.0
* @see jibo.bt.Behavior#name
*/
/**
* Creates a behavior.
* @method
* @name jibo.bt.ParentBehavior~setChildren
* @deprecated since 1.1.0
* @see jibo.bt.ParentBehavior#children
*/
/**
* @class
* @name AudioUtils
* @memberof jibo.utils
* @deprecated Since 3.0.0
*/
/**
* Creates and returns correct full audio path from given file; takes into account asset packs, etc.
* @method jibo.utils.AudioUtils~getPath
* @deprecated Since 3.0.0
*/
/**
* Creates a new "Audio" stream based on given audio path and project uri; returns the audio object.
* @method jibo.utils.AudioUtils~startAudio
* @deprecated Since 3.0.0
*/
/**
* @method jibo.media~getUrlById
* @deprecated Since 5.8.2
* @see jibo.media#getUrl
*/
/**
*
* Stop jibo using voice commands.
* @name jibo.globalEvents#stop
* @deprecated since 6.0.4
* @see jibo.globalEvents#voiceStop
*/
/**
*
* Stop jibo using touch commands
* @name jibo.globalEvents#touchOn
* @deprecated since 6.0.4
* @see jibo.globalEvents#touchStop
*/

View File

@@ -0,0 +1,37 @@
/**
* Perform whatever pre-update setup is required.
* Return true for success, false for failure.
* If a failure, update will not be called.
* @method jibo.flow.ActivityImplementation#start
* @param {jibo.flow.Context} context The executor's context
* @returns {boolean}
*/
/**
* Perform the activity's normal update action. This will continue to be
* called on every update tick until it returns SUCCEEDED or FAILED.
* @method jibo.flow.ActivityImplementation#update
* @param {jibo.flow.Context} context The executor's context
* @returns {jibo.bt.Status}
*/
/**
* Stop any ongoing activity (called during the processing of Flow.Interrupt and general exceptions).
* This is provided so that an asynchronous activity can be stopped and its resources released.
* @method jibo.flow.ActivityImplementation#stop
* @param {jibo.flow.Context} context The executor's context
* @return {Promise<void>} A promise that resolves after any asynchronous cleanup has been performed.
*/
/**
* Destroy the activity, doing a full cleanup of any resources that need releasing.
* @method jibo.flow.ActivityImplementation#destroy
*/
/**
* If the Flow has a transition or Flow.Catch in scope capable of handling the given JS exception, turn it into
* a Flow ~Exception.* and process it internally, otherwise stop Flow execution and throw the JS exception.
* @method jibo.flow.ActivityImplementation#formOrThrowException
* @param jsexception {Exception} Javascript Exception object to throw as a JS exception or convert to a Flow exception
* @returns {string} the name of the Flow Exception to be thrown
*/

View File

@@ -0,0 +1,48 @@
/**
* Given a Flow activity and the current Flow Executor, create the runtime implementation of the activity.
* @method jibo.flow.ActivityImplementationFactory#getImplementationOfActivity
* @param {jibo.flow.Activity} activity - The activity we wish to get the implementation of.
* @param {jibo.flow.FlowExecutor} flowExecutor - The current FlowExecutor.
* @param {any} optionCodeThis - object containing only an '.in' property, whose value is the 'this.out' from the previous activity executed.
* @returns {jibo.flow.ActivityImplementation} an ActivityImplementation for the given activity.
*/
/**
* Given a Flow activity, return either a Flow-Activity or Behavior constructor for it.
* @method jibo.flow.ActivityImplementationFactory#getActivityOrBehaviorConstructor
* @param {jibo.flow.Activity} activity - The activity to find the constructor for.
* @returns {any} Object with an ActivityImplementation constructor or a Behavior constructor.
*/
/**
* Return the JS Class name for the given activity. This is simply a permutation of the activity's Flow Type.
* (e.g. it converts Flow.Eval-Async to FlowEvalAsync)
* @param {jibo.flow.Activity} activity - The activity to find the constructor for.
* @returns {string} - The JS Class name of the activity's implementation.
*/
/**
* Given a BehaviorConstructor, return the Flow implementation of a Behavior (really a Flow Class instance that wraps a Behavior Class instance).
* @method jibo.flow.ActivityImplementationFactory#getBehaviorClassInstance
* @param {jibo.bt.BehaviorConstructor} behaviorConstructor - The Behavior constructor for the Behavior or Decorator being wrapped by this Flow Activity.
* @param {jibo.flow.Activity} activity - The current Behavior-type Flow activity.
* @param {jibo.flow.FlowExecutor} flowExecutor - The current FlowExecutor.
* @param {any} optionCodeThis - The object being used for the "this" object in the option code.
* @returns {jibo.flow.FlowBehavior} - a FlowBehavior instance that wraps the instantiated Behavior.
*/
/**
* Given an activity constructor, return the constructed activity.
* @param {any} activityConstructor - The ActivityImplementation constructor.
* @param {jibo.flow.Activity} activity - The current Flow activity.
* @param {jibo.flow.FlowExecutor} flowExecutor - The current FlowExecutor.
* @param {any} optionCodeThis - The object being used for the "this" object in the option code.
* @returns {jibo.flow.ActivityImplementation} an ActivityImplementation for the given activity.
*/
/**
* Log the start of execution of every activity.
* @method jibo.flow.ActivityImplementationFactory#log
* @param {jibo.flow.Activity} activity - The Activity to log a record of.
* @param {jibo.flow.FlowExecutor} flowExecutor - The current FlowExecutor.
*/

36
Skills/@be/node_modules/jibo/lib/docs/flow/Context.js generated vendored Normal file
View File

@@ -0,0 +1,36 @@
/**
* A Notepad object stores each procedure's "local" variables.
* @class Notepad
* @memberof jibo.flow
* @param {jibo.flow.Context} context The context that is referencing the notepad.
* @param {any} params The input parameters to the procedure, available as 'notepad.params' in the procedure.
* @param {jibo.flow.Environment} environment The global environment of the executing flow.
*/
/**
* A hook so that non-Flow activities (i.e. Behaviors) can set the activity's output transition.
* Available as 'notepad.setTransition'.
* @param {string} transition
*/
/**
* A Result object is provided during procedure execution to
* hold any outputs the procedure needs to return to the caller.
* It can be filled in as needed by the procedure (e.g. "result.foo = 42").
* The Result object is made available to the caller throw the invoking Flow.Subflow activity
* (via the "subflow_result_object" parameter of the "getTransition" parameter).
* A procedure's Flow.End activity will always set result.transition.
* @class Result
* @memberof jibo.flow
*/
/**
* A snapshot of all the relevant info in an exception. This is available as `notepad.FlowEnv.lastException` after an exception occurs.
* @class FlowExceptionInfo
* @property {string} name - The name of the exception, e.g. "~InteractionError.noMatch"
* @property {jibo.flow.ActivityImplementation} activity - The activity in which the exception occurred. Equivalent to `stackTrace[0].activity`.
* @property {jibo.flow.Procedure} procedure - The procedure in which the exception occurred. Equivalent to `stackTrace[0].procedure`.
* @property {Array} stackTrace - An array of objects corresponding to the stack at the time the exception occurred, each having a procedure and activity property. The first element in the array is the inner most frame (ie. where the exception occurred).
* @property {any} payload - An object containing further information about the exception. This may be provided by a `Flow.Throw` activity, or in the case of JS exceptions, is the information passed via the parameter to a JS `catch()` statement.
* @memberof jibo.flow
*/

View File

@@ -0,0 +1,90 @@
/**
* Interface specifying what Overrides may be provided during FlowExecutor creation.
* @param {Blackboard} [blackboard] Override the default blackboard object for this flow.
* @param {Object} [notepad] Provide your own notepad object instead of the default one.
* @param {Object} [params] Provide parameters to the Flow code.
* @param {EventEmitter} [emitter] Provide your own emitter object instead of the default one shared with behavior trees.
* @param {jibo.flow.FlowExecutor} [flowExecutor] Provide your own Class for the FlowExecutor (primarly used with DebugFlowExecutor).
* @param {Boolean} [enableLogging] Turn on detailed logging as the flow executes.
* @param {Environment} [environment] Provide a pre-populated FlowEnvironment (normally an empty one is created automatically).
* @param {String} [assetPack] The asset pack name to use for loading assets in this tree.
*/
/**
* Class representing a FlowExecutor.
* The FlowExecutor runs a FlowRoot.
* @class FlowExecutor
* @memberof jibo.flow
*/
/**
* Step the primary flow and all parallel flows.
* @method jibo.flow.FlowExecutor#update
* @returns {boolean}
*/
/**
* Step the flow engine.
* This is overridden by the DebugFlowExecutor so
* that it may intervene in the execution process.
*/
/**
* Start the Flow Executor.
* This is effectively a nop since all the work is done through update().
* @method jibo.flow.FlowExecutor#start
*/
/**
* When FlowExecutor starts
* @event jibo.flow.FlowExecutor#start
*/
/**
* Called to stop the Flow Executor.
*
* 1) Stop the current activity.
* 2) Emit `stop` to stop update ticks.
* @method jibo.flow.FlowExecutor#stop
* @return {Promise<void>} A promise that resolves after any asynchronous cleanup has been performed.
*/
/**
* When FlowExecutor stops.
* @event jibo.flow.FlowExecutor#stop
*/
/**
* Called when the Flow executor has finished naturally (not via stop or exception).
* We simply emit events indicating that.
*/
/**
* Send `stop` to the current activity of the Flow Executor in the primary thread.
* @method jibo.flow.FlowExecutor#stopCurrentActivity
*/
/**
* Send `stop` to the current activity of the Flow Executor in the primary thread of the given context.
* @method jibo.flow.FlowExecutor#stopCurrentActivityInContext
*/
/**
* Destroy the FlowExecutor.
* Stop the primary thread and destroy all parallel flows within its scope.
* The flow is no longer runnable.
* @method jibo.flow.FlowExecutor#destroy
*/
/**
* Stop all the parallel flows.
* @method jibo.flow.FlowExecutor#destroyAsyncFlows
* @param {array} contexts the list of stack frames containing async flows to be destroyed
*/
/**
* Stop and Destroy this flow.
* The flow is no longer runnable.
* @method jibo.flow.FlowExecutor#stopAndDestroy
* @return {Promise<void>} A promise that resolves after any asynchronous cleanup has been performed.
*/

View File

@@ -0,0 +1,73 @@
/**
* Utility methods for registering activities and creating flows.
* @class FlowExecutorFactory
* @namespace jibo.flow
*/
/**
* Register an activity globally
* @method jibo.flow#register
* @param {String} name The PascalCased name for the behavior.
* @param {String} namespace This behavior's namespace. Pass in a globally unique name for this namesapce.
* @param {Module} classRef Class reference for the behavior or decorator.
*/
/**
* Add all activities
* @method jibo.flow#registerCore
* @private
*/
/**
* Give the Flow Executor access to the Activity constructors.
* @param {string} className - Final Class name (e.g. `FlowEvalAsync`)
* @param {string} [namespace] - Namespace of activity -- `core` if unsupplied.
* @returns {jibo.flow.ActivityImplementation} - Constructor of the activity or undefined if not found.
*/
/**
* Create a runnable flow executor from a flow file import.
* @method jibo.flow#create
* @param {String|Function} uri Relative or absolute path to a `.flow` file or module export of flow.
* @param {FlowExecutorOverrides} [overrides] Options for populating flow globals.
* @returns {jibo.flow.FlowExecutor}
*/
/**
* Create and run a runnable flow from a flow file import.
* ```
* const jibo = require('jibo');
* jibo.init('face', (err) => {
* jibo.flow.run('./flows/main', function(status){});
* });
*
* // Other supported APIs
* jibo.flow.run('./flows/main');
* jibo.flow.run('./flows/main', (status) => {});
* const overrides = {};
* jibo.flow.run('./flows/main', overrides);
* jibo.flow.run('./flows/main', overrides, (status) => {});
* ```
*
* @method jibo.flow#run
* @param {String|Function} uri Relative or absolute path to a `.flow` file or module export of flow.
* @param {Object} [overrides] Used for supplying optional flow globals and setting FlowExecutor options.
* @param {jibo.bt.Blackboard} [overrides.blackboard] Override the default blackboard object for this flow.
* @param {Object} [overrides.notepad] Provide your own notepad object instead of the default one.
* @param {Object} [overrides.blackboard] Provide your own blackboard object instead of the default one shared with behavior trees.
* @param {Object} [overrides.emitter] Provide your own emitter object instead of the default one shared with behavior trees.
* @param {String} [overrides.assetPack] The asset pack name to use for loading assets in this tree.
* @param {boolean} [overrides.stopOnException] Set to true to cause the FlowExecutor to stop in the debugger with an explorable stacktrace.
* @param {boolean} [overrides.enableLogging] Set to true to cause the FlowExecutor to log an activity trace to the console as it executes.
* @param {function} onFinishedCallback The callback which gets called when the flow has reached a status of FAILED, SUCCEEDED, or INTERRUPTED.
* @returns {jibo.flow.FlowExecutor}
*/
/**
* Resolve the path in relation to a calleeDirname directory. If the supplied uri is an absolute path, the uri is
* returned unmodified.
* @param {String} calleeDirname The directory name where the uri is relative to.
* @param {String} uri The relative or absolute uri to a file in relation to the calleeDirname.
* @returns {String} The result absolute path.
* @private
*/

View File

@@ -0,0 +1,6 @@
/**
* Installs the Action API, which can be found in the "jibo-action-system" module
* @class ActionPlugin
* @implements Plugin
* @private
*/

View File

@@ -0,0 +1,6 @@
/**
* Installs the AnimDB API, which can be found in the "jibo-anim-db" module
* @class AnimDBPlugin
* @implements Plugin
* @private
*/

View File

@@ -0,0 +1,6 @@
/**
* Installs the Autobot API
* @class AutobotPlugin
* @implements Plugin
* @private
*/

View File

@@ -0,0 +1,13 @@
/**
* Jibo plugin designed to communicate with the DevShell service, if it's running
* in int-developer or developer mode
* @class DevShell
* @extends EventEmitter
* @implements Plugin
* @private
*/
/**
* Called from skills manager
* @param command
*/

View File

@@ -0,0 +1,6 @@
/**
* Installs the Embodied API, which can be found in the "jibo-embodied-dialog" module
* @class EmbodiedPlugin
* @implements Plugin
* @private
*/

View File

@@ -0,0 +1,6 @@
/**
* Installs the Emotion API, which can be found in the "jibo-emotion-system" module
* @class Emotion
* @implements Plugin
* @private
*/

View File

@@ -0,0 +1,6 @@
/**
* Installs the DOF Arbiter API, which can be found in the "jibo-dof-arbiter" module
* @class DOFArbiterPlugin
* @implements Plugin
* @private
*/

View File

@@ -0,0 +1,3 @@
/**
* Preload the fonts needed for GUI
*/

View File

@@ -0,0 +1,6 @@
/**
* Installs the interaction memory API, which can be found in the "jibo-interaction-memory" module
* @class InteractionMemoryPlugin
* @implements Plugin
* @private
*/

View File

@@ -0,0 +1,18 @@
/**
* Jibo plugin designed to communicate with Skills Service Manager
* mainly to dispatch events when shutting down, initializing or showing
* the current jibo skill. Available on `jibo.lifecycle`
* @class LifeCycle
* @extends EventEmitter
* @implements Plugin
* @private
*/
/**
* Call when skill is done and wants to exit
*/
/**
* Called from skills manager
* @param command
*/

View File

@@ -0,0 +1,6 @@
/**
* Initializes Jibo's location data
* @class LocationPlugin
* @implements Plugin
* @private
*/

View File

@@ -0,0 +1,6 @@
/**
* Installs the Media API
* @class MediaPlugin
* @implements Plugin
* @private
*/

View File

@@ -0,0 +1,3 @@
/**
* Fetch the registry host from the IPC host
*/

View File

@@ -0,0 +1,3 @@
/**
* Registers tasks with the loader related to rendering
*/

View File

@@ -0,0 +1,3 @@
/**
* Fetch the list of services from the registry
*/

View File

@@ -0,0 +1,11 @@
/**
* Init all the clients on the `jibo` object for the running services
* as listed in the services registry.
*/
/**
* The map of service calls to init. The key must match the
* name of the service as found in the registry. If the
* service isn't currently running (and thus not listed in the
* registry), then the client will not be inited.
*/

View File

@@ -0,0 +1,68 @@
/**
* Versions for ssm, platform, jibo.
* @namespace jibo.versions
*/
/**
* The current version of the jibo API.
* @name jibo.versions#jibo
* @type {String}
*/
/**
* The current version of skills-service-manager.
* @name jibo.versions#ssm
* @type {String}
*/
/**
* The content of the current jibo's package.json.
* @name jibo.versions#platform
* @type {String}
*/
/**
* The full-stack release number of this Jibo's software
* @name jibo.versions#release
* @type {String}
*/
/**
* The current version of platform.
* @name jibo.versions#_packageInfo
* @type {Object}
* @private
*/
/**
* Initializes the versions API.
* @private
* @param {Function} done Callback when completed.
*/
/**
* Check to see if the current version is supported on this platform.
* @method jibo.versions#supported
* @param {String} currentPlatformVersion The current platform version.
* @return {Boolean} `true` if this `jibo` supports the current platform version.
*/
/**
* The Semver on the platform needed to run this `jibo`.
* @name jibo.versions#requiresPlatform
* @type {String}
*/
/**
* The content of the current jibo's `package.json`.
* @name jibo.versions#packageInfo
* @type {Object}
*/
/**
* Internally get the SSM version.
* @method jibo.versions#_getSSMVersion
* @private
* @param {Object} service Current service object for skils.
* @param {Function} done Callback when complete.
*/

View File

@@ -0,0 +1,6 @@
/**
* @class VolumePlugin
* @extends EventEmitter
* @implements Plugin
* @private
*/

View File

@@ -0,0 +1,7 @@
/**
* Installs the Context Service API, which can be found in services/context
* @class ContextPlugin
* @implements Plugin
* @memberof jibo
* @private
*/

View File

@@ -0,0 +1,28 @@
/**
* @description
* Context Service for providing on-robot context for cloud and related components.
*
* @namespace jibo.context
*/
/**
* Updates the Skill portion of the Context with CloudSkill data from The Hub
* @param {jibo.context.SkillData} skill - SkillData provided from the CloudSkill
*/
/**
* Resets the Skill portion of the Context back to default empty state.
*/
/**
* Compile on-robot and active cloud skill (if any) context
* @param {jibo.jetstream.types.HubSpeakerRecogResults} [speakers] - List of speakers we've confidently ID'd.
* @param {boolean} [omitLoop=false] - `true` if you would like users/Jibo omitted from the LoopContext
* @returns {Promise<jibo.context.Context>}
*/
/**
* Retrieves all relevant Loop member information.
* @returns {Promise<jibo.context.LoopContext>}
* @private
*/

View File

@@ -0,0 +1,138 @@
/**
* Enum of Jibo's colors.
* @typedef jibo.context.JiboColor
* @prop BLACK {string} 'BLACK'
* @prop WHITE {string} 'WHITE'
*/
/**
* Data provided about a given Loop member.
* @memberof jibo.context
* @interface LooperInfo
* @property {string} firstName - Loop member's first name.
* @property {string} lastName - Loop member's last name.
* @property {string} phoneticName - Loop member's phonetic name.
* @property {string} gender - Loop member's gender.
* @property {number} birthdate - Unix epoch timestamp.
* @property {string} id - Loop member's id in loop.
* @property {string} accountId - Loop member's account id (across loops).
*/
/**
* Data provided about Jibo himself.
* @memberof jibo.context
* @interface JiboInfo
* @property {jibo.context.JiboColor} color - Jibo's color.
* @property {number} birthdate - Unix epoch timestamp.
* @property {string} id - Loop member's id in loop.
*/
/**
* Data provided about the Loop and members of it.
* @memberof jibo.context
* @interface LoopContext
* @property {jibo.context.LooperInfo[]} users - Information about every Loop member (except Jibo).
* @property {jibo.context.JiboInfo} jibo - Information about Jibo himself.
* @property {string} owner - Loop owner's id in loop.
* @property {string} loopId - ID of loop.
*/
/**
* Data provided about Jibo's current emotional state.
* @memberof jibo.context
* @interface EmotionContext
* @property {string} name - Current nearest emotion.
* @property {number} valence - Current valence.
* @property {number} confidence - Current confidence.
*/
/**
* Data provided about Jibo's current character state.
* @memberof jibo.context
* @interface CharacterContext
* @property {jibo.context.EmotionContext} emotion - Current emotion context.
* @property {jibo.context.MotivationContext} motivation - Current motivation context.
*/
/**
* Data provided about Jibo's current motivational state.
* @memberof jibo.context
* @interface MotivationContext
* @property {number} social - Current social drive state.
* @property {number} playful - Current playful drive state.
*/
/**
* Data provided about Jibo's current perceptual information.
* @memberof jibo.context
* @interface PerceptionContext
* @property {string} speaker - ID of the currently active speaker.
* @property {jibo.lps.identity#Person[]} peoplePresent - Data about currently detected present people.
*/
/**
* Data provided about Jibo's current location.
* @memberof jibo.context
* @interface LocationContext
* @property {string} city - Jibo's current city (or nearest).
* @property {string} state - Jibo's current state.
* @property {string} stateAbbr - ISO 3166 1 alpha 2 spec compliant state (or political equivalent) abbreviation of Jibo's current location.
* @property {string} country - Jibo's current country.
* @property {string} countryCode - ISO 3166 1 alpha 2 spec compliant country code of Jibo's current country.
* @property {number} lat - Jibo's current latitude.
* @property {number} lng - Jibo's current longitude.
* @property {string} iso - ISO 8601 compliant string representing Jibo's current time/timezone.
*/
/**
* Data derived from last turn of dialog with jibo.
* @memberof jibo.context
* @interface DialogContext
* @property {string} [referent] - ID of a loop member that was referred to in utterance.
*/
/**
* On-robot context data
* @memberof jibo.context
* @interface RuntimeContext
* @property {jibo.context.EmotionContext} character - Information about Jibo's character state.
* @property {jibo.context.LocationContext} location - Information about Jibo's current location.
* @property {jibo.context.LoopContext} loop - Information about Jibo's loop.
* @property {jibo.context.PerceptionContext} perception - Information about Jibo's perception state.
* @property {jibo.context.DialogContext} dialog - Information about the current turn of Dialog.
*/
/**
* Cloud skill session data
* @memberof jibo.context
* @interface SkillData
* @property {string} id - Cloud Skill ID.
* @property {Object} [session] - Session data for the currently active Cloud Skill.
*/
/**
* Combination of on-robot and active cloud skill session data
* @memberof jibo.context
* @interface Context
* @property {jibo.context.RuntimeContext} runtime - On-robot context data.
* @property {jibo.context.SkillData} skill - Cloud skill session data.
*/
/**
* Retreive the merge of the on-robot context and any active cloud skill session context
* @method jibo.context#getContext
* @param {jibo.jetstream.types.HubSpeakerRecogResults} [speakers] - List of speakers we've confidently ID'd.
* @param {boolean} [omitLoop=false] - `true` if you would like users/Jibo omitted from the LoopContext.
* @returns {Promise<jibo.context.Context>}
*/
/**
* Updates the Skill portion of the Context with active Cloud Skill session data from The Hub
* @method jibo.context#updateSkillContext
* @param {jibo.context.SkillData} data - Skill session data provided from the CloudSkill
*/
/**
* Resets the Skill portion of the Context back to default empty state
* @method jibo.context#resetSkillContext
*/

View File

@@ -0,0 +1,119 @@
/**
* @description
* Controls the rendering of the eye, overlay, and background.
* ```
* let jibo = require('jibo');
* jibo.init('face', () => {
* // Setup complete!
* });
* ```
* @namespace jibo.face
*/
/**
* Entire width of Jibo's face.
* @name jibo.face.WIDTH
* @type {int}
* @default 1280
* @readOnly
*/
/**
* Entire height of Jibo's face.
* @name jibo.face.HEIGHT
* @type {int}
* @default 720
* @readOnly
*/
/**
* Stage container for all PIXI display objects.
* @name jibo.face#stage
* @type {PIXI.Container}
*/
/**
* If the display is updating.
* @name jibo.face#_paused
* @type {Boolean}
* @private
*/
/**
* Instance of the update timer for handling events.
* @name jibo.face#_timer
* @type {jibo.timer}
* @private
*/
/**
* Instance to the GUI/View Manager.
* @private
* @name jibo.face#_views
* @type {jibo.face.views}
*/
/**
* Instance to the GestureManager for input gestures.
* @private
* @name jibo.face#_gestures
* @type {jibo.face.GestureManager}
*/
/**
* Instance to the Eye display.
* @private
* @name jibo.face#_eye
* @type {jibo.face.EyeContainer}
*/
/**
* Creates the canvas for the renderer.
* @private
* @method jibo.face.createView
*/
/**
* Adds a face animation to play.
* @private
* @method jibo.face#init
* @param {HTMLElement} element HTML element which will contain the view
* @param {boolean} [prepWorkers=true] If Crunch texture loading workers should be prepared. Should be left as the default of true, unless in the SDK.
*/
/**
* Manage the views on Jibo's face.
* @name jibo.face#views
* @type {jibo.face.views}
*/
/**
* Create and manage the input gestures.
* @name jibo.face#gestures
* @type {jibo.face.GestureManager}
*/
/**
* Tweens manager.
* @name jibo.face#tween
* @type {jibo.face.TweenManager}
*/
/**
* Representation of the eye itself.
* @name jibo.face#eye
* @type {jibo.face.EyeContainer}
*/
/**
* Update/render the stage.
* @method jibo.face#update
* @private
* @param {int} elapsed Time in milliseconds since the last update
*/
/**
* If `true`, pauses the face renderer completely.
* @name jibo.face#paused
* @type {boolean}
*/

View File

@@ -0,0 +1,232 @@
/**
* An abstract Layer for the eye.
* @class Layer
* @memberof jibo.rendering.animation
* @private
*/
/**
* A layer that represents the Eye.
* @class EyeLayer
* @memberof jibo.rendering.animation
* @private
*/
/**
* A layer of the KeysAnimation class that represents a timeline animation.
* @class TimelineLayer
* @memberof jibo.rendering.animation
* @private
* @param {Number} index The depth index.
* @param {String} name Name of the timeline.
* @param {jibo.rendering.animation.Timeline} timeline
* @param {Number} startTime The starting time of this animation in seconds.
* @param {Boolean} attach `true` if Timeline should be attached to the eye's position.
* @param {String} offset The frame offset to start playing the animation at
*/
/**
* Update the position of the animation.
* @method jibo.rendering.animation.TimelineLayer#update
* @param {Number} time Global time of the animation in seconds.
*/
/**
* Destroy and don't use after this.
* @method jibo.rendering.animation.TimelineLayer#destroy
*/
/**
* Class used by Animation Utilities to provide playback
* of keys files.
* @class KeysAnimation
* @memberof jibo.rendering.animation
* @extends EventEmitter
* @param {String} id The name of the keys file.
*/
/**
* The default framerate.
* @name jibo.rendering.animation.KeysAnimation.FRAMERATE
* @type {String}
* @default 30
*/
/**
* Event name when animation starts.
* @name jibo.rendering.animation.KeysAnimation.STARTED
* @type {String}
*/
/**
* Event name when animation stops.
* @name jibo.rendering.animation.KeysAnimation.STOPPED
* @type {String}
*/
/**
* Event name when builder event is fired.
* @name jibo.rendering.animation.KeysAnimation.EVENT
* @type {String}
*/
/**
* Event name when animation is cancelled.
* @name jibo.rendering.animation.KeysAnimation.CANCELLED
* @type {String}
*/
/**
* Event name when audio is played.
* @name jibo.rendering.animation.KeysAnimation.PLAY_AUDIO
* @type {String}
*/
/**
* Event name when timeline is played.
* @name jibo.rendering.animation.KeysAnimation.PLAY_TIMELINE
* @type {String}
*/
/**
* Event name when timeline needs to be reordered.
* @name jibo.rendering.animation.KeysAnimation.REORDER
* @type {String}
*/
/**
* Event when the timeline is updated.
* @name jibo.rendering.animation.KeysAnimation.UPDATE
* @type {String}
* @param {Number} time The current time in seconds from the start of animation.
* @param {Object} dofValues Collection of DOF values for the current frame.
*/
/**
* Asset Pack name.
* @name jibo.rendering.animation.KeysAnimation#assetPack
* @type {String}
*/
/**
* Resource root for animation (defaults to root of skill).
* @name jibo.rendering.animation.KeysAnimation#root
* @type {String}
*/
/**
* Id of the keys file in the cache.
* @name jibo.rendering.animation.KeysAnimation#id
* @type {String}
*/
/**
* Name of the keys file.
* @name jibo.rendering.animation.KeysAnimation#name
* @type {String}
*/
/**
* The collection of layers for the animation.
* @name jibo.rendering.animation.KeysAnimation#layers
* @type {Array<Layer>}
*/
/**
* Token of an asset load for our keys data, so it doesn't get unloaded under us.
* @private
*/
/**
* Map of Timeline objects.
* @name jibo.rendering.animation.KeysAnimation#timelines
* @type {Object}
*/
/**
* Map of PIXI.Texture objects.
* @name jibo.rendering.animation.KeysAnimation#textures
* @type {Object}
*/
/**
* Map of Sound objects.
* @name jibo.rendering.animation.KeysAnimation#sounds
* @type {Object}
*/
/**
* The animation options.
* @name jibo.rendering.animation.KeysAnimation#options
* @type {AnimationOptions<DOFSet>}
* @private
*/
/**
* The animation instance.
* @name jibo.rendering.animation.KeysAnimation#instance
* @type {AnimationInstance}
* @private
*/
/**
* Update the timelines.
* @method jibo.rendering.animation.KeysAnimation#update
* @param {Number} time Current time of this animation
*/
/**
* Set the keys animation data.
* @name jibo.rendering.animation.KeysAnimation#data
* @type {Object}
* @private
*/
/**
* Sync a movieclip to the playback of the animation.
* @method jibo.rendering.animation.KeysAnimation#playSync
* @param {animate.MovieClip} instance The clip to play.
* @param {String|Function} [event] The name of the event label or callback function.
* @param {Function} [callback] Callback when play is complete.
*/
/**
* Destroy the keys animation completely, after the Expression Service has told us that it has finished playing.
* @method jibo.rendering.animation.KeysAnimation#destroyWhenComplete
*/
/**
* Destroy the keys animation completely.
* @method jibo.rendering.animation.KeysAnimation#destroy
*/
/**
* Handle animation custom events.
* @method jibo.rendering.animation.KeysAnimation#onEvent
* @private
*/
/**
* Handle playing audio within the animation.
* @method jibo.rendering.animation.KeysAnimation#onPlayAudio
* @private
* @param {Object} payload
* @param {string} payload.file
*/
/**
* Reorder the layers of the animation.
* @method jibo.rendering.animation.KeysAnimation#reorder
* @private
*/
/**
* Handle the playing of a timeline event.
* @method jibo.rendering.animation.KeysAnimation#onPlayTimeline
* @private
* @param {object} payload
* @param {string} payload.file
* @param {number} payload.layerNum
* @param {boolean} payload.attach
* @param {string} payload.offset
*/

View File

@@ -0,0 +1,126 @@
/**
* Class used by Animation Utilities to provide playback
* of keys files.
* @class KeysData
* @memberof jibo.rendering.animation
* @extends EventEmitter
* @param {String} id The name of the keys file.
* @param {String} src The absolute path of the keys file.
* @param {String} cache The name of the cache the data was originally loaded into.
*/
/**
* Asset Pack name.
* @name jibo.rendering.animation.KeysData#assetPack
* @type {String}
*/
/**
* Resource root for animation (defaults to root of skill).
* @name jibo.rendering.animation.KeysData#root
* @type {String}
*/
/**
* Source path of animation data
* @name jibo.rendering.animation.KeysData#src
* @type {String}
*/
/**
* Source path of corresponding `.anim`, if present/valid.
* @name jibo.rendering.animation.KeysData#dotAnimSrc
* @type {String}
*/
/**
* Name of the initial cache this data was loaded into. Used when determining animation options.
* @name jibo.rendering.animation.KeysData#cache
* @type {String}
*/
/**
* Map of Timeline objects.
* @name jibo.rendering.animation.KeysData#timelines
* @type {Object}
*/
/**
* Map of PIXI.Texture objects.
* @name jibo.rendering.animation.KeysData#textures
* @type {Object}
*/
/**
* Map of Sound objects.
* @name jibo.rendering.animation.KeysData#sounds
* @type {Object}
*/
/**
* Name of the keys file.
* @name jibo.rendering.animation.KeysData#id
* @type {String}
*/
/**
* The keys animation data.
* @name jibo.rendering.animation.KeysData#data
* @type {Object}
* @private
*/
/**
* Add a sound to the animation for playing.
* @method jibo.rendering.animation.KeysData#addSound
* @param {String} id The ID of the sound
* @param {jibo.sound.Sound} sound Instance of sound.
*/
/**
* Add a timeline to the animation for playing.
* @method jibo.rendering.animation.KeysData#addTimeline
* @param {String} id The ID of the timeline
* @param {jibo.rendering.animation.Timeline} timeline Instance of timeline.
*/
/**
* Add a PIXI texture to the animation for playback.
* @method jibo.rendering.animation.KeysData#addTexture
* @param {String} id The ID of the texture
* @param {PIXI.Texture} texture Instance of texture.
*/
/**
* Create a shallow clean copy of this KeysAnimation object resetting all state.
* This should be used when retrieving a keys animation object from cache
* Note: Any clean copy should always be destroyed after use
* @param {CloneOptions<DOFSet>} options Options for animation instantiation/playback.
* @method jibo.rendering.animation.KeysData#getCleanCopy
* @return {Promise<jibo.rendering.animation.KeysData>}
*/
/**
* Create and immediately play a KeysAnimation from this KeysData.
* Event handlers for `stopped`, `cancelled`, `rejected`, and other animation events must be registered to the
* animation instance immediately (in-stack) upon promise resolution, or else they may be missed.
* @param {CloneOptions<DOFSet>} [options] Options for animation instantiation/playback.
* @param {string} [requestor] The system making the animation playback request.
* @method jibo.rendering.animation.KeysData#getAndPlayAnim
* @return {Promise<jibo.rendering.animation.KeysAnimation>}
*/
/**
* Destroy the keys data completely.
* @method jibo.rendering.animation.KeysData#destroy
*/
/**
* Create an animation options from keyframes data or a keyframes file.
* In the case of keyframes data, DOF values are computed and passed to the expression service.
* In the case of a keyframes file, the path to a file of DOF values computed from the keyframes file is passed
* to the expression service.
* @method jibo.rendering.animation.KeysData#createAnimOptions
* @return {AnimationOptions<DOFSet>}
* @private
*/

View File

@@ -0,0 +1,129 @@
/**
* Nested Keys File Loading.
*
* Given a keys file url, load the file and then recursively
* composite into it any keys files it points to (somewhat like macro expansion).
* @return {String} The result of the compositing operation with all reference layers removed.
* @name jibo.rendering.animation.KeysLoader#innerNestedLoad
* @param {String} url Path nanme of the keys file to be loaded
* @param {Callback} complete Callback to call when the load is completed.
* @param {String} [parentId] The layer ID of the referencing frame.
* @param {String} [refBase] The directory that the asset references are with respect to.
* @private
*/
/**
* Convert keyframes referencing texture, pixi and audio information into assetpack style references if necessary.
*
* The motivation:
* Consider a reference layer in a skill's animation that references an animDB keys file.
* Compositing will pull in the layers from the animDB keys file, but any asset references (textures, audio, pixi)
* in those layers will be relative to the animDB root. If the paths to those assets are not converted to
* asset-pack style references (while we know their provenance) we will not be able to distinguish later on
* whether those references are relative to the animDB or to the local skill.
*
* @param {Keyframes} frames the keyframes object whose asset references will be modified.
* @param {string} assetPack the assetPack that the containing file is in.
*/
/**
* Convert a non-asset pack reference into an asset-pack one.
* @param assetPack
* @param filepath
* @returns {string}
*/
/**
* Find all references in a keys file, returning them in reverse-order.
* @name jibo.rendering.animation.KeysLoader#getKeyFileReferences
* @param {Keyframes} frames A keyframes structure containing reference layers.
* @param {String} refBase The directory containing the file from whence the given keyframes were loaded.
* @returns {Array} An array of objects describing references to other keys files,
* each object has these properties:
* `url`: the url of the file being referenced,
* `parentId`: the layerID of the parent,
* `holdFinalPose`: whether the final frame of the referenced layer is held until the next reference (or end),
* `containerDuration`: the duration of the file that contains this reference.
* `layerNumber`: the ordinal layer number of the reference,
* `atEnd`: a boolean that is true if this is the last reference in the layer.
* `nextRefStart`: where the next reference frame is, or Infinity if there are no further references.
* `timeOffset`: the timepoint at which it is to be inserted in the referencing layer.
* @private
*/
/**
* Place num in a leading-zero-padded field of the given size
* @param {number} num Number to pad
* @param {number} size Size of final field
* @returns {string}
*/
/**
* Return a full URL for the referenced keys file based on
* the reference mode (by name or by file).
* @param {any} keyframe the keyframe containing the reference.
* @param {string} refBase directory of the file in which the reference is occurring.
* @returns {object} object.url containing the fully resolved path to referenced file and
* object.refBase containing the parent directory of the referencer.
* @method jibo.rendering.animation.KeysLoader#getReferencedUrl
* @private
*/
/**
* Find any "HOLD_SAFE" events in referenced layers and remove them (by renaming them).
* @name jibo.rendering.animation.KeysLoader#removeHoldSafesInReferences
* @param {Keyframes} frames keyframes to be cleaned.
* @private
*/
/**
* Strip out any reference-type layers from the keyframes.
* @name jibo.rendering.animation.KeysLoader#removeReferenceLayers
* @param {Keyframes} keyframes keyframes structure containing reference layers.
* @private
*/
/**
* Shift the layer's validFrom, validUpto and validHoldAfter properties and
* shift the timepoint of all the keyframes within each of the given layers by the given time offset ("validFrom").
* The validFrom and validUpto parameters are in "referencing" layer coordinates.
* @name jibo.rendering.animation.KeysLoader#timeshift
* @param {Keyframes} frames the layers containing the keyframes to be shifted.
* @param {number} validFrom the beginning of the valid region.
* @param {number} validUpto the ending of valid region, or Infinity for unlimited.
* @param {number} holdAfter the timepoint after which the pose does not change (i.e. it remains fixed at that timepoint).
* @private
*/
/**
* Insert all the layers of toBeInsertedKeyframes into existingKeyframes at the given layer number.
* Insert them last-first in order to preserve their original ordering at the designated layer.
* @name jibo.rendering.animation.KeysLoader#composite
* @param {Number} layerNumber the layer number in which the keyframes are to be inserted.
* @param {Keyframes} existingKeyframes the existing keyframes into which the layers will be inserted.
* @param {Keyframes} toBeInsertedKeyframes the source of the keyframes to be inserted.
* @private
*/
/**
* Modifies the layer ids to prefixed by the referencing layer's id (delimited by "-")
* and suffixed with the layer number (delimited by '.').
* @name jibo.rendering.animation.KeysLoader#fixLayerIds
* @param {Keyframes} frames the set of layers to be modified.
* @param {string} prefix the string with which to prefix each layer id.
* @private
*/
/**
* Was this layer produced from a keyframes reference?
* @name jibo.rendering.animation.KeysLoader#isReferencedLayer
* @param {any} layer the layer to be checked
* @returns {boolean}
* @private
*/
/**
// * Return true if frame being referenced already exists in hierarchy.
// * @param frames
// * @param prefix
// */

View File

@@ -0,0 +1,12 @@
/**
* The object returned by the ShapesTask.
* @class Shapes
* @memberof jibo.rendering.animation
* @param {String} id ID for the shapes.
* @param {Array<Array>} shapes Collection of shapes.
*/
/**
* Destroys shapes object.
* @method jibo.rendering.animation.Shapes#destroy
*/

View File

@@ -0,0 +1,19 @@
/**
* The object returned by the SpritesheetTask.
* @class Spritesheet
* @memberof jibo.rendering.animation
* @param {PIXI.BaseTexture} baseTexture
* @param {Object} frames The frames map
* @param {Number} resolution The amount of scale
*/
/**
* The collection of textures by name.
* @name jibo.rendering.animation.Spritesheet#frames
* @type {Object}
*/
/**
* Destroys all the textures/frames of spritesheet.
* @method jibo.rendering.animation.Spritesheet#destroy
*/

View File

@@ -0,0 +1,48 @@
/**
* The object returned by the TimelineTask. Represents a PIXI animation.
* @class Timeline
* @private
* @memberof jibo.rendering.animation
*/
/**
* Adds a texture for the Timeline.
* @method jibo.rendering.animation.Timeline#addTexture
* @private
* @param {PIXI.Texture} texture Texture reference.
* @param {String} id The id name of texture in cache.
*/
/**
* Gets a texture/frame that was loaded for this Timeline
* @method jibo.rendering.animation.Timeline#getTexture
* @private
* @param {String} id The id name of texture in cache.
* @returns {PIXI.Texture} Texture reference.
*/
/**
* Adds shapes to the Timeline.
* @method jibo.rendering.animation.Timeline#addShapes
* @private
* @param {jibo.rendering.animation.Shapes} shapes Texture reference.
*/
/**
* Adds spritesheet to the Timeline.
* @method jibo.rendering.animation.Timeline#addSpritesheet
* @private
* @param {jibo.rendering.animation.Spritesheet} spritesheet Spritesheet reference.
*/
/**
* Uploads all the textures to the GPU.
* @method jibo.rendering.animation.Timeline#upload
* @param {PIXI.WebGLRenderer} renderer Reference to face renderer.
* @param {Function} callback Callback when complete.
*/
/**
* Destroys Timeline object.
* @method jibo.rendering.animation.Timeline#destroy
*/

View File

@@ -0,0 +1,31 @@
/**
* Abstract class for eye overlay and eye classes.
* @class AbstractEye
* @extends jibo.face.AbstractLayer
* @memberof jibo.face
* @param {Boolean} cache `true` to cache textures.
*/
/**
* The eye mesh.
* @name jibo.face.AbstractEye#eyeMesh
* @type {jibo.face.EyeMesh}
*/
/**
* Default eye texture when nothing is set.
* @method jibo.face.AbstractEye#init
* @param {PIXI.Texture} texture The default texture to use
*/
/**
* Destroy and don't use after this.
* @method jibo.face.AbstractEye#destroy
*/
/**
* Set current eye texture.
* @method jibo.face.AbstractEye#setTexture
* @protected
* @param {PIXI.Texture} texture Texture to set
*/

View File

@@ -0,0 +1,146 @@
/**
* Abstract class for background, eye overlay and eye classes.
* @class AbstractLayer
* @extends PIXI.Container
* @memberof jibo.face
* @param {Boolean} cache `true` to cache textures.
*/
/**
* If should update according to DOFValues.
* @name jibo.face.AbstractLayer#connected
* @type {String}
*/
/**
* `true` if layer has been initialized.
* @name jibo.face.AbstractLayer#initialized
* @type {String}
* @protected
*/
/**
* Current cached timestamp.
* @name jibo.face.AbstractLayer#timestamp
* @type {Number[]}
* @protected
*/
/**
* Current cached dofValues.
* @name jibo.face.AbstractLayer#dofValues
* @type {Number[]}
* @protected
*/
/**
* Empty placeholder texture.
* @name jibo.face.AbstractLayer#_defaultTexture
* @type {PIXI.Texture}
* @private
*/
/**
* Reference to the current texture.
* @name jibo.face.AbstractLayer#_texture
* @type {PIXI.Texture}
* @private
*/
/**
* Current path of the texture loaded/loading.
* @name jibo.face.AbstractLayer#_texturePath
* @type {String}
* @private
*/
/**
* The current asset loading
* @name jibo.face.AbstractLayer#_load
* @type {jibo.loader.AssetLoad}
* @private
*/
/**
* The cache key of the texture currently in use.
* @name jibo.face.AbstractLayer#_textureCacheKey
* @type {jibo.loader.AssetToken}
* @private
*/
/**
* Default eye texture when nothing is set.
* @method jibo.face.AbstractLayer#reset
* @param {Boolean} [resetPath=true] `false` to ignore resetting default path
*/
/**
* Default eye texture when nothing is set.
* @method jibo.face.AbstractLayer#init
* @param {PIXI.Texture} texture The default texture to use
*/
/**
* Display of DOFValues.
* @method jibo.face.AbstractLayer#display
* @param {Array<Number>} timestamp Timestamp when update is called.
* @param {jibo.face.DOFValues} dofValues Update display according to these values.
* @return {Boolean} `true` proceeds with update.
*/
/**
* Full path to the texture to use.
* @name jibo.face.AbstractLayer#texturePath
* @type {String}
*/
/**
* Destroy and don't use after this.
* @method jibo.face.AbstractLayer#destroy
*/
/**
* Set current eye texture.
* @method jibo.face.AbstractLayer#setTexture
* @param {PIXI.Texture} texture Texture to set.
* @override
*/
/**
* Value to tint.
* @method jibo.face.AbstractLayer#rgb2hex
* @protected
* @param {Number} red Red value from 0 to 1
* @param {Number} green Green value from 0 to 1
* @param {Number} blue Blue value from 0 to 1
* @return {int} The resulting uint color
*/
/**
* Check to see a path matches the default texture.
* @method jibo.face.AbstractLayer#_isDefaultTexture
* @param {PIXI.Texture} texture The default texture.
* @param {String} value Full path to test.
* @return {Boolean} `true` if the value is the default texture.
* @private
*/
/**
* If there's a current load happen, stop it.
* @method jibo.face.AbstractLayer#_cancelLoad
* @private
*/
/**
* Set the current texture path.
* @method jibo.face.AbstractLayer#_applyTexture
* @param {String} value Path to the texture
* @private
*/
/**
* Set the current texture path.
* @method jibo.face.AbstractLayer#_loadTexture
* @param {String} value Path to the texture
* @private
*/

Some files were not shown because too many files have changed in this diff Show More