toolbase 0.4.0__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 (65) hide show
  1. {toolbase-0.4.0 → toolbase-0.5.0}/PKG-INFO +1 -1
  2. {toolbase-0.4.0 → toolbase-0.5.0}/pyproject.toml +1 -1
  3. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/cli.py +100 -10
  4. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/envs/__init__.py +2 -0
  5. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/envs/manifest.py +25 -0
  6. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/serve/orchestrator.py +36 -3
  7. {toolbase-0.4.0 → toolbase-0.5.0}/CHANGELOG.md +0 -0
  8. {toolbase-0.4.0 → toolbase-0.5.0}/LICENSE +0 -0
  9. {toolbase-0.4.0 → toolbase-0.5.0}/MANIFEST.in +0 -0
  10. {toolbase-0.4.0 → toolbase-0.5.0}/README.md +0 -0
  11. {toolbase-0.4.0 → toolbase-0.5.0}/setup.cfg +0 -0
  12. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/__init__.py +0 -0
  13. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/_setup_host.py +0 -0
  14. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/_toolkit_host.py +0 -0
  15. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/astro.py +0 -0
  16. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/auth.py +0 -0
  17. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/config.py +0 -0
  18. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/connect/__init__.py +0 -0
  19. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/connect/base.py +0 -0
  20. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/connect/claude_code.py +0 -0
  21. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/connect/codex.py +0 -0
  22. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/connect/orchestral.py +0 -0
  23. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/envs/bundle_deps.py +0 -0
  24. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/envs/cache.py +0 -0
  25. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/envs/config.py +0 -0
  26. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/envs/discovery.py +0 -0
  27. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/envs/paths.py +0 -0
  28. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/envs/schema.py +0 -0
  29. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/hep.py +0 -0
  30. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/ingest.py +0 -0
  31. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/logging/__init__.py +0 -0
  32. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/logging/logger.py +0 -0
  33. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/neutrino.py +0 -0
  34. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/quantum.py +0 -0
  35. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/serve/__init__.py +0 -0
  36. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/serve/bundles.py +0 -0
  37. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/serve/config.py +0 -0
  38. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/serve/profile_scaffold.py +0 -0
  39. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/serve/profiles.py +0 -0
  40. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/serve/proxy_tool.py +0 -0
  41. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/setup/__init__.py +0 -0
  42. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/setup/_rpc.py +0 -0
  43. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/setup/context.py +0 -0
  44. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/setup/declarative.py +0 -0
  45. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/setup/downloads.py +0 -0
  46. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/setup/prompts.py +0 -0
  47. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/setup/runner.py +0 -0
  48. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/setup/schema.py +0 -0
  49. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/setup/storage.py +0 -0
  50. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/setup/validate_cache.py +0 -0
  51. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/skills.py +0 -0
  52. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/templates/Dockerfile.template +0 -0
  53. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/templates/README.md.template +0 -0
  54. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/templates/__init__.py.template +0 -0
  55. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/templates/mcp/__init__.py.template +0 -0
  56. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/templates/mcp/server_stdio.py.template +0 -0
  57. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/templates/requirements.txt.template +0 -0
  58. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/templates/setup.py.template +0 -0
  59. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/templates/skills/example_skill.md +0 -0
  60. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/templates/tool_example.py +0 -0
  61. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/templates/toolkit.yaml.template +0 -0
  62. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/toolkit.py +0 -0
  63. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/validation.py +0 -0
  64. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase/versioning.py +0 -0
  65. {toolbase-0.4.0 → toolbase-0.5.0}/toolbase.egg-info/SOURCES.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: toolbase
3
- Version: 0.4.0
3
+ Version: 0.5.0
4
4
  Summary: The community registry and CLI for AI agent toolkits - discover, share, and serve tools to AI agents over MCP
5
5
  Author-email: Alex Roman <toolbase.dev@gmail.com>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "toolbase"
7
- version = "0.4.0"
7
+ version = "0.5.0"
8
8
  description = "The community registry and CLI for AI agent toolkits - discover, share, and serve tools to AI agents over MCP"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
@@ -3480,6 +3480,49 @@ def _pin_after_install(
3480
3480
  )
3481
3481
 
3482
3482
 
