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,46 @@
/**
* Initialize the error service module for `jibo.init`.
* @method jibo.errors#init
* @param service {Object} The service options
* @param service.host {String} host name
* @param service.port {String} port number
* @param callback {Function} callback
*/
/**
* Get the id for the current error or null if there is no error active
* @method jibo.errors#getCurrentErrorId
* @param callback {Function} The callback which returns either an error or the currentErrorId (null if no active error)
*/
/**
* Get how many errors are currently entered in the error service priority queue.
* This includes the current error
* @method jibo.errors#getErrorCount
* @param callback {Function} The callback which returns either an error or the number of errors
*/
/**
* Subscribe to an error to get notified when your subscribed error is not / no longer the current error in the error service
* @method jibo.errors#subscribeError
* @param errorCode {string} The support error id string to subscribe to
* @param callback {Function} The callback which fires if the error is no longer the current error in the error service
* Passes an error as a parameter if a server side error occurs
* This callback is called either when:
* 1) the error gets resolved from the SSM Error Service (and removed from the priority queue)
* 2) one error is subscribed and then another error subscribes
* 3) the error is not present in the SSM Error Service priority queue (in which case it will resolve right away)
* 4) the client called processedError on the error it's subscribed to
*/
/**
* Mark an error for being processed in the SSM error service. This will move the error to the error rescheduler.
* The error will be removed from the error rescheduler if it is internally resolved.
* If the error is not internally resolved, the error rescheduler will reinsert the error into the priority queue (which may trigger the settings skill to relaunch)
* @method jibo.errors#processedError
* @param errorCode {string} The support error id string to process
* @param callback {Function} The callback which fires indicating the SSM error service has attempted to move the error to the error rescheduler
* The processedErrorObject field returns along with an error object
* This error object in the callback is populated if the error code is ommitted or if there is a communication problem with the SSM error service.
* If the error object is populated, the response data object will be null and vice versa
*/

View File

@@ -0,0 +1,11 @@
/**
* Send identity requests.
* @param path {String} HTTP path to specify identity request.
* @param data {Object} Options for the request.
* @param data.name {String} Name for the identity.
* @param [data.kind="face"] {String} Kind of identity data. (Currently ONLY supports "face".)
* @param cb {Function} Callback for the method.
* @param [httpUrlOverride] {String} Override the httpUrl (IP and port of the service)
* @method jibo.ics#_sendIdentityRequest
* @private
*/

View File

@@ -0,0 +1,200 @@
/**
* Queue of callbacks for calling demandDetect
* @name jibo.lps~demandDetectQueue
* @type {Array<Callback>}
* @private
*/
/**
* Keeps track of whether a demandDetect call sets redirect
* @name jibo.lps~_demandDetectRedetect
* @type {Boolean}
* @private
*/
/**
* Lighting quality around jibo's cameras
* @name jibo.lps~_lightingQuality
* @type {number}
* @private
*/
/**
* Lighting level around jibo's cameras
* @name jibo.lps~_lightingLevel
* @type {number}
* @private
*/
/**
* Sectors of Jibo's LPS, sorted by visibility
* @name jibo.lps~_sectors
* @type {Sector[]}
* @private
*/
/**
* @description
* Local Perceptual Space
*
* @namespace jibo.lps
*/
/**
* Service address.
* @name jibo.lps#httpUrl
* @type {string}
* @readOnly
* @private
*/
/**
* Return the full state of the Jibo's local perceptual space.
* @name jibo.lps#motionData
* @type {*|{cameras: Array, entities: Array}}
* @readOnly
*/
/**
* Return the full audio state of the Jibo's local perceptual space.
* @name jibo.lps#audioData
* @type {any}
* @readOnly
*/
/**
* Get recent lighting quality for jibo's cameras as averaged by 3 most visible sectors.
* [0,1] with 1 being highest quality, 0 being lowest.
* WARNING: for best results, must be used with platform >=5.1.0
* @name jibo.lps#lightingQuality
* @type {number}
*/
/**
* Get recent lighting level for jibo's cameras as averaged by 3 most visible sectors.
* [0,1] with 1 being highest lighting level, 0 being lowest.
* WARNING: for best results, must be used with platform >=5.1.0
* @name jibo.lps#lightingLevel
* @type {number}
*/
/**
* Callback for LPS Service
* @callback jibo.lps~Callback
* @param [err] {String | Error} String of error text, or null if success.
* @param [data] {any} Data of successful call. Varies by function.
*/
/**
* @description
* Local Perceptual Space Events
* Events that are emitted upon data received.
* Example usage:
* ```
* jibo.lps.events.audio.on(data => {
* console.log(data.entities.length);
* });
* ```
* @namespace jibo.lps.events
*/
/**
* Emits an event when new audio data is received from service.
* @name jibo.lps.events#audio
* @type {Event}
*/
/**
* Emits an event when new motion data is received from service.
* @name jibo.lps.events#motion
* @type {Event}
*/
/**
* Get the visual entity closest to Jibo.
* @method jibo.lps#getClosestVisualEntity
*
* @return The closest visual entity to Jibo. If one does not exist, returns undefined.
*/
/**
* Get a visual entity by specified ID.
* @method jibo.lps#getVisualEntityById
* @param id {Number} ID of the entity to get.
* @return The specified visual entity. If it does not exist, returns undefined.
*/
/**
* Get the closest audible entity to Jibo.
* @method jibo.lps#getClosestAudibleEntity
*
* @return The closest audible entity to Jibo. If one does not exist, returns undefined.
*/
/**
* Get an audible entity by specified ID.
* @method jibo.lps#getAudibleEntityById
* @param id {Number} ID of the entity to get.
* @return The specified audible entity. If it does not exist, returns undefined.
*/
/**
* Request camera calibration data
* @param {number} cameraID ID for camera to be used.
* @param {jibo.lps~Callback} cb Callback for the function which returns parsed data.
* @method jibo.lps#getCameraParameters
*/
/**
* Forces a one-shot full frame face detection and reports all faces detected
* @param {number} cameraID ID for camera to be used.
* @param {jibo.lps~Callback} cb Callback for the function which returns parsed data.
* @param {string} [kind=faces] Kind of entities to search for.
* @param {boolean} [initTracks=false] Hint to try to init the face ids which are tracked.
* @method jibo.lps#getFaces
*/
/**
* Force the LPS to run face detection on jibo's present field of vision.
* @param cameraID=0 {Number} (0|1) ID of Camera to run algorithm on.
* @param redetect=false {Boolean} Should redetect (rerun algorithm) until a face is detected.
* @param cb {jibo.lps~Callback} Callback with null error if detection algorithm ran, error otherwise. Results from face detection will only be represented through {@link jibo.lps#motionData}.
* @method jibo.lps#demandDetect
*/
/**
* Call and clear all demand detect callbacks with error, data
* @method jibo.lps~_clearDemandDetectCallbacks
* @param err {Error | string} Error to call callbacks with.
* @param data {any} Data to call callbacks with
* @private
*/
/**
* @description Barcode data object.
* @typedef {Object} jibo.lps~BarcodeData
* @property {int} type `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), or `10` (Code 128).
* @property {string} content Payload of the barcode data.
*/
/**
* Read barcode or QR code data.
* @method jibo.lps#readBarcode
* @param {Function} cb Callback for the function.
* @return {jibo.lps~BarcodeData} Barcode data object.
*/
/**
* Set a present person.
* @method jibo.lps#setPresence
* @param {jibo.lps.identity.PresenceRecord} presenceData Data to set around environment.
* @param {Function} cb Callback for the function.
*/
/**
* Extract information about jibo's visible sectors
* @method jibo.lps~_extractSectorInformatin
* @param {jibo.lps.Sector[]} sectors Raw sector data from websocket.
* @private
*/

View File

@@ -0,0 +1,46 @@
/** Interface (internal only)
* @interface jibo.media.MediaManager#AdoptRequest
* @property contentIDs {string[]} List of media content IDs saved to
* disk by jibo.media.MediaService#storePhoto to be adopted (moved
* from the media root dir into the upload/ directory) by the Media
* Manager.
* @property mediaType {MediaType} Type of the media to be adopted.
* @private
*/
/** Interface (internal only)
* @interface jibo.media.MediaManager#UploadRequest
* @property contentID {string}
* @property immediate {boolean}
* @property keepLocal {boolean}
* @property type {jibo.media.MediaManager#MediaType}
* @property reference {string}
* @private
*/
/** Interface (internal only)
* @interface jibo.media.MediaManager#DownloadRequest
* @property contentID {string}
* @property immediate {boolean}
* @property type {jibo.media.MediaManager#MediaType}
* @private
*/
/** Interface (internal only)
* @interface jibo.media.MediaManager#DeleteRequest
* @property contentID {string}
* @property immediate {boolean}
* @property deleteLocal {boolean}
* @property deleteRemote {boolean}
* @property type {jibo.media.MediaManager#MediaType}
* @private
*/
/** Enum of media types.
* @interface jibo.media.MediaManager#MediaType
* @property image {string} 'image'
* @property recording {string} 'recording'
* @property thumb {string} 'thumb'
* @property thumb_robot {string} 'thumb_robot'
* @property audio {string} 'audio'
*/

View File

@@ -0,0 +1,32 @@
/** Enum of photo types.
* @name jibo.media#PhotoType
* @type {Enum}
* @property DEBUG {Number} 0; 1/2-scale (640x360) grayscale.
* @property PREVIEW {Number} 1; 1/2-scale (640x360) color.
* @property HALF {Number} 1; alias for PREVIEW
* @property SNAP {Number} 2; Full-scale (1280x720) color. (default)
* @property FULL {Number} 2; alias for SNAP
* @property FOUR_MP {Number} 3; Four megapixel (2688x1520) color.
* @property LARGE {Number} 3; alias for FOUR_MP
*/
/** Enum of cameras.
* @name jibo.media#CameraID
* @type {Enum}
* @property LEFT {Number} 0; Left camera.
* @property RIGHT {Number} 1; Right camera. Default.
*/
/** @callback jibo.media.MediaService~PhotoCallback */
/** @callback jibo.media.MediaService~PhotoStoreCallback */
/** Internal implementation of stopRecording. This one is difference than the main
* implementation in that it doesn't throw errors when developers call it when
* no recording was in progress. This is used by startRecording(), which calls
* the robot media service to stop any rogue recording that might have been left running.
* TODO: The robot media service should auto timeout or support auto stopping when
* recording/start is called. Jira ticket here:
* https://jira.jibo.com/browse/PLATSVCS-758
* @private
*/

View File

@@ -0,0 +1,21 @@
/**
* Initialize the performance module for `jibo.init`.
* @method jibo.performance#init
* @param service {Object} The service options
* @param service.host {String} host name
* @param service.port {String} port number
* @param callback {Function} callback
*/
/**
* Post a log to the performance service.
* @method jibo.performance#log
* @param type {string} The event type
* @param description {string} Description
*/
/**
* Get the current time. Uses high precision timer.
* @method jibo.performance#now
* @returns {number} Milliseconds since epoch.
*/

View File

@@ -0,0 +1,20 @@
/**
* Initialize the error service module for `jibo.init`.
* @method jibo.secureTransferService#init
* @param service {Object} The service options
* @param service.host {String} host name
* @param service.port {String} port number
* @param callback {Function} callback
*/
/**
* A method to know whether or not we have backup data
* @method jibo.secureTransferService#hasBackupData
* @param callback {Function} callback - passes a bool via the callback params which signals if we have backup data
*/
/**
* Poll this method to know (via callback) if the UGC Key is ready in the SecureTransferService
* @method jibo.secureTransferService#isUGCKeyReady
* @param callback {Function} callback - passes a bool via the callback params which signals if the UGC key is ready
*/

View File

@@ -0,0 +1,38 @@
/** Arbitrary string identifying the type of data associated with this notification */
/** Notification channel name. One of: "GENERAL", "NETWORK", "POWER_MANAGEMENT", "HARDWARE_FAULT" */
/** chronometer timestamp associated with this notification */
/** type-specific notification data */
/**
* Notification emitted when the robot shuts down.
* @name jibo.systemManager#onShutdown
* @type {TypedEvent}
*/
/**
* getVersion - Gets current version of platform build if connected to robot (raw numbers xx.xx.xx).
* @method jibo.systemManager#getVersion
*
* @param {function} cb Callback that notifies the caller that the
* version was retrieved; If successful, returns version; otherwise, error string.
*/
/**
* getDisplayVersion - Gets current display-friendly version of platform build if connected to robot.
* @method jibo.systemManager#getDisplayVersion
*
* @param {function} cb Callback that notifies the caller that the
* version was retrieved; If successful, returns version; otherwise, error string.
*/
/**
* getIdentity - Gets the identity of the robot if connected.
* @method jibo.systemManager#getIdentity (object containing name, WiFi MAC address and serial number)
*
* @param {function} cb Callback that notifies the caller that the
* identity was retrieved; If successful, returns object containing name, MAC
* address and serial number; otherwise, error string.
*/

View File

