diff --git a/package-lock.json b/package-lock.json index d850a029..9cea2308 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "lucide-vue-next": "^0.548.0", + "markdown-it": "^14.1.1", "reka-ui": "^2.6.0", "tailwind-merge": "^3.3.1", "tailwindcss": "^4.1.16", @@ -27,6 +28,7 @@ "@iconify/vue": "^5.0.0", "@tsconfig/node22": "^22.0.2", "@types/jsdom": "^27.0.0", + "@types/markdown-it": "^14.1.2", "@types/node": "^22.18.13", "@vitejs/plugin-vue": "^6.0.1", "@vitest/eslint-plugin": "^1.3.23", @@ -123,7 +125,6 @@ "integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/code-frame": "^7.27.1", "@babel/generator": "^7.28.5", @@ -676,7 +677,6 @@ } ], "license": "MIT", - "peer": true, "engines": { "node": ">=18" }, @@ -720,7 +720,6 @@ } ], "license": "MIT", - "peer": true, "engines": { "node": ">=18" } @@ -2259,6 +2258,31 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/linkify-it": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-5.0.0.tgz", + "integrity": "sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/markdown-it": { + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-14.1.2.tgz", + "integrity": "sha512-promo4eFwuiW+TfGxhi+0x3czqTYJkG8qB17ZUJiVF10Xm7NLVRSLUsfRTU/6h1e24VvRnXCx+hG7li58lkzog==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/linkify-it": "^5", + "@types/mdurl": "^2" + } + }, + "node_modules/@types/mdurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-2.0.0.tgz", + "integrity": "sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/node": { "version": "22.19.1", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.1.tgz", @@ -2328,7 +2352,6 @@ "integrity": "sha512-tK3GPFWbirvNgsNKto+UmB/cRtn6TZfyw0D6IKrW55n6Vbs7KJoZtI//kpTKzE/DUmmnAFD8/Ca46s7Obs92/w==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.46.4", "@typescript-eslint/types": "8.46.4", @@ -3138,7 +3161,6 @@ "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", - "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -3232,7 +3254,6 @@ "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, "license": "Python-2.0" }, "node_modules/aria-hidden": { @@ -3344,7 +3365,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "baseline-browser-mapping": "^2.8.25", "caniuse-lite": "^1.0.30001754", @@ -3904,7 +3924,6 @@ "integrity": "sha512-BhHmn2yNOFA9H9JmmIVKJmd288g9hrVRDkdoIgRCRuSySRUHH7r/DI6aAXW9T1WwUuY3DFgrcaqB+deURBLR5g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -3965,7 +3984,6 @@ "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==", "dev": true, "license": "MIT", - "peer": true, "bin": { "eslint-config-prettier": "bin/cli.js" }, @@ -4013,7 +4031,6 @@ "integrity": "sha512-SbR9ZBUFKgvWAbq3RrdCtWaW0IKm6wwUiApxf3BVTNfqUIo4IQQmreMg2iHFJJ6C/0wss3LXURBJ1OwS/MhFcQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "natural-compare": "^1.4.0", @@ -5164,6 +5181,15 @@ "url": "https://opencollective.com/parcel" } }, + "node_modules/linkify-it": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", + "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==", + "license": "MIT", + "dependencies": { + "uc.micro": "^2.0.0" + } + }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -5222,6 +5248,35 @@ "@jridgewell/sourcemap-codec": "^1.5.5" } }, + "node_modules/markdown-it": { + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.1.tgz", + "integrity": "sha512-BuU2qnTti9YKgK5N+IeMubp14ZUKUUw7yeJbkjtosvHiP0AZ5c8IAgEMk79D0eC8F23r4Ac/q8cAIFdm2FtyoA==", + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1", + "entities": "^4.4.0", + "linkify-it": "^5.0.0", + "mdurl": "^2.0.0", + "punycode.js": "^2.3.1", + "uc.micro": "^2.1.0" + }, + "bin": { + "markdown-it": "bin/markdown-it.mjs" + } + }, + "node_modules/markdown-it/node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/mdn-data": { "version": "2.12.2", "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.12.2.tgz", @@ -5229,6 +5284,12 @@ "dev": true, "license": "CC0-1.0" }, + "node_modules/mdurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", + "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==", + "license": "MIT" + }, "node_modules/memorystream": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", @@ -5742,7 +5803,6 @@ "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==", "dev": true, "license": "MIT", - "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -5783,6 +5843,15 @@ "node": ">=6" } }, + "node_modules/punycode.js": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz", + "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -6478,7 +6547,6 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -6632,7 +6700,6 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "devOptional": true, "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -6665,6 +6732,12 @@ "typescript": ">=4.8.4 <6.0.0" } }, + "node_modules/uc.micro": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", + "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", + "license": "MIT" + }, "node_modules/undici-types": { "version": "6.21.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", @@ -6755,7 +6828,6 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-7.2.2.tgz", "integrity": "sha512-BxAKBWmIbrDgrokdGZH1IgkIk/5mMHDreLDmCJ0qpyJaAteP8NvMhkwr/ZCQNqNH97bw/dANTE9PDzqwJghfMQ==", "license": "MIT", - "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", @@ -6974,7 +7046,6 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -6988,7 +7059,6 @@ "integrity": "sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@types/chai": "^5.2.2", "@vitest/expect": "3.2.4", @@ -7081,7 +7151,6 @@ "resolved": "https://registry.npmjs.org/vue/-/vue-3.5.24.tgz", "integrity": "sha512-uTHDOpVQTMjcGgrqFPSb8iO2m1DUvo+WbGqoXQz8Y1CeBYQ0FXf2z1gLRaBtHjlRz7zZUBHxjVB5VTLzYkvftg==", "license": "MIT", - "peer": true, "dependencies": { "@vue/compiler-dom": "3.5.24", "@vue/compiler-sfc": "3.5.24", diff --git a/package.json b/package.json index 5d6383b2..bac5ea92 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "lucide-vue-next": "^0.548.0", + "markdown-it": "^14.1.1", "reka-ui": "^2.6.0", "tailwind-merge": "^3.3.1", "tailwindcss": "^4.1.16", @@ -37,6 +38,7 @@ "@iconify/vue": "^5.0.0", "@tsconfig/node22": "^22.0.2", "@types/jsdom": "^27.0.0", + "@types/markdown-it": "^14.1.2", "@types/node": "^22.18.13", "@vitejs/plugin-vue": "^6.0.1", "@vitest/eslint-plugin": "^1.3.23", diff --git a/src/components/ComHubEndpointView.vue b/src/components/ComHubEndpointView.vue new file mode 100644 index 00000000..da0986e2 --- /dev/null +++ b/src/components/ComHubEndpointView.vue @@ -0,0 +1,322 @@ + + + \ No newline at end of file diff --git a/src/components/ComHubOverview.vue b/src/components/ComHubOverview.vue index 1fc853fe..f8719ae2 100644 --- a/src/components/ComHubOverview.vue +++ b/src/components/ComHubOverview.vue @@ -1,9 +1,17 @@ diff --git a/src/components/ComHubOverviewWrapper.vue b/src/components/ComHubOverviewWrapper.vue new file mode 100644 index 00000000..bd5c209c --- /dev/null +++ b/src/components/ComHubOverviewWrapper.vue @@ -0,0 +1,36 @@ + + + \ No newline at end of file diff --git a/src/components/endpoint/EndpointDocs.vue b/src/components/endpoint/EndpointDocs.vue new file mode 100644 index 00000000..b3ef4c7c --- /dev/null +++ b/src/components/endpoint/EndpointDocs.vue @@ -0,0 +1,28 @@ + + + \ No newline at end of file diff --git a/src/components/endpoint/EndpointFingerprint.vue b/src/components/endpoint/EndpointFingerprint.vue new file mode 100644 index 00000000..a960a91e --- /dev/null +++ b/src/components/endpoint/EndpointFingerprint.vue @@ -0,0 +1,62 @@ + + + \ No newline at end of file diff --git a/src/components/endpoint/EndpointHeader.vue b/src/components/endpoint/EndpointHeader.vue new file mode 100644 index 00000000..e69de29b diff --git a/src/components/endpoint/EndpointInterfaces.vue b/src/components/endpoint/EndpointInterfaces.vue new file mode 100644 index 00000000..04efb81a --- /dev/null +++ b/src/components/endpoint/EndpointInterfaces.vue @@ -0,0 +1,104 @@ + + + \ No newline at end of file diff --git a/src/components/endpoint/EndpointMethods.vue b/src/components/endpoint/EndpointMethods.vue new file mode 100644 index 00000000..e69de29b diff --git a/src/components/endpoint/EndpointPointers.vue b/src/components/endpoint/EndpointPointers.vue new file mode 100644 index 00000000..479577dc --- /dev/null +++ b/src/components/endpoint/EndpointPointers.vue @@ -0,0 +1,55 @@ + + + \ No newline at end of file diff --git a/src/components/endpoint/EndpointView.vue b/src/components/endpoint/EndpointView.vue new file mode 100644 index 00000000..292fa694 --- /dev/null +++ b/src/components/endpoint/EndpointView.vue @@ -0,0 +1,136 @@ + + + \ No newline at end of file diff --git a/src/composable/useComHub.ts b/src/composable/useComHub.ts new file mode 100644 index 00000000..4e258bd9 --- /dev/null +++ b/src/composable/useComHub.ts @@ -0,0 +1,6 @@ +import { reactive } from 'vue' + +export const comhub = reactive({ + endpoint: '@@FB2D5CF3FBE8CF00FC4518DAF76A189602E1', + // TODO: Replace with live runtime state +}) \ No newline at end of file diff --git a/src/lib/runtime.ts b/src/lib/runtime.ts index 97af3bfd..620b34e6 100644 --- a/src/lib/runtime.ts +++ b/src/lib/runtime.ts @@ -1,50 +1,25 @@ -import { Runtime, DIF } from '@unyt/datex'; +import { Runtime, DIF } from '@unyt/datex' +import type { RuntimeConfig } from '@unyt/datex' -/** - * The default configuration for the Datex runtime. - */ -const defaultConfig = { - // interfaces: [{ - // type: "websocket-client", - // config: { address: "wss://example.unyt.land" }, - // }], - debug: false, // set to true to show info/debug messages -}; +const defaultConfig: RuntimeConfig = { + interfaces: [ + { + type: 'websocket-client', + config: { + url: 'wss://example.unyt.land', + }, + }, + ], +} -/** - * The default instance of the Datex runtime. - */ -export const Datex: Runtime = await Runtime.create(defaultConfig, { - allow_unsigned_blocks: true, -}); +export const Datex: Runtime = await Runtime.create(defaultConfig) -/** - * Returns a map of pointers that are currently loaded in the runtime. - * The keys are pointer identifiers and the values are DIFContainer objects - * representing the values stored at the pointer. - */ -export function getPointers(): Map { - // some example JS values - const values = [ - 42, - 'Hello, World!', - true, - { a: 1, b: 2 }, - [1, 2, 3, 4, 5], - { - nested: { - key: 'value', - arr: [10, 20, 30], - }, - }, - ]; - const pointers = new Map( - values.map((value, index) => { - const difValue = Datex.dif.convertJSValueToDIFValue( - value, - ) as DIF.Definitions.DIFContainer; - return [`$${index.toString().padStart(16, '0')}`, difValue]; - }), - ); - return pointers; -} +export function getPointers(): Map { + const mock: [string, DIF.Definitions.DIFValueContainer][] = [ + ['$std', { type: 'object', name: 'std' } as unknown as DIF.Definitions.DIFValueContainer], + ['$file_server', { type: 'object', name: 'file_server' } as unknown as DIF.Definitions.DIFValueContainer], + ['$webrtc', { type: 'object', name: 'webrtc' } as unknown as DIF.Definitions.DIFValueContainer], + ['$Math', { type: 'object', name: 'Math' } as unknown as DIF.Definitions.DIFValueContainer], + ] + return new Map(mock) +} \ No newline at end of file diff --git a/src/router/index.ts b/src/router/index.ts index 25326a55..844d4eca 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -16,14 +16,19 @@ const router = createRouter({ component: () => import('@/views/BlockViewer/DatexBlockProtocolViewWrapper.vue'), }, { - path: '/', + path: '', name: 'Editor', component: WindowGeneralView, }, { path: '/comhub', name: 'comhub-overview', - component: () => import('@/components/ComHubOverview.vue'), + component: () => import('@/components/ComHubOverviewWrapper.vue'), + }, + { + path: '/u/:endpoint_id', + name: 'endpoint', + component: () => import('@/components/endpoint/EndpointView.vue'), }, ], });