3483
+ def _pin_editable_local(name: str, *, local_scope: bool) -> None:
3484
+ """Pin (name, "editable") into the machine-local manifest layer.
3485
+
3486
+ Writes ``manifest.local.yaml`` next to the scoped project's
3487
+ committed manifest and drops a ``.gitignore`` into ``.toolbase/``
3488
+ (created only if absent) so the local layer never reaches git.
3489
+ Best-effort like _pin_after_install: a failure warns, the install
3490
+ stands.
3491
+ """
3492
+ try:
3493
+ from .envs import (
3494
+ project_manifest_path as _project_manifest_path,
3495
+ local_manifest_path as _local_manifest_path,
3496
+ add_pin as _add_pin,
3497
+ default_project_root as _default_project_root,
3498
+ )
3499
+ if local_scope:
3500
+ from .envs import find_project_root as _find_project_root
3501
+ found = _find_project_root(cwd=Path.cwd())
3502
+ if found is None:
3503
+ project_root = Path.cwd().resolve()
3504
+ _materialize_project_dir(project_root)
3505
+ else:
3506
+ project_root = found
3507
+ else:
3508
+ project_root = _default_project_root()
3509
+ local_path = _local_manifest_path(_project_manifest_path(project_root))
3510
+ _add_pin(local_path, name, "editable")
3511
+ gitignore = local_path.parent / ".gitignore"
3512
+ if not gitignore.exists():
3513
+ gitignore.write_text("manifest.local.yaml\n")
3514
+ console.print(
3515
+ f"[dim]Pinned editable in {local_path.name} "
3516
+ f"(machine-local, gitignored).[/dim]"
3517
+ )
3518
+ except Exception as e:
3519
+ console.print(
3520
+ f"[dim]Note: could not write the local editable pin: {e} — "
3521
+ f"without it, numbered slots outrank this checkout.[/dim]"
3522
+ )
3523
+
3524
+
3525
+
3483
3526
  def _install_from_path(
3484
3527
  source_path: Path,
3485
3528
  *,
@@ -3861,10 +3904,12 @@ def _install_from_path(
3861
3904
  ),
3862
3905
  )
3863
3906
  else:
3864
- console.print(
3865
- "[dim]Editable installs are not pinned into the project "
3866
- "manifest (the path is machine-specific).[/dim]"
3867
- )
3907
+ # Editable pins are machine state (they point at THIS machine's
3908
+ # source checkout), so they go to the gitignored local layer —
3909
+ # never the committed manifest. Without a pin the editable slot
3910
+ # would lose version resolution to any numbered slot and the
3911
+ # checkout would silently not serve.
3912
+ _pin_editable_local(name, local_scope=local_scope)
3868
3913
 
3869
3914
  console.print(f"\n[bold]Ready to use! Try:[/bold]")
3870
3915
  console.print(f" [cyan]tb activate {name}[/cyan] # expose it to the agent")
@@ -5244,6 +5289,21 @@ def list_cmd(as_json, verbose):
5244
5289
  f"[dim](used {last_used}, {size})[/dim]"
5245
5290
  f"{subset_tag}"
5246
5291
  )
5292
+ # Editable-shadow warning: a live-linked checkout exists but
5293
+ # resolution picks a numbered slot — the developer's code is
5294
+ # not what serves. Same condition as discovery's shadow_note.
5295
+ selected = pin_map.get(name) or (
5296
+ max((e.version for e in grouped[name]),
5297
+ key=lambda v: parse_version(v) or (0, 0, 0))
5298
+ if len(grouped[name]) > 1 else grouped[name][0].version
5299
+ )
5300
+ has_editable = any(e.version == "editable" for e in grouped[name])
5301
+ if has_editable and selected != "editable":
5302
+ console.print(
5303
+ " [yellow]⚠ editable slot shadowed by "
5304
+ f"{selected} — pin 'editable' in "
5305
+ ".toolbase/manifest.local.yaml to serve your checkout[/yellow]"
5306
+ )
5247
5307
  if verbose:
5248
5308
  _list_print_tools_verbose(name, resolved_profile)
5249
5309
 
@@ -5428,14 +5488,19 @@ def _list_resolve_pin_map(entries):
5428
5488
  load_manifest as _load_manifest,
5429
5489
  )
