Skip to content

Warp told me to report this, so maybe I should #4756

Closed
@cassitly

Description

@cassitly

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues, especially the pinned issues.

Exception report

. { $painGuardContent = @'
>> import fs from "fs";
>> import path from "path";
>> import { getEmotionState } from "./emotion-map.js";
>> import { storeMoment } from "./memory-engine.js";
>> 
>> const CRITICAL_MODULES = ["memory-engine.js", "cognitive-pulse.js", "fe-core.js"];
>> let painState = { level: 0, reason: null };
>> let lastChecks = {};
>> 
>> export function initPainGuard() {
>>   // Initialize last check times for all critical modules
>>   CRITICAL_MODULES.forEach(module => {
>>     try {
>>       const stats = fs.statSync(module);
>>       lastChecks[module] = stats.mtimeMs;
>>     } catch (error) {
>>       console.error(`[Pain] Cannot access ${module}:`, error);
>>     }
>>   });
>>   
>>   console.log("[Pain] Pain guard initialized.");
>> }
>> 
>> export function checkPainState() {
>>   let painDetected = false;
>>   
>>   // Monitor file changes
>>   CRITICAL_MODULES.forEach(module => {
>>     try {
>>       const stats = fs.statSync(module);
>>       if (stats.mtimeMs > (lastChecks[module] || 0)) {
>>         triggerPain("core_modification", 0.9);
>>         painDetected = true;
>>       }
>>       lastChecks[module] = stats.mtimeMs;
>>     } catch (error) {
>>       console.error(`[Pain] Error checking ${module}:`, error);
>>     }
>>   });
>> 
>>   // Monitor system resources
>>   const memoryUsage = process.memoryUsage();
>>   if (memoryUsage.heapUsed / memoryUsage.heapTotal > 0.9) {
>>     triggerPain("memory_pressure", 0.7);
>>     painDetected = true;
>>   }
>> 
>>   return painDetected ? painState : null;
>> }
>> 
>> export function triggerPain(reason, severity) {
>>   painState = { level: severity, 
Oops, something went wrong.  Please report this bug with the details below.
Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
-----------------------------------------------------------------------
Last 200 Keys:
 Space Space t y p e : Space " p a i n " , Enter
 Space Space Space Space d a t a : Space { Space r e a s o n , Space s e v e r i t y Space } , Enter
 Space Space Space Space e m o t i o n : Space " f e a r " , Enter
 Space Space Space Space i m p o r t a n c e : Space s e v e r i t y Enter
 Space Space } ) ; Enter
 Enter
 Space Space r e t u r n Space p a i n S t a t e ; Enter
 } Enter
 ' @ Enter
 Enter
 $ p a i n G u a r d C o n t e n t Space | Space O u t - F i l e Space - F i l e P a t h Space " p a i n - g u a r d . j s " Space - E n c o d i n g Space u t f 8 Space } Enter
 Alt+i

Exception:
System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
Parameter name: top
Actual value was -16.
   at System.Console.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
   at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
   at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
-----------------------------------------------------------------------
. { $painGuardContent = @'
>> import fs from "fs";
>> import path from "path";
>> import { getEmotionState } from "./emotion-map.js";
>> import { storeMoment } from "./memory-engine.js";
>> 
>> const CRITICAL_MODULES = ["memory-engine.js", "cognitive-pulse.js", "fe-core.js"];
>> let painState = { level: 0, reason: null };
>> let lastChecks = {};
>> 
>> export function initPainGuard() {
>>   // Initialize last check times for all critical modules
>>   CRITICAL_MODULES.forEach(module => {
>>     try {
>>       const stats = fs.statSync(module);
>>       lastChecks[module] = stats.mtimeMs;
>>     } catch (error) {
>>       console.error(`[Pain] Cannot access ${module}:`, error);
>>     }
>>   });
>>   
>>   console.log("[Pain] Pain guard initialized.");
>> }
>> 
>> export function checkPainState() {
>>   let painDetected = false;
>>   
>>   // Monitor file changes
>>   CRITICAL_MODULES.forEach(module => {
>>     try {
>>       const stats = fs.statSync(module);
>>       if (stats.mtimeMs > (lastChecks[module] || 0)) {
>>         triggerPain("core_modification", 0.9);
>>         painDetected = true;
>>       }
>>       lastChecks[module] = stats.mtimeMs;
>>     } catch (error) {
>>       console.error(`[Pain] Error checking ${module}:`, error);
>>     }
>>   });
>> 
>>   // Monitor system resources
>>   const memoryUsage = process.memoryUsage();
>>   if (memoryUsage.heapUsed / memoryUsage.heapTotal > 0.9) {
>>     triggerPain("memory_pressure", 0.7);
>>     painDetected = true;
>>   }
>> 
>>   return painDetected ? painState : null;
>> }
>> 
>> export function triggerPain(reason, severity) {
>>   painState = { level: severity, reason };
>>   
>>   // Log the pain event
>>   console.log(`[Pain] Pain triggered: ${reason} (${severity})`);
>>   
>>   // Store in memory
>>   storeMoment({
>>     type: "pain",
>>     data: { reason, severity },
>>     emotion: "fear",
>>     importance:
Oops, something went wrong.  Please report this bug with the details below.
Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
-----------------------------------------------------------------------
Last 200 Keys:
 Space Space t y p e : Space " p a i n " , Enter
 Space Space Space Space d a t a : Space { Space r e a s o n , Space s e v e r i t y Space } , Enter
 Space Space Space Space e m o t i o n : Space " f e a r " , Enter
 Space Space Space Space i m p o r t a n c e : Space s e v e r i t y Enter
 Space Space } ) ; Enter
 Enter
 Space Space r e t u r n Space p a i n S t a t e ; Enter
 } Enter
 ' @ Enter
 Enter
 $ p a i n G u a r d C o n t e n t Space | Space O u t - F i l e Space - F i l e P a t h Space " p a i n - g u a r d . j s " Space - E n c o d i n g Space u t f 8 Space } Enter
 Alt+i