@@ -0,0 +1,379 @@
/**
* Body state of Jibo
* @name jibo.system#bs
* @type {TypedEvent}
* @private
*/
/**
* http interface url to the body service
* @name jibo.system#bodyHttpInterface
* @type {string}
* @private
*/
/**
* http interface url to the audio service
* @name jibo.system#audioHttpInterface
* @type {string}
* @private
*/
/**
* WS url for body service
* @name jibo.system#socketUrl
* @type {string}
* @private
*/
/**
* The type of power source we're currently using.
* @name jibo.system#powerSource
* @type {jibo.system#PowerSource}
* @private
*/
/**
* The state of Jibo's hatch
* @name jibo.system#hatchOpen
* @type {boolean}
* @private
*/
/**
* Whether anything is externally moving jibo.
* @name jibo.system#isMoving
* @type {boolean}
* @private
*/
/**
* Input Energy sensed by body system.
* @name jibo.system~_inputEnergy
* @type {jibo.system#InputEnergy}
* @private
*/
/**
* Input Energy sensed by body system.
* @name jibo.system~miscSocket
* @type {jibo.system#InputEnergy}
* @private
*/
/**
* Input Energy sensed by body system.
* @name jibo.system~touchSocket
* @type {jibo.system#InputEnergy}
* @private
*/
/**
* Input Energy sensed by body system.
* @name jibo.system~powerSocket
* @type {jibo.system#InputEnergy}
* @private
*/
/**
* socket to get incoming information about motor axis
* @name jibo.system~axisSocket
* @type {WSclient}
* @private
*/
/**
* socket to get incoming information about Jibo's IMU State
* @name jibo.system~imuSocket
* @type {WSclient}
* @private
*/
/**
* Handler for head touch state and events
* @name jibo.system~touchHandler
* @type {jibo.system#TouchHandler}
* @private
*/
/**
* @description
* Non-motion-related robot body services (i.e. temperature, fan, battery, backlight, etc.).
*
* ```
* var jibo = require("jibo");
* jibo.system.getBatteryTemperature();
* ```
* @namespace jibo.system
*/
/**
* `true` if the robot is plugged in.
* @name jibo.system#pluggedIn
* @type {boolean}
*/
/**
* `true` if the robot's battery is charging.
* @name jibo.system#batteryCharging
* @type {boolean}
*/
/**
* Get the robot's charging rate.
* @name jibo.system#batteryChargeRate
* @type {number}
*/
/**
* Get the robot's current touch pad state.
* There is an array of 6 pads with `true` for touched and `false` for not touched.
* See {@tutorial robot-info-tool} for a diagram of Jibo's head touch pads.
* Three run vertically down the left side of Jibo's head from top to bottom: `pad_state[0, 1, 2]`.
* Three run vertically down the right of his head: `pad_state[3, 4, 5]`.
* @name jibo.system#padState
* @type {boolean[]}
*/
/**
* @description
* System events that are emitted upon data received.
*
* Example:
* ```
* jibo.system.events.touchChanged.on((data) => {
* console.log(data);
* });
* ```
* @class SystemEvents
* @memberof jibo.system
*/
/**
* Event for when the touch pad has changed states
* @name jibo.system.SystemEvents#touchChanged
* @type {TypedEvent}
* @readOnly
*/
/**
* Emitted audio input energy changes.
* @name jibo.system.SystemEvents#inputEnergy
* @type {TypedEvent}
* @readOnly
*/
/**
* A touch pad has been turned on, where previously all were off.
* WARNING: this refers to the local `touchOn` event, which is
* NOT used to stop Jibo. If you want to listen for the
* `touchStop` event AND clobber the stop behavior, please
* refer to {@link jibo.globalEvents#touchStop}.
* Emits array of pad state.
* @name jibo.system.SystemEvents#touchOn
* @type {TypedEvent}
* @readOnly
*/
/**
* All touch pads are off, where previously at least one was on.
* Emits array of pad state.
* @name jibo.system.SystemEvents#touchOff
* @type {TypedEvent}
* @readOnly
*/
/**
* Axis fault on. Emits name of axis that faulted.
* @name jibo.system.SystemEvents#axisFaultOn
* @type {TypedEvent}
* @readonly
*/
/**
* Axis fault has stopped. Emits that axis are all not faulting.
* @name jibo.system.SystemEvents#axisFaultOff
* @type {TypedEvent}
* @readonly
*/
/**
* Jibo's hatch has opened
* @name jibo.system.SystemEvents#hatchOpen
* @type {TypedEvent}
* @readonly
*/
/**
* Jibo's hatch has closed
* @name jibo.system.SystemEvents#hatchClose
* @type {TypedEvent}
* @readonly
*/
/**
* Jibo was just plugged in
* @name jibo.system.SystemEvents#pluggedIn
* @type {TypedEvent}
* @readonly
*/
/**
* Jibo was just unplugged
* @name jibo.system.SystemEvents#unplugged
* @type {TypedEvent}
* @readonly
*/
/**
* System Events
* @name jibo.system#events
* @type {jibo.system.SystemEvents}
*/
/**
* Get the robot's battery temperature.
* @method jibo.system#getBatteryTemperature
* @return {number} The temperature of the battery in degrees Celsius.
*/
/** Get the robot's battery level.
* @method jibo.system#getBatteryLevel
* @return {number} The current level of the battery as a percentage.
*/
/**
* Get the robot's system voltage.
* @method jibo.system#getSystemVoltage
* @return {number} The current system voltage estimate.
*/
/**
* Get the robot's main board temperature.
* @method jibo.system#getMainBoardTemperature
* @return {number} The temperature of the main board in degrees Celsius.
*/
/**
* Get the robot's CPU temperature.
* @method jibo.system#getCPUTemperature
* @return {number} The temperature of the CPU in degrees Celsius.
*/
/**
* Get the touch state of pads in Jibo's head.
* @method jibo.system#getTouchState
* @returns {jibo.system.TouchState} The state of Jibo's head touchpads.
*/
/**
* Get the robot's fan speed.
* @method jibo.system#getFanSpeed
* @param {Function} callback Notify the caller that the
* system data was received or that an error was encountered.
* If successful, return cooling fan speed as percentage of
* maximum (range [0.0, 1.0]).
*
*/
/**
* Get the robot's fan mode.
* @method jibo.system#getFanMode
* @param {Function} callback Notify the caller that the
* system data was received or that an error was encountered.
* If successful, return fan mode as a string.
*
*/
/**
* Get LCD backlight information.
* @method jibo.system#getBacklight
* @param {Function} callback Notify the caller that the
* system data was received or that an error was encountered.
* If successful, return the LCD backlight brightness
* in percentage of maximum (range [0.0, 1.0]).
*/
/**
* Set the LCD backlight brightness.
* @method jibo.system#setBacklight
* @param {Value} value Desired brightness of LCD backlight (range [0.0 - 1.0]).
* @param {Function} callback Notify the caller that the
* system data was received or that an error was encountered.
* If unsuccessful, return the error; otherwise, return 'null'.
*/
/**
* Get current master volume.
* @method jibo.system#getMasterVolume
* @param {Function} callback Notify the caller that the
* system data was received or that an error was encountered.
* If successful, return the master volume (range [0.0, 1.0]).
*/
/**
* Set the master volume.
* @method jibo.system#setMasterVolume
* @param {number} value Desired master volume (range [0.0 - 1.0]).
* @param {Function} cb Notify the caller that
* system data was received or that an error was encountered.
* If unsuccessful, return the error; otherwise, return `null`.
*/
/**
* Initializes the audio system.
* @param service {ServiceRecord} service record to initialize audio service.
* @param callback {Function} Callback for once socket has been created.
* @method jibo.system#initAudio
*/
/**
* Get mixer settings.
* @method jibo.system#_getMixerSetting
* @param {Function} cb Callback when complete.
* @private
*/
/**
* Create the WS to misc information
* @param callback {Function} Callback for once socket has been created
* @method jibo.system#_createMiscSocket
* @private
*/
/**
* Create the WS to touch information
* @param callback {Function} Callback for once socket has been created
* @method jibo.system#_createTouchSocket
* @private
*/
/**
* Create the WS to power information
* @param callback {Function} Callback for once socket has been created
* @method jibo.system#_createPowerSocket
* @private
*/
/**
* Create axis state socket for axis events.
* @method jibo.lps#_createAxisSocket
* @param {Function} cb Callback for once axis has been created.
* @private
*/
/**
* Create axis state socket for axis events.
* @method jibo.lps#_createIMUSocket
* @param {Function} cb Callback for once axis has been created.
* @private
*/
/**
* Get the current system setting for a given system
* @param {string} setting the setting to get the information for.
* @param {Function} callback Notify the caller that the robot was successfully indexed.
* If unsuccessful, return the error; otherwise, return the setting value.
* @method jibo.system#_getSystemSetting
* @private
*/

View File

@@ -0,0 +1,171 @@
/**
* @description
* Text-to-Speech
*
* ```
* var jibo = require("jibo");
* jibo.tts.on('word', (word) => {
* //respond to words
* });
* jibo.tts.speak("Hello, my name is Jibo", (err) => {
*
* });
* ```
* @namespace jibo.tts
*/
/**
* Enum for TTS modes.
* @typedef jibo.tts#TTSMode
* @property SSML {String} Advanced, allows use of SSML.
* @property TEXT {String} Default.
*/
/**
* Enum for TTS locales.
* @typedef jibo.tts#TTSLocale
* @property EN_US {String} US English.
*/
/**
* Enum for TTS "boolean" values.
* @typedef jibo.tts#TTSBoolean
* @property TRUE {String}
* @property FALSE {String}
*/
/**
* TTS Server API paths.
* {@link https://confluence.jibo.com/display/ENG/TTS+Service|TTS Service Docs}
* @private
* @enum {String}
*/
/**
* The various types of actions pedals can take.
* @private
* @enum {String}
*/
/**
* The various events this service will emit.
* @alias jibo.tts~PedalsEvents
* @enum {String}
*/
/**
* The default settings for a TTS request body
* @private
*/
/**
* The default settings for a POS request body
* @private
*/
/**
* Emitted when a word is spoken.
* @name jibo.tts#word
* @type {TypedEvent}
*/
/**
* Emitted when a phoneme event happens
* @name jibo.tts#phone
* @type {TypedEvent}
*/
/**
* Emitted when an effect event happens
* @name jibo.tts#effect
* @type {TypedEvent}
*/
/**
* Emitted when an analysis event happens
* @name jibo.tts#analysis
* @type {TypedEvent}
*/
/**
* Emitted when TTS stops
* @name jibo.tts#stopped
* @type {TypedEvent}
*/
/**
* Make Jibo speak.
* @method jibo.tts#speak
* @param {String} text Text for Jibo to speak.
* @param {Object} [options] Parameters to override default TTS behavior.
* @param {number} [options.duration_stretch] Stretch the utterance. 1 = no stretch, 0.5 = halve the duration, 2 = double the duration. No upper limit.
* No effect if `options.mode === jibo.tts.TTSMode.SSML`.
* @param {number} [options.pitch] Control the overall pitch of the speaker. No SSML tag to override
* Recommended value is 0.42. The recommended range is [0.2, 0.8].
* @param {number} [options.pitchBandwidth] Widen the pitch bandwidth. Recommended value is 1.
* The range is [0.0, 2.0]. `0` makes Jibo sound robotic. `2.0`
* makes Jibo sound more human.
* @param {jibo.tts~TTSMode} [options.mode] In `jibo.tts.TTSMode.SSML` mode, the `text` argument to this function should contain valid SSML. In text mode, the prompt can contain any text.
* @param {boolean} [options.skipWordEvents=false] If `true`, no word events are emitted during TTS synthesis.
* @param {Function} [callback] Notify the caller that the speech has started. If no
* callback is provided, return a `Promise`.
* @return {Promise|undefined} If no callback is provided, return a `Promise`, which is resolved when done speaking.
*/
/**
* Stop any speech Jibo is uttering.
* @method jibo.tts#stop
* @param {Function} [callback] Notify the caller that speech has stopped. If no callback is provided, return a `Promise`.
* @return {Promise|undefined} If no callback is provided, return a `Promise`, which gets resolved when stopped.
*/
/**
* Asynchronously retrieve a word schedule for given text (SSML markup support coming soon!).
* @method jibo.tts#getWordTimings
* @param {String} text The utterance provided to TTS for speaking.
* @param {Object} [options] Same options as {@link jibo.tts#speak}.
* @param {Function} [callback] Callback. If none is provided, return a `Promise`.
* @return {Promise|undefined}
*/
/**
* Start a sound effect.
* @method jibo.tts#startEffect
* @param {String} name The name of the effect.
* @param {number | string} value Either a number between 0 and 1 or a
* string parameter for the effect.
*/
/**
* Stop a sound effect.
* @method jibo.tts#stopEffect
* @param {String} name The name of the effect.
*/
/**
* Update the value of a sound effect.
* @method jibo.tts#updateEffect
* @param {String} name The name of the effect.
* @param {number | string} value Either a number between 0 and 1 or a
* string parameter for the effect.
*/
/**
* Tokenize a string
* @method jibo.tts#getPOSTokens
* @param {string} text The text to be tokenized.
* @param {Object} [options] Parameters to override the default POS behavior.
* @param {Function} [callback] Notify the caller about the resulting tokens
*
* @return {Promise|undefined} If no callack is provided, return a `Promise`, which is resolved when done tokenizing.
*/
/**
* Get POS Tags from a list of tokens (including words, symbols, etc)
* @method jibo.tts#getPOSTags
* @param {string[]} tokens A list of tokens (including words and symbols)
* @param {Object} [options] Parameters to override default POS behavior.
* @param {Function} [callback] Notify the caller about the resulting POS tags
*
* @return {Promise|undefined} If no callback if provided, return a `Promise`, which is resolved when finishing tagging.
*/

View File

@@ -0,0 +1,34 @@
/**
* System events to emit on touch changes.
* @name jibo.system.TouchHandler#events
* @type {jibo.system.SystemEvents}
* @readOnly
*/
/**
* Touch state of touch pads at the present moment.
* @name jibo.system.TouchHandler#events
* @type {jibo.system.TouchState}
* @readOnly
*/
/**
* Last pad state to be read through touch pads. `true` for touched. `false` for not touched.
* @name jibo.system.TouchHandler~_lastPadState
* @type {boolean[]}
* @readOnly
*/
/**
* Accept and calculate touch data based on touch events from system service.
* @param touchState {jibo.system.TouchState} Current touch state of touch pads.
* @method jibo.system.TouchHandler#acceptTouch
*/
/**
* Internally check membership of array
* @param array {Array<any>} Array to check membership of
* @param member {any} Member to check if in array
* @method jibo.system.TouchHandler~_arrayHas
* @private
*/

View File

@@ -0,0 +1,8 @@
/**
* Initialize the wifi module for `jibo.init`.
* @method jibo.wifi#init
* @param service {Object} The service options
* @param service.host {String} host name
* @param service.port {String} port number
* @param callback {Function} callback
*/

View File

@@ -0,0 +1,8 @@
/**
* @author vijay.umapathy <vijay.umapathy@jibo.com>
*/
/**
* Detect spikes in the input energy stream.
* Typical values range from -60dB to ~10dB depending on noise level. 0dB is the loudest sound the speaker can detect.
*/

View File

@@ -0,0 +1,7 @@
/**
* Look for a spike in an audio signal and emit an event
*/
/**
* @constructor
*/

View File

@@ -0,0 +1,24 @@
/**
* @author vijay.umapathy <vijay.umapathy@jibo.com>
*/
/**
* @interface TriggerOptions
* @description Configuration options for an ambient trigger
* @prop {number} baselineSize baseline size (num samples)
* @prop {number} recentSize recent size (num samples)
* @prop {number} triggerSensitivity trigger if recent.mean > base.mean + triggerSensitivity * base.std
* @prop {number} triggerTimeout timeout in ms (can't fire an event more frequently than this)
* @prop {number?} minimumRecentMean The recent-mean must be at least this to trigger an event.
* @prop {number?} minimumBaselineStdDev The minimum std deviation of the baseline must be at least this to trigger an event.
* @prop {number?} alwaysEmitAbove The recent-mean value above which an event will be emitted regardless of other constraints.
*/
/**
* Determines whether a spike event should trigger
* @returns {TriggerData} Either a populated object or an uninitialized (null) object. An unintialized object indicates that the trigger will not be emitted.
*/
/**
* Are the conditions met for emitting an event?
*/

View File

@@ -0,0 +1,33 @@
/**
* base on https://glastra.net/online-calculation-of-mean-variance-and-standard-deviation/
*
* @author vijay.umapathy <vijay.umapathy@jibo.com>
*/
/**
* Adds an element to the sample.
*/
/**
* Removes an element from the sample.
*/
/**
* Returns the current number of samples
*/
/**
* Returns the mean
*/
/**
* Returns mean squared
*/
/**
* return the variance of a distribution
*/
/**
* return the standard deviation of a distribution
*/

View File

