portacode 0.3.19.dev5__tar.gz → 0.3.19.dev7__tar.gz

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.
Files changed (45) hide show
  1. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/PKG-INFO +1 -1
  2. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/portacode/_version.py +2 -2
  3. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/portacode/connection/handlers/project_state_handlers.py +39 -63
  4. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/portacode.egg-info/PKG-INFO +1 -1
  5. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/.claude/agents/communication-manager.md +0 -0
  6. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/.claude/settings.local.json +0 -0
  7. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/.gitignore +0 -0
  8. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/.gitmodules +0 -0
  9. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/LICENSE +0 -0
  10. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/MANIFEST.in +0 -0
  11. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/Makefile +0 -0
  12. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/README.md +0 -0
  13. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/backup.sh +0 -0
  14. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/docker-compose.yaml +0 -0
  15. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/portacode/README.md +0 -0
  16. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/portacode/__init__.py +0 -0
  17. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/portacode/__main__.py +0 -0
  18. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/portacode/cli.py +0 -0
  19. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/portacode/connection/README.md +0 -0
  20. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/portacode/connection/__init__.py +0 -0
  21. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/portacode/connection/client.py +0 -0
  22. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/portacode/connection/handlers/README.md +0 -0
  23. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/portacode/connection/handlers/WEBSOCKET_PROTOCOL.md +0 -0
  24. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/portacode/connection/handlers/__init__.py +0 -0
  25. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/portacode/connection/handlers/base.py +0 -0
  26. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/portacode/connection/handlers/file_handlers.py +0 -0
  27. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/portacode/connection/handlers/registry.py +0 -0
  28. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/portacode/connection/handlers/session.py +0 -0
  29. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/portacode/connection/handlers/system_handlers.py +0 -0
  30. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/portacode/connection/handlers/tab_factory.py +0 -0
  31. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/portacode/connection/handlers/terminal_handlers.py +0 -0
  32. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/portacode/connection/multiplex.py +0 -0
  33. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/portacode/connection/terminal.py +0 -0
  34. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/portacode/data.py +0 -0
  35. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/portacode/keypair.py +0 -0
  36. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/portacode/service.py +0 -0
  37. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/portacode.egg-info/SOURCES.txt +0 -0
  38. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/portacode.egg-info/dependency_links.txt +0 -0
  39. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/portacode.egg-info/entry_points.txt +0 -0
  40. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/portacode.egg-info/requires.txt +0 -0
  41. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/portacode.egg-info/top_level.txt +0 -0
  42. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/pyproject.toml +0 -0
  43. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/restore.sh +0 -0
  44. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/setup.cfg +0 -0
  45. {portacode-0.3.19.dev5 → portacode-0.3.19.dev7}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: portacode
3
- Version: 0.3.19.dev5
3
+ Version: 0.3.19.dev7
4
4
  Summary: Portacode CLI client and SDK
5
5
  Home-page: https://github.com/portacode/portacode
6
6
  Author: Meena Erian
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '0.3.19.dev5'
21
- __version_tuple__ = version_tuple = (0, 3, 19, 'dev5')
20
+ __version__ = version = '0.3.19.dev7'
21
+ __version_tuple__ = version_tuple = (0, 3, 19, 'dev7')
@@ -338,64 +338,17 @@ class GitManager:
338
338
  return None
339
339
 
340
340
  def _get_pygments_lexer(self, file_path: str) -> Optional[object]:
341
- """Get Pygments lexer for a file path."""
341
+ """Get Pygments lexer for a file path using built-in detection."""
342
342
  if not PYGMENTS_AVAILABLE:
343
343
  return None
344
344
 
345
345
  try:
346
- # Try to get lexer by filename
346
+ # Use Pygments' built-in filename detection
347
347
  return get_lexer_for_filename(file_path)
348
348
  except ClassNotFound:
