webarchiver 1.2.2__tar.gz → 1.2.4__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.
- {webarchiver-1.2.2 → webarchiver-1.2.4}/.bumpversion.cfg +1 -5
- webarchiver-1.2.4/.github/workflows/connector.yml +94 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/.pre-commit-config.yaml +3 -3
- {webarchiver-1.2.2 → webarchiver-1.2.4}/MANIFEST.in +0 -1
- {webarchiver-1.2.2/webarchiver.egg-info → webarchiver-1.2.4}/PKG-INFO +6 -6
- {webarchiver-1.2.2 → webarchiver-1.2.4}/README.md +1 -1
- {webarchiver-1.2.2 → webarchiver-1.2.4}/docker/Dockerfile +1 -1
- {webarchiver-1.2.2 → webarchiver-1.2.4}/docs/architecture.md +1 -1
- {webarchiver-1.2.2 → webarchiver-1.2.4}/docs/installation.md +1 -1
- {webarchiver-1.2.2 → webarchiver-1.2.4}/docs/overview.md +1 -1
- {webarchiver-1.2.2 → webarchiver-1.2.4}/mkdocs.yml +0 -1
- {webarchiver-1.2.2 → webarchiver-1.2.4}/pyproject.toml +7 -6
- {webarchiver-1.2.2 → webarchiver-1.2.4}/scripts/bootstrap_environment.py +1 -1
- {webarchiver-1.2.2 → webarchiver-1.2.4}/scripts/bootstrap_sources.py +1 -1
- {webarchiver-1.2.2 → webarchiver-1.2.4}/scripts/check_connector_contract.py +4 -6
- {webarchiver-1.2.2 → webarchiver-1.2.4}/specs/README.md +1 -1
- {webarchiver-1.2.2 → webarchiver-1.2.4}/specs/web-source/plan.md +2 -2
- {webarchiver-1.2.2 → webarchiver-1.2.4}/specs/web-source/requirements.md +7 -6
- {webarchiver-1.2.2 → webarchiver-1.2.4}/specs/web-source/spec.md +3 -3
- {webarchiver-1.2.2 → webarchiver-1.2.4}/tests/test_conformance.py +2 -2
- {webarchiver-1.2.2 → webarchiver-1.2.4}/tests/test_extract.py +1 -1
- {webarchiver-1.2.2 → webarchiver-1.2.4}/tests/test_startup.py +3 -3
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver/api/fetcher.py +4 -4
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver/api/request_filter.py +1 -1
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver/api/web_source.py +2 -2
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver/auth.py +1 -1
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver/connector_sources.py +0 -22
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver/error_authority.py +1 -1
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver/kg_ingest.py +1 -1
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver/mcp_server.py +10 -8
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver/ontology/__init__.py +1 -1
- {webarchiver-1.2.2 → webarchiver-1.2.4/webarchiver.egg-info}/PKG-INFO +6 -6
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver.egg-info/SOURCES.txt +2 -23
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver.egg-info/entry_points.txt +3 -3
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver.egg-info/requires.txt +3 -3
- webarchiver-1.2.2/.github/workflows/connector-pr.yml +0 -17
- webarchiver-1.2.2/.github/workflows/pages.yml +0 -25
- webarchiver-1.2.2/.github/workflows/pipeline.yml +0 -27
- webarchiver-1.2.2/.github/workflows/scanners.yml +0 -42
- webarchiver-1.2.2/.pipeline-theme/provenance.json +0 -21
- webarchiver-1.2.2/.pipeline-theme/scripts/sync_mkdocs_theme.py +0 -189
- webarchiver-1.2.2/.pipeline-theme/templates/mkdocs-theme/README.md +0 -29
- webarchiver-1.2.2/.pipeline-theme/templates/mkdocs-theme/base.mkdocs.yml +0 -116
- webarchiver-1.2.2/.pipeline-theme/templates/mkdocs-theme/overrides/main.html +0 -64
- webarchiver-1.2.2/docs/assets/brands/agent-connector-sdk-logo-v1.png +0 -0
- webarchiver-1.2.2/docs/assets/brands/agent-terminal-ui-logo-v1.png +0 -0
- webarchiver-1.2.2/docs/assets/brands/agent-utilities-logo-v1.png +0 -0
- webarchiver-1.2.2/docs/assets/brands/agent-webui-logo-v1.png +0 -0
- webarchiver-1.2.2/docs/assets/brands/arbora-logo-v1.png +0 -0
- webarchiver-1.2.2/docs/assets/brands/epistemic-graph-logo-v1.png +0 -0
- webarchiver-1.2.2/docs/assets/brands/geniusbot-logo-v1.png +0 -0
- webarchiver-1.2.2/docs/assets/favicon.svg +0 -13
- webarchiver-1.2.2/docs/assets/graph-mark.svg +0 -13
- webarchiver-1.2.2/docs/glossary.md +0 -57
- webarchiver-1.2.2/docs/stylesheets/extra.css +0 -249
- webarchiver-1.2.2/specs/web-source/status.json +0 -156
- webarchiver-1.2.2/webarchiver/_version.py +0 -3
- {webarchiver-1.2.2 → webarchiver-1.2.4}/.config/spec-dashboard.json +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/.github/workflows/windows-ci.yml +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/LICENSE +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/docker/debug.Dockerfile +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/docker/mcp.compose.yml +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/docker/starship.toml +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/docs/agent-readiness.json +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/docs/agent-readiness.schema.json +0 -0
- {webarchiver-1.2.2/.pipeline-theme/templates/mkdocs-theme → webarchiver-1.2.4/docs}/assets/brands/agent-terminal-ui-logo-v1.png +0 -0
- {webarchiver-1.2.2/.pipeline-theme/templates/mkdocs-theme → webarchiver-1.2.4/docs}/assets/brands/agent-utilities-logo-v1.png +0 -0
- {webarchiver-1.2.2/.pipeline-theme/templates/mkdocs-theme → webarchiver-1.2.4/docs}/assets/brands/agent-webui-logo-v1.png +0 -0
- {webarchiver-1.2.2/.pipeline-theme/templates/mkdocs-theme → webarchiver-1.2.4/docs}/assets/brands/arbora-logo-v1.png +0 -0
- {webarchiver-1.2.2/.pipeline-theme/templates/mkdocs-theme → webarchiver-1.2.4/docs}/assets/brands/epistemic-graph-logo-v1.png +0 -0
- {webarchiver-1.2.2/.pipeline-theme/templates/mkdocs-theme → webarchiver-1.2.4/docs}/assets/brands/geniusbot-logo-v1.png +0 -0
- /webarchiver-1.2.2/.pipeline-theme/templates/mkdocs-theme/assets/brands/agent-connector-sdk-logo-v1.png → /webarchiver-1.2.4/docs/assets/brands/scion-sdk-logo-v1.png +0 -0
- {webarchiver-1.2.2/.pipeline-theme/templates/mkdocs-theme → webarchiver-1.2.4/docs}/assets/favicon.svg +0 -0
- {webarchiver-1.2.2/.pipeline-theme/templates/mkdocs-theme → webarchiver-1.2.4/docs}/assets/graph-mark.svg +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/docs/capabilities/api.json +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/docs/capabilities/mcp.json +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/docs/concepts.md +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/docs/deployment.md +0 -0
- {webarchiver-1.2.2/.pipeline-theme/templates/mkdocs-theme → webarchiver-1.2.4/docs}/glossary.md +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/docs/index.md +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/docs/platform.md +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/docs/spec-delivery.md +0 -0
- {webarchiver-1.2.2/.pipeline-theme/templates/mkdocs-theme → webarchiver-1.2.4/docs/stylesheets}/extra.css +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/docs/usage.md +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/pytest.ini +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/scripts/agent_readiness_tck.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/scripts/bootstrap.sh +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/scripts/check_import_safety.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/scripts/check_workspace_source_drift.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/scripts/generate_agent_readiness.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/scripts/security_sanitizer.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/scripts/select_python.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/scripts/verify_api_integration.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/scripts/workspace_sources.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/setup.cfg +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/specs/web-source/tasks.md +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/specs/web-source/test-spec.md +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/tests/__init__.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/tests/conftest.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/tests/fixtures/article.html +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/tests/test_concept_parity.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/tests/test_crawl.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/tests/test_error_authority.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/tests/test_init_dynamics.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/tests/test_kg_ingest.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/tests/test_served.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/tests/test_webarchiver_mcp_validation.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver/__init__.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver/__main__.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver/api/__init__.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver/api/_support.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver/api/api_client_system.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver/api/browser.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver/api/crawl.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver/api/extraction.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver/api/policy.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver/connectors/__init__.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver/error_rendering.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver/mcp/__init__.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver/mcp/mcp_system.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver/mcp_config.json +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver/ontology/pack.ttl +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver/ontology/webarchiver.ttl +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver/prompts/__init__.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver/prompts/webarchiver_specialist.json +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver/skills/__init__.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver/skills/webarchiver-starter/SKILL.md +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver/webarchiver_input_models.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver/webarchiver_response_models.py +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver.egg-info/dependency_links.txt +0 -0
- {webarchiver-1.2.2 → webarchiver-1.2.4}/webarchiver.egg-info/top_level.txt +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[bumpversion]
|
|
2
|
-
current_version = 1.2.
|
|
2
|
+
current_version = 1.2.4
|
|
3
3
|
commit = True
|
|
4
4
|
tag = True
|
|
5
5
|
|
|
@@ -7,10 +7,6 @@ tag = True
|
|
|
7
7
|
search = version = "{current_version}"
|
|
8
8
|
replace = version = "{new_version}"
|
|
9
9
|
|
|
10
|
-
[bumpversion:file:webarchiver/_version.py]
|
|
11
|
-
search = __version__ = "{current_version}"
|
|
12
|
-
replace = __version__ = "{new_version}"
|
|
13
|
-
|
|
14
10
|
[bumpversion:file(dockerpin):docker/Dockerfile]
|
|
15
11
|
search = webarchiver[mcp]=={current_version}
|
|
16
12
|
replace = webarchiver[mcp]=={new_version}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
name: Connector
|
|
2
|
+
|
|
3
|
+
# Copy to .github/workflows/connector.yml (reference/ci-standard.md, "Connector pipeline").
|
|
4
|
+
# The ONE caller a connector carries; every pipeline change is made in pipelines'
|
|
5
|
+
# connector_pipeline.yml. Routing by event:
|
|
6
|
+
# pull_request gates, affected tests, image check
|
|
7
|
+
# push to main org-site notify + main checks; never publishes
|
|
8
|
+
# push of a v* tag PyPI, then Docker, and GitHub Pages
|
|
9
|
+
# schedule, repository_dispatch, workflow_dispatch SDK rebuild
|
|
10
|
+
# Releases are cut by the owner with gh: scripts/release_connector.sh in pipelines (the owner's tag push publishes).
|
|
11
|
+
# Per-connector differences are `with:` inputs of the job below (all defaulted).
|
|
12
|
+
# The GitHub Pages environment needs a `v*` tag deployment policy.
|
|
13
|
+
|
|
14
|
+
on:
|
|
15
|
+
pull_request:
|
|
16
|
+
branches: [main]
|
|
17
|
+
push:
|
|
18
|
+
branches: [main]
|
|
19
|
+
tags: ['v*']
|
|
20
|
+
schedule:
|
|
21
|
+
- cron: '17 5 * * *'
|
|
22
|
+
repository_dispatch:
|
|
23
|
+
types: [sdk-release]
|
|
24
|
+
workflow_dispatch:
|
|
25
|
+
inputs:
|
|
26
|
+
release_repair:
|
|
27
|
+
description: Republish the already published container after the reviewed public-wheel guard.
|
|
28
|
+
required: false
|
|
29
|
+
default: false
|
|
30
|
+
type: boolean
|
|
31
|
+
release_source_sha:
|
|
32
|
+
description: Full SHA of the original package source that produced the public wheel.
|
|
33
|
+
required: false
|
|
34
|
+
default: ''
|
|
35
|
+
type: string
|
|
36
|
+
release_source_epoch:
|
|
37
|
+
description: Exact SOURCE_DATE_EPOCH used to generate the public connector payload.
|
|
38
|
+
required: false
|
|
39
|
+
default: ''
|
|
40
|
+
type: string
|
|
41
|
+
legacy_profile:
|
|
42
|
+
description: Preserve the reviewed tracked wheel-only package tree without renderer generation.
|
|
43
|
+
required: false
|
|
44
|
+
default: false
|
|
45
|
+
type: boolean
|
|
46
|
+
|
|
47
|
+
# Pull requests cancel superseded runs; every other event queues per event and ref and never cancels.
|
|
48
|
+
concurrency:
|
|
49
|
+
group: ${{ github.event_name == 'pull_request' && format('pr-{0}-{1}', github.workflow, github.event.pull_request.number) || format('connector-{0}-{1}', github.event_name, github.ref) }}
|
|
50
|
+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
51
|
+
|
|
52
|
+
permissions: {}
|
|
53
|
+
|
|
54
|
+
jobs:
|
|
55
|
+
pipeline:
|
|
56
|
+
permissions:
|
|
57
|
+
contents: write
|
|
58
|
+
pages: write
|
|
59
|
+
id-token: write
|
|
60
|
+
uses: Knuckles-Team/pipelines/.github/workflows/connector_pipeline.yml@main
|
|
61
|
+
with:
|
|
62
|
+
release_repair: ${{ inputs.release_repair || false }}
|
|
63
|
+
release_source_sha: ${{ inputs.release_source_sha || '' }}
|
|
64
|
+
release_source_epoch: ${{ inputs.release_source_epoch || '' }}
|
|
65
|
+
legacy_profile: ${{ inputs.legacy_profile || false }}
|
|
66
|
+
skip-hooks: docker-compose-check,scanner-versions
|
|
67
|
+
python-connector: false
|
|
68
|
+
render-connector: false
|
|
69
|
+
pages-spec-dashboard-config: .config/spec-dashboard.json
|
|
70
|
+
secrets:
|
|
71
|
+
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
|
|
72
|
+
DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }}
|
|
73
|
+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
|
74
|
+
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
|
75
|
+
DOCKER_REPOSITORY: ${{ secrets.DOCKER_REPOSITORY }}
|
|
76
|
+
org_site_app_id: ${{ secrets.org_site_app_id }}
|
|
77
|
+
org_site_app_private_key: ${{ secrets.org_site_app_private_key }}
|
|
78
|
+
|
|
79
|
+
# The one required status check (reference/ci-standard.md): named in the caller so the
|
|
80
|
+
# ruleset context is exactly `CI required`. Skipped routes pass; failed or cancelled fail.
|
|
81
|
+
ci-required:
|
|
82
|
+
name: CI required
|
|
83
|
+
if: always()
|
|
84
|
+
needs: [pipeline]
|
|
85
|
+
runs-on: ubuntu-latest
|
|
86
|
+
timeout-minutes: 5
|
|
87
|
+
permissions: {}
|
|
88
|
+
steps:
|
|
89
|
+
- name: Fail on a failed or cancelled pipeline (skipped is fine)
|
|
90
|
+
env:
|
|
91
|
+
RESULT: ${{ needs.pipeline.result }}
|
|
92
|
+
run: |
|
|
93
|
+
echo "pipeline result: $RESULT"
|
|
94
|
+
case "$RESULT" in failure|cancelled) echo "::error::the pipeline ended $RESULT"; exit 1;; esac
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
# .pipeline-theme/ is
|
|
2
|
-
#
|
|
1
|
+
# .pipeline-theme/ is the shared Pages theme checked out from pipelines at
|
|
2
|
+
# build time (never tracked); formatters must not rewrite a local checkout.
|
|
3
3
|
exclude: ^\.pipeline-theme/
|
|
4
4
|
default_language_version:
|
|
5
5
|
python: python3
|
|
@@ -69,7 +69,7 @@ repos:
|
|
|
69
69
|
always_run: true
|
|
70
70
|
- id: pytest
|
|
71
71
|
name: Generated connector contracts
|
|
72
|
-
entry:
|
|
72
|
+
entry: uv run --all-extras pytest tests -q
|
|
73
73
|
language: system
|
|
74
74
|
pass_filenames: false
|
|
75
75
|
always_run: true
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: webarchiver
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.4
|
|
4
4
|
Summary: Governed web fetch, extract, render, screenshot and link connector
|
|
5
|
-
Author: Repository Maintainers
|
|
5
|
+
Author-email: Repository Maintainers <maintainers@knuckles.team>
|
|
6
6
|
License: MIT
|
|
7
7
|
Classifier: Development Status :: 5 - Production/Stable
|
|
8
8
|
Classifier: License :: OSI Approved :: MIT License
|
|
@@ -15,14 +15,14 @@ Classifier: Programming Language :: Python :: 3.14
|
|
|
15
15
|
Requires-Python: <3.15,>=3.12
|
|
16
16
|
Description-Content-Type: text/markdown
|
|
17
17
|
License-File: LICENSE
|
|
18
|
-
Requires-Dist:
|
|
18
|
+
Requires-Dist: scion-sdk[mcp]<0.7.0,>=0.6.4
|
|
19
19
|
Requires-Dist: trafilatura<3.0.0,>=2.0.0
|
|
20
20
|
Requires-Dist: lxml>=6.0.0
|
|
21
21
|
Requires-Dist: playwright<2.0.0,>=1.55.0
|
|
22
22
|
Provides-Extra: mcp
|
|
23
|
-
Requires-Dist:
|
|
23
|
+
Requires-Dist: scion-sdk[mcp]<0.7.0,>=0.6.4; extra == "mcp"
|
|
24
24
|
Provides-Extra: all
|
|
25
|
-
Requires-Dist:
|
|
25
|
+
Requires-Dist: scion-sdk[mcp]<0.7.0,>=0.6.4; extra == "all"
|
|
26
26
|
Provides-Extra: test
|
|
27
27
|
Requires-Dist: pytest-xdist>=3.6.0; extra == "test"
|
|
28
28
|
Requires-Dist: pytest; extra == "test"
|
|
@@ -80,7 +80,7 @@ DOMs, full-page screenshots and outbound links. It holds no credentials.
|
|
|
80
80
|
`web_render`, `web_screenshot`, `web_crawl` and `web_links`, all
|
|
81
81
|
read-only.
|
|
82
82
|
- **Shared web-source contract** — `web_fetch` and `web_extract` are the
|
|
83
|
-
|
|
83
|
+
scion-sdk web-source contract's tools: the same request, page
|
|
84
84
|
result and refusal reasons as every page connector, including the ArchiveBox
|
|
85
85
|
connector. Each page names its `backend` (`webarchiver`).
|
|
86
86
|
|
|
@@ -48,7 +48,7 @@ DOMs, full-page screenshots and outbound links. It holds no credentials.
|
|
|
48
48
|
`web_render`, `web_screenshot`, `web_crawl` and `web_links`, all
|
|
49
49
|
read-only.
|
|
50
50
|
- **Shared web-source contract** — `web_fetch` and `web_extract` are the
|
|
51
|
-
|
|
51
|
+
scion-sdk web-source contract's tools: the same request, page
|
|
52
52
|
result and refusal reasons as every page connector, including the ArchiveBox
|
|
53
53
|
connector. Each page names its `backend` (`webarchiver`).
|
|
54
54
|
|
|
@@ -20,7 +20,7 @@ ENV HOST=${HOST} \
|
|
|
20
20
|
PLAYWRIGHT_BROWSERS_PATH=/opt/ms-playwright
|
|
21
21
|
# The render and screenshot operations drive Playwright's prebuilt Chromium
|
|
22
22
|
# (downloaded, not compiled) with its system libraries.
|
|
23
|
-
RUN pip install --only-binary :all: webarchiver[mcp]==1.2.
|
|
23
|
+
RUN pip install --only-binary :all: webarchiver[mcp]==1.2.4 \
|
|
24
24
|
&& playwright install --with-deps --only-shell chromium \
|
|
25
25
|
&& rm -rf /var/lib/apt/lists/* \
|
|
26
26
|
&& chmod -R a+rX /opt/ms-playwright \
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Connector architecture
|
|
2
2
|
|
|
3
3
|
The `webarchiver` package owns external-system operations and source mappings.
|
|
4
|
-
The [shared connector SDK](https://github.com/Knuckles-Team/
|
|
4
|
+
The [shared connector SDK](https://github.com/Knuckles-Team/scion-sdk/blob/5babc4cc48ad73928468b243842f219f51e2cca1/README.md) owns reusable runtime contracts.
|
|
5
5
|
|
|
6
6
|
```mermaid
|
|
7
7
|
flowchart LR
|
|
@@ -17,7 +17,7 @@ pip install webarchiver
|
|
|
17
17
|
|
|
18
18
|
| Extra | Install | Pulls in |
|
|
19
19
|
|---|---|---|
|
|
20
|
-
| `mcp` | `pip install "webarchiver[mcp]"` | MCP runtime (`
|
|
20
|
+
| `mcp` | `pip install "webarchiver[mcp]"` | MCP runtime (`scion-sdk`) |
|
|
21
21
|
| `all` | `pip install "webarchiver[all]"` | Everything above |
|
|
22
22
|
|
|
23
23
|
## From source
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# webarchiver — Concept Overview
|
|
2
2
|
|
|
3
3
|
> **Category**: Integration | **Ecosystem Role**: MCP Server
|
|
4
|
-
> Built on [`
|
|
4
|
+
> Built on [`scion-sdk`](https://github.com/Knuckles-Team/scion-sdk).
|
|
5
5
|
|
|
6
6
|
## Description
|
|
7
7
|
|
|
@@ -4,27 +4,28 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "webarchiver"
|
|
7
|
-
version = "1.2.
|
|
7
|
+
version = "1.2.4"
|
|
8
8
|
description = "Governed web fetch, extract, render, screenshot and link connector"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
classifiers = [ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: MIT License", "Environment :: Console", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14",]
|
|
11
11
|
requires-python = ">=3.12,<3.15"
|
|
12
12
|
dependencies = [
|
|
13
|
-
"
|
|
13
|
+
"scion-sdk[mcp]>=0.6.4,<0.7.0",
|
|
14
14
|
"trafilatura>=2.0.0,<3.0.0",
|
|
15
15
|
"lxml>=6.0.0",
|
|
16
16
|
"playwright>=1.55.0,<2.0.0",
|
|
17
17
|
]
|
|
18
18
|
[[project.authors]]
|
|
19
19
|
name = "Repository Maintainers"
|
|
20
|
+
email = "maintainers@knuckles.team"
|
|
20
21
|
|
|
21
22
|
[project.license]
|
|
22
23
|
text = "MIT"
|
|
23
24
|
|
|
24
25
|
[project.optional-dependencies]
|
|
25
|
-
mcp = [ "
|
|
26
|
+
mcp = [ "scion-sdk[mcp]>=0.6.4,<0.7.0",]
|
|
26
27
|
all = [
|
|
27
|
-
"
|
|
28
|
+
"scion-sdk[mcp]>=0.6.4,<0.7.0",
|
|
28
29
|
]
|
|
29
30
|
test = [
|
|
30
31
|
"pytest-xdist>=3.6.0", "pytest", "pytest-asyncio", "pytest-cov",]
|
|
@@ -32,8 +33,8 @@ test = [
|
|
|
32
33
|
[project.scripts]
|
|
33
34
|
webarchiver-mcp = "webarchiver.mcp_server:mcp_server"
|
|
34
35
|
|
|
35
|
-
# The one declared connector identity: the fleet name (
|
|
36
|
-
[project.entry-points."
|
|
36
|
+
# The one declared connector identity: the fleet name (SCION-CONNECTOR-CONTROL-R071).
|
|
37
|
+
[project.entry-points."scion_sdk.connector"]
|
|
37
38
|
webarchiver-mcp = "webarchiver"
|
|
38
39
|
|
|
39
40
|
[tool.uv.workspace]
|
|
@@ -88,7 +88,7 @@ for name, source in expected.items():
|
|
|
88
88
|
origin = pathlib.Path(module.__file__).resolve()
|
|
89
89
|
origin.relative_to(pathlib.Path(source).resolve())
|
|
90
90
|
origins[name] = str(origin)
|
|
91
|
-
for name in ('
|
|
91
|
+
for name in ('scion_sdk', 'epistemic_graph', 'fastmcp', 'mcp', 'pytest'):
|
|
92
92
|
origin = pathlib.Path(importlib.import_module(name).__file__).resolve()
|
|
93
93
|
origin.relative_to(pathlib.Path(expected.get(name, prefix)).resolve())
|
|
94
94
|
origins[name] = str(origin)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"""Reject retired connector APIs in a generated SDK-based project.
|
|
3
3
|
|
|
4
4
|
This static check needs no installed connector dependencies. A connector is
|
|
5
|
-
MCP-only and depends on
|
|
5
|
+
MCP-only and depends on scion-sdk alone: the retired control-plane
|
|
6
6
|
package may be neither imported nor declared as a dependency.
|
|
7
7
|
"""
|
|
8
8
|
|
|
@@ -75,12 +75,10 @@ def check_project(root: Path, package: str) -> list[str]:
|
|
|
75
75
|
for value in dependencies
|
|
76
76
|
}
|
|
77
77
|
violations = []
|
|
78
|
-
if "
|
|
79
|
-
violations.append("pyproject.toml: connector requires
|
|
78
|
+
if "scion-sdk" not in names:
|
|
79
|
+
violations.append("pyproject.toml: connector requires scion-sdk")
|
|
80
80
|
if RETIRED_PACKAGE.replace("_", "-") in names:
|
|
81
|
-
violations.append(
|
|
82
|
-
"pyproject.toml: connectors depend on agent-connector-sdk only"
|
|
83
|
-
)
|
|
81
|
+
violations.append("pyproject.toml: connectors depend on scion-sdk only")
|
|
84
82
|
for extra, values in project.get("optional-dependencies", {}).items():
|
|
85
83
|
if any(RETIRED_PACKAGE.replace("_", "-") in value.lower() for value in values):
|
|
86
84
|
violations.append(
|
|
@@ -4,7 +4,7 @@ These specs follow the ecosystem [spec standard](https://github.com/Knuckles-Tea
|
|
|
4
4
|
|
|
5
5
|
## Owner
|
|
6
6
|
|
|
7
|
-
This repository owns the specs with the ID prefix `CONN-WEBARCHIVER`. The connector contract, certification, and transport rules belong to [
|
|
7
|
+
This repository owns the specs with the ID prefix `CONN-WEBARCHIVER`. The connector contract, certification, and transport rules belong to [scion-sdk](https://github.com/Knuckles-Team/scion-sdk/tree/main/specs).
|
|
8
8
|
|
|
9
9
|
## Local specifications
|
|
10
10
|
|
|
@@ -14,7 +14,7 @@ The connector holds no store and no selection rule. It returns one page result o
|
|
|
14
14
|
|
|
15
15
|
## Interfaces and data model
|
|
16
16
|
|
|
17
|
-
The tool arguments and results are the SDK contract types of `
|
|
17
|
+
The tool arguments and results are the SDK contract types of `SCION-SOURCE-INGEST-R005.40.1`. No connector-local result type exists.
|
|
18
18
|
|
|
19
19
|
## Live integration path
|
|
20
20
|
|
|
@@ -22,7 +22,7 @@ The production caller is `WebFetchSourceAdapter.extract` in the SDK. arbora reac
|
|
|
22
22
|
|
|
23
23
|
## Quality and release gates
|
|
24
24
|
|
|
25
|
-
The SDK conformance kit of `
|
|
25
|
+
The SDK conformance kit of `SCION-SOURCE-INGEST-R005.40.2` must pass against the served connector.
|
|
26
26
|
|
|
27
27
|
## Risks, alternatives, and decisions
|
|
28
28
|
|
|
@@ -6,14 +6,15 @@ Each row is one requirement. A child row `.n` is one five-minute unit of work. A
|
|
|
6
6
|
|
|
7
7
|
| ID | Requirement | Acceptance |
|
|
8
8
|
|---|---|---|
|
|
9
|
-
| `CONN-WEBARCHIVER-WEB-SOURCE-R001` | **Pages answer through the web-source contract (rollup).** The webarchiver connector must implement the web-source contract of `
|
|
10
|
-
| `CONN-WEBARCHIVER-WEB-SOURCE-R001.1` | **Model.** `web_fetch` and `web_extract` are the SDK web-source contract's tools (`
|
|
9
|
+
| `CONN-WEBARCHIVER-WEB-SOURCE-R001` | **Pages answer through the web-source contract (rollup).** The webarchiver connector must implement the web-source contract of `SCION-SOURCE-INGEST-R005.40`. It serves the per-operation tools `web_fetch`, `web_extract`, `web_render` and `web_screenshot`. It is the primary backend of `research.web` (`ARBORA-OPS-R067.3`). Children `.1` to `.8` and `.10` deliver it. | See each child. |
|
|
10
|
+
| `CONN-WEBARCHIVER-WEB-SOURCE-R001.1` | **Model.** `web_fetch` and `web_extract` are the SDK web-source contract's tools (`SCION-SOURCE-INGEST-R005.40.1`). `register_web_source_tools` serves them over `WebarchiverSource` in `webarchiver/api/web_source.py`. They take a `WebFetchRequest` and return a `WebPageResult` or a `WebFetchRefusal`, with `backend=webarchiver`. `web_render`, `web_screenshot`, `web_links` and `web_crawl` are the connector's own per-operation tools. Proving test: `tests/test_conformance.py::test_webarchiver_conforms_to_the_web_source_contract`. | The served tool schemas equal the contract's, and an unknown argument is refused. |
|
|
11
11
|
| `CONN-WEBARCHIVER-WEB-SOURCE-R001.2` | **Behavior.** The connector must obey `robots.txt` for its user agent and cache each file for 3600 s. It must keep a per-domain rate limit of 1 request per second by default. It must stop reading at `max_bytes` and refuse an unlisted content type. `web_extract` must reduce the page to its main content as markdown. It must return the title, author, published date, canonical URL and outbound links. `content_digest` is the SHA-256 of the extracted text. Proving test: `tests/test_extract.py::test_main_content_and_metadata`. | Fixture pages yield the expected markdown and metadata, and a disallowed path is refused. |
|
|
12
|
-
| `CONN-WEBARCHIVER-WEB-SOURCE-R001.3` | **Wiring.** The browser capture in `Webarchiver.launch_browser` (`webarchiver/webarchiver.py:63`) serves `web_render` and `web_screenshot`. The server uses the SDK server factory and `register_tool_surface`. The production caller is `WebFetchSourceAdapter.extract` of `
|
|
12
|
+
| `CONN-WEBARCHIVER-WEB-SOURCE-R001.3` | **Wiring.** The browser capture in `Webarchiver.launch_browser` (`webarchiver/webarchiver.py:63`) serves `web_render` and `web_screenshot`. The server uses the SDK server factory and `register_tool_surface`. The production caller is `WebFetchSourceAdapter.extract` of `SCION-SOURCE-INGEST-R005.40.3`. Proving test: `tests/test_served.py::test_tools_call_reaches_extractor`. | A served `tools/call` reaches the extractor and the capture path. |
|
|
13
13
|
| `CONN-WEBARCHIVER-WEB-SOURCE-R001.4` | **Refusal.** Each refusal must use a closed reason of the contract: `robots_disallowed`, `rate_limited`, `size_exceeded`, `unsupported_type`, `egress_denied`, `policy_refused`, `extract_empty` or `upstream_failed`. A private address must refuse through the SDK egress policy. The connector must never return an empty page as a success. Proving test: `tests/test_extract.py::test_refusals`. | Each case returns its reason and no page body. |
|
|
14
14
|
| `CONN-WEBARCHIVER-WEB-SOURCE-R001.5` | **Evidence.** Each result must name `backend=webarchiver`, the final URL, the HTTP status, the byte count, the content digest, the retrieval time and the `robots.txt` decision. Proving test: `tests/test_extract.py::test_result_provenance`. | Each named field is present and matches the fixture response. |
|
|
15
|
-
| `CONN-WEBARCHIVER-WEB-SOURCE-R001.6` | **Hot-path proof.** The test serves the connector and runs the SDK conformance kit of `
|
|
15
|
+
| `CONN-WEBARCHIVER-WEB-SOURCE-R001.6` | **Hot-path proof.** The test serves the connector and runs the SDK conformance kit of `SCION-SOURCE-INGEST-R005.40.2` against it. It then runs `connector-sync --once` for one page into a running engine. Proving test: `tests/test_conformance_served.py::test_conformance_kit_and_sync`. | The kit reports no broken obligation, and the engine holds one Document with `backend=webarchiver`. |
|
|
16
16
|
| `CONN-WEBARCHIVER-WEB-SOURCE-R001.7` | **Bounded site crawl.** `web_crawl(seed_url, same_site, max_pages, max_depth, include, exclude)` in `webarchiver/api/crawl.py` must walk links breadth-first from one seed and return the page URLs it reached, in discovery order. It must fetch every page through the same policy as `web_fetch`: robots.txt, the per-domain rate limit, size and content-type caps and egress pinning. `same_site` defaults to true. `max_pages` ranges from 1 to 1000 and `max_depth` from 0 to 10. `include` and `exclude` are regular expressions. A robots-disallowed or failed page is reported as skipped with its closed reason. It returns URLs only; fetching content is the caller's next step. Proving test: `tests/test_crawl.py::test_bounded_crawl`. | A fixture site yields the expected URLs in order, the disallowed path is reported and never fetched, and out-of-range bounds refuse with `policy_refused`. |
|
|
17
|
-
| `CONN-WEBARCHIVER-WEB-SOURCE-R001.8` | **Ingest mappings.** `webarchiver/connector_manifest.yml` must declare `schema_mappings` for the `Document` and `Chunk` record types, mapped to the core `Document` and `Chunk` classes, so `SourceIngest` resolves `manifest:<connector>#schema_mappings/Document` and `.../Chunk` in the pack the fleet imports (`
|
|
18
|
-
| `CONN-WEBARCHIVER-WEB-SOURCE-R001.10` | **Conformance.** The connector passes the SDK conformance kit (`
|
|
17
|
+
| `CONN-WEBARCHIVER-WEB-SOURCE-R001.8` | **Ingest mappings.** `webarchiver/connector_manifest.yml` must declare `schema_mappings` for the `Document` and `Chunk` record types, mapped to the core `Document` and `Chunk` classes, so `SourceIngest` resolves `manifest:<connector>#schema_mappings/Document` and `.../Chunk` in the pack the fleet imports (`SCION-SOURCE-INGEST-R004.25`). Proving test: `tests/test_startup.py::test_manifest_maps_document_and_chunk_records`. | The served manifest maps both record types with their text, title, source and backend fields. |
|
|
18
|
+
| `CONN-WEBARCHIVER-WEB-SOURCE-R001.10` | **Conformance.** The connector passes the SDK conformance kit (`SCION-SOURCE-INGEST-R005.40.2`) against itself, served in process. The kit checks robots.txt, the per-domain rate limit, `max_bytes`, the content type, the digest and the tool schemas. The archivebox-api connector passes the same kit, so both produce the same tools and record shape (`CONN-ARCHIVEBOX-API-WEB-SOURCE-R001.8`). Proving test: `tests/test_conformance.py::test_webarchiver_conforms_to_the_web_source_contract`. | The kit reports no broken obligation. |
|
|
19
19
|
| `CONN-WEBARCHIVER-WEB-SOURCE-R001.11` | **Fleet name.** The connector files its content pack, manifest and ingest binding under its fleet name `webarchiver-mcp`, not the package name. `ConnectorContent.connector` in `webarchiver/mcp_server.py`, `connector` in `webarchiver/connector_manifest.yml` and the `IngestBinding` in `webarchiver/kg_ingest.py` all carry `webarchiver-mcp`, so the engine lists the connector's tools and ingest under the name the fleet and onboarding use. Proving test: `tests/test_startup.py::test_connector_name_is_the_fleet_name`. | The served content, the manifest and the ingest binding all name `webarchiver-mcp`. |
|
|
20
|
+
| `CONN-WEBARCHIVER-WEB-SOURCE-R002` | **Structured entity documents.** `web_fetch` must accept the media types `application/json` and `application/ld+json`. It returns the body unchanged, with its media type and `content_digest`. The digest is the SHA-256 of the body. It runs no markdown extraction on these types. The robots, rate-limit and `max_bytes` rules of R001.2 still apply. It serves `MEDULLA-DECISION-ENGINE-R099.2`. | Test: `tests/test_extract.py::test_json_entity_document_passes_through` fetches a fixture entity document and asserts the body, media type and digest. |
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# CONN-WEBARCHIVER-WEB-SOURCE — Web page fetch, extraction, render and screenshot connector
|
|
2
2
|
|
|
3
|
-
Owner: webarchiver. Cross-repo IDs: `
|
|
3
|
+
Owner: webarchiver. Cross-repo IDs: `SCION-SOURCE-INGEST-R005.40`, `ARBORA-OPS-R067`, `MEDULLA-UNIFIED-DATA-PLANE-R651.7`.
|
|
4
4
|
|
|
5
|
-
Extends: [
|
|
5
|
+
Extends: [SCION-SOURCE-INGEST](https://github.com/Knuckles-Team/scion-sdk/blob/main/specs/SCION-SOURCE-INGEST/spec.md)
|
|
6
6
|
References: [ARBORA-OPS](https://github.com/Knuckles-Team/arbora/blob/main/specs/hosted-api-operations/spec.md)
|
|
7
7
|
|
|
8
8
|
## Purpose and user stories
|
|
@@ -17,7 +17,7 @@ The rows are in [requirements.md](requirements.md). The proving tests are in [te
|
|
|
17
17
|
|
|
18
18
|
## Why a new spec
|
|
19
19
|
|
|
20
|
-
The search covered `specs/` of this repository and the SDK and arbora specs. This repository had no spec for page fetch. The SDK owns only the contract (`
|
|
20
|
+
The search covered `specs/` of this repository and the SDK and arbora specs. This repository had no spec for page fetch. The SDK owns only the contract (`SCION-SOURCE-INGEST-R005.40`). The behavior of this one external system belongs here.
|
|
21
21
|
|
|
22
22
|
## Scope and interfaces
|
|
23
23
|
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import pytest
|
|
6
|
-
from
|
|
6
|
+
from fastmcp import Client
|
|
7
|
+
from scion_sdk.testing.web_source_conformance import (
|
|
7
8
|
check_web_source,
|
|
8
9
|
fastmcp_caller,
|
|
9
10
|
fixture_site,
|
|
10
11
|
served_tool_schemas,
|
|
11
12
|
)
|
|
12
|
-
from fastmcp import Client
|
|
13
13
|
|
|
14
14
|
import webarchiver.auth as auth_module
|
|
15
15
|
from webarchiver.mcp_server import get_mcp_instance
|
|
@@ -11,8 +11,8 @@ def test_mcp_server_module_importable():
|
|
|
11
11
|
|
|
12
12
|
@pytest.mark.concept("CONN-WEBARCHIVER-001")
|
|
13
13
|
def test_version_has_one_source():
|
|
14
|
-
"""The
|
|
15
|
-
from
|
|
14
|
+
"""The served version is the installed distribution version. CONCEPT:CONN-WEBARCHIVER-001"""
|
|
15
|
+
from importlib.metadata import version
|
|
16
16
|
|
|
17
17
|
module = importlib.import_module("webarchiver.mcp_server")
|
|
18
|
-
assert module.
|
|
18
|
+
assert module._VERSION == version("webarchiver")
|
|
@@ -13,11 +13,11 @@ from dataclasses import dataclass, field
|
|
|
13
13
|
from urllib.parse import urljoin, urlsplit
|
|
14
14
|
|
|
15
15
|
import httpx
|
|
16
|
-
from agent_connector_sdk.http.client import create_async_http_client
|
|
17
|
-
from agent_connector_sdk.http.egress import EgressPolicyError, PinnedEgressViolation
|
|
18
|
-
from agent_connector_sdk.http.options import HttpClientOptions
|
|
19
|
-
from agent_connector_sdk.http.retry import RetryPolicy
|
|
20
16
|
from pydantic import BaseModel, ConfigDict
|
|
17
|
+
from scion_sdk.http.client import create_async_http_client
|
|
18
|
+
from scion_sdk.http.egress import EgressPolicyError, PinnedEgressViolation
|
|
19
|
+
from scion_sdk.http.options import HttpClientOptions
|
|
20
|
+
from scion_sdk.http.retry import RetryPolicy
|
|
21
21
|
|
|
22
22
|
from .policy import (
|
|
23
23
|
DomainRateLimiter,
|
|
@@ -10,7 +10,7 @@ from __future__ import annotations
|
|
|
10
10
|
import socket
|
|
11
11
|
from functools import lru_cache
|
|
12
12
|
|
|
13
|
-
from
|
|
13
|
+
from scion_sdk.http.egress import egress_ip_is_blocked
|
|
14
14
|
|
|
15
15
|
__all__ = ["AD_HOST_SUFFIXES", "egress_blocked", "is_ad_host"]
|
|
16
16
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""webarchiver's implementation of the SDK web-source contract.
|
|
2
2
|
|
|
3
3
|
CONN-WEBARCHIVER-WEB-SOURCE-R001.1. ``web_fetch`` and ``web_extract`` are served
|
|
4
|
-
by :func:`
|
|
4
|
+
by :func:`scion_sdk.ports.web_source.register_web_source_tools` over
|
|
5
5
|
:class:`WebarchiverSource`, so their names, schemas, refusal reasons and output
|
|
6
6
|
shape are the contract's, identical to every other page connector's. The page
|
|
7
7
|
is fetched natively (governed httpx client) and its main content extracted
|
|
@@ -10,7 +10,7 @@ with trafilatura; ``backend`` is ``webarchiver``.
|
|
|
10
10
|
|
|
11
11
|
from __future__ import annotations
|
|
12
12
|
|
|
13
|
-
from
|
|
13
|
+
from scion_sdk.ports.web_source import (
|
|
14
14
|
WebFetchRequest,
|
|
15
15
|
WebOutboundLink,
|
|
16
16
|
WebPageResult,
|
|
@@ -5,7 +5,7 @@ come from settings; loopback and private hosts are refused unless explicitly
|
|
|
5
5
|
allowed for a test or an authorized internal deployment.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
from
|
|
8
|
+
from scion_sdk.config import load_config, setting
|
|
9
9
|
|
|
10
10
|
from .api import ApiClientSystem, FetchPolicy
|
|
11
11
|
|
|
@@ -8,8 +8,6 @@ from __future__ import annotations
|
|
|
8
8
|
|
|
9
9
|
from typing import Any
|
|
10
10
|
|
|
11
|
-
from agent_connector_sdk.ingest.sources import IngestSourceDeclaration, IngestSourceSpec
|
|
12
|
-
|
|
13
11
|
CONNECTOR: str = "webarchiver-mcp"
|
|
14
12
|
|
|
15
13
|
SOURCES: tuple[Any, ...] = ()
|
|
@@ -73,23 +71,3 @@ RESOURCES: tuple[dict[str, str], ...] = (
|
|
|
73
71
|
"name": "Chunk",
|
|
74
72
|
},
|
|
75
73
|
)
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
def declaration() -> IngestSourceDeclaration:
|
|
79
|
-
"""The declaration the server assembles from this module."""
|
|
80
|
-
specs: list[IngestSourceSpec] = []
|
|
81
|
-
for item in SOURCES:
|
|
82
|
-
for entry in item["connector_sources"]:
|
|
83
|
-
body: dict[str, Any] = {
|
|
84
|
-
k: v for k, v in entry.items() if k not in ("tool", "mapping")
|
|
85
|
-
}
|
|
86
|
-
spec = {**body, "tools": (entry["tool"],)}
|
|
87
|
-
specs.append(IngestSourceSpec.model_validate(spec))
|
|
88
|
-
return IngestSourceDeclaration.model_validate(
|
|
89
|
-
{
|
|
90
|
-
"connector": CONNECTOR,
|
|
91
|
-
"sources": specs,
|
|
92
|
-
"schema_mappings": SCHEMA_MAPPINGS,
|
|
93
|
-
"resources": RESOURCES,
|
|
94
|
-
}
|
|
95
|
-
)
|
|
@@ -17,7 +17,7 @@ import re
|
|
|
17
17
|
from dataclasses import dataclass
|
|
18
18
|
from typing import Any
|
|
19
19
|
|
|
20
|
-
from
|
|
20
|
+
from scion_sdk.privacy import sanitize_for_persistence
|
|
21
21
|
|
|
22
22
|
from .error_rendering import (
|
|
23
23
|
AGENT_ERROR_ACCEPT,
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import sys
|
|
2
|
+
from importlib.metadata import version as _dist_version
|
|
2
3
|
from pathlib import Path
|
|
3
4
|
|
|
4
|
-
from
|
|
5
|
-
from
|
|
6
|
-
from
|
|
7
|
-
from
|
|
8
|
-
from
|
|
5
|
+
from scion_sdk.config import load_config
|
|
6
|
+
from scion_sdk.mcp.content import ConnectorContent
|
|
7
|
+
from scion_sdk.mcp.server import create_mcp_server
|
|
8
|
+
from scion_sdk.mcp.tool_surface import register_tool_surface
|
|
9
|
+
from scion_sdk.ports.web_source import register_web_source_tools
|
|
9
10
|
|
|
10
11
|
from . import mcp as tool_modules
|
|
11
|
-
from ._version import __version__
|
|
12
12
|
from .api import ApiClientSystem, WebarchiverSource
|
|
13
13
|
from .auth import get_client
|
|
14
14
|
|
|
15
|
+
_VERSION = _dist_version("webarchiver")
|
|
16
|
+
|
|
15
17
|
#: The fleet and onboarding name; EG files the content pack and ingest under it.
|
|
16
18
|
CONNECTOR_NAME = "webarchiver-mcp"
|
|
17
19
|
|
|
@@ -22,13 +24,13 @@ def get_mcp_instance(*, command_args=None):
|
|
|
22
24
|
package_root = Path(__file__).resolve().parent
|
|
23
25
|
args, mcp, middlewares = create_mcp_server(
|
|
24
26
|
name="Webarchiver",
|
|
25
|
-
version=
|
|
27
|
+
version=_VERSION,
|
|
26
28
|
instructions="Governed web fetch, extract, render, screenshot and link connector",
|
|
27
29
|
command_args=command_args,
|
|
28
30
|
content=ConnectorContent(
|
|
29
31
|
connector=CONNECTOR_NAME,
|
|
30
32
|
package_root=package_root,
|
|
31
|
-
package_version=
|
|
33
|
+
package_version=_VERSION,
|
|
32
34
|
),
|
|
33
35
|
)
|
|
34
36
|
# One typed, annotated MCP tool per API operation (SDK default).
|