Repository navigation
feat(net): a computer can let another only view threads and chat with bots, set from three presets - #1469
Merged
Conversation
Each computer keeps a new switch per device, "Work on threads from this device" (net_node_policy.work, on by default; a store from before it keeps every device on). Off, every call that starts, sends to, steers, stops or changes a thread, reads its files or Git, or makes or changes a bot is refused with the reason work_off, in every family and for a person's call and an agent's alike, also when a saved result is looked up. Reads and bot chat still pass. One table classes every remote method and stream kind as view, bots_chat, bots_manage, work, terminal or editor (src/shared/net/accessClasses.ts); a test reads the methods a real daemon registers and fails on one with no class. mousse-cli bridge limits takes --work on|off.
Each computer's row in Settings, Devices has Access from this device: View and chat with bots, Work on threads (the defaults) or Full control. A pick sets the device's switches at once; switches that match none show as Custom, and the single switches stay. Limits has the Work on threads switch on its own. Phones have no preset. The presets are shared (src/shared/net/accessPresets.ts) for later screens.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #1463 (stage 6)
Each computer can now let another of your computers only read threads and chat with bots, without letting it start or change work. This is set with one control on that computer's row in Settings → Devices.
What changes
work_offand is shown in words: " lets this computer view threads and chat with bots only."src/shared/net/accessClasses.ts):src/shared/net/accessPresets.tsso a later Allow screen can reuse them:bridge limits --work on|off.Notes
routed.pagecounts as view, so a page of a large reply fetched just before the switch went off can be read for its remaining minute.Tests
tests/net/bridge/routed/accessClasses.test.ts(new): the completeness test, then real daemons in both directions:work_off, for person and agent calls alike.tests/renderer/deviceAccessPreset.test.ts(new): each preset sends its fields, a non-matching set shows Custom, the Limits switch works alone, and phones and older services show no preset.tests/net/store/nodePolicyMigration.test.ts,tests/net/bridge/nodePolicy.test.ts,tests/net/cli/net.test.ts: the new column, its default, and the CLI flag.These pass, as do
connectedHereandbotDeviceAccess. Both typecheck configs are clean.