349
- # Fallback to common extensions
350
- extension = os.path.splitext(file_path)[1].lower()
351
- lexer_map = {
352
- '.py': 'python',
353
- '.js': 'javascript',
354
- '.jsx': 'jsx',
355
- '.ts': 'typescript',
356
- '.tsx': 'tsx',
357
- '.html': 'html',
358
- '.htm': 'html',
359
- '.css': 'css',
360
- '.scss': 'scss',
361
- '.sass': 'sass',
362
- '.json': 'json',
363
- '.xml': 'xml',
364
- '.yaml': 'yaml',
365
- '.yml': 'yaml',
366
- '.java': 'java',
367
- '.c': 'c',
368
- '.cpp': 'cpp',
369
- '.cc': 'cpp',
370
- '.cxx': 'cpp',
371
- '.h': 'c',
372
- '.hpp': 'cpp',
373
- '.cs': 'csharp',
374
- '.php': 'php',
375
- '.rb': 'ruby',
376
- '.go': 'go',
377
- '.rs': 'rust',
378
- '.sh': 'bash',
379
- '.bash': 'bash',
380
- '.zsh': 'zsh',
381
- '.fish': 'fish',
382
- '.sql': 'sql',
383
- '.md': 'markdown',
384
- '.rst': 'rst'
385
- }
386
-
387
- lexer_name = lexer_map.get(extension)
388
- if lexer_name:
389
- try:
390
- return get_lexer_by_name(lexer_name)
391
- except ClassNotFound:
392
- pass
393
-
394
- # Final fallback to text
395
- try:
396
- return get_lexer_by_name('text')
397
- except ClassNotFound:
398
- return None
349
+ # If no lexer found, return None (will fall back to plain text)
350
+ logger.debug("No Pygments lexer found for file: %s", file_path)
351
+ return None
399
352
  except Exception as e:
400
353
  logger.debug("Error getting Pygments lexer: %s", e)
401
354
  return None
@@ -484,7 +437,7 @@ class GitManager:
484
437
 
485
438
  for line_info in parsed_diff:
486
439
  if line_info['type'] == 'header':
487
- continue # Skip diff headers
440
+ continue # Skip all diff headers including --- and +++ lines
488
441
 
489
442
  line_type = line_info['type']
490
443
  old_line_num = line_info.get('old_line_num', '')
@@ -492,19 +445,42 @@ class GitManager:
492
445
  content = line_info['content']
493
446
  intraline_html = line_info.get('intraline_html', '')
494
447
 
495
- # Use intra-line highlighted content if available, otherwise apply syntax highlighting
448
+ # Use intra-line highlighted content if available
496
449
  if intraline_html:
497
450
  final_content = intraline_html
498
- elif lexer and content.strip():
499
- try:
500
- # Apply syntax highlighting to the content (without the +/- prefix)
501
- clean_content = content[1:] if content and content[0] in '+-' else content
502
- highlighted = highlight(clean_content, lexer, HtmlFormatter(nowrap=True, noclasses=False))
503
- final_content = content[0] + highlighted if content and content[0] in '+-' else highlighted
504
- except Exception:
505
- final_content = self._escape_html(content)
506
451
  else:
507
- final_content = self._escape_html(content)
452
+ # Apply syntax highlighting to the content
453
+ if content and content[0] in '+-':
454
+ # For added/deleted lines, highlight the content without the prefix
455
+ prefix = content[0]
456
+ clean_content = content[1:]
457
+
458
+ if lexer and clean_content.strip():
459
+ try:
460
+ # Apply syntax highlighting
461
+ highlighted = highlight(clean_content, lexer, HtmlFormatter(nowrap=True, noclasses=False))
462
+ final_content = prefix + highlighted
463
+ except Exception as e:
464
+ logger.debug("Error applying syntax highlighting: %s", e)
465
+ final_content = self._escape_html(content)
466
+ else:
467
+ final_content = self._escape_html(content)
468
+ elif content and content[0] == ' ':
469
+ # For context lines, highlight without the space prefix
470
+ clean_content = content[1:]
471
+
472
+ if lexer and clean_content.strip():
473
+ try:
474
+ # Apply syntax highlighting
475
+ highlighted = highlight(clean_content, lexer, HtmlFormatter(nowrap=True, noclasses=False))
476
+ final_content = ' ' + highlighted
477
+ except Exception as e:
478
+ logger.debug("Error applying syntax highlighting: %s", e)
479
+ final_content = self._escape_html(content)
480
+ else:
481
+ final_content = self._escape_html(content)
482
+ else:
483
+ final_content = self._escape_html(content)
508
484
 
509
485
  # CSS classes for different line types
510
486
  row_class = f'diff-line diff-{line_type}'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: portacode
3
- Version: 0.3.19.dev5
3
+ Version: 0.3.19.dev7
4
4
  Summary: Portacode CLI client and SDK
5
5
  Home-page: https://github.com/portacode/portacode
6
6
  Author: Meena Erian
File without changes