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,20 @@
/**
* Enum of Jibo's Embodied Dialog states
* @typedef jibo.embodied#EmbodiedState
* @property {string} IDLE
* @property {string} SPEAKING
* @property {string} LISTENING
* @property {string} MIXED
*/
/**
* Constructor options for the Jibo Embodied Dialog system
* @memberof jibo.embodied
* @interface EmbodiedOptions
* @extends {jibo.embodied.speech.SpeakOptions}
* @property {string} [resourceRoot] - Root directory of /animation and /audio resources
*/
/**
* Constructs Embodied Dialog instance
*/

View File

@@ -0,0 +1,141 @@
/**
* The singleton embodied dialog instance
* Should not be used in normal operation, but made visible for testing and debugging purposes.
* @type {EmbodiedDialog}
* @private
*/
/**
* @private
*/
/**
* Initializes the embodied dialog instance.
* @method jibo.embodied#init
* @param {jibo} jibo jibo instance.
* @param {jibo.embodied.EmbodiedOptions} [options] Embodied dialog initialization options.
* @param {jibo.embodied.speech.AutoRuleConfig} [autoRuleConfig] Embodied speech AutoRule configuration.
* @returns {Promise<void>} Resolved when completed initialization.
*/
/**
* Checks if embodied dialog is already initialized.
* @method jibo.embodied#isInitialized
* @returns {boolean} `true` if already initialized.
*/
/**
* Get the state of embodied dialog.
* @method jibo.embodied#getState
* @returns {jibo.embodied#EmbodiedState} Embodied dialog state (derived from `jibo.embodied.speech` and `jibo.embodied.listen`).
*/
/**
* @description Embodied speech provides a framework through which Jibo's
* speech is expressed with character by wrapping it with sound
* and animation behaviors (both automatically and via ESML tags). The
* vast majority of the animations that are requested via these tags come
* from the Animation Database (AnimDB).
*
* @namespace jibo.embodied.speech
*/
/**
* Speaks text with coordinated animations and sounds (both auto-generated and user-defined).
* @method jibo.embodied.speech#speak
* @param {string} textToSpeak Text jibo should speak.
* @param {jibo.embodied.speech.SpeakOptions} [speakOptions] Options to configure request
* @param {jibo.embodied.speech.AutoRuleConfig} [autoRuleConfig] Configuration for AutoRules of request
* @returns {Promise<jibo.embodied.speech#RequestStatus>} A promise that is resolved when jibo is done speaking (naturally or via stop)
*/
/**
* Stops the currently ongoing speak command.
* @method jibo.embodied.speech#stop
* @returns {Promise.<void>}
*/
/**
* Sets up the audio and anim paths for embodied speech.
* @method jibo.embodied.speech#setPaths
* @param {string} assetPack Asset
*/
/**
* Get current activity status of embodied speech
* @method jibo.embodied.speech#isActive
* @returns {boolean} `true if` embodied speech is currently processing a speak request.
*/
/**
* Retrieve a promise linked to the state embodied speech animation dispatch.
* @method jibo.embodied.speech#waitForAnimDispatch
* @returns {Promise<void>} Promise providing the current state of embodied speech animation dispatch.
*/
/**
* @description Embodied listen provides a framework through which Jibo's
* listening states are clearly communicated and expressed with character.
*
* @namespace jibo.embodied.listen
*/
/**
* Returns the current ambient listening mode.
* @method jibo.embodied.listen#getAmbientMode
* @return {jibo.embodied.listen#AmbientListenMode}
*/
/**
* Returns the current active listening mode.
* @method jibo.embodied.listen#getActiveMode
* @return {jibo.embodied.listen#ActiveListenMode}
*/
/**
* Set ambient mode for embodied listen.
* @method jibo.embodied.listen#setMode
* @param {jibo.embodied.listen#AmbientListenMode} mode Ambient listen mode to set.
*/
/**
* Request active mode of embodied listen.
* @method jibo.embodied.listen#enterActiveMode
* @param {jibo.embodied.listen#ActiveListenMode} mode Requested active listen mode.
* @param {jibo.embodied.listen.ActiveModeOptions} [options] Configuration options consumed by the different active modes.
* @return {Promise<jibo.embodied.listen#RequestStatus>} Resolves once embodied listen is in
* requested active mode or interrupted by another active mode request.
*/
/**
* Exit active mode of embodied listen.
* @method jibo.embodied.listen#exitActiveMode
* @param {boolean} [fastForward=true] `true` to fast forward state sequence to idle state.
* @return {Promise<void>} Resolves when embodied listen returns to idle.
*/
/**
* Disposes of resources, unsubscribes from events.
* Should be called when destroying instance.
* @method jibo.embodied.listen#dispose
*/
/**
* Resolves immediately if already in idle, otherwise waits until state machine reaches idle.
* Can be fast forwarded to idle. In this case we will flush animation queue and head straight to idle.
* @method jibo.embodied.listen#waitForIdle
* @param {boolean} fastForward `true` to fast forward state sequence to idle state.
* @returns {Promise<any>}
*/
/**
* Disables embodied listen for the next listen event.
* @method jibo.embodied.listen#disableOnce
*/
/**
* This method demonstrates the animation/led/sound used in both the engagement and disengagement states.
* @method jibo.embodied.listen#demoEngaged
* @param {boolean} turnOn Turn on/off the demo engaged state.
* @returns {Promise<T[]>}
*/

View File

@@ -0,0 +1,6 @@
/**
* @description Embodied Dialog provides framework through which dialog
* (speaking and listening) is expressed with character.
*
* @namespace jibo.embodied
*/

View File

@@ -0,0 +1,15 @@
/**
* Builds a perceptual eye transition animation name
* @param {boolean} seePerson
* @param {EyeTransitionStyle} style
* @param {EyeTransitionDirection} direction
* @param {boolean} [sound=true]
* @return {string}
*/
/**
* Builds a perceptual eye pose animation name
* @param {boolean} seePerson
* @param {boolean} listening
* @return {string}
*/

View File

