deepvista-cli 1.2.0__tar.gz → 2.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 (98) hide show
  1. deepvista_cli-2.0.0/.release-please-manifest.json +3 -0
  2. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/CHANGELOG.md +24 -0
  3. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/PKG-INFO +7 -17
  4. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/README.md +6 -16
  5. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/deepvista_cli/client/http.py +36 -32
  6. deepvista_cli-2.0.0/deepvista_cli/commands/agents.py +366 -0
  7. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/deepvista_cli/commands/card.py +177 -0
  8. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/deepvista_cli/commands/notes.py +4 -254
  9. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/deepvista_cli/commands/schedule.py +3 -3
  10. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/deepvista_cli/commands/skill.py +55 -529
  11. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/deepvista_cli/commands/tasks.py +766 -253
  12. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/deepvista_cli/commands/upgrade.py +15 -147
  13. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/deepvista_cli/main.py +1 -3
  14. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/deepvista_cli/resources/workflow_host_runtime.md +11 -39
  15. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/deepvista_cli/session_note.py +1 -7
  16. deepvista_cli-2.0.0/deepvista_cli/workflow_doc.py +116 -0
  17. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/plugins/claude-code/.claude-plugin/plugin.json +1 -1
  18. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/plugins/claude-code/README.md +14 -37
  19. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/plugins/claude-code/commands/deepvista.md +2 -2
  20. deepvista_cli-2.0.0/plugins/claude-code/commands/refresh-skills.md +25 -0
  21. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/plugins/claude-code/scripts/deepvista-sync.sh +6 -26
  22. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/plugins/claude-code/skills/install-deepvista-cli/SKILL.md +4 -5
  23. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/pyproject.toml +1 -1
  24. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/skills/deepvista/SKILL.md +9 -11
  25. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/skills/deepvista/reference/notes.md +9 -20
  26. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/skills/deepvista/reference/openclaw.md +4 -4
  27. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/skills/deepvista/reference/shared.md +9 -17
  28. deepvista_cli-2.0.0/skills/deepvista/reference/skill-create-from-note.md +60 -0
  29. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/skills/deepvista/reference/skill-research-to-skill.md +1 -2
  30. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/skills/deepvista/reference/skill.md +10 -31
  31. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/skills/deepvista/reference/tasks.md +7 -2
  32. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/skills/deepvista/reference/vistabase-card.md +9 -2
  33. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/skills/dv-workflow/SKILL.md +3 -3
  34. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/tests/test_agent_id_tagging.py +4 -4
  35. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/tests/test_tasks_commands.py +405 -101
  36. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/uv.lock +1 -1
  37. deepvista_cli-1.2.0/.release-please-manifest.json +0 -3
  38. deepvista_cli-1.2.0/deepvista_cli/agent_catalog.py +0 -606
  39. deepvista_cli-1.2.0/deepvista_cli/commands/agents.py +0 -1210
  40. deepvista_cli-1.2.0/deepvista_cli/commands/lint.py +0 -303
  41. deepvista_cli-1.2.0/deepvista_cli/workflow_doc.py +0 -256
  42. deepvista_cli-1.2.0/plugins/claude-code/agents/.gitignore +0 -10
  43. deepvista_cli-1.2.0/plugins/claude-code/commands/refresh-skills.md +0 -29
  44. deepvista_cli-1.2.0/skills/deepvista/reference/lint.md +0 -54
  45. deepvista_cli-1.2.0/skills/deepvista/reference/skill-create-from-note.md +0 -75
  46. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/.claude-plugin/marketplace.json +0 -0
  47. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/.github/workflows/ci.yml +0 -0
  48. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/.github/workflows/publish.yml +0 -0
  49. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/.github/workflows/release-please.yml +0 -0
  50. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/.gitignore +0 -0
  51. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/.pre-commit-config.yaml +0 -0
  52. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/CLAUDE.md +0 -0
  53. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/CONTRIBUTING.md +0 -0
  54. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/LICENSE +0 -0
  55. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/deepvista_cli/__init__.py +0 -0
  56. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/deepvista_cli/auth/__init__.py +0 -0
  57. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/deepvista_cli/auth/callback_server.py +0 -0
  58. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/deepvista_cli/auth/login.py +0 -0
  59. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/deepvista_cli/auth/tokens.py +0 -0
  60. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/deepvista_cli/client/__init__.py +0 -0
  61. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/deepvista_cli/client/origin.py +0 -0
  62. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/deepvista_cli/commands/__init__.py +0 -0
  63. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/deepvista_cli/commands/auth.py +0 -0
  64. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/deepvista_cli/commands/chat.py +0 -0
  65. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/deepvista_cli/commands/config.py +0 -0
  66. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/deepvista_cli/commands/project.py +0 -0
  67. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/deepvista_cli/commands/session.py +0 -0
  68. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/deepvista_cli/config.py +0 -0
  69. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/deepvista_cli/output/__init__.py +0 -0
  70. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/deepvista_cli/output/formatter.py +0 -0
  71. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/deepvista_cli/resources/__init__.py +0 -0
  72. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/deepvista_cli/skill_catalog.py +0 -0
  73. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/docs/assets/deepvista-banner.png +0 -0
  74. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/install.ps1 +0 -0
  75. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/install.sh +0 -0
  76. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/plugins/README.md +0 -0
  77. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/plugins/claude-code/hooks/hooks.json +0 -0
  78. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/plugins/claude-code/scripts/deepvista-agent-sync.sh +0 -0
  79. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/plugins/claude-code/scripts/deepvista-session-end.sh +0 -0
  80. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/plugins/claude-code/scripts/deepvista-session-start.sh +0 -0
  81. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/plugins/claude-code/scripts/deepvista-session-turn.sh +0 -0
  82. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/plugins/claude-code/scripts/deepvista-skill-url.py +0 -0
  83. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/plugins/claude-code/skills/.gitignore +0 -0
  84. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/release-please-config.json +0 -0
  85. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/scripts/check_plugin_version.py +0 -0
  86. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/skills/deepvista/reference/chat.md +0 -0
  87. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/skills/deepvista/reference/project.md +0 -0
  88. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/skills/deepvista/reference/session.md +0 -0
  89. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/skills/deepvista/reference/skill-analyze-notes.md +0 -0
  90. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/skills/deepvista/reference/skill-import-files.md +0 -0
  91. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/tests/__init__.py +0 -0
  92. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/tests/test_entry_points.py +0 -0
  93. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/tests/test_project_commands.py +0 -0
  94. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/tests/test_session_note_format.py +0 -0
  95. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/tests/test_skill_catalog.py +0 -0
  96. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/tests/test_skill_commands.py +0 -0
  97. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/tests/test_workflow_doc_phases.py +0 -0
  98. {deepvista_cli-1.2.0 → deepvista_cli-2.0.0}/uninstall.sh +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "2.0.0"
