skilllite 0.1.0__tar.gz → 0.1.2__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 (53) hide show
  1. {skilllite-0.1.0/skilllite.egg-info → skilllite-0.1.2}/PKG-INFO +151 -1
  2. {skilllite-0.1.0 → skilllite-0.1.2}/README.md +144 -0
  3. {skilllite-0.1.0 → skilllite-0.1.2}/pyproject.toml +5 -1
  4. {skilllite-0.1.0 → skilllite-0.1.2}/skilllite/__init__.py +1 -1
  5. skilllite-0.1.2/skilllite/cli/__init__.py +19 -0
  6. skilllite-0.1.2/skilllite/cli/__main__.py +10 -0
  7. skilllite-0.1.2/skilllite/cli/binary.py +93 -0
  8. skilllite-0.1.2/skilllite/cli/integrations/__init__.py +8 -0
  9. skilllite-0.1.2/skilllite/cli/integrations/opencode.py +316 -0
  10. skilllite-0.1.2/skilllite/cli/main.py +142 -0
  11. skilllite-0.1.2/skilllite/cli/mcp.py +29 -0
  12. {skilllite-0.1.0 → skilllite-0.1.2}/skilllite/core/__init__.py +2 -0
  13. skilllite-0.1.2/skilllite/core/adapters/__init__.py +74 -0
  14. skilllite-0.1.2/skilllite/core/adapters/langchain.py +362 -0
  15. skilllite-0.1.2/skilllite/core/adapters/llamaindex.py +264 -0
  16. {skilllite-0.1.0 → skilllite-0.1.2}/skilllite/core/handler.py +179 -4
  17. {skilllite-0.1.0 → skilllite-0.1.2}/skilllite/core/loops.py +180 -15
  18. {skilllite-0.1.0 → skilllite-0.1.2}/skilllite/core/manager.py +82 -15
  19. {skilllite-0.1.0 → skilllite-0.1.2}/skilllite/core/metadata.py +14 -7
  20. skilllite-0.1.2/skilllite/core/security.py +420 -0
  21. {skilllite-0.1.0 → skilllite-0.1.2}/skilllite/mcp/server.py +537 -49
  22. {skilllite-0.1.0 → skilllite-0.1.2}/skilllite/quick.py +14 -4
  23. skilllite-0.1.2/skilllite/sandbox/context.py +155 -0
  24. skilllite-0.1.2/skilllite/sandbox/execution_service.py +254 -0
  25. {skilllite-0.1.0 → skilllite-0.1.2}/skilllite/sandbox/skillbox/executor.py +124 -19
  26. skilllite-0.1.2/skilllite/sandbox/unified_executor.py +359 -0
  27. {skilllite-0.1.0 → skilllite-0.1.2/skilllite.egg-info}/PKG-INFO +151 -1
  28. {skilllite-0.1.0 → skilllite-0.1.2}/skilllite.egg-info/SOURCES.txt +14 -1
  29. {skilllite-0.1.0 → skilllite-0.1.2}/skilllite.egg-info/requires.txt +8 -0
  30. skilllite-0.1.0/skilllite/cli.py +0 -217
  31. {skilllite-0.1.0 → skilllite-0.1.2}/LICENSE +0 -0
  32. {skilllite-0.1.0 → skilllite-0.1.2}/MANIFEST.in +0 -0
  33. {skilllite-0.1.0 → skilllite-0.1.2}/setup.cfg +0 -0
  34. {skilllite-0.1.0 → skilllite-0.1.2}/setup.py +0 -0
  35. {skilllite-0.1.0 → skilllite-0.1.2}/skilllite/analyzer.py +0 -0
  36. {skilllite-0.1.0 → skilllite-0.1.2}/skilllite/builtin_tools.py +0 -0
  37. {skilllite-0.1.0 → skilllite-0.1.2}/skilllite/core/executor.py +0 -0
  38. {skilllite-0.1.0 → skilllite-0.1.2}/skilllite/core/prompt_builder.py +0 -0
  39. {skilllite-0.1.0 → skilllite-0.1.2}/skilllite/core/registry.py +0 -0
  40. {skilllite-0.1.0 → skilllite-0.1.2}/skilllite/core/skill_info.py +0 -0
  41. {skilllite-0.1.0 → skilllite-0.1.2}/skilllite/core/tool_builder.py +0 -0
  42. {skilllite-0.1.0 → skilllite-0.1.2}/skilllite/core/tools.py +0 -0
  43. {skilllite-0.1.0 → skilllite-0.1.2}/skilllite/mcp/__init__.py +0 -0
  44. {skilllite-0.1.0 → skilllite-0.1.2}/skilllite/sandbox/__init__.py +0 -0
  45. {skilllite-0.1.0 → skilllite-0.1.2}/skilllite/sandbox/base.py +0 -0
  46. {skilllite-0.1.0 → skilllite-0.1.2}/skilllite/sandbox/config.py +0 -0
  47. {skilllite-0.1.0 → skilllite-0.1.2}/skilllite/sandbox/skillbox/__init__.py +0 -0
  48. {skilllite-0.1.0 → skilllite-0.1.2}/skilllite/sandbox/skillbox/binary.py +0 -0
  49. {skilllite-0.1.0 → skilllite-0.1.2}/skilllite/sandbox/utils.py +0 -0
  50. {skilllite-0.1.0 → skilllite-0.1.2}/skilllite/validation.py +0 -0
  51. {skilllite-0.1.0 → skilllite-0.1.2}/skilllite.egg-info/dependency_links.txt +0 -0
  52. {skilllite-0.1.0 → skilllite-0.1.2}/skilllite.egg-info/entry_points.txt +0 -0
  53. {skilllite-0.1.0 → skilllite-0.1.2}/skilllite.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: skilllite
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: A lightweight Skills execution engine with LLM integration for LLM agents
5
5
  Author-email: SkillLite Team <skilllite@example.com>
