# Wove intents - what Wove can do, independent of any language.
#
# A domain line names an area of the system: a short name for menus, an
# English description for the help and the decision model. Everyday
# domains first, in the order menus show them:
#
#   domain <name>	<short name>	<description>
#
# An intent is a stanza: its id at column 0 (domain.action), then
# tab-indented fields:
#
#   label	English text shown to the user (translated with gettext)
#   when	concepts that must all be in the sentence (see below)
#   run	the command, {slot} is replaced by the quoted slot value;
#		wove:<name> calls the flow wove_flow_<name> instead
#   slot	<name> <type> [optional] [default=<value>]
#   confirm	no | yes | word <word>   (default: yes when the trame action
#		changes the system, no otherwise)
#   undo	<intent> [slot=value ...]   value is {slot} or @<trame.query>:<key> (dots for spaces)
#
# A "when" element is a concept from the lexicons (lang/*.lex), a typed
# token (#num #word #service #iface #user #dev #path #ip #cidr #url #mac
# #date #time #mode), a value concept prefix (lang:* need:* pct:*),
# alternatives a|b, or !concept that must be absent. The intent whose
# matching rule has the most elements wins; a tie is a question to the
# user, never a guess.

domain	wifi	Wi-Fi	Wi-Fi: connect, scan, disconnect, saved networks
domain	network	Internet and network	Network and Internet: IP address, DNS, cable, diagnostic
domain	pkg	Software	Software: install, remove, search, upgrade packages
domain	audio	Sound	Sound: volume, mute, sound cards
domain	brightness	Brightness	Screen brightness and backlight
domain	screen	Screen	Screens and display resolution
domain	bluetooth	Bluetooth	Bluetooth: power, scan, pair headsets and devices
domain	storage	Disks and USB keys	Disks, free space, USB keys, mounting
domain	power	Battery and power	Battery, reboot, shut down, sleep, CPU governor
domain	keyboard	Keyboard	Keyboard layout
domain	locale	Language	System language
domain	time	Date and time	Clock, date, time zone, NTP synchronization
domain	user	Users and passwords	User accounts, passwords, groups, automatic login
domain	system	My computer	The computer: system information, hardware, memory, temperature, slowness
domain	service	Services	Services and daemons: start, stop, enable at boot
domain	boot	Boot menu	Boot menu (GRUB): entries, default, timeout
domain	firewall	Firewall	Firewall: open or block ports
domain	kernel	Kernel and drivers	Kernel and modules (drivers), sysctl
domain	hostname	Computer name	Computer name
domain	mirror	Package mirror	Package mirror
domain	log	System logs	System logs
domain	meta	Wove	Talking with Wove: help, undo, again

#
# System
#

system.info
	label	Show system information
	when	system !log
	when	system show !log
	when	computer show
	when	version
	run	trame system info

system.hardware
	label	Show the hardware of this computer
	when	hardware
	when	hardware show
	when	computer hardware
	when	cpu
	run	trame hardware summary

system.memory
	label	Show memory usage
	when	memory
	when	memory show|what
	run	free -m

system.uptime
	label	Show how long the computer has been running
	when	uptime
	run	trame system uptime

system.sensors
	label	Show temperatures
	when	temperature
	when	computer temperature
	when	cpu temperature
	run	trame hardware sensors

system.pci
	label	List PCI devices
	when	pci
	run	trame hardware pci

system.usb
	label	List USB devices
	when	usb
	when	usb list|show
	when	usb hardware
	run	trame hardware usb

system.firmware
	label	Find devices missing a firmware or a driver
	when	firmware
	when	firmware none
	when	hardware none|broken
	run	trame hardware firmware

system.slow
	label	Find out why the computer is slow
	when	slow
	when	computer slow
	when	system slow
	when	process
	when	process list|show
	run	wove:slow

system.report
	label	Write a support report
	when	report
	run	trame system report

#
# Packages (spk)
#