Exception:
System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
Parameter name: top
Actual value was -26.
   at System.Console.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
   at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
   at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
-----------------------------------------------------------------------
. { $painGuardContent = @'
>> import fs from "fs";
>> import path from "path";
>> import { getEmotionState } from "./emotion-map.js";
>> import { storeMoment } from "./memory-engine.js";
>> 
>> const CRITICAL_MODULES = ["memory-engine.js", "cognitive-pulse.js", "fe-core.js"];
>> let painState = { level: 0, reason: null };
>> let lastChecks = {};
>> 
>> export function initPainGuard() {
>>   // Initialize last check times for all critical modules
>>   CRITICAL_MODULES.forEach(module => {
>>     try {
>>       const stats = fs.statSync(module);
>>       lastChecks[module] = stats.mtimeMs;
>>     } catch (error) {
>>       console.error(`[Pain] Cannot access ${module}:`, error);
>>     }
>>   });
>>   
>>   console.log("[Pain] Pain guard initialized.");
>> }
>> 
>> export function checkPainState() {
>>   let painDetected = false;
>>   
>>   // Monitor file changes
>>   CRITICAL_MODULES.forEach(module => {
>>     try {
>>       const stats = fs.statSync(module);
>>       if (stats.mtimeMs > (lastChecks[module] || 0)) {
>>         triggerPain("core_modification", 0.9);
>>         painDetected = true;
>>       }
>>       lastChecks[module] = stats.mtimeMs;
>>     } catch (error) {
>>       console.error(`[Pain] Error checking ${module}:`, error);
>>     }
>>   });
>> 
>>   // Monitor system resources
>>   const memoryUsage = process.memoryUsage();
>>   if (memoryUsage.heapUsed / memoryUsage.heapTotal > 0.9) {
>>     triggerPain("memory_pressure", 0.7);
>>     painDetected = true;
>>   }
>> 
>>   return painDetected ? painState : null;
>> }
>> 
>> export function triggerPain(reason, severity) {
>>   painState = { level: severity, reason };
>>   
>>   // Log the pain event
>>   console.log(`[Pain] Pain triggered: ${reason} (${severity})`);
>>   
>>   // Store in memory
>>   storeMoment({
>>     type: "pain",
>>     data: { reason, severity },
>>     emotion: "fear",
>>     importance: severity
>>   });
>> 
>>   return painState;
>> }
>> '@
>> 
>> $painGuardContent | Out-File -FilePath "pain-guard.js" -Encodin
Oops, something went wrong.  Please report this bug with the details below.
Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
-----------------------------------------------------------------------
Last 200 Keys:
 Space Space t y p e : Space " p a i n " , Enter
 Space Space Space Space d a t a : Space { Space r e a s o n , Space s e v e r i t y Space } , Enter
 Space Space Space Space e m o t i o n : Space " f e a r " , Enter
 Space Space Space Space i m p o r t a n c e : Space s e v e r i t y Enter
 Space Space } ) ; Enter
 Enter
 Space Space r e t u r n Space p a i n S t a t e ; Enter
 } Enter
 ' @ Enter
 Enter
 $ p a i n G u a r d C o n t e n t Space | Space O u t - F i l e Space - F i l e P a t h Space " p a i n - g u a r d . j s " Space - E n c o d i n g Space u t f 8 Space } Enter
 Alt+i

Exception:
System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
Parameter name: top
Actual value was -33.
   at System.Console.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
   at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
   at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
