agentskills-runtime 0.0.1__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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 OpenCangJie Team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,454 @@
1
+ Metadata-Version: 2.1
2
+ Name: agentskills-runtime
3
+ Version: 0.0.1
4
+ Summary: Python SDK for AgentSkills Runtime - Install, manage, and execute AI agent skills with built-in runtime support
5
+ Author-email: OpenCangJie Team <team@opencangjie.org>
6
+ Maintainer-email: OpenCangJie Team <team@opencangjie.org>
7
+ License: MIT
8
+ Project-URL: Homepage, https://atomgit.com/uctoo/agentskills-runtime
9
+ Project-URL: Documentation, https://atomgit.com/uctoo/agentskills-runtime#readme
10
+ Project-URL: Repository, https://atomgit.com/uctoo/agentskills-runtime.git
11
+ Project-URL: Issues, https://atomgit.com/uctoo/agentskills-runtime/issues
12
+ Project-URL: Changelog, https://atomgit.com/uctoo/agentskills-runtime/blob/main/CHANGELOG.md
13
+ Keywords: agentskills-runtime,skills,ai,agent,runtime,cli,uctoo,cangjiemagic,mcp,llm-tools,skill-runtime,ai-agent-tools
14
+ Classifier: Development Status :: 3 - Alpha
15
+ Classifier: Environment :: Console
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.8
21
+ Classifier: Programming Language :: Python :: 3.9
22
+ Classifier: Programming Language :: Python :: 3.10
23
+ Classifier: Programming Language :: Python :: 3.11
24
+ Classifier: Programming Language :: Python :: 3.12
25
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
26
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
27
+ Classifier: Typing :: Typed
28
+ Requires-Python: >=3.8
29
+ Description-Content-Type: text/markdown
30
+ License-File: LICENSE
31
+ Requires-Dist: requests>=2.28.0
32
+ Requires-Dist: click>=8.0.0
33
+ Requires-Dist: rich>=13.0.0
34
+ Requires-Dist: questionary>=2.0.0
35
+ Requires-Dist: pyyaml>=6.0
36
+ Requires-Dist: packaging>=21.0
37
+ Provides-Extra: dev
38
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
39
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
40
+ Requires-Dist: black>=23.0.0; extra == "dev"
41
+ Requires-Dist: isort>=5.0.0; extra == "dev"
42
+ Requires-Dist: mypy>=1.0.0; extra == "dev"
43
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
44
+ Provides-Extra: publish
45
+ Requires-Dist: build>=1.0.0; extra == "publish"
46
+ Requires-Dist: twine>=4.0.0; extra == "publish"
47
+
48
+ # agentskills-runtime
49
+
50
+ Python SDK for AgentSkills Runtime - Install, manage, and execute AI agent skills with built-in runtime support.
51
+
52
+ ## Features
53
+
54
+ - **Complete Runtime Management**: Download, install, start, and stop the AgentSkills runtime
55
+ - **Skill Management**: Install, list, execute, and remove skills
56
+ - **CLI & Programmatic API**: Use via command line or integrate into your applications
57
+ - **Cross-Platform**: Supports Windows, macOS, and Linux
58
+ - **Type Hints**: Full type annotations for better IDE support
59
+
60
+ ## Installation
61
+
62
+ ```bash
63
+ pip install agentskills-runtime
64
+ ```
65
+
66
+ ## Quick Start
67
+
68
+ ### 1. Install the Runtime
69
+
70
+ ```bash
71
+ # Download and install the AgentSkills runtime
72
+ skills install-runtime
73
+
74
+ # Or specify a version
75
+ skills install-runtime --runtime-version 0.0.13
76
+ ```
77
+
78
+ ### 2. Start the Runtime
79
+
80
+ ```bash
81
+ # Start in background (default)
82
+ skills start
83
+
84
+ # Start in foreground
85
+ skills start --foreground
86
+
87
+ # Custom port and host
88
+ skills start --port 3000 --host 0.0.0.0
89
+ ```
90
+
91
+ ### 3. Manage Skills
92
+
93
+ ```bash
94
+ # Find and install skills
95
+ skills find react
96
+ skills add ./my-skill
97
+
98
+ # List installed skills
99
+ skills list
100
+
101
+ # Execute a skill
102
+ skills run my-skill -p '{"input": "data"}'
103
+ ```
104
+
105
+ ## CLI Commands
106
+
107
+ ### Runtime Management
108
+
109
+ #### `skills install-runtime`
110
+
111
+ Download and install the AgentSkills runtime binary.
112
+
113
+ ```bash
114
+ skills install-runtime
115
+ skills install-runtime --runtime-version 0.0.13
116
+ ```
117
+
118
+ #### `skills start`
119
+
120
+ Start the AgentSkills runtime server.
121
+
122
+ ```bash
123
+ # Start in background (default)
124
+ skills start
125
+
126
+ # Start in foreground
127
+ skills start --foreground
128
+
129
+ # Custom configuration
130
+ skills start --port 3000 --host 0.0.0.0
131
+ ```
132
+
133
+ **Options:**
134
+ - `-p, --port <port>` - Port to listen on (default: 8080)
135
+ - `-h, --host <host>` - Host to bind to (default: 127.0.0.1)
136
+ - `-f, --foreground` - Run in foreground (default: background)
137
+
138
+ #### `skills stop`
139
+
140
+ Stop the AgentSkills runtime server.
141
+
142
+ ```bash
143
+ skills stop
144
+ ```
145
+
146
+ #### `skills status`
147
+
148
+ Check the status of the skills runtime server.
149
+
150
+ ```bash
151
+ skills status
152
+ ```
153
+
154
+ ### Skill Management
155
+
156
+ #### `skills find [query]`
157
+
158
+ Search for skills interactively or by keyword.
159
+
160
+ ```bash
161
+ skills find
162
+ skills find react testing
163
+ skills find "pdf generation"
164
+ skills find skill --source github --limit 10
165
+ skills find skill --source atomgit --limit 5
166
+ ```
167
+
168
+ **Options:**
169
+ - `-l, --limit <number>`: Maximum number of results, default 10
170
+ - `-s, --source <source>`: Search source, options: `all` (default), `github`, `gitee`, `atomgit`
171
+
172
+ **Note:** AtomGit search requires setting the `ATOMGIT_TOKEN` environment variable in the runtime's `.env` configuration file.
173
+
174
+ #### `skills add <source>`
175
+
176
+ Install a skill from GitHub or local path.
177
+
178
+ ```bash
179
+ skills add ./my-skill
180
+ skills add github.com/user/skill-repo
181
+ skills add github.com/user/skill-repo --branch develop
182
+ ```
183
+
184
+ **Options:**
185
+ - `-g, --global`: Install globally (user-level)
186
+ - `-p, --path <path>`: Local path to skill
187
+ - `-b, --branch <branch>`: Git branch name
188
+ - `-t, --tag <tag>`: Git tag name
189
+ - `-c, --commit <commit>`: Git commit ID
190
+ - `-n, --name <name>`: Skill name override
191
+ - `--validate/--no-validate`: Validate skill before installation (default: True)
192
+ - `-y, --yes`: Skip confirmation prompts
193
+
194
+ #### `skills list`
195
+
196
+ List installed skills.
197
+
198
+ ```bash
199
+ skills list
200
+ skills list --limit 50 --page 1
201
+ skills list --json
202
+ ```
203
+
204
+ **Options:**
205
+ - `-l, --limit <number>`: Maximum number of results, default 20
206
+ - `-p, --page <number>`: Page number, default 0
207
+ - `--json`: Output as JSON
208
+
209
+ #### `skills run <skillId>`
210
+
211
+ Execute a skill.
212
+
213
+ ```bash
214
+ skills run my-skill -p '{"param1": "value"}'
215
+ skills run my-skill --tool tool-name -p '{"param1": "value"}'
216
+ skills run my-skill -i # Interactive mode
217
+ ```
218
+
219
+ **Options:**
220
+ - `-t, --tool <name>`: Tool name to execute
221
+ - `-p, --params <json>`: Parameters as JSON string
222
+ - `-f, --params-file <file>`: Parameters from JSON file
223
+ - `-i, --interactive`: Interactive parameter input
224
+
225
+ #### `skills remove <skillId>`
226
+
227
+ Remove an installed skill.
228
+
229
+ ```bash
230
+ skills remove my-skill
231
+ skills rm my-skill -y
232
+ ```
233
+
234
+ **Options:**
235
+ - `-y, --yes`: Skip confirmation prompt
236
+
237
+ #### `skills info <skillId>`
238
+
239
+ Show detailed information about a skill.
240
+
241
+ ```bash
242
+ skills info my-skill
243
+ ```
244
+
245
+ #### `skills init [name]`
246
+
247
+ Initialize a new skill project.
248
+
249
+ ```bash
250
+ skills init my-new-skill
251
+ skills init my-new-skill --directory ./skills
252
+ ```
253
+
254
+ **Options:**
255
+ - `-d, --directory <dir>`: Target directory, default: current directory
256
+ - `-t, --template <template>`: Skill template, default: basic
257
+
258
+ #### `skills check`
259
+
260
+ Check for skill updates.
261
+
262
+ ```bash
263
+ skills check
264
+ ```
265
+
266
+ ## Programmatic API
267
+
268
+ ### Basic Usage
269
+
270
+ ```python
271
+ from agent_skills import SkillsClient, create_client
272
+
273
+ # Create a client
274
+ client = create_client()
275
+
276
+ # List skills
277
+ result = client.list_skills(limit=10)
278
+ for skill in result.skills:
279
+ print(f"{skill.name}: {skill.description}")
280
+
281
+ # Execute a skill
282
+ result = client.execute_skill("my-skill", {"input": "data"})
283
+ if result.success:
284
+ print(result.output)
285
+ else:
286
+ print(f"Error: {result.error_message}")
287
+ ```
288
+
289
+ ### Runtime Management
290
+
291
+ ```python
292
+ from agent_skills import RuntimeManager, RuntimeOptions
293
+
294
+ manager = RuntimeManager()
295
+
296
+ # Check if runtime is installed
297
+ if not manager.is_installed():
298
+ # Download and install runtime
299
+ manager.download_runtime("0.0.13")
300
+
301
+ # Start runtime
302
+ options = RuntimeOptions(port=8080, host="127.0.0.1")
303
+ process = manager.start(options)
304
+
305
+ # Check status
306
+ status = manager.status()
307
+ print(f"Running: {status.running}, Version: {status.version}")
308
+
309
+ # Stop runtime
310
+ manager.stop()
311
+ ```
312
+
313
+ ### Skill Definition
314
+
315
+ ```python
316
+ from agent_skills import define_skill, SkillMetadata, ToolDefinition, ToolParameter, ParamType
317
+
318
+ # Define a skill
319
+ skill = define_skill(
320
+ metadata=SkillMetadata(
321
+ name="my-skill",
322
+ version="1.0.0",
323
+ description="My custom skill",
324
+ author="Your Name",
325
+ ),
326
+ tools=[
327
+ ToolDefinition(
328
+ name="my-tool",
329
+ description="A tool that does something",
330
+ parameters=[
331
+ ToolParameter(
332
+ name="input",
333
+ param_type=ParamType.STRING,
334
+ description="Input parameter",
335
+ required=True,
336
+ ),
337
+ ],
338
+ ),
339
+ ],
340
+ )
341
+ ```
342
+
343
+ ### Configuration
344
+
345
+ ```python
346
+ from agent_skills import get_config
347
+
348
+ # Get configuration from environment variables prefixed with SKILL_
349
+ config = get_config()
350
+ api_key = config.get("API_KEY") # From SKILL_API_KEY env var
351
+ ```
352
+
353
+ ## Configuration
354
+
355
+ ### Environment Variables
356
+
357
+ - `SKILL_RUNTIME_API_URL`: API server URL (default: http://127.0.0.1:8080)
358
+ - `SKILL_INSTALL_PATH`: Default path for skill installation
359
+ - `SKILL_*`: Custom configuration accessible via `get_config()`
360
+
361
+ ## Development
362
+
363
+ ### Setup Development Environment
364
+
365
+ ```bash
366
+ # Clone the repository
367
+ git clone https://atomgit.com/uctoo/agentskills-runtime.git
368
+ cd agentskills-runtime/sdk/python
369
+
370
+ # Create virtual environment
371
+ python -m venv venv
372
+ source venv/bin/activate # On Windows: venv\Scripts\activate
373
+
374
+ # Install development dependencies
375
+ pip install -e ".[dev]"
376
+ ```
377
+
378
+ ### Run Tests
379
+
380
+ ```bash
381
+ # Run all tests
382
+ pytest
383
+
384
+ # Run with coverage
385
+ pytest --cov=agent_skills
386
+
387
+ # Run specific test file
388
+ pytest tests/test_models.py
389
+ ```
390
+
391
+ ### Code Quality
392
+
393
+ ```bash
394
+ # Format code
395
+ black src tests
396
+
397
+ # Sort imports
398
+ isort src tests
399
+
400
+ # Type check
401
+ mypy src
402
+
403
+ # Lint
404
+ ruff check src tests
405
+ ```
406
+
407
+ ## License
408
+
409
+ MIT License - see [LICENSE](LICENSE) for details.
410
+
411
+ ## Publishing to PyPI
412
+
413
+ ### Prerequisites
414
+
415
+ 1. Create an account on [PyPI](https://pypi.org/account/register/)
416
+ 2. Generate an API token from [PyPI Account Settings](https://pypi.org/manage/account/token/)
417
+ 3. Update `.pypirc` with your token:
418
+
419
+ ```ini
420
+ [pypi]
421
+ username = __token__
422
+ password = pypi-xxxx... # Your PyPI API token
423
+ ```
424
+
425
+ ### Publish to PyPI
426
+
427
+ ```bash
428
+ # Install publish dependencies
429
+ pip install -e ".[publish]"
430
+
431
+ # Method 1: Using the publish script
432
+ python publish.py
433
+
434
+ # Method 2: Manual publish
435
+ python -m build
436
+ python -m twine upload dist/*
437
+
438
+ # Publish to TestPyPI first (recommended for testing)
439
+ python publish.py --test
440
+ ```
441
+
442
+ ### Important Notes
443
+
444
+ - **Never commit `.pypirc` with real tokens to version control**
445
+ - The `.gitignore` file excludes `.pypirc` by default
446
+ - Use TestPyPI for testing before publishing to production PyPI
447
+ - Version numbers must be unique for each publish
448
+
449
+ ## Links
450
+
451
+ - [Documentation](https://atomgit.com/uctoo/agentskills-runtime#readme)
452
+ - [Repository](https://atomgit.com/uctoo/agentskills-runtime)
453
+ - [Issue Tracker](https://atomgit.com/uctoo/agentskills-runtime/issues)
454
+ - [JavaScript SDK](../javascript)