@@ -0,0 +1,100 @@
/**
* Constructs (but does not init) Embodied Listen instance
*
* @param {EmbodiedDialog} _ed
*/
/**
* Initializes Embodied Listen instance
*
* @param {jibo} jibo instance
* @param {boolean} [debug=false] Toggle debug mode
* @returns {Promise<void>} Resolved when completed initialization
*/
/**
* Thinking state setup
* In this state we turn off LED and Eye and start a thinking animation to hide the
* wait time until we receive cloud results
*/
/**
* Disposes of resources, unsubscribes from events.
* Should be called when destroying instance.
*/
/**
* Resolves immediately if already in idle, otherwise waits until state machine reaches idle.
* Can be fast forwarded to Idle. In this case we will flush animation queue and head straight to idle.
* @param {boolean} fastForward Fast forward state sequence to idle state
* @returns {Promise}
*/
/**
* This method demonstrates the animation/led/sound used in both
* the engagement and disengagement states.
* @param {boolean} turnOn Whether to turn on engaged state or turn it off
* @returns {Promise<T[]>}
*/
/**
* Disables Embodied Listen for the next listen event
*/
/**
* Returns the current Ambient Embodied Listen Mode
* @return {AmbientListenMode}
*/
/**
* Returns the current Active Embodied Listen Mode
* @return {ActiveListenMode}
*/
/**
* Changes the Ambient Embodied Listen Mode
* @param {AmbientListenMode} mode New mode
*/
/**
* Request to enter an Active Embodied Listen Mode
* @param {ActiveListenMode} mode - Requested Active Mode.
* @param {ActiveModeOptions} [options] - Configuration Options consumed by the different Active Modes
* @return {Promise<RequestStatus>} Resolves once Embodied Listen is back
* in requested Active Mode or interrupted by another active mode request.
*/
/**
* Request to exit the Active Embodied Listen Mode
* @param {ListenMode|string} mode New mode
* @param {boolean} [fastForward=true] `true` to fast forward state sequence to idle state.
* @return {Promise<void>} Resolves once Embodied Listen is back in idle state.
*/
/**
* Triggers a listening eye transition
* @param {boolean} heyJibo - Whether we are transitioning because of a HJ event
* @internal
* @private
*/
/**
* Triggers a listening eye (off)
* @internal
* @private
*/
/**
* Handles incremental results and is used to create a head bob or a blink
* or posture shift
* @internal
* @private
*/
/**
* Internal mode setter, gets called by `setMode`
* @param {string|PromiseProvider} anim to play
* @param {AnimConfig} [config] to configure the anim
* @param {PlaybackOptions} [options] to configure the playback
* @private
*/

View File

@@ -0,0 +1,29 @@
/**
* Enum of active embodied listen mode request result statuses.
* @typedef jibo.embodied.listen#RequestStatus
* @prop SUCCEEDED
* @prop INTERRUPTED
* @prop CANCELLED
* @prop REJECTED
*/
/**
* Enum of Jibo's ambient embodied listen modes.
* @typedef jibo.embodied.listen#AmbientListenMode
* @property {string} NORMAL - Standard listening expressions, includes body movement and sounds.
* @property {string} NO_BODY - Standard listening expressions, minus body movement.
*/
/**
* Enum of Jibo's active embodied listen modes.
* @typedef jibo.embodied.listen#ActiveListenMode
* @property {string} OPTIONAL_RESPONSE - Listening expressions tuned to reflect the optional nature of response.
* @property {string} UI - More "device-like" listening expressions, for use in things like menus.
*/
/**
* Embodied listen active mode configuration options.
* @memberof jibo.embodied.listen
* @interface ActiveModeOptions
* @property {timeout} [timeout] - Fade-out duration consumed by optional response active mode.
*/

View File

@@ -0,0 +1,30 @@
/**
* Play animation
* @param {AnimationOptions} options Animation playback and configuration options
* @return {PlaybackResult}
*/
/**
* Set color of LED ring
* @param {jibo} jibo The jibo object.
* @param {Array.<number>} color The RGB LED color.
*/
/**
* Play sound
* @param {jibo} jibo The jibo object.
* @param {string} path The path to the sound file
* @return {Promise}
*/
/**
* Packs three individual rgb values into one 32 bit integer
* @param {number[]} rbgArray Array of [r,g,b] values (where each value is in range 0-255)
* @returns {number}
*/
/**
* Unpacks a 32 bit representation of an rgb value into three r g b values
* @param {number} rgbPacked a packed representation
* @returns {number[]}
*/

View File

@@ -0,0 +1,49 @@
/**
* Constructs (but does not init) Embodied Speech instance
*
* @param {EmbodiedDialog} _ed
*/
/**
* Initializes Embodied Speech instance
*
* @param {any} jibo instance
* @param {boolean} [debug=false] Toggle debug mode
* @param {EmbodiedOptions} [options] Embodied Speech will use to initialize with
* @param {AutoRuleConfig} [autoRuleConfig] Embodied Speech will use to initialize with
* @returns {Promise<void>} Resolved when completed initialization
*/
/**
* Speaks text using coordinated gestures/behaviors that a mix of
* auto-generated and user-defined behaviors.
*
* @param {String} textToSpeak The text that Jibo should speak.
* @param {SpeakOptions} speakOptions
* @param {AutoRuleConfig} autoRuleConfig
* @return {Promise<RequestStatus>} A promise that is resolved when Jibo is done speaking (naturally or stopped).
*/
/**
* Stop all current and future animations and TTS
*
* @return {Promise<void>}
*/
/**
* Update all resource roots (Base, Anim and Audio)
*
* @param {String} root new resourceRoot path
*/
/**
* Get current activity status of Embodied Speech
*
* @return {boolean} Whether or not Embodied Speech is currently processing a Speak request
*/
/**
* Retrieve a promise linked to the state Embodied Speech animation dispatch
*
* @return {Promise<void>} Promise providing the current state of Embodied Speech animation dispatch
*/

View File

@@ -0,0 +1,73 @@
/**
* Enum of Jibo's Embodied Speech Request statuses.
* @typedef jibo.embodied.speech#RequestStatus
* @prop SUCCEEDED
* @prop STOPPED
*/
/**
* Enum of Jibo's Embodied Speech Dispatch types
* @typedef jibo.embodied.speech#DispatchType
* @property {string} TTS Text-to-speech
* @property {string} ALL All types
*/
/**
* @description INTERNAL ONLY - Interface that encodes data necessary for instantiating an SSML Node
*/
/**
* @description Interface of the PlaybackData.
* @property [playbackGenerator] {Function} - Promise generator (function) that generates a Playback promise
* @property [playbackPr] {Promise<Playback>} - Promise resolved when Playback is ready (loaded)
* @property playbackDuration {number} - Duration of the animation in the Playback object
* @property playbackName {string} - Name of the animation in the Playback object
* @property playbackLayers {MetaLayerPresence} - MetaLayerPresence of the animation in the Playback object
*/
/**
* @description Interface of AttrFilter.
* @property allOf {string[]} - All attributes that must all be included
* @property someOf {string[]} - All attributes that at least one must be included
* @property noneOf {string[]} - All attributes that must not be included
* @property addAll {string[]} - All attributes that should be added (only relevant to layers= attribute)
*/
/**
* @description Interface of MetaLayerPresence.
* @property [Body] {boolean} Whether or not an animation has the Body meta layer
* @property [Screen] {boolean} Whether or not an animation has the Screen meta layer
* @property [Audio] {boolean} Whether or not an animation has the Audio meta layer
*/
/**
* @description Interface of RequestInfo
* @property type {RequestType} - Type of Asset request
* @property description {string} - Description of the Asset request
*/
/**
* Contruction and Speak options for the Jibo Embodied Speech system
* @memberof jibo.embodied.speech
* @interface SpeakOptions
* @property {boolean} [disableAutoRules=false] - Enable/disable AutoRules
* @property {jibo.embodied.speech#DispatchType} [DispatchComplete='ALL'] - When to resolve the jibo.embodied.speech#speak request
* @property {boolean} [enableLayerMerging=true] - Whether to allow animations that use different DOFs to blend
* @property {number} [frameBuffer=0] - Minimum amount of time (in ms) between animations
* @property {number} [assetRelativeEnd] - Amount of time (in ms) an Animation should be allowed to play beyond to TTS end of speech
* @property {boolean} [followedByListen] - Whether Speak request is immediately followed by Listen
*/
/**
* AutoRule configuration options for the Jibo Embodied Speech system
* @memberof jibo.embodied.speech
* @interface AutoRuleConfig
* @property {boolean} [interSentenceTiming=false] - Enable/disable InterSentenceTiming AutoRule
* @property {boolean} [intraSentenceTiming=false] - Enable/disable IntraSentenceTiming AutoRule
* @property {boolean} [hotWords=true] - Enable/disable HotWords AutoRule
* @property {boolean} [punctuation=true] - Enable/disable Punctuation AutoRule
* @property {boolean} [structure=false] - Enable/disable Structure AutoRule
* @property {boolean} [voice=true] - Enable/disable Voice AutoRule
* @property {boolean} [beat=true] - Enable/disable Beat AutoRule
* @property {boolean} [themeRheme=false] - Enable/disable ThemeRheme AutoRule
*/

View File

@@ -0,0 +1,46 @@
/**
* Takes Node (XML) attributes and creates a RequestInfo object from them
*
* @param {Map<string, AttType>} att - Map of attributes to their data
* @returns {RequestInfo}
*/
/**
* Takes a comma separated string of filtering categories and modifies the provided
* categories list with the categories we want filtered at runtime
*
* @param {AttType} requestedCategoriesIntent - comma separated string of requested Layers
* @param {AttrFilter} categoryFilter - categories we want to be filtered at runtime (if any)
*/
/**
* Takes a comma separated string of filtering attributes and modifies the provided
* MetaFilter object with the list of attributes we want filtered at runtime (may contain dupes)
*
* @param {string} filterAttr - comma separated string
* @param {MetaFilter} metaFilter - meta terms we want filtered at runtime (if any)
*/
/**
* Parses a term within a query and returns the constituent parts
*
* @param {string} term - Individual part of a larger query
* @returns {Array<string, string[]>} - Parsed term containing OP and ATTRS
*/
/**
* Takes a comma separated string of filtering requested meta terms and modifies the provided
* MetaFilter object with the unified set of meta we want filtered at runtime
*
* @param {string} reqFiltered - comma separated string of requested Meta
* @param {MetaFilter} metaFilter - meta terms we want filtered at runtime (if any)
*/
/**
* Takes a comma separated string of filtering requested layers terms and modifies the provided
* two MetaLayerPresence objects describing which sets of layers we will add/subtract at runtime
*
* @param {AttType} requestedLayersIntent - comma separated string of requested Layers
* @param {MetaLayerPresence} layers - layers we want to be filtered at runtime (if any)
* @param {MetaLayerPresence} layersToAdd - layers we want to be added at runtime (if any)
*/

View File

@@ -0,0 +1,6 @@
/**
* Check a given input string of text for containing restricted words
* @param {string} sentence - String to have restricted words replaced
* @param {string} replacement - Replacement string to swap in
* @returns {string} String with all replacements swapped in
*/

View File

@@ -0,0 +1,3 @@
/**
* @private
*/

View File

