@gwro/codeaside 0.1.0 → 0.1.2
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/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,19 @@ from [GlanceCode](https://github.com/sousyllc/glancecode) 0.6.2 (glasses app 0.3
|
|
|
5
5
|
and does not track later upstream releases. Upstream's own history up to the fork
|
|
6
6
|
is kept at the end for reference.
|
|
7
7
|
|
|
8
|
+
## 0.1.2
|
|
9
|
+
|
|
10
|
+
- A message sent with a pasted image while Claude was busy showed on the glasses
|
|
11
|
+
as `[object Object],[object Object]`. Claude Code records such a queued message
|
|
12
|
+
as a list of text and image blocks, and the hub printed the list. It now shows
|
|
13
|
+
the text, with `[image]` for the picture.
|
|
14
|
+
|
|
15
|
+
## 0.1.1
|
|
16
|
+
|
|
17
|
+
- README: the configuration table's Default column held two long paths that
|
|
18
|
+
could not wrap, which pushed the Purpose column off the page on npm. The
|
|
19
|
+
column now holds short values and the paths are in the text.
|
|
20
|
+
|
|
8
21
|
## 0.1.0
|
|
9
22
|
|
|
10
23
|
First release: a Windows port of the hub and command-line tool of
|
package/README.md
CHANGED
|
@@ -307,11 +307,11 @@ See [SECURITY.md](SECURITY.md) and [docs/privacy.md](docs/privacy.md).
|
|
|
307
307
|
| `port` | 7717 | hub API on 127.0.0.1 |
|
|
308
308
|
| `httpsPort` | 7443 | HTTPS port on your `*.ts.net` name |
|
|
309
309
|
| `hookPort` | 7718 | hook intake on 127.0.0.1 |
|
|
310
|
-
| `hostPipe` |
|
|
310
|
+
| `hostPipe` | per user | the session host's named pipe; `\\.\pipe\codeaside-host-<user>` unless set |
|
|
311
311
|
| `claudeArgs` | `[]` | extra arguments for sessions started from the glasses |
|
|
312
|
-
| `whisperBin` |
|
|
313
|
-
| `whisperThreads` |
|
|
314
|
-
| `sttVocabulary` | | words the speech model should expect |
|
|
312
|
+
| `whisperBin` | installed | the whisper.cpp server; unless set, the `whisper-server.exe` that `setup-voice` puts in `%LOCALAPPDATA%\codeaside\whisper`. Point it at your own build to use that instead |
|
|
313
|
+
| `whisperThreads` | auto | CPU threads for transcription (CPU build); unless set, half the logical CPUs, between 2 and 8 |
|
|
314
|
+
| `sttVocabulary` | built in | words the speech model should expect; your project names are added to it |
|
|
315
315
|
| `ntfyTopic` | empty | optional phone push through ntfy when a session finishes or needs you |
|
|
316
316
|
| `preventSleep` | true | keep the PC awake (not the display) while the hub runs and the PC is on AC power |
|
|
317
317
|
| `bindTailscaleIP` | false | also listen on the raw Tailscale IP over plain HTTP, for development |
|
|
@@ -11,7 +11,7 @@ The guide now opens with the one-line setup, then covers:
|
|
|
11
11
|
|
|
12
12
|
- requirements
|
|
13
13
|
- pairing the glasses
|
|
14
|
-
- troubleshooting`,void 0,40*6e4)])}tick(){const e="00000000-0000-4000-8000-000000000001",t=this.sessions.get(e),n=this.items.get(e);if(!t||!n)return;const r=v1[this.step%v1.length];this.step++,"state"in r?(t.state=r.state,t.activity=r.activity||""):(n.push({...r,key:j1(),ts:T1()}),n.length>40&&n.splice(0,n.length-40)),t.lastActivity=T(),this.notify()}add(e,t){const n=this.items.get(e)||[];n.push(t),this.items.set(e,n)}async loadItems(e){this.items.has(e)||this.items.set(e,[]),this.notify()}async prompt(e,t){const n=this.sessions.get(e);if(!n)throw new Error("no such session");return this.add(e,L("user",t)),n.state="working",n.activity="Thinking",this.notify(),Y(()=>{this.add(e,L("assistant","This is the demo, so nothing ran. Pair the app with your own PC to talk to real Claude Code sessions.")),n.state="idle",n.activity="",n.lastActivity=T(),this.notify()},1500),{}}async interrupt(e){const t=this.sessions.get(e);return t&&(t.state="idle",t.activity="",this.add(e,L("notice","Interrupted")),this.notify()),{}}async choose(e,t,n){const r=this.sessions.get(e),i=["Yes","Yes, and don't ask again for this command","No"];if(!r?.waiting)throw new Error("nothing to answer");return r.waiting=null,n===2?(this.add(e,L("notice","Interrupted")),r.state="idle"):(r.state="working",Y(()=>{this.add(e,L("assistant","Deployed to staging. Open staging.example.com on your phone to check the new onboarding.")),r.state="idle",r.lastActivity=T(),this.notify()},1800)),this.notify(),{chosen:i[n]||"Yes"}}async answer(e,t){return this.prompt(e,t)}async dialog(e){return{dialog:{kind:"permission",options:["Yes","Yes, and don't ask again for this command","No"]}}}async command(e,t){return this.add(e,L("notice",t)),this.notify(),{}}async models(e){const t=this.sessions.get(e)?.agent;return t==="gemini"?[]:t==="codex"?[{id:"gpt-5.5",name:"GPT-5.5"},{id:"gpt-5.5-mini",name:"GPT-5.5 mini"}]:[{id:"opus",name:"Opus"},{id:"sonnet",name:"Sonnet"},{id:"haiku",name:"Haiku"}]}async recent(){return{agents:this.agents,projects:["api-server","mobile-app","docs-site","infra"].map((e,t)=>({cwd:`~/code/${e}`,project:e,mtime:T()-t*36e5})),sessions:[{id:"00000000-0000-4000-8000-000000000010",cwd:"~/code/infra",project:"infra",title:"Rotate the staging certificates",mtime:T()-26*36e5},{id:"00000000-0000-4000-8000-000000000011",cwd:"~/code/api-server",project:"api-server",title:"Add rate limits to the public API",mtime:T()-50*36e5}]}}async launch(e,t,n){const r=e.split("/").pop()||"project",i=n==="codex"||n==="gemini"?n:"claude",s={claude:"claude-opus-5",codex:"gpt-5.5",gemini:"gemini-3.5-flash"}[i],x=Q({id:`00000000-0000-4000-8000-${String(T()).slice(-12)}`,project:r,agent:i,model:s,title:t?"Resumed session":null});return this.sessions.set(x.id,x),this.items.set(x.id,[L("notice",t?"Resumed (demo)":"New session (demo)")]),this.notify(),{session:x}}presence(){return Promise.resolve()}log(e){return Promise.resolve()}async transcribe(e,t=!1){const n="Run the signup tests again and tell me what fails";if(await new Promise(i=>Y(i,t?150:600)),!t)return this.partialCalls=0,n;const r=n.split(" ");return this.partialCalls=Math.min(r.length,this.partialCalls+3),r.slice(0,this.partialCalls).join(" ")}}function H4(o){return o?o.eventType??z.CLICK_EVENT:null}class t2{constructor(e,t){this.emit=e,this.lastDisplayWrite=t}last=new Map;holdEndedAt=0;holding=!1;handle(e){if(e.audioEvent?.audioPcm){this.emit({type:"audio",pcm:e.audioEvent.audioPcm});return}if(e.menuItemClickEvent?.itemID){this.emit({type:"menu",id:e.menuItemClickEvent.itemID});return}const t=H4(e.sysEvent),n=H4(e.textEvent),r=H4(e.listEvent),i=[t,n,r].find(s=>s!==null&&s!==z.CLICK_EVENT)??t??n??r;if(i!=null)switch(i){case z.DOUBLE_CLICK_EVENT:this.debounce("double",350)&&this.emit({type:"doubleTap"});return;case z.SCROLL_TOP_EVENT:case z.SCROLL_BOTTOM_EVENT:{if(Date.now()-this.lastDisplayWrite()<120)return;const s=i===z.SCROLL_TOP_EVENT?"up":"down";this.debounce(`scroll-${s}`,220)&&this.emit({type:s});return}case z.LONG_PRESS_EVENT:!this.holding&&this.debounce("hold",300)&&(this.holding=!0,this.emit({type:"holdStart"}));return;case z.LONG_PRESS_RELEASE_EVENT:this.holding&&(this.holding=!1,this.holdEndedAt=Date.now(),this.emit({type:"holdEnd"}));return;case z.FOREGROUND_ENTER_EVENT:this.debounce("fg",600)&&this.emit({type:"foreground"});return;case z.FOREGROUND_EXIT_EVENT:this.debounce("bg",600)&&this.emit({type:"background"});return;case z.SYSTEM_EXIT_EVENT:case z.ABNORMAL_EXIT_EVENT:this.emit({type:"exit"});return;case z.CLICK_EVENT:if(Date.now()-this.holdEndedAt<500)return;this.debounce("tap",250)&&this.emit({type:"tap"});return}}debounce(e,t){const n=Date.now();return n-(this.last.get(e)||0)<t?!1:(this.last.set(e,n),!0)}}const T4="codeaside.hub",O1=[],e2="0.1.0",n2="CodeAside";async function r2(o){const e=new URLSearchParams(location.search),t=e.get("token")?{url:e.get("hub")||location.origin,token:e.get("token")}:null;if(t)return await o.setLocalStorage(T4,JSON.stringify(t)).catch(()=>!1),history.replaceState(null,"",location.pathname),t;for(const n of[T4,...O1]){const r=await o.getLocalStorage(n).catch(()=>"");if(r)try{const i=JSON.parse(r);if(i.url&&i.token)return i}catch{}}return null}function i2(o){const e=/^\s*(https?:\/\/[^\s#]+)#(\S+)\s*$/.exec(o);return e?{url:e[1].replace(/\/$/,""),token:e[2]}:null}function W(o){return document.getElementById(o)}async function s2(){const o=await D0(),e=await r2(o),t=new URLSearchParams(location.search).has("demo"),n=W("status"),r=W("mirror"),i=W("pair"),s=W("pair-code"),x=W("demo"),c=W("unpair");W("version").textContent=`v${e2} · built Nov 19,
|
|
14
|
+
- troubleshooting`,void 0,40*6e4)])}tick(){const e="00000000-0000-4000-8000-000000000001",t=this.sessions.get(e),n=this.items.get(e);if(!t||!n)return;const r=v1[this.step%v1.length];this.step++,"state"in r?(t.state=r.state,t.activity=r.activity||""):(n.push({...r,key:j1(),ts:T1()}),n.length>40&&n.splice(0,n.length-40)),t.lastActivity=T(),this.notify()}add(e,t){const n=this.items.get(e)||[];n.push(t),this.items.set(e,n)}async loadItems(e){this.items.has(e)||this.items.set(e,[]),this.notify()}async prompt(e,t){const n=this.sessions.get(e);if(!n)throw new Error("no such session");return this.add(e,L("user",t)),n.state="working",n.activity="Thinking",this.notify(),Y(()=>{this.add(e,L("assistant","This is the demo, so nothing ran. Pair the app with your own PC to talk to real Claude Code sessions.")),n.state="idle",n.activity="",n.lastActivity=T(),this.notify()},1500),{}}async interrupt(e){const t=this.sessions.get(e);return t&&(t.state="idle",t.activity="",this.add(e,L("notice","Interrupted")),this.notify()),{}}async choose(e,t,n){const r=this.sessions.get(e),i=["Yes","Yes, and don't ask again for this command","No"];if(!r?.waiting)throw new Error("nothing to answer");return r.waiting=null,n===2?(this.add(e,L("notice","Interrupted")),r.state="idle"):(r.state="working",Y(()=>{this.add(e,L("assistant","Deployed to staging. Open staging.example.com on your phone to check the new onboarding.")),r.state="idle",r.lastActivity=T(),this.notify()},1800)),this.notify(),{chosen:i[n]||"Yes"}}async answer(e,t){return this.prompt(e,t)}async dialog(e){return{dialog:{kind:"permission",options:["Yes","Yes, and don't ask again for this command","No"]}}}async command(e,t){return this.add(e,L("notice",t)),this.notify(),{}}async models(e){const t=this.sessions.get(e)?.agent;return t==="gemini"?[]:t==="codex"?[{id:"gpt-5.5",name:"GPT-5.5"},{id:"gpt-5.5-mini",name:"GPT-5.5 mini"}]:[{id:"opus",name:"Opus"},{id:"sonnet",name:"Sonnet"},{id:"haiku",name:"Haiku"}]}async recent(){return{agents:this.agents,projects:["api-server","mobile-app","docs-site","infra"].map((e,t)=>({cwd:`~/code/${e}`,project:e,mtime:T()-t*36e5})),sessions:[{id:"00000000-0000-4000-8000-000000000010",cwd:"~/code/infra",project:"infra",title:"Rotate the staging certificates",mtime:T()-26*36e5},{id:"00000000-0000-4000-8000-000000000011",cwd:"~/code/api-server",project:"api-server",title:"Add rate limits to the public API",mtime:T()-50*36e5}]}}async launch(e,t,n){const r=e.split("/").pop()||"project",i=n==="codex"||n==="gemini"?n:"claude",s={claude:"claude-opus-5",codex:"gpt-5.5",gemini:"gemini-3.5-flash"}[i],x=Q({id:`00000000-0000-4000-8000-${String(T()).slice(-12)}`,project:r,agent:i,model:s,title:t?"Resumed session":null});return this.sessions.set(x.id,x),this.items.set(x.id,[L("notice",t?"Resumed (demo)":"New session (demo)")]),this.notify(),{session:x}}presence(){return Promise.resolve()}log(e){return Promise.resolve()}async transcribe(e,t=!1){const n="Run the signup tests again and tell me what fails";if(await new Promise(i=>Y(i,t?150:600)),!t)return this.partialCalls=0,n;const r=n.split(" ");return this.partialCalls=Math.min(r.length,this.partialCalls+3),r.slice(0,this.partialCalls).join(" ")}}function H4(o){return o?o.eventType??z.CLICK_EVENT:null}class t2{constructor(e,t){this.emit=e,this.lastDisplayWrite=t}last=new Map;holdEndedAt=0;holding=!1;handle(e){if(e.audioEvent?.audioPcm){this.emit({type:"audio",pcm:e.audioEvent.audioPcm});return}if(e.menuItemClickEvent?.itemID){this.emit({type:"menu",id:e.menuItemClickEvent.itemID});return}const t=H4(e.sysEvent),n=H4(e.textEvent),r=H4(e.listEvent),i=[t,n,r].find(s=>s!==null&&s!==z.CLICK_EVENT)??t??n??r;if(i!=null)switch(i){case z.DOUBLE_CLICK_EVENT:this.debounce("double",350)&&this.emit({type:"doubleTap"});return;case z.SCROLL_TOP_EVENT:case z.SCROLL_BOTTOM_EVENT:{if(Date.now()-this.lastDisplayWrite()<120)return;const s=i===z.SCROLL_TOP_EVENT?"up":"down";this.debounce(`scroll-${s}`,220)&&this.emit({type:s});return}case z.LONG_PRESS_EVENT:!this.holding&&this.debounce("hold",300)&&(this.holding=!0,this.emit({type:"holdStart"}));return;case z.LONG_PRESS_RELEASE_EVENT:this.holding&&(this.holding=!1,this.holdEndedAt=Date.now(),this.emit({type:"holdEnd"}));return;case z.FOREGROUND_ENTER_EVENT:this.debounce("fg",600)&&this.emit({type:"foreground"});return;case z.FOREGROUND_EXIT_EVENT:this.debounce("bg",600)&&this.emit({type:"background"});return;case z.SYSTEM_EXIT_EVENT:case z.ABNORMAL_EXIT_EVENT:this.emit({type:"exit"});return;case z.CLICK_EVENT:if(Date.now()-this.holdEndedAt<500)return;this.debounce("tap",250)&&this.emit({type:"tap"});return}}debounce(e,t){const n=Date.now();return n-(this.last.get(e)||0)<t?!1:(this.last.set(e,n),!0)}}const T4="codeaside.hub",O1=[],e2="0.1.0",n2="CodeAside";async function r2(o){const e=new URLSearchParams(location.search),t=e.get("token")?{url:e.get("hub")||location.origin,token:e.get("token")}:null;if(t)return await o.setLocalStorage(T4,JSON.stringify(t)).catch(()=>!1),history.replaceState(null,"",location.pathname),t;for(const n of[T4,...O1]){const r=await o.getLocalStorage(n).catch(()=>"");if(r)try{const i=JSON.parse(r);if(i.url&&i.token)return i}catch{}}return null}function i2(o){const e=/^\s*(https?:\/\/[^\s#]+)#(\S+)\s*$/.exec(o);return e?{url:e[1].replace(/\/$/,""),token:e[2]}:null}function W(o){return document.getElementById(o)}async function s2(){const o=await D0(),e=await r2(o),t=new URLSearchParams(location.search).has("demo"),n=W("status"),r=W("mirror"),i=W("pair"),s=W("pair-code"),x=W("demo"),c=W("unpair");W("version").textContent=`v${e2} · built Nov 19, 7:19 PM`,i.addEventListener("submit",async v=>{v.preventDefault();const y=i2(s.value);if(!y){n.textContent="That doesn't look like a pairing code. It starts with https:// and has a # before the token.";return}await o.setLocalStorage(T4,JSON.stringify(y)),location.href=location.pathname}),c.addEventListener("click",async()=>{await o.setLocalStorage(T4,"");for(const v of O1)await o.setLocalStorage(v,"").catch(()=>!1);location.href=location.pathname});const a=new N0(o);a.onFrame=v=>{r.textContent=`${v.header}
|
|
15
15
|
${"─".repeat(40)}
|
|
16
16
|
${v.body.join(`
|
|
17
17
|
`)}`};let h=!1;const l=async v=>{if(h)return;h=!0;const y=new U0(o,a,v);f.target=g=>void y.handle(g),v.subscribe(()=>{v instanceof w1?n.textContent="Demo mode: sample sessions, nothing runs. Pair to use your own machine.":n.textContent=v.connected?`Connected to ${v.cfg.url} · ${v.sessions.size} session(s)`:`Hub unreachable at ${v.cfg.url}${v.lastError?` (${v.lastError})`:""}`}),await v.connect(),v.presence(),l4(()=>void v.presence(),3e4),_1()&&v.log("timers: SDK shadow timers active, using native timers alongside")},f={target:v=>{v.type==="tap"&&w(),v.type==="doubleTap"&&o.shutDownPageContainer(1)}},d=new t2(v=>f.target(v),()=>a.lastWriteAt);o.onEvenHubEvent(v=>d.handle(v));const w=async()=>{i.hidden=!0,x.hidden=!0,c.hidden=!0,await l(new w1)};if(x.addEventListener("click",()=>void w()),e&&!t){x.hidden=!0,await l(new N1(e));return}if(t){await w();return}c.hidden=!0,i.hidden=!1,x.hidden=!1,n.textContent="Not paired. On your computer run `codeaside pair` and paste the code below, or try the demo.",a.show({header:k(n2,"not paired",U),body:j(`Pair with the hub on your computer: run codeaside pair and paste the code on your phone.
|
package/app/dist/index.html
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
.help { color: #8a8a8a; font-size: 13px; }
|
|
18
18
|
.help b { color: #bdbdbd; font-weight: 600; }
|
|
19
19
|
</style>
|
|
20
|
-
<script type="module" crossorigin src="./assets/index-
|
|
20
|
+
<script type="module" crossorigin src="./assets/index-BSC7KG_n.js"></script>
|
|
21
21
|
</head>
|
|
22
22
|
<body>
|
|
23
23
|
<main>
|
package/hub/transcript.mjs
CHANGED
|
@@ -170,7 +170,8 @@ export function entryToItems(entry) {
|
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
if (entry.type === "attachment" && entry.attachment?.type === "queued_command") {
|
|
173
|
-
|
|
173
|
+
// A prompt queued with a pasted image is a list of blocks, not a string.
|
|
174
|
+
const p = textOf(entry.attachment.prompt).replace(/\[Image #\d+\]\s*/g, "[image] ").trim();
|
|
174
175
|
if (p && !p.startsWith("<")) out.push({ key: uuid, kind: "user", text: clipText(p), ts });
|
|
175
176
|
return out;
|
|
176
177
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gwro/codeaside",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Drive your Claude Code sessions from Even Realities G2 smart glasses, natively on Windows: live transcript, approvals, and hold-to-talk voice.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|