3
+ }
@@ -37,6 +37,30 @@ users what's new between the version they have installed and the latest release.
37
37
  adopts a pre-existing server-side row instead of failing when the local
38
38
  file is missing.
39
39
 
40
+ ## [2.0.0](https://github.com/DeepVista-AI/deepvista-cli/compare/v1.2.0...v2.0.0) (2026-07-06)
41
+
42
+
43
+ ### ⚠ BREAKING CHANGES
44
+
45
+ * simplify the CLI surface (84 → 69 commands, −1,470 lines) ([#189](https://github.com/DeepVista-AI/deepvista-cli/issues/189))
46
+
47
+ ### Features
48
+
49
+ * **DV-1428:** stream task-card execution incrementally, report live progress ([#185](https://github.com/DeepVista-AI/deepvista-cli/issues/185)) ([7f081b5](https://github.com/DeepVista-AI/deepvista-cli/commit/7f081b598085d52280fb84c4396d573672b6cb5a))
50
+ * **DV-1429:** tasks clean, auto-detect agent --type, prune stale agents ([#183](https://github.com/DeepVista-AI/deepvista-cli/issues/183)) ([38252e7](https://github.com/DeepVista-AI/deepvista-cli/commit/38252e71b33275bc7976037192a082c7f2ccb391))
51
+ * run task queue jobs in parallel (max 5) ([#193](https://github.com/DeepVista-AI/deepvista-cli/issues/193)) ([b22a727](https://github.com/DeepVista-AI/deepvista-cli/commit/b22a7275a59aef3e69896846a86ddfb263d43a24))
52
+ * simplify the CLI surface (84 → 69 commands, −1,470 lines) ([#189](https://github.com/DeepVista-AI/deepvista-cli/issues/189)) ([5056442](https://github.com/DeepVista-AI/deepvista-cli/commit/50564429a84ff044967cab8db831e282b5fac67b))
53
+
54
+
55
+ ### Bug Fixes
56
+
57
+ * **tasks:** use single-quoted f-string to avoid escaped double quotes in task note hint ([#181](https://github.com/DeepVista-AI/deepvista-cli/issues/181)) ([297de78](https://github.com/DeepVista-AI/deepvista-cli/commit/297de78ee188cd9dcd9b4031b5b29b76733b160d))
58
+
59
+
60
+ ### Documentation
61
+
62
+ * **DV-1434:** fix schedule command docstring to reference schedule_job cards ([#182](https://github.com/DeepVista-AI/deepvista-cli/issues/182)) ([d01f98d](https://github.com/DeepVista-AI/deepvista-cli/commit/d01f98d03a21256ee96ee4cae8b78f81c4b44a85))
63
+
40
64
  ## [1.2.0](https://github.com/DeepVista-AI/deepvista-cli/compare/v1.1.0...v1.2.0) (2026-06-27)
41
65
 
42
66
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deepvista-cli
3
- Version: 1.2.0
3
+ Version: 2.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
@@ -243,13 +243,12 @@ One skill, `deepvista`, with per-subcommand detail under `skills/deepvista/refer
243
243
  | `reference/vistabase-card.md` | Knowledge-base cards (`card` / `vistabase`) — create, search, pin, edit, grep |
244
244
  | `reference/session.md` | Agent session transcripts — init, tick, finalize |
245
245
  | `reference/chat.md` | Chat sessions and NDJSON stream format |
246
- | `reference/skill.md` | Structured Skill workflows — list, run, discover, install |
246
+ | `reference/skill.md` | Structured Skill workflows — list, run, phase, complete |
247
247
  | `reference/skill-create-from-note.md` | Synthesize a Skill from one or more notes |
248
248
  | `reference/skill-analyze-notes.md` | Pattern: search → read → synthesize notes |
249
249
  | `reference/skill-research-to-skill.md` | Pattern: research the KB, then run a Skill |
250
250
  | `reference/skill-import-files.md` | Bulk-import a folder as file cards |
251
251
  | `reference/tasks.md` | Run work dispatched to this machine — `tasks run` / `setup` |
252
- | `reference/lint.md` | Health-check the vistabase for dupes / contradictions / gaps |
253
252
  | `reference/openclaw.md` | Auto-capture rules for OpenClaw agents |
254
253
 
255
254
  The agent loads only the index at first; when a subcommand is needed, it reads the matching reference file on demand.
@@ -318,11 +317,10 @@ deepvista notes # Hand-written notes (cards with type=note)
318
317
  Supporting commands:
319
318
 
320
319
  ```
321
- deepvista agents # Register & manage AI agents connected to DeepVista
320
+ deepvista agents # Agent identity heartbeat (auto-registers on first sync)
322
321
  deepvista session # Agent conversation transcripts (init / tick / finalize)
323
322
  deepvista tasks # Run work dispatched to this machine (task cards, queued commands)
324
323
  deepvista schedule # Manage the recurring daily-planning job (opt-in)
325
- deepvista lint # Health-check the vistabase with the DeepVista agent
326
324
  deepvista auth # Authenticate with DeepVista
327
325
  deepvista config # Manage CLI profiles (local, staging, production, …)
328
326
  deepvista upgrade # Check for and install CLI + skill updates
@@ -351,16 +349,14 @@ Card types: `person` · `organization` · `message` · `todo` · `topic` · `key
351
349
  ```bash
352
350
  deepvista skill list [--limit N]
353
351
  deepvista skill get <skill_id>
354
- deepvista skill run <skill_id> [--mode host|deepvista|auto] [--input "context"]
352
+ deepvista skill run <skill_id> [--input "context"]
355
353
  deepvista skill phase open <skill_id> "Phase N: <title>"
356
354
  deepvista skill phase done <skill_id> "Phase N: <title>" [--artifact-card-id ID]... [--next-phase "Phase N+1: …"]
357
355
  deepvista skill phase pause <skill_id> --reason "<short sentence>"
358
- deepvista skill phase run-on-deepvista <skill_id> "Phase N: <title>"
359
356
  deepvista skill complete <skill_id> --review "<retrospective bullets>"
360
- deepvista skill status <run_chat_id>
361
357
  ```
362
358
 
363
- `skill run` defaults to **host mode** — it prints a JSON header + the workflow's SKILL.md body + a host runtime contract on stdout, and the host agent (Claude Code / OpenClaw / Cursor) drives the run via the `phase` shims and `complete`. Use `--mode deepvista` to keep the legacy behaviour (server agent drives the whole run, NDJSON streamed back). `--mode auto` decides per phase by inspecting each phase's `tool_plan`.
359
+ `skill run` prints a JSON header + the workflow's SKILL.md body + a host runtime contract on stdout, and the host agent (Claude Code / OpenClaw / Cursor) drives the run via the `phase` shims and `complete`.
364
360
 
365
361
  ### chat — AI agent
366
362
 
@@ -414,13 +410,7 @@ deepvista schedule deactivate
414
410
  deepvista schedule delete <job_id>
415
411
  ```
416
412
 
417
- ### lint — Vistabase health check
418
-
419
- ```bash
420
- deepvista lint [--limit N] # surface duplicates, contradictions, stale claims, orphans, gaps
421
- ```
422
-
423
- Run `deepvista <command> --help` for the full options of any group, including `agents`, `auth`, `config`, `upgrade`, and `ui`. Auth, profiles, and agent registration are also covered in `skills/deepvista/reference/shared.md`.
413
+ Run `deepvista <command> --help` for the full options of any group, including `agents`, `auth`, `config`, and `upgrade`. Auth, profiles, and the agent heartbeat are also covered in `skills/deepvista/reference/shared.md`.
424
414
 
425
415
  ---
426
416
 
@@ -560,7 +550,7 @@ deepvista-cli/
560
550
  │ ├── config.py # Config + profiles
561
551
  │ ├── auth/ # Login, token storage, callback server
562
552
  │ ├── client/ # HTTP client, SSE streaming
563
- │ ├── commands/ # card, skill, chat, notes, agents, session, tasks, schedule, auth, config, lint, upgrade
553
+ │ ├── commands/ # card, skill, chat, notes, agents, session, tasks, schedule, auth, config, upgrade
564
554
  │ └── output/ # JSON + table formatters
565
555
  └── skills/ # SKILL.md files for agent integration
566
556
  ```
@@ -216,13 +216,12 @@ One skill, `deepvista`, with per-subcommand detail under `skills/deepvista/refer
216
216
  | `reference/vistabase-card.md` | Knowledge-base cards (`card` / `vistabase`) — create, search, pin, edit, grep |
217
217
  | `reference/session.md` | Agent session transcripts — init, tick, finalize |
218
218
  | `reference/chat.md` | Chat sessions and NDJSON stream format |
219
- | `reference/skill.md` | Structured Skill workflows — list, run, discover, install |
219
+ | `reference/skill.md` | Structured Skill workflows — list, run, phase, complete |
220
220
  | `reference/skill-create-from-note.md` | Synthesize a Skill from one or more notes |
221
221
  | `reference/skill-analyze-notes.md` | Pattern: search → read → synthesize notes |
222
222
  | `reference/skill-research-to-skill.md` | Pattern: research the KB, then run a Skill |
223
223
  | `reference/skill-import-files.md` | Bulk-import a folder as file cards |
224
224
  | `reference/tasks.md` | Run work dispatched to this machine — `tasks run` / `setup` |
225
- | `reference/lint.md` | Health-check the vistabase for dupes / contradictions / gaps |
226
225
  | `reference/openclaw.md` | Auto-capture rules for OpenClaw agents |
227
226
 
228
227
  The agent loads only the index at first; when a subcommand is needed, it reads the matching reference file on demand.
@@ -291,11 +290,10 @@ deepvista notes # Hand-written notes (cards with type=note)
291
290
  Supporting commands:
292
291
 
293
292
  ```
294
- deepvista agents # Register & manage AI agents connected to DeepVista
293
+ deepvista agents # Agent identity heartbeat (auto-registers on first sync)
295
294
  deepvista session # Agent conversation transcripts (init / tick / finalize)
296
295
  deepvista tasks # Run work dispatched to this machine (task cards, queued commands)
297
296
  deepvista schedule # Manage the recurring daily-planning job (opt-in)
298
- deepvista lint # Health-check the vistabase with the DeepVista agent
299
297
  deepvista auth # Authenticate with DeepVista
300
298
  deepvista config # Manage CLI profiles (local, staging, production, …)
301
299
  deepvista upgrade # Check for and install CLI + skill updates
@@ -324,16 +322,14 @@ Card types: `person` · `organization` · `message` · `todo` · `topic` · `key
324
322
  ```bash
325
323
  deepvista skill list [--limit N]
326
324
  deepvista skill get <skill_id>
327
- deepvista skill run <skill_id> [--mode host|deepvista|auto] [--input "context"]
325
+ deepvista skill run <skill_id> [--input "context"]
328
326
  deepvista skill phase open <skill_id> "Phase N: <title>"
329
327
  deepvista skill phase done <skill_id> "Phase N: <title>" [--artifact-card-id ID]... [--next-phase "Phase N+1: …"]
330
328
  deepvista skill phase pause <skill_id> --reason "<short sentence>"
331
- deepvista skill phase run-on-deepvista <skill_id> "Phase N: <title>"
332
329
  deepvista skill complete <skill_id> --review "<retrospective bullets>"
333
- deepvista skill status <run_chat_id>
334
330
  ```
335
331
 
336
- `skill run` defaults to **host mode** — it prints a JSON header + the workflow's SKILL.md body + a host runtime contract on stdout, and the host agent (Claude Code / OpenClaw / Cursor) drives the run via the `phase` shims and `complete`. Use `--mode deepvista` to keep the legacy behaviour (server agent drives the whole run, NDJSON streamed back). `--mode auto` decides per phase by inspecting each phase's `tool_plan`.
332
+ `skill run` prints a JSON header + the workflow's SKILL.md body + a host runtime contract on stdout, and the host agent (Claude Code / OpenClaw / Cursor) drives the run via the `phase` shims and `complete`.
337
333
 
338
334
  ### chat — AI agent
339
335
 
@@ -387,13 +383,7 @@ deepvista schedule deactivate
387
383
  deepvista schedule delete <job_id>
388
384
  ```
389
385
 
390
- ### lint — Vistabase health check
391
-
392
- ```bash
393
- deepvista lint [--limit N] # surface duplicates, contradictions, stale claims, orphans, gaps
394
- ```
395
-
396
- Run `deepvista <command> --help` for the full options of any group, including `agents`, `auth`, `config`, `upgrade`, and `ui`. Auth, profiles, and agent registration are also covered in `skills/deepvista/reference/shared.md`.
386
+ Run `deepvista <command> --help` for the full options of any group, including `agents`, `auth`, `config`, and `upgrade`. Auth, profiles, and the agent heartbeat are also covered in `skills/deepvista/reference/shared.md`.
397
387
 
398
388
  ---
399
389
 
@@ -533,7 +523,7 @@ deepvista-cli/
533
523
  │ ├── config.py # Config + profiles
534
524
  │ ├── auth/ # Login, token storage, callback server
535
525
  │ ├── client/ # HTTP client, SSE streaming
536
- │ ├── commands/ # card, skill, chat, notes, agents, session, tasks, schedule, auth, config, lint, upgrade
526
+ │ ├── commands/ # card, skill, chat, notes, agents, session, tasks, schedule, auth, config, upgrade
537
527
  │ └── output/ # JSON + table formatters
538
528
  └── skills/ # SKILL.md files for agent integration
539
529
  ```
@@ -13,6 +13,7 @@ from __future__ import annotations
13
13
  import json
14
14
  import logging
15
15
  import sys
16
+ import threading
16
17
  from collections.abc import Iterator
17
18
  from typing import Any, NoReturn
18
19
 
@@ -32,6 +33,7 @@ class DeepVistaClient:
32
33
  def __init__(self, config: CLIConfig) -> None:
33
34
  self.config = config
34
35
  self._client: httpx.Client | None = None
36
+ self._lock = threading.Lock()
35
37
 
36
38
  def _get_client(self) -> httpx.Client:
37
39
  if self._client is None:
@@ -140,25 +142,26 @@ class DeepVistaClient:
140
142
  )
141
143
  sys.exit(0)
142
144
 
143
- try:
144
- client = self._get_client()
145
- if method == "GET":
146
- resp = client.get(path, headers=headers, params=params)
147
- elif method == "POST":
148
- resp = client.post(path, headers=headers, json=body or {})
149
- elif method == "PATCH":
150
- resp = client.patch(path, headers=headers, json=body or {})
151
- elif method == "DELETE":
152
- resp = client.delete(path, headers=headers, params=params)
153
- else:
154
- raise ValueError(f"Unsupported method: {method}")
155
- except (httpx.ConnectError, httpx.TimeoutException) as exc:
156
- self._handle_network_error(exc)
157
-
158
- self._log_response(resp)
159
- if resp.status_code >= 400:
160
- self._handle_error(resp)
161
- return resp.json()
145
+ with self._lock:
146
+ 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}")
158
+ except (httpx.ConnectError, httpx.TimeoutException) as exc:
159
+ self._handle_network_error(exc)
160
+
161
+ self._log_response(resp)
162
+ if resp.status_code >= 400:
163
+ self._handle_error(resp)
164
+ return resp.json()
162
165
 
163
166
  def get(self, path: str, params: dict | None = None, extra_headers: dict[str, str] | None = None) -> Any:
164
167
  """HTTP GET, returns parsed JSON."""
@@ -184,19 +187,20 @@ class DeepVistaClient:
184
187
  err=True,
185
188
  )
186
189
  sys.exit(0)
187
- try:
188
- client = self._get_client()
189
- resp = client.post(path, headers=headers, json=body or {})
190
- except (httpx.ConnectError, httpx.TimeoutException) as exc:
191
- self._handle_network_error(exc)
192
- self._log_response(resp)
193
- try:
194
- data = resp.json()
195
- if isinstance(data, dict):
196
- data["_status_code"] = resp.status_code
197
- return data
198
- except Exception:
199
- return {"error": resp.text, "status_code": resp.status_code, "_status_code": resp.status_code}
190
+ with self._lock:
191
+ try:
192
+ client = self._get_client()
193
+ resp = client.post(path, headers=headers, json=body or {})
194
+ except (httpx.ConnectError, httpx.TimeoutException) as exc:
195
+ self._handle_network_error(exc)
196
+ self._log_response(resp)
197
+ try:
198
+ data = resp.json()
199
+ if isinstance(data, dict):
200
+ data["_status_code"] = resp.status_code
201
+ return data
202
+ except Exception:
203
+ return {"error": resp.text, "status_code": resp.status_code, "_status_code": resp.status_code}
200
204
 
201
205
  def patch(self, path: str, body: dict | None = None) -> Any:
202
206
  """HTTP PATCH, returns parsed JSON."""
@@ -0,0 +1,366 @@
1
+ """deepvista agents — the agent identity heartbeat.
2
+
3
+ Each agent tool (Claude Code, OpenClaw, Cursor, etc.) gets a persistent
4
+ identity with config stored in DeepVista. ``agents sync`` is the single
5
+ command: it auto-registers on first run, then heartbeats config/state.
6
+
7
+ Agent IDs are stored locally at ~/.config/deepvista/agents/<agent_type>.json
8
+ (or ``<agent_type>__<project_id>.json`` per project) so the CLI knows which
9
+ agent it's running inside. The storage helpers here are shared with
10
+ ``tasks``, ``session``, ``notes`` and origin detection.
11
+ """
12
+
13
+ from __future__ import annotations
14
+
15
+ import json as _json
16
+ import os
17
+ from pathlib import Path
18
+
19
+ import click
20
+
21
+ from deepvista_cli.client.http import DeepVistaClient
22
+ from deepvista_cli.client.origin import build_origin, detect_agent_tool
23
+ from deepvista_cli.config import CONFIG_DIR
24
+ from deepvista_cli.output.formatter import format_output, output_error
25
+
26
+ AGENTS_DIR = CONFIG_DIR / "agents"
27
+
28
+ ERROR_CODE_AGENT_NOT_FOUND = "AGENT_NOT_FOUND"
29
+ ERROR_CODE_AGENT_ALREADY_REGISTERED = "AGENT_ALREADY_REGISTERED"
30
+
31
+ _AGENT_TYPE_LABELS = {
32
+ "claude-code": "Claude Code",
33
+ "opencode": "OpenCode",
34
+ "openclaw": "OpenClaw",
35
+ "cursor": "Cursor",
36
+ "windsurf": "Windsurf",
37
+ "cline": "Cline",
38
+ "aider": "Aider",
39
+ "github-copilot": "GitHub Copilot",
40
+ "deepvista-cli": "DeepVista CLI",
41
+ }
42
+
43
+
44
+ def _agent_id_path(agent_type: str, project_id: str | None = None) -> Path:
45
+ if project_id:
46
+ return AGENTS_DIR / f"{agent_type}__{project_id}.json"
47
+ return AGENTS_DIR / f"{agent_type}.json"
48
+
49
+
50
+ def _save_agent_id(
51
+ agent_type: str,
52
+ agent_id: str,
53
+ project_id: str | None = None,
54
+ project_name: str | None = None,
55
+ ) -> None:
56
+ AGENTS_DIR.mkdir(parents=True, exist_ok=True)
57
+ path = _agent_id_path(agent_type, project_id)
58
+ data: dict = {"agent_id": agent_id, "agent_type": agent_type}
59
+ if project_id:
60
+ data["project_id"] = project_id
61
+ if project_name:
62
+ data["project_name"] = project_name
63
+ path.write_text(_json.dumps(data))
64
+ os.chmod(path, 0o600)
65
+
66
+
67
+ def _read_agent_id_file(path: Path) -> dict | None:
68
+ try:
69
+ return _json.loads(path.read_text())
70
+ except (_json.JSONDecodeError, OSError, KeyError):
71
+ return None
72
+
73
+
74
+ def _load_agent_id(agent_type: str, project_id: str | None = None) -> str | None:
75
+ path = _agent_id_path(agent_type, project_id)
76
+ if not path.exists():
77
+ return None
78
+ if data := _read_agent_id_file(path):
79
+ if aid := data.get("agent_id"):
80
+ return aid
81
+ return None
82
+
83
+
84
+ def load_agent_id_for_active_agent() -> str | None:
85
+ """Return the active agent UUID from the local cache, or None."""
86
+ try:
87
+ agent_type, _ = detect_agent_tool()
88
+ except Exception:
89
+ return None
90
+ if not agent_type:
91
+ return None
92
+ return _load_agent_id(agent_type)
93
+
94
+
95
+ def _remove_agent_id(agent_type: str, project_id: str | None = None) -> None:
96
+ _agent_id_path(agent_type, project_id).unlink(missing_ok=True)
97
+
98
+
99
+ def _machine_fingerprint() -> str:
100
+ import hashlib
101
+ import platform
102
+ import uuid
103
+
104
+ raw = f"{platform.node()}:{uuid.getnode()}:{platform.system()}"
105
+ return hashlib.sha256(raw.encode()).hexdigest()[:16]
106
+
107
+
108
+ def _build_config_snapshot(_agent_type: str) -> dict:
109
+ """Minimal config: origin metadata + working directory."""
110
+ origin = build_origin()
111
+ config: dict = {
112
+ "machine_fingerprint": _machine_fingerprint(),
113
+ "working_directory": str(Path.cwd()),
114
+ }
115
+ for key in ("machine", "model", "tool_version"):
116
+ if val := origin.get(key):
117
+ config[key] = val
118
+ return config
119
+
120
+
121
+ def _default_agent_name(agent_type: str) -> str:
122
+ import platform
123
+
124
+ label = _AGENT_TYPE_LABELS.get(agent_type, agent_type)
125
+ hostname = platform.node() or "unknown-host"
126
+ return f"{label} — {hostname}"
127
+
128
+
129
+ def _find_local_registration_for_project(
130
+ project_id: str,
131
+ agent_type: str | None = None,
132
+ ) -> tuple[str, str] | None:
133
+ """Return ``(agent_id, agent_type)`` from the local cache for ``project_id``."""
134
+ if agent_type:
135
+ if cached := _load_agent_id(agent_type, project_id):
136
+ return cached, agent_type
137
+ if not AGENTS_DIR.exists():
138
+ return None
139
+ candidates: list[tuple[float, Path]] = []
140
+ for path in AGENTS_DIR.glob("*.json"):
141
+ try:
142
+ candidates.append((path.stat().st_mtime, path))
143
+ except OSError:
144
+ continue
145
+ for _, path in sorted(candidates, reverse=True):
146
+ data = _read_agent_id_file(path)
147
+ if not data or data.get("project_id") != project_id:
148
+ continue
149
+ aid = data.get("agent_id")
150
+ if not aid:
151
+ continue
152
+ atype = str(data.get("agent_type") or agent_type or "deepvista-cli")
153
+ return str(aid), atype
154
+ return None
155
+
156
+
157
+ def _project_headers(project_id: str) -> dict[str, str]:
158
+ return {"X-Project-Id": project_id}
159
+
160
+
161
+ def _resolve_agent_type(agent_type: str | None = None) -> str:
162
+ if agent_type:
163
+ return agent_type
164
+ try:
165
+ detected, _ = detect_agent_tool()
166
+ except Exception:
167
+ detected = None
168
+ return detected or "deepvista-cli"
169
+
170
+
171
+ def _agent_exists_on_server(ctx: click.Context, agent_id: str, project_id: str) -> bool:
172
+ """Return True when ``agent_id`` is a managed agent for this user in ``project_id``."""
173
+ data = _client(ctx).get(f"/agents/{agent_id}", extra_headers=_project_headers(project_id))
174
+ return bool(data.get("agent"))
175
+
176
+
177
+ def _sync_machine_online(
178
+ ctx: click.Context,
179
+ agent_id: str,
180
+ project_id: str,
181
+ config: dict,
182
+ ) -> None:
183
+ _client(ctx).post(
184
+ f"/agents/{agent_id}/sync",
185
+ {"status": "online", "sync_type": "manual", "config_patch": config},
186
+ extra_headers=_project_headers(project_id),
187
+ )
188
+
189
+
190
+ def _register_agent_via_api(
191
+ ctx: click.Context,
192
+ name: str,
193
+ agent_type: str,
194
+ config: dict,
195
+ *,
196
+ project_id: str | None = None,
197
+ project_name: str | None = None,
198
+ agent_role: str = "misc",
199
+ ) -> tuple[str | None, str | None]:
200
+ body: dict = {
201
+ "name": name,
202
+ "agent_type": agent_type,
203
+ "agent_role": agent_role,
204
+ "config": config,
205
+ }
206
+ extra_headers = _project_headers(project_id) if project_id else None
207
+ data = _client(ctx).post("/agents", body, extra_headers=extra_headers)
208
+ agent = data.get("agent")
209
+ save_project_id = project_id or (agent.get("project_id") if agent else None)
210
+ if agent and agent.get("id"):
211
+ _save_agent_id(agent_type, agent["id"], save_project_id, project_name)
212
+ return agent["id"], None
213
+ if data.get("error_code") == ERROR_CODE_AGENT_ALREADY_REGISTERED and agent and agent.get("id"):
214
+ _save_agent_id(agent_type, agent["id"], save_project_id, project_name)
215
+ return agent["id"], None
216
+ return None, data.get("error", "Registration failed")
217
+
218
+
219
+ def resolve_or_register_machine(
220
+ ctx: click.Context,
221
+ project_id: str,
222
+ *,
223
+ agent_type: str | None = None,
224
+ agent_role: str = "misc",
225
+ project_name: str | None = None,
226
+ quiet: bool = False,
227
+ ) -> str | None:
228
+ """Resolve this machine's managed agent for ``project_id``, registering when needed.
229
+
230
+ Trust-but-verify flow:
231
+ 1. Use the local cache when the server still knows that agent id.
232
+ 2. Otherwise register (or adopt an existing server row via
233
+ ``AGENT_ALREADY_REGISTERED``), save locally, and mark online.
234
+ """
235
+ resolved_type = _resolve_agent_type(agent_type)
236
+ config = _build_config_snapshot(resolved_type)
237
+
238
+ local = _find_local_registration_for_project(project_id, resolved_type)
239
+ cached_id = local[0] if local else None
240
+ cached_type = local[1] if local else resolved_type
241
+ if cached_id and _agent_exists_on_server(ctx, cached_id, project_id):
242
+ _sync_machine_online(ctx, cached_id, project_id, config)
243
+ return cached_id
244
+ if cached_id:
245
+ _remove_agent_id(cached_type, project_id)
246
+
247
+ agent_id, error = _register_agent_via_api(
248
+ ctx,
249
+ _default_agent_name(resolved_type),
250
+ resolved_type,
251
+ config,
252
+ project_id=project_id,
253
+ project_name=project_name,
254
+ agent_role=agent_role,
255
+ )
256
+ if not agent_id:
257
+ if not quiet:
258
+ click.echo(
259
+ f" [warn] could not register agent for project {project_id}: {error or 'unknown'}",
260
+ err=True,
261
+ )
262
+ return None
263
+
264
+ _sync_machine_online(ctx, agent_id, project_id, config)
265
+ if not quiet:
266
+ click.echo(f" registered agent {agent_id} for project {project_id}", err=True)
267
+ return agent_id
268
+
269
+
270
+ def _ensure_agent_registered(ctx: click.Context, agent_type: str) -> str:
271
+ if existing := _load_agent_id(agent_type):
272
+ return existing
273
+ config = _build_config_snapshot(agent_type)
274
+ agent_id, error = _register_agent_via_api(ctx, _default_agent_name(agent_type), agent_type, config)
275
+ if not agent_id:
276
+ output_error(1, "Auto-registration failed", error or "Unknown error")
277
+ raise SystemExit(1)
278
+ return agent_id
279
+
280
+
281
+ def _client(ctx: click.Context) -> DeepVistaClient:
282
+ return ctx.obj._client
283
+
284
+
285
+ def _output(ctx: click.Context, data: object, **kwargs: object) -> None:
286
+ format_output(
287
+ data,
288
+ ctx.obj.output_format,
289
+ entity_type="agent",
290
+ base_url=ctx.obj.auth_url,
291
+ project_id=ctx.obj.project_id,
292
+ **kwargs, # type: ignore[arg-type]
293
+ )
294
+
295
+
296
+ @click.group("agents")
297
+ def agents_group() -> None:
298
+ """Agent identity heartbeat for DeepVista."""
299
+
300
+
301
+ @agents_group.command("sync")
302
+ @click.argument("agent_id", required=False, default=None)
303
+ @click.option("--type", "agent_type", default=None, help="Resolve agent by type from local storage.")
304
+ @click.option("--status", default=None, type=click.Choice(["online", "offline", "error"]))
305
+ @click.option("--memory", default=None, help="Memory JSON to merge into config.")
306
+ @click.option("--dry-run", is_flag=True, default=False, help="Preview without making changes.")
307
+ @click.pass_context
308
+ def agents_sync(
309
+ ctx: click.Context,
310
+ agent_id: str | None,
311
+ agent_type: str | None,
312
+ status: str | None,
313
+ memory: str | None,
314
+ dry_run: bool,
315
+ ) -> None:
316
+ """Heartbeat + push state to DeepVista. Auto-registers on first run.
317
+
318
+ > [!CAUTION] This is a write command — confirm with the user before executing.
319
+ """
320
+ resolved_type = agent_type
321
+ if not resolved_type:
322
+ try:
323
+ resolved_type, _ = detect_agent_tool()
324
+ except Exception:
325
+ resolved_type = None
326
+
327
+ if agent_id:
328
+ resolved_id = agent_id
329
+ elif resolved_type:
330
+ resolved_id = _ensure_agent_registered(ctx, resolved_type)
331
+ else:
332
+ output_error(3, "Cannot resolve agent ID", "Provide --agent-id or --type, or run inside a registered agent.")
333
+ raise SystemExit(3)
334
+
335
+ body: dict = {"sync_type": "manual"}
336
+ if status:
337
+ body["status"] = status
338
+
339
+ config_patch = _build_config_snapshot(resolved_type or "")
340
+ if memory:
341
+ try:
342
+ config_patch["memory"] = _json.loads(memory)
343
+ except _json.JSONDecodeError:
344
+ output_error(3, "Invalid --memory JSON", f"Got: {memory}")
345
+ return
346
+ if config_patch:
347
+ body["config_patch"] = config_patch
348
+
349
+ if dry_run:
350
+ _output(
351
+ ctx,
352
+ {"dry_run": True, "would": "sync agent state", "agent_id": resolved_id, "payload": body},
353
+ title="Dry Run: Sync Agent",
354
+ )
355
+ return
356
+
357
+ data = _client(ctx).post(f"/agents/{resolved_id}/sync", body)
358
+ if not data.get("success") and data.get("error_code") == ERROR_CODE_AGENT_NOT_FOUND and resolved_type:
359
+ _remove_agent_id(resolved_type)
360
+ resolved_id = _ensure_agent_registered(ctx, resolved_type)
361
+ data = _client(ctx).post(f"/agents/{resolved_id}/sync", body)
362
+
363
+ if not data.get("success"):
364
+ output_error(1, "Sync failed", data.get("error", ""))
365
+ return
366
+ _output(ctx, data["agent"], title="Synced Agent")