Add tokens and faceclaw-input script, which allows using a CLI utility as an input device for the glasses

This commit is contained in:
James Babcock committed 2026-09-20 00:34:58 -07:00
1 parent 313ba85708
commit ccb320c66f
32 files changed
+1785 -12

No files matched your search

+3 -3
View File
@@ -137,7 +137,7 @@ export type ShellWindow = {
* Deliver a text string to the window (e.g. finalized voice input). Optional:
* only windows that consume typed text (the terminal) implement it.
*/
receiveTextInput?: (text: string) => void;
receiveTextInput?: (text: string, options?: { submit?: boolean }) => void;
/** Foreground state changed: this window's surface is (not) the visible one. */
setForeground?: (foreground: boolean) => void;
/**
@@ -1105,8 +1105,8 @@ class Shell {
}
/** Deliver a text string to the foreground window (e.g. finalized voice input). */
sendTextToForegroundWindow(text: string): void {
this.foregroundWindow()?.receiveTextInput?.(text);
sendTextToForegroundWindow(text: string, options?: { submit?: boolean }): void {
this.foregroundWindow()?.receiveTextInput?.(text, options);
}
/**
+3 -3
View File
@@ -20,7 +20,7 @@ export type WorkerAppMessage =
| { type: "resize-window"; windowId: string; viewport: { width: number; height: number } }
| { type: "close-window"; windowId: string }
| { type: "input"; windowId: string; event: unknown; frameId: number; focused: boolean }
| { type: "text-input"; windowId: string; text: string }
| { type: "text-input"; windowId: string; text: string; submit?: boolean }
| { type: "render"; windowId: string; focused: boolean }
| { type: "foreground"; windowId: string; foreground: boolean; focused: boolean }
/**
@@ -441,8 +441,8 @@ export class WorkerAppHost {
requestRender: () => {
this.post({ type: "render", windowId: spec.windowId, focused: shell.isWindowFocused(spec.windowId) });
},
receiveTextInput: (text) => {
this.post({ type: "text-input", windowId: spec.windowId, text });
receiveTextInput: (text, options) => {
this.post({ type: "text-input", windowId: spec.windowId, text, ...(options?.submit === undefined ? {} : { submit: options.submit }) });
},
setForeground: (foreground) => {
this.options.setSurfaceVisible(surfaceId, foreground);