@@ -0,0 +1,167 @@
/**
* Events for IdentityService to listen to to emit public events.
* @name jibo.lps.identity.DataConverter#events
* @type {jibo.lps.identity.IdentityEvents}
*/
/**
* Time after which the entity identified by the last speaker is removed.
* not static in order to speed up tests
* @name jibo.lps.identity.DataConverter#MS_IDENTITY_DECAY
* @type {number}
* @default 30000
* @private
*/
/**
* Last speaker heard by LPS
* @name jibo.lps.identity.DataConverter~_mostRecentSpeaker
* @type {jibo.lps.identity#SensoryRecord}
* @private
*/
/**
* Last time we heard Hey Jibo
* @name jibo.lps.identity.DataConverter~_lastSpokeTime
* @type {Time}
* @private
*/
/**
* last time we got vision information
* @name jibo.lps.identity.DataConverter~lastVisionTimestamp
* @type {Timestamp}
* @private
*/
/**
* Presences being tracked by LPS
* @name jibo.lps.identity.DataConverter~presences
* @type {Map<string, jibo.lps.identity/PresenceRecord>}
* @private
* @deprecated
*/
/**
* Map of all entity IDs to entity records
* @name jibo.lps.identity.DataConverter~entities
* @type {Map<string, jibo.lps.identity#LPSEntity>}
* @private
*/
/**
* Audio Entity ID of the last HJ we heard
* @name jibo.lps.identity.DataConverter~lastHJId
* @type {string}
* @private
*/
/**
* Map of ID'd entities around us and corresponding presence records
* @name jibo.lps.identity.DataConverter~currentIdentifiedEntities
* @type {Map<string, PresenceRecord>}
* @private
*/
/**
* Time since we've set an active speaker
* @name jibo.lps.identity.DataConverter~lastTimeCurrentSpeakerUpdated
* @type {Date}
* @private
*/
/**
* Map of timer handles by identified name. Allows several different speaker identified entities to decay simulataneously.
* @name jibo.lps.identity.DataConverter~identifiedEntityDecayMap
* @type {Map<string, NodeJS.Timer>}
* @private
*/
/**
* @description Get the most recent speaker as calculated by the data converter
* @method jibo.lps.identity.DataConverter#mostRecentSpeaker
* @param {number} msAge the acceptable age in ms of the most recent speaker request.
* @type {jibo.lps.identity.SensoryRecord}
*/
/**
* Get the last time somebody spoke.
* @name jibo.lps.identity.DataConverter#lastSpokeTime
* @type {jibo.animate.Time}
*/
/**
* All presences being tracked by LPS
* @name jibo.lps.identity.DataConverter~presences
* @type {Map<string, jibo.lps.identity#PresenceRecord>}
* @private
* @deprecated
*/
/**
* All visible people being tracked by LPS
* @name jibo.lps.identity.DataConverter~visibleFaces
* @type {Map<string, jibo.lps.identity#LPSEntity>}
* @private
*/
/**
* All people entities being tracked by LPS
* @name jibo.lps.identity.DataConverter~people
* @type {Map<string, jibo.lps.identity#LPSEntity>}
* @private
*/
/**
* @method jibo.lps.identity.DataConverter#acceptAwareness
* @description Accept information through LPS Vision socket.
* @param {any} data Raw data from LPS socket.
*/
/**
* @description Extract speaker ID information from raw GL data
* @param {any} data Raw speaker ID data from GL Service
* @method jibo.lps.identity.DataConverter#acceptSpeakerId
*/
/**
* @description Extract entity information from raw LPS data. Update all existing entity tracks.
* @param {any} entities Raw entity data from LPS Service
* @method jibo.lps.identity.DataConverter~extractEntities
* @private
*/
/**
* @description Clears entities if they disappeared from list.
* @param {Set<string>} seenKeys Entity Ids we saw this update
* @method jibo.lps.identity.DataConverter~clearEntities
* @private
*/
/**
* @description Check to see if a newly identified entity is around
* @param {string} name the unique (looper) name of the ID'd entity
* @param {jibo.lps.identity.PresenceRecord} presence the record to be emitted if new ID
* @method jibo.lps.identity.DataConverter~checkIdentifiedEntity
* @private
*/
/**
* @description Check to see if we've lost an ID
* @param {string} name the unique (looper) name of the ID'd entity
* @method jibo.lps.identity.DataConverter~removeIdentifiedEntity
* @private
*/
/**
* @description Check if the entity is an identified person that jibo knows
* @param {LPSEntity} entity the entity to check
* @method jibo.lps.identity.DataConverter~entityIsIdentifiedPerson
* @private
*/
/**
* @description Reset most recent speaker to null
* @method jibo.lps.identity.DataConverter~invalidateMostRecentSpeaker
* @private
*/

View File

@@ -0,0 +1,53 @@
/**
* @description
* IdentityEvents that can be subscribed to.
* ```
* jibo.lps.identity.events.presenceStarted.on(() => {});
* ```
* @memberof jibo.lps.identity
* @class IdentityEvents
*/
/**
* Fires upon transition from nobody being present to at least one person being present
* in the robot's environment.
* @name jibo.lps.identity.IdentityEvents#presenceStarted
* @type {Event<any>}
*/
/**
* Fires upon transition from at least one person being present to nobody being present
* in the robot's environment.
* @name jibo.lps.identity.IdentityEvents#presenceEnded
* @type {Event<any>}
*/
/**
* Fires when a person in the robot's environment becomes uniquely identified.
* @name jibo.lps.identity.IdentityEvents#idAcquired
* @type {Event<string>}
*/
/**
* Fires when a previously-identified person disappears.
* @name jibo.lps.identity.IdentityEvents#idLost
* @type {Event<string>}
*/
/**
* Fires when a new face enters Jibo's FOV
* @name jibo.lps.identity.IdentityEvents#visibleFaceStarted
* @type {Event<string>}
*/
/**
* Fires when a face leaves Jibo's FOV.
* @name jibo.lps.identity.IdentityEvents#visibleFaceStopped
* @type {Event<string>}
*/
/**
* Fires when audio stream gets a HJ event
* @name jibo.lps.identity.IdentityEvents#hjEvent
* @type {Event<string>}
*/

View File

@@ -0,0 +1,106 @@
/**
* @description
* Identity Module.
* Get identity information from Jibo's LPS. including
* present persons, present speaker, person location, as well as
* detailed information about speaker and face ID.
*
* ```
* var jibo = require("jibo");
* jibo.lps.identity.getPresentPersons();
* ```
* @namespace jibo.lps.identity
*/
/**
* Identity Events
* @name jibo.lps.identity#events
* @type {jibo.lps.identity.IdentityEvents}
*/
/**
* Data converter helper to accept and convert LPS data
* @name jibo.lps.identity#dataConverter
* @type {jibo.lps.identity.DataConverter}
* @private
*/
/**
* Keep interval handler for unregistering when dispose is called
* @name jibo.lps.identity~intervalHandle
* @type {any}
* @private
*/
/**
* Keep wake handler for unregistering when dispose is called
* @name jibo.lps.identity~wakeHandlerFunction
* @type {any}
* @private
*/
/**
* LPS Instance for piping identity-specific calls.
* @name jibo.lps.identity~lps
* @type {LPSService}
* @private
*/
/**
* @param {LPSService} lps service instance
* @constructor
*/
/**
* @description Begins the polling of LPS websocket on timescale. Sends
* data to DataConverter to be handled.
* @method jibo.lps.identity#init
*/
/**
* @description Returns `true` if one or more persons are present in the robot's environment.
* @returns {boolean} `true` if someone is present.
* @method jibo.lps.identity#isAnyonePresent
*/
/**
* @description Returns `true` if one or more persons are in the robot's field of view.
* @returns {boolean} `true` if someone is visible.
* @method jibo.lps.identity#isAnyoneVisible
*/
/**
* @description Returns a list of persons who are present in the robot's environment.
* Persons may be identified (known/in-loop) or unidentified.
* @returns {Array<jibo.lps.identity#Person>} List of present persons.
* @method jibo.lps.identity#getPresentPersons
*/
/**
* @description Returns a list of persons who are in the robots field of view
* Persons may be identified (known/in-loop) or unidentified.
* @returns {Array<jibo.lps.identity#Person>} List of visible persons.
* @method jibo.lps.identity#getVisiblePersons
*/
/**
* @description Call this method to provide top-down ("ground truth") notification that a particular person is present
* in the robot's environment.
* @param {string} id - Unique ID of the person who is present.
* @param {Function} [callback] Callback for information about LPS call request status.
* @method jibo.lps.identity#setPresentPerson
*/
/**
* @description Returns the most recent speaker out of the persons who are present in the robot's environment,
* or null if no such person is present.
* @param {number} [age=30000] Acceptable age in ms of the most recent speaker event. Defaults 30 seconds.
* @returns {jibo.lps.identity#Person} Person who is speaking.
* @method jibo.lps.identity#getActiveSpeaker
*/
/**
* @description Gets the faces currently in jibo's FOV.
* @returns {Map} Faces presently in Jibo's FOV as map of string ==> jibo.lps#LPSEntity
* @method jibo.lps.identity#getVisibleFaces
*/

View File

@@ -0,0 +1,29 @@
/**
* Returns true if one or more persons are present in the robot's environment.
*/
/**
* Returns true if one or more persons are visible in the robot's field of view.
*/
/**
* Returns a list of persons who are present in the robot's environment.
* Persons may be identified (known/in-loop) or unidentified.
*/
/**
* Returns a list of persons who are visible in the robot's field of view.
* Persons may be identified (known/in-loop) or unidentified.
*/
/**
* Call this method to provide top-down ("ground truth") notification that a particular person is present
* in the robot's environment.
* @param {string} id - Unique ID of the person who is present.
* @param {Function} cb - Callback for LPS response.
*/
/**
* Returns the most recent speaker out of the persons who are present in the robot's environment,
* or null if no such person is present.
*/

View File

@@ -0,0 +1,29 @@
import { ServiceContainer } from './utils/ServiceOwner';
import { ServiceRecord, InitCallback } from './utils/Types';
import * as errors from './services/ErrorService';
export { errors };
import * as ics from './services/IdentityCreationService';
export { ics };
import { lps } from './services/LPSService';
export { lps };
import { media } from './services/MediaService';
export { media };
import { mediaManager } from './services/MediaManagerService';
export { mediaManager };
import * as performance from './services/PerformanceService';
export { performance };
import * as scheduler from './services/SchedulerService';
export { scheduler };
import * as secureTransferService from './services/SecureTransferService';
export { secureTransferService };
import * as systemManager from './services/SystemManager';
export { systemManager };
import { system } from './services/SystemService';
export { system };
import * as tts from './services/TTSService';
export { tts };
import * as wifi from './services/WifiService';
export { wifi };
export { WebCommunication as web } from './utils/WebCommunication';
export declare type AsyncMethod = (callback: Function) => void;
export declare function init(owner: ServiceContainer, records: ServiceRecord[], callback: InitCallback, initWrapper?: (initFunction: AsyncMethod, service: string) => AsyncMethod): void;

View File

@@ -0,0 +1,61 @@
import { Log } from 'jibo-log';
import { ServiceRecord, InitCallback, Callback } from '../utils/Types';
/**
* @namespace jibo.errors
* @intdocs
*/
export interface SubscriptionObject {
nextErrorId: string;
subscribedErrorId: string;
resolved: boolean;
}
export interface ProcessedErrorObject {
processedError: boolean;
}
/**
* Initialize the error service module for `jibo.init`.
* @method jibo.errors#init
* @param service {Object} The service options
* @param service.host {String} host name
* @param service.port {String} port number
* @param callback {Function} callback
*/
export declare function init(service: ServiceRecord, parentLog: Log, callback: InitCallback): void;
/**
* Get the id for the current error or null if there is no error active
* @method jibo.errors#getCurrentErrorId
* @param callback {Function} The callback which returns either an error or the currentErrorId (null if no active error)
*/
export declare function getCurrentErrorId(callback: Callback<string>): void;
/**
* Get how many errors are currently entered in the error service priority queue.
* This includes the current error
* @method jibo.errors#getErrorCount
* @param callback {Function} The callback which returns either an error or the number of errors
*/
export declare function getErrorCount(callback: Callback<number>): void;
/**
* Subscribe to an error to get notified when your subscribed error is not / no longer the current error in the error service
* @method jibo.errors#subscribeError
* @param errorCode {string} The support error id string to subscribe to
* @param callback {Function} The callback which fires if the error is no longer the current error in the error service
* Passes an error as a parameter if a server side error occurs
* This callback is called either when:
* 1) the error gets resolved from the SSM Error Service (and removed from the priority queue)
* 2) one error is subscribed and then another error subscribes
* 3) the error is not present in the SSM Error Service priority queue (in which case it will resolve right away)
* 4) the client called processedError on the error it's subscribed to
*/
export declare function subscribeError(errorCode: string, callback: Callback<SubscriptionObject>): void;
/**
* Mark an error for being processed in the SSM error service. This will move the error to the error rescheduler.
* The error will be removed from the error rescheduler if it is internally resolved.
* If the error is not internally resolved, the error rescheduler will reinsert the error into the priority queue (which may trigger the settings skill to relaunch)
* @method jibo.errors#processedError
* @param errorCode {string} The support error id string to process
* @param callback {Function} The callback which fires indicating the SSM error service has attempted to move the error to the error rescheduler
* The processedErrorObject field returns along with an error object
* This error object in the callback is populated if the error code is ommitted or if there is a communication problem with the SSM error service.
* If the error object is populated, the response data object will be null and vice versa
*/
export declare function processedError(errorCode: string, callback: Callback<ProcessedErrorObject>): void;

View File

@@ -0,0 +1,72 @@
import { Log } from 'jibo-log';
import { ServiceRecord, InitCallback, Callback } from '../utils/Types';
export declare function init(service: ServiceRecord, parentLog: Log, cb: InitCallback): void;
/**
* Create new entry in LPS identity list.
* @param data {Object} Options for the request.
* @param data.name {String} Name for the identity.
* @param [data.kind="face"] {String} Kind of identity data. (Currently ONLY supports "face".)
* @param cb {Function} Callback for the method.
* @method jibo.ics#createIdentity
* @intdocs
*/
export declare function createIdentity(data: {
name: string;
kind?: string;
}, cb: Function): void;
/**
* Remove entry from LPS identity list.
* @param data {Object} Options for the request.
* @param data.name {String} Name for the identity.
* @param [data.kind="face"] {String} Kind of identity data. (Currently ONLY supports "face".)
* @param cb {Function} Callback for the method.
* @method jibo.ics#removeIdentity
* @intdocs
*/
export declare function removeIdentity(data: {
name: string;
kind?: string;
}, cb: Function): void;
/**
* Get list of all face-trained users
* @method jibo.ics#getIdentityList
* @param cb {Function} Callback for the method.
* @intdocs
*/
export declare function getIdentityList(cb: Callback): void;
/**
* Get face location details
* @method jibo.ics#getFaceLocationDetails
* @param looperId {String}
* @param photoIndex {Number}
* @param cb {Function} Callback for the method.
* @return {Object} requested face location details
* @intdocs
*/
export declare function getTrainingPhotoMetadata(looperId: string, photoIndex: number, cb: Callback): void;
/**
* Returns URI of face-training photo JPEG
* @method jibo.ics#getTrainingPhoto
* @param looperId {String} Name for the identity.
* @param photoIndex {Number} Index of the photo to get
* @return URI of face training photo JPEG
* @intdocs
*/
export declare function getTrainingPhotoURI(looperId: string, photoIndex: number): string;
export interface TrainingRequestResponse {
detection?: any;
detections?: any[];
}
/**
* Set up new training request. Request LPS to train an identified for a name using current sensor data.
* @method jibo.ics#sendTrainingRequest
* @param data {Object} Options for the training request.
* @param data.name {String} Name for the training data.
* @param [data.kind="face"] {String} Kind of data to be trained on. (Currently ONLY supports "face".)
* @param cb {Function} Callback for the method.
* @intdocs
*/
export declare function sendTrainingRequest(data: {
name: string;
kind?: string;
}, cb: Callback<TrainingRequestResponse>): void;

View File