@@ -0,0 +1,209 @@
/**
* The group of tags that are acted upon/turned into their own Node types
*/
/**
*
* @param {Jibo} jibo the jibo singleton
*/
/**
* Takes a text string sentence (optionally annotated with XML) and converts
* it into a "pre-input tree" -- a more processed intermediary tree used by
* other parts of the pipeline
*
* @param {String} sentence A text sentence optionally annotated with XML.
* e.g. `Mary had a <anim cat="emphasis">little</anim> lamb.`
* @param {boolean} [censorSwears=true] Swap out swears for a set of tags that act as a censor
* @return {TagTreeNode} Parsed word tree structure
*/
/**
* Given all matching TimelineAutoRuleData, insert the timeline modifying autoRule assets into the
* XML tree representation of the text.
*
* @param {TagTreeNode} xmlTree
* @param {TimelineAutoRuleData} timelineAutoRuleData
*/
/**
* Merges pre-input with nlp tree and produces an 'Input Tree' which splits
* on blocking nodes and only contains TTS and ANIM top level nodes
* @param {Node} inputTree that contains all the tag XML hierarchy
* @param {Node} nlpTree that contains the word information
* @return {Node} InputTree
*/
/**
* Create a new subtree with supplied root and list of Nodes
*
* @param {Node} root of sew subTree
* @param {Node[]} nodesToAdd
* @return {Node} Newly created subtree
*/
/**
* Checks whether a tag's type is 'asset' (i.e. an animation or sound).
*
* @param {Node} node to check
* @return {Boolean} Whether the supplied node is asset.
*/
/**
* Checks whether a tag is empty (i.e. it has no children).
*
* @param {Node} node to check
* @return {Boolean} Whether the supplied node is blocking.
*/
/**
* Checks whether a tag is blocking (e.g. a blocking animation or sound).
*
* @param {Node} node to check
* @return {Boolean} Whether the supplied node is blocking.
*/
/**
* Checks whether a tag is unbounded non-blocking (e.g. an empty non-blocking animation or sound).
*
* @param {Node} node to check
* @return {Boolean} Whether the supplied node is unbounded and non-blocking.
*/
/**
* Checks whether a tag is explicitly non blocking (i.e. nonBlocking=true attribute).
*
* @param {Node} node to check
* @return {Boolean} Whether the supplied node is blocking.
*/
/**
* Checks whether a node/tag's type is SSML.
*
* @param {Node} node to check
* @return {Boolean} Whether the supplied node is SSML.
*/
/**
* Checks whether a node/tag's type is an SSML that has inherent timing value.
*
* @param {Node} node to check
* @return {Boolean} Whether the supplied node is SSML.
*/
/**
* Checks whether a node/tag's type is an SSML that has no inherent timing value.
*
* @param {Node} node to check
* @return {Boolean} Whether the supplied node is SSML.
*/
/**
* Checks whether a node/tag's type is SSML Break.
*
* @param {Node} node to check
* @return {Boolean} Whether the supplied node is SSML.
*/
/**
* Checks whether a node/tag's type is SSML Phoneme.
*
* @param {Node} node to check
* @return {Boolean} Whether the supplied node is SSML Phoneme.
*/
/**
* Checks whether a node/tag's type is SSML Pitch.
*
* @param {Node} node to check
* @return {Boolean} Whether the supplied node is SSML Pitch.
*/
/**
* Checks whether a node/tag's type is SSML Duration.
*
* @param {Node} node to check
* @return {Boolean} Whether the supplied node is SSML Duration.
*/
/**
* Checks whether a node/tag's type is SSML SayAs.
*
* @param {Node} node to check
* @return {Boolean} Whether the supplied node is SSML SayAs.
*/
/**
* Checks whether a node/tag's type is SSML Style.
*
* @param {Node} node to check
* @return {Boolean} Whether the supplied node is SSML Style.
*/
/**
* Checks whether a node/tag's type is SSML Engine.
*
* @param {Node} node to check
* @return {Boolean} Whether the supplied node is SSML Engine.
*/
/**
* Returns the text array contained within the tree.
*
* @param {Node} tree The XML tree to transform into a string.
* @return {string[]} Array of text that composed of the tree's leaf node
* values.
*/
/**
* Returns the text contained within the tree without any XML tags.
*
* @param {Node} tree The XML tree to transform into a string.
* @return {String} A plain text string composed of the tree's leaf node
* values.
*/
/**
* Returns the text (with SSML) contained within the tree.
*
* @param {Node} tree The XML tree to transform into a string.
* @return {String} A plain text string composed of the tree's leaf node
* values.
*/
/**
* Returns the text (with SSML) contained within array of text nodes.
*
* @param {Node[]} textNodes The text nodes to transform into a string
* @param {boolean} [prune=false] option to drop breaks that precede/succeed non-SSML text
* @return {String} A plain text string composed of the array
*/
/**
* Returns the text (with SSML) contained within array of text nodes.
* ! Mutates !
*
* @param {Node} nodes Node to stringify
* @param {string[]} stringified Properly stringified node results of current call
* @return {Node} Terminal node
* @private
*/
/**
* Replaces a node's text nodes with another tree's text nodes. The result
* is two trees sharing the same text node instances.
* @param {Node} sourceTree The tree with text nodes to retain.
* @param {Node} destinationTree The tree with text nodes to replace.
* @param {Boolean} optMatchWords Ensure that the words from both trees are
* matching.
* @return {Node} The destination with the child text nodes replaced.
*/
/**
* Converts an annotation tree to a list of words.
*
* @param {Node} annotationTree The tree with tag annotations and words
* as their children.
* @param {Boolean} ssml Whether the returned list should include SSML tags
* @return {Node[]} List of word nodes.
*/

View File

@@ -0,0 +1,28 @@
/**
* @param {String} ruleName the tag name for this behavior
* @param {Number} priority priority of rule with respect to other rules
* @param {Number} probability probability of occurrence of rule
*/
/**
* Applies this rule and produces a list of lists of consecutive word nodes
* which should have this rule applied to them
* @param {Node} nlpTreeRoot
* @param {Node[]} [otherRoots]
* @return {Node[][]}
* @private
*/
/**
* Creates a node of type that is appropriate for this rule. The node should have
* no children as those will be added later
* @returns {Node}
* @private
*/
/**
* Applies this rule and produces an output tree
* @param {Node} nlpTreeRoot
* @param {Node[]} [otherRoots]
* @return {Node}
*/

View File

@@ -0,0 +1,22 @@
/**
* Retrieves the HotWords mapping from `jibo-anim-db-animations`
*
* @return {string}
*/
/**
* Applies a list of rules to an NLP tree generating a list of output trees.
*
* @param {Node} nlpTreeRoot
* @param {AutoRuleConfig} autoRuleConfig
* @return {Node[]}
*/
/**
* Applies a list of rules (if they were requested by the AutoRuleConfig) to an XML tree
* generating a list of output trees.
*
* @param {TagTreeNode} xmlTree
* @param {AutoRuleConfig} autoRuleConfig
* @return {TimelineAutoRuleData[]}
*/