pkg.need
	label	Find software for a need and install it
	when	need:*
	when	install need:*
	when	want need:*
	when	search need:*
	when	pkg need:*
	when	new need:*
	slot	need	need
	run	wove:need

pkg.install
	label	Install a package
	when	install
	when	install #word
	when	install pkg
	when	want #word
	when	add pkg
	slot	packages	words	optional
	run	wove:install
	undo	pkg.remove packages={packages}

pkg.remove
	label	Remove a package
	when	remove #word
	when	remove pkg
	when	uninstall
	when	uninstall #word
	slot	packages	installed
	run	wove:remove
	undo	pkg.install packages={packages}

pkg.search
	label	Search a package
	when	search #word
	when	search pkg
	when	pkg #word search
	slot	query	words
	run	wove:search

pkg.info
	label	Show what a package is
	when	what #word
	when	pkg show #word
	when	pkg #word what
	slot	package	word
	run	wove:pkginfo

pkg.upgrade
	label	Update the system (all packages)
	when	update
	when	update system|pkg|computer|all
	when	upgrade
	run	spk-up --add
	confirm	yes

pkg.check
	label	Check for updates
	when	update check|what|show|list
	when	update any
	run	spk-up --check

pkg.list
	label	List installed packages
	when	pkg list
	when	pkg installed
	when	pkg installed list|show
	run	spk-ls --short

pkg.clean
	label	Clean the package cache
	when	pkg clean
	when	cache clean
	when	cache
	run	spk clean
	confirm	yes

#
# Sound
#

audio.get
	label	Show the sound volume
	when	audio
	when	audio show
	when	audio what
	run	trame audio get

audio.set
	label	Set the sound volume
	when	audio #num
	when	audio set #num
	when	audio pct:*
	when	audio set pct:*
	when	audio set
	when	audio up|down|set to #num
	slot	percent	percent
	run	trame audio set {percent}
	undo	audio.set percent=@audio.get:percent

audio.up
	label	Turn the sound up
	when	audio up
	when	audio up #num
	when	audio up by #num
	slot	step	num	optional default=10
	run	wove:audio_up

audio.down
	label	Turn the sound down
	when	audio down
	when	audio down #num
	when	audio down by #num
	slot	step	num	optional default=10
	run	wove:audio_down

audio.mute
	label	Mute the sound
	when	mute
	when	mute on
	when	audio off
	when	audio mute
	run	trame audio mute on
	confirm	no
	undo	audio.unmute

audio.unmute
	label	Unmute the sound
	when	unmute
	when	mute off
	when	audio on
	when	audio again
	run	trame audio mute off
	confirm	no
	undo	audio.mute

audio.devices
	label	List sound cards
	when	audio list
	when	audio hardware
	run	trame audio devices

audio.fix
	label	Repair the sound
	when	audio broken
	when	audio none
	when	audio not
	run	wove:sound_fix

#
# Brightness and screens
#

brightness.get
	label	Show the screen brightness
	when	brightness
	when	brightness show !up !down
	when	brightness what !up !down
	run	trame display brightness get

brightness.set
	label	Set the screen brightness
	when	brightness #num
	when	brightness set #num
	when	brightness pct:*
	when	brightness set pct:*
	when	brightness set
	when	brightness up|down|set to #num
	when	screen #num
	slot	percent	percent
	run	trame display brightness set {percent}
	confirm	no
	undo	brightness.set percent=@display.brightness.get:percent

brightness.up
	label	Make the screen brighter
	when	brightness up
	when	brightness up #num
	when	brightness up by #num
	when	screen up
	slot	step	num	optional default=10
	run	wove:brightness_up

brightness.down
	label	Make the screen darker
	when	brightness down
	when	brightness down #num
	when	brightness down by #num
	when	screen down
	slot	step	num	optional default=10
	run	wove:brightness_down

screen.list
	label	Show screens and resolutions
	when	screen !up !down
	when	screen show|list !up !down !brightness
	when	resolution
	when	resolution show|list|what
	run	trame display list