6
6
  License: MIT
@@ -32,10 +32,16 @@ Provides-Extra: anthropic
32
32
  Requires-Dist: anthropic>=0.18.0; extra == "anthropic"
33
33
  Provides-Extra: mcp
34
34
  Requires-Dist: mcp>=1.0.0; extra == "mcp"
35
+ Provides-Extra: langchain
36
+ Requires-Dist: langchain-core>=0.1.0; extra == "langchain"
37
+ Provides-Extra: llamaindex
38
+ Requires-Dist: llama-index-core>=0.10.0; extra == "llamaindex"
35
39
  Provides-Extra: all
36
40
  Requires-Dist: openai>=1.0.0; extra == "all"
37
41
  Requires-Dist: anthropic>=0.18.0; extra == "all"
38
42
  Requires-Dist: mcp>=1.0.0; extra == "all"
43
+ Requires-Dist: langchain-core>=0.1.0; extra == "all"
44
+ Requires-Dist: llama-index-core>=0.10.0; extra == "all"
39
45
  Provides-Extra: dev
40
46
  Requires-Dist: pytest>=7.0; extra == "dev"
41
47
  Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
@@ -288,6 +294,150 @@ Enum for LLM provider formats:
288
294
  - `ToolFormat.CLAUDE`
289
295
  - `ToolFormat.OPENAI`
290
296
 
