deepvista-cli 4.4.0__tar.gz → 4.4.1__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 (102) hide show
  1. deepvista_cli-4.4.1/.release-please-manifest.json +3 -0
  2. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/CHANGELOG.md +13 -0
  3. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/PKG-INFO +1 -1
  4. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/commands/card.py +10 -0
  5. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/commands/pull.py +9 -8
  6. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/commands/skill.py +14 -2
  7. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/skill_catalog.py +119 -11
  8. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/plugins/claude-code/.claude-plugin/plugin.json +1 -1
  9. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/pyproject.toml +1 -1
  10. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/skills/deepvista/reference/pull.md +29 -17
  11. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/skills/deepvista/reference/push.md +4 -1
  12. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/tests/test_skill_catalog.py +153 -0
  13. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/uv.lock +1 -1
  14. deepvista_cli-4.4.0/.release-please-manifest.json +0 -3
  15. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/.claude-plugin/marketplace.json +0 -0
  16. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/.github/workflows/ci.yml +0 -0
  17. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/.github/workflows/publish.yml +0 -0
  18. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/.github/workflows/release-please.yml +0 -0
  19. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/.gitignore +0 -0
  20. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/.pre-commit-config.yaml +0 -0
  21. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/CLAUDE.md +0 -0
  22. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/CONTRIBUTING.md +0 -0
  23. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/LICENSE +0 -0
  24. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/README.md +0 -0
  25. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/__init__.py +0 -0
  26. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/auth/__init__.py +0 -0
  27. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/auth/callback_server.py +0 -0
  28. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/auth/login.py +0 -0
  29. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/auth/tokens.py +0 -0
  30. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/bundle.py +0 -0
  31. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/client/__init__.py +0 -0
  32. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/client/http.py +0 -0
  33. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/client/origin.py +0 -0
  34. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/commands/__init__.py +0 -0
  35. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/commands/agents.py +0 -0
  36. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/commands/auth.py +0 -0
  37. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/commands/chat.py +0 -0
  38. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/commands/config.py +0 -0
  39. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/commands/notes.py +0 -0
  40. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/commands/project.py +0 -0
  41. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/commands/push.py +0 -0
  42. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/commands/schedule.py +0 -0
  43. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/commands/session.py +0 -0
  44. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/commands/tasks.py +0 -0
  45. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/commands/upgrade.py +0 -0
  46. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/config.py +0 -0
  47. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/main.py +0 -0
  48. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/output/__init__.py +0 -0
  49. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/output/formatter.py +0 -0
  50. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/resources/__init__.py +0 -0
  51. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/resources/workflow_host_runtime.md +0 -0
  52. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/session_note.py +0 -0
  53. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/utils.py +0 -0
  54. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/deepvista_cli/workflow_doc.py +0 -0
  55. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/docs/assets/deepvista-banner.png +0 -0
  56. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/docs/releasing.md +0 -0
  57. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/install.ps1 +0 -0
  58. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/install.sh +0 -0
  59. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/plugins/README.md +0 -0
  60. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/plugins/claude-code/README.md +0 -0
  61. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/plugins/claude-code/commands/deepvista.md +0 -0
  62. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/plugins/claude-code/commands/refresh-skills.md +0 -0
  63. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/plugins/claude-code/hooks/hooks.json +0 -0
  64. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/plugins/claude-code/scripts/deepvista-agent-sync.sh +0 -0
  65. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/plugins/claude-code/scripts/deepvista-session-end.sh +0 -0
  66. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/plugins/claude-code/scripts/deepvista-session-start.sh +0 -0
  67. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/plugins/claude-code/scripts/deepvista-session-turn.sh +0 -0
  68. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/plugins/claude-code/scripts/deepvista-skill-url.py +0 -0
  69. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/plugins/claude-code/scripts/deepvista-sync.sh +0 -0
  70. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/plugins/claude-code/skills/.gitignore +0 -0
  71. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/plugins/claude-code/skills/install-deepvista-cli/SKILL.md +0 -0
  72. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/release-please-config.json +0 -0
  73. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/scripts/check_plugin_version.py +0 -0
  74. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/scripts/quickstart.sh +0 -0
  75. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/skills/deepvista/SKILL.md +0 -0
  76. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/skills/deepvista/reference/chat.md +0 -0
  77. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/skills/deepvista/reference/notes.md +0 -0
  78. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/skills/deepvista/reference/openclaw.md +0 -0
  79. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/skills/deepvista/reference/project.md +0 -0
  80. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/skills/deepvista/reference/session.md +0 -0
  81. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/skills/deepvista/reference/shared.md +0 -0
  82. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/skills/deepvista/reference/skill-analyze-notes.md +0 -0
  83. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/skills/deepvista/reference/skill-create-from-note.md +0 -0
  84. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/skills/deepvista/reference/skill-import-files.md +0 -0
  85. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/skills/deepvista/reference/skill-research-to-skill.md +0 -0
  86. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/skills/deepvista/reference/skill.md +0 -0
  87. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/skills/deepvista/reference/tasks.md +0 -0
  88. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/skills/deepvista/reference/vistabase-card.md +0 -0
  89. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/skills/dv-workflow/SKILL.md +0 -0
  90. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/tests/__init__.py +0 -0
  91. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/tests/test_agent_id_tagging.py +0 -0
  92. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/tests/test_bundle.py +0 -0
  93. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/tests/test_card_comment_commands.py +0 -0
  94. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/tests/test_entry_points.py +0 -0
  95. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/tests/test_http_client_retry.py +0 -0
  96. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/tests/test_project_commands.py +0 -0
  97. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/tests/test_schedule_commands.py +0 -0
  98. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/tests/test_session_note_format.py +0 -0
  99. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/tests/test_skill_commands.py +0 -0
  100. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/tests/test_tasks_commands.py +0 -0
  101. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/tests/test_workflow_doc_phases.py +0 -0
  102. {deepvista_cli-4.4.0 → deepvista_cli-4.4.1}/uninstall.sh +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "4.4.1"
3
+ }
@@ -46,6 +46,19 @@ users what's new between the version they have installed and the latest release.
46
46
  adopts a pre-existing server-side row instead of failing when the local
47
47
  file is missing.
48
48
 
49
+ ## [4.4.1](https://github.com/DeepVista-AI/deepvista-cli/compare/v4.4.0...v4.4.1) (2026-07-29)
50
+
51
+
52
+ ### Bug Fixes
53
+
54
+ * **card:** sync CARD_TYPES with the backend enum ([#227](https://github.com/DeepVista-AI/deepvista-cli/issues/227)) ([aa7dfb3](https://github.com/DeepVista-AI/deepvista-cli/commit/aa7dfb3fba049bb55fadcff00ba940bfe51aa84c))
55
+ * **DV-1869:** move installed bundles out of the stub dir into a stable store ([#226](https://github.com/DeepVista-AI/deepvista-cli/issues/226)) ([f58ce1d](https://github.com/DeepVista-AI/deepvista-cli/commit/f58ce1d3a466530652a53fcd6d6da039a307121d))
56
+
57
+
58
+ ### Documentation
59
+
60
+ * `pull.md` rewritten for the new layout, `push.md` updated. ([f58ce1d](https://github.com/DeepVista-AI/deepvista-cli/commit/f58ce1d3a466530652a53fcd6d6da039a307121d))
61
+
49
62
  ## [4.4.0](https://github.com/DeepVista-AI/deepvista-cli/compare/v4.3.0...v4.4.0) (2026-07-29)
50
63
 
51
64
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deepvista-cli
3
- Version: 4.4.0
3
+ Version: 4.4.1
4
4
  Summary: CLI for DeepVista — chat, notes, skills, and memory from your terminal.
5
5
  Project-URL: Homepage, https://deepvista.ai
6
6
  Project-URL: Repository, https://github.com/DeepVista-AI/deepvista-cli
@@ -35,6 +35,12 @@ from deepvista_cli.output.formatter import format_output, output_error
35
35
  # for human-authored notes; `artifact` (DV-1573) is the agent's fallback for
36
36
  # its own output when no structured type fits. The deprecated `skill_run`
37
37
  # type (superseded by `run_log`, DV-1130) is intentionally absent.
38
+ #
39
+ # This list gates `--type` on `list` / `search` / `grep` as well as `create`,
40
+ # so a type missing here cannot be *filtered* for either — not just created.
41
+ # `issue`, `table`, `environment_variable` and `notification` had drifted out
42
+ # of sync with the backend enum; `table` in particular is user-facing (a table
43
+ # card is the header row of a curated list, DV-1859).
38
44
  CARD_TYPES = [
39
45
  "person",
40
46
  "organization",
@@ -52,6 +58,10 @@ CARD_TYPES = [
52
58
  "task",
53
59
  "conversation_starter",
54
60
  "artifact",
61
+ "notification",
62
+ "issue",
63
+ "table",
64
+ "environment_variable",
55
65
  ]
56
66
 
57
67
  CARD_COLUMNS = ["id", "type", "title", "display_status", "updated_at"]
@@ -29,16 +29,17 @@ def _client(ctx: click.Context) -> DeepVistaClient:
29
29
 
30
30
 
31
31
  def _default_target(card: dict) -> str:
32
- """Where a skill lands when the user doesn't say.
32
+ """Where a bundle lands when the user doesn't say: the bundle store.
33
33
 
34
- The stub directory, not a cache dir — so `scripts/render.py` resolves
35
- relative to the SKILL.md the agent is reading, which is the convention
36
- Claude Code and friends already assume.
34
+ Not the stub dir (DV-1869). Stubs live wherever the syncing agent directory
35
+ wants them — under the Claude Code plugin that's a version-pinned path the
36
+ marketplace updater wipes on upgrade — so bundles kept beside them were
37
+ deleted by an upgrade with no old location left to migrate from. The store is
38
+ keyed by card id and survives both.
37
39
 
38
- Resolved against the target sync *actually* last used rather than
39
- ``DEFAULT_TARGET_DIR`` (DV-1869) — the plugin hook syncs into
40
- ``${CLAUDE_PLUGIN_ROOT}/skills``, so the default landed the payload beside a
41
- stub that lived elsewhere, and the next sync cleaned it up as stale.
40
+ `skill load` prints the root and tells the agent to resolve the body's
41
+ relative paths against it, which is what the agent needed anyway: its cwd is
42
+ the project, never the skill directory.
42
43
  """
43
44
  card_id = str(card.get("id") or "")
44
45
  return str(skill_catalog.bundle_root_for(card_id, card))
@@ -647,7 +647,10 @@ def skill_sync(
647
647
  Safe to wire into a SessionStart hook (it exits 0 on any network failure
648
648
  and previous sync state remains usable).
649
649
  """
650
- target_path = Path(target) if target else skill_catalog.DEFAULT_TARGET_DIR
650
+ # `default_target_dir()` follows CLAUDE_PLUGIN_ROOT when set, so a bare
651
+ # `deepvista skill sync` lands where the plugin's hook puts stubs instead of
652
+ # bouncing them between two locations on every manual run (DV-1869).
653
+ target_path = Path(target) if target else skill_catalog.default_target_dir()
651
654
 
652
655
  try:
653
656
  result = skill_catalog.sync_catalog(
@@ -706,7 +709,16 @@ def skill_load(ctx: click.Context, skill_id: str, no_cache: bool, ttl: int) -> N
706
709
  # writes only stubs, and an unbundled skill costs nothing.
707
710
  bundle_root = skill_catalog.ensure_skill_bundle(client, skill_id, card)
708
711
  if bundle_root is not None:
709
- body += f"\n\n---\n\nBundled files for this skill are installed at `{bundle_root}`.\n"
712
+ # State the root explicitly and say how to resolve against it. The
713
+ # bundle no longer sits next to this SKILL.md (DV-1869: it lives in a
714
+ # store that survives plugin upgrades), and the agent's cwd is the
715
+ # project anyway — so every relative path in the body above needs
716
+ # this base to mean anything.
717
+ body += (
718
+ f"\n\n---\n\n**Bundled files for this skill are installed at `{bundle_root}`.**\n"
719
+ f"Resolve every file path mentioned above against that directory — "
720
+ f"e.g. `cd {bundle_root} && uv run --script <script>`.\n"
721
+ )
710
722
  # Catch SystemExit too — the HTTP client calls sys.exit on API/auth
711
723
  # errors, but at skill-invocation time we'd rather return a readable
712
724
  # error body than bubble a raw exit code into the agent's context.
@@ -25,6 +25,7 @@ from __future__ import annotations
25
25
  import hashlib
26
26
  import json
27
27
  import logging
28
+ import os
28
29
  import re
29
30
  import shutil
30
31
  import time
@@ -42,6 +43,14 @@ from deepvista_cli.utils import load_json_state, save_json_state
42
43
  # ---------------------------------------------------------------------------
43
44
 
44
45
  DEFAULT_TARGET_DIR = Path.home() / ".claude" / "skills"
46
+
47
+ # Where installed bundles live (DV-1869). Separate from the stub dir on purpose:
48
+ # stubs are cheap, regenerable, and owned by whichever agent directory syncs
49
+ # them; bundles are bytes we'd otherwise re-download, and they must survive a
50
+ # plugin upgrade wiping ${CLAUDE_PLUGIN_ROOT}. XDG data dir, not the config dir,
51
+ # because this is state rather than configuration.
52
+ _XDG_DATA_HOME = Path(os.environ.get("XDG_DATA_HOME") or (Path.home() / ".local" / "share"))
53
+ DEFAULT_BUNDLE_STORE_DIR = _XDG_DATA_HOME / "deepvista" / "bundles"
45
54
  DEFAULT_STUB_PREFIX = "dv-"
46
55
  DEFAULT_LIMIT = 30
47
56
  DEFAULT_THROTTLE_MIN = 60
@@ -813,6 +822,29 @@ def load_skill_body(
813
822
  return _render_skill_body_markdown(card)
814
823
 
815
824
 
825
+ def bundle_store_dir() -> Path:
826
+ """Root of the bundle store, overridable with ``DEEPVISTA_BUNDLE_DIR``.
827
+
828
+ Read at call time rather than bound at import so a test or a sandboxed run
829
+ can redirect it.
830
+ """
831
+ override = os.environ.get("DEEPVISTA_BUNDLE_DIR")
832
+ return Path(override) if override else DEFAULT_BUNDLE_STORE_DIR
833
+
834
+
835
+ def default_target_dir() -> Path:
836
+ """Default stub directory: the plugin's own skills dir when we're inside it.
837
+
838
+ The plugin's SessionStart hook passes ``--target ${CLAUDE_PLUGIN_ROOT}/skills``
839
+ explicitly, so a bare ``deepvista skill sync`` used to disagree with it and
840
+ bounce stubs between two locations on every manual run (DV-1869). Honouring
841
+ the same env var makes the two agree. A machine with only the CLI — a cloud
842
+ VM, say — has no ``CLAUDE_PLUGIN_ROOT`` and keeps ``~/.claude/skills``.
843
+ """
844
+ plugin_root = os.environ.get("CLAUDE_PLUGIN_ROOT")
845
+ return Path(plugin_root) / "skills" if plugin_root else DEFAULT_TARGET_DIR
846
+
847
+
816
848
  def synced_target_dir(state_path: Path | None = None) -> Path:
817
849
  """Where sync actually last wrote stubs, not where we'd write them by default.
818
850
 
@@ -829,28 +861,92 @@ def synced_target_dir(state_path: Path | None = None) -> Path:
829
861
  recorded = load_state(state_path or CATALOG_STATE_FILE).get("target")
830
862
  if isinstance(recorded, str) and recorded:
831
863
  return Path(recorded)
832
- return DEFAULT_TARGET_DIR
864
+ return default_target_dir()
833
865
 
834
866
 
835
- def bundle_root_for(
836
- skill_id: str, card: dict[str, Any], *, target: Path | None = None, prefix: str = DEFAULT_STUB_PREFIX
867
+ def bundle_root_for(skill_id: str, card: dict[str, Any] | None = None, *, target: Path | None = None) -> Path:
868
+ """Where a skill's bundle lands: the bundle store, keyed by card id.
869
+
870
+ Deliberately **not** the stub dir any more (DV-1869). Stubs belong to
871
+ whichever agent directory is syncing them — under the Claude Code plugin
872
+ that's ``${CLAUDE_PLUGIN_ROOT}/skills``, a *version-pinned* path the
873
+ marketplace updater wipes on upgrade (which is why
874
+ :func:`_catalog_stubs_missing` exists at all). Bundles kept there were
875
+ collateral: an upgrade deletes the directory outright, so there is no old
876
+ location left for a migration to move files out of, and every upgrade
877
+ silently forced a re-download — a network round trip at best, a skill
878
+ invocation with no scripts when offline.
879
+
880
+ Keyed by **card id**, not a title slug, which also fixes a latent bug:
881
+ renaming a skill changed its slug and orphaned the installed bundle.
882
+
883
+ ``target`` overrides the root entirely (``pull --to``).
884
+ """
885
+ if target is not None:
886
+ return target
887
+ return bundle_store_dir() / (skill_id or "unknown")
888
+
889
+
890
+ def legacy_bundle_root_for(
891
+ skill_id: str, card: dict[str, Any] | None = None, *, prefix: str = DEFAULT_STUB_PREFIX
837
892
  ) -> Path:
838
- """Where a skill's bundle lands: its stub directory.
893
+ """Where bundles used to land: the skill's stub directory.
839
894
 
840
- Prefers the dir name a previous sync recorded — that one already resolved
841
- duplicate-title collisions — and falls back to the deterministic slug.
842
- Materializing into the stub dir (not a cache dir) is what lets
843
- ``scripts/render.py`` resolve relative to the SKILL.md the agent is
844
- reading, with no absolute-path rewriting.
895
+ Kept solely so :func:`migrate_legacy_bundle` can find an existing install
896
+ and move it, rather than leaving it stranded or re-downloading it.
845
897
  """
846
- root = target or synced_target_dir()
898
+ root = synced_target_dir()
847
899
  for entry in load_state().get("stubs", []):
848
900
  if entry.get("id") == skill_id and entry.get("dir_name"):
849
901
  return root / entry["dir_name"]
850
- title = str(card.get("title") or "skill")
902
+ title = str((card or {}).get("title") or "skill")
851
903
  return root / f"{prefix}{slugify_for_dir(title, fallback=skill_id[:8])}"
852
904
 
853
905
 
906
+ def migrate_legacy_bundle(skill_id: str, card: dict[str, Any] | None, store_root: Path) -> list[str]:
907
+ """Move a bundle installed under the old stub-dir layout into the store.
908
+
909
+ Returns the paths moved. A no-op when there is nothing there, so it is safe
910
+ to call on every install. Files already present in the store win — a fresh
911
+ install is at least as current as what we're carrying over.
912
+ """
913
+ legacy_root = legacy_bundle_root_for(skill_id, card)
914
+ if legacy_root == store_root or not legacy_root.exists():
915
+ return []
916
+
917
+ installed: dict[str, str] = bundle.read_marker(legacy_root).get("files") or {}
918
+ if not installed:
919
+ return []
920
+
921
+ moved: list[str] = []
922
+ for path in installed:
923
+ try:
924
+ source = bundle.safe_destination(legacy_root, path)
925
+ destination = bundle.safe_destination(store_root, path)
926
+ except bundle.BundleError:
927
+ continue
928
+ if not source.exists() or destination.exists():
929
+ continue
930
+ destination.parent.mkdir(parents=True, exist_ok=True)
931
+ try:
932
+ shutil.move(str(source), str(destination))
933
+ moved.append(path)
934
+ except OSError:
935
+ logger.info("could not migrate %s into the bundle store", source)
936
+
937
+ if moved:
938
+ marker = legacy_root / bundle.MARKER_FILENAME
939
+ store_marker = store_root / bundle.MARKER_FILENAME
940
+ if marker.exists() and not store_marker.exists():
941
+ store_marker.parent.mkdir(parents=True, exist_ok=True)
942
+ try:
943
+ shutil.move(str(marker), str(store_marker))
944
+ except OSError:
945
+ logger.info("could not carry the bundle marker into the store")
946
+ logger.info("migrated %d bundled file(s) for %s into %s", len(moved), skill_id, store_root)
947
+ return moved
948
+
949
+
854
950
  def ensure_skill_bundle(
855
951
  client: _CatalogClient,
856
952
  skill_id: str,
@@ -881,6 +977,11 @@ def ensure_skill_bundle(
881
977
  return None
882
978
 
883
979
  root = bundle_root_for(skill_id, card, target=target)
980
+ # Carry an install made under the old stub-dir layout into the store before
981
+ # checking the marker, so an existing bundle is moved rather than
982
+ # re-downloaded (and rather than being left to rot where sync will bin it).
983
+ if target is None:
984
+ migrate_legacy_bundle(skill_id, card, root)
884
985
  if bundle_mod.read_marker(root).get("bundle_sha") == bundle_mod.compute_bundle_sha(files):
885
986
  return root
886
987
 
@@ -900,6 +1001,7 @@ __all__ = [
900
1001
  "BODY_CACHE_DIR",
901
1002
  "CATALOG_STATE_FILE",
902
1003
  "DEFAULT_BODY_CACHE_TTL_SEC",
1004
+ "DEFAULT_BUNDLE_STORE_DIR",
903
1005
  "DEFAULT_LIMIT",
904
1006
  "DEFAULT_STUB_PREFIX",
905
1007
  "DEFAULT_TARGET_DIR",
@@ -911,7 +1013,13 @@ __all__ = [
911
1013
  "build_stub_markdown",
912
1014
  "compute_plan",
913
1015
  "bundle_root_for",
1016
+ "bundle_store_dir",
1017
+ "default_target_dir",
914
1018
  "ensure_skill_bundle",
1019
+ "legacy_bundle_root_for",
1020
+ "migrate_legacy_bundle",
1021
+ "remove_stub_dir",
1022
+ "synced_target_dir",
915
1023
  "load_skill_body",
916
1024
  "load_skill_card",
917
1025
  "render_skill_body",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepvista",
3
- "version": "4.4.0",
3
+ "version": "4.4.1",
4
4
  "description": "Remote-managed skill catalog from DeepVista. Auto-syncs thin stubs into the plugin's skills dir on SessionStart; full bodies are lazy-loaded at invocation time.",
5
5
  "author": {
6
6
  "name": "DeepVista AI",
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "deepvista-cli"
3
- version = "4.4.0"
3
+ version = "4.4.1"
4
4
  description = "CLI for DeepVista — chat, notes, skills, and memory from your terminal."
5
5
  readme = "README.md"
6
6
  license = { text = "Apache-2.0" }
@@ -26,23 +26,35 @@ deepvista pull <skill-id> --dry-run # list without writing
26
26
 
27
27
  ## Where files land
28
28
 
29
- By default, the skill's **stub directory** — the one `deepvista skill sync` last
30
- wrote `SKILL.md` into. That is usually `~/.claude/skills/dv-<slug>/`, but when
31
- the Claude Code plugin's SessionStart hook is doing the syncing it is
32
- `${CLAUDE_PLUGIN_ROOT}/skills/dv-<slug>/` instead. `pull` follows the recorded
33
- target rather than assuming the default, so the payload always lands beside the
34
- stub that references it:
29
+ By default the **bundle store** — a stable, version-independent directory keyed by
30
+ card id:
35
31
 
36
32
  ```
37
- ~/.claude/skills/dv-pdf-report/
38
- ├── SKILL.md ← the skill body (written by sync)
39
- ├── scripts/render.py ← bundle
33
+ ~/.local/share/deepvista/bundles/<card-id>/
34
+ ├── scripts/render.py
40
35
  ├── references/layout.md
41
36
  └── .deepvista-bundle.json ← install marker, do not edit
42
37
  ```
43
38
 
44
- Landing in the stub dir is deliberate: `scripts/render.py` then resolves
45
- relative to the `SKILL.md` the agent is reading, with no absolute paths.
39
+ Deliberately *not* the skill's stub directory. Stubs belong to whichever agent
40
+ directory syncs them, and under the Claude Code plugin that is
41
+ `${CLAUDE_PLUGIN_ROOT}/skills` — a **version-pinned** path the marketplace
42
+ updater deletes on upgrade. A bundle kept there was collateral damage: the
43
+ directory vanishes wholesale, so there is nothing left to migrate from, and every
44
+ upgrade silently forced a re-download.
45
+
46
+ Keyed by card id rather than a title slug, so renaming a skill doesn't orphan its
47
+ installed files.
48
+
49
+ Override with `--to`, or point the whole store somewhere else with
50
+ `DEEPVISTA_BUNDLE_DIR`.
51
+
52
+ `deepvista skill load` prints the root and tells the agent to resolve the body's
53
+ relative file paths against it — which it needed anyway, since an agent's working
54
+ directory is the project, never the skill directory.
55
+
56
+ A bundle installed under the older stub-dir layout is **moved** into the store the
57
+ next time the skill is loaded or pulled, not re-downloaded.
46
58
 
47
59
  ## You usually don't need to run this
48
60
 
@@ -70,12 +82,12 @@ we installed — an edited leftover is left alone.
70
82
 
71
83
  ## Sync won't delete what you installed
72
84
 
73
- A stub dir doubles as a bundle root, so retiring a stub could take a working
74
- install with it. It doesn't: `sync` removes the stub and the files its own marker
75
- says it installed, skips any whose hash changed (you edited them), and leaves the
76
- directory standing if anything survives. When the target *moves* — a plugin
77
- upgrade changes `${CLAUDE_PLUGIN_ROOT}` — installed bundles are carried over to
78
- the new stub dir rather than deleted, so a machine never has to re-download.
85
+ Bundles live outside the stub dirs `sync` manages, so retiring or relocating a
86
+ stub cannot touch them. Two older safeguards still apply to installs made under
87
+ the previous layout: `sync` removes only the stub plus the files its own marker
88
+ says it installed, skipping any whose hash changed (you edited them) and leaving
89
+ the directory standing if anything survives; and a target move carries such a
90
+ bundle across rather than deleting it.
79
91
 
80
92
  ## Exit codes
81
93
 
@@ -79,7 +79,10 @@ deepvista skill sync # writes the stub
79
79
  # …invoking the skill runs `deepvista skill load <id>`, which installs the bundle
80
80
  ```
81
81
 
82
- Or explicitly: `deepvista pull <card-id>`. See [pull.md](pull.md).
82
+ Or explicitly: `deepvista pull <card-id>`. Files land in the bundle store
83
+ (`~/.local/share/deepvista/bundles/<card-id>/`), and `skill load` prints that root
84
+ so the agent can resolve the body's relative paths against it. See
85
+ [pull.md](pull.md).
83
86
 
84
87
  ## Exit codes
85
88
 
@@ -682,4 +682,157 @@ def test_synced_target_dir_follows_the_recorded_target(tmp_path: Path, monkeypat
682
682
 
683
683
  def test_synced_target_dir_defaults_without_state(tmp_path: Path, monkeypatch):
684
684
  monkeypatch.setattr(skill_catalog, "CATALOG_STATE_FILE", tmp_path / "missing.json")
685
+ monkeypatch.delenv("CLAUDE_PLUGIN_ROOT", raising=False)
685
686
  assert skill_catalog.synced_target_dir() == skill_catalog.DEFAULT_TARGET_DIR
687
+
688
+
689
+ # ---------------------------------------------------------------------------
690
+ # Bundle store (DV-1869 follow-up)
691
+ #
692
+ # Stubs follow whichever agent dir syncs them — under the Claude Code plugin
693
+ # that's `${CLAUDE_PLUGIN_ROOT}/skills`, a version-pinned path the marketplace
694
+ # updater wipes on upgrade. Bundles kept beside them were deleted by an upgrade
695
+ # with no old location left to migrate from, so they now live in their own store.
696
+ # ---------------------------------------------------------------------------
697
+
698
+
699
+ def test_bundle_root_is_the_store_keyed_by_card_id(tmp_path: Path, monkeypatch):
700
+ monkeypatch.setenv("DEEPVISTA_BUNDLE_DIR", str(tmp_path / "store"))
701
+
702
+ root = skill_catalog.bundle_root_for("card-abc", {"title": "Narrated Browser"})
703
+
704
+ assert root == tmp_path / "store" / "card-abc"
705
+ # Keyed by id, not the title — renaming a skill must not orphan its bundle.
706
+ renamed = skill_catalog.bundle_root_for("card-abc", {"title": "Something Else Entirely"})
707
+ assert renamed == root
708
+
709
+
710
+ def test_bundle_root_honours_an_explicit_target(tmp_path: Path):
711
+ root = skill_catalog.bundle_root_for("card-abc", {"title": "x"}, target=tmp_path / "workdir")
712
+ assert root == tmp_path / "workdir"
713
+
714
+
715
+ def test_default_target_follows_the_plugin_root(tmp_path: Path, monkeypatch):
716
+ monkeypatch.setenv("CLAUDE_PLUGIN_ROOT", str(tmp_path / "plugin"))
717
+ assert skill_catalog.default_target_dir() == tmp_path / "plugin" / "skills"
718
+
719
+ monkeypatch.delenv("CLAUDE_PLUGIN_ROOT")
720
+ assert skill_catalog.default_target_dir() == skill_catalog.DEFAULT_TARGET_DIR
721
+
722
+
723
+ def _legacy_install(stub_dir: Path) -> None:
724
+ """A bundle installed under the old layout: files inside the stub dir."""
725
+ from deepvista_cli import bundle
726
+
727
+ stub_dir.mkdir(parents=True, exist_ok=True)
728
+ (stub_dir / "SKILL.md").write_text(skill_catalog.build_stub_markdown(_meta("id-a", "Alpha")))
729
+ (stub_dir / "scripts").mkdir(exist_ok=True)
730
+ (stub_dir / "scripts" / "run.py").write_text("print('hi')\n")
731
+ (stub_dir / "scripts" / "run.py").chmod(0o755)
732
+ bundle.write_marker(stub_dir, [bundle.BundleFile(path="scripts/run.py", sha256=_sha("print('hi')\n"), mode="755")])
733
+
734
+
735
+ def test_migrate_legacy_bundle_moves_files_and_marker(tmp_path: Path, monkeypatch):
736
+ from deepvista_cli import bundle
737
+
738
+ state_path = tmp_path / "state.json"
739
+ stubs = tmp_path / "skills"
740
+ _legacy_install(stubs / "dv-alpha")
741
+ skill_catalog.save_state({"target": str(stubs), "stubs": [{"id": "id-a", "dir_name": "dv-alpha"}]}, state_path)
742
+ monkeypatch.setattr(skill_catalog, "CATALOG_STATE_FILE", state_path)
743
+ store = tmp_path / "store" / "id-a"
744
+
745
+ moved = skill_catalog.migrate_legacy_bundle("id-a", {"title": "Alpha"}, store)
746
+
747
+ assert moved == ["scripts/run.py"]
748
+ assert (store / "scripts" / "run.py").read_text() == "print('hi')\n"
749
+ assert (store / "scripts" / "run.py").stat().st_mode & 0o777 == 0o755
750
+ assert (store / bundle.MARKER_FILENAME).exists()
751
+ # Moved, not copied — the stub dir keeps only the stub.
752
+ assert not (stubs / "dv-alpha" / "scripts" / "run.py").exists()
753
+ assert (stubs / "dv-alpha" / "SKILL.md").exists()
754
+
755
+
756
+ def test_migrate_legacy_bundle_is_a_no_op_with_nothing_to_move(tmp_path: Path, monkeypatch):
757
+ monkeypatch.setattr(skill_catalog, "CATALOG_STATE_FILE", tmp_path / "missing.json")
758
+ assert skill_catalog.migrate_legacy_bundle("id-a", {"title": "Alpha"}, tmp_path / "store") == []
759
+
760
+
761
+ def test_migrate_legacy_bundle_lets_the_store_win(tmp_path: Path, monkeypatch):
762
+ """A fresh install in the store is at least as current as the legacy copy."""
763
+ state_path = tmp_path / "state.json"
764
+ stubs = tmp_path / "skills"
765
+ _legacy_install(stubs / "dv-alpha")
766
+ skill_catalog.save_state({"target": str(stubs), "stubs": [{"id": "id-a", "dir_name": "dv-alpha"}]}, state_path)
767
+ monkeypatch.setattr(skill_catalog, "CATALOG_STATE_FILE", state_path)
768
+
769
+ store = tmp_path / "store" / "id-a"
770
+ (store / "scripts").mkdir(parents=True)
771
+ (store / "scripts" / "run.py").write_text("print('newer')\n")
772
+
773
+ assert skill_catalog.migrate_legacy_bundle("id-a", {"title": "Alpha"}, store) == []
774
+ assert (store / "scripts" / "run.py").read_text() == "print('newer')\n"
775
+
776
+
777
+ def test_ensure_skill_bundle_migrates_instead_of_redownloading(tmp_path: Path, monkeypatch):
778
+ """A legacy install must be adopted, not fetched again."""
779
+ from deepvista_cli import bundle
780
+
781
+ state_path = tmp_path / "state.json"
782
+ stubs = tmp_path / "skills"
783
+ _legacy_install(stubs / "dv-alpha")
784
+ skill_catalog.save_state({"target": str(stubs), "stubs": [{"id": "id-a", "dir_name": "dv-alpha"}]}, state_path)
785
+ monkeypatch.setattr(skill_catalog, "CATALOG_STATE_FILE", state_path)
786
+ monkeypatch.setenv("DEEPVISTA_BUNDLE_DIR", str(tmp_path / "store"))
787
+
788
+ sha = _sha("print('hi')\n")
789
+ body = f'---\nname: alpha\nfiles:\n - path: scripts/run.py\n sha256: {sha}\n mode: "755"\n---\n\n# Alpha\n'
790
+
791
+ class NoFetchClient:
792
+ def post(self, path, body=None):
793
+ raise AssertionError(f"unexpected POST {path}")
794
+
795
+ def get(self, path, params=None):
796
+ raise AssertionError(f"unexpected download: {path} {params}")
797
+
798
+ root = skill_catalog.ensure_skill_bundle(NoFetchClient(), "id-a", {"id": "id-a", "title": "Alpha", "content": body})
799
+
800
+ assert root == tmp_path / "store" / "id-a"
801
+ assert (root / "scripts" / "run.py").read_text() == "print('hi')\n"
802
+ assert bundle.read_marker(root).get("bundle_sha")
803
+
804
+
805
+ def test_a_wiped_plugin_dir_does_not_touch_the_store(tmp_path: Path, monkeypatch):
806
+ """The upgrade scenario the store exists for.
807
+
808
+ The marketplace updater deletes the whole version-pinned plugin dir, so there
809
+ is no old location for a migration to read — the bundle only survives because
810
+ it was never in there.
811
+ """
812
+ import shutil as _shutil
813
+
814
+ from deepvista_cli import bundle
815
+
816
+ state_path = tmp_path / "state.json"
817
+ plugin_v1 = tmp_path / "plugin" / "4.3.0" / "skills"
818
+ store = tmp_path / "store" / "id-a"
819
+
820
+ fake1 = FakeClient()
821
+ _enqueue_list(fake1, [{"id": "id-a", "title": "Alpha", "description": ""}])
822
+ skill_catalog.sync_catalog(fake1, target=plugin_v1, prefix="dv-", state_path=state_path, throttle_min=0)
823
+
824
+ # Bundle installed into the store, not the stub dir.
825
+ (store / "scripts").mkdir(parents=True)
826
+ (store / "scripts" / "run.py").write_text("print('hi')\n")
827
+ bundle.write_marker(store, [bundle.BundleFile(path="scripts/run.py", sha256=_sha("print('hi')\n"))])
828
+
829
+ # Upgrade: the old plugin version dir is deleted outright, new one appears.
830
+ _shutil.rmtree(tmp_path / "plugin" / "4.3.0")
831
+ plugin_v2 = tmp_path / "plugin" / "4.4.0" / "skills"
832
+
833
+ fake2 = FakeClient()
834
+ _enqueue_list(fake2, [{"id": "id-a", "title": "Alpha", "description": ""}])
835
+ skill_catalog.sync_catalog(fake2, target=plugin_v2, prefix="dv-", state_path=state_path, throttle_min=0)
836
+
837
+ assert (plugin_v2 / "dv-alpha" / "SKILL.md").exists()
838
+ assert (store / "scripts" / "run.py").read_text() == "print('hi')\n"
@@ -56,7 +56,7 @@ wheels = [
56
56
 
57
57
  [[package]]
58
58
  name = "deepvista-cli"
59
- version = "4.4.0"
59
+ version = "4.4.1"
60
60
  source = { editable = "." }
61
61
  dependencies = [
62
62
  { name = "click" },
@@ -1,3 +0,0 @@
1
- {
2
- ".": "4.4.0"
3
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes