cartograph-cli 0.3.0__tar.gz → 0.3.2__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 (71) hide show
  1. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/.github/workflows/fresh-install.yml +6 -3
  2. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/PKG-INFO +1 -1
  3. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/pyproject.toml +1 -1
  4. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/src/cartograph/installer.py +31 -21
  5. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/tests/fresh_install/test_fresh_install.sh +4 -4
  6. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/.github/workflows/publish.yml +0 -0
  7. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/.github/workflows/test.yml +0 -0
  8. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/.gitignore +0 -0
  9. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/CLAUDE.md +0 -0
  10. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/CONTRIBUTING.md +0 -0
  11. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/LICENSE +0 -0
  12. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/README.md +0 -0
  13. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/cg/infra_agent_cli_python/.validation_stamp.json +0 -0
  14. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/cg/infra_agent_cli_python/examples/example_usage.py +0 -0
  15. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/cg/infra_agent_cli_python/src/__init__.py +0 -0
  16. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/cg/infra_agent_cli_python/src/agent_cli.py +0 -0
  17. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/cg/infra_agent_cli_python/tests/test_agent_cli.py +0 -0
  18. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/cg/infra_agent_cli_python/widget.json +0 -0
  19. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/cg/infra_file_stamp_python/.validation_stamp.json +0 -0
  20. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/cg/infra_file_stamp_python/examples/example_usage.py +0 -0
  21. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/cg/infra_file_stamp_python/src/__init__.py +0 -0
  22. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/cg/infra_file_stamp_python/src/file_stamp.py +0 -0
  23. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/cg/infra_file_stamp_python/tests/test_file_stamp.py +0 -0
  24. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/cg/infra_file_stamp_python/widget.json +0 -0
  25. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/logo/logo-cartograph-black.svg +0 -0
  26. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/logo/logo-cartograph-white.svg +0 -0
  27. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/logo/logo-cartograph.svg +0 -0
  28. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/pytest.ini +0 -0
  29. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/src/cartograph/__init__.py +0 -0
  30. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/src/cartograph/__main__.py +0 -0
  31. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/src/cartograph/auth.py +0 -0
  32. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/src/cartograph/checkin.py +0 -0
  33. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/src/cartograph/cli.py +0 -0
  34. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/src/cartograph/cloud.py +0 -0
  35. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/src/cartograph/config.py +0 -0
  36. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/src/cartograph/dashboard.py +0 -0
  37. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/src/cartograph/dashboard_ui.py +0 -0
  38. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/src/cartograph/engine.py +0 -0
  39. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/src/cartograph/inspector.py +0 -0
  40. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/src/cartograph/languages/__init__.py +0 -0
  41. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/src/cartograph/languages/base.py +0 -0
  42. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/src/cartograph/languages/javascript.py +0 -0
  43. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/src/cartograph/languages/nim.py +0 -0
  44. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/src/cartograph/languages/python.py +0 -0
  45. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/src/cartograph/languages/registry.py +0 -0
  46. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/src/cartograph/languages/scanners/js_scanner.js +0 -0
  47. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/src/cartograph/languages/scanners/nim_scanner.nim +0 -0
  48. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/src/cartograph/library_config.json +0 -0
  49. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/src/cartograph/scaffolding/__init__.py +0 -0
  50. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/src/cartograph/search/__init__.py +0 -0
  51. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/src/cartograph/search/base.py +0 -0
  52. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/src/cartograph/search/bm25.py +0 -0
  53. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/src/cartograph/search/filters.py +0 -0
  54. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/src/cartograph/search/hybrid.py +0 -0
  55. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/src/cartograph/search/ngram.py +0 -0
  56. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/src/cartograph/search/synonyms.json +0 -0
  57. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/src/cartograph/trust.py +0 -0
  58. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/src/cartograph/validation_stamp.py +0 -0
  59. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/src/cartograph/validator.py +0 -0
  60. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/tests/__init__.py +0 -0
  61. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/tests/cloud_health.py +0 -0
  62. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/tests/conftest.py +0 -0
  63. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/tests/fresh_install/Dockerfile +0 -0
  64. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/tests/test_checkin.py +0 -0
  65. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/tests/test_create.py +0 -0
  66. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/tests/test_inspect.py +0 -0
  67. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/tests/test_install.py +0 -0
  68. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/tests/test_language_engines.py +0 -0
  69. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/tests/test_loading.py +0 -0
  70. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/tests/test_search.py +0 -0
  71. {cartograph_cli-0.3.0 → cartograph_cli-0.3.2}/tests/test_validate.py +0 -0
@@ -54,9 +54,12 @@ jobs:
54
54
 
55
55
  - name: Verify widget structure
56
56
  run: |
57
- test -f cg/backend-ci-test-python/widget.json
58
- test -d cg/backend-ci-test-python/src
59
- test -d cg/backend-ci-test-python/tests
57
+ # Find the created widget dir dynamically instead of hardcoding
58
+ WIDGET_DIR=$(find cg -maxdepth 2 -name "widget.json" -printf "%h" -quit)
59
+ echo "Widget created at: $WIDGET_DIR"
60
+ test -f "$WIDGET_DIR/widget.json"
61
+ test -d "$WIDGET_DIR/src"
62
+ test -d "$WIDGET_DIR/tests"
60
63
 
61
64
  - name: cartograph stats
62
65
  run: cartograph stats
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cartograph-cli
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: Widget library manager for AI agents — CLI
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "cartograph-cli"
7
- version = "0.3.0"
7
+ version = "0.3.2"
8
8
  description = "Widget library manager for AI agents — CLI"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -45,26 +45,29 @@ def _widget_dir(target_dir, widget_id):
45
45
  return os.path.join(target_dir, DEFAULT_INSTALL_DIR, python_dir_name(widget_id))
46
46
 
47
47
 
48
- def _install_from_cloud(widget_id, dest_path):
48
+ def _install_from_cloud(widget_id, dest_path, owner_hint=None):
49
49
  """Search cloud for a widget and install it by downloading the zip."""
50
- from .cloud import search as cloud_search, download_widget
51
-
52
- # Search cloud to find the widget and its owner
53
- results = cloud_search(widget_id, top_k=5)
54
- widgets = results.get("widgets", [])
55
- # Search results may return namespaced IDs (@owner/widget-id) or bare IDs
56
- match = next(
57
- (w for w in widgets
58
- if w.get("id") == widget_id
59
- or w.get("id", "").endswith(f"/{widget_id}")),
60
- None,
61
- )
62
- if not match:
63
- return {"error": f"Widget '{widget_id}' not found locally or in the cloud registry."}
64
-
65
- owner = match.get("owner", "")
66
- if not owner:
67
- return {"error": f"Widget '{widget_id}' found in cloud but missing owner info."}
50
+ from .cloud import download_widget
51
+
52
+ if owner_hint:
53
+ # Already know the owner from @owner/widget_id format
54
+ owner = owner_hint
55
+ else:
56
+ # Search cloud to find the widget and its owner
57
+ from .cloud import search as cloud_search
58
+ results = cloud_search(widget_id, top_k=5)
59
+ widgets = results.get("widgets", [])
60
+ match = next(
61
+ (w for w in widgets
62
+ if w.get("id") == widget_id
63
+ or w.get("id", "").endswith(f"/{widget_id}")),
64
+ None,
65
+ )
66
+ if not match:
67
+ return {"error": f"Widget '{widget_id}' not found locally or in the cloud registry."}
68
+ owner = match.get("owner", "")
69
+ if not owner:
70
+ return {"error": f"Widget '{widget_id}' found in cloud but missing owner info."}
68
71
 
69
72
  result = download_widget(owner, widget_id)
70
73
  if "error" in result:
@@ -91,9 +94,16 @@ def _install_from_cloud(widget_id, dest_path):
91
94
 
92
95
 
93
96
  def install(carto, widget_id, target_dir, version=None):
94
- """Install a widget into target_dir/cartograph/widget_id."""
97
+ """Install a widget into target_dir/cg/widget_id."""
95
98
  from .engine import REPO_DIR
96
99
 
100
+ # Strip @owner/ prefix if present (cloud widget IDs are namespaced)
101
+ owner_hint = None
102
+ if widget_id.startswith("@"):
103
+ parts = widget_id[1:].split("/", 1)
104
+ if len(parts) == 2:
105
+ owner_hint, widget_id = parts
106
+
97
107
  if not os.path.isabs(target_dir):
98
108
  return {"error": f"Target must be an absolute path, got: '{target_dir}'"}
99
109
 
@@ -134,7 +144,7 @@ def install(carto, widget_id, target_dir, version=None):
134
144
  return {"error": str(e)}
135
145
 
136
146
  # Fall back to cloud registry
137
- return _install_from_cloud(widget_id, dest_path)
147
+ return _install_from_cloud(widget_id, dest_path, owner_hint=owner_hint)
138
148
 
139
149
 
140
150
  def upgrade(carto, widget_id, target_dir, version=None):
@@ -53,14 +53,14 @@ check "cartograph create" cartograph create backend-hello-python \
53
53
  --language python --domain backend --name "Hello World"
54
54
 
55
55
  # 6. Check the widget structure exists
56
- check "widget structure" test -f cartograph/backend-hello-python/widget.json
57
- check "widget src exists" test -d cartograph/backend-hello-python/src
58
- check "widget tests exist" test -d cartograph/backend-hello-python/tests
56
+ check "widget structure" test -f cg/backend_hello_python/widget.json
57
+ check "widget src exists" test -d cg/backend_hello_python/src
58
+ check "widget tests exist" test -d cg/backend_hello_python/tests
59
59
 
60
60
  # 7. Validate the widget (should fail on template TODOs)
61
61
  echo ""
62
62
  echo "=== validate (expect failure on TODOs) ==="
63
- if cartograph validate cartograph/backend-hello-python 2>&1; then
63
+ if cartograph validate cg/backend_hello_python 2>&1; then
64
64
  echo " NOTE: validate passed (unexpected but ok)"
65
65
  else
66
66
  echo " Expected failure on template TODOs - PASS"
File without changes
File without changes
File without changes