View File

@@ -0,0 +1,31 @@
/**
* Subrules that compose the larger AutoRules
*/
/**
* Utility class that houses a number of useful functions for AutoRules
*/
/**
* Extracts the last words in a sentence, choosing either all the words
* in the last sentence part, or if it contains a verb then the verb and
* all following words
* @param {Node} sentenceNode
* @return {List} list of consecutive word nodes
*/
/**
* Extracts the sections of a sentence segmented by a given segment-er
*
* @param {string[]} segmenters
* @param {Node} sentenceNode
* @param {boolean} [keepPunct=false]
* @return {Node[]}
*/
/**
* Remove all words from an array of WordNodes that are expansions of contractions
*
* @param {WordNode[]} words
* @return {WordNode[]}
*/

View File

@@ -0,0 +1,13 @@
/**
* @param {Number} priority priority of rule with respect to other rules
* @param {Number} probability probability of occurrence of rule
*/
/**
* Applies this rule and produces a list of lists of consecutive word nodes
* which should have this rule applied to them
* @param {Node} nlpTreeRoot
* @param {Node[]} [otherRoots]
* @return {Node[][]}
* @private
*/

View File

@@ -0,0 +1,13 @@
/**
* @param {Number} priority priority of rule with respect to other rules
* @param {Number} probability probability of occurrence of rule
*/
/**
* Applies this rule and produces a list of lists of consecutive word nodes
* which should have this rule applied to them
* @param {Node} nlpTreeRoot
* @param {Node[]} [otherRoots]
* @return {Node[][]}
* @private
*/

View File

@@ -0,0 +1,13 @@
/**
* @param {Number} priority priority of rule with respect to other rules
* @param {Number} probability probability of occurrence of rule
*/
/**
* Applies this rule and produces a list of lists of consecutive word nodes
* which should have this rule applied to them
* @param {Node} nlpTreeRoot
* @param {Node[]} [otherRoots]
* @return {Node[][]}
* @private
*/

View File

@@ -0,0 +1,13 @@
/**
* @param {Number} priority priority of rule with respect to other rules
* @param {Number} probability probability of occurrence of rule
*/
/**
* Applies this rule and produces a list of lists of consecutive word nodes
* which should have this rule applied to them
* @param {Node} nlpTreeRoot
* @param {Node[]} [otherRoots]
* @return {Node[][]}
* @private
*/

View File

@@ -0,0 +1,26 @@
/**
* Attribute keys utilized by the but rule to keep track of the positional/counts of but elements
*/
/**
* Keys file names utilized by the but rule
*/
/**
* Number of words on either side of a "but" that we want to wrap in animation
*/
/**
* @param {jibo} jibo
* @param {Number} priority priority of rule with respect to other rules
* @param {Number} probability probability of occurrence of rule
*/
/**
* Applies this rule and produces a list of lists of consecutive word nodes
* which should have this rule applied to them
* @param {Node} nlpTreeRoot
* @param {Node[]} [otherRoots]
* @return {Node[][]}
* @private
*/

View File

@@ -0,0 +1,14 @@
/**
* @param {jibo} jibo
* @param {Number} priority priority of rule with respect to other rules
* @param {Number} probability probability of occurrence of rule
*/
/**
* Applies this rule and produces a list of lists of consecutive word nodes
* which should have this rule applied to them
* @param {Node} nlpTreeRoot
* @param {Node[]} [otherRoots]
* @return {Node[][]}
* @private
*/

View File

@@ -0,0 +1,13 @@
/**
* @param {Number} priority priority of rule with respect to other rules
* @param {Number} probability probability of occurrence of rule
*/
/**
* Applies this rule and produces a list of lists of consecutive word nodes
* which should have this rule applied to them
* @param {Node} nlpTreeRoot
* @param {Node[]} [otherRoots]
* @return {Node[][]}
* @private
*/

View File

@@ -0,0 +1,13 @@
/**
* @param {Number} priority priority of rule with respect to other rules
* @param {Number} probability probability of occurrence of rule
*/
/**
* Applies this rule and produces a list of lists of consecutive word nodes
* which should have this rule applied to them
* @param {Node} nlpTreeRoot
* @param {Node[]} [otherRoots]
* @return {Node[][]}
* @private
*/

View File

@@ -0,0 +1,13 @@
/**
* @param {Number} priority priority of rule with respect to other rules
* @param {Number} probability probability of occurrence of rule
* @param {Map<number, Map<string, string[]>>} hotWordMap mapping of HotWords to their animations
*/
/**
* Applies this rule and produces a list of lists of consecutive word nodes
* which should have this rule applied to them
* @param {Node} nlpTreeRoot
* @return {Node[][]}
* @private
*/

View File

@@ -0,0 +1,14 @@
/**
* @param {jibo} jibo
* @param {Number} priority priority of rule with respect to other rules
* @param {Number} probability probability of occurrence of rule
*/
/**
* Applies this rule and produces a list of lists of consecutive word nodes
* which should have this rule applied to them
* @param {Node} nlpTreeRoot
* @param {Node[]} [otherRoots]
* @return {Node[][]}
* @private
*/

View File

@@ -0,0 +1,30 @@
/**
* Keys utilized by the list rule to keep track of the subrule information
*/
/**
* Keys file names utilized by the list rule
*/
/**
* @param {jibo} jibo
* @param {Number} priority priority of rule with respect to other rules
* @param {Number} probability probability of occurrence of rule
*/
/**
* Applies this rule and produces a list of lists of consecutive word nodes
* which should have this rule applied to them
*
* @param {Node} nlpTreeRoot
* @param {Node[]} [otherRoots]
* @return {Node[][]}
* @private
*/
/**
* Adds some metadata to nodes that are apart of the list (for later list rule use)
*
* @param {Node[][]} listSegments
* @private
*/

View File