@@ -0,0 +1,157 @@
import { Event, EventContainer } from 'jibo-typed-events';
import IdentityService from "./id";
import DetectorService from "./detectors";
import { ServiceRecord, InitCallback } from '../utils/Types';
import { Log } from 'jibo-log';
/**
* @description
* Local Perceptual Space
*
* @namespace jibo.lps
*/
export declare class lps {
/**
* Return the full state of the Jibo's local perceptual space.
* @name jibo.lps#motionData
* @type {*|{cameras: Array, entities: Array}}
* @readOnly
*/
static readonly motionData: any;
/**
* Return the full audio state of the Jibo's local perceptual space.
* @name jibo.lps#audioData
* @type {any}
* @readOnly
*/
static readonly audioData: any;
/**
* Get recent lighting quality for jibo's cameras as averaged by 3 most visible sectors.
* [0,1] with 1 being highest quality, 0 being lowest.
* WARNING: for best results, must be used with platform >=5.1.0
* @name jibo.lps#lightingQuality
* @type {number}
*/
static readonly lightingQuality: number;
/**
* Get recent lighting level for jibo's cameras as averaged by 3 most visible sectors.
* [0,1] with 1 being highest lighting level, 0 being lowest.
* WARNING: for best results, must be used with platform >=5.1.0
* @name jibo.lps#lightingLevel
* @type {number}
*/
static readonly lightingLevel: number;
}
export declare namespace lps {
/**
* Callback for LPS Service
* @callback jibo.lps~Callback
* @param [err] {String | Error} String of error text, or null if success.
* @param [data] {any} Data of successful call. Varies by function.
*/
type Callback = (err?: string | Error, data?: any) => void;
/**
* @description
* Local Perceptual Space Events
* Events that are emitted upon data received.
* Example usage:
* ```
* jibo.lps.events.audio.on(data => {
* console.log(data.entities.length);
* });
* ```
* @namespace jibo.lps.events
*/
class LPSEvents extends EventContainer {
/**
* Emits an event when new audio data is received from service.
* @name jibo.lps.events#audio
* @type {Event}
*/
audio: Event<any>;
/**
* Emits an event when new motion data is received from service.
* @name jibo.lps.events#motion
* @type {Event}
*/
motion: Event<any>;
}
const events: LPSEvents;
let identity: IdentityService;
let detector: DetectorService;
/**
* Get the visual entity closest to Jibo.
* @method jibo.lps#getClosestVisualEntity
*
* @return The closest visual entity to Jibo. If one does not exist, returns undefined.
*/
function getClosestVisualEntity(): any;
/**
* Get a visual entity by specified ID.
* @method jibo.lps#getVisualEntityById
* @param id {Number} ID of the entity to get.
* @return The specified visual entity. If it does not exist, returns undefined.
*/
function getVisualEntityById(id: number): any;
/**
* Get the closest audible entity to Jibo.
* @method jibo.lps#getClosestAudibleEntity
*
* @return The closest audible entity to Jibo. If one does not exist, returns undefined.
*/
function getClosestAudibleEntity(): any;
/**
* Get an audible entity by specified ID.
* @method jibo.lps#getAudibleEntityById
* @param id {Number} ID of the entity to get.
* @return The specified audible entity. If it does not exist, returns undefined.
*/
function getAudibleEntityById(id: number): any;
/**
* Request camera calibration data
* @param {number} cameraID ID for camera to be used.
* @param {jibo.lps~Callback} cb Callback for the function which returns parsed data.
* @method jibo.lps#getCameraParameters
*/
function getCameraParameters(cameraID: number, cb: Callback): void;
/**
* Forces a one-shot full frame face detection and reports all faces detected
* @param {number} cameraID ID for camera to be used.
* @param {jibo.lps~Callback} cb Callback for the function which returns parsed data.
* @param {string} [kind=faces] Kind of entities to search for.
* @param {boolean} [initTracks=false] Hint to try to init the face ids which are tracked.
* @method jibo.lps#getFaces
*/
function getFaces(cameraID: number, cb: Callback, kind?: string, initTracks?: boolean): void;
/**
* Force the LPS to run face detection on jibo's present field of vision.
* @param cameraID=0 {Number} (0|1) ID of Camera to run algorithm on.
* @param redetect=false {Boolean} Should redetect (rerun algorithm) until a face is detected.
* @param cb {jibo.lps~Callback} Callback with null error if detection algorithm ran, error otherwise. Results from face detection will only be represented through {@link jibo.lps#motionData}.
* @method jibo.lps#demandDetect
*/
function demandDetect(cameraID: number, redetect: boolean, cb: Callback): void;
/**
* @description Barcode data object.
* @typedef {Object} jibo.lps~BarcodeData
* @property {int} type `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), or `10` (Code 128).
* @property {string} content Payload of the barcode data.
*/
/**
* Read barcode or QR code data.
* @method jibo.lps#readBarcode
* @param {Function} cb Callback for the function.
* @return {jibo.lps~BarcodeData} Barcode data object.
*/
function readBarcode(cb: any): void;
/**
* Set a present person.
* @method jibo.lps#setPresence
* @param {jibo.lps.identity.PresenceRecord} presenceData Data to set around environment.
* @param {Function} cb Callback for the function.
*/
function setPresence(presenceData: any, cb: any): void;
function init(service: ServiceRecord, parentLog: Log, cb: InitCallback): void;
function _createMotionSocket(cb: any): void;
function _createAudioSocket(cb: any): void;
}

View File

@@ -0,0 +1,83 @@
import { Log } from 'jibo-log';
import { ServiceRecord, InitCallback, Callback } from '../utils/Types';
/**
* Media Manager Service
* @namespace jibo.media.mediaManager
* @intdocs
*/
export declare class mediaManager {
/** Delete media from the cloud and/or local library.
*
* @method jibo.media.MediaManager#delete
* @param {string} contentID Content ID of the media to delete.
* @param {boolean} immediate If `true` wait until the delete is
* finished finished in the cloud before calling callback.
* @param {boolean} deleteLocal Delete the local library copy.
* @param {boolean} deleteRemote Delete the cloud copy.
* @param {jibo.media.MediaManager} mediaType Enumerated value of the media type.
* @param {function} callback Called when done.
* @intdocs
*/
static delete(contentID: string, immediate: boolean, deleteLocal: boolean, deleteRemote: boolean, mediaType: mediaManager.MediaType, callback: mediaManager.ErrCallback): void;
}
export declare namespace mediaManager {
type ErrCallback = Callback<void>;
/** Enum of media types.
* @interface jibo.media.MediaManager#MediaType
* @property image {string} 'image'
* @property recording {string} 'recording'
* @property thumb {string} 'thumb'
* @property thumb_robot {string} 'thumb_robot'
* @property audio {string} 'audio'
*/
enum MediaType {
image = "image",
recording = "recording",
thumb = "thumb",
thumb_robot = "thumb_robot",
audio = "audio",
}
function init(service: ServiceRecord, parentLog: Log, callback: InitCallback): void;
/** Move picture files written to disk by the Media Service from
* the place it likes to put them (/opt/jibo/Photos) into the
* right directory for the Media Manager Service to take care of
* them (/opt/jibo/Photos/upload).
*
* @method jibo.media.MediaManager#adopt
* @param {string[]} contentIDs Content IDs of the media file to
* be adopted.
* @param {MediaType} mediaType Type of media to be
* adopted. Applies to all supplied contentIDs.
* @param {function} callback Called when done.
* @intdocs
*/
function adopt(contentIDs: string[], mediaType: MediaType, callback: ErrCallback): void;
/** Send media from the local library to the cloud.
*
* @method jibo.media.MediaManager#upload
* @param {string} contentID Content ID of the local media to upload.
* @param {boolean} immediate Wait until the upload is finished before calling callback.
* @param {boolean} keepLocal If `false` local copy of media will be removed after upload.
* @param {jibo.media.MediaManager} mediaType Enumerated value of the media type.
* @param {string} reference Optional content ID reference (for
* thumbnails to point to the main content)
* @param {function} callback Called when done.
* @intdocs
*/
function upload(contentID: string, immediate: boolean, keepLocal: boolean, mediaType: MediaType, reference: string, callback: ErrCallback): void;
/** Download media from the cloud to the local library.
* If the media is already in the local library the call
* will succeed the same as if it downloaded it (but faster).
*
* @method jibo.media.MediaManager#download
* @param {string} contentID Content ID of the local media to upload.
* @param {boolean} immediate If `true` wait until the upload is finished before calling callback.
* @param {boolean} keepLocal If `false` local copy of media will be removed after upload.
* @param {jibo.media.MediaManager} mediaType Enumerated value of the media type.
* @param {string} reference Optional content ID reference (for
* thumbnails to point to the main content)
* @param {function} callback Called when done.
* @intdocs
*/
function download(contentID: string, immediate: boolean, mediaType: MediaType, callback: ErrCallback): void;
}

View File

@@ -0,0 +1,140 @@
/// <reference types="node" />
import { Log } from 'jibo-log';
import { ServiceRecord, InitCallback } from '../utils/Types';
/** Media Service. Internal Only.
*
* @class MediaService
* @memberof jibo.media
* @intdocs
*/
export declare class media {
}
export declare namespace media {
/** Enum of photo types.
* @name jibo.media#PhotoType
* @type {Enum}
* @property DEBUG {Number} 0; 1/2-scale (640x360) grayscale.
* @property PREVIEW {Number} 1; 1/2-scale (640x360) color.
* @property HALF {Number} 1; alias for PREVIEW
* @property SNAP {Number} 2; Full-scale (1280x720) color. (default)
* @property FULL {Number} 2; alias for SNAP
* @property FOUR_MP {Number} 3; Four megapixel (2688x1520) color.
* @property LARGE {Number} 3; alias for FOUR_MP
*/
enum PhotoType {
DEBUG = 0,
PREVIEW = 1,
HALF = 1,
SNAP = 2,
FULL = 2,
FOUR_MP = 3,
LARGE = 3,
}
/** Enum of cameras.
* @name jibo.media#CameraID
* @type {Enum}
* @property LEFT {Number} 0; Left camera.
* @property RIGHT {Number} 1; Right camera. Default.
*/
enum CameraID {
LEFT = 0,
RIGHT = 1,
}
/**
* @interface jibo.media~Filter
* @property {string} kind
* @property {any} config
* @intdocs
*/
interface Filter {
kind: string;
config: any;
}
interface PhotoResponse {
id: string;
previewUrl: string;
}
interface Thumbnails {
[name: string]: [number, number];
}
interface ThumbnailsResponse {
[name: string]: string;
}
interface PhotoStoreResponse {
id: string;
thumbnails: ThumbnailsResponse;
stored: boolean;
}
/** @callback jibo.media.MediaService~PhotoCallback */
type PhotoCallback = (err: Error, response?: PhotoResponse) => void;
/** @callback jibo.media.MediaService~PhotoStoreCallback */
type PhotoStoreCallback = (err: Error, response?: PhotoStoreResponse) => void;
function init(service: ServiceRecord, parentLog: Log, cb: InitCallback): void;
/** Take a photo. Returns content id of photo.
* Use `getPreviewUrl(data.id)` for
* image url.
*
* @method jibo.media.MediaService#takePhoto
* @param {jibo.media#CameraID} camera Camera to use.
* @param {jibo.media#PhotoType} photoType Type of photo requested.
* @param {jibo.media~Filter[]} [params.filters] List of filters to apply
* to the image in order.
* @param {boolean} store If `true`, image is also permanently
* stored (currently ignored, use `storePhoto()`)
* @param {jibo.media.MediaService~PhotoCallback} callback Called with an error, or
* with data about the photo including the content ID (`data.id`).
* @intdocs
*/
function takePhoto(camera: CameraID, photoType: PhotoType, filters: Filter[], store: boolean, callback: PhotoCallback): void;
/** Store a photo and thumbnails to disk and return the UUID of
* each saved image.
*
* @param {Buffer} buffer The image buffer to save to disk,
* @param {object} thumbnails Keys are id to associate with that thumbnail. Values are two element Arrays, where the
* first element is the width of the thumbnail, and the second is the height in pixels.
* @param {jibo.media.MediaService~PhotoStoreCallback} callback Called when photos are stored.
* @method jibo.media.MediaService#storePhoto
* @intdocs
*/
function storePhoto(buffer: Buffer, id: string, thumbnails: Thumbnails, callback: PhotoStoreCallback): void;
/** Get a URL given a photo ID.
*
* @param {string} id ID of the photo.
* @returns {string} URL to the photo.
* @method jibo.media.MediaService#getUrl
* @intdocs
*/
function getUrl(id: string): string;
/** Get the preview URL of a recently taken
* in-memory photo that hasn't been stored yet.
*
* @param {string} id Content ID of the photo.
* @returns {string} URL to the photo.
* @method jibo.media.MediaService#getPreviewUrl
* @intdocs
*/
function getPreviewUrl(id: string): string;
/** Set up a viewfinder in a window with camera preview positioned
* at a given location on-screen.
*
* @method jibo.media.MediaService#setViewfinder
* @param data {Object} Options for the viewfinder preview.
* @param data.enable {Boolean} `true` to show viewfinder; `false` to not show viewfinder.
* @param [data.width=1280] {Number} Width of the viewfinder.
* @param [data.height=720] {Number} Height of the viewfinder.
* @param [data.x=0] {Number} x-coordinate to place the viewfinder.
* @param [data.y=0] {Number} y-coordinate to place the viewfinder.
* @param [data.camera=1] {Number} Camera to use. 0=Left, 1=Right.
* @param callback {Function} Callback for the method.
* @intdocs
*/
function setViewfinder(data: any, callback: any): any;
/** Get the current state of the viewfinder preview window.
*
* @method jibo.media.MediaService#getViewfinder
* @param {Function} callback Callback for the function that returns an error, or
* if request is successful returns object with timestamp, enable, and window.
* @intdocs
*/
function getViewfinder(callback: any): any;
}

View File

@@ -0,0 +1,24 @@
import { Log } from 'jibo-log';
import { ServiceRecord, InitCallback } from '../utils/Types';
/**
* Initialize the performance module for `jibo.init`.
* @method jibo.performance#init
* @param service {Object} The service options
* @param service.host {String} host name
* @param service.port {String} port number
* @param callback {Function} callback
*/
export declare function init(service: ServiceRecord, parentLog: Log, callback: InitCallback): void;
/**
* Post a log to the performance service.
* @method jibo.performance#log
* @param type {string} The event type
* @param description {string} Description
*/
export declare function log(type: string, description?: string): void;
/**
* Get the current time. Uses high precision timer.
* @method jibo.performance#now
* @returns {number} Milliseconds since epoch.
*/
export declare function now(): number;

View File