screen.resolution
	label	Change the screen resolution
	when	resolution set
	when	resolution #mode
	when	screen #mode
	when	screen set #mode
	when	#mode
	slot	mode	mode
	run	wove:resolution

#
# Wi-Fi
#

wifi.connect
	label	Connect to a Wi-Fi network
	when	wifi connect
	when	wifi on
	when	wifi set
	when	wifi want
	when	wifi connect #word
	when	internet wifi
	run	wove:wifi

wifi.scan
	label	Show the Wi-Fi networks around
	when	wifi scan
	when	wifi search
	when	wifi list !saved
	when	wifi show !saved
	when	wifi what !connect
	when	wifi network list|show !saved
	run	trame wifi scan

wifi.saved
	label	List saved Wi-Fi networks
	when	wifi saved
	when	wifi saved list|show
	run	trame wifi list

wifi.status
	label	Show the Wi-Fi connection
	when	wifi status
	when	wifi connect what
	when	wifi connect status
	when	wifi connect check
	run	trame wifi status

wifi.disconnect
	label	Turn Wi-Fi off
	when	wifi off|mute
	when	wifi disconnect
	when	wifi stop
	run	trame wifi disconnect
	undo	wifi.connect

wifi.forget
	label	Forget a saved Wi-Fi network
	when	wifi forget
	when	wifi remove
	slot	ssid	saved_ssid
	run	trame wifi forget {ssid}

wifi.fix
	label	Repair the Wi-Fi
	when	wifi broken
	when	wifi none
	when	wifi not
	run	wove:net_fix

#
# Network
#

network.status
	label	Show the network connection
	when	network
	when	network show|status
	when	internet
	when	internet show|status|connect !not !broken
	when	gateway
	run	trame network status

network.ip
	label	Show my IP address
	when	ip
	when	ip show|what
	when	network ip
	run	trame network show

network.check
	label	Diagnose the network and Internet connection
	when	network broken|none|not|check
	when	internet broken|none|not|check
	when	ethernet broken|none|not
	run	wove:net_fix

network.dhcp
	label	Ask an IP address by DHCP
	when	dhcp
	when	dhcp #iface
	slot	iface	iface
	run	trame network dhcp {iface}

network.up
	label	Bring a network interface up
	when	#iface on|up|start
	slot	iface	iface
	run	trame network up {iface}

network.down
	label	Bring a network interface down
	when	#iface off|down|stop
	slot	iface	iface
	run	trame network down {iface}

network.restart
	label	Restart the network
	when	network restart
	when	wifi restart
	when	internet restart
	when	ethernet restart
	run	trame network restart
	confirm	yes

network.dns
	label	Show the DNS servers
	when	dns
	when	dns show|what
	run	trame network dns get

network.dns_set
	label	Change the DNS servers
	when	dns set
	when	dns #ip
	when	dns set #ip
	slot	servers	ip
	run	trame network dns set {servers}

network.static
	label	Use a static IP address at boot
	when	ip static
	when	ip set #cidr
	when	static #cidr
	slot	cidr	cidr
	slot	gateway	ip
	run	trame network config static {cidr} {gateway}

network.auto
	label	Use DHCP at boot
	when	ip dhcp
	when	network dhcp
	when	dhcp atboot
	run	trame network config dhcp

#
# Bluetooth
#

bluetooth.status
	label	Show the Bluetooth state
	when	bluetooth
	when	bluetooth status|show
	run	trame bluetooth status

bluetooth.on
	label	Turn Bluetooth on
	when	bluetooth on|start|enable
	run	trame bluetooth power on
	undo	bluetooth.off

bluetooth.off
	label	Turn Bluetooth off
	when	bluetooth off|stop|disable|mute
	run	trame bluetooth power off
	undo	bluetooth.on

bluetooth.scan
	label	Search Bluetooth devices around
	when	bluetooth scan|search
	when	bluetooth scan|search device
	run	trame bluetooth scan

bluetooth.devices
	label	List known Bluetooth devices
	when	bluetooth list
	when	bluetooth device
	when	bluetooth device list|show
	run	trame bluetooth devices

