snow-flow 10.0.128 → 10.0.130

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
- "version": "10.0.128",
3
+ "version": "10.0.130",
4
4
  "name": "snow-flow",
5
5
  "description": "Snow-Flow - ServiceNow Multi-Agent Development Framework powered by AI",
6
6
  "license": "Elastic-2.0",
@@ -116,15 +116,20 @@ export function tui(input: {
116
116
  }) {
117
117
  _onUpgrade = input.onUpgrade
118
118
  const skipThemeDetection = !!process.env.OPENCODE_SKIP_THEME_DETECTION || !!process.env.OPENCODE_REMOTE_TUI
119
+ // In hosted mode, use stderr for pre-render logs to keep terminal clean for the renderer
120
+ const forceThread = !!process.env.OTUI_FORCE_THREAD
121
+ const log = forceThread
122
+ ? (msg: string) => process.stderr.write(`${msg}\n`)
123
+ : (msg: string) => console.log(msg)
119
124
  // promise to prevent immediate exit
120
125
  return new Promise<void>(async (resolve) => {
121
126
  let mode: "dark" | "light" = "dark"
122
127
  if (skipThemeDetection) {
123
- console.log("[snow-flow] skipping theme detection")
128
+ log("[snow-flow] skipping theme detection")
124
129
  } else {
125
- console.log("[snow-flow] detecting theme...")
130
+ log("[snow-flow] detecting theme...")
126
131
  mode = await getTerminalBackgroundColor()
127
- console.log(`[snow-flow] theme: ${mode}`)
132
+ log(`[snow-flow] theme: ${mode}`)
128
133
  }
129
134
  const onExit = async () => {
130
135
  await input.onExit?.()
@@ -148,13 +153,13 @@ export function tui(input: {
148
153
 
149
154
  // On Linux, @opentui disables Zig renderer threading which prevents PTY output.
150
155
  // OTUI_FORCE_THREAD=1 temporarily spoofs platform so @opentui keeps threading enabled.
151
- if (process.env.OTUI_FORCE_THREAD) {
152
- console.log("[snow-flow] forcing renderer threading (OTUI_FORCE_THREAD)")
156
+ if (forceThread) {
157
+ log("[snow-flow] forcing renderer threading (OTUI_FORCE_THREAD)")
153
158
  Object.defineProperty(process, "platform", { value: "darwin", configurable: true })
154
159
  }
155
160
 
156
161
  try {
157
- console.log("[snow-flow] starting tui...")
162
+ log("[snow-flow] starting tui...")
158
163
  await render(
159
164
  () => {
160
165
  return (
@@ -182,6 +187,7 @@ export function tui(input: {
182
187
  <FrecencyProvider>
183
188
  <PromptHistoryProvider>
184
189
  <PromptRefProvider>
190
+ <HostedRendererDiag />
185
191
  <App />
186
192
  </PromptRefProvider>
187
193
  </PromptHistoryProvider>
@@ -212,6 +218,24 @@ export function tui(input: {
212
218
  })
213
219
  }
214
220
 
221
+ function HostedRendererDiag() {
222
+ if (!process.env.OTUI_FORCE_THREAD) return null
223
+ const renderer = useRenderer()
224
+ onMount(() => {
225
+ const r = renderer as any
226
+
227
+ // Clear screen to remove console.log messages, then start render loop
228
+ if (!r._isRunning) {
229
+ const realWrite = r.realStdoutWrite
230
+ if (realWrite) {
231
+ realWrite.call(r.stdout, "\x1b[2J\x1b[H")
232
+ }
233
+ r.start()
234
+ }
235
+ })
236
+ return null
237
+ }
238
+
215
239
  function App() {
216
240
  const route = useRoute()
217
241
  const dimensions = useTerminalDimensions()