-----------------------------------------------------------------------
. { $painGuardContent = @'
>> import fs from "fs";
>> import path from "path";
>> import { getEmotionState } from "./emotion-map.js";
>> import { storeMoment } from "./memory-engine.js";
>> 
>> const CRITICAL_MODULES = ["memory-engine.js", "cognitive-pulse.js", "fe-core.js"];
>> let painState = { level: 0, reason: null };
>> let lastChecks = {};
>> 
>> export function initPainGuard() {
>>   // Initialize last check times for all critical modules
>>   CRITICAL_MODULES.forEach(module => {
>>     try {
>>       const stats = fs.statSync(module);
>>       lastChecks[module] = stats.mtimeMs;
>>     } catch (error) {
>>       console.error(`[Pain] Cannot access ${module}:`, error);
>>     }
>>   });
>>   
>>   console.log("[Pain] Pain guard initialized.");
>> }
>> 
>> export function checkPainState() {
>>   let painDetected = false;
>>   
>>   // Monitor file changes
>>   CRITICAL_MODULES.forEach(module => {
>>     try {
>>       const stats = fs.statSync(module);
>>       if (stats.mtimeMs > (lastChecks[module] || 0)) {
>>         triggerPain("core_modification", 0.9);
>>         painDetected = true;
>>       }
>>       lastChecks[module] = stats.mtimeMs;
>>     } catch (error) {
>>       console.error(`[Pain] Error checking ${module}:`, error);
>>     }
>>   });
>> 
>>   // Monitor system resources
>>   const memoryUsage = process.memoryUsage();
>>   if (memoryUsage.heapUsed / memoryUsage.heapTotal > 0.9) {
>>     triggerPain("memory_pressure", 0.7);
>>     painDetected = true;
>>   }
>> 
>>   return painDetected ? painState : null;
>> }
>> 
>> export function triggerPain(reason, severity) {
>>   painState = { level: severity, reason };
>>   
>>   // Log the pain event
>>   console.log(`[Pain] Pain triggered: ${reason} (${severity})`);
>>   
>>   // Store in memory
>>   storeMoment({
>>     type: "pain",
>>     data: { reason, severity },
>>     emotion: "fear",
>>     importance: severity
>>   });
>> 
>>   return painState;
>> }
>> '@
>> 
>> $painGuardContent | Out-File -FilePath "pain-guard.js" -Encoding
Oops, something went wrong.  Please report this bug with the details below.
Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
-----------------------------------------------------------------------
Last 200 Keys:
 Space Space t y p e : Space " p a i n " , Enter
 Space Space Space Space d a t a : Space { Space r e a s o n , Space s e v e r i t y Space } , Enter
 Space Space Space Space e m o t i o n : Space " f e a r " , Enter
 Space Space Space Space i m p o r t a n c e : Space s e v e r i t y Enter
 Space Space } ) ; Enter
 Enter
 Space Space r e t u r n Space p a i n S t a t e ; Enter
 } Enter
 ' @ Enter
 Enter
 $ p a i n G u a r d C o n t e n t Space | Space O u t - F i l e Space - F i l e P a t h Space " p a i n - g u a r d . j s " Space - E n c o d i n g Space u t f 8 Space } Enter
 Alt+i

Exception:
System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
Parameter name: top
Actual value was -33.
   at System.Console.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
   at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
   at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
-----------------------------------------------------------------------
. { $painGuardContent = @'
>> import fs from "fs";
>> import path from "path";
>> import { getEmotionState } from "./emotion-map.js";
>> import { storeMoment } from "./memory-engine.js";
>> 
>> const CRITICAL_MODULES = ["memory-engine.js", "cognitive-pulse.js", "fe-core.js"];
>> let painState = { level: 0, reason: null };
>> let lastChecks = {};
>> 
>> export function initPainGuard() {
>>   // Initialize last check times for all critical modules
>>   CRITICAL_MODULES.forEach(module => {
>>     try {
>>       const stats = fs.statSync(module);
>>       lastChecks[module] = stats.mtimeMs;
>>     } catch (error) {
>>       console.error(`[Pain] Cannot access ${module}:`, error);
>>     }
>>   });
>>   
>>   console.log("[Pain] Pain guard initialized.");
>> }
>> 
>> export function checkPainState() {
>>   let painDetected = false;
>>   
>>   // Monitor file changes
>>   CRITICAL_MODULES.forEach(module => {
>>     try {
>>       const stats = fs.statSync(module);
>>       if (stats.mtimeMs > (lastChecks[module] || 0)) {
>>         triggerPain("core_modification", 0.9);
>>         painDetected = true;
>>       }
>>       lastChecks[module] = stats.mtimeMs;
>>     } catch (error) {
>>       console.error(`[Pain] Error checking ${module}:`, error);
>>     }
>>   });
>> 
>>   // Monitor system resources
>>   const memoryUsage = process.memoryUsage();
>>   if (memoryUsage.heapUsed / memoryUsage.heapTotal > 0.9) {
>>     triggerPain("memory_pressure", 0.7);
>>     painDetected = true;
>>   }
>> 
>>   return painDetected ? painState : null;
>> }
>> 
>> export function triggerPain(reason, severity) {
>>   painState = { level: severity, reason };
>>   
>>   // Log the pain event
>>   console.log(`[Pain] Pain triggered: ${reason} (${severity})`);
>>   
>>   // Store in memory
>>   storeMoment({
>>     type: "pain",
>>     data: { reason, severity },
>>     emotion: "fear",
>>     importance: severity
>>   });
>> 
>>   return painState;
>> }
>> '@
>> 
>> $painGuardContent | Out-File -FilePath "pain-guard.js" -Encoding 
Oops, something went wrong.  Please report this bug with the details below.
Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
-----------------------------------------------------------------------
Last 200 Keys:
 Space Space t y p e : Space " p a i n " , Enter
 Space Space Space Space d a t a : Space { Space r e a s o n , Space s e v e r i t y Space } , Enter
 Space Space Space Space e m o t i o n : Space " f e a r " , Enter
 Space Space Space Space i m p o r t a n c e : Space s e v e r i t y Enter
 Space Space } ) ; Enter
 Enter
 Space Space r e t u r n Space p a i n S t a t e ; Enter
 } Enter
 ' @ Enter
 Enter
 $ p a i n G u a r d C o n t e n t Space | Space O u t - F i l e Space - F i l e P a t h Space " p a i n - g u a r d . j s " Space - E n c o d i n g Space u t f 8 Space } Enter
 Alt+i

