deepvista-cli 3.1.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.
- deepvista_cli-4.0.0/.release-please-manifest.json +3 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/CHANGELOG.md +34 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/PKG-INFO +2 -2
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/deepvista_cli/client/http.py +90 -34
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/deepvista_cli/commands/card.py +180 -20
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/deepvista_cli/commands/schedule.py +63 -51
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/deepvista_cli/commands/skill.py +1 -1
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/deepvista_cli/commands/tasks.py +21 -8
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/deepvista_cli/session_note.py +4 -10
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/deepvista_cli/skill_catalog.py +3 -9
- deepvista_cli-4.0.0/deepvista_cli/utils.py +23 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/plugins/claude-code/.claude-plugin/plugin.json +1 -1
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/pyproject.toml +2 -2
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/skills/deepvista/SKILL.md +1 -1
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/skills/deepvista/reference/notes.md +5 -2
- deepvista_cli-4.0.0/skills/deepvista/reference/openclaw.md +110 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/skills/deepvista/reference/skill-analyze-notes.md +2 -2
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/skills/deepvista/reference/skill-create-from-note.md +1 -1
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/skills/deepvista/reference/vistabase-card.md +24 -8
- deepvista_cli-4.0.0/tests/test_card_comment_commands.py +117 -0
- deepvista_cli-4.0.0/tests/test_http_client_retry.py +104 -0
- deepvista_cli-4.0.0/tests/test_schedule_commands.py +204 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/tests/test_tasks_commands.py +59 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/uv.lock +5 -5
- deepvista_cli-3.1.0/.release-please-manifest.json +0 -3
- deepvista_cli-3.1.0/skills/deepvista/reference/openclaw.md +0 -82
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/.claude-plugin/marketplace.json +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/.github/workflows/ci.yml +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/.github/workflows/publish.yml +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/.github/workflows/release-please.yml +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/.gitignore +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/.pre-commit-config.yaml +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/CLAUDE.md +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/CONTRIBUTING.md +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/LICENSE +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/README.md +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/deepvista_cli/__init__.py +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/deepvista_cli/auth/__init__.py +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/deepvista_cli/auth/callback_server.py +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/deepvista_cli/auth/login.py +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/deepvista_cli/auth/tokens.py +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/deepvista_cli/client/__init__.py +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/deepvista_cli/client/origin.py +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/deepvista_cli/commands/__init__.py +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/deepvista_cli/commands/agents.py +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/deepvista_cli/commands/auth.py +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/deepvista_cli/commands/chat.py +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/deepvista_cli/commands/config.py +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/deepvista_cli/commands/notes.py +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/deepvista_cli/commands/project.py +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/deepvista_cli/commands/session.py +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/deepvista_cli/commands/upgrade.py +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/deepvista_cli/config.py +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/deepvista_cli/main.py +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/deepvista_cli/output/__init__.py +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/deepvista_cli/output/formatter.py +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/deepvista_cli/resources/__init__.py +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/deepvista_cli/resources/workflow_host_runtime.md +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/deepvista_cli/workflow_doc.py +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/docs/assets/deepvista-banner.png +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/install.ps1 +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/install.sh +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/plugins/README.md +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/plugins/claude-code/README.md +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/plugins/claude-code/commands/deepvista.md +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/plugins/claude-code/commands/refresh-skills.md +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/plugins/claude-code/hooks/hooks.json +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/plugins/claude-code/scripts/deepvista-agent-sync.sh +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/plugins/claude-code/scripts/deepvista-session-end.sh +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/plugins/claude-code/scripts/deepvista-session-start.sh +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/plugins/claude-code/scripts/deepvista-session-turn.sh +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/plugins/claude-code/scripts/deepvista-skill-url.py +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/plugins/claude-code/scripts/deepvista-sync.sh +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/plugins/claude-code/skills/.gitignore +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/plugins/claude-code/skills/install-deepvista-cli/SKILL.md +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/release-please-config.json +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/scripts/check_plugin_version.py +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/skills/deepvista/reference/chat.md +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/skills/deepvista/reference/project.md +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/skills/deepvista/reference/session.md +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/skills/deepvista/reference/shared.md +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/skills/deepvista/reference/skill-import-files.md +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/skills/deepvista/reference/skill-research-to-skill.md +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/skills/deepvista/reference/skill.md +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/skills/deepvista/reference/tasks.md +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/skills/dv-workflow/SKILL.md +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/tests/__init__.py +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/tests/test_agent_id_tagging.py +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/tests/test_entry_points.py +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/tests/test_project_commands.py +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/tests/test_session_note_format.py +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/tests/test_skill_catalog.py +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/tests/test_skill_commands.py +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/tests/test_workflow_doc_phases.py +0 -0
- {deepvista_cli-3.1.0 → deepvista_cli-4.0.0}/uninstall.sh +0 -0
|
@@ -46,6 +46,40 @@ 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
|
+
|
|
71
|
+
## [3.2.0](https://github.com/DeepVista-AI/deepvista-cli/compare/v3.1.0...v3.2.0) (2026-07-13)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
### Features
|
|
75
|
+
|
|
76
|
+
* **DV-1496:** expose card comment commands in CLI ([#204](https://github.com/DeepVista-AI/deepvista-cli/issues/204)) ([3551969](https://github.com/DeepVista-AI/deepvista-cli/commit/35519695664c89076fe6785fa1d19c5c6a3846dd))
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
### Bug Fixes
|
|
80
|
+
|
|
81
|
+
* **DV-1484:** reconcile OpenClaw auto-capture with explicit-note rule ([#199](https://github.com/DeepVista-AI/deepvista-cli/issues/199)) ([663d2df](https://github.com/DeepVista-AI/deepvista-cli/commit/663d2df18d775ad2e90cf1db23c17621c0db4469))
|
|
82
|
+
|
|
49
83
|
## [3.1.0](https://github.com/DeepVista-AI/deepvista-cli/compare/v3.0.0...v3.1.0) (2026-07-12)
|
|
50
84
|
|
|
51
85
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: deepvista-cli
|
|
3
|
-
Version:
|
|
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
|
|
@@ -18,7 +18,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.12
|
|
19
19
|
Classifier: Topic :: Utilities
|
|
20
20
|
Requires-Python: >=3.12
|
|
21
|
-
Requires-Dist: click>=8.
|
|
21
|
+
Requires-Dist: click>=8.3.3
|
|
22
22
|
Requires-Dist: filelock>=3.12
|
|
23
23
|
Requires-Dist: httpx<1,>=0.27
|
|
24
24
|
Requires-Dist: psutil>=7.2.2
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
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,8 +13,12 @@ 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 /
|
|
16
|
+
POST /search_context_cards -> hybrid tsvector + embedding content search
|
|
17
17
|
DELETE /context_cards/{id} -> delete
|
|
18
|
+
POST /list_card_comments -> list a card's comments (DV-1308)
|
|
19
|
+
POST /create_card_comment -> add a comment to a card
|
|
20
|
+
POST /update_card_comment -> edit a comment (author only)
|
|
21
|
+
DELETE /card_comments/{id} -> delete a comment (author only)
|
|
18
22
|
"""
|
|
19
23
|
|
|
20
24
|
from __future__ import annotations
|
|
@@ -41,6 +45,8 @@ CARD_TYPES = [
|
|
|
41
45
|
|
|
42
46
|
CARD_COLUMNS = ["id", "type", "title", "display_status", "updated_at"]
|
|
43
47
|
|
|
48
|
+
COMMENT_COLUMNS = ["id", "commenter_type", "commenter_name", "comment", "created_at"]
|
|
49
|
+
|
|
44
50
|
|
|
45
51
|
def _client(ctx: click.Context) -> DeepVistaClient:
|
|
46
52
|
return ctx.obj._client
|
|
@@ -656,43 +662,197 @@ def card_archive(ctx: click.Context, card_id: str, dry_run: bool) -> None:
|
|
|
656
662
|
)
|
|
657
663
|
|
|
658
664
|
|
|
659
|
-
@card_group.command("+
|
|
660
|
-
@click.argument("
|
|
665
|
+
@card_group.command("+search-content")
|
|
666
|
+
@click.argument("query", required=False, default="")
|
|
661
667
|
@click.option("--type", "card_type", type=click.Choice(CARD_TYPES, case_sensitive=False), default=None)
|
|
662
|
-
@click.option("-i", "--ignore-case", is_flag=True, default=False, help="Case-insensitive matching.")
|
|
663
668
|
@click.option("--limit", default=20, help="Max cards to return (default 20).")
|
|
664
|
-
@click.option("-C", "--context", "context_lines", default=0, type=int, help="Lines of context around each match.")
|
|
665
669
|
@click.pass_context
|
|
666
|
-
def
|
|
670
|
+
def card_search_content(
|
|
667
671
|
ctx: click.Context,
|
|
668
|
-
|
|
672
|
+
query: str,
|
|
669
673
|
card_type: str | None,
|
|
670
|
-
ignore_case: bool,
|
|
671
674
|
limit: int,
|
|
672
|
-
context_lines: int,
|
|
673
675
|
) -> None:
|
|
674
|
-
"""
|
|
676
|
+
"""Hybrid full-text + semantic search, ranked by combined score.
|
|
675
677
|
|
|
676
|
-
Different from +search
|
|
677
|
-
|
|
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.
|
|
678
681
|
|
|
679
682
|
Read-only — never modifies your knowledge base.
|
|
680
683
|
"""
|
|
681
|
-
body: dict = {
|
|
682
|
-
"pattern": pattern,
|
|
683
|
-
"case_insensitive": ignore_case,
|
|
684
|
-
"limit": limit,
|
|
685
|
-
"context_lines": context_lines,
|
|
686
|
-
}
|
|
684
|
+
body: dict = {"query": query, "limit": limit}
|
|
687
685
|
if card_type:
|
|
688
686
|
body["card_type"] = card_type
|
|
689
687
|
|
|
690
|
-
data = _client(ctx).post("/
|
|
688
|
+
data = _client(ctx).post("/search_context_cards", body)
|
|
691
689
|
format_output(
|
|
692
690
|
data,
|
|
693
691
|
ctx.obj.output_format,
|
|
694
|
-
title=f"
|
|
692
|
+
title=f"Search: {query}" if query else "Browse",
|
|
695
693
|
entity_type="card",
|
|
696
694
|
base_url=ctx.obj.auth_url,
|
|
697
695
|
project_id=ctx.obj.project_id,
|
|
698
696
|
)
|
|
697
|
+
|
|
698
|
+
|
|
699
|
+
# ---------------------------------------------------------------------------
|
|
700
|
+
# Comments (DV-1308 / DV-1496) — flat, markdown comment thread on a card
|
|
701
|
+
# ---------------------------------------------------------------------------
|
|
702
|
+
|
|
703
|
+
|
|
704
|
+
@card_group.group("comment")
|
|
705
|
+
def comment_group() -> None:
|
|
706
|
+
"""Add / read / edit / delete comments on a context card.
|
|
707
|
+
|
|
708
|
+
Comments are a flat, markdown thread attached to a card — use them for
|
|
709
|
+
enrichment and running commentary instead of editing the card body. The CLI
|
|
710
|
+
posts as the authenticated user (`commenter_type=human`); you can only edit
|
|
711
|
+
or delete your own comments.
|
|
712
|
+
"""
|
|
713
|
+
|
|
714
|
+
|
|
715
|
+
@comment_group.command("list")
|
|
716
|
+
@click.argument("card_id")
|
|
717
|
+
@click.option("--limit", default=50, help="Max comments to return (default 50).")
|
|
718
|
+
@project_option
|
|
719
|
+
@click.pass_context
|
|
720
|
+
def comment_list(ctx: click.Context, card_id: str, limit: int, project_override: str | None) -> None:
|
|
721
|
+
"""List a card's comments (oldest first).
|
|
722
|
+
|
|
723
|
+
Read-only.
|
|
724
|
+
"""
|
|
725
|
+
apply_project_override(ctx, project_override)
|
|
726
|
+
comments = _client(ctx).post("/list_card_comments", {"card_id": card_id})
|
|
727
|
+
comments = comments if isinstance(comments, list) else []
|
|
728
|
+
format_output(
|
|
729
|
+
{"card_id": card_id, "comments": comments[:limit], "count": len(comments[:limit])},
|
|
730
|
+
ctx.obj.output_format,
|
|
731
|
+
columns=COMMENT_COLUMNS,
|
|
732
|
+
title=f"Comments: {card_id}",
|
|
733
|
+
entity_type="card",
|
|
734
|
+
base_url=ctx.obj.auth_url,
|
|
735
|
+
project_id=ctx.obj.project_id,
|
|
736
|
+
)
|
|
737
|
+
|
|
738
|
+
|
|
739
|
+
@comment_group.command("add")
|
|
740
|
+
@click.argument("card_id")
|
|
741
|
+
@click.option("--content", "comment", default=None, help="Comment body (markdown).")
|
|
742
|
+
@click.option(
|
|
743
|
+
"--content-file",
|
|
744
|
+
default=None,
|
|
745
|
+
help="Read the comment from a file path. Use '-' for stdin. Overrides --content.",
|
|
746
|
+
)
|
|
747
|
+
@click.option("--dry-run", is_flag=True, default=False, help="Preview what would happen without making any changes.")
|
|
748
|
+
@project_option
|
|
749
|
+
@click.pass_context
|
|
750
|
+
def comment_add(
|
|
751
|
+
ctx: click.Context,
|
|
752
|
+
card_id: str,
|
|
753
|
+
comment: str | None,
|
|
754
|
+
content_file: str | None,
|
|
755
|
+
dry_run: bool,
|
|
756
|
+
project_override: str | None,
|
|
757
|
+
) -> None:
|
|
758
|
+
"""Add a comment to a context card.
|
|
759
|
+
|
|
760
|
+
> [!CAUTION] This is a write command — confirm with the user before executing.
|
|
761
|
+
"""
|
|
762
|
+
apply_project_override(ctx, project_override)
|
|
763
|
+
comment = resolve_content(comment, content_file)
|
|
764
|
+
if not comment or not comment.strip():
|
|
765
|
+
output_error(3, "Comment must not be empty", "Pass --content or --content-file.")
|
|
766
|
+
|
|
767
|
+
body: dict = {"card_id": card_id, "comment": comment}
|
|
768
|
+
if dry_run:
|
|
769
|
+
format_output(
|
|
770
|
+
{"dry_run": True, "would": "create card comment", "payload": body},
|
|
771
|
+
ctx.obj.output_format,
|
|
772
|
+
entity_type="card",
|
|
773
|
+
base_url=ctx.obj.auth_url,
|
|
774
|
+
project_id=ctx.obj.project_id,
|
|
775
|
+
)
|
|
776
|
+
return
|
|
777
|
+
|
|
778
|
+
data = _client(ctx).post("/create_card_comment", body)
|
|
779
|
+
format_output(
|
|
780
|
+
data,
|
|
781
|
+
ctx.obj.output_format,
|
|
782
|
+
title=f"Commented on: {card_id}",
|
|
783
|
+
entity_type="card",
|
|
784
|
+
base_url=ctx.obj.auth_url,
|
|
785
|
+
project_id=ctx.obj.project_id,
|
|
786
|
+
)
|
|
787
|
+
|
|
788
|
+
|
|
789
|
+
@comment_group.command("edit")
|
|
790
|
+
@click.argument("comment_id")
|
|
791
|
+
@click.option("--content", "comment", default=None, help="New comment body (markdown).")
|
|
792
|
+
@click.option(
|
|
793
|
+
"--content-file",
|
|
794
|
+
default=None,
|
|
795
|
+
help="Read the comment from a file path. Use '-' for stdin. Overrides --content.",
|
|
796
|
+
)
|
|
797
|
+
@click.option("--dry-run", is_flag=True, default=False, help="Preview what would happen without making any changes.")
|
|
798
|
+
@click.pass_context
|
|
799
|
+
def comment_edit(
|
|
800
|
+
ctx: click.Context,
|
|
801
|
+
comment_id: str,
|
|
802
|
+
comment: str | None,
|
|
803
|
+
content_file: str | None,
|
|
804
|
+
dry_run: bool,
|
|
805
|
+
) -> None:
|
|
806
|
+
"""Edit one of your own comments.
|
|
807
|
+
|
|
808
|
+
> [!CAUTION] This is a write command — confirm with the user before executing.
|
|
809
|
+
"""
|
|
810
|
+
comment = resolve_content(comment, content_file)
|
|
811
|
+
if not comment or not comment.strip():
|
|
812
|
+
output_error(3, "Comment must not be empty", "Pass --content or --content-file.")
|
|
813
|
+
|
|
814
|
+
body: dict = {"comment_id": comment_id, "comment": comment}
|
|
815
|
+
if dry_run:
|
|
816
|
+
format_output(
|
|
817
|
+
{"dry_run": True, "would": "update card comment", "payload": body},
|
|
818
|
+
ctx.obj.output_format,
|
|
819
|
+
entity_type="card",
|
|
820
|
+
base_url=ctx.obj.auth_url,
|
|
821
|
+
project_id=ctx.obj.project_id,
|
|
822
|
+
)
|
|
823
|
+
return
|
|
824
|
+
|
|
825
|
+
data = _client(ctx).post("/update_card_comment", body)
|
|
826
|
+
format_output(
|
|
827
|
+
data,
|
|
828
|
+
ctx.obj.output_format,
|
|
829
|
+
title=f"Edited comment: {comment_id}",
|
|
830
|
+
entity_type="card",
|
|
831
|
+
base_url=ctx.obj.auth_url,
|
|
832
|
+
project_id=ctx.obj.project_id,
|
|
833
|
+
)
|
|
834
|
+
|
|
835
|
+
|
|
836
|
+
@comment_group.command("delete")
|
|
837
|
+
@click.argument("comment_id")
|
|
838
|
+
@click.option("--dry-run", is_flag=True, default=False, help="Preview what would happen without making any changes.")
|
|
839
|
+
@click.pass_context
|
|
840
|
+
def comment_delete(ctx: click.Context, comment_id: str, dry_run: bool) -> None:
|
|
841
|
+
"""Delete one of your own comments.
|
|
842
|
+
|
|
843
|
+
> [!CAUTION] This is a destructive write command — confirm with the user before executing.
|
|
844
|
+
"""
|
|
845
|
+
if dry_run:
|
|
846
|
+
format_output(
|
|
847
|
+
{"dry_run": True, "would": "delete card comment", "comment_id": comment_id},
|
|
848
|
+
ctx.obj.output_format,
|
|
849
|
+
entity_type="card",
|
|
850
|
+
base_url=ctx.obj.auth_url,
|
|
851
|
+
project_id=ctx.obj.project_id,
|
|
852
|
+
)
|
|
853
|
+
return
|
|
854
|
+
|
|
855
|
+
data = _client(ctx).delete(f"/card_comments/{comment_id}")
|
|
856
|
+
format_output(
|
|
857
|
+
data, ctx.obj.output_format, entity_type="card", base_url=ctx.obj.auth_url, project_id=ctx.obj.project_id
|
|
858
|
+
)
|
|
@@ -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
|
-
#
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
#
|
|
26
|
-
|
|
27
|
-
DEFAULT_WEEKLY_CRON = "0
|
|
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 ``
|
|
41
|
-
|
|
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("
|
|
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(
|
|
57
|
-
|
|
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
|
|
64
|
-
|
|
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
|
-
|
|
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
|
-
|
|
72
|
-
|
|
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": "
|
|
93
|
+
{"status": "already_active", "job": existing},
|
|
82
94
|
ctx.obj.output_format,
|
|
83
|
-
title="Daily planning
|
|
95
|
+
title="Daily planning already active",
|
|
84
96
|
)
|
|
85
97
|
return
|
|
86
98
|
|
|
87
|
-
|
|
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
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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.
|
|
153
|
-
|
|
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` / `+
|
|
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.
|