Commit Graph

1183 Commits (mark-ii/ignore-build-files)

Author SHA1 Message Date
Kris Gesling ad32a7a873 move bus connect method to process_utils 2021-01-11 16:57:25 +09:30
Kris Gesling 960f650c88 Skills service to use common bus client method 2021-01-11 16:57:25 +09:30
Kris Gesling 54eac52b11 merge dev into mark-2 branch 2021-01-06 22:17:25 +09:30
Kris Gesling 013726e5bc
Merge pull request #2785 from timgates42/bugfix_typo_returns
docs: fix simple typo, retruns -> returns
2021-01-05 12:07:15 +09:30
Kris Gesling 81bd4f3468
Merge pull request #2707 from forslund/feature/remote-startup-on-change
Fix remote settings overwrite at startup
2021-01-05 10:10:40 +09:30
JarbasAI f1d7141bf2
fix/intent_api (#2786)
* fix/fix/intent_api

* get active skills

* fix/intent_api

* fix/intent_api

* typos

Co-authored-by: jarbasal <jarbasai@mailfence.com>
2020-12-31 12:56:44 +09:30
Åke Forslund bd19d1673c Fix remote settings overwrite at startup
Mycroft always mangeled any local settings changes at startup.

This caches the last settings from home on disk and only updates skills
_if_ there is a change.

This means that as if a member is changed locally (manually edited or
changed by the skill itself) it will be kept until another change is made
to the skill on Home.
2020-12-29 23:03:21 +01:00
Kris Gesling fd5c8bb5e3 Merge branch 'dev' into feature/mark-2 2020-12-29 14:31:09 +09:30
Tim Gates 66270c3cd7
docs: fix simple typo, retruns -> returns
There is a small typo in mycroft/skills/skill_data.py.

Should read `returns` rather than `retruns`.
2020-12-24 08:18:14 +11:00
Kris Gesling b0884301a3
Merge pull request #2734 from MycroftAI/feat/skill_settings_sync
skill settings sync flag
2020-12-02 10:45:45 +09:30
jarbasal 4c84f66e15 skill settings sync flag 2020-12-01 23:56:15 +11:00
Åke Forslund eb78d67ff7 Fix AdaptIntent without name. 2020-11-24 10:49:04 +01:00
Kris Gesling 12401b8b59
Merge pull request #2666 from MycroftAI/feat/extend_timeout
cps extend timeout
2020-11-15 10:52:16 +09:30
Kris Gesling f2b7b0251b
Merge pull request #2757 from forslund/feature/ready-check
Feature: add Process Status and ensure all services ready
2020-11-12 09:16:43 +09:30
Åke Forslund 731de16d1f Properly fix readthedocs issue with yaml 2020-11-06 07:29:12 +01:00
Kris Gesling 0258009857
Merge pull request #2737 from MycroftAI/feat/appstore_warning
msm appstore warning
2020-10-28 16:13:18 +09:30
jarbasal 8b7a45d02f msm appstore warning 2020-10-26 16:44:52 +00:00
Kris Gesling 3ca15e9bb7 ensure load_status is initialized on load failure 2020-10-26 16:18:20 +09:30
Åke Forslund 6eeeefb0ac Always use the plural "Skills" for the service
Change all strings referring to the service to use "Skills service"
2020-09-27 09:58:08 +02:00
Åke Forslund 225ece7737 Add started and alive hooks to skills process 2020-09-27 09:58:08 +02:00
Kris Gesling 582faab843 Move ready check to enclosure; use ProcessStatus
Previously Mycroft reported mycroft.ready when Padatious had
finished it's first training run. This check has been shifted
to the enclosure service, and starts checking once the Padatious
training is complete.

Currently checks on readiness of audio, speech and skills services.
2020-09-27 09:58:02 +02:00
Kris Gesling 5e8474cd72 Add optional message argument
When called over the messagebus the message is passed to the handler,
thereby throwing a TypeError as it wasn't expecting 2 positional args.
2020-09-25 15:55:42 +09:30
Kris Gesling e9add604fd add ProcessStatus to key services 2020-09-25 06:52:27 +02:00
Kris Gesling fa0b0dbd41 Change names for consistency 2020-09-25 06:52:25 +02:00
Åke Forslund 633dea1ac5 Add ProcessStatus class
ProcessStatus tracks the process status and allows callbacks on changes
and status queries over the messagebus.

StatusCallbackMap is used to setup the callbacks

ProcessState is an enum tracking the different states.
2020-09-25 06:51:20 +02:00
Kris Gesling ae72ebd247
Merge pull request #2599 from forslund/refactor/intent-service
Refactor intent service
2020-09-23 10:24:16 +09:30
Kris Gesling 571e6d3e61
Merge pull request #2659 from forslund/feature/detect-bad-modification-times
Don't reload skill if a mod time is in the future
2020-09-22 20:55:35 +09:30
jarbasal 7e1e3e4bc2 extend timeout 2020-09-20 21:38:33 +01:00
katridi a185a9a4bf
Issue-2567 - Fixing not initialized dialog_render (#2685)
Fixes #2567
2020-09-15 22:10:39 +09:30
Åke Forslund b71bedd471 initialize status members before bus handlers
self._loaded_status was accessed from a message handler, if a message is
received at the precisely wrong time an exception may occur. This fixes
the init order.

Also moves the skill_updater creation to be fore the handlers are
registered.
2020-09-07 06:34:07 +02:00
Åke Forslund 70d9868f84 Don't update if autoupdate is disabled 2020-08-21 14:43:41 +02:00
Kris Gesling 1b64285bd0
Merge pull request #2669 from MycroftAI/remove/converse-error
remove previously deprecated error message
2020-08-21 00:31:17 +00:00
Kris Gesling 519f7e19cd
Merge pull request #2674 from MycroftAI/feat/gui_cps_status
add GUI + PAUSED to track status
2020-08-20 21:28:14 +00:00
Åke Forslund 988b99b7fe Add missing watchdog argument
Fix retry call to _initialize_skill_manager() when Msm cache doesn't exist locally.
2020-08-20 21:22:55 +02:00
jarbasal a8e9af8505 add GUI, skill and enclosure to track status 2020-08-20 17:44:48 +09:30
Åke Forslund fe4daa2565 Update Query api methods 2020-08-19 18:24:59 +02:00
Kris Gesling 58a5cddbd6 remove previously deprecated error msg 2020-08-18 22:14:32 +09:30
Åke Forslund 10092c3a9e Don't reload skill if a mod time is in the future
This stops a skill from being reloaded repeatedly if a file gets a bad
modification time.

It also logs the offending files in the error message.
2020-08-18 09:52:59 +02:00
Åke Forslund 81570f14e9 WIP fix pylint warnings in context manager 2020-08-14 13:40:16 +02:00
Kris Gesling 8065f5cbee do not call max if files list is empty 2020-08-14 21:05:32 +09:30
Åke Forslund 8089411d93 Fix warnings from pylint in intent_service.py
- Add missing docstrings
- fix short variable names
- restructure return code
2020-08-13 09:28:23 +02:00
Åke Forslund d9281d7795 Handle pylint warnings for padatious_service 2020-08-13 09:28:23 +02:00
Åke Forslund 841ed2dcfc Update for pylint conformity for adapt module
- imports
- All docstring
- AdaptService method warnings
2020-08-13 09:28:23 +02:00
Åke Forslund 618daac9a4 Pair utterances with normalized versions
- Move setting original utterance to the respective intent service
- Remove botch limiting the intent service to a single STT hypothesis
2020-08-13 09:28:18 +02:00
Åke Forslund 917127638b Remove workaround for adapt one_of intents
This issue was properly fixed in Adapt 0.3.5.
2020-08-13 08:18:55 +02:00
Åke Forslund 008ab372fd FallbackService encapsulating fallback calls 2020-08-13 08:18:51 +02:00
Åke Forslund bb8d4e3c1f Generalization of intent service Episode IV
Simplify the handle_utterance into a list of intent matching functions
run in order until a match is found.

The resolution order is

- Converse
- Padatious High Confidence
- Adapt
- Fallback High priority
- Padatious Medium Confidence
- Fallback Medium priority
- Padatious Last ditch effore
- Fallback Low priority

This collects the many parts of where intent is handled into a single
location handling the entire flow.

The idea is that, in the end, all the skill calling should be done from
this method. The main intent parsers does this but the converse and
fallback still calls directly.
2020-08-13 08:12:53 +02:00
Åke Forslund b52cc55f25 Add support for ranges of fallbacks
If no range is provided it defaults to 0-100 to be backwards compatible
2020-08-13 08:12:53 +02:00
Åke Forslund 4c87bc23d4 Move padatious service to within the IntentService 2020-08-13 08:12:53 +02:00
Åke Forslund e93d23f0df Split out adapt from the intent_service. 2020-08-13 08:12:53 +02:00
Åke Forslund b24679a17c Amendments after comments PR comments
- Fix playlist_position description
- Make CPS_send_tracklist() require a playlist argument
- change docstring for the playlist type
2020-08-11 23:09:06 +02:00
Kris Gesling 55cd62470f
Merge pull request #2619 from forslund/feature/common-play-inform-gui
Add method for updating playback information from skills
2020-08-11 07:14:22 +00:00
Åke Forslund 8f4847ff77 Status and track list suggested by @Jarbasal
This commit adds the status, extended track info as well as a tracklist
information as proposed by Jarbasal.
2020-08-11 06:58:45 +02:00
Kris Gesling 69a1c1d082
Merge pull request #2644 from forslund/feature/install-defaults
Always install default skills before initial load
2020-08-11 01:53:50 +00:00
Kris Gesling 7d446b0222
Merge pull request #2650 from forslund/bugfix/stt-missing-lang
set active lang to configured if missing from STT and normalize
2020-08-10 06:36:46 +00:00
Åke Forslund e9760cdce8 Normalize the lang code to lowercase only
This suites lingua franca better
2020-08-10 07:41:50 +02:00
Åke Forslund 6edaa58558 set active lang to configured if missing from STT
If the STT doesn't send a lang code fallback to configured language
instead of hardcoded en-us
2020-08-10 07:41:44 +02:00
Åke Forslund 6abfca67a6 Fix settings changed check after skill handler
Make self._initial_settings have an unique copy of the settings and not
a reference to the original ones.
2020-08-09 08:50:44 +02:00
Åke Forslund 49faadee03 Don't include blacklisted skills in defaults
Don't try do an install on startup if a blacklisted skill is uninstalled
2020-07-31 09:58:34 +02:00
Åke Forslund 0756da700a Always install default skills before initial load
This checks if all default skills are installed before continuing with
initial load.

For devices with no skills installed on first start this should ensure
that skills are installed before sending the mycroft.skills.initialized
to start precise training and generating the mycroft.ready message
2020-07-29 18:48:53 +02:00
Åke Forslund 236a2ed594 Add hook for stopping 2020-07-22 11:06:47 +02:00
Åke Forslund a1fdae3415 Add support for watchdog in skills and speech client
If no watchdog is provided a dummy function will be called
2020-07-22 10:52:32 +02:00
Åke Forslund 09b1deb511 Add possibility for notification hooks for services
- skills
- audio
- speech client
- messagebus service
- enclosure

The main functions now accepts the arguments ready_hook and error_hook
allowing a service or runner script to catch these states and perform
actions accordingly.

This is useful for things like systemd or a desktop launcher.

Fix audio service startup
2020-07-22 10:52:27 +02:00
Åke Forslund 45cb8bec62 Add message for updating playback information from skills
This adds the function used by the npr-news-skill and spotify-skill to
communicate their info to the playback control showing the default
playback UI.

The function has the common parameters specified but is setup to be able
to add new functionallity without core changes.
2020-07-20 13:45:14 +02:00
jamesmf b94b07b35b revert iot dig_for_message 2020-07-14 23:11:10 -04:00
Åke Forslund 58608e6458 Handle reloading of relative imports
Submodule reload is enforced by removing sys.modules reference. This
will make imports do the full uncached importing
2020-06-30 19:42:36 +02:00
Åke Forslund b968b06ccb Switch from the deprecated imp to importlib
Separate python 3.4 and 3.5+ implementation
2020-06-23 11:29:15 +02:00
Åke a0c7ea7caf
Merge pull request #2560 from forslund/refactor/settings-cleanup
Refactor settings cleanup
2020-05-31 13:37:34 +02:00
Åke Forslund cdb04b1f3c Minor docstring update 2020-05-27 22:08:14 +02:00
Åke Forslund d494814ec0 Remove unused method 2020-05-27 22:08:14 +02:00
Åke Forslund 944cc416a5 Update SkillSettingsDownloader class
- Update docstrings
- Remove unused members
- Minor logic change to make download method more self-contained
2020-05-27 22:08:10 +02:00
Åke Forslund 010562f3e1 Fix remove_fallback()
remove_fallback() was mainly created for use internally during shutdown
and required the wrapped callable to be able to remove a handler. This
makes it general, using a mapping to find the wrapper from a handler if
needed. The method now also returns the success/failure status
2020-05-19 10:51:53 +02:00
Bart Ribbers 01900e5a29 Check the skill directory and XDG_CONFIG_DIR for settings 2020-05-15 11:45:13 +02:00
Åke Forslund 2036bbb63c Fix bug in adds context decorator missing content
The words parameter is now passed to the set_context method as intended.
2020-05-11 06:50:36 +02:00
Åke Forslund c78c4f6c03 Clean up docstrings for context decorators 2020-05-11 06:50:33 +02:00
Åke Forslund 202cc94262 Fix uploading settings meta
This changes the order so the started flag is set before the settingsmeta
the send() method is called.

The send() method now exits if the started flag isn't set causing the
skill settings not to be uploaded
2020-04-20 09:57:03 +02:00
Åke Forslund 9246190c34 Reduce timeout for track info response
The 5 second timeout made the playback control take quite some time to
shutdown if the audio process isn't running.
2020-04-02 19:18:17 +02:00
Åke Forslund 6b27ceca1c Allow stopping settings upload mid-stride
The upload queue will now check if it's stopped while consuming the
queue, allowing quicker shutdown if triggered while in the middle of
uploading settingsmeta.
2020-04-02 19:13:51 +02:00
Åke Forslund 2a50fb1578 Warn about skills that take a long time to shutdown 2020-04-02 19:13:16 +02:00
Åke 28c3a61e1c
Merge pull request #2503 from forslund/bugfix/converse-error
Bugfix Converse error
2020-04-02 07:45:00 +02:00
Åke Forslund 35d9558998 Handle communication failure with converse handler 2020-03-24 10:42:07 +01:00
Åke Forslund d7cab332fe Add skill to speak meta information 2020-03-23 11:41:13 +01:00
Åke Forslund d9d5f57a4f Add meta information about the speech dialog
Provides meta data such as dialog used and data that was inserted.
2020-03-23 11:41:13 +01:00
Åke Forslund f0a6d1a714 Minor clean up of intent_service.py
- Remove print statement
- Remove unused import
- Updated some docstrings
2020-03-15 19:23:25 +01:00
Åke Forslund 4982af46b1 Add check for empty skill IDs
Only allow non-empty skill IDs into the list of active skills
2020-03-15 19:23:25 +01:00
Åke Forslund af50fb5e59 Override make_active for padatious
Padatious doesn't shouldn't report active like other skills, this only
sent an empty skill entry to the active skills list.
2020-03-15 19:23:25 +01:00
Åke Forslund 8e61019451 Copy the list of active skills during operations
A skill can be missed if a skill is removed (due to an error) from the
list during iteration
2020-03-15 19:23:25 +01:00
Åke Forslund 58f0ac8b9e Simplify the converse callings
Remove the use of the separate error message and use the wait_for_reply method
to get the converse result. The error message is left to guarantee
compatibility.
2020-03-07 11:11:21 +01:00
Åke Forslund 1fcaffa363 Use copy in loops where the len of active_skills may change 2020-03-03 21:41:03 +01:00
Åke Forslund ed4c6f7248 Fix resetting of converse state on STT failure
The handler was silently failing when the STT doesn't receive any data.
2020-03-02 11:25:23 +01:00
Åke Forslund 5867b4fe2e Remove debug logging of stop message context 2020-02-27 14:33:34 +01:00
Chris Veilleux baf194c556 remove deprecated Settings class and any code in core that references it. 2020-02-27 08:07:07 +01:00
Åke Forslund ef76f685bf Only register for stop events if skill uses them. 2020-02-26 07:25:45 +01:00
Åke 1afedb2dd2
Merge pull request #2468 from JarbasAl/feat/intent_api
intent api
2020-02-24 08:40:36 +01:00
jarbasal 09cc3f6294 cleanup 2020-02-24 08:23:35 +01:00
jarbasal 3728e2013b norm utterances 2020-02-24 08:23:35 +01:00
jarbasal 74d07f0fdc Fix lang parameter 2020-02-24 08:23:26 +01:00
jarbasal 1e00347834 message fix 2020-02-24 07:46:46 +01:00
jarbasal befab62a58 get_skill from utterance 2020-02-24 07:46:46 +01:00
jarbasal d3037f2ba1 move to intent_service_interface 2020-02-24 07:46:46 +01:00
jarbasal f1c55cc809 padatious match 2020-02-24 07:46:46 +01:00
jarbasal 16f91c8ebe add regex 2020-02-24 07:46:46 +01:00
jarbasal 532bcc2b2a intent api 2020-02-24 07:46:46 +01:00
Åke Forslund e1fa0e3ad2 Set context from previous message when doing converse 2020-02-22 09:35:03 +01:00
Åke Forslund acf3b96aa2 Make padatious service forward the intent call 2020-02-21 08:26:47 +01:00
Åke Forslund 1a0432255c Handle missing message idents in converse
Handle the case where context exists but without ident
2020-02-21 07:57:46 +01:00
jarbasal f209afb021 Move dig_for_message to messagebus submodule 2020-02-15 15:35:43 +01:00
jarbasal fc9e254eef common iot message context 2020-02-15 15:35:43 +01:00
jarbasal f4a96e6c22 Update Unittests and fix pep8 2020-02-15 15:35:43 +01:00
jarbasal cc8029a357 pass context in scheduled events 2020-02-15 15:35:43 +01:00
jarbasal ef556557ad Fallback skill forward messages 2020-02-15 12:52:10 +01:00
jarbasal 0a560602c7 Use forward to send messages in MycroftSkill 2020-02-15 12:50:49 +01:00
Åke 47038f575e
Merge pull request #2462 from forslund/test/cqs
Tests for CommonQuerySkill
2020-02-07 08:34:18 +01:00
Åke 74c6a483fd
Merge pull request #2459 from forslund/test/common-play-skills
Common play skill tests
2020-02-07 08:33:54 +01:00
Åke d269a49a16
Merge pull request #2422 from forslund/refactor/dialog
Refactor mycroft.dialog
2020-02-07 08:33:25 +01:00
Åke Forslund f759903dcb Deprecate DialogLoader class
The DialogLoader class has been replaced by the simpler load_dialogs
function.
2020-02-05 17:04:37 +01:00
Åke Forslund 3fa6e6e309 Use wait_for_response to retreive track info 2020-02-05 13:13:17 +01:00
Åke Forslund 020ee329f6 Allow AudioService.queue to accept mime info 2020-02-05 13:13:17 +01:00
Åke Forslund b2c920f031 Minor docstring cleanup 2020-02-05 13:13:17 +01:00
Åke Forslund 6740eea82c Fix formatting of docstrings 2020-01-26 18:17:37 +01:00
Åke Forslund 9abb00f681 Fix func checking if a platform supports visuals 2020-01-26 18:17:37 +01:00
Åke Forslund 9563bff162 Add readthedocs docs for settings_change_callback 2020-01-15 08:39:15 +01:00
andlo 39de6b655e pep8 fix 2020-01-07 16:53:37 +00:00
andlo 7b4891d07a enable seting for patadious single_thread in mycroft.conf 2020-01-06 19:32:29 +00:00
Åke Forslund 555478c33f Add self.root_dir to readthedocs documentation 2020-01-03 10:45:39 +01:00
Åke Forslund 9628a5b5f4 Fix settingsmeta upload start race condition 2019-12-19 10:03:36 +01:00
Åke Forslund d45edcd613 Add priority skill's settingsmeta 2019-12-19 10:03:14 +01:00
Åke 184508a020
Merge pull request #2370 from forslund/feature/settingsmeta-queue
Stabilize skill settings download
2019-12-18 12:41:16 +01:00
Åke Forslund ec1d35d1b7 Fixes from code review
- Use reload status directly instead of instance check
- Move manifest posting to start_upload method
2019-12-18 12:05:40 +01:00
Åke Forslund 1e7314d7ca Update skill manifest when a skill is removed
When skills are removed the skills manifest is updated using msm and
then sent to the backend.
2019-12-18 12:05:40 +01:00
Åke Forslund 146a8c1434 Get skill_gid more reliably
If skill directory doesn't exist in current cache try to fetch a new
copy.
2019-12-18 12:05:40 +01:00
Åke Forslund f5685bde96 Simplify
Skip the queue thread, do upload in series with skill load/reload.
2019-12-18 12:05:40 +01:00
Åke Forslund fa1bdfdda7 Send manifest before starting settingsmeta upload.
Minor restructuring moving the enqueuing of settingsmeta upload to after
updating the skills manifest.
2019-12-18 12:05:40 +01:00
Åke Forslund c11c9756ce Add queue system to send settingsmeta
The queue will store all settingsmeta upload calls and execute them
after pairing can be verified.

Starts settings download after upload has started. When settings meta upload
has started for all skills the skill download process is triggered.

This guarantees that the settingsmeta skill_gid has been populated
properly before skills try to figure out which part of the skills data
belongs to them.

Add docstrings to upload queue
2019-12-18 12:04:57 +01:00
Philipp Fischbeck 3f73fb50af
Fix typo in MycroftSkill documentation
Change "https://https://" to "https://"
2019-12-15 16:42:41 +01:00
domcross 7af161fd03 Fallback to 'en-us' when resource fails
When mycroft_skill.find_resource fails to load a resource for self.lang
fall back to lang 'en-us'
as most skills/resources are available in english by default.

==== Fixed Issues ====
2019-12-05 10:21:54 +01:00
Åke 6bd6441da2
Merge pull request #2393 from MycroftAI/feature/geolocation-api
Feature/geolocation api
2019-11-26 11:10:05 +01:00
Åke f1327f0973
Merge pull request #2376 from forslund/bugfix/shutdown-on-skill-remove
Fix Shutdown of removed skills
2019-11-07 23:08:45 +01:00
Chris Veilleux 183649ac5e Merge remote-tracking branch 'remotes/origin/dev' into feature/geolocation-api 2019-10-31 13:11:58 -05:00
Åke Forslund 3e905165e6 Fix Shutdown of removed skills
Verify that skill directory exists before writing to ensure that the
shutdown method doesn't throw exception if a skill is unloaded due to
being removed.
2019-10-31 11:40:41 +01:00
Åke Forslund d4a7193fe8 Remove circular reference during skill shutdown
This cleans up the extra skills references making the ref count trigger
correctly.
2019-10-31 09:38:46 +01:00
Åke Forslund 4bf0e89fb5 Update docstrings to match behaviour 2019-10-17 11:33:25 +02:00
ChanceNCounter 738ba6cf00 edit for pep8 compliance (#15) 2019-10-17 11:07:51 +02:00
jarbasal 978ece53ca feat/ask_selection 2019-10-17 11:07:51 +02:00
David Wagner 1a9a51fe56
Merge pull request #2354 from forslund/bugfix/settings-delitem
Add missing __delitem__ method
2019-10-07 10:44:48 -05:00
Åke Forslund 24d6cf9ea0 Add missing __delitem__ method
The delitem method is apparently used, for example by the alarm skill
2019-10-04 20:43:46 +02:00
Åke Forslund 08d38dea75 Remove event before running event handler
Allow events to reschedule themselves. The reference is removed before
the handler is executed to not remove anything added by the handler.
2019-10-04 18:29:11 +02:00
Åke 15233f8929
Merge pull request #2336 from forslund/feature/load-skill-settings-once
Remove duplicate load of skill settings
2019-10-03 19:46:11 +02:00
Åke Forslund 425feb0590 Store correct function for once events
The handler was always stored even when the event was a once event and
thus was wrapped in once_wrapper.

This handles the once correctly.
2019-09-30 13:31:53 +02:00
Åke Forslund 9254ee0229 Remove duplicate load of skill settings
Instead of loading skill settings from disk twice, a copy is made into the
_initial_settings member after load.
2019-09-29 18:39:07 +02:00