@@ -0,0 +1,18 @@
/**
* Nouns that are exempt from the noun rule
*/
/**
* @param {Number} priority priority of rule with respect to other rules
* @param {Number} probability probability of occurrence of rule
*/
/**
* Applies this rule and produces a list of lists of consecutive word nodes
* which should have this rule applied to them
*
* @param {Node} nlpTreeRoot
* @param {Node[]} [otherRoots]
* @return {Node[][]}
* @private
*/

View File

@@ -0,0 +1,26 @@
/**
* Attribute keys utilized by the or rule to keep track of the positional/counts of or elements
*/
/**
* Keys file names utilized by the or rule
*/
/**
* Number of words on either side of an "or" that we want to wrap in animation
*/
/**
* @param {jibo} jibo
* @param {Number} priority priority of rule with respect to other rules
* @param {Number} probability probability of occurrence of rule
*/
/**
* Applies this rule and produces a list of lists of consecutive word nodes
* which should have this rule applied to them
* @param {Node} nlpTreeRoot
* @param {Node[]} [otherRoots]
* @return {Node[][]}
* @private
*/

View File

@@ -0,0 +1,13 @@
/**
* @param {Number} priority priority of rule with respect to other rules
* @param {Number} probability probability of occurrence of rule
*/
/**
* Applies this rule and produces a list of lists of consecutive word nodes
* which should have this rule applied to them
* @param {Node} nlpTreeRoot
* @param {Node[]} [otherRoots]
* @return {Node[][]}
* @private
*/

View File

@@ -0,0 +1,13 @@
/**
* @param {Number} priority priority of rule with respect to other rules
* @param {Number} probability probability of occurrence of rule
*/
/**
* Applies this rule and produces a list of lists of consecutive word nodes
* which should have this rule applied to them
* @param {Node} nlpTreeRoot
* @param {Node[]} [otherRoots]
* @return {Node[][]}
* @private
*/

View File

@@ -0,0 +1,13 @@
/**
* @param {Number} priority priority of rule with respect to other rules
* @param {Number} probability probability of occurrence of rule
*/
/**
* Applies this rule and produces a list of lists of consecutive word nodes
* which should have this rule applied to them
* @param {Node} nlpTreeRoot
* @param {Node[]} otherRoots
* @return {Node[][]}
* @private
*/

View File

@@ -0,0 +1,20 @@
/**
* @param {Number} priority priority of rule with respect to other rules
* @param {Number} probability probability of occurrence of rule
*/
/**
* Create AssetNode with ellipsis animation and gather insertion information
*
* @param {TimelineAutoRuleMatchInfo} matchInfo
* @return {Array<Node, TimelineAutoRuleInsertionInfo>}
* @private
*/
/**
* Gathers all nodes that contain ellipsis
*
* @param {TagTreeNode} xmlTree
* @return {Array<Array<Node, string>>} Nodes that match and which rule was matched
* @private
*/

View File

@@ -0,0 +1,21 @@
/**
* @param {jibo} jibo
* @param {Number} priority priority of rule with respect to other rules
* @param {Number} probability probability of occurrence of rule
*/
/**
* Create (possibly nested) set of SSML Nodes as prescribed in the emotionToVoiceConfig map
*
* @param {TimelineAutoRuleMatchInfo} matchInfo
* @return {Array<Node, TimelineAutoRuleInsertionInfo>}
* @private
*/
/**
* Gathers all nodes that are wrappable with a TTSSML Style tag (which is either all or none)
*
* @param {TagTreeNode} xmlTree
* @return {Array<Array<Node, string>>} Nodes that match and which rule was matched
* @private
*/

View File

@@ -0,0 +1,20 @@
/**
* @param {Number} priority priority of rule with respect to other rules
* @param {Number} probability probability of occurrence of rule
*/
/**
* Create TTSNode with ellipsis animation and gather insertion information
*
* @param {TimelineAutoRuleMatchInfo} matchInfo
* @return {Array<Node, TimelineAutoRuleInsertionInfo>}
* @private
*/
/**
* Gathers all nodes that contained with an exclamation sentence
*
* @param {TagTreeNode} xmlTree
* @return {Array<Array<Node, string>>} Nodes that match and which rule was matched
* @private
*/

View File

@@ -0,0 +1,41 @@
/**
* Minimum duration for a period pause inserted by AutoRules
*/
/**
* Maximum duration for a period pause inserted by AutoRules
*/
/**
* Duration for a question pause inserted by AutoRules
*/
/**
* Duration for a exclamation pause inserted by AutoRules
*/
/**
* Duration for an "ellipsis" pause inserted by AutoRules
*/
/**
* @param {Number} priority priority of rule with respect to other rules
* @param {Number} probability probability of occurrence of rule
*/
/**
* Create SSML/break node and gather insertion information
*
* @param {TimelineAutoRuleMatchInfo} matchInfo
* @return {Array<Node, TimelineAutoRuleInsertionInfo>}
* @private
*/
/**
* Gathers all nodes that match any of the punctuation related to the InterSentence timing rule (i.e. ., ?, !)
*
* @param {TagTreeNode} xmlTree
* @param {boolean} doPunctuation If only the timing aspects related to the ellipsis autoRule are desired
* @return {Array<Array<Node, string>>} Nodes that match and which subrule was matched
* @private
*/

View File

@@ -0,0 +1,28 @@
/**
* Duration for a "but" pause inserted by AutoRules
*/
/**
* Duration for an "or" pause inserted by AutoRules
*/
/**
* @param {Number} priority priority of rule with respect to other rules
* @param {Number} probability probability of occurrence of rule
*/
/**
* Create SSML/break node and gather insertion information
*
* @param {TimelineAutoRuleMatchInfo} matchInfo
* @return {Array<Node, TimelineAutoRuleInsertionInfo>}
* @private
*/
/**
* Gathers all nodes that match any of the punctuation related to the IntraSentence timing rule (i.e. or, but, ...)
*
* @param {TagTreeNode} xmlTree
* @return {Array<Array<Node, string>>}
* @private
*/

View File

