From ca2bb3e5b93948ed2da3c1c5081993be0a6e69a4 Mon Sep 17 00:00:00 2001 From: Brian Takita Date: Sat, 17 Apr 2021 18:47:34 -0400 Subject: [PATCH 01/33] Convert ui modules & svelte components to typescript --- .gitignore | 2 + tests/syn-lib/syn-lib.ts | 136 ++- ui/package-lock.json | 1574 ++++++++++++++++++++++++++++++- ui/package.json | 6 +- ui/public/index.html | 2 +- ui/rollup.config.js | 14 +- ui/src/App.svelte | 132 +-- ui/src/Debug.svelte | 4 +- ui/src/Delta.ts | 26 + ui/src/Editor.svelte | 13 +- ui/src/Folk.svelte | 9 +- ui/src/Folks.svelte | 4 +- ui/src/History.svelte | 4 +- ui/src/HistoryEntry.svelte | 2 +- ui/src/Syn.svelte | 9 +- ui/src/Title.svelte | 4 +- ui/src/{colors.js => colors.ts} | 65 +- ui/src/main.js | 1 + ui/src/stores.js | 22 - ui/src/stores.ts | 35 + ui/src/{syn.js => syn.ts} | 370 +++++--- ui/src/utils.js | 52 - ui/src/utils.ts | 61 ++ ui/tsconfig.json | 42 + zomes/syn/src/error.rs | 2 + 25 files changed, 2155 insertions(+), 436 deletions(-) create mode 100644 ui/src/Delta.ts rename ui/src/{colors.js => colors.ts} (52%) delete mode 100644 ui/src/stores.js create mode 100644 ui/src/stores.ts rename ui/src/{syn.js => syn.ts} (71%) delete mode 100644 ui/src/utils.js create mode 100644 ui/src/utils.ts create mode 100644 ui/tsconfig.json diff --git a/.gitignore b/.gitignore index 45d84209..8572d1bc 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ ui/node .hc* *.happ .cargo +.idea +.rollup.cache diff --git a/tests/syn-lib/syn-lib.ts b/tests/syn-lib/syn-lib.ts index 10e0ab10..1648e2b4 100644 --- a/tests/syn-lib/syn-lib.ts +++ b/tests/syn-lib/syn-lib.ts @@ -1,88 +1,86 @@ -import {Connection} from './../../ui/src/syn' +import { Connection, Content } from './../../ui/src/syn' import { Config, InstallAgentsHapps } from '@holochain/tryorama' -import { HoloHash } from '@holochain/conductor-api' -import * as _ from 'lodash' import path from 'path' -import {delay, Delta, Signal, StateForSync} from '../common' +import { delay, Delta, Signal, StateForSync } from '../common' -const config = Config.gen(); +const config = Config.gen() const dna = path.join(__dirname, '../../syn.dna') console.log(dna) -const installation: InstallAgentsHapps = [ - // one agents - [[dna]], // contains 1 dna +const installation:InstallAgentsHapps = [ + // one agents + [[dna]], // contains 1 dna ] -process.on('unhandledRejection', error => { +process.on('unhandledRejection', error=>{ // Will print "unhandledRejection err is not defined" - console.log('unhandledRejection', error); -}); + console.log('unhandledRejection', error) +}) // Delta representation could be JSON or not, for now we are using // json so setting this variable to true -const jsonDeltas = true; +const jsonDeltas = true +export const oFn = (orchestrator)=>{ + const defaultContent:Content = { title: '', body: '' } + /* orchestrator.registerScenario('syn connect', async (s, t) => { + const [me_player] = await s.players([config]) + const [[me_happ]] = await me_player.installAgentsHapps(installation) + const appPort = me_player._conductor.appClient.client.socket._url.split(":")[2]; + const c = new Connection(appPort, me_happ.hAppId) + t.equal(c.appPort, appPort) + t.equal(c.appId, me_happ.hAppId) + t.equal(c.sessions.length, 0) + t.equal(c.syn, undefined) + t.equal(c.appClient, undefined) -export const oFn = (orchestrator) => { - const defaultContent = {title:'', body:''} -/* orchestrator.registerScenario('syn connect', async (s, t) => { - const [me_player] = await s.players([config]) - const [[me_happ]] = await me_player.installAgentsHapps(installation) - const appPort = me_player._conductor.appClient.client.socket._url.split(":")[2]; - const c = new Connection(appPort, me_happ.hAppId) - t.equal(c.appPort, appPort) - t.equal(c.appId, me_happ.hAppId) - t.equal(c.sessions.length, 0) - t.equal(c.syn, undefined) - t.equal(c.appClient, undefined) - - await c.open(defaultContent, () => {}) - t.notEqual(c.appClient, undefined) - t.deepEqual(c.syn.defaultContent, defaultContent) - })*/ - orchestrator.registerScenario('syn 2 nodes', async (s, t) => { - const [player1, player2] = await s.players([config, config]) - const [[syn1]] = await player1.installAgentsHapps(installation) - const [[syn2]] = await player2.installAgentsHapps(installation) - await s.shareAllNodes([player1, player2]); - const appPort1 = player1._conductor.appClient.client.socket._url.split(":")[2]; - const appPort2 = player2._conductor.appClient.client.socket._url.split(":")[2]; - const c1 = new Connection(appPort1, syn1.hAppId) - await c1.open(defaultContent, applyDeltas) - await c1.joinSession() - const c2 = new Connection(appPort2, syn2.hAppId) - await c2.open(defaultContent, applyDeltas) - await c2.joinSession() - t.equal(c1.syn.me, c2.session._scribeStr) - while (true) { - const others = Object.keys(c2.session.others) - if (others.length > 0) { - t.equal(c2.session.others[others[0]].pubKey.toString('base64'), c1.syn.me) - break - } else { - await delay(1000) - } - } - }) + await c.open(defaultContent, () => {}) + t.notEqual(c.appClient, undefined) + t.deepEqual(c.syn.defaultContent, defaultContent) + })*/ + orchestrator.registerScenario('syn 2 nodes', async (s, t)=>{ + const [player1, player2] = await s.players([config, config]) + const [[syn1]] = await player1.installAgentsHapps(installation) + const [[syn2]] = await player2.installAgentsHapps(installation) + await s.shareAllNodes([player1, player2]) + const appPort1:number = player1._conductor.appClient.client.socket._url.split(':')[2] + const appPort2:number = player2._conductor.appClient.client.socket._url.split(':')[2] + const c1 = new Connection(appPort1, syn1.hAppId) + await c1.open(defaultContent, applyDeltas) + await c1.joinSession() + const c2 = new Connection(appPort2, syn2.hAppId) + await c2.open(defaultContent, applyDeltas) + await c2.joinSession() + t.equal(c1.syn.me, c2.session._scribeStr) + while (true) { + const others = Object.keys(c2.session.others) + if (others.length > 0) { + t.equal(c2.session.others[others[0]].pubKey.toString('base64'), c1.syn.me) + break + } else { + await delay(1000) + } + } + }) } -const applyDeltas = (content, deltas) => { - for (const delta of deltas) { - switch(delta.type) { - case "Title": - content.title = delta.value - break - case "Add": - const [loc, text] = delta.value - content.body = content.body.slice(0, loc) + text + content.body.slice(loc) - break - case "Delete": - const [start, end] = delta.value - content.body = content.body.slice(0, start) + content.body.slice(end) - break - } +const applyDeltas = (content, deltas)=>{ + for (const delta of deltas) { + switch (delta.type) { + case 'Title': + content.title = delta.value + break + case 'Add': + const [loc, text] = delta.value + content.body = content.body.slice(0, loc) + text + content.body.slice(loc) + break + case 'Delete': + const [start, end] = delta.value + content.body = content.body.slice(0, start) + content.body.slice(end) + break } - return content + } + return content } +export type applyDeltas_T = ()=>Content diff --git a/ui/package-lock.json b/ui/package-lock.json index 65c4f61e..54f8621d 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -1,8 +1,1361 @@ { "name": "svelte-app", "version": "1.0.0", - "lockfileVersion": 1, + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "name": "svelte-app", + "version": "1.0.0", + "dependencies": { + "@holochain/conductor-api": "0.0.1", + "@rollup/plugin-typescript": "^8.2.1", + "rollup-plugin-typescript2": "^0.30.0", + "sirv-cli": "^1.0.0", + "svelte-fa": "^2.2.0", + "svelte-preprocess": "^4.7.0", + "typescript": "^4.2.4" + }, + "devDependencies": { + "@rollup/plugin-commonjs": "^16.0.0", + "@rollup/plugin-node-resolve": "^10.0.0", + "@rollup/plugin-replace": "^2.3.4", + "rollup": "^2.3.4", + "rollup-plugin-css-only": "^3.1.0", + "rollup-plugin-livereload": "^2.0.0", + "rollup-plugin-svelte": "^7.0.0", + "rollup-plugin-terser": "^7.0.0", + "svelte": "^3.0.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", + "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.10.4" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", + "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", + "dev": true + }, + "node_modules/@babel/highlight": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "node_modules/@holochain/conductor-api": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@holochain/conductor-api/-/conductor-api-0.0.1.tgz", + "integrity": "sha512-Vng5LG8JN1Zh7/s8OMOQKVih/Cz4zJo/6xpXnOYX148XC8bakKuaRXV08sTUWZMKElbq4BqZFTVcxJw3ouPt+w==", + "dependencies": { + "@msgpack/msgpack": "^2.1.0", + "@types/ws": "^7.2.4", + "isomorphic-ws": "^4.0.1", + "nanoid": "^3.1.9", + "ws": "^7.3.0" + } + }, + "node_modules/@holochain/conductor-api/node_modules/ws": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.4.tgz", + "integrity": "sha512-Qm8k8ojNQIMx7S+Zp8u/uHOx7Qazv3Yv4q68MiWWWOJhiwG5W3x7iqmRtJo8xxrciZUY4vRxUTJCKuRnF28ZZw==", + "engines": { + "node": ">=8.3.0" + } + }, + "node_modules/@msgpack/msgpack": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@msgpack/msgpack/-/msgpack-2.5.1.tgz", + "integrity": "sha512-l44t7u0VxuHZT5D2zCdsRbkUPkrAJMu4wyXTvHr75eXICklf38NZncRqPYA4g9t7rprPuRCPYT5+pTLihuSKRA==", + "dependencies": { + "tslib": ">=2.0.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@polka/url": { + "version": "1.0.0-next.11", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.11.tgz", + "integrity": "sha512-3NsZsJIA/22P3QUyrEDNA2D133H4j224twJrdipXN38dpnIOzAbUDtOwkcJ5pXmn75w7LSQDjA4tO9dm1XlqlA==" + }, + "node_modules/@rollup/plugin-commonjs": { + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-16.0.0.tgz", + "integrity": "sha512-LuNyypCP3msCGVQJ7ki8PqYdpjfEkE/xtFa5DqlF+7IBD0JsfMZ87C58heSwIMint58sAUZbt3ITqOmdQv/dXw==", + "dev": true, + "dependencies": { + "@rollup/pluginutils": "^3.1.0", + "commondir": "^1.0.1", + "estree-walker": "^2.0.1", + "glob": "^7.1.6", + "is-reference": "^1.2.1", + "magic-string": "^0.25.7", + "resolve": "^1.17.0" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/@rollup/plugin-node-resolve": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-10.0.0.tgz", + "integrity": "sha512-sNijGta8fqzwA1VwUEtTvWCx2E7qC70NMsDh4ZG13byAXYigBNZMxALhKUSycBks5gupJdq0lFrKumFrRZ8H3A==", + "dev": true, + "dependencies": { + "@rollup/pluginutils": "^3.1.0", + "@types/resolve": "1.17.1", + "builtin-modules": "^3.1.0", + "deepmerge": "^4.2.2", + "is-module": "^1.0.0", + "resolve": "^1.17.0" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/@rollup/plugin-replace": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-2.3.4.tgz", + "integrity": "sha512-waBhMzyAtjCL1GwZes2jaE9MjuQ/DQF2BatH3fRivUF3z0JBFrU0U6iBNC/4WR+2rLKhaAhPWDNPYp4mI6RqdQ==", + "dev": true, + "dependencies": { + "@rollup/pluginutils": "^3.1.0", + "magic-string": "^0.25.7" + } + }, + "node_modules/@rollup/plugin-typescript": { + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-8.2.1.tgz", + "integrity": "sha512-Qd2E1pleDR4bwyFxqbjt4eJf+wB0UKVMLc7/BAFDGVdAXQMCsD4DUv5/7/ww47BZCYxWtJqe1Lo0KVNswBJlRw==", + "dependencies": { + "@rollup/pluginutils": "^3.1.0", + "resolve": "^1.17.0" + }, + "engines": { + "node": ">=8.0.0" + }, + "peerDependencies": { + "rollup": "^2.14.0", + "tslib": "*", + "typescript": ">=3.7.0" + } + }, + "node_modules/@rollup/pluginutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", + "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", + "dependencies": { + "@types/estree": "0.0.39", + "estree-walker": "^1.0.1", + "picomatch": "^2.2.2" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/@rollup/pluginutils/node_modules/estree-walker": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", + "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==" + }, + "node_modules/@types/estree": { + "version": "0.0.39", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", + "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==" + }, + "node_modules/@types/node": { + "version": "14.14.16", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.16.tgz", + "integrity": "sha512-naXYePhweTi+BMv11TgioE2/FXU4fSl29HAH1ffxVciNsH3rYXjNP2yM8wqmSm7jS20gM8TIklKiTen+1iVncw==" + }, + "node_modules/@types/pug": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/pug/-/pug-2.0.4.tgz", + "integrity": "sha1-h3L80EGOPNLMFxVV1zAHQVBR9LI=" + }, + "node_modules/@types/resolve": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", + "integrity": "sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/sass": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/@types/sass/-/sass-1.16.0.tgz", + "integrity": "sha512-2XZovu4NwcqmtZtsBR5XYLw18T8cBCnU2USFHTnYLLHz9fkhnoEMoDsqShJIOFsFhn5aJHjweiUUdTrDGujegA==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/ws": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.0.tgz", + "integrity": "sha512-Y29uQ3Uy+58bZrFLhX36hcI3Np37nqWE7ky5tjiDoy1GDZnIwVxS0CgF+s+1bXMzjKBFy+fqaRfb708iNzdinw==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/async-limiter": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", + "dev": true + }, + "node_modules/balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "node_modules/binary-extensions": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", + "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "node_modules/builtin-modules": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.2.0.tgz", + "integrity": "sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chokidar": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.3.tgz", + "integrity": "sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ==", + "dev": true, + "dependencies": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.5.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.1.2" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "node_modules/console-clear": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/console-clear/-/console-clear-1.1.1.tgz", + "integrity": "sha512-pMD+MVR538ipqkG5JXeOEbKWS5um1H4LUUccUQG68qpeqBYbzYy79Gh55jkd2TtPdRfUaLWdv6LPP//5Zt0aPQ==", + "engines": { + "node": ">=4" + } + }, + "node_modules/deepmerge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/detect-indent": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.0.0.tgz", + "integrity": "sha512-oSyFlqaTHCItVRGK5RmrmjB+CmaMOW7IaNA/kdxqhoa6d17j/5ce9O9eWXmV/KEdRwqpQA+Vqe8a8Bsybu4YnA==", + "engines": { + "node": ">=8" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-cache-dir": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", + "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==", + "dependencies": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/avajs/find-cache-dir?sponsor=1" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "node_modules/get-port": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz", + "integrity": "sha1-3Xzn3hh8Bsi/NTeWrHHgmfCYDrw=", + "engines": { + "node": ">=4" + } + }, + "node_modules/glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", + "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==" + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-core-module": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", + "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", + "dependencies": { + "has": "^1.0.3" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", + "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=", + "dev": true + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-reference": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", + "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", + "dev": true, + "dependencies": { + "@types/estree": "*" + } + }, + "node_modules/isomorphic-ws": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", + "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==" + }, + "node_modules/jest-worker": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", + "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", + "dev": true, + "dependencies": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^7.0.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/jest-worker/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-worker/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "engines": { + "node": ">=6" + } + }, + "node_modules/livereload": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/livereload/-/livereload-0.9.1.tgz", + "integrity": "sha512-9g7sua11kkyZNo2hLRCG3LuZZwqexoyEyecSlV8cAsfAVVCZqLzVir6XDqmH0r+Vzgnd5LrdHDMyjtFnJQLAYw==", + "dev": true, + "dependencies": { + "chokidar": "^3.3.0", + "livereload-js": "^3.1.0", + "opts": ">= 1.2.0", + "ws": "^6.2.1" + }, + "bin": { + "livereload": "bin/livereload.js" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/livereload-js": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/livereload-js/-/livereload-js-3.3.1.tgz", + "integrity": "sha512-CBu1gTEfzVhlOK1WASKAAJ9Qx1fHECTq0SUB67sfxwQssopTyvzqTlgl+c0h9pZ6V+Fzd2rc510ppuNusg9teQ==", + "dev": true + }, + "node_modules/local-access": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/local-access/-/local-access-1.1.0.tgz", + "integrity": "sha512-XfegD5pyTAfb+GY6chk283Ox5z8WexG56OvM06RWLpAc/UHozO8X6xAxEkIitZOtsSMM1Yr3DkHgW5W+onLhCw==", + "engines": { + "node": ">=6" + } + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/magic-string": { + "version": "0.25.7", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", + "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", + "dev": true, + "dependencies": { + "sourcemap-codec": "^1.4.4" + } + }, + "node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "node_modules/mime": { + "version": "2.4.7", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.7.tgz", + "integrity": "sha512-dhNd1uA2u397uQk3Nv5LM4lm93WYDUXFn3Fu291FJerns4jyTudqhIWe4W04YLy7Uk1tm1Ore04NpjRvQp/NPA==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "engines": { + "node": ">=4" + } + }, + "node_modules/minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/mri": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.6.tgz", + "integrity": "sha512-oi1b3MfbyGa7FJMP9GmLTttni5JoICpYBRlq+x5V16fZbLsnL9N3wFqqIm/nIG43FjUFkFh9Epzp/kzUGUnJxQ==", + "engines": { + "node": ">=4" + } + }, + "node_modules/nanoid": { + "version": "3.1.22", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.22.tgz", + "integrity": "sha512-/2ZUaJX2ANuLtTvqTlgqBQNJoQO398KyJgZloL0PZkC0dpysjncRUPsFe3DUPzz/y3h+u7C46np8RMuvF3jsSQ==", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/opts": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/opts/-/opts-2.0.2.tgz", + "integrity": "sha512-k41FwbcLnlgnFh69f4qdUfvDQ+5vaSDnVPFI/y5XuhKRq97EnVVneO9F1ESVCdiVu4fCS2L8usX3mU331hB7pg==", + "dev": true + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" + }, + "node_modules/picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "engines": { + "node": ">=8.6" + } + }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/readdirp": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", + "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/require-relative": { + "version": "0.8.7", + "resolved": "https://registry.npmjs.org/require-relative/-/require-relative-0.8.7.tgz", + "integrity": "sha1-eZlTn8ngR6N5KPoZb44VY9q9Nt4=", + "dev": true + }, + "node_modules/resolve": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "dependencies": { + "is-core-module": "^2.2.0", + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/rollup": { + "version": "2.35.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.35.1.tgz", + "integrity": "sha512-q5KxEyWpprAIcainhVy6HfRttD9kutQpHbeqDTWnqAFNJotiojetK6uqmcydNMymBEtC4I8bCYR+J3mTMqeaUA==", + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=10.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.1.2" + } + }, + "node_modules/rollup-plugin-css-only": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-css-only/-/rollup-plugin-css-only-3.1.0.tgz", + "integrity": "sha512-TYMOE5uoD76vpj+RTkQLzC9cQtbnJNktHPB507FzRWBVaofg7KhIqq1kGbcVOadARSozWF883Ho9KpSPKH8gqA==", + "dev": true, + "dependencies": { + "@rollup/pluginutils": "4" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/rollup-plugin-css-only/node_modules/@rollup/pluginutils": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.1.0.tgz", + "integrity": "sha512-TrBhfJkFxA+ER+ew2U2/fHbebhLT/l/2pRk0hfj9KusXUuRXd2v0R58AfaZK9VXDQ4TogOSEmICVrQAA3zFnHQ==", + "dev": true, + "dependencies": { + "estree-walker": "^2.0.1", + "picomatch": "^2.2.2" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/rollup-plugin-livereload": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-livereload/-/rollup-plugin-livereload-2.0.0.tgz", + "integrity": "sha512-oC/8NqumGYuphkqrfszOHUUIwzKsaHBICw6QRwT5uD07gvePTS+HW+GFwu6f9K8W02CUuTvtIM9AWJrbj4wE1A==", + "dev": true, + "dependencies": { + "livereload": "^0.9.1" + }, + "engines": { + "node": ">=8.3" + } + }, + "node_modules/rollup-plugin-svelte": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-svelte/-/rollup-plugin-svelte-7.0.0.tgz", + "integrity": "sha512-cw4yv/5v1NQV3nPbpOJtikgkB+9mfSJaqKUdq7x5fVQJnwLtcdc2JOszBs5pBY+SemTs5pmJbdEMseEavbUtjQ==", + "dev": true, + "dependencies": { + "require-relative": "^0.8.7", + "rollup-pluginutils": "^2.8.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/rollup-plugin-terser": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz", + "integrity": "sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.10.4", + "jest-worker": "^26.2.1", + "serialize-javascript": "^4.0.0", + "terser": "^5.0.0" + } + }, + "node_modules/rollup-plugin-typescript2": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.30.0.tgz", + "integrity": "sha512-NUFszIQyhgDdhRS9ya/VEmsnpTe+GERDMmFo0Y+kf8ds51Xy57nPNGglJY+W6x1vcouA7Au7nsTgsLFj2I0PxQ==", + "dependencies": { + "@rollup/pluginutils": "^4.1.0", + "find-cache-dir": "^3.3.1", + "fs-extra": "8.1.0", + "resolve": "1.20.0", + "tslib": "2.1.0" + }, + "peerDependencies": { + "rollup": ">=1.26.3", + "typescript": ">=2.4.0" + } + }, + "node_modules/rollup-plugin-typescript2/node_modules/@rollup/pluginutils": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.1.0.tgz", + "integrity": "sha512-TrBhfJkFxA+ER+ew2U2/fHbebhLT/l/2pRk0hfj9KusXUuRXd2v0R58AfaZK9VXDQ4TogOSEmICVrQAA3zFnHQ==", + "dependencies": { + "estree-walker": "^2.0.1", + "picomatch": "^2.2.2" + }, + "engines": { + "node": ">= 8.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0" + } + }, + "node_modules/rollup-pluginutils": { + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", + "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==", + "dev": true, + "dependencies": { + "estree-walker": "^0.6.1" + } + }, + "node_modules/rollup-pluginutils/node_modules/estree-walker": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", + "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", + "dev": true + }, + "node_modules/sade": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/sade/-/sade-1.7.4.tgz", + "integrity": "sha512-y5yauMD93rX840MwUJr7C1ysLFBgMspsdTo4UVrDg3fXDvtwOyIqykhVAAm6fk/3au77773itJStObgK+LKaiA==", + "dependencies": { + "mri": "^1.1.0" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + }, + "node_modules/semiver": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/semiver/-/semiver-1.1.0.tgz", + "integrity": "sha512-QNI2ChmuioGC1/xjyYwyZYADILWyW6AmS1UH6gDj/SFUUUS4MBAWs/7mxnkRPc/F4iHezDP+O8t0dO8WHiEOdg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/serialize-javascript": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", + "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", + "dev": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/sirv": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/sirv/-/sirv-1.0.10.tgz", + "integrity": "sha512-H5EZCoZaggEUQy8ocKsF7WAToGuZhjJlLvM3XOef46CbdIgbNeQ1p32N1PCuCjkVYwrAVOSMacN6CXXgIzuspg==", + "dependencies": { + "@polka/url": "^1.0.0-next.9", + "mime": "^2.3.1", + "totalist": "^1.0.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/sirv-cli": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/sirv-cli/-/sirv-cli-1.0.10.tgz", + "integrity": "sha512-8mLTRkvzpZXMyUZJ1whf84YHN/mm2r2+j5sU1ZYr5n2jA8VkFItNPk53oysOo+0QxBVp9aUjggkAsQp1d7L3OQ==", + "dependencies": { + "console-clear": "^1.1.0", + "get-port": "^3.2.0", + "kleur": "^3.0.0", + "local-access": "^1.0.1", + "sade": "^1.6.0", + "semiver": "^1.0.0", + "sirv": "^1.0.10", + "tinydate": "^1.0.0" + }, + "bin": { + "sirv": "bin.js" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/source-map-support/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sourcemap-codec": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", + "dev": true + }, + "node_modules/strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dependencies": { + "min-indent": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/svelte": { + "version": "3.31.0", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.31.0.tgz", + "integrity": "sha512-r+n8UJkDqoQm1b+3tA3Lh6mHXKpcfOSOuEuIo5gE2W9wQYi64RYX/qE6CZBDDsP/H4M+N426JwY7XGH4xASvGQ==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/svelte-fa": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/svelte-fa/-/svelte-fa-2.2.0.tgz", + "integrity": "sha512-PN1H8AWDh+OwhwjJKTv4/zXvKvmvOEVSCVhIhji6Onx8XEw+CGf8BDR0BVUIp87IEX+DEqIo9pbyhgz8EoYZyA==" + }, + "node_modules/svelte-preprocess": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/svelte-preprocess/-/svelte-preprocess-4.7.0.tgz", + "integrity": "sha512-iNrY4YGqi0LD2e6oT9YbdSzOKntxk8gmzfqso1z/lUJOZh4o6fyIqkirmiZ8/dDJFqtIE1spVgDFWgkfhLEYlw==", + "hasInstallScript": true, + "dependencies": { + "@types/pug": "^2.0.4", + "@types/sass": "^1.16.0", + "detect-indent": "^6.0.0", + "strip-indent": "^3.0.0" + }, + "engines": { + "node": ">= 9.11.2" + }, + "peerDependencies": { + "@babel/core": "^7.10.2", + "coffeescript": "^2.5.1", + "less": "^3.11.3", + "postcss": "^7 || ^8", + "postcss-load-config": "^2.1.0 || ^3.0.0", + "pug": "^3.0.0", + "sass": "^1.26.8", + "stylus": "^0.54.7", + "sugarss": "^2.0.0", + "svelte": "^3.23.0", + "typescript": "^3.9.5 || ^4.0.0" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "coffeescript": { + "optional": true + }, + "less": { + "optional": true + }, + "node-sass": { + "optional": true + }, + "postcss": { + "optional": true + }, + "postcss-load-config": { + "optional": true + }, + "pug": { + "optional": true + }, + "sass": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "typescript": { + "optional": true + } + } + }, + "node_modules/terser": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.5.1.tgz", + "integrity": "sha512-6VGWZNVP2KTUcltUQJ25TtNjx/XgdDsBDKGt8nN0MpydU36LmbPPcMBd2kmtZNNGVVDLg44k7GKeHHj+4zPIBQ==", + "dev": true, + "dependencies": { + "commander": "^2.20.0", + "source-map": "~0.7.2", + "source-map-support": "~0.5.19" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/tinydate": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/tinydate/-/tinydate-1.3.0.tgz", + "integrity": "sha512-7cR8rLy2QhYHpsBDBVYnnWXm8uRTr38RoZakFSW7Bs7PzfMPNZthuMLkwqZv7MTu8lhQ91cOFYS5a7iFj2oR3w==", + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/totalist": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/totalist/-/totalist-1.1.0.tgz", + "integrity": "sha512-gduQwd1rOdDMGxFG1gEvhV88Oirdo2p+KjoYFU7k2g+i7n6AFFbDQ5kMPUsW0pNbfQsB/cwXvT1i4Bue0s9g5g==", + "engines": { + "node": ">=6" + } + }, + "node_modules/tslib": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz", + "integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==" + }, + "node_modules/typescript": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", + "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "node_modules/ws": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", + "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", + "dev": true, + "dependencies": { + "async-limiter": "~1.0.0" + } + } + }, "dependencies": { "@babel/code-frame": { "version": "7.12.11", @@ -101,11 +1454,19 @@ "magic-string": "^0.25.7" } }, + "@rollup/plugin-typescript": { + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-8.2.1.tgz", + "integrity": "sha512-Qd2E1pleDR4bwyFxqbjt4eJf+wB0UKVMLc7/BAFDGVdAXQMCsD4DUv5/7/ww47BZCYxWtJqe1Lo0KVNswBJlRw==", + "requires": { + "@rollup/pluginutils": "^3.1.0", + "resolve": "^1.17.0" + } + }, "@rollup/pluginutils": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", - "dev": true, "requires": { "@types/estree": "0.0.39", "estree-walker": "^1.0.1", @@ -115,22 +1476,25 @@ "estree-walker": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", - "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", - "dev": true + "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==" } } }, "@types/estree": { "version": "0.0.39", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", - "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", - "dev": true + "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==" }, "@types/node": { "version": "14.14.16", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.16.tgz", "integrity": "sha512-naXYePhweTi+BMv11TgioE2/FXU4fSl29HAH1ffxVciNsH3rYXjNP2yM8wqmSm7jS20gM8TIklKiTen+1iVncw==" }, + "@types/pug": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/pug/-/pug-2.0.4.tgz", + "integrity": "sha1-h3L80EGOPNLMFxVV1zAHQVBR9LI=" + }, "@types/resolve": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", @@ -140,6 +1504,14 @@ "@types/node": "*" } }, + "@types/sass": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/@types/sass/-/sass-1.16.0.tgz", + "integrity": "sha512-2XZovu4NwcqmtZtsBR5XYLw18T8cBCnU2USFHTnYLLHz9fkhnoEMoDsqShJIOFsFhn5aJHjweiUUdTrDGujegA==", + "requires": { + "@types/node": "*" + } + }, "@types/ws": { "version": "7.4.0", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.0.tgz", @@ -267,8 +1639,7 @@ "commondir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", - "dev": true + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=" }, "concat-map": { "version": "0.0.1", @@ -287,6 +1658,11 @@ "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", "dev": true }, + "detect-indent": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.0.0.tgz", + "integrity": "sha512-oSyFlqaTHCItVRGK5RmrmjB+CmaMOW7IaNA/kdxqhoa6d17j/5ce9O9eWXmV/KEdRwqpQA+Vqe8a8Bsybu4YnA==" + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -296,8 +1672,7 @@ "estree-walker": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", - "dev": true + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" }, "fill-range": { "version": "7.0.1", @@ -308,6 +1683,35 @@ "to-regex-range": "^5.0.1" } }, + "find-cache-dir": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", + "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==", + "requires": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -318,14 +1722,12 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", - "dev": true, "optional": true }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "get-port": { "version": "3.2.0", @@ -355,11 +1757,15 @@ "is-glob": "^4.0.1" } }, + "graceful-fs": { + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", + "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==" + }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, "requires": { "function-bind": "^1.1.1" } @@ -399,7 +1805,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", - "dev": true, "requires": { "has": "^1.0.3" } @@ -479,6 +1884,14 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "requires": { + "graceful-fs": "^4.1.6" + } + }, "kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -507,6 +1920,14 @@ "resolved": "https://registry.npmjs.org/local-access/-/local-access-1.1.0.tgz", "integrity": "sha512-XfegD5pyTAfb+GY6chk283Ox5z8WexG56OvM06RWLpAc/UHozO8X6xAxEkIitZOtsSMM1Yr3DkHgW5W+onLhCw==" }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "requires": { + "p-locate": "^4.1.0" + } + }, "magic-string": { "version": "0.25.7", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", @@ -516,6 +1937,14 @@ "sourcemap-codec": "^1.4.4" } }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "requires": { + "semver": "^6.0.0" + } + }, "merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -527,6 +1956,11 @@ "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.7.tgz", "integrity": "sha512-dhNd1uA2u397uQk3Nv5LM4lm93WYDUXFn3Fu291FJerns4jyTudqhIWe4W04YLy7Uk1tm1Ore04NpjRvQp/NPA==" }, + "min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==" + }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -567,6 +2001,32 @@ "integrity": "sha512-k41FwbcLnlgnFh69f4qdUfvDQ+5vaSDnVPFI/y5XuhKRq97EnVVneO9F1ESVCdiVu4fCS2L8usX3mU331hB7pg==", "dev": true }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -576,14 +2036,20 @@ "path-parse": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "dev": true + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" }, "picomatch": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", - "dev": true + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==" + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "requires": { + "find-up": "^4.0.0" + } }, "randombytes": { "version": "2.1.0", @@ -610,12 +2076,11 @@ "dev": true }, "resolve": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", - "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", - "dev": true, + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", "requires": { - "is-core-module": "^2.1.0", + "is-core-module": "^2.2.0", "path-parse": "^1.0.6" } }, @@ -623,7 +2088,6 @@ "version": "2.35.1", "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.35.1.tgz", "integrity": "sha512-q5KxEyWpprAIcainhVy6HfRttD9kutQpHbeqDTWnqAFNJotiojetK6uqmcydNMymBEtC4I8bCYR+J3mTMqeaUA==", - "dev": true, "requires": { "fsevents": "~2.1.2" } @@ -680,6 +2144,29 @@ "terser": "^5.0.0" } }, + "rollup-plugin-typescript2": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.30.0.tgz", + "integrity": "sha512-NUFszIQyhgDdhRS9ya/VEmsnpTe+GERDMmFo0Y+kf8ds51Xy57nPNGglJY+W6x1vcouA7Au7nsTgsLFj2I0PxQ==", + "requires": { + "@rollup/pluginutils": "^4.1.0", + "find-cache-dir": "^3.3.1", + "fs-extra": "8.1.0", + "resolve": "1.20.0", + "tslib": "2.1.0" + }, + "dependencies": { + "@rollup/pluginutils": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.1.0.tgz", + "integrity": "sha512-TrBhfJkFxA+ER+ew2U2/fHbebhLT/l/2pRk0hfj9KusXUuRXd2v0R58AfaZK9VXDQ4TogOSEmICVrQAA3zFnHQ==", + "requires": { + "estree-walker": "^2.0.1", + "picomatch": "^2.2.2" + } + } + } + }, "rollup-pluginutils": { "version": "2.8.2", "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", @@ -716,6 +2203,11 @@ "resolved": "https://registry.npmjs.org/semiver/-/semiver-1.1.0.tgz", "integrity": "sha512-QNI2ChmuioGC1/xjyYwyZYADILWyW6AmS1UH6gDj/SFUUUS4MBAWs/7mxnkRPc/F4iHezDP+O8t0dO8WHiEOdg==" }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + }, "serialize-javascript": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", @@ -780,6 +2272,14 @@ "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", "dev": true }, + "strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "requires": { + "min-indent": "^1.0.0" + } + }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -792,14 +2292,24 @@ "svelte": { "version": "3.31.0", "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.31.0.tgz", - "integrity": "sha512-r+n8UJkDqoQm1b+3tA3Lh6mHXKpcfOSOuEuIo5gE2W9wQYi64RYX/qE6CZBDDsP/H4M+N426JwY7XGH4xASvGQ==", - "dev": true + "integrity": "sha512-r+n8UJkDqoQm1b+3tA3Lh6mHXKpcfOSOuEuIo5gE2W9wQYi64RYX/qE6CZBDDsP/H4M+N426JwY7XGH4xASvGQ==" }, "svelte-fa": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/svelte-fa/-/svelte-fa-2.2.0.tgz", "integrity": "sha512-PN1H8AWDh+OwhwjJKTv4/zXvKvmvOEVSCVhIhji6Onx8XEw+CGf8BDR0BVUIp87IEX+DEqIo9pbyhgz8EoYZyA==" }, + "svelte-preprocess": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/svelte-preprocess/-/svelte-preprocess-4.7.0.tgz", + "integrity": "sha512-iNrY4YGqi0LD2e6oT9YbdSzOKntxk8gmzfqso1z/lUJOZh4o6fyIqkirmiZ8/dDJFqtIE1spVgDFWgkfhLEYlw==", + "requires": { + "@types/pug": "^2.0.4", + "@types/sass": "^1.16.0", + "detect-indent": "^6.0.0", + "strip-indent": "^3.0.0" + } + }, "terser": { "version": "5.5.1", "resolved": "https://registry.npmjs.org/terser/-/terser-5.5.1.tgz", @@ -835,6 +2345,16 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz", "integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==" }, + "typescript": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", + "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==" + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/ui/package.json b/ui/package.json index 9b309aee..40b14133 100644 --- a/ui/package.json +++ b/ui/package.json @@ -19,7 +19,11 @@ }, "dependencies": { "@holochain/conductor-api": "0.0.1", + "@rollup/plugin-typescript": "^8.2.1", + "rollup-plugin-typescript2": "^0.30.0", "sirv-cli": "^1.0.0", - "svelte-fa": "^2.2.0" + "svelte-fa": "^2.2.0", + "svelte-preprocess": "^4.7.0", + "typescript": "^4.2.4" } } diff --git a/ui/public/index.html b/ui/public/index.html index 5da7ed3e..99770484 100644 --- a/ui/public/index.html +++ b/ui/public/index.html @@ -10,7 +10,7 @@ - + diff --git a/ui/rollup.config.js b/ui/rollup.config.js index 57c1671b..d5093719 100644 --- a/ui/rollup.config.js +++ b/ui/rollup.config.js @@ -5,6 +5,8 @@ import resolve from '@rollup/plugin-node-resolve'; import livereload from 'rollup-plugin-livereload'; import { terser } from 'rollup-plugin-terser'; import css from 'rollup-plugin-css-only'; +import typescript from '@rollup/plugin-typescript'; +import preprocess from 'svelte-preprocess'; const production = !process.env.ROLLUP_WATCH; @@ -35,17 +37,25 @@ export default { sourcemap: true, format: 'iife', name: 'app', - file: 'public/build/bundle.js' + dir: 'public/build' }, plugins: [ replace({ 'process.env.NODE_ENV': JSON.stringify(process.env.NODE) }), + typescript(), svelte({ compilerOptions: { // enable run-time checks when not in production dev: !production - } + }, + preprocess: preprocess({ + sourcemap: !production, + defaults: { + script: 'typescript', + style: 'scss' + } + }) }), // we'll extract any component CSS out into // a separate file - better for performance diff --git a/ui/src/App.svelte b/ui/src/App.svelte index 46ee8fe8..6cd1eecd 100644 --- a/ui/src/App.svelte +++ b/ui/src/App.svelte @@ -1,44 +1,46 @@ - -
{#if $connection && $connection.syn && $connection.syn.me} - + {/if} {#each Object.keys($folks) as p} - + {/each}
diff --git a/ui/src/History.svelte b/ui/src/History.svelte index 8d8fc27a..afce816a 100644 --- a/ui/src/History.svelte +++ b/ui/src/History.svelte @@ -1,6 +1,6 @@ diff --git a/ui/rollup.config.js b/ui/rollup.config.js index 0735c08d..c9d904de 100644 --- a/ui/rollup.config.js +++ b/ui/rollup.config.js @@ -32,7 +32,7 @@ function serve() { } export default { - input: 'src/main.js', + input: 'src/main.ts', output: { sourcemap: true, format: 'iife', diff --git a/ui/src/main.js b/ui/src/main.ts similarity index 100% rename from ui/src/main.js rename to ui/src/main.ts From 0b6739e4741a252fc7cc2953e47328e860d055f1 Mon Sep 17 00:00:00 2001 From: Brian Takita Date: Fri, 23 Apr 2021 10:31:58 -0400 Subject: [PATCH 09/33] wip --- pnpm-workspace.yaml | 3 + tests/syn-lib/syn-lib.ts | 8 +- ui/package-lock.json | 662 +++++++++++--------------- ui/package.json | 28 +- ui/rollup.config.js | 2 +- ui/src/App.svelte | 13 +- ui/src/Debug.svelte | 11 +- ui/src/Editor.svelte | 10 +- ui/src/History.svelte | 8 +- ui/src/StateForSync.ts | 2 +- ui/src/Syn.svelte | 11 +- ui/src/Syn.ts | 35 +- ui/src/Title.svelte | 6 +- ui/src/{ => connection}/Connection.ts | 16 +- ui/src/connection/connection_b.ts | 9 + ui/src/connection/index.ts | 2 + ui/src/{ => content}/Content.ts | 0 ui/src/content/content_b.ts | 12 + ui/src/content/index.ts | 2 + ui/src/{ => delta}/ApplyDelta.ts | 2 +- ui/src/{ => delta}/Delta.ts | 0 ui/src/delta/committedChanges_b.ts | 9 + ui/src/delta/index.ts | 7 + ui/src/delta/nextIndex_b.ts | 10 + ui/src/delta/recordedChanges_b.ts | 9 + ui/src/delta/requestedChanges_b.ts | 9 + ui/src/{ => folk}/Folk.svelte | 11 +- ui/src/{ => folk}/Folk.ts | 6 +- ui/src/{ => folk}/Folks.svelte | 7 +- ui/src/folk/folks_b.ts | 9 + ui/src/folk/index.ts | 7 + ui/src/scribe/index.ts | 1 + ui/src/scribe/scribeStr_b.ts | 8 + ui/src/{ => session}/Session.ts | 42 +- ui/src/{ => session}/SessionInfo.ts | 2 +- ui/src/session/index.ts | 3 + ui/src/session/session_b.ts | 15 + ui/src/stores.ts | 39 -- ui/tsconfig.json | 5 - 39 files changed, 516 insertions(+), 525 deletions(-) create mode 100644 pnpm-workspace.yaml rename ui/src/{ => connection}/Connection.ts (85%) create mode 100644 ui/src/connection/connection_b.ts create mode 100644 ui/src/connection/index.ts rename ui/src/{ => content}/Content.ts (100%) create mode 100644 ui/src/content/content_b.ts create mode 100644 ui/src/content/index.ts rename ui/src/{ => delta}/ApplyDelta.ts (88%) rename ui/src/{ => delta}/Delta.ts (100%) create mode 100644 ui/src/delta/committedChanges_b.ts create mode 100644 ui/src/delta/index.ts create mode 100644 ui/src/delta/nextIndex_b.ts create mode 100644 ui/src/delta/recordedChanges_b.ts create mode 100644 ui/src/delta/requestedChanges_b.ts rename ui/src/{ => folk}/Folk.svelte (89%) rename ui/src/{ => folk}/Folk.ts (74%) rename ui/src/{ => folk}/Folks.svelte (71%) create mode 100644 ui/src/folk/folks_b.ts create mode 100644 ui/src/folk/index.ts create mode 100644 ui/src/scribe/index.ts create mode 100644 ui/src/scribe/scribeStr_b.ts rename ui/src/{ => session}/Session.ts (94%) rename ui/src/{ => session}/SessionInfo.ts (84%) create mode 100644 ui/src/session/index.ts create mode 100644 ui/src/session/session_b.ts delete mode 100644 ui/src/stores.ts diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 00000000..a41ce147 --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,3 @@ +packages: + - 'js/apps/*' + - 'js/libs/*' diff --git a/tests/syn-lib/syn-lib.ts b/tests/syn-lib/syn-lib.ts index 12b4fc09..77a012d0 100644 --- a/tests/syn-lib/syn-lib.ts +++ b/tests/syn-lib/syn-lib.ts @@ -1,5 +1,5 @@ -import { Connection } from '../../ui/src/Connection' -import { Content } from '../../ui/src/Content' +import { Connection } from '../../ui/src/connection' +import { Content } from '../../ui/src/content' import { Config, InstallAgentsHapps } from '@holochain/tryorama' import path from 'path' import { delay } from '../common' @@ -47,10 +47,10 @@ export const oFn = (orchestrator)=>{ await s.shareAllNodes([player1, player2]) const appPort1:number = player1._conductor.appClient.client.socket._url.split(':')[2] const appPort2:number = player2._conductor.appClient.client.socket._url.split(':')[2] - const c1 = new Connection(appPort1, syn1.hAppId) + const c1 = new Connection({}, appPort1, syn1.hAppId) await c1.open(defaultContent, applyDeltas) await c1.joinSession() - const c2 = new Connection(appPort2, syn2.hAppId) + const c2 = new Connection({}, appPort2, syn2.hAppId) await c2.open(defaultContent, applyDeltas) await c2.joinSession() t.equal(c1.syn.me, c2.session._scribeStr) diff --git a/ui/package-lock.json b/ui/package-lock.json index 54f8621d..085d6993 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -9,23 +9,24 @@ "version": "1.0.0", "dependencies": { "@holochain/conductor-api": "0.0.1", - "@rollup/plugin-typescript": "^8.2.1", - "rollup-plugin-typescript2": "^0.30.0", - "sirv-cli": "^1.0.0", - "svelte-fa": "^2.2.0", - "svelte-preprocess": "^4.7.0", - "typescript": "^4.2.4" + "sirv-cli": "^1.0.11", + "svelte-fa": "^2.2.0" }, "devDependencies": { + "@ctx-core/object": "^17.5.8", + "@ctx-core/store": "^24.2.3", "@rollup/plugin-commonjs": "^16.0.0", "@rollup/plugin-node-resolve": "^10.0.0", - "@rollup/plugin-replace": "^2.3.4", - "rollup": "^2.3.4", + "@rollup/plugin-replace": "^2.4.2", + "@rollup/plugin-typescript": "^8.2.1", + "rollup": "^2.45.2", "rollup-plugin-css-only": "^3.1.0", "rollup-plugin-livereload": "^2.0.0", - "rollup-plugin-svelte": "^7.0.0", - "rollup-plugin-terser": "^7.0.0", - "svelte": "^3.0.0" + "rollup-plugin-svelte": "^7.1.0", + "rollup-plugin-terser": "^7.0.2", + "svelte": "^3.37.0", + "svelte-preprocess": "^4.7.2", + "typescript": "^4.2.4" } }, "node_modules/@babel/code-frame": { @@ -54,6 +55,61 @@ "js-tokens": "^4.0.0" } }, + "node_modules/@ctx-core/array": { + "version": "20.2.10", + "resolved": "https://registry.npmjs.org/@ctx-core/array/-/array-20.2.10.tgz", + "integrity": "sha512-/YqpFwZ0f9Yh1KLm78rrVbbeq+F7LQu91P4IB3+G3/9Leg70FA+MMkSIKcvj2jDNGnmjPGQBGUiYSDeLfyff7g==", + "dev": true, + "dependencies": { + "@ctx-core/combinators": "^6.0.10", + "@ctx-core/function": "^17.4.7", + "@ctx-core/object": "^17.5.8", + "@ctx-core/set": "^9.0.18" + } + }, + "node_modules/@ctx-core/combinators": { + "version": "6.0.10", + "resolved": "https://registry.npmjs.org/@ctx-core/combinators/-/combinators-6.0.10.tgz", + "integrity": "sha512-l16FC/IsyfTOffJkRq5kZSgfnjNa8Wz7m0HpyGQu6//fcePpOvFL+HuQvXgnsMREF6DiayW03QXdStk1kCDBjw==", + "dev": true + }, + "node_modules/@ctx-core/function": { + "version": "17.4.7", + "resolved": "https://registry.npmjs.org/@ctx-core/function/-/function-17.4.7.tgz", + "integrity": "sha512-ZDASKCKnyp5/TSejfetvibyuvjdt6Dhe/JbPcvF2Hm7p+EHhTSPdNyE3EdaTZarWs63AoBllJAxsTgdhL+vs9g==", + "dev": true + }, + "node_modules/@ctx-core/object": { + "version": "17.5.8", + "resolved": "https://registry.npmjs.org/@ctx-core/object/-/object-17.5.8.tgz", + "integrity": "sha512-gvzwD6835tlm4+dAha///sEKlLJYm95SNCul8mQP8bBJlGA17RVIhApF9k/U7HW7Zn4L3XcFHH9PHdik0KGB1A==", + "dev": true, + "dependencies": { + "@ctx-core/function": "^17.4.7" + } + }, + "node_modules/@ctx-core/set": { + "version": "9.0.18", + "resolved": "https://registry.npmjs.org/@ctx-core/set/-/set-9.0.18.tgz", + "integrity": "sha512-RPT1HCPrBR/sGyisv1QN3Bc7/XbTTCKHVvpSvkR9OthPB1AHIyDpUx/vEjnJqojZ0Q0sr3GltuqQl0XAkUhO5g==", + "dev": true, + "dependencies": { + "@ctx-core/function": "^17.4.7" + } + }, + "node_modules/@ctx-core/store": { + "version": "24.2.3", + "resolved": "https://registry.npmjs.org/@ctx-core/store/-/store-24.2.3.tgz", + "integrity": "sha512-1m+VM2wKOSfhPxdQIlkzCrlnAxkJRpBvIhqtAVgsbJIHQWn/qoSbWwuXTk9OqQVWvsTiwfPoMb9euLn/5kceTQ==", + "dev": true, + "dependencies": { + "@ctx-core/array": "^20.2.10", + "@ctx-core/combinators": "^6.0.10", + "@ctx-core/function": "^17.4.7", + "@ctx-core/object": "^17.5.8", + "svelte": "3.37.0" + } + }, "node_modules/@holochain/conductor-api": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/@holochain/conductor-api/-/conductor-api-0.0.1.tgz", @@ -86,9 +142,9 @@ } }, "node_modules/@polka/url": { - "version": "1.0.0-next.11", - "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.11.tgz", - "integrity": "sha512-3NsZsJIA/22P3QUyrEDNA2D133H4j224twJrdipXN38dpnIOzAbUDtOwkcJ5pXmn75w7LSQDjA4tO9dm1XlqlA==" + "version": "1.0.0-next.12", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.12.tgz", + "integrity": "sha512-6RglhutqrGFMO1MNUXp95RBuYIuc8wTnMAV5MUhLmjTOy78ncwOw7RgeQ/HeymkKXRhZd0s2DNrM1rL7unk3MQ==" }, "node_modules/@rollup/plugin-commonjs": { "version": "16.0.0", @@ -126,19 +182,23 @@ } }, "node_modules/@rollup/plugin-replace": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-2.3.4.tgz", - "integrity": "sha512-waBhMzyAtjCL1GwZes2jaE9MjuQ/DQF2BatH3fRivUF3z0JBFrU0U6iBNC/4WR+2rLKhaAhPWDNPYp4mI6RqdQ==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-2.4.2.tgz", + "integrity": "sha512-IGcu+cydlUMZ5En85jxHH4qj2hta/11BHq95iHEyb2sbgiN0eCdzvUcHw5gt9pBL5lTi4JDYJ1acCoMGpTvEZg==", "dev": true, "dependencies": { "@rollup/pluginutils": "^3.1.0", "magic-string": "^0.25.7" + }, + "peerDependencies": { + "rollup": "^1.20.0 || ^2.0.0" } }, "node_modules/@rollup/plugin-typescript": { "version": "8.2.1", "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-8.2.1.tgz", "integrity": "sha512-Qd2E1pleDR4bwyFxqbjt4eJf+wB0UKVMLc7/BAFDGVdAXQMCsD4DUv5/7/ww47BZCYxWtJqe1Lo0KVNswBJlRw==", + "dev": true, "dependencies": { "@rollup/pluginutils": "^3.1.0", "resolve": "^1.17.0" @@ -156,6 +216,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", + "dev": true, "dependencies": { "@types/estree": "0.0.39", "estree-walker": "^1.0.1", @@ -168,12 +229,14 @@ "node_modules/@rollup/pluginutils/node_modules/estree-walker": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", - "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==" + "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", + "dev": true }, "node_modules/@types/estree": { "version": "0.0.39", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", - "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==" + "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", + "dev": true }, "node_modules/@types/node": { "version": "14.14.16", @@ -183,7 +246,8 @@ "node_modules/@types/pug": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@types/pug/-/pug-2.0.4.tgz", - "integrity": "sha1-h3L80EGOPNLMFxVV1zAHQVBR9LI=" + "integrity": "sha1-h3L80EGOPNLMFxVV1zAHQVBR9LI=", + "dev": true }, "node_modules/@types/resolve": { "version": "1.17.1", @@ -198,6 +262,7 @@ "version": "1.16.0", "resolved": "https://registry.npmjs.org/@types/sass/-/sass-1.16.0.tgz", "integrity": "sha512-2XZovu4NwcqmtZtsBR5XYLw18T8cBCnU2USFHTnYLLHz9fkhnoEMoDsqShJIOFsFhn5aJHjweiUUdTrDGujegA==", + "dev": true, "dependencies": { "@types/node": "*" } @@ -352,7 +417,8 @@ "node_modules/commondir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=" + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true }, "node_modules/concat-map": { "version": "0.0.1", @@ -381,6 +447,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.0.0.tgz", "integrity": "sha512-oSyFlqaTHCItVRGK5RmrmjB+CmaMOW7IaNA/kdxqhoa6d17j/5ce9O9eWXmV/KEdRwqpQA+Vqe8a8Bsybu4YnA==", + "dev": true, "engines": { "node": ">=8" } @@ -397,7 +464,8 @@ "node_modules/estree-walker": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true }, "node_modules/fill-range": { "version": "7.0.1", @@ -411,47 +479,6 @@ "node": ">=8" } }, - "node_modules/find-cache-dir": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", - "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==", - "dependencies": { - "commondir": "^1.0.1", - "make-dir": "^3.0.2", - "pkg-dir": "^4.1.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/avajs/find-cache-dir?sponsor=1" - } - }, - "node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - }, - "engines": { - "node": ">=6 <7 || >=8" - } - }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -462,6 +489,7 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "dev": true, "optional": true, "os": [ "darwin" @@ -473,7 +501,8 @@ "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true }, "node_modules/get-port": { "version": "3.2.0", @@ -512,15 +541,11 @@ "node": ">= 6" } }, - "node_modules/graceful-fs": { - "version": "4.2.6", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", - "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==" - }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, "dependencies": { "function-bind": "^1.1.1" }, @@ -569,6 +594,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", + "dev": true, "dependencies": { "has": "^1.0.3" } @@ -664,14 +690,6 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, - "node_modules/jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, "node_modules/kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -712,17 +730,6 @@ "node": ">=6" } }, - "node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/magic-string": { "version": "0.25.7", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", @@ -732,20 +739,6 @@ "sourcemap-codec": "^1.4.4" } }, - "node_modules/make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dependencies": { - "semver": "^6.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -753,9 +746,9 @@ "dev": true }, "node_modules/mime": { - "version": "2.4.7", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.7.tgz", - "integrity": "sha512-dhNd1uA2u397uQk3Nv5LM4lm93WYDUXFn3Fu291FJerns4jyTudqhIWe4W04YLy7Uk1tm1Ore04NpjRvQp/NPA==", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.5.2.tgz", + "integrity": "sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg==", "bin": { "mime": "cli.js" }, @@ -767,6 +760,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dev": true, "engines": { "node": ">=4" } @@ -826,47 +820,6 @@ "integrity": "sha512-k41FwbcLnlgnFh69f4qdUfvDQ+5vaSDnVPFI/y5XuhKRq97EnVVneO9F1ESVCdiVu4fCS2L8usX3mU331hB7pg==", "dev": true }, - "node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "engines": { - "node": ">=6" - } - }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "engines": { - "node": ">=8" - } - }, "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -879,27 +832,18 @@ "node_modules/path-parse": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true }, "node_modules/picomatch": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true, "engines": { "node": ">=8.6" } }, - "node_modules/pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dependencies": { - "find-up": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -931,6 +875,7 @@ "version": "1.20.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "dev": true, "dependencies": { "is-core-module": "^2.2.0", "path-parse": "^1.0.6" @@ -940,9 +885,10 @@ } }, "node_modules/rollup": { - "version": "2.35.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.35.1.tgz", - "integrity": "sha512-q5KxEyWpprAIcainhVy6HfRttD9kutQpHbeqDTWnqAFNJotiojetK6uqmcydNMymBEtC4I8bCYR+J3mTMqeaUA==", + "version": "2.45.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.45.2.tgz", + "integrity": "sha512-kRRU7wXzFHUzBIv0GfoFFIN3m9oteY4uAsKllIpQDId5cfnkWF2J130l+27dzDju0E6MScKiV0ZM5Bw8m4blYQ==", + "dev": true, "bin": { "rollup": "dist/bin/rollup" }, @@ -950,7 +896,7 @@ "node": ">=10.0.0" }, "optionalDependencies": { - "fsevents": "~2.1.2" + "fsevents": "~2.3.1" } }, "node_modules/rollup-plugin-css-only": { @@ -991,9 +937,9 @@ } }, "node_modules/rollup-plugin-svelte": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-svelte/-/rollup-plugin-svelte-7.0.0.tgz", - "integrity": "sha512-cw4yv/5v1NQV3nPbpOJtikgkB+9mfSJaqKUdq7x5fVQJnwLtcdc2JOszBs5pBY+SemTs5pmJbdEMseEavbUtjQ==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-svelte/-/rollup-plugin-svelte-7.1.0.tgz", + "integrity": "sha512-vopCUq3G+25sKjwF5VilIbiY6KCuMNHP1PFvx2Vr3REBNMDllKHFZN2B9jwwC+MqNc3UPKkjXnceLPEjTjXGXg==", "dev": true, "dependencies": { "require-relative": "^0.8.7", @@ -1001,6 +947,10 @@ }, "engines": { "node": ">=10" + }, + "peerDependencies": { + "rollup": ">=2.0.0", + "svelte": ">=3.5.0" } }, "node_modules/rollup-plugin-terser": { @@ -1015,37 +965,6 @@ "terser": "^5.0.0" } }, - "node_modules/rollup-plugin-typescript2": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.30.0.tgz", - "integrity": "sha512-NUFszIQyhgDdhRS9ya/VEmsnpTe+GERDMmFo0Y+kf8ds51Xy57nPNGglJY+W6x1vcouA7Au7nsTgsLFj2I0PxQ==", - "dependencies": { - "@rollup/pluginutils": "^4.1.0", - "find-cache-dir": "^3.3.1", - "fs-extra": "8.1.0", - "resolve": "1.20.0", - "tslib": "2.1.0" - }, - "peerDependencies": { - "rollup": ">=1.26.3", - "typescript": ">=2.4.0" - } - }, - "node_modules/rollup-plugin-typescript2/node_modules/@rollup/pluginutils": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.1.0.tgz", - "integrity": "sha512-TrBhfJkFxA+ER+ew2U2/fHbebhLT/l/2pRk0hfj9KusXUuRXd2v0R58AfaZK9VXDQ4TogOSEmICVrQAA3zFnHQ==", - "dependencies": { - "estree-walker": "^2.0.1", - "picomatch": "^2.2.2" - }, - "engines": { - "node": ">= 8.0.0" - }, - "peerDependencies": { - "rollup": "^1.20.0||^2.0.0" - } - }, "node_modules/rollup-pluginutils": { "version": "2.8.2", "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", @@ -1061,6 +980,20 @@ "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", "dev": true }, + "node_modules/rollup/node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/sade": { "version": "1.7.4", "resolved": "https://registry.npmjs.org/sade/-/sade-1.7.4.tgz", @@ -1086,14 +1019,6 @@ "node": ">=6" } }, - "node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/serialize-javascript": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", @@ -1104,9 +1029,9 @@ } }, "node_modules/sirv": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/sirv/-/sirv-1.0.10.tgz", - "integrity": "sha512-H5EZCoZaggEUQy8ocKsF7WAToGuZhjJlLvM3XOef46CbdIgbNeQ1p32N1PCuCjkVYwrAVOSMacN6CXXgIzuspg==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/sirv/-/sirv-1.0.11.tgz", + "integrity": "sha512-SR36i3/LSWja7AJNRBz4fF/Xjpn7lQFI30tZ434dIy+bitLYSP+ZEenHg36i23V2SGEz+kqjksg0uOGZ5LPiqg==", "dependencies": { "@polka/url": "^1.0.0-next.9", "mime": "^2.3.1", @@ -1117,9 +1042,9 @@ } }, "node_modules/sirv-cli": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/sirv-cli/-/sirv-cli-1.0.10.tgz", - "integrity": "sha512-8mLTRkvzpZXMyUZJ1whf84YHN/mm2r2+j5sU1ZYr5n2jA8VkFItNPk53oysOo+0QxBVp9aUjggkAsQp1d7L3OQ==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/sirv-cli/-/sirv-cli-1.0.11.tgz", + "integrity": "sha512-L8NILoRSBd38VcfFcERYCaVCnWPBLo9G6u/a37UJ8Ysv4DfjizMbFBcM+SswNnndJienhR6qy8KFuAEaeL4g8Q==", "dependencies": { "console-clear": "^1.1.0", "get-port": "^3.2.0", @@ -1127,7 +1052,7 @@ "local-access": "^1.0.1", "sade": "^1.6.0", "semiver": "^1.0.0", - "sirv": "^1.0.10", + "sirv": "^1.0.11", "tinydate": "^1.0.0" }, "bin": { @@ -1175,6 +1100,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dev": true, "dependencies": { "min-indent": "^1.0.0" }, @@ -1195,9 +1121,10 @@ } }, "node_modules/svelte": { - "version": "3.31.0", - "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.31.0.tgz", - "integrity": "sha512-r+n8UJkDqoQm1b+3tA3Lh6mHXKpcfOSOuEuIo5gE2W9wQYi64RYX/qE6CZBDDsP/H4M+N426JwY7XGH4xASvGQ==", + "version": "3.37.0", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.37.0.tgz", + "integrity": "sha512-TRF30F4W4+d+Jr2KzUUL1j8Mrpns/WM/WacxYlo5MMb2E5Qy2Pk1Guj6GylxsW9OnKQl1tnF8q3hG/hQ3h6VUA==", + "dev": true, "engines": { "node": ">= 8" } @@ -1208,9 +1135,10 @@ "integrity": "sha512-PN1H8AWDh+OwhwjJKTv4/zXvKvmvOEVSCVhIhji6Onx8XEw+CGf8BDR0BVUIp87IEX+DEqIo9pbyhgz8EoYZyA==" }, "node_modules/svelte-preprocess": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/svelte-preprocess/-/svelte-preprocess-4.7.0.tgz", - "integrity": "sha512-iNrY4YGqi0LD2e6oT9YbdSzOKntxk8gmzfqso1z/lUJOZh4o6fyIqkirmiZ8/dDJFqtIE1spVgDFWgkfhLEYlw==", + "version": "4.7.2", + "resolved": "https://registry.npmjs.org/svelte-preprocess/-/svelte-preprocess-4.7.2.tgz", + "integrity": "sha512-EToG+08rEsA33btv+C5g2qnRArwpTc5AoU0QBB3ZEkYagxAb2yPNsy0qsmtvbJOTBMy6o3oyijDdl3DMpMvpEg==", + "dev": true, "hasInstallScript": true, "dependencies": { "@types/pug": "^2.0.4", @@ -1324,6 +1252,7 @@ "version": "4.2.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", + "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -1332,14 +1261,6 @@ "node": ">=4.2.0" } }, - "node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "engines": { - "node": ">= 4.0.0" - } - }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -1383,6 +1304,61 @@ "js-tokens": "^4.0.0" } }, + "@ctx-core/array": { + "version": "20.2.10", + "resolved": "https://registry.npmjs.org/@ctx-core/array/-/array-20.2.10.tgz", + "integrity": "sha512-/YqpFwZ0f9Yh1KLm78rrVbbeq+F7LQu91P4IB3+G3/9Leg70FA+MMkSIKcvj2jDNGnmjPGQBGUiYSDeLfyff7g==", + "dev": true, + "requires": { + "@ctx-core/combinators": "^6.0.10", + "@ctx-core/function": "^17.4.7", + "@ctx-core/object": "^17.5.8", + "@ctx-core/set": "^9.0.18" + } + }, + "@ctx-core/combinators": { + "version": "6.0.10", + "resolved": "https://registry.npmjs.org/@ctx-core/combinators/-/combinators-6.0.10.tgz", + "integrity": "sha512-l16FC/IsyfTOffJkRq5kZSgfnjNa8Wz7m0HpyGQu6//fcePpOvFL+HuQvXgnsMREF6DiayW03QXdStk1kCDBjw==", + "dev": true + }, + "@ctx-core/function": { + "version": "17.4.7", + "resolved": "https://registry.npmjs.org/@ctx-core/function/-/function-17.4.7.tgz", + "integrity": "sha512-ZDASKCKnyp5/TSejfetvibyuvjdt6Dhe/JbPcvF2Hm7p+EHhTSPdNyE3EdaTZarWs63AoBllJAxsTgdhL+vs9g==", + "dev": true + }, + "@ctx-core/object": { + "version": "17.5.8", + "resolved": "https://registry.npmjs.org/@ctx-core/object/-/object-17.5.8.tgz", + "integrity": "sha512-gvzwD6835tlm4+dAha///sEKlLJYm95SNCul8mQP8bBJlGA17RVIhApF9k/U7HW7Zn4L3XcFHH9PHdik0KGB1A==", + "dev": true, + "requires": { + "@ctx-core/function": "^17.4.7" + } + }, + "@ctx-core/set": { + "version": "9.0.18", + "resolved": "https://registry.npmjs.org/@ctx-core/set/-/set-9.0.18.tgz", + "integrity": "sha512-RPT1HCPrBR/sGyisv1QN3Bc7/XbTTCKHVvpSvkR9OthPB1AHIyDpUx/vEjnJqojZ0Q0sr3GltuqQl0XAkUhO5g==", + "dev": true, + "requires": { + "@ctx-core/function": "^17.4.7" + } + }, + "@ctx-core/store": { + "version": "24.2.3", + "resolved": "https://registry.npmjs.org/@ctx-core/store/-/store-24.2.3.tgz", + "integrity": "sha512-1m+VM2wKOSfhPxdQIlkzCrlnAxkJRpBvIhqtAVgsbJIHQWn/qoSbWwuXTk9OqQVWvsTiwfPoMb9euLn/5kceTQ==", + "dev": true, + "requires": { + "@ctx-core/array": "^20.2.10", + "@ctx-core/combinators": "^6.0.10", + "@ctx-core/function": "^17.4.7", + "@ctx-core/object": "^17.5.8", + "svelte": "3.37.0" + } + }, "@holochain/conductor-api": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/@holochain/conductor-api/-/conductor-api-0.0.1.tgz", @@ -1411,9 +1387,9 @@ } }, "@polka/url": { - "version": "1.0.0-next.11", - "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.11.tgz", - "integrity": "sha512-3NsZsJIA/22P3QUyrEDNA2D133H4j224twJrdipXN38dpnIOzAbUDtOwkcJ5pXmn75w7LSQDjA4tO9dm1XlqlA==" + "version": "1.0.0-next.12", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.12.tgz", + "integrity": "sha512-6RglhutqrGFMO1MNUXp95RBuYIuc8wTnMAV5MUhLmjTOy78ncwOw7RgeQ/HeymkKXRhZd0s2DNrM1rL7unk3MQ==" }, "@rollup/plugin-commonjs": { "version": "16.0.0", @@ -1445,9 +1421,9 @@ } }, "@rollup/plugin-replace": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-2.3.4.tgz", - "integrity": "sha512-waBhMzyAtjCL1GwZes2jaE9MjuQ/DQF2BatH3fRivUF3z0JBFrU0U6iBNC/4WR+2rLKhaAhPWDNPYp4mI6RqdQ==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-2.4.2.tgz", + "integrity": "sha512-IGcu+cydlUMZ5En85jxHH4qj2hta/11BHq95iHEyb2sbgiN0eCdzvUcHw5gt9pBL5lTi4JDYJ1acCoMGpTvEZg==", "dev": true, "requires": { "@rollup/pluginutils": "^3.1.0", @@ -1458,6 +1434,7 @@ "version": "8.2.1", "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-8.2.1.tgz", "integrity": "sha512-Qd2E1pleDR4bwyFxqbjt4eJf+wB0UKVMLc7/BAFDGVdAXQMCsD4DUv5/7/ww47BZCYxWtJqe1Lo0KVNswBJlRw==", + "dev": true, "requires": { "@rollup/pluginutils": "^3.1.0", "resolve": "^1.17.0" @@ -1467,6 +1444,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", + "dev": true, "requires": { "@types/estree": "0.0.39", "estree-walker": "^1.0.1", @@ -1476,14 +1454,16 @@ "estree-walker": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", - "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==" + "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", + "dev": true } } }, "@types/estree": { "version": "0.0.39", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", - "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==" + "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", + "dev": true }, "@types/node": { "version": "14.14.16", @@ -1493,7 +1473,8 @@ "@types/pug": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@types/pug/-/pug-2.0.4.tgz", - "integrity": "sha1-h3L80EGOPNLMFxVV1zAHQVBR9LI=" + "integrity": "sha1-h3L80EGOPNLMFxVV1zAHQVBR9LI=", + "dev": true }, "@types/resolve": { "version": "1.17.1", @@ -1508,6 +1489,7 @@ "version": "1.16.0", "resolved": "https://registry.npmjs.org/@types/sass/-/sass-1.16.0.tgz", "integrity": "sha512-2XZovu4NwcqmtZtsBR5XYLw18T8cBCnU2USFHTnYLLHz9fkhnoEMoDsqShJIOFsFhn5aJHjweiUUdTrDGujegA==", + "dev": true, "requires": { "@types/node": "*" } @@ -1639,7 +1621,8 @@ "commondir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=" + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true }, "concat-map": { "version": "0.0.1", @@ -1661,7 +1644,8 @@ "detect-indent": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.0.0.tgz", - "integrity": "sha512-oSyFlqaTHCItVRGK5RmrmjB+CmaMOW7IaNA/kdxqhoa6d17j/5ce9O9eWXmV/KEdRwqpQA+Vqe8a8Bsybu4YnA==" + "integrity": "sha512-oSyFlqaTHCItVRGK5RmrmjB+CmaMOW7IaNA/kdxqhoa6d17j/5ce9O9eWXmV/KEdRwqpQA+Vqe8a8Bsybu4YnA==", + "dev": true }, "escape-string-regexp": { "version": "1.0.5", @@ -1672,7 +1656,8 @@ "estree-walker": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true }, "fill-range": { "version": "7.0.1", @@ -1683,35 +1668,6 @@ "to-regex-range": "^5.0.1" } }, - "find-cache-dir": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", - "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==", - "requires": { - "commondir": "^1.0.1", - "make-dir": "^3.0.2", - "pkg-dir": "^4.1.0" - } - }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -1722,12 +1678,14 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "dev": true, "optional": true }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true }, "get-port": { "version": "3.2.0", @@ -1757,15 +1715,11 @@ "is-glob": "^4.0.1" } }, - "graceful-fs": { - "version": "4.2.6", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", - "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==" - }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, "requires": { "function-bind": "^1.1.1" } @@ -1805,6 +1759,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", + "dev": true, "requires": { "has": "^1.0.3" } @@ -1884,14 +1839,6 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "requires": { - "graceful-fs": "^4.1.6" - } - }, "kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -1920,14 +1867,6 @@ "resolved": "https://registry.npmjs.org/local-access/-/local-access-1.1.0.tgz", "integrity": "sha512-XfegD5pyTAfb+GY6chk283Ox5z8WexG56OvM06RWLpAc/UHozO8X6xAxEkIitZOtsSMM1Yr3DkHgW5W+onLhCw==" }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "requires": { - "p-locate": "^4.1.0" - } - }, "magic-string": { "version": "0.25.7", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", @@ -1937,14 +1876,6 @@ "sourcemap-codec": "^1.4.4" } }, - "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "requires": { - "semver": "^6.0.0" - } - }, "merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -1952,14 +1883,15 @@ "dev": true }, "mime": { - "version": "2.4.7", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.7.tgz", - "integrity": "sha512-dhNd1uA2u397uQk3Nv5LM4lm93WYDUXFn3Fu291FJerns4jyTudqhIWe4W04YLy7Uk1tm1Ore04NpjRvQp/NPA==" + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.5.2.tgz", + "integrity": "sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg==" }, "min-indent": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", - "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==" + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dev": true }, "minimatch": { "version": "3.0.4", @@ -2001,32 +1933,6 @@ "integrity": "sha512-k41FwbcLnlgnFh69f4qdUfvDQ+5vaSDnVPFI/y5XuhKRq97EnVVneO9F1ESVCdiVu4fCS2L8usX3mU331hB7pg==", "dev": true }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "requires": { - "p-limit": "^2.2.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" - }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -2036,20 +1942,14 @@ "path-parse": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true }, "picomatch": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==" - }, - "pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "requires": { - "find-up": "^4.0.0" - } + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true }, "randombytes": { "version": "2.1.0", @@ -2079,17 +1979,28 @@ "version": "1.20.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "dev": true, "requires": { "is-core-module": "^2.2.0", "path-parse": "^1.0.6" } }, "rollup": { - "version": "2.35.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.35.1.tgz", - "integrity": "sha512-q5KxEyWpprAIcainhVy6HfRttD9kutQpHbeqDTWnqAFNJotiojetK6uqmcydNMymBEtC4I8bCYR+J3mTMqeaUA==", + "version": "2.45.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.45.2.tgz", + "integrity": "sha512-kRRU7wXzFHUzBIv0GfoFFIN3m9oteY4uAsKllIpQDId5cfnkWF2J130l+27dzDju0E6MScKiV0ZM5Bw8m4blYQ==", + "dev": true, "requires": { - "fsevents": "~2.1.2" + "fsevents": "~2.3.1" + }, + "dependencies": { + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "optional": true + } } }, "rollup-plugin-css-only": { @@ -2123,9 +2034,9 @@ } }, "rollup-plugin-svelte": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-svelte/-/rollup-plugin-svelte-7.0.0.tgz", - "integrity": "sha512-cw4yv/5v1NQV3nPbpOJtikgkB+9mfSJaqKUdq7x5fVQJnwLtcdc2JOszBs5pBY+SemTs5pmJbdEMseEavbUtjQ==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-svelte/-/rollup-plugin-svelte-7.1.0.tgz", + "integrity": "sha512-vopCUq3G+25sKjwF5VilIbiY6KCuMNHP1PFvx2Vr3REBNMDllKHFZN2B9jwwC+MqNc3UPKkjXnceLPEjTjXGXg==", "dev": true, "requires": { "require-relative": "^0.8.7", @@ -2144,29 +2055,6 @@ "terser": "^5.0.0" } }, - "rollup-plugin-typescript2": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.30.0.tgz", - "integrity": "sha512-NUFszIQyhgDdhRS9ya/VEmsnpTe+GERDMmFo0Y+kf8ds51Xy57nPNGglJY+W6x1vcouA7Au7nsTgsLFj2I0PxQ==", - "requires": { - "@rollup/pluginutils": "^4.1.0", - "find-cache-dir": "^3.3.1", - "fs-extra": "8.1.0", - "resolve": "1.20.0", - "tslib": "2.1.0" - }, - "dependencies": { - "@rollup/pluginutils": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.1.0.tgz", - "integrity": "sha512-TrBhfJkFxA+ER+ew2U2/fHbebhLT/l/2pRk0hfj9KusXUuRXd2v0R58AfaZK9VXDQ4TogOSEmICVrQAA3zFnHQ==", - "requires": { - "estree-walker": "^2.0.1", - "picomatch": "^2.2.2" - } - } - } - }, "rollup-pluginutils": { "version": "2.8.2", "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", @@ -2203,11 +2091,6 @@ "resolved": "https://registry.npmjs.org/semiver/-/semiver-1.1.0.tgz", "integrity": "sha512-QNI2ChmuioGC1/xjyYwyZYADILWyW6AmS1UH6gDj/SFUUUS4MBAWs/7mxnkRPc/F4iHezDP+O8t0dO8WHiEOdg==" }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" - }, "serialize-javascript": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", @@ -2218,9 +2101,9 @@ } }, "sirv": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/sirv/-/sirv-1.0.10.tgz", - "integrity": "sha512-H5EZCoZaggEUQy8ocKsF7WAToGuZhjJlLvM3XOef46CbdIgbNeQ1p32N1PCuCjkVYwrAVOSMacN6CXXgIzuspg==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/sirv/-/sirv-1.0.11.tgz", + "integrity": "sha512-SR36i3/LSWja7AJNRBz4fF/Xjpn7lQFI30tZ434dIy+bitLYSP+ZEenHg36i23V2SGEz+kqjksg0uOGZ5LPiqg==", "requires": { "@polka/url": "^1.0.0-next.9", "mime": "^2.3.1", @@ -2228,9 +2111,9 @@ } }, "sirv-cli": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/sirv-cli/-/sirv-cli-1.0.10.tgz", - "integrity": "sha512-8mLTRkvzpZXMyUZJ1whf84YHN/mm2r2+j5sU1ZYr5n2jA8VkFItNPk53oysOo+0QxBVp9aUjggkAsQp1d7L3OQ==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/sirv-cli/-/sirv-cli-1.0.11.tgz", + "integrity": "sha512-L8NILoRSBd38VcfFcERYCaVCnWPBLo9G6u/a37UJ8Ysv4DfjizMbFBcM+SswNnndJienhR6qy8KFuAEaeL4g8Q==", "requires": { "console-clear": "^1.1.0", "get-port": "^3.2.0", @@ -2238,7 +2121,7 @@ "local-access": "^1.0.1", "sade": "^1.6.0", "semiver": "^1.0.0", - "sirv": "^1.0.10", + "sirv": "^1.0.11", "tinydate": "^1.0.0" } }, @@ -2276,6 +2159,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dev": true, "requires": { "min-indent": "^1.0.0" } @@ -2290,9 +2174,10 @@ } }, "svelte": { - "version": "3.31.0", - "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.31.0.tgz", - "integrity": "sha512-r+n8UJkDqoQm1b+3tA3Lh6mHXKpcfOSOuEuIo5gE2W9wQYi64RYX/qE6CZBDDsP/H4M+N426JwY7XGH4xASvGQ==" + "version": "3.37.0", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.37.0.tgz", + "integrity": "sha512-TRF30F4W4+d+Jr2KzUUL1j8Mrpns/WM/WacxYlo5MMb2E5Qy2Pk1Guj6GylxsW9OnKQl1tnF8q3hG/hQ3h6VUA==", + "dev": true }, "svelte-fa": { "version": "2.2.0", @@ -2300,9 +2185,10 @@ "integrity": "sha512-PN1H8AWDh+OwhwjJKTv4/zXvKvmvOEVSCVhIhji6Onx8XEw+CGf8BDR0BVUIp87IEX+DEqIo9pbyhgz8EoYZyA==" }, "svelte-preprocess": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/svelte-preprocess/-/svelte-preprocess-4.7.0.tgz", - "integrity": "sha512-iNrY4YGqi0LD2e6oT9YbdSzOKntxk8gmzfqso1z/lUJOZh4o6fyIqkirmiZ8/dDJFqtIE1spVgDFWgkfhLEYlw==", + "version": "4.7.2", + "resolved": "https://registry.npmjs.org/svelte-preprocess/-/svelte-preprocess-4.7.2.tgz", + "integrity": "sha512-EToG+08rEsA33btv+C5g2qnRArwpTc5AoU0QBB3ZEkYagxAb2yPNsy0qsmtvbJOTBMy6o3oyijDdl3DMpMvpEg==", + "dev": true, "requires": { "@types/pug": "^2.0.4", "@types/sass": "^1.16.0", @@ -2348,12 +2234,8 @@ "typescript": { "version": "4.2.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", - "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==" - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" + "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", + "dev": true }, "wrappy": { "version": "1.0.2", diff --git a/ui/package.json b/ui/package.json index cd526dbd..b9f1dc25 100644 --- a/ui/package.json +++ b/ui/package.json @@ -1,28 +1,30 @@ { - "name": "svelte-app", + "name": "@holochain/syn-ui", "version": "1.0.0", "scripts": { "build": "rollup -c", "dev": "rollup -c -w", "start": "sirv public" }, + "dependencies": { + "@holochain/conductor-api": "0.0.1", + "sirv-cli": "^1.0.11", + "svelte-fa": "^2.2.0" + }, "devDependencies": { + "@ctx-core/object": "^17.5.8", + "@ctx-core/store": "^24.2.3", "@rollup/plugin-commonjs": "^16.0.0", "@rollup/plugin-node-resolve": "^10.0.0", - "@rollup/plugin-replace": "^2.3.4", - "rollup": "^2.3.4", + "@rollup/plugin-replace": "^2.4.2", + "@rollup/plugin-typescript": "^8.2.1", + "rollup": "^2.45.2", "rollup-plugin-css-only": "^3.1.0", "rollup-plugin-livereload": "^2.0.0", - "rollup-plugin-svelte": "^7.0.0", - "rollup-plugin-terser": "^7.0.0", - "svelte": "^3.0.0" - }, - "dependencies": { - "@holochain/conductor-api": "0.0.1", - "@rollup/plugin-typescript": "^8.2.1", - "sirv-cli": "^1.0.0", - "svelte-fa": "^2.2.0", - "svelte-preprocess": "^4.7.0", + "rollup-plugin-svelte": "^7.1.0", + "rollup-plugin-terser": "^7.0.2", + "svelte": "^3.37.0", + "svelte-preprocess": "^4.7.2", "typescript": "^4.2.4" } } diff --git a/ui/rollup.config.js b/ui/rollup.config.js index c9d904de..024397b5 100644 --- a/ui/rollup.config.js +++ b/ui/rollup.config.js @@ -43,7 +43,6 @@ export default { replace({ 'process.env.NODE_ENV': JSON.stringify(process.env.NODE) }), - typescript(), svelte({ compilerOptions: { // enable run-time checks when not in production @@ -70,6 +69,7 @@ export default { browser: true, dedupe: ['svelte'] }), + typescript(), commonjs(), // In dev mode, call `npm run start` once diff --git a/ui/src/App.svelte b/ui/src/App.svelte index eecfe1c7..6c58b213 100644 --- a/ui/src/App.svelte +++ b/ui/src/App.svelte @@ -1,14 +1,17 @@ \n{#if $connection && $connection.syn}\n {#if scribe}\n
\n
\n
\n {pubKeyStr.slice(-4)}\n
\n
\n
\n {:else}\n
\n
\n {pubKeyStr.slice(-4)}\n
\n {/if}\n{/if}\n","\n\n
\n {#if $connection && $connection.syn && $connection.syn.me}\n \n {/if}\n {#each Object.keys($folks) as p}\n \n {/each}\n
\n",null,null,null,null,null,null,null,"\n\n\n {editor_content1}{editor_content2}\n\n","\n\n\n
\n Title:\n {#if editingTitle}\n \n {:else}\n
{titleHover=true}} on:mouseleave={()=>{titleHover=false}} on:click={beginEditTitle}>\n \n {#if untitled}\n Untitled Document\n {:else}\n {$content.title}\n {/if}\n \n
\n {/if}\n
\n","\n\n\n\n
\n

Holochain Connection:

\n App Port: \n AppId: \n \n
\n\n
\n Sessions:\n {#if sessions}\n {#each sessions as session}\n \n Id: {bufferToBase64(session).slice(-4)}\n \n {/each}\n {/if}\n
\n","\n\n
\n
    \n
  • \n {#if $connection && $connection.syn}\n Connected to Dna: {$connection.syn.Dna}\n {:else}\n No connection\n {/if}\n
  • lastCommitedContentHash: {$session ? $session.contentHashStr : ''}\n
  • session: {JSON.stringify($session)}\n
  • nextIndex: {$nextIndex}\n
  • scribe: {$scribeStr}\n
\n
\n","\n\n
\n {text}\n
\n","\n\n\n
\n History:\n
\n {#each historyEntries as historyEntry}\n \n {/each}\n
\n
\n","\n\n\n\n\n \n\n\n
\n

SynText

\n
\n syn.requestChange(event.detail)}/>\n</div>\n</div>\n<main>\n<div class:noscribe>\n <Editor on:requestChange={(event) => syn.requestChange(event.detail)}/>\n</div>\n\n\n<Syn applyDeltaFn={applyDelta} undoFn={undo} bind:this={syn}/>\n</main>\n\n<div class='folks-tray'>\n <Folks/>\n</div>\n\n<div class='tab' class:shown={tabShown} class:drawer-hidden={drawerHidden} on:mouseenter={showTab}\n on:mouseleave={hideTab}>\n <div class='tab-inner' class:shown={tabShown} on:click={drawerHidden ? showDrawer() : hideDrawer()}>\n <i class:drawer-hidden={drawerHidden} class=\"tab-icon fas {drawerHidden ? 'fa-chevron-up' : 'fa-chevron-down'}\"></i>\n </div>\n</div>\n<div class='debug-drawer' bind:this={resizeable} use:initResizeable on:mouseenter={showTab} on:mouseleave={hideTab}\n class:hidden={drawerHidden}>\n <div class='handle' bind:this={resizeHandle} on:mousedown={startDragging}></div>\n <div class='debug-content'>\n <History changeToTextFn={changeToText}/>\n <Debug/>\n </div>\n</div>\n",null],"names":["global","this","require$$0","require$$1","common_2","common_1","client_1","require$$2","require$$3","require$$4","derived","in_get","in_derived","_b","Syn","AppWebsocket"],"mappings":";;;;;IAAA,SAAS,IAAI,GAAG,GAAG;IAWnB,SAAS,YAAY,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;IACzD,IAAI,OAAO,CAAC,aAAa,GAAG;IAC5B,QAAQ,GAAG,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;IACzC,KAAK,CAAC;IACN,CAAC;IACD,SAAS,GAAG,CAAC,EAAE,EAAE;IACjB,I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e,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAE,OAAO,GAAG,SAAS,CAAC,KAAK,GAAI,oBAAoB,EAAE,aAAa,GAAG,aAAa;;;MAEtG,MAAM,CAAC,gBAAgB,CAAC,aAAa,EAAE,gBAAgB;;;SAGpE,YAAY,GAAG,KAAK;;WAClB,UAAU;sBACd,YAAY,GAAG,IAAI;;;WAEf,UAAU;sBACd,YAAY,GAAG,KAAK;;;SAGlB,QAAQ,GAAG,KAAK;;WACd,OAAO;sBACX,QAAQ,GAAG,IAAI;;;WAEX,OAAO;sBACX,QAAQ,GAAG,KAAK;;;;;;;;;mCA4JU,KAAK,IAAK,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM;qCAKzC,KAAK,IAAK,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM;;;;OAIb,GAAG;;;;;;;OAe1B,YAAY;;;;;;;OAFR,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAxO1C,QAAQ,GAAG,UAAU,KAAK,EAAE;;;;KA5E5B,YAAY,GAAG,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UCZnB,GAAG,GAAG,IAAI,GAAG,CAAC;QACnB,MAAM,EAAE,QAAQ,CAAC,IAAI;QACrB,KAAK,EAAE,EACN;KACD;;;;;;;;"} \ No newline at end of file diff --git a/ui/public/favicon.png b/ui/apps/app/public/favicon.png similarity index 100% rename from ui/public/favicon.png rename to ui/apps/app/public/favicon.png diff --git a/ui/public/global.css b/ui/apps/app/public/global.css similarity index 100% rename from ui/public/global.css rename to ui/apps/app/public/global.css diff --git a/ui/public/index.html b/ui/apps/app/public/index.html similarity index 100% rename from ui/public/index.html rename to ui/apps/app/public/index.html diff --git a/ui/rollup.config.js b/ui/apps/app/rollup.config.js similarity index 100% rename from ui/rollup.config.js rename to ui/apps/app/rollup.config.js diff --git a/ui/scripts/setupTypeScript.js b/ui/apps/app/scripts/setupTypeScript.js similarity index 100% rename from ui/scripts/setupTypeScript.js rename to ui/apps/app/scripts/setupTypeScript.js diff --git a/ui/src/App.svelte b/ui/apps/app/src/App.svelte similarity index 94% rename from ui/src/App.svelte rename to ui/apps/app/src/App.svelte index 6c58b213..010df576 100644 --- a/ui/src/App.svelte +++ b/ui/apps/app/src/App.svelte @@ -6,19 +6,19 @@ import Syn from './Syn.svelte' import Debug from './Debug.svelte' import History from './History.svelte' - import { scribeStr_b } from './scribe' - import type { AddDelta, applyDelta_ret_T, DeleteDelta, Delta, MetaDelta, TitleDelta } from './delta' + import { scribe_str_b } from './scribe' + import type { AddDelta, apply_delta_ret_T, DeleteDelta, Delta, MetaDelta, TitleDelta } from './delta' import type { Content } from './content' let ctx = {} setContext('ctx', ctx) - const scribeStr = scribeStr_b(ctx) + const scribe_str = scribe_str_b(ctx) $: disconnected = false // definition of how to apply a delta to the content // if the delta is destructive also returns what was // destroyed for use by undo - function applyDelta(content:Content, in_delta:Delta):applyDelta_ret_T { + function applyDelta(content:Content, in_delta:Delta):apply_delta_ret_T { switch (in_delta.type) { case 'Title': { const deleted = content.title @@ -89,7 +89,7 @@ return `${delta.type}:\n${detail}` } - $: noscribe = $scribeStr === '' + $: noscribe = $scribe_str === '' let syn // The debug drawer's ability to resized and hidden @@ -299,12 +299,12 @@ <div class='toolbar'> <h1>SynText</h1> <div class:noscribe> - <Title on:requestChange={(event) => syn.requestChange(event.detail)}/> + <Title on:request_change={(event) => syn.request_change(event.detail)}/> </div> </div> <main> <div class:noscribe> - <Editor on:requestChange={(event) => syn.requestChange(event.detail)}/> + <Editor on:request_change={(event) => syn.request_change(event.detail)}/> </div> diff --git a/ui/src/Debug.svelte b/ui/apps/app/src/Debug.svelte similarity index 67% rename from ui/src/Debug.svelte rename to ui/apps/app/src/Debug.svelte index e1737d40..3a51da68 100644 --- a/ui/src/Debug.svelte +++ b/ui/apps/app/src/Debug.svelte @@ -1,13 +1,13 @@ <script lang="ts"> import { getContext } from 'svelte' - import { nextIndex_b } from './delta' - import { connection_b } from './connection' + import { next_index_b } from './delta' + import { connection_b } from './zome' import { session_b } from './session' - import { scribeStr_b } from './scribe' + import { scribe_str_b } from './scribe' const ctx = getContext('ctx') - const scribeStr = scribeStr_b(ctx) + const scribe_str = scribe_str_b(ctx) const connection = connection_b(ctx) - const nextIndex = nextIndex_b(ctx) + const next_index = next_index_b(ctx) const session = session_b(ctx) </script> <style> @@ -25,7 +25,7 @@ ul { {/if} <li>lastCommitedContentHash: {$session ? $session.contentHashStr : ''} <li>session: {JSON.stringify($session)} - <li>nextIndex: {$nextIndex} - <li>scribe: {$scribeStr} + <li>next_index: {$next_index} + <li>scribe: {$scribe_str} </ul> </div> diff --git a/ui/src/Editor.svelte b/ui/apps/app/src/Editor.svelte similarity index 79% rename from ui/src/Editor.svelte rename to ui/apps/app/src/Editor.svelte index e2fb5dc5..ed2315b9 100644 --- a/ui/src/Editor.svelte +++ b/ui/apps/app/src/Editor.svelte @@ -1,6 +1,6 @@ <script lang="ts"> import { createEventDispatcher, getContext } from 'svelte' - import { connection_b } from './connection' + import { connection_b } from './zome' import { content_b } from './content' import { session_b } from './session' import { CSSifyHSL } from './colors' @@ -17,23 +17,23 @@ } let editor - $: myTag = $session ? $session.myTag : '' - $: editor_content1 = $content.body.slice(0, getLoc(myTag)) - $: editor_content2 = $content.body.slice(getLoc(myTag)) + $: my_tag = $session ? $session.my_tag : '' + $: editor_content1 = $content.body.slice(0, getLoc(my_tag)) + $: editor_content2 = $content.body.slice(getLoc(my_tag)) function addText(text) { - const loc = getLoc(myTag) + const loc = getLoc(my_tag) const deltas:Delta[] = [{type:'Add', value:[loc, text]}] for (const [tag, tagLoc] of Object.entries($content.meta)) { if (tagLoc >= loc) { deltas.push({type:'Meta', value: {setLoc: [tag,tagLoc+text.length] }}) } } - dispatch('requestChange', deltas) + dispatch('request_change', deltas) } function handleInput(event) { - const loc = getLoc(myTag) + const loc = getLoc(my_tag) const key = event.key if (key.length == 1) { addText(key) @@ -41,15 +41,15 @@ switch (key) { case 'ArrowRight': if (loc < $content.body.length) { - dispatch('requestChange', [ - {type:'Meta', value:{setLoc: [myTag, loc+1]}} + dispatch('request_change', [ + {type:'Meta', value:{setLoc: [my_tag, loc+1]}} ]) } break case 'ArrowLeft': if (loc > 0){ - dispatch('requestChange', [ - {type:'Meta', value:{setLoc: [myTag, loc-1]}} + dispatch('request_change', [ + {type:'Meta', value:{setLoc: [my_tag, loc-1]}} ]) } break @@ -64,7 +64,7 @@ deltas.push({type:'Meta', value: {setLoc: [tag,tagLoc-1] }}) } } - dispatch('requestChange', deltas) + dispatch('request_change', deltas) } } } @@ -76,9 +76,9 @@ if (window.getSelection().focusNode.parentElement == editor.lastChild) { loc += editor_content1.length } - if (loc != getLoc(myTag)) { - dispatch('requestChange', [ - {type:'Meta', value:{setLoc: [myTag, loc]}} + if (loc != getLoc(my_tag)) { + dispatch('request_change', [ + {type:'Meta', value:{setLoc: [my_tag, loc]}} ]) } } @@ -87,8 +87,8 @@ $: { // wait for cursor and connection and color inside connection to exist // before updating the cursor color - if (cursor && $connection && $connection.syn && $connection.syn.myColors) { - cursor.style['border-color'] = CSSifyHSL($connection.syn.myColors.primary) + if (cursor && $connection && $connection.syn && $connection.syn.my_colors) { + cursor.style['border-color'] = CSSifyHSL($connection.syn.my_colors.primary) } } diff --git a/ui/src/folk/Folk.svelte b/ui/apps/app/src/Folk.svelte similarity index 91% rename from ui/src/folk/Folk.svelte rename to ui/apps/app/src/Folk.svelte index 1cb94099..4e9dceed 100644 --- a/ui/src/folk/Folk.svelte +++ b/ui/apps/app/src/Folk.svelte @@ -1,26 +1,24 @@ <script lang="ts"> import { getContext } from 'svelte' - import { connection_b } from '../connection' - import { folks_b } from './folks_b' - import { CSSifyHSL } from '../colors' - import { scribeStr_b } from '../scribe' + import { connection_b } from '@syn-ui/zome-client' + import { folks_b, scribe_str_b } from '@syn-ui/model' const ctx = getContext('ctx') const connection = connection_b(ctx) const folks = folks_b(ctx) - const scribeStr = scribeStr_b(ctx) + const scribe_str = scribe_str_b(ctx) export let pubKeyStr = '' export let me = false let scribe - $: scribe = pubKeyStr == $scribeStr + $: scribe = pubKeyStr == $scribe_str let outOfSession $: outOfSession = (!$folks[pubKeyStr] || !$folks[pubKeyStr].inSession) && !me function setUpHex(hexEl) { let colors if (me) { - colors = $connection.syn.myColors + colors = $connection.syn.my_colors } else { colors = $folks[pubKeyStr].colors } diff --git a/ui/src/folk/Folks.svelte b/ui/apps/app/src/Folks.svelte similarity index 87% rename from ui/src/folk/Folks.svelte rename to ui/apps/app/src/Folks.svelte index f381332f..c524acaf 100644 --- a/ui/src/folk/Folks.svelte +++ b/ui/apps/app/src/Folks.svelte @@ -1,6 +1,6 @@ <script lang="ts"> - import { connection_b } from '../connection' - import { folks_b } from './folks_b' + import { folks_b } from '@syn-ui/model' + import { connection_b } from '@syn-ui/zome-client' import Folk from './Folk.svelte' import { getContext } from 'svelte' const ctx = getContext('ctx') diff --git a/ui/src/History.svelte b/ui/apps/app/src/History.svelte similarity index 76% rename from ui/src/History.svelte rename to ui/apps/app/src/History.svelte index 1df88b05..47e072e7 100644 --- a/ui/src/History.svelte +++ b/ui/apps/app/src/History.svelte @@ -1,11 +1,11 @@ <script lang="ts"> import { afterUpdate, getContext } from 'svelte' - import { requestedChanges_b, recordedChanges_b, committedChanges_b } from './delta' + import { requested_changes_b, recorded_changes_b, committed_changes_b } from './delta' import HistoryEntry from './HistoryEntry.svelte' const ctx = getContext('ctx') - const requestedChanges = requestedChanges_b(ctx) - const recordedChanges = recordedChanges_b(ctx) - const committedChanges = committedChanges_b(ctx) + const requested_changes = requested_changes_b(ctx) + const recorded_changes = recorded_changes_b(ctx) + const committed_changes = committed_changes_b(ctx) export let changeToTextFn @@ -24,9 +24,9 @@ let recordedH let committedH let historyEntries = [] - $: {requestedH = changesToEntriesList($requestedChanges, 'requested')} - $: {recordedH = changesToEntriesList($recordedChanges, 'recorded')} - $: {committedH = changesToEntriesList($committedChanges, 'committed')} + $: {requestedH = changesToEntriesList($requested_changes, 'requested')} + $: {recordedH = changesToEntriesList($recorded_changes, 'recorded')} + $: {committedH = changesToEntriesList($committed_changes, 'committed')} $: {historyEntries = [...requestedH, ...recordedH, ...committedH]} // when updating the list, also scroll to the newest historyEntry diff --git a/ui/src/HistoryEntry.svelte b/ui/apps/app/src/HistoryEntry.svelte similarity index 100% rename from ui/src/HistoryEntry.svelte rename to ui/apps/app/src/HistoryEntry.svelte diff --git a/ui/src/Syn.svelte b/ui/apps/app/src/Syn.svelte similarity index 62% rename from ui/src/Syn.svelte rename to ui/apps/app/src/Syn.svelte index f1d09bf1..fd090ab3 100644 --- a/ui/src/Syn.svelte +++ b/ui/apps/app/src/Syn.svelte @@ -1,13 +1,14 @@ <script lang="ts"> import { createEventDispatcher, getContext } from 'svelte' import { bufferToBase64 } from './utils' - import { connection_b, Connection } from './connection' - import { scribeStr_b } from './scribe' + import { connection_b, Connection } from './zome' + import { scribe_str_b } from './scribe' + import { session_b } from './session' const ctx = getContext('ctx') const connection = connection_b(ctx) - const scribeStr = scribeStr_b(ctx) + const scribe_str = scribe_str_b(ctx) - let session + const session = session_b(ctx) // this properties are the app-defined functions to apply and undo changes export let applyDeltaFn, undoFn @@ -15,8 +16,8 @@ // this is the list of sessions returned by the DNA let sessions - export function requestChange(deltas) { - $session.requestChange(deltas) + export function request_change(deltas) { + $session.request_change(deltas) } // ----------------------------------------------------------------------- @@ -24,17 +25,19 @@ const dispatch = createEventDispatcher() let adminPort=1234 - let appPort=8888 - let appId='syn' + let app_port=8888 + let app_id='syn' async function toggle() { - if (!$connection) { - $connection = new Connection(ctx, appPort, appId) - await $connection.open({title:'', body:''}, applyDeltaFn) - - session = $connection.syn.session - - console.log('joining session...') - await $connection.joinSession() + if (!$session) { + // if (!$connection) { + $session = await join_session({ app_port, app_id, ctx }) + // $connection = new Connection(ctx, app_port, app_id) + // await $connection.open({title:'', body:''}, applyDeltaFn) + // + // session = $connection.syn.session + // + // console.log('joining session...') + // await $connection.joinSession() sessions = $connection.sessions } else { @@ -44,11 +47,11 @@ } } - async function commitChange() { - $session.commitChange() + async function commit_change() { + $session.commit_change() } - $: noscribe = $scribeStr === '' + $: noscribe = $scribe_str === '' </script> <style> :global(.noscribe) { @@ -80,12 +83,12 @@ cursor: pointer; } </style> -<button class:noscribe on:click={commitChange}>Commit</button> +<button class:noscribe on:click={commit_change}>Commit</button> <div> <h4>Holochain Connection:</h4> - App Port: <input bind:value={appPort}> - AppId: <input bind:value={appId}> + App Port: <input bind:value={app_port}> + AppId: <input bind:value={app_id}> <button on:click={toggle}> {#if $connection} Disconnect diff --git a/ui/src/Title.svelte b/ui/apps/app/src/Title.svelte similarity index 98% rename from ui/src/Title.svelte rename to ui/apps/app/src/Title.svelte index bda9bbe7..bea7ad53 100644 --- a/ui/src/Title.svelte +++ b/ui/apps/app/src/Title.svelte @@ -14,7 +14,7 @@ // than the current title if (titleBeingTyped !== $content.title) { let delta = { type: 'Title', value: titleBeingTyped } - dispatch('requestChange', [delta]) + dispatch('request_change', [delta]) } titleBeingTyped = '' editingTitle = false diff --git a/ui/apps/app/tsconfig.json b/ui/apps/app/tsconfig.json new file mode 100644 index 00000000..4082f16a --- /dev/null +++ b/ui/apps/app/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../tsconfig.json" +} diff --git a/ui/apps/headless/README.md b/ui/apps/headless/README.md new file mode 100644 index 00000000..d87757fe --- /dev/null +++ b/ui/apps/headless/README.md @@ -0,0 +1,3 @@ +# Holochain Syn Headless App + +TODO: Implement diff --git a/ui/apps/headless/package.json b/ui/apps/headless/package.json new file mode 100644 index 00000000..2e7c5f35 --- /dev/null +++ b/ui/apps/headless/package.json @@ -0,0 +1,31 @@ +{ + "name": "@syn-ui/headless", + "version": "1.0.0", + "scripts": { + "build": "rollup -c", + "dev": "rollup -c -w", + "start": "sirv public" + }, + "dependencies": { + "@ctx-core/combinators": "^6.0.10", + "@holochain/conductor-api": "0.0.3", + "sirv-cli": "^1.0.11", + "svelte-fa": "^2.2.0" + }, + "devDependencies": { + "@ctx-core/object": "^17.5.9", + "@ctx-core/store": "^24.3.1", + "@rollup/plugin-commonjs": "^18.0.0", + "@rollup/plugin-node-resolve": "^11.2.1", + "@rollup/plugin-replace": "^2.4.2", + "@rollup/plugin-typescript": "^8.2.1", + "rollup": "^2.45.2", + "rollup-plugin-css-only": "^3.1.0", + "rollup-plugin-livereload": "^2.0.0", + "rollup-plugin-svelte": "^7.1.0", + "rollup-plugin-terser": "^7.0.2", + "svelte": "^3.37.0", + "svelte-preprocess": "^4.7.2", + "typescript": "^4.2.4" + } +} \ No newline at end of file diff --git a/ui/apps/headless/src/index.ts b/ui/apps/headless/src/index.ts new file mode 100644 index 00000000..e69de29b diff --git a/ui/apps/headless/tsconfig.json b/ui/apps/headless/tsconfig.json new file mode 100644 index 00000000..4082f16a --- /dev/null +++ b/ui/apps/headless/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../tsconfig.json" +} diff --git a/ui/src/Signal.ts b/ui/libs/Signal.ts similarity index 100% rename from ui/src/Signal.ts rename to ui/libs/Signal.ts diff --git a/ui/src/main.ts b/ui/libs/main.ts similarity index 100% rename from ui/src/main.ts rename to ui/libs/main.ts diff --git a/ui/libs/model/README.md b/ui/libs/model/README.md new file mode 100644 index 00000000..410269ba --- /dev/null +++ b/ui/libs/model/README.md @@ -0,0 +1 @@ +# @syn-ui/model diff --git a/ui/libs/model/package.json b/ui/libs/model/package.json new file mode 100644 index 00000000..9a5e0682 --- /dev/null +++ b/ui/libs/model/package.json @@ -0,0 +1,18 @@ +{ + "name": "@syn-ui/model", + "version": "1.0.0", + "main": "./src/index.ts", + "module": "./src/index.ts", + "types": "./src/index.ts", + "scripts": {}, + "devDependencies": { + "@ctx-core/combinators": "^6.0.10", + "@ctx-core/object": "^17.5.9", + "@ctx-core/store": "^24.3.1", + "@holochain/conductor-api": "0.0.3", + "@syn-ui/utils": "workspace:^1.0.0", + "@syn-ui/zome-client": "workspace:^1.0.0", + "svelte": "^3.37.0", + "typescript": "^4.2.4" + } +} \ No newline at end of file diff --git a/ui/libs/model/src/colors/CSSifyHSL.ts b/ui/libs/model/src/colors/CSSifyHSL.ts new file mode 100644 index 00000000..0e7b6352 --- /dev/null +++ b/ui/libs/model/src/colors/CSSifyHSL.ts @@ -0,0 +1,5 @@ +import type { HSL } from './HSL' +export function CSSifyHSL(hslArray:HSL) { + const [h, s, l] = hslArray + return `hsl(${h} ${s}% ${l}%)` +} diff --git a/ui/libs/model/src/colors/arrayBufferToHex.ts b/ui/libs/model/src/colors/arrayBufferToHex.ts new file mode 100644 index 00000000..e93674f2 --- /dev/null +++ b/ui/libs/model/src/colors/arrayBufferToHex.ts @@ -0,0 +1,9 @@ +import type { HoloHash } from '@holochain/conductor-api' +// returns binary input as hex number string (e.g. 'a293b8e1a') +export function arrayBufferToHex(buffer:HoloHash) { + let hexString = '' + for (const byte of buffer) { + hexString += byte.toString(16) + } + return hexString +} diff --git a/ui/libs/model/src/colors/clamp.ts b/ui/libs/model/src/colors/clamp.ts new file mode 100644 index 00000000..57b7be27 --- /dev/null +++ b/ui/libs/model/src/colors/clamp.ts @@ -0,0 +1,4 @@ +// Source: https://stackoverflow.com/questions/5842747 +export function clamp(value, min, max) { + return Math.min(Math.max(value, min), max) +} diff --git a/ui/src/colors.ts b/ui/libs/model/src/colors/getFolkColors.ts similarity index 54% rename from ui/src/colors.ts rename to ui/libs/model/src/colors/getFolkColors.ts index 336427c5..7441bed5 100644 --- a/ui/src/colors.ts +++ b/ui/libs/model/src/colors/getFolkColors.ts @@ -1,43 +1,8 @@ import type { HoloHash } from '@holochain/conductor-api' -// retruns binary input as hex number string (e.g. 'a293b8e1a') -function arrayBufferToHex(buffer:HoloHash) { - let hexString = '' - for (const byte of buffer) { - hexString += byte.toString(16) - } - return hexString -} - -// converts RGB to HSL -// Source: https://gist.github.com/mjackson/5311256 -function rgbToHsl(r:number, g:number, b:number) { - r /= 255, g /= 255, b /= 255 - let max = Math.max(r, g, b), min = Math.min(r, g, b) - let h, s, l = (max + min) / 2 - if (max == min) { h = s = 0} else { - let d = max - min - s = l > 0.5 ? d / (2 - max - min) : d / (max + min) - switch (max) { - case r: - h = (g - b) / d + (g < b ? 6 : 0) - break - case g: - h = (b - r) / d + 2 - break - case b: - h = (r - g) / d + 4 - break - } - h /= 6 - } - return [h * 360, s * 100, l * 100] -} - -// Source: https://stackoverflow.com/questions/5842747 -function clamp(value, min, max) { - return Math.min(Math.max(value, min), max) -} - +import type { FolkColors } from './FolkColors' +import { arrayBufferToHex } from './arrayBufferToHex' +import { rgbToHsl } from './rgbToHsl' +import { clamp } from './clamp' // Generate an object of colors for a folk from their pubKey // returns Object: // primary: Color, // used for hex outline and norrmal cursor @@ -68,17 +33,3 @@ export function getFolkColors(pubKey:HoloHash):FolkColors { lookingCursor: [h, s + 10, 40], } } - -export type HSL = [number, number, number] -export interface FolkColors { - primary:HSL - hexagon:HSL - selection:HSL - lookingSelection:HSL - lookingCursor:HSL -} - -export function CSSifyHSL(hslArray:HSL) { - const [h, s, l] = hslArray - return `hsl(${h} ${s}% ${l}%)` -} diff --git a/ui/libs/model/src/colors/index.ts b/ui/libs/model/src/colors/index.ts new file mode 100644 index 00000000..db415b8d --- /dev/null +++ b/ui/libs/model/src/colors/index.ts @@ -0,0 +1,8 @@ +export * from './arrayBufferToHex' +export * from './clamp' +export * from './CSSifyHSL' +export * from './FolkColors' +export * from './getFolkColors' +export * from './HSL' +export * from './my_colors_b' +export * from './rgbToHsl' diff --git a/ui/libs/model/src/colors/my_colors_b.ts b/ui/libs/model/src/colors/my_colors_b.ts new file mode 100644 index 00000000..064eb7e6 --- /dev/null +++ b/ui/libs/model/src/colors/my_colors_b.ts @@ -0,0 +1,10 @@ +import { _b } from '@ctx-core/object' +import { derived$ } from '@ctx-core/store' +import { agent_pub_key_b } from '@syn-ui/zome-client' +import { getFolkColors } from './getFolkColors' +export const my_colors_b = _b('my_colors', (ctx)=>{ + const agent_pub_key = agent_pub_key_b(ctx) + return derived$(agent_pub_key, $agent_pub_key=> + $agent_pub_key ? getFolkColors($agent_pub_key) : null + ) +}) diff --git a/ui/libs/model/src/colors/rgbToHsl.ts b/ui/libs/model/src/colors/rgbToHsl.ts new file mode 100644 index 00000000..56235daf --- /dev/null +++ b/ui/libs/model/src/colors/rgbToHsl.ts @@ -0,0 +1,24 @@ +// converts RGB to HSL +// Source: https://gist.github.com/mjackson/5311256 +export function rgbToHsl(r:number, g:number, b:number) { + r /= 255, g /= 255, b /= 255 + let max = Math.max(r, g, b), min = Math.min(r, g, b) + let h, s, l = (max + min) / 2 + if (max == min) { h = s = 0} else { + let d = max - min + s = l > 0.5 ? d / (2 - max - min) : d / (max + min) + switch (max) { + case r: + h = (g - b) / d + (g < b ? 6 : 0) + break + case g: + h = (b - r) / d + 2 + break + case b: + h = (r - g) / d + 4 + break + } + h /= 6 + } + return [h * 360, s * 100, l * 100] +} diff --git a/ui/libs/model/src/content/content_b.ts b/ui/libs/model/src/content/content_b.ts new file mode 100644 index 00000000..94849ccb --- /dev/null +++ b/ui/libs/model/src/content/content_b.ts @@ -0,0 +1,6 @@ +import { _b } from '@ctx-core/object' +import { writable$ } from '@ctx-core/store' +import type { Content } from '@syn-ui/zome-client' +export const content_b = _b('content', ()=>{ + return writable$<Content>({ title: '', body: '' }) +}) diff --git a/ui/src/content/index.ts b/ui/libs/model/src/content/index.ts similarity index 100% rename from ui/src/content/index.ts rename to ui/libs/model/src/content/index.ts diff --git a/ui/libs/model/src/delta/ApplyDelta.ts b/ui/libs/model/src/delta/ApplyDelta.ts new file mode 100644 index 00000000..482a97bf --- /dev/null +++ b/ui/libs/model/src/delta/ApplyDelta.ts @@ -0,0 +1,10 @@ +import type { Content, Delta } from '@syn-ui/zome-client' +export interface ApplyDelta { + delta:Delta + deleted?:ApplyDelta_deleted_T + id?:string + at?:number +} +export type ApplyDelta_deleted_T = string|[string, number] +export type apply_delta_ret_T = [Content, ApplyDelta] +export type apply_delta_fn_T = (content:Content, delta:Delta)=>apply_delta_ret_T diff --git a/ui/libs/model/src/delta/StateForSync.ts b/ui/libs/model/src/delta/StateForSync.ts new file mode 100644 index 00000000..7af6d6c1 --- /dev/null +++ b/ui/libs/model/src/delta/StateForSync.ts @@ -0,0 +1,14 @@ +import type { HoloHash } from '@holochain/conductor-api' +import type { DeltaValue } from '@syn-ui/zome-client' +export interface StateForSync { + snapshot:HoloHash, + commit:HoloHash, + commit_content_hash:HoloHash + deltas:DeltaValue[], +} +export interface SerializedStateForSync { + snapshot:HoloHash, + commit:HoloHash, + commit_content_hash:HoloHash + deltas:string[], +} diff --git a/ui/libs/model/src/delta/_scribe_signal_folk_pubKey_a1_b.ts b/ui/libs/model/src/delta/_scribe_signal_folk_pubKey_a1_b.ts new file mode 100644 index 00000000..42c7314f --- /dev/null +++ b/ui/libs/model/src/delta/_scribe_signal_folk_pubKey_a1_b.ts @@ -0,0 +1,8 @@ +import { _b } from '@ctx-core/object' +import { folks_b } from '../session' +export const _scribe_signal_folk_pubKey_a1_b = _b('_scribe_signal_folk_pubKey_a1', (ctx) => { + const folks = folks_b(ctx) + return function _scribe_signal_folk_pubKey_a1() { + return Object.values(folks.$).filter(v=>v.inSession).map(v=>v.pubKey) + } +}) diff --git a/ui/libs/model/src/delta/apply_delta_fn_b.ts b/ui/libs/model/src/delta/apply_delta_fn_b.ts new file mode 100644 index 00000000..0edd791f --- /dev/null +++ b/ui/libs/model/src/delta/apply_delta_fn_b.ts @@ -0,0 +1,6 @@ +import { _b } from '@ctx-core/object' +import { writable$ } from '@ctx-core/store' +import type { apply_delta_fn_T } from './ApplyDelta' +export const apply_delta_fn_b = _b('apply_delta_fn', ()=> + writable$<apply_delta_fn_T>(null) +) diff --git a/ui/libs/model/src/delta/committed_changes_b.ts b/ui/libs/model/src/delta/committed_changes_b.ts new file mode 100644 index 00000000..a81509cf --- /dev/null +++ b/ui/libs/model/src/delta/committed_changes_b.ts @@ -0,0 +1,10 @@ +import { _b } from '@ctx-core/object' +import { writable, Writable } from '@ctx-core/store' +import type { ApplyDelta } from './ApplyDelta' +export const committed_changes_b = _b('committed_changes', ()=>{ + return writable<ApplyDelta[]>([]) as committed_changes_T +}) +export type $committed_changes_T = ApplyDelta[] +export interface committed_changes_T extends Writable<$committed_changes_T> { + push(...changes:ApplyDelta[]):void +} diff --git a/ui/libs/model/src/delta/index.ts b/ui/libs/model/src/delta/index.ts new file mode 100644 index 00000000..9dbae377 --- /dev/null +++ b/ui/libs/model/src/delta/index.ts @@ -0,0 +1,12 @@ +export * from './ApplyDelta' +export * from './apply_delta_fn_b' +export * from './committed_changes_b' +export * from './next_index_b' +export * from './record_delta_b' +export * from './recorded_changes_b' +export * from './request_change_b' +export * from './requested_changes_b' +export * from './run_apply_delta_b' +export * from './_scribe_signal_folk_pubKey_a1_b' +export * from './send_change_b' +export * from './StateForSync' diff --git a/ui/libs/model/src/delta/next_index_b.ts b/ui/libs/model/src/delta/next_index_b.ts new file mode 100644 index 00000000..7d5b84b0 --- /dev/null +++ b/ui/libs/model/src/delta/next_index_b.ts @@ -0,0 +1,10 @@ +import { derived$ } from '@ctx-core/store' +import { _b } from '@ctx-core/object' +import { recorded_changes_b } from './recorded_changes_b' +export const next_index_b = _b('next_index', (ctx)=>{ + const recorded_changes = recorded_changes_b(ctx) + return derived$( + recorded_changes, + $recorded_changes=>$recorded_changes.length + ) +}) diff --git a/ui/libs/model/src/delta/record_delta_b.ts b/ui/libs/model/src/delta/record_delta_b.ts new file mode 100644 index 00000000..b04453f2 --- /dev/null +++ b/ui/libs/model/src/delta/record_delta_b.ts @@ -0,0 +1,14 @@ +import type { Delta } from '@syn-ui/zome-client' +import { _b } from '@ctx-core/object' +import { run_apply_delta_b } from './run_apply_delta_b' +import { recorded_changes_b } from './recorded_changes_b' +export const record_delta_b = _b('record_delta', (ctx)=>{ + const run_apply_delta = run_apply_delta_b(ctx) + const recorded_changes = recorded_changes_b(ctx) + return function record_delta(delta:Delta) { + // apply the deltas to the content which returns the undoable change + const undoable_change = run_apply_delta(delta) + // append changes to the recorded history + recorded_changes.push(undoable_change) + } +}) diff --git a/ui/libs/model/src/delta/recorded_changes_b.ts b/ui/libs/model/src/delta/recorded_changes_b.ts new file mode 100644 index 00000000..7cb69363 --- /dev/null +++ b/ui/libs/model/src/delta/recorded_changes_b.ts @@ -0,0 +1,20 @@ +import { _b } from '@ctx-core/object' +import { Writable$, writable$ } from '@ctx-core/store' +import type { ApplyDelta } from './ApplyDelta' +export const recorded_changes_b = _b('recorded_changes', ()=> + new recorded_changes_T() +) +export type $recorded_changes_T = ApplyDelta[] +export class recorded_changes_T implements Writable$<$recorded_changes_T> { + #store = writable$<$recorded_changes_T>([]) + set = this.#store.set + subscribe = this.#store.subscribe + update = this.#store.update + $ = this.#store.$ + push = (...apply_delta_a1:ApplyDelta[])=>{ + const $store = this.#store.$ + $store.push(...apply_delta_a1) + this.#store.set($store) + return $store + } +} diff --git a/ui/libs/model/src/delta/request_change_b.ts b/ui/libs/model/src/delta/request_change_b.ts new file mode 100644 index 00000000..47d1c4f2 --- /dev/null +++ b/ui/libs/model/src/delta/request_change_b.ts @@ -0,0 +1,51 @@ +import { _b } from '@ctx-core/object' +import { Delta, my_tag_b, rpc_send_change_request_b } from '@syn-ui/zome-client' +import { am_i_scribe_b } from '../session/am_i_scribe_b' +import { scribe_b } from '../session' +import { next_index_b } from './next_index_b' +import { record_delta_b } from './record_delta_b' +import { send_change_b } from './send_change_b' +import { requested_changes_b } from './requested_changes_b' +import { run_apply_delta_b } from './run_apply_delta_b' +export const request_change_b = _b('request_change', (ctx)=>{ + const record_delta = record_delta_b(ctx) + const request_changes = requested_changes_b(ctx) + let request_counter = 0 + return async function request_change(deltas:Delta[]) { + // any requested made by the scribe should be recorded immediately + if (am_i_scribe_b(ctx).$ === true) { + const $next_index = next_index_b(ctx).$ + for (const delta of deltas) { + record_delta(delta) + } + await send_change_b(ctx)({ index: $next_index, deltas }) + } else { + // otherwise apply the change and queue it to requested changes for + // confirmation later and send request change to scribe + + // create a unique id for each change + // TODO: this should be part of actual changeReqs + const change_id = my_tag_b(ctx).$ + '.' + request_counter + const change_at = Date.now() + + const $requested_changes = request_changes.$ + // we want to apply this to current next_index plus any previously + // requested changes that haven't yet be recorded + const index = next_index_b(ctx).$ + $requested_changes.length + for (const delta of deltas) { + const undoable_change = run_apply_delta_b(ctx)(delta) + undoable_change.id = change_id + undoable_change.at = change_at + // append changes to the requested queue + // request_changes.push + $requested_changes.push(undoable_change) + } + request_changes.$ = $requested_changes + console.log('REQUESTED', $requested_changes) + await rpc_send_change_request_b(ctx)({ + index, deltas, scribe: scribe_b(ctx).$ + }) + request_counter += 1 + } + } +}) diff --git a/ui/libs/model/src/delta/requested_changes_b.ts b/ui/libs/model/src/delta/requested_changes_b.ts new file mode 100644 index 00000000..3102b263 --- /dev/null +++ b/ui/libs/model/src/delta/requested_changes_b.ts @@ -0,0 +1,6 @@ +import { _b } from '@ctx-core/object' +import { writable$ } from '@ctx-core/store' +import type { ApplyDelta } from './ApplyDelta' +export const requested_changes_b = _b('requested_changes', ()=>{ + return writable$<ApplyDelta[]>([]) +}) diff --git a/ui/libs/model/src/delta/run_apply_delta_b.ts b/ui/libs/model/src/delta/run_apply_delta_b.ts new file mode 100644 index 00000000..d30c2983 --- /dev/null +++ b/ui/libs/model/src/delta/run_apply_delta_b.ts @@ -0,0 +1,14 @@ +import type { Delta } from '@syn-ui/zome-client' +import { _b } from '@ctx-core/object' +import { content_b } from '../content' +import { apply_delta_fn_b } from './apply_delta_fn_b' +import type { ApplyDelta } from './ApplyDelta' +export const run_apply_delta_b = _b('run_apply_delta', (ctx)=>{ + const content = content_b(ctx) + const apply_delta_fn = apply_delta_fn_b(ctx) + return function run_apply_delta(delta:Delta):ApplyDelta { + const [$content, undoable_change] = apply_delta_fn.$(content.$, delta) + content.set($content) + return undoable_change + } +}) diff --git a/ui/libs/model/src/delta/send_change_b.ts b/ui/libs/model/src/delta/send_change_b.ts new file mode 100644 index 00000000..98c85d1e --- /dev/null +++ b/ui/libs/model/src/delta/send_change_b.ts @@ -0,0 +1,18 @@ +import { _b } from '@ctx-core/object' +import type { Delta } from '@syn-ui/zome-client' +import { _scribe_signal_folk_pubKey_a1_b } from './_scribe_signal_folk_pubKey_a1_b' +import { rpc_send_change_b } from '@syn-ui/zome-client' +export const send_change_b = _b('send_change', (ctx)=>{ + const _scribe_signal_folk_pubKey_a1 = _scribe_signal_folk_pubKey_a1_b(ctx) + const rpc_send_change = rpc_send_change_b(ctx) + return async function send_change({ index, deltas }:send_change_params_I) { + const participants = _scribe_signal_folk_pubKey_a1() + return rpc_send_change({ + index, deltas, participants + }) + } +}) +export interface send_change_params_I { + index:number + deltas:Delta[] +} diff --git a/ui/libs/model/src/index.ts b/ui/libs/model/src/index.ts new file mode 100644 index 00000000..de8c36de --- /dev/null +++ b/ui/libs/model/src/index.ts @@ -0,0 +1,5 @@ +export * from './colors' +export * from './content' +export * from './delta' +export * from './folk' +export * from './session' diff --git a/ui/libs/model/src/session/ChangeReq_ops_b.ts b/ui/libs/model/src/session/ChangeReq_ops_b.ts new file mode 100644 index 00000000..b7eb0cd7 --- /dev/null +++ b/ui/libs/model/src/session/ChangeReq_ops_b.ts @@ -0,0 +1,39 @@ +import { _b } from '@ctx-core/object' +import type { Delta } from '@syn-ui/zome-client' +import { am_i_scribe_b } from './am_i_scribe_b' +import { next_index_b, send_change_b } from '../delta' +import { record_deltas_b } from './record_deltas_b' +import type { Ops } from './Ops' +export const ChangeReq_ops_b = _b<Ops>('ChangeReq_ops', (ctx)=>{ + const am_i_scribe = am_i_scribe_b(ctx) + const next_index = next_index_b(ctx) + const send_change = send_change_b(ctx) + return { + ChangeReq: async (signal)=>{ + const [index, serialized_deltas]:[number, string[]] = signal.data.payload.signal_payload + const deltas:Delta[] = serialized_deltas.map(d=>JSON.parse(d)) + const change:[number, Delta[]] = [index, deltas] + if (am_i_scribe.$ === true) { + let [index, deltas] = change + const $next_index = next_index.$ + if ($next_index != index) { + console.log('Scribe is receiving change out of order!') + console.log(`next_index: ${$next_index}, changeIndex:${index} for deltas:`, deltas) + if (index < $next_index) { + // change is too late, $next_index has moved on + // TODO: rebase? notify sender? + return + } else { + // change is in the future, possibly some other change was dropped or is slow in arriving + // TODO: wait a bit? Ask sender for other changes? + return + } + } + record_deltas_b(ctx)(index, deltas) + // notify all participants of the change + await send_change({ index, deltas }) + } + // connection.session.changeReq([index, deltas]) + } + } +}) diff --git a/ui/libs/model/src/session/Change_ops_b.ts b/ui/libs/model/src/session/Change_ops_b.ts new file mode 100644 index 00000000..9f28b235 --- /dev/null +++ b/ui/libs/model/src/session/Change_ops_b.ts @@ -0,0 +1,27 @@ +import type { AppSignal } from '@holochain/conductor-api' +import { _b } from '@ctx-core/object' +import { next_index_b } from '../delta' +import { am_i_scribe_b } from './am_i_scribe_b' +import { record_deltas_b } from './record_deltas_b' +import type { Ops } from './Ops' +export const Change_ops_b = _b('Change_ops', (ctx)=>{ + const next_index = next_index_b(ctx) + return { + Change: async (signal:AppSignal)=>{ + const [index, serialized_deltas] = signal.data.payload.signal_payload + const deltas = serialized_deltas.map(d=>JSON.parse(d)) + if (am_i_scribe_b(ctx).$ === true) { + console.log('change received but I\'m the scribe, so I\'m ignoring this!') + } else { + console.log(`change arrived for ${index}:`, deltas) + const $next_index = next_index.$ + if ($next_index === index) { + record_deltas_b(ctx)(index, deltas) + } else { + console.log(`change arrived out of sequence next_index: ${$next_index}, change index:${index}`) + // TODO either call for sync, or do some waiting algorithm + } + } + } + } as Ops +}) diff --git a/ui/libs/model/src/session/CommitNotice_ops_b.ts b/ui/libs/model/src/session/CommitNotice_ops_b.ts new file mode 100644 index 00000000..eed78526 --- /dev/null +++ b/ui/libs/model/src/session/CommitNotice_ops_b.ts @@ -0,0 +1,38 @@ +import { _b } from '@ctx-core/object' +import { bufferToBase64, EntryHash, HeaderHash } from '@syn-ui/utils' +import type { Ops } from './Ops' +import { content_hash_str_b } from './content_hash_str_b' +import { next_index_b } from '../delta' +export const CommitNotice_ops_b = _b<Ops>('CommitNotice_ops', (ctx)=>{ + const content_hash_str = content_hash_str_b(ctx) + const next_index = next_index_b(ctx) + return { + CommitNotice: async (signal)=>{ + const commitInfo:CommitInfo = signal.data.payload.signal_payload + // make sure we are at the right place to be able to just move forward with the commit + const $content_hash_str = content_hash_str.$ + if ($content_hash_str == bufferToBase64(commitInfo.previous_content_hash) && + next_index.$ === commitInfo.deltas_committed) { + content_hash_str.$ = bufferToBase64(commitInfo.commit_content_hash) + this.committed = this.committed.concat(this.recorded) + this.recorded = [] + this.committed_changes.set(this.committed) + this.recorded_changes.set(this.recorded) + } else { + console.log('received commit notice for beyond our last commit, gotta resync') + console.log('commit.commit_content_hash:', bufferToBase64(commitInfo.commit_content_hash)) + console.log('commit.previous_content_hash:', bufferToBase64(commitInfo.previous_content_hash)) + console.log('commit.deltas_committed:', commitInfo.deltas_committed) + console.log('my $session.contentHashStr', $content_hash_str) + console.log('my next_index', this.next_index()) + // TODO resync + } + } + } +}) +export interface CommitInfo { + deltas_committed:number + commit_content_hash:EntryHash + previous_content_hash:EntryHash + commit:HeaderHash +} diff --git a/ui/libs/model/src/session/FolkLore_ops_b.ts b/ui/libs/model/src/session/FolkLore_ops_b.ts new file mode 100644 index 00000000..f3d04e6c --- /dev/null +++ b/ui/libs/model/src/session/FolkLore_ops_b.ts @@ -0,0 +1,35 @@ +import { _b } from '@ctx-core/object' +import { decodeJson, FOLK_GONE, FOLK_UNKNOWN } from '@syn-ui/zome-client' +import { am_i_scribe_b } from './am_i_scribe_b' +import { update_folks_b } from './update_folks_b' +import type { Ops } from './Ops' +export const FolkLore_ops_b = _b<Ops>('FolkLore_ops', (ctx)=>{ + const am_i_scribe = am_i_scribe_b(ctx) + const update_folks = update_folks_b(ctx) + return { + FolkLore: async (signal)=>{ + const data = decodeJson(signal.data.payload.signal_payload) + console.log('got folklore', data) + if (am_i_scribe.$) { + console.log('folklore received but I\'m the scribe!') + } else { + if (data.gone) { + Object.values(data.participants).forEach( + pubKey=>{ + update_folks(pubKey, FOLK_GONE) + } + ) + } + // TODO move last seen into p.meta so that we can update that value + // as hearsay. + if (data.participants) { + Object.values(data.participants).forEach( + p=>{ + update_folks(p.pubKey, FOLK_UNKNOWN, p.meta) + } + ) + } + } + } + } +}) diff --git a/ui/libs/model/src/session/Heartbeat_ops_b.ts b/ui/libs/model/src/session/Heartbeat_ops_b.ts new file mode 100644 index 00000000..d76a1b3d --- /dev/null +++ b/ui/libs/model/src/session/Heartbeat_ops_b.ts @@ -0,0 +1,22 @@ +import { _b } from '@ctx-core/object' +import type { Ops } from './Ops' +import { decodeJson, FOLK_SEEN } from '@syn-ui/zome-client' +import { am_i_scribe_b } from './am_i_scribe_b' +import { update_folks_b } from './update_folks_b' +export const Heartbeat_ops_b = _b<Ops>('Heartbeat_ops', (ctx)=>{ + const am_i_scribe = am_i_scribe_b(ctx) + const update_folks = update_folks_b(ctx) + return { + Heartbeat: async (signal)=>{ + let [from, jsonData] = signal.data.payload.signal_payload + const data = decodeJson(jsonData) + console.log('got heartbeat', data, 'from:', from) + if (am_i_scribe.$ === true) { + // I am the scribe and I've recieved a heartbeat from a concerned Folk + update_folks(from, FOLK_SEEN) + } else { + console.log('heartbeat received but I\'m not the scribe.') + } + } + } +}) diff --git a/ui/libs/model/src/session/Ops.ts b/ui/libs/model/src/session/Ops.ts new file mode 100644 index 00000000..40742912 --- /dev/null +++ b/ui/libs/model/src/session/Ops.ts @@ -0,0 +1,3 @@ +import type { AppSignal } from '@holochain/conductor-api' +export type Op = (signal:AppSignal)=>Promise<void> +export interface Ops extends Record<string, Op> {} diff --git a/ui/src/session/Session.ts b/ui/libs/model/src/session/Session.ts similarity index 77% rename from ui/src/session/Session.ts rename to ui/libs/model/src/session/Session.ts index faaab6ad..5f4d7b3a 100644 --- a/ui/src/session/Session.ts +++ b/ui/libs/model/src/session/Session.ts @@ -1,18 +1,18 @@ import type { HoloHash } from '@holochain/conductor-api' import { content_b, Content } from '../content' import { - requestedChanges_b, recordedChanges_b, committedChanges_b, ApplyDelta, applyDelta_T, Delta + requested_changes_b, recorded_changes_b, committed_changes_b, ApplyDelta, apply_delta_fn_T, Delta } from '../delta' import { ApiResponse, bufferToBase64, encodeJson } from '../utils' import { getFolkColors } from '../colors' import { - FOLK_GONE, FOLK_SEEN, FOLK_UNKNOWN, PubKeyToFolkRecord, FolkStatus, folks_b, folks_T, FolkI + FOLK_GONE, FOLK_SEEN, FOLK_UNKNOWN, PubKeyToFolkRecord, FolkStatus, folks_b, folks_T, Folk } from '../folk' -import type { Syn } from '../Syn' import type { Commit } from '../Commit' -import type { Zome } from '../Zome' +import type { Zome } from '@syn-ui/zome-client' +import { scribe_str_b } from '../scribe' import type { SessionInfo } from './SessionInfo' -import { scribeStr_b } from '../scribe' +import type { Syn } from './Syn' // const outOfSessionTimout = 30 * 1000 const outOfSessionTimout = 8 * 1000 // testing code :) @@ -23,10 +23,10 @@ let reqTimeout = 1000 export class Session { zome:Zome - applyDeltaFn:applyDelta_T + applyDeltaFn:apply_delta_fn_T _content:Content me:string - myTag:string + my_tag:string others:PubKeyToFolkRecord folks:folks_T @@ -34,7 +34,7 @@ export class Session { this.zome = syn.zome this.applyDeltaFn = syn.applyDeltaFn this.me = syn.zome.me - this.myTag = syn.zome.me.slice(-4) + this.my_tag = syn.zome.me.slice(-4) const others = {} as PubKeyToFolkRecord this.others = others this.folks = folks_b(ctx) @@ -46,38 +46,38 @@ export class Session { heart:ReturnType<typeof setInterval> requestChecker:ReturnType<typeof setInterval> scribe:HoloHash - _scribeStr:string + _scribe_str:string requested:any[] sessionHash:HoloHash snapshot_content:Content snapshot_hash:HoloHash content_hash:HoloHash - currentCommitHeaderHash:HoloHash + current_commit_header_hash:HoloHash deltas:Delta[] snapshotHashStr:string contentHashStr:string reqCounter:number committed:ApplyDelta[] recorded:ApplyDelta[] - commitInProgress:boolean + commit_in_progress:boolean // set up the svelte based state vars content = content_b(this.ctx) - recordedChanges = recordedChanges_b(this.ctx) - requestedChanges = requestedChanges_b(this.ctx) - committedChanges = committedChanges_b(this.ctx) - scribeStr = scribeStr_b(this.ctx) + recorded_changes = recorded_changes_b(this.ctx) + requested_changes = requested_changes_b(this.ctx) + committed_changes = committed_changes_b(this.ctx) + scribe_str = scribe_str_b(this.ctx) initTimers(syn) { const self = this // Send heartbeat to scribe every [heartbeat interval] this.heart = setInterval(async ()=>{ - if (self._scribeStr == self.me) { + if (self._scribe_str == self.me) { // examine folks last seen time and see if any have crossed the session out-of-session // timeout so we can tell everybody else about them having dropped. let gone = self.updateRecentlyTimedOutFolks() if (gone.length > 0) { - self.sendFolkLore(self.folksForScribeSignals(), { gone }) + self.sendFolkLore(self._scribe_signal_folk_pubKey_a1(), { gone }) } } else { // I'm not the scribe so send them a heartbeat @@ -90,10 +90,10 @@ export class Session { if ((Date.now() - self.requested[0].at) > reqTimeout) { // for now let's just do the most drastic thing! /* - console.log('requested change timed out! Undoing all changes', $requestedChanges[0]) - // TODO: make sure this is transactional and no requestChanges squeak in ! - while ($requestedChanges.length > 0) { - requestedChanges.update(changes => { + console.log('requested change timed out! Undoing all changes', $requested_changes[0]) + // TODO: make sure this is transactional and no request_changes squeak in ! + while ($requested_changes.length > 0) { + requested_changes.update(changes => { const change = changes.pop() console.log('undoing ', change) const undoDelta = undoFn(change) @@ -125,58 +125,58 @@ export class Session { this.deltas = sessionInfo.deltas.map(d=>JSON.parse(d)) this.snapshotHashStr = bufferToBase64(sessionInfo.snapshot_hash) this.contentHashStr = bufferToBase64(sessionInfo.content_hash) - this._scribeStr = bufferToBase64(sessionInfo.scribe) - this.scribeStr.set(this._scribeStr) + this._scribe_str = bufferToBase64(sessionInfo.scribe) + this.scribe_str.set(this._scribe_str) this.recorded = [] this.requested = [] - this.requestedChanges.set(this.requested) - this.recordedChanges.set(this.recorded) - this.committedChanges.set([]) + this.requested_changes.set(this.requested) + this.recorded_changes.set(this.recorded) + this.committed_changes.set([]) this.reqCounter = 0 this.committed = [] let newContent = { ...sessionInfo.snapshot_content } // clone so as not to pass by ref newContent.meta = {} - newContent.meta[this.myTag] = 0 + newContent.meta[this.my_tag] = 0 for (const delta of this.deltas) { const [c, change] = this.applyDeltaFn(newContent, delta) newContent = c this.committed.push(change) } - this.committedChanges.set(this.committed) + this.committed_changes.set(this.committed) this._content = newContent this.content.set(this._content) } - _recordDelta(delta) { + _record_delta(delta) { // apply the deltas to the content which returns the undoable change - const undoableChange = this._runApplyDelta(delta) + const undoableChange = this.run_apply_delta(delta) // append changes to the recorded history this.recorded.push(undoableChange) - this.recordedChanges.set(this.recorded) + this.recorded_changes.set(this.recorded) } - _recordDeltas(deltas) { + _record_deltas(deltas) { // apply the deltas to the content which returns the undoable change for (const delta of deltas) { - this._recordDelta(delta) + this._record_delta(delta) } } // apply changes confirmed as recorded by the scribe while reconciling // and possibly rebasing our requested changes - recordDeltas(_index:number, deltas:Delta[]) { - console.log('recordDeltas REQUESTED', this.requested) + record_deltas(_index:number, deltas:Delta[]) { + console.log('record_deltas REQUESTED', this.requested) for (const delta of deltas) { if (this.requested.length > 0) { // if this change is our next requested change then remove it if (JSON.stringify(delta) == JSON.stringify(this.requested[0].delta)) { this.recorded.push(this.requested.shift()) - this.recordedChanges.set(this.recorded) - this.requestedChanges.set(this.requested) + this.recorded_changes.set(this.recorded) + this.requested_changes.set(this.requested) } else { // TODO rebase? console.log('REBASE NEEDED?') @@ -188,16 +188,16 @@ export class Session { // to check our requested changes // TODO: do we need to check if this is a change that we did send and have already // integrated somehow and ignore if so. (Seems unlikely?) - this._recordDelta(delta) + this._record_delta(delta) } } } - nextIndex() { + next_index() { return this.recorded.length } - _runApplyDelta(delta) { + run_apply_delta(delta) { const [newContent, undoableChange] = this.applyDeltaFn(this._content, delta) this._content = newContent this.content.set(this._content) @@ -207,11 +207,11 @@ export class Session { // called when requesting a change to the content as a result of user action // If we are the scribe, no need to go into the zome // TODO: prevent reentry - requestChange(deltas) { + request_change(deltas) { // any requested made by the scribe should be recorded immediately - if (this._scribeStr == this.me) { - const index = this.nextIndex() - this._recordDeltas(deltas) + if (this._scribe_str == this.me) { + const index = this.next_index() + this._record_deltas(deltas) this.sendChange(index, deltas) } else { // otherwise apply the change and queue it to requested changes for @@ -219,20 +219,20 @@ export class Session { // create a unique id for each change // TODO: this should be part of actual changeReqs - const changeId = this.myTag + '.' + this.reqCounter + const changeId = this.my_tag + '.' + this.reqCounter const changeAt = Date.now() - // we want to apply this to current nextIndex plus any previously + // we want to apply this to current next_index plus any previously // requested changes that haven't yet be recorded - const index = this.nextIndex() + this.requested.length + const index = this.next_index() + this.requested.length for (const delta of deltas) { - const undoableChange = this._runApplyDelta(delta) + const undoableChange = this.run_apply_delta(delta) undoableChange.id = changeId undoableChange.at = changeAt // append changes to the requested queue this.requested.push(undoableChange) - this.requestedChanges.set(this.requested) + this.requested_changes.set(this.requested) } console.log('REQUESTED', this.requested) this.sendChangeReq(index, deltas) @@ -242,13 +242,13 @@ export class Session { addChangeAsScribe(change) { let [index, deltas] = change - const nextIndex = this.nextIndex() - if (nextIndex != index) { + const next_index = this.next_index() + if (next_index != index) { console.log('Scribe is receiving change out of order!') - console.log(`nextIndex: ${nextIndex}, changeIndex:${index} for deltas:`, deltas) + console.log(`next_index: ${next_index}, changeIndex:${index} for deltas:`, deltas) - if (index < nextIndex) { - // change is too late, nextIndex has moved on + if (index < next_index) { + // change is too late, next_index has moved on // TODO: rebase? notify sender? return } else { @@ -258,19 +258,19 @@ export class Session { } } - this.recordDeltas(index, deltas) + this.record_deltas(index, deltas) // notify all participants of the change this.sendChange(index, deltas) } - async commitChange() { - if (this._scribeStr == this.me) { + async commit_change() { + if (this._scribe_str == this.me) { if (this.recorded.length == 0) { alert('No changes to commit!') return } - this.commitInProgress = true + this.commit_in_progress = true const newContentHash = await this.hashContent(this._content) console.log('commiting from snapshot', this.snapshotHashStr) @@ -288,21 +288,21 @@ export class Session { app_specific: null } }, - participants: this.folksForScribeSignals() + participants: this._scribe_signal_folk_pubKey_a1() } try { - this.currentCommitHeaderHash = await this.zome.call('commit', commit) + this.current_commit_header_hash = await this.zome.call('commit', commit) // if commit successfull we need to update the content hash and its string in the session this.content_hash = newContentHash this.contentHashStr = bufferToBase64(this.content_hash) this.committed = this.committed.concat(this.recorded) this.recorded = [] - this.recordedChanges.set(this.recorded) - this.committedChanges.set(this.committed) + this.recorded_changes.set(this.recorded) + this.committed_changes.set(this.committed) } catch (e) { console.log('Error:', e) } - this.commitInProgress = false + this.commit_in_progress = false } else { alert('You ain\'t the scribe!') } @@ -313,11 +313,11 @@ export class Session { _newOther(pubKeyStr:string, pubKey:HoloHash) { if (!(pubKeyStr in this.others)) { const colors = getFolkColors(pubKey) - this.others[pubKeyStr] = { pubKey, colors } as FolkI + this.others[pubKeyStr] = { pubKey, colors } as Folk } } - updateOthers(pubKey:HoloHash, status:FolkStatus, meta?:number) { + update_folks(pubKey:HoloHash, status:FolkStatus, meta?:number) { const pubKeyStr = bufferToBase64(pubKey) if (pubKeyStr == this.me) { return @@ -344,7 +344,7 @@ export class Session { this.folks.set(this.others) } - folksForScribeSignals() { + _scribe_signal_folk_pubKey_a1() { return Object.values(this.others).filter(v=>v.inSession).map(v=>v.pubKey) } @@ -381,7 +381,7 @@ export class Session { } async sendChange(index, deltas) { - const participants = this.folksForScribeSignals() + const participants = this._scribe_signal_folk_pubKey_a1() if (participants.length > 0) { deltas = deltas.map(d=>JSON.stringify(d)) return this.zome.call('send_change', { participants, change: [index, deltas] }) @@ -407,7 +407,7 @@ export class Session { // handler for the changeReq event changeReq(change) { - if (this._scribeStr == this.me) { + if (this._scribe_str == this.me) { this.addChangeAsScribe(change) } else { console.log('change requested but I\'m not the scribe.') @@ -416,14 +416,14 @@ export class Session { // handler for the change event change(index, deltas) { - if (this._scribeStr == this.me) { + if (this._scribe_str == this.me) { console.log('change received but I\'m the scribe, so I\'m ignoring this!') } else { console.log(`change arrived for ${index}:`, deltas) - if (this.nextIndex() == index) { - this.recordDeltas(index, deltas) + if (this.next_index() == index) { + this.record_deltas(index, deltas) } else { - console.log(`change arrived out of sequence nextIndex: ${this.nextIndex()}, change index:${index}`) + console.log(`change arrived out of sequence next_index: ${this.next_index()}, change index:${index}`) // TODO either call for sync, or do some waiting algorithm } } @@ -432,27 +432,27 @@ export class Session { // handler for the syncReq event syncReq(request) { const from = request.from - if (this._scribeStr == this.me) { - this.updateOthers(from, FOLK_SEEN, request.meta) + if (this._scribe_str == this.me) { + this.update_folks(from, FOLK_SEEN, request.meta) let state = { snapshot: this.snapshot_hash, commit_content_hash: this.content_hash, deltas: this.recorded.map(c=>c.delta) } - if (this.currentCommitHeaderHash) { - state['commit'] = this.currentCommitHeaderHash + if (this.current_commit_header_hash) { + state['commit'] = this.current_commit_header_hash } // send a sync response to the sender this.sendSyncResp(from, state) // and send everybody a folk lore p2p message with new participants let p = { ...this.others } p[this.me] = { - pubKey: this.zome.agentPubKey + pubKey: this.zome.agent_pub_key } const data = { participants: p } - this.sendFolkLore(this.folksForScribeSignals(), data) + this.sendFolkLore(this._scribe_signal_folk_pubKey_a1(), data) } else { console.log('syncReq received but I\'m not the scribe!') } @@ -463,7 +463,7 @@ export class Session { // Make sure that we are working off the same snapshot and commit const commitContentHashStr = bufferToBase64(stateForSync.commit_content_hash) if (commitContentHashStr == this.contentHashStr) { - this._recordDeltas(stateForSync.deltas) + this._record_deltas(stateForSync.deltas) } else { console.log('WHOA, sync response has different current state assumptions') // TODO: resync somehow @@ -473,24 +473,24 @@ export class Session { // handler for the heartbeat event heartbeat(from, data) { console.log('got heartbeat', data, 'from:', from) - if (this._scribeStr != this.me) { + if (this._scribe_str != this.me) { console.log('heartbeat received but I\'m not the scribe.') } else { // I am the scribe and I've recieved a heartbeat from a concerned Folk - this.updateOthers(from, FOLK_SEEN) + this.update_folks(from, FOLK_SEEN) } } // handler for the folklore event folklore(data:ApiResponse) { console.log('got folklore', data) - if (this._scribeStr == this.me) { + if (this._scribe_str == this.me) { console.log('folklore received but I\'m the scribe!') } else { if (data.gone) { Object.values(data.participants).forEach( pubKey=>{ - this.updateOthers(pubKey, FOLK_GONE) + this.update_folks(pubKey, FOLK_GONE) } ) } @@ -499,7 +499,7 @@ export class Session { if (data.participants) { Object.values(data.participants).forEach( p=>{ - this.updateOthers(p.pubKey, FOLK_UNKNOWN, p.meta) + this.update_folks(p.pubKey, FOLK_UNKNOWN, p.meta) } ) } @@ -510,19 +510,19 @@ export class Session { commitNotice(commitInfo) { // make sure we are at the right place to be able to just move forward with the commit if (this.contentHashStr == bufferToBase64(commitInfo.previous_content_hash) && - this.nextIndex() == commitInfo.deltas_committed) { + this.next_index() == commitInfo.deltas_committed) { this.contentHashStr = bufferToBase64(commitInfo.commit_content_hash) this.committed = this.committed.concat(this.recorded) this.recorded = [] - this.committedChanges.set(this.committed) - this.recordedChanges.set(this.recorded) + this.committed_changes.set(this.committed) + this.recorded_changes.set(this.recorded) } else { console.log('received commit notice for beyond our last commit, gotta resync') console.log('commit.commit_content_hash:', bufferToBase64(commitInfo.commit_content_hash)) console.log('commit.previous_content_hash:', bufferToBase64(commitInfo.previous_content_hash)) console.log('commit.deltas_committed:', commitInfo.deltas_committed) console.log('my $session.contentHashStr', this.contentHashStr) - console.log('my nextIndex', this.nextIndex()) + console.log('my next_index', this.next_index()) // TODO resync } } diff --git a/ui/src/Syn.ts b/ui/libs/model/src/session/Syn.ts similarity index 56% rename from ui/src/Syn.ts rename to ui/libs/model/src/session/Syn.ts index baed7b8d..7e563a0c 100644 --- a/ui/src/Syn.ts +++ b/ui/libs/model/src/session/Syn.ts @@ -1,13 +1,11 @@ import type { AppWebsocket, HoloHash } from '@holochain/conductor-api' -import { get } from '@ctx-core/store' -import { FolkColors, getFolkColors } from './colors' -import { connection_b } from './connection' -import type { Content } from './content' -import { folks_b } from './folk' -import type { applyDelta_T } from './delta' -import { Zome } from './Zome' -import { Session, session_b, SessionInfo } from './session' -import { scribeStr_b } from './scribe' +import { Zome, connection_b } from '@syn-ui/zome-client' +import { FolkColors, getFolkColors } from '../colors' +import type { Content } from '../content' +import { folks_b } from '../folk' +import type { apply_delta_fn_T } from '../delta' +import { Session, session_b, SessionInfo } from '../session' +import { scribe_str_b } from '../scribe' declare global { interface Window { @@ -18,37 +16,37 @@ declare global { export class Syn { constructor( public ctx, - public defaultContent:Content, - public applyDeltaFn:applyDelta_T, - public appClient:AppWebsocket, - public appId:string + public default_content:Content, + public applyDeltaFn:apply_delta_fn_T, + public app_ws:AppWebsocket, + public app_id:string ) { window.syn = this } - zome = new Zome(this.appClient, this.appId) + zome = new Zome(this.app_ws, this.app_id) session = session_b(this.ctx) folks = folks_b(this.ctx) connection = connection_b(this.ctx) - scribeStr = scribeStr_b(this.ctx) - agentPubKey:HoloHash + scribe_str = scribe_str_b(this.ctx) + agent_pub_key:HoloHash me:string - myColors:FolkColors - myTag:string + my_colors:FolkColors + my_tag:string Dna:string async attach() { await this.zome.attach() - this.agentPubKey = this.zome.agentPubKey + this.agent_pub_key = this.zome.agent_pub_key this.me = this.zome.me - this.myColors = getFolkColors(this.agentPubKey) - this.myTag = this.me.slice(-4) - this.Dna = this.zome.dnaStr + this.my_colors = getFolkColors(this.agent_pub_key) + this.my_tag = this.me.slice(-4) + this.Dna = this.zome.dna_str // TODO: others moved into session so we can do it here. // load up the other folk in this syn instance // let allFolks = await this.getFolks() // for (const folk of allFolks) { -// this.updateOthers(folk) +// this.update_folks(folk) // } } @@ -57,12 +55,12 @@ export class Syn { this.folks.set({}) this.connection.set(undefined) this.session.update(s=>{ - s.scribeStr.set('') - s._content = this.defaultContent + s.scribe_str.set('') + s._content = this.default_content s.content.set(s._content) - s.requestedChanges.set([]) - s.recordedChanges.set([]) - s.committedChanges.set([]) + s.requested_changes.set([]) + s.recorded_changes.set([]) + s.committed_changes.set([]) return undefined }) } @@ -86,7 +84,7 @@ export class Syn { async newSession():Promise<Session> { const rawSessionInfo:SessionInfo = await this.callZome( 'new_session', - { content: this.defaultContent } + { content: this.default_content } ) const $session = new Session(this.ctx, this, rawSessionInfo) this.session.set($session) @@ -94,7 +92,7 @@ export class Syn { } async sendSyncReq():Promise<{ sessionInfo:SessionInfo }> { - return this.callZome('send_sync_request', { scribe: get(this.session).scribe }) + return this.callZome('send_sync_request', { scribe: this.session.$.scribe }) } } diff --git a/ui/libs/model/src/session/SyncReq_ops_b.ts b/ui/libs/model/src/session/SyncReq_ops_b.ts new file mode 100644 index 00000000..c16a1000 --- /dev/null +++ b/ui/libs/model/src/session/SyncReq_ops_b.ts @@ -0,0 +1,58 @@ +import type { HoloHash } from '@holochain/conductor-api' +import { _b } from '@ctx-core/object' +import { + agent_pub_key_b, FOLK_SEEN, me_b, rpc_send_folk_lore_b, rpc_send_sync_response_b, StateForSync +} from '@syn-ui/zome-client' +import { _scribe_signal_folk_pubKey_a1_b, recorded_changes_b } from '../delta' +import { update_folks_b } from './update_folks_b' +import { snapshot_hash_b } from './snapshot_hash_b' +import { content_hash_b } from './content_hash_b' +import { current_commit_header_hash_b } from './current_commit_header_hash_b' +import { folks_b } from './folks_b' +import { am_i_scribe_b } from './am_i_scribe_b' +import type { Ops } from './Ops' +export const SyncReq_ops_b = _b<Ops>('SyncReq_ops', (ctx)=>{ + const me = me_b(ctx) + const folks = folks_b(ctx) + const update_folks = update_folks_b(ctx) + const rpc_send_sync_response = rpc_send_sync_response_b(ctx) + const recorded_changes = recorded_changes_b(ctx) + const content_hash = content_hash_b(ctx) + const snapshot_hash = snapshot_hash_b(ctx) + const current_commit_header_hash = current_commit_header_hash_b(ctx) + const _scribe_signal_folk_pubKey_a1 = _scribe_signal_folk_pubKey_a1_b(ctx) + const rpc_send_folk_lore = rpc_send_folk_lore_b(ctx) + return { + SyncReq: async (signal)=>{ + const participant:HoloHash = signal.data.payload.signal_payload + const $me = me.$ + if (am_i_scribe_b(ctx).$) { + update_folks(participant, FOLK_SEEN) + const state:StateForSync = { + snapshot: snapshot_hash.$, + commit_content_hash: content_hash.$, + deltas: recorded_changes.$.map(c=>c.delta) + } + const $current_commit_header_hash = current_commit_header_hash.$ + if ($current_commit_header_hash) { + state['commit'] = $current_commit_header_hash + } + // send a sync response to the sender + await rpc_send_sync_response({ participant, state }) + // and send everybody a folk lore p2p message with new participants + const $folks = folks.$ + let p = { ...$folks } + p[$me] = { + pubKey: agent_pub_key_b(ctx).$ + } + const data = { participants: p } + await rpc_send_folk_lore({ + participants: _scribe_signal_folk_pubKey_a1(), + data, + }) + } else { + console.log('syncReq received but I\'m not the scribe!') + } + } + } +}) diff --git a/ui/libs/model/src/session/SyncResp_ops_b.ts b/ui/libs/model/src/session/SyncResp_ops_b.ts new file mode 100644 index 00000000..9c552120 --- /dev/null +++ b/ui/libs/model/src/session/SyncResp_ops_b.ts @@ -0,0 +1,29 @@ +import { _b, assign } from '@ctx-core/object' +import { bufferToBase64 } from '@syn-ui/utils' +import type { SerializedStateForSync, StateForSync } from '../delta' +import { record_delta_b } from '../delta' +import { content_hash_str_b } from './content_hash_str_b' +import type { Ops } from './Ops' +export const SyncResp_ops_b = _b<Ops>('SyncResp_ops', (ctx)=>{ + const content_hash_str = content_hash_str_b(ctx) + const record_delta = record_delta_b(ctx) + return { + SyncResp: async (signal)=>{ + const serialized_state:SerializedStateForSync = signal.data.payload.signal_payload + serialized_state.deltas = serialized_state.deltas.map(d=>JSON.parse(d)) + const state = assign({} as StateForSync, serialized_state, { + deltas: serialized_state.deltas.map(d=>JSON.parse(d)) + }) + // Make sure that we are working off the same snapshot and commit + const commit_content_hash_str = bufferToBase64(state.commit_content_hash) + if (commit_content_hash_str == content_hash_str.$) { + for (const delta of state.deltas) { + record_delta(delta) + } + } else { + console.log('WHOA, sync response has different current state assumptions') + // TODO: resync somehow + } + } + } +}) diff --git a/ui/libs/model/src/session/am_i_scribe_b.ts b/ui/libs/model/src/session/am_i_scribe_b.ts new file mode 100644 index 00000000..2c62c14d --- /dev/null +++ b/ui/libs/model/src/session/am_i_scribe_b.ts @@ -0,0 +1,11 @@ +import { _b } from '@ctx-core/object' +import { derived$ } from '@ctx-core/store' +import { me_b } from '@syn-ui/zome-client' +import { scribe_str_b } from './scribe_str_b' +export const am_i_scribe_b = _b('am_i_scribe', (ctx)=>{ + const scribe_str = scribe_str_b(ctx) + const me = me_b(ctx) + return derived$(([scribe_str, me]), ([$scribe_str, $me])=> + $scribe_str ? $scribe_str === $me : null + ) +}) diff --git a/ui/libs/model/src/session/commit_change_b.ts b/ui/libs/model/src/session/commit_change_b.ts new file mode 100644 index 00000000..50eeb56a --- /dev/null +++ b/ui/libs/model/src/session/commit_change_b.ts @@ -0,0 +1,76 @@ +import { _b, assign } from '@ctx-core/object' +import { Commit, rpc_commit_b, rpc_hash_content_b } from '@syn-ui/zome-client' +import { bufferToBase64 } from '@syn-ui/utils' +import { _scribe_signal_folk_pubKey_a1_b, committed_changes_b, recorded_changes_b } from '../delta' +import { content_b } from '../content' +import { commit_in_progress_b } from './commit_in_progress_b' +import { snapshot_hash_str_b } from './snapshot_hash_str_b' +import { content_hash_str_b } from './content_hash_str_b' +import { content_hash_b } from './content_hash_b' +import { snapshot_hash_b } from './snapshot_hash_b' +import { current_commit_header_hash_b } from './current_commit_header_hash_b' +import { session_info_b } from './session_info_b' +import { am_i_scribe_b } from './am_i_scribe_b' +export const commit_change_b = _b('commit_change', (ctx)=>{ + const recorded_changes = recorded_changes_b(ctx) + const commit_in_progress = commit_in_progress_b(ctx) + const rpc_hash_content = rpc_hash_content_b(ctx) + const content = content_b(ctx) + const snapshot_hash_str = snapshot_hash_str_b(ctx) + const content_hash = content_hash_b(ctx) + const content_hash_str = content_hash_str_b(ctx) + const snapshot_hash = snapshot_hash_b(ctx) + const _scribe_signal_folk_pubKey_a1 = _scribe_signal_folk_pubKey_a1_b(ctx) + const rpc_commit = rpc_commit_b(ctx) + const current_commit_header_hash = current_commit_header_hash_b(ctx) + const committed_changes = committed_changes_b(ctx) + const session_info = session_info_b(ctx) + return async function commit_change() { + if (am_i_scribe_b(ctx).$) { + const $recorded_changes = recorded_changes.$ + if ($recorded_changes.length == 0) { + alert('No changes to commit!') + return + } + commit_in_progress.set(true) + try { + const new_content_hash = await rpc_hash_content(content.$) + console.log('committing from snapshot', snapshot_hash_str.$) + console.log(' prev_hash:', content_hash_str.$) + console.log(' new_hash:', bufferToBase64(new_content_hash)) + const commit:Commit = { + snapshot: snapshot_hash.$, + change: { + deltas: $recorded_changes.map(c=>JSON.stringify(c.delta)), + content_hash: new_content_hash, + previous_change: content_hash.$, + meta: { + contributors: [], + witnesses: [], + app_specific: null + } + }, + participants: _scribe_signal_folk_pubKey_a1() + } + try { + const $current_commit_header_hash = await rpc_commit(commit) + current_commit_header_hash.set($current_commit_header_hash) + // if commit successfull we need to update the content hash and its string in the session + session_info.update($session_info=> + assign($session_info, { + content_hash: new_content_hash + }) + ) + committed_changes.push(...$recorded_changes) + recorded_changes.set([]) + } catch (e) { + console.log('Error:', e) + } + } finally { + commit_in_progress.set(false) + } + } else { + alert(`You ain't the scribe!`) + } + } +}) diff --git a/ui/libs/model/src/session/commit_in_progress_b.ts b/ui/libs/model/src/session/commit_in_progress_b.ts new file mode 100644 index 00000000..7fc29143 --- /dev/null +++ b/ui/libs/model/src/session/commit_in_progress_b.ts @@ -0,0 +1,5 @@ +import { _b } from '@ctx-core/object' +import { writable } from '@ctx-core/store' +export const commit_in_progress_b = _b('commit_in_progress', ()=> + writable<boolean>(false) +) diff --git a/ui/libs/model/src/session/content_hash_b.ts b/ui/libs/model/src/session/content_hash_b.ts new file mode 100644 index 00000000..467a34c1 --- /dev/null +++ b/ui/libs/model/src/session/content_hash_b.ts @@ -0,0 +1,28 @@ +import { _b, assign } from '@ctx-core/object' +import { derived$, Readable } from '@ctx-core/store' +import { session_info_b } from './session_info_b' +import type { Readable$ } from '@ctx-core/store/src/readable$' +import type { EntryHash } from '@syn-ui/utils' +import { mix_writable$ } from '@ctx-core/store/src/writable$' +export const content_hash_b = _b('content_hash', (ctx)=>{ + const session_info = session_info_b(ctx) + return mix_writable$(mix_readable_set(derived$(session_info, $session_info=> + $session_info?.content_hash + ), $content_hash=>session_info.update($session_info=>{ + $session_info.content_hash = $content_hash + return $session_info + }))) +}) +export interface content_hash_I extends Readable$<EntryHash> { + +} +export interface mix_readable_set_I<Val extends unknown = unknown> extends Readable<Val> { + set(val:Val):void +} +export function mix_readable_set<Val extends unknown = unknown>( + store:Readable<Val>, set:(val:Val)=>void +):mix_readable_set_I<Val> { + return assign(store as mix_readable_set_I<Val>, { + set + }) +} diff --git a/ui/libs/model/src/session/content_hash_str_b.ts b/ui/libs/model/src/session/content_hash_str_b.ts new file mode 100644 index 00000000..1225a541 --- /dev/null +++ b/ui/libs/model/src/session/content_hash_str_b.ts @@ -0,0 +1,10 @@ +import { _b } from '@ctx-core/object' +import { content_hash_b } from './content_hash_b' +import { derived$ } from '@ctx-core/store' +import { bufferToBase64 } from '@syn-ui/utils' +export const content_hash_str_b = _b('content_hash_str', (ctx) => { + const content_hash = content_hash_b(ctx) + return derived$(content_hash, $content_hash=> + $content_hash ? bufferToBase64($content_hash) : null + ) +}) diff --git a/ui/libs/model/src/session/current_commit_header_hash_b.ts b/ui/libs/model/src/session/current_commit_header_hash_b.ts new file mode 100644 index 00000000..d21e53e5 --- /dev/null +++ b/ui/libs/model/src/session/current_commit_header_hash_b.ts @@ -0,0 +1,6 @@ +import type { HoloHash } from '@holochain/conductor-api' +import { _b } from '@ctx-core/object' +import { writable$ } from '@ctx-core/store' +export const current_commit_header_hash_b = _b('current_commit_header_hash', ()=> + writable$<HoloHash>(null) +) diff --git a/ui/libs/model/src/session/folks_b.ts b/ui/libs/model/src/session/folks_b.ts new file mode 100644 index 00000000..6cc3da3a --- /dev/null +++ b/ui/libs/model/src/session/folks_b.ts @@ -0,0 +1,7 @@ +import { _b } from '@ctx-core/object' +import { writable$ } from '@ctx-core/store' +import type { PubKeyToFolkRecord } from '@syn-ui/zome-client' +export const folks_b = _b('folks', ()=>{ + return writable$<$folks_T>(null) +}) +export type $folks_T = PubKeyToFolkRecord diff --git a/ui/libs/model/src/session/index.ts b/ui/libs/model/src/session/index.ts new file mode 100644 index 00000000..c66a100c --- /dev/null +++ b/ui/libs/model/src/session/index.ts @@ -0,0 +1,17 @@ +export * from './commit_change_b' +export * from './commit_in_progress_b' +export * from './content_hash_b' +export * from './content_hash_str_b' +export * from './current_commit_header_hash_b' +export * from './folks_b' +export * from './join_session' +export * from './scribe_b' +export * from './scribe_str_b' +export * from './Session' +export * from './session_info_b' +export * from './sessions_b' +export * from './snapshot_hash_b' +export * from './snapshot_hash_str_b' +export * from './Syn' +export * from './SyncReq_ops_b' +export * from './update_folks_b' diff --git a/ui/libs/model/src/session/join_session.ts b/ui/libs/model/src/session/join_session.ts new file mode 100644 index 00000000..980f8b6f --- /dev/null +++ b/ui/libs/model/src/session/join_session.ts @@ -0,0 +1,93 @@ +import type { AppSignal } from '@holochain/conductor-api' +import { clone } from '@ctx-core/object' +import { I } from '@ctx-core/combinators' +import { subscribe_wait_timeout } from '@ctx-core/store' +import { bufferToBase64 } from '@syn-ui/utils' +import { + app_id_b, app_port_b, app_ws_cb_b, decodeJson, me_b, rpc_get_session_b, + rpc_new_session_b, rpc_send_sync_request_b, SessionInfo, +} from '@syn-ui/zome-client' +import { apply_delta_fn_T, apply_delta_fn_b } from '../delta' +import { SyncReq_ops_b } from './SyncReq_ops_b' +import { sessions_b } from './sessions_b' +import { session_info_b } from './session_info_b' +import { SyncResp_ops_b } from './SyncResp_ops_b' +import { am_i_scribe_b } from './am_i_scribe_b' +import { ChangeReq_ops_b } from './ChangeReq_ops_b' +import { Change_ops_b } from './Change_ops_b' +import type { Ops } from './Ops' +import { FolkLore_ops_b } from './FolkLore_ops_b' +import { Heartbeat_ops_b } from './Heartbeat_ops_b' +export async function join_session(params:join_session_params_T) { + const ctx = params.ctx || {} + const me = me_b(ctx) + const sessions = sessions_b(ctx) + const ops:Ops = clone( + Change_ops_b(ctx), + ChangeReq_ops_b(ctx), + FolkLore_ops_b(ctx), + Heartbeat_ops_b(ctx), + SyncReq_ops_b(ctx), + SyncResp_ops_b(ctx), + ) + app_ws_cb_b(ctx).set($app_ws_cb) + app_id_b(ctx).set(params.app_id) + app_port_b(ctx).set(params.app_port) + apply_delta_fn_b(ctx).set(params.apply_delta_fn) + const $sessions = await subscribe_wait_timeout(sessions, I, 10_000) + const session_info = session_info_b(ctx) + let $session_info:SessionInfo + if ($sessions.length === 0) { + $session_info = await rpc_new_session_b(ctx)() + sessions.unshift($session_info.session) + } else { + $session_info = await rpc_get_session_b(ctx)($sessions[0]) + if (am_i_scribe_b(ctx).$) { + await rpc_send_sync_request_b(ctx)($session_info) + } + } + session_info.set($session_info) + async function $app_ws_cb(signal:AppSignal) { + // ignore signals not meant for me + if (bufferToBase64(signal.data.cellId[1]) !== me.$) { + return + } + const { signal_name } = signal.data.payload + console.log('Got Signal', signal_name, signal) + const op = ops[signal_name] + if (!op) { + console.warn(`Undefined Op: ${signal_name}`) + } + await op(signal) + switch (signal.data.payload.signal_name) { + case 'SyncReq': + await SyncReq_ops_b(ctx) + break + case 'SyncResp': + await SyncResp_ops_b(ctx) + break + case 'ChangeReq': + await ChangeReq_ops_b(ctx) + break + case 'Change': + await Change_ops_b(ctx) + break + case 'FolkLore': { + FolkLore_ops_b(ctx) + break + } + case 'Heartbeat': { + Heartbeat_ops_b(ctx) + break + } + case 'CommitNotice': + connection.session.commitNotice(signal.data.payload.signal_payload) + } + } +} +export interface join_session_params_T { + app_port:number + app_id:string + apply_delta_fn:apply_delta_fn_T + ctx?:object +} diff --git a/ui/libs/model/src/session/record_deltas_b.ts b/ui/libs/model/src/session/record_deltas_b.ts new file mode 100644 index 00000000..d9e14180 --- /dev/null +++ b/ui/libs/model/src/session/record_deltas_b.ts @@ -0,0 +1,30 @@ +import type { Delta } from '@syn-ui/zome-client' +import { _b } from '@ctx-core/object' +import { record_delta_b, recorded_changes_b, requested_changes_b } from '../delta' +export const record_deltas_b = _b('record_deltas', (ctx)=>{ + const requested_changes = requested_changes_b(ctx) + return function record_deltas(_index:number, deltas:Delta[]) { + const $requested_changes = requested_changes.$ + console.log('record_deltas REQUESTED', $requested_changes) + for (const delta of deltas) { + if ($requested_changes.length > 0) { + // if this change is our next requested change then remove it + if (JSON.stringify(delta) == JSON.stringify($requested_changes[0].delta)) { + recorded_changes_b(ctx).push($requested_changes.shift()) + requested_changes.set($requested_changes) + } else { + // TODO rebase? + console.log('REBASE NEEDED?') + console.log('requested ', $requested_changes[0].delta) + console.log('to be recorded ', delta) + } + } else { + // no requested changes so this must be from someone else so we don't have + // to check our requested changes + // TODO: do we need to check if this is a change that we did send and have already + // integrated somehow and ignore if so. (Seems unlikely?) + record_delta_b(ctx)(delta) + } + } + } +}) diff --git a/ui/libs/model/src/session/scribe_b.ts b/ui/libs/model/src/session/scribe_b.ts new file mode 100644 index 00000000..2d607797 --- /dev/null +++ b/ui/libs/model/src/session/scribe_b.ts @@ -0,0 +1,10 @@ +import { _b } from '@ctx-core/object' +import { derived$ } from '@ctx-core/store' +import { bufferToBase64 } from '@syn-ui/utils' +import { session_info_b } from './session_info_b' +export const scribe_b = _b('scribe', (ctx)=>{ + const session_info = session_info_b(ctx) + return derived$(session_info, $session_info=> + $session_info ? bufferToBase64($session_info.scribe) : null + ) +}) diff --git a/ui/libs/model/src/session/scribe_str_b.ts b/ui/libs/model/src/session/scribe_str_b.ts new file mode 100644 index 00000000..442ea863 --- /dev/null +++ b/ui/libs/model/src/session/scribe_str_b.ts @@ -0,0 +1,10 @@ +import { _b } from '@ctx-core/object' +import { derived$ } from '@ctx-core/store' +import { bufferToBase64 } from '@syn-ui/utils' +import { scribe_b } from './scribe_b' +export const scribe_str_b = _b('scribe_str', (ctx)=>{ + const scribe = scribe_b(ctx) + return derived$(scribe, $scribe=> + $scribe ? bufferToBase64($scribe) : null + ) +}) diff --git a/ui/libs/model/src/session/session_info_b.ts b/ui/libs/model/src/session/session_info_b.ts new file mode 100644 index 00000000..99850a80 --- /dev/null +++ b/ui/libs/model/src/session/session_info_b.ts @@ -0,0 +1,6 @@ +import { _b } from '@ctx-core/object' +import { writable$ } from '@ctx-core/store' +import type { SessionInfo } from '@syn-ui/zome-client' +export const session_info_b = _b('session_info', ()=> + writable$<SessionInfo>(null) +) diff --git a/ui/libs/model/src/session/sessions_b.ts b/ui/libs/model/src/session/sessions_b.ts new file mode 100644 index 00000000..bc1b48b0 --- /dev/null +++ b/ui/libs/model/src/session/sessions_b.ts @@ -0,0 +1,33 @@ +import type { HoloHash } from '@holochain/conductor-api' +import { _b } from '@ctx-core/object' +import { Writable$, writable$ } from '@ctx-core/store' +import { rpc_get_sessions_b } from '@syn-ui/zome-client' +import { assign } from 'svelte/internal' +export const sessions_b = _b('sessions', (ctx)=>{ + const rpc_get_sessions = rpc_get_sessions_b(ctx) + const sessions = writable$<HoloHash[]>(null) + const busy = writable$<boolean>(false) + load().then() + const out_sessions = sessions as sessions_T + assign(out_sessions, { busy, load, unshift }) + return out_sessions + async function load() { + busy.set(true) + try { + return await rpc_get_sessions() + } finally { + busy.set(false) + } + } + function unshift(...session_hash_a1:HoloHash[]) { + const $sessions = sessions.$ + $sessions.unshift(...session_hash_a1) + sessions.set($sessions) + return $sessions + } +}) +export interface sessions_T extends Writable$<HoloHash[]> { + busy:Writable$<boolean> + load():Promise<HoloHash> + unshift(...session_hash_a1:HoloHash[]):HoloHash[] +} diff --git a/ui/libs/model/src/session/snapshot_hash_b.ts b/ui/libs/model/src/session/snapshot_hash_b.ts new file mode 100644 index 00000000..edae2e0b --- /dev/null +++ b/ui/libs/model/src/session/snapshot_hash_b.ts @@ -0,0 +1,9 @@ +import { _b } from '@ctx-core/object' +import { derived$ } from '@ctx-core/store' +import { session_info_b } from './session_info_b' +export const snapshot_hash_b = _b('snapshot_hash', (ctx) => { + const session_info = session_info_b(ctx) + return derived$(session_info, $session_info=> + $session_info?.snapshot_hash + ) +}) diff --git a/ui/libs/model/src/session/snapshot_hash_str_b.ts b/ui/libs/model/src/session/snapshot_hash_str_b.ts new file mode 100644 index 00000000..2b3af6ea --- /dev/null +++ b/ui/libs/model/src/session/snapshot_hash_str_b.ts @@ -0,0 +1,10 @@ +import { _b } from '@ctx-core/object' +import { derived$ } from '@ctx-core/store' +import { bufferToBase64 } from '@syn-ui/utils' +import { snapshot_hash_b } from './snapshot_hash_b' +export const snapshot_hash_str_b = _b('snapshot_hash_str', (ctx) => { + const snapshot_hash = snapshot_hash_b(ctx) + return derived$(snapshot_hash, $snapshot_hash=> + $snapshot_hash ? bufferToBase64($snapshot_hash) : null + ) +}) diff --git a/ui/libs/model/src/session/sync_response_b.ts b/ui/libs/model/src/session/sync_response_b.ts new file mode 100644 index 00000000..e69de29b diff --git a/ui/libs/model/src/session/update_folks_b.ts b/ui/libs/model/src/session/update_folks_b.ts new file mode 100644 index 00000000..482e8984 --- /dev/null +++ b/ui/libs/model/src/session/update_folks_b.ts @@ -0,0 +1,42 @@ +import type { HoloHash } from '@holochain/conductor-api' +import { _b } from '@ctx-core/object' +import { get } from '@ctx-core/store' +import { bufferToBase64 } from '@syn-ui/utils' +import { Folk, FOLK_GONE, FOLK_SEEN, FOLK_UNKNOWN, FolkStatus, me_b, PubKeyToFolkRecord } from '@syn-ui/zome-client' +import { getFolkColors } from '../colors' +import { folks_b } from './folks_b' +import { am_i_scribe_b } from './am_i_scribe_b' +export const update_folks_b = _b('update_folks', (ctx)=>{ + const am_i_scribe = am_i_scribe_b(ctx) + const folks = folks_b(ctx) + return update_folks + function update_folks(pubKey:HoloHash, status:FolkStatus, meta?:number) { + const pubKeyStr = bufferToBase64(pubKey) + if (am_i_scribe.$) { + return + } + // if we don't have this key, create a record for it + // including the default color + const $folks = folks.$ + _other($folks, pubKeyStr, pubKey) + if (meta) { + $folks[pubKeyStr]['meta'] = meta + } + switch (status) { + case FOLK_SEEN: + $folks[pubKeyStr]['inSession'] = true + $folks[pubKeyStr]['lastSeen'] = Date.now() + break + case FOLK_GONE: + case FOLK_UNKNOWN: + $folks[pubKeyStr]['inSession'] = false + } + folks.set($folks) + } + function _other($folks:PubKeyToFolkRecord, pubKeyStr:string, pubKey:HoloHash) { + if (!(pubKeyStr in $folks)) { + const colors = getFolkColors(pubKey) + $folks[pubKeyStr] = { pubKey, colors } as Folk + } + } +}) diff --git a/ui/libs/model/tsconfig.json b/ui/libs/model/tsconfig.json new file mode 100644 index 00000000..4082f16a --- /dev/null +++ b/ui/libs/model/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../tsconfig.json" +} diff --git a/ui/libs/utils/README.md b/ui/libs/utils/README.md new file mode 100644 index 00000000..410269ba --- /dev/null +++ b/ui/libs/utils/README.md @@ -0,0 +1 @@ +# @syn-ui/model diff --git a/ui/libs/utils/package.json b/ui/libs/utils/package.json new file mode 100644 index 00000000..cc179cef --- /dev/null +++ b/ui/libs/utils/package.json @@ -0,0 +1,13 @@ +{ + "name": "@syn-ui/utils", + "version": "1.0.0", + "main": "./src/index.ts", + "module": "./src/index.ts", + "types": "./src/index.ts", + "scripts": {}, + "dependencies": { + }, + "devDependencies": { + "typescript": "^4.2.4" + } +} diff --git a/ui/libs/utils/src/EntryHash.ts b/ui/libs/utils/src/EntryHash.ts new file mode 100644 index 00000000..6695d2d8 --- /dev/null +++ b/ui/libs/utils/src/EntryHash.ts @@ -0,0 +1,2 @@ +import type { HoloHash } from '@holochain/conductor-api' +export type EntryHash = HoloHash diff --git a/ui/libs/utils/src/HeaderHash.ts b/ui/libs/utils/src/HeaderHash.ts new file mode 100644 index 00000000..d673f74e --- /dev/null +++ b/ui/libs/utils/src/HeaderHash.ts @@ -0,0 +1,2 @@ +import type { HoloHash } from '@holochain/conductor-api' +export type HeaderHash = HoloHash diff --git a/ui/libs/utils/src/base64ToBuffer.ts b/ui/libs/utils/src/base64ToBuffer.ts new file mode 100644 index 00000000..38feec18 --- /dev/null +++ b/ui/libs/utils/src/base64ToBuffer.ts @@ -0,0 +1,8 @@ +export const base64ToBuffer = base64=>{ + if (!base64) return + if (typeof window !== 'undefined') { + return Uint8Array.from(window.atob(base64), c=>c.charCodeAt(0)) + } else { + return Buffer.from(base64, 'base64') + } +} diff --git a/ui/libs/utils/src/bufferToBase64.ts b/ui/libs/utils/src/bufferToBase64.ts new file mode 100644 index 00000000..d33fc1de --- /dev/null +++ b/ui/libs/utils/src/bufferToBase64.ts @@ -0,0 +1,15 @@ +export const bufferToBase64 = buffer=>{ + if (typeof window !== 'undefined') { + // browser + let binary = '' + const bytes = new Uint8Array(buffer) + const len = bytes.byteLength + for (let i = 0; i < len; i++) { + binary += String.fromCharCode(bytes[i]) + } + return window.btoa(binary) + } else { + // nodejs + return buffer.toString('base64') + } +} diff --git a/ui/libs/utils/src/index.ts b/ui/libs/utils/src/index.ts new file mode 100644 index 00000000..421e3d14 --- /dev/null +++ b/ui/libs/utils/src/index.ts @@ -0,0 +1,4 @@ +export * from './base64ToBuffer' +export * from './bufferToBase64' +export * from './EntryHash' +export * from './HeaderHash' diff --git a/ui/libs/utils/tsconfig.json b/ui/libs/utils/tsconfig.json new file mode 100644 index 00000000..4082f16a --- /dev/null +++ b/ui/libs/utils/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../tsconfig.json" +} diff --git a/ui/libs/zome-client/README.md b/ui/libs/zome-client/README.md new file mode 100644 index 00000000..410269ba --- /dev/null +++ b/ui/libs/zome-client/README.md @@ -0,0 +1 @@ +# @syn-ui/model diff --git a/ui/libs/zome-client/package.json b/ui/libs/zome-client/package.json new file mode 100644 index 00000000..68ae77d2 --- /dev/null +++ b/ui/libs/zome-client/package.json @@ -0,0 +1,15 @@ +{ + "name": "@syn-ui/zome-client", + "version": "1.0.0", + "main": "./src/index.ts", + "module": "./src/index.ts", + "types": "./src/index.ts", + "scripts": {}, + "devDependencies": { + "@ctx-core/function": "^17.4.7", + "@ctx-core/object": "^17.5.9", + "@ctx-core/store": "^24.3.1", + "@syn-ui/utils": "workspace:^1.0.0", + "typescript": "^4.2.4" + } +} \ No newline at end of file diff --git a/ui/libs/zome-client/src/ApiResponse.ts b/ui/libs/zome-client/src/ApiResponse.ts new file mode 100644 index 00000000..e0304192 --- /dev/null +++ b/ui/libs/zome-client/src/ApiResponse.ts @@ -0,0 +1,7 @@ +import type { HoloHash } from '@holochain/conductor-api' +import type { Participant } from './Participant' +export interface ApiResponse extends Record<string, any> { + pubKey:HoloHash + gone?:boolean + participants:Participant[] +} diff --git a/ui/src/Commit.ts b/ui/libs/zome-client/src/Commit.ts similarity index 100% rename from ui/src/Commit.ts rename to ui/libs/zome-client/src/Commit.ts diff --git a/ui/src/connection/Connection.ts b/ui/libs/zome-client/src/Connection.ts similarity index 82% rename from ui/src/connection/Connection.ts rename to ui/libs/zome-client/src/Connection.ts index 82b4c932..75c249d5 100644 --- a/ui/src/connection/Connection.ts +++ b/ui/libs/zome-client/src/Connection.ts @@ -1,28 +1,28 @@ import { AppSignal, AppWebsocket, HoloHash } from '@holochain/conductor-api' import { Session } from '../session' import type { Content } from '../content' -import type { applyDelta_T } from '../delta' +import type { apply_delta_fn_T } from '../delta' import { bufferToBase64, decodeJson } from '../utils' import { Syn } from '../Syn' export class Connection { - constructor(public ctx, public appPort:number, public appId:string) { + constructor(public ctx, public app_port:number, public app_id:string) { } - appClient:AppWebsocket + app_ws:AppWebsocket session:Session sessions:HoloHash[] syn:Syn - async open(defaultContent:Content, applyDeltaFn:applyDelta_T) { + async open(default_content:Content, applyDeltaFn:apply_delta_fn_T) { const self = this - this.appClient = await AppWebsocket.connect( - `ws://localhost:${this.appPort}`, + this.app_ws = await AppWebsocket.connect( + `ws://localhost:${this.app_port}`, 30000, (signal)=>signalHandler(self, signal)) console.log('connection established:', this) // TODO: in the future we should be able manage and to attach to multiple syn happs - this.syn = new Syn(this.ctx, defaultContent, applyDeltaFn, this.appClient, this.appId) + this.syn = new Syn(this.ctx, default_content, applyDeltaFn, this.app_ws, this.app_id) await this.syn.attach() this.sessions = await this.syn.getSessions() } @@ -38,7 +38,7 @@ export class Connection { } else { const sessionInfo = await this.syn.getSession(this.sessions[0]) this.session = new Session(this.ctx, this.syn, sessionInfo) - if (this.session._scribeStr != this.syn.me) { + if (this.session._scribe_str != this.syn.me) { await this.syn.sendSyncReq() } } @@ -47,7 +47,7 @@ export class Connection { function signalHandler(connection:Connection, signal:AppSignal) { // ignore signals not meant for me - if (!connection.syn || bufferToBase64(signal.data.cellId[1]) != connection.syn.me) { + if (!connection.syn || bufferToBase64(signal.data.cell_id[1]) != connection.syn.me) { return } console.log('Got Signal', signal.data.payload.signal_name, signal) diff --git a/ui/src/content/Content.ts b/ui/libs/zome-client/src/Content.ts similarity index 100% rename from ui/src/content/Content.ts rename to ui/libs/zome-client/src/Content.ts diff --git a/ui/src/delta/Delta.ts b/ui/libs/zome-client/src/Delta.ts similarity index 100% rename from ui/src/delta/Delta.ts rename to ui/libs/zome-client/src/Delta.ts diff --git a/ui/src/folk/Folk.ts b/ui/libs/zome-client/src/Folk.ts similarity index 58% rename from ui/src/folk/Folk.ts rename to ui/libs/zome-client/src/Folk.ts index 1554b200..a263eaac 100644 --- a/ui/src/folk/Folk.ts +++ b/ui/libs/zome-client/src/Folk.ts @@ -1,12 +1,18 @@ import type { HoloHash } from '@holochain/conductor-api' -import type { FolkColors } from '../colors' -export interface FolkI { +import type { FolkColors } from './FolkColors' +export interface Folk { pubKey:HoloHash inSession?:boolean colors?:FolkColors lastSeen?:number } -export type PubKeyToFolkRecord = Record<string, FolkI> +export type string_Folk_Record = Record<string, Folk> +export type pk = 'pubKey' +export type PubKeyToFolkRecord = { + [L in keyof Exclude<any, 'pubKey'>]: Folk; +} & { + pubKey?: HoloHash +} export enum FolkStatus { FOLK_SEEN = 1, FOLK_GONE = 2, diff --git a/ui/libs/zome-client/src/FolkColors.ts b/ui/libs/zome-client/src/FolkColors.ts new file mode 100644 index 00000000..bbe0e06e --- /dev/null +++ b/ui/libs/zome-client/src/FolkColors.ts @@ -0,0 +1,8 @@ +import type { HSL } from './HSL' +export interface FolkColors { + primary:HSL + hexagon:HSL + selection:HSL + lookingSelection:HSL + lookingCursor:HSL +} diff --git a/ui/libs/zome-client/src/HSL.ts b/ui/libs/zome-client/src/HSL.ts new file mode 100644 index 00000000..c183e1fc --- /dev/null +++ b/ui/libs/zome-client/src/HSL.ts @@ -0,0 +1 @@ +export type HSL = [number, number, number] diff --git a/ui/libs/zome-client/src/Participant.ts b/ui/libs/zome-client/src/Participant.ts new file mode 100644 index 00000000..0b1ca369 --- /dev/null +++ b/ui/libs/zome-client/src/Participant.ts @@ -0,0 +1,5 @@ +import type { HoloHash } from '@holochain/conductor-api' +export interface Participant extends HoloHash { + pubKey:HoloHash + meta:number +} diff --git a/ui/libs/zome-client/src/SessionInfo.ts b/ui/libs/zome-client/src/SessionInfo.ts new file mode 100644 index 00000000..44f992e8 --- /dev/null +++ b/ui/libs/zome-client/src/SessionInfo.ts @@ -0,0 +1,11 @@ +import type { AgentPubKey } from '@holochain/conductor-api' +import type { Content } from './Content' +import type { EntryHash } from '@syn-ui/utils' +export interface SessionInfo { + session:EntryHash + scribe:AgentPubKey + snapshot_content:Content + snapshot_hash:EntryHash + deltas:string[] + content_hash:EntryHash +} diff --git a/ui/libs/zome-client/src/StateForSync.ts b/ui/libs/zome-client/src/StateForSync.ts new file mode 100644 index 00000000..fa1ff288 --- /dev/null +++ b/ui/libs/zome-client/src/StateForSync.ts @@ -0,0 +1,14 @@ +import type { HoloHash } from '@holochain/conductor-api' +import type { Delta } from './Delta' +export interface StateForSync { + snapshot:HoloHash + commit?:HoloHash + commit_content_hash:HoloHash + deltas:Delta[] +} +export interface StateForSync_serialized_I { + snapshot:HoloHash + commit?:HoloHash + commit_content_hash:HoloHash + deltas:string[] +} diff --git a/ui/src/Zome.ts b/ui/libs/zome-client/src/Zome.ts similarity index 60% rename from ui/src/Zome.ts rename to ui/libs/zome-client/src/Zome.ts index 9b592554..5fe55727 100644 --- a/ui/src/Zome.ts +++ b/ui/libs/zome-client/src/Zome.ts @@ -1,23 +1,23 @@ import type { AppWebsocket, HoloHash, InstalledAppInfo } from '@holochain/conductor-api' -import { bufferToBase64 } from './utils' +import { bufferToBase64 } from '../utils' export class Zome { - constructor(public appClient:AppWebsocket, public appId:string) { + constructor(public app_ws:AppWebsocket, public app_id:string) { } - agentPubKey:HoloHash + agent_pub_key:HoloHash appInfo:InstalledAppInfo - cellId:[HoloHash, HoloHash] + cell_id:[HoloHash, HoloHash] dna:HoloHash - dnaStr:string + dna_str:string me:string async attach() { // setup the syn instance data - this.appInfo = await this.appClient.appInfo({ installed_app_id: this.appId }) - this.cellId = this.appInfo.cell_data[0].cell_id - this.agentPubKey = this.cellId[1] - this.dna = this.cellId[0] - this.dnaStr = bufferToBase64(this.dna) - this.me = bufferToBase64(this.agentPubKey) + this.appInfo = await this.app_ws.appInfo({ installed_app_id: this.app_id }) + this.cell_id = this.appInfo.cell_data[0].cell_id + this.agent_pub_key = this.cell_id[1] + this.dna = this.cell_id[0] + this.dna_str = bufferToBase64(this.dna) + this.me = bufferToBase64(this.agent_pub_key) } attached() { @@ -32,13 +32,13 @@ export class Zome { try { const zome_name = 'syn' console.log(`Making zome call ${fn_name} with:`, payload) - const result = await this.appClient.callZome( + const result = await this.app_ws.callZome( { cap: null, - cell_id: this.cellId, + cell_id: this.cell_id, zome_name, fn_name, - provenance: this.agentPubKey, + provenance: this.agent_pub_key, payload }, timeout diff --git a/ui/libs/zome-client/src/agent_pub_key_b.ts b/ui/libs/zome-client/src/agent_pub_key_b.ts new file mode 100644 index 00000000..217bf067 --- /dev/null +++ b/ui/libs/zome-client/src/agent_pub_key_b.ts @@ -0,0 +1,9 @@ +import { _b } from '@ctx-core/object' +import { derived$ } from '@ctx-core/store' +import { cell_id_b } from './cell_id_b' +export const agent_pub_key_b = _b('agent_pub_key', (ctx)=>{ + const cell_id = cell_id_b(ctx) + return derived$(cell_id, $cell_id=> + $cell_id?.[0] + ) +}) diff --git a/ui/libs/zome-client/src/appInfo_b.ts b/ui/libs/zome-client/src/appInfo_b.ts new file mode 100644 index 00000000..26cf1628 --- /dev/null +++ b/ui/libs/zome-client/src/appInfo_b.ts @@ -0,0 +1,17 @@ +import type { InstalledAppInfo } from '@holochain/conductor-api' +import { _b } from '@ctx-core/object' +import { derived$, Readable$ } from '@ctx-core/store' +import { app_ws_b } from './app_ws_b' +import { app_id_b } from './app_id_b' +export const appInfo_b = _b('appInfo', (ctx)=>{ + const app_id = app_id_b(ctx) + const app_ws = app_ws_b(ctx) + const appInfo:appInfo_T = derived$([app_ws, app_id], ([$app_ws, $app_id], set)=>{ + (async()=>{ + set(await $app_ws.appInfo({ installed_app_id: $app_id })) + })() + }) + return appInfo +}) +export type $appInfo_T = InstalledAppInfo +export interface appInfo_T extends Readable$<$appInfo_T> {} diff --git a/ui/libs/zome-client/src/app_id_b.ts b/ui/libs/zome-client/src/app_id_b.ts new file mode 100644 index 00000000..3fed6e10 --- /dev/null +++ b/ui/libs/zome-client/src/app_id_b.ts @@ -0,0 +1,5 @@ +import { _b } from '@ctx-core/object' +import { writable$ } from '@ctx-core/store' +export const app_id_b = _b('app_id', ()=>{ + return writable$<string>(null) +}) diff --git a/ui/libs/zome-client/src/app_port_b.ts b/ui/libs/zome-client/src/app_port_b.ts new file mode 100644 index 00000000..a42acb9f --- /dev/null +++ b/ui/libs/zome-client/src/app_port_b.ts @@ -0,0 +1,8 @@ +import { _b, B } from '@ctx-core/object' +import { writable$, Writable } from '@ctx-core/store' +export const app_port_b:app_port_b_T = _b('app_port', ()=>{ + return writable$(null) +}) +export type $app_port_T = number +export interface app_port_T extends Writable<$app_port_T> {} +export interface app_port_b_T extends B<app_port_T> {} diff --git a/ui/libs/zome-client/src/app_ws_b.ts b/ui/libs/zome-client/src/app_ws_b.ts new file mode 100644 index 00000000..8e571fb8 --- /dev/null +++ b/ui/libs/zome-client/src/app_ws_b.ts @@ -0,0 +1,70 @@ +import { AppSignal, AppSignalCb, AppWebsocket } from '@holochain/conductor-api' +import { _b, B } from '@ctx-core/object' +import { derived$, Readable } from '@ctx-core/store' +import { app_port_b } from './app_port_b' +import { app_ws_cb_b } from './app_ws_cb_b' +export const app_ws_b:app_ws_b_T = _b('app_ws', (ctx)=>{ + const app_port = app_port_b(ctx) + const app_ws_cb = app_ws_cb_b(ctx) + return derived$(app_port, ($app_port, set)=>{ + (async ()=>{ + set( + await _app_ws($app_port, (signal:AppSignal) =>{ + app_ws_cb.$(signal) + }) + ) + })() + }) +}) +export type $app_ws_T = AppWebsocket +export interface app_ws_T extends Readable<$app_ws_T> {} +export interface app_ws_b_T extends B<app_ws_T> {} + +export async function _app_ws(app_port:number, signal_fn:AppSignalCb) { + return await AppWebsocket.connect( + `ws://localhost:${app_port}`, + 30000, + (signal)=>signal_fn(signal)) +} +// function signal_fn(signal:AppSignal) { +// // ignore signals not meant for me +// if (!connection.syn || bufferToBase64(signal.data.cell_id[1]) != connection.syn.me) { +// return +// } +// console.log('Got Signal', signal.data.payload.signal_name, signal) +// switch (signal.data.payload.signal_name) { +// case 'SyncReq': +// connection.session.syncReq({ from: signal.data.payload.signal_payload }) +// break +// case 'SyncResp': +// const state = signal.data.payload.signal_payload +// state.deltas = state.deltas.map(d=>JSON.parse(d)) +// connection.session.syncResp(state) +// break +// case 'ChangeReq': { +// let [index, deltas] = signal.data.payload.signal_payload +// deltas = deltas.map(d=>JSON.parse(d)) +// connection.session.changeReq([index, deltas]) +// break +// } +// case 'Change': { +// let [index, deltas] = signal.data.payload.signal_payload +// deltas = deltas.map(d=>JSON.parse(d)) +// connection.session.change(index, deltas) +// break +// } +// case 'FolkLore': { +// let data = decodeJson(signal.data.payload.signal_payload) +// connection.session.folklore(data) +// break +// } +// case 'Heartbeat': { +// let [from, jsonData] = signal.data.payload.signal_payload +// const data = decodeJson(jsonData) +// connection.session.heartbeat(from, data) +// break +// } +// case 'CommitNotice': +// connection.session.commitNotice(signal.data.payload.signal_payload) +// } +// } diff --git a/ui/libs/zome-client/src/app_ws_cb_b.ts b/ui/libs/zome-client/src/app_ws_cb_b.ts new file mode 100644 index 00000000..c3aecada --- /dev/null +++ b/ui/libs/zome-client/src/app_ws_cb_b.ts @@ -0,0 +1,8 @@ +import type { AppSignalCb } from '@holochain/conductor-api' +import { _b } from '@ctx-core/object' +import { writable$ } from '@ctx-core/store' +export const app_ws_cb_b = _b('app_ws_cb', ()=> + writable$<AppSignalCb>(()=> + console.warn('Unhandled app_ws callback: app_ws_cb should be set') + ) +) diff --git a/ui/libs/zome-client/src/cell_id_b.ts b/ui/libs/zome-client/src/cell_id_b.ts new file mode 100644 index 00000000..8bdf47e7 --- /dev/null +++ b/ui/libs/zome-client/src/cell_id_b.ts @@ -0,0 +1,9 @@ +import { _b } from '@ctx-core/object' +import { derived$ } from '@ctx-core/store' +import { appInfo_b } from './appInfo_b' +export const cell_id_b = _b('cell_id', (ctx)=>{ + const appInfo = appInfo_b(ctx) + return derived$(appInfo, $appInfo=> + $appInfo?.cell_data?.[0]?.cell_id + ) +}) diff --git a/ui/libs/zome-client/src/connection_b.ts b/ui/libs/zome-client/src/connection_b.ts new file mode 100644 index 00000000..e8738116 --- /dev/null +++ b/ui/libs/zome-client/src/connection_b.ts @@ -0,0 +1,6 @@ +import { _b } from '@ctx-core/object' +import { writable$ } from '@ctx-core/store' +import type { Connection } from './Connection' +export const connection_b = _b('connection', ()=>{ + return writable$<Connection>(null) +}) diff --git a/ui/libs/zome-client/src/decodeJson.ts b/ui/libs/zome-client/src/decodeJson.ts new file mode 100644 index 00000000..979a452b --- /dev/null +++ b/ui/libs/zome-client/src/decodeJson.ts @@ -0,0 +1,17 @@ +import { base64ToBuffer } from '@syn-ui/utils' +import type { ApiResponse } from './ApiResponse' +export function decodeJson(jsonStr:string):ApiResponse { + return JSON.parse(jsonStr, function (key:string, value:string) { + // the receiver function looks for the typed array flag + try { + if (key == 'pubKey') { + return base64ToBuffer(value) + } + } catch (e) { + console.log('decodeJson Error:', e) + } + + // if flag not found no conversion is done + return value + }) +} diff --git a/ui/libs/zome-client/src/dna_b.ts b/ui/libs/zome-client/src/dna_b.ts new file mode 100644 index 00000000..f74dab38 --- /dev/null +++ b/ui/libs/zome-client/src/dna_b.ts @@ -0,0 +1,9 @@ +import { _b } from '@ctx-core/object' +import { derived$ } from '@ctx-core/store' +import { cell_id_b } from './cell_id_b' +export const dna_b = _b('dna', (ctx)=>{ + const cell_id = cell_id_b(ctx) + return derived$(cell_id, $cell_id=> + $cell_id?.[0] + ) +}) diff --git a/ui/libs/zome-client/src/dna_str_b.ts b/ui/libs/zome-client/src/dna_str_b.ts new file mode 100644 index 00000000..a91e36fd --- /dev/null +++ b/ui/libs/zome-client/src/dna_str_b.ts @@ -0,0 +1,10 @@ +import { _b } from '@ctx-core/object' +import { derived$ } from '@ctx-core/store' +import { bufferToBase64 } from '@syn-ui/utils' +import { dna_b } from './dna_b' +export const dna_str_b = _b('dna_str', (ctx)=>{ + const dna = dna_b(ctx) + return derived$(dna, $dna=> + $dna ? bufferToBase64($dna) : null + ) +}) diff --git a/ui/libs/zome-client/src/encodeJson.ts b/ui/libs/zome-client/src/encodeJson.ts new file mode 100644 index 00000000..a3110263 --- /dev/null +++ b/ui/libs/zome-client/src/encodeJson.ts @@ -0,0 +1,13 @@ +import { bufferToBase64 } from '@syn-ui/utils' +export function encodeJson(obj) { + return JSON.stringify(obj, function (key, value) { + if (key == 'pubKey') { + if (typeof window !== 'undefined') { + return bufferToBase64(value) // In the browser it's the actual array + } else { + return bufferToBase64(Buffer.from(value.data)) // In node it's an object + } + } + return value + }) +} diff --git a/ui/libs/zome-client/src/index.ts b/ui/libs/zome-client/src/index.ts new file mode 100644 index 00000000..27a1144d --- /dev/null +++ b/ui/libs/zome-client/src/index.ts @@ -0,0 +1,39 @@ +export * from './agent_pub_key_b' +export * from './ApiResponse' +export * from './app_id_b' +export * from './appInfo_b' +export * from './app_port_b' +export * from './app_ws_b' +export * from './app_ws_cb_b' +export * from './cell_id_b' +export * from './Commit' +export * from './Connection' +export * from './connection_b' +export * from './Content' +export * from './decodeJson' +export * from './Delta' +export * from './dna_b' +export * from './dna_str_b' +export * from './encodeJson' +export * from './Folk' +export * from './FolkColors' +export * from './HSL' +export * from './me_b' +export * from './my_tag_b' +export * from './Participant' +export * from './rpc_b' +export * from './rpc_commit_b' +export * from './rpc_get_folks_b' +export * from './rpc_get_session_b' +export * from './rpc_get_sessions_b' +export * from './rpc_hash_content_b' +export * from './rpc_new_session_b' +export * from './rpc_send_change_b' +export * from './rpc_send_change_request_b' +export * from './rpc_send_folk_lore_b' +export * from './rpc_send_heartbeat_b' +export * from './rpc_send_sync_request_b' +export * from './rpc_send_sync_response_b' +export * from './SessionInfo' +export * from './StateForSync' +export * from './Zome' diff --git a/ui/libs/zome-client/src/me_b.ts b/ui/libs/zome-client/src/me_b.ts new file mode 100644 index 00000000..1ee31a70 --- /dev/null +++ b/ui/libs/zome-client/src/me_b.ts @@ -0,0 +1,10 @@ +import { _b } from '@ctx-core/object' +import { derived$ } from '@ctx-core/store' +import { bufferToBase64 } from '@syn-ui/utils' +import { agent_pub_key_b } from './agent_pub_key_b' +export const me_b = _b('me', (ctx)=>{ + const agent_pub_key = agent_pub_key_b(ctx) + return derived$(agent_pub_key, $agent_pub_key=> + $agent_pub_key ? bufferToBase64($agent_pub_key) : null + ) +}) diff --git a/ui/libs/zome-client/src/my_tag_b.ts b/ui/libs/zome-client/src/my_tag_b.ts new file mode 100644 index 00000000..0207f42b --- /dev/null +++ b/ui/libs/zome-client/src/my_tag_b.ts @@ -0,0 +1,9 @@ +import { _b } from '@ctx-core/object' +import { derived$ } from '@ctx-core/store' +import { me_b } from './me_b' +export const my_tag_b = _b('my_tag', (ctx) => { + const me = me_b(ctx) + return derived$(me, $me => + $me ? $me.slice(-4) : null + ) +}) diff --git a/ui/libs/zome-client/src/rpc_b.ts b/ui/libs/zome-client/src/rpc_b.ts new file mode 100644 index 00000000..5ef17ddd --- /dev/null +++ b/ui/libs/zome-client/src/rpc_b.ts @@ -0,0 +1,43 @@ +import type { AppWebsocket, AgentPubKey, HoloHash } from '@holochain/conductor-api' +import { _b } from '@ctx-core/object' +import { I } from '@ctx-core/combinators' +import { subscribe_wait_timeout } from '@ctx-core/store' +import { app_ws_b } from './app_ws_b' +import { cell_id_b } from './cell_id_b' +import { agent_pub_key_b } from './agent_pub_key_b' +export const rpc_b = _b('rpc', (ctx)=>{ + const app_ws = app_ws_b(ctx) + const cell_id = cell_id_b(ctx) + const agent_pub_key = agent_pub_key_b(ctx) + return rpc + async function rpc(fn_name:string, payload?:any, timeout?:number) { + try { + const zome_name = 'syn' + console.log(`Making zome call ${fn_name} with:`, payload) + const [$app_ws, $cell_id, $agent_pub_key]:[AppWebsocket, [HoloHash, AgentPubKey], HoloHash] = + await Promise.all([ + subscribe_wait_timeout(app_ws, I, 10_000), + subscribe_wait_timeout(cell_id, I, 10_000), + subscribe_wait_timeout(agent_pub_key, I, 10_000) + ]) + const result = await $app_ws.callZome( + { + cap: null, + cell_id: $cell_id, + zome_name, + fn_name, + provenance: $agent_pub_key, + payload + }, + timeout + ) + return result + } catch (error) { + console.log('ERROR: rpc threw error', error) + throw(error) + // if (error == 'Error: Socket is not open') { + // TODO return doResetConnection(dispatch) + // } + } + } +}) diff --git a/ui/libs/zome-client/src/rpc_commit_b.ts b/ui/libs/zome-client/src/rpc_commit_b.ts new file mode 100644 index 00000000..1399894a --- /dev/null +++ b/ui/libs/zome-client/src/rpc_commit_b.ts @@ -0,0 +1,10 @@ +import type { HoloHash } from '@holochain/conductor-api' +import { _b } from '@ctx-core/object' +import { rpc_b } from './rpc_b' +import type { Commit } from './Commit' +export const rpc_commit_b = _b('rpc_commit', (ctx)=>{ + const rpc = rpc_b(ctx) + return async function rpc_commit(commit:Commit):Promise<HoloHash> { + return rpc('commit', commit) + } +}) diff --git a/ui/libs/zome-client/src/rpc_get_folks_b.ts b/ui/libs/zome-client/src/rpc_get_folks_b.ts new file mode 100644 index 00000000..0c5741f9 --- /dev/null +++ b/ui/libs/zome-client/src/rpc_get_folks_b.ts @@ -0,0 +1,9 @@ +import { _b } from '@ctx-core/object' +import { rpc_b } from './rpc_b' +import type { HoloHash } from '@holochain/conductor-api' +export const rpc_get_folks_b = _b('rpc_get_folks', (ctx)=>{ + const rpc = rpc_b(ctx) + return async function rpc_get_folks():Promise<HoloHash[]> { + return await rpc('get_folks') + } +}) diff --git a/ui/libs/zome-client/src/rpc_get_session_b.ts b/ui/libs/zome-client/src/rpc_get_session_b.ts new file mode 100644 index 00000000..853de417 --- /dev/null +++ b/ui/libs/zome-client/src/rpc_get_session_b.ts @@ -0,0 +1,10 @@ +import type { HoloHash } from '@holochain/conductor-api' +import { _b } from '@ctx-core/object' +import { rpc_b } from './rpc_b' +import type { SessionInfo } from './SessionInfo' +export const rpc_get_session_b = _b('rpc_get_session', (ctx) => { + const rpc = rpc_b(ctx) + return async function rpc_get_session(session_hash:HoloHash):Promise<SessionInfo> { + return rpc('get_session', session_hash) + } +}) diff --git a/ui/libs/zome-client/src/rpc_get_sessions_b.ts b/ui/libs/zome-client/src/rpc_get_sessions_b.ts new file mode 100644 index 00000000..f5ef9890 --- /dev/null +++ b/ui/libs/zome-client/src/rpc_get_sessions_b.ts @@ -0,0 +1,9 @@ +import type { HoloHash } from '@holochain/conductor-api' +import { _b } from '@ctx-core/object' +import { rpc_b } from './rpc_b' +export const rpc_get_sessions_b = _b('rpc_get_sessions', (ctx)=>{ + const rpc = rpc_b(ctx) + return async function rpc_get_sessions():Promise<HoloHash[]> { + return await rpc('get_sessions') + } +}) diff --git a/ui/libs/zome-client/src/rpc_hash_content_b.ts b/ui/libs/zome-client/src/rpc_hash_content_b.ts new file mode 100644 index 00000000..15712a73 --- /dev/null +++ b/ui/libs/zome-client/src/rpc_hash_content_b.ts @@ -0,0 +1,10 @@ +import type { HoloHash } from '@holochain/conductor-api' +import { _b } from '@ctx-core/object' +import type { Content } from './Content' +import { rpc_b } from './rpc_b' +export const rpc_hash_content_b = _b('rpc_hash_content', (ctx)=>{ + const rpc = rpc_b(ctx) + return async function rpc_hash_content(content:Content):Promise<HoloHash> { + return rpc('hash_content', content) + } +}) diff --git a/ui/libs/zome-client/src/rpc_new_session_b.ts b/ui/libs/zome-client/src/rpc_new_session_b.ts new file mode 100644 index 00000000..e3f6db01 --- /dev/null +++ b/ui/libs/zome-client/src/rpc_new_session_b.ts @@ -0,0 +1,12 @@ +import { _b } from '@ctx-core/object' +import { rpc_b } from './rpc_b' +import type { Content } from './Content' +import type { SessionInfo } from './SessionInfo' +export const rpc_new_session_b = _b('rpc_new_session', (ctx) => { + const rpc = rpc_b(ctx) + return async function rpc_new_session( + content:Content = { title: '', body: '' } + ):Promise<SessionInfo> { + return rpc('new_session', { content }) + } +}) diff --git a/ui/libs/zome-client/src/rpc_send_change_b.ts b/ui/libs/zome-client/src/rpc_send_change_b.ts new file mode 100644 index 00000000..eea4d836 --- /dev/null +++ b/ui/libs/zome-client/src/rpc_send_change_b.ts @@ -0,0 +1,23 @@ +import { _b } from '@ctx-core/object' +import type { HoloHash } from '@holochain/conductor-api' +import type { Delta } from './Delta' +import { rpc_b } from './rpc_b' +export const rpc_send_change_b = _b('rpc_send_change', (ctx)=>{ + const rpc = rpc_b(ctx) + return async function rpc_send_change( + { index, deltas, participants }:rpc_send_change_params_I + ):Promise<void> { + if (participants.length > 0) { + const delta_json_a1 = deltas.map(d=>JSON.stringify(d)) + return rpc('send_change', { + participants, + change: [index, delta_json_a1] + }) + } + } +}) +export interface rpc_send_change_params_I { + index:number + deltas:Delta[] + participants:HoloHash[] +} diff --git a/ui/libs/zome-client/src/rpc_send_change_request_b.ts b/ui/libs/zome-client/src/rpc_send_change_request_b.ts new file mode 100644 index 00000000..73fe6099 --- /dev/null +++ b/ui/libs/zome-client/src/rpc_send_change_request_b.ts @@ -0,0 +1,24 @@ +import type { HoloHash } from '@holochain/conductor-api' +import { _b } from '@ctx-core/object' +import { rpc_b } from './rpc_b' +import type { Delta } from './Delta' +export const rpc_send_change_request_b = _b('rpc_send_change_request', (ctx)=>{ + const rpc = rpc_b(ctx) + return async function rpc_send_change_request( + { index, deltas, scribe }:rpc_send_change_request_params_I + ):Promise<void> { + const delta_json_a1 = deltas.map(delta=>JSON.stringify(delta)) + return rpc('send_change_request', { + scribe, + change: [ + index, + delta_json_a1 + ] + }) + } +}) +export interface rpc_send_change_request_params_I { + index:number + deltas:Delta[] + scribe:HoloHash +} diff --git a/ui/libs/zome-client/src/rpc_send_folk_lore_b.ts b/ui/libs/zome-client/src/rpc_send_folk_lore_b.ts new file mode 100644 index 00000000..85688776 --- /dev/null +++ b/ui/libs/zome-client/src/rpc_send_folk_lore_b.ts @@ -0,0 +1,20 @@ +import { _b } from '@ctx-core/object' +import { rpc_b } from './rpc_b' +import type { HoloHash } from '@holochain/conductor-api' +import { encodeJson } from './encodeJson' +import type { PubKeyToFolkRecord } from './Folk' +export const rpc_send_folk_lore_b = _b('rpc_send_folk_lore', (ctx)=>{ + const rpc = rpc_b(ctx) + return function rpc_send_folk_lore({ participants, data }:SendFolkLoreInput) { + if (participants.length) { + const serialized_data = encodeJson(data) + return rpc('send_folk_lore', { participants, data: serialized_data }) + } + } +}) +export interface SendFolkLoreInput { + participants:HoloHash[] + data:{ + participants:PubKeyToFolkRecord + } +} diff --git a/ui/libs/zome-client/src/rpc_send_heartbeat_b.ts b/ui/libs/zome-client/src/rpc_send_heartbeat_b.ts new file mode 100644 index 00000000..fd0e809e --- /dev/null +++ b/ui/libs/zome-client/src/rpc_send_heartbeat_b.ts @@ -0,0 +1,13 @@ +import { _b } from '@ctx-core/object' +import type { HoloHash } from '@holochain/conductor-api' +import { rpc_b } from './rpc_b' +export const rpc_send_heartbeat_b = _b('rpc_send_heartbeat', (ctx)=>{ + const rpc = rpc_b(ctx) + return function rpc_send_heartbeat({ scribe, data }:rpc_send_heartbeat_params_I) { + return rpc('send_heartbeat', { scribe, data }) + } +}) +export interface rpc_send_heartbeat_params_I { + scribe:HoloHash + data:string +} diff --git a/ui/libs/zome-client/src/rpc_send_sync_request_b.ts b/ui/libs/zome-client/src/rpc_send_sync_request_b.ts new file mode 100644 index 00000000..71de086e --- /dev/null +++ b/ui/libs/zome-client/src/rpc_send_sync_request_b.ts @@ -0,0 +1,9 @@ +import { _b } from '@ctx-core/object' +import { rpc_b } from './rpc_b' +import type { SessionInfo } from './SessionInfo' +export const rpc_send_sync_request_b = _b('rpc_send_sync_request', (ctx)=>{ + const rpc = rpc_b(ctx) + return async function rpc_send_sync_request(session_info:SessionInfo) { + return rpc('send_sync_request', session_info.scribe) + } +}) diff --git a/ui/libs/zome-client/src/rpc_send_sync_response_b.ts b/ui/libs/zome-client/src/rpc_send_sync_response_b.ts new file mode 100644 index 00000000..5de45ac1 --- /dev/null +++ b/ui/libs/zome-client/src/rpc_send_sync_response_b.ts @@ -0,0 +1,19 @@ +import type { HoloHash } from '@holochain/conductor-api' +import { _b, assign } from '@ctx-core/object' +import { rpc_b } from './rpc_b' +import type { StateForSync, StateForSync_serialized_I } from './StateForSync' +export const rpc_send_sync_response_b = _b('rpc_send_sync_response', (ctx)=>{ + const rpc = rpc_b(ctx) + return function rpc_send_sync_response({ participant, state }:SendSyncResponseInput) { + const serialized_state:StateForSync_serialized_I = assign({}, state, { + deltas: state.deltas.map(delta=>JSON.stringify(delta)) + }) + return rpc('send_sync_response', { + participant, state: serialized_state + }) + } +}) +export interface SendSyncResponseInput { + participant:HoloHash + state:StateForSync +} diff --git a/ui/libs/zome-client/tsconfig.json b/ui/libs/zome-client/tsconfig.json new file mode 100644 index 00000000..4082f16a --- /dev/null +++ b/ui/libs/zome-client/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../tsconfig.json" +} diff --git a/ui/package-lock.json b/ui/package-lock.json deleted file mode 100644 index 085d6993..00000000 --- a/ui/package-lock.json +++ /dev/null @@ -1,2256 +0,0 @@ -{ - "name": "svelte-app", - "version": "1.0.0", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "svelte-app", - "version": "1.0.0", - "dependencies": { - "@holochain/conductor-api": "0.0.1", - "sirv-cli": "^1.0.11", - "svelte-fa": "^2.2.0" - }, - "devDependencies": { - "@ctx-core/object": "^17.5.8", - "@ctx-core/store": "^24.2.3", - "@rollup/plugin-commonjs": "^16.0.0", - "@rollup/plugin-node-resolve": "^10.0.0", - "@rollup/plugin-replace": "^2.4.2", - "@rollup/plugin-typescript": "^8.2.1", - "rollup": "^2.45.2", - "rollup-plugin-css-only": "^3.1.0", - "rollup-plugin-livereload": "^2.0.0", - "rollup-plugin-svelte": "^7.1.0", - "rollup-plugin-terser": "^7.0.2", - "svelte": "^3.37.0", - "svelte-preprocess": "^4.7.2", - "typescript": "^4.2.4" - } - }, - "node_modules/@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, - "dependencies": { - "@babel/highlight": "^7.10.4" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", - "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", - "dev": true - }, - "node_modules/@babel/highlight": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", - "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.10.4", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, - "node_modules/@ctx-core/array": { - "version": "20.2.10", - "resolved": "https://registry.npmjs.org/@ctx-core/array/-/array-20.2.10.tgz", - "integrity": "sha512-/YqpFwZ0f9Yh1KLm78rrVbbeq+F7LQu91P4IB3+G3/9Leg70FA+MMkSIKcvj2jDNGnmjPGQBGUiYSDeLfyff7g==", - "dev": true, - "dependencies": { - "@ctx-core/combinators": "^6.0.10", - "@ctx-core/function": "^17.4.7", - "@ctx-core/object": "^17.5.8", - "@ctx-core/set": "^9.0.18" - } - }, - "node_modules/@ctx-core/combinators": { - "version": "6.0.10", - "resolved": "https://registry.npmjs.org/@ctx-core/combinators/-/combinators-6.0.10.tgz", - "integrity": "sha512-l16FC/IsyfTOffJkRq5kZSgfnjNa8Wz7m0HpyGQu6//fcePpOvFL+HuQvXgnsMREF6DiayW03QXdStk1kCDBjw==", - "dev": true - }, - "node_modules/@ctx-core/function": { - "version": "17.4.7", - "resolved": "https://registry.npmjs.org/@ctx-core/function/-/function-17.4.7.tgz", - "integrity": "sha512-ZDASKCKnyp5/TSejfetvibyuvjdt6Dhe/JbPcvF2Hm7p+EHhTSPdNyE3EdaTZarWs63AoBllJAxsTgdhL+vs9g==", - "dev": true - }, - "node_modules/@ctx-core/object": { - "version": "17.5.8", - "resolved": "https://registry.npmjs.org/@ctx-core/object/-/object-17.5.8.tgz", - "integrity": "sha512-gvzwD6835tlm4+dAha///sEKlLJYm95SNCul8mQP8bBJlGA17RVIhApF9k/U7HW7Zn4L3XcFHH9PHdik0KGB1A==", - "dev": true, - "dependencies": { - "@ctx-core/function": "^17.4.7" - } - }, - "node_modules/@ctx-core/set": { - "version": "9.0.18", - "resolved": "https://registry.npmjs.org/@ctx-core/set/-/set-9.0.18.tgz", - "integrity": "sha512-RPT1HCPrBR/sGyisv1QN3Bc7/XbTTCKHVvpSvkR9OthPB1AHIyDpUx/vEjnJqojZ0Q0sr3GltuqQl0XAkUhO5g==", - "dev": true, - "dependencies": { - "@ctx-core/function": "^17.4.7" - } - }, - "node_modules/@ctx-core/store": { - "version": "24.2.3", - "resolved": "https://registry.npmjs.org/@ctx-core/store/-/store-24.2.3.tgz", - "integrity": "sha512-1m+VM2wKOSfhPxdQIlkzCrlnAxkJRpBvIhqtAVgsbJIHQWn/qoSbWwuXTk9OqQVWvsTiwfPoMb9euLn/5kceTQ==", - "dev": true, - "dependencies": { - "@ctx-core/array": "^20.2.10", - "@ctx-core/combinators": "^6.0.10", - "@ctx-core/function": "^17.4.7", - "@ctx-core/object": "^17.5.8", - "svelte": "3.37.0" - } - }, - "node_modules/@holochain/conductor-api": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/@holochain/conductor-api/-/conductor-api-0.0.1.tgz", - "integrity": "sha512-Vng5LG8JN1Zh7/s8OMOQKVih/Cz4zJo/6xpXnOYX148XC8bakKuaRXV08sTUWZMKElbq4BqZFTVcxJw3ouPt+w==", - "dependencies": { - "@msgpack/msgpack": "^2.1.0", - "@types/ws": "^7.2.4", - "isomorphic-ws": "^4.0.1", - "nanoid": "^3.1.9", - "ws": "^7.3.0" - } - }, - "node_modules/@holochain/conductor-api/node_modules/ws": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.4.tgz", - "integrity": "sha512-Qm8k8ojNQIMx7S+Zp8u/uHOx7Qazv3Yv4q68MiWWWOJhiwG5W3x7iqmRtJo8xxrciZUY4vRxUTJCKuRnF28ZZw==", - "engines": { - "node": ">=8.3.0" - } - }, - "node_modules/@msgpack/msgpack": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@msgpack/msgpack/-/msgpack-2.5.1.tgz", - "integrity": "sha512-l44t7u0VxuHZT5D2zCdsRbkUPkrAJMu4wyXTvHr75eXICklf38NZncRqPYA4g9t7rprPuRCPYT5+pTLihuSKRA==", - "dependencies": { - "tslib": ">=2.0.0" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/@polka/url": { - "version": "1.0.0-next.12", - "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.12.tgz", - "integrity": "sha512-6RglhutqrGFMO1MNUXp95RBuYIuc8wTnMAV5MUhLmjTOy78ncwOw7RgeQ/HeymkKXRhZd0s2DNrM1rL7unk3MQ==" - }, - "node_modules/@rollup/plugin-commonjs": { - "version": "16.0.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-16.0.0.tgz", - "integrity": "sha512-LuNyypCP3msCGVQJ7ki8PqYdpjfEkE/xtFa5DqlF+7IBD0JsfMZ87C58heSwIMint58sAUZbt3ITqOmdQv/dXw==", - "dev": true, - "dependencies": { - "@rollup/pluginutils": "^3.1.0", - "commondir": "^1.0.1", - "estree-walker": "^2.0.1", - "glob": "^7.1.6", - "is-reference": "^1.2.1", - "magic-string": "^0.25.7", - "resolve": "^1.17.0" - }, - "engines": { - "node": ">= 8.0.0" - } - }, - "node_modules/@rollup/plugin-node-resolve": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-10.0.0.tgz", - "integrity": "sha512-sNijGta8fqzwA1VwUEtTvWCx2E7qC70NMsDh4ZG13byAXYigBNZMxALhKUSycBks5gupJdq0lFrKumFrRZ8H3A==", - "dev": true, - "dependencies": { - "@rollup/pluginutils": "^3.1.0", - "@types/resolve": "1.17.1", - "builtin-modules": "^3.1.0", - "deepmerge": "^4.2.2", - "is-module": "^1.0.0", - "resolve": "^1.17.0" - }, - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/@rollup/plugin-replace": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-2.4.2.tgz", - "integrity": "sha512-IGcu+cydlUMZ5En85jxHH4qj2hta/11BHq95iHEyb2sbgiN0eCdzvUcHw5gt9pBL5lTi4JDYJ1acCoMGpTvEZg==", - "dev": true, - "dependencies": { - "@rollup/pluginutils": "^3.1.0", - "magic-string": "^0.25.7" - }, - "peerDependencies": { - "rollup": "^1.20.0 || ^2.0.0" - } - }, - "node_modules/@rollup/plugin-typescript": { - "version": "8.2.1", - "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-8.2.1.tgz", - "integrity": "sha512-Qd2E1pleDR4bwyFxqbjt4eJf+wB0UKVMLc7/BAFDGVdAXQMCsD4DUv5/7/ww47BZCYxWtJqe1Lo0KVNswBJlRw==", - "dev": true, - "dependencies": { - "@rollup/pluginutils": "^3.1.0", - "resolve": "^1.17.0" - }, - "engines": { - "node": ">=8.0.0" - }, - "peerDependencies": { - "rollup": "^2.14.0", - "tslib": "*", - "typescript": ">=3.7.0" - } - }, - "node_modules/@rollup/pluginutils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", - "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", - "dev": true, - "dependencies": { - "@types/estree": "0.0.39", - "estree-walker": "^1.0.1", - "picomatch": "^2.2.2" - }, - "engines": { - "node": ">= 8.0.0" - } - }, - "node_modules/@rollup/pluginutils/node_modules/estree-walker": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", - "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", - "dev": true - }, - "node_modules/@types/estree": { - "version": "0.0.39", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", - "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", - "dev": true - }, - "node_modules/@types/node": { - "version": "14.14.16", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.16.tgz", - "integrity": "sha512-naXYePhweTi+BMv11TgioE2/FXU4fSl29HAH1ffxVciNsH3rYXjNP2yM8wqmSm7jS20gM8TIklKiTen+1iVncw==" - }, - "node_modules/@types/pug": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@types/pug/-/pug-2.0.4.tgz", - "integrity": "sha1-h3L80EGOPNLMFxVV1zAHQVBR9LI=", - "dev": true - }, - "node_modules/@types/resolve": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", - "integrity": "sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/sass": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/@types/sass/-/sass-1.16.0.tgz", - "integrity": "sha512-2XZovu4NwcqmtZtsBR5XYLw18T8cBCnU2USFHTnYLLHz9fkhnoEMoDsqShJIOFsFhn5aJHjweiUUdTrDGujegA==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/ws": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.0.tgz", - "integrity": "sha512-Y29uQ3Uy+58bZrFLhX36hcI3Np37nqWE7ky5tjiDoy1GDZnIwVxS0CgF+s+1bXMzjKBFy+fqaRfb708iNzdinw==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/anymatch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", - "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", - "dev": true, - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/async-limiter": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", - "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", - "dev": true - }, - "node_modules/balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "node_modules/binary-extensions": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", - "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, - "node_modules/builtin-modules": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.2.0.tgz", - "integrity": "sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/chokidar": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.3.tgz", - "integrity": "sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ==", - "dev": true, - "dependencies": { - "anymatch": "~3.1.1", - "braces": "~3.0.2", - "glob-parent": "~5.1.0", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.5.0" - }, - "engines": { - "node": ">= 8.10.0" - }, - "optionalDependencies": { - "fsevents": "~2.1.2" - } - }, - "node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, - "node_modules/commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", - "dev": true - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "node_modules/console-clear": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/console-clear/-/console-clear-1.1.1.tgz", - "integrity": "sha512-pMD+MVR538ipqkG5JXeOEbKWS5um1H4LUUccUQG68qpeqBYbzYy79Gh55jkd2TtPdRfUaLWdv6LPP//5Zt0aPQ==", - "engines": { - "node": ">=4" - } - }, - "node_modules/deepmerge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/detect-indent": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.0.0.tgz", - "integrity": "sha512-oSyFlqaTHCItVRGK5RmrmjB+CmaMOW7IaNA/kdxqhoa6d17j/5ce9O9eWXmV/KEdRwqpQA+Vqe8a8Bsybu4YnA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/estree-walker": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", - "dev": true - }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "node_modules/fsevents": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", - "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "node_modules/get-port": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz", - "integrity": "sha1-3Xzn3hh8Bsi/NTeWrHHgmfCYDrw=", - "engines": { - "node": ">=4" - } - }, - "node_modules/glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - } - }, - "node_modules/glob-parent": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", - "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-core-module": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", - "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", - "dev": true, - "dependencies": { - "has": "^1.0.3" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", - "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=", - "dev": true - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/is-reference": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", - "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", - "dev": true, - "dependencies": { - "@types/estree": "*" - } - }, - "node_modules/isomorphic-ws": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", - "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==" - }, - "node_modules/jest-worker": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", - "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", - "dev": true, - "dependencies": { - "@types/node": "*", - "merge-stream": "^2.0.0", - "supports-color": "^7.0.0" - }, - "engines": { - "node": ">= 10.13.0" - } - }, - "node_modules/jest-worker/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-worker/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "node_modules/kleur": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", - "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", - "engines": { - "node": ">=6" - } - }, - "node_modules/livereload": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/livereload/-/livereload-0.9.1.tgz", - "integrity": "sha512-9g7sua11kkyZNo2hLRCG3LuZZwqexoyEyecSlV8cAsfAVVCZqLzVir6XDqmH0r+Vzgnd5LrdHDMyjtFnJQLAYw==", - "dev": true, - "dependencies": { - "chokidar": "^3.3.0", - "livereload-js": "^3.1.0", - "opts": ">= 1.2.0", - "ws": "^6.2.1" - }, - "bin": { - "livereload": "bin/livereload.js" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/livereload-js": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/livereload-js/-/livereload-js-3.3.1.tgz", - "integrity": "sha512-CBu1gTEfzVhlOK1WASKAAJ9Qx1fHECTq0SUB67sfxwQssopTyvzqTlgl+c0h9pZ6V+Fzd2rc510ppuNusg9teQ==", - "dev": true - }, - "node_modules/local-access": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/local-access/-/local-access-1.1.0.tgz", - "integrity": "sha512-XfegD5pyTAfb+GY6chk283Ox5z8WexG56OvM06RWLpAc/UHozO8X6xAxEkIitZOtsSMM1Yr3DkHgW5W+onLhCw==", - "engines": { - "node": ">=6" - } - }, - "node_modules/magic-string": { - "version": "0.25.7", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", - "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", - "dev": true, - "dependencies": { - "sourcemap-codec": "^1.4.4" - } - }, - "node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true - }, - "node_modules/mime": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.5.2.tgz", - "integrity": "sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg==", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/min-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", - "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/mri": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.6.tgz", - "integrity": "sha512-oi1b3MfbyGa7FJMP9GmLTttni5JoICpYBRlq+x5V16fZbLsnL9N3wFqqIm/nIG43FjUFkFh9Epzp/kzUGUnJxQ==", - "engines": { - "node": ">=4" - } - }, - "node_modules/nanoid": { - "version": "3.1.22", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.22.tgz", - "integrity": "sha512-/2ZUaJX2ANuLtTvqTlgqBQNJoQO398KyJgZloL0PZkC0dpysjncRUPsFe3DUPzz/y3h+u7C46np8RMuvF3jsSQ==", - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/opts": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/opts/-/opts-2.0.2.tgz", - "integrity": "sha512-k41FwbcLnlgnFh69f4qdUfvDQ+5vaSDnVPFI/y5XuhKRq97EnVVneO9F1ESVCdiVu4fCS2L8usX3mU331hB7pg==", - "dev": true - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "dev": true - }, - "node_modules/picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", - "dev": true, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "dependencies": { - "safe-buffer": "^5.1.0" - } - }, - "node_modules/readdirp": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", - "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", - "dev": true, - "dependencies": { - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8.10.0" - } - }, - "node_modules/require-relative": { - "version": "0.8.7", - "resolved": "https://registry.npmjs.org/require-relative/-/require-relative-0.8.7.tgz", - "integrity": "sha1-eZlTn8ngR6N5KPoZb44VY9q9Nt4=", - "dev": true - }, - "node_modules/resolve": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", - "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", - "dev": true, - "dependencies": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/rollup": { - "version": "2.45.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.45.2.tgz", - "integrity": "sha512-kRRU7wXzFHUzBIv0GfoFFIN3m9oteY4uAsKllIpQDId5cfnkWF2J130l+27dzDju0E6MScKiV0ZM5Bw8m4blYQ==", - "dev": true, - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=10.0.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.1" - } - }, - "node_modules/rollup-plugin-css-only": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-css-only/-/rollup-plugin-css-only-3.1.0.tgz", - "integrity": "sha512-TYMOE5uoD76vpj+RTkQLzC9cQtbnJNktHPB507FzRWBVaofg7KhIqq1kGbcVOadARSozWF883Ho9KpSPKH8gqA==", - "dev": true, - "dependencies": { - "@rollup/pluginutils": "4" - }, - "engines": { - "node": ">=10.12.0" - } - }, - "node_modules/rollup-plugin-css-only/node_modules/@rollup/pluginutils": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.1.0.tgz", - "integrity": "sha512-TrBhfJkFxA+ER+ew2U2/fHbebhLT/l/2pRk0hfj9KusXUuRXd2v0R58AfaZK9VXDQ4TogOSEmICVrQAA3zFnHQ==", - "dev": true, - "dependencies": { - "estree-walker": "^2.0.1", - "picomatch": "^2.2.2" - }, - "engines": { - "node": ">= 8.0.0" - } - }, - "node_modules/rollup-plugin-livereload": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-livereload/-/rollup-plugin-livereload-2.0.0.tgz", - "integrity": "sha512-oC/8NqumGYuphkqrfszOHUUIwzKsaHBICw6QRwT5uD07gvePTS+HW+GFwu6f9K8W02CUuTvtIM9AWJrbj4wE1A==", - "dev": true, - "dependencies": { - "livereload": "^0.9.1" - }, - "engines": { - "node": ">=8.3" - } - }, - "node_modules/rollup-plugin-svelte": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-svelte/-/rollup-plugin-svelte-7.1.0.tgz", - "integrity": "sha512-vopCUq3G+25sKjwF5VilIbiY6KCuMNHP1PFvx2Vr3REBNMDllKHFZN2B9jwwC+MqNc3UPKkjXnceLPEjTjXGXg==", - "dev": true, - "dependencies": { - "require-relative": "^0.8.7", - "rollup-pluginutils": "^2.8.2" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "rollup": ">=2.0.0", - "svelte": ">=3.5.0" - } - }, - "node_modules/rollup-plugin-terser": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz", - "integrity": "sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.10.4", - "jest-worker": "^26.2.1", - "serialize-javascript": "^4.0.0", - "terser": "^5.0.0" - } - }, - "node_modules/rollup-pluginutils": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", - "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==", - "dev": true, - "dependencies": { - "estree-walker": "^0.6.1" - } - }, - "node_modules/rollup-pluginutils/node_modules/estree-walker": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", - "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", - "dev": true - }, - "node_modules/rollup/node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/sade": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/sade/-/sade-1.7.4.tgz", - "integrity": "sha512-y5yauMD93rX840MwUJr7C1ysLFBgMspsdTo4UVrDg3fXDvtwOyIqykhVAAm6fk/3au77773itJStObgK+LKaiA==", - "dependencies": { - "mri": "^1.1.0" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true - }, - "node_modules/semiver": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/semiver/-/semiver-1.1.0.tgz", - "integrity": "sha512-QNI2ChmuioGC1/xjyYwyZYADILWyW6AmS1UH6gDj/SFUUUS4MBAWs/7mxnkRPc/F4iHezDP+O8t0dO8WHiEOdg==", - "engines": { - "node": ">=6" - } - }, - "node_modules/serialize-javascript": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", - "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", - "dev": true, - "dependencies": { - "randombytes": "^2.1.0" - } - }, - "node_modules/sirv": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/sirv/-/sirv-1.0.11.tgz", - "integrity": "sha512-SR36i3/LSWja7AJNRBz4fF/Xjpn7lQFI30tZ434dIy+bitLYSP+ZEenHg36i23V2SGEz+kqjksg0uOGZ5LPiqg==", - "dependencies": { - "@polka/url": "^1.0.0-next.9", - "mime": "^2.3.1", - "totalist": "^1.0.0" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/sirv-cli": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/sirv-cli/-/sirv-cli-1.0.11.tgz", - "integrity": "sha512-L8NILoRSBd38VcfFcERYCaVCnWPBLo9G6u/a37UJ8Ysv4DfjizMbFBcM+SswNnndJienhR6qy8KFuAEaeL4g8Q==", - "dependencies": { - "console-clear": "^1.1.0", - "get-port": "^3.2.0", - "kleur": "^3.0.0", - "local-access": "^1.0.1", - "sade": "^1.6.0", - "semiver": "^1.0.0", - "sirv": "^1.0.11", - "tinydate": "^1.0.0" - }, - "bin": { - "sirv": "bin.js" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", - "dev": true, - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "node_modules/source-map-support/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sourcemap-codec": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", - "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", - "dev": true - }, - "node_modules/strip-indent": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", - "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", - "dev": true, - "dependencies": { - "min-indent": "^1.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/svelte": { - "version": "3.37.0", - "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.37.0.tgz", - "integrity": "sha512-TRF30F4W4+d+Jr2KzUUL1j8Mrpns/WM/WacxYlo5MMb2E5Qy2Pk1Guj6GylxsW9OnKQl1tnF8q3hG/hQ3h6VUA==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/svelte-fa": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/svelte-fa/-/svelte-fa-2.2.0.tgz", - "integrity": "sha512-PN1H8AWDh+OwhwjJKTv4/zXvKvmvOEVSCVhIhji6Onx8XEw+CGf8BDR0BVUIp87IEX+DEqIo9pbyhgz8EoYZyA==" - }, - "node_modules/svelte-preprocess": { - "version": "4.7.2", - "resolved": "https://registry.npmjs.org/svelte-preprocess/-/svelte-preprocess-4.7.2.tgz", - "integrity": "sha512-EToG+08rEsA33btv+C5g2qnRArwpTc5AoU0QBB3ZEkYagxAb2yPNsy0qsmtvbJOTBMy6o3oyijDdl3DMpMvpEg==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "@types/pug": "^2.0.4", - "@types/sass": "^1.16.0", - "detect-indent": "^6.0.0", - "strip-indent": "^3.0.0" - }, - "engines": { - "node": ">= 9.11.2" - }, - "peerDependencies": { - "@babel/core": "^7.10.2", - "coffeescript": "^2.5.1", - "less": "^3.11.3", - "postcss": "^7 || ^8", - "postcss-load-config": "^2.1.0 || ^3.0.0", - "pug": "^3.0.0", - "sass": "^1.26.8", - "stylus": "^0.54.7", - "sugarss": "^2.0.0", - "svelte": "^3.23.0", - "typescript": "^3.9.5 || ^4.0.0" - }, - "peerDependenciesMeta": { - "@babel/core": { - "optional": true - }, - "coffeescript": { - "optional": true - }, - "less": { - "optional": true - }, - "node-sass": { - "optional": true - }, - "postcss": { - "optional": true - }, - "postcss-load-config": { - "optional": true - }, - "pug": { - "optional": true - }, - "sass": { - "optional": true - }, - "stylus": { - "optional": true - }, - "sugarss": { - "optional": true - }, - "typescript": { - "optional": true - } - } - }, - "node_modules/terser": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.5.1.tgz", - "integrity": "sha512-6VGWZNVP2KTUcltUQJ25TtNjx/XgdDsBDKGt8nN0MpydU36LmbPPcMBd2kmtZNNGVVDLg44k7GKeHHj+4zPIBQ==", - "dev": true, - "dependencies": { - "commander": "^2.20.0", - "source-map": "~0.7.2", - "source-map-support": "~0.5.19" - }, - "bin": { - "terser": "bin/terser" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/tinydate": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/tinydate/-/tinydate-1.3.0.tgz", - "integrity": "sha512-7cR8rLy2QhYHpsBDBVYnnWXm8uRTr38RoZakFSW7Bs7PzfMPNZthuMLkwqZv7MTu8lhQ91cOFYS5a7iFj2oR3w==", - "engines": { - "node": ">=4" - } - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/totalist": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/totalist/-/totalist-1.1.0.tgz", - "integrity": "sha512-gduQwd1rOdDMGxFG1gEvhV88Oirdo2p+KjoYFU7k2g+i7n6AFFbDQ5kMPUsW0pNbfQsB/cwXvT1i4Bue0s9g5g==", - "engines": { - "node": ">=6" - } - }, - "node_modules/tslib": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz", - "integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==" - }, - "node_modules/typescript": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", - "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=4.2.0" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "node_modules/ws": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", - "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", - "dev": true, - "dependencies": { - "async-limiter": "~1.0.0" - } - } - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, - "requires": { - "@babel/highlight": "^7.10.4" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", - "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", - "dev": true - }, - "@babel/highlight": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", - "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.10.4", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, - "@ctx-core/array": { - "version": "20.2.10", - "resolved": "https://registry.npmjs.org/@ctx-core/array/-/array-20.2.10.tgz", - "integrity": "sha512-/YqpFwZ0f9Yh1KLm78rrVbbeq+F7LQu91P4IB3+G3/9Leg70FA+MMkSIKcvj2jDNGnmjPGQBGUiYSDeLfyff7g==", - "dev": true, - "requires": { - "@ctx-core/combinators": "^6.0.10", - "@ctx-core/function": "^17.4.7", - "@ctx-core/object": "^17.5.8", - "@ctx-core/set": "^9.0.18" - } - }, - "@ctx-core/combinators": { - "version": "6.0.10", - "resolved": "https://registry.npmjs.org/@ctx-core/combinators/-/combinators-6.0.10.tgz", - "integrity": "sha512-l16FC/IsyfTOffJkRq5kZSgfnjNa8Wz7m0HpyGQu6//fcePpOvFL+HuQvXgnsMREF6DiayW03QXdStk1kCDBjw==", - "dev": true - }, - "@ctx-core/function": { - "version": "17.4.7", - "resolved": "https://registry.npmjs.org/@ctx-core/function/-/function-17.4.7.tgz", - "integrity": "sha512-ZDASKCKnyp5/TSejfetvibyuvjdt6Dhe/JbPcvF2Hm7p+EHhTSPdNyE3EdaTZarWs63AoBllJAxsTgdhL+vs9g==", - "dev": true - }, - "@ctx-core/object": { - "version": "17.5.8", - "resolved": "https://registry.npmjs.org/@ctx-core/object/-/object-17.5.8.tgz", - "integrity": "sha512-gvzwD6835tlm4+dAha///sEKlLJYm95SNCul8mQP8bBJlGA17RVIhApF9k/U7HW7Zn4L3XcFHH9PHdik0KGB1A==", - "dev": true, - "requires": { - "@ctx-core/function": "^17.4.7" - } - }, - "@ctx-core/set": { - "version": "9.0.18", - "resolved": "https://registry.npmjs.org/@ctx-core/set/-/set-9.0.18.tgz", - "integrity": "sha512-RPT1HCPrBR/sGyisv1QN3Bc7/XbTTCKHVvpSvkR9OthPB1AHIyDpUx/vEjnJqojZ0Q0sr3GltuqQl0XAkUhO5g==", - "dev": true, - "requires": { - "@ctx-core/function": "^17.4.7" - } - }, - "@ctx-core/store": { - "version": "24.2.3", - "resolved": "https://registry.npmjs.org/@ctx-core/store/-/store-24.2.3.tgz", - "integrity": "sha512-1m+VM2wKOSfhPxdQIlkzCrlnAxkJRpBvIhqtAVgsbJIHQWn/qoSbWwuXTk9OqQVWvsTiwfPoMb9euLn/5kceTQ==", - "dev": true, - "requires": { - "@ctx-core/array": "^20.2.10", - "@ctx-core/combinators": "^6.0.10", - "@ctx-core/function": "^17.4.7", - "@ctx-core/object": "^17.5.8", - "svelte": "3.37.0" - } - }, - "@holochain/conductor-api": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/@holochain/conductor-api/-/conductor-api-0.0.1.tgz", - "integrity": "sha512-Vng5LG8JN1Zh7/s8OMOQKVih/Cz4zJo/6xpXnOYX148XC8bakKuaRXV08sTUWZMKElbq4BqZFTVcxJw3ouPt+w==", - "requires": { - "@msgpack/msgpack": "^2.1.0", - "@types/ws": "^7.2.4", - "isomorphic-ws": "^4.0.1", - "nanoid": "^3.1.9", - "ws": "^7.3.0" - }, - "dependencies": { - "ws": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.4.tgz", - "integrity": "sha512-Qm8k8ojNQIMx7S+Zp8u/uHOx7Qazv3Yv4q68MiWWWOJhiwG5W3x7iqmRtJo8xxrciZUY4vRxUTJCKuRnF28ZZw==" - } - } - }, - "@msgpack/msgpack": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@msgpack/msgpack/-/msgpack-2.5.1.tgz", - "integrity": "sha512-l44t7u0VxuHZT5D2zCdsRbkUPkrAJMu4wyXTvHr75eXICklf38NZncRqPYA4g9t7rprPuRCPYT5+pTLihuSKRA==", - "requires": { - "tslib": ">=2.0.0" - } - }, - "@polka/url": { - "version": "1.0.0-next.12", - "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.12.tgz", - "integrity": "sha512-6RglhutqrGFMO1MNUXp95RBuYIuc8wTnMAV5MUhLmjTOy78ncwOw7RgeQ/HeymkKXRhZd0s2DNrM1rL7unk3MQ==" - }, - "@rollup/plugin-commonjs": { - "version": "16.0.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-16.0.0.tgz", - "integrity": "sha512-LuNyypCP3msCGVQJ7ki8PqYdpjfEkE/xtFa5DqlF+7IBD0JsfMZ87C58heSwIMint58sAUZbt3ITqOmdQv/dXw==", - "dev": true, - "requires": { - "@rollup/pluginutils": "^3.1.0", - "commondir": "^1.0.1", - "estree-walker": "^2.0.1", - "glob": "^7.1.6", - "is-reference": "^1.2.1", - "magic-string": "^0.25.7", - "resolve": "^1.17.0" - } - }, - "@rollup/plugin-node-resolve": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-10.0.0.tgz", - "integrity": "sha512-sNijGta8fqzwA1VwUEtTvWCx2E7qC70NMsDh4ZG13byAXYigBNZMxALhKUSycBks5gupJdq0lFrKumFrRZ8H3A==", - "dev": true, - "requires": { - "@rollup/pluginutils": "^3.1.0", - "@types/resolve": "1.17.1", - "builtin-modules": "^3.1.0", - "deepmerge": "^4.2.2", - "is-module": "^1.0.0", - "resolve": "^1.17.0" - } - }, - "@rollup/plugin-replace": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-2.4.2.tgz", - "integrity": "sha512-IGcu+cydlUMZ5En85jxHH4qj2hta/11BHq95iHEyb2sbgiN0eCdzvUcHw5gt9pBL5lTi4JDYJ1acCoMGpTvEZg==", - "dev": true, - "requires": { - "@rollup/pluginutils": "^3.1.0", - "magic-string": "^0.25.7" - } - }, - "@rollup/plugin-typescript": { - "version": "8.2.1", - "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-8.2.1.tgz", - "integrity": "sha512-Qd2E1pleDR4bwyFxqbjt4eJf+wB0UKVMLc7/BAFDGVdAXQMCsD4DUv5/7/ww47BZCYxWtJqe1Lo0KVNswBJlRw==", - "dev": true, - "requires": { - "@rollup/pluginutils": "^3.1.0", - "resolve": "^1.17.0" - } - }, - "@rollup/pluginutils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", - "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", - "dev": true, - "requires": { - "@types/estree": "0.0.39", - "estree-walker": "^1.0.1", - "picomatch": "^2.2.2" - }, - "dependencies": { - "estree-walker": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", - "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", - "dev": true - } - } - }, - "@types/estree": { - "version": "0.0.39", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", - "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", - "dev": true - }, - "@types/node": { - "version": "14.14.16", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.16.tgz", - "integrity": "sha512-naXYePhweTi+BMv11TgioE2/FXU4fSl29HAH1ffxVciNsH3rYXjNP2yM8wqmSm7jS20gM8TIklKiTen+1iVncw==" - }, - "@types/pug": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@types/pug/-/pug-2.0.4.tgz", - "integrity": "sha1-h3L80EGOPNLMFxVV1zAHQVBR9LI=", - "dev": true - }, - "@types/resolve": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", - "integrity": "sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/sass": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/@types/sass/-/sass-1.16.0.tgz", - "integrity": "sha512-2XZovu4NwcqmtZtsBR5XYLw18T8cBCnU2USFHTnYLLHz9fkhnoEMoDsqShJIOFsFhn5aJHjweiUUdTrDGujegA==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/ws": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.0.tgz", - "integrity": "sha512-Y29uQ3Uy+58bZrFLhX36hcI3Np37nqWE7ky5tjiDoy1GDZnIwVxS0CgF+s+1bXMzjKBFy+fqaRfb708iNzdinw==", - "requires": { - "@types/node": "*" - } - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "anymatch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", - "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", - "dev": true, - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } - }, - "async-limiter": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", - "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", - "dev": true - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "binary-extensions": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", - "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, - "builtin-modules": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.2.0.tgz", - "integrity": "sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA==", - "dev": true - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "chokidar": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.3.tgz", - "integrity": "sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ==", - "dev": true, - "requires": { - "anymatch": "~3.1.1", - "braces": "~3.0.2", - "fsevents": "~2.1.2", - "glob-parent": "~5.1.0", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.5.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, - "commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "console-clear": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/console-clear/-/console-clear-1.1.1.tgz", - "integrity": "sha512-pMD+MVR538ipqkG5JXeOEbKWS5um1H4LUUccUQG68qpeqBYbzYy79Gh55jkd2TtPdRfUaLWdv6LPP//5Zt0aPQ==" - }, - "deepmerge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", - "dev": true - }, - "detect-indent": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.0.0.tgz", - "integrity": "sha512-oSyFlqaTHCItVRGK5RmrmjB+CmaMOW7IaNA/kdxqhoa6d17j/5ce9O9eWXmV/KEdRwqpQA+Vqe8a8Bsybu4YnA==", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "estree-walker": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", - "dev": true - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "fsevents": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", - "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", - "dev": true, - "optional": true - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "get-port": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz", - "integrity": "sha1-3Xzn3hh8Bsi/NTeWrHHgmfCYDrw=" - }, - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", - "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "requires": { - "binary-extensions": "^2.0.0" - } - }, - "is-core-module": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", - "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", - "dev": true, - "requires": { - "has": "^1.0.3" - } - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", - "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=", - "dev": true - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "is-reference": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", - "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", - "dev": true, - "requires": { - "@types/estree": "*" - } - }, - "isomorphic-ws": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", - "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==" - }, - "jest-worker": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", - "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", - "dev": true, - "requires": { - "@types/node": "*", - "merge-stream": "^2.0.0", - "supports-color": "^7.0.0" - }, - "dependencies": { - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "kleur": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", - "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==" - }, - "livereload": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/livereload/-/livereload-0.9.1.tgz", - "integrity": "sha512-9g7sua11kkyZNo2hLRCG3LuZZwqexoyEyecSlV8cAsfAVVCZqLzVir6XDqmH0r+Vzgnd5LrdHDMyjtFnJQLAYw==", - "dev": true, - "requires": { - "chokidar": "^3.3.0", - "livereload-js": "^3.1.0", - "opts": ">= 1.2.0", - "ws": "^6.2.1" - } - }, - "livereload-js": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/livereload-js/-/livereload-js-3.3.1.tgz", - "integrity": "sha512-CBu1gTEfzVhlOK1WASKAAJ9Qx1fHECTq0SUB67sfxwQssopTyvzqTlgl+c0h9pZ6V+Fzd2rc510ppuNusg9teQ==", - "dev": true - }, - "local-access": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/local-access/-/local-access-1.1.0.tgz", - "integrity": "sha512-XfegD5pyTAfb+GY6chk283Ox5z8WexG56OvM06RWLpAc/UHozO8X6xAxEkIitZOtsSMM1Yr3DkHgW5W+onLhCw==" - }, - "magic-string": { - "version": "0.25.7", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", - "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", - "dev": true, - "requires": { - "sourcemap-codec": "^1.4.4" - } - }, - "merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true - }, - "mime": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.5.2.tgz", - "integrity": "sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg==" - }, - "min-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", - "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", - "dev": true - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "mri": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.6.tgz", - "integrity": "sha512-oi1b3MfbyGa7FJMP9GmLTttni5JoICpYBRlq+x5V16fZbLsnL9N3wFqqIm/nIG43FjUFkFh9Epzp/kzUGUnJxQ==" - }, - "nanoid": { - "version": "3.1.22", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.22.tgz", - "integrity": "sha512-/2ZUaJX2ANuLtTvqTlgqBQNJoQO398KyJgZloL0PZkC0dpysjncRUPsFe3DUPzz/y3h+u7C46np8RMuvF3jsSQ==" - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "opts": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/opts/-/opts-2.0.2.tgz", - "integrity": "sha512-k41FwbcLnlgnFh69f4qdUfvDQ+5vaSDnVPFI/y5XuhKRq97EnVVneO9F1ESVCdiVu4fCS2L8usX3mU331hB7pg==", - "dev": true - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "dev": true - }, - "picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", - "dev": true - }, - "randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "requires": { - "safe-buffer": "^5.1.0" - } - }, - "readdirp": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", - "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", - "dev": true, - "requires": { - "picomatch": "^2.2.1" - } - }, - "require-relative": { - "version": "0.8.7", - "resolved": "https://registry.npmjs.org/require-relative/-/require-relative-0.8.7.tgz", - "integrity": "sha1-eZlTn8ngR6N5KPoZb44VY9q9Nt4=", - "dev": true - }, - "resolve": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", - "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", - "dev": true, - "requires": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" - } - }, - "rollup": { - "version": "2.45.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.45.2.tgz", - "integrity": "sha512-kRRU7wXzFHUzBIv0GfoFFIN3m9oteY4uAsKllIpQDId5cfnkWF2J130l+27dzDju0E6MScKiV0ZM5Bw8m4blYQ==", - "dev": true, - "requires": { - "fsevents": "~2.3.1" - }, - "dependencies": { - "fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "optional": true - } - } - }, - "rollup-plugin-css-only": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-css-only/-/rollup-plugin-css-only-3.1.0.tgz", - "integrity": "sha512-TYMOE5uoD76vpj+RTkQLzC9cQtbnJNktHPB507FzRWBVaofg7KhIqq1kGbcVOadARSozWF883Ho9KpSPKH8gqA==", - "dev": true, - "requires": { - "@rollup/pluginutils": "4" - }, - "dependencies": { - "@rollup/pluginutils": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.1.0.tgz", - "integrity": "sha512-TrBhfJkFxA+ER+ew2U2/fHbebhLT/l/2pRk0hfj9KusXUuRXd2v0R58AfaZK9VXDQ4TogOSEmICVrQAA3zFnHQ==", - "dev": true, - "requires": { - "estree-walker": "^2.0.1", - "picomatch": "^2.2.2" - } - } - } - }, - "rollup-plugin-livereload": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-livereload/-/rollup-plugin-livereload-2.0.0.tgz", - "integrity": "sha512-oC/8NqumGYuphkqrfszOHUUIwzKsaHBICw6QRwT5uD07gvePTS+HW+GFwu6f9K8W02CUuTvtIM9AWJrbj4wE1A==", - "dev": true, - "requires": { - "livereload": "^0.9.1" - } - }, - "rollup-plugin-svelte": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-svelte/-/rollup-plugin-svelte-7.1.0.tgz", - "integrity": "sha512-vopCUq3G+25sKjwF5VilIbiY6KCuMNHP1PFvx2Vr3REBNMDllKHFZN2B9jwwC+MqNc3UPKkjXnceLPEjTjXGXg==", - "dev": true, - "requires": { - "require-relative": "^0.8.7", - "rollup-pluginutils": "^2.8.2" - } - }, - "rollup-plugin-terser": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz", - "integrity": "sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.10.4", - "jest-worker": "^26.2.1", - "serialize-javascript": "^4.0.0", - "terser": "^5.0.0" - } - }, - "rollup-pluginutils": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", - "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==", - "dev": true, - "requires": { - "estree-walker": "^0.6.1" - }, - "dependencies": { - "estree-walker": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", - "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", - "dev": true - } - } - }, - "sade": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/sade/-/sade-1.7.4.tgz", - "integrity": "sha512-y5yauMD93rX840MwUJr7C1ysLFBgMspsdTo4UVrDg3fXDvtwOyIqykhVAAm6fk/3au77773itJStObgK+LKaiA==", - "requires": { - "mri": "^1.1.0" - } - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true - }, - "semiver": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/semiver/-/semiver-1.1.0.tgz", - "integrity": "sha512-QNI2ChmuioGC1/xjyYwyZYADILWyW6AmS1UH6gDj/SFUUUS4MBAWs/7mxnkRPc/F4iHezDP+O8t0dO8WHiEOdg==" - }, - "serialize-javascript": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", - "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", - "dev": true, - "requires": { - "randombytes": "^2.1.0" - } - }, - "sirv": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/sirv/-/sirv-1.0.11.tgz", - "integrity": "sha512-SR36i3/LSWja7AJNRBz4fF/Xjpn7lQFI30tZ434dIy+bitLYSP+ZEenHg36i23V2SGEz+kqjksg0uOGZ5LPiqg==", - "requires": { - "@polka/url": "^1.0.0-next.9", - "mime": "^2.3.1", - "totalist": "^1.0.0" - } - }, - "sirv-cli": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/sirv-cli/-/sirv-cli-1.0.11.tgz", - "integrity": "sha512-L8NILoRSBd38VcfFcERYCaVCnWPBLo9G6u/a37UJ8Ysv4DfjizMbFBcM+SswNnndJienhR6qy8KFuAEaeL4g8Q==", - "requires": { - "console-clear": "^1.1.0", - "get-port": "^3.2.0", - "kleur": "^3.0.0", - "local-access": "^1.0.1", - "sade": "^1.6.0", - "semiver": "^1.0.0", - "sirv": "^1.0.11", - "tinydate": "^1.0.0" - } - }, - "source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", - "dev": true - }, - "source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "sourcemap-codec": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", - "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", - "dev": true - }, - "strip-indent": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", - "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", - "dev": true, - "requires": { - "min-indent": "^1.0.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "svelte": { - "version": "3.37.0", - "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.37.0.tgz", - "integrity": "sha512-TRF30F4W4+d+Jr2KzUUL1j8Mrpns/WM/WacxYlo5MMb2E5Qy2Pk1Guj6GylxsW9OnKQl1tnF8q3hG/hQ3h6VUA==", - "dev": true - }, - "svelte-fa": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/svelte-fa/-/svelte-fa-2.2.0.tgz", - "integrity": "sha512-PN1H8AWDh+OwhwjJKTv4/zXvKvmvOEVSCVhIhji6Onx8XEw+CGf8BDR0BVUIp87IEX+DEqIo9pbyhgz8EoYZyA==" - }, - "svelte-preprocess": { - "version": "4.7.2", - "resolved": "https://registry.npmjs.org/svelte-preprocess/-/svelte-preprocess-4.7.2.tgz", - "integrity": "sha512-EToG+08rEsA33btv+C5g2qnRArwpTc5AoU0QBB3ZEkYagxAb2yPNsy0qsmtvbJOTBMy6o3oyijDdl3DMpMvpEg==", - "dev": true, - "requires": { - "@types/pug": "^2.0.4", - "@types/sass": "^1.16.0", - "detect-indent": "^6.0.0", - "strip-indent": "^3.0.0" - } - }, - "terser": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.5.1.tgz", - "integrity": "sha512-6VGWZNVP2KTUcltUQJ25TtNjx/XgdDsBDKGt8nN0MpydU36LmbPPcMBd2kmtZNNGVVDLg44k7GKeHHj+4zPIBQ==", - "dev": true, - "requires": { - "commander": "^2.20.0", - "source-map": "~0.7.2", - "source-map-support": "~0.5.19" - } - }, - "tinydate": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/tinydate/-/tinydate-1.3.0.tgz", - "integrity": "sha512-7cR8rLy2QhYHpsBDBVYnnWXm8uRTr38RoZakFSW7Bs7PzfMPNZthuMLkwqZv7MTu8lhQ91cOFYS5a7iFj2oR3w==" - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, - "totalist": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/totalist/-/totalist-1.1.0.tgz", - "integrity": "sha512-gduQwd1rOdDMGxFG1gEvhV88Oirdo2p+KjoYFU7k2g+i7n6AFFbDQ5kMPUsW0pNbfQsB/cwXvT1i4Bue0s9g5g==" - }, - "tslib": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz", - "integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==" - }, - "typescript": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", - "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", - "dev": true - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "ws": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", - "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", - "dev": true, - "requires": { - "async-limiter": "~1.0.0" - } - } - } -} diff --git a/ui/package.json b/ui/package.json index b9f1dc25..2dbd3acf 100644 --- a/ui/package.json +++ b/ui/package.json @@ -1,30 +1,6 @@ { - "name": "@holochain/syn-ui", - "version": "1.0.0", - "scripts": { - "build": "rollup -c", - "dev": "rollup -c -w", - "start": "sirv public" - }, - "dependencies": { - "@holochain/conductor-api": "0.0.1", - "sirv-cli": "^1.0.11", - "svelte-fa": "^2.2.0" - }, - "devDependencies": { - "@ctx-core/object": "^17.5.8", - "@ctx-core/store": "^24.2.3", - "@rollup/plugin-commonjs": "^16.0.0", - "@rollup/plugin-node-resolve": "^10.0.0", - "@rollup/plugin-replace": "^2.4.2", - "@rollup/plugin-typescript": "^8.2.1", - "rollup": "^2.45.2", - "rollup-plugin-css-only": "^3.1.0", - "rollup-plugin-livereload": "^2.0.0", - "rollup-plugin-svelte": "^7.1.0", - "rollup-plugin-terser": "^7.0.2", - "svelte": "^3.37.0", - "svelte-preprocess": "^4.7.2", - "typescript": "^4.2.4" - } + "devDependencies": { + "@holochain/conductor-api": "^0.0.3", + "@syn-ui/utils": "workspace:^1.0.0" + } } diff --git a/ui/src/StateForSync.ts b/ui/src/StateForSync.ts deleted file mode 100644 index ca9629e5..00000000 --- a/ui/src/StateForSync.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { HoloHash } from '@holochain/conductor-api' -import type { DeltaValue } from './delta' -export interface StateForSync { - snapshot: HoloHash, - commit: HoloHash, - deltas: DeltaValue[], -} diff --git a/ui/src/connection/connection_b.ts b/ui/src/connection/connection_b.ts deleted file mode 100644 index 83a74226..00000000 --- a/ui/src/connection/connection_b.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { _b, B } from '@ctx-core/object' -import { writable, Writable } from '@ctx-core/store' -import type { Connection } from './Connection' -export const connection_b:connection_b_T = _b('connection', ()=>{ - return writable(null) -}) -export type $connection = Connection -export interface connection_T extends Writable<$connection> {} -export interface connection_b_T extends B<connection_T> {} diff --git a/ui/src/connection/index.ts b/ui/src/connection/index.ts deleted file mode 100644 index dd5ab892..00000000 --- a/ui/src/connection/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './Connection' -export * from './connection_b' diff --git a/ui/src/content/content_b.ts b/ui/src/content/content_b.ts deleted file mode 100644 index ea48bba4..00000000 --- a/ui/src/content/content_b.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { _b, B } from '@ctx-core/object' -import { writable, Writable } from '@ctx-core/store' -export const content_b:content_b_T = _b('content', ()=>{ - return writable({ title: '', body: '' }) as content_T -}) -export interface $content_T { - title:string - body:string - meta?:Record<string, number> -} -export interface content_T extends Writable<$content_T> {} -export interface content_b_T extends B<content_T> {} diff --git a/ui/src/delta/ApplyDelta.ts b/ui/src/delta/ApplyDelta.ts deleted file mode 100644 index 0c052029..00000000 --- a/ui/src/delta/ApplyDelta.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { Delta } from './Delta' -import type { Content } from '../content' -export interface ApplyDelta { - delta:Delta - deleted?:applyDelta_ret_deleted_T - id?:string - at?:number -} -export type applyDelta_ret_deleted_T = string|[string, number] -export type applyDelta_ret_T = [Content, ApplyDelta] -export type applyDelta_T = (content:Content, delta:Delta)=>applyDelta_ret_T diff --git a/ui/src/delta/committedChanges_b.ts b/ui/src/delta/committedChanges_b.ts deleted file mode 100644 index 76c773a9..00000000 --- a/ui/src/delta/committedChanges_b.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { _b, B } from '@ctx-core/object' -import { writable, Writable } from '@ctx-core/store' -import type { ApplyDelta } from './ApplyDelta' -export const committedChanges_b:committedChanges_b_T = _b('committedChanges', ()=>{ - return writable([]) as committedChanges_T -}) -export type $committedChanges_T = ApplyDelta[] -export interface committedChanges_T extends Writable<$committedChanges_T> {} -export interface committedChanges_b_T extends B<committedChanges_T> {} diff --git a/ui/src/delta/index.ts b/ui/src/delta/index.ts deleted file mode 100644 index 871d7cee..00000000 --- a/ui/src/delta/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from './ApplyDelta' -export * from './Delta' -export * from './committedChanges_b' -export * from './nextIndex_b' -export * from './recordedChanges_b' -export * from './requestedChanges_b' -export * from './requestedChanges_b' diff --git a/ui/src/delta/nextIndex_b.ts b/ui/src/delta/nextIndex_b.ts deleted file mode 100644 index b10d703c..00000000 --- a/ui/src/delta/nextIndex_b.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { derived } from '@ctx-core/store' -import { _b } from '@ctx-core/object' -import { recordedChanges_b } from './recordedChanges_b' -export const nextIndex_b = _b('nextIndex', (ctx)=>{ - const recordedChanges = recordedChanges_b(ctx) - return derived( - recordedChanges, - c=>c.length - ) -}) diff --git a/ui/src/delta/recordedChanges_b.ts b/ui/src/delta/recordedChanges_b.ts deleted file mode 100644 index 5a3a2d9a..00000000 --- a/ui/src/delta/recordedChanges_b.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { _b, B } from '@ctx-core/object' -import { writable, Writable } from '@ctx-core/store' -import type { ApplyDelta } from './ApplyDelta' -export const recordedChanges_b:recordedChanges_b_T = _b('recordedChanges', ()=>{ - return writable([]) as recordedChanges_T -}) -export type $recordedChanges_T = ApplyDelta[] -export interface recordedChanges_T extends Writable<$recordedChanges_T> {} -export interface recordedChanges_b_T extends B<recordedChanges_T> {} diff --git a/ui/src/delta/requestedChanges_b.ts b/ui/src/delta/requestedChanges_b.ts deleted file mode 100644 index f3f4a0dc..00000000 --- a/ui/src/delta/requestedChanges_b.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { _b } from '@ctx-core/object' -import { writable, Writable } from '@ctx-core/store' -import type { ApplyDelta } from './ApplyDelta' -export const requestedChanges_b = _b('requestedChanges', () => { - return writable([]) as requestedChanges_T -}) -export const requestedChanges:requestedChanges_T = writable([]) -export type $requestedChanges_T = ApplyDelta[] -export interface requestedChanges_T extends Writable<$requestedChanges_T> {} diff --git a/ui/src/folk/folks_b.ts b/ui/src/folk/folks_b.ts deleted file mode 100644 index 357eb943..00000000 --- a/ui/src/folk/folks_b.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { _b, B } from '@ctx-core/object' -import { writable, Writable } from '@ctx-core/store' -import type { PubKeyToFolkRecord } from './Folk' -export const folks_b:folks_b_T = _b('folk', ()=>{ - return writable({}) -}) -export type $folks_T = PubKeyToFolkRecord -export interface folks_T extends Writable<$folks_T> {} -export interface folks_b_T extends B<folks_T> {} diff --git a/ui/src/folk/index.ts b/ui/src/folk/index.ts deleted file mode 100644 index 504b9d55..00000000 --- a/ui/src/folk/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -import 'svelte' -import Folk from './Folk.svelte' -export { Folk } -import Folks from './Folks.svelte' -export { Folks } -export * from './Folk' -export * from './folks_b' diff --git a/ui/src/scribe/index.ts b/ui/src/scribe/index.ts deleted file mode 100644 index 6ad0d7f7..00000000 --- a/ui/src/scribe/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './scribeStr_b' diff --git a/ui/src/scribe/scribeStr_b.ts b/ui/src/scribe/scribeStr_b.ts deleted file mode 100644 index 5e5639c5..00000000 --- a/ui/src/scribe/scribeStr_b.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { _b, B } from '@ctx-core/object' -import { writable, Writable } from '@ctx-core/store' -export const scribeStr_b:scribeStr_b_T = _b('scribeStr', ()=>{ - return writable('') -}) -export type $scribeStr_T = string -export interface scribeStr_T extends Writable<$scribeStr_T> {} -export interface scribeStr_b_T extends B<scribeStr_T> {} diff --git a/ui/src/session/SessionInfo.ts b/ui/src/session/SessionInfo.ts deleted file mode 100644 index b415d7d5..00000000 --- a/ui/src/session/SessionInfo.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { HoloHash } from '@holochain/conductor-api' -import type { Content } from '../content' -export interface SessionInfo { - scribe:HoloHash - session:HoloHash - snapshot_content:Content - snapshot_hash:HoloHash - deltas:string[] - content_hash:HoloHash -} diff --git a/ui/src/session/index.ts b/ui/src/session/index.ts deleted file mode 100644 index 8989b493..00000000 --- a/ui/src/session/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './Session' -export * from './session_b' -export * from './SessionInfo' diff --git a/ui/src/session/session_b.ts b/ui/src/session/session_b.ts deleted file mode 100644 index fe0f90b8..00000000 --- a/ui/src/session/session_b.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { _b, B } from '@ctx-core/object' -import { writable, Writable } from '@ctx-core/store' -import type { Session } from './Session' -export const session_b:session_b_T = _b('session', ()=>{ - const session = writable(null) - return session as session_T -}) -export type $session_T = Session -export class session_T implements Writable<$session_T> { - store = writable(null) - set = this.store.set - subscribe = this.store.subscribe - update = this.store.update -} -export interface session_b_T extends B<session_T> {} diff --git a/ui/src/utils.ts b/ui/src/utils.ts deleted file mode 100644 index fe6db01d..00000000 --- a/ui/src/utils.ts +++ /dev/null @@ -1,62 +0,0 @@ -import type { HoloHash } from '@holochain/conductor-api' -export const bufferToBase64 = buffer=>{ - if (typeof window !== 'undefined') { - // browser - let binary = '' - const bytes = new Uint8Array(buffer) - const len = bytes.byteLength - for (let i = 0; i < len; i++) { - binary += String.fromCharCode(bytes[i]) - } - return window.btoa(binary) - } else { - // nodejs - return buffer.toString('base64') - } -} - -export const base64ToBuffer = base64=>{ - if (!base64) return - if (typeof window !== 'undefined') { - return Uint8Array.from(window.atob(base64), c=>c.charCodeAt(0)) - } else { - return Buffer.from(base64, 'base64') - } -} -export interface Participant extends HoloHash { - pubKey:HoloHash - meta:number -} -export interface ApiResponse extends Record<string, any> { - pubKey:HoloHash - gone?:boolean - participants:Participant[] -} -export function decodeJson(jsonStr:string):ApiResponse { - return JSON.parse(jsonStr, function (key:string, value:string) { - // the receiver function looks for the typed array flag - try { - if (key == 'pubKey') { - return base64ToBuffer(value) - } - } catch (e) { - console.log('decodeJson Error:', e) - } - - // if flag not found no conversion is done - return value - }) -} - -export function encodeJson(obj) { - return JSON.stringify(obj, function (key, value) { - if (key == 'pubKey') { - if (typeof window !== 'undefined') { - return bufferToBase64(value) // In the browser it's the actual array - } else { - return bufferToBase64(Buffer.from(value.data)) // In node it's an object - } - } - return value - }) -} From eae3e42f02138612cc270a92ef03db769e7dddc5 Mon Sep 17 00:00:00 2001 From: Brian Takita <brian.takita@gmail.com> Date: Sun, 25 Apr 2021 21:24:27 -0400 Subject: [PATCH 11/33] wip: @syn-ui/model migration complete --- pnpm-lock.yaml | 26 +- ui/apps/app/package.json | 2 +- ui/apps/app/src/App.svelte | 2 +- ui/apps/app/src/Syn.svelte | 18 +- ui/apps/headless/package.json | 2 +- ui/libs/model/package.json | 2 +- ui/libs/model/src/actions/index.ts | 3 + ui/libs/model/src/actions/join_session.ts | 81 +++ ui/libs/model/src/actions/leave_session.ts | 15 + ui/libs/model/src/actions/toggle_session.ts | 16 + ui/libs/model/src/colors/getFolkColors.ts | 2 +- .../delta/_scribe_signal_folk_pubKey_a1_b.ts | 5 +- .../model/src/delta/committed_changes_b.ts | 8 +- ui/libs/model/src/delta/request_change_b.ts | 25 +- ui/libs/model/src/index.ts | 3 +- .../model/src/session/CommitNotice_ops_b.ts | 38 -- ui/libs/model/src/session/Ops.ts | 3 - ui/libs/model/src/session/Session.ts | 529 ------------------ ui/libs/model/src/session/Syn.ts | 98 ---- ui/libs/model/src/session/commit_change_b.ts | 8 +- .../model/src/session/commit_in_progress_b.ts | 4 +- ui/libs/model/src/session/content_hash_b.ts | 37 +- ui/libs/model/src/session/deltas_b.ts | 12 + ui/libs/model/src/session/index.ts | 8 +- ui/libs/model/src/session/join_session.ts | 93 --- ui/libs/model/src/session/record_deltas_b.ts | 6 +- ui/libs/model/src/session/session_info_b.ts | 25 +- .../src/session/session_info_session_b.ts | 9 + ui/libs/model/src/session/sessions_b.ts | 33 +- .../model/src/session/snapshot_content_b.ts | 34 ++ ui/libs/model/src/session/sync_response_b.ts | 0 ui/libs/model/src/session/update_folks_b.ts | 11 +- .../ChangeReq_SignalOps_b.ts} | 10 +- .../Change_SignalOps_b.ts} | 15 +- .../src/signals/CommitNotice_SignalOps_b.ts | 42 ++ .../FolkLore_SignalOps_b.ts} | 24 +- .../Heartbeat_SignalOps_b.ts} | 7 +- ui/libs/model/src/signals/SignalOps.ts | 3 + .../SyncReq_SignalOps_b.ts} | 20 +- .../SyncResp_SignalOps_b.ts} | 6 +- ui/libs/model/src/signals/index.ts | 8 + ui/libs/model/src/timers/Timer.ts | 15 + ui/libs/model/src/timers/index.ts | 3 + .../src/timers/request_checker_timer_b.ts | 38 ++ .../src/timers/scribe_heartbeat_timer_b.ts | 44 ++ ui/libs/zome-client/package.json | 2 +- ui/libs/zome-client/src/ApiResponse.ts | 6 +- ui/libs/zome-client/src/Connection.ts | 89 --- ui/libs/{ => zome-client/src}/Signal.ts | 0 ui/libs/zome-client/src/app_port_b.ts | 11 +- ui/libs/zome-client/src/app_ws_b.ts | 53 +- ui/libs/zome-client/src/encodeJson.ts | 2 +- ui/libs/zome-client/src/index.ts | 1 + ui/libs/zome-client/src/rpc_get_session_b.ts | 4 +- ui/libs/zome-client/src/rpc_get_sessions_b.ts | 4 +- .../zome-client/src/rpc_send_folk_lore_b.ts | 7 +- 56 files changed, 507 insertions(+), 1065 deletions(-) create mode 100644 ui/libs/model/src/actions/index.ts create mode 100644 ui/libs/model/src/actions/join_session.ts create mode 100644 ui/libs/model/src/actions/leave_session.ts create mode 100644 ui/libs/model/src/actions/toggle_session.ts delete mode 100644 ui/libs/model/src/session/CommitNotice_ops_b.ts delete mode 100644 ui/libs/model/src/session/Ops.ts delete mode 100644 ui/libs/model/src/session/Session.ts delete mode 100644 ui/libs/model/src/session/Syn.ts create mode 100644 ui/libs/model/src/session/deltas_b.ts delete mode 100644 ui/libs/model/src/session/join_session.ts create mode 100644 ui/libs/model/src/session/session_info_session_b.ts create mode 100644 ui/libs/model/src/session/snapshot_content_b.ts delete mode 100644 ui/libs/model/src/session/sync_response_b.ts rename ui/libs/model/src/{session/ChangeReq_ops_b.ts => signals/ChangeReq_SignalOps_b.ts} (83%) rename ui/libs/model/src/{session/Change_ops_b.ts => signals/Change_SignalOps_b.ts} (69%) create mode 100644 ui/libs/model/src/signals/CommitNotice_SignalOps_b.ts rename ui/libs/model/src/{session/FolkLore_ops_b.ts => signals/FolkLore_SignalOps_b.ts} (55%) rename ui/libs/model/src/{session/Heartbeat_ops_b.ts => signals/Heartbeat_SignalOps_b.ts} (76%) create mode 100644 ui/libs/model/src/signals/SignalOps.ts rename ui/libs/model/src/{session/SyncReq_ops_b.ts => signals/SyncReq_SignalOps_b.ts} (79%) rename ui/libs/model/src/{session/SyncResp_ops_b.ts => signals/SyncResp_SignalOps_b.ts} (86%) create mode 100644 ui/libs/model/src/signals/index.ts create mode 100644 ui/libs/model/src/timers/Timer.ts create mode 100644 ui/libs/model/src/timers/index.ts create mode 100644 ui/libs/model/src/timers/request_checker_timer_b.ts create mode 100644 ui/libs/model/src/timers/scribe_heartbeat_timer_b.ts delete mode 100644 ui/libs/zome-client/src/Connection.ts rename ui/libs/{ => zome-client/src}/Signal.ts (100%) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index defd3e77..4f6d8331 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -26,7 +26,7 @@ importers: specifiers: '@ctx-core/combinators': ^6.0.10 '@ctx-core/object': ^17.5.9 - '@ctx-core/store': ^24.3.1 + '@ctx-core/store': ^24.5.0 '@holochain/conductor-api': 0.0.3 '@rollup/plugin-commonjs': ^18.0.0 '@rollup/plugin-node-resolve': ^11.2.1 @@ -51,7 +51,7 @@ importers: svelte-fa: 2.2.0 devDependencies: '@ctx-core/object': 17.5.9 - '@ctx-core/store': 24.3.1 + '@ctx-core/store': 24.5.0 '@rollup/plugin-commonjs': 18.0.0_rollup@2.45.2 '@rollup/plugin-node-resolve': 11.2.1_rollup@2.45.2 '@rollup/plugin-replace': 2.4.2_rollup@2.45.2 @@ -71,7 +71,7 @@ importers: specifiers: '@ctx-core/combinators': ^6.0.10 '@ctx-core/object': ^17.5.9 - '@ctx-core/store': ^24.3.1 + '@ctx-core/store': ^24.5.0 '@holochain/conductor-api': 0.0.3 '@rollup/plugin-commonjs': ^18.0.0 '@rollup/plugin-node-resolve': ^11.2.1 @@ -94,7 +94,7 @@ importers: svelte-fa: 2.2.0 devDependencies: '@ctx-core/object': 17.5.9 - '@ctx-core/store': 24.3.1 + '@ctx-core/store': 24.5.0 '@rollup/plugin-commonjs': 18.0.0_rollup@2.45.2 '@rollup/plugin-node-resolve': 11.2.1_rollup@2.45.2 '@rollup/plugin-replace': 2.4.2_rollup@2.45.2 @@ -112,7 +112,7 @@ importers: specifiers: '@ctx-core/combinators': ^6.0.10 '@ctx-core/object': ^17.5.9 - '@ctx-core/store': ^24.3.1 + '@ctx-core/store': ^24.5.0 '@holochain/conductor-api': 0.0.3 '@syn-ui/utils': workspace:^1.0.0 '@syn-ui/zome-client': workspace:^1.0.0 @@ -121,7 +121,7 @@ importers: devDependencies: '@ctx-core/combinators': 6.0.10 '@ctx-core/object': 17.5.9 - '@ctx-core/store': 24.3.1 + '@ctx-core/store': 24.5.0 '@holochain/conductor-api': 0.0.3 '@syn-ui/utils': link:../utils '@syn-ui/zome-client': link:../zome-client @@ -138,13 +138,13 @@ importers: specifiers: '@ctx-core/function': ^17.4.7 '@ctx-core/object': ^17.5.9 - '@ctx-core/store': ^24.3.1 + '@ctx-core/store': ^24.5.0 '@syn-ui/utils': workspace:^1.0.0 typescript: ^4.2.4 devDependencies: '@ctx-core/function': 17.4.7 '@ctx-core/object': 17.5.9 - '@ctx-core/store': 24.3.1 + '@ctx-core/store': 24.5.0 '@syn-ui/utils': link:../utils typescript: 4.2.4 @@ -435,8 +435,8 @@ packages: '@ctx-core/function': 17.4.7 dev: true - /@ctx-core/store/24.3.1: - resolution: {integrity: sha512-CGtNBbYHqX9zHC9efp5AWa2PK9tySKLzuSxrFQkY7j8kSxo7eLCHk0P93MzXpAnKbqDV0hp3yv0k0aCtz8s8aQ==} + /@ctx-core/store/24.5.0: + resolution: {integrity: sha512-ia2oixp/tsWG8nNB7blAsnlOe2aQNwdaUa1GK8XIV3AmvwtP2P72pnJwRID/0lRYbFfas8DN8iOUMYIQN648tQ==} dependencies: '@ctx-core/array': 20.2.11 '@ctx-core/combinators': 6.0.10 @@ -1549,8 +1549,8 @@ packages: kind-of: 6.0.3 dev: true - /mixme/0.5.0: - resolution: {integrity: sha512-YyyBIzqe6EEi5xcnN66LXVVvwijMF51liPT9ZqsrHim9s2MgEg4jxI8gsSF6R7pzAotjvBiERC90bbnwAqiDHg==} + /mixme/0.5.1: + resolution: {integrity: sha512-NaeZIckeBFT7i0XBEpGyFcAE0/bLcQ9MHErTpnU3bLWVE5WZbxG5Y3fDsMxYGifTo5khDA42OquXCC2ngKJB+g==} engines: {node: '>= 8.0.0'} dev: true @@ -2085,7 +2085,7 @@ packages: /stream-transform/2.1.0: resolution: {integrity: sha512-bwQO+75rzQbug7e5OOHnOR3FgbJ0fCjHmDIdynkwUaFzleBXugGmv2dx3sX3aIHUQRLjrcisRPgN9BWl63uGgw==} dependencies: - mixme: 0.5.0 + mixme: 0.5.1 dev: true /string-width/2.1.1: diff --git a/ui/apps/app/package.json b/ui/apps/app/package.json index 195ea026..178d4303 100644 --- a/ui/apps/app/package.json +++ b/ui/apps/app/package.json @@ -14,7 +14,7 @@ }, "devDependencies": { "@ctx-core/object": "^17.5.9", - "@ctx-core/store": "^24.3.1", + "@ctx-core/store": "^24.5.0", "@rollup/plugin-commonjs": "^18.0.0", "@rollup/plugin-node-resolve": "^11.2.1", "@rollup/plugin-replace": "^2.4.2", diff --git a/ui/apps/app/src/App.svelte b/ui/apps/app/src/App.svelte index 010df576..76d85603 100644 --- a/ui/apps/app/src/App.svelte +++ b/ui/apps/app/src/App.svelte @@ -308,7 +308,7 @@ </div> -<Syn applyDeltaFn={applyDelta} undoFn={undo} bind:this={syn}/> +<Syn apply_delta_fn={applyDelta} undoFn={undo} bind:this={syn}/> </main> <div class='folks-tray'> diff --git a/ui/apps/app/src/Syn.svelte b/ui/apps/app/src/Syn.svelte index fd090ab3..5e71146e 100644 --- a/ui/apps/app/src/Syn.svelte +++ b/ui/apps/app/src/Syn.svelte @@ -1,25 +1,21 @@ <script lang="ts"> import { createEventDispatcher, getContext } from 'svelte' - import { bufferToBase64 } from './utils' - import { connection_b, Connection } from './zome' - import { scribe_str_b } from './scribe' - import { session_b } from './session' + import { join_session, request_change_b, scribe_str_b } from '@syn-ui/model' + import { connection_b } from '@syn-ui/zome-client' + import { bufferToBase64 } from '@syn-ui/utils' const ctx = getContext('ctx') const connection = connection_b(ctx) const scribe_str = scribe_str_b(ctx) + const request_change = request_change_b(ctx) const session = session_b(ctx) // this properties are the app-defined functions to apply and undo changes - export let applyDeltaFn, undoFn + export let apply_delta_fn, undoFn // this is the list of sessions returned by the DNA let sessions - export function request_change(deltas) { - $session.request_change(deltas) - } - // ----------------------------------------------------------------------- const dispatch = createEventDispatcher() @@ -30,9 +26,9 @@ async function toggle() { if (!$session) { // if (!$connection) { - $session = await join_session({ app_port, app_id, ctx }) + $session = await join_session({ app_port, app_id, apply_delta_fn, ctx }) // $connection = new Connection(ctx, app_port, app_id) - // await $connection.open({title:'', body:''}, applyDeltaFn) + // await $connection.open({title:'', body:''}, apply_delta_fn) // // session = $connection.syn.session // diff --git a/ui/apps/headless/package.json b/ui/apps/headless/package.json index 2e7c5f35..0fe48bb8 100644 --- a/ui/apps/headless/package.json +++ b/ui/apps/headless/package.json @@ -14,7 +14,7 @@ }, "devDependencies": { "@ctx-core/object": "^17.5.9", - "@ctx-core/store": "^24.3.1", + "@ctx-core/store": "^24.5.0", "@rollup/plugin-commonjs": "^18.0.0", "@rollup/plugin-node-resolve": "^11.2.1", "@rollup/plugin-replace": "^2.4.2", diff --git a/ui/libs/model/package.json b/ui/libs/model/package.json index 9a5e0682..da0fd0f0 100644 --- a/ui/libs/model/package.json +++ b/ui/libs/model/package.json @@ -8,7 +8,7 @@ "devDependencies": { "@ctx-core/combinators": "^6.0.10", "@ctx-core/object": "^17.5.9", - "@ctx-core/store": "^24.3.1", + "@ctx-core/store": "^24.5.0", "@holochain/conductor-api": "0.0.3", "@syn-ui/utils": "workspace:^1.0.0", "@syn-ui/zome-client": "workspace:^1.0.0", diff --git a/ui/libs/model/src/actions/index.ts b/ui/libs/model/src/actions/index.ts new file mode 100644 index 00000000..b808c85d --- /dev/null +++ b/ui/libs/model/src/actions/index.ts @@ -0,0 +1,3 @@ +export * from './join_session' +export * from './leave_session' +export * from './toggle_session' diff --git a/ui/libs/model/src/actions/join_session.ts b/ui/libs/model/src/actions/join_session.ts new file mode 100644 index 00000000..be8f8b54 --- /dev/null +++ b/ui/libs/model/src/actions/join_session.ts @@ -0,0 +1,81 @@ +import type { AppSignal } from '@holochain/conductor-api' +import { clone } from '@ctx-core/object' +import { I } from '@ctx-core/combinators' +import { subscribe_wait_timeout } from '@ctx-core/store' +import { bufferToBase64 } from '@syn-ui/utils' +import { + app_id_b, app_port_b, app_ws_cb_b, me_b, rpc_get_session_b, rpc_new_session_b, + rpc_send_sync_request_b, SessionInfo, +} from '@syn-ui/zome-client' +import { apply_delta_fn_T, apply_delta_fn_b } from '../delta' +import { am_i_scribe_b, session_info_b, sessions_b } from '../session' +import { + Change_SignalOps_b, ChangeReq_SignalOps_b, CommitNotice_SignalOps_b, + FolkLore_SignalOps_b, Heartbeat_SignalOps_b, SignalOps, + SyncReq_SignalOps_b, SyncResp_SignalOps_b +} from '../signals' +import { request_checker_timer_b, scribe_heartbeat_timer_b } from '../timers' +export async function join_session(params:join_session_params_T) { + const ctx = params.ctx || {} + const me = me_b(ctx) + const sessions = sessions_b(ctx) + const signal_ops:SignalOps = clone( + Change_SignalOps_b(ctx), + ChangeReq_SignalOps_b(ctx), + CommitNotice_SignalOps_b(ctx), + FolkLore_SignalOps_b(ctx), + Heartbeat_SignalOps_b(ctx), + SyncReq_SignalOps_b(ctx), + SyncResp_SignalOps_b(ctx), + ) + const app_ws_cb = app_ws_cb_b(ctx) + app_ws_cb.$ = $app_ws_cb + const app_id = app_id_b(ctx) + app_id.$ = params.app_id + const app_port = app_port_b(ctx) + app_port.$ = params.app_port + const $apply_delta_fn = params.apply_delta_fn + const apply_delta_fn = apply_delta_fn_b(ctx) + apply_delta_fn.$ = $apply_delta_fn + const $sessions = await subscribe_wait_timeout(sessions, I, 10_000) + let $session_info:SessionInfo + if ($sessions.length === 0) { + const rpc_new_session = rpc_new_session_b(ctx) + $session_info = await rpc_new_session() + sessions.unshift($session_info.session) + } else { + const rpc_get_session = rpc_get_session_b(ctx) + $session_info = await rpc_get_session($sessions[0]) + const am_i_scribe = am_i_scribe_b(ctx) + if (am_i_scribe.$ === true) { + const rpc_send_sync_request = rpc_send_sync_request_b(ctx) + await rpc_send_sync_request($session_info) + } + } + const session_info = session_info_b(ctx) + session_info.$ = $session_info + const request_checker_timer = request_checker_timer_b(ctx) + request_checker_timer.start() + const scribe_heartbeat_timer = scribe_heartbeat_timer_b(ctx) + scribe_heartbeat_timer.start() + return ctx + async function $app_ws_cb(signal:AppSignal) { + // ignore signals not meant for me + if (bufferToBase64(signal.data.cellId[1]) !== me.$) { + return + } + const { signal_name } = signal.data.payload + console.log('Got Signal', signal_name, signal) + const signal_payload_op = signal_ops[signal_name] + if (!signal_payload_op) { + console.warn(`Undefined SignalOp: ${signal_name}`) + } + await signal_payload_op(signal) + } +} +export interface join_session_params_T { + app_port:number + app_id:string + apply_delta_fn:apply_delta_fn_T + ctx?:object +} diff --git a/ui/libs/model/src/actions/leave_session.ts b/ui/libs/model/src/actions/leave_session.ts new file mode 100644 index 00000000..cbf54a66 --- /dev/null +++ b/ui/libs/model/src/actions/leave_session.ts @@ -0,0 +1,15 @@ +import { session_info_b } from '../session' +import { request_checker_timer_b, scribe_heartbeat_timer_b } from '../timers' +export async function leave_session(params:leave_session_params_I) { + const ctx = params.ctx || {} + const session_info = session_info_b(ctx) + session_info.$ = null + const request_checker_timer = request_checker_timer_b(ctx) + request_checker_timer.stop() + const scribe_heartbeat_timer = scribe_heartbeat_timer_b(ctx) + scribe_heartbeat_timer.stop() + return ctx +} +export interface leave_session_params_I { + ctx?:object +} diff --git a/ui/libs/model/src/actions/toggle_session.ts b/ui/libs/model/src/actions/toggle_session.ts new file mode 100644 index 00000000..13dde320 --- /dev/null +++ b/ui/libs/model/src/actions/toggle_session.ts @@ -0,0 +1,16 @@ +import { clone } from '@ctx-core/object' +import { session_info_b } from '../session' +import type { join_session_params_T } from './join_session' +import { leave_session } from './leave_session' +import { join_session } from './join_session' +export async function toggle_session(params:join_session_params_T) { + const ctx = params.ctx || {} + const session_info = session_info_b(ctx) + return ( + session_info.$ + ? leave_session({ ctx }) + : join_session( + clone<join_session_params_T>(params, { ctx }) + ) + ) +} diff --git a/ui/libs/model/src/colors/getFolkColors.ts b/ui/libs/model/src/colors/getFolkColors.ts index 7441bed5..8a987c8e 100644 --- a/ui/libs/model/src/colors/getFolkColors.ts +++ b/ui/libs/model/src/colors/getFolkColors.ts @@ -1,5 +1,5 @@ import type { HoloHash } from '@holochain/conductor-api' -import type { FolkColors } from './FolkColors' +import type { FolkColors } from '@syn-ui/zome-client' import { arrayBufferToHex } from './arrayBufferToHex' import { rgbToHsl } from './rgbToHsl' import { clamp } from './clamp' diff --git a/ui/libs/model/src/delta/_scribe_signal_folk_pubKey_a1_b.ts b/ui/libs/model/src/delta/_scribe_signal_folk_pubKey_a1_b.ts index 42c7314f..73f70bf2 100644 --- a/ui/libs/model/src/delta/_scribe_signal_folk_pubKey_a1_b.ts +++ b/ui/libs/model/src/delta/_scribe_signal_folk_pubKey_a1_b.ts @@ -1,8 +1,9 @@ import { _b } from '@ctx-core/object' import { folks_b } from '../session' -export const _scribe_signal_folk_pubKey_a1_b = _b('_scribe_signal_folk_pubKey_a1', (ctx) => { +import type { AgentPubKey } from '@holochain/conductor-api' +export const _scribe_signal_folk_pubKey_a1_b = _b('_scribe_signal_folk_pubKey_a1', (ctx)=>{ const folks = folks_b(ctx) - return function _scribe_signal_folk_pubKey_a1() { + return function _scribe_signal_folk_pubKey_a1():AgentPubKey[] { return Object.values(folks.$).filter(v=>v.inSession).map(v=>v.pubKey) } }) diff --git a/ui/libs/model/src/delta/committed_changes_b.ts b/ui/libs/model/src/delta/committed_changes_b.ts index a81509cf..d30f9535 100644 --- a/ui/libs/model/src/delta/committed_changes_b.ts +++ b/ui/libs/model/src/delta/committed_changes_b.ts @@ -1,10 +1,6 @@ import { _b } from '@ctx-core/object' -import { writable, Writable } from '@ctx-core/store' +import { writable$ } from '@ctx-core/store' import type { ApplyDelta } from './ApplyDelta' export const committed_changes_b = _b('committed_changes', ()=>{ - return writable<ApplyDelta[]>([]) as committed_changes_T + return writable$<ApplyDelta[]>([]) }) -export type $committed_changes_T = ApplyDelta[] -export interface committed_changes_T extends Writable<$committed_changes_T> { - push(...changes:ApplyDelta[]):void -} diff --git a/ui/libs/model/src/delta/request_change_b.ts b/ui/libs/model/src/delta/request_change_b.ts index 47d1c4f2..61824dd8 100644 --- a/ui/libs/model/src/delta/request_change_b.ts +++ b/ui/libs/model/src/delta/request_change_b.ts @@ -13,27 +13,30 @@ export const request_change_b = _b('request_change', (ctx)=>{ let request_counter = 0 return async function request_change(deltas:Delta[]) { // any requested made by the scribe should be recorded immediately - if (am_i_scribe_b(ctx).$ === true) { - const $next_index = next_index_b(ctx).$ + const am_i_scribe = am_i_scribe_b(ctx) + const next_index = next_index_b(ctx) + if (am_i_scribe.$ === true) { + const $next_index = next_index.$ for (const delta of deltas) { record_delta(delta) } - await send_change_b(ctx)({ index: $next_index, deltas }) + const send_change = send_change_b(ctx) + await send_change({ index: $next_index, deltas }) } else { // otherwise apply the change and queue it to requested changes for // confirmation later and send request change to scribe - // create a unique id for each change // TODO: this should be part of actual changeReqs - const change_id = my_tag_b(ctx).$ + '.' + request_counter + const my_tag = my_tag_b(ctx) + const change_id = my_tag.$ + '.' + request_counter const change_at = Date.now() - const $requested_changes = request_changes.$ // we want to apply this to current next_index plus any previously // requested changes that haven't yet be recorded - const index = next_index_b(ctx).$ + $requested_changes.length + const index = next_index.$ + $requested_changes.length for (const delta of deltas) { - const undoable_change = run_apply_delta_b(ctx)(delta) + const run_apply_delta = run_apply_delta_b(ctx) + const undoable_change = run_apply_delta(delta) undoable_change.id = change_id undoable_change.at = change_at // append changes to the requested queue @@ -42,8 +45,10 @@ export const request_change_b = _b('request_change', (ctx)=>{ } request_changes.$ = $requested_changes console.log('REQUESTED', $requested_changes) - await rpc_send_change_request_b(ctx)({ - index, deltas, scribe: scribe_b(ctx).$ + const rpc_send_change_request = rpc_send_change_request_b(ctx) + const scribe = scribe_b(ctx) + await rpc_send_change_request({ + index, deltas, scribe: scribe.$ }) request_counter += 1 } diff --git a/ui/libs/model/src/index.ts b/ui/libs/model/src/index.ts index de8c36de..6482f695 100644 --- a/ui/libs/model/src/index.ts +++ b/ui/libs/model/src/index.ts @@ -1,5 +1,6 @@ +export * from './actions' export * from './colors' export * from './content' export * from './delta' -export * from './folk' export * from './session' +export * from './timers' diff --git a/ui/libs/model/src/session/CommitNotice_ops_b.ts b/ui/libs/model/src/session/CommitNotice_ops_b.ts deleted file mode 100644 index eed78526..00000000 --- a/ui/libs/model/src/session/CommitNotice_ops_b.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { _b } from '@ctx-core/object' -import { bufferToBase64, EntryHash, HeaderHash } from '@syn-ui/utils' -import type { Ops } from './Ops' -import { content_hash_str_b } from './content_hash_str_b' -import { next_index_b } from '../delta' -export const CommitNotice_ops_b = _b<Ops>('CommitNotice_ops', (ctx)=>{ - const content_hash_str = content_hash_str_b(ctx) - const next_index = next_index_b(ctx) - return { - CommitNotice: async (signal)=>{ - const commitInfo:CommitInfo = signal.data.payload.signal_payload - // make sure we are at the right place to be able to just move forward with the commit - const $content_hash_str = content_hash_str.$ - if ($content_hash_str == bufferToBase64(commitInfo.previous_content_hash) && - next_index.$ === commitInfo.deltas_committed) { - content_hash_str.$ = bufferToBase64(commitInfo.commit_content_hash) - this.committed = this.committed.concat(this.recorded) - this.recorded = [] - this.committed_changes.set(this.committed) - this.recorded_changes.set(this.recorded) - } else { - console.log('received commit notice for beyond our last commit, gotta resync') - console.log('commit.commit_content_hash:', bufferToBase64(commitInfo.commit_content_hash)) - console.log('commit.previous_content_hash:', bufferToBase64(commitInfo.previous_content_hash)) - console.log('commit.deltas_committed:', commitInfo.deltas_committed) - console.log('my $session.contentHashStr', $content_hash_str) - console.log('my next_index', this.next_index()) - // TODO resync - } - } - } -}) -export interface CommitInfo { - deltas_committed:number - commit_content_hash:EntryHash - previous_content_hash:EntryHash - commit:HeaderHash -} diff --git a/ui/libs/model/src/session/Ops.ts b/ui/libs/model/src/session/Ops.ts deleted file mode 100644 index 40742912..00000000 --- a/ui/libs/model/src/session/Ops.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { AppSignal } from '@holochain/conductor-api' -export type Op = (signal:AppSignal)=>Promise<void> -export interface Ops extends Record<string, Op> {} diff --git a/ui/libs/model/src/session/Session.ts b/ui/libs/model/src/session/Session.ts deleted file mode 100644 index 5f4d7b3a..00000000 --- a/ui/libs/model/src/session/Session.ts +++ /dev/null @@ -1,529 +0,0 @@ -import type { HoloHash } from '@holochain/conductor-api' -import { content_b, Content } from '../content' -import { - requested_changes_b, recorded_changes_b, committed_changes_b, ApplyDelta, apply_delta_fn_T, Delta -} from '../delta' -import { ApiResponse, bufferToBase64, encodeJson } from '../utils' -import { getFolkColors } from '../colors' -import { - FOLK_GONE, FOLK_SEEN, FOLK_UNKNOWN, PubKeyToFolkRecord, FolkStatus, folks_b, folks_T, Folk -} from '../folk' -import type { Commit } from '../Commit' -import type { Zome } from '@syn-ui/zome-client' -import { scribe_str_b } from '../scribe' -import type { SessionInfo } from './SessionInfo' -import type { Syn } from './Syn' - -// const outOfSessionTimout = 30 * 1000 -const outOfSessionTimout = 8 * 1000 // testing code :) - -// const heartbeatInterval = 15 * 1000 // 15 seconds -const heartbeatInterval = 30 * 1000 // for testing ;) -let reqTimeout = 1000 - -export class Session { - zome:Zome - applyDeltaFn:apply_delta_fn_T - _content:Content - me:string - my_tag:string - others:PubKeyToFolkRecord - folks:folks_T - - constructor(protected ctx, syn:Syn, public sessionInfo:SessionInfo) { - this.zome = syn.zome - this.applyDeltaFn = syn.applyDeltaFn - this.me = syn.zome.me - this.my_tag = syn.zome.me.slice(-4) - const others = {} as PubKeyToFolkRecord - this.others = others - this.folks = folks_b(ctx) - this.folks.set(others) - this.initState(this.sessionInfo) - this.initTimers(syn) - console.log('session joined:', this.sessionInfo) - } - heart:ReturnType<typeof setInterval> - requestChecker:ReturnType<typeof setInterval> - scribe:HoloHash - _scribe_str:string - requested:any[] - sessionHash:HoloHash - snapshot_content:Content - snapshot_hash:HoloHash - content_hash:HoloHash - current_commit_header_hash:HoloHash - deltas:Delta[] - snapshotHashStr:string - contentHashStr:string - reqCounter:number - committed:ApplyDelta[] - recorded:ApplyDelta[] - commit_in_progress:boolean - - // set up the svelte based state vars - content = content_b(this.ctx) - recorded_changes = recorded_changes_b(this.ctx) - requested_changes = requested_changes_b(this.ctx) - committed_changes = committed_changes_b(this.ctx) - scribe_str = scribe_str_b(this.ctx) - - initTimers(syn) { - const self = this - // Send heartbeat to scribe every [heartbeat interval] - this.heart = setInterval(async ()=>{ - if (self._scribe_str == self.me) { - // examine folks last seen time and see if any have crossed the session out-of-session - // timeout so we can tell everybody else about them having dropped. - let gone = self.updateRecentlyTimedOutFolks() - if (gone.length > 0) { - self.sendFolkLore(self._scribe_signal_folk_pubKey_a1(), { gone }) - } - } else { - // I'm not the scribe so send them a heartbeat - await self.sendHeartbeat('Hello') - } - }, heartbeatInterval) - - this.requestChecker = setInterval(async ()=>{ - if (self.requested.length > 0) { - if ((Date.now() - self.requested[0].at) > reqTimeout) { - // for now let's just do the most drastic thing! - /* - console.log('requested change timed out! Undoing all changes', $requested_changes[0]) - // TODO: make sure this is transactional and no request_changes squeak in ! - while ($requested_changes.length > 0) { - requested_changes.update(changes => { - const change = changes.pop() - console.log('undoing ', change) - const undoDelta = undoFn(change) - console.log('undoDelta: ', undoDelta) - applyDeltaFn(undoDelta) - return changes - }) - }*/ - - // and send a sync request incase something just got out of sequence - // TODO: prepare for shifting to new scribe if they went offline - - this.initState(await syn.getSession(self.sessionHash)) - console.log('HERE') - syn.sendSyncReq() - } - } - }, reqTimeout / 2) - - } - - initState(sessionInfo:SessionInfo) { - this.sessionHash = sessionInfo.session - this.scribe = sessionInfo.scribe - this.snapshot_content = sessionInfo.snapshot_content - this.snapshot_hash = sessionInfo.snapshot_hash - this.content_hash = sessionInfo.content_hash - - this.deltas = sessionInfo.deltas.map(d=>JSON.parse(d)) - this.snapshotHashStr = bufferToBase64(sessionInfo.snapshot_hash) - this.contentHashStr = bufferToBase64(sessionInfo.content_hash) - this._scribe_str = bufferToBase64(sessionInfo.scribe) - this.scribe_str.set(this._scribe_str) - - this.recorded = [] - this.requested = [] - this.requested_changes.set(this.requested) - this.recorded_changes.set(this.recorded) - this.committed_changes.set([]) - this.reqCounter = 0 - - this.committed = [] - let newContent = { ...sessionInfo.snapshot_content } // clone so as not to pass by ref - newContent.meta = {} - newContent.meta[this.my_tag] = 0 - - for (const delta of this.deltas) { - const [c, change] = this.applyDeltaFn(newContent, delta) - newContent = c - this.committed.push(change) - } - this.committed_changes.set(this.committed) - - this._content = newContent - this.content.set(this._content) - } - - _record_delta(delta) { - // apply the deltas to the content which returns the undoable change - const undoableChange = this.run_apply_delta(delta) - // append changes to the recorded history - this.recorded.push(undoableChange) - this.recorded_changes.set(this.recorded) - } - - _record_deltas(deltas) { - // apply the deltas to the content which returns the undoable change - for (const delta of deltas) { - this._record_delta(delta) - } - } - - // apply changes confirmed as recorded by the scribe while reconciling - // and possibly rebasing our requested changes - record_deltas(_index:number, deltas:Delta[]) { - console.log('record_deltas REQUESTED', this.requested) - for (const delta of deltas) { - if (this.requested.length > 0) { - // if this change is our next requested change then remove it - if (JSON.stringify(delta) == JSON.stringify(this.requested[0].delta)) { - this.recorded.push(this.requested.shift()) - this.recorded_changes.set(this.recorded) - this.requested_changes.set(this.requested) - } else { - // TODO rebase? - console.log('REBASE NEEDED?') - console.log('requested ', this.requested[0].delta) - console.log('to be recorded ', delta) - } - } else { - // no requested changes so this must be from someone else so we don't have - // to check our requested changes - // TODO: do we need to check if this is a change that we did send and have already - // integrated somehow and ignore if so. (Seems unlikely?) - this._record_delta(delta) - } - } - } - - next_index() { - return this.recorded.length - } - - run_apply_delta(delta) { - const [newContent, undoableChange] = this.applyDeltaFn(this._content, delta) - this._content = newContent - this.content.set(this._content) - return undoableChange - } - - // called when requesting a change to the content as a result of user action - // If we are the scribe, no need to go into the zome - // TODO: prevent reentry - request_change(deltas) { - // any requested made by the scribe should be recorded immediately - if (this._scribe_str == this.me) { - const index = this.next_index() - this._record_deltas(deltas) - this.sendChange(index, deltas) - } else { - // otherwise apply the change and queue it to requested changes for - // confirmation later and send request change to scribe - - // create a unique id for each change - // TODO: this should be part of actual changeReqs - const changeId = this.my_tag + '.' + this.reqCounter - const changeAt = Date.now() - - // we want to apply this to current next_index plus any previously - // requested changes that haven't yet be recorded - const index = this.next_index() + this.requested.length - - for (const delta of deltas) { - const undoableChange = this.run_apply_delta(delta) - undoableChange.id = changeId - undoableChange.at = changeAt - // append changes to the requested queue - this.requested.push(undoableChange) - this.requested_changes.set(this.requested) - } - console.log('REQUESTED', this.requested) - this.sendChangeReq(index, deltas) - this.reqCounter += 1 - } - } - - addChangeAsScribe(change) { - let [index, deltas] = change - const next_index = this.next_index() - if (next_index != index) { - console.log('Scribe is receiving change out of order!') - console.log(`next_index: ${next_index}, changeIndex:${index} for deltas:`, deltas) - - if (index < next_index) { - // change is too late, next_index has moved on - // TODO: rebase? notify sender? - return - } else { - // change is in the future, possibly some other change was dropped or is slow in arriving - // TODO: wait a bit? Ask sender for other changes? - return - } - } - - this.record_deltas(index, deltas) - - // notify all participants of the change - this.sendChange(index, deltas) - } - - async commit_change() { - if (this._scribe_str == this.me) { - if (this.recorded.length == 0) { - alert('No changes to commit!') - return - } - this.commit_in_progress = true - - const newContentHash = await this.hashContent(this._content) - console.log('commiting from snapshot', this.snapshotHashStr) - console.log(' prev_hash:', this.contentHashStr) - console.log(' new_hash:', bufferToBase64(newContentHash)) - const commit:Commit = { - snapshot: this.snapshot_hash, - change: { - deltas: this.recorded.map(c=>JSON.stringify(c.delta)), - content_hash: newContentHash, - previous_change: this.content_hash, - meta: { - contributors: [], - witnesses: [], - app_specific: null - } - }, - participants: this._scribe_signal_folk_pubKey_a1() - } - try { - this.current_commit_header_hash = await this.zome.call('commit', commit) - // if commit successfull we need to update the content hash and its string in the session - this.content_hash = newContentHash - this.contentHashStr = bufferToBase64(this.content_hash) - this.committed = this.committed.concat(this.recorded) - this.recorded = [] - this.recorded_changes.set(this.recorded) - this.committed_changes.set(this.committed) - } catch (e) { - console.log('Error:', e) - } - this.commit_in_progress = false - } else { - alert('You ain\'t the scribe!') - } - } - - // Folks -------------------------------------------------------- - - _newOther(pubKeyStr:string, pubKey:HoloHash) { - if (!(pubKeyStr in this.others)) { - const colors = getFolkColors(pubKey) - this.others[pubKeyStr] = { pubKey, colors } as Folk - } - } - - update_folks(pubKey:HoloHash, status:FolkStatus, meta?:number) { - const pubKeyStr = bufferToBase64(pubKey) - if (pubKeyStr == this.me) { - return - } - - // if we don't have this key, create a record for it - // including the default color - this._newOther(pubKeyStr, pubKey) - - if (meta) { - this.others[pubKeyStr]['meta'] = meta - } - - switch (status) { - case FOLK_SEEN: - this.others[pubKeyStr]['inSession'] = true - this.others[pubKeyStr]['lastSeen'] = Date.now() - break - case FOLK_GONE: - case FOLK_UNKNOWN: - this.others[pubKeyStr]['inSession'] = false - } - - this.folks.set(this.others) - } - - _scribe_signal_folk_pubKey_a1() { - return Object.values(this.others).filter(v=>v.inSession).map(v=>v.pubKey) - } - - // updates folks in-session status by checking their last-seen time - updateRecentlyTimedOutFolks() { - let result = [] - for (const [pubKeyStr, folk] of Object.entries(this.others)) { - if (folk.inSession && (Date.now() - this.others[pubKeyStr].lastSeen > outOfSessionTimout)) { - folk.inSession = false - result.push(this.others[pubKeyStr].pubKey) - } - } - if (result.length > 0) { - this.folks.set(this.others) - } - return result - } - - async hashContent(content) { - return this.zome.call('hash_content', content) - } - - // senders --------------------------------------------------------------------- - // These are the functions that send signals in the context of a session - - async sendHeartbeat(data) { - data = encodeJson(data) - return this.zome.call('send_heartbeat', { scribe: this.scribe, data }) - } - - async sendChangeReq(index, deltas) { - deltas = deltas.map(d=>JSON.stringify(d)) - return this.zome.call('send_change_request', { scribe: this.scribe, change: [index, deltas] }) - } - - async sendChange(index, deltas) { - const participants = this._scribe_signal_folk_pubKey_a1() - if (participants.length > 0) { - deltas = deltas.map(d=>JSON.stringify(d)) - return this.zome.call('send_change', { participants, change: [index, deltas] }) - } - } - - async sendFolkLore(participants, data) { - if (participants.length > 0) { - data = encodeJson(data) - return this.zome.call('send_folk_lore', { participants, data }) - } - } - - async sendSyncResp(to, state) { - state.deltas = state.deltas.map(d=>JSON.stringify(d)) - return this.zome.call('send_sync_response', { - participant: to, - state - }) - } - - // signal handlers ------------------------------------------ - - // handler for the changeReq event - changeReq(change) { - if (this._scribe_str == this.me) { - this.addChangeAsScribe(change) - } else { - console.log('change requested but I\'m not the scribe.') - } - } - - // handler for the change event - change(index, deltas) { - if (this._scribe_str == this.me) { - console.log('change received but I\'m the scribe, so I\'m ignoring this!') - } else { - console.log(`change arrived for ${index}:`, deltas) - if (this.next_index() == index) { - this.record_deltas(index, deltas) - } else { - console.log(`change arrived out of sequence next_index: ${this.next_index()}, change index:${index}`) - // TODO either call for sync, or do some waiting algorithm - } - } - } - - // handler for the syncReq event - syncReq(request) { - const from = request.from - if (this._scribe_str == this.me) { - this.update_folks(from, FOLK_SEEN, request.meta) - let state = { - snapshot: this.snapshot_hash, - commit_content_hash: this.content_hash, - deltas: this.recorded.map(c=>c.delta) - } - if (this.current_commit_header_hash) { - state['commit'] = this.current_commit_header_hash - } - // send a sync response to the sender - this.sendSyncResp(from, state) - // and send everybody a folk lore p2p message with new participants - let p = { ...this.others } - p[this.me] = { - pubKey: this.zome.agent_pub_key - } - const data = { - participants: p - } - this.sendFolkLore(this._scribe_signal_folk_pubKey_a1(), data) - } else { - console.log('syncReq received but I\'m not the scribe!') - } - } - - // handler for the syncResp event - syncResp(stateForSync) { - // Make sure that we are working off the same snapshot and commit - const commitContentHashStr = bufferToBase64(stateForSync.commit_content_hash) - if (commitContentHashStr == this.contentHashStr) { - this._record_deltas(stateForSync.deltas) - } else { - console.log('WHOA, sync response has different current state assumptions') - // TODO: resync somehow - } - } - - // handler for the heartbeat event - heartbeat(from, data) { - console.log('got heartbeat', data, 'from:', from) - if (this._scribe_str != this.me) { - console.log('heartbeat received but I\'m not the scribe.') - } else { - // I am the scribe and I've recieved a heartbeat from a concerned Folk - this.update_folks(from, FOLK_SEEN) - } - } - - // handler for the folklore event - folklore(data:ApiResponse) { - console.log('got folklore', data) - if (this._scribe_str == this.me) { - console.log('folklore received but I\'m the scribe!') - } else { - if (data.gone) { - Object.values(data.participants).forEach( - pubKey=>{ - this.update_folks(pubKey, FOLK_GONE) - } - ) - } - // TODO move last seen into p.meta so that we can update that value - // as hearsay. - if (data.participants) { - Object.values(data.participants).forEach( - p=>{ - this.update_folks(p.pubKey, FOLK_UNKNOWN, p.meta) - } - ) - } - } - } - - // handler for the commit notice event - commitNotice(commitInfo) { - // make sure we are at the right place to be able to just move forward with the commit - if (this.contentHashStr == bufferToBase64(commitInfo.previous_content_hash) && - this.next_index() == commitInfo.deltas_committed) { - this.contentHashStr = bufferToBase64(commitInfo.commit_content_hash) - this.committed = this.committed.concat(this.recorded) - this.recorded = [] - this.committed_changes.set(this.committed) - this.recorded_changes.set(this.recorded) - } else { - console.log('received commit notice for beyond our last commit, gotta resync') - console.log('commit.commit_content_hash:', bufferToBase64(commitInfo.commit_content_hash)) - console.log('commit.previous_content_hash:', bufferToBase64(commitInfo.previous_content_hash)) - console.log('commit.deltas_committed:', commitInfo.deltas_committed) - console.log('my $session.contentHashStr', this.contentHashStr) - console.log('my next_index', this.next_index()) - // TODO resync - } - } -} diff --git a/ui/libs/model/src/session/Syn.ts b/ui/libs/model/src/session/Syn.ts deleted file mode 100644 index 7e563a0c..00000000 --- a/ui/libs/model/src/session/Syn.ts +++ /dev/null @@ -1,98 +0,0 @@ -import type { AppWebsocket, HoloHash } from '@holochain/conductor-api' -import { Zome, connection_b } from '@syn-ui/zome-client' -import { FolkColors, getFolkColors } from '../colors' -import type { Content } from '../content' -import { folks_b } from '../folk' -import type { apply_delta_fn_T } from '../delta' -import { Session, session_b, SessionInfo } from '../session' -import { scribe_str_b } from '../scribe' - -declare global { - interface Window { - syn:Syn - } -} - -export class Syn { - constructor( - public ctx, - public default_content:Content, - public applyDeltaFn:apply_delta_fn_T, - public app_ws:AppWebsocket, - public app_id:string - ) { - window.syn = this - } - zome = new Zome(this.app_ws, this.app_id) - session = session_b(this.ctx) - folks = folks_b(this.ctx) - connection = connection_b(this.ctx) - scribe_str = scribe_str_b(this.ctx) - agent_pub_key:HoloHash - me:string - my_colors:FolkColors - my_tag:string - Dna:string - - async attach() { - await this.zome.attach() - this.agent_pub_key = this.zome.agent_pub_key - this.me = this.zome.me - this.my_colors = getFolkColors(this.agent_pub_key) - this.my_tag = this.me.slice(-4) - this.Dna = this.zome.dna_str - - // TODO: others moved into session so we can do it here. - // load up the other folk in this syn instance -// let allFolks = await this.getFolks() -// for (const folk of allFolks) { -// this.update_folks(folk) -// } - - } - - clearState() { - this.folks.set({}) - this.connection.set(undefined) - this.session.update(s=>{ - s.scribe_str.set('') - s._content = this.default_content - s.content.set(s._content) - s.requested_changes.set([]) - s.recorded_changes.set([]) - s.committed_changes.set([]) - return undefined - }) - } - - async callZome(fn_name, payload?, timeout?) { - return this.zome.call(fn_name, payload, timeout) - } - - async getFolks():Promise<HoloHash[]> { - return this.callZome('get_folks') - } - - async getSessions():Promise<HoloHash[]> { - return this.callZome('get_sessions') - } - - async getSession(session_hash:HoloHash):Promise<SessionInfo> { - return this.callZome('get_session', session_hash) - } - - async newSession():Promise<Session> { - const rawSessionInfo:SessionInfo = await this.callZome( - 'new_session', - { content: this.default_content } - ) - const $session = new Session(this.ctx, this, rawSessionInfo) - this.session.set($session) - return $session - } - - async sendSyncReq():Promise<{ sessionInfo:SessionInfo }> { - return this.callZome('send_sync_request', { scribe: this.session.$.scribe }) - } - -} diff --git a/ui/libs/model/src/session/commit_change_b.ts b/ui/libs/model/src/session/commit_change_b.ts index 50eeb56a..4ce0183a 100644 --- a/ui/libs/model/src/session/commit_change_b.ts +++ b/ui/libs/model/src/session/commit_change_b.ts @@ -26,7 +26,8 @@ export const commit_change_b = _b('commit_change', (ctx)=>{ const committed_changes = committed_changes_b(ctx) const session_info = session_info_b(ctx) return async function commit_change() { - if (am_i_scribe_b(ctx).$) { + const am_i_scribe = am_i_scribe_b(ctx) + if (am_i_scribe.$ === true) { const $recorded_changes = recorded_changes.$ if ($recorded_changes.length == 0) { alert('No changes to commit!') @@ -61,7 +62,10 @@ export const commit_change_b = _b('commit_change', (ctx)=>{ content_hash: new_content_hash }) ) - committed_changes.push(...$recorded_changes) + committed_changes.update($committed_changes=>{ + $committed_changes.push(...$recorded_changes) + return $committed_changes + }) recorded_changes.set([]) } catch (e) { console.log('Error:', e) diff --git a/ui/libs/model/src/session/commit_in_progress_b.ts b/ui/libs/model/src/session/commit_in_progress_b.ts index 7fc29143..2d30f196 100644 --- a/ui/libs/model/src/session/commit_in_progress_b.ts +++ b/ui/libs/model/src/session/commit_in_progress_b.ts @@ -1,5 +1,5 @@ import { _b } from '@ctx-core/object' -import { writable } from '@ctx-core/store' +import { writable$ } from '@ctx-core/store' export const commit_in_progress_b = _b('commit_in_progress', ()=> - writable<boolean>(false) + writable$<boolean>(false) ) diff --git a/ui/libs/model/src/session/content_hash_b.ts b/ui/libs/model/src/session/content_hash_b.ts index 467a34c1..5067c53d 100644 --- a/ui/libs/model/src/session/content_hash_b.ts +++ b/ui/libs/model/src/session/content_hash_b.ts @@ -1,28 +1,17 @@ -import { _b, assign } from '@ctx-core/object' -import { derived$, Readable } from '@ctx-core/store' +import { _b } from '@ctx-core/object' +import { derived$, mix_set_readable$ } from '@ctx-core/store' import { session_info_b } from './session_info_b' -import type { Readable$ } from '@ctx-core/store/src/readable$' -import type { EntryHash } from '@syn-ui/utils' -import { mix_writable$ } from '@ctx-core/store/src/writable$' export const content_hash_b = _b('content_hash', (ctx)=>{ const session_info = session_info_b(ctx) - return mix_writable$(mix_readable_set(derived$(session_info, $session_info=> - $session_info?.content_hash - ), $content_hash=>session_info.update($session_info=>{ - $session_info.content_hash = $content_hash - return $session_info - }))) + return mix_set_readable$( + derived$(session_info, $session_info=>{ + return $session_info?.content_hash + }), + $content_hash=>{ + session_info.update($session_info=>{ + $session_info.content_hash = $content_hash + return $session_info + }) + } + ) }) -export interface content_hash_I extends Readable$<EntryHash> { - -} -export interface mix_readable_set_I<Val extends unknown = unknown> extends Readable<Val> { - set(val:Val):void -} -export function mix_readable_set<Val extends unknown = unknown>( - store:Readable<Val>, set:(val:Val)=>void -):mix_readable_set_I<Val> { - return assign(store as mix_readable_set_I<Val>, { - set - }) -} diff --git a/ui/libs/model/src/session/deltas_b.ts b/ui/libs/model/src/session/deltas_b.ts new file mode 100644 index 00000000..1ae0e956 --- /dev/null +++ b/ui/libs/model/src/session/deltas_b.ts @@ -0,0 +1,12 @@ +import { _b } from '@ctx-core/object' +import { session_info_b } from './session_info_b' +import { derived$ } from '@ctx-core/store' +import type { Delta } from '@syn-ui/zome-client' +export const deltas_b = _b('deltas', (ctx)=>{ + const session_info = session_info_b(ctx) + return derived$(session_info, $session_info=> + $session_info ? $session_info.deltas.map( + serialized_delta=>JSON.parse(serialized_delta) + ) as Delta[] : null + ) +}) diff --git a/ui/libs/model/src/session/index.ts b/ui/libs/model/src/session/index.ts index c66a100c..aa8dce10 100644 --- a/ui/libs/model/src/session/index.ts +++ b/ui/libs/model/src/session/index.ts @@ -1,17 +1,17 @@ +export * from './am_i_scribe_b' export * from './commit_change_b' export * from './commit_in_progress_b' export * from './content_hash_b' export * from './content_hash_str_b' export * from './current_commit_header_hash_b' +export * from './deltas_b' export * from './folks_b' -export * from './join_session' +export * from './record_deltas_b' export * from './scribe_b' export * from './scribe_str_b' -export * from './Session' export * from './session_info_b' export * from './sessions_b' +export * from './snapshot_content_b' export * from './snapshot_hash_b' export * from './snapshot_hash_str_b' -export * from './Syn' -export * from './SyncReq_ops_b' export * from './update_folks_b' diff --git a/ui/libs/model/src/session/join_session.ts b/ui/libs/model/src/session/join_session.ts deleted file mode 100644 index 980f8b6f..00000000 --- a/ui/libs/model/src/session/join_session.ts +++ /dev/null @@ -1,93 +0,0 @@ -import type { AppSignal } from '@holochain/conductor-api' -import { clone } from '@ctx-core/object' -import { I } from '@ctx-core/combinators' -import { subscribe_wait_timeout } from '@ctx-core/store' -import { bufferToBase64 } from '@syn-ui/utils' -import { - app_id_b, app_port_b, app_ws_cb_b, decodeJson, me_b, rpc_get_session_b, - rpc_new_session_b, rpc_send_sync_request_b, SessionInfo, -} from '@syn-ui/zome-client' -import { apply_delta_fn_T, apply_delta_fn_b } from '../delta' -import { SyncReq_ops_b } from './SyncReq_ops_b' -import { sessions_b } from './sessions_b' -import { session_info_b } from './session_info_b' -import { SyncResp_ops_b } from './SyncResp_ops_b' -import { am_i_scribe_b } from './am_i_scribe_b' -import { ChangeReq_ops_b } from './ChangeReq_ops_b' -import { Change_ops_b } from './Change_ops_b' -import type { Ops } from './Ops' -import { FolkLore_ops_b } from './FolkLore_ops_b' -import { Heartbeat_ops_b } from './Heartbeat_ops_b' -export async function join_session(params:join_session_params_T) { - const ctx = params.ctx || {} - const me = me_b(ctx) - const sessions = sessions_b(ctx) - const ops:Ops = clone( - Change_ops_b(ctx), - ChangeReq_ops_b(ctx), - FolkLore_ops_b(ctx), - Heartbeat_ops_b(ctx), - SyncReq_ops_b(ctx), - SyncResp_ops_b(ctx), - ) - app_ws_cb_b(ctx).set($app_ws_cb) - app_id_b(ctx).set(params.app_id) - app_port_b(ctx).set(params.app_port) - apply_delta_fn_b(ctx).set(params.apply_delta_fn) - const $sessions = await subscribe_wait_timeout(sessions, I, 10_000) - const session_info = session_info_b(ctx) - let $session_info:SessionInfo - if ($sessions.length === 0) { - $session_info = await rpc_new_session_b(ctx)() - sessions.unshift($session_info.session) - } else { - $session_info = await rpc_get_session_b(ctx)($sessions[0]) - if (am_i_scribe_b(ctx).$) { - await rpc_send_sync_request_b(ctx)($session_info) - } - } - session_info.set($session_info) - async function $app_ws_cb(signal:AppSignal) { - // ignore signals not meant for me - if (bufferToBase64(signal.data.cellId[1]) !== me.$) { - return - } - const { signal_name } = signal.data.payload - console.log('Got Signal', signal_name, signal) - const op = ops[signal_name] - if (!op) { - console.warn(`Undefined Op: ${signal_name}`) - } - await op(signal) - switch (signal.data.payload.signal_name) { - case 'SyncReq': - await SyncReq_ops_b(ctx) - break - case 'SyncResp': - await SyncResp_ops_b(ctx) - break - case 'ChangeReq': - await ChangeReq_ops_b(ctx) - break - case 'Change': - await Change_ops_b(ctx) - break - case 'FolkLore': { - FolkLore_ops_b(ctx) - break - } - case 'Heartbeat': { - Heartbeat_ops_b(ctx) - break - } - case 'CommitNotice': - connection.session.commitNotice(signal.data.payload.signal_payload) - } - } -} -export interface join_session_params_T { - app_port:number - app_id:string - apply_delta_fn:apply_delta_fn_T - ctx?:object -} diff --git a/ui/libs/model/src/session/record_deltas_b.ts b/ui/libs/model/src/session/record_deltas_b.ts index d9e14180..e74cb663 100644 --- a/ui/libs/model/src/session/record_deltas_b.ts +++ b/ui/libs/model/src/session/record_deltas_b.ts @@ -10,7 +10,8 @@ export const record_deltas_b = _b('record_deltas', (ctx)=>{ if ($requested_changes.length > 0) { // if this change is our next requested change then remove it if (JSON.stringify(delta) == JSON.stringify($requested_changes[0].delta)) { - recorded_changes_b(ctx).push($requested_changes.shift()) + const recorded_changes = recorded_changes_b(ctx) + recorded_changes.push($requested_changes.shift()) requested_changes.set($requested_changes) } else { // TODO rebase? @@ -23,7 +24,8 @@ export const record_deltas_b = _b('record_deltas', (ctx)=>{ // to check our requested changes // TODO: do we need to check if this is a change that we did send and have already // integrated somehow and ignore if so. (Seems unlikely?) - record_delta_b(ctx)(delta) + const record_delta = record_delta_b(ctx) + record_delta(delta) } } } diff --git a/ui/libs/model/src/session/session_info_b.ts b/ui/libs/model/src/session/session_info_b.ts index 99850a80..49679640 100644 --- a/ui/libs/model/src/session/session_info_b.ts +++ b/ui/libs/model/src/session/session_info_b.ts @@ -1,6 +1,19 @@ -import { _b } from '@ctx-core/object' -import { writable$ } from '@ctx-core/store' -import type { SessionInfo } from '@syn-ui/zome-client' -export const session_info_b = _b('session_info', ()=> - writable$<SessionInfo>(null) -) +import { _b, assign } from '@ctx-core/object' +import { writable$, Writable$ } from '@ctx-core/store' +import { rpc_get_session_b, SessionInfo } from '@syn-ui/zome-client' +export const session_info_b = _b<session_info_I>('session_info', (ctx)=>{ + const rpc_get_session = rpc_get_session_b(ctx) + const session_info = assign(writable$(null), { + refresh + }) + return session_info + async function refresh() { + const $session_info = session_info.$ + if ($session_info) { + await rpc_get_session($session_info.session) + } + } +}) +export interface session_info_I extends Writable$<SessionInfo> { + refresh():Promise<void> +} diff --git a/ui/libs/model/src/session/session_info_session_b.ts b/ui/libs/model/src/session/session_info_session_b.ts new file mode 100644 index 00000000..36019fa7 --- /dev/null +++ b/ui/libs/model/src/session/session_info_session_b.ts @@ -0,0 +1,9 @@ +import { _b } from '@ctx-core/object' +import { derived$ } from '@ctx-core/store' +import { session_info_b } from './session_info_b' +export const session_info_session_b = _b('session_info_session', (ctx)=>{ + const session_info = session_info_b(ctx) + return derived$(session_info, $session_info=> + $session_info?.session + ) +}) diff --git a/ui/libs/model/src/session/sessions_b.ts b/ui/libs/model/src/session/sessions_b.ts index bc1b48b0..b8ec4550 100644 --- a/ui/libs/model/src/session/sessions_b.ts +++ b/ui/libs/model/src/session/sessions_b.ts @@ -1,33 +1,42 @@ -import type { HoloHash } from '@holochain/conductor-api' -import { _b } from '@ctx-core/object' +import { _b, assign } from '@ctx-core/object' import { Writable$, writable$ } from '@ctx-core/store' import { rpc_get_sessions_b } from '@syn-ui/zome-client' -import { assign } from 'svelte/internal' +import type { EntryHash } from '@syn-ui/utils' +import { session_info_b } from './session_info_b' export const sessions_b = _b('sessions', (ctx)=>{ const rpc_get_sessions = rpc_get_sessions_b(ctx) - const sessions = writable$<HoloHash[]>(null) + const session_info = session_info_b(ctx) + const sessions = writable$<EntryHash[]>(null) const busy = writable$<boolean>(false) - load().then() const out_sessions = sessions as sessions_T assign(out_sessions, { busy, load, unshift }) + session_info.subscribe(async ($session_info) => { + if ($session_info) { + if (!busy.$) { + await load() + } + } else { + sessions.$ = null + } + }) return out_sessions async function load() { - busy.set(true) + busy.$ = true try { - return await rpc_get_sessions() + sessions.$ = await rpc_get_sessions() } finally { - busy.set(false) + busy.$ = false } } - function unshift(...session_hash_a1:HoloHash[]) { + function unshift(...session_hash_a1:EntryHash[]) { const $sessions = sessions.$ $sessions.unshift(...session_hash_a1) sessions.set($sessions) return $sessions } }) -export interface sessions_T extends Writable$<HoloHash[]> { +export interface sessions_T extends Writable$<EntryHash[]> { busy:Writable$<boolean> - load():Promise<HoloHash> - unshift(...session_hash_a1:HoloHash[]):HoloHash[] + load():Promise<EntryHash> + unshift(...session_hash_a1:EntryHash[]):EntryHash[] } diff --git a/ui/libs/model/src/session/snapshot_content_b.ts b/ui/libs/model/src/session/snapshot_content_b.ts new file mode 100644 index 00000000..b1603baa --- /dev/null +++ b/ui/libs/model/src/session/snapshot_content_b.ts @@ -0,0 +1,34 @@ +import { _b } from '@ctx-core/object' +import { derived$ } from '@ctx-core/store' +import { Content, my_tag_b } from '@syn-ui/zome-client' +import { apply_delta_fn_b } from '../delta' +import { content_b } from '../content' +import { session_info_b } from './session_info_b' +import { deltas_b } from './deltas_b' +export const snapshot_content_b = _b('snapshot_content', (ctx)=>{ + const session_info = session_info_b(ctx) + const my_tag = my_tag_b(ctx) + const apply_delta_fn = apply_delta_fn_b(ctx) + const deltas = deltas_b(ctx) + const content = content_b(ctx) + const snapshot_content = derived$(session_info, $session_info=> + $session_info?.snapshot_content + ) + snapshot_content.subscribe($snapshot_content=>{ + let $content:Content = { + ...$snapshot_content, + meta: { + [my_tag.$]: 0 + } + } + const new_$committed_changes = [] + const $apply_delta_fn = apply_delta_fn.$ + for (const delta of deltas.$) { + const [in_$content, change] = $apply_delta_fn($content, delta) + $content = in_$content + new_$committed_changes.push(change) + } + content.$ = $content + }) + return snapshot_content +}) diff --git a/ui/libs/model/src/session/sync_response_b.ts b/ui/libs/model/src/session/sync_response_b.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/ui/libs/model/src/session/update_folks_b.ts b/ui/libs/model/src/session/update_folks_b.ts index 482e8984..2071ed24 100644 --- a/ui/libs/model/src/session/update_folks_b.ts +++ b/ui/libs/model/src/session/update_folks_b.ts @@ -1,8 +1,9 @@ -import type { HoloHash } from '@holochain/conductor-api' +import type { AgentPubKey } from '@holochain/conductor-api' import { _b } from '@ctx-core/object' -import { get } from '@ctx-core/store' import { bufferToBase64 } from '@syn-ui/utils' -import { Folk, FOLK_GONE, FOLK_SEEN, FOLK_UNKNOWN, FolkStatus, me_b, PubKeyToFolkRecord } from '@syn-ui/zome-client' +import { + Folk, FOLK_GONE, FOLK_SEEN, FOLK_UNKNOWN, FolkStatus, PubKeyToFolkRecord +} from '@syn-ui/zome-client' import { getFolkColors } from '../colors' import { folks_b } from './folks_b' import { am_i_scribe_b } from './am_i_scribe_b' @@ -10,7 +11,7 @@ export const update_folks_b = _b('update_folks', (ctx)=>{ const am_i_scribe = am_i_scribe_b(ctx) const folks = folks_b(ctx) return update_folks - function update_folks(pubKey:HoloHash, status:FolkStatus, meta?:number) { + function update_folks(pubKey:AgentPubKey, status:FolkStatus, meta?:number) { const pubKeyStr = bufferToBase64(pubKey) if (am_i_scribe.$) { return @@ -33,7 +34,7 @@ export const update_folks_b = _b('update_folks', (ctx)=>{ } folks.set($folks) } - function _other($folks:PubKeyToFolkRecord, pubKeyStr:string, pubKey:HoloHash) { + function _other($folks:PubKeyToFolkRecord, pubKeyStr:string, pubKey:AgentPubKey) { if (!(pubKeyStr in $folks)) { const colors = getFolkColors(pubKey) $folks[pubKeyStr] = { pubKey, colors } as Folk diff --git a/ui/libs/model/src/session/ChangeReq_ops_b.ts b/ui/libs/model/src/signals/ChangeReq_SignalOps_b.ts similarity index 83% rename from ui/libs/model/src/session/ChangeReq_ops_b.ts rename to ui/libs/model/src/signals/ChangeReq_SignalOps_b.ts index b7eb0cd7..c3d75aac 100644 --- a/ui/libs/model/src/session/ChangeReq_ops_b.ts +++ b/ui/libs/model/src/signals/ChangeReq_SignalOps_b.ts @@ -1,10 +1,9 @@ import { _b } from '@ctx-core/object' import type { Delta } from '@syn-ui/zome-client' -import { am_i_scribe_b } from './am_i_scribe_b' import { next_index_b, send_change_b } from '../delta' -import { record_deltas_b } from './record_deltas_b' -import type { Ops } from './Ops' -export const ChangeReq_ops_b = _b<Ops>('ChangeReq_ops', (ctx)=>{ +import { am_i_scribe_b, record_deltas_b } from '../session' +import type { SignalOps } from './SignalOps' +export const ChangeReq_SignalOps_b = _b<SignalOps>('ChangeReq_SignalOps', (ctx)=>{ const am_i_scribe = am_i_scribe_b(ctx) const next_index = next_index_b(ctx) const send_change = send_change_b(ctx) @@ -29,7 +28,8 @@ export const ChangeReq_ops_b = _b<Ops>('ChangeReq_ops', (ctx)=>{ return } } - record_deltas_b(ctx)(index, deltas) + const record_deltas = record_deltas_b(ctx) + record_deltas(index, deltas) // notify all participants of the change await send_change({ index, deltas }) } diff --git a/ui/libs/model/src/session/Change_ops_b.ts b/ui/libs/model/src/signals/Change_SignalOps_b.ts similarity index 69% rename from ui/libs/model/src/session/Change_ops_b.ts rename to ui/libs/model/src/signals/Change_SignalOps_b.ts index 9f28b235..cd9b7405 100644 --- a/ui/libs/model/src/session/Change_ops_b.ts +++ b/ui/libs/model/src/signals/Change_SignalOps_b.ts @@ -1,27 +1,28 @@ import type { AppSignal } from '@holochain/conductor-api' import { _b } from '@ctx-core/object' import { next_index_b } from '../delta' -import { am_i_scribe_b } from './am_i_scribe_b' -import { record_deltas_b } from './record_deltas_b' -import type { Ops } from './Ops' -export const Change_ops_b = _b('Change_ops', (ctx)=>{ +import { am_i_scribe_b, record_deltas_b } from '../session' +import type { SignalOps } from './SignalOps' +export const Change_SignalOps_b = _b<SignalOps>('Change_SignalOps', (ctx)=>{ const next_index = next_index_b(ctx) return { Change: async (signal:AppSignal)=>{ const [index, serialized_deltas] = signal.data.payload.signal_payload const deltas = serialized_deltas.map(d=>JSON.parse(d)) - if (am_i_scribe_b(ctx).$ === true) { + const am_i_scribe = am_i_scribe_b(ctx) + if (am_i_scribe.$ === true) { console.log('change received but I\'m the scribe, so I\'m ignoring this!') } else { console.log(`change arrived for ${index}:`, deltas) const $next_index = next_index.$ if ($next_index === index) { - record_deltas_b(ctx)(index, deltas) + const record_deltas = record_deltas_b(ctx) + record_deltas(index, deltas) } else { console.log(`change arrived out of sequence next_index: ${$next_index}, change index:${index}`) // TODO either call for sync, or do some waiting algorithm } } } - } as Ops + } }) diff --git a/ui/libs/model/src/signals/CommitNotice_SignalOps_b.ts b/ui/libs/model/src/signals/CommitNotice_SignalOps_b.ts new file mode 100644 index 00000000..631c3e1d --- /dev/null +++ b/ui/libs/model/src/signals/CommitNotice_SignalOps_b.ts @@ -0,0 +1,42 @@ +import { _b } from '@ctx-core/object' +import { bufferToBase64, EntryHash, HeaderHash } from '@syn-ui/utils' +import { committed_changes_b, next_index_b, recorded_changes_b } from '../delta' +import { content_hash_b, content_hash_str_b } from '../session' +import type { SignalOps } from './SignalOps' +export const CommitNotice_SignalOps_b = _b<SignalOps>('CommitNotice_SignalOps', (ctx)=>{ + const content_hash = content_hash_b(ctx) + const content_hash_str = content_hash_str_b(ctx) + const next_index = next_index_b(ctx) + const committed_changes = committed_changes_b(ctx) + const recorded_changes = recorded_changes_b(ctx) + return { + CommitNotice: async (signal)=>{ + const commit_info:CommitInfo = signal.data.payload.signal_payload + // make sure we are at the right place to be able to just move forward with the commit + const $content_hash_str = content_hash_str.$ + if ($content_hash_str == bufferToBase64(commit_info.previous_content_hash) && + next_index.$ === commit_info.deltas_committed) { + content_hash.$ = commit_info.commit_content_hash + committed_changes.update($committed_changes=>{ + $committed_changes.push(...recorded_changes.$) + return $committed_changes + }) + recorded_changes.$ = [] + } else { + console.log('received commit notice for beyond our last commit, gotta resync') + console.log('commit.commit_content_hash:', bufferToBase64(commit_info.commit_content_hash)) + console.log('commit.previous_content_hash:', bufferToBase64(commit_info.previous_content_hash)) + console.log('commit.deltas_committed:', commit_info.deltas_committed) + console.log('my $session.contentHashStr', $content_hash_str) + console.log('my next_index', next_index.$) + // TODO resync + } + } + } +}) +export interface CommitInfo { + deltas_committed:number + commit_content_hash:EntryHash + previous_content_hash:EntryHash + commit:HeaderHash +} diff --git a/ui/libs/model/src/session/FolkLore_ops_b.ts b/ui/libs/model/src/signals/FolkLore_SignalOps_b.ts similarity index 55% rename from ui/libs/model/src/session/FolkLore_ops_b.ts rename to ui/libs/model/src/signals/FolkLore_SignalOps_b.ts index f3d04e6c..f1b092c6 100644 --- a/ui/libs/model/src/session/FolkLore_ops_b.ts +++ b/ui/libs/model/src/signals/FolkLore_SignalOps_b.ts @@ -1,9 +1,8 @@ import { _b } from '@ctx-core/object' import { decodeJson, FOLK_GONE, FOLK_UNKNOWN } from '@syn-ui/zome-client' -import { am_i_scribe_b } from './am_i_scribe_b' -import { update_folks_b } from './update_folks_b' -import type { Ops } from './Ops' -export const FolkLore_ops_b = _b<Ops>('FolkLore_ops', (ctx)=>{ +import { am_i_scribe_b, update_folks_b } from '../session' +import type { SignalOps } from './SignalOps' +export const FolkLore_SignalOps_b = _b<SignalOps>('FolkLore_SignalOps', (ctx)=>{ const am_i_scribe = am_i_scribe_b(ctx) const update_folks = update_folks_b(ctx) return { @@ -11,19 +10,18 @@ export const FolkLore_ops_b = _b<Ops>('FolkLore_ops', (ctx)=>{ const data = decodeJson(signal.data.payload.signal_payload) console.log('got folklore', data) if (am_i_scribe.$) { - console.log('folklore received but I\'m the scribe!') + console.log(`folklore received but I'm the scribe!`) } else { - if (data.gone) { - Object.values(data.participants).forEach( - pubKey=>{ - update_folks(pubKey, FOLK_GONE) - } - ) + const { gone, participants } = data + if (gone) { + for (const pubKey of gone) { + update_folks(pubKey, FOLK_GONE) + } } // TODO move last seen into p.meta so that we can update that value // as hearsay. - if (data.participants) { - Object.values(data.participants).forEach( + if (participants) { + Object.values(participants).forEach( p=>{ update_folks(p.pubKey, FOLK_UNKNOWN, p.meta) } diff --git a/ui/libs/model/src/session/Heartbeat_ops_b.ts b/ui/libs/model/src/signals/Heartbeat_SignalOps_b.ts similarity index 76% rename from ui/libs/model/src/session/Heartbeat_ops_b.ts rename to ui/libs/model/src/signals/Heartbeat_SignalOps_b.ts index d76a1b3d..8497be04 100644 --- a/ui/libs/model/src/session/Heartbeat_ops_b.ts +++ b/ui/libs/model/src/signals/Heartbeat_SignalOps_b.ts @@ -1,9 +1,8 @@ import { _b } from '@ctx-core/object' -import type { Ops } from './Ops' import { decodeJson, FOLK_SEEN } from '@syn-ui/zome-client' -import { am_i_scribe_b } from './am_i_scribe_b' -import { update_folks_b } from './update_folks_b' -export const Heartbeat_ops_b = _b<Ops>('Heartbeat_ops', (ctx)=>{ +import { am_i_scribe_b, update_folks_b } from '../session' +import type { SignalOps } from './SignalOps' +export const Heartbeat_SignalOps_b = _b<SignalOps>('Heartbeat_SignalOps', (ctx)=>{ const am_i_scribe = am_i_scribe_b(ctx) const update_folks = update_folks_b(ctx) return { diff --git a/ui/libs/model/src/signals/SignalOps.ts b/ui/libs/model/src/signals/SignalOps.ts new file mode 100644 index 00000000..2ccb8b68 --- /dev/null +++ b/ui/libs/model/src/signals/SignalOps.ts @@ -0,0 +1,3 @@ +import type { AppSignal } from '@holochain/conductor-api' +export type SignalOp = (signal:AppSignal)=>Promise<void> +export interface SignalOps extends Record<string, SignalOp> {} diff --git a/ui/libs/model/src/session/SyncReq_ops_b.ts b/ui/libs/model/src/signals/SyncReq_SignalOps_b.ts similarity index 79% rename from ui/libs/model/src/session/SyncReq_ops_b.ts rename to ui/libs/model/src/signals/SyncReq_SignalOps_b.ts index c16a1000..b48f89c0 100644 --- a/ui/libs/model/src/session/SyncReq_ops_b.ts +++ b/ui/libs/model/src/signals/SyncReq_SignalOps_b.ts @@ -4,14 +4,12 @@ import { agent_pub_key_b, FOLK_SEEN, me_b, rpc_send_folk_lore_b, rpc_send_sync_response_b, StateForSync } from '@syn-ui/zome-client' import { _scribe_signal_folk_pubKey_a1_b, recorded_changes_b } from '../delta' -import { update_folks_b } from './update_folks_b' -import { snapshot_hash_b } from './snapshot_hash_b' -import { content_hash_b } from './content_hash_b' -import { current_commit_header_hash_b } from './current_commit_header_hash_b' -import { folks_b } from './folks_b' -import { am_i_scribe_b } from './am_i_scribe_b' -import type { Ops } from './Ops' -export const SyncReq_ops_b = _b<Ops>('SyncReq_ops', (ctx)=>{ +import { + am_i_scribe_b, content_hash_b, current_commit_header_hash_b, folks_b, + snapshot_hash_b, update_folks_b +} from '../session' +import type { SignalOps } from './SignalOps' +export const SyncReq_SignalOps_b = _b<SignalOps>('SyncReq_SignalOps', (ctx)=>{ const me = me_b(ctx) const folks = folks_b(ctx) const update_folks = update_folks_b(ctx) @@ -26,7 +24,8 @@ export const SyncReq_ops_b = _b<Ops>('SyncReq_ops', (ctx)=>{ SyncReq: async (signal)=>{ const participant:HoloHash = signal.data.payload.signal_payload const $me = me.$ - if (am_i_scribe_b(ctx).$) { + const am_i_scribe = am_i_scribe_b(ctx) + if (am_i_scribe.$ === true) { update_folks(participant, FOLK_SEEN) const state:StateForSync = { snapshot: snapshot_hash.$, @@ -42,8 +41,9 @@ export const SyncReq_ops_b = _b<Ops>('SyncReq_ops', (ctx)=>{ // and send everybody a folk lore p2p message with new participants const $folks = folks.$ let p = { ...$folks } + const agent_pub_key = agent_pub_key_b(ctx) p[$me] = { - pubKey: agent_pub_key_b(ctx).$ + pubKey: agent_pub_key.$ } const data = { participants: p } await rpc_send_folk_lore({ diff --git a/ui/libs/model/src/session/SyncResp_ops_b.ts b/ui/libs/model/src/signals/SyncResp_SignalOps_b.ts similarity index 86% rename from ui/libs/model/src/session/SyncResp_ops_b.ts rename to ui/libs/model/src/signals/SyncResp_SignalOps_b.ts index 9c552120..741688b8 100644 --- a/ui/libs/model/src/session/SyncResp_ops_b.ts +++ b/ui/libs/model/src/signals/SyncResp_SignalOps_b.ts @@ -2,9 +2,9 @@ import { _b, assign } from '@ctx-core/object' import { bufferToBase64 } from '@syn-ui/utils' import type { SerializedStateForSync, StateForSync } from '../delta' import { record_delta_b } from '../delta' -import { content_hash_str_b } from './content_hash_str_b' -import type { Ops } from './Ops' -export const SyncResp_ops_b = _b<Ops>('SyncResp_ops', (ctx)=>{ +import { content_hash_str_b } from '../session' +import type { SignalOps } from './SignalOps' +export const SyncResp_SignalOps_b = _b<SignalOps>('SyncResp_SignalOps', (ctx)=>{ const content_hash_str = content_hash_str_b(ctx) const record_delta = record_delta_b(ctx) return { diff --git a/ui/libs/model/src/signals/index.ts b/ui/libs/model/src/signals/index.ts new file mode 100644 index 00000000..93895c90 --- /dev/null +++ b/ui/libs/model/src/signals/index.ts @@ -0,0 +1,8 @@ +export * from './ChangeReq_SignalOps_b' +export * from './Change_SignalOps_b' +export * from './CommitNotice_SignalOps_b' +export * from './FolkLore_SignalOps_b' +export * from './Heartbeat_SignalOps_b' +export * from './SignalOps' +export * from './SyncReq_SignalOps_b' +export * from './SyncResp_SignalOps_b' diff --git a/ui/libs/model/src/timers/Timer.ts b/ui/libs/model/src/timers/Timer.ts new file mode 100644 index 00000000..666d6324 --- /dev/null +++ b/ui/libs/model/src/timers/Timer.ts @@ -0,0 +1,15 @@ +export class Timer { + interval_id:any + constructor(protected setInterval_fn:()=>void, protected interval_ms:number) {} + start() { + this.stop() + this.interval_id = setInterval(this.setInterval_fn, this.interval_ms) + } + stop() { + const { interval_id } = this + if (interval_id) { + clearInterval(interval_id) + this.interval_id = null + } + } +} diff --git a/ui/libs/model/src/timers/index.ts b/ui/libs/model/src/timers/index.ts new file mode 100644 index 00000000..2e098ed3 --- /dev/null +++ b/ui/libs/model/src/timers/index.ts @@ -0,0 +1,3 @@ +export * from './request_checker_timer_b' +export * from './scribe_heartbeat_timer_b' +export * from './Timer' diff --git a/ui/libs/model/src/timers/request_checker_timer_b.ts b/ui/libs/model/src/timers/request_checker_timer_b.ts new file mode 100644 index 00000000..8e2dc0de --- /dev/null +++ b/ui/libs/model/src/timers/request_checker_timer_b.ts @@ -0,0 +1,38 @@ +import { _b } from '@ctx-core/object' +import { rpc_send_sync_request_b } from '@syn-ui/zome-client' +import { requested_changes_b } from '../delta' +import { session_info_b } from '../session' +import { Timer } from './Timer' +const request_timeout = 1000 +export const request_checker_timer_b = _b('request_checker_timer', (ctx)=>{ + const requested_changes = requested_changes_b(ctx) + const session_info = session_info_b(ctx) + const rpc_send_sync_request = rpc_send_sync_request_b(ctx) + return new Timer(async ()=>{ + const $requested_changes = requested_changes.$ + if ($requested_changes.length > 0) { + if ((Date.now() - $requested_changes[0].at) > request_timeout) { + // for now let's just do the most drastic thing! + /* + console.log('requested change timed out! Undoing all changes', $requested_changes[0]) + // TODO: make sure this is transactional and no request_changes squeak in ! + while ($requested_changes.length > 0) { + requested_changes.update(changes => { + const change = changes.pop() + console.log('undoing ', change) + const undoDelta = undoFn(change) + console.log('undoDelta: ', undoDelta) + apply_delta_fn(undoDelta) + return changes + }) + }*/ + + // and send a sync request incase something just got out of sequence + // TODO: prepare for shifting to new scribe if they went offline + await session_info.refresh() + console.log('HERE') + await rpc_send_sync_request(session_info.$) + } + } + }, request_timeout / 2) +}) diff --git a/ui/libs/model/src/timers/scribe_heartbeat_timer_b.ts b/ui/libs/model/src/timers/scribe_heartbeat_timer_b.ts new file mode 100644 index 00000000..638f8f72 --- /dev/null +++ b/ui/libs/model/src/timers/scribe_heartbeat_timer_b.ts @@ -0,0 +1,44 @@ +import { _b } from '@ctx-core/object' +import { rpc_send_folk_lore_b, rpc_send_heartbeat_b } from '@syn-ui/zome-client' +import { am_i_scribe_b, folks_b, scribe_b } from '../session' +import { _scribe_signal_folk_pubKey_a1_b } from '../delta' +import { Timer } from './Timer' +// const outOfSessionTimout = 30 * 1000 +const outOfSessionTimout = 8 * 1000 // testing code :) +// const heartbeatInterval = 15 * 1000 // 15 seconds +const heartbeat_interval = 30 * 1000 // for testing ;) +export const scribe_heartbeat_timer_b = _b<Timer>('scribe_heartbeat_timer', (ctx)=>{ + const am_i_scribe = am_i_scribe_b(ctx) + const folks = folks_b(ctx) + return new Timer(async ()=>{ + if (am_i_scribe.$ === true) { + // examine folks last seen time and see if any have crossed the session out-of-session + // timeout so we can tell everybody else about them having dropped. + const gone = [] + const $folks = folks.$ + for (const [pubKeyStr, folk] of Object.entries($folks)) { + if (folk.inSession && (Date.now() - $folks[pubKeyStr].lastSeen > outOfSessionTimout)) { + folk.inSession = false + gone.push($folks[pubKeyStr].pubKey) + } + } + if (gone.length > 0) { + folks.$ = $folks + const rpc_send_folk_lore = rpc_send_folk_lore_b(ctx) + const _scribe_signal_folk_pubKey_a1 = _scribe_signal_folk_pubKey_a1_b(ctx) + await rpc_send_folk_lore({ + participants: _scribe_signal_folk_pubKey_a1(), + data: { gone } + }) + } + } else { + // I'm not the scribe so send them a heartbeat + const rpc_send_heartbeat = rpc_send_heartbeat_b(ctx) + const scribe = scribe_b(ctx) + await rpc_send_heartbeat({ + scribe: scribe.$, + data: 'Hello' + }) + } + }, heartbeat_interval) +}) diff --git a/ui/libs/zome-client/package.json b/ui/libs/zome-client/package.json index 68ae77d2..ab7fef1b 100644 --- a/ui/libs/zome-client/package.json +++ b/ui/libs/zome-client/package.json @@ -8,7 +8,7 @@ "devDependencies": { "@ctx-core/function": "^17.4.7", "@ctx-core/object": "^17.5.9", - "@ctx-core/store": "^24.3.1", + "@ctx-core/store": "^24.5.0", "@syn-ui/utils": "workspace:^1.0.0", "typescript": "^4.2.4" } diff --git a/ui/libs/zome-client/src/ApiResponse.ts b/ui/libs/zome-client/src/ApiResponse.ts index e0304192..ae46d277 100644 --- a/ui/libs/zome-client/src/ApiResponse.ts +++ b/ui/libs/zome-client/src/ApiResponse.ts @@ -1,7 +1,7 @@ -import type { HoloHash } from '@holochain/conductor-api' +import type { AgentPubKey } from '@holochain/conductor-api' import type { Participant } from './Participant' export interface ApiResponse extends Record<string, any> { - pubKey:HoloHash - gone?:boolean + pubKey:AgentPubKey + gone?:AgentPubKey[] participants:Participant[] } diff --git a/ui/libs/zome-client/src/Connection.ts b/ui/libs/zome-client/src/Connection.ts deleted file mode 100644 index 75c249d5..00000000 --- a/ui/libs/zome-client/src/Connection.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { AppSignal, AppWebsocket, HoloHash } from '@holochain/conductor-api' -import { Session } from '../session' -import type { Content } from '../content' -import type { apply_delta_fn_T } from '../delta' -import { bufferToBase64, decodeJson } from '../utils' -import { Syn } from '../Syn' -export class Connection { - constructor(public ctx, public app_port:number, public app_id:string) { - } - app_ws:AppWebsocket - session:Session - sessions:HoloHash[] - syn:Syn - - async open(default_content:Content, applyDeltaFn:apply_delta_fn_T) { - const self = this - this.app_ws = await AppWebsocket.connect( - `ws://localhost:${this.app_port}`, - 30000, - (signal)=>signalHandler(self, signal)) - - console.log('connection established:', this) - - // TODO: in the future we should be able manage and to attach to multiple syn happs - this.syn = new Syn(this.ctx, default_content, applyDeltaFn, this.app_ws, this.app_id) - await this.syn.attach() - this.sessions = await this.syn.getSessions() - } - - async joinSession() { - if (!this.syn) { - console.log('join session called without syn app opened') - return - } - if (this.sessions.length == 0) { - this.session = await this.syn.newSession() - this.sessions[0] = this.session.sessionHash - } else { - const sessionInfo = await this.syn.getSession(this.sessions[0]) - this.session = new Session(this.ctx, this.syn, sessionInfo) - if (this.session._scribe_str != this.syn.me) { - await this.syn.sendSyncReq() - } - } - } -} - -function signalHandler(connection:Connection, signal:AppSignal) { - // ignore signals not meant for me - if (!connection.syn || bufferToBase64(signal.data.cell_id[1]) != connection.syn.me) { - return - } - console.log('Got Signal', signal.data.payload.signal_name, signal) - switch (signal.data.payload.signal_name) { - case 'SyncReq': - connection.session.syncReq({ from: signal.data.payload.signal_payload }) - break - case 'SyncResp': - const state = signal.data.payload.signal_payload - state.deltas = state.deltas.map(d=>JSON.parse(d)) - connection.session.syncResp(state) - break - case 'ChangeReq': { - let [index, deltas] = signal.data.payload.signal_payload - deltas = deltas.map(d=>JSON.parse(d)) - connection.session.changeReq([index, deltas]) - break - } - case 'Change': { - let [index, deltas] = signal.data.payload.signal_payload - deltas = deltas.map(d=>JSON.parse(d)) - connection.session.change(index, deltas) - break - } - case 'FolkLore': { - let data = decodeJson(signal.data.payload.signal_payload) - connection.session.folklore(data) - break - } - case 'Heartbeat': { - let [from, jsonData] = signal.data.payload.signal_payload - const data = decodeJson(jsonData) - connection.session.heartbeat(from, data) - break - } - case 'CommitNotice': - connection.session.commitNotice(signal.data.payload.signal_payload) - } -} diff --git a/ui/libs/Signal.ts b/ui/libs/zome-client/src/Signal.ts similarity index 100% rename from ui/libs/Signal.ts rename to ui/libs/zome-client/src/Signal.ts diff --git a/ui/libs/zome-client/src/app_port_b.ts b/ui/libs/zome-client/src/app_port_b.ts index a42acb9f..ccbf913e 100644 --- a/ui/libs/zome-client/src/app_port_b.ts +++ b/ui/libs/zome-client/src/app_port_b.ts @@ -1,8 +1,5 @@ -import { _b, B } from '@ctx-core/object' -import { writable$, Writable } from '@ctx-core/store' -export const app_port_b:app_port_b_T = _b('app_port', ()=>{ - return writable$(null) +import { _b } from '@ctx-core/object' +import { writable$ } from '@ctx-core/store' +export const app_port_b = _b('app_port', ()=>{ + return writable$<number>(null) }) -export type $app_port_T = number -export interface app_port_T extends Writable<$app_port_T> {} -export interface app_port_b_T extends B<app_port_T> {} diff --git a/ui/libs/zome-client/src/app_ws_b.ts b/ui/libs/zome-client/src/app_ws_b.ts index 8e571fb8..d8b24c55 100644 --- a/ui/libs/zome-client/src/app_ws_b.ts +++ b/ui/libs/zome-client/src/app_ws_b.ts @@ -1,24 +1,21 @@ import { AppSignal, AppSignalCb, AppWebsocket } from '@holochain/conductor-api' -import { _b, B } from '@ctx-core/object' +import { _b } from '@ctx-core/object' import { derived$, Readable } from '@ctx-core/store' import { app_port_b } from './app_port_b' import { app_ws_cb_b } from './app_ws_cb_b' -export const app_ws_b:app_ws_b_T = _b('app_ws', (ctx)=>{ +export const app_ws_b = _b('app_ws', (ctx)=>{ const app_port = app_port_b(ctx) const app_ws_cb = app_ws_cb_b(ctx) return derived$(app_port, ($app_port, set)=>{ (async ()=>{ set( - await _app_ws($app_port, (signal:AppSignal) =>{ + await _app_ws($app_port, (signal:AppSignal)=>{ app_ws_cb.$(signal) }) ) })() - }) + }) as Readable<AppWebsocket> }) -export type $app_ws_T = AppWebsocket -export interface app_ws_T extends Readable<$app_ws_T> {} -export interface app_ws_b_T extends B<app_ws_T> {} export async function _app_ws(app_port:number, signal_fn:AppSignalCb) { return await AppWebsocket.connect( @@ -26,45 +23,3 @@ export async function _app_ws(app_port:number, signal_fn:AppSignalCb) { 30000, (signal)=>signal_fn(signal)) } -// function signal_fn(signal:AppSignal) { -// // ignore signals not meant for me -// if (!connection.syn || bufferToBase64(signal.data.cell_id[1]) != connection.syn.me) { -// return -// } -// console.log('Got Signal', signal.data.payload.signal_name, signal) -// switch (signal.data.payload.signal_name) { -// case 'SyncReq': -// connection.session.syncReq({ from: signal.data.payload.signal_payload }) -// break -// case 'SyncResp': -// const state = signal.data.payload.signal_payload -// state.deltas = state.deltas.map(d=>JSON.parse(d)) -// connection.session.syncResp(state) -// break -// case 'ChangeReq': { -// let [index, deltas] = signal.data.payload.signal_payload -// deltas = deltas.map(d=>JSON.parse(d)) -// connection.session.changeReq([index, deltas]) -// break -// } -// case 'Change': { -// let [index, deltas] = signal.data.payload.signal_payload -// deltas = deltas.map(d=>JSON.parse(d)) -// connection.session.change(index, deltas) -// break -// } -// case 'FolkLore': { -// let data = decodeJson(signal.data.payload.signal_payload) -// connection.session.folklore(data) -// break -// } -// case 'Heartbeat': { -// let [from, jsonData] = signal.data.payload.signal_payload -// const data = decodeJson(jsonData) -// connection.session.heartbeat(from, data) -// break -// } -// case 'CommitNotice': -// connection.session.commitNotice(signal.data.payload.signal_payload) -// } -// } diff --git a/ui/libs/zome-client/src/encodeJson.ts b/ui/libs/zome-client/src/encodeJson.ts index a3110263..b674f0bd 100644 --- a/ui/libs/zome-client/src/encodeJson.ts +++ b/ui/libs/zome-client/src/encodeJson.ts @@ -1,7 +1,7 @@ import { bufferToBase64 } from '@syn-ui/utils' export function encodeJson(obj) { return JSON.stringify(obj, function (key, value) { - if (key == 'pubKey') { + if (key === 'pubKey') { if (typeof window !== 'undefined') { return bufferToBase64(value) // In the browser it's the actual array } else { diff --git a/ui/libs/zome-client/src/index.ts b/ui/libs/zome-client/src/index.ts index 27a1144d..4154aba1 100644 --- a/ui/libs/zome-client/src/index.ts +++ b/ui/libs/zome-client/src/index.ts @@ -35,5 +35,6 @@ export * from './rpc_send_heartbeat_b' export * from './rpc_send_sync_request_b' export * from './rpc_send_sync_response_b' export * from './SessionInfo' +export * from './Signal' export * from './StateForSync' export * from './Zome' diff --git a/ui/libs/zome-client/src/rpc_get_session_b.ts b/ui/libs/zome-client/src/rpc_get_session_b.ts index 853de417..ec3a69bd 100644 --- a/ui/libs/zome-client/src/rpc_get_session_b.ts +++ b/ui/libs/zome-client/src/rpc_get_session_b.ts @@ -1,10 +1,10 @@ -import type { HoloHash } from '@holochain/conductor-api' import { _b } from '@ctx-core/object' +import type { EntryHash } from '@syn-ui/utils' import { rpc_b } from './rpc_b' import type { SessionInfo } from './SessionInfo' export const rpc_get_session_b = _b('rpc_get_session', (ctx) => { const rpc = rpc_b(ctx) - return async function rpc_get_session(session_hash:HoloHash):Promise<SessionInfo> { + return async function rpc_get_session(session_hash:EntryHash):Promise<SessionInfo> { return rpc('get_session', session_hash) } }) diff --git a/ui/libs/zome-client/src/rpc_get_sessions_b.ts b/ui/libs/zome-client/src/rpc_get_sessions_b.ts index f5ef9890..da5d07c0 100644 --- a/ui/libs/zome-client/src/rpc_get_sessions_b.ts +++ b/ui/libs/zome-client/src/rpc_get_sessions_b.ts @@ -1,9 +1,9 @@ -import type { HoloHash } from '@holochain/conductor-api' import { _b } from '@ctx-core/object' +import type { EntryHash } from '@syn-ui/utils' import { rpc_b } from './rpc_b' export const rpc_get_sessions_b = _b('rpc_get_sessions', (ctx)=>{ const rpc = rpc_b(ctx) - return async function rpc_get_sessions():Promise<HoloHash[]> { + return async function rpc_get_sessions():Promise<EntryHash[]> { return await rpc('get_sessions') } }) diff --git a/ui/libs/zome-client/src/rpc_send_folk_lore_b.ts b/ui/libs/zome-client/src/rpc_send_folk_lore_b.ts index 85688776..d994afb2 100644 --- a/ui/libs/zome-client/src/rpc_send_folk_lore_b.ts +++ b/ui/libs/zome-client/src/rpc_send_folk_lore_b.ts @@ -1,6 +1,6 @@ +import type { AgentPubKey } from '@holochain/conductor-api' import { _b } from '@ctx-core/object' import { rpc_b } from './rpc_b' -import type { HoloHash } from '@holochain/conductor-api' import { encodeJson } from './encodeJson' import type { PubKeyToFolkRecord } from './Folk' export const rpc_send_folk_lore_b = _b('rpc_send_folk_lore', (ctx)=>{ @@ -13,8 +13,9 @@ export const rpc_send_folk_lore_b = _b('rpc_send_folk_lore', (ctx)=>{ } }) export interface SendFolkLoreInput { - participants:HoloHash[] + participants:AgentPubKey[] data:{ - participants:PubKeyToFolkRecord + participants?:PubKeyToFolkRecord, + gone?:AgentPubKey[] } } From 9238bc61197a082c78191cf61cbe5790e54e0f4d Mon Sep 17 00:00:00 2001 From: Brian Takita <brian.takita@gmail.com> Date: Mon, 26 Apr 2021 02:20:39 -0400 Subject: [PATCH 12/33] wip: build --- bin/tsc-build.sh | 2 + pnpm-lock.yaml | 1086 +++- pnpm-workspace.yaml | 1 + tests/package.json | 24 +- tests/syn-lib/syn-lib.ts | 30 +- tests/unit-test/syn.ts | 3 +- ui/apps/app/.gitignore | 1 + ui/apps/app/package.json | 5 +- ui/apps/app/public/build/main.css | 1 - ui/apps/app/public/build/main.js | 7010 ----------------------- ui/apps/app/public/build/main.js.map | 1 - ui/apps/app/rollup.config.js | 155 +- ui/apps/app/src/App.svelte | 8 +- ui/apps/app/src/Debug.svelte | 19 +- ui/apps/app/src/Editor.svelte | 34 +- ui/apps/app/src/Folk.svelte | 14 +- ui/apps/app/src/Folks.svelte | 10 +- ui/apps/app/src/History.svelte | 2 +- ui/apps/app/src/Syn.svelte | 71 +- ui/apps/app/src/Title.svelte | 2 +- ui/{libs => apps/app/src}/main.ts | 0 ui/apps/headless/package.json | 4 +- ui/libs/model/.gitignore | 1 + ui/libs/model/package.json | 10 +- ui/libs/model/src/colors/CSSifyHSL.ts | 2 +- ui/libs/model/src/colors/index.ts | 2 - ui/libs/model/src/content/index.ts | 1 - ui/libs/model/tsconfig.json | 7 +- ui/libs/utils/.gitignore | 1 + ui/libs/utils/package.json | 4 +- ui/libs/utils/tsconfig.json | 7 +- ui/libs/zome-client/.gitignore | 1 + ui/libs/zome-client/package.json | 11 +- ui/libs/zome-client/src/Zome.ts | 56 - ui/libs/zome-client/src/connection_b.ts | 6 - ui/libs/zome-client/src/index.ts | 3 - ui/libs/zome-client/tsconfig.json | 17 +- ui/package.json | 6 - ui/tsconfig.json | 5 + 39 files changed, 1274 insertions(+), 7349 deletions(-) create mode 100755 bin/tsc-build.sh create mode 100644 ui/apps/app/.gitignore delete mode 100644 ui/apps/app/public/build/main.css delete mode 100644 ui/apps/app/public/build/main.js delete mode 100644 ui/apps/app/public/build/main.js.map rename ui/{libs => apps/app/src}/main.ts (100%) create mode 100644 ui/libs/model/.gitignore create mode 100644 ui/libs/utils/.gitignore create mode 100644 ui/libs/zome-client/.gitignore delete mode 100644 ui/libs/zome-client/src/Zome.ts delete mode 100644 ui/libs/zome-client/src/connection_b.ts delete mode 100644 ui/package.json diff --git a/bin/tsc-build.sh b/bin/tsc-build.sh new file mode 100755 index 00000000..ab677a99 --- /dev/null +++ b/bin/tsc-build.sh @@ -0,0 +1,2 @@ +#!/bin/sh +tsc -b $(find ui/libs -maxdepth 1 -mindepth 1) $@ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4f6d8331..45dfca50 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -22,11 +22,42 @@ importers: pnpm: 6.2.1 typescript: 4.2.4 + tests: + specifiers: + '@holochain/conductor-api': 0.0.3 + '@holochain/tryorama': 0.4.2 + '@syn-ui/model': workspace:^1.0.0 + '@syn-ui/utils': workspace:^1.0.0 + '@syn-ui/zome-client': workspace:^1.0.0 + '@types/lodash': ^4.14.168 + '@types/node': ^14.14.41 + esm: ^3.2.25 + lodash: ^4.17.21 + tape: ^5.2.2 + ts-node: ^9.1.1 + typescript: ^4.2.4 + uuidv4: ^6.2.7 + dependencies: + esm: 3.2.25 + lodash: 4.17.21 + tape: 5.2.2 + ts-node: 9.1.1_typescript@4.2.4 + typescript: 4.2.4 + uuidv4: 6.2.7 + devDependencies: + '@holochain/conductor-api': 0.0.3 + '@holochain/tryorama': 0.4.2 + '@syn-ui/model': link:../ui/libs/model + '@syn-ui/utils': link:../ui/libs/utils + '@syn-ui/zome-client': link:../ui/libs/zome-client + '@types/lodash': 4.14.168 + '@types/node': 14.14.41 + ui/apps/app: specifiers: '@ctx-core/combinators': ^6.0.10 - '@ctx-core/object': ^17.5.9 - '@ctx-core/store': ^24.5.0 + '@ctx-core/object': ^17.5.10 + '@ctx-core/store': ^24.5.2 '@holochain/conductor-api': 0.0.3 '@rollup/plugin-commonjs': ^18.0.0 '@rollup/plugin-node-resolve': ^11.2.1 @@ -43,6 +74,7 @@ importers: svelte: ^3.37.0 svelte-fa: ^2.2.0 svelte-preprocess: ^4.7.2 + tslib: ^2.2.0 typescript: ^4.2.4 dependencies: '@ctx-core/combinators': 6.0.10 @@ -50,12 +82,12 @@ importers: sirv-cli: 1.0.11 svelte-fa: 2.2.0 devDependencies: - '@ctx-core/object': 17.5.9 - '@ctx-core/store': 24.5.0 + '@ctx-core/object': 17.5.10 + '@ctx-core/store': 24.5.2 '@rollup/plugin-commonjs': 18.0.0_rollup@2.45.2 '@rollup/plugin-node-resolve': 11.2.1_rollup@2.45.2 '@rollup/plugin-replace': 2.4.2_rollup@2.45.2 - '@rollup/plugin-typescript': 8.2.1_rollup@2.45.2+typescript@4.2.4 + '@rollup/plugin-typescript': 8.2.1_d21869dc49fccc93d6599238c3a50ee6 '@syn-ui/model': link:../../libs/model '@syn-ui/zome-client': link:../../libs/zome-client rollup: 2.45.2 @@ -65,13 +97,14 @@ importers: rollup-plugin-terser: 7.0.2_rollup@2.45.2 svelte: 3.37.0 svelte-preprocess: 4.7.2_svelte@3.37.0+typescript@4.2.4 + tslib: 2.2.0 typescript: 4.2.4 ui/apps/headless: specifiers: '@ctx-core/combinators': ^6.0.10 - '@ctx-core/object': ^17.5.9 - '@ctx-core/store': ^24.5.0 + '@ctx-core/object': ^17.5.10 + '@ctx-core/store': ^24.5.2 '@holochain/conductor-api': 0.0.3 '@rollup/plugin-commonjs': ^18.0.0 '@rollup/plugin-node-resolve': ^11.2.1 @@ -93,8 +126,8 @@ importers: sirv-cli: 1.0.11 svelte-fa: 2.2.0 devDependencies: - '@ctx-core/object': 17.5.9 - '@ctx-core/store': 24.5.0 + '@ctx-core/object': 17.5.10 + '@ctx-core/store': 24.5.2 '@rollup/plugin-commonjs': 18.0.0_rollup@2.45.2 '@rollup/plugin-node-resolve': 11.2.1_rollup@2.45.2 '@rollup/plugin-replace': 2.4.2_rollup@2.45.2 @@ -111,8 +144,8 @@ importers: ui/libs/model: specifiers: '@ctx-core/combinators': ^6.0.10 - '@ctx-core/object': ^17.5.9 - '@ctx-core/store': ^24.5.0 + '@ctx-core/object': ^17.5.10 + '@ctx-core/store': ^24.5.2 '@holochain/conductor-api': 0.0.3 '@syn-ui/utils': workspace:^1.0.0 '@syn-ui/zome-client': workspace:^1.0.0 @@ -120,8 +153,8 @@ importers: typescript: ^4.2.4 devDependencies: '@ctx-core/combinators': 6.0.10 - '@ctx-core/object': 17.5.9 - '@ctx-core/store': 24.5.0 + '@ctx-core/object': 17.5.10 + '@ctx-core/store': 24.5.2 '@holochain/conductor-api': 0.0.3 '@syn-ui/utils': link:../utils '@syn-ui/zome-client': link:../zome-client @@ -137,19 +170,29 @@ importers: ui/libs/zome-client: specifiers: '@ctx-core/function': ^17.4.7 - '@ctx-core/object': ^17.5.9 - '@ctx-core/store': ^24.5.0 + '@ctx-core/object': ^17.5.10 + '@ctx-core/store': ^24.5.2 + '@holochain/conductor-api': ^0.0.3 '@syn-ui/utils': workspace:^1.0.0 typescript: ^4.2.4 devDependencies: '@ctx-core/function': 17.4.7 - '@ctx-core/object': 17.5.9 - '@ctx-core/store': 24.5.0 + '@ctx-core/object': 17.5.10 + '@ctx-core/store': 24.5.2 + '@holochain/conductor-api': 0.0.3 '@syn-ui/utils': link:../utils typescript: 4.2.4 packages: + /101/1.6.3: + resolution: {integrity: sha512-4dmQ45yY0Dx24Qxp+zAsNLlMF6tteCyfVzgbulvSyC7tCyd3V8sW76sS0tHq8NpcbXfWTKasfyfzU1Kd86oKzw==} + dependencies: + clone: 1.0.4 + deep-eql: 0.1.3 + keypather: 1.10.2 + dev: true + /@babel/code-frame/7.12.13: resolution: {integrity: sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==} dependencies: @@ -344,21 +387,21 @@ packages: prettier: 1.19.1 dev: true - /@ctx-core/array/20.2.11: - resolution: {integrity: sha512-NgqBw7vrsS6O/DIifOnrkVTDT0FZBDKFLvspb00963euorcOp+aXdS2OvUTEdvT38cTdDZEXMek7AHCwyLgp+Q==} + /@ctx-core/array/20.2.12: + resolution: {integrity: sha512-kd+6PF0v8u7g1daQAiRXAYx9sGYBUpUJUgasE9G+4On+HF0SSx61X5z6LLEJzrOf5PGmEedoF3dQ2HgTU9nqRw==} dependencies: '@ctx-core/combinators': 6.0.10 '@ctx-core/function': 17.4.7 - '@ctx-core/object': 17.5.9 + '@ctx-core/object': 17.5.10 '@ctx-core/set': 9.0.18 dev: true - /@ctx-core/cli-args/7.2.21: - resolution: {integrity: sha512-aTnmfQKXuYNb+iP7tY9+MpfOIsT+uhiSYreORsAJEE88uaVFozwuq0PdmluP2rUt7g8IqSSFudLrauaI3XPX1g==} + /@ctx-core/cli-args/7.2.22: + resolution: {integrity: sha512-QRs9x+tUcevEhoI8zeBjhdaY3mi/CLCi8KqALNHoJe06JYOORG+ZPj26vt6SfWOTt9H1ZsMraEoKVqhAMHEl8g==} dependencies: - '@ctx-core/array': 20.2.11 + '@ctx-core/array': 20.2.12 '@ctx-core/function': 17.4.7 - '@ctx-core/object': 17.5.9 + '@ctx-core/object': 17.5.10 dev: true /@ctx-core/combinators/6.0.10: @@ -368,7 +411,7 @@ packages: resolution: {integrity: sha512-P/dDxfaZeOhvFPRvMXzyaiHnBV0BkIwLuH99/MBgmsE/Y6klat0jfHv5KcWyAlcK72ha9CEufdY2DhHXpuZb6w==} hasBin: true dependencies: - '@ctx-core/array': 20.2.11 + '@ctx-core/array': 20.2.12 dev: true /@ctx-core/function/17.4.7: @@ -379,7 +422,7 @@ packages: resolution: {integrity: sha512-5o0fnCLUl0gLqEqDM6NAokqOuO7kZo+Juv8qQP7cocVdEPS5/Dslk9wG1SLbpESwcCAr/Uam9VRkeQRTJlKMKg==} hasBin: true dependencies: - '@ctx-core/cli-args': 7.2.21 + '@ctx-core/cli-args': 7.2.22 '@ctx-core/queue': 3.0.10 esm: 3.2.25 globby: 11.0.3 @@ -389,8 +432,8 @@ packages: resolution: {integrity: sha512-DPONMvR8ZqCk5BlO0wD9CCyzm+zZ4MlAZ8HnG0HICjeidtDpaavlH/p4cwKDX/VbVtnNv04uhFcbfvFWVNFksg==} hasBin: true dependencies: - '@ctx-core/array': 20.2.11 - '@ctx-core/cli-args': 7.2.21 + '@ctx-core/array': 20.2.12 + '@ctx-core/cli-args': 7.2.22 '@ctx-core/ctx-core-package-tools': 6.0.44 '@ctx-core/package': 6.1.20 '@ctx-core/queue': 3.0.10 @@ -401,8 +444,8 @@ packages: semver: 7.3.5 dev: true - /@ctx-core/object/17.5.9: - resolution: {integrity: sha512-N7rgVmS+0u0wnhKreAnycuL4XX6XZ5bbVQS3g3oeN63rh/KgFmNNo83NXMzGtrlqbk7m1HwKWzg9jPLU3WfUrQ==} + /@ctx-core/object/17.5.10: + resolution: {integrity: sha512-ettwQ3/WpWLlCrgL+WndM0ESL3hMXwIVyRt/31FLk6PVeN6e42tSKgmyd/1LNJid/FNA6+EtIsvLustHUP+I/g==} dependencies: '@ctx-core/function': 17.4.7 dev: true @@ -411,7 +454,7 @@ packages: resolution: {integrity: sha512-dSdBXWBo9eT9Q3v74Q6wyVawKFwC6S+7pOdpI/ctPKwDqcuP28thI3cWD4O3Iafk4/HVsDDON3Sgse28KbJ2jg==} hasBin: true dependencies: - '@ctx-core/cli-args': 7.2.21 + '@ctx-core/cli-args': 7.2.22 esm: 3.2.25 resolve: 1.20.0 dev: true @@ -435,16 +478,24 @@ packages: '@ctx-core/function': 17.4.7 dev: true - /@ctx-core/store/24.5.0: - resolution: {integrity: sha512-ia2oixp/tsWG8nNB7blAsnlOe2aQNwdaUa1GK8XIV3AmvwtP2P72pnJwRID/0lRYbFfas8DN8iOUMYIQN648tQ==} + /@ctx-core/store/24.5.2: + resolution: {integrity: sha512-TxM0nWK23MbzNGMPu28SWFE539l3KYo+3TBFCA8YkzYJFywDehaDTscVzu9FdXkydYuXMur2sjKOLkPFEtuArw==} dependencies: - '@ctx-core/array': 20.2.11 + '@ctx-core/array': 20.2.12 '@ctx-core/combinators': 6.0.10 '@ctx-core/function': 17.4.7 - '@ctx-core/object': 17.5.9 + '@ctx-core/object': 17.5.10 svelte: 3.37.0 dev: true + /@dabh/diagnostics/2.0.2: + resolution: {integrity: sha512-+A1YivoVDNNVCdfozHSR8v/jyuuLTMXwjWuxPFlFlUapXoGc+Gj9mDlTDDfrwl7rXCl2tNZ0kE8sIBO6YOn96Q==} + dependencies: + colorspace: 1.1.2 + enabled: 2.0.0 + kuler: 2.0.0 + dev: true + /@holochain/conductor-api/0.0.3: resolution: {integrity: sha512-wok/uiyGoX4m59wMhT3VX2Ma6bXBfZwp8F8iqTb/XiHz0UpROOCrUELXnmN9Ee1sYnmJcTLYRhRTCZ73WRgkdA==} dependencies: @@ -457,6 +508,46 @@ packages: - bufferutil - utf-8-validate + /@holochain/hachiko/0.5.2: + resolution: {integrity: sha512-w6Aca1HPTenVzqT0rAgRch+FZwGri0EvbAK6ETKV+ZAP+dxPBlQqUgTCrbv2AuwFTU/mobYXniaFlrrAtEnXjQ==} + dependencies: + colors: 1.4.0 + lodash: 4.17.21 + winston: 3.3.3 + winston-null: 2.0.0_winston@3.3.3 + dev: true + + /@holochain/tryorama/0.4.2: + resolution: {integrity: sha512-2Da3zWfXRO/xItRMhzxhRdu+6c9ce0lCZ7hXLjJ2HQ8pspdU6oVHVPhlblwr1Bk1n0W43LM11XVC1YbgzFWZBw==} + dependencies: + '@holochain/conductor-api': 0.0.3 + '@holochain/hachiko': 0.5.2 + '@iarna/toml': 2.2.5 + '@msgpack/msgpack': 2.6.0 + async-mutex: 0.1.4 + axios: 0.19.2 + base-64: 0.1.0 + colors: 1.4.0 + fp-ts: 2.10.4 + get-port: 5.1.1 + io-ts: 2.2.16_fp-ts@2.10.4 + io-ts-reporters: 1.2.2_fp-ts@2.10.4+io-ts@2.2.16 + lodash: 4.17.21 + memoizee: 0.4.15 + ramda: 0.26.1 + rpc-websockets: 4.6.1 + uuid: 8.3.2 + winston: 3.3.3 + yaml: 1.10.2 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + dev: true + + /@iarna/toml/2.2.5: + resolution: {integrity: sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==} + dev: true + /@manypkg/find-root/1.1.0: resolution: {integrity: sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==} dependencies: @@ -480,6 +571,11 @@ packages: resolution: {integrity: sha512-5qzv53J43V8GaYsaETs29Q0Ehw9Dog6SG18MASZRQDuZYXtA5T7pymGE2S40NL0X8sjl8+TybmRa5O8d45V7MQ==} engines: {node: '>= 10'} + /@msgpack/msgpack/2.6.0: + resolution: {integrity: sha512-CbKEhARMPl/CYNhIs4p0NgoNWspUQP45QxZoJ433ydSd2HTfzQ4WQyEpViJkEHKkRcPbV72FlFf3gtD9frzKTg==} + engines: {node: '>= 10'} + dev: true + /@nodelib/fs.scandir/2.1.4: resolution: {integrity: sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==} engines: {node: '>= 8'} @@ -546,6 +642,21 @@ packages: rollup: 2.45.2 dev: true + /@rollup/plugin-typescript/8.2.1_d21869dc49fccc93d6599238c3a50ee6: + resolution: {integrity: sha512-Qd2E1pleDR4bwyFxqbjt4eJf+wB0UKVMLc7/BAFDGVdAXQMCsD4DUv5/7/ww47BZCYxWtJqe1Lo0KVNswBJlRw==} + engines: {node: '>=8.0.0'} + peerDependencies: + rollup: ^2.14.0 + tslib: '*' + typescript: '>=3.7.0' + dependencies: + '@rollup/pluginutils': 3.1.0_rollup@2.45.2 + resolve: 1.20.0 + rollup: 2.45.2 + tslib: 2.2.0 + typescript: 4.2.4 + dev: true + /@rollup/plugin-typescript/8.2.1_rollup@2.45.2+typescript@4.2.4: resolution: {integrity: sha512-Qd2E1pleDR4bwyFxqbjt4eJf+wB0UKVMLc7/BAFDGVdAXQMCsD4DUv5/7/ww47BZCYxWtJqe1Lo0KVNswBJlRw==} engines: {node: '>=8.0.0'} @@ -591,6 +702,10 @@ packages: resolution: {integrity: sha512-c5ciR06jK8u9BstrmJyO97m+klJrrhCf9u3rLu3DEAJBirxRqSCvDQoYKmxuYwQI5SZChAWu+tq9oVlGRuzPAg==} dev: true + /@types/lodash/4.14.168: + resolution: {integrity: sha512-oVfRvqHV/V6D1yifJbVRU3TMp8OT6o6BG+U9MkwuJ3U8/CsDHvalRpsxBqivn71ztOFZBTfJMvETbqHiaNSj7Q==} + dev: true + /@types/minimist/1.2.1: resolution: {integrity: sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg==} dev: true @@ -626,6 +741,10 @@ packages: resolution: {integrity: sha512-RxAwYt4rGwK5GyoRwuP0jT6ZHAVTdz2EqgsHmX0PYNjGsko+OeT4WFXXTs/lM3teJUJodM+SNtAL5/pXIJ61IQ==} dev: true + /@types/uuid/8.3.0: + resolution: {integrity: sha512-eQ9qFW/fhfGJF8WKHGEHZEyVWfZxrT+6CLIJGBcZPfxUh/+BnEj+UCGYMlr9qZuX/2AltsvwrGqp0LhEW8D0zQ==} + dev: false + /@types/ws/7.4.1: resolution: {integrity: sha512-ISCK1iFnR+jYv7+jLNX0wDqesZ/5RAeY3wUx6QaphmocphU61h+b+PHjS18TF4WIPTu/MMzxIq2PHr32o2TS5Q==} dependencies: @@ -674,6 +793,10 @@ packages: picomatch: 2.2.3 dev: true + /arg/4.1.3: + resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} + dev: false + /argparse/1.0.10: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} dependencies: @@ -684,6 +807,10 @@ packages: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} dev: true + /array-filter/1.0.0: + resolution: {integrity: sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=} + dev: false + /array-union/2.1.0: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} @@ -694,8 +821,55 @@ packages: engines: {node: '>=0.10.0'} dev: true + /assert-args/1.2.1: + resolution: {integrity: sha1-QEEDoUUqMv53iYgR5U5ZCoqTc70=} + dependencies: + '101': 1.6.3 + compound-subject: 0.0.1 + debug: 2.6.9 + get-prototype-of: 0.0.0 + is-capitalized: 1.0.0 + is-class: 0.0.4 + dev: true + + /async-limiter/1.0.1: + resolution: {integrity: sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==} + dev: true + + /async-mutex/0.1.4: + resolution: {integrity: sha512-zVWTmAnxxHaeB2B1te84oecI8zTDJ/8G49aVBblRX6be0oq6pAybNcUSxwfgVOmOjSCvN4aYZAqwtyNI8e1YGw==} + dev: true + + /async/3.2.0: + resolution: {integrity: sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==} + dev: true + + /available-typed-arrays/1.0.2: + resolution: {integrity: sha512-XWX3OX8Onv97LMk/ftVyBibpGwY5a8SmuxZPzeOxqmuEqUCOM9ZE+uIaD1VNJ5QnvU2UQusvmKbuM1FR8QWGfQ==} + engines: {node: '>= 0.4'} + dependencies: + array-filter: 1.0.0 + dev: false + + /axios/0.19.2: + resolution: {integrity: sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==} + deprecated: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410 + dependencies: + follow-redirects: 1.5.10 + dev: true + + /babel-runtime/6.26.0: + resolution: {integrity: sha1-llxwWGaOgrVde/4E/yM3vItWR/4=} + dependencies: + core-js: 2.6.12 + regenerator-runtime: 0.11.1 + dev: true + /balanced-match/1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + + /base-64/0.1.0: + resolution: {integrity: sha1-eAqZyE59YAJgNhURxId2E78k9rs=} dev: true /base64-js/1.5.1: @@ -740,7 +914,6 @@ packages: dependencies: balanced-match: 1.0.2 concat-map: 0.0.1 - dev: true /braces/3.0.2: resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} @@ -757,7 +930,6 @@ packages: /buffer-from/1.1.1: resolution: {integrity: sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==} - dev: true /buffer/5.7.1: resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} @@ -771,6 +943,13 @@ packages: engines: {node: '>=6'} dev: true + /call-bind/1.0.2: + resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==} + dependencies: + function-bind: 1.1.1 + get-intrinsic: 1.1.1 + dev: false + /camelcase-keys/6.2.2: resolution: {integrity: sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==} engines: {node: '>=8'} @@ -838,6 +1017,11 @@ packages: resolution: {integrity: sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==} dev: true + /circular-json/0.5.9: + resolution: {integrity: sha512-4ivwqHpIFJZBuhN3g/pEcdbnGUywkBblloGbkglyloVjjR3uT6tieI89MVOfbP2tHX5sgb01FuLgAOzebNlJNQ==} + deprecated: CircularJSON is in maintenance only, flatted is its successor. + dev: true + /cli-boxes/1.0.0: resolution: {integrity: sha1-T6kXw+WclKAEzWH47lCdplFocUM=} engines: {node: '>=0.10.0'} @@ -889,6 +1073,32 @@ packages: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} dev: true + /color-string/1.5.5: + resolution: {integrity: sha512-jgIoum0OfQfq9Whcfc2z/VhCNcmQjWbey6qBX0vqt7YICflUmBCh9E9CiQD5GSJ+Uehixm3NUwHVhqUAWRivZg==} + dependencies: + color-name: 1.1.4 + simple-swizzle: 0.2.2 + dev: true + + /color/3.0.0: + resolution: {integrity: sha512-jCpd5+s0s0t7p3pHQKpnJ0TpQKKdleP71LWcA0aqiljpiuAkOSUFN/dyH8ZwF0hRmFlrIuRhufds1QyEP9EB+w==} + dependencies: + color-convert: 1.9.3 + color-string: 1.5.5 + dev: true + + /colors/1.4.0: + resolution: {integrity: sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==} + engines: {node: '>=0.1.90'} + dev: true + + /colorspace/1.1.2: + resolution: {integrity: sha512-vt+OoIP2d76xLhjwbBaucYlNSpPsrJWPlBTtwCpQKIu6/CSMutyzX93O/Do0qzpH3YoHEes8YEFXyZ797rEhzQ==} + dependencies: + color: 3.0.0 + text-hex: 1.0.0 + dev: true + /commander/2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} dev: true @@ -897,15 +1107,32 @@ packages: resolution: {integrity: sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=} dev: true + /compound-subject/0.0.1: + resolution: {integrity: sha1-JxVUaYoVrmCLHfyv0wt7oeqJLEs=} + dev: true + /concat-map/0.0.1: resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=} - dev: true /console-clear/1.1.1: resolution: {integrity: sha512-pMD+MVR538ipqkG5JXeOEbKWS5um1H4LUUccUQG68qpeqBYbzYy79Gh55jkd2TtPdRfUaLWdv6LPP//5Zt0aPQ==} engines: {node: '>=4'} dev: false + /core-js/2.6.12: + resolution: {integrity: sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==} + deprecated: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3. + requiresBuild: true + dev: true + + /core-util-is/1.0.2: + resolution: {integrity: sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=} + dev: true + + /create-require/1.1.1: + resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} + dev: false + /cross-spawn/5.1.0: resolution: {integrity: sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=} dependencies: @@ -936,6 +1163,30 @@ packages: stream-transform: 2.1.0 dev: true + /cycle/1.0.3: + resolution: {integrity: sha1-IegLK+hYD5i0aPN5QwZisEbDStI=} + engines: {node: '>=0.4.0'} + dev: true + + /d/1.0.1: + resolution: {integrity: sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==} + dependencies: + es5-ext: 0.10.53 + type: 1.2.0 + dev: true + + /debug/2.6.9: + resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} + dependencies: + ms: 2.0.0 + dev: true + + /debug/3.1.0: + resolution: {integrity: sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==} + dependencies: + ms: 2.0.0 + dev: true + /decamelize-keys/1.1.0: resolution: {integrity: sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=} engines: {node: '>=0.10.0'} @@ -949,6 +1200,32 @@ packages: engines: {node: '>=0.10.0'} dev: true + /deep-eql/0.1.3: + resolution: {integrity: sha1-71WKyrjeJSBs1xOQbXTlaTDrafI=} + dependencies: + type-detect: 0.1.1 + dev: true + + /deep-equal/2.0.5: + resolution: {integrity: sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw==} + dependencies: + call-bind: 1.0.2 + es-get-iterator: 1.1.2 + get-intrinsic: 1.1.1 + is-arguments: 1.1.0 + is-date-object: 1.0.2 + is-regex: 1.1.2 + isarray: 2.0.5 + object-is: 1.1.5 + object-keys: 1.1.1 + object.assign: 4.1.2 + regexp.prototype.flags: 1.3.1 + side-channel: 1.0.4 + which-boxed-primitive: 1.0.2 + which-collection: 1.0.1 + which-typed-array: 1.1.4 + dev: false + /deepmerge/4.2.2: resolution: {integrity: sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==} engines: {node: '>=0.10.0'} @@ -960,11 +1237,27 @@ packages: clone: 1.0.4 dev: true + /define-properties/1.1.3: + resolution: {integrity: sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==} + engines: {node: '>= 0.4'} + dependencies: + object-keys: 1.1.1 + dev: false + + /defined/1.0.0: + resolution: {integrity: sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=} + dev: false + /detect-indent/6.0.0: resolution: {integrity: sha512-oSyFlqaTHCItVRGK5RmrmjB+CmaMOW7IaNA/kdxqhoa6d17j/5ce9O9eWXmV/KEdRwqpQA+Vqe8a8Bsybu4YnA==} engines: {node: '>=8'} dev: true + /diff/4.0.2: + resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} + engines: {node: '>=0.3.1'} + dev: false + /dir-glob/3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} @@ -972,10 +1265,21 @@ packages: path-type: 4.0.0 dev: true + /dotignore/0.1.2: + resolution: {integrity: sha512-UGGGWfSauusaVJC+8fgV+NVvBXkCTmVv7sk6nojDZZvuOUNGUy0Zk4UpHQD6EDjS0jpBwcACvH4eofvyzBcRDw==} + hasBin: true + dependencies: + minimatch: 3.0.4 + dev: false + /emoji-regex/8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} dev: true + /enabled/2.0.0: + resolution: {integrity: sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==} + dev: true + /enquirer/2.3.6: resolution: {integrity: sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==} engines: {node: '>=8.6'} @@ -989,6 +1293,82 @@ packages: is-arrayish: 0.2.1 dev: true + /es-abstract/1.18.0: + resolution: {integrity: sha512-LJzK7MrQa8TS0ja2w3YNLzUgJCGPdPOV1yVvezjNnS89D+VR08+Szt2mz3YB2Dck/+w5tfIq/RoUAFqJJGM2yw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + es-to-primitive: 1.2.1 + function-bind: 1.1.1 + get-intrinsic: 1.1.1 + has: 1.0.3 + has-symbols: 1.0.2 + is-callable: 1.2.3 + is-negative-zero: 2.0.1 + is-regex: 1.1.2 + is-string: 1.0.5 + object-inspect: 1.10.2 + object-keys: 1.1.1 + object.assign: 4.1.2 + string.prototype.trimend: 1.0.4 + string.prototype.trimstart: 1.0.4 + unbox-primitive: 1.0.1 + dev: false + + /es-get-iterator/1.1.2: + resolution: {integrity: sha512-+DTO8GYwbMCwbywjimwZMHp8AuYXOS2JZFWoi2AlPOS3ebnII9w/NLpNZtA7A0YLaVDw+O7KFCeoIV7OPvM7hQ==} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.1.1 + has-symbols: 1.0.2 + is-arguments: 1.1.0 + is-map: 2.0.2 + is-set: 2.0.2 + is-string: 1.0.5 + isarray: 2.0.5 + dev: false + + /es-to-primitive/1.2.1: + resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} + engines: {node: '>= 0.4'} + dependencies: + is-callable: 1.2.3 + is-date-object: 1.0.2 + is-symbol: 1.0.3 + dev: false + + /es5-ext/0.10.53: + resolution: {integrity: sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==} + dependencies: + es6-iterator: 2.0.3 + es6-symbol: 3.1.3 + next-tick: 1.0.0 + dev: true + + /es6-iterator/2.0.3: + resolution: {integrity: sha1-p96IkUGgWpSwhUQDstCg+/qY87c=} + dependencies: + d: 1.0.1 + es5-ext: 0.10.53 + es6-symbol: 3.1.3 + dev: true + + /es6-symbol/3.1.3: + resolution: {integrity: sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==} + dependencies: + d: 1.0.1 + ext: 1.4.0 + dev: true + + /es6-weak-map/2.0.3: + resolution: {integrity: sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==} + dependencies: + d: 1.0.1 + es5-ext: 0.10.53 + es6-iterator: 2.0.3 + es6-symbol: 3.1.3 + dev: true + /escape-string-regexp/1.0.5: resolution: {integrity: sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=} engines: {node: '>=0.8.0'} @@ -997,7 +1377,6 @@ packages: /esm/3.2.25: resolution: {integrity: sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==} engines: {node: '>=6'} - dev: true /esprima/4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} @@ -1017,6 +1396,17 @@ packages: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} dev: true + /event-emitter/0.3.5: + resolution: {integrity: sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=} + dependencies: + d: 1.0.1 + es5-ext: 0.10.53 + dev: true + + /eventemitter3/3.1.2: + resolution: {integrity: sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==} + dev: true + /execa/0.7.0: resolution: {integrity: sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=} engines: {node: '>=4'} @@ -1030,6 +1420,12 @@ packages: strip-eof: 1.0.0 dev: true + /ext/1.4.0: + resolution: {integrity: sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==} + dependencies: + type: 2.5.0 + dev: true + /extendable-error/0.1.7: resolution: {integrity: sha512-UOiS2in6/Q0FK0R0q6UY9vYpQ21mr/Qn1KOnte7vsACuNJf514WvCCUHSRCPcgjPT2bAhNIJdlE6bVap1GKmeg==} dev: true @@ -1055,12 +1451,24 @@ packages: picomatch: 2.2.3 dev: true + /fast-safe-stringify/2.0.7: + resolution: {integrity: sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA==} + dev: true + /fastq/1.11.0: resolution: {integrity: sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g==} dependencies: reusify: 1.0.4 dev: true + /fecha/2.3.3: + resolution: {integrity: sha512-lUGBnIamTAwk4znq5BcqsDaxSmZ9nDVJaij6NvRt/Tg4R69gERA+otPKbS86ROw9nxVMw2/mp1fnaiWqbs6Sdg==} + dev: true + + /fecha/4.2.1: + resolution: {integrity: sha512-MMMQ0ludy/nBs1/o0zVOiKTpG7qMbonKUzjJgQFEuvq6INZ1OraKPRAWkBq5vlKLOUMpmNYG1JoN3oDPUQ9m3Q==} + dev: true + /fill-range/7.0.1: resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} engines: {node: '>=8'} @@ -1091,6 +1499,31 @@ packages: pkg-dir: 4.2.0 dev: true + /fn.name/1.1.0: + resolution: {integrity: sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==} + dev: true + + /follow-redirects/1.5.10: + resolution: {integrity: sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==} + engines: {node: '>=4.0'} + dependencies: + debug: 3.1.0 + dev: true + + /for-each/0.3.3: + resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} + dependencies: + is-callable: 1.2.3 + dev: false + + /foreach/2.0.5: + resolution: {integrity: sha1-C+4AUBiusmDQo6865ljdATbsG5k=} + dev: false + + /fp-ts/2.10.4: + resolution: {integrity: sha512-vMTB5zNc9PnE20q145PNbkiL9P9WegwmKVOFloi/NfHnPdAlcob6I3AKqlH/9u3k3/M/GOftZhcJdBrb+NtnDA==} + dev: true + /fs-extra/7.0.1: resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==} engines: {node: '>=6 <7 || >=8'} @@ -1111,7 +1544,6 @@ packages: /fs.realpath/1.0.0: resolution: {integrity: sha1-FQStJSMVjKpA20onh8sBQRmU6k8=} - dev: true /fsevents/2.3.2: resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} @@ -1122,18 +1554,34 @@ packages: /function-bind/1.1.1: resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} - dev: true /get-caller-file/2.0.5: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} dev: true + /get-intrinsic/1.1.1: + resolution: {integrity: sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==} + dependencies: + function-bind: 1.1.1 + has: 1.0.3 + has-symbols: 1.0.2 + dev: false + /get-port/3.2.0: resolution: {integrity: sha1-3Xzn3hh8Bsi/NTeWrHHgmfCYDrw=} engines: {node: '>=4'} dev: false + /get-port/5.1.1: + resolution: {integrity: sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ==} + engines: {node: '>=8'} + dev: true + + /get-prototype-of/0.0.0: + resolution: {integrity: sha1-mHcr0QcW0W3rSzIlFsRp78oorEQ=} + dev: true + /get-stream/3.0.0: resolution: {integrity: sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=} engines: {node: '>=4'} @@ -1155,7 +1603,6 @@ packages: minimatch: 3.0.4 once: 1.4.0 path-is-absolute: 1.0.1 - dev: true /globby/11.0.3: resolution: {integrity: sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg==} @@ -1182,6 +1629,10 @@ packages: engines: {node: '>=6'} dev: true + /has-bigints/1.0.1: + resolution: {integrity: sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==} + dev: false + /has-flag/3.0.0: resolution: {integrity: sha1-tdRU3CGZriJWmfNGfloH87lVuv0=} engines: {node: '>=4'} @@ -1192,12 +1643,16 @@ packages: engines: {node: '>=8'} dev: true + /has-symbols/1.0.2: + resolution: {integrity: sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==} + engines: {node: '>= 0.4'} + dev: false + /has/1.0.3: resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} engines: {node: '>= 0.4.0'} dependencies: function-bind: 1.1.1 - dev: true /hosted-git-info/2.8.9: resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} @@ -1233,16 +1688,47 @@ packages: dependencies: once: 1.4.0 wrappy: 1.0.2 - dev: true /inherits/2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + + /io-ts-reporters/1.2.2_fp-ts@2.10.4+io-ts@2.2.16: + resolution: {integrity: sha512-igASwWWkDY757OutNcM6zTtdJf/eTZYkoe2ymsX2qpm5bKZLo74FJYjsCtMQOEdY7dRHLLEulCyFQwdN69GBCg==} + peerDependencies: + fp-ts: ^2.0.2 + io-ts: ^2.0.0 + dependencies: + fp-ts: 2.10.4 + io-ts: 2.2.16_fp-ts@2.10.4 + dev: true + + /io-ts/2.2.16_fp-ts@2.10.4: + resolution: {integrity: sha512-y5TTSa6VP6le0hhmIyN0dqEXkrZeJLeC5KApJq6VLci3UEKF80lZ+KuoUs02RhBxNWlrqSNxzfI7otLX1Euv8Q==} + peerDependencies: + fp-ts: ^2.5.0 + dependencies: + fp-ts: 2.10.4 dev: true + /is-arguments/1.1.0: + resolution: {integrity: sha512-1Ij4lOMPl/xB5kBDn7I+b2ttPMKa8szhEIrXDuXQD/oe3HJLTLhqhgGspwgyGd6MOywBUqVvYicF72lkgDnIHg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + dev: false + /is-arrayish/0.2.1: resolution: {integrity: sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=} dev: true + /is-arrayish/0.3.2: + resolution: {integrity: sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==} + dev: true + + /is-bigint/1.0.1: + resolution: {integrity: sha512-J0ELF4yHFxHy0cmSxZuheDOz2luOdVvqjwmEcj8H/L1JHeuEDSDbeRP+Dk9kFVk5RTFzbucJ2Kb9F7ixY2QaCg==} + dev: false + /is-binary-path/2.1.0: resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} engines: {node: '>=8'} @@ -1250,6 +1736,22 @@ packages: binary-extensions: 2.2.0 dev: true + /is-boolean-object/1.1.0: + resolution: {integrity: sha512-a7Uprx8UtD+HWdyYwnD1+ExtTgqQtD2k/1yJgtXP6wnMm8byhkoTZRl+95LLThpzNZJ5aEvi46cdH+ayMFRwmA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + dev: false + + /is-callable/1.2.3: + resolution: {integrity: sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==} + engines: {node: '>= 0.4'} + dev: false + + /is-capitalized/1.0.0: + resolution: {integrity: sha1-TIRktNkdPk7rRIid0s2PGwrEwTY=} + dev: true + /is-ci/2.0.0: resolution: {integrity: sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==} hasBin: true @@ -1257,11 +1759,19 @@ packages: ci-info: 2.0.0 dev: true + /is-class/0.0.4: + resolution: {integrity: sha1-4FdFFwW7NOOePjNZjJOpg3KWtzY=} + dev: true + /is-core-module/2.3.0: resolution: {integrity: sha512-xSphU2KG9867tsYdLD4RWQ1VqdFl4HTO9Thf3I/3dLEfr0dbPTWKsuCKrgqMljg4nPE+Gq0VCnzT3gr0CyBmsw==} dependencies: has: 1.0.3 - dev: true + + /is-date-object/1.0.2: + resolution: {integrity: sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==} + engines: {node: '>= 0.4'} + dev: false /is-extglob/2.1.1: resolution: {integrity: sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=} @@ -1290,10 +1800,24 @@ packages: engines: {node: '>=8'} dev: true + /is-map/2.0.2: + resolution: {integrity: sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==} + dev: false + /is-module/1.0.0: resolution: {integrity: sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=} dev: true + /is-negative-zero/2.0.1: + resolution: {integrity: sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==} + engines: {node: '>= 0.4'} + dev: false + + /is-number-object/1.0.4: + resolution: {integrity: sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw==} + engines: {node: '>= 0.4'} + dev: false + /is-number/7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} @@ -1304,17 +1828,43 @@ packages: engines: {node: '>=0.10.0'} dev: true + /is-promise/2.2.2: + resolution: {integrity: sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==} + dev: true + /is-reference/1.2.1: resolution: {integrity: sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==} dependencies: '@types/estree': 0.0.47 dev: true + /is-regex/1.1.2: + resolution: {integrity: sha512-axvdhb5pdhEVThqJzYXwMlVuZwC+FF2DpcOhTS+y/8jVq4trxyPgfcwIxIKiyeuLlSQYKkmUaPQJ8ZE4yNKXDg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + has-symbols: 1.0.2 + dev: false + + /is-set/2.0.2: + resolution: {integrity: sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==} + dev: false + /is-stream/1.1.0: resolution: {integrity: sha1-EtSj3U5o4Lec6428hBc66A2RykQ=} engines: {node: '>=0.10.0'} dev: true + /is-stream/2.0.0: + resolution: {integrity: sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==} + engines: {node: '>=8'} + dev: true + + /is-string/1.0.5: + resolution: {integrity: sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==} + engines: {node: '>= 0.4'} + dev: false + /is-subdir/1.2.0: resolution: {integrity: sha512-2AT6j+gXe/1ueqbW6fLZJiIw3F8iXGJtt0yDrZaBhAZEG1raiTxKWU+IPqMCzQAXOUCKdA4UDMgacKH25XG2Cw==} engines: {node: '>=4'} @@ -1322,16 +1872,50 @@ packages: better-path-resolve: 1.0.0 dev: true + /is-symbol/1.0.3: + resolution: {integrity: sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==} + engines: {node: '>= 0.4'} + dependencies: + has-symbols: 1.0.2 + dev: false + + /is-typed-array/1.1.5: + resolution: {integrity: sha512-S+GRDgJlR3PyEbsX/Fobd9cqpZBuvUS+8asRqYDMLCb2qMzt1oz5m5oxQCxOgUDxiWsOVNi4yaF+/uvdlHlYug==} + engines: {node: '>= 0.4'} + dependencies: + available-typed-arrays: 1.0.2 + call-bind: 1.0.2 + es-abstract: 1.18.0 + foreach: 2.0.5 + has-symbols: 1.0.2 + dev: false + /is-unicode-supported/0.1.0: resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} engines: {node: '>=10'} dev: true + /is-weakmap/2.0.1: + resolution: {integrity: sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==} + dev: false + + /is-weakset/2.0.1: + resolution: {integrity: sha512-pi4vhbhVHGLxohUw7PhGsueT4vRGFoXhP7+RGN0jKIv9+8PWYCQTqtADngrxOm2g46hoH0+g8uZZBzMrvVGDmw==} + dev: false + /is-windows/1.0.2: resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==} engines: {node: '>=0.10.0'} dev: true + /isarray/1.0.0: + resolution: {integrity: sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=} + dev: true + + /isarray/2.0.5: + resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} + dev: false + /isexe/2.0.0: resolution: {integrity: sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=} dev: true @@ -1381,6 +1965,12 @@ packages: graceful-fs: 4.2.6 dev: true + /keypather/1.10.2: + resolution: {integrity: sha1-4ESWMtSz5RbyHMAUznxWRP3c5hQ=} + dependencies: + '101': 1.6.3 + dev: true + /kind-of/6.0.3: resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} engines: {node: '>=0.10.0'} @@ -1391,6 +1981,10 @@ packages: engines: {node: '>=6'} dev: false + /kuler/2.0.0: + resolution: {integrity: sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==} + dev: true + /lines-and-columns/1.1.6: resolution: {integrity: sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=} dev: true @@ -1446,6 +2040,9 @@ packages: resolution: {integrity: sha1-lDbjTtJgk+1/+uGTYUQ1CRXZrdg=} dev: true + /lodash/4.17.21: + resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + /log-symbols/4.1.0: resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} engines: {node: '>=10'} @@ -1454,6 +2051,26 @@ packages: is-unicode-supported: 0.1.0 dev: true + /logform/1.10.0: + resolution: {integrity: sha512-em5ojIhU18fIMOw/333mD+ZLE2fis0EzXl1ZwHx4iQzmpQi6odNiY/t+ITNr33JZhT9/KEaH+UPIipr6a9EjWg==} + dependencies: + colors: 1.4.0 + fast-safe-stringify: 2.0.7 + fecha: 2.3.3 + ms: 2.1.3 + triple-beam: 1.3.0 + dev: true + + /logform/2.2.0: + resolution: {integrity: sha512-N0qPlqfypFx7UHNn4B3lzS/b0uLqt2hmuoa+PpuXNYgozdJYAyauF5Ky0BWVjrxDlMWiT3qN4zPq3vVAfZy7Yg==} + dependencies: + colors: 1.4.0 + fast-safe-stringify: 2.0.7 + fecha: 4.2.1 + ms: 2.1.3 + triple-beam: 1.3.0 + dev: true + /lru-cache/4.1.5: resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==} dependencies: @@ -1468,12 +2085,22 @@ packages: yallist: 4.0.0 dev: true + /lru-queue/0.1.0: + resolution: {integrity: sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM=} + dependencies: + es5-ext: 0.10.53 + dev: true + /magic-string/0.25.7: resolution: {integrity: sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==} dependencies: sourcemap-codec: 1.4.8 dev: true + /make-error/1.3.6: + resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} + dev: false + /map-obj/1.0.1: resolution: {integrity: sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=} engines: {node: '>=0.10.0'} @@ -1484,6 +2111,19 @@ packages: engines: {node: '>=8'} dev: true + /memoizee/0.4.15: + resolution: {integrity: sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ==} + dependencies: + d: 1.0.1 + es5-ext: 0.10.53 + es6-weak-map: 2.0.3 + event-emitter: 0.3.5 + is-promise: 2.2.2 + lru-queue: 0.1.0 + next-tick: 1.1.0 + timers-ext: 0.1.7 + dev: true + /meow/6.1.1: resolution: {integrity: sha512-3YffViIt2QWgTy6Pale5QpopX/IvU3LPL03jOTqp6pGj3VjesdO/U8CuHMKpnQr4shCNCM5fd5XFFvIIl6JBHg==} engines: {node: '>=8'} @@ -1538,7 +2178,6 @@ packages: resolution: {integrity: sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==} dependencies: brace-expansion: 1.1.11 - dev: true /minimist-options/4.1.0: resolution: {integrity: sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==} @@ -1549,6 +2188,10 @@ packages: kind-of: 6.0.3 dev: true + /minimist/1.2.5: + resolution: {integrity: sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==} + dev: false + /mixme/0.5.1: resolution: {integrity: sha512-NaeZIckeBFT7i0XBEpGyFcAE0/bLcQ9MHErTpnU3bLWVE5WZbxG5Y3fDsMxYGifTo5khDA42OquXCC2ngKJB+g==} engines: {node: '>= 8.0.0'} @@ -1559,11 +2202,27 @@ packages: engines: {node: '>=4'} dev: false + /ms/2.0.0: + resolution: {integrity: sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=} + dev: true + + /ms/2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + dev: true + /nanoid/3.1.22: resolution: {integrity: sha512-/2ZUaJX2ANuLtTvqTlgqBQNJoQO398KyJgZloL0PZkC0dpysjncRUPsFe3DUPzz/y3h+u7C46np8RMuvF3jsSQ==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true + /next-tick/1.0.0: + resolution: {integrity: sha1-yobR/ogoFpsBICCOPchCS524NCw=} + dev: true + + /next-tick/1.1.0: + resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==} + dev: true + /normalize-package-data/2.5.0: resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} dependencies: @@ -1585,10 +2244,42 @@ packages: path-key: 2.0.1 dev: true + /object-inspect/1.10.2: + resolution: {integrity: sha512-gz58rdPpadwztRrPjZE9DZLOABUpTGdcANUgOwBFO1C+HZZhePoP83M65WGDmbpwFYJSWqavbl4SgDn4k8RYTA==} + dev: false + + /object-is/1.1.5: + resolution: {integrity: sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.3 + dev: false + + /object-keys/1.1.1: + resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} + engines: {node: '>= 0.4'} + dev: false + + /object.assign/4.1.2: + resolution: {integrity: sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.3 + has-symbols: 1.0.2 + object-keys: 1.1.1 + dev: false + /once/1.4.0: resolution: {integrity: sha1-WDsap3WWHUsROsF9nFC6753Xa9E=} dependencies: wrappy: 1.0.2 + + /one-time/1.0.0: + resolution: {integrity: sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==} + dependencies: + fn.name: 1.1.0 dev: true /onetime/5.1.2: @@ -1694,7 +2385,6 @@ packages: /path-is-absolute/1.0.1: resolution: {integrity: sha1-F0uSaHNVNP+8es5r9TpanhtcX18=} engines: {node: '>=0.10.0'} - dev: true /path-key/2.0.1: resolution: {integrity: sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=} @@ -1703,7 +2393,6 @@ packages: /path-parse/1.0.6: resolution: {integrity: sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==} - dev: true /path-type/4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} @@ -1749,6 +2438,10 @@ packages: hasBin: true dev: true + /process-nextick-args/2.0.1: + resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} + dev: true + /pseudomap/1.0.2: resolution: {integrity: sha1-8FKijacOYYkX7wqKw0wa5aaChrM=} dev: true @@ -1762,6 +2455,10 @@ packages: engines: {node: '>=8'} dev: true + /ramda/0.26.1: + resolution: {integrity: sha512-hLWjpy7EnsDBb0p+Z3B7rPi3GDeRG5ZtiI33kJhTt+ORCd38AbAIjB/9zRIUoeTbE/AVX5ZkU7m6bznsvrf8eQ==} + dev: true + /randombytes/2.1.0: resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} dependencies: @@ -1797,6 +2494,18 @@ packages: strip-bom: 3.0.0 dev: true + /readable-stream/2.3.7: + resolution: {integrity: sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==} + dependencies: + core-util-is: 1.0.2 + inherits: 2.0.4 + isarray: 1.0.0 + process-nextick-args: 2.0.1 + safe-buffer: 5.1.2 + string_decoder: 1.1.1 + util-deprecate: 1.0.2 + dev: true + /readable-stream/3.6.0: resolution: {integrity: sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==} engines: {node: '>= 6'} @@ -1821,10 +2530,22 @@ packages: strip-indent: 3.0.0 dev: true + /regenerator-runtime/0.11.1: + resolution: {integrity: sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==} + dev: true + /regenerator-runtime/0.13.7: resolution: {integrity: sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==} dev: true + /regexp.prototype.flags/1.3.1: + resolution: {integrity: sha512-JiBdRBq91WlY7uRJ0ds7R+dU02i6LKi8r3BuQhNXn+kmeLN+EfHhfjqMRis1zJxnlu88hq/4dx0P2OP3APRTOA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.3 + dev: false + /require-directory/2.1.1: resolution: {integrity: sha1-jGStX9MNqxyXbiNE/+f3kqam30I=} engines: {node: '>=0.10.0'} @@ -1850,6 +2571,13 @@ packages: path-parse: 1.0.6 dev: true + /resolve/2.0.0-next.3: + resolution: {integrity: sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==} + dependencies: + is-core-module: 2.3.0 + path-parse: 1.0.6 + dev: false + /restore-cursor/3.1.0: resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} engines: {node: '>=8'} @@ -1858,6 +2586,12 @@ packages: signal-exit: 3.0.3 dev: true + /resumer/0.0.0: + resolution: {integrity: sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k=} + dependencies: + through: 2.3.8 + dev: false + /reusify/1.0.4: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} @@ -1922,6 +2656,18 @@ packages: fsevents: 2.3.2 dev: true + /rpc-websockets/4.6.1: + resolution: {integrity: sha512-xyQC6+95hOFQJBuMRIYi2E3/ddKEMMKuql5Sd49r4578CcthP0N9nHHFkVtvrsAgz4OQH6j7zsLurLNY0nOU6g==} + dependencies: + '@babel/runtime': 7.13.17 + assert-args: 1.2.1 + babel-runtime: 6.26.0 + circular-json: 0.5.9 + eventemitter3: 3.1.2 + uuid: 3.4.0 + ws: 5.2.2 + dev: true + /run-parallel/1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} dependencies: @@ -1935,6 +2681,10 @@ packages: mri: 1.1.6 dev: false + /safe-buffer/5.1.2: + resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} + dev: true + /safe-buffer/5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} dev: true @@ -1983,10 +2733,24 @@ packages: engines: {node: '>=0.10.0'} dev: true + /side-channel/1.0.4: + resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.1.1 + object-inspect: 1.10.2 + dev: false + /signal-exit/3.0.3: resolution: {integrity: sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==} dev: true + /simple-swizzle/0.2.2: + resolution: {integrity: sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=} + dependencies: + is-arrayish: 0.3.2 + dev: true + /sirv-cli/1.0.11: resolution: {integrity: sha512-L8NILoRSBd38VcfFcERYCaVCnWPBLo9G6u/a37UJ8Ysv4DfjizMbFBcM+SswNnndJienhR6qy8KFuAEaeL4g8Q==} engines: {node: '>= 10'} @@ -2033,12 +2797,10 @@ packages: dependencies: buffer-from: 1.1.1 source-map: 0.6.1 - dev: true /source-map/0.6.1: resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} engines: {node: '>=0.10.0'} - dev: true /source-map/0.7.3: resolution: {integrity: sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==} @@ -2082,6 +2844,10 @@ packages: resolution: {integrity: sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=} dev: true + /stack-trace/0.0.10: + resolution: {integrity: sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=} + dev: true + /stream-transform/2.1.0: resolution: {integrity: sha512-bwQO+75rzQbug7e5OOHnOR3FgbJ0fCjHmDIdynkwUaFzleBXugGmv2dx3sX3aIHUQRLjrcisRPgN9BWl63uGgw==} dependencies: @@ -2105,6 +2871,35 @@ packages: strip-ansi: 6.0.0 dev: true + /string.prototype.trim/1.2.4: + resolution: {integrity: sha512-hWCk/iqf7lp0/AgTF7/ddO1IWtSNPASjlzCicV5irAVdE1grjsneK26YG6xACMBEdCvO8fUST0UzDMh/2Qy+9Q==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.3 + es-abstract: 1.18.0 + dev: false + + /string.prototype.trimend/1.0.4: + resolution: {integrity: sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.3 + dev: false + + /string.prototype.trimstart/1.0.4: + resolution: {integrity: sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.3 + dev: false + + /string_decoder/1.1.1: + resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} + dependencies: + safe-buffer: 5.1.2 + dev: true + /string_decoder/1.3.0: resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} dependencies: @@ -2214,6 +3009,29 @@ packages: engines: {node: '>= 8'} dev: true + /tape/5.2.2: + resolution: {integrity: sha512-grXrzPC1ly2kyTMKdqxh5GiLpb0BpNctCuecTB0psHX4Gu0nc+uxWR4xKjTh/4CfQlH4zhvTM2/EXmHXp6v/uA==} + hasBin: true + dependencies: + call-bind: 1.0.2 + deep-equal: 2.0.5 + defined: 1.0.0 + dotignore: 0.1.2 + for-each: 0.3.3 + glob: 7.1.6 + has: 1.0.3 + inherits: 2.0.4 + is-regex: 1.1.2 + minimist: 1.2.5 + object-inspect: 1.10.2 + object-is: 1.1.5 + object.assign: 4.1.2 + resolve: 2.0.0-next.3 + resumer: 0.0.0 + string.prototype.trim: 1.2.4 + through: 2.3.8 + dev: false + /term-size/1.2.0: resolution: {integrity: sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=} engines: {node: '>=4'} @@ -2236,6 +3054,21 @@ packages: source-map-support: 0.5.19 dev: true + /text-hex/1.0.0: + resolution: {integrity: sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==} + dev: true + + /through/2.3.8: + resolution: {integrity: sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=} + dev: false + + /timers-ext/0.1.7: + resolution: {integrity: sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==} + dependencies: + es5-ext: 0.10.53 + next-tick: 1.1.0 + dev: true + /tinydate/1.3.0: resolution: {integrity: sha512-7cR8rLy2QhYHpsBDBVYnnWXm8uRTr38RoZakFSW7Bs7PzfMPNZthuMLkwqZv7MTu8lhQ91cOFYS5a7iFj2oR3w==} engines: {node: '>=4'} @@ -2265,6 +3098,30 @@ packages: engines: {node: '>=8'} dev: true + /triple-beam/1.3.0: + resolution: {integrity: sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==} + dev: true + + /ts-node/9.1.1_typescript@4.2.4: + resolution: {integrity: sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg==} + engines: {node: '>=10.0.0'} + hasBin: true + peerDependencies: + typescript: '>=2.7' + dependencies: + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + source-map-support: 0.5.19 + typescript: 4.2.4 + yn: 3.1.1 + dev: false + + /tslib/2.2.0: + resolution: {integrity: sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==} + dev: true + /tty-table/2.8.13: resolution: {integrity: sha512-eVV/+kB6fIIdx+iUImhXrO22gl7f6VmmYh0Zbu6C196fe1elcHXd7U6LcLXu0YoVPc2kNesWiukYcdK8ZmJ6aQ==} engines: {node: '>=8.16.0'} @@ -2278,6 +3135,10 @@ packages: yargs: 15.4.1 dev: true + /type-detect/0.1.1: + resolution: {integrity: sha1-C6XsKohWQORw6k6FBZcZANrFiCI=} + dev: true + /type-fest/0.13.1: resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} engines: {node: '>=10'} @@ -2293,11 +3154,27 @@ packages: engines: {node: '>=8'} dev: true + /type/1.2.0: + resolution: {integrity: sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==} + dev: true + + /type/2.5.0: + resolution: {integrity: sha512-180WMDQaIMm3+7hGXWf12GtdniDEy7nYcyFMKJn/eZz/6tSLXrUN9V0wKSbMjej0I1WHWbpREDEKHtqPQa9NNw==} + dev: true + /typescript/4.2.4: resolution: {integrity: sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==} engines: {node: '>=4.2.0'} hasBin: true - dev: true + + /unbox-primitive/1.0.1: + resolution: {integrity: sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==} + dependencies: + function-bind: 1.1.1 + has-bigints: 1.0.1 + has-symbols: 1.0.2 + which-boxed-primitive: 1.0.2 + dev: false /universalify/0.1.2: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} @@ -2308,6 +3185,22 @@ packages: resolution: {integrity: sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=} dev: true + /uuid/3.4.0: + resolution: {integrity: sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==} + hasBin: true + dev: true + + /uuid/8.3.2: + resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} + hasBin: true + + /uuidv4/6.2.7: + resolution: {integrity: sha512-3XvpuG5LVO9Bd9H/mjdMd7eh556ojlAFx5jJ7dSiGGjFNaU8XhcKhhnV34YGjyZiRs8kPBwXuhYJoyvrY+EMOA==} + dependencies: + '@types/uuid': 8.3.0 + uuid: 8.3.2 + dev: false + /validate-npm-package-license/3.0.4: resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} dependencies: @@ -2321,6 +3214,25 @@ packages: defaults: 1.0.3 dev: true + /which-boxed-primitive/1.0.2: + resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} + dependencies: + is-bigint: 1.0.1 + is-boolean-object: 1.1.0 + is-number-object: 1.0.4 + is-string: 1.0.5 + is-symbol: 1.0.3 + dev: false + + /which-collection/1.0.1: + resolution: {integrity: sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==} + dependencies: + is-map: 2.0.2 + is-set: 2.0.2 + is-weakmap: 2.0.1 + is-weakset: 2.0.1 + dev: false + /which-module/2.0.0: resolution: {integrity: sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=} dev: true @@ -2333,6 +3245,19 @@ packages: path-exists: 4.0.0 dev: true + /which-typed-array/1.1.4: + resolution: {integrity: sha512-49E0SpUe90cjpoc7BOJwyPHRqSAd12c10Qm2amdEZrJPCY2NDxaW01zHITrem+rnETY3dwrbH3UUrUwagfCYDA==} + engines: {node: '>= 0.4'} + dependencies: + available-typed-arrays: 1.0.2 + call-bind: 1.0.2 + es-abstract: 1.18.0 + foreach: 2.0.5 + function-bind: 1.1.1 + has-symbols: 1.0.2 + is-typed-array: 1.1.5 + dev: false + /which/1.3.1: resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} hasBin: true @@ -2347,6 +3272,50 @@ packages: string-width: 2.1.1 dev: true + /winston-compat/0.1.5: + resolution: {integrity: sha512-EPvPcHT604AV3Ji6d3+vX8ENKIml9VSxMRnPQ+cuK/FX6f3hvPP2hxyoeeCOCFvDrJEujalfcKWlWPvAnFyS9g==} + engines: {node: '>= 6.4.0'} + dependencies: + cycle: 1.0.3 + logform: 1.10.0 + triple-beam: 1.3.0 + dev: true + + /winston-null/2.0.0_winston@3.3.3: + resolution: {integrity: sha512-uS5tJB5OkLWOoc3I7/LsWUfTIa5Du38XSviHf/b0TINK659Np9368FJwTt15UoZQYUQVxLpM06lxk2dKET22Xw==} + engines: {node: '>=6'} + peerDependencies: + winston: '>=2.0.0' + dependencies: + semver: 5.7.1 + winston: 3.3.3 + winston-compat: 0.1.5 + winston-transport: 4.4.0 + dev: true + + /winston-transport/4.4.0: + resolution: {integrity: sha512-Lc7/p3GtqtqPBYYtS6KCN3c77/2QCev51DvcJKbkFPQNoj1sinkGwLGFDxkXY9J6p9+EPnYs+D90uwbnaiURTw==} + engines: {node: '>= 6.4.0'} + dependencies: + readable-stream: 2.3.7 + triple-beam: 1.3.0 + dev: true + + /winston/3.3.3: + resolution: {integrity: sha512-oEXTISQnC8VlSAKf1KYSSd7J6IWuRPQqDdo8eoRNaYKLvwSb5+79Z3Yi1lrl6KDpU6/VWaxpakDAtb1oQ4n9aw==} + engines: {node: '>= 6.4.0'} + dependencies: + '@dabh/diagnostics': 2.0.2 + async: 3.2.0 + is-stream: 2.0.0 + logform: 2.2.0 + one-time: 1.0.0 + readable-stream: 3.6.0 + stack-trace: 0.0.10 + triple-beam: 1.3.0 + winston-transport: 4.4.0 + dev: true + /wrap-ansi/6.2.0: resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} engines: {node: '>=8'} @@ -2358,6 +3327,11 @@ packages: /wrappy/1.0.2: resolution: {integrity: sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=} + + /ws/5.2.2: + resolution: {integrity: sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==} + dependencies: + async-limiter: 1.0.1 dev: true /ws/7.4.5: @@ -2384,6 +3358,11 @@ packages: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} dev: true + /yaml/1.10.2: + resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==} + engines: {node: '>= 6'} + dev: true + /yargs-parser/18.1.3: resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} engines: {node: '>=6'} @@ -2409,6 +3388,11 @@ packages: yargs-parser: 18.1.3 dev: true + /yn/3.1.1: + resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} + engines: {node: '>=6'} + dev: false + /yocto-queue/0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 1a711283..69fdf7c3 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,3 +1,4 @@ packages: - 'ui/apps/*' - 'ui/libs/*' + - 'tests' diff --git a/tests/package.json b/tests/package.json index 4a0fce85..8e49fe86 100644 --- a/tests/package.json +++ b/tests/package.json @@ -1,4 +1,5 @@ { + "name": "@syn-ui/tests", "main": "index.js", "scripts": { "test": "npm run test:setup && npm run test:standard", @@ -11,16 +12,19 @@ "license": "CAL-1.0", "dependencies": { "esm": "^3.2.25", - "lodash": "^4.17.19", - "tape": "^5.0.1", - "ts-node": "^8.10.2", - "typescript": "^3.9.6", - "uuidv4": "^6.2.3" + "lodash": "^4.17.21", + "tape": "^5.2.2", + "ts-node": "^9.1.1", + "typescript": "^4.2.4", + "uuidv4": "^6.2.7" }, "devDependencies": { - "@holochain/conductor-api": "0.0.1", - "@holochain/tryorama": "0.4.1", - "@types/lodash": "^4.14.158", - "@types/node": "^14.0.14" + "@holochain/conductor-api": "0.0.3", + "@holochain/tryorama": "0.4.2", + "@syn-ui/model": "workspace:^1.0.0", + "@syn-ui/utils": "workspace:^1.0.0", + "@syn-ui/zome-client": "workspace:^1.0.0", + "@types/lodash": "^4.14.168", + "@types/node": "^14.14.41" } -} +} \ No newline at end of file diff --git a/tests/syn-lib/syn-lib.ts b/tests/syn-lib/syn-lib.ts index b27ad9e6..f369e8ce 100644 --- a/tests/syn-lib/syn-lib.ts +++ b/tests/syn-lib/syn-lib.ts @@ -1,7 +1,7 @@ -import { Connection } from '../../ui/src/connection' -import { Content } from '../../ui/src/content' -import { Config, InstallAgentsHapps } from '@holochain/tryorama' import path from 'path' +import { Config, InstallAgentsHapps } from '@holochain/tryorama' +import { Content, me_b } from '@syn-ui/zome-client' +import { folks_b, join_session, scribe_str_b } from '@syn-ui/model' import { delay } from '../common' const config = Config.gen() @@ -47,17 +47,23 @@ export const oFn = (orchestrator)=>{ await s.shareAllNodes([player1, player2]) const appPort1:number = player1._conductor.app_ws.client.socket._url.split(':')[2] const appPort2:number = player2._conductor.app_ws.client.socket._url.split(':')[2] - const c1 = new Connection({}, appPort1, syn1.hAppId) - await c1.open(default_content, applyDeltas) - await c1.joinSession() - const c2 = new Connection({}, appPort2, syn2.hAppId) - await c2.open(default_content, applyDeltas) - await c2.joinSession() - t.equal(c1.syn.me, c2.session._scribe_str) + const c1 = join_session({ + app_port: appPort1, app_id: syn1.hAppId, apply_delta_fn: applyDeltas + }) + // const c1 = new Connection({}, appPort1, syn1.hAppId) + // await c1.open(default_content, applyDeltas) + // await c1.joinSession() + const c2 = join_session({ + app_port: appPort2, app_id: syn2.hAppId, apply_delta_fn: applyDeltas + }) + // const c2 = new Connection({}, appPort2, syn2.hAppId) + // await c2.open(default_content, applyDeltas) + // await c2.joinSession() + t.equal(me_b(c1).$, scribe_str_b(c2).$) while (true) { - const others = Object.keys(c2.session.others) + const others = Object.keys(folks_b(c2).$) if (others.length > 0) { - t.equal(c2.session.others[others[0]].pubKey.toString('base64'), c1.syn.me) + t.equal(folks_b(c2).$[others[0]].pubKey.toString('base64'), me_b(c1).$) break } else { await delay(1000) diff --git a/tests/unit-test/syn.ts b/tests/unit-test/syn.ts index 829cc92a..9a7a922d 100644 --- a/tests/unit-test/syn.ts +++ b/tests/unit-test/syn.ts @@ -1,7 +1,8 @@ import { Config, InstallAgentsHapps } from '@holochain/tryorama' import * as _ from 'lodash' import path from 'path' -import {delay, Delta, Signal, StateForSync} from '../common' +import { Delta, Signal } from '@syn-ui/zome-client' +import { delay } from '@holochain/tryorama/lib/util' const config = Config.gen(); diff --git a/ui/apps/app/.gitignore b/ui/apps/app/.gitignore new file mode 100644 index 00000000..c6f271f7 --- /dev/null +++ b/ui/apps/app/.gitignore @@ -0,0 +1 @@ +public/build diff --git a/ui/apps/app/package.json b/ui/apps/app/package.json index 178d4303..474d69b6 100644 --- a/ui/apps/app/package.json +++ b/ui/apps/app/package.json @@ -13,8 +13,8 @@ "svelte-fa": "^2.2.0" }, "devDependencies": { - "@ctx-core/object": "^17.5.9", - "@ctx-core/store": "^24.5.0", + "@ctx-core/object": "^17.5.10", + "@ctx-core/store": "^24.5.2", "@rollup/plugin-commonjs": "^18.0.0", "@rollup/plugin-node-resolve": "^11.2.1", "@rollup/plugin-replace": "^2.4.2", @@ -28,6 +28,7 @@ "rollup-plugin-terser": "^7.0.2", "svelte": "^3.37.0", "svelte-preprocess": "^4.7.2", + "tslib": "^2.2.0", "typescript": "^4.2.4" } } \ No newline at end of file diff --git a/ui/apps/app/public/build/main.css b/ui/apps/app/public/build/main.css deleted file mode 100644 index 259e136d..00000000 --- a/ui/apps/app/public/build/main.css +++ /dev/null @@ -1 +0,0 @@ -main.svelte-hss0sb{padding:1em;background:rgba(119, 153, 102, 0.2);grid-column:1/2}.toolbar.svelte-hss0sb{background:rgba(153, 118, 102, 0.2);padding:2rem;grid-column:1/2}.folks-tray.svelte-hss0sb{min-width:calc((var(--folks-padding) * 2) + var(--folk-hex-width));width:auto;background:rgba(115, 102, 153, 0.2);grid-column:2/3;grid-row:1/4}:root{--resizeable-height:200px;--tab-width:60px}.debug-drawer.svelte-hss0sb{width:100%;box-sizing:border-box;height:var(--resizeable-height);min-height:var(--min-height);max-height:var(--max-height);background:#cde4e4;position:absolute;bottom:0;text-align:left;grid-column:1/2;overflow:hidden;z-index:90}.hidden.svelte-hss0sb{height:0;min-height:0}.handle.svelte-hss0sb{height:1px;width:100%;background-color:#98b3b3;z-index:100}.handle.svelte-hss0sb::after{content:"";height:9px;position:absolute;left:0;right:0;margin-bottom:-4px;background-color:transparent;cursor:ns-resize;z-index:101}.tab.svelte-hss0sb{z-index:130;position:absolute;width:var(--tab-width);height:calc(var(--tab-width) / 2);left:calc(50% - (var(--tab-width) / 2));bottom:var(--resizeable-height);overflow:hidden;margin-bottom:-2px;border-top-left-radius:calc(var(--tab-width) / 2);border-top-right-radius:calc(var(--tab-width) / 2);pointer-events:none}.tab-inner.svelte-hss0sb{position:absolute;box-sizing:border-box;width:var(--tab-width);height:var(--tab-width);background:#cde4e4;border:1px solid #94b8b8;color:#669999;border-radius:calc(var(--tab-width) / 2);cursor:pointer;text-align:center;top:calc(var(--tab-width) / 2);transition:transform 0.2s ease-out 0.2s}.tab.shown.svelte-hss0sb{pointer-events:all}.tab-inner.shown.svelte-hss0sb{transform:translateY(-50%);transition:transform 0.2s ease-out 0s}.tab.drawer-hidden.svelte-hss0sb{bottom:0;pointer-events:all}.tab-icon.svelte-hss0sb{margin-top:9px}.debug-content.svelte-hss0sb{padding:1rem;word-wrap:break-word;height:100%;overflow-y:scroll;box-sizing:border-box;z-index:90}h1.svelte-hss0sb{color:#ff3e00;text-transform:uppercase;font-size:4em;font-weight:100;margin:auto}@media(min-width: 640px){main.svelte-hss0sb{max-width:none}}ul.svelte-1am20lw{margin-bottom:1rem}.history.svelte-1718ppz{width:auto;border:1px solid rgba(0, 0, 0, 0.25);border-radius:4px;padding:0.5em 0.5em 0;background-color:rgba(255, 255, 255, 0.25)}.history-entries.svelte-1718ppz{display:flex;flex-direction:row;flex-wrap:nowrap;gap:1em;overflow-x:scroll;padding:0.5em 0 1.2em}editor.svelte-4kugpc{width:auto;min-height:10em;border:1px solid black;background-color:rgba(255, 255, 255, 0.6);font-family:Arial;display:block;white-space:pre-wrap;margin:1em 0 0.4em 0;padding:4px}.cursor.svelte-4kugpc{display:inline;border-left:solid 2px;margin-right:-2px;z-index:10;position:relative}.noscribe{pointer-events:none;position:relative}.noscribe:after{content:" ";z-index:20;display:block;position:absolute;height:100%;top:0;left:0;right:0;background:rgba(255, 255, 255, 0.7)}input.svelte-1u2trq8{width:4em;border-radius:4px}.session.svelte-1u2trq8{border-radius:4px;background-color:pink}button.svelte-1u2trq8{cursor:pointer}.title-wrapper.svelte-3yilbg{height:1.6em}.title.svelte-3yilbg{font-weight:bold;display:inline-block;padding:0.4em;-webkit-padding:0.4em 0;margin:0 0 0.5em 0;border-width:1px;border-color:#00000000;border-style:solid;border-radius:2px}.title-hover.svelte-3yilbg{border-style:dashed;border-color:#aaa}.title-input.svelte-3yilbg{border-style:solid;border-color:#ccc;font-weight:bold;margin-bottom:0}.untitled.svelte-3yilbg{color:lightgray}:root{--folks-padding:.75em;--folks-grid-gap:1rem}.folks.svelte-ekfsic{display:grid;grid-gap:var(--folks-grid-gap);padding:var(--folks-grid-gap) var(--folks-padding) var(--folks-padding);place-items:center}:root{--folk-hex-width:60px;--folk-hex-height:calc(var(--folk-hex-width) * .8666);--hex-border:4px;--scribe-hex-width:calc(var(--folk-hex-width) - 2 * var(--hex-border));--scribe-hex-height:calc(var(--folk-hex-height) - 2 * var(--hex-border));--scribe-scale:0.8666 }.folk.svelte-6nts23.svelte-6nts23{display:grid;width:var(--folk-hex-width);height:var(--folk-hex-height);clip-path:polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);place-items:center;color:white;text-shadow:0 0 5px black;cursor:pointer}.folk-color.svelte-6nts23.svelte-6nts23{z-index:-10;content:"";width:calc(var(--folk-hex-width) - (var(--hex-border)) * 2);height:calc(var(--folk-hex-height) - (var(--hex-border)) * 2);clip-path:polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);position:absolute}.scribe-wrapper.svelte-6nts23.svelte-6nts23{display:grid;position:relative;place-items:center}.scribe-halo.svelte-6nts23.svelte-6nts23{width:var(--folk-hex-width);height:var(--folk-hex-height);clip-path:polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 12.5% 75%, calc(12.5% + 1.732px) calc(75% - 1px), calc(25% + 1.15px) calc(100% - 2px), 50% calc(100% - 2px), 50% 100%, 75% 100%, 87.5% 75%, calc(87.5% - 1.732px) calc(75% - 1px), calc(100% - 2.31px) 50%, calc(87.5% - 1.732px) calc(25% + 1px), 87.5% 25%, 75% 0%, 50% 0%, 50% calc(0% + 2px), calc(25% + 1.15px) calc(0% + 2px), calc(12.5% + 1.732px) calc(25% + 1px), 12.5% 25%);background-color:#1a1a1a;position:absolute}.scribe.svelte-6nts23.svelte-6nts23{margin:var(--hex-border) 0;scale:var(--scribe-scale)}.out-of-session.svelte-6nts23.svelte-6nts23{background-color:goldenrod !important}.out-of-session.svelte-6nts23 div.svelte-6nts23{background-color:goldenrodyellow !important}.history-entry.svelte-12sic9q{border:1px solid #ccc;border-radius:4px;padding:0.3em;width:auto;height:2.6em;flex-grow:0;flex-shrink:0;flex-basis:auto;white-space:pre-wrap;overflow-y:scroll}.recorded.svelte-12sic9q{background-color:lightyellow}.committed.svelte-12sic9q{background-color:lightgreen}.requested.svelte-12sic9q{background-color:lightcoral} \ No newline at end of file diff --git a/ui/apps/app/public/build/main.js b/ui/apps/app/public/build/main.js deleted file mode 100644 index 5e85a6c5..00000000 --- a/ui/apps/app/public/build/main.js +++ /dev/null @@ -1,7010 +0,0 @@ - -(function(l, r) { if (l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (window.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(window.document); -var app = (function () { - 'use strict'; - - function noop() { } - function add_location(element, file, line, column, char) { - element.__svelte_meta = { - loc: { file, line, column, char } - }; - } - function run(fn) { - return fn(); - } - function blank_object() { - return Object.create(null); - } - function run_all(fns) { - fns.forEach(run); - } - function is_function(thing) { - return typeof thing === 'function'; - } - function safe_not_equal(a, b) { - return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function'); - } - function is_empty(obj) { - return Object.keys(obj).length === 0; - } - function validate_store(store, name) { - if (store != null && typeof store.subscribe !== 'function') { - throw new Error(`'${name}' is not a store with a 'subscribe' method`); - } - } - function subscribe(store, ...callbacks) { - if (store == null) { - return noop; - } - const unsub = store.subscribe(...callbacks); - return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub; - } - function get_store_value(store) { - let value; - subscribe(store, _ => value = _)(); - return value; - } - function component_subscribe(component, store, callback) { - component.$$.on_destroy.push(subscribe(store, callback)); - } - function set_store_value(store, ret, value = ret) { - store.set(value); - return ret; - } - function action_destroyer(action_result) { - return action_result && is_function(action_result.destroy) ? action_result.destroy : noop; - } - - function append(target, node) { - target.appendChild(node); - } - function insert(target, node, anchor) { - target.insertBefore(node, anchor || null); - } - function detach(node) { - node.parentNode.removeChild(node); - } - function destroy_each(iterations, detaching) { - for (let i = 0; i < iterations.length; i += 1) { - if (iterations[i]) - iterations[i].d(detaching); - } - } - function element(name) { - return document.createElement(name); - } - function text(data) { - return document.createTextNode(data); - } - function space() { - return text(' '); - } - function empty() { - return text(''); - } - function listen(node, event, handler, options) { - node.addEventListener(event, handler, options); - return () => node.removeEventListener(event, handler, options); - } - function attr(node, attribute, value) { - if (value == null) - node.removeAttribute(attribute); - else if (node.getAttribute(attribute) !== value) - node.setAttribute(attribute, value); - } - function children(element) { - return Array.from(element.childNodes); - } - function set_input_value(input, value) { - input.value = value == null ? '' : value; - } - function toggle_class(element, name, toggle) { - element.classList[toggle ? 'add' : 'remove'](name); - } - function custom_event(type, detail) { - const e = document.createEvent('CustomEvent'); - e.initCustomEvent(type, false, false, detail); - return e; - } - - let current_component; - function set_current_component(component) { - current_component = component; - } - function get_current_component() { - if (!current_component) - throw new Error('Function called outside component initialization'); - return current_component; - } - function afterUpdate(fn) { - get_current_component().$$.after_update.push(fn); - } - function createEventDispatcher() { - const component = get_current_component(); - return (type, detail) => { - const callbacks = component.$$.callbacks[type]; - if (callbacks) { - // TODO are there situations where events could be dispatched - // in a server (non-DOM) environment? - const event = custom_event(type, detail); - callbacks.slice().forEach(fn => { - fn.call(component, event); - }); - } - }; - } - function setContext(key, context) { - get_current_component().$$.context.set(key, context); - } - function getContext(key) { - return get_current_component().$$.context.get(key); - } - - const dirty_components = []; - const binding_callbacks = []; - const render_callbacks = []; - const flush_callbacks = []; - const resolved_promise = Promise.resolve(); - let update_scheduled = false; - function schedule_update() { - if (!update_scheduled) { - update_scheduled = true; - resolved_promise.then(flush); - } - } - function tick() { - schedule_update(); - return resolved_promise; - } - function add_render_callback(fn) { - render_callbacks.push(fn); - } - let flushing = false; - const seen_callbacks = new Set(); - function flush() { - if (flushing) - return; - flushing = true; - do { - // first, call beforeUpdate functions - // and update components - for (let i = 0; i < dirty_components.length; i += 1) { - const component = dirty_components[i]; - set_current_component(component); - update(component.$$); - } - set_current_component(null); - dirty_components.length = 0; - while (binding_callbacks.length) - binding_callbacks.pop()(); - // then, once components are updated, call - // afterUpdate functions. This may cause - // subsequent updates... - for (let i = 0; i < render_callbacks.length; i += 1) { - const callback = render_callbacks[i]; - if (!seen_callbacks.has(callback)) { - // ...so guard against infinite loops - seen_callbacks.add(callback); - callback(); - } - } - render_callbacks.length = 0; - } while (dirty_components.length); - while (flush_callbacks.length) { - flush_callbacks.pop()(); - } - update_scheduled = false; - flushing = false; - seen_callbacks.clear(); - } - function update($$) { - if ($$.fragment !== null) { - $$.update(); - run_all($$.before_update); - const dirty = $$.dirty; - $$.dirty = [-1]; - $$.fragment && $$.fragment.p($$.ctx, dirty); - $$.after_update.forEach(add_render_callback); - } - } - const outroing = new Set(); - let outros; - function group_outros() { - outros = { - r: 0, - c: [], - p: outros // parent group - }; - } - function check_outros() { - if (!outros.r) { - run_all(outros.c); - } - outros = outros.p; - } - function transition_in(block, local) { - if (block && block.i) { - outroing.delete(block); - block.i(local); - } - } - function transition_out(block, local, detach, callback) { - if (block && block.o) { - if (outroing.has(block)) - return; - outroing.add(block); - outros.c.push(() => { - outroing.delete(block); - if (callback) { - if (detach) - block.d(1); - callback(); - } - }); - block.o(local); - } - } - - const globals = (typeof window !== 'undefined' - ? window - : typeof globalThis !== 'undefined' - ? globalThis - : global); - function create_component(block) { - block && block.c(); - } - function mount_component(component, target, anchor, customElement) { - const { fragment, on_mount, on_destroy, after_update } = component.$$; - fragment && fragment.m(target, anchor); - if (!customElement) { - // onMount happens before the initial afterUpdate - add_render_callback(() => { - const new_on_destroy = on_mount.map(run).filter(is_function); - if (on_destroy) { - on_destroy.push(...new_on_destroy); - } - else { - // Edge case - component was destroyed immediately, - // most likely as a result of a binding initialising - run_all(new_on_destroy); - } - component.$$.on_mount = []; - }); - } - after_update.forEach(add_render_callback); - } - function destroy_component(component, detaching) { - const $$ = component.$$; - if ($$.fragment !== null) { - run_all($$.on_destroy); - $$.fragment && $$.fragment.d(detaching); - // TODO null out other refs, including component.$$ (but need to - // preserve final state?) - $$.on_destroy = $$.fragment = null; - $$.ctx = []; - } - } - function make_dirty(component, i) { - if (component.$$.dirty[0] === -1) { - dirty_components.push(component); - schedule_update(); - component.$$.dirty.fill(0); - } - component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31)); - } - function init(component, options, instance, create_fragment, not_equal, props, dirty = [-1]) { - const parent_component = current_component; - set_current_component(component); - const $$ = component.$$ = { - fragment: null, - ctx: null, - // state - props, - update: noop, - not_equal, - bound: blank_object(), - // lifecycle - on_mount: [], - on_destroy: [], - on_disconnect: [], - before_update: [], - after_update: [], - context: new Map(parent_component ? parent_component.$$.context : options.context || []), - // everything else - callbacks: blank_object(), - dirty, - skip_bound: false - }; - let ready = false; - $$.ctx = instance - ? instance(component, options.props || {}, (i, ret, ...rest) => { - const value = rest.length ? rest[0] : ret; - if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) { - if (!$$.skip_bound && $$.bound[i]) - $$.bound[i](value); - if (ready) - make_dirty(component, i); - } - return ret; - }) - : []; - $$.update(); - ready = true; - run_all($$.before_update); - // `false` as a special case of no DOM component - $$.fragment = create_fragment ? create_fragment($$.ctx) : false; - if (options.target) { - if (options.hydrate) { - const nodes = children(options.target); - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - $$.fragment && $$.fragment.l(nodes); - nodes.forEach(detach); - } - else { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - $$.fragment && $$.fragment.c(); - } - if (options.intro) - transition_in(component.$$.fragment); - mount_component(component, options.target, options.anchor, options.customElement); - flush(); - } - set_current_component(parent_component); - } - /** - * Base class for Svelte components. Used when dev=false. - */ - class SvelteComponent { - $destroy() { - destroy_component(this, 1); - this.$destroy = noop; - } - $on(type, callback) { - const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = [])); - callbacks.push(callback); - return () => { - const index = callbacks.indexOf(callback); - if (index !== -1) - callbacks.splice(index, 1); - }; - } - $set($$props) { - if (this.$$set && !is_empty($$props)) { - this.$$.skip_bound = true; - this.$$set($$props); - this.$$.skip_bound = false; - } - } - } - - function dispatch_dev(type, detail) { - document.dispatchEvent(custom_event(type, Object.assign({ version: '3.37.0' }, detail))); - } - function append_dev(target, node) { - dispatch_dev('SvelteDOMInsert', { target, node }); - append(target, node); - } - function insert_dev(target, node, anchor) { - dispatch_dev('SvelteDOMInsert', { target, node, anchor }); - insert(target, node, anchor); - } - function detach_dev(node) { - dispatch_dev('SvelteDOMRemove', { node }); - detach(node); - } - function listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation) { - const modifiers = options === true ? ['capture'] : options ? Array.from(Object.keys(options)) : []; - if (has_prevent_default) - modifiers.push('preventDefault'); - if (has_stop_propagation) - modifiers.push('stopPropagation'); - dispatch_dev('SvelteDOMAddEventListener', { node, event, handler, modifiers }); - const dispose = listen(node, event, handler, options); - return () => { - dispatch_dev('SvelteDOMRemoveEventListener', { node, event, handler, modifiers }); - dispose(); - }; - } - function attr_dev(node, attribute, value) { - attr(node, attribute, value); - if (value == null) - dispatch_dev('SvelteDOMRemoveAttribute', { node, attribute }); - else - dispatch_dev('SvelteDOMSetAttribute', { node, attribute, value }); - } - function set_data_dev(text, data) { - data = '' + data; - if (text.wholeText === data) - return; - dispatch_dev('SvelteDOMSetData', { node: text, data }); - text.data = data; - } - function validate_each_argument(arg) { - if (typeof arg !== 'string' && !(arg && typeof arg === 'object' && 'length' in arg)) { - let msg = '{#each} only iterates over array-like objects.'; - if (typeof Symbol === 'function' && arg && Symbol.iterator in arg) { - msg += ' You can use a spread to convert this iterable into an array.'; - } - throw new Error(msg); - } - } - function validate_slots(name, slot, keys) { - for (const slot_key of Object.keys(slot)) { - if (!~keys.indexOf(slot_key)) { - console.warn(`<${name}> received an unexpected slot "${slot_key}".`); - } - } - } - /** - * Base class for Svelte components with some minor dev-enhancements. Used when dev=true. - */ - class SvelteComponentDev extends SvelteComponent { - constructor(options) { - if (!options || (!options.target && !options.$$inline)) { - throw new Error("'target' is a required option"); - } - super(); - } - $destroy() { - super.$destroy(); - this.$destroy = () => { - console.warn('Component was already destroyed'); // eslint-disable-line no-console - }; - } - $capture_state() { } - $inject_state() { } - } - - var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; - - function createCommonjsModule(fn, basedir, module) { - return module = { - path: basedir, - exports: {}, - require: function (path, base) { - return commonjsRequire(path, (base === undefined || base === null) ? module.path : base); - } - }, fn(module, module.exports), module.exports; - } - - function getAugmentedNamespace(n) { - if (n.__esModule) return n; - var a = Object.defineProperty({}, '__esModule', {value: true}); - Object.keys(n).forEach(function (k) { - var d = Object.getOwnPropertyDescriptor(n, k); - Object.defineProperty(a, k, d.get ? d : { - enumerable: true, - get: function () { - return n[k]; - } - }); - }); - return a; - } - - function commonjsRequire () { - throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs'); - } - - var admin$1 = createCommonjsModule(function (module, exports) { - Object.defineProperty(exports, "__esModule", { value: true }); - //# sourceMappingURL=admin.js.map - }); - - var app$2 = createCommonjsModule(function (module, exports) { - Object.defineProperty(exports, "__esModule", { value: true }); - //# sourceMappingURL=app.js.map - }); - - var types = createCommonjsModule(function (module, exports) { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.fakeAgentPubKey = void 0; - exports.fakeAgentPubKey = (x) => Buffer.from([0x84, 0x20, 0x24].concat('000000000000000000000000000000000000' - .split('') - .map((x) => parseInt(x, 10)))); - //# sourceMappingURL=types.js.map - }); - - // https://github.com/maxogden/websocket-stream/blob/48dc3ddf943e5ada668c31ccd94e9186f02fafbd/ws-fallback.js - - var ws = null; - - if (typeof WebSocket !== 'undefined') { - ws = WebSocket; - } else if (typeof MozWebSocket !== 'undefined') { - ws = MozWebSocket; - } else if (typeof commonjsGlobal !== 'undefined') { - ws = commonjsGlobal.WebSocket || commonjsGlobal.MozWebSocket; - } else if (typeof window !== 'undefined') { - ws = window.WebSocket || window.MozWebSocket; - } else if (typeof self !== 'undefined') { - ws = self.WebSocket || self.MozWebSocket; - } - - var browser = ws; - - var TEXT_ENCODING_AVAILABLE = (typeof process === "undefined" || process.env["TEXT_ENCODING"] !== "never") && - typeof TextEncoder !== "undefined" && - typeof TextDecoder !== "undefined"; - var STR_SIZE_MAX = 4294967295; // uint32_max - function utf8Count(str) { - var strLength = str.length; - var byteLength = 0; - var pos = 0; - while (pos < strLength) { - var value = str.charCodeAt(pos++); - if ((value & 0xffffff80) === 0) { - // 1-byte - byteLength++; - continue; - } - else if ((value & 0xfffff800) === 0) { - // 2-bytes - byteLength += 2; - } - else { - // handle surrogate pair - if (value >= 0xd800 && value <= 0xdbff) { - // high surrogate - if (pos < strLength) { - var extra = str.charCodeAt(pos); - if ((extra & 0xfc00) === 0xdc00) { - ++pos; - value = ((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000; - } - } - } - if ((value & 0xffff0000) === 0) { - // 3-byte - byteLength += 3; - } - else { - // 4-byte - byteLength += 4; - } - } - } - return byteLength; - } - function utf8EncodeJs(str, output, outputOffset) { - var strLength = str.length; - var offset = outputOffset; - var pos = 0; - while (pos < strLength) { - var value = str.charCodeAt(pos++); - if ((value & 0xffffff80) === 0) { - // 1-byte - output[offset++] = value; - continue; - } - else if ((value & 0xfffff800) === 0) { - // 2-bytes - output[offset++] = ((value >> 6) & 0x1f) | 0xc0; - } - else { - // handle surrogate pair - if (value >= 0xd800 && value <= 0xdbff) { - // high surrogate - if (pos < strLength) { - var extra = str.charCodeAt(pos); - if ((extra & 0xfc00) === 0xdc00) { - ++pos; - value = ((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000; - } - } - } - if ((value & 0xffff0000) === 0) { - // 3-byte - output[offset++] = ((value >> 12) & 0x0f) | 0xe0; - output[offset++] = ((value >> 6) & 0x3f) | 0x80; - } - else { - // 4-byte - output[offset++] = ((value >> 18) & 0x07) | 0xf0; - output[offset++] = ((value >> 12) & 0x3f) | 0x80; - output[offset++] = ((value >> 6) & 0x3f) | 0x80; - } - } - output[offset++] = (value & 0x3f) | 0x80; - } - } - var sharedTextEncoder = TEXT_ENCODING_AVAILABLE ? new TextEncoder() : undefined; - var TEXT_ENCODER_THRESHOLD = !TEXT_ENCODING_AVAILABLE - ? STR_SIZE_MAX - : typeof process !== "undefined" && process.env["TEXT_ENCODING"] !== "force" - ? 200 - : 0; - function utf8EncodeTEencode(str, output, outputOffset) { - output.set(sharedTextEncoder.encode(str), outputOffset); - } - function utf8EncodeTEencodeInto(str, output, outputOffset) { - sharedTextEncoder.encodeInto(str, output.subarray(outputOffset)); - } - var utf8EncodeTE = (sharedTextEncoder === null || sharedTextEncoder === void 0 ? void 0 : sharedTextEncoder.encodeInto) ? utf8EncodeTEencodeInto : utf8EncodeTEencode; - var CHUNK_SIZE = 4096; - function utf8DecodeJs(bytes, inputOffset, byteLength) { - var offset = inputOffset; - var end = offset + byteLength; - var units = []; - var result = ""; - while (offset < end) { - var byte1 = bytes[offset++]; - if ((byte1 & 0x80) === 0) { - // 1 byte - units.push(byte1); - } - else if ((byte1 & 0xe0) === 0xc0) { - // 2 bytes - var byte2 = bytes[offset++] & 0x3f; - units.push(((byte1 & 0x1f) << 6) | byte2); - } - else if ((byte1 & 0xf0) === 0xe0) { - // 3 bytes - var byte2 = bytes[offset++] & 0x3f; - var byte3 = bytes[offset++] & 0x3f; - units.push(((byte1 & 0x1f) << 12) | (byte2 << 6) | byte3); - } - else if ((byte1 & 0xf8) === 0xf0) { - // 4 bytes - var byte2 = bytes[offset++] & 0x3f; - var byte3 = bytes[offset++] & 0x3f; - var byte4 = bytes[offset++] & 0x3f; - var unit = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0c) | (byte3 << 0x06) | byte4; - if (unit > 0xffff) { - unit -= 0x10000; - units.push(((unit >>> 10) & 0x3ff) | 0xd800); - unit = 0xdc00 | (unit & 0x3ff); - } - units.push(unit); - } - else { - units.push(byte1); - } - if (units.length >= CHUNK_SIZE) { - result += String.fromCharCode.apply(String, units); - units.length = 0; - } - } - if (units.length > 0) { - result += String.fromCharCode.apply(String, units); - } - return result; - } - var sharedTextDecoder = TEXT_ENCODING_AVAILABLE ? new TextDecoder() : null; - var TEXT_DECODER_THRESHOLD = !TEXT_ENCODING_AVAILABLE - ? STR_SIZE_MAX - : typeof process !== "undefined" && process.env["TEXT_DECODER"] !== "force" - ? 200 - : 0; - function utf8DecodeTD(bytes, inputOffset, byteLength) { - var stringBytes = bytes.subarray(inputOffset, inputOffset + byteLength); - return sharedTextDecoder.decode(stringBytes); - } - - /** - * ExtData is used to handle Extension Types that are not registered to ExtensionCodec. - */ - var ExtData = /** @class */ (function () { - function ExtData(type, data) { - this.type = type; - this.data = data; - } - return ExtData; - }()); - - // DataView extension to handle int64 / uint64, - // where the actual range is 53-bits integer (a.k.a. safe integer) - function setUint64(view, offset, value) { - var high = value / 4294967296; - var low = value; // high bits are truncated by DataView - view.setUint32(offset, high); - view.setUint32(offset + 4, low); - } - function setInt64(view, offset, value) { - var high = Math.floor(value / 4294967296); - var low = value; // high bits are truncated by DataView - view.setUint32(offset, high); - view.setUint32(offset + 4, low); - } - function getInt64(view, offset) { - var high = view.getInt32(offset); - var low = view.getUint32(offset + 4); - return high * 4294967296 + low; - } - function getUint64(view, offset) { - var high = view.getUint32(offset); - var low = view.getUint32(offset + 4); - return high * 4294967296 + low; - } - - // https://github.com/msgpack/msgpack/blob/master/spec.md#timestamp-extension-type - var EXT_TIMESTAMP = -1; - var TIMESTAMP32_MAX_SEC = 0x100000000 - 1; // 32-bit unsigned int - var TIMESTAMP64_MAX_SEC = 0x400000000 - 1; // 34-bit unsigned int - function encodeTimeSpecToTimestamp(_a) { - var sec = _a.sec, nsec = _a.nsec; - if (sec >= 0 && nsec >= 0 && sec <= TIMESTAMP64_MAX_SEC) { - // Here sec >= 0 && nsec >= 0 - if (nsec === 0 && sec <= TIMESTAMP32_MAX_SEC) { - // timestamp 32 = { sec32 (unsigned) } - var rv = new Uint8Array(4); - var view = new DataView(rv.buffer); - view.setUint32(0, sec); - return rv; - } - else { - // timestamp 64 = { nsec30 (unsigned), sec34 (unsigned) } - var secHigh = sec / 0x100000000; - var secLow = sec & 0xffffffff; - var rv = new Uint8Array(8); - var view = new DataView(rv.buffer); - // nsec30 | secHigh2 - view.setUint32(0, (nsec << 2) | (secHigh & 0x3)); - // secLow32 - view.setUint32(4, secLow); - return rv; - } - } - else { - // timestamp 96 = { nsec32 (unsigned), sec64 (signed) } - var rv = new Uint8Array(12); - var view = new DataView(rv.buffer); - view.setUint32(0, nsec); - setInt64(view, 4, sec); - return rv; - } - } - function encodeDateToTimeSpec(date) { - var msec = date.getTime(); - var sec = Math.floor(msec / 1e3); - var nsec = (msec - sec * 1e3) * 1e6; - // Normalizes { sec, nsec } to ensure nsec is unsigned. - var nsecInSec = Math.floor(nsec / 1e9); - return { - sec: sec + nsecInSec, - nsec: nsec - nsecInSec * 1e9, - }; - } - function encodeTimestampExtension(object) { - if (object instanceof Date) { - var timeSpec = encodeDateToTimeSpec(object); - return encodeTimeSpecToTimestamp(timeSpec); - } - else { - return null; - } - } - function decodeTimestampToTimeSpec(data) { - var view = new DataView(data.buffer, data.byteOffset, data.byteLength); - // data may be 32, 64, or 96 bits - switch (data.byteLength) { - case 4: { - // timestamp 32 = { sec32 } - var sec = view.getUint32(0); - var nsec = 0; - return { sec: sec, nsec: nsec }; - } - case 8: { - // timestamp 64 = { nsec30, sec34 } - var nsec30AndSecHigh2 = view.getUint32(0); - var secLow32 = view.getUint32(4); - var sec = (nsec30AndSecHigh2 & 0x3) * 0x100000000 + secLow32; - var nsec = nsec30AndSecHigh2 >>> 2; - return { sec: sec, nsec: nsec }; - } - case 12: { - // timestamp 96 = { nsec32 (unsigned), sec64 (signed) } - var sec = getInt64(view, 4); - var nsec = view.getUint32(0); - return { sec: sec, nsec: nsec }; - } - default: - throw new Error("Unrecognized data size for timestamp: " + data.length); - } - } - function decodeTimestampExtension(data) { - var timeSpec = decodeTimestampToTimeSpec(data); - return new Date(timeSpec.sec * 1e3 + timeSpec.nsec / 1e6); - } - var timestampExtension = { - type: EXT_TIMESTAMP, - encode: encodeTimestampExtension, - decode: decodeTimestampExtension, - }; - - // ExtensionCodec to handle MessagePack extensions - var ExtensionCodec = /** @class */ (function () { - function ExtensionCodec() { - // built-in extensions - this.builtInEncoders = []; - this.builtInDecoders = []; - // custom extensions - this.encoders = []; - this.decoders = []; - this.register(timestampExtension); - } - ExtensionCodec.prototype.register = function (_a) { - var type = _a.type, encode = _a.encode, decode = _a.decode; - if (type >= 0) { - // custom extensions - this.encoders[type] = encode; - this.decoders[type] = decode; - } - else { - // built-in extensions - var index = 1 + type; - this.builtInEncoders[index] = encode; - this.builtInDecoders[index] = decode; - } - }; - ExtensionCodec.prototype.tryToEncode = function (object, context) { - // built-in extensions - for (var i = 0; i < this.builtInEncoders.length; i++) { - var encodeExt = this.builtInEncoders[i]; - if (encodeExt != null) { - var data = encodeExt(object, context); - if (data != null) { - var type = -1 - i; - return new ExtData(type, data); - } - } - } - // custom extensions - for (var i = 0; i < this.encoders.length; i++) { - var encodeExt = this.encoders[i]; - if (encodeExt != null) { - var data = encodeExt(object, context); - if (data != null) { - var type = i; - return new ExtData(type, data); - } - } - } - if (object instanceof ExtData) { - // to keep ExtData as is - return object; - } - return null; - }; - ExtensionCodec.prototype.decode = function (data, type, context) { - var decodeExt = type < 0 ? this.builtInDecoders[-1 - type] : this.decoders[type]; - if (decodeExt) { - return decodeExt(data, type, context); - } - else { - // decode() does not fail, returns ExtData instead. - return new ExtData(type, data); - } - }; - ExtensionCodec.defaultCodec = new ExtensionCodec(); - return ExtensionCodec; - }()); - - function ensureUint8Array(buffer) { - if (buffer instanceof Uint8Array) { - return buffer; - } - else if (ArrayBuffer.isView(buffer)) { - return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength); - } - else if (buffer instanceof ArrayBuffer) { - return new Uint8Array(buffer); - } - else { - // ArrayLike<number> - return Uint8Array.from(buffer); - } - } - function createDataView(buffer) { - if (buffer instanceof ArrayBuffer) { - return new DataView(buffer); - } - var bufferView = ensureUint8Array(buffer); - return new DataView(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength); - } - - var DEFAULT_MAX_DEPTH = 100; - var DEFAULT_INITIAL_BUFFER_SIZE = 2048; - var Encoder = /** @class */ (function () { - function Encoder(extensionCodec, context, maxDepth, initialBufferSize, sortKeys, forceFloat32, ignoreUndefined, forceIntegerToFloat) { - if (extensionCodec === void 0) { extensionCodec = ExtensionCodec.defaultCodec; } - if (context === void 0) { context = undefined; } - if (maxDepth === void 0) { maxDepth = DEFAULT_MAX_DEPTH; } - if (initialBufferSize === void 0) { initialBufferSize = DEFAULT_INITIAL_BUFFER_SIZE; } - if (sortKeys === void 0) { sortKeys = false; } - if (forceFloat32 === void 0) { forceFloat32 = false; } - if (ignoreUndefined === void 0) { ignoreUndefined = false; } - if (forceIntegerToFloat === void 0) { forceIntegerToFloat = false; } - this.extensionCodec = extensionCodec; - this.context = context; - this.maxDepth = maxDepth; - this.initialBufferSize = initialBufferSize; - this.sortKeys = sortKeys; - this.forceFloat32 = forceFloat32; - this.ignoreUndefined = ignoreUndefined; - this.forceIntegerToFloat = forceIntegerToFloat; - this.pos = 0; - this.view = new DataView(new ArrayBuffer(this.initialBufferSize)); - this.bytes = new Uint8Array(this.view.buffer); - } - Encoder.prototype.getUint8Array = function () { - return this.bytes.subarray(0, this.pos); - }; - Encoder.prototype.reinitializeState = function () { - this.pos = 0; - }; - Encoder.prototype.encode = function (object) { - this.reinitializeState(); - this.doEncode(object, 1); - return this.getUint8Array(); - }; - Encoder.prototype.doEncode = function (object, depth) { - if (depth > this.maxDepth) { - throw new Error("Too deep objects in depth " + depth); - } - if (object == null) { - this.encodeNil(); - } - else if (typeof object === "boolean") { - this.encodeBoolean(object); - } - else if (typeof object === "number") { - this.encodeNumber(object); - } - else if (typeof object === "string") { - this.encodeString(object); - } - else { - this.encodeObject(object, depth); - } - }; - Encoder.prototype.ensureBufferSizeToWrite = function (sizeToWrite) { - var requiredSize = this.pos + sizeToWrite; - if (this.view.byteLength < requiredSize) { - this.resizeBuffer(requiredSize * 2); - } - }; - Encoder.prototype.resizeBuffer = function (newSize) { - var newBuffer = new ArrayBuffer(newSize); - var newBytes = new Uint8Array(newBuffer); - var newView = new DataView(newBuffer); - newBytes.set(this.bytes); - this.view = newView; - this.bytes = newBytes; - }; - Encoder.prototype.encodeNil = function () { - this.writeU8(0xc0); - }; - Encoder.prototype.encodeBoolean = function (object) { - if (object === false) { - this.writeU8(0xc2); - } - else { - this.writeU8(0xc3); - } - }; - Encoder.prototype.encodeNumber = function (object) { - if (Number.isSafeInteger(object) && !this.forceIntegerToFloat) { - if (object >= 0) { - if (object < 0x80) { - // positive fixint - this.writeU8(object); - } - else if (object < 0x100) { - // uint 8 - this.writeU8(0xcc); - this.writeU8(object); - } - else if (object < 0x10000) { - // uint 16 - this.writeU8(0xcd); - this.writeU16(object); - } - else if (object < 0x100000000) { - // uint 32 - this.writeU8(0xce); - this.writeU32(object); - } - else { - // uint 64 - this.writeU8(0xcf); - this.writeU64(object); - } - } - else { - if (object >= -0x20) { - // nagative fixint - this.writeU8(0xe0 | (object + 0x20)); - } - else if (object >= -0x80) { - // int 8 - this.writeU8(0xd0); - this.writeI8(object); - } - else if (object >= -0x8000) { - // int 16 - this.writeU8(0xd1); - this.writeI16(object); - } - else if (object >= -0x80000000) { - // int 32 - this.writeU8(0xd2); - this.writeI32(object); - } - else { - // int 64 - this.writeU8(0xd3); - this.writeI64(object); - } - } - } - else { - // non-integer numbers - if (this.forceFloat32) { - // float 32 - this.writeU8(0xca); - this.writeF32(object); - } - else { - // float 64 - this.writeU8(0xcb); - this.writeF64(object); - } - } - }; - Encoder.prototype.writeStringHeader = function (byteLength) { - if (byteLength < 32) { - // fixstr - this.writeU8(0xa0 + byteLength); - } - else if (byteLength < 0x100) { - // str 8 - this.writeU8(0xd9); - this.writeU8(byteLength); - } - else if (byteLength < 0x10000) { - // str 16 - this.writeU8(0xda); - this.writeU16(byteLength); - } - else if (byteLength < 0x100000000) { - // str 32 - this.writeU8(0xdb); - this.writeU32(byteLength); - } - else { - throw new Error("Too long string: " + byteLength + " bytes in UTF-8"); - } - }; - Encoder.prototype.encodeString = function (object) { - var maxHeaderSize = 1 + 4; - var strLength = object.length; - if (strLength > TEXT_ENCODER_THRESHOLD) { - var byteLength = utf8Count(object); - this.ensureBufferSizeToWrite(maxHeaderSize + byteLength); - this.writeStringHeader(byteLength); - utf8EncodeTE(object, this.bytes, this.pos); - this.pos += byteLength; - } - else { - var byteLength = utf8Count(object); - this.ensureBufferSizeToWrite(maxHeaderSize + byteLength); - this.writeStringHeader(byteLength); - utf8EncodeJs(object, this.bytes, this.pos); - this.pos += byteLength; - } - }; - Encoder.prototype.encodeObject = function (object, depth) { - // try to encode objects with custom codec first of non-primitives - var ext = this.extensionCodec.tryToEncode(object, this.context); - if (ext != null) { - this.encodeExtension(ext); - } - else if (Array.isArray(object)) { - this.encodeArray(object, depth); - } - else if (ArrayBuffer.isView(object)) { - this.encodeBinary(object); - } - else if (typeof object === "object") { - this.encodeMap(object, depth); - } - else { - // symbol, function and other special object come here unless extensionCodec handles them. - throw new Error("Unrecognized object: " + Object.prototype.toString.apply(object)); - } - }; - Encoder.prototype.encodeBinary = function (object) { - var size = object.byteLength; - if (size < 0x100) { - // bin 8 - this.writeU8(0xc4); - this.writeU8(size); - } - else if (size < 0x10000) { - // bin 16 - this.writeU8(0xc5); - this.writeU16(size); - } - else if (size < 0x100000000) { - // bin 32 - this.writeU8(0xc6); - this.writeU32(size); - } - else { - throw new Error("Too large binary: " + size); - } - var bytes = ensureUint8Array(object); - this.writeU8a(bytes); - }; - Encoder.prototype.encodeArray = function (object, depth) { - var size = object.length; - if (size < 16) { - // fixarray - this.writeU8(0x90 + size); - } - else if (size < 0x10000) { - // array 16 - this.writeU8(0xdc); - this.writeU16(size); - } - else if (size < 0x100000000) { - // array 32 - this.writeU8(0xdd); - this.writeU32(size); - } - else { - throw new Error("Too large array: " + size); - } - for (var _i = 0, object_1 = object; _i < object_1.length; _i++) { - var item = object_1[_i]; - this.doEncode(item, depth + 1); - } - }; - Encoder.prototype.countWithoutUndefined = function (object, keys) { - var count = 0; - for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { - var key = keys_1[_i]; - if (object[key] !== undefined) { - count++; - } - } - return count; - }; - Encoder.prototype.encodeMap = function (object, depth) { - var keys = Object.keys(object); - if (this.sortKeys) { - keys.sort(); - } - var size = this.ignoreUndefined ? this.countWithoutUndefined(object, keys) : keys.length; - if (size < 16) { - // fixmap - this.writeU8(0x80 + size); - } - else if (size < 0x10000) { - // map 16 - this.writeU8(0xde); - this.writeU16(size); - } - else if (size < 0x100000000) { - // map 32 - this.writeU8(0xdf); - this.writeU32(size); - } - else { - throw new Error("Too large map object: " + size); - } - for (var _i = 0, keys_2 = keys; _i < keys_2.length; _i++) { - var key = keys_2[_i]; - var value = object[key]; - if (!(this.ignoreUndefined && value === undefined)) { - this.encodeString(key); - this.doEncode(value, depth + 1); - } - } - }; - Encoder.prototype.encodeExtension = function (ext) { - var size = ext.data.length; - if (size === 1) { - // fixext 1 - this.writeU8(0xd4); - } - else if (size === 2) { - // fixext 2 - this.writeU8(0xd5); - } - else if (size === 4) { - // fixext 4 - this.writeU8(0xd6); - } - else if (size === 8) { - // fixext 8 - this.writeU8(0xd7); - } - else if (size === 16) { - // fixext 16 - this.writeU8(0xd8); - } - else if (size < 0x100) { - // ext 8 - this.writeU8(0xc7); - this.writeU8(size); - } - else if (size < 0x10000) { - // ext 16 - this.writeU8(0xc8); - this.writeU16(size); - } - else if (size < 0x100000000) { - // ext 32 - this.writeU8(0xc9); - this.writeU32(size); - } - else { - throw new Error("Too large extension object: " + size); - } - this.writeI8(ext.type); - this.writeU8a(ext.data); - }; - Encoder.prototype.writeU8 = function (value) { - this.ensureBufferSizeToWrite(1); - this.view.setUint8(this.pos, value); - this.pos++; - }; - Encoder.prototype.writeU8a = function (values) { - var size = values.length; - this.ensureBufferSizeToWrite(size); - this.bytes.set(values, this.pos); - this.pos += size; - }; - Encoder.prototype.writeI8 = function (value) { - this.ensureBufferSizeToWrite(1); - this.view.setInt8(this.pos, value); - this.pos++; - }; - Encoder.prototype.writeU16 = function (value) { - this.ensureBufferSizeToWrite(2); - this.view.setUint16(this.pos, value); - this.pos += 2; - }; - Encoder.prototype.writeI16 = function (value) { - this.ensureBufferSizeToWrite(2); - this.view.setInt16(this.pos, value); - this.pos += 2; - }; - Encoder.prototype.writeU32 = function (value) { - this.ensureBufferSizeToWrite(4); - this.view.setUint32(this.pos, value); - this.pos += 4; - }; - Encoder.prototype.writeI32 = function (value) { - this.ensureBufferSizeToWrite(4); - this.view.setInt32(this.pos, value); - this.pos += 4; - }; - Encoder.prototype.writeF32 = function (value) { - this.ensureBufferSizeToWrite(4); - this.view.setFloat32(this.pos, value); - this.pos += 4; - }; - Encoder.prototype.writeF64 = function (value) { - this.ensureBufferSizeToWrite(8); - this.view.setFloat64(this.pos, value); - this.pos += 8; - }; - Encoder.prototype.writeU64 = function (value) { - this.ensureBufferSizeToWrite(8); - setUint64(this.view, this.pos, value); - this.pos += 8; - }; - Encoder.prototype.writeI64 = function (value) { - this.ensureBufferSizeToWrite(8); - setInt64(this.view, this.pos, value); - this.pos += 8; - }; - return Encoder; - }()); - - var defaultEncodeOptions = {}; - /** - * It encodes `value` in the MessagePack format and - * returns a byte buffer. - * - * The returned buffer is a slice of a larger `ArrayBuffer`, so you have to use its `#byteOffset` and `#byteLength` in order to convert it to another typed arrays including NodeJS `Buffer`. - */ - function encode(value, options) { - if (options === void 0) { options = defaultEncodeOptions; } - var encoder = new Encoder(options.extensionCodec, options.context, options.maxDepth, options.initialBufferSize, options.sortKeys, options.forceFloat32, options.ignoreUndefined, options.forceIntegerToFloat); - return encoder.encode(value); - } - - /*! ***************************************************************************** - Copyright (c) Microsoft Corporation. - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. - ***************************************************************************** */ - /* global Reflect, Promise */ - - var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - - function __extends(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - } - - function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - } - - function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - } - - function __values(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - } - - function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - } - - function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - } - - function __asyncValues(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - } - - function prettyByte(byte) { - return (byte < 0 ? "-" : "") + "0x" + Math.abs(byte).toString(16).padStart(2, "0"); - } - - var DEFAULT_MAX_KEY_LENGTH = 16; - var DEFAULT_MAX_LENGTH_PER_KEY = 16; - var CachedKeyDecoder = /** @class */ (function () { - function CachedKeyDecoder(maxKeyLength, maxLengthPerKey) { - if (maxKeyLength === void 0) { maxKeyLength = DEFAULT_MAX_KEY_LENGTH; } - if (maxLengthPerKey === void 0) { maxLengthPerKey = DEFAULT_MAX_LENGTH_PER_KEY; } - this.maxKeyLength = maxKeyLength; - this.maxLengthPerKey = maxLengthPerKey; - this.hit = 0; - this.miss = 0; - // avoid `new Array(N)` to create a non-sparse array for performance. - this.caches = []; - for (var i = 0; i < this.maxKeyLength; i++) { - this.caches.push([]); - } - } - CachedKeyDecoder.prototype.canBeCached = function (byteLength) { - return byteLength > 0 && byteLength <= this.maxKeyLength; - }; - CachedKeyDecoder.prototype.get = function (bytes, inputOffset, byteLength) { - var records = this.caches[byteLength - 1]; - FIND_CHUNK: for (var _i = 0, records_1 = records; _i < records_1.length; _i++) { - var record = records_1[_i]; - var recordBytes = record.bytes; - for (var j = 0; j < byteLength; j++) { - if (recordBytes[j] !== bytes[inputOffset + j]) { - continue FIND_CHUNK; - } - } - return record.value; - } - return null; - }; - CachedKeyDecoder.prototype.store = function (bytes, value) { - var records = this.caches[bytes.length - 1]; - var record = { bytes: bytes, value: value }; - if (records.length >= this.maxLengthPerKey) { - // `records` are full! - // Set `record` to a randomized position. - records[(Math.random() * records.length) | 0] = record; - } - else { - records.push(record); - } - }; - CachedKeyDecoder.prototype.decode = function (bytes, inputOffset, byteLength) { - var cachedValue = this.get(bytes, inputOffset, byteLength); - if (cachedValue != null) { - this.hit++; - return cachedValue; - } - this.miss++; - var value = utf8DecodeJs(bytes, inputOffset, byteLength); - // Ensure to copy a slice of bytes because the byte may be NodeJS Buffer and Buffer#slice() returns a reference to its internal ArrayBuffer. - var slicedCopyOfBytes = Uint8Array.prototype.slice.call(bytes, inputOffset, inputOffset + byteLength); - this.store(slicedCopyOfBytes, value); - return value; - }; - return CachedKeyDecoder; - }()); - - var isValidMapKeyType = function (key) { - var keyType = typeof key; - return keyType === "string" || keyType === "number"; - }; - var HEAD_BYTE_REQUIRED = -1; - var EMPTY_VIEW = new DataView(new ArrayBuffer(0)); - var EMPTY_BYTES = new Uint8Array(EMPTY_VIEW.buffer); - // IE11: Hack to support IE11. - // IE11: Drop this hack and just use RangeError when IE11 is obsolete. - var DataViewIndexOutOfBoundsError = (function () { - try { - // IE11: The spec says it should throw RangeError, - // IE11: but in IE11 it throws TypeError. - EMPTY_VIEW.getInt8(0); - } - catch (e) { - return e.constructor; - } - throw new Error("never reached"); - })(); - var MORE_DATA = new DataViewIndexOutOfBoundsError("Insufficient data"); - var DEFAULT_MAX_LENGTH = 4294967295; // uint32_max - var sharedCachedKeyDecoder = new CachedKeyDecoder(); - var DecodeError = /** @class */ (function (_super) { - __extends(DecodeError, _super); - function DecodeError(message) { - var _this = _super.call(this, message) || this; - // fix the prototype chain in a cross-platform way - var proto = Object.create(DecodeError.prototype); - Object.setPrototypeOf(_this, proto); - Object.defineProperty(_this, "name", { - configurable: true, - enumerable: false, - value: DecodeError.name, - }); - return _this; - } - return DecodeError; - }(Error)); - var Decoder = /** @class */ (function () { - function Decoder(extensionCodec, context, maxStrLength, maxBinLength, maxArrayLength, maxMapLength, maxExtLength, keyDecoder) { - if (extensionCodec === void 0) { extensionCodec = ExtensionCodec.defaultCodec; } - if (context === void 0) { context = undefined; } - if (maxStrLength === void 0) { maxStrLength = DEFAULT_MAX_LENGTH; } - if (maxBinLength === void 0) { maxBinLength = DEFAULT_MAX_LENGTH; } - if (maxArrayLength === void 0) { maxArrayLength = DEFAULT_MAX_LENGTH; } - if (maxMapLength === void 0) { maxMapLength = DEFAULT_MAX_LENGTH; } - if (maxExtLength === void 0) { maxExtLength = DEFAULT_MAX_LENGTH; } - if (keyDecoder === void 0) { keyDecoder = sharedCachedKeyDecoder; } - this.extensionCodec = extensionCodec; - this.context = context; - this.maxStrLength = maxStrLength; - this.maxBinLength = maxBinLength; - this.maxArrayLength = maxArrayLength; - this.maxMapLength = maxMapLength; - this.maxExtLength = maxExtLength; - this.keyDecoder = keyDecoder; - this.totalPos = 0; - this.pos = 0; - this.view = EMPTY_VIEW; - this.bytes = EMPTY_BYTES; - this.headByte = HEAD_BYTE_REQUIRED; - this.stack = []; - } - Decoder.prototype.reinitializeState = function () { - this.totalPos = 0; - this.headByte = HEAD_BYTE_REQUIRED; - }; - Decoder.prototype.setBuffer = function (buffer) { - this.bytes = ensureUint8Array(buffer); - this.view = createDataView(this.bytes); - this.pos = 0; - }; - Decoder.prototype.appendBuffer = function (buffer) { - if (this.headByte === HEAD_BYTE_REQUIRED && !this.hasRemaining()) { - this.setBuffer(buffer); - } - else { - // retried because data is insufficient - var remainingData = this.bytes.subarray(this.pos); - var newData = ensureUint8Array(buffer); - var concated = new Uint8Array(remainingData.length + newData.length); - concated.set(remainingData); - concated.set(newData, remainingData.length); - this.setBuffer(concated); - } - }; - Decoder.prototype.hasRemaining = function (size) { - if (size === void 0) { size = 1; } - return this.view.byteLength - this.pos >= size; - }; - Decoder.prototype.createExtraByteError = function (posToShow) { - var _a = this, view = _a.view, pos = _a.pos; - return new RangeError("Extra " + (view.byteLength - pos) + " of " + view.byteLength + " byte(s) found at buffer[" + posToShow + "]"); - }; - Decoder.prototype.decode = function (buffer) { - this.reinitializeState(); - this.setBuffer(buffer); - var object = this.doDecodeSync(); - if (this.hasRemaining()) { - throw this.createExtraByteError(this.pos); - } - return object; - }; - Decoder.prototype.decodeMulti = function (buffer) { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - this.reinitializeState(); - this.setBuffer(buffer); - _a.label = 1; - case 1: - if (!this.hasRemaining()) return [3 /*break*/, 3]; - return [4 /*yield*/, this.doDecodeSync()]; - case 2: - _a.sent(); - return [3 /*break*/, 1]; - case 3: return [2 /*return*/]; - } - }); - }; - Decoder.prototype.decodeAsync = function (stream) { - var stream_1, stream_1_1; - var e_1, _a; - return __awaiter(this, void 0, void 0, function () { - var decoded, object, buffer, e_1_1, _b, headByte, pos, totalPos; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - decoded = false; - _c.label = 1; - case 1: - _c.trys.push([1, 6, 7, 12]); - stream_1 = __asyncValues(stream); - _c.label = 2; - case 2: return [4 /*yield*/, stream_1.next()]; - case 3: - if (!(stream_1_1 = _c.sent(), !stream_1_1.done)) return [3 /*break*/, 5]; - buffer = stream_1_1.value; - if (decoded) { - throw this.createExtraByteError(this.totalPos); - } - this.appendBuffer(buffer); - try { - object = this.doDecodeSync(); - decoded = true; - } - catch (e) { - if (!(e instanceof DataViewIndexOutOfBoundsError)) { - throw e; // rethrow - } - // fallthrough - } - this.totalPos += this.pos; - _c.label = 4; - case 4: return [3 /*break*/, 2]; - case 5: return [3 /*break*/, 12]; - case 6: - e_1_1 = _c.sent(); - e_1 = { error: e_1_1 }; - return [3 /*break*/, 12]; - case 7: - _c.trys.push([7, , 10, 11]); - if (!(stream_1_1 && !stream_1_1.done && (_a = stream_1.return))) return [3 /*break*/, 9]; - return [4 /*yield*/, _a.call(stream_1)]; - case 8: - _c.sent(); - _c.label = 9; - case 9: return [3 /*break*/, 11]; - case 10: - if (e_1) throw e_1.error; - return [7 /*endfinally*/]; - case 11: return [7 /*endfinally*/]; - case 12: - if (decoded) { - if (this.hasRemaining()) { - throw this.createExtraByteError(this.totalPos); - } - return [2 /*return*/, object]; - } - _b = this, headByte = _b.headByte, pos = _b.pos, totalPos = _b.totalPos; - throw new RangeError("Insufficient data in parsing " + prettyByte(headByte) + " at " + totalPos + " (" + pos + " in the current buffer)"); - } - }); - }); - }; - Decoder.prototype.decodeArrayStream = function (stream) { - return this.decodeMultiAsync(stream, true); - }; - Decoder.prototype.decodeStream = function (stream) { - return this.decodeMultiAsync(stream, false); - }; - Decoder.prototype.decodeMultiAsync = function (stream, isArray) { - return __asyncGenerator(this, arguments, function decodeMultiAsync_1() { - var isArrayHeaderRequired, arrayItemsLeft, stream_2, stream_2_1, buffer, e_2, e_3_1; - var e_3, _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - isArrayHeaderRequired = isArray; - arrayItemsLeft = -1; - _b.label = 1; - case 1: - _b.trys.push([1, 13, 14, 19]); - stream_2 = __asyncValues(stream); - _b.label = 2; - case 2: return [4 /*yield*/, __await(stream_2.next())]; - case 3: - if (!(stream_2_1 = _b.sent(), !stream_2_1.done)) return [3 /*break*/, 12]; - buffer = stream_2_1.value; - if (isArray && arrayItemsLeft === 0) { - throw this.createExtraByteError(this.totalPos); - } - this.appendBuffer(buffer); - if (isArrayHeaderRequired) { - arrayItemsLeft = this.readArraySize(); - isArrayHeaderRequired = false; - this.complete(); - } - _b.label = 4; - case 4: - _b.trys.push([4, 9, , 10]); - _b.label = 5; - case 5: - return [4 /*yield*/, __await(this.doDecodeSync())]; - case 6: return [4 /*yield*/, _b.sent()]; - case 7: - _b.sent(); - if (--arrayItemsLeft === 0) { - return [3 /*break*/, 8]; - } - return [3 /*break*/, 5]; - case 8: return [3 /*break*/, 10]; - case 9: - e_2 = _b.sent(); - if (!(e_2 instanceof DataViewIndexOutOfBoundsError)) { - throw e_2; // rethrow - } - return [3 /*break*/, 10]; - case 10: - this.totalPos += this.pos; - _b.label = 11; - case 11: return [3 /*break*/, 2]; - case 12: return [3 /*break*/, 19]; - case 13: - e_3_1 = _b.sent(); - e_3 = { error: e_3_1 }; - return [3 /*break*/, 19]; - case 14: - _b.trys.push([14, , 17, 18]); - if (!(stream_2_1 && !stream_2_1.done && (_a = stream_2.return))) return [3 /*break*/, 16]; - return [4 /*yield*/, __await(_a.call(stream_2))]; - case 15: - _b.sent(); - _b.label = 16; - case 16: return [3 /*break*/, 18]; - case 17: - if (e_3) throw e_3.error; - return [7 /*endfinally*/]; - case 18: return [7 /*endfinally*/]; - case 19: return [2 /*return*/]; - } - }); - }); - }; - Decoder.prototype.doDecodeSync = function () { - DECODE: while (true) { - var headByte = this.readHeadByte(); - var object = void 0; - if (headByte >= 0xe0) { - // negative fixint (111x xxxx) 0xe0 - 0xff - object = headByte - 0x100; - } - else if (headByte < 0xc0) { - if (headByte < 0x80) { - // positive fixint (0xxx xxxx) 0x00 - 0x7f - object = headByte; - } - else if (headByte < 0x90) { - // fixmap (1000 xxxx) 0x80 - 0x8f - var size = headByte - 0x80; - if (size !== 0) { - this.pushMapState(size); - this.complete(); - continue DECODE; - } - else { - object = {}; - } - } - else if (headByte < 0xa0) { - // fixarray (1001 xxxx) 0x90 - 0x9f - var size = headByte - 0x90; - if (size !== 0) { - this.pushArrayState(size); - this.complete(); - continue DECODE; - } - else { - object = []; - } - } - else { - // fixstr (101x xxxx) 0xa0 - 0xbf - var byteLength = headByte - 0xa0; - object = this.decodeUtf8String(byteLength, 0); - } - } - else if (headByte === 0xc0) { - // nil - object = null; - } - else if (headByte === 0xc2) { - // false - object = false; - } - else if (headByte === 0xc3) { - // true - object = true; - } - else if (headByte === 0xca) { - // float 32 - object = this.readF32(); - } - else if (headByte === 0xcb) { - // float 64 - object = this.readF64(); - } - else if (headByte === 0xcc) { - // uint 8 - object = this.readU8(); - } - else if (headByte === 0xcd) { - // uint 16 - object = this.readU16(); - } - else if (headByte === 0xce) { - // uint 32 - object = this.readU32(); - } - else if (headByte === 0xcf) { - // uint 64 - object = this.readU64(); - } - else if (headByte === 0xd0) { - // int 8 - object = this.readI8(); - } - else if (headByte === 0xd1) { - // int 16 - object = this.readI16(); - } - else if (headByte === 0xd2) { - // int 32 - object = this.readI32(); - } - else if (headByte === 0xd3) { - // int 64 - object = this.readI64(); - } - else if (headByte === 0xd9) { - // str 8 - var byteLength = this.lookU8(); - object = this.decodeUtf8String(byteLength, 1); - } - else if (headByte === 0xda) { - // str 16 - var byteLength = this.lookU16(); - object = this.decodeUtf8String(byteLength, 2); - } - else if (headByte === 0xdb) { - // str 32 - var byteLength = this.lookU32(); - object = this.decodeUtf8String(byteLength, 4); - } - else if (headByte === 0xdc) { - // array 16 - var size = this.readU16(); - if (size !== 0) { - this.pushArrayState(size); - this.complete(); - continue DECODE; - } - else { - object = []; - } - } - else if (headByte === 0xdd) { - // array 32 - var size = this.readU32(); - if (size !== 0) { - this.pushArrayState(size); - this.complete(); - continue DECODE; - } - else { - object = []; - } - } - else if (headByte === 0xde) { - // map 16 - var size = this.readU16(); - if (size !== 0) { - this.pushMapState(size); - this.complete(); - continue DECODE; - } - else { - object = {}; - } - } - else if (headByte === 0xdf) { - // map 32 - var size = this.readU32(); - if (size !== 0) { - this.pushMapState(size); - this.complete(); - continue DECODE; - } - else { - object = {}; - } - } - else if (headByte === 0xc4) { - // bin 8 - var size = this.lookU8(); - object = this.decodeBinary(size, 1); - } - else if (headByte === 0xc5) { - // bin 16 - var size = this.lookU16(); - object = this.decodeBinary(size, 2); - } - else if (headByte === 0xc6) { - // bin 32 - var size = this.lookU32(); - object = this.decodeBinary(size, 4); - } - else if (headByte === 0xd4) { - // fixext 1 - object = this.decodeExtension(1, 0); - } - else if (headByte === 0xd5) { - // fixext 2 - object = this.decodeExtension(2, 0); - } - else if (headByte === 0xd6) { - // fixext 4 - object = this.decodeExtension(4, 0); - } - else if (headByte === 0xd7) { - // fixext 8 - object = this.decodeExtension(8, 0); - } - else if (headByte === 0xd8) { - // fixext 16 - object = this.decodeExtension(16, 0); - } - else if (headByte === 0xc7) { - // ext 8 - var size = this.lookU8(); - object = this.decodeExtension(size, 1); - } - else if (headByte === 0xc8) { - // ext 16 - var size = this.lookU16(); - object = this.decodeExtension(size, 2); - } - else if (headByte === 0xc9) { - // ext 32 - var size = this.lookU32(); - object = this.decodeExtension(size, 4); - } - else { - throw new DecodeError("Unrecognized type byte: " + prettyByte(headByte)); - } - this.complete(); - var stack = this.stack; - while (stack.length > 0) { - // arrays and maps - var state = stack[stack.length - 1]; - if (state.type === 0 /* ARRAY */) { - state.array[state.position] = object; - state.position++; - if (state.position === state.size) { - stack.pop(); - object = state.array; - } - else { - continue DECODE; - } - } - else if (state.type === 1 /* MAP_KEY */) { - if (!isValidMapKeyType(object)) { - throw new DecodeError("The type of key must be string or number but " + typeof object); - } - if (object === "__proto__") { - throw new DecodeError("The key __proto__ is not allowed"); - } - state.key = object; - state.type = 2 /* MAP_VALUE */; - continue DECODE; - } - else { - // it must be `state.type === State.MAP_VALUE` here - state.map[state.key] = object; - state.readCount++; - if (state.readCount === state.size) { - stack.pop(); - object = state.map; - } - else { - state.key = null; - state.type = 1 /* MAP_KEY */; - continue DECODE; - } - } - } - return object; - } - }; - Decoder.prototype.readHeadByte = function () { - if (this.headByte === HEAD_BYTE_REQUIRED) { - this.headByte = this.readU8(); - // console.log("headByte", prettyByte(this.headByte)); - } - return this.headByte; - }; - Decoder.prototype.complete = function () { - this.headByte = HEAD_BYTE_REQUIRED; - }; - Decoder.prototype.readArraySize = function () { - var headByte = this.readHeadByte(); - switch (headByte) { - case 0xdc: - return this.readU16(); - case 0xdd: - return this.readU32(); - default: { - if (headByte < 0xa0) { - return headByte - 0x90; - } - else { - throw new DecodeError("Unrecognized array type byte: " + prettyByte(headByte)); - } - } - } - }; - Decoder.prototype.pushMapState = function (size) { - if (size > this.maxMapLength) { - throw new DecodeError("Max length exceeded: map length (" + size + ") > maxMapLengthLength (" + this.maxMapLength + ")"); - } - this.stack.push({ - type: 1 /* MAP_KEY */, - size: size, - key: null, - readCount: 0, - map: {}, - }); - }; - Decoder.prototype.pushArrayState = function (size) { - if (size > this.maxArrayLength) { - throw new DecodeError("Max length exceeded: array length (" + size + ") > maxArrayLength (" + this.maxArrayLength + ")"); - } - this.stack.push({ - type: 0 /* ARRAY */, - size: size, - array: new Array(size), - position: 0, - }); - }; - Decoder.prototype.decodeUtf8String = function (byteLength, headerOffset) { - var _a; - if (byteLength > this.maxStrLength) { - throw new DecodeError("Max length exceeded: UTF-8 byte length (" + byteLength + ") > maxStrLength (" + this.maxStrLength + ")"); - } - if (this.bytes.byteLength < this.pos + headerOffset + byteLength) { - throw MORE_DATA; - } - var offset = this.pos + headerOffset; - var object; - if (this.stateIsMapKey() && ((_a = this.keyDecoder) === null || _a === void 0 ? void 0 : _a.canBeCached(byteLength))) { - object = this.keyDecoder.decode(this.bytes, offset, byteLength); - } - else if (byteLength > TEXT_DECODER_THRESHOLD) { - object = utf8DecodeTD(this.bytes, offset, byteLength); - } - else { - object = utf8DecodeJs(this.bytes, offset, byteLength); - } - this.pos += headerOffset + byteLength; - return object; - }; - Decoder.prototype.stateIsMapKey = function () { - if (this.stack.length > 0) { - var state = this.stack[this.stack.length - 1]; - return state.type === 1 /* MAP_KEY */; - } - return false; - }; - Decoder.prototype.decodeBinary = function (byteLength, headOffset) { - if (byteLength > this.maxBinLength) { - throw new DecodeError("Max length exceeded: bin length (" + byteLength + ") > maxBinLength (" + this.maxBinLength + ")"); - } - if (!this.hasRemaining(byteLength + headOffset)) { - throw MORE_DATA; - } - var offset = this.pos + headOffset; - var object = this.bytes.subarray(offset, offset + byteLength); - this.pos += headOffset + byteLength; - return object; - }; - Decoder.prototype.decodeExtension = function (size, headOffset) { - if (size > this.maxExtLength) { - throw new DecodeError("Max length exceeded: ext length (" + size + ") > maxExtLength (" + this.maxExtLength + ")"); - } - var extType = this.view.getInt8(this.pos + headOffset); - var data = this.decodeBinary(size, headOffset + 1 /* extType */); - return this.extensionCodec.decode(data, extType, this.context); - }; - Decoder.prototype.lookU8 = function () { - return this.view.getUint8(this.pos); - }; - Decoder.prototype.lookU16 = function () { - return this.view.getUint16(this.pos); - }; - Decoder.prototype.lookU32 = function () { - return this.view.getUint32(this.pos); - }; - Decoder.prototype.readU8 = function () { - var value = this.view.getUint8(this.pos); - this.pos++; - return value; - }; - Decoder.prototype.readI8 = function () { - var value = this.view.getInt8(this.pos); - this.pos++; - return value; - }; - Decoder.prototype.readU16 = function () { - var value = this.view.getUint16(this.pos); - this.pos += 2; - return value; - }; - Decoder.prototype.readI16 = function () { - var value = this.view.getInt16(this.pos); - this.pos += 2; - return value; - }; - Decoder.prototype.readU32 = function () { - var value = this.view.getUint32(this.pos); - this.pos += 4; - return value; - }; - Decoder.prototype.readI32 = function () { - var value = this.view.getInt32(this.pos); - this.pos += 4; - return value; - }; - Decoder.prototype.readU64 = function () { - var value = getUint64(this.view, this.pos); - this.pos += 8; - return value; - }; - Decoder.prototype.readI64 = function () { - var value = getInt64(this.view, this.pos); - this.pos += 8; - return value; - }; - Decoder.prototype.readF32 = function () { - var value = this.view.getFloat32(this.pos); - this.pos += 4; - return value; - }; - Decoder.prototype.readF64 = function () { - var value = this.view.getFloat64(this.pos); - this.pos += 8; - return value; - }; - return Decoder; - }()); - - var defaultDecodeOptions = {}; - /** - * It decodes a single MessagePack object in a buffer. - * - * This is a synchronous decoding function. - * See other variants for asynchronous decoding: {@link decodeAsync()}, {@link decodeStream()}, or {@link decodeArrayStream()}. - */ - function decode(buffer, options) { - if (options === void 0) { options = defaultDecodeOptions; } - var decoder = new Decoder(options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength); - return decoder.decode(buffer); - } - /** - * It decodes multiple MessagePack objects in a buffer. - * This is corresponding to {@link decodeMultiStream()}. - */ - function decodeMulti(buffer, options) { - if (options === void 0) { options = defaultDecodeOptions; } - var decoder = new Decoder(options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength); - return decoder.decodeMulti(buffer); - } - - // utility for whatwg streams - function isAsyncIterable(object) { - return object[Symbol.asyncIterator] != null; - } - function assertNonNull(value) { - if (value == null) { - throw new Error("Assertion Failure: value must not be null nor undefined"); - } - } - function asyncIterableFromStream(stream) { - return __asyncGenerator(this, arguments, function asyncIterableFromStream_1() { - var reader, _a, done, value; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - reader = stream.getReader(); - _b.label = 1; - case 1: - _b.trys.push([1, , 9, 10]); - _b.label = 2; - case 2: - return [4 /*yield*/, __await(reader.read())]; - case 3: - _a = _b.sent(), done = _a.done, value = _a.value; - if (!done) return [3 /*break*/, 5]; - return [4 /*yield*/, __await(void 0)]; - case 4: return [2 /*return*/, _b.sent()]; - case 5: - assertNonNull(value); - return [4 /*yield*/, __await(value)]; - case 6: return [4 /*yield*/, _b.sent()]; - case 7: - _b.sent(); - return [3 /*break*/, 2]; - case 8: return [3 /*break*/, 10]; - case 9: - reader.releaseLock(); - return [7 /*endfinally*/]; - case 10: return [2 /*return*/]; - } - }); - }); - } - function ensureAsyncIterable(streamLike) { - if (isAsyncIterable(streamLike)) { - return streamLike; - } - else { - return asyncIterableFromStream(streamLike); - } - } - - function decodeAsync(streamLike, options) { - if (options === void 0) { options = defaultDecodeOptions; } - return __awaiter(this, void 0, void 0, function () { - var stream, decoder; - return __generator(this, function (_a) { - stream = ensureAsyncIterable(streamLike); - decoder = new Decoder(options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength); - return [2 /*return*/, decoder.decodeAsync(stream)]; - }); - }); - } - function decodeArrayStream(streamLike, options) { - if (options === void 0) { options = defaultDecodeOptions; } - var stream = ensureAsyncIterable(streamLike); - var decoder = new Decoder(options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength); - return decoder.decodeArrayStream(stream); - } - function decodeMultiStream(streamLike, options) { - if (options === void 0) { options = defaultDecodeOptions; } - var stream = ensureAsyncIterable(streamLike); - var decoder = new Decoder(options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength); - return decoder.decodeStream(stream); - } - /** - * @deprecated Use {@link decodeMultiStream()} instead. - */ - function decodeStream(streamLike, options) { - if (options === void 0) { options = defaultDecodeOptions; } - return decodeMultiStream(streamLike, options); - } - - // Main Functions: - - var dist_es5_esm = /*#__PURE__*/Object.freeze({ - __proto__: null, - encode: encode, - decode: decode, - decodeMulti: decodeMulti, - decodeAsync: decodeAsync, - decodeArrayStream: decodeArrayStream, - decodeMultiStream: decodeMultiStream, - decodeStream: decodeStream, - Decoder: Decoder, - DecodeError: DecodeError, - Encoder: Encoder, - ExtensionCodec: ExtensionCodec, - ExtData: ExtData, - EXT_TIMESTAMP: EXT_TIMESTAMP, - encodeDateToTimeSpec: encodeDateToTimeSpec, - encodeTimeSpecToTimestamp: encodeTimeSpecToTimestamp, - decodeTimestampToTimeSpec: decodeTimestampToTimeSpec, - encodeTimestampExtension: encodeTimestampExtension, - decodeTimestampExtension: decodeTimestampExtension - }); - - var require$$0 = /*@__PURE__*/getAugmentedNamespace(dist_es5_esm); - - var client = createCommonjsModule(function (module, exports) { - var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault = (commonjsGlobal && commonjsGlobal.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar = (commonjsGlobal && commonjsGlobal.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.WsClient = void 0; - const isomorphic_ws_1 = __importDefault(browser); - const msgpack = __importStar(require$$0); - /** - * A Websocket client which can make requests and receive responses, - * as well as send and receive signals - * - * Uses Holochain's websocket WireMessage for communication. - */ - class WsClient { - constructor(socket, signalCb) { - this.socket = socket; - this.pendingRequests = {}; - this.index = 0; - // TODO: allow adding signal handlers later - this.alreadyWarnedNoSignalCb = false; - socket.onmessage = (encodedMsg) => __awaiter(this, void 0, void 0, function* () { - let data = encodedMsg.data; - // If data is not a buffer (nodejs), it will be a blob (browser) - if (typeof Buffer === "undefined" || !Buffer.isBuffer(data)) { - data = yield data.arrayBuffer(); - } - const msg = msgpack.decode(data); - if (msg.type === "Signal") { - if (signalCb) { - const decodedMessage = msgpack.decode(msg.data); - // Note: holochain currently returns signals as an array of two values: cellId and the serialized signal payload - // and this array is nested within the App key within the returned message. - const decodedCellId = decodedMessage.App[0]; - // Note:In order to return readible content to the UI, the signal payload must also be decoded. - const decodedPayload = signalTransform(decodedMessage.App[1]); - // Return a uniform format to UI (ie: { type, data } - the same format as with callZome and appInfo...) - const signal = { - type: msg.type, - data: { cellId: decodedCellId, payload: decodedPayload }, - }; - signalCb(signal); - } - else { - if (!this.alreadyWarnedNoSignalCb) - console.log(`Received signal but no signal callback was set in constructor`); - this.alreadyWarnedNoSignalCb = true; - } - } - else if (msg.type === "Response") { - this.handleResponse(msg); - } - else { - console.error(`Got unrecognized Websocket message type: ${msg.type}`); - } - }); - } - emitSignal(data) { - const encodedMsg = msgpack.encode({ - type: "Signal", - data: msgpack.encode(data), - }); - this.socket.send(encodedMsg); - } - request(data) { - let id = this.index; - this.index += 1; - const encodedMsg = msgpack.encode({ - id, - type: "Request", - data: msgpack.encode(data), - }); - const promise = new Promise((fulfill, reject) => { - this.pendingRequests[id] = { fulfill, reject }; - }); - if (this.socket.readyState === this.socket.OPEN) { - this.socket.send(encodedMsg); - } - else { - return Promise.reject(new Error(`Socket is not open`)); - } - return promise; - } - handleResponse(msg) { - const id = msg.id; - if (this.pendingRequests[id]) { - // resolve response - if (msg.data === null || msg.data === undefined) { - this.pendingRequests[id].reject(new Error(`Response canceled by responder`)); - } - else { - this.pendingRequests[id].fulfill(msgpack.decode(msg.data)); - } - } - else { - console.error(`Got response with no matching request. id=${id}`); - } - } - close() { - this.socket.close(); - return this.awaitClose(); - } - awaitClose() { - return new Promise((resolve) => this.socket.on("close", resolve)); - } - static connect(url, signalCb) { - return new Promise((resolve, reject) => { - const socket = new isomorphic_ws_1.default(url); - // make sure that there are no uncaught connection - // errors because that causes nodejs thread to crash - // with uncaught exception - socket.onerror = (e) => { - reject(new Error(`could not connect to holochain conductor, please check that a conductor service is running and available at ${url}`)); - }; - socket.onopen = () => { - resolve(new WsClient(socket, signalCb)); - }; - }); - } - } - exports.WsClient = WsClient; - const signalTransform = (res) => { - return msgpack.decode(res); - }; - //# sourceMappingURL=client.js.map - }); - - var common$1 = createCommonjsModule(function (module, exports) { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.promiseTimeout = exports.catchError = exports.DEFAULT_TIMEOUT = void 0; - const ERROR_TYPE = 'error'; - exports.DEFAULT_TIMEOUT = 15000; - exports.catchError = (res) => { - return res.type === ERROR_TYPE - ? Promise.reject(res) - : Promise.resolve(res); - }; - exports.promiseTimeout = (promise, tag, ms) => { - let id; - let timeout = new Promise((resolve, reject) => { - id = setTimeout(() => { - clearTimeout(id); - reject(new Error(`Timed out in ${ms}ms: ${tag}`)); - }, ms); - }); - return new Promise((res, rej) => { - Promise.race([ - promise, - timeout - ]).then((a) => { - clearTimeout(id); - return res(a); - }) - .catch(e => { - return rej(e); - }); - }); - }; - //# sourceMappingURL=common.js.map - }); - - var common = createCommonjsModule(function (module, exports) { - var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.requesterTransformer = void 0; - /** - * Take a Requester function which deals with tagged requests and responses, - * and return a Requester which deals only with the inner data types, also - * with the optional Transformer applied to further modify the input and output. - */ - exports.requesterTransformer = (requester, tag, transform = identityTransformer) => ((req, timeout) => __awaiter(void 0, void 0, void 0, function* () { - const input = { type: tag, data: transform.input(req) }; - const response = yield requester(input, timeout); - const output = transform.output(response.data); - return output; - })); - const identity = x => x; - const identityTransformer = { - input: identity, - output: identity, - }; - //# sourceMappingURL=common.js.map - }); - - var admin = createCommonjsModule(function (module, exports) { - /** - * Defines AdminWebsocket, an easy-to-use websocket implementation of the - * Conductor Admin API - * - * const client = AdminWebsocket.connect( - * 'ws://localhost:9000' - * ) - * - * client.generateAgentPubKey() - * .then(agentPubKey => { - * console.log('Agent successfully generated:', agentPubKey) - * }) - * .catch(err => { - * console.error('problem generating agent:', err) - * }) - */ - var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.AdminWebsocket = void 0; - - - - class AdminWebsocket { - constructor(client, defaultTimeout) { - this._requester = (tag, transformer) => common.requesterTransformer((req, timeout) => common$1.promiseTimeout(this.client.request(req), tag, timeout || this.defaultTimeout).then(common$1.catchError), tag, transformer); - // the specific request/response types come from the Interface - // which this class implements - this.activateApp = this._requester('activate_app'); - this.attachAppInterface = this._requester('attach_app_interface'); - this.deactivateApp = this._requester('deactivate_app'); - this.dumpState = this._requester('dump_state', dumpStateTransform); - this.generateAgentPubKey = this._requester('generate_agent_pub_key'); - this.registerDna = this._requester('register_dna'); - this.installApp = this._requester('install_app'); - this.installAppBundle = this._requester('install_app_bundle'); - this.createCloneCell = this._requester('create_clone_cell'); - this.listDnas = this._requester('list_dnas'); - this.listCellIds = this._requester('list_cell_ids'); - this.listActiveApps = this._requester('list_active_apps'); - this.requestAgentInfo = this._requester('request_agent_info'); - this.addAgentInfo = this._requester('add_agent_info'); - this.client = client; - this.defaultTimeout = defaultTimeout === undefined ? common$1.DEFAULT_TIMEOUT : defaultTimeout; - } - static connect(url, defaultTimeout) { - return __awaiter(this, void 0, void 0, function* () { - const wsClient = yield client.WsClient.connect(url); - return new AdminWebsocket(wsClient, defaultTimeout); - }); - } - } - exports.AdminWebsocket = AdminWebsocket; - const dumpStateTransform = { - input: (req) => req, - output: (res) => { - return JSON.parse(res); - } - }; - //# sourceMappingURL=admin.js.map - }); - - var app$1 = createCommonjsModule(function (module, exports) { - var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault = (commonjsGlobal && commonjsGlobal.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar = (commonjsGlobal && commonjsGlobal.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.AppWebsocket = void 0; - /** - * Defines AppWebsocket, an easy-to-use websocket implementation of the - * Conductor API for apps - * - * const client = AppWebsocket.connect( - * 'ws://localhost:9000', - * signal => console.log('got a signal:', signal) - * ) - * - * client.callZome({...}) // TODO: show what's in here - * .then(() => { - * console.log('DNA successfully installed') - * }) - * .catch(err => { - * console.error('problem installing DNA:', err) - * }) - */ - const msgpack = __importStar(require$$0); - - - - class AppWebsocket { - constructor(client, defaultTimeout) { - this._requester = (tag, transformer) => common.requesterTransformer((req, timeout) => common$1.promiseTimeout(this.client.request(req), tag, timeout || this.defaultTimeout).then(common$1.catchError), tag, transformer); - this.appInfo = this._requester('app_info'); - this.callZome = this._requester('zome_call_invocation', callZomeTransform); - this.client = client; - this.defaultTimeout = defaultTimeout === undefined ? common$1.DEFAULT_TIMEOUT : defaultTimeout; - } - static connect(url, defaultTimeout, signalCb) { - return __awaiter(this, void 0, void 0, function* () { - const wsClient = yield client.WsClient.connect(url, signalCb); - return new AppWebsocket(wsClient, defaultTimeout); - }); - } - } - exports.AppWebsocket = AppWebsocket; - const callZomeTransform = { - input: (req) => { - req.payload = msgpack.encode(req.payload); - return req; - }, - output: (res) => { - return msgpack.decode(res); - } - }; - //# sourceMappingURL=app.js.map - }); - - var lib = createCommonjsModule(function (module, exports) { - var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - })); - var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); - }; - Object.defineProperty(exports, "__esModule", { value: true }); - __exportStar(admin$1, exports); - __exportStar(app$2, exports); - __exportStar(types, exports); - __exportStar(admin, exports); - __exportStar(app$1, exports); - //# sourceMappingURL=index.js.map - }); - - /** - * Object.assign - */ - const assign = Object.assign; - - const pending_symbol = Symbol('pending'); - /** - * Returns a function to ensure that an member key is defined on a ctx object, - * otherwise it creates the value using the _val factory function. - */ - function _be(key, _val) { - return (ctx, opts) => { - if (!ctx.hasOwnProperty(key) || (opts === null || opts === void 0 ? void 0 : opts.force)) { - let pending = ctx[pending_symbol]; - if (!pending) { - pending = {}; - assign(ctx, { [pending_symbol]: pending }); - } - if (pending[key]) { - console.trace(`_be: key '${key.toString()}' has a circular dependency`); - throw `_be: key '${key.toString()}' has a circular dependency`; - } - pending[key] = true; - const val = _val(ctx, key, opts); - if (!ctx.hasOwnProperty(key)) { - if (val === undefined) - throw `_be: ${String(key)}: function must return a non-undefined value or directly set the ctx with the property ${String(key)}`; - assign(ctx, { [key]: val }); - } - delete pending[key]; - } - return ctx[key]; - }; - } - - /** - * Object keys - */ - Object.keys.bind(Object); - - const native_isArray = Array.isArray; - /** - * Is the argument an Array? - */ - function isArray(obj) { - return native_isArray ? native_isArray(obj) : toString.call(obj) === '[object Array]'; - } - - /** - * Object values - * @function values - */ - Object.values.bind(Object); - - function _tuple(...data) { - return data; - } - - const subscriber_queue = []; - /** - * Creates a `Readable` store that allows reading by subscription. - * @param value initial value - * @param {StartStopNotifier}start start and stop notifications for subscriptions - */ - function readable(value, start) { - return { - subscribe: writable(value, start).subscribe - }; - } - /** - * Create a `Writable` store that allows both updating and reading by subscription. - * @param {*=}value initial value - * @param {StartStopNotifier=}start start and stop notifications for subscriptions - */ - function writable(value, start = noop) { - let stop; - const subscribers = []; - function set(new_value) { - if (safe_not_equal(value, new_value)) { - value = new_value; - if (stop) { // store is ready - const run_queue = !subscriber_queue.length; - for (let i = 0; i < subscribers.length; i += 1) { - const s = subscribers[i]; - s[1](); - subscriber_queue.push(s, value); - } - if (run_queue) { - for (let i = 0; i < subscriber_queue.length; i += 2) { - subscriber_queue[i][0](subscriber_queue[i + 1]); - } - subscriber_queue.length = 0; - } - } - } - } - function update(fn) { - set(fn(value)); - } - function subscribe(run, invalidate = noop) { - const subscriber = [run, invalidate]; - subscribers.push(subscriber); - if (subscribers.length === 1) { - stop = start(set) || noop; - } - run(value); - return () => { - const index = subscribers.indexOf(subscriber); - if (index !== -1) { - subscribers.splice(index, 1); - } - if (subscribers.length === 0) { - stop(); - stop = null; - } - }; - } - return { set, update, subscribe }; - } - function derived$1(stores, fn, initial_value) { - const single = !Array.isArray(stores); - const stores_array = single - ? [stores] - : stores; - const auto = fn.length < 2; - return readable(initial_value, (set) => { - let inited = false; - const values = []; - let pending = 0; - let cleanup = noop; - const sync = () => { - if (pending) { - return; - } - cleanup(); - const result = fn(single ? values[0] : values, set); - if (auto) { - set(result); - } - else { - cleanup = is_function(result) ? result : noop; - } - }; - const unsubscribers = stores_array.map((store, i) => subscribe(store, (value) => { - values[i] = value; - pending &= ~(1 << i); - if (inited) { - sync(); - } - }, () => { - pending |= (1 << i); - })); - inited = true; - sync(); - return function stop() { - run_all(unsubscribers); - cleanup(); - }; - }); - } - - function get(store) { - return get_store_value(store); - } - - function derived(stores, in_fn, initial_value) { - return (in_fn.length === 1 - ? derived$1(stores, ((values) => { - return in_fn((isArray(values) ? _tuple(...values) : values)); - })) - : derived$1(stores, ((values, set) => { - return in_fn((isArray(values) ? _tuple(...values) : values), set); - }), initial_value)); - } - - const content_b = _be('content', () => { - return writable({ title: '', body: '' }); - }); - - const committedChanges_b = _be('committedChanges', () => { - return writable([]); - }); - - const recordedChanges_b = _be('recordedChanges', () => { - return writable([]); - }); - - const nextIndex_b = _be('nextIndex', (ctx) => { - const recordedChanges = recordedChanges_b(ctx); - return derived(recordedChanges, c => c.length); - }); - - const requestedChanges_b = _be('requestedChanges', () => { - return writable([]); - }); - - const bufferToBase64 = buffer => { - if (typeof window !== 'undefined') { - // browser - let binary = ''; - const bytes = new Uint8Array(buffer); - const len = bytes.byteLength; - for (let i = 0; i < len; i++) { - binary += String.fromCharCode(bytes[i]); - } - return window.btoa(binary); - } - else { - // nodejs - return buffer.toString('base64'); - } - }; - const base64ToBuffer = base64 => { - if (!base64) - return; - if (typeof window !== 'undefined') { - return Uint8Array.from(window.atob(base64), c => c.charCodeAt(0)); - } - else { - return Buffer.from(base64, 'base64'); - } - }; - function decodeJson(jsonStr) { - return JSON.parse(jsonStr, function (key, value) { - // the receiver function looks for the typed array flag - try { - if (key == 'pubKey') { - return base64ToBuffer(value); - } - } - catch (e) { - console.log('decodeJson Error:', e); - } - // if flag not found no conversion is done - return value; - }); - } - function encodeJson(obj) { - return JSON.stringify(obj, function (key, value) { - if (key == 'pubKey') { - if (typeof window !== 'undefined') { - return bufferToBase64(value); // In the browser it's the actual array - } - else { - return bufferToBase64(Buffer.from(value.data)); // In node it's an object - } - } - return value; - }); - } - - // retruns binary input as hex number string (e.g. 'a293b8e1a') - function arrayBufferToHex(buffer) { - let hexString = ''; - for (const byte of buffer) { - hexString += byte.toString(16); - } - return hexString; - } - // converts RGB to HSL - // Source: https://gist.github.com/mjackson/5311256 - function rgbToHsl(r, g, b) { - r /= 255, g /= 255, b /= 255; - let max = Math.max(r, g, b), min = Math.min(r, g, b); - let h, s, l = (max + min) / 2; - if (max == min) { - h = s = 0; - } - else { - let d = max - min; - s = l > 0.5 ? d / (2 - max - min) : d / (max + min); - switch (max) { - case r: - h = (g - b) / d + (g < b ? 6 : 0); - break; - case g: - h = (b - r) / d + 2; - break; - case b: - h = (r - g) / d + 4; - break; - } - h /= 6; - } - return [h * 360, s * 100, l * 100]; - } - // Source: https://stackoverflow.com/questions/5842747 - function clamp(value, min, max) { - return Math.min(Math.max(value, min), max); - } - // Generate an object of colors for a folk from their pubKey - // returns Object: - // primary: Color, // used for hex outline and norrmal cursor - // hexagon: Color, // used for hexagon picture placeholder - // selection: Color, // used for normal selection - // lookingSelection: Color, // used for selection when "looking at" - // lookingCursor: Color, // used for cursor when "looking at" - // where Color is array: [h, s, l] - // used in `use:setColor` on new Folk components - function getFolkColors(pubKey) { - // get a hex color from the folk's public key - const hexColor = '#' + arrayBufferToHex(pubKey).slice(-6); - // extract the RGB components from the hex color notation. - // Source: https://stackoverflow.com/questions/3732046 - const r = parseInt(hexColor.substr(1, 2), 16); // Grab the hex representation of red (chars 1-2) and convert to decimal (base 10). - const g = parseInt(hexColor.substr(3, 2), 16); - const b = parseInt(hexColor.substr(5, 2), 16); - // convert to HSL - let hsl = rgbToHsl(r, g, b); - // limit color to be bright enough and not too bright - hsl[1] = clamp(hsl[1], 10, 90); // limit s - const [h, s] = hsl; // destructure - return { - primary: [h, s, 50], - hexagon: [h, s, 25], - selection: [h, s, 90], - lookingSelection: [h, s, 80], - lookingCursor: [h, s + 10, 40], - }; - } - function CSSifyHSL(hslArray) { - const [h, s, l] = hslArray; - return `hsl(${h} ${s}% ${l}%)`; - } - - const folks_b = _be('folk', () => { - return writable({}); - }); - - const scribeStr_b = _be('scribeStr', () => { - return writable(''); - }); - - /* src/folk/Folk.svelte generated by Svelte v3.37.0 */ - const file$8 = "src/folk/Folk.svelte"; - - // (88:0) {#if $connection && $connection.syn} - function create_if_block$4(ctx) { - let if_block_anchor; - - function select_block_type(ctx, dirty) { - if (/*scribe*/ ctx[2]) return create_if_block_1$2; - return create_else_block$3; - } - - let current_block_type = select_block_type(ctx); - let if_block = current_block_type(ctx); - - const block = { - c: function create() { - if_block.c(); - if_block_anchor = empty(); - }, - m: function mount(target, anchor) { - if_block.m(target, anchor); - insert_dev(target, if_block_anchor, anchor); - }, - p: function update(ctx, dirty) { - if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) { - if_block.p(ctx, dirty); - } else { - if_block.d(1); - if_block = current_block_type(ctx); - - if (if_block) { - if_block.c(); - if_block.m(if_block_anchor.parentNode, if_block_anchor); - } - } - }, - d: function destroy(detaching) { - if_block.d(detaching); - if (detaching) detach_dev(if_block_anchor); - } - }; - - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block$4.name, - type: "if", - source: "(88:0) {#if $connection && $connection.syn}", - ctx - }); - - return block; - } - - // (97:2) {:else} - function create_else_block$3(ctx) { - let div1; - let div0; - let t0; - let t1_value = /*pubKeyStr*/ ctx[0].slice(-4) + ""; - let t1; - let mounted; - let dispose; - - const block = { - c: function create() { - div1 = element("div"); - div0 = element("div"); - t0 = space(); - t1 = text(t1_value); - attr_dev(div0, "class", "folk-color svelte-6nts23"); - add_location(div0, file$8, 98, 6, 3226); - attr_dev(div1, "class", "folk svelte-6nts23"); - toggle_class(div1, "me", /*me*/ ctx[1]); - toggle_class(div1, "out-of-session", /*outOfSession*/ ctx[3]); - add_location(div1, file$8, 97, 4, 3143); - }, - m: function mount(target, anchor) { - insert_dev(target, div1, anchor); - append_dev(div1, div0); - append_dev(div1, t0); - append_dev(div1, t1); - - if (!mounted) { - dispose = action_destroyer(/*setUpHex*/ ctx[8].call(null, div1)); - mounted = true; - } - }, - p: function update(ctx, dirty) { - if (dirty & /*pubKeyStr*/ 1 && t1_value !== (t1_value = /*pubKeyStr*/ ctx[0].slice(-4) + "")) set_data_dev(t1, t1_value); - - if (dirty & /*me*/ 2) { - toggle_class(div1, "me", /*me*/ ctx[1]); - } - - if (dirty & /*outOfSession*/ 8) { - toggle_class(div1, "out-of-session", /*outOfSession*/ ctx[3]); - } - }, - d: function destroy(detaching) { - if (detaching) detach_dev(div1); - mounted = false; - dispose(); - } - }; - - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_else_block$3.name, - type: "else", - source: "(97:2) {:else}", - ctx - }); - - return block; - } - - // (89:2) {#if scribe} - function create_if_block_1$2(ctx) { - let div3; - let div1; - let div0; - let t0; - let t1_value = /*pubKeyStr*/ ctx[0].slice(-4) + ""; - let t1; - let t2; - let div2; - let mounted; - let dispose; - - const block = { - c: function create() { - div3 = element("div"); - div1 = element("div"); - div0 = element("div"); - t0 = space(); - t1 = text(t1_value); - t2 = space(); - div2 = element("div"); - attr_dev(div0, "class", "folk-color svelte-6nts23"); - add_location(div0, file$8, 91, 8, 3006); - attr_dev(div1, "class", "folk scribe svelte-6nts23"); - toggle_class(div1, "me", /*me*/ ctx[1]); - toggle_class(div1, "out-of-session", /*outOfSession*/ ctx[3]); - add_location(div1, file$8, 90, 6, 2914); - attr_dev(div2, "class", "scribe-halo svelte-6nts23"); - add_location(div2, file$8, 94, 6, 3086); - attr_dev(div3, "class", "scribe-wrapper svelte-6nts23"); - add_location(div3, file$8, 89, 4, 2879); - }, - m: function mount(target, anchor) { - insert_dev(target, div3, anchor); - append_dev(div3, div1); - append_dev(div1, div0); - append_dev(div1, t0); - append_dev(div1, t1); - append_dev(div3, t2); - append_dev(div3, div2); - - if (!mounted) { - dispose = action_destroyer(/*setUpHex*/ ctx[8].call(null, div1)); - mounted = true; - } - }, - p: function update(ctx, dirty) { - if (dirty & /*pubKeyStr*/ 1 && t1_value !== (t1_value = /*pubKeyStr*/ ctx[0].slice(-4) + "")) set_data_dev(t1, t1_value); - - if (dirty & /*me*/ 2) { - toggle_class(div1, "me", /*me*/ ctx[1]); - } - - if (dirty & /*outOfSession*/ 8) { - toggle_class(div1, "out-of-session", /*outOfSession*/ ctx[3]); - } - }, - d: function destroy(detaching) { - if (detaching) detach_dev(div3); - mounted = false; - dispose(); - } - }; - - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_1$2.name, - type: "if", - source: "(89:2) {#if scribe}", - ctx - }); - - return block; - } - - function create_fragment$8(ctx) { - let if_block_anchor; - let if_block = /*$connection*/ ctx[4] && /*$connection*/ ctx[4].syn && create_if_block$4(ctx); - - const block = { - c: function create() { - if (if_block) if_block.c(); - if_block_anchor = empty(); - }, - l: function claim(nodes) { - throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); - }, - m: function mount(target, anchor) { - if (if_block) if_block.m(target, anchor); - insert_dev(target, if_block_anchor, anchor); - }, - p: function update(ctx, [dirty]) { - if (/*$connection*/ ctx[4] && /*$connection*/ ctx[4].syn) { - if (if_block) { - if_block.p(ctx, dirty); - } else { - if_block = create_if_block$4(ctx); - if_block.c(); - if_block.m(if_block_anchor.parentNode, if_block_anchor); - } - } else if (if_block) { - if_block.d(1); - if_block = null; - } - }, - i: noop, - o: noop, - d: function destroy(detaching) { - if (if_block) if_block.d(detaching); - if (detaching) detach_dev(if_block_anchor); - } - }; - - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_fragment$8.name, - type: "component", - source: "", - ctx - }); - - return block; - } - - function instance$8($$self, $$props, $$invalidate) { - let $scribeStr; - let $folks; - let $connection; - let { $$slots: slots = {}, $$scope } = $$props; - validate_slots("Folk", slots, []); - const ctx = getContext("ctx"); - const connection = connection_b(ctx); - validate_store(connection, "connection"); - component_subscribe($$self, connection, value => $$invalidate(4, $connection = value)); - const folks = folks_b(ctx); - validate_store(folks, "folks"); - component_subscribe($$self, folks, value => $$invalidate(10, $folks = value)); - const scribeStr = scribeStr_b(ctx); - validate_store(scribeStr, "scribeStr"); - component_subscribe($$self, scribeStr, value => $$invalidate(9, $scribeStr = value)); - let { pubKeyStr = "" } = $$props; - let { me = false } = $$props; - let scribe; - let outOfSession; - - function setUpHex(hexEl) { - let colors; - - if (me) { - colors = $connection.syn.myColors; - } else { - colors = $folks[pubKeyStr].colors; - } - - hexEl.style["background-color"] = CSSifyHSL(colors.primary); - - // hex element's first child is its picture/hexagonColor div - hexEl.firstChild.style["background-color"] = CSSifyHSL(colors.hexagon); - } - - const writable_props = ["pubKeyStr", "me"]; - - Object.keys($$props).forEach(key => { - if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<Folk> was created with unknown prop '${key}'`); - }); - - $$self.$$set = $$props => { - if ("pubKeyStr" in $$props) $$invalidate(0, pubKeyStr = $$props.pubKeyStr); - if ("me" in $$props) $$invalidate(1, me = $$props.me); - }; - - $$self.$capture_state = () => ({ - getContext, - connection_b, - folks_b, - CSSifyHSL, - scribeStr_b, - ctx, - connection, - folks, - scribeStr, - pubKeyStr, - me, - scribe, - outOfSession, - setUpHex, - $scribeStr, - $folks, - $connection - }); - - $$self.$inject_state = $$props => { - if ("pubKeyStr" in $$props) $$invalidate(0, pubKeyStr = $$props.pubKeyStr); - if ("me" in $$props) $$invalidate(1, me = $$props.me); - if ("scribe" in $$props) $$invalidate(2, scribe = $$props.scribe); - if ("outOfSession" in $$props) $$invalidate(3, outOfSession = $$props.outOfSession); - }; - - if ($$props && "$$inject" in $$props) { - $$self.$inject_state($$props.$$inject); - } - - $$self.$$.update = () => { - if ($$self.$$.dirty & /*pubKeyStr, $scribeStr*/ 513) { - $$invalidate(2, scribe = pubKeyStr == $scribeStr); - } - - if ($$self.$$.dirty & /*$folks, pubKeyStr, me*/ 1027) { - $$invalidate(3, outOfSession = (!$folks[pubKeyStr] || !$folks[pubKeyStr].inSession) && !me); - } - }; - - return [ - pubKeyStr, - me, - scribe, - outOfSession, - $connection, - connection, - folks, - scribeStr, - setUpHex, - $scribeStr, - $folks - ]; - } - - class Folk extends SvelteComponentDev { - constructor(options) { - super(options); - init(this, options, instance$8, create_fragment$8, safe_not_equal, { pubKeyStr: 0, me: 1 }); - - dispatch_dev("SvelteRegisterComponent", { - component: this, - tagName: "Folk", - options, - id: create_fragment$8.name - }); - } - - get pubKeyStr() { - throw new Error("<Folk>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"); - } - - set pubKeyStr(value) { - throw new Error("<Folk>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"); - } - - get me() { - throw new Error("<Folk>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"); - } - - set me(value) { - throw new Error("<Folk>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"); - } - } - - /* src/folk/Folks.svelte generated by Svelte v3.37.0 */ - - const { Object: Object_1$1 } = globals; - const file$7 = "src/folk/Folks.svelte"; - - function get_each_context$2(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[5] = list[i]; - return child_ctx; - } - - // (21:2) {#if $connection && $connection.syn && $connection.syn.me} - function create_if_block$3(ctx) { - let folk; - let current; - - folk = new Folk({ - props: { - me: true, - pubKeyStr: /*$connection*/ ctx[0].syn.me - }, - $$inline: true - }); - - const block = { - c: function create() { - create_component(folk.$$.fragment); - }, - m: function mount(target, anchor) { - mount_component(folk, target, anchor); - current = true; - }, - p: function update(ctx, dirty) { - const folk_changes = {}; - if (dirty & /*$connection*/ 1) folk_changes.pubKeyStr = /*$connection*/ ctx[0].syn.me; - folk.$set(folk_changes); - }, - i: function intro(local) { - if (current) return; - transition_in(folk.$$.fragment, local); - current = true; - }, - o: function outro(local) { - transition_out(folk.$$.fragment, local); - current = false; - }, - d: function destroy(detaching) { - destroy_component(folk, detaching); - } - }; - - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block$3.name, - type: "if", - source: "(21:2) {#if $connection && $connection.syn && $connection.syn.me}", - ctx - }); - - return block; - } - - // (24:2) {#each Object.keys($folks) as p} - function create_each_block$2(ctx) { - let folk; - let current; - - folk = new Folk({ - props: { pubKeyStr: /*p*/ ctx[5] }, - $$inline: true - }); - - const block = { - c: function create() { - create_component(folk.$$.fragment); - }, - m: function mount(target, anchor) { - mount_component(folk, target, anchor); - current = true; - }, - p: function update(ctx, dirty) { - const folk_changes = {}; - if (dirty & /*$folks*/ 2) folk_changes.pubKeyStr = /*p*/ ctx[5]; - folk.$set(folk_changes); - }, - i: function intro(local) { - if (current) return; - transition_in(folk.$$.fragment, local); - current = true; - }, - o: function outro(local) { - transition_out(folk.$$.fragment, local); - current = false; - }, - d: function destroy(detaching) { - destroy_component(folk, detaching); - } - }; - - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_each_block$2.name, - type: "each", - source: "(24:2) {#each Object.keys($folks) as p}", - ctx - }); - - return block; - } - - function create_fragment$7(ctx) { - let div; - let t; - let current; - let if_block = /*$connection*/ ctx[0] && /*$connection*/ ctx[0].syn && /*$connection*/ ctx[0].syn.me && create_if_block$3(ctx); - let each_value = Object.keys(/*$folks*/ ctx[1]); - validate_each_argument(each_value); - let each_blocks = []; - - for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block$2(get_each_context$2(ctx, each_value, i)); - } - - const out = i => transition_out(each_blocks[i], 1, 1, () => { - each_blocks[i] = null; - }); - - const block = { - c: function create() { - div = element("div"); - if (if_block) if_block.c(); - t = space(); - - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - - attr_dev(div, "class", "folks svelte-ekfsic"); - add_location(div, file$7, 19, 0, 528); - }, - l: function claim(nodes) { - throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); - }, - m: function mount(target, anchor) { - insert_dev(target, div, anchor); - if (if_block) if_block.m(div, null); - append_dev(div, t); - - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].m(div, null); - } - - current = true; - }, - p: function update(ctx, [dirty]) { - if (/*$connection*/ ctx[0] && /*$connection*/ ctx[0].syn && /*$connection*/ ctx[0].syn.me) { - if (if_block) { - if_block.p(ctx, dirty); - - if (dirty & /*$connection*/ 1) { - transition_in(if_block, 1); - } - } else { - if_block = create_if_block$3(ctx); - if_block.c(); - transition_in(if_block, 1); - if_block.m(div, t); - } - } else if (if_block) { - group_outros(); - - transition_out(if_block, 1, 1, () => { - if_block = null; - }); - - check_outros(); - } - - if (dirty & /*Object, $folks*/ 2) { - each_value = Object.keys(/*$folks*/ ctx[1]); - validate_each_argument(each_value); - let i; - - for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context$2(ctx, each_value, i); - - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - transition_in(each_blocks[i], 1); - } else { - each_blocks[i] = create_each_block$2(child_ctx); - each_blocks[i].c(); - transition_in(each_blocks[i], 1); - each_blocks[i].m(div, null); - } - } - - group_outros(); - - for (i = each_value.length; i < each_blocks.length; i += 1) { - out(i); - } - - check_outros(); - } - }, - i: function intro(local) { - if (current) return; - transition_in(if_block); - - for (let i = 0; i < each_value.length; i += 1) { - transition_in(each_blocks[i]); - } - - current = true; - }, - o: function outro(local) { - transition_out(if_block); - each_blocks = each_blocks.filter(Boolean); - - for (let i = 0; i < each_blocks.length; i += 1) { - transition_out(each_blocks[i]); - } - - current = false; - }, - d: function destroy(detaching) { - if (detaching) detach_dev(div); - if (if_block) if_block.d(); - destroy_each(each_blocks, detaching); - } - }; - - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_fragment$7.name, - type: "component", - source: "", - ctx - }); - - return block; - } - - function instance$7($$self, $$props, $$invalidate) { - let $connection; - let $folks; - let { $$slots: slots = {}, $$scope } = $$props; - validate_slots("Folks", slots, []); - const ctx = getContext("ctx"); - const folks = folks_b(ctx); - validate_store(folks, "folks"); - component_subscribe($$self, folks, value => $$invalidate(1, $folks = value)); - const connection = connection_b(ctx); - validate_store(connection, "connection"); - component_subscribe($$self, connection, value => $$invalidate(0, $connection = value)); - const writable_props = []; - - Object_1$1.keys($$props).forEach(key => { - if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<Folks> was created with unknown prop '${key}'`); - }); - - $$self.$capture_state = () => ({ - connection_b, - folks_b, - Folk, - getContext, - ctx, - folks, - connection, - $connection, - $folks - }); - - return [$connection, $folks, folks, connection]; - } - - class Folks extends SvelteComponentDev { - constructor(options) { - super(options); - init(this, options, instance$7, create_fragment$7, safe_not_equal, {}); - - dispatch_dev("SvelteRegisterComponent", { - component: this, - tagName: "Folks", - options, - id: create_fragment$7.name - }); - } - } - - var FolkStatus; - (function (FolkStatus) { - FolkStatus[FolkStatus["FOLK_SEEN"] = 1] = "FOLK_SEEN"; - FolkStatus[FolkStatus["FOLK_GONE"] = 2] = "FOLK_GONE"; - FolkStatus[FolkStatus["FOLK_UNKNOWN"] = 3] = "FOLK_UNKNOWN"; - })(FolkStatus || (FolkStatus = {})); - const FOLK_SEEN = FolkStatus.FOLK_SEEN; - const FOLK_GONE = FolkStatus.FOLK_GONE; - const FOLK_UNKNOWN = FolkStatus.FOLK_UNKNOWN; - - // const outOfSessionTimout = 30 * 1000 - const outOfSessionTimout = 8 * 1000; // testing code :) - // const heartbeatInterval = 15 * 1000 // 15 seconds - const heartbeatInterval = 30 * 1000; // for testing ;) - let reqTimeout = 1000; - class Session { - constructor(ctx, syn, sessionInfo) { - this.ctx = ctx; - this.sessionInfo = sessionInfo; - // set up the svelte based state vars - this.content = content_b(this.ctx); - this.recordedChanges = recordedChanges_b(this.ctx); - this.requestedChanges = requestedChanges_b(this.ctx); - this.committedChanges = committedChanges_b(this.ctx); - this.scribeStr = scribeStr_b(this.ctx); - this.zome = syn.zome; - this.applyDeltaFn = syn.applyDeltaFn; - this.me = syn.zome.me; - this.myTag = syn.zome.me.slice(-4); - const others = {}; - this.others = others; - this.folks = folks_b(ctx); - this.folks.set(others); - this.initState(this.sessionInfo); - this.initTimers(syn); - console.log('session joined:', this.sessionInfo); - } - initTimers(syn) { - const self = this; - // Send heartbeat to scribe every [heartbeat interval] - this.heart = setInterval(async () => { - if (self._scribeStr == self.me) { - // examine folks last seen time and see if any have crossed the session out-of-session - // timeout so we can tell everybody else about them having dropped. - let gone = self.updateRecentlyTimedOutFolks(); - if (gone.length > 0) { - self.sendFolkLore(self.folksForScribeSignals(), { gone }); - } - } - else { - // I'm not the scribe so send them a heartbeat - await self.sendHeartbeat('Hello'); - } - }, heartbeatInterval); - this.requestChecker = setInterval(async () => { - if (self.requested.length > 0) { - if ((Date.now() - self.requested[0].at) > reqTimeout) { - // for now let's just do the most drastic thing! - /* - console.log('requested change timed out! Undoing all changes', $requestedChanges[0]) - // TODO: make sure this is transactional and no requestChanges squeak in ! - while ($requestedChanges.length > 0) { - requestedChanges.update(changes => { - const change = changes.pop() - console.log('undoing ', change) - const undoDelta = undoFn(change) - console.log('undoDelta: ', undoDelta) - applyDeltaFn(undoDelta) - return changes - }) - }*/ - // and send a sync request incase something just got out of sequence - // TODO: prepare for shifting to new scribe if they went offline - this.initState(await syn.getSession(self.sessionHash)); - console.log('HERE'); - syn.sendSyncReq(); - } - } - }, reqTimeout / 2); - } - initState(sessionInfo) { - this.sessionHash = sessionInfo.session; - this.scribe = sessionInfo.scribe; - this.snapshot_content = sessionInfo.snapshot_content; - this.snapshot_hash = sessionInfo.snapshot_hash; - this.content_hash = sessionInfo.content_hash; - this.deltas = sessionInfo.deltas.map(d => JSON.parse(d)); - this.snapshotHashStr = bufferToBase64(sessionInfo.snapshot_hash); - this.contentHashStr = bufferToBase64(sessionInfo.content_hash); - this._scribeStr = bufferToBase64(sessionInfo.scribe); - this.scribeStr.set(this._scribeStr); - this.recorded = []; - this.requested = []; - this.requestedChanges.set(this.requested); - this.recordedChanges.set(this.recorded); - this.committedChanges.set([]); - this.reqCounter = 0; - this.committed = []; - let newContent = Object.assign({}, sessionInfo.snapshot_content); // clone so as not to pass by ref - newContent.meta = {}; - newContent.meta[this.myTag] = 0; - for (const delta of this.deltas) { - const [c, change] = this.applyDeltaFn(newContent, delta); - newContent = c; - this.committed.push(change); - } - this.committedChanges.set(this.committed); - this._content = newContent; - this.content.set(this._content); - } - _recordDelta(delta) { - // apply the deltas to the content which returns the undoable change - const undoableChange = this._runApplyDelta(delta); - // append changes to the recorded history - this.recorded.push(undoableChange); - this.recordedChanges.set(this.recorded); - } - _recordDeltas(deltas) { - // apply the deltas to the content which returns the undoable change - for (const delta of deltas) { - this._recordDelta(delta); - } - } - // apply changes confirmed as recorded by the scribe while reconciling - // and possibly rebasing our requested changes - recordDeltas(_index, deltas) { - console.log('recordDeltas REQUESTED', this.requested); - for (const delta of deltas) { - if (this.requested.length > 0) { - // if this change is our next requested change then remove it - if (JSON.stringify(delta) == JSON.stringify(this.requested[0].delta)) { - this.recorded.push(this.requested.shift()); - this.recordedChanges.set(this.recorded); - this.requestedChanges.set(this.requested); - } - else { - // TODO rebase? - console.log('REBASE NEEDED?'); - console.log('requested ', this.requested[0].delta); - console.log('to be recorded ', delta); - } - } - else { - // no requested changes so this must be from someone else so we don't have - // to check our requested changes - // TODO: do we need to check if this is a change that we did send and have already - // integrated somehow and ignore if so. (Seems unlikely?) - this._recordDelta(delta); - } - } - } - nextIndex() { - return this.recorded.length; - } - _runApplyDelta(delta) { - const [newContent, undoableChange] = this.applyDeltaFn(this._content, delta); - this._content = newContent; - this.content.set(this._content); - return undoableChange; - } - // called when requesting a change to the content as a result of user action - // If we are the scribe, no need to go into the zome - // TODO: prevent reentry - requestChange(deltas) { - // any requested made by the scribe should be recorded immediately - if (this._scribeStr == this.me) { - const index = this.nextIndex(); - this._recordDeltas(deltas); - this.sendChange(index, deltas); - } - else { - // otherwise apply the change and queue it to requested changes for - // confirmation later and send request change to scribe - // create a unique id for each change - // TODO: this should be part of actual changeReqs - const changeId = this.myTag + '.' + this.reqCounter; - const changeAt = Date.now(); - // we want to apply this to current nextIndex plus any previously - // requested changes that haven't yet be recorded - const index = this.nextIndex() + this.requested.length; - for (const delta of deltas) { - const undoableChange = this._runApplyDelta(delta); - undoableChange.id = changeId; - undoableChange.at = changeAt; - // append changes to the requested queue - this.requested.push(undoableChange); - this.requestedChanges.set(this.requested); - } - console.log('REQUESTED', this.requested); - this.sendChangeReq(index, deltas); - this.reqCounter += 1; - } - } - addChangeAsScribe(change) { - let [index, deltas] = change; - const nextIndex = this.nextIndex(); - if (nextIndex != index) { - console.log('Scribe is receiving change out of order!'); - console.log(`nextIndex: ${nextIndex}, changeIndex:${index} for deltas:`, deltas); - if (index < nextIndex) { - // change is too late, nextIndex has moved on - // TODO: rebase? notify sender? - return; - } - else { - // change is in the future, possibly some other change was dropped or is slow in arriving - // TODO: wait a bit? Ask sender for other changes? - return; - } - } - this.recordDeltas(index, deltas); - // notify all participants of the change - this.sendChange(index, deltas); - } - async commitChange() { - if (this._scribeStr == this.me) { - if (this.recorded.length == 0) { - alert('No changes to commit!'); - return; - } - this.commitInProgress = true; - const newContentHash = await this.hashContent(this._content); - console.log('commiting from snapshot', this.snapshotHashStr); - console.log(' prev_hash:', this.contentHashStr); - console.log(' new_hash:', bufferToBase64(newContentHash)); - const commit = { - snapshot: this.snapshot_hash, - change: { - deltas: this.recorded.map(c => JSON.stringify(c.delta)), - content_hash: newContentHash, - previous_change: this.content_hash, - meta: { - contributors: [], - witnesses: [], - app_specific: null - } - }, - participants: this.folksForScribeSignals() - }; - try { - this.currentCommitHeaderHash = await this.zome.call('commit', commit); - // if commit successfull we need to update the content hash and its string in the session - this.content_hash = newContentHash; - this.contentHashStr = bufferToBase64(this.content_hash); - this.committed = this.committed.concat(this.recorded); - this.recorded = []; - this.recordedChanges.set(this.recorded); - this.committedChanges.set(this.committed); - } - catch (e) { - console.log('Error:', e); - } - this.commitInProgress = false; - } - else { - alert('You ain\'t the scribe!'); - } - } - // Folks -------------------------------------------------------- - _newOther(pubKeyStr, pubKey) { - if (!(pubKeyStr in this.others)) { - const colors = getFolkColors(pubKey); - this.others[pubKeyStr] = { pubKey, colors }; - } - } - updateOthers(pubKey, status, meta) { - const pubKeyStr = bufferToBase64(pubKey); - if (pubKeyStr == this.me) { - return; - } - // if we don't have this key, create a record for it - // including the default color - this._newOther(pubKeyStr, pubKey); - if (meta) { - this.others[pubKeyStr]['meta'] = meta; - } - switch (status) { - case FOLK_SEEN: - this.others[pubKeyStr]['inSession'] = true; - this.others[pubKeyStr]['lastSeen'] = Date.now(); - break; - case FOLK_GONE: - case FOLK_UNKNOWN: - this.others[pubKeyStr]['inSession'] = false; - } - this.folks.set(this.others); - } - folksForScribeSignals() { - return Object.values(this.others).filter(v => v.inSession).map(v => v.pubKey); - } - // updates folks in-session status by checking their last-seen time - updateRecentlyTimedOutFolks() { - let result = []; - for (const [pubKeyStr, folk] of Object.entries(this.others)) { - if (folk.inSession && (Date.now() - this.others[pubKeyStr].lastSeen > outOfSessionTimout)) { - folk.inSession = false; - result.push(this.others[pubKeyStr].pubKey); - } - } - if (result.length > 0) { - this.folks.set(this.others); - } - return result; - } - async hashContent(content) { - return this.zome.call('hash_content', content); - } - // senders --------------------------------------------------------------------- - // These are the functions that send signals in the context of a session - async sendHeartbeat(data) { - data = encodeJson(data); - return this.zome.call('send_heartbeat', { scribe: this.scribe, data }); - } - async sendChangeReq(index, deltas) { - deltas = deltas.map(d => JSON.stringify(d)); - return this.zome.call('send_change_request', { scribe: this.scribe, change: [index, deltas] }); - } - async sendChange(index, deltas) { - const participants = this.folksForScribeSignals(); - if (participants.length > 0) { - deltas = deltas.map(d => JSON.stringify(d)); - return this.zome.call('send_change', { participants, change: [index, deltas] }); - } - } - async sendFolkLore(participants, data) { - if (participants.length > 0) { - data = encodeJson(data); - return this.zome.call('send_folk_lore', { participants, data }); - } - } - async sendSyncResp(to, state) { - state.deltas = state.deltas.map(d => JSON.stringify(d)); - return this.zome.call('send_sync_response', { - participant: to, - state - }); - } - // signal handlers ------------------------------------------ - // handler for the changeReq event - changeReq(change) { - if (this._scribeStr == this.me) { - this.addChangeAsScribe(change); - } - else { - console.log('change requested but I\'m not the scribe.'); - } - } - // handler for the change event - change(index, deltas) { - if (this._scribeStr == this.me) { - console.log('change received but I\'m the scribe, so I\'m ignoring this!'); - } - else { - console.log(`change arrived for ${index}:`, deltas); - if (this.nextIndex() == index) { - this.recordDeltas(index, deltas); - } - else { - console.log(`change arrived out of sequence nextIndex: ${this.nextIndex()}, change index:${index}`); - // TODO either call for sync, or do some waiting algorithm - } - } - } - // handler for the syncReq event - syncReq(request) { - const from = request.from; - if (this._scribeStr == this.me) { - this.updateOthers(from, FOLK_SEEN, request.meta); - let state = { - snapshot: this.snapshot_hash, - commit_content_hash: this.content_hash, - deltas: this.recorded.map(c => c.delta) - }; - if (this.currentCommitHeaderHash) { - state['commit'] = this.currentCommitHeaderHash; - } - // send a sync response to the sender - this.sendSyncResp(from, state); - // and send everybody a folk lore p2p message with new participants - let p = Object.assign({}, this.others); - p[this.me] = { - pubKey: this.zome.agentPubKey - }; - const data = { - participants: p - }; - this.sendFolkLore(this.folksForScribeSignals(), data); - } - else { - console.log('syncReq received but I\'m not the scribe!'); - } - } - // handler for the syncResp event - syncResp(stateForSync) { - // Make sure that we are working off the same snapshot and commit - const commitContentHashStr = bufferToBase64(stateForSync.commit_content_hash); - if (commitContentHashStr == this.contentHashStr) { - this._recordDeltas(stateForSync.deltas); - } - else { - console.log('WHOA, sync response has different current state assumptions'); - // TODO: resync somehow - } - } - // handler for the heartbeat event - heartbeat(from, data) { - console.log('got heartbeat', data, 'from:', from); - if (this._scribeStr != this.me) { - console.log('heartbeat received but I\'m not the scribe.'); - } - else { - // I am the scribe and I've recieved a heartbeat from a concerned Folk - this.updateOthers(from, FOLK_SEEN); - } - } - // handler for the folklore event - folklore(data) { - console.log('got folklore', data); - if (this._scribeStr == this.me) { - console.log('folklore received but I\'m the scribe!'); - } - else { - if (data.gone) { - Object.values(data.participants).forEach(pubKey => { - this.updateOthers(pubKey, FOLK_GONE); - }); - } - // TODO move last seen into p.meta so that we can update that value - // as hearsay. - if (data.participants) { - Object.values(data.participants).forEach(p => { - this.updateOthers(p.pubKey, FOLK_UNKNOWN, p.meta); - }); - } - } - } - // handler for the commit notice event - commitNotice(commitInfo) { - // make sure we are at the right place to be able to just move forward with the commit - if (this.contentHashStr == bufferToBase64(commitInfo.previous_content_hash) && - this.nextIndex() == commitInfo.deltas_committed) { - this.contentHashStr = bufferToBase64(commitInfo.commit_content_hash); - this.committed = this.committed.concat(this.recorded); - this.recorded = []; - this.committedChanges.set(this.committed); - this.recordedChanges.set(this.recorded); - } - else { - console.log('received commit notice for beyond our last commit, gotta resync'); - console.log('commit.commit_content_hash:', bufferToBase64(commitInfo.commit_content_hash)); - console.log('commit.previous_content_hash:', bufferToBase64(commitInfo.previous_content_hash)); - console.log('commit.deltas_committed:', commitInfo.deltas_committed); - console.log('my $session.contentHashStr', this.contentHashStr); - console.log('my nextIndex', this.nextIndex()); - // TODO resync - } - } - } - - const session_b = _be('session', () => { - const session = writable(null); - return session; - }); - - class Zome { - constructor(appClient, appId) { - this.appClient = appClient; - this.appId = appId; - } - async attach() { - // setup the syn instance data - this.appInfo = await this.appClient.appInfo({ installed_app_id: this.appId }); - this.cellId = this.appInfo.cell_data[0].cell_id; - this.agentPubKey = this.cellId[1]; - this.dna = this.cellId[0]; - this.dnaStr = bufferToBase64(this.dna); - this.me = bufferToBase64(this.agentPubKey); - } - attached() { - return this.appInfo != undefined; - } - async call(fn_name, payload, timeout) { - if (!this.attached()) { - console.log('Can\'t call zome when disconnected from conductor'); - return; - } - try { - const zome_name = 'syn'; - console.log(`Making zome call ${fn_name} with:`, payload); - const result = await this.appClient.callZome({ - cap: null, - cell_id: this.cellId, - zome_name, - fn_name, - provenance: this.agentPubKey, - payload - }, timeout); - return result; - } - catch (error) { - console.log('ERROR: callZome threw error', error); - throw (error); - // if (error == 'Error: Socket is not open') { - // TODO return doResetConnection(dispatch) - // } - } - } - } - - class Syn$1 { - constructor(ctx, defaultContent, applyDeltaFn, appClient, appId) { - this.ctx = ctx; - this.defaultContent = defaultContent; - this.applyDeltaFn = applyDeltaFn; - this.appClient = appClient; - this.appId = appId; - this.zome = new Zome(this.appClient, this.appId); - this.session = session_b(this.ctx); - this.folks = folks_b(this.ctx); - this.connection = connection_b(this.ctx); - this.scribeStr = scribeStr_b(this.ctx); - window.syn = this; - } - async attach() { - await this.zome.attach(); - this.agentPubKey = this.zome.agentPubKey; - this.me = this.zome.me; - this.myColors = getFolkColors(this.agentPubKey); - this.myTag = this.me.slice(-4); - this.Dna = this.zome.dnaStr; - // TODO: others moved into session so we can do it here. - // load up the other folk in this syn instance - // let allFolks = await this.getFolks() - // for (const folk of allFolks) { - // this.updateOthers(folk) - // } - } - clearState() { - this.folks.set({}); - this.connection.set(undefined); - this.session.update(s => { - s.scribeStr.set(''); - s._content = this.defaultContent; - s.content.set(s._content); - s.requestedChanges.set([]); - s.recordedChanges.set([]); - s.committedChanges.set([]); - return undefined; - }); - } - async callZome(fn_name, payload, timeout) { - return this.zome.call(fn_name, payload, timeout); - } - async getFolks() { - return this.callZome('get_folks'); - } - async getSessions() { - return this.callZome('get_sessions'); - } - async getSession(session_hash) { - return this.callZome('get_session', session_hash); - } - async newSession() { - const rawSessionInfo = await this.callZome('new_session', { content: this.defaultContent }); - const $session = new Session(this.ctx, this, rawSessionInfo); - this.session.set($session); - return $session; - } - async sendSyncReq() { - return this.callZome('send_sync_request', { scribe: get(this.session).scribe }); - } - } - - class Connection { - constructor(ctx, appPort, appId) { - this.ctx = ctx; - this.appPort = appPort; - this.appId = appId; - } - async open(defaultContent, applyDeltaFn) { - const self = this; - this.appClient = await lib.AppWebsocket.connect(`ws://localhost:${this.appPort}`, 30000, (signal) => signalHandler(self, signal)); - console.log('connection established:', this); - // TODO: in the future we should be able manage and to attach to multiple syn happs - this.syn = new Syn$1(this.ctx, defaultContent, applyDeltaFn, this.appClient, this.appId); - await this.syn.attach(); - this.sessions = await this.syn.getSessions(); - } - async joinSession() { - if (!this.syn) { - console.log('join session called without syn app opened'); - return; - } - if (this.sessions.length == 0) { - this.session = await this.syn.newSession(); - this.sessions[0] = this.session.sessionHash; - } - else { - const sessionInfo = await this.syn.getSession(this.sessions[0]); - this.session = new Session(this.ctx, this.syn, sessionInfo); - if (this.session._scribeStr != this.syn.me) { - await this.syn.sendSyncReq(); - } - } - } - } - function signalHandler(connection, signal) { - // ignore signals not meant for me - if (!connection.syn || bufferToBase64(signal.data.cellId[1]) != connection.syn.me) { - return; - } - console.log('Got Signal', signal.data.payload.signal_name, signal); - switch (signal.data.payload.signal_name) { - case 'SyncReq': - connection.session.syncReq({ from: signal.data.payload.signal_payload }); - break; - case 'SyncResp': - const state = signal.data.payload.signal_payload; - state.deltas = state.deltas.map(d => JSON.parse(d)); - connection.session.syncResp(state); - break; - case 'ChangeReq': { - let [index, deltas] = signal.data.payload.signal_payload; - deltas = deltas.map(d => JSON.parse(d)); - connection.session.changeReq([index, deltas]); - break; - } - case 'Change': { - let [index, deltas] = signal.data.payload.signal_payload; - deltas = deltas.map(d => JSON.parse(d)); - connection.session.change(index, deltas); - break; - } - case 'FolkLore': { - let data = decodeJson(signal.data.payload.signal_payload); - connection.session.folklore(data); - break; - } - case 'Heartbeat': { - let [from, jsonData] = signal.data.payload.signal_payload; - const data = decodeJson(jsonData); - connection.session.heartbeat(from, data); - break; - } - case 'CommitNotice': - connection.session.commitNotice(signal.data.payload.signal_payload); - } - } - - const connection_b = _be('connection', () => { - return writable(null); - }); - - /* src/Editor.svelte generated by Svelte v3.37.0 */ - - const { Object: Object_1, console: console_1$2 } = globals; - const file$6 = "src/Editor.svelte"; - - function create_fragment$6(ctx) { - let editor_1; - let span0; - let t0; - let span1; - let span2; - let t1; - let mounted; - let dispose; - - const block = { - c: function create() { - editor_1 = element("editor"); - span0 = element("span"); - t0 = text(/*editor_content1*/ ctx[2]); - span1 = element("span"); - span2 = element("span"); - t1 = text(/*editor_content2*/ ctx[3]); - add_location(span0, file$6, 109, 2, 3567); - attr_dev(span1, "class", "cursor svelte-4kugpc"); - add_location(span1, file$6, 109, 32, 3597); - add_location(span2, file$6, 109, 79, 3644); - attr_dev(editor_1, "tabindex", "0"); - attr_dev(editor_1, "start", "0"); - attr_dev(editor_1, "class", "svelte-4kugpc"); - add_location(editor_1, file$6, 108, 0, 3470); - }, - l: function claim(nodes) { - throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); - }, - m: function mount(target, anchor) { - insert_dev(target, editor_1, anchor); - append_dev(editor_1, span0); - append_dev(span0, t0); - append_dev(editor_1, span1); - /*span1_binding*/ ctx[13](span1); - append_dev(editor_1, span2); - append_dev(span2, t1); - /*editor_1_binding*/ ctx[14](editor_1); - - if (!mounted) { - dispose = [ - listen_dev(editor_1, "click", /*handleClick*/ ctx[8], false, false, false), - listen_dev(editor_1, "keydown", /*handleInput*/ ctx[7], false, false, false) - ]; - - mounted = true; - } - }, - p: function update(ctx, [dirty]) { - if (dirty & /*editor_content1*/ 4) set_data_dev(t0, /*editor_content1*/ ctx[2]); - if (dirty & /*editor_content2*/ 8) set_data_dev(t1, /*editor_content2*/ ctx[3]); - }, - i: noop, - o: noop, - d: function destroy(detaching) { - if (detaching) detach_dev(editor_1); - /*span1_binding*/ ctx[13](null); - /*editor_1_binding*/ ctx[14](null); - mounted = false; - run_all(dispose); - } - }; - - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_fragment$6.name, - type: "component", - source: "", - ctx - }); - - return block; - } - - function instance$6($$self, $$props, $$invalidate) { - let myTag; - let editor_content1; - let editor_content2; - let $content; - let $session; - let $connection; - let { $$slots: slots = {}, $$scope } = $$props; - validate_slots("Editor", slots, []); - - const ctx = getContext("ctx"); - const dispatch = createEventDispatcher(); - const connection = connection_b(ctx); - validate_store(connection, "connection"); - component_subscribe($$self, connection, value => $$invalidate(12, $connection = value)); - const content = content_b(ctx); - validate_store(content, "content"); - component_subscribe($$self, content, value => $$invalidate(9, $content = value)); - const session = session_b(ctx); - validate_store(session, "session"); - component_subscribe($$self, session, value => $$invalidate(11, $session = value)); - - function getLoc(tag) { - return $content.meta - ? $content.meta[tag] ? $content.meta[tag] : 0 - : 0; - } - - let editor; - - function addText(text) { - const loc = getLoc(myTag); - const deltas = [{ type: "Add", value: [loc, text] }]; - - for (const [tag, tagLoc] of Object.entries($content.meta)) { - if (tagLoc >= loc) { - deltas.push({ - type: "Meta", - value: { setLoc: [tag, tagLoc + text.length] } - }); - } - } - - dispatch("requestChange", deltas); - } - - function handleInput(event) { - const loc = getLoc(myTag); - const key = event.key; - - if (key.length == 1) { - addText(key); - } else { - switch (key) { - case "ArrowRight": - if (loc < $content.body.length) { - dispatch("requestChange", [ - { - type: "Meta", - value: { setLoc: [myTag, loc + 1] } - } - ]); - } - break; - case "ArrowLeft": - if (loc > 0) { - dispatch("requestChange", [ - { - type: "Meta", - value: { setLoc: [myTag, loc - 1] } - } - ]); - } - break; - case "Enter": - addText("\n"); - break; - case "Backspace": - if (loc > 0) { - const deltas = [{ type: "Delete", value: [loc - 1, loc] }]; - - for (const [tag, tagLoc] of Object.entries($content.meta)) { - if (tagLoc >= loc) { - deltas.push({ - type: "Meta", - value: { setLoc: [tag, tagLoc - 1] } - }); - } - } - - dispatch("requestChange", deltas); - } - } - } - - console.log("input", event.key); - } - - function handleClick(e) { - const offset = window.getSelection().focusOffset; - let loc = offset > 0 ? offset : 0; - - if (window.getSelection().focusNode.parentElement == editor.lastChild) { - loc += editor_content1.length; - } - - if (loc != getLoc(myTag)) { - dispatch("requestChange", [ - { - type: "Meta", - value: { setLoc: [myTag, loc] } - } - ]); - } - } - - let cursor; - const writable_props = []; - - Object_1.keys($$props).forEach(key => { - if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console_1$2.warn(`<Editor> was created with unknown prop '${key}'`); - }); - - function span1_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - cursor = $$value; - ($$invalidate(0, cursor), $$invalidate(12, $connection)); - }); - } - - function editor_1_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - editor = $$value; - $$invalidate(1, editor); - }); - } - - $$self.$capture_state = () => ({ - createEventDispatcher, - getContext, - connection_b, - content_b, - session_b, - CSSifyHSL, - ctx, - dispatch, - connection, - content, - session, - getLoc, - editor, - addText, - handleInput, - handleClick, - cursor, - $content, - myTag, - $session, - editor_content1, - editor_content2, - $connection - }); - - $$self.$inject_state = $$props => { - if ("editor" in $$props) $$invalidate(1, editor = $$props.editor); - if ("cursor" in $$props) $$invalidate(0, cursor = $$props.cursor); - if ("myTag" in $$props) $$invalidate(10, myTag = $$props.myTag); - if ("editor_content1" in $$props) $$invalidate(2, editor_content1 = $$props.editor_content1); - if ("editor_content2" in $$props) $$invalidate(3, editor_content2 = $$props.editor_content2); - }; - - if ($$props && "$$inject" in $$props) { - $$self.$inject_state($$props.$$inject); - } - - $$self.$$.update = () => { - if ($$self.$$.dirty & /*$session*/ 2048) { - $$invalidate(10, myTag = $session ? $session.myTag : ""); - } - - if ($$self.$$.dirty & /*$content, myTag*/ 1536) { - $$invalidate(2, editor_content1 = $content.body.slice(0, getLoc(myTag))); - } - - if ($$self.$$.dirty & /*$content, myTag*/ 1536) { - $$invalidate(3, editor_content2 = $content.body.slice(getLoc(myTag))); - } - - if ($$self.$$.dirty & /*cursor, $connection*/ 4097) { - { - // wait for cursor and connection and color inside connection to exist - // before updating the cursor color - if (cursor && $connection && $connection.syn && $connection.syn.myColors) { - $$invalidate(0, cursor.style["border-color"] = CSSifyHSL($connection.syn.myColors.primary), cursor); - } - } - } - }; - - return [ - cursor, - editor, - editor_content1, - editor_content2, - connection, - content, - session, - handleInput, - handleClick, - $content, - myTag, - $session, - $connection, - span1_binding, - editor_1_binding - ]; - } - - class Editor extends SvelteComponentDev { - constructor(options) { - super(options); - init(this, options, instance$6, create_fragment$6, safe_not_equal, {}); - - dispatch_dev("SvelteRegisterComponent", { - component: this, - tagName: "Editor", - options, - id: create_fragment$6.name - }); - } - } - - /* src/Title.svelte generated by Svelte v3.37.0 */ - - const { console: console_1$1 } = globals; - const file$5 = "src/Title.svelte"; - - // (97:2) {:else} - function create_else_block$2(ctx) { - let div; - let span; - let mounted; - let dispose; - - function select_block_type_1(ctx, dirty) { - if (/*untitled*/ ctx[4]) return create_if_block_1$1; - return create_else_block_1; - } - - let current_block_type = select_block_type_1(ctx); - let if_block = current_block_type(ctx); - - const block = { - c: function create() { - div = element("div"); - span = element("span"); - if_block.c(); - attr_dev(span, "class", "svelte-3yilbg"); - toggle_class(span, "untitled", /*untitled*/ ctx[4]); - add_location(span, file$5, 98, 6, 3234); - attr_dev(div, "class", "title svelte-3yilbg"); - toggle_class(div, "title-hover", /*titleHover*/ ctx[5]); - add_location(div, file$5, 97, 4, 3074); - }, - m: function mount(target, anchor) { - insert_dev(target, div, anchor); - append_dev(div, span); - if_block.m(span, null); - - if (!mounted) { - dispose = [ - listen_dev(div, "mouseenter", /*mouseenter_handler*/ ctx[12], false, false, false), - listen_dev(div, "mouseleave", /*mouseleave_handler*/ ctx[13], false, false, false), - listen_dev(div, "click", /*beginEditTitle*/ ctx[8], false, false, false) - ]; - - mounted = true; - } - }, - p: function update(ctx, dirty) { - if (current_block_type === (current_block_type = select_block_type_1(ctx)) && if_block) { - if_block.p(ctx, dirty); - } else { - if_block.d(1); - if_block = current_block_type(ctx); - - if (if_block) { - if_block.c(); - if_block.m(span, null); - } - } - - if (dirty & /*untitled*/ 16) { - toggle_class(span, "untitled", /*untitled*/ ctx[4]); - } - - if (dirty & /*titleHover*/ 32) { - toggle_class(div, "title-hover", /*titleHover*/ ctx[5]); - } - }, - d: function destroy(detaching) { - if (detaching) detach_dev(div); - if_block.d(); - mounted = false; - run_all(dispose); - } - }; - - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_else_block$2.name, - type: "else", - source: "(97:2) {:else}", - ctx - }); - - return block; - } - - // (95:2) {#if editingTitle} - function create_if_block$2(ctx) { - let input; - let mounted; - let dispose; - - const block = { - c: function create() { - input = element("input"); - attr_dev(input, "class", "title-input svelte-3yilbg"); - add_location(input, file$5, 95, 4, 2929); - }, - m: function mount(target, anchor) { - insert_dev(target, input, anchor); - set_input_value(input, /*titleBeingTyped*/ ctx[1]); - /*input_binding*/ ctx[11](input); - - if (!mounted) { - dispose = [ - listen_dev(input, "input", /*input_input_handler*/ ctx[10]), - listen_dev(input, "keydown", /*handleTitleKeypress*/ ctx[9], false, false, false), - listen_dev(input, "blur", /*saveTitle*/ ctx[7], false, false, false) - ]; - - mounted = true; - } - }, - p: function update(ctx, dirty) { - if (dirty & /*titleBeingTyped*/ 2 && input.value !== /*titleBeingTyped*/ ctx[1]) { - set_input_value(input, /*titleBeingTyped*/ ctx[1]); - } - }, - d: function destroy(detaching) { - if (detaching) detach_dev(input); - /*input_binding*/ ctx[11](null); - mounted = false; - run_all(dispose); - } - }; - - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block$2.name, - type: "if", - source: "(95:2) {#if editingTitle}", - ctx - }); - - return block; - } - - // (102:8) {:else} - function create_else_block_1(ctx) { - let t_value = /*$content*/ ctx[0].title + ""; - let t; - - const block = { - c: function create() { - t = text(t_value); - }, - m: function mount(target, anchor) { - insert_dev(target, t, anchor); - }, - p: function update(ctx, dirty) { - if (dirty & /*$content*/ 1 && t_value !== (t_value = /*$content*/ ctx[0].title + "")) set_data_dev(t, t_value); - }, - d: function destroy(detaching) { - if (detaching) detach_dev(t); - } - }; - - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_else_block_1.name, - type: "else", - source: "(102:8) {:else}", - ctx - }); - - return block; - } - - // (100:8) {#if untitled} - function create_if_block_1$1(ctx) { - let t; - - const block = { - c: function create() { - t = text("Untitled Document"); - }, - m: function mount(target, anchor) { - insert_dev(target, t, anchor); - }, - p: noop, - d: function destroy(detaching) { - if (detaching) detach_dev(t); - } - }; - - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_1$1.name, - type: "if", - source: "(100:8) {#if untitled}", - ctx - }); - - return block; - } - - function create_fragment$5(ctx) { - let div; - let t; - - function select_block_type(ctx, dirty) { - if (/*editingTitle*/ ctx[2]) return create_if_block$2; - return create_else_block$2; - } - - let current_block_type = select_block_type(ctx); - let if_block = current_block_type(ctx); - - const block = { - c: function create() { - div = element("div"); - t = text("Title:\n "); - if_block.c(); - attr_dev(div, "class", "title-wrapper svelte-3yilbg"); - add_location(div, file$5, 92, 0, 2867); - }, - l: function claim(nodes) { - throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); - }, - m: function mount(target, anchor) { - insert_dev(target, div, anchor); - append_dev(div, t); - if_block.m(div, null); - }, - p: function update(ctx, [dirty]) { - if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) { - if_block.p(ctx, dirty); - } else { - if_block.d(1); - if_block = current_block_type(ctx); - - if (if_block) { - if_block.c(); - if_block.m(div, null); - } - } - }, - i: noop, - o: noop, - d: function destroy(detaching) { - if (detaching) detach_dev(div); - if_block.d(); - } - }; - - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_fragment$5.name, - type: "component", - source: "", - ctx - }); - - return block; - } - - function instance$5($$self, $$props, $$invalidate) { - let $content; - let { $$slots: slots = {}, $$scope } = $$props; - validate_slots("Title", slots, []); - - var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P - ? value - : new P(function (resolve) { - resolve(value); - }); - } - - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch(e) { - reject(e); - } - } - - function rejected(value) { - try { - step(generator["throw"](value)); - } catch(e) { - reject(e); - } - } - - function step(result) { - result.done - ? resolve(result.value) - : adopt(result.value).then(fulfilled, rejected); - } - - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - - const ctx = getContext("ctx"); - const dispatch = createEventDispatcher(); - const content = content_b(ctx); - validate_store(content, "content"); - component_subscribe($$self, content, value => $$invalidate(0, $content = value)); - let titleBeingTyped = ""; - let editingTitle = false; - - function saveTitle() { - if (editingTitle) { - // only dispatch a changeReq if the title trying to be saved is different - // than the current title - if (titleBeingTyped !== $content.title) { - let delta = { type: "Title", value: titleBeingTyped }; - dispatch("requestChange", [delta]); - } - - $$invalidate(1, titleBeingTyped = ""); - $$invalidate(2, editingTitle = false); - } else { - console.log("Can't run saveTitle when it wasn't being edited!"); - } - } - - let titleEl; // variable to bind the title input to when it's created - - function beginEditTitle() { - return __awaiter(this, void 0, void 0, function* () { - $$invalidate(5, titleHover = false); - $$invalidate(1, titleBeingTyped = $content.title); // fill the field with the current title - $$invalidate(2, editingTitle = true); - yield tick(); // wait for the title input element to be created - titleEl.focus(); - }); - } - - function handleTitleKeypress() { - if (event.key == "Enter") { - saveTitle(); - } else if (event.key == "Escape") { - // don't save new title & discard changes - $$invalidate(1, titleBeingTyped = ""); - - // turn off editing - $$invalidate(2, editingTitle = false); - } - } - - // keep track of whether the doc is untitled - let untitled; - - let titleHover; // whether the title is being hovered - const writable_props = []; - - Object.keys($$props).forEach(key => { - if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console_1$1.warn(`<Title> was created with unknown prop '${key}'`); - }); - - function input_input_handler() { - titleBeingTyped = this.value; - $$invalidate(1, titleBeingTyped); - } - - function input_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - titleEl = $$value; - $$invalidate(3, titleEl); - }); - } - - const mouseenter_handler = () => { - $$invalidate(5, titleHover = true); - }; - - const mouseleave_handler = () => { - $$invalidate(5, titleHover = false); - }; - - $$self.$capture_state = () => ({ - __awaiter, - createEventDispatcher, - getContext, - tick, - content_b, - ctx, - dispatch, - content, - titleBeingTyped, - editingTitle, - saveTitle, - titleEl, - beginEditTitle, - handleTitleKeypress, - untitled, - titleHover, - $content - }); - - $$self.$inject_state = $$props => { - if ("__awaiter" in $$props) __awaiter = $$props.__awaiter; - if ("titleBeingTyped" in $$props) $$invalidate(1, titleBeingTyped = $$props.titleBeingTyped); - if ("editingTitle" in $$props) $$invalidate(2, editingTitle = $$props.editingTitle); - if ("titleEl" in $$props) $$invalidate(3, titleEl = $$props.titleEl); - if ("untitled" in $$props) $$invalidate(4, untitled = $$props.untitled); - if ("titleHover" in $$props) $$invalidate(5, titleHover = $$props.titleHover); - }; - - if ($$props && "$$inject" in $$props) { - $$self.$inject_state($$props.$$inject); - } - - $$self.$$.update = () => { - if ($$self.$$.dirty & /*$content*/ 1) { - $$invalidate(4, untitled = $content.title === ""); - } - }; - - return [ - $content, - titleBeingTyped, - editingTitle, - titleEl, - untitled, - titleHover, - content, - saveTitle, - beginEditTitle, - handleTitleKeypress, - input_input_handler, - input_binding, - mouseenter_handler, - mouseleave_handler - ]; - } - - class Title extends SvelteComponentDev { - constructor(options) { - super(options); - init(this, options, instance$5, create_fragment$5, safe_not_equal, {}); - - dispatch_dev("SvelteRegisterComponent", { - component: this, - tagName: "Title", - options, - id: create_fragment$5.name - }); - } - } - - /* src/Syn.svelte generated by Svelte v3.37.0 */ - - const { console: console_1 } = globals; - const file$4 = "src/Syn.svelte"; - - function get_each_context$1(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[9] = list[i]; - return child_ctx; - } - - // (98:4) {:else} - function create_else_block$1(ctx) { - let t; - - const block = { - c: function create() { - t = text("Connect"); - }, - m: function mount(target, anchor) { - insert_dev(target, t, anchor); - }, - d: function destroy(detaching) { - if (detaching) detach_dev(t); - } - }; - - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_else_block$1.name, - type: "else", - source: "(98:4) {:else}", - ctx - }); - - return block; - } - - // (96:4) {#if $connection} - function create_if_block_1(ctx) { - let t; - - const block = { - c: function create() { - t = text("Disconnect"); - }, - m: function mount(target, anchor) { - insert_dev(target, t, anchor); - }, - d: function destroy(detaching) { - if (detaching) detach_dev(t); - } - }; - - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_1.name, - type: "if", - source: "(96:4) {#if $connection}", - ctx - }); - - return block; - } - - // (106:2) {#if sessions} - function create_if_block$1(ctx) { - let each_1_anchor; - let each_value = /*sessions*/ ctx[0]; - validate_each_argument(each_value); - let each_blocks = []; - - for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block$1(get_each_context$1(ctx, each_value, i)); - } - - const block = { - c: function create() { - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - - each_1_anchor = empty(); - }, - m: function mount(target, anchor) { - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].m(target, anchor); - } - - insert_dev(target, each_1_anchor, anchor); - }, - p: function update(ctx, dirty) { - if (dirty & /*bufferToBase64, sessions*/ 1) { - each_value = /*sessions*/ ctx[0]; - validate_each_argument(each_value); - let i; - - for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context$1(ctx, each_value, i); - - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - } else { - each_blocks[i] = create_each_block$1(child_ctx); - each_blocks[i].c(); - each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); - } - } - - for (; i < each_blocks.length; i += 1) { - each_blocks[i].d(1); - } - - each_blocks.length = each_value.length; - } - }, - d: function destroy(detaching) { - destroy_each(each_blocks, detaching); - if (detaching) detach_dev(each_1_anchor); - } - }; - - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block$1.name, - type: "if", - source: "(106:2) {#if sessions}", - ctx - }); - - return block; - } - - // (107:2) {#each sessions as session} - function create_each_block$1(ctx) { - let span; - let t0; - let t1_value = bufferToBase64(/*session*/ ctx[9]).slice(-4) + ""; - let t1; - let t2; - - const block = { - c: function create() { - span = element("span"); - t0 = text("Id: "); - t1 = text(t1_value); - t2 = space(); - attr_dev(span, "class", "session svelte-1u2trq8"); - add_location(span, file$4, 107, 4, 3195); - }, - m: function mount(target, anchor) { - insert_dev(target, span, anchor); - append_dev(span, t0); - append_dev(span, t1); - append_dev(span, t2); - }, - p: function update(ctx, dirty) { - if (dirty & /*sessions*/ 1 && t1_value !== (t1_value = bufferToBase64(/*session*/ ctx[9]).slice(-4) + "")) set_data_dev(t1, t1_value); - }, - d: function destroy(detaching) { - if (detaching) detach_dev(span); - } - }; - - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_each_block$1.name, - type: "each", - source: "(107:2) {#each sessions as session}", - ctx - }); - - return block; - } - - function create_fragment$4(ctx) { - let button0; - let t1; - let div0; - let h4; - let t3; - let input0; - let t4; - let input1; - let t5; - let button1; - let t6; - let div1; - let t7; - let mounted; - let dispose; - - function select_block_type(ctx, dirty) { - if (/*$connection*/ ctx[3]) return create_if_block_1; - return create_else_block$1; - } - - let current_block_type = select_block_type(ctx); - let if_block0 = current_block_type(ctx); - let if_block1 = /*sessions*/ ctx[0] && create_if_block$1(ctx); - - const block = { - c: function create() { - button0 = element("button"); - button0.textContent = "Commit"; - t1 = space(); - div0 = element("div"); - h4 = element("h4"); - h4.textContent = "Holochain Connection:"; - t3 = text("\n App Port: "); - input0 = element("input"); - t4 = text("\n AppId: "); - input1 = element("input"); - t5 = space(); - button1 = element("button"); - if_block0.c(); - t6 = space(); - div1 = element("div"); - t7 = text("Sessions:\n "); - if (if_block1) if_block1.c(); - attr_dev(button0, "class", "svelte-1u2trq8"); - toggle_class(button0, "noscribe", /*noscribe*/ ctx[4]); - add_location(button0, file$4, 88, 0, 2805); - add_location(h4, file$4, 91, 2, 2877); - attr_dev(input0, "class", "svelte-1u2trq8"); - add_location(input0, file$4, 92, 12, 2920); - attr_dev(input1, "class", "svelte-1u2trq8"); - add_location(input1, file$4, 93, 9, 2958); - attr_dev(button1, "class", "svelte-1u2trq8"); - add_location(button1, file$4, 94, 2, 2987); - add_location(div0, file$4, 90, 0, 2869); - attr_dev(div1, "class", "sessions"); - add_location(div1, file$4, 103, 0, 3109); - }, - l: function claim(nodes) { - throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); - }, - m: function mount(target, anchor) { - insert_dev(target, button0, anchor); - insert_dev(target, t1, anchor); - insert_dev(target, div0, anchor); - append_dev(div0, h4); - append_dev(div0, t3); - append_dev(div0, input0); - set_input_value(input0, /*appPort*/ ctx[1]); - append_dev(div0, t4); - append_dev(div0, input1); - set_input_value(input1, /*appId*/ ctx[2]); - append_dev(div0, t5); - append_dev(div0, button1); - if_block0.m(button1, null); - insert_dev(target, t6, anchor); - insert_dev(target, div1, anchor); - append_dev(div1, t7); - if (if_block1) if_block1.m(div1, null); - - if (!mounted) { - dispose = [ - listen_dev(button0, "click", /*commitChange*/ ctx[8], false, false, false), - listen_dev(input0, "input", /*input0_input_handler*/ ctx[14]), - listen_dev(input1, "input", /*input1_input_handler*/ ctx[15]), - listen_dev(button1, "click", /*toggle*/ ctx[7], false, false, false) - ]; - - mounted = true; - } - }, - p: function update(ctx, [dirty]) { - if (dirty & /*noscribe*/ 16) { - toggle_class(button0, "noscribe", /*noscribe*/ ctx[4]); - } - - if (dirty & /*appPort*/ 2 && input0.value !== /*appPort*/ ctx[1]) { - set_input_value(input0, /*appPort*/ ctx[1]); - } - - if (dirty & /*appId*/ 4 && input1.value !== /*appId*/ ctx[2]) { - set_input_value(input1, /*appId*/ ctx[2]); - } - - if (current_block_type !== (current_block_type = select_block_type(ctx))) { - if_block0.d(1); - if_block0 = current_block_type(ctx); - - if (if_block0) { - if_block0.c(); - if_block0.m(button1, null); - } - } - - if (/*sessions*/ ctx[0]) { - if (if_block1) { - if_block1.p(ctx, dirty); - } else { - if_block1 = create_if_block$1(ctx); - if_block1.c(); - if_block1.m(div1, null); - } - } else if (if_block1) { - if_block1.d(1); - if_block1 = null; - } - }, - i: noop, - o: noop, - d: function destroy(detaching) { - if (detaching) detach_dev(button0); - if (detaching) detach_dev(t1); - if (detaching) detach_dev(div0); - if_block0.d(); - if (detaching) detach_dev(t6); - if (detaching) detach_dev(div1); - if (if_block1) if_block1.d(); - mounted = false; - run_all(dispose); - } - }; - - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_fragment$4.name, - type: "component", - source: "", - ctx - }); - - return block; - } - - function instance$4($$self, $$props, $$invalidate) { - let noscribe; - let $session; - let $connection; - let $scribeStr; - let { $$slots: slots = {}, $$scope } = $$props; - validate_slots("Syn", slots, []); - - var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P - ? value - : new P(function (resolve) { - resolve(value); - }); - } - - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch(e) { - reject(e); - } - } - - function rejected(value) { - try { - step(generator["throw"](value)); - } catch(e) { - reject(e); - } - } - - function step(result) { - result.done - ? resolve(result.value) - : adopt(result.value).then(fulfilled, rejected); - } - - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - - const ctx = getContext("ctx"); - const connection = connection_b(ctx); - validate_store(connection, "connection"); - component_subscribe($$self, connection, value => $$invalidate(3, $connection = value)); - const scribeStr = scribeStr_b(ctx); - validate_store(scribeStr, "scribeStr"); - component_subscribe($$self, scribeStr, value => $$invalidate(13, $scribeStr = value)); - const session = session_b(ctx); - validate_store(session, "session"); - component_subscribe($$self, session, value => $$invalidate(16, $session = value)); - let { applyDeltaFn } = $$props, { undoFn } = $$props; - - // this is the list of sessions returned by the DNA - let sessions; - - function requestChange(deltas) { - $session.requestChange(deltas); - } - - // ----------------------------------------------------------------------- - const dispatch = createEventDispatcher(); - - let adminPort = 1234; - let appPort = 8888; - let appId = "syn"; - - function toggle() { - return __awaiter(this, void 0, void 0, function* () { - if (!$session) { - // if (!$connection) { - set_store_value(session, $session = yield join_session(appPort, appId), $session); - - // $connection = new Connection(ctx, appPort, appId) - // await $connection.open({title:'', body:''}, applyDeltaFn) - // - // session = $connection.syn.session - // - // console.log('joining session...') - // await $connection.joinSession() - $$invalidate(0, sessions = $connection.sessions); - } else { - $connection.syn.clearState(); - $$invalidate(0, sessions = undefined); - console.log("disconnected"); - } - }); - } - - function commitChange() { - return __awaiter(this, void 0, void 0, function* () { - $session.commitChange(); - }); - } - - const writable_props = ["applyDeltaFn", "undoFn"]; - - Object.keys($$props).forEach(key => { - if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console_1.warn(`<Syn> was created with unknown prop '${key}'`); - }); - - function input0_input_handler() { - appPort = this.value; - $$invalidate(1, appPort); - } - - function input1_input_handler() { - appId = this.value; - $$invalidate(2, appId); - } - - $$self.$$set = $$props => { - if ("applyDeltaFn" in $$props) $$invalidate(10, applyDeltaFn = $$props.applyDeltaFn); - if ("undoFn" in $$props) $$invalidate(11, undoFn = $$props.undoFn); - }; - - $$self.$capture_state = () => ({ - __awaiter, - createEventDispatcher, - getContext, - bufferToBase64, - connection_b, - Connection, - scribeStr_b, - session_b, - ctx, - connection, - scribeStr, - session, - applyDeltaFn, - undoFn, - sessions, - requestChange, - dispatch, - adminPort, - appPort, - appId, - toggle, - commitChange, - $session, - $connection, - noscribe, - $scribeStr - }); - - $$self.$inject_state = $$props => { - if ("__awaiter" in $$props) __awaiter = $$props.__awaiter; - if ("applyDeltaFn" in $$props) $$invalidate(10, applyDeltaFn = $$props.applyDeltaFn); - if ("undoFn" in $$props) $$invalidate(11, undoFn = $$props.undoFn); - if ("sessions" in $$props) $$invalidate(0, sessions = $$props.sessions); - if ("adminPort" in $$props) adminPort = $$props.adminPort; - if ("appPort" in $$props) $$invalidate(1, appPort = $$props.appPort); - if ("appId" in $$props) $$invalidate(2, appId = $$props.appId); - if ("noscribe" in $$props) $$invalidate(4, noscribe = $$props.noscribe); - }; - - if ($$props && "$$inject" in $$props) { - $$self.$inject_state($$props.$$inject); - } - - $$self.$$.update = () => { - if ($$self.$$.dirty & /*$scribeStr*/ 8192) { - $$invalidate(4, noscribe = $scribeStr === ""); - } - }; - - return [ - sessions, - appPort, - appId, - $connection, - noscribe, - connection, - scribeStr, - toggle, - commitChange, - session, - applyDeltaFn, - undoFn, - requestChange, - $scribeStr, - input0_input_handler, - input1_input_handler - ]; - } - - class Syn extends SvelteComponentDev { - constructor(options) { - super(options); - - init(this, options, instance$4, create_fragment$4, safe_not_equal, { - applyDeltaFn: 10, - undoFn: 11, - requestChange: 12 - }); - - dispatch_dev("SvelteRegisterComponent", { - component: this, - tagName: "Syn", - options, - id: create_fragment$4.name - }); - - const { ctx } = this.$$; - const props = options.props || {}; - - if (/*applyDeltaFn*/ ctx[10] === undefined && !("applyDeltaFn" in props)) { - console_1.warn("<Syn> was created without expected prop 'applyDeltaFn'"); - } - - if (/*undoFn*/ ctx[11] === undefined && !("undoFn" in props)) { - console_1.warn("<Syn> was created without expected prop 'undoFn'"); - } - } - - get applyDeltaFn() { - throw new Error("<Syn>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"); - } - - set applyDeltaFn(value) { - throw new Error("<Syn>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"); - } - - get undoFn() { - throw new Error("<Syn>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"); - } - - set undoFn(value) { - throw new Error("<Syn>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"); - } - - get requestChange() { - return this.$$.ctx[12]; - } - - set requestChange(value) { - throw new Error("<Syn>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"); - } - } - - /* src/Debug.svelte generated by Svelte v3.37.0 */ - const file$3 = "src/Debug.svelte"; - - // (20:6) {:else} - function create_else_block(ctx) { - let t; - - const block = { - c: function create() { - t = text("No connection"); - }, - m: function mount(target, anchor) { - insert_dev(target, t, anchor); - }, - p: noop, - d: function destroy(detaching) { - if (detaching) detach_dev(t); - } - }; - - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_else_block.name, - type: "else", - source: "(20:6) {:else}", - ctx - }); - - return block; - } - - // (18:6) {#if $connection && $connection.syn} - function create_if_block(ctx) { - let t0; - let t1_value = /*$connection*/ ctx[0].syn.Dna + ""; - let t1; - - const block = { - c: function create() { - t0 = text("Connected to Dna: "); - t1 = text(t1_value); - }, - m: function mount(target, anchor) { - insert_dev(target, t0, anchor); - insert_dev(target, t1, anchor); - }, - p: function update(ctx, dirty) { - if (dirty & /*$connection*/ 1 && t1_value !== (t1_value = /*$connection*/ ctx[0].syn.Dna + "")) set_data_dev(t1, t1_value); - }, - d: function destroy(detaching) { - if (detaching) detach_dev(t0); - if (detaching) detach_dev(t1); - } - }; - - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block.name, - type: "if", - source: "(18:6) {#if $connection && $connection.syn}", - ctx - }); - - return block; - } - - function create_fragment$3(ctx) { - let div; - let ul; - let li0; - let t0; - let li1; - let t1; - - let t2_value = (/*$session*/ ctx[1] - ? /*$session*/ ctx[1].contentHashStr - : "") + ""; - - let t2; - let t3; - let li2; - let t4; - let t5_value = JSON.stringify(/*$session*/ ctx[1]) + ""; - let t5; - let t6; - let li3; - let t7; - let t8; - let t9; - let li4; - let t10; - let t11; - - function select_block_type(ctx, dirty) { - if (/*$connection*/ ctx[0] && /*$connection*/ ctx[0].syn) return create_if_block; - return create_else_block; - } - - let current_block_type = select_block_type(ctx); - let if_block = current_block_type(ctx); - - const block = { - c: function create() { - div = element("div"); - ul = element("ul"); - li0 = element("li"); - if_block.c(); - t0 = space(); - li1 = element("li"); - t1 = text("lastCommitedContentHash: "); - t2 = text(t2_value); - t3 = space(); - li2 = element("li"); - t4 = text("session: "); - t5 = text(t5_value); - t6 = space(); - li3 = element("li"); - t7 = text("nextIndex: "); - t8 = text(/*$nextIndex*/ ctx[2]); - t9 = space(); - li4 = element("li"); - t10 = text("scribe: "); - t11 = text(/*$scribeStr*/ ctx[3]); - add_location(li0, file$3, 16, 4, 463); - add_location(li1, file$3, 22, 4, 611); - add_location(li2, file$3, 23, 4, 686); - add_location(li3, file$3, 24, 4, 730); - add_location(li4, file$3, 25, 4, 762); - attr_dev(ul, "class", "svelte-1am20lw"); - add_location(ul, file$3, 15, 2, 454); - add_location(div, file$3, 14, 0, 446); - }, - l: function claim(nodes) { - throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); - }, - m: function mount(target, anchor) { - insert_dev(target, div, anchor); - append_dev(div, ul); - append_dev(ul, li0); - if_block.m(li0, null); - append_dev(li0, t0); - append_dev(ul, li1); - append_dev(li1, t1); - append_dev(li1, t2); - append_dev(li1, t3); - append_dev(ul, li2); - append_dev(li2, t4); - append_dev(li2, t5); - append_dev(li2, t6); - append_dev(ul, li3); - append_dev(li3, t7); - append_dev(li3, t8); - append_dev(li3, t9); - append_dev(ul, li4); - append_dev(li4, t10); - append_dev(li4, t11); - }, - p: function update(ctx, [dirty]) { - if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) { - if_block.p(ctx, dirty); - } else { - if_block.d(1); - if_block = current_block_type(ctx); - - if (if_block) { - if_block.c(); - if_block.m(li0, t0); - } - } - - if (dirty & /*$session*/ 2 && t2_value !== (t2_value = (/*$session*/ ctx[1] - ? /*$session*/ ctx[1].contentHashStr - : "") + "")) set_data_dev(t2, t2_value); - - if (dirty & /*$session*/ 2 && t5_value !== (t5_value = JSON.stringify(/*$session*/ ctx[1]) + "")) set_data_dev(t5, t5_value); - if (dirty & /*$nextIndex*/ 4) set_data_dev(t8, /*$nextIndex*/ ctx[2]); - if (dirty & /*$scribeStr*/ 8) set_data_dev(t11, /*$scribeStr*/ ctx[3]); - }, - i: noop, - o: noop, - d: function destroy(detaching) { - if (detaching) detach_dev(div); - if_block.d(); - } - }; - - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_fragment$3.name, - type: "component", - source: "", - ctx - }); - - return block; - } - - function instance$3($$self, $$props, $$invalidate) { - let $connection; - let $session; - let $nextIndex; - let $scribeStr; - let { $$slots: slots = {}, $$scope } = $$props; - validate_slots("Debug", slots, []); - const ctx = getContext("ctx"); - const scribeStr = scribeStr_b(ctx); - validate_store(scribeStr, "scribeStr"); - component_subscribe($$self, scribeStr, value => $$invalidate(3, $scribeStr = value)); - const connection = connection_b(ctx); - validate_store(connection, "connection"); - component_subscribe($$self, connection, value => $$invalidate(0, $connection = value)); - const nextIndex = nextIndex_b(ctx); - validate_store(nextIndex, "nextIndex"); - component_subscribe($$self, nextIndex, value => $$invalidate(2, $nextIndex = value)); - const session = session_b(ctx); - validate_store(session, "session"); - component_subscribe($$self, session, value => $$invalidate(1, $session = value)); - const writable_props = []; - - Object.keys($$props).forEach(key => { - if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<Debug> was created with unknown prop '${key}'`); - }); - - $$self.$capture_state = () => ({ - getContext, - nextIndex_b, - connection_b, - session_b, - scribeStr_b, - ctx, - scribeStr, - connection, - nextIndex, - session, - $connection, - $session, - $nextIndex, - $scribeStr - }); - - return [ - $connection, - $session, - $nextIndex, - $scribeStr, - scribeStr, - connection, - nextIndex, - session - ]; - } - - class Debug extends SvelteComponentDev { - constructor(options) { - super(options); - init(this, options, instance$3, create_fragment$3, safe_not_equal, {}); - - dispatch_dev("SvelteRegisterComponent", { - component: this, - tagName: "Debug", - options, - id: create_fragment$3.name - }); - } - } - - /* src/HistoryEntry.svelte generated by Svelte v3.37.0 */ - - const file$2 = "src/HistoryEntry.svelte"; - - function create_fragment$2(ctx) { - let div; - let t; - let div_class_value; - - const block = { - c: function create() { - div = element("div"); - t = text(/*text*/ ctx[0]); - attr_dev(div, "class", div_class_value = "history-entry " + /*status*/ ctx[1] + " svelte-12sic9q"); - add_location(div, file$2, 27, 0, 441); - }, - l: function claim(nodes) { - throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); - }, - m: function mount(target, anchor) { - insert_dev(target, div, anchor); - append_dev(div, t); - }, - p: function update(ctx, [dirty]) { - if (dirty & /*text*/ 1) set_data_dev(t, /*text*/ ctx[0]); - - if (dirty & /*status*/ 2 && div_class_value !== (div_class_value = "history-entry " + /*status*/ ctx[1] + " svelte-12sic9q")) { - attr_dev(div, "class", div_class_value); - } - }, - i: noop, - o: noop, - d: function destroy(detaching) { - if (detaching) detach_dev(div); - } - }; - - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_fragment$2.name, - type: "component", - source: "", - ctx - }); - - return block; - } - - function instance$2($$self, $$props, $$invalidate) { - let { $$slots: slots = {}, $$scope } = $$props; - validate_slots("HistoryEntry", slots, []); - let { text } = $$props; - let { status } = $$props; - const writable_props = ["text", "status"]; - - Object.keys($$props).forEach(key => { - if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<HistoryEntry> was created with unknown prop '${key}'`); - }); - - $$self.$$set = $$props => { - if ("text" in $$props) $$invalidate(0, text = $$props.text); - if ("status" in $$props) $$invalidate(1, status = $$props.status); - }; - - $$self.$capture_state = () => ({ text, status }); - - $$self.$inject_state = $$props => { - if ("text" in $$props) $$invalidate(0, text = $$props.text); - if ("status" in $$props) $$invalidate(1, status = $$props.status); - }; - - if ($$props && "$$inject" in $$props) { - $$self.$inject_state($$props.$$inject); - } - - return [text, status]; - } - - class HistoryEntry extends SvelteComponentDev { - constructor(options) { - super(options); - init(this, options, instance$2, create_fragment$2, safe_not_equal, { text: 0, status: 1 }); - - dispatch_dev("SvelteRegisterComponent", { - component: this, - tagName: "HistoryEntry", - options, - id: create_fragment$2.name - }); - - const { ctx } = this.$$; - const props = options.props || {}; - - if (/*text*/ ctx[0] === undefined && !("text" in props)) { - console.warn("<HistoryEntry> was created without expected prop 'text'"); - } - - if (/*status*/ ctx[1] === undefined && !("status" in props)) { - console.warn("<HistoryEntry> was created without expected prop 'status'"); - } - } - - get text() { - throw new Error("<HistoryEntry>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"); - } - - set text(value) { - throw new Error("<HistoryEntry>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"); - } - - get status() { - throw new Error("<HistoryEntry>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"); - } - - set status(value) { - throw new Error("<HistoryEntry>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"); - } - } - - /* src/History.svelte generated by Svelte v3.37.0 */ - const file$1 = "src/History.svelte"; - - function get_each_context(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[14] = list[i]; - return child_ctx; - } - - // (72:4) {#each historyEntries as historyEntry} - function create_each_block(ctx) { - let historyentry; - let current; - - historyentry = new HistoryEntry({ - props: { - status: /*historyEntry*/ ctx[14].status, - text: /*historyEntry*/ ctx[14].text - }, - $$inline: true - }); - - const block = { - c: function create() { - create_component(historyentry.$$.fragment); - }, - m: function mount(target, anchor) { - mount_component(historyentry, target, anchor); - current = true; - }, - p: function update(ctx, dirty) { - const historyentry_changes = {}; - if (dirty & /*historyEntries*/ 1) historyentry_changes.status = /*historyEntry*/ ctx[14].status; - if (dirty & /*historyEntries*/ 1) historyentry_changes.text = /*historyEntry*/ ctx[14].text; - historyentry.$set(historyentry_changes); - }, - i: function intro(local) { - if (current) return; - transition_in(historyentry.$$.fragment, local); - current = true; - }, - o: function outro(local) { - transition_out(historyentry.$$.fragment, local); - current = false; - }, - d: function destroy(detaching) { - destroy_component(historyentry, detaching); - } - }; - - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_each_block.name, - type: "each", - source: "(72:4) {#each historyEntries as historyEntry}", - ctx - }); - - return block; - } - - function create_fragment$1(ctx) { - let div1; - let t; - let div0; - let current; - let each_value = /*historyEntries*/ ctx[0]; - validate_each_argument(each_value); - let each_blocks = []; - - for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i)); - } - - const out = i => transition_out(each_blocks[i], 1, 1, () => { - each_blocks[i] = null; - }); - - const block = { - c: function create() { - div1 = element("div"); - t = text("History:\n "); - div0 = element("div"); - - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - - attr_dev(div0, "class", "history-entries svelte-1718ppz"); - add_location(div0, file$1, 70, 2, 2504); - attr_dev(div1, "class", "history svelte-1718ppz"); - add_location(div1, file$1, 68, 0, 2469); - }, - l: function claim(nodes) { - throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); - }, - m: function mount(target, anchor) { - insert_dev(target, div1, anchor); - append_dev(div1, t); - append_dev(div1, div0); - - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].m(div0, null); - } - - current = true; - }, - p: function update(ctx, [dirty]) { - if (dirty & /*historyEntries*/ 1) { - each_value = /*historyEntries*/ ctx[0]; - validate_each_argument(each_value); - let i; - - for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context(ctx, each_value, i); - - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - transition_in(each_blocks[i], 1); - } else { - each_blocks[i] = create_each_block(child_ctx); - each_blocks[i].c(); - transition_in(each_blocks[i], 1); - each_blocks[i].m(div0, null); - } - } - - group_outros(); - - for (i = each_value.length; i < each_blocks.length; i += 1) { - out(i); - } - - check_outros(); - } - }, - i: function intro(local) { - if (current) return; - - for (let i = 0; i < each_value.length; i += 1) { - transition_in(each_blocks[i]); - } - - current = true; - }, - o: function outro(local) { - each_blocks = each_blocks.filter(Boolean); - - for (let i = 0; i < each_blocks.length; i += 1) { - transition_out(each_blocks[i]); - } - - current = false; - }, - d: function destroy(detaching) { - if (detaching) detach_dev(div1); - destroy_each(each_blocks, detaching); - } - }; - - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_fragment$1.name, - type: "component", - source: "", - ctx - }); - - return block; - } - - function instance$1($$self, $$props, $$invalidate) { - let $requestedChanges; - let $recordedChanges; - let $committedChanges; - let { $$slots: slots = {}, $$scope } = $$props; - validate_slots("History", slots, []); - - var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P - ? value - : new P(function (resolve) { - resolve(value); - }); - } - - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch(e) { - reject(e); - } - } - - function rejected(value) { - try { - step(generator["throw"](value)); - } catch(e) { - reject(e); - } - } - - function step(result) { - result.done - ? resolve(result.value) - : adopt(result.value).then(fulfilled, rejected); - } - - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - - const ctx = getContext("ctx"); - const requestedChanges = requestedChanges_b(ctx); - validate_store(requestedChanges, "requestedChanges"); - component_subscribe($$self, requestedChanges, value => $$invalidate(8, $requestedChanges = value)); - const recordedChanges = recordedChanges_b(ctx); - validate_store(recordedChanges, "recordedChanges"); - component_subscribe($$self, recordedChanges, value => $$invalidate(9, $recordedChanges = value)); - const committedChanges = committedChanges_b(ctx); - validate_store(committedChanges, "committedChanges"); - component_subscribe($$self, committedChanges, value => $$invalidate(10, $committedChanges = value)); - let { changeToTextFn } = $$props; - - // returns a list of historyEntry objects with some text - // and a status (for styling) - function changesToEntriesList(changes, status) { - let entriesList = []; - - for (let i = changes.length - 1; i >= 0; i--) { - const text = changeToTextFn(changes[i]); - entriesList.push({ text, status }); - } - - return entriesList; - } - - let requestedH; - let recordedH; - let committedH; - let historyEntries = []; - - // when updating the list, also scroll to the newest historyEntry - afterUpdate(() => __awaiter(void 0, void 0, void 0, function* () { - let entryElem = document.getElementsByClassName("history-entries")[0]; - - if (entryElem.firstChild !== null) { - entryElem.firstChild.scrollIntoView(false); - } - })); - - const writable_props = ["changeToTextFn"]; - - Object.keys($$props).forEach(key => { - if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<History> was created with unknown prop '${key}'`); - }); - - $$self.$$set = $$props => { - if ("changeToTextFn" in $$props) $$invalidate(4, changeToTextFn = $$props.changeToTextFn); - }; - - $$self.$capture_state = () => ({ - __awaiter, - afterUpdate, - getContext, - requestedChanges_b, - recordedChanges_b, - committedChanges_b, - HistoryEntry, - ctx, - requestedChanges, - recordedChanges, - committedChanges, - changeToTextFn, - changesToEntriesList, - requestedH, - recordedH, - committedH, - historyEntries, - $requestedChanges, - $recordedChanges, - $committedChanges - }); - - $$self.$inject_state = $$props => { - if ("__awaiter" in $$props) __awaiter = $$props.__awaiter; - if ("changeToTextFn" in $$props) $$invalidate(4, changeToTextFn = $$props.changeToTextFn); - if ("requestedH" in $$props) $$invalidate(5, requestedH = $$props.requestedH); - if ("recordedH" in $$props) $$invalidate(6, recordedH = $$props.recordedH); - if ("committedH" in $$props) $$invalidate(7, committedH = $$props.committedH); - if ("historyEntries" in $$props) $$invalidate(0, historyEntries = $$props.historyEntries); - }; - - if ($$props && "$$inject" in $$props) { - $$self.$inject_state($$props.$$inject); - } - - $$self.$$.update = () => { - if ($$self.$$.dirty & /*$requestedChanges*/ 256) { - { - $$invalidate(5, requestedH = changesToEntriesList($requestedChanges, "requested")); - } - } - - if ($$self.$$.dirty & /*$recordedChanges*/ 512) { - { - $$invalidate(6, recordedH = changesToEntriesList($recordedChanges, "recorded")); - } - } - - if ($$self.$$.dirty & /*$committedChanges*/ 1024) { - { - $$invalidate(7, committedH = changesToEntriesList($committedChanges, "committed")); - } - } - - if ($$self.$$.dirty & /*requestedH, recordedH, committedH*/ 224) { - { - $$invalidate(0, historyEntries = [...requestedH, ...recordedH, ...committedH]); - } - } - }; - - return [ - historyEntries, - requestedChanges, - recordedChanges, - committedChanges, - changeToTextFn, - requestedH, - recordedH, - committedH, - $requestedChanges, - $recordedChanges, - $committedChanges - ]; - } - - class History extends SvelteComponentDev { - constructor(options) { - super(options); - init(this, options, instance$1, create_fragment$1, safe_not_equal, { changeToTextFn: 4 }); - - dispatch_dev("SvelteRegisterComponent", { - component: this, - tagName: "History", - options, - id: create_fragment$1.name - }); - - const { ctx } = this.$$; - const props = options.props || {}; - - if (/*changeToTextFn*/ ctx[4] === undefined && !("changeToTextFn" in props)) { - console.warn("<History> was created without expected prop 'changeToTextFn'"); - } - } - - get changeToTextFn() { - throw new Error("<History>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"); - } - - set changeToTextFn(value) { - throw new Error("<History>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"); - } - } - - /* src/App.svelte generated by Svelte v3.37.0 */ - - const { document: document_1 } = globals; - const file = "src/App.svelte"; - - function create_fragment(ctx) { - let script; - let script_src_value; - let t0; - let div1; - let h1; - let t2; - let div0; - let title; - let t3; - let main; - let div2; - let editor; - let t4; - let syn_1; - let t5; - let div3; - let folks; - let t6; - let div5; - let div4; - let i; - let i_class_value; - let t7; - let div8; - let div6; - let t8; - let div7; - let history; - let t9; - let debug_1; - let current; - let mounted; - let dispose; - title = new Title({ $$inline: true }); - title.$on("requestChange", /*requestChange_handler*/ ctx[14]); - editor = new Editor({ $$inline: true }); - editor.$on("requestChange", /*requestChange_handler_1*/ ctx[15]); - let syn_1_props = { applyDeltaFn: applyDelta, undoFn: undo }; - syn_1 = new Syn({ props: syn_1_props, $$inline: true }); - /*syn_1_binding*/ ctx[16](syn_1); - folks = new Folks({ $$inline: true }); - - history = new History({ - props: { changeToTextFn: changeToText }, - $$inline: true - }); - - debug_1 = new Debug({ $$inline: true }); - - const block = { - c: function create() { - script = element("script"); - t0 = space(); - div1 = element("div"); - h1 = element("h1"); - h1.textContent = "SynText"; - t2 = space(); - div0 = element("div"); - create_component(title.$$.fragment); - t3 = space(); - main = element("main"); - div2 = element("div"); - create_component(editor.$$.fragment); - t4 = space(); - create_component(syn_1.$$.fragment); - t5 = space(); - div3 = element("div"); - create_component(folks.$$.fragment); - t6 = space(); - div5 = element("div"); - div4 = element("div"); - i = element("i"); - t7 = space(); - div8 = element("div"); - div6 = element("div"); - t8 = space(); - div7 = element("div"); - create_component(history.$$.fragment); - t9 = space(); - create_component(debug_1.$$.fragment); - if (script.src !== (script_src_value = "https://kit.fontawesome.com/80d72fa568.js")) attr_dev(script, "src", script_src_value); - attr_dev(script, "crossorigin", "anonymous"); - add_location(script, file, 280, 2, 7198); - attr_dev(h1, "class", "svelte-hss0sb"); - add_location(h1, file, 284, 2, 7328); - toggle_class(div0, "noscribe", /*noscribe*/ ctx[5]); - add_location(div0, file, 285, 0, 7345); - attr_dev(div1, "class", "toolbar svelte-hss0sb"); - add_location(div1, file, 283, 0, 7304); - toggle_class(div2, "noscribe", /*noscribe*/ ctx[5]); - add_location(div2, file, 290, 0, 7462); - attr_dev(main, "class", "svelte-hss0sb"); - add_location(main, file, 289, 0, 7455); - attr_dev(div3, "class", "folks-tray svelte-hss0sb"); - add_location(div3, file, 298, 0, 7638); - - attr_dev(i, "class", i_class_value = "tab-icon fas " + (/*drawerHidden*/ ctx[3] - ? "fa-chevron-up" - : "fa-chevron-down") + " svelte-hss0sb"); - - toggle_class(i, "drawer-hidden", /*drawerHidden*/ ctx[3]); - add_location(i, file, 305, 4, 7918); - attr_dev(div4, "class", "tab-inner svelte-hss0sb"); - toggle_class(div4, "shown", /*tabShown*/ ctx[4]); - add_location(div4, file, 304, 2, 7813); - attr_dev(div5, "class", "tab svelte-hss0sb"); - toggle_class(div5, "shown", /*tabShown*/ ctx[4]); - toggle_class(div5, "drawer-hidden", /*drawerHidden*/ ctx[3]); - add_location(div5, file, 302, 0, 7682); - attr_dev(div6, "class", "handle svelte-hss0sb"); - add_location(div6, file, 310, 2, 8203); - attr_dev(div7, "class", "debug-content svelte-hss0sb"); - add_location(div7, file, 311, 2, 8286); - attr_dev(div8, "class", "debug-drawer svelte-hss0sb"); - toggle_class(div8, "hidden", /*drawerHidden*/ ctx[3]); - add_location(div8, file, 308, 0, 8051); - }, - l: function claim(nodes) { - throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); - }, - m: function mount(target, anchor) { - append_dev(document_1.head, script); - insert_dev(target, t0, anchor); - insert_dev(target, div1, anchor); - append_dev(div1, h1); - append_dev(div1, t2); - append_dev(div1, div0); - mount_component(title, div0, null); - insert_dev(target, t3, anchor); - insert_dev(target, main, anchor); - append_dev(main, div2); - mount_component(editor, div2, null); - append_dev(main, t4); - mount_component(syn_1, main, null); - insert_dev(target, t5, anchor); - insert_dev(target, div3, anchor); - mount_component(folks, div3, null); - insert_dev(target, t6, anchor); - insert_dev(target, div5, anchor); - append_dev(div5, div4); - append_dev(div4, i); - insert_dev(target, t7, anchor); - insert_dev(target, div8, anchor); - append_dev(div8, div6); - /*div6_binding*/ ctx[17](div6); - append_dev(div8, t8); - append_dev(div8, div7); - mount_component(history, div7, null); - append_dev(div7, t9); - mount_component(debug_1, div7, null); - /*div8_binding*/ ctx[18](div8); - current = true; - - if (!mounted) { - dispose = [ - listen_dev( - div4, - "click", - function () { - if (is_function(/*drawerHidden*/ ctx[3] - ? /*showDrawer*/ ctx[10]() - : /*hideDrawer*/ ctx[9]())) (/*drawerHidden*/ ctx[3] - ? /*showDrawer*/ ctx[10]() - : /*hideDrawer*/ ctx[9]()).apply(this, arguments); - }, - false, - false, - false - ), - listen_dev(div5, "mouseenter", /*showTab*/ ctx[11], false, false, false), - listen_dev(div5, "mouseleave", /*hideTab*/ ctx[12], false, false, false), - listen_dev(div6, "mousedown", /*startDragging*/ ctx[8], false, false, false), - action_destroyer(/*initResizeable*/ ctx[7].call(null, div8)), - listen_dev(div8, "mouseenter", /*showTab*/ ctx[11], false, false, false), - listen_dev(div8, "mouseleave", /*hideTab*/ ctx[12], false, false, false) - ]; - - mounted = true; - } - }, - p: function update(new_ctx, [dirty]) { - ctx = new_ctx; - - if (dirty & /*noscribe*/ 32) { - toggle_class(div0, "noscribe", /*noscribe*/ ctx[5]); - } - - if (dirty & /*noscribe*/ 32) { - toggle_class(div2, "noscribe", /*noscribe*/ ctx[5]); - } - - const syn_1_changes = {}; - syn_1.$set(syn_1_changes); - - if (!current || dirty & /*drawerHidden*/ 8 && i_class_value !== (i_class_value = "tab-icon fas " + (/*drawerHidden*/ ctx[3] - ? "fa-chevron-up" - : "fa-chevron-down") + " svelte-hss0sb")) { - attr_dev(i, "class", i_class_value); - } - - if (dirty & /*drawerHidden, drawerHidden*/ 8) { - toggle_class(i, "drawer-hidden", /*drawerHidden*/ ctx[3]); - } - - if (dirty & /*tabShown*/ 16) { - toggle_class(div4, "shown", /*tabShown*/ ctx[4]); - } - - if (dirty & /*tabShown*/ 16) { - toggle_class(div5, "shown", /*tabShown*/ ctx[4]); - } - - if (dirty & /*drawerHidden*/ 8) { - toggle_class(div5, "drawer-hidden", /*drawerHidden*/ ctx[3]); - } - - if (dirty & /*drawerHidden*/ 8) { - toggle_class(div8, "hidden", /*drawerHidden*/ ctx[3]); - } - }, - i: function intro(local) { - if (current) return; - transition_in(title.$$.fragment, local); - transition_in(editor.$$.fragment, local); - transition_in(syn_1.$$.fragment, local); - transition_in(folks.$$.fragment, local); - transition_in(history.$$.fragment, local); - transition_in(debug_1.$$.fragment, local); - current = true; - }, - o: function outro(local) { - transition_out(title.$$.fragment, local); - transition_out(editor.$$.fragment, local); - transition_out(syn_1.$$.fragment, local); - transition_out(folks.$$.fragment, local); - transition_out(history.$$.fragment, local); - transition_out(debug_1.$$.fragment, local); - current = false; - }, - d: function destroy(detaching) { - detach_dev(script); - if (detaching) detach_dev(t0); - if (detaching) detach_dev(div1); - destroy_component(title); - if (detaching) detach_dev(t3); - if (detaching) detach_dev(main); - destroy_component(editor); - /*syn_1_binding*/ ctx[16](null); - destroy_component(syn_1); - if (detaching) detach_dev(t5); - if (detaching) detach_dev(div3); - destroy_component(folks); - if (detaching) detach_dev(t6); - if (detaching) detach_dev(div5); - if (detaching) detach_dev(t7); - if (detaching) detach_dev(div8); - /*div6_binding*/ ctx[17](null); - destroy_component(history); - destroy_component(debug_1); - /*div8_binding*/ ctx[18](null); - mounted = false; - run_all(dispose); - } - }; - - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_fragment.name, - type: "component", - source: "", - ctx - }); - - return block; - } - - const minDrawerSize = 0; - - // definition of how to apply a delta to the content - // if the delta is destructive also returns what was - // destroyed for use by undo - function applyDelta(content, in_delta) { - switch (in_delta.type) { - case "Title": - { - const deleted = content.title; - const delta = in_delta; - content.title = delta.value; - return [content, { delta, deleted }]; - } - case "Add": - { - const delta = in_delta; - const [loc, text] = delta.value; - content.body = content.body.slice(0, loc) + text + content.body.slice(loc); - return [content, { delta }]; - } - case "Delete": - { - const delta = in_delta; - const [start, end] = delta.value; - const deleted = content.body.slice(start, end); - content.body = content.body.slice(0, start) + content.body.slice(end); - return [content, { delta, deleted }]; - } - case "Meta": - { - const delta = in_delta; - const [tag, loc] = delta.value.setLoc; - const deleted = [tag, content.meta[tag]]; - content.meta[tag] = loc; - return [content, { delta, deleted }]; - } - } - } - - // definition of how to undo a change, returns a delta that will undo the change - function undo(change) { - const delta = change.delta; - - switch (delta.type) { - case "Title": - return { type: "Title", value: change.deleted }; - case "Add": - const [loc, text] = delta.value; - return { - type: "Delete", - value: [loc, loc + text.length] - }; - case "Delete": - const [start, end] = delta.value; - return { - type: "Add", - value: [start, change.deleted] - }; - case "Meta": - return { - type: "Meta", - value: { setLoc: change.deleted } - }; - } - } - - // definition of how to convert a change to text for the history renderer - function changeToText(change) { - let delta = change.delta; - let detail; - - switch (delta.type) { - case "Add": - detail = `${delta.value[1]}@${delta.value[0]}`; - break; - case "Delete": - detail = `${change.deleted}@${delta.value[0]}`; - break; - case "Title": - detail = `${change.deleted}->${delta.value}`; - break; - case "Meta": - detail = ""; - } - - return `${delta.type}:\n${detail}`; - } - - function instance($$self, $$props, $$invalidate) { - let disconnected; - let noscribe; - let $scribeStr; - let { $$slots: slots = {}, $$scope } = $$props; - validate_slots("App", slots, []); - - - let ctx = {}; - setContext("ctx", ctx); - const scribeStr = scribeStr_b(ctx); - validate_store(scribeStr, "scribeStr"); - component_subscribe($$self, scribeStr, value => $$invalidate(13, $scribeStr = value)); - let syn; - - // The debug drawer's ability to resized and hidden - let resizeable; - - let resizeHandle; - const maxDrawerSize = document.documentElement.clientHeight - 30 - 10; - - const initResizeable = resizeableEl => { - resizeableEl.style.setProperty("--max-height", `${maxDrawerSize}px`); - resizeableEl.style.setProperty("--min-height", `${minDrawerSize}px`); - }; - - const setDrawerHeight = height => { - document.documentElement.style.setProperty("--resizeable-height", `${height}px`); - }; - - const getDrawerHeight = () => { - const pxHeight = getComputedStyle(resizeable).getPropertyValue("--resizeable-height"); - return parseInt(pxHeight, 10); - }; - - const startDragging = event => { - event.preventDefault(); - const startingDrawerHeight = getDrawerHeight(); - const yOffset = event.pageY; - - const mouseDragHandler = moveEvent => { - moveEvent.preventDefault(); - const primaryButtonPressed = moveEvent.buttons === 1; - - if (!primaryButtonPressed) { - setDrawerHeight(Math.min(Math.max(getDrawerHeight(), minDrawerSize), maxDrawerSize)); - window.removeEventListener("pointermove", mouseDragHandler); - return; - } - - setDrawerHeight(Math.min(Math.max(yOffset - moveEvent.pageY + startingDrawerHeight, minDrawerSize), maxDrawerSize)); - }; - - window.addEventListener("pointermove", mouseDragHandler); - }; - - let drawerHidden = false; - - const hideDrawer = () => { - $$invalidate(3, drawerHidden = true); - }; - - const showDrawer = () => { - $$invalidate(3, drawerHidden = false); - }; - - let tabShown = false; - - const showTab = () => { - $$invalidate(4, tabShown = true); - }; - - const hideTab = () => { - $$invalidate(4, tabShown = false); - }; - - const writable_props = []; - - Object.keys($$props).forEach(key => { - if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<App> was created with unknown prop '${key}'`); - }); - - const requestChange_handler = event => syn.requestChange(event.detail); - const requestChange_handler_1 = event => syn.requestChange(event.detail); - - function syn_1_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - syn = $$value; - $$invalidate(0, syn); - }); - } - - function div6_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - resizeHandle = $$value; - $$invalidate(2, resizeHandle); - }); - } - - function div8_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - resizeable = $$value; - $$invalidate(1, resizeable); - }); - } - - $$self.$capture_state = () => ({ - setContext, - Editor, - Title, - Folks, - Syn, - Debug, - History, - scribeStr_b, - ctx, - scribeStr, - applyDelta, - undo, - changeToText, - syn, - resizeable, - resizeHandle, - minDrawerSize, - maxDrawerSize, - initResizeable, - setDrawerHeight, - getDrawerHeight, - startDragging, - drawerHidden, - hideDrawer, - showDrawer, - tabShown, - showTab, - hideTab, - disconnected, - noscribe, - $scribeStr - }); - - $$self.$inject_state = $$props => { - if ("ctx" in $$props) ctx = $$props.ctx; - if ("syn" in $$props) $$invalidate(0, syn = $$props.syn); - if ("resizeable" in $$props) $$invalidate(1, resizeable = $$props.resizeable); - if ("resizeHandle" in $$props) $$invalidate(2, resizeHandle = $$props.resizeHandle); - if ("drawerHidden" in $$props) $$invalidate(3, drawerHidden = $$props.drawerHidden); - if ("tabShown" in $$props) $$invalidate(4, tabShown = $$props.tabShown); - if ("disconnected" in $$props) disconnected = $$props.disconnected; - if ("noscribe" in $$props) $$invalidate(5, noscribe = $$props.noscribe); - }; - - if ($$props && "$$inject" in $$props) { - $$self.$inject_state($$props.$$inject); - } - - $$self.$$.update = () => { - if ($$self.$$.dirty & /*$scribeStr*/ 8192) { - $$invalidate(5, noscribe = $scribeStr === ""); - } - }; - - disconnected = false; - - return [ - syn, - resizeable, - resizeHandle, - drawerHidden, - tabShown, - noscribe, - scribeStr, - initResizeable, - startDragging, - hideDrawer, - showDrawer, - showTab, - hideTab, - $scribeStr, - requestChange_handler, - requestChange_handler_1, - syn_1_binding, - div6_binding, - div8_binding - ]; - } - - class App extends SvelteComponentDev { - constructor(options) { - super(options); - init(this, options, instance, create_fragment, safe_not_equal, {}); - - dispatch_dev("SvelteRegisterComponent", { - component: this, - tagName: "App", - options, - id: create_fragment.name - }); - } - } - - const app = new App({ - target: document.body, - props: {} - }); - - return app; - -}()); -//# sourceMappingURL=main.js.map diff --git a/ui/apps/app/public/build/main.js.map b/ui/apps/app/public/build/main.js.map deleted file mode 100644 index 2f473906..00000000 --- a/ui/apps/app/public/build/main.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"main.js","sources":["../../node_modules/svelte/internal/index.mjs","../../node_modules/@holochain/conductor-api/lib/api/admin.js","../../node_modules/@holochain/conductor-api/lib/api/app.js","../../node_modules/@holochain/conductor-api/lib/api/types.js","../../node_modules/isomorphic-ws/browser.js","../../node_modules/@msgpack/msgpack/dist.es5+esm/utils/utf8.mjs","../../node_modules/@msgpack/msgpack/dist.es5+esm/ExtData.mjs","../../node_modules/@msgpack/msgpack/dist.es5+esm/utils/int.mjs","../../node_modules/@msgpack/msgpack/dist.es5+esm/timestamp.mjs","../../node_modules/@msgpack/msgpack/dist.es5+esm/ExtensionCodec.mjs","../../node_modules/@msgpack/msgpack/dist.es5+esm/utils/typedArrays.mjs","../../node_modules/@msgpack/msgpack/dist.es5+esm/Encoder.mjs","../../node_modules/@msgpack/msgpack/dist.es5+esm/encode.mjs","../../node_modules/tslib/tslib.es6.js","../../node_modules/@msgpack/msgpack/dist.es5+esm/utils/prettyByte.mjs","../../node_modules/@msgpack/msgpack/dist.es5+esm/CachedKeyDecoder.mjs","../../node_modules/@msgpack/msgpack/dist.es5+esm/Decoder.mjs","../../node_modules/@msgpack/msgpack/dist.es5+esm/decode.mjs","../../node_modules/@msgpack/msgpack/dist.es5+esm/utils/stream.mjs","../../node_modules/@msgpack/msgpack/dist.es5+esm/decodeAsync.mjs","../../node_modules/@msgpack/msgpack/dist.es5+esm/index.mjs","../../node_modules/@holochain/conductor-api/lib/websocket/client.js","../../node_modules/@holochain/conductor-api/lib/websocket/common.js","../../node_modules/@holochain/conductor-api/lib/api/common.js","../../node_modules/@holochain/conductor-api/lib/websocket/admin.js","../../node_modules/@holochain/conductor-api/lib/websocket/app.js","../../node_modules/@holochain/conductor-api/lib/index.js","../../node_modules/@ctx-core/object/src/assign.js","../../node_modules/@ctx-core/object/src/_be.js","../../node_modules/@ctx-core/object/src/keys.js","../../node_modules/@ctx-core/object/src/isArray.js","../../node_modules/@ctx-core/object/src/values.js","../../node_modules/@ctx-core/array/src/_tuple.js","../../node_modules/svelte/store/index.mjs","../../node_modules/@ctx-core/store/src/get.js","../../node_modules/@ctx-core/store/src/derived.js","../../src/content/content_b.ts","../../src/delta/committedChanges_b.ts","../../src/delta/recordedChanges_b.ts","../../src/delta/nextIndex_b.ts","../../src/delta/requestedChanges_b.ts","../../src/utils.ts","../../src/colors.ts","../../src/folk/folks_b.ts","../../src/scribe/scribeStr_b.ts","../../src/folk/Folk.svelte","../../src/folk/Folks.svelte","../../src/folk/Folk.ts","../../src/session/Session.ts","../../src/session/session_b.ts","../../src/Zome.ts","../../src/Syn.ts","../../src/connection/Connection.ts","../../src/connection/connection_b.ts","../../src/Editor.svelte","../../src/Title.svelte","../../src/Syn.svelte","../../src/Debug.svelte","../../src/HistoryEntry.svelte","../../src/History.svelte","../../src/App.svelte","../../src/main.ts"],"sourcesContent":["function noop() { }\nconst identity = x => x;\nfunction assign(tar, src) {\n // @ts-ignore\n for (const k in src)\n tar[k] = src[k];\n return tar;\n}\nfunction is_promise(value) {\n return value && typeof value === 'object' && typeof value.then === 'function';\n}\nfunction add_location(element, file, line, column, char) {\n element.__svelte_meta = {\n loc: { file, line, column, char }\n };\n}\nfunction run(fn) {\n return fn();\n}\nfunction blank_object() {\n return Object.create(null);\n}\nfunction run_all(fns) {\n fns.forEach(run);\n}\nfunction is_function(thing) {\n return typeof thing === 'function';\n}\nfunction safe_not_equal(a, b) {\n return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');\n}\nfunction not_equal(a, b) {\n return a != a ? b == b : a !== b;\n}\nfunction is_empty(obj) {\n return Object.keys(obj).length === 0;\n}\nfunction validate_store(store, name) {\n if (store != null && typeof store.subscribe !== 'function') {\n throw new Error(`'${name}' is not a store with a 'subscribe' method`);\n }\n}\nfunction subscribe(store, ...callbacks) {\n if (store == null) {\n return noop;\n }\n const unsub = store.subscribe(...callbacks);\n return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;\n}\nfunction get_store_value(store) {\n let value;\n subscribe(store, _ => value = _)();\n return value;\n}\nfunction component_subscribe(component, store, callback) {\n component.$$.on_destroy.push(subscribe(store, callback));\n}\nfunction create_slot(definition, ctx, $$scope, fn) {\n if (definition) {\n const slot_ctx = get_slot_context(definition, ctx, $$scope, fn);\n return definition[0](slot_ctx);\n }\n}\nfunction get_slot_context(definition, ctx, $$scope, fn) {\n return definition[1] && fn\n ? assign($$scope.ctx.slice(), definition[1](fn(ctx)))\n : $$scope.ctx;\n}\nfunction get_slot_changes(definition, $$scope, dirty, fn) {\n if (definition[2] && fn) {\n const lets = definition[2](fn(dirty));\n if ($$scope.dirty === undefined) {\n return lets;\n }\n if (typeof lets === 'object') {\n const merged = [];\n const len = Math.max($$scope.dirty.length, lets.length);\n for (let i = 0; i < len; i += 1) {\n merged[i] = $$scope.dirty[i] | lets[i];\n }\n return merged;\n }\n return $$scope.dirty | lets;\n }\n return $$scope.dirty;\n}\nfunction update_slot(slot, slot_definition, ctx, $$scope, dirty, get_slot_changes_fn, get_slot_context_fn) {\n const slot_changes = get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn);\n if (slot_changes) {\n const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);\n slot.p(slot_context, slot_changes);\n }\n}\nfunction update_slot_spread(slot, slot_definition, ctx, $$scope, dirty, get_slot_changes_fn, get_slot_spread_changes_fn, get_slot_context_fn) {\n const slot_changes = get_slot_spread_changes_fn(dirty) | get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn);\n if (slot_changes) {\n const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);\n slot.p(slot_context, slot_changes);\n }\n}\nfunction exclude_internal_props(props) {\n const result = {};\n for (const k in props)\n if (k[0] !== '$')\n result[k] = props[k];\n return result;\n}\nfunction compute_rest_props(props, keys) {\n const rest = {};\n keys = new Set(keys);\n for (const k in props)\n if (!keys.has(k) && k[0] !== '$')\n rest[k] = props[k];\n return rest;\n}\nfunction compute_slots(slots) {\n const result = {};\n for (const key in slots) {\n result[key] = true;\n }\n return result;\n}\nfunction once(fn) {\n let ran = false;\n return function (...args) {\n if (ran)\n return;\n ran = true;\n fn.call(this, ...args);\n };\n}\nfunction null_to_empty(value) {\n return value == null ? '' : value;\n}\nfunction set_store_value(store, ret, value = ret) {\n store.set(value);\n return ret;\n}\nconst has_prop = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);\nfunction action_destroyer(action_result) {\n return action_result && is_function(action_result.destroy) ? action_result.destroy : noop;\n}\n\nconst is_client = typeof window !== 'undefined';\nlet now = is_client\n ? () => window.performance.now()\n : () => Date.now();\nlet raf = is_client ? cb => requestAnimationFrame(cb) : noop;\n// used internally for testing\nfunction set_now(fn) {\n now = fn;\n}\nfunction set_raf(fn) {\n raf = fn;\n}\n\nconst tasks = new Set();\nfunction run_tasks(now) {\n tasks.forEach(task => {\n if (!task.c(now)) {\n tasks.delete(task);\n task.f();\n }\n });\n if (tasks.size !== 0)\n raf(run_tasks);\n}\n/**\n * For testing purposes only!\n */\nfunction clear_loops() {\n tasks.clear();\n}\n/**\n * Creates a new task that runs on each raf frame\n * until it returns a falsy value or is aborted\n */\nfunction loop(callback) {\n let task;\n if (tasks.size === 0)\n raf(run_tasks);\n return {\n promise: new Promise(fulfill => {\n tasks.add(task = { c: callback, f: fulfill });\n }),\n abort() {\n tasks.delete(task);\n }\n };\n}\n\nfunction append(target, node) {\n target.appendChild(node);\n}\nfunction insert(target, node, anchor) {\n target.insertBefore(node, anchor || null);\n}\nfunction detach(node) {\n node.parentNode.removeChild(node);\n}\nfunction destroy_each(iterations, detaching) {\n for (let i = 0; i < iterations.length; i += 1) {\n if (iterations[i])\n iterations[i].d(detaching);\n }\n}\nfunction element(name) {\n return document.createElement(name);\n}\nfunction element_is(name, is) {\n return document.createElement(name, { is });\n}\nfunction object_without_properties(obj, exclude) {\n const target = {};\n for (const k in obj) {\n if (has_prop(obj, k)\n // @ts-ignore\n && exclude.indexOf(k) === -1) {\n // @ts-ignore\n target[k] = obj[k];\n }\n }\n return target;\n}\nfunction svg_element(name) {\n return document.createElementNS('http://www.w3.org/2000/svg', name);\n}\nfunction text(data) {\n return document.createTextNode(data);\n}\nfunction space() {\n return text(' ');\n}\nfunction empty() {\n return text('');\n}\nfunction listen(node, event, handler, options) {\n node.addEventListener(event, handler, options);\n return () => node.removeEventListener(event, handler, options);\n}\nfunction prevent_default(fn) {\n return function (event) {\n event.preventDefault();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction stop_propagation(fn) {\n return function (event) {\n event.stopPropagation();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction self(fn) {\n return function (event) {\n // @ts-ignore\n if (event.target === this)\n fn.call(this, event);\n };\n}\nfunction attr(node, attribute, value) {\n if (value == null)\n node.removeAttribute(attribute);\n else if (node.getAttribute(attribute) !== value)\n node.setAttribute(attribute, value);\n}\nfunction set_attributes(node, attributes) {\n // @ts-ignore\n const descriptors = Object.getOwnPropertyDescriptors(node.__proto__);\n for (const key in attributes) {\n if (attributes[key] == null) {\n node.removeAttribute(key);\n }\n else if (key === 'style') {\n node.style.cssText = attributes[key];\n }\n else if (key === '__value') {\n node.value = node[key] = attributes[key];\n }\n else if (descriptors[key] && descriptors[key].set) {\n node[key] = attributes[key];\n }\n else {\n attr(node, key, attributes[key]);\n }\n }\n}\nfunction set_svg_attributes(node, attributes) {\n for (const key in attributes) {\n attr(node, key, attributes[key]);\n }\n}\nfunction set_custom_element_data(node, prop, value) {\n if (prop in node) {\n node[prop] = value;\n }\n else {\n attr(node, prop, value);\n }\n}\nfunction xlink_attr(node, attribute, value) {\n node.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);\n}\nfunction get_binding_group_value(group, __value, checked) {\n const value = new Set();\n for (let i = 0; i < group.length; i += 1) {\n if (group[i].checked)\n value.add(group[i].__value);\n }\n if (!checked) {\n value.delete(__value);\n }\n return Array.from(value);\n}\nfunction to_number(value) {\n return value === '' ? null : +value;\n}\nfunction time_ranges_to_array(ranges) {\n const array = [];\n for (let i = 0; i < ranges.length; i += 1) {\n array.push({ start: ranges.start(i), end: ranges.end(i) });\n }\n return array;\n}\nfunction children(element) {\n return Array.from(element.childNodes);\n}\nfunction claim_element(nodes, name, attributes, svg) {\n for (let i = 0; i < nodes.length; i += 1) {\n const node = nodes[i];\n if (node.nodeName === name) {\n let j = 0;\n const remove = [];\n while (j < node.attributes.length) {\n const attribute = node.attributes[j++];\n if (!attributes[attribute.name]) {\n remove.push(attribute.name);\n }\n }\n for (let k = 0; k < remove.length; k++) {\n node.removeAttribute(remove[k]);\n }\n return nodes.splice(i, 1)[0];\n }\n }\n return svg ? svg_element(name) : element(name);\n}\nfunction claim_text(nodes, data) {\n for (let i = 0; i < nodes.length; i += 1) {\n const node = nodes[i];\n if (node.nodeType === 3) {\n node.data = '' + data;\n return nodes.splice(i, 1)[0];\n }\n }\n return text(data);\n}\nfunction claim_space(nodes) {\n return claim_text(nodes, ' ');\n}\nfunction set_data(text, data) {\n data = '' + data;\n if (text.wholeText !== data)\n text.data = data;\n}\nfunction set_input_value(input, value) {\n input.value = value == null ? '' : value;\n}\nfunction set_input_type(input, type) {\n try {\n input.type = type;\n }\n catch (e) {\n // do nothing\n }\n}\nfunction set_style(node, key, value, important) {\n node.style.setProperty(key, value, important ? 'important' : '');\n}\nfunction select_option(select, value) {\n for (let i = 0; i < select.options.length; i += 1) {\n const option = select.options[i];\n if (option.__value === value) {\n option.selected = true;\n return;\n }\n }\n}\nfunction select_options(select, value) {\n for (let i = 0; i < select.options.length; i += 1) {\n const option = select.options[i];\n option.selected = ~value.indexOf(option.__value);\n }\n}\nfunction select_value(select) {\n const selected_option = select.querySelector(':checked') || select.options[0];\n return selected_option && selected_option.__value;\n}\nfunction select_multiple_value(select) {\n return [].map.call(select.querySelectorAll(':checked'), option => option.__value);\n}\n// unfortunately this can't be a constant as that wouldn't be tree-shakeable\n// so we cache the result instead\nlet crossorigin;\nfunction is_crossorigin() {\n if (crossorigin === undefined) {\n crossorigin = false;\n try {\n if (typeof window !== 'undefined' && window.parent) {\n void window.parent.document;\n }\n }\n catch (error) {\n crossorigin = true;\n }\n }\n return crossorigin;\n}\nfunction add_resize_listener(node, fn) {\n const computed_style = getComputedStyle(node);\n if (computed_style.position === 'static') {\n node.style.position = 'relative';\n }\n const iframe = element('iframe');\n iframe.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; ' +\n 'overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;');\n iframe.setAttribute('aria-hidden', 'true');\n iframe.tabIndex = -1;\n const crossorigin = is_crossorigin();\n let unsubscribe;\n if (crossorigin) {\n iframe.src = \"data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}</script>\";\n unsubscribe = listen(window, 'message', (event) => {\n if (event.source === iframe.contentWindow)\n fn();\n });\n }\n else {\n iframe.src = 'about:blank';\n iframe.onload = () => {\n unsubscribe = listen(iframe.contentWindow, 'resize', fn);\n };\n }\n append(node, iframe);\n return () => {\n if (crossorigin) {\n unsubscribe();\n }\n else if (unsubscribe && iframe.contentWindow) {\n unsubscribe();\n }\n detach(iframe);\n };\n}\nfunction toggle_class(element, name, toggle) {\n element.classList[toggle ? 'add' : 'remove'](name);\n}\nfunction custom_event(type, detail) {\n const e = document.createEvent('CustomEvent');\n e.initCustomEvent(type, false, false, detail);\n return e;\n}\nfunction query_selector_all(selector, parent = document.body) {\n return Array.from(parent.querySelectorAll(selector));\n}\nclass HtmlTag {\n constructor(anchor = null) {\n this.a = anchor;\n this.e = this.n = null;\n }\n m(html, target, anchor = null) {\n if (!this.e) {\n this.e = element(target.nodeName);\n this.t = target;\n this.h(html);\n }\n this.i(anchor);\n }\n h(html) {\n this.e.innerHTML = html;\n this.n = Array.from(this.e.childNodes);\n }\n i(anchor) {\n for (let i = 0; i < this.n.length; i += 1) {\n insert(this.t, this.n[i], anchor);\n }\n }\n p(html) {\n this.d();\n this.h(html);\n this.i(this.a);\n }\n d() {\n this.n.forEach(detach);\n }\n}\nfunction attribute_to_object(attributes) {\n const result = {};\n for (const attribute of attributes) {\n result[attribute.name] = attribute.value;\n }\n return result;\n}\nfunction get_custom_elements_slots(element) {\n const result = {};\n element.childNodes.forEach((node) => {\n result[node.slot || 'default'] = true;\n });\n return result;\n}\n\nconst active_docs = new Set();\nlet active = 0;\n// https://github.com/darkskyapp/string-hash/blob/master/index.js\nfunction hash(str) {\n let hash = 5381;\n let i = str.length;\n while (i--)\n hash = ((hash << 5) - hash) ^ str.charCodeAt(i);\n return hash >>> 0;\n}\nfunction create_rule(node, a, b, duration, delay, ease, fn, uid = 0) {\n const step = 16.666 / duration;\n let keyframes = '{\\n';\n for (let p = 0; p <= 1; p += step) {\n const t = a + (b - a) * ease(p);\n keyframes += p * 100 + `%{${fn(t, 1 - t)}}\\n`;\n }\n const rule = keyframes + `100% {${fn(b, 1 - b)}}\\n}`;\n const name = `__svelte_${hash(rule)}_${uid}`;\n const doc = node.ownerDocument;\n active_docs.add(doc);\n const stylesheet = doc.__svelte_stylesheet || (doc.__svelte_stylesheet = doc.head.appendChild(element('style')).sheet);\n const current_rules = doc.__svelte_rules || (doc.__svelte_rules = {});\n if (!current_rules[name]) {\n current_rules[name] = true;\n stylesheet.insertRule(`@keyframes ${name} ${rule}`, stylesheet.cssRules.length);\n }\n const animation = node.style.animation || '';\n node.style.animation = `${animation ? `${animation}, ` : ''}${name} ${duration}ms linear ${delay}ms 1 both`;\n active += 1;\n return name;\n}\nfunction delete_rule(node, name) {\n const previous = (node.style.animation || '').split(', ');\n const next = previous.filter(name\n ? anim => anim.indexOf(name) < 0 // remove specific animation\n : anim => anim.indexOf('__svelte') === -1 // remove all Svelte animations\n );\n const deleted = previous.length - next.length;\n if (deleted) {\n node.style.animation = next.join(', ');\n active -= deleted;\n if (!active)\n clear_rules();\n }\n}\nfunction clear_rules() {\n raf(() => {\n if (active)\n return;\n active_docs.forEach(doc => {\n const stylesheet = doc.__svelte_stylesheet;\n let i = stylesheet.cssRules.length;\n while (i--)\n stylesheet.deleteRule(i);\n doc.__svelte_rules = {};\n });\n active_docs.clear();\n });\n}\n\nfunction create_animation(node, from, fn, params) {\n if (!from)\n return noop;\n const to = node.getBoundingClientRect();\n if (from.left === to.left && from.right === to.right && from.top === to.top && from.bottom === to.bottom)\n return noop;\n const { delay = 0, duration = 300, easing = identity, \n // @ts-ignore todo: should this be separated from destructuring? Or start/end added to public api and documentation?\n start: start_time = now() + delay, \n // @ts-ignore todo:\n end = start_time + duration, tick = noop, css } = fn(node, { from, to }, params);\n let running = true;\n let started = false;\n let name;\n function start() {\n if (css) {\n name = create_rule(node, 0, 1, duration, delay, easing, css);\n }\n if (!delay) {\n started = true;\n }\n }\n function stop() {\n if (css)\n delete_rule(node, name);\n running = false;\n }\n loop(now => {\n if (!started && now >= start_time) {\n started = true;\n }\n if (started && now >= end) {\n tick(1, 0);\n stop();\n }\n if (!running) {\n return false;\n }\n if (started) {\n const p = now - start_time;\n const t = 0 + 1 * easing(p / duration);\n tick(t, 1 - t);\n }\n return true;\n });\n start();\n tick(0, 1);\n return stop;\n}\nfunction fix_position(node) {\n const style = getComputedStyle(node);\n if (style.position !== 'absolute' && style.position !== 'fixed') {\n const { width, height } = style;\n const a = node.getBoundingClientRect();\n node.style.position = 'absolute';\n node.style.width = width;\n node.style.height = height;\n add_transform(node, a);\n }\n}\nfunction add_transform(node, a) {\n const b = node.getBoundingClientRect();\n if (a.left !== b.left || a.top !== b.top) {\n const style = getComputedStyle(node);\n const transform = style.transform === 'none' ? '' : style.transform;\n node.style.transform = `${transform} translate(${a.left - b.left}px, ${a.top - b.top}px)`;\n }\n}\n\nlet current_component;\nfunction set_current_component(component) {\n current_component = component;\n}\nfunction get_current_component() {\n if (!current_component)\n throw new Error('Function called outside component initialization');\n return current_component;\n}\nfunction beforeUpdate(fn) {\n get_current_component().$$.before_update.push(fn);\n}\nfunction onMount(fn) {\n get_current_component().$$.on_mount.push(fn);\n}\nfunction afterUpdate(fn) {\n get_current_component().$$.after_update.push(fn);\n}\nfunction onDestroy(fn) {\n get_current_component().$$.on_destroy.push(fn);\n}\nfunction createEventDispatcher() {\n const component = get_current_component();\n return (type, detail) => {\n const callbacks = component.$$.callbacks[type];\n if (callbacks) {\n // TODO are there situations where events could be dispatched\n // in a server (non-DOM) environment?\n const event = custom_event(type, detail);\n callbacks.slice().forEach(fn => {\n fn.call(component, event);\n });\n }\n };\n}\nfunction setContext(key, context) {\n get_current_component().$$.context.set(key, context);\n}\nfunction getContext(key) {\n return get_current_component().$$.context.get(key);\n}\nfunction hasContext(key) {\n return get_current_component().$$.context.has(key);\n}\n// TODO figure out if we still want to support\n// shorthand events, or if we want to implement\n// a real bubbling mechanism\nfunction bubble(component, event) {\n const callbacks = component.$$.callbacks[event.type];\n if (callbacks) {\n callbacks.slice().forEach(fn => fn(event));\n }\n}\n\nconst dirty_components = [];\nconst intros = { enabled: false };\nconst binding_callbacks = [];\nconst render_callbacks = [];\nconst flush_callbacks = [];\nconst resolved_promise = Promise.resolve();\nlet update_scheduled = false;\nfunction schedule_update() {\n if (!update_scheduled) {\n update_scheduled = true;\n resolved_promise.then(flush);\n }\n}\nfunction tick() {\n schedule_update();\n return resolved_promise;\n}\nfunction add_render_callback(fn) {\n render_callbacks.push(fn);\n}\nfunction add_flush_callback(fn) {\n flush_callbacks.push(fn);\n}\nlet flushing = false;\nconst seen_callbacks = new Set();\nfunction flush() {\n if (flushing)\n return;\n flushing = true;\n do {\n // first, call beforeUpdate functions\n // and update components\n for (let i = 0; i < dirty_components.length; i += 1) {\n const component = dirty_components[i];\n set_current_component(component);\n update(component.$$);\n }\n set_current_component(null);\n dirty_components.length = 0;\n while (binding_callbacks.length)\n binding_callbacks.pop()();\n // then, once components are updated, call\n // afterUpdate functions. This may cause\n // subsequent updates...\n for (let i = 0; i < render_callbacks.length; i += 1) {\n const callback = render_callbacks[i];\n if (!seen_callbacks.has(callback)) {\n // ...so guard against infinite loops\n seen_callbacks.add(callback);\n callback();\n }\n }\n render_callbacks.length = 0;\n } while (dirty_components.length);\n while (flush_callbacks.length) {\n flush_callbacks.pop()();\n }\n update_scheduled = false;\n flushing = false;\n seen_callbacks.clear();\n}\nfunction update($$) {\n if ($$.fragment !== null) {\n $$.update();\n run_all($$.before_update);\n const dirty = $$.dirty;\n $$.dirty = [-1];\n $$.fragment && $$.fragment.p($$.ctx, dirty);\n $$.after_update.forEach(add_render_callback);\n }\n}\n\nlet promise;\nfunction wait() {\n if (!promise) {\n promise = Promise.resolve();\n promise.then(() => {\n promise = null;\n });\n }\n return promise;\n}\nfunction dispatch(node, direction, kind) {\n node.dispatchEvent(custom_event(`${direction ? 'intro' : 'outro'}${kind}`));\n}\nconst outroing = new Set();\nlet outros;\nfunction group_outros() {\n outros = {\n r: 0,\n c: [],\n p: outros // parent group\n };\n}\nfunction check_outros() {\n if (!outros.r) {\n run_all(outros.c);\n }\n outros = outros.p;\n}\nfunction transition_in(block, local) {\n if (block && block.i) {\n outroing.delete(block);\n block.i(local);\n }\n}\nfunction transition_out(block, local, detach, callback) {\n if (block && block.o) {\n if (outroing.has(block))\n return;\n outroing.add(block);\n outros.c.push(() => {\n outroing.delete(block);\n if (callback) {\n if (detach)\n block.d(1);\n callback();\n }\n });\n block.o(local);\n }\n}\nconst null_transition = { duration: 0 };\nfunction create_in_transition(node, fn, params) {\n let config = fn(node, params);\n let running = false;\n let animation_name;\n let task;\n let uid = 0;\n function cleanup() {\n if (animation_name)\n delete_rule(node, animation_name);\n }\n function go() {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n if (css)\n animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++);\n tick(0, 1);\n const start_time = now() + delay;\n const end_time = start_time + duration;\n if (task)\n task.abort();\n running = true;\n add_render_callback(() => dispatch(node, true, 'start'));\n task = loop(now => {\n if (running) {\n if (now >= end_time) {\n tick(1, 0);\n dispatch(node, true, 'end');\n cleanup();\n return running = false;\n }\n if (now >= start_time) {\n const t = easing((now - start_time) / duration);\n tick(t, 1 - t);\n }\n }\n return running;\n });\n }\n let started = false;\n return {\n start() {\n if (started)\n return;\n delete_rule(node);\n if (is_function(config)) {\n config = config();\n wait().then(go);\n }\n else {\n go();\n }\n },\n invalidate() {\n started = false;\n },\n end() {\n if (running) {\n cleanup();\n running = false;\n }\n }\n };\n}\nfunction create_out_transition(node, fn, params) {\n let config = fn(node, params);\n let running = true;\n let animation_name;\n const group = outros;\n group.r += 1;\n function go() {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n if (css)\n animation_name = create_rule(node, 1, 0, duration, delay, easing, css);\n const start_time = now() + delay;\n const end_time = start_time + duration;\n add_render_callback(() => dispatch(node, false, 'start'));\n loop(now => {\n if (running) {\n if (now >= end_time) {\n tick(0, 1);\n dispatch(node, false, 'end');\n if (!--group.r) {\n // this will result in `end()` being called,\n // so we don't need to clean up here\n run_all(group.c);\n }\n return false;\n }\n if (now >= start_time) {\n const t = easing((now - start_time) / duration);\n tick(1 - t, t);\n }\n }\n return running;\n });\n }\n if (is_function(config)) {\n wait().then(() => {\n // @ts-ignore\n config = config();\n go();\n });\n }\n else {\n go();\n }\n return {\n end(reset) {\n if (reset && config.tick) {\n config.tick(1, 0);\n }\n if (running) {\n if (animation_name)\n delete_rule(node, animation_name);\n running = false;\n }\n }\n };\n}\nfunction create_bidirectional_transition(node, fn, params, intro) {\n let config = fn(node, params);\n let t = intro ? 0 : 1;\n let running_program = null;\n let pending_program = null;\n let animation_name = null;\n function clear_animation() {\n if (animation_name)\n delete_rule(node, animation_name);\n }\n function init(program, duration) {\n const d = program.b - t;\n duration *= Math.abs(d);\n return {\n a: t,\n b: program.b,\n d,\n duration,\n start: program.start,\n end: program.start + duration,\n group: program.group\n };\n }\n function go(b) {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n const program = {\n start: now() + delay,\n b\n };\n if (!b) {\n // @ts-ignore todo: improve typings\n program.group = outros;\n outros.r += 1;\n }\n if (running_program || pending_program) {\n pending_program = program;\n }\n else {\n // if this is an intro, and there's a delay, we need to do\n // an initial tick and/or apply CSS animation immediately\n if (css) {\n clear_animation();\n animation_name = create_rule(node, t, b, duration, delay, easing, css);\n }\n if (b)\n tick(0, 1);\n running_program = init(program, duration);\n add_render_callback(() => dispatch(node, b, 'start'));\n loop(now => {\n if (pending_program && now > pending_program.start) {\n running_program = init(pending_program, duration);\n pending_program = null;\n dispatch(node, running_program.b, 'start');\n if (css) {\n clear_animation();\n animation_name = create_rule(node, t, running_program.b, running_program.duration, 0, easing, config.css);\n }\n }\n if (running_program) {\n if (now >= running_program.end) {\n tick(t = running_program.b, 1 - t);\n dispatch(node, running_program.b, 'end');\n if (!pending_program) {\n // we're done\n if (running_program.b) {\n // intro — we can tidy up immediately\n clear_animation();\n }\n else {\n // outro — needs to be coordinated\n if (!--running_program.group.r)\n run_all(running_program.group.c);\n }\n }\n running_program = null;\n }\n else if (now >= running_program.start) {\n const p = now - running_program.start;\n t = running_program.a + running_program.d * easing(p / running_program.duration);\n tick(t, 1 - t);\n }\n }\n return !!(running_program || pending_program);\n });\n }\n }\n return {\n run(b) {\n if (is_function(config)) {\n wait().then(() => {\n // @ts-ignore\n config = config();\n go(b);\n });\n }\n else {\n go(b);\n }\n },\n end() {\n clear_animation();\n running_program = pending_program = null;\n }\n };\n}\n\nfunction handle_promise(promise, info) {\n const token = info.token = {};\n function update(type, index, key, value) {\n if (info.token !== token)\n return;\n info.resolved = value;\n let child_ctx = info.ctx;\n if (key !== undefined) {\n child_ctx = child_ctx.slice();\n child_ctx[key] = value;\n }\n const block = type && (info.current = type)(child_ctx);\n let needs_flush = false;\n if (info.block) {\n if (info.blocks) {\n info.blocks.forEach((block, i) => {\n if (i !== index && block) {\n group_outros();\n transition_out(block, 1, 1, () => {\n if (info.blocks[i] === block) {\n info.blocks[i] = null;\n }\n });\n check_outros();\n }\n });\n }\n else {\n info.block.d(1);\n }\n block.c();\n transition_in(block, 1);\n block.m(info.mount(), info.anchor);\n needs_flush = true;\n }\n info.block = block;\n if (info.blocks)\n info.blocks[index] = block;\n if (needs_flush) {\n flush();\n }\n }\n if (is_promise(promise)) {\n const current_component = get_current_component();\n promise.then(value => {\n set_current_component(current_component);\n update(info.then, 1, info.value, value);\n set_current_component(null);\n }, error => {\n set_current_component(current_component);\n update(info.catch, 2, info.error, error);\n set_current_component(null);\n if (!info.hasCatch) {\n throw error;\n }\n });\n // if we previously had a then/catch block, destroy it\n if (info.current !== info.pending) {\n update(info.pending, 0);\n return true;\n }\n }\n else {\n if (info.current !== info.then) {\n update(info.then, 1, info.value, promise);\n return true;\n }\n info.resolved = promise;\n }\n}\n\nconst globals = (typeof window !== 'undefined'\n ? window\n : typeof globalThis !== 'undefined'\n ? globalThis\n : global);\n\nfunction destroy_block(block, lookup) {\n block.d(1);\n lookup.delete(block.key);\n}\nfunction outro_and_destroy_block(block, lookup) {\n transition_out(block, 1, 1, () => {\n lookup.delete(block.key);\n });\n}\nfunction fix_and_destroy_block(block, lookup) {\n block.f();\n destroy_block(block, lookup);\n}\nfunction fix_and_outro_and_destroy_block(block, lookup) {\n block.f();\n outro_and_destroy_block(block, lookup);\n}\nfunction update_keyed_each(old_blocks, dirty, get_key, dynamic, ctx, list, lookup, node, destroy, create_each_block, next, get_context) {\n let o = old_blocks.length;\n let n = list.length;\n let i = o;\n const old_indexes = {};\n while (i--)\n old_indexes[old_blocks[i].key] = i;\n const new_blocks = [];\n const new_lookup = new Map();\n const deltas = new Map();\n i = n;\n while (i--) {\n const child_ctx = get_context(ctx, list, i);\n const key = get_key(child_ctx);\n let block = lookup.get(key);\n if (!block) {\n block = create_each_block(key, child_ctx);\n block.c();\n }\n else if (dynamic) {\n block.p(child_ctx, dirty);\n }\n new_lookup.set(key, new_blocks[i] = block);\n if (key in old_indexes)\n deltas.set(key, Math.abs(i - old_indexes[key]));\n }\n const will_move = new Set();\n const did_move = new Set();\n function insert(block) {\n transition_in(block, 1);\n block.m(node, next);\n lookup.set(block.key, block);\n next = block.first;\n n--;\n }\n while (o && n) {\n const new_block = new_blocks[n - 1];\n const old_block = old_blocks[o - 1];\n const new_key = new_block.key;\n const old_key = old_block.key;\n if (new_block === old_block) {\n // do nothing\n next = new_block.first;\n o--;\n n--;\n }\n else if (!new_lookup.has(old_key)) {\n // remove old block\n destroy(old_block, lookup);\n o--;\n }\n else if (!lookup.has(new_key) || will_move.has(new_key)) {\n insert(new_block);\n }\n else if (did_move.has(old_key)) {\n o--;\n }\n else if (deltas.get(new_key) > deltas.get(old_key)) {\n did_move.add(new_key);\n insert(new_block);\n }\n else {\n will_move.add(old_key);\n o--;\n }\n }\n while (o--) {\n const old_block = old_blocks[o];\n if (!new_lookup.has(old_block.key))\n destroy(old_block, lookup);\n }\n while (n)\n insert(new_blocks[n - 1]);\n return new_blocks;\n}\nfunction validate_each_keys(ctx, list, get_context, get_key) {\n const keys = new Set();\n for (let i = 0; i < list.length; i++) {\n const key = get_key(get_context(ctx, list, i));\n if (keys.has(key)) {\n throw new Error('Cannot have duplicate keys in a keyed each');\n }\n keys.add(key);\n }\n}\n\nfunction get_spread_update(levels, updates) {\n const update = {};\n const to_null_out = {};\n const accounted_for = { $$scope: 1 };\n let i = levels.length;\n while (i--) {\n const o = levels[i];\n const n = updates[i];\n if (n) {\n for (const key in o) {\n if (!(key in n))\n to_null_out[key] = 1;\n }\n for (const key in n) {\n if (!accounted_for[key]) {\n update[key] = n[key];\n accounted_for[key] = 1;\n }\n }\n levels[i] = n;\n }\n else {\n for (const key in o) {\n accounted_for[key] = 1;\n }\n }\n }\n for (const key in to_null_out) {\n if (!(key in update))\n update[key] = undefined;\n }\n return update;\n}\nfunction get_spread_object(spread_props) {\n return typeof spread_props === 'object' && spread_props !== null ? spread_props : {};\n}\n\n// source: https://html.spec.whatwg.org/multipage/indices.html\nconst boolean_attributes = new Set([\n 'allowfullscreen',\n 'allowpaymentrequest',\n 'async',\n 'autofocus',\n 'autoplay',\n 'checked',\n 'controls',\n 'default',\n 'defer',\n 'disabled',\n 'formnovalidate',\n 'hidden',\n 'ismap',\n 'loop',\n 'multiple',\n 'muted',\n 'nomodule',\n 'novalidate',\n 'open',\n 'playsinline',\n 'readonly',\n 'required',\n 'reversed',\n 'selected'\n]);\n\nconst invalid_attribute_name_character = /[\\s'\">/=\\u{FDD0}-\\u{FDEF}\\u{FFFE}\\u{FFFF}\\u{1FFFE}\\u{1FFFF}\\u{2FFFE}\\u{2FFFF}\\u{3FFFE}\\u{3FFFF}\\u{4FFFE}\\u{4FFFF}\\u{5FFFE}\\u{5FFFF}\\u{6FFFE}\\u{6FFFF}\\u{7FFFE}\\u{7FFFF}\\u{8FFFE}\\u{8FFFF}\\u{9FFFE}\\u{9FFFF}\\u{AFFFE}\\u{AFFFF}\\u{BFFFE}\\u{BFFFF}\\u{CFFFE}\\u{CFFFF}\\u{DFFFE}\\u{DFFFF}\\u{EFFFE}\\u{EFFFF}\\u{FFFFE}\\u{FFFFF}\\u{10FFFE}\\u{10FFFF}]/u;\n// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\n// https://infra.spec.whatwg.org/#noncharacter\nfunction spread(args, classes_to_add) {\n const attributes = Object.assign({}, ...args);\n if (classes_to_add) {\n if (attributes.class == null) {\n attributes.class = classes_to_add;\n }\n else {\n attributes.class += ' ' + classes_to_add;\n }\n }\n let str = '';\n Object.keys(attributes).forEach(name => {\n if (invalid_attribute_name_character.test(name))\n return;\n const value = attributes[name];\n if (value === true)\n str += ' ' + name;\n else if (boolean_attributes.has(name.toLowerCase())) {\n if (value)\n str += ' ' + name;\n }\n else if (value != null) {\n str += ` ${name}=\"${String(value).replace(/\"/g, '"').replace(/'/g, ''')}\"`;\n }\n });\n return str;\n}\nconst escaped = {\n '\"': '"',\n \"'\": ''',\n '&': '&',\n '<': '<',\n '>': '>'\n};\nfunction escape(html) {\n return String(html).replace(/[\"'&<>]/g, match => escaped[match]);\n}\nfunction each(items, fn) {\n let str = '';\n for (let i = 0; i < items.length; i += 1) {\n str += fn(items[i], i);\n }\n return str;\n}\nconst missing_component = {\n $$render: () => ''\n};\nfunction validate_component(component, name) {\n if (!component || !component.$$render) {\n if (name === 'svelte:component')\n name += ' this={...}';\n throw new Error(`<${name}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules`);\n }\n return component;\n}\nfunction debug(file, line, column, values) {\n console.log(`{@debug} ${file ? file + ' ' : ''}(${line}:${column})`); // eslint-disable-line no-console\n console.log(values); // eslint-disable-line no-console\n return '';\n}\nlet on_destroy;\nfunction create_ssr_component(fn) {\n function $$render(result, props, bindings, slots, context) {\n const parent_component = current_component;\n const $$ = {\n on_destroy,\n context: new Map(parent_component ? parent_component.$$.context : context || []),\n // these will be immediately discarded\n on_mount: [],\n before_update: [],\n after_update: [],\n callbacks: blank_object()\n };\n set_current_component({ $$ });\n const html = fn(result, props, bindings, slots);\n set_current_component(parent_component);\n return html;\n }\n return {\n render: (props = {}, { $$slots = {}, context = new Map() } = {}) => {\n on_destroy = [];\n const result = { title: '', head: '', css: new Set() };\n const html = $$render(result, props, {}, $$slots, context);\n run_all(on_destroy);\n return {\n html,\n css: {\n code: Array.from(result.css).map(css => css.code).join('\\n'),\n map: null // TODO\n },\n head: result.title + result.head\n };\n },\n $$render\n };\n}\nfunction add_attribute(name, value, boolean) {\n if (value == null || (boolean && !value))\n return '';\n return ` ${name}${value === true ? '' : `=${typeof value === 'string' ? JSON.stringify(escape(value)) : `\"${value}\"`}`}`;\n}\nfunction add_classes(classes) {\n return classes ? ` class=\"${classes}\"` : '';\n}\n\nfunction bind(component, name, callback) {\n const index = component.$$.props[name];\n if (index !== undefined) {\n component.$$.bound[index] = callback;\n callback(component.$$.ctx[index]);\n }\n}\nfunction create_component(block) {\n block && block.c();\n}\nfunction claim_component(block, parent_nodes) {\n block && block.l(parent_nodes);\n}\nfunction mount_component(component, target, anchor, customElement) {\n const { fragment, on_mount, on_destroy, after_update } = component.$$;\n fragment && fragment.m(target, anchor);\n if (!customElement) {\n // onMount happens before the initial afterUpdate\n add_render_callback(() => {\n const new_on_destroy = on_mount.map(run).filter(is_function);\n if (on_destroy) {\n on_destroy.push(...new_on_destroy);\n }\n else {\n // Edge case - component was destroyed immediately,\n // most likely as a result of a binding initialising\n run_all(new_on_destroy);\n }\n component.$$.on_mount = [];\n });\n }\n after_update.forEach(add_render_callback);\n}\nfunction destroy_component(component, detaching) {\n const $$ = component.$$;\n if ($$.fragment !== null) {\n run_all($$.on_destroy);\n $$.fragment && $$.fragment.d(detaching);\n // TODO null out other refs, including component.$$ (but need to\n // preserve final state?)\n $$.on_destroy = $$.fragment = null;\n $$.ctx = [];\n }\n}\nfunction make_dirty(component, i) {\n if (component.$$.dirty[0] === -1) {\n dirty_components.push(component);\n schedule_update();\n component.$$.dirty.fill(0);\n }\n component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31));\n}\nfunction init(component, options, instance, create_fragment, not_equal, props, dirty = [-1]) {\n const parent_component = current_component;\n set_current_component(component);\n const $$ = component.$$ = {\n fragment: null,\n ctx: null,\n // state\n props,\n update: noop,\n not_equal,\n bound: blank_object(),\n // lifecycle\n on_mount: [],\n on_destroy: [],\n on_disconnect: [],\n before_update: [],\n after_update: [],\n context: new Map(parent_component ? parent_component.$$.context : options.context || []),\n // everything else\n callbacks: blank_object(),\n dirty,\n skip_bound: false\n };\n let ready = false;\n $$.ctx = instance\n ? instance(component, options.props || {}, (i, ret, ...rest) => {\n const value = rest.length ? rest[0] : ret;\n if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {\n if (!$$.skip_bound && $$.bound[i])\n $$.bound[i](value);\n if (ready)\n make_dirty(component, i);\n }\n return ret;\n })\n : [];\n $$.update();\n ready = true;\n run_all($$.before_update);\n // `false` as a special case of no DOM component\n $$.fragment = create_fragment ? create_fragment($$.ctx) : false;\n if (options.target) {\n if (options.hydrate) {\n const nodes = children(options.target);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n $$.fragment && $$.fragment.l(nodes);\n nodes.forEach(detach);\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n $$.fragment && $$.fragment.c();\n }\n if (options.intro)\n transition_in(component.$$.fragment);\n mount_component(component, options.target, options.anchor, options.customElement);\n flush();\n }\n set_current_component(parent_component);\n}\nlet SvelteElement;\nif (typeof HTMLElement === 'function') {\n SvelteElement = class extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n }\n connectedCallback() {\n const { on_mount } = this.$$;\n this.$$.on_disconnect = on_mount.map(run).filter(is_function);\n // @ts-ignore todo: improve typings\n for (const key in this.$$.slotted) {\n // @ts-ignore todo: improve typings\n this.appendChild(this.$$.slotted[key]);\n }\n }\n attributeChangedCallback(attr, _oldValue, newValue) {\n this[attr] = newValue;\n }\n disconnectedCallback() {\n run_all(this.$$.on_disconnect);\n }\n $destroy() {\n destroy_component(this, 1);\n this.$destroy = noop;\n }\n $on(type, callback) {\n // TODO should this delegate to addEventListener?\n const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));\n callbacks.push(callback);\n return () => {\n const index = callbacks.indexOf(callback);\n if (index !== -1)\n callbacks.splice(index, 1);\n };\n }\n $set($$props) {\n if (this.$$set && !is_empty($$props)) {\n this.$$.skip_bound = true;\n this.$$set($$props);\n this.$$.skip_bound = false;\n }\n }\n };\n}\n/**\n * Base class for Svelte components. Used when dev=false.\n */\nclass SvelteComponent {\n $destroy() {\n destroy_component(this, 1);\n this.$destroy = noop;\n }\n $on(type, callback) {\n const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));\n callbacks.push(callback);\n return () => {\n const index = callbacks.indexOf(callback);\n if (index !== -1)\n callbacks.splice(index, 1);\n };\n }\n $set($$props) {\n if (this.$$set && !is_empty($$props)) {\n this.$$.skip_bound = true;\n this.$$set($$props);\n this.$$.skip_bound = false;\n }\n }\n}\n\nfunction dispatch_dev(type, detail) {\n document.dispatchEvent(custom_event(type, Object.assign({ version: '3.37.0' }, detail)));\n}\nfunction append_dev(target, node) {\n dispatch_dev('SvelteDOMInsert', { target, node });\n append(target, node);\n}\nfunction insert_dev(target, node, anchor) {\n dispatch_dev('SvelteDOMInsert', { target, node, anchor });\n insert(target, node, anchor);\n}\nfunction detach_dev(node) {\n dispatch_dev('SvelteDOMRemove', { node });\n detach(node);\n}\nfunction detach_between_dev(before, after) {\n while (before.nextSibling && before.nextSibling !== after) {\n detach_dev(before.nextSibling);\n }\n}\nfunction detach_before_dev(after) {\n while (after.previousSibling) {\n detach_dev(after.previousSibling);\n }\n}\nfunction detach_after_dev(before) {\n while (before.nextSibling) {\n detach_dev(before.nextSibling);\n }\n}\nfunction listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation) {\n const modifiers = options === true ? ['capture'] : options ? Array.from(Object.keys(options)) : [];\n if (has_prevent_default)\n modifiers.push('preventDefault');\n if (has_stop_propagation)\n modifiers.push('stopPropagation');\n dispatch_dev('SvelteDOMAddEventListener', { node, event, handler, modifiers });\n const dispose = listen(node, event, handler, options);\n return () => {\n dispatch_dev('SvelteDOMRemoveEventListener', { node, event, handler, modifiers });\n dispose();\n };\n}\nfunction attr_dev(node, attribute, value) {\n attr(node, attribute, value);\n if (value == null)\n dispatch_dev('SvelteDOMRemoveAttribute', { node, attribute });\n else\n dispatch_dev('SvelteDOMSetAttribute', { node, attribute, value });\n}\nfunction prop_dev(node, property, value) {\n node[property] = value;\n dispatch_dev('SvelteDOMSetProperty', { node, property, value });\n}\nfunction dataset_dev(node, property, value) {\n node.dataset[property] = value;\n dispatch_dev('SvelteDOMSetDataset', { node, property, value });\n}\nfunction set_data_dev(text, data) {\n data = '' + data;\n if (text.wholeText === data)\n return;\n dispatch_dev('SvelteDOMSetData', { node: text, data });\n text.data = data;\n}\nfunction validate_each_argument(arg) {\n if (typeof arg !== 'string' && !(arg && typeof arg === 'object' && 'length' in arg)) {\n let msg = '{#each} only iterates over array-like objects.';\n if (typeof Symbol === 'function' && arg && Symbol.iterator in arg) {\n msg += ' You can use a spread to convert this iterable into an array.';\n }\n throw new Error(msg);\n }\n}\nfunction validate_slots(name, slot, keys) {\n for (const slot_key of Object.keys(slot)) {\n if (!~keys.indexOf(slot_key)) {\n console.warn(`<${name}> received an unexpected slot \"${slot_key}\".`);\n }\n }\n}\n/**\n * Base class for Svelte components with some minor dev-enhancements. Used when dev=true.\n */\nclass SvelteComponentDev extends SvelteComponent {\n constructor(options) {\n if (!options || (!options.target && !options.$$inline)) {\n throw new Error(\"'target' is a required option\");\n }\n super();\n }\n $destroy() {\n super.$destroy();\n this.$destroy = () => {\n console.warn('Component was already destroyed'); // eslint-disable-line no-console\n };\n }\n $capture_state() { }\n $inject_state() { }\n}\n/**\n * Base class to create strongly typed Svelte components.\n * This only exists for typing purposes and should be used in `.d.ts` files.\n *\n * ### Example:\n *\n * You have component library on npm called `component-library`, from which\n * you export a component called `MyComponent`. For Svelte+TypeScript users,\n * you want to provide typings. Therefore you create a `index.d.ts`:\n * ```ts\n * import { SvelteComponentTyped } from \"svelte\";\n * export class MyComponent extends SvelteComponentTyped<{foo: string}> {}\n * ```\n * Typing this makes it possible for IDEs like VS Code with the Svelte extension\n * to provide intellisense and to use the component like this in a Svelte file\n * with TypeScript:\n * ```svelte\n * <script lang=\"ts\">\n * \timport { MyComponent } from \"component-library\";\n * </script>\n * <MyComponent foo={'bar'} />\n * ```\n *\n * #### Why not make this part of `SvelteComponent(Dev)`?\n * Because\n * ```ts\n * class ASubclassOfSvelteComponent extends SvelteComponent<{foo: string}> {}\n * const component: typeof SvelteComponent = ASubclassOfSvelteComponent;\n * ```\n * will throw a type error, so we need to seperate the more strictly typed class.\n */\nclass SvelteComponentTyped extends SvelteComponentDev {\n constructor(options) {\n super(options);\n }\n}\nfunction loop_guard(timeout) {\n const start = Date.now();\n return () => {\n if (Date.now() - start > timeout) {\n throw new Error('Infinite loop detected');\n }\n };\n}\n\nexport { HtmlTag, SvelteComponent, SvelteComponentDev, SvelteComponentTyped, SvelteElement, action_destroyer, add_attribute, add_classes, add_flush_callback, add_location, add_render_callback, add_resize_listener, add_transform, afterUpdate, append, append_dev, assign, attr, attr_dev, attribute_to_object, beforeUpdate, bind, binding_callbacks, blank_object, bubble, check_outros, children, claim_component, claim_element, claim_space, claim_text, clear_loops, component_subscribe, compute_rest_props, compute_slots, createEventDispatcher, create_animation, create_bidirectional_transition, create_component, create_in_transition, create_out_transition, create_slot, create_ssr_component, current_component, custom_event, dataset_dev, debug, destroy_block, destroy_component, destroy_each, detach, detach_after_dev, detach_before_dev, detach_between_dev, detach_dev, dirty_components, dispatch_dev, each, element, element_is, empty, escape, escaped, exclude_internal_props, fix_and_destroy_block, fix_and_outro_and_destroy_block, fix_position, flush, getContext, get_binding_group_value, get_current_component, get_custom_elements_slots, get_slot_changes, get_slot_context, get_spread_object, get_spread_update, get_store_value, globals, group_outros, handle_promise, hasContext, has_prop, identity, init, insert, insert_dev, intros, invalid_attribute_name_character, is_client, is_crossorigin, is_empty, is_function, is_promise, listen, listen_dev, loop, loop_guard, missing_component, mount_component, noop, not_equal, now, null_to_empty, object_without_properties, onDestroy, onMount, once, outro_and_destroy_block, prevent_default, prop_dev, query_selector_all, raf, run, run_all, safe_not_equal, schedule_update, select_multiple_value, select_option, select_options, select_value, self, setContext, set_attributes, set_current_component, set_custom_element_data, set_data, set_data_dev, set_input_type, set_input_value, set_now, set_raf, set_store_value, set_style, set_svg_attributes, space, spread, stop_propagation, subscribe, svg_element, text, tick, time_ranges_to_array, to_number, toggle_class, transition_in, transition_out, update_keyed_each, update_slot, update_slot_spread, validate_component, validate_each_argument, validate_each_keys, validate_slots, validate_store, xlink_attr };\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=admin.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=app.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fakeAgentPubKey = void 0;\nexports.fakeAgentPubKey = (x) => Buffer.from([0x84, 0x20, 0x24].concat('000000000000000000000000000000000000'\n .split('')\n .map((x) => parseInt(x, 10))));\n//# sourceMappingURL=types.js.map","// https://github.com/maxogden/websocket-stream/blob/48dc3ddf943e5ada668c31ccd94e9186f02fafbd/ws-fallback.js\n\nvar ws = null\n\nif (typeof WebSocket !== 'undefined') {\n ws = WebSocket\n} else if (typeof MozWebSocket !== 'undefined') {\n ws = MozWebSocket\n} else if (typeof global !== 'undefined') {\n ws = global.WebSocket || global.MozWebSocket\n} else if (typeof window !== 'undefined') {\n ws = window.WebSocket || window.MozWebSocket\n} else if (typeof self !== 'undefined') {\n ws = self.WebSocket || self.MozWebSocket\n}\n\nmodule.exports = ws\n","var TEXT_ENCODING_AVAILABLE = (typeof process === \"undefined\" || process.env[\"TEXT_ENCODING\"] !== \"never\") &&\n typeof TextEncoder !== \"undefined\" &&\n typeof TextDecoder !== \"undefined\";\nvar STR_SIZE_MAX = 4294967295; // uint32_max\nexport function utf8Count(str) {\n var strLength = str.length;\n var byteLength = 0;\n var pos = 0;\n while (pos < strLength) {\n var value = str.charCodeAt(pos++);\n if ((value & 0xffffff80) === 0) {\n // 1-byte\n byteLength++;\n continue;\n }\n else if ((value & 0xfffff800) === 0) {\n // 2-bytes\n byteLength += 2;\n }\n else {\n // handle surrogate pair\n if (value >= 0xd800 && value <= 0xdbff) {\n // high surrogate\n if (pos < strLength) {\n var extra = str.charCodeAt(pos);\n if ((extra & 0xfc00) === 0xdc00) {\n ++pos;\n value = ((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000;\n }\n }\n }\n if ((value & 0xffff0000) === 0) {\n // 3-byte\n byteLength += 3;\n }\n else {\n // 4-byte\n byteLength += 4;\n }\n }\n }\n return byteLength;\n}\nexport function utf8EncodeJs(str, output, outputOffset) {\n var strLength = str.length;\n var offset = outputOffset;\n var pos = 0;\n while (pos < strLength) {\n var value = str.charCodeAt(pos++);\n if ((value & 0xffffff80) === 0) {\n // 1-byte\n output[offset++] = value;\n continue;\n }\n else if ((value & 0xfffff800) === 0) {\n // 2-bytes\n output[offset++] = ((value >> 6) & 0x1f) | 0xc0;\n }\n else {\n // handle surrogate pair\n if (value >= 0xd800 && value <= 0xdbff) {\n // high surrogate\n if (pos < strLength) {\n var extra = str.charCodeAt(pos);\n if ((extra & 0xfc00) === 0xdc00) {\n ++pos;\n value = ((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000;\n }\n }\n }\n if ((value & 0xffff0000) === 0) {\n // 3-byte\n output[offset++] = ((value >> 12) & 0x0f) | 0xe0;\n output[offset++] = ((value >> 6) & 0x3f) | 0x80;\n }\n else {\n // 4-byte\n output[offset++] = ((value >> 18) & 0x07) | 0xf0;\n output[offset++] = ((value >> 12) & 0x3f) | 0x80;\n output[offset++] = ((value >> 6) & 0x3f) | 0x80;\n }\n }\n output[offset++] = (value & 0x3f) | 0x80;\n }\n}\nvar sharedTextEncoder = TEXT_ENCODING_AVAILABLE ? new TextEncoder() : undefined;\nexport var TEXT_ENCODER_THRESHOLD = !TEXT_ENCODING_AVAILABLE\n ? STR_SIZE_MAX\n : typeof process !== \"undefined\" && process.env[\"TEXT_ENCODING\"] !== \"force\"\n ? 200\n : 0;\nfunction utf8EncodeTEencode(str, output, outputOffset) {\n output.set(sharedTextEncoder.encode(str), outputOffset);\n}\nfunction utf8EncodeTEencodeInto(str, output, outputOffset) {\n sharedTextEncoder.encodeInto(str, output.subarray(outputOffset));\n}\nexport var utf8EncodeTE = (sharedTextEncoder === null || sharedTextEncoder === void 0 ? void 0 : sharedTextEncoder.encodeInto) ? utf8EncodeTEencodeInto : utf8EncodeTEencode;\nvar CHUNK_SIZE = 4096;\nexport function utf8DecodeJs(bytes, inputOffset, byteLength) {\n var offset = inputOffset;\n var end = offset + byteLength;\n var units = [];\n var result = \"\";\n while (offset < end) {\n var byte1 = bytes[offset++];\n if ((byte1 & 0x80) === 0) {\n // 1 byte\n units.push(byte1);\n }\n else if ((byte1 & 0xe0) === 0xc0) {\n // 2 bytes\n var byte2 = bytes[offset++] & 0x3f;\n units.push(((byte1 & 0x1f) << 6) | byte2);\n }\n else if ((byte1 & 0xf0) === 0xe0) {\n // 3 bytes\n var byte2 = bytes[offset++] & 0x3f;\n var byte3 = bytes[offset++] & 0x3f;\n units.push(((byte1 & 0x1f) << 12) | (byte2 << 6) | byte3);\n }\n else if ((byte1 & 0xf8) === 0xf0) {\n // 4 bytes\n var byte2 = bytes[offset++] & 0x3f;\n var byte3 = bytes[offset++] & 0x3f;\n var byte4 = bytes[offset++] & 0x3f;\n var unit = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0c) | (byte3 << 0x06) | byte4;\n if (unit > 0xffff) {\n unit -= 0x10000;\n units.push(((unit >>> 10) & 0x3ff) | 0xd800);\n unit = 0xdc00 | (unit & 0x3ff);\n }\n units.push(unit);\n }\n else {\n units.push(byte1);\n }\n if (units.length >= CHUNK_SIZE) {\n result += String.fromCharCode.apply(String, units);\n units.length = 0;\n }\n }\n if (units.length > 0) {\n result += String.fromCharCode.apply(String, units);\n }\n return result;\n}\nvar sharedTextDecoder = TEXT_ENCODING_AVAILABLE ? new TextDecoder() : null;\nexport var TEXT_DECODER_THRESHOLD = !TEXT_ENCODING_AVAILABLE\n ? STR_SIZE_MAX\n : typeof process !== \"undefined\" && process.env[\"TEXT_DECODER\"] !== \"force\"\n ? 200\n : 0;\nexport function utf8DecodeTD(bytes, inputOffset, byteLength) {\n var stringBytes = bytes.subarray(inputOffset, inputOffset + byteLength);\n return sharedTextDecoder.decode(stringBytes);\n}\n//# sourceMappingURL=utf8.mjs.map","/**\n * ExtData is used to handle Extension Types that are not registered to ExtensionCodec.\n */\nvar ExtData = /** @class */ (function () {\n function ExtData(type, data) {\n this.type = type;\n this.data = data;\n }\n return ExtData;\n}());\nexport { ExtData };\n//# sourceMappingURL=ExtData.mjs.map","// DataView extension to handle int64 / uint64,\n// where the actual range is 53-bits integer (a.k.a. safe integer)\nexport function setUint64(view, offset, value) {\n var high = value / 4294967296;\n var low = value; // high bits are truncated by DataView\n view.setUint32(offset, high);\n view.setUint32(offset + 4, low);\n}\nexport function setInt64(view, offset, value) {\n var high = Math.floor(value / 4294967296);\n var low = value; // high bits are truncated by DataView\n view.setUint32(offset, high);\n view.setUint32(offset + 4, low);\n}\nexport function getInt64(view, offset) {\n var high = view.getInt32(offset);\n var low = view.getUint32(offset + 4);\n return high * 4294967296 + low;\n}\nexport function getUint64(view, offset) {\n var high = view.getUint32(offset);\n var low = view.getUint32(offset + 4);\n return high * 4294967296 + low;\n}\n//# sourceMappingURL=int.mjs.map","// https://github.com/msgpack/msgpack/blob/master/spec.md#timestamp-extension-type\nimport { getInt64, setInt64 } from \"./utils/int.mjs\";\nexport var EXT_TIMESTAMP = -1;\nvar TIMESTAMP32_MAX_SEC = 0x100000000 - 1; // 32-bit unsigned int\nvar TIMESTAMP64_MAX_SEC = 0x400000000 - 1; // 34-bit unsigned int\nexport function encodeTimeSpecToTimestamp(_a) {\n var sec = _a.sec, nsec = _a.nsec;\n if (sec >= 0 && nsec >= 0 && sec <= TIMESTAMP64_MAX_SEC) {\n // Here sec >= 0 && nsec >= 0\n if (nsec === 0 && sec <= TIMESTAMP32_MAX_SEC) {\n // timestamp 32 = { sec32 (unsigned) }\n var rv = new Uint8Array(4);\n var view = new DataView(rv.buffer);\n view.setUint32(0, sec);\n return rv;\n }\n else {\n // timestamp 64 = { nsec30 (unsigned), sec34 (unsigned) }\n var secHigh = sec / 0x100000000;\n var secLow = sec & 0xffffffff;\n var rv = new Uint8Array(8);\n var view = new DataView(rv.buffer);\n // nsec30 | secHigh2\n view.setUint32(0, (nsec << 2) | (secHigh & 0x3));\n // secLow32\n view.setUint32(4, secLow);\n return rv;\n }\n }\n else {\n // timestamp 96 = { nsec32 (unsigned), sec64 (signed) }\n var rv = new Uint8Array(12);\n var view = new DataView(rv.buffer);\n view.setUint32(0, nsec);\n setInt64(view, 4, sec);\n return rv;\n }\n}\nexport function encodeDateToTimeSpec(date) {\n var msec = date.getTime();\n var sec = Math.floor(msec / 1e3);\n var nsec = (msec - sec * 1e3) * 1e6;\n // Normalizes { sec, nsec } to ensure nsec is unsigned.\n var nsecInSec = Math.floor(nsec / 1e9);\n return {\n sec: sec + nsecInSec,\n nsec: nsec - nsecInSec * 1e9,\n };\n}\nexport function encodeTimestampExtension(object) {\n if (object instanceof Date) {\n var timeSpec = encodeDateToTimeSpec(object);\n return encodeTimeSpecToTimestamp(timeSpec);\n }\n else {\n return null;\n }\n}\nexport function decodeTimestampToTimeSpec(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength);\n // data may be 32, 64, or 96 bits\n switch (data.byteLength) {\n case 4: {\n // timestamp 32 = { sec32 }\n var sec = view.getUint32(0);\n var nsec = 0;\n return { sec: sec, nsec: nsec };\n }\n case 8: {\n // timestamp 64 = { nsec30, sec34 }\n var nsec30AndSecHigh2 = view.getUint32(0);\n var secLow32 = view.getUint32(4);\n var sec = (nsec30AndSecHigh2 & 0x3) * 0x100000000 + secLow32;\n var nsec = nsec30AndSecHigh2 >>> 2;\n return { sec: sec, nsec: nsec };\n }\n case 12: {\n // timestamp 96 = { nsec32 (unsigned), sec64 (signed) }\n var sec = getInt64(view, 4);\n var nsec = view.getUint32(0);\n return { sec: sec, nsec: nsec };\n }\n default:\n throw new Error(\"Unrecognized data size for timestamp: \" + data.length);\n }\n}\nexport function decodeTimestampExtension(data) {\n var timeSpec = decodeTimestampToTimeSpec(data);\n return new Date(timeSpec.sec * 1e3 + timeSpec.nsec / 1e6);\n}\nexport var timestampExtension = {\n type: EXT_TIMESTAMP,\n encode: encodeTimestampExtension,\n decode: decodeTimestampExtension,\n};\n//# sourceMappingURL=timestamp.mjs.map","// ExtensionCodec to handle MessagePack extensions\nimport { ExtData } from \"./ExtData.mjs\";\nimport { timestampExtension } from \"./timestamp.mjs\";\nvar ExtensionCodec = /** @class */ (function () {\n function ExtensionCodec() {\n // built-in extensions\n this.builtInEncoders = [];\n this.builtInDecoders = [];\n // custom extensions\n this.encoders = [];\n this.decoders = [];\n this.register(timestampExtension);\n }\n ExtensionCodec.prototype.register = function (_a) {\n var type = _a.type, encode = _a.encode, decode = _a.decode;\n if (type >= 0) {\n // custom extensions\n this.encoders[type] = encode;\n this.decoders[type] = decode;\n }\n else {\n // built-in extensions\n var index = 1 + type;\n this.builtInEncoders[index] = encode;\n this.builtInDecoders[index] = decode;\n }\n };\n ExtensionCodec.prototype.tryToEncode = function (object, context) {\n // built-in extensions\n for (var i = 0; i < this.builtInEncoders.length; i++) {\n var encodeExt = this.builtInEncoders[i];\n if (encodeExt != null) {\n var data = encodeExt(object, context);\n if (data != null) {\n var type = -1 - i;\n return new ExtData(type, data);\n }\n }\n }\n // custom extensions\n for (var i = 0; i < this.encoders.length; i++) {\n var encodeExt = this.encoders[i];\n if (encodeExt != null) {\n var data = encodeExt(object, context);\n if (data != null) {\n var type = i;\n return new ExtData(type, data);\n }\n }\n }\n if (object instanceof ExtData) {\n // to keep ExtData as is\n return object;\n }\n return null;\n };\n ExtensionCodec.prototype.decode = function (data, type, context) {\n var decodeExt = type < 0 ? this.builtInDecoders[-1 - type] : this.decoders[type];\n if (decodeExt) {\n return decodeExt(data, type, context);\n }\n else {\n // decode() does not fail, returns ExtData instead.\n return new ExtData(type, data);\n }\n };\n ExtensionCodec.defaultCodec = new ExtensionCodec();\n return ExtensionCodec;\n}());\nexport { ExtensionCodec };\n//# sourceMappingURL=ExtensionCodec.mjs.map","export function ensureUint8Array(buffer) {\n if (buffer instanceof Uint8Array) {\n return buffer;\n }\n else if (ArrayBuffer.isView(buffer)) {\n return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);\n }\n else if (buffer instanceof ArrayBuffer) {\n return new Uint8Array(buffer);\n }\n else {\n // ArrayLike<number>\n return Uint8Array.from(buffer);\n }\n}\nexport function createDataView(buffer) {\n if (buffer instanceof ArrayBuffer) {\n return new DataView(buffer);\n }\n var bufferView = ensureUint8Array(buffer);\n return new DataView(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength);\n}\n//# sourceMappingURL=typedArrays.mjs.map","import { utf8EncodeJs, utf8Count, TEXT_ENCODER_THRESHOLD, utf8EncodeTE } from \"./utils/utf8.mjs\";\nimport { ExtensionCodec } from \"./ExtensionCodec.mjs\";\nimport { setInt64, setUint64 } from \"./utils/int.mjs\";\nimport { ensureUint8Array } from \"./utils/typedArrays.mjs\";\nexport var DEFAULT_MAX_DEPTH = 100;\nexport var DEFAULT_INITIAL_BUFFER_SIZE = 2048;\nvar Encoder = /** @class */ (function () {\n function Encoder(extensionCodec, context, maxDepth, initialBufferSize, sortKeys, forceFloat32, ignoreUndefined, forceIntegerToFloat) {\n if (extensionCodec === void 0) { extensionCodec = ExtensionCodec.defaultCodec; }\n if (context === void 0) { context = undefined; }\n if (maxDepth === void 0) { maxDepth = DEFAULT_MAX_DEPTH; }\n if (initialBufferSize === void 0) { initialBufferSize = DEFAULT_INITIAL_BUFFER_SIZE; }\n if (sortKeys === void 0) { sortKeys = false; }\n if (forceFloat32 === void 0) { forceFloat32 = false; }\n if (ignoreUndefined === void 0) { ignoreUndefined = false; }\n if (forceIntegerToFloat === void 0) { forceIntegerToFloat = false; }\n this.extensionCodec = extensionCodec;\n this.context = context;\n this.maxDepth = maxDepth;\n this.initialBufferSize = initialBufferSize;\n this.sortKeys = sortKeys;\n this.forceFloat32 = forceFloat32;\n this.ignoreUndefined = ignoreUndefined;\n this.forceIntegerToFloat = forceIntegerToFloat;\n this.pos = 0;\n this.view = new DataView(new ArrayBuffer(this.initialBufferSize));\n this.bytes = new Uint8Array(this.view.buffer);\n }\n Encoder.prototype.getUint8Array = function () {\n return this.bytes.subarray(0, this.pos);\n };\n Encoder.prototype.reinitializeState = function () {\n this.pos = 0;\n };\n Encoder.prototype.encode = function (object) {\n this.reinitializeState();\n this.doEncode(object, 1);\n return this.getUint8Array();\n };\n Encoder.prototype.doEncode = function (object, depth) {\n if (depth > this.maxDepth) {\n throw new Error(\"Too deep objects in depth \" + depth);\n }\n if (object == null) {\n this.encodeNil();\n }\n else if (typeof object === \"boolean\") {\n this.encodeBoolean(object);\n }\n else if (typeof object === \"number\") {\n this.encodeNumber(object);\n }\n else if (typeof object === \"string\") {\n this.encodeString(object);\n }\n else {\n this.encodeObject(object, depth);\n }\n };\n Encoder.prototype.ensureBufferSizeToWrite = function (sizeToWrite) {\n var requiredSize = this.pos + sizeToWrite;\n if (this.view.byteLength < requiredSize) {\n this.resizeBuffer(requiredSize * 2);\n }\n };\n Encoder.prototype.resizeBuffer = function (newSize) {\n var newBuffer = new ArrayBuffer(newSize);\n var newBytes = new Uint8Array(newBuffer);\n var newView = new DataView(newBuffer);\n newBytes.set(this.bytes);\n this.view = newView;\n this.bytes = newBytes;\n };\n Encoder.prototype.encodeNil = function () {\n this.writeU8(0xc0);\n };\n Encoder.prototype.encodeBoolean = function (object) {\n if (object === false) {\n this.writeU8(0xc2);\n }\n else {\n this.writeU8(0xc3);\n }\n };\n Encoder.prototype.encodeNumber = function (object) {\n if (Number.isSafeInteger(object) && !this.forceIntegerToFloat) {\n if (object >= 0) {\n if (object < 0x80) {\n // positive fixint\n this.writeU8(object);\n }\n else if (object < 0x100) {\n // uint 8\n this.writeU8(0xcc);\n this.writeU8(object);\n }\n else if (object < 0x10000) {\n // uint 16\n this.writeU8(0xcd);\n this.writeU16(object);\n }\n else if (object < 0x100000000) {\n // uint 32\n this.writeU8(0xce);\n this.writeU32(object);\n }\n else {\n // uint 64\n this.writeU8(0xcf);\n this.writeU64(object);\n }\n }\n else {\n if (object >= -0x20) {\n // nagative fixint\n this.writeU8(0xe0 | (object + 0x20));\n }\n else if (object >= -0x80) {\n // int 8\n this.writeU8(0xd0);\n this.writeI8(object);\n }\n else if (object >= -0x8000) {\n // int 16\n this.writeU8(0xd1);\n this.writeI16(object);\n }\n else if (object >= -0x80000000) {\n // int 32\n this.writeU8(0xd2);\n this.writeI32(object);\n }\n else {\n // int 64\n this.writeU8(0xd3);\n this.writeI64(object);\n }\n }\n }\n else {\n // non-integer numbers\n if (this.forceFloat32) {\n // float 32\n this.writeU8(0xca);\n this.writeF32(object);\n }\n else {\n // float 64\n this.writeU8(0xcb);\n this.writeF64(object);\n }\n }\n };\n Encoder.prototype.writeStringHeader = function (byteLength) {\n if (byteLength < 32) {\n // fixstr\n this.writeU8(0xa0 + byteLength);\n }\n else if (byteLength < 0x100) {\n // str 8\n this.writeU8(0xd9);\n this.writeU8(byteLength);\n }\n else if (byteLength < 0x10000) {\n // str 16\n this.writeU8(0xda);\n this.writeU16(byteLength);\n }\n else if (byteLength < 0x100000000) {\n // str 32\n this.writeU8(0xdb);\n this.writeU32(byteLength);\n }\n else {\n throw new Error(\"Too long string: \" + byteLength + \" bytes in UTF-8\");\n }\n };\n Encoder.prototype.encodeString = function (object) {\n var maxHeaderSize = 1 + 4;\n var strLength = object.length;\n if (strLength > TEXT_ENCODER_THRESHOLD) {\n var byteLength = utf8Count(object);\n this.ensureBufferSizeToWrite(maxHeaderSize + byteLength);\n this.writeStringHeader(byteLength);\n utf8EncodeTE(object, this.bytes, this.pos);\n this.pos += byteLength;\n }\n else {\n var byteLength = utf8Count(object);\n this.ensureBufferSizeToWrite(maxHeaderSize + byteLength);\n this.writeStringHeader(byteLength);\n utf8EncodeJs(object, this.bytes, this.pos);\n this.pos += byteLength;\n }\n };\n Encoder.prototype.encodeObject = function (object, depth) {\n // try to encode objects with custom codec first of non-primitives\n var ext = this.extensionCodec.tryToEncode(object, this.context);\n if (ext != null) {\n this.encodeExtension(ext);\n }\n else if (Array.isArray(object)) {\n this.encodeArray(object, depth);\n }\n else if (ArrayBuffer.isView(object)) {\n this.encodeBinary(object);\n }\n else if (typeof object === \"object\") {\n this.encodeMap(object, depth);\n }\n else {\n // symbol, function and other special object come here unless extensionCodec handles them.\n throw new Error(\"Unrecognized object: \" + Object.prototype.toString.apply(object));\n }\n };\n Encoder.prototype.encodeBinary = function (object) {\n var size = object.byteLength;\n if (size < 0x100) {\n // bin 8\n this.writeU8(0xc4);\n this.writeU8(size);\n }\n else if (size < 0x10000) {\n // bin 16\n this.writeU8(0xc5);\n this.writeU16(size);\n }\n else if (size < 0x100000000) {\n // bin 32\n this.writeU8(0xc6);\n this.writeU32(size);\n }\n else {\n throw new Error(\"Too large binary: \" + size);\n }\n var bytes = ensureUint8Array(object);\n this.writeU8a(bytes);\n };\n Encoder.prototype.encodeArray = function (object, depth) {\n var size = object.length;\n if (size < 16) {\n // fixarray\n this.writeU8(0x90 + size);\n }\n else if (size < 0x10000) {\n // array 16\n this.writeU8(0xdc);\n this.writeU16(size);\n }\n else if (size < 0x100000000) {\n // array 32\n this.writeU8(0xdd);\n this.writeU32(size);\n }\n else {\n throw new Error(\"Too large array: \" + size);\n }\n for (var _i = 0, object_1 = object; _i < object_1.length; _i++) {\n var item = object_1[_i];\n this.doEncode(item, depth + 1);\n }\n };\n Encoder.prototype.countWithoutUndefined = function (object, keys) {\n var count = 0;\n for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {\n var key = keys_1[_i];\n if (object[key] !== undefined) {\n count++;\n }\n }\n return count;\n };\n Encoder.prototype.encodeMap = function (object, depth) {\n var keys = Object.keys(object);\n if (this.sortKeys) {\n keys.sort();\n }\n var size = this.ignoreUndefined ? this.countWithoutUndefined(object, keys) : keys.length;\n if (size < 16) {\n // fixmap\n this.writeU8(0x80 + size);\n }\n else if (size < 0x10000) {\n // map 16\n this.writeU8(0xde);\n this.writeU16(size);\n }\n else if (size < 0x100000000) {\n // map 32\n this.writeU8(0xdf);\n this.writeU32(size);\n }\n else {\n throw new Error(\"Too large map object: \" + size);\n }\n for (var _i = 0, keys_2 = keys; _i < keys_2.length; _i++) {\n var key = keys_2[_i];\n var value = object[key];\n if (!(this.ignoreUndefined && value === undefined)) {\n this.encodeString(key);\n this.doEncode(value, depth + 1);\n }\n }\n };\n Encoder.prototype.encodeExtension = function (ext) {\n var size = ext.data.length;\n if (size === 1) {\n // fixext 1\n this.writeU8(0xd4);\n }\n else if (size === 2) {\n // fixext 2\n this.writeU8(0xd5);\n }\n else if (size === 4) {\n // fixext 4\n this.writeU8(0xd6);\n }\n else if (size === 8) {\n // fixext 8\n this.writeU8(0xd7);\n }\n else if (size === 16) {\n // fixext 16\n this.writeU8(0xd8);\n }\n else if (size < 0x100) {\n // ext 8\n this.writeU8(0xc7);\n this.writeU8(size);\n }\n else if (size < 0x10000) {\n // ext 16\n this.writeU8(0xc8);\n this.writeU16(size);\n }\n else if (size < 0x100000000) {\n // ext 32\n this.writeU8(0xc9);\n this.writeU32(size);\n }\n else {\n throw new Error(\"Too large extension object: \" + size);\n }\n this.writeI8(ext.type);\n this.writeU8a(ext.data);\n };\n Encoder.prototype.writeU8 = function (value) {\n this.ensureBufferSizeToWrite(1);\n this.view.setUint8(this.pos, value);\n this.pos++;\n };\n Encoder.prototype.writeU8a = function (values) {\n var size = values.length;\n this.ensureBufferSizeToWrite(size);\n this.bytes.set(values, this.pos);\n this.pos += size;\n };\n Encoder.prototype.writeI8 = function (value) {\n this.ensureBufferSizeToWrite(1);\n this.view.setInt8(this.pos, value);\n this.pos++;\n };\n Encoder.prototype.writeU16 = function (value) {\n this.ensureBufferSizeToWrite(2);\n this.view.setUint16(this.pos, value);\n this.pos += 2;\n };\n Encoder.prototype.writeI16 = function (value) {\n this.ensureBufferSizeToWrite(2);\n this.view.setInt16(this.pos, value);\n this.pos += 2;\n };\n Encoder.prototype.writeU32 = function (value) {\n this.ensureBufferSizeToWrite(4);\n this.view.setUint32(this.pos, value);\n this.pos += 4;\n };\n Encoder.prototype.writeI32 = function (value) {\n this.ensureBufferSizeToWrite(4);\n this.view.setInt32(this.pos, value);\n this.pos += 4;\n };\n Encoder.prototype.writeF32 = function (value) {\n this.ensureBufferSizeToWrite(4);\n this.view.setFloat32(this.pos, value);\n this.pos += 4;\n };\n Encoder.prototype.writeF64 = function (value) {\n this.ensureBufferSizeToWrite(8);\n this.view.setFloat64(this.pos, value);\n this.pos += 8;\n };\n Encoder.prototype.writeU64 = function (value) {\n this.ensureBufferSizeToWrite(8);\n setUint64(this.view, this.pos, value);\n this.pos += 8;\n };\n Encoder.prototype.writeI64 = function (value) {\n this.ensureBufferSizeToWrite(8);\n setInt64(this.view, this.pos, value);\n this.pos += 8;\n };\n return Encoder;\n}());\nexport { Encoder };\n//# sourceMappingURL=Encoder.mjs.map","import { Encoder } from \"./Encoder.mjs\";\nvar defaultEncodeOptions = {};\n/**\n * It encodes `value` in the MessagePack format and\n * returns a byte buffer.\n *\n * The returned buffer is a slice of a larger `ArrayBuffer`, so you have to use its `#byteOffset` and `#byteLength` in order to convert it to another typed arrays including NodeJS `Buffer`.\n */\nexport function encode(value, options) {\n if (options === void 0) { options = defaultEncodeOptions; }\n var encoder = new Encoder(options.extensionCodec, options.context, options.maxDepth, options.initialBufferSize, options.sortKeys, options.forceFloat32, options.ignoreUndefined, options.forceIntegerToFloat);\n return encoder.encode(value);\n}\n//# sourceMappingURL=encode.mjs.map","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from) {\r\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\r\n to[j] = from[i];\r\n return to;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","export function prettyByte(byte) {\n return (byte < 0 ? \"-\" : \"\") + \"0x\" + Math.abs(byte).toString(16).padStart(2, \"0\");\n}\n//# sourceMappingURL=prettyByte.mjs.map","import { utf8DecodeJs } from \"./utils/utf8.mjs\";\nvar DEFAULT_MAX_KEY_LENGTH = 16;\nvar DEFAULT_MAX_LENGTH_PER_KEY = 16;\nvar CachedKeyDecoder = /** @class */ (function () {\n function CachedKeyDecoder(maxKeyLength, maxLengthPerKey) {\n if (maxKeyLength === void 0) { maxKeyLength = DEFAULT_MAX_KEY_LENGTH; }\n if (maxLengthPerKey === void 0) { maxLengthPerKey = DEFAULT_MAX_LENGTH_PER_KEY; }\n this.maxKeyLength = maxKeyLength;\n this.maxLengthPerKey = maxLengthPerKey;\n this.hit = 0;\n this.miss = 0;\n // avoid `new Array(N)` to create a non-sparse array for performance.\n this.caches = [];\n for (var i = 0; i < this.maxKeyLength; i++) {\n this.caches.push([]);\n }\n }\n CachedKeyDecoder.prototype.canBeCached = function (byteLength) {\n return byteLength > 0 && byteLength <= this.maxKeyLength;\n };\n CachedKeyDecoder.prototype.get = function (bytes, inputOffset, byteLength) {\n var records = this.caches[byteLength - 1];\n FIND_CHUNK: for (var _i = 0, records_1 = records; _i < records_1.length; _i++) {\n var record = records_1[_i];\n var recordBytes = record.bytes;\n for (var j = 0; j < byteLength; j++) {\n if (recordBytes[j] !== bytes[inputOffset + j]) {\n continue FIND_CHUNK;\n }\n }\n return record.value;\n }\n return null;\n };\n CachedKeyDecoder.prototype.store = function (bytes, value) {\n var records = this.caches[bytes.length - 1];\n var record = { bytes: bytes, value: value };\n if (records.length >= this.maxLengthPerKey) {\n // `records` are full!\n // Set `record` to a randomized position.\n records[(Math.random() * records.length) | 0] = record;\n }\n else {\n records.push(record);\n }\n };\n CachedKeyDecoder.prototype.decode = function (bytes, inputOffset, byteLength) {\n var cachedValue = this.get(bytes, inputOffset, byteLength);\n if (cachedValue != null) {\n this.hit++;\n return cachedValue;\n }\n this.miss++;\n var value = utf8DecodeJs(bytes, inputOffset, byteLength);\n // Ensure to copy a slice of bytes because the byte may be NodeJS Buffer and Buffer#slice() returns a reference to its internal ArrayBuffer.\n var slicedCopyOfBytes = Uint8Array.prototype.slice.call(bytes, inputOffset, inputOffset + byteLength);\n this.store(slicedCopyOfBytes, value);\n return value;\n };\n return CachedKeyDecoder;\n}());\nexport { CachedKeyDecoder };\n//# sourceMappingURL=CachedKeyDecoder.mjs.map","import { __asyncGenerator, __asyncValues, __await, __awaiter, __extends, __generator } from \"tslib\";\nimport { prettyByte } from \"./utils/prettyByte.mjs\";\nimport { ExtensionCodec } from \"./ExtensionCodec.mjs\";\nimport { getInt64, getUint64 } from \"./utils/int.mjs\";\nimport { utf8DecodeJs, TEXT_DECODER_THRESHOLD, utf8DecodeTD } from \"./utils/utf8.mjs\";\nimport { createDataView, ensureUint8Array } from \"./utils/typedArrays.mjs\";\nimport { CachedKeyDecoder } from \"./CachedKeyDecoder.mjs\";\nvar isValidMapKeyType = function (key) {\n var keyType = typeof key;\n return keyType === \"string\" || keyType === \"number\";\n};\nvar HEAD_BYTE_REQUIRED = -1;\nvar EMPTY_VIEW = new DataView(new ArrayBuffer(0));\nvar EMPTY_BYTES = new Uint8Array(EMPTY_VIEW.buffer);\n// IE11: Hack to support IE11.\n// IE11: Drop this hack and just use RangeError when IE11 is obsolete.\nexport var DataViewIndexOutOfBoundsError = (function () {\n try {\n // IE11: The spec says it should throw RangeError,\n // IE11: but in IE11 it throws TypeError.\n EMPTY_VIEW.getInt8(0);\n }\n catch (e) {\n return e.constructor;\n }\n throw new Error(\"never reached\");\n})();\nvar MORE_DATA = new DataViewIndexOutOfBoundsError(\"Insufficient data\");\nvar DEFAULT_MAX_LENGTH = 4294967295; // uint32_max\nvar sharedCachedKeyDecoder = new CachedKeyDecoder();\nvar DecodeError = /** @class */ (function (_super) {\n __extends(DecodeError, _super);\n function DecodeError(message) {\n var _this = _super.call(this, message) || this;\n // fix the prototype chain in a cross-platform way\n var proto = Object.create(DecodeError.prototype);\n Object.setPrototypeOf(_this, proto);\n Object.defineProperty(_this, \"name\", {\n configurable: true,\n enumerable: false,\n value: DecodeError.name,\n });\n return _this;\n }\n return DecodeError;\n}(Error));\nexport { DecodeError };\nvar Decoder = /** @class */ (function () {\n function Decoder(extensionCodec, context, maxStrLength, maxBinLength, maxArrayLength, maxMapLength, maxExtLength, keyDecoder) {\n if (extensionCodec === void 0) { extensionCodec = ExtensionCodec.defaultCodec; }\n if (context === void 0) { context = undefined; }\n if (maxStrLength === void 0) { maxStrLength = DEFAULT_MAX_LENGTH; }\n if (maxBinLength === void 0) { maxBinLength = DEFAULT_MAX_LENGTH; }\n if (maxArrayLength === void 0) { maxArrayLength = DEFAULT_MAX_LENGTH; }\n if (maxMapLength === void 0) { maxMapLength = DEFAULT_MAX_LENGTH; }\n if (maxExtLength === void 0) { maxExtLength = DEFAULT_MAX_LENGTH; }\n if (keyDecoder === void 0) { keyDecoder = sharedCachedKeyDecoder; }\n this.extensionCodec = extensionCodec;\n this.context = context;\n this.maxStrLength = maxStrLength;\n this.maxBinLength = maxBinLength;\n this.maxArrayLength = maxArrayLength;\n this.maxMapLength = maxMapLength;\n this.maxExtLength = maxExtLength;\n this.keyDecoder = keyDecoder;\n this.totalPos = 0;\n this.pos = 0;\n this.view = EMPTY_VIEW;\n this.bytes = EMPTY_BYTES;\n this.headByte = HEAD_BYTE_REQUIRED;\n this.stack = [];\n }\n Decoder.prototype.reinitializeState = function () {\n this.totalPos = 0;\n this.headByte = HEAD_BYTE_REQUIRED;\n };\n Decoder.prototype.setBuffer = function (buffer) {\n this.bytes = ensureUint8Array(buffer);\n this.view = createDataView(this.bytes);\n this.pos = 0;\n };\n Decoder.prototype.appendBuffer = function (buffer) {\n if (this.headByte === HEAD_BYTE_REQUIRED && !this.hasRemaining()) {\n this.setBuffer(buffer);\n }\n else {\n // retried because data is insufficient\n var remainingData = this.bytes.subarray(this.pos);\n var newData = ensureUint8Array(buffer);\n var concated = new Uint8Array(remainingData.length + newData.length);\n concated.set(remainingData);\n concated.set(newData, remainingData.length);\n this.setBuffer(concated);\n }\n };\n Decoder.prototype.hasRemaining = function (size) {\n if (size === void 0) { size = 1; }\n return this.view.byteLength - this.pos >= size;\n };\n Decoder.prototype.createExtraByteError = function (posToShow) {\n var _a = this, view = _a.view, pos = _a.pos;\n return new RangeError(\"Extra \" + (view.byteLength - pos) + \" of \" + view.byteLength + \" byte(s) found at buffer[\" + posToShow + \"]\");\n };\n Decoder.prototype.decode = function (buffer) {\n this.reinitializeState();\n this.setBuffer(buffer);\n var object = this.doDecodeSync();\n if (this.hasRemaining()) {\n throw this.createExtraByteError(this.pos);\n }\n return object;\n };\n Decoder.prototype.decodeMulti = function (buffer) {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n this.reinitializeState();\n this.setBuffer(buffer);\n _a.label = 1;\n case 1:\n if (!this.hasRemaining()) return [3 /*break*/, 3];\n return [4 /*yield*/, this.doDecodeSync()];\n case 2:\n _a.sent();\n return [3 /*break*/, 1];\n case 3: return [2 /*return*/];\n }\n });\n };\n Decoder.prototype.decodeAsync = function (stream) {\n var stream_1, stream_1_1;\n var e_1, _a;\n return __awaiter(this, void 0, void 0, function () {\n var decoded, object, buffer, e_1_1, _b, headByte, pos, totalPos;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n decoded = false;\n _c.label = 1;\n case 1:\n _c.trys.push([1, 6, 7, 12]);\n stream_1 = __asyncValues(stream);\n _c.label = 2;\n case 2: return [4 /*yield*/, stream_1.next()];\n case 3:\n if (!(stream_1_1 = _c.sent(), !stream_1_1.done)) return [3 /*break*/, 5];\n buffer = stream_1_1.value;\n if (decoded) {\n throw this.createExtraByteError(this.totalPos);\n }\n this.appendBuffer(buffer);\n try {\n object = this.doDecodeSync();\n decoded = true;\n }\n catch (e) {\n if (!(e instanceof DataViewIndexOutOfBoundsError)) {\n throw e; // rethrow\n }\n // fallthrough\n }\n this.totalPos += this.pos;\n _c.label = 4;\n case 4: return [3 /*break*/, 2];\n case 5: return [3 /*break*/, 12];\n case 6:\n e_1_1 = _c.sent();\n e_1 = { error: e_1_1 };\n return [3 /*break*/, 12];\n case 7:\n _c.trys.push([7, , 10, 11]);\n if (!(stream_1_1 && !stream_1_1.done && (_a = stream_1.return))) return [3 /*break*/, 9];\n return [4 /*yield*/, _a.call(stream_1)];\n case 8:\n _c.sent();\n _c.label = 9;\n case 9: return [3 /*break*/, 11];\n case 10:\n if (e_1) throw e_1.error;\n return [7 /*endfinally*/];\n case 11: return [7 /*endfinally*/];\n case 12:\n if (decoded) {\n if (this.hasRemaining()) {\n throw this.createExtraByteError(this.totalPos);\n }\n return [2 /*return*/, object];\n }\n _b = this, headByte = _b.headByte, pos = _b.pos, totalPos = _b.totalPos;\n throw new RangeError(\"Insufficient data in parsing \" + prettyByte(headByte) + \" at \" + totalPos + \" (\" + pos + \" in the current buffer)\");\n }\n });\n });\n };\n Decoder.prototype.decodeArrayStream = function (stream) {\n return this.decodeMultiAsync(stream, true);\n };\n Decoder.prototype.decodeStream = function (stream) {\n return this.decodeMultiAsync(stream, false);\n };\n Decoder.prototype.decodeMultiAsync = function (stream, isArray) {\n return __asyncGenerator(this, arguments, function decodeMultiAsync_1() {\n var isArrayHeaderRequired, arrayItemsLeft, stream_2, stream_2_1, buffer, e_2, e_3_1;\n var e_3, _a;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n isArrayHeaderRequired = isArray;\n arrayItemsLeft = -1;\n _b.label = 1;\n case 1:\n _b.trys.push([1, 13, 14, 19]);\n stream_2 = __asyncValues(stream);\n _b.label = 2;\n case 2: return [4 /*yield*/, __await(stream_2.next())];\n case 3:\n if (!(stream_2_1 = _b.sent(), !stream_2_1.done)) return [3 /*break*/, 12];\n buffer = stream_2_1.value;\n if (isArray && arrayItemsLeft === 0) {\n throw this.createExtraByteError(this.totalPos);\n }\n this.appendBuffer(buffer);\n if (isArrayHeaderRequired) {\n arrayItemsLeft = this.readArraySize();\n isArrayHeaderRequired = false;\n this.complete();\n }\n _b.label = 4;\n case 4:\n _b.trys.push([4, 9, , 10]);\n _b.label = 5;\n case 5:\n if (!true) return [3 /*break*/, 8];\n return [4 /*yield*/, __await(this.doDecodeSync())];\n case 6: return [4 /*yield*/, _b.sent()];\n case 7:\n _b.sent();\n if (--arrayItemsLeft === 0) {\n return [3 /*break*/, 8];\n }\n return [3 /*break*/, 5];\n case 8: return [3 /*break*/, 10];\n case 9:\n e_2 = _b.sent();\n if (!(e_2 instanceof DataViewIndexOutOfBoundsError)) {\n throw e_2; // rethrow\n }\n return [3 /*break*/, 10];\n case 10:\n this.totalPos += this.pos;\n _b.label = 11;\n case 11: return [3 /*break*/, 2];\n case 12: return [3 /*break*/, 19];\n case 13:\n e_3_1 = _b.sent();\n e_3 = { error: e_3_1 };\n return [3 /*break*/, 19];\n case 14:\n _b.trys.push([14, , 17, 18]);\n if (!(stream_2_1 && !stream_2_1.done && (_a = stream_2.return))) return [3 /*break*/, 16];\n return [4 /*yield*/, __await(_a.call(stream_2))];\n case 15:\n _b.sent();\n _b.label = 16;\n case 16: return [3 /*break*/, 18];\n case 17:\n if (e_3) throw e_3.error;\n return [7 /*endfinally*/];\n case 18: return [7 /*endfinally*/];\n case 19: return [2 /*return*/];\n }\n });\n });\n };\n Decoder.prototype.doDecodeSync = function () {\n DECODE: while (true) {\n var headByte = this.readHeadByte();\n var object = void 0;\n if (headByte >= 0xe0) {\n // negative fixint (111x xxxx) 0xe0 - 0xff\n object = headByte - 0x100;\n }\n else if (headByte < 0xc0) {\n if (headByte < 0x80) {\n // positive fixint (0xxx xxxx) 0x00 - 0x7f\n object = headByte;\n }\n else if (headByte < 0x90) {\n // fixmap (1000 xxxx) 0x80 - 0x8f\n var size = headByte - 0x80;\n if (size !== 0) {\n this.pushMapState(size);\n this.complete();\n continue DECODE;\n }\n else {\n object = {};\n }\n }\n else if (headByte < 0xa0) {\n // fixarray (1001 xxxx) 0x90 - 0x9f\n var size = headByte - 0x90;\n if (size !== 0) {\n this.pushArrayState(size);\n this.complete();\n continue DECODE;\n }\n else {\n object = [];\n }\n }\n else {\n // fixstr (101x xxxx) 0xa0 - 0xbf\n var byteLength = headByte - 0xa0;\n object = this.decodeUtf8String(byteLength, 0);\n }\n }\n else if (headByte === 0xc0) {\n // nil\n object = null;\n }\n else if (headByte === 0xc2) {\n // false\n object = false;\n }\n else if (headByte === 0xc3) {\n // true\n object = true;\n }\n else if (headByte === 0xca) {\n // float 32\n object = this.readF32();\n }\n else if (headByte === 0xcb) {\n // float 64\n object = this.readF64();\n }\n else if (headByte === 0xcc) {\n // uint 8\n object = this.readU8();\n }\n else if (headByte === 0xcd) {\n // uint 16\n object = this.readU16();\n }\n else if (headByte === 0xce) {\n // uint 32\n object = this.readU32();\n }\n else if (headByte === 0xcf) {\n // uint 64\n object = this.readU64();\n }\n else if (headByte === 0xd0) {\n // int 8\n object = this.readI8();\n }\n else if (headByte === 0xd1) {\n // int 16\n object = this.readI16();\n }\n else if (headByte === 0xd2) {\n // int 32\n object = this.readI32();\n }\n else if (headByte === 0xd3) {\n // int 64\n object = this.readI64();\n }\n else if (headByte === 0xd9) {\n // str 8\n var byteLength = this.lookU8();\n object = this.decodeUtf8String(byteLength, 1);\n }\n else if (headByte === 0xda) {\n // str 16\n var byteLength = this.lookU16();\n object = this.decodeUtf8String(byteLength, 2);\n }\n else if (headByte === 0xdb) {\n // str 32\n var byteLength = this.lookU32();\n object = this.decodeUtf8String(byteLength, 4);\n }\n else if (headByte === 0xdc) {\n // array 16\n var size = this.readU16();\n if (size !== 0) {\n this.pushArrayState(size);\n this.complete();\n continue DECODE;\n }\n else {\n object = [];\n }\n }\n else if (headByte === 0xdd) {\n // array 32\n var size = this.readU32();\n if (size !== 0) {\n this.pushArrayState(size);\n this.complete();\n continue DECODE;\n }\n else {\n object = [];\n }\n }\n else if (headByte === 0xde) {\n // map 16\n var size = this.readU16();\n if (size !== 0) {\n this.pushMapState(size);\n this.complete();\n continue DECODE;\n }\n else {\n object = {};\n }\n }\n else if (headByte === 0xdf) {\n // map 32\n var size = this.readU32();\n if (size !== 0) {\n this.pushMapState(size);\n this.complete();\n continue DECODE;\n }\n else {\n object = {};\n }\n }\n else if (headByte === 0xc4) {\n // bin 8\n var size = this.lookU8();\n object = this.decodeBinary(size, 1);\n }\n else if (headByte === 0xc5) {\n // bin 16\n var size = this.lookU16();\n object = this.decodeBinary(size, 2);\n }\n else if (headByte === 0xc6) {\n // bin 32\n var size = this.lookU32();\n object = this.decodeBinary(size, 4);\n }\n else if (headByte === 0xd4) {\n // fixext 1\n object = this.decodeExtension(1, 0);\n }\n else if (headByte === 0xd5) {\n // fixext 2\n object = this.decodeExtension(2, 0);\n }\n else if (headByte === 0xd6) {\n // fixext 4\n object = this.decodeExtension(4, 0);\n }\n else if (headByte === 0xd7) {\n // fixext 8\n object = this.decodeExtension(8, 0);\n }\n else if (headByte === 0xd8) {\n // fixext 16\n object = this.decodeExtension(16, 0);\n }\n else if (headByte === 0xc7) {\n // ext 8\n var size = this.lookU8();\n object = this.decodeExtension(size, 1);\n }\n else if (headByte === 0xc8) {\n // ext 16\n var size = this.lookU16();\n object = this.decodeExtension(size, 2);\n }\n else if (headByte === 0xc9) {\n // ext 32\n var size = this.lookU32();\n object = this.decodeExtension(size, 4);\n }\n else {\n throw new DecodeError(\"Unrecognized type byte: \" + prettyByte(headByte));\n }\n this.complete();\n var stack = this.stack;\n while (stack.length > 0) {\n // arrays and maps\n var state = stack[stack.length - 1];\n if (state.type === 0 /* ARRAY */) {\n state.array[state.position] = object;\n state.position++;\n if (state.position === state.size) {\n stack.pop();\n object = state.array;\n }\n else {\n continue DECODE;\n }\n }\n else if (state.type === 1 /* MAP_KEY */) {\n if (!isValidMapKeyType(object)) {\n throw new DecodeError(\"The type of key must be string or number but \" + typeof object);\n }\n if (object === \"__proto__\") {\n throw new DecodeError(\"The key __proto__ is not allowed\");\n }\n state.key = object;\n state.type = 2 /* MAP_VALUE */;\n continue DECODE;\n }\n else {\n // it must be `state.type === State.MAP_VALUE` here\n state.map[state.key] = object;\n state.readCount++;\n if (state.readCount === state.size) {\n stack.pop();\n object = state.map;\n }\n else {\n state.key = null;\n state.type = 1 /* MAP_KEY */;\n continue DECODE;\n }\n }\n }\n return object;\n }\n };\n Decoder.prototype.readHeadByte = function () {\n if (this.headByte === HEAD_BYTE_REQUIRED) {\n this.headByte = this.readU8();\n // console.log(\"headByte\", prettyByte(this.headByte));\n }\n return this.headByte;\n };\n Decoder.prototype.complete = function () {\n this.headByte = HEAD_BYTE_REQUIRED;\n };\n Decoder.prototype.readArraySize = function () {\n var headByte = this.readHeadByte();\n switch (headByte) {\n case 0xdc:\n return this.readU16();\n case 0xdd:\n return this.readU32();\n default: {\n if (headByte < 0xa0) {\n return headByte - 0x90;\n }\n else {\n throw new DecodeError(\"Unrecognized array type byte: \" + prettyByte(headByte));\n }\n }\n }\n };\n Decoder.prototype.pushMapState = function (size) {\n if (size > this.maxMapLength) {\n throw new DecodeError(\"Max length exceeded: map length (\" + size + \") > maxMapLengthLength (\" + this.maxMapLength + \")\");\n }\n this.stack.push({\n type: 1 /* MAP_KEY */,\n size: size,\n key: null,\n readCount: 0,\n map: {},\n });\n };\n Decoder.prototype.pushArrayState = function (size) {\n if (size > this.maxArrayLength) {\n throw new DecodeError(\"Max length exceeded: array length (\" + size + \") > maxArrayLength (\" + this.maxArrayLength + \")\");\n }\n this.stack.push({\n type: 0 /* ARRAY */,\n size: size,\n array: new Array(size),\n position: 0,\n });\n };\n Decoder.prototype.decodeUtf8String = function (byteLength, headerOffset) {\n var _a;\n if (byteLength > this.maxStrLength) {\n throw new DecodeError(\"Max length exceeded: UTF-8 byte length (\" + byteLength + \") > maxStrLength (\" + this.maxStrLength + \")\");\n }\n if (this.bytes.byteLength < this.pos + headerOffset + byteLength) {\n throw MORE_DATA;\n }\n var offset = this.pos + headerOffset;\n var object;\n if (this.stateIsMapKey() && ((_a = this.keyDecoder) === null || _a === void 0 ? void 0 : _a.canBeCached(byteLength))) {\n object = this.keyDecoder.decode(this.bytes, offset, byteLength);\n }\n else if (byteLength > TEXT_DECODER_THRESHOLD) {\n object = utf8DecodeTD(this.bytes, offset, byteLength);\n }\n else {\n object = utf8DecodeJs(this.bytes, offset, byteLength);\n }\n this.pos += headerOffset + byteLength;\n return object;\n };\n Decoder.prototype.stateIsMapKey = function () {\n if (this.stack.length > 0) {\n var state = this.stack[this.stack.length - 1];\n return state.type === 1 /* MAP_KEY */;\n }\n return false;\n };\n Decoder.prototype.decodeBinary = function (byteLength, headOffset) {\n if (byteLength > this.maxBinLength) {\n throw new DecodeError(\"Max length exceeded: bin length (\" + byteLength + \") > maxBinLength (\" + this.maxBinLength + \")\");\n }\n if (!this.hasRemaining(byteLength + headOffset)) {\n throw MORE_DATA;\n }\n var offset = this.pos + headOffset;\n var object = this.bytes.subarray(offset, offset + byteLength);\n this.pos += headOffset + byteLength;\n return object;\n };\n Decoder.prototype.decodeExtension = function (size, headOffset) {\n if (size > this.maxExtLength) {\n throw new DecodeError(\"Max length exceeded: ext length (\" + size + \") > maxExtLength (\" + this.maxExtLength + \")\");\n }\n var extType = this.view.getInt8(this.pos + headOffset);\n var data = this.decodeBinary(size, headOffset + 1 /* extType */);\n return this.extensionCodec.decode(data, extType, this.context);\n };\n Decoder.prototype.lookU8 = function () {\n return this.view.getUint8(this.pos);\n };\n Decoder.prototype.lookU16 = function () {\n return this.view.getUint16(this.pos);\n };\n Decoder.prototype.lookU32 = function () {\n return this.view.getUint32(this.pos);\n };\n Decoder.prototype.readU8 = function () {\n var value = this.view.getUint8(this.pos);\n this.pos++;\n return value;\n };\n Decoder.prototype.readI8 = function () {\n var value = this.view.getInt8(this.pos);\n this.pos++;\n return value;\n };\n Decoder.prototype.readU16 = function () {\n var value = this.view.getUint16(this.pos);\n this.pos += 2;\n return value;\n };\n Decoder.prototype.readI16 = function () {\n var value = this.view.getInt16(this.pos);\n this.pos += 2;\n return value;\n };\n Decoder.prototype.readU32 = function () {\n var value = this.view.getUint32(this.pos);\n this.pos += 4;\n return value;\n };\n Decoder.prototype.readI32 = function () {\n var value = this.view.getInt32(this.pos);\n this.pos += 4;\n return value;\n };\n Decoder.prototype.readU64 = function () {\n var value = getUint64(this.view, this.pos);\n this.pos += 8;\n return value;\n };\n Decoder.prototype.readI64 = function () {\n var value = getInt64(this.view, this.pos);\n this.pos += 8;\n return value;\n };\n Decoder.prototype.readF32 = function () {\n var value = this.view.getFloat32(this.pos);\n this.pos += 4;\n return value;\n };\n Decoder.prototype.readF64 = function () {\n var value = this.view.getFloat64(this.pos);\n this.pos += 8;\n return value;\n };\n return Decoder;\n}());\nexport { Decoder };\n//# sourceMappingURL=Decoder.mjs.map","import { Decoder } from \"./Decoder.mjs\";\nexport var defaultDecodeOptions = {};\n/**\n * It decodes a single MessagePack object in a buffer.\n *\n * This is a synchronous decoding function.\n * See other variants for asynchronous decoding: {@link decodeAsync()}, {@link decodeStream()}, or {@link decodeArrayStream()}.\n */\nexport function decode(buffer, options) {\n if (options === void 0) { options = defaultDecodeOptions; }\n var decoder = new Decoder(options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength);\n return decoder.decode(buffer);\n}\n/**\n * It decodes multiple MessagePack objects in a buffer.\n * This is corresponding to {@link decodeMultiStream()}.\n */\nexport function decodeMulti(buffer, options) {\n if (options === void 0) { options = defaultDecodeOptions; }\n var decoder = new Decoder(options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength);\n return decoder.decodeMulti(buffer);\n}\n//# sourceMappingURL=decode.mjs.map","// utility for whatwg streams\nimport { __asyncGenerator, __await, __generator } from \"tslib\";\nexport function isAsyncIterable(object) {\n return object[Symbol.asyncIterator] != null;\n}\nfunction assertNonNull(value) {\n if (value == null) {\n throw new Error(\"Assertion Failure: value must not be null nor undefined\");\n }\n}\nexport function asyncIterableFromStream(stream) {\n return __asyncGenerator(this, arguments, function asyncIterableFromStream_1() {\n var reader, _a, done, value;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n reader = stream.getReader();\n _b.label = 1;\n case 1:\n _b.trys.push([1, , 9, 10]);\n _b.label = 2;\n case 2:\n if (!true) return [3 /*break*/, 8];\n return [4 /*yield*/, __await(reader.read())];\n case 3:\n _a = _b.sent(), done = _a.done, value = _a.value;\n if (!done) return [3 /*break*/, 5];\n return [4 /*yield*/, __await(void 0)];\n case 4: return [2 /*return*/, _b.sent()];\n case 5:\n assertNonNull(value);\n return [4 /*yield*/, __await(value)];\n case 6: return [4 /*yield*/, _b.sent()];\n case 7:\n _b.sent();\n return [3 /*break*/, 2];\n case 8: return [3 /*break*/, 10];\n case 9:\n reader.releaseLock();\n return [7 /*endfinally*/];\n case 10: return [2 /*return*/];\n }\n });\n });\n}\nexport function ensureAsyncIterable(streamLike) {\n if (isAsyncIterable(streamLike)) {\n return streamLike;\n }\n else {\n return asyncIterableFromStream(streamLike);\n }\n}\n//# sourceMappingURL=stream.mjs.map","import { __awaiter, __generator } from \"tslib\";\nimport { Decoder } from \"./Decoder.mjs\";\nimport { ensureAsyncIterable } from \"./utils/stream.mjs\";\nimport { defaultDecodeOptions } from \"./decode.mjs\";\nexport function decodeAsync(streamLike, options) {\n if (options === void 0) { options = defaultDecodeOptions; }\n return __awaiter(this, void 0, void 0, function () {\n var stream, decoder;\n return __generator(this, function (_a) {\n stream = ensureAsyncIterable(streamLike);\n decoder = new Decoder(options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength);\n return [2 /*return*/, decoder.decodeAsync(stream)];\n });\n });\n}\nexport function decodeArrayStream(streamLike, options) {\n if (options === void 0) { options = defaultDecodeOptions; }\n var stream = ensureAsyncIterable(streamLike);\n var decoder = new Decoder(options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength);\n return decoder.decodeArrayStream(stream);\n}\nexport function decodeMultiStream(streamLike, options) {\n if (options === void 0) { options = defaultDecodeOptions; }\n var stream = ensureAsyncIterable(streamLike);\n var decoder = new Decoder(options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength);\n return decoder.decodeStream(stream);\n}\n/**\n * @deprecated Use {@link decodeMultiStream()} instead.\n */\nexport function decodeStream(streamLike, options) {\n if (options === void 0) { options = defaultDecodeOptions; }\n return decodeMultiStream(streamLike, options);\n}\n//# sourceMappingURL=decodeAsync.mjs.map","// Main Functions:\nimport { encode } from \"./encode.mjs\";\nexport { encode };\nimport { decode, decodeMulti } from \"./decode.mjs\";\nexport { decode, decodeMulti };\nimport { decodeAsync, decodeArrayStream, decodeMultiStream, decodeStream } from \"./decodeAsync.mjs\";\nexport { decodeAsync, decodeArrayStream, decodeMultiStream, decodeStream };\nimport { Decoder, DecodeError } from \"./Decoder.mjs\";\nexport { Decoder, DecodeError };\nimport { Encoder } from \"./Encoder.mjs\";\nexport { Encoder };\n// Utilitiies for Extension Types:\nimport { ExtensionCodec } from \"./ExtensionCodec.mjs\";\nexport { ExtensionCodec };\nimport { ExtData } from \"./ExtData.mjs\";\nexport { ExtData };\nimport { EXT_TIMESTAMP, encodeDateToTimeSpec, encodeTimeSpecToTimestamp, decodeTimestampToTimeSpec, encodeTimestampExtension, decodeTimestampExtension, } from \"./timestamp.mjs\";\nexport { EXT_TIMESTAMP, encodeDateToTimeSpec, encodeTimeSpecToTimestamp, decodeTimestampToTimeSpec, encodeTimestampExtension, decodeTimestampExtension, };\n//# sourceMappingURL=index.mjs.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WsClient = void 0;\nconst isomorphic_ws_1 = __importDefault(require(\"isomorphic-ws\"));\nconst msgpack = __importStar(require(\"@msgpack/msgpack\"));\n/**\n * A Websocket client which can make requests and receive responses,\n * as well as send and receive signals\n *\n * Uses Holochain's websocket WireMessage for communication.\n */\nclass WsClient {\n constructor(socket, signalCb) {\n this.socket = socket;\n this.pendingRequests = {};\n this.index = 0;\n // TODO: allow adding signal handlers later\n this.alreadyWarnedNoSignalCb = false;\n socket.onmessage = (encodedMsg) => __awaiter(this, void 0, void 0, function* () {\n let data = encodedMsg.data;\n // If data is not a buffer (nodejs), it will be a blob (browser)\n if (typeof Buffer === \"undefined\" || !Buffer.isBuffer(data)) {\n data = yield data.arrayBuffer();\n }\n const msg = msgpack.decode(data);\n if (msg.type === \"Signal\") {\n if (signalCb) {\n const decodedMessage = msgpack.decode(msg.data);\n // Note: holochain currently returns signals as an array of two values: cellId and the serialized signal payload\n // and this array is nested within the App key within the returned message.\n const decodedCellId = decodedMessage.App[0];\n // Note:In order to return readible content to the UI, the signal payload must also be decoded.\n const decodedPayload = signalTransform(decodedMessage.App[1]);\n // Return a uniform format to UI (ie: { type, data } - the same format as with callZome and appInfo...)\n const signal = {\n type: msg.type,\n data: { cellId: decodedCellId, payload: decodedPayload },\n };\n signalCb(signal);\n }\n else {\n if (!this.alreadyWarnedNoSignalCb)\n console.log(`Received signal but no signal callback was set in constructor`);\n this.alreadyWarnedNoSignalCb = true;\n }\n }\n else if (msg.type === \"Response\") {\n this.handleResponse(msg);\n }\n else {\n console.error(`Got unrecognized Websocket message type: ${msg.type}`);\n }\n });\n }\n emitSignal(data) {\n const encodedMsg = msgpack.encode({\n type: \"Signal\",\n data: msgpack.encode(data),\n });\n this.socket.send(encodedMsg);\n }\n request(data) {\n let id = this.index;\n this.index += 1;\n const encodedMsg = msgpack.encode({\n id,\n type: \"Request\",\n data: msgpack.encode(data),\n });\n const promise = new Promise((fulfill, reject) => {\n this.pendingRequests[id] = { fulfill, reject };\n });\n if (this.socket.readyState === this.socket.OPEN) {\n this.socket.send(encodedMsg);\n }\n else {\n return Promise.reject(new Error(`Socket is not open`));\n }\n return promise;\n }\n handleResponse(msg) {\n const id = msg.id;\n if (this.pendingRequests[id]) {\n // resolve response\n if (msg.data === null || msg.data === undefined) {\n this.pendingRequests[id].reject(new Error(`Response canceled by responder`));\n }\n else {\n this.pendingRequests[id].fulfill(msgpack.decode(msg.data));\n }\n }\n else {\n console.error(`Got response with no matching request. id=${id}`);\n }\n }\n close() {\n this.socket.close();\n return this.awaitClose();\n }\n awaitClose() {\n return new Promise((resolve) => this.socket.on(\"close\", resolve));\n }\n static connect(url, signalCb) {\n return new Promise((resolve, reject) => {\n const socket = new isomorphic_ws_1.default(url);\n // make sure that there are no uncaught connection\n // errors because that causes nodejs thread to crash\n // with uncaught exception\n socket.onerror = (e) => {\n reject(new Error(`could not connect to holochain conductor, please check that a conductor service is running and available at ${url}`));\n };\n socket.onopen = () => {\n resolve(new WsClient(socket, signalCb));\n };\n });\n }\n}\nexports.WsClient = WsClient;\nconst signalTransform = (res) => {\n return msgpack.decode(res);\n};\n//# sourceMappingURL=client.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.promiseTimeout = exports.catchError = exports.DEFAULT_TIMEOUT = void 0;\nconst ERROR_TYPE = 'error';\nexports.DEFAULT_TIMEOUT = 15000;\nexports.catchError = (res) => {\n return res.type === ERROR_TYPE\n ? Promise.reject(res)\n : Promise.resolve(res);\n};\nexports.promiseTimeout = (promise, tag, ms) => {\n let id;\n let timeout = new Promise((resolve, reject) => {\n id = setTimeout(() => {\n clearTimeout(id);\n reject(new Error(`Timed out in ${ms}ms: ${tag}`));\n }, ms);\n });\n return new Promise((res, rej) => {\n Promise.race([\n promise,\n timeout\n ]).then((a) => {\n clearTimeout(id);\n return res(a);\n })\n .catch(e => {\n return rej(e);\n });\n });\n};\n//# sourceMappingURL=common.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.requesterTransformer = void 0;\n/**\n * Take a Requester function which deals with tagged requests and responses,\n * and return a Requester which deals only with the inner data types, also\n * with the optional Transformer applied to further modify the input and output.\n */\nexports.requesterTransformer = (requester, tag, transform = identityTransformer) => ((req, timeout) => __awaiter(void 0, void 0, void 0, function* () {\n const input = { type: tag, data: transform.input(req) };\n const response = yield requester(input, timeout);\n const output = transform.output(response.data);\n return output;\n}));\nconst identity = x => x;\nconst identityTransformer = {\n input: identity,\n output: identity,\n};\n//# sourceMappingURL=common.js.map","\"use strict\";\n/**\n * Defines AdminWebsocket, an easy-to-use websocket implementation of the\n * Conductor Admin API\n *\n * const client = AdminWebsocket.connect(\n * 'ws://localhost:9000'\n * )\n *\n * client.generateAgentPubKey()\n * .then(agentPubKey => {\n * console.log('Agent successfully generated:', agentPubKey)\n * })\n * .catch(err => {\n * console.error('problem generating agent:', err)\n * })\n */\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AdminWebsocket = void 0;\nconst client_1 = require(\"./client\");\nconst common_1 = require(\"./common\");\nconst common_2 = require(\"../api/common\");\nclass AdminWebsocket {\n constructor(client, defaultTimeout) {\n this._requester = (tag, transformer) => common_2.requesterTransformer((req, timeout) => common_1.promiseTimeout(this.client.request(req), tag, timeout || this.defaultTimeout).then(common_1.catchError), tag, transformer);\n // the specific request/response types come from the Interface\n // which this class implements\n this.activateApp = this._requester('activate_app');\n this.attachAppInterface = this._requester('attach_app_interface');\n this.deactivateApp = this._requester('deactivate_app');\n this.dumpState = this._requester('dump_state', dumpStateTransform);\n this.generateAgentPubKey = this._requester('generate_agent_pub_key');\n this.registerDna = this._requester('register_dna');\n this.installApp = this._requester('install_app');\n this.installAppBundle = this._requester('install_app_bundle');\n this.createCloneCell = this._requester('create_clone_cell');\n this.listDnas = this._requester('list_dnas');\n this.listCellIds = this._requester('list_cell_ids');\n this.listActiveApps = this._requester('list_active_apps');\n this.requestAgentInfo = this._requester('request_agent_info');\n this.addAgentInfo = this._requester('add_agent_info');\n this.client = client;\n this.defaultTimeout = defaultTimeout === undefined ? common_1.DEFAULT_TIMEOUT : defaultTimeout;\n }\n static connect(url, defaultTimeout) {\n return __awaiter(this, void 0, void 0, function* () {\n const wsClient = yield client_1.WsClient.connect(url);\n return new AdminWebsocket(wsClient, defaultTimeout);\n });\n }\n}\nexports.AdminWebsocket = AdminWebsocket;\nconst dumpStateTransform = {\n input: (req) => req,\n output: (res) => {\n return JSON.parse(res);\n }\n};\n//# sourceMappingURL=admin.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AppWebsocket = void 0;\n/**\n * Defines AppWebsocket, an easy-to-use websocket implementation of the\n * Conductor API for apps\n *\n * const client = AppWebsocket.connect(\n * 'ws://localhost:9000',\n * signal => console.log('got a signal:', signal)\n * )\n *\n * client.callZome({...}) // TODO: show what's in here\n * .then(() => {\n * console.log('DNA successfully installed')\n * })\n * .catch(err => {\n * console.error('problem installing DNA:', err)\n * })\n */\nconst msgpack = __importStar(require(\"@msgpack/msgpack\"));\nconst client_1 = require(\"./client\");\nconst common_1 = require(\"./common\");\nconst common_2 = require(\"../api/common\");\nclass AppWebsocket {\n constructor(client, defaultTimeout) {\n this._requester = (tag, transformer) => common_2.requesterTransformer((req, timeout) => common_1.promiseTimeout(this.client.request(req), tag, timeout || this.defaultTimeout).then(common_1.catchError), tag, transformer);\n this.appInfo = this._requester('app_info');\n this.callZome = this._requester('zome_call_invocation', callZomeTransform);\n this.client = client;\n this.defaultTimeout = defaultTimeout === undefined ? common_1.DEFAULT_TIMEOUT : defaultTimeout;\n }\n static connect(url, defaultTimeout, signalCb) {\n return __awaiter(this, void 0, void 0, function* () {\n const wsClient = yield client_1.WsClient.connect(url, signalCb);\n return new AppWebsocket(wsClient, defaultTimeout);\n });\n }\n}\nexports.AppWebsocket = AppWebsocket;\nconst callZomeTransform = {\n input: (req) => {\n req.payload = msgpack.encode(req.payload);\n return req;\n },\n output: (res) => {\n return msgpack.decode(res);\n }\n};\n//# sourceMappingURL=app.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./api/admin\"), exports);\n__exportStar(require(\"./api/app\"), exports);\n__exportStar(require(\"./api/types\"), exports);\n__exportStar(require(\"./websocket/admin\"), exports);\n__exportStar(require(\"./websocket/app\"), exports);\n//# sourceMappingURL=index.js.map","/**\n * Object.assign\n */\nexport const assign = Object.assign;\n","import { assign } from './assign';\nexport const pending_symbol = Symbol('pending');\n/**\n * Returns a function to ensure that an member key is defined on a ctx object,\n * otherwise it creates the value using the _val factory function.\n */\nexport function _be(key, _val) {\n return (ctx, opts) => {\n if (!ctx.hasOwnProperty(key) || (opts === null || opts === void 0 ? void 0 : opts.force)) {\n let pending = ctx[pending_symbol];\n if (!pending) {\n pending = {};\n assign(ctx, { [pending_symbol]: pending });\n }\n if (pending[key]) {\n console.trace(`_be: key '${key.toString()}' has a circular dependency`);\n throw `_be: key '${key.toString()}' has a circular dependency`;\n }\n pending[key] = true;\n const val = _val(ctx, key, opts);\n if (!ctx.hasOwnProperty(key)) {\n if (val === undefined)\n throw `_be: ${String(key)}: function must return a non-undefined value or directly set the ctx with the property ${String(key)}`;\n assign(ctx, { [key]: val });\n }\n delete pending[key];\n }\n return ctx[key];\n };\n}\nexport { _be as _b, };\n","/**\n * Object keys\n */\nexport const keys = Object.keys.bind(Object);\n","export const native_isArray = Array.isArray;\n/**\n * Is the argument an Array?\n */\nexport function isArray(obj) {\n return native_isArray ? native_isArray(obj) : toString.call(obj) === '[object Array]';\n}\n","/**\n * Object values\n * @function values\n */\nexport const values = Object.values.bind(Object);\n","export function _tuple(...data) {\n return data;\n}\n","import { noop, safe_not_equal, subscribe, run_all, is_function } from '../internal/index.mjs';\nexport { get_store_value as get } from '../internal/index.mjs';\n\nconst subscriber_queue = [];\n/**\n * Creates a `Readable` store that allows reading by subscription.\n * @param value initial value\n * @param {StartStopNotifier}start start and stop notifications for subscriptions\n */\nfunction readable(value, start) {\n return {\n subscribe: writable(value, start).subscribe\n };\n}\n/**\n * Create a `Writable` store that allows both updating and reading by subscription.\n * @param {*=}value initial value\n * @param {StartStopNotifier=}start start and stop notifications for subscriptions\n */\nfunction writable(value, start = noop) {\n let stop;\n const subscribers = [];\n function set(new_value) {\n if (safe_not_equal(value, new_value)) {\n value = new_value;\n if (stop) { // store is ready\n const run_queue = !subscriber_queue.length;\n for (let i = 0; i < subscribers.length; i += 1) {\n const s = subscribers[i];\n s[1]();\n subscriber_queue.push(s, value);\n }\n if (run_queue) {\n for (let i = 0; i < subscriber_queue.length; i += 2) {\n subscriber_queue[i][0](subscriber_queue[i + 1]);\n }\n subscriber_queue.length = 0;\n }\n }\n }\n }\n function update(fn) {\n set(fn(value));\n }\n function subscribe(run, invalidate = noop) {\n const subscriber = [run, invalidate];\n subscribers.push(subscriber);\n if (subscribers.length === 1) {\n stop = start(set) || noop;\n }\n run(value);\n return () => {\n const index = subscribers.indexOf(subscriber);\n if (index !== -1) {\n subscribers.splice(index, 1);\n }\n if (subscribers.length === 0) {\n stop();\n stop = null;\n }\n };\n }\n return { set, update, subscribe };\n}\nfunction derived(stores, fn, initial_value) {\n const single = !Array.isArray(stores);\n const stores_array = single\n ? [stores]\n : stores;\n const auto = fn.length < 2;\n return readable(initial_value, (set) => {\n let inited = false;\n const values = [];\n let pending = 0;\n let cleanup = noop;\n const sync = () => {\n if (pending) {\n return;\n }\n cleanup();\n const result = fn(single ? values[0] : values, set);\n if (auto) {\n set(result);\n }\n else {\n cleanup = is_function(result) ? result : noop;\n }\n };\n const unsubscribers = stores_array.map((store, i) => subscribe(store, (value) => {\n values[i] = value;\n pending &= ~(1 << i);\n if (inited) {\n sync();\n }\n }, () => {\n pending |= (1 << i);\n }));\n inited = true;\n sync();\n return function stop() {\n run_all(unsubscribers);\n cleanup();\n };\n });\n}\n\nexport { derived, readable, writable };\n","import { get as in_get } from 'svelte/store';\nexport function get(store) {\n return in_get(store);\n}\n","import { derived as in_derived } from 'svelte/store';\nimport { _tuple, isArray } from '@ctx-core/array';\nexport function derived(stores, in_fn, initial_value) {\n return (in_fn.length === 1\n ? in_derived(stores, ((values) => {\n return in_fn((isArray(values) ? _tuple(...values) : values));\n }))\n : in_derived(stores, ((values, set) => {\n return in_fn((isArray(values) ? _tuple(...values) : values), set);\n }), initial_value));\n}\n",null,null,null,null,null,null,null,null,null,"<script lang=\"ts\">\n import { getContext } from 'svelte'\n import { connection_b } from '../connection'\n import { folks_b } from './folks_b'\n import { CSSifyHSL } from '../colors'\n import { scribeStr_b } from '../scribe'\n const ctx = getContext('ctx')\n const connection = connection_b(ctx)\n const folks = folks_b(ctx)\n const scribeStr = scribeStr_b(ctx)\n\n export let pubKeyStr = ''\n export let me = false\n\n let scribe\n $: scribe = pubKeyStr == $scribeStr\n\n let outOfSession\n $: outOfSession = (!$folks[pubKeyStr] || !$folks[pubKeyStr].inSession) && !me\n function setUpHex(hexEl) {\n let colors\n if (me) {\n colors = $connection.syn.myColors\n } else {\n colors = $folks[pubKeyStr].colors\n }\n hexEl.style['background-color'] = CSSifyHSL(colors.primary)\n // hex element's first child is its picture/hexagonColor div\n hexEl.firstChild.style['background-color'] = CSSifyHSL(colors.hexagon)\n }\n\n</script>\n<style>\n :global(:root) {\n --folk-hex-width: 60px;\n --folk-hex-height: calc(var(--folk-hex-width) * .8666);\n --hex-border: 4px;\n --scribe-hex-width: calc(var(--folk-hex-width) - 2 * var(--hex-border));\n --scribe-hex-height: calc(var(--folk-hex-height) - 2 * var(--hex-border));\n --scribe-scale: 0.8666\n }\n .folk {\n display: grid;\n width: var(--folk-hex-width);\n height: var(--folk-hex-height);\n clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);\n place-items: center;\n color: white;\n text-shadow: 0 0 5px black;\n cursor: pointer;\n }\n .folk-color {\n z-index: -10;\n content: '';\n width: calc(var(--folk-hex-width) - (var(--hex-border)) * 2);\n height: calc(var(--folk-hex-height) - (var(--hex-border)) * 2);\n clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);\n position: absolute;\n }\n\n .scribe-wrapper {\n display: grid;\n position: relative;\n place-items: center;\n }\n .scribe-halo {\n width: var(--folk-hex-width);\n height: var(--folk-hex-height);\n /* https://www.desmos.com/calculator/bgt97otugr */\n clip-path: polygon(25%0%,75%0%,100%50%,75%100%,25%100%,12.5% 75%,calc(12.5% + 1.732px) calc(75% - 1px),calc(25% + 1.15px) calc(100% - 2px),50% calc(100% - 2px),50% 100%,75% 100%,87.5% 75%,calc(87.5% - 1.732px) calc(75% - 1px),calc(100% - 2.31px) 50%,calc(87.5% - 1.732px) calc(25% + 1px),87.5% 25%,75%0%,50%0%,50% calc(0% + 2px),calc(25% + 1.15px) calc(0% + 2px),calc(12.5% + 1.732px) calc(25% + 1px),12.5% 25%);\n background-color: hsl(0, 0%, 10%);\n position: absolute;\n }\n .scribe {\n margin: var(--hex-border) 0;\n scale: var(--scribe-scale);\n }\n .me {\n }\n\n .out-of-session { /* folk hex outline */\n background-color: goldenrod !important;\n }\n .out-of-session div { /* folk-color */\n background-color: goldenrodyellow !important;\n /* FIXME: this should grey out the hex instead of make it yellow :)*/\n }\n\n</style>\n{#if $connection && $connection.syn}\n {#if scribe}\n <div class='scribe-wrapper'>\n <div use:setUpHex class='folk scribe' class:me class:out-of-session={outOfSession}>\n <div class='folk-color'></div>\n {pubKeyStr.slice(-4)}\n </div>\n <div class='scribe-halo'></div>\n </div>\n {:else}\n <div use:setUpHex class='folk' class:me class:out-of-session={outOfSession}>\n <div class='folk-color'></div>\n {pubKeyStr.slice(-4)}\n </div>\n {/if}\n{/if}\n","<script lang=\"ts\">\n import { connection_b } from '../connection'\n import { folks_b } from './folks_b'\n import Folk from './Folk.svelte'\n import { getContext } from 'svelte'\n const ctx = getContext('ctx')\n const folks = folks_b(ctx)\n const connection = connection_b(ctx)\n</script>\n<style>\n :global(:root) {\n --folks-padding: .75em;\n --folks-grid-gap: 1rem;\n }\n .folks {\n display: grid;\n grid-gap: var(--folks-grid-gap);\n padding: var(--folks-grid-gap) var(--folks-padding) var(--folks-padding);\n place-items: center;\n }\n</style>\n<div class='folks'>\n {#if $connection && $connection.syn && $connection.syn.me}\n <Folk me={true} pubKeyStr={$connection.syn.me}/>\n {/if}\n {#each Object.keys($folks) as p}\n <Folk pubKeyStr={p}/>\n {/each}\n</div>\n",null,null,null,null,null,null,null,"<script lang=\"ts\">\n import { createEventDispatcher, getContext } from 'svelte'\n import { connection_b } from './connection'\n import { content_b } from './content'\n import { session_b } from './session'\n import { CSSifyHSL } from './colors'\n import type { Delta } from './Delta'\n\n const ctx = getContext('ctx')\n const dispatch = createEventDispatcher()\n const connection = connection_b(ctx)\n const content = content_b(ctx)\n const session = session_b(ctx)\n\n function getLoc(tag) {\n return $content.meta ? ($content.meta[tag] ? $content.meta[tag] : 0) : 0\n }\n\n let editor\n $: myTag = $session ? $session.myTag : ''\n $: editor_content1 = $content.body.slice(0, getLoc(myTag))\n $: editor_content2 = $content.body.slice(getLoc(myTag))\n\n function addText(text) {\n const loc = getLoc(myTag)\n const deltas:Delta[] = [{type:'Add', value:[loc, text]}]\n for (const [tag, tagLoc] of Object.entries($content.meta)) {\n if (tagLoc >= loc) {\n deltas.push({type:'Meta', value: {setLoc: [tag,tagLoc+text.length] }})\n }\n }\n dispatch('requestChange', deltas)\n }\n\n function handleInput(event) {\n const loc = getLoc(myTag)\n const key = event.key\n if (key.length == 1) {\n addText(key)\n } else {\n switch (key) {\n case 'ArrowRight':\n if (loc < $content.body.length) {\n dispatch('requestChange', [\n {type:'Meta', value:{setLoc: [myTag, loc+1]}}\n ])\n }\n break\n case 'ArrowLeft':\n if (loc > 0){\n dispatch('requestChange', [\n {type:'Meta', value:{setLoc: [myTag, loc-1]}}\n ])\n }\n break\n case 'Enter':\n addText('\\n')\n break\n case 'Backspace':\n if (loc>0) {\n const deltas:Delta[] = [{type:'Delete', value:[loc-1, loc]}]\n for (const [tag, tagLoc] of Object.entries($content.meta)) {\n if (tagLoc >= loc) {\n deltas.push({type:'Meta', value: {setLoc: [tag,tagLoc-1] }})\n }\n }\n dispatch('requestChange', deltas)\n }\n }\n }\n console.log('input', event.key)\n }\n function handleClick(e) {\n const offset = window.getSelection().focusOffset\n let loc = offset > 0 ? offset : 0\n if (window.getSelection().focusNode.parentElement == editor.lastChild) {\n loc += editor_content1.length\n }\n if (loc != getLoc(myTag)) {\n dispatch('requestChange', [\n {type:'Meta', value:{setLoc: [myTag, loc]}}\n ])\n }\n }\n\n let cursor\n $: {\n // wait for cursor and connection and color inside connection to exist\n // before updating the cursor color\n if (cursor && $connection && $connection.syn && $connection.syn.myColors) {\n cursor.style['border-color'] = CSSifyHSL($connection.syn.myColors.primary)\n }\n }\n\n</script>\n<style>\n editor {\n width: auto;\n min-height: 10em;\n border: 1px solid black;\n background-color: hsla(0, 0%, 100%, .6);\n font-family: Arial;\n display: block;\n white-space: pre-wrap;\n margin: 1em 0 .4em 0;\n padding: 4px;\n }\n .cursor {\n display: inline;\n border-left: solid 2px; /* Should be the Folk's main color */\n margin-right: -2px;\n z-index: 10;\n position: relative;\n }\n</style>\n<editor on:click={handleClick} on:keydown={handleInput} tabindex=0 start=0 bind:this={editor}>\n <span>{editor_content1}</span><span class='cursor' bind:this={cursor}></span><span>{editor_content2}</span>\n</editor>\n","<script lang=\"ts\">\n import { createEventDispatcher, getContext, tick } from 'svelte'\n import { content_b } from './content'\n const ctx = getContext('ctx')\n const dispatch = createEventDispatcher()\n const content = content_b(ctx)\n\n let titleBeingTyped = ''\n\n let editingTitle = false\n function saveTitle() {\n if (editingTitle) {\n // only dispatch a changeReq if the title trying to be saved is different\n // than the current title\n if (titleBeingTyped !== $content.title) {\n let delta = { type: 'Title', value: titleBeingTyped }\n dispatch('requestChange', [delta])\n }\n titleBeingTyped = ''\n editingTitle = false\n } else {\n console.log(\"Can't run saveTitle when it wasn't being edited!\")\n }\n }\n\n let titleEl // variable to bind the title input to when it's created\n async function beginEditTitle() {\n titleHover=false\n titleBeingTyped = $content.title // fill the field with the current title\n editingTitle = true\n await tick() // wait for the title input element to be created\n titleEl.focus()\n }\n\n function handleTitleKeypress() {\n\t\tif (event.key == 'Enter') {\n saveTitle()\n } else if (event.key == 'Escape') {\n // don't save new title & discard changes\n titleBeingTyped = ''\n // turn off editing\n editingTitle=false\n }\n }\n\n // keep track of whether the doc is untitled\n let untitled\n $: untitled = ($content.title === '')\n\n let titleHover // whether the title is being hovered\n\n\n</script>\n<style>\n .title-wrapper {\n height: 1.6em;\n }\n\n .title {\n /* min-width: 10em;\n min-height: 1em; */\n font-weight: bold;\n display: inline-block;\n padding: 0.4em;\n -webkit-padding: 0.4em 0;\n margin: 0 0 0.5em 0;\n border-width: 1px;\n border-color: #00000000;\n border-style: solid;\n border-radius: 2px;\n }\n\n .title-hover {\n border-style: dashed;\n border-color: #aaa;\n }\n\n /* input has to be below hover so it overrides */\n .title-input {\n border-style: solid;\n border-color: #ccc;\n font-weight: bold;\n margin-bottom: 0;\n }\n\n .untitled {\n color: lightgray;\n }\n</style>\n\n<div class='title-wrapper'>\n Title:\n {#if editingTitle}\n <input class='title-input' bind:value={titleBeingTyped} on:keydown={handleTitleKeypress} on:blur={saveTitle} bind:this={titleEl}/>\n {:else}\n <div class='title' class:title-hover={titleHover} on:mouseenter={()=>{titleHover=true}} on:mouseleave={()=>{titleHover=false}} on:click={beginEditTitle}>\n <span class:untitled>\n {#if untitled}\n Untitled Document\n {:else}\n {$content.title}\n {/if}\n </span>\n </div>\n {/if}\n</div>\n","<script lang=\"ts\">\n import { createEventDispatcher, getContext } from 'svelte'\n import { bufferToBase64 } from './utils'\n import { connection_b, Connection } from './connection'\n import { scribeStr_b } from './scribe'\n import { session_b } from './session'\n const ctx = getContext('ctx')\n const connection = connection_b(ctx)\n const scribeStr = scribeStr_b(ctx)\n\n const session = session_b(ctx)\n\n // this properties are the app-defined functions to apply and undo changes\n export let applyDeltaFn, undoFn\n\n // this is the list of sessions returned by the DNA\n let sessions\n\n export function requestChange(deltas) {\n $session.requestChange(deltas)\n }\n\n // -----------------------------------------------------------------------\n\n const dispatch = createEventDispatcher()\n\n let adminPort=1234\n let appPort=8888\n let appId='syn'\n async function toggle() {\n if (!$session) {\n // if (!$connection) {\n $session = await join_session(appPort, appId,)\n // $connection = new Connection(ctx, appPort, appId)\n // await $connection.open({title:'', body:''}, applyDeltaFn)\n //\n // session = $connection.syn.session\n //\n // console.log('joining session...')\n // await $connection.joinSession()\n sessions = $connection.sessions\n }\n else {\n $connection.syn.clearState()\n sessions = undefined\n console.log('disconnected')\n }\n }\n\n async function commitChange() {\n $session.commitChange()\n }\n\n $: noscribe = $scribeStr === ''\n</script>\n<style>\n :global(.noscribe) {\n pointer-events: none;\n position: relative;\n }\n\n :global(.noscribe:after) {\n content: ' ';\n z-index: 20;\n display: block;\n position: absolute;\n height: 100%;\n top: 0;\n left: 0;\n right: 0;\n background: rgba(255, 255, 255, 0.7);\n }\n input {\n width: 4em;\n //border: 2px solid red;\n border-radius: 4px;\n }\n .session {\n border-radius: 4px;\n background-color: pink\n }\n button {\n cursor: pointer;\n }\n</style>\n<button class:noscribe on:click={commitChange}>Commit</button>\n\n<div>\n <h4>Holochain Connection:</h4>\n App Port: <input bind:value={appPort}>\n AppId: <input bind:value={appId}>\n <button on:click={toggle}>\n {#if $connection}\n Disconnect\n {:else}\n Connect\n {/if}\n </button>\n</div>\n\n<div class='sessions'>\n Sessions:\n {#if sessions}\n {#each sessions as session}\n <span class='session'>\n Id: {bufferToBase64(session).slice(-4)}\n </span>\n {/each}\n {/if}\n</div>\n","<script lang=\"ts\">\n import { getContext } from 'svelte'\n import { nextIndex_b } from './delta'\n import { connection_b } from './connection'\n import { session_b } from './session'\n import { scribeStr_b } from './scribe'\n const ctx = getContext('ctx')\n const scribeStr = scribeStr_b(ctx)\n const connection = connection_b(ctx)\n const nextIndex = nextIndex_b(ctx)\n const session = session_b(ctx)\n</script>\n<style>\nul {\n margin-bottom: 1rem;\n}\n</style>\n<div>\n <ul>\n <li>\n {#if $connection && $connection.syn}\n Connected to Dna: {$connection.syn.Dna}\n {:else}\n No connection\n {/if}\n <li>lastCommitedContentHash: {$session ? $session.contentHashStr : ''}\n <li>session: {JSON.stringify($session)}\n <li>nextIndex: {$nextIndex}\n <li>scribe: {$scribeStr}\n </ul>\n</div>\n","<script lang=\"ts\">\n export let text\n export let status\n</script>\n<style>\n .history-entry {\n border: 1px solid #ccc;\n border-radius: 4px;\n padding: .3em;\n width: auto;\n height: 2.6em;\n flex-grow: 0;\n flex-shrink: 0;\n flex-basis: auto;\n white-space: pre-wrap;\n overflow-y: scroll;\n }\n .recorded {\n background-color: lightyellow;\n }\n .committed {\n background-color: lightgreen;\n }\n .requested {\n background-color: lightcoral;\n }\n</style>\n<div class='history-entry {status}'>\n {text}\n</div>\n","<script lang=\"ts\">\n import { afterUpdate, getContext } from 'svelte'\n import { requestedChanges_b, recordedChanges_b, committedChanges_b } from './delta'\n import HistoryEntry from './HistoryEntry.svelte'\n const ctx = getContext('ctx')\n const requestedChanges = requestedChanges_b(ctx)\n const recordedChanges = recordedChanges_b(ctx)\n const committedChanges = committedChanges_b(ctx)\n \n export let changeToTextFn\n\n // returns a list of historyEntry objects with some text\n // and a status (for styling)\n function changesToEntriesList(changes, status) {\n let entriesList = []\n for (let i=changes.length-1; i>=0; i--) {\n const text = changeToTextFn(changes[i])\n entriesList.push({'text': text, 'status': status})\n }\n return entriesList\n }\n\n let requestedH\n let recordedH\n let committedH\n let historyEntries = []\n $: {requestedH = changesToEntriesList($requestedChanges, 'requested')}\n $: {recordedH = changesToEntriesList($recordedChanges, 'recorded')}\n $: {committedH = changesToEntriesList($committedChanges, 'committed')}\n $: {historyEntries = [...requestedH, ...recordedH, ...committedH]}\n\n // when updating the list, also scroll to the newest historyEntry\n afterUpdate(async () => {\n\t\tlet entryElem = document.getElementsByClassName('history-entries')[0]\n if (entryElem.firstChild !== null) {\n entryElem.firstChild.scrollIntoView(false)\n }\n\t})\n\n</script>\n<style>\n .history {\n width: auto;\n border: 1px solid hsla(0, 0%, 0%, 0.25);\n border-radius: 4px;\n padding: .5em .5em 0;\n background-color: hsla(0, 0%, 100%, .25);\n }\n .history-entries {\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n gap: 1em;\n overflow-x: scroll;\n padding: .5em 0 1.2em;\n }\n</style>\n\n<div class='history'>\n History:\n <div class='history-entries'>\n {#each historyEntries as historyEntry}\n <HistoryEntry status={historyEntry.status} text={historyEntry.text}/>\n {/each}\n </div>\n</div>\n","<script lang=\"ts\">\n import { setContext } from 'svelte'\n import Editor from './Editor.svelte'\n import Title from './Title.svelte'\n import { Folks } from './folk'\n import Syn from './Syn.svelte'\n import Debug from './Debug.svelte'\n import History from './History.svelte'\n import { scribeStr_b } from './scribe'\n import type { AddDelta, applyDelta_ret_T, DeleteDelta, Delta, MetaDelta, TitleDelta } from './delta'\n import type { Content } from './content'\n let ctx = {}\n setContext('ctx', ctx)\n const scribeStr = scribeStr_b(ctx)\n\n $: disconnected = false\n\n // definition of how to apply a delta to the content\n // if the delta is destructive also returns what was\n // destroyed for use by undo\n function applyDelta(content:Content, in_delta:Delta):applyDelta_ret_T {\n switch (in_delta.type) {\n case 'Title': {\n const deleted = content.title\n const delta = in_delta as TitleDelta\n content.title = delta.value\n return [content, { delta, deleted }]\n }\n case 'Add': {\n const delta = in_delta as AddDelta\n const [loc, text] = delta.value\n content.body = content.body.slice(0, loc) + text + content.body.slice(loc)\n return [content, { delta }]\n }\n case 'Delete': {\n const delta = in_delta as DeleteDelta\n const [start, end] = delta.value\n const deleted = content.body.slice(start, end)\n content.body = content.body.slice(0, start) + content.body.slice(end)\n return [content, { delta, deleted }]\n }\n case 'Meta': {\n const delta = in_delta as MetaDelta\n const [tag, loc] = delta.value.setLoc\n const deleted = [tag, content.meta[tag]]\n content.meta[tag] = loc\n return [content, { delta, deleted }]\n }\n }\n }\n\n // definition of how to undo a change, returns a delta that will undo the change\n function undo(change) {\n const delta = change.delta\n switch (delta.type) {\n case 'Title':\n return { type: 'Title', value: change.deleted }\n break\n case 'Add':\n const [loc, text] = delta.value\n return { type: 'Delete', value: [loc, loc + text.length] }\n break\n case 'Delete':\n const [start, end] = delta.value\n return { type: 'Add', value: [start, change.deleted] }\n break\n case 'Meta':\n return { type: 'Meta', value: { setLoc: change.deleted } }\n }\n }\n\n // definition of how to convert a change to text for the history renderer\n function changeToText(change) {\n let delta = change.delta\n let detail\n switch (delta.type) {\n case 'Add':\n detail = `${delta.value[1]}@${delta.value[0]}`\n break\n case 'Delete':\n detail = `${change.deleted}@${delta.value[0]}`\n break\n case 'Title':\n detail = `${change.deleted}->${delta.value}`\n break\n case 'Meta':\n detail = ''\n }\n return `${delta.type}:\\n${detail}`\n }\n\n $: noscribe = $scribeStr === ''\n let syn\n\n // The debug drawer's ability to resized and hidden\n let resizeable\n let resizeHandle\n const minDrawerSize = 0\n const maxDrawerSize = document.documentElement.clientHeight - 30 - 10\n const initResizeable = (resizeableEl)=>{\n resizeableEl.style.setProperty('--max-height', `${maxDrawerSize}px`)\n resizeableEl.style.setProperty('--min-height', `${minDrawerSize}px`)\n }\n\n const setDrawerHeight = (height)=>{\n document.documentElement.style.setProperty('--resizeable-height', `${height}px`)\n }\n const getDrawerHeight = ()=>{\n const pxHeight = getComputedStyle(resizeable)\n .getPropertyValue('--resizeable-height')\n return parseInt(pxHeight, 10)\n }\n\n const startDragging = (event)=>{\n event.preventDefault()\n const host = resizeable\n const startingDrawerHeight = getDrawerHeight()\n const yOffset = event.pageY\n\n const mouseDragHandler = (moveEvent)=>{\n moveEvent.preventDefault()\n const primaryButtonPressed = moveEvent.buttons === 1\n if (!primaryButtonPressed) {\n setDrawerHeight(Math.min(Math.max(getDrawerHeight(), minDrawerSize), maxDrawerSize))\n window.removeEventListener('pointermove', mouseDragHandler)\n return\n }\n setDrawerHeight(Math.min(Math.max((yOffset - moveEvent.pageY) + startingDrawerHeight, minDrawerSize), maxDrawerSize))\n }\n const remove = window.addEventListener('pointermove', mouseDragHandler)\n }\n\n let drawerHidden = false\n const hideDrawer = ()=>{\n drawerHidden = true\n }\n const showDrawer = ()=>{\n drawerHidden = false\n }\n\n let tabShown = false\n const showTab = ()=>{\n tabShown = true\n }\n const hideTab = ()=>{\n tabShown = false\n }\n\n</script>\n\n<style global>\n\tmain {\n padding: 1em;\n background: hsla(100, 20%, 50%, .2);\n grid-column: 1 / 2;\n }\n\n .toolbar {\n background: hsla(19, 20%, 50%, .2);\n padding: 2rem;\n grid-column: 1 / 2;\n }\n\n .folks-tray {\n min-width: calc((var(--folks-padding) * 2) + var(--folk-hex-width));\n width: auto;\n background: hsla(255, 20%, 50%, .2);\n grid-column: 2 / 3;\n grid-row: 1/4;\n }\n\n :global(:root) {\n --resizeable-height: 200px;\n --tab-width: 60px;\n }\n\n .debug-drawer {\n width: 100%;\n box-sizing: border-box;\n height: var(--resizeable-height);\n min-height: var(--min-height);\n max-height: var(--max-height);\n background: hsla(180, 30%, 85%, 1);\n position: absolute;\n bottom: 0;\n text-align: left;\n grid-column: 1 / 2;\n overflow: hidden;\n z-index: 90;\n }\n\n .hidden {\n height: 0;\n min-height: 0;\n }\n\n .handle {\n height: 1px;\n width: 100%;\n background-color: hsla(180, 15%, 65%, 1);\n z-index: 100;\n }\n\n .handle::after {\n content: '';\n height: 9px;\n position: absolute;\n left: 0;\n right: 0;\n margin-bottom: -4px;\n background-color: transparent;\n cursor: ns-resize;\n z-index: 101;\n }\n\n /* tab styling reverse-engineered from Atom */\n .tab {\n z-index: 130;\n position: absolute;\n width: var(--tab-width);\n height: calc(var(--tab-width) / 2);\n left: calc(50% - (var(--tab-width) / 2));\n bottom: var(--resizeable-height);\n overflow: hidden;\n margin-bottom: -2px;\n border-top-left-radius: calc(var(--tab-width) / 2);\n border-top-right-radius: calc(var(--tab-width) / 2);\n\n pointer-events: none;\n }\n\n .tab-inner {\n position: absolute;\n box-sizing: border-box; /* borders included in size */\n width: var(--tab-width);\n height: var(--tab-width);\n background: hsla(180, 30%, 85%);\n border: 1px solid hsla(180, 20%, 65%, 1);\n color: hsla(180, 20%, 50%, 1); /* color of chevron */\n border-radius: calc(var(--tab-width) / 2);\n cursor: pointer;\n text-align: center;\n\n top: calc(var(--tab-width) / 2);\n transition: transform 0.2s ease-out 0.2s;\n }\n\n .tab.shown {\n pointer-events: all;\n }\n\n .tab-inner.shown {\n transform: translateY(-50%);\n transition: transform 0.2s ease-out 0s;\n }\n\n /* allow the tab to pop up when drawer is hidden */\n .tab.drawer-hidden {\n bottom: 0;\n pointer-events: all;\n }\n\n .tab-icon {\n margin-top: 9px;\n }\n\n .debug-content {\n padding: 1rem;\n word-wrap: break-word;\n height: 100%;\n overflow-y: scroll;\n box-sizing: border-box;\n z-index: 90;\n }\n\n body {\n font-family: system-ui, sans-serif;\n }\n\n h1 {\n color: #ff3e00;\n text-transform: uppercase;\n font-size: 4em;\n font-weight: 100;\n margin: auto;\n }\n\n @media (min-width: 640px) {\n main {\n max-width: none;\n }\n }\n</style>\n\n<svelte:head>\n <script src='https://kit.fontawesome.com/80d72fa568.js' crossorigin='anonymous'></script>\n</svelte:head>\n\n<div class='toolbar'>\n <h1>SynText</h1>\n<div class:noscribe>\n <Title on:requestChange={(event) => syn.requestChange(event.detail)}/>\n</div>\n</div>\n<main>\n<div class:noscribe>\n <Editor on:requestChange={(event) => syn.requestChange(event.detail)}/>\n</div>\n\n\n<Syn applyDeltaFn={applyDelta} undoFn={undo} bind:this={syn}/>\n</main>\n\n<div class='folks-tray'>\n <Folks/>\n</div>\n\n<div class='tab' class:shown={tabShown} class:drawer-hidden={drawerHidden} on:mouseenter={showTab}\n on:mouseleave={hideTab}>\n <div class='tab-inner' class:shown={tabShown} on:click={drawerHidden ? showDrawer() : hideDrawer()}>\n <i class:drawer-hidden={drawerHidden} class=\"tab-icon fas {drawerHidden ? 'fa-chevron-up' : 'fa-chevron-down'}\"></i>\n </div>\n</div>\n<div class='debug-drawer' bind:this={resizeable} use:initResizeable on:mouseenter={showTab} on:mouseleave={hideTab}\n class:hidden={drawerHidden}>\n <div class='handle' bind:this={resizeHandle} on:mousedown={startDragging}></div>\n <div class='debug-content'>\n <History changeToTextFn={changeToText}/>\n <Debug/>\n </div>\n</div>\n",null],"names":["global","this","require$$0","require$$1","common_2","common_1","client_1","require$$2","require$$3","require$$4","derived","in_get","in_derived","_b","Syn","AppWebsocket"],"mappings":";;;;;IAAA,SAAS,IAAI,GAAG,GAAG;IAWnB,SAAS,YAAY,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;IACzD,IAAI,OAAO,CAAC,aAAa,GAAG;IAC5B,QAAQ,GAAG,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;IACzC,KAAK,CAAC;IACN,CAAC;IACD,SAAS,GAAG,CAAC,EAAE,EAAE;IACjB,IAAI,OAAO,EAAE,EAAE,CAAC;IAChB,CAAC;IACD,SAAS,YAAY,GAAG;IACxB,IAAI,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IACD,SAAS,OAAO,CAAC,GAAG,EAAE;IACtB,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;IACD,SAAS,WAAW,CAAC,KAAK,EAAE;IAC5B,IAAI,OAAO,OAAO,KAAK,KAAK,UAAU,CAAC;IACvC,CAAC;IACD,SAAS,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE;IAC9B,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,KAAK,OAAO,CAAC,KAAK,UAAU,CAAC,CAAC;IAClG,CAAC;IAID,SAAS,QAAQ,CAAC,GAAG,EAAE;IACvB,IAAI,OAAO,MAAM,CAAC,IAAI,CAAC,GA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xO1C,QAAQ,GAAG,UAAU,KAAK,EAAE;;;;KA5E5B,YAAY,GAAG,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UCZnB,GAAG,GAAG,IAAI,GAAG,CAAC;QACnB,MAAM,EAAE,QAAQ,CAAC,IAAI;QACrB,KAAK,EAAE,EACN;KACD;;;;;;;;"} \ No newline at end of file diff --git a/ui/apps/app/rollup.config.js b/ui/apps/app/rollup.config.js index 024397b5..50692184 100644 --- a/ui/apps/app/rollup.config.js +++ b/ui/apps/app/rollup.config.js @@ -1,90 +1,91 @@ -import svelte from 'rollup-plugin-svelte'; -import commonjs from '@rollup/plugin-commonjs'; -import replace from '@rollup/plugin-replace'; -import resolve from '@rollup/plugin-node-resolve'; -import livereload from 'rollup-plugin-livereload'; -import { terser } from 'rollup-plugin-terser'; -import css from 'rollup-plugin-css-only'; -import typescript from '@rollup/plugin-typescript'; -import preprocess from 'svelte-preprocess'; +import svelte from 'rollup-plugin-svelte' +import commonjs from '@rollup/plugin-commonjs' +import replace from '@rollup/plugin-replace' +import resolve from '@rollup/plugin-node-resolve' +import livereload from 'rollup-plugin-livereload' +import { terser } from 'rollup-plugin-terser' +import css from 'rollup-plugin-css-only' +import typescript from '@rollup/plugin-typescript' +import preprocess from 'svelte-preprocess' -const production = !process.env.ROLLUP_WATCH; +const production = !process.env.ROLLUP_WATCH function serve() { - let server; + let server - function toExit() { - if (server) server.kill(0); - } + function toExit() { + if (server) server.kill(0) + } - return { - writeBundle() { - if (server) return; - server = require('child_process').spawn('npm', ['run', 'start', '--', '--dev'], { - stdio: ['ignore', 'inherit', 'inherit'], - shell: true - }); + return { + writeBundle() { + if (server) return + server = require('child_process').spawn('npm', ['run', 'start', '--', '--dev'], { + stdio: ['ignore', 'inherit', 'inherit'], + shell: true + }) - process.on('SIGTERM', toExit); - process.on('exit', toExit); - } - }; + process.on('SIGTERM', toExit) + process.on('exit', toExit) + } + } } export default { - input: 'src/main.ts', - output: { - sourcemap: true, - format: 'iife', - name: 'app', - dir: 'public/build' - }, - plugins: [ - replace({ - 'process.env.NODE_ENV': JSON.stringify(process.env.NODE) - }), - svelte({ - compilerOptions: { - // enable run-time checks when not in production - dev: !production - }, - preprocess: preprocess({ - sourcemap: !production, - defaults: { - script: 'typescript', - style: 'scss' - } - }) - }), - // we'll extract any component CSS out into - // a separate file - better for performance - css({ output: 'main.css' }), + input: 'src/main.ts', + output: { + sourcemap: true, + format: 'iife', + name: 'app', + dir: 'public/build' + }, + plugins: [ + replace({ + preventAssignment: true, + 'process.env.NODE_ENV': JSON.stringify(process.env.NODE) + }), + svelte({ + compilerOptions: { + // enable run-time checks when not in production + dev: !production + }, + preprocess: preprocess({ + sourcemap: !production, + defaults: { + script: 'typescript', + style: 'scss' + } + }) + }), + // we'll extract any component CSS out into + // a separate file - better for performance + css({ output: 'main.css' }), - // If you have external dependencies installed from - // npm, you'll most likely need these plugins. In - // some cases you'll need additional configuration - - // consult the documentation for details: - // https://github.com/rollup/plugins/tree/master/packages/commonjs - resolve({ - browser: true, - dedupe: ['svelte'] - }), - typescript(), - commonjs(), + // If you have external dependencies installed from + // npm, you'll most likely need these plugins. In + // some cases you'll need additional configuration - + // consult the documentation for details: + // https://github.com/rollup/plugins/tree/master/packages/commonjs + resolve({ + browser: true, + dedupe: ['svelte'] + }), + typescript(), + commonjs(), - // In dev mode, call `npm run start` once - // the bundle has been generated - !production && serve(), + // In dev mode, call `npm run start` once + // the bundle has been generated + !production && serve(), - // Watch the `public` directory and refresh the - // browser on changes when not in production - !production && livereload('public'), + // Watch the `public` directory and refresh the + // browser on changes when not in production + !production && livereload('public'), - // If we're building for production (npm run build - // instead of npm run dev), minify - production && terser() - ], - watch: { - clearScreen: false - } -}; + // If we're building for production (npm run build + // instead of npm run dev), minify + production && terser() + ], + watch: { + clearScreen: false + } +} diff --git a/ui/apps/app/src/App.svelte b/ui/apps/app/src/App.svelte index 76d85603..41136ad6 100644 --- a/ui/apps/app/src/App.svelte +++ b/ui/apps/app/src/App.svelte @@ -1,14 +1,14 @@ <script lang="ts"> import { setContext } from 'svelte' + import { scribe_str_b } from '@syn-ui/model' + import type { apply_delta_ret_T } from '@syn-ui/model' + import type { AddDelta, Content, DeleteDelta, Delta, MetaDelta, TitleDelta } from '@syn-ui/zome-client' import Editor from './Editor.svelte' import Title from './Title.svelte' - import { Folks } from './folk' + import Folks from './Folks.svelte' import Syn from './Syn.svelte' import Debug from './Debug.svelte' import History from './History.svelte' - import { scribe_str_b } from './scribe' - import type { AddDelta, apply_delta_ret_T, DeleteDelta, Delta, MetaDelta, TitleDelta } from './delta' - import type { Content } from './content' let ctx = {} setContext('ctx', ctx) const scribe_str = scribe_str_b(ctx) diff --git a/ui/apps/app/src/Debug.svelte b/ui/apps/app/src/Debug.svelte index 3a51da68..1bdb6584 100644 --- a/ui/apps/app/src/Debug.svelte +++ b/ui/apps/app/src/Debug.svelte @@ -1,14 +1,13 @@ <script lang="ts"> import { getContext } from 'svelte' - import { next_index_b } from './delta' - import { connection_b } from './zome' - import { session_b } from './session' - import { scribe_str_b } from './scribe' + import { content_hash_str_b, next_index_b, scribe_str_b, session_info_b } from '@syn-ui/model' + import { dna_b } from '@syn-ui/zome-client' const ctx = getContext('ctx') + const dna = dna_b(ctx) const scribe_str = scribe_str_b(ctx) - const connection = connection_b(ctx) const next_index = next_index_b(ctx) - const session = session_b(ctx) + const session_info = session_info_b(ctx) + const content_hash_str = content_hash_str_b(ctx) </script> <style> ul { @@ -18,13 +17,13 @@ ul { <div> <ul> <li> - {#if $connection && $connection.syn} - Connected to Dna: {$connection.syn.Dna} + {#if $dna} + Connected to Dna: {$dna} {:else} No connection {/if} - <li>lastCommitedContentHash: {$session ? $session.contentHashStr : ''} - <li>session: {JSON.stringify($session)} + <li>lastCommitedContentHash: {$content_hash_str ? $content_hash_str : ''} + <li>session: {JSON.stringify($session_info)} <li>next_index: {$next_index} <li>scribe: {$scribe_str} </ul> diff --git a/ui/apps/app/src/Editor.svelte b/ui/apps/app/src/Editor.svelte index ed2315b9..9b35f6a6 100644 --- a/ui/apps/app/src/Editor.svelte +++ b/ui/apps/app/src/Editor.svelte @@ -1,28 +1,26 @@ <script lang="ts"> import { createEventDispatcher, getContext } from 'svelte' - import { connection_b } from './zome' - import { content_b } from './content' - import { session_b } from './session' - import { CSSifyHSL } from './colors' - import type { Delta } from './Delta' + import { my_tag_b } from '@syn-ui/zome-client' + import type { Delta } from '@syn-ui/zome-client' + import { content_b, CSSifyHSL, my_colors_b, session_info_b } from '@syn-ui/model' const ctx = getContext('ctx') const dispatch = createEventDispatcher() - const connection = connection_b(ctx) const content = content_b(ctx) - const session = session_b(ctx) + const session_info = session_info_b(ctx) + const my_tag = my_tag_b(ctx) + const my_colors = my_colors_b(ctx) function getLoc(tag) { return $content.meta ? ($content.meta[tag] ? $content.meta[tag] : 0) : 0 } let editor - $: my_tag = $session ? $session.my_tag : '' - $: editor_content1 = $content.body.slice(0, getLoc(my_tag)) - $: editor_content2 = $content.body.slice(getLoc(my_tag)) + $: editor_content1 = $content.body.slice(0, getLoc($my_tag)) + $: editor_content2 = $content.body.slice(getLoc($my_tag)) function addText(text) { - const loc = getLoc(my_tag) + const loc = getLoc($my_tag) const deltas:Delta[] = [{type:'Add', value:[loc, text]}] for (const [tag, tagLoc] of Object.entries($content.meta)) { if (tagLoc >= loc) { @@ -33,7 +31,7 @@ } function handleInput(event) { - const loc = getLoc(my_tag) + const loc = getLoc($my_tag) const key = event.key if (key.length == 1) { addText(key) @@ -42,14 +40,14 @@ case 'ArrowRight': if (loc < $content.body.length) { dispatch('request_change', [ - {type:'Meta', value:{setLoc: [my_tag, loc+1]}} + {type:'Meta', value:{setLoc: [$my_tag, loc+1]}} ]) } break case 'ArrowLeft': if (loc > 0){ dispatch('request_change', [ - {type:'Meta', value:{setLoc: [my_tag, loc-1]}} + {type:'Meta', value:{setLoc: [$my_tag, loc-1]}} ]) } break @@ -76,9 +74,9 @@ if (window.getSelection().focusNode.parentElement == editor.lastChild) { loc += editor_content1.length } - if (loc != getLoc(my_tag)) { + if (loc != getLoc($my_tag)) { dispatch('request_change', [ - {type:'Meta', value:{setLoc: [my_tag, loc]}} + {type:'Meta', value:{setLoc: [$my_tag, loc]}} ]) } } @@ -87,8 +85,8 @@ $: { // wait for cursor and connection and color inside connection to exist // before updating the cursor color - if (cursor && $connection && $connection.syn && $connection.syn.my_colors) { - cursor.style['border-color'] = CSSifyHSL($connection.syn.my_colors.primary) + if ($my_colors) { + cursor.style['border-color'] = CSSifyHSL($my_colors.primary) } } diff --git a/ui/apps/app/src/Folk.svelte b/ui/apps/app/src/Folk.svelte index 4e9dceed..ac442cfd 100644 --- a/ui/apps/app/src/Folk.svelte +++ b/ui/apps/app/src/Folk.svelte @@ -1,11 +1,11 @@ <script lang="ts"> import { getContext } from 'svelte' - import { connection_b } from '@syn-ui/zome-client' - import { folks_b, scribe_str_b } from '@syn-ui/model' + import { CSSifyHSL, folks_b, my_colors_b, scribe_str_b, session_info_b } from '@syn-ui/model' const ctx = getContext('ctx') - const connection = connection_b(ctx) const folks = folks_b(ctx) const scribe_str = scribe_str_b(ctx) + const my_colors = my_colors_b(ctx) + const session_info = session_info_b(ctx) export let pubKeyStr = '' export let me = false @@ -14,11 +14,11 @@ $: scribe = pubKeyStr == $scribe_str let outOfSession - $: outOfSession = (!$folks[pubKeyStr] || !$folks[pubKeyStr].inSession) && !me + $: outOfSession = (!$folks[pubKeyStr] || !$folks[pubKeyStr].inSession) && !me function setUpHex(hexEl) { let colors if (me) { - colors = $connection.syn.my_colors + colors = $my_colors } else { colors = $folks[pubKeyStr].colors } @@ -65,7 +65,7 @@ width: var(--folk-hex-width); height: var(--folk-hex-height); /* https://www.desmos.com/calculator/bgt97otugr */ - clip-path: polygon(25%0%,75%0%,100%50%,75%100%,25%100%,12.5% 75%,calc(12.5% + 1.732px) calc(75% - 1px),calc(25% + 1.15px) calc(100% - 2px),50% calc(100% - 2px),50% 100%,75% 100%,87.5% 75%,calc(87.5% - 1.732px) calc(75% - 1px),calc(100% - 2.31px) 50%,calc(87.5% - 1.732px) calc(25% + 1px),87.5% 25%,75%0%,50%0%,50% calc(0% + 2px),calc(25% + 1.15px) calc(0% + 2px),calc(12.5% + 1.732px) calc(25% + 1px),12.5% 25%); + clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 12.5% 75%, calc(12.5% + 1.732px) calc(75% - 1px), calc(25% + 1.15px) calc(100% - 2px), 50% calc(100% - 2px), 50% 100%, 75% 100%, 87.5% 75%, calc(87.5% - 1.732px) calc(75% - 1px), calc(100% - 2.31px) 50%, calc(87.5% - 1.732px) calc(25% + 1px), 87.5% 25%, 75% 0%, 50% 0%, 50% calc(0% + 2px), calc(25% + 1.15px) calc(0% + 2px), calc(12.5% + 1.732px) calc(25% + 1px), 12.5% 25%); background-color: hsl(0, 0%, 10%); position: absolute; } @@ -85,7 +85,7 @@ } </style> -{#if $connection && $connection.syn} +{#if $session_info} {#if scribe} <div class='scribe-wrapper'> <div use:setUpHex class='folk scribe' class:me class:out-of-session={outOfSession}> diff --git a/ui/apps/app/src/Folks.svelte b/ui/apps/app/src/Folks.svelte index c524acaf..aeacff58 100644 --- a/ui/apps/app/src/Folks.svelte +++ b/ui/apps/app/src/Folks.svelte @@ -1,11 +1,11 @@ <script lang="ts"> + import { getContext } from 'svelte' import { folks_b } from '@syn-ui/model' - import { connection_b } from '@syn-ui/zome-client' + import { me_b } from '@syn-ui/zome-client' import Folk from './Folk.svelte' - import { getContext } from 'svelte' const ctx = getContext('ctx') + const me = me_b(ctx) const folks = folks_b(ctx) - const connection = connection_b(ctx) </script> <style> :global(:root) { @@ -20,8 +20,8 @@ } </style> <div class='folks'> - {#if $connection && $connection.syn && $connection.syn.me} - <Folk me={true} pubKeyStr={$connection.syn.me}/> + {#if $me} + <Folk me={true} pubKeyStr={$me}/> {/if} {#each Object.keys($folks) as p} <Folk pubKeyStr={p}/> diff --git a/ui/apps/app/src/History.svelte b/ui/apps/app/src/History.svelte index 47e072e7..5b97843b 100644 --- a/ui/apps/app/src/History.svelte +++ b/ui/apps/app/src/History.svelte @@ -1,6 +1,6 @@ <script lang="ts"> import { afterUpdate, getContext } from 'svelte' - import { requested_changes_b, recorded_changes_b, committed_changes_b } from './delta' + import { committed_changes_b, recorded_changes_b, requested_changes_b } from '@syn-ui/model' import HistoryEntry from './HistoryEntry.svelte' const ctx = getContext('ctx') const requested_changes = requested_changes_b(ctx) diff --git a/ui/apps/app/src/Syn.svelte b/ui/apps/app/src/Syn.svelte index 5e71146e..a81d3e43 100644 --- a/ui/apps/app/src/Syn.svelte +++ b/ui/apps/app/src/Syn.svelte @@ -1,70 +1,51 @@ <script lang="ts"> import { createEventDispatcher, getContext } from 'svelte' - import { join_session, request_change_b, scribe_str_b } from '@syn-ui/model' - import { connection_b } from '@syn-ui/zome-client' + import { + commit_change_b, scribe_str_b, session_info_b, sessions_b, toggle_session + } from '@syn-ui/model' import { bufferToBase64 } from '@syn-ui/utils' const ctx = getContext('ctx') - const connection = connection_b(ctx) + const session_info = session_info_b(ctx) + // this is the list of sessions returned by the DNA + const sessions = sessions_b(ctx) const scribe_str = scribe_str_b(ctx) - - const request_change = request_change_b(ctx) - const session = session_b(ctx) + const commit_change = commit_change_b(ctx) // this properties are the app-defined functions to apply and undo changes export let apply_delta_fn, undoFn - // this is the list of sessions returned by the DNA - let sessions - // ----------------------------------------------------------------------- const dispatch = createEventDispatcher() - let adminPort=1234 - let app_port=8888 - let app_id='syn' + let adminPort = 1234 + let app_port = 8888 + let app_id = 'syn' async function toggle() { - if (!$session) { - // if (!$connection) { - $session = await join_session({ app_port, app_id, apply_delta_fn, ctx }) - // $connection = new Connection(ctx, app_port, app_id) - // await $connection.open({title:'', body:''}, apply_delta_fn) - // - // session = $connection.syn.session - // - // console.log('joining session...') - // await $connection.joinSession() - sessions = $connection.sessions - } - else { - $connection.syn.clearState() - sessions = undefined + await toggle_session({ app_port, app_id, apply_delta_fn, ctx }) + if (!$session_info) { console.log('disconnected') } } - async function commit_change() { - $session.commit_change() - } - $: noscribe = $scribe_str === '' </script> <style> :global(.noscribe) { - pointer-events: none; - position: relative; + pointer-events: none; + position: relative; } :global(.noscribe:after) { - content: ' '; - z-index: 20; - display: block; - position: absolute; - height: 100%; - top: 0; - left: 0; - right: 0; - background: rgba(255, 255, 255, 0.7); + content: ' '; + z-index: 20; + display: block; + position: absolute; + height: 100%; + top: 0; + left: 0; + right: 0; + background: rgba(255, 255, 255, 0.7); } input { width: 4em; @@ -86,7 +67,7 @@ App Port: <input bind:value={app_port}> AppId: <input bind:value={app_id}> <button on:click={toggle}> - {#if $connection} + {#if $session_info} Disconnect {:else} Connect @@ -96,11 +77,9 @@ <div class='sessions'> Sessions: - {#if sessions} - {#each sessions as session} + {#each $sessions || [] as session} <span class='session'> Id: {bufferToBase64(session).slice(-4)} </span> {/each} - {/if} </div> diff --git a/ui/apps/app/src/Title.svelte b/ui/apps/app/src/Title.svelte index bea7ad53..bd1498dd 100644 --- a/ui/apps/app/src/Title.svelte +++ b/ui/apps/app/src/Title.svelte @@ -1,6 +1,6 @@ <script lang="ts"> import { createEventDispatcher, getContext, tick } from 'svelte' - import { content_b } from './content' + import { content_b } from '@syn-ui/model' const ctx = getContext('ctx') const dispatch = createEventDispatcher() const content = content_b(ctx) diff --git a/ui/libs/main.ts b/ui/apps/app/src/main.ts similarity index 100% rename from ui/libs/main.ts rename to ui/apps/app/src/main.ts diff --git a/ui/apps/headless/package.json b/ui/apps/headless/package.json index 0fe48bb8..81d8861f 100644 --- a/ui/apps/headless/package.json +++ b/ui/apps/headless/package.json @@ -13,8 +13,8 @@ "svelte-fa": "^2.2.0" }, "devDependencies": { - "@ctx-core/object": "^17.5.9", - "@ctx-core/store": "^24.5.0", + "@ctx-core/object": "^17.5.10", + "@ctx-core/store": "^24.5.2", "@rollup/plugin-commonjs": "^18.0.0", "@rollup/plugin-node-resolve": "^11.2.1", "@rollup/plugin-replace": "^2.4.2", diff --git a/ui/libs/model/.gitignore b/ui/libs/model/.gitignore new file mode 100644 index 00000000..1521c8b7 --- /dev/null +++ b/ui/libs/model/.gitignore @@ -0,0 +1 @@ +dist diff --git a/ui/libs/model/package.json b/ui/libs/model/package.json index da0fd0f0..3d1d1371 100644 --- a/ui/libs/model/package.json +++ b/ui/libs/model/package.json @@ -1,18 +1,18 @@ { "name": "@syn-ui/model", "version": "1.0.0", - "main": "./src/index.ts", - "module": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.js", "types": "./src/index.ts", "scripts": {}, "devDependencies": { "@ctx-core/combinators": "^6.0.10", - "@ctx-core/object": "^17.5.9", - "@ctx-core/store": "^24.5.0", + "@ctx-core/object": "^17.5.10", + "@ctx-core/store": "^24.5.2", "@holochain/conductor-api": "0.0.3", "@syn-ui/utils": "workspace:^1.0.0", "@syn-ui/zome-client": "workspace:^1.0.0", "svelte": "^3.37.0", "typescript": "^4.2.4" } -} \ No newline at end of file +} diff --git a/ui/libs/model/src/colors/CSSifyHSL.ts b/ui/libs/model/src/colors/CSSifyHSL.ts index 0e7b6352..ff730fce 100644 --- a/ui/libs/model/src/colors/CSSifyHSL.ts +++ b/ui/libs/model/src/colors/CSSifyHSL.ts @@ -1,4 +1,4 @@ -import type { HSL } from './HSL' +import type { HSL } from '@syn-ui/zome-client' export function CSSifyHSL(hslArray:HSL) { const [h, s, l] = hslArray return `hsl(${h} ${s}% ${l}%)` diff --git a/ui/libs/model/src/colors/index.ts b/ui/libs/model/src/colors/index.ts index db415b8d..f60c3b2c 100644 --- a/ui/libs/model/src/colors/index.ts +++ b/ui/libs/model/src/colors/index.ts @@ -1,8 +1,6 @@ export * from './arrayBufferToHex' export * from './clamp' export * from './CSSifyHSL' -export * from './FolkColors' export * from './getFolkColors' -export * from './HSL' export * from './my_colors_b' export * from './rgbToHsl' diff --git a/ui/libs/model/src/content/index.ts b/ui/libs/model/src/content/index.ts index c4570274..82066eec 100644 --- a/ui/libs/model/src/content/index.ts +++ b/ui/libs/model/src/content/index.ts @@ -1,2 +1 @@ -export * from './Content' export * from './content_b' diff --git a/ui/libs/model/tsconfig.json b/ui/libs/model/tsconfig.json index 4082f16a..88221382 100644 --- a/ui/libs/model/tsconfig.json +++ b/ui/libs/model/tsconfig.json @@ -1,3 +1,8 @@ { - "extends": "../../tsconfig.json" + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "dist", + "declarationDir": "dist", + "declaration": true + } } diff --git a/ui/libs/utils/.gitignore b/ui/libs/utils/.gitignore new file mode 100644 index 00000000..1521c8b7 --- /dev/null +++ b/ui/libs/utils/.gitignore @@ -0,0 +1 @@ +dist diff --git a/ui/libs/utils/package.json b/ui/libs/utils/package.json index cc179cef..4c02cbbd 100644 --- a/ui/libs/utils/package.json +++ b/ui/libs/utils/package.json @@ -1,8 +1,8 @@ { "name": "@syn-ui/utils", "version": "1.0.0", - "main": "./src/index.ts", - "module": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.js", "types": "./src/index.ts", "scripts": {}, "dependencies": { diff --git a/ui/libs/utils/tsconfig.json b/ui/libs/utils/tsconfig.json index 4082f16a..88221382 100644 --- a/ui/libs/utils/tsconfig.json +++ b/ui/libs/utils/tsconfig.json @@ -1,3 +1,8 @@ { - "extends": "../../tsconfig.json" + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "dist", + "declarationDir": "dist", + "declaration": true + } } diff --git a/ui/libs/zome-client/.gitignore b/ui/libs/zome-client/.gitignore new file mode 100644 index 00000000..1521c8b7 --- /dev/null +++ b/ui/libs/zome-client/.gitignore @@ -0,0 +1 @@ +dist diff --git a/ui/libs/zome-client/package.json b/ui/libs/zome-client/package.json index ab7fef1b..23047f6c 100644 --- a/ui/libs/zome-client/package.json +++ b/ui/libs/zome-client/package.json @@ -1,15 +1,16 @@ { "name": "@syn-ui/zome-client", "version": "1.0.0", - "main": "./src/index.ts", - "module": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.js", "types": "./src/index.ts", "scripts": {}, "devDependencies": { "@ctx-core/function": "^17.4.7", - "@ctx-core/object": "^17.5.9", - "@ctx-core/store": "^24.5.0", + "@ctx-core/object": "^17.5.10", + "@ctx-core/store": "^24.5.2", + "@holochain/conductor-api": "^0.0.3", "@syn-ui/utils": "workspace:^1.0.0", "typescript": "^4.2.4" } -} \ No newline at end of file +} diff --git a/ui/libs/zome-client/src/Zome.ts b/ui/libs/zome-client/src/Zome.ts deleted file mode 100644 index 5fe55727..00000000 --- a/ui/libs/zome-client/src/Zome.ts +++ /dev/null @@ -1,56 +0,0 @@ -import type { AppWebsocket, HoloHash, InstalledAppInfo } from '@holochain/conductor-api' -import { bufferToBase64 } from '../utils' -export class Zome { - constructor(public app_ws:AppWebsocket, public app_id:string) { - } - agent_pub_key:HoloHash - appInfo:InstalledAppInfo - cell_id:[HoloHash, HoloHash] - dna:HoloHash - dna_str:string - me:string - - async attach() { - // setup the syn instance data - this.appInfo = await this.app_ws.appInfo({ installed_app_id: this.app_id }) - this.cell_id = this.appInfo.cell_data[0].cell_id - this.agent_pub_key = this.cell_id[1] - this.dna = this.cell_id[0] - this.dna_str = bufferToBase64(this.dna) - this.me = bufferToBase64(this.agent_pub_key) - } - - attached() { - return this.appInfo != undefined - } - - async call(fn_name:string, payload:any, timeout?:number) { - if (!this.attached()) { - console.log('Can\'t call zome when disconnected from conductor') - return - } - try { - const zome_name = 'syn' - console.log(`Making zome call ${fn_name} with:`, payload) - const result = await this.app_ws.callZome( - { - cap: null, - cell_id: this.cell_id, - zome_name, - fn_name, - provenance: this.agent_pub_key, - payload - }, - timeout - ) - return result - } catch (error) { - console.log('ERROR: callZome threw error', error) - throw(error) - // if (error == 'Error: Socket is not open') { - // TODO return doResetConnection(dispatch) - // } - } - } - -} diff --git a/ui/libs/zome-client/src/connection_b.ts b/ui/libs/zome-client/src/connection_b.ts deleted file mode 100644 index e8738116..00000000 --- a/ui/libs/zome-client/src/connection_b.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { _b } from '@ctx-core/object' -import { writable$ } from '@ctx-core/store' -import type { Connection } from './Connection' -export const connection_b = _b('connection', ()=>{ - return writable$<Connection>(null) -}) diff --git a/ui/libs/zome-client/src/index.ts b/ui/libs/zome-client/src/index.ts index 4154aba1..8ada23ba 100644 --- a/ui/libs/zome-client/src/index.ts +++ b/ui/libs/zome-client/src/index.ts @@ -7,8 +7,6 @@ export * from './app_ws_b' export * from './app_ws_cb_b' export * from './cell_id_b' export * from './Commit' -export * from './Connection' -export * from './connection_b' export * from './Content' export * from './decodeJson' export * from './Delta' @@ -37,4 +35,3 @@ export * from './rpc_send_sync_response_b' export * from './SessionInfo' export * from './Signal' export * from './StateForSync' -export * from './Zome' diff --git a/ui/libs/zome-client/tsconfig.json b/ui/libs/zome-client/tsconfig.json index 4082f16a..54a7acc1 100644 --- a/ui/libs/zome-client/tsconfig.json +++ b/ui/libs/zome-client/tsconfig.json @@ -1,3 +1,18 @@ { - "extends": "../../tsconfig.json" + "extends": "../../tsconfig.json", + "compilerOptions": { + "skipLibCheck": true, + "skipDefaultLibCheck": true, + "outDir": "dist", + "declarationDir": "dist", + "declaration": true + }, + "include": [ + "./src/**/*" + ], + "exclude": [ + "node_modules/**", + "**/node_modules/**", + "**/dist/**" + ] } diff --git a/ui/package.json b/ui/package.json deleted file mode 100644 index 2dbd3acf..00000000 --- a/ui/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "devDependencies": { - "@holochain/conductor-api": "^0.0.3", - "@syn-ui/utils": "workspace:^1.0.0" - } -} diff --git a/ui/tsconfig.json b/ui/tsconfig.json index f0712164..946858a9 100644 --- a/ui/tsconfig.json +++ b/ui/tsconfig.json @@ -33,5 +33,10 @@ "dom" ] }, + "exclude": [ + "node_modules/**", + "**/node_modules/**", + "**/dist/**" + ], "references": [] } From dc996e5ce80d0c3b4142be10dce1a9e64cc9abad Mon Sep 17 00:00:00 2001 From: Brian Takita <brian.takita@gmail.com> Date: Mon, 26 Apr 2021 02:36:21 -0400 Subject: [PATCH 13/33] wip: site renders --- ui/apps/app/src/Folks.svelte | 4 +++- .../src/{session => delta}/commit_change_b.ts | 17 ++++++++--------- .../model/src/{session => delta}/deltas_b.ts | 2 +- ui/libs/model/src/delta/index.ts | 4 ++++ .../src/{session => delta}/record_deltas_b.ts | 4 +++- ui/libs/model/src/delta/request_change_b.ts | 3 +-- .../{session => delta}/snapshot_content_b.ts | 4 ++-- ui/libs/model/src/session/index.ts | 4 ---- .../model/src/signals/ChangeReq_SignalOps_b.ts | 4 ++-- ui/libs/model/src/signals/Change_SignalOps_b.ts | 4 ++-- ui/libs/zome-client/src/appInfo_b.ts | 1 + ui/libs/zome-client/src/app_ws_b.ts | 14 +++++++++----- 12 files changed, 36 insertions(+), 29 deletions(-) rename ui/libs/model/src/{session => delta}/commit_change_b.ts (83%) rename ui/libs/model/src/{session => delta}/deltas_b.ts (88%) rename ui/libs/model/src/{session => delta}/record_deltas_b.ts (89%) rename ui/libs/model/src/{session => delta}/snapshot_content_b.ts (91%) diff --git a/ui/apps/app/src/Folks.svelte b/ui/apps/app/src/Folks.svelte index aeacff58..abd1da80 100644 --- a/ui/apps/app/src/Folks.svelte +++ b/ui/apps/app/src/Folks.svelte @@ -6,6 +6,8 @@ const ctx = getContext('ctx') const me = me_b(ctx) const folks = folks_b(ctx) + let folks_keys = [] + $: folks_keys = $folks ? Object.keys($folks) : [] </script> <style> :global(:root) { @@ -23,7 +25,7 @@ {#if $me} <Folk me={true} pubKeyStr={$me}/> {/if} - {#each Object.keys($folks) as p} + {#each folks_keys as p} <Folk pubKeyStr={p}/> {/each} </div> diff --git a/ui/libs/model/src/session/commit_change_b.ts b/ui/libs/model/src/delta/commit_change_b.ts similarity index 83% rename from ui/libs/model/src/session/commit_change_b.ts rename to ui/libs/model/src/delta/commit_change_b.ts index 4ce0183a..59773a4b 100644 --- a/ui/libs/model/src/session/commit_change_b.ts +++ b/ui/libs/model/src/delta/commit_change_b.ts @@ -1,16 +1,15 @@ import { _b, assign } from '@ctx-core/object' import { Commit, rpc_commit_b, rpc_hash_content_b } from '@syn-ui/zome-client' import { bufferToBase64 } from '@syn-ui/utils' -import { _scribe_signal_folk_pubKey_a1_b, committed_changes_b, recorded_changes_b } from '../delta' import { content_b } from '../content' -import { commit_in_progress_b } from './commit_in_progress_b' -import { snapshot_hash_str_b } from './snapshot_hash_str_b' -import { content_hash_str_b } from './content_hash_str_b' -import { content_hash_b } from './content_hash_b' -import { snapshot_hash_b } from './snapshot_hash_b' -import { current_commit_header_hash_b } from './current_commit_header_hash_b' -import { session_info_b } from './session_info_b' -import { am_i_scribe_b } from './am_i_scribe_b' +import { + am_i_scribe_b, commit_in_progress_b, content_hash_b, + content_hash_str_b, current_commit_header_hash_b, session_info_b, + snapshot_hash_b, snapshot_hash_str_b +} from '../session' +import { recorded_changes_b } from './recorded_changes_b' +import { _scribe_signal_folk_pubKey_a1_b } from './_scribe_signal_folk_pubKey_a1_b' +import { committed_changes_b } from './committed_changes_b' export const commit_change_b = _b('commit_change', (ctx)=>{ const recorded_changes = recorded_changes_b(ctx) const commit_in_progress = commit_in_progress_b(ctx) diff --git a/ui/libs/model/src/session/deltas_b.ts b/ui/libs/model/src/delta/deltas_b.ts similarity index 88% rename from ui/libs/model/src/session/deltas_b.ts rename to ui/libs/model/src/delta/deltas_b.ts index 1ae0e956..dc8f1ee2 100644 --- a/ui/libs/model/src/session/deltas_b.ts +++ b/ui/libs/model/src/delta/deltas_b.ts @@ -1,7 +1,7 @@ import { _b } from '@ctx-core/object' -import { session_info_b } from './session_info_b' import { derived$ } from '@ctx-core/store' import type { Delta } from '@syn-ui/zome-client' +import { session_info_b } from '../session' export const deltas_b = _b('deltas', (ctx)=>{ const session_info = session_info_b(ctx) return derived$(session_info, $session_info=> diff --git a/ui/libs/model/src/delta/index.ts b/ui/libs/model/src/delta/index.ts index 9dbae377..8d71049d 100644 --- a/ui/libs/model/src/delta/index.ts +++ b/ui/libs/model/src/delta/index.ts @@ -1,12 +1,16 @@ export * from './ApplyDelta' export * from './apply_delta_fn_b' +export * from './commit_change_b' export * from './committed_changes_b' +export * from './deltas_b' export * from './next_index_b' export * from './record_delta_b' +export * from './record_deltas_b' export * from './recorded_changes_b' export * from './request_change_b' export * from './requested_changes_b' export * from './run_apply_delta_b' export * from './_scribe_signal_folk_pubKey_a1_b' export * from './send_change_b' +export * from './snapshot_content_b' export * from './StateForSync' diff --git a/ui/libs/model/src/session/record_deltas_b.ts b/ui/libs/model/src/delta/record_deltas_b.ts similarity index 89% rename from ui/libs/model/src/session/record_deltas_b.ts rename to ui/libs/model/src/delta/record_deltas_b.ts index e74cb663..90725abb 100644 --- a/ui/libs/model/src/session/record_deltas_b.ts +++ b/ui/libs/model/src/delta/record_deltas_b.ts @@ -1,6 +1,8 @@ import type { Delta } from '@syn-ui/zome-client' import { _b } from '@ctx-core/object' -import { record_delta_b, recorded_changes_b, requested_changes_b } from '../delta' +import { requested_changes_b } from './requested_changes_b' +import { recorded_changes_b } from './recorded_changes_b' +import { record_delta_b } from './record_delta_b' export const record_deltas_b = _b('record_deltas', (ctx)=>{ const requested_changes = requested_changes_b(ctx) return function record_deltas(_index:number, deltas:Delta[]) { diff --git a/ui/libs/model/src/delta/request_change_b.ts b/ui/libs/model/src/delta/request_change_b.ts index 61824dd8..796dcf35 100644 --- a/ui/libs/model/src/delta/request_change_b.ts +++ b/ui/libs/model/src/delta/request_change_b.ts @@ -1,7 +1,6 @@ import { _b } from '@ctx-core/object' import { Delta, my_tag_b, rpc_send_change_request_b } from '@syn-ui/zome-client' -import { am_i_scribe_b } from '../session/am_i_scribe_b' -import { scribe_b } from '../session' +import { am_i_scribe_b, scribe_b } from '../session' import { next_index_b } from './next_index_b' import { record_delta_b } from './record_delta_b' import { send_change_b } from './send_change_b' diff --git a/ui/libs/model/src/session/snapshot_content_b.ts b/ui/libs/model/src/delta/snapshot_content_b.ts similarity index 91% rename from ui/libs/model/src/session/snapshot_content_b.ts rename to ui/libs/model/src/delta/snapshot_content_b.ts index b1603baa..e8fff995 100644 --- a/ui/libs/model/src/session/snapshot_content_b.ts +++ b/ui/libs/model/src/delta/snapshot_content_b.ts @@ -1,9 +1,9 @@ import { _b } from '@ctx-core/object' import { derived$ } from '@ctx-core/store' import { Content, my_tag_b } from '@syn-ui/zome-client' -import { apply_delta_fn_b } from '../delta' import { content_b } from '../content' -import { session_info_b } from './session_info_b' +import { session_info_b } from '../session' +import { apply_delta_fn_b } from './apply_delta_fn_b' import { deltas_b } from './deltas_b' export const snapshot_content_b = _b('snapshot_content', (ctx)=>{ const session_info = session_info_b(ctx) diff --git a/ui/libs/model/src/session/index.ts b/ui/libs/model/src/session/index.ts index aa8dce10..2c598d6a 100644 --- a/ui/libs/model/src/session/index.ts +++ b/ui/libs/model/src/session/index.ts @@ -1,17 +1,13 @@ export * from './am_i_scribe_b' -export * from './commit_change_b' export * from './commit_in_progress_b' export * from './content_hash_b' export * from './content_hash_str_b' export * from './current_commit_header_hash_b' -export * from './deltas_b' export * from './folks_b' -export * from './record_deltas_b' export * from './scribe_b' export * from './scribe_str_b' export * from './session_info_b' export * from './sessions_b' -export * from './snapshot_content_b' export * from './snapshot_hash_b' export * from './snapshot_hash_str_b' export * from './update_folks_b' diff --git a/ui/libs/model/src/signals/ChangeReq_SignalOps_b.ts b/ui/libs/model/src/signals/ChangeReq_SignalOps_b.ts index c3d75aac..900fccb5 100644 --- a/ui/libs/model/src/signals/ChangeReq_SignalOps_b.ts +++ b/ui/libs/model/src/signals/ChangeReq_SignalOps_b.ts @@ -1,7 +1,7 @@ import { _b } from '@ctx-core/object' import type { Delta } from '@syn-ui/zome-client' -import { next_index_b, send_change_b } from '../delta' -import { am_i_scribe_b, record_deltas_b } from '../session' +import { next_index_b, record_deltas_b, send_change_b } from '../delta' +import { am_i_scribe_b } from '../session' import type { SignalOps } from './SignalOps' export const ChangeReq_SignalOps_b = _b<SignalOps>('ChangeReq_SignalOps', (ctx)=>{ const am_i_scribe = am_i_scribe_b(ctx) diff --git a/ui/libs/model/src/signals/Change_SignalOps_b.ts b/ui/libs/model/src/signals/Change_SignalOps_b.ts index cd9b7405..b92d24c5 100644 --- a/ui/libs/model/src/signals/Change_SignalOps_b.ts +++ b/ui/libs/model/src/signals/Change_SignalOps_b.ts @@ -1,7 +1,7 @@ import type { AppSignal } from '@holochain/conductor-api' import { _b } from '@ctx-core/object' -import { next_index_b } from '../delta' -import { am_i_scribe_b, record_deltas_b } from '../session' +import { next_index_b, record_deltas_b } from '../delta' +import { am_i_scribe_b } from '../session' import type { SignalOps } from './SignalOps' export const Change_SignalOps_b = _b<SignalOps>('Change_SignalOps', (ctx)=>{ const next_index = next_index_b(ctx) diff --git a/ui/libs/zome-client/src/appInfo_b.ts b/ui/libs/zome-client/src/appInfo_b.ts index 26cf1628..40e64450 100644 --- a/ui/libs/zome-client/src/appInfo_b.ts +++ b/ui/libs/zome-client/src/appInfo_b.ts @@ -7,6 +7,7 @@ export const appInfo_b = _b('appInfo', (ctx)=>{ const app_id = app_id_b(ctx) const app_ws = app_ws_b(ctx) const appInfo:appInfo_T = derived$([app_ws, app_id], ([$app_ws, $app_id], set)=>{ + if (!$app_ws || !$app_id) return (async()=>{ set(await $app_ws.appInfo({ installed_app_id: $app_id })) })() diff --git a/ui/libs/zome-client/src/app_ws_b.ts b/ui/libs/zome-client/src/app_ws_b.ts index d8b24c55..af233991 100644 --- a/ui/libs/zome-client/src/app_ws_b.ts +++ b/ui/libs/zome-client/src/app_ws_b.ts @@ -6,13 +6,17 @@ import { app_ws_cb_b } from './app_ws_cb_b' export const app_ws_b = _b('app_ws', (ctx)=>{ const app_port = app_port_b(ctx) const app_ws_cb = app_ws_cb_b(ctx) + let $app_ws:AppWebsocket return derived$(app_port, ($app_port, set)=>{ + if (!$app_port) return (async ()=>{ - set( - await _app_ws($app_port, (signal:AppSignal)=>{ - app_ws_cb.$(signal) - }) - ) + if ($app_ws) { + await $app_ws.client.close() + } + $app_ws = await _app_ws($app_port, (signal:AppSignal)=>{ + app_ws_cb.$(signal) + }) + set($app_ws) })() }) as Readable<AppWebsocket> }) From b442813d22f841e51394440ab0abe9983f15788b Mon Sep 17 00:00:00 2001 From: Brian Takita <brian.takita@gmail.com> Date: Tue, 27 Apr 2021 15:40:14 -0400 Subject: [PATCH 14/33] update dependencies --- package.json | 2 +- pnpm-lock.yaml | 116 +++++++++++++++---------------- tests/package.json | 2 +- ui/apps/app/package.json | 4 +- ui/apps/headless/package.json | 4 +- ui/libs/model/package.json | 6 +- ui/libs/zome-client/package.json | 6 +- 7 files changed, 70 insertions(+), 70 deletions(-) diff --git a/package.json b/package.json index cdf91f5e..cbed5231 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "@changesets/cli": "^2.16.0", "@ctx-core/function": "^17.4.7", "@ctx-core/jetbrains": "^4.0.33", - "@ctx-core/monorepo": "^15.0.51", + "@ctx-core/monorepo": "^15.0.54", "@ctx-core/pnpm-tools": "^6.0.11", "pnpm": "^6.2.1", "typescript": "4.2.4" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 45dfca50..b1761d67 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,7 +8,7 @@ importers: '@changesets/cli': ^2.16.0 '@ctx-core/function': ^17.4.7 '@ctx-core/jetbrains': ^4.0.33 - '@ctx-core/monorepo': ^15.0.51 + '@ctx-core/monorepo': ^15.0.54 '@ctx-core/pnpm-tools': ^6.0.11 pnpm: ^6.2.1 typescript: 4.2.4 @@ -17,7 +17,7 @@ importers: '@changesets/cli': 2.16.0 '@ctx-core/function': 17.4.7 '@ctx-core/jetbrains': 4.0.33 - '@ctx-core/monorepo': 15.0.51 + '@ctx-core/monorepo': 15.0.54 '@ctx-core/pnpm-tools': 6.0.11 pnpm: 6.2.1 typescript: 4.2.4 @@ -30,7 +30,7 @@ importers: '@syn-ui/utils': workspace:^1.0.0 '@syn-ui/zome-client': workspace:^1.0.0 '@types/lodash': ^4.14.168 - '@types/node': ^14.14.41 + '@types/node': ^15.0.1 esm: ^3.2.25 lodash: ^4.17.21 tape: ^5.2.2 @@ -51,13 +51,13 @@ importers: '@syn-ui/utils': link:../ui/libs/utils '@syn-ui/zome-client': link:../ui/libs/zome-client '@types/lodash': 4.14.168 - '@types/node': 14.14.41 + '@types/node': 15.0.1 ui/apps/app: specifiers: '@ctx-core/combinators': ^6.0.10 - '@ctx-core/object': ^17.5.10 - '@ctx-core/store': ^24.5.2 + '@ctx-core/object': ^17.5.11 + '@ctx-core/store': ^24.5.5 '@holochain/conductor-api': 0.0.3 '@rollup/plugin-commonjs': ^18.0.0 '@rollup/plugin-node-resolve': ^11.2.1 @@ -82,8 +82,8 @@ importers: sirv-cli: 1.0.11 svelte-fa: 2.2.0 devDependencies: - '@ctx-core/object': 17.5.10 - '@ctx-core/store': 24.5.2 + '@ctx-core/object': 17.5.11 + '@ctx-core/store': 24.5.5 '@rollup/plugin-commonjs': 18.0.0_rollup@2.45.2 '@rollup/plugin-node-resolve': 11.2.1_rollup@2.45.2 '@rollup/plugin-replace': 2.4.2_rollup@2.45.2 @@ -103,8 +103,8 @@ importers: ui/apps/headless: specifiers: '@ctx-core/combinators': ^6.0.10 - '@ctx-core/object': ^17.5.10 - '@ctx-core/store': ^24.5.2 + '@ctx-core/object': ^17.5.11 + '@ctx-core/store': ^24.5.5 '@holochain/conductor-api': 0.0.3 '@rollup/plugin-commonjs': ^18.0.0 '@rollup/plugin-node-resolve': ^11.2.1 @@ -126,8 +126,8 @@ importers: sirv-cli: 1.0.11 svelte-fa: 2.2.0 devDependencies: - '@ctx-core/object': 17.5.10 - '@ctx-core/store': 24.5.2 + '@ctx-core/object': 17.5.11 + '@ctx-core/store': 24.5.5 '@rollup/plugin-commonjs': 18.0.0_rollup@2.45.2 '@rollup/plugin-node-resolve': 11.2.1_rollup@2.45.2 '@rollup/plugin-replace': 2.4.2_rollup@2.45.2 @@ -144,8 +144,8 @@ importers: ui/libs/model: specifiers: '@ctx-core/combinators': ^6.0.10 - '@ctx-core/object': ^17.5.10 - '@ctx-core/store': ^24.5.2 + '@ctx-core/object': ^17.5.11 + '@ctx-core/store': ^24.5.5 '@holochain/conductor-api': 0.0.3 '@syn-ui/utils': workspace:^1.0.0 '@syn-ui/zome-client': workspace:^1.0.0 @@ -153,8 +153,8 @@ importers: typescript: ^4.2.4 devDependencies: '@ctx-core/combinators': 6.0.10 - '@ctx-core/object': 17.5.10 - '@ctx-core/store': 24.5.2 + '@ctx-core/object': 17.5.11 + '@ctx-core/store': 24.5.5 '@holochain/conductor-api': 0.0.3 '@syn-ui/utils': link:../utils '@syn-ui/zome-client': link:../zome-client @@ -170,15 +170,15 @@ importers: ui/libs/zome-client: specifiers: '@ctx-core/function': ^17.4.7 - '@ctx-core/object': ^17.5.10 - '@ctx-core/store': ^24.5.2 + '@ctx-core/object': ^17.5.11 + '@ctx-core/store': ^24.5.5 '@holochain/conductor-api': ^0.0.3 '@syn-ui/utils': workspace:^1.0.0 typescript: ^4.2.4 devDependencies: '@ctx-core/function': 17.4.7 - '@ctx-core/object': 17.5.10 - '@ctx-core/store': 24.5.2 + '@ctx-core/object': 17.5.11 + '@ctx-core/store': 24.5.5 '@holochain/conductor-api': 0.0.3 '@syn-ui/utils': link:../utils typescript: 4.2.4 @@ -387,31 +387,31 @@ packages: prettier: 1.19.1 dev: true - /@ctx-core/array/20.2.12: - resolution: {integrity: sha512-kd+6PF0v8u7g1daQAiRXAYx9sGYBUpUJUgasE9G+4On+HF0SSx61X5z6LLEJzrOf5PGmEedoF3dQ2HgTU9nqRw==} + /@ctx-core/array/20.2.13: + resolution: {integrity: sha512-BQObHyviZh1/8AxmcxjOfG1WyDGy7I3o/Yr30IzWkNS7ktAHioi3YUS/TyDwtDb6Mb5TiPGBAd5ANnf9TvE7LA==} dependencies: '@ctx-core/combinators': 6.0.10 '@ctx-core/function': 17.4.7 - '@ctx-core/object': 17.5.10 + '@ctx-core/object': 17.5.11 '@ctx-core/set': 9.0.18 dev: true - /@ctx-core/cli-args/7.2.22: - resolution: {integrity: sha512-QRs9x+tUcevEhoI8zeBjhdaY3mi/CLCi8KqALNHoJe06JYOORG+ZPj26vt6SfWOTt9H1ZsMraEoKVqhAMHEl8g==} + /@ctx-core/cli-args/7.2.23: + resolution: {integrity: sha512-5qjmwEOnAchoarvZmFwZUkM+ZR/93s1o1oNx7T6iHW77/SAbfEfNsEg9tzFFidBUgXPVWEuSXO4kabs1eFLp+Q==} dependencies: - '@ctx-core/array': 20.2.12 + '@ctx-core/array': 20.2.13 '@ctx-core/function': 17.4.7 - '@ctx-core/object': 17.5.10 + '@ctx-core/object': 17.5.11 dev: true /@ctx-core/combinators/6.0.10: resolution: {integrity: sha512-l16FC/IsyfTOffJkRq5kZSgfnjNa8Wz7m0HpyGQu6//fcePpOvFL+HuQvXgnsMREF6DiayW03QXdStk1kCDBjw==} - /@ctx-core/ctx-core-package-tools/6.0.44: - resolution: {integrity: sha512-P/dDxfaZeOhvFPRvMXzyaiHnBV0BkIwLuH99/MBgmsE/Y6klat0jfHv5KcWyAlcK72ha9CEufdY2DhHXpuZb6w==} + /@ctx-core/ctx-core-package-tools/6.0.47: + resolution: {integrity: sha512-fEHIFI28aP1bHrFEeECqCNS3ZlR21cQNxq9Z8H/OkL57ooPsWRBlQQwziJCnFyAMl5fn42frksVTnW35QwXUuQ==} hasBin: true dependencies: - '@ctx-core/array': 20.2.12 + '@ctx-core/array': 20.2.13 dev: true /@ctx-core/function/17.4.7: @@ -422,19 +422,19 @@ packages: resolution: {integrity: sha512-5o0fnCLUl0gLqEqDM6NAokqOuO7kZo+Juv8qQP7cocVdEPS5/Dslk9wG1SLbpESwcCAr/Uam9VRkeQRTJlKMKg==} hasBin: true dependencies: - '@ctx-core/cli-args': 7.2.22 + '@ctx-core/cli-args': 7.2.23 '@ctx-core/queue': 3.0.10 esm: 3.2.25 globby: 11.0.3 dev: true - /@ctx-core/monorepo/15.0.51: - resolution: {integrity: sha512-DPONMvR8ZqCk5BlO0wD9CCyzm+zZ4MlAZ8HnG0HICjeidtDpaavlH/p4cwKDX/VbVtnNv04uhFcbfvFWVNFksg==} + /@ctx-core/monorepo/15.0.54: + resolution: {integrity: sha512-fMeLRv5B9rfCjsOA5j5y72CY7Vtm+pVm5clp6xWJxV/XwNLPIXQRkgibznaqBQBdEa0yGKKVX2puI70aedcx0Q==} hasBin: true dependencies: - '@ctx-core/array': 20.2.12 - '@ctx-core/cli-args': 7.2.22 - '@ctx-core/ctx-core-package-tools': 6.0.44 + '@ctx-core/array': 20.2.13 + '@ctx-core/cli-args': 7.2.23 + '@ctx-core/ctx-core-package-tools': 6.0.47 '@ctx-core/package': 6.1.20 '@ctx-core/queue': 3.0.10 detect-indent: 6.0.0 @@ -444,8 +444,8 @@ packages: semver: 7.3.5 dev: true - /@ctx-core/object/17.5.10: - resolution: {integrity: sha512-ettwQ3/WpWLlCrgL+WndM0ESL3hMXwIVyRt/31FLk6PVeN6e42tSKgmyd/1LNJid/FNA6+EtIsvLustHUP+I/g==} + /@ctx-core/object/17.5.11: + resolution: {integrity: sha512-j8BHbufH6GFz+8uogeZUptB4/0o2AUWi66SOa1ixFV1/rpMoSLOQqbXheiRJRAWHuonQjhvMjbRbVM0aaR4yvw==} dependencies: '@ctx-core/function': 17.4.7 dev: true @@ -454,7 +454,7 @@ packages: resolution: {integrity: sha512-dSdBXWBo9eT9Q3v74Q6wyVawKFwC6S+7pOdpI/ctPKwDqcuP28thI3cWD4O3Iafk4/HVsDDON3Sgse28KbJ2jg==} hasBin: true dependencies: - '@ctx-core/cli-args': 7.2.22 + '@ctx-core/cli-args': 7.2.23 esm: 3.2.25 resolve: 1.20.0 dev: true @@ -478,13 +478,13 @@ packages: '@ctx-core/function': 17.4.7 dev: true - /@ctx-core/store/24.5.2: - resolution: {integrity: sha512-TxM0nWK23MbzNGMPu28SWFE539l3KYo+3TBFCA8YkzYJFywDehaDTscVzu9FdXkydYuXMur2sjKOLkPFEtuArw==} + /@ctx-core/store/24.5.5: + resolution: {integrity: sha512-2PWc/SYGGN+GgUMxd4/pG2rRGDmhsE/8v1DEXJ2zGob7fzbgIofD0nHN/unpypQVUyrRuft5rFic6Cq15taS2A==} dependencies: - '@ctx-core/array': 20.2.12 + '@ctx-core/array': 20.2.13 '@ctx-core/combinators': 6.0.10 '@ctx-core/function': 17.4.7 - '@ctx-core/object': 17.5.10 + '@ctx-core/object': 17.5.11 svelte: 3.37.0 dev: true @@ -500,7 +500,7 @@ packages: resolution: {integrity: sha512-wok/uiyGoX4m59wMhT3VX2Ma6bXBfZwp8F8iqTb/XiHz0UpROOCrUELXnmN9Ee1sYnmJcTLYRhRTCZ73WRgkdA==} dependencies: '@msgpack/msgpack': 2.4.0 - '@types/ws': 7.4.1 + '@types/ws': 7.4.2 isomorphic-ws: 4.0.1_ws@7.4.5 nanoid: 3.1.22 ws: 7.4.5 @@ -552,7 +552,7 @@ packages: resolution: {integrity: sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==} dependencies: '@babel/runtime': 7.13.17 - '@types/node': 12.20.10 + '@types/node': 12.20.11 find-up: 4.1.0 fs-extra: 8.1.0 dev: true @@ -710,12 +710,12 @@ packages: resolution: {integrity: sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg==} dev: true - /@types/node/12.20.10: - resolution: {integrity: sha512-TxCmnSSppKBBOzYzPR2BR25YlX5Oay8z2XGwFBInuA/Co0V9xJhLlW4kjbxKtgeNo3NOMbQP1A5Rc03y+XecPw==} + /@types/node/12.20.11: + resolution: {integrity: sha512-gema+apZ6qLQK7k7F0dGkGCWQYsL0qqKORWOQO6tq46q+x+1C0vbOiOqOwRVlh4RAdbQwV/j/ryr3u5NOG1fPQ==} dev: true - /@types/node/14.14.41: - resolution: {integrity: sha512-dueRKfaJL4RTtSa7bWeTK1M+VH+Gns73oCgzvYfHZywRCoPSd8EkXBL0mZ9unPTveBn+D9phZBaxuzpwjWkW0g==} + /@types/node/15.0.1: + resolution: {integrity: sha512-TMkXt0Ck1y0KKsGr9gJtWGjttxlZnnvDtphxUOSd0bfaR6Q1jle+sPvrzNR1urqYTWMinoKvjKfXUGsumaO1PA==} /@types/normalize-package-data/2.4.0: resolution: {integrity: sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==} @@ -728,13 +728,13 @@ packages: /@types/resolve/1.17.1: resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} dependencies: - '@types/node': 14.14.41 + '@types/node': 15.0.1 dev: true /@types/sass/1.16.0: resolution: {integrity: sha512-2XZovu4NwcqmtZtsBR5XYLw18T8cBCnU2USFHTnYLLHz9fkhnoEMoDsqShJIOFsFhn5aJHjweiUUdTrDGujegA==} dependencies: - '@types/node': 14.14.41 + '@types/node': 15.0.1 dev: true /@types/semver/6.2.2: @@ -745,10 +745,10 @@ packages: resolution: {integrity: sha512-eQ9qFW/fhfGJF8WKHGEHZEyVWfZxrT+6CLIJGBcZPfxUh/+BnEj+UCGYMlr9qZuX/2AltsvwrGqp0LhEW8D0zQ==} dev: false - /@types/ws/7.4.1: - resolution: {integrity: sha512-ISCK1iFnR+jYv7+jLNX0wDqesZ/5RAeY3wUx6QaphmocphU61h+b+PHjS18TF4WIPTu/MMzxIq2PHr32o2TS5Q==} + /@types/ws/7.4.2: + resolution: {integrity: sha512-PbeN0Eydl7LQl4OIav29YmkO2LxbVuz3nZD/kb19lOS+wLgIkRbWMNmU/QQR7ABpOJ7D7xDOU8co7iohObewrw==} dependencies: - '@types/node': 14.14.41 + '@types/node': 15.0.1 /ansi-align/2.0.0: resolution: {integrity: sha1-w2rsy6VjuJzrVW82kPCx2eNUf38=} @@ -1931,7 +1931,7 @@ packages: resolution: {integrity: sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 14.14.41 + '@types/node': 15.0.1 merge-stream: 2.0.0 supports-color: 7.2.0 dev: true @@ -2639,7 +2639,7 @@ packages: jest-worker: 26.6.2 rollup: 2.45.2 serialize-javascript: 4.0.0 - terser: 5.6.1 + terser: 5.7.0 dev: true /rollup-pluginutils/2.8.2: @@ -3044,8 +3044,8 @@ packages: engines: {node: '>=8'} dev: true - /terser/5.6.1: - resolution: {integrity: sha512-yv9YLFQQ+3ZqgWCUk+pvNJwgUTdlIxUk1WTN+RnaFJe2L7ipG2csPT0ra2XRm7Cs8cxN7QXmK1rFzEwYEQkzXw==} + /terser/5.7.0: + resolution: {integrity: sha512-HP5/9hp2UaZt5fYkuhNBR8YyRcT8juw8+uFbAme53iN9hblvKnLUTKkmwJG6ocWpIKf8UK4DoeWG4ty0J6S6/g==} engines: {node: '>=10'} hasBin: true dependencies: diff --git a/tests/package.json b/tests/package.json index 8e49fe86..9e7ccede 100644 --- a/tests/package.json +++ b/tests/package.json @@ -25,6 +25,6 @@ "@syn-ui/utils": "workspace:^1.0.0", "@syn-ui/zome-client": "workspace:^1.0.0", "@types/lodash": "^4.14.168", - "@types/node": "^14.14.41" + "@types/node": "^15.0.1" } } \ No newline at end of file diff --git a/ui/apps/app/package.json b/ui/apps/app/package.json index 474d69b6..db97dc60 100644 --- a/ui/apps/app/package.json +++ b/ui/apps/app/package.json @@ -13,8 +13,8 @@ "svelte-fa": "^2.2.0" }, "devDependencies": { - "@ctx-core/object": "^17.5.10", - "@ctx-core/store": "^24.5.2", + "@ctx-core/object": "^17.5.11", + "@ctx-core/store": "^24.5.5", "@rollup/plugin-commonjs": "^18.0.0", "@rollup/plugin-node-resolve": "^11.2.1", "@rollup/plugin-replace": "^2.4.2", diff --git a/ui/apps/headless/package.json b/ui/apps/headless/package.json index 81d8861f..7ab2bcae 100644 --- a/ui/apps/headless/package.json +++ b/ui/apps/headless/package.json @@ -13,8 +13,8 @@ "svelte-fa": "^2.2.0" }, "devDependencies": { - "@ctx-core/object": "^17.5.10", - "@ctx-core/store": "^24.5.2", + "@ctx-core/object": "^17.5.11", + "@ctx-core/store": "^24.5.5", "@rollup/plugin-commonjs": "^18.0.0", "@rollup/plugin-node-resolve": "^11.2.1", "@rollup/plugin-replace": "^2.4.2", diff --git a/ui/libs/model/package.json b/ui/libs/model/package.json index 3d1d1371..beec7dc7 100644 --- a/ui/libs/model/package.json +++ b/ui/libs/model/package.json @@ -7,12 +7,12 @@ "scripts": {}, "devDependencies": { "@ctx-core/combinators": "^6.0.10", - "@ctx-core/object": "^17.5.10", - "@ctx-core/store": "^24.5.2", + "@ctx-core/object": "^17.5.11", + "@ctx-core/store": "^24.5.5", "@holochain/conductor-api": "0.0.3", "@syn-ui/utils": "workspace:^1.0.0", "@syn-ui/zome-client": "workspace:^1.0.0", "svelte": "^3.37.0", "typescript": "^4.2.4" } -} +} \ No newline at end of file diff --git a/ui/libs/zome-client/package.json b/ui/libs/zome-client/package.json index 23047f6c..bdfdd037 100644 --- a/ui/libs/zome-client/package.json +++ b/ui/libs/zome-client/package.json @@ -7,10 +7,10 @@ "scripts": {}, "devDependencies": { "@ctx-core/function": "^17.4.7", - "@ctx-core/object": "^17.5.10", - "@ctx-core/store": "^24.5.2", + "@ctx-core/object": "^17.5.11", + "@ctx-core/store": "^24.5.5", "@holochain/conductor-api": "^0.0.3", "@syn-ui/utils": "workspace:^1.0.0", "typescript": "^4.2.4" } -} +} \ No newline at end of file From 5b4cbc70c58782cf75655e59d7b92bd9a68e9056 Mon Sep 17 00:00:00 2001 From: Brian Takita <brian.takita@gmail.com> Date: Tue, 27 Apr 2021 23:15:26 -0400 Subject: [PATCH 15/33] wip: Connect button: working --- pnpm-lock.yaml | 183 ++++++++++++++++++--- ui/apps/app/.vscode/extensions.json | 3 + ui/apps/app/package.json | 15 +- ui/apps/app/rollup.config.js | 11 +- ui/apps/app/scripts/setupTypeScript.js | 117 ------------- ui/apps/app/src/App.svelte | 7 + ui/apps/app/src/Folk.svelte | 2 +- ui/apps/app/tsconfig.json | 7 +- ui/apps/headless/package.json | 2 +- ui/libs/model/package.json | 4 +- ui/libs/model/src/actions/join_session.ts | 2 + ui/libs/model/src/session/sessions_b.ts | 15 +- ui/libs/zome-client/package.json | 3 +- ui/libs/zome-client/src/Buffer.ts | 8 + ui/libs/zome-client/src/agent_pub_key_b.ts | 2 +- ui/libs/zome-client/src/index.ts | 1 + 16 files changed, 218 insertions(+), 164 deletions(-) create mode 100644 ui/apps/app/.vscode/extensions.json delete mode 100644 ui/apps/app/scripts/setupTypeScript.js create mode 100644 ui/libs/zome-client/src/Buffer.ts diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b1761d67..38a6b3cb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -57,25 +57,29 @@ importers: specifiers: '@ctx-core/combinators': ^6.0.10 '@ctx-core/object': ^17.5.11 - '@ctx-core/store': ^24.5.5 + '@ctx-core/store': ^24.5.6 '@holochain/conductor-api': 0.0.3 '@rollup/plugin-commonjs': ^18.0.0 '@rollup/plugin-node-resolve': ^11.2.1 '@rollup/plugin-replace': ^2.4.2 - '@rollup/plugin-typescript': ^8.2.1 + '@rollup/plugin-typescript': ^6.1.0 '@syn-ui/model': workspace:^1.0.0 '@syn-ui/zome-client': workspace:^1.0.0 + '@tsconfig/svelte': ^1.0.10 + buffer: ^6.0.3 rollup: ^2.45.2 rollup-plugin-css-only: ^3.1.0 rollup-plugin-livereload: ^2.0.0 + rollup-plugin-node-polyfills: ^0.2.1 rollup-plugin-svelte: ^7.1.0 rollup-plugin-terser: ^7.0.2 sirv-cli: ^1.0.11 svelte: ^3.37.0 + svelte-check: ^1.5.2 svelte-fa: ^2.2.0 svelte-preprocess: ^4.7.2 tslib: ^2.2.0 - typescript: ^4.2.4 + typescript: ^3.9.9 dependencies: '@ctx-core/combinators': 6.0.10 '@holochain/conductor-api': 0.0.3 @@ -83,28 +87,32 @@ importers: svelte-fa: 2.2.0 devDependencies: '@ctx-core/object': 17.5.11 - '@ctx-core/store': 24.5.5 + '@ctx-core/store': 24.5.6 '@rollup/plugin-commonjs': 18.0.0_rollup@2.45.2 '@rollup/plugin-node-resolve': 11.2.1_rollup@2.45.2 '@rollup/plugin-replace': 2.4.2_rollup@2.45.2 - '@rollup/plugin-typescript': 8.2.1_d21869dc49fccc93d6599238c3a50ee6 + '@rollup/plugin-typescript': 6.1.0_94bd13ed9056efdf75c69b35fe3b3146 '@syn-ui/model': link:../../libs/model '@syn-ui/zome-client': link:../../libs/zome-client + '@tsconfig/svelte': 1.0.10 + buffer: 6.0.3 rollup: 2.45.2 rollup-plugin-css-only: 3.1.0_rollup@2.45.2 rollup-plugin-livereload: 2.0.0 + rollup-plugin-node-polyfills: 0.2.1 rollup-plugin-svelte: 7.1.0_rollup@2.45.2+svelte@3.37.0 rollup-plugin-terser: 7.0.2_rollup@2.45.2 svelte: 3.37.0 - svelte-preprocess: 4.7.2_svelte@3.37.0+typescript@4.2.4 + svelte-check: 1.5.2_svelte@3.37.0 + svelte-preprocess: 4.7.2_svelte@3.37.0+typescript@3.9.9 tslib: 2.2.0 - typescript: 4.2.4 + typescript: 3.9.9 ui/apps/headless: specifiers: '@ctx-core/combinators': ^6.0.10 '@ctx-core/object': ^17.5.11 - '@ctx-core/store': ^24.5.5 + '@ctx-core/store': ^24.5.6 '@holochain/conductor-api': 0.0.3 '@rollup/plugin-commonjs': ^18.0.0 '@rollup/plugin-node-resolve': ^11.2.1 @@ -127,7 +135,7 @@ importers: svelte-fa: 2.2.0 devDependencies: '@ctx-core/object': 17.5.11 - '@ctx-core/store': 24.5.5 + '@ctx-core/store': 24.5.6 '@rollup/plugin-commonjs': 18.0.0_rollup@2.45.2 '@rollup/plugin-node-resolve': 11.2.1_rollup@2.45.2 '@rollup/plugin-replace': 2.4.2_rollup@2.45.2 @@ -145,7 +153,7 @@ importers: specifiers: '@ctx-core/combinators': ^6.0.10 '@ctx-core/object': ^17.5.11 - '@ctx-core/store': ^24.5.5 + '@ctx-core/store': ^24.5.6 '@holochain/conductor-api': 0.0.3 '@syn-ui/utils': workspace:^1.0.0 '@syn-ui/zome-client': workspace:^1.0.0 @@ -154,7 +162,7 @@ importers: devDependencies: '@ctx-core/combinators': 6.0.10 '@ctx-core/object': 17.5.11 - '@ctx-core/store': 24.5.5 + '@ctx-core/store': 24.5.6 '@holochain/conductor-api': 0.0.3 '@syn-ui/utils': link:../utils '@syn-ui/zome-client': link:../zome-client @@ -171,16 +179,18 @@ importers: specifiers: '@ctx-core/function': ^17.4.7 '@ctx-core/object': ^17.5.11 - '@ctx-core/store': ^24.5.5 + '@ctx-core/store': ^24.5.6 '@holochain/conductor-api': ^0.0.3 '@syn-ui/utils': workspace:^1.0.0 + buffer: ^6.0.3 typescript: ^4.2.4 devDependencies: '@ctx-core/function': 17.4.7 '@ctx-core/object': 17.5.11 - '@ctx-core/store': 24.5.5 + '@ctx-core/store': 24.5.6 '@holochain/conductor-api': 0.0.3 '@syn-ui/utils': link:../utils + buffer: 6.0.3 typescript: 4.2.4 packages: @@ -478,8 +488,8 @@ packages: '@ctx-core/function': 17.4.7 dev: true - /@ctx-core/store/24.5.5: - resolution: {integrity: sha512-2PWc/SYGGN+GgUMxd4/pG2rRGDmhsE/8v1DEXJ2zGob7fzbgIofD0nHN/unpypQVUyrRuft5rFic6Cq15taS2A==} + /@ctx-core/store/24.5.6: + resolution: {integrity: sha512-6e19x2i4xUVcQaEdjoUe85h6GNgZGESGQEmdJZzqeYJZO7M5w/GktcOEpNAac70c3n/y56nD0uKErDYt1ME41A==} dependencies: '@ctx-core/array': 20.2.13 '@ctx-core/combinators': 6.0.10 @@ -642,19 +652,19 @@ packages: rollup: 2.45.2 dev: true - /@rollup/plugin-typescript/8.2.1_d21869dc49fccc93d6599238c3a50ee6: - resolution: {integrity: sha512-Qd2E1pleDR4bwyFxqbjt4eJf+wB0UKVMLc7/BAFDGVdAXQMCsD4DUv5/7/ww47BZCYxWtJqe1Lo0KVNswBJlRw==} + /@rollup/plugin-typescript/6.1.0_94bd13ed9056efdf75c69b35fe3b3146: + resolution: {integrity: sha512-hJxaiE6WyNOsK+fZpbFh9CUijZYqPQuAOWO5khaGTUkM8DYNNyA2TDlgamecE+qLOG1G1+CwbWMAx3rbqpp6xQ==} engines: {node: '>=8.0.0'} peerDependencies: rollup: ^2.14.0 tslib: '*' - typescript: '>=3.7.0' + typescript: '>=3.4.0' dependencies: '@rollup/pluginutils': 3.1.0_rollup@2.45.2 resolve: 1.20.0 rollup: 2.45.2 tslib: 2.2.0 - typescript: 4.2.4 + typescript: 3.9.9 dev: true /@rollup/plugin-typescript/8.2.1_rollup@2.45.2+typescript@4.2.4: @@ -694,6 +704,10 @@ packages: rollup: 2.45.2 dev: true + /@tsconfig/svelte/1.0.10: + resolution: {integrity: sha512-EBrpH2iXXfaf/9z81koiDYkp2mlwW2XzFcAqn6qh7VKyP8zBvHHAQzNhY+W9vH5arAjmGAm5g8ElWq6YmXm3ig==} + dev: true + /@types/estree/0.0.39: resolution: {integrity: sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==} dev: true @@ -938,6 +952,13 @@ packages: ieee754: 1.2.1 dev: true + /buffer/6.0.3: + resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==} + dependencies: + base64-js: 1.5.1 + ieee754: 1.2.1 + dev: true + /builtin-modules/3.2.0: resolution: {integrity: sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA==} engines: {node: '>=6'} @@ -950,6 +971,11 @@ packages: get-intrinsic: 1.1.1 dev: false + /callsites/3.1.0: + resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} + engines: {node: '>=6'} + dev: true + /camelcase-keys/6.2.2: resolution: {integrity: sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==} engines: {node: '>=8'} @@ -1678,6 +1704,14 @@ packages: engines: {node: '>= 4'} dev: true + /import-fresh/3.3.0: + resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} + engines: {node: '>=6'} + dependencies: + parent-module: 1.0.1 + resolve-from: 4.0.0 + dev: true + /indent-string/4.0.0: resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} engines: {node: '>=8'} @@ -2190,7 +2224,6 @@ packages: /minimist/1.2.5: resolution: {integrity: sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==} - dev: false /mixme/0.5.1: resolution: {integrity: sha512-NaeZIckeBFT7i0XBEpGyFcAE0/bLcQ9MHErTpnU3bLWVE5WZbxG5Y3fDsMxYGifTo5khDA42OquXCC2ngKJB+g==} @@ -2367,6 +2400,13 @@ packages: engines: {node: '>=6'} dev: true + /parent-module/1.0.1: + resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} + engines: {node: '>=6'} + dependencies: + callsites: 3.1.0 + dev: true + /parse-json/5.2.0: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} @@ -2559,6 +2599,11 @@ packages: resolution: {integrity: sha1-eZlTn8ngR6N5KPoZb44VY9q9Nt4=} dev: true + /resolve-from/4.0.0: + resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} + engines: {node: '>=4'} + dev: true + /resolve-from/5.0.0: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} engines: {node: '>=8'} @@ -2607,6 +2652,15 @@ packages: rollup: 2.45.2 dev: true + /rollup-plugin-inject/3.0.2: + resolution: {integrity: sha512-ptg9PQwzs3orn4jkgXJ74bfs5vYz1NCZlSQMBUA0wKcGp5i5pA1AO3fOUEte8enhGUC+iapTCzEWw2jEFFUO/w==} + deprecated: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject. + dependencies: + estree-walker: 0.6.1 + magic-string: 0.25.7 + rollup-pluginutils: 2.8.2 + dev: true + /rollup-plugin-livereload/2.0.0: resolution: {integrity: sha512-oC/8NqumGYuphkqrfszOHUUIwzKsaHBICw6QRwT5uD07gvePTS+HW+GFwu6f9K8W02CUuTvtIM9AWJrbj4wE1A==} engines: {node: '>=8.3'} @@ -2617,6 +2671,12 @@ packages: - utf-8-validate dev: true + /rollup-plugin-node-polyfills/0.2.1: + resolution: {integrity: sha512-4kCrKPTJ6sK4/gLL/U5QzVT8cxJcofO0OU74tnB19F40cmuAKSzH5/siithxlofFEjwvw1YAhPmbvGNA6jEroA==} + dependencies: + rollup-plugin-inject: 3.0.2 + dev: true + /rollup-plugin-svelte/7.1.0_rollup@2.45.2+svelte@3.37.0: resolution: {integrity: sha512-vopCUq3G+25sKjwF5VilIbiY6KCuMNHP1PFvx2Vr3REBNMDllKHFZN2B9jwwC+MqNc3UPKkjXnceLPEjTjXGXg==} engines: {node: '>=10'} @@ -2951,10 +3011,87 @@ packages: has-flag: 4.0.0 dev: true + /svelte-check/1.5.2_svelte@3.37.0: + resolution: {integrity: sha512-x9Pc13r814TKrMXY70IyqDEmPzuFiqNSpBmsrMKrFpi995MiG+lmqYnyw8iQC+DGh7H3eUt3LIFXbNd396XIFw==} + hasBin: true + peerDependencies: + svelte: ^3.24.0 + dependencies: + chalk: 4.1.1 + chokidar: 3.5.1 + glob: 7.1.6 + import-fresh: 3.3.0 + minimist: 1.2.5 + source-map: 0.7.3 + svelte: 3.37.0 + svelte-preprocess: 4.7.2_svelte@3.37.0+typescript@3.9.9 + typescript: 3.9.9 + transitivePeerDependencies: + - '@babel/core' + - coffeescript + - less + - node-sass + - postcss + - postcss-load-config + - pug + - sass + - stylus + - sugarss + dev: true + /svelte-fa/2.2.0: resolution: {integrity: sha512-PN1H8AWDh+OwhwjJKTv4/zXvKvmvOEVSCVhIhji6Onx8XEw+CGf8BDR0BVUIp87IEX+DEqIo9pbyhgz8EoYZyA==} dev: false + /svelte-preprocess/4.7.2_svelte@3.37.0+typescript@3.9.9: + resolution: {integrity: sha512-EToG+08rEsA33btv+C5g2qnRArwpTc5AoU0QBB3ZEkYagxAb2yPNsy0qsmtvbJOTBMy6o3oyijDdl3DMpMvpEg==} + engines: {node: '>= 9.11.2'} + requiresBuild: true + peerDependencies: + '@babel/core': ^7.10.2 + coffeescript: ^2.5.1 + less: ^3.11.3 + node-sass: '*' + postcss: ^7 || ^8 + postcss-load-config: ^2.1.0 || ^3.0.0 + pug: ^3.0.0 + sass: ^1.26.8 + stylus: ^0.54.7 + sugarss: ^2.0.0 + svelte: ^3.23.0 + typescript: ^3.9.5 || ^4.0.0 + peerDependenciesMeta: + '@babel/core': + optional: true + coffeescript: + optional: true + less: + optional: true + node-sass: + optional: true + postcss: + optional: true + postcss-load-config: + optional: true + pug: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + typescript: + optional: true + dependencies: + '@types/pug': 2.0.4 + '@types/sass': 1.16.0 + detect-indent: 6.0.0 + strip-indent: 3.0.0 + svelte: 3.37.0 + typescript: 3.9.9 + dev: true + /svelte-preprocess/4.7.2_svelte@3.37.0+typescript@4.2.4: resolution: {integrity: sha512-EToG+08rEsA33btv+C5g2qnRArwpTc5AoU0QBB3ZEkYagxAb2yPNsy0qsmtvbJOTBMy6o3oyijDdl3DMpMvpEg==} engines: {node: '>= 9.11.2'} @@ -3162,6 +3299,12 @@ packages: resolution: {integrity: sha512-180WMDQaIMm3+7hGXWf12GtdniDEy7nYcyFMKJn/eZz/6tSLXrUN9V0wKSbMjej0I1WHWbpREDEKHtqPQa9NNw==} dev: true + /typescript/3.9.9: + resolution: {integrity: sha512-kdMjTiekY+z/ubJCATUPlRDl39vXYiMV9iyeMuEuXZh2we6zz80uovNN2WlAxmmdE/Z/YQe+EbOEXB5RHEED3w==} + engines: {node: '>=4.2.0'} + hasBin: true + dev: true + /typescript/4.2.4: resolution: {integrity: sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==} engines: {node: '>=4.2.0'} diff --git a/ui/apps/app/.vscode/extensions.json b/ui/apps/app/.vscode/extensions.json new file mode 100644 index 00000000..bdef8201 --- /dev/null +++ b/ui/apps/app/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["svelte.svelte-vscode"] +} diff --git a/ui/apps/app/package.json b/ui/apps/app/package.json index db97dc60..2140bb5d 100644 --- a/ui/apps/app/package.json +++ b/ui/apps/app/package.json @@ -4,7 +4,8 @@ "scripts": { "build": "rollup -c", "dev": "rollup -c -w", - "start": "sirv public" + "start": "sirv public", + "validate": "svelte-check" }, "dependencies": { "@ctx-core/combinators": "^6.0.10", @@ -14,21 +15,25 @@ }, "devDependencies": { "@ctx-core/object": "^17.5.11", - "@ctx-core/store": "^24.5.5", + "@ctx-core/store": "^24.5.6", "@rollup/plugin-commonjs": "^18.0.0", "@rollup/plugin-node-resolve": "^11.2.1", "@rollup/plugin-replace": "^2.4.2", - "@rollup/plugin-typescript": "^8.2.1", + "@rollup/plugin-typescript": "^6.1.0", "@syn-ui/model": "workspace:^1.0.0", "@syn-ui/zome-client": "workspace:^1.0.0", + "@tsconfig/svelte": "^1.0.10", + "buffer": "^6.0.3", "rollup": "^2.45.2", "rollup-plugin-css-only": "^3.1.0", "rollup-plugin-livereload": "^2.0.0", + "rollup-plugin-node-polyfills": "^0.2.1", "rollup-plugin-svelte": "^7.1.0", "rollup-plugin-terser": "^7.0.2", "svelte": "^3.37.0", + "svelte-check": "^1.5.2", "svelte-preprocess": "^4.7.2", "tslib": "^2.2.0", - "typescript": "^4.2.4" + "typescript": "^3.9.9" } -} \ No newline at end of file +} diff --git a/ui/apps/app/rollup.config.js b/ui/apps/app/rollup.config.js index 50692184..403620e3 100644 --- a/ui/apps/app/rollup.config.js +++ b/ui/apps/app/rollup.config.js @@ -5,6 +5,7 @@ import resolve from '@rollup/plugin-node-resolve' import livereload from 'rollup-plugin-livereload' import { terser } from 'rollup-plugin-terser' import css from 'rollup-plugin-css-only' +import polyfills from 'rollup-plugin-node-polyfills' import typescript from '@rollup/plugin-typescript' import preprocess from 'svelte-preprocess' @@ -37,12 +38,13 @@ export default { sourcemap: true, format: 'iife', name: 'app', - dir: 'public/build' + dir: 'public/build', + intro: 'const global = window;' }, plugins: [ replace({ preventAssignment: true, - 'process.env.NODE_ENV': JSON.stringify(process.env.NODE) + 'process.env.NODE_ENV': JSON.stringify(process.env.NODE), }), svelte({ compilerOptions: { @@ -60,6 +62,7 @@ export default { // we'll extract any component CSS out into // a separate file - better for performance css({ output: 'main.css' }), + polyfills(), // If you have external dependencies installed from // npm, you'll most likely need these plugins. In @@ -72,6 +75,10 @@ export default { }), typescript(), commonjs(), + typescript({ + sourceMap: !production, + inlineSources: !production + }), // In dev mode, call `npm run start` once // the bundle has been generated diff --git a/ui/apps/app/scripts/setupTypeScript.js b/ui/apps/app/scripts/setupTypeScript.js deleted file mode 100644 index d4710951..00000000 --- a/ui/apps/app/scripts/setupTypeScript.js +++ /dev/null @@ -1,117 +0,0 @@ -// @ts-check - -/** This script modifies the project to support TS code in .svelte files like: - - <script lang="ts"> - export let name: string; - </script> - - As well as validating the code for CI. - */ - -/** To work on this script: - rm -rf test-template template && git clone sveltejs/template test-template && node scripts/setupTypeScript.js test-template -*/ - -const fs = require("fs") -const path = require("path") -const { argv } = require("process") - -const projectRoot = argv[2] || path.join(__dirname, "..") - -// Add deps to pkg.json -const packageJSON = JSON.parse(fs.readFileSync(path.join(projectRoot, "package.json"), "utf8")) -packageJSON.devDependencies = Object.assign(packageJSON.devDependencies, { - "svelte-check": "^1.0.0", - "svelte-preprocess": "^4.0.0", - "@rollup/plugin-typescript": "^6.0.0", - "typescript": "^3.9.3", - "tslib": "^2.0.0", - "@tsconfig/svelte": "^1.0.0" -}) - -// Add script for checking -packageJSON.scripts = Object.assign(packageJSON.scripts, { - "validate": "svelte-check" -}) - -// Write the package JSON -fs.writeFileSync(path.join(projectRoot, "package.json"), JSON.stringify(packageJSON, null, " ")) - -// mv src/main.js to main.ts - note, we need to edit rollup.config.js for this too -const beforeMainJSPath = path.join(projectRoot, "src", "main.js") -const afterMainTSPath = path.join(projectRoot, "src", "main.ts") -fs.renameSync(beforeMainJSPath, afterMainTSPath) - -// Switch the app.svelte file to use TS -const appSveltePath = path.join(projectRoot, "src", "App.svelte") -let appFile = fs.readFileSync(appSveltePath, "utf8") -appFile = appFile.replace("<script>", '<script lang="ts">') -appFile = appFile.replace("export let name;", 'export let name: string;') -fs.writeFileSync(appSveltePath, appFile) - -// Edit rollup config -const rollupConfigPath = path.join(projectRoot, "rollup.config.js") -let rollupConfig = fs.readFileSync(rollupConfigPath, "utf8") - -// Edit imports -rollupConfig = rollupConfig.replace(`'rollup-plugin-terser';`, `'rollup-plugin-terser'; -import sveltePreprocess from 'svelte-preprocess'; -import typescript from '@rollup/plugin-typescript';`) - -// Replace name of entry point -rollupConfig = rollupConfig.replace(`'src/main.js'`, `'src/main.ts'`) - -// Add preprocessor -rollupConfig = rollupConfig.replace( - 'compilerOptions:', - 'preprocess: sveltePreprocess(),\n\t\t\tcompilerOptions:' -); - -// Add TypeScript -rollupConfig = rollupConfig.replace( - 'commonjs(),', - 'commonjs(),\n\t\ttypescript({\n\t\t\tsourceMap: !production,\n\t\t\tinlineSources: !production\n\t\t}),' -); -fs.writeFileSync(rollupConfigPath, rollupConfig) - -// Add TSConfig -const tsconfig = `{ - "extends": "@tsconfig/svelte/tsconfig.json", - - "include": ["src/**/*"], - "exclude": ["node_modules/*", "__sapper__/*", "public/*"] -}` -const tsconfigPath = path.join(projectRoot, "tsconfig.json") -fs.writeFileSync(tsconfigPath, tsconfig) - -// Delete this script, but not during testing -if (!argv[2]) { - // Remove the script - fs.unlinkSync(path.join(__filename)) - - // Check for Mac's DS_store file, and if it's the only one left remove it - const remainingFiles = fs.readdirSync(path.join(__dirname)) - if (remainingFiles.length === 1 && remainingFiles[0] === '.DS_store') { - fs.unlinkSync(path.join(__dirname, '.DS_store')) - } - - // Check if the scripts folder is empty - if (fs.readdirSync(path.join(__dirname)).length === 0) { - // Remove the scripts folder - fs.rmdirSync(path.join(__dirname)) - } -} - -// Adds the extension recommendation -fs.mkdirSync(path.join(projectRoot, ".vscode")) -fs.writeFileSync(path.join(projectRoot, ".vscode", "extensions.json"), `{ - "recommendations": ["svelte.svelte-vscode"] -} -`) - -console.log("Converted to TypeScript.") - -if (fs.existsSync(path.join(projectRoot, "node_modules"))) { - console.log("\nYou will need to re-run your dependency manager to get started.") -} diff --git a/ui/apps/app/src/App.svelte b/ui/apps/app/src/App.svelte index 41136ad6..7281cdb4 100644 --- a/ui/apps/app/src/App.svelte +++ b/ui/apps/app/src/App.svelte @@ -10,6 +10,13 @@ import Debug from './Debug.svelte' import History from './History.svelte' let ctx = {} + window.ctx = ctx + declare global { + interface Window { + ctx:object + } + } + setContext('ctx', ctx) const scribe_str = scribe_str_b(ctx) diff --git a/ui/apps/app/src/Folk.svelte b/ui/apps/app/src/Folk.svelte index ac442cfd..fa1c4915 100644 --- a/ui/apps/app/src/Folk.svelte +++ b/ui/apps/app/src/Folk.svelte @@ -14,7 +14,7 @@ $: scribe = pubKeyStr == $scribe_str let outOfSession - $: outOfSession = (!$folks[pubKeyStr] || !$folks[pubKeyStr].inSession) && !me + $: outOfSession = $folks?.[pubKeyStr]?.inSession && !me function setUpHex(hexEl) { let colors if (me) { diff --git a/ui/apps/app/tsconfig.json b/ui/apps/app/tsconfig.json index 4082f16a..b082e968 100644 --- a/ui/apps/app/tsconfig.json +++ b/ui/apps/app/tsconfig.json @@ -1,3 +1,6 @@ { - "extends": "../../tsconfig.json" -} + "extends": "@tsconfig/svelte/tsconfig.json", + + "include": ["src/**/*"], + "exclude": ["node_modules/*", "__sapper__/*", "public/*"] +} \ No newline at end of file diff --git a/ui/apps/headless/package.json b/ui/apps/headless/package.json index 7ab2bcae..4bb3f213 100644 --- a/ui/apps/headless/package.json +++ b/ui/apps/headless/package.json @@ -14,7 +14,7 @@ }, "devDependencies": { "@ctx-core/object": "^17.5.11", - "@ctx-core/store": "^24.5.5", + "@ctx-core/store": "^24.5.6", "@rollup/plugin-commonjs": "^18.0.0", "@rollup/plugin-node-resolve": "^11.2.1", "@rollup/plugin-replace": "^2.4.2", diff --git a/ui/libs/model/package.json b/ui/libs/model/package.json index beec7dc7..d5a16320 100644 --- a/ui/libs/model/package.json +++ b/ui/libs/model/package.json @@ -8,11 +8,11 @@ "devDependencies": { "@ctx-core/combinators": "^6.0.10", "@ctx-core/object": "^17.5.11", - "@ctx-core/store": "^24.5.5", + "@ctx-core/store": "^24.5.6", "@holochain/conductor-api": "0.0.3", "@syn-ui/utils": "workspace:^1.0.0", "@syn-ui/zome-client": "workspace:^1.0.0", "svelte": "^3.37.0", "typescript": "^4.2.4" } -} \ No newline at end of file +} diff --git a/ui/libs/model/src/actions/join_session.ts b/ui/libs/model/src/actions/join_session.ts index be8f8b54..2765ad80 100644 --- a/ui/libs/model/src/actions/join_session.ts +++ b/ui/libs/model/src/actions/join_session.ts @@ -29,8 +29,10 @@ export async function join_session(params:join_session_params_T) { SyncResp_SignalOps_b(ctx), ) const app_ws_cb = app_ws_cb_b(ctx) + // app_ws_cb.set($app_ws_cb) app_ws_cb.$ = $app_ws_cb const app_id = app_id_b(ctx) + // app_id.set(params.app_id) app_id.$ = params.app_id const app_port = app_port_b(ctx) app_port.$ = params.app_port diff --git a/ui/libs/model/src/session/sessions_b.ts b/ui/libs/model/src/session/sessions_b.ts index b8ec4550..4d4586b5 100644 --- a/ui/libs/model/src/session/sessions_b.ts +++ b/ui/libs/model/src/session/sessions_b.ts @@ -2,23 +2,13 @@ import { _b, assign } from '@ctx-core/object' import { Writable$, writable$ } from '@ctx-core/store' import { rpc_get_sessions_b } from '@syn-ui/zome-client' import type { EntryHash } from '@syn-ui/utils' -import { session_info_b } from './session_info_b' export const sessions_b = _b('sessions', (ctx)=>{ const rpc_get_sessions = rpc_get_sessions_b(ctx) - const session_info = session_info_b(ctx) const sessions = writable$<EntryHash[]>(null) const busy = writable$<boolean>(false) const out_sessions = sessions as sessions_T assign(out_sessions, { busy, load, unshift }) - session_info.subscribe(async ($session_info) => { - if ($session_info) { - if (!busy.$) { - await load() - } - } else { - sessions.$ = null - } - }) + load().then() return out_sessions async function load() { busy.$ = true @@ -27,6 +17,7 @@ export const sessions_b = _b('sessions', (ctx)=>{ } finally { busy.$ = false } + return sessions.$ } function unshift(...session_hash_a1:EntryHash[]) { const $sessions = sessions.$ @@ -37,6 +28,6 @@ export const sessions_b = _b('sessions', (ctx)=>{ }) export interface sessions_T extends Writable$<EntryHash[]> { busy:Writable$<boolean> - load():Promise<EntryHash> + load():Promise<EntryHash[]> unshift(...session_hash_a1:EntryHash[]):EntryHash[] } diff --git a/ui/libs/zome-client/package.json b/ui/libs/zome-client/package.json index bdfdd037..220c6344 100644 --- a/ui/libs/zome-client/package.json +++ b/ui/libs/zome-client/package.json @@ -8,9 +8,10 @@ "devDependencies": { "@ctx-core/function": "^17.4.7", "@ctx-core/object": "^17.5.11", - "@ctx-core/store": "^24.5.5", + "@ctx-core/store": "^24.5.6", "@holochain/conductor-api": "^0.0.3", "@syn-ui/utils": "workspace:^1.0.0", + "buffer": "^6.0.3", "typescript": "^4.2.4" } } \ No newline at end of file diff --git a/ui/libs/zome-client/src/Buffer.ts b/ui/libs/zome-client/src/Buffer.ts new file mode 100644 index 00000000..93c13e60 --- /dev/null +++ b/ui/libs/zome-client/src/Buffer.ts @@ -0,0 +1,8 @@ +import { Buffer } from 'buffer' +export { Buffer } +window.Buffer = Buffer +declare global { + interface Window { + Buffer:typeof Buffer + } +} diff --git a/ui/libs/zome-client/src/agent_pub_key_b.ts b/ui/libs/zome-client/src/agent_pub_key_b.ts index 217bf067..1241969b 100644 --- a/ui/libs/zome-client/src/agent_pub_key_b.ts +++ b/ui/libs/zome-client/src/agent_pub_key_b.ts @@ -4,6 +4,6 @@ import { cell_id_b } from './cell_id_b' export const agent_pub_key_b = _b('agent_pub_key', (ctx)=>{ const cell_id = cell_id_b(ctx) return derived$(cell_id, $cell_id=> - $cell_id?.[0] + $cell_id?.[1] ) }) diff --git a/ui/libs/zome-client/src/index.ts b/ui/libs/zome-client/src/index.ts index 8ada23ba..bb07502b 100644 --- a/ui/libs/zome-client/src/index.ts +++ b/ui/libs/zome-client/src/index.ts @@ -5,6 +5,7 @@ export * from './appInfo_b' export * from './app_port_b' export * from './app_ws_b' export * from './app_ws_cb_b' +export * from './Buffer' export * from './cell_id_b' export * from './Commit' export * from './Content' From 85406bfd3f7844a4a2736c8bf3131e0f3a17f068 Mon Sep 17 00:00:00 2001 From: Brian Takita <brian.takita@gmail.com> Date: Wed, 28 Apr 2021 17:28:22 -0400 Subject: [PATCH 16/33] pnpm: + tests directory update dependencies --- .gitignore | 1 + bin/tsc-build.sh | 2 +- package.json | 8 +- pnpm-lock.yaml | 209 +++---- tests/syn-lib/index.ts | 4 +- tests/syn-lib/main.ts | 4 +- tests/syn-lib/syn-lib.ts | 37 +- tests/unit-test/syn.ts | 540 +++++++++--------- ui/apps/app/package.json | 10 +- ui/apps/app/src/App.svelte | 114 ++-- ui/apps/app/src/Editor.svelte | 63 +- ui/apps/app/src/Syn.svelte | 4 +- ui/apps/headless/package.json | 4 +- ui/libs/model/package.json | 6 +- ui/libs/model/src/actions/join_session.ts | 11 +- ui/libs/model/src/colors/arrayBufferToHex.ts | 4 +- ui/libs/model/src/colors/getFolkColors.ts | 4 +- ui/libs/model/src/content/content_b.ts | 2 +- .../delta/_scribe_signal_folk_pubKey_a1_b.ts | 5 +- ui/libs/model/src/delta/apply_delta_fn_b.ts | 6 - ui/libs/model/src/delta/commit_change_b.ts | 14 +- ui/libs/model/src/delta/index.ts | 1 - ui/libs/model/src/delta/record_deltas_b.ts | 3 +- ui/libs/model/src/delta/recorded_changes_b.ts | 15 +- ui/libs/model/src/delta/request_change_b.ts | 2 +- ui/libs/model/src/delta/run_apply_delta_b.ts | 74 ++- ui/libs/model/src/delta/snapshot_content_b.ts | 24 - ui/libs/model/src/session/content_hash_b.ts | 4 +- .../session/current_commit_header_hash_b.ts | 2 +- ui/libs/model/src/session/folks_b.ts | 4 +- ui/libs/model/src/session/scribe_b.ts | 8 +- ui/libs/model/src/session/session_info_b.ts | 5 +- ui/libs/model/src/session/sessions_b.ts | 26 +- ui/libs/model/src/session/snapshot_hash_b.ts | 5 +- ui/libs/model/src/session/update_folks_b.ts | 4 +- .../model/src/signals/SyncReq_SignalOps_b.ts | 5 +- .../model/src/signals/SyncResp_SignalOps_b.ts | 10 +- .../src/timers/request_checker_timer_b.ts | 10 +- .../src/timers/scribe_heartbeat_timer_b.ts | 9 +- ui/libs/zome-client/package.json | 6 +- ui/libs/zome-client/src/Commit.ts | 11 +- ui/libs/zome-client/src/Content.ts | 2 +- ui/libs/zome-client/src/Folk.ts | 11 +- ui/libs/zome-client/src/StateForSync.ts | 14 +- ui/libs/zome-client/src/app_id_b.ts | 2 +- ui/libs/zome-client/src/app_port_b.ts | 2 +- ui/libs/zome-client/src/rpc_b.ts | 2 +- ui/libs/zome-client/src/rpc_hash_content_b.ts | 4 +- ui/libs/zome-client/src/rpc_new_session_b.ts | 2 +- .../zome-client/src/rpc_send_heartbeat_b.ts | 2 +- ui/tsconfig.json | 5 +- 51 files changed, 635 insertions(+), 691 deletions(-) delete mode 100644 ui/libs/model/src/delta/apply_delta_fn_b.ts diff --git a/.gitignore b/.gitignore index 8572d1bc..8d4068e9 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ ui/node .cargo .idea .rollup.cache +*.iml diff --git a/bin/tsc-build.sh b/bin/tsc-build.sh index ab677a99..3e57167d 100755 --- a/bin/tsc-build.sh +++ b/bin/tsc-build.sh @@ -1,2 +1,2 @@ #!/bin/sh -tsc -b $(find ui/libs -maxdepth 1 -mindepth 1) $@ +tsc -b $(find ui/libs -maxdepth 1 -mindepth 1) tests $@ diff --git a/package.json b/package.json index cbed5231..907ef9ca 100644 --- a/package.json +++ b/package.json @@ -12,11 +12,11 @@ "devDependencies": { "@babel/runtime": "^7.13.17", "@changesets/cli": "^2.16.0", - "@ctx-core/function": "^17.4.7", - "@ctx-core/jetbrains": "^4.0.33", - "@ctx-core/monorepo": "^15.0.54", + "@ctx-core/function": "^17.4.8", + "@ctx-core/jetbrains": "^4.0.34", + "@ctx-core/monorepo": "^15.0.55", "@ctx-core/pnpm-tools": "^6.0.11", - "pnpm": "^6.2.1", + "pnpm": "^6.2.3", "typescript": "4.2.4" }, "noUpdate": [] diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 38a6b3cb..9bebbf31 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,20 +6,20 @@ importers: specifiers: '@babel/runtime': ^7.13.17 '@changesets/cli': ^2.16.0 - '@ctx-core/function': ^17.4.7 - '@ctx-core/jetbrains': ^4.0.33 - '@ctx-core/monorepo': ^15.0.54 + '@ctx-core/function': ^17.4.8 + '@ctx-core/jetbrains': ^4.0.34 + '@ctx-core/monorepo': ^15.0.55 '@ctx-core/pnpm-tools': ^6.0.11 - pnpm: ^6.2.1 + pnpm: ^6.2.3 typescript: 4.2.4 devDependencies: '@babel/runtime': 7.13.17 '@changesets/cli': 2.16.0 - '@ctx-core/function': 17.4.7 - '@ctx-core/jetbrains': 4.0.33 - '@ctx-core/monorepo': 15.0.54 + '@ctx-core/function': 17.4.8 + '@ctx-core/jetbrains': 4.0.34 + '@ctx-core/monorepo': 15.0.55 '@ctx-core/pnpm-tools': 6.0.11 - pnpm: 6.2.1 + pnpm: 6.2.3 typescript: 4.2.4 tests: @@ -56,13 +56,13 @@ importers: ui/apps/app: specifiers: '@ctx-core/combinators': ^6.0.10 - '@ctx-core/object': ^17.5.11 - '@ctx-core/store': ^24.5.6 + '@ctx-core/object': ^17.5.13 + '@ctx-core/store': ^24.5.8 '@holochain/conductor-api': 0.0.3 '@rollup/plugin-commonjs': ^18.0.0 '@rollup/plugin-node-resolve': ^11.2.1 '@rollup/plugin-replace': ^2.4.2 - '@rollup/plugin-typescript': ^6.1.0 + '@rollup/plugin-typescript': ^8.2.1 '@syn-ui/model': workspace:^1.0.0 '@syn-ui/zome-client': workspace:^1.0.0 '@tsconfig/svelte': ^1.0.10 @@ -79,19 +79,19 @@ importers: svelte-fa: ^2.2.0 svelte-preprocess: ^4.7.2 tslib: ^2.2.0 - typescript: ^3.9.9 + typescript: ^4.2.4 dependencies: '@ctx-core/combinators': 6.0.10 '@holochain/conductor-api': 0.0.3 sirv-cli: 1.0.11 svelte-fa: 2.2.0 devDependencies: - '@ctx-core/object': 17.5.11 - '@ctx-core/store': 24.5.6 + '@ctx-core/object': 17.5.13 + '@ctx-core/store': 24.5.8 '@rollup/plugin-commonjs': 18.0.0_rollup@2.45.2 '@rollup/plugin-node-resolve': 11.2.1_rollup@2.45.2 '@rollup/plugin-replace': 2.4.2_rollup@2.45.2 - '@rollup/plugin-typescript': 6.1.0_94bd13ed9056efdf75c69b35fe3b3146 + '@rollup/plugin-typescript': 8.2.1_d21869dc49fccc93d6599238c3a50ee6 '@syn-ui/model': link:../../libs/model '@syn-ui/zome-client': link:../../libs/zome-client '@tsconfig/svelte': 1.0.10 @@ -104,15 +104,15 @@ importers: rollup-plugin-terser: 7.0.2_rollup@2.45.2 svelte: 3.37.0 svelte-check: 1.5.2_svelte@3.37.0 - svelte-preprocess: 4.7.2_svelte@3.37.0+typescript@3.9.9 + svelte-preprocess: 4.7.2_svelte@3.37.0+typescript@4.2.4 tslib: 2.2.0 - typescript: 3.9.9 + typescript: 4.2.4 ui/apps/headless: specifiers: '@ctx-core/combinators': ^6.0.10 - '@ctx-core/object': ^17.5.11 - '@ctx-core/store': ^24.5.6 + '@ctx-core/object': ^17.5.13 + '@ctx-core/store': ^24.5.8 '@holochain/conductor-api': 0.0.3 '@rollup/plugin-commonjs': ^18.0.0 '@rollup/plugin-node-resolve': ^11.2.1 @@ -134,8 +134,8 @@ importers: sirv-cli: 1.0.11 svelte-fa: 2.2.0 devDependencies: - '@ctx-core/object': 17.5.11 - '@ctx-core/store': 24.5.6 + '@ctx-core/object': 17.5.13 + '@ctx-core/store': 24.5.8 '@rollup/plugin-commonjs': 18.0.0_rollup@2.45.2 '@rollup/plugin-node-resolve': 11.2.1_rollup@2.45.2 '@rollup/plugin-replace': 2.4.2_rollup@2.45.2 @@ -152,8 +152,8 @@ importers: ui/libs/model: specifiers: '@ctx-core/combinators': ^6.0.10 - '@ctx-core/object': ^17.5.11 - '@ctx-core/store': ^24.5.6 + '@ctx-core/object': ^17.5.13 + '@ctx-core/store': ^24.5.8 '@holochain/conductor-api': 0.0.3 '@syn-ui/utils': workspace:^1.0.0 '@syn-ui/zome-client': workspace:^1.0.0 @@ -161,8 +161,8 @@ importers: typescript: ^4.2.4 devDependencies: '@ctx-core/combinators': 6.0.10 - '@ctx-core/object': 17.5.11 - '@ctx-core/store': 24.5.6 + '@ctx-core/object': 17.5.13 + '@ctx-core/store': 24.5.8 '@holochain/conductor-api': 0.0.3 '@syn-ui/utils': link:../utils '@syn-ui/zome-client': link:../zome-client @@ -177,17 +177,17 @@ importers: ui/libs/zome-client: specifiers: - '@ctx-core/function': ^17.4.7 - '@ctx-core/object': ^17.5.11 - '@ctx-core/store': ^24.5.6 + '@ctx-core/function': ^17.4.8 + '@ctx-core/object': ^17.5.13 + '@ctx-core/store': ^24.5.8 '@holochain/conductor-api': ^0.0.3 '@syn-ui/utils': workspace:^1.0.0 buffer: ^6.0.3 typescript: ^4.2.4 devDependencies: - '@ctx-core/function': 17.4.7 - '@ctx-core/object': 17.5.11 - '@ctx-core/store': 24.5.6 + '@ctx-core/function': 17.4.8 + '@ctx-core/object': 17.5.13 + '@ctx-core/store': 24.5.8 '@holochain/conductor-api': 0.0.3 '@syn-ui/utils': link:../utils buffer: 6.0.3 @@ -397,55 +397,55 @@ packages: prettier: 1.19.1 dev: true - /@ctx-core/array/20.2.13: - resolution: {integrity: sha512-BQObHyviZh1/8AxmcxjOfG1WyDGy7I3o/Yr30IzWkNS7ktAHioi3YUS/TyDwtDb6Mb5TiPGBAd5ANnf9TvE7LA==} + /@ctx-core/array/20.2.15: + resolution: {integrity: sha512-5O3LUlAdPYmhGMNNRYCexV9EvCQJg0qbVTUos1zsz9XjnLe4as50nRiyd/eXwovtsA4Qo7cNgvFVNxFgmlonfQ==} dependencies: '@ctx-core/combinators': 6.0.10 - '@ctx-core/function': 17.4.7 - '@ctx-core/object': 17.5.11 - '@ctx-core/set': 9.0.18 + '@ctx-core/function': 17.4.8 + '@ctx-core/object': 17.5.13 + '@ctx-core/set': 9.0.20 dev: true - /@ctx-core/cli-args/7.2.23: - resolution: {integrity: sha512-5qjmwEOnAchoarvZmFwZUkM+ZR/93s1o1oNx7T6iHW77/SAbfEfNsEg9tzFFidBUgXPVWEuSXO4kabs1eFLp+Q==} + /@ctx-core/cli-args/7.2.25: + resolution: {integrity: sha512-B7k/aybFB88hKmjfZ3d2es5sDfFtqLOVEW1e5DaPdJfOc4s1/9K07TRT7Cxuac5NwlZUguA+OEyQXG+bbRttwA==} dependencies: - '@ctx-core/array': 20.2.13 - '@ctx-core/function': 17.4.7 - '@ctx-core/object': 17.5.11 + '@ctx-core/array': 20.2.15 + '@ctx-core/function': 17.4.8 + '@ctx-core/object': 17.5.13 dev: true /@ctx-core/combinators/6.0.10: resolution: {integrity: sha512-l16FC/IsyfTOffJkRq5kZSgfnjNa8Wz7m0HpyGQu6//fcePpOvFL+HuQvXgnsMREF6DiayW03QXdStk1kCDBjw==} - /@ctx-core/ctx-core-package-tools/6.0.47: - resolution: {integrity: sha512-fEHIFI28aP1bHrFEeECqCNS3ZlR21cQNxq9Z8H/OkL57ooPsWRBlQQwziJCnFyAMl5fn42frksVTnW35QwXUuQ==} + /@ctx-core/ctx-core-package-tools/6.0.48: + resolution: {integrity: sha512-VtQKqt1SHoTBtNSBjJZyO9V0hQjvd6NN5mBpzBdoADNcyEJ6UMKGKsHfV6M2Sr2FbUM+bV2saicMJ3hzCKWWwQ==} hasBin: true dependencies: - '@ctx-core/array': 20.2.13 + '@ctx-core/array': 20.2.15 dev: true - /@ctx-core/function/17.4.7: - resolution: {integrity: sha512-ZDASKCKnyp5/TSejfetvibyuvjdt6Dhe/JbPcvF2Hm7p+EHhTSPdNyE3EdaTZarWs63AoBllJAxsTgdhL+vs9g==} + /@ctx-core/function/17.4.8: + resolution: {integrity: sha512-XEtd8ko5HlzZDMYNPRLRMIldLKWPMSRLmqGRxlYxtQvYDiwDobtOPxCyhzeDR7nlxSGBVBWI/7tMwhegnttUUw==} dev: true - /@ctx-core/jetbrains/4.0.33: - resolution: {integrity: sha512-5o0fnCLUl0gLqEqDM6NAokqOuO7kZo+Juv8qQP7cocVdEPS5/Dslk9wG1SLbpESwcCAr/Uam9VRkeQRTJlKMKg==} + /@ctx-core/jetbrains/4.0.34: + resolution: {integrity: sha512-4wGPtDyY8sEeR3uh01thHA4DdCIexqvCBD5SJPWlPYeA2qrj/BAzd7JNuAZRrouJCkWthf5W1kUxArAQkgsNXQ==} hasBin: true dependencies: - '@ctx-core/cli-args': 7.2.23 + '@ctx-core/cli-args': 7.2.25 '@ctx-core/queue': 3.0.10 esm: 3.2.25 globby: 11.0.3 dev: true - /@ctx-core/monorepo/15.0.54: - resolution: {integrity: sha512-fMeLRv5B9rfCjsOA5j5y72CY7Vtm+pVm5clp6xWJxV/XwNLPIXQRkgibznaqBQBdEa0yGKKVX2puI70aedcx0Q==} + /@ctx-core/monorepo/15.0.55: + resolution: {integrity: sha512-mJxvMK4JerYPqzRIgItdmwbWbT9FIGI7Z7Ct7msIKGNwm+I0YKe3h3KwH7Ay4AorFHe/hM5AH92c7/MtFfpELQ==} hasBin: true dependencies: - '@ctx-core/array': 20.2.13 - '@ctx-core/cli-args': 7.2.23 - '@ctx-core/ctx-core-package-tools': 6.0.47 - '@ctx-core/package': 6.1.20 + '@ctx-core/array': 20.2.15 + '@ctx-core/cli-args': 7.2.25 + '@ctx-core/ctx-core-package-tools': 6.0.48 + '@ctx-core/package': 6.1.21 '@ctx-core/queue': 3.0.10 detect-indent: 6.0.0 esm: 3.2.25 @@ -454,17 +454,17 @@ packages: semver: 7.3.5 dev: true - /@ctx-core/object/17.5.11: - resolution: {integrity: sha512-j8BHbufH6GFz+8uogeZUptB4/0o2AUWi66SOa1ixFV1/rpMoSLOQqbXheiRJRAWHuonQjhvMjbRbVM0aaR4yvw==} + /@ctx-core/object/17.5.13: + resolution: {integrity: sha512-FUeqxZAj/XKH3m2cr/YZv21PJFyMebEWoUddYXQLk6vgEe8pL7BgXqE3gHSwu3SN/V70LkRI9XquqtEwNvkuSw==} dependencies: - '@ctx-core/function': 17.4.7 + '@ctx-core/function': 17.4.8 dev: true - /@ctx-core/package/6.1.20: - resolution: {integrity: sha512-dSdBXWBo9eT9Q3v74Q6wyVawKFwC6S+7pOdpI/ctPKwDqcuP28thI3cWD4O3Iafk4/HVsDDON3Sgse28KbJ2jg==} + /@ctx-core/package/6.1.21: + resolution: {integrity: sha512-1LAU/w/BEA+Og4nMNNZqL8DULgFUUHYdFn8xkKsiD6XE2tqBmjpeI8NliBz2a5rP9VGRReix0q1vjanCc4lY/g==} hasBin: true dependencies: - '@ctx-core/cli-args': 7.2.23 + '@ctx-core/cli-args': 7.2.25 esm: 3.2.25 resolve: 1.20.0 dev: true @@ -482,19 +482,19 @@ packages: resolution: {integrity: sha512-SUX8v4klI5/Xy4LeQ87V5h1WfK8k15YvFvsTw74fLYWYEaquy3nYnuduRsAY8L58xZ0uY/OQ++XHTiyIUCX9aA==} dev: true - /@ctx-core/set/9.0.18: - resolution: {integrity: sha512-RPT1HCPrBR/sGyisv1QN3Bc7/XbTTCKHVvpSvkR9OthPB1AHIyDpUx/vEjnJqojZ0Q0sr3GltuqQl0XAkUhO5g==} + /@ctx-core/set/9.0.20: + resolution: {integrity: sha512-eeXGmjWuJRHvypqHpNaKQWBKsx9b/dWSkfAHePgFNeVzmW5k1e3zd8g+suJPENpFcFHhbUizoqqRVwnVcTWwBw==} dependencies: - '@ctx-core/function': 17.4.7 + '@ctx-core/function': 17.4.8 dev: true - /@ctx-core/store/24.5.6: - resolution: {integrity: sha512-6e19x2i4xUVcQaEdjoUe85h6GNgZGESGQEmdJZzqeYJZO7M5w/GktcOEpNAac70c3n/y56nD0uKErDYt1ME41A==} + /@ctx-core/store/24.5.8: + resolution: {integrity: sha512-rTUxxR5DLymZPUaX+RXnWeXUCCown1WVhrCEMC8WWTRAoH08Avc25S5ovIWLxHODrzftcow8ou/REWo3r75fEQ==} dependencies: - '@ctx-core/array': 20.2.13 + '@ctx-core/array': 20.2.15 '@ctx-core/combinators': 6.0.10 - '@ctx-core/function': 17.4.7 - '@ctx-core/object': 17.5.11 + '@ctx-core/function': 17.4.8 + '@ctx-core/object': 17.5.13 svelte: 3.37.0 dev: true @@ -652,19 +652,19 @@ packages: rollup: 2.45.2 dev: true - /@rollup/plugin-typescript/6.1.0_94bd13ed9056efdf75c69b35fe3b3146: - resolution: {integrity: sha512-hJxaiE6WyNOsK+fZpbFh9CUijZYqPQuAOWO5khaGTUkM8DYNNyA2TDlgamecE+qLOG1G1+CwbWMAx3rbqpp6xQ==} + /@rollup/plugin-typescript/8.2.1_d21869dc49fccc93d6599238c3a50ee6: + resolution: {integrity: sha512-Qd2E1pleDR4bwyFxqbjt4eJf+wB0UKVMLc7/BAFDGVdAXQMCsD4DUv5/7/ww47BZCYxWtJqe1Lo0KVNswBJlRw==} engines: {node: '>=8.0.0'} peerDependencies: rollup: ^2.14.0 tslib: '*' - typescript: '>=3.4.0' + typescript: '>=3.7.0' dependencies: '@rollup/pluginutils': 3.1.0_rollup@2.45.2 resolve: 1.20.0 rollup: 2.45.2 tslib: 2.2.0 - typescript: 3.9.9 + typescript: 4.2.4 dev: true /@rollup/plugin-typescript/8.2.1_rollup@2.45.2+typescript@4.2.4: @@ -2456,8 +2456,8 @@ packages: find-up: 4.1.0 dev: true - /pnpm/6.2.1: - resolution: {integrity: sha512-aSrlGL3703pXhMaxFpFLAFakvpla0PaGN2/zOh5oG2qbvJ+jKuGkpHPhpLyAnhs/z+Je3wBaYA7vETu1f1xwqQ==} + /pnpm/6.2.3: + resolution: {integrity: sha512-qYRrxYyN14tqeMGu7E3P+INXDiYbGojn5mitVfUxidO9OsSnTGSqT85nkslfKW8YfChlzFVN0XdG+1Tj86tKhA==} engines: {node: '>=12.17'} hasBin: true dev: true @@ -3024,8 +3024,8 @@ packages: minimist: 1.2.5 source-map: 0.7.3 svelte: 3.37.0 - svelte-preprocess: 4.7.2_svelte@3.37.0+typescript@3.9.9 - typescript: 3.9.9 + svelte-preprocess: 4.7.2_svelte@3.37.0+typescript@4.2.4 + typescript: 4.2.4 transitivePeerDependencies: - '@babel/core' - coffeescript @@ -3043,55 +3043,6 @@ packages: resolution: {integrity: sha512-PN1H8AWDh+OwhwjJKTv4/zXvKvmvOEVSCVhIhji6Onx8XEw+CGf8BDR0BVUIp87IEX+DEqIo9pbyhgz8EoYZyA==} dev: false - /svelte-preprocess/4.7.2_svelte@3.37.0+typescript@3.9.9: - resolution: {integrity: sha512-EToG+08rEsA33btv+C5g2qnRArwpTc5AoU0QBB3ZEkYagxAb2yPNsy0qsmtvbJOTBMy6o3oyijDdl3DMpMvpEg==} - engines: {node: '>= 9.11.2'} - requiresBuild: true - peerDependencies: - '@babel/core': ^7.10.2 - coffeescript: ^2.5.1 - less: ^3.11.3 - node-sass: '*' - postcss: ^7 || ^8 - postcss-load-config: ^2.1.0 || ^3.0.0 - pug: ^3.0.0 - sass: ^1.26.8 - stylus: ^0.54.7 - sugarss: ^2.0.0 - svelte: ^3.23.0 - typescript: ^3.9.5 || ^4.0.0 - peerDependenciesMeta: - '@babel/core': - optional: true - coffeescript: - optional: true - less: - optional: true - node-sass: - optional: true - postcss: - optional: true - postcss-load-config: - optional: true - pug: - optional: true - sass: - optional: true - stylus: - optional: true - sugarss: - optional: true - typescript: - optional: true - dependencies: - '@types/pug': 2.0.4 - '@types/sass': 1.16.0 - detect-indent: 6.0.0 - strip-indent: 3.0.0 - svelte: 3.37.0 - typescript: 3.9.9 - dev: true - /svelte-preprocess/4.7.2_svelte@3.37.0+typescript@4.2.4: resolution: {integrity: sha512-EToG+08rEsA33btv+C5g2qnRArwpTc5AoU0QBB3ZEkYagxAb2yPNsy0qsmtvbJOTBMy6o3oyijDdl3DMpMvpEg==} engines: {node: '>= 9.11.2'} @@ -3299,12 +3250,6 @@ packages: resolution: {integrity: sha512-180WMDQaIMm3+7hGXWf12GtdniDEy7nYcyFMKJn/eZz/6tSLXrUN9V0wKSbMjej0I1WHWbpREDEKHtqPQa9NNw==} dev: true - /typescript/3.9.9: - resolution: {integrity: sha512-kdMjTiekY+z/ubJCATUPlRDl39vXYiMV9iyeMuEuXZh2we6zz80uovNN2WlAxmmdE/Z/YQe+EbOEXB5RHEED3w==} - engines: {node: '>=4.2.0'} - hasBin: true - dev: true - /typescript/4.2.4: resolution: {integrity: sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==} engines: {node: '>=4.2.0'} diff --git a/tests/syn-lib/index.ts b/tests/syn-lib/index.ts index ad2834d1..c2762b11 100644 --- a/tests/syn-lib/index.ts +++ b/tests/syn-lib/index.ts @@ -1,2 +1,2 @@ -require = require("esm")(module/*, options*/) -module.exports = require("./main") +export * from './main' +export * from './syn-lib' diff --git a/tests/syn-lib/main.ts b/tests/syn-lib/main.ts index 1c6c7266..c3ec8569 100644 --- a/tests/syn-lib/main.ts +++ b/tests/syn-lib/main.ts @@ -2,7 +2,7 @@ import { Orchestrator } from '@holochain/tryorama' const orchestrator = new Orchestrator() -import {oFn} from './syn-lib' +import { oFn } from './syn-lib' -oFn(orchestrator); +oFn(orchestrator) orchestrator.run() diff --git a/tests/syn-lib/syn-lib.ts b/tests/syn-lib/syn-lib.ts index f369e8ce..e0c46b09 100644 --- a/tests/syn-lib/syn-lib.ts +++ b/tests/syn-lib/syn-lib.ts @@ -1,6 +1,6 @@ import path from 'path' import { Config, InstallAgentsHapps } from '@holochain/tryorama' -import { Content, me_b } from '@syn-ui/zome-client' +import { Content, me_b, PubKeyToFolkRecord } from '@syn-ui/zome-client' import { folks_b, join_session, scribe_str_b } from '@syn-ui/model' import { delay } from '../common' @@ -24,7 +24,7 @@ process.on('unhandledRejection', error=>{ // json so setting this variable to true const jsonDeltas = true export const oFn = (orchestrator)=>{ - const default_content:Content = { title: '', body: '' } + const default_content:Content = { title: '', body: '', meta: {} } /* orchestrator.registerScenario('syn connect', async (s, t) => { const [me_player] = await s.players([config]) const [[me_happ]] = await me_player.installAgentsHapps(installation) @@ -48,22 +48,25 @@ export const oFn = (orchestrator)=>{ const appPort1:number = player1._conductor.app_ws.client.socket._url.split(':')[2] const appPort2:number = player2._conductor.app_ws.client.socket._url.split(':')[2] const c1 = join_session({ - app_port: appPort1, app_id: syn1.hAppId, apply_delta_fn: applyDeltas + app_port: appPort1, app_id: syn1.hAppId, }) // const c1 = new Connection({}, appPort1, syn1.hAppId) // await c1.open(default_content, applyDeltas) // await c1.joinSession() const c2 = join_session({ - app_port: appPort2, app_id: syn2.hAppId, apply_delta_fn: applyDeltas + app_port: appPort2, app_id: syn2.hAppId, }) // const c2 = new Connection({}, appPort2, syn2.hAppId) // await c2.open(default_content, applyDeltas) // await c2.joinSession() - t.equal(me_b(c1).$, scribe_str_b(c2).$) + const c1_me = me_b(c1) + t.equal(c1_me.$, scribe_str_b(c2).$) + const c2_folks = folks_b(c2) while (true) { - const others = Object.keys(folks_b(c2).$) + const $c2_folks = c2_folks.$ as PubKeyToFolkRecord + const others = Object.keys($c2_folks) if (others.length > 0) { - t.equal(folks_b(c2).$[others[0]].pubKey.toString('base64'), me_b(c1).$) + t.equal($c2_folks[others[0]].pubKey.toString('base64'), c1_me.$) break } else { await delay(1000) @@ -71,23 +74,3 @@ export const oFn = (orchestrator)=>{ } }) } - -const applyDeltas = (content, deltas)=>{ - for (const delta of deltas) { - switch (delta.type) { - case 'Title': - content.title = delta.value - break - case 'Add': - const [loc, text] = delta.value - content.body = content.body.slice(0, loc) + text + content.body.slice(loc) - break - case 'Delete': - const [start, end] = delta.value - content.body = content.body.slice(0, start) + content.body.slice(end) - break - } - } - return content -} -export type applyDeltas_T = ()=>Content diff --git a/tests/unit-test/syn.ts b/tests/unit-test/syn.ts index 9a7a922d..ad7c6c6e 100644 --- a/tests/unit-test/syn.ts +++ b/tests/unit-test/syn.ts @@ -1,294 +1,282 @@ import { Config, InstallAgentsHapps } from '@holochain/tryorama' -import * as _ from 'lodash' +import { delay } from '@holochain/tryorama/lib/util' import path from 'path' import { Delta, Signal } from '@syn-ui/zome-client' -import { delay } from '@holochain/tryorama/lib/util' +import { content_b, run_apply_delta_b, session_info_b } from '@syn-ui/model' -const config = Config.gen(); +const config = Config.gen() const dna = path.join(__dirname, '../../syn.dna') console.log(dna) -const installation: InstallAgentsHapps = [ - // one agents - [[dna]], // contains 1 dna +const installation:InstallAgentsHapps = [ + // one agents + [[dna]], // contains 1 dna ] -process.on('unhandledRejection', error => { +process.on('unhandledRejection', error=>{ // Will print "unhandledRejection err is not defined" - console.log('unhandledRejection', error); -}); - - -module.exports = (orchestrator) => { - orchestrator.registerScenario('syn basic zome calls', async (s, t) => { - - // Delta representation could be JSON or not, for now we are using - // json so setting this variable to true - const jsonDeltas = true; - - const [me_player, alice_player, bob_player] = await s.players([config, config, config]) - const [[me_happ]] = await me_player.installAgentsHapps(installation) - const [[alice_happ]] = await alice_player.installAgentsHapps(installation) - const [[bob_happ]] = await bob_player.installAgentsHapps(installation) - - await s.shareAllNodes([me_player, alice_player, bob_player]); - - const me = me_happ.cells[0] - const alice = alice_happ.cells[0] - const bob = bob_happ.cells[0] - - const me_pubkey = me.cell_id[1] - const alice_pubkey = alice.cell_id[1] - const bob_pubkey = bob.cell_id[1] - - let sessions = await me.call('syn', 'get_sessions') - t.equal(sessions.length, 0) - - // create initial session - let sessionInfo = await me.call('syn', 'new_session', {content: {title:"", body:""}}) - // I created the session, so I should be the scribe - t.deepEqual(sessionInfo.scribe, me_pubkey) - // First ever session so content should be default content - t.deepEqual(sessionInfo.snapshot_content, {title:"", body:""}) - let sessionHash = sessionInfo.session; - - // check the hash_content zome call. - let hash = await me.call('syn', 'hash_content', sessionInfo.snapshot_content) - t.deepEqual(sessionInfo.content_hash, hash) - - // check get_sessions utility zome call - sessions = await me.call('syn', 'get_sessions') - t.equal(sessions.length, 1) - t.deepEqual(sessions[0],sessionHash) - - // exercise the get_session zome call - const returnedSessionInfo = await me.call('syn', 'get_session', sessionHash) - t.equal(sessions.length, 1) - t.deepEqual(sessionInfo, returnedSessionInfo) - - // check that initial snapshot was created by using the get_content zome call - const returned_content = await me.call('syn', 'get_content', sessionInfo.content_hash) - t.deepEqual(returned_content, sessionInfo.snapshot_content) - - // set up the pending deltas array - let pendingDeltas = [{type:"Title",value: "foo title"}, {type:"Add", value:[0,"bar content"]}] - - let new_content = applyDeltas(sessionInfo.snapshot_content, pendingDeltas) - const new_content_hash_1 = await me.call('syn', 'hash_content', new_content) - - let deltas = jsonDeltas ? pendingDeltas.map(d=>JSON.stringify(d)) : pendingDeltas; - - // set signal handlers so we can confirm they get sent and received appropriately - let me_signals : Signal[] = [] - me_player.setSignalHandler((signal) => { - console.log("Received Signal for me:",signal) - me_signals.push(signal.data.payload) - }) - - // alice signal handler - let alice_signals : Signal[] = [] - alice_player.setSignalHandler((signal) => { - console.log("Received Signal for alice:",signal) - alice_signals.push(signal.data.payload) - }) - - // bob signal handler - let bob_signals : Signal[] = [] - bob_player.setSignalHandler((signal) => { - console.log("Received Signal for bob:",signal) - bob_signals.push(signal.data.payload) - }) - - // add a content change - let commit = { - snapshot: sessionInfo.content_hash, - change: { - deltas, - content_hash: new_content_hash_1, - previous_change: sessionInfo.content_hash, // this is the first change so same hash as snapshot - meta: { - contributors: [], - witnesses: [], - app_specific: null - } - }, - participants: [] - } - let commit_header_hash = await me.call('syn', 'commit', commit) - t.equal(commit_header_hash.length, 39) // is a hash - - // add a second content change - pendingDeltas = [ - {type:"Delete", value:[0,3]}, - {type:"Add", value:[0,"baz"]}, - {type:"Add", value:[11," new"]}, // 'baz content new' - {type:"Delete", value:[4,11]}, // 'baz new' - {type:"Add", value:[4,"monkey"]}, // 'baz monkey new' - ] - new_content = applyDeltas(new_content, pendingDeltas) - const new_content_hash_2 = await me.call('syn', 'hash_content', new_content) - - deltas = jsonDeltas ? pendingDeltas.map(d=>JSON.stringify(d)) : pendingDeltas; - commit = { - snapshot: sessionInfo.content_hash, - change: { - deltas, - content_hash: new_content_hash_2, - previous_change: new_content_hash_1, // this is the second change so previous commit's hash - meta: { - contributors: [], - witnesses: [], - app_specific: null - } - }, - participants: [] + console.log('unhandledRejection', error) +}) + +module.exports = (orchestrator)=>{ + orchestrator.registerScenario('syn basic zome calls', async (s, t)=>{ + + // Delta representation could be JSON or not, for now we are using + // json so setting this variable to true + const jsonDeltas = true + + const [me_player, alice_player, bob_player] = await s.players([config, config, config]) + const [[me_happ]] = await me_player.installAgentsHapps(installation) + const [[alice_happ]] = await alice_player.installAgentsHapps(installation) + const [[bob_happ]] = await bob_player.installAgentsHapps(installation) + const me_ctx = {}, alice_ctx = {}, bob_ctx = {} + + await s.shareAllNodes([me_player, alice_player, bob_player]) + + const me = me_happ.cells[0] + const alice = alice_happ.cells[0] + const bob = bob_happ.cells[0] + + const me_pubkey = me.cellId[1] + const alice_pubkey = alice.cellId[1] + const bob_pubkey = bob.cellId[1] + + let sessions = await me.call('syn', 'get_sessions') + t.equal(sessions.length, 0) + + // create initial session + const $session_info = await me.call('syn', 'new_session', { content: { title: '', body: '' } }) + const session_info = session_info_b(me_ctx) + session_info.$ = $session_info + // I created the session, so I should be the scribe + t.deepEqual($session_info.scribe, me_pubkey) + // First ever session so content should be default content + t.deepEqual($session_info.snapshot_content, { title: '', body: '' }) + let sessionHash = $session_info.session + + // check the hash_content zome call. + let hash = await me.call('syn', 'hash_content', $session_info.snapshot_content) + t.deepEqual($session_info.content_hash, hash) + + // check get_sessions utility zome call + sessions = await me.call('syn', 'get_sessions') + t.equal(sessions.length, 1) + t.deepEqual(sessions[0], sessionHash) + + // exercise the get_session zome call + const returnedSessionInfo = await me.call('syn', 'get_session', sessionHash) + t.equal(sessions.length, 1) + t.deepEqual($session_info, returnedSessionInfo) + + // check that initial snapshot was created by using the get_content zome call + const returned_content = await me.call('syn', 'get_content', $session_info.content_hash) + t.deepEqual(returned_content, $session_info.snapshot_content) + + // set up the pending deltas array + let pending_deltas:Delta[] = [{ type: 'Title', value: 'foo title' }, { type: 'Add', value: [0, 'bar content'] }] + + apply_deltas(me_ctx, pending_deltas) + const me_content = content_b(me_ctx) + const new_content_hash_1 = await me.call('syn', 'hash_content', me_content.$) + + let deltas = jsonDeltas ? pending_deltas.map(d=>JSON.stringify(d)) : pending_deltas + + // set signal handlers so we can confirm they get sent and received appropriately + let me_signals:Signal[] = [] + me_player.setSignalHandler((signal)=>{ + console.log('Received Signal for me:', signal) + me_signals.push(signal.data.payload) + }) + + // alice signal handler + let alice_signals:Signal[] = [] + alice_player.setSignalHandler((signal)=>{ + console.log('Received Signal for alice:', signal) + alice_signals.push(signal.data.payload) + }) + + // bob signal handler + let bob_signals:Signal[] = [] + bob_player.setSignalHandler((signal)=>{ + console.log('Received Signal for bob:', signal) + bob_signals.push(signal.data.payload) + }) + + // add a content change + let commit = { + snapshot: $session_info.content_hash, + change: { + deltas, + content_hash: new_content_hash_1, + previous_change: $session_info.content_hash, // this is the first change so same hash as snapshot + meta: { + contributors: [], + witnesses: [], + app_specific: null } - commit_header_hash = await me.call('syn', 'commit', commit) - // clear the pendingDeltas - pendingDeltas = [] - - // alice joins session - const aliceSessionInfo = await alice.call('syn', 'get_session', sessionHash) - // alice should get my session - t.deepEqual(aliceSessionInfo.session, sessionHash) - t.deepEqual(aliceSessionInfo.scribe, me_pubkey) - t.deepEqual(aliceSessionInfo.snapshot_content, {title:'', body:''}) - await alice.call('syn', 'send_sync_request', {scribe: me_pubkey }) - - // check that deltas and snapshot content returned add up to the current real content - await delay(500) // make time for integrating new data - const receivedDeltas = jsonDeltas ? aliceSessionInfo.deltas.map(d=>JSON.parse(d)) : aliceSessionInfo.deltas; - t.deepEqual( - applyDeltas(aliceSessionInfo.snapshot_content, receivedDeltas), - {title: "foo title", body: "baz monkey new"} // content after two commits - ) - - // confirm that the session_info's content hash matches the content_hash - // generated by applying deltas - hash = await alice.call('syn', 'hash_content', aliceSessionInfo.snapshot_content) - t.deepEqual(aliceSessionInfo.content_hash, hash) - - // I should receive alice's request for the state as she joins the session - t.deepEqual(me_signals[0], {signal_name: "SyncReq", signal_payload: alice_pubkey}) - - // I add some pending deltas which I will then need to send to Alice as part of her Joining. - pendingDeltas = [{type:"Title",value: "I haven't committed yet"},{type:"Add", value:[14,"\nBut made a new line! 🍑"]}] - - deltas = jsonDeltas ? pendingDeltas.map(d=>JSON.stringify(d)) : pendingDeltas; - - const state = { - snapshot: sessionInfo.content_hash, - commit: commit_header_hash, - commit_content_hash: new_content_hash_2, - deltas: deltas, + }, + participants: [] + } + let commit_header_hash = await me.call('syn', 'commit', commit) + t.equal(commit_header_hash.length, 39) // is a hash + + // add a second content change + pending_deltas = [ + { type: 'Delete', value: [0, 3] }, + { type: 'Add', value: [0, 'baz'] }, + { type: 'Add', value: [11, ' new'] }, // 'baz content new' + { type: 'Delete', value: [4, 11] }, // 'baz new' + { type: 'Add', value: [4, 'monkey'] }, // 'baz monkey new' + ] + apply_deltas(me_ctx, pending_deltas) + const new_content_hash_2 = await me.call('syn', 'hash_content', me_content.$) + + deltas = jsonDeltas ? pending_deltas.map(d=>JSON.stringify(d)) : pending_deltas + commit = { + snapshot: $session_info.content_hash, + change: { + deltas, + content_hash: new_content_hash_2, + previous_change: new_content_hash_1, // this is the second change so previous commit's hash + meta: { + contributors: [], + witnesses: [], + app_specific: null } - await me.call('syn', 'send_sync_response', { - participant: alice_pubkey, - state, - }) - - // Alice should have recieved uncommitted deltas - await delay(500) // make time for signal to arrive - t.equal(alice_signals[0].signal_name, "SyncResp") - let receivedState = alice_signals[0].signal_payload; - t.deepEqual(receivedState, state) // deltas, commit, and snapshot match - - // bob joins session - const bobSessionInfo = await alice.call('syn', 'get_session', sessionHash) - // bob should get my session - t.deepEqual(bobSessionInfo.scribe, me_pubkey) - await bob.call('syn', 'send_sync_request', {scribe: me_pubkey }) - - // alice sends me a change req and I should receive it - const alice_delta: Delta = {type: "Title", value: "Alice in Wonderland"} - let delta = jsonDeltas ? JSON.stringify(alice_delta) : alice_delta; - await alice.call('syn', 'send_change_request', { - scribe: aliceSessionInfo.scribe, - change: [1, [delta]]}) - await delay(500) // make time for signal to arrive - const sig = me_signals[2] - t.equal(sig.signal_name, "ChangeReq") - const [sig_index, sig_delta] = sig.signal_payload - t.equal(sig_index,1) - const receiveDelta = jsonDeltas ? JSON.parse(sig_delta) : sig_delta; - t.deepEqual(receiveDelta, alice_delta) // delta_matches - - - let my_deltas = [{type: "Add", value:[0, "Whoops!\n"]},{type: "Title", value: "Alice in Wonderland"}]; - deltas = jsonDeltas ? my_deltas.map(d=>JSON.stringify(d)) : deltas; - // I send a change, and alice and bob should receive it. - await me.call('syn', 'send_change', { - participants: [alice_pubkey, bob_pubkey], - change: [2, deltas]}) - await delay(500) // make time for signal to arrive - let a_sig = alice_signals[1] - let b_sig = bob_signals[0] - t.equal(a_sig.signal_name, "Change") - t.equal(b_sig.signal_name, "Change") - t.deepEqual(a_sig.signal_payload, [2, deltas]) // delta_matches - t.deepEqual(b_sig.signal_payload, [2, deltas]) // delta_matches - - - await alice.call('syn', 'send_heartbeat', { - scribe: me_pubkey, - data: "Hello"}) - await delay(500) // make time for signal to arrive - let me_sig = me_signals[3] - t.equal(me_sig.signal_name, "Heartbeat") - t.deepEqual(me_sig.signal_payload[1], "Hello") - t.deepEqual(me_sig.signal_payload[0], alice_pubkey) - - await me.call('syn', 'send_folk_lore', { - participants: [alice_pubkey, bob_pubkey], - data: "Alice said hello"}) - await delay(500) // make time for signal to arrive - - a_sig = alice_signals[2] - b_sig = bob_signals[1] - t.equal(a_sig.signal_name, "FolkLore") - t.equal(b_sig.signal_name, "FolkLore") - t.deepEqual(a_sig.signal_payload, "Alice said hello") - t.deepEqual(b_sig.signal_payload, "Alice said hello") - - // alice asks for a sync request - await alice.call('syn', 'send_sync_request', { - scribe: me_pubkey}) - await delay(500) // make time for signal to arrive - me_sig = me_signals[4] - t.equal(me_sig.signal_name, "SyncReq") - - // confirm that all agents got added to the folks anchor - // TODO figure out why init doesn't happen immediately. - let folks = await me.call('syn', 'get_folks') - t.equal(folks.length, 3) - + }, + participants: [] + } + commit_header_hash = await me.call('syn', 'commit', commit) + // clear the pending_deltas + pending_deltas = [] + + // alice joins session + const $alice_session_info = await alice.call('syn', 'get_session', sessionHash) + const alice_session_info = session_info_b(alice_ctx) + alice_session_info.$ = $alice_session_info + // alice should get my session + t.deepEqual($alice_session_info.session, sessionHash) + t.deepEqual($alice_session_info.scribe, me_pubkey) + t.deepEqual($alice_session_info.snapshot_content, { title: '', body: '' }) + await alice.call('syn', 'send_sync_request', { scribe: me_pubkey }) + + // check that deltas and snapshot content returned add up to the current real content + await delay(500) // make time for integrating new data + const received_deltas:Delta[] = jsonDeltas ? $alice_session_info.deltas.map(d=>JSON.parse(d)) : $alice_session_info.deltas + t.deepEqual( + apply_deltas(alice_ctx, received_deltas), + { title: 'foo title', body: 'baz monkey new' } // content after two commits + ) + + // confirm that the $session_info's content hash matches the content_hash + // generated by applying deltas + hash = await alice.call('syn', 'hash_content', $alice_session_info.snapshot_content) + t.deepEqual($alice_session_info.content_hash, hash) + + // I should receive alice's request for the state as she joins the session + t.deepEqual(me_signals[0], { signal_name: 'SyncReq', signal_payload: alice_pubkey }) + + // I add some pending deltas which I will then need to send to Alice as part of her Joining. + pending_deltas = [{ type: 'Title', value: 'I haven\'t committed yet' }, { type: 'Add', value: [14, '\nBut made a new line! 🍑'] }] + + deltas = jsonDeltas ? pending_deltas.map(d=>JSON.stringify(d)) : pending_deltas + + const state = { + snapshot: $session_info.content_hash, + commit: commit_header_hash, + commit_content_hash: new_content_hash_2, + deltas: deltas, + } + await me.call('syn', 'send_sync_response', { + participant: alice_pubkey, + state, }) -} -/* - Fake UI functions - - applyDeltas - - takes a content and a list of deltas - - returns the new content with those deltas applied -*/ - -const applyDeltas = (content, deltas) => { - for (const delta of deltas) { - switch(delta.type) { - case "Title": - content.title = delta.value - break - case "Add": - const [loc, text] = delta.value - content.body = content.body.slice(0, loc) + text + content.body.slice(loc) - break - case "Delete": - const [start, end] = delta.value - content.body = content.body.slice(0, start) + content.body.slice(end) - break + // Alice should have recieved uncommitted deltas + await delay(500) // make time for signal to arrive + t.equal(alice_signals[0].signal_name, 'SyncResp') + let receivedState = alice_signals[0].signal_payload + t.deepEqual(receivedState, state) // deltas, commit, and snapshot match + + // bob joins session + const bobSessionInfo = await alice.call('syn', 'get_session', sessionHash) + // bob should get my session + t.deepEqual(bobSessionInfo.scribe, me_pubkey) + await bob.call('syn', 'send_sync_request', { scribe: me_pubkey }) + + // alice sends me a change req and I should receive it + const alice_delta:Delta = { type: 'Title', value: 'Alice in Wonderland' } + let delta = jsonDeltas ? JSON.stringify(alice_delta) : alice_delta + await alice.call('syn', 'send_change_request', { + scribe: $alice_session_info.scribe, + change: [1, [delta]] + }) + await delay(500) // make time for signal to arrive + const sig = me_signals[2] + t.equal(sig.signal_name, 'ChangeReq') + const [sig_index, sig_delta] = sig.signal_payload + t.equal(sig_index, 1) + const receiveDelta = jsonDeltas ? JSON.parse(sig_delta) : sig_delta + t.deepEqual(receiveDelta, alice_delta) // delta_matches + + let my_deltas = [{ type: 'Add', value: [0, 'Whoops!\n'] }, { type: 'Title', value: 'Alice in Wonderland' }] + deltas = jsonDeltas ? my_deltas.map(d=>JSON.stringify(d)) : deltas + // I send a change, and alice and bob should receive it. + await me.call('syn', 'send_change', { + participants: [alice_pubkey, bob_pubkey], + change: [2, deltas] + }) + await delay(500) // make time for signal to arrive + let a_sig = alice_signals[1] + let b_sig = bob_signals[0] + t.equal(a_sig.signal_name, 'Change') + t.equal(b_sig.signal_name, 'Change') + t.deepEqual(a_sig.signal_payload, [2, deltas]) // delta_matches + t.deepEqual(b_sig.signal_payload, [2, deltas]) // delta_matches + + await alice.call('syn', 'send_heartbeat', { + scribe: me_pubkey, + data: 'Hello' + }) + await delay(500) // make time for signal to arrive + let me_sig = me_signals[3] + t.equal(me_sig.signal_name, 'Heartbeat') + t.deepEqual(me_sig.signal_payload[1], 'Hello') + t.deepEqual(me_sig.signal_payload[0], alice_pubkey) + + await me.call('syn', 'send_folk_lore', { + participants: [alice_pubkey, bob_pubkey], + data: 'Alice said hello' + }) + await delay(500) // make time for signal to arrive + + a_sig = alice_signals[2] + b_sig = bob_signals[1] + t.equal(a_sig.signal_name, 'FolkLore') + t.equal(b_sig.signal_name, 'FolkLore') + t.deepEqual(a_sig.signal_payload, 'Alice said hello') + t.deepEqual(b_sig.signal_payload, 'Alice said hello') + + // alice asks for a sync request + await alice.call('syn', 'send_sync_request', { + scribe: me_pubkey + }) + await delay(500) // make time for signal to arrive + me_sig = me_signals[4] + t.equal(me_sig.signal_name, 'SyncReq') + + // confirm that all agents got added to the folks anchor + // TODO figure out why init doesn't happen immediately. + let folks = await me.call('syn', 'get_folks') + t.equal(folks.length, 3) + + function apply_deltas(ctx:object, deltas:Delta[]) { + const run_apply_delta = run_apply_delta_b(ctx) + for (const delta of deltas) { + run_apply_delta(delta) + } } - } - return content + }) } diff --git a/ui/apps/app/package.json b/ui/apps/app/package.json index 2140bb5d..4f71ef77 100644 --- a/ui/apps/app/package.json +++ b/ui/apps/app/package.json @@ -14,12 +14,12 @@ "svelte-fa": "^2.2.0" }, "devDependencies": { - "@ctx-core/object": "^17.5.11", - "@ctx-core/store": "^24.5.6", + "@ctx-core/object": "^17.5.13", + "@ctx-core/store": "^24.5.8", "@rollup/plugin-commonjs": "^18.0.0", "@rollup/plugin-node-resolve": "^11.2.1", "@rollup/plugin-replace": "^2.4.2", - "@rollup/plugin-typescript": "^6.1.0", + "@rollup/plugin-typescript": "^8.2.1", "@syn-ui/model": "workspace:^1.0.0", "@syn-ui/zome-client": "workspace:^1.0.0", "@tsconfig/svelte": "^1.0.10", @@ -34,6 +34,6 @@ "svelte-check": "^1.5.2", "svelte-preprocess": "^4.7.2", "tslib": "^2.2.0", - "typescript": "^3.9.9" + "typescript": "^4.2.4" } -} +} \ No newline at end of file diff --git a/ui/apps/app/src/App.svelte b/ui/apps/app/src/App.svelte index 7281cdb4..91aa9072 100644 --- a/ui/apps/app/src/App.svelte +++ b/ui/apps/app/src/App.svelte @@ -1,6 +1,6 @@ <script lang="ts"> import { setContext } from 'svelte' - import { scribe_str_b } from '@syn-ui/model' + import { request_change_b, scribe_str_b } from '@syn-ui/model' import type { apply_delta_ret_T } from '@syn-ui/model' import type { AddDelta, Content, DeleteDelta, Delta, MetaDelta, TitleDelta } from '@syn-ui/zome-client' import Editor from './Editor.svelte' @@ -18,44 +18,11 @@ } setContext('ctx', ctx) + const request_change = request_change_b(ctx) const scribe_str = scribe_str_b(ctx) $: disconnected = false - // definition of how to apply a delta to the content - // if the delta is destructive also returns what was - // destroyed for use by undo - function applyDelta(content:Content, in_delta:Delta):apply_delta_ret_T { - switch (in_delta.type) { - case 'Title': { - const deleted = content.title - const delta = in_delta as TitleDelta - content.title = delta.value - return [content, { delta, deleted }] - } - case 'Add': { - const delta = in_delta as AddDelta - const [loc, text] = delta.value - content.body = content.body.slice(0, loc) + text + content.body.slice(loc) - return [content, { delta }] - } - case 'Delete': { - const delta = in_delta as DeleteDelta - const [start, end] = delta.value - const deleted = content.body.slice(start, end) - content.body = content.body.slice(0, start) + content.body.slice(end) - return [content, { delta, deleted }] - } - case 'Meta': { - const delta = in_delta as MetaDelta - const [tag, loc] = delta.value.setLoc - const deleted = [tag, content.meta[tag]] - content.meta[tag] = loc - return [content, { delta, deleted }] - } - } - } - // definition of how to undo a change, returns a delta that will undo the change function undo(change) { const delta = change.delta @@ -155,6 +122,44 @@ </script> +<svelte:head> + <script src='https://kit.fontawesome.com/80d72fa568.js' crossorigin='anonymous'></script> +</svelte:head> + +<div class='toolbar'> + <h1>SynText</h1> +<div class:noscribe> + <Title on:request_change={(event) => request_change(event.detail)}/> +</div> +</div> +<main> +<div class:noscribe> + <Editor on:request_change={(event) => request_change(event.detail)}/> +</div> + + +<Syn undoFn={undo} bind:this={syn}/> +</main> + +<div class='folks-tray'> + <Folks/> +</div> + +<div class='tab' class:shown={tabShown} class:drawer-hidden={drawerHidden} on:mouseenter={showTab} + on:mouseleave={hideTab}> + <div class='tab-inner' class:shown={tabShown} on:click={drawerHidden ? showDrawer() : hideDrawer()}> + <i class:drawer-hidden={drawerHidden} class="tab-icon fas {drawerHidden ? 'fa-chevron-up' : 'fa-chevron-down'}"></i> + </div> +</div> +<div class='debug-drawer' bind:this={resizeable} use:initResizeable on:mouseenter={showTab} on:mouseleave={hideTab} + class:hidden={drawerHidden}> + <div class='handle' bind:this={resizeHandle} on:mousedown={startDragging}></div> + <div class='debug-content'> + <History changeToTextFn={changeToText}/> + <Debug/> + </div> +</div> + <style global> main { padding: 1em; @@ -298,41 +303,4 @@ } } </style> - -<svelte:head> - <script src='https://kit.fontawesome.com/80d72fa568.js' crossorigin='anonymous'></script> -</svelte:head> - -<div class='toolbar'> - <h1>SynText</h1> -<div class:noscribe> - <Title on:request_change={(event) => syn.request_change(event.detail)}/> -</div> -</div> -<main> -<div class:noscribe> - <Editor on:request_change={(event) => syn.request_change(event.detail)}/> -</div> - - -<Syn apply_delta_fn={applyDelta} undoFn={undo} bind:this={syn}/> -</main> - -<div class='folks-tray'> - <Folks/> -</div> - -<div class='tab' class:shown={tabShown} class:drawer-hidden={drawerHidden} on:mouseenter={showTab} - on:mouseleave={hideTab}> - <div class='tab-inner' class:shown={tabShown} on:click={drawerHidden ? showDrawer() : hideDrawer()}> - <i class:drawer-hidden={drawerHidden} class="tab-icon fas {drawerHidden ? 'fa-chevron-up' : 'fa-chevron-down'}"></i> - </div> -</div> -<div class='debug-drawer' bind:this={resizeable} use:initResizeable on:mouseenter={showTab} on:mouseleave={hideTab} - class:hidden={drawerHidden}> - <div class='handle' bind:this={resizeHandle} on:mousedown={startDragging}></div> - <div class='debug-content'> - <History changeToTextFn={changeToText}/> - <Debug/> - </div> -</div> +u diff --git a/ui/apps/app/src/Editor.svelte b/ui/apps/app/src/Editor.svelte index 9b35f6a6..9f41bcba 100644 --- a/ui/apps/app/src/Editor.svelte +++ b/ui/apps/app/src/Editor.svelte @@ -15,16 +15,17 @@ return $content.meta ? ($content.meta[tag] ? $content.meta[tag] : 0) : 0 } - let editor - $: editor_content1 = $content.body.slice(0, getLoc($my_tag)) - $: editor_content2 = $content.body.slice(getLoc($my_tag)) + let editor:HTMLElement + let editor_content1:string, editor_content2:string + $: editor_content1 = $content?.body?.slice(0, getLoc($my_tag))||'' + $: editor_content2 = $content?.body?.slice(getLoc($my_tag))||'' function addText(text) { const loc = getLoc($my_tag) - const deltas:Delta[] = [{type:'Add', value:[loc, text]}] + const deltas:Delta[] = [{ type: 'Add', value: [loc, text] }] for (const [tag, tagLoc] of Object.entries($content.meta)) { if (tagLoc >= loc) { - deltas.push({type:'Meta', value: {setLoc: [tag,tagLoc+text.length] }}) + deltas.push({ type: 'Meta', value: { setLoc: [tag, tagLoc + text.length] } }) } } dispatch('request_change', deltas) @@ -37,33 +38,33 @@ addText(key) } else { switch (key) { - case 'ArrowRight': - if (loc < $content.body.length) { - dispatch('request_change', [ - {type:'Meta', value:{setLoc: [$my_tag, loc+1]}} - ]) - } - break - case 'ArrowLeft': - if (loc > 0){ - dispatch('request_change', [ - {type:'Meta', value:{setLoc: [$my_tag, loc-1]}} - ]) - } - break - case 'Enter': - addText('\n') - break - case 'Backspace': - if (loc>0) { - const deltas:Delta[] = [{type:'Delete', value:[loc-1, loc]}] - for (const [tag, tagLoc] of Object.entries($content.meta)) { - if (tagLoc >= loc) { - deltas.push({type:'Meta', value: {setLoc: [tag,tagLoc-1] }}) + case 'ArrowRight': + if (loc < $content.body.length) { + dispatch('request_change', [ + { type: 'Meta', value: { setLoc: [$my_tag, loc + 1] } } + ]) + } + break + case 'ArrowLeft': + if (loc > 0) { + dispatch('request_change', [ + { type: 'Meta', value: { setLoc: [$my_tag, loc - 1] } } + ]) + } + break + case 'Enter': + addText('\n') + break + case 'Backspace': + if (loc > 0) { + const deltas:Delta[] = [{ type: 'Delete', value: [loc - 1, loc] }] + for (const [tag, tagLoc] of Object.entries($content.meta)) { + if (tagLoc >= loc) { + deltas.push({ type: 'Meta', value: { setLoc: [tag, tagLoc - 1] } }) + } } + dispatch('request_change', deltas) } - dispatch('request_change', deltas) - } } } console.log('input', event.key) @@ -76,7 +77,7 @@ } if (loc != getLoc($my_tag)) { dispatch('request_change', [ - {type:'Meta', value:{setLoc: [$my_tag, loc]}} + { type: 'Meta', value: { setLoc: [$my_tag, loc] } } ]) } } diff --git a/ui/apps/app/src/Syn.svelte b/ui/apps/app/src/Syn.svelte index a81d3e43..c84b3099 100644 --- a/ui/apps/app/src/Syn.svelte +++ b/ui/apps/app/src/Syn.svelte @@ -12,7 +12,7 @@ const commit_change = commit_change_b(ctx) // this properties are the app-defined functions to apply and undo changes - export let apply_delta_fn, undoFn + export let undoFn // ----------------------------------------------------------------------- @@ -22,7 +22,7 @@ let app_port = 8888 let app_id = 'syn' async function toggle() { - await toggle_session({ app_port, app_id, apply_delta_fn, ctx }) + await toggle_session({ app_port, app_id, ctx }) if (!$session_info) { console.log('disconnected') } diff --git a/ui/apps/headless/package.json b/ui/apps/headless/package.json index 4bb3f213..5f9dbb92 100644 --- a/ui/apps/headless/package.json +++ b/ui/apps/headless/package.json @@ -13,8 +13,8 @@ "svelte-fa": "^2.2.0" }, "devDependencies": { - "@ctx-core/object": "^17.5.11", - "@ctx-core/store": "^24.5.6", + "@ctx-core/object": "^17.5.13", + "@ctx-core/store": "^24.5.8", "@rollup/plugin-commonjs": "^18.0.0", "@rollup/plugin-node-resolve": "^11.2.1", "@rollup/plugin-replace": "^2.4.2", diff --git a/ui/libs/model/package.json b/ui/libs/model/package.json index d5a16320..61193813 100644 --- a/ui/libs/model/package.json +++ b/ui/libs/model/package.json @@ -7,12 +7,12 @@ "scripts": {}, "devDependencies": { "@ctx-core/combinators": "^6.0.10", - "@ctx-core/object": "^17.5.11", - "@ctx-core/store": "^24.5.6", + "@ctx-core/object": "^17.5.13", + "@ctx-core/store": "^24.5.8", "@holochain/conductor-api": "0.0.3", "@syn-ui/utils": "workspace:^1.0.0", "@syn-ui/zome-client": "workspace:^1.0.0", "svelte": "^3.37.0", "typescript": "^4.2.4" } -} +} \ No newline at end of file diff --git a/ui/libs/model/src/actions/join_session.ts b/ui/libs/model/src/actions/join_session.ts index 2765ad80..586dc1fb 100644 --- a/ui/libs/model/src/actions/join_session.ts +++ b/ui/libs/model/src/actions/join_session.ts @@ -1,13 +1,10 @@ import type { AppSignal } from '@holochain/conductor-api' import { clone } from '@ctx-core/object' -import { I } from '@ctx-core/combinators' -import { subscribe_wait_timeout } from '@ctx-core/store' import { bufferToBase64 } from '@syn-ui/utils' import { app_id_b, app_port_b, app_ws_cb_b, me_b, rpc_get_session_b, rpc_new_session_b, rpc_send_sync_request_b, SessionInfo, } from '@syn-ui/zome-client' -import { apply_delta_fn_T, apply_delta_fn_b } from '../delta' import { am_i_scribe_b, session_info_b, sessions_b } from '../session' import { Change_SignalOps_b, ChangeReq_SignalOps_b, CommitNotice_SignalOps_b, @@ -29,17 +26,12 @@ export async function join_session(params:join_session_params_T) { SyncResp_SignalOps_b(ctx), ) const app_ws_cb = app_ws_cb_b(ctx) - // app_ws_cb.set($app_ws_cb) app_ws_cb.$ = $app_ws_cb const app_id = app_id_b(ctx) - // app_id.set(params.app_id) app_id.$ = params.app_id const app_port = app_port_b(ctx) app_port.$ = params.app_port - const $apply_delta_fn = params.apply_delta_fn - const apply_delta_fn = apply_delta_fn_b(ctx) - apply_delta_fn.$ = $apply_delta_fn - const $sessions = await subscribe_wait_timeout(sessions, I, 10_000) + const $sessions = await sessions.load() let $session_info:SessionInfo if ($sessions.length === 0) { const rpc_new_session = rpc_new_session_b(ctx) @@ -78,6 +70,5 @@ export async function join_session(params:join_session_params_T) { export interface join_session_params_T { app_port:number app_id:string - apply_delta_fn:apply_delta_fn_T ctx?:object } diff --git a/ui/libs/model/src/colors/arrayBufferToHex.ts b/ui/libs/model/src/colors/arrayBufferToHex.ts index e93674f2..8ebac0df 100644 --- a/ui/libs/model/src/colors/arrayBufferToHex.ts +++ b/ui/libs/model/src/colors/arrayBufferToHex.ts @@ -2,8 +2,8 @@ import type { HoloHash } from '@holochain/conductor-api' // returns binary input as hex number string (e.g. 'a293b8e1a') export function arrayBufferToHex(buffer:HoloHash) { let hexString = '' - for (const byte of buffer) { + buffer.forEach(byte=> hexString += byte.toString(16) - } + ) return hexString } diff --git a/ui/libs/model/src/colors/getFolkColors.ts b/ui/libs/model/src/colors/getFolkColors.ts index 8a987c8e..3501daa7 100644 --- a/ui/libs/model/src/colors/getFolkColors.ts +++ b/ui/libs/model/src/colors/getFolkColors.ts @@ -1,4 +1,4 @@ -import type { HoloHash } from '@holochain/conductor-api' +import type { AgentPubKey } from '@holochain/conductor-api' import type { FolkColors } from '@syn-ui/zome-client' import { arrayBufferToHex } from './arrayBufferToHex' import { rgbToHsl } from './rgbToHsl' @@ -12,7 +12,7 @@ import { clamp } from './clamp' // lookingCursor: Color, // used for cursor when "looking at" // where Color is array: [h, s, l] // used in `use:setColor` on new Folk components -export function getFolkColors(pubKey:HoloHash):FolkColors { +export function getFolkColors(pubKey:AgentPubKey):FolkColors { // get a hex color from the folk's public key const hexColor = '#' + arrayBufferToHex(pubKey).slice(-6) // extract the RGB components from the hex color notation. diff --git a/ui/libs/model/src/content/content_b.ts b/ui/libs/model/src/content/content_b.ts index 94849ccb..49d5fc14 100644 --- a/ui/libs/model/src/content/content_b.ts +++ b/ui/libs/model/src/content/content_b.ts @@ -2,5 +2,5 @@ import { _b } from '@ctx-core/object' import { writable$ } from '@ctx-core/store' import type { Content } from '@syn-ui/zome-client' export const content_b = _b('content', ()=>{ - return writable$<Content>({ title: '', body: '' }) + return writable$<Content>({ title: '', body: '', meta: {} }) }) diff --git a/ui/libs/model/src/delta/_scribe_signal_folk_pubKey_a1_b.ts b/ui/libs/model/src/delta/_scribe_signal_folk_pubKey_a1_b.ts index 73f70bf2..09334938 100644 --- a/ui/libs/model/src/delta/_scribe_signal_folk_pubKey_a1_b.ts +++ b/ui/libs/model/src/delta/_scribe_signal_folk_pubKey_a1_b.ts @@ -1,9 +1,10 @@ +import type { AgentPubKey } from '@holochain/conductor-api' import { _b } from '@ctx-core/object' +import type { PubKeyToFolkRecord } from '@syn-ui/zome-client' import { folks_b } from '../session' -import type { AgentPubKey } from '@holochain/conductor-api' export const _scribe_signal_folk_pubKey_a1_b = _b('_scribe_signal_folk_pubKey_a1', (ctx)=>{ const folks = folks_b(ctx) return function _scribe_signal_folk_pubKey_a1():AgentPubKey[] { - return Object.values(folks.$).filter(v=>v.inSession).map(v=>v.pubKey) + return Object.values(folks.$ as PubKeyToFolkRecord).filter(v=>v.inSession).map(v=>v.pubKey) } }) diff --git a/ui/libs/model/src/delta/apply_delta_fn_b.ts b/ui/libs/model/src/delta/apply_delta_fn_b.ts deleted file mode 100644 index 0edd791f..00000000 --- a/ui/libs/model/src/delta/apply_delta_fn_b.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { _b } from '@ctx-core/object' -import { writable$ } from '@ctx-core/store' -import type { apply_delta_fn_T } from './ApplyDelta' -export const apply_delta_fn_b = _b('apply_delta_fn', ()=> - writable$<apply_delta_fn_T>(null) -) diff --git a/ui/libs/model/src/delta/commit_change_b.ts b/ui/libs/model/src/delta/commit_change_b.ts index 59773a4b..242d6d96 100644 --- a/ui/libs/model/src/delta/commit_change_b.ts +++ b/ui/libs/model/src/delta/commit_change_b.ts @@ -1,6 +1,6 @@ import { _b, assign } from '@ctx-core/object' import { Commit, rpc_commit_b, rpc_hash_content_b } from '@syn-ui/zome-client' -import { bufferToBase64 } from '@syn-ui/utils' +import { bufferToBase64, EntryHash, HeaderHash } from '@syn-ui/utils' import { content_b } from '../content' import { am_i_scribe_b, commit_in_progress_b, content_hash_b, @@ -32,18 +32,18 @@ export const commit_change_b = _b('commit_change', (ctx)=>{ alert('No changes to commit!') return } - commit_in_progress.set(true) + commit_in_progress.$ = true try { const new_content_hash = await rpc_hash_content(content.$) console.log('committing from snapshot', snapshot_hash_str.$) console.log(' prev_hash:', content_hash_str.$) console.log(' new_hash:', bufferToBase64(new_content_hash)) const commit:Commit = { - snapshot: snapshot_hash.$, + snapshot: snapshot_hash.$ as HeaderHash, change: { deltas: $recorded_changes.map(c=>JSON.stringify(c.delta)), content_hash: new_content_hash, - previous_change: content_hash.$, + previous_change: content_hash.$ as EntryHash, meta: { contributors: [], witnesses: [], @@ -54,7 +54,7 @@ export const commit_change_b = _b('commit_change', (ctx)=>{ } try { const $current_commit_header_hash = await rpc_commit(commit) - current_commit_header_hash.set($current_commit_header_hash) + current_commit_header_hash.$ = $current_commit_header_hash // if commit successfull we need to update the content hash and its string in the session session_info.update($session_info=> assign($session_info, { @@ -65,12 +65,12 @@ export const commit_change_b = _b('commit_change', (ctx)=>{ $committed_changes.push(...$recorded_changes) return $committed_changes }) - recorded_changes.set([]) + recorded_changes.$ = [] } catch (e) { console.log('Error:', e) } } finally { - commit_in_progress.set(false) + commit_in_progress.$ = false } } else { alert(`You ain't the scribe!`) diff --git a/ui/libs/model/src/delta/index.ts b/ui/libs/model/src/delta/index.ts index 8d71049d..bcadfa62 100644 --- a/ui/libs/model/src/delta/index.ts +++ b/ui/libs/model/src/delta/index.ts @@ -1,5 +1,4 @@ export * from './ApplyDelta' -export * from './apply_delta_fn_b' export * from './commit_change_b' export * from './committed_changes_b' export * from './deltas_b' diff --git a/ui/libs/model/src/delta/record_deltas_b.ts b/ui/libs/model/src/delta/record_deltas_b.ts index 90725abb..6e5d3097 100644 --- a/ui/libs/model/src/delta/record_deltas_b.ts +++ b/ui/libs/model/src/delta/record_deltas_b.ts @@ -3,6 +3,7 @@ import { _b } from '@ctx-core/object' import { requested_changes_b } from './requested_changes_b' import { recorded_changes_b } from './recorded_changes_b' import { record_delta_b } from './record_delta_b' +import type { ApplyDelta } from './ApplyDelta' export const record_deltas_b = _b('record_deltas', (ctx)=>{ const requested_changes = requested_changes_b(ctx) return function record_deltas(_index:number, deltas:Delta[]) { @@ -13,7 +14,7 @@ export const record_deltas_b = _b('record_deltas', (ctx)=>{ // if this change is our next requested change then remove it if (JSON.stringify(delta) == JSON.stringify($requested_changes[0].delta)) { const recorded_changes = recorded_changes_b(ctx) - recorded_changes.push($requested_changes.shift()) + recorded_changes.push($requested_changes.shift() as ApplyDelta) requested_changes.set($requested_changes) } else { // TODO rebase? diff --git a/ui/libs/model/src/delta/recorded_changes_b.ts b/ui/libs/model/src/delta/recorded_changes_b.ts index 7cb69363..1d75a335 100644 --- a/ui/libs/model/src/delta/recorded_changes_b.ts +++ b/ui/libs/model/src/delta/recorded_changes_b.ts @@ -1,20 +1,15 @@ import { _b } from '@ctx-core/object' -import { Writable$, writable$ } from '@ctx-core/store' +import { writable$, writable$_C } from '@ctx-core/store' import type { ApplyDelta } from './ApplyDelta' export const recorded_changes_b = _b('recorded_changes', ()=> - new recorded_changes_T() + new recorded_changes_T(writable$<$recorded_changes_T>([])) ) export type $recorded_changes_T = ApplyDelta[] -export class recorded_changes_T implements Writable$<$recorded_changes_T> { - #store = writable$<$recorded_changes_T>([]) - set = this.#store.set - subscribe = this.#store.subscribe - update = this.#store.update - $ = this.#store.$ +export class recorded_changes_T extends writable$_C<$recorded_changes_T> { push = (...apply_delta_a1:ApplyDelta[])=>{ - const $store = this.#store.$ + const $store = this.$ $store.push(...apply_delta_a1) - this.#store.set($store) + this.$ = $store return $store } } diff --git a/ui/libs/model/src/delta/request_change_b.ts b/ui/libs/model/src/delta/request_change_b.ts index 796dcf35..6bc1c68b 100644 --- a/ui/libs/model/src/delta/request_change_b.ts +++ b/ui/libs/model/src/delta/request_change_b.ts @@ -33,8 +33,8 @@ export const request_change_b = _b('request_change', (ctx)=>{ // we want to apply this to current next_index plus any previously // requested changes that haven't yet be recorded const index = next_index.$ + $requested_changes.length + const run_apply_delta = run_apply_delta_b(ctx) for (const delta of deltas) { - const run_apply_delta = run_apply_delta_b(ctx) const undoable_change = run_apply_delta(delta) undoable_change.id = change_id undoable_change.at = change_at diff --git a/ui/libs/model/src/delta/run_apply_delta_b.ts b/ui/libs/model/src/delta/run_apply_delta_b.ts index d30c2983..db5c80da 100644 --- a/ui/libs/model/src/delta/run_apply_delta_b.ts +++ b/ui/libs/model/src/delta/run_apply_delta_b.ts @@ -1,13 +1,77 @@ -import type { Delta } from '@syn-ui/zome-client' import { _b } from '@ctx-core/object' +import { + Content, Delta, AddDelta, DeleteDelta, MetaDelta, TitleDelta, my_tag_b +} from '@syn-ui/zome-client' import { content_b } from '../content' -import { apply_delta_fn_b } from './apply_delta_fn_b' import type { ApplyDelta } from './ApplyDelta' +import { deltas_b } from './deltas_b' +import { snapshot_content_b } from './snapshot_content_b' +import { committed_changes_b } from './committed_changes_b' export const run_apply_delta_b = _b('run_apply_delta', (ctx)=>{ const content = content_b(ctx) - const apply_delta_fn = apply_delta_fn_b(ctx) - return function run_apply_delta(delta:Delta):ApplyDelta { - const [$content, undoable_change] = apply_delta_fn.$(content.$, delta) + const my_tag = my_tag_b(ctx) + const deltas = deltas_b(ctx) + const snapshot_content = snapshot_content_b(ctx) + const committed_changes = committed_changes_b(ctx) + snapshot_content.subscribe($snapshot_content=>{ + if (!$snapshot_content) return + const $content:Content = { + title: $snapshot_content.title, + body: $snapshot_content.body, + meta: { + [my_tag.$]: 0 + } + } + content.$ = $content + const new_$committed_changes:ApplyDelta[] = [] + for (const delta of deltas.$ || []) { + const change = run_apply_delta(delta) + new_$committed_changes.push(change) + } + committed_changes.update($committed_changes => { + $committed_changes.push(...new_$committed_changes) + return $committed_changes + }) + }) + return run_apply_delta + function run_apply_delta(delta:Delta):ApplyDelta { + const $content = content.$ + let undoable_change:ApplyDelta + switch (delta.type) { + case 'Title': { + const deleted = $content.title + const Title_delta = delta as TitleDelta + $content.title = Title_delta.value + undoable_change = { delta, deleted } + break + } + case 'Add': { + const Add_delta = delta as AddDelta + const [loc, text] = Add_delta.value + $content.body = $content.body.slice(0, loc) + text + $content.body.slice(loc) + undoable_change = { delta } + break + } + case 'Delete': { + const Delete_delta = delta as DeleteDelta + const [start, end] = Delete_delta.value + const deleted = $content.body.slice(start, end) + $content.body = $content.body.slice(0, start) + $content.body.slice(end) + undoable_change = { delta, deleted } + break + } + case 'Meta': { + const Meta_delta = delta as MetaDelta + const [tag, loc] = Meta_delta.value.setLoc + const deleted:[string, number] = [tag, $content.meta[tag]] + $content.meta[tag] = loc + undoable_change = { delta, deleted } + break + } + default: { + throw `Unsupported delta.type ${delta.type}` + } + } content.set($content) return undoable_change } diff --git a/ui/libs/model/src/delta/snapshot_content_b.ts b/ui/libs/model/src/delta/snapshot_content_b.ts index e8fff995..28cb95c0 100644 --- a/ui/libs/model/src/delta/snapshot_content_b.ts +++ b/ui/libs/model/src/delta/snapshot_content_b.ts @@ -1,34 +1,10 @@ import { _b } from '@ctx-core/object' import { derived$ } from '@ctx-core/store' -import { Content, my_tag_b } from '@syn-ui/zome-client' -import { content_b } from '../content' import { session_info_b } from '../session' -import { apply_delta_fn_b } from './apply_delta_fn_b' -import { deltas_b } from './deltas_b' export const snapshot_content_b = _b('snapshot_content', (ctx)=>{ const session_info = session_info_b(ctx) - const my_tag = my_tag_b(ctx) - const apply_delta_fn = apply_delta_fn_b(ctx) - const deltas = deltas_b(ctx) - const content = content_b(ctx) const snapshot_content = derived$(session_info, $session_info=> $session_info?.snapshot_content ) - snapshot_content.subscribe($snapshot_content=>{ - let $content:Content = { - ...$snapshot_content, - meta: { - [my_tag.$]: 0 - } - } - const new_$committed_changes = [] - const $apply_delta_fn = apply_delta_fn.$ - for (const delta of deltas.$) { - const [in_$content, change] = $apply_delta_fn($content, delta) - $content = in_$content - new_$committed_changes.push(change) - } - content.$ = $content - }) return snapshot_content }) diff --git a/ui/libs/model/src/session/content_hash_b.ts b/ui/libs/model/src/session/content_hash_b.ts index 5067c53d..e71a1cfc 100644 --- a/ui/libs/model/src/session/content_hash_b.ts +++ b/ui/libs/model/src/session/content_hash_b.ts @@ -1,6 +1,8 @@ import { _b } from '@ctx-core/object' import { derived$, mix_set_readable$ } from '@ctx-core/store' +import type { SessionInfo } from '@syn-ui/zome-client' import { session_info_b } from './session_info_b' +import type { EntryHash } from '@syn-ui/utils/dist' export const content_hash_b = _b('content_hash', (ctx)=>{ const session_info = session_info_b(ctx) return mix_set_readable$( @@ -9,7 +11,7 @@ export const content_hash_b = _b('content_hash', (ctx)=>{ }), $content_hash=>{ session_info.update($session_info=>{ - $session_info.content_hash = $content_hash + ($session_info as SessionInfo).content_hash = $content_hash as EntryHash return $session_info }) } diff --git a/ui/libs/model/src/session/current_commit_header_hash_b.ts b/ui/libs/model/src/session/current_commit_header_hash_b.ts index d21e53e5..7df2bac5 100644 --- a/ui/libs/model/src/session/current_commit_header_hash_b.ts +++ b/ui/libs/model/src/session/current_commit_header_hash_b.ts @@ -2,5 +2,5 @@ import type { HoloHash } from '@holochain/conductor-api' import { _b } from '@ctx-core/object' import { writable$ } from '@ctx-core/store' export const current_commit_header_hash_b = _b('current_commit_header_hash', ()=> - writable$<HoloHash>(null) + writable$<HoloHash|null>(null) ) diff --git a/ui/libs/model/src/session/folks_b.ts b/ui/libs/model/src/session/folks_b.ts index 6cc3da3a..54e66c1f 100644 --- a/ui/libs/model/src/session/folks_b.ts +++ b/ui/libs/model/src/session/folks_b.ts @@ -2,6 +2,6 @@ import { _b } from '@ctx-core/object' import { writable$ } from '@ctx-core/store' import type { PubKeyToFolkRecord } from '@syn-ui/zome-client' export const folks_b = _b('folks', ()=>{ - return writable$<$folks_T>(null) + return writable$<$folks_T>({}) }) -export type $folks_T = PubKeyToFolkRecord +export type $folks_T = PubKeyToFolkRecord|null diff --git a/ui/libs/model/src/session/scribe_b.ts b/ui/libs/model/src/session/scribe_b.ts index 2d607797..de12452e 100644 --- a/ui/libs/model/src/session/scribe_b.ts +++ b/ui/libs/model/src/session/scribe_b.ts @@ -1,10 +1,10 @@ +import type { AgentPubKey } from '@holochain/conductor-api' import { _b } from '@ctx-core/object' -import { derived$ } from '@ctx-core/store' -import { bufferToBase64 } from '@syn-ui/utils' +import { derived$, Readable$ } from '@ctx-core/store' import { session_info_b } from './session_info_b' export const scribe_b = _b('scribe', (ctx)=>{ const session_info = session_info_b(ctx) return derived$(session_info, $session_info=> - $session_info ? bufferToBase64($session_info.scribe) : null - ) + $session_info?.scribe + ) as Readable$<AgentPubKey> }) diff --git a/ui/libs/model/src/session/session_info_b.ts b/ui/libs/model/src/session/session_info_b.ts index 49679640..35684691 100644 --- a/ui/libs/model/src/session/session_info_b.ts +++ b/ui/libs/model/src/session/session_info_b.ts @@ -3,7 +3,7 @@ import { writable$, Writable$ } from '@ctx-core/store' import { rpc_get_session_b, SessionInfo } from '@syn-ui/zome-client' export const session_info_b = _b<session_info_I>('session_info', (ctx)=>{ const rpc_get_session = rpc_get_session_b(ctx) - const session_info = assign(writable$(null), { + const session_info = assign(writable$<$session_info_T>(null), { refresh }) return session_info @@ -14,6 +14,7 @@ export const session_info_b = _b<session_info_I>('session_info', (ctx)=>{ } } }) -export interface session_info_I extends Writable$<SessionInfo> { +export type $session_info_T = SessionInfo|null +export interface session_info_I extends Writable$<$session_info_T> { refresh():Promise<void> } diff --git a/ui/libs/model/src/session/sessions_b.ts b/ui/libs/model/src/session/sessions_b.ts index 4d4586b5..0dadd989 100644 --- a/ui/libs/model/src/session/sessions_b.ts +++ b/ui/libs/model/src/session/sessions_b.ts @@ -1,32 +1,48 @@ import { _b, assign } from '@ctx-core/object' import { Writable$, writable$ } from '@ctx-core/store' -import { rpc_get_sessions_b } from '@syn-ui/zome-client' +import { rpc_get_sessions_b, SessionInfo } from '@syn-ui/zome-client' import type { EntryHash } from '@syn-ui/utils' +import { session_info_b } from './session_info_b' export const sessions_b = _b('sessions', (ctx)=>{ const rpc_get_sessions = rpc_get_sessions_b(ctx) - const sessions = writable$<EntryHash[]>(null) + const sessions = writable$<EntryHash[]|null>(null) const busy = writable$<boolean>(false) const out_sessions = sessions as sessions_T assign(out_sessions, { busy, load, unshift }) - load().then() + const session_info = session_info_b(ctx) + let $session_info:SessionInfo|null + session_info.subscribe(in_$session_info=>{ + if ($session_info && !in_$session_info) { + sessions.$ = null + } + $session_info = in_$session_info + }) return out_sessions async function load() { + console.debug('sessions_b|load|debug|1') busy.$ = true try { + console.debug('sessions_b|load|debug|2') sessions.$ = await rpc_get_sessions() + console.debug('sessions_b|load|debug|3', { + 'sessions.$': sessions.$ + }) } finally { busy.$ = false } + console.debug('sessions_b|load|debug|4', { + 'sessions.$': sessions.$ + }) return sessions.$ } function unshift(...session_hash_a1:EntryHash[]) { - const $sessions = sessions.$ + const $sessions = sessions.$ as EntryHash[] $sessions.unshift(...session_hash_a1) sessions.set($sessions) return $sessions } }) -export interface sessions_T extends Writable$<EntryHash[]> { +export interface sessions_T extends Writable$<EntryHash[]|null> { busy:Writable$<boolean> load():Promise<EntryHash[]> unshift(...session_hash_a1:EntryHash[]):EntryHash[] diff --git a/ui/libs/model/src/session/snapshot_hash_b.ts b/ui/libs/model/src/session/snapshot_hash_b.ts index edae2e0b..361f7d63 100644 --- a/ui/libs/model/src/session/snapshot_hash_b.ts +++ b/ui/libs/model/src/session/snapshot_hash_b.ts @@ -1,7 +1,8 @@ import { _b } from '@ctx-core/object' -import { derived$ } from '@ctx-core/store' +import { derived$, Readable$ } from '@ctx-core/store' +import type { HeaderHash } from '@syn-ui/utils/dist' import { session_info_b } from './session_info_b' -export const snapshot_hash_b = _b('snapshot_hash', (ctx) => { +export const snapshot_hash_b = _b<Readable$<HeaderHash|undefined>>('snapshot_hash', ctx => { const session_info = session_info_b(ctx) return derived$(session_info, $session_info=> $session_info?.snapshot_hash diff --git a/ui/libs/model/src/session/update_folks_b.ts b/ui/libs/model/src/session/update_folks_b.ts index 2071ed24..f04490f6 100644 --- a/ui/libs/model/src/session/update_folks_b.ts +++ b/ui/libs/model/src/session/update_folks_b.ts @@ -18,7 +18,7 @@ export const update_folks_b = _b('update_folks', (ctx)=>{ } // if we don't have this key, create a record for it // including the default color - const $folks = folks.$ + const $folks = folks.$ as PubKeyToFolkRecord _other($folks, pubKeyStr, pubKey) if (meta) { $folks[pubKeyStr]['meta'] = meta @@ -32,7 +32,7 @@ export const update_folks_b = _b('update_folks', (ctx)=>{ case FOLK_UNKNOWN: $folks[pubKeyStr]['inSession'] = false } - folks.set($folks) + folks.$ = $folks } function _other($folks:PubKeyToFolkRecord, pubKeyStr:string, pubKey:AgentPubKey) { if (!(pubKeyStr in $folks)) { diff --git a/ui/libs/model/src/signals/SyncReq_SignalOps_b.ts b/ui/libs/model/src/signals/SyncReq_SignalOps_b.ts index b48f89c0..0cf8ee7b 100644 --- a/ui/libs/model/src/signals/SyncReq_SignalOps_b.ts +++ b/ui/libs/model/src/signals/SyncReq_SignalOps_b.ts @@ -3,6 +3,7 @@ import { _b } from '@ctx-core/object' import { agent_pub_key_b, FOLK_SEEN, me_b, rpc_send_folk_lore_b, rpc_send_sync_response_b, StateForSync } from '@syn-ui/zome-client' +import type { EntryHash } from '@syn-ui/utils' import { _scribe_signal_folk_pubKey_a1_b, recorded_changes_b } from '../delta' import { am_i_scribe_b, content_hash_b, current_commit_header_hash_b, folks_b, @@ -28,8 +29,8 @@ export const SyncReq_SignalOps_b = _b<SignalOps>('SyncReq_SignalOps', (ctx)=>{ if (am_i_scribe.$ === true) { update_folks(participant, FOLK_SEEN) const state:StateForSync = { - snapshot: snapshot_hash.$, - commit_content_hash: content_hash.$, + snapshot: snapshot_hash.$ as EntryHash, + commit_content_hash: content_hash.$ as EntryHash, deltas: recorded_changes.$.map(c=>c.delta) } const $current_commit_header_hash = current_commit_header_hash.$ diff --git a/ui/libs/model/src/signals/SyncResp_SignalOps_b.ts b/ui/libs/model/src/signals/SyncResp_SignalOps_b.ts index 741688b8..79c287e2 100644 --- a/ui/libs/model/src/signals/SyncResp_SignalOps_b.ts +++ b/ui/libs/model/src/signals/SyncResp_SignalOps_b.ts @@ -1,4 +1,6 @@ +import type { HoloHash } from '@holochain/conductor-api' import { _b, assign } from '@ctx-core/object' +import type { Delta } from '@syn-ui/zome-client' import { bufferToBase64 } from '@syn-ui/utils' import type { SerializedStateForSync, StateForSync } from '../delta' import { record_delta_b } from '../delta' @@ -11,7 +13,7 @@ export const SyncResp_SignalOps_b = _b<SignalOps>('SyncResp_SignalOps', (ctx)=>{ SyncResp: async (signal)=>{ const serialized_state:SerializedStateForSync = signal.data.payload.signal_payload serialized_state.deltas = serialized_state.deltas.map(d=>JSON.parse(d)) - const state = assign({} as StateForSync, serialized_state, { + const state:SyncResp_stace_I = assign({} as StateForSync, serialized_state, { deltas: serialized_state.deltas.map(d=>JSON.parse(d)) }) // Make sure that we are working off the same snapshot and commit @@ -27,3 +29,9 @@ export const SyncResp_SignalOps_b = _b<SignalOps>('SyncResp_SignalOps', (ctx)=>{ } } }) +export interface SyncResp_stace_I extends Omit<StateForSync, 'deltas'> { + snapshot:HoloHash, + commit:HoloHash, + commit_content_hash:HoloHash + deltas:Delta[] +} diff --git a/ui/libs/model/src/timers/request_checker_timer_b.ts b/ui/libs/model/src/timers/request_checker_timer_b.ts index 8e2dc0de..2d5862d3 100644 --- a/ui/libs/model/src/timers/request_checker_timer_b.ts +++ b/ui/libs/model/src/timers/request_checker_timer_b.ts @@ -11,7 +11,8 @@ export const request_checker_timer_b = _b('request_checker_timer', (ctx)=>{ return new Timer(async ()=>{ const $requested_changes = requested_changes.$ if ($requested_changes.length > 0) { - if ((Date.now() - $requested_changes[0].at) > request_timeout) { + const at = $requested_changes[0]?.at + if (at && (Date.now() - at) > request_timeout) { // for now let's just do the most drastic thing! /* console.log('requested change timed out! Undoing all changes', $requested_changes[0]) @@ -22,7 +23,7 @@ export const request_checker_timer_b = _b('request_checker_timer', (ctx)=>{ console.log('undoing ', change) const undoDelta = undoFn(change) console.log('undoDelta: ', undoDelta) - apply_delta_fn(undoDelta) + run_apply_delta(undoDelta) return changes }) }*/ @@ -31,7 +32,10 @@ export const request_checker_timer_b = _b('request_checker_timer', (ctx)=>{ // TODO: prepare for shifting to new scribe if they went offline await session_info.refresh() console.log('HERE') - await rpc_send_sync_request(session_info.$) + const $session_info = session_info.$ + if ($session_info) { + await rpc_send_sync_request($session_info) + } } } }, request_timeout / 2) diff --git a/ui/libs/model/src/timers/scribe_heartbeat_timer_b.ts b/ui/libs/model/src/timers/scribe_heartbeat_timer_b.ts index 638f8f72..ac00f87d 100644 --- a/ui/libs/model/src/timers/scribe_heartbeat_timer_b.ts +++ b/ui/libs/model/src/timers/scribe_heartbeat_timer_b.ts @@ -1,8 +1,9 @@ import { _b } from '@ctx-core/object' -import { rpc_send_folk_lore_b, rpc_send_heartbeat_b } from '@syn-ui/zome-client' +import { PubKeyToFolkRecord, rpc_send_folk_lore_b, rpc_send_heartbeat_b } from '@syn-ui/zome-client' import { am_i_scribe_b, folks_b, scribe_b } from '../session' import { _scribe_signal_folk_pubKey_a1_b } from '../delta' import { Timer } from './Timer' +import type { AgentPubKey } from '@holochain/conductor-api' // const outOfSessionTimout = 30 * 1000 const outOfSessionTimout = 8 * 1000 // testing code :) // const heartbeatInterval = 15 * 1000 // 15 seconds @@ -14,10 +15,10 @@ export const scribe_heartbeat_timer_b = _b<Timer>('scribe_heartbeat_timer', (ctx if (am_i_scribe.$ === true) { // examine folks last seen time and see if any have crossed the session out-of-session // timeout so we can tell everybody else about them having dropped. - const gone = [] - const $folks = folks.$ + const gone:AgentPubKey[] = [] + const $folks = folks.$ as PubKeyToFolkRecord for (const [pubKeyStr, folk] of Object.entries($folks)) { - if (folk.inSession && (Date.now() - $folks[pubKeyStr].lastSeen > outOfSessionTimout)) { + if (folk.inSession && (Date.now() - ($folks[pubKeyStr].lastSeen||0) > outOfSessionTimout)) { folk.inSession = false gone.push($folks[pubKeyStr].pubKey) } diff --git a/ui/libs/zome-client/package.json b/ui/libs/zome-client/package.json index 220c6344..bd2d8588 100644 --- a/ui/libs/zome-client/package.json +++ b/ui/libs/zome-client/package.json @@ -6,9 +6,9 @@ "types": "./src/index.ts", "scripts": {}, "devDependencies": { - "@ctx-core/function": "^17.4.7", - "@ctx-core/object": "^17.5.11", - "@ctx-core/store": "^24.5.6", + "@ctx-core/function": "^17.4.8", + "@ctx-core/object": "^17.5.13", + "@ctx-core/store": "^24.5.8", "@holochain/conductor-api": "^0.0.3", "@syn-ui/utils": "workspace:^1.0.0", "buffer": "^6.0.3", diff --git a/ui/libs/zome-client/src/Commit.ts b/ui/libs/zome-client/src/Commit.ts index 4af93503..6b47ea77 100644 --- a/ui/libs/zome-client/src/Commit.ts +++ b/ui/libs/zome-client/src/Commit.ts @@ -1,15 +1,16 @@ -import type { HoloHash } from '@holochain/conductor-api' +import type { AgentPubKey } from '@holochain/conductor-api' +import type { EntryHash, HeaderHash } from '@syn-ui/utils/dist' export interface Commit { - snapshot:HoloHash + snapshot:HeaderHash change:{ deltas:string[] - content_hash:HoloHash - previous_change:HoloHash + content_hash:EntryHash + previous_change:EntryHash meta:{ contributors:string[] witnesses:string[] app_specific:null } }, - participants:HoloHash[] + participants:AgentPubKey[] } diff --git a/ui/libs/zome-client/src/Content.ts b/ui/libs/zome-client/src/Content.ts index e91ad216..9e7d6991 100644 --- a/ui/libs/zome-client/src/Content.ts +++ b/ui/libs/zome-client/src/Content.ts @@ -1,5 +1,5 @@ export interface Content { title:string body:string - meta?:Record<string, number> + meta:Record<string, number> } diff --git a/ui/libs/zome-client/src/Folk.ts b/ui/libs/zome-client/src/Folk.ts index a263eaac..7dc08b43 100644 --- a/ui/libs/zome-client/src/Folk.ts +++ b/ui/libs/zome-client/src/Folk.ts @@ -1,17 +1,16 @@ -import type { HoloHash } from '@holochain/conductor-api' +import type { AgentPubKey } from '@holochain/conductor-api' import type { FolkColors } from './FolkColors' export interface Folk { - pubKey:HoloHash + pubKey:AgentPubKey inSession?:boolean colors?:FolkColors lastSeen?:number } -export type string_Folk_Record = Record<string, Folk> export type pk = 'pubKey' export type PubKeyToFolkRecord = { - [L in keyof Exclude<any, 'pubKey'>]: Folk; -} & { - pubKey?: HoloHash + [L in keyof Exclude<any, 'pubKey'>]:Folk; +}&{ + pubKey?:AgentPubKey } export enum FolkStatus { FOLK_SEEN = 1, diff --git a/ui/libs/zome-client/src/StateForSync.ts b/ui/libs/zome-client/src/StateForSync.ts index fa1ff288..bfa8e5b6 100644 --- a/ui/libs/zome-client/src/StateForSync.ts +++ b/ui/libs/zome-client/src/StateForSync.ts @@ -1,14 +1,14 @@ -import type { HoloHash } from '@holochain/conductor-api' +import type { EntryHash, HeaderHash } from '@syn-ui/utils' import type { Delta } from './Delta' export interface StateForSync { - snapshot:HoloHash - commit?:HoloHash - commit_content_hash:HoloHash + snapshot:EntryHash + commit?:HeaderHash + commit_content_hash:EntryHash deltas:Delta[] } export interface StateForSync_serialized_I { - snapshot:HoloHash - commit?:HoloHash - commit_content_hash:HoloHash + snapshot:EntryHash + commit?:HeaderHash + commit_content_hash:EntryHash deltas:string[] } diff --git a/ui/libs/zome-client/src/app_id_b.ts b/ui/libs/zome-client/src/app_id_b.ts index 3fed6e10..7cb058dc 100644 --- a/ui/libs/zome-client/src/app_id_b.ts +++ b/ui/libs/zome-client/src/app_id_b.ts @@ -1,5 +1,5 @@ import { _b } from '@ctx-core/object' import { writable$ } from '@ctx-core/store' export const app_id_b = _b('app_id', ()=>{ - return writable$<string>(null) + return writable$<string|null>(null) }) diff --git a/ui/libs/zome-client/src/app_port_b.ts b/ui/libs/zome-client/src/app_port_b.ts index ccbf913e..6e59014a 100644 --- a/ui/libs/zome-client/src/app_port_b.ts +++ b/ui/libs/zome-client/src/app_port_b.ts @@ -1,5 +1,5 @@ import { _b } from '@ctx-core/object' import { writable$ } from '@ctx-core/store' export const app_port_b = _b('app_port', ()=>{ - return writable$<number>(null) + return writable$<number|null>(null) }) diff --git a/ui/libs/zome-client/src/rpc_b.ts b/ui/libs/zome-client/src/rpc_b.ts index 5ef17ddd..028b7f1f 100644 --- a/ui/libs/zome-client/src/rpc_b.ts +++ b/ui/libs/zome-client/src/rpc_b.ts @@ -33,7 +33,7 @@ export const rpc_b = _b('rpc', (ctx)=>{ ) return result } catch (error) { - console.log('ERROR: rpc threw error', error) + console.log(`ERROR: rpc ${fn_name}`, { error }) throw(error) // if (error == 'Error: Socket is not open') { // TODO return doResetConnection(dispatch) diff --git a/ui/libs/zome-client/src/rpc_hash_content_b.ts b/ui/libs/zome-client/src/rpc_hash_content_b.ts index 15712a73..bf899e85 100644 --- a/ui/libs/zome-client/src/rpc_hash_content_b.ts +++ b/ui/libs/zome-client/src/rpc_hash_content_b.ts @@ -1,10 +1,10 @@ -import type { HoloHash } from '@holochain/conductor-api' import { _b } from '@ctx-core/object' +import type { EntryHash } from '@syn-ui/utils/dist' import type { Content } from './Content' import { rpc_b } from './rpc_b' export const rpc_hash_content_b = _b('rpc_hash_content', (ctx)=>{ const rpc = rpc_b(ctx) - return async function rpc_hash_content(content:Content):Promise<HoloHash> { + return async function rpc_hash_content(content:Content):Promise<EntryHash> { return rpc('hash_content', content) } }) diff --git a/ui/libs/zome-client/src/rpc_new_session_b.ts b/ui/libs/zome-client/src/rpc_new_session_b.ts index e3f6db01..ae55a2c9 100644 --- a/ui/libs/zome-client/src/rpc_new_session_b.ts +++ b/ui/libs/zome-client/src/rpc_new_session_b.ts @@ -5,7 +5,7 @@ import type { SessionInfo } from './SessionInfo' export const rpc_new_session_b = _b('rpc_new_session', (ctx) => { const rpc = rpc_b(ctx) return async function rpc_new_session( - content:Content = { title: '', body: '' } + content:Content = { title: '', body: '', meta: {} } ):Promise<SessionInfo> { return rpc('new_session', { content }) } diff --git a/ui/libs/zome-client/src/rpc_send_heartbeat_b.ts b/ui/libs/zome-client/src/rpc_send_heartbeat_b.ts index fd0e809e..b5861729 100644 --- a/ui/libs/zome-client/src/rpc_send_heartbeat_b.ts +++ b/ui/libs/zome-client/src/rpc_send_heartbeat_b.ts @@ -1,5 +1,5 @@ -import { _b } from '@ctx-core/object' import type { HoloHash } from '@holochain/conductor-api' +import { _b } from '@ctx-core/object' import { rpc_b } from './rpc_b' export const rpc_send_heartbeat_b = _b('rpc_send_heartbeat', (ctx)=>{ const rpc = rpc_b(ctx) diff --git a/ui/tsconfig.json b/ui/tsconfig.json index 946858a9..58596b59 100644 --- a/ui/tsconfig.json +++ b/ui/tsconfig.json @@ -1,4 +1,6 @@ { + "$schema": "https://json.schemastore.org/tsconfig", + "display": "Svelte", "compileOnSave": true, "compilerOptions": { "experimentalDecorators": true, @@ -16,7 +18,8 @@ "forceConsistentCasingInFileNames": true, "importsNotUsedAsValues": "error", "types": [ - "node" + "node", + "svelte" ], "noImplicitAny": false, "resolveJsonModule": true, From b3d45a9eb23d65c253c9e9760096ab349b7d6e46 Mon Sep 17 00:00:00 2001 From: Brian Takita <brian.takita@gmail.com> Date: Fri, 30 Apr 2021 06:54:39 -0400 Subject: [PATCH 17/33] @syn-ui/tests: using models: passing --- bin/tsc-build.sh | 2 +- package.json | 6 +- pnpm-lock.yaml | 1258 +++++++++++++++-- tests/.gitignore | 1 + tests/package.json | 7 +- tests/syn-lib/index.ts | 1 + tests/syn-lib/syn-lib.ts | 4 +- tests/unit-test/index.ts | 1 + tests/unit-test/syn.ts | 572 ++++---- ui/tsconfig.json => tsconfig.json | 2 +- ui/apps/app/package.json | 8 +- ui/apps/headless/package.json | 8 +- ui/libs/model/package.json | 6 +- ui/libs/model/src/actions/join_session.ts | 2 +- ui/libs/model/src/content/content_b.ts | 3 +- ui/libs/model/src/delta/apply_deltas_b.ts | 87 ++ ui/libs/model/src/delta/index.ts | 3 +- ui/libs/model/src/delta/record_delta_b.ts | 14 - ui/libs/model/src/delta/record_deltas_b.ts | 24 +- ui/libs/model/src/delta/request_change_b.ts | 20 +- ui/libs/model/src/delta/run_apply_delta_b.ts | 78 - ui/libs/model/src/delta/snapshot_content_b.ts | 6 +- ui/libs/model/src/session/content_hash_b.ts | 19 +- ui/libs/model/src/session/sessions_b.ts | 10 +- .../src/signals/ChangeReq_SignalOps_b.ts | 2 +- .../model/src/signals/Change_SignalOps_b.ts | 4 +- .../src/signals/Heartbeat_SignalOps_b.ts | 9 +- .../model/src/signals/SyncResp_SignalOps_b.ts | 13 +- .../src/timers/request_checker_timer_b.ts | 5 +- .../src/timers/scribe_heartbeat_timer_b.ts | 2 +- ui/libs/model/tsconfig.json | 2 +- ui/libs/utils/tsconfig.json | 2 +- ui/libs/zome-client/package.json | 6 +- ui/libs/zome-client/src/Buffer.ts | 4 +- ui/libs/zome-client/src/Commit.ts | 3 +- ui/libs/zome-client/src/SessionInfo.ts | 3 +- ui/libs/zome-client/src/appInfo_b.ts | 16 +- ui/libs/zome-client/src/app_ws_b.ts | 34 +- ui/libs/zome-client/src/cell_id_b.ts | 6 +- ui/libs/zome-client/src/index.ts | 1 + ui/libs/zome-client/src/rpc_b.ts | 13 +- ui/libs/zome-client/src/rpc_commit_b.ts | 4 +- ui/libs/zome-client/src/rpc_get_content_b.ts | 10 + .../zome-client/src/rpc_send_folk_lore_b.ts | 9 +- .../src/rpc_send_sync_request_b.ts | 6 +- ui/libs/zome-client/tsconfig.json | 2 +- 46 files changed, 1715 insertions(+), 583 deletions(-) create mode 100644 tests/.gitignore rename ui/tsconfig.json => tsconfig.json (97%) create mode 100644 ui/libs/model/src/delta/apply_deltas_b.ts delete mode 100644 ui/libs/model/src/delta/record_delta_b.ts delete mode 100644 ui/libs/model/src/delta/run_apply_delta_b.ts create mode 100644 ui/libs/zome-client/src/rpc_get_content_b.ts diff --git a/bin/tsc-build.sh b/bin/tsc-build.sh index 3e57167d..ab677a99 100755 --- a/bin/tsc-build.sh +++ b/bin/tsc-build.sh @@ -1,2 +1,2 @@ #!/bin/sh -tsc -b $(find ui/libs -maxdepth 1 -mindepth 1) tests $@ +tsc -b $(find ui/libs -maxdepth 1 -mindepth 1) $@ diff --git a/package.json b/package.json index 907ef9ca..cf1e02cf 100644 --- a/package.json +++ b/package.json @@ -10,14 +10,14 @@ ] }, "devDependencies": { - "@babel/runtime": "^7.13.17", + "@babel/runtime": "^7.14.0", "@changesets/cli": "^2.16.0", "@ctx-core/function": "^17.4.8", "@ctx-core/jetbrains": "^4.0.34", - "@ctx-core/monorepo": "^15.0.55", + "@ctx-core/monorepo": "^15.0.56", "@ctx-core/pnpm-tools": "^6.0.11", "pnpm": "^6.2.3", "typescript": "4.2.4" }, "noUpdate": [] -} \ No newline at end of file +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9bebbf31..e2d3ceab 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,33 +4,36 @@ importers: .: specifiers: - '@babel/runtime': ^7.13.17 + '@babel/runtime': ^7.14.0 '@changesets/cli': ^2.16.0 '@ctx-core/function': ^17.4.8 '@ctx-core/jetbrains': ^4.0.34 - '@ctx-core/monorepo': ^15.0.55 + '@ctx-core/monorepo': ^15.0.56 '@ctx-core/pnpm-tools': ^6.0.11 pnpm: ^6.2.3 typescript: 4.2.4 devDependencies: - '@babel/runtime': 7.13.17 + '@babel/runtime': 7.14.0 '@changesets/cli': 2.16.0 '@ctx-core/function': 17.4.8 '@ctx-core/jetbrains': 4.0.34 - '@ctx-core/monorepo': 15.0.55 + '@ctx-core/monorepo': 15.0.56 '@ctx-core/pnpm-tools': 6.0.11 pnpm: 6.2.3 typescript: 4.2.4 tests: specifiers: - '@holochain/conductor-api': 0.0.3 + '@ctx-core/combinators': ^6.0.10 + '@ctx-core/store': ^24.5.9 + '@holochain/conductor-api': 0.0.4 '@holochain/tryorama': 0.4.2 '@syn-ui/model': workspace:^1.0.0 '@syn-ui/utils': workspace:^1.0.0 '@syn-ui/zome-client': workspace:^1.0.0 '@types/lodash': ^4.14.168 '@types/node': ^15.0.1 + ava: ^3.15.0 esm: ^3.2.25 lodash: ^4.17.21 tape: ^5.2.2 @@ -45,20 +48,23 @@ importers: typescript: 4.2.4 uuidv4: 6.2.7 devDependencies: - '@holochain/conductor-api': 0.0.3 + '@ctx-core/combinators': 6.0.10 + '@ctx-core/store': 24.5.9 + '@holochain/conductor-api': 0.0.4 '@holochain/tryorama': 0.4.2 '@syn-ui/model': link:../ui/libs/model '@syn-ui/utils': link:../ui/libs/utils '@syn-ui/zome-client': link:../ui/libs/zome-client '@types/lodash': 4.14.168 '@types/node': 15.0.1 + ava: 3.15.0 ui/apps/app: specifiers: '@ctx-core/combinators': ^6.0.10 - '@ctx-core/object': ^17.5.13 - '@ctx-core/store': ^24.5.8 - '@holochain/conductor-api': 0.0.3 + '@ctx-core/object': ^17.5.15 + '@ctx-core/store': ^24.5.9 + '@holochain/conductor-api': 0.0.4 '@rollup/plugin-commonjs': ^18.0.0 '@rollup/plugin-node-resolve': ^11.2.1 '@rollup/plugin-replace': ^2.4.2 @@ -67,7 +73,7 @@ importers: '@syn-ui/zome-client': workspace:^1.0.0 '@tsconfig/svelte': ^1.0.10 buffer: ^6.0.3 - rollup: ^2.45.2 + rollup: ^2.46.0 rollup-plugin-css-only: ^3.1.0 rollup-plugin-livereload: ^2.0.0 rollup-plugin-node-polyfills: ^0.2.1 @@ -82,26 +88,26 @@ importers: typescript: ^4.2.4 dependencies: '@ctx-core/combinators': 6.0.10 - '@holochain/conductor-api': 0.0.3 + '@holochain/conductor-api': 0.0.4 sirv-cli: 1.0.11 svelte-fa: 2.2.0 devDependencies: - '@ctx-core/object': 17.5.13 - '@ctx-core/store': 24.5.8 - '@rollup/plugin-commonjs': 18.0.0_rollup@2.45.2 - '@rollup/plugin-node-resolve': 11.2.1_rollup@2.45.2 - '@rollup/plugin-replace': 2.4.2_rollup@2.45.2 - '@rollup/plugin-typescript': 8.2.1_d21869dc49fccc93d6599238c3a50ee6 + '@ctx-core/object': 17.5.15 + '@ctx-core/store': 24.5.9 + '@rollup/plugin-commonjs': 18.0.0_rollup@2.46.0 + '@rollup/plugin-node-resolve': 11.2.1_rollup@2.46.0 + '@rollup/plugin-replace': 2.4.2_rollup@2.46.0 + '@rollup/plugin-typescript': 8.2.1_a3b54be422ec682aa2c1673acc2ace22 '@syn-ui/model': link:../../libs/model '@syn-ui/zome-client': link:../../libs/zome-client '@tsconfig/svelte': 1.0.10 buffer: 6.0.3 - rollup: 2.45.2 - rollup-plugin-css-only: 3.1.0_rollup@2.45.2 + rollup: 2.46.0 + rollup-plugin-css-only: 3.1.0_rollup@2.46.0 rollup-plugin-livereload: 2.0.0 rollup-plugin-node-polyfills: 0.2.1 - rollup-plugin-svelte: 7.1.0_rollup@2.45.2+svelte@3.37.0 - rollup-plugin-terser: 7.0.2_rollup@2.45.2 + rollup-plugin-svelte: 7.1.0_rollup@2.46.0+svelte@3.37.0 + rollup-plugin-terser: 7.0.2_rollup@2.46.0 svelte: 3.37.0 svelte-check: 1.5.2_svelte@3.37.0 svelte-preprocess: 4.7.2_svelte@3.37.0+typescript@4.2.4 @@ -111,14 +117,14 @@ importers: ui/apps/headless: specifiers: '@ctx-core/combinators': ^6.0.10 - '@ctx-core/object': ^17.5.13 - '@ctx-core/store': ^24.5.8 - '@holochain/conductor-api': 0.0.3 + '@ctx-core/object': ^17.5.15 + '@ctx-core/store': ^24.5.9 + '@holochain/conductor-api': 0.0.4 '@rollup/plugin-commonjs': ^18.0.0 '@rollup/plugin-node-resolve': ^11.2.1 '@rollup/plugin-replace': ^2.4.2 '@rollup/plugin-typescript': ^8.2.1 - rollup: ^2.45.2 + rollup: ^2.46.0 rollup-plugin-css-only: ^3.1.0 rollup-plugin-livereload: ^2.0.0 rollup-plugin-svelte: ^7.1.0 @@ -130,21 +136,21 @@ importers: typescript: ^4.2.4 dependencies: '@ctx-core/combinators': 6.0.10 - '@holochain/conductor-api': 0.0.3 + '@holochain/conductor-api': 0.0.4 sirv-cli: 1.0.11 svelte-fa: 2.2.0 devDependencies: - '@ctx-core/object': 17.5.13 - '@ctx-core/store': 24.5.8 - '@rollup/plugin-commonjs': 18.0.0_rollup@2.45.2 - '@rollup/plugin-node-resolve': 11.2.1_rollup@2.45.2 - '@rollup/plugin-replace': 2.4.2_rollup@2.45.2 - '@rollup/plugin-typescript': 8.2.1_rollup@2.45.2+typescript@4.2.4 - rollup: 2.45.2 - rollup-plugin-css-only: 3.1.0_rollup@2.45.2 + '@ctx-core/object': 17.5.15 + '@ctx-core/store': 24.5.9 + '@rollup/plugin-commonjs': 18.0.0_rollup@2.46.0 + '@rollup/plugin-node-resolve': 11.2.1_rollup@2.46.0 + '@rollup/plugin-replace': 2.4.2_rollup@2.46.0 + '@rollup/plugin-typescript': 8.2.1_rollup@2.46.0+typescript@4.2.4 + rollup: 2.46.0 + rollup-plugin-css-only: 3.1.0_rollup@2.46.0 rollup-plugin-livereload: 2.0.0 - rollup-plugin-svelte: 7.1.0_rollup@2.45.2+svelte@3.37.0 - rollup-plugin-terser: 7.0.2_rollup@2.45.2 + rollup-plugin-svelte: 7.1.0_rollup@2.46.0+svelte@3.37.0 + rollup-plugin-terser: 7.0.2_rollup@2.46.0 svelte: 3.37.0 svelte-preprocess: 4.7.2_svelte@3.37.0+typescript@4.2.4 typescript: 4.2.4 @@ -152,18 +158,18 @@ importers: ui/libs/model: specifiers: '@ctx-core/combinators': ^6.0.10 - '@ctx-core/object': ^17.5.13 - '@ctx-core/store': ^24.5.8 - '@holochain/conductor-api': 0.0.3 + '@ctx-core/object': ^17.5.15 + '@ctx-core/store': ^24.5.9 + '@holochain/conductor-api': 0.0.4 '@syn-ui/utils': workspace:^1.0.0 '@syn-ui/zome-client': workspace:^1.0.0 svelte: ^3.37.0 typescript: ^4.2.4 devDependencies: '@ctx-core/combinators': 6.0.10 - '@ctx-core/object': 17.5.13 - '@ctx-core/store': 24.5.8 - '@holochain/conductor-api': 0.0.3 + '@ctx-core/object': 17.5.15 + '@ctx-core/store': 24.5.9 + '@holochain/conductor-api': 0.0.4 '@syn-ui/utils': link:../utils '@syn-ui/zome-client': link:../zome-client svelte: 3.37.0 @@ -178,17 +184,17 @@ importers: ui/libs/zome-client: specifiers: '@ctx-core/function': ^17.4.8 - '@ctx-core/object': ^17.5.13 - '@ctx-core/store': ^24.5.8 - '@holochain/conductor-api': ^0.0.3 + '@ctx-core/object': ^17.5.15 + '@ctx-core/store': ^24.5.9 + '@holochain/conductor-api': ^0.0.4 '@syn-ui/utils': workspace:^1.0.0 buffer: ^6.0.3 typescript: ^4.2.4 devDependencies: '@ctx-core/function': 17.4.8 - '@ctx-core/object': 17.5.13 - '@ctx-core/store': 24.5.8 - '@holochain/conductor-api': 0.0.3 + '@ctx-core/object': 17.5.15 + '@ctx-core/store': 24.5.9 + '@holochain/conductor-api': 0.0.4 '@syn-ui/utils': link:../utils buffer: 6.0.3 typescript: 4.2.4 @@ -206,23 +212,23 @@ packages: /@babel/code-frame/7.12.13: resolution: {integrity: sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==} dependencies: - '@babel/highlight': 7.13.10 + '@babel/highlight': 7.14.0 dev: true - /@babel/helper-validator-identifier/7.12.11: - resolution: {integrity: sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==} + /@babel/helper-validator-identifier/7.14.0: + resolution: {integrity: sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==} dev: true - /@babel/highlight/7.13.10: - resolution: {integrity: sha512-5aPpe5XQPzflQrFwL1/QoeHkP2MsA4JCntcXHRhEsdsfPVkvPi2w7Qix4iV7t5S/oC9OodGrggd8aco1g3SZFg==} + /@babel/highlight/7.14.0: + resolution: {integrity: sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==} dependencies: - '@babel/helper-validator-identifier': 7.12.11 + '@babel/helper-validator-identifier': 7.14.0 chalk: 2.4.2 js-tokens: 4.0.0 dev: true - /@babel/runtime/7.13.17: - resolution: {integrity: sha512-NCdgJEelPTSh+FEFylhnP1ylq848l1z9t9N0j1Lfbcw0+KXGjsTvUmkxy+voLLXB5SOKMbLLx4jxYliGrYQseA==} + /@babel/runtime/7.14.0: + resolution: {integrity: sha512-JELkvo/DlpNdJ7dlyw/eY7E0suy5i5GQH+Vlxaq1nsNJ+H7f4Vtv3jMeCEgRhZZQFXTjldYfQgv2qmM6M1v5wA==} dependencies: regenerator-runtime: 0.13.7 dev: true @@ -230,7 +236,7 @@ packages: /@changesets/apply-release-plan/5.0.0: resolution: {integrity: sha512-SE+5nPNSKUyUociPnAvnjYSVF+diciEhX9ZHSqKWMlydswCDjiaq9gz67qwWCmwgEgEOz0TS7VrQBoOlzbitvA==} dependencies: - '@babel/runtime': 7.13.17 + '@babel/runtime': 7.14.0 '@changesets/config': 1.6.0 '@changesets/get-version-range-type': 0.3.2 '@changesets/git': 1.1.1 @@ -248,7 +254,7 @@ packages: /@changesets/assemble-release-plan/5.0.0: resolution: {integrity: sha512-LElDXTCBUkPSmdXlCisoUWw2paX48snatBmw/hKnGiSvnyZqdTIylLojAGQWG0/vOO9v3s/DvJ4hdagIquxJjg==} dependencies: - '@babel/runtime': 7.13.17 + '@babel/runtime': 7.14.0 '@changesets/errors': 0.1.4 '@changesets/get-dependents-graph': 1.2.1 '@changesets/types': 4.0.0 @@ -260,7 +266,7 @@ packages: resolution: {integrity: sha512-VFkXSyyk/WRjjUoBI7g7cDy09qBjPbBQOloPMEshTzMo/NY9muWHl2yB/FSSkV/6PxGimPtJ7aEJPYfk8HCfXw==} hasBin: true dependencies: - '@babel/runtime': 7.13.17 + '@babel/runtime': 7.14.0 '@changesets/apply-release-plan': 5.0.0 '@changesets/assemble-release-plan': 5.0.0 '@changesets/config': 1.6.0 @@ -323,7 +329,7 @@ packages: /@changesets/get-release-plan/3.0.0: resolution: {integrity: sha512-7VLiqpcWZyjwIXYgkubBC/9cdwqUJEhLMRT9/Y9+ctHqrpsXmJg15QQPTOh3HT9yGN5fJPL1WwuZkc1HXUhK0g==} dependencies: - '@babel/runtime': 7.13.17 + '@babel/runtime': 7.14.0 '@changesets/assemble-release-plan': 5.0.0 '@changesets/config': 1.6.0 '@changesets/pre': 1.0.6 @@ -339,7 +345,7 @@ packages: /@changesets/git/1.1.1: resolution: {integrity: sha512-Z12TcKwgU33YE3r76cyU+X81RchOXljDZ5s3G2u0Zd+ODyrwlDb91IO55+6R0Ha6ouPz8ioont0gA70c1RFngg==} dependencies: - '@babel/runtime': 7.13.17 + '@babel/runtime': 7.14.0 '@changesets/errors': 0.1.4 '@changesets/types': 4.0.0 '@manypkg/get-packages': 1.1.1 @@ -363,7 +369,7 @@ packages: /@changesets/pre/1.0.6: resolution: {integrity: sha512-ZwFFQLjhTmA4hj8+Cf9pm6nD9Tp+AiBz1wJLaGum4Ae1fPXMwDnJfHknFUTytqZBlC0gHkiGSj6QkUuetWvckg==} dependencies: - '@babel/runtime': 7.13.17 + '@babel/runtime': 7.14.0 '@changesets/errors': 0.1.4 '@changesets/types': 4.0.0 '@manypkg/get-packages': 1.1.1 @@ -373,7 +379,7 @@ packages: /@changesets/read/0.4.7: resolution: {integrity: sha512-E70QrYQpSCMF0nC0dlPU7i6A9zht+8zkQczrKMbOUwDVrfidcvgojxfuJSQbzptYSb9OKYh8GOLd+bsq9+uO9Q==} dependencies: - '@babel/runtime': 7.13.17 + '@babel/runtime': 7.14.0 '@changesets/git': 1.1.1 '@changesets/logger': 0.0.5 '@changesets/parse': 0.3.8 @@ -390,38 +396,45 @@ packages: /@changesets/write/0.1.4: resolution: {integrity: sha512-uco+vS3mo2JqflLciIU707har+6AEFOeP8pgu3vVC1M2WcKukQgR1KylHFqZJxKQWahf8mQnuUSbgR4yJQuhmA==} dependencies: - '@babel/runtime': 7.13.17 + '@babel/runtime': 7.14.0 '@changesets/types': 4.0.0 fs-extra: 7.0.1 human-id: 1.0.2 prettier: 1.19.1 dev: true - /@ctx-core/array/20.2.15: - resolution: {integrity: sha512-5O3LUlAdPYmhGMNNRYCexV9EvCQJg0qbVTUos1zsz9XjnLe4as50nRiyd/eXwovtsA4Qo7cNgvFVNxFgmlonfQ==} + /@concordance/react/2.0.0: + resolution: {integrity: sha512-huLSkUuM2/P+U0uy2WwlKuixMsTODD8p4JVQBI4VKeopkiN0C7M3N9XYVawb4M+4spN5RrO/eLhk7KoQX6nsfA==} + engines: {node: '>=6.12.3 <7 || >=8.9.4 <9 || >=10.0.0'} + dependencies: + arrify: 1.0.1 + dev: true + + /@ctx-core/array/20.2.18: + resolution: {integrity: sha512-PjZK6iWxXrx2pxGKPYX5Qs/pwW5Wo2c/Rx5VPavKOiZQ++VWt+Uk3VfnwgS5R8A60yWi45zx6vdhFYkNB/xFcA==} dependencies: '@ctx-core/combinators': 6.0.10 '@ctx-core/function': 17.4.8 - '@ctx-core/object': 17.5.13 + '@ctx-core/object': 17.5.15 '@ctx-core/set': 9.0.20 dev: true - /@ctx-core/cli-args/7.2.25: - resolution: {integrity: sha512-B7k/aybFB88hKmjfZ3d2es5sDfFtqLOVEW1e5DaPdJfOc4s1/9K07TRT7Cxuac5NwlZUguA+OEyQXG+bbRttwA==} + /@ctx-core/cli-args/7.2.27: + resolution: {integrity: sha512-xH5FDMnw+VD5rtLbFjOrNn2lgX3bPTXeh/2YyLTw/STxa+QjeUgKTlftxLDD5ZiGnfVtkuIXLbQX2G/ghZLfMQ==} dependencies: - '@ctx-core/array': 20.2.15 + '@ctx-core/array': 20.2.18 '@ctx-core/function': 17.4.8 - '@ctx-core/object': 17.5.13 + '@ctx-core/object': 17.5.15 dev: true /@ctx-core/combinators/6.0.10: resolution: {integrity: sha512-l16FC/IsyfTOffJkRq5kZSgfnjNa8Wz7m0HpyGQu6//fcePpOvFL+HuQvXgnsMREF6DiayW03QXdStk1kCDBjw==} - /@ctx-core/ctx-core-package-tools/6.0.48: - resolution: {integrity: sha512-VtQKqt1SHoTBtNSBjJZyO9V0hQjvd6NN5mBpzBdoADNcyEJ6UMKGKsHfV6M2Sr2FbUM+bV2saicMJ3hzCKWWwQ==} + /@ctx-core/ctx-core-package-tools/6.0.49: + resolution: {integrity: sha512-AWvTxUL0ZEjlGjU+Ye546oLbFqqvwTzy+bEJmUxsNVgKeAGtKZNfd0hY5+QStHqf7bD10A6V4NM4CgcI7f9VJA==} hasBin: true dependencies: - '@ctx-core/array': 20.2.15 + '@ctx-core/array': 20.2.18 dev: true /@ctx-core/function/17.4.8: @@ -432,19 +445,19 @@ packages: resolution: {integrity: sha512-4wGPtDyY8sEeR3uh01thHA4DdCIexqvCBD5SJPWlPYeA2qrj/BAzd7JNuAZRrouJCkWthf5W1kUxArAQkgsNXQ==} hasBin: true dependencies: - '@ctx-core/cli-args': 7.2.25 + '@ctx-core/cli-args': 7.2.27 '@ctx-core/queue': 3.0.10 esm: 3.2.25 globby: 11.0.3 dev: true - /@ctx-core/monorepo/15.0.55: - resolution: {integrity: sha512-mJxvMK4JerYPqzRIgItdmwbWbT9FIGI7Z7Ct7msIKGNwm+I0YKe3h3KwH7Ay4AorFHe/hM5AH92c7/MtFfpELQ==} + /@ctx-core/monorepo/15.0.56: + resolution: {integrity: sha512-6/HYAUhrw1OrYnRFH6x5uMhlkJiQy0W5OJ3sOY2gikfiullhmre+r0NLytHnGaHZgXVkwWcRyi1eLqr7t3R/IA==} hasBin: true dependencies: - '@ctx-core/array': 20.2.15 - '@ctx-core/cli-args': 7.2.25 - '@ctx-core/ctx-core-package-tools': 6.0.48 + '@ctx-core/array': 20.2.18 + '@ctx-core/cli-args': 7.2.27 + '@ctx-core/ctx-core-package-tools': 6.0.49 '@ctx-core/package': 6.1.21 '@ctx-core/queue': 3.0.10 detect-indent: 6.0.0 @@ -454,8 +467,8 @@ packages: semver: 7.3.5 dev: true - /@ctx-core/object/17.5.13: - resolution: {integrity: sha512-FUeqxZAj/XKH3m2cr/YZv21PJFyMebEWoUddYXQLk6vgEe8pL7BgXqE3gHSwu3SN/V70LkRI9XquqtEwNvkuSw==} + /@ctx-core/object/17.5.15: + resolution: {integrity: sha512-Y1RhOn79IofjzCeav+QKUpRa5LdkQSrX6Lct8mxPkHP+FSWxDcnLqD+EouwesaqKN9nh7p8+gI4d/EmERaR4MQ==} dependencies: '@ctx-core/function': 17.4.8 dev: true @@ -464,7 +477,7 @@ packages: resolution: {integrity: sha512-1LAU/w/BEA+Og4nMNNZqL8DULgFUUHYdFn8xkKsiD6XE2tqBmjpeI8NliBz2a5rP9VGRReix0q1vjanCc4lY/g==} hasBin: true dependencies: - '@ctx-core/cli-args': 7.2.25 + '@ctx-core/cli-args': 7.2.27 esm: 3.2.25 resolve: 1.20.0 dev: true @@ -488,13 +501,13 @@ packages: '@ctx-core/function': 17.4.8 dev: true - /@ctx-core/store/24.5.8: - resolution: {integrity: sha512-rTUxxR5DLymZPUaX+RXnWeXUCCown1WVhrCEMC8WWTRAoH08Avc25S5ovIWLxHODrzftcow8ou/REWo3r75fEQ==} + /@ctx-core/store/24.5.9: + resolution: {integrity: sha512-N+AKLLWOfXXf1Okk1EbfGHak5nHTuIxERNIvTcjk4TfksEcz6UpyU+AyZ6i0aGyQkFuBVlM5gSti5PTn3UXeEg==} dependencies: - '@ctx-core/array': 20.2.15 + '@ctx-core/array': 20.2.18 '@ctx-core/combinators': 6.0.10 '@ctx-core/function': 17.4.8 - '@ctx-core/object': 17.5.13 + '@ctx-core/object': 17.5.15 svelte: 3.37.0 dev: true @@ -517,6 +530,19 @@ packages: transitivePeerDependencies: - bufferutil - utf-8-validate + dev: true + + /@holochain/conductor-api/0.0.4: + resolution: {integrity: sha512-s52H+JMtiWID8wsqkKVkbjNDrHeVD88X+XWEllIi9INc7md2nBkMKBVChc/qgpRFqrpj2X8j/Es9MtvIJYnQqg==} + dependencies: + '@msgpack/msgpack': 2.4.0 + '@types/ws': 7.4.2 + isomorphic-ws: 4.0.1_ws@7.4.5 + nanoid: 3.1.22 + ws: 7.4.5 + transitivePeerDependencies: + - bufferutil + - utf-8-validate /@holochain/hachiko/0.5.2: resolution: {integrity: sha512-w6Aca1HPTenVzqT0rAgRch+FZwGri0EvbAK6ETKV+ZAP+dxPBlQqUgTCrbv2AuwFTU/mobYXniaFlrrAtEnXjQ==} @@ -561,7 +587,7 @@ packages: /@manypkg/find-root/1.1.0: resolution: {integrity: sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==} dependencies: - '@babel/runtime': 7.13.17 + '@babel/runtime': 7.14.0 '@types/node': 12.20.11 find-up: 4.1.0 fs-extra: 8.1.0 @@ -570,7 +596,7 @@ packages: /@manypkg/get-packages/1.1.1: resolution: {integrity: sha512-J6VClfQSVgR6958eIDTGjfdCrELy1eT+SHeoSMomnvRQVktZMnEA5edIr5ovRFNw5y+Bk/jyoevPzGYod96mhw==} dependencies: - '@babel/runtime': 7.13.17 + '@babel/runtime': 7.14.0 '@manypkg/find-root': 1.1.0 fs-extra: 8.1.0 globby: 11.0.3 @@ -611,48 +637,48 @@ packages: resolution: {integrity: sha512-6RglhutqrGFMO1MNUXp95RBuYIuc8wTnMAV5MUhLmjTOy78ncwOw7RgeQ/HeymkKXRhZd0s2DNrM1rL7unk3MQ==} dev: false - /@rollup/plugin-commonjs/18.0.0_rollup@2.45.2: + /@rollup/plugin-commonjs/18.0.0_rollup@2.46.0: resolution: {integrity: sha512-fj92shhg8luw7XbA0HowAqz90oo7qtLGwqTKbyZ8pmOyH8ui5e+u0wPEgeHLH3djcVma6gUCUrjY6w5R2o1u6g==} engines: {node: '>= 8.0.0'} peerDependencies: rollup: ^2.30.0 dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.45.2 + '@rollup/pluginutils': 3.1.0_rollup@2.46.0 commondir: 1.0.1 estree-walker: 2.0.2 glob: 7.1.6 is-reference: 1.2.1 magic-string: 0.25.7 resolve: 1.20.0 - rollup: 2.45.2 + rollup: 2.46.0 dev: true - /@rollup/plugin-node-resolve/11.2.1_rollup@2.45.2: + /@rollup/plugin-node-resolve/11.2.1_rollup@2.46.0: resolution: {integrity: sha512-yc2n43jcqVyGE2sqV5/YCmocy9ArjVAP/BeXyTtADTBBX6V0e5UMqwO8CdQ0kzjb6zu5P1qMzsScCMRvE9OlVg==} engines: {node: '>= 10.0.0'} peerDependencies: rollup: ^1.20.0||^2.0.0 dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.45.2 + '@rollup/pluginutils': 3.1.0_rollup@2.46.0 '@types/resolve': 1.17.1 builtin-modules: 3.2.0 deepmerge: 4.2.2 is-module: 1.0.0 resolve: 1.20.0 - rollup: 2.45.2 + rollup: 2.46.0 dev: true - /@rollup/plugin-replace/2.4.2_rollup@2.45.2: + /@rollup/plugin-replace/2.4.2_rollup@2.46.0: resolution: {integrity: sha512-IGcu+cydlUMZ5En85jxHH4qj2hta/11BHq95iHEyb2sbgiN0eCdzvUcHw5gt9pBL5lTi4JDYJ1acCoMGpTvEZg==} peerDependencies: rollup: ^1.20.0 || ^2.0.0 dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.45.2 + '@rollup/pluginutils': 3.1.0_rollup@2.46.0 magic-string: 0.25.7 - rollup: 2.45.2 + rollup: 2.46.0 dev: true - /@rollup/plugin-typescript/8.2.1_d21869dc49fccc93d6599238c3a50ee6: + /@rollup/plugin-typescript/8.2.1_a3b54be422ec682aa2c1673acc2ace22: resolution: {integrity: sha512-Qd2E1pleDR4bwyFxqbjt4eJf+wB0UKVMLc7/BAFDGVdAXQMCsD4DUv5/7/ww47BZCYxWtJqe1Lo0KVNswBJlRw==} engines: {node: '>=8.0.0'} peerDependencies: @@ -660,14 +686,14 @@ packages: tslib: '*' typescript: '>=3.7.0' dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.45.2 + '@rollup/pluginutils': 3.1.0_rollup@2.46.0 resolve: 1.20.0 - rollup: 2.45.2 + rollup: 2.46.0 tslib: 2.2.0 typescript: 4.2.4 dev: true - /@rollup/plugin-typescript/8.2.1_rollup@2.45.2+typescript@4.2.4: + /@rollup/plugin-typescript/8.2.1_rollup@2.46.0+typescript@4.2.4: resolution: {integrity: sha512-Qd2E1pleDR4bwyFxqbjt4eJf+wB0UKVMLc7/BAFDGVdAXQMCsD4DUv5/7/ww47BZCYxWtJqe1Lo0KVNswBJlRw==} engines: {node: '>=8.0.0'} peerDependencies: @@ -675,13 +701,13 @@ packages: tslib: '*' typescript: '>=3.7.0' dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.45.2 + '@rollup/pluginutils': 3.1.0_rollup@2.46.0 resolve: 1.20.0 - rollup: 2.45.2 + rollup: 2.46.0 typescript: 4.2.4 dev: true - /@rollup/pluginutils/3.1.0_rollup@2.45.2: + /@rollup/pluginutils/3.1.0_rollup@2.46.0: resolution: {integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==} engines: {node: '>= 8.0.0'} peerDependencies: @@ -690,10 +716,10 @@ packages: '@types/estree': 0.0.39 estree-walker: 1.0.1 picomatch: 2.2.3 - rollup: 2.45.2 + rollup: 2.46.0 dev: true - /@rollup/pluginutils/4.1.0_rollup@2.45.2: + /@rollup/pluginutils/4.1.0_rollup@2.46.0: resolution: {integrity: sha512-TrBhfJkFxA+ER+ew2U2/fHbebhLT/l/2pRk0hfj9KusXUuRXd2v0R58AfaZK9VXDQ4TogOSEmICVrQAA3zFnHQ==} engines: {node: '>= 8.0.0'} peerDependencies: @@ -701,7 +727,19 @@ packages: dependencies: estree-walker: 2.0.2 picomatch: 2.2.3 - rollup: 2.45.2 + rollup: 2.46.0 + dev: true + + /@sindresorhus/is/0.14.0: + resolution: {integrity: sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==} + engines: {node: '>=6'} + dev: true + + /@szmarczak/http-timer/1.1.2: + resolution: {integrity: sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==} + engines: {node: '>=6'} + dependencies: + defer-to-connect: 1.1.3 dev: true /@tsconfig/svelte/1.0.10: @@ -764,12 +802,37 @@ packages: dependencies: '@types/node': 15.0.1 + /acorn-walk/8.1.0: + resolution: {integrity: sha512-mjmzmv12YIG/G8JQdQuz2MUDShEJ6teYpT5bmWA4q7iwoGen8xtt3twF3OvzIUl+Q06aWIjvnwQUKvQ6TtMRjg==} + engines: {node: '>=0.4.0'} + dev: true + + /acorn/8.2.2: + resolution: {integrity: sha512-VrMS8kxT0e7J1EX0p6rI/E0FbfOVcvBpbIqHThFv+f8YrZIlMfVotYcXKVPmTvPW8sW5miJzfUFrrvthUZg8VQ==} + engines: {node: '>=0.4.0'} + hasBin: true + dev: true + + /aggregate-error/3.1.0: + resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==} + engines: {node: '>=8'} + dependencies: + clean-stack: 2.2.0 + indent-string: 4.0.0 + dev: true + /ansi-align/2.0.0: resolution: {integrity: sha1-w2rsy6VjuJzrVW82kPCx2eNUf38=} dependencies: string-width: 2.1.1 dev: true + /ansi-align/3.0.0: + resolution: {integrity: sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw==} + dependencies: + string-width: 3.1.0 + dev: true + /ansi-colors/4.1.1: resolution: {integrity: sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==} engines: {node: '>=6'} @@ -780,6 +843,11 @@ packages: engines: {node: '>=4'} dev: true + /ansi-regex/4.1.0: + resolution: {integrity: sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==} + engines: {node: '>=6'} + dev: true + /ansi-regex/5.0.0: resolution: {integrity: sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==} engines: {node: '>=8'} @@ -799,6 +867,11 @@ packages: color-convert: 2.0.1 dev: true + /ansi-styles/5.2.0: + resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} + engines: {node: '>=10'} + dev: true + /anymatch/3.1.2: resolution: {integrity: sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==} engines: {node: '>= 8'} @@ -825,16 +898,31 @@ packages: resolution: {integrity: sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=} dev: false + /array-find-index/1.0.2: + resolution: {integrity: sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=} + engines: {node: '>=0.10.0'} + dev: true + /array-union/2.1.0: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} dev: true + /arrgv/1.0.2: + resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} + engines: {node: '>=8.0.0'} + dev: true + /arrify/1.0.1: resolution: {integrity: sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=} engines: {node: '>=0.10.0'} dev: true + /arrify/2.0.1: + resolution: {integrity: sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==} + engines: {node: '>=8'} + dev: true + /assert-args/1.2.1: resolution: {integrity: sha1-QEEDoUUqMv53iYgR5U5ZCoqTc70=} dependencies: @@ -846,6 +934,11 @@ packages: is-class: 0.0.4 dev: true + /astral-regex/2.0.0: + resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} + engines: {node: '>=8'} + dev: true + /async-limiter/1.0.1: resolution: {integrity: sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==} dev: true @@ -858,6 +951,71 @@ packages: resolution: {integrity: sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==} dev: true + /ava/3.15.0: + resolution: {integrity: sha512-HGAnk1SHPk4Sx6plFAUkzV/XC1j9+iQhOzt4vBly18/yo0AV8Oytx7mtJd/CR8igCJ5p160N/Oo/cNJi2uSeWA==} + engines: {node: '>=10.18.0 <11 || >=12.14.0 <12.17.0 || >=12.17.0 <13 || >=14.0.0 <15 || >=15'} + hasBin: true + dependencies: + '@concordance/react': 2.0.0 + acorn: 8.2.2 + acorn-walk: 8.1.0 + ansi-styles: 5.2.0 + arrgv: 1.0.2 + arrify: 2.0.1 + callsites: 3.1.0 + chalk: 4.1.1 + chokidar: 3.5.1 + chunkd: 2.0.1 + ci-info: 2.0.0 + ci-parallel-vars: 1.0.1 + clean-yaml-object: 0.1.0 + cli-cursor: 3.1.0 + cli-truncate: 2.1.0 + code-excerpt: 3.0.0 + common-path-prefix: 3.0.0 + concordance: 5.0.4 + convert-source-map: 1.7.0 + currently-unhandled: 0.4.1 + debug: 4.3.1 + del: 6.0.0 + emittery: 0.8.1 + equal-length: 1.0.1 + figures: 3.2.0 + globby: 11.0.3 + ignore-by-default: 2.0.0 + import-local: 3.0.2 + indent-string: 4.0.0 + is-error: 2.2.2 + is-plain-object: 5.0.0 + is-promise: 4.0.0 + lodash: 4.17.21 + matcher: 3.0.0 + md5-hex: 3.0.1 + mem: 8.1.1 + ms: 2.1.3 + ora: 5.4.0 + p-event: 4.2.0 + p-map: 4.0.0 + picomatch: 2.2.3 + pkg-conf: 3.1.0 + plur: 4.0.0 + pretty-ms: 7.0.1 + read-pkg: 5.2.0 + resolve-cwd: 3.0.0 + slash: 3.0.0 + source-map-support: 0.5.19 + stack-utils: 2.0.3 + strip-ansi: 6.0.0 + supertap: 2.0.0 + temp-dir: 2.0.0 + trim-off-newlines: 1.0.1 + update-notifier: 5.1.0 + write-file-atomic: 3.0.3 + yargs: 16.2.0 + transitivePeerDependencies: + - supports-color + dev: true + /available-typed-arrays/1.0.2: resolution: {integrity: sha512-XWX3OX8Onv97LMk/ftVyBibpGwY5a8SmuxZPzeOxqmuEqUCOM9ZE+uIaD1VNJ5QnvU2UQusvmKbuM1FR8QWGfQ==} engines: {node: '>= 0.4'} @@ -910,6 +1068,10 @@ packages: readable-stream: 3.6.0 dev: true + /blueimp-md5/2.18.0: + resolution: {integrity: sha512-vE52okJvzsVWhcgUHOv+69OG3Mdg151xyn41aVQN/5W5S+S43qZhxECtYLAEHMSFWX6Mv5IZrzj3T5+JqXfj5Q==} + dev: true + /boxen/1.3.0: resolution: {integrity: sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw==} engines: {node: '>=4'} @@ -923,6 +1085,20 @@ packages: widest-line: 2.0.1 dev: true + /boxen/5.0.1: + resolution: {integrity: sha512-49VBlw+PrWEF51aCmy7QIteYPIFZxSpvqBdP/2itCPPlJ49kj9zg/XPRFrdkne2W+CfwXUls8exMvu1RysZpKA==} + engines: {node: '>=10'} + dependencies: + ansi-align: 3.0.0 + camelcase: 6.2.0 + chalk: 4.1.1 + cli-boxes: 2.2.1 + string-width: 4.2.2 + type-fest: 0.20.2 + widest-line: 3.1.0 + wrap-ansi: 7.0.0 + dev: true + /brace-expansion/1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} dependencies: @@ -964,6 +1140,19 @@ packages: engines: {node: '>=6'} dev: true + /cacheable-request/6.1.0: + resolution: {integrity: sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==} + engines: {node: '>=8'} + dependencies: + clone-response: 1.0.2 + get-stream: 5.2.0 + http-cache-semantics: 4.1.0 + keyv: 3.1.0 + lowercase-keys: 2.0.0 + normalize-url: 4.5.0 + responselike: 1.0.2 + dev: true + /call-bind/1.0.2: resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==} dependencies: @@ -995,6 +1184,11 @@ packages: engines: {node: '>=6'} dev: true + /camelcase/6.2.0: + resolution: {integrity: sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==} + engines: {node: '>=10'} + dev: true + /chalk/2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} engines: {node: '>=4'} @@ -1039,20 +1233,43 @@ packages: fsevents: 2.3.2 dev: true + /chunkd/2.0.1: + resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} + dev: true + /ci-info/2.0.0: resolution: {integrity: sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==} dev: true + /ci-parallel-vars/1.0.1: + resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} + dev: true + /circular-json/0.5.9: resolution: {integrity: sha512-4ivwqHpIFJZBuhN3g/pEcdbnGUywkBblloGbkglyloVjjR3uT6tieI89MVOfbP2tHX5sgb01FuLgAOzebNlJNQ==} deprecated: CircularJSON is in maintenance only, flatted is its successor. dev: true + /clean-stack/2.2.0: + resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==} + engines: {node: '>=6'} + dev: true + + /clean-yaml-object/0.1.0: + resolution: {integrity: sha1-Y/sRDcLOGoTcIfbZM0h20BCui2g=} + engines: {node: '>=0.10.0'} + dev: true + /cli-boxes/1.0.0: resolution: {integrity: sha1-T6kXw+WclKAEzWH47lCdplFocUM=} engines: {node: '>=0.10.0'} dev: true + /cli-boxes/2.2.1: + resolution: {integrity: sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==} + engines: {node: '>=6'} + dev: true + /cli-cursor/3.1.0: resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} engines: {node: '>=8'} @@ -1065,6 +1282,14 @@ packages: engines: {node: '>=6'} dev: true + /cli-truncate/2.1.0: + resolution: {integrity: sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==} + engines: {node: '>=8'} + dependencies: + slice-ansi: 3.0.0 + string-width: 4.2.2 + dev: true + /cliui/6.0.0: resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==} dependencies: @@ -1073,11 +1298,32 @@ packages: wrap-ansi: 6.2.0 dev: true + /cliui/7.0.4: + resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} + dependencies: + string-width: 4.2.2 + strip-ansi: 6.0.0 + wrap-ansi: 7.0.0 + dev: true + + /clone-response/1.0.2: + resolution: {integrity: sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=} + dependencies: + mimic-response: 1.0.1 + dev: true + /clone/1.0.4: resolution: {integrity: sha1-2jCcwmPfFZlMaIypAheco8fNfH4=} engines: {node: '>=0.8'} dev: true + /code-excerpt/3.0.0: + resolution: {integrity: sha512-VHNTVhd7KsLGOqfX3SyeO8RyYPMp1GJOg194VITk04WMYCv4plV68YWe6TJZxd9MhobjtpMRnVky01gqZsalaw==} + engines: {node: '>=10'} + dependencies: + convert-to-spaces: 1.0.2 + dev: true + /color-convert/1.9.3: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} dependencies: @@ -1129,6 +1375,10 @@ packages: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} dev: true + /common-path-prefix/3.0.0: + resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} + dev: true + /commondir/1.0.1: resolution: {integrity: sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=} dev: true @@ -1140,14 +1390,51 @@ packages: /concat-map/0.0.1: resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=} + /concordance/5.0.4: + resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} + engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} + dependencies: + date-time: 3.1.0 + esutils: 2.0.3 + fast-diff: 1.2.0 + js-string-escape: 1.0.1 + lodash: 4.17.21 + md5-hex: 3.0.1 + semver: 7.3.5 + well-known-symbols: 2.0.0 + dev: true + + /configstore/5.0.1: + resolution: {integrity: sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==} + engines: {node: '>=8'} + dependencies: + dot-prop: 5.3.0 + graceful-fs: 4.2.6 + make-dir: 3.1.0 + unique-string: 2.0.0 + write-file-atomic: 3.0.3 + xdg-basedir: 4.0.0 + dev: true + /console-clear/1.1.1: resolution: {integrity: sha512-pMD+MVR538ipqkG5JXeOEbKWS5um1H4LUUccUQG68qpeqBYbzYy79Gh55jkd2TtPdRfUaLWdv6LPP//5Zt0aPQ==} engines: {node: '>=4'} dev: false + /convert-source-map/1.7.0: + resolution: {integrity: sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==} + dependencies: + safe-buffer: 5.1.2 + dev: true + + /convert-to-spaces/1.0.2: + resolution: {integrity: sha1-fj5Iu+bZl7FBfdyihoIEtNPYVxU=} + engines: {node: '>= 4'} + dev: true + /core-js/2.6.12: resolution: {integrity: sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==} - deprecated: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3. + deprecated: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js. requiresBuild: true dev: true @@ -1167,6 +1454,11 @@ packages: which: 1.3.1 dev: true + /crypto-random-string/2.0.0: + resolution: {integrity: sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==} + engines: {node: '>=8'} + dev: true + /csv-generate/3.4.0: resolution: {integrity: sha512-D6yi7c6lL70cpTx3TQIVWKrfxuLiKa0pBizu0zi7fSRXlhmE7u674gk9k1IjCEnxKq2t6xzbXnxcOmSdBbE8vQ==} dev: true @@ -1189,6 +1481,13 @@ packages: stream-transform: 2.1.0 dev: true + /currently-unhandled/0.4.1: + resolution: {integrity: sha1-mI3zP+qxke95mmE2nddsF635V+o=} + engines: {node: '>=0.10.0'} + dependencies: + array-find-index: 1.0.2 + dev: true + /cycle/1.0.3: resolution: {integrity: sha1-IegLK+hYD5i0aPN5QwZisEbDStI=} engines: {node: '>=0.4.0'} @@ -1201,6 +1500,13 @@ packages: type: 1.2.0 dev: true + /date-time/3.1.0: + resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} + engines: {node: '>=6'} + dependencies: + time-zone: 1.0.0 + dev: true + /debug/2.6.9: resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} dependencies: @@ -1213,6 +1519,18 @@ packages: ms: 2.0.0 dev: true + /debug/4.3.1: + resolution: {integrity: sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.2 + dev: true + /decamelize-keys/1.1.0: resolution: {integrity: sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=} engines: {node: '>=0.10.0'} @@ -1226,6 +1544,13 @@ packages: engines: {node: '>=0.10.0'} dev: true + /decompress-response/3.3.0: + resolution: {integrity: sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=} + engines: {node: '>=4'} + dependencies: + mimic-response: 1.0.1 + dev: true + /deep-eql/0.1.3: resolution: {integrity: sha1-71WKyrjeJSBs1xOQbXTlaTDrafI=} dependencies: @@ -1252,6 +1577,11 @@ packages: which-typed-array: 1.1.4 dev: false + /deep-extend/0.6.0: + resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} + engines: {node: '>=4.0.0'} + dev: true + /deepmerge/4.2.2: resolution: {integrity: sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==} engines: {node: '>=0.10.0'} @@ -1263,6 +1593,10 @@ packages: clone: 1.0.4 dev: true + /defer-to-connect/1.1.3: + resolution: {integrity: sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==} + dev: true + /define-properties/1.1.3: resolution: {integrity: sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==} engines: {node: '>= 0.4'} @@ -1274,6 +1608,20 @@ packages: resolution: {integrity: sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=} dev: false + /del/6.0.0: + resolution: {integrity: sha512-1shh9DQ23L16oXSZKB2JxpL7iMy2E0S9d517ptA1P8iw0alkPtQcrKH7ru31rYtKwF499HkTu+DRzq3TCKDFRQ==} + engines: {node: '>=10'} + dependencies: + globby: 11.0.3 + graceful-fs: 4.2.6 + is-glob: 4.0.1 + is-path-cwd: 2.2.0 + is-path-inside: 3.0.3 + p-map: 4.0.0 + rimraf: 3.0.2 + slash: 3.0.0 + dev: true + /detect-indent/6.0.0: resolution: {integrity: sha512-oSyFlqaTHCItVRGK5RmrmjB+CmaMOW7IaNA/kdxqhoa6d17j/5ce9O9eWXmV/KEdRwqpQA+Vqe8a8Bsybu4YnA==} engines: {node: '>=8'} @@ -1291,6 +1639,13 @@ packages: path-type: 4.0.0 dev: true + /dot-prop/5.3.0: + resolution: {integrity: sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==} + engines: {node: '>=8'} + dependencies: + is-obj: 2.0.0 + dev: true + /dotignore/0.1.2: resolution: {integrity: sha512-UGGGWfSauusaVJC+8fgV+NVvBXkCTmVv7sk6nojDZZvuOUNGUy0Zk4UpHQD6EDjS0jpBwcACvH4eofvyzBcRDw==} hasBin: true @@ -1298,6 +1653,19 @@ packages: minimatch: 3.0.4 dev: false + /duplexer3/0.1.4: + resolution: {integrity: sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=} + dev: true + + /emittery/0.8.1: + resolution: {integrity: sha512-uDfvUjVrfGJJhymx/kz6prltenw1u7WrCg1oa94zYY8xxVpLLUu045LAT0dhDZdXG58/EpPL/5kA180fQ/qudg==} + engines: {node: '>=10'} + dev: true + + /emoji-regex/7.0.3: + resolution: {integrity: sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==} + dev: true + /emoji-regex/8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} dev: true @@ -1306,6 +1674,12 @@ packages: resolution: {integrity: sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==} dev: true + /end-of-stream/1.4.4: + resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} + dependencies: + once: 1.4.0 + dev: true + /enquirer/2.3.6: resolution: {integrity: sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==} engines: {node: '>=8.6'} @@ -1313,6 +1687,11 @@ packages: ansi-colors: 4.1.1 dev: true + /equal-length/1.0.1: + resolution: {integrity: sha1-IcoRLUirJLTh5//A5TOdMf38J0w=} + engines: {node: '>=4'} + dev: true + /error-ex/1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} dependencies: @@ -1395,11 +1774,31 @@ packages: es6-symbol: 3.1.3 dev: true + /escalade/3.1.1: + resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} + engines: {node: '>=6'} + dev: true + + /escape-goat/2.1.1: + resolution: {integrity: sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==} + engines: {node: '>=8'} + dev: true + /escape-string-regexp/1.0.5: resolution: {integrity: sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=} engines: {node: '>=0.8.0'} dev: true + /escape-string-regexp/2.0.0: + resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} + engines: {node: '>=8'} + dev: true + + /escape-string-regexp/4.0.0: + resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} + engines: {node: '>=10'} + dev: true + /esm/3.2.25: resolution: {integrity: sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==} engines: {node: '>=6'} @@ -1422,6 +1821,11 @@ packages: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} dev: true + /esutils/2.0.3: + resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} + engines: {node: '>=0.10.0'} + dev: true + /event-emitter/0.3.5: resolution: {integrity: sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=} dependencies: @@ -1465,6 +1869,10 @@ packages: tmp: 0.0.33 dev: true + /fast-diff/1.2.0: + resolution: {integrity: sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==} + dev: true + /fast-glob/3.2.5: resolution: {integrity: sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==} engines: {node: '>=8'} @@ -1495,6 +1903,13 @@ packages: resolution: {integrity: sha512-MMMQ0ludy/nBs1/o0zVOiKTpG7qMbonKUzjJgQFEuvq6INZ1OraKPRAWkBq5vlKLOUMpmNYG1JoN3oDPUQ9m3Q==} dev: true + /figures/3.2.0: + resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==} + engines: {node: '>=8'} + dependencies: + escape-string-regexp: 1.0.5 + dev: true + /fill-range/7.0.1: resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} engines: {node: '>=8'} @@ -1502,6 +1917,13 @@ packages: to-regex-range: 5.0.1 dev: true + /find-up/3.0.0: + resolution: {integrity: sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==} + engines: {node: '>=6'} + dependencies: + locate-path: 3.0.0 + dev: true + /find-up/4.1.0: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} engines: {node: '>=8'} @@ -1613,6 +2035,20 @@ packages: engines: {node: '>=4'} dev: true + /get-stream/4.1.0: + resolution: {integrity: sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==} + engines: {node: '>=6'} + dependencies: + pump: 3.0.0 + dev: true + + /get-stream/5.2.0: + resolution: {integrity: sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==} + engines: {node: '>=8'} + dependencies: + pump: 3.0.0 + dev: true + /glob-parent/5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} @@ -1630,6 +2066,13 @@ packages: once: 1.4.0 path-is-absolute: 1.0.1 + /global-dirs/3.0.0: + resolution: {integrity: sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA==} + engines: {node: '>=10'} + dependencies: + ini: 2.0.0 + dev: true + /globby/11.0.3: resolution: {integrity: sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg==} engines: {node: '>=10'} @@ -1642,6 +2085,23 @@ packages: slash: 3.0.0 dev: true + /got/9.6.0: + resolution: {integrity: sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==} + engines: {node: '>=8.6'} + dependencies: + '@sindresorhus/is': 0.14.0 + '@szmarczak/http-timer': 1.1.2 + cacheable-request: 6.1.0 + decompress-response: 3.3.0 + duplexer3: 0.1.4 + get-stream: 4.1.0 + lowercase-keys: 1.0.1 + mimic-response: 1.0.1 + p-cancelable: 1.1.0 + to-readable-stream: 1.0.0 + url-parse-lax: 3.0.0 + dev: true + /graceful-fs/4.2.6: resolution: {integrity: sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==} dev: true @@ -1674,6 +2134,11 @@ packages: engines: {node: '>= 0.4'} dev: false + /has-yarn/2.1.0: + resolution: {integrity: sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==} + engines: {node: '>=8'} + dev: true + /has/1.0.3: resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} engines: {node: '>= 0.4.0'} @@ -1684,6 +2149,10 @@ packages: resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} dev: true + /http-cache-semantics/4.1.0: + resolution: {integrity: sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==} + dev: true + /human-id/1.0.2: resolution: {integrity: sha512-UNopramDEhHJD+VR+ehk8rOslwSfByxPIZyJRfV739NDhN5LF1fa1MqnzKm2lGTQRjNrjK19Q5fhkgIfjlVUKw==} dev: true @@ -1699,6 +2168,11 @@ packages: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} dev: true + /ignore-by-default/2.0.0: + resolution: {integrity: sha512-+mQSgMRiFD3L3AOxLYOCxjIq4OnAmo5CIuC+lj5ehCJcPtV++QacEV7FdpzvYxH6DaOySWzQU6RR0lPLy37ckA==} + engines: {node: '>=10 <11 || >=12 <13 || >=14'} + dev: true + /ignore/5.1.8: resolution: {integrity: sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==} engines: {node: '>= 4'} @@ -1712,12 +2186,31 @@ packages: resolve-from: 4.0.0 dev: true - /indent-string/4.0.0: - resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} - engines: {node: '>=8'} + /import-lazy/2.1.0: + resolution: {integrity: sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=} + engines: {node: '>=4'} dev: true - /inflight/1.0.6: + /import-local/3.0.2: + resolution: {integrity: sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA==} + engines: {node: '>=8'} + hasBin: true + dependencies: + pkg-dir: 4.2.0 + resolve-cwd: 3.0.0 + dev: true + + /imurmurhash/0.1.4: + resolution: {integrity: sha1-khi5srkoojixPcT7a21XbyMUU+o=} + engines: {node: '>=0.8.19'} + dev: true + + /indent-string/4.0.0: + resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} + engines: {node: '>=8'} + dev: true + + /inflight/1.0.6: resolution: {integrity: sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=} dependencies: once: 1.4.0 @@ -1726,6 +2219,15 @@ packages: /inherits/2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + /ini/1.3.8: + resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} + dev: true + + /ini/2.0.0: + resolution: {integrity: sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==} + engines: {node: '>=10'} + dev: true + /io-ts-reporters/1.2.2_fp-ts@2.10.4+io-ts@2.2.16: resolution: {integrity: sha512-igASwWWkDY757OutNcM6zTtdJf/eTZYkoe2ymsX2qpm5bKZLo74FJYjsCtMQOEdY7dRHLLEulCyFQwdN69GBCg==} peerDependencies: @@ -1744,6 +2246,11 @@ packages: fp-ts: 2.10.4 dev: true + /irregular-plurals/3.3.0: + resolution: {integrity: sha512-MVBLKUTangM3EfRPFROhmWQQKRDsrgI83J8GS3jXy+OwYqiR2/aoWndYQ5416jLE3uaGgLH7ncme3X9y09gZ3g==} + engines: {node: '>=8'} + dev: true + /is-arguments/1.1.0: resolution: {integrity: sha512-1Ij4lOMPl/xB5kBDn7I+b2ttPMKa8szhEIrXDuXQD/oe3HJLTLhqhgGspwgyGd6MOywBUqVvYicF72lkgDnIHg==} engines: {node: '>= 0.4'} @@ -1807,6 +2314,10 @@ packages: engines: {node: '>= 0.4'} dev: false + /is-error/2.2.2: + resolution: {integrity: sha512-IOQqts/aHWbiisY5DuPJQ0gcbvaLFCa7fBa9xoLfxBZvQ+ZI/Zh9xoI7Gk+G64N0FdK4AbibytHht2tWgpJWLg==} + dev: true + /is-extglob/2.1.1: resolution: {integrity: sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=} engines: {node: '>=0.10.0'} @@ -1829,6 +2340,14 @@ packages: is-extglob: 2.1.1 dev: true + /is-installed-globally/0.4.0: + resolution: {integrity: sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==} + engines: {node: '>=10'} + dependencies: + global-dirs: 3.0.0 + is-path-inside: 3.0.3 + dev: true + /is-interactive/1.0.0: resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} engines: {node: '>=8'} @@ -1847,6 +2366,11 @@ packages: engines: {node: '>= 0.4'} dev: false + /is-npm/5.0.0: + resolution: {integrity: sha512-WW/rQLOazUq+ST/bCAVBp/2oMERWLsR7OrKyt052dNDk4DHcDE0/7QSXITlmi+VBcV13DfIbysG3tZJm5RfdBA==} + engines: {node: '>=10'} + dev: true + /is-number-object/1.0.4: resolution: {integrity: sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw==} engines: {node: '>= 0.4'} @@ -1857,15 +2381,39 @@ packages: engines: {node: '>=0.12.0'} dev: true + /is-obj/2.0.0: + resolution: {integrity: sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==} + engines: {node: '>=8'} + dev: true + + /is-path-cwd/2.2.0: + resolution: {integrity: sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==} + engines: {node: '>=6'} + dev: true + + /is-path-inside/3.0.3: + resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} + engines: {node: '>=8'} + dev: true + /is-plain-obj/1.1.0: resolution: {integrity: sha1-caUMhCnfync8kqOQpKA7OfzVHT4=} engines: {node: '>=0.10.0'} dev: true + /is-plain-object/5.0.0: + resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} + engines: {node: '>=0.10.0'} + dev: true + /is-promise/2.2.2: resolution: {integrity: sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==} dev: true + /is-promise/4.0.0: + resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} + dev: true + /is-reference/1.2.1: resolution: {integrity: sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==} dependencies: @@ -1924,6 +2472,10 @@ packages: has-symbols: 1.0.2 dev: false + /is-typedarray/1.0.0: + resolution: {integrity: sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=} + dev: true + /is-unicode-supported/0.1.0: resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} engines: {node: '>=10'} @@ -1942,6 +2494,10 @@ packages: engines: {node: '>=0.10.0'} dev: true + /is-yarn-global/0.3.0: + resolution: {integrity: sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==} + dev: true + /isarray/1.0.0: resolution: {integrity: sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=} dev: true @@ -1970,6 +2526,11 @@ packages: supports-color: 7.2.0 dev: true + /js-string-escape/1.0.1: + resolution: {integrity: sha1-4mJbrbwNZ8dTPp7cEGjFh65BN+8=} + engines: {node: '>= 0.8'} + dev: true + /js-tokens/4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} dev: true @@ -1989,6 +2550,14 @@ packages: argparse: 2.0.1 dev: true + /json-buffer/3.0.0: + resolution: {integrity: sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=} + dev: true + + /json-parse-better-errors/1.0.2: + resolution: {integrity: sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==} + dev: true + /json-parse-even-better-errors/2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} dev: true @@ -2005,6 +2574,12 @@ packages: '101': 1.6.3 dev: true + /keyv/3.1.0: + resolution: {integrity: sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==} + dependencies: + json-buffer: 3.0.0 + dev: true + /kind-of/6.0.3: resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} engines: {node: '>=0.10.0'} @@ -2019,6 +2594,13 @@ packages: resolution: {integrity: sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==} dev: true + /latest-version/5.1.0: + resolution: {integrity: sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==} + engines: {node: '>=8'} + dependencies: + package-json: 6.5.0 + dev: true + /lines-and-columns/1.1.6: resolution: {integrity: sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=} dev: true @@ -2041,6 +2623,17 @@ packages: - utf-8-validate dev: true + /load-json-file/5.3.0: + resolution: {integrity: sha512-cJGP40Jc/VXUsp8/OrnyKyTZ1y6v/dphm3bioS+RrKXjK2BB6wHUd6JptZEFDGgGahMT+InnZO5i1Ei9mpC8Bw==} + engines: {node: '>=6'} + dependencies: + graceful-fs: 4.2.6 + parse-json: 4.0.0 + pify: 4.0.1 + strip-bom: 3.0.0 + type-fest: 0.3.1 + dev: true + /load-yaml-file/0.2.0: resolution: {integrity: sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw==} engines: {node: '>=6'} @@ -2056,6 +2649,14 @@ packages: engines: {node: '>=6'} dev: false + /locate-path/3.0.0: + resolution: {integrity: sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==} + engines: {node: '>=6'} + dependencies: + p-locate: 3.0.0 + path-exists: 3.0.0 + dev: true + /locate-path/5.0.0: resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} engines: {node: '>=8'} @@ -2105,6 +2706,16 @@ packages: triple-beam: 1.3.0 dev: true + /lowercase-keys/1.0.1: + resolution: {integrity: sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==} + engines: {node: '>=0.10.0'} + dev: true + + /lowercase-keys/2.0.0: + resolution: {integrity: sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==} + engines: {node: '>=8'} + dev: true + /lru-cache/4.1.5: resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==} dependencies: @@ -2131,10 +2742,24 @@ packages: sourcemap-codec: 1.4.8 dev: true + /make-dir/3.1.0: + resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} + engines: {node: '>=8'} + dependencies: + semver: 6.3.0 + dev: true + /make-error/1.3.6: resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} dev: false + /map-age-cleaner/0.1.3: + resolution: {integrity: sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==} + engines: {node: '>=6'} + dependencies: + p-defer: 1.0.0 + dev: true + /map-obj/1.0.1: resolution: {integrity: sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=} engines: {node: '>=0.10.0'} @@ -2145,6 +2770,28 @@ packages: engines: {node: '>=8'} dev: true + /matcher/3.0.0: + resolution: {integrity: sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==} + engines: {node: '>=10'} + dependencies: + escape-string-regexp: 4.0.0 + dev: true + + /md5-hex/3.0.1: + resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} + engines: {node: '>=8'} + dependencies: + blueimp-md5: 2.18.0 + dev: true + + /mem/8.1.1: + resolution: {integrity: sha512-qFCFUDs7U3b8mBDPyz5EToEKoAkgCzqquIgi9nkkR9bixxOVOre+09lbuH7+9Kn2NFpm56M3GUWVbU2hQgdACA==} + engines: {node: '>=10'} + dependencies: + map-age-cleaner: 0.1.3 + mimic-fn: 3.1.0 + dev: true + /memoizee/0.4.15: resolution: {integrity: sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ==} dependencies: @@ -2203,6 +2850,16 @@ packages: engines: {node: '>=6'} dev: true + /mimic-fn/3.1.0: + resolution: {integrity: sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ==} + engines: {node: '>=8'} + dev: true + + /mimic-response/1.0.1: + resolution: {integrity: sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==} + engines: {node: '>=4'} + dev: true + /min-indent/1.0.1: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} @@ -2239,6 +2896,10 @@ packages: resolution: {integrity: sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=} dev: true + /ms/2.1.2: + resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} + dev: true + /ms/2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} dev: true @@ -2270,6 +2931,11 @@ packages: engines: {node: '>=0.10.0'} dev: true + /normalize-url/4.5.0: + resolution: {integrity: sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==} + engines: {node: '>=8'} + dev: true + /npm-run-path/2.0.2: resolution: {integrity: sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=} engines: {node: '>=4'} @@ -2350,6 +3016,23 @@ packages: resolution: {integrity: sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q==} dev: true + /p-cancelable/1.1.0: + resolution: {integrity: sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==} + engines: {node: '>=6'} + dev: true + + /p-defer/1.0.0: + resolution: {integrity: sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=} + engines: {node: '>=4'} + dev: true + + /p-event/4.2.0: + resolution: {integrity: sha512-KXatOjCRXXkSePPb1Nbi0p0m+gQAwdlbhi4wQKJPI1HsMQS9g+Sqp2o+QHziPr7eYJyOZet836KoHEVM1mwOrQ==} + engines: {node: '>=8'} + dependencies: + p-timeout: 3.2.0 + dev: true + /p-filter/2.1.0: resolution: {integrity: sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw==} engines: {node: '>=8'} @@ -2376,6 +3059,13 @@ packages: yocto-queue: 0.1.0 dev: true + /p-locate/3.0.0: + resolution: {integrity: sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==} + engines: {node: '>=6'} + dependencies: + p-limit: 2.3.0 + dev: true + /p-locate/4.1.0: resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} engines: {node: '>=8'} @@ -2395,11 +3085,35 @@ packages: engines: {node: '>=6'} dev: true + /p-map/4.0.0: + resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==} + engines: {node: '>=10'} + dependencies: + aggregate-error: 3.1.0 + dev: true + + /p-timeout/3.2.0: + resolution: {integrity: sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==} + engines: {node: '>=8'} + dependencies: + p-finally: 1.0.0 + dev: true + /p-try/2.2.0: resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} engines: {node: '>=6'} dev: true + /package-json/6.5.0: + resolution: {integrity: sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==} + engines: {node: '>=8'} + dependencies: + got: 9.6.0 + registry-auth-token: 4.2.1 + registry-url: 5.1.0 + semver: 6.3.0 + dev: true + /parent-module/1.0.1: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} @@ -2407,6 +3121,14 @@ packages: callsites: 3.1.0 dev: true + /parse-json/4.0.0: + resolution: {integrity: sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=} + engines: {node: '>=4'} + dependencies: + error-ex: 1.3.2 + json-parse-better-errors: 1.0.2 + dev: true + /parse-json/5.2.0: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} @@ -2417,6 +3139,16 @@ packages: lines-and-columns: 1.1.6 dev: true + /parse-ms/2.1.0: + resolution: {integrity: sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA==} + engines: {node: '>=6'} + dev: true + + /path-exists/3.0.0: + resolution: {integrity: sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=} + engines: {node: '>=4'} + dev: true + /path-exists/4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} @@ -2449,6 +3181,14 @@ packages: engines: {node: '>=6'} dev: true + /pkg-conf/3.1.0: + resolution: {integrity: sha512-m0OTbR/5VPNPqO1ph6Fqbj7Hv6QU7gR/tQW40ZqrL1rjgCU85W6C1bJn0BItuJqnR98PWzw7Z8hHeChD1WrgdQ==} + engines: {node: '>=6'} + dependencies: + find-up: 3.0.0 + load-json-file: 5.3.0 + dev: true + /pkg-dir/4.2.0: resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} engines: {node: '>=8'} @@ -2456,6 +3196,13 @@ packages: find-up: 4.1.0 dev: true + /plur/4.0.0: + resolution: {integrity: sha512-4UGewrYgqDFw9vV6zNV+ADmPAUAfJPKtGvb/VdpQAx25X5f3xXdGdyOEVFwkl8Hl/tl7+xbeHqSEM+D5/TirUg==} + engines: {node: '>=10'} + dependencies: + irregular-plurals: 3.3.0 + dev: true + /pnpm/6.2.3: resolution: {integrity: sha512-qYRrxYyN14tqeMGu7E3P+INXDiYbGojn5mitVfUxidO9OsSnTGSqT85nkslfKW8YfChlzFVN0XdG+1Tj86tKhA==} engines: {node: '>=12.17'} @@ -2472,12 +3219,24 @@ packages: which-pm: 2.0.0 dev: true + /prepend-http/2.0.0: + resolution: {integrity: sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=} + engines: {node: '>=4'} + dev: true + /prettier/1.19.1: resolution: {integrity: sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==} engines: {node: '>=4'} hasBin: true dev: true + /pretty-ms/7.0.1: + resolution: {integrity: sha512-973driJZvxiGOQ5ONsFhOF/DtzPMOMtgC11kCpUrPGMTgqp2q/1gwzCquocrN33is0VZ5GFHXZYMM9l6h67v2Q==} + engines: {node: '>=10'} + dependencies: + parse-ms: 2.1.0 + dev: true + /process-nextick-args/2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} dev: true @@ -2486,6 +3245,20 @@ packages: resolution: {integrity: sha1-8FKijacOYYkX7wqKw0wa5aaChrM=} dev: true + /pump/3.0.0: + resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==} + dependencies: + end-of-stream: 1.4.4 + once: 1.4.0 + dev: true + + /pupa/2.1.1: + resolution: {integrity: sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A==} + engines: {node: '>=8'} + dependencies: + escape-goat: 2.1.1 + dev: true + /queue-microtask/1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} dev: true @@ -2505,6 +3278,16 @@ packages: safe-buffer: 5.2.1 dev: true + /rc/1.2.8: + resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} + hasBin: true + dependencies: + deep-extend: 0.6.0 + ini: 1.3.8 + minimist: 1.2.5 + strip-json-comments: 2.0.1 + dev: true + /read-pkg-up/7.0.1: resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==} engines: {node: '>=8'} @@ -2586,6 +3369,20 @@ packages: define-properties: 1.1.3 dev: false + /registry-auth-token/4.2.1: + resolution: {integrity: sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw==} + engines: {node: '>=6.0.0'} + dependencies: + rc: 1.2.8 + dev: true + + /registry-url/5.1.0: + resolution: {integrity: sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==} + engines: {node: '>=8'} + dependencies: + rc: 1.2.8 + dev: true + /require-directory/2.1.1: resolution: {integrity: sha1-jGStX9MNqxyXbiNE/+f3kqam30I=} engines: {node: '>=0.10.0'} @@ -2599,6 +3396,13 @@ packages: resolution: {integrity: sha1-eZlTn8ngR6N5KPoZb44VY9q9Nt4=} dev: true + /resolve-cwd/3.0.0: + resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} + engines: {node: '>=8'} + dependencies: + resolve-from: 5.0.0 + dev: true + /resolve-from/4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} @@ -2623,6 +3427,12 @@ packages: path-parse: 1.0.6 dev: false + /responselike/1.0.2: + resolution: {integrity: sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=} + dependencies: + lowercase-keys: 1.0.1 + dev: true + /restore-cursor/3.1.0: resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} engines: {node: '>=8'} @@ -2642,14 +3452,21 @@ packages: engines: {iojs: '>=1.0.0', node: '>=0.10.0'} dev: true - /rollup-plugin-css-only/3.1.0_rollup@2.45.2: + /rimraf/3.0.2: + resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + hasBin: true + dependencies: + glob: 7.1.6 + dev: true + + /rollup-plugin-css-only/3.1.0_rollup@2.46.0: resolution: {integrity: sha512-TYMOE5uoD76vpj+RTkQLzC9cQtbnJNktHPB507FzRWBVaofg7KhIqq1kGbcVOadARSozWF883Ho9KpSPKH8gqA==} engines: {node: '>=10.12.0'} peerDependencies: rollup: 1 || 2 dependencies: - '@rollup/pluginutils': 4.1.0_rollup@2.45.2 - rollup: 2.45.2 + '@rollup/pluginutils': 4.1.0_rollup@2.46.0 + rollup: 2.46.0 dev: true /rollup-plugin-inject/3.0.2: @@ -2677,7 +3494,7 @@ packages: rollup-plugin-inject: 3.0.2 dev: true - /rollup-plugin-svelte/7.1.0_rollup@2.45.2+svelte@3.37.0: + /rollup-plugin-svelte/7.1.0_rollup@2.46.0+svelte@3.37.0: resolution: {integrity: sha512-vopCUq3G+25sKjwF5VilIbiY6KCuMNHP1PFvx2Vr3REBNMDllKHFZN2B9jwwC+MqNc3UPKkjXnceLPEjTjXGXg==} engines: {node: '>=10'} peerDependencies: @@ -2685,19 +3502,19 @@ packages: svelte: '>=3.5.0' dependencies: require-relative: 0.8.7 - rollup: 2.45.2 + rollup: 2.46.0 rollup-pluginutils: 2.8.2 svelte: 3.37.0 dev: true - /rollup-plugin-terser/7.0.2_rollup@2.45.2: + /rollup-plugin-terser/7.0.2_rollup@2.46.0: resolution: {integrity: sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==} peerDependencies: rollup: ^2.0.0 dependencies: '@babel/code-frame': 7.12.13 jest-worker: 26.6.2 - rollup: 2.45.2 + rollup: 2.46.0 serialize-javascript: 4.0.0 terser: 5.7.0 dev: true @@ -2708,8 +3525,8 @@ packages: estree-walker: 0.6.1 dev: true - /rollup/2.45.2: - resolution: {integrity: sha512-kRRU7wXzFHUzBIv0GfoFFIN3m9oteY4uAsKllIpQDId5cfnkWF2J130l+27dzDju0E6MScKiV0ZM5Bw8m4blYQ==} + /rollup/2.46.0: + resolution: {integrity: sha512-qPGoUBNl+Z8uNu0z7pD3WPTABWRbcOwIrO/5ccDJzmrtzn0LVf6Lj91+L5CcWhXl6iWf23FQ6m8Jkl2CmN1O7Q==} engines: {node: '>=10.0.0'} hasBin: true optionalDependencies: @@ -2719,7 +3536,7 @@ packages: /rpc-websockets/4.6.1: resolution: {integrity: sha512-xyQC6+95hOFQJBuMRIYi2E3/ddKEMMKuql5Sd49r4578CcthP0N9nHHFkVtvrsAgz4OQH6j7zsLurLNY0nOU6g==} dependencies: - '@babel/runtime': 7.13.17 + '@babel/runtime': 7.14.0 assert-args: 1.2.1 babel-runtime: 6.26.0 circular-json: 0.5.9 @@ -2758,11 +3575,23 @@ packages: engines: {node: '>=6'} dev: false + /semver-diff/3.1.1: + resolution: {integrity: sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==} + engines: {node: '>=8'} + dependencies: + semver: 6.3.0 + dev: true + /semver/5.7.1: resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==} hasBin: true dev: true + /semver/6.3.0: + resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==} + hasBin: true + dev: true + /semver/7.3.5: resolution: {integrity: sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==} engines: {node: '>=10'} @@ -2771,6 +3600,13 @@ packages: lru-cache: 6.0.0 dev: true + /serialize-error/7.0.1: + resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} + engines: {node: '>=10'} + dependencies: + type-fest: 0.13.1 + dev: true + /serialize-javascript/4.0.0: resolution: {integrity: sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==} dependencies: @@ -2840,6 +3676,15 @@ packages: engines: {node: '>=8'} dev: true + /slice-ansi/3.0.0: + resolution: {integrity: sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==} + engines: {node: '>=8'} + dependencies: + ansi-styles: 4.3.0 + astral-regex: 2.0.0 + is-fullwidth-code-point: 3.0.0 + dev: true + /smartwrap/1.2.5: resolution: {integrity: sha512-bzWRwHwu0RnWjwU7dFy7tF68pDAx/zMSu3g7xr9Nx5J0iSImYInglwEVExyHLxXljy6PWMjkSAbwF7t2mPnRmg==} deprecated: Backported compatibility to node > 6 @@ -2908,6 +3753,13 @@ packages: resolution: {integrity: sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=} dev: true + /stack-utils/2.0.3: + resolution: {integrity: sha512-gL//fkxfWUsIlFL2Tl42Cl6+HFALEaB1FU76I/Fy+oZjRreP7OPMXFlGbxM7NQsI0ZpUfw76sHnv0WNYuTb7Iw==} + engines: {node: '>=10'} + dependencies: + escape-string-regexp: 2.0.0 + dev: true + /stream-transform/2.1.0: resolution: {integrity: sha512-bwQO+75rzQbug7e5OOHnOR3FgbJ0fCjHmDIdynkwUaFzleBXugGmv2dx3sX3aIHUQRLjrcisRPgN9BWl63uGgw==} dependencies: @@ -2922,6 +3774,15 @@ packages: strip-ansi: 4.0.0 dev: true + /string-width/3.1.0: + resolution: {integrity: sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==} + engines: {node: '>=6'} + dependencies: + emoji-regex: 7.0.3 + is-fullwidth-code-point: 2.0.0 + strip-ansi: 5.2.0 + dev: true + /string-width/4.2.2: resolution: {integrity: sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==} engines: {node: '>=8'} @@ -2973,6 +3834,13 @@ packages: ansi-regex: 3.0.0 dev: true + /strip-ansi/5.2.0: + resolution: {integrity: sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==} + engines: {node: '>=6'} + dependencies: + ansi-regex: 4.1.0 + dev: true + /strip-ansi/6.0.0: resolution: {integrity: sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==} engines: {node: '>=8'} @@ -2997,6 +3865,22 @@ packages: min-indent: 1.0.1 dev: true + /strip-json-comments/2.0.1: + resolution: {integrity: sha1-PFMZQukIwml8DsNEhYwobHygpgo=} + engines: {node: '>=0.10.0'} + dev: true + + /supertap/2.0.0: + resolution: {integrity: sha512-jRzcXlCeDYvKoZGA5oRhYyR3jUIYu0enkSxtmAgHRlD7HwrovTpH4bDSi0py9FtuA8si9cW/fKommJHuaoDHJA==} + engines: {node: '>=10'} + dependencies: + arrify: 2.0.1 + indent-string: 4.0.0 + js-yaml: 3.14.1 + serialize-error: 7.0.1 + strip-ansi: 6.0.0 + dev: true + /supports-color/5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} engines: {node: '>=4'} @@ -3120,6 +4004,11 @@ packages: through: 2.3.8 dev: false + /temp-dir/2.0.0: + resolution: {integrity: sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg==} + engines: {node: '>=8'} + dev: true + /term-size/1.2.0: resolution: {integrity: sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=} engines: {node: '>=4'} @@ -3150,6 +4039,11 @@ packages: resolution: {integrity: sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=} dev: false + /time-zone/1.0.0: + resolution: {integrity: sha1-mcW/VZWJZq9tBtg73zgA3IL67F0=} + engines: {node: '>=4'} + dev: true + /timers-ext/0.1.7: resolution: {integrity: sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==} dependencies: @@ -3169,6 +4063,11 @@ packages: os-tmpdir: 1.0.2 dev: true + /to-readable-stream/1.0.0: + resolution: {integrity: sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==} + engines: {node: '>=6'} + dev: true + /to-regex-range/5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} @@ -3186,6 +4085,11 @@ packages: engines: {node: '>=8'} dev: true + /trim-off-newlines/1.0.1: + resolution: {integrity: sha1-n5up2e+odkw4dpi8v+sshI8RrbM=} + engines: {node: '>=0.10.0'} + dev: true + /triple-beam/1.3.0: resolution: {integrity: sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==} dev: true @@ -3232,6 +4136,16 @@ packages: engines: {node: '>=10'} dev: true + /type-fest/0.20.2: + resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} + engines: {node: '>=10'} + dev: true + + /type-fest/0.3.1: + resolution: {integrity: sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==} + engines: {node: '>=6'} + dev: true + /type-fest/0.6.0: resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==} engines: {node: '>=8'} @@ -3250,6 +4164,12 @@ packages: resolution: {integrity: sha512-180WMDQaIMm3+7hGXWf12GtdniDEy7nYcyFMKJn/eZz/6tSLXrUN9V0wKSbMjej0I1WHWbpREDEKHtqPQa9NNw==} dev: true + /typedarray-to-buffer/3.1.5: + resolution: {integrity: sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==} + dependencies: + is-typedarray: 1.0.0 + dev: true + /typescript/4.2.4: resolution: {integrity: sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==} engines: {node: '>=4.2.0'} @@ -3264,11 +4184,45 @@ packages: which-boxed-primitive: 1.0.2 dev: false + /unique-string/2.0.0: + resolution: {integrity: sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==} + engines: {node: '>=8'} + dependencies: + crypto-random-string: 2.0.0 + dev: true + /universalify/0.1.2: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} engines: {node: '>= 4.0.0'} dev: true + /update-notifier/5.1.0: + resolution: {integrity: sha512-ItnICHbeMh9GqUy31hFPrD1kcuZ3rpxDZbf4KUDavXwS0bW5m7SLbDQpGX3UYr072cbrF5hFUs3r5tUsPwjfHw==} + engines: {node: '>=10'} + dependencies: + boxen: 5.0.1 + chalk: 4.1.1 + configstore: 5.0.1 + has-yarn: 2.1.0 + import-lazy: 2.1.0 + is-ci: 2.0.0 + is-installed-globally: 0.4.0 + is-npm: 5.0.0 + is-yarn-global: 0.3.0 + latest-version: 5.1.0 + pupa: 2.1.1 + semver: 7.3.5 + semver-diff: 3.1.1 + xdg-basedir: 4.0.0 + dev: true + + /url-parse-lax/3.0.0: + resolution: {integrity: sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=} + engines: {node: '>=4'} + dependencies: + prepend-http: 2.0.0 + dev: true + /util-deprecate/1.0.2: resolution: {integrity: sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=} dev: true @@ -3302,6 +4256,11 @@ packages: defaults: 1.0.3 dev: true + /well-known-symbols/2.0.0: + resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} + engines: {node: '>=6'} + dev: true + /which-boxed-primitive/1.0.2: resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} dependencies: @@ -3360,6 +4319,13 @@ packages: string-width: 2.1.1 dev: true + /widest-line/3.1.0: + resolution: {integrity: sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==} + engines: {node: '>=8'} + dependencies: + string-width: 4.2.2 + dev: true + /winston-compat/0.1.5: resolution: {integrity: sha512-EPvPcHT604AV3Ji6d3+vX8ENKIml9VSxMRnPQ+cuK/FX6f3hvPP2hxyoeeCOCFvDrJEujalfcKWlWPvAnFyS9g==} engines: {node: '>= 6.4.0'} @@ -3413,9 +4379,27 @@ packages: strip-ansi: 6.0.0 dev: true + /wrap-ansi/7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.2 + strip-ansi: 6.0.0 + dev: true + /wrappy/1.0.2: resolution: {integrity: sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=} + /write-file-atomic/3.0.3: + resolution: {integrity: sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==} + dependencies: + imurmurhash: 0.1.4 + is-typedarray: 1.0.0 + signal-exit: 3.0.3 + typedarray-to-buffer: 3.1.5 + dev: true + /ws/5.2.2: resolution: {integrity: sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==} dependencies: @@ -3434,10 +4418,20 @@ packages: utf-8-validate: optional: true + /xdg-basedir/4.0.0: + resolution: {integrity: sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==} + engines: {node: '>=8'} + dev: true + /y18n/4.0.3: resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} dev: true + /y18n/5.0.8: + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} + engines: {node: '>=10'} + dev: true + /yallist/2.1.2: resolution: {integrity: sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=} dev: true @@ -3459,6 +4453,11 @@ packages: decamelize: 1.2.0 dev: true + /yargs-parser/20.2.7: + resolution: {integrity: sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw==} + engines: {node: '>=10'} + dev: true + /yargs/15.4.1: resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==} engines: {node: '>=8'} @@ -3476,6 +4475,19 @@ packages: yargs-parser: 18.1.3 dev: true + /yargs/16.2.0: + resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} + engines: {node: '>=10'} + dependencies: + cliui: 7.0.4 + escalade: 3.1.1 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.2 + y18n: 5.0.8 + yargs-parser: 20.2.7 + dev: true + /yn/3.1.1: resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} engines: {node: '>=6'} diff --git a/tests/.gitignore b/tests/.gitignore new file mode 100644 index 00000000..a6c7c285 --- /dev/null +++ b/tests/.gitignore @@ -0,0 +1 @@ +*.js diff --git a/tests/package.json b/tests/package.json index 9e7ccede..3c8ff756 100644 --- a/tests/package.json +++ b/tests/package.json @@ -19,12 +19,15 @@ "uuidv4": "^6.2.7" }, "devDependencies": { - "@holochain/conductor-api": "0.0.3", + "@ctx-core/combinators": "^6.0.10", + "@ctx-core/store": "^24.5.9", + "@holochain/conductor-api": "0.0.4", "@holochain/tryorama": "0.4.2", "@syn-ui/model": "workspace:^1.0.0", "@syn-ui/utils": "workspace:^1.0.0", "@syn-ui/zome-client": "workspace:^1.0.0", "@types/lodash": "^4.14.168", - "@types/node": "^15.0.1" + "@types/node": "^15.0.1", + "ava": "^3.15.0" } } \ No newline at end of file diff --git a/tests/syn-lib/index.ts b/tests/syn-lib/index.ts index c2762b11..5bed510f 100644 --- a/tests/syn-lib/index.ts +++ b/tests/syn-lib/index.ts @@ -1,2 +1,3 @@ +require = require('esm')(module) export * from './main' export * from './syn-lib' diff --git a/tests/syn-lib/syn-lib.ts b/tests/syn-lib/syn-lib.ts index e0c46b09..e48df543 100644 --- a/tests/syn-lib/syn-lib.ts +++ b/tests/syn-lib/syn-lib.ts @@ -47,13 +47,13 @@ export const oFn = (orchestrator)=>{ await s.shareAllNodes([player1, player2]) const appPort1:number = player1._conductor.app_ws.client.socket._url.split(':')[2] const appPort2:number = player2._conductor.app_ws.client.socket._url.split(':')[2] - const c1 = join_session({ + const c1 = await join_session({ app_port: appPort1, app_id: syn1.hAppId, }) // const c1 = new Connection({}, appPort1, syn1.hAppId) // await c1.open(default_content, applyDeltas) // await c1.joinSession() - const c2 = join_session({ + const c2 = await join_session({ app_port: appPort2, app_id: syn2.hAppId, }) // const c2 = new Connection({}, appPort2, syn2.hAppId) diff --git a/tests/unit-test/index.ts b/tests/unit-test/index.ts index 14b94195..2c4e745d 100644 --- a/tests/unit-test/index.ts +++ b/tests/unit-test/index.ts @@ -1,3 +1,4 @@ +require = require('esm')(module) import { Orchestrator } from '@holochain/tryorama' const orchestrator = new Orchestrator() diff --git a/tests/unit-test/syn.ts b/tests/unit-test/syn.ts index ad7c6c6e..deb510c5 100644 --- a/tests/unit-test/syn.ts +++ b/tests/unit-test/syn.ts @@ -1,8 +1,17 @@ +import path from 'path' import { Config, InstallAgentsHapps } from '@holochain/tryorama' import { delay } from '@holochain/tryorama/lib/util' -import path from 'path' -import { Delta, Signal } from '@syn-ui/zome-client' -import { content_b, run_apply_delta_b, session_info_b } from '@syn-ui/model' +import { _neq } from '@ctx-core/function' +import { I } from '@ctx-core/combinators' +import { derived$, subscribe_wait_timeout, writable$ } from '@ctx-core/store' +import { bufferToBase64, EntryHash } from '@syn-ui/utils' +import { content_b, apply_deltas_b, session_info_b, join_session, leave_session } from '@syn-ui/model' +import { + Commit, Content, Delta, my_tag_b, rpc_commit_b, rpc_get_content_b, rpc_get_folks_b, rpc_get_session_b, + rpc_get_sessions_b, rpc_hash_content_b, rpc_send_change_b, rpc_send_change_request_b, rpc_send_folk_lore_b, + rpc_send_heartbeat_b, rpc_send_sync_request_b, rpc_send_sync_response_b, Signal, StateForSync +} from '@syn-ui/zome-client' +import { AgentPubKey } from '@holochain/conductor-api' const config = Config.gen() @@ -12,7 +21,7 @@ console.log(dna) const installation:InstallAgentsHapps = [ // one agents - [[dna]], // contains 1 dna + [[dna]], // contains 1 dnaT ] process.on('unhandledRejection', error=>{ @@ -31,8 +40,6 @@ module.exports = (orchestrator)=>{ const [[me_happ]] = await me_player.installAgentsHapps(installation) const [[alice_happ]] = await alice_player.installAgentsHapps(installation) const [[bob_happ]] = await bob_player.installAgentsHapps(installation) - const me_ctx = {}, alice_ctx = {}, bob_ctx = {} - await s.shareAllNodes([me_player, alice_player, bob_player]) const me = me_happ.cells[0] @@ -41,242 +48,335 @@ module.exports = (orchestrator)=>{ const me_pubkey = me.cellId[1] const alice_pubkey = alice.cellId[1] + const alice_pubkey_base64 = bufferToBase64(alice_pubkey) const bob_pubkey = bob.cellId[1] + const bob_pubkey_base64 = bufferToBase64(bob_pubkey) - let sessions = await me.call('syn', 'get_sessions') + let sessions:EntryHash[] = await me.call('syn', 'get_sessions') t.equal(sessions.length, 0) + const me_port:number = parseInt(me_player._conductor.appClient.client.socket.url.split(':')[2]) + const alice_port:number = parseInt(alice_player._conductor.appClient.client.socket.url.split(':')[2]) + const bob_port:number = parseInt(bob_player._conductor.appClient.client.socket.url.split(':')[2]) - // create initial session - const $session_info = await me.call('syn', 'new_session', { content: { title: '', body: '' } }) - const session_info = session_info_b(me_ctx) - session_info.$ = $session_info - // I created the session, so I should be the scribe - t.deepEqual($session_info.scribe, me_pubkey) - // First ever session so content should be default content - t.deepEqual($session_info.snapshot_content, { title: '', body: '' }) - let sessionHash = $session_info.session - - // check the hash_content zome call. - let hash = await me.call('syn', 'hash_content', $session_info.snapshot_content) - t.deepEqual($session_info.content_hash, hash) - - // check get_sessions utility zome call - sessions = await me.call('syn', 'get_sessions') - t.equal(sessions.length, 1) - t.deepEqual(sessions[0], sessionHash) - - // exercise the get_session zome call - const returnedSessionInfo = await me.call('syn', 'get_session', sessionHash) - t.equal(sessions.length, 1) - t.deepEqual($session_info, returnedSessionInfo) - - // check that initial snapshot was created by using the get_content zome call - const returned_content = await me.call('syn', 'get_content', $session_info.content_hash) - t.deepEqual(returned_content, $session_info.snapshot_content) - - // set up the pending deltas array - let pending_deltas:Delta[] = [{ type: 'Title', value: 'foo title' }, { type: 'Add', value: [0, 'bar content'] }] - - apply_deltas(me_ctx, pending_deltas) - const me_content = content_b(me_ctx) - const new_content_hash_1 = await me.call('syn', 'hash_content', me_content.$) - - let deltas = jsonDeltas ? pending_deltas.map(d=>JSON.stringify(d)) : pending_deltas - - // set signal handlers so we can confirm they get sent and received appropriately - let me_signals:Signal[] = [] - me_player.setSignalHandler((signal)=>{ - console.log('Received Signal for me:', signal) - me_signals.push(signal.data.payload) - }) - - // alice signal handler - let alice_signals:Signal[] = [] - alice_player.setSignalHandler((signal)=>{ - console.log('Received Signal for alice:', signal) - alice_signals.push(signal.data.payload) - }) - - // bob signal handler - let bob_signals:Signal[] = [] - bob_player.setSignalHandler((signal)=>{ - console.log('Received Signal for bob:', signal) - bob_signals.push(signal.data.payload) - }) - - // add a content change - let commit = { - snapshot: $session_info.content_hash, - change: { - deltas, - content_hash: new_content_hash_1, - previous_change: $session_info.content_hash, // this is the first change so same hash as snapshot - meta: { - contributors: [], - witnesses: [], - app_specific: null + const me_ctx = {}, alice_ctx = {}, bob_ctx = {} + await join_session({ app_port: me_port, app_id: me_happ.hAppId, ctx: me_ctx }) + await join_session({ app_port: alice_port, app_id: alice_happ.hAppId, ctx: alice_ctx }) + await join_session({ app_port: bob_port, app_id: bob_happ.hAppId, ctx: bob_ctx }) + + try { + await subscribe_wait_timeout(session_info_b(me_ctx), I, 10_000) + // I created the session, so I should be the scribe + t.deepEqual(session_info_b(me_ctx)?.$?.scribe, me_pubkey) + // First ever session so content should be default content + t.deepEqual(session_info_b(me_ctx)?.$?.snapshot_content, { title: '', body: '' }) + let sessionHash = session_info_b(me_ctx)?.$?.session as EntryHash + + // check the hash_content zome call. + let hash = await rpc_hash_content_b(me_ctx)(session_info_b(me_ctx)?.$?.snapshot_content as Content) + t.deepEqual(session_info_b(me_ctx)?.$?.content_hash, hash) + + // check get_sessions utility zome call + sessions = await rpc_get_sessions_b(me_ctx)() + t.equal(sessions.length, 1) + t.deepEqual(sessions[0], sessionHash) + + // exercise the get_session zome call + const returnedSessionInfo = await rpc_get_session_b(me_ctx)(sessionHash) + t.equal(sessions.length, 1) + t.deepEqual(session_info_b(me_ctx)?.$, returnedSessionInfo) + + // check that initial snapshot was created by using the get_content zome call + const returned_content = await rpc_get_content_b(me_ctx)(session_info_b(me_ctx)?.$?.content_hash as EntryHash) + t.deepEqual(returned_content, session_info_b(me_ctx)?.$?.snapshot_content) + + // set up the pending deltas array + let pending_deltas:Delta[] = [{ type: 'Title', value: 'foo title' }, { type: 'Add', value: [0, 'bar content'] }] + + await apply_deltas_b(me_ctx)(pending_deltas) + const me_content = content_b(me_ctx) + const new_content_hash_1 = await rpc_hash_content_b(me_ctx)(me_content.$) + + let deltas = jsonDeltas ? pending_deltas.map(d=>JSON.stringify(d)) : pending_deltas + + // set signal handlers so we can confirm they get sent and received appropriately + let me_signals = writable$<Signal[]>([]) + const me_signals_length = derived$(me_signals, $me_signals=>$me_signals?.length) + let me_signals_length_$ = me_signals_length.$ + me_player.setSignalHandler((signal)=>{ + console.log('Received Signal for me:', signal) + me_signals.update($me_signals=>{ + $me_signals.push(signal.data.payload) + return $me_signals + }) + }) + + // alice signal handler + const alice_signals = writable$<Signal[]>([]) + const alice_signals_length = derived$(alice_signals, $alice_signals=>$alice_signals?.length) + let alice_signals_length_$ = alice_signals_length.$ + alice_player.setSignalHandler((signal)=>{ + console.log('Received Signal for alice:', signal) + alice_signals.update($alice_signals=>{ + $alice_signals.push(signal.data.payload) + return $alice_signals + }) + }) + + // bob signal handler + const bob_signals = writable$<Signal[]>([]) + const bob_signals_length = derived$(bob_signals, $bob_signals=>$bob_signals?.length) + let bob_signals_length_$ = bob_signals_length.$ + bob_player.setSignalHandler((signal)=>{ + console.log('Received Signal for bob:', signal) + bob_signals.update($bob_signals=>{ + $bob_signals.push(signal.data.payload) + return $bob_signals + }) + }) + + // add a content change + let commit:Commit = { + snapshot: session_info_b(me_ctx)?.$?.content_hash as EntryHash, + change: { + deltas: deltas, + content_hash: new_content_hash_1, + previous_change: session_info_b(me_ctx)?.$?.content_hash as EntryHash, // this is the first change so same hash as snapshot + meta: { + contributors: [], + witnesses: [], + app_specific: null + } + }, + participants: [] + } + let commit_header_hash = await rpc_commit_b(me_ctx)(commit) + t.equal(commit_header_hash.length, 39) // is a hash + + // add a second content change + pending_deltas = [ + { type: 'Delete', value: [0, 3] }, + { type: 'Add', value: [0, 'baz'] }, + { type: 'Add', value: [11, ' new'] }, // 'baz content new' + { type: 'Delete', value: [4, 11] }, // 'baz new' + { type: 'Add', value: [4, 'monkey'] }, // 'baz monkey new' + ] + await apply_deltas_b(me_ctx)(pending_deltas) + const new_content_hash_2 = await rpc_hash_content_b(me_ctx)(me_content.$) + + deltas = jsonDeltas ? pending_deltas.map(d=>JSON.stringify(d)) : pending_deltas + commit = { + snapshot: session_info_b(me_ctx)?.$?.content_hash as EntryHash, + change: { + deltas, + content_hash: new_content_hash_2, + previous_change: new_content_hash_1, // this is the second change so previous commit's hash + meta: { + contributors: [], + witnesses: [], + app_specific: null + } + }, + participants: [] + } + commit_header_hash = await rpc_commit_b(me_ctx)(commit) + // clear the pending_deltas + pending_deltas = [] + + // alice joins session + const alice_session_info = session_info_b(alice_ctx) + let alice_session_info_$ = alice_session_info.$ + // alice_session_info.$ = await rpc_get_session_b(alice_ctx)(sessionHash) + // alice should get my session + t.deepEqual(alice_session_info.$?.session, sessionHash) + t.deepEqual(alice_session_info.$?.scribe, me_pubkey) + t.deepEqual(alice_session_info.$?.snapshot_content, { title: '', body: '' }) + + await rpc_send_sync_request_b(alice_ctx)(me_pubkey) + + // check that deltas and snapshot content returned add up to the current real content + await delay(500) // make time for integrating new data + const received_deltas:Delta[] = (jsonDeltas ? alice_session_info.$?.deltas.map(d=>JSON.parse(d)) : alice_session_info.$?.deltas) as Delta[] + await apply_deltas_b(alice_ctx)(received_deltas) + t.deepEqual( + me_content.$, + { title: 'foo title', body: 'baz monkey new', meta: { [my_tag_b(me_ctx).$]: 0 } } // content after two commits + ) + + // confirm that the session_info_b(me_ctx)'s content hash matches the content_hash + // generated by applying deltas + hash = await rpc_hash_content_b(alice_ctx)(alice_session_info.$?.snapshot_content as Content) + t.deepEqual(alice_session_info.$?.content_hash, hash) + + // I should receive alice's request for the state as she joins the session + t.deepEqual(me_signals.$[0], { signal_name: 'SyncReq', signal_payload: alice_pubkey }) + + // I add some pending deltas which I will then need to send to Alice as part of her Joining. + pending_deltas = [{ type: 'Title', value: 'I haven\'t committed yet' }, { type: 'Add', value: [14, '\nBut made a new line! 🍑'] }] + + deltas = jsonDeltas ? pending_deltas.map(d=>JSON.stringify(d)) : pending_deltas + + const state:StateForSync = { + snapshot: session_info_b(me_ctx)?.$?.content_hash as EntryHash, + commit: commit_header_hash, + commit_content_hash: new_content_hash_2, + deltas: pending_deltas, + } + alice_signals_length_$ = alice_signals_length.$ + await rpc_send_sync_response_b(me_ctx)({ + participant: alice_pubkey, + state, + }) + await subscribe_wait_timeout(alice_signals_length, _neq(alice_signals_length_$), 10_000) + alice_signals_length_$ = alice_signals_length.$ + + // Alice should have received uncommitted deltas + t.equal(alice_signals.$[alice_signals_length_$ - 1].signal_name, 'SyncResp') + let receivedState = alice_signals.$[alice_signals_length_$ - 1].signal_payload + t.deepEqual(receivedState, { ...state, deltas: pending_deltas.map(d=>JSON.stringify(d)) }) // deltas, commit, and snapshot match + + // bob joins session + const bob_$session_info = await rpc_get_session_b(bob_ctx)(sessionHash) + // bob should get my session + t.deepEqual(bob_$session_info.scribe, me_pubkey) + await rpc_send_sync_request_b(bob_ctx)(me_pubkey) + + t.deepEqual(me_signals.$.map(ms=>ms.signal_name), ['SyncReq']) + // alice sends me a change req and I should receive it + const alice_delta:Delta = { type: 'Title', value: 'Alice in Wonderland' } + let delta = jsonDeltas ? JSON.stringify(alice_delta) : alice_delta + + let me_ChangeReq_signals_length = filter_signal_name(me_signals.$, 'ChangeReq').length + me_signals_length_$ = me_signals_length.$ + await rpc_send_change_request_b(alice_ctx)({ + scribe: alice_session_info.$?.scribe as AgentPubKey, + index: 1, + deltas: [alice_delta] + }) + await subscribe_wait_timeout( + me_signals, + $me_signals=> + filter_signal_name($me_signals, 'ChangeReq').length > me_ChangeReq_signals_length, + 10_000) + const sig = filter_signal_name(me_signals.$, 'ChangeReq').reverse()[0] + t.deepEqual(sig.signal_name, 'ChangeReq') + const [sig_index, sig_delta] = sig.signal_payload + t.equal(sig_index, 1) + const receiveDelta = jsonDeltas ? JSON.parse(sig_delta) : sig_delta + t.deepEqual(receiveDelta, alice_delta) // delta_matches + + let my_deltas:Delta[] = [{ type: 'Add', value: [0, 'Whoops!\n'] }, { type: 'Title', value: 'Alice in Wonderland' }] + deltas = jsonDeltas ? my_deltas.map(d=>JSON.stringify(d)) : deltas + let alice_Change_signals_length = filter_signal_name(alice_signals.$, 'Change').length + let bob_Change_signals_length = filter_signal_name(bob_signals.$, 'Change').length + // I send a change, and alice and bob should receive it. + await rpc_send_change_b(me_ctx)({ + participants: [alice_pubkey, bob_pubkey], + index: 2, + deltas: my_deltas, + }) + await subscribe_wait_timeout( + alice_signals, + $alice_signals=>filter_signal_name($alice_signals, 'Change').length > alice_Change_signals_length, + 10_000) + await subscribe_wait_timeout( + bob_signals, + $bob_signals=>filter_signal_name($bob_signals, 'Change').length > bob_Change_signals_length, + 10_000) + let a_sig = filter_signal_name(alice_signals.$, 'Change').reverse()[0] + let b_sig = filter_signal_name(bob_signals.$, 'Change').reverse()[0] + t.equal(a_sig.signal_name, 'Change') + t.equal(b_sig.signal_name, 'Change') + t.deepEqual(a_sig.signal_payload, [2, deltas]) // delta_matches + t.deepEqual(b_sig.signal_payload, [2, deltas]) // delta_matches + + let me_Hearbeat_signal_length = filter_signal_name(me_signals.$, 'Heartbeat').length + await rpc_send_heartbeat_b(alice_ctx)({ + scribe: me_pubkey, + data: 'Hello' + }) + await subscribe_wait_timeout( + me_signals, + $me_signals=>filter_signal_name($me_signals, 'Heartbeat').length > me_Hearbeat_signal_length, + 10_000 + ) + let me_sig = filter_signal_name(me_signals.$, 'Heartbeat').reverse()[0] + t.equal(me_sig.signal_name, 'Heartbeat') + t.deepEqual(me_sig.signal_payload[1], 'Hello') + t.deepEqual(me_sig.signal_payload[0], alice_pubkey) + + let alice_FolkLore_length = filter_signal_name(alice_signals.$, 'FolkLore').length + let bob_FolkLore_length = filter_signal_name(bob_signals.$, 'FolkLore').length + await rpc_send_folk_lore_b(me_ctx)({ + participants: [alice_pubkey, bob_pubkey], + data: { + participants: { + [alice_pubkey]: { + pubKey: alice_pubkey + }, + [bob_pubkey]: { + pubKey: bob_pubkey + }, + } } - }, - participants: [] - } - let commit_header_hash = await me.call('syn', 'commit', commit) - t.equal(commit_header_hash.length, 39) // is a hash - - // add a second content change - pending_deltas = [ - { type: 'Delete', value: [0, 3] }, - { type: 'Add', value: [0, 'baz'] }, - { type: 'Add', value: [11, ' new'] }, // 'baz content new' - { type: 'Delete', value: [4, 11] }, // 'baz new' - { type: 'Add', value: [4, 'monkey'] }, // 'baz monkey new' - ] - apply_deltas(me_ctx, pending_deltas) - const new_content_hash_2 = await me.call('syn', 'hash_content', me_content.$) - - deltas = jsonDeltas ? pending_deltas.map(d=>JSON.stringify(d)) : pending_deltas - commit = { - snapshot: $session_info.content_hash, - change: { - deltas, - content_hash: new_content_hash_2, - previous_change: new_content_hash_1, // this is the second change so previous commit's hash - meta: { - contributors: [], - witnesses: [], - app_specific: null + }) + await subscribe_wait_timeout( + alice_signals, + $signals=>filter_signal_name($signals, 'FolkLore').length > alice_FolkLore_length, + 10_000 + ) + await subscribe_wait_timeout( + bob_signals, + $signals=>filter_signal_name($signals, 'FolkLore').length > bob_FolkLore_length, + 10_000 + ) + a_sig = filter_signal_name(alice_signals.$, 'FolkLore').reverse()[0] + b_sig = filter_signal_name(bob_signals.$, 'FolkLore').reverse()[0] + t.equal(a_sig.signal_name, 'FolkLore') + t.equal(b_sig.signal_name, 'FolkLore') + t.deepEqual(a_sig.signal_payload, JSON.stringify({ + participants: { + [alice_pubkey]: { + pubKey: alice_pubkey_base64 + }, + [bob_pubkey]: { + pubKey: bob_pubkey_base64 + }, } - }, - participants: [] - } - commit_header_hash = await me.call('syn', 'commit', commit) - // clear the pending_deltas - pending_deltas = [] - - // alice joins session - const $alice_session_info = await alice.call('syn', 'get_session', sessionHash) - const alice_session_info = session_info_b(alice_ctx) - alice_session_info.$ = $alice_session_info - // alice should get my session - t.deepEqual($alice_session_info.session, sessionHash) - t.deepEqual($alice_session_info.scribe, me_pubkey) - t.deepEqual($alice_session_info.snapshot_content, { title: '', body: '' }) - await alice.call('syn', 'send_sync_request', { scribe: me_pubkey }) - - // check that deltas and snapshot content returned add up to the current real content - await delay(500) // make time for integrating new data - const received_deltas:Delta[] = jsonDeltas ? $alice_session_info.deltas.map(d=>JSON.parse(d)) : $alice_session_info.deltas - t.deepEqual( - apply_deltas(alice_ctx, received_deltas), - { title: 'foo title', body: 'baz monkey new' } // content after two commits - ) - - // confirm that the $session_info's content hash matches the content_hash - // generated by applying deltas - hash = await alice.call('syn', 'hash_content', $alice_session_info.snapshot_content) - t.deepEqual($alice_session_info.content_hash, hash) - - // I should receive alice's request for the state as she joins the session - t.deepEqual(me_signals[0], { signal_name: 'SyncReq', signal_payload: alice_pubkey }) - - // I add some pending deltas which I will then need to send to Alice as part of her Joining. - pending_deltas = [{ type: 'Title', value: 'I haven\'t committed yet' }, { type: 'Add', value: [14, '\nBut made a new line! 🍑'] }] - - deltas = jsonDeltas ? pending_deltas.map(d=>JSON.stringify(d)) : pending_deltas - - const state = { - snapshot: $session_info.content_hash, - commit: commit_header_hash, - commit_content_hash: new_content_hash_2, - deltas: deltas, - } - await me.call('syn', 'send_sync_response', { - participant: alice_pubkey, - state, - }) - - // Alice should have recieved uncommitted deltas - await delay(500) // make time for signal to arrive - t.equal(alice_signals[0].signal_name, 'SyncResp') - let receivedState = alice_signals[0].signal_payload - t.deepEqual(receivedState, state) // deltas, commit, and snapshot match - - // bob joins session - const bobSessionInfo = await alice.call('syn', 'get_session', sessionHash) - // bob should get my session - t.deepEqual(bobSessionInfo.scribe, me_pubkey) - await bob.call('syn', 'send_sync_request', { scribe: me_pubkey }) - - // alice sends me a change req and I should receive it - const alice_delta:Delta = { type: 'Title', value: 'Alice in Wonderland' } - let delta = jsonDeltas ? JSON.stringify(alice_delta) : alice_delta - await alice.call('syn', 'send_change_request', { - scribe: $alice_session_info.scribe, - change: [1, [delta]] - }) - await delay(500) // make time for signal to arrive - const sig = me_signals[2] - t.equal(sig.signal_name, 'ChangeReq') - const [sig_index, sig_delta] = sig.signal_payload - t.equal(sig_index, 1) - const receiveDelta = jsonDeltas ? JSON.parse(sig_delta) : sig_delta - t.deepEqual(receiveDelta, alice_delta) // delta_matches - - let my_deltas = [{ type: 'Add', value: [0, 'Whoops!\n'] }, { type: 'Title', value: 'Alice in Wonderland' }] - deltas = jsonDeltas ? my_deltas.map(d=>JSON.stringify(d)) : deltas - // I send a change, and alice and bob should receive it. - await me.call('syn', 'send_change', { - participants: [alice_pubkey, bob_pubkey], - change: [2, deltas] - }) - await delay(500) // make time for signal to arrive - let a_sig = alice_signals[1] - let b_sig = bob_signals[0] - t.equal(a_sig.signal_name, 'Change') - t.equal(b_sig.signal_name, 'Change') - t.deepEqual(a_sig.signal_payload, [2, deltas]) // delta_matches - t.deepEqual(b_sig.signal_payload, [2, deltas]) // delta_matches - - await alice.call('syn', 'send_heartbeat', { - scribe: me_pubkey, - data: 'Hello' - }) - await delay(500) // make time for signal to arrive - let me_sig = me_signals[3] - t.equal(me_sig.signal_name, 'Heartbeat') - t.deepEqual(me_sig.signal_payload[1], 'Hello') - t.deepEqual(me_sig.signal_payload[0], alice_pubkey) - - await me.call('syn', 'send_folk_lore', { - participants: [alice_pubkey, bob_pubkey], - data: 'Alice said hello' - }) - await delay(500) // make time for signal to arrive - - a_sig = alice_signals[2] - b_sig = bob_signals[1] - t.equal(a_sig.signal_name, 'FolkLore') - t.equal(b_sig.signal_name, 'FolkLore') - t.deepEqual(a_sig.signal_payload, 'Alice said hello') - t.deepEqual(b_sig.signal_payload, 'Alice said hello') - - // alice asks for a sync request - await alice.call('syn', 'send_sync_request', { - scribe: me_pubkey - }) - await delay(500) // make time for signal to arrive - me_sig = me_signals[4] - t.equal(me_sig.signal_name, 'SyncReq') - - // confirm that all agents got added to the folks anchor - // TODO figure out why init doesn't happen immediately. - let folks = await me.call('syn', 'get_folks') - t.equal(folks.length, 3) - - function apply_deltas(ctx:object, deltas:Delta[]) { - const run_apply_delta = run_apply_delta_b(ctx) - for (const delta of deltas) { - run_apply_delta(delta) - } + })) + t.deepEqual(b_sig.signal_payload, JSON.stringify({ + participants: { + [alice_pubkey]: { + pubKey: alice_pubkey_base64 + }, + [bob_pubkey]: { + pubKey: bob_pubkey_base64 + }, + } + })) + + let me_SyncReq_length = filter_signal_name(me_signals.$, 'SyncReq').length + // alice asks for a sync request + await rpc_send_sync_request_b(alice_ctx)(me_pubkey) + await subscribe_wait_timeout( + me_signals, + $signals=>filter_signal_name($signals, 'SyncReq').length > me_SyncReq_length, + 10_000 + ) + me_sig = filter_signal_name(me_signals.$, 'SyncReq').reverse()[0] + t.equal(me_sig.signal_name, 'SyncReq') + + // confirm that all agents got added to the folks anchor + // TODO figure out why init doesn't happen immediately. + let folks = await rpc_get_folks_b(me_ctx)() + t.equal(folks.length, 3) + } finally { + await leave_session({ ctx: me_ctx }) + await leave_session({ ctx: alice_ctx }) + await leave_session({ ctx: bob_ctx }) } + /**/ }) } +function filter_signal_name(signals:Signal[], signal_name:string) { + return signals.filter(s=>s.signal_name === signal_name) +} diff --git a/ui/tsconfig.json b/tsconfig.json similarity index 97% rename from ui/tsconfig.json rename to tsconfig.json index 58596b59..f47b4e93 100644 --- a/ui/tsconfig.json +++ b/tsconfig.json @@ -13,7 +13,7 @@ "target": "es2017", "isolatedModules": true, "sourceMap": true, - "strict": false, + "strict": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "importsNotUsedAsValues": "error", diff --git a/ui/apps/app/package.json b/ui/apps/app/package.json index 4f71ef77..2779de1a 100644 --- a/ui/apps/app/package.json +++ b/ui/apps/app/package.json @@ -9,13 +9,13 @@ }, "dependencies": { "@ctx-core/combinators": "^6.0.10", - "@holochain/conductor-api": "0.0.3", + "@holochain/conductor-api": "0.0.4", "sirv-cli": "^1.0.11", "svelte-fa": "^2.2.0" }, "devDependencies": { - "@ctx-core/object": "^17.5.13", - "@ctx-core/store": "^24.5.8", + "@ctx-core/object": "^17.5.15", + "@ctx-core/store": "^24.5.9", "@rollup/plugin-commonjs": "^18.0.0", "@rollup/plugin-node-resolve": "^11.2.1", "@rollup/plugin-replace": "^2.4.2", @@ -24,7 +24,7 @@ "@syn-ui/zome-client": "workspace:^1.0.0", "@tsconfig/svelte": "^1.0.10", "buffer": "^6.0.3", - "rollup": "^2.45.2", + "rollup": "^2.46.0", "rollup-plugin-css-only": "^3.1.0", "rollup-plugin-livereload": "^2.0.0", "rollup-plugin-node-polyfills": "^0.2.1", diff --git a/ui/apps/headless/package.json b/ui/apps/headless/package.json index 5f9dbb92..62d1f1cb 100644 --- a/ui/apps/headless/package.json +++ b/ui/apps/headless/package.json @@ -8,18 +8,18 @@ }, "dependencies": { "@ctx-core/combinators": "^6.0.10", - "@holochain/conductor-api": "0.0.3", + "@holochain/conductor-api": "0.0.4", "sirv-cli": "^1.0.11", "svelte-fa": "^2.2.0" }, "devDependencies": { - "@ctx-core/object": "^17.5.13", - "@ctx-core/store": "^24.5.8", + "@ctx-core/object": "^17.5.15", + "@ctx-core/store": "^24.5.9", "@rollup/plugin-commonjs": "^18.0.0", "@rollup/plugin-node-resolve": "^11.2.1", "@rollup/plugin-replace": "^2.4.2", "@rollup/plugin-typescript": "^8.2.1", - "rollup": "^2.45.2", + "rollup": "^2.46.0", "rollup-plugin-css-only": "^3.1.0", "rollup-plugin-livereload": "^2.0.0", "rollup-plugin-svelte": "^7.1.0", diff --git a/ui/libs/model/package.json b/ui/libs/model/package.json index 61193813..4c2751c4 100644 --- a/ui/libs/model/package.json +++ b/ui/libs/model/package.json @@ -7,9 +7,9 @@ "scripts": {}, "devDependencies": { "@ctx-core/combinators": "^6.0.10", - "@ctx-core/object": "^17.5.13", - "@ctx-core/store": "^24.5.8", - "@holochain/conductor-api": "0.0.3", + "@ctx-core/object": "^17.5.15", + "@ctx-core/store": "^24.5.9", + "@holochain/conductor-api": "0.0.4", "@syn-ui/utils": "workspace:^1.0.0", "@syn-ui/zome-client": "workspace:^1.0.0", "svelte": "^3.37.0", diff --git a/ui/libs/model/src/actions/join_session.ts b/ui/libs/model/src/actions/join_session.ts index 586dc1fb..7b093991 100644 --- a/ui/libs/model/src/actions/join_session.ts +++ b/ui/libs/model/src/actions/join_session.ts @@ -43,7 +43,7 @@ export async function join_session(params:join_session_params_T) { const am_i_scribe = am_i_scribe_b(ctx) if (am_i_scribe.$ === true) { const rpc_send_sync_request = rpc_send_sync_request_b(ctx) - await rpc_send_sync_request($session_info) + await rpc_send_sync_request($session_info.scribe) } } const session_info = session_info_b(ctx) diff --git a/ui/libs/model/src/content/content_b.ts b/ui/libs/model/src/content/content_b.ts index 49d5fc14..2b16a35b 100644 --- a/ui/libs/model/src/content/content_b.ts +++ b/ui/libs/model/src/content/content_b.ts @@ -2,5 +2,6 @@ import { _b } from '@ctx-core/object' import { writable$ } from '@ctx-core/store' import type { Content } from '@syn-ui/zome-client' export const content_b = _b('content', ()=>{ - return writable$<Content>({ title: '', body: '', meta: {} }) + const content = writable$<Content>({ title: '', body: '', meta: {} }) + return content }) diff --git a/ui/libs/model/src/delta/apply_deltas_b.ts b/ui/libs/model/src/delta/apply_deltas_b.ts new file mode 100644 index 00000000..51795af8 --- /dev/null +++ b/ui/libs/model/src/delta/apply_deltas_b.ts @@ -0,0 +1,87 @@ +import { _b } from '@ctx-core/object' +import { + Content, Delta, AddDelta, DeleteDelta, MetaDelta, TitleDelta, my_tag_b, rpc_hash_content_b +} from '@syn-ui/zome-client' +import { content_b } from '../content' +import { content_hash_b } from '../session' +import type { ApplyDelta } from './ApplyDelta' +import { deltas_b } from './deltas_b' +import { snapshot_content_b } from './snapshot_content_b' +import { committed_changes_b } from './committed_changes_b' +export const apply_deltas_b = _b('apply_deltas', (ctx)=>{ + const content = content_b(ctx) + const my_tag = my_tag_b(ctx) + const deltas = deltas_b(ctx) + const snapshot_content = snapshot_content_b(ctx) + const committed_changes = committed_changes_b(ctx) + let current_$snapshot_content:undefined|Content + snapshot_content.subscribe(async $snapshot_content=>{ + if (!$snapshot_content || current_$snapshot_content === $snapshot_content) return + current_$snapshot_content = $snapshot_content + const $my_tag = my_tag.$ + const $content:Content = { + title: $snapshot_content.title, + body: $snapshot_content.body, + meta: {} + } + if ($my_tag) { + $content.meta[$my_tag] = 0 + } + content.$ = $content + const new_$committed_changes:ApplyDelta[] = [] + new_$committed_changes.push( + ...(await apply_deltas(deltas.$ || [])) + ) + committed_changes.update($committed_changes=>{ + $committed_changes.push(...new_$committed_changes) + return $committed_changes + }) + }) + return apply_deltas + async function apply_deltas(deltas:Delta[]):Promise<ApplyDelta[]> { + const $content = content.$ + const undoable_changes:ApplyDelta[] = [] + for (const delta of deltas) { + switch (delta.type) { + case 'Title': { + const deleted = $content.title + const Title_delta = delta as TitleDelta + $content.title = Title_delta.value + undoable_changes.push({ delta, deleted }) + break + } + case 'Add': { + const Add_delta = delta as AddDelta + const [loc, text] = Add_delta.value + $content.body = $content.body.slice(0, loc) + text + $content.body.slice(loc) + undoable_changes.push({ delta }) + break + } + case 'Delete': { + const Delete_delta = delta as DeleteDelta + const [start, end] = Delete_delta.value + const deleted = $content.body.slice(start, end) + $content.body = $content.body.slice(0, start) + $content.body.slice(end) + undoable_changes.push({ delta, deleted }) + break + } + case 'Meta': { + const Meta_delta = delta as MetaDelta + const [tag, loc] = Meta_delta.value.setLoc + const deleted:[string, number] = [tag, $content.meta[tag]] + $content.meta[tag] = loc + undoable_changes.push({ delta, deleted }) + break + } + default: { + throw `Unsupported delta.type ${delta.type}` + } + } + } + content.$ = $content + const rpc_hash_content = rpc_hash_content_b(ctx) + const content_hash = content_hash_b(ctx) + content_hash.$ = await rpc_hash_content($content) + return undoable_changes + } +}) diff --git a/ui/libs/model/src/delta/index.ts b/ui/libs/model/src/delta/index.ts index bcadfa62..642beb2a 100644 --- a/ui/libs/model/src/delta/index.ts +++ b/ui/libs/model/src/delta/index.ts @@ -3,12 +3,11 @@ export * from './commit_change_b' export * from './committed_changes_b' export * from './deltas_b' export * from './next_index_b' -export * from './record_delta_b' export * from './record_deltas_b' export * from './recorded_changes_b' export * from './request_change_b' export * from './requested_changes_b' -export * from './run_apply_delta_b' +export * from './apply_deltas_b' export * from './_scribe_signal_folk_pubKey_a1_b' export * from './send_change_b' export * from './snapshot_content_b' diff --git a/ui/libs/model/src/delta/record_delta_b.ts b/ui/libs/model/src/delta/record_delta_b.ts deleted file mode 100644 index b04453f2..00000000 --- a/ui/libs/model/src/delta/record_delta_b.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { Delta } from '@syn-ui/zome-client' -import { _b } from '@ctx-core/object' -import { run_apply_delta_b } from './run_apply_delta_b' -import { recorded_changes_b } from './recorded_changes_b' -export const record_delta_b = _b('record_delta', (ctx)=>{ - const run_apply_delta = run_apply_delta_b(ctx) - const recorded_changes = recorded_changes_b(ctx) - return function record_delta(delta:Delta) { - // apply the deltas to the content which returns the undoable change - const undoable_change = run_apply_delta(delta) - // append changes to the recorded history - recorded_changes.push(undoable_change) - } -}) diff --git a/ui/libs/model/src/delta/record_deltas_b.ts b/ui/libs/model/src/delta/record_deltas_b.ts index 6e5d3097..d7d9334b 100644 --- a/ui/libs/model/src/delta/record_deltas_b.ts +++ b/ui/libs/model/src/delta/record_deltas_b.ts @@ -1,21 +1,26 @@ -import type { Delta } from '@syn-ui/zome-client' import { _b } from '@ctx-core/object' +import type { Delta } from '@syn-ui/zome-client' import { requested_changes_b } from './requested_changes_b' import { recorded_changes_b } from './recorded_changes_b' -import { record_delta_b } from './record_delta_b' import type { ApplyDelta } from './ApplyDelta' +import { apply_deltas_b } from './apply_deltas_b' export const record_deltas_b = _b('record_deltas', (ctx)=>{ const requested_changes = requested_changes_b(ctx) - return function record_deltas(_index:number, deltas:Delta[]) { + const apply_deltas = apply_deltas_b(ctx) + const recorded_changes = recorded_changes_b(ctx) + return async function record_deltas(deltas:Delta[]) { const $requested_changes = requested_changes.$ console.log('record_deltas REQUESTED', $requested_changes) + const apply_deltas_a1:Delta[] = [] for (const delta of deltas) { if ($requested_changes.length > 0) { // if this change is our next requested change then remove it - if (JSON.stringify(delta) == JSON.stringify($requested_changes[0].delta)) { + if (JSON.stringify(delta) === JSON.stringify($requested_changes[0].delta)) { const recorded_changes = recorded_changes_b(ctx) - recorded_changes.push($requested_changes.shift() as ApplyDelta) - requested_changes.set($requested_changes) + const $recorded_changes = recorded_changes.$ + $recorded_changes.push($requested_changes.shift() as ApplyDelta) + recorded_changes.$ = $recorded_changes + requested_changes.$ = $requested_changes } else { // TODO rebase? console.log('REBASE NEEDED?') @@ -27,9 +32,12 @@ export const record_deltas_b = _b('record_deltas', (ctx)=>{ // to check our requested changes // TODO: do we need to check if this is a change that we did send and have already // integrated somehow and ignore if so. (Seems unlikely?) - const record_delta = record_delta_b(ctx) - record_delta(delta) + // apply the deltas to the content which returns the undoable change + apply_deltas_a1.push(delta) } } + const undoable_changes = await apply_deltas(apply_deltas_a1) + // append changes to the recorded history + recorded_changes.push(...undoable_changes) } }) diff --git a/ui/libs/model/src/delta/request_change_b.ts b/ui/libs/model/src/delta/request_change_b.ts index 6bc1c68b..3add4a48 100644 --- a/ui/libs/model/src/delta/request_change_b.ts +++ b/ui/libs/model/src/delta/request_change_b.ts @@ -2,12 +2,12 @@ import { _b } from '@ctx-core/object' import { Delta, my_tag_b, rpc_send_change_request_b } from '@syn-ui/zome-client' import { am_i_scribe_b, scribe_b } from '../session' import { next_index_b } from './next_index_b' -import { record_delta_b } from './record_delta_b' import { send_change_b } from './send_change_b' import { requested_changes_b } from './requested_changes_b' -import { run_apply_delta_b } from './run_apply_delta_b' +import { apply_deltas_b } from './apply_deltas_b' +import { record_deltas_b } from './record_deltas_b' export const request_change_b = _b('request_change', (ctx)=>{ - const record_delta = record_delta_b(ctx) + const record_deltas = record_deltas_b(ctx) const request_changes = requested_changes_b(ctx) let request_counter = 0 return async function request_change(deltas:Delta[]) { @@ -16,9 +16,7 @@ export const request_change_b = _b('request_change', (ctx)=>{ const next_index = next_index_b(ctx) if (am_i_scribe.$ === true) { const $next_index = next_index.$ - for (const delta of deltas) { - record_delta(delta) - } + await record_deltas(deltas) const send_change = send_change_b(ctx) await send_change({ index: $next_index, deltas }) } else { @@ -33,15 +31,13 @@ export const request_change_b = _b('request_change', (ctx)=>{ // we want to apply this to current next_index plus any previously // requested changes that haven't yet be recorded const index = next_index.$ + $requested_changes.length - const run_apply_delta = run_apply_delta_b(ctx) - for (const delta of deltas) { - const undoable_change = run_apply_delta(delta) + const apply_deltas = apply_deltas_b(ctx) + const undoable_changes = await apply_deltas(deltas) + for (const undoable_change of undoable_changes) { undoable_change.id = change_id undoable_change.at = change_at - // append changes to the requested queue - // request_changes.push - $requested_changes.push(undoable_change) } + $requested_changes.push(...undoable_changes) request_changes.$ = $requested_changes console.log('REQUESTED', $requested_changes) const rpc_send_change_request = rpc_send_change_request_b(ctx) diff --git a/ui/libs/model/src/delta/run_apply_delta_b.ts b/ui/libs/model/src/delta/run_apply_delta_b.ts deleted file mode 100644 index db5c80da..00000000 --- a/ui/libs/model/src/delta/run_apply_delta_b.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { _b } from '@ctx-core/object' -import { - Content, Delta, AddDelta, DeleteDelta, MetaDelta, TitleDelta, my_tag_b -} from '@syn-ui/zome-client' -import { content_b } from '../content' -import type { ApplyDelta } from './ApplyDelta' -import { deltas_b } from './deltas_b' -import { snapshot_content_b } from './snapshot_content_b' -import { committed_changes_b } from './committed_changes_b' -export const run_apply_delta_b = _b('run_apply_delta', (ctx)=>{ - const content = content_b(ctx) - const my_tag = my_tag_b(ctx) - const deltas = deltas_b(ctx) - const snapshot_content = snapshot_content_b(ctx) - const committed_changes = committed_changes_b(ctx) - snapshot_content.subscribe($snapshot_content=>{ - if (!$snapshot_content) return - const $content:Content = { - title: $snapshot_content.title, - body: $snapshot_content.body, - meta: { - [my_tag.$]: 0 - } - } - content.$ = $content - const new_$committed_changes:ApplyDelta[] = [] - for (const delta of deltas.$ || []) { - const change = run_apply_delta(delta) - new_$committed_changes.push(change) - } - committed_changes.update($committed_changes => { - $committed_changes.push(...new_$committed_changes) - return $committed_changes - }) - }) - return run_apply_delta - function run_apply_delta(delta:Delta):ApplyDelta { - const $content = content.$ - let undoable_change:ApplyDelta - switch (delta.type) { - case 'Title': { - const deleted = $content.title - const Title_delta = delta as TitleDelta - $content.title = Title_delta.value - undoable_change = { delta, deleted } - break - } - case 'Add': { - const Add_delta = delta as AddDelta - const [loc, text] = Add_delta.value - $content.body = $content.body.slice(0, loc) + text + $content.body.slice(loc) - undoable_change = { delta } - break - } - case 'Delete': { - const Delete_delta = delta as DeleteDelta - const [start, end] = Delete_delta.value - const deleted = $content.body.slice(start, end) - $content.body = $content.body.slice(0, start) + $content.body.slice(end) - undoable_change = { delta, deleted } - break - } - case 'Meta': { - const Meta_delta = delta as MetaDelta - const [tag, loc] = Meta_delta.value.setLoc - const deleted:[string, number] = [tag, $content.meta[tag]] - $content.meta[tag] = loc - undoable_change = { delta, deleted } - break - } - default: { - throw `Unsupported delta.type ${delta.type}` - } - } - content.set($content) - return undoable_change - } -}) diff --git a/ui/libs/model/src/delta/snapshot_content_b.ts b/ui/libs/model/src/delta/snapshot_content_b.ts index 28cb95c0..5b585817 100644 --- a/ui/libs/model/src/delta/snapshot_content_b.ts +++ b/ui/libs/model/src/delta/snapshot_content_b.ts @@ -1,10 +1,12 @@ import { _b } from '@ctx-core/object' -import { derived$ } from '@ctx-core/store' +import { derived$, Readable$ } from '@ctx-core/store' +import type { Content } from '@syn-ui/zome-client' import { session_info_b } from '../session' export const snapshot_content_b = _b('snapshot_content', (ctx)=>{ const session_info = session_info_b(ctx) - const snapshot_content = derived$(session_info, $session_info=> + const snapshot_content:snapshot_content_T = derived$(session_info, $session_info=> $session_info?.snapshot_content ) return snapshot_content }) +export interface snapshot_content_T extends Readable$<undefined|Content> {} diff --git a/ui/libs/model/src/session/content_hash_b.ts b/ui/libs/model/src/session/content_hash_b.ts index e71a1cfc..6f5563a3 100644 --- a/ui/libs/model/src/session/content_hash_b.ts +++ b/ui/libs/model/src/session/content_hash_b.ts @@ -1,19 +1,12 @@ import { _b } from '@ctx-core/object' -import { derived$, mix_set_readable$ } from '@ctx-core/store' -import type { SessionInfo } from '@syn-ui/zome-client' +import { writable$ } from '@ctx-core/store' import { session_info_b } from './session_info_b' import type { EntryHash } from '@syn-ui/utils/dist' export const content_hash_b = _b('content_hash', (ctx)=>{ const session_info = session_info_b(ctx) - return mix_set_readable$( - derived$(session_info, $session_info=>{ - return $session_info?.content_hash - }), - $content_hash=>{ - session_info.update($session_info=>{ - ($session_info as SessionInfo).content_hash = $content_hash as EntryHash - return $session_info - }) - } - ) + const content_hash = writable$<undefined|EntryHash>(undefined) + session_info.subscribe($session_info=>{ + content_hash.$ = $session_info?.content_hash + }) + return content_hash }) diff --git a/ui/libs/model/src/session/sessions_b.ts b/ui/libs/model/src/session/sessions_b.ts index 0dadd989..93321ffc 100644 --- a/ui/libs/model/src/session/sessions_b.ts +++ b/ui/libs/model/src/session/sessions_b.ts @@ -4,7 +4,6 @@ import { rpc_get_sessions_b, SessionInfo } from '@syn-ui/zome-client' import type { EntryHash } from '@syn-ui/utils' import { session_info_b } from './session_info_b' export const sessions_b = _b('sessions', (ctx)=>{ - const rpc_get_sessions = rpc_get_sessions_b(ctx) const sessions = writable$<EntryHash[]|null>(null) const busy = writable$<boolean>(false) const out_sessions = sessions as sessions_T @@ -19,20 +18,13 @@ export const sessions_b = _b('sessions', (ctx)=>{ }) return out_sessions async function load() { - console.debug('sessions_b|load|debug|1') busy.$ = true try { - console.debug('sessions_b|load|debug|2') + const rpc_get_sessions = rpc_get_sessions_b(ctx) sessions.$ = await rpc_get_sessions() - console.debug('sessions_b|load|debug|3', { - 'sessions.$': sessions.$ - }) } finally { busy.$ = false } - console.debug('sessions_b|load|debug|4', { - 'sessions.$': sessions.$ - }) return sessions.$ } function unshift(...session_hash_a1:EntryHash[]) { diff --git a/ui/libs/model/src/signals/ChangeReq_SignalOps_b.ts b/ui/libs/model/src/signals/ChangeReq_SignalOps_b.ts index 900fccb5..bc0bb012 100644 --- a/ui/libs/model/src/signals/ChangeReq_SignalOps_b.ts +++ b/ui/libs/model/src/signals/ChangeReq_SignalOps_b.ts @@ -29,7 +29,7 @@ export const ChangeReq_SignalOps_b = _b<SignalOps>('ChangeReq_SignalOps', (ctx)= } } const record_deltas = record_deltas_b(ctx) - record_deltas(index, deltas) + await record_deltas(deltas) // notify all participants of the change await send_change({ index, deltas }) } diff --git a/ui/libs/model/src/signals/Change_SignalOps_b.ts b/ui/libs/model/src/signals/Change_SignalOps_b.ts index b92d24c5..064bbecf 100644 --- a/ui/libs/model/src/signals/Change_SignalOps_b.ts +++ b/ui/libs/model/src/signals/Change_SignalOps_b.ts @@ -11,13 +11,13 @@ export const Change_SignalOps_b = _b<SignalOps>('Change_SignalOps', (ctx)=>{ const deltas = serialized_deltas.map(d=>JSON.parse(d)) const am_i_scribe = am_i_scribe_b(ctx) if (am_i_scribe.$ === true) { - console.log('change received but I\'m the scribe, so I\'m ignoring this!') + console.log(`change received but I'm the scribe, so I'm ignoring this!`) } else { console.log(`change arrived for ${index}:`, deltas) const $next_index = next_index.$ if ($next_index === index) { const record_deltas = record_deltas_b(ctx) - record_deltas(index, deltas) + await record_deltas(deltas) } else { console.log(`change arrived out of sequence next_index: ${$next_index}, change index:${index}`) // TODO either call for sync, or do some waiting algorithm diff --git a/ui/libs/model/src/signals/Heartbeat_SignalOps_b.ts b/ui/libs/model/src/signals/Heartbeat_SignalOps_b.ts index 8497be04..05948eed 100644 --- a/ui/libs/model/src/signals/Heartbeat_SignalOps_b.ts +++ b/ui/libs/model/src/signals/Heartbeat_SignalOps_b.ts @@ -1,5 +1,5 @@ import { _b } from '@ctx-core/object' -import { decodeJson, FOLK_SEEN } from '@syn-ui/zome-client' +import { FOLK_SEEN } from '@syn-ui/zome-client' import { am_i_scribe_b, update_folks_b } from '../session' import type { SignalOps } from './SignalOps' export const Heartbeat_SignalOps_b = _b<SignalOps>('Heartbeat_SignalOps', (ctx)=>{ @@ -7,14 +7,13 @@ export const Heartbeat_SignalOps_b = _b<SignalOps>('Heartbeat_SignalOps', (ctx)= const update_folks = update_folks_b(ctx) return { Heartbeat: async (signal)=>{ - let [from, jsonData] = signal.data.payload.signal_payload - const data = decodeJson(jsonData) - console.log('got heartbeat', data, 'from:', from) + let [from, msg] = signal.data.payload.signal_payload + console.log('got heartbeat', msg, 'from:', from) if (am_i_scribe.$ === true) { // I am the scribe and I've recieved a heartbeat from a concerned Folk update_folks(from, FOLK_SEEN) } else { - console.log('heartbeat received but I\'m not the scribe.') + console.log(`heartbeat received but I'm not the scribe.`) } } } diff --git a/ui/libs/model/src/signals/SyncResp_SignalOps_b.ts b/ui/libs/model/src/signals/SyncResp_SignalOps_b.ts index 79c287e2..336fa614 100644 --- a/ui/libs/model/src/signals/SyncResp_SignalOps_b.ts +++ b/ui/libs/model/src/signals/SyncResp_SignalOps_b.ts @@ -3,25 +3,22 @@ import { _b, assign } from '@ctx-core/object' import type { Delta } from '@syn-ui/zome-client' import { bufferToBase64 } from '@syn-ui/utils' import type { SerializedStateForSync, StateForSync } from '../delta' -import { record_delta_b } from '../delta' +import { record_deltas_b } from '../delta' import { content_hash_str_b } from '../session' import type { SignalOps } from './SignalOps' export const SyncResp_SignalOps_b = _b<SignalOps>('SyncResp_SignalOps', (ctx)=>{ const content_hash_str = content_hash_str_b(ctx) - const record_delta = record_delta_b(ctx) + const record_deltas = record_deltas_b(ctx) return { SyncResp: async (signal)=>{ const serialized_state:SerializedStateForSync = signal.data.payload.signal_payload - serialized_state.deltas = serialized_state.deltas.map(d=>JSON.parse(d)) - const state:SyncResp_stace_I = assign({} as StateForSync, serialized_state, { + const state:SyncResp_state_I = assign({} as StateForSync, serialized_state, { deltas: serialized_state.deltas.map(d=>JSON.parse(d)) }) // Make sure that we are working off the same snapshot and commit const commit_content_hash_str = bufferToBase64(state.commit_content_hash) if (commit_content_hash_str == content_hash_str.$) { - for (const delta of state.deltas) { - record_delta(delta) - } + await record_deltas(state.deltas) } else { console.log('WHOA, sync response has different current state assumptions') // TODO: resync somehow @@ -29,7 +26,7 @@ export const SyncResp_SignalOps_b = _b<SignalOps>('SyncResp_SignalOps', (ctx)=>{ } } }) -export interface SyncResp_stace_I extends Omit<StateForSync, 'deltas'> { +export interface SyncResp_state_I extends Omit<StateForSync, 'deltas'> { snapshot:HoloHash, commit:HoloHash, commit_content_hash:HoloHash diff --git a/ui/libs/model/src/timers/request_checker_timer_b.ts b/ui/libs/model/src/timers/request_checker_timer_b.ts index 2d5862d3..3e48b9ca 100644 --- a/ui/libs/model/src/timers/request_checker_timer_b.ts +++ b/ui/libs/model/src/timers/request_checker_timer_b.ts @@ -23,7 +23,8 @@ export const request_checker_timer_b = _b('request_checker_timer', (ctx)=>{ console.log('undoing ', change) const undoDelta = undoFn(change) console.log('undoDelta: ', undoDelta) - run_apply_delta(undoDelta) + const apply_deltas = apply_deltas_b(ctx) + await apply_deltas(undoDelta) return changes }) }*/ @@ -34,7 +35,7 @@ export const request_checker_timer_b = _b('request_checker_timer', (ctx)=>{ console.log('HERE') const $session_info = session_info.$ if ($session_info) { - await rpc_send_sync_request($session_info) + await rpc_send_sync_request($session_info.scribe) } } } diff --git a/ui/libs/model/src/timers/scribe_heartbeat_timer_b.ts b/ui/libs/model/src/timers/scribe_heartbeat_timer_b.ts index ac00f87d..9a8b60f0 100644 --- a/ui/libs/model/src/timers/scribe_heartbeat_timer_b.ts +++ b/ui/libs/model/src/timers/scribe_heartbeat_timer_b.ts @@ -1,5 +1,5 @@ -import { _b } from '@ctx-core/object' import { PubKeyToFolkRecord, rpc_send_folk_lore_b, rpc_send_heartbeat_b } from '@syn-ui/zome-client' +import { _b } from '@ctx-core/object' import { am_i_scribe_b, folks_b, scribe_b } from '../session' import { _scribe_signal_folk_pubKey_a1_b } from '../delta' import { Timer } from './Timer' diff --git a/ui/libs/model/tsconfig.json b/ui/libs/model/tsconfig.json index 88221382..3667b080 100644 --- a/ui/libs/model/tsconfig.json +++ b/ui/libs/model/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../../tsconfig.json", "compilerOptions": { "outDir": "dist", "declarationDir": "dist", diff --git a/ui/libs/utils/tsconfig.json b/ui/libs/utils/tsconfig.json index 88221382..3667b080 100644 --- a/ui/libs/utils/tsconfig.json +++ b/ui/libs/utils/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../../tsconfig.json", "compilerOptions": { "outDir": "dist", "declarationDir": "dist", diff --git a/ui/libs/zome-client/package.json b/ui/libs/zome-client/package.json index bd2d8588..36e65963 100644 --- a/ui/libs/zome-client/package.json +++ b/ui/libs/zome-client/package.json @@ -7,9 +7,9 @@ "scripts": {}, "devDependencies": { "@ctx-core/function": "^17.4.8", - "@ctx-core/object": "^17.5.13", - "@ctx-core/store": "^24.5.8", - "@holochain/conductor-api": "^0.0.3", + "@ctx-core/object": "^17.5.15", + "@ctx-core/store": "^24.5.9", + "@holochain/conductor-api": "^0.0.4", "@syn-ui/utils": "workspace:^1.0.0", "buffer": "^6.0.3", "typescript": "^4.2.4" diff --git a/ui/libs/zome-client/src/Buffer.ts b/ui/libs/zome-client/src/Buffer.ts index 93c13e60..3a1ba4ff 100644 --- a/ui/libs/zome-client/src/Buffer.ts +++ b/ui/libs/zome-client/src/Buffer.ts @@ -1,6 +1,8 @@ import { Buffer } from 'buffer' export { Buffer } -window.Buffer = Buffer +if (typeof window !== 'undefined') { + window.Buffer = Buffer +} declare global { interface Window { Buffer:typeof Buffer diff --git a/ui/libs/zome-client/src/Commit.ts b/ui/libs/zome-client/src/Commit.ts index 6b47ea77..e51e7f7f 100644 --- a/ui/libs/zome-client/src/Commit.ts +++ b/ui/libs/zome-client/src/Commit.ts @@ -1,9 +1,10 @@ import type { AgentPubKey } from '@holochain/conductor-api' import type { EntryHash, HeaderHash } from '@syn-ui/utils/dist' +import type { Delta } from './Delta' export interface Commit { snapshot:HeaderHash change:{ - deltas:string[] + deltas:string[]|Delta[] content_hash:EntryHash previous_change:EntryHash meta:{ diff --git a/ui/libs/zome-client/src/SessionInfo.ts b/ui/libs/zome-client/src/SessionInfo.ts index 44f992e8..a6596081 100644 --- a/ui/libs/zome-client/src/SessionInfo.ts +++ b/ui/libs/zome-client/src/SessionInfo.ts @@ -1,7 +1,8 @@ import type { AgentPubKey } from '@holochain/conductor-api' -import type { Content } from './Content' import type { EntryHash } from '@syn-ui/utils' +import type { Content } from './Content' export interface SessionInfo { + type:'SessionInfo' session:EntryHash scribe:AgentPubKey snapshot_content:Content diff --git a/ui/libs/zome-client/src/appInfo_b.ts b/ui/libs/zome-client/src/appInfo_b.ts index 40e64450..a49c62fd 100644 --- a/ui/libs/zome-client/src/appInfo_b.ts +++ b/ui/libs/zome-client/src/appInfo_b.ts @@ -1,5 +1,5 @@ -import type { InstalledAppInfo } from '@holochain/conductor-api' -import { _b } from '@ctx-core/object' +import type { InstalledAppInfo, AppWebsocket } from '@holochain/conductor-api' +import { _b, assign } from '@ctx-core/object' import { derived$, Readable$ } from '@ctx-core/store' import { app_ws_b } from './app_ws_b' import { app_id_b } from './app_id_b' @@ -8,11 +8,17 @@ export const appInfo_b = _b('appInfo', (ctx)=>{ const app_ws = app_ws_b(ctx) const appInfo:appInfo_T = derived$([app_ws, app_id], ([$app_ws, $app_id], set)=>{ if (!$app_ws || !$app_id) return - (async()=>{ - set(await $app_ws.appInfo({ installed_app_id: $app_id })) + if (appInfo.$app_ws === $app_ws && appInfo.$app_id === $app_id) return + assign(appInfo, { $app_ws, $app_id }) + ;(async ()=>{ + const $appInfo = await $app_ws.appInfo({ installed_app_id: $app_id }) + set($appInfo) })() }) return appInfo }) export type $appInfo_T = InstalledAppInfo -export interface appInfo_T extends Readable$<$appInfo_T> {} +export interface appInfo_T extends Readable$<$appInfo_T> { + $app_ws?:AppWebsocket + $app_id?:string +} diff --git a/ui/libs/zome-client/src/app_ws_b.ts b/ui/libs/zome-client/src/app_ws_b.ts index af233991..8cfc8d69 100644 --- a/ui/libs/zome-client/src/app_ws_b.ts +++ b/ui/libs/zome-client/src/app_ws_b.ts @@ -1,29 +1,39 @@ import { AppSignal, AppSignalCb, AppWebsocket } from '@holochain/conductor-api' import { _b } from '@ctx-core/object' -import { derived$, Readable } from '@ctx-core/store' +import { derived$, Readable$ } from '@ctx-core/store' import { app_port_b } from './app_port_b' import { app_ws_cb_b } from './app_ws_cb_b' export const app_ws_b = _b('app_ws', (ctx)=>{ const app_port = app_port_b(ctx) const app_ws_cb = app_ws_cb_b(ctx) - let $app_ws:AppWebsocket - return derived$(app_port, ($app_port, set)=>{ + const app_ws:app_ws_T = derived$(app_port, ($app_port, set)=>{ if (!$app_port) return - (async ()=>{ - if ($app_ws) { - await $app_ws.client.close() + if (app_ws.$app_port === $app_port) { + return + } + app_ws.$app_port = $app_port + const close_client = app_ws.$?.client + ;(async ()=>{ + try { + set(await _app_ws($app_port, (signal:AppSignal)=>{ + app_ws_cb.$(signal) + })) + } finally { + if (close_client) { + await close_client.close() + } } - $app_ws = await _app_ws($app_port, (signal:AppSignal)=>{ - app_ws_cb.$(signal) - }) - set($app_ws) })() - }) as Readable<AppWebsocket> + }) + return app_ws }) - export async function _app_ws(app_port:number, signal_fn:AppSignalCb) { return await AppWebsocket.connect( `ws://localhost:${app_port}`, 30000, (signal)=>signal_fn(signal)) } +export type $app_ws_T = null|AppWebsocket +export interface app_ws_T extends Readable$<$app_ws_T> { + $app_port?:number +} diff --git a/ui/libs/zome-client/src/cell_id_b.ts b/ui/libs/zome-client/src/cell_id_b.ts index 8bdf47e7..7401b777 100644 --- a/ui/libs/zome-client/src/cell_id_b.ts +++ b/ui/libs/zome-client/src/cell_id_b.ts @@ -3,7 +3,7 @@ import { derived$ } from '@ctx-core/store' import { appInfo_b } from './appInfo_b' export const cell_id_b = _b('cell_id', (ctx)=>{ const appInfo = appInfo_b(ctx) - return derived$(appInfo, $appInfo=> - $appInfo?.cell_data?.[0]?.cell_id - ) + return derived$(appInfo, $appInfo=>{ + return $appInfo?.cell_data?.[0]?.cell_id + }) }) diff --git a/ui/libs/zome-client/src/index.ts b/ui/libs/zome-client/src/index.ts index bb07502b..31fafdf1 100644 --- a/ui/libs/zome-client/src/index.ts +++ b/ui/libs/zome-client/src/index.ts @@ -22,6 +22,7 @@ export * from './my_tag_b' export * from './Participant' export * from './rpc_b' export * from './rpc_commit_b' +export * from './rpc_get_content_b' export * from './rpc_get_folks_b' export * from './rpc_get_session_b' export * from './rpc_get_sessions_b' diff --git a/ui/libs/zome-client/src/rpc_b.ts b/ui/libs/zome-client/src/rpc_b.ts index 028b7f1f..ff78a484 100644 --- a/ui/libs/zome-client/src/rpc_b.ts +++ b/ui/libs/zome-client/src/rpc_b.ts @@ -1,10 +1,11 @@ -import type { AppWebsocket, AgentPubKey, HoloHash } from '@holochain/conductor-api' +import type { AppWebsocket } from '@holochain/conductor-api' import { _b } from '@ctx-core/object' import { I } from '@ctx-core/combinators' import { subscribe_wait_timeout } from '@ctx-core/store' import { app_ws_b } from './app_ws_b' import { cell_id_b } from './cell_id_b' import { agent_pub_key_b } from './agent_pub_key_b' +import { appInfo_b } from './appInfo_b' export const rpc_b = _b('rpc', (ctx)=>{ const app_ws = app_ws_b(ctx) const cell_id = cell_id_b(ctx) @@ -14,12 +15,10 @@ export const rpc_b = _b('rpc', (ctx)=>{ try { const zome_name = 'syn' console.log(`Making zome call ${fn_name} with:`, payload) - const [$app_ws, $cell_id, $agent_pub_key]:[AppWebsocket, [HoloHash, AgentPubKey], HoloHash] = - await Promise.all([ - subscribe_wait_timeout(app_ws, I, 10_000), - subscribe_wait_timeout(cell_id, I, 10_000), - subscribe_wait_timeout(agent_pub_key, I, 10_000) - ]) + const $app_ws = await subscribe_wait_timeout(app_ws, I, 10_000) as AppWebsocket + await subscribe_wait_timeout(appInfo_b(ctx), I, 10_000) + const $cell_id = await subscribe_wait_timeout(cell_id, I, 10_000) + const $agent_pub_key = await subscribe_wait_timeout(agent_pub_key, I, 10_000) const result = await $app_ws.callZome( { cap: null, diff --git a/ui/libs/zome-client/src/rpc_commit_b.ts b/ui/libs/zome-client/src/rpc_commit_b.ts index 1399894a..07987e81 100644 --- a/ui/libs/zome-client/src/rpc_commit_b.ts +++ b/ui/libs/zome-client/src/rpc_commit_b.ts @@ -1,10 +1,10 @@ -import type { HoloHash } from '@holochain/conductor-api' import { _b } from '@ctx-core/object' +import type { HeaderHash } from '@syn-ui/utils' import { rpc_b } from './rpc_b' import type { Commit } from './Commit' export const rpc_commit_b = _b('rpc_commit', (ctx)=>{ const rpc = rpc_b(ctx) - return async function rpc_commit(commit:Commit):Promise<HoloHash> { + return async function rpc_commit(commit:Commit):Promise<HeaderHash> { return rpc('commit', commit) } }) diff --git a/ui/libs/zome-client/src/rpc_get_content_b.ts b/ui/libs/zome-client/src/rpc_get_content_b.ts new file mode 100644 index 00000000..69123ab7 --- /dev/null +++ b/ui/libs/zome-client/src/rpc_get_content_b.ts @@ -0,0 +1,10 @@ +import { _b } from '@ctx-core/object' +import type { EntryHash } from '@syn-ui/utils' +import { rpc_b } from './rpc_b' +import type { SessionInfo } from './SessionInfo' +export const rpc_get_content_b = _b('rpc_get_content', (ctx) => { + const rpc = rpc_b(ctx) + return async function rpc_get_content(content_hash:EntryHash):Promise<SessionInfo> { + return rpc('get_content', content_hash) + } +}) diff --git a/ui/libs/zome-client/src/rpc_send_folk_lore_b.ts b/ui/libs/zome-client/src/rpc_send_folk_lore_b.ts index d994afb2..8ca86677 100644 --- a/ui/libs/zome-client/src/rpc_send_folk_lore_b.ts +++ b/ui/libs/zome-client/src/rpc_send_folk_lore_b.ts @@ -14,8 +14,9 @@ export const rpc_send_folk_lore_b = _b('rpc_send_folk_lore', (ctx)=>{ }) export interface SendFolkLoreInput { participants:AgentPubKey[] - data:{ - participants?:PubKeyToFolkRecord, - gone?:AgentPubKey[] - } + data:SendFolkLoreInputData +} +export interface SendFolkLoreInputData { + participants?:PubKeyToFolkRecord, + gone?:AgentPubKey[] } diff --git a/ui/libs/zome-client/src/rpc_send_sync_request_b.ts b/ui/libs/zome-client/src/rpc_send_sync_request_b.ts index 71de086e..f0189f7b 100644 --- a/ui/libs/zome-client/src/rpc_send_sync_request_b.ts +++ b/ui/libs/zome-client/src/rpc_send_sync_request_b.ts @@ -1,9 +1,9 @@ +import type { AgentPubKey } from '@holochain/conductor-api' import { _b } from '@ctx-core/object' import { rpc_b } from './rpc_b' -import type { SessionInfo } from './SessionInfo' export const rpc_send_sync_request_b = _b('rpc_send_sync_request', (ctx)=>{ const rpc = rpc_b(ctx) - return async function rpc_send_sync_request(session_info:SessionInfo) { - return rpc('send_sync_request', session_info.scribe) + return async function rpc_send_sync_request(scribe: AgentPubKey) { + return rpc('send_sync_request', { scribe }) } }) diff --git a/ui/libs/zome-client/tsconfig.json b/ui/libs/zome-client/tsconfig.json index 54a7acc1..06628288 100644 --- a/ui/libs/zome-client/tsconfig.json +++ b/ui/libs/zome-client/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../../tsconfig.json", "compilerOptions": { "skipLibCheck": true, "skipDefaultLibCheck": true, From c1c25efcaaf2953a8d73b34cfdcd2806156be21b Mon Sep 17 00:00:00 2001 From: Brian Takita <brian.takita@gmail.com> Date: Fri, 30 Apr 2021 07:22:04 -0400 Subject: [PATCH 18/33] app_ws: writable$ instead of derived$ - app_ws_cb_b --- ui/libs/model/src/actions/join_session.ts | 7 +++-- ui/libs/model/src/session/content_hash_b.ts | 2 +- ui/libs/zome-client/src/appInfo_b.ts | 3 ++ ui/libs/zome-client/src/app_ws_b.ts | 34 +++------------------ ui/libs/zome-client/src/app_ws_cb_b.ts | 8 ----- ui/libs/zome-client/src/index.ts | 1 - 6 files changed, 12 insertions(+), 43 deletions(-) delete mode 100644 ui/libs/zome-client/src/app_ws_cb_b.ts diff --git a/ui/libs/model/src/actions/join_session.ts b/ui/libs/model/src/actions/join_session.ts index 7b093991..d558a9e5 100644 --- a/ui/libs/model/src/actions/join_session.ts +++ b/ui/libs/model/src/actions/join_session.ts @@ -2,7 +2,8 @@ import type { AppSignal } from '@holochain/conductor-api' import { clone } from '@ctx-core/object' import { bufferToBase64 } from '@syn-ui/utils' import { - app_id_b, app_port_b, app_ws_cb_b, me_b, rpc_get_session_b, rpc_new_session_b, + _app_ws, + app_id_b, app_port_b, app_ws_b, me_b, rpc_get_session_b, rpc_new_session_b, rpc_send_sync_request_b, SessionInfo, } from '@syn-ui/zome-client' import { am_i_scribe_b, session_info_b, sessions_b } from '../session' @@ -25,12 +26,12 @@ export async function join_session(params:join_session_params_T) { SyncReq_SignalOps_b(ctx), SyncResp_SignalOps_b(ctx), ) - const app_ws_cb = app_ws_cb_b(ctx) - app_ws_cb.$ = $app_ws_cb const app_id = app_id_b(ctx) app_id.$ = params.app_id const app_port = app_port_b(ctx) app_port.$ = params.app_port + const app_ws = app_ws_b(ctx) + app_ws.$ = await _app_ws(app_port.$, $app_ws_cb) const $sessions = await sessions.load() let $session_info:SessionInfo if ($sessions.length === 0) { diff --git a/ui/libs/model/src/session/content_hash_b.ts b/ui/libs/model/src/session/content_hash_b.ts index 6f5563a3..16df1489 100644 --- a/ui/libs/model/src/session/content_hash_b.ts +++ b/ui/libs/model/src/session/content_hash_b.ts @@ -1,7 +1,7 @@ import { _b } from '@ctx-core/object' import { writable$ } from '@ctx-core/store' -import { session_info_b } from './session_info_b' import type { EntryHash } from '@syn-ui/utils/dist' +import { session_info_b } from './session_info_b' export const content_hash_b = _b('content_hash', (ctx)=>{ const session_info = session_info_b(ctx) const content_hash = writable$<undefined|EntryHash>(undefined) diff --git a/ui/libs/zome-client/src/appInfo_b.ts b/ui/libs/zome-client/src/appInfo_b.ts index a49c62fd..143ba32e 100644 --- a/ui/libs/zome-client/src/appInfo_b.ts +++ b/ui/libs/zome-client/src/appInfo_b.ts @@ -6,12 +6,15 @@ import { app_id_b } from './app_id_b' export const appInfo_b = _b('appInfo', (ctx)=>{ const app_id = app_id_b(ctx) const app_ws = app_ws_b(ctx) + let current_$app_id:string = '' const appInfo:appInfo_T = derived$([app_ws, app_id], ([$app_ws, $app_id], set)=>{ if (!$app_ws || !$app_id) return if (appInfo.$app_ws === $app_ws && appInfo.$app_id === $app_id) return assign(appInfo, { $app_ws, $app_id }) + current_$app_id = $app_id ;(async ()=>{ const $appInfo = await $app_ws.appInfo({ installed_app_id: $app_id }) + if (current_$app_id !== $app_id) return set($appInfo) })() }) diff --git a/ui/libs/zome-client/src/app_ws_b.ts b/ui/libs/zome-client/src/app_ws_b.ts index 8cfc8d69..5e379903 100644 --- a/ui/libs/zome-client/src/app_ws_b.ts +++ b/ui/libs/zome-client/src/app_ws_b.ts @@ -1,31 +1,8 @@ -import { AppSignal, AppSignalCb, AppWebsocket } from '@holochain/conductor-api' +import { AppSignalCb, AppWebsocket } from '@holochain/conductor-api' import { _b } from '@ctx-core/object' -import { derived$, Readable$ } from '@ctx-core/store' -import { app_port_b } from './app_port_b' -import { app_ws_cb_b } from './app_ws_cb_b' -export const app_ws_b = _b('app_ws', (ctx)=>{ - const app_port = app_port_b(ctx) - const app_ws_cb = app_ws_cb_b(ctx) - const app_ws:app_ws_T = derived$(app_port, ($app_port, set)=>{ - if (!$app_port) return - if (app_ws.$app_port === $app_port) { - return - } - app_ws.$app_port = $app_port - const close_client = app_ws.$?.client - ;(async ()=>{ - try { - set(await _app_ws($app_port, (signal:AppSignal)=>{ - app_ws_cb.$(signal) - })) - } finally { - if (close_client) { - await close_client.close() - } - } - })() - }) - return app_ws +import { writable$ } from '@ctx-core/store' +export const app_ws_b = _b('app_ws', ()=>{ + return writable$<$app_ws_T>(null) }) export async function _app_ws(app_port:number, signal_fn:AppSignalCb) { return await AppWebsocket.connect( @@ -34,6 +11,3 @@ export async function _app_ws(app_port:number, signal_fn:AppSignalCb) { (signal)=>signal_fn(signal)) } export type $app_ws_T = null|AppWebsocket -export interface app_ws_T extends Readable$<$app_ws_T> { - $app_port?:number -} diff --git a/ui/libs/zome-client/src/app_ws_cb_b.ts b/ui/libs/zome-client/src/app_ws_cb_b.ts deleted file mode 100644 index c3aecada..00000000 --- a/ui/libs/zome-client/src/app_ws_cb_b.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { AppSignalCb } from '@holochain/conductor-api' -import { _b } from '@ctx-core/object' -import { writable$ } from '@ctx-core/store' -export const app_ws_cb_b = _b('app_ws_cb', ()=> - writable$<AppSignalCb>(()=> - console.warn('Unhandled app_ws callback: app_ws_cb should be set') - ) -) diff --git a/ui/libs/zome-client/src/index.ts b/ui/libs/zome-client/src/index.ts index 31fafdf1..350012a5 100644 --- a/ui/libs/zome-client/src/index.ts +++ b/ui/libs/zome-client/src/index.ts @@ -4,7 +4,6 @@ export * from './app_id_b' export * from './appInfo_b' export * from './app_port_b' export * from './app_ws_b' -export * from './app_ws_cb_b' export * from './Buffer' export * from './cell_id_b' export * from './Commit' From e89cffaa219234831bf3ccf46a754f8508f18d00 Mon Sep 17 00:00:00 2001 From: Brian Takita <brian.takita@gmail.com> Date: Fri, 30 Apr 2021 07:30:50 -0400 Subject: [PATCH 19/33] extracted app_ws_cb_b --- ui/libs/model/src/actions/join_session.ts | 37 ++--------------------- ui/libs/model/src/signals/app_ws_cb_b.ts | 35 +++++++++++++++++++++ ui/libs/model/src/signals/index.ts | 1 + ui/libs/zome-client/src/app_ws_b.ts | 2 +- 4 files changed, 40 insertions(+), 35 deletions(-) create mode 100644 ui/libs/model/src/signals/app_ws_cb_b.ts diff --git a/ui/libs/model/src/actions/join_session.ts b/ui/libs/model/src/actions/join_session.ts index d558a9e5..62b1f317 100644 --- a/ui/libs/model/src/actions/join_session.ts +++ b/ui/libs/model/src/actions/join_session.ts @@ -1,37 +1,19 @@ -import type { AppSignal } from '@holochain/conductor-api' -import { clone } from '@ctx-core/object' -import { bufferToBase64 } from '@syn-ui/utils' import { - _app_ws, - app_id_b, app_port_b, app_ws_b, me_b, rpc_get_session_b, rpc_new_session_b, + _$app_ws, app_id_b, app_port_b, app_ws_b, rpc_get_session_b, rpc_new_session_b, rpc_send_sync_request_b, SessionInfo, } from '@syn-ui/zome-client' import { am_i_scribe_b, session_info_b, sessions_b } from '../session' -import { - Change_SignalOps_b, ChangeReq_SignalOps_b, CommitNotice_SignalOps_b, - FolkLore_SignalOps_b, Heartbeat_SignalOps_b, SignalOps, - SyncReq_SignalOps_b, SyncResp_SignalOps_b -} from '../signals' import { request_checker_timer_b, scribe_heartbeat_timer_b } from '../timers' +import { app_ws_cb_b } from '../signals' export async function join_session(params:join_session_params_T) { const ctx = params.ctx || {} - const me = me_b(ctx) const sessions = sessions_b(ctx) - const signal_ops:SignalOps = clone( - Change_SignalOps_b(ctx), - ChangeReq_SignalOps_b(ctx), - CommitNotice_SignalOps_b(ctx), - FolkLore_SignalOps_b(ctx), - Heartbeat_SignalOps_b(ctx), - SyncReq_SignalOps_b(ctx), - SyncResp_SignalOps_b(ctx), - ) const app_id = app_id_b(ctx) app_id.$ = params.app_id const app_port = app_port_b(ctx) app_port.$ = params.app_port const app_ws = app_ws_b(ctx) - app_ws.$ = await _app_ws(app_port.$, $app_ws_cb) + app_ws.$ = await _$app_ws(app_port.$, app_ws_cb_b(ctx)) const $sessions = await sessions.load() let $session_info:SessionInfo if ($sessions.length === 0) { @@ -54,19 +36,6 @@ export async function join_session(params:join_session_params_T) { const scribe_heartbeat_timer = scribe_heartbeat_timer_b(ctx) scribe_heartbeat_timer.start() return ctx - async function $app_ws_cb(signal:AppSignal) { - // ignore signals not meant for me - if (bufferToBase64(signal.data.cellId[1]) !== me.$) { - return - } - const { signal_name } = signal.data.payload - console.log('Got Signal', signal_name, signal) - const signal_payload_op = signal_ops[signal_name] - if (!signal_payload_op) { - console.warn(`Undefined SignalOp: ${signal_name}`) - } - await signal_payload_op(signal) - } } export interface join_session_params_T { app_port:number diff --git a/ui/libs/model/src/signals/app_ws_cb_b.ts b/ui/libs/model/src/signals/app_ws_cb_b.ts new file mode 100644 index 00000000..47139a37 --- /dev/null +++ b/ui/libs/model/src/signals/app_ws_cb_b.ts @@ -0,0 +1,35 @@ +import type { AppSignal } from '@holochain/conductor-api' +import { _b, clone } from '@ctx-core/object' +import { bufferToBase64 } from '@syn-ui/utils' +import { me_b } from '@syn-ui/zome-client' +import { + Change_SignalOps_b, ChangeReq_SignalOps_b, CommitNotice_SignalOps_b, + FolkLore_SignalOps_b, Heartbeat_SignalOps_b, + SignalOps, SyncReq_SignalOps_b, SyncResp_SignalOps_b +} from '../signals' +export const app_ws_cb_b = _b('app_ws_cb', (ctx) => { + const me = me_b(ctx) + const signal_ops:SignalOps = clone( + Change_SignalOps_b(ctx), + ChangeReq_SignalOps_b(ctx), + CommitNotice_SignalOps_b(ctx), + FolkLore_SignalOps_b(ctx), + Heartbeat_SignalOps_b(ctx), + SyncReq_SignalOps_b(ctx), + SyncResp_SignalOps_b(ctx), + ) + return app_ws_cb + async function app_ws_cb(signal:AppSignal) { + // ignore signals not meant for me + if (bufferToBase64(signal.data.cellId[1]) !== me.$) { + return + } + const { signal_name } = signal.data.payload + console.log('Got Signal', signal_name, signal) + const signal_payload_op = signal_ops[signal_name] + if (!signal_payload_op) { + console.warn(`Undefined SignalOp: ${signal_name}`) + } + await signal_payload_op(signal) + } +}) diff --git a/ui/libs/model/src/signals/index.ts b/ui/libs/model/src/signals/index.ts index 93895c90..e4bc3cf0 100644 --- a/ui/libs/model/src/signals/index.ts +++ b/ui/libs/model/src/signals/index.ts @@ -1,3 +1,4 @@ +export * from './app_ws_cb_b' export * from './ChangeReq_SignalOps_b' export * from './Change_SignalOps_b' export * from './CommitNotice_SignalOps_b' diff --git a/ui/libs/zome-client/src/app_ws_b.ts b/ui/libs/zome-client/src/app_ws_b.ts index 5e379903..1c097efd 100644 --- a/ui/libs/zome-client/src/app_ws_b.ts +++ b/ui/libs/zome-client/src/app_ws_b.ts @@ -4,7 +4,7 @@ import { writable$ } from '@ctx-core/store' export const app_ws_b = _b('app_ws', ()=>{ return writable$<$app_ws_T>(null) }) -export async function _app_ws(app_port:number, signal_fn:AppSignalCb) { +export async function _$app_ws(app_port:number, signal_fn:AppSignalCb) { return await AppWebsocket.connect( `ws://localhost:${app_port}`, 30000, From 3d16c39eda99503dde1389cfff51af89bb8d3fd7 Mon Sep 17 00:00:00 2001 From: Brian Takita <brian.takita@gmail.com> Date: Fri, 30 Apr 2021 23:27:41 -0400 Subject: [PATCH 20/33] fix: Makefile: pnpm to run tests app_ws_b: close when app_port changes update dependencies --- Makefile | 6 +- pnpm-lock.yaml | 68 ++++++++++--------- tests/package.json | 7 +- tests/unit-test/syn.ts | 39 ++++++----- ui/apps/app/package.json | 4 +- ui/apps/headless/package.json | 4 +- ui/libs/model/package.json | 4 +- ui/libs/model/src/actions/join_session.ts | 8 +-- ui/libs/model/src/session/index.ts | 1 + ui/libs/model/src/session/sessions_b.ts | 16 ++--- .../model/src/session/sessions_str_a1_b.ts | 13 ++++ .../model/src/signals/SyncReq_SignalOps_b.ts | 3 +- ui/libs/zome-client/package.json | 2 +- ui/libs/zome-client/src/appInfo_b.ts | 51 ++++++++++---- ui/libs/zome-client/src/app_id_b.ts | 2 +- ui/libs/zome-client/src/app_port_b.ts | 2 +- ui/libs/zome-client/src/app_ws_b.ts | 59 ++++++++++++++-- 17 files changed, 189 insertions(+), 100 deletions(-) create mode 100644 ui/libs/model/src/session/sessions_str_a1_b.ts diff --git a/Makefile b/Makefile index 71fc974c..908c3a3d 100644 --- a/Makefile +++ b/Makefile @@ -55,17 +55,17 @@ test-unit: test-dna: @echo "Starting Scenario tests in $$(pwd)..."; \ - cd tests && npm test + cd tests && ./node_modules/.bin/pnpm test test-dna-debug: @echo "Starting Scenario tests in $$(pwd)..."; \ - cd tests && npm run test-debug + cd tests && ./node_modules/.bin/pnpm run test-debug test-e2e: test-node test-dna test-node: @echo "Setting up Scenario/Stress test Javascript..."; \ - cd tests && npm install && cd .. + cd tests && ./node_modules/.bin/pnpm install && cd .. # Generic targets; does not require a Nix environment .PHONY: clean diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e2d3ceab..6ee21c20 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -25,7 +25,7 @@ importers: tests: specifiers: '@ctx-core/combinators': ^6.0.10 - '@ctx-core/store': ^24.5.9 + '@ctx-core/store': ^24.7.1 '@holochain/conductor-api': 0.0.4 '@holochain/tryorama': 0.4.2 '@syn-ui/model': workspace:^1.0.0 @@ -36,6 +36,7 @@ importers: ava: ^3.15.0 esm: ^3.2.25 lodash: ^4.17.21 + pnpm: ^6.2.3 tape: ^5.2.2 ts-node: ^9.1.1 typescript: ^4.2.4 @@ -49,7 +50,7 @@ importers: uuidv4: 6.2.7 devDependencies: '@ctx-core/combinators': 6.0.10 - '@ctx-core/store': 24.5.9 + '@ctx-core/store': 24.7.1 '@holochain/conductor-api': 0.0.4 '@holochain/tryorama': 0.4.2 '@syn-ui/model': link:../ui/libs/model @@ -58,12 +59,13 @@ importers: '@types/lodash': 4.14.168 '@types/node': 15.0.1 ava: 3.15.0 + pnpm: 6.2.3 ui/apps/app: specifiers: '@ctx-core/combinators': ^6.0.10 '@ctx-core/object': ^17.5.15 - '@ctx-core/store': ^24.5.9 + '@ctx-core/store': ^24.7.1 '@holochain/conductor-api': 0.0.4 '@rollup/plugin-commonjs': ^18.0.0 '@rollup/plugin-node-resolve': ^11.2.1 @@ -80,7 +82,7 @@ importers: rollup-plugin-svelte: ^7.1.0 rollup-plugin-terser: ^7.0.2 sirv-cli: ^1.0.11 - svelte: ^3.37.0 + svelte: ^3.38.0 svelte-check: ^1.5.2 svelte-fa: ^2.2.0 svelte-preprocess: ^4.7.2 @@ -93,7 +95,7 @@ importers: svelte-fa: 2.2.0 devDependencies: '@ctx-core/object': 17.5.15 - '@ctx-core/store': 24.5.9 + '@ctx-core/store': 24.7.1 '@rollup/plugin-commonjs': 18.0.0_rollup@2.46.0 '@rollup/plugin-node-resolve': 11.2.1_rollup@2.46.0 '@rollup/plugin-replace': 2.4.2_rollup@2.46.0 @@ -106,11 +108,11 @@ importers: rollup-plugin-css-only: 3.1.0_rollup@2.46.0 rollup-plugin-livereload: 2.0.0 rollup-plugin-node-polyfills: 0.2.1 - rollup-plugin-svelte: 7.1.0_rollup@2.46.0+svelte@3.37.0 + rollup-plugin-svelte: 7.1.0_rollup@2.46.0+svelte@3.38.0 rollup-plugin-terser: 7.0.2_rollup@2.46.0 - svelte: 3.37.0 - svelte-check: 1.5.2_svelte@3.37.0 - svelte-preprocess: 4.7.2_svelte@3.37.0+typescript@4.2.4 + svelte: 3.38.0 + svelte-check: 1.5.2_svelte@3.38.0 + svelte-preprocess: 4.7.2_svelte@3.38.0+typescript@4.2.4 tslib: 2.2.0 typescript: 4.2.4 @@ -118,7 +120,7 @@ importers: specifiers: '@ctx-core/combinators': ^6.0.10 '@ctx-core/object': ^17.5.15 - '@ctx-core/store': ^24.5.9 + '@ctx-core/store': ^24.7.1 '@holochain/conductor-api': 0.0.4 '@rollup/plugin-commonjs': ^18.0.0 '@rollup/plugin-node-resolve': ^11.2.1 @@ -130,7 +132,7 @@ importers: rollup-plugin-svelte: ^7.1.0 rollup-plugin-terser: ^7.0.2 sirv-cli: ^1.0.11 - svelte: ^3.37.0 + svelte: ^3.38.0 svelte-fa: ^2.2.0 svelte-preprocess: ^4.7.2 typescript: ^4.2.4 @@ -141,7 +143,7 @@ importers: svelte-fa: 2.2.0 devDependencies: '@ctx-core/object': 17.5.15 - '@ctx-core/store': 24.5.9 + '@ctx-core/store': 24.7.1 '@rollup/plugin-commonjs': 18.0.0_rollup@2.46.0 '@rollup/plugin-node-resolve': 11.2.1_rollup@2.46.0 '@rollup/plugin-replace': 2.4.2_rollup@2.46.0 @@ -149,30 +151,30 @@ importers: rollup: 2.46.0 rollup-plugin-css-only: 3.1.0_rollup@2.46.0 rollup-plugin-livereload: 2.0.0 - rollup-plugin-svelte: 7.1.0_rollup@2.46.0+svelte@3.37.0 + rollup-plugin-svelte: 7.1.0_rollup@2.46.0+svelte@3.38.0 rollup-plugin-terser: 7.0.2_rollup@2.46.0 - svelte: 3.37.0 - svelte-preprocess: 4.7.2_svelte@3.37.0+typescript@4.2.4 + svelte: 3.38.0 + svelte-preprocess: 4.7.2_svelte@3.38.0+typescript@4.2.4 typescript: 4.2.4 ui/libs/model: specifiers: '@ctx-core/combinators': ^6.0.10 '@ctx-core/object': ^17.5.15 - '@ctx-core/store': ^24.5.9 + '@ctx-core/store': ^24.7.1 '@holochain/conductor-api': 0.0.4 '@syn-ui/utils': workspace:^1.0.0 '@syn-ui/zome-client': workspace:^1.0.0 - svelte: ^3.37.0 + svelte: ^3.38.0 typescript: ^4.2.4 devDependencies: '@ctx-core/combinators': 6.0.10 '@ctx-core/object': 17.5.15 - '@ctx-core/store': 24.5.9 + '@ctx-core/store': 24.7.1 '@holochain/conductor-api': 0.0.4 '@syn-ui/utils': link:../utils '@syn-ui/zome-client': link:../zome-client - svelte: 3.37.0 + svelte: 3.38.0 typescript: 4.2.4 ui/libs/utils: @@ -185,7 +187,7 @@ importers: specifiers: '@ctx-core/function': ^17.4.8 '@ctx-core/object': ^17.5.15 - '@ctx-core/store': ^24.5.9 + '@ctx-core/store': ^24.7.1 '@holochain/conductor-api': ^0.0.4 '@syn-ui/utils': workspace:^1.0.0 buffer: ^6.0.3 @@ -193,7 +195,7 @@ importers: devDependencies: '@ctx-core/function': 17.4.8 '@ctx-core/object': 17.5.15 - '@ctx-core/store': 24.5.9 + '@ctx-core/store': 24.7.1 '@holochain/conductor-api': 0.0.4 '@syn-ui/utils': link:../utils buffer: 6.0.3 @@ -501,14 +503,14 @@ packages: '@ctx-core/function': 17.4.8 dev: true - /@ctx-core/store/24.5.9: - resolution: {integrity: sha512-N+AKLLWOfXXf1Okk1EbfGHak5nHTuIxERNIvTcjk4TfksEcz6UpyU+AyZ6i0aGyQkFuBVlM5gSti5PTn3UXeEg==} + /@ctx-core/store/24.7.1: + resolution: {integrity: sha512-9ZwBLpT1rvSIDGt9JMQjT4fMDkjPety7Mwdr/vmXzkh6AIRKyeyzyxVSsGB1pgL3sh9QcFTgFMpQyoqdcLyXlQ==} dependencies: '@ctx-core/array': 20.2.18 '@ctx-core/combinators': 6.0.10 '@ctx-core/function': 17.4.8 '@ctx-core/object': 17.5.15 - svelte: 3.37.0 + svelte: 3.38.0 dev: true /@dabh/diagnostics/2.0.2: @@ -3494,7 +3496,7 @@ packages: rollup-plugin-inject: 3.0.2 dev: true - /rollup-plugin-svelte/7.1.0_rollup@2.46.0+svelte@3.37.0: + /rollup-plugin-svelte/7.1.0_rollup@2.46.0+svelte@3.38.0: resolution: {integrity: sha512-vopCUq3G+25sKjwF5VilIbiY6KCuMNHP1PFvx2Vr3REBNMDllKHFZN2B9jwwC+MqNc3UPKkjXnceLPEjTjXGXg==} engines: {node: '>=10'} peerDependencies: @@ -3504,7 +3506,7 @@ packages: require-relative: 0.8.7 rollup: 2.46.0 rollup-pluginutils: 2.8.2 - svelte: 3.37.0 + svelte: 3.38.0 dev: true /rollup-plugin-terser/7.0.2_rollup@2.46.0: @@ -3895,7 +3897,7 @@ packages: has-flag: 4.0.0 dev: true - /svelte-check/1.5.2_svelte@3.37.0: + /svelte-check/1.5.2_svelte@3.38.0: resolution: {integrity: sha512-x9Pc13r814TKrMXY70IyqDEmPzuFiqNSpBmsrMKrFpi995MiG+lmqYnyw8iQC+DGh7H3eUt3LIFXbNd396XIFw==} hasBin: true peerDependencies: @@ -3907,8 +3909,8 @@ packages: import-fresh: 3.3.0 minimist: 1.2.5 source-map: 0.7.3 - svelte: 3.37.0 - svelte-preprocess: 4.7.2_svelte@3.37.0+typescript@4.2.4 + svelte: 3.38.0 + svelte-preprocess: 4.7.2_svelte@3.38.0+typescript@4.2.4 typescript: 4.2.4 transitivePeerDependencies: - '@babel/core' @@ -3927,7 +3929,7 @@ packages: resolution: {integrity: sha512-PN1H8AWDh+OwhwjJKTv4/zXvKvmvOEVSCVhIhji6Onx8XEw+CGf8BDR0BVUIp87IEX+DEqIo9pbyhgz8EoYZyA==} dev: false - /svelte-preprocess/4.7.2_svelte@3.37.0+typescript@4.2.4: + /svelte-preprocess/4.7.2_svelte@3.38.0+typescript@4.2.4: resolution: {integrity: sha512-EToG+08rEsA33btv+C5g2qnRArwpTc5AoU0QBB3ZEkYagxAb2yPNsy0qsmtvbJOTBMy6o3oyijDdl3DMpMvpEg==} engines: {node: '>= 9.11.2'} requiresBuild: true @@ -3972,12 +3974,12 @@ packages: '@types/sass': 1.16.0 detect-indent: 6.0.0 strip-indent: 3.0.0 - svelte: 3.37.0 + svelte: 3.38.0 typescript: 4.2.4 dev: true - /svelte/3.37.0: - resolution: {integrity: sha512-TRF30F4W4+d+Jr2KzUUL1j8Mrpns/WM/WacxYlo5MMb2E5Qy2Pk1Guj6GylxsW9OnKQl1tnF8q3hG/hQ3h6VUA==} + /svelte/3.38.0: + resolution: {integrity: sha512-V0CbyzvXEka7zQtRYt++cpPh0zxxDUTIeNlq4KncGXn2qHnQFZ2i4L4+2QOfLwOudb9cewJeegupBQcscnBaaA==} engines: {node: '>= 8'} dev: true diff --git a/tests/package.json b/tests/package.json index 3c8ff756..92f1c090 100644 --- a/tests/package.json +++ b/tests/package.json @@ -20,7 +20,7 @@ }, "devDependencies": { "@ctx-core/combinators": "^6.0.10", - "@ctx-core/store": "^24.5.9", + "@ctx-core/store": "^24.7.1", "@holochain/conductor-api": "0.0.4", "@holochain/tryorama": "0.4.2", "@syn-ui/model": "workspace:^1.0.0", @@ -28,6 +28,7 @@ "@syn-ui/zome-client": "workspace:^1.0.0", "@types/lodash": "^4.14.168", "@types/node": "^15.0.1", - "ava": "^3.15.0" + "ava": "^3.15.0", + "pnpm": "^6.2.3" } -} \ No newline at end of file +} diff --git a/tests/unit-test/syn.ts b/tests/unit-test/syn.ts index deb510c5..eb465059 100644 --- a/tests/unit-test/syn.ts +++ b/tests/unit-test/syn.ts @@ -35,7 +35,6 @@ module.exports = (orchestrator)=>{ // Delta representation could be JSON or not, for now we are using // json so setting this variable to true const jsonDeltas = true - const [me_player, alice_player, bob_player] = await s.players([config, config, config]) const [[me_happ]] = await me_player.installAgentsHapps(installation) const [[alice_happ]] = await alice_player.installAgentsHapps(installation) @@ -66,14 +65,14 @@ module.exports = (orchestrator)=>{ try { await subscribe_wait_timeout(session_info_b(me_ctx), I, 10_000) // I created the session, so I should be the scribe - t.deepEqual(session_info_b(me_ctx)?.$?.scribe, me_pubkey) + t.deepEqual(session_info_b(me_ctx).$!.scribe, me_pubkey) // First ever session so content should be default content - t.deepEqual(session_info_b(me_ctx)?.$?.snapshot_content, { title: '', body: '' }) - let sessionHash = session_info_b(me_ctx)?.$?.session as EntryHash + t.deepEqual(session_info_b(me_ctx).$!.snapshot_content, { title: '', body: '' }) + let sessionHash = session_info_b(me_ctx).$!.session as EntryHash // check the hash_content zome call. - let hash = await rpc_hash_content_b(me_ctx)(session_info_b(me_ctx)?.$?.snapshot_content as Content) - t.deepEqual(session_info_b(me_ctx)?.$?.content_hash, hash) + let hash = await rpc_hash_content_b(me_ctx)(session_info_b(me_ctx).$!.snapshot_content) + t.deepEqual(session_info_b(me_ctx).$!.content_hash, hash) // check get_sessions utility zome call sessions = await rpc_get_sessions_b(me_ctx)() @@ -83,11 +82,11 @@ module.exports = (orchestrator)=>{ // exercise the get_session zome call const returnedSessionInfo = await rpc_get_session_b(me_ctx)(sessionHash) t.equal(sessions.length, 1) - t.deepEqual(session_info_b(me_ctx)?.$, returnedSessionInfo) + t.deepEqual(session_info_b(me_ctx).$, returnedSessionInfo) // check that initial snapshot was created by using the get_content zome call - const returned_content = await rpc_get_content_b(me_ctx)(session_info_b(me_ctx)?.$?.content_hash as EntryHash) - t.deepEqual(returned_content, session_info_b(me_ctx)?.$?.snapshot_content) + const returned_content = await rpc_get_content_b(me_ctx)(session_info_b(me_ctx).$!.content_hash) + t.deepEqual(returned_content, session_info_b(me_ctx).$!.snapshot_content) // set up the pending deltas array let pending_deltas:Delta[] = [{ type: 'Title', value: 'foo title' }, { type: 'Add', value: [0, 'bar content'] }] @@ -136,11 +135,11 @@ module.exports = (orchestrator)=>{ // add a content change let commit:Commit = { - snapshot: session_info_b(me_ctx)?.$?.content_hash as EntryHash, + snapshot: session_info_b(me_ctx).$!.content_hash as EntryHash, change: { deltas: deltas, content_hash: new_content_hash_1, - previous_change: session_info_b(me_ctx)?.$?.content_hash as EntryHash, // this is the first change so same hash as snapshot + previous_change: session_info_b(me_ctx).$!.content_hash as EntryHash, // this is the first change so same hash as snapshot meta: { contributors: [], witnesses: [], @@ -165,7 +164,7 @@ module.exports = (orchestrator)=>{ deltas = jsonDeltas ? pending_deltas.map(d=>JSON.stringify(d)) : pending_deltas commit = { - snapshot: session_info_b(me_ctx)?.$?.content_hash as EntryHash, + snapshot: session_info_b(me_ctx).$!.content_hash as EntryHash, change: { deltas, content_hash: new_content_hash_2, @@ -187,15 +186,15 @@ module.exports = (orchestrator)=>{ let alice_session_info_$ = alice_session_info.$ // alice_session_info.$ = await rpc_get_session_b(alice_ctx)(sessionHash) // alice should get my session - t.deepEqual(alice_session_info.$?.session, sessionHash) - t.deepEqual(alice_session_info.$?.scribe, me_pubkey) - t.deepEqual(alice_session_info.$?.snapshot_content, { title: '', body: '' }) + t.deepEqual(alice_session_info.$!.session, sessionHash) + t.deepEqual(alice_session_info.$!.scribe, me_pubkey) + t.deepEqual(alice_session_info.$!.snapshot_content, { title: '', body: '' }) await rpc_send_sync_request_b(alice_ctx)(me_pubkey) // check that deltas and snapshot content returned add up to the current real content await delay(500) // make time for integrating new data - const received_deltas:Delta[] = (jsonDeltas ? alice_session_info.$?.deltas.map(d=>JSON.parse(d)) : alice_session_info.$?.deltas) as Delta[] + const received_deltas:Delta[] = (jsonDeltas ? alice_session_info.$!.deltas.map(d=>JSON.parse(d)) : alice_session_info.$!.deltas) as Delta[] await apply_deltas_b(alice_ctx)(received_deltas) t.deepEqual( me_content.$, @@ -204,8 +203,8 @@ module.exports = (orchestrator)=>{ // confirm that the session_info_b(me_ctx)'s content hash matches the content_hash // generated by applying deltas - hash = await rpc_hash_content_b(alice_ctx)(alice_session_info.$?.snapshot_content as Content) - t.deepEqual(alice_session_info.$?.content_hash, hash) + hash = await rpc_hash_content_b(alice_ctx)(alice_session_info.$!.snapshot_content as Content) + t.deepEqual(alice_session_info.$!.content_hash, hash) // I should receive alice's request for the state as she joins the session t.deepEqual(me_signals.$[0], { signal_name: 'SyncReq', signal_payload: alice_pubkey }) @@ -216,7 +215,7 @@ module.exports = (orchestrator)=>{ deltas = jsonDeltas ? pending_deltas.map(d=>JSON.stringify(d)) : pending_deltas const state:StateForSync = { - snapshot: session_info_b(me_ctx)?.$?.content_hash as EntryHash, + snapshot: session_info_b(me_ctx).$!.content_hash as EntryHash, commit: commit_header_hash, commit_content_hash: new_content_hash_2, deltas: pending_deltas, @@ -248,7 +247,7 @@ module.exports = (orchestrator)=>{ let me_ChangeReq_signals_length = filter_signal_name(me_signals.$, 'ChangeReq').length me_signals_length_$ = me_signals_length.$ await rpc_send_change_request_b(alice_ctx)({ - scribe: alice_session_info.$?.scribe as AgentPubKey, + scribe: alice_session_info.$!.scribe, index: 1, deltas: [alice_delta] }) diff --git a/ui/apps/app/package.json b/ui/apps/app/package.json index 2779de1a..36c7ecbb 100644 --- a/ui/apps/app/package.json +++ b/ui/apps/app/package.json @@ -15,7 +15,7 @@ }, "devDependencies": { "@ctx-core/object": "^17.5.15", - "@ctx-core/store": "^24.5.9", + "@ctx-core/store": "^24.7.1", "@rollup/plugin-commonjs": "^18.0.0", "@rollup/plugin-node-resolve": "^11.2.1", "@rollup/plugin-replace": "^2.4.2", @@ -30,7 +30,7 @@ "rollup-plugin-node-polyfills": "^0.2.1", "rollup-plugin-svelte": "^7.1.0", "rollup-plugin-terser": "^7.0.2", - "svelte": "^3.37.0", + "svelte": "^3.38.0", "svelte-check": "^1.5.2", "svelte-preprocess": "^4.7.2", "tslib": "^2.2.0", diff --git a/ui/apps/headless/package.json b/ui/apps/headless/package.json index 62d1f1cb..88051cf5 100644 --- a/ui/apps/headless/package.json +++ b/ui/apps/headless/package.json @@ -14,7 +14,7 @@ }, "devDependencies": { "@ctx-core/object": "^17.5.15", - "@ctx-core/store": "^24.5.9", + "@ctx-core/store": "^24.7.1", "@rollup/plugin-commonjs": "^18.0.0", "@rollup/plugin-node-resolve": "^11.2.1", "@rollup/plugin-replace": "^2.4.2", @@ -24,7 +24,7 @@ "rollup-plugin-livereload": "^2.0.0", "rollup-plugin-svelte": "^7.1.0", "rollup-plugin-terser": "^7.0.2", - "svelte": "^3.37.0", + "svelte": "^3.38.0", "svelte-preprocess": "^4.7.2", "typescript": "^4.2.4" } diff --git a/ui/libs/model/package.json b/ui/libs/model/package.json index 4c2751c4..da69d0ba 100644 --- a/ui/libs/model/package.json +++ b/ui/libs/model/package.json @@ -8,11 +8,11 @@ "devDependencies": { "@ctx-core/combinators": "^6.0.10", "@ctx-core/object": "^17.5.15", - "@ctx-core/store": "^24.5.9", + "@ctx-core/store": "^24.7.1", "@holochain/conductor-api": "0.0.4", "@syn-ui/utils": "workspace:^1.0.0", "@syn-ui/zome-client": "workspace:^1.0.0", - "svelte": "^3.37.0", + "svelte": "^3.38.0", "typescript": "^4.2.4" } } \ No newline at end of file diff --git a/ui/libs/model/src/actions/join_session.ts b/ui/libs/model/src/actions/join_session.ts index 62b1f317..1b3cc1e3 100644 --- a/ui/libs/model/src/actions/join_session.ts +++ b/ui/libs/model/src/actions/join_session.ts @@ -1,8 +1,7 @@ import { - _$app_ws, app_id_b, app_port_b, app_ws_b, rpc_get_session_b, rpc_new_session_b, - rpc_send_sync_request_b, SessionInfo, + app_id_b, app_port_b, app_ws_b, rpc_get_session_b, rpc_new_session_b, rpc_send_sync_request_b, SessionInfo, } from '@syn-ui/zome-client' -import { am_i_scribe_b, session_info_b, sessions_b } from '../session' +import { am_i_scribe_b, session_info_b, sessions_b, sessions_str_a1_b } from '../session' import { request_checker_timer_b, scribe_heartbeat_timer_b } from '../timers' import { app_ws_cb_b } from '../signals' export async function join_session(params:join_session_params_T) { @@ -13,8 +12,9 @@ export async function join_session(params:join_session_params_T) { const app_port = app_port_b(ctx) app_port.$ = params.app_port const app_ws = app_ws_b(ctx) - app_ws.$ = await _$app_ws(app_port.$, app_ws_cb_b(ctx)) + await app_ws.load(app_ws_cb_b(ctx)) const $sessions = await sessions.load() + sessions_str_a1_b(ctx) let $session_info:SessionInfo if ($sessions.length === 0) { const rpc_new_session = rpc_new_session_b(ctx) diff --git a/ui/libs/model/src/session/index.ts b/ui/libs/model/src/session/index.ts index 2c598d6a..104e7d04 100644 --- a/ui/libs/model/src/session/index.ts +++ b/ui/libs/model/src/session/index.ts @@ -8,6 +8,7 @@ export * from './scribe_b' export * from './scribe_str_b' export * from './session_info_b' export * from './sessions_b' +export * from './sessions_str_a1_b' export * from './snapshot_hash_b' export * from './snapshot_hash_str_b' export * from './update_folks_b' diff --git a/ui/libs/model/src/session/sessions_b.ts b/ui/libs/model/src/session/sessions_b.ts index 93321ffc..c66f87a6 100644 --- a/ui/libs/model/src/session/sessions_b.ts +++ b/ui/libs/model/src/session/sessions_b.ts @@ -1,36 +1,36 @@ import { _b, assign } from '@ctx-core/object' -import { Writable$, writable$ } from '@ctx-core/store' +import { _readable_set_ctx$, Writable$ } from '@ctx-core/store' import { rpc_get_sessions_b, SessionInfo } from '@syn-ui/zome-client' import type { EntryHash } from '@syn-ui/utils' import { session_info_b } from './session_info_b' export const sessions_b = _b('sessions', (ctx)=>{ - const sessions = writable$<EntryHash[]|null>(null) - const busy = writable$<boolean>(false) + const { store: sessions, set } = _readable_set_ctx$<EntryHash[]|null>(null) + const { store: busy, set: set_busy } = _readable_set_ctx$<boolean>(false) const out_sessions = sessions as sessions_T assign(out_sessions, { busy, load, unshift }) const session_info = session_info_b(ctx) let $session_info:SessionInfo|null session_info.subscribe(in_$session_info=>{ if ($session_info && !in_$session_info) { - sessions.$ = null + set(null) } $session_info = in_$session_info }) return out_sessions async function load() { - busy.$ = true + set_busy(true) try { const rpc_get_sessions = rpc_get_sessions_b(ctx) - sessions.$ = await rpc_get_sessions() + set(await rpc_get_sessions()) } finally { - busy.$ = false + set_busy(false) } return sessions.$ } function unshift(...session_hash_a1:EntryHash[]) { const $sessions = sessions.$ as EntryHash[] $sessions.unshift(...session_hash_a1) - sessions.set($sessions) + set($sessions) return $sessions } }) diff --git a/ui/libs/model/src/session/sessions_str_a1_b.ts b/ui/libs/model/src/session/sessions_str_a1_b.ts new file mode 100644 index 00000000..55831465 --- /dev/null +++ b/ui/libs/model/src/session/sessions_str_a1_b.ts @@ -0,0 +1,13 @@ +import { _b } from '@ctx-core/object' +import { sessions_b } from './sessions_b' +import { derived$, Readable$ } from '@ctx-core/store' +import { bufferToBase64 } from '@syn-ui/utils/dist' +export const sessions_str_a1_b = _b<sessions_str_a1_T>('sessions_str_a1', (ctx)=>{ + const sessions = sessions_b(ctx) + const sessions_str_a1 = derived$(sessions, $sessions=> + $sessions?.map(session=>bufferToBase64(session)) + ) as sessions_str_a1_T + return sessions_str_a1 +}) +export type $sessions_str_a1_T = null|string[] +export interface sessions_str_a1_T extends Readable$<$sessions_str_a1_T> {} diff --git a/ui/libs/model/src/signals/SyncReq_SignalOps_b.ts b/ui/libs/model/src/signals/SyncReq_SignalOps_b.ts index 0cf8ee7b..2c1a3497 100644 --- a/ui/libs/model/src/signals/SyncReq_SignalOps_b.ts +++ b/ui/libs/model/src/signals/SyncReq_SignalOps_b.ts @@ -24,7 +24,6 @@ export const SyncReq_SignalOps_b = _b<SignalOps>('SyncReq_SignalOps', (ctx)=>{ return { SyncReq: async (signal)=>{ const participant:HoloHash = signal.data.payload.signal_payload - const $me = me.$ const am_i_scribe = am_i_scribe_b(ctx) if (am_i_scribe.$ === true) { update_folks(participant, FOLK_SEEN) @@ -43,7 +42,7 @@ export const SyncReq_SignalOps_b = _b<SignalOps>('SyncReq_SignalOps', (ctx)=>{ const $folks = folks.$ let p = { ...$folks } const agent_pub_key = agent_pub_key_b(ctx) - p[$me] = { + p[me.$] = { pubKey: agent_pub_key.$ } const data = { participants: p } diff --git a/ui/libs/zome-client/package.json b/ui/libs/zome-client/package.json index 36e65963..da5f1fea 100644 --- a/ui/libs/zome-client/package.json +++ b/ui/libs/zome-client/package.json @@ -8,7 +8,7 @@ "devDependencies": { "@ctx-core/function": "^17.4.8", "@ctx-core/object": "^17.5.15", - "@ctx-core/store": "^24.5.9", + "@ctx-core/store": "^24.7.1", "@holochain/conductor-api": "^0.0.4", "@syn-ui/utils": "workspace:^1.0.0", "buffer": "^6.0.3", diff --git a/ui/libs/zome-client/src/appInfo_b.ts b/ui/libs/zome-client/src/appInfo_b.ts index 143ba32e..540c4f83 100644 --- a/ui/libs/zome-client/src/appInfo_b.ts +++ b/ui/libs/zome-client/src/appInfo_b.ts @@ -1,27 +1,52 @@ import type { InstalledAppInfo, AppWebsocket } from '@holochain/conductor-api' import { _b, assign } from '@ctx-core/object' -import { derived$, Readable$ } from '@ctx-core/store' +import { _readable_set_ctx$, derived$, Readable$, Writable$ } from '@ctx-core/store' import { app_ws_b } from './app_ws_b' import { app_id_b } from './app_id_b' +import { app_port_b } from './app_port_b' export const appInfo_b = _b('appInfo', (ctx)=>{ const app_id = app_id_b(ctx) const app_ws = app_ws_b(ctx) - let current_$app_id:string = '' - const appInfo:appInfo_T = derived$([app_ws, app_id], ([$app_ws, $app_id], set)=>{ - if (!$app_ws || !$app_id) return - if (appInfo.$app_ws === $app_ws && appInfo.$app_id === $app_id) return - assign(appInfo, { $app_ws, $app_id }) - current_$app_id = $app_id - ;(async ()=>{ - const $appInfo = await $app_ws.appInfo({ installed_app_id: $app_id }) - if (current_$app_id !== $app_id) return - set($appInfo) - })() + const app_port = app_port_b(ctx) + const { store: appInfo_frame, set: set_appInfo_frame } = _readable_set_ctx$<$appInfo_frame_T>({ + $app_ws: app_ws.$, + $app_id: app_id.$, + $app_port: app_port.$, + done: false, }) + const appInfo:appInfo_T = assign( + derived$([app_ws, app_id, app_port], ([$app_ws, $app_id, $app_port], set)=>{ + if (!$app_ws || !$app_id || !$app_port) return + const $appInfo_frame = { $app_ws, $app_id, $app_port, done: false } + if (_is_current($appInfo_frame)) return + set_appInfo_frame($appInfo_frame) + ;(async ()=>{ + const $appInfo = await $app_ws.appInfo({ installed_app_id: $app_id }) + if (!_is_current($appInfo_frame)) return + set($appInfo) + set_appInfo_frame(assign($appInfo_frame, { done: true })) + })() + }), { + appInfo_frame + } + ) as appInfo_T return appInfo + function _is_current(compare_$appInfo_frame:$appInfo_frame_T) { + const $appInfo_frame = appInfo_frame.$ + return ( + $appInfo_frame.$app_ws === compare_$appInfo_frame.$app_ws + && $appInfo_frame.$app_id === compare_$appInfo_frame.$app_id + && $appInfo_frame.$app_port === compare_$appInfo_frame.$app_port + ) + } }) export type $appInfo_T = InstalledAppInfo -export interface appInfo_T extends Readable$<$appInfo_T> { +export interface $appInfo_frame_T { $app_ws?:AppWebsocket $app_id?:string + $app_port?:number + done:boolean +} +export interface appInfo_T extends Readable$<$appInfo_T>, $appInfo_frame_T { + appInfo_frame:Writable$<$appInfo_frame_T> } diff --git a/ui/libs/zome-client/src/app_id_b.ts b/ui/libs/zome-client/src/app_id_b.ts index 7cb058dc..976988d0 100644 --- a/ui/libs/zome-client/src/app_id_b.ts +++ b/ui/libs/zome-client/src/app_id_b.ts @@ -1,5 +1,5 @@ import { _b } from '@ctx-core/object' import { writable$ } from '@ctx-core/store' export const app_id_b = _b('app_id', ()=>{ - return writable$<string|null>(null) + return writable$<undefined|string>(undefined) }) diff --git a/ui/libs/zome-client/src/app_port_b.ts b/ui/libs/zome-client/src/app_port_b.ts index 6e59014a..c07396bf 100644 --- a/ui/libs/zome-client/src/app_port_b.ts +++ b/ui/libs/zome-client/src/app_port_b.ts @@ -1,5 +1,5 @@ import { _b } from '@ctx-core/object' import { writable$ } from '@ctx-core/store' export const app_port_b = _b('app_port', ()=>{ - return writable$<number|null>(null) + return writable$<undefined|number>(undefined) }) diff --git a/ui/libs/zome-client/src/app_ws_b.ts b/ui/libs/zome-client/src/app_ws_b.ts index 1c097efd..5cbb2d84 100644 --- a/ui/libs/zome-client/src/app_ws_b.ts +++ b/ui/libs/zome-client/src/app_ws_b.ts @@ -1,8 +1,47 @@ import { AppSignalCb, AppWebsocket } from '@holochain/conductor-api' -import { _b } from '@ctx-core/object' -import { writable$ } from '@ctx-core/store' -export const app_ws_b = _b('app_ws', ()=>{ - return writable$<$app_ws_T>(null) +import { _b, assign } from '@ctx-core/object' +import { _readable_set_ctx$, Readable$ } from '@ctx-core/store' +import { app_port_b } from './app_port_b' +export const app_ws_b = _b('app_ws', (ctx)=>{ + const app_port = app_port_b(ctx) + const { store, set } = _readable_set_ctx$<$app_ws_T>(undefined) + const { store: app_ws_frame, set: set_app_ws_frame } = _readable_set_ctx$<$app_ws_frame_T>( + _init_$app_ws_frame() + ) + const app_ws:app_ws_T = assign(store, { + load, + close, + app_ws_frame + }) + return app_ws + async function load(signal_fn:AppSignalCb) { + const $app_port = app_port.$ + if (!$app_port || !($app_port > 0)) throw `app_port.$ must have a value > 0` + const $app_ws_frame = app_ws_frame.$ + if ($app_ws_frame.$app_port === $app_port) return + if ($app_ws_frame.$app_ws) { + await $app_ws_frame.$app_ws.client.socket.close() + } + set_app_ws_frame({ $app_port, done: false }) + const $app_ws = await _$app_ws($app_port, signal_fn) + set_app_ws_frame({ $app_ws, $app_port, done: true }) + set($app_ws) + } + async function close() { + const $app_ws = app_ws.$ + if ($app_ws) { + await $app_ws.client.socket.close() + } + set(undefined) + set_app_ws_frame(_init_$app_ws_frame()) + } + function _init_$app_ws_frame() { + return { + $app_ws: store.$, + $app_port: app_port.$, + done: true + } + } }) export async function _$app_ws(app_port:number, signal_fn:AppSignalCb) { return await AppWebsocket.connect( @@ -10,4 +49,14 @@ export async function _$app_ws(app_port:number, signal_fn:AppSignalCb) { 30000, (signal)=>signal_fn(signal)) } -export type $app_ws_T = null|AppWebsocket +export type $app_ws_T = undefined|AppWebsocket +export interface app_ws_T extends Readable$<$app_ws_T> { + load(signal_fn:AppSignalCb):Promise<void> + close():Promise<void> + app_ws_frame:Readable$<$app_ws_frame_T> +} +export interface $app_ws_frame_T { + $app_ws?:$app_ws_T + $app_port?:number + done:boolean +} From 0a98cb03e47515722c961552dbf0348f515cf693 Mon Sep 17 00:00:00 2001 From: Brian Takita <brian.takita@gmail.com> Date: Fri, 30 Apr 2021 23:57:36 -0400 Subject: [PATCH 21/33] + session_b,session_str_b --- tests/unit-test/syn.ts | 56 +++++++++++----------- ui/libs/model/src/actions/join_session.ts | 3 +- ui/libs/model/src/session/index.ts | 2 + ui/libs/model/src/session/session_b.ts | 9 ++++ ui/libs/model/src/session/session_str_b.ts | 10 ++++ 5 files changed, 51 insertions(+), 29 deletions(-) create mode 100644 ui/libs/model/src/session/session_b.ts create mode 100644 ui/libs/model/src/session/session_str_b.ts diff --git a/tests/unit-test/syn.ts b/tests/unit-test/syn.ts index eb465059..02131e27 100644 --- a/tests/unit-test/syn.ts +++ b/tests/unit-test/syn.ts @@ -68,39 +68,39 @@ module.exports = (orchestrator)=>{ t.deepEqual(session_info_b(me_ctx).$!.scribe, me_pubkey) // First ever session so content should be default content t.deepEqual(session_info_b(me_ctx).$!.snapshot_content, { title: '', body: '' }) - let sessionHash = session_info_b(me_ctx).$!.session as EntryHash + let session_hash = session_info_b(me_ctx).$!.session // check the hash_content zome call. - let hash = await rpc_hash_content_b(me_ctx)(session_info_b(me_ctx).$!.snapshot_content) - t.deepEqual(session_info_b(me_ctx).$!.content_hash, hash) + let content_hash = await rpc_hash_content_b(me_ctx)(session_info_b(me_ctx).$!.snapshot_content) + t.deepEqual(session_info_b(me_ctx).$!.content_hash, content_hash) // check get_sessions utility zome call sessions = await rpc_get_sessions_b(me_ctx)() t.equal(sessions.length, 1) - t.deepEqual(sessions[0], sessionHash) + t.deepEqual(sessions[0], session_hash) // exercise the get_session zome call - const returnedSessionInfo = await rpc_get_session_b(me_ctx)(sessionHash) + const session_info = await rpc_get_session_b(me_ctx)(session_hash) t.equal(sessions.length, 1) - t.deepEqual(session_info_b(me_ctx).$, returnedSessionInfo) + t.deepEqual(session_info_b(me_ctx).$, session_info) // check that initial snapshot was created by using the get_content zome call - const returned_content = await rpc_get_content_b(me_ctx)(session_info_b(me_ctx).$!.content_hash) - t.deepEqual(returned_content, session_info_b(me_ctx).$!.snapshot_content) + let content = await rpc_get_content_b(me_ctx)(session_info_b(me_ctx).$!.content_hash) + t.deepEqual(content, session_info_b(me_ctx).$!.snapshot_content) // set up the pending deltas array let pending_deltas:Delta[] = [{ type: 'Title', value: 'foo title' }, { type: 'Add', value: [0, 'bar content'] }] await apply_deltas_b(me_ctx)(pending_deltas) const me_content = content_b(me_ctx) - const new_content_hash_1 = await rpc_hash_content_b(me_ctx)(me_content.$) + content_hash = await rpc_hash_content_b(me_ctx)(me_content.$) let deltas = jsonDeltas ? pending_deltas.map(d=>JSON.stringify(d)) : pending_deltas // set signal handlers so we can confirm they get sent and received appropriately let me_signals = writable$<Signal[]>([]) const me_signals_length = derived$(me_signals, $me_signals=>$me_signals?.length) - let me_signals_length_$ = me_signals_length.$ + let $me_signals_length = me_signals_length.$ me_player.setSignalHandler((signal)=>{ console.log('Received Signal for me:', signal) me_signals.update($me_signals=>{ @@ -112,7 +112,7 @@ module.exports = (orchestrator)=>{ // alice signal handler const alice_signals = writable$<Signal[]>([]) const alice_signals_length = derived$(alice_signals, $alice_signals=>$alice_signals?.length) - let alice_signals_length_$ = alice_signals_length.$ + let $alice_signals_length = alice_signals_length.$ alice_player.setSignalHandler((signal)=>{ console.log('Received Signal for alice:', signal) alice_signals.update($alice_signals=>{ @@ -124,7 +124,7 @@ module.exports = (orchestrator)=>{ // bob signal handler const bob_signals = writable$<Signal[]>([]) const bob_signals_length = derived$(bob_signals, $bob_signals=>$bob_signals?.length) - let bob_signals_length_$ = bob_signals_length.$ + let $bob_signals_length = bob_signals_length.$ bob_player.setSignalHandler((signal)=>{ console.log('Received Signal for bob:', signal) bob_signals.update($bob_signals=>{ @@ -138,8 +138,8 @@ module.exports = (orchestrator)=>{ snapshot: session_info_b(me_ctx).$!.content_hash as EntryHash, change: { deltas: deltas, - content_hash: new_content_hash_1, - previous_change: session_info_b(me_ctx).$!.content_hash as EntryHash, // this is the first change so same hash as snapshot + content_hash: content_hash, + previous_change: session_info_b(me_ctx).$!.content_hash as EntryHash, // this is the first change so same content_hash as snapshot meta: { contributors: [], witnesses: [], @@ -149,7 +149,7 @@ module.exports = (orchestrator)=>{ participants: [] } let commit_header_hash = await rpc_commit_b(me_ctx)(commit) - t.equal(commit_header_hash.length, 39) // is a hash + t.equal(commit_header_hash.length, 39) // is a content_hash // add a second content change pending_deltas = [ @@ -168,7 +168,7 @@ module.exports = (orchestrator)=>{ change: { deltas, content_hash: new_content_hash_2, - previous_change: new_content_hash_1, // this is the second change so previous commit's hash + previous_change: content_hash, // this is the second change so previous commit's content_hash meta: { contributors: [], witnesses: [], @@ -184,9 +184,9 @@ module.exports = (orchestrator)=>{ // alice joins session const alice_session_info = session_info_b(alice_ctx) let alice_session_info_$ = alice_session_info.$ - // alice_session_info.$ = await rpc_get_session_b(alice_ctx)(sessionHash) + // alice_session_info.$ = await rpc_get_session_b(alice_ctx)(session_hash) // alice should get my session - t.deepEqual(alice_session_info.$!.session, sessionHash) + t.deepEqual(alice_session_info.$!.session, session_hash) t.deepEqual(alice_session_info.$!.scribe, me_pubkey) t.deepEqual(alice_session_info.$!.snapshot_content, { title: '', body: '' }) @@ -201,10 +201,10 @@ module.exports = (orchestrator)=>{ { title: 'foo title', body: 'baz monkey new', meta: { [my_tag_b(me_ctx).$]: 0 } } // content after two commits ) - // confirm that the session_info_b(me_ctx)'s content hash matches the content_hash + // confirm that the session_info_b(me_ctx)'s content content_hash matches the content_hash // generated by applying deltas - hash = await rpc_hash_content_b(alice_ctx)(alice_session_info.$!.snapshot_content as Content) - t.deepEqual(alice_session_info.$!.content_hash, hash) + content_hash = await rpc_hash_content_b(alice_ctx)(alice_session_info.$!.snapshot_content as Content) + t.deepEqual(alice_session_info.$!.content_hash, content_hash) // I should receive alice's request for the state as she joins the session t.deepEqual(me_signals.$[0], { signal_name: 'SyncReq', signal_payload: alice_pubkey }) @@ -220,21 +220,21 @@ module.exports = (orchestrator)=>{ commit_content_hash: new_content_hash_2, deltas: pending_deltas, } - alice_signals_length_$ = alice_signals_length.$ + $alice_signals_length = alice_signals_length.$ await rpc_send_sync_response_b(me_ctx)({ participant: alice_pubkey, state, }) - await subscribe_wait_timeout(alice_signals_length, _neq(alice_signals_length_$), 10_000) - alice_signals_length_$ = alice_signals_length.$ + await subscribe_wait_timeout(alice_signals_length, _neq($alice_signals_length), 10_000) + $alice_signals_length = alice_signals_length.$ // Alice should have received uncommitted deltas - t.equal(alice_signals.$[alice_signals_length_$ - 1].signal_name, 'SyncResp') - let receivedState = alice_signals.$[alice_signals_length_$ - 1].signal_payload + t.equal(alice_signals.$[$alice_signals_length - 1].signal_name, 'SyncResp') + let receivedState = alice_signals.$[$alice_signals_length - 1].signal_payload t.deepEqual(receivedState, { ...state, deltas: pending_deltas.map(d=>JSON.stringify(d)) }) // deltas, commit, and snapshot match // bob joins session - const bob_$session_info = await rpc_get_session_b(bob_ctx)(sessionHash) + const bob_$session_info = await rpc_get_session_b(bob_ctx)(session_hash) // bob should get my session t.deepEqual(bob_$session_info.scribe, me_pubkey) await rpc_send_sync_request_b(bob_ctx)(me_pubkey) @@ -245,7 +245,7 @@ module.exports = (orchestrator)=>{ let delta = jsonDeltas ? JSON.stringify(alice_delta) : alice_delta let me_ChangeReq_signals_length = filter_signal_name(me_signals.$, 'ChangeReq').length - me_signals_length_$ = me_signals_length.$ + $me_signals_length = me_signals_length.$ await rpc_send_change_request_b(alice_ctx)({ scribe: alice_session_info.$!.scribe, index: 1, diff --git a/ui/libs/model/src/actions/join_session.ts b/ui/libs/model/src/actions/join_session.ts index 1b3cc1e3..b4fa48cc 100644 --- a/ui/libs/model/src/actions/join_session.ts +++ b/ui/libs/model/src/actions/join_session.ts @@ -1,7 +1,7 @@ import { app_id_b, app_port_b, app_ws_b, rpc_get_session_b, rpc_new_session_b, rpc_send_sync_request_b, SessionInfo, } from '@syn-ui/zome-client' -import { am_i_scribe_b, session_info_b, sessions_b, sessions_str_a1_b } from '../session' +import { am_i_scribe_b, session_info_b, session_str_b, sessions_b, sessions_str_a1_b } from '../session' import { request_checker_timer_b, scribe_heartbeat_timer_b } from '../timers' import { app_ws_cb_b } from '../signals' export async function join_session(params:join_session_params_T) { @@ -15,6 +15,7 @@ export async function join_session(params:join_session_params_T) { await app_ws.load(app_ws_cb_b(ctx)) const $sessions = await sessions.load() sessions_str_a1_b(ctx) + session_str_b(ctx) let $session_info:SessionInfo if ($sessions.length === 0) { const rpc_new_session = rpc_new_session_b(ctx) diff --git a/ui/libs/model/src/session/index.ts b/ui/libs/model/src/session/index.ts index 104e7d04..0880cbee 100644 --- a/ui/libs/model/src/session/index.ts +++ b/ui/libs/model/src/session/index.ts @@ -7,6 +7,8 @@ export * from './folks_b' export * from './scribe_b' export * from './scribe_str_b' export * from './session_info_b' +export * from './session_b' +export * from './session_str_b' export * from './sessions_b' export * from './sessions_str_a1_b' export * from './snapshot_hash_b' diff --git a/ui/libs/model/src/session/session_b.ts b/ui/libs/model/src/session/session_b.ts new file mode 100644 index 00000000..988b8f35 --- /dev/null +++ b/ui/libs/model/src/session/session_b.ts @@ -0,0 +1,9 @@ +import { _b } from '@ctx-core/object' +import { derived$ } from '@ctx-core/store' +import { session_info_b } from './session_info_b' +export const session_b = _b('session', (ctx) => { + const session_info = session_info_b(ctx) + return derived$(session_info, $session_info=> + $session_info?.session + ) +}) diff --git a/ui/libs/model/src/session/session_str_b.ts b/ui/libs/model/src/session/session_str_b.ts new file mode 100644 index 00000000..8af4a1da --- /dev/null +++ b/ui/libs/model/src/session/session_str_b.ts @@ -0,0 +1,10 @@ +import { _b } from '@ctx-core/object' +import { derived$ } from '@ctx-core/store' +import { bufferToBase64 } from '@syn-ui/utils' +import { session_b } from './session_b' +export const session_str_b = _b('session_str', (ctx) => { + const session = session_b(ctx) + return derived$(session, $session=> + $session ? bufferToBase64($session) : undefined + ) +}) From 27e55dcbe1c1f18cde821cd71b9ca98f7f20310c Mon Sep 17 00:00:00 2001 From: Brian Takita <brian.takita@gmail.com> Date: Sat, 1 May 2021 01:12:03 -0400 Subject: [PATCH 22/33] 4 space indentation --- ui/apps/app/src/App.svelte | 548 +++++++++--------- ui/apps/app/src/Editor.svelte | 118 ++-- ui/apps/app/src/Folk.svelte | 18 +- ui/apps/app/src/History.svelte | 26 +- ui/apps/app/src/Syn.svelte | 11 +- ui/apps/app/src/Title.svelte | 62 +- ui/apps/app/src/main.ts | 7 +- ui/libs/model/src/actions/join_session.ts | 70 +-- ui/libs/model/src/actions/leave_session.ts | 18 +- ui/libs/model/src/actions/toggle_session.ts | 16 +- ui/libs/model/src/colors/CSSifyHSL.ts | 4 +- ui/libs/model/src/colors/arrayBufferToHex.ts | 10 +- ui/libs/model/src/colors/clamp.ts | 2 +- ui/libs/model/src/colors/getFolkColors.ts | 38 +- ui/libs/model/src/colors/my_colors_b.ts | 8 +- ui/libs/model/src/colors/rgbToHsl.ts | 38 +- ui/libs/model/src/content/content_b.ts | 4 +- ui/libs/model/src/delta/ApplyDelta.ts | 8 +- ui/libs/model/src/delta/StateForSync.ts | 16 +- .../delta/_scribe_signal_folk_pubKey_a1_b.ts | 8 +- ui/libs/model/src/delta/apply_deltas_b.ts | 144 ++--- ui/libs/model/src/delta/commit_change_b.ts | 130 ++--- .../model/src/delta/committed_changes_b.ts | 2 +- ui/libs/model/src/delta/deltas_b.ts | 12 +- ui/libs/model/src/delta/next_index_b.ts | 10 +- ui/libs/model/src/delta/record_deltas_b.ts | 66 +-- ui/libs/model/src/delta/recorded_changes_b.ts | 14 +- ui/libs/model/src/delta/request_change_b.ts | 80 +-- .../model/src/delta/requested_changes_b.ts | 2 +- ui/libs/model/src/delta/send_change_b.ts | 20 +- ui/libs/model/src/delta/snapshot_content_b.ts | 10 +- ui/libs/model/src/session/am_i_scribe_b.ts | 10 +- .../model/src/session/commit_in_progress_b.ts | 2 +- ui/libs/model/src/session/content_hash_b.ts | 12 +- .../model/src/session/content_hash_str_b.ts | 10 +- .../session/current_commit_header_hash_b.ts | 2 +- ui/libs/model/src/session/folks_b.ts | 2 +- ui/libs/model/src/session/scribe_b.ts | 8 +- ui/libs/model/src/session/scribe_str_b.ts | 8 +- ui/libs/model/src/session/session_b.ts | 10 +- ui/libs/model/src/session/session_info_b.ts | 22 +- .../src/session/session_info_session_b.ts | 8 +- ui/libs/model/src/session/session_str_b.ts | 10 +- ui/libs/model/src/session/sessions_b.ts | 60 +- .../model/src/session/sessions_str_a1_b.ts | 10 +- ui/libs/model/src/session/snapshot_hash_b.ts | 10 +- .../model/src/session/snapshot_hash_str_b.ts | 10 +- ui/libs/model/src/session/update_folks_b.ts | 62 +- .../src/signals/ChangeReq_SignalOps_b.ts | 60 +- .../model/src/signals/Change_SignalOps_b.ts | 38 +- .../src/signals/CommitNotice_SignalOps_b.ts | 64 +- .../model/src/signals/FolkLore_SignalOps_b.ts | 48 +- .../src/signals/Heartbeat_SignalOps_b.ts | 26 +- .../model/src/signals/SyncReq_SignalOps_b.ts | 90 +-- .../model/src/signals/SyncResp_SignalOps_b.ts | 42 +- ui/libs/model/src/signals/app_ws_cb_b.ts | 54 +- ui/libs/model/src/timers/Timer.ts | 24 +- .../src/timers/request_checker_timer_b.ts | 66 +-- .../src/timers/scribe_heartbeat_timer_b.ts | 64 +- ui/libs/utils/src/base64ToBuffer.ts | 12 +- ui/libs/utils/src/bufferToBase64.ts | 24 +- ui/libs/zome-client/src/ApiResponse.ts | 6 +- ui/libs/zome-client/src/Buffer.ts | 8 +- ui/libs/zome-client/src/Commit.ts | 24 +- ui/libs/zome-client/src/Content.ts | 6 +- ui/libs/zome-client/src/Delta.ts | 22 +- ui/libs/zome-client/src/Folk.ts | 18 +- ui/libs/zome-client/src/FolkColors.ts | 10 +- ui/libs/zome-client/src/Participant.ts | 4 +- ui/libs/zome-client/src/SessionInfo.ts | 14 +- ui/libs/zome-client/src/Signal.ts | 4 +- ui/libs/zome-client/src/StateForSync.ts | 16 +- ui/libs/zome-client/src/agent_pub_key_b.ts | 8 +- ui/libs/zome-client/src/appInfo_b.ts | 76 +-- ui/libs/zome-client/src/app_id_b.ts | 2 +- ui/libs/zome-client/src/app_port_b.ts | 2 +- ui/libs/zome-client/src/app_ws_b.ts | 92 +-- ui/libs/zome-client/src/cell_id_b.ts | 8 +- ui/libs/zome-client/src/decodeJson.ts | 24 +- ui/libs/zome-client/src/dna_b.ts | 8 +- ui/libs/zome-client/src/dna_str_b.ts | 8 +- ui/libs/zome-client/src/encodeJson.ts | 20 +- ui/libs/zome-client/src/me_b.ts | 8 +- ui/libs/zome-client/src/my_tag_b.ts | 10 +- ui/libs/zome-client/src/rpc_b.ts | 62 +- ui/libs/zome-client/src/rpc_commit_b.ts | 8 +- ui/libs/zome-client/src/rpc_get_content_b.ts | 10 +- ui/libs/zome-client/src/rpc_get_folks_b.ts | 8 +- ui/libs/zome-client/src/rpc_get_session_b.ts | 10 +- ui/libs/zome-client/src/rpc_get_sessions_b.ts | 8 +- ui/libs/zome-client/src/rpc_hash_content_b.ts | 8 +- ui/libs/zome-client/src/rpc_new_session_b.ts | 14 +- ui/libs/zome-client/src/rpc_send_change_b.ts | 28 +- .../src/rpc_send_change_request_b.ts | 32 +- .../zome-client/src/rpc_send_folk_lore_b.ts | 20 +- .../zome-client/src/rpc_send_heartbeat_b.ts | 12 +- .../src/rpc_send_sync_request_b.ts | 8 +- .../src/rpc_send_sync_response_b.ts | 22 +- 98 files changed, 1519 insertions(+), 1517 deletions(-) diff --git a/ui/apps/app/src/App.svelte b/ui/apps/app/src/App.svelte index 91aa9072..743eebbf 100644 --- a/ui/apps/app/src/App.svelte +++ b/ui/apps/app/src/App.svelte @@ -1,306 +1,308 @@ <script lang="ts"> - import { setContext } from 'svelte' - import { request_change_b, scribe_str_b } from '@syn-ui/model' - import type { apply_delta_ret_T } from '@syn-ui/model' - import type { AddDelta, Content, DeleteDelta, Delta, MetaDelta, TitleDelta } from '@syn-ui/zome-client' - import Editor from './Editor.svelte' - import Title from './Title.svelte' - import Folks from './Folks.svelte' - import Syn from './Syn.svelte' - import Debug from './Debug.svelte' - import History from './History.svelte' - let ctx = {} - window.ctx = ctx - declare global { - interface Window { - ctx:object + import { setContext } from 'svelte' + import { request_change_b, scribe_str_b } from '@syn-ui/model' + import type { apply_delta_ret_T } from '@syn-ui/model' + import type { AddDelta, Content, DeleteDelta, Delta, MetaDelta, TitleDelta } from '@syn-ui/zome-client' + import Editor from './Editor.svelte' + import Title from './Title.svelte' + import Folks from './Folks.svelte' + import Syn from './Syn.svelte' + import Debug from './Debug.svelte' + import History from './History.svelte' + + let ctx = {} + window.ctx = ctx + declare global { + interface Window { + ctx:object + } } - } - - setContext('ctx', ctx) - const request_change = request_change_b(ctx) - const scribe_str = scribe_str_b(ctx) - - $: disconnected = false - - // definition of how to undo a change, returns a delta that will undo the change - function undo(change) { - const delta = change.delta - switch (delta.type) { - case 'Title': - return { type: 'Title', value: change.deleted } - break - case 'Add': - const [loc, text] = delta.value - return { type: 'Delete', value: [loc, loc + text.length] } - break - case 'Delete': - const [start, end] = delta.value - return { type: 'Add', value: [start, change.deleted] } - break - case 'Meta': - return { type: 'Meta', value: { setLoc: change.deleted } } + + setContext('ctx', ctx) + const request_change = request_change_b(ctx) + const scribe_str = scribe_str_b(ctx) + + $: disconnected = false + + // definition of how to undo a change, returns a delta that will undo the change + function undo(change) { + const delta = change.delta + switch (delta.type) { + case 'Title': + return { type: 'Title', value: change.deleted } + break + case 'Add': + const [loc, text] = delta.value + return { type: 'Delete', value: [loc, loc + text.length] } + break + case 'Delete': + const [start, end] = delta.value + return { type: 'Add', value: [start, change.deleted] } + break + case 'Meta': + return { type: 'Meta', value: { setLoc: change.deleted } } + } } - } - - // definition of how to convert a change to text for the history renderer - function changeToText(change) { - let delta = change.delta - let detail - switch (delta.type) { - case 'Add': - detail = `${delta.value[1]}@${delta.value[0]}` - break - case 'Delete': - detail = `${change.deleted}@${delta.value[0]}` - break - case 'Title': - detail = `${change.deleted}->${delta.value}` - break - case 'Meta': - detail = '' + + // definition of how to convert a change to text for the history renderer + function changeToText(change) { + let delta = change.delta + let detail + switch (delta.type) { + case 'Add': + detail = `${delta.value[1]}@${delta.value[0]}` + break + case 'Delete': + detail = `${change.deleted}@${delta.value[0]}` + break + case 'Title': + detail = `${change.deleted}->${delta.value}` + break + case 'Meta': + detail = '' + } + return `${delta.type}:\n${detail}` } - return `${delta.type}:\n${detail}` - } - - $: noscribe = $scribe_str === '' - let syn - - // The debug drawer's ability to resized and hidden - let resizeable - let resizeHandle - const minDrawerSize = 0 - const maxDrawerSize = document.documentElement.clientHeight - 30 - 10 - const initResizeable = (resizeableEl)=>{ - resizeableEl.style.setProperty('--max-height', `${maxDrawerSize}px`) - resizeableEl.style.setProperty('--min-height', `${minDrawerSize}px`) - } - - const setDrawerHeight = (height)=>{ - document.documentElement.style.setProperty('--resizeable-height', `${height}px`) - } - const getDrawerHeight = ()=>{ - const pxHeight = getComputedStyle(resizeable) - .getPropertyValue('--resizeable-height') - return parseInt(pxHeight, 10) - } - - const startDragging = (event)=>{ - event.preventDefault() - const host = resizeable - const startingDrawerHeight = getDrawerHeight() - const yOffset = event.pageY - - const mouseDragHandler = (moveEvent)=>{ - moveEvent.preventDefault() - const primaryButtonPressed = moveEvent.buttons === 1 - if (!primaryButtonPressed) { - setDrawerHeight(Math.min(Math.max(getDrawerHeight(), minDrawerSize), maxDrawerSize)) - window.removeEventListener('pointermove', mouseDragHandler) - return - } - setDrawerHeight(Math.min(Math.max((yOffset - moveEvent.pageY) + startingDrawerHeight, minDrawerSize), maxDrawerSize)) + + $: noscribe = $scribe_str === '' + let syn + + // The debug drawer's ability to resized and hidden + let resizeable + let resizeHandle + const minDrawerSize = 0 + const maxDrawerSize = document.documentElement.clientHeight - 30 - 10 + const initResizeable = (resizeableEl)=>{ + resizeableEl.style.setProperty('--max-height', `${maxDrawerSize}px`) + resizeableEl.style.setProperty('--min-height', `${minDrawerSize}px`) + } + + const setDrawerHeight = (height)=>{ + document.documentElement.style.setProperty('--resizeable-height', `${height}px`) + } + const getDrawerHeight = ()=>{ + const pxHeight = getComputedStyle(resizeable) + .getPropertyValue('--resizeable-height') + return parseInt(pxHeight, 10) + } + + const startDragging = (event)=>{ + event.preventDefault() + const host = resizeable + const startingDrawerHeight = getDrawerHeight() + const yOffset = event.pageY + + const mouseDragHandler = (moveEvent)=>{ + moveEvent.preventDefault() + const primaryButtonPressed = moveEvent.buttons === 1 + if (!primaryButtonPressed) { + setDrawerHeight(Math.min(Math.max(getDrawerHeight(), minDrawerSize), maxDrawerSize)) + window.removeEventListener('pointermove', mouseDragHandler) + return + } + setDrawerHeight(Math.min(Math.max((yOffset - moveEvent.pageY) + startingDrawerHeight, minDrawerSize), maxDrawerSize)) + } + const remove = window.addEventListener('pointermove', mouseDragHandler) + } + + let drawerHidden = false + const hideDrawer = ()=>{ + drawerHidden = true + } + const showDrawer = ()=>{ + drawerHidden = false + } + + let tabShown = false + const showTab = ()=>{ + tabShown = true + } + const hideTab = ()=>{ + tabShown = false } - const remove = window.addEventListener('pointermove', mouseDragHandler) - } - - let drawerHidden = false - const hideDrawer = ()=>{ - drawerHidden = true - } - const showDrawer = ()=>{ - drawerHidden = false - } - - let tabShown = false - const showTab = ()=>{ - tabShown = true - } - const hideTab = ()=>{ - tabShown = false - } </script> <svelte:head> - <script src='https://kit.fontawesome.com/80d72fa568.js' crossorigin='anonymous'></script> + <script src='https://kit.fontawesome.com/80d72fa568.js' crossorigin='anonymous'></script> </svelte:head> <div class='toolbar'> - <h1>SynText</h1> -<div class:noscribe> - <Title on:request_change={(event) => request_change(event.detail)}/> -</div> + <h1>SynText</h1> + <div class:noscribe> + <Title on:request_change={(event) => request_change(event.detail)}/> + </div> </div> <main> -<div class:noscribe> - <Editor on:request_change={(event) => request_change(event.detail)}/> -</div> + <div class:noscribe> + <Editor on:request_change={(event) => request_change(event.detail)}/> + </div> -<Syn undoFn={undo} bind:this={syn}/> + <Syn undoFn={undo} bind:this={syn}/> </main> <div class='folks-tray'> - <Folks/> + <Folks/> </div> <div class='tab' class:shown={tabShown} class:drawer-hidden={drawerHidden} on:mouseenter={showTab} on:mouseleave={hideTab}> - <div class='tab-inner' class:shown={tabShown} on:click={drawerHidden ? showDrawer() : hideDrawer()}> - <i class:drawer-hidden={drawerHidden} class="tab-icon fas {drawerHidden ? 'fa-chevron-up' : 'fa-chevron-down'}"></i> - </div> + <div class='tab-inner' class:shown={tabShown} on:click={drawerHidden ? showDrawer() : hideDrawer()}> + <i class:drawer-hidden={drawerHidden} + class="tab-icon fas {drawerHidden ? 'fa-chevron-up' : 'fa-chevron-down'}"></i> + </div> </div> <div class='debug-drawer' bind:this={resizeable} use:initResizeable on:mouseenter={showTab} on:mouseleave={hideTab} class:hidden={drawerHidden}> - <div class='handle' bind:this={resizeHandle} on:mousedown={startDragging}></div> - <div class='debug-content'> - <History changeToTextFn={changeToText}/> - <Debug/> - </div> + <div class='handle' bind:this={resizeHandle} on:mousedown={startDragging}></div> + <div class='debug-content'> + <History changeToTextFn={changeToText}/> + <Debug/> + </div> </div> <style global> - main { - padding: 1em; - background: hsla(100, 20%, 50%, .2); - grid-column: 1 / 2; - } - - .toolbar { - background: hsla(19, 20%, 50%, .2); - padding: 2rem; - grid-column: 1 / 2; - } - - .folks-tray { - min-width: calc((var(--folks-padding) * 2) + var(--folk-hex-width)); - width: auto; - background: hsla(255, 20%, 50%, .2); - grid-column: 2 / 3; - grid-row: 1/4; - } - - :global(:root) { - --resizeable-height: 200px; - --tab-width: 60px; - } - - .debug-drawer { - width: 100%; - box-sizing: border-box; - height: var(--resizeable-height); - min-height: var(--min-height); - max-height: var(--max-height); - background: hsla(180, 30%, 85%, 1); - position: absolute; - bottom: 0; - text-align: left; - grid-column: 1 / 2; - overflow: hidden; - z-index: 90; - } - - .hidden { - height: 0; - min-height: 0; - } - - .handle { - height: 1px; - width: 100%; - background-color: hsla(180, 15%, 65%, 1); - z-index: 100; - } - - .handle::after { - content: ''; - height: 9px; - position: absolute; - left: 0; - right: 0; - margin-bottom: -4px; - background-color: transparent; - cursor: ns-resize; - z-index: 101; - } - - /* tab styling reverse-engineered from Atom */ - .tab { - z-index: 130; - position: absolute; - width: var(--tab-width); - height: calc(var(--tab-width) / 2); - left: calc(50% - (var(--tab-width) / 2)); - bottom: var(--resizeable-height); - overflow: hidden; - margin-bottom: -2px; - border-top-left-radius: calc(var(--tab-width) / 2); - border-top-right-radius: calc(var(--tab-width) / 2); - - pointer-events: none; - } - - .tab-inner { - position: absolute; - box-sizing: border-box; /* borders included in size */ - width: var(--tab-width); - height: var(--tab-width); - background: hsla(180, 30%, 85%); - border: 1px solid hsla(180, 20%, 65%, 1); - color: hsla(180, 20%, 50%, 1); /* color of chevron */ - border-radius: calc(var(--tab-width) / 2); - cursor: pointer; - text-align: center; - - top: calc(var(--tab-width) / 2); - transition: transform 0.2s ease-out 0.2s; - } - - .tab.shown { - pointer-events: all; - } - - .tab-inner.shown { - transform: translateY(-50%); - transition: transform 0.2s ease-out 0s; - } - - /* allow the tab to pop up when drawer is hidden */ - .tab.drawer-hidden { - bottom: 0; - pointer-events: all; - } - - .tab-icon { - margin-top: 9px; - } - - .debug-content { - padding: 1rem; - word-wrap: break-word; - height: 100%; - overflow-y: scroll; - box-sizing: border-box; - z-index: 90; - } - - body { - font-family: system-ui, sans-serif; - } - - h1 { - color: #ff3e00; - text-transform: uppercase; - font-size: 4em; - font-weight: 100; - margin: auto; - } - - @media (min-width: 640px) { main { - max-width: none; + padding: 1em; + background: hsla(100, 20%, 50%, .2); + grid-column: 1 / 2; + } + + .toolbar { + background: hsla(19, 20%, 50%, .2); + padding: 2rem; + grid-column: 1 / 2; + } + + .folks-tray { + min-width: calc((var(--folks-padding) * 2) + var(--folk-hex-width)); + width: auto; + background: hsla(255, 20%, 50%, .2); + grid-column: 2 / 3; + grid-row: 1/4; + } + + :global(:root) { + --resizeable-height: 200px; + --tab-width: 60px; + } + + .debug-drawer { + width: 100%; + box-sizing: border-box; + height: var(--resizeable-height); + min-height: var(--min-height); + max-height: var(--max-height); + background: hsla(180, 30%, 85%, 1); + position: absolute; + bottom: 0; + text-align: left; + grid-column: 1 / 2; + overflow: hidden; + z-index: 90; + } + + .hidden { + height: 0; + min-height: 0; + } + + .handle { + height: 1px; + width: 100%; + background-color: hsla(180, 15%, 65%, 1); + z-index: 100; + } + + .handle::after { + content: ''; + height: 9px; + position: absolute; + left: 0; + right: 0; + margin-bottom: -4px; + background-color: transparent; + cursor: ns-resize; + z-index: 101; + } + + /* tab styling reverse-engineered from Atom */ + .tab { + z-index: 130; + position: absolute; + width: var(--tab-width); + height: calc(var(--tab-width) / 2); + left: calc(50% - (var(--tab-width) / 2)); + bottom: var(--resizeable-height); + overflow: hidden; + margin-bottom: -2px; + border-top-left-radius: calc(var(--tab-width) / 2); + border-top-right-radius: calc(var(--tab-width) / 2); + + pointer-events: none; + } + + .tab-inner { + position: absolute; + box-sizing: border-box; /* borders included in size */ + width: var(--tab-width); + height: var(--tab-width); + background: hsla(180, 30%, 85%); + border: 1px solid hsla(180, 20%, 65%, 1); + color: hsla(180, 20%, 50%, 1); /* color of chevron */ + border-radius: calc(var(--tab-width) / 2); + cursor: pointer; + text-align: center; + + top: calc(var(--tab-width) / 2); + transition: transform 0.2s ease-out 0.2s; + } + + .tab.shown { + pointer-events: all; + } + + .tab-inner.shown { + transform: translateY(-50%); + transition: transform 0.2s ease-out 0s; + } + + /* allow the tab to pop up when drawer is hidden */ + .tab.drawer-hidden { + bottom: 0; + pointer-events: all; + } + + .tab-icon { + margin-top: 9px; + } + + .debug-content { + padding: 1rem; + word-wrap: break-word; + height: 100%; + overflow-y: scroll; + box-sizing: border-box; + z-index: 90; + } + + body { + font-family: system-ui, sans-serif; + } + + h1 { + color: #ff3e00; + text-transform: uppercase; + font-size: 4em; + font-weight: 100; + margin: auto; + } + + @media (min-width: 640px) { + main { + max-width: none; + } } - } </style> u diff --git a/ui/apps/app/src/Editor.svelte b/ui/apps/app/src/Editor.svelte index 9f41bcba..9b00bca5 100644 --- a/ui/apps/app/src/Editor.svelte +++ b/ui/apps/app/src/Editor.svelte @@ -12,83 +12,83 @@ const my_colors = my_colors_b(ctx) function getLoc(tag) { - return $content.meta ? ($content.meta[tag] ? $content.meta[tag] : 0) : 0 + return $content.meta ? ($content.meta[tag] ? $content.meta[tag] : 0) : 0 } let editor:HTMLElement let editor_content1:string, editor_content2:string - $: editor_content1 = $content?.body?.slice(0, getLoc($my_tag))||'' - $: editor_content2 = $content?.body?.slice(getLoc($my_tag))||'' + $: editor_content1 = $content?.body?.slice(0, getLoc($my_tag)) || '' + $: editor_content2 = $content?.body?.slice(getLoc($my_tag)) || '' function addText(text) { - const loc = getLoc($my_tag) - const deltas:Delta[] = [{ type: 'Add', value: [loc, text] }] - for (const [tag, tagLoc] of Object.entries($content.meta)) { - if (tagLoc >= loc) { - deltas.push({ type: 'Meta', value: { setLoc: [tag, tagLoc + text.length] } }) + const loc = getLoc($my_tag) + const deltas:Delta[] = [{ type: 'Add', value: [loc, text] }] + for (const [tag, tagLoc] of Object.entries($content.meta)) { + if (tagLoc >= loc) { + deltas.push({ type: 'Meta', value: { setLoc: [tag, tagLoc + text.length] } }) + } } - } - dispatch('request_change', deltas) + dispatch('request_change', deltas) } function handleInput(event) { - const loc = getLoc($my_tag) - const key = event.key - if (key.length == 1) { - addText(key) - } else { - switch (key) { - case 'ArrowRight': - if (loc < $content.body.length) { - dispatch('request_change', [ - { type: 'Meta', value: { setLoc: [$my_tag, loc + 1] } } - ]) - } - break - case 'ArrowLeft': - if (loc > 0) { - dispatch('request_change', [ - { type: 'Meta', value: { setLoc: [$my_tag, loc - 1] } } - ]) - } - break - case 'Enter': - addText('\n') - break - case 'Backspace': - if (loc > 0) { - const deltas:Delta[] = [{ type: 'Delete', value: [loc - 1, loc] }] - for (const [tag, tagLoc] of Object.entries($content.meta)) { - if (tagLoc >= loc) { - deltas.push({ type: 'Meta', value: { setLoc: [tag, tagLoc - 1] } }) - } - } - dispatch('request_change', deltas) + const loc = getLoc($my_tag) + const key = event.key + if (key.length == 1) { + addText(key) + } else { + switch (key) { + case 'ArrowRight': + if (loc < $content.body.length) { + dispatch('request_change', [ + { type: 'Meta', value: { setLoc: [$my_tag, loc + 1] } } + ]) + } + break + case 'ArrowLeft': + if (loc > 0) { + dispatch('request_change', [ + { type: 'Meta', value: { setLoc: [$my_tag, loc - 1] } } + ]) + } + break + case 'Enter': + addText('\n') + break + case 'Backspace': + if (loc > 0) { + const deltas:Delta[] = [{ type: 'Delete', value: [loc - 1, loc] }] + for (const [tag, tagLoc] of Object.entries($content.meta)) { + if (tagLoc >= loc) { + deltas.push({ type: 'Meta', value: { setLoc: [tag, tagLoc - 1] } }) + } + } + dispatch('request_change', deltas) + } } } - } - console.log('input', event.key) + console.log('input', event.key) } function handleClick(e) { - const offset = window.getSelection().focusOffset - let loc = offset > 0 ? offset : 0 - if (window.getSelection().focusNode.parentElement == editor.lastChild) { - loc += editor_content1.length - } - if (loc != getLoc($my_tag)) { - dispatch('request_change', [ - { type: 'Meta', value: { setLoc: [$my_tag, loc] } } - ]) - } + const offset = window.getSelection().focusOffset + let loc = offset > 0 ? offset : 0 + if (window.getSelection().focusNode.parentElement == editor.lastChild) { + loc += editor_content1.length + } + if (loc != getLoc($my_tag)) { + dispatch('request_change', [ + { type: 'Meta', value: { setLoc: [$my_tag, loc] } } + ]) + } } let cursor $: { - // wait for cursor and connection and color inside connection to exist - // before updating the cursor color - if ($my_colors) { - cursor.style['border-color'] = CSSifyHSL($my_colors.primary) - } + // wait for cursor and connection and color inside connection to exist + // before updating the cursor color + if ($my_colors) { + cursor.style['border-color'] = CSSifyHSL($my_colors.primary) + } } </script> diff --git a/ui/apps/app/src/Folk.svelte b/ui/apps/app/src/Folk.svelte index fa1c4915..9f360065 100644 --- a/ui/apps/app/src/Folk.svelte +++ b/ui/apps/app/src/Folk.svelte @@ -16,15 +16,15 @@ let outOfSession $: outOfSession = $folks?.[pubKeyStr]?.inSession && !me function setUpHex(hexEl) { - let colors - if (me) { - colors = $my_colors - } else { - colors = $folks[pubKeyStr].colors - } - hexEl.style['background-color'] = CSSifyHSL(colors.primary) - // hex element's first child is its picture/hexagonColor div - hexEl.firstChild.style['background-color'] = CSSifyHSL(colors.hexagon) + let colors + if (me) { + colors = $my_colors + } else { + colors = $folks[pubKeyStr].colors + } + hexEl.style['background-color'] = CSSifyHSL(colors.primary) + // hex element's first child is its picture/hexagonColor div + hexEl.firstChild.style['background-color'] = CSSifyHSL(colors.hexagon) } </script> diff --git a/ui/apps/app/src/History.svelte b/ui/apps/app/src/History.svelte index 5b97843b..2272a031 100644 --- a/ui/apps/app/src/History.svelte +++ b/ui/apps/app/src/History.svelte @@ -6,18 +6,18 @@ const requested_changes = requested_changes_b(ctx) const recorded_changes = recorded_changes_b(ctx) const committed_changes = committed_changes_b(ctx) - + export let changeToTextFn // returns a list of historyEntry objects with some text // and a status (for styling) function changesToEntriesList(changes, status) { - let entriesList = [] - for (let i=changes.length-1; i>=0; i--) { - const text = changeToTextFn(changes[i]) - entriesList.push({'text': text, 'status': status}) - } - return entriesList + let entriesList = [] + for (let i = changes.length - 1; i >= 0; i--) { + const text = changeToTextFn(changes[i]) + entriesList.push({ 'text': text, 'status': status }) + } + return entriesList } let requestedH @@ -30,12 +30,12 @@ $: {historyEntries = [...requestedH, ...recordedH, ...committedH]} // when updating the list, also scroll to the newest historyEntry - afterUpdate(async () => { - let entryElem = document.getElementsByClassName('history-entries')[0] - if (entryElem.firstChild !== null) { - entryElem.firstChild.scrollIntoView(false) - } - }) + afterUpdate(async ()=>{ + let entryElem = document.getElementsByClassName('history-entries')[0] + if (entryElem.firstChild !== null) { + entryElem.firstChild.scrollIntoView(false) + } + }) </script> <style> diff --git a/ui/apps/app/src/Syn.svelte b/ui/apps/app/src/Syn.svelte index c84b3099..5d00a182 100644 --- a/ui/apps/app/src/Syn.svelte +++ b/ui/apps/app/src/Syn.svelte @@ -1,7 +1,7 @@ <script lang="ts"> import { createEventDispatcher, getContext } from 'svelte' import { - commit_change_b, scribe_str_b, session_info_b, sessions_b, toggle_session + commit_change_b, scribe_str_b, session_info_b, sessions_b, toggle_session } from '@syn-ui/model' import { bufferToBase64 } from '@syn-ui/utils' const ctx = getContext('ctx') @@ -22,10 +22,10 @@ let app_port = 8888 let app_id = 'syn' async function toggle() { - await toggle_session({ app_port, app_id, ctx }) - if (!$session_info) { - console.log('disconnected') - } + await toggle_session({ app_port, app_id, ctx }) + if (!$session_info) { + console.log('disconnected') + } } $: noscribe = $scribe_str === '' @@ -49,7 +49,6 @@ } input { width: 4em; - //border: 2px solid red; border-radius: 4px; } .session { diff --git a/ui/apps/app/src/Title.svelte b/ui/apps/app/src/Title.svelte index bd1498dd..e1f37f17 100644 --- a/ui/apps/app/src/Title.svelte +++ b/ui/apps/app/src/Title.svelte @@ -9,38 +9,38 @@ let editingTitle = false function saveTitle() { - if (editingTitle) { - // only dispatch a changeReq if the title trying to be saved is different - // than the current title - if (titleBeingTyped !== $content.title) { - let delta = { type: 'Title', value: titleBeingTyped } - dispatch('request_change', [delta]) + if (editingTitle) { + // only dispatch a changeReq if the title trying to be saved is different + // than the current title + if (titleBeingTyped !== $content.title) { + let delta = { type: 'Title', value: titleBeingTyped } + dispatch('request_change', [delta]) + } + titleBeingTyped = '' + editingTitle = false + } else { + console.log('Can\'t run saveTitle when it wasn\'t being edited!') } - titleBeingTyped = '' - editingTitle = false - } else { - console.log("Can't run saveTitle when it wasn't being edited!") - } } let titleEl // variable to bind the title input to when it's created async function beginEditTitle() { - titleHover=false - titleBeingTyped = $content.title // fill the field with the current title - editingTitle = true - await tick() // wait for the title input element to be created - titleEl.focus() + titleHover = false + titleBeingTyped = $content.title // fill the field with the current title + editingTitle = true + await tick() // wait for the title input element to be created + titleEl.focus() } function handleTitleKeypress() { - if (event.key == 'Enter') { - saveTitle() - } else if (event.key == 'Escape') { - // don't save new title & discard changes - titleBeingTyped = '' - // turn off editing - editingTitle=false - } + if (event.key == 'Enter') { + saveTitle() + } else if (event.key == 'Escape') { + // don't save new title & discard changes + titleBeingTyped = '' + // turn off editing + editingTitle = false + } } // keep track of whether the doc is untitled @@ -77,10 +77,10 @@ /* input has to be below hover so it overrides */ .title-input { - border-style: solid; - border-color: #ccc; - font-weight: bold; - margin-bottom: 0; + border-style: solid; + border-color: #ccc; + font-weight: bold; + margin-bottom: 0; } .untitled { @@ -91,9 +91,11 @@ <div class='title-wrapper'> Title: {#if editingTitle} - <input class='title-input' bind:value={titleBeingTyped} on:keydown={handleTitleKeypress} on:blur={saveTitle} bind:this={titleEl}/> + <input class='title-input' bind:value={titleBeingTyped} on:keydown={handleTitleKeypress} on:blur={saveTitle} + bind:this={titleEl}/> {:else} - <div class='title' class:title-hover={titleHover} on:mouseenter={()=>{titleHover=true}} on:mouseleave={()=>{titleHover=false}} on:click={beginEditTitle}> + <div class='title' class:title-hover={titleHover} on:mouseenter={()=>{titleHover=true}} + on:mouseleave={()=>{titleHover=false}} on:click={beginEditTitle}> <span class:untitled> {#if untitled} Untitled Document diff --git a/ui/apps/app/src/main.ts b/ui/apps/app/src/main.ts index 4c5a8ed1..5c366e9d 100644 --- a/ui/apps/app/src/main.ts +++ b/ui/apps/app/src/main.ts @@ -2,9 +2,8 @@ import 'svelte' import App from './App.svelte' const app = new App({ - target: document.body, - props: { - } -}); + target: document.body, + props: {} +}) export default app diff --git a/ui/libs/model/src/actions/join_session.ts b/ui/libs/model/src/actions/join_session.ts index b4fa48cc..28c16633 100644 --- a/ui/libs/model/src/actions/join_session.ts +++ b/ui/libs/model/src/actions/join_session.ts @@ -1,45 +1,45 @@ import { - app_id_b, app_port_b, app_ws_b, rpc_get_session_b, rpc_new_session_b, rpc_send_sync_request_b, SessionInfo, + app_id_b, app_port_b, app_ws_b, rpc_get_session_b, rpc_new_session_b, rpc_send_sync_request_b, SessionInfo, } from '@syn-ui/zome-client' import { am_i_scribe_b, session_info_b, session_str_b, sessions_b, sessions_str_a1_b } from '../session' import { request_checker_timer_b, scribe_heartbeat_timer_b } from '../timers' import { app_ws_cb_b } from '../signals' export async function join_session(params:join_session_params_T) { - const ctx = params.ctx || {} - const sessions = sessions_b(ctx) - const app_id = app_id_b(ctx) - app_id.$ = params.app_id - const app_port = app_port_b(ctx) - app_port.$ = params.app_port - const app_ws = app_ws_b(ctx) - await app_ws.load(app_ws_cb_b(ctx)) - const $sessions = await sessions.load() - sessions_str_a1_b(ctx) - session_str_b(ctx) - let $session_info:SessionInfo - if ($sessions.length === 0) { - const rpc_new_session = rpc_new_session_b(ctx) - $session_info = await rpc_new_session() - sessions.unshift($session_info.session) - } else { - const rpc_get_session = rpc_get_session_b(ctx) - $session_info = await rpc_get_session($sessions[0]) - const am_i_scribe = am_i_scribe_b(ctx) - if (am_i_scribe.$ === true) { - const rpc_send_sync_request = rpc_send_sync_request_b(ctx) - await rpc_send_sync_request($session_info.scribe) + const ctx = params.ctx || {} + const sessions = sessions_b(ctx) + const app_id = app_id_b(ctx) + app_id.$ = params.app_id + const app_port = app_port_b(ctx) + app_port.$ = params.app_port + const app_ws = app_ws_b(ctx) + await app_ws.load(app_ws_cb_b(ctx)) + const $sessions = await sessions.load() + sessions_str_a1_b(ctx) + session_str_b(ctx) + let $session_info:SessionInfo + if ($sessions.length === 0) { + const rpc_new_session = rpc_new_session_b(ctx) + $session_info = await rpc_new_session() + sessions.unshift($session_info.session) + } else { + const rpc_get_session = rpc_get_session_b(ctx) + $session_info = await rpc_get_session($sessions[0]) + const am_i_scribe = am_i_scribe_b(ctx) + if (am_i_scribe.$ === true) { + const rpc_send_sync_request = rpc_send_sync_request_b(ctx) + await rpc_send_sync_request($session_info.scribe) + } } - } - const session_info = session_info_b(ctx) - session_info.$ = $session_info - const request_checker_timer = request_checker_timer_b(ctx) - request_checker_timer.start() - const scribe_heartbeat_timer = scribe_heartbeat_timer_b(ctx) - scribe_heartbeat_timer.start() - return ctx + const session_info = session_info_b(ctx) + session_info.$ = $session_info + const request_checker_timer = request_checker_timer_b(ctx) + request_checker_timer.start() + const scribe_heartbeat_timer = scribe_heartbeat_timer_b(ctx) + scribe_heartbeat_timer.start() + return ctx } export interface join_session_params_T { - app_port:number - app_id:string - ctx?:object + app_port:number + app_id:string + ctx?:object } diff --git a/ui/libs/model/src/actions/leave_session.ts b/ui/libs/model/src/actions/leave_session.ts index cbf54a66..b40dd478 100644 --- a/ui/libs/model/src/actions/leave_session.ts +++ b/ui/libs/model/src/actions/leave_session.ts @@ -1,15 +1,15 @@ import { session_info_b } from '../session' import { request_checker_timer_b, scribe_heartbeat_timer_b } from '../timers' export async function leave_session(params:leave_session_params_I) { - const ctx = params.ctx || {} - const session_info = session_info_b(ctx) - session_info.$ = null - const request_checker_timer = request_checker_timer_b(ctx) - request_checker_timer.stop() - const scribe_heartbeat_timer = scribe_heartbeat_timer_b(ctx) - scribe_heartbeat_timer.stop() - return ctx + const ctx = params.ctx || {} + const session_info = session_info_b(ctx) + session_info.$ = null + const request_checker_timer = request_checker_timer_b(ctx) + request_checker_timer.stop() + const scribe_heartbeat_timer = scribe_heartbeat_timer_b(ctx) + scribe_heartbeat_timer.stop() + return ctx } export interface leave_session_params_I { - ctx?:object + ctx?:object } diff --git a/ui/libs/model/src/actions/toggle_session.ts b/ui/libs/model/src/actions/toggle_session.ts index 13dde320..e35696e6 100644 --- a/ui/libs/model/src/actions/toggle_session.ts +++ b/ui/libs/model/src/actions/toggle_session.ts @@ -4,13 +4,13 @@ import type { join_session_params_T } from './join_session' import { leave_session } from './leave_session' import { join_session } from './join_session' export async function toggle_session(params:join_session_params_T) { - const ctx = params.ctx || {} - const session_info = session_info_b(ctx) - return ( - session_info.$ - ? leave_session({ ctx }) - : join_session( - clone<join_session_params_T>(params, { ctx }) + const ctx = params.ctx || {} + const session_info = session_info_b(ctx) + return ( + session_info.$ + ? leave_session({ ctx }) + : join_session( + clone<join_session_params_T>(params, { ctx }) + ) ) - ) } diff --git a/ui/libs/model/src/colors/CSSifyHSL.ts b/ui/libs/model/src/colors/CSSifyHSL.ts index ff730fce..1378fbd2 100644 --- a/ui/libs/model/src/colors/CSSifyHSL.ts +++ b/ui/libs/model/src/colors/CSSifyHSL.ts @@ -1,5 +1,5 @@ import type { HSL } from '@syn-ui/zome-client' export function CSSifyHSL(hslArray:HSL) { - const [h, s, l] = hslArray - return `hsl(${h} ${s}% ${l}%)` + const [h, s, l] = hslArray + return `hsl(${h} ${s}% ${l}%)` } diff --git a/ui/libs/model/src/colors/arrayBufferToHex.ts b/ui/libs/model/src/colors/arrayBufferToHex.ts index 8ebac0df..3aeb2693 100644 --- a/ui/libs/model/src/colors/arrayBufferToHex.ts +++ b/ui/libs/model/src/colors/arrayBufferToHex.ts @@ -1,9 +1,9 @@ import type { HoloHash } from '@holochain/conductor-api' // returns binary input as hex number string (e.g. 'a293b8e1a') export function arrayBufferToHex(buffer:HoloHash) { - let hexString = '' - buffer.forEach(byte=> - hexString += byte.toString(16) - ) - return hexString + let hexString = '' + buffer.forEach(byte=> + hexString += byte.toString(16) + ) + return hexString } diff --git a/ui/libs/model/src/colors/clamp.ts b/ui/libs/model/src/colors/clamp.ts index 57b7be27..0b6a9f7b 100644 --- a/ui/libs/model/src/colors/clamp.ts +++ b/ui/libs/model/src/colors/clamp.ts @@ -1,4 +1,4 @@ // Source: https://stackoverflow.com/questions/5842747 export function clamp(value, min, max) { - return Math.min(Math.max(value, min), max) + return Math.min(Math.max(value, min), max) } diff --git a/ui/libs/model/src/colors/getFolkColors.ts b/ui/libs/model/src/colors/getFolkColors.ts index 3501daa7..40a68a0d 100644 --- a/ui/libs/model/src/colors/getFolkColors.ts +++ b/ui/libs/model/src/colors/getFolkColors.ts @@ -13,23 +13,23 @@ import { clamp } from './clamp' // where Color is array: [h, s, l] // used in `use:setColor` on new Folk components export function getFolkColors(pubKey:AgentPubKey):FolkColors { - // get a hex color from the folk's public key - const hexColor = '#' + arrayBufferToHex(pubKey).slice(-6) - // extract the RGB components from the hex color notation. - // Source: https://stackoverflow.com/questions/3732046 - const r = parseInt(hexColor.substr(1, 2), 16) // Grab the hex representation of red (chars 1-2) and convert to decimal (base 10). - const g = parseInt(hexColor.substr(3, 2), 16) - const b = parseInt(hexColor.substr(5, 2), 16) - // convert to HSL - let hsl = rgbToHsl(r, g, b) - // limit color to be bright enough and not too bright - hsl[1] = clamp(hsl[1], 10, 90) // limit s - const [h, s] = hsl // destructure - return { - primary: [h, s, 50], - hexagon: [h, s, 25], - selection: [h, s, 90], // placeholder values from here down - lookingSelection: [h, s, 80], - lookingCursor: [h, s + 10, 40], - } + // get a hex color from the folk's public key + const hexColor = '#' + arrayBufferToHex(pubKey).slice(-6) + // extract the RGB components from the hex color notation. + // Source: https://stackoverflow.com/questions/3732046 + const r = parseInt(hexColor.substr(1, 2), 16) // Grab the hex representation of red (chars 1-2) and convert to decimal (base 10). + const g = parseInt(hexColor.substr(3, 2), 16) + const b = parseInt(hexColor.substr(5, 2), 16) + // convert to HSL + let hsl = rgbToHsl(r, g, b) + // limit color to be bright enough and not too bright + hsl[1] = clamp(hsl[1], 10, 90) // limit s + const [h, s] = hsl // destructure + return { + primary: [h, s, 50], + hexagon: [h, s, 25], + selection: [h, s, 90], // placeholder values from here down + lookingSelection: [h, s, 80], + lookingCursor: [h, s + 10, 40], + } } diff --git a/ui/libs/model/src/colors/my_colors_b.ts b/ui/libs/model/src/colors/my_colors_b.ts index 064eb7e6..8e1a1876 100644 --- a/ui/libs/model/src/colors/my_colors_b.ts +++ b/ui/libs/model/src/colors/my_colors_b.ts @@ -3,8 +3,8 @@ import { derived$ } from '@ctx-core/store' import { agent_pub_key_b } from '@syn-ui/zome-client' import { getFolkColors } from './getFolkColors' export const my_colors_b = _b('my_colors', (ctx)=>{ - const agent_pub_key = agent_pub_key_b(ctx) - return derived$(agent_pub_key, $agent_pub_key=> - $agent_pub_key ? getFolkColors($agent_pub_key) : null - ) + const agent_pub_key = agent_pub_key_b(ctx) + return derived$(agent_pub_key, $agent_pub_key=> + $agent_pub_key ? getFolkColors($agent_pub_key) : null + ) }) diff --git a/ui/libs/model/src/colors/rgbToHsl.ts b/ui/libs/model/src/colors/rgbToHsl.ts index 56235daf..f4381e29 100644 --- a/ui/libs/model/src/colors/rgbToHsl.ts +++ b/ui/libs/model/src/colors/rgbToHsl.ts @@ -1,24 +1,24 @@ // converts RGB to HSL // Source: https://gist.github.com/mjackson/5311256 export function rgbToHsl(r:number, g:number, b:number) { - r /= 255, g /= 255, b /= 255 - let max = Math.max(r, g, b), min = Math.min(r, g, b) - let h, s, l = (max + min) / 2 - if (max == min) { h = s = 0} else { - let d = max - min - s = l > 0.5 ? d / (2 - max - min) : d / (max + min) - switch (max) { - case r: - h = (g - b) / d + (g < b ? 6 : 0) - break - case g: - h = (b - r) / d + 2 - break - case b: - h = (r - g) / d + 4 - break + r /= 255, g /= 255, b /= 255 + let max = Math.max(r, g, b), min = Math.min(r, g, b) + let h, s, l = (max + min) / 2 + if (max == min) { h = s = 0} else { + let d = max - min + s = l > 0.5 ? d / (2 - max - min) : d / (max + min) + switch (max) { + case r: + h = (g - b) / d + (g < b ? 6 : 0) + break + case g: + h = (b - r) / d + 2 + break + case b: + h = (r - g) / d + 4 + break + } + h /= 6 } - h /= 6 - } - return [h * 360, s * 100, l * 100] + return [h * 360, s * 100, l * 100] } diff --git a/ui/libs/model/src/content/content_b.ts b/ui/libs/model/src/content/content_b.ts index 2b16a35b..1dd8ef11 100644 --- a/ui/libs/model/src/content/content_b.ts +++ b/ui/libs/model/src/content/content_b.ts @@ -2,6 +2,6 @@ import { _b } from '@ctx-core/object' import { writable$ } from '@ctx-core/store' import type { Content } from '@syn-ui/zome-client' export const content_b = _b('content', ()=>{ - const content = writable$<Content>({ title: '', body: '', meta: {} }) - return content + const content = writable$<Content>({ title: '', body: '', meta: {} }) + return content }) diff --git a/ui/libs/model/src/delta/ApplyDelta.ts b/ui/libs/model/src/delta/ApplyDelta.ts index 482a97bf..23d92f1e 100644 --- a/ui/libs/model/src/delta/ApplyDelta.ts +++ b/ui/libs/model/src/delta/ApplyDelta.ts @@ -1,9 +1,9 @@ import type { Content, Delta } from '@syn-ui/zome-client' export interface ApplyDelta { - delta:Delta - deleted?:ApplyDelta_deleted_T - id?:string - at?:number + delta:Delta + deleted?:ApplyDelta_deleted_T + id?:string + at?:number } export type ApplyDelta_deleted_T = string|[string, number] export type apply_delta_ret_T = [Content, ApplyDelta] diff --git a/ui/libs/model/src/delta/StateForSync.ts b/ui/libs/model/src/delta/StateForSync.ts index 7af6d6c1..a09fb200 100644 --- a/ui/libs/model/src/delta/StateForSync.ts +++ b/ui/libs/model/src/delta/StateForSync.ts @@ -1,14 +1,14 @@ import type { HoloHash } from '@holochain/conductor-api' import type { DeltaValue } from '@syn-ui/zome-client' export interface StateForSync { - snapshot:HoloHash, - commit:HoloHash, - commit_content_hash:HoloHash - deltas:DeltaValue[], + snapshot:HoloHash, + commit:HoloHash, + commit_content_hash:HoloHash + deltas:DeltaValue[], } export interface SerializedStateForSync { - snapshot:HoloHash, - commit:HoloHash, - commit_content_hash:HoloHash - deltas:string[], + snapshot:HoloHash, + commit:HoloHash, + commit_content_hash:HoloHash + deltas:string[], } diff --git a/ui/libs/model/src/delta/_scribe_signal_folk_pubKey_a1_b.ts b/ui/libs/model/src/delta/_scribe_signal_folk_pubKey_a1_b.ts index 09334938..eeb13d6d 100644 --- a/ui/libs/model/src/delta/_scribe_signal_folk_pubKey_a1_b.ts +++ b/ui/libs/model/src/delta/_scribe_signal_folk_pubKey_a1_b.ts @@ -3,8 +3,8 @@ import { _b } from '@ctx-core/object' import type { PubKeyToFolkRecord } from '@syn-ui/zome-client' import { folks_b } from '../session' export const _scribe_signal_folk_pubKey_a1_b = _b('_scribe_signal_folk_pubKey_a1', (ctx)=>{ - const folks = folks_b(ctx) - return function _scribe_signal_folk_pubKey_a1():AgentPubKey[] { - return Object.values(folks.$ as PubKeyToFolkRecord).filter(v=>v.inSession).map(v=>v.pubKey) - } + const folks = folks_b(ctx) + return function _scribe_signal_folk_pubKey_a1():AgentPubKey[] { + return Object.values(folks.$ as PubKeyToFolkRecord).filter(v=>v.inSession).map(v=>v.pubKey) + } }) diff --git a/ui/libs/model/src/delta/apply_deltas_b.ts b/ui/libs/model/src/delta/apply_deltas_b.ts index 51795af8..11187af4 100644 --- a/ui/libs/model/src/delta/apply_deltas_b.ts +++ b/ui/libs/model/src/delta/apply_deltas_b.ts @@ -1,6 +1,6 @@ import { _b } from '@ctx-core/object' import { - Content, Delta, AddDelta, DeleteDelta, MetaDelta, TitleDelta, my_tag_b, rpc_hash_content_b + Content, Delta, AddDelta, DeleteDelta, MetaDelta, TitleDelta, my_tag_b, rpc_hash_content_b } from '@syn-ui/zome-client' import { content_b } from '../content' import { content_hash_b } from '../session' @@ -9,79 +9,79 @@ import { deltas_b } from './deltas_b' import { snapshot_content_b } from './snapshot_content_b' import { committed_changes_b } from './committed_changes_b' export const apply_deltas_b = _b('apply_deltas', (ctx)=>{ - const content = content_b(ctx) - const my_tag = my_tag_b(ctx) - const deltas = deltas_b(ctx) - const snapshot_content = snapshot_content_b(ctx) - const committed_changes = committed_changes_b(ctx) - let current_$snapshot_content:undefined|Content - snapshot_content.subscribe(async $snapshot_content=>{ - if (!$snapshot_content || current_$snapshot_content === $snapshot_content) return - current_$snapshot_content = $snapshot_content - const $my_tag = my_tag.$ - const $content:Content = { - title: $snapshot_content.title, - body: $snapshot_content.body, - meta: {} - } - if ($my_tag) { - $content.meta[$my_tag] = 0 - } - content.$ = $content - const new_$committed_changes:ApplyDelta[] = [] - new_$committed_changes.push( - ...(await apply_deltas(deltas.$ || [])) - ) - committed_changes.update($committed_changes=>{ - $committed_changes.push(...new_$committed_changes) - return $committed_changes - }) - }) - return apply_deltas - async function apply_deltas(deltas:Delta[]):Promise<ApplyDelta[]> { - const $content = content.$ - const undoable_changes:ApplyDelta[] = [] - for (const delta of deltas) { - switch (delta.type) { - case 'Title': { - const deleted = $content.title - const Title_delta = delta as TitleDelta - $content.title = Title_delta.value - undoable_changes.push({ delta, deleted }) - break + const content = content_b(ctx) + const my_tag = my_tag_b(ctx) + const deltas = deltas_b(ctx) + const snapshot_content = snapshot_content_b(ctx) + const committed_changes = committed_changes_b(ctx) + let current_$snapshot_content:undefined|Content + snapshot_content.subscribe(async $snapshot_content=>{ + if (!$snapshot_content || current_$snapshot_content === $snapshot_content) return + current_$snapshot_content = $snapshot_content + const $my_tag = my_tag.$ + const $content:Content = { + title: $snapshot_content.title, + body: $snapshot_content.body, + meta: {} } - case 'Add': { - const Add_delta = delta as AddDelta - const [loc, text] = Add_delta.value - $content.body = $content.body.slice(0, loc) + text + $content.body.slice(loc) - undoable_changes.push({ delta }) - break + if ($my_tag) { + $content.meta[$my_tag] = 0 } - case 'Delete': { - const Delete_delta = delta as DeleteDelta - const [start, end] = Delete_delta.value - const deleted = $content.body.slice(start, end) - $content.body = $content.body.slice(0, start) + $content.body.slice(end) - undoable_changes.push({ delta, deleted }) - break - } - case 'Meta': { - const Meta_delta = delta as MetaDelta - const [tag, loc] = Meta_delta.value.setLoc - const deleted:[string, number] = [tag, $content.meta[tag]] - $content.meta[tag] = loc - undoable_changes.push({ delta, deleted }) - break - } - default: { - throw `Unsupported delta.type ${delta.type}` + content.$ = $content + const new_$committed_changes:ApplyDelta[] = [] + new_$committed_changes.push( + ...(await apply_deltas(deltas.$ || [])) + ) + committed_changes.update($committed_changes=>{ + $committed_changes.push(...new_$committed_changes) + return $committed_changes + }) + }) + return apply_deltas + async function apply_deltas(deltas:Delta[]):Promise<ApplyDelta[]> { + const $content = content.$ + const undoable_changes:ApplyDelta[] = [] + for (const delta of deltas) { + switch (delta.type) { + case 'Title': { + const deleted = $content.title + const Title_delta = delta as TitleDelta + $content.title = Title_delta.value + undoable_changes.push({ delta, deleted }) + break + } + case 'Add': { + const Add_delta = delta as AddDelta + const [loc, text] = Add_delta.value + $content.body = $content.body.slice(0, loc) + text + $content.body.slice(loc) + undoable_changes.push({ delta }) + break + } + case 'Delete': { + const Delete_delta = delta as DeleteDelta + const [start, end] = Delete_delta.value + const deleted = $content.body.slice(start, end) + $content.body = $content.body.slice(0, start) + $content.body.slice(end) + undoable_changes.push({ delta, deleted }) + break + } + case 'Meta': { + const Meta_delta = delta as MetaDelta + const [tag, loc] = Meta_delta.value.setLoc + const deleted:[string, number] = [tag, $content.meta[tag]] + $content.meta[tag] = loc + undoable_changes.push({ delta, deleted }) + break + } + default: { + throw `Unsupported delta.type ${delta.type}` + } + } } - } + content.$ = $content + const rpc_hash_content = rpc_hash_content_b(ctx) + const content_hash = content_hash_b(ctx) + content_hash.$ = await rpc_hash_content($content) + return undoable_changes } - content.$ = $content - const rpc_hash_content = rpc_hash_content_b(ctx) - const content_hash = content_hash_b(ctx) - content_hash.$ = await rpc_hash_content($content) - return undoable_changes - } }) diff --git a/ui/libs/model/src/delta/commit_change_b.ts b/ui/libs/model/src/delta/commit_change_b.ts index 242d6d96..e4b6f4d1 100644 --- a/ui/libs/model/src/delta/commit_change_b.ts +++ b/ui/libs/model/src/delta/commit_change_b.ts @@ -3,77 +3,77 @@ import { Commit, rpc_commit_b, rpc_hash_content_b } from '@syn-ui/zome-client' import { bufferToBase64, EntryHash, HeaderHash } from '@syn-ui/utils' import { content_b } from '../content' import { - am_i_scribe_b, commit_in_progress_b, content_hash_b, - content_hash_str_b, current_commit_header_hash_b, session_info_b, - snapshot_hash_b, snapshot_hash_str_b + am_i_scribe_b, commit_in_progress_b, content_hash_b, + content_hash_str_b, current_commit_header_hash_b, session_info_b, + snapshot_hash_b, snapshot_hash_str_b } from '../session' import { recorded_changes_b } from './recorded_changes_b' import { _scribe_signal_folk_pubKey_a1_b } from './_scribe_signal_folk_pubKey_a1_b' import { committed_changes_b } from './committed_changes_b' export const commit_change_b = _b('commit_change', (ctx)=>{ - const recorded_changes = recorded_changes_b(ctx) - const commit_in_progress = commit_in_progress_b(ctx) - const rpc_hash_content = rpc_hash_content_b(ctx) - const content = content_b(ctx) - const snapshot_hash_str = snapshot_hash_str_b(ctx) - const content_hash = content_hash_b(ctx) - const content_hash_str = content_hash_str_b(ctx) - const snapshot_hash = snapshot_hash_b(ctx) - const _scribe_signal_folk_pubKey_a1 = _scribe_signal_folk_pubKey_a1_b(ctx) - const rpc_commit = rpc_commit_b(ctx) - const current_commit_header_hash = current_commit_header_hash_b(ctx) - const committed_changes = committed_changes_b(ctx) - const session_info = session_info_b(ctx) - return async function commit_change() { - const am_i_scribe = am_i_scribe_b(ctx) - if (am_i_scribe.$ === true) { - const $recorded_changes = recorded_changes.$ - if ($recorded_changes.length == 0) { - alert('No changes to commit!') - return - } - commit_in_progress.$ = true - try { - const new_content_hash = await rpc_hash_content(content.$) - console.log('committing from snapshot', snapshot_hash_str.$) - console.log(' prev_hash:', content_hash_str.$) - console.log(' new_hash:', bufferToBase64(new_content_hash)) - const commit:Commit = { - snapshot: snapshot_hash.$ as HeaderHash, - change: { - deltas: $recorded_changes.map(c=>JSON.stringify(c.delta)), - content_hash: new_content_hash, - previous_change: content_hash.$ as EntryHash, - meta: { - contributors: [], - witnesses: [], - app_specific: null + const recorded_changes = recorded_changes_b(ctx) + const commit_in_progress = commit_in_progress_b(ctx) + const rpc_hash_content = rpc_hash_content_b(ctx) + const content = content_b(ctx) + const snapshot_hash_str = snapshot_hash_str_b(ctx) + const content_hash = content_hash_b(ctx) + const content_hash_str = content_hash_str_b(ctx) + const snapshot_hash = snapshot_hash_b(ctx) + const _scribe_signal_folk_pubKey_a1 = _scribe_signal_folk_pubKey_a1_b(ctx) + const rpc_commit = rpc_commit_b(ctx) + const current_commit_header_hash = current_commit_header_hash_b(ctx) + const committed_changes = committed_changes_b(ctx) + const session_info = session_info_b(ctx) + return async function commit_change() { + const am_i_scribe = am_i_scribe_b(ctx) + if (am_i_scribe.$ === true) { + const $recorded_changes = recorded_changes.$ + if ($recorded_changes.length == 0) { + alert('No changes to commit!') + return } - }, - participants: _scribe_signal_folk_pubKey_a1() - } - try { - const $current_commit_header_hash = await rpc_commit(commit) - current_commit_header_hash.$ = $current_commit_header_hash - // if commit successfull we need to update the content hash and its string in the session - session_info.update($session_info=> - assign($session_info, { - content_hash: new_content_hash - }) - ) - committed_changes.update($committed_changes=>{ - $committed_changes.push(...$recorded_changes) - return $committed_changes - }) - recorded_changes.$ = [] - } catch (e) { - console.log('Error:', e) + commit_in_progress.$ = true + try { + const new_content_hash = await rpc_hash_content(content.$) + console.log('committing from snapshot', snapshot_hash_str.$) + console.log(' prev_hash:', content_hash_str.$) + console.log(' new_hash:', bufferToBase64(new_content_hash)) + const commit:Commit = { + snapshot: snapshot_hash.$ as HeaderHash, + change: { + deltas: $recorded_changes.map(c=>JSON.stringify(c.delta)), + content_hash: new_content_hash, + previous_change: content_hash.$ as EntryHash, + meta: { + contributors: [], + witnesses: [], + app_specific: null + } + }, + participants: _scribe_signal_folk_pubKey_a1() + } + try { + const $current_commit_header_hash = await rpc_commit(commit) + current_commit_header_hash.$ = $current_commit_header_hash + // if commit successfull we need to update the content hash and its string in the session + session_info.update($session_info=> + assign($session_info, { + content_hash: new_content_hash + }) + ) + committed_changes.update($committed_changes=>{ + $committed_changes.push(...$recorded_changes) + return $committed_changes + }) + recorded_changes.$ = [] + } catch (e) { + console.log('Error:', e) + } + } finally { + commit_in_progress.$ = false + } + } else { + alert(`You ain't the scribe!`) } - } finally { - commit_in_progress.$ = false - } - } else { - alert(`You ain't the scribe!`) } - } }) diff --git a/ui/libs/model/src/delta/committed_changes_b.ts b/ui/libs/model/src/delta/committed_changes_b.ts index d30f9535..bfd1948e 100644 --- a/ui/libs/model/src/delta/committed_changes_b.ts +++ b/ui/libs/model/src/delta/committed_changes_b.ts @@ -2,5 +2,5 @@ import { _b } from '@ctx-core/object' import { writable$ } from '@ctx-core/store' import type { ApplyDelta } from './ApplyDelta' export const committed_changes_b = _b('committed_changes', ()=>{ - return writable$<ApplyDelta[]>([]) + return writable$<ApplyDelta[]>([]) }) diff --git a/ui/libs/model/src/delta/deltas_b.ts b/ui/libs/model/src/delta/deltas_b.ts index dc8f1ee2..d22d8279 100644 --- a/ui/libs/model/src/delta/deltas_b.ts +++ b/ui/libs/model/src/delta/deltas_b.ts @@ -3,10 +3,10 @@ import { derived$ } from '@ctx-core/store' import type { Delta } from '@syn-ui/zome-client' import { session_info_b } from '../session' export const deltas_b = _b('deltas', (ctx)=>{ - const session_info = session_info_b(ctx) - return derived$(session_info, $session_info=> - $session_info ? $session_info.deltas.map( - serialized_delta=>JSON.parse(serialized_delta) - ) as Delta[] : null - ) + const session_info = session_info_b(ctx) + return derived$(session_info, $session_info=> + $session_info ? $session_info.deltas.map( + serialized_delta=>JSON.parse(serialized_delta) + ) as Delta[] : null + ) }) diff --git a/ui/libs/model/src/delta/next_index_b.ts b/ui/libs/model/src/delta/next_index_b.ts index 7d5b84b0..db24c4a6 100644 --- a/ui/libs/model/src/delta/next_index_b.ts +++ b/ui/libs/model/src/delta/next_index_b.ts @@ -2,9 +2,9 @@ import { derived$ } from '@ctx-core/store' import { _b } from '@ctx-core/object' import { recorded_changes_b } from './recorded_changes_b' export const next_index_b = _b('next_index', (ctx)=>{ - const recorded_changes = recorded_changes_b(ctx) - return derived$( - recorded_changes, - $recorded_changes=>$recorded_changes.length - ) + const recorded_changes = recorded_changes_b(ctx) + return derived$( + recorded_changes, + $recorded_changes=>$recorded_changes.length + ) }) diff --git a/ui/libs/model/src/delta/record_deltas_b.ts b/ui/libs/model/src/delta/record_deltas_b.ts index d7d9334b..97316328 100644 --- a/ui/libs/model/src/delta/record_deltas_b.ts +++ b/ui/libs/model/src/delta/record_deltas_b.ts @@ -5,39 +5,39 @@ import { recorded_changes_b } from './recorded_changes_b' import type { ApplyDelta } from './ApplyDelta' import { apply_deltas_b } from './apply_deltas_b' export const record_deltas_b = _b('record_deltas', (ctx)=>{ - const requested_changes = requested_changes_b(ctx) - const apply_deltas = apply_deltas_b(ctx) - const recorded_changes = recorded_changes_b(ctx) - return async function record_deltas(deltas:Delta[]) { - const $requested_changes = requested_changes.$ - console.log('record_deltas REQUESTED', $requested_changes) - const apply_deltas_a1:Delta[] = [] - for (const delta of deltas) { - if ($requested_changes.length > 0) { - // if this change is our next requested change then remove it - if (JSON.stringify(delta) === JSON.stringify($requested_changes[0].delta)) { - const recorded_changes = recorded_changes_b(ctx) - const $recorded_changes = recorded_changes.$ - $recorded_changes.push($requested_changes.shift() as ApplyDelta) - recorded_changes.$ = $recorded_changes - requested_changes.$ = $requested_changes - } else { - // TODO rebase? - console.log('REBASE NEEDED?') - console.log('requested ', $requested_changes[0].delta) - console.log('to be recorded ', delta) + const requested_changes = requested_changes_b(ctx) + const apply_deltas = apply_deltas_b(ctx) + const recorded_changes = recorded_changes_b(ctx) + return async function record_deltas(deltas:Delta[]) { + const $requested_changes = requested_changes.$ + console.log('record_deltas REQUESTED', $requested_changes) + const apply_deltas_a1:Delta[] = [] + for (const delta of deltas) { + if ($requested_changes.length > 0) { + // if this change is our next requested change then remove it + if (JSON.stringify(delta) === JSON.stringify($requested_changes[0].delta)) { + const recorded_changes = recorded_changes_b(ctx) + const $recorded_changes = recorded_changes.$ + $recorded_changes.push($requested_changes.shift() as ApplyDelta) + recorded_changes.$ = $recorded_changes + requested_changes.$ = $requested_changes + } else { + // TODO rebase? + console.log('REBASE NEEDED?') + console.log('requested ', $requested_changes[0].delta) + console.log('to be recorded ', delta) + } + } else { + // no requested changes so this must be from someone else so we don't have + // to check our requested changes + // TODO: do we need to check if this is a change that we did send and have already + // integrated somehow and ignore if so. (Seems unlikely?) + // apply the deltas to the content which returns the undoable change + apply_deltas_a1.push(delta) + } } - } else { - // no requested changes so this must be from someone else so we don't have - // to check our requested changes - // TODO: do we need to check if this is a change that we did send and have already - // integrated somehow and ignore if so. (Seems unlikely?) - // apply the deltas to the content which returns the undoable change - apply_deltas_a1.push(delta) - } + const undoable_changes = await apply_deltas(apply_deltas_a1) + // append changes to the recorded history + recorded_changes.push(...undoable_changes) } - const undoable_changes = await apply_deltas(apply_deltas_a1) - // append changes to the recorded history - recorded_changes.push(...undoable_changes) - } }) diff --git a/ui/libs/model/src/delta/recorded_changes_b.ts b/ui/libs/model/src/delta/recorded_changes_b.ts index 1d75a335..b3b6eed6 100644 --- a/ui/libs/model/src/delta/recorded_changes_b.ts +++ b/ui/libs/model/src/delta/recorded_changes_b.ts @@ -2,14 +2,14 @@ import { _b } from '@ctx-core/object' import { writable$, writable$_C } from '@ctx-core/store' import type { ApplyDelta } from './ApplyDelta' export const recorded_changes_b = _b('recorded_changes', ()=> - new recorded_changes_T(writable$<$recorded_changes_T>([])) + new recorded_changes_T(writable$<$recorded_changes_T>([])) ) export type $recorded_changes_T = ApplyDelta[] export class recorded_changes_T extends writable$_C<$recorded_changes_T> { - push = (...apply_delta_a1:ApplyDelta[])=>{ - const $store = this.$ - $store.push(...apply_delta_a1) - this.$ = $store - return $store - } + push = (...apply_delta_a1:ApplyDelta[])=>{ + const $store = this.$ + $store.push(...apply_delta_a1) + this.$ = $store + return $store + } } diff --git a/ui/libs/model/src/delta/request_change_b.ts b/ui/libs/model/src/delta/request_change_b.ts index 3add4a48..a36180ed 100644 --- a/ui/libs/model/src/delta/request_change_b.ts +++ b/ui/libs/model/src/delta/request_change_b.ts @@ -7,45 +7,45 @@ import { requested_changes_b } from './requested_changes_b' import { apply_deltas_b } from './apply_deltas_b' import { record_deltas_b } from './record_deltas_b' export const request_change_b = _b('request_change', (ctx)=>{ - const record_deltas = record_deltas_b(ctx) - const request_changes = requested_changes_b(ctx) - let request_counter = 0 - return async function request_change(deltas:Delta[]) { - // any requested made by the scribe should be recorded immediately - const am_i_scribe = am_i_scribe_b(ctx) - const next_index = next_index_b(ctx) - if (am_i_scribe.$ === true) { - const $next_index = next_index.$ - await record_deltas(deltas) - const send_change = send_change_b(ctx) - await send_change({ index: $next_index, deltas }) - } else { - // otherwise apply the change and queue it to requested changes for - // confirmation later and send request change to scribe - // create a unique id for each change - // TODO: this should be part of actual changeReqs - const my_tag = my_tag_b(ctx) - const change_id = my_tag.$ + '.' + request_counter - const change_at = Date.now() - const $requested_changes = request_changes.$ - // we want to apply this to current next_index plus any previously - // requested changes that haven't yet be recorded - const index = next_index.$ + $requested_changes.length - const apply_deltas = apply_deltas_b(ctx) - const undoable_changes = await apply_deltas(deltas) - for (const undoable_change of undoable_changes) { - undoable_change.id = change_id - undoable_change.at = change_at - } - $requested_changes.push(...undoable_changes) - request_changes.$ = $requested_changes - console.log('REQUESTED', $requested_changes) - const rpc_send_change_request = rpc_send_change_request_b(ctx) - const scribe = scribe_b(ctx) - await rpc_send_change_request({ - index, deltas, scribe: scribe.$ - }) - request_counter += 1 + const record_deltas = record_deltas_b(ctx) + const request_changes = requested_changes_b(ctx) + let request_counter = 0 + return async function request_change(deltas:Delta[]) { + // any requested made by the scribe should be recorded immediately + const am_i_scribe = am_i_scribe_b(ctx) + const next_index = next_index_b(ctx) + if (am_i_scribe.$ === true) { + const $next_index = next_index.$ + await record_deltas(deltas) + const send_change = send_change_b(ctx) + await send_change({ index: $next_index, deltas }) + } else { + // otherwise apply the change and queue it to requested changes for + // confirmation later and send request change to scribe + // create a unique id for each change + // TODO: this should be part of actual changeReqs + const my_tag = my_tag_b(ctx) + const change_id = my_tag.$ + '.' + request_counter + const change_at = Date.now() + const $requested_changes = request_changes.$ + // we want to apply this to current next_index plus any previously + // requested changes that haven't yet be recorded + const index = next_index.$ + $requested_changes.length + const apply_deltas = apply_deltas_b(ctx) + const undoable_changes = await apply_deltas(deltas) + for (const undoable_change of undoable_changes) { + undoable_change.id = change_id + undoable_change.at = change_at + } + $requested_changes.push(...undoable_changes) + request_changes.$ = $requested_changes + console.log('REQUESTED', $requested_changes) + const rpc_send_change_request = rpc_send_change_request_b(ctx) + const scribe = scribe_b(ctx) + await rpc_send_change_request({ + index, deltas, scribe: scribe.$ + }) + request_counter += 1 + } } - } }) diff --git a/ui/libs/model/src/delta/requested_changes_b.ts b/ui/libs/model/src/delta/requested_changes_b.ts index 3102b263..a98146b7 100644 --- a/ui/libs/model/src/delta/requested_changes_b.ts +++ b/ui/libs/model/src/delta/requested_changes_b.ts @@ -2,5 +2,5 @@ import { _b } from '@ctx-core/object' import { writable$ } from '@ctx-core/store' import type { ApplyDelta } from './ApplyDelta' export const requested_changes_b = _b('requested_changes', ()=>{ - return writable$<ApplyDelta[]>([]) + return writable$<ApplyDelta[]>([]) }) diff --git a/ui/libs/model/src/delta/send_change_b.ts b/ui/libs/model/src/delta/send_change_b.ts index 98c85d1e..b9e6d343 100644 --- a/ui/libs/model/src/delta/send_change_b.ts +++ b/ui/libs/model/src/delta/send_change_b.ts @@ -3,16 +3,16 @@ import type { Delta } from '@syn-ui/zome-client' import { _scribe_signal_folk_pubKey_a1_b } from './_scribe_signal_folk_pubKey_a1_b' import { rpc_send_change_b } from '@syn-ui/zome-client' export const send_change_b = _b('send_change', (ctx)=>{ - const _scribe_signal_folk_pubKey_a1 = _scribe_signal_folk_pubKey_a1_b(ctx) - const rpc_send_change = rpc_send_change_b(ctx) - return async function send_change({ index, deltas }:send_change_params_I) { - const participants = _scribe_signal_folk_pubKey_a1() - return rpc_send_change({ - index, deltas, participants - }) - } + const _scribe_signal_folk_pubKey_a1 = _scribe_signal_folk_pubKey_a1_b(ctx) + const rpc_send_change = rpc_send_change_b(ctx) + return async function send_change({ index, deltas }:send_change_params_I) { + const participants = _scribe_signal_folk_pubKey_a1() + return rpc_send_change({ + index, deltas, participants + }) + } }) export interface send_change_params_I { - index:number - deltas:Delta[] + index:number + deltas:Delta[] } diff --git a/ui/libs/model/src/delta/snapshot_content_b.ts b/ui/libs/model/src/delta/snapshot_content_b.ts index 5b585817..45109170 100644 --- a/ui/libs/model/src/delta/snapshot_content_b.ts +++ b/ui/libs/model/src/delta/snapshot_content_b.ts @@ -3,10 +3,10 @@ import { derived$, Readable$ } from '@ctx-core/store' import type { Content } from '@syn-ui/zome-client' import { session_info_b } from '../session' export const snapshot_content_b = _b('snapshot_content', (ctx)=>{ - const session_info = session_info_b(ctx) - const snapshot_content:snapshot_content_T = derived$(session_info, $session_info=> - $session_info?.snapshot_content - ) - return snapshot_content + const session_info = session_info_b(ctx) + const snapshot_content:snapshot_content_T = derived$(session_info, $session_info=> + $session_info?.snapshot_content + ) + return snapshot_content }) export interface snapshot_content_T extends Readable$<undefined|Content> {} diff --git a/ui/libs/model/src/session/am_i_scribe_b.ts b/ui/libs/model/src/session/am_i_scribe_b.ts index 2c62c14d..fa2feb5d 100644 --- a/ui/libs/model/src/session/am_i_scribe_b.ts +++ b/ui/libs/model/src/session/am_i_scribe_b.ts @@ -3,9 +3,9 @@ import { derived$ } from '@ctx-core/store' import { me_b } from '@syn-ui/zome-client' import { scribe_str_b } from './scribe_str_b' export const am_i_scribe_b = _b('am_i_scribe', (ctx)=>{ - const scribe_str = scribe_str_b(ctx) - const me = me_b(ctx) - return derived$(([scribe_str, me]), ([$scribe_str, $me])=> - $scribe_str ? $scribe_str === $me : null - ) + const scribe_str = scribe_str_b(ctx) + const me = me_b(ctx) + return derived$(([scribe_str, me]), ([$scribe_str, $me])=> + $scribe_str ? $scribe_str === $me : null + ) }) diff --git a/ui/libs/model/src/session/commit_in_progress_b.ts b/ui/libs/model/src/session/commit_in_progress_b.ts index 2d30f196..f4d4646f 100644 --- a/ui/libs/model/src/session/commit_in_progress_b.ts +++ b/ui/libs/model/src/session/commit_in_progress_b.ts @@ -1,5 +1,5 @@ import { _b } from '@ctx-core/object' import { writable$ } from '@ctx-core/store' export const commit_in_progress_b = _b('commit_in_progress', ()=> - writable$<boolean>(false) + writable$<boolean>(false) ) diff --git a/ui/libs/model/src/session/content_hash_b.ts b/ui/libs/model/src/session/content_hash_b.ts index 16df1489..40d06851 100644 --- a/ui/libs/model/src/session/content_hash_b.ts +++ b/ui/libs/model/src/session/content_hash_b.ts @@ -3,10 +3,10 @@ import { writable$ } from '@ctx-core/store' import type { EntryHash } from '@syn-ui/utils/dist' import { session_info_b } from './session_info_b' export const content_hash_b = _b('content_hash', (ctx)=>{ - const session_info = session_info_b(ctx) - const content_hash = writable$<undefined|EntryHash>(undefined) - session_info.subscribe($session_info=>{ - content_hash.$ = $session_info?.content_hash - }) - return content_hash + const session_info = session_info_b(ctx) + const content_hash = writable$<undefined|EntryHash>(undefined) + session_info.subscribe($session_info=>{ + content_hash.$ = $session_info?.content_hash + }) + return content_hash }) diff --git a/ui/libs/model/src/session/content_hash_str_b.ts b/ui/libs/model/src/session/content_hash_str_b.ts index 1225a541..fb45cfb0 100644 --- a/ui/libs/model/src/session/content_hash_str_b.ts +++ b/ui/libs/model/src/session/content_hash_str_b.ts @@ -2,9 +2,9 @@ import { _b } from '@ctx-core/object' import { content_hash_b } from './content_hash_b' import { derived$ } from '@ctx-core/store' import { bufferToBase64 } from '@syn-ui/utils' -export const content_hash_str_b = _b('content_hash_str', (ctx) => { - const content_hash = content_hash_b(ctx) - return derived$(content_hash, $content_hash=> - $content_hash ? bufferToBase64($content_hash) : null - ) +export const content_hash_str_b = _b('content_hash_str', (ctx)=>{ + const content_hash = content_hash_b(ctx) + return derived$(content_hash, $content_hash=> + $content_hash ? bufferToBase64($content_hash) : null + ) }) diff --git a/ui/libs/model/src/session/current_commit_header_hash_b.ts b/ui/libs/model/src/session/current_commit_header_hash_b.ts index 7df2bac5..2a4e5917 100644 --- a/ui/libs/model/src/session/current_commit_header_hash_b.ts +++ b/ui/libs/model/src/session/current_commit_header_hash_b.ts @@ -2,5 +2,5 @@ import type { HoloHash } from '@holochain/conductor-api' import { _b } from '@ctx-core/object' import { writable$ } from '@ctx-core/store' export const current_commit_header_hash_b = _b('current_commit_header_hash', ()=> - writable$<HoloHash|null>(null) + writable$<HoloHash|null>(null) ) diff --git a/ui/libs/model/src/session/folks_b.ts b/ui/libs/model/src/session/folks_b.ts index 54e66c1f..8f18ba9e 100644 --- a/ui/libs/model/src/session/folks_b.ts +++ b/ui/libs/model/src/session/folks_b.ts @@ -2,6 +2,6 @@ import { _b } from '@ctx-core/object' import { writable$ } from '@ctx-core/store' import type { PubKeyToFolkRecord } from '@syn-ui/zome-client' export const folks_b = _b('folks', ()=>{ - return writable$<$folks_T>({}) + return writable$<$folks_T>({}) }) export type $folks_T = PubKeyToFolkRecord|null diff --git a/ui/libs/model/src/session/scribe_b.ts b/ui/libs/model/src/session/scribe_b.ts index de12452e..43b14d24 100644 --- a/ui/libs/model/src/session/scribe_b.ts +++ b/ui/libs/model/src/session/scribe_b.ts @@ -3,8 +3,8 @@ import { _b } from '@ctx-core/object' import { derived$, Readable$ } from '@ctx-core/store' import { session_info_b } from './session_info_b' export const scribe_b = _b('scribe', (ctx)=>{ - const session_info = session_info_b(ctx) - return derived$(session_info, $session_info=> - $session_info?.scribe - ) as Readable$<AgentPubKey> + const session_info = session_info_b(ctx) + return derived$(session_info, $session_info=> + $session_info?.scribe + ) as Readable$<AgentPubKey> }) diff --git a/ui/libs/model/src/session/scribe_str_b.ts b/ui/libs/model/src/session/scribe_str_b.ts index 442ea863..efbc7c3c 100644 --- a/ui/libs/model/src/session/scribe_str_b.ts +++ b/ui/libs/model/src/session/scribe_str_b.ts @@ -3,8 +3,8 @@ import { derived$ } from '@ctx-core/store' import { bufferToBase64 } from '@syn-ui/utils' import { scribe_b } from './scribe_b' export const scribe_str_b = _b('scribe_str', (ctx)=>{ - const scribe = scribe_b(ctx) - return derived$(scribe, $scribe=> - $scribe ? bufferToBase64($scribe) : null - ) + const scribe = scribe_b(ctx) + return derived$(scribe, $scribe=> + $scribe ? bufferToBase64($scribe) : null + ) }) diff --git a/ui/libs/model/src/session/session_b.ts b/ui/libs/model/src/session/session_b.ts index 988b8f35..fc8c7830 100644 --- a/ui/libs/model/src/session/session_b.ts +++ b/ui/libs/model/src/session/session_b.ts @@ -1,9 +1,9 @@ import { _b } from '@ctx-core/object' import { derived$ } from '@ctx-core/store' import { session_info_b } from './session_info_b' -export const session_b = _b('session', (ctx) => { - const session_info = session_info_b(ctx) - return derived$(session_info, $session_info=> - $session_info?.session - ) +export const session_b = _b('session', (ctx)=>{ + const session_info = session_info_b(ctx) + return derived$(session_info, $session_info=> + $session_info?.session + ) }) diff --git a/ui/libs/model/src/session/session_info_b.ts b/ui/libs/model/src/session/session_info_b.ts index 35684691..ad7cf408 100644 --- a/ui/libs/model/src/session/session_info_b.ts +++ b/ui/libs/model/src/session/session_info_b.ts @@ -2,19 +2,19 @@ import { _b, assign } from '@ctx-core/object' import { writable$, Writable$ } from '@ctx-core/store' import { rpc_get_session_b, SessionInfo } from '@syn-ui/zome-client' export const session_info_b = _b<session_info_I>('session_info', (ctx)=>{ - const rpc_get_session = rpc_get_session_b(ctx) - const session_info = assign(writable$<$session_info_T>(null), { - refresh - }) - return session_info - async function refresh() { - const $session_info = session_info.$ - if ($session_info) { - await rpc_get_session($session_info.session) + const rpc_get_session = rpc_get_session_b(ctx) + const session_info = assign(writable$<$session_info_T>(null), { + refresh + }) + return session_info + async function refresh() { + const $session_info = session_info.$ + if ($session_info) { + await rpc_get_session($session_info.session) + } } - } }) export type $session_info_T = SessionInfo|null export interface session_info_I extends Writable$<$session_info_T> { - refresh():Promise<void> + refresh():Promise<void> } diff --git a/ui/libs/model/src/session/session_info_session_b.ts b/ui/libs/model/src/session/session_info_session_b.ts index 36019fa7..7ef449fc 100644 --- a/ui/libs/model/src/session/session_info_session_b.ts +++ b/ui/libs/model/src/session/session_info_session_b.ts @@ -2,8 +2,8 @@ import { _b } from '@ctx-core/object' import { derived$ } from '@ctx-core/store' import { session_info_b } from './session_info_b' export const session_info_session_b = _b('session_info_session', (ctx)=>{ - const session_info = session_info_b(ctx) - return derived$(session_info, $session_info=> - $session_info?.session - ) + const session_info = session_info_b(ctx) + return derived$(session_info, $session_info=> + $session_info?.session + ) }) diff --git a/ui/libs/model/src/session/session_str_b.ts b/ui/libs/model/src/session/session_str_b.ts index 8af4a1da..6df8797f 100644 --- a/ui/libs/model/src/session/session_str_b.ts +++ b/ui/libs/model/src/session/session_str_b.ts @@ -2,9 +2,9 @@ import { _b } from '@ctx-core/object' import { derived$ } from '@ctx-core/store' import { bufferToBase64 } from '@syn-ui/utils' import { session_b } from './session_b' -export const session_str_b = _b('session_str', (ctx) => { - const session = session_b(ctx) - return derived$(session, $session=> - $session ? bufferToBase64($session) : undefined - ) +export const session_str_b = _b('session_str', (ctx)=>{ + const session = session_b(ctx) + return derived$(session, $session=> + $session ? bufferToBase64($session) : undefined + ) }) diff --git a/ui/libs/model/src/session/sessions_b.ts b/ui/libs/model/src/session/sessions_b.ts index c66f87a6..c1405310 100644 --- a/ui/libs/model/src/session/sessions_b.ts +++ b/ui/libs/model/src/session/sessions_b.ts @@ -4,38 +4,38 @@ import { rpc_get_sessions_b, SessionInfo } from '@syn-ui/zome-client' import type { EntryHash } from '@syn-ui/utils' import { session_info_b } from './session_info_b' export const sessions_b = _b('sessions', (ctx)=>{ - const { store: sessions, set } = _readable_set_ctx$<EntryHash[]|null>(null) - const { store: busy, set: set_busy } = _readable_set_ctx$<boolean>(false) - const out_sessions = sessions as sessions_T - assign(out_sessions, { busy, load, unshift }) - const session_info = session_info_b(ctx) - let $session_info:SessionInfo|null - session_info.subscribe(in_$session_info=>{ - if ($session_info && !in_$session_info) { - set(null) + const { store: sessions, set } = _readable_set_ctx$<EntryHash[]|null>(null) + const { store: busy, set: set_busy } = _readable_set_ctx$<boolean>(false) + const out_sessions = sessions as sessions_T + assign(out_sessions, { busy, load, unshift }) + const session_info = session_info_b(ctx) + let $session_info:SessionInfo|null + session_info.subscribe(in_$session_info=>{ + if ($session_info && !in_$session_info) { + set(null) + } + $session_info = in_$session_info + }) + return out_sessions + async function load() { + set_busy(true) + try { + const rpc_get_sessions = rpc_get_sessions_b(ctx) + set(await rpc_get_sessions()) + } finally { + set_busy(false) + } + return sessions.$ } - $session_info = in_$session_info - }) - return out_sessions - async function load() { - set_busy(true) - try { - const rpc_get_sessions = rpc_get_sessions_b(ctx) - set(await rpc_get_sessions()) - } finally { - set_busy(false) + function unshift(...session_hash_a1:EntryHash[]) { + const $sessions = sessions.$ as EntryHash[] + $sessions.unshift(...session_hash_a1) + set($sessions) + return $sessions } - return sessions.$ - } - function unshift(...session_hash_a1:EntryHash[]) { - const $sessions = sessions.$ as EntryHash[] - $sessions.unshift(...session_hash_a1) - set($sessions) - return $sessions - } }) export interface sessions_T extends Writable$<EntryHash[]|null> { - busy:Writable$<boolean> - load():Promise<EntryHash[]> - unshift(...session_hash_a1:EntryHash[]):EntryHash[] + busy:Writable$<boolean> + load():Promise<EntryHash[]> + unshift(...session_hash_a1:EntryHash[]):EntryHash[] } diff --git a/ui/libs/model/src/session/sessions_str_a1_b.ts b/ui/libs/model/src/session/sessions_str_a1_b.ts index 55831465..8c2ef7d3 100644 --- a/ui/libs/model/src/session/sessions_str_a1_b.ts +++ b/ui/libs/model/src/session/sessions_str_a1_b.ts @@ -3,11 +3,11 @@ import { sessions_b } from './sessions_b' import { derived$, Readable$ } from '@ctx-core/store' import { bufferToBase64 } from '@syn-ui/utils/dist' export const sessions_str_a1_b = _b<sessions_str_a1_T>('sessions_str_a1', (ctx)=>{ - const sessions = sessions_b(ctx) - const sessions_str_a1 = derived$(sessions, $sessions=> - $sessions?.map(session=>bufferToBase64(session)) - ) as sessions_str_a1_T - return sessions_str_a1 + const sessions = sessions_b(ctx) + const sessions_str_a1 = derived$(sessions, $sessions=> + $sessions?.map(session=>bufferToBase64(session)) + ) as sessions_str_a1_T + return sessions_str_a1 }) export type $sessions_str_a1_T = null|string[] export interface sessions_str_a1_T extends Readable$<$sessions_str_a1_T> {} diff --git a/ui/libs/model/src/session/snapshot_hash_b.ts b/ui/libs/model/src/session/snapshot_hash_b.ts index 361f7d63..ab837844 100644 --- a/ui/libs/model/src/session/snapshot_hash_b.ts +++ b/ui/libs/model/src/session/snapshot_hash_b.ts @@ -2,9 +2,9 @@ import { _b } from '@ctx-core/object' import { derived$, Readable$ } from '@ctx-core/store' import type { HeaderHash } from '@syn-ui/utils/dist' import { session_info_b } from './session_info_b' -export const snapshot_hash_b = _b<Readable$<HeaderHash|undefined>>('snapshot_hash', ctx => { - const session_info = session_info_b(ctx) - return derived$(session_info, $session_info=> - $session_info?.snapshot_hash - ) +export const snapshot_hash_b = _b<Readable$<HeaderHash|undefined>>('snapshot_hash', ctx=>{ + const session_info = session_info_b(ctx) + return derived$(session_info, $session_info=> + $session_info?.snapshot_hash + ) }) diff --git a/ui/libs/model/src/session/snapshot_hash_str_b.ts b/ui/libs/model/src/session/snapshot_hash_str_b.ts index 2b3af6ea..561cb8e6 100644 --- a/ui/libs/model/src/session/snapshot_hash_str_b.ts +++ b/ui/libs/model/src/session/snapshot_hash_str_b.ts @@ -2,9 +2,9 @@ import { _b } from '@ctx-core/object' import { derived$ } from '@ctx-core/store' import { bufferToBase64 } from '@syn-ui/utils' import { snapshot_hash_b } from './snapshot_hash_b' -export const snapshot_hash_str_b = _b('snapshot_hash_str', (ctx) => { - const snapshot_hash = snapshot_hash_b(ctx) - return derived$(snapshot_hash, $snapshot_hash=> - $snapshot_hash ? bufferToBase64($snapshot_hash) : null - ) +export const snapshot_hash_str_b = _b('snapshot_hash_str', (ctx)=>{ + const snapshot_hash = snapshot_hash_b(ctx) + return derived$(snapshot_hash, $snapshot_hash=> + $snapshot_hash ? bufferToBase64($snapshot_hash) : null + ) }) diff --git a/ui/libs/model/src/session/update_folks_b.ts b/ui/libs/model/src/session/update_folks_b.ts index f04490f6..e07b59e6 100644 --- a/ui/libs/model/src/session/update_folks_b.ts +++ b/ui/libs/model/src/session/update_folks_b.ts @@ -2,42 +2,42 @@ import type { AgentPubKey } from '@holochain/conductor-api' import { _b } from '@ctx-core/object' import { bufferToBase64 } from '@syn-ui/utils' import { - Folk, FOLK_GONE, FOLK_SEEN, FOLK_UNKNOWN, FolkStatus, PubKeyToFolkRecord + Folk, FOLK_GONE, FOLK_SEEN, FOLK_UNKNOWN, FolkStatus, PubKeyToFolkRecord } from '@syn-ui/zome-client' import { getFolkColors } from '../colors' import { folks_b } from './folks_b' import { am_i_scribe_b } from './am_i_scribe_b' export const update_folks_b = _b('update_folks', (ctx)=>{ - const am_i_scribe = am_i_scribe_b(ctx) - const folks = folks_b(ctx) - return update_folks - function update_folks(pubKey:AgentPubKey, status:FolkStatus, meta?:number) { - const pubKeyStr = bufferToBase64(pubKey) - if (am_i_scribe.$) { - return + const am_i_scribe = am_i_scribe_b(ctx) + const folks = folks_b(ctx) + return update_folks + function update_folks(pubKey:AgentPubKey, status:FolkStatus, meta?:number) { + const pubKeyStr = bufferToBase64(pubKey) + if (am_i_scribe.$) { + return + } + // if we don't have this key, create a record for it + // including the default color + const $folks = folks.$ as PubKeyToFolkRecord + _other($folks, pubKeyStr, pubKey) + if (meta) { + $folks[pubKeyStr]['meta'] = meta + } + switch (status) { + case FOLK_SEEN: + $folks[pubKeyStr]['inSession'] = true + $folks[pubKeyStr]['lastSeen'] = Date.now() + break + case FOLK_GONE: + case FOLK_UNKNOWN: + $folks[pubKeyStr]['inSession'] = false + } + folks.$ = $folks } - // if we don't have this key, create a record for it - // including the default color - const $folks = folks.$ as PubKeyToFolkRecord - _other($folks, pubKeyStr, pubKey) - if (meta) { - $folks[pubKeyStr]['meta'] = meta + function _other($folks:PubKeyToFolkRecord, pubKeyStr:string, pubKey:AgentPubKey) { + if (!(pubKeyStr in $folks)) { + const colors = getFolkColors(pubKey) + $folks[pubKeyStr] = { pubKey, colors } as Folk + } } - switch (status) { - case FOLK_SEEN: - $folks[pubKeyStr]['inSession'] = true - $folks[pubKeyStr]['lastSeen'] = Date.now() - break - case FOLK_GONE: - case FOLK_UNKNOWN: - $folks[pubKeyStr]['inSession'] = false - } - folks.$ = $folks - } - function _other($folks:PubKeyToFolkRecord, pubKeyStr:string, pubKey:AgentPubKey) { - if (!(pubKeyStr in $folks)) { - const colors = getFolkColors(pubKey) - $folks[pubKeyStr] = { pubKey, colors } as Folk - } - } }) diff --git a/ui/libs/model/src/signals/ChangeReq_SignalOps_b.ts b/ui/libs/model/src/signals/ChangeReq_SignalOps_b.ts index bc0bb012..16712cef 100644 --- a/ui/libs/model/src/signals/ChangeReq_SignalOps_b.ts +++ b/ui/libs/model/src/signals/ChangeReq_SignalOps_b.ts @@ -4,36 +4,36 @@ import { next_index_b, record_deltas_b, send_change_b } from '../delta' import { am_i_scribe_b } from '../session' import type { SignalOps } from './SignalOps' export const ChangeReq_SignalOps_b = _b<SignalOps>('ChangeReq_SignalOps', (ctx)=>{ - const am_i_scribe = am_i_scribe_b(ctx) - const next_index = next_index_b(ctx) - const send_change = send_change_b(ctx) - return { - ChangeReq: async (signal)=>{ - const [index, serialized_deltas]:[number, string[]] = signal.data.payload.signal_payload - const deltas:Delta[] = serialized_deltas.map(d=>JSON.parse(d)) - const change:[number, Delta[]] = [index, deltas] - if (am_i_scribe.$ === true) { - let [index, deltas] = change - const $next_index = next_index.$ - if ($next_index != index) { - console.log('Scribe is receiving change out of order!') - console.log(`next_index: ${$next_index}, changeIndex:${index} for deltas:`, deltas) - if (index < $next_index) { - // change is too late, $next_index has moved on - // TODO: rebase? notify sender? - return - } else { - // change is in the future, possibly some other change was dropped or is slow in arriving - // TODO: wait a bit? Ask sender for other changes? - return - } + const am_i_scribe = am_i_scribe_b(ctx) + const next_index = next_index_b(ctx) + const send_change = send_change_b(ctx) + return { + ChangeReq: async (signal)=>{ + const [index, serialized_deltas]:[number, string[]] = signal.data.payload.signal_payload + const deltas:Delta[] = serialized_deltas.map(d=>JSON.parse(d)) + const change:[number, Delta[]] = [index, deltas] + if (am_i_scribe.$ === true) { + let [index, deltas] = change + const $next_index = next_index.$ + if ($next_index != index) { + console.log('Scribe is receiving change out of order!') + console.log(`next_index: ${$next_index}, changeIndex:${index} for deltas:`, deltas) + if (index < $next_index) { + // change is too late, $next_index has moved on + // TODO: rebase? notify sender? + return + } else { + // change is in the future, possibly some other change was dropped or is slow in arriving + // TODO: wait a bit? Ask sender for other changes? + return + } + } + const record_deltas = record_deltas_b(ctx) + await record_deltas(deltas) + // notify all participants of the change + await send_change({ index, deltas }) + } + // connection.session.changeReq([index, deltas]) } - const record_deltas = record_deltas_b(ctx) - await record_deltas(deltas) - // notify all participants of the change - await send_change({ index, deltas }) - } - // connection.session.changeReq([index, deltas]) } - } }) diff --git a/ui/libs/model/src/signals/Change_SignalOps_b.ts b/ui/libs/model/src/signals/Change_SignalOps_b.ts index 064bbecf..56c39f12 100644 --- a/ui/libs/model/src/signals/Change_SignalOps_b.ts +++ b/ui/libs/model/src/signals/Change_SignalOps_b.ts @@ -4,25 +4,25 @@ import { next_index_b, record_deltas_b } from '../delta' import { am_i_scribe_b } from '../session' import type { SignalOps } from './SignalOps' export const Change_SignalOps_b = _b<SignalOps>('Change_SignalOps', (ctx)=>{ - const next_index = next_index_b(ctx) - return { - Change: async (signal:AppSignal)=>{ - const [index, serialized_deltas] = signal.data.payload.signal_payload - const deltas = serialized_deltas.map(d=>JSON.parse(d)) - const am_i_scribe = am_i_scribe_b(ctx) - if (am_i_scribe.$ === true) { - console.log(`change received but I'm the scribe, so I'm ignoring this!`) - } else { - console.log(`change arrived for ${index}:`, deltas) - const $next_index = next_index.$ - if ($next_index === index) { - const record_deltas = record_deltas_b(ctx) - await record_deltas(deltas) - } else { - console.log(`change arrived out of sequence next_index: ${$next_index}, change index:${index}`) - // TODO either call for sync, or do some waiting algorithm + const next_index = next_index_b(ctx) + return { + Change: async (signal:AppSignal)=>{ + const [index, serialized_deltas] = signal.data.payload.signal_payload + const deltas = serialized_deltas.map(d=>JSON.parse(d)) + const am_i_scribe = am_i_scribe_b(ctx) + if (am_i_scribe.$ === true) { + console.log(`change received but I'm the scribe, so I'm ignoring this!`) + } else { + console.log(`change arrived for ${index}:`, deltas) + const $next_index = next_index.$ + if ($next_index === index) { + const record_deltas = record_deltas_b(ctx) + await record_deltas(deltas) + } else { + console.log(`change arrived out of sequence next_index: ${$next_index}, change index:${index}`) + // TODO either call for sync, or do some waiting algorithm + } + } } - } } - } }) diff --git a/ui/libs/model/src/signals/CommitNotice_SignalOps_b.ts b/ui/libs/model/src/signals/CommitNotice_SignalOps_b.ts index 631c3e1d..5550c2d9 100644 --- a/ui/libs/model/src/signals/CommitNotice_SignalOps_b.ts +++ b/ui/libs/model/src/signals/CommitNotice_SignalOps_b.ts @@ -4,39 +4,39 @@ import { committed_changes_b, next_index_b, recorded_changes_b } from '../delta' import { content_hash_b, content_hash_str_b } from '../session' import type { SignalOps } from './SignalOps' export const CommitNotice_SignalOps_b = _b<SignalOps>('CommitNotice_SignalOps', (ctx)=>{ - const content_hash = content_hash_b(ctx) - const content_hash_str = content_hash_str_b(ctx) - const next_index = next_index_b(ctx) - const committed_changes = committed_changes_b(ctx) - const recorded_changes = recorded_changes_b(ctx) - return { - CommitNotice: async (signal)=>{ - const commit_info:CommitInfo = signal.data.payload.signal_payload - // make sure we are at the right place to be able to just move forward with the commit - const $content_hash_str = content_hash_str.$ - if ($content_hash_str == bufferToBase64(commit_info.previous_content_hash) && - next_index.$ === commit_info.deltas_committed) { - content_hash.$ = commit_info.commit_content_hash - committed_changes.update($committed_changes=>{ - $committed_changes.push(...recorded_changes.$) - return $committed_changes - }) - recorded_changes.$ = [] - } else { - console.log('received commit notice for beyond our last commit, gotta resync') - console.log('commit.commit_content_hash:', bufferToBase64(commit_info.commit_content_hash)) - console.log('commit.previous_content_hash:', bufferToBase64(commit_info.previous_content_hash)) - console.log('commit.deltas_committed:', commit_info.deltas_committed) - console.log('my $session.contentHashStr', $content_hash_str) - console.log('my next_index', next_index.$) - // TODO resync - } + const content_hash = content_hash_b(ctx) + const content_hash_str = content_hash_str_b(ctx) + const next_index = next_index_b(ctx) + const committed_changes = committed_changes_b(ctx) + const recorded_changes = recorded_changes_b(ctx) + return { + CommitNotice: async (signal)=>{ + const commit_info:CommitInfo = signal.data.payload.signal_payload + // make sure we are at the right place to be able to just move forward with the commit + const $content_hash_str = content_hash_str.$ + if ($content_hash_str == bufferToBase64(commit_info.previous_content_hash) && + next_index.$ === commit_info.deltas_committed) { + content_hash.$ = commit_info.commit_content_hash + committed_changes.update($committed_changes=>{ + $committed_changes.push(...recorded_changes.$) + return $committed_changes + }) + recorded_changes.$ = [] + } else { + console.log('received commit notice for beyond our last commit, gotta resync') + console.log('commit.commit_content_hash:', bufferToBase64(commit_info.commit_content_hash)) + console.log('commit.previous_content_hash:', bufferToBase64(commit_info.previous_content_hash)) + console.log('commit.deltas_committed:', commit_info.deltas_committed) + console.log('my $session.contentHashStr', $content_hash_str) + console.log('my next_index', next_index.$) + // TODO resync + } + } } - } }) export interface CommitInfo { - deltas_committed:number - commit_content_hash:EntryHash - previous_content_hash:EntryHash - commit:HeaderHash + deltas_committed:number + commit_content_hash:EntryHash + previous_content_hash:EntryHash + commit:HeaderHash } diff --git a/ui/libs/model/src/signals/FolkLore_SignalOps_b.ts b/ui/libs/model/src/signals/FolkLore_SignalOps_b.ts index f1b092c6..f66c3e58 100644 --- a/ui/libs/model/src/signals/FolkLore_SignalOps_b.ts +++ b/ui/libs/model/src/signals/FolkLore_SignalOps_b.ts @@ -3,31 +3,31 @@ import { decodeJson, FOLK_GONE, FOLK_UNKNOWN } from '@syn-ui/zome-client' import { am_i_scribe_b, update_folks_b } from '../session' import type { SignalOps } from './SignalOps' export const FolkLore_SignalOps_b = _b<SignalOps>('FolkLore_SignalOps', (ctx)=>{ - const am_i_scribe = am_i_scribe_b(ctx) - const update_folks = update_folks_b(ctx) - return { - FolkLore: async (signal)=>{ - const data = decodeJson(signal.data.payload.signal_payload) - console.log('got folklore', data) - if (am_i_scribe.$) { - console.log(`folklore received but I'm the scribe!`) - } else { - const { gone, participants } = data - if (gone) { - for (const pubKey of gone) { - update_folks(pubKey, FOLK_GONE) - } - } - // TODO move last seen into p.meta so that we can update that value - // as hearsay. - if (participants) { - Object.values(participants).forEach( - p=>{ - update_folks(p.pubKey, FOLK_UNKNOWN, p.meta) + const am_i_scribe = am_i_scribe_b(ctx) + const update_folks = update_folks_b(ctx) + return { + FolkLore: async (signal)=>{ + const data = decodeJson(signal.data.payload.signal_payload) + console.log('got folklore', data) + if (am_i_scribe.$) { + console.log(`folklore received but I'm the scribe!`) + } else { + const { gone, participants } = data + if (gone) { + for (const pubKey of gone) { + update_folks(pubKey, FOLK_GONE) + } + } + // TODO move last seen into p.meta so that we can update that value + // as hearsay. + if (participants) { + Object.values(participants).forEach( + p=>{ + update_folks(p.pubKey, FOLK_UNKNOWN, p.meta) + } + ) + } } - ) } - } } - } }) diff --git a/ui/libs/model/src/signals/Heartbeat_SignalOps_b.ts b/ui/libs/model/src/signals/Heartbeat_SignalOps_b.ts index 05948eed..09676695 100644 --- a/ui/libs/model/src/signals/Heartbeat_SignalOps_b.ts +++ b/ui/libs/model/src/signals/Heartbeat_SignalOps_b.ts @@ -3,18 +3,18 @@ import { FOLK_SEEN } from '@syn-ui/zome-client' import { am_i_scribe_b, update_folks_b } from '../session' import type { SignalOps } from './SignalOps' export const Heartbeat_SignalOps_b = _b<SignalOps>('Heartbeat_SignalOps', (ctx)=>{ - const am_i_scribe = am_i_scribe_b(ctx) - const update_folks = update_folks_b(ctx) - return { - Heartbeat: async (signal)=>{ - let [from, msg] = signal.data.payload.signal_payload - console.log('got heartbeat', msg, 'from:', from) - if (am_i_scribe.$ === true) { - // I am the scribe and I've recieved a heartbeat from a concerned Folk - update_folks(from, FOLK_SEEN) - } else { - console.log(`heartbeat received but I'm not the scribe.`) - } + const am_i_scribe = am_i_scribe_b(ctx) + const update_folks = update_folks_b(ctx) + return { + Heartbeat: async (signal)=>{ + let [from, msg] = signal.data.payload.signal_payload + console.log('got heartbeat', msg, 'from:', from) + if (am_i_scribe.$ === true) { + // I am the scribe and I've recieved a heartbeat from a concerned Folk + update_folks(from, FOLK_SEEN) + } else { + console.log(`heartbeat received but I'm not the scribe.`) + } + } } - } }) diff --git a/ui/libs/model/src/signals/SyncReq_SignalOps_b.ts b/ui/libs/model/src/signals/SyncReq_SignalOps_b.ts index 2c1a3497..f7d21be1 100644 --- a/ui/libs/model/src/signals/SyncReq_SignalOps_b.ts +++ b/ui/libs/model/src/signals/SyncReq_SignalOps_b.ts @@ -1,58 +1,58 @@ import type { HoloHash } from '@holochain/conductor-api' import { _b } from '@ctx-core/object' import { - agent_pub_key_b, FOLK_SEEN, me_b, rpc_send_folk_lore_b, rpc_send_sync_response_b, StateForSync + agent_pub_key_b, FOLK_SEEN, me_b, rpc_send_folk_lore_b, rpc_send_sync_response_b, StateForSync } from '@syn-ui/zome-client' import type { EntryHash } from '@syn-ui/utils' import { _scribe_signal_folk_pubKey_a1_b, recorded_changes_b } from '../delta' import { - am_i_scribe_b, content_hash_b, current_commit_header_hash_b, folks_b, - snapshot_hash_b, update_folks_b + am_i_scribe_b, content_hash_b, current_commit_header_hash_b, folks_b, + snapshot_hash_b, update_folks_b } from '../session' import type { SignalOps } from './SignalOps' export const SyncReq_SignalOps_b = _b<SignalOps>('SyncReq_SignalOps', (ctx)=>{ - const me = me_b(ctx) - const folks = folks_b(ctx) - const update_folks = update_folks_b(ctx) - const rpc_send_sync_response = rpc_send_sync_response_b(ctx) - const recorded_changes = recorded_changes_b(ctx) - const content_hash = content_hash_b(ctx) - const snapshot_hash = snapshot_hash_b(ctx) - const current_commit_header_hash = current_commit_header_hash_b(ctx) - const _scribe_signal_folk_pubKey_a1 = _scribe_signal_folk_pubKey_a1_b(ctx) - const rpc_send_folk_lore = rpc_send_folk_lore_b(ctx) - return { - SyncReq: async (signal)=>{ - const participant:HoloHash = signal.data.payload.signal_payload - const am_i_scribe = am_i_scribe_b(ctx) - if (am_i_scribe.$ === true) { - update_folks(participant, FOLK_SEEN) - const state:StateForSync = { - snapshot: snapshot_hash.$ as EntryHash, - commit_content_hash: content_hash.$ as EntryHash, - deltas: recorded_changes.$.map(c=>c.delta) + const me = me_b(ctx) + const folks = folks_b(ctx) + const update_folks = update_folks_b(ctx) + const rpc_send_sync_response = rpc_send_sync_response_b(ctx) + const recorded_changes = recorded_changes_b(ctx) + const content_hash = content_hash_b(ctx) + const snapshot_hash = snapshot_hash_b(ctx) + const current_commit_header_hash = current_commit_header_hash_b(ctx) + const _scribe_signal_folk_pubKey_a1 = _scribe_signal_folk_pubKey_a1_b(ctx) + const rpc_send_folk_lore = rpc_send_folk_lore_b(ctx) + return { + SyncReq: async (signal)=>{ + const participant:HoloHash = signal.data.payload.signal_payload + const am_i_scribe = am_i_scribe_b(ctx) + if (am_i_scribe.$ === true) { + update_folks(participant, FOLK_SEEN) + const state:StateForSync = { + snapshot: snapshot_hash.$ as EntryHash, + commit_content_hash: content_hash.$ as EntryHash, + deltas: recorded_changes.$.map(c=>c.delta) + } + const $current_commit_header_hash = current_commit_header_hash.$ + if ($current_commit_header_hash) { + state['commit'] = $current_commit_header_hash + } + // send a sync response to the sender + await rpc_send_sync_response({ participant, state }) + // and send everybody a folk lore p2p message with new participants + const $folks = folks.$ + let p = { ...$folks } + const agent_pub_key = agent_pub_key_b(ctx) + p[me.$] = { + pubKey: agent_pub_key.$ + } + const data = { participants: p } + await rpc_send_folk_lore({ + participants: _scribe_signal_folk_pubKey_a1(), + data, + }) + } else { + console.log('syncReq received but I\'m not the scribe!') + } } - const $current_commit_header_hash = current_commit_header_hash.$ - if ($current_commit_header_hash) { - state['commit'] = $current_commit_header_hash - } - // send a sync response to the sender - await rpc_send_sync_response({ participant, state }) - // and send everybody a folk lore p2p message with new participants - const $folks = folks.$ - let p = { ...$folks } - const agent_pub_key = agent_pub_key_b(ctx) - p[me.$] = { - pubKey: agent_pub_key.$ - } - const data = { participants: p } - await rpc_send_folk_lore({ - participants: _scribe_signal_folk_pubKey_a1(), - data, - }) - } else { - console.log('syncReq received but I\'m not the scribe!') - } } - } }) diff --git a/ui/libs/model/src/signals/SyncResp_SignalOps_b.ts b/ui/libs/model/src/signals/SyncResp_SignalOps_b.ts index 336fa614..463581df 100644 --- a/ui/libs/model/src/signals/SyncResp_SignalOps_b.ts +++ b/ui/libs/model/src/signals/SyncResp_SignalOps_b.ts @@ -7,28 +7,28 @@ import { record_deltas_b } from '../delta' import { content_hash_str_b } from '../session' import type { SignalOps } from './SignalOps' export const SyncResp_SignalOps_b = _b<SignalOps>('SyncResp_SignalOps', (ctx)=>{ - const content_hash_str = content_hash_str_b(ctx) - const record_deltas = record_deltas_b(ctx) - return { - SyncResp: async (signal)=>{ - const serialized_state:SerializedStateForSync = signal.data.payload.signal_payload - const state:SyncResp_state_I = assign({} as StateForSync, serialized_state, { - deltas: serialized_state.deltas.map(d=>JSON.parse(d)) - }) - // Make sure that we are working off the same snapshot and commit - const commit_content_hash_str = bufferToBase64(state.commit_content_hash) - if (commit_content_hash_str == content_hash_str.$) { - await record_deltas(state.deltas) - } else { - console.log('WHOA, sync response has different current state assumptions') - // TODO: resync somehow - } + const content_hash_str = content_hash_str_b(ctx) + const record_deltas = record_deltas_b(ctx) + return { + SyncResp: async (signal)=>{ + const serialized_state:SerializedStateForSync = signal.data.payload.signal_payload + const state:SyncResp_state_I = assign({} as StateForSync, serialized_state, { + deltas: serialized_state.deltas.map(d=>JSON.parse(d)) + }) + // Make sure that we are working off the same snapshot and commit + const commit_content_hash_str = bufferToBase64(state.commit_content_hash) + if (commit_content_hash_str == content_hash_str.$) { + await record_deltas(state.deltas) + } else { + console.log('WHOA, sync response has different current state assumptions') + // TODO: resync somehow + } + } } - } }) export interface SyncResp_state_I extends Omit<StateForSync, 'deltas'> { - snapshot:HoloHash, - commit:HoloHash, - commit_content_hash:HoloHash - deltas:Delta[] + snapshot:HoloHash, + commit:HoloHash, + commit_content_hash:HoloHash + deltas:Delta[] } diff --git a/ui/libs/model/src/signals/app_ws_cb_b.ts b/ui/libs/model/src/signals/app_ws_cb_b.ts index 47139a37..68f1025a 100644 --- a/ui/libs/model/src/signals/app_ws_cb_b.ts +++ b/ui/libs/model/src/signals/app_ws_cb_b.ts @@ -3,33 +3,33 @@ import { _b, clone } from '@ctx-core/object' import { bufferToBase64 } from '@syn-ui/utils' import { me_b } from '@syn-ui/zome-client' import { - Change_SignalOps_b, ChangeReq_SignalOps_b, CommitNotice_SignalOps_b, - FolkLore_SignalOps_b, Heartbeat_SignalOps_b, - SignalOps, SyncReq_SignalOps_b, SyncResp_SignalOps_b + Change_SignalOps_b, ChangeReq_SignalOps_b, CommitNotice_SignalOps_b, + FolkLore_SignalOps_b, Heartbeat_SignalOps_b, + SignalOps, SyncReq_SignalOps_b, SyncResp_SignalOps_b } from '../signals' -export const app_ws_cb_b = _b('app_ws_cb', (ctx) => { - const me = me_b(ctx) - const signal_ops:SignalOps = clone( - Change_SignalOps_b(ctx), - ChangeReq_SignalOps_b(ctx), - CommitNotice_SignalOps_b(ctx), - FolkLore_SignalOps_b(ctx), - Heartbeat_SignalOps_b(ctx), - SyncReq_SignalOps_b(ctx), - SyncResp_SignalOps_b(ctx), - ) - return app_ws_cb - async function app_ws_cb(signal:AppSignal) { - // ignore signals not meant for me - if (bufferToBase64(signal.data.cellId[1]) !== me.$) { - return +export const app_ws_cb_b = _b('app_ws_cb', (ctx)=>{ + const me = me_b(ctx) + const signal_ops:SignalOps = clone( + Change_SignalOps_b(ctx), + ChangeReq_SignalOps_b(ctx), + CommitNotice_SignalOps_b(ctx), + FolkLore_SignalOps_b(ctx), + Heartbeat_SignalOps_b(ctx), + SyncReq_SignalOps_b(ctx), + SyncResp_SignalOps_b(ctx), + ) + return app_ws_cb + async function app_ws_cb(signal:AppSignal) { + // ignore signals not meant for me + if (bufferToBase64(signal.data.cellId[1]) !== me.$) { + return + } + const { signal_name } = signal.data.payload + console.log('Got Signal', signal_name, signal) + const signal_payload_op = signal_ops[signal_name] + if (!signal_payload_op) { + console.warn(`Undefined SignalOp: ${signal_name}`) + } + await signal_payload_op(signal) } - const { signal_name } = signal.data.payload - console.log('Got Signal', signal_name, signal) - const signal_payload_op = signal_ops[signal_name] - if (!signal_payload_op) { - console.warn(`Undefined SignalOp: ${signal_name}`) - } - await signal_payload_op(signal) - } }) diff --git a/ui/libs/model/src/timers/Timer.ts b/ui/libs/model/src/timers/Timer.ts index 666d6324..9cad8da5 100644 --- a/ui/libs/model/src/timers/Timer.ts +++ b/ui/libs/model/src/timers/Timer.ts @@ -1,15 +1,15 @@ export class Timer { - interval_id:any - constructor(protected setInterval_fn:()=>void, protected interval_ms:number) {} - start() { - this.stop() - this.interval_id = setInterval(this.setInterval_fn, this.interval_ms) - } - stop() { - const { interval_id } = this - if (interval_id) { - clearInterval(interval_id) - this.interval_id = null + interval_id:any + constructor(protected setInterval_fn:()=>void, protected interval_ms:number) {} + start() { + this.stop() + this.interval_id = setInterval(this.setInterval_fn, this.interval_ms) + } + stop() { + const { interval_id } = this + if (interval_id) { + clearInterval(interval_id) + this.interval_id = null + } } - } } diff --git a/ui/libs/model/src/timers/request_checker_timer_b.ts b/ui/libs/model/src/timers/request_checker_timer_b.ts index 3e48b9ca..f7f1e6fb 100644 --- a/ui/libs/model/src/timers/request_checker_timer_b.ts +++ b/ui/libs/model/src/timers/request_checker_timer_b.ts @@ -5,39 +5,39 @@ import { session_info_b } from '../session' import { Timer } from './Timer' const request_timeout = 1000 export const request_checker_timer_b = _b('request_checker_timer', (ctx)=>{ - const requested_changes = requested_changes_b(ctx) - const session_info = session_info_b(ctx) - const rpc_send_sync_request = rpc_send_sync_request_b(ctx) - return new Timer(async ()=>{ - const $requested_changes = requested_changes.$ - if ($requested_changes.length > 0) { - const at = $requested_changes[0]?.at - if (at && (Date.now() - at) > request_timeout) { - // for now let's just do the most drastic thing! - /* - console.log('requested change timed out! Undoing all changes', $requested_changes[0]) - // TODO: make sure this is transactional and no request_changes squeak in ! - while ($requested_changes.length > 0) { - requested_changes.update(changes => { - const change = changes.pop() - console.log('undoing ', change) - const undoDelta = undoFn(change) - console.log('undoDelta: ', undoDelta) - const apply_deltas = apply_deltas_b(ctx) - await apply_deltas(undoDelta) - return changes - }) - }*/ + const requested_changes = requested_changes_b(ctx) + const session_info = session_info_b(ctx) + const rpc_send_sync_request = rpc_send_sync_request_b(ctx) + return new Timer(async ()=>{ + const $requested_changes = requested_changes.$ + if ($requested_changes.length > 0) { + const at = $requested_changes[0]?.at + if (at && (Date.now() - at) > request_timeout) { + // for now let's just do the most drastic thing! + /* + console.log('requested change timed out! Undoing all changes', $requested_changes[0]) + // TODO: make sure this is transactional and no request_changes squeak in ! + while ($requested_changes.length > 0) { + requested_changes.update(changes => { + const change = changes.pop() + console.log('undoing ', change) + const undoDelta = undoFn(change) + console.log('undoDelta: ', undoDelta) + const apply_deltas = apply_deltas_b(ctx) + await apply_deltas(undoDelta) + return changes + }) + }*/ - // and send a sync request incase something just got out of sequence - // TODO: prepare for shifting to new scribe if they went offline - await session_info.refresh() - console.log('HERE') - const $session_info = session_info.$ - if ($session_info) { - await rpc_send_sync_request($session_info.scribe) + // and send a sync request incase something just got out of sequence + // TODO: prepare for shifting to new scribe if they went offline + await session_info.refresh() + console.log('HERE') + const $session_info = session_info.$ + if ($session_info) { + await rpc_send_sync_request($session_info.scribe) + } + } } - } - } - }, request_timeout / 2) + }, request_timeout / 2) }) diff --git a/ui/libs/model/src/timers/scribe_heartbeat_timer_b.ts b/ui/libs/model/src/timers/scribe_heartbeat_timer_b.ts index 9a8b60f0..268ef20f 100644 --- a/ui/libs/model/src/timers/scribe_heartbeat_timer_b.ts +++ b/ui/libs/model/src/timers/scribe_heartbeat_timer_b.ts @@ -9,37 +9,37 @@ const outOfSessionTimout = 8 * 1000 // testing code :) // const heartbeatInterval = 15 * 1000 // 15 seconds const heartbeat_interval = 30 * 1000 // for testing ;) export const scribe_heartbeat_timer_b = _b<Timer>('scribe_heartbeat_timer', (ctx)=>{ - const am_i_scribe = am_i_scribe_b(ctx) - const folks = folks_b(ctx) - return new Timer(async ()=>{ - if (am_i_scribe.$ === true) { - // examine folks last seen time and see if any have crossed the session out-of-session - // timeout so we can tell everybody else about them having dropped. - const gone:AgentPubKey[] = [] - const $folks = folks.$ as PubKeyToFolkRecord - for (const [pubKeyStr, folk] of Object.entries($folks)) { - if (folk.inSession && (Date.now() - ($folks[pubKeyStr].lastSeen||0) > outOfSessionTimout)) { - folk.inSession = false - gone.push($folks[pubKeyStr].pubKey) + const am_i_scribe = am_i_scribe_b(ctx) + const folks = folks_b(ctx) + return new Timer(async ()=>{ + if (am_i_scribe.$ === true) { + // examine folks last seen time and see if any have crossed the session out-of-session + // timeout so we can tell everybody else about them having dropped. + const gone:AgentPubKey[] = [] + const $folks = folks.$ as PubKeyToFolkRecord + for (const [pubKeyStr, folk] of Object.entries($folks)) { + if (folk.inSession && (Date.now() - ($folks[pubKeyStr].lastSeen || 0) > outOfSessionTimout)) { + folk.inSession = false + gone.push($folks[pubKeyStr].pubKey) + } + } + if (gone.length > 0) { + folks.$ = $folks + const rpc_send_folk_lore = rpc_send_folk_lore_b(ctx) + const _scribe_signal_folk_pubKey_a1 = _scribe_signal_folk_pubKey_a1_b(ctx) + await rpc_send_folk_lore({ + participants: _scribe_signal_folk_pubKey_a1(), + data: { gone } + }) + } + } else { + // I'm not the scribe so send them a heartbeat + const rpc_send_heartbeat = rpc_send_heartbeat_b(ctx) + const scribe = scribe_b(ctx) + await rpc_send_heartbeat({ + scribe: scribe.$, + data: 'Hello' + }) } - } - if (gone.length > 0) { - folks.$ = $folks - const rpc_send_folk_lore = rpc_send_folk_lore_b(ctx) - const _scribe_signal_folk_pubKey_a1 = _scribe_signal_folk_pubKey_a1_b(ctx) - await rpc_send_folk_lore({ - participants: _scribe_signal_folk_pubKey_a1(), - data: { gone } - }) - } - } else { - // I'm not the scribe so send them a heartbeat - const rpc_send_heartbeat = rpc_send_heartbeat_b(ctx) - const scribe = scribe_b(ctx) - await rpc_send_heartbeat({ - scribe: scribe.$, - data: 'Hello' - }) - } - }, heartbeat_interval) + }, heartbeat_interval) }) diff --git a/ui/libs/utils/src/base64ToBuffer.ts b/ui/libs/utils/src/base64ToBuffer.ts index 38feec18..a3be3aa5 100644 --- a/ui/libs/utils/src/base64ToBuffer.ts +++ b/ui/libs/utils/src/base64ToBuffer.ts @@ -1,8 +1,8 @@ export const base64ToBuffer = base64=>{ - if (!base64) return - if (typeof window !== 'undefined') { - return Uint8Array.from(window.atob(base64), c=>c.charCodeAt(0)) - } else { - return Buffer.from(base64, 'base64') - } + if (!base64) return + if (typeof window !== 'undefined') { + return Uint8Array.from(window.atob(base64), c=>c.charCodeAt(0)) + } else { + return Buffer.from(base64, 'base64') + } } diff --git a/ui/libs/utils/src/bufferToBase64.ts b/ui/libs/utils/src/bufferToBase64.ts index d33fc1de..e182b3fd 100644 --- a/ui/libs/utils/src/bufferToBase64.ts +++ b/ui/libs/utils/src/bufferToBase64.ts @@ -1,15 +1,15 @@ export const bufferToBase64 = buffer=>{ - if (typeof window !== 'undefined') { - // browser - let binary = '' - const bytes = new Uint8Array(buffer) - const len = bytes.byteLength - for (let i = 0; i < len; i++) { - binary += String.fromCharCode(bytes[i]) + if (typeof window !== 'undefined') { + // browser + let binary = '' + const bytes = new Uint8Array(buffer) + const len = bytes.byteLength + for (let i = 0; i < len; i++) { + binary += String.fromCharCode(bytes[i]) + } + return window.btoa(binary) + } else { + // nodejs + return buffer.toString('base64') } - return window.btoa(binary) - } else { - // nodejs - return buffer.toString('base64') - } } diff --git a/ui/libs/zome-client/src/ApiResponse.ts b/ui/libs/zome-client/src/ApiResponse.ts index ae46d277..9ce437f1 100644 --- a/ui/libs/zome-client/src/ApiResponse.ts +++ b/ui/libs/zome-client/src/ApiResponse.ts @@ -1,7 +1,7 @@ import type { AgentPubKey } from '@holochain/conductor-api' import type { Participant } from './Participant' export interface ApiResponse extends Record<string, any> { - pubKey:AgentPubKey - gone?:AgentPubKey[] - participants:Participant[] + pubKey:AgentPubKey + gone?:AgentPubKey[] + participants:Participant[] } diff --git a/ui/libs/zome-client/src/Buffer.ts b/ui/libs/zome-client/src/Buffer.ts index 3a1ba4ff..8dbd1d18 100644 --- a/ui/libs/zome-client/src/Buffer.ts +++ b/ui/libs/zome-client/src/Buffer.ts @@ -1,10 +1,10 @@ import { Buffer } from 'buffer' export { Buffer } if (typeof window !== 'undefined') { - window.Buffer = Buffer + window.Buffer = Buffer } declare global { - interface Window { - Buffer:typeof Buffer - } + interface Window { + Buffer:typeof Buffer + } } diff --git a/ui/libs/zome-client/src/Commit.ts b/ui/libs/zome-client/src/Commit.ts index e51e7f7f..a648e47c 100644 --- a/ui/libs/zome-client/src/Commit.ts +++ b/ui/libs/zome-client/src/Commit.ts @@ -2,16 +2,16 @@ import type { AgentPubKey } from '@holochain/conductor-api' import type { EntryHash, HeaderHash } from '@syn-ui/utils/dist' import type { Delta } from './Delta' export interface Commit { - snapshot:HeaderHash - change:{ - deltas:string[]|Delta[] - content_hash:EntryHash - previous_change:EntryHash - meta:{ - contributors:string[] - witnesses:string[] - app_specific:null - } - }, - participants:AgentPubKey[] + snapshot:HeaderHash + change:{ + deltas:string[]|Delta[] + content_hash:EntryHash + previous_change:EntryHash + meta:{ + contributors:string[] + witnesses:string[] + app_specific:null + } + }, + participants:AgentPubKey[] } diff --git a/ui/libs/zome-client/src/Content.ts b/ui/libs/zome-client/src/Content.ts index 9e7d6991..64b23020 100644 --- a/ui/libs/zome-client/src/Content.ts +++ b/ui/libs/zome-client/src/Content.ts @@ -1,5 +1,5 @@ export interface Content { - title:string - body:string - meta:Record<string, number> + title:string + body:string + meta:Record<string, number> } diff --git a/ui/libs/zome-client/src/Delta.ts b/ui/libs/zome-client/src/Delta.ts index 45d5b48e..e244e969 100644 --- a/ui/libs/zome-client/src/Delta.ts +++ b/ui/libs/zome-client/src/Delta.ts @@ -1,27 +1,27 @@ export type DeltaValue = TitleDeltaValue|AddDeltaValue|DeleteDeltaValue|MetaDeltaValue export interface Delta { - type:string - value:DeltaValue + type:string + value:DeltaValue } export type TitleDeltaValue = string export interface TitleDelta extends Delta { - type:'Title' - value:TitleDeltaValue + type:'Title' + value:TitleDeltaValue } export type AddDeltaValue = [number, string] export interface AddDelta extends Delta { - type:'Add' - value:AddDeltaValue + type:'Add' + value:AddDeltaValue } export type DeleteDeltaValue = [number, number] export interface DeleteDelta extends Delta { - type:'Delete' - value:DeleteDeltaValue + type:'Delete' + value:DeleteDeltaValue } export interface MetaDeltaValue { - setLoc:[string, number] + setLoc:[string, number] } export interface MetaDelta extends Delta { - type:'Meta' - value:MetaDeltaValue + type:'Meta' + value:MetaDeltaValue } diff --git a/ui/libs/zome-client/src/Folk.ts b/ui/libs/zome-client/src/Folk.ts index 7dc08b43..ea315a2a 100644 --- a/ui/libs/zome-client/src/Folk.ts +++ b/ui/libs/zome-client/src/Folk.ts @@ -1,21 +1,21 @@ import type { AgentPubKey } from '@holochain/conductor-api' import type { FolkColors } from './FolkColors' export interface Folk { - pubKey:AgentPubKey - inSession?:boolean - colors?:FolkColors - lastSeen?:number + pubKey:AgentPubKey + inSession?:boolean + colors?:FolkColors + lastSeen?:number } export type pk = 'pubKey' export type PubKeyToFolkRecord = { - [L in keyof Exclude<any, 'pubKey'>]:Folk; + [L in keyof Exclude<any, 'pubKey'>]:Folk; }&{ - pubKey?:AgentPubKey + pubKey?:AgentPubKey } export enum FolkStatus { - FOLK_SEEN = 1, - FOLK_GONE = 2, - FOLK_UNKNOWN = 3, + FOLK_SEEN = 1, + FOLK_GONE = 2, + FOLK_UNKNOWN = 3, } export const FOLK_SEEN = FolkStatus.FOLK_SEEN export const FOLK_GONE = FolkStatus.FOLK_GONE diff --git a/ui/libs/zome-client/src/FolkColors.ts b/ui/libs/zome-client/src/FolkColors.ts index bbe0e06e..320838b9 100644 --- a/ui/libs/zome-client/src/FolkColors.ts +++ b/ui/libs/zome-client/src/FolkColors.ts @@ -1,8 +1,8 @@ import type { HSL } from './HSL' export interface FolkColors { - primary:HSL - hexagon:HSL - selection:HSL - lookingSelection:HSL - lookingCursor:HSL + primary:HSL + hexagon:HSL + selection:HSL + lookingSelection:HSL + lookingCursor:HSL } diff --git a/ui/libs/zome-client/src/Participant.ts b/ui/libs/zome-client/src/Participant.ts index 0b1ca369..31d2a9cf 100644 --- a/ui/libs/zome-client/src/Participant.ts +++ b/ui/libs/zome-client/src/Participant.ts @@ -1,5 +1,5 @@ import type { HoloHash } from '@holochain/conductor-api' export interface Participant extends HoloHash { - pubKey:HoloHash - meta:number + pubKey:HoloHash + meta:number } diff --git a/ui/libs/zome-client/src/SessionInfo.ts b/ui/libs/zome-client/src/SessionInfo.ts index a6596081..55cff66b 100644 --- a/ui/libs/zome-client/src/SessionInfo.ts +++ b/ui/libs/zome-client/src/SessionInfo.ts @@ -2,11 +2,11 @@ import type { AgentPubKey } from '@holochain/conductor-api' import type { EntryHash } from '@syn-ui/utils' import type { Content } from './Content' export interface SessionInfo { - type:'SessionInfo' - session:EntryHash - scribe:AgentPubKey - snapshot_content:Content - snapshot_hash:EntryHash - deltas:string[] - content_hash:EntryHash + type:'SessionInfo' + session:EntryHash + scribe:AgentPubKey + snapshot_content:Content + snapshot_hash:EntryHash + deltas:string[] + content_hash:EntryHash } diff --git a/ui/libs/zome-client/src/Signal.ts b/ui/libs/zome-client/src/Signal.ts index e7c422b9..fafb5418 100644 --- a/ui/libs/zome-client/src/Signal.ts +++ b/ui/libs/zome-client/src/Signal.ts @@ -1,4 +1,4 @@ export interface Signal { - signal_name:string, - signal_payload? + signal_name:string, + signal_payload? } diff --git a/ui/libs/zome-client/src/StateForSync.ts b/ui/libs/zome-client/src/StateForSync.ts index bfa8e5b6..6ba4bb93 100644 --- a/ui/libs/zome-client/src/StateForSync.ts +++ b/ui/libs/zome-client/src/StateForSync.ts @@ -1,14 +1,14 @@ import type { EntryHash, HeaderHash } from '@syn-ui/utils' import type { Delta } from './Delta' export interface StateForSync { - snapshot:EntryHash - commit?:HeaderHash - commit_content_hash:EntryHash - deltas:Delta[] + snapshot:EntryHash + commit?:HeaderHash + commit_content_hash:EntryHash + deltas:Delta[] } export interface StateForSync_serialized_I { - snapshot:EntryHash - commit?:HeaderHash - commit_content_hash:EntryHash - deltas:string[] + snapshot:EntryHash + commit?:HeaderHash + commit_content_hash:EntryHash + deltas:string[] } diff --git a/ui/libs/zome-client/src/agent_pub_key_b.ts b/ui/libs/zome-client/src/agent_pub_key_b.ts index 1241969b..17c5989c 100644 --- a/ui/libs/zome-client/src/agent_pub_key_b.ts +++ b/ui/libs/zome-client/src/agent_pub_key_b.ts @@ -2,8 +2,8 @@ import { _b } from '@ctx-core/object' import { derived$ } from '@ctx-core/store' import { cell_id_b } from './cell_id_b' export const agent_pub_key_b = _b('agent_pub_key', (ctx)=>{ - const cell_id = cell_id_b(ctx) - return derived$(cell_id, $cell_id=> - $cell_id?.[1] - ) + const cell_id = cell_id_b(ctx) + return derived$(cell_id, $cell_id=> + $cell_id?.[1] + ) }) diff --git a/ui/libs/zome-client/src/appInfo_b.ts b/ui/libs/zome-client/src/appInfo_b.ts index 540c4f83..77f1f446 100644 --- a/ui/libs/zome-client/src/appInfo_b.ts +++ b/ui/libs/zome-client/src/appInfo_b.ts @@ -5,48 +5,48 @@ import { app_ws_b } from './app_ws_b' import { app_id_b } from './app_id_b' import { app_port_b } from './app_port_b' export const appInfo_b = _b('appInfo', (ctx)=>{ - const app_id = app_id_b(ctx) - const app_ws = app_ws_b(ctx) - const app_port = app_port_b(ctx) - const { store: appInfo_frame, set: set_appInfo_frame } = _readable_set_ctx$<$appInfo_frame_T>({ - $app_ws: app_ws.$, - $app_id: app_id.$, - $app_port: app_port.$, - done: false, - }) - const appInfo:appInfo_T = assign( - derived$([app_ws, app_id, app_port], ([$app_ws, $app_id, $app_port], set)=>{ - if (!$app_ws || !$app_id || !$app_port) return - const $appInfo_frame = { $app_ws, $app_id, $app_port, done: false } - if (_is_current($appInfo_frame)) return - set_appInfo_frame($appInfo_frame) - ;(async ()=>{ - const $appInfo = await $app_ws.appInfo({ installed_app_id: $app_id }) - if (!_is_current($appInfo_frame)) return - set($appInfo) - set_appInfo_frame(assign($appInfo_frame, { done: true })) - })() - }), { - appInfo_frame + const app_id = app_id_b(ctx) + const app_ws = app_ws_b(ctx) + const app_port = app_port_b(ctx) + const { store: appInfo_frame, set: set_appInfo_frame } = _readable_set_ctx$<$appInfo_frame_T>({ + $app_ws: app_ws.$, + $app_id: app_id.$, + $app_port: app_port.$, + done: false, + }) + const appInfo:appInfo_T = assign( + derived$([app_ws, app_id, app_port], ([$app_ws, $app_id, $app_port], set)=>{ + if (!$app_ws || !$app_id || !$app_port) return + const $appInfo_frame = { $app_ws, $app_id, $app_port, done: false } + if (_is_current($appInfo_frame)) return + set_appInfo_frame($appInfo_frame) + ;(async ()=>{ + const $appInfo = await $app_ws.appInfo({ installed_app_id: $app_id }) + if (!_is_current($appInfo_frame)) return + set($appInfo) + set_appInfo_frame(assign($appInfo_frame, { done: true })) + })() + }), { + appInfo_frame + } + ) as appInfo_T + return appInfo + function _is_current(compare_$appInfo_frame:$appInfo_frame_T) { + const $appInfo_frame = appInfo_frame.$ + return ( + $appInfo_frame.$app_ws === compare_$appInfo_frame.$app_ws + && $appInfo_frame.$app_id === compare_$appInfo_frame.$app_id + && $appInfo_frame.$app_port === compare_$appInfo_frame.$app_port + ) } - ) as appInfo_T - return appInfo - function _is_current(compare_$appInfo_frame:$appInfo_frame_T) { - const $appInfo_frame = appInfo_frame.$ - return ( - $appInfo_frame.$app_ws === compare_$appInfo_frame.$app_ws - && $appInfo_frame.$app_id === compare_$appInfo_frame.$app_id - && $appInfo_frame.$app_port === compare_$appInfo_frame.$app_port - ) - } }) export type $appInfo_T = InstalledAppInfo export interface $appInfo_frame_T { - $app_ws?:AppWebsocket - $app_id?:string - $app_port?:number - done:boolean + $app_ws?:AppWebsocket + $app_id?:string + $app_port?:number + done:boolean } export interface appInfo_T extends Readable$<$appInfo_T>, $appInfo_frame_T { - appInfo_frame:Writable$<$appInfo_frame_T> + appInfo_frame:Writable$<$appInfo_frame_T> } diff --git a/ui/libs/zome-client/src/app_id_b.ts b/ui/libs/zome-client/src/app_id_b.ts index 976988d0..0a526d49 100644 --- a/ui/libs/zome-client/src/app_id_b.ts +++ b/ui/libs/zome-client/src/app_id_b.ts @@ -1,5 +1,5 @@ import { _b } from '@ctx-core/object' import { writable$ } from '@ctx-core/store' export const app_id_b = _b('app_id', ()=>{ - return writable$<undefined|string>(undefined) + return writable$<undefined|string>(undefined) }) diff --git a/ui/libs/zome-client/src/app_port_b.ts b/ui/libs/zome-client/src/app_port_b.ts index c07396bf..5c57a249 100644 --- a/ui/libs/zome-client/src/app_port_b.ts +++ b/ui/libs/zome-client/src/app_port_b.ts @@ -1,5 +1,5 @@ import { _b } from '@ctx-core/object' import { writable$ } from '@ctx-core/store' export const app_port_b = _b('app_port', ()=>{ - return writable$<undefined|number>(undefined) + return writable$<undefined|number>(undefined) }) diff --git a/ui/libs/zome-client/src/app_ws_b.ts b/ui/libs/zome-client/src/app_ws_b.ts index 5cbb2d84..c0674ca7 100644 --- a/ui/libs/zome-client/src/app_ws_b.ts +++ b/ui/libs/zome-client/src/app_ws_b.ts @@ -3,60 +3,60 @@ import { _b, assign } from '@ctx-core/object' import { _readable_set_ctx$, Readable$ } from '@ctx-core/store' import { app_port_b } from './app_port_b' export const app_ws_b = _b('app_ws', (ctx)=>{ - const app_port = app_port_b(ctx) - const { store, set } = _readable_set_ctx$<$app_ws_T>(undefined) - const { store: app_ws_frame, set: set_app_ws_frame } = _readable_set_ctx$<$app_ws_frame_T>( - _init_$app_ws_frame() - ) - const app_ws:app_ws_T = assign(store, { - load, - close, - app_ws_frame - }) - return app_ws - async function load(signal_fn:AppSignalCb) { - const $app_port = app_port.$ - if (!$app_port || !($app_port > 0)) throw `app_port.$ must have a value > 0` - const $app_ws_frame = app_ws_frame.$ - if ($app_ws_frame.$app_port === $app_port) return - if ($app_ws_frame.$app_ws) { - await $app_ws_frame.$app_ws.client.socket.close() + const app_port = app_port_b(ctx) + const { store, set } = _readable_set_ctx$<$app_ws_T>(undefined) + const { store: app_ws_frame, set: set_app_ws_frame } = _readable_set_ctx$<$app_ws_frame_T>( + _init_$app_ws_frame() + ) + const app_ws:app_ws_T = assign(store, { + load, + close, + app_ws_frame + }) + return app_ws + async function load(signal_fn:AppSignalCb) { + const $app_port = app_port.$ + if (!$app_port || !($app_port > 0)) throw `app_port.$ must have a value > 0` + const $app_ws_frame = app_ws_frame.$ + if ($app_ws_frame.$app_port === $app_port) return + if ($app_ws_frame.$app_ws) { + await $app_ws_frame.$app_ws.client.socket.close() + } + set_app_ws_frame({ $app_port, done: false }) + const $app_ws = await _$app_ws($app_port, signal_fn) + set_app_ws_frame({ $app_ws, $app_port, done: true }) + set($app_ws) } - set_app_ws_frame({ $app_port, done: false }) - const $app_ws = await _$app_ws($app_port, signal_fn) - set_app_ws_frame({ $app_ws, $app_port, done: true }) - set($app_ws) - } - async function close() { - const $app_ws = app_ws.$ - if ($app_ws) { - await $app_ws.client.socket.close() + async function close() { + const $app_ws = app_ws.$ + if ($app_ws) { + await $app_ws.client.socket.close() + } + set(undefined) + set_app_ws_frame(_init_$app_ws_frame()) } - set(undefined) - set_app_ws_frame(_init_$app_ws_frame()) - } - function _init_$app_ws_frame() { - return { - $app_ws: store.$, - $app_port: app_port.$, - done: true + function _init_$app_ws_frame() { + return { + $app_ws: store.$, + $app_port: app_port.$, + done: true + } } - } }) export async function _$app_ws(app_port:number, signal_fn:AppSignalCb) { - return await AppWebsocket.connect( - `ws://localhost:${app_port}`, - 30000, - (signal)=>signal_fn(signal)) + return await AppWebsocket.connect( + `ws://localhost:${app_port}`, + 30000, + (signal)=>signal_fn(signal)) } export type $app_ws_T = undefined|AppWebsocket export interface app_ws_T extends Readable$<$app_ws_T> { - load(signal_fn:AppSignalCb):Promise<void> - close():Promise<void> - app_ws_frame:Readable$<$app_ws_frame_T> + load(signal_fn:AppSignalCb):Promise<void> + close():Promise<void> + app_ws_frame:Readable$<$app_ws_frame_T> } export interface $app_ws_frame_T { - $app_ws?:$app_ws_T - $app_port?:number - done:boolean + $app_ws?:$app_ws_T + $app_port?:number + done:boolean } diff --git a/ui/libs/zome-client/src/cell_id_b.ts b/ui/libs/zome-client/src/cell_id_b.ts index 7401b777..1ffe05cc 100644 --- a/ui/libs/zome-client/src/cell_id_b.ts +++ b/ui/libs/zome-client/src/cell_id_b.ts @@ -2,8 +2,8 @@ import { _b } from '@ctx-core/object' import { derived$ } from '@ctx-core/store' import { appInfo_b } from './appInfo_b' export const cell_id_b = _b('cell_id', (ctx)=>{ - const appInfo = appInfo_b(ctx) - return derived$(appInfo, $appInfo=>{ - return $appInfo?.cell_data?.[0]?.cell_id - }) + const appInfo = appInfo_b(ctx) + return derived$(appInfo, $appInfo=>{ + return $appInfo?.cell_data?.[0]?.cell_id + }) }) diff --git a/ui/libs/zome-client/src/decodeJson.ts b/ui/libs/zome-client/src/decodeJson.ts index 979a452b..4b3fd44e 100644 --- a/ui/libs/zome-client/src/decodeJson.ts +++ b/ui/libs/zome-client/src/decodeJson.ts @@ -1,17 +1,17 @@ import { base64ToBuffer } from '@syn-ui/utils' import type { ApiResponse } from './ApiResponse' export function decodeJson(jsonStr:string):ApiResponse { - return JSON.parse(jsonStr, function (key:string, value:string) { - // the receiver function looks for the typed array flag - try { - if (key == 'pubKey') { - return base64ToBuffer(value) - } - } catch (e) { - console.log('decodeJson Error:', e) - } + return JSON.parse(jsonStr, function (key:string, value:string) { + // the receiver function looks for the typed array flag + try { + if (key == 'pubKey') { + return base64ToBuffer(value) + } + } catch (e) { + console.log('decodeJson Error:', e) + } - // if flag not found no conversion is done - return value - }) + // if flag not found no conversion is done + return value + }) } diff --git a/ui/libs/zome-client/src/dna_b.ts b/ui/libs/zome-client/src/dna_b.ts index f74dab38..ddb9f899 100644 --- a/ui/libs/zome-client/src/dna_b.ts +++ b/ui/libs/zome-client/src/dna_b.ts @@ -2,8 +2,8 @@ import { _b } from '@ctx-core/object' import { derived$ } from '@ctx-core/store' import { cell_id_b } from './cell_id_b' export const dna_b = _b('dna', (ctx)=>{ - const cell_id = cell_id_b(ctx) - return derived$(cell_id, $cell_id=> - $cell_id?.[0] - ) + const cell_id = cell_id_b(ctx) + return derived$(cell_id, $cell_id=> + $cell_id?.[0] + ) }) diff --git a/ui/libs/zome-client/src/dna_str_b.ts b/ui/libs/zome-client/src/dna_str_b.ts index a91e36fd..3a2f202f 100644 --- a/ui/libs/zome-client/src/dna_str_b.ts +++ b/ui/libs/zome-client/src/dna_str_b.ts @@ -3,8 +3,8 @@ import { derived$ } from '@ctx-core/store' import { bufferToBase64 } from '@syn-ui/utils' import { dna_b } from './dna_b' export const dna_str_b = _b('dna_str', (ctx)=>{ - const dna = dna_b(ctx) - return derived$(dna, $dna=> - $dna ? bufferToBase64($dna) : null - ) + const dna = dna_b(ctx) + return derived$(dna, $dna=> + $dna ? bufferToBase64($dna) : null + ) }) diff --git a/ui/libs/zome-client/src/encodeJson.ts b/ui/libs/zome-client/src/encodeJson.ts index b674f0bd..a5555aaf 100644 --- a/ui/libs/zome-client/src/encodeJson.ts +++ b/ui/libs/zome-client/src/encodeJson.ts @@ -1,13 +1,13 @@ import { bufferToBase64 } from '@syn-ui/utils' export function encodeJson(obj) { - return JSON.stringify(obj, function (key, value) { - if (key === 'pubKey') { - if (typeof window !== 'undefined') { - return bufferToBase64(value) // In the browser it's the actual array - } else { - return bufferToBase64(Buffer.from(value.data)) // In node it's an object - } - } - return value - }) + return JSON.stringify(obj, function (key, value) { + if (key === 'pubKey') { + if (typeof window !== 'undefined') { + return bufferToBase64(value) // In the browser it's the actual array + } else { + return bufferToBase64(Buffer.from(value.data)) // In node it's an object + } + } + return value + }) } diff --git a/ui/libs/zome-client/src/me_b.ts b/ui/libs/zome-client/src/me_b.ts index 1ee31a70..340f3990 100644 --- a/ui/libs/zome-client/src/me_b.ts +++ b/ui/libs/zome-client/src/me_b.ts @@ -3,8 +3,8 @@ import { derived$ } from '@ctx-core/store' import { bufferToBase64 } from '@syn-ui/utils' import { agent_pub_key_b } from './agent_pub_key_b' export const me_b = _b('me', (ctx)=>{ - const agent_pub_key = agent_pub_key_b(ctx) - return derived$(agent_pub_key, $agent_pub_key=> - $agent_pub_key ? bufferToBase64($agent_pub_key) : null - ) + const agent_pub_key = agent_pub_key_b(ctx) + return derived$(agent_pub_key, $agent_pub_key=> + $agent_pub_key ? bufferToBase64($agent_pub_key) : null + ) }) diff --git a/ui/libs/zome-client/src/my_tag_b.ts b/ui/libs/zome-client/src/my_tag_b.ts index 0207f42b..6fcd5ac5 100644 --- a/ui/libs/zome-client/src/my_tag_b.ts +++ b/ui/libs/zome-client/src/my_tag_b.ts @@ -1,9 +1,9 @@ import { _b } from '@ctx-core/object' import { derived$ } from '@ctx-core/store' import { me_b } from './me_b' -export const my_tag_b = _b('my_tag', (ctx) => { - const me = me_b(ctx) - return derived$(me, $me => - $me ? $me.slice(-4) : null - ) +export const my_tag_b = _b('my_tag', (ctx)=>{ + const me = me_b(ctx) + return derived$(me, $me=> + $me ? $me.slice(-4) : null + ) }) diff --git a/ui/libs/zome-client/src/rpc_b.ts b/ui/libs/zome-client/src/rpc_b.ts index ff78a484..01161ce1 100644 --- a/ui/libs/zome-client/src/rpc_b.ts +++ b/ui/libs/zome-client/src/rpc_b.ts @@ -7,36 +7,36 @@ import { cell_id_b } from './cell_id_b' import { agent_pub_key_b } from './agent_pub_key_b' import { appInfo_b } from './appInfo_b' export const rpc_b = _b('rpc', (ctx)=>{ - const app_ws = app_ws_b(ctx) - const cell_id = cell_id_b(ctx) - const agent_pub_key = agent_pub_key_b(ctx) - return rpc - async function rpc(fn_name:string, payload?:any, timeout?:number) { - try { - const zome_name = 'syn' - console.log(`Making zome call ${fn_name} with:`, payload) - const $app_ws = await subscribe_wait_timeout(app_ws, I, 10_000) as AppWebsocket - await subscribe_wait_timeout(appInfo_b(ctx), I, 10_000) - const $cell_id = await subscribe_wait_timeout(cell_id, I, 10_000) - const $agent_pub_key = await subscribe_wait_timeout(agent_pub_key, I, 10_000) - const result = await $app_ws.callZome( - { - cap: null, - cell_id: $cell_id, - zome_name, - fn_name, - provenance: $agent_pub_key, - payload - }, - timeout - ) - return result - } catch (error) { - console.log(`ERROR: rpc ${fn_name}`, { error }) - throw(error) - // if (error == 'Error: Socket is not open') { - // TODO return doResetConnection(dispatch) - // } + const app_ws = app_ws_b(ctx) + const cell_id = cell_id_b(ctx) + const agent_pub_key = agent_pub_key_b(ctx) + return rpc + async function rpc(fn_name:string, payload?:any, timeout?:number) { + try { + const zome_name = 'syn' + console.log(`Making zome call ${fn_name} with:`, payload) + const $app_ws = await subscribe_wait_timeout(app_ws, I, 10_000) as AppWebsocket + await subscribe_wait_timeout(appInfo_b(ctx), I, 10_000) + const $cell_id = await subscribe_wait_timeout(cell_id, I, 10_000) + const $agent_pub_key = await subscribe_wait_timeout(agent_pub_key, I, 10_000) + const result = await $app_ws.callZome( + { + cap: null, + cell_id: $cell_id, + zome_name, + fn_name, + provenance: $agent_pub_key, + payload + }, + timeout + ) + return result + } catch (error) { + console.log(`ERROR: rpc ${fn_name}`, { error }) + throw(error) + // if (error == 'Error: Socket is not open') { + // TODO return doResetConnection(dispatch) + // } + } } - } }) diff --git a/ui/libs/zome-client/src/rpc_commit_b.ts b/ui/libs/zome-client/src/rpc_commit_b.ts index 07987e81..b18db96c 100644 --- a/ui/libs/zome-client/src/rpc_commit_b.ts +++ b/ui/libs/zome-client/src/rpc_commit_b.ts @@ -3,8 +3,8 @@ import type { HeaderHash } from '@syn-ui/utils' import { rpc_b } from './rpc_b' import type { Commit } from './Commit' export const rpc_commit_b = _b('rpc_commit', (ctx)=>{ - const rpc = rpc_b(ctx) - return async function rpc_commit(commit:Commit):Promise<HeaderHash> { - return rpc('commit', commit) - } + const rpc = rpc_b(ctx) + return async function rpc_commit(commit:Commit):Promise<HeaderHash> { + return rpc('commit', commit) + } }) diff --git a/ui/libs/zome-client/src/rpc_get_content_b.ts b/ui/libs/zome-client/src/rpc_get_content_b.ts index 69123ab7..9bbbcb7e 100644 --- a/ui/libs/zome-client/src/rpc_get_content_b.ts +++ b/ui/libs/zome-client/src/rpc_get_content_b.ts @@ -2,9 +2,9 @@ import { _b } from '@ctx-core/object' import type { EntryHash } from '@syn-ui/utils' import { rpc_b } from './rpc_b' import type { SessionInfo } from './SessionInfo' -export const rpc_get_content_b = _b('rpc_get_content', (ctx) => { - const rpc = rpc_b(ctx) - return async function rpc_get_content(content_hash:EntryHash):Promise<SessionInfo> { - return rpc('get_content', content_hash) - } +export const rpc_get_content_b = _b('rpc_get_content', (ctx)=>{ + const rpc = rpc_b(ctx) + return async function rpc_get_content(content_hash:EntryHash):Promise<SessionInfo> { + return rpc('get_content', content_hash) + } }) diff --git a/ui/libs/zome-client/src/rpc_get_folks_b.ts b/ui/libs/zome-client/src/rpc_get_folks_b.ts index 0c5741f9..d9eb34bf 100644 --- a/ui/libs/zome-client/src/rpc_get_folks_b.ts +++ b/ui/libs/zome-client/src/rpc_get_folks_b.ts @@ -2,8 +2,8 @@ import { _b } from '@ctx-core/object' import { rpc_b } from './rpc_b' import type { HoloHash } from '@holochain/conductor-api' export const rpc_get_folks_b = _b('rpc_get_folks', (ctx)=>{ - const rpc = rpc_b(ctx) - return async function rpc_get_folks():Promise<HoloHash[]> { - return await rpc('get_folks') - } + const rpc = rpc_b(ctx) + return async function rpc_get_folks():Promise<HoloHash[]> { + return await rpc('get_folks') + } }) diff --git a/ui/libs/zome-client/src/rpc_get_session_b.ts b/ui/libs/zome-client/src/rpc_get_session_b.ts index ec3a69bd..3a6fa2e2 100644 --- a/ui/libs/zome-client/src/rpc_get_session_b.ts +++ b/ui/libs/zome-client/src/rpc_get_session_b.ts @@ -2,9 +2,9 @@ import { _b } from '@ctx-core/object' import type { EntryHash } from '@syn-ui/utils' import { rpc_b } from './rpc_b' import type { SessionInfo } from './SessionInfo' -export const rpc_get_session_b = _b('rpc_get_session', (ctx) => { - const rpc = rpc_b(ctx) - return async function rpc_get_session(session_hash:EntryHash):Promise<SessionInfo> { - return rpc('get_session', session_hash) - } +export const rpc_get_session_b = _b('rpc_get_session', (ctx)=>{ + const rpc = rpc_b(ctx) + return async function rpc_get_session(session_hash:EntryHash):Promise<SessionInfo> { + return rpc('get_session', session_hash) + } }) diff --git a/ui/libs/zome-client/src/rpc_get_sessions_b.ts b/ui/libs/zome-client/src/rpc_get_sessions_b.ts index da5d07c0..2103dfe3 100644 --- a/ui/libs/zome-client/src/rpc_get_sessions_b.ts +++ b/ui/libs/zome-client/src/rpc_get_sessions_b.ts @@ -2,8 +2,8 @@ import { _b } from '@ctx-core/object' import type { EntryHash } from '@syn-ui/utils' import { rpc_b } from './rpc_b' export const rpc_get_sessions_b = _b('rpc_get_sessions', (ctx)=>{ - const rpc = rpc_b(ctx) - return async function rpc_get_sessions():Promise<EntryHash[]> { - return await rpc('get_sessions') - } + const rpc = rpc_b(ctx) + return async function rpc_get_sessions():Promise<EntryHash[]> { + return await rpc('get_sessions') + } }) diff --git a/ui/libs/zome-client/src/rpc_hash_content_b.ts b/ui/libs/zome-client/src/rpc_hash_content_b.ts index bf899e85..3028d7f9 100644 --- a/ui/libs/zome-client/src/rpc_hash_content_b.ts +++ b/ui/libs/zome-client/src/rpc_hash_content_b.ts @@ -3,8 +3,8 @@ import type { EntryHash } from '@syn-ui/utils/dist' import type { Content } from './Content' import { rpc_b } from './rpc_b' export const rpc_hash_content_b = _b('rpc_hash_content', (ctx)=>{ - const rpc = rpc_b(ctx) - return async function rpc_hash_content(content:Content):Promise<EntryHash> { - return rpc('hash_content', content) - } + const rpc = rpc_b(ctx) + return async function rpc_hash_content(content:Content):Promise<EntryHash> { + return rpc('hash_content', content) + } }) diff --git a/ui/libs/zome-client/src/rpc_new_session_b.ts b/ui/libs/zome-client/src/rpc_new_session_b.ts index ae55a2c9..f255d8b4 100644 --- a/ui/libs/zome-client/src/rpc_new_session_b.ts +++ b/ui/libs/zome-client/src/rpc_new_session_b.ts @@ -2,11 +2,11 @@ import { _b } from '@ctx-core/object' import { rpc_b } from './rpc_b' import type { Content } from './Content' import type { SessionInfo } from './SessionInfo' -export const rpc_new_session_b = _b('rpc_new_session', (ctx) => { - const rpc = rpc_b(ctx) - return async function rpc_new_session( - content:Content = { title: '', body: '', meta: {} } - ):Promise<SessionInfo> { - return rpc('new_session', { content }) - } +export const rpc_new_session_b = _b('rpc_new_session', (ctx)=>{ + const rpc = rpc_b(ctx) + return async function rpc_new_session( + content:Content = { title: '', body: '', meta: {} } + ):Promise<SessionInfo> { + return rpc('new_session', { content }) + } }) diff --git a/ui/libs/zome-client/src/rpc_send_change_b.ts b/ui/libs/zome-client/src/rpc_send_change_b.ts index eea4d836..062ebe1b 100644 --- a/ui/libs/zome-client/src/rpc_send_change_b.ts +++ b/ui/libs/zome-client/src/rpc_send_change_b.ts @@ -3,21 +3,21 @@ import type { HoloHash } from '@holochain/conductor-api' import type { Delta } from './Delta' import { rpc_b } from './rpc_b' export const rpc_send_change_b = _b('rpc_send_change', (ctx)=>{ - const rpc = rpc_b(ctx) - return async function rpc_send_change( - { index, deltas, participants }:rpc_send_change_params_I - ):Promise<void> { - if (participants.length > 0) { - const delta_json_a1 = deltas.map(d=>JSON.stringify(d)) - return rpc('send_change', { - participants, - change: [index, delta_json_a1] - }) + const rpc = rpc_b(ctx) + return async function rpc_send_change( + { index, deltas, participants }:rpc_send_change_params_I + ):Promise<void> { + if (participants.length > 0) { + const delta_json_a1 = deltas.map(d=>JSON.stringify(d)) + return rpc('send_change', { + participants, + change: [index, delta_json_a1] + }) + } } - } }) export interface rpc_send_change_params_I { - index:number - deltas:Delta[] - participants:HoloHash[] + index:number + deltas:Delta[] + participants:HoloHash[] } diff --git a/ui/libs/zome-client/src/rpc_send_change_request_b.ts b/ui/libs/zome-client/src/rpc_send_change_request_b.ts index 73fe6099..790a5958 100644 --- a/ui/libs/zome-client/src/rpc_send_change_request_b.ts +++ b/ui/libs/zome-client/src/rpc_send_change_request_b.ts @@ -3,22 +3,22 @@ import { _b } from '@ctx-core/object' import { rpc_b } from './rpc_b' import type { Delta } from './Delta' export const rpc_send_change_request_b = _b('rpc_send_change_request', (ctx)=>{ - const rpc = rpc_b(ctx) - return async function rpc_send_change_request( - { index, deltas, scribe }:rpc_send_change_request_params_I - ):Promise<void> { - const delta_json_a1 = deltas.map(delta=>JSON.stringify(delta)) - return rpc('send_change_request', { - scribe, - change: [ - index, - delta_json_a1 - ] - }) - } + const rpc = rpc_b(ctx) + return async function rpc_send_change_request( + { index, deltas, scribe }:rpc_send_change_request_params_I + ):Promise<void> { + const delta_json_a1 = deltas.map(delta=>JSON.stringify(delta)) + return rpc('send_change_request', { + scribe, + change: [ + index, + delta_json_a1 + ] + }) + } }) export interface rpc_send_change_request_params_I { - index:number - deltas:Delta[] - scribe:HoloHash + index:number + deltas:Delta[] + scribe:HoloHash } diff --git a/ui/libs/zome-client/src/rpc_send_folk_lore_b.ts b/ui/libs/zome-client/src/rpc_send_folk_lore_b.ts index 8ca86677..e0efc2df 100644 --- a/ui/libs/zome-client/src/rpc_send_folk_lore_b.ts +++ b/ui/libs/zome-client/src/rpc_send_folk_lore_b.ts @@ -4,19 +4,19 @@ import { rpc_b } from './rpc_b' import { encodeJson } from './encodeJson' import type { PubKeyToFolkRecord } from './Folk' export const rpc_send_folk_lore_b = _b('rpc_send_folk_lore', (ctx)=>{ - const rpc = rpc_b(ctx) - return function rpc_send_folk_lore({ participants, data }:SendFolkLoreInput) { - if (participants.length) { - const serialized_data = encodeJson(data) - return rpc('send_folk_lore', { participants, data: serialized_data }) + const rpc = rpc_b(ctx) + return function rpc_send_folk_lore({ participants, data }:SendFolkLoreInput) { + if (participants.length) { + const serialized_data = encodeJson(data) + return rpc('send_folk_lore', { participants, data: serialized_data }) + } } - } }) export interface SendFolkLoreInput { - participants:AgentPubKey[] - data:SendFolkLoreInputData + participants:AgentPubKey[] + data:SendFolkLoreInputData } export interface SendFolkLoreInputData { - participants?:PubKeyToFolkRecord, - gone?:AgentPubKey[] + participants?:PubKeyToFolkRecord, + gone?:AgentPubKey[] } diff --git a/ui/libs/zome-client/src/rpc_send_heartbeat_b.ts b/ui/libs/zome-client/src/rpc_send_heartbeat_b.ts index b5861729..49e7514c 100644 --- a/ui/libs/zome-client/src/rpc_send_heartbeat_b.ts +++ b/ui/libs/zome-client/src/rpc_send_heartbeat_b.ts @@ -2,12 +2,12 @@ import type { HoloHash } from '@holochain/conductor-api' import { _b } from '@ctx-core/object' import { rpc_b } from './rpc_b' export const rpc_send_heartbeat_b = _b('rpc_send_heartbeat', (ctx)=>{ - const rpc = rpc_b(ctx) - return function rpc_send_heartbeat({ scribe, data }:rpc_send_heartbeat_params_I) { - return rpc('send_heartbeat', { scribe, data }) - } + const rpc = rpc_b(ctx) + return function rpc_send_heartbeat({ scribe, data }:rpc_send_heartbeat_params_I) { + return rpc('send_heartbeat', { scribe, data }) + } }) export interface rpc_send_heartbeat_params_I { - scribe:HoloHash - data:string + scribe:HoloHash + data:string } diff --git a/ui/libs/zome-client/src/rpc_send_sync_request_b.ts b/ui/libs/zome-client/src/rpc_send_sync_request_b.ts index f0189f7b..9e01c5d8 100644 --- a/ui/libs/zome-client/src/rpc_send_sync_request_b.ts +++ b/ui/libs/zome-client/src/rpc_send_sync_request_b.ts @@ -2,8 +2,8 @@ import type { AgentPubKey } from '@holochain/conductor-api' import { _b } from '@ctx-core/object' import { rpc_b } from './rpc_b' export const rpc_send_sync_request_b = _b('rpc_send_sync_request', (ctx)=>{ - const rpc = rpc_b(ctx) - return async function rpc_send_sync_request(scribe: AgentPubKey) { - return rpc('send_sync_request', { scribe }) - } + const rpc = rpc_b(ctx) + return async function rpc_send_sync_request(scribe:AgentPubKey) { + return rpc('send_sync_request', { scribe }) + } }) diff --git a/ui/libs/zome-client/src/rpc_send_sync_response_b.ts b/ui/libs/zome-client/src/rpc_send_sync_response_b.ts index 5de45ac1..54f202fb 100644 --- a/ui/libs/zome-client/src/rpc_send_sync_response_b.ts +++ b/ui/libs/zome-client/src/rpc_send_sync_response_b.ts @@ -3,17 +3,17 @@ import { _b, assign } from '@ctx-core/object' import { rpc_b } from './rpc_b' import type { StateForSync, StateForSync_serialized_I } from './StateForSync' export const rpc_send_sync_response_b = _b('rpc_send_sync_response', (ctx)=>{ - const rpc = rpc_b(ctx) - return function rpc_send_sync_response({ participant, state }:SendSyncResponseInput) { - const serialized_state:StateForSync_serialized_I = assign({}, state, { - deltas: state.deltas.map(delta=>JSON.stringify(delta)) - }) - return rpc('send_sync_response', { - participant, state: serialized_state - }) - } + const rpc = rpc_b(ctx) + return function rpc_send_sync_response({ participant, state }:SendSyncResponseInput) { + const serialized_state:StateForSync_serialized_I = assign({}, state, { + deltas: state.deltas.map(delta=>JSON.stringify(delta)) + }) + return rpc('send_sync_response', { + participant, state: serialized_state + }) + } }) export interface SendSyncResponseInput { - participant:HoloHash - state:StateForSync + participant:HoloHash + state:StateForSync } From 391671026428c9da39aea7c641a64942268f57bb Mon Sep 17 00:00:00 2001 From: Brian Takita <brian.takita@gmail.com> Date: Sat, 1 May 2021 12:28:32 -0400 Subject: [PATCH 23/33] + console_b --- tests/unit-test/syn.ts | 704 +++++++++--------- ui/apps/app/src/Syn.svelte | 2 +- ui/libs/model/src/delta/commit_change_b.ts | 97 +-- ui/libs/model/src/delta/record_deltas_b.ts | 2 + ui/libs/model/src/delta/request_change_b.ts | 2 + ui/libs/model/src/session/sessions_b.ts | 9 +- .../src/signals/ChangeReq_SignalOps_b.ts | 2 + .../model/src/signals/Change_SignalOps_b.ts | 2 + .../src/signals/CommitNotice_SignalOps_b.ts | 3 +- .../model/src/signals/FolkLore_SignalOps_b.ts | 2 + .../src/signals/Heartbeat_SignalOps_b.ts | 2 + .../model/src/signals/SyncReq_SignalOps_b.ts | 3 +- .../model/src/signals/SyncResp_SignalOps_b.ts | 3 +- ui/libs/model/src/signals/app_ws_cb_b.ts | 3 +- .../src/timers/request_checker_timer_b.ts | 2 + ui/libs/utils/src/console_b.ts | 13 + ui/libs/utils/src/index.ts | 1 + ui/libs/zome-client/src/decodeJson.ts | 2 +- ui/libs/zome-client/src/rpc_b.ts | 2 + zomes/syn/src/lib.rs | 1 + 20 files changed, 452 insertions(+), 405 deletions(-) create mode 100644 ui/libs/utils/src/console_b.ts diff --git a/tests/unit-test/syn.ts b/tests/unit-test/syn.ts index 02131e27..5915e434 100644 --- a/tests/unit-test/syn.ts +++ b/tests/unit-test/syn.ts @@ -7,9 +7,9 @@ import { derived$, subscribe_wait_timeout, writable$ } from '@ctx-core/store' import { bufferToBase64, EntryHash } from '@syn-ui/utils' import { content_b, apply_deltas_b, session_info_b, join_session, leave_session } from '@syn-ui/model' import { - Commit, Content, Delta, my_tag_b, rpc_commit_b, rpc_get_content_b, rpc_get_folks_b, rpc_get_session_b, - rpc_get_sessions_b, rpc_hash_content_b, rpc_send_change_b, rpc_send_change_request_b, rpc_send_folk_lore_b, - rpc_send_heartbeat_b, rpc_send_sync_request_b, rpc_send_sync_response_b, Signal, StateForSync + Commit, Content, Delta, my_tag_b, rpc_commit_b, rpc_get_content_b, rpc_get_folks_b, rpc_get_session_b, + rpc_get_sessions_b, rpc_hash_content_b, rpc_send_change_b, rpc_send_change_request_b, rpc_send_folk_lore_b, + rpc_send_heartbeat_b, rpc_send_sync_request_b, rpc_send_sync_response_b, Signal, StateForSync } from '@syn-ui/zome-client' import { AgentPubKey } from '@holochain/conductor-api' @@ -20,362 +20,362 @@ const dna = path.join(__dirname, '../../syn.dna') console.log(dna) const installation:InstallAgentsHapps = [ - // one agents - [[dna]], // contains 1 dnaT + // one agents + [[dna]], // contains 1 dnaT ] process.on('unhandledRejection', error=>{ - // Will print "unhandledRejection err is not defined" - console.log('unhandledRejection', error) + // Will print "unhandledRejection err is not defined" + console.log('unhandledRejection', error) }) module.exports = (orchestrator)=>{ - orchestrator.registerScenario('syn basic zome calls', async (s, t)=>{ - - // Delta representation could be JSON or not, for now we are using - // json so setting this variable to true - const jsonDeltas = true - const [me_player, alice_player, bob_player] = await s.players([config, config, config]) - const [[me_happ]] = await me_player.installAgentsHapps(installation) - const [[alice_happ]] = await alice_player.installAgentsHapps(installation) - const [[bob_happ]] = await bob_player.installAgentsHapps(installation) - await s.shareAllNodes([me_player, alice_player, bob_player]) - - const me = me_happ.cells[0] - const alice = alice_happ.cells[0] - const bob = bob_happ.cells[0] - - const me_pubkey = me.cellId[1] - const alice_pubkey = alice.cellId[1] - const alice_pubkey_base64 = bufferToBase64(alice_pubkey) - const bob_pubkey = bob.cellId[1] - const bob_pubkey_base64 = bufferToBase64(bob_pubkey) - - let sessions:EntryHash[] = await me.call('syn', 'get_sessions') - t.equal(sessions.length, 0) - const me_port:number = parseInt(me_player._conductor.appClient.client.socket.url.split(':')[2]) - const alice_port:number = parseInt(alice_player._conductor.appClient.client.socket.url.split(':')[2]) - const bob_port:number = parseInt(bob_player._conductor.appClient.client.socket.url.split(':')[2]) - - const me_ctx = {}, alice_ctx = {}, bob_ctx = {} - await join_session({ app_port: me_port, app_id: me_happ.hAppId, ctx: me_ctx }) - await join_session({ app_port: alice_port, app_id: alice_happ.hAppId, ctx: alice_ctx }) - await join_session({ app_port: bob_port, app_id: bob_happ.hAppId, ctx: bob_ctx }) - - try { - await subscribe_wait_timeout(session_info_b(me_ctx), I, 10_000) - // I created the session, so I should be the scribe - t.deepEqual(session_info_b(me_ctx).$!.scribe, me_pubkey) - // First ever session so content should be default content - t.deepEqual(session_info_b(me_ctx).$!.snapshot_content, { title: '', body: '' }) - let session_hash = session_info_b(me_ctx).$!.session - - // check the hash_content zome call. - let content_hash = await rpc_hash_content_b(me_ctx)(session_info_b(me_ctx).$!.snapshot_content) - t.deepEqual(session_info_b(me_ctx).$!.content_hash, content_hash) - - // check get_sessions utility zome call - sessions = await rpc_get_sessions_b(me_ctx)() - t.equal(sessions.length, 1) - t.deepEqual(sessions[0], session_hash) - - // exercise the get_session zome call - const session_info = await rpc_get_session_b(me_ctx)(session_hash) - t.equal(sessions.length, 1) - t.deepEqual(session_info_b(me_ctx).$, session_info) - - // check that initial snapshot was created by using the get_content zome call - let content = await rpc_get_content_b(me_ctx)(session_info_b(me_ctx).$!.content_hash) - t.deepEqual(content, session_info_b(me_ctx).$!.snapshot_content) - - // set up the pending deltas array - let pending_deltas:Delta[] = [{ type: 'Title', value: 'foo title' }, { type: 'Add', value: [0, 'bar content'] }] - - await apply_deltas_b(me_ctx)(pending_deltas) - const me_content = content_b(me_ctx) - content_hash = await rpc_hash_content_b(me_ctx)(me_content.$) - - let deltas = jsonDeltas ? pending_deltas.map(d=>JSON.stringify(d)) : pending_deltas - - // set signal handlers so we can confirm they get sent and received appropriately - let me_signals = writable$<Signal[]>([]) - const me_signals_length = derived$(me_signals, $me_signals=>$me_signals?.length) - let $me_signals_length = me_signals_length.$ - me_player.setSignalHandler((signal)=>{ - console.log('Received Signal for me:', signal) - me_signals.update($me_signals=>{ - $me_signals.push(signal.data.payload) - return $me_signals - }) - }) - - // alice signal handler - const alice_signals = writable$<Signal[]>([]) - const alice_signals_length = derived$(alice_signals, $alice_signals=>$alice_signals?.length) - let $alice_signals_length = alice_signals_length.$ - alice_player.setSignalHandler((signal)=>{ - console.log('Received Signal for alice:', signal) - alice_signals.update($alice_signals=>{ - $alice_signals.push(signal.data.payload) - return $alice_signals - }) - }) - - // bob signal handler - const bob_signals = writable$<Signal[]>([]) - const bob_signals_length = derived$(bob_signals, $bob_signals=>$bob_signals?.length) - let $bob_signals_length = bob_signals_length.$ - bob_player.setSignalHandler((signal)=>{ - console.log('Received Signal for bob:', signal) - bob_signals.update($bob_signals=>{ - $bob_signals.push(signal.data.payload) - return $bob_signals - }) - }) - - // add a content change - let commit:Commit = { - snapshot: session_info_b(me_ctx).$!.content_hash as EntryHash, - change: { - deltas: deltas, - content_hash: content_hash, - previous_change: session_info_b(me_ctx).$!.content_hash as EntryHash, // this is the first change so same content_hash as snapshot - meta: { - contributors: [], - witnesses: [], - app_specific: null - } - }, - participants: [] - } - let commit_header_hash = await rpc_commit_b(me_ctx)(commit) - t.equal(commit_header_hash.length, 39) // is a content_hash - - // add a second content change - pending_deltas = [ - { type: 'Delete', value: [0, 3] }, - { type: 'Add', value: [0, 'baz'] }, - { type: 'Add', value: [11, ' new'] }, // 'baz content new' - { type: 'Delete', value: [4, 11] }, // 'baz new' - { type: 'Add', value: [4, 'monkey'] }, // 'baz monkey new' - ] - await apply_deltas_b(me_ctx)(pending_deltas) - const new_content_hash_2 = await rpc_hash_content_b(me_ctx)(me_content.$) - - deltas = jsonDeltas ? pending_deltas.map(d=>JSON.stringify(d)) : pending_deltas - commit = { - snapshot: session_info_b(me_ctx).$!.content_hash as EntryHash, - change: { - deltas, - content_hash: new_content_hash_2, - previous_change: content_hash, // this is the second change so previous commit's content_hash - meta: { - contributors: [], - witnesses: [], - app_specific: null - } - }, - participants: [] - } - commit_header_hash = await rpc_commit_b(me_ctx)(commit) - // clear the pending_deltas - pending_deltas = [] - - // alice joins session - const alice_session_info = session_info_b(alice_ctx) - let alice_session_info_$ = alice_session_info.$ - // alice_session_info.$ = await rpc_get_session_b(alice_ctx)(session_hash) - // alice should get my session - t.deepEqual(alice_session_info.$!.session, session_hash) - t.deepEqual(alice_session_info.$!.scribe, me_pubkey) - t.deepEqual(alice_session_info.$!.snapshot_content, { title: '', body: '' }) - - await rpc_send_sync_request_b(alice_ctx)(me_pubkey) - - // check that deltas and snapshot content returned add up to the current real content - await delay(500) // make time for integrating new data - const received_deltas:Delta[] = (jsonDeltas ? alice_session_info.$!.deltas.map(d=>JSON.parse(d)) : alice_session_info.$!.deltas) as Delta[] - await apply_deltas_b(alice_ctx)(received_deltas) - t.deepEqual( - me_content.$, - { title: 'foo title', body: 'baz monkey new', meta: { [my_tag_b(me_ctx).$]: 0 } } // content after two commits - ) - - // confirm that the session_info_b(me_ctx)'s content content_hash matches the content_hash - // generated by applying deltas - content_hash = await rpc_hash_content_b(alice_ctx)(alice_session_info.$!.snapshot_content as Content) - t.deepEqual(alice_session_info.$!.content_hash, content_hash) - - // I should receive alice's request for the state as she joins the session - t.deepEqual(me_signals.$[0], { signal_name: 'SyncReq', signal_payload: alice_pubkey }) - - // I add some pending deltas which I will then need to send to Alice as part of her Joining. - pending_deltas = [{ type: 'Title', value: 'I haven\'t committed yet' }, { type: 'Add', value: [14, '\nBut made a new line! 🍑'] }] - - deltas = jsonDeltas ? pending_deltas.map(d=>JSON.stringify(d)) : pending_deltas - - const state:StateForSync = { - snapshot: session_info_b(me_ctx).$!.content_hash as EntryHash, - commit: commit_header_hash, - commit_content_hash: new_content_hash_2, - deltas: pending_deltas, - } - $alice_signals_length = alice_signals_length.$ - await rpc_send_sync_response_b(me_ctx)({ - participant: alice_pubkey, - state, - }) - await subscribe_wait_timeout(alice_signals_length, _neq($alice_signals_length), 10_000) - $alice_signals_length = alice_signals_length.$ - - // Alice should have received uncommitted deltas - t.equal(alice_signals.$[$alice_signals_length - 1].signal_name, 'SyncResp') - let receivedState = alice_signals.$[$alice_signals_length - 1].signal_payload - t.deepEqual(receivedState, { ...state, deltas: pending_deltas.map(d=>JSON.stringify(d)) }) // deltas, commit, and snapshot match - - // bob joins session - const bob_$session_info = await rpc_get_session_b(bob_ctx)(session_hash) - // bob should get my session - t.deepEqual(bob_$session_info.scribe, me_pubkey) - await rpc_send_sync_request_b(bob_ctx)(me_pubkey) - - t.deepEqual(me_signals.$.map(ms=>ms.signal_name), ['SyncReq']) - // alice sends me a change req and I should receive it - const alice_delta:Delta = { type: 'Title', value: 'Alice in Wonderland' } - let delta = jsonDeltas ? JSON.stringify(alice_delta) : alice_delta - - let me_ChangeReq_signals_length = filter_signal_name(me_signals.$, 'ChangeReq').length - $me_signals_length = me_signals_length.$ - await rpc_send_change_request_b(alice_ctx)({ - scribe: alice_session_info.$!.scribe, - index: 1, - deltas: [alice_delta] - }) - await subscribe_wait_timeout( - me_signals, - $me_signals=> - filter_signal_name($me_signals, 'ChangeReq').length > me_ChangeReq_signals_length, - 10_000) - const sig = filter_signal_name(me_signals.$, 'ChangeReq').reverse()[0] - t.deepEqual(sig.signal_name, 'ChangeReq') - const [sig_index, sig_delta] = sig.signal_payload - t.equal(sig_index, 1) - const receiveDelta = jsonDeltas ? JSON.parse(sig_delta) : sig_delta - t.deepEqual(receiveDelta, alice_delta) // delta_matches - - let my_deltas:Delta[] = [{ type: 'Add', value: [0, 'Whoops!\n'] }, { type: 'Title', value: 'Alice in Wonderland' }] - deltas = jsonDeltas ? my_deltas.map(d=>JSON.stringify(d)) : deltas - let alice_Change_signals_length = filter_signal_name(alice_signals.$, 'Change').length - let bob_Change_signals_length = filter_signal_name(bob_signals.$, 'Change').length - // I send a change, and alice and bob should receive it. - await rpc_send_change_b(me_ctx)({ - participants: [alice_pubkey, bob_pubkey], - index: 2, - deltas: my_deltas, - }) - await subscribe_wait_timeout( - alice_signals, - $alice_signals=>filter_signal_name($alice_signals, 'Change').length > alice_Change_signals_length, - 10_000) - await subscribe_wait_timeout( - bob_signals, - $bob_signals=>filter_signal_name($bob_signals, 'Change').length > bob_Change_signals_length, - 10_000) - let a_sig = filter_signal_name(alice_signals.$, 'Change').reverse()[0] - let b_sig = filter_signal_name(bob_signals.$, 'Change').reverse()[0] - t.equal(a_sig.signal_name, 'Change') - t.equal(b_sig.signal_name, 'Change') - t.deepEqual(a_sig.signal_payload, [2, deltas]) // delta_matches - t.deepEqual(b_sig.signal_payload, [2, deltas]) // delta_matches - - let me_Hearbeat_signal_length = filter_signal_name(me_signals.$, 'Heartbeat').length - await rpc_send_heartbeat_b(alice_ctx)({ - scribe: me_pubkey, - data: 'Hello' - }) - await subscribe_wait_timeout( - me_signals, - $me_signals=>filter_signal_name($me_signals, 'Heartbeat').length > me_Hearbeat_signal_length, - 10_000 - ) - let me_sig = filter_signal_name(me_signals.$, 'Heartbeat').reverse()[0] - t.equal(me_sig.signal_name, 'Heartbeat') - t.deepEqual(me_sig.signal_payload[1], 'Hello') - t.deepEqual(me_sig.signal_payload[0], alice_pubkey) - - let alice_FolkLore_length = filter_signal_name(alice_signals.$, 'FolkLore').length - let bob_FolkLore_length = filter_signal_name(bob_signals.$, 'FolkLore').length - await rpc_send_folk_lore_b(me_ctx)({ - participants: [alice_pubkey, bob_pubkey], - data: { - participants: { - [alice_pubkey]: { - pubKey: alice_pubkey - }, - [bob_pubkey]: { - pubKey: bob_pubkey - }, - } + orchestrator.registerScenario('syn basic zome calls', async (s, t)=>{ + + // Delta representation could be JSON or not, for now we are using + // json so setting this variable to true + const jsonDeltas = true + const [me_player, alice_player, bob_player] = await s.players([config, config, config]) + const [[me_happ]] = await me_player.installAgentsHapps(installation) + const [[alice_happ]] = await alice_player.installAgentsHapps(installation) + const [[bob_happ]] = await bob_player.installAgentsHapps(installation) + await s.shareAllNodes([me_player, alice_player, bob_player]) + + const me = me_happ.cells[0] + const alice = alice_happ.cells[0] + const bob = bob_happ.cells[0] + + const me_pubkey = me.cellId[1] + const alice_pubkey = alice.cellId[1] + const alice_pubkey_base64 = bufferToBase64(alice_pubkey) + const bob_pubkey = bob.cellId[1] + const bob_pubkey_base64 = bufferToBase64(bob_pubkey) + + let sessions:EntryHash[] = await me.call('syn', 'get_sessions') + t.equal(sessions.length, 0) + const me_port:number = parseInt(me_player._conductor.appClient.client.socket.url.split(':')[2]) + const alice_port:number = parseInt(alice_player._conductor.appClient.client.socket.url.split(':')[2]) + const bob_port:number = parseInt(bob_player._conductor.appClient.client.socket.url.split(':')[2]) + + const me_ctx = {}, alice_ctx = {}, bob_ctx = {} + await join_session({ app_port: me_port, app_id: me_happ.hAppId, ctx: me_ctx }) + await join_session({ app_port: alice_port, app_id: alice_happ.hAppId, ctx: alice_ctx }) + await join_session({ app_port: bob_port, app_id: bob_happ.hAppId, ctx: bob_ctx }) + + try { + await subscribe_wait_timeout(session_info_b(me_ctx), I, 10_000) + // I created the session, so I should be the scribe + t.deepEqual(session_info_b(me_ctx).$!.scribe, me_pubkey) + // First ever session so content should be default content + t.deepEqual(session_info_b(me_ctx).$!.snapshot_content, { title: '', body: '' }) + let session_hash = session_info_b(me_ctx).$!.session + + // check the hash_content zome call. + let content_hash = await rpc_hash_content_b(me_ctx)(session_info_b(me_ctx).$!.snapshot_content) + t.deepEqual(session_info_b(me_ctx).$!.content_hash, content_hash) + + // check get_sessions utility zome call + sessions = await rpc_get_sessions_b(me_ctx)() + t.equal(sessions.length, 1) + t.deepEqual(sessions[0], session_hash) + + // exercise the get_session zome call + const session_info = await rpc_get_session_b(me_ctx)(session_hash) + t.equal(sessions.length, 1) + t.deepEqual(session_info_b(me_ctx).$, session_info) + + // check that initial snapshot was created by using the get_content zome call + let content = await rpc_get_content_b(me_ctx)(session_info_b(me_ctx).$!.content_hash) + t.deepEqual(content, session_info_b(me_ctx).$!.snapshot_content) + + // set up the pending deltas array + let pending_deltas:Delta[] = [{ type: 'Title', value: 'foo title' }, { type: 'Add', value: [0, 'bar content'] }] + + await apply_deltas_b(me_ctx)(pending_deltas) + const me_content = content_b(me_ctx) + content_hash = await rpc_hash_content_b(me_ctx)(me_content.$) + + let deltas = jsonDeltas ? pending_deltas.map(d=>JSON.stringify(d)) : pending_deltas + + // set signal handlers so we can confirm they get sent and received appropriately + let me_signals = writable$<Signal[]>([]) + const me_signals_length = derived$(me_signals, $me_signals=>$me_signals?.length) + let $me_signals_length = me_signals_length.$ + me_player.setSignalHandler((signal)=>{ + console.log('Received Signal for me:', signal) + me_signals.update($me_signals=>{ + $me_signals.push(signal.data.payload) + return $me_signals + }) + }) + + // alice signal handler + const alice_signals = writable$<Signal[]>([]) + const alice_signals_length = derived$(alice_signals, $alice_signals=>$alice_signals?.length) + let $alice_signals_length = alice_signals_length.$ + alice_player.setSignalHandler((signal)=>{ + console.log('Received Signal for alice:', signal) + alice_signals.update($alice_signals=>{ + $alice_signals.push(signal.data.payload) + return $alice_signals + }) + }) + + // bob signal handler + const bob_signals = writable$<Signal[]>([]) + const bob_signals_length = derived$(bob_signals, $bob_signals=>$bob_signals?.length) + let $bob_signals_length = bob_signals_length.$ + bob_player.setSignalHandler((signal)=>{ + console.log('Received Signal for bob:', signal) + bob_signals.update($bob_signals=>{ + $bob_signals.push(signal.data.payload) + return $bob_signals + }) + }) + + // add a content change + let commit:Commit = { + snapshot: session_info_b(me_ctx).$!.content_hash as EntryHash, + change: { + deltas: deltas, + content_hash: content_hash, + previous_change: session_info_b(me_ctx).$!.content_hash as EntryHash, // this is the first change so same content_hash as snapshot + meta: { + contributors: [], + witnesses: [], + app_specific: null + } + }, + participants: [] + } + let commit_header_hash = await rpc_commit_b(me_ctx)(commit) + t.equal(commit_header_hash.length, 39) // is a content_hash + + // add a second content change + pending_deltas = [ + { type: 'Delete', value: [0, 3] }, + { type: 'Add', value: [0, 'baz'] }, + { type: 'Add', value: [11, ' new'] }, // 'baz content new' + { type: 'Delete', value: [4, 11] }, // 'baz new' + { type: 'Add', value: [4, 'monkey'] }, // 'baz monkey new' + ] + await apply_deltas_b(me_ctx)(pending_deltas) + const new_content_hash_2 = await rpc_hash_content_b(me_ctx)(me_content.$) + + deltas = jsonDeltas ? pending_deltas.map(d=>JSON.stringify(d)) : pending_deltas + commit = { + snapshot: session_info_b(me_ctx).$!.content_hash as EntryHash, + change: { + deltas, + content_hash: new_content_hash_2, + previous_change: content_hash, // this is the second change so previous commit's content_hash + meta: { + contributors: [], + witnesses: [], + app_specific: null + } + }, + participants: [] + } + commit_header_hash = await rpc_commit_b(me_ctx)(commit) + // clear the pending_deltas + pending_deltas = [] + + // alice joins session + const alice_session_info = session_info_b(alice_ctx) + let alice_session_info_$ = alice_session_info.$ + // alice_session_info.$ = await rpc_get_session_b(alice_ctx)(session_hash) + // alice should get my session + t.deepEqual(alice_session_info.$!.session, session_hash) + t.deepEqual(alice_session_info.$!.scribe, me_pubkey) + t.deepEqual(alice_session_info.$!.snapshot_content, { title: '', body: '' }) + + await rpc_send_sync_request_b(alice_ctx)(me_pubkey) + + // check that deltas and snapshot content returned add up to the current real content + await delay(500) // make time for integrating new data + const received_deltas:Delta[] = (jsonDeltas ? alice_session_info.$!.deltas.map(d=>JSON.parse(d)) : alice_session_info.$!.deltas) as Delta[] + await apply_deltas_b(alice_ctx)(received_deltas) + t.deepEqual( + me_content.$, + { title: 'foo title', body: 'baz monkey new', meta: { [my_tag_b(me_ctx).$]: 0 } } // content after two commits + ) + + // confirm that the session_info_b(me_ctx)'s content content_hash matches the content_hash + // generated by applying deltas + content_hash = await rpc_hash_content_b(alice_ctx)(alice_session_info.$!.snapshot_content as Content) + t.deepEqual(alice_session_info.$!.content_hash, content_hash) + + // I should receive alice's request for the state as she joins the session + t.deepEqual(me_signals.$[0], { signal_name: 'SyncReq', signal_payload: alice_pubkey }) + + // I add some pending deltas which I will then need to send to Alice as part of her Joining. + pending_deltas = [{ type: 'Title', value: 'I haven\'t committed yet' }, { type: 'Add', value: [14, '\nBut made a new line! 🍑'] }] + + deltas = jsonDeltas ? pending_deltas.map(d=>JSON.stringify(d)) : pending_deltas + + const state:StateForSync = { + snapshot: session_info_b(me_ctx).$!.content_hash as EntryHash, + commit: commit_header_hash, + commit_content_hash: new_content_hash_2, + deltas: pending_deltas, + } + $alice_signals_length = alice_signals_length.$ + await rpc_send_sync_response_b(me_ctx)({ + participant: alice_pubkey, + state, + }) + await subscribe_wait_timeout(alice_signals_length, _neq($alice_signals_length), 10_000) + $alice_signals_length = alice_signals_length.$ + + // Alice should have received uncommitted deltas + t.equal(alice_signals.$[$alice_signals_length - 1].signal_name, 'SyncResp') + let receivedState = alice_signals.$[$alice_signals_length - 1].signal_payload + t.deepEqual(receivedState, { ...state, deltas: pending_deltas.map(d=>JSON.stringify(d)) }) // deltas, commit, and snapshot match + + // bob joins session + const bob_$session_info = await rpc_get_session_b(bob_ctx)(session_hash) + // bob should get my session + t.deepEqual(bob_$session_info.scribe, me_pubkey) + await rpc_send_sync_request_b(bob_ctx)(me_pubkey) + + t.deepEqual(me_signals.$.map(ms=>ms.signal_name), ['SyncReq']) + // alice sends me a change req and I should receive it + const alice_delta:Delta = { type: 'Title', value: 'Alice in Wonderland' } + let delta = jsonDeltas ? JSON.stringify(alice_delta) : alice_delta + + let me_ChangeReq_signals_length = filter_signal_name(me_signals.$, 'ChangeReq').length + $me_signals_length = me_signals_length.$ + await rpc_send_change_request_b(alice_ctx)({ + scribe: alice_session_info.$!.scribe, + index: 1, + deltas: [alice_delta] + }) + await subscribe_wait_timeout( + me_signals, + $me_signals=> + filter_signal_name($me_signals, 'ChangeReq').length > me_ChangeReq_signals_length, + 10_000) + const sig = filter_signal_name(me_signals.$, 'ChangeReq').reverse()[0] + t.deepEqual(sig.signal_name, 'ChangeReq') + const [sig_index, sig_delta] = sig.signal_payload + t.equal(sig_index, 1) + const receiveDelta = jsonDeltas ? JSON.parse(sig_delta) : sig_delta + t.deepEqual(receiveDelta, alice_delta) // delta_matches + + let my_deltas:Delta[] = [{ type: 'Add', value: [0, 'Whoops!\n'] }, { type: 'Title', value: 'Alice in Wonderland' }] + deltas = jsonDeltas ? my_deltas.map(d=>JSON.stringify(d)) : deltas + let alice_Change_signals_length = filter_signal_name(alice_signals.$, 'Change').length + let bob_Change_signals_length = filter_signal_name(bob_signals.$, 'Change').length + // I send a change, and alice and bob should receive it. + await rpc_send_change_b(me_ctx)({ + participants: [alice_pubkey, bob_pubkey], + index: 2, + deltas: my_deltas, + }) + await subscribe_wait_timeout( + alice_signals, + $alice_signals=>filter_signal_name($alice_signals, 'Change').length > alice_Change_signals_length, + 10_000) + await subscribe_wait_timeout( + bob_signals, + $bob_signals=>filter_signal_name($bob_signals, 'Change').length > bob_Change_signals_length, + 10_000) + let a_sig = filter_signal_name(alice_signals.$, 'Change').reverse()[0] + let b_sig = filter_signal_name(bob_signals.$, 'Change').reverse()[0] + t.equal(a_sig.signal_name, 'Change') + t.equal(b_sig.signal_name, 'Change') + t.deepEqual(a_sig.signal_payload, [2, deltas]) // delta_matches + t.deepEqual(b_sig.signal_payload, [2, deltas]) // delta_matches + + let me_Hearbeat_signal_length = filter_signal_name(me_signals.$, 'Heartbeat').length + await rpc_send_heartbeat_b(alice_ctx)({ + scribe: me_pubkey, + data: 'Hello' + }) + await subscribe_wait_timeout( + me_signals, + $me_signals=>filter_signal_name($me_signals, 'Heartbeat').length > me_Hearbeat_signal_length, + 10_000 + ) + let me_sig = filter_signal_name(me_signals.$, 'Heartbeat').reverse()[0] + t.equal(me_sig.signal_name, 'Heartbeat') + t.deepEqual(me_sig.signal_payload[1], 'Hello') + t.deepEqual(me_sig.signal_payload[0], alice_pubkey) + + let alice_FolkLore_length = filter_signal_name(alice_signals.$, 'FolkLore').length + let bob_FolkLore_length = filter_signal_name(bob_signals.$, 'FolkLore').length + await rpc_send_folk_lore_b(me_ctx)({ + participants: [alice_pubkey, bob_pubkey], + data: { + participants: { + [alice_pubkey]: { + pubKey: alice_pubkey + }, + [bob_pubkey]: { + pubKey: bob_pubkey + }, + } + } + }) + await subscribe_wait_timeout( + alice_signals, + $signals=>filter_signal_name($signals, 'FolkLore').length > alice_FolkLore_length, + 10_000 + ) + await subscribe_wait_timeout( + bob_signals, + $signals=>filter_signal_name($signals, 'FolkLore').length > bob_FolkLore_length, + 10_000 + ) + a_sig = filter_signal_name(alice_signals.$, 'FolkLore').reverse()[0] + b_sig = filter_signal_name(bob_signals.$, 'FolkLore').reverse()[0] + t.equal(a_sig.signal_name, 'FolkLore') + t.equal(b_sig.signal_name, 'FolkLore') + t.deepEqual(a_sig.signal_payload, JSON.stringify({ + participants: { + [alice_pubkey]: { + pubKey: alice_pubkey_base64 + }, + [bob_pubkey]: { + pubKey: bob_pubkey_base64 + }, + } + })) + t.deepEqual(b_sig.signal_payload, JSON.stringify({ + participants: { + [alice_pubkey]: { + pubKey: alice_pubkey_base64 + }, + [bob_pubkey]: { + pubKey: bob_pubkey_base64 + }, + } + })) + + let me_SyncReq_length = filter_signal_name(me_signals.$, 'SyncReq').length + // alice asks for a sync request + await rpc_send_sync_request_b(alice_ctx)(me_pubkey) + await subscribe_wait_timeout( + me_signals, + $signals=>filter_signal_name($signals, 'SyncReq').length > me_SyncReq_length, + 10_000 + ) + me_sig = filter_signal_name(me_signals.$, 'SyncReq').reverse()[0] + t.equal(me_sig.signal_name, 'SyncReq') + + // confirm that all agents got added to the folks anchor + // TODO figure out why init doesn't happen immediately. + let folks = await rpc_get_folks_b(me_ctx)() + t.equal(folks.length, 3) + } finally { + await leave_session({ ctx: me_ctx }) + await leave_session({ ctx: alice_ctx }) + await leave_session({ ctx: bob_ctx }) } - }) - await subscribe_wait_timeout( - alice_signals, - $signals=>filter_signal_name($signals, 'FolkLore').length > alice_FolkLore_length, - 10_000 - ) - await subscribe_wait_timeout( - bob_signals, - $signals=>filter_signal_name($signals, 'FolkLore').length > bob_FolkLore_length, - 10_000 - ) - a_sig = filter_signal_name(alice_signals.$, 'FolkLore').reverse()[0] - b_sig = filter_signal_name(bob_signals.$, 'FolkLore').reverse()[0] - t.equal(a_sig.signal_name, 'FolkLore') - t.equal(b_sig.signal_name, 'FolkLore') - t.deepEqual(a_sig.signal_payload, JSON.stringify({ - participants: { - [alice_pubkey]: { - pubKey: alice_pubkey_base64 - }, - [bob_pubkey]: { - pubKey: bob_pubkey_base64 - }, - } - })) - t.deepEqual(b_sig.signal_payload, JSON.stringify({ - participants: { - [alice_pubkey]: { - pubKey: alice_pubkey_base64 - }, - [bob_pubkey]: { - pubKey: bob_pubkey_base64 - }, - } - })) - - let me_SyncReq_length = filter_signal_name(me_signals.$, 'SyncReq').length - // alice asks for a sync request - await rpc_send_sync_request_b(alice_ctx)(me_pubkey) - await subscribe_wait_timeout( - me_signals, - $signals=>filter_signal_name($signals, 'SyncReq').length > me_SyncReq_length, - 10_000 - ) - me_sig = filter_signal_name(me_signals.$, 'SyncReq').reverse()[0] - t.equal(me_sig.signal_name, 'SyncReq') - - // confirm that all agents got added to the folks anchor - // TODO figure out why init doesn't happen immediately. - let folks = await rpc_get_folks_b(me_ctx)() - t.equal(folks.length, 3) - } finally { - await leave_session({ ctx: me_ctx }) - await leave_session({ ctx: alice_ctx }) - await leave_session({ ctx: bob_ctx }) - } - /**/ - }) + /**/ + }) } function filter_signal_name(signals:Signal[], signal_name:string) { - return signals.filter(s=>s.signal_name === signal_name) + return signals.filter(s=>s.signal_name === signal_name) } diff --git a/ui/apps/app/src/Syn.svelte b/ui/apps/app/src/Syn.svelte index 5d00a182..32aace3a 100644 --- a/ui/apps/app/src/Syn.svelte +++ b/ui/apps/app/src/Syn.svelte @@ -59,7 +59,7 @@ cursor: pointer; } </style> -<button class:noscribe on:click={commit_change}>Commit</button> +<button class:noscribe on:click={evt=>commit_change()}>Commit</button> <div> <h4>Holochain Connection:</h4> diff --git a/ui/libs/model/src/delta/commit_change_b.ts b/ui/libs/model/src/delta/commit_change_b.ts index e4b6f4d1..4ad9d560 100644 --- a/ui/libs/model/src/delta/commit_change_b.ts +++ b/ui/libs/model/src/delta/commit_change_b.ts @@ -1,6 +1,6 @@ import { _b, assign } from '@ctx-core/object' import { Commit, rpc_commit_b, rpc_hash_content_b } from '@syn-ui/zome-client' -import { bufferToBase64, EntryHash, HeaderHash } from '@syn-ui/utils' +import { bufferToBase64, console_b } from '@syn-ui/utils' import { content_b } from '../content' import { am_i_scribe_b, commit_in_progress_b, content_hash_b, @@ -11,6 +11,7 @@ import { recorded_changes_b } from './recorded_changes_b' import { _scribe_signal_folk_pubKey_a1_b } from './_scribe_signal_folk_pubKey_a1_b' import { committed_changes_b } from './committed_changes_b' export const commit_change_b = _b('commit_change', (ctx)=>{ + const console = console_b(ctx) const recorded_changes = recorded_changes_b(ctx) const commit_in_progress = commit_in_progress_b(ctx) const rpc_hash_content = rpc_hash_content_b(ctx) @@ -24,56 +25,62 @@ export const commit_change_b = _b('commit_change', (ctx)=>{ const current_commit_header_hash = current_commit_header_hash_b(ctx) const committed_changes = committed_changes_b(ctx) const session_info = session_info_b(ctx) + const am_i_scribe = am_i_scribe_b(ctx) return async function commit_change() { - const am_i_scribe = am_i_scribe_b(ctx) if (am_i_scribe.$ === true) { - const $recorded_changes = recorded_changes.$ - if ($recorded_changes.length == 0) { - alert('No changes to commit!') - return + await try_commit() + } else { + alert(`You ain't the scribe!`) + } + } + async function try_commit() { + const $recorded_changes = recorded_changes.$ + if ($recorded_changes.length == 0) { + alert('No changes to commit!') + return + } + commit_in_progress.$ = true + try { + const new_content_hash = await rpc_hash_content(content.$) + console.log('committing from snapshot', snapshot_hash_str.$) + console.log(' prev_hash:', content_hash_str.$) + console.log(' new_hash:', bufferToBase64(new_content_hash)) + const commit:Commit = { + snapshot: snapshot_hash.$!, + change: { + deltas: $recorded_changes.map(c=>JSON.stringify(c.delta)), + content_hash: new_content_hash, + previous_change: content_hash.$!, + meta: { + contributors: [], + witnesses: [], + app_specific: null + } + }, + participants: _scribe_signal_folk_pubKey_a1() } - commit_in_progress.$ = true try { - const new_content_hash = await rpc_hash_content(content.$) - console.log('committing from snapshot', snapshot_hash_str.$) - console.log(' prev_hash:', content_hash_str.$) - console.log(' new_hash:', bufferToBase64(new_content_hash)) - const commit:Commit = { - snapshot: snapshot_hash.$ as HeaderHash, - change: { - deltas: $recorded_changes.map(c=>JSON.stringify(c.delta)), - content_hash: new_content_hash, - previous_change: content_hash.$ as EntryHash, - meta: { - contributors: [], - witnesses: [], - app_specific: null - } - }, - participants: _scribe_signal_folk_pubKey_a1() - } - try { - const $current_commit_header_hash = await rpc_commit(commit) - current_commit_header_hash.$ = $current_commit_header_hash - // if commit successfull we need to update the content hash and its string in the session - session_info.update($session_info=> - assign($session_info, { - content_hash: new_content_hash - }) - ) - committed_changes.update($committed_changes=>{ - $committed_changes.push(...$recorded_changes) - return $committed_changes + console.debug('try_rpc_commit|debug|1', { + commit, + }) + const $current_commit_header_hash = await rpc_commit(commit) + current_commit_header_hash.$ = $current_commit_header_hash + // if commit successful we need to update the content hash and its string in the session + session_info.update($session_info=> + assign($session_info, { + content_hash: new_content_hash }) - recorded_changes.$ = [] - } catch (e) { - console.log('Error:', e) - } - } finally { - commit_in_progress.$ = false + ) + committed_changes.update($committed_changes=>{ + $committed_changes.push(...$recorded_changes) + return $committed_changes + }) + recorded_changes.$ = [] + } catch (e) { + console.log('Error:', e) } - } else { - alert(`You ain't the scribe!`) + } finally { + commit_in_progress.$ = false } } }) diff --git a/ui/libs/model/src/delta/record_deltas_b.ts b/ui/libs/model/src/delta/record_deltas_b.ts index 97316328..28d5c1ff 100644 --- a/ui/libs/model/src/delta/record_deltas_b.ts +++ b/ui/libs/model/src/delta/record_deltas_b.ts @@ -1,10 +1,12 @@ import { _b } from '@ctx-core/object' import type { Delta } from '@syn-ui/zome-client' +import { console_b } from '@syn-ui/utils' import { requested_changes_b } from './requested_changes_b' import { recorded_changes_b } from './recorded_changes_b' import type { ApplyDelta } from './ApplyDelta' import { apply_deltas_b } from './apply_deltas_b' export const record_deltas_b = _b('record_deltas', (ctx)=>{ + const console = console_b(ctx) const requested_changes = requested_changes_b(ctx) const apply_deltas = apply_deltas_b(ctx) const recorded_changes = recorded_changes_b(ctx) diff --git a/ui/libs/model/src/delta/request_change_b.ts b/ui/libs/model/src/delta/request_change_b.ts index a36180ed..b659251f 100644 --- a/ui/libs/model/src/delta/request_change_b.ts +++ b/ui/libs/model/src/delta/request_change_b.ts @@ -1,5 +1,6 @@ import { _b } from '@ctx-core/object' import { Delta, my_tag_b, rpc_send_change_request_b } from '@syn-ui/zome-client' +import { console_b } from '@syn-ui/utils' import { am_i_scribe_b, scribe_b } from '../session' import { next_index_b } from './next_index_b' import { send_change_b } from './send_change_b' @@ -7,6 +8,7 @@ import { requested_changes_b } from './requested_changes_b' import { apply_deltas_b } from './apply_deltas_b' import { record_deltas_b } from './record_deltas_b' export const request_change_b = _b('request_change', (ctx)=>{ + const console = console_b(ctx) const record_deltas = record_deltas_b(ctx) const request_changes = requested_changes_b(ctx) let request_counter = 0 diff --git a/ui/libs/model/src/session/sessions_b.ts b/ui/libs/model/src/session/sessions_b.ts index c1405310..f3d42f00 100644 --- a/ui/libs/model/src/session/sessions_b.ts +++ b/ui/libs/model/src/session/sessions_b.ts @@ -1,9 +1,10 @@ import { _b, assign } from '@ctx-core/object' import { _readable_set_ctx$, Writable$ } from '@ctx-core/store' import { rpc_get_sessions_b, SessionInfo } from '@syn-ui/zome-client' -import type { EntryHash } from '@syn-ui/utils' +import { console_b, EntryHash } from '@syn-ui/utils' import { session_info_b } from './session_info_b' export const sessions_b = _b('sessions', (ctx)=>{ + const console = console_b(ctx) const { store: sessions, set } = _readable_set_ctx$<EntryHash[]|null>(null) const { store: busy, set: set_busy } = _readable_set_ctx$<boolean>(false) const out_sessions = sessions as sessions_T @@ -21,7 +22,11 @@ export const sessions_b = _b('sessions', (ctx)=>{ set_busy(true) try { const rpc_get_sessions = rpc_get_sessions_b(ctx) - set(await rpc_get_sessions()) + const $session_info = await rpc_get_sessions() + console.debug('sessions|load|debug|1', { + $session_info + }) + set($session_info) } finally { set_busy(false) } diff --git a/ui/libs/model/src/signals/ChangeReq_SignalOps_b.ts b/ui/libs/model/src/signals/ChangeReq_SignalOps_b.ts index 16712cef..8ba726cd 100644 --- a/ui/libs/model/src/signals/ChangeReq_SignalOps_b.ts +++ b/ui/libs/model/src/signals/ChangeReq_SignalOps_b.ts @@ -1,9 +1,11 @@ import { _b } from '@ctx-core/object' import type { Delta } from '@syn-ui/zome-client' +import { console_b } from '@syn-ui/utils' import { next_index_b, record_deltas_b, send_change_b } from '../delta' import { am_i_scribe_b } from '../session' import type { SignalOps } from './SignalOps' export const ChangeReq_SignalOps_b = _b<SignalOps>('ChangeReq_SignalOps', (ctx)=>{ + const console = console_b(ctx) const am_i_scribe = am_i_scribe_b(ctx) const next_index = next_index_b(ctx) const send_change = send_change_b(ctx) diff --git a/ui/libs/model/src/signals/Change_SignalOps_b.ts b/ui/libs/model/src/signals/Change_SignalOps_b.ts index 56c39f12..a4b727e9 100644 --- a/ui/libs/model/src/signals/Change_SignalOps_b.ts +++ b/ui/libs/model/src/signals/Change_SignalOps_b.ts @@ -1,9 +1,11 @@ import type { AppSignal } from '@holochain/conductor-api' import { _b } from '@ctx-core/object' +import { console_b } from '@syn-ui/utils' import { next_index_b, record_deltas_b } from '../delta' import { am_i_scribe_b } from '../session' import type { SignalOps } from './SignalOps' export const Change_SignalOps_b = _b<SignalOps>('Change_SignalOps', (ctx)=>{ + const console = console_b(ctx) const next_index = next_index_b(ctx) return { Change: async (signal:AppSignal)=>{ diff --git a/ui/libs/model/src/signals/CommitNotice_SignalOps_b.ts b/ui/libs/model/src/signals/CommitNotice_SignalOps_b.ts index 5550c2d9..9692f58d 100644 --- a/ui/libs/model/src/signals/CommitNotice_SignalOps_b.ts +++ b/ui/libs/model/src/signals/CommitNotice_SignalOps_b.ts @@ -1,9 +1,10 @@ import { _b } from '@ctx-core/object' -import { bufferToBase64, EntryHash, HeaderHash } from '@syn-ui/utils' +import { bufferToBase64, console_b, EntryHash, HeaderHash } from '@syn-ui/utils' import { committed_changes_b, next_index_b, recorded_changes_b } from '../delta' import { content_hash_b, content_hash_str_b } from '../session' import type { SignalOps } from './SignalOps' export const CommitNotice_SignalOps_b = _b<SignalOps>('CommitNotice_SignalOps', (ctx)=>{ + const console = console_b(ctx) const content_hash = content_hash_b(ctx) const content_hash_str = content_hash_str_b(ctx) const next_index = next_index_b(ctx) diff --git a/ui/libs/model/src/signals/FolkLore_SignalOps_b.ts b/ui/libs/model/src/signals/FolkLore_SignalOps_b.ts index f66c3e58..138d2e5c 100644 --- a/ui/libs/model/src/signals/FolkLore_SignalOps_b.ts +++ b/ui/libs/model/src/signals/FolkLore_SignalOps_b.ts @@ -1,8 +1,10 @@ import { _b } from '@ctx-core/object' import { decodeJson, FOLK_GONE, FOLK_UNKNOWN } from '@syn-ui/zome-client' +import { console_b } from '@syn-ui/utils' import { am_i_scribe_b, update_folks_b } from '../session' import type { SignalOps } from './SignalOps' export const FolkLore_SignalOps_b = _b<SignalOps>('FolkLore_SignalOps', (ctx)=>{ + const console = console_b(ctx) const am_i_scribe = am_i_scribe_b(ctx) const update_folks = update_folks_b(ctx) return { diff --git a/ui/libs/model/src/signals/Heartbeat_SignalOps_b.ts b/ui/libs/model/src/signals/Heartbeat_SignalOps_b.ts index 09676695..3ed540ea 100644 --- a/ui/libs/model/src/signals/Heartbeat_SignalOps_b.ts +++ b/ui/libs/model/src/signals/Heartbeat_SignalOps_b.ts @@ -1,8 +1,10 @@ import { _b } from '@ctx-core/object' import { FOLK_SEEN } from '@syn-ui/zome-client' +import { console_b } from '@syn-ui/utils' import { am_i_scribe_b, update_folks_b } from '../session' import type { SignalOps } from './SignalOps' export const Heartbeat_SignalOps_b = _b<SignalOps>('Heartbeat_SignalOps', (ctx)=>{ + const console = console_b(ctx) const am_i_scribe = am_i_scribe_b(ctx) const update_folks = update_folks_b(ctx) return { diff --git a/ui/libs/model/src/signals/SyncReq_SignalOps_b.ts b/ui/libs/model/src/signals/SyncReq_SignalOps_b.ts index f7d21be1..fa630697 100644 --- a/ui/libs/model/src/signals/SyncReq_SignalOps_b.ts +++ b/ui/libs/model/src/signals/SyncReq_SignalOps_b.ts @@ -3,7 +3,7 @@ import { _b } from '@ctx-core/object' import { agent_pub_key_b, FOLK_SEEN, me_b, rpc_send_folk_lore_b, rpc_send_sync_response_b, StateForSync } from '@syn-ui/zome-client' -import type { EntryHash } from '@syn-ui/utils' +import { console_b, EntryHash } from '@syn-ui/utils' import { _scribe_signal_folk_pubKey_a1_b, recorded_changes_b } from '../delta' import { am_i_scribe_b, content_hash_b, current_commit_header_hash_b, folks_b, @@ -11,6 +11,7 @@ import { } from '../session' import type { SignalOps } from './SignalOps' export const SyncReq_SignalOps_b = _b<SignalOps>('SyncReq_SignalOps', (ctx)=>{ + const console = console_b(ctx) const me = me_b(ctx) const folks = folks_b(ctx) const update_folks = update_folks_b(ctx) diff --git a/ui/libs/model/src/signals/SyncResp_SignalOps_b.ts b/ui/libs/model/src/signals/SyncResp_SignalOps_b.ts index 463581df..19a1688e 100644 --- a/ui/libs/model/src/signals/SyncResp_SignalOps_b.ts +++ b/ui/libs/model/src/signals/SyncResp_SignalOps_b.ts @@ -1,12 +1,13 @@ import type { HoloHash } from '@holochain/conductor-api' import { _b, assign } from '@ctx-core/object' import type { Delta } from '@syn-ui/zome-client' -import { bufferToBase64 } from '@syn-ui/utils' +import { bufferToBase64, console_b } from '@syn-ui/utils' import type { SerializedStateForSync, StateForSync } from '../delta' import { record_deltas_b } from '../delta' import { content_hash_str_b } from '../session' import type { SignalOps } from './SignalOps' export const SyncResp_SignalOps_b = _b<SignalOps>('SyncResp_SignalOps', (ctx)=>{ + const console = console_b(ctx) const content_hash_str = content_hash_str_b(ctx) const record_deltas = record_deltas_b(ctx) return { diff --git a/ui/libs/model/src/signals/app_ws_cb_b.ts b/ui/libs/model/src/signals/app_ws_cb_b.ts index 68f1025a..c7a22229 100644 --- a/ui/libs/model/src/signals/app_ws_cb_b.ts +++ b/ui/libs/model/src/signals/app_ws_cb_b.ts @@ -1,6 +1,6 @@ import type { AppSignal } from '@holochain/conductor-api' import { _b, clone } from '@ctx-core/object' -import { bufferToBase64 } from '@syn-ui/utils' +import { bufferToBase64, console_b } from '@syn-ui/utils' import { me_b } from '@syn-ui/zome-client' import { Change_SignalOps_b, ChangeReq_SignalOps_b, CommitNotice_SignalOps_b, @@ -8,6 +8,7 @@ import { SignalOps, SyncReq_SignalOps_b, SyncResp_SignalOps_b } from '../signals' export const app_ws_cb_b = _b('app_ws_cb', (ctx)=>{ + const console = console_b(ctx) const me = me_b(ctx) const signal_ops:SignalOps = clone( Change_SignalOps_b(ctx), diff --git a/ui/libs/model/src/timers/request_checker_timer_b.ts b/ui/libs/model/src/timers/request_checker_timer_b.ts index f7f1e6fb..964b4c3a 100644 --- a/ui/libs/model/src/timers/request_checker_timer_b.ts +++ b/ui/libs/model/src/timers/request_checker_timer_b.ts @@ -1,10 +1,12 @@ import { _b } from '@ctx-core/object' import { rpc_send_sync_request_b } from '@syn-ui/zome-client' +import { console_b } from '@syn-ui/utils' import { requested_changes_b } from '../delta' import { session_info_b } from '../session' import { Timer } from './Timer' const request_timeout = 1000 export const request_checker_timer_b = _b('request_checker_timer', (ctx)=>{ + const console = console_b(ctx) const requested_changes = requested_changes_b(ctx) const session_info = session_info_b(ctx) const rpc_send_sync_request = rpc_send_sync_request_b(ctx) diff --git a/ui/libs/utils/src/console_b.ts b/ui/libs/utils/src/console_b.ts new file mode 100644 index 00000000..8dbc225d --- /dev/null +++ b/ui/libs/utils/src/console_b.ts @@ -0,0 +1,13 @@ +import { _b } from '@ctx-core/object' +const in_console = console +export const console_b = _b('console', () => { + const console = { + debug: in_console.debug, + info: in_console.info, + log: in_console.log, + warn: in_console.warn, + error: in_console.error, + trace: in_console.trace, + } + return console +}) diff --git a/ui/libs/utils/src/index.ts b/ui/libs/utils/src/index.ts index 421e3d14..0b2333b1 100644 --- a/ui/libs/utils/src/index.ts +++ b/ui/libs/utils/src/index.ts @@ -1,4 +1,5 @@ export * from './base64ToBuffer' export * from './bufferToBase64' +export * from './console_b' export * from './EntryHash' export * from './HeaderHash' diff --git a/ui/libs/zome-client/src/decodeJson.ts b/ui/libs/zome-client/src/decodeJson.ts index 4b3fd44e..d97f3031 100644 --- a/ui/libs/zome-client/src/decodeJson.ts +++ b/ui/libs/zome-client/src/decodeJson.ts @@ -8,7 +8,7 @@ export function decodeJson(jsonStr:string):ApiResponse { return base64ToBuffer(value) } } catch (e) { - console.log('decodeJson Error:', e) + console.warn('decodeJson Error:', e) } // if flag not found no conversion is done diff --git a/ui/libs/zome-client/src/rpc_b.ts b/ui/libs/zome-client/src/rpc_b.ts index 01161ce1..0c25a9d7 100644 --- a/ui/libs/zome-client/src/rpc_b.ts +++ b/ui/libs/zome-client/src/rpc_b.ts @@ -2,11 +2,13 @@ import type { AppWebsocket } from '@holochain/conductor-api' import { _b } from '@ctx-core/object' import { I } from '@ctx-core/combinators' import { subscribe_wait_timeout } from '@ctx-core/store' +import { console_b } from '@syn-ui/utils' import { app_ws_b } from './app_ws_b' import { cell_id_b } from './cell_id_b' import { agent_pub_key_b } from './agent_pub_key_b' import { appInfo_b } from './appInfo_b' export const rpc_b = _b('rpc', (ctx)=>{ + const console = console_b(ctx) const app_ws = app_ws_b(ctx) const cell_id = cell_id_b(ctx) const agent_pub_key = agent_pub_key_b(ctx) diff --git a/zomes/syn/src/lib.rs b/zomes/syn/src/lib.rs index 40c250f5..dd601874 100644 --- a/zomes/syn/src/lib.rs +++ b/zomes/syn/src/lib.rs @@ -274,6 +274,7 @@ pub fn get_sessions(_: ()) -> ExternResult<SessionList> { let path = get_sessions_path(); let links = get_links(path.hash()?, None)?.into_inner(); let sessions = links.into_iter().map(|l| l.target).collect(); + debug!("get_sessions: sessions: {:?}", sessions); Ok(SessionList(sessions)) } From add618804f11bb15e1b5961853fedb0eeefc6543 Mon Sep 17 00:00:00 2001 From: Brian Takita <brian.takita@gmail.com> Date: Sat, 1 May 2021 12:53:34 -0400 Subject: [PATCH 24/33] @syn-ui/tests: + waitfor_filtered_signals_change --- tests/unit-test/syn.ts | 197 ++++++++++++++++++++--------------------- 1 file changed, 98 insertions(+), 99 deletions(-) diff --git a/tests/unit-test/syn.ts b/tests/unit-test/syn.ts index 5915e434..011d2e27 100644 --- a/tests/unit-test/syn.ts +++ b/tests/unit-test/syn.ts @@ -1,17 +1,17 @@ import path from 'path' import { Config, InstallAgentsHapps } from '@holochain/tryorama' import { delay } from '@holochain/tryorama/lib/util' -import { _neq } from '@ctx-core/function' +import { noop } from '@ctx-core/function' +import { assign } from '@ctx-core/object' import { I } from '@ctx-core/combinators' -import { derived$, subscribe_wait_timeout, writable$ } from '@ctx-core/store' -import { bufferToBase64, EntryHash } from '@syn-ui/utils' +import { Readable$, subscribe_wait_timeout, writable$ } from '@ctx-core/store' +import { bufferToBase64, console_b, EntryHash } from '@syn-ui/utils' import { content_b, apply_deltas_b, session_info_b, join_session, leave_session } from '@syn-ui/model' import { Commit, Content, Delta, my_tag_b, rpc_commit_b, rpc_get_content_b, rpc_get_folks_b, rpc_get_session_b, rpc_get_sessions_b, rpc_hash_content_b, rpc_send_change_b, rpc_send_change_request_b, rpc_send_folk_lore_b, rpc_send_heartbeat_b, rpc_send_sync_request_b, rpc_send_sync_response_b, Signal, StateForSync } from '@syn-ui/zome-client' -import { AgentPubKey } from '@holochain/conductor-api' const config = Config.gen() @@ -58,6 +58,11 @@ module.exports = (orchestrator)=>{ const bob_port:number = parseInt(bob_player._conductor.appClient.client.socket.url.split(':')[2]) const me_ctx = {}, alice_ctx = {}, bob_ctx = {} + // To enable logs, remove log: noop + const console_overrides = { log: noop } + assign(console_b(me_ctx), console_overrides) + assign(console_b(alice_ctx), console_overrides) + assign(console_b(bob_ctx), console_overrides) await join_session({ app_port: me_port, app_id: me_happ.hAppId, ctx: me_ctx }) await join_session({ app_port: alice_port, app_id: alice_happ.hAppId, ctx: alice_ctx }) await join_session({ app_port: bob_port, app_id: bob_happ.hAppId, ctx: bob_ctx }) @@ -99,10 +104,8 @@ module.exports = (orchestrator)=>{ // set signal handlers so we can confirm they get sent and received appropriately let me_signals = writable$<Signal[]>([]) - const me_signals_length = derived$(me_signals, $me_signals=>$me_signals?.length) - let $me_signals_length = me_signals_length.$ me_player.setSignalHandler((signal)=>{ - console.log('Received Signal for me:', signal) + console_b(me_ctx).log('Received Signal for me:', signal) me_signals.update($me_signals=>{ $me_signals.push(signal.data.payload) return $me_signals @@ -111,10 +114,8 @@ module.exports = (orchestrator)=>{ // alice signal handler const alice_signals = writable$<Signal[]>([]) - const alice_signals_length = derived$(alice_signals, $alice_signals=>$alice_signals?.length) - let $alice_signals_length = alice_signals_length.$ alice_player.setSignalHandler((signal)=>{ - console.log('Received Signal for alice:', signal) + console_b(alice_ctx).log('Received Signal for alice:', signal) alice_signals.update($alice_signals=>{ $alice_signals.push(signal.data.payload) return $alice_signals @@ -123,10 +124,8 @@ module.exports = (orchestrator)=>{ // bob signal handler const bob_signals = writable$<Signal[]>([]) - const bob_signals_length = derived$(bob_signals, $bob_signals=>$bob_signals?.length) - let $bob_signals_length = bob_signals_length.$ bob_player.setSignalHandler((signal)=>{ - console.log('Received Signal for bob:', signal) + console_b(bob_ctx).log('Received Signal for bob:', signal) bob_signals.update($bob_signals=>{ $bob_signals.push(signal.data.payload) return $bob_signals @@ -195,6 +194,9 @@ module.exports = (orchestrator)=>{ // check that deltas and snapshot content returned add up to the current real content await delay(500) // make time for integrating new data const received_deltas:Delta[] = (jsonDeltas ? alice_session_info.$!.deltas.map(d=>JSON.parse(d)) : alice_session_info.$!.deltas) as Delta[] + console.debug('debug|1', { + received_deltas + }) await apply_deltas_b(alice_ctx)(received_deltas) t.deepEqual( me_content.$, @@ -220,17 +222,18 @@ module.exports = (orchestrator)=>{ commit_content_hash: new_content_hash_2, deltas: pending_deltas, } - $alice_signals_length = alice_signals_length.$ - await rpc_send_sync_response_b(me_ctx)({ - participant: alice_pubkey, - state, - }) - await subscribe_wait_timeout(alice_signals_length, _neq($alice_signals_length), 10_000) - $alice_signals_length = alice_signals_length.$ + let [alice_SyncResp_stack] = await waitfor_filtered_signals_change(async ()=> + rpc_send_sync_response_b(me_ctx)({ + participant: alice_pubkey, + state, + }), + [alice_signals], + $alice_signals=>filter_signal_name($alice_signals, 'SyncResp') + ) // Alice should have received uncommitted deltas - t.equal(alice_signals.$[$alice_signals_length - 1].signal_name, 'SyncResp') - let receivedState = alice_signals.$[$alice_signals_length - 1].signal_payload + t.equal(alice_SyncResp_stack[0].signal_name, 'SyncResp') + let receivedState = alice_SyncResp_stack[0].signal_payload t.deepEqual(receivedState, { ...state, deltas: pending_deltas.map(d=>JSON.stringify(d)) }) // deltas, commit, and snapshot match // bob joins session @@ -244,92 +247,73 @@ module.exports = (orchestrator)=>{ const alice_delta:Delta = { type: 'Title', value: 'Alice in Wonderland' } let delta = jsonDeltas ? JSON.stringify(alice_delta) : alice_delta - let me_ChangeReq_signals_length = filter_signal_name(me_signals.$, 'ChangeReq').length - $me_signals_length = me_signals_length.$ - await rpc_send_change_request_b(alice_ctx)({ - scribe: alice_session_info.$!.scribe, - index: 1, - deltas: [alice_delta] - }) - await subscribe_wait_timeout( - me_signals, + const [me_ChangeReq_stack] = await waitfor_filtered_signals_change(async ()=> + rpc_send_change_request_b(alice_ctx)({ + scribe: alice_session_info.$!.scribe, + index: 1, + deltas: [alice_delta] + }), + [me_signals], $me_signals=> - filter_signal_name($me_signals, 'ChangeReq').length > me_ChangeReq_signals_length, - 10_000) - const sig = filter_signal_name(me_signals.$, 'ChangeReq').reverse()[0] - t.deepEqual(sig.signal_name, 'ChangeReq') - const [sig_index, sig_delta] = sig.signal_payload + filter_signal_name($me_signals, 'ChangeReq') + ) + t.deepEqual(me_ChangeReq_stack[0].signal_name, 'ChangeReq') + const [sig_index, sig_delta] = me_ChangeReq_stack[0].signal_payload t.equal(sig_index, 1) const receiveDelta = jsonDeltas ? JSON.parse(sig_delta) : sig_delta t.deepEqual(receiveDelta, alice_delta) // delta_matches let my_deltas:Delta[] = [{ type: 'Add', value: [0, 'Whoops!\n'] }, { type: 'Title', value: 'Alice in Wonderland' }] deltas = jsonDeltas ? my_deltas.map(d=>JSON.stringify(d)) : deltas - let alice_Change_signals_length = filter_signal_name(alice_signals.$, 'Change').length - let bob_Change_signals_length = filter_signal_name(bob_signals.$, 'Change').length // I send a change, and alice and bob should receive it. - await rpc_send_change_b(me_ctx)({ - participants: [alice_pubkey, bob_pubkey], - index: 2, - deltas: my_deltas, - }) - await subscribe_wait_timeout( - alice_signals, - $alice_signals=>filter_signal_name($alice_signals, 'Change').length > alice_Change_signals_length, - 10_000) - await subscribe_wait_timeout( - bob_signals, - $bob_signals=>filter_signal_name($bob_signals, 'Change').length > bob_Change_signals_length, - 10_000) - let a_sig = filter_signal_name(alice_signals.$, 'Change').reverse()[0] - let b_sig = filter_signal_name(bob_signals.$, 'Change').reverse()[0] + const [alice_Change_stack, bob_Change_stack] = await waitfor_filtered_signals_change(async ()=> + rpc_send_change_b(me_ctx)({ + participants: [alice_pubkey, bob_pubkey], + index: 2, + deltas: my_deltas, + }), + [alice_signals, bob_signals], + $signals=>filter_signal_name($signals, 'Change') + ) + let a_sig = alice_Change_stack[0] + let b_sig = bob_Change_stack[0] t.equal(a_sig.signal_name, 'Change') t.equal(b_sig.signal_name, 'Change') t.deepEqual(a_sig.signal_payload, [2, deltas]) // delta_matches t.deepEqual(b_sig.signal_payload, [2, deltas]) // delta_matches - let me_Hearbeat_signal_length = filter_signal_name(me_signals.$, 'Heartbeat').length - await rpc_send_heartbeat_b(alice_ctx)({ - scribe: me_pubkey, - data: 'Hello' - }) - await subscribe_wait_timeout( - me_signals, - $me_signals=>filter_signal_name($me_signals, 'Heartbeat').length > me_Hearbeat_signal_length, - 10_000 + const [me_Heartbeat] = await waitfor_filtered_signals_change(async ()=> + rpc_send_heartbeat_b(alice_ctx)({ + scribe: me_pubkey, + data: 'Hello' + }), + [me_signals], + $signals=>filter_signal_name($signals, 'Heartbeat') ) - let me_sig = filter_signal_name(me_signals.$, 'Heartbeat').reverse()[0] + let me_sig = me_Heartbeat[0] t.equal(me_sig.signal_name, 'Heartbeat') t.deepEqual(me_sig.signal_payload[1], 'Hello') t.deepEqual(me_sig.signal_payload[0], alice_pubkey) - let alice_FolkLore_length = filter_signal_name(alice_signals.$, 'FolkLore').length - let bob_FolkLore_length = filter_signal_name(bob_signals.$, 'FolkLore').length - await rpc_send_folk_lore_b(me_ctx)({ - participants: [alice_pubkey, bob_pubkey], - data: { - participants: { - [alice_pubkey]: { - pubKey: alice_pubkey - }, - [bob_pubkey]: { - pubKey: bob_pubkey - }, - } - } - }) - await subscribe_wait_timeout( - alice_signals, - $signals=>filter_signal_name($signals, 'FolkLore').length > alice_FolkLore_length, - 10_000 - ) - await subscribe_wait_timeout( - bob_signals, - $signals=>filter_signal_name($signals, 'FolkLore').length > bob_FolkLore_length, - 10_000 + const [alice_FolkLore, bob_FolkLore] = await waitfor_filtered_signals_change(async ()=> + rpc_send_folk_lore_b(me_ctx)({ + participants: [alice_pubkey, bob_pubkey], + data: { + participants: { + [alice_pubkey]: { + pubKey: alice_pubkey + }, + [bob_pubkey]: { + pubKey: bob_pubkey + }, + } + } + }), + [alice_signals, bob_signals], + $signals=>filter_signal_name($signals, 'FolkLore') ) - a_sig = filter_signal_name(alice_signals.$, 'FolkLore').reverse()[0] - b_sig = filter_signal_name(bob_signals.$, 'FolkLore').reverse()[0] + a_sig = alice_FolkLore[0] + b_sig = bob_FolkLore[0] t.equal(a_sig.signal_name, 'FolkLore') t.equal(b_sig.signal_name, 'FolkLore') t.deepEqual(a_sig.signal_payload, JSON.stringify({ @@ -353,29 +337,44 @@ module.exports = (orchestrator)=>{ } })) - let me_SyncReq_length = filter_signal_name(me_signals.$, 'SyncReq').length // alice asks for a sync request - await rpc_send_sync_request_b(alice_ctx)(me_pubkey) - await subscribe_wait_timeout( - me_signals, - $signals=>filter_signal_name($signals, 'SyncReq').length > me_SyncReq_length, - 10_000 + const [me_SyncReq] = await waitfor_filtered_signals_change(async()=> + rpc_send_sync_request_b(alice_ctx)(me_pubkey), + [me_signals], + $signals=>filter_signal_name($signals, 'SyncReq') ) - me_sig = filter_signal_name(me_signals.$, 'SyncReq').reverse()[0] + me_sig = me_SyncReq[0] t.equal(me_sig.signal_name, 'SyncReq') // confirm that all agents got added to the folks anchor // TODO figure out why init doesn't happen immediately. let folks = await rpc_get_folks_b(me_ctx)() t.equal(folks.length, 3) + /**/ } finally { await leave_session({ ctx: me_ctx }) await leave_session({ ctx: alice_ctx }) await leave_session({ ctx: bob_ctx }) } - /**/ }) } -function filter_signal_name(signals:Signal[], signal_name:string) { - return signals.filter(s=>s.signal_name === signal_name) +function filter_signal_name($signals:Signal[], signal_name:string) { + return $signals.filter(s=>s.signal_name === signal_name) +} +async function waitfor_filtered_signals_change( + fn:()=>Promise<void>, + signals_a1:Readable$<Signal[]>[], + _filtered_signals:($signals:Signal[])=>Signal[], + timeout = 1000 +) { + const filtered_signals_a1 = signals_a1.map(signals=>_filtered_signals(signals.$)) + await fn() + await Promise.all(signals_a1.map((signals, idx)=> + subscribe_wait_timeout(signals, + $signals=>{ + return _filtered_signals($signals).length > filtered_signals_a1[idx].length + } + , timeout) + )) + return signals_a1.map(signals=>_filtered_signals(signals.$).reverse()) } From 77c8a487b09357986616a9750a586b3d359b0634 Mon Sep 17 00:00:00 2001 From: Brian Takita <brian.takita@gmail.com> Date: Sat, 1 May 2021 22:37:42 -0400 Subject: [PATCH 25/33] fix: Connect;change text;Commit;refresh;Connect: deltas are applied additional tests --- tests/syn-lib/syn-lib.ts | 6 +- tests/unit-test/syn.ts | 158 +++++++++++------- ui/apps/app/src/App.svelte | 6 +- ui/apps/app/src/Debug.svelte | 6 +- ui/apps/app/src/Folk.svelte | 6 +- ui/apps/app/src/Syn.svelte | 6 +- ui/libs/model/src/actions/join_session.ts | 11 +- ui/libs/model/src/actions/leave_session.ts | 5 +- ui/libs/model/src/content/content_b.ts | 5 +- .../delta/_scribe_signal_folk_pubKey_a1_b.ts | 3 +- ui/libs/model/src/delta/apply_deltas_b.ts | 38 ++--- ui/libs/model/src/delta/commit_change_b.ts | 25 +-- ui/libs/model/src/delta/index.ts | 2 - ui/libs/model/src/delta/record_deltas_b.ts | 8 +- ui/libs/model/src/delta/recorded_changes_b.ts | 9 +- ui/libs/model/src/delta/request_change_b.ts | 6 +- ui/libs/model/src/session/am_i_scribe_b.ts | 8 +- ui/libs/model/src/session/folks_b.ts | 2 +- ui/libs/model/src/session/index.ts | 14 +- ui/libs/model/src/session/scribe_b.ts | 10 -- ui/libs/model/src/session/scribe_str_b.ts | 10 -- ui/libs/model/src/session/session_info_b.ts | 4 +- .../session_info_deltas_b.ts} | 2 +- ...{session_b.ts => session_info_scribe_b.ts} | 6 +- .../src/session/session_info_scribe_str_b.ts | 10 ++ ...str_b.ts => session_info_session_str_b.ts} | 6 +- .../session_info_snapshot_content_b.ts} | 2 +- ...h_b.ts => session_info_snapshot_hash_b.ts} | 2 +- .../session_info_snapshot_hash_str_b.ts | 10 ++ ui/libs/model/src/session/sessions_b.ts | 14 +- .../model/src/session/snapshot_hash_str_b.ts | 10 -- .../model/src/signals/SyncReq_SignalOps_b.ts | 10 +- .../model/src/signals/SyncResp_SignalOps_b.ts | 2 +- .../src/timers/request_checker_timer_b.ts | 1 - .../src/timers/scribe_heartbeat_timer_b.ts | 6 +- 35 files changed, 220 insertions(+), 209 deletions(-) delete mode 100644 ui/libs/model/src/session/scribe_b.ts delete mode 100644 ui/libs/model/src/session/scribe_str_b.ts rename ui/libs/model/src/{delta/deltas_b.ts => session/session_info_deltas_b.ts} (85%) rename ui/libs/model/src/session/{session_b.ts => session_info_scribe_b.ts} (67%) create mode 100644 ui/libs/model/src/session/session_info_scribe_str_b.ts rename ui/libs/model/src/session/{session_str_b.ts => session_info_session_str_b.ts} (54%) rename ui/libs/model/src/{delta/snapshot_content_b.ts => session/session_info_snapshot_content_b.ts} (83%) rename ui/libs/model/src/session/{snapshot_hash_b.ts => session_info_snapshot_hash_b.ts} (74%) create mode 100644 ui/libs/model/src/session/session_info_snapshot_hash_str_b.ts delete mode 100644 ui/libs/model/src/session/snapshot_hash_str_b.ts diff --git a/tests/syn-lib/syn-lib.ts b/tests/syn-lib/syn-lib.ts index e48df543..6a4f101f 100644 --- a/tests/syn-lib/syn-lib.ts +++ b/tests/syn-lib/syn-lib.ts @@ -1,7 +1,7 @@ import path from 'path' import { Config, InstallAgentsHapps } from '@holochain/tryorama' import { Content, me_b, PubKeyToFolkRecord } from '@syn-ui/zome-client' -import { folks_b, join_session, scribe_str_b } from '@syn-ui/model' +import { folks_b, join_session, session_info_scribe_str_b } from '@syn-ui/model' import { delay } from '../common' const config = Config.gen() @@ -60,10 +60,10 @@ export const oFn = (orchestrator)=>{ // await c2.open(default_content, applyDeltas) // await c2.joinSession() const c1_me = me_b(c1) - t.equal(c1_me.$, scribe_str_b(c2).$) + t.equal(c1_me.$, session_info_scribe_str_b(c2).$) const c2_folks = folks_b(c2) while (true) { - const $c2_folks = c2_folks.$ as PubKeyToFolkRecord + const $c2_folks = c2_folks.$! const others = Object.keys($c2_folks) if (others.length > 0) { t.equal($c2_folks[others[0]].pubKey.toString('base64'), c1_me.$) diff --git a/tests/unit-test/syn.ts b/tests/unit-test/syn.ts index 011d2e27..1ac2f321 100644 --- a/tests/unit-test/syn.ts +++ b/tests/unit-test/syn.ts @@ -1,14 +1,13 @@ import path from 'path' import { Config, InstallAgentsHapps } from '@holochain/tryorama' -import { delay } from '@holochain/tryorama/lib/util' import { noop } from '@ctx-core/function' import { assign } from '@ctx-core/object' import { I } from '@ctx-core/combinators' import { Readable$, subscribe_wait_timeout, writable$ } from '@ctx-core/store' import { bufferToBase64, console_b, EntryHash } from '@syn-ui/utils' -import { content_b, apply_deltas_b, session_info_b, join_session, leave_session } from '@syn-ui/model' +import { content_b, apply_deltas_b, session_info_b, join_session, leave_session, content_hash_b } from '@syn-ui/model' import { - Commit, Content, Delta, my_tag_b, rpc_commit_b, rpc_get_content_b, rpc_get_folks_b, rpc_get_session_b, + Commit, Delta, my_tag_b, rpc_commit_b, rpc_get_content_b, rpc_get_folks_b, rpc_get_session_b, rpc_get_sessions_b, rpc_hash_content_b, rpc_send_change_b, rpc_send_change_request_b, rpc_send_folk_lore_b, rpc_send_heartbeat_b, rpc_send_sync_request_b, rpc_send_sync_response_b, Signal, StateForSync } from '@syn-ui/zome-client' @@ -59,13 +58,12 @@ module.exports = (orchestrator)=>{ const me_ctx = {}, alice_ctx = {}, bob_ctx = {} // To enable logs, remove log: noop - const console_overrides = { log: noop } + const show_full_logs = false + const console_overrides = show_full_logs ? {} : { log: noop } assign(console_b(me_ctx), console_overrides) assign(console_b(alice_ctx), console_overrides) assign(console_b(bob_ctx), console_overrides) await join_session({ app_port: me_port, app_id: me_happ.hAppId, ctx: me_ctx }) - await join_session({ app_port: alice_port, app_id: alice_happ.hAppId, ctx: alice_ctx }) - await join_session({ app_port: bob_port, app_id: bob_happ.hAppId, ctx: bob_ctx }) try { await subscribe_wait_timeout(session_info_b(me_ctx), I, 10_000) @@ -90,8 +88,10 @@ module.exports = (orchestrator)=>{ t.deepEqual(session_info_b(me_ctx).$, session_info) // check that initial snapshot was created by using the get_content zome call - let content = await rpc_get_content_b(me_ctx)(session_info_b(me_ctx).$!.content_hash) - t.deepEqual(content, session_info_b(me_ctx).$!.snapshot_content) + t.deepEqual( + session_info_b(me_ctx).$!.snapshot_content, + await rpc_get_content_b(me_ctx)(session_info_b(me_ctx).$!.content_hash) + ) // set up the pending deltas array let pending_deltas:Delta[] = [{ type: 'Title', value: 'foo title' }, { type: 'Add', value: [0, 'bar content'] }] @@ -134,11 +134,11 @@ module.exports = (orchestrator)=>{ // add a content change let commit:Commit = { - snapshot: session_info_b(me_ctx).$!.content_hash as EntryHash, + snapshot: session_info_b(me_ctx).$!.content_hash!, change: { deltas: deltas, content_hash: content_hash, - previous_change: session_info_b(me_ctx).$!.content_hash as EntryHash, // this is the first change so same content_hash as snapshot + previous_change: session_info_b(me_ctx).$!.content_hash!, // this is the first change so same content_hash as snapshot meta: { contributors: [], witnesses: [], @@ -163,7 +163,7 @@ module.exports = (orchestrator)=>{ deltas = jsonDeltas ? pending_deltas.map(d=>JSON.stringify(d)) : pending_deltas commit = { - snapshot: session_info_b(me_ctx).$!.content_hash as EntryHash, + snapshot: session_info_b(me_ctx).$!.content_hash!, change: { deltas, content_hash: new_content_hash_2, @@ -180,36 +180,68 @@ module.exports = (orchestrator)=>{ // clear the pending_deltas pending_deltas = [] + let me_SyncResp_stack:Signal[], alice_SyncResp_stack:Signal[], me_SyncReq_stack:Signal[] + + // check that deltas and snapshot content returned add up to the current real content + ;[alice_SyncResp_stack] = await waitfor_filtered_signals_change(async ()=>{ + [me_SyncReq_stack] = await waitfor_filtered_signals_change(()=> + join_session({ + app_port: alice_port, + app_id: alice_happ.hAppId, + ctx: alice_ctx + }), + // rpc_send_sync_request_b(alice_ctx)(me_pubkey), + [me_signals], + $signals=>filter_signal_name($signals, 'SyncReq') + ) + }, + [alice_signals], + $signals=>filter_signal_name($signals, 'SyncResp') + ) // alice joins session const alice_session_info = session_info_b(alice_ctx) - let alice_session_info_$ = alice_session_info.$ - // alice_session_info.$ = await rpc_get_session_b(alice_ctx)(session_hash) + const alice_content = content_b(alice_ctx) // alice should get my session t.deepEqual(alice_session_info.$!.session, session_hash) t.deepEqual(alice_session_info.$!.scribe, me_pubkey) t.deepEqual(alice_session_info.$!.snapshot_content, { title: '', body: '' }) - - await rpc_send_sync_request_b(alice_ctx)(me_pubkey) - - // check that deltas and snapshot content returned add up to the current real content - await delay(500) // make time for integrating new data - const received_deltas:Delta[] = (jsonDeltas ? alice_session_info.$!.deltas.map(d=>JSON.parse(d)) : alice_session_info.$!.deltas) as Delta[] - console.debug('debug|1', { - received_deltas - }) - await apply_deltas_b(alice_ctx)(received_deltas) t.deepEqual( me_content.$, { title: 'foo title', body: 'baz monkey new', meta: { [my_tag_b(me_ctx).$]: 0 } } // content after two commits ) + t.deepEqual( + alice_content.$, + { title: 'foo title', body: 'baz monkey new', meta: { [my_tag_b(alice_ctx).$]: 0 } } // content after two commits + ) + await leave_session({ ctx: alice_ctx }) + ;[alice_SyncResp_stack] = await waitfor_filtered_signals_change(async ()=>{ + [me_SyncReq_stack] = await waitfor_filtered_signals_change(()=> + join_session({ + app_port: alice_port, + app_id: alice_happ.hAppId, + ctx: alice_ctx + }), + // rpc_send_sync_request_b(alice_ctx)(me_pubkey), + [me_signals], + $signals=>filter_signal_name($signals, 'SyncReq') + ) + }, + [alice_signals], + $signals=>filter_signal_name($signals, 'SyncResp') + ) + t.deepEqual( + alice_content.$, + { title: 'foo title', body: 'baz monkey new', meta: { [my_tag_b(alice_ctx).$]: 0 } } // content after two commits + ) // confirm that the session_info_b(me_ctx)'s content content_hash matches the content_hash // generated by applying deltas - content_hash = await rpc_hash_content_b(alice_ctx)(alice_session_info.$!.snapshot_content as Content) - t.deepEqual(alice_session_info.$!.content_hash, content_hash) + content_hash = await rpc_hash_content_b(alice_ctx)(content_b(alice_ctx).$) + const alice_content_hash = content_hash_b(alice_ctx) + t.deepEqual(alice_content_hash.$, content_hash) // I should receive alice's request for the state as she joins the session - t.deepEqual(me_signals.$[0], { signal_name: 'SyncReq', signal_payload: alice_pubkey }) + t.deepEqual(me_SyncReq_stack![0], { signal_name: 'SyncReq', signal_payload: alice_pubkey }) // I add some pending deltas which I will then need to send to Alice as part of her Joining. pending_deltas = [{ type: 'Title', value: 'I haven\'t committed yet' }, { type: 'Add', value: [14, '\nBut made a new line! 🍑'] }] @@ -217,12 +249,12 @@ module.exports = (orchestrator)=>{ deltas = jsonDeltas ? pending_deltas.map(d=>JSON.stringify(d)) : pending_deltas const state:StateForSync = { - snapshot: session_info_b(me_ctx).$!.content_hash as EntryHash, + snapshot: session_info_b(me_ctx).$!.content_hash!, commit: commit_header_hash, commit_content_hash: new_content_hash_2, deltas: pending_deltas, - } - let [alice_SyncResp_stack] = await waitfor_filtered_signals_change(async ()=> + }; + [alice_SyncResp_stack] = await waitfor_filtered_signals_change(async ()=> rpc_send_sync_response_b(me_ctx)({ participant: alice_pubkey, state, @@ -236,18 +268,20 @@ module.exports = (orchestrator)=>{ let receivedState = alice_SyncResp_stack[0].signal_payload t.deepEqual(receivedState, { ...state, deltas: pending_deltas.map(d=>JSON.stringify(d)) }) // deltas, commit, and snapshot match + await join_session({ app_port: bob_port, app_id: bob_happ.hAppId, ctx: bob_ctx }) // bob joins session - const bob_$session_info = await rpc_get_session_b(bob_ctx)(session_hash) + const bob_$session_info = session_info_b(bob_ctx).$! + // const bob_$session_info = await rpc_get_session_b(bob_ctx)(session_hash) // bob should get my session t.deepEqual(bob_$session_info.scribe, me_pubkey) await rpc_send_sync_request_b(bob_ctx)(me_pubkey) - t.deepEqual(me_signals.$.map(ms=>ms.signal_name), ['SyncReq']) + t.deepEqual(me_signals.$.map(ms=>ms.signal_name), ['SyncReq', 'SyncReq', 'SyncReq']) // alice sends me a change req and I should receive it const alice_delta:Delta = { type: 'Title', value: 'Alice in Wonderland' } let delta = jsonDeltas ? JSON.stringify(alice_delta) : alice_delta - const [me_ChangeReq_stack] = await waitfor_filtered_signals_change(async ()=> + let [me_ChangeReq_stack] = await waitfor_filtered_signals_change(async ()=> rpc_send_change_request_b(alice_ctx)({ scribe: alice_session_info.$!.scribe, index: 1, @@ -266,7 +300,7 @@ module.exports = (orchestrator)=>{ let my_deltas:Delta[] = [{ type: 'Add', value: [0, 'Whoops!\n'] }, { type: 'Title', value: 'Alice in Wonderland' }] deltas = jsonDeltas ? my_deltas.map(d=>JSON.stringify(d)) : deltas // I send a change, and alice and bob should receive it. - const [alice_Change_stack, bob_Change_stack] = await waitfor_filtered_signals_change(async ()=> + let [alice_Change_stack, bob_Change_stack] = await waitfor_filtered_signals_change(async ()=> rpc_send_change_b(me_ctx)({ participants: [alice_pubkey, bob_pubkey], index: 2, @@ -282,7 +316,7 @@ module.exports = (orchestrator)=>{ t.deepEqual(a_sig.signal_payload, [2, deltas]) // delta_matches t.deepEqual(b_sig.signal_payload, [2, deltas]) // delta_matches - const [me_Heartbeat] = await waitfor_filtered_signals_change(async ()=> + let [me_Heartbeat] = await waitfor_filtered_signals_change(async ()=> rpc_send_heartbeat_b(alice_ctx)({ scribe: me_pubkey, data: 'Hello' @@ -295,7 +329,7 @@ module.exports = (orchestrator)=>{ t.deepEqual(me_sig.signal_payload[1], 'Hello') t.deepEqual(me_sig.signal_payload[0], alice_pubkey) - const [alice_FolkLore, bob_FolkLore] = await waitfor_filtered_signals_change(async ()=> + let [alice_FolkLore, bob_FolkLore] = await waitfor_filtered_signals_change(async ()=> rpc_send_folk_lore_b(me_ctx)({ participants: [alice_pubkey, bob_pubkey], data: { @@ -338,8 +372,8 @@ module.exports = (orchestrator)=>{ })) // alice asks for a sync request - const [me_SyncReq] = await waitfor_filtered_signals_change(async()=> - rpc_send_sync_request_b(alice_ctx)(me_pubkey), + let [me_SyncReq] = await waitfor_filtered_signals_change(async ()=> + rpc_send_sync_request_b(alice_ctx)(me_pubkey), [me_signals], $signals=>filter_signal_name($signals, 'SyncReq') ) @@ -349,32 +383,40 @@ module.exports = (orchestrator)=>{ // confirm that all agents got added to the folks anchor // TODO figure out why init doesn't happen immediately. let folks = await rpc_get_folks_b(me_ctx)() - t.equal(folks.length, 3) + t.deepEqual(folks, [ + me_pubkey, alice_pubkey, bob_pubkey + ]) /**/ } finally { await leave_session({ ctx: me_ctx }) await leave_session({ ctx: alice_ctx }) await leave_session({ ctx: bob_ctx }) } - }) -} -function filter_signal_name($signals:Signal[], signal_name:string) { - return $signals.filter(s=>s.signal_name === signal_name) -} -async function waitfor_filtered_signals_change( - fn:()=>Promise<void>, - signals_a1:Readable$<Signal[]>[], - _filtered_signals:($signals:Signal[])=>Signal[], - timeout = 1000 -) { - const filtered_signals_a1 = signals_a1.map(signals=>_filtered_signals(signals.$)) - await fn() - await Promise.all(signals_a1.map((signals, idx)=> - subscribe_wait_timeout(signals, - $signals=>{ - return _filtered_signals($signals).length > filtered_signals_a1[idx].length + function filter_signal_name($signals:Signal[], signal_name:string) { + return $signals.filter(s=>s.signal_name === signal_name) + } + async function waitfor_filtered_signals_change( + fn:()=>Promise<any>, + signals_a1:Readable$<Signal[]>[], + _filtered_signals:($signals:Signal[])=>Signal[], + timeout = 1000, + err = new Error() + ) { + const filtered_signals_a1 = signals_a1.map(signals=>_filtered_signals(signals.$)) + await fn() + try { + await Promise.all(signals_a1.map((signals, idx)=> + subscribe_wait_timeout(signals, + $signals=>{ + return _filtered_signals($signals).length > filtered_signals_a1[idx].length + }, timeout) + )) + return signals_a1.map(signals=>_filtered_signals(signals.$).reverse()) + } catch (e) { + err.message = e.message + throw err + return [] } - , timeout) - )) - return signals_a1.map(signals=>_filtered_signals(signals.$).reverse()) + } + }) } diff --git a/ui/apps/app/src/App.svelte b/ui/apps/app/src/App.svelte index 743eebbf..e50bc220 100644 --- a/ui/apps/app/src/App.svelte +++ b/ui/apps/app/src/App.svelte @@ -1,6 +1,6 @@ <script lang="ts"> import { setContext } from 'svelte' - import { request_change_b, scribe_str_b } from '@syn-ui/model' + import { request_change_b, session_info_scribe_str_b } from '@syn-ui/model' import type { apply_delta_ret_T } from '@syn-ui/model' import type { AddDelta, Content, DeleteDelta, Delta, MetaDelta, TitleDelta } from '@syn-ui/zome-client' import Editor from './Editor.svelte' @@ -20,7 +20,7 @@ setContext('ctx', ctx) const request_change = request_change_b(ctx) - const scribe_str = scribe_str_b(ctx) + const session_info_scribe_str = session_info_scribe_str_b(ctx) $: disconnected = false @@ -64,7 +64,7 @@ return `${delta.type}:\n${detail}` } - $: noscribe = $scribe_str === '' + $: noscribe = $session_info_scribe_str === '' let syn // The debug drawer's ability to resized and hidden diff --git a/ui/apps/app/src/Debug.svelte b/ui/apps/app/src/Debug.svelte index 1bdb6584..55bc16dd 100644 --- a/ui/apps/app/src/Debug.svelte +++ b/ui/apps/app/src/Debug.svelte @@ -1,10 +1,10 @@ <script lang="ts"> import { getContext } from 'svelte' - import { content_hash_str_b, next_index_b, scribe_str_b, session_info_b } from '@syn-ui/model' + import { content_hash_str_b, next_index_b, session_info_scribe_str_b, session_info_b } from '@syn-ui/model' import { dna_b } from '@syn-ui/zome-client' const ctx = getContext('ctx') const dna = dna_b(ctx) - const scribe_str = scribe_str_b(ctx) + const session_info_scribe_str = session_info_scribe_str_b(ctx) const next_index = next_index_b(ctx) const session_info = session_info_b(ctx) const content_hash_str = content_hash_str_b(ctx) @@ -25,6 +25,6 @@ ul { <li>lastCommitedContentHash: {$content_hash_str ? $content_hash_str : ''} <li>session: {JSON.stringify($session_info)} <li>next_index: {$next_index} - <li>scribe: {$scribe_str} + <li>scribe: {$session_info_scribe_str} </ul> </div> diff --git a/ui/apps/app/src/Folk.svelte b/ui/apps/app/src/Folk.svelte index 9f360065..d41038b4 100644 --- a/ui/apps/app/src/Folk.svelte +++ b/ui/apps/app/src/Folk.svelte @@ -1,9 +1,9 @@ <script lang="ts"> import { getContext } from 'svelte' - import { CSSifyHSL, folks_b, my_colors_b, scribe_str_b, session_info_b } from '@syn-ui/model' + import { CSSifyHSL, folks_b, my_colors_b, session_info_scribe_str_b, session_info_b } from '@syn-ui/model' const ctx = getContext('ctx') const folks = folks_b(ctx) - const scribe_str = scribe_str_b(ctx) + const session_info_scribe_str = session_info_scribe_str_b(ctx) const my_colors = my_colors_b(ctx) const session_info = session_info_b(ctx) @@ -11,7 +11,7 @@ export let me = false let scribe - $: scribe = pubKeyStr == $scribe_str + $: scribe = pubKeyStr == $session_info_scribe_str let outOfSession $: outOfSession = $folks?.[pubKeyStr]?.inSession && !me diff --git a/ui/apps/app/src/Syn.svelte b/ui/apps/app/src/Syn.svelte index 32aace3a..984efb02 100644 --- a/ui/apps/app/src/Syn.svelte +++ b/ui/apps/app/src/Syn.svelte @@ -1,14 +1,14 @@ <script lang="ts"> import { createEventDispatcher, getContext } from 'svelte' import { - commit_change_b, scribe_str_b, session_info_b, sessions_b, toggle_session + commit_change_b, session_info_scribe_str_b, session_info_b, sessions_b, toggle_session } from '@syn-ui/model' import { bufferToBase64 } from '@syn-ui/utils' const ctx = getContext('ctx') const session_info = session_info_b(ctx) // this is the list of sessions returned by the DNA const sessions = sessions_b(ctx) - const scribe_str = scribe_str_b(ctx) + const session_info_scribe_str = session_info_scribe_str_b(ctx) const commit_change = commit_change_b(ctx) // this properties are the app-defined functions to apply and undo changes @@ -28,7 +28,7 @@ } } - $: noscribe = $scribe_str === '' + $: noscribe = $session_info_scribe_str === '' </script> <style> :global(.noscribe) { diff --git a/ui/libs/model/src/actions/join_session.ts b/ui/libs/model/src/actions/join_session.ts index 28c16633..09e160a0 100644 --- a/ui/libs/model/src/actions/join_session.ts +++ b/ui/libs/model/src/actions/join_session.ts @@ -1,7 +1,7 @@ import { app_id_b, app_port_b, app_ws_b, rpc_get_session_b, rpc_new_session_b, rpc_send_sync_request_b, SessionInfo, } from '@syn-ui/zome-client' -import { am_i_scribe_b, session_info_b, session_str_b, sessions_b, sessions_str_a1_b } from '../session' +import { am_i_scribe_b, session_info_b, session_info_session_str_b, sessions_b, sessions_str_a1_b } from '../session' import { request_checker_timer_b, scribe_heartbeat_timer_b } from '../timers' import { app_ws_cb_b } from '../signals' export async function join_session(params:join_session_params_T) { @@ -15,23 +15,24 @@ export async function join_session(params:join_session_params_T) { await app_ws.load(app_ws_cb_b(ctx)) const $sessions = await sessions.load() sessions_str_a1_b(ctx) - session_str_b(ctx) + session_info_session_str_b(ctx) let $session_info:SessionInfo + const session_info = session_info_b(ctx) if ($sessions.length === 0) { const rpc_new_session = rpc_new_session_b(ctx) $session_info = await rpc_new_session() + session_info.$ = $session_info sessions.unshift($session_info.session) } else { const rpc_get_session = rpc_get_session_b(ctx) $session_info = await rpc_get_session($sessions[0]) + session_info.$ = $session_info const am_i_scribe = am_i_scribe_b(ctx) - if (am_i_scribe.$ === true) { + if (am_i_scribe.$ === false) { const rpc_send_sync_request = rpc_send_sync_request_b(ctx) await rpc_send_sync_request($session_info.scribe) } } - const session_info = session_info_b(ctx) - session_info.$ = $session_info const request_checker_timer = request_checker_timer_b(ctx) request_checker_timer.start() const scribe_heartbeat_timer = scribe_heartbeat_timer_b(ctx) diff --git a/ui/libs/model/src/actions/leave_session.ts b/ui/libs/model/src/actions/leave_session.ts index b40dd478..12ed551c 100644 --- a/ui/libs/model/src/actions/leave_session.ts +++ b/ui/libs/model/src/actions/leave_session.ts @@ -1,9 +1,12 @@ import { session_info_b } from '../session' import { request_checker_timer_b, scribe_heartbeat_timer_b } from '../timers' +import { _$content, content_b } from '../content' export async function leave_session(params:leave_session_params_I) { const ctx = params.ctx || {} const session_info = session_info_b(ctx) - session_info.$ = null + session_info.$ = undefined + const content = content_b(ctx) + content.$ = _$content() const request_checker_timer = request_checker_timer_b(ctx) request_checker_timer.stop() const scribe_heartbeat_timer = scribe_heartbeat_timer_b(ctx) diff --git a/ui/libs/model/src/content/content_b.ts b/ui/libs/model/src/content/content_b.ts index 1dd8ef11..9d746275 100644 --- a/ui/libs/model/src/content/content_b.ts +++ b/ui/libs/model/src/content/content_b.ts @@ -2,6 +2,9 @@ import { _b } from '@ctx-core/object' import { writable$ } from '@ctx-core/store' import type { Content } from '@syn-ui/zome-client' export const content_b = _b('content', ()=>{ - const content = writable$<Content>({ title: '', body: '', meta: {} }) + const content = writable$<Content>(_$content()) return content }) +export function _$content() { + return { title: '', body: '', meta: {} } +} diff --git a/ui/libs/model/src/delta/_scribe_signal_folk_pubKey_a1_b.ts b/ui/libs/model/src/delta/_scribe_signal_folk_pubKey_a1_b.ts index eeb13d6d..ac510986 100644 --- a/ui/libs/model/src/delta/_scribe_signal_folk_pubKey_a1_b.ts +++ b/ui/libs/model/src/delta/_scribe_signal_folk_pubKey_a1_b.ts @@ -1,10 +1,9 @@ import type { AgentPubKey } from '@holochain/conductor-api' import { _b } from '@ctx-core/object' -import type { PubKeyToFolkRecord } from '@syn-ui/zome-client' import { folks_b } from '../session' export const _scribe_signal_folk_pubKey_a1_b = _b('_scribe_signal_folk_pubKey_a1', (ctx)=>{ const folks = folks_b(ctx) return function _scribe_signal_folk_pubKey_a1():AgentPubKey[] { - return Object.values(folks.$ as PubKeyToFolkRecord).filter(v=>v.inSession).map(v=>v.pubKey) + return Object.values(folks.$!).filter(v=>v.inSession).map(v=>v.pubKey) } }) diff --git a/ui/libs/model/src/delta/apply_deltas_b.ts b/ui/libs/model/src/delta/apply_deltas_b.ts index 11187af4..50d3624b 100644 --- a/ui/libs/model/src/delta/apply_deltas_b.ts +++ b/ui/libs/model/src/delta/apply_deltas_b.ts @@ -1,41 +1,32 @@ import { _b } from '@ctx-core/object' import { - Content, Delta, AddDelta, DeleteDelta, MetaDelta, TitleDelta, my_tag_b, rpc_hash_content_b + Content, Delta, AddDelta, DeleteDelta, MetaDelta, TitleDelta, my_tag_b } from '@syn-ui/zome-client' import { content_b } from '../content' -import { content_hash_b } from '../session' +import { session_info_b, session_info_deltas_b } from '../session' import type { ApplyDelta } from './ApplyDelta' -import { deltas_b } from './deltas_b' -import { snapshot_content_b } from './snapshot_content_b' import { committed_changes_b } from './committed_changes_b' export const apply_deltas_b = _b('apply_deltas', (ctx)=>{ const content = content_b(ctx) const my_tag = my_tag_b(ctx) - const deltas = deltas_b(ctx) - const snapshot_content = snapshot_content_b(ctx) + const session_info = session_info_b(ctx) + const session_info_deltas = session_info_deltas_b(ctx) const committed_changes = committed_changes_b(ctx) - let current_$snapshot_content:undefined|Content - snapshot_content.subscribe(async $snapshot_content=>{ - if (!$snapshot_content || current_$snapshot_content === $snapshot_content) return - current_$snapshot_content = $snapshot_content + session_info.subscribe(async $session_info=>{ + if (!$session_info) return + const { snapshot_content } = $session_info const $my_tag = my_tag.$ const $content:Content = { - title: $snapshot_content.title, - body: $snapshot_content.body, + title: snapshot_content.title, + body: snapshot_content.body, meta: {} } if ($my_tag) { $content.meta[$my_tag] = 0 } content.$ = $content - const new_$committed_changes:ApplyDelta[] = [] - new_$committed_changes.push( - ...(await apply_deltas(deltas.$ || [])) - ) - committed_changes.update($committed_changes=>{ - $committed_changes.push(...new_$committed_changes) - return $committed_changes - }) + committed_changes.$ = [] + await apply_deltas(session_info_deltas.$ || []) }) return apply_deltas async function apply_deltas(deltas:Delta[]):Promise<ApplyDelta[]> { @@ -79,9 +70,10 @@ export const apply_deltas_b = _b('apply_deltas', (ctx)=>{ } } content.$ = $content - const rpc_hash_content = rpc_hash_content_b(ctx) - const content_hash = content_hash_b(ctx) - content_hash.$ = await rpc_hash_content($content) + committed_changes.update($committed_changes=>{ + $committed_changes.push(...undoable_changes) + return $committed_changes + }) return undoable_changes } }) diff --git a/ui/libs/model/src/delta/commit_change_b.ts b/ui/libs/model/src/delta/commit_change_b.ts index 4ad9d560..3b1c9489 100644 --- a/ui/libs/model/src/delta/commit_change_b.ts +++ b/ui/libs/model/src/delta/commit_change_b.ts @@ -1,11 +1,10 @@ -import { _b, assign } from '@ctx-core/object' +import { _b } from '@ctx-core/object' import { Commit, rpc_commit_b, rpc_hash_content_b } from '@syn-ui/zome-client' import { bufferToBase64, console_b } from '@syn-ui/utils' import { content_b } from '../content' import { - am_i_scribe_b, commit_in_progress_b, content_hash_b, - content_hash_str_b, current_commit_header_hash_b, session_info_b, - snapshot_hash_b, snapshot_hash_str_b + am_i_scribe_b, commit_in_progress_b, content_hash_b, content_hash_str_b, + current_commit_header_hash_b, session_info_snapshot_hash_b, session_info_snapshot_hash_str_b } from '../session' import { recorded_changes_b } from './recorded_changes_b' import { _scribe_signal_folk_pubKey_a1_b } from './_scribe_signal_folk_pubKey_a1_b' @@ -16,15 +15,14 @@ export const commit_change_b = _b('commit_change', (ctx)=>{ const commit_in_progress = commit_in_progress_b(ctx) const rpc_hash_content = rpc_hash_content_b(ctx) const content = content_b(ctx) - const snapshot_hash_str = snapshot_hash_str_b(ctx) + const session_info_snapshot_hash_str = session_info_snapshot_hash_str_b(ctx) const content_hash = content_hash_b(ctx) const content_hash_str = content_hash_str_b(ctx) - const snapshot_hash = snapshot_hash_b(ctx) + const session_info_snapshot_hash = session_info_snapshot_hash_b(ctx) const _scribe_signal_folk_pubKey_a1 = _scribe_signal_folk_pubKey_a1_b(ctx) const rpc_commit = rpc_commit_b(ctx) const current_commit_header_hash = current_commit_header_hash_b(ctx) const committed_changes = committed_changes_b(ctx) - const session_info = session_info_b(ctx) const am_i_scribe = am_i_scribe_b(ctx) return async function commit_change() { if (am_i_scribe.$ === true) { @@ -42,11 +40,11 @@ export const commit_change_b = _b('commit_change', (ctx)=>{ commit_in_progress.$ = true try { const new_content_hash = await rpc_hash_content(content.$) - console.log('committing from snapshot', snapshot_hash_str.$) + console.log('committing from snapshot', session_info_snapshot_hash_str.$) console.log(' prev_hash:', content_hash_str.$) console.log(' new_hash:', bufferToBase64(new_content_hash)) const commit:Commit = { - snapshot: snapshot_hash.$!, + snapshot: session_info_snapshot_hash.$!, change: { deltas: $recorded_changes.map(c=>JSON.stringify(c.delta)), content_hash: new_content_hash, @@ -60,17 +58,10 @@ export const commit_change_b = _b('commit_change', (ctx)=>{ participants: _scribe_signal_folk_pubKey_a1() } try { - console.debug('try_rpc_commit|debug|1', { - commit, - }) const $current_commit_header_hash = await rpc_commit(commit) current_commit_header_hash.$ = $current_commit_header_hash // if commit successful we need to update the content hash and its string in the session - session_info.update($session_info=> - assign($session_info, { - content_hash: new_content_hash - }) - ) + content_hash.$ = new_content_hash committed_changes.update($committed_changes=>{ $committed_changes.push(...$recorded_changes) return $committed_changes diff --git a/ui/libs/model/src/delta/index.ts b/ui/libs/model/src/delta/index.ts index 642beb2a..4ea426d1 100644 --- a/ui/libs/model/src/delta/index.ts +++ b/ui/libs/model/src/delta/index.ts @@ -1,7 +1,6 @@ export * from './ApplyDelta' export * from './commit_change_b' export * from './committed_changes_b' -export * from './deltas_b' export * from './next_index_b' export * from './record_deltas_b' export * from './recorded_changes_b' @@ -10,5 +9,4 @@ export * from './requested_changes_b' export * from './apply_deltas_b' export * from './_scribe_signal_folk_pubKey_a1_b' export * from './send_change_b' -export * from './snapshot_content_b' export * from './StateForSync' diff --git a/ui/libs/model/src/delta/record_deltas_b.ts b/ui/libs/model/src/delta/record_deltas_b.ts index 28d5c1ff..742b3a32 100644 --- a/ui/libs/model/src/delta/record_deltas_b.ts +++ b/ui/libs/model/src/delta/record_deltas_b.ts @@ -3,7 +3,6 @@ import type { Delta } from '@syn-ui/zome-client' import { console_b } from '@syn-ui/utils' import { requested_changes_b } from './requested_changes_b' import { recorded_changes_b } from './recorded_changes_b' -import type { ApplyDelta } from './ApplyDelta' import { apply_deltas_b } from './apply_deltas_b' export const record_deltas_b = _b('record_deltas', (ctx)=>{ const console = console_b(ctx) @@ -20,7 +19,7 @@ export const record_deltas_b = _b('record_deltas', (ctx)=>{ if (JSON.stringify(delta) === JSON.stringify($requested_changes[0].delta)) { const recorded_changes = recorded_changes_b(ctx) const $recorded_changes = recorded_changes.$ - $recorded_changes.push($requested_changes.shift() as ApplyDelta) + $recorded_changes.push($requested_changes.shift()!) recorded_changes.$ = $recorded_changes requested_changes.$ = $requested_changes } else { @@ -40,6 +39,9 @@ export const record_deltas_b = _b('record_deltas', (ctx)=>{ } const undoable_changes = await apply_deltas(apply_deltas_a1) // append changes to the recorded history - recorded_changes.push(...undoable_changes) + recorded_changes.update($recorded_changes=>{ + $recorded_changes.push(...undoable_changes) + return $recorded_changes + }) } }) diff --git a/ui/libs/model/src/delta/recorded_changes_b.ts b/ui/libs/model/src/delta/recorded_changes_b.ts index b3b6eed6..75447bc9 100644 --- a/ui/libs/model/src/delta/recorded_changes_b.ts +++ b/ui/libs/model/src/delta/recorded_changes_b.ts @@ -5,11 +5,4 @@ export const recorded_changes_b = _b('recorded_changes', ()=> new recorded_changes_T(writable$<$recorded_changes_T>([])) ) export type $recorded_changes_T = ApplyDelta[] -export class recorded_changes_T extends writable$_C<$recorded_changes_T> { - push = (...apply_delta_a1:ApplyDelta[])=>{ - const $store = this.$ - $store.push(...apply_delta_a1) - this.$ = $store - return $store - } -} +export class recorded_changes_T extends writable$_C<$recorded_changes_T> {} diff --git a/ui/libs/model/src/delta/request_change_b.ts b/ui/libs/model/src/delta/request_change_b.ts index b659251f..1058a2f3 100644 --- a/ui/libs/model/src/delta/request_change_b.ts +++ b/ui/libs/model/src/delta/request_change_b.ts @@ -1,7 +1,7 @@ import { _b } from '@ctx-core/object' import { Delta, my_tag_b, rpc_send_change_request_b } from '@syn-ui/zome-client' import { console_b } from '@syn-ui/utils' -import { am_i_scribe_b, scribe_b } from '../session' +import { am_i_scribe_b, session_info_scribe_b } from '../session' import { next_index_b } from './next_index_b' import { send_change_b } from './send_change_b' import { requested_changes_b } from './requested_changes_b' @@ -43,9 +43,9 @@ export const request_change_b = _b('request_change', (ctx)=>{ request_changes.$ = $requested_changes console.log('REQUESTED', $requested_changes) const rpc_send_change_request = rpc_send_change_request_b(ctx) - const scribe = scribe_b(ctx) + const scribe = session_info_scribe_b(ctx) await rpc_send_change_request({ - index, deltas, scribe: scribe.$ + index, deltas, scribe: scribe.$! }) request_counter += 1 } diff --git a/ui/libs/model/src/session/am_i_scribe_b.ts b/ui/libs/model/src/session/am_i_scribe_b.ts index fa2feb5d..09283c81 100644 --- a/ui/libs/model/src/session/am_i_scribe_b.ts +++ b/ui/libs/model/src/session/am_i_scribe_b.ts @@ -1,11 +1,11 @@ import { _b } from '@ctx-core/object' import { derived$ } from '@ctx-core/store' import { me_b } from '@syn-ui/zome-client' -import { scribe_str_b } from './scribe_str_b' +import { session_info_scribe_str_b } from './session_info_scribe_str_b' export const am_i_scribe_b = _b('am_i_scribe', (ctx)=>{ - const scribe_str = scribe_str_b(ctx) + const session_info_scribe_str = session_info_scribe_str_b(ctx) const me = me_b(ctx) - return derived$(([scribe_str, me]), ([$scribe_str, $me])=> - $scribe_str ? $scribe_str === $me : null + return derived$(([session_info_scribe_str, me]), ([$session_info_scribe_str, $me])=> + $session_info_scribe_str ? $session_info_scribe_str === $me : null ) }) diff --git a/ui/libs/model/src/session/folks_b.ts b/ui/libs/model/src/session/folks_b.ts index 8f18ba9e..0388cdce 100644 --- a/ui/libs/model/src/session/folks_b.ts +++ b/ui/libs/model/src/session/folks_b.ts @@ -4,4 +4,4 @@ import type { PubKeyToFolkRecord } from '@syn-ui/zome-client' export const folks_b = _b('folks', ()=>{ return writable$<$folks_T>({}) }) -export type $folks_T = PubKeyToFolkRecord|null +export type $folks_T = PubKeyToFolkRecord diff --git a/ui/libs/model/src/session/index.ts b/ui/libs/model/src/session/index.ts index 0880cbee..97b16969 100644 --- a/ui/libs/model/src/session/index.ts +++ b/ui/libs/model/src/session/index.ts @@ -4,13 +4,15 @@ export * from './content_hash_b' export * from './content_hash_str_b' export * from './current_commit_header_hash_b' export * from './folks_b' -export * from './scribe_b' -export * from './scribe_str_b' +export * from './session_info_scribe_b' +export * from './session_info_scribe_str_b' export * from './session_info_b' -export * from './session_b' -export * from './session_str_b' +export * from './session_info_deltas_b' +export * from './session_info_session_b' +export * from './session_info_session_str_b' +export * from './session_info_snapshot_content_b' export * from './sessions_b' export * from './sessions_str_a1_b' -export * from './snapshot_hash_b' -export * from './snapshot_hash_str_b' +export * from './session_info_snapshot_hash_b' +export * from './session_info_snapshot_hash_str_b' export * from './update_folks_b' diff --git a/ui/libs/model/src/session/scribe_b.ts b/ui/libs/model/src/session/scribe_b.ts deleted file mode 100644 index 43b14d24..00000000 --- a/ui/libs/model/src/session/scribe_b.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { AgentPubKey } from '@holochain/conductor-api' -import { _b } from '@ctx-core/object' -import { derived$, Readable$ } from '@ctx-core/store' -import { session_info_b } from './session_info_b' -export const scribe_b = _b('scribe', (ctx)=>{ - const session_info = session_info_b(ctx) - return derived$(session_info, $session_info=> - $session_info?.scribe - ) as Readable$<AgentPubKey> -}) diff --git a/ui/libs/model/src/session/scribe_str_b.ts b/ui/libs/model/src/session/scribe_str_b.ts deleted file mode 100644 index efbc7c3c..00000000 --- a/ui/libs/model/src/session/scribe_str_b.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { _b } from '@ctx-core/object' -import { derived$ } from '@ctx-core/store' -import { bufferToBase64 } from '@syn-ui/utils' -import { scribe_b } from './scribe_b' -export const scribe_str_b = _b('scribe_str', (ctx)=>{ - const scribe = scribe_b(ctx) - return derived$(scribe, $scribe=> - $scribe ? bufferToBase64($scribe) : null - ) -}) diff --git a/ui/libs/model/src/session/session_info_b.ts b/ui/libs/model/src/session/session_info_b.ts index ad7cf408..72714228 100644 --- a/ui/libs/model/src/session/session_info_b.ts +++ b/ui/libs/model/src/session/session_info_b.ts @@ -3,7 +3,7 @@ import { writable$, Writable$ } from '@ctx-core/store' import { rpc_get_session_b, SessionInfo } from '@syn-ui/zome-client' export const session_info_b = _b<session_info_I>('session_info', (ctx)=>{ const rpc_get_session = rpc_get_session_b(ctx) - const session_info = assign(writable$<$session_info_T>(null), { + const session_info = assign(writable$<$session_info_T>(undefined), { refresh }) return session_info @@ -14,7 +14,7 @@ export const session_info_b = _b<session_info_I>('session_info', (ctx)=>{ } } }) -export type $session_info_T = SessionInfo|null +export type $session_info_T = undefined|SessionInfo export interface session_info_I extends Writable$<$session_info_T> { refresh():Promise<void> } diff --git a/ui/libs/model/src/delta/deltas_b.ts b/ui/libs/model/src/session/session_info_deltas_b.ts similarity index 85% rename from ui/libs/model/src/delta/deltas_b.ts rename to ui/libs/model/src/session/session_info_deltas_b.ts index d22d8279..c072dede 100644 --- a/ui/libs/model/src/delta/deltas_b.ts +++ b/ui/libs/model/src/session/session_info_deltas_b.ts @@ -2,7 +2,7 @@ import { _b } from '@ctx-core/object' import { derived$ } from '@ctx-core/store' import type { Delta } from '@syn-ui/zome-client' import { session_info_b } from '../session' -export const deltas_b = _b('deltas', (ctx)=>{ +export const session_info_deltas_b = _b('session_info_deltas', (ctx)=>{ const session_info = session_info_b(ctx) return derived$(session_info, $session_info=> $session_info ? $session_info.deltas.map( diff --git a/ui/libs/model/src/session/session_b.ts b/ui/libs/model/src/session/session_info_scribe_b.ts similarity index 67% rename from ui/libs/model/src/session/session_b.ts rename to ui/libs/model/src/session/session_info_scribe_b.ts index fc8c7830..54cbeaae 100644 --- a/ui/libs/model/src/session/session_b.ts +++ b/ui/libs/model/src/session/session_info_scribe_b.ts @@ -1,9 +1,9 @@ import { _b } from '@ctx-core/object' import { derived$ } from '@ctx-core/store' import { session_info_b } from './session_info_b' -export const session_b = _b('session', (ctx)=>{ +export const session_info_scribe_b = _b('session_info_scribe', (ctx)=>{ const session_info = session_info_b(ctx) return derived$(session_info, $session_info=> - $session_info?.session - ) + $session_info?.scribe + )! }) diff --git a/ui/libs/model/src/session/session_info_scribe_str_b.ts b/ui/libs/model/src/session/session_info_scribe_str_b.ts new file mode 100644 index 00000000..ca706a24 --- /dev/null +++ b/ui/libs/model/src/session/session_info_scribe_str_b.ts @@ -0,0 +1,10 @@ +import { _b } from '@ctx-core/object' +import { derived$ } from '@ctx-core/store' +import { bufferToBase64 } from '@syn-ui/utils' +import { session_info_scribe_b } from './session_info_scribe_b' +export const session_info_scribe_str_b = _b('session_info_scribe_str', (ctx)=>{ + const session_info_scribe = session_info_scribe_b(ctx) + return derived$(session_info_scribe, $session_info_scribe=> + $session_info_scribe ? bufferToBase64($session_info_scribe) : null + ) +}) diff --git a/ui/libs/model/src/session/session_str_b.ts b/ui/libs/model/src/session/session_info_session_str_b.ts similarity index 54% rename from ui/libs/model/src/session/session_str_b.ts rename to ui/libs/model/src/session/session_info_session_str_b.ts index 6df8797f..5194921a 100644 --- a/ui/libs/model/src/session/session_str_b.ts +++ b/ui/libs/model/src/session/session_info_session_str_b.ts @@ -1,9 +1,9 @@ import { _b } from '@ctx-core/object' import { derived$ } from '@ctx-core/store' import { bufferToBase64 } from '@syn-ui/utils' -import { session_b } from './session_b' -export const session_str_b = _b('session_str', (ctx)=>{ - const session = session_b(ctx) +import { session_info_session_b } from './session_info_session_b' +export const session_info_session_str_b = _b('session_info_session_str', (ctx)=>{ + const session = session_info_session_b(ctx) return derived$(session, $session=> $session ? bufferToBase64($session) : undefined ) diff --git a/ui/libs/model/src/delta/snapshot_content_b.ts b/ui/libs/model/src/session/session_info_snapshot_content_b.ts similarity index 83% rename from ui/libs/model/src/delta/snapshot_content_b.ts rename to ui/libs/model/src/session/session_info_snapshot_content_b.ts index 45109170..6333fc1b 100644 --- a/ui/libs/model/src/delta/snapshot_content_b.ts +++ b/ui/libs/model/src/session/session_info_snapshot_content_b.ts @@ -2,7 +2,7 @@ import { _b } from '@ctx-core/object' import { derived$, Readable$ } from '@ctx-core/store' import type { Content } from '@syn-ui/zome-client' import { session_info_b } from '../session' -export const snapshot_content_b = _b('snapshot_content', (ctx)=>{ +export const session_info_snapshot_content_b = _b('session_info_snapshot_content', (ctx)=>{ const session_info = session_info_b(ctx) const snapshot_content:snapshot_content_T = derived$(session_info, $session_info=> $session_info?.snapshot_content diff --git a/ui/libs/model/src/session/snapshot_hash_b.ts b/ui/libs/model/src/session/session_info_snapshot_hash_b.ts similarity index 74% rename from ui/libs/model/src/session/snapshot_hash_b.ts rename to ui/libs/model/src/session/session_info_snapshot_hash_b.ts index ab837844..816177d4 100644 --- a/ui/libs/model/src/session/snapshot_hash_b.ts +++ b/ui/libs/model/src/session/session_info_snapshot_hash_b.ts @@ -2,7 +2,7 @@ import { _b } from '@ctx-core/object' import { derived$, Readable$ } from '@ctx-core/store' import type { HeaderHash } from '@syn-ui/utils/dist' import { session_info_b } from './session_info_b' -export const snapshot_hash_b = _b<Readable$<HeaderHash|undefined>>('snapshot_hash', ctx=>{ +export const session_info_snapshot_hash_b = _b<Readable$<undefined|HeaderHash>>('session_info_snapshot_hash', ctx=>{ const session_info = session_info_b(ctx) return derived$(session_info, $session_info=> $session_info?.snapshot_hash diff --git a/ui/libs/model/src/session/session_info_snapshot_hash_str_b.ts b/ui/libs/model/src/session/session_info_snapshot_hash_str_b.ts new file mode 100644 index 00000000..06aa8984 --- /dev/null +++ b/ui/libs/model/src/session/session_info_snapshot_hash_str_b.ts @@ -0,0 +1,10 @@ +import { _b } from '@ctx-core/object' +import { derived$ } from '@ctx-core/store' +import { bufferToBase64 } from '@syn-ui/utils' +import { session_info_snapshot_hash_b } from './session_info_snapshot_hash_b' +export const session_info_snapshot_hash_str_b = _b('session_info_snapshot_hash_str', (ctx)=>{ + const session_info_snapshot_hash = session_info_snapshot_hash_b(ctx) + return derived$(session_info_snapshot_hash, $session_info_snapshot_hash=> + $session_info_snapshot_hash ? bufferToBase64($session_info_snapshot_hash) : null + ) +}) diff --git a/ui/libs/model/src/session/sessions_b.ts b/ui/libs/model/src/session/sessions_b.ts index f3d42f00..9b70cd04 100644 --- a/ui/libs/model/src/session/sessions_b.ts +++ b/ui/libs/model/src/session/sessions_b.ts @@ -1,16 +1,15 @@ import { _b, assign } from '@ctx-core/object' import { _readable_set_ctx$, Writable$ } from '@ctx-core/store' import { rpc_get_sessions_b, SessionInfo } from '@syn-ui/zome-client' -import { console_b, EntryHash } from '@syn-ui/utils' +import type { EntryHash } from '@syn-ui/utils' import { session_info_b } from './session_info_b' export const sessions_b = _b('sessions', (ctx)=>{ - const console = console_b(ctx) const { store: sessions, set } = _readable_set_ctx$<EntryHash[]|null>(null) const { store: busy, set: set_busy } = _readable_set_ctx$<boolean>(false) const out_sessions = sessions as sessions_T assign(out_sessions, { busy, load, unshift }) const session_info = session_info_b(ctx) - let $session_info:SessionInfo|null + let $session_info:undefined|SessionInfo session_info.subscribe(in_$session_info=>{ if ($session_info && !in_$session_info) { set(null) @@ -22,18 +21,15 @@ export const sessions_b = _b('sessions', (ctx)=>{ set_busy(true) try { const rpc_get_sessions = rpc_get_sessions_b(ctx) - const $session_info = await rpc_get_sessions() - console.debug('sessions|load|debug|1', { - $session_info - }) - set($session_info) + const $sessions = await rpc_get_sessions() + set($sessions) } finally { set_busy(false) } return sessions.$ } function unshift(...session_hash_a1:EntryHash[]) { - const $sessions = sessions.$ as EntryHash[] + const $sessions = sessions.$! $sessions.unshift(...session_hash_a1) set($sessions) return $sessions diff --git a/ui/libs/model/src/session/snapshot_hash_str_b.ts b/ui/libs/model/src/session/snapshot_hash_str_b.ts deleted file mode 100644 index 561cb8e6..00000000 --- a/ui/libs/model/src/session/snapshot_hash_str_b.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { _b } from '@ctx-core/object' -import { derived$ } from '@ctx-core/store' -import { bufferToBase64 } from '@syn-ui/utils' -import { snapshot_hash_b } from './snapshot_hash_b' -export const snapshot_hash_str_b = _b('snapshot_hash_str', (ctx)=>{ - const snapshot_hash = snapshot_hash_b(ctx) - return derived$(snapshot_hash, $snapshot_hash=> - $snapshot_hash ? bufferToBase64($snapshot_hash) : null - ) -}) diff --git a/ui/libs/model/src/signals/SyncReq_SignalOps_b.ts b/ui/libs/model/src/signals/SyncReq_SignalOps_b.ts index fa630697..a24dd212 100644 --- a/ui/libs/model/src/signals/SyncReq_SignalOps_b.ts +++ b/ui/libs/model/src/signals/SyncReq_SignalOps_b.ts @@ -3,11 +3,11 @@ import { _b } from '@ctx-core/object' import { agent_pub_key_b, FOLK_SEEN, me_b, rpc_send_folk_lore_b, rpc_send_sync_response_b, StateForSync } from '@syn-ui/zome-client' -import { console_b, EntryHash } from '@syn-ui/utils' +import { console_b } from '@syn-ui/utils' import { _scribe_signal_folk_pubKey_a1_b, recorded_changes_b } from '../delta' import { am_i_scribe_b, content_hash_b, current_commit_header_hash_b, folks_b, - snapshot_hash_b, update_folks_b + session_info_snapshot_hash_b, update_folks_b } from '../session' import type { SignalOps } from './SignalOps' export const SyncReq_SignalOps_b = _b<SignalOps>('SyncReq_SignalOps', (ctx)=>{ @@ -18,7 +18,7 @@ export const SyncReq_SignalOps_b = _b<SignalOps>('SyncReq_SignalOps', (ctx)=>{ const rpc_send_sync_response = rpc_send_sync_response_b(ctx) const recorded_changes = recorded_changes_b(ctx) const content_hash = content_hash_b(ctx) - const snapshot_hash = snapshot_hash_b(ctx) + const session_info_snapshot_hash = session_info_snapshot_hash_b(ctx) const current_commit_header_hash = current_commit_header_hash_b(ctx) const _scribe_signal_folk_pubKey_a1 = _scribe_signal_folk_pubKey_a1_b(ctx) const rpc_send_folk_lore = rpc_send_folk_lore_b(ctx) @@ -29,8 +29,8 @@ export const SyncReq_SignalOps_b = _b<SignalOps>('SyncReq_SignalOps', (ctx)=>{ if (am_i_scribe.$ === true) { update_folks(participant, FOLK_SEEN) const state:StateForSync = { - snapshot: snapshot_hash.$ as EntryHash, - commit_content_hash: content_hash.$ as EntryHash, + snapshot: session_info_snapshot_hash.$!, + commit_content_hash: content_hash.$!, deltas: recorded_changes.$.map(c=>c.delta) } const $current_commit_header_hash = current_commit_header_hash.$ diff --git a/ui/libs/model/src/signals/SyncResp_SignalOps_b.ts b/ui/libs/model/src/signals/SyncResp_SignalOps_b.ts index 19a1688e..922b7e13 100644 --- a/ui/libs/model/src/signals/SyncResp_SignalOps_b.ts +++ b/ui/libs/model/src/signals/SyncResp_SignalOps_b.ts @@ -18,7 +18,7 @@ export const SyncResp_SignalOps_b = _b<SignalOps>('SyncResp_SignalOps', (ctx)=>{ }) // Make sure that we are working off the same snapshot and commit const commit_content_hash_str = bufferToBase64(state.commit_content_hash) - if (commit_content_hash_str == content_hash_str.$) { + if ( commit_content_hash_str == content_hash_str.$) { await record_deltas(state.deltas) } else { console.log('WHOA, sync response has different current state assumptions') diff --git a/ui/libs/model/src/timers/request_checker_timer_b.ts b/ui/libs/model/src/timers/request_checker_timer_b.ts index 964b4c3a..bb980f34 100644 --- a/ui/libs/model/src/timers/request_checker_timer_b.ts +++ b/ui/libs/model/src/timers/request_checker_timer_b.ts @@ -33,7 +33,6 @@ export const request_checker_timer_b = _b('request_checker_timer', (ctx)=>{ // and send a sync request incase something just got out of sequence // TODO: prepare for shifting to new scribe if they went offline - await session_info.refresh() console.log('HERE') const $session_info = session_info.$ if ($session_info) { diff --git a/ui/libs/model/src/timers/scribe_heartbeat_timer_b.ts b/ui/libs/model/src/timers/scribe_heartbeat_timer_b.ts index 268ef20f..d9a44e0b 100644 --- a/ui/libs/model/src/timers/scribe_heartbeat_timer_b.ts +++ b/ui/libs/model/src/timers/scribe_heartbeat_timer_b.ts @@ -1,6 +1,6 @@ import { PubKeyToFolkRecord, rpc_send_folk_lore_b, rpc_send_heartbeat_b } from '@syn-ui/zome-client' import { _b } from '@ctx-core/object' -import { am_i_scribe_b, folks_b, scribe_b } from '../session' +import { am_i_scribe_b, folks_b, session_info_scribe_b } from '../session' import { _scribe_signal_folk_pubKey_a1_b } from '../delta' import { Timer } from './Timer' import type { AgentPubKey } from '@holochain/conductor-api' @@ -35,9 +35,9 @@ export const scribe_heartbeat_timer_b = _b<Timer>('scribe_heartbeat_timer', (ctx } else { // I'm not the scribe so send them a heartbeat const rpc_send_heartbeat = rpc_send_heartbeat_b(ctx) - const scribe = scribe_b(ctx) + const session_info_scribe = session_info_scribe_b(ctx) await rpc_send_heartbeat({ - scribe: scribe.$, + scribe: session_info_scribe.$!, data: 'Hello' }) } From 81fec2dafdd72bd3cc33d876635527cd5ef1cddf Mon Sep 17 00:00:00 2001 From: Brian Takita <brian.takita@gmail.com> Date: Mon, 3 May 2021 16:19:13 -0400 Subject: [PATCH 26/33] fix: @syn-ui/test: intermittent failure with rpc_get_folks_b(me_ctx) call @syn-ui/test: + timeout --- package.json | 4 +- pnpm-lock.yaml | 196 +++++++++++++++---------------- tests/package.json | 6 +- tests/unit-test/syn.ts | 39 ++++-- ui/apps/app/package.json | 8 +- ui/apps/headless/package.json | 8 +- ui/libs/model/package.json | 6 +- ui/libs/zome-client/package.json | 6 +- 8 files changed, 140 insertions(+), 133 deletions(-) diff --git a/package.json b/package.json index cf1e02cf..e2f2b200 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "devDependencies": { "@babel/runtime": "^7.14.0", "@changesets/cli": "^2.16.0", - "@ctx-core/function": "^17.4.8", + "@ctx-core/function": "^17.4.9", "@ctx-core/jetbrains": "^4.0.34", "@ctx-core/monorepo": "^15.0.56", "@ctx-core/pnpm-tools": "^6.0.11", @@ -20,4 +20,4 @@ "typescript": "4.2.4" }, "noUpdate": [] -} +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6ee21c20..50bf854a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,7 +6,7 @@ importers: specifiers: '@babel/runtime': ^7.14.0 '@changesets/cli': ^2.16.0 - '@ctx-core/function': ^17.4.8 + '@ctx-core/function': ^17.4.9 '@ctx-core/jetbrains': ^4.0.34 '@ctx-core/monorepo': ^15.0.56 '@ctx-core/pnpm-tools': ^6.0.11 @@ -15,7 +15,7 @@ importers: devDependencies: '@babel/runtime': 7.14.0 '@changesets/cli': 2.16.0 - '@ctx-core/function': 17.4.8 + '@ctx-core/function': 17.4.9 '@ctx-core/jetbrains': 4.0.34 '@ctx-core/monorepo': 15.0.56 '@ctx-core/pnpm-tools': 6.0.11 @@ -25,9 +25,9 @@ importers: tests: specifiers: '@ctx-core/combinators': ^6.0.10 - '@ctx-core/store': ^24.7.1 + '@ctx-core/store': ^24.7.5 '@holochain/conductor-api': 0.0.4 - '@holochain/tryorama': 0.4.2 + '@holochain/tryorama': 0.4.3 '@syn-ui/model': workspace:^1.0.0 '@syn-ui/utils': workspace:^1.0.0 '@syn-ui/zome-client': workspace:^1.0.0 @@ -50,9 +50,9 @@ importers: uuidv4: 6.2.7 devDependencies: '@ctx-core/combinators': 6.0.10 - '@ctx-core/store': 24.7.1 + '@ctx-core/store': 24.7.5 '@holochain/conductor-api': 0.0.4 - '@holochain/tryorama': 0.4.2 + '@holochain/tryorama': 0.4.3 '@syn-ui/model': link:../ui/libs/model '@syn-ui/utils': link:../ui/libs/utils '@syn-ui/zome-client': link:../ui/libs/zome-client @@ -64,8 +64,8 @@ importers: ui/apps/app: specifiers: '@ctx-core/combinators': ^6.0.10 - '@ctx-core/object': ^17.5.15 - '@ctx-core/store': ^24.7.1 + '@ctx-core/object': ^17.5.17 + '@ctx-core/store': ^24.7.5 '@holochain/conductor-api': 0.0.4 '@rollup/plugin-commonjs': ^18.0.0 '@rollup/plugin-node-resolve': ^11.2.1 @@ -82,10 +82,10 @@ importers: rollup-plugin-svelte: ^7.1.0 rollup-plugin-terser: ^7.0.2 sirv-cli: ^1.0.11 - svelte: ^3.38.0 + svelte: ^3.38.2 svelte-check: ^1.5.2 svelte-fa: ^2.2.0 - svelte-preprocess: ^4.7.2 + svelte-preprocess: ^4.7.3 tslib: ^2.2.0 typescript: ^4.2.4 dependencies: @@ -94,8 +94,8 @@ importers: sirv-cli: 1.0.11 svelte-fa: 2.2.0 devDependencies: - '@ctx-core/object': 17.5.15 - '@ctx-core/store': 24.7.1 + '@ctx-core/object': 17.5.17 + '@ctx-core/store': 24.7.5 '@rollup/plugin-commonjs': 18.0.0_rollup@2.46.0 '@rollup/plugin-node-resolve': 11.2.1_rollup@2.46.0 '@rollup/plugin-replace': 2.4.2_rollup@2.46.0 @@ -108,19 +108,19 @@ importers: rollup-plugin-css-only: 3.1.0_rollup@2.46.0 rollup-plugin-livereload: 2.0.0 rollup-plugin-node-polyfills: 0.2.1 - rollup-plugin-svelte: 7.1.0_rollup@2.46.0+svelte@3.38.0 + rollup-plugin-svelte: 7.1.0_rollup@2.46.0+svelte@3.38.2 rollup-plugin-terser: 7.0.2_rollup@2.46.0 - svelte: 3.38.0 - svelte-check: 1.5.2_svelte@3.38.0 - svelte-preprocess: 4.7.2_svelte@3.38.0+typescript@4.2.4 + svelte: 3.38.2 + svelte-check: 1.5.2_svelte@3.38.2 + svelte-preprocess: 4.7.3_svelte@3.38.2+typescript@4.2.4 tslib: 2.2.0 typescript: 4.2.4 ui/apps/headless: specifiers: '@ctx-core/combinators': ^6.0.10 - '@ctx-core/object': ^17.5.15 - '@ctx-core/store': ^24.7.1 + '@ctx-core/object': ^17.5.17 + '@ctx-core/store': ^24.7.5 '@holochain/conductor-api': 0.0.4 '@rollup/plugin-commonjs': ^18.0.0 '@rollup/plugin-node-resolve': ^11.2.1 @@ -132,9 +132,9 @@ importers: rollup-plugin-svelte: ^7.1.0 rollup-plugin-terser: ^7.0.2 sirv-cli: ^1.0.11 - svelte: ^3.38.0 + svelte: ^3.38.2 svelte-fa: ^2.2.0 - svelte-preprocess: ^4.7.2 + svelte-preprocess: ^4.7.3 typescript: ^4.2.4 dependencies: '@ctx-core/combinators': 6.0.10 @@ -142,8 +142,8 @@ importers: sirv-cli: 1.0.11 svelte-fa: 2.2.0 devDependencies: - '@ctx-core/object': 17.5.15 - '@ctx-core/store': 24.7.1 + '@ctx-core/object': 17.5.17 + '@ctx-core/store': 24.7.5 '@rollup/plugin-commonjs': 18.0.0_rollup@2.46.0 '@rollup/plugin-node-resolve': 11.2.1_rollup@2.46.0 '@rollup/plugin-replace': 2.4.2_rollup@2.46.0 @@ -151,30 +151,30 @@ importers: rollup: 2.46.0 rollup-plugin-css-only: 3.1.0_rollup@2.46.0 rollup-plugin-livereload: 2.0.0 - rollup-plugin-svelte: 7.1.0_rollup@2.46.0+svelte@3.38.0 + rollup-plugin-svelte: 7.1.0_rollup@2.46.0+svelte@3.38.2 rollup-plugin-terser: 7.0.2_rollup@2.46.0 - svelte: 3.38.0 - svelte-preprocess: 4.7.2_svelte@3.38.0+typescript@4.2.4 + svelte: 3.38.2 + svelte-preprocess: 4.7.3_svelte@3.38.2+typescript@4.2.4 typescript: 4.2.4 ui/libs/model: specifiers: '@ctx-core/combinators': ^6.0.10 - '@ctx-core/object': ^17.5.15 - '@ctx-core/store': ^24.7.1 + '@ctx-core/object': ^17.5.17 + '@ctx-core/store': ^24.7.5 '@holochain/conductor-api': 0.0.4 '@syn-ui/utils': workspace:^1.0.0 '@syn-ui/zome-client': workspace:^1.0.0 - svelte: ^3.38.0 + svelte: ^3.38.2 typescript: ^4.2.4 devDependencies: '@ctx-core/combinators': 6.0.10 - '@ctx-core/object': 17.5.15 - '@ctx-core/store': 24.7.1 + '@ctx-core/object': 17.5.17 + '@ctx-core/store': 24.7.5 '@holochain/conductor-api': 0.0.4 '@syn-ui/utils': link:../utils '@syn-ui/zome-client': link:../zome-client - svelte: 3.38.0 + svelte: 3.38.2 typescript: 4.2.4 ui/libs/utils: @@ -185,17 +185,17 @@ importers: ui/libs/zome-client: specifiers: - '@ctx-core/function': ^17.4.8 - '@ctx-core/object': ^17.5.15 - '@ctx-core/store': ^24.7.1 + '@ctx-core/function': ^17.4.9 + '@ctx-core/object': ^17.5.17 + '@ctx-core/store': ^24.7.5 '@holochain/conductor-api': ^0.0.4 '@syn-ui/utils': workspace:^1.0.0 buffer: ^6.0.3 typescript: ^4.2.4 devDependencies: - '@ctx-core/function': 17.4.8 - '@ctx-core/object': 17.5.15 - '@ctx-core/store': 24.7.1 + '@ctx-core/function': 17.4.9 + '@ctx-core/object': 17.5.17 + '@ctx-core/store': 24.7.5 '@holochain/conductor-api': 0.0.4 '@syn-ui/utils': link:../utils buffer: 6.0.3 @@ -412,21 +412,21 @@ packages: arrify: 1.0.1 dev: true - /@ctx-core/array/20.2.18: - resolution: {integrity: sha512-PjZK6iWxXrx2pxGKPYX5Qs/pwW5Wo2c/Rx5VPavKOiZQ++VWt+Uk3VfnwgS5R8A60yWi45zx6vdhFYkNB/xFcA==} + /@ctx-core/array/20.2.20: + resolution: {integrity: sha512-OpGLFpg78qHrQGxMFoLFJVe3qpk1GGhebOmw5sq8CMQhAJlj91VynQn3hSS/agg88XQwAAN05oP0BDtfEzNt1w==} dependencies: '@ctx-core/combinators': 6.0.10 - '@ctx-core/function': 17.4.8 - '@ctx-core/object': 17.5.15 - '@ctx-core/set': 9.0.20 + '@ctx-core/function': 17.4.9 + '@ctx-core/object': 17.5.17 + '@ctx-core/set': 9.0.21 dev: true - /@ctx-core/cli-args/7.2.27: - resolution: {integrity: sha512-xH5FDMnw+VD5rtLbFjOrNn2lgX3bPTXeh/2YyLTw/STxa+QjeUgKTlftxLDD5ZiGnfVtkuIXLbQX2G/ghZLfMQ==} + /@ctx-core/cli-args/7.2.29: + resolution: {integrity: sha512-udKauGZDrehl42SEQSyusaRA19v0g3lapYX2sDEYimt8wlmK8MCtU15w0vCtPAXOnB+7Z/vMUEMmhbCwOMXqkw==} dependencies: - '@ctx-core/array': 20.2.18 - '@ctx-core/function': 17.4.8 - '@ctx-core/object': 17.5.15 + '@ctx-core/array': 20.2.20 + '@ctx-core/function': 17.4.9 + '@ctx-core/object': 17.5.17 dev: true /@ctx-core/combinators/6.0.10: @@ -436,18 +436,18 @@ packages: resolution: {integrity: sha512-AWvTxUL0ZEjlGjU+Ye546oLbFqqvwTzy+bEJmUxsNVgKeAGtKZNfd0hY5+QStHqf7bD10A6V4NM4CgcI7f9VJA==} hasBin: true dependencies: - '@ctx-core/array': 20.2.18 + '@ctx-core/array': 20.2.20 dev: true - /@ctx-core/function/17.4.8: - resolution: {integrity: sha512-XEtd8ko5HlzZDMYNPRLRMIldLKWPMSRLmqGRxlYxtQvYDiwDobtOPxCyhzeDR7nlxSGBVBWI/7tMwhegnttUUw==} + /@ctx-core/function/17.4.9: + resolution: {integrity: sha512-BsAVEgSWFfKdhH/B/+1TLGrgFGrit40CGjEl5w7XUHTDzEi/1OEUalSznD0TKZJ5sBXQGCakp3TaRgL5UIz3sA==} dev: true /@ctx-core/jetbrains/4.0.34: resolution: {integrity: sha512-4wGPtDyY8sEeR3uh01thHA4DdCIexqvCBD5SJPWlPYeA2qrj/BAzd7JNuAZRrouJCkWthf5W1kUxArAQkgsNXQ==} hasBin: true dependencies: - '@ctx-core/cli-args': 7.2.27 + '@ctx-core/cli-args': 7.2.29 '@ctx-core/queue': 3.0.10 esm: 3.2.25 globby: 11.0.3 @@ -457,8 +457,8 @@ packages: resolution: {integrity: sha512-6/HYAUhrw1OrYnRFH6x5uMhlkJiQy0W5OJ3sOY2gikfiullhmre+r0NLytHnGaHZgXVkwWcRyi1eLqr7t3R/IA==} hasBin: true dependencies: - '@ctx-core/array': 20.2.18 - '@ctx-core/cli-args': 7.2.27 + '@ctx-core/array': 20.2.20 + '@ctx-core/cli-args': 7.2.29 '@ctx-core/ctx-core-package-tools': 6.0.49 '@ctx-core/package': 6.1.21 '@ctx-core/queue': 3.0.10 @@ -469,17 +469,17 @@ packages: semver: 7.3.5 dev: true - /@ctx-core/object/17.5.15: - resolution: {integrity: sha512-Y1RhOn79IofjzCeav+QKUpRa5LdkQSrX6Lct8mxPkHP+FSWxDcnLqD+EouwesaqKN9nh7p8+gI4d/EmERaR4MQ==} + /@ctx-core/object/17.5.17: + resolution: {integrity: sha512-1qbnYvUj/Z4gN0G6MPmjTmhCS0P7rz2yMW8fcwsRB1iaf4GhbSkpCGyo+F1YJxwuLc/d1LDb/x6MPSPUEvJouA==} dependencies: - '@ctx-core/function': 17.4.8 + '@ctx-core/function': 17.4.9 dev: true /@ctx-core/package/6.1.21: resolution: {integrity: sha512-1LAU/w/BEA+Og4nMNNZqL8DULgFUUHYdFn8xkKsiD6XE2tqBmjpeI8NliBz2a5rP9VGRReix0q1vjanCc4lY/g==} hasBin: true dependencies: - '@ctx-core/cli-args': 7.2.27 + '@ctx-core/cli-args': 7.2.29 esm: 3.2.25 resolve: 1.20.0 dev: true @@ -497,20 +497,20 @@ packages: resolution: {integrity: sha512-SUX8v4klI5/Xy4LeQ87V5h1WfK8k15YvFvsTw74fLYWYEaquy3nYnuduRsAY8L58xZ0uY/OQ++XHTiyIUCX9aA==} dev: true - /@ctx-core/set/9.0.20: - resolution: {integrity: sha512-eeXGmjWuJRHvypqHpNaKQWBKsx9b/dWSkfAHePgFNeVzmW5k1e3zd8g+suJPENpFcFHhbUizoqqRVwnVcTWwBw==} + /@ctx-core/set/9.0.21: + resolution: {integrity: sha512-uynQWcGIlpr1l9NGGYFGGF82AzMBxW6x6wtK2iK0HFDWiVbKl6t7X37CVkV9xpVjbOJmFDTQt46+OO5DuNd3rg==} dependencies: - '@ctx-core/function': 17.4.8 + '@ctx-core/function': 17.4.9 dev: true - /@ctx-core/store/24.7.1: - resolution: {integrity: sha512-9ZwBLpT1rvSIDGt9JMQjT4fMDkjPety7Mwdr/vmXzkh6AIRKyeyzyxVSsGB1pgL3sh9QcFTgFMpQyoqdcLyXlQ==} + /@ctx-core/store/24.7.5: + resolution: {integrity: sha512-XxjAPVZnkuXT9PR2b1jXViKtxI4jDniONLbpwwjLWAdKrMjYbUf0Sg8OUPv5101zfRahuRQgP28tsRARv39SqA==} dependencies: - '@ctx-core/array': 20.2.18 + '@ctx-core/array': 20.2.20 '@ctx-core/combinators': 6.0.10 - '@ctx-core/function': 17.4.8 - '@ctx-core/object': 17.5.15 - svelte: 3.38.0 + '@ctx-core/function': 17.4.9 + '@ctx-core/object': 17.5.17 + svelte: 3.38.1 dev: true /@dabh/diagnostics/2.0.2: @@ -521,19 +521,6 @@ packages: kuler: 2.0.0 dev: true - /@holochain/conductor-api/0.0.3: - resolution: {integrity: sha512-wok/uiyGoX4m59wMhT3VX2Ma6bXBfZwp8F8iqTb/XiHz0UpROOCrUELXnmN9Ee1sYnmJcTLYRhRTCZ73WRgkdA==} - dependencies: - '@msgpack/msgpack': 2.4.0 - '@types/ws': 7.4.2 - isomorphic-ws: 4.0.1_ws@7.4.5 - nanoid: 3.1.22 - ws: 7.4.5 - transitivePeerDependencies: - - bufferutil - - utf-8-validate - dev: true - /@holochain/conductor-api/0.0.4: resolution: {integrity: sha512-s52H+JMtiWID8wsqkKVkbjNDrHeVD88X+XWEllIi9INc7md2nBkMKBVChc/qgpRFqrpj2X8j/Es9MtvIJYnQqg==} dependencies: @@ -555,10 +542,10 @@ packages: winston-null: 2.0.0_winston@3.3.3 dev: true - /@holochain/tryorama/0.4.2: - resolution: {integrity: sha512-2Da3zWfXRO/xItRMhzxhRdu+6c9ce0lCZ7hXLjJ2HQ8pspdU6oVHVPhlblwr1Bk1n0W43LM11XVC1YbgzFWZBw==} + /@holochain/tryorama/0.4.3: + resolution: {integrity: sha512-IHaNZSCCeaa+kmC7AN7Vo5sAknBqHMD3WyC1hWwc2F40JwdAaaGb74uGMgPtg6bdxpsmEVUPSHFKW5ex07+WCg==} dependencies: - '@holochain/conductor-api': 0.0.3 + '@holochain/conductor-api': 0.0.4 '@holochain/hachiko': 0.5.2 '@iarna/toml': 2.2.5 '@msgpack/msgpack': 2.6.0 @@ -566,10 +553,10 @@ packages: axios: 0.19.2 base-64: 0.1.0 colors: 1.4.0 - fp-ts: 2.10.4 + fp-ts: 2.10.5 get-port: 5.1.1 - io-ts: 2.2.16_fp-ts@2.10.4 - io-ts-reporters: 1.2.2_fp-ts@2.10.4+io-ts@2.2.16 + io-ts: 2.2.16_fp-ts@2.10.5 + io-ts-reporters: 1.2.2_fp-ts@2.10.5+io-ts@2.2.16 lodash: 4.17.21 memoizee: 0.4.15 ramda: 0.26.1 @@ -1970,8 +1957,8 @@ packages: resolution: {integrity: sha1-C+4AUBiusmDQo6865ljdATbsG5k=} dev: false - /fp-ts/2.10.4: - resolution: {integrity: sha512-vMTB5zNc9PnE20q145PNbkiL9P9WegwmKVOFloi/NfHnPdAlcob6I3AKqlH/9u3k3/M/GOftZhcJdBrb+NtnDA==} + /fp-ts/2.10.5: + resolution: {integrity: sha512-X2KfTIV0cxIk3d7/2Pvp/pxL/xr2MV1WooyEzKtTWYSc1+52VF4YzjBTXqeOlSiZsPCxIBpDGfT9Dyo7WEY0DQ==} dev: true /fs-extra/7.0.1: @@ -2230,22 +2217,22 @@ packages: engines: {node: '>=10'} dev: true - /io-ts-reporters/1.2.2_fp-ts@2.10.4+io-ts@2.2.16: + /io-ts-reporters/1.2.2_fp-ts@2.10.5+io-ts@2.2.16: resolution: {integrity: sha512-igASwWWkDY757OutNcM6zTtdJf/eTZYkoe2ymsX2qpm5bKZLo74FJYjsCtMQOEdY7dRHLLEulCyFQwdN69GBCg==} peerDependencies: fp-ts: ^2.0.2 io-ts: ^2.0.0 dependencies: - fp-ts: 2.10.4 - io-ts: 2.2.16_fp-ts@2.10.4 + fp-ts: 2.10.5 + io-ts: 2.2.16_fp-ts@2.10.5 dev: true - /io-ts/2.2.16_fp-ts@2.10.4: + /io-ts/2.2.16_fp-ts@2.10.5: resolution: {integrity: sha512-y5TTSa6VP6le0hhmIyN0dqEXkrZeJLeC5KApJq6VLci3UEKF80lZ+KuoUs02RhBxNWlrqSNxzfI7otLX1Euv8Q==} peerDependencies: fp-ts: ^2.5.0 dependencies: - fp-ts: 2.10.4 + fp-ts: 2.10.5 dev: true /irregular-plurals/3.3.0: @@ -3496,7 +3483,7 @@ packages: rollup-plugin-inject: 3.0.2 dev: true - /rollup-plugin-svelte/7.1.0_rollup@2.46.0+svelte@3.38.0: + /rollup-plugin-svelte/7.1.0_rollup@2.46.0+svelte@3.38.2: resolution: {integrity: sha512-vopCUq3G+25sKjwF5VilIbiY6KCuMNHP1PFvx2Vr3REBNMDllKHFZN2B9jwwC+MqNc3UPKkjXnceLPEjTjXGXg==} engines: {node: '>=10'} peerDependencies: @@ -3506,7 +3493,7 @@ packages: require-relative: 0.8.7 rollup: 2.46.0 rollup-pluginutils: 2.8.2 - svelte: 3.38.0 + svelte: 3.38.2 dev: true /rollup-plugin-terser/7.0.2_rollup@2.46.0: @@ -3897,7 +3884,7 @@ packages: has-flag: 4.0.0 dev: true - /svelte-check/1.5.2_svelte@3.38.0: + /svelte-check/1.5.2_svelte@3.38.2: resolution: {integrity: sha512-x9Pc13r814TKrMXY70IyqDEmPzuFiqNSpBmsrMKrFpi995MiG+lmqYnyw8iQC+DGh7H3eUt3LIFXbNd396XIFw==} hasBin: true peerDependencies: @@ -3909,8 +3896,8 @@ packages: import-fresh: 3.3.0 minimist: 1.2.5 source-map: 0.7.3 - svelte: 3.38.0 - svelte-preprocess: 4.7.2_svelte@3.38.0+typescript@4.2.4 + svelte: 3.38.2 + svelte-preprocess: 4.7.3_svelte@3.38.2+typescript@4.2.4 typescript: 4.2.4 transitivePeerDependencies: - '@babel/core' @@ -3929,8 +3916,8 @@ packages: resolution: {integrity: sha512-PN1H8AWDh+OwhwjJKTv4/zXvKvmvOEVSCVhIhji6Onx8XEw+CGf8BDR0BVUIp87IEX+DEqIo9pbyhgz8EoYZyA==} dev: false - /svelte-preprocess/4.7.2_svelte@3.38.0+typescript@4.2.4: - resolution: {integrity: sha512-EToG+08rEsA33btv+C5g2qnRArwpTc5AoU0QBB3ZEkYagxAb2yPNsy0qsmtvbJOTBMy6o3oyijDdl3DMpMvpEg==} + /svelte-preprocess/4.7.3_svelte@3.38.2+typescript@4.2.4: + resolution: {integrity: sha512-Zx1/xLeGOIBlZMGPRCaXtlMe4ZA0faato5Dc3CosEqwu75MIEPuOstdkH6cy+RYTUYynoxzNaDxkPX4DbrPwRA==} engines: {node: '>= 9.11.2'} requiresBuild: true peerDependencies: @@ -3974,12 +3961,17 @@ packages: '@types/sass': 1.16.0 detect-indent: 6.0.0 strip-indent: 3.0.0 - svelte: 3.38.0 + svelte: 3.38.2 typescript: 4.2.4 dev: true - /svelte/3.38.0: - resolution: {integrity: sha512-V0CbyzvXEka7zQtRYt++cpPh0zxxDUTIeNlq4KncGXn2qHnQFZ2i4L4+2QOfLwOudb9cewJeegupBQcscnBaaA==} + /svelte/3.38.1: + resolution: {integrity: sha512-N3XLAyfzqrFxwRLevBeW7Dke9ZlHRVGSIed5abo4Drvj+zvd2OyWpFa1x4nQUc8Lnvt4Kcn8/5le1peRDybNqg==} + engines: {node: '>= 8'} + dev: true + + /svelte/3.38.2: + resolution: {integrity: sha512-q5Dq0/QHh4BLJyEVWGe7Cej5NWs040LWjMbicBGZ+3qpFWJ1YObRmUDZKbbovddLC9WW7THTj3kYbTOFmU9fbg==} engines: {node: '>= 8'} dev: true diff --git a/tests/package.json b/tests/package.json index 92f1c090..1679204e 100644 --- a/tests/package.json +++ b/tests/package.json @@ -20,9 +20,9 @@ }, "devDependencies": { "@ctx-core/combinators": "^6.0.10", - "@ctx-core/store": "^24.7.1", + "@ctx-core/store": "^24.7.5", "@holochain/conductor-api": "0.0.4", - "@holochain/tryorama": "0.4.2", + "@holochain/tryorama": "0.4.3", "@syn-ui/model": "workspace:^1.0.0", "@syn-ui/utils": "workspace:^1.0.0", "@syn-ui/zome-client": "workspace:^1.0.0", @@ -31,4 +31,4 @@ "ava": "^3.15.0", "pnpm": "^6.2.3" } -} +} \ No newline at end of file diff --git a/tests/unit-test/syn.ts b/tests/unit-test/syn.ts index 1ac2f321..3517489c 100644 --- a/tests/unit-test/syn.ts +++ b/tests/unit-test/syn.ts @@ -1,11 +1,14 @@ +import { isDeepStrictEqual } from 'util' import path from 'path' import { Config, InstallAgentsHapps } from '@holochain/tryorama' -import { noop } from '@ctx-core/function' +import { noop, promise_timeout } from '@ctx-core/function' import { assign } from '@ctx-core/object' import { I } from '@ctx-core/combinators' import { Readable$, subscribe_wait_timeout, writable$ } from '@ctx-core/store' import { bufferToBase64, console_b, EntryHash } from '@syn-ui/utils' -import { content_b, apply_deltas_b, session_info_b, join_session, leave_session, content_hash_b } from '@syn-ui/model' +import { + content_b, apply_deltas_b, session_info_b, join_session, leave_session, content_hash_b +} from '@syn-ui/model' import { Commit, Delta, my_tag_b, rpc_commit_b, rpc_get_content_b, rpc_get_folks_b, rpc_get_session_b, rpc_get_sessions_b, rpc_hash_content_b, rpc_send_change_b, rpc_send_change_request_b, rpc_send_folk_lore_b, @@ -66,6 +69,7 @@ module.exports = (orchestrator)=>{ await join_session({ app_port: me_port, app_id: me_happ.hAppId, ctx: me_ctx }) try { + t.deepEqual(await rpc_get_folks_b(me_ctx)(), [me_pubkey]) await subscribe_wait_timeout(session_info_b(me_ctx), I, 10_000) // I created the session, so I should be the scribe t.deepEqual(session_info_b(me_ctx).$!.scribe, me_pubkey) @@ -180,10 +184,11 @@ module.exports = (orchestrator)=>{ // clear the pending_deltas pending_deltas = [] + // check that deltas and snapshot content returned add up to the current real content let me_SyncResp_stack:Signal[], alice_SyncResp_stack:Signal[], me_SyncReq_stack:Signal[] - // check that deltas and snapshot content returned add up to the current real content - ;[alice_SyncResp_stack] = await waitfor_filtered_signals_change(async ()=>{ + // alice joins session + [alice_SyncResp_stack] = await waitfor_filtered_signals_change(async ()=>{ [me_SyncReq_stack] = await waitfor_filtered_signals_change(()=> join_session({ app_port: alice_port, @@ -198,7 +203,12 @@ module.exports = (orchestrator)=>{ [alice_signals], $signals=>filter_signal_name($signals, 'SyncResp') ) - // alice joins session + await promise_timeout(async ()=>{ + while (!isDeepStrictEqual( + await rpc_get_folks_b(me_ctx)(), + [me_pubkey, alice_pubkey])) {} + }, 500) + t.deepEqual(await rpc_get_folks_b(me_ctx)(), [me_pubkey, alice_pubkey]) const alice_session_info = session_info_b(alice_ctx) const alice_content = content_b(alice_ctx) // alice should get my session @@ -209,9 +219,13 @@ module.exports = (orchestrator)=>{ me_content.$, { title: 'foo title', body: 'baz monkey new', meta: { [my_tag_b(me_ctx).$]: 0 } } // content after two commits ) - t.deepEqual( - alice_content.$, - { title: 'foo title', body: 'baz monkey new', meta: { [my_tag_b(alice_ctx).$]: 0 } } // content after two commits + await subscribe_wait_timeout( + alice_content, + $alice_content=> + isDeepStrictEqual( + $alice_content, + { title: 'foo title', body: 'baz monkey new', meta: { [my_tag_b(alice_ctx).$]: 0 } }), + 1000 ) await leave_session({ ctx: alice_ctx }) ;[alice_SyncResp_stack] = await waitfor_filtered_signals_change(async ()=>{ @@ -382,10 +396,11 @@ module.exports = (orchestrator)=>{ // confirm that all agents got added to the folks anchor // TODO figure out why init doesn't happen immediately. - let folks = await rpc_get_folks_b(me_ctx)() - t.deepEqual(folks, [ - me_pubkey, alice_pubkey, bob_pubkey - ]) + await promise_timeout(async ()=>{ + while (!isDeepStrictEqual( + await rpc_get_folks_b(me_ctx)(), + [me_pubkey, alice_pubkey, bob_pubkey])) {} + }, 500) /**/ } finally { await leave_session({ ctx: me_ctx }) diff --git a/ui/apps/app/package.json b/ui/apps/app/package.json index 36c7ecbb..20783215 100644 --- a/ui/apps/app/package.json +++ b/ui/apps/app/package.json @@ -14,8 +14,8 @@ "svelte-fa": "^2.2.0" }, "devDependencies": { - "@ctx-core/object": "^17.5.15", - "@ctx-core/store": "^24.7.1", + "@ctx-core/object": "^17.5.17", + "@ctx-core/store": "^24.7.5", "@rollup/plugin-commonjs": "^18.0.0", "@rollup/plugin-node-resolve": "^11.2.1", "@rollup/plugin-replace": "^2.4.2", @@ -30,9 +30,9 @@ "rollup-plugin-node-polyfills": "^0.2.1", "rollup-plugin-svelte": "^7.1.0", "rollup-plugin-terser": "^7.0.2", - "svelte": "^3.38.0", + "svelte": "^3.38.2", "svelte-check": "^1.5.2", - "svelte-preprocess": "^4.7.2", + "svelte-preprocess": "^4.7.3", "tslib": "^2.2.0", "typescript": "^4.2.4" } diff --git a/ui/apps/headless/package.json b/ui/apps/headless/package.json index 88051cf5..d3e9381c 100644 --- a/ui/apps/headless/package.json +++ b/ui/apps/headless/package.json @@ -13,8 +13,8 @@ "svelte-fa": "^2.2.0" }, "devDependencies": { - "@ctx-core/object": "^17.5.15", - "@ctx-core/store": "^24.7.1", + "@ctx-core/object": "^17.5.17", + "@ctx-core/store": "^24.7.5", "@rollup/plugin-commonjs": "^18.0.0", "@rollup/plugin-node-resolve": "^11.2.1", "@rollup/plugin-replace": "^2.4.2", @@ -24,8 +24,8 @@ "rollup-plugin-livereload": "^2.0.0", "rollup-plugin-svelte": "^7.1.0", "rollup-plugin-terser": "^7.0.2", - "svelte": "^3.38.0", - "svelte-preprocess": "^4.7.2", + "svelte": "^3.38.2", + "svelte-preprocess": "^4.7.3", "typescript": "^4.2.4" } } \ No newline at end of file diff --git a/ui/libs/model/package.json b/ui/libs/model/package.json index da69d0ba..80c902d9 100644 --- a/ui/libs/model/package.json +++ b/ui/libs/model/package.json @@ -7,12 +7,12 @@ "scripts": {}, "devDependencies": { "@ctx-core/combinators": "^6.0.10", - "@ctx-core/object": "^17.5.15", - "@ctx-core/store": "^24.7.1", + "@ctx-core/object": "^17.5.17", + "@ctx-core/store": "^24.7.5", "@holochain/conductor-api": "0.0.4", "@syn-ui/utils": "workspace:^1.0.0", "@syn-ui/zome-client": "workspace:^1.0.0", - "svelte": "^3.38.0", + "svelte": "^3.38.2", "typescript": "^4.2.4" } } \ No newline at end of file diff --git a/ui/libs/zome-client/package.json b/ui/libs/zome-client/package.json index da5f1fea..67fd10a5 100644 --- a/ui/libs/zome-client/package.json +++ b/ui/libs/zome-client/package.json @@ -6,9 +6,9 @@ "types": "./src/index.ts", "scripts": {}, "devDependencies": { - "@ctx-core/function": "^17.4.8", - "@ctx-core/object": "^17.5.15", - "@ctx-core/store": "^24.7.1", + "@ctx-core/function": "^17.4.9", + "@ctx-core/object": "^17.5.17", + "@ctx-core/store": "^24.7.5", "@holochain/conductor-api": "^0.0.4", "@syn-ui/utils": "workspace:^1.0.0", "buffer": "^6.0.3", From 75e244300449f67c09968eff2843c2f72f21f2c2 Mon Sep 17 00:00:00 2001 From: Brian Takita <brian.takita@gmail.com> Date: Tue, 4 May 2021 04:44:40 -0400 Subject: [PATCH 27/33] fix: FolkLore signal handling @syn-ui/tests: improvements to functional testing --- package.json | 2 +- pnpm-lock.yaml | 65 ++- tests/common.ts | 1 - tests/package.json | 11 +- tests/unit-test/syn.ts | 507 ++++++++++-------- ui/apps/app/package.json | 2 +- ui/apps/app/src/App.svelte | 11 +- ui/apps/app/src/Editor_I.ts | 5 + ui/apps/app/src/Title.svelte | 3 +- ui/apps/app/src/Title_I.ts | 5 + ui/apps/app/src/index.ts | 15 + ui/apps/app/src/request_change_T.ts | 2 + ui/apps/headless/package.json | 2 +- ui/libs/model/package.json | 2 +- ui/libs/model/src/content/content_b.ts | 2 +- ui/libs/model/src/delta/apply_deltas_b.ts | 11 +- ui/libs/model/src/delta/commit_change_b.ts | 20 +- ui/libs/model/src/delta/next_index_b.ts | 7 +- ui/libs/model/src/delta/record_deltas_b.ts | 4 +- ui/libs/model/src/delta/request_change_b.ts | 15 +- .../session/current_commit_header_hash_b.ts | 2 +- ui/libs/model/src/session/update_folks_b.ts | 7 +- .../src/signals/Heartbeat_SignalOps_b.ts | 2 +- .../model/src/signals/SyncReq_SignalOps_b.ts | 8 +- .../model/src/signals/SyncResp_SignalOps_b.ts | 4 +- .../src/timers/scribe_heartbeat_timer_b.ts | 6 +- ui/libs/utils/src/delay.ts | 1 + ui/libs/utils/src/index.ts | 2 + ui/libs/utils/src/stack.ts | 22 + ui/libs/zome-client/package.json | 2 +- zomes/syn/src/lib.rs | 1 + 31 files changed, 435 insertions(+), 314 deletions(-) create mode 100644 ui/apps/app/src/Editor_I.ts create mode 100644 ui/apps/app/src/Title_I.ts create mode 100644 ui/apps/app/src/index.ts create mode 100644 ui/apps/app/src/request_change_T.ts create mode 100644 ui/libs/utils/src/delay.ts create mode 100644 ui/libs/utils/src/stack.ts diff --git a/package.json b/package.json index e2f2b200..df4a23b1 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "@ctx-core/jetbrains": "^4.0.34", "@ctx-core/monorepo": "^15.0.56", "@ctx-core/pnpm-tools": "^6.0.11", - "pnpm": "^6.2.3", + "pnpm": "^6.2.5", "typescript": "4.2.4" }, "noUpdate": [] diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 50bf854a..866507ac 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,7 +10,7 @@ importers: '@ctx-core/jetbrains': ^4.0.34 '@ctx-core/monorepo': ^15.0.56 '@ctx-core/pnpm-tools': ^6.0.11 - pnpm: ^6.2.3 + pnpm: ^6.2.5 typescript: 4.2.4 devDependencies: '@babel/runtime': 7.14.0 @@ -19,15 +19,15 @@ importers: '@ctx-core/jetbrains': 4.0.34 '@ctx-core/monorepo': 15.0.56 '@ctx-core/pnpm-tools': 6.0.11 - pnpm: 6.2.3 + pnpm: 6.2.5 typescript: 4.2.4 tests: specifiers: '@ctx-core/combinators': ^6.0.10 - '@ctx-core/store': ^24.7.5 + '@ctx-core/store': ^24.7.9 '@holochain/conductor-api': 0.0.4 - '@holochain/tryorama': 0.4.3 + '@holochain/tryorama': 0.4.2 '@syn-ui/model': workspace:^1.0.0 '@syn-ui/utils': workspace:^1.0.0 '@syn-ui/zome-client': workspace:^1.0.0 @@ -36,7 +36,7 @@ importers: ava: ^3.15.0 esm: ^3.2.25 lodash: ^4.17.21 - pnpm: ^6.2.3 + pnpm: ^6.2.5 tape: ^5.2.2 ts-node: ^9.1.1 typescript: ^4.2.4 @@ -50,22 +50,22 @@ importers: uuidv4: 6.2.7 devDependencies: '@ctx-core/combinators': 6.0.10 - '@ctx-core/store': 24.7.5 + '@ctx-core/store': 24.7.9 '@holochain/conductor-api': 0.0.4 - '@holochain/tryorama': 0.4.3 + '@holochain/tryorama': 0.4.2 '@syn-ui/model': link:../ui/libs/model '@syn-ui/utils': link:../ui/libs/utils '@syn-ui/zome-client': link:../ui/libs/zome-client '@types/lodash': 4.14.168 '@types/node': 15.0.1 ava: 3.15.0 - pnpm: 6.2.3 + pnpm: 6.2.5 ui/apps/app: specifiers: '@ctx-core/combinators': ^6.0.10 '@ctx-core/object': ^17.5.17 - '@ctx-core/store': ^24.7.5 + '@ctx-core/store': ^24.7.9 '@holochain/conductor-api': 0.0.4 '@rollup/plugin-commonjs': ^18.0.0 '@rollup/plugin-node-resolve': ^11.2.1 @@ -95,7 +95,7 @@ importers: svelte-fa: 2.2.0 devDependencies: '@ctx-core/object': 17.5.17 - '@ctx-core/store': 24.7.5 + '@ctx-core/store': 24.7.9 '@rollup/plugin-commonjs': 18.0.0_rollup@2.46.0 '@rollup/plugin-node-resolve': 11.2.1_rollup@2.46.0 '@rollup/plugin-replace': 2.4.2_rollup@2.46.0 @@ -120,7 +120,7 @@ importers: specifiers: '@ctx-core/combinators': ^6.0.10 '@ctx-core/object': ^17.5.17 - '@ctx-core/store': ^24.7.5 + '@ctx-core/store': ^24.7.9 '@holochain/conductor-api': 0.0.4 '@rollup/plugin-commonjs': ^18.0.0 '@rollup/plugin-node-resolve': ^11.2.1 @@ -143,7 +143,7 @@ importers: svelte-fa: 2.2.0 devDependencies: '@ctx-core/object': 17.5.17 - '@ctx-core/store': 24.7.5 + '@ctx-core/store': 24.7.9 '@rollup/plugin-commonjs': 18.0.0_rollup@2.46.0 '@rollup/plugin-node-resolve': 11.2.1_rollup@2.46.0 '@rollup/plugin-replace': 2.4.2_rollup@2.46.0 @@ -161,7 +161,7 @@ importers: specifiers: '@ctx-core/combinators': ^6.0.10 '@ctx-core/object': ^17.5.17 - '@ctx-core/store': ^24.7.5 + '@ctx-core/store': ^24.7.9 '@holochain/conductor-api': 0.0.4 '@syn-ui/utils': workspace:^1.0.0 '@syn-ui/zome-client': workspace:^1.0.0 @@ -170,7 +170,7 @@ importers: devDependencies: '@ctx-core/combinators': 6.0.10 '@ctx-core/object': 17.5.17 - '@ctx-core/store': 24.7.5 + '@ctx-core/store': 24.7.9 '@holochain/conductor-api': 0.0.4 '@syn-ui/utils': link:../utils '@syn-ui/zome-client': link:../zome-client @@ -187,7 +187,7 @@ importers: specifiers: '@ctx-core/function': ^17.4.9 '@ctx-core/object': ^17.5.17 - '@ctx-core/store': ^24.7.5 + '@ctx-core/store': ^24.7.9 '@holochain/conductor-api': ^0.0.4 '@syn-ui/utils': workspace:^1.0.0 buffer: ^6.0.3 @@ -195,7 +195,7 @@ importers: devDependencies: '@ctx-core/function': 17.4.9 '@ctx-core/object': 17.5.17 - '@ctx-core/store': 24.7.5 + '@ctx-core/store': 24.7.9 '@holochain/conductor-api': 0.0.4 '@syn-ui/utils': link:../utils buffer: 6.0.3 @@ -503,8 +503,8 @@ packages: '@ctx-core/function': 17.4.9 dev: true - /@ctx-core/store/24.7.5: - resolution: {integrity: sha512-XxjAPVZnkuXT9PR2b1jXViKtxI4jDniONLbpwwjLWAdKrMjYbUf0Sg8OUPv5101zfRahuRQgP28tsRARv39SqA==} + /@ctx-core/store/24.7.9: + resolution: {integrity: sha512-GSow/2VRcMqJJ6LNMnGuyo00j9/VGGRwCUt2oCdg8aWq8UWrHhMFQU4Z671Dn+9jm/IjhMlr1KpRiiuwNtMBFw==} dependencies: '@ctx-core/array': 20.2.20 '@ctx-core/combinators': 6.0.10 @@ -521,6 +521,19 @@ packages: kuler: 2.0.0 dev: true + /@holochain/conductor-api/0.0.3: + resolution: {integrity: sha512-wok/uiyGoX4m59wMhT3VX2Ma6bXBfZwp8F8iqTb/XiHz0UpROOCrUELXnmN9Ee1sYnmJcTLYRhRTCZ73WRgkdA==} + dependencies: + '@msgpack/msgpack': 2.4.0 + '@types/ws': 7.4.2 + isomorphic-ws: 4.0.1_ws@7.4.5 + nanoid: 3.1.22 + ws: 7.4.5 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + dev: true + /@holochain/conductor-api/0.0.4: resolution: {integrity: sha512-s52H+JMtiWID8wsqkKVkbjNDrHeVD88X+XWEllIi9INc7md2nBkMKBVChc/qgpRFqrpj2X8j/Es9MtvIJYnQqg==} dependencies: @@ -542,13 +555,13 @@ packages: winston-null: 2.0.0_winston@3.3.3 dev: true - /@holochain/tryorama/0.4.3: - resolution: {integrity: sha512-IHaNZSCCeaa+kmC7AN7Vo5sAknBqHMD3WyC1hWwc2F40JwdAaaGb74uGMgPtg6bdxpsmEVUPSHFKW5ex07+WCg==} + /@holochain/tryorama/0.4.2: + resolution: {integrity: sha512-2Da3zWfXRO/xItRMhzxhRdu+6c9ce0lCZ7hXLjJ2HQ8pspdU6oVHVPhlblwr1Bk1n0W43LM11XVC1YbgzFWZBw==} dependencies: - '@holochain/conductor-api': 0.0.4 + '@holochain/conductor-api': 0.0.3 '@holochain/hachiko': 0.5.2 '@iarna/toml': 2.2.5 - '@msgpack/msgpack': 2.6.0 + '@msgpack/msgpack': 2.6.1 async-mutex: 0.1.4 axios: 0.19.2 base-64: 0.1.0 @@ -596,8 +609,8 @@ packages: resolution: {integrity: sha512-5qzv53J43V8GaYsaETs29Q0Ehw9Dog6SG18MASZRQDuZYXtA5T7pymGE2S40NL0X8sjl8+TybmRa5O8d45V7MQ==} engines: {node: '>= 10'} - /@msgpack/msgpack/2.6.0: - resolution: {integrity: sha512-CbKEhARMPl/CYNhIs4p0NgoNWspUQP45QxZoJ433ydSd2HTfzQ4WQyEpViJkEHKkRcPbV72FlFf3gtD9frzKTg==} + /@msgpack/msgpack/2.6.1: + resolution: {integrity: sha512-YSXpFq3n+xHYNefgg9my/wWjZ0nWNxdfYVGpOi5d7sE2xHtNNL8z+V+/eiC1SYCh884w7z6JoDBWGLreR2a45w==} engines: {node: '>= 10'} dev: true @@ -3192,8 +3205,8 @@ packages: irregular-plurals: 3.3.0 dev: true - /pnpm/6.2.3: - resolution: {integrity: sha512-qYRrxYyN14tqeMGu7E3P+INXDiYbGojn5mitVfUxidO9OsSnTGSqT85nkslfKW8YfChlzFVN0XdG+1Tj86tKhA==} + /pnpm/6.2.5: + resolution: {integrity: sha512-klFrPM3JDo+LFA2f7Ih3wnH296ZDDqfFx5BCc3ADZV6zRQFscEL8XIU8jDqsHFv7EZHLP9Z12fzY/HyHca/duw==} engines: {node: '>=12.17'} hasBin: true dev: true diff --git a/tests/common.ts b/tests/common.ts index 1be5e9b3..e69de29b 100644 --- a/tests/common.ts +++ b/tests/common.ts @@ -1 +0,0 @@ -export const delay = ms => new Promise(r => setTimeout(r, ms)); diff --git a/tests/package.json b/tests/package.json index 1679204e..fa2ed32e 100644 --- a/tests/package.json +++ b/tests/package.json @@ -20,15 +20,18 @@ }, "devDependencies": { "@ctx-core/combinators": "^6.0.10", - "@ctx-core/store": "^24.7.5", + "@ctx-core/store": "^24.7.9", "@holochain/conductor-api": "0.0.4", - "@holochain/tryorama": "0.4.3", + "@holochain/tryorama": "0.4.2", "@syn-ui/model": "workspace:^1.0.0", "@syn-ui/utils": "workspace:^1.0.0", "@syn-ui/zome-client": "workspace:^1.0.0", "@types/lodash": "^4.14.168", "@types/node": "^15.0.1", "ava": "^3.15.0", - "pnpm": "^6.2.3" - } + "pnpm": "^6.2.5" + }, + "noUpdate": [ + "@holochain/tryorama" + ] } \ No newline at end of file diff --git a/tests/unit-test/syn.ts b/tests/unit-test/syn.ts index 3517489c..3eca4f2f 100644 --- a/tests/unit-test/syn.ts +++ b/tests/unit-test/syn.ts @@ -5,15 +5,17 @@ import { noop, promise_timeout } from '@ctx-core/function' import { assign } from '@ctx-core/object' import { I } from '@ctx-core/combinators' import { Readable$, subscribe_wait_timeout, writable$ } from '@ctx-core/store' -import { bufferToBase64, console_b, EntryHash } from '@syn-ui/utils' +import { _caller_line, bufferToBase64, console_b } from '@syn-ui/utils' import { - content_b, apply_deltas_b, session_info_b, join_session, leave_session, content_hash_b + content_b, session_info_b, join_session, leave_session, content_hash_b, sessions_b, commit_change_b, + current_commit_header_hash_b, request_change_b, recorded_changes_b, committed_changes_b, folks_b, + getFolkColors } from '@syn-ui/model' import { - Commit, Delta, my_tag_b, rpc_commit_b, rpc_get_content_b, rpc_get_folks_b, rpc_get_session_b, - rpc_get_sessions_b, rpc_hash_content_b, rpc_send_change_b, rpc_send_change_request_b, rpc_send_folk_lore_b, - rpc_send_heartbeat_b, rpc_send_sync_request_b, rpc_send_sync_response_b, Signal, StateForSync + Delta, my_tag_b, rpc_get_content_b, rpc_get_folks_b, rpc_get_session_b, rpc_hash_content_b, + rpc_send_heartbeat_b, rpc_send_sync_request_b, Signal } from '@syn-ui/zome-client' +import { delay } from '@holochain/tryorama/lib/util' const config = Config.gen() @@ -53,8 +55,7 @@ module.exports = (orchestrator)=>{ const bob_pubkey = bob.cellId[1] const bob_pubkey_base64 = bufferToBase64(bob_pubkey) - let sessions:EntryHash[] = await me.call('syn', 'get_sessions') - t.equal(sessions.length, 0) + t.equal((await me.call('syn', 'get_sessions')).length, 0, _caller_line()) const me_port:number = parseInt(me_player._conductor.appClient.client.socket.url.split(':')[2]) const alice_port:number = parseInt(alice_player._conductor.appClient.client.socket.url.split(':')[2]) const bob_port:number = parseInt(bob_player._conductor.appClient.client.socket.url.split(':')[2]) @@ -69,40 +70,43 @@ module.exports = (orchestrator)=>{ await join_session({ app_port: me_port, app_id: me_happ.hAppId, ctx: me_ctx }) try { - t.deepEqual(await rpc_get_folks_b(me_ctx)(), [me_pubkey]) + t.deepEqual(await rpc_get_folks_b(me_ctx)(), [me_pubkey], _caller_line()) await subscribe_wait_timeout(session_info_b(me_ctx), I, 10_000) // I created the session, so I should be the scribe - t.deepEqual(session_info_b(me_ctx).$!.scribe, me_pubkey) + t.deepEqual(session_info_b(me_ctx).$!.scribe, me_pubkey, _caller_line()) // First ever session so content should be default content - t.deepEqual(session_info_b(me_ctx).$!.snapshot_content, { title: '', body: '' }) + t.deepEqual(session_info_b(me_ctx).$!.snapshot_content, { title: '', body: '' }, _caller_line()) let session_hash = session_info_b(me_ctx).$!.session // check the hash_content zome call. - let content_hash = await rpc_hash_content_b(me_ctx)(session_info_b(me_ctx).$!.snapshot_content) - t.deepEqual(session_info_b(me_ctx).$!.content_hash, content_hash) + t.deepEqual( + session_info_b(me_ctx).$!.content_hash, + await rpc_hash_content_b(me_ctx)(session_info_b(me_ctx).$!.snapshot_content), + _caller_line() + ) // check get_sessions utility zome call - sessions = await rpc_get_sessions_b(me_ctx)() - t.equal(sessions.length, 1) - t.deepEqual(sessions[0], session_hash) + const me_sessions = sessions_b(me_ctx) + t.equal(me_sessions.$!.length, 1, _caller_line()) + t.deepEqual(me_sessions.$![0], session_hash, _caller_line()) // exercise the get_session zome call - const session_info = await rpc_get_session_b(me_ctx)(session_hash) - t.equal(sessions.length, 1) - t.deepEqual(session_info_b(me_ctx).$, session_info) + t.equal(me_sessions.$!.length, 1, _caller_line()) + t.deepEqual(session_info_b(me_ctx).$, await rpc_get_session_b(me_ctx)(session_hash), _caller_line()) // check that initial snapshot was created by using the get_content zome call t.deepEqual( session_info_b(me_ctx).$!.snapshot_content, - await rpc_get_content_b(me_ctx)(session_info_b(me_ctx).$!.content_hash) + await rpc_get_content_b(me_ctx)(session_info_b(me_ctx).$!.content_hash), + _caller_line() ) // set up the pending deltas array let pending_deltas:Delta[] = [{ type: 'Title', value: 'foo title' }, { type: 'Add', value: [0, 'bar content'] }] - await apply_deltas_b(me_ctx)(pending_deltas) + await request_change_b(me_ctx)(pending_deltas) const me_content = content_b(me_ctx) - content_hash = await rpc_hash_content_b(me_ctx)(me_content.$) + let content_hash = await rpc_hash_content_b(me_ctx)(me_content.$) let deltas = jsonDeltas ? pending_deltas.map(d=>JSON.stringify(d)) : pending_deltas @@ -137,22 +141,9 @@ module.exports = (orchestrator)=>{ }) // add a content change - let commit:Commit = { - snapshot: session_info_b(me_ctx).$!.content_hash!, - change: { - deltas: deltas, - content_hash: content_hash, - previous_change: session_info_b(me_ctx).$!.content_hash!, // this is the first change so same content_hash as snapshot - meta: { - contributors: [], - witnesses: [], - app_specific: null - } - }, - participants: [] - } - let commit_header_hash = await rpc_commit_b(me_ctx)(commit) - t.equal(commit_header_hash.length, 39) // is a content_hash + await commit_change_b(me_ctx)() + t.equal(current_commit_header_hash_b(me_ctx).$!.length, 39, _caller_line()) // is a content_hash + t.deepEqual(recorded_changes_b(me_ctx).$, [], _caller_line()) // add a second content change pending_deltas = [ @@ -162,247 +153,300 @@ module.exports = (orchestrator)=>{ { type: 'Delete', value: [4, 11] }, // 'baz new' { type: 'Add', value: [4, 'monkey'] }, // 'baz monkey new' ] - await apply_deltas_b(me_ctx)(pending_deltas) - const new_content_hash_2 = await rpc_hash_content_b(me_ctx)(me_content.$) + const new_content_hash_2 = (await promise_timeout(async ()=>{ + const $current_commit_header_hash = current_commit_header_hash_b(me_ctx).$! + for (; ;) { + if (current_commit_header_hash_b(me_ctx).$! === $current_commit_header_hash) return + await delay(0) + } + }, 500))! deltas = jsonDeltas ? pending_deltas.map(d=>JSON.stringify(d)) : pending_deltas - commit = { - snapshot: session_info_b(me_ctx).$!.content_hash!, - change: { - deltas, - content_hash: new_content_hash_2, - previous_change: content_hash, // this is the second change so previous commit's content_hash - meta: { - contributors: [], - witnesses: [], - app_specific: null - } - }, - participants: [] - } - commit_header_hash = await rpc_commit_b(me_ctx)(commit) + await request_change_b(me_ctx)(pending_deltas) + t.deepEqual(recorded_changes_b(me_ctx).$, [ + { delta: { type: 'Delete', value: [0, 3] }, deleted: 'bar' }, + { delta: { type: 'Add', value: [0, 'baz'] } }, + { delta: { type: 'Add', value: [11, ' new'] } }, // 'baz content new' + { delta: { type: 'Delete', value: [4, 11] }, deleted: 'content' }, // 'baz new' + { delta: { type: 'Add', value: [4, 'monkey'] } }, // 'baz monkey new' + ], _caller_line()) + + await commit_change_b(me_ctx)() // clear the pending_deltas pending_deltas = [] // check that deltas and snapshot content returned add up to the current real content let me_SyncResp_stack:Signal[], alice_SyncResp_stack:Signal[], me_SyncReq_stack:Signal[] - // alice joins session - [alice_SyncResp_stack] = await waitfor_filtered_signals_change(async ()=>{ - [me_SyncReq_stack] = await waitfor_filtered_signals_change(()=> - join_session({ - app_port: alice_port, - app_id: alice_happ.hAppId, - ctx: alice_ctx - }), - // rpc_send_sync_request_b(alice_ctx)(me_pubkey), - [me_signals], - $signals=>filter_signal_name($signals, 'SyncReq') - ) - }, - [alice_signals], - $signals=>filter_signal_name($signals, 'SyncResp') + t.deepEqual( + me_content.$, + { title: 'foo title', body: 'baz monkey new', meta: { [my_tag_b(me_ctx).$]: 0 } }, // content after two commits + _caller_line() ) + let alice_FolkLore_stack:Signal[] + // alice joins session + ;[ + [me_SyncReq_stack], + [alice_FolkLore_stack], + [alice_SyncResp_stack] + ] = await waitfor_filtered_signals_change(async ()=> + join_session({ + app_port: alice_port, + app_id: alice_happ.hAppId, + ctx: alice_ctx + }), + [ + [[me_signals], $signals=>filter_signal_name($signals, 'SyncReq')], + [[alice_signals], $signals=>filter_signal_name($signals, 'FolkLore')], + [[alice_signals], $signals=>filter_signal_name($signals, 'SyncResp')] + ] + ) + await promise_timeout(async ()=>{ + for (; ;) { + if ( + isDeepStrictEqual(await rpc_get_folks_b(me_ctx)(), [me_pubkey, alice_pubkey]) + ) return + await delay(0) + } + }, 500) await promise_timeout(async ()=>{ - while (!isDeepStrictEqual( - await rpc_get_folks_b(me_ctx)(), - [me_pubkey, alice_pubkey])) {} + for (; ;) { + if ( + isDeepStrictEqual( + await rpc_get_folks_b(alice_ctx)(), [me_pubkey, alice_pubkey]) + ) return + await delay(0) + } }, 500) - t.deepEqual(await rpc_get_folks_b(me_ctx)(), [me_pubkey, alice_pubkey]) + t.deepEqual(await rpc_get_folks_b(me_ctx)(), [me_pubkey, alice_pubkey], _caller_line()) const alice_session_info = session_info_b(alice_ctx) const alice_content = content_b(alice_ctx) // alice should get my session - t.deepEqual(alice_session_info.$!.session, session_hash) - t.deepEqual(alice_session_info.$!.scribe, me_pubkey) - t.deepEqual(alice_session_info.$!.snapshot_content, { title: '', body: '' }) - t.deepEqual( - me_content.$, - { title: 'foo title', body: 'baz monkey new', meta: { [my_tag_b(me_ctx).$]: 0 } } // content after two commits - ) + t.deepEqual(alice_session_info.$!.session, session_hash, _caller_line()) + t.deepEqual(alice_session_info.$!.scribe, me_pubkey, _caller_line()) + t.deepEqual(alice_session_info.$!.snapshot_content, { title: '', body: '' }, _caller_line()) + await promise_timeout(async ()=>{ + for (; ;) { + if ( + isDeepStrictEqual(alice_session_info.$!.deltas, [ + '{"type":"Title","value":"foo title"}', + '{"type":"Add","value":[0,"bar content"]}', + '{"type":"Delete","value":[0,3]}', + '{"type":"Add","value":[0,"baz"]}', + '{"type":"Add","value":[11," new"]}', + '{"type":"Delete","value":[4,11]}', + '{"type":"Add","value":[4,"monkey"]}' + ]) + ) return + await delay(0) + } + }, 1000) + await subscribe_wait_timeout( alice_content, - $alice_content=> - isDeepStrictEqual( + $alice_content=>{ + return isDeepStrictEqual( $alice_content, - { title: 'foo title', body: 'baz monkey new', meta: { [my_tag_b(alice_ctx).$]: 0 } }), + { title: 'foo title', body: 'baz monkey new', meta: { [my_tag_b(alice_ctx).$]: 0 } }) + }, 1000 ) await leave_session({ ctx: alice_ctx }) - ;[alice_SyncResp_stack] = await waitfor_filtered_signals_change(async ()=>{ - [me_SyncReq_stack] = await waitfor_filtered_signals_change(()=> - join_session({ - app_port: alice_port, - app_id: alice_happ.hAppId, - ctx: alice_ctx - }), - // rpc_send_sync_request_b(alice_ctx)(me_pubkey), - [me_signals], - $signals=>filter_signal_name($signals, 'SyncReq') - ) - }, - [alice_signals], - $signals=>filter_signal_name($signals, 'SyncResp') - ) + ;[ + [me_SyncReq_stack], + [alice_SyncResp_stack], + ] = await waitfor_filtered_signals_change(async ()=> + join_session({ + app_port: alice_port, + app_id: alice_happ.hAppId, + ctx: alice_ctx + }), + [ + [[me_signals], $signals=>filter_signal_name($signals, 'SyncReq')], + [[alice_signals], $signals=>filter_signal_name($signals, 'SyncResp')], + ]) t.deepEqual( alice_content.$, - { title: 'foo title', body: 'baz monkey new', meta: { [my_tag_b(alice_ctx).$]: 0 } } // content after two commits + { title: 'foo title', body: 'baz monkey new', meta: { [my_tag_b(alice_ctx).$]: 0 } },// content after two commits + _caller_line() ) // confirm that the session_info_b(me_ctx)'s content content_hash matches the content_hash // generated by applying deltas content_hash = await rpc_hash_content_b(alice_ctx)(content_b(alice_ctx).$) const alice_content_hash = content_hash_b(alice_ctx) - t.deepEqual(alice_content_hash.$, content_hash) + t.deepEqual(alice_content_hash.$, content_hash, _caller_line()) // I should receive alice's request for the state as she joins the session - t.deepEqual(me_SyncReq_stack![0], { signal_name: 'SyncReq', signal_payload: alice_pubkey }) + t.deepEqual(me_SyncReq_stack![0], { signal_name: 'SyncReq', signal_payload: alice_pubkey }, _caller_line()) // I add some pending deltas which I will then need to send to Alice as part of her Joining. pending_deltas = [{ type: 'Title', value: 'I haven\'t committed yet' }, { type: 'Add', value: [14, '\nBut made a new line! 🍑'] }] deltas = jsonDeltas ? pending_deltas.map(d=>JSON.stringify(d)) : pending_deltas - const state:StateForSync = { - snapshot: session_info_b(me_ctx).$!.content_hash!, - commit: commit_header_hash, - commit_content_hash: new_content_hash_2, - deltas: pending_deltas, - }; - [alice_SyncResp_stack] = await waitfor_filtered_signals_change(async ()=> - rpc_send_sync_response_b(me_ctx)({ - participant: alice_pubkey, - state, - }), - [alice_signals], - $alice_signals=>filter_signal_name($alice_signals, 'SyncResp') - ) + let alice_Change_stack:Signal[] + let me_index = _index(me_ctx) + ;[[alice_Change_stack]] = await waitfor_filtered_signals_change(async ()=> + request_change_b(me_ctx)(pending_deltas), + [ + [[alice_signals], $alice_signals=>filter_signal_name($alice_signals, 'Change')] + ]) // Alice should have received uncommitted deltas - t.equal(alice_SyncResp_stack[0].signal_name, 'SyncResp') - let receivedState = alice_SyncResp_stack[0].signal_payload - t.deepEqual(receivedState, { ...state, deltas: pending_deltas.map(d=>JSON.stringify(d)) }) // deltas, commit, and snapshot match + t.equal(alice_Change_stack[0].signal_name, 'Change', _caller_line()) + t.deepEqual(alice_Change_stack[0].signal_payload[0], me_index, _caller_line()) // deltas, commit, and snapshot match + t.deepEqual(alice_Change_stack[0].signal_payload[1], pending_deltas.map(d=>JSON.stringify(d)), _caller_line()) // deltas, commit, and snapshot match - await join_session({ app_port: bob_port, app_id: bob_happ.hAppId, ctx: bob_ctx }) - // bob joins session - const bob_$session_info = session_info_b(bob_ctx).$! - // const bob_$session_info = await rpc_get_session_b(bob_ctx)(session_hash) - // bob should get my session - t.deepEqual(bob_$session_info.scribe, me_pubkey) - await rpc_send_sync_request_b(bob_ctx)(me_pubkey) - - t.deepEqual(me_signals.$.map(ms=>ms.signal_name), ['SyncReq', 'SyncReq', 'SyncReq']) + t.deepEqual(me_signals.$.map(ms=>ms.signal_name), ['SyncReq', 'SyncReq'], _caller_line()) // alice sends me a change req and I should receive it const alice_delta:Delta = { type: 'Title', value: 'Alice in Wonderland' } let delta = jsonDeltas ? JSON.stringify(alice_delta) : alice_delta - let [me_ChangeReq_stack] = await waitfor_filtered_signals_change(async ()=> - rpc_send_change_request_b(alice_ctx)({ - scribe: alice_session_info.$!.scribe, - index: 1, - deltas: [alice_delta] + let alice_index = _index(alice_ctx) + let [[me_ChangeReq_stack]] = await waitfor_filtered_signals_change(async ()=> + request_change_b(alice_ctx)([alice_delta]), + [[[me_signals], $signals=>filter_signal_name($signals, 'ChangeReq')]] + ) + t.deepEqual(me_ChangeReq_stack[0].signal_name, 'ChangeReq', _caller_line()) + t.equal(me_ChangeReq_stack[0].signal_payload[0], alice_index, _caller_line()) + const receiveDelta = jsonDeltas ? JSON.parse(me_ChangeReq_stack[0].signal_payload[1]) : me_ChangeReq_stack[0].signal_payload[1] + t.deepEqual(receiveDelta, alice_delta, _caller_line()) // delta_matches + + let alice_SyncReq_stack:Signal[], bob_SyncResp_stack:Signal[], bob_FolkLore_stack:Signal[] + ;[ + [me_SyncReq_stack], + [alice_FolkLore_stack, bob_FolkLore_stack], + [bob_SyncResp_stack] + ] = await waitfor_filtered_signals_change(async ()=> + join_session({ + app_port: bob_port, + app_id: bob_happ.hAppId, + ctx: bob_ctx }), - [me_signals], - $me_signals=> - filter_signal_name($me_signals, 'ChangeReq') + [ + [[me_signals], $signals=>filter_signal_name($signals, 'SyncReq')], + [[alice_signals, bob_signals], $signals=>filter_signal_name($signals, 'FolkLore')], + [[bob_signals], $signals=>filter_signal_name($signals, 'SyncResp')] + ] ) - t.deepEqual(me_ChangeReq_stack[0].signal_name, 'ChangeReq') - const [sig_index, sig_delta] = me_ChangeReq_stack[0].signal_payload - t.equal(sig_index, 1) - const receiveDelta = jsonDeltas ? JSON.parse(sig_delta) : sig_delta - t.deepEqual(receiveDelta, alice_delta) // delta_matches + + // bob joins session + const bob_$session_info = session_info_b(bob_ctx).$! + // const bob_$session_info = await rpc_get_session_b(bob_ctx)(session_hash) + // bob should get my session + t.deepEqual(bob_$session_info.scribe, me_pubkey, _caller_line()) + await promise_timeout(async ()=>{ + for (; ;) { + if ( + isDeepStrictEqual(folks_b(me_ctx).$[alice_pubkey_base64]?.pubKey, alice_pubkey) + && isDeepStrictEqual(folks_b(me_ctx).$[bob_pubkey_base64]?.pubKey, bob_pubkey) + ) return + await delay(0) + } + }, 1000) + await promise_timeout(async ()=>{ + for (; ;) { + if ( + isDeepStrictEqual(folks_b(alice_ctx).$[alice_pubkey_base64]?.pubKey, alice_pubkey) + && isDeepStrictEqual(folks_b(alice_ctx).$[bob_pubkey_base64]?.pubKey, bob_pubkey) + ) return + await delay(0) + } + }, 1000) + await promise_timeout(async ()=>{ + for (; ;) { + if ( + isDeepStrictEqual(folks_b(bob_ctx).$[alice_pubkey_base64]?.pubKey, alice_pubkey) + && isDeepStrictEqual(folks_b(bob_ctx).$[bob_pubkey_base64]?.pubKey, bob_pubkey) + ) return + await delay(0) + } + }, 1000) + t.deepEqual(folks_b(me_ctx).$[alice_pubkey_base64].pubKey, alice_pubkey, _caller_line()) + t.deepEqual(folks_b(me_ctx).$[alice_pubkey_base64].colors, getFolkColors(alice_pubkey), _caller_line()) + t.deepEqual(folks_b(me_ctx).$[alice_pubkey_base64].inSession, true, _caller_line()) + t.ok(folks_b(me_ctx).$[alice_pubkey_base64].lastSeen! <= Date.now(), _caller_line()) + t.deepEqual(folks_b(me_ctx).$[bob_pubkey_base64].pubKey, bob_pubkey, _caller_line()) + t.deepEqual(folks_b(me_ctx).$[bob_pubkey_base64].colors, getFolkColors(bob_pubkey), _caller_line()) + t.deepEqual(folks_b(me_ctx).$[bob_pubkey_base64].inSession, true, _caller_line()) + t.ok(folks_b(me_ctx).$[bob_pubkey_base64].lastSeen! <= Date.now(), _caller_line()) + t.deepEqual(folks_b(alice_ctx).$[alice_pubkey_base64].pubKey, alice_pubkey, _caller_line()) + t.deepEqual(folks_b(alice_ctx).$[alice_pubkey_base64].colors, getFolkColors(alice_pubkey), _caller_line()) + t.deepEqual(folks_b(alice_ctx).$[bob_pubkey_base64].pubKey, bob_pubkey, _caller_line()) + t.deepEqual(folks_b(alice_ctx).$[bob_pubkey_base64].colors, getFolkColors(bob_pubkey), _caller_line()) + t.deepEqual(folks_b(bob_ctx).$[alice_pubkey_base64].pubKey, alice_pubkey, _caller_line()) + t.deepEqual(folks_b(bob_ctx).$[alice_pubkey_base64].colors, getFolkColors(alice_pubkey), _caller_line()) + t.deepEqual(folks_b(bob_ctx).$[bob_pubkey_base64].pubKey, bob_pubkey, _caller_line()) + t.deepEqual(folks_b(bob_ctx).$[bob_pubkey_base64].colors, getFolkColors(bob_pubkey), _caller_line()) + + t.equal(alice_FolkLore_stack[0].signal_name, 'FolkLore', _caller_line()) + t.equal(bob_FolkLore_stack[0].signal_name, 'FolkLore', _caller_line()) + ;(()=>{ + const alice_signal = JSON.parse(alice_FolkLore_stack[0].signal_payload) + t.deepEqual(alice_signal.participants[alice_pubkey_base64].pubKey, alice_pubkey_base64, _caller_line()) + t.deepEqual(alice_signal.participants[bob_pubkey_base64].pubKey, bob_pubkey_base64, _caller_line()) + })() + ;(()=>{ + const bob_signal = JSON.parse(bob_FolkLore_stack[0].signal_payload) + t.deepEqual(bob_signal.participants[alice_pubkey_base64].pubKey, alice_pubkey_base64, _caller_line()) + t.deepEqual(bob_signal.participants[bob_pubkey_base64].pubKey, bob_pubkey_base64, _caller_line()) + })() let my_deltas:Delta[] = [{ type: 'Add', value: [0, 'Whoops!\n'] }, { type: 'Title', value: 'Alice in Wonderland' }] deltas = jsonDeltas ? my_deltas.map(d=>JSON.stringify(d)) : deltas + let bob_Change_stack:Signal[] // I send a change, and alice and bob should receive it. - let [alice_Change_stack, bob_Change_stack] = await waitfor_filtered_signals_change(async ()=> - rpc_send_change_b(me_ctx)({ - participants: [alice_pubkey, bob_pubkey], - index: 2, - deltas: my_deltas, - }), - [alice_signals, bob_signals], - $signals=>filter_signal_name($signals, 'Change') + me_index = _index(me_ctx) + ;[[alice_Change_stack, bob_Change_stack]] = await waitfor_filtered_signals_change(async ()=> + request_change_b(me_ctx)(my_deltas), + [ + [[alice_signals, bob_signals], $signals=>filter_signal_name($signals, 'Change')] + ] ) - let a_sig = alice_Change_stack[0] - let b_sig = bob_Change_stack[0] - t.equal(a_sig.signal_name, 'Change') - t.equal(b_sig.signal_name, 'Change') - t.deepEqual(a_sig.signal_payload, [2, deltas]) // delta_matches - t.deepEqual(b_sig.signal_payload, [2, deltas]) // delta_matches - - let [me_Heartbeat] = await waitfor_filtered_signals_change(async ()=> + t.equal(alice_Change_stack[0].signal_name, 'Change', _caller_line()) + t.equal(bob_Change_stack[0].signal_name, 'Change', _caller_line()) + t.deepEqual(alice_Change_stack[0].signal_payload[0], me_index, _caller_line()) // delta_matches + t.deepEqual(alice_Change_stack[0].signal_payload[1], deltas, _caller_line()) // delta_matches + t.deepEqual(bob_Change_stack[0].signal_payload[0], me_index, _caller_line()) // delta_matches + t.deepEqual(bob_Change_stack[0].signal_payload[1], deltas, _caller_line()) // delta_matches + + let me_Heartbeat:Signal[] + ;[[me_Heartbeat]] = await waitfor_filtered_signals_change(async ()=> rpc_send_heartbeat_b(alice_ctx)({ scribe: me_pubkey, data: 'Hello' }), - [me_signals], - $signals=>filter_signal_name($signals, 'Heartbeat') + [[[me_signals], $signals=>filter_signal_name($signals, 'Heartbeat')]] ) let me_sig = me_Heartbeat[0] - t.equal(me_sig.signal_name, 'Heartbeat') - t.deepEqual(me_sig.signal_payload[1], 'Hello') - t.deepEqual(me_sig.signal_payload[0], alice_pubkey) - - let [alice_FolkLore, bob_FolkLore] = await waitfor_filtered_signals_change(async ()=> - rpc_send_folk_lore_b(me_ctx)({ - participants: [alice_pubkey, bob_pubkey], - data: { - participants: { - [alice_pubkey]: { - pubKey: alice_pubkey - }, - [bob_pubkey]: { - pubKey: bob_pubkey - }, - } - } - }), - [alice_signals, bob_signals], - $signals=>filter_signal_name($signals, 'FolkLore') - ) - a_sig = alice_FolkLore[0] - b_sig = bob_FolkLore[0] - t.equal(a_sig.signal_name, 'FolkLore') - t.equal(b_sig.signal_name, 'FolkLore') - t.deepEqual(a_sig.signal_payload, JSON.stringify({ - participants: { - [alice_pubkey]: { - pubKey: alice_pubkey_base64 - }, - [bob_pubkey]: { - pubKey: bob_pubkey_base64 - }, - } - })) - t.deepEqual(b_sig.signal_payload, JSON.stringify({ - participants: { - [alice_pubkey]: { - pubKey: alice_pubkey_base64 - }, - [bob_pubkey]: { - pubKey: bob_pubkey_base64 - }, - } - })) + t.equal(me_sig.signal_name, 'Heartbeat', _caller_line()) + t.deepEqual(me_sig.signal_payload[1], 'Hello', _caller_line()) + t.deepEqual(me_sig.signal_payload[0], alice_pubkey, _caller_line()) // alice asks for a sync request - let [me_SyncReq] = await waitfor_filtered_signals_change(async ()=> + let me_SyncReq:Signal[] + ;[[me_SyncReq]] = await waitfor_filtered_signals_change(async ()=> rpc_send_sync_request_b(alice_ctx)(me_pubkey), - [me_signals], - $signals=>filter_signal_name($signals, 'SyncReq') + [[[me_signals], $signals=>filter_signal_name($signals, 'SyncReq')]] ) - me_sig = me_SyncReq[0] - t.equal(me_sig.signal_name, 'SyncReq') + t.equal(me_SyncReq[0].signal_name, 'SyncReq', _caller_line()) // confirm that all agents got added to the folks anchor // TODO figure out why init doesn't happen immediately. await promise_timeout(async ()=>{ - while (!isDeepStrictEqual( - await rpc_get_folks_b(me_ctx)(), - [me_pubkey, alice_pubkey, bob_pubkey])) {} + for (; ;) { + if ( + isDeepStrictEqual( + await rpc_get_folks_b(me_ctx)(), + [me_pubkey, alice_pubkey, bob_pubkey]) + ) return + await delay(0) + } }, 500) /**/ } finally { + console.debug('finally|leave_session') await leave_session({ ctx: me_ctx }) await leave_session({ ctx: alice_ctx }) await leave_session({ ctx: bob_ctx }) @@ -410,28 +454,37 @@ module.exports = (orchestrator)=>{ function filter_signal_name($signals:Signal[], signal_name:string) { return $signals.filter(s=>s.signal_name === signal_name) } + function _index(ctx) { + return committed_changes_b(ctx).$.length + recorded_changes_b(ctx).$.length + } async function waitfor_filtered_signals_change( fn:()=>Promise<any>, - signals_a1:Readable$<Signal[]>[], - _filtered_signals:($signals:Signal[])=>Signal[], + script_a1:[Readable$<Signal[]>[], ($signals:Signal[])=>Signal[]][], timeout = 1000, err = new Error() ) { - const filtered_signals_a1 = signals_a1.map(signals=>_filtered_signals(signals.$)) + const filtered_signals_a2 = script_a1.map(script=>{ + const [signals_a1, _filtered_signals] = script + return signals_a1.map(signals=>_filtered_signals(signals.$)) + }) await fn() - try { - await Promise.all(signals_a1.map((signals, idx)=> - subscribe_wait_timeout(signals, - $signals=>{ - return _filtered_signals($signals).length > filtered_signals_a1[idx].length - }, timeout) - )) - return signals_a1.map(signals=>_filtered_signals(signals.$).reverse()) - } catch (e) { - err.message = e.message - throw err - return [] - } + return await Promise.all( + script_a1.map(async (script, script_idx)=>{ + try { + const [signals_a1, _filtered_signals] = script + await Promise.all(signals_a1.map((signals, idx)=> + subscribe_wait_timeout(signals, + $signals=>{ + return _filtered_signals($signals).length > filtered_signals_a2[script_idx][idx].length + }, timeout) + )) + return signals_a1.map(signals=>_filtered_signals(signals.$).reverse()) + } catch (e) { + err.message = e.message + throw err + } + }) + ) } }) } diff --git a/ui/apps/app/package.json b/ui/apps/app/package.json index 20783215..fa2607c0 100644 --- a/ui/apps/app/package.json +++ b/ui/apps/app/package.json @@ -15,7 +15,7 @@ }, "devDependencies": { "@ctx-core/object": "^17.5.17", - "@ctx-core/store": "^24.7.5", + "@ctx-core/store": "^24.7.9", "@rollup/plugin-commonjs": "^18.0.0", "@rollup/plugin-node-resolve": "^11.2.1", "@rollup/plugin-replace": "^2.4.2", diff --git a/ui/apps/app/src/App.svelte b/ui/apps/app/src/App.svelte index e50bc220..7b746711 100644 --- a/ui/apps/app/src/App.svelte +++ b/ui/apps/app/src/App.svelte @@ -1,14 +1,15 @@ <script lang="ts"> import { setContext } from 'svelte' import { request_change_b, session_info_scribe_str_b } from '@syn-ui/model' - import type { apply_delta_ret_T } from '@syn-ui/model' - import type { AddDelta, Content, DeleteDelta, Delta, MetaDelta, TitleDelta } from '@syn-ui/zome-client' + import type { Delta } from '@syn-ui/zome-client' import Editor from './Editor.svelte' - import Title from './Title.svelte' + import type { Title_I } from './Title_I' + import in_Title from './Title.svelte' import Folks from './Folks.svelte' import Syn from './Syn.svelte' import Debug from './Debug.svelte' import History from './History.svelte' + const Title:Title_I = in_Title let ctx = {} window.ctx = ctx @@ -130,12 +131,12 @@ <div class='toolbar'> <h1>SynText</h1> <div class:noscribe> - <Title on:request_change={(event) => request_change(event.detail)}/> + <Title on:request_change={(event: CustomEvent<Delta[]>) => request_change(event.detail)}/> </div> </div> <main> <div class:noscribe> - <Editor on:request_change={(event) => request_change(event.detail)}/> + <Editor on:request_change={(event: CustomEvent<Delta[]>) => request_change(event.detail)}/> </div> diff --git a/ui/apps/app/src/Editor_I.ts b/ui/apps/app/src/Editor_I.ts new file mode 100644 index 00000000..6e4220b6 --- /dev/null +++ b/ui/apps/app/src/Editor_I.ts @@ -0,0 +1,5 @@ +import type { SvelteComponentTyped } from 'svelte' +import type { request_change_T } from './request_change_T' +export interface Editor_I extends SvelteComponentTyped<{}, { + request_change: request_change_T +}> {} diff --git a/ui/apps/app/src/Title.svelte b/ui/apps/app/src/Title.svelte index e1f37f17..7ff3a374 100644 --- a/ui/apps/app/src/Title.svelte +++ b/ui/apps/app/src/Title.svelte @@ -1,6 +1,7 @@ <script lang="ts"> import { createEventDispatcher, getContext, tick } from 'svelte' import { content_b } from '@syn-ui/model' + import type { Delta } from '@syn-ui/zome-client' const ctx = getContext('ctx') const dispatch = createEventDispatcher() const content = content_b(ctx) @@ -13,7 +14,7 @@ // only dispatch a changeReq if the title trying to be saved is different // than the current title if (titleBeingTyped !== $content.title) { - let delta = { type: 'Title', value: titleBeingTyped } + let delta:Delta = { type: 'Title', value: titleBeingTyped } dispatch('request_change', [delta]) } titleBeingTyped = '' diff --git a/ui/apps/app/src/Title_I.ts b/ui/apps/app/src/Title_I.ts new file mode 100644 index 00000000..9e4dbd3a --- /dev/null +++ b/ui/apps/app/src/Title_I.ts @@ -0,0 +1,5 @@ +import type { SvelteComponentTyped } from 'svelte' +import type { request_change_T } from './request_change_T' +export interface Title_I extends SvelteComponentTyped<{}, { + request_change: request_change_T +}> {} diff --git a/ui/apps/app/src/index.ts b/ui/apps/app/src/index.ts new file mode 100644 index 00000000..54b2bd36 --- /dev/null +++ b/ui/apps/app/src/index.ts @@ -0,0 +1,15 @@ +import 'svelte' +import App from './App.svelte' +import Debug from './Debug.svelte' +import Editor from './Editor.svelte' +import Folk from './Folk.svelte' +import Folks from './Folks.svelte' +import History from './History.svelte' +import HistoryEntry from './HistoryEntry.svelte' +import Syn from './Syn.svelte' +import Title from './Title.svelte' +export { + App, Debug, Editor, Folk, Folks, History, HistoryEntry, Syn, Title +} +export * from './Editor_I' +export * from './Title_I' diff --git a/ui/apps/app/src/request_change_T.ts b/ui/apps/app/src/request_change_T.ts new file mode 100644 index 00000000..e20b4c94 --- /dev/null +++ b/ui/apps/app/src/request_change_T.ts @@ -0,0 +1,2 @@ +import type { Delta } from '@syn-ui/zome-client' +export type request_change_T = CustomEvent<Delta[]> diff --git a/ui/apps/headless/package.json b/ui/apps/headless/package.json index d3e9381c..29bc4768 100644 --- a/ui/apps/headless/package.json +++ b/ui/apps/headless/package.json @@ -14,7 +14,7 @@ }, "devDependencies": { "@ctx-core/object": "^17.5.17", - "@ctx-core/store": "^24.7.5", + "@ctx-core/store": "^24.7.9", "@rollup/plugin-commonjs": "^18.0.0", "@rollup/plugin-node-resolve": "^11.2.1", "@rollup/plugin-replace": "^2.4.2", diff --git a/ui/libs/model/package.json b/ui/libs/model/package.json index 80c902d9..7f80f4e8 100644 --- a/ui/libs/model/package.json +++ b/ui/libs/model/package.json @@ -8,7 +8,7 @@ "devDependencies": { "@ctx-core/combinators": "^6.0.10", "@ctx-core/object": "^17.5.17", - "@ctx-core/store": "^24.7.5", + "@ctx-core/store": "^24.7.9", "@holochain/conductor-api": "0.0.4", "@syn-ui/utils": "workspace:^1.0.0", "@syn-ui/zome-client": "workspace:^1.0.0", diff --git a/ui/libs/model/src/content/content_b.ts b/ui/libs/model/src/content/content_b.ts index 9d746275..23e7ee9a 100644 --- a/ui/libs/model/src/content/content_b.ts +++ b/ui/libs/model/src/content/content_b.ts @@ -6,5 +6,5 @@ export const content_b = _b('content', ()=>{ return content }) export function _$content() { - return { title: '', body: '', meta: {} } + return { title: '', body: '', meta: {} } } diff --git a/ui/libs/model/src/delta/apply_deltas_b.ts b/ui/libs/model/src/delta/apply_deltas_b.ts index 50d3624b..3f13968b 100644 --- a/ui/libs/model/src/delta/apply_deltas_b.ts +++ b/ui/libs/model/src/delta/apply_deltas_b.ts @@ -1,7 +1,5 @@ import { _b } from '@ctx-core/object' -import { - Content, Delta, AddDelta, DeleteDelta, MetaDelta, TitleDelta, my_tag_b -} from '@syn-ui/zome-client' +import { Content, Delta, AddDelta, DeleteDelta, MetaDelta, TitleDelta, my_tag_b } from '@syn-ui/zome-client' import { content_b } from '../content' import { session_info_b, session_info_deltas_b } from '../session' import type { ApplyDelta } from './ApplyDelta' @@ -26,7 +24,8 @@ export const apply_deltas_b = _b('apply_deltas', (ctx)=>{ } content.$ = $content committed_changes.$ = [] - await apply_deltas(session_info_deltas.$ || []) + const undoable_changes = await apply_deltas(session_info_deltas.$ || []) + committed_changes.$ = undoable_changes }) return apply_deltas async function apply_deltas(deltas:Delta[]):Promise<ApplyDelta[]> { @@ -70,10 +69,6 @@ export const apply_deltas_b = _b('apply_deltas', (ctx)=>{ } } content.$ = $content - committed_changes.update($committed_changes=>{ - $committed_changes.push(...undoable_changes) - return $committed_changes - }) return undoable_changes } }) diff --git a/ui/libs/model/src/delta/commit_change_b.ts b/ui/libs/model/src/delta/commit_change_b.ts index 3b1c9489..3db7c57b 100644 --- a/ui/libs/model/src/delta/commit_change_b.ts +++ b/ui/libs/model/src/delta/commit_change_b.ts @@ -32,9 +32,13 @@ export const commit_change_b = _b('commit_change', (ctx)=>{ } } async function try_commit() { - const $recorded_changes = recorded_changes.$ - if ($recorded_changes.length == 0) { - alert('No changes to commit!') + if (recorded_changes.$.length == 0) { + const msg = 'No changes to commit!' + if (typeof window === 'undefined') { + console.info(msg) + } else { + window.alert(msg) + } return } commit_in_progress.$ = true @@ -46,7 +50,7 @@ export const commit_change_b = _b('commit_change', (ctx)=>{ const commit:Commit = { snapshot: session_info_snapshot_hash.$!, change: { - deltas: $recorded_changes.map(c=>JSON.stringify(c.delta)), + deltas: recorded_changes.$.map(c=>JSON.stringify(c.delta)), content_hash: new_content_hash, previous_change: content_hash.$!, meta: { @@ -58,17 +62,17 @@ export const commit_change_b = _b('commit_change', (ctx)=>{ participants: _scribe_signal_folk_pubKey_a1() } try { - const $current_commit_header_hash = await rpc_commit(commit) - current_commit_header_hash.$ = $current_commit_header_hash + current_commit_header_hash.$ = await rpc_commit(commit) // if commit successful we need to update the content hash and its string in the session content_hash.$ = new_content_hash committed_changes.update($committed_changes=>{ - $committed_changes.push(...$recorded_changes) + $committed_changes.push(...recorded_changes.$) return $committed_changes }) recorded_changes.$ = [] } catch (e) { - console.log('Error:', e) + console.trace('Error:', e) + throw e } } finally { commit_in_progress.$ = false diff --git a/ui/libs/model/src/delta/next_index_b.ts b/ui/libs/model/src/delta/next_index_b.ts index db24c4a6..89c3eb1e 100644 --- a/ui/libs/model/src/delta/next_index_b.ts +++ b/ui/libs/model/src/delta/next_index_b.ts @@ -1,10 +1,13 @@ import { derived$ } from '@ctx-core/store' import { _b } from '@ctx-core/object' import { recorded_changes_b } from './recorded_changes_b' +import { committed_changes_b } from './committed_changes_b' export const next_index_b = _b('next_index', (ctx)=>{ + const committed_changes = committed_changes_b(ctx) const recorded_changes = recorded_changes_b(ctx) return derived$( - recorded_changes, - $recorded_changes=>$recorded_changes.length + [committed_changes, recorded_changes], + ([$committed_changes, $recorded_changes])=> + $committed_changes.length + $recorded_changes.length ) }) diff --git a/ui/libs/model/src/delta/record_deltas_b.ts b/ui/libs/model/src/delta/record_deltas_b.ts index 742b3a32..76d8fcd0 100644 --- a/ui/libs/model/src/delta/record_deltas_b.ts +++ b/ui/libs/model/src/delta/record_deltas_b.ts @@ -7,8 +7,6 @@ import { apply_deltas_b } from './apply_deltas_b' export const record_deltas_b = _b('record_deltas', (ctx)=>{ const console = console_b(ctx) const requested_changes = requested_changes_b(ctx) - const apply_deltas = apply_deltas_b(ctx) - const recorded_changes = recorded_changes_b(ctx) return async function record_deltas(deltas:Delta[]) { const $requested_changes = requested_changes.$ console.log('record_deltas REQUESTED', $requested_changes) @@ -37,8 +35,10 @@ export const record_deltas_b = _b('record_deltas', (ctx)=>{ apply_deltas_a1.push(delta) } } + const apply_deltas = apply_deltas_b(ctx) const undoable_changes = await apply_deltas(apply_deltas_a1) // append changes to the recorded history + const recorded_changes = recorded_changes_b(ctx) recorded_changes.update($recorded_changes=>{ $recorded_changes.push(...undoable_changes) return $recorded_changes diff --git a/ui/libs/model/src/delta/request_change_b.ts b/ui/libs/model/src/delta/request_change_b.ts index 1058a2f3..a194f723 100644 --- a/ui/libs/model/src/delta/request_change_b.ts +++ b/ui/libs/model/src/delta/request_change_b.ts @@ -9,8 +9,6 @@ import { apply_deltas_b } from './apply_deltas_b' import { record_deltas_b } from './record_deltas_b' export const request_change_b = _b('request_change', (ctx)=>{ const console = console_b(ctx) - const record_deltas = record_deltas_b(ctx) - const request_changes = requested_changes_b(ctx) let request_counter = 0 return async function request_change(deltas:Delta[]) { // any requested made by the scribe should be recorded immediately @@ -18,6 +16,7 @@ export const request_change_b = _b('request_change', (ctx)=>{ const next_index = next_index_b(ctx) if (am_i_scribe.$ === true) { const $next_index = next_index.$ + const record_deltas = record_deltas_b(ctx) await record_deltas(deltas) const send_change = send_change_b(ctx) await send_change({ index: $next_index, deltas }) @@ -29,19 +28,21 @@ export const request_change_b = _b('request_change', (ctx)=>{ const my_tag = my_tag_b(ctx) const change_id = my_tag.$ + '.' + request_counter const change_at = Date.now() - const $requested_changes = request_changes.$ + const request_changes = requested_changes_b(ctx) // we want to apply this to current next_index plus any previously // requested changes that haven't yet be recorded - const index = next_index.$ + $requested_changes.length + const index = next_index.$ + request_changes.$.length const apply_deltas = apply_deltas_b(ctx) const undoable_changes = await apply_deltas(deltas) for (const undoable_change of undoable_changes) { undoable_change.id = change_id undoable_change.at = change_at } - $requested_changes.push(...undoable_changes) - request_changes.$ = $requested_changes - console.log('REQUESTED', $requested_changes) + request_changes.update($request_changes=>{ + $request_changes.push(...undoable_changes) + console.log('REQUESTED', $request_changes) + return $request_changes + }) const rpc_send_change_request = rpc_send_change_request_b(ctx) const scribe = session_info_scribe_b(ctx) await rpc_send_change_request({ diff --git a/ui/libs/model/src/session/current_commit_header_hash_b.ts b/ui/libs/model/src/session/current_commit_header_hash_b.ts index 2a4e5917..9f002ae2 100644 --- a/ui/libs/model/src/session/current_commit_header_hash_b.ts +++ b/ui/libs/model/src/session/current_commit_header_hash_b.ts @@ -2,5 +2,5 @@ import type { HoloHash } from '@holochain/conductor-api' import { _b } from '@ctx-core/object' import { writable$ } from '@ctx-core/store' export const current_commit_header_hash_b = _b('current_commit_header_hash', ()=> - writable$<HoloHash|null>(null) + writable$<undefined|HoloHash>(undefined) ) diff --git a/ui/libs/model/src/session/update_folks_b.ts b/ui/libs/model/src/session/update_folks_b.ts index e07b59e6..de7a3aba 100644 --- a/ui/libs/model/src/session/update_folks_b.ts +++ b/ui/libs/model/src/session/update_folks_b.ts @@ -6,19 +6,14 @@ import { } from '@syn-ui/zome-client' import { getFolkColors } from '../colors' import { folks_b } from './folks_b' -import { am_i_scribe_b } from './am_i_scribe_b' export const update_folks_b = _b('update_folks', (ctx)=>{ - const am_i_scribe = am_i_scribe_b(ctx) const folks = folks_b(ctx) return update_folks function update_folks(pubKey:AgentPubKey, status:FolkStatus, meta?:number) { const pubKeyStr = bufferToBase64(pubKey) - if (am_i_scribe.$) { - return - } // if we don't have this key, create a record for it // including the default color - const $folks = folks.$ as PubKeyToFolkRecord + const $folks = folks.$ _other($folks, pubKeyStr, pubKey) if (meta) { $folks[pubKeyStr]['meta'] = meta diff --git a/ui/libs/model/src/signals/Heartbeat_SignalOps_b.ts b/ui/libs/model/src/signals/Heartbeat_SignalOps_b.ts index 3ed540ea..e41af4a3 100644 --- a/ui/libs/model/src/signals/Heartbeat_SignalOps_b.ts +++ b/ui/libs/model/src/signals/Heartbeat_SignalOps_b.ts @@ -12,7 +12,7 @@ export const Heartbeat_SignalOps_b = _b<SignalOps>('Heartbeat_SignalOps', (ctx)= let [from, msg] = signal.data.payload.signal_payload console.log('got heartbeat', msg, 'from:', from) if (am_i_scribe.$ === true) { - // I am the scribe and I've recieved a heartbeat from a concerned Folk + // I am the scribe and I've received a heartbeat from a concerned Folk update_folks(from, FOLK_SEEN) } else { console.log(`heartbeat received but I'm not the scribe.`) diff --git a/ui/libs/model/src/signals/SyncReq_SignalOps_b.ts b/ui/libs/model/src/signals/SyncReq_SignalOps_b.ts index a24dd212..d9555cff 100644 --- a/ui/libs/model/src/signals/SyncReq_SignalOps_b.ts +++ b/ui/libs/model/src/signals/SyncReq_SignalOps_b.ts @@ -1,4 +1,4 @@ -import type { HoloHash } from '@holochain/conductor-api' +import type { AgentPubKey } from '@holochain/conductor-api' import { _b } from '@ctx-core/object' import { agent_pub_key_b, FOLK_SEEN, me_b, rpc_send_folk_lore_b, rpc_send_sync_response_b, StateForSync @@ -14,19 +14,18 @@ export const SyncReq_SignalOps_b = _b<SignalOps>('SyncReq_SignalOps', (ctx)=>{ const console = console_b(ctx) const me = me_b(ctx) const folks = folks_b(ctx) - const update_folks = update_folks_b(ctx) const rpc_send_sync_response = rpc_send_sync_response_b(ctx) const recorded_changes = recorded_changes_b(ctx) const content_hash = content_hash_b(ctx) const session_info_snapshot_hash = session_info_snapshot_hash_b(ctx) const current_commit_header_hash = current_commit_header_hash_b(ctx) const _scribe_signal_folk_pubKey_a1 = _scribe_signal_folk_pubKey_a1_b(ctx) - const rpc_send_folk_lore = rpc_send_folk_lore_b(ctx) return { SyncReq: async (signal)=>{ - const participant:HoloHash = signal.data.payload.signal_payload + const participant:AgentPubKey = signal.data.payload.signal_payload const am_i_scribe = am_i_scribe_b(ctx) if (am_i_scribe.$ === true) { + const update_folks = update_folks_b(ctx) update_folks(participant, FOLK_SEEN) const state:StateForSync = { snapshot: session_info_snapshot_hash.$!, @@ -47,6 +46,7 @@ export const SyncReq_SignalOps_b = _b<SignalOps>('SyncReq_SignalOps', (ctx)=>{ pubKey: agent_pub_key.$ } const data = { participants: p } + const rpc_send_folk_lore = rpc_send_folk_lore_b(ctx) await rpc_send_folk_lore({ participants: _scribe_signal_folk_pubKey_a1(), data, diff --git a/ui/libs/model/src/signals/SyncResp_SignalOps_b.ts b/ui/libs/model/src/signals/SyncResp_SignalOps_b.ts index 922b7e13..66f9da02 100644 --- a/ui/libs/model/src/signals/SyncResp_SignalOps_b.ts +++ b/ui/libs/model/src/signals/SyncResp_SignalOps_b.ts @@ -9,7 +9,6 @@ import type { SignalOps } from './SignalOps' export const SyncResp_SignalOps_b = _b<SignalOps>('SyncResp_SignalOps', (ctx)=>{ const console = console_b(ctx) const content_hash_str = content_hash_str_b(ctx) - const record_deltas = record_deltas_b(ctx) return { SyncResp: async (signal)=>{ const serialized_state:SerializedStateForSync = signal.data.payload.signal_payload @@ -18,7 +17,8 @@ export const SyncResp_SignalOps_b = _b<SignalOps>('SyncResp_SignalOps', (ctx)=>{ }) // Make sure that we are working off the same snapshot and commit const commit_content_hash_str = bufferToBase64(state.commit_content_hash) - if ( commit_content_hash_str == content_hash_str.$) { + if (commit_content_hash_str == content_hash_str.$) { + const record_deltas = record_deltas_b(ctx) await record_deltas(state.deltas) } else { console.log('WHOA, sync response has different current state assumptions') diff --git a/ui/libs/model/src/timers/scribe_heartbeat_timer_b.ts b/ui/libs/model/src/timers/scribe_heartbeat_timer_b.ts index d9a44e0b..7607e948 100644 --- a/ui/libs/model/src/timers/scribe_heartbeat_timer_b.ts +++ b/ui/libs/model/src/timers/scribe_heartbeat_timer_b.ts @@ -1,9 +1,9 @@ -import { PubKeyToFolkRecord, rpc_send_folk_lore_b, rpc_send_heartbeat_b } from '@syn-ui/zome-client' +import type { AgentPubKey } from '@holochain/conductor-api' import { _b } from '@ctx-core/object' +import { rpc_send_folk_lore_b, rpc_send_heartbeat_b } from '@syn-ui/zome-client' import { am_i_scribe_b, folks_b, session_info_scribe_b } from '../session' import { _scribe_signal_folk_pubKey_a1_b } from '../delta' import { Timer } from './Timer' -import type { AgentPubKey } from '@holochain/conductor-api' // const outOfSessionTimout = 30 * 1000 const outOfSessionTimout = 8 * 1000 // testing code :) // const heartbeatInterval = 15 * 1000 // 15 seconds @@ -16,7 +16,7 @@ export const scribe_heartbeat_timer_b = _b<Timer>('scribe_heartbeat_timer', (ctx // examine folks last seen time and see if any have crossed the session out-of-session // timeout so we can tell everybody else about them having dropped. const gone:AgentPubKey[] = [] - const $folks = folks.$ as PubKeyToFolkRecord + const $folks = folks.$ for (const [pubKeyStr, folk] of Object.entries($folks)) { if (folk.inSession && (Date.now() - ($folks[pubKeyStr].lastSeen || 0) > outOfSessionTimout)) { folk.inSession = false diff --git a/ui/libs/utils/src/delay.ts b/ui/libs/utils/src/delay.ts new file mode 100644 index 00000000..b2ef630a --- /dev/null +++ b/ui/libs/utils/src/delay.ts @@ -0,0 +1 @@ +export const delay = ms=>new Promise(r=>setTimeout(r, ms)) diff --git a/ui/libs/utils/src/index.ts b/ui/libs/utils/src/index.ts index 0b2333b1..30624ceb 100644 --- a/ui/libs/utils/src/index.ts +++ b/ui/libs/utils/src/index.ts @@ -1,5 +1,7 @@ export * from './base64ToBuffer' export * from './bufferToBase64' export * from './console_b' +export * from './delay' export * from './EntryHash' export * from './HeaderHash' +export * from './stack' diff --git a/ui/libs/utils/src/stack.ts b/ui/libs/utils/src/stack.ts new file mode 100644 index 00000000..810d9e1f --- /dev/null +++ b/ui/libs/utils/src/stack.ts @@ -0,0 +1,22 @@ +export function _stack() { + const err = new Error + return err.stack!.split('\n') +} +export function _filename() { + const caller_line = _caller_line() + return caller_line.slice(0 + 1, caller_line.indexOf(':')) +} +export function _line() { + const caller_line = _caller_line() + return parseInt(caller_line.slice(caller_line.indexOf(':') + 1, caller_line.lastIndexOf(':'))) +} +export function _line_pos() { + const caller_line = _caller_line() + return caller_line.slice(caller_line.lastIndexOf(':') + 1) +} +export function _caller_line(stack_line = _stack()[3]) { + return ( + stack_line.slice(stack_line.lastIndexOf('/'), stack_line.lastIndexOf(')')) + || stack_line.slice(stack_line.lastIndexOf('('), stack_line.lastIndexOf(')')) + ) +} diff --git a/ui/libs/zome-client/package.json b/ui/libs/zome-client/package.json index 67fd10a5..a09c9d1f 100644 --- a/ui/libs/zome-client/package.json +++ b/ui/libs/zome-client/package.json @@ -8,7 +8,7 @@ "devDependencies": { "@ctx-core/function": "^17.4.9", "@ctx-core/object": "^17.5.17", - "@ctx-core/store": "^24.7.5", + "@ctx-core/store": "^24.7.9", "@holochain/conductor-api": "^0.0.4", "@syn-ui/utils": "workspace:^1.0.0", "buffer": "^6.0.3", diff --git a/zomes/syn/src/lib.rs b/zomes/syn/src/lib.rs index dd601874..b70171da 100644 --- a/zomes/syn/src/lib.rs +++ b/zomes/syn/src/lib.rs @@ -179,6 +179,7 @@ fn get_snapshot_info_for_session( let (snapshot_hash, _) = element.header().entry_data().unwrap(); // should always have entry data let commits = get_links_and_load_type::<ContentChange>(snapshot_hash.clone(), None)?; + debug!("get_snapshot_info_for_session|commits|debug|1|{:?}", &commits); // build hash map from commits vec, with keys as previous_change let tuples = commits .into_iter() From 6d0129aa74c649dea82df36c5a2a2f892cd8e3e4 Mon Sep 17 00:00:00 2001 From: Brian Takita <brian.takita@gmail.com> Date: Tue, 4 May 2021 05:13:51 -0400 Subject: [PATCH 28/33] @syn-ui/tests: waitfor instead of promise_timeout --- package.json | 2 +- pnpm-lock.yaml | 198 +++++++++++++++---------------- tests/package.json | 2 +- tests/unit-test/syn.ts | 127 +++++++------------- ui/apps/app/package.json | 6 +- ui/apps/headless/package.json | 6 +- ui/libs/model/package.json | 4 +- ui/libs/zome-client/package.json | 6 +- 8 files changed, 158 insertions(+), 193 deletions(-) diff --git a/package.json b/package.json index df4a23b1..0b1e84ab 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "devDependencies": { "@babel/runtime": "^7.14.0", "@changesets/cli": "^2.16.0", - "@ctx-core/function": "^17.4.9", + "@ctx-core/function": "^17.5.0", "@ctx-core/jetbrains": "^4.0.34", "@ctx-core/monorepo": "^15.0.56", "@ctx-core/pnpm-tools": "^6.0.11", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 866507ac..ed25d815 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,7 +6,7 @@ importers: specifiers: '@babel/runtime': ^7.14.0 '@changesets/cli': ^2.16.0 - '@ctx-core/function': ^17.4.9 + '@ctx-core/function': ^17.5.0 '@ctx-core/jetbrains': ^4.0.34 '@ctx-core/monorepo': ^15.0.56 '@ctx-core/pnpm-tools': ^6.0.11 @@ -15,7 +15,7 @@ importers: devDependencies: '@babel/runtime': 7.14.0 '@changesets/cli': 2.16.0 - '@ctx-core/function': 17.4.9 + '@ctx-core/function': 17.5.0 '@ctx-core/jetbrains': 4.0.34 '@ctx-core/monorepo': 15.0.56 '@ctx-core/pnpm-tools': 6.0.11 @@ -25,7 +25,7 @@ importers: tests: specifiers: '@ctx-core/combinators': ^6.0.10 - '@ctx-core/store': ^24.7.9 + '@ctx-core/store': ^24.7.10 '@holochain/conductor-api': 0.0.4 '@holochain/tryorama': 0.4.2 '@syn-ui/model': workspace:^1.0.0 @@ -50,7 +50,7 @@ importers: uuidv4: 6.2.7 devDependencies: '@ctx-core/combinators': 6.0.10 - '@ctx-core/store': 24.7.9 + '@ctx-core/store': 24.7.10 '@holochain/conductor-api': 0.0.4 '@holochain/tryorama': 0.4.2 '@syn-ui/model': link:../ui/libs/model @@ -64,8 +64,8 @@ importers: ui/apps/app: specifiers: '@ctx-core/combinators': ^6.0.10 - '@ctx-core/object': ^17.5.17 - '@ctx-core/store': ^24.7.9 + '@ctx-core/object': ^17.5.18 + '@ctx-core/store': ^24.7.10 '@holochain/conductor-api': 0.0.4 '@rollup/plugin-commonjs': ^18.0.0 '@rollup/plugin-node-resolve': ^11.2.1 @@ -75,7 +75,7 @@ importers: '@syn-ui/zome-client': workspace:^1.0.0 '@tsconfig/svelte': ^1.0.10 buffer: ^6.0.3 - rollup: ^2.46.0 + rollup: ^2.47.0 rollup-plugin-css-only: ^3.1.0 rollup-plugin-livereload: ^2.0.0 rollup-plugin-node-polyfills: ^0.2.1 @@ -94,22 +94,22 @@ importers: sirv-cli: 1.0.11 svelte-fa: 2.2.0 devDependencies: - '@ctx-core/object': 17.5.17 - '@ctx-core/store': 24.7.9 - '@rollup/plugin-commonjs': 18.0.0_rollup@2.46.0 - '@rollup/plugin-node-resolve': 11.2.1_rollup@2.46.0 - '@rollup/plugin-replace': 2.4.2_rollup@2.46.0 - '@rollup/plugin-typescript': 8.2.1_a3b54be422ec682aa2c1673acc2ace22 + '@ctx-core/object': 17.5.18 + '@ctx-core/store': 24.7.10 + '@rollup/plugin-commonjs': 18.0.0_rollup@2.47.0 + '@rollup/plugin-node-resolve': 11.2.1_rollup@2.47.0 + '@rollup/plugin-replace': 2.4.2_rollup@2.47.0 + '@rollup/plugin-typescript': 8.2.1_810b5a6d1c7477a73baaceebd2991e4b '@syn-ui/model': link:../../libs/model '@syn-ui/zome-client': link:../../libs/zome-client '@tsconfig/svelte': 1.0.10 buffer: 6.0.3 - rollup: 2.46.0 - rollup-plugin-css-only: 3.1.0_rollup@2.46.0 + rollup: 2.47.0 + rollup-plugin-css-only: 3.1.0_rollup@2.47.0 rollup-plugin-livereload: 2.0.0 rollup-plugin-node-polyfills: 0.2.1 - rollup-plugin-svelte: 7.1.0_rollup@2.46.0+svelte@3.38.2 - rollup-plugin-terser: 7.0.2_rollup@2.46.0 + rollup-plugin-svelte: 7.1.0_rollup@2.47.0+svelte@3.38.2 + rollup-plugin-terser: 7.0.2_rollup@2.47.0 svelte: 3.38.2 svelte-check: 1.5.2_svelte@3.38.2 svelte-preprocess: 4.7.3_svelte@3.38.2+typescript@4.2.4 @@ -119,14 +119,14 @@ importers: ui/apps/headless: specifiers: '@ctx-core/combinators': ^6.0.10 - '@ctx-core/object': ^17.5.17 - '@ctx-core/store': ^24.7.9 + '@ctx-core/object': ^17.5.18 + '@ctx-core/store': ^24.7.10 '@holochain/conductor-api': 0.0.4 '@rollup/plugin-commonjs': ^18.0.0 '@rollup/plugin-node-resolve': ^11.2.1 '@rollup/plugin-replace': ^2.4.2 '@rollup/plugin-typescript': ^8.2.1 - rollup: ^2.46.0 + rollup: ^2.47.0 rollup-plugin-css-only: ^3.1.0 rollup-plugin-livereload: ^2.0.0 rollup-plugin-svelte: ^7.1.0 @@ -142,17 +142,17 @@ importers: sirv-cli: 1.0.11 svelte-fa: 2.2.0 devDependencies: - '@ctx-core/object': 17.5.17 - '@ctx-core/store': 24.7.9 - '@rollup/plugin-commonjs': 18.0.0_rollup@2.46.0 - '@rollup/plugin-node-resolve': 11.2.1_rollup@2.46.0 - '@rollup/plugin-replace': 2.4.2_rollup@2.46.0 - '@rollup/plugin-typescript': 8.2.1_rollup@2.46.0+typescript@4.2.4 - rollup: 2.46.0 - rollup-plugin-css-only: 3.1.0_rollup@2.46.0 + '@ctx-core/object': 17.5.18 + '@ctx-core/store': 24.7.10 + '@rollup/plugin-commonjs': 18.0.0_rollup@2.47.0 + '@rollup/plugin-node-resolve': 11.2.1_rollup@2.47.0 + '@rollup/plugin-replace': 2.4.2_rollup@2.47.0 + '@rollup/plugin-typescript': 8.2.1_rollup@2.47.0+typescript@4.2.4 + rollup: 2.47.0 + rollup-plugin-css-only: 3.1.0_rollup@2.47.0 rollup-plugin-livereload: 2.0.0 - rollup-plugin-svelte: 7.1.0_rollup@2.46.0+svelte@3.38.2 - rollup-plugin-terser: 7.0.2_rollup@2.46.0 + rollup-plugin-svelte: 7.1.0_rollup@2.47.0+svelte@3.38.2 + rollup-plugin-terser: 7.0.2_rollup@2.47.0 svelte: 3.38.2 svelte-preprocess: 4.7.3_svelte@3.38.2+typescript@4.2.4 typescript: 4.2.4 @@ -160,8 +160,8 @@ importers: ui/libs/model: specifiers: '@ctx-core/combinators': ^6.0.10 - '@ctx-core/object': ^17.5.17 - '@ctx-core/store': ^24.7.9 + '@ctx-core/object': ^17.5.18 + '@ctx-core/store': ^24.7.10 '@holochain/conductor-api': 0.0.4 '@syn-ui/utils': workspace:^1.0.0 '@syn-ui/zome-client': workspace:^1.0.0 @@ -169,8 +169,8 @@ importers: typescript: ^4.2.4 devDependencies: '@ctx-core/combinators': 6.0.10 - '@ctx-core/object': 17.5.17 - '@ctx-core/store': 24.7.9 + '@ctx-core/object': 17.5.18 + '@ctx-core/store': 24.7.10 '@holochain/conductor-api': 0.0.4 '@syn-ui/utils': link:../utils '@syn-ui/zome-client': link:../zome-client @@ -185,17 +185,17 @@ importers: ui/libs/zome-client: specifiers: - '@ctx-core/function': ^17.4.9 - '@ctx-core/object': ^17.5.17 - '@ctx-core/store': ^24.7.9 + '@ctx-core/function': ^17.5.0 + '@ctx-core/object': ^17.5.18 + '@ctx-core/store': ^24.7.10 '@holochain/conductor-api': ^0.0.4 '@syn-ui/utils': workspace:^1.0.0 buffer: ^6.0.3 typescript: ^4.2.4 devDependencies: - '@ctx-core/function': 17.4.9 - '@ctx-core/object': 17.5.17 - '@ctx-core/store': 24.7.9 + '@ctx-core/function': 17.5.0 + '@ctx-core/object': 17.5.18 + '@ctx-core/store': 24.7.10 '@holochain/conductor-api': 0.0.4 '@syn-ui/utils': link:../utils buffer: 6.0.3 @@ -412,21 +412,21 @@ packages: arrify: 1.0.1 dev: true - /@ctx-core/array/20.2.20: - resolution: {integrity: sha512-OpGLFpg78qHrQGxMFoLFJVe3qpk1GGhebOmw5sq8CMQhAJlj91VynQn3hSS/agg88XQwAAN05oP0BDtfEzNt1w==} + /@ctx-core/array/20.2.21: + resolution: {integrity: sha512-JFQBXg2aCxRM5W2LSGKrjT/WRDhxmSg3X7jFJDQHy4EHJdb8TORwjcZuM7aG1toF7l8eVoUfEqiRnLK4LncwGg==} dependencies: '@ctx-core/combinators': 6.0.10 - '@ctx-core/function': 17.4.9 - '@ctx-core/object': 17.5.17 - '@ctx-core/set': 9.0.21 + '@ctx-core/function': 17.5.0 + '@ctx-core/object': 17.5.18 + '@ctx-core/set': 9.0.22 dev: true - /@ctx-core/cli-args/7.2.29: - resolution: {integrity: sha512-udKauGZDrehl42SEQSyusaRA19v0g3lapYX2sDEYimt8wlmK8MCtU15w0vCtPAXOnB+7Z/vMUEMmhbCwOMXqkw==} + /@ctx-core/cli-args/7.2.30: + resolution: {integrity: sha512-U/vcD1oUdm7Mb1HXygcL3BMG3Xw4tpnYN8lfNjJv6Gug/tqfu6ukqEAhgAY6B7DiuOMWliAGnQOp5DKQm0Qjpw==} dependencies: - '@ctx-core/array': 20.2.20 - '@ctx-core/function': 17.4.9 - '@ctx-core/object': 17.5.17 + '@ctx-core/array': 20.2.21 + '@ctx-core/function': 17.5.0 + '@ctx-core/object': 17.5.18 dev: true /@ctx-core/combinators/6.0.10: @@ -436,18 +436,18 @@ packages: resolution: {integrity: sha512-AWvTxUL0ZEjlGjU+Ye546oLbFqqvwTzy+bEJmUxsNVgKeAGtKZNfd0hY5+QStHqf7bD10A6V4NM4CgcI7f9VJA==} hasBin: true dependencies: - '@ctx-core/array': 20.2.20 + '@ctx-core/array': 20.2.21 dev: true - /@ctx-core/function/17.4.9: - resolution: {integrity: sha512-BsAVEgSWFfKdhH/B/+1TLGrgFGrit40CGjEl5w7XUHTDzEi/1OEUalSznD0TKZJ5sBXQGCakp3TaRgL5UIz3sA==} + /@ctx-core/function/17.5.0: + resolution: {integrity: sha512-wSRxd4POFA1M+ovxxwI1wozyCvq8Djk1WBewdTvt+pA/Ugs79v+xsxLfrRpuByjZbFV7RbMgtoEp3KEFAkb5/Q==} dev: true /@ctx-core/jetbrains/4.0.34: resolution: {integrity: sha512-4wGPtDyY8sEeR3uh01thHA4DdCIexqvCBD5SJPWlPYeA2qrj/BAzd7JNuAZRrouJCkWthf5W1kUxArAQkgsNXQ==} hasBin: true dependencies: - '@ctx-core/cli-args': 7.2.29 + '@ctx-core/cli-args': 7.2.30 '@ctx-core/queue': 3.0.10 esm: 3.2.25 globby: 11.0.3 @@ -457,8 +457,8 @@ packages: resolution: {integrity: sha512-6/HYAUhrw1OrYnRFH6x5uMhlkJiQy0W5OJ3sOY2gikfiullhmre+r0NLytHnGaHZgXVkwWcRyi1eLqr7t3R/IA==} hasBin: true dependencies: - '@ctx-core/array': 20.2.20 - '@ctx-core/cli-args': 7.2.29 + '@ctx-core/array': 20.2.21 + '@ctx-core/cli-args': 7.2.30 '@ctx-core/ctx-core-package-tools': 6.0.49 '@ctx-core/package': 6.1.21 '@ctx-core/queue': 3.0.10 @@ -469,17 +469,17 @@ packages: semver: 7.3.5 dev: true - /@ctx-core/object/17.5.17: - resolution: {integrity: sha512-1qbnYvUj/Z4gN0G6MPmjTmhCS0P7rz2yMW8fcwsRB1iaf4GhbSkpCGyo+F1YJxwuLc/d1LDb/x6MPSPUEvJouA==} + /@ctx-core/object/17.5.18: + resolution: {integrity: sha512-N3gFUMY+ql3W0sv5tMiVHR7pkaqvsTfSDjsrl8PMohVreczELnNjkh06dleeJr+7upbaCbw3YwK8L3qKUhLSxQ==} dependencies: - '@ctx-core/function': 17.4.9 + '@ctx-core/function': 17.5.0 dev: true /@ctx-core/package/6.1.21: resolution: {integrity: sha512-1LAU/w/BEA+Og4nMNNZqL8DULgFUUHYdFn8xkKsiD6XE2tqBmjpeI8NliBz2a5rP9VGRReix0q1vjanCc4lY/g==} hasBin: true dependencies: - '@ctx-core/cli-args': 7.2.29 + '@ctx-core/cli-args': 7.2.30 esm: 3.2.25 resolve: 1.20.0 dev: true @@ -497,19 +497,19 @@ packages: resolution: {integrity: sha512-SUX8v4klI5/Xy4LeQ87V5h1WfK8k15YvFvsTw74fLYWYEaquy3nYnuduRsAY8L58xZ0uY/OQ++XHTiyIUCX9aA==} dev: true - /@ctx-core/set/9.0.21: - resolution: {integrity: sha512-uynQWcGIlpr1l9NGGYFGGF82AzMBxW6x6wtK2iK0HFDWiVbKl6t7X37CVkV9xpVjbOJmFDTQt46+OO5DuNd3rg==} + /@ctx-core/set/9.0.22: + resolution: {integrity: sha512-+kPrVPSYLBnYIHJCyY34VV7g9mbsuBQuYJlg0XunkpDrpTBX96Y9udNqJ6q/BSxzlFzsZ+1BKtMqYzGoa2aa9A==} dependencies: - '@ctx-core/function': 17.4.9 + '@ctx-core/function': 17.5.0 dev: true - /@ctx-core/store/24.7.9: - resolution: {integrity: sha512-GSow/2VRcMqJJ6LNMnGuyo00j9/VGGRwCUt2oCdg8aWq8UWrHhMFQU4Z671Dn+9jm/IjhMlr1KpRiiuwNtMBFw==} + /@ctx-core/store/24.7.10: + resolution: {integrity: sha512-g/Tpr6Qr2/Cre9l0+TqgvlmbjJ4joKqnP6bgdCZt23d6UMA4BRdZf1WWuP95eoSt15i8r+2MDTopTDByBcBzLA==} dependencies: - '@ctx-core/array': 20.2.20 + '@ctx-core/array': 20.2.21 '@ctx-core/combinators': 6.0.10 - '@ctx-core/function': 17.4.9 - '@ctx-core/object': 17.5.17 + '@ctx-core/function': 17.5.0 + '@ctx-core/object': 17.5.18 svelte: 3.38.1 dev: true @@ -561,7 +561,7 @@ packages: '@holochain/conductor-api': 0.0.3 '@holochain/hachiko': 0.5.2 '@iarna/toml': 2.2.5 - '@msgpack/msgpack': 2.6.1 + '@msgpack/msgpack': 2.6.3 async-mutex: 0.1.4 axios: 0.19.2 base-64: 0.1.0 @@ -609,8 +609,8 @@ packages: resolution: {integrity: sha512-5qzv53J43V8GaYsaETs29Q0Ehw9Dog6SG18MASZRQDuZYXtA5T7pymGE2S40NL0X8sjl8+TybmRa5O8d45V7MQ==} engines: {node: '>= 10'} - /@msgpack/msgpack/2.6.1: - resolution: {integrity: sha512-YSXpFq3n+xHYNefgg9my/wWjZ0nWNxdfYVGpOi5d7sE2xHtNNL8z+V+/eiC1SYCh884w7z6JoDBWGLreR2a45w==} + /@msgpack/msgpack/2.6.3: + resolution: {integrity: sha512-dSJ1TBB9Hreienm5SFVbpKIcRRekQNULxvbmDVXQwRCZWYCIxZ23X+FlFWkg1LmGG+DIQZXH+2IW01QwxofT/g==} engines: {node: '>= 10'} dev: true @@ -639,48 +639,48 @@ packages: resolution: {integrity: sha512-6RglhutqrGFMO1MNUXp95RBuYIuc8wTnMAV5MUhLmjTOy78ncwOw7RgeQ/HeymkKXRhZd0s2DNrM1rL7unk3MQ==} dev: false - /@rollup/plugin-commonjs/18.0.0_rollup@2.46.0: + /@rollup/plugin-commonjs/18.0.0_rollup@2.47.0: resolution: {integrity: sha512-fj92shhg8luw7XbA0HowAqz90oo7qtLGwqTKbyZ8pmOyH8ui5e+u0wPEgeHLH3djcVma6gUCUrjY6w5R2o1u6g==} engines: {node: '>= 8.0.0'} peerDependencies: rollup: ^2.30.0 dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.46.0 + '@rollup/pluginutils': 3.1.0_rollup@2.47.0 commondir: 1.0.1 estree-walker: 2.0.2 glob: 7.1.6 is-reference: 1.2.1 magic-string: 0.25.7 resolve: 1.20.0 - rollup: 2.46.0 + rollup: 2.47.0 dev: true - /@rollup/plugin-node-resolve/11.2.1_rollup@2.46.0: + /@rollup/plugin-node-resolve/11.2.1_rollup@2.47.0: resolution: {integrity: sha512-yc2n43jcqVyGE2sqV5/YCmocy9ArjVAP/BeXyTtADTBBX6V0e5UMqwO8CdQ0kzjb6zu5P1qMzsScCMRvE9OlVg==} engines: {node: '>= 10.0.0'} peerDependencies: rollup: ^1.20.0||^2.0.0 dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.46.0 + '@rollup/pluginutils': 3.1.0_rollup@2.47.0 '@types/resolve': 1.17.1 builtin-modules: 3.2.0 deepmerge: 4.2.2 is-module: 1.0.0 resolve: 1.20.0 - rollup: 2.46.0 + rollup: 2.47.0 dev: true - /@rollup/plugin-replace/2.4.2_rollup@2.46.0: + /@rollup/plugin-replace/2.4.2_rollup@2.47.0: resolution: {integrity: sha512-IGcu+cydlUMZ5En85jxHH4qj2hta/11BHq95iHEyb2sbgiN0eCdzvUcHw5gt9pBL5lTi4JDYJ1acCoMGpTvEZg==} peerDependencies: rollup: ^1.20.0 || ^2.0.0 dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.46.0 + '@rollup/pluginutils': 3.1.0_rollup@2.47.0 magic-string: 0.25.7 - rollup: 2.46.0 + rollup: 2.47.0 dev: true - /@rollup/plugin-typescript/8.2.1_a3b54be422ec682aa2c1673acc2ace22: + /@rollup/plugin-typescript/8.2.1_810b5a6d1c7477a73baaceebd2991e4b: resolution: {integrity: sha512-Qd2E1pleDR4bwyFxqbjt4eJf+wB0UKVMLc7/BAFDGVdAXQMCsD4DUv5/7/ww47BZCYxWtJqe1Lo0KVNswBJlRw==} engines: {node: '>=8.0.0'} peerDependencies: @@ -688,14 +688,14 @@ packages: tslib: '*' typescript: '>=3.7.0' dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.46.0 + '@rollup/pluginutils': 3.1.0_rollup@2.47.0 resolve: 1.20.0 - rollup: 2.46.0 + rollup: 2.47.0 tslib: 2.2.0 typescript: 4.2.4 dev: true - /@rollup/plugin-typescript/8.2.1_rollup@2.46.0+typescript@4.2.4: + /@rollup/plugin-typescript/8.2.1_rollup@2.47.0+typescript@4.2.4: resolution: {integrity: sha512-Qd2E1pleDR4bwyFxqbjt4eJf+wB0UKVMLc7/BAFDGVdAXQMCsD4DUv5/7/ww47BZCYxWtJqe1Lo0KVNswBJlRw==} engines: {node: '>=8.0.0'} peerDependencies: @@ -703,13 +703,13 @@ packages: tslib: '*' typescript: '>=3.7.0' dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.46.0 + '@rollup/pluginutils': 3.1.0_rollup@2.47.0 resolve: 1.20.0 - rollup: 2.46.0 + rollup: 2.47.0 typescript: 4.2.4 dev: true - /@rollup/pluginutils/3.1.0_rollup@2.46.0: + /@rollup/pluginutils/3.1.0_rollup@2.47.0: resolution: {integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==} engines: {node: '>= 8.0.0'} peerDependencies: @@ -718,10 +718,10 @@ packages: '@types/estree': 0.0.39 estree-walker: 1.0.1 picomatch: 2.2.3 - rollup: 2.46.0 + rollup: 2.47.0 dev: true - /@rollup/pluginutils/4.1.0_rollup@2.46.0: + /@rollup/pluginutils/4.1.0_rollup@2.47.0: resolution: {integrity: sha512-TrBhfJkFxA+ER+ew2U2/fHbebhLT/l/2pRk0hfj9KusXUuRXd2v0R58AfaZK9VXDQ4TogOSEmICVrQAA3zFnHQ==} engines: {node: '>= 8.0.0'} peerDependencies: @@ -729,7 +729,7 @@ packages: dependencies: estree-walker: 2.0.2 picomatch: 2.2.3 - rollup: 2.46.0 + rollup: 2.47.0 dev: true /@sindresorhus/is/0.14.0: @@ -3461,14 +3461,14 @@ packages: glob: 7.1.6 dev: true - /rollup-plugin-css-only/3.1.0_rollup@2.46.0: + /rollup-plugin-css-only/3.1.0_rollup@2.47.0: resolution: {integrity: sha512-TYMOE5uoD76vpj+RTkQLzC9cQtbnJNktHPB507FzRWBVaofg7KhIqq1kGbcVOadARSozWF883Ho9KpSPKH8gqA==} engines: {node: '>=10.12.0'} peerDependencies: rollup: 1 || 2 dependencies: - '@rollup/pluginutils': 4.1.0_rollup@2.46.0 - rollup: 2.46.0 + '@rollup/pluginutils': 4.1.0_rollup@2.47.0 + rollup: 2.47.0 dev: true /rollup-plugin-inject/3.0.2: @@ -3496,7 +3496,7 @@ packages: rollup-plugin-inject: 3.0.2 dev: true - /rollup-plugin-svelte/7.1.0_rollup@2.46.0+svelte@3.38.2: + /rollup-plugin-svelte/7.1.0_rollup@2.47.0+svelte@3.38.2: resolution: {integrity: sha512-vopCUq3G+25sKjwF5VilIbiY6KCuMNHP1PFvx2Vr3REBNMDllKHFZN2B9jwwC+MqNc3UPKkjXnceLPEjTjXGXg==} engines: {node: '>=10'} peerDependencies: @@ -3504,19 +3504,19 @@ packages: svelte: '>=3.5.0' dependencies: require-relative: 0.8.7 - rollup: 2.46.0 + rollup: 2.47.0 rollup-pluginutils: 2.8.2 svelte: 3.38.2 dev: true - /rollup-plugin-terser/7.0.2_rollup@2.46.0: + /rollup-plugin-terser/7.0.2_rollup@2.47.0: resolution: {integrity: sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==} peerDependencies: rollup: ^2.0.0 dependencies: '@babel/code-frame': 7.12.13 jest-worker: 26.6.2 - rollup: 2.46.0 + rollup: 2.47.0 serialize-javascript: 4.0.0 terser: 5.7.0 dev: true @@ -3527,8 +3527,8 @@ packages: estree-walker: 0.6.1 dev: true - /rollup/2.46.0: - resolution: {integrity: sha512-qPGoUBNl+Z8uNu0z7pD3WPTABWRbcOwIrO/5ccDJzmrtzn0LVf6Lj91+L5CcWhXl6iWf23FQ6m8Jkl2CmN1O7Q==} + /rollup/2.47.0: + resolution: {integrity: sha512-rqBjgq9hQfW0vRmz+0S062ORRNJXvwRpzxhFXORvar/maZqY6za3rgQ/p1Glg+j1hnc1GtYyQCPiAei95uTElg==} engines: {node: '>=10.0.0'} hasBin: true optionalDependencies: diff --git a/tests/package.json b/tests/package.json index fa2ed32e..865b1926 100644 --- a/tests/package.json +++ b/tests/package.json @@ -20,7 +20,7 @@ }, "devDependencies": { "@ctx-core/combinators": "^6.0.10", - "@ctx-core/store": "^24.7.9", + "@ctx-core/store": "^24.7.10", "@holochain/conductor-api": "0.0.4", "@holochain/tryorama": "0.4.2", "@syn-ui/model": "workspace:^1.0.0", diff --git a/tests/unit-test/syn.ts b/tests/unit-test/syn.ts index 3eca4f2f..6b94a502 100644 --- a/tests/unit-test/syn.ts +++ b/tests/unit-test/syn.ts @@ -1,7 +1,7 @@ import { isDeepStrictEqual } from 'util' import path from 'path' import { Config, InstallAgentsHapps } from '@holochain/tryorama' -import { noop, promise_timeout } from '@ctx-core/function' +import { noop, waitfor } from '@ctx-core/function' import { assign } from '@ctx-core/object' import { I } from '@ctx-core/combinators' import { Readable$, subscribe_wait_timeout, writable$ } from '@ctx-core/store' @@ -15,7 +15,6 @@ import { Delta, my_tag_b, rpc_get_content_b, rpc_get_folks_b, rpc_get_session_b, rpc_hash_content_b, rpc_send_heartbeat_b, rpc_send_sync_request_b, Signal } from '@syn-ui/zome-client' -import { delay } from '@holochain/tryorama/lib/util' const config = Config.gen() @@ -153,13 +152,13 @@ module.exports = (orchestrator)=>{ { type: 'Delete', value: [4, 11] }, // 'baz new' { type: 'Add', value: [4, 'monkey'] }, // 'baz monkey new' ] - const new_content_hash_2 = (await promise_timeout(async ()=>{ + await (async ()=>{ const $current_commit_header_hash = current_commit_header_hash_b(me_ctx).$! - for (; ;) { - if (current_commit_header_hash_b(me_ctx).$! === $current_commit_header_hash) return - await delay(0) - } - }, 500))! + await waitfor(async ()=> + (current_commit_header_hash_b(me_ctx).$!) === $current_commit_header_hash, + 500 + ) + })() deltas = jsonDeltas ? pending_deltas.map(d=>JSON.stringify(d)) : pending_deltas await request_change_b(me_ctx)(pending_deltas) @@ -201,23 +200,12 @@ module.exports = (orchestrator)=>{ [[alice_signals], $signals=>filter_signal_name($signals, 'SyncResp')] ] ) - await promise_timeout(async ()=>{ - for (; ;) { - if ( - isDeepStrictEqual(await rpc_get_folks_b(me_ctx)(), [me_pubkey, alice_pubkey]) - ) return - await delay(0) - } - }, 500) - await promise_timeout(async ()=>{ - for (; ;) { - if ( - isDeepStrictEqual( - await rpc_get_folks_b(alice_ctx)(), [me_pubkey, alice_pubkey]) - ) return - await delay(0) - } - }, 500) + await waitfor( + async ()=>isDeepStrictEqual(await rpc_get_folks_b(me_ctx)(), [me_pubkey, alice_pubkey]), + 500) + await waitfor(async ()=> + isDeepStrictEqual(await rpc_get_folks_b(alice_ctx)(), [me_pubkey, alice_pubkey]), + 500) t.deepEqual(await rpc_get_folks_b(me_ctx)(), [me_pubkey, alice_pubkey], _caller_line()) const alice_session_info = session_info_b(alice_ctx) const alice_content = content_b(alice_ctx) @@ -225,22 +213,16 @@ module.exports = (orchestrator)=>{ t.deepEqual(alice_session_info.$!.session, session_hash, _caller_line()) t.deepEqual(alice_session_info.$!.scribe, me_pubkey, _caller_line()) t.deepEqual(alice_session_info.$!.snapshot_content, { title: '', body: '' }, _caller_line()) - await promise_timeout(async ()=>{ - for (; ;) { - if ( - isDeepStrictEqual(alice_session_info.$!.deltas, [ - '{"type":"Title","value":"foo title"}', - '{"type":"Add","value":[0,"bar content"]}', - '{"type":"Delete","value":[0,3]}', - '{"type":"Add","value":[0,"baz"]}', - '{"type":"Add","value":[11," new"]}', - '{"type":"Delete","value":[4,11]}', - '{"type":"Add","value":[4,"monkey"]}' - ]) - ) return - await delay(0) - } - }, 1000) + await waitfor(async ()=> + isDeepStrictEqual(alice_session_info.$!.deltas, [ + '{"type":"Title","value":"foo title"}', + '{"type":"Add","value":[0,"bar content"]}', + '{"type":"Delete","value":[0,3]}', + '{"type":"Add","value":[0,"baz"]}', + '{"type":"Add","value":[11," new"]}', + '{"type":"Delete","value":[4,11]}', + '{"type":"Add","value":[4,"monkey"]}' + ]), 1000) await subscribe_wait_timeout( alice_content, @@ -336,33 +318,18 @@ module.exports = (orchestrator)=>{ // const bob_$session_info = await rpc_get_session_b(bob_ctx)(session_hash) // bob should get my session t.deepEqual(bob_$session_info.scribe, me_pubkey, _caller_line()) - await promise_timeout(async ()=>{ - for (; ;) { - if ( - isDeepStrictEqual(folks_b(me_ctx).$[alice_pubkey_base64]?.pubKey, alice_pubkey) - && isDeepStrictEqual(folks_b(me_ctx).$[bob_pubkey_base64]?.pubKey, bob_pubkey) - ) return - await delay(0) - } - }, 1000) - await promise_timeout(async ()=>{ - for (; ;) { - if ( - isDeepStrictEqual(folks_b(alice_ctx).$[alice_pubkey_base64]?.pubKey, alice_pubkey) - && isDeepStrictEqual(folks_b(alice_ctx).$[bob_pubkey_base64]?.pubKey, bob_pubkey) - ) return - await delay(0) - } - }, 1000) - await promise_timeout(async ()=>{ - for (; ;) { - if ( - isDeepStrictEqual(folks_b(bob_ctx).$[alice_pubkey_base64]?.pubKey, alice_pubkey) - && isDeepStrictEqual(folks_b(bob_ctx).$[bob_pubkey_base64]?.pubKey, bob_pubkey) - ) return - await delay(0) - } - }, 1000) + await waitfor(async ()=> + isDeepStrictEqual(folks_b(me_ctx).$[alice_pubkey_base64]?.pubKey, alice_pubkey) + && isDeepStrictEqual(folks_b(me_ctx).$[bob_pubkey_base64]?.pubKey, bob_pubkey), + 1000) + await waitfor(async ()=> + isDeepStrictEqual(folks_b(alice_ctx).$[alice_pubkey_base64]?.pubKey, alice_pubkey) + && isDeepStrictEqual(folks_b(alice_ctx).$[bob_pubkey_base64]?.pubKey, bob_pubkey), + 1000) + await waitfor(async ()=> + isDeepStrictEqual(folks_b(bob_ctx).$[alice_pubkey_base64]?.pubKey, alice_pubkey) + && isDeepStrictEqual(folks_b(bob_ctx).$[bob_pubkey_base64]?.pubKey, bob_pubkey), + 1000) t.deepEqual(folks_b(me_ctx).$[alice_pubkey_base64].pubKey, alice_pubkey, _caller_line()) t.deepEqual(folks_b(me_ctx).$[alice_pubkey_base64].colors, getFolkColors(alice_pubkey), _caller_line()) t.deepEqual(folks_b(me_ctx).$[alice_pubkey_base64].inSession, true, _caller_line()) @@ -434,22 +401,20 @@ module.exports = (orchestrator)=>{ // confirm that all agents got added to the folks anchor // TODO figure out why init doesn't happen immediately. - await promise_timeout(async ()=>{ - for (; ;) { - if ( - isDeepStrictEqual( - await rpc_get_folks_b(me_ctx)(), - [me_pubkey, alice_pubkey, bob_pubkey]) - ) return - await delay(0) - } - }, 500) + await waitfor(async ()=>{ + const $folks = await rpc_get_folks_b(me_ctx)() + return isDeepStrictEqual($folks, [me_pubkey, alice_pubkey, bob_pubkey]) + }, + 500) /**/ + t.pass(_caller_line()) } finally { console.debug('finally|leave_session') - await leave_session({ ctx: me_ctx }) - await leave_session({ ctx: alice_ctx }) - await leave_session({ ctx: bob_ctx }) + await Promise.all([ + leave_session({ ctx: me_ctx }), + leave_session({ ctx: alice_ctx }), + leave_session({ ctx: bob_ctx }), + ]) } function filter_signal_name($signals:Signal[], signal_name:string) { return $signals.filter(s=>s.signal_name === signal_name) diff --git a/ui/apps/app/package.json b/ui/apps/app/package.json index fa2607c0..7e76539f 100644 --- a/ui/apps/app/package.json +++ b/ui/apps/app/package.json @@ -14,8 +14,8 @@ "svelte-fa": "^2.2.0" }, "devDependencies": { - "@ctx-core/object": "^17.5.17", - "@ctx-core/store": "^24.7.9", + "@ctx-core/object": "^17.5.18", + "@ctx-core/store": "^24.7.10", "@rollup/plugin-commonjs": "^18.0.0", "@rollup/plugin-node-resolve": "^11.2.1", "@rollup/plugin-replace": "^2.4.2", @@ -24,7 +24,7 @@ "@syn-ui/zome-client": "workspace:^1.0.0", "@tsconfig/svelte": "^1.0.10", "buffer": "^6.0.3", - "rollup": "^2.46.0", + "rollup": "^2.47.0", "rollup-plugin-css-only": "^3.1.0", "rollup-plugin-livereload": "^2.0.0", "rollup-plugin-node-polyfills": "^0.2.1", diff --git a/ui/apps/headless/package.json b/ui/apps/headless/package.json index 29bc4768..efe9b2bf 100644 --- a/ui/apps/headless/package.json +++ b/ui/apps/headless/package.json @@ -13,13 +13,13 @@ "svelte-fa": "^2.2.0" }, "devDependencies": { - "@ctx-core/object": "^17.5.17", - "@ctx-core/store": "^24.7.9", + "@ctx-core/object": "^17.5.18", + "@ctx-core/store": "^24.7.10", "@rollup/plugin-commonjs": "^18.0.0", "@rollup/plugin-node-resolve": "^11.2.1", "@rollup/plugin-replace": "^2.4.2", "@rollup/plugin-typescript": "^8.2.1", - "rollup": "^2.46.0", + "rollup": "^2.47.0", "rollup-plugin-css-only": "^3.1.0", "rollup-plugin-livereload": "^2.0.0", "rollup-plugin-svelte": "^7.1.0", diff --git a/ui/libs/model/package.json b/ui/libs/model/package.json index 7f80f4e8..25b0678a 100644 --- a/ui/libs/model/package.json +++ b/ui/libs/model/package.json @@ -7,8 +7,8 @@ "scripts": {}, "devDependencies": { "@ctx-core/combinators": "^6.0.10", - "@ctx-core/object": "^17.5.17", - "@ctx-core/store": "^24.7.9", + "@ctx-core/object": "^17.5.18", + "@ctx-core/store": "^24.7.10", "@holochain/conductor-api": "0.0.4", "@syn-ui/utils": "workspace:^1.0.0", "@syn-ui/zome-client": "workspace:^1.0.0", diff --git a/ui/libs/zome-client/package.json b/ui/libs/zome-client/package.json index a09c9d1f..c18c5484 100644 --- a/ui/libs/zome-client/package.json +++ b/ui/libs/zome-client/package.json @@ -6,9 +6,9 @@ "types": "./src/index.ts", "scripts": {}, "devDependencies": { - "@ctx-core/function": "^17.4.9", - "@ctx-core/object": "^17.5.17", - "@ctx-core/store": "^24.7.9", + "@ctx-core/function": "^17.5.0", + "@ctx-core/object": "^17.5.18", + "@ctx-core/store": "^24.7.10", "@holochain/conductor-api": "^0.0.4", "@syn-ui/utils": "workspace:^1.0.0", "buffer": "^6.0.3", From ba0ac08ba988d45ae97799f06923c62841388563 Mon Sep 17 00:00:00 2001 From: Brian Takita <brian.takita@gmail.com> Date: Tue, 4 May 2021 05:25:14 -0400 Subject: [PATCH 29/33] using _stacktrace_filename_line from @ctx-core/function --- package.json | 2 +- pnpm-lock.yaml | 100 ++++++++++++------------ tests/package.json | 2 +- tests/unit-test/syn.ts | 130 +++++++++++++++---------------- ui/apps/app/package.json | 4 +- ui/apps/headless/package.json | 4 +- ui/libs/model/package.json | 4 +- ui/libs/utils/src/stack.ts | 22 ------ ui/libs/zome-client/package.json | 6 +- 9 files changed, 126 insertions(+), 148 deletions(-) delete mode 100644 ui/libs/utils/src/stack.ts diff --git a/package.json b/package.json index 0b1e84ab..bc3e818f 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "devDependencies": { "@babel/runtime": "^7.14.0", "@changesets/cli": "^2.16.0", - "@ctx-core/function": "^17.5.0", + "@ctx-core/function": "^17.6.0", "@ctx-core/jetbrains": "^4.0.34", "@ctx-core/monorepo": "^15.0.56", "@ctx-core/pnpm-tools": "^6.0.11", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ed25d815..b9ca0017 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,7 +6,7 @@ importers: specifiers: '@babel/runtime': ^7.14.0 '@changesets/cli': ^2.16.0 - '@ctx-core/function': ^17.5.0 + '@ctx-core/function': ^17.6.0 '@ctx-core/jetbrains': ^4.0.34 '@ctx-core/monorepo': ^15.0.56 '@ctx-core/pnpm-tools': ^6.0.11 @@ -15,7 +15,7 @@ importers: devDependencies: '@babel/runtime': 7.14.0 '@changesets/cli': 2.16.0 - '@ctx-core/function': 17.5.0 + '@ctx-core/function': 17.6.0 '@ctx-core/jetbrains': 4.0.34 '@ctx-core/monorepo': 15.0.56 '@ctx-core/pnpm-tools': 6.0.11 @@ -25,7 +25,7 @@ importers: tests: specifiers: '@ctx-core/combinators': ^6.0.10 - '@ctx-core/store': ^24.7.10 + '@ctx-core/store': ^24.7.11 '@holochain/conductor-api': 0.0.4 '@holochain/tryorama': 0.4.2 '@syn-ui/model': workspace:^1.0.0 @@ -50,7 +50,7 @@ importers: uuidv4: 6.2.7 devDependencies: '@ctx-core/combinators': 6.0.10 - '@ctx-core/store': 24.7.10 + '@ctx-core/store': 24.7.11 '@holochain/conductor-api': 0.0.4 '@holochain/tryorama': 0.4.2 '@syn-ui/model': link:../ui/libs/model @@ -64,8 +64,8 @@ importers: ui/apps/app: specifiers: '@ctx-core/combinators': ^6.0.10 - '@ctx-core/object': ^17.5.18 - '@ctx-core/store': ^24.7.10 + '@ctx-core/object': ^17.5.19 + '@ctx-core/store': ^24.7.11 '@holochain/conductor-api': 0.0.4 '@rollup/plugin-commonjs': ^18.0.0 '@rollup/plugin-node-resolve': ^11.2.1 @@ -94,8 +94,8 @@ importers: sirv-cli: 1.0.11 svelte-fa: 2.2.0 devDependencies: - '@ctx-core/object': 17.5.18 - '@ctx-core/store': 24.7.10 + '@ctx-core/object': 17.5.19 + '@ctx-core/store': 24.7.11 '@rollup/plugin-commonjs': 18.0.0_rollup@2.47.0 '@rollup/plugin-node-resolve': 11.2.1_rollup@2.47.0 '@rollup/plugin-replace': 2.4.2_rollup@2.47.0 @@ -119,8 +119,8 @@ importers: ui/apps/headless: specifiers: '@ctx-core/combinators': ^6.0.10 - '@ctx-core/object': ^17.5.18 - '@ctx-core/store': ^24.7.10 + '@ctx-core/object': ^17.5.19 + '@ctx-core/store': ^24.7.11 '@holochain/conductor-api': 0.0.4 '@rollup/plugin-commonjs': ^18.0.0 '@rollup/plugin-node-resolve': ^11.2.1 @@ -142,8 +142,8 @@ importers: sirv-cli: 1.0.11 svelte-fa: 2.2.0 devDependencies: - '@ctx-core/object': 17.5.18 - '@ctx-core/store': 24.7.10 + '@ctx-core/object': 17.5.19 + '@ctx-core/store': 24.7.11 '@rollup/plugin-commonjs': 18.0.0_rollup@2.47.0 '@rollup/plugin-node-resolve': 11.2.1_rollup@2.47.0 '@rollup/plugin-replace': 2.4.2_rollup@2.47.0 @@ -160,8 +160,8 @@ importers: ui/libs/model: specifiers: '@ctx-core/combinators': ^6.0.10 - '@ctx-core/object': ^17.5.18 - '@ctx-core/store': ^24.7.10 + '@ctx-core/object': ^17.5.19 + '@ctx-core/store': ^24.7.11 '@holochain/conductor-api': 0.0.4 '@syn-ui/utils': workspace:^1.0.0 '@syn-ui/zome-client': workspace:^1.0.0 @@ -169,8 +169,8 @@ importers: typescript: ^4.2.4 devDependencies: '@ctx-core/combinators': 6.0.10 - '@ctx-core/object': 17.5.18 - '@ctx-core/store': 24.7.10 + '@ctx-core/object': 17.5.19 + '@ctx-core/store': 24.7.11 '@holochain/conductor-api': 0.0.4 '@syn-ui/utils': link:../utils '@syn-ui/zome-client': link:../zome-client @@ -185,17 +185,17 @@ importers: ui/libs/zome-client: specifiers: - '@ctx-core/function': ^17.5.0 - '@ctx-core/object': ^17.5.18 - '@ctx-core/store': ^24.7.10 + '@ctx-core/function': ^17.6.0 + '@ctx-core/object': ^17.5.19 + '@ctx-core/store': ^24.7.11 '@holochain/conductor-api': ^0.0.4 '@syn-ui/utils': workspace:^1.0.0 buffer: ^6.0.3 typescript: ^4.2.4 devDependencies: - '@ctx-core/function': 17.5.0 - '@ctx-core/object': 17.5.18 - '@ctx-core/store': 24.7.10 + '@ctx-core/function': 17.6.0 + '@ctx-core/object': 17.5.19 + '@ctx-core/store': 24.7.11 '@holochain/conductor-api': 0.0.4 '@syn-ui/utils': link:../utils buffer: 6.0.3 @@ -412,21 +412,21 @@ packages: arrify: 1.0.1 dev: true - /@ctx-core/array/20.2.21: - resolution: {integrity: sha512-JFQBXg2aCxRM5W2LSGKrjT/WRDhxmSg3X7jFJDQHy4EHJdb8TORwjcZuM7aG1toF7l8eVoUfEqiRnLK4LncwGg==} + /@ctx-core/array/20.2.22: + resolution: {integrity: sha512-KTvL+5tstfo7oal7mSYsnItpC7HGHILqIKFG/gtTp1V+Q83830XAwBHTSJLwI7lTvIb2/s3uLqROnlBD2HwinQ==} dependencies: '@ctx-core/combinators': 6.0.10 - '@ctx-core/function': 17.5.0 - '@ctx-core/object': 17.5.18 - '@ctx-core/set': 9.0.22 + '@ctx-core/function': 17.6.0 + '@ctx-core/object': 17.5.19 + '@ctx-core/set': 9.0.23 dev: true - /@ctx-core/cli-args/7.2.30: - resolution: {integrity: sha512-U/vcD1oUdm7Mb1HXygcL3BMG3Xw4tpnYN8lfNjJv6Gug/tqfu6ukqEAhgAY6B7DiuOMWliAGnQOp5DKQm0Qjpw==} + /@ctx-core/cli-args/7.2.31: + resolution: {integrity: sha512-gmw8eQwFhn2NCENEMi81TTKmoOuzyPdnfMlIlsIVBNUzh8tIqXeLPSoJRGwAy+MQJ7Y77lVZhnUR2vNfFXf8Hw==} dependencies: - '@ctx-core/array': 20.2.21 - '@ctx-core/function': 17.5.0 - '@ctx-core/object': 17.5.18 + '@ctx-core/array': 20.2.22 + '@ctx-core/function': 17.6.0 + '@ctx-core/object': 17.5.19 dev: true /@ctx-core/combinators/6.0.10: @@ -436,18 +436,18 @@ packages: resolution: {integrity: sha512-AWvTxUL0ZEjlGjU+Ye546oLbFqqvwTzy+bEJmUxsNVgKeAGtKZNfd0hY5+QStHqf7bD10A6V4NM4CgcI7f9VJA==} hasBin: true dependencies: - '@ctx-core/array': 20.2.21 + '@ctx-core/array': 20.2.22 dev: true - /@ctx-core/function/17.5.0: - resolution: {integrity: sha512-wSRxd4POFA1M+ovxxwI1wozyCvq8Djk1WBewdTvt+pA/Ugs79v+xsxLfrRpuByjZbFV7RbMgtoEp3KEFAkb5/Q==} + /@ctx-core/function/17.6.0: + resolution: {integrity: sha512-Dr0dxCen22a/O2P7pj/tmXSYKOq0i7EeokgSOcqb8SaF+9vsMd7TMB5tsHVLTy7KedKkW4waewc3BcWGJ1l56A==} dev: true /@ctx-core/jetbrains/4.0.34: resolution: {integrity: sha512-4wGPtDyY8sEeR3uh01thHA4DdCIexqvCBD5SJPWlPYeA2qrj/BAzd7JNuAZRrouJCkWthf5W1kUxArAQkgsNXQ==} hasBin: true dependencies: - '@ctx-core/cli-args': 7.2.30 + '@ctx-core/cli-args': 7.2.31 '@ctx-core/queue': 3.0.10 esm: 3.2.25 globby: 11.0.3 @@ -457,8 +457,8 @@ packages: resolution: {integrity: sha512-6/HYAUhrw1OrYnRFH6x5uMhlkJiQy0W5OJ3sOY2gikfiullhmre+r0NLytHnGaHZgXVkwWcRyi1eLqr7t3R/IA==} hasBin: true dependencies: - '@ctx-core/array': 20.2.21 - '@ctx-core/cli-args': 7.2.30 + '@ctx-core/array': 20.2.22 + '@ctx-core/cli-args': 7.2.31 '@ctx-core/ctx-core-package-tools': 6.0.49 '@ctx-core/package': 6.1.21 '@ctx-core/queue': 3.0.10 @@ -469,17 +469,17 @@ packages: semver: 7.3.5 dev: true - /@ctx-core/object/17.5.18: - resolution: {integrity: sha512-N3gFUMY+ql3W0sv5tMiVHR7pkaqvsTfSDjsrl8PMohVreczELnNjkh06dleeJr+7upbaCbw3YwK8L3qKUhLSxQ==} + /@ctx-core/object/17.5.19: + resolution: {integrity: sha512-KDzYn6ZZA0YVdAh8OasHuqEf+nFVhqHa7J7e5onIgC9w/JTpAZMVLangH6Pqp3zp5Pds8pMzpkWHOezDhzIrjA==} dependencies: - '@ctx-core/function': 17.5.0 + '@ctx-core/function': 17.6.0 dev: true /@ctx-core/package/6.1.21: resolution: {integrity: sha512-1LAU/w/BEA+Og4nMNNZqL8DULgFUUHYdFn8xkKsiD6XE2tqBmjpeI8NliBz2a5rP9VGRReix0q1vjanCc4lY/g==} hasBin: true dependencies: - '@ctx-core/cli-args': 7.2.30 + '@ctx-core/cli-args': 7.2.31 esm: 3.2.25 resolve: 1.20.0 dev: true @@ -497,19 +497,19 @@ packages: resolution: {integrity: sha512-SUX8v4klI5/Xy4LeQ87V5h1WfK8k15YvFvsTw74fLYWYEaquy3nYnuduRsAY8L58xZ0uY/OQ++XHTiyIUCX9aA==} dev: true - /@ctx-core/set/9.0.22: - resolution: {integrity: sha512-+kPrVPSYLBnYIHJCyY34VV7g9mbsuBQuYJlg0XunkpDrpTBX96Y9udNqJ6q/BSxzlFzsZ+1BKtMqYzGoa2aa9A==} + /@ctx-core/set/9.0.23: + resolution: {integrity: sha512-cONviaeKCRr3tNk8Kr565sRX8q3VlLkgPCRd4yBfgeYJ1qWCDqdF8gFwxSRJO0qV6Dy1VvAj8KcdNwu9oyeriw==} dependencies: - '@ctx-core/function': 17.5.0 + '@ctx-core/function': 17.6.0 dev: true - /@ctx-core/store/24.7.10: - resolution: {integrity: sha512-g/Tpr6Qr2/Cre9l0+TqgvlmbjJ4joKqnP6bgdCZt23d6UMA4BRdZf1WWuP95eoSt15i8r+2MDTopTDByBcBzLA==} + /@ctx-core/store/24.7.11: + resolution: {integrity: sha512-ATahTIWVPwYul2WmiYcdOYCUoPg0EY6ystp3bthhfm/dDFIg/sYtCEy5DVrRCVVI1ZUgSDj6Tb8LjEhavzgzzw==} dependencies: - '@ctx-core/array': 20.2.21 + '@ctx-core/array': 20.2.22 '@ctx-core/combinators': 6.0.10 - '@ctx-core/function': 17.5.0 - '@ctx-core/object': 17.5.18 + '@ctx-core/function': 17.6.0 + '@ctx-core/object': 17.5.19 svelte: 3.38.1 dev: true diff --git a/tests/package.json b/tests/package.json index 865b1926..21765049 100644 --- a/tests/package.json +++ b/tests/package.json @@ -20,7 +20,7 @@ }, "devDependencies": { "@ctx-core/combinators": "^6.0.10", - "@ctx-core/store": "^24.7.10", + "@ctx-core/store": "^24.7.11", "@holochain/conductor-api": "0.0.4", "@holochain/tryorama": "0.4.2", "@syn-ui/model": "workspace:^1.0.0", diff --git a/tests/unit-test/syn.ts b/tests/unit-test/syn.ts index 6b94a502..671c8022 100644 --- a/tests/unit-test/syn.ts +++ b/tests/unit-test/syn.ts @@ -1,11 +1,11 @@ import { isDeepStrictEqual } from 'util' import path from 'path' import { Config, InstallAgentsHapps } from '@holochain/tryorama' -import { noop, waitfor } from '@ctx-core/function' +import { _stacktrace_filename_line, noop, waitfor } from '@ctx-core/function' import { assign } from '@ctx-core/object' import { I } from '@ctx-core/combinators' import { Readable$, subscribe_wait_timeout, writable$ } from '@ctx-core/store' -import { _caller_line, bufferToBase64, console_b } from '@syn-ui/utils' +import { bufferToBase64, console_b } from '@syn-ui/utils' import { content_b, session_info_b, join_session, leave_session, content_hash_b, sessions_b, commit_change_b, current_commit_header_hash_b, request_change_b, recorded_changes_b, committed_changes_b, folks_b, @@ -54,7 +54,7 @@ module.exports = (orchestrator)=>{ const bob_pubkey = bob.cellId[1] const bob_pubkey_base64 = bufferToBase64(bob_pubkey) - t.equal((await me.call('syn', 'get_sessions')).length, 0, _caller_line()) + t.equal((await me.call('syn', 'get_sessions')).length, 0, _stacktrace_filename_line()) const me_port:number = parseInt(me_player._conductor.appClient.client.socket.url.split(':')[2]) const alice_port:number = parseInt(alice_player._conductor.appClient.client.socket.url.split(':')[2]) const bob_port:number = parseInt(bob_player._conductor.appClient.client.socket.url.split(':')[2]) @@ -69,35 +69,35 @@ module.exports = (orchestrator)=>{ await join_session({ app_port: me_port, app_id: me_happ.hAppId, ctx: me_ctx }) try { - t.deepEqual(await rpc_get_folks_b(me_ctx)(), [me_pubkey], _caller_line()) + t.deepEqual(await rpc_get_folks_b(me_ctx)(), [me_pubkey], _stacktrace_filename_line()) await subscribe_wait_timeout(session_info_b(me_ctx), I, 10_000) // I created the session, so I should be the scribe - t.deepEqual(session_info_b(me_ctx).$!.scribe, me_pubkey, _caller_line()) + t.deepEqual(session_info_b(me_ctx).$!.scribe, me_pubkey, _stacktrace_filename_line()) // First ever session so content should be default content - t.deepEqual(session_info_b(me_ctx).$!.snapshot_content, { title: '', body: '' }, _caller_line()) + t.deepEqual(session_info_b(me_ctx).$!.snapshot_content, { title: '', body: '' }, _stacktrace_filename_line()) let session_hash = session_info_b(me_ctx).$!.session // check the hash_content zome call. t.deepEqual( session_info_b(me_ctx).$!.content_hash, await rpc_hash_content_b(me_ctx)(session_info_b(me_ctx).$!.snapshot_content), - _caller_line() + _stacktrace_filename_line() ) // check get_sessions utility zome call const me_sessions = sessions_b(me_ctx) - t.equal(me_sessions.$!.length, 1, _caller_line()) - t.deepEqual(me_sessions.$![0], session_hash, _caller_line()) + t.equal(me_sessions.$!.length, 1, _stacktrace_filename_line()) + t.deepEqual(me_sessions.$![0], session_hash, _stacktrace_filename_line()) // exercise the get_session zome call - t.equal(me_sessions.$!.length, 1, _caller_line()) - t.deepEqual(session_info_b(me_ctx).$, await rpc_get_session_b(me_ctx)(session_hash), _caller_line()) + t.equal(me_sessions.$!.length, 1, _stacktrace_filename_line()) + t.deepEqual(session_info_b(me_ctx).$, await rpc_get_session_b(me_ctx)(session_hash), _stacktrace_filename_line()) // check that initial snapshot was created by using the get_content zome call t.deepEqual( session_info_b(me_ctx).$!.snapshot_content, await rpc_get_content_b(me_ctx)(session_info_b(me_ctx).$!.content_hash), - _caller_line() + _stacktrace_filename_line() ) // set up the pending deltas array @@ -141,8 +141,8 @@ module.exports = (orchestrator)=>{ // add a content change await commit_change_b(me_ctx)() - t.equal(current_commit_header_hash_b(me_ctx).$!.length, 39, _caller_line()) // is a content_hash - t.deepEqual(recorded_changes_b(me_ctx).$, [], _caller_line()) + t.equal(current_commit_header_hash_b(me_ctx).$!.length, 39, _stacktrace_filename_line()) // is a content_hash + t.deepEqual(recorded_changes_b(me_ctx).$, [], _stacktrace_filename_line()) // add a second content change pending_deltas = [ @@ -168,7 +168,7 @@ module.exports = (orchestrator)=>{ { delta: { type: 'Add', value: [11, ' new'] } }, // 'baz content new' { delta: { type: 'Delete', value: [4, 11] }, deleted: 'content' }, // 'baz new' { delta: { type: 'Add', value: [4, 'monkey'] } }, // 'baz monkey new' - ], _caller_line()) + ], _stacktrace_filename_line()) await commit_change_b(me_ctx)() // clear the pending_deltas @@ -180,7 +180,7 @@ module.exports = (orchestrator)=>{ t.deepEqual( me_content.$, { title: 'foo title', body: 'baz monkey new', meta: { [my_tag_b(me_ctx).$]: 0 } }, // content after two commits - _caller_line() + _stacktrace_filename_line() ) let alice_FolkLore_stack:Signal[] // alice joins session @@ -206,13 +206,13 @@ module.exports = (orchestrator)=>{ await waitfor(async ()=> isDeepStrictEqual(await rpc_get_folks_b(alice_ctx)(), [me_pubkey, alice_pubkey]), 500) - t.deepEqual(await rpc_get_folks_b(me_ctx)(), [me_pubkey, alice_pubkey], _caller_line()) + t.deepEqual(await rpc_get_folks_b(me_ctx)(), [me_pubkey, alice_pubkey], _stacktrace_filename_line()) const alice_session_info = session_info_b(alice_ctx) const alice_content = content_b(alice_ctx) // alice should get my session - t.deepEqual(alice_session_info.$!.session, session_hash, _caller_line()) - t.deepEqual(alice_session_info.$!.scribe, me_pubkey, _caller_line()) - t.deepEqual(alice_session_info.$!.snapshot_content, { title: '', body: '' }, _caller_line()) + t.deepEqual(alice_session_info.$!.session, session_hash, _stacktrace_filename_line()) + t.deepEqual(alice_session_info.$!.scribe, me_pubkey, _stacktrace_filename_line()) + t.deepEqual(alice_session_info.$!.snapshot_content, { title: '', body: '' }, _stacktrace_filename_line()) await waitfor(async ()=> isDeepStrictEqual(alice_session_info.$!.deltas, [ '{"type":"Title","value":"foo title"}', @@ -250,17 +250,17 @@ module.exports = (orchestrator)=>{ t.deepEqual( alice_content.$, { title: 'foo title', body: 'baz monkey new', meta: { [my_tag_b(alice_ctx).$]: 0 } },// content after two commits - _caller_line() + _stacktrace_filename_line() ) // confirm that the session_info_b(me_ctx)'s content content_hash matches the content_hash // generated by applying deltas content_hash = await rpc_hash_content_b(alice_ctx)(content_b(alice_ctx).$) const alice_content_hash = content_hash_b(alice_ctx) - t.deepEqual(alice_content_hash.$, content_hash, _caller_line()) + t.deepEqual(alice_content_hash.$, content_hash, _stacktrace_filename_line()) // I should receive alice's request for the state as she joins the session - t.deepEqual(me_SyncReq_stack![0], { signal_name: 'SyncReq', signal_payload: alice_pubkey }, _caller_line()) + t.deepEqual(me_SyncReq_stack![0], { signal_name: 'SyncReq', signal_payload: alice_pubkey }, _stacktrace_filename_line()) // I add some pending deltas which I will then need to send to Alice as part of her Joining. pending_deltas = [{ type: 'Title', value: 'I haven\'t committed yet' }, { type: 'Add', value: [14, '\nBut made a new line! 🍑'] }] @@ -276,11 +276,11 @@ module.exports = (orchestrator)=>{ ]) // Alice should have received uncommitted deltas - t.equal(alice_Change_stack[0].signal_name, 'Change', _caller_line()) - t.deepEqual(alice_Change_stack[0].signal_payload[0], me_index, _caller_line()) // deltas, commit, and snapshot match - t.deepEqual(alice_Change_stack[0].signal_payload[1], pending_deltas.map(d=>JSON.stringify(d)), _caller_line()) // deltas, commit, and snapshot match + t.equal(alice_Change_stack[0].signal_name, 'Change', _stacktrace_filename_line()) + t.deepEqual(alice_Change_stack[0].signal_payload[0], me_index, _stacktrace_filename_line()) // deltas, commit, and snapshot match + t.deepEqual(alice_Change_stack[0].signal_payload[1], pending_deltas.map(d=>JSON.stringify(d)), _stacktrace_filename_line()) // deltas, commit, and snapshot match - t.deepEqual(me_signals.$.map(ms=>ms.signal_name), ['SyncReq', 'SyncReq'], _caller_line()) + t.deepEqual(me_signals.$.map(ms=>ms.signal_name), ['SyncReq', 'SyncReq'], _stacktrace_filename_line()) // alice sends me a change req and I should receive it const alice_delta:Delta = { type: 'Title', value: 'Alice in Wonderland' } let delta = jsonDeltas ? JSON.stringify(alice_delta) : alice_delta @@ -290,10 +290,10 @@ module.exports = (orchestrator)=>{ request_change_b(alice_ctx)([alice_delta]), [[[me_signals], $signals=>filter_signal_name($signals, 'ChangeReq')]] ) - t.deepEqual(me_ChangeReq_stack[0].signal_name, 'ChangeReq', _caller_line()) - t.equal(me_ChangeReq_stack[0].signal_payload[0], alice_index, _caller_line()) + t.deepEqual(me_ChangeReq_stack[0].signal_name, 'ChangeReq', _stacktrace_filename_line()) + t.equal(me_ChangeReq_stack[0].signal_payload[0], alice_index, _stacktrace_filename_line()) const receiveDelta = jsonDeltas ? JSON.parse(me_ChangeReq_stack[0].signal_payload[1]) : me_ChangeReq_stack[0].signal_payload[1] - t.deepEqual(receiveDelta, alice_delta, _caller_line()) // delta_matches + t.deepEqual(receiveDelta, alice_delta, _stacktrace_filename_line()) // delta_matches let alice_SyncReq_stack:Signal[], bob_SyncResp_stack:Signal[], bob_FolkLore_stack:Signal[] ;[ @@ -317,7 +317,7 @@ module.exports = (orchestrator)=>{ const bob_$session_info = session_info_b(bob_ctx).$! // const bob_$session_info = await rpc_get_session_b(bob_ctx)(session_hash) // bob should get my session - t.deepEqual(bob_$session_info.scribe, me_pubkey, _caller_line()) + t.deepEqual(bob_$session_info.scribe, me_pubkey, _stacktrace_filename_line()) await waitfor(async ()=> isDeepStrictEqual(folks_b(me_ctx).$[alice_pubkey_base64]?.pubKey, alice_pubkey) && isDeepStrictEqual(folks_b(me_ctx).$[bob_pubkey_base64]?.pubKey, bob_pubkey), @@ -330,34 +330,34 @@ module.exports = (orchestrator)=>{ isDeepStrictEqual(folks_b(bob_ctx).$[alice_pubkey_base64]?.pubKey, alice_pubkey) && isDeepStrictEqual(folks_b(bob_ctx).$[bob_pubkey_base64]?.pubKey, bob_pubkey), 1000) - t.deepEqual(folks_b(me_ctx).$[alice_pubkey_base64].pubKey, alice_pubkey, _caller_line()) - t.deepEqual(folks_b(me_ctx).$[alice_pubkey_base64].colors, getFolkColors(alice_pubkey), _caller_line()) - t.deepEqual(folks_b(me_ctx).$[alice_pubkey_base64].inSession, true, _caller_line()) - t.ok(folks_b(me_ctx).$[alice_pubkey_base64].lastSeen! <= Date.now(), _caller_line()) - t.deepEqual(folks_b(me_ctx).$[bob_pubkey_base64].pubKey, bob_pubkey, _caller_line()) - t.deepEqual(folks_b(me_ctx).$[bob_pubkey_base64].colors, getFolkColors(bob_pubkey), _caller_line()) - t.deepEqual(folks_b(me_ctx).$[bob_pubkey_base64].inSession, true, _caller_line()) - t.ok(folks_b(me_ctx).$[bob_pubkey_base64].lastSeen! <= Date.now(), _caller_line()) - t.deepEqual(folks_b(alice_ctx).$[alice_pubkey_base64].pubKey, alice_pubkey, _caller_line()) - t.deepEqual(folks_b(alice_ctx).$[alice_pubkey_base64].colors, getFolkColors(alice_pubkey), _caller_line()) - t.deepEqual(folks_b(alice_ctx).$[bob_pubkey_base64].pubKey, bob_pubkey, _caller_line()) - t.deepEqual(folks_b(alice_ctx).$[bob_pubkey_base64].colors, getFolkColors(bob_pubkey), _caller_line()) - t.deepEqual(folks_b(bob_ctx).$[alice_pubkey_base64].pubKey, alice_pubkey, _caller_line()) - t.deepEqual(folks_b(bob_ctx).$[alice_pubkey_base64].colors, getFolkColors(alice_pubkey), _caller_line()) - t.deepEqual(folks_b(bob_ctx).$[bob_pubkey_base64].pubKey, bob_pubkey, _caller_line()) - t.deepEqual(folks_b(bob_ctx).$[bob_pubkey_base64].colors, getFolkColors(bob_pubkey), _caller_line()) - - t.equal(alice_FolkLore_stack[0].signal_name, 'FolkLore', _caller_line()) - t.equal(bob_FolkLore_stack[0].signal_name, 'FolkLore', _caller_line()) + t.deepEqual(folks_b(me_ctx).$[alice_pubkey_base64].pubKey, alice_pubkey, _stacktrace_filename_line()) + t.deepEqual(folks_b(me_ctx).$[alice_pubkey_base64].colors, getFolkColors(alice_pubkey), _stacktrace_filename_line()) + t.deepEqual(folks_b(me_ctx).$[alice_pubkey_base64].inSession, true, _stacktrace_filename_line()) + t.ok(folks_b(me_ctx).$[alice_pubkey_base64].lastSeen! <= Date.now(), _stacktrace_filename_line()) + t.deepEqual(folks_b(me_ctx).$[bob_pubkey_base64].pubKey, bob_pubkey, _stacktrace_filename_line()) + t.deepEqual(folks_b(me_ctx).$[bob_pubkey_base64].colors, getFolkColors(bob_pubkey), _stacktrace_filename_line()) + t.deepEqual(folks_b(me_ctx).$[bob_pubkey_base64].inSession, true, _stacktrace_filename_line()) + t.ok(folks_b(me_ctx).$[bob_pubkey_base64].lastSeen! <= Date.now(), _stacktrace_filename_line()) + t.deepEqual(folks_b(alice_ctx).$[alice_pubkey_base64].pubKey, alice_pubkey, _stacktrace_filename_line()) + t.deepEqual(folks_b(alice_ctx).$[alice_pubkey_base64].colors, getFolkColors(alice_pubkey), _stacktrace_filename_line()) + t.deepEqual(folks_b(alice_ctx).$[bob_pubkey_base64].pubKey, bob_pubkey, _stacktrace_filename_line()) + t.deepEqual(folks_b(alice_ctx).$[bob_pubkey_base64].colors, getFolkColors(bob_pubkey), _stacktrace_filename_line()) + t.deepEqual(folks_b(bob_ctx).$[alice_pubkey_base64].pubKey, alice_pubkey, _stacktrace_filename_line()) + t.deepEqual(folks_b(bob_ctx).$[alice_pubkey_base64].colors, getFolkColors(alice_pubkey), _stacktrace_filename_line()) + t.deepEqual(folks_b(bob_ctx).$[bob_pubkey_base64].pubKey, bob_pubkey, _stacktrace_filename_line()) + t.deepEqual(folks_b(bob_ctx).$[bob_pubkey_base64].colors, getFolkColors(bob_pubkey), _stacktrace_filename_line()) + + t.equal(alice_FolkLore_stack[0].signal_name, 'FolkLore', _stacktrace_filename_line()) + t.equal(bob_FolkLore_stack[0].signal_name, 'FolkLore', _stacktrace_filename_line()) ;(()=>{ const alice_signal = JSON.parse(alice_FolkLore_stack[0].signal_payload) - t.deepEqual(alice_signal.participants[alice_pubkey_base64].pubKey, alice_pubkey_base64, _caller_line()) - t.deepEqual(alice_signal.participants[bob_pubkey_base64].pubKey, bob_pubkey_base64, _caller_line()) + t.deepEqual(alice_signal.participants[alice_pubkey_base64].pubKey, alice_pubkey_base64, _stacktrace_filename_line()) + t.deepEqual(alice_signal.participants[bob_pubkey_base64].pubKey, bob_pubkey_base64, _stacktrace_filename_line()) })() ;(()=>{ const bob_signal = JSON.parse(bob_FolkLore_stack[0].signal_payload) - t.deepEqual(bob_signal.participants[alice_pubkey_base64].pubKey, alice_pubkey_base64, _caller_line()) - t.deepEqual(bob_signal.participants[bob_pubkey_base64].pubKey, bob_pubkey_base64, _caller_line()) + t.deepEqual(bob_signal.participants[alice_pubkey_base64].pubKey, alice_pubkey_base64, _stacktrace_filename_line()) + t.deepEqual(bob_signal.participants[bob_pubkey_base64].pubKey, bob_pubkey_base64, _stacktrace_filename_line()) })() let my_deltas:Delta[] = [{ type: 'Add', value: [0, 'Whoops!\n'] }, { type: 'Title', value: 'Alice in Wonderland' }] @@ -371,12 +371,12 @@ module.exports = (orchestrator)=>{ [[alice_signals, bob_signals], $signals=>filter_signal_name($signals, 'Change')] ] ) - t.equal(alice_Change_stack[0].signal_name, 'Change', _caller_line()) - t.equal(bob_Change_stack[0].signal_name, 'Change', _caller_line()) - t.deepEqual(alice_Change_stack[0].signal_payload[0], me_index, _caller_line()) // delta_matches - t.deepEqual(alice_Change_stack[0].signal_payload[1], deltas, _caller_line()) // delta_matches - t.deepEqual(bob_Change_stack[0].signal_payload[0], me_index, _caller_line()) // delta_matches - t.deepEqual(bob_Change_stack[0].signal_payload[1], deltas, _caller_line()) // delta_matches + t.equal(alice_Change_stack[0].signal_name, 'Change', _stacktrace_filename_line()) + t.equal(bob_Change_stack[0].signal_name, 'Change', _stacktrace_filename_line()) + t.deepEqual(alice_Change_stack[0].signal_payload[0], me_index, _stacktrace_filename_line()) // delta_matches + t.deepEqual(alice_Change_stack[0].signal_payload[1], deltas, _stacktrace_filename_line()) // delta_matches + t.deepEqual(bob_Change_stack[0].signal_payload[0], me_index, _stacktrace_filename_line()) // delta_matches + t.deepEqual(bob_Change_stack[0].signal_payload[1], deltas, _stacktrace_filename_line()) // delta_matches let me_Heartbeat:Signal[] ;[[me_Heartbeat]] = await waitfor_filtered_signals_change(async ()=> @@ -387,9 +387,9 @@ module.exports = (orchestrator)=>{ [[[me_signals], $signals=>filter_signal_name($signals, 'Heartbeat')]] ) let me_sig = me_Heartbeat[0] - t.equal(me_sig.signal_name, 'Heartbeat', _caller_line()) - t.deepEqual(me_sig.signal_payload[1], 'Hello', _caller_line()) - t.deepEqual(me_sig.signal_payload[0], alice_pubkey, _caller_line()) + t.equal(me_sig.signal_name, 'Heartbeat', _stacktrace_filename_line()) + t.deepEqual(me_sig.signal_payload[1], 'Hello', _stacktrace_filename_line()) + t.deepEqual(me_sig.signal_payload[0], alice_pubkey, _stacktrace_filename_line()) // alice asks for a sync request let me_SyncReq:Signal[] @@ -397,7 +397,7 @@ module.exports = (orchestrator)=>{ rpc_send_sync_request_b(alice_ctx)(me_pubkey), [[[me_signals], $signals=>filter_signal_name($signals, 'SyncReq')]] ) - t.equal(me_SyncReq[0].signal_name, 'SyncReq', _caller_line()) + t.equal(me_SyncReq[0].signal_name, 'SyncReq', _stacktrace_filename_line()) // confirm that all agents got added to the folks anchor // TODO figure out why init doesn't happen immediately. @@ -407,7 +407,7 @@ module.exports = (orchestrator)=>{ }, 500) /**/ - t.pass(_caller_line()) + t.pass(_stacktrace_filename_line()) } finally { console.debug('finally|leave_session') await Promise.all([ diff --git a/ui/apps/app/package.json b/ui/apps/app/package.json index 7e76539f..8f488d59 100644 --- a/ui/apps/app/package.json +++ b/ui/apps/app/package.json @@ -14,8 +14,8 @@ "svelte-fa": "^2.2.0" }, "devDependencies": { - "@ctx-core/object": "^17.5.18", - "@ctx-core/store": "^24.7.10", + "@ctx-core/object": "^17.5.19", + "@ctx-core/store": "^24.7.11", "@rollup/plugin-commonjs": "^18.0.0", "@rollup/plugin-node-resolve": "^11.2.1", "@rollup/plugin-replace": "^2.4.2", diff --git a/ui/apps/headless/package.json b/ui/apps/headless/package.json index efe9b2bf..59283e5e 100644 --- a/ui/apps/headless/package.json +++ b/ui/apps/headless/package.json @@ -13,8 +13,8 @@ "svelte-fa": "^2.2.0" }, "devDependencies": { - "@ctx-core/object": "^17.5.18", - "@ctx-core/store": "^24.7.10", + "@ctx-core/object": "^17.5.19", + "@ctx-core/store": "^24.7.11", "@rollup/plugin-commonjs": "^18.0.0", "@rollup/plugin-node-resolve": "^11.2.1", "@rollup/plugin-replace": "^2.4.2", diff --git a/ui/libs/model/package.json b/ui/libs/model/package.json index 25b0678a..3c7358cd 100644 --- a/ui/libs/model/package.json +++ b/ui/libs/model/package.json @@ -7,8 +7,8 @@ "scripts": {}, "devDependencies": { "@ctx-core/combinators": "^6.0.10", - "@ctx-core/object": "^17.5.18", - "@ctx-core/store": "^24.7.10", + "@ctx-core/object": "^17.5.19", + "@ctx-core/store": "^24.7.11", "@holochain/conductor-api": "0.0.4", "@syn-ui/utils": "workspace:^1.0.0", "@syn-ui/zome-client": "workspace:^1.0.0", diff --git a/ui/libs/utils/src/stack.ts b/ui/libs/utils/src/stack.ts deleted file mode 100644 index 810d9e1f..00000000 --- a/ui/libs/utils/src/stack.ts +++ /dev/null @@ -1,22 +0,0 @@ -export function _stack() { - const err = new Error - return err.stack!.split('\n') -} -export function _filename() { - const caller_line = _caller_line() - return caller_line.slice(0 + 1, caller_line.indexOf(':')) -} -export function _line() { - const caller_line = _caller_line() - return parseInt(caller_line.slice(caller_line.indexOf(':') + 1, caller_line.lastIndexOf(':'))) -} -export function _line_pos() { - const caller_line = _caller_line() - return caller_line.slice(caller_line.lastIndexOf(':') + 1) -} -export function _caller_line(stack_line = _stack()[3]) { - return ( - stack_line.slice(stack_line.lastIndexOf('/'), stack_line.lastIndexOf(')')) - || stack_line.slice(stack_line.lastIndexOf('('), stack_line.lastIndexOf(')')) - ) -} diff --git a/ui/libs/zome-client/package.json b/ui/libs/zome-client/package.json index c18c5484..245d6289 100644 --- a/ui/libs/zome-client/package.json +++ b/ui/libs/zome-client/package.json @@ -6,9 +6,9 @@ "types": "./src/index.ts", "scripts": {}, "devDependencies": { - "@ctx-core/function": "^17.5.0", - "@ctx-core/object": "^17.5.18", - "@ctx-core/store": "^24.7.10", + "@ctx-core/function": "^17.6.0", + "@ctx-core/object": "^17.5.19", + "@ctx-core/store": "^24.7.11", "@holochain/conductor-api": "^0.0.4", "@syn-ui/utils": "workspace:^1.0.0", "buffer": "^6.0.3", From 537ac8f805c8a47cbdf8f547cdaedab33385aacf Mon Sep 17 00:00:00 2001 From: Brian Takita <brian.takita@gmail.com> Date: Tue, 4 May 2021 06:04:05 -0400 Subject: [PATCH 30/33] @syn-ui/model: recorded_changes_b: writable$ instead of recorded_changes_T --- ui/libs/model/src/delta/recorded_changes_b.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ui/libs/model/src/delta/recorded_changes_b.ts b/ui/libs/model/src/delta/recorded_changes_b.ts index 75447bc9..31f579b1 100644 --- a/ui/libs/model/src/delta/recorded_changes_b.ts +++ b/ui/libs/model/src/delta/recorded_changes_b.ts @@ -1,8 +1,7 @@ import { _b } from '@ctx-core/object' -import { writable$, writable$_C } from '@ctx-core/store' +import { writable$ } from '@ctx-core/store' import type { ApplyDelta } from './ApplyDelta' export const recorded_changes_b = _b('recorded_changes', ()=> - new recorded_changes_T(writable$<$recorded_changes_T>([])) + writable$<$recorded_changes_T>([]) ) export type $recorded_changes_T = ApplyDelta[] -export class recorded_changes_T extends writable$_C<$recorded_changes_T> {} From 0258d66561419a756f12a65be0cb0e9ce48e406b Mon Sep 17 00:00:00 2001 From: Brian Takita <brian.takita@gmail.com> Date: Tue, 4 May 2021 06:05:00 -0400 Subject: [PATCH 31/33] fix: @syn-ui/utils: removed ./stack --- ui/libs/utils/src/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/libs/utils/src/index.ts b/ui/libs/utils/src/index.ts index 30624ceb..f9121241 100644 --- a/ui/libs/utils/src/index.ts +++ b/ui/libs/utils/src/index.ts @@ -4,4 +4,3 @@ export * from './console_b' export * from './delay' export * from './EntryHash' export * from './HeaderHash' -export * from './stack' From 4253d87964ffb7c1372839a451099ca131e92235 Mon Sep 17 00:00:00 2001 From: Brian Takita <brian.takita@gmail.com> Date: Tue, 4 May 2021 06:06:21 -0400 Subject: [PATCH 32/33] fix: App: svelte compile issue --- ui/apps/app/src/App.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/apps/app/src/App.svelte b/ui/apps/app/src/App.svelte index 7b746711..fd77ee76 100644 --- a/ui/apps/app/src/App.svelte +++ b/ui/apps/app/src/App.svelte @@ -131,12 +131,12 @@ <div class='toolbar'> <h1>SynText</h1> <div class:noscribe> - <Title on:request_change={(event: CustomEvent<Delta[]>) => request_change(event.detail)}/> + <Title on:request_change={(event) => request_change(event.detail)}/> </div> </div> <main> <div class:noscribe> - <Editor on:request_change={(event: CustomEvent<Delta[]>) => request_change(event.detail)}/> + <Editor on:request_change={(event) => request_change(event.detail)}/> </div> From a67bac3fbfd2207f5c0d5aa09069b59917147e77 Mon Sep 17 00:00:00 2001 From: Brian Takita <brian.takita@gmail.com> Date: Wed, 5 May 2021 02:13:48 -0400 Subject: [PATCH 33/33] @syn-ui/test: use run function instead of iife --- package.json | 6 +- pnpm-lock.yaml | 195 +++++++++++++++---------------- tests/package.json | 4 +- tests/unit-test/syn.ts | 14 +-- ui/apps/app/package.json | 8 +- ui/apps/headless/package.json | 8 +- ui/libs/model/package.json | 4 +- ui/libs/zome-client/package.json | 6 +- 8 files changed, 120 insertions(+), 125 deletions(-) diff --git a/package.json b/package.json index bc3e818f..19953f5e 100644 --- a/package.json +++ b/package.json @@ -12,9 +12,9 @@ "devDependencies": { "@babel/runtime": "^7.14.0", "@changesets/cli": "^2.16.0", - "@ctx-core/function": "^17.6.0", - "@ctx-core/jetbrains": "^4.0.34", - "@ctx-core/monorepo": "^15.0.56", + "@ctx-core/function": "^17.8.2", + "@ctx-core/jetbrains": "^4.0.35", + "@ctx-core/monorepo": "^15.0.57", "@ctx-core/pnpm-tools": "^6.0.11", "pnpm": "^6.2.5", "typescript": "4.2.4" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b9ca0017..fb14b624 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,18 +6,18 @@ importers: specifiers: '@babel/runtime': ^7.14.0 '@changesets/cli': ^2.16.0 - '@ctx-core/function': ^17.6.0 - '@ctx-core/jetbrains': ^4.0.34 - '@ctx-core/monorepo': ^15.0.56 + '@ctx-core/function': ^17.8.2 + '@ctx-core/jetbrains': ^4.0.35 + '@ctx-core/monorepo': ^15.0.57 '@ctx-core/pnpm-tools': ^6.0.11 pnpm: ^6.2.5 typescript: 4.2.4 devDependencies: '@babel/runtime': 7.14.0 '@changesets/cli': 2.16.0 - '@ctx-core/function': 17.6.0 - '@ctx-core/jetbrains': 4.0.34 - '@ctx-core/monorepo': 15.0.56 + '@ctx-core/function': 17.8.2 + '@ctx-core/jetbrains': 4.0.35 + '@ctx-core/monorepo': 15.0.57 '@ctx-core/pnpm-tools': 6.0.11 pnpm: 6.2.5 typescript: 4.2.4 @@ -25,14 +25,14 @@ importers: tests: specifiers: '@ctx-core/combinators': ^6.0.10 - '@ctx-core/store': ^24.7.11 + '@ctx-core/store': ^24.7.17 '@holochain/conductor-api': 0.0.4 '@holochain/tryorama': 0.4.2 '@syn-ui/model': workspace:^1.0.0 '@syn-ui/utils': workspace:^1.0.0 '@syn-ui/zome-client': workspace:^1.0.0 '@types/lodash': ^4.14.168 - '@types/node': ^15.0.1 + '@types/node': ^15.0.2 ava: ^3.15.0 esm: ^3.2.25 lodash: ^4.17.21 @@ -50,25 +50,25 @@ importers: uuidv4: 6.2.7 devDependencies: '@ctx-core/combinators': 6.0.10 - '@ctx-core/store': 24.7.11 + '@ctx-core/store': 24.7.17 '@holochain/conductor-api': 0.0.4 '@holochain/tryorama': 0.4.2 '@syn-ui/model': link:../ui/libs/model '@syn-ui/utils': link:../ui/libs/utils '@syn-ui/zome-client': link:../ui/libs/zome-client '@types/lodash': 4.14.168 - '@types/node': 15.0.1 + '@types/node': 15.0.2 ava: 3.15.0 pnpm: 6.2.5 ui/apps/app: specifiers: '@ctx-core/combinators': ^6.0.10 - '@ctx-core/object': ^17.5.19 - '@ctx-core/store': ^24.7.11 + '@ctx-core/object': ^17.5.24 + '@ctx-core/store': ^24.7.17 '@holochain/conductor-api': 0.0.4 - '@rollup/plugin-commonjs': ^18.0.0 - '@rollup/plugin-node-resolve': ^11.2.1 + '@rollup/plugin-commonjs': ^18.1.0 + '@rollup/plugin-node-resolve': ^13.0.0 '@rollup/plugin-replace': ^2.4.2 '@rollup/plugin-typescript': ^8.2.1 '@syn-ui/model': workspace:^1.0.0 @@ -94,10 +94,10 @@ importers: sirv-cli: 1.0.11 svelte-fa: 2.2.0 devDependencies: - '@ctx-core/object': 17.5.19 - '@ctx-core/store': 24.7.11 - '@rollup/plugin-commonjs': 18.0.0_rollup@2.47.0 - '@rollup/plugin-node-resolve': 11.2.1_rollup@2.47.0 + '@ctx-core/object': 17.5.24 + '@ctx-core/store': 24.7.17 + '@rollup/plugin-commonjs': 18.1.0_rollup@2.47.0 + '@rollup/plugin-node-resolve': 13.0.0_rollup@2.47.0 '@rollup/plugin-replace': 2.4.2_rollup@2.47.0 '@rollup/plugin-typescript': 8.2.1_810b5a6d1c7477a73baaceebd2991e4b '@syn-ui/model': link:../../libs/model @@ -119,11 +119,11 @@ importers: ui/apps/headless: specifiers: '@ctx-core/combinators': ^6.0.10 - '@ctx-core/object': ^17.5.19 - '@ctx-core/store': ^24.7.11 + '@ctx-core/object': ^17.5.24 + '@ctx-core/store': ^24.7.17 '@holochain/conductor-api': 0.0.4 - '@rollup/plugin-commonjs': ^18.0.0 - '@rollup/plugin-node-resolve': ^11.2.1 + '@rollup/plugin-commonjs': ^18.1.0 + '@rollup/plugin-node-resolve': ^13.0.0 '@rollup/plugin-replace': ^2.4.2 '@rollup/plugin-typescript': ^8.2.1 rollup: ^2.47.0 @@ -142,10 +142,10 @@ importers: sirv-cli: 1.0.11 svelte-fa: 2.2.0 devDependencies: - '@ctx-core/object': 17.5.19 - '@ctx-core/store': 24.7.11 - '@rollup/plugin-commonjs': 18.0.0_rollup@2.47.0 - '@rollup/plugin-node-resolve': 11.2.1_rollup@2.47.0 + '@ctx-core/object': 17.5.24 + '@ctx-core/store': 24.7.17 + '@rollup/plugin-commonjs': 18.1.0_rollup@2.47.0 + '@rollup/plugin-node-resolve': 13.0.0_rollup@2.47.0 '@rollup/plugin-replace': 2.4.2_rollup@2.47.0 '@rollup/plugin-typescript': 8.2.1_rollup@2.47.0+typescript@4.2.4 rollup: 2.47.0 @@ -160,8 +160,8 @@ importers: ui/libs/model: specifiers: '@ctx-core/combinators': ^6.0.10 - '@ctx-core/object': ^17.5.19 - '@ctx-core/store': ^24.7.11 + '@ctx-core/object': ^17.5.24 + '@ctx-core/store': ^24.7.17 '@holochain/conductor-api': 0.0.4 '@syn-ui/utils': workspace:^1.0.0 '@syn-ui/zome-client': workspace:^1.0.0 @@ -169,8 +169,8 @@ importers: typescript: ^4.2.4 devDependencies: '@ctx-core/combinators': 6.0.10 - '@ctx-core/object': 17.5.19 - '@ctx-core/store': 24.7.11 + '@ctx-core/object': 17.5.24 + '@ctx-core/store': 24.7.17 '@holochain/conductor-api': 0.0.4 '@syn-ui/utils': link:../utils '@syn-ui/zome-client': link:../zome-client @@ -185,17 +185,17 @@ importers: ui/libs/zome-client: specifiers: - '@ctx-core/function': ^17.6.0 - '@ctx-core/object': ^17.5.19 - '@ctx-core/store': ^24.7.11 + '@ctx-core/function': ^17.8.2 + '@ctx-core/object': ^17.5.24 + '@ctx-core/store': ^24.7.17 '@holochain/conductor-api': ^0.0.4 '@syn-ui/utils': workspace:^1.0.0 buffer: ^6.0.3 typescript: ^4.2.4 devDependencies: - '@ctx-core/function': 17.6.0 - '@ctx-core/object': 17.5.19 - '@ctx-core/store': 24.7.11 + '@ctx-core/function': 17.8.2 + '@ctx-core/object': 17.5.24 + '@ctx-core/store': 24.7.17 '@holochain/conductor-api': 0.0.4 '@syn-ui/utils': link:../utils buffer: 6.0.3 @@ -412,55 +412,55 @@ packages: arrify: 1.0.1 dev: true - /@ctx-core/array/20.2.22: - resolution: {integrity: sha512-KTvL+5tstfo7oal7mSYsnItpC7HGHILqIKFG/gtTp1V+Q83830XAwBHTSJLwI7lTvIb2/s3uLqROnlBD2HwinQ==} + /@ctx-core/array/20.2.27: + resolution: {integrity: sha512-JOuBl8h78AOltpwkBIrspFrHO5rAAWOA0MfA3tAABErYiJN9IsF5epDish0N4utfP5aKGX+zpXFCmwG8S2lbPg==} dependencies: '@ctx-core/combinators': 6.0.10 - '@ctx-core/function': 17.6.0 - '@ctx-core/object': 17.5.19 - '@ctx-core/set': 9.0.23 + '@ctx-core/function': 17.8.2 + '@ctx-core/object': 17.5.24 + '@ctx-core/set': 9.0.28 dev: true - /@ctx-core/cli-args/7.2.31: - resolution: {integrity: sha512-gmw8eQwFhn2NCENEMi81TTKmoOuzyPdnfMlIlsIVBNUzh8tIqXeLPSoJRGwAy+MQJ7Y77lVZhnUR2vNfFXf8Hw==} + /@ctx-core/cli-args/7.2.36: + resolution: {integrity: sha512-RnF77Nm0sY4X3AOyFifokc/t+/lqzmDB1voMO9H+O5mod6K9fQfQS7K8YfIn6lFwx6UKkFPkTpTH56mTK2PlVw==} dependencies: - '@ctx-core/array': 20.2.22 - '@ctx-core/function': 17.6.0 - '@ctx-core/object': 17.5.19 + '@ctx-core/array': 20.2.27 + '@ctx-core/function': 17.8.2 + '@ctx-core/object': 17.5.24 dev: true /@ctx-core/combinators/6.0.10: resolution: {integrity: sha512-l16FC/IsyfTOffJkRq5kZSgfnjNa8Wz7m0HpyGQu6//fcePpOvFL+HuQvXgnsMREF6DiayW03QXdStk1kCDBjw==} - /@ctx-core/ctx-core-package-tools/6.0.49: - resolution: {integrity: sha512-AWvTxUL0ZEjlGjU+Ye546oLbFqqvwTzy+bEJmUxsNVgKeAGtKZNfd0hY5+QStHqf7bD10A6V4NM4CgcI7f9VJA==} + /@ctx-core/ctx-core-package-tools/6.0.50: + resolution: {integrity: sha512-657P7H3uLHQLX/qzQa9BFRy0Z87hkblTx3ry+x3m3cXyC72MZ/GHQP7YxEHTiqQ/9lS+3Mbxjki6Z2cEXWh03g==} hasBin: true dependencies: - '@ctx-core/array': 20.2.22 + '@ctx-core/array': 20.2.27 dev: true - /@ctx-core/function/17.6.0: - resolution: {integrity: sha512-Dr0dxCen22a/O2P7pj/tmXSYKOq0i7EeokgSOcqb8SaF+9vsMd7TMB5tsHVLTy7KedKkW4waewc3BcWGJ1l56A==} + /@ctx-core/function/17.8.2: + resolution: {integrity: sha512-dn1+mBlaDUfvmN0j61kD5peC0FRCXL/zkEy9YrPkcWeCMaOFN4zSUVbLt55zv1yXPARDTz6B2NR78vq1ojMXsQ==} dev: true - /@ctx-core/jetbrains/4.0.34: - resolution: {integrity: sha512-4wGPtDyY8sEeR3uh01thHA4DdCIexqvCBD5SJPWlPYeA2qrj/BAzd7JNuAZRrouJCkWthf5W1kUxArAQkgsNXQ==} + /@ctx-core/jetbrains/4.0.35: + resolution: {integrity: sha512-BSSwxdENKxxCcFsTD4lL1h7Pokonkgu2P+aKgLMtNBUu32rDNydYSw/wWlA/tXJ+6XZpaGW7r3m3pkhfnZpkeA==} hasBin: true dependencies: - '@ctx-core/cli-args': 7.2.31 + '@ctx-core/cli-args': 7.2.36 '@ctx-core/queue': 3.0.10 esm: 3.2.25 globby: 11.0.3 dev: true - /@ctx-core/monorepo/15.0.56: - resolution: {integrity: sha512-6/HYAUhrw1OrYnRFH6x5uMhlkJiQy0W5OJ3sOY2gikfiullhmre+r0NLytHnGaHZgXVkwWcRyi1eLqr7t3R/IA==} + /@ctx-core/monorepo/15.0.57: + resolution: {integrity: sha512-2eJtIsvEoiYASAPIz9KBPmkrnzoa4t8c35baVE+HhPSKn7FJXPqkeh88MDAQflvWE+vQVubQsLNX247depbkOA==} hasBin: true dependencies: - '@ctx-core/array': 20.2.22 - '@ctx-core/cli-args': 7.2.31 - '@ctx-core/ctx-core-package-tools': 6.0.49 - '@ctx-core/package': 6.1.21 + '@ctx-core/array': 20.2.27 + '@ctx-core/cli-args': 7.2.36 + '@ctx-core/ctx-core-package-tools': 6.0.50 + '@ctx-core/package': 6.1.22 '@ctx-core/queue': 3.0.10 detect-indent: 6.0.0 esm: 3.2.25 @@ -469,17 +469,17 @@ packages: semver: 7.3.5 dev: true - /@ctx-core/object/17.5.19: - resolution: {integrity: sha512-KDzYn6ZZA0YVdAh8OasHuqEf+nFVhqHa7J7e5onIgC9w/JTpAZMVLangH6Pqp3zp5Pds8pMzpkWHOezDhzIrjA==} + /@ctx-core/object/17.5.24: + resolution: {integrity: sha512-BuG85Ts+LfAnbCabq4+Vw90zRKt8wbMyz573kVdAaYcHYMYwZtfcwbS+HGhNfiHitnvIWYZ9W10BR6nCZorM/A==} dependencies: - '@ctx-core/function': 17.6.0 + '@ctx-core/function': 17.8.2 dev: true - /@ctx-core/package/6.1.21: - resolution: {integrity: sha512-1LAU/w/BEA+Og4nMNNZqL8DULgFUUHYdFn8xkKsiD6XE2tqBmjpeI8NliBz2a5rP9VGRReix0q1vjanCc4lY/g==} + /@ctx-core/package/6.1.22: + resolution: {integrity: sha512-3CMMIbjx5tJPugWGTV9DuRm+OdyLd0aEMhBZ/Y4BUyTVjCIeoBdXt0lF+BEIRYGBO7vYaCdH1XkcUrCnX63noQ==} hasBin: true dependencies: - '@ctx-core/cli-args': 7.2.31 + '@ctx-core/cli-args': 7.2.36 esm: 3.2.25 resolve: 1.20.0 dev: true @@ -497,20 +497,20 @@ packages: resolution: {integrity: sha512-SUX8v4klI5/Xy4LeQ87V5h1WfK8k15YvFvsTw74fLYWYEaquy3nYnuduRsAY8L58xZ0uY/OQ++XHTiyIUCX9aA==} dev: true - /@ctx-core/set/9.0.23: - resolution: {integrity: sha512-cONviaeKCRr3tNk8Kr565sRX8q3VlLkgPCRd4yBfgeYJ1qWCDqdF8gFwxSRJO0qV6Dy1VvAj8KcdNwu9oyeriw==} + /@ctx-core/set/9.0.28: + resolution: {integrity: sha512-VOqt/rs4Q08gRVWPF959JIVvwCGv4cXmacQoDyCs1HbwSDJ5T8t73jHFPnlUoL8ARlzMjAv/+J/2/X1ZKVpzIg==} dependencies: - '@ctx-core/function': 17.6.0 + '@ctx-core/function': 17.8.2 dev: true - /@ctx-core/store/24.7.11: - resolution: {integrity: sha512-ATahTIWVPwYul2WmiYcdOYCUoPg0EY6ystp3bthhfm/dDFIg/sYtCEy5DVrRCVVI1ZUgSDj6Tb8LjEhavzgzzw==} + /@ctx-core/store/24.7.17: + resolution: {integrity: sha512-ruuhQZj+3tZ6k27JhiX+/y2zpGN4ezZ/Xsh0wTDuZ5VzBeGqh7TfOTB2EKbFiSiFXXd6u2cFgesbgd2Rs/0GKQ==} dependencies: - '@ctx-core/array': 20.2.22 + '@ctx-core/array': 20.2.27 '@ctx-core/combinators': 6.0.10 - '@ctx-core/function': 17.6.0 - '@ctx-core/object': 17.5.19 - svelte: 3.38.1 + '@ctx-core/function': 17.8.2 + '@ctx-core/object': 17.5.24 + svelte: 3.38.2 dev: true /@dabh/diagnostics/2.0.2: @@ -590,7 +590,7 @@ packages: resolution: {integrity: sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==} dependencies: '@babel/runtime': 7.14.0 - '@types/node': 12.20.11 + '@types/node': 12.20.12 find-up: 4.1.0 fs-extra: 8.1.0 dev: true @@ -639,8 +639,8 @@ packages: resolution: {integrity: sha512-6RglhutqrGFMO1MNUXp95RBuYIuc8wTnMAV5MUhLmjTOy78ncwOw7RgeQ/HeymkKXRhZd0s2DNrM1rL7unk3MQ==} dev: false - /@rollup/plugin-commonjs/18.0.0_rollup@2.47.0: - resolution: {integrity: sha512-fj92shhg8luw7XbA0HowAqz90oo7qtLGwqTKbyZ8pmOyH8ui5e+u0wPEgeHLH3djcVma6gUCUrjY6w5R2o1u6g==} + /@rollup/plugin-commonjs/18.1.0_rollup@2.47.0: + resolution: {integrity: sha512-h3e6T9rUxVMAQswpDIobfUHn/doMzM9sgkMrsMWCFLmB84PSoC8mV8tOloAJjSRwdqhXBqstlX2BwBpHJvbhxg==} engines: {node: '>= 8.0.0'} peerDependencies: rollup: ^2.30.0 @@ -655,11 +655,11 @@ packages: rollup: 2.47.0 dev: true - /@rollup/plugin-node-resolve/11.2.1_rollup@2.47.0: - resolution: {integrity: sha512-yc2n43jcqVyGE2sqV5/YCmocy9ArjVAP/BeXyTtADTBBX6V0e5UMqwO8CdQ0kzjb6zu5P1qMzsScCMRvE9OlVg==} + /@rollup/plugin-node-resolve/13.0.0_rollup@2.47.0: + resolution: {integrity: sha512-41X411HJ3oikIDivT5OKe9EZ6ud6DXudtfNrGbC4nniaxx2esiWjkLOzgnZsWq1IM8YIeL2rzRGLZLBjlhnZtQ==} engines: {node: '>= 10.0.0'} peerDependencies: - rollup: ^1.20.0||^2.0.0 + rollup: ^2.42.0 dependencies: '@rollup/pluginutils': 3.1.0_rollup@2.47.0 '@types/resolve': 1.17.1 @@ -764,12 +764,12 @@ packages: resolution: {integrity: sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg==} dev: true - /@types/node/12.20.11: - resolution: {integrity: sha512-gema+apZ6qLQK7k7F0dGkGCWQYsL0qqKORWOQO6tq46q+x+1C0vbOiOqOwRVlh4RAdbQwV/j/ryr3u5NOG1fPQ==} + /@types/node/12.20.12: + resolution: {integrity: sha512-KQZ1al2hKOONAs2MFv+yTQP1LkDWMrRJ9YCVRalXltOfXsBmH5IownLxQaiq0lnAHwAViLnh2aTYqrPcRGEbgg==} dev: true - /@types/node/15.0.1: - resolution: {integrity: sha512-TMkXt0Ck1y0KKsGr9gJtWGjttxlZnnvDtphxUOSd0bfaR6Q1jle+sPvrzNR1urqYTWMinoKvjKfXUGsumaO1PA==} + /@types/node/15.0.2: + resolution: {integrity: sha512-p68+a+KoxpoB47015IeYZYRrdqMUcpbK8re/zpFB8Ld46LHC1lPEbp3EXgkEhAYEcPvjJF6ZO+869SQ0aH1dcA==} /@types/normalize-package-data/2.4.0: resolution: {integrity: sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==} @@ -782,13 +782,13 @@ packages: /@types/resolve/1.17.1: resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} dependencies: - '@types/node': 15.0.1 + '@types/node': 15.0.2 dev: true /@types/sass/1.16.0: resolution: {integrity: sha512-2XZovu4NwcqmtZtsBR5XYLw18T8cBCnU2USFHTnYLLHz9fkhnoEMoDsqShJIOFsFhn5aJHjweiUUdTrDGujegA==} dependencies: - '@types/node': 15.0.1 + '@types/node': 15.0.2 dev: true /@types/semver/6.2.2: @@ -802,15 +802,15 @@ packages: /@types/ws/7.4.2: resolution: {integrity: sha512-PbeN0Eydl7LQl4OIav29YmkO2LxbVuz3nZD/kb19lOS+wLgIkRbWMNmU/QQR7ABpOJ7D7xDOU8co7iohObewrw==} dependencies: - '@types/node': 15.0.1 + '@types/node': 15.0.2 /acorn-walk/8.1.0: resolution: {integrity: sha512-mjmzmv12YIG/G8JQdQuz2MUDShEJ6teYpT5bmWA4q7iwoGen8xtt3twF3OvzIUl+Q06aWIjvnwQUKvQ6TtMRjg==} engines: {node: '>=0.4.0'} dev: true - /acorn/8.2.2: - resolution: {integrity: sha512-VrMS8kxT0e7J1EX0p6rI/E0FbfOVcvBpbIqHThFv+f8YrZIlMfVotYcXKVPmTvPW8sW5miJzfUFrrvthUZg8VQ==} + /acorn/8.2.4: + resolution: {integrity: sha512-Ibt84YwBDDA890eDiDCEqcbwvHlBvzzDkU2cGBBDDI1QWT12jTiXIOn2CIw5KK4i6N5Z2HUxwYjzriDyqaqqZg==} engines: {node: '>=0.4.0'} hasBin: true dev: true @@ -959,7 +959,7 @@ packages: hasBin: true dependencies: '@concordance/react': 2.0.0 - acorn: 8.2.2 + acorn: 8.2.4 acorn-walk: 8.1.0 ansi-styles: 5.2.0 arrgv: 1.0.2 @@ -2268,8 +2268,8 @@ packages: resolution: {integrity: sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==} dev: true - /is-bigint/1.0.1: - resolution: {integrity: sha512-J0ELF4yHFxHy0cmSxZuheDOz2luOdVvqjwmEcj8H/L1JHeuEDSDbeRP+Dk9kFVk5RTFzbucJ2Kb9F7ixY2QaCg==} + /is-bigint/1.0.2: + resolution: {integrity: sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA==} dev: false /is-binary-path/2.1.0: @@ -2523,7 +2523,7 @@ packages: resolution: {integrity: sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 15.0.1 + '@types/node': 15.0.2 merge-stream: 2.0.0 supports-color: 7.2.0 dev: true @@ -3978,11 +3978,6 @@ packages: typescript: 4.2.4 dev: true - /svelte/3.38.1: - resolution: {integrity: sha512-N3XLAyfzqrFxwRLevBeW7Dke9ZlHRVGSIed5abo4Drvj+zvd2OyWpFa1x4nQUc8Lnvt4Kcn8/5le1peRDybNqg==} - engines: {node: '>= 8'} - dev: true - /svelte/3.38.2: resolution: {integrity: sha512-q5Dq0/QHh4BLJyEVWGe7Cej5NWs040LWjMbicBGZ+3qpFWJ1YObRmUDZKbbovddLC9WW7THTj3kYbTOFmU9fbg==} engines: {node: '>= 8'} @@ -4271,7 +4266,7 @@ packages: /which-boxed-primitive/1.0.2: resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} dependencies: - is-bigint: 1.0.1 + is-bigint: 1.0.2 is-boolean-object: 1.1.0 is-number-object: 1.0.4 is-string: 1.0.5 diff --git a/tests/package.json b/tests/package.json index 21765049..b8603f84 100644 --- a/tests/package.json +++ b/tests/package.json @@ -20,14 +20,14 @@ }, "devDependencies": { "@ctx-core/combinators": "^6.0.10", - "@ctx-core/store": "^24.7.11", + "@ctx-core/store": "^24.7.17", "@holochain/conductor-api": "0.0.4", "@holochain/tryorama": "0.4.2", "@syn-ui/model": "workspace:^1.0.0", "@syn-ui/utils": "workspace:^1.0.0", "@syn-ui/zome-client": "workspace:^1.0.0", "@types/lodash": "^4.14.168", - "@types/node": "^15.0.1", + "@types/node": "^15.0.2", "ava": "^3.15.0", "pnpm": "^6.2.5" }, diff --git a/tests/unit-test/syn.ts b/tests/unit-test/syn.ts index 671c8022..fc0b9b5a 100644 --- a/tests/unit-test/syn.ts +++ b/tests/unit-test/syn.ts @@ -1,7 +1,7 @@ import { isDeepStrictEqual } from 'util' import path from 'path' import { Config, InstallAgentsHapps } from '@holochain/tryorama' -import { _stacktrace_filename_line, noop, waitfor } from '@ctx-core/function' +import { _stacktrace_filename_line, noop, run, waitfor } from '@ctx-core/function' import { assign } from '@ctx-core/object' import { I } from '@ctx-core/combinators' import { Readable$, subscribe_wait_timeout, writable$ } from '@ctx-core/store' @@ -152,13 +152,13 @@ module.exports = (orchestrator)=>{ { type: 'Delete', value: [4, 11] }, // 'baz new' { type: 'Add', value: [4, 'monkey'] }, // 'baz monkey new' ] - await (async ()=>{ + await run(async ()=>{ const $current_commit_header_hash = current_commit_header_hash_b(me_ctx).$! await waitfor(async ()=> (current_commit_header_hash_b(me_ctx).$!) === $current_commit_header_hash, 500 ) - })() + }) deltas = jsonDeltas ? pending_deltas.map(d=>JSON.stringify(d)) : pending_deltas await request_change_b(me_ctx)(pending_deltas) @@ -349,16 +349,16 @@ module.exports = (orchestrator)=>{ t.equal(alice_FolkLore_stack[0].signal_name, 'FolkLore', _stacktrace_filename_line()) t.equal(bob_FolkLore_stack[0].signal_name, 'FolkLore', _stacktrace_filename_line()) - ;(()=>{ + run(()=>{ const alice_signal = JSON.parse(alice_FolkLore_stack[0].signal_payload) t.deepEqual(alice_signal.participants[alice_pubkey_base64].pubKey, alice_pubkey_base64, _stacktrace_filename_line()) t.deepEqual(alice_signal.participants[bob_pubkey_base64].pubKey, bob_pubkey_base64, _stacktrace_filename_line()) - })() - ;(()=>{ + }) + run(()=>{ const bob_signal = JSON.parse(bob_FolkLore_stack[0].signal_payload) t.deepEqual(bob_signal.participants[alice_pubkey_base64].pubKey, alice_pubkey_base64, _stacktrace_filename_line()) t.deepEqual(bob_signal.participants[bob_pubkey_base64].pubKey, bob_pubkey_base64, _stacktrace_filename_line()) - })() + }) let my_deltas:Delta[] = [{ type: 'Add', value: [0, 'Whoops!\n'] }, { type: 'Title', value: 'Alice in Wonderland' }] deltas = jsonDeltas ? my_deltas.map(d=>JSON.stringify(d)) : deltas diff --git a/ui/apps/app/package.json b/ui/apps/app/package.json index 8f488d59..117d4748 100644 --- a/ui/apps/app/package.json +++ b/ui/apps/app/package.json @@ -14,10 +14,10 @@ "svelte-fa": "^2.2.0" }, "devDependencies": { - "@ctx-core/object": "^17.5.19", - "@ctx-core/store": "^24.7.11", - "@rollup/plugin-commonjs": "^18.0.0", - "@rollup/plugin-node-resolve": "^11.2.1", + "@ctx-core/object": "^17.5.24", + "@ctx-core/store": "^24.7.17", + "@rollup/plugin-commonjs": "^18.1.0", + "@rollup/plugin-node-resolve": "^13.0.0", "@rollup/plugin-replace": "^2.4.2", "@rollup/plugin-typescript": "^8.2.1", "@syn-ui/model": "workspace:^1.0.0", diff --git a/ui/apps/headless/package.json b/ui/apps/headless/package.json index 59283e5e..485fd5ae 100644 --- a/ui/apps/headless/package.json +++ b/ui/apps/headless/package.json @@ -13,10 +13,10 @@ "svelte-fa": "^2.2.0" }, "devDependencies": { - "@ctx-core/object": "^17.5.19", - "@ctx-core/store": "^24.7.11", - "@rollup/plugin-commonjs": "^18.0.0", - "@rollup/plugin-node-resolve": "^11.2.1", + "@ctx-core/object": "^17.5.24", + "@ctx-core/store": "^24.7.17", + "@rollup/plugin-commonjs": "^18.1.0", + "@rollup/plugin-node-resolve": "^13.0.0", "@rollup/plugin-replace": "^2.4.2", "@rollup/plugin-typescript": "^8.2.1", "rollup": "^2.47.0", diff --git a/ui/libs/model/package.json b/ui/libs/model/package.json index 3c7358cd..85b9d37a 100644 --- a/ui/libs/model/package.json +++ b/ui/libs/model/package.json @@ -7,8 +7,8 @@ "scripts": {}, "devDependencies": { "@ctx-core/combinators": "^6.0.10", - "@ctx-core/object": "^17.5.19", - "@ctx-core/store": "^24.7.11", + "@ctx-core/object": "^17.5.24", + "@ctx-core/store": "^24.7.17", "@holochain/conductor-api": "0.0.4", "@syn-ui/utils": "workspace:^1.0.0", "@syn-ui/zome-client": "workspace:^1.0.0", diff --git a/ui/libs/zome-client/package.json b/ui/libs/zome-client/package.json index 245d6289..960963d4 100644 --- a/ui/libs/zome-client/package.json +++ b/ui/libs/zome-client/package.json @@ -6,9 +6,9 @@ "types": "./src/index.ts", "scripts": {}, "devDependencies": { - "@ctx-core/function": "^17.6.0", - "@ctx-core/object": "^17.5.19", - "@ctx-core/store": "^24.7.11", + "@ctx-core/function": "^17.8.2", + "@ctx-core/object": "^17.5.24", + "@ctx-core/store": "^24.7.17", "@holochain/conductor-api": "^0.0.4", "@syn-ui/utils": "workspace:^1.0.0", "buffer": "^6.0.3",