ai-pack-cli 0.1.6__tar.gz → 0.1.7__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.
- {ai_pack_cli-0.1.6 → ai_pack_cli-0.1.7}/PKG-INFO +1 -1
- {ai_pack_cli-0.1.6 → ai_pack_cli-0.1.7}/ai_pack.py +24 -2
- {ai_pack_cli-0.1.6 → ai_pack_cli-0.1.7}/ai_pack_cli.egg-info/PKG-INFO +1 -1
- {ai_pack_cli-0.1.6 → ai_pack_cli-0.1.7}/setup.py +1 -1
- {ai_pack_cli-0.1.6 → ai_pack_cli-0.1.7}/tests/test_skeleton.py +8 -8
- {ai_pack_cli-0.1.6 → ai_pack_cli-0.1.7}/README.md +0 -0
- {ai_pack_cli-0.1.6 → ai_pack_cli-0.1.7}/ai_pack_cli.egg-info/SOURCES.txt +0 -0
- {ai_pack_cli-0.1.6 → ai_pack_cli-0.1.7}/ai_pack_cli.egg-info/dependency_links.txt +0 -0
- {ai_pack_cli-0.1.6 → ai_pack_cli-0.1.7}/ai_pack_cli.egg-info/entry_points.txt +0 -0
- {ai_pack_cli-0.1.6 → ai_pack_cli-0.1.7}/ai_pack_cli.egg-info/requires.txt +0 -0
- {ai_pack_cli-0.1.6 → ai_pack_cli-0.1.7}/ai_pack_cli.egg-info/top_level.txt +0 -0
- {ai_pack_cli-0.1.6 → ai_pack_cli-0.1.7}/setup.cfg +0 -0
- {ai_pack_cli-0.1.6 → ai_pack_cli-0.1.7}/tests/test_binary.py +0 -0
- {ai_pack_cli-0.1.6 → ai_pack_cli-0.1.7}/tests/test_gitignore.py +0 -0
|
@@ -208,6 +208,20 @@ class SkeletonExtractor:
|
|
|
208
208
|
return content
|
|
209
209
|
|
|
210
210
|
|
|
211
|
+
def copy_via_osc52(payload: str) -> bool:
|
|
212
|
+
"""Attempts to copy text to the client system clipboard using OSC 52 escape sequence."""
|
|
213
|
+
try:
|
|
214
|
+
import base64
|
|
215
|
+
# Base64 encode the payload
|
|
216
|
+
b64_data = base64.b64encode(payload.encode("utf-8")).decode("ascii")
|
|
217
|
+
# Write to stdout using the OSC 52 escape sequence: \x1b]52;c;[base64]\x07
|
|
218
|
+
sys.stdout.write(f"\x1b]52;c;{b64_data}\x07")
|
|
219
|
+
sys.stdout.flush()
|
|
220
|
+
return True
|
|
221
|
+
except Exception:
|
|
222
|
+
return False
|
|
223
|
+
|
|
224
|
+
|
|
211
225
|
def walk_dir(directory: str, git_files: Set[str] = None, gitignore: GitignoreMatcher = None) -> List[str]:
|
|
212
226
|
"""Recursively traverses directories, ignoring binaries and configured ignore directories."""
|
|
213
227
|
candidates = []
|
|
@@ -462,12 +476,20 @@ def main():
|
|
|
462
476
|
print(f"❌ Error saving to file {args.output}: {e}", file=sys.stderr)
|
|
463
477
|
sys.exit(1)
|
|
464
478
|
else:
|
|
479
|
+
copied = False
|
|
465
480
|
try:
|
|
466
481
|
import pyperclip
|
|
467
482
|
pyperclip.copy(payload)
|
|
483
|
+
copied = True
|
|
468
484
|
print("🚀 Successfully copied to clipboard!")
|
|
469
|
-
except Exception
|
|
470
|
-
|
|
485
|
+
except Exception:
|
|
486
|
+
# Fallback to OSC 52 (works seamlessly over SSH / remote terminal sessions)
|
|
487
|
+
if copy_via_osc52(payload):
|
|
488
|
+
copied = True
|
|
489
|
+
print("🚀 Successfully copied to clipboard (via OSC 52 remote sequence)!")
|
|
490
|
+
|
|
491
|
+
if not copied:
|
|
492
|
+
print("❌ Error copying to clipboard: Pyperclip could not find a copy/paste mechanism.", file=sys.stderr)
|
|
471
493
|
print("💡 In headless Linux systems, you must install 'xclip' or 'xsel', or direct output to a file using the '-o' flag.", file=sys.stderr)
|
|
472
494
|
sys.exit(1)
|
|
473
495
|
|
|
@@ -18,17 +18,17 @@ class TestSkeletonExtractor(unittest.TestCase):
|
|
|
18
18
|
|
|
19
19
|
@patch('ai_pack.sys.stderr', new_callable=StringIO)
|
|
20
20
|
def test_get_skeleton_import_error(self, mock_stderr):
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
# Clear sys.modules of any real codesigs import to trigger ImportError
|
|
22
|
+
original_modules = sys.modules.copy()
|
|
23
|
+
if 'codesigs' in sys.modules:
|
|
24
|
+
del sys.modules['codesigs']
|
|
25
|
+
try:
|
|
26
|
+
with patch.dict(sys.modules, {'codesigs': None}):
|
|
27
27
|
result = SkeletonExtractor.get_skeleton("test.py", "def foo():\n pass")
|
|
28
28
|
self.assertEqual(result, "def foo():\n pass")
|
|
29
29
|
self.assertIn("package is required", mock_stderr.getvalue())
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
finally:
|
|
31
|
+
sys.modules = original_modules
|
|
32
32
|
|
|
33
33
|
@patch('ai_pack.sys.stderr', new_callable=StringIO)
|
|
34
34
|
def test_get_skeleton_runtime_error(self, mock_stderr):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|