Commit graph

31 commits

Author SHA1 Message Date
bunnie
6c28ee9642 strip some debug messages 2022-06-19 02:04:08 +08:00
bunnie
b7453b627e add API tokens to prediction API
The prediction API now takes an API token. This is a 128-bit
number that gets passed to the prediction engine, and it's meant
to be unique for every context that requires a predictor.

It's up to the prediction engine to do anything with the token.
For the "null" engines (such as the icontray for `vault` and
`tts`) the token is just ignored. But for example, in `shellchat`,
the API token is used to store a history record in a HashMap on
a per-token basis. This means that every app that uses the
`shellchat` history function gets their own history that can only
be read out by that app.

The actual token itself is mostly passed through the API. The
token storage is in the Context layer (each Context has a record
for a token, that starts as `None`), and is passed down to
the predictor every time the context swaps, and the predictor
receives the token and passes it back if the token was `Some`,
or allocates a new random token if it was `None`.

Note that everything is a Context, including, for example, menus and
modal dialog boxes, but not all contexts have predictors. Only
Contexts that ask for a predictor have them. This mechanism
works smoothly in this model (as opposed to other hacks and work-arounds
previously tried getting to this solution).
2022-06-19 01:01:25 +08:00
Sean Cross
3ae9d8abf0 apps/services: remove xous::xous_main macro usage
This macro will be removed, since it is no longer necessary. Remove this
macro across the project and replace it with a standard `main()`
function.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-05-31 13:33:30 +08:00
bunnie
c81a9a7644 whups a buffer wasn't saved during the refactor 2021-08-04 02:05:26 +08:00
bunnie
8b83fb7c65 remove heapless, go to libstd for all collections!!!!
*fistpump*
2021-08-04 01:25:32 +08:00
bunnie
356b07dacc works on "real hardware" but some issues with hosted mode 2021-06-16 17:03:28 +08:00
bunnie
5301f4af20 major refactor of the Ux -- can create, redirect I/O contexts
getting ready for Precursor to do more than just one thing.
2021-06-16 04:50:26 +08:00
bunnie
eee9f4e765 refactor xous-names to permit only a fixed number of connections
this prevents less trusted processes from connecting to servers
after the kernel initializations are done.

this works so long as we don't have disconnects from the kernel
servers. In order to support disconnects we will also need a
way to re-enumerate the SID to guarantee that we don't have a re-use
problem. But for now, the kernel is not designed with any practical
disconnect mechanism; there is no code that calls the Quit mechanism
on any server.
2021-06-15 17:41:14 +08:00
Sean Cross
eb7895d601 xous: add a return code to TerminateProcess
As part of this refactor, make `terminate_process()` a divergent call.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-20 11:01:00 +08:00
bunnie
a8a35fa434 roll back heapless crate on ime-frontend 2021-05-08 23:55:08 +08:00
bunnie
391122823d refactor heapless version in attempt to debug issue that cropped up in xous-names
somehow, updating the toolchain has broken the FnvIndexMap implementation
2021-05-08 18:44:23 +08:00
bunnie
ca349ec1b0 clean up minor bugs and other issues 2021-04-06 22:38:11 +08:00
bunnie
9ba2fb134c refactor most major modules, but Xous now crashes 2021-04-05 23:50:00 +08:00
bunnie
8fed353a83 refactor of the imef interface part 1 2021-04-05 00:30:46 +08:00
bunnie
470b5c6440 finalize API refactor for xous-names 2021-03-30 02:13:23 +08:00
Sean Cross
fdce58d06e ipc: convert project to use xous-ipc
This rewrites the entire project so that most runnable projects now use
`xous-ipc` instead of `xous::String` where possible.

This also removes `rkyv` from the list of dependencies in `xous-rs`.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-26 20:22:33 +08:00
bunnie
ea8b208a15 finalize rkyv 0.4.1 refactor 2021-03-18 03:54:48 +08:00
bunnie
d68e3e8cf4 an attempt to refactor to rkyv 0.4.1
unfortunately, it looks like deserialize requires an alloc??
2021-03-16 02:02:53 +08:00
bunnie
a9a7ac435f add support for rounded rectangle text bubbles and dynamic sizing
this makes more more natural chat-style text bubble interactions
2021-03-10 00:25:14 +08:00
bunnie
3cec151ffd fix prediction order 2021-03-09 02:47:25 +08:00
bunnie
7f7f30f23d make shell predictions only on newlines, for now 2021-03-09 02:33:10 +08:00
bunnie
7d1fb5a31b ellipsis support and fixing prediction redraw bugs 2021-03-09 02:24:45 +08:00
bunnie
c9e82c427e fix a bunch of minor bugs 2021-03-08 05:12:26 +08:00
bunnie
d5d8e0ee86 TIL you can't return variable-length strings in an rkyv
rkyv does some optimization to not send all the data in
a string if you don't use it up.

xous assumes the same "pos" argument on the return type

thus a variable length string doesn't work as a return type
(you can send it, because you can specify a "pos" on the send
side).

fortunately, the application for the variable-length string
was getting predictions out of the predictor, and a short (31 element)
fixed-length array with a side companion of a len variable
should be more than sufficient for completion suggestions.
2021-03-08 04:25:58 +08:00
bunnie
8a8c1e6a66 foundations for predictive text display 2021-03-08 00:57:50 +08:00
bunnie
aa8c0e5792 a bit more deck shuffling on the APIs
feels a lot cleaner now.
2021-03-04 16:02:42 +08:00
bunnie
76684c89fc refactor the traits to have a default implementation
probably should be the *only* implementation because these are
only concerned with IPC calls that really require changes in
two separate crates, but I feel unconfident enough about the API
that for now I want the flexibility to experiment with non-default
APIs until I'm ready to freeze things.
2021-03-04 04:48:22 +08:00
bunnie
f565fdaf6f refactor API into a separate crate with traits 2021-03-04 04:33:20 +08:00
bunnie
92ca22c38c refactor IME plugin API into a common crate
This will allow other APIs to just include the API crate
to define all the gazintas and gozoutas.
2021-03-04 03:14:26 +08:00
bunnie
2b768e9b86 fix warnings in initial API 2021-03-03 23:27:30 +08:00
bunnie
8f809c2a51 start layering in the IME front end and prediction APIs 2021-03-03 14:53:33 +08:00