bluetooth.pair
	label	Pair and connect a Bluetooth device
	when	bluetooth connect|pair
	when	device connect|pair
	when	headset
	when	headset connect|pair|set
	run	wove:bt_pair

bluetooth.disconnect
	label	Disconnect a Bluetooth device
	when	bluetooth disconnect
	when	headset disconnect
	slot	mac	bt_device
	run	trame bluetooth disconnect {mac}

bluetooth.forget
	label	Forget a Bluetooth device
	when	bluetooth forget|remove
	when	headset forget|remove
	slot	mac	bt_device
	run	trame bluetooth remove {mac}

#
# Services
#

service.list
	label	List services
	when	service
	when	service list|show
	run	trame service list

service.status
	label	Show the state of a service
	when	#service status|show|running
	when	service status
	slot	name	service
	run	trame service status {name}

service.start
	label	Start a service
	when	start #service
	when	on #service
	when	start service
	slot	name	service
	run	trame service start {name}
	undo	service.stop name={name}

service.stop
	label	Stop a service
	when	stop #service
	when	off #service
	when	stop service
	slot	name	service
	run	trame service stop {name}
	undo	service.start name={name}

service.restart
	label	Restart a service
	when	restart #service
	when	restart service
	slot	name	service
	run	trame service restart {name}

service.enable
	label	Start a service at boot
	when	enable #service
	when	on #service atboot
	when	start #service atboot
	when	enable service
	slot	name	service
	run	trame service enable {name}
	undo	service.disable name={name}

service.disable
	label	Do not start a service at boot
	when	disable #service
	when	off #service atboot
	when	stop #service atboot
	when	disable service
	slot	name	service
	run	trame service disable {name}
	undo	service.enable name={name}

#
# Time
#

time.get
	label	Show the date and time
	when	time
	when	time show|what
	when	date
	when	date show|what
	run	trame time get

time.set
	label	Set the clock
	when	time set #time
	when	time set #date
	when	date set #date
	when	time #time
	when	set #date #time
	slot	datetime	datetime
	run	trame time set {datetime}

time.sync
	label	Synchronize the clock from the Internet
	when	time sync
	when	sync
	when	ntp
	when	time internet
	run	trame time ntp

time.tz
	label	Show the time zone
	when	tz
	when	tz show|what
	run	trame time tz

time.tz_set
	label	Change the time zone
	when	tz set
	when	tz #word
	when	tz set #word
	when	time set #word
	when	time #word
	slot	tz	tz
	run	trame time tz set {tz}
	undo	time.tz_set tz=@time.tz:timezone

#
# Keyboard and language
#

keyboard.get
	label	Show the keyboard layout
	when	keyboard
	when	keyboard show|what
	run	wove:keyboard_get

keyboard.set
	label	Change the keyboard layout
	when	keyboard set
	when	keyboard not|broken
	when	keyboard lang:*
	when	keyboard set lang:*
	when	set lang:*
	slot	lang	lang
	run	wove:keyboard_set

keyboard.list
	label	List keyboard layouts
	when	keyboard list
	run	trame keyboard xkb list

locale.get
	label	Show the system language
	when	locale
	when	locale show|what
	run	trame locale get

locale.set
	label	Change the system language
	when	locale set
	when	locale lang:*
	when	locale set lang:*
	when	system lang:*
	when	system set lang:*
	when	set lang:*
	slot	lang	lang
	run	wove:locale_set

# Hidden: what locale.set and undo run, with a locale name.
locale.set_raw
	label	Change the system language
	slot	locale	word
	run	trame locale set {locale}
	undo	locale.set_raw locale=@locale.get:lang

locale.list
	label	List available languages
	when	locale list
	run	trame locale list

#
# Users
#

user.list
	label	List users
	when	user
	when	user list|show
	run	trame user list

user.info
	label	Show a user account
	when	user #user !add
	when	user show #user
	when	#user show
	slot	name	user
	run	trame user info {name}

