deepvista-cli 3.2.0__tar.gz → 4.0.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 (94) hide show
  1. deepvista_cli-4.0.0/.release-please-manifest.json +3 -0
  2. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/CHANGELOG.md +22 -0
  3. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/PKG-INFO +1 -1
  4. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/deepvista_cli/client/http.py +90 -34
  5. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/deepvista_cli/commands/card.py +12 -20
  6. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/deepvista_cli/commands/schedule.py +63 -51
  7. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/deepvista_cli/commands/skill.py +1 -1
  8. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/deepvista_cli/commands/tasks.py +21 -8
  9. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/deepvista_cli/session_note.py +4 -10
  10. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/deepvista_cli/skill_catalog.py +3 -9
  11. deepvista_cli-4.0.0/deepvista_cli/utils.py +23 -0
  12. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/plugins/claude-code/.claude-plugin/plugin.json +1 -1
  13. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/pyproject.toml +1 -1
  14. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/skills/deepvista/SKILL.md +1 -1
  15. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/skills/deepvista/reference/openclaw.md +15 -3
  16. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/skills/deepvista/reference/skill-analyze-notes.md +2 -2
  17. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/skills/deepvista/reference/skill-create-from-note.md +1 -1
  18. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/skills/deepvista/reference/vistabase-card.md +10 -7
  19. deepvista_cli-4.0.0/tests/test_http_client_retry.py +104 -0
  20. deepvista_cli-4.0.0/tests/test_schedule_commands.py +204 -0
  21. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/tests/test_tasks_commands.py +59 -0
  22. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/uv.lock +1 -1
  23. deepvista_cli-3.2.0/.release-please-manifest.json +0 -3
  24. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/.claude-plugin/marketplace.json +0 -0
  25. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/.github/workflows/ci.yml +0 -0
  26. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/.github/workflows/publish.yml +0 -0
  27. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/.github/workflows/release-please.yml +0 -0
  28. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/.gitignore +0 -0
  29. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/.pre-commit-config.yaml +0 -0
  30. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/CLAUDE.md +0 -0
  31. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/CONTRIBUTING.md +0 -0
  32. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/LICENSE +0 -0
  33. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/README.md +0 -0
  34. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/deepvista_cli/__init__.py +0 -0
  35. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/deepvista_cli/auth/__init__.py +0 -0
  36. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/deepvista_cli/auth/callback_server.py +0 -0
  37. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/deepvista_cli/auth/login.py +0 -0
  38. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/deepvista_cli/auth/tokens.py +0 -0
  39. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/deepvista_cli/client/__init__.py +0 -0
  40. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/deepvista_cli/client/origin.py +0 -0
  41. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/deepvista_cli/commands/__init__.py +0 -0
  42. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/deepvista_cli/commands/agents.py +0 -0
  43. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/deepvista_cli/commands/auth.py +0 -0
  44. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/deepvista_cli/commands/chat.py +0 -0
  45. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/deepvista_cli/commands/config.py +0 -0
  46. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/deepvista_cli/commands/notes.py +0 -0
  47. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/deepvista_cli/commands/project.py +0 -0
  48. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/deepvista_cli/commands/session.py +0 -0
  49. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/deepvista_cli/commands/upgrade.py +0 -0
  50. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/deepvista_cli/config.py +0 -0
  51. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/deepvista_cli/main.py +0 -0
  52. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/deepvista_cli/output/__init__.py +0 -0
  53. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/deepvista_cli/output/formatter.py +0 -0
  54. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/deepvista_cli/resources/__init__.py +0 -0
  55. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/deepvista_cli/resources/workflow_host_runtime.md +0 -0
  56. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/deepvista_cli/workflow_doc.py +0 -0
  57. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/docs/assets/deepvista-banner.png +0 -0
  58. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/install.ps1 +0 -0
  59. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/install.sh +0 -0
  60. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/plugins/README.md +0 -0
  61. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/plugins/claude-code/README.md +0 -0
  62. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/plugins/claude-code/commands/deepvista.md +0 -0
  63. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/plugins/claude-code/commands/refresh-skills.md +0 -0
  64. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/plugins/claude-code/hooks/hooks.json +0 -0
  65. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/plugins/claude-code/scripts/deepvista-agent-sync.sh +0 -0
  66. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/plugins/claude-code/scripts/deepvista-session-end.sh +0 -0
  67. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/plugins/claude-code/scripts/deepvista-session-start.sh +0 -0
  68. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/plugins/claude-code/scripts/deepvista-session-turn.sh +0 -0
  69. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/plugins/claude-code/scripts/deepvista-skill-url.py +0 -0
  70. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/plugins/claude-code/scripts/deepvista-sync.sh +0 -0
  71. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/plugins/claude-code/skills/.gitignore +0 -0
  72. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/plugins/claude-code/skills/install-deepvista-cli/SKILL.md +0 -0
  73. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/release-please-config.json +0 -0
  74. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/scripts/check_plugin_version.py +0 -0
  75. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/skills/deepvista/reference/chat.md +0 -0
  76. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/skills/deepvista/reference/notes.md +0 -0
  77. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/skills/deepvista/reference/project.md +0 -0
  78. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/skills/deepvista/reference/session.md +0 -0
  79. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/skills/deepvista/reference/shared.md +0 -0
  80. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/skills/deepvista/reference/skill-import-files.md +0 -0
  81. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/skills/deepvista/reference/skill-research-to-skill.md +0 -0
  82. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/skills/deepvista/reference/skill.md +0 -0
  83. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/skills/deepvista/reference/tasks.md +0 -0
  84. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/skills/dv-workflow/SKILL.md +0 -0
  85. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/tests/__init__.py +0 -0
  86. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/tests/test_agent_id_tagging.py +0 -0
  87. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/tests/test_card_comment_commands.py +0 -0
  88. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/tests/test_entry_points.py +0 -0
  89. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/tests/test_project_commands.py +0 -0
  90. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/tests/test_session_note_format.py +0 -0
  91. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/tests/test_skill_catalog.py +0 -0
  92. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/tests/test_skill_commands.py +0 -0
  93. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/tests/test_workflow_doc_phases.py +0 -0
  94. {deepvista_cli-3.2.0 → deepvista_cli-4.0.0}/uninstall.sh +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "4.0.0"