297
+ ## Framework Adapters
298
+
299
+ SkillLite provides adapters for popular AI frameworks with security confirmation support.
300
+
301
+ ### LangChain Integration
302
+
303
+ For LangChain/LangGraph integration, we recommend using the dedicated **[langchain-skilllite](https://pypi.org/project/langchain-skilllite/)** package:
304
+
305
+ ```bash
306
+ pip install langchain-skilllite
307
+ ```
308
+
309
+ ```python
310
+ from langchain_skilllite import SkillLiteToolkit
311
+ from langchain_openai import ChatOpenAI
312
+ from langgraph.prebuilt import create_react_agent
313
+
314
+ # Load all skills from a directory as LangChain tools
315
+ tools = SkillLiteToolkit.from_directory("./skills")
316
+
317
+ # Create a LangGraph agent
318
+ agent = create_react_agent(ChatOpenAI(model="gpt-4"), tools)
319
+
320
+ # Run the agent
321
+ result = agent.invoke({
322
+ "messages": [("user", "Convert 'hello world' to uppercase")]
323
+ })
324
+ ```
325
+
326
+ With security confirmation (sandbox_level=3):
327
+
328
+ ```python
329
+ def confirm_execution(report: str, scan_id: str) -> bool:
330
+ print(report)
331
+ return input("Continue? [y/N]: ").lower() == 'y'
332
+
333
+ tools = SkillLiteToolkit.from_directory(
334
+ "./skills",
335
+ sandbox_level=3, # 1=no sandbox, 2=sandbox only, 3=sandbox+scan
336
+ confirmation_callback=confirm_execution
337
+ )
338
+ ```
339
+
340
+ For more details, see the [langchain-skilllite documentation](../langchain-skilllite/README.md).
341
+
342
+ **Alternative**: You can also use the built-in adapter:
343
+
344
+ ```python
345
+ from skilllite import SkillManager
346
+ from skilllite.core.adapters.langchain import SkillLiteToolkit
347
+
348
+ manager = SkillManager(skills_dir="./skills")
349
+ tools = SkillLiteToolkit.from_manager(manager).get_tools()
350
+ ```
351
+
352
+ ### LlamaIndex Integration
353
+
354
+ ```python
355
+ from skilllite import SkillManager
356
+ from skilllite.core.adapters.llamaindex import SkillLiteToolSpec
357
+
358
+ manager = SkillManager(skills_dir="./skills")
359
+
360
+ # Basic usage
361
+ tool_spec = SkillLiteToolSpec.from_manager(manager)
362
+ tools = tool_spec.to_tool_list()
363
+
364
+ # With security confirmation
365
+ def confirm(report: str, scan_id: str) -> bool:
366
+ print(report)
367
+ return input("Continue? [y/N]: ").lower() == 'y'
368
+
369
+ tool_spec = SkillLiteToolSpec.from_manager(
370
+ manager,
371
+ sandbox_level=3,
372
+ confirmation_callback=confirm
373
+ )
374
+
375
+ # Use with LlamaIndex agent
376
+ from llama_index.core.agent import ReActAgent
377
+ agent = ReActAgent.from_tools(tools, llm=llm)
378
+ ```
379
+
380
+ ### Security Levels
381
+
382
+ | Level | Description |
383
+ |-------|-------------|
384
+ | 1 | No sandbox - direct execution |
385
+ | 2 | Sandbox isolation only |
386
+ | 3 | Sandbox + static security scan (requires confirmation for high-severity issues) |
387
+
388
+ ## OpenCode Integration
389
+
390
+ SkillLite can be integrated with [OpenCode](https://github.com/opencode-ai/opencode) as an MCP (Model Context Protocol) server, providing secure sandbox execution capabilities.
391
+
392
+ ### Quick Setup
393
+
394
+ ```bash
395
+ # Install with MCP support
396
+ pip install skilllite[mcp]
397
+
398
+ # One-command setup for OpenCode
399
+ skilllite init-opencode
400
+
401
+ # Start OpenCode
402
+ opencode
403
+ ```
404
+
405
+ The `init-opencode` command automatically:
406
+ - Detects the best way to start the MCP server (uvx, pipx, skilllite, or python)
407
+ - Creates `opencode.json` with optimal configuration
408
+ - Generates `.opencode/skills/skilllite/SKILL.md` with usage instructions
409
+ - Discovers your pre-defined skills
410
+
411
+ ### Available MCP Tools
412
+
413
+ | Tool | Description |
414
+ |------|-------------|
415
+ | `skilllite_list_skills` | List all available skills |
416
+ | `skilllite_get_skill_info` | Get skill details and input schema |
417
+ | `skilllite_run_skill` | Execute a pre-defined skill |
418
+ | `skilllite_scan_code` | Scan code for security issues |
419
+ | `skilllite_execute_code` | Execute code in secure sandbox |
420
+
421
+ ### Security Features
422
+
423
+ - **System-level Sandbox**: macOS Seatbelt / Linux Namespace isolation
424
+ - **Security Scanning**: Static analysis before execution
425
+ - **User Confirmation**: Dangerous code requires explicit approval
426
+ - **Scan ID Verification**: Prevents code modification between scan and execution
427
+
428
+ For detailed documentation, see [OpenCode Integration Tutorial](../tutorials/07_opencode_integration/README.md).
429
+
430
+ ## CLI Commands
431
+
432
+ ```bash
433
+ skilllite install # Install skillbox sandbox binary
434
+ skilllite uninstall # Remove skillbox binary
435
+ skilllite status # Show installation status
436
+ skilllite version # Show version information
437
+ skilllite mcp # Start MCP server
438
+ skilllite init-opencode # Initialize OpenCode integration
439
+ ```
440
+
291
441
  ## License
292
442
 
293
443
  MIT License
@@ -242,6 +242,150 @@ Enum for LLM provider formats:
242
242
  - `ToolFormat.CLAUDE`
243
243
  - `ToolFormat.OPENAI`
244
244
 
245
+ ## Framework Adapters
246
+
247
+ SkillLite provides adapters for popular AI frameworks with security confirmation support.
248
+
249
+ ### LangChain Integration
250
+
251
+ For LangChain/LangGraph integration, we recommend using the dedicated **[langchain-skilllite](https://pypi.org/project/langchain-skilllite/)** package:
252
+
253
+ ```bash
254
+ pip install langchain-skilllite
255
+ ```
256
+
257
+ ```python
258
+ from langchain_skilllite import SkillLiteToolkit
259
+ from langchain_openai import ChatOpenAI
260
+ from langgraph.prebuilt import create_react_agent
261
+
262
+ # Load all skills from a directory as LangChain tools
263
+ tools = SkillLiteToolkit.from_directory("./skills")
264
+
265
+ # Create a LangGraph agent
266
+ agent = create_react_agent(ChatOpenAI(model="gpt-4"), tools)
267
+
268
+ # Run the agent
269
+ result = agent.invoke({
270
+ "messages": [("user", "Convert 'hello world' to uppercase")]
271
+ })
272
+ ```
273
+
274
+ With security confirmation (sandbox_level=3):
275
+
276
+ ```python
277
+ def confirm_execution(report: str, scan_id: str) -> bool:
278
+ print(report)
279
+ return input("Continue? [y/N]: ").lower() == 'y'
280
+
281
+ tools = SkillLiteToolkit.from_directory(
282
+ "./skills",
283
+ sandbox_level=3, # 1=no sandbox, 2=sandbox only, 3=sandbox+scan
284
+ confirmation_callback=confirm_execution
285
+ )
286
+ ```
287
+
288
+ For more details, see the [langchain-skilllite documentation](../langchain-skilllite/README.md).
289
+
290
+ **Alternative**: You can also use the built-in adapter:
291
+
292
+ ```python
293
+ from skilllite import SkillManager
294
+ from skilllite.core.adapters.langchain import SkillLiteToolkit
295
+
296
+ manager = SkillManager(skills_dir="./skills")
297
+ tools = SkillLiteToolkit.from_manager(manager).get_tools()
298
+ ```
299
+
300
+ ### LlamaIndex Integration
301
+
302
+ ```python
303
+ from skilllite import SkillManager
304
+ from skilllite.core.adapters.llamaindex import SkillLiteToolSpec
305
+
306
+ manager = SkillManager(skills_dir="./skills")
307
+
308
+ # Basic usage
309
+ tool_spec = SkillLiteToolSpec.from_manager(manager)
310
+ tools = tool_spec.to_tool_list()
311
+
312
+ # With security confirmation
313
+ def confirm(report: str, scan_id: str) -> bool:
314
+ print(report)
315
+ return input("Continue? [y/N]: ").lower() == 'y'
316
+
317
+ tool_spec = SkillLiteToolSpec.from_manager(
318
+ manager,
319
+ sandbox_level=3,
320
+ confirmation_callback=confirm
321
+ )
322
+
323
+ # Use with LlamaIndex agent
324
+ from llama_index.core.agent import ReActAgent
325
+ agent = ReActAgent.from_tools(tools, llm=llm)
326
+ ```
327
+
328
+ ### Security Levels
329
+
330
+ | Level | Description |
331
+ |-------|-------------|
332
+ | 1 | No sandbox - direct execution |
333
+ | 2 | Sandbox isolation only |
334
+ | 3 | Sandbox + static security scan (requires confirmation for high-severity issues) |
335
+
336
+ ## OpenCode Integration
337
+
338
+ SkillLite can be integrated with [OpenCode](https://github.com/opencode-ai/opencode) as an MCP (Model Context Protocol) server, providing secure sandbox execution capabilities.
339
+
340
+ ### Quick Setup
341
+
342
+ ```bash
343
+ # Install with MCP support
344
+ pip install skilllite[mcp]
345
+
346
+ # One-command setup for OpenCode
347
+ skilllite init-opencode
348
+
349
+ # Start OpenCode
350
+ opencode
351
+ ```
352
+
353
+ The `init-opencode` command automatically:
354
+ - Detects the best way to start the MCP server (uvx, pipx, skilllite, or python)
355
+ - Creates `opencode.json` with optimal configuration
356
+ - Generates `.opencode/skills/skilllite/SKILL.md` with usage instructions
357
+ - Discovers your pre-defined skills
358
+
359
+ ### Available MCP Tools
360
+
361
+ | Tool | Description |
362
+ |------|-------------|
363
+ | `skilllite_list_skills` | List all available skills |
364
+ | `skilllite_get_skill_info` | Get skill details and input schema |
365
+ | `skilllite_run_skill` | Execute a pre-defined skill |
366
+ | `skilllite_scan_code` | Scan code for security issues |
367
+ | `skilllite_execute_code` | Execute code in secure sandbox |
368
+
369
+ ### Security Features
370
+
371
+ - **System-level Sandbox**: macOS Seatbelt / Linux Namespace isolation
372
+ - **Security Scanning**: Static analysis before execution
373
+ - **User Confirmation**: Dangerous code requires explicit approval
374
+ - **Scan ID Verification**: Prevents code modification between scan and execution
375
+
376
+ For detailed documentation, see [OpenCode Integration Tutorial](../tutorials/07_opencode_integration/README.md).
377
+
378
+ ## CLI Commands
379
+
380
+ ```bash
381
+ skilllite install # Install skillbox sandbox binary
382
+ skilllite uninstall # Remove skillbox binary
383
+ skilllite status # Show installation status
384
+ skilllite version # Show version information
385
+ skilllite mcp # Start MCP server
386
+ skilllite init-opencode # Initialize OpenCode integration
387
+ ```
388
+
245
389
  ## License
246
390
 
247
391
  MIT License
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "skilllite"
7
- version = "0.1.0"
7
+ version = "0.1.2"
8
8
  description = "A lightweight Skills execution engine with LLM integration for LLM agents"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
@@ -36,10 +36,14 @@ dependencies = [
36
36
  openai = ["openai>=1.0.0"]
37
37
  anthropic = ["anthropic>=0.18.0"]
38
38
  mcp = ["mcp>=1.0.0"]
39
+ langchain = ["langchain-core>=0.1.0"]
40
+ llamaindex = ["llama-index-core>=0.10.0"]
39
41
  all = [
40
42
  "openai>=1.0.0",
41
43
  "anthropic>=0.18.0",
42
44
  "mcp>=1.0.0",
45
+ "langchain-core>=0.1.0",
46
+ "llama-index-core>=0.10.0",
43
47
  ]
44
48
  dev = [
45
49
  "pytest>=7.0",
@@ -113,7 +113,7 @@ try:
113
113
  except ImportError:
114
114
  MCP_AVAILABLE = False
115
115
 
116
- __version__ = "0.1.0"
116
+ __version__ = "0.1.1"
117
117
  __all__ = [
118
118
  # Core
119
119
  "SkillManager",
@@ -0,0 +1,19 @@
1
+ """
2
+ Command-line interface for skilllite.
3
+
4
+ Provides commands for managing the skillbox binary, similar to
5
+ how Playwright provides `playwright install` for browser management.
6
+
7
+ Usage:
8
+ skilllite install # Download and install the sandbox binary
9
+ skilllite uninstall # Remove the installed binary
10
+ skilllite status # Show installation status
11
+ skilllite version # Show version information
12
+ skilllite mcp # Start MCP server
13
+ skilllite init-opencode # Initialize OpenCode integration
14
+ """
15
+
16
+ from .main import main, create_parser
17
+
18
+ __all__ = ["main", "create_parser"]
19
+
@@ -0,0 +1,10 @@
1
+ """
2
+ Allow running the CLI as a module: python -m skilllite.cli
3
+ """
4
+
5
+ import sys
6
+ from .main import main
7
+
8
+ if __name__ == "__main__":
9
+ sys.exit(main())
10
+
@@ -0,0 +1,93 @@
1
+ """
2
+ Binary management commands for skilllite CLI.
3
+
4
+ Commands: install, uninstall, status, version
5
+ """
6
+
7
+ import argparse
8
+ import sys
9
+
10
+ from .. import __version__
11
+ from ..sandbox.skillbox import (
12
+ BINARY_VERSION,
13
+ get_platform,
14
+ install,
15
+ is_installed,
16
+ get_installed_version,
17
+ uninstall,
18
+ )
19
+
20
+
21
+ def print_status() -> None:
22
+ """Print installation status."""
23
+ from ..sandbox.skillbox import find_binary, get_binary_path
24
+
25
+ print("SkillLite Installation Status")
26
+ print("=" * 40)
27
+
28
+ if is_installed():
29
+ version = get_installed_version()
30
+ print(f"✓ skillbox is installed (v{version})")
31
+ print(f" Location: {get_binary_path()}")
32
+ else:
33
+ binary = find_binary()
34
+ if binary:
35
+ print(f"✓ skillbox found at: {binary}")
36
+ else:
37
+ print("✗ skillbox is not installed")
38
+ print(" Install with: skilllite install")
39
+
40
+
41
+ def cmd_install(args: argparse.Namespace) -> int:
42
+ """Install the skillbox binary."""
43
+ try:
44
+ install(
45
+ version=args.version,
46
+ force=args.force,
47
+ show_progress=not args.quiet
48
+ )
49
+ return 0
50
+ except Exception as e:
51
+ print(f"Error: {e}", file=sys.stderr)
52
+ return 1
53
+
54
+
55
+ def cmd_uninstall(args: argparse.Namespace) -> int:
56
+ """Uninstall the skillbox binary."""
57
+ try:
58
+ uninstall()
59
+ return 0
60
+ except Exception as e:
61
+ print(f"Error: {e}", file=sys.stderr)
62
+ return 1
63
+
64
+
65
+ def cmd_status(args: argparse.Namespace) -> int:
66
+ """Show installation status."""
67
+ try:
68
+ print_status()
69
+ return 0
70
+ except Exception as e:
71
+ print(f"Error: {e}", file=sys.stderr)
72
+ return 1
73
+
74
+
75
+ def cmd_version(args: argparse.Namespace) -> int:
76
+ """Show version information."""
77
+ print(f"skilllite Python SDK: v{__version__}")
78
+ print(f"skillbox binary (bundled): v{BINARY_VERSION}")
79
+
80
+ installed_version = get_installed_version()
81
+ if installed_version:
82
+ print(f"skillbox binary (installed): v{installed_version}")
83
+ else:
84
+ print("skillbox binary (installed): not installed")
85
+
86
+ try:
87
+ plat = get_platform()
88
+ print(f"Platform: {plat}")
89
+ except RuntimeError as e:
90
+ print(f"Platform: {e}")
91
+
92
+ return 0
93
+
@@ -0,0 +1,8 @@
1
+ """
2
+ CLI integrations for external tools.
3
+ """
4
+
5
+ from .opencode import cmd_init_opencode
6
+
7
+ __all__ = ["cmd_init_opencode"]
8
+