volkom-mesh 0.1.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 (31) hide show
  1. volkom_mesh-0.1.0/.gitignore +6 -0
  2. volkom_mesh-0.1.0/CHANGELOG.md +26 -0
  3. volkom_mesh-0.1.0/LICENSE +202 -0
  4. volkom_mesh-0.1.0/PKG-INFO +130 -0
  5. volkom_mesh-0.1.0/README.md +99 -0
  6. volkom_mesh-0.1.0/pyproject.toml +65 -0
  7. volkom_mesh-0.1.0/src/volkom_mesh/__init__.py +13 -0
  8. volkom_mesh-0.1.0/src/volkom_mesh/access.py +78 -0
  9. volkom_mesh-0.1.0/src/volkom_mesh/cli.py +359 -0
  10. volkom_mesh-0.1.0/src/volkom_mesh/client.py +192 -0
  11. volkom_mesh-0.1.0/src/volkom_mesh/commands/__init__.py +1 -0
  12. volkom_mesh-0.1.0/src/volkom_mesh/commands/agents.py +136 -0
  13. volkom_mesh-0.1.0/src/volkom_mesh/commands/alerts.py +132 -0
  14. volkom_mesh-0.1.0/src/volkom_mesh/commands/budget.py +48 -0
  15. volkom_mesh-0.1.0/src/volkom_mesh/commands/common.py +49 -0
  16. volkom_mesh-0.1.0/src/volkom_mesh/commands/tenants.py +140 -0
  17. volkom_mesh-0.1.0/src/volkom_mesh/commands/tokens.py +82 -0
  18. volkom_mesh-0.1.0/src/volkom_mesh/commands/users.py +84 -0
  19. volkom_mesh-0.1.0/src/volkom_mesh/commands/vault.py +121 -0
  20. volkom_mesh-0.1.0/src/volkom_mesh/commands/workflows.py +102 -0
  21. volkom_mesh-0.1.0/src/volkom_mesh/guard.py +137 -0
  22. volkom_mesh-0.1.0/src/volkom_mesh/main.py +391 -0
  23. volkom_mesh-0.1.0/src/volkom_mesh/redact.py +92 -0
  24. volkom_mesh-0.1.0/src/volkom_mesh/routes.py +124 -0
  25. volkom_mesh-0.1.0/src/volkom_mesh/store.py +167 -0
  26. volkom_mesh-0.1.0/src/volkom_mesh/target.py +83 -0
  27. volkom_mesh-0.1.0/tests/conftest.py +11 -0
  28. volkom_mesh-0.1.0/tests/test_mesh_cli.py +578 -0
  29. volkom_mesh-0.1.0/tests/test_mesh_guard.py +248 -0
  30. volkom_mesh-0.1.0/tests/test_mesh_redact_target_store.py +195 -0
  31. volkom_mesh-0.1.0/tests/test_mesh_roles.py +338 -0