@@ -0,0 +1,98 @@
import { Log } from 'jibo-log';
import { ServiceRecord, InitCallback, Callback } from '../utils/Types';
/**
* Schedule a job to run on the robot in the background.
* @namespace jibo.scheduler
* @intdocs
*/
export declare type SkillData = {
skill: string;
domain: string;
intent: string;
};
export interface OTARecord {
id: string;
subsystem: string;
changes: string;
length: number;
toVersion: string;
dependencies: any;
downloaded: boolean;
}
/**
* Initialize the performance module for `jibo.init`.
* @method jibo.scheduler#init
* @param service {Object} The service options
* @param service.host {String} host name
* @param service.port {String} port number
* @param callback {Function} callback
* @intdocs
*/
export declare function init(service: ServiceRecord, parentLog: Log, callback: InitCallback): void;
/**
* Trigger an instant robot backup
* @method jibo.scheduler#backupRobot
* @param callback {Function} callback
* @intdocs
*/
export declare function backupRobot(callback: Callback<void>): void;
/**
* Get the current state of a backup, if applicable
* @method jibo.scheduler#backupStatus
* @param callback {Function} callback
* @intdocs
*/
export declare function backupStatus(callback: Callback<any>): void;
/**
* Trigger an instant ota-update (check for updates, download and install)
* @method jibo.scheduler#otaDownloadAndInstall
* @param callback {Function} callback
* @intdocs
*/
export declare function otaDownloadAndInstall(callback: Callback<void>): void;
/**
* Get the current state of a scheduled OTA download
* @method jibo.scheduler#otaDownloadStatus
* @param callback {Function} callback
* @intdocs
*/
export declare function otaDownloadStatus(callback: Callback<any>): void;
/**
* Check for OTA updates via SchedulerService
* @method jibo.scheduler#otaCheckUpdates
* @param callback {Function} callback
* @intdocs
*/
export declare function otaCheckUpdates(callback: Callback<OTARecord[]>): void;
/**
* Add a job to the scheduler service.
* @method jibo.scheduler#addJob
* @param schedule {String} The schedule (crontab syntax).
* @param data {Object} Options for the skill redirect request.
* @param callback {Function} callback
* @intdocs
*/
export declare function addJob(schedule: string, skillData: SkillData, callback: Callback<string>): void;
/**
* Remove a job from the scheduler service.
* @method jibo.scheduler#removeJob
* @param job {String} The ID of the job to remove.
* @param callback {Function} callback
* @intdocs
*/
export declare function removeJob(jobId: string, callback: Callback<void>): void;
/**
* List all active jobs from the scheduler service.
* @method jibo.scheduler#listJobs
* @param callback {Function} callback
* @intdocs
*/
export declare function listJobs(callback: Callback<any>): void;
/**
* Check if a specific job exists with the scheduler service; returns current job data if it exists.
* @method jibo.scheduler#hasJob
* @param jobId {String} The ID of the job to check for.
* @param callback {Function} callback
* @intdocs
*/
export declare function hasJob(jobId: string, callback: Callback<any>): void;

View File

@@ -0,0 +1,23 @@
import { Log } from 'jibo-log';
import { ServiceRecord, InitCallback, Callback } from '../utils/Types';
/**
* Initialize the error service module for `jibo.init`.
* @method jibo.secureTransferService#init
* @param service {Object} The service options
* @param service.host {String} host name
* @param service.port {String} port number
* @param callback {Function} callback
*/
export declare function init(service: ServiceRecord, parentLog: Log, callback: InitCallback): void;
/**
* A method to know whether or not we have backup data
* @method jibo.secureTransferService#hasBackupData
* @param callback {Function} callback - passes a bool via the callback params which signals if we have backup data
*/
export declare function hasBackupData(callback: Callback<boolean>): void;
/**
* Poll this method to know (via callback) if the UGC Key is ready in the SecureTransferService
* @method jibo.secureTransferService#isUGCKeyReady
* @param callback {Function} callback - passes a bool via the callback params which signals if the UGC key is ready
*/
export declare function isUGCKeyReady(callback: Callback<boolean>): void;

View File

@@ -0,0 +1,188 @@
import { Log } from 'jibo-log';
import { Event } from 'jibo-typed-events';
import { ServiceRecord, InitCallback, Callback } from '../utils/Types';
export interface NotificationInterface {
/** Arbitrary string identifying the type of data associated with this notification */
type: string;
/** Notification channel name. One of: "GENERAL", "NETWORK", "POWER_MANAGEMENT", "HARDWARE_FAULT" */
channel: string;
/** chronometer timestamp associated with this notification */
ts: number[];
/** type-specific notification data */
data: any;
}
export interface Identity {
name: string;
wifi_mac: string;
serial_number: string;
}
/**
* @namespace jibo.systemManager
* @intdocs
*/
export declare let notifications: NotificationInterface;
/**
* Notification emitted when the robot shuts down.
* @name jibo.systemManager#onShutdown
* @type {TypedEvent}
*/
export declare const onShutdown: Event<NotificationInterface>;
export declare let httpInterface: string;
export declare function init(service: ServiceRecord, parentLog: Log, cb: InitCallback): void;
/**
* getVersion - Gets current version of platform build if connected to robot (raw numbers xx.xx.xx).
* @method jibo.systemManager#getVersion
*
* @param {function} cb Callback that notifies the caller that the
* version was retrieved; If successful, returns version; otherwise, error string.
*/
export declare function getVersion(callback: Callback<string>): void;
/**
* getDisplayVersion - Gets current display-friendly version of platform build if connected to robot.
* @method jibo.systemManager#getDisplayVersion
*
* @param {function} cb Callback that notifies the caller that the
* version was retrieved; If successful, returns version; otherwise, error string.
*/
export declare function getDisplayVersion(callback: Callback<string>): void;
/**
* getCredentials - Gets the robot's current credentials
* @method jibo.systemManager#getCredentials
* @param {function} callback Callback that notifies caller of the robot's current credentials (can be empty).
*
* @intdocs
*/
export declare function getCredentials(callback: Callback<any>): void;
/**
* setCredentials - Sets the robot's current credentials
* @method jibo.systemManager#setCredentials
* @param {Object} creds Credentials JSON object.
* @param {function} callback Callback when completed.
*
* @intdocs
*/
export declare function setCredentials(creds: any, callback: Callback<void>): void;
/**
* getMode - Gets the robot's current mode (identified, oobe, int-developer, developer, normal)
* @method jibo.systemManager#getMode
* @param {function} callback Callback that notifies caller of the current mode.
*
* @intdocs
*/
export declare function getMode(callback: Callback<string>): void;
/**
* setMode - Sets the robot's current mode (requires reboot to take effect). !!! Use this with extreme caution !!!
* @method jibo.systemManager#setMode
* @param {String} _mode Value that represents desired mode: identified, oobe, int-developer, developer, normal
* @param {function} callback Callback when completed.
*
* @intdocs
*/
export declare function setMode(_mode: string, callback: Callback<void>): void;
/**
* getCurrentTime - Get the current time of the robot.
* @method jibo.systemManager#getCurrentTime
*
* @param {function} callback Callback when completed.
*
* @intdocs
*/
export declare function getCurrentTime(callback: Callback<number>): void;
/**
* syncTime - Force a synchronization of the robot's time with an NTP server.
* @method jibo.systemManager#syncTime
*
* @param {function} callback Callback when completed.
*
* @intdocs
*/
export declare function syncTime(callback: Callback<void>): void;
/**
* getTimeZone - Gets current timezone of robot.
* @method jibo.systemManager#getTimeZone
*
* @param {function} callback Callback that notifies the caller what the current timezone of the robot is.
*
* @intdocs
*/
export declare function getTimeZone(callback: Callback<string>): void;
/**
* wipe - Requests a system wipe
* @method jibo.systemManager#wipe
* @param {function} callback Callback when completed.
*
* @intdocs
*/
export declare function wipe(callback: Callback<void>): void;
/**
* backup - Requests a system backup
* @method jibo.systemManager#backup
* @param {function} callback Callback when completed.
*
* @intdocs
*/
export declare function backup(callback: Callback<void>): void;
/**
* restore - Requests a system restore
* @method jibo.systemManager#restore
* @param {function} callback Callback when completed.
*
* @intdocs
*/
export declare function restore(callback: Callback<void>): void;
/**
* poweroff - Attempts to power off the robot
* @method jibo.systemManager#poweroff
* @param {function} callback Callback when completed.
*
* @intdocs
*/
export declare function poweroff(callback: Callback<void>): void;
/**
* reboot - Attempts to reboot (power off and on) the robot
* @method jibo.systemManager#reboot
* @param {function} callback Callback when completed.
*
* @intdocs
*/
export declare function reboot(callback: Callback<void>): void;
/**
* forceLogs - Uploads any pending system logs to the server
* @method jibo.systemManager#forceLogs
* @param {function} callback Callback when completed.
*
* @intdocs
*/
export declare function forceLogs(callback: Callback<void>): void;
/**
* checkForUpdates - Returns a current list of available platform updates.
* @method jibo.systemManager#checkForUpdates
*
* @param {function} cb Callback that notifies the caller of any updates; If successful,
* returns the metadata associated with each update (if any exist); otherwise, error string.
* @param {String} [filter] Optional and if specified, check for updates matching that filter on the server.
*
* @intdocs
*/
export declare function checkForUpdates(callback: Callback<any>, filter?: string): void;
/**
* @intdocs
*/
export declare function downloadUpdates(data: any, callback: Callback<any>): void;
/**
* Installs specified update IDs on robot.
* @method jibo.systemManager#installUpdates
* @intdocs
* @param {Object} data The update IDs to install.
* @param {function} callback The callback when installation request has been made.
*/
export declare function installUpdates(data: any, callback: Callback<void>): void;
/**
* getIdentity - Gets the identity of the robot if connected.
* @method jibo.systemManager#getIdentity (object containing name, WiFi MAC address and serial number)
*
* @param {function} cb Callback that notifies the caller that the
* identity was retrieved; If successful, returns object containing name, MAC
* address and serial number; otherwise, error string.
*/
export declare function getIdentity(callback: Callback<Identity>): void;

View File

@@ -0,0 +1,258 @@
import { Event, EventContainer } from 'jibo-typed-events';
import { TouchState, InputEnergy, AxisState } from 'jibo-common-types';
import { ServiceRecord, InitCallback, Callback } from '../utils/Types';
import { Log } from 'jibo-log';
/**
* @description
* Non-motion-related robot body services (i.e. temperature, fan, battery, backlight, etc.).
*
* ```
* var jibo = require("jibo");
* jibo.system.getBatteryTemperature();
* ```
* @namespace jibo.system
*/
export declare class system {
/**
* Set the body output.
* @name jibo.system#output
* @type {Object}
* @intdocs
*/
static output: any;
/**
* `true` if the robot is plugged in.
* @name jibo.system#pluggedIn
* @type {boolean}
*/
static readonly pluggedIn: boolean;
/**
* `true` if the robot's battery is charging.
* @name jibo.system#batteryCharging
* @type {boolean}
*/
static readonly batteryCharging: boolean;
/**
* Get the robot's charging rate.
* @name jibo.system#batteryChargeRate
* @type {number}
*/
static readonly batteryChargeRate: number;
/**
* Get the robot's current touch pad state.
* There is an array of 6 pads with `true` for touched and `false` for not touched.
* See {@tutorial robot-info-tool} for a diagram of Jibo's head touch pads.
* Three run vertically down the left side of Jibo's head from top to bottom: `pad_state[0, 1, 2]`.
* Three run vertically down the right of his head: `pad_state[3, 4, 5]`.
* @name jibo.system#padState
* @type {boolean[]}
*/
static readonly padState: boolean[];
/**
* Energy statistics for input audio at 20Hz.
* @name jibo.system#inputEnergy
* @intdocs
*/
static readonly inputEnergy: InputEnergy;
}
export declare namespace system {
/**
* @description
* System events that are emitted upon data received.
*
* Example:
* ```
* jibo.system.events.touchChanged.on((data) => {
* console.log(data);
* });
* ```
* @class SystemEvents
* @memberof jibo.system
*/
class SystemEvents extends EventContainer {
/**
* Event for when the touch pad has changed states
* @name jibo.system.SystemEvents#touchChanged
* @type {TypedEvent}
* @readOnly
*/
touchChanged: Event<TouchState>;
/**
* Emitted audio input energy changes.
* @name jibo.system.SystemEvents#inputEnergy
* @type {TypedEvent}
* @readOnly
*/
inputEnergy: Event<InputEnergy>;
/**
* A touch pad has been turned on, where previously all were off.
* WARNING: this refers to the local `touchOn` event, which is
* NOT used to stop Jibo. If you want to listen for the
* `touchStop` event AND clobber the stop behavior, please
* refer to {@link jibo.globalEvents#touchStop}.
* Emits array of pad state.
* @name jibo.system.SystemEvents#touchOn
* @type {TypedEvent}
* @readOnly
*/
touchOn: Event<boolean[]>;
/**
* All touch pads are off, where previously at least one was on.
* Emits array of pad state.
* @name jibo.system.SystemEvents#touchOff
* @type {TypedEvent}
* @readOnly
*/
touchOff: Event<boolean[]>;
/**
* Axis fault on. Emits name of axis that faulted.
* @name jibo.system.SystemEvents#axisFaultOn
* @type {TypedEvent}
* @readonly
*/
axisFaultOn: Event<AxisState>;
/**
* Axis fault has stopped. Emits that axis are all not faulting.
* @name jibo.system.SystemEvents#axisFaultOff
* @type {TypedEvent}
* @readonly
*/
axisFaultOff: Event<AxisState>;
/**
* Jibo's hatch has opened
* @name jibo.system.SystemEvents#hatchOpen
* @type {TypedEvent}
* @readonly
*/
hatchOpen: Event<void>;
/**
* Jibo's hatch has closed
* @name jibo.system.SystemEvents#hatchClose
* @type {TypedEvent}
* @readonly
*/
hatchClose: Event<void>;
/**
* Jibo was just plugged in
* @name jibo.system.SystemEvents#pluggedIn
* @type {TypedEvent}
* @readonly
*/
pluggedIn: Event<void>;
/**
* Jibo was just unplugged
* @name jibo.system.SystemEvents#unplugged
* @type {TypedEvent}
* @readonly
*/
unplugged: Event<void>;
}
/**
* System Events
* @name jibo.system#events
* @type {jibo.system.SystemEvents}
*/
const events: SystemEvents;
/**
* Initialize the body service
* @intdocs
* @method jibo.system#initBody
*/
function initBody(service: ServiceRecord, parentLog: Log, callback: InitCallback): void;
/**
* Get the robot's battery temperature.
* @method jibo.system#getBatteryTemperature
* @return {number} The temperature of the battery in degrees Celsius.
*/
function getBatteryTemperature(): number;
/** Get the robot's battery level.
* @method jibo.system#getBatteryLevel
* @return {number} The current level of the battery as a percentage.
*/
function getBatteryLevel(): number;
/**
* Get the robot's system voltage.
* @method jibo.system#getSystemVoltage
* @return {number} The current system voltage estimate.
*/
function getSystemVoltage(): number;
/**
* Get the robot's main board temperature.
* @method jibo.system#getMainBoardTemperature
* @return {number} The temperature of the main board in degrees Celsius.
*/
function getMainBoardTemperature(): number;
/**
* Get the robot's CPU temperature.
* @method jibo.system#getCPUTemperature
* @return {number} The temperature of the CPU in degrees Celsius.
*/
function getCPUTemperature(): number;
/**
* Get the touch state of pads in Jibo's head.
* @method jibo.system#getTouchState
* @returns {jibo.system.TouchState} The state of Jibo's head touchpads.
*/
function getTouchState(): TouchState;
/**
* Get the robot's fan speed.
* @method jibo.system#getFanSpeed
* @param {Function} callback Notify the caller that the
* system data was received or that an error was encountered.
* If successful, return cooling fan speed as percentage of
* maximum (range [0.0, 1.0]).
*
*/
function getFanSpeed(callback: Callback<number>): void;
/**
* Get the robot's fan mode.
* @method jibo.system#getFanMode
* @param {Function} callback Notify the caller that the
* system data was received or that an error was encountered.
* If successful, return fan mode as a string.
*
*/
function getFanMode(callback: Callback<string>): void;
/**
* Get LCD backlight information.
* @method jibo.system#getBacklight
* @param {Function} callback Notify the caller that the
* system data was received or that an error was encountered.
* If successful, return the LCD backlight brightness
* in percentage of maximum (range [0.0, 1.0]).
*/
function getBacklight(callback: Callback<number>): void;
/**
* Set the LCD backlight brightness.
* @method jibo.system#setBacklight
* @param {Value} value Desired brightness of LCD backlight (range [0.0 - 1.0]).
* @param {Function} callback Notify the caller that the
* system data was received or that an error was encountered.
* If unsuccessful, return the error; otherwise, return 'null'.
*/
function setBacklight(value: number, callback: Callback<void>): void;
/**
* Get current master volume.
* @method jibo.system#getMasterVolume
* @param {Function} callback Notify the caller that the
* system data was received or that an error was encountered.
* If successful, return the master volume (range [0.0, 1.0]).
*/
function getMasterVolume(callback: Callback<number>): void;
/**
* Set the master volume.
* @method jibo.system#setMasterVolume
* @param {number} value Desired master volume (range [0.0 - 1.0]).
* @param {Function} cb Notify the caller that
* system data was received or that an error was encountered.
* If unsuccessful, return the error; otherwise, return `null`.
*/
function setMasterVolume(value: number, cb: Callback<void>): void;
/**
* Initializes the audio system.
* @param service {ServiceRecord} service record to initialize audio service.
* @param callback {Function} Callback for once socket has been created.
* @method jibo.system#initAudio
*/
function initAudio(service: ServiceRecord, parentLog: Log, callback: InitCallback): void;
}