@@ -0,0 +1,36 @@
/**
* @param {String} ruleName the tag name for this behavior
* @param {TimelineAutoRuleType} ruleType the type of this behavior
* @param {Number} priority priority of rule with respect to other rules
* @param {Number} probability probability of occurrence of rule
*/
/**
* Applies this rule and produces a list of "tuples" containing information about what node
* matches the rule and what rule was matched.
*
* @param {Node} xmlTree
* @param {any} context
* @return {Array<Array<Node,any>>}
* @private
*/
/**
* Creates a "tuple" consisting of the parent node we will be inserting under as well as
* the node and any placement information.
*
* @param {TimelineAutoRuleMatchInfo} matchInfo
* @returns {Array<Node, TimelineAutoRuleInsertionInfo>}
* @private
*/
/**
* Applies this rule and a TimelineAutoRuleData object which gives information on:
* - What rule matches
* - Some info about that rule (e.g. priority)
* - Where the rule matched and the node to insert at those matches
*
* @param {TagTreeNode} xmlTree
* @param {any} [context] Any contextual information a rule might need to properly apply the rule
* @return {TimelineAutoRuleData}
*/

View File

@@ -0,0 +1,54 @@
/**
* Wrapper interface that contains necessary information for TimelineAutoRule match
*/
/**
* Types of Timeline-modifying auto rules
*/
/**
* Types of Blink nodes
*/
/**
* Node, insertion offset information and optional children of said to-be-inserted node
*/
/**
* Node, sub-rule and optional children associated with matching rule
*/
/**
* Utility class that houses a number of useful functions for Timeline Modifying AutoRules
*/
/**
* Create a break node of a given size (duration)
*
* @param {number} size
* @return {Node} SSML/Break node
*/
/**
* Create a blink node of a given type (single, double)
*
* @param {BlinkNodeType} type
* @return {AssetNode} Asset node
*/
/**
* Create an SSML node of a given type and attribute combination
*
* @param {SSMLNodeType} type
* @param {Object} attrs of type { [x: string]: AttType }
* @return {SSMLNode} SSML node
*/
/**
* Given a node to insert and a sibling to the node we want to insert, get the parent and placement (index) information
*
* @param {Node} nodeToInsert
* @param {Node} siblingNode
* @param {number} offset
* @return {Array<Node, TimelineAutoRuleInsertionInfo>} Parent node to the node we will be inserting, the node to be inserted and placement info
*/

View File

@@ -0,0 +1,13 @@
/**
* @param {string|string[]} input Text string to generatePreInputTree into tree.
* @param {string[]} expansions
* @param {string[]} contractions
* @return {Node}
*/
/**
* @param {string[]} words words to generatePreInputTree into tree.
* @param {string[]} expansions
* @param {string[]} contractions
* @return {Node}
*/

View File

@@ -0,0 +1,20 @@
/**
* This method inspects the input node and if it is of type NLPNodeType.WORD
* it adds it as child to out, otherwise it adds all descendants of node that
* have type NLPNodeType.WORD as children to out
* @param {Node} node Input node
* @param {Node} out Output node
*/
/**
* Takes a verb part node and breaks its word children into
* pre-verbal, verbal, and post-verbal parts
* @param {Node} vp
* @param {Node} preV
* @param {Node} V
* @param {Node} postV
*/
/** @enum {String} */
/** @enum {String} */

View File

@@ -0,0 +1,6 @@
/**
* Plays a Playback object and adds it to the playing keys list
*
* @param {Playback} Playback
* @return {Promise<any>} Promise to be resolved when playback is complete
*/

View File

@@ -0,0 +1,36 @@
/**
* Insert a TimelineFrame into the current TimelineLayer (if nothing currently occupies
* that time slot which is already utilizing the requested DOFs of the robot)
*
* @param {TimelineFrame} pendingFrame TimelineFrame to be inserted (if possible)
* @param {boolean} [withBuffer=false] Toggle to respect the frameBuffer when inserting
* @param {boolean} layerMergeOverride Value to override the initialized layerMerging value with
* @return {boolean} Success or failure to insert thea supplied TimelineFrame
*/
/**
* Given a MetaLayerPresence, yield an integer representation of those layers (derived from a bit array)
*
* @param {MetaLayerPresence} metaLayerPresence
* @return {Number} Integer representation of the summation of the Layers as bits
*/
/**
* Gather all TimelineFrames that are present at the same time as the supplied TimelineFrame
*
* @param {TimelineFrame} pendingFrame TimelineFrame to be (possibly) inserted
* @param {boolean} useBuffer Toggle to respect the frameBuffer when inserting
* @return {TimelineFrame[]} Possibly conflicting frames
*/
/**
* Insert TimelineFrame into the TimelineLayer
*
* @param {TimelineFrame} pendingFrame TimelineFrame to be inserted
*/
/**
* Initialize a Timeline with TTS timing data
*
* @param {TTSFrame[]} ttsFrames Timing data for each TTS subsection
*/

View File

