diff --git a/README.md b/README.md index a24ab3d..57196e5 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ vita: our %radio has 326 subs to unregister a desk: `:vita|d %kids`. WARNING: all data collected on an unregistered desk will be lost. -once every 24 hours, `:vita` grabs downloads metrics on each registered desk using `.^((set ship) %cs /=mydesk=/subs)`. every time this scry is performed, `:vita` logs the size of the set with a timestamp. `:vita` keeps one copy of the latest full set of downloaders, and a cumulative set of all unique downloaders. +once every 24 hours, `:vita` grabs downloads metrics on each registered desk using `.^((set [@p rave:clay]) %cx /=//=/cult/mydesk)` (filtered by ships watching the latest desk version). every time this scry is performed, `:vita` logs the size of the set with a timestamp. `:vita` keeps one copy of the latest full set of downloaders, and a cumulative set of all unique downloaders. when users unsync from your local desk, `latest.downloads` wont go down until your next `|commit` to the desk. `cumulative.downloads` only goes up. @@ -113,13 +113,24 @@ the vita frontend displays the data collected by `:vita` plus some forms for app ## install from source -1. create a blank `%vita` desk. -2. copy in basic app dependencies. +1. ```bash + rm -rI vita-full/ + find vita -type f | while read f; do { d=$(dirname "$f" | sed "s/^vita/vita-full/"); mkdir -p "$d"; ln -sr -t "$d" "$f"; }; done + git clone -b 411k --depth 1 https://github.com/urbit/urbit.git urb + cp urb/pkg/arvo/lib/{agentio*,verb*,strand*} vita-full/lib/ + cp urb/pkg/arvo/sur/{spider*,verb*} vita-full/sur/ + git clone -b sl/server-schooner-z412k --depth 1 https://github.com/sidnym-ladrut/yard.git yar + cp yar/desk/lib/{dbug*,default-agent*,skeleton*,rudder*,server*,docket*,mip*} vita-full/lib/ + cp yar/desk/mar/{bill*,docket*,hoon*,kelvin*,mime*,noun*,ship*,json*} vita-full/mar/ + cp yar/desk/sur/docket* vita-full/sur/ + git clone -b v1.25.0 --depth 1 https://github.com/tloncorp/landscape.git lan + cp lan/desk/sur/treaty* vita-full/sur/ + ``` +2. `|new-desk %vita` 3. `|mount %vita` -4. cd `/vita` -5. `./install.sh -w /vita` -6. `|commit %vita` -7. `|install our %vita` +4. `rm -rf /vita/*; cp -rf /vita-full /vita` +5. `|commit %vita` +6. `|install our %vita` ## urbit.org grant diff --git a/vita-client/gen/share-usage.hoon b/vita-client/gen/toggle-vita.hoon similarity index 67% rename from vita-client/gen/share-usage.hoon rename to vita-client/gen/toggle-vita.hoon index 26eacab..a340e83 100644 --- a/vita-client/gen/share-usage.hoon +++ b/vita-client/gen/toggle-vita.hoon @@ -1,10 +1,10 @@ :: Tell app whether to share usage data with :vita :: -:: :myagent +mydesk!share-usage +:: :myagent +mydesk!toggle-vita :: enables sharing -:: :myagent +mydesk!share-usage & +:: :myagent +mydesk!toggle-vita & :: enables sharing -:: :myagent +mydesk!share-usage | +:: :myagent +mydesk!toggle-vita | :: disables sharing :: :- %say @@ -13,4 +13,4 @@ :- %set-enabled ?^ arg share.arg -& \ No newline at end of file +& diff --git a/vita-client/lib/vita-client.hoon b/vita-client/lib/vita-client.hoon index 8cb44c9..200bdfd 100644 --- a/vita-client/lib/vita-client.hoon +++ b/vita-client/lib/vita-client.hoon @@ -6,7 +6,7 @@ :: from somewhere that indicates real user activity :: :: on %log-activity, we check if we already poked :~parent/vita today. -:: if so, ignore. if not, poke :~parent/vita with +:: if so, ignore. if not, poke :~parent/vita with :: :: on init, vita-client can be set to be enabled / disabled by default. :: on init, vita-client is configured with its parent @p @@ -102,10 +102,10 @@ `this(config cfg.pok) %log-activity ?. enabled.config - :: %- (slog leaf+"{} vita-client: not sending activity, disabled." ~) + :: %- (slog leaf+"{} vita-client: not sending activity, disabled." ~) `this ?. (gth now.bowl (add last ~h8)) ::TODO ~d1 constant? - %- (slog leaf+"{} vita-client: not sending activity. already sent." ~) + :: %- (slog leaf+"{} vita-client: not sending activity. already sent." ~) `this =. last now.bowl :_ this @@ -132,7 +132,14 @@ ++ on-peek |= =path ^- (unit (unit cage)) - (on-peek:ag path) + ?. ?=([@ %vita *] path) + (on-peek:ag path) + ?+ path [~ ~] + [%u %vita ~] ``noun+!>(&) + [%x %vita %last ~] ``noun+!>(last) + [%x %vita %enabled ~] ``noun+!>(enabled.config) + [%x %vita %parent ~] ``noun+!>(vita-parent.config) + == :: ++ on-agent |= [=wire =sign:agent:gall] diff --git a/vita/app/vita.hoon b/vita/app/vita.hoon index eb26d49..c6d8c20 100644 --- a/vita/app/vita.hoon +++ b/vita/app/vita.hoon @@ -9,7 +9,7 @@ :: accept foreign pokes attesting to activity on a desk :: count unique active users each day :: export to csv -:: +:: /- sur=vita, tt=treaty /+ vita /+ default-agent, verb, dbug, agentio @@ -250,7 +250,7 @@ |= [time=@da =duct] ^- ? ?. ?=(^ duct) - %.n + %.n ?=([%gall %use %vita *] i.duct) %+ turn timers |= [time=@da =duct] @@ -290,10 +290,15 @@ ++ scry-clay-subs |= [desk=@tas] ^- (set ship) - =; s=(set ship) - %- (slog leaf+"vita: our {} has {<(lent ~(tap in s))>} subs" ~) - s - .^((set ship) %cs /[(scot %p our.bowl)]/[desk]/[(scot %da now.bowl)]/subs) + =- ((slog leaf+"vita: our {} has {<(lent ~(tap in -))>} subs" ~) -) + =+ [our=(scot %p our.bowl) now=(scot %da now.bowl)] + %- sy + %- turn :_ head + %+ skim ~(tap in .^((set [@p rave:clay]) %cx /[our]//[now]/cult/[desk])) + |= [@p rav=rave:clay] + ?& ?=([%sing %w [%ud @] ~] rav) + .=(+>->.rav +(ud:.^(cass:clay %cw /[our]/[desk]/[now]))) + == :: ++ scry-treaty-alliance .^(update:alliance:tt %gx /[(scot %p our.bowl)]/treaty/[(scot %da now.bowl)]/alliance/noun) @@ -400,4 +405,4 @@ new-met new == --- +--