skiva-sdk 0.1.0__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.
- skiva_sdk-0.1.0/.github/workflows/python.yml +28 -0
- skiva_sdk-0.1.0/.github/workflows/release.yml +62 -0
- skiva_sdk-0.1.0/.gitignore +15 -0
- skiva_sdk-0.1.0/CHANGELOG.md +14 -0
- skiva_sdk-0.1.0/CHANGELOG.zh-CN.md +14 -0
- skiva_sdk-0.1.0/LICENSE +202 -0
- skiva_sdk-0.1.0/PKG-INFO +159 -0
- skiva_sdk-0.1.0/README.md +135 -0
- skiva_sdk-0.1.0/README.zh-CN.md +134 -0
- skiva_sdk-0.1.0/docs/TESTING.md +55 -0
- skiva_sdk-0.1.0/docs/TESTING.zh-CN.md +55 -0
- skiva_sdk-0.1.0/examples/offline_demo.py +70 -0
- skiva_sdk-0.1.0/examples/server_discovery.py +24 -0
- skiva_sdk-0.1.0/pyproject.toml +46 -0
- skiva_sdk-0.1.0/src/skiva_sdk/__init__.py +40 -0
- skiva_sdk-0.1.0/src/skiva_sdk/catalog.py +99 -0
- skiva_sdk-0.1.0/src/skiva_sdk/client.py +218 -0
- skiva_sdk-0.1.0/src/skiva_sdk/errors.py +48 -0
- skiva_sdk-0.1.0/src/skiva_sdk/integrations/__init__.py +0 -0
- skiva_sdk-0.1.0/src/skiva_sdk/integrations/pydantic_ai.py +114 -0
- skiva_sdk-0.1.0/src/skiva_sdk/protocol.py +149 -0
- skiva_sdk-0.1.0/src/skiva_sdk/py.typed +0 -0
- skiva_sdk-0.1.0/src/skiva_sdk/view.py +304 -0
- skiva_sdk-0.1.0/tests/cases/release-1/data-contract/SKILL.md +9 -0
- skiva_sdk-0.1.0/tests/cases/release-1/data-contract/assets/empty.txt +0 -0
- skiva_sdk-0.1.0/tests/cases/release-1/data-contract/assets/events.csv +2 -0
- skiva_sdk-0.1.0/tests/cases/release-1/data-contract/assets/sample.bin +0 -0
- skiva_sdk-0.1.0/tests/cases/release-1/data-contract/references/caf/303/251.md +2 -0
- skiva_sdk-0.1.0/tests/cases/release-1/data-contract/references/schema.json +1 -0
- skiva_sdk-0.1.0/tests/cases/release-1/expense-audit/SKILL.md +12 -0
- skiva_sdk-0.1.0/tests/cases/release-1/expense-audit/assets/receipts.json +1 -0
- skiva_sdk-0.1.0/tests/cases/release-1/expense-audit/references/currency.json +1 -0
- skiva_sdk-0.1.0/tests/cases/release-1/expense-audit/references/policy.json +1 -0
- skiva_sdk-0.1.0/tests/cases/release-1/expense-audit/references/regions//344/270/212/346/265/267.md +3 -0
- skiva_sdk-0.1.0/tests/cases/release-1/expense-audit/scripts/evaluate.py +11 -0
- skiva_sdk-0.1.0/tests/cases/release-1/expense-audit/templates/report.md +4 -0
- skiva_sdk-0.1.0/tests/cases/release-1/release-review/SKILL.md +8 -0
- skiva_sdk-0.1.0/tests/cases/release-1/release-review/references/checklist.json +1 -0
- skiva_sdk-0.1.0/tests/cases/release-1/release-review/references/rollout.md +2 -0
- skiva_sdk-0.1.0/tests/cases/release-1/release-review/references/security/threats.md +3 -0
- skiva_sdk-0.1.0/tests/cases/release-1/release-review/templates/decision.json +1 -0
- skiva_sdk-0.1.0/tests/cases/release-2/data-contract/SKILL.md +9 -0
- skiva_sdk-0.1.0/tests/cases/release-2/data-contract/assets/empty.txt +0 -0
- skiva_sdk-0.1.0/tests/cases/release-2/data-contract/assets/events.csv +2 -0
- skiva_sdk-0.1.0/tests/cases/release-2/data-contract/assets/sample.bin +0 -0
- skiva_sdk-0.1.0/tests/cases/release-2/data-contract/references/caf/303/251.md +2 -0
- skiva_sdk-0.1.0/tests/cases/release-2/data-contract/references/schema.json +1 -0
- skiva_sdk-0.1.0/tests/cases/release-2/expense-audit/SKILL.md +12 -0
- skiva_sdk-0.1.0/tests/cases/release-2/expense-audit/assets/receipts.json +1 -0
- skiva_sdk-0.1.0/tests/cases/release-2/expense-audit/references/currency.json +1 -0
- skiva_sdk-0.1.0/tests/cases/release-2/expense-audit/references/policy.json +1 -0
- skiva_sdk-0.1.0/tests/cases/release-2/expense-audit/references/regions//344/270/212/346/265/267.md +3 -0
- skiva_sdk-0.1.0/tests/cases/release-2/expense-audit/scripts/evaluate.py +11 -0
- skiva_sdk-0.1.0/tests/cases/release-2/expense-audit/templates/report.md +4 -0
- skiva_sdk-0.1.0/tests/cases/release-2/release-review/SKILL.md +8 -0
- skiva_sdk-0.1.0/tests/cases/release-2/release-review/references/checklist.json +1 -0
- skiva_sdk-0.1.0/tests/cases/release-2/release-review/references/rollout.md +2 -0
- skiva_sdk-0.1.0/tests/cases/release-2/release-review/references/security/threats.md +3 -0
- skiva_sdk-0.1.0/tests/cases/release-2/release-review/templates/decision.json +1 -0
- skiva_sdk-0.1.0/tests/conftest.py +74 -0
- skiva_sdk-0.1.0/tests/fixtures/generate.go +16 -0
- skiva_sdk-0.1.0/tests/fixtures/go-manifest.json +1 -0
- skiva_sdk-0.1.0/tests/scenarios.py +93 -0
- skiva_sdk-0.1.0/tests/test_adversarial.py +206 -0
- skiva_sdk-0.1.0/tests/test_agent_scenarios.py +224 -0
- skiva_sdk-0.1.0/tests/test_complex_cases.py +302 -0
- skiva_sdk-0.1.0/tests/test_http.py +45 -0
- skiva_sdk-0.1.0/tests/test_properties.py +33 -0
- skiva_sdk-0.1.0/tests/test_protocol_fixture.py +10 -0
- skiva_sdk-0.1.0/tests/test_pydantic_ai.py +105 -0
- skiva_sdk-0.1.0/tests/test_sdk.py +294 -0
- skiva_sdk-0.1.0/uv.lock +893 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
name: Python SDK
|
|
2
|
+
on: [push, pull_request, workflow_dispatch, workflow_call]
|
|
3
|
+
permissions:
|
|
4
|
+
contents: read
|
|
5
|
+
jobs:
|
|
6
|
+
test:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
timeout-minutes: 10
|
|
9
|
+
strategy:
|
|
10
|
+
fail-fast: false
|
|
11
|
+
matrix:
|
|
12
|
+
python: ['3.11', '3.12', '3.13']
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
- uses: actions/setup-python@v5
|
|
16
|
+
with:
|
|
17
|
+
python-version: ${{ matrix.python }}
|
|
18
|
+
- run: python -m pip install '.[dev,pydantic-ai]'
|
|
19
|
+
- run: ruff check src tests examples
|
|
20
|
+
- run: pytest -q --cov=skiva_sdk --cov-fail-under=90 --cov-report=term-missing --cov-report=xml:.test-results/coverage.xml --junitxml=.test-results/junit.xml
|
|
21
|
+
- run: python -m build
|
|
22
|
+
- run: python examples/offline_demo.py
|
|
23
|
+
- uses: actions/upload-artifact@v4
|
|
24
|
+
if: always()
|
|
25
|
+
with:
|
|
26
|
+
name: python-${{ matrix.python }}-test-results
|
|
27
|
+
path: .test-results/
|
|
28
|
+
include-hidden-files: true
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
name: Publish Python SDK
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
tags: ['v*']
|
|
5
|
+
workflow_dispatch:
|
|
6
|
+
permissions:
|
|
7
|
+
contents: read
|
|
8
|
+
concurrency:
|
|
9
|
+
group: pypi-${{ github.ref }}
|
|
10
|
+
cancel-in-progress: false
|
|
11
|
+
jobs:
|
|
12
|
+
test:
|
|
13
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
14
|
+
uses: ./.github/workflows/python.yml
|
|
15
|
+
build:
|
|
16
|
+
needs: test
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
timeout-minutes: 10
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v4
|
|
21
|
+
- uses: actions/setup-python@v5
|
|
22
|
+
with:
|
|
23
|
+
python-version: '3.12'
|
|
24
|
+
- name: Validate release version
|
|
25
|
+
run: |
|
|
26
|
+
python - <<'PY'
|
|
27
|
+
import os, tomllib
|
|
28
|
+
with open('pyproject.toml', 'rb') as f:
|
|
29
|
+
project = tomllib.load(f)['project']
|
|
30
|
+
assert project['name'] == 'skiva-sdk'
|
|
31
|
+
assert os.environ['GITHUB_REF_NAME'] == 'v' + project['version'], 'Tag must match package version'
|
|
32
|
+
PY
|
|
33
|
+
- run: python -m pip install build twine
|
|
34
|
+
- run: python -m build
|
|
35
|
+
- run: python -m twine check --strict dist/*
|
|
36
|
+
- name: Smoke test installed wheel
|
|
37
|
+
run: |
|
|
38
|
+
python -m venv /tmp/skiva-wheel
|
|
39
|
+
/tmp/skiva-wheel/bin/python -m pip install dist/*.whl
|
|
40
|
+
/tmp/skiva-wheel/bin/python -c "import os; from importlib.metadata import version; from skiva_sdk import SkivaClient; assert 'v' + version('skiva-sdk') == os.environ['GITHUB_REF_NAME']"
|
|
41
|
+
/tmp/skiva-wheel/bin/python examples/offline_demo.py
|
|
42
|
+
- uses: actions/upload-artifact@v4
|
|
43
|
+
with:
|
|
44
|
+
name: python-distributions
|
|
45
|
+
path: dist/
|
|
46
|
+
if-no-files-found: error
|
|
47
|
+
publish:
|
|
48
|
+
needs: build
|
|
49
|
+
runs-on: ubuntu-latest
|
|
50
|
+
timeout-minutes: 10
|
|
51
|
+
environment:
|
|
52
|
+
name: pypi
|
|
53
|
+
url: https://pypi.org/project/skiva-sdk/
|
|
54
|
+
permissions:
|
|
55
|
+
id-token: write
|
|
56
|
+
steps:
|
|
57
|
+
- uses: actions/download-artifact@v4
|
|
58
|
+
with:
|
|
59
|
+
name: python-distributions
|
|
60
|
+
path: dist/
|
|
61
|
+
- name: Publish to PyPI with Trusted Publishing
|
|
62
|
+
uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # release/v1
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
English · [简体中文](CHANGELOG.zh-CN.md)
|
|
4
|
+
|
|
5
|
+
## 0.1.0 — 2026-10-22
|
|
6
|
+
|
|
7
|
+
- Async distribution/v1 client with immutable manifests and SHA-256 verification.
|
|
8
|
+
- Pinned default and opt-in dynamic sessions with captured batch views.
|
|
9
|
+
- Versioned discovery, content envelopes and expected snapshot/catalog checks.
|
|
10
|
+
- Optional Pydantic AI 2.59.0 discovery instructions refreshed per model request.
|
|
11
|
+
- Online permission checks, bounded memory and temporary directory materialization.
|
|
12
|
+
- No durable task store, offline mode or automatic history cleanup.
|
|
13
|
+
- Expanded regression suite with three multi-file Skill cases in two versions, generated rollback sequences and multi-turn Agent scenarios.
|
|
14
|
+
- Fixed stale `last_refresh_error` after successful pinned refresh recovery.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# 更新记录
|
|
2
|
+
|
|
3
|
+
[English](CHANGELOG.md) · 简体中文
|
|
4
|
+
|
|
5
|
+
## 0.1.0 — 2026-10-22
|
|
6
|
+
|
|
7
|
+
- 异步 distribution/v1 客户端,不可变清单与 SHA-256 校验。
|
|
8
|
+
- 默认固定策略、可选动态会话及批次固定视图。
|
|
9
|
+
- 带版本的发现列表、内容包裹和预期快照/目录校验。
|
|
10
|
+
- 可选 Pydantic AI 2.59.0 集成,每次模型请求刷新发现指令。
|
|
11
|
+
- 在线权限检查、有上限的内存缓存和临时目录导出。
|
|
12
|
+
- 不包含持久化任务存储、离线模式或自动历史清理。
|
|
13
|
+
- 增加三组多文件双版本 Skill、自动生成回滚序列及多轮 Agent 场景测试。
|
|
14
|
+
- 修复固定模式刷新恢复成功后仍残留 `last_refresh_error` 的问题。
|
skiva_sdk-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
skiva_sdk-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: skiva-sdk
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Version-aware Skill discovery and delivery for Skiva
|
|
5
|
+
Project-URL: Documentation, https://linghechen.github.io/skiva/docs/sdk-python/
|
|
6
|
+
Project-URL: Repository, https://github.com/LingHeChen/skiva-python
|
|
7
|
+
Project-URL: Issues, https://github.com/LingHeChen/skiva-python/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/LingHeChen/skiva-python/blob/main/CHANGELOG.md
|
|
9
|
+
License-Expression: Apache-2.0
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Requires-Python: >=3.11
|
|
12
|
+
Requires-Dist: httpx<1,>=0.27
|
|
13
|
+
Requires-Dist: pyyaml<7,>=6
|
|
14
|
+
Provides-Extra: dev
|
|
15
|
+
Requires-Dist: build>=1.2; extra == 'dev'
|
|
16
|
+
Requires-Dist: hypothesis>=6; extra == 'dev'
|
|
17
|
+
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
|
|
18
|
+
Requires-Dist: pytest-cov>=6; extra == 'dev'
|
|
19
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
20
|
+
Requires-Dist: ruff>=0.11; extra == 'dev'
|
|
21
|
+
Provides-Extra: pydantic-ai
|
|
22
|
+
Requires-Dist: pydantic-ai-slim==2.59.0; extra == 'pydantic-ai'
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
|
|
25
|
+
# Skiva Python SDK
|
|
26
|
+
|
|
27
|
+
English · [简体中文](https://github.com/LingHeChen/skiva-python/blob/main/README.zh-CN.md)
|
|
28
|
+
|
|
29
|
+
Async Python SDK for Skiva's `/distribution/v1` protocol. Python 3.11+. Package name: `skiva-sdk`; import: `skiva_sdk`. Version: 0.1.0.
|
|
30
|
+
|
|
31
|
+
[GitHub repository](https://github.com/LingHeChen/skiva-python) · [Skiva server](https://github.com/LingHeChen/skiva)
|
|
32
|
+
|
|
33
|
+
## Install
|
|
34
|
+
|
|
35
|
+
Install from PyPI:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
python -m pip install skiva-sdk==0.1.0
|
|
39
|
+
# Optional framework adapter, tested against exactly Pydantic AI 2.59.0:
|
|
40
|
+
python -m pip install 'skiva-sdk[pydantic-ai]==0.1.0'
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Use a **client credential assigned to an enabled Agent Profile**, not an admin/API session token. Use the server origin (or reverse-proxy prefix), without `/distribution/v1`. Use HTTPS outside a trusted local environment.
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
export SKIVA_SERVER_URL=http://localhost:8080
|
|
47
|
+
export SKIVA_CLIENT_TOKEN=your-client-credential
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The profile must have a published snapshot and authorized Skills. SDK dynamic mode respects server-side profile pins; it does not bypass them.
|
|
51
|
+
|
|
52
|
+
## Discovery and loading
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
import asyncio
|
|
56
|
+
from skiva_sdk import SkivaClient
|
|
57
|
+
|
|
58
|
+
async def main():
|
|
59
|
+
async with SkivaClient.from_env() as client:
|
|
60
|
+
async with client.bind(task_id="review-42") as skills:
|
|
61
|
+
catalog = await skills.catalog()
|
|
62
|
+
print(catalog.render())
|
|
63
|
+
if catalog.skills:
|
|
64
|
+
content = await skills.load_skill(
|
|
65
|
+
catalog.skills[0].name,
|
|
66
|
+
expected_snapshot_id=catalog.ref.snapshot_id,
|
|
67
|
+
expected_catalog_digest=catalog.catalog_digest,
|
|
68
|
+
)
|
|
69
|
+
print(content.render())
|
|
70
|
+
|
|
71
|
+
asyncio.run(main())
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
`Catalog` contains a `SnapshotRef`, immutable Skill metadata and `catalog_digest`. `SkillContent` contains the actual ref, catalog digest, manifest-relative path, file digest and text. Rendered envelopes escape XML markup. Names/descriptions still originate from published Skills: treat publishers as a trust boundary, not as trusted system-policy authors simply because text is escaped.
|
|
75
|
+
|
|
76
|
+
The discovery prompt tells the model to compare snapshot IDs for equality, not chronological order, and to reload content whose version differs. Rollback is handled the same way as forward updates. `catalog_digest` also changes when the authorized file set changes within one snapshot. This is a model-facing fallback, **not a guarantee that old instructions are forgotten**.
|
|
77
|
+
|
|
78
|
+
## Fixed and dynamic policies
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
async with client.bind(consistency="dynamic") as skills:
|
|
82
|
+
await skills.refresh() # explicit reconciliation; raises on failure
|
|
83
|
+
async with skills.snapshot() as batch:
|
|
84
|
+
body = await batch.read_text("review/SKILL.md")
|
|
85
|
+
rules = await batch.read_text("review/references/rules.md")
|
|
86
|
+
original_ref = batch.ref
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
- Default `pinned`: one snapshot and filtered manifest for the binding. Future channel changes do not change it.
|
|
90
|
+
- Opt-in `dynamic`: reads/discovery reconcile on access after `refresh_interval` (default 5 seconds). `refresh()` forces reconciliation. No background daemon or SSE subscription.
|
|
91
|
+
- An expected-version load forces dynamic reconciliation even before the interval expires. Snapshot or catalog mismatch raises `VersionMismatch`; no silent substitution.
|
|
92
|
+
- A fully verified candidate replaces the active view atomically. Each operation captures one view; different operations can span versions. `snapshot()` captures one view for related operations, even while the enclosing dynamic session updates.
|
|
93
|
+
- Refresh failure aborts that operation and populates `last_refresh_error`; it never silently reports stale discovery as fresh. Later successful refresh clears the error. `transition_count` counts successful view changes.
|
|
94
|
+
- The client default can be overridden per binding. An explicit `source=SnapshotRef` requires pinned mode. Reuse a ref for an explicit retry, subject to current server grants/permissions.
|
|
95
|
+
- `view.ref` in dynamic mode is a point-in-time observation. Use returned `SkillContent.ref` or `batch.ref` for provenance.
|
|
96
|
+
|
|
97
|
+
Task/attempt IDs are optional correlation fields and auto-generated if absent. Duplicate active IDs are rejected **within one client**. There is no durable attempt store, crash resume or cross-process exactly-once guarantee in v0.1. Persist refs in your application's own storage for explicit pinned retries. A ref does not grant access and cannot bypass a new credential's permissions.
|
|
98
|
+
|
|
99
|
+
## Pydantic AI integration
|
|
100
|
+
|
|
101
|
+
```python
|
|
102
|
+
from pydantic_ai import Agent
|
|
103
|
+
from pydantic_ai.capabilities import Caching
|
|
104
|
+
from skiva_sdk import SkillSession
|
|
105
|
+
from skiva_sdk.integrations.pydantic_ai import SkivaSkills
|
|
106
|
+
|
|
107
|
+
agent = Agent(
|
|
108
|
+
model, # Supply your configured Pydantic AI model/provider.
|
|
109
|
+
name="skiva-agent",
|
|
110
|
+
deps_type=SkillSession,
|
|
111
|
+
capabilities=[Caching(), SkivaSkills()],
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
async with agent:
|
|
115
|
+
async with client.bind(consistency="dynamic") as skills:
|
|
116
|
+
result = await agent.run("Review this change", deps=skills)
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
`SkivaSkills` provides a named, dynamic discovery instruction part with **rewrite** semantics, evaluated before **every model request**. It explicitly refreshes the session at each request, bypassing the normal polling interval. It also registers `load_skill` and `read_skill_file`, requiring both expected version fields. Version mismatch/not-found become structured tool results; authorization/network failures abort rather than encourage stale fallback. It does not rewrite historical tool returns or erase derived conclusions. Provider wire placement of instructions depends on Pydantic AI and the provider.
|
|
120
|
+
|
|
121
|
+
Keep business dependencies with `SkivaSkills(get_session=lambda deps: deps.skills)`. Each run must receive its own session; the capability has no mutable run state. Attach one SkivaSkills capability per Agent (tool names are fixed). This is a dedicated discovery/tool integration, **not** a replacement for the native Harness `Skills` workspace backend. Shell/direct filesystem access is not intercepted. Configure application tracing in the host application; the SDK exports no prompts/tokens to an external telemetry service.
|
|
122
|
+
|
|
123
|
+
An active binding owns both discovery and reads. A pinned binding intentionally advertises its pinned catalog; select dynamic to follow updates within a run. Instructions are not modified while a model request is in flight. Header changes can affect prompt caching.
|
|
124
|
+
|
|
125
|
+
## Real files when necessary
|
|
126
|
+
|
|
127
|
+
```python
|
|
128
|
+
async with skills.snapshot() as batch:
|
|
129
|
+
async with batch.materialize() as directory:
|
|
130
|
+
# Give this path to a framework or awaited subprocess.
|
|
131
|
+
# The child process must finish before leaving this block.
|
|
132
|
+
print(directory)
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
This exports a complete private copy into a temporary directory, preserving read/execute modes. It does not create a FUSE mount or writable hardlinks to shared objects. It rejects paths incompatible with supported platforms, including case-folding collisions. Cleanup occurs on exit. File modes are not sandbox isolation against the owning process. **Direct reads of exported files bypass SDK authorization; revocation cannot recall exported bytes.** New snapshots require new exports, never rewriting an old directory.
|
|
136
|
+
|
|
137
|
+
## Validation, authorization and limits
|
|
138
|
+
|
|
139
|
+
Every snapshot is fully downloaded and validated before publication: Go-compatible manifest canonicalization, SHA-256, sizes, paths and modes. Cache is in memory and private to each view/client; no shared disk/offline cache. Default limits: 10,000 files, 8 MiB per file/manifest, 64 MiB per snapshot, 256 KiB per SKILL.md parsing input. Concurrent/retained views multiply memory use; applications should limit concurrency and release references.
|
|
140
|
+
|
|
141
|
+
Every public read/catalog/export rechecks the explicit snapshot manifest online, even for cached bytes. Changed permissions invalidate a captured view; explicit credential revocation is sticky for that client instance. Network failure blocks the operation. No offline mode, transparent network retries, or model-task retries. An authorization race after the final check and previously delivered content cannot be undone. HTTP redirects are not followed; bearer tokens are not included in SDK error messages. Raw transport instrumentation can still expose credentials; configure logging accordingly. Environment proxy/CA settings are ignored by default (`trust_env=False`); opt in explicitly with `trust_env=True` if needed, and install `httpx[socks]` for SOCKS proxies. A custom HTTPX transport can supply application TLS/proxy settings.
|
|
142
|
+
|
|
143
|
+
Useful errors: `VersionMismatch`, `ManifestChanged`, `AuthorizationDenied`, `IntegrityError`, `ProtocolError`, `LimitExceeded`, `SkillNotFound`, `TransportError`, `ClosedError`.
|
|
144
|
+
|
|
145
|
+
## Development and verification
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
uv sync --extra dev --extra pydantic-ai
|
|
149
|
+
uv run pytest -q
|
|
150
|
+
uv run ruff check src tests examples
|
|
151
|
+
uv run python -m build
|
|
152
|
+
uv run python examples/offline_demo.py
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Tests use a controlled distribution fixture and Pydantic's actual `FunctionModel` agent loop, without external model calls. They cover updates/rollback, same-snapshot permission changes, concurrent reads/runs, old-content provenance, corruption, export isolation, and Go-generated manifest fixtures. The offline demo requires no server or credentials. It is not a substitute for deployment acceptance against your Skiva server and selected model provider.
|
|
156
|
+
|
|
157
|
+
See [examples/](https://github.com/LingHeChen/skiva-python/tree/main/examples/) and [CHANGELOG.md](https://github.com/LingHeChen/skiva-python/blob/main/CHANGELOG.md). Official integration references: [Pydantic capabilities](https://pydantic.dev/docs/ai/capabilities/custom/), [Agent Skills implementation guide](https://agentskills.io/client-implementation/adding-skills-support).
|
|
158
|
+
|
|
159
|
+
Detailed scenarios and recorded results: [Testing guide](https://github.com/LingHeChen/skiva-python/blob/main/docs/TESTING.md).
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# Skiva Python SDK
|
|
2
|
+
|
|
3
|
+
English · [简体中文](https://github.com/LingHeChen/skiva-python/blob/main/README.zh-CN.md)
|
|
4
|
+
|
|
5
|
+
Async Python SDK for Skiva's `/distribution/v1` protocol. Python 3.11+. Package name: `skiva-sdk`; import: `skiva_sdk`. Version: 0.1.0.
|
|
6
|
+
|
|
7
|
+
[GitHub repository](https://github.com/LingHeChen/skiva-python) · [Skiva server](https://github.com/LingHeChen/skiva)
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
Install from PyPI:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
python -m pip install skiva-sdk==0.1.0
|
|
15
|
+
# Optional framework adapter, tested against exactly Pydantic AI 2.59.0:
|
|
16
|
+
python -m pip install 'skiva-sdk[pydantic-ai]==0.1.0'
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Use a **client credential assigned to an enabled Agent Profile**, not an admin/API session token. Use the server origin (or reverse-proxy prefix), without `/distribution/v1`. Use HTTPS outside a trusted local environment.
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
export SKIVA_SERVER_URL=http://localhost:8080
|
|
23
|
+
export SKIVA_CLIENT_TOKEN=your-client-credential
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The profile must have a published snapshot and authorized Skills. SDK dynamic mode respects server-side profile pins; it does not bypass them.
|
|
27
|
+
|
|
28
|
+
## Discovery and loading
|
|
29
|
+
|
|
30
|
+
```python
|
|
31
|
+
import asyncio
|
|
32
|
+
from skiva_sdk import SkivaClient
|
|
33
|
+
|
|
34
|
+
async def main():
|
|
35
|
+
async with SkivaClient.from_env() as client:
|
|
36
|
+
async with client.bind(task_id="review-42") as skills:
|
|
37
|
+
catalog = await skills.catalog()
|
|
38
|
+
print(catalog.render())
|
|
39
|
+
if catalog.skills:
|
|
40
|
+
content = await skills.load_skill(
|
|
41
|
+
catalog.skills[0].name,
|
|
42
|
+
expected_snapshot_id=catalog.ref.snapshot_id,
|
|
43
|
+
expected_catalog_digest=catalog.catalog_digest,
|
|
44
|
+
)
|
|
45
|
+
print(content.render())
|
|
46
|
+
|
|
47
|
+
asyncio.run(main())
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
`Catalog` contains a `SnapshotRef`, immutable Skill metadata and `catalog_digest`. `SkillContent` contains the actual ref, catalog digest, manifest-relative path, file digest and text. Rendered envelopes escape XML markup. Names/descriptions still originate from published Skills: treat publishers as a trust boundary, not as trusted system-policy authors simply because text is escaped.
|
|
51
|
+
|
|
52
|
+
The discovery prompt tells the model to compare snapshot IDs for equality, not chronological order, and to reload content whose version differs. Rollback is handled the same way as forward updates. `catalog_digest` also changes when the authorized file set changes within one snapshot. This is a model-facing fallback, **not a guarantee that old instructions are forgotten**.
|
|
53
|
+
|
|
54
|
+
## Fixed and dynamic policies
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
async with client.bind(consistency="dynamic") as skills:
|
|
58
|
+
await skills.refresh() # explicit reconciliation; raises on failure
|
|
59
|
+
async with skills.snapshot() as batch:
|
|
60
|
+
body = await batch.read_text("review/SKILL.md")
|
|
61
|
+
rules = await batch.read_text("review/references/rules.md")
|
|
62
|
+
original_ref = batch.ref
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
- Default `pinned`: one snapshot and filtered manifest for the binding. Future channel changes do not change it.
|
|
66
|
+
- Opt-in `dynamic`: reads/discovery reconcile on access after `refresh_interval` (default 5 seconds). `refresh()` forces reconciliation. No background daemon or SSE subscription.
|
|
67
|
+
- An expected-version load forces dynamic reconciliation even before the interval expires. Snapshot or catalog mismatch raises `VersionMismatch`; no silent substitution.
|
|
68
|
+
- A fully verified candidate replaces the active view atomically. Each operation captures one view; different operations can span versions. `snapshot()` captures one view for related operations, even while the enclosing dynamic session updates.
|
|
69
|
+
- Refresh failure aborts that operation and populates `last_refresh_error`; it never silently reports stale discovery as fresh. Later successful refresh clears the error. `transition_count` counts successful view changes.
|
|
70
|
+
- The client default can be overridden per binding. An explicit `source=SnapshotRef` requires pinned mode. Reuse a ref for an explicit retry, subject to current server grants/permissions.
|
|
71
|
+
- `view.ref` in dynamic mode is a point-in-time observation. Use returned `SkillContent.ref` or `batch.ref` for provenance.
|
|
72
|
+
|
|
73
|
+
Task/attempt IDs are optional correlation fields and auto-generated if absent. Duplicate active IDs are rejected **within one client**. There is no durable attempt store, crash resume or cross-process exactly-once guarantee in v0.1. Persist refs in your application's own storage for explicit pinned retries. A ref does not grant access and cannot bypass a new credential's permissions.
|
|
74
|
+
|
|
75
|
+
## Pydantic AI integration
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
from pydantic_ai import Agent
|
|
79
|
+
from pydantic_ai.capabilities import Caching
|
|
80
|
+
from skiva_sdk import SkillSession
|
|
81
|
+
from skiva_sdk.integrations.pydantic_ai import SkivaSkills
|
|
82
|
+
|
|
83
|
+
agent = Agent(
|
|
84
|
+
model, # Supply your configured Pydantic AI model/provider.
|
|
85
|
+
name="skiva-agent",
|
|
86
|
+
deps_type=SkillSession,
|
|
87
|
+
capabilities=[Caching(), SkivaSkills()],
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
async with agent:
|
|
91
|
+
async with client.bind(consistency="dynamic") as skills:
|
|
92
|
+
result = await agent.run("Review this change", deps=skills)
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
`SkivaSkills` provides a named, dynamic discovery instruction part with **rewrite** semantics, evaluated before **every model request**. It explicitly refreshes the session at each request, bypassing the normal polling interval. It also registers `load_skill` and `read_skill_file`, requiring both expected version fields. Version mismatch/not-found become structured tool results; authorization/network failures abort rather than encourage stale fallback. It does not rewrite historical tool returns or erase derived conclusions. Provider wire placement of instructions depends on Pydantic AI and the provider.
|
|
96
|
+
|
|
97
|
+
Keep business dependencies with `SkivaSkills(get_session=lambda deps: deps.skills)`. Each run must receive its own session; the capability has no mutable run state. Attach one SkivaSkills capability per Agent (tool names are fixed). This is a dedicated discovery/tool integration, **not** a replacement for the native Harness `Skills` workspace backend. Shell/direct filesystem access is not intercepted. Configure application tracing in the host application; the SDK exports no prompts/tokens to an external telemetry service.
|
|
98
|
+
|
|
99
|
+
An active binding owns both discovery and reads. A pinned binding intentionally advertises its pinned catalog; select dynamic to follow updates within a run. Instructions are not modified while a model request is in flight. Header changes can affect prompt caching.
|
|
100
|
+
|
|
101
|
+
## Real files when necessary
|
|
102
|
+
|
|
103
|
+
```python
|
|
104
|
+
async with skills.snapshot() as batch:
|
|
105
|
+
async with batch.materialize() as directory:
|
|
106
|
+
# Give this path to a framework or awaited subprocess.
|
|
107
|
+
# The child process must finish before leaving this block.
|
|
108
|
+
print(directory)
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
This exports a complete private copy into a temporary directory, preserving read/execute modes. It does not create a FUSE mount or writable hardlinks to shared objects. It rejects paths incompatible with supported platforms, including case-folding collisions. Cleanup occurs on exit. File modes are not sandbox isolation against the owning process. **Direct reads of exported files bypass SDK authorization; revocation cannot recall exported bytes.** New snapshots require new exports, never rewriting an old directory.
|
|
112
|
+
|
|
113
|
+
## Validation, authorization and limits
|
|
114
|
+
|
|
115
|
+
Every snapshot is fully downloaded and validated before publication: Go-compatible manifest canonicalization, SHA-256, sizes, paths and modes. Cache is in memory and private to each view/client; no shared disk/offline cache. Default limits: 10,000 files, 8 MiB per file/manifest, 64 MiB per snapshot, 256 KiB per SKILL.md parsing input. Concurrent/retained views multiply memory use; applications should limit concurrency and release references.
|
|
116
|
+
|
|
117
|
+
Every public read/catalog/export rechecks the explicit snapshot manifest online, even for cached bytes. Changed permissions invalidate a captured view; explicit credential revocation is sticky for that client instance. Network failure blocks the operation. No offline mode, transparent network retries, or model-task retries. An authorization race after the final check and previously delivered content cannot be undone. HTTP redirects are not followed; bearer tokens are not included in SDK error messages. Raw transport instrumentation can still expose credentials; configure logging accordingly. Environment proxy/CA settings are ignored by default (`trust_env=False`); opt in explicitly with `trust_env=True` if needed, and install `httpx[socks]` for SOCKS proxies. A custom HTTPX transport can supply application TLS/proxy settings.
|
|
118
|
+
|
|
119
|
+
Useful errors: `VersionMismatch`, `ManifestChanged`, `AuthorizationDenied`, `IntegrityError`, `ProtocolError`, `LimitExceeded`, `SkillNotFound`, `TransportError`, `ClosedError`.
|
|
120
|
+
|
|
121
|
+
## Development and verification
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
uv sync --extra dev --extra pydantic-ai
|
|
125
|
+
uv run pytest -q
|
|
126
|
+
uv run ruff check src tests examples
|
|
127
|
+
uv run python -m build
|
|
128
|
+
uv run python examples/offline_demo.py
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Tests use a controlled distribution fixture and Pydantic's actual `FunctionModel` agent loop, without external model calls. They cover updates/rollback, same-snapshot permission changes, concurrent reads/runs, old-content provenance, corruption, export isolation, and Go-generated manifest fixtures. The offline demo requires no server or credentials. It is not a substitute for deployment acceptance against your Skiva server and selected model provider.
|
|
132
|
+
|
|
133
|
+
See [examples/](https://github.com/LingHeChen/skiva-python/tree/main/examples/) and [CHANGELOG.md](https://github.com/LingHeChen/skiva-python/blob/main/CHANGELOG.md). Official integration references: [Pydantic capabilities](https://pydantic.dev/docs/ai/capabilities/custom/), [Agent Skills implementation guide](https://agentskills.io/client-implementation/adding-skills-support).
|
|
134
|
+
|
|
135
|
+
Detailed scenarios and recorded results: [Testing guide](https://github.com/LingHeChen/skiva-python/blob/main/docs/TESTING.md).
|