@pixelbyte-software/pixcode 1.49.11 → 1.50.1

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.
@@ -29,6 +29,10 @@ type HermesTerminalLaunchEvent = {
29
29
  provider: string;
30
30
  projectPath: string | null;
31
31
  prompt: string | null;
32
+ startupInput: string | null;
33
+ permissionMode: string | null;
34
+ skipPermissions: boolean;
35
+ bypassPermissions: boolean;
32
36
  source: string;
33
37
  createdAt: string;
34
38
  };
@@ -80,6 +84,24 @@ function rememberHermesTerminalLaunch(event: HermesTerminalLaunchEvent) {
80
84
  hermesTerminalLaunchEmitter.emit('terminal-launch', event);
81
85
  }
82
86
 
87
+ function readTrimmedString(value: unknown) {
88
+ return typeof value === 'string' && value.trim() ? value.trim() : null;
89
+ }
90
+
91
+ function readBoolean(value: unknown) {
92
+ return value === true || value === 'true' || value === '1';
93
+ }
94
+
95
+ function isLegacyPromptLikelyStartupInput(prompt: string | null) {
96
+ if (!prompt || prompt.length > 160 || prompt.includes('\n')) return false;
97
+ if (/^[/:!@]/u.test(prompt)) return true;
98
+ if (prompt.includes(':')) return false;
99
+ if (/\b(user|request|reason|audit|task|kullanıcı|kullanicinin|istek|isteği|gorev|görev|terminal|codex|claude|qwen|gemini|cursor|opencode|open|aç|ac|başlat|baslat|send|gönder|gonder)\b/iu.test(prompt)) {
100
+ return false;
101
+ }
102
+ return prompt.length <= 80;
103
+ }
104
+
83
105
  export function createHermesRouter(options: HermesRouterOptions = {}): Router {
84
106
  const router = express.Router();
85
107
 
@@ -448,15 +470,23 @@ export function createHermesRouter(options: HermesRouterOptions = {}): Router {
448
470
  const projectPath = typeof body.projectPath === 'string' && body.projectPath.trim()
449
471
  ? body.projectPath.trim()
450
472
  : null;
451
- const prompt = typeof body.prompt === 'string' && body.prompt.trim()
452
- ? body.prompt.trim()
453
- : null;
473
+ const prompt = readTrimmedString(body.prompt ?? body.reason);
474
+ const requestedStartupInput = readTrimmedString(body.startupInput ?? body.input);
475
+ const startupInput = requestedStartupInput ?? (isLegacyPromptLikelyStartupInput(prompt) ? prompt : null);
476
+ const bypassPermissions = readBoolean(body.bypassPermissions);
477
+ const skipPermissions = readBoolean(body.skipPermissions) || bypassPermissions;
478
+ const requestedPermissionMode = readTrimmedString(body.permissionMode);
479
+ const permissionMode = requestedPermissionMode ?? (skipPermissions ? 'bypassPermissions' : null);
454
480
 
455
481
  const event: HermesTerminalLaunchEvent = {
456
482
  id: nextHermesTerminalLaunchId,
457
483
  provider,
458
484
  projectPath,
459
485
  prompt,
486
+ startupInput,
487
+ permissionMode,
488
+ skipPermissions,
489
+ bypassPermissions,
460
490
  source: 'hermes-mcp',
461
491
  createdAt: new Date().toISOString(),
462
492
  };