@@ -0,0 +1,129 @@
/**
* Takes an InputTree and AutoTagTree and generates a Timeline composed of sound, animation and
* TTS for later dispatch
*
* @param {Node} inputTree containing all user provided tag and NLP information
* @param {SpeakOptions} options related to how the timeline should be constructed / expressed
* @param {Node[]} autoTagTrees which contain which autorules match what word nodes
* @return {Promise<Timeline>} Complete timeline of tts with requested and auto anims/sounds
*/
/**
* Takes an InputTree and creates a Timeline composed of requested sound, animation and TTS
*
* @param {Node} inputTree Itemized timing data retrieved from TTS service
* @return {Node} pre-processed InputTree
*/
/**
* Takes a Sound object, parses it for duration, builds an Animation around it and returns the metadata
*
* @param {any} loadedSound Sounds referenced in <audio path='...' /> tag
* @param {String} audioPath path to the audio file
* @param {Node} node Asset node associated with the asset (anim) data
* @param {Map<Node, Anim>} cachedAssetMap structure that holds cached animData objects
* @return {AnimMetadata}
*/
/**
* Takes an InputTree and creates a Timeline composed of requested sound, animation and TTS
*
* @param {Node} inputTree Itemized timing data retrieved from TTS service
* @param {SpeakOptions} options related to how the timeline should be constructed / expressed
* @return {Promise<Timeline, Map<Node, TimeBounds>>} Timeline (before AutoRules) and WordSchedule
*/
/**
* Take in computed BREAK tag data and build an SSML node
*
* @param {number} size Length of the newly computed BREAK tag/node
* @return {SSMLNode} SSML node that represents the break to be
*/
/**
* Attempt to find an asset given the provided Node (and optional TimeBounds) data
*
* @param {AssetNode} node Asset node that contains the information for resolving Asset
* @param {number} [durationSeconds] Optional duration (in seconds) the asset must be contained within
* @param {boolean} [randomizeOrient] Optional toggle to turn on the randomization of the resolved animation's orientation
* @param {string} [cache] Optional cache to use other than the default
* @return {AssetResolution} Object containing if the asset was resolved,
* and identifying info if it wasn't
*/
/**
* Finds the animation in a set of animation that fits into a given duration optimally
*
* @param {Animation[]} candidates = The set of animations that we are searching through
* @param {number} durationFramesToFill - How much time we need to fill by looping
* @param {boolean} [allowMin] - Whether or not to allow the min duration of the animation as an option
* @return {OptimalLoopResult}}
*/
/**
* Generates both a MetaLayerPresence representations of the animations layers, taking into account the possible layer requests made in ESML
* and a MuteConfig, to express to the AnimConfig how to play the animation
*
* @param {Animation} anim Animation
* @param {AssetNode} node AssetNode
* @return {Array<MetaLayerPresence, MuteConfig>}
*/
/**
* Generates the initial timeline composed of TTS timing data
*
* @param {TTSSpeakData} ttsSpeakData Data containing all string to speak and speaking options
* @param {TTSTokenWord[]} tokenTimes TTS Token timings
* @param {SpeakOptions} options related to how the timeline should be constructed / expressed
* @param {boolean} [shouldPrune=false] If the TTS.speak call should be ended early
* @return {Array<Timeline, TTSTokenWord[]>} Initialized Timeline and updated TTS Token timings
*/
/**
* Get the pruned version of the end time of a TTS text.
*
* @param {TTSTokenWord[]} tokenTimes TTS Token timings
*/
/**
* Takes in list of Word Nodes and TTS Token timings and merges them into one structure
*
* @param {Node[]} wordNodes Word nodes extracted from the InputTree
* @param {TTSTokenWord[]} tokenTimes TTS Token timings
* @param {SpeakOptions} options related to how the timeline should be constructed / expressed
* @return {Map<Node, TimeBounds>} Start and stop time of each WordNode
*/
/**
* Takes an InputTree and populates layers (e.g. Animation and Sound) of supplied Timeline
*
* @param {Node} inputTree InputTree containing all input information
* @param {Timeline} timeline In-progress Timeline with only TTS layer
* @param {Map<Node, TimeBounds>} wordSchedule holds the time bounds for each word node
* @return {Timeline} Timeline with non-TTS layers merged into it
*/
/**
* Takes in AutoTagTrees and creates a prioritized map of TimelinesFrames
*
* @param {Node[]} autoTagTrees which contain which auto-rules match what word nodes
* @param {Map<Node, TimeBounds>} wordSchedule holds the time bounds for each word node
* @param {Timeline} timeline In-progress Master Timeline
* @return {Map<number, AutoRuleMatch[][]>} Priority map of timeline frames generated by auto-rules
*/
/**
* Finds the first and last children word(s) nodes of the supplied node for Timing
*
* @param {Node} node parent of the children being gathered
* @param {Map<Node, TimeBounds>} wordSchedule holds the time bounds for each word node
* @return {TimeBounds} start/stop time of the first/last child nodes
*/
/**
* Takes a prioritized Map of TimelineFrames to be merged with supplied (Master) Timeline
*
* @param {Map<number, AutoRuleMatch[][]>} pending: auto-rule generated assets
* @param {Timeline} timeline In-progress master Timeline
* @return {Timeline} Completed timeline
*/

View File

@@ -0,0 +1,39 @@
/**
* @param {String} str String value to validate against.
* @return {Boolean} Whether or not the string is punctuation.
*/
/**
*
*
* @param {String} text Text with contraction.
* @return {Array<String[], String[]>} text Text with contractions expanded.
*/
/**
* Expands word contractions by rule
*
* @param {String} text Text with contraction.
* @return {String} text Text with contractions expanded.
*/
/**
* Checks to see if string has a contraction.
*
* @param {String} text String containing possible contraction(s)
* @return {Boolean} Whether the supplied string contains contraction(s)
*/
/**
* Sanitizes string inputs for processing.
*
* @param {String} str Input string to sanitize.
* @return {String} Sanitized text string.
*/
/**
* Converts an array of words into a sentence string.
*
* @param {Array.<String>} wordArray Array of words and punctuation.
* @return {String} A sentence comprised of the words (and punctuation).
*/

View File

@@ -0,0 +1,15 @@
/**
* Validates requested SpeakOptions and reverts to provided validated option values (when not provided)
*
* @param {SpeakOptions} validatedOptions Validated default options
* @param {SpeakOptions} [speakOptions] Options pertaining to each ES speak
* @return {SpeakOptions} Merged incoming options with Validated speak options
*/
/**
* Validates requested AutoRuleConfig and defaults to provided validated config values (when none provided)
*
* @param {AutoRuleConfig} validatedConfig Validated default config
* @param {AutoRuleConfig} [autoRuleConfig] Config pertaining to each ES speak
* @return {AutoRuleConfig} Merged incoming config with Validated config
*/

View File

@@ -0,0 +1,22 @@
/**
* Converts a number in seconds to milliseconds
*
* @param {number} seconds in seconds
* @return {number} timespan in milliseconds
*/
/**
* Converts a number in milliseconds to seconds
*
* @param {number} seconds in milliseconds
* @return {number} timespan in seconds
*/
/**
* Load animation(s) into cache
*
* @param {jibo} jibo Jibo runtime instance
* @param {string|AnimQuery} query Name of animation or AnimQuery
* @param {string} cacheName Name of cache to load animation into
* @return {Promise} The promise resolved when animation(s) have been cached
*/