@@ -0,0 +1,6 @@
1
+ .venv/
2
+ dist/
3
+ __pycache__/
4
+ .pytest_cache/
5
+ *.egg-info/
6
+ .DS_Store
@@ -0,0 +1,26 @@
1
+ # Changelog
2
+
3
+ All notable changes to `volkom-mesh`. Versions follow [semver](https://semver.org).
4
+
5
+ ## 0.1.0 — first public release
6
+
7
+ The Volkom Mesh command line, for the people of a workspace and for Volkom staff.
8
+
9
+ - `login` with your portal e-mail and a 6-digit code (typed hidden); the session lasts 24 h
10
+ and is kept in the system keychain. It connects to `https://vmesh.volkom.ai` unless `--api`
11
+ says otherwise, and later commands use the Mesh of your last login.
12
+ - Read runs and failures (with one run's timeline), AI spend, the audit log, alerts and alert
13
+ rules, budgets, agents and workflows.
14
+ - Admins can run, enable, disable, schedule, change the model of and delete agents; create,
15
+ run and delete workflows; handle alerts and alert rules; issue and revoke agent keys; and
16
+ invite people, change their role or remove them.
17
+ - The help shows only what your role can do (admin or viewer); a command outside it says why
18
+ instead of returning a bare 403, and nothing is sent. Your workspace comes from your
19
+ session: no need to type it.
20
+ - Production is always flagged; every change there asks for confirmation, deletions ask
21
+ twice, and a script that skips the prompt with `--yes` must name the Mesh (`--api` or
22
+ `VOLKOM_MESH_API`).
23
+ - New keys are shown once or written to a new private file (`--save-to`); secrets are masked
24
+ in everything printed; the session only travels to the Mesh it was created for.
25
+ - `--json` on every command for scripts and AI assistants.
26
+ - `volkom-ro`: the same CLI locked to reads.
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ https://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ https://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,130 @@
1
+ Metadata-Version: 2.4
2
+ Name: volkom-mesh
3
+ Version: 0.1.0
4
+ Summary: Command line for Volkom Mesh: runs, failures, AI spend, alerts, agents, workflows, keys and people of your workspace.
5
+ Project-URL: Homepage, https://vmesh.volkom.ai/docs/
6
+ Project-URL: Documentation, https://vmesh.volkom.ai/docs/
7
+ Author: Volkom
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
10
+ Keywords: ai agents,cli,mesh,observability,volkom
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Intended Audience :: System Administrators
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3 :: Only
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: 3.14
22
+ Classifier: Topic :: System :: Monitoring
23
+ Classifier: Topic :: Utilities
24
+ Requires-Python: >=3.11
25
+ Requires-Dist: click<9,>=8.1
26
+ Requires-Dist: httpx<1.0,>=0.27
27
+ Requires-Dist: keyring<26.0,>=25.0
28
+ Requires-Dist: rich<15.0,>=13.0
29
+ Requires-Dist: typer<0.26,>=0.12
30
+ Description-Content-Type: text/markdown
31
+
32
+ # volkom-mesh
33
+
34
+ The command line for [Volkom Mesh](https://vmesh.volkom.ai): see your agents' runs and
35
+ failures, AI spend and alerts, run an agent, manage workflows, keys and the people of your
36
+ workspace, from the terminal or from a script. It talks only to the Mesh API, with the same
37
+ login and the same permissions as the portal.
38
+
39
+ ## Install
40
+
41
+ Requires Python 3.11+. One command, with [uv](https://docs.astral.sh/uv/) or
42
+ [pipx](https://pipx.pypa.io):
43
+
44
+ ```bash
45
+ uv tool install volkom-mesh # or: pipx install volkom-mesh
46
+ volkom-mesh --version
47
+ ```
48
+
49
+ This installs two commands: `volkom-mesh`, and `volkom-ro`, the same CLI locked to reads
50
+ (handy to give a script or an AI assistant read access without the ability to change
51
+ anything, whatever your role).
52
+
53
+ ## Log in
54
+
55
+ ```bash
56
+ volkom-mesh login
57
+ ```
58
+
59
+ It asks for your portal e-mail and the 6-digit code that e-mail receives (the code is typed
60
+ hidden). The session lasts 24 hours and is kept in your system keychain. `login` connects to
61
+ the public Mesh, `https://vmesh.volkom.ai`, unless you pass `--api <url>`; every later command
62
+ uses the Mesh of your last login.
63
+
64
+ `volkom-mesh whoami` shows who you are logged in as, your role and your workspace (tenant).
65
+ If your e-mail belongs to several workspaces, the Mesh picks one at login; `whoami` tells you
66
+ which.
67
+
68
+ ## Use
69
+
70
+ Your workspace comes from your session, so you never type it:
71
+
72
+ ```bash
73
+ volkom-mesh runs # latest runs, with outcome and error
74
+ volkom-mesh failures --agent invoices # only failed runs of one agent
75
+ volkom-mesh runs --run <run-id> # the event timeline of one run
76
+ volkom-mesh agents list # agents, whether they are online, last outcome
77
+ volkom-mesh spend --range 7d # AI usage by agent
78
+ volkom-mesh alerts list
79
+ volkom-mesh agents run invoices # queue a run (admin)
80
+ volkom-mesh tokens create invoices --save-to ./invoices.key # a key for an agent (admin)
81
+ volkom-mesh --help # what your role can do
82
+ volkom-mesh <group> <command> --help
83
+ ```
84
+
85
+ Every command accepts `--json` (`{"api", "production", "data"}`) for scripts and agents.
86
+
87
+ ## What each role can do
88
+
89
+ The help shows only what your role allows. The Mesh enforces the same rules on every
90
+ request; the CLI just tells you earlier.
91
+
92
+ | | admin | viewer |
93
+ |---|---|---|
94
+ | `runs`, `failures`, `spend`, `audit`, `whoami` | ✓ | ✓ |
95
+ | `tenants show`, `agents list` / `triggers`, `workflows list` / `runs` | ✓ | ✓ |
96
+ | `budget show`, `alerts list`, `alert-rules list` | ✓ | ✓ |
97
+ | `agents enable` / `disable` / `set-interval` / `set-model` / `run` / `delete` | ✓ | |
98
+ | `workflows create` / `run` / `delete` | ✓ | |
99
+ | `alerts ack` / `resolve` / `mute`, `alert-rules create` / `update` / `delete` | ✓ | |
100
+ | `tokens list` / `create` / `workspace-key` / `revoke` | ✓ | |
101
+ | `users list` / `invitations` / `invite` / `set-role` / `remove` | ✓ | |
102
+
103
+ Volkom staff see more commands (tenants, vault, budgets); they are hidden for workspace users.
104
+
105
+ ## Safety
106
+
107
+ - **Production is always flagged.** Every output against `*.volkom.ai` says `PRODUCTION`, and
108
+ every change asks you to type the name of what you are changing (or pass `--yes`).
109
+ - **Destructive actions** (delete, revoke) need the name typed twice, or
110
+ `--yes --confirm <name>` in a script. `--yes` alone is never enough.
111
+ - **Scripts that change production name the Mesh**: with `--yes`, pass `--api` or set
112
+ `VOLKOM_MESH_API`; the Mesh of your last login is not enough to skip the prompt.
113
+ - **New keys are shown once**, or written with `--save-to <file>` to a new file only you can
114
+ read, without touching the screen.
115
+ - **Secrets are masked** in everything the CLI prints, including error messages.
116
+ - **Your session only travels to the Mesh it was created for**, over https for production; no
117
+ redirect is followed.
118
+ - `logout` deletes the session from this machine. The server keeps it valid until it
119
+ expires (24 h).
120
+
121
+ ## Settings
122
+
123
+ | | |
124
+ |---|---|
125
+ | `--api <url>` / `VOLKOM_MESH_API` | Which Mesh (default: the one of your last login; `login` defaults to `https://vmesh.volkom.ai`). |
126
+ | `VOLKOM_MESH_STORE=file` | Keep the session in `~/.config/volkom-mesh/sessions.json` (mode 600) instead of the keychain. |
127
+ | `VOLKOM_MESH_CONFIG_DIR` | Another folder for those files. |
128
+
129
+ Exit codes: `0` ok · `1` API or network error · `2` bad input · `3` not logged in ·
130
+ `4` refused (confirmation missing, read-only CLI, or your role).
@@ -0,0 +1,99 @@
1
+ # volkom-mesh
2
+
3
+ The command line for [Volkom Mesh](https://vmesh.volkom.ai): see your agents' runs and
4
+ failures, AI spend and alerts, run an agent, manage workflows, keys and the people of your
5
+ workspace, from the terminal or from a script. It talks only to the Mesh API, with the same
6
+ login and the same permissions as the portal.
7
+
8
+ ## Install
9
+
10
+ Requires Python 3.11+. One command, with [uv](https://docs.astral.sh/uv/) or
11
+ [pipx](https://pipx.pypa.io):
12
+
13
+ ```bash
14
+ uv tool install volkom-mesh # or: pipx install volkom-mesh
15
+ volkom-mesh --version
16
+ ```
17
+
18
+ This installs two commands: `volkom-mesh`, and `volkom-ro`, the same CLI locked to reads
19
+ (handy to give a script or an AI assistant read access without the ability to change
20
+ anything, whatever your role).
21
+
22
+ ## Log in
23
+
24
+ ```bash
25
+ volkom-mesh login
26
+ ```
27
+
28
+ It asks for your portal e-mail and the 6-digit code that e-mail receives (the code is typed
29
+ hidden). The session lasts 24 hours and is kept in your system keychain. `login` connects to
30
+ the public Mesh, `https://vmesh.volkom.ai`, unless you pass `--api <url>`; every later command
31
+ uses the Mesh of your last login.
32
+
33
+ `volkom-mesh whoami` shows who you are logged in as, your role and your workspace (tenant).
34
+ If your e-mail belongs to several workspaces, the Mesh picks one at login; `whoami` tells you
35
+ which.
36
+
37
+ ## Use
38
+
39
+ Your workspace comes from your session, so you never type it:
40
+
41
+ ```bash
42
+ volkom-mesh runs # latest runs, with outcome and error
43
+ volkom-mesh failures --agent invoices # only failed runs of one agent
44
+ volkom-mesh runs --run <run-id> # the event timeline of one run
45
+ volkom-mesh agents list # agents, whether they are online, last outcome
46
+ volkom-mesh spend --range 7d # AI usage by agent
47
+ volkom-mesh alerts list
48
+ volkom-mesh agents run invoices # queue a run (admin)
49
+ volkom-mesh tokens create invoices --save-to ./invoices.key # a key for an agent (admin)
50
+ volkom-mesh --help # what your role can do
51
+ volkom-mesh <group> <command> --help
52
+ ```
53
+
54
+ Every command accepts `--json` (`{"api", "production", "data"}`) for scripts and agents.
55
+
56
+ ## What each role can do
57
+
58
+ The help shows only what your role allows. The Mesh enforces the same rules on every
59
+ request; the CLI just tells you earlier.
60
+
61
+ | | admin | viewer |
62
+ |---|---|---|
63
+ | `runs`, `failures`, `spend`, `audit`, `whoami` | ✓ | ✓ |
64
+ | `tenants show`, `agents list` / `triggers`, `workflows list` / `runs` | ✓ | ✓ |
65
+ | `budget show`, `alerts list`, `alert-rules list` | ✓ | ✓ |
66
+ | `agents enable` / `disable` / `set-interval` / `set-model` / `run` / `delete` | ✓ | |
67
+ | `workflows create` / `run` / `delete` | ✓ | |
68
+ | `alerts ack` / `resolve` / `mute`, `alert-rules create` / `update` / `delete` | ✓ | |
69
+ | `tokens list` / `create` / `workspace-key` / `revoke` | ✓ | |
70
+ | `users list` / `invitations` / `invite` / `set-role` / `remove` | ✓ | |
71
+
72
+ Volkom staff see more commands (tenants, vault, budgets); they are hidden for workspace users.
73
+
74
+ ## Safety
75
+
76
+ - **Production is always flagged.** Every output against `*.volkom.ai` says `PRODUCTION`, and
77
+ every change asks you to type the name of what you are changing (or pass `--yes`).
78
+ - **Destructive actions** (delete, revoke) need the name typed twice, or
79
+ `--yes --confirm <name>` in a script. `--yes` alone is never enough.
80
+ - **Scripts that change production name the Mesh**: with `--yes`, pass `--api` or set
81
+ `VOLKOM_MESH_API`; the Mesh of your last login is not enough to skip the prompt.
82
+ - **New keys are shown once**, or written with `--save-to <file>` to a new file only you can
83
+ read, without touching the screen.
84
+ - **Secrets are masked** in everything the CLI prints, including error messages.
85
+ - **Your session only travels to the Mesh it was created for**, over https for production; no
86
+ redirect is followed.
87
+ - `logout` deletes the session from this machine. The server keeps it valid until it
88
+ expires (24 h).
89
+
90
+ ## Settings
91
+
92
+ | | |
93
+ |---|---|
94
+ | `--api <url>` / `VOLKOM_MESH_API` | Which Mesh (default: the one of your last login; `login` defaults to `https://vmesh.volkom.ai`). |
95
+ | `VOLKOM_MESH_STORE=file` | Keep the session in `~/.config/volkom-mesh/sessions.json` (mode 600) instead of the keychain. |
96
+ | `VOLKOM_MESH_CONFIG_DIR` | Another folder for those files. |
97
+
98
+ Exit codes: `0` ok · `1` API or network error · `2` bad input · `3` not logged in ·
99
+ `4` refused (confirmation missing, read-only CLI, or your role).
@@ -0,0 +1,65 @@
1
+ [build-system]
2
+ # hatchling 1.30 and 1.32+ write Metadata-Version 2.5, which twine < 7 rejects;
3
+ # 1.29 writes 2.4, accepted everywhere. Pinned so CI builds what was checked here.
4
+ requires = ["hatchling>=1.27,<1.30"]
5
+ build-backend = "hatchling.build"
6
+
7
+ # Published on PyPI as `volkom-mesh` (package and command), Apache-2.0, from
8
+ # .github/workflows/publish-volkom-mesh.yml on a `volkom-mesh-vX.Y.Z` tag. The
9
+ # Mesh repository is private: no repository URL here, and the README is what
10
+ # PyPI shows, so it must stay free of internal hosts and customer names.
11
+ [project]
12
+ name = "volkom-mesh"
13
+ version = "0.1.0"
14
+ description = "Command line for Volkom Mesh: runs, failures, AI spend, alerts, agents, workflows, keys and people of your workspace."
15
+ readme = "README.md"
16
+ license = "Apache-2.0"
17
+ license-files = ["LICENSE"]
18
+ requires-python = ">=3.11"
19
+ authors = [{ name = "Volkom" }]
20
+ keywords = ["volkom", "mesh", "ai agents", "observability", "cli"]
21
+ classifiers = [
22
+ "Development Status :: 4 - Beta",
23
+ "Environment :: Console",
24
+ "Intended Audience :: Developers",
25
+ "Intended Audience :: System Administrators",
26
+ "Operating System :: OS Independent",
27
+ "Programming Language :: Python :: 3",
28
+ "Programming Language :: Python :: 3 :: Only",
29
+ "Programming Language :: Python :: 3.11",
30
+ "Programming Language :: Python :: 3.12",
31
+ "Programming Language :: Python :: 3.13",
32
+ "Programming Language :: Python :: 3.14",
33
+ "Topic :: System :: Monitoring",
34
+ "Topic :: Utilities",
35
+ ]
36
+ dependencies = [
37
+ # typer 0.26+ embeds its own copy of click; this CLI hooks into click's
38
+ # parser (cli.MeshGroup), so it stays on the typer that uses click itself.
39
+ "typer>=0.12,<0.26",
40
+ "click>=8.1,<9",
41
+ "rich>=13.0,<15.0",
42
+ "httpx>=0.27,<1.0",
43
+ "keyring>=25.0,<26.0",
44
+ ]
45
+
46
+ [project.urls]
47
+ Homepage = "https://vmesh.volkom.ai/docs/"
48
+ Documentation = "https://vmesh.volkom.ai/docs/"
49
+
50
+ [project.scripts]
51
+ volkom-mesh = "volkom_mesh.main:main"
52
+ # The same CLI locked to reads: anything that writes refuses before sending.
53
+ volkom-ro = "volkom_mesh.main:main_read_only"
54
+
55
+ [dependency-groups]
56
+ dev = ["pytest>=8.0"]
57
+
58
+ [tool.hatch.build.targets.wheel]
59
+ packages = ["src/volkom_mesh"]
60
+
61
+ # The sdist carries only what is needed to build and test: no scratch, no
62
+ # lockfile, no internal docs. hatch also copies the nearest .gitignore: the
63
+ # package has its own, minimal one, so the repository's never travels.
64
+ [tool.hatch.build.targets.sdist]
65
+ include = ["src/volkom_mesh", "tests", "README.md", "CHANGELOG.md", "LICENSE", "pyproject.toml"]
@@ -0,0 +1,13 @@
1
+ """`volkom-mesh`: drive the Mesh over HTTP, with a guard on every request.
2
+
3
+ This package only speaks to the API, and only through the (method, path
4
+ template) pairs listed in routes.py. `volkom-ro` is the same CLI locked to
5
+ reads. Volkom's internal `volkom` CLI (straight to ClickHouse) lives in another
6
+ package and is not part of this one.
7
+ """
8
+ from importlib.metadata import PackageNotFoundError, version
9
+
10
+ try:
11
+ __version__ = version("volkom-mesh")
12
+ except PackageNotFoundError: # running from a source tree that was never installed
13
+ __version__ = "0.0.0+unknown"
@@ -0,0 +1,78 @@
1
+ """What each kind of user can do, so the CLI can adapt its help and say so early.
2
+
3
+ This is NOT a security boundary: the Mesh checks every request (its RBAC
4
+ middleware plus the checks inside each endpoint) and that is what decides. The
5
+ table mirrors those rules so that a tenant user does not see Volkom staff
6
+ commands, and gets a clear sentence instead of a bare 403 before anything is
7
+ sent. Each row was checked against a real Mesh with a tenant admin and a tenant
8
+ viewer (see the PR). If the server ever allows more than this table, the worst
9
+ case is a hidden command; if it allows less, the server's 403 is still shown,
10
+ translated.
11
+
12
+ Staff (user_type "admin") are never filtered here: their roles (owner, operator,
13
+ support, billing) are left entirely to the server.
14
+ """
15
+ from __future__ import annotations
16
+
17
+ ADMIN, VIEWER = "admin", "viewer"
18
+ BOTH = frozenset({ADMIN, VIEWER})
19
+ ADMIN_ONLY = frozenset({ADMIN})
20
+ STAFF_ONLY: frozenset[str] = frozenset()
21
+
22
+ # command path -> the tenant roles that may use it. Missing = staff only.
23
+ TENANT_ACCESS: dict[tuple[str, ...], frozenset[str]] = {
24
+ ("login",): BOTH, ("logout",): BOTH, ("whoami",): BOTH,
25
+ ("runs",): BOTH, ("failures",): BOTH, ("spend",): BOTH, ("audit",): BOTH,
26
+ ("tenants", "show"): BOTH,
27
+ ("agents", "list"): BOTH, ("agents", "triggers"): BOTH,
28
+ ("agents", "enable"): ADMIN_ONLY, ("agents", "disable"): ADMIN_ONLY,
29
+ ("agents", "set-interval"): ADMIN_ONLY, ("agents", "run"): ADMIN_ONLY,
30
+ ("agents", "delete"): ADMIN_ONLY, ("agents", "set-model"): ADMIN_ONLY,
31
+ ("workflows", "list"): BOTH, ("workflows", "runs"): BOTH,
32
+ ("workflows", "create"): ADMIN_ONLY, ("workflows", "run"): ADMIN_ONLY,
33
+ ("workflows", "delete"): ADMIN_ONLY,
34
+ # The Mesh keeps keys away from viewers (rbac: no /keys for a viewer).
35
+ ("tokens", "list"): ADMIN_ONLY, ("tokens", "create"): ADMIN_ONLY,
36
+ ("tokens", "workspace-key"): ADMIN_ONLY, ("tokens", "revoke"): ADMIN_ONLY,
37
+ ("budget", "show"): BOTH,
38
+ ("alerts", "list"): BOTH,
39
+ ("alerts", "ack"): ADMIN_ONLY, ("alerts", "resolve"): ADMIN_ONLY, ("alerts", "mute"): ADMIN_ONLY,
40
+ ("alert-rules", "list"): BOTH,
41
+ ("alert-rules", "create"): ADMIN_ONLY, ("alert-rules", "update"): ADMIN_ONLY,
42
+ ("alert-rules", "delete"): ADMIN_ONLY,
43
+ ("users", "list"): ADMIN_ONLY, ("users", "invitations"): ADMIN_ONLY,
44
+ ("users", "invite"): ADMIN_ONLY, ("users", "set-role"): ADMIN_ONLY, ("users", "remove"): ADMIN_ONLY,
45
+ # Not listed, so staff only: status, tenants list/create/update/set-plan/
46
+ # suspend/unsuspend/deactivate/reactivate, vault *, budget set.
47
+ }
48
+
49
+
50
+ def is_tenant_user(me: dict | None) -> bool:
51
+ return bool(me) and me.get("user_type") == "tenant_user"
52
+
53
+
54
+ def tenant_role(me: dict) -> str:
55
+ # The server treats a tenant session without a role as admin (rbac.effective_role).
56
+ return me.get("role") or ADMIN
57
+
58
+
59
+ def allowed(path: tuple[str, ...], me: dict | None) -> bool:
60
+ """Whether the CLI should offer `path` to this user. Unknown user = yes."""
61
+ if not is_tenant_user(me):
62
+ return True
63
+ return tenant_role(me) in TENANT_ACCESS.get(path, STAFF_ONLY)
64
+
65
+
66
+ def who(me: dict) -> str:
67
+ if is_tenant_user(me):
68
+ return f"{me.get('email')} ({tenant_role(me)} of tenant {me.get('tenant_slug') or '?'})"
69
+ return f"{me.get('email')} (Volkom staff, {me.get('role') or 'owner'})"
70
+
71
+
72
+ def refusal(path: tuple[str, ...], me: dict) -> str:
73
+ cmd = " ".join(path)
74
+ if not TENANT_ACCESS.get(path):
75
+ return f"`{cmd}` is for Volkom staff. You are logged in as {who(me)}. Nothing was sent."
76
+ return (f"`{cmd}` needs the admin role of your tenant. You are logged in as {who(me)}; "
77
+ "ask an admin of your workspace (if your role just changed, `volkom-mesh whoami` "
78
+ "refreshes it). Nothing was sent.")