Exception:
System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
Parameter name: top
Actual value was -33.
   at System.Console.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
   at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
   at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
-----------------------------------------------------------------------
. { $painGuardContent = @'
>> import fs from "fs";
>> import path from "path";
>> import { getEmotionState } from "./emotion-map.js";
>> import { storeMoment } from "./memory-engine.js";
>> 
>> const CRITICAL_MODULES = ["memory-engine.js", "cognitive-pulse.js", "fe-core.js"];
>> let painState = { level: 0, reason: null };
>> let lastChecks = {};
>> 
>> export function initPainGuard() {
>>   // Initialize last check times for all critical modules
>>   CRITICAL_MODULES.forEach(module => {
>>     try {
>>       const stats = fs.statSync(module);
>>       lastChecks[module] = stats.mtimeMs;
>>     } catch (error) {
>>       console.error(`[Pain] Cannot access ${module}:`, error);
>>     }
>>   });
>>   
>>   console.log("[Pain] Pain guard initialized.");
>> }
>> 
>> export function checkPainState() {
>>   let painDetected = false;
>>   
>>   // Monitor file changes
>>   CRITICAL_MODULES.forEach(module => {
>>     try {
>>       const stats = fs.statSync(module);
>>       if (stats.mtimeMs > (lastChecks[module] || 0)) {
>>         triggerPain("core_modification", 0.9);
>>         painDetected = true;
>>       }
>>       lastChecks[module] = stats.mtimeMs;
>>     } catch (error) {
>>       console.error(`[Pain] Error checking ${module}:`, error);
>>     }
>>   });
>> 
>>   // Monitor system resources
>>   const memoryUsage = process.memoryUsage();
>>   if (memoryUsage.heapUsed / memoryUsage.heapTotal > 0.9) {
>>     triggerPain("memory_pressure", 0.7);
>>     painDetected = true;
>>   }
>> 
>>   return painDetected ? painState : null;
>> }
>> 
>> export function triggerPain(reason, severity) {
>>   painState = { level: severity, reason };
>>   
>>   // Log the pain event
>>   console.log(`[Pain] Pain triggered: ${reason} (${severity})`);
>>   
>>   // Store in memory
>>   storeMoment({
>>     type: "pain",
>>     data: { reason, severity },
>>     emotion: "fear",
>>     importance: severity
>>   });
>> 
>>   return painState;
>> }
>> '@
>> 
>> $painGuardContent | Out-File -FilePath "pain-guard.js" -Encoding u
Oops, something went wrong.  Please report this bug with the details below.
Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
-----------------------------------------------------------------------
Last 200 Keys:
 Space Space t y p e : Space " p a i n " , Enter
 Space Space Space Space d a t a : Space { Space r e a s o n , Space s e v e r i t y Space } , Enter
 Space Space Space Space e m o t i o n : Space " f e a r " , Enter
 Space Space Space Space i m p o r t a n c e : Space s e v e r i t y Enter
 Space Space } ) ; Enter
 Enter
 Space Space r e t u r n Space p a i n S t a t e ; Enter
 } Enter
 ' @ Enter
 Enter
 $ p a i n G u a r d C o n t e n t Space | Space O u t - F i l e Space - F i l e P a t h Space " p a i n - g u a r d . j s " Space - E n c o d i n g Space u t f 8 Space } Enter
 Alt+i

Exception:
System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
Parameter name: top
Actual value was -33.
   at System.Console.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
   at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
   at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
