snow-flow 10.0.128 → 10.0.129
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/package.json +1 -1
- package/src/cli/cmd/tui/app.tsx +56 -1
package/package.json
CHANGED
package/src/cli/cmd/tui/app.tsx
CHANGED
|
@@ -148,7 +148,8 @@ export function tui(input: {
|
|
|
148
148
|
|
|
149
149
|
// On Linux, @opentui disables Zig renderer threading which prevents PTY output.
|
|
150
150
|
// OTUI_FORCE_THREAD=1 temporarily spoofs platform so @opentui keeps threading enabled.
|
|
151
|
-
|
|
151
|
+
const forceThread = !!process.env.OTUI_FORCE_THREAD
|
|
152
|
+
if (forceThread) {
|
|
152
153
|
console.log("[snow-flow] forcing renderer threading (OTUI_FORCE_THREAD)")
|
|
153
154
|
Object.defineProperty(process, "platform", { value: "darwin", configurable: true })
|
|
154
155
|
}
|
|
@@ -182,6 +183,7 @@ export function tui(input: {
|
|
|
182
183
|
<FrecencyProvider>
|
|
183
184
|
<PromptHistoryProvider>
|
|
184
185
|
<PromptRefProvider>
|
|
186
|
+
<HostedRendererDiag />
|
|
185
187
|
<App />
|
|
186
188
|
</PromptRefProvider>
|
|
187
189
|
</PromptHistoryProvider>
|
|
@@ -212,6 +214,59 @@ export function tui(input: {
|
|
|
212
214
|
})
|
|
213
215
|
}
|
|
214
216
|
|
|
217
|
+
function HostedRendererDiag() {
|
|
218
|
+
if (!process.env.OTUI_FORCE_THREAD) return null
|
|
219
|
+
const renderer = useRenderer()
|
|
220
|
+
onMount(() => {
|
|
221
|
+
const r = renderer as any
|
|
222
|
+
const log = (msg: string) => process.stderr.write(`[sf-diag] ${msg}\n`)
|
|
223
|
+
log(`useThread=${r._useThread} isRunning=${r._isRunning} state=${r._controlState} live=${r.liveRequestCounter}`)
|
|
224
|
+
log(`platform=${process.platform} altScreen=${r._useAlternateScreen}`)
|
|
225
|
+
log(`termSetup=${r._terminalIsSetup} root=${!!r.root} buffer=${!!r.nextRenderBuffer}`)
|
|
226
|
+
|
|
227
|
+
// Try 1: force-start the render loop if not running
|
|
228
|
+
if (!r._isRunning) {
|
|
229
|
+
log("calling renderer.start()")
|
|
230
|
+
r.start()
|
|
231
|
+
log(`after start: isRunning=${r._isRunning} state=${r._controlState}`)
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// Try 2: after 2s, check state and try manual output
|
|
235
|
+
setTimeout(() => {
|
|
236
|
+
log(`2s check: isRunning=${r._isRunning} state=${r._controlState} rendering=${r.rendering}`)
|
|
237
|
+
// Test direct write via realStdoutWrite (saved reference to actual stdout.write)
|
|
238
|
+
const realWrite = r.realStdoutWrite
|
|
239
|
+
if (realWrite) {
|
|
240
|
+
realWrite.call(r.stdout, "\x1b[2J\x1b[H\x1b[1;31m[sf-diag] REAL STDOUT WRITE OK\x1b[0m\r\n")
|
|
241
|
+
log("realStdoutWrite sent")
|
|
242
|
+
}
|
|
243
|
+
// Test lib.writeOut
|
|
244
|
+
try {
|
|
245
|
+
r.writeOut("\x1b[3;1H\x1b[1;32m[sf-diag] WRITEOUT OK\x1b[0m\r\n")
|
|
246
|
+
log("writeOut sent")
|
|
247
|
+
} catch (e: any) {
|
|
248
|
+
log(`writeOut error: ${e.message}`)
|
|
249
|
+
}
|
|
250
|
+
}, 2000)
|
|
251
|
+
|
|
252
|
+
// Try 3: after 4s, try manual render cycle
|
|
253
|
+
setTimeout(() => {
|
|
254
|
+
log(`4s check: isRunning=${r._isRunning} rendering=${r.rendering}`)
|
|
255
|
+
try {
|
|
256
|
+
if (r.root && r.nextRenderBuffer) {
|
|
257
|
+
r.root.render(r.nextRenderBuffer, 0)
|
|
258
|
+
log("root.render done")
|
|
259
|
+
}
|
|
260
|
+
r.renderNative()
|
|
261
|
+
log("renderNative done")
|
|
262
|
+
} catch (e: any) {
|
|
263
|
+
log(`manual render error: ${e.message}`)
|
|
264
|
+
}
|
|
265
|
+
}, 4000)
|
|
266
|
+
})
|
|
267
|
+
return null
|
|
268
|
+
}
|
|
269
|
+
|
|
215
270
|
function App() {
|
|
216
271
|
const route = useRoute()
|
|
217
272
|
const dimensions = useTerminalDimensions()
|