Files
JiboOs/docs/plugins/context/api.js
2026-03-16 13:53:01 +02:00

138 lines
5.0 KiB
JavaScript

/**
* 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
*/