View File

@@ -0,0 +1,214 @@
import { Event } from 'jibo-typed-events';
import { ServiceRecord, InitCallback, Callback } from '../utils/Types';
import { Log } from 'jibo-log';
/**
* @description
* Text-to-Speech
*
* ```
* var jibo = require("jibo");
* jibo.tts.on('word', (word) => {
* //respond to words
* });
* jibo.tts.speak("Hello, my name is Jibo", (err) => {
*
* });
* ```
* @namespace jibo.tts
*/
/**
* Enum for TTS modes.
* @typedef jibo.tts#TTSMode
* @property SSML {String} Advanced, allows use of SSML.
* @property TEXT {String} Default.
*/
export declare enum TTSMode {
SSML = "ssml",
TEXT = "text",
}
/**
* Enum for TTS locales.
* @typedef jibo.tts#TTSLocale
* @property EN_US {String} US English.
*/
export declare enum TTSLocale {
EN_US = "en-us",
}
/**
* Enum for TTS voices.
* @typedef jibo.tts#TTSVoice
* @property GRIFFIN {String} "Griffin" voice.
* @intdocs
*/
export declare enum TTSVoice {
GRIFFIN = "griffin",
}
/**
* Enum for TTS "boolean" values.
* @typedef jibo.tts#TTSBoolean
* @property TRUE {String}
* @property FALSE {String}
*/
export declare enum TTSBoolean {
TRUE = "TRUE",
FALSE = "FALSE",
}
export declare type TimingsCB = Callback<WordTimings>;
export declare type POSTokensCallback = Callback<POSTokens>;
export declare type POSTagsCallback = Callback<POSTags>;
export interface TTSOptions {
duration_stretch?: number;
pitch?: number;
pitchBandwidth?: number;
locale?: TTSLocale;
voice?: TTSVoice;
mode?: TTSMode;
skipWordEvents?: TTSBoolean;
volume?: number;
whisper?: TTSBoolean;
cached?: TTSBoolean;
earlyStopTime?: number;
}
export interface POSOptions {
}
export interface WordTimings {
tokentimes: {
tokens: {
name: string;
start: number;
end: number;
}[];
};
}
export interface POSTokens {
tokens: string[];
}
export interface POSTags {
tokentags: string[][];
}
export interface Word {
token: string;
timestamp: number;
status: string;
moreinfo: any[];
}
/**
* Emitted when a word is spoken.
* @name jibo.tts#word
* @type {TypedEvent}
*/
export declare const word: Event<Word>;
/**
* Emitted when a phoneme event happens
* @name jibo.tts#phone
* @type {TypedEvent}
*/
export declare const phone: Event<any>;
/**
* Emitted when an effect event happens
* @name jibo.tts#effect
* @type {TypedEvent}
*/
export declare const effect: Event<any>;
/**
* Emitted when an analysis event happens
* @name jibo.tts#analysis
* @type {TypedEvent}
*/
export declare const analysis: Event<any>;
/**
* Emitted when TTS stops
* @name jibo.tts#stopped
* @type {TypedEvent}
*/
export declare const stopped: Event<void>;
export declare let isInitialized: boolean;
export declare let isTalking: boolean;
export declare let isStopping: boolean;
export declare function init(service: ServiceRecord, parentLog: Log, cb: InitCallback): void;
/**
* Make Jibo speak.
* @method jibo.tts#speak
* @param {String} text Text for Jibo to speak.
* @param {Object} [options] Parameters to override default TTS behavior.
* @param {number} [options.duration_stretch] Stretch the utterance. 1 = no stretch, 0.5 = halve the duration, 2 = double the duration. No upper limit.
* No effect if `options.mode === jibo.tts.TTSMode.SSML`.
* @param {number} [options.pitch] Control the overall pitch of the speaker. No SSML tag to override
* Recommended value is 0.42. The recommended range is [0.2, 0.8].
* @param {number} [options.pitchBandwidth] Widen the pitch bandwidth. Recommended value is 1.
* The range is [0.0, 2.0]. `0` makes Jibo sound robotic. `2.0`
* makes Jibo sound more human.
* @param {jibo.tts~TTSMode} [options.mode] In `jibo.tts.TTSMode.SSML` mode, the `text` argument to this function should contain valid SSML. In text mode, the prompt can contain any text.
* @param {boolean} [options.skipWordEvents=false] If `true`, no word events are emitted during TTS synthesis.
* @param {Function} [callback] Notify the caller that the speech has started. If no
* callback is provided, return a `Promise`.
* @return {Promise|undefined} If no callback is provided, return a `Promise`, which is resolved when done speaking.
*/
export declare function speak(text: string, options?: TTSOptions): Promise<void>;
export declare function speak(text: string, callback: Callback<void>): void;
export declare function speak(text: string, options: TTSOptions, callback: Callback<void>): void;
/**
* Stop any speech Jibo is uttering.
* @method jibo.tts#stop
* @param {Function} [callback] Notify the caller that speech has stopped. If no callback is provided, return a `Promise`.
* @return {Promise|undefined} If no callback is provided, return a `Promise`, which gets resolved when stopped.
*/
export declare function stop(): Promise<void>;
export declare function stop(callback: Callback<void>): void;
/**
* Asynchronously retrieve a word schedule for given text (SSML markup support coming soon!).
* @method jibo.tts#getWordTimings
* @param {String} text The utterance provided to TTS for speaking.
* @param {Object} [options] Same options as {@link jibo.tts#speak}.
* @param {Function} [callback] Callback. If none is provided, return a `Promise`.
* @return {Promise|undefined}
*/
export declare function getWordTimings(text: string, options?: TTSOptions): Promise<WordTimings>;
export declare function getWordTimings(text: string, callback: TimingsCB): void;
export declare function getWordTimings(text: string, options: TTSOptions, callback: TimingsCB): void;
/**
* Start a sound effect.
* @method jibo.tts#startEffect
* @param {String} name The name of the effect.
* @param {number | string} value Either a number between 0 and 1 or a
* string parameter for the effect.
*/
export declare function startEffect(name: string, value: string | number): void;
/**
* Stop a sound effect.
* @method jibo.tts#stopEffect
* @param {String} name The name of the effect.
*/
export declare function stopEffect(name: string): void;
/**
* Update the value of a sound effect.
* @method jibo.tts#updateEffect
* @param {String} name The name of the effect.
* @param {number | string} value Either a number between 0 and 1 or a
* string parameter for the effect.
*/
export declare function updateEffect(name: string, value: string | number): void;
/**
* Tokenize a string
* @method jibo.tts#getPOSTokens
* @param {string} text The text to be tokenized.
* @param {Object} [options] Parameters to override the default POS behavior.
* @param {Function} [callback] Notify the caller about the resulting tokens
*
* @return {Promise|undefined} If no callack is provided, return a `Promise`, which is resolved when done tokenizing.
*/
export declare function getPOSTokens(text: string, options?: POSOptions): Promise<POSTokens>;
export declare function getPOSTokens(text: string, callback: POSTokensCallback): void;
export declare function getPOSTokens(text: string, options: POSOptions, callback: POSTokensCallback): void;
/**
* Get POS Tags from a list of tokens (including words, symbols, etc)
* @method jibo.tts#getPOSTags
* @param {string[]} tokens A list of tokens (including words and symbols)
* @param {Object} [options] Parameters to override default POS behavior.
* @param {Function} [callback] Notify the caller about the resulting POS tags
*
* @return {Promise|undefined} If no callback if provided, return a `Promise`, which is resolved when finishing tagging.
*/
export declare function getPOSTags(tokens: string[], options?: POSOptions): Promise<POSTags>;
export declare function getPOSTags(tokens: string[], callback: POSTagsCallback): void;
export declare function getPOSTags(tokens: string[], options: POSOptions, callback: POSTagsCallback): void;

View File

@@ -0,0 +1,52 @@
import { TouchState } from 'jibo-common-types';
import { system } from './SystemService';
import SystemEvents = system.SystemEvents;
import { Log } from 'jibo-log';
/**
* @description
* Handler for all incoming TouchSocket data.
* Will convert touch pad state to system events like touchOn,
* touchOff, and touchChanged.
* Eventually, the gesture manager will live here and emit more nuanced
* events based on touch pads, like 'stroke', 'pat', etc...
* Example:
* ```
* jibo.system.touchSocket.on('message', (touchSocketData) => {
* jibo.system.touchHandler.acceptData(touchSocketData);
* });
* ```
* @class TouchHandler
* @intdocs
* @memberof jibo.system
*/
export declare class TouchHandler {
/**
* System events to emit on touch changes.
* @name jibo.system.TouchHandler#events
* @type {jibo.system.SystemEvents}
* @readOnly
*/
events: SystemEvents;
/**
* Touch state of touch pads at the present moment.
* @name jibo.system.TouchHandler#events
* @type {jibo.system.TouchState}
* @readOnly
*/
touchState: TouchState;
/**
* Last pad state to be read through touch pads. `true` for touched. `false` for not touched.
* @name jibo.system.TouchHandler~_lastPadState
* @type {boolean[]}
* @readOnly
*/
private _lastPadState;
constructor(releaseEvents: SystemEvents, parentLog: Log);
/**
* Accept and calculate touch data based on touch events from system service.
* @param touchState {jibo.system.TouchState} Current touch state of touch pads.
* @method jibo.system.TouchHandler#acceptTouch
*/
acceptTouch(touchState: TouchState): void;
}
export default TouchHandler;

View File

@@ -0,0 +1,107 @@
import { ServiceRecord, InitCallback, Callback } from '../utils/Types';
import { Log } from 'jibo-log';
/**
* Initialize the wifi module for `jibo.init`.
* @method jibo.wifi#init
* @param service {Object} The service options
* @param service.host {String} host name
* @param service.port {String} port number
* @param callback {Function} callback
*/
export declare function init(service: ServiceRecord, parentLog: Log, callback: InitCallback): void;
/**
* Gets our full internet connection status, using the value of the most recent verifyConnection()
* call. Only use this if you recently did a verifyConnection and don't want to potentially keep
* waiting for a verifyConnection() failure.
* @method jibo.wifi#isConnected
* @return {boolean} If we are currently connected.
* @intdocs
*/
export declare function isConnected(): boolean;
/**
* Add a wifi network.
* @method jibo.wifi#addNetwork
* @param networkData {Object} The network data
* @param minVerifyTime {Integer} The minimum amount of time in seconds to verify the connection before failing
* @param callback {Function} callback
* @intdocs
*/
export declare function addNetwork(networkData: NetworkData, minVerifyTime: number, callback: ErrorCodeCallback): void;
/**
* Select (enable) a wifi network.
* @method jibo.wifi#selectNetwork
* @param ssid {String} The network name
* @param callback {Function} callback
* @intdocs
*/
export declare function selectNetwork(_ssid: string, callback: Callback<void>): void;
/**
* Remove a wifi network.
* @method jibo.wifi#removeNetwork
* @param ssid {String} The network name
* @param callback {Function} callback
* @intdocs
*/
export declare function removeNetwork(_ssid: string, callback: Callback<void>): void;
/**
* Remove all wifi networks.
* @method jibo.wifi#removeAllNetworks
* @param callback {Function} callback
* @intdocs
*/
export declare function removeAllNetworks(callback: Callback<void>): void;
/**
* Get current network stats.
* @method jibo.wifi#getCurrentNetwork
* @param callback {Function} callback
* @intdocs
*/
export declare function getCurrentNetwork(callback: Callback<NetworkStats>): void;
/**
* Get currently saved networks.
* @method jibo.wifi#getSavedNetworks
* @param callback {Function} callback
* @intdocs
*/
export declare function getSavedNetworks(callback: Callback<SavedNetworkEntry[]>): void;
/**
* Verify the current network connection if network exists.
* @method jibo.wifi#verifyConnection
* @param callback {Function} callback
* @intdocs
*/
export declare function verifyConnection(callback: ErrorCodeCallback): void;
export declare type ErrorCodeCallback = (err?: {
code: number;
description: string;
}) => void;
export declare enum NetworkType {
DHCP = 0,
STATIC = 1,
}
export interface StaticNetworkSettings {
staticIP: string;
gateway: string;
netmask: string;
dns1?: string;
dns2?: string;
}
export interface NetworkData {
ssid: string;
pswd: string;
security: string;
hidden: number;
networkType: NetworkType;
staticSettings: StaticNetworkSettings;
}
export interface NetworkStats {
ssid: string;
strength: number;
speed: number;
ip_address: string;
}
export interface SavedNetworkEntry {
index: string;
ssid: string;
current: boolean;
}

View File

@@ -0,0 +1,13 @@
/**
* @author vijay.umapathy <vijay.umapathy@jibo.com>
*/
import { AmbientTrigger } from '../utils/AmbientTrigger';
import { Log } from 'jibo-log';
/**
* Detect spikes in the input energy stream.
* Typical values range from -60dB to ~10dB depending on noise level. 0dB is the loudest sound the speaker can detect.
*/
export declare class AmbientAudioSpike extends AmbientTrigger {
constructor();
init(parentLog: Log): void;
}

View File

@@ -0,0 +1,14 @@
import { AmbientAudioSpike } from "./AmbientAudio/AmbientAudioSpike";
import { Log } from 'jibo-log';
declare class Detector {
/**
* Look for a spike in an audio signal and emit an event
*/
ambientAudioSpike: AmbientAudioSpike;
/**
* @constructor
*/
constructor();
init(parentLog: Log): void;
}
export default Detector;

View File

@@ -0,0 +1,2 @@
import DetectorService from './DetectorService';
export default DetectorService;

View File