user.add
	label	Create a user
	when	user add
	when	user add #word
	when	user new
	slot	name	newuser
	run	trame user add {name}
	undo	user.remove name={name}

user.remove
	label	Delete a user
	when	user remove
	when	user remove #user
	when	remove #user
	slot	name	user
	run	trame user remove {name}
	confirm	word delete

user.passwd
	label	Change a password
	when	password
	when	password set
	when	password #user
	when	password set #user
	slot	name	user	default=me
	run	wove:passwd

user.groups
	label	List groups
	when	group
	when	group list|show
	run	trame user groups

user.group_add
	label	Add a user to a group
	when	group add
	when	group add #user
	when	user group add
	slot	user	user
	slot	group	group
	run	trame user group add {user} {group}
	undo	user.group_remove user={user} group={group}

user.group_remove
	label	Remove a user from a group
	when	group remove
	when	group remove #user
	slot	user	user
	slot	group	group
	run	trame user group remove {user} {group}
	undo	user.group_add user={user} group={group}

user.lock
	label	Lock a user account
	when	user lock
	when	lock #user
	slot	name	user
	run	trame user lock {name}
	undo	user.unlock name={name}

user.unlock
	label	Unlock a user account
	when	user unlock
	when	unlock #user
	slot	name	user
	run	trame user unlock {name}
	undo	user.lock name={name}

user.autologin
	label	Show the automatic login
	when	autologin
	when	autologin show|what
	run	trame user autologin get

user.autologin_set
	label	Log a user in automatically at boot
	when	autologin set|on
	when	autologin #user
	when	autologin set #user
	slot	name	user	default=me
	run	trame user autologin set {name}

user.autologin_off
	label	Turn automatic login off
	when	autologin off|stop|disable
	run	trame user autologin set off

#
# Storage
#

storage.usage
	label	Show free disk space
	when	storage
	when	space
	when	storage show|full|what
	when	space show|what|full
	when	storage space
	run	trame storage usage

storage.free
	label	Free disk space
	when	space none|clean|want|need
	when	storage space clean
	when	storage clean
	when	clean
	when	space new
	run	wove:disk_free

storage.info
	label	Show details on a disk
	when	#dev
	when	#dev show
	slot	device	device
	run	trame storage info {device}

storage.list
	label	List disks and partitions
	when	storage list
	when	partition
	when	partition list|show
	run	trame storage list

storage.mount
	label	Mount a disk or a USB key
	when	mount
	when	mount #dev
	when	usbkey mount|on|show
	when	usbkey
	slot	device	device
	run	trame storage mount {device}
	undo	storage.umount target={device}

storage.umount
	label	Unmount a disk
	when	unmount
	when	unmount #dev|#path
	slot	target	mounted
	run	trame storage umount {target}

storage.eject
	label	Eject a USB key safely
	when	eject
	when	usbkey eject|remove|unmount|off
	slot	disk	removable
	run	trame storage eject {disk}

#
# Power
#

power.status
	label	Show the battery
	when	battery
	when	battery show|what|status
	when	power status
	run	trame power status

power.reboot
	label	Restart the computer
	when	reboot
	when	restart computer
	when	restart system
	when	computer reboot
	run	trame power reboot --yes
	confirm	word reboot

power.poweroff
	label	Shut the computer down
	when	poweroff
	when	off computer
	when	off !wifi !bluetooth !audio !screen !brightness !autologin !#service !network !ethernet !#iface
	when	stop computer
	when	off system
	when	stop system
	run	trame power poweroff --yes
	confirm	word poweroff

power.suspend
	label	Put the computer to sleep
	when	suspend
	when	computer suspend
	run	trame power suspend
	confirm	yes

power.hibernate
	label	Hibernate the computer
	when	hibernate
	run	trame power hibernate
	confirm	yes

power.governor
	label	Show the CPU governor
	when	governor
	when	governor show|what
	run	trame power governor get

power.governor_set
	label	Change the CPU governor
	when	governor set
	when	gov:*
	when	governor gov:*
	when	set gov:*
	slot	name	governor
	run	trame power governor set {name}
	undo	power.governor_set name=@power.governor.get:governor

#
# Boot menu
#

boot.entries
	label	List the boot menu entries
	when	boot
	when	boot list|show
	run	trame boot entries

boot.default
	label	Change the default boot entry
	when	boot default
	when	boot default set
	when	boot default #num
	slot	index	boot_entry
	run	trame boot default set {index}

boot.timeout
	label	Change the boot menu timeout
	when	boot timeout
	when	boot timeout #num
	when	boot timeout set
	when	timeout #num
	slot	seconds	num
	run	trame boot timeout set {seconds}

#
# Firewall
#

firewall.list
	label	Show the firewall rules
	when	firewall
	when	firewall list|show
	when	port list|show
	run	trame firewall list

firewall.allow
	label	Open a port in the firewall
	when	port allow #num
	when	allow #num
	when	firewall allow #num
	when	port allow
	slot	spec	port
	run	trame firewall allow {spec}

firewall.deny
	label	Block a port in the firewall
	when	port deny #num
	when	deny #num
	when	firewall deny #num
	when	port deny
	slot	spec	port
	run	trame firewall deny {spec}

firewall.flush
	label	Remove every firewall rule
	when	firewall flush
	when	firewall clean
	run	trame firewall flush --yes
	confirm	word flush

#
# Kernel
#

kernel.version
	label	Show the kernel version
	when	kernel !log
	when	kernel show|what|version !log
	run	trame system kernel

kernel.modules
	label	List loaded modules
	when	module
	when	module list|show
	run	trame kernel modules list

kernel.load
	label	Load a kernel module
	when	module load
	when	load #word
	when	module load #word
	slot	module	word
	run	trame kernel modules load {module}
	undo	kernel.unload module={module}

kernel.unload
	label	Unload a kernel module
	when	module unload
	when	unload #word
	when	module unload #word
	slot	module	word
	run	trame kernel modules unload {module}
	undo	kernel.load module={module}

kernel.modinfo
	label	Show a kernel module
	when	module #word
	when	module show #word
	slot	module	word
	run	trame kernel modules info {module}

kernel.sysctl
	label	Show kernel parameters (sysctl)
	when	sysctl
	when	sysctl show #word
	slot	key	word	optional
	run	trame kernel params get {key}

kernel.sysctl_set
	label	Set a kernel parameter (sysctl)
	when	sysctl set
	slot	kv	word
	run	trame kernel params set {kv}

kernel.detect
	label	Load drivers for the detected hardware
	when	module detect
	when	hardware detect
	when	detect
	run	trame kernel detect load
	confirm	yes

#
# Hostname, mirror, logs
#

hostname.get
	label	Show the computer name
	when	hostname
	when	hostname show|what
	run	trame hostname get

hostname.set
	label	Rename the computer
	when	hostname set
	when	hostname set #word
	when	hostname #word
	when	rename computer
	when	rename #word
	slot	name	word
	run	trame hostname set {name}
	undo	hostname.set name=@hostname.get:hostname

mirror.list
	label	Show the package mirror
	when	mirror
	when	mirror show|list|what
	run	trame mirror list

mirror.set
	label	Change the package mirror
	when	mirror set
	when	mirror #url
	when	mirror set #url
	slot	url	url
	run	trame mirror set {url}

log.view
	label	Show a system log
	when	log
	when	log show
	when	log kernel|boot|system|network|screen|password
	slot	source	logsrc
	run	trame log view {source}

#
# Talking with Wove
#

meta.help
	label	Show what Wove can do
	when	help
	when	what can
	run	wove:help

meta.hello
	label	Say hello
	when	hello
	run	wove:hello

meta.thanks
	label	Say thanks
	when	thanks
	run	wove:thanks

meta.undo
	label	Undo the last action
	when	undo
	run	wove:undo

meta.again
	label	Do the last action again
	when	again !audio
	run	wove:again