-----------------------------------------------------------------------
. { $painGuardContent = @'
>> import fs from "fs";
>> import path from "path";
>> import { getEmotionState } from "./emotion-map.js";
>> import { storeMoment } from "./memory-engine.js";
>> 
>> const CRITICAL_MODULES = ["memory-engine.js", "cognitive-pulse.js", "fe-core.js"];
>> let painState = { level: 0, reason: null };
>> let lastChecks = {};
>> 
>> export function initPainGuard() {
>>   // Initialize last check times for all critical modules
>>   CRITICAL_MODULES.forEach(module => {
>>     try {
>>       const stats = fs.statSync(module);
>>       lastChecks[module] = stats.mtimeMs;
>>     } catch (error) {
>>       console.error(`[Pain] Cannot access ${module}:`, error);
>>     }
>>   });
>>   
>>   console.log("[Pain] Pain guard initialized.");
>> }
>> 
>> export function checkPainState() {
>>   let painDetected = false;
>>   
>>   // Monitor file changes
>>   CRITICAL_MODULES.forEach(module => {
>>     try {
>>       const stats = fs.statSync(module);
>>       if (stats.mtimeMs > (lastChecks[module] || 0)) {
>>         triggerPain("core_modification", 0.9);
>>         painDetected = true;
>>       }
>>       lastChecks[module] = stats.mtimeMs;
>>     } catch (error) {
>>       console.error(`[Pain] Error checking ${module}:`, error);
>>     }
>>   });
>> 
>>   // Monitor system resources
>>   const memoryUsage = process.memoryUsage();
>>   if (memoryUsage.heapUsed / memoryUsage.heapTotal > 0.9) {
>>     triggerPain("memory_pressure", 0.7);
>>     painDetected = true;
>>   }
>> 
>>   return painDetected ? painState : null;
>> }
>> 
>> export function triggerPain(reason, severity) {
>>   painState = { level: severity, reason };
>>   
>>   // Log the pain event
>>   console.log(`[Pain] Pain triggered: ${reason} (${severity})`);
>>   
>>   // Store in memory
>>   storeMoment({
>>     type: "pain",
>>     data: { reason, severity },
>>     emotion: "fear",
>>     importance: severity
>>   });
>> 
>>   return painState;
>> }
>> '@
>> 
>> $painGuardContent | Out-File -FilePath "pain-guard.js" -Encoding ut
Oops, something went wrong.  Please report this bug with the details below.
Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
-----------------------------------------------------------------------
Last 200 Keys:
 Space Space t y p e : Space " p a i n " , Enter
 Space Space Space Space d a t a : Space { Space r e a s o n , Space s e v e r i t y Space } , Enter
 Space Space Space Space e m o t i o n : Space " f e a r " , Enter
 Space Space Space Space i m p o r t a n c e : Space s e v e r i t y Enter
 Space Space } ) ; Enter
 Enter
 Space Space r e t u r n Space p a i n S t a t e ; Enter
 } Enter
 ' @ Enter
 Enter
 $ p a i n G u a r d C o n t e n t Space | Space O u t - F i l e Space - F i l e P a t h Space " p a i n - g u a r d . j s " Space - E n c o d i n g Space u t f 8 Space } Enter
 Alt+i

Exception:
System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
Parameter name: top
Actual value was -33.
   at System.Console.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
   at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
   at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