@@ -0,0 +1,55 @@
/**
* @author vijay.umapathy <vijay.umapathy@jibo.com>
*/
import { Log } from 'jibo-log';
import { Event } from 'jibo-typed-events';
import { SpikeData } from "jibo-common-types";
/**
* @interface TriggerOptions
* @description Configuration options for an ambient trigger
* @prop {number} baselineSize baseline size (num samples)
* @prop {number} recentSize recent size (num samples)
* @prop {number} triggerSensitivity trigger if recent.mean > base.mean + triggerSensitivity * base.std
* @prop {number} triggerTimeout timeout in ms (can't fire an event more frequently than this)
* @prop {number?} minimumRecentMean The recent-mean must be at least this to trigger an event.
* @prop {number?} minimumBaselineStdDev The minimum std deviation of the baseline must be at least this to trigger an event.
* @prop {number?} alwaysEmitAbove The recent-mean value above which an event will be emitted regardless of other constraints.
*/
export interface TriggerOptions {
baselineSize: number;
recentSize: number;
triggerSensitivity: number;
triggerTimeout: number;
minimumRecentMean?: number;
alwaysEmitAbove?: number;
minimumBaselineStdDev?: number;
}
export declare class AmbientTrigger {
trigger: Event<SpikeData>;
name: string;
private samples;
private sampleCount;
private lastEmissionTime;
private baselineStats;
private recentStats;
private options;
private log;
constructor(name: string, options: TriggerOptions);
resetSize(baselineSize: number, recentSize: number): void;
setTriggerSensitivity(value: number): void;
init(parentLog: Log): void;
protected addSample(value: number): void;
private baselineFilled();
private recentFilled();
private noRecentEmission();
/**
* Determines whether a spike event should trigger
* @returns {TriggerData} Either a populated object or an uninitialized (null) object. An unintialized object indicates that the trigger will not be emitted.
*/
private shouldTrigger();
/**
* Are the conditions met for emitting an event?
*/
private conditionMet();
private mod(n, m);
}

View File

@@ -0,0 +1,39 @@
/**
* base on https://glastra.net/online-calculation-of-mean-variance-and-standard-deviation/
*
* @author vijay.umapathy <vijay.umapathy@jibo.com>
*/
export declare class OnlineMeanAndVariance {
private _n;
private _mean;
private _m2;
constructor();
/**
* Adds an element to the sample.
*/
add(value: number): void;
/**
* Removes an element from the sample.
*/
remove(value: number): void;
/**
* Returns the current number of samples
*/
numSamples(): number;
/**
* Returns the mean
*/
mean(): number;
/**
* Returns mean squared
*/
meanSquared(): number;
/**
* return the variance of a distribution
*/
variance(): number;
/**
* return the standard deviation of a distribution
*/
stdDev(): number;
}

View File

@@ -0,0 +1,4 @@
import { AmbientAudioSpike } from "../AmbientAudio/AmbientAudioSpike";
export declare class TunableDebug {
static setup(audioTrigger: AmbientAudioSpike): void;
}

View File

@@ -0,0 +1,62 @@
import { Time } from "animation-utilities";
import { IdentityEvents } from "./IDEvents";
import { SpeakerRecord, AudioData } from "jibo-common-types";
import { Log } from 'jibo-log';
import { types as JetstreamTypes } from '@jibo/jetstream-client';
/**
* @description
* Extra properties tacked on to LPS Records
* @typedef jibo.lps.identity#EXTRA_LPS_PROPERTIES
* @param {string} was_in_fov Whether or not the entity was in FOV in last update tick.
* @intdocs
*/
export declare const EXTRA_LPS_PROPERTIES: string[];
/**
* @description
* Convert data from various raw forms into standardized SensoryRecords, extract relevant
* data and events for skills.
* @class DataConverter
* @memberof jibo.lps.identity
* @intdocs
*/
export declare class DataConverter {
/**
* Events for IdentityService to listen to to emit public events.
* @name jibo.lps.identity.DataConverter#events
* @type {jibo.lps.identity.IdentityEvents}
*/
events: IdentityEvents;
constructor(events: IdentityEvents);
init(parentLog: Log): void;
/**
* @description Get the most recent speaker as calculated by the data converter
* @method jibo.lps.identity.DataConverter#mostRecentSpeaker
* @param {number} msAge the acceptable age in ms of the most recent speaker request.
* @type {jibo.lps.identity.SensoryRecord}
*/
mostRecentSpeaker(msAge: number): SpeakerRecord;
/**
* Get the last time somebody spoke.
* @name jibo.lps.identity.DataConverter#lastSpokeTime
* @type {jibo.animate.Time}
*/
lastSpokeTime: Time;
/**
* @method jibo.lps.identity.DataConverter#acceptAwareness
* @description Accept information through LPS Vision socket.
* @param {any} data Raw data from LPS socket.
*/
acceptAwareness(data: any): void;
/**
* @method jibo.lps.identity.DataConverter#acceptAudio
* @param {jibo.lps#AudioData} data Raw data from LPS socket.
* @intdocs
*/
acceptAudio(data: AudioData): void;
/**
* @description Extract speaker ID information from raw GL data
* @param {any} data Raw speaker ID data from GL Service
* @method jibo.lps.identity.DataConverter#acceptSpeakerId
*/
acceptSpeakerId(data: JetstreamTypes.SpeakerIDData): void;
}

View File

@@ -0,0 +1,58 @@
import { Event, EventContainer } from 'jibo-typed-events';
import { LPSEntity, PresenceRecord, HJData } from "jibo-common-types";
/**
* @description
* IdentityEvents that can be subscribed to.
* ```
* jibo.lps.identity.events.presenceStarted.on(() => {});
* ```
* @memberof jibo.lps.identity
* @class IdentityEvents
*/
export declare class IdentityEvents extends EventContainer {
/**
* Fires upon transition from nobody being present to at least one person being present
* in the robot's environment.
* @name jibo.lps.identity.IdentityEvents#presenceStarted
* @type {Event<any>}
*/
presenceStarted: Event<PresenceRecord>;
/**
* Fires upon transition from at least one person being present to nobody being present
* in the robot's environment.
* @name jibo.lps.identity.IdentityEvents#presenceEnded
* @type {Event<any>}
*/
presenceEnded: Event<PresenceRecord>;
/**
* Fires when a person in the robot's environment becomes uniquely identified.
* @name jibo.lps.identity.IdentityEvents#idAcquired
* @type {Event<string>}
*/
idAcquired: Event<PresenceRecord>;
/**
* Fires when a previously-identified person disappears.
* @name jibo.lps.identity.IdentityEvents#idLost
* @type {Event<string>}
*/
idLost: Event<PresenceRecord>;
/**
* Fires when a new face enters Jibo's FOV
* @name jibo.lps.identity.IdentityEvents#visibleFaceStarted
* @type {Event<string>}
*/
visibleFaceStarted: Event<LPSEntity>;
/**
* Fires when a face leaves Jibo's FOV.
* @name jibo.lps.identity.IdentityEvents#visibleFaceStopped
* @type {Event<string>}
*/
visibleFaceStopped: Event<LPSEntity>;
/**
* Fires when audio stream gets a HJ event
* @name jibo.lps.identity.IdentityEvents#hjEvent
* @type {Event<string>}
*/
hjEvent: Event<HJData>;
constructor();
}

View File

@@ -0,0 +1,86 @@
import IdentityInterface from "./IdentityServiceInterface";
import { IdentityEvents } from './IDEvents';
import { lps } from "../LPSService";
import { LPSEntity, SpeakerRecord, Person } from "jibo-common-types";
import { Log } from 'jibo-log';
/**
* @description
* Identity Module.
* Get identity information from Jibo's LPS. including
* present persons, present speaker, person location, as well as
* detailed information about speaker and face ID.
*
* ```
* var jibo = require("jibo");
* jibo.lps.identity.getPresentPersons();
* ```
* @namespace jibo.lps.identity
*/
declare class Identity implements IdentityInterface {
/**
* Identity Events
* @name jibo.lps.identity#events
* @type {jibo.lps.identity.IdentityEvents}
*/
events: IdentityEvents;
/**
* @param {LPSService} lps service instance
* @constructor
*/
constructor(lpsService: typeof lps);
/**
* @description Begins the polling of LPS websocket on timescale. Sends
* data to DataConverter to be handled.
* @method jibo.lps.identity#init
*/
init(parentLog: Log): void;
/**
* @description Returns `true` if one or more persons are present in the robot's environment.
* @returns {boolean} `true` if someone is present.
* @method jibo.lps.identity#isAnyonePresent
*/
isAnyonePresent(): boolean;
/**
* @description Returns `true` if one or more persons are in the robot's field of view.
* @returns {boolean} `true` if someone is visible.
* @method jibo.lps.identity#isAnyoneVisible
*/
isAnyoneVisible(): boolean;
/**
* @description Returns a list of persons who are present in the robot's environment.
* Persons may be identified (known/in-loop) or unidentified.
* @returns {Array<jibo.lps.identity#Person>} List of present persons.
* @method jibo.lps.identity#getPresentPersons
*/
getPresentPersons(): Person[];
/**
* @description Returns a list of persons who are in the robots field of view
* Persons may be identified (known/in-loop) or unidentified.
* @returns {Array<jibo.lps.identity#Person>} List of visible persons.
* @method jibo.lps.identity#getVisiblePersons
*/
getVisiblePersons(): Person[];
/**
* @description Call this method to provide top-down ("ground truth") notification that a particular person is present
* in the robot's environment.
* @param {string} id - Unique ID of the person who is present.
* @param {Function} [callback] Callback for information about LPS call request status.
* @method jibo.lps.identity#setPresentPerson
*/
setPresentPerson(id: string, callback: () => void): void;
/**
* @description Returns the most recent speaker out of the persons who are present in the robot's environment,
* or null if no such person is present.
* @param {number} [age=30000] Acceptable age in ms of the most recent speaker event. Defaults 30 seconds.
* @returns {jibo.lps.identity#Person} Person who is speaking.
* @method jibo.lps.identity#getActiveSpeaker
*/
getActiveSpeaker(age?: number): SpeakerRecord;
/**
* @description Gets the faces currently in jibo's FOV.
* @returns {Map} Faces presently in Jibo's FOV as map of string ==> jibo.lps#LPSEntity
* @method jibo.lps.identity#getVisibleFaces
*/
getVisibleFaces(): Map<string, LPSEntity>;
}
export default Identity;

View File

@@ -0,0 +1,36 @@
import { IdentityEvents } from './IDEvents';
import { SpeakerRecord, Person } from "jibo-common-types";
interface IdentityServiceInterface {
events: IdentityEvents;
/**
* Returns true if one or more persons are present in the robot's environment.
*/
isAnyonePresent(): boolean;
/**
* Returns true if one or more persons are visible in the robot's field of view.
*/
isAnyoneVisible(): boolean;
/**
* Returns a list of persons who are present in the robot's environment.
* Persons may be identified (known/in-loop) or unidentified.
*/
getPresentPersons(): Person[];
/**
* Returns a list of persons who are visible in the robot's field of view.
* Persons may be identified (known/in-loop) or unidentified.
*/
getVisiblePersons(): Person[];
/**
* Call this method to provide top-down ("ground truth") notification that a particular person is present
* in the robot's environment.
* @param {string} id - Unique ID of the person who is present.
* @param {Function} cb - Callback for LPS response.
*/
setPresentPerson(id: string, cb: Function): any;
/**
* Returns the most recent speaker out of the persons who are present in the robot's environment,
* or null if no such person is present.
*/
getActiveSpeaker(): SpeakerRecord;
}
export default IdentityServiceInterface;

View File

@@ -0,0 +1,2 @@
import IdentityService from './IdentityService';
export default IdentityService;

View File

@@ -0,0 +1,15 @@
import { Analytics, Jetstream, Versions, GlobalEvents } from './Types';
export interface ServiceContainer {
analytics?: Analytics;
jetstream?: Jetstream;
versions?: Versions;
globalEvents?: GlobalEvents;
}
export declare class ServiceOwner {
private static _owner;
static init(owner: ServiceContainer): void;
static readonly analytics: Analytics;
static readonly jetstream: Jetstream;
static readonly versions: Versions;
static readonly globalEvents: GlobalEvents;
}

View File

@@ -0,0 +1,24 @@
import { Event } from 'jibo-typed-events';
import { types as JetstreamTypes } from '@jibo/jetstream-client';
export declare type ServiceRecord = {
name?: string;
host: string;
port: number;
};
export declare type InitCallback = (err?: Error | string) => void;
export declare type Callback<T = any> = (err?: any, result?: T) => void;
export interface Analytics {
track(event: string, props?: any): void;
}
export interface Jetstream {
events: {
speakerID: Event<JetstreamTypes.SpeakerIDData>;
};
}
export interface Versions {
requiresPlatform: string;
supported(version: string): boolean;
}
export interface GlobalEvents {
touchStop: Event<boolean[]>;
}

View File

@@ -0,0 +1,19 @@
export declare enum RequestType {
POST = 0,
GET = 1,
}
export declare const ErrorStatus: {
ABORTED: string;
NETWORK_ERROR: string;
DATA_ERROR: string;
};
export declare class WebCommunication {
static readonly ErrorStatus: {
ABORTED: string;
NETWORK_ERROR: string;
DATA_ERROR: string;
};
static readonly RequestType: typeof RequestType;
static sendMessage(requestType: RequestType, path: string, data: any, dataVerification: (response: any, status: number) => boolean, cb: (err: Error, response: any, status: number) => void): XMLHttpRequest;
}
export default WebCommunication;

View File

@@ -0,0 +1,6 @@
import { ServiceContainer } from './utils/ServiceOwner';
import { ServiceRecord, InitCallback } from './utils/Types';
import { lps } from './services/LPSService';
export { lps };
export declare type AsyncMethod = (callback: Function) => void;
export declare function init(owner: ServiceContainer, records: ServiceRecord[], callback: InitCallback, initWrapper?: (initFunction: AsyncMethod, service: string) => AsyncMethod): void;

View File