5430
5490
  project_root, _source = _resolve_active_project_root()
5491
+ from .envs import (
5492
+ load_merged_pins as _load_merged_pins,
5493
+ local_manifest_path as _local_manifest_path,
5494
+ )
5431
5495
  manifest_path = _project_manifest_path(project_root)
5432
- if not manifest_path.exists():
5496
+ if (not manifest_path.exists()
5497
+ and not _local_manifest_path(manifest_path).exists()):
5433
5498
  return {}, None
5434
- manifest = _load_manifest(manifest_path)
5435
- return (
5436
- {e.name: e.version for e in manifest.toolkits},
5437
- manifest_path,
5438
- )
5499
+ # Merged view: committed manifest + machine-local layer
5500
+ # (manifest.local.yaml), local wins — the same resolution
5501
+ # discover_toolkits uses, so the * markers never disagree
5502
+ # with what actually serves.
5503
+ return _load_merged_pins(manifest_path), manifest_path
5439
5504
  except Exception:
5440
5505
  # Manifest read errors (schema-too-new, malformed) shouldn't
5441
5506
  # break list. Skip the pin indicator and proceed.
@@ -5633,11 +5698,36 @@ def uninstall(name, yes, no_, no_input):
5633
5698
  # we silently fall back to default-project (which is where ``install``
5634
5699
  # would have pinned in the no-project case anyway).
5635
5700
  try:
5701
+ from .envs import (
5702
+ local_manifest_path as _local_manifest_path,
5703
+ load_manifest as _load_manifest_for_pins,
5704
+ )
5636
5705
  project_root, _source = _resolve_active_project_root()
5637
5706
  manifest_path = _project_manifest_path(project_root)
5707
+ local_path = _local_manifest_path(manifest_path)
5638
5708
  remaining = _list_versions(name)
5639
5709
  if not remaining:
5640
5710
  _remove_pin(manifest_path, name)
5711
+ _remove_pin(local_path, name)
5712
+ else:
5713
+ # Some versions remain. If a pin (committed or local layer)
5714
+ # still names a version we just removed, it now dangles —
5715
+ # serving would SKIP the toolkit entirely ("pinned version
5716
+ # not in cache") even though usable slots exist. Remove the
5717
+ # stale pin loudly; unpinned resolution falls back to the
5718
+ # highest remaining slot.
5719
+ for layer in (manifest_path, local_path):
5720
+ pins = {e.name: e.version
5721
+ for e in _load_manifest_for_pins(layer).toolkits}
5722
+ pinned = pins.get(name)
5723
+ if pinned is not None and pinned not in remaining:
5724
+ _remove_pin(layer, name)
5725
+ console.print(
5726
+ f"[yellow]⚠ Removed stale pin {name}@{pinned} from "
5727
+ f"{layer.name} (slot uninstalled; remaining: "
5728
+ f"{', '.join(remaining)}). Re-pin with "
5729
+ f"`tb install {name}@<version> -l` if needed.[/yellow]"
5730
+ )
5641
5731
  except Exception as e:
5642
5732
  console.print(
5643
5733
  f"[dim]Note: could not update project manifest: {e}[/dim]"
@@ -66,6 +66,8 @@ from .manifest import (
66
66
  Manifest,
67
67
  ManifestEntry,
68
68
  load_manifest,
69
+ local_manifest_path,
70
+ load_merged_pins,
69
71
  save_manifest,
70
72
  add_pin,
71
73
  remove_pin,
@@ -146,6 +146,31 @@ _MANIFEST_HEADER_COMMENT = (
146
146
  )
147
147
 
148
148
 
149
+ def local_manifest_path(manifest_path: Path) -> Path:
150
+ """The machine-local pin layer sitting next to a committed manifest.
151
+
152
+ ``manifest.yaml`` is committed (shareable: what the project depends
153
+ on, optionally pinned to registry versions). ``manifest.local.yaml``
154
+ is gitignored machine state — the place for pins that are only true
155
+ on this machine, above all ``version: editable`` (an editable slot
156
+ points into a local source checkout that no other machine has).
157
+ Local pins override committed pins name-by-name, mirroring the
158
+ user->project two-layer merge used for config values.
159
+ """
160
+ return manifest_path.with_name("manifest.local.yaml")
161
+
162
+
163
+ def load_merged_pins(manifest_path: Path) -> dict:
164
+ """``{name: version}`` from the committed manifest with the local
165
+ layer merged over it (local wins per name). Either file may be
166
+ absent; absent layers contribute nothing."""
167
+ pins = {e.name: e.version for e in load_manifest(manifest_path).toolkits}
168
+ local = load_manifest(local_manifest_path(manifest_path))
169
+ for e in local.toolkits:
170
+ pins[e.name] = e.version
171
+ return pins
172
+
173
+
149
174
  def load_manifest(path: Path) -> Manifest:
150
175
  """Read a manifest from disk, returning an empty ``Manifest`` if absent.
151
176
 
@@ -187,11 +187,14 @@ def discover_toolkits(toolkits_dir: Optional[Path] = None) -> List[ToolkitDiscov
187
187
  pin_by_name: Dict[str, str] = {}
188
188
  try:
189
189
  from ..cli import _resolve_active_project_root
190
+ from ..envs import load_merged_pins
190
191
  project_root, _source = _resolve_active_project_root()
191
192
  manifest_path = project_manifest_path(project_root)
192
- manifest = load_manifest(manifest_path)
193
- for e in manifest.toolkits:
194
- pin_by_name[e.name] = e.version
193
+ # Committed manifest merged with the machine-local layer
194
+ # (manifest.local.yaml) — local pins win per name. Editable
195
+ # pins belong in the local layer; they describe THIS machine's
196
+ # source checkout, not the project.
197
+ pin_by_name = load_merged_pins(manifest_path)
195
198
  except Exception:
196
199
  pin_by_name = {}
197
200
 
@@ -232,9 +235,29 @@ def discover_toolkits(toolkits_dir: Optional[Path] = None) -> List[ToolkitDiscov
232
235
  reverse=True,
233
236
  )[0]
234
237
 
238
+ # An editable slot that lost selection is a likely surprise:
239
+ # the developer linked a source checkout, but a numbered slot
240
+ # (or a committed pin) outranks it, so their live code is NOT
241
+ # what serves. Selection stays deterministic; we just refuse
242
+ # to be quiet about it. Carried in meta so both the serve
243
+ # banner and `tb list` can surface it.
244
+ shadow_note = None
245
+ if chosen is not None and chosen.version != "editable" and skip_extra is None:
246
+ editable_slot = next(
247
+ (c for c in candidates if c.version == "editable"), None)
248
+ if editable_slot is not None:
249
+ src = (editable_slot.install_meta or {}).get("source_path", "?")
250
+ shadow_note = (
251
+ f"editable slot (-> {src}) is shadowed by "
252
+ f"{chosen.version} — pin 'editable' in "
253
+ f".toolbase/manifest.local.yaml to serve your checkout"
254
+ )
255
+
235
256
  # Build the legacy-shaped meta dict that the rest of the
236
257
  # orchestrator expects.
237
258
  meta = dict(chosen.legacy_meta)
259
+ if shadow_note:
260
+ meta["shadow_note"] = shadow_note
238
261
  if not meta.get("environment") and chosen.install_meta.get("install_method"):
239
262
  meta["environment"] = chosen.install_meta["install_method"]
240
263
  meta.setdefault(
@@ -1056,6 +1079,16 @@ class Orchestrator:
1056
1079
  # config. Tools whose ``bundle:`` field names an unavailable
1057
1080
  # bundle are dropped from the served set. One stderr line per
1058
1081
  # dropped bundle, fired once at startup (NOT per call).
1082
+ # Editable-shadow warning (set at discovery): the developer's
1083
+ # source checkout exists but a numbered slot is what serves.
1084
+ note = (disc.meta or {}).get("shadow_note")
1085
+ if note:
1086
+ self.console.print(f" [yellow]⚠[/yellow] [dim]{disc.name}: {note}[/dim]")
1087
+ self.logger.log_event(
1088
+ "editable_shadowed", toolkit=disc.name,
1089
+ message=note, level="warn",
1090
+ )
1091
+
1059
1092
  availability, name_to_bundles = _resolve_bundle_availability(disc)
1060
1093
  if availability.dropped_bundles:
1061
1094
  for bname, missing in availability.dropped_bundles.items():
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes