snow-flow 10.0.122 → 10.0.124

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.122",
3
+ "version": "10.0.124",
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,6 +116,7 @@ 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
+ const log = (msg: string) => process.stderr.write("[sf] " + msg + "\n")
119
120
  // promise to prevent immediate exit
120
121
  return new Promise<void>(async (resolve) => {
121
122
  let mode: "dark" | "light" = "dark"
@@ -127,9 +128,50 @@ export function tui(input: {
127
128
  resolve()
128
129
  }
129
130
 
130
- // Clear screen before render ensures terminal viewport starts at row 0
131
- // so @opentui's absolute ANSI positioning aligns with visible area
132
- process.stdout.write("\x1b[2J\x1b[H")
131
+ const { createCliRenderer } = await import("@opentui/core")
132
+
133
+ const renderer = await createCliRenderer({
134
+ targetFps: 60,
135
+ gatherStats: false,
136
+ exitOnCtrlC: false,
137
+ useKittyKeyboard: process.env.OPENCODE_DISABLE_KITTY_KEYBOARD ? undefined : {},
138
+ consoleOptions: {
139
+ keyBindings: [{ name: "y", ctrl: true, action: "copy-selection" }],
140
+ onCopySelection: (text: string) => {
141
+ Clipboard.copy(text).catch(() => {})
142
+ },
143
+ },
144
+ })
145
+
146
+ // All diagnostics via writeOut so they appear in the terminal
147
+ const r = renderer as any
148
+ const diag = (msg: string) => r.writeOut(msg + "\r\n")
149
+ diag("lib=" + !!r.lib + " ptr=" + !!r.rendererPtr + " thread=" + r._useThread)
150
+ diag("altScreen=" + r._useAlternateScreen + " dims=" + r.width + "x" + r.height)
151
+ diag("root=" + !!r.root + " rootChildren=" + r.root?.getChildren?.()?.length)
152
+
153
+ // After 3s, check render loop and try manual render
154
+ setTimeout(() => {
155
+ diag("--- 3s check ---")
156
+ diag("rootChildren=" + r.root?.getChildren?.()?.length)
157
+ diag("renderScheduled=" + r._renderScheduled + " rendering=" + r.renderingNative)
158
+ try {
159
+ r.requestRender()
160
+ diag("requestRender() called")
161
+ } catch (e: any) {
162
+ diag("requestRender FAILED: " + e.message)
163
+ }
164
+ // Force a native render directly
165
+ setTimeout(() => {
166
+ diag("--- 4s force render ---")
167
+ try {
168
+ r.lib.render(r.rendererPtr, true)
169
+ diag("lib.render(force=true) called")
170
+ } catch (e: any) {
171
+ diag("lib.render FAILED: " + e.message)
172
+ }
173
+ }, 1000)
174
+ }, 3000)
133
175
 
134
176
  await render(
135
177
  () => (
@@ -176,18 +218,7 @@ export function tui(input: {
176
218
  </ArgsProvider>
177
219
  </ErrorBoundary>
178
220
  ),
179
- {
180
- targetFps: 60,
181
- gatherStats: false,
182
- exitOnCtrlC: false,
183
- useKittyKeyboard: process.env.OPENCODE_DISABLE_KITTY_KEYBOARD ? undefined : {},
184
- consoleOptions: {
185
- keyBindings: [{ name: "y", ctrl: true, action: "copy-selection" }],
186
- onCopySelection: (text: string) => {
187
- Clipboard.copy(text).catch(() => {})
188
- },
189
- },
190
- },
221
+ renderer,
191
222
  )
192
223
  })
193
224
  }
@@ -197,6 +228,16 @@ function App() {
197
228
  const dimensions = useTerminalDimensions()
198
229
  const renderer = useRenderer()
199
230
  renderer.disableStdoutInterception()
231
+
232
+ // Diagnostic: check dimensions and renderer state from inside the component
233
+ const r = renderer as any
234
+ const diag = (msg: string) => r.writeOut?.("[App] " + msg + "\r\n") ?? process.stderr.write("[App] " + msg + "\n")
235
+ diag("dims=" + dimensions().width + "x" + dimensions().height)
236
+ diag("theme loading...")
237
+ onMount(() => {
238
+ diag("mounted! dims=" + dimensions().width + "x" + dimensions().height)
239
+ diag("root children=" + r.root?.getChildren?.()?.length)
240
+ })
200
241
  const dialog = useDialog()
201
242
  const local = useLocal()
202
243
  const kv = useKV()
package/src/pty/index.ts CHANGED
@@ -115,6 +115,7 @@ export namespace Pty {
115
115
  extraEnv = {
116
116
  OPENCODE_SKIP_THEME_DETECTION: "1",
117
117
  OPENCODE_DISABLE_KITTY_KEYBOARD: "1",
118
+ OTUI_USE_ALTERNATE_SCREEN: "0",
118
119
  COLORTERM: "truecolor",
119
120
  FORCE_COLOR: "3",
120
121
  }
@@ -56,6 +56,7 @@ async function spawnTui(cols: number, rows: number, env?: Record<string, string>
56
56
  FORCE_COLOR: "3",
57
57
  OPENCODE_SKIP_THEME_DETECTION: "1",
58
58
  OPENCODE_DISABLE_KITTY_KEYBOARD: "1",
59
+ OTUI_USE_ALTERNATE_SCREEN: "0",
59
60
  },
60
61
  },
61
62
  )