parallel-web-tools 0.4.0rc2__tar.gz → 0.5.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.
Files changed (53) hide show
  1. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/PKG-INFO +1 -1
  2. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/__init__.py +1 -1
  3. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/cli/commands.py +36 -0
  4. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/cli/skills.py +6 -10
  5. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/core/skills.py +94 -100
  6. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/integrations/bigquery/cloud_function/requirements.txt +1 -1
  7. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/pyproject.toml +1 -1
  8. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/.gitignore +0 -0
  9. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/README.md +0 -0
  10. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/cli/__init__.py +0 -0
  11. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/cli/planner.py +0 -0
  12. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/cli/updater.py +0 -0
  13. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/core/__init__.py +0 -0
  14. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/core/auth.py +0 -0
  15. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/core/batch.py +0 -0
  16. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/core/credentials.py +0 -0
  17. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/core/endpoints.py +0 -0
  18. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/core/findall.py +0 -0
  19. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/core/monitor.py +0 -0
  20. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/core/polling.py +0 -0
  21. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/core/research.py +0 -0
  22. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/core/result.py +0 -0
  23. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/core/runner.py +0 -0
  24. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/core/schema.py +0 -0
  25. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/core/service.py +0 -0
  26. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/core/service_types.py +0 -0
  27. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/core/sql_utils.py +0 -0
  28. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/core/user_agent.py +0 -0
  29. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/integrations/__init__.py +0 -0
  30. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/integrations/bigquery/__init__.py +0 -0
  31. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/integrations/bigquery/cloud_function/main.py +0 -0
  32. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/integrations/bigquery/deploy.py +0 -0
  33. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/integrations/bigquery/sql/create_functions.sql +0 -0
  34. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/integrations/duckdb/__init__.py +0 -0
  35. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/integrations/duckdb/batch.py +0 -0
  36. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/integrations/duckdb/findall.py +0 -0
  37. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/integrations/duckdb/udf.py +0 -0
  38. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/integrations/polars/__init__.py +0 -0
  39. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/integrations/polars/enrich.py +0 -0
  40. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/integrations/snowflake/__init__.py +0 -0
  41. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/integrations/snowflake/deploy.py +0 -0
  42. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/integrations/snowflake/sql/01_setup.sql +0 -0
  43. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/integrations/snowflake/sql/02_create_udf.sql +0 -0
  44. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/integrations/snowflake/sql/03_cleanup.sql +0 -0
  45. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/integrations/spark/__init__.py +0 -0
  46. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/integrations/spark/streaming.py +0 -0
  47. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/integrations/spark/udf.py +0 -0
  48. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/integrations/utils.py +0 -0
  49. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/processors/__init__.py +0 -0
  50. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/processors/bigquery.py +0 -0
  51. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/processors/csv.py +0 -0
  52. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/processors/duckdb.py +0 -0
  53. {parallel_web_tools-0.4.0rc2 → parallel_web_tools-0.5.0}/parallel_web_tools/processors/json.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: parallel-web-tools
3
- Version: 0.4.0rc2
3
+ Version: 0.5.0
4
4
  Summary: Parallel Tools: CLI and Python SDK for AI-powered web intelligence
5
5
  Project-URL: Homepage, https://github.com/parallel-web/parallel-web-tools
6
6
  Project-URL: Documentation, https://docs.parallel.ai
@@ -35,7 +35,7 @@ from parallel_web_tools.core import (
35
35
  update_monitor,
36
36
  )
37
37
 
38
- __version__ = "0.4.0rc2"
38
+ __version__ = "0.5.0"
39
39
 
40
40
  __all__ = [
41
41
  # Auth
@@ -174,6 +174,35 @@ def _extract_api_message(error: Exception) -> str:
174
174
  return str(error)
175
175
 
176
176
 
177
+ def _legacy_credentials_in_use() -> bool:
178
+ """True when the active API key comes from the v0→v1 migrated ``legacy`` org.
179
+
180
+ Env-var keys win over stored creds in :func:`resolve_api_key`, so we only
181
+ flag legacy state when no ``PARALLEL_API_KEY`` is set — otherwise the user's
182
+ error has nothing to do with their on-disk credentials.
183
+ """
184
+ if os.environ.get("PARALLEL_API_KEY"):
185
+ return False
186
+ from parallel_web_tools.core import credentials
187
+
188
+ creds = credentials.load()
189
+ if creds is None:
190
+ return False
191
+ return creds.selected_org_id == credentials.LEGACY_ORG_ID
192
+
193
+
194
+ def _is_legacy_account_api_failure(error: Exception) -> bool:
195
+ """Detect a legacy user attempting an Account API operation.
196
+
197
+ ``ReauthenticationRequired`` fires from :func:`get_control_api_access_token`
198
+ whenever there are no usable control-API tokens. For a v0→v1 migrated user
199
+ this is expected: their stored ``api_key`` works for the standard Parallel
200
+ API, but they never went through the device flow that mints control tokens,
201
+ so any Account API call fails here.
202
+ """
203
+ return isinstance(error, ReauthenticationRequired) and _legacy_credentials_in_use()
204
+
205
+
177
206
  def _handle_error(
178
207
  error: Exception,
179
208
  output_json: bool = False,
@@ -186,6 +215,13 @@ def _handle_error(
186
215
  Rich-formatted error message.
187
216
  """
188
217
  message = _extract_api_message(error)
218
+ if _is_legacy_account_api_failure(error):
219
+ message = (
220
+ "This operation requires Account API credentials, but your stored "
221
+ "credentials only authorize the standard Parallel API. Re-run "
222
+ "'parallel-cli login' to authenticate against the Account API."
223
+ )
224
+ exit_code = EXIT_AUTH_ERROR
189
225
  if output_json:
190
226
  error_data = {"error": {"message": message, "type": type(error).__name__}}
191
227
  print(json.dumps(error_data, indent=2))
@@ -35,19 +35,19 @@ def create_skills_group(
35
35
  def skills() -> None:
36
36
  """Install and manage Parallel agent skills.
37
37
 
38
- Set GH_TOKEN for higher GitHub API rate limits when fetching skills.
38
+ Downloads come from skills.parallel.ai. Set PARALLEL_SKILLS_INDEX_URL to use a custom index.
39
39
  """
40
40
  pass
41
41
 
42
42
  @skills.command(name="list")
43
43
  @click.option("--json", "output_json", is_flag=True, help="Output as JSON")
44
44
  def skills_list(output_json: bool) -> None:
45
- """List available Parallel skills from GitHub."""
46
- from parallel_web_tools.core.skills import SkillsError, get_skills_repo_ref, list_remote_skills
45
+ """List available Parallel skills from skills.parallel.ai."""
46
+ from parallel_web_tools.core.skills import SkillsError, get_remote_skills_channel, list_remote_skills
47
47
 
48
48
  try:
49
- ref = get_skills_repo_ref()
50
- skill_names = list_remote_skills(ref=ref)
49
+ ref = get_remote_skills_channel()
50
+ skill_names = list_remote_skills()
51
51
  except SkillsError as e:
52
52
  handle_error(e, output_json=output_json, exit_code=exit_api_error, prefix="Skills list failed")
53
53
  except Exception as e:
@@ -76,7 +76,7 @@ def create_skills_group(
76
76
  )
77
77
  @click.option("--json", "output_json", is_flag=True, help="Output as JSON")
78
78
  def skills_install(project: bool, skill_names: tuple[str, ...], output_json: bool) -> None:
79
- """Install Parallel skills from GitHub.
79
+ """Install Parallel skills from skills.parallel.ai.
80
80
 
81
81
  When --skill is provided, the managed install set is replaced with exactly
82
82
  the listed skills.
@@ -85,7 +85,6 @@ def create_skills_group(
85
85
  SkillsError,
86
86
  SkillsInputError,
87
87
  SkillsInstallLocationError,
88
- get_skills_repo_ref,
89
88
  install_skills,
90
89
  resolve_install_dir,
91
90
  )
@@ -95,7 +94,6 @@ def create_skills_group(
95
94
  result = install_skills(
96
95
  install_dir=install_dir,
97
96
  selected_skills=list(skill_names) or None,
98
- ref=get_skills_repo_ref(),
99
97
  )
100
98
  except SkillsInstallLocationError as e:
101
99
  handle_error(e, output_json=output_json, exit_code=exit_bad_input, prefix="Skills install failed")
@@ -170,7 +168,6 @@ def create_skills_group(
170
168
  SkillsError,
171
169
  SkillsInputError,
172
170
  SkillsInstallLocationError,
173
- get_skills_repo_ref,
174
171
  reinstall_skills,
175
172
  resolve_install_dir,
176
173
  )
@@ -180,7 +177,6 @@ def create_skills_group(
180
177
  result = reinstall_skills(
181
178
  install_dir=install_dir,
182
179
  selected_skills=list(skill_names) or None,
183
- ref=get_skills_repo_ref(),
184
180
  )
185
181
  except SkillsInstallLocationError as e:
186
182
  handle_error(e, output_json=output_json, exit_code=exit_bad_input, prefix="Skills reinstall failed")
@@ -2,26 +2,21 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- import io
6
5
  import json
7
6
  import os
8
7
  import shutil
9
- import tempfile
10
8
  import time
11
- import zipfile
12
9
  from collections.abc import Iterator
13
10
  from contextlib import contextmanager
14
11
  from pathlib import Path
15
- from urllib.parse import quote
12
+ from typing import Any
16
13
 
17
14
  import httpx
18
15
 
19
- SKILLS_REPO_OWNER = "parallel-web"
20
- SKILLS_REPO_NAME = "parallel-agent-skills"
21
- SKILLS_REPO_SKILLS_PATH = "skills"
16
+ DEFAULT_SKILLS_INDEX_URL = "https://skills.parallel.ai/index.json"
17
+ SKILLS_INDEX_URL_ENV = "PARALLEL_SKILLS_INDEX_URL"
22
18
  DEFAULT_SKILLS_REPO_REF = "main"
23
19
  SKILLS_REPO_REF_ENV = "PARALLEL_SKILLS_REPO_REF"
24
- GITHUB_TOKEN_ENV = "GH_TOKEN"
25
20
  GLOBAL_SKILLS_DIR_ENV = "PARALLEL_SKILLS_GLOBAL_DIR"
26
21
 
27
22
  PROJECT_ROOT_MARKERS = (".git", "pyproject.toml", "package.json")
@@ -45,13 +40,25 @@ class SkillsInputError(SkillsError):
45
40
 
46
41
 
47
42
  def get_skills_repo_ref() -> str:
48
- """Return repository ref used for skill downloads."""
43
+ """Return the legacy requested skills channel/ref override.
44
+
45
+ CDN-backed installs ignore this value and always use the channel advertised by
46
+ the remote index, but we keep the helper for backwards compatibility.
47
+ """
49
48
  configured = os.environ.get(SKILLS_REPO_REF_ENV)
50
49
  if configured and configured.strip():
51
50
  return configured.strip()
52
51
  return DEFAULT_SKILLS_REPO_REF
53
52
 
54
53
 
54
+ def get_skills_index_url() -> str:
55
+ """Return the CDN index URL used for skills downloads."""
56
+ configured = os.environ.get(SKILLS_INDEX_URL_ENV)
57
+ if configured and configured.strip():
58
+ return configured.strip()
59
+ return DEFAULT_SKILLS_INDEX_URL
60
+
61
+
55
62
  def get_global_skills_dir() -> Path:
56
63
  """Return the global skills directory path."""
57
64
  configured = os.environ.get(GLOBAL_SKILLS_DIR_ENV)
@@ -84,108 +91,92 @@ def resolve_install_dir(project: bool, start: Path | None = None) -> Path:
84
91
  return root / ".agents" / "skills"
85
92
 
86
93
 
87
- def _github_archive_url(ref: str) -> str:
88
- encoded_ref = quote(ref, safe="")
89
- return f"https://api.github.com/repos/{SKILLS_REPO_OWNER}/{SKILLS_REPO_NAME}/zipball/{encoded_ref}"
94
+ @contextmanager
95
+ def _skills_client() -> Iterator[httpx.Client]:
96
+ with httpx.Client(timeout=30, follow_redirects=True) as client:
97
+ yield client
90
98
 
91
99
 
92
- def _github_headers() -> dict[str, str]:
93
- """Build GitHub API headers for skills archive downloads."""
94
- headers = {
95
- "Accept": "application/vnd.github+json",
96
- "X-GitHub-Api-Version": "2022-11-28",
97
- }
98
- token = os.environ.get(GITHUB_TOKEN_ENV)
99
- if token and token.strip():
100
- headers["Authorization"] = f"Bearer {token.strip()}"
101
- return headers
100
+ def _fetch_json(client: httpx.Client, url: str, description: str) -> dict[str, Any]:
101
+ response = client.get(url)
102
+ if response.status_code >= 400:
103
+ raise SkillsDownloadError(f"Failed to download {description} from {url}: HTTP {response.status_code}")
102
104
 
105
+ try:
106
+ data = response.json()
107
+ except ValueError as e:
108
+ raise SkillsDownloadError(f"Failed to parse {description} from {url} as JSON") from e
103
109
 
104
- def _download_repo_archive(client: httpx.Client, ref: str) -> bytes:
105
- # TODO: add retry/backoff for transient GitHub API failures (429/5xx).
106
- response = client.get(_github_archive_url(ref))
107
- if response.status_code >= 400:
108
- raise SkillsDownloadError(
109
- f"Failed to download skills archive at ref '{ref}' from "
110
- f"{SKILLS_REPO_OWNER}/{SKILLS_REPO_NAME}: HTTP {response.status_code}"
111
- )
112
- return response.content
110
+ if not isinstance(data, dict):
111
+ raise SkillsDownloadError(f"Expected {description} at {url} to be a JSON object")
112
+ return data
113
113
 
114
114
 
115
- def _extract_repo_archive(archive_bytes: bytes, dest_dir: Path) -> Path:
116
- """Extract a GitHub zipball into dest_dir and return the archive root."""
117
- dest_dir.mkdir(parents=True, exist_ok=True)
115
+ def _fetch_skills_index(client: httpx.Client) -> dict[str, Any]:
116
+ return _fetch_json(client, get_skills_index_url(), "skills index")
118
117
 
119
- try:
120
- with zipfile.ZipFile(io.BytesIO(archive_bytes)) as zf:
121
- root_name: str | None = None
122
-
123
- for member in zf.infolist():
124
- member_path = Path(member.filename)
125
- parts = member_path.parts
126
- if not parts:
127
- continue
128
- if parts[0] in ("", "/"):
129
- raise SkillsDownloadError("Invalid archive entry path")
130
- if any(part == ".." for part in parts):
131
- raise SkillsDownloadError("Archive contains unsafe path traversal entry")
132
- if root_name is None:
133
- root_name = parts[0]
134
-
135
- target = dest_dir / member_path
136
- target_resolved = target.resolve()
137
- dest_resolved = dest_dir.resolve()
138
- if dest_resolved not in (target_resolved, *target_resolved.parents):
139
- raise SkillsDownloadError("Archive extraction would escape destination directory")
140
-
141
- if member.is_dir():
142
- target.mkdir(parents=True, exist_ok=True)
143
- continue
144
-
145
- target.parent.mkdir(parents=True, exist_ok=True)
146
- with zf.open(member) as src, target.open("wb") as dst:
147
- shutil.copyfileobj(src, dst)
148
- except zipfile.BadZipFile as e:
149
- raise SkillsDownloadError("Failed to read downloaded skills archive") from e
150
-
151
- if not root_name:
152
- raise SkillsDownloadError("Downloaded skills archive was empty")
153
-
154
- root = dest_dir / root_name
155
- if not root.exists() or not root.is_dir():
156
- raise SkillsDownloadError("Downloaded skills archive had no repository root directory")
157
- return root
118
+
119
+ def _index_channel(index: dict[str, Any]) -> str:
120
+ channel = index.get("channel")
121
+ if isinstance(channel, str) and channel.strip():
122
+ return channel.strip()
123
+ return DEFAULT_SKILLS_REPO_REF
158
124
 
159
125
 
160
- @contextmanager
161
- def _downloaded_repo_root(ref: str) -> Iterator[Path]:
162
- with httpx.Client(timeout=30, follow_redirects=True, headers=_github_headers()) as client:
163
- archive_bytes = _download_repo_archive(client, ref)
126
+ def _skills_from_index(index: dict[str, Any]) -> dict[str, dict[str, str]]:
127
+ raw_skills = index.get("skills")
128
+ if not isinstance(raw_skills, list):
129
+ raise SkillsDownloadError("Skills index is missing a valid 'skills' list")
130
+
131
+ parsed: dict[str, dict[str, str]] = {}
132
+ for raw_skill in raw_skills:
133
+ if not isinstance(raw_skill, dict):
134
+ raise SkillsDownloadError("Skills index contained an invalid skill entry")
135
+
136
+ name = raw_skill.get("name")
137
+ skill_url = raw_skill.get("skill_url")
138
+ if not isinstance(name, str) or not name.strip():
139
+ raise SkillsDownloadError("Skills index contained a skill with an invalid name")
140
+ if not isinstance(skill_url, str) or not skill_url.strip():
141
+ raise SkillsDownloadError(f"Skills index entry '{name}' is missing a valid skill_url")
142
+
143
+ parsed[name.strip()] = {
144
+ "name": name.strip(),
145
+ "skill_url": skill_url.strip(),
146
+ }
164
147
 
165
- with tempfile.TemporaryDirectory(prefix="parallel-skills-") as tmpdir:
166
- repo_root = _extract_repo_archive(archive_bytes, Path(tmpdir))
167
- yield repo_root
148
+ return parsed
168
149
 
169
150
 
170
- def _skills_root(repo_root: Path) -> Path:
171
- skills_root = repo_root / SKILLS_REPO_SKILLS_PATH
172
- if not skills_root.exists() or not skills_root.is_dir():
151
+ def _list_skills_from_index(index: dict[str, Any]) -> list[str]:
152
+ return sorted(_skills_from_index(index))
153
+
154
+
155
+ def _download_skill_markdown(client: httpx.Client, skill_name: str, skill_url: str) -> bytes:
156
+ response = client.get(skill_url)
157
+ if response.status_code >= 400:
173
158
  raise SkillsDownloadError(
174
- f"Downloaded repository does not contain a '{SKILLS_REPO_SKILLS_PATH}/' directory at the requested ref"
159
+ f"Failed to download skill '{skill_name}' from {skill_url}: HTTP {response.status_code}"
175
160
  )
176
- return skills_root
161
+ return response.content
177
162
 
178
163
 
179
- def _list_skills_from_repo_root(repo_root: Path) -> list[str]:
180
- skills_root = _skills_root(repo_root)
181
- return sorted(path.name for path in skills_root.iterdir() if path.is_dir())
164
+ def get_remote_skills_channel() -> str:
165
+ """Return the channel advertised by the remote CDN index."""
166
+ with _skills_client() as client:
167
+ index = _fetch_skills_index(client)
168
+ return _index_channel(index)
182
169
 
183
170
 
184
171
  def list_remote_skills(ref: str | None = None) -> list[str]:
185
- """Return available skill directory names from the remote repository."""
186
- resolved_ref = ref or get_skills_repo_ref()
187
- with _downloaded_repo_root(resolved_ref) as repo_root:
188
- return _list_skills_from_repo_root(repo_root)
172
+ """Return available skill names from the CDN index.
173
+
174
+ The ref argument is ignored for CDN-backed installs.
175
+ """
176
+ del ref
177
+ with _skills_client() as client:
178
+ index = _fetch_skills_index(client)
179
+ return _list_skills_from_index(index)
189
180
 
190
181
 
191
182
  def _manifest_path(install_dir: Path) -> Path:
@@ -194,8 +185,7 @@ def _manifest_path(install_dir: Path) -> Path:
194
185
 
195
186
  def _write_manifest(install_dir: Path, ref: str, installed_skills: list[str]) -> None:
196
187
  data = {
197
- "repo": f"{SKILLS_REPO_OWNER}/{SKILLS_REPO_NAME}",
198
- "skills_path": SKILLS_REPO_SKILLS_PATH,
188
+ "source": get_skills_index_url(),
199
189
  "ref": ref,
200
190
  "installed_skills": sorted(installed_skills),
201
191
  "installed_at": int(time.time()),
@@ -226,13 +216,15 @@ def install_skills(
226
216
  Only skills previously managed by parallel-cli are reconciled. Unmanaged skill
227
217
  directories are left untouched.
228
218
  """
229
- resolved_ref = ref or get_skills_repo_ref()
219
+ del ref
230
220
 
231
- with _downloaded_repo_root(resolved_ref) as repo_root:
232
- skills_root = _skills_root(repo_root)
233
- available = _list_skills_from_repo_root(repo_root)
221
+ with _skills_client() as client:
222
+ index = _fetch_skills_index(client)
223
+ resolved_ref = _index_channel(index)
224
+ available_skills = _skills_from_index(index)
225
+ available = sorted(available_skills)
234
226
  requested = sorted(set(selected_skills or available))
235
- missing = sorted(name for name in requested if name not in available)
227
+ missing = sorted(name for name in requested if name not in available_skills)
236
228
  if missing:
237
229
  raise SkillsInputError(
238
230
  f"Unknown skills requested: {', '.join(missing)}. Available skills: {', '.join(available)}"
@@ -256,7 +248,9 @@ def install_skills(
256
248
  skill_dir = install_dir / skill_name
257
249
  if skill_dir.exists():
258
250
  shutil.rmtree(skill_dir)
259
- shutil.copytree(skills_root / skill_name, skill_dir)
251
+ skill_dir.mkdir(parents=True, exist_ok=True)
252
+ skill_bytes = _download_skill_markdown(client, skill_name, available_skills[skill_name]["skill_url"])
253
+ (skill_dir / "SKILL.md").write_bytes(skill_bytes)
260
254
 
261
255
  _write_manifest(install_dir, resolved_ref, requested)
262
256
  return {
@@ -1,5 +1,5 @@
1
1
  # Cloud Function dependencies for BigQuery Remote Function
2
2
  functions-framework>=3.0.0
3
3
  flask>=3.0.0
4
- parallel-web-tools>=0.4.0rc2
4
+ parallel-web-tools>=0.5.0
5
5
  google-cloud-secret-manager>=2.20.0
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "parallel-web-tools"
7
- version = "0.4.0rc2"
7
+ version = "0.5.0"
8
8
  description = "Parallel Tools: CLI and Python SDK for AI-powered web intelligence"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"