From 6d6f7a24090dc463ec9c027e25926d71c1abd769 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 5 Nov 2024 10:23:26 +0100 Subject: [PATCH] added option to provide AppClient when connecting to SimpleHolochain, add Weave version of example UI --- lib/src/index.ts | 17 +- package-lock.json | 1095 ++++++++++++++++++++++++++++++++++++++- package.json | 2 + ui/package.json | 1 + ui/src/holochain-app.ts | 38 +- weave.dev.config.ts | 80 +++ 6 files changed, 1204 insertions(+), 29 deletions(-) create mode 100644 weave.dev.config.ts diff --git a/lib/src/index.ts b/lib/src/index.ts index d51efcf..808ce80 100644 --- a/lib/src/index.ts +++ b/lib/src/index.ts @@ -301,14 +301,23 @@ export class SimpleHolochain { }); } - static async connect(options: AppWebsocketConnectionOptions = {}) { - const client = await AppWebsocket.connect(options); + /** + * + * @param appClient (optional) An AppClient with an already established app websocket connection + * @param options (optional) If no AppClient is provided, this argument allows to specify + * the websocket connection options + * @returns + */ + static async connect(appClient?: AppClient, options: AppWebsocketConnectionOptions = {}) { + if (!appClient) { + appClient = await AppWebsocket.connect(options); + } const zomeClient = new ZomeClient( - client, + appClient, "generic_dna", "generic_zome" ); - return new SimpleHolochain(client, zomeClient); + return new SimpleHolochain(appClient, zomeClient); } private nodeStore(nodeId: NodeId): NodeStore { diff --git a/package-lock.json b/package-lock.json index 15d1dc0..d162f95 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "devDependencies": { "@holochain-playground/cli": "^0.300.1", "@holochain/hc-spin": "^0.400.0-dev.3", + "@theweave/cli": "0.13.0-gamma.6", "concurrently": "^6.5.1", "get-port-cli": "^3.0.0" }, @@ -82,6 +83,14 @@ "node": ">=14.17" } }, + "node_modules/@alenaksu/json-viewer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@alenaksu/json-viewer/-/json-viewer-2.1.2.tgz", + "integrity": "sha512-hyR5EUc0GZMTjlSULJZlMzEYB896ICbCf1+5YLQRSAczGRWy42UWac5PcXM4spuyTkrEHHlOZBTVEq34f9+JVQ==", + "dependencies": { + "lit": "^3.2.0" + } + }, "node_modules/@babel/code-frame": { "version": "7.26.2", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", @@ -154,6 +163,26 @@ "node": ">=0.1.90" } }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@ctrl/tinycolor": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@ctrl/tinycolor/-/tinycolor-4.1.0.tgz", + "integrity": "sha512-WyOx8cJQ+FQus4Mm4uPIZA64gbk3Wxh0so5Lcii0aJifqwoVOlfFtorjLE0Hen4OYyHZMXDWqMmaQemBhgxFRQ==", + "engines": { + "node": ">=14" + } + }, "node_modules/@dabh/diagnostics": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz", @@ -598,6 +627,138 @@ "node": ">=12" } }, + "node_modules/@floating-ui/core": { + "version": "1.6.8", + "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.6.8.tgz", + "integrity": "sha512-7XJ9cPU+yI2QeLS+FCSlqNFZJq8arvswefkZrYI1yQBbftw6FyrZOxYSh+9S7z7TpeWlRt9zJ5IhM1WIL334jA==", + "dependencies": { + "@floating-ui/utils": "^0.2.8" + } + }, + "node_modules/@floating-ui/dom": { + "version": "1.6.12", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.12.tgz", + "integrity": "sha512-NP83c0HjokcGVEMeoStg317VD9W7eDlGK7457dMBANbKA6GJZdc7rjujdgqzTaz93jkGgc5P/jeWbaCHnMNc+w==", + "dependencies": { + "@floating-ui/core": "^1.6.0", + "@floating-ui/utils": "^0.2.8" + } + }, + "node_modules/@floating-ui/utils": { + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.8.tgz", + "integrity": "sha512-kym7SodPp8/wloecOpcmSnWJsK7M0E5Wg8UcFA+uO4B9s5d0ywXOEro/8HM9x0rW+TljRzul/14UYz3TleT3ig==" + }, + "node_modules/@holo-host/identicon": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@holo-host/identicon/-/identicon-0.1.0.tgz", + "integrity": "sha512-Dn5pTV/m3XaK1Zvq3liw/vQUt7goM7Y84x2zUyH8cb9CNMs4kPCNHs3kalbJZ/ymzFvwcdiLwwNW8AKk+WWN5A==" + }, + "node_modules/@holochain-open-dev/elements": { + "version": "0.400.0-dev.3", + "resolved": "https://registry.npmjs.org/@holochain-open-dev/elements/-/elements-0.400.0-dev.3.tgz", + "integrity": "sha512-dlGBnDxQKmhXElO32ipjkgxdD6nmfPR2edLYDHzGWdP4uetNWTrbqSjWfw+dqDMmGG1nQkmIkTeBAFBstVgWoQ==", + "dependencies": { + "@holo-host/identicon": "^0.1.0", + "@holochain/client": "^0.18.0-dev.13", + "@lit/localize": "^0.12.0", + "@mdi/js": "^7.1.96", + "@shoelace-style/shoelace": "^2.11.0", + "lit": "^3.0.2", + "prosemirror-commands": "^1.5.2", + "prosemirror-keymap": "^1.2.2", + "prosemirror-state": "^1.4.3", + "prosemirror-view": "^1.31.3" + } + }, + "node_modules/@holochain-open-dev/elements/node_modules/@holochain/client": { + "version": "0.18.0-rc.0", + "resolved": "https://registry.npmjs.org/@holochain/client/-/client-0.18.0-rc.0.tgz", + "integrity": "sha512-y9dfvrnUL4OeIhW+yHUnsjsBMoWvL1HnvUKGjfoBQDBsqJGpanmysV6ALScNErF5axPVZ30/m0nmQ9NgpFzUGg==", + "dependencies": { + "@bitgo/blake2b": "^3.2.4", + "@holochain/serialization": "^0.1.0-beta-rc.3", + "@msgpack/msgpack": "^2.8.0", + "emittery": "^1.0.1", + "isomorphic-ws": "^5.0.0", + "js-base64": "^3.7.5", + "libsodium-wrappers": "^0.7.13", + "lodash-es": "^4.17.21", + "ws": "^8.14.2" + }, + "engines": { + "node": ">=18.0.0 || >=20.0.0" + } + }, + "node_modules/@holochain-open-dev/profiles": { + "version": "0.400.0-dev.4", + "resolved": "https://registry.npmjs.org/@holochain-open-dev/profiles/-/profiles-0.400.0-dev.4.tgz", + "integrity": "sha512-fwYpbPmdxbPv9DlnXXmhk/BGka6j/ovPGj4EkN5Uv3ao3BNHHIhBm39dRmlJVC8JXOJCPYeIkeEOM6/92A61aw==", + "dependencies": { + "@holochain-open-dev/elements": "0.400.0-dev.3", + "@holochain-open-dev/stores": "0.400.0-dev.3", + "@holochain-open-dev/utils": "0.400.0-dev.4", + "@holochain/client": "^0.18.0-dev.13", + "@lit/context": "^1.0.1", + "@lit/localize": "^0.12.0", + "@mdi/js": "^7.1.96", + "@shoelace-style/shoelace": "^2.11.0", + "lit": "^3.0.2" + } + }, + "node_modules/@holochain-open-dev/profiles/node_modules/@holochain/client": { + "version": "0.18.0-rc.0", + "resolved": "https://registry.npmjs.org/@holochain/client/-/client-0.18.0-rc.0.tgz", + "integrity": "sha512-y9dfvrnUL4OeIhW+yHUnsjsBMoWvL1HnvUKGjfoBQDBsqJGpanmysV6ALScNErF5axPVZ30/m0nmQ9NgpFzUGg==", + "dependencies": { + "@bitgo/blake2b": "^3.2.4", + "@holochain/serialization": "^0.1.0-beta-rc.3", + "@msgpack/msgpack": "^2.8.0", + "emittery": "^1.0.1", + "isomorphic-ws": "^5.0.0", + "js-base64": "^3.7.5", + "libsodium-wrappers": "^0.7.13", + "lodash-es": "^4.17.21", + "ws": "^8.14.2" + }, + "engines": { + "node": ">=18.0.0 || >=20.0.0" + } + }, + "node_modules/@holochain-open-dev/stores": { + "version": "0.400.0-dev.3", + "resolved": "https://registry.npmjs.org/@holochain-open-dev/stores/-/stores-0.400.0-dev.3.tgz", + "integrity": "sha512-keo5lLzsz151tCLLHKfbmcEYd7aDpFMDhG9QphvloqETuVAX/MRINrrgY8yEaas2upmTBI+G2avs9VZLXc1mxw==", + "dependencies": { + "@alenaksu/json-viewer": "^2.0.1", + "@holochain-open-dev/utils": "^0.400.0-dev.4", + "@holochain/client": "^0.18.0-dev.13", + "@scoped-elements/cytoscape": "^0.2.0", + "@shoelace-style/shoelace": "^2.11.2", + "lit": "^3.0.2", + "lit-svelte-stores": "^0.3.0", + "svelte": "^3.53.1" + } + }, + "node_modules/@holochain-open-dev/stores/node_modules/@holochain/client": { + "version": "0.18.0-rc.0", + "resolved": "https://registry.npmjs.org/@holochain/client/-/client-0.18.0-rc.0.tgz", + "integrity": "sha512-y9dfvrnUL4OeIhW+yHUnsjsBMoWvL1HnvUKGjfoBQDBsqJGpanmysV6ALScNErF5axPVZ30/m0nmQ9NgpFzUGg==", + "dependencies": { + "@bitgo/blake2b": "^3.2.4", + "@holochain/serialization": "^0.1.0-beta-rc.3", + "@msgpack/msgpack": "^2.8.0", + "emittery": "^1.0.1", + "isomorphic-ws": "^5.0.0", + "js-base64": "^3.7.5", + "libsodium-wrappers": "^0.7.13", + "lodash-es": "^4.17.21", + "ws": "^8.14.2" + }, + "engines": { + "node": ">=18.0.0 || >=20.0.0" + } + }, "node_modules/@holochain-open-dev/utils": { "version": "0.400.0-dev.4", "resolved": "https://registry.npmjs.org/@holochain-open-dev/utils/-/utils-0.400.0-dev.4.tgz", @@ -956,6 +1117,110 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@lightningrodlabs/we-rust-utils": { + "version": "0.400.0-dev.12", + "resolved": "https://registry.npmjs.org/@lightningrodlabs/we-rust-utils/-/we-rust-utils-0.400.0-dev.12.tgz", + "integrity": "sha512-hHxHMHwsueDk0CqXdnKf4/eIaFTU4C6UNFO1hZDPUkc2NmZ2fmC5GmtMYKajJvrT0KC3sRRpqC4k78Ctuq0Crg==", + "dev": true, + "engines": { + "node": ">= 10" + }, + "optionalDependencies": { + "@lightningrodlabs/we-rust-utils-darwin-arm64": "0.400.0-dev.12", + "@lightningrodlabs/we-rust-utils-darwin-x64": "0.400.0-dev.12", + "@lightningrodlabs/we-rust-utils-linux-x64-gnu": "0.400.0-dev.12", + "@lightningrodlabs/we-rust-utils-win32-x64-msvc": "0.400.0-dev.12" + } + }, + "node_modules/@lightningrodlabs/we-rust-utils-darwin-arm64": { + "version": "0.400.0-dev.12", + "resolved": "https://registry.npmjs.org/@lightningrodlabs/we-rust-utils-darwin-arm64/-/we-rust-utils-darwin-arm64-0.400.0-dev.12.tgz", + "integrity": "sha512-tIfjYSxsdNzBhB7pKuKCZF4wQQ2q0jiJ7hyDyWqpll7gWiEq76h9E7mIRZMnS5geUZst3FLg124E8mFUKFFG2A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@lightningrodlabs/we-rust-utils-darwin-x64": { + "version": "0.400.0-dev.12", + "resolved": "https://registry.npmjs.org/@lightningrodlabs/we-rust-utils-darwin-x64/-/we-rust-utils-darwin-x64-0.400.0-dev.12.tgz", + "integrity": "sha512-28iceGbg77MweUfEdZig0lyOan+IMmB9PnnWoYXjfwBfSjuC672aUrcxFbjfWvg07qTmw3u/SOL1voqszK0uNg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@lightningrodlabs/we-rust-utils-linux-x64-gnu": { + "version": "0.400.0-dev.12", + "resolved": "https://registry.npmjs.org/@lightningrodlabs/we-rust-utils-linux-x64-gnu/-/we-rust-utils-linux-x64-gnu-0.400.0-dev.12.tgz", + "integrity": "sha512-8DhzdVqQdCrS8VsRkopW2x8lWpoWf5hXQODRz2th3Lqy3sU8OZZTLt3qGBKCl0qjBeQlNnvApUzdsIKwRqxk6g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@lightningrodlabs/we-rust-utils-win32-x64-msvc": { + "version": "0.400.0-dev.12", + "resolved": "https://registry.npmjs.org/@lightningrodlabs/we-rust-utils-win32-x64-msvc/-/we-rust-utils-win32-x64-msvc-0.400.0-dev.12.tgz", + "integrity": "sha512-iP54daZSJsomgzp2bF6udnfSQ+fBwepr/mqdcsEV2KC8q45kGKEfYGns/U5sgyVGZU2C9Tedk2uAMbHE9cYq4w==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, "node_modules/@lit-labs/ssr-dom-shim": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@lit-labs/ssr-dom-shim/-/ssr-dom-shim-1.2.1.tgz", @@ -971,6 +1236,22 @@ "@lit/reactive-element": "^1.6.2 || ^2.0.0" } }, + "node_modules/@lit/localize": { + "version": "0.12.2", + "resolved": "https://registry.npmjs.org/@lit/localize/-/localize-0.12.2.tgz", + "integrity": "sha512-Qv9kvgJKDq/JVSwXOxuWvQnnOBysHA99ti9im9a4fImCmx+fto+XXcUYQbjZHqiueEEc4V20PcRDPO+1g/6seQ==", + "dependencies": { + "lit": "^3.2.0" + } + }, + "node_modules/@lit/react": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@lit/react/-/react-1.0.6.tgz", + "integrity": "sha512-QIss8MPh6qUoFJmuaF4dSHts3qCsA36S3HcOLiNPShxhgYPr4XJRnCBKPipk85sR9xr6TQrOcDMfexwbNdJHYA==", + "peerDependencies": { + "@types/react": "17 || 18" + } + }, "node_modules/@lit/reactive-element": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-2.0.4.tgz", @@ -989,6 +1270,74 @@ "@lit/reactive-element": "^1.0.0 || ^2.0.0" } }, + "node_modules/@matthme/electron-updater": { + "version": "6.3.0-alpha.1", + "resolved": "https://registry.npmjs.org/@matthme/electron-updater/-/electron-updater-6.3.0-alpha.1.tgz", + "integrity": "sha512-k6oaZzT3XWE6hY1IchR5kZ0eEb9sVp9K3+BVtG88rA8aqvI9OJJrGZlCFStO4AXmLgZ/U/MUbWih4eHMS9eDcQ==", + "dev": true, + "dependencies": { + "builder-util-runtime": "9.2.5-alpha.2", + "fs-extra": "^10.1.0", + "js-yaml": "^4.1.0", + "lazy-val": "^1.0.5", + "lodash.escaperegexp": "^4.1.2", + "lodash.isequal": "^4.5.0", + "semver": "^7.3.8", + "tiny-typed-emitter": "^2.1.0" + } + }, + "node_modules/@matthme/electron-updater/node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@matthme/electron-updater/node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/@matthme/electron-updater/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@matthme/electron-updater/node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/@mdi/js": { + "version": "7.4.47", + "resolved": "https://registry.npmjs.org/@mdi/js/-/js-7.4.47.tgz", + "integrity": "sha512-KPnNOtm5i2pMabqZxpUz7iQf+mfrYZyKCZ8QNz85czgEt7cuHcGorWfdzUMWYA0SD+a6Hn4FmJ+YhzzzjkTZrQ==" + }, "node_modules/@msgpack/msgpack": { "version": "2.8.0", "resolved": "https://registry.npmjs.org/@msgpack/msgpack/-/msgpack-2.8.0.tgz", @@ -1036,6 +1385,20 @@ "node": ">= 8" } }, + "node_modules/@open-wc/dedupe-mixin": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@open-wc/dedupe-mixin/-/dedupe-mixin-1.4.0.tgz", + "integrity": "sha512-Sj7gKl1TLcDbF7B6KUhtvr+1UCxdhMbNY5KxdU5IfMFWqL8oy1ZeAcCANjoB1TL0AJTcPmcCFsCbHf8X2jGDUA==" + }, + "node_modules/@open-wc/scoped-elements": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/@open-wc/scoped-elements/-/scoped-elements-2.2.4.tgz", + "integrity": "sha512-12X4F4QGPWcvPbxAiJ4v8wQFCOu+laZHRGfTrkoj+3JzACCtuxHG49YbuqVzQ135QPKCuhP9wA0kpGGEfUegyg==", + "dependencies": { + "@lit/reactive-element": "^1.0.0 || ^2.0.0", + "@open-wc/dedupe-mixin": "^1.4.0" + } + }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", @@ -1293,38 +1656,297 @@ "x64" ], "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@scoped-elements/cytoscape": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@scoped-elements/cytoscape/-/cytoscape-0.2.1.tgz", + "integrity": "sha512-IYeDqiSdYaSYs4jT8bQCFX1J7YJWCeYV9ZDR++KRrxpcDnqmb96SlYwZRp9AYxEJbE1kvGltRAE3ttu1hI5PFA==", + "dependencies": { + "@open-wc/scoped-elements": "^2.0.1", + "@types/cytoscape": "^3.19.0", + "cytoscape": "^3.20.0", + "cytoscape-cola": "^2.5.0", + "cytoscape-cose-bilkent": "^4.1.0", + "cytoscape-dagre": "^2.3.2", + "cytoscape-klay": "^3.1.4", + "lit": "^2.0.2", + "lodash-es": "^4.17.21" + } + }, + "node_modules/@scoped-elements/cytoscape/node_modules/@lit/reactive-element": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-1.6.3.tgz", + "integrity": "sha512-QuTgnG52Poic7uM1AN5yJ09QMe0O28e10XzSvWDz02TJiiKee4stsiownEIadWm8nYzyDAyT+gKzUoZmiWQtsQ==", + "dependencies": { + "@lit-labs/ssr-dom-shim": "^1.0.0" + } + }, + "node_modules/@scoped-elements/cytoscape/node_modules/lit": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/lit/-/lit-2.8.0.tgz", + "integrity": "sha512-4Sc3OFX9QHOJaHbmTMk28SYgVxLN3ePDjg7hofEft2zWlehFL3LiAuapWc4U/kYwMYJSh2hTCPZ6/LIC7ii0MA==", + "dependencies": { + "@lit/reactive-element": "^1.6.0", + "lit-element": "^3.3.0", + "lit-html": "^2.8.0" + } + }, + "node_modules/@scoped-elements/cytoscape/node_modules/lit-element": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/lit-element/-/lit-element-3.3.3.tgz", + "integrity": "sha512-XbeRxmTHubXENkV4h8RIPyr8lXc+Ff28rkcQzw3G6up2xg5E8Zu1IgOWIwBLEQsu3cOVFqdYwiVi0hv0SlpqUA==", + "dependencies": { + "@lit-labs/ssr-dom-shim": "^1.1.0", + "@lit/reactive-element": "^1.3.0", + "lit-html": "^2.8.0" + } + }, + "node_modules/@scoped-elements/cytoscape/node_modules/lit-html": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-2.8.0.tgz", + "integrity": "sha512-o9t+MQM3P4y7M7yNzqAyjp7z+mQGa4NS4CxiyLqFPyFWyc4O+nodLrkrxSaCTrla6M5YOLaT3RpbbqjszB5g3Q==", + "dependencies": { + "@types/trusted-types": "^2.0.2" + } + }, + "node_modules/@shoelace-style/animations": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@shoelace-style/animations/-/animations-1.2.0.tgz", + "integrity": "sha512-avvo1xxkLbv2dgtabdewBbqcJfV0e0zCwFqkPMnHFGbJbBHorRFfMAHh1NG9ymmXn0jW95ibUVH03E1NYXD6Gw==", + "funding": { + "type": "individual", + "url": "https://github.com/sponsors/claviska" + } + }, + "node_modules/@shoelace-style/localize": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@shoelace-style/localize/-/localize-3.2.1.tgz", + "integrity": "sha512-r4C9C/5kSfMBIr0D9imvpRdCNXtUNgyYThc4YlS6K5Hchv1UyxNQ9mxwj+BTRH2i1Neits260sR3OjKMnplsFA==" + }, + "node_modules/@shoelace-style/shoelace": { + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/@shoelace-style/shoelace/-/shoelace-2.18.0.tgz", + "integrity": "sha512-uzpL0+8Qm8aE2ArcXBcKHkaPc6l7ymuVaN6xJM0yd2o3talcoXpuP+gRBsgggSZKuuJEa+JkEuLDdzzFnE/+jw==", + "dependencies": { + "@ctrl/tinycolor": "^4.0.2", + "@floating-ui/dom": "^1.5.3", + "@lit/react": "^1.0.0", + "@shoelace-style/animations": "^1.1.0", + "@shoelace-style/localize": "^3.1.2", + "composed-offset-position": "^0.0.4", + "lit": "^3.0.0", + "qr-creator": "^1.0.0" + }, + "engines": { + "node": ">=14.17.0" + }, + "funding": { + "type": "individual", + "url": "https://github.com/sponsors/claviska" + } + }, + "node_modules/@sindresorhus/is": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", + "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" + } + }, + "node_modules/@szmarczak/http-timer": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz", + "integrity": "sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==", + "dev": true, + "license": "MIT", + "dependencies": { + "defer-to-connect": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@theweave/api": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@theweave/api/-/api-0.2.1.tgz", + "integrity": "sha512-IHOIVNA3jRQKpDS/rgFdghpiNHfoVw2R6FPMB7QZQW+PCDwVVxtsGCsS5SRKM4zLbOHqSFnar55wGEbL9bmwZg==", + "dependencies": { + "@holochain-open-dev/profiles": "0.400.0-dev.4", + "@holochain/client": "0.18.0-dev.13", + "@msgpack/msgpack": "^2.8.0", + "js-base64": "^3.7.2" + } + }, + "node_modules/@theweave/api/node_modules/@holochain/client": { + "version": "0.18.0-dev.13", + "resolved": "https://registry.npmjs.org/@holochain/client/-/client-0.18.0-dev.13.tgz", + "integrity": "sha512-pwmqsVRhzERt036Ms3Nch7UT94u1+kEPnGF1rcYParrx8lE5aol5XxW5UqS1wiIoadd5iYjYXJE8CJI2fga0Sg==", + "dependencies": { + "@bitgo/blake2b": "^3.2.4", + "@holochain/serialization": "^0.1.0-beta-rc.3", + "@msgpack/msgpack": "^2.8.0", + "emittery": "^1.0.1", + "isomorphic-ws": "^5.0.0", + "js-base64": "^3.7.5", + "libsodium-wrappers": "^0.7.13", + "lodash-es": "^4.17.21", + "ws": "^8.14.2" + }, + "engines": { + "node": ">=18.0.0 || >=20.0.0" + } + }, + "node_modules/@theweave/cli": { + "version": "0.13.0-gamma.6", + "resolved": "https://registry.npmjs.org/@theweave/cli/-/cli-0.13.0-gamma.6.tgz", + "integrity": "sha512-QwFbnaP6JLgozT6N1O8oNYZHCIEFsVIZyZlSu3WiV9SWouePeGc9DqukV394/v5sH//PpboeEu5IQdDo3YXapg==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "@electron-toolkit/preload": "^2.0.0", + "@electron-toolkit/utils": "^2.0.0", + "@holochain-open-dev/utils": "0.400.0-dev.4", + "@holochain/client": "0.18.0-dev.13", + "@lightningrodlabs/we-rust-utils": "0.400.0-dev.12", + "@matthme/electron-updater": "6.3.0-alpha.1", + "@msgpack/msgpack": "^2.8.0", + "@theweave/api": "0.2.0", + "adm-zip": "0.5.14", + "bufferutil": "4.0.8", + "commander": "11.1.0", + "electron": "^29.3.1", + "electron-context-menu": "3.6.1", + "mime": "4.0.0", + "nanoid": "5.0.4", + "split": "1.0.1", + "ts-node": "10.9.2", + "utf-8-validate": "^6.0.3", + "uuid": "9.0.1", + "winston": "3.11.0" + }, + "bin": { + "weave": "cli.js" + } + }, + "node_modules/@theweave/cli/node_modules/@electron-toolkit/preload": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@electron-toolkit/preload/-/preload-2.0.0.tgz", + "integrity": "sha512-zpZDzbqJTZQC5d4LRs2EKruKWnqah+T75s+niBYFemYLtiW5TTZcWi3Q8UxHqnwTudDMuWJb233aaS2yjx3Xiw==", + "dev": true, + "peerDependencies": { + "electron": ">=13.0.0" + } + }, + "node_modules/@theweave/cli/node_modules/@electron-toolkit/utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@electron-toolkit/utils/-/utils-2.0.1.tgz", + "integrity": "sha512-3nnjd3D1NIjxdzNrvR5fkJ3kbJNbRkpHppv0/pSbMX6I0DaBzpPXeSfDYuJJKzZrAc3CmGcJa0MU4+AjEOlT4g==", + "dev": true, + "peerDependencies": { + "electron": ">=13.0.0" + } }, - "node_modules/@sindresorhus/is": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", - "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", + "node_modules/@theweave/cli/node_modules/@holochain/client": { + "version": "0.18.0-dev.13", + "resolved": "https://registry.npmjs.org/@holochain/client/-/client-0.18.0-dev.13.tgz", + "integrity": "sha512-pwmqsVRhzERt036Ms3Nch7UT94u1+kEPnGF1rcYParrx8lE5aol5XxW5UqS1wiIoadd5iYjYXJE8CJI2fga0Sg==", "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" + "dependencies": { + "@bitgo/blake2b": "^3.2.4", + "@holochain/serialization": "^0.1.0-beta-rc.3", + "@msgpack/msgpack": "^2.8.0", + "emittery": "^1.0.1", + "isomorphic-ws": "^5.0.0", + "js-base64": "^3.7.5", + "libsodium-wrappers": "^0.7.13", + "lodash-es": "^4.17.21", + "ws": "^8.14.2" }, - "funding": { - "url": "https://github.com/sindresorhus/is?sponsor=1" + "engines": { + "node": ">=18.0.0 || >=20.0.0" } }, - "node_modules/@szmarczak/http-timer": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz", - "integrity": "sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==", + "node_modules/@theweave/cli/node_modules/@theweave/api": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@theweave/api/-/api-0.2.0.tgz", + "integrity": "sha512-JrY8Q3g3JEzz44PO8NulNIAGH+jLslre9htHEoWG+kjpF+AeYOMGtPGf18GuFRiJdumIPocPTqOls3L+H05Wtg==", "dev": true, - "license": "MIT", "dependencies": { - "defer-to-connect": "^2.0.0" + "@holochain-open-dev/profiles": "0.400.0-dev.4", + "@holochain/client": "0.18.0-dev.13", + "@msgpack/msgpack": "^2.8.0", + "js-base64": "^3.7.2" + } + }, + "node_modules/@theweave/cli/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "dev": true, + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/@theweave/cli/node_modules/winston": { + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/winston/-/winston-3.11.0.tgz", + "integrity": "sha512-L3yR6/MzZAOl0DsysUXHVjOwv8mKZ71TrA/41EIduGpOOV5LQVodqN+QdQ6BS6PJ/RdIshZhq84P/fStEZkk7g==", + "dev": true, + "dependencies": { + "@colors/colors": "^1.6.0", + "@dabh/diagnostics": "^2.0.2", + "async": "^3.2.3", + "is-stream": "^2.0.0", + "logform": "^2.4.0", + "one-time": "^1.0.0", + "readable-stream": "^3.4.0", + "safe-stable-stringify": "^2.3.1", + "stack-trace": "0.0.x", + "triple-beam": "^1.3.0", + "winston-transport": "^4.5.0" }, "engines": { - "node": ">=10" + "node": ">= 12.0.0" } }, + "node_modules/@tsconfig/node10": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", + "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", + "dev": true + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true + }, "node_modules/@types/cacheable-request": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.3.tgz", @@ -1353,6 +1975,11 @@ "@types/chai": "*" } }, + "node_modules/@types/cytoscape": { + "version": "3.21.8", + "resolved": "https://registry.npmjs.org/@types/cytoscape/-/cytoscape-3.21.8.tgz", + "integrity": "sha512-6Bo9ZDrv0vfwe8Sg/ERc5VL0yU0gYvP4dgZi0fAXYkKHfyHaNqWRMcwYm3mu4sLsXbB8ZuXE75sR7qnaOL5JgQ==" + }, "node_modules/@types/estree": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", @@ -1400,6 +2027,22 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/prop-types": { + "version": "15.7.13", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.13.tgz", + "integrity": "sha512-hCZTSvwbzWGvhqxp/RqVqwU999pBf2vp7hzIjiYOsl8wqOmUxkQ6ddw1cV3l8811+kdUFus/q4d1Y3E3SyEifA==", + "peer": true + }, + "node_modules/@types/react": { + "version": "18.3.12", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.12.tgz", + "integrity": "sha512-D2wOSq/d6Agt28q7rSI3jhU7G6aiuzljDGZ2hTZHIkrTLUI+AF3WMeKkEZ9nN2fkBAlcktT6vcZjDFiIhMYEQw==", + "peer": true, + "dependencies": { + "@types/prop-types": "*", + "csstype": "^3.0.2" + } + }, "node_modules/@types/responselike": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.3.tgz", @@ -1646,6 +2289,15 @@ "node": ">=0.4.0" } }, + "node_modules/adm-zip": { + "version": "0.5.14", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.14.tgz", + "integrity": "sha512-DnyqqifT4Jrcvb8USYjp6FHtBpEIz1mnXu6pTRHZ0RL69LbQYiO+0lDFg5+OKA7U29oWSs3a/i8fhn8ZcceIWg==", + "dev": true, + "engines": { + "node": ">=12.0" + } + }, "node_modules/ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -1788,6 +2440,18 @@ "safe-buffer": "~5.1.0" } }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, "node_modules/arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", @@ -1988,6 +2652,19 @@ "node": ">=6.14.2" } }, + "node_modules/builder-util-runtime": { + "version": "9.2.5-alpha.2", + "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-9.2.5-alpha.2.tgz", + "integrity": "sha512-/Ln2ddejGj2HNMJ+X66mKHRcOvmRzUO/dSi8t4hSV64J7IA+DE+mqDb+zogIE2gin7p7YwcGiOkKny4nwPPPXg==", + "dev": true, + "dependencies": { + "debug": "^4.3.4", + "sax": "^1.2.4" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/cac": { "version": "6.7.14", "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", @@ -2259,6 +2936,11 @@ "node": ">=16" } }, + "node_modules/composed-offset-position": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/composed-offset-position/-/composed-offset-position-0.0.4.tgz", + "integrity": "sha512-vMlvu1RuNegVE0YsCDSV/X4X10j56mq7PCIyOKK74FxkXzGLwhOUmdkJLSdOBOMwWycobGUMgft2lp+YgTe8hw==" + }, "node_modules/compress-commons": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-4.1.2.tgz", @@ -2318,6 +3000,14 @@ "dev": true, "license": "MIT" }, + "node_modules/cose-base": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/cose-base/-/cose-base-1.0.3.tgz", + "integrity": "sha512-s9whTXInMSgAp/NVXVNuVxVKzGH2qck3aQlVHxDCdAEPgtMKwc4Wq6/QKhgdEdgbLSi9rBTAcPoRa6JpiG4ksg==", + "dependencies": { + "layout-base": "^1.0.0" + } + }, "node_modules/crc-32": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", @@ -2345,6 +3035,12 @@ "node": ">= 10" } }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -2360,6 +3056,110 @@ "node": ">= 8" } }, + "node_modules/csstype": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", + "peer": true + }, + "node_modules/cytoscape": { + "version": "3.30.3", + "resolved": "https://registry.npmjs.org/cytoscape/-/cytoscape-3.30.3.tgz", + "integrity": "sha512-HncJ9gGJbVtw7YXtIs3+6YAFSSiKsom0amWc33Z7QbylbY2JGMrA0yz4EwrdTScZxnwclXeEZHzO5pxoy0ZE4g==", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/cytoscape-cola": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/cytoscape-cola/-/cytoscape-cola-2.5.1.tgz", + "integrity": "sha512-4/2S9bW1LvdsEPmxXN1OEAPFPbk7DvCx2c9d+TblkQAAvptGaSgtPWCByTEGgT8UxCxcVqes2aFPO5pzwo7R2w==", + "dependencies": { + "webcola": "^3.4.0" + }, + "peerDependencies": { + "cytoscape": "^3.2.0" + } + }, + "node_modules/cytoscape-cose-bilkent": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cytoscape-cose-bilkent/-/cytoscape-cose-bilkent-4.1.0.tgz", + "integrity": "sha512-wgQlVIUJF13Quxiv5e1gstZ08rnZj2XaLHGoFMYXz7SkNfCDOOteKBE6SYRfA9WxxI/iBc3ajfDoc6hb/MRAHQ==", + "dependencies": { + "cose-base": "^1.0.0" + }, + "peerDependencies": { + "cytoscape": "^3.2.0" + } + }, + "node_modules/cytoscape-dagre": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/cytoscape-dagre/-/cytoscape-dagre-2.5.0.tgz", + "integrity": "sha512-VG2Knemmshop4kh5fpLO27rYcyUaaDkRw+6PiX4bstpB+QFt0p2oauMrsjVbUamGWQ6YNavh7x2em2uZlzV44g==", + "dependencies": { + "dagre": "^0.8.5" + }, + "peerDependencies": { + "cytoscape": "^3.2.22" + } + }, + "node_modules/cytoscape-klay": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/cytoscape-klay/-/cytoscape-klay-3.1.4.tgz", + "integrity": "sha512-VwPj0VR25GPfy6qXVQRi/MYlZM/zkdvRhHlgqbM//lSvstgM6fhp3ik/uM8Wr8nlhskfqz/M1fIDmR6UckbS2A==", + "dependencies": { + "klayjs": "^0.4.1" + }, + "peerDependencies": { + "cytoscape": "^3.2.0" + } + }, + "node_modules/d3-dispatch": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-1.0.6.tgz", + "integrity": "sha512-fVjoElzjhCEy+Hbn8KygnmMS7Or0a9sI2UzGwoB7cCtvI1XpVN9GpoYlnb3xt2YV66oXYb1fLJ8GMvP4hdU1RA==" + }, + "node_modules/d3-drag": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-1.2.5.tgz", + "integrity": "sha512-rD1ohlkKQwMZYkQlYVCrSFxsWPzI97+W+PaEIBNTMxRuxz9RF0Hi5nJWHGVJ3Om9d2fRTe1yOBINJyy/ahV95w==", + "dependencies": { + "d3-dispatch": "1", + "d3-selection": "1" + } + }, + "node_modules/d3-path": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-1.0.9.tgz", + "integrity": "sha512-VLaYcn81dtHVTjEHd8B+pbe9yHWpXKZUC87PzoFmsFrJqgFwDe/qxfp5MlfsfM1V5E/iVt0MmEbWQ7FVIXh/bg==" + }, + "node_modules/d3-selection": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-1.4.2.tgz", + "integrity": "sha512-SJ0BqYihzOjDnnlfyeHT0e30k0K1+5sR3d5fNueCNeuhZTnGw4M4o8mqJchSwgKMXCNFo+e2VTChiSJ0vYtXkg==" + }, + "node_modules/d3-shape": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-1.3.7.tgz", + "integrity": "sha512-EUkvKjqPFUAZyOlhY5gzCxCeI0Aep04LwIRpsZ/mLFelJiUfnK56jo5JMDSE7yyP2kLSb6LtF+S5chMk7uqPqw==", + "dependencies": { + "d3-path": "1" + } + }, + "node_modules/d3-timer": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-1.0.10.tgz", + "integrity": "sha512-B1JDm0XDaQC+uvo4DT79H0XmBskgS3l6Ve+1SBCfxgmtIb1AVrPIoqd+nPSv+loMX8szQ0sVUhGngL7D5QPiXw==" + }, + "node_modules/dagre": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/dagre/-/dagre-0.8.5.tgz", + "integrity": "sha512-/aTqmnRta7x7MCCpExk7HQL2O4owCT2h8NT//9I1OQ9vt29Pa0BzSAkR5lwFUcQ7491yVi/3CXU9jQ5o0Mn2Sw==", + "dependencies": { + "graphlib": "^2.1.8", + "lodash": "^4.17.15" + } + }, "node_modules/date-fns": { "version": "2.30.0", "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", @@ -3229,6 +4029,14 @@ "dev": true, "license": "ISC" }, + "node_modules/graphlib": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/graphlib/-/graphlib-2.1.8.tgz", + "integrity": "sha512-jcLLfkpoVGmH7/InMC/1hIvOPSUh38oJtGhvrOFGzioE1DZ+0YW16RgmOJhHiuWTvGiJQ9Z1Ik43JvkRPRvE+A==", + "dependencies": { + "lodash": "^4.17.15" + } + }, "node_modules/hard-rejection": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", @@ -3542,6 +4350,18 @@ "dev": true, "license": "MIT" }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", @@ -3594,12 +4414,28 @@ "node": ">=0.10.0" } }, + "node_modules/klayjs": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/klayjs/-/klayjs-0.4.1.tgz", + "integrity": "sha512-WUNxuO7O79TEkxCj6OIaK5TJBkaWaR/IKNTakgV9PwDn+mrr63MLHed34AcE2yTaDntgO6l0zGFIzhcoTeroTA==" + }, "node_modules/kuler": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==", "license": "MIT" }, + "node_modules/layout-base": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/layout-base/-/layout-base-1.0.2.tgz", + "integrity": "sha512-8h2oVEZNktL4BH2JCOI90iD1yXwL6iNW7KcCKT2QZgQJR2vbqDsldCTPRU9NifTCqHZci57XvQQ15YTu+sTYPg==" + }, + "node_modules/lazy-val": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/lazy-val/-/lazy-val-1.0.5.tgz", + "integrity": "sha512-0/BnGCCfyUMkBpeDgWihanIAF9JmZhHBgUhEqzvf+adhNGLoP6TaiI5oF8oyb3I45P+PcnrqihSf01M0l0G5+Q==", + "dev": true + }, "node_modules/lazystream": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz", @@ -3699,6 +4535,16 @@ "@types/trusted-types": "^2.0.2" } }, + "node_modules/lit-svelte-stores": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/lit-svelte-stores/-/lit-svelte-stores-0.3.3.tgz", + "integrity": "sha512-jtaHfgSlDuiwzmKHr6iF9uW6wV/CMRkj6QRCOnKrtRdb+uAUIiqhhNhBV2JXDO0OpCcTpqkM8kOEnotlLAYEAQ==", + "dependencies": { + "lit": "^3.0.0", + "lodash-es": "^4.17.21", + "svelte": "^3.38.3" + } + }, "node_modules/local-pkg": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.3.tgz", @@ -3760,6 +4606,12 @@ "dev": true, "license": "MIT" }, + "node_modules/lodash.escaperegexp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz", + "integrity": "sha512-TM9YBvyC84ZxE3rgfefxUWiQKLilstD6k7PTGt6wfbtXF8ixIJLOL3VYyV/z+ZiPLsVxAsKAFVwWlWeb2Y8Yyw==", + "dev": true + }, "node_modules/lodash.flatten": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", @@ -3767,6 +4619,12 @@ "dev": true, "license": "MIT" }, + "node_modules/lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==", + "dev": true + }, "node_modules/lodash.isplainobject": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", @@ -3837,6 +4695,12 @@ "node": ">=10" } }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, "node_modules/map-obj": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", @@ -3915,6 +4779,21 @@ "node": ">=8.6" } }, + "node_modules/mime": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-4.0.0.tgz", + "integrity": "sha512-pzhgdeqU5pJ9t5WK9m4RT4GgGWqYJylxUf62Yb9datXRwdcw5MjiD1BYI5evF8AgTXN9gtKX3CFLvCUL5fAhEA==", + "dev": true, + "funding": [ + "https://github.com/sponsors/broofa" + ], + "bin": { + "mime": "bin/cli.js" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/mime-db": { "version": "1.53.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.53.0.tgz", @@ -4143,6 +5022,11 @@ "fn.name": "1.x.x" } }, + "node_modules/orderedmap": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/orderedmap/-/orderedmap-2.1.1.tgz", + "integrity": "sha512-TvAWxi0nDe1j/rtMcWcIj94+Ffe6n7zhow33h40SKxmsmozs6dz/e+EajymfoFcHd7sxNn8yHM8839uixMOV6g==" + }, "node_modules/p-cancelable": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", @@ -4452,6 +5336,61 @@ "node": ">=0.4.0" } }, + "node_modules/prosemirror-commands": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/prosemirror-commands/-/prosemirror-commands-1.6.2.tgz", + "integrity": "sha512-0nDHH++qcf/BuPLYvmqZTUUsPJUCPBUXt0J1ErTcDIS369CTp773itzLGIgIXG4LJXOlwYCr44+Mh4ii6MP1QA==", + "dependencies": { + "prosemirror-model": "^1.0.0", + "prosemirror-state": "^1.0.0", + "prosemirror-transform": "^1.10.2" + } + }, + "node_modules/prosemirror-keymap": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/prosemirror-keymap/-/prosemirror-keymap-1.2.2.tgz", + "integrity": "sha512-EAlXoksqC6Vbocqc0GtzCruZEzYgrn+iiGnNjsJsH4mrnIGex4qbLdWWNza3AW5W36ZRrlBID0eM6bdKH4OStQ==", + "dependencies": { + "prosemirror-state": "^1.0.0", + "w3c-keyname": "^2.2.0" + } + }, + "node_modules/prosemirror-model": { + "version": "1.23.0", + "resolved": "https://registry.npmjs.org/prosemirror-model/-/prosemirror-model-1.23.0.tgz", + "integrity": "sha512-Q/fgsgl/dlOAW9ILu4OOhYWQbc7TQd4BwKH/RwmUjyVf8682Be4zj3rOYdLnYEcGzyg8LL9Q5IWYKD8tdToreQ==", + "dependencies": { + "orderedmap": "^2.0.0" + } + }, + "node_modules/prosemirror-state": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/prosemirror-state/-/prosemirror-state-1.4.3.tgz", + "integrity": "sha512-goFKORVbvPuAQaXhpbemJFRKJ2aixr+AZMGiquiqKxaucC6hlpHNZHWgz5R7dS4roHiwq9vDctE//CZ++o0W1Q==", + "dependencies": { + "prosemirror-model": "^1.0.0", + "prosemirror-transform": "^1.0.0", + "prosemirror-view": "^1.27.0" + } + }, + "node_modules/prosemirror-transform": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/prosemirror-transform/-/prosemirror-transform-1.10.2.tgz", + "integrity": "sha512-2iUq0wv2iRoJO/zj5mv8uDUriOHWzXRnOTVgCzSXnktS/2iQRa3UUQwVlkBlYZFtygw6Nh1+X4mGqoYBINn5KQ==", + "dependencies": { + "prosemirror-model": "^1.21.0" + } + }, + "node_modules/prosemirror-view": { + "version": "1.35.0", + "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.35.0.tgz", + "integrity": "sha512-Umtbh22fmUlpZpRTiOVXA0PpdRZeYEeXQsLp51VfnMhjkJrqJ0n8APinIZrRAD5Jr3UxH8FnOaUqRylSuMsqHA==", + "dependencies": { + "prosemirror-model": "^1.20.0", + "prosemirror-state": "^1.0.0", + "prosemirror-transform": "^1.1.0" + } + }, "node_modules/pump": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.2.tgz", @@ -4476,6 +5415,11 @@ "node": ">=8" } }, + "node_modules/qr-creator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/qr-creator/-/qr-creator-1.0.0.tgz", + "integrity": "sha512-C0cqfbS1P5hfqN4NhsYsUXePlk9BO+a45bAQ3xLYjBL3bOIFzoVEjs79Fado9u9BPBD3buHi3+vY+C8tHh4qMQ==" + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -4891,6 +5835,12 @@ "node": ">=10" } }, + "node_modules/sax": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz", + "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==", + "dev": true + }, "node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -5338,6 +6288,12 @@ "dev": true, "license": "MIT" }, + "node_modules/tiny-typed-emitter": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tiny-typed-emitter/-/tiny-typed-emitter-2.1.0.tgz", + "integrity": "sha512-qVtvMxeXbVej0cQWKqVSSAHmKZEHAvxdF8HEUBFWts8h+xEo5m/lEiPakuyZ3BnCBjOD8i24kzNOiOLLgsSxhA==", + "dev": true + }, "node_modules/tinybench": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", @@ -5407,6 +6363,58 @@ "node": ">= 14.0.0" } }, + "node_modules/ts-node": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/ts-node/node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", @@ -5489,6 +6497,19 @@ "node": ">=8" } }, + "node_modules/utf-8-validate": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-6.0.5.tgz", + "integrity": "sha512-EYZR+OpIXp9Y1eG1iueg8KRsY8TuT8VNgnanZ0uA3STqhHQTLwbl+WX76/9X5OY12yQubymBpaBSmMPkSTQcKA==", + "devOptional": true, + "hasInstallScript": true, + "dependencies": { + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">=6.14.2" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -5504,6 +6525,12 @@ "uuid": "dist/bin/uuid" } }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true + }, "node_modules/validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", @@ -6668,6 +7695,22 @@ "dev": true, "license": "MIT" }, + "node_modules/w3c-keyname": { + "version": "2.2.8", + "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz", + "integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==" + }, + "node_modules/webcola": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/webcola/-/webcola-3.4.0.tgz", + "integrity": "sha512-4BiLXjXw3SJHo3Xd+rF+7fyClT6n7I+AR6TkBqyQ4kTsePSAMDLRCXY1f3B/kXJeP9tYn4G1TblxTO+jAt0gaw==", + "dependencies": { + "d3-dispatch": "^1.0.3", + "d3-drag": "^1.0.4", + "d3-shape": "^1.3.5", + "d3-timer": "^1.0.5" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -6898,6 +7941,15 @@ "fd-slicer": "~1.1.0" } }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", @@ -6987,6 +8039,7 @@ "@lit/context": "^1.1.3", "@lit/task": "^1.0.1", "@msgpack/msgpack": "^2.8.0", + "@theweave/api": "0.2.1", "lit": "^3.2.1" }, "devDependencies": { diff --git a/package.json b/package.json index fd9b841..e845cd0 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "scripts": { "start": "AGENTS=${AGENTS:-2} BOOTSTRAP_PORT=$(get-port) SIGNAL_PORT=$(get-port) npm run network", "network": "hc sandbox clean && npm run build:happ && UI_PORT=$(get-port) concurrently \"npm run start --workspace ui\" \"npm run launch:happ\"", + "tool-dev": "npm run build:happ && concurrently \"UI_PORT=8888 npm run start --workspace ui\" \"weave --agent-idx 1 --dev-config ./weave.dev.config.ts\" \"sleep 5 && weave --agent-idx 2 --dev-config ./weave.dev.config.ts --sync-time 6000\"", "test": "npm run build:zomes && hc app pack workdir --recursive && npm run test --workspace tests", "launch:happ": "hc-spin -n $AGENTS --ui-port $UI_PORT workdir/generic-dna.happ", "start:tauri": "AGENTS=${AGENTS:-2} BOOTSTRAP_PORT=$(get-port) SIGNAL_PORT=$(get-port) npm run network:tauri", @@ -22,6 +23,7 @@ "devDependencies": { "@holochain-playground/cli": "^0.300.1", "@holochain/hc-spin": "^0.400.0-dev.3", + "@theweave/cli": "0.13.0-gamma.6", "concurrently": "^6.5.1", "get-port-cli": "^3.0.0" }, diff --git a/ui/package.json b/ui/package.json index 721dc73..8989ded 100644 --- a/ui/package.json +++ b/ui/package.json @@ -11,6 +11,7 @@ "@holochain/client": "^0.18.0-rc.0", "@holochain/simple-holochain": "file:../lib", "@holochain-open-dev/utils": "0.400.0-dev.4", + "@theweave/api": "0.2.1", "@lit/context": "^1.1.3", "@lit/task": "^1.0.1", "@msgpack/msgpack": "^2.8.0", diff --git a/ui/src/holochain-app.ts b/ui/src/holochain-app.ts index 9f4eefd..f8b28d9 100644 --- a/ui/src/holochain-app.ts +++ b/ui/src/holochain-app.ts @@ -1,5 +1,5 @@ import { ActionHash, AppClient, AppWebsocket, HolochainError } from "@holochain/client"; -import { provide } from "@lit/context"; +import { createContext, provide } from "@lit/context"; import { css, html, LitElement } from "lit"; import { customElement, property, state } from "lit/decorators.js"; @@ -11,6 +11,10 @@ import { SimpleHolochain } from "@holochain/simple-holochain"; import './elements/all-posts'; import './elements/create-post'; import './elements/post-detail'; +import { initializeHotReload, isWeaveContext, WeaveClient } from "@theweave/api"; + +export const weaveClientContext = createContext('weave_client'); + @customElement("holochain-app") export class HolochainApp extends LitElement { @@ -22,12 +26,38 @@ export class HolochainApp extends LitElement { @provide({ context: simpleHolochainContext }) @property({ type: Object }) - client!: SimpleHolochain; + simpleHolochain!: SimpleHolochain; + + @provide({ context: weaveClientContext }) + @property({ type: Object }) + weaveClient!: WeaveClient | undefined; async firstUpdated() { this.loading = true; + if ((import.meta as any).env.DEV) { + try { + await initializeHotReload(); + } catch (e) { + // eslint-disable-next-line no-console + console.warn( + 'Could not initialize applet hot-reloading. This is only expected to work in a We context in dev mode.' + ); + } + } try { - this.client = await SimpleHolochain.connect(); + if (isWeaveContext()) { + const weaveClient = await WeaveClient.connect(); + if ( + weaveClient.renderInfo.type !== 'applet-view' || + !['main'].includes(weaveClient.renderInfo.view.type) + ) + throw new Error( + 'This Tool only implements the applet main and asset views.' + ); + this.simpleHolochain = await SimpleHolochain.connect(weaveClient.renderInfo.appletClient); + } else { + this.simpleHolochain = await SimpleHolochain.connect(); + } } catch (e) { this.error = e as HolochainError; } finally { @@ -36,7 +66,7 @@ export class HolochainApp extends LitElement { } render() { - if (this.loading || !this.client) return html``; + if (this.loading || !this.simpleHolochain) return html``; return html`
diff --git a/weave.dev.config.ts b/weave.dev.config.ts new file mode 100644 index 0000000..e8c94df --- /dev/null +++ b/weave.dev.config.ts @@ -0,0 +1,80 @@ +import { defineConfig } from "@theweave/cli"; + +export default defineConfig({ + groups: [ + { + name: "Tennis Club", + networkSeed: "098rc1m-09384u-crm-29384u-cmkj", + icon: { + type: "https", + url: "https://cdn0.iconfinder.com/data/icons/sports-43/281/sport-sports_21-1024.png", + }, + creatingAgent: { + agentIdx: 1, + agentProfile: { + nickname: "Gaston", + avatar: { + type: "https", + url: "https://i.pinimg.com/originals/38/b2/03/38b20399fd3a5a890ad8e045615ac5bf.jpg", + }, + }, + }, + joiningAgents: [ + { + agentIdx: 2, + agentProfile: { + nickname: "Marsupilami", + avatar: { + type: "https", + url: + "https://1.bp.blogspot.com/-RpUDITUWkpI/TYZSIwI1boI/AAAAAAAAGcQ/dfiskKd9ioM/w1200-h630-p-k-no-nu/marsupilami3.png", + }, + }, + }, + ], + applets: [ + { + name: "SimpleHolochain", + instanceName: "SimpleHolochain", + registeringAgent: 1, + joiningAgents: [2], + }, + { + name: "KanDo", + instanceName: "KanDo", + registeringAgent: 1, + joiningAgents: [2], + }, + ], + }, + ], + applets: [ + { + name: "SimpleHolochain", + subtitle: "An example Weave Tool built using SimpleHolochain", + description: "This is an example Weave Tool built using SimpleHolochain.", + icon: { + type: "https", + url: "https://cdn-icons-png.flaticon.com/512/5110/5110487.png", + }, + source: { + type: "localhost", + happPath: "./workdir/generic-dna.happ", + uiPort: 8888, + }, + }, + { + name: "KanDo", + subtitle: "KanBan board on Holochain", + description: "KanBan board", + icon: { + type: "https", + url: "https://theweave.social/images/kando_icon.png", + }, + source: { + type: "https", + url: "https://github.com/holochain-apps/kando/releases/download/v0.11.0-rc.0/kando.webhapp", + }, + }, + ], +});