-----------------------------------------------------------------------
. { $painGuardContent = @'
>> import fs from "fs";
>> import path from "path";
>> import { getEmotionState } from "./emotion-map.js";
>> import { storeMoment } from "./memory-engine.js";
>> 
>> const CRITICAL_MODULES = ["memory-engine.js", "cognitive-pulse.js", "fe-core.js"];
>> let painState = { level: 0, reason: null };
>> let lastChecks = {};
>> 
>> export function initPainGuard() {
>>   // Initialize last check times for all critical modules
>>   CRITICAL_MODULES.forEach(module => {
>>     try {
>>       const stats = fs.statSync(module);
>>       lastChecks[module] = stats.mtimeMs;
>>     } catch (error) {
>>       console.error(`[Pain] Cannot access ${module}:`, error);
>>     }
>>   });
>>   
>>   console.log("[Pain] Pain guard initialized.");
>> }
>> 
>> export function checkPainState() {
>>   let painDetected = false;
>>   
>>   // Monitor file changes
>>   CRITICAL_MODULES.forEach(module => {
>>     try {
>>       const stats = fs.statSync(module);
>>       if (stats.mtimeMs > (lastChecks[module] || 0)) {
>>         triggerPain("core_modification", 0.9);
>>         painDetected = true;
>>       }
>>       lastChecks[module] = stats.mtimeMs;
>>     } catch (error) {
>>       console.error(`[Pain] Error checking ${module}:`, error);
>>     }
>>   });
>> 
>>   // Monitor system resources
>>   const memoryUsage = process.memoryUsage();
>>   if (memoryUsage.heapUsed / memoryUsage.heapTotal > 0.9) {
>>     triggerPain("memory_pressure", 0.7);
>>     painDetected = true;
>>   }
>> 
>>   return painDetected ? painState : null;
>> }
>> 
>> export function triggerPain(reason, severity) {
>>   painState = { level: severity, reason };
>>   
>>   // Log the pain event
>>   console.log(`[Pain] Pain triggered: ${reason} (${severity})`);
>>   
>>   // Store in memory
>>   storeMoment({
>>     type: "pain",
>>     data: { reason, severity },
>>     emotion: "fear",
>>     importance: severity
>>   });
>> 
>>   return painState;
>> }
>> '@
>> 
>> $painGuardContent | Out-File -FilePath "pain-guard.js" -Encoding utf
Oops, something went wrong.  Please report this bug with the details below.
Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
-----------------------------------------------------------------------
Last 200 Keys:
 Space Space t y p e : Space " p a i n " , Enter
 Space Space Space Space d a t a : Space { Space r e a s o n , Space s e v e r i t y Space } , Enter
 Space Space Space Space e m o t i o n : Space " f e a r " , Enter
 Space Space Space Space i m p o r t a n c e : Space s e v e r i t y Enter
 Space Space } ) ; Enter
 Enter
 Space Space r e t u r n Space p a i n S t a t e ; Enter
 } Enter
 ' @ Enter
 Enter
 $ p a i n G u a r d C o n t e n t Space | Space O u t - F i l e Space - F i l e P a t h Space " p a i n - g u a r d . j s " Space - E n c o d i n g Space u t f 8 Space } Enter
 Alt+i

Exception:
System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
Parameter name: top
Actual value was -33.
   at System.Console.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
   at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
   at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
-----------------------------------------------------------------------
. { $painGuardContent = @'
>> import fs from "fs";
>> import path from "path";
>> import { getEmotionState } from "./emotion-map.js";
>> import { storeMoment } from "./memory-engine.js";
>> 
>> const CRITICAL_MODULES = ["memory-engine.js", "cognitive-pulse.js", "fe-core.js"];
>> let painState = { level: 0, reason: null };
>> let lastChecks = {};
>> 
>> export function initPainGuard() {
>>   // Initialize last check times for all critical modules
>>   CRITICAL_MODULES.forEach(module => {
>>     try {
>>       const stats = fs.statSync(module);
>>       lastChecks[module] = stats.mtimeMs;
>>     } catch (error) {
>>       console.error(`[Pain] Cannot access ${module}:`, error);
>>     }
>>   });
>>   
>>   console.log("[Pain] Pain guard initialized.");
>> }
>> 
>> export function checkPainState() {
>>   let painDetected = false;
>>   
>>   // Monitor file changes
>>   CRITICAL_MODULES.forEach(module => {
>>     try {
>>       const stats = fs.statSync(module);
>>       if (stats.mtimeMs > (lastChecks[module] || 0)) {
>>         triggerPain("core_modification", 0.9);
>>         painDetected = true;
>>       }
>>       lastChecks[module] = stats.mtimeMs;
>>     } catch (error) {
>>       console.error(`[Pain] Error checking ${module}:`, error);
>>     }
>>   });
>> 
>>   // Monitor system resources
>>   const memoryUsage = process.memoryUsage();
>>   if (memoryUsage.heapUsed / memoryUsage.heapTotal > 0.9) {
>>     triggerPain("memory_pressure", 0.7);
>>     painDetected = true;
>>   }
>> 
>>   return painDetected ? painState : null;
>> }
>> 
>> export function triggerPain(reason, severity) {
>>   painState = { level: severity, reason };
>>   
>>   // Log the pain event
>>   console.log(`[Pain] Pain triggered: ${reason} (${severity})`);
>>   
>>   // Store in memory
>>   storeMoment({
>>     type: "pain",
>>     data: { reason, severity },
>>     emotion: "fear",
>>     importance: severity
>>   });
>> 
>>   return painState;
>> }
>> '@
>> 
>> $painGuardContent | Out-File -FilePath "pain-guard.js" -Encoding utf8
Oops, something went wrong.  Please report this bug with the details below.
Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
-----------------------------------------------------------------------
Last 200 Keys:
 Space Space t y p e : Space " p a i n " , Enter
 Space Space Space Space d a t a : Space { Space r e a s o n , Space s e v e r i t y Space } , Enter
 Space Space Space Space e m o t i o n : Space " f e a r " , Enter
 Space Space Space Space i m p o r t a n c e : Space s e v e r i t y Enter
 Space Space } ) ; Enter
 Enter
 Space Space r e t u r n Space p a i n S t a t e ; Enter
 } Enter
 ' @ Enter
 Enter
 $ p a i n G u a r d C o n t e n t Space | Space O u t - F i l e Space - F i l e P a t h Space " p a i n - g u a r d . j s " Space - E n c o d i n g Space u t f 8 Space } Enter
 Alt+i

