@telepath-computer/television 0.1.27 → 0.1.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -10
- package/dist/browser/assets/index-Bi8GHwko.js +548 -0
- package/dist/browser/assets/index-BporpGDZ.css +1 -0
- package/dist/browser/index.html +2 -2
- package/dist/cli.cjs +43922 -80546
- package/dist/electron.cjs +42950 -79935
- package/dist/views/text/index.html +38 -0
- package/dist/views/text/manifest.json +5 -0
- package/package.json +26 -15
- package/skill/SKILL.md +365 -100
- package/dist/artifact-runtime/index.js +0 -986
- package/dist/artifact-runtime/style.css +0 -1
- package/dist/browser/assets/index-C0Ygc25s.js +0 -555
- package/dist/browser/assets/index-D0BGTUk2.css +0 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>Text view</title>
|
|
6
|
+
<style>
|
|
7
|
+
html,
|
|
8
|
+
body {
|
|
9
|
+
margin: 0;
|
|
10
|
+
padding: 0;
|
|
11
|
+
height: 100%;
|
|
12
|
+
background: #fff;
|
|
13
|
+
color: #000;
|
|
14
|
+
}
|
|
15
|
+
pre#content {
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
margin: 0;
|
|
18
|
+
padding: 12px 16px;
|
|
19
|
+
min-height: 100%;
|
|
20
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
21
|
+
font-size: 13px;
|
|
22
|
+
line-height: 1.5;
|
|
23
|
+
white-space: pre-wrap;
|
|
24
|
+
word-break: break-word;
|
|
25
|
+
outline: none;
|
|
26
|
+
}
|
|
27
|
+
</style>
|
|
28
|
+
<script type="module">var I=e=>{throw TypeError(e)};var _=(e,n,t)=>n.has(e)||I("Cannot "+t);var c=(e,n,t)=>(_(e,n,"read from private field"),t?t.call(e):n.get(e)),u=(e,n,t)=>n.has(e)?I("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,t),y=(e,n,t,r)=>(_(e,n,"write to private field"),r?r.call(e,t):n.set(e,t),t),p=(e,n,t)=>(_(e,n,"access private method"),t);(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function t(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=t(s);fetch(s.href,o)}})();const S=new Set(["target","currentTarget","eventPhase","defaultPrevented","isTrusted","timeStamp","srcElement","returnValue","cancelBubble","NONE","CAPTURING_PHASE","AT_TARGET","BUBBLING_PHASE","composedPath","stopPropagation","stopImmediatePropagation","preventDefault","initEvent"]);function O(e){for(const n of Object.keys(e))if(S.has(n))throw new Error(`Event payload key "${n}" is reserved; choose a different property name`)}function G(e,n){O(n);for(const t of Object.keys(n))Object.defineProperty(e,t,{value:n[t],writable:!0,enumerable:!0,configurable:!0})}function V(){class e extends Event{constructor(t,r){const{type:s,bubbles:o,cancelable:i,composed:v,...w}=r??{};if(s!==void 0)throw new Error('Do not pass "type" in init; use the constructor argument instead');super(t,{bubbles:o,cancelable:i,composed:v}),G(this,w)}}return e}class U extends globalThis.EventTarget{}function B(e,n,t){const r=e.dispose.bind(e);e.dispose=()=>{if(!n())return t(),r()}}function F(e){var t;class n extends e{constructor(...o){super(...o);u(this,t,!1);B(this,()=>c(this,t),()=>{y(this,t,!0)})}[Symbol.dispose](){this.dispose()}get disposed(){return c(this,t)}}return t=new WeakMap,n}const R="0123456789ABCDEFGHJKMNPQRSTVWXYZ",b=32,W=16,A=10,P=0xffffffffffff;var f;(function(e){e.Base32IncorrectEncoding="B32_ENC_INVALID",e.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",e.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",e.EncodeTimeNegative="ENC_TIME_NEG",e.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",e.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",e.PRNGDetectFailure="PRNG_DETECT",e.ULIDInvalid="ULID_INVALID",e.Unexpected="UNEXPECTED",e.UUIDInvalid="UUID_INVALID"})(f||(f={}));class T extends Error{constructor(n,t){super(`${t} (${n})`),this.name="ULIDError",this.code=n}}function $(e){const n=Math.floor(e()*b)%b;return R.charAt(n)}function j(e){const n=H(),t=n&&(n.crypto||n.msCrypto)||null;if(typeof(t==null?void 0:t.getRandomValues)=="function")return()=>{const r=new Uint8Array(1);return t.getRandomValues(r),r[0]/256};if(typeof(t==null?void 0:t.randomBytes)=="function")return()=>t.randomBytes(1).readUInt8()/256;throw new T(f.PRNGDetectFailure,"Failed to find a reliable PRNG")}function H(){return X()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function K(e,n){let t="";for(;e>0;e--)t=$(n)+t;return t}function k(e,n=A){if(isNaN(e))throw new T(f.EncodeTimeValueMalformed,`Time must be a number: ${e}`);if(e>P)throw new T(f.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${P}: ${e}`);if(e<0)throw new T(f.EncodeTimeNegative,`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new T(f.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let t,r="";for(let s=n;s>0;s--)t=e%b,r=R.charAt(t)+r,e=(e-t)/b;return r}function X(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function z(e,n){const t=j(),r=Date.now();return k(r,A)+K(W,t)}function N(e){return typeof e=="object"&&e!==null}function Y(e){return!N(e)||e.type!=="content-updated"||typeof e.content!="string"?!1:!("id"in e)}function Z(e){if(!N(e)||e.type!=="response"||typeof e.id!="string")return!1;const n="result"in e&&e.result!==void 0,t="error"in e&&e.error!==void 0;return!(n===t||n&&(!N(e.result)||Object.keys(e.result).length!==0)||t&&(!N(e.error)||typeof e.error.message!="string"))}const q=V(),J=F(U);var m,E,h,d,a,L,C,D,x;class Q extends J{constructor(t=globalThis){super();u(this,a);u(this,m);u(this,E);u(this,h);u(this,d,new Map);y(this,m,t);const r=t.parent;if(!r||r===t)throw new Error("ArtifactContext: window has no parent");y(this,E,r),y(this,h,s=>p(this,a,L).call(this,s)),c(this,m).addEventListener("message",c(this,h)),p(this,a,D).call(this,{type:"ready"})}updateContent(t){p(this,a,x).call(this);const r=z(),s={type:"update-content",id:r,content:t};return new Promise((o,i)=>{c(this,d).set(r,{resolve:o,reject:i}),p(this,a,D).call(this,s)})}dispose(){c(this,m).removeEventListener("message",c(this,h));const t=[...c(this,d).values()];c(this,d).clear();for(const{reject:r}of t)r(new Error("ArtifactContext disposed"))}}m=new WeakMap,E=new WeakMap,h=new WeakMap,d=new WeakMap,a=new WeakSet,L=function(t){if(this.disposed||t.source!==c(this,E))return;const r=t.data;if(Y(r)){this.dispatchEvent(new q("content-updated",{content:r.content}));return}if(Z(r)){p(this,a,C).call(this,r);return}},C=function(t){const r=c(this,d).get(t.id);if(r){if(c(this,d).delete(t.id),t.error!==void 0){r.reject(new Error(t.error.message));return}r.resolve()}},D=function(t){c(this,E).postMessage(t,"*")},x=function(){if(this.disposed)throw new Error("ArtifactContext is disposed")};const ee=500;function te(e){const{pre:n,ctx:t}=e,r=e.debounceMs??ee;let s=null,o=null,i=null;const v=async()=>{i=null;const g=n.textContent??"";s=g;try{await t.updateContent(g),o=g}catch{const l=o??"";n.textContent=l,s=l}},w=()=>{i!==null&&clearTimeout(i),i=setTimeout(()=>{v()},r)},M=g=>{const l=g.content;s!==null&&l===s||(n.textContent=l,o=l)};return t.addEventListener("content-updated",M),n.addEventListener("input",w),{dispose(){i!==null&&(clearTimeout(i),i=null),t.removeEventListener("content-updated",M),n.removeEventListener("input",w)}}}const ne=document.getElementById("content"),re=new URLSearchParams(window.location.search).get("debugWire")==="1";re&&window.addEventListener("message",e=>{e.source===window.parent&&window.parent.postMessage({type:"__wire-observed",direction:"host-to-view",message:e.data},"*")});const se=new Q;te({pre:ne,ctx:se});
|
|
29
|
+
</script>
|
|
30
|
+
</head>
|
|
31
|
+
<body>
|
|
32
|
+
<pre
|
|
33
|
+
id="content"
|
|
34
|
+
contenteditable="plaintext-only"
|
|
35
|
+
spellcheck="false"
|
|
36
|
+
></pre>
|
|
37
|
+
</body>
|
|
38
|
+
</html>
|
package/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telepath-computer/television",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.29",
|
|
4
4
|
"type": "module",
|
|
5
|
+
"workspaces": [
|
|
6
|
+
"packages/*"
|
|
7
|
+
],
|
|
5
8
|
"main": "dist/electron.cjs",
|
|
6
9
|
"bin": {
|
|
7
10
|
"tv": "dist/cli.cjs"
|
|
@@ -13,24 +16,23 @@
|
|
|
13
16
|
"scripts": {
|
|
14
17
|
"start:server": "scripts/dev-server.sh",
|
|
15
18
|
"start:electron": "scripts/dev-electron.sh",
|
|
16
|
-
"layout": "
|
|
17
|
-
"build": "npm
|
|
19
|
+
"layout": "npm --workspace @telepath-computer/television-layout-demo run dev",
|
|
20
|
+
"build:layout-demo": "npm --workspace @telepath-computer/television-layout-demo run build",
|
|
21
|
+
"build": "npm run build:renderer && npm run build:views && npm run build:cli && npm run build:electron",
|
|
22
|
+
"build:views": "node scripts/build-views.mjs",
|
|
18
23
|
"prepack": "npm run build",
|
|
19
24
|
"lint": "eslint . --ext .ts --max-warnings=0",
|
|
20
25
|
"lint:fix": "npm run lint -- --fix",
|
|
21
26
|
"type-check": "tsc --noEmit",
|
|
22
27
|
"test:setup": "playwright install chromium",
|
|
23
|
-
"test": "vitest run",
|
|
24
|
-
"test:e2e
|
|
25
|
-
"test:e2e-browser": "playwright test --config=playwright.config.ts",
|
|
28
|
+
"test": "vitest run && npm run test --workspaces --if-present",
|
|
29
|
+
"test:e2e": "vitest run test/e2e-node/ && playwright test --config=playwright.config.ts && npm run test:e2e --workspaces --if-present",
|
|
26
30
|
"test:agent": "vitest run --config test/e2e-agent/vitest.config.ts",
|
|
27
|
-
"test:
|
|
28
|
-
"test:all": "npm test && npm run test:e2e-node && npm run test:e2e-browser && npm run test:agent && npm run test:electron",
|
|
31
|
+
"test:all": "npm test && npm run test:e2e && npm run test:agent",
|
|
29
32
|
"verify": "npm run lint && npm run type-check && npm run test:all",
|
|
30
|
-
"build:
|
|
31
|
-
"build:
|
|
32
|
-
"build:
|
|
33
|
-
"build:cli": "esbuild src/cli/index.ts --bundle --platform=node --target=node18 --format=cjs --banner:js=\"#!/usr/bin/env node\" --outfile=dist/cli.cjs"
|
|
33
|
+
"build:renderer": "vite build --config packages/web/vite.config.ts",
|
|
34
|
+
"build:electron": "esbuild packages/desktop/src/index.ts --bundle --platform=node --target=node18 --format=cjs --outfile=dist/electron.cjs --external:electron --external:@rupertsworld/electron-ipc",
|
|
35
|
+
"build:cli": "node scripts/build-cli.mjs"
|
|
34
36
|
},
|
|
35
37
|
"dependencies": {
|
|
36
38
|
"@agentclientprotocol/sdk": "^0.18.1",
|
|
@@ -41,14 +43,23 @@
|
|
|
41
43
|
"@rupertsworld/electron-ipc": "^0.2.1",
|
|
42
44
|
"@rupertsworld/event-target": "^0.1.0",
|
|
43
45
|
"@rupertsworld/observable": "^0.1.2",
|
|
44
|
-
"@telepath-computer/
|
|
45
|
-
"@telepath-computer/
|
|
46
|
+
"@telepath-computer/disposable": "0.0.0",
|
|
47
|
+
"@telepath-computer/television-artifact": "0.0.0",
|
|
48
|
+
"@telepath-computer/television-cli": "0.0.0",
|
|
49
|
+
"@telepath-computer/television-desktop": "0.0.0",
|
|
50
|
+
"@telepath-computer/television-layout": "0.0.0",
|
|
51
|
+
"@telepath-computer/television-layout-demo": "0.0.0",
|
|
52
|
+
"@telepath-computer/television-server": "0.0.0",
|
|
53
|
+
"@telepath-computer/television-shared": "0.0.0",
|
|
54
|
+
"@telepath-computer/television-view-text": "0.0.0",
|
|
55
|
+
"@telepath-computer/television-web": "0.0.0",
|
|
56
|
+
"@telepath-computer/ui": "0.0.0",
|
|
46
57
|
"commander": "^14.0.3",
|
|
58
|
+
"disposablestack": "^1.1.6",
|
|
47
59
|
"dompurify": "^3.3.3",
|
|
48
60
|
"express": "^4.21.0",
|
|
49
61
|
"lit-html": "^3.3.2",
|
|
50
62
|
"marked": "^17.0.4",
|
|
51
|
-
"store-thing": "^0.2.0",
|
|
52
63
|
"ulid": "^3.0.2",
|
|
53
64
|
"watcher": "^2.3.1",
|
|
54
65
|
"ws": "^8.19.0",
|