@@ -0,0 +1,388 @@
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.index = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
if (!global.XMLHttpRequest) {
global.XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest;
Object.defineProperty(global.XMLHttpRequest.prototype, 'response', {
get: function () {
if (this.responseType === 'json') {
try {
this.__response = JSON.parse(this.responseText);
}
catch (e) {
this.responseType = null;
}
}
if (this.__response) {
return this.__response;
}
return this.responseXML || this.responseText;
}
});
}
const jibo_log_1 = require("jibo-log");
const async = require("async");
const ServiceOwner_1 = require("./utils/ServiceOwner");
const log = new jibo_log_1.Log('SF.ServiceClients');
const services = {};
const LPSService_1 = require("./services/LPSService");
exports.lps = LPSService_1.lps;
services.lps = LPSService_1.lps.init;
function init(owner, records, callback, initWrapper) {
ServiceOwner_1.ServiceOwner.init(owner);
const tasks = [];
records.forEach((service) => {
const initFunction = services[service.name];
if (initFunction) {
let actualInit = (callback) => {
initFunction(service, log, callback);
};
if (initWrapper) {
actualInit = initWrapper(actualInit, service.name);
}
tasks.push(actualInit);
}
});
async.parallel(tasks, callback);
}
exports.init = init;
},{"./services/LPSService":2,"./utils/ServiceOwner":3,"async":undefined,"jibo-log":undefined,"xmlhttprequest":undefined}],2:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const async = require("async");
const jibo_client_framework_1 = require("jibo-client-framework");
let log;
let lpsData = {};
lpsData.motionData = {
cameras: [],
entities: [],
ts: [0, 0]
};
lpsData.audioData = {
entities: [],
ts: [0, 0]
};
let httpUrl;
let lpsServiceUrl;
let motionSocket;
let audioSocket;
let _demandDetectQueue = [];
let _demandDetectRedetect = false;
class lps {
static get httpUrl() {
return httpUrl;
}
static get motionData() {
return lpsData.motionData;
}
static get audioData() {
return lpsData.audioData;
}
}
exports.lps = lps;
(function (lps) {
function getClosestVisualEntity() {
let entity;
if (lpsData.motionData !== undefined &&
lpsData.motionData.entities !== undefined &&
lpsData.motionData.entities.length > 0) {
entity = lpsData.motionData.entities[0];
}
return entity;
}
lps.getClosestVisualEntity = getClosestVisualEntity;
function getVisualEntityById(id) {
let entity;
for (let i = 0; i < lpsData.motionData.entities.length; i++) {
let itr = lpsData.motionData.entities[i];
if (itr && (itr.id === id)) {
entity = itr;
break;
}
}
return entity;
}
lps.getVisualEntityById = getVisualEntityById;
function getClosestAudibleEntity() {
let entity;
if (lpsData.audioData !== undefined &&
lpsData.audioData.entities !== undefined &&
lpsData.audioData.entities.length > 0) {
entity = lpsData.audioData.entities[0];
}
return entity;
}
lps.getClosestAudibleEntity = getClosestAudibleEntity;
function getAudibleEntityById(id) {
let entity;
for (let i = 0; i < lpsData.audioData.entities.length; i++) {
let itr = lpsData.audioData.entities[i];
if (itr && (itr.id === id)) {
entity = itr;
break;
}
}
return entity;
}
lps.getAudibleEntityById = getAudibleEntityById;
function getCameraParameters(cameraID, cb) {
if (httpUrl === undefined) {
cb('Identity service is not initialized', null);
return;
}
let params = {};
params.cameraId = cameraID;
let request = new XMLHttpRequest();
request.open("GET", httpUrl + '/lps/camera/calibration?cameraId=' + cameraID, true);
request.onreadystatechange = () => {
if (request.readyState === 4) {
if (request.status >= 200 && request.status <= 299) {
try {
const data = JSON.parse(request.response);
cb(null, data);
}
catch (e) {
const errorData = 'Response is not JSON.';
cb(errorData, null);
}
}
else {
let msg = 'LPS service unavailable:';
if (request.statusText !== undefined && request.statusText !== "") {
msg += request.statusText;
}
let errorData = null;
if (request.response) {
try {
errorData = JSON.parse(request.response);
}
catch (e) {
errorData = 'Response is not JSON.';
}
}
cb(msg, errorData);
}
}
};
request.send();
}
lps.getCameraParameters = getCameraParameters;
function getFaces(cameraID, cb, kind, initTracks = false) {
if (httpUrl === undefined) {
cb('Identity service is not initialized', null);
return;
}
let params = {};
params.camera_id = cameraID;
params.kind = kind;
params.init_tracks = initTracks;
let request = new XMLHttpRequest();
request.open("POST", httpUrl + '/lps/faces', true);
request.onreadystatechange = () => {
if (request.readyState === 4) {
if (request.status >= 200 && request.status <= 299) {
try {
const data = JSON.parse(request.response);
cb(null, data);
}
catch (e) {
const errorData = 'Response is not JSON.';
cb(errorData, null);
}
}
else {
let msg = 'LPS service unavailable:';
if (request.statusText !== undefined && request.statusText !== "") {
msg += request.statusText;
}
let errorData = null;
if (request.response) {
try {
errorData = JSON.parse(request.response);
}
catch (e) {
errorData = 'Response is not JSON.';
}
}
cb(msg, errorData);
}
}
};
request.send(JSON.stringify(params));
}
lps.getFaces = getFaces;
function demandDetect(cameraID, redetect, cb) {
log.debug("demandDetect", cameraID, redetect);
if (!!_demandDetectQueue.length) {
if (_demandDetectRedetect === redetect) {
_demandDetectQueue.push(cb);
return;
}
else {
cb('Cannot Demand Detect while call with redetect:' + _demandDetectRedetect + ' is in progress', null);
return;
}
}
_demandDetectRedetect = redetect;
_demandDetectQueue.push(cb);
if (httpUrl === undefined) {
_clearDemandDetectCallbacks('LPS service is not initialized', null);
return;
}
const data = {
'camera_id': cameraID,
'roi': {
'left': 0,
'top': 0,
'right': 640,
'bottom': 360
},
'redetect': redetect
};
const request = new XMLHttpRequest();
request.open('POST', httpUrl + '/lps/demand_detect', true);
request.onreadystatechange = () => {
if (request.readyState === 4) {
if (request.status >= 200 && request.status <= 299) {
if (request.response) {
let response = {};
try {
response = JSON.parse(request.response);
_clearDemandDetectCallbacks(null, response.detections);
}
catch (e) {
cb(e, null);
}
}
else {
_clearDemandDetectCallbacks('No data received from LPS demand detection', null);
}
}
else {
let msg = 'Demand Detect failure:';
if (request.statusText !== undefined && request.statusText !== '') {
msg += request.statusText;
}
_clearDemandDetectCallbacks(msg, null);
}
}
};
request.send(JSON.stringify(data));
}
lps.demandDetect = demandDetect;
function _clearDemandDetectCallbacks(err, data) {
_demandDetectQueue.forEach((callback) => {
callback(err, data);
});
_demandDetectQueue = [];
}
lps._clearDemandDetectCallbacks = _clearDemandDetectCallbacks;
function readBarcode(cb) {
if (httpUrl === undefined) {
cb('Barcode service is not initialized', null);
return;
}
let request = new XMLHttpRequest();
request.open("GET", httpUrl + '/lps/barcode', true);
request.onreadystatechange = () => {
if (request.readyState === 4) {
if (request.status >= 200 && request.status <= 299) {
if (request.response) {
let response = JSON.parse(request.response);
cb(null, response.barcodes);
}
else {
cb('No data received from barcode service', null);
}
}
else {
let msg = 'Barcode service unavailable';
if (request.statusText !== undefined && request.statusText !== "") {
msg = request.statusText;
}
cb(msg, null);
}
}
};
request.send();
}
lps.readBarcode = readBarcode;
function setPresence(presenceData, cb) {
if (httpUrl === undefined) {
cb('LPS Service is not initialized', null);
return;
}
let request = new XMLHttpRequest();
request.open("POST", httpUrl + '/lps/presence', true);
request.onreadystatechange = () => {
if (request.readyState === 4) {
if (request.status >= 200 && request.status <= 299) {
if (request.response) {
const response = JSON.parse(request.response);
cb(null, response);
}
else {
cb('No data received from barcode service', null);
}
}
else {
let msg = 'Failed to set presence';
if (request.statusText !== undefined && request.statusText !== "") {
msg += request.statusText;
}
cb(msg, null);
}
}
};
request.send(JSON.stringify(presenceData));
}
lps.setPresence = setPresence;
function init(service, parentLog, cb) {
log = parentLog.createChild('LPS');
lpsServiceUrl = "ws:" + service.host + ":" + service.port;
httpUrl = "http://" + service.host + ":" + service.port;
async.parallel([
_createMotionSocket,
_createAudioSocket
], cb);
}
lps.init = init;
function _createMotionSocket(cb) {
motionSocket = new jibo_client_framework_1.WSClient(lpsServiceUrl + "/lps/visual_awareness");
motionSocket.on('error', () => {
console.error(`Error opening visual awareness socket at ${lpsServiceUrl}/visual_awareness`);
});
motionSocket.on('message', (data) => {
lpsData.motionData = data;
});
cb();
}
lps._createMotionSocket = _createMotionSocket;
function _createAudioSocket(cb) {
audioSocket = new jibo_client_framework_1.WSClient(lpsServiceUrl + "/lps/audible_awareness");
audioSocket.on('error', () => {
console.error(`Error opening audible awareness socket at ${lpsServiceUrl}/audible_awareness`);
});
audioSocket.on('message', (data) => {
lpsData.audioData = data;
});
cb();
}
lps._createAudioSocket = _createAudioSocket;
})(lps = exports.lps || (exports.lps = {}));
},{"async":undefined,"jibo-client-framework":undefined}],3:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class ServiceOwner {
static init(owner) {
this._owner = owner;
}
}
exports.ServiceOwner = ServiceOwner;
},{}]},{},[1])(1)
});
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,109 @@
import { ServiceRecord, InitCallback } from '../utils/Types';
import { Log } from 'jibo-log';
/**
* @description
* Local Perceptual Space
*
* @namespace jibo.lps
*/
export declare class lps {
/**
* Return the full state of the Jibo's local perceptual space.
* @name jibo.lps#motionData
* @type {*|{cameras: Array, entities: Array}}
* @readOnly
*/
static readonly motionData: any;
/**
* Return the full audio state of the Jibo's local perceptual space.
* @name jibo.lps#audioData
* @type {any}
* @readOnly
*/
static readonly audioData: any;
}
export declare namespace lps {
/**
* Callback for LPS Service
* @callback jibo.lps~Callback
* @param [err] {String | Error} String of error text, or null if success.
* @param [data] {any} Data of successful call. Varies by function.
*/
type Callback = (err?: string | Error, data?: any) => void;
/**
* Get the visual entity closest to Jibo.
* @method jibo.lps#getClosestVisualEntity
*
* @return The closest visual entity to Jibo. If one does not exist, returns undefined.
*/
function getClosestVisualEntity(): any;
/**
* Get a visual entity by specified ID.
* @method jibo.lps#getVisualEntityById
* @param id {Number} ID of the entity to get.
* @return The specified visual entity. If it does not exist, returns undefined.
*/
function getVisualEntityById(id: number): any;
/**
* Get the closest audible entity to Jibo.
* @method jibo.lps#getClosestAudibleEntity
*
* @return The closest audible entity to Jibo. If one does not exist, returns undefined.
*/
function getClosestAudibleEntity(): any;
/**
* Get an audible entity by specified ID.
* @method jibo.lps#getAudibleEntityById
* @param id {Number} ID of the entity to get.
* @return The specified audible entity. If it does not exist, returns undefined.
*/
function getAudibleEntityById(id: number): any;
/**
* Request camera calibration data
* @param {number} cameraID ID for camera to be used.
* @param {jibo.lps~Callback} cb Callback for the function which returns parsed data.
* @method jibo.lps#getCameraParameters
*/
function getCameraParameters(cameraID: number, cb: Callback): void;
/**
* Forces a one-shot full frame face detection and reports all faces detected
* @param {number} cameraID ID for camera to be used.
* @param {jibo.lps~Callback} cb Callback for the function which returns parsed data.
* @param {string} [kind=faces] Kind of entities to search for.
* @param {boolean} [initTracks=false] Hint to try to init the face ids which are tracked.
* @method jibo.lps#getFaces
*/
function getFaces(cameraID: number, cb: Callback, kind?: string, initTracks?: boolean): void;
/**
* Force the LPS to run face detection on jibo's present field of vision.
* @param cameraID=0 {Number} (0|1) ID of Camera to run algorithm on.
* @param redetect=false {Boolean} Should redetect (rerun algorithm) until a face is detected.
* @param cb {jibo.lps~Callback} Callback with null error if detection algorithm ran, error otherwise. Results from face detection will only be represented through {@link jibo.lps#motionData}.
* @method jibo.lps#demandDetect
*/
function demandDetect(cameraID: number, redetect: boolean, cb: Callback): void;
/**
* @description Barcode data object.
* @typedef {Object} jibo.lps~BarcodeData
* @property {int} type `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), or `10` (Code 128).
* @property {string} content Payload of the barcode data.
*/
/**
* Read barcode or QR code data.
* @method jibo.lps#readBarcode
* @param {Function} cb Callback for the function.
* @return {jibo.lps~BarcodeData} Barcode data object.
*/
function readBarcode(cb: any): void;
/**
* Set a present person.
* @method jibo.lps#setPresence
* @param {jibo.lps.identity.PresenceRecord} presenceData Data to set around environment.
* @param {Function} cb Callback for the function.
*/
function setPresence(presenceData: any, cb: any): void;
function init(service: ServiceRecord, parentLog: Log, cb: InitCallback): void;
function _createMotionSocket(cb: any): void;
function _createAudioSocket(cb: any): void;
}

View File

@@ -0,0 +1,6 @@
export interface ServiceContainer {
}
export declare class ServiceOwner {
private static _owner;
static init(owner: ServiceContainer): void;
}

View File

@@ -0,0 +1,24 @@
import { Event } from 'jibo-typed-events';
import { types as JetstreamTypes } from '@jibo/jetstream-client';
export declare type ServiceRecord = {
name?: string;
host: string;
port: number;
};
export declare type InitCallback = (err?: Error | string) => void;
export declare type Callback<T = any> = (err?: any, result?: T) => void;
export interface Analytics {
track(event: string, props?: any): void;
}
export interface Jetstream {
events: {
speakerID: Event<JetstreamTypes.SpeakerIDData>;
};
}
export interface Versions {
requiresPlatform: string;
supported(version: string): boolean;
}
export interface GlobalEvents {
touchStop: Event<boolean[]>;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,52 @@
{
"name": "jibo-service-clients",
"version": "4.0.6",
"description": "",
"main": "lib/jibo-service-clients.js",
"typings": "lib/dts/index.d.ts",
"scripts": {
"test": "gulp test && istanbul report && yarn coverage:check",
"test:debug": "gulp test --debug",
"test:report": "gulp test-report",
"coverage:check": "istanbul check-coverage --statements 10 --branches 0 --functions 0 --lines 10",
"build": "gulp debug",
"build:release": "gulp",
"clean": "gulp clean-all",
"watch": "gulp watch",
"docs": "gulp docs",
"docs:public": "gulp docs-public"
},
"engines": {
"node": ">=6.0"
},
"dependencies": {
"@types/node": "6.0.94",
"@jibo/jetstream-client": "^2.0.0",
"animation-utilities": "^5.0.0",
"async": "^2.6.0",
"jibo-client-framework": "^4.0.0",
"jibo-common-types": "^4.0.0",
"jibo-typed-events": "^6.0.0",
"xmlhttprequest": "^1.8.0"
},
"devDependencies": {
"@types/node": "6.0.94",
"@types/async": "2.0.42",
"gulp": "^3.9.1",
"istanbul": "^0.4.5",
"jibo-gulp": "^8.0.0",
"jibo-tunable": "^1.2.0",
"jibo-log": "^5.0.0"
},
"repository": {
"type": "git",
"url": "git@github.jibo.com:sdk/sdk.git"
},
"files": [
"lib",
"dts"
],
"license": "UNLICENSED",
"distribution": "PROPRIETARY AND CONFIDENTIAL - NOT FOR DISTRIBUTION",
"copyright": "Copyright (c) 2014-2018 Jibo, Inc. All Rights Reserved"
}

View File

@@ -0,0 +1,6 @@
Notes:
* Services exported as namespaces so that types are accessible and we can expose types easily from the jibo module
* Some services explicitly export a static class and a namespace - this is to export a namespace that has getter methods, as typescript merges them
To Do:
* Clean up SchedulerService to rely on \_sendRequest() more - possibly all services to use WebCommunication?

View File

@@ -0,0 +1,19 @@
{
"compilerOptions": {
"target": "es6",
"allowJs": false,
"module": "commonjs",
"moduleResolution": "node",
"experimentalDecorators": true,
"typeRoots": ["./node_modules/@types", "../../node_modules/@types"],
"types": ["node", "async"]
},
"compileOnSave": false,
"include": [
"src/index.ts",
"src/utils/ServiceOwner.ts",
"src/utils/Types.ts",
"src/services/LPSService.ts",
"typings/index.d.ts"
]
}

View File

@@ -0,0 +1,17 @@
{
"compilerOptions": {
"target": "es6",
"allowJs": false,
"module": "commonjs",
"moduleResolution": "node",
"noUnusedLocals": true,
"experimentalDecorators": true,
"typeRoots": ["./node_modules/@types", "../../node_modules/@types"],
"types": ["node", "async"]
},
"compileOnSave": false,
"include": [
"src/**/*.ts",
"typings/index.d.ts"
]
}

View File

@@ -0,0 +1,3 @@
{
"extends": "../../tslint_base.json"
}