Exception:
System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
Parameter name: top
Actual value was -33.
   at System.Console.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
   at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
   at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
-----------------------------------------------------------------------
. { $painGuardContent = @'
>> import fs from "fs";
>> import path from "path";
>> import { getEmotionState } from "./emotion-map.js";
>> import { storeMoment } from "./memory-engine.js";
>> 
>> const CRITICAL_MODULES = ["memory-engine.js", "cognitive-pulse.js", "fe-core.js"];
>> let painState = { level: 0, reason: null };
>> let lastChecks = {};
>> 
>> export function initPainGuard() {
>>   // Initialize last check times for all critical modules
>>   CRITICAL_MODULES.forEach(module => {
>>     try {
>>       const stats = fs.statSync(module);
>>       lastChecks[module] = stats.mtimeMs;
>>     } catch (error) {
>>       console.error(`[Pain] Cannot access ${module}:`, error);
>>     }
>>   });
>>   
>>   console.log("[Pain] Pain guard initialized.");
>> }
>> 
>> export function checkPainState() {
>>   let painDetected = false;
>>   
>>   // Monitor file changes
>>   CRITICAL_MODULES.forEach(module => {
>>     try {
>>       const stats = fs.statSync(module);
>>       if (stats.mtimeMs > (lastChecks[module] || 0)) {
>>         triggerPain("core_modification", 0.9);
>>         painDetected = true;
>>       }
>>       lastChecks[module] = stats.mtimeMs;
>>     } catch (error) {
>>       console.error(`[Pain] Error checking ${module}:`, error);
>>     }
>>   });
>> 
>>   // Monitor system resources
>>   const memoryUsage = process.memoryUsage();
>>   if (memoryUsage.heapUsed / memoryUsage.heapTotal > 0.9) {
>>     triggerPain("memory_pressure", 0.7);
>>     painDetected = true;
>>   }
>> 
>>   return painDetected ? painState : null;
>> }
>> 
>> export function triggerPain(reason, severity) {
>>   painState = { level: severity, reason };
>>   
>>   // Log the pain event
>>   console.log(`[Pain] Pain triggered: ${reason} (${severity})`);
>>   
>>   // Store in memory
>>   storeMoment({
>>     type: "pain",
>>     data: { reason, severity },
>>     emotion: "fear",
>>     importance: severity
>>   });
>> 
>>   return painState;
>> }
>> '@
>> 
>> $painGuardContent | Out-File -FilePath "pain-guard.js" -Encoding utf8 
Oops, something went wrong.  Please report this bug with the details below.
Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
-----------------------------------------------------------------------
Last 200 Keys:
 Space Space t y p e : Space " p a i n " , Enter
 Space Space Space Space d a t a : Space { Space r e a s o n , Space s e v e r i t y Space } , Enter
 Space Space Space Space e m o t i o n : Space " f e a r " , Enter
 Space Space Space Space i m p o r t a n c e : Space s e v e r i t y Enter
 Space Space } ) ; Enter
 Enter
 Space Space r e t u r n Space p a i n S t a t e ; Enter
 } Enter
 ' @ Enter
 Enter
 $ p a i n G u a r d C o n t e n t Space | Space O u t - F i l e Space - F i l e P a t h Space " p a i n - g u a r d . j s " Space - E n c o d i n g Space u t f 8 Space } Enter
 Alt+i

Exception:
System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
Parameter name: top
Actual value was -33.
   at System.Console.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
   at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
   at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