3
+ }
@@ -46,6 +46,28 @@ 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.0.0](https://github.com/DeepVista-AI/deepvista-cli/compare/v3.2.0...v4.0.0) (2026-07-14)
50
+
51
+
52
+ ### ⚠ BREAKING CHANGES
53
+
54
+ * **DV-1078:** replace +grep with +search-content hybrid search ([#207](https://github.com/DeepVista-AI/deepvista-cli/issues/207))
55
+
56
+ ### Features
57
+
58
+ * **DV-1078:** replace +grep with +search-content hybrid search ([#207](https://github.com/DeepVista-AI/deepvista-cli/issues/207)) ([9813a55](https://github.com/DeepVista-AI/deepvista-cli/commit/9813a555408fe0a0a66cd8328b4df2bf778c7cdc))
59
+
60
+
61
+ ### Bug Fixes
62
+
63
+ * **DV-1529:** add exponential backoff retry for transient network errors ([#200](https://github.com/DeepVista-AI/deepvista-cli/issues/200)) ([3e2fd79](https://github.com/DeepVista-AI/deepvista-cli/commit/3e2fd790cf4c3bd2b76e9992dd90dcc52d1bf60a))
64
+ * **DV-1537:** match deepvista-cli schedule commands on job kind, not title ([#201](https://github.com/DeepVista-AI/deepvista-cli/issues/201)) ([22f2fc1](https://github.com/DeepVista-AI/deepvista-cli/commit/22f2fc1305ec7806eb00425cb2c3dcceaf32b476))
65
+
66
+
67
+ ### Documentation
68
+
69
+ * **DV-1367:** correct stale dedup claim in openclaw.md ([#202](https://github.com/DeepVista-AI/deepvista-cli/issues/202)) ([79d5dab](https://github.com/DeepVista-AI/deepvista-cli/commit/79d5dab4fbc361a3c1535d8c9d6606b309e9edf0))
70
+
49
71
  ## [3.2.0](https://github.com/DeepVista-AI/deepvista-cli/compare/v3.1.0...v3.2.0) (2026-07-13)
50
72
 
51
73
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deepvista-cli
3
- Version: 3.2.0
3
+ Version: 4.0.0
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
@@ -12,9 +12,11 @@ from __future__ import annotations
12
12
 
13
13
  import json
14
14
  import logging
15
+ import random
15
16
  import sys
16
17
  import threading
17
- from collections.abc import Iterator
18
+ import time
19
+ from collections.abc import Callable, Iterator
18
20
  from typing import Any, NoReturn
19
21
 
20
22
  import click
@@ -26,6 +28,15 @@ from deepvista_cli.config import EXIT_API_ERROR, EXIT_AUTH_ERROR, EXIT_NETWORK_E
26
28
 
27
29
  logger = logging.getLogger(__name__)
28
30
 
31
+ # Retry transient network errors (server offline / request timed out) with
32
+ # exponential backoff before treating them as fatal (DV-1529). A single blip
33
+ # used to kill an hours-long `tasks run` poll loop outright.
34
+ NETWORK_RETRY_ATTEMPTS = 5
35
+ NETWORK_RETRY_BASE_DELAY = 1.0
36
+ NETWORK_RETRY_MAX_DELAY = 30.0
37
+ NETWORK_RETRY_BACKOFF_FACTOR = 2.0
38
+ NETWORK_RETRY_JITTER = 0.2
39
+
29
40
 
30
41
  class DeepVistaClient:
31
42
  """HTTP client for the DeepVista backend API."""
@@ -94,6 +105,31 @@ class DeepVistaClient:
94
105
  if self.config.verbose:
95
106
  click.echo(f"<<< {resp.status_code}", err=True)
96
107
 
108
+ def _call_with_retry(self, send: Callable[[], httpx.Response]) -> httpx.Response:
109
+ """Call `send()`, retrying transient network errors with exponential backoff.
110
+
111
+ Re-raises the last `httpx.ConnectError`/`httpx.TimeoutException` once
112
+ `NETWORK_RETRY_ATTEMPTS` is exhausted, so callers keep handling it the
113
+ same way they always have (see `_handle_network_error`).
114
+ """
115
+ for attempt in range(NETWORK_RETRY_ATTEMPTS):
116
+ try:
117
+ return send()
118
+ except (httpx.ConnectError, httpx.TimeoutException):
119
+ if attempt == NETWORK_RETRY_ATTEMPTS - 1:
120
+ raise
121
+ delay = min(
122
+ NETWORK_RETRY_BASE_DELAY * (NETWORK_RETRY_BACKOFF_FACTOR**attempt),
123
+ NETWORK_RETRY_MAX_DELAY,
124
+ )
125
+ delay *= 1 + random.uniform(-NETWORK_RETRY_JITTER, NETWORK_RETRY_JITTER)
126
+ click.echo(
127
+ f"... network error, retrying in {delay:.1f}s (attempt {attempt + 2}/{NETWORK_RETRY_ATTEMPTS})",
128
+ err=True,
129
+ )
130
+ time.sleep(delay)
131
+ raise AssertionError("unreachable") # loop always returns or raises
132
+
97
133
  def _handle_network_error(self, exc: httpx.ConnectError | httpx.TimeoutException) -> NoReturn:
98
134
  """Handle network-level errors with structured output."""
99
135
  if isinstance(exc, httpx.ConnectError):
@@ -142,19 +178,22 @@ class DeepVistaClient:
142
178
  )
143
179
  sys.exit(0)
144
180
 
181
+ def send() -> httpx.Response:
182
+ client = self._get_client()
183
+ if method == "GET":
184
+ return client.get(path, headers=headers, params=params)
185
+ elif method == "POST":
186
+ return client.post(path, headers=headers, json=body or {})
187
+ elif method == "PATCH":
188
+ return client.patch(path, headers=headers, json=body or {})
189
+ elif method == "DELETE":
190
+ return client.delete(path, headers=headers, params=params)
191
+ else:
192
+ raise ValueError(f"Unsupported method: {method}")
193
+
145
194
  with self._lock:
146
195
  try:
147
- client = self._get_client()
148
- if method == "GET":
149
- resp = client.get(path, headers=headers, params=params)
150
- elif method == "POST":
151
- resp = client.post(path, headers=headers, json=body or {})
152
- elif method == "PATCH":
153
- resp = client.patch(path, headers=headers, json=body or {})
154
- elif method == "DELETE":
155
- resp = client.delete(path, headers=headers, params=params)
156
- else:
157
- raise ValueError(f"Unsupported method: {method}")
196
+ resp = self._call_with_retry(send)
158
197
  except (httpx.ConnectError, httpx.TimeoutException) as exc:
159
198
  self._handle_network_error(exc)
160
199
 
@@ -189,8 +228,7 @@ class DeepVistaClient:
189
228
  sys.exit(0)
190
229
  with self._lock:
191
230
  try:
192
- client = self._get_client()
193
- resp = client.post(path, headers=headers, json=body or {})
231
+ resp = self._call_with_retry(lambda: self._get_client().post(path, headers=headers, json=body or {}))
194
232
  except (httpx.ConnectError, httpx.TimeoutException) as exc:
195
233
  self._handle_network_error(exc)
196
234
  self._log_response(resp)
@@ -224,29 +262,47 @@ class DeepVistaClient:
224
262
 
225
263
  client = self._get_client()
226
264
 
265
+ # Only the initial connect is retried — once the stream is open, a
266
+ # ConnectError/TimeoutException mid-read means events may already
267
+ # have been yielded, so blindly retrying would risk replaying them.
268
+ opened: list[Any] = []
269
+
270
+ def open_stream() -> httpx.Response:
271
+ stream_cm = client.stream("POST", path, json=body or {}, headers=headers, timeout=300)
272
+ resp = stream_cm.__enter__()
273
+ opened.append(stream_cm)
274
+ return resp
275
+
227
276
  try:
228
- with client.stream("POST", path, json=body or {}, headers=headers, timeout=300) as resp:
229
- self._log_response(resp)
230
- if resp.status_code >= 400:
231
- resp.read()
232
- self._handle_error(resp)
233
-
234
- buffer = ""
235
- for chunk in resp.iter_text():
236
- buffer += chunk
237
- while "\n" in buffer:
238
- line, buffer = buffer.split("\n", 1)
239
- line = line.strip()
240
- if line.startswith("data: "):
241
- data_str = line[6:]
242
- if data_str == "[DONE]":
243
- return
244
- try:
245
- yield json.loads(data_str)
246
- except json.JSONDecodeError:
247
- logger.debug("Skipping non-JSON SSE line: %s", data_str)
277
+ resp = self._call_with_retry(open_stream)
278
+ except (httpx.ConnectError, httpx.TimeoutException) as exc:
279
+ self._handle_network_error(exc)
280
+
281
+ stream_cm = opened[-1]
282
+ try:
283
+ self._log_response(resp)
284
+ if resp.status_code >= 400:
285
+ resp.read()
286
+ self._handle_error(resp)
287
+
288
+ buffer = ""
289
+ for chunk in resp.iter_text():
290
+ buffer += chunk
291
+ while "\n" in buffer:
292
+ line, buffer = buffer.split("\n", 1)
293
+ line = line.strip()
294
+ if line.startswith("data: "):
295
+ data_str = line[6:]
296
+ if data_str == "[DONE]":
297
+ return
298
+ try:
299
+ yield json.loads(data_str)
300
+ except json.JSONDecodeError:
301
+ logger.debug("Skipping non-JSON SSE line: %s", data_str)
248
302
  except (httpx.ConnectError, httpx.TimeoutException) as exc:
249
303
  self._handle_network_error(exc)
304
+ finally:
305
+ stream_cm.__exit__(None, None, None)
250
306
 
251
307
  def close(self) -> None:
252
308
  if self._client:
@@ -13,7 +13,7 @@ Endpoints:
13
13
  POST /create_context_card -> create
14
14
  POST /update_context_card -> update
15
15
  POST /edit_context_card -> targeted string replacement (file-ops Edit)
16
- POST /grep_context_cards -> regex content search (file-ops Grep)
16
+ POST /search_context_cards -> hybrid tsvector + embedding content search
17
17
  DELETE /context_cards/{id} -> delete
18
18
  POST /list_card_comments -> list a card's comments (DV-1308)
19
19
  POST /create_card_comment -> add a comment to a card
@@ -662,42 +662,34 @@ def card_archive(ctx: click.Context, card_id: str, dry_run: bool) -> None:
662
662
  )
663
663
 
664
664
 
665
- @card_group.command("+grep")
666
- @click.argument("pattern")
665
+ @card_group.command("+search-content")
666
+ @click.argument("query", required=False, default="")
667
667
  @click.option("--type", "card_type", type=click.Choice(CARD_TYPES, case_sensitive=False), default=None)
668
- @click.option("-i", "--ignore-case", is_flag=True, default=False, help="Case-insensitive matching.")
669
668
  @click.option("--limit", default=20, help="Max cards to return (default 20).")
670
- @click.option("-C", "--context", "context_lines", default=0, type=int, help="Lines of context around each match.")
671
669
  @click.pass_context
672
- def card_grep(
670
+ def card_search_content(
673
671
  ctx: click.Context,
674
- pattern: str,
672
+ query: str,
675
673
  card_type: str | None,
676
- ignore_case: bool,
677
674
  limit: int,
678
- context_lines: int,
679
675
  ) -> None:
680
- """Regex search through card content. Returns matching lines with line numbers.
676
+ """Hybrid full-text + semantic search, ranked by combined score.
681
677
 
682
- Different from +search (semantic/keyword) — this does literal/regex matching
683
- on card content, like grep or ripgrep.
678
+ Different from +search — this ranks against card content (not just
679
+ title/keywords) via the search_vector + embedding hybrid. Omit query
680
+ to browse cards of --type, most-recently-updated first.
684
681
 
685
682
  Read-only — never modifies your knowledge base.
686
683
  """
687
- body: dict = {
688
- "pattern": pattern,
689
- "case_insensitive": ignore_case,
690
- "limit": limit,
691
- "context_lines": context_lines,
692
- }
684
+ body: dict = {"query": query, "limit": limit}
693
685
  if card_type:
694
686
  body["card_type"] = card_type
695
687
 
696
- data = _client(ctx).post("/grep_context_cards", body)
688
+ data = _client(ctx).post("/search_context_cards", body)
697
689
  format_output(
698
690
  data,
699
691
  ctx.obj.output_format,
700
- title=f"Grep: {pattern}",
692
+ title=f"Search: {query}" if query else "Browse",
701
693
  entity_type="card",
702
694
  base_url=ctx.obj.auth_url,
703
695
  project_id=ctx.obj.project_id,
@@ -9,6 +9,14 @@ token spend under their control.
9
9
  Under the hood each "activation" is a ``schedule_job`` context card on the
10
10
  server (DV-1166) whose ``prompt`` asks the agent to run the daily-planning
11
11
  skill. The heartbeat dispatcher drains due jobs and runs the agent.
12
+
13
+ Identity + creation are delegated to the server's ``POST /scheduled-jobs/
14
+ activate`` endpoint (DV-1045), keyed on the stable ``kind="daily_planning"``
15
+ attribute rather than a title string — the same endpoint the web Settings /
16
+ Home "Scheduled Job" toggle drives. Matching on ``kind`` (instead of a
17
+ hardcoded title, as this command used to) is what keeps this command and the
18
+ web UI pointed at the same row instead of each silently creating its own
19
+ duplicate (DV-1537).
12
20
  """
13
21
 
14
22
  from __future__ import annotations
@@ -18,13 +26,13 @@ import click
18
26
  from deepvista_cli.client.http import DeepVistaClient
19
27
  from deepvista_cli.output.formatter import format_output, output_error
20
28
 
21
- # The server-side workflow skill that generates the planning note.
22
- DAILY_PLANNING_SKILL = "deepvista-daily-planning"
23
- # Stable title used to find this job again (activate is idempotent on it).
24
- JOB_TITLE = "Daily Planning"
25
- # Cron is evaluated in UTC server-side (no per-user timezone yet — see DV-879).
26
- DEFAULT_DAILY_CRON = "0 8 * * *"
27
- DEFAULT_WEEKLY_CRON = "0 8 * * 1"
29
+ # Stable identifier the server keys the (user_id, kind) upsert on — mirrors
30
+ # ``DAILY_PLANNING_JOB_KIND`` in ai/vista_common/services/scheduled_job_service.py.
31
+ JOB_KIND = "daily_planning"
32
+ # Only used to build a --cron/--weekly override; the server supplies its own
33
+ # canonical cron (currently daily 09:00 in the user's timezone) when neither
34
+ # flag is passed, so there's no local default to duplicate/drift from.
35
+ DEFAULT_WEEKLY_CRON = "0 9 * * 1"
28
36
 
29
37
  # Columns shown in `--format table`.
30
38
  _JOB_COLUMNS = ["id", "title", "cron_schedule", "enabled", "next_run_at", "last_run_at"]
@@ -37,12 +45,14 @@ def _client(ctx: click.Context) -> DeepVistaClient:
37
45
  def _find_daily_planning_job(ctx: click.Context) -> dict | None:
38
46
  """Return the existing daily-planning job for this user, or None.
39
47
 
40
- Matches on the stable ``JOB_TITLE`` so repeated activations re-use the same
41
- row instead of stacking duplicates.
48
+ Matches on the stable ``kind`` attribute (DV-1045) — the same field the
49
+ server's ``(user_id, kind)`` upsert is keyed on — so this reliably finds
50
+ the same row the server's activate endpoint would touch, regardless of
51
+ what title the row happens to carry.
42
52
  """
43
53
  data = _client(ctx).get("/scheduled-jobs")
44
54
  for job in data.get("jobs", []):
45
- if job.get("title") == JOB_TITLE:
55
+ if job.get("kind") == JOB_KIND:
46
56
  return job
47
57
  return None
48
58
 
@@ -53,58 +63,60 @@ def schedule_group() -> None:
53
63
 
54
64
 
55
65
  @schedule_group.command("activate")
56
- @click.option("--cron", "cron_schedule", default=None, help="5-field cron in UTC (default: daily 08:00 UTC).")
57
- @click.option("--weekly", is_flag=True, default=False, help="Run weekly (Mon 08:00 UTC) instead of daily.")
66
+ @click.option(
67
+ "--cron",
68
+ "cron_schedule",
69
+ default=None,
70
+ help="5-field cron override (default: the server's canonical daily cadence).",
71
+ )
72
+ @click.option(
73
+ "--weekly",
74
+ is_flag=True,
75
+ default=False,
76
+ help="Run weekly (Mon 09:00) instead of the server default (daily).",
77
+ )
58
78
  @click.pass_context
59
79
  def schedule_activate(ctx: click.Context, cron_schedule: str | None, weekly: bool) -> None:
60
80
  """Activate the recurring daily-planning job.
61
81
 
62
82
  Idempotent: if a daily-planning job already exists it is re-enabled rather
63
- than duplicated. To change the cron of an existing job, deactivate + delete
64
- it first, then activate again with a new --cron.
83
+ than duplicated (the server upserts on ``kind``, keyed the same way the web
84
+ Settings / Home "Scheduled Job" toggle activates it — see DV-1537). Without
85
+ --cron/--weekly the server's own canonical prompt + cadence are used; pass
86
+ either flag to override the cadence on top of that.
65
87
  """
66
- cadence = "weekly" if weekly else "daily"
67
- if cron_schedule is None:
68
- cron_schedule = DEFAULT_WEEKLY_CRON if weekly else DEFAULT_DAILY_CRON
69
-
88
+ cron_override = cron_schedule or (DEFAULT_WEEKLY_CRON if weekly else None)
70
89
  existing = _find_daily_planning_job(ctx)
71
- if existing is not None:
72
- if existing.get("enabled"):
73
- format_output(
74
- {"status": "already_active", "job": existing},
75
- ctx.obj.output_format,
76
- title="Daily planning already active",
77
- )
78
- return
79
- resp = _client(ctx).patch(f"/scheduled-jobs/{existing['id']}", {"enabled": True})
90
+
91
+ if existing is not None and existing.get("enabled") and cron_override is None:
80
92
  format_output(
81
- {"status": "reactivated", "job": resp.get("job", resp)},
93
+ {"status": "already_active", "job": existing},
82
94
  ctx.obj.output_format,
83
- title="Daily planning reactivated",
95
+ title="Daily planning already active",
84
96
  )
85
97
  return
86
98
 
87
- prompt = (
88
- f"Run the {DAILY_PLANNING_SKILL} skill to generate today's daily "
89
- f"planning note (cadence: {cadence}). List the workflow Skills that "
90
- f"should run today as context-card chips in the note's Planning section."
91
- )
92
- resp = _client(ctx).post(
93
- "/scheduled-jobs",
94
- {
95
- "prompt": prompt,
96
- "cron_schedule": cron_schedule,
97
- "title": JOB_TITLE,
98
- "enabled": True,
99
- },
100
- )
99
+ resp = _client(ctx).post("/scheduled-jobs/activate", {"kind": JOB_KIND})
101
100
  if not resp.get("success"):
102
101
  output_error(1, "Failed to activate daily planning", resp.get("error", ""))
103
- format_output(
104
- {"status": "activated", "cadence": cadence, "job": resp.get("job", resp)},
105
- ctx.obj.output_format,
106
- title="Daily planning activated",
107
- )
102
+ return
103
+ job = resp.get("job") or {}
104
+
105
+ if cron_override is not None and job.get("cron_schedule") != cron_override:
106
+ patch_resp = _client(ctx).patch(f"/scheduled-jobs/{job['id']}", {"cron_schedule": cron_override})
107
+ if not patch_resp.get("success"):
108
+ output_error(1, "Activated but failed to set the requested cron", patch_resp.get("error", ""))
109
+ return
110
+ job = patch_resp.get("job", job)
111
+
112
+ if existing is None:
113
+ status, title = "activated", "Daily planning activated"
114
+ elif not existing.get("enabled"):
115
+ status, title = "reactivated", "Daily planning reactivated"
116
+ else:
117
+ status, title = "updated", "Daily planning schedule updated"
118
+
119
+ format_output({"status": status, "job": job}, ctx.obj.output_format, title=title)
108
120
 
109
121
 
110
122
  @schedule_group.command("deactivate")
@@ -149,9 +161,9 @@ def schedule_list(ctx: click.Context) -> None:
149
161
  def schedule_delete(ctx: click.Context, job_id: str | None) -> None:
150
162
  """Delete a scheduled job permanently.
151
163
 
152
- With no JOB_ID, deletes the daily-planning job. Use this (then ``activate``)
153
- to change a job's cron, which PATCH can't edit. Pass ``--dry-run`` on the
154
- root command to preview without deleting.
164
+ With no JOB_ID, deletes the daily-planning job. To change its cadence
165
+ instead, use ``activate --cron``/``--weekly``, which patches it in place.
166
+ Pass ``--dry-run`` on the root command to preview without deleting.
155
167
  """
156
168
  if job_id is None:
157
169
  existing = _find_daily_planning_job(ctx)
@@ -781,7 +781,7 @@ def skill_create_from_note(
781
781
  """Synthesize a workflow skill from one or more notes via the DeepVista agent.
782
782
 
783
783
  Pass note UUIDs positionally or via repeated `--note-id`. To find source
784
- notes first, use `deepvista card +search` / `+grep` / `+similar` and pass
784
+ notes first, use `deepvista card +search` / `+search-content` / `+similar` and pass
785
785
  the resulting IDs here. The agent produces one `workflow` skill (executable
786
786
  steps), grounded in the union of all source notes and linked back to
787
787
  every source.
@@ -42,7 +42,7 @@ from deepvista_cli.commands.agents import (
42
42
  resolve_or_register_machine,
43
43
  )
44
44
  from deepvista_cli.commands.project import _projects
45
- from deepvista_cli.config import CONFIG_DIR, credentials_path
45
+ from deepvista_cli.config import CONFIG_DIR, EXIT_NETWORK_ERROR, credentials_path
46
46
  from deepvista_cli.output.formatter import format_output, output_error
47
47
 
48
48
  # Reported output is truncated to a tail (mirrors the backend cap on task cards).
@@ -1051,13 +1051,26 @@ def tasks_run(
1051
1051
  try:
1052
1052
  while True:
1053
1053
  polls += 1
1054
- agents = _refresh_agents_for_poll(
1055
- ctx,
1056
- agents,
1057
- project_names,
1058
- agent_type=agent_type,
1059
- )
1060
- submitted = _claim_and_submit_all(ctx, agents, executor)
1054
+ try:
1055
+ agents = _refresh_agents_for_poll(
1056
+ ctx,
1057
+ agents,
1058
+ project_names,
1059
+ agent_type=agent_type,
1060
+ )
1061
+ submitted = _claim_and_submit_all(ctx, agents, executor)
1062
+ except SystemExit as exc:
1063
+ # A network error survives the HTTP client's own retries only
1064
+ # when the outage outlasts them. Don't let one bad poll kill an
1065
+ # hours-long `tasks run` job (DV-1529) — log it and try again
1066
+ # next interval. `run_once` keeps the old fail-fast behavior.
1067
+ if run_once or exc.code != EXIT_NETWORK_ERROR:
1068
+ raise
1069
+ click.echo(
1070
+ f" [warn] poll #{polls}: network error persisted after retries, skipping this poll",
1071
+ err=True,
1072
+ )
1073
+ submitted = 0
1061
1074
 
1062
1075
  results = executor.drain_completed()
1063
1076
  total_results.extend(results)
@@ -27,6 +27,8 @@ from datetime import UTC, datetime
27
27
  from pathlib import Path
28
28
  from typing import Any
29
29
 
30
+ from deepvista_cli.utils import load_json_state, save_json_state
31
+
30
32
  # ---------------------------------------------------------------------------
31
33
  # Constants
32
34
  # ---------------------------------------------------------------------------
@@ -64,19 +66,11 @@ def state_path(session_id: str) -> Path:
64
66
 
65
67
 
66
68
  def load_state(session_id: str) -> dict[str, Any]:
67
- path = state_path(session_id)
68
- if not path.exists():
69
- return {}
70
- try:
71
- return json.loads(path.read_text())
72
- except (OSError, json.JSONDecodeError):
73
- return {}
69
+ return load_json_state(state_path(session_id))
74
70
 
75
71
 
76
72
  def save_state(session_id: str, state: dict[str, Any]) -> None:
77
- path = state_path(session_id)
78
- path.parent.mkdir(parents=True, exist_ok=True)
79
- path.write_text(json.dumps(state, indent=2))
73
+ save_json_state(state_path(session_id), state)
80
74
 
81
75
 
82
76
  # ---------------------------------------------------------------------------
@@ -23,7 +23,6 @@ with Click. Tests target the functions here directly.
23
23
  from __future__ import annotations
24
24
 
25
25
  import hashlib
26
- import json
27
26
  import re
28
27
  import shutil
29
28
  import time
@@ -33,6 +32,7 @@ from pathlib import Path
33
32
  from typing import Any, Protocol
34
33
 
35
34
  from deepvista_cli.config import CONFIG_DIR
35
+ from deepvista_cli.utils import load_json_state, save_json_state
36
36
 
37
37
  # ---------------------------------------------------------------------------
38
38
  # Defaults & constants
@@ -216,18 +216,12 @@ def stub_content_hash(markdown: str) -> str:
216
216
 
217
217
  def load_state(path: Path = CATALOG_STATE_FILE) -> dict[str, Any]:
218
218
  """Load the last-sync state. Returns {} when missing or corrupt."""
219
- if not path.exists():
220
- return {}
221
- try:
222
- return json.loads(path.read_text(encoding="utf-8"))
223
- except (OSError, json.JSONDecodeError):
224
- return {}
219
+ return load_json_state(path)
225
220
 
226
221
 
227
222
  def save_state(state: dict[str, Any], path: Path = CATALOG_STATE_FILE) -> None:
228
223
  """Persist the sync state. Creates parent dirs on demand."""
229
- path.parent.mkdir(parents=True, exist_ok=True)
230
- path.write_text(json.dumps(state, indent=2), encoding="utf-8")
224
+ save_json_state(path, state)
231
225
 
232
226
 
233
227
  # ---------------------------------------------------------------------------
@@ -0,0 +1,23 @@
1
+ """Small helpers shared across catalog/session modules."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import json
6
+ from pathlib import Path
7
+ from typing import Any
8
+
9
+
10
+ def load_json_state(path: Path) -> dict[str, Any]:
11
+ """Load JSON state from ``path``. Returns ``{}`` when missing or corrupt."""
12
+ if not path.exists():
13
+ return {}
14
+ try:
15
+ return json.loads(path.read_text(encoding="utf-8"))
16
+ except (OSError, json.JSONDecodeError):
17
+ return {}
18
+
19
+
20
+ def save_json_state(path: Path, data: dict[str, Any]) -> None:
21
+ """Persist JSON state to ``path``, creating parent dirs on demand."""
22
+ path.parent.mkdir(parents=True, exist_ok=True)
23
+ path.write_text(json.dumps(data, indent=2), encoding="utf-8")
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepvista",
3
- "version": "3.2.0",
3
+ "version": "4.0.0",
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 = "3.2.0"
3
+ version = "4.0.0"
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" }
@@ -120,7 +120,7 @@ If the source material isn't yet a DeepVista note, capture it first
120
120
  3. **Use `--content-file` for non-trivial content.** Never paste large content,
121
121
  files, or URLs inline — pass `--content-file <absolute-path>` (or `--content-file -`
122
122
  to read from stdin) so the exact bytes are stored.
123
- 4. **Read-only commands are safe.** `list`, `get`, `+search`, `+grep`, `+similar`,
123
+ 4. **Read-only commands are safe.** `list`, `get`, `+search`, `+search-content`, `+similar`,
124
124
  `show`, `history`, `diff`, `status` — run without confirmation.
125
125
  5. **Check `--help` for exact flags.** When you need exact flag syntax or available options,
126
126
  run `deepvista <subcommand> --help` rather than guessing from memory.
@@ -84,13 +84,25 @@ deepvista auth status
84
84
  If unauthenticated, prompt the user to run `deepvista auth login` — don't try to
85
85
  capture silently into a broken auth state.
86
86
 
87
- ## Optional — heartbeat / dedup
87
+ ## Optional — heartbeat
88
88
 
89
89
  If the user runs `deepvista agents sync --type openclaw` once (it auto-registers
90
- on first run), the CLI will heartbeat after each agent turn and the server will
91
- flag near-duplicate captures during periodic maintenance. Set up is one-time;
90
+ on first run), the CLI will heartbeat after each agent turn. Set up is one-time;
92
91
  not required for capture to work.
93
92
 
93
+ ## Duplicate captures (DV-1367)
94
+
95
+ The server blocks exact/near-duplicate person and organization cards at write
96
+ time (title match or high embedding similarity creates an update instead of a
97
+ new card), but that's a safety net, not a substitute for good capture
98
+ discipline — it can still miss a duplicate that's phrased differently enough.
99
+ When capturing a person or organization, prefer
100
+ `deepvista card +search "<name>" --type person` (or `--type organization`)
101
+ first and reuse an existing card instead of creating a new one for the same
102
+ entity. Any duplicates that do slip through can be resolved later via
103
+ Vistabase's manual "Merge duplicate" card action — there is no automatic
104
+ background cleanup (yet).
105
+
94
106
  ## See also
95
107
 
96
108
  - [vistabase-card.md](vistabase-card.md) — the underlying `card create` command and full `--type` list