on master help sign in
restructure clay api ref in line with other vanes
9cfdcf7tinnus-napbus
arvo/clay/examples.md+25−25
@@ -7,13 +7,13 @@ template = "doc.html"
7# Contents
7# Contents
8
8
9- [Introduction](#introduction)
9- [Introduction](#introduction)
10−- [Read and Subscribe](#read-and-subscribe)
10+- [%warp](#warp) - Read and Subscribe.
11 - [%sing](#sing) - Read a file or directory.
11 - [%sing](#sing) - Read a file or directory.
12 - [%next](#next) - Subscribe for the next change to a file or directory.
12 - [%next](#next) - Subscribe for the next change to a file or directory.
13 - [%mult](#mult) - Subscribe for the next change to a set of files and/or directories.
13 - [%mult](#mult) - Subscribe for the next change to a set of files and/or directories.
14 - [%many](#many) - Track changes to a `desk` for the specified range of revisions.
14 - [%many](#many) - Track changes to a `desk` for the specified range of revisions.
15 - [Cancel Subscription](#cancel-subscription)
15 - [Cancel Subscription](#cancel-subscription)
16−- [Write and Modify](#write-and-modify)
16+- [%info](#info) - Write and Modify.
17 - [%ins](#ins) - Add a file.
17 - [%ins](#ins) - Add a file.
18 - [%del](#del) - Delete a file.
18 - [%del](#del) - Delete a file.
19 - [%mut](#mut) - Change a file.
19 - [%mut](#mut) - Change a file.
@@ -31,8 +31,8 @@ template = "doc.html"
31 - [%crew](#crew) - Get permission groups.
31 - [%crew](#crew) - Get permission groups.
32 - [%crow](#crow) - Get group usage.
32 - [%crow](#crow) - Get group usage.
33- [Foreign Ships](#foreign-ships)
33- [Foreign Ships](#foreign-ships)
34− - [%warp](#warp) - Read a file on a foreign ship.
34+ - [%warp](#warp-remote) - Read a file on a foreign ship.
35− - [%merg](#merg) - Merge from a foreign `desk`.
35+ - [%merg](#merg-remote) - Merge from a foreign `desk`.
36
36
37# Introduction
37# Introduction
38
38
@@ -61,11 +61,11 @@ Most examples will either use `|pass` to just send a `task` or the following thr
61(pure:m !>(~))
61(pure:m !>(~))
62```
62```
63
63
64−# Read and Subscribe
64+# `%warp`
65
65
66−See the [Read and Subscribe](@/docs/arvo/clay/tasks.md#read-and-subscribe) section of the [API Reference](@/docs/arvo/clay/tasks.md) document for general details.
66+See the [Read and Subscribe](@/docs/arvo/clay/tasks.md#warp) section of the [API Reference](@/docs/arvo/clay/tasks.md) document for general details.
67
67
68−## %sing
68+## `%sing`
69
69
70Here we'll look at reading files by passing Clay a `%warp` `task` with a `%sing` `rave` and receiving a `%writ` `gift` containing the data in response.
70Here we'll look at reading files by passing Clay a `%warp` `task` with a `%sing` `rave` and receiving a `%writ` `gift` containing the data in response.
71
71
@@ -116,7 +116,7 @@ Here's a breakdown of the `task` we sent:
116
116
117![%sing diagram](https://pub.m.tinnus-napbus.xyz/sing.png "%sing diagram")
117![%sing diagram](https://pub.m.tinnus-napbus.xyz/sing.png "%sing diagram")
118
118
119−## %next
119+## `%next`
120
120
121Here we'll look at subscribing to the next version of a file by passing Clay a `%warp` `task` with a `%next` `rave` and receiving a `%writ` `gift` when the file changes.
121Here we'll look at subscribing to the next version of a file by passing Clay a `%warp` `task` with a `%next` `rave` and receiving a `%writ` `gift` when the file changes.
122
122
@@ -152,7 +152,7 @@ Here's a breakdown of the task we sent:
152
152
153![%next diagram](https://pub.m.tinnus-napbus.xyz/next.png "%next diagram")
153![%next diagram](https://pub.m.tinnus-napbus.xyz/next.png "%next diagram")
154
154
155−## %mult
155+## `%mult`
156
156
157Here we'll look at subscribing to the next version of multiple files by passing Clay a `%warp` `task` with a `%mult` `rave` and receiving a `%wris` `gift` when any of the files change.
157Here we'll look at subscribing to the next version of multiple files by passing Clay a `%warp` `task` with a `%mult` `rave` and receiving a `%wris` `gift` when any of the files change.
158
158
@@ -211,7 +211,7 @@ Here's a breakdown of the `task` we sent:
211
211
212![subscribe mult diagram](https://pub.m.tinnus-napbus.xyz/sub-mult.png "subscribe mult diagram")
212![subscribe mult diagram](https://pub.m.tinnus-napbus.xyz/sub-mult.png "subscribe mult diagram")
213
213
214−## %many
214+## `%many`
215
215
216Here we'll look at subscribing to a range of changes to a `desk` by passing Clay a `%warp` `task` with a `%many` `rave` and receiving `%writ` `gift`s when changes occur.
216Here we'll look at subscribing to a range of changes to a `desk` by passing Clay a `%warp` `task` with a `%many` `rave` and receiving `%writ` `gift`s when changes occur.
217
217
@@ -349,11 +349,11 @@ Here's a breakdown of the `task` we sent:
349
349
350![cancel subscription diagram](https://pub.m.tinnus-napbus.xyz/stop-sub.png "cancel subscription diagram")
350![cancel subscription diagram](https://pub.m.tinnus-napbus.xyz/stop-sub.png "cancel subscription diagram")
351
351
352−# Write and Modify
352+# `%info`
353
353
354See the [Write and Modify](@/docs/arvo/clay/tasks.md#write-and-modify) section of the [API Reference](@/docs/arvo/clay/tasks.md) document for general details.
354See the [Write and Modify](@/docs/arvo/clay/tasks.md#write-and-modify) section of the [API Reference](@/docs/arvo/clay/tasks.md) document for general details.
355
355
356−## %ins
356+## `%ins`
357
357
358Here we'll look at adding a file by sending Clay a `%info` `task` containing a `%ins` `miso`.
358Here we'll look at adding a file by sending Clay a `%info` `task` containing a `%ins` `miso`.
359
359
@@ -372,7 +372,7 @@ Here's a breakdown of the `task` we sent:
372
372
373![%ins diagram](https://pub.m.tinnus-napbus.xyz/ins.png)
373![%ins diagram](https://pub.m.tinnus-napbus.xyz/ins.png)
374
374
375−## %del
375+## `%del`
376
376
377Here we'll look at deleting a file by sending Clay a `%info` `task` containing a `%del` `miso`.
377Here we'll look at deleting a file by sending Clay a `%info` `task` containing a `%del` `miso`.
378
378
@@ -389,7 +389,7 @@ Here's a breakdown of the `task` we sent:
389
389
390![%del diagram](https://pub.m.tinnus-napbus.xyz/del.png)
390![%del diagram](https://pub.m.tinnus-napbus.xyz/del.png)
391
391
392−## %mut
392+## `%mut`
393
393
394Identical to the [%ins](#ins) example, just replace `%ins` with `%mut`.
394Identical to the [%ins](#ins) example, just replace `%ins` with `%mut`.
395
395
@@ -438,7 +438,7 @@ Save to `ted/multi-change.hoon`, `|commit %home`, and run:
438
438
439See the [Manage Mounts](@/docs/arvo/clay/tasks.md#manage-mounts) section of the [API Reference](@/docs/arvo/clay/tasks.md) document for general details.
439See the [Manage Mounts](@/docs/arvo/clay/tasks.md#manage-mounts) section of the [API Reference](@/docs/arvo/clay/tasks.md) document for general details.
440
440
441−## %boat
441+## `%boat`
442
442
443Here we'll look at requesting the list of existing mount points on a ship by sending Clay a `%boat` `task` and receiving a `%hill` `gift`.
443Here we'll look at requesting the list of existing mount points on a ship by sending Clay a `%boat` `task` and receiving a `%hill` `gift`.
444
444
@@ -449,7 +449,7 @@ Using the `send-task-take-gift.hoon` thread, let's make such a request:
449[%hill p=~[%home]]
449[%hill p=~[%home]]
450```
450```
451
451
452−## %mont
452+## `%mont`
453
453
454Here we'll look at mounting `desk`s, directories and files to unix by sending Clay a `%mont` `task`.
454Here we'll look at mounting `desk`s, directories and files to unix by sending Clay a `%mont` `task`.
455
455
@@ -488,7 +488,7 @@ Let's try mounting a subdirectory and a single folder:
488
488
489If you look in your pier you'll now see a `gen` folder with the contents of `/gen` and a `hi.hoon` file by itself. Notice how the file extension has been automatically added.
489If you look in your pier you'll now see a `gen` folder with the contents of `/gen` and a `hi.hoon` file by itself. Notice how the file extension has been automatically added.
490
490
491−## %ogre
491+## `%ogre`
492
492
493Here we'll look at unmounting `desk`s, directories and files by sending Clay a `%ogre` `task`.
493Here we'll look at unmounting `desk`s, directories and files by sending Clay a `%ogre` `task`.
494
494
@@ -519,7 +519,7 @@ If we specify a non-existent mount point it will fail with an error printed to t
519
519
520If we give it an unmounted `beam` it will not print an error but still won't work.
520If we give it an unmounted `beam` it will not print an error but still won't work.
521
521
522−## %dirk
522+## `%dirk`
523
523
524Here we'll look at committing changed files by sending Clay a `%dirk` `task`.
524Here we'll look at committing changed files by sending Clay a `%dirk` `task`.
525
525
@@ -540,7 +540,7 @@ If you have the same `desk` mounted to multiple points, a committed change in on
540
540
541See the [Merge Desks](@/docs/arvo/clay/tasks.md#merge-desks) section of the [API Reference](@/docs/arvo/clay/tasks.md) document for general details.
541See the [Merge Desks](@/docs/arvo/clay/tasks.md#merge-desks) section of the [API Reference](@/docs/arvo/clay/tasks.md) document for general details.
542
542
543−## %merg
543+## `%merg`
544
544
545Here we'll look at merging `desk`s by sending Clay a `%merg` `task` and receiving a `%mere` `gift` in response.
545Here we'll look at merging `desk`s by sending Clay a `%merg` `task` and receiving a `%mere` `gift` in response.
546
546
@@ -615,7 +615,7 @@ You can also specify it by revision number or label.
615
615
616See the [Permissions](@/docs/arvo/clay/tasks.md#permissions) section of the [API Reference](@/docs/arvo/clay/tasks.md) document for general details.
616See the [Permissions](@/docs/arvo/clay/tasks.md#permissions) section of the [API Reference](@/docs/arvo/clay/tasks.md) document for general details.
617
617
618−## %perm
618+## `%perm`
619
619
620Here we'll look at setting permissions by sending Clay a `%perm` `task`.
620Here we'll look at setting permissions by sending Clay a `%perm` `task`.
621
621
@@ -695,7 +695,7 @@ Here's a breakdown of a `%perm` task:
695
695
696![perm diagram](https://pub.m.tinnus-napbus.xyz/perm-diagram.png)
696![perm diagram](https://pub.m.tinnus-napbus.xyz/perm-diagram.png)
697
697
698−## %cred
698+## `%cred`
699
699
700Here we'll look at creating a permission group by sending Clay a `%cred` `task`.
700Here we'll look at creating a permission group by sending Clay a `%cred` `task`.
701
701
@@ -707,7 +707,7 @@ Let's create a group called `'foo'` with a few ships:
707
707
708We'll check it with the next kind of `task`: [%crew](#crew).
708We'll check it with the next kind of `task`: [%crew](#crew).
709
709
710−## %crew
710+## `%crew`
711
711
712Here we'll look at retrieving permission groups by sending Clay a `%crew` `task` and receiving a `%cruz` `gift` in response.
712Here we'll look at retrieving permission groups by sending Clay a `%crew` `task` and receiving a `%cruz` `gift` in response.
713
713
@@ -718,7 +718,7 @@ Let's check, using the `send-task-take-gift.hoon` thread, for the permission gro
718[%cruz cez={[p=~.foo q={~nec ~bud ~wes ~zod ~sev}]}]
718[%cruz cez={[p=~.foo q={~nec ~bud ~wes ~zod ~sev}]}]
719```
719```
720
720
721−## %crow
721+## `%crow`
722
722
723Here we'll look at retrieving a list of all files and directories in all `desk`s which have permissions set for a group by sending Clay a `%crow` `task` and receiving a `%croz` `gift` in response.
723Here we'll look at retrieving a list of all files and directories in all `desk`s which have permissions set for a group by sending Clay a `%crow` `task` and receiving a `%croz` `gift` in response.
724
724
@@ -754,7 +754,7 @@ Now we'll use the `send-task-take-gift.hoon` thread to try `%crow`:
754
754
755See the [Foreign Ships](@/docs/arvo/clay/tasks.md#foreign-ships) section of the [API Reference](@/docs/arvo/clay/tasks.md) document for general details.
755See the [Foreign Ships](@/docs/arvo/clay/tasks.md#foreign-ships) section of the [API Reference](@/docs/arvo/clay/tasks.md) document for general details.
756
756
757−## %warp
757+## `%warp` - Remote
758
758
759Here we'll look at reading files on a foreign ship by sending Clay a `%warp` `task` with a foreign ship in the `wer` field and receiving a `%writ` `gift` in response.
759Here we'll look at reading files on a foreign ship by sending Clay a `%warp` `task` with a foreign ship in the `wer` field and receiving a `%writ` `gift` in response.
760
760
@@ -817,7 +817,7 @@ call: failed
817/sys/vane/clay/hoon:<[1.365 48].[1.365 50]>
817/sys/vane/clay/hoon:<[1.365 48].[1.365 50]>
818```
818```
819
819
820−## %merg
820+## `%merg` - Remote
821
821
822To merge a foreign `desk` into a local one, you just send Clay a `%merg` `task` (as you would for a local merge) and specify the foreign ship in the `her` field. For an example, see the [%merg](#merg) section.
822To merge a foreign `desk` into a local one, you just send Clay a `%merg` `task` (as you would for a local merge) and specify the foreign ship in the `her` field. For an example, see the [%merg](#merg) section.
823
823
arvo/clay/tasks.md+145−52
@@ -7,7 +7,7 @@ template = "doc.html"
7# Contents
7# Contents
8
8
9- [Introduction](#introduction)
9- [Introduction](#introduction)
10−- [Read and Subscribe](#read-and-subscribe)
10+- [%warp](#warp) - Read and Subscribe.
11 - [%sing](#sing) - Read a file or directory.
11 - [%sing](#sing) - Read a file or directory.
12 - [%next](#next) - Subscribe for the next change to a file or directory.
12 - [%next](#next) - Subscribe for the next change to a file or directory.
13 - [%mult](#mult) - Subscribe for the next change to a set of files and/or directories.
13 - [%mult](#mult) - Subscribe for the next change to a set of files and/or directories.
@@ -28,8 +28,8 @@ template = "doc.html"
28 - [%crew](#crew) - Get permission groups.
28 - [%crew](#crew) - Get permission groups.
29 - [%crow](#crow) - Get group usage.
29 - [%crow](#crow) - Get group usage.
30- [Foreign Ships](#foreign-ships)
30- [Foreign Ships](#foreign-ships)
31− - [%warp](#warp) - Read a file on a foreign ship.
31+ - [%warp](#warp-remote) - Read a file on a foreign ship.
32− - [%merg](#merg) - Merge from a foreign `desk`.
32+ - [%merg](#merg-remote) - Merge from a foreign `desk`.
33
33
34# Introduction
34# Introduction
35
35
@@ -37,14 +37,16 @@ This document details all the `task`s you're likely to use to interact with Clay
37
37
38The focus of this document is on interacting with Clay from userspace applications and threads, so it doesn't delve into the internal mechanics of Clay from a kernel development perspective.
38The focus of this document is on interacting with Clay from userspace applications and threads, so it doesn't delve into the internal mechanics of Clay from a kernel development perspective.
39
39
40−# Read and Subscribe
40+# `%warp`
41−
42−Here we'll look at reading files and subscribing to changes. This is done by sending Clay a `%warp` `task`:
43
41
44```hoon
42```hoon
45[%warp wer=ship rif=riff] :: internal file req
43[%warp wer=ship rif=riff] :: internal file req
46```
44```
47
45
46+A `%warp` `task` is for reading a subscribing to files and directories.
47+
48+### Accepts
49+
48The `wer` field is the target ship. The `(unit rave)` of the [riff](@/docs/arvo/clay/data-types.md#riff-clay-request-desist) is null to cancel an existing subscription, otherwise the [rave](@/docs/arvo/clay/data-types.md#rave-clay-general-subscription-request) is tagged with one of:
50The `wer` field is the target ship. The `(unit rave)` of the [riff](@/docs/arvo/clay/data-types.md#riff-clay-request-desist) is null to cancel an existing subscription, otherwise the [rave](@/docs/arvo/clay/data-types.md#rave-clay-general-subscription-request) is tagged with one of:
49
51
50- `%sing` - Read a single file or directory.
52- `%sing` - Read a single file or directory.
@@ -54,6 +56,8 @@ The `wer` field is the target ship. The `(unit rave)` of the [riff](@/docs/arvo/
54
56
55We'll look at each of these in more detail below.
57We'll look at each of these in more detail below.
56
58
59+### Returns
60+
57Clay responds to a `%mult` request with a `%wris` `gift`, and the rest with a `%writ` `gift`.
61Clay responds to a `%mult` request with a `%wris` `gift`, and the rest with a `%writ` `gift`.
58
62
59A `%wris` `gift` looks like:
63A `%wris` `gift` looks like:
@@ -72,19 +76,23 @@ The `unit` of the [riot](@/docs/arvo/clay/data-types.md#riot-clay-response) will
72
76
73Now we'll look at each of the `rave` request types in turn.
77Now we'll look at each of the `rave` request types in turn.
74
78
75−## %sing
79+## `%sing`
76
80
77```hoon
81```hoon
78[%sing =mood]
82[%sing =mood]
79```
83```
80
84
85+This `rave` is for reading a single file or directory immediately.
86+
81−This is for reading a single file or directory immediately. The `care` of the [mood](@/docs/arvo/clay/data-types.md#mood-clay-single-subscription-request) will determine what you can read and what type of data will be returned. See the [care](@/docs/arvo/clay/data-types.md#care-clay-clay-submode) documentation and [scry](@/docs/arvo/clay/scry.md) documentation for details on the various `care`s.
87+The `care` of the [mood](@/docs/arvo/clay/data-types.md#mood-clay-single-subscription-request) will determine what you can read and what type of data will be returned. See the [care](@/docs/arvo/clay/data-types.md#care-clay-clay-submode) documentation and [scry](@/docs/arvo/clay/scry.md) documentation for details on the various `care`s.
82
88
83The [case](@/docs/arvo/clay/data-types.md#case-specifying-a-commit) specifies the `desk` revision and you can use whichever kind you prefer. The `path` will usually be a path to a file or directory like `/gen/hood/hi/hoon` but may be something else depending on the `care`.
89The [case](@/docs/arvo/clay/data-types.md#case-specifying-a-commit) specifies the `desk` revision and you can use whichever kind you prefer. The `path` will usually be a path to a file or directory like `/gen/hood/hi/hoon` but may be something else depending on the `care`.
84
90
91+### Example
92+
85[See here for an example of using %sing.](@/docs/arvo/clay/examples.md#sing)
93[See here for an example of using %sing.](@/docs/arvo/clay/examples.md#sing)
86
94
87−## %next
95+## `%next`
88
96
89```hoon
97```hoon
90[%next =mood] :: await next version
98[%next =mood] :: await next version
@@ -94,9 +102,11 @@ This subscribes to the next version of the specified file. See [here](@/docs/arv
94
102
95If you subscribe to the current `case` of the `desk`, Clay will not respond until the file changes. If you subscribe to a previous `case` of the `desk` and the file has changed in between then and now, it will immediately return the first change it comes across in that range. For example, if you're currently at `case` `100`, subscribe to case `50` and the file in question has been modified at both `60` and `80`, clay will immediately return the version of the file at `case` `60`.
103If you subscribe to the current `case` of the `desk`, Clay will not respond until the file changes. If you subscribe to a previous `case` of the `desk` and the file has changed in between then and now, it will immediately return the first change it comes across in that range. For example, if you're currently at `case` `100`, subscribe to case `50` and the file in question has been modified at both `60` and `80`, clay will immediately return the version of the file at `case` `60`.
96
104
105+### Example
106+
97[See here for an example of using %next.](@/docs/arvo/clay/examples.md#next)
107[See here for an example of using %next.](@/docs/arvo/clay/examples.md#next)
98
108
99−## %mult
109+## `%mult`
100
110
101```hoon
111```hoon
102[%mult =mool] :: next version of any
112[%mult =mool] :: next version of any
@@ -114,9 +124,11 @@ The `mool` specified in the request is this structure:
114
124
115You can use a different `care` for each of the files specified by the `path` if you like. Significantly, the `care` will determine whether Clay sends a response for a given change. For example, if you subscribe to an existing `/foo/txt` with a `%u` `care` and `/foo/txt` is modified but isn't deleted, Clay will *not* tell you. However, if you subscribe with an `%x` `care`, it *will* tell you.
125You can use a different `care` for each of the files specified by the `path` if you like. Significantly, the `care` will determine whether Clay sends a response for a given change. For example, if you subscribe to an existing `/foo/txt` with a `%u` `care` and `/foo/txt` is modified but isn't deleted, Clay will *not* tell you. However, if you subscribe with an `%x` `care`, it *will* tell you.
116
126
127+### Example
128+
117[See here for an example of using %mult.](@/docs/arvo/clay/examples.md#mult)
129[See here for an example of using %mult.](@/docs/arvo/clay/examples.md#mult)
118
130
119−## %many
131+## `%many`
120
132
121```hoon
133```hoon
122[%many track=? =moat] :: track range
134[%many track=? =moat] :: track range
@@ -144,24 +156,30 @@ When you reach the end of the subscribed range of `case`s, Clay will send you a
144[%writ p=~]
156[%writ p=~]
145```
157```
146
158
159+### Example
160+
147[See here for an example of using %many.](@/docs/arvo/clay/examples.md#many)
161[See here for an example of using %many.](@/docs/arvo/clay/examples.md#many)
148
162
149## Cancel Subscription
163## Cancel Subscription
150
164
151To cancel a subscription, you just send a `%warp` with a null `(unit rave)` in the `riff`. Clay will cancel the subscription based on the `wire`. The request is exactly the same regardless of which type of `rave` you subscribed with originally.
165To cancel a subscription, you just send a `%warp` with a null `(unit rave)` in the `riff`. Clay will cancel the subscription based on the `wire`. The request is exactly the same regardless of which type of `rave` you subscribed with originally.
152
166
167+### Example
168+
153[See here for an example of cancelling a subscription.](@/docs/arvo/clay/examples.md#cancel-subscription)
169[See here for an example of cancelling a subscription.](@/docs/arvo/clay/examples.md#cancel-subscription)
154
170
155# Write and Modify
171# Write and Modify
156
172
157−## %info
173+## `%info`
158−
159−To write or modify a file, we send Clay a `%info` `task`:
160
174
161```hoon
175```hoon
162[%info des=desk dit=nori] :: internal edit
176[%info des=desk dit=nori] :: internal edit
163```
177```
164
178
179+To write or modify a file, we send Clay a `%info` `task`.
180+
181+### Accepts
182+
165The `%|` tag in the [nori](@/docs/arvo/clay/data-types.md#nori-clay-repository-action) is not currently supported and will crash with a `%labelling-not-implemented` if used, so you can focus on the `%&` part. The [soba](@/docs/arvo/clay/data-types.md#soba-clay-delta) in the `nori` is just a list of changes so you can make more than one change in one request. Its `path` is just the path to a file like `/gen/hood/hi/hoon` and the [miso](@/docs/arvo/clay/data-types.md#miso-clay-ankh-delta) is one of these types of requests:
183The `%|` tag in the [nori](@/docs/arvo/clay/data-types.md#nori-clay-repository-action) is not currently supported and will crash with a `%labelling-not-implemented` if used, so you can focus on the `%&` part. The [soba](@/docs/arvo/clay/data-types.md#soba-clay-delta) in the `nori` is just a list of changes so you can make more than one change in one request. Its `path` is just the path to a file like `/gen/hood/hi/hoon` and the [miso](@/docs/arvo/clay/data-types.md#miso-clay-ankh-delta) is one of these types of requests:
166
184
167- `%del` - Delete a file.
185- `%del` - Delete a file.
@@ -169,8 +187,12 @@ The `%|` tag in the [nori](@/docs/arvo/clay/data-types.md#nori-clay-repository-a
169- `%dif` - This has not yet been implemented so will crash with a `%dif-not-implemented` error.
187- `%dif` - This has not yet been implemented so will crash with a `%dif-not-implemented` error.
170- `%mut` - Change a file. At the time of writing this behaves identically to `%ins` so its use merely informs the reader.
188- `%mut` - Change a file. At the time of writing this behaves identically to `%ins` so its use merely informs the reader.
171
189
190+### Returns
191+
172Clay does not give any response to an `%info` `task` so don't expect a `sign` back.
192Clay does not give any response to an `%info` `task` so don't expect a `sign` back.
173
193
194+### Example
195+
174Here are examples of using each of these as well as making multiple changes in one request:
196Here are examples of using each of these as well as making multiple changes in one request:
175
197
176- [%del](@/docs/arvo/clay/examples.md#del)
198- [%del](@/docs/arvo/clay/examples.md#del)
@@ -190,15 +212,21 @@ There are four Clay `task`s relevant to mounts:
190- [%ogre](#ogre) - Unmount something.
212- [%ogre](#ogre) - Unmount something.
191- [%dirk](#dirk) - Commit changes.
213- [%dirk](#dirk) - Commit changes.
192
214
193−## %boat
215+## `%boat`
194−
195−This type of `task` will request the list of existing mounts. It looks like:
196
216
197```hoon
217```hoon
198[%boat ~]
218[%boat ~]
199```
219```
200
220
221+A `%boat` `task` requests the list of existing mounts.
222+
223+### Accepts
224+
225+A `%boat` `task` does not take any arguments.
226+
227+### Returns
228+
201−Pretty simple. The type it returns is a `%hill` `gift`, which looks like:
229+The type it returns is a `%hill` `gift`, which looks like:
202
230
203```hoon
231```hoon
204[%hill p=(list @tas)]
232[%hill p=(list @tas)]
@@ -206,16 +234,20 @@ Pretty simple. The type it returns is a `%hill` `gift`, which looks like:
206
234
207...where the `@tas` is the name of the mount point.
235...where the `@tas` is the name of the mount point.
208
236
209−[See here for an example of using %boat.](@/docs/arvo/clay/examples.md#boat)
237+### Example
210
238
211−## %mont
239+[See here for an example of using %boat.](@/docs/arvo/clay/examples.md#boat)
212
240
213−This type of `task` mounts the specified `beam` to the specified `term` mount point. It looks like:
241+## `%mont`
214
242
215```hoon
243```hoon
216[%mont pot=term bem=beam]
244[%mont pot=term bem=beam]
217```
245```
218
246
247+A `%mont` `task` mounts the specified `beam` to the specified `term` mount point.
248+
249+### Accepts
250+
219A `beam:clay` is the following structure:
251A `beam:clay` is the following structure:
220
252
221```hoon
253```hoon
@@ -224,37 +256,57 @@ A `beam:clay` is the following structure:
224
256
225You can mount the whole desk with a `path` of `/`, and you can also mount subdirectories or even individual files. If you want to mount an individual file, you must exclude its `mark` from the path. For example, if you want to mount `/gen/hood/hi/hoon`, you'd specify `/gen/hood/hi`. It will automatically be given the correct file extension when mounted. If you include the `hoon` mark it will crash (and currently crash your ship).
257You can mount the whole desk with a `path` of `/`, and you can also mount subdirectories or even individual files. If you want to mount an individual file, you must exclude its `mark` from the path. For example, if you want to mount `/gen/hood/hi/hoon`, you'd specify `/gen/hood/hi`. It will automatically be given the correct file extension when mounted. If you include the `hoon` mark it will crash (and currently crash your ship).
226
258
227−[See here for an example of using %mont.](@/docs/arvo/clay/examples.md#mont)
259+### Returns
260+
261+Clay does not return a `gift` in response to a `%mont` `%task`.
228
262
229−## %ogre
263+### Example
264+
265+[See here for an example of using %mont.](@/docs/arvo/clay/examples.md#mont)
230
266
231−This type of `task` unmounts the specified mount. It's defined in `lull.hoon` as:
267+## `%ogre`
232
268
233```hoon
269```hoon
234[%ogre pot=$@(desk beam)]
270[%ogre pot=$@(desk beam)]
235```
271```
236
272
237−But in fact it will only unmount the target when specified as a `term` mount name. Passing it a `desk` will incidentally work if the mount is named the same as the `desk` but otherwise it won't work. Passing it a `beam:clay` will simply not work.
273+A `%ogre` `task` unmounts the specified mount.
238
274
239−[See here for an example of using %ogre.](@/docs/arvo/clay/examples.md#ogre)
275+### Accepts
276+
277+It's defined in `lull.hoon` as taking `$@(desk beam)` but in fact it will only unmount the target when specified as a `term` mount name. Passing it a `desk` will incidentally work if the mount is named the same as the `desk` but otherwise it won't work. Passing it a `beam:clay` will simply not work.
278+
279+### Returns
240
280
241−## %dirk
281+Clay does not return a `gift` in response to a `%ogre` `task`.
242
282
243−This type of `task` commits changes in the target mount. It's defined in `lull.hoon` as:
283+### Example
284+
285+[See here for an example of using %ogre.](@/docs/arvo/clay/examples.md#ogre)
286+
287+## `%dirk`
244
288
245```hoon
289```hoon
246[%dirk des=desk]
290[%dirk des=desk]
247```
291```
248
292
293+### Accepts
294+
295+A `%dirk` `task` commits changes in the target mount.
296+
249−... but like [%ogre](#ogre), it actually takes the name of a mount point rather than a `desk` as is specified.
297+It's defined in `lull.hoon` as taking a `desk` but like [%ogre](#ogre), it actually takes the name of a mount point rather than a `desk` as is specified.
298+
299+### Returns
300+
301+Clay does not return a `gift` in response to a `%dirk` `task`.
302+
303+### Example
250
304
251[See here for an example of using %dirk.](@/docs/arvo/clay/examples.md#dirk)
305[See here for an example of using %dirk.](@/docs/arvo/clay/examples.md#dirk)
252
306
253# Merge Desks
307# Merge Desks
254
308
255−## %merg
309+## `%merg`
256−
257−A `%merg` `task` will merge the specified source `desk` into the target local `desk`. It looks like:
258
310
259```hoon
311```hoon
260$: %merg :: merge desks
312$: %merg :: merge desks
@@ -264,10 +316,16 @@ $: %merg :: merge desks
264== ::
316== ::
265```
317```
266
318
319+A `%merg` `task` will merge the specified source `desk` into the target local `desk`.
320+
321+### Accepts
322+
267The `germ` specifies the merge strategy. You can refer to the [Strategies](@/docs/arvo/clay/using.md#strategies) section of the [Using Clay](@/docs/arvo/clay/using.md) document for details of each `germ`.
323The `germ` specifies the merge strategy. You can refer to the [Strategies](@/docs/arvo/clay/using.md#strategies) section of the [Using Clay](@/docs/arvo/clay/using.md) document for details of each `germ`.
268
324
269If you're merging into a new `desk` you must use `%init`, all other strategies will fail. If the desk already exists, you cannot use `%init`. Otherwise, you're free to use whichever you'd like.
325If you're merging into a new `desk` you must use `%init`, all other strategies will fail. If the desk already exists, you cannot use `%init`. Otherwise, you're free to use whichever you'd like.
270
326
327+### Returns
328+
271Clay will respond to the request with a `%mere` `gift` which looks like:
329Clay will respond to the request with a `%mere` `gift` which looks like:
272
330
273```hoon
331```hoon
@@ -287,6 +345,8 @@ If the merge failed, `p` will have a head of `%.n` and then a `[term tang]` wher
287]
345]
288```
346```
289
347
348+### Example
349+
290[See here for an example of using %merg.](@/docs/arvo/clay/examples.md#merg)
350[See here for an example of using %merg.](@/docs/arvo/clay/examples.md#merg)
291
351
292# Permissions
352# Permissions
@@ -331,18 +391,18 @@ A `%perm` `task` is for setting permissions, and the other three are for managin
331
391
332We'll look at each of these in turn.
392We'll look at each of these in turn.
333
393
334−## %perm
394+## `%perm`
335−
336−This sets permissions for the target file or directory.
337−
338−Note this will replace existing permissions rather than add to them, so if you want to add a ship to an existing whitelist or whatever you'll have to first read the existing permissions, add the ship, then send the whole lot back.
339−
340−A `%perm` `task` looks like:
341
395
342```hoon
396```hoon
343[%perm des=desk pax=path rit=rite] :: change permissions
397[%perm des=desk pax=path rit=rite] :: change permissions
344```
398```
345
399
400+A `%perm` `task` sets permissions for the target file or directory.
401+
402+Note this will replace existing permissions rather than add to them, so if you want to add a ship to an existing whitelist or whatever you'll have to first read the existing permissions, add the ship, then send the whole lot back.
403+
404+### Accepts
405+
346The `pax` path is the file or directory whose permissions you want to change, and the `rite` is this structure:
406The `pax` path is the file or directory whose permissions you want to change, and the `rite` is this structure:
347
407
348```hoon
408```hoon
@@ -366,33 +426,52 @@ Where a `rule` is this structure:
366
426
367As the comment suggests, the `@ta` is the name of a `crew` (group).
427As the comment suggests, the `@ta` is the name of a `crew` (group).
368
428
369−[See here for an example of using %perm.](@/docs/arvo/clay/examples.md#perm)
429+### Returns
430+
431+Clay does not return a `gift` in response to a `%perm` `task`.
370
432
371−## %cred
433+### Example
434+
435+[See here for an example of using %perm.](@/docs/arvo/clay/examples.md#perm)
372
436
373−This simply creates a permission group. The task looks like this:
437+## `%cred`
374
438
375```hoon
439```hoon
376[%cred nom=@ta cew=crew] :: set permission group
440[%cred nom=@ta cew=crew] :: set permission group
377```
441```
378
442
443+This simply creates a permission group.
444+
445+### Accepts
446+
379The `nom` is a name for the group and the `crew` is just a `(set ship)`:
447The `nom` is a name for the group and the `crew` is just a `(set ship)`:
380
448
381```hoon
449```hoon
382+$ crew (set ship) :: permissions group
450+$ crew (set ship) :: permissions group
383```
451```
384
452
385−[See here for an example of using %cred.](@/docs/arvo/clay/examples.md#cred)
453+### Returns
386
454
387−## %crew
455+Clay does not return a `gift` in response to a `%cred` `task`.
388
456
389−This retrieves all permission groups. It looks like:
457+### Example
458+
459+[See here for an example of using %cred.](@/docs/arvo/clay/examples.md#cred)
460+
461+## `%crew`
390
462
391```hoon
463```hoon
392[%crew ~] :: permission groups
464[%crew ~] :: permission groups
393```
465```
466+This retrieves all permission groups.
467+
468+### Accepts
469+
470+A `%crew` `task` takes no arguments.
471+
472+### Returns
394
473
395−Clay wil return a sign containing a `%cruz` `gift`. It looks like:
474+Clay wil return a `%cruz` `gift`. It looks like:
396
475
397```hoon
476```hoon
398[%cruz cez=(map @ta crew)] :: permission groups
477[%cruz cez=(map @ta crew)] :: permission groups
@@ -400,16 +479,24 @@ Clay wil return a sign containing a `%cruz` `gift`. It looks like:
400
479
401The `cez` is just a map from group name to `crew` which is just a `(set ship)`.
480The `cez` is just a map from group name to `crew` which is just a `(set ship)`.
402
481
403−[See here for an example of using %crew.](@/docs/arvo/clay/examples.md#crew)
482+### Example
404
483
405−## %crow
484+[See here for an example of using %crew.](@/docs/arvo/clay/examples.md#crew)
406
485
407−This is the last group `task`. It retrieves all files and directories in all `desk`s which have permissions set for the group in question. It will not return inherited permissions, only those explicitly set. It looks like:
486+## `%crow`
408
487
409```hoon
488```hoon
410[%crow nom=@ta] :: group usage
489[%crow nom=@ta] :: group usage
411```
490```
412
491
492+A `%crow` `task` retrieves all files and directories in all `desk`s which have permissions set for the group in question. It will not return inherited permissions, only those explicitly set.
493+
494+### Accepts
495+
496+The `nom` is the name of a `crew`.
497+
498+### Returns
499+
413The `gift` you get back is a `%croz` which looks like:
500The `gift` you get back is a `%croz` which looks like:
414
501
415```hoon
502```hoon
@@ -422,6 +509,8 @@ The `gift` you get back is a `%croz` which looks like:
422+$ regs (map path rule) :: rules for paths
509+$ regs (map path rule) :: rules for paths
423```
510```
424
511
512+### Example
513+
425[See here for an example of using %crow.](@/docs/arvo/clay/examples.md#crow)
514[See here for an example of using %crow.](@/docs/arvo/clay/examples.md#crow)
426
515
427# Foreign Ships
516# Foreign Ships
@@ -430,9 +519,9 @@ Here we'll looking at making Clay requests to a foreign ship.
430
519
431As it currently stands, it's not possible to write to a foreign `desk`. Additionally, remote scries are not implemented. That leaves requests to read files (`%warp`) and merge desks (`%merg`), which we'll look at next.
520As it currently stands, it's not possible to write to a foreign `desk`. Additionally, remote scries are not implemented. That leaves requests to read files (`%warp`) and merge desks (`%merg`), which we'll look at next.
432
521
433−## %warp
522+## `%warp` - Remote
434
523
435−To read files on a foreign `desk`, you just send Clay a `%warp` `task` (as you would for a local read) and specify the target ship in the `wer` field. For details on making such requests, see the [Read and Subscribe](#read-and-subscribe) section.
524+To read files on a foreign `desk`, you just send Clay a `%warp` `task` (as you would for a local read) and specify the target ship in the `wer` field. For details on making such requests, see the [Read and Subscribe](#warp) section.
436
525
437Clay only allows a subset of `care`s to be used remotely. They are:
526Clay only allows a subset of `care`s to be used remotely. They are:
438
527
@@ -449,9 +538,11 @@ The foreign ship will respond only if correct permissions have been set. See the
449
538
450Note that if you're reading a whole `desk` or directory, all subfolders and files must also permit reading. If even a single file does not permit you reading it, the foreign ship will not respond to the request.
539Note that if you're reading a whole `desk` or directory, all subfolders and files must also permit reading. If even a single file does not permit you reading it, the foreign ship will not respond to the request.
451
540
541+### Example
542+
452[See here for examples of requests to foreign ships.](@/docs/arvo/clay/examples.md#foreign-ships)
543[See here for examples of requests to foreign ships.](@/docs/arvo/clay/examples.md#foreign-ships)
453
544
454−## %merg
545+## `%merg` - Remote
455
546
456To merge a foreign `desk` into a local one, you just send Clay a `%merg` `task` (as you would for a local merge) and specify the foreign ship in the `her` field. For details on making such requests, see the [Merge Desks](#merge-desks) section.
547To merge a foreign `desk` into a local one, you just send Clay a `%merg` `task` (as you would for a local merge) and specify the foreign ship in the `her` field. For details on making such requests, see the [Merge Desks](#merge-desks) section.
457
548
@@ -459,4 +550,6 @@ The foreign ship will respond only if correct permissions have been set. See the
459
550
460Note that all subfolders and individual files within the `desk` must permit your reading in order for the merge to succeed. If even one file does not permit you reading it, the remote ship will not respond to the request at all.
551Note that all subfolders and individual files within the `desk` must permit your reading in order for the merge to succeed. If even one file does not permit you reading it, the remote ship will not respond to the request at all.
461
552
553+### Example
554+
462[See here for examples of requests to foreign ships.](@/docs/arvo/clay/examples.md#foreign-ships)
555[See here for examples of requests to foreign ships.](@/docs/arvo/clay/examples.md#foreign-ships)