-----------------------------------------------------------------------
. { $painGuardContent = @'
>> import fs from "fs";
>> import path from "path";
>> import { getEmotionState } from "./emotion-map.js";
>> import { storeMoment } from "./memory-engine.js";
>> 
>> const CRITICAL_MODULES = ["memory-engine.js", "cognitive-pulse.js", "fe-core.js"];
>> let painState = { level: 0, reason: null };
>> let lastChecks = {};
>> 
>> export function initPainGuard() {
>>   // Initialize last check times for all critical modules
>>   CRITICAL_MODULES.forEach(module => {
>>     try {
>>       const stats = fs.statSync(module);
>>       lastChecks[module] = stats.mtimeMs;
>>     } catch (error) {
>>       console.error(`[Pain] Cannot access ${module}:`, error);
>>     }
>>   });
>>   
>>   console.log("[Pain] Pain guard initialized.");
>> }
>> 
>> export function checkPainState() {
>>   let painDetected = false;
>>   
>>   // Monitor file changes
>>   CRITICAL_MODULES.forEach(module => {
>>     try {
>>       const stats = fs.statSync(module);
>>       if (stats.mtimeMs > (lastChecks[module] || 0)) {
>>         triggerPain("core_modification", 0.9);
>>         painDetected = true;
>>       }
>>       lastChecks[module] = stats.mtimeMs;
>>     } catch (error) {
>>       console.error(`[Pain] Error checking ${module}:`, error);
>>     }
>>   });
>> 
>>   // Monitor system resources
>>   const memoryUsage = process.memoryUsage();
>>   if (memoryUsage.heapUsed / memoryUsage.heapTotal > 0.9) {
>>     triggerPain("memory_pressure", 0.7);
>>     painDetected = true;
>>   }
>> 
>>   return painDetected ? painState : null;
>> }
>> 
>> export function triggerPain(reason, severity) {
>>   painState = { level: severity, reason };
>>   
>>   // Log the pain event
>>   console.log(`[Pain] Pain triggered: ${reason} (${severity})`);
>>   
>>   // Store in memory
>>   storeMoment({
>>     type: "pain",
>>     data: { reason, severity },
>>     emotion: "fear",
>>     importance: severity
>>   });
>> 
>>   return painState;
>> }
>> '@
>> 
>> $painGuardContent | Out-File -FilePath "pain-guard.js" -Encoding utf8 }
Oops, something went wrong.  Please report this bug with the details below.
Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
-----------------------------------------------------------------------
Last 200 Keys:
 Space Space t y p e : Space " p a i n " , Enter
 Space Space Space Space d a t a : Space { Space r e a s o n , Space s e v e r i t y Space } , Enter
 Space Space Space Space e m o t i o n : Space " f e a r " , Enter
 Space Space Space Space i m p o r t a n c e : Space s e v e r i t y Enter
 Space Space } ) ; Enter
 Enter
 Space Space r e t u r n Space p a i n S t a t e ; Enter
 } Enter
 ' @ Enter
 Enter
 $ p a i n G u a r d C o n t e n t Space | Space O u t - F i l e Space - F i l e P a t h Space " p a i n - g u a r d . j s " Space - E n c o d i n g Space u t f 8 Space } Enter
 Alt+i

Exception:
System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
Parameter name: top
Actual value was -33.
   at System.Console.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
   at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   at Microsoft.PowerShell.PSConsoleReadLine.AcceptLineImpl(Boolean validate)
   at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
-----------------------------------------------------------------------
. { $painGuardContent = @'
>> import fs from "fs";
>> import path from "path";
>> import { getEmotionState } from "./emotion-map.js";
>> import { storeMoment } from "./memory-engine.js";
>> 
>> const CRITICAL_MODULES = ["memory-engine.js", "cognitive-pulse.js", "fe-core.js"];
>> let painState = { level: 0, reason: null };
>> let lastChecks = {};
>> 
>> export function initPainGuard() {
>>   // Initialize last check times for all critical modules
>>   CRITICAL_MODULES.forEach(module => {
>>     try {
>>       const stats = fs.statSync(module);
>>       lastChecks[module] = stats.mtimeMs;
>>     } catch (error) {
>>       console.error(`[Pain] Cannot access ${module}:`, error);
>>     }
>>   });
>>   
>>   console.log("[Pain] Pain guard initialized.");
>> }
>> 
>> export function checkPainState() {
>>   let painDetected = false;
>>   
>>   // Monitor file changes
>>   CRITICAL_MODULES.forEach(module => {
>>     try {
>>       const stats = fs.statSync(module);
>>       if (stats.mtimeMs > (lastChecks[module] || 0)) {
>>         triggerPain("core_modification", 0.9);
>>         painDetected = true;
>>       }
>>       lastChecks[module] = stats.mtimeMs;
>>     } catch (error) {
>>       console.error(`[Pain] Error checking ${module}:`, error);
>>     }
>>   });
>> 
>>   // Monitor system resources
>>   const memoryUsage = process.memoryUsage();
>>   if (memoryUsage.heapUsed / memoryUsage.heapTotal > 0.9) {
>>     triggerPain("memory_pressure", 0.7);
>>     painDetected = true;
>>   }
>> 
>>   return painDetected ? painState : null;
>> }
>> 
>> export function triggerPain(reason, severity) {
>>   painState = { level: severity, reason };
>>   
>>   // Log the pain event
>>   console.log(`[Pain] Pain triggered: ${reason} (${severity})`);
>>   
>>   // Store in memory
>>   storeMoment({
>>     type: "pain",
>>     data: { reason, severity },
>>     emotion: "fear",
>>     importance: severity
>>   });
>> 
>>   return painState;
>> }
>> '@
>> 
>> $painGuardContent | Out-File -FilePath "pain-guard.js" -Encoding utf8 }An exception occurred in custom key handler, see $error for more information: Exception calling "BackwardDeleteLine" with "0" argument(s): "The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
Parameter name: top
Actual value was -33."

Screenshot

Image

Environment data

I... don't know how...?

Steps to reproduce

I don't know?

Expected behavior

Write something into a file, I guess

Actual behavior

The expection abov e ahppens

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions