diff --git a/bin/solid.pill b/bin/solid.pill index 895afdcc3..b15985bc0 100644 --- a/bin/solid.pill +++ b/bin/solid.pill @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a7257cfd276f656bdcfa57151618f4543ab81c0b791ed59d44de1aaa6963ff86 -size 13826886 +oid sha256:ac9058e514df24f8b2111575e0fcaf06d3747892f62ea584a713ebdf80cc0f59 +size 7313285 diff --git a/pkg/arvo/app/chat-hook.hoon b/pkg/arvo/app/chat-hook.hoon index c4c98266e..0005f07f7 100644 --- a/pkg/arvo/app/chat-hook.hoon +++ b/pkg/arvo/app/chat-hook.hoon @@ -87,7 +87,8 @@ ^- (list (list card)) %+ turn ~(tap in keys) generate-cards == - [loaded-cards.upgraded-state this(state upgraded-state)] + :_ this(state upgraded-state) + loaded-cards.upgraded-state :: ++ generate-cards |= old-chat=path diff --git a/pkg/arvo/app/chat-store.hoon b/pkg/arvo/app/chat-store.hoon index ab4d3e6a6..b37b1f044 100644 --- a/pkg/arvo/app/chat-store.hoon +++ b/pkg/arvo/app/chat-store.hoon @@ -13,12 +13,6 @@ +$ state-zero [%0 =inbox:store] +$ state-one [%1 =inbox:store] +$ state-two [%2 =inbox:store] -:: -+$ diff - $% [%chat-initial inbox:store] - [%chat-configs configs:store] - [%chat-update update:store] - == -- :: =| state-two @@ -70,8 +64,7 @@ =/ cards=(list card) ?+ path (on-watch:def path) [%keys ~] (give %chat-update !>([%keys ~(key by inbox)])) - [%all ~] (give %chat-initial !>(inbox)) - [%configs ~] (give %chat-configs !>((inbox-to-configs:store inbox))) + [%all ~] (give %chat-update !>([%initial inbox])) [%updates ~] ~ [%mailbox @ *] ?> (~(has by inbox) t.path) @@ -92,7 +85,6 @@ ^- (unit (unit cage)) ?+ path (on-peek:def path) [%x %all ~] ``noun+!>(inbox) - [%x %configs ~] ``noun+!>((inbox-to-configs:store inbox)) [%x %keys ~] ``noun+!>(~(key by inbox)) [%x %envelopes *] (peek-x-envelopes:cc t.t.path) [%x %mailbox *] @@ -274,7 +266,6 @@ (update-subscribers [%mailbox pax] upd) ?. |(|(=(%read -.upd) =(%message -.upd)) =(%messages -.upd)) ~ - (update-subscribers /configs upd) ?. |(=(%create -.upd) =(%delete -.upd)) ~ (update-subscribers /keys upd) diff --git a/pkg/arvo/app/chat-view.hoon b/pkg/arvo/app/chat-view.hoon index 880fd713e..5dbd0a9e5 100644 --- a/pkg/arvo/app/chat-view.hoon +++ b/pkg/arvo/app/chat-view.hoon @@ -14,51 +14,24 @@ /+ *server, default-agent, verb, dbug, store=chat-store, view=chat-view -/= index - /^ octs - /; as-octs:mimes:html - /: /===/app/chat/index - /| /html/ - /~ ~ - == -/= tile-js - /^ octs - /; as-octs:mimes:html - /: /===/app/chat/js/tile - /| /js/ - /~ ~ - == -/= script - /^ octs - /; as-octs:mimes:html - /: /===/app/chat/js/index - /| /js/ - /~ ~ - == -/= style - /^ octs - /; as-octs:mimes:html - /: /===/app/chat/css/index - /| /css/ - /~ ~ - == -/= chat-png - /^ (map knot @) - /: /===/app/chat/img /_ /png/ :: ~% %chat-view-top ..is ~ |% -+$ card card:agent:gall -:: -+$ poke - $% [%launch-action [@tas path @t]] - [%chat-action action:store] - [%group-action group-action] - [%chat-hook-action action:hook] - [%permission-hook-action permission-hook-action] - [%permission-group-hook-action permission-group-hook-action] ++$ versioned-state + $% state-0 == +:: ++$ state-0 + $: %0 + ~ + == +:: ++$ card card:agent:gall -- +:: +=| state-0 +=* state - +:: %+ verb | %- agent:dbug ^- agent:gall @@ -72,12 +45,15 @@ :: ++ on-init ^- (quip card _this) - =/ launcha [%launch-action !>([%add %chat-view /configs '/~chat/js/tile.js'])] :_ this - :~ [%pass /updates %agent [our.bol %chat-store] %watch /updates] - [%pass / %arvo %e %connect [~ /'~chat'] %chat-view] - [%pass /chat-view %agent [our.bol %launch] %poke launcha] + :~ :* %pass /srv %agent [our.bol %file-server] + %poke %file-server-action + !>([%serve-dir /'~chat' /app/landscape %.n]) + == + [%pass / %arvo %e %connect [~ /'chat-view'] %chat-view] + [%pass /updates %agent [our.bol %chat-store] %watch /updates] == + :: ++ on-poke ~/ %chat-view-poke |= [=mark =vase] @@ -112,14 +88,12 @@ :: create inbox with 20 messages max per mailbox and send that along :: then quit the subscription :_ this - [%give %fact ~ %json !>((inbox:enjs:store truncated-inbox-scry))]~ - ?: =(/configs path) - [[%give %fact ~ %json !>(*json)]~ this] + [%give %fact ~ %json !>((update:enjs:store [%initial truncated-inbox]))]~ (on-watch:def path) :: ++ message-limit 20 :: - ++ truncated-inbox-scry + ++ truncated-inbox ^- inbox:store =/ =inbox:store .^(inbox:store %gx /=chat-store/(scot %da now.bol)/all/noun) @@ -133,7 +107,7 @@ ~/ %chat-view-agent |= [=wire =sign:agent:gall] ^- (quip card _this) - ?+ -.sign (on-agent:def wire sign) + ?+ -.sign (on-agent:def wire sign) %kick :_ this [%pass / %agent [our.bol %chat-store] %watch /updates]~ @@ -150,12 +124,24 @@ ~/ %chat-view-arvo |= [=wire =sign-arvo] ^- (quip card _this) - ?. ?=(%bound +<.sign-arvo) - (on-arvo:def wire sign-arvo) - [~ this] + ?: ?=(%bound +<.sign-arvo) [~ this] + (on-arvo:def wire sign-arvo) + :: + ++ on-save !>(state) + ++ on-load + |= old-vase=vase + ^- (quip card _this) + =/ old ((soft state-0) q.old-vase) + ?^ old [~ this] + :_ this(state [%0 ~]) + :~ [%pass / %arvo %e %disconnect [~ /'~chat']] + [%pass / %arvo %e %connect [~ /'chat-view'] %chat-view] + :* %pass /srv %agent [our.bol %file-server] + %poke %file-server-action + !>([%serve-dir /'~chat' /app/landscape %.n]) + == + == :: - ++ on-save on-save:def - ++ on-load on-load:def ++ on-leave on-leave:def ++ on-peek on-peek:def ++ on-fail on-fail:def @@ -170,18 +156,7 @@ ^- simple-payload:http =+ url=(parse-request-line url.request.inbound-request) ?+ site.url not-found:gen - [%'~chat' %css %index ~] (css-response:gen style) - [%'~chat' %js %tile ~] (js-response:gen tile-js) - [%'~chat' %js %index ~] (js-response:gen script) - :: - [%'~chat' %img @t *] - =/ name=@t i.t.t.site.url - =/ img (~(get by chat-png) name) - ?~ img - not-found:gen - (png-response:gen (as-octs:mimes:html u.img)) - :: - [%'~chat' %paginate @t @t *] + [%'chat-view' %paginate @t @t *] =/ start (need (rush i.t.t.site.url dem)) =/ end (need (rush i.t.t.t.site.url dem)) =/ pax t.t.t.t.site.url @@ -190,8 +165,6 @@ %- json-to-octs %- update:enjs:store [%messages pax start end envelopes] - :: - [%'~chat' *] (html-response:gen index) == :: ++ poke-json @@ -488,11 +461,7 @@ ++ diff-chat-update |= upd=update:store ^- (list card) - =/ updates-json (update:enjs:store upd) - =/ configs-json (configs:enjs:store configs-scry) - :~ [%give %fact ~[/primary] %json !>(updates-json)] - [%give %fact ~[/configs] %json !>(configs-json)] - == + [%give %fact ~[/primary] %json !>((update:enjs:store upd))]~ :: :: +utilities :: @@ -535,10 +504,6 @@ ^- (list envelope:store) (scry-for (list envelope:store) %chat-store [%envelopes pax]) :: -++ configs-scry - ^- configs:store - (scry-for configs:store %chat-store /configs) -:: ++ group-scry |= pax=path ^- (unit group) diff --git a/pkg/arvo/app/chat/js/index.js b/pkg/arvo/app/chat/js/index.js deleted file mode 100644 index 8a52ed84b..000000000 --- a/pkg/arvo/app/chat/js/index.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("buffer"),require("path"),require("util")):"function"==typeof define&&define.amd?define("index",["buffer","path","util"],t):t((e=e||self).buffer,e.path,e.util)}(this,function(e,t,r){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e,t=t&&t.hasOwnProperty("default")?t.default:t,r=r&&r.hasOwnProperty("default")?r.default:r;var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function a(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function l(e,t){return e(t={exports:{}},t.exports),t.exports}function o(e){return e&&e.default||e}var s=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable;var h=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,n,i=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),a=1;aU.length&&U.push(e)}function Z(e,t,r){return null==e?0:function e(t,r,n,i){var a=typeof t;"undefined"!==a&&"boolean"!==a||(t=null);var l=!1;if(null===t)l=!0;else switch(a){case"string":case"number":l=!0;break;case"object":switch(t.$$typeof){case d:case p:l=!0}}if(l)return n(i,t,""===r?"."+B(t,0):r),1;if(l=0,r=""===r?".":r+":",Array.isArray(t))for(var o=0;o=x},l=function(){},t.unstable_forceFrameRate=function(e){0>e||125E(l,r))void 0!==s&&0>E(s,l)?(e[n]=s,e[o]=r,n=o):(e[n]=l,e[a]=r,n=a);else{if(!(void 0!==s&&0>E(s,r)))break e;e[n]=s,e[o]=r,n=o}}}return t}return null}function E(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}var L=[],T=[],A=1,D=null,O=3,P=!1,R=!1,q=!1;function H(e){for(var t=S(T);null!==t;){if(null===t.callback)N(T);else{if(!(t.startTime<=e))break;N(T),t.sortIndex=t.expirationTime,M(L,t)}t=S(T)}}function j(e){if(q=!1,H(e),!R)if(null!==S(L))R=!0,r(I);else{var t=S(T);null!==t&&n(j,t.startTime-e)}}function I(e,r){R=!1,q&&(q=!1,i()),P=!0;var l=O;try{for(H(r),D=S(L);null!==D&&(!(D.expirationTime>r)||e&&!a());){var o=D.callback;if(null!==o){D.callback=null,O=D.priorityLevel;var s=o(D.expirationTime<=r);r=t.unstable_now(),"function"==typeof s?D.callback=s:D===S(L)&&N(L),H(r)}else N(L);D=S(L)}if(null!==D)var u=!0;else{var c=S(T);null!==c&&n(j,c.startTime-r),u=!1}return u}finally{D=null,O=l,P=!1}}function F(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var U=l;t.unstable_ImmediatePriority=1,t.unstable_UserBlockingPriority=2,t.unstable_NormalPriority=3,t.unstable_IdlePriority=5,t.unstable_LowPriority=4,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=O;O=e;try{return t()}finally{O=r}},t.unstable_next=function(e){switch(O){case 1:case 2:case 3:var t=3;break;default:t=O}var r=O;O=t;try{return e()}finally{O=r}},t.unstable_scheduleCallback=function(e,a,l){var o=t.unstable_now();if("object"==typeof l&&null!==l){var s=l.delay;s="number"==typeof s&&0o?(e.sortIndex=s,M(T,e),null===S(L)&&e===S(T)&&(q?i():q=!0,n(j,s-o))):(e.sortIndex=l,M(L,e),R||P||(R=!0,r(I))),e},t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_wrapCallback=function(e){var t=O;return function(){var r=O;O=t;try{return e.apply(this,arguments)}finally{O=r}}},t.unstable_getCurrentPriorityLevel=function(){return O},t.unstable_shouldYield=function(){var e=t.unstable_now();H(e);var r=S(L);return r!==D&&null!==D&&null!==r&&null!==r.callback&&r.startTime<=e&&r.expirationTime