netra-zen 1.0.0__py3-none-any.whl → 1.0.1__py3-none-any.whl
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.
- {netra_zen-1.0.0.dist-info → netra_zen-1.0.1.dist-info}/METADATA +206 -6
- {netra_zen-1.0.0.dist-info → netra_zen-1.0.1.dist-info}/RECORD +7 -7
- zen_orchestrator.py +1 -17
- {netra_zen-1.0.0.dist-info → netra_zen-1.0.1.dist-info}/WHEEL +0 -0
- {netra_zen-1.0.0.dist-info → netra_zen-1.0.1.dist-info}/entry_points.txt +0 -0
- {netra_zen-1.0.0.dist-info → netra_zen-1.0.1.dist-info}/licenses/LICENSE.md +0 -0
- {netra_zen-1.0.0.dist-info → netra_zen-1.0.1.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: netra-zen
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.1
|
4
4
|
Summary: Multi-instance Claude orchestrator for parallel task execution
|
5
5
|
Home-page: https://github.com/netra-systems/zen
|
6
6
|
Author: Systems
|
@@ -79,10 +79,210 @@ Example portion of status report:
|
|
79
79
|
║ ⏳ quality-synthesizer queued 0K
|
80
80
|
╚════════════════════════════════════════════╝
|
81
81
|
```
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
82
|
+
|
83
|
+
## Example Start
|
84
|
+
```
|
85
|
+
zen
|
86
|
+
```
|
87
|
+
|
88
|
+
```
|
89
|
+
+=== STATUS REPORT [14:47:39] ===+
|
90
|
+
| Total: 2 instances
|
91
|
+
| Running: 2, Completed: 0, Failed: 0, Pending: 0
|
92
|
+
| Tokens: 0 total, 0 cached | Median: 0 | Tools: 0
|
93
|
+
| 💰 Cost: $0.0000 total, $0.0000 avg/instance | Pricing: Claude compliant
|
94
|
+
|
|
95
|
+
| TOKEN BUDGET STATUS |
|
96
|
+
| Overall: [--------------------] 0% 0/10.0K
|
97
|
+
| Command Budgets:
|
98
|
+
| /analyze-repository [--------------------] 0% 0/5.0K
|
99
|
+
| /README [--------------------] 0% 0/1.0K
|
100
|
+
|
|
101
|
+
| 📝 Model shows actual Claude model used (critical for accurate cost tracking)
|
102
|
+
| 💡 Tip: Model may differ from your config - Claude routes requests intelligently
|
103
|
+
| Status Name Model Duration Overall Tokens Cache Cr Cache Rd Tools Budget
|
104
|
+
| -------- ------------------------------ ---------- ---------- -------- -------- -------- -------- ------ ----------
|
105
|
+
| 🏃 analyze-repo opus4 5.1s 0 0 0 0 0 0/5.0K
|
106
|
+
| 🏃 help-overview sonnet4 0.0s 0 0 0 0 0 0/1.0K
|
107
|
+
+================================+
|
108
|
+
```
|
109
|
+
|
110
|
+
## Budget Warning Only
|
111
|
+
```
|
112
|
+
zen --overall-token-budget 10000
|
113
|
+
```
|
114
|
+
```
|
115
|
+
+=== STATUS REPORT [14:47:44] ===+
|
116
|
+
| Total: 2 instances
|
117
|
+
| Running: 2, Completed: 0, Failed: 0, Pending: 0
|
118
|
+
| Tokens: 32.2K total, 32.2K cached | Median: 32.2K | Tools: 1
|
119
|
+
| 💰 Cost: $0.0818 total, $0.0409 avg/instance | Pricing: Claude compliant
|
120
|
+
|
|
121
|
+
| TOKEN BUDGET STATUS |
|
122
|
+
| Overall: [####################] 100% 32.2K/10.0K
|
123
|
+
| Command Budgets:
|
124
|
+
| /analyze-repository [####################] 100% 32.2K/5.0K
|
125
|
+
| /README [--------------------] 0% 0/1.0K
|
126
|
+
|
|
127
|
+
| 📝 Model shows actual Claude model used (critical for accurate cost tracking)
|
128
|
+
| 💡 Tip: Model may differ from your config - Claude routes requests intelligently
|
129
|
+
| Status Name Model Duration Overall Tokens Cache Cr Cache Rd Tools Budget
|
130
|
+
| -------- ------------------------------ ---------- ---------- -------- -------- -------- -------- ------ ----------
|
131
|
+
| 🏃 analyze-repo 35sonnet 10.1s 32.2K 5 20.9K 11.4K 1 32.2K/5.0K
|
132
|
+
| 🏃 help-overview opus4 5.0s 0 0 0 0 0 0/1.0K
|
133
|
+
+================================+
|
134
|
+
|
135
|
+
+=== TOOL USAGE DETAILS ===+
|
136
|
+
| Tool Name Uses Tokens Cost ($) Used By
|
137
|
+
| -------------------- -------- ---------- ---------- -----------------------------------
|
138
|
+
| Bash 1 33 0.0001 analyze-repo(1 uses, 33 tok)
|
139
|
+
| -------------------- -------- ---------- ---------- -----------------------------------
|
140
|
+
| TOTAL 1 33 0.0001
|
141
|
+
+===============================================================================================+
|
142
|
+
```
|
143
|
+
|
144
|
+
## Budget Block
|
145
|
+
```
|
146
|
+
zen --overall-token-budget 10000 --budget-enforcement-mode block
|
147
|
+
```
|
148
|
+
```
|
149
|
+
2025-09-18 14:50:42,050 - zen_orchestrator - INFO - 💰 BUDGET UPDATE [analyze-repo]: Recording 32240 tokens for command '/analyze-repository'
|
150
|
+
2025-09-18 14:50:42,050 - zen_orchestrator - INFO - 📊 BUDGET STATE [analyze-repo]: /analyze-repository now at 32240/5000 tokens (644.8%)
|
151
|
+
2025-09-18 14:50:42,050 - zen_orchestrator - ERROR - 🚫 🔴 RUNTIME TERMINATION: Runtime budget violation for analyze-repo: Overall budget exceeded: 32240/10000 tokens
|
152
|
+
2025-09-18 14:50:42,050 - zen_orchestrator - INFO - Terminating instance analyze-repo (PID: 88916): Terminated due to budget violation - Overall budget exceeded: 32240/10000 tokens
|
153
|
+
2025-09-18 14:50:42,050 - zen_orchestrator - INFO - Sent SIGTERM to analyze-repo (PID: 88916)
|
154
|
+
```
|
155
|
+
|
156
|
+
```
|
157
|
+
+=== FINAL STATUS [14:50:57] ===+
|
158
|
+
| Total: 2 instances
|
159
|
+
| Running: 0, Completed: 0, Failed: 2, Pending: 0
|
160
|
+
| Tokens: 85.6K total, 85.2K cached | Median: 42.8K | Tools: 1
|
161
|
+
| 💰 Cost: $0.0889 total, $0.0444 avg/instance | Pricing: Claude compliant
|
162
|
+
|
|
163
|
+
| TOKEN BUDGET STATUS |
|
164
|
+
| Overall: [####################] 100% 85.6K/10.0K
|
165
|
+
| Command Budgets:
|
166
|
+
| /analyze-repository [####################] 100% 48.4K/5.0K
|
167
|
+
| /README [####################] 100% 37.2K/1.0K
|
168
|
+
|
|
169
|
+
| 📝 Model shows actual Claude model used (critical for accurate cost tracking)
|
170
|
+
| 💡 Tip: Model may differ from your config - Claude routes requests intelligently
|
171
|
+
| Status Name Model Duration Overall Tokens Cache Cr Cache Rd Tools Budget
|
172
|
+
| -------- ------------------------------ ---------- ---------- -------- -------- -------- -------- ------ ----------
|
173
|
+
| ❌ analyze-repo sonnet4 22.5s 48.4K 31 16.1K 32.2K 1 48.4K/5.0K
|
174
|
+
| ❌ help-overview 35sonnet 16.2s 37.2K 422 0 36.8K 0 37.2K/1.0K
|
175
|
+
+===============================+
|
176
|
+
|
177
|
+
+=== TOOL USAGE DETAILS ===+
|
178
|
+
| Tool Name Uses Tokens Cost ($) Used By
|
179
|
+
| -------------------- -------- ---------- ---------- -----------------------------------
|
180
|
+
| Task 1 348 0.0010 analyze-repo(1 uses, 348 tok)
|
181
|
+
| -------------------- -------- ---------- ---------- -----------------------------------
|
182
|
+
| TOTAL 1 348 0.0010
|
183
|
+
+===============================================================================================+
|
184
|
+
```
|
185
|
+
|
186
|
+
# Example Start At
|
187
|
+
```
|
188
|
+
zen --start-at "2am"
|
189
|
+
```
|
190
|
+
|
191
|
+
```
|
192
|
+
...
|
193
|
+
2025-09-18 14:54:29,863 - zen_orchestrator - INFO - Added instance: analyze-repo - Analyze the repository structure and codebase
|
194
|
+
2025-09-18 14:54:29,863 - zen_orchestrator - INFO - Added instance: help-overview - Show project README and overview information
|
195
|
+
|
196
|
+
2025-09-18 14:54:29,863 - zen_orchestrator - INFO - Orchestration scheduled to start at: 2025-09-19 02:00:00
|
197
|
+
2025-09-18 14:54:29,863 - zen_orchestrator - INFO - Waiting 39930.1 seconds (11.1 hours) until start time...
|
198
|
+
```
|
199
|
+
|
200
|
+
# Example Command
|
201
|
+
** Assumes you have a claude command \runtests **
|
202
|
+
```
|
203
|
+
zen "/runtests"
|
204
|
+
```
|
205
|
+
```
|
206
|
+
...
|
207
|
+
2025-09-18 14:56:18,478 - zen_orchestrator - INFO - Added instance: direct-runtests-3337c2c5 - Direct execution of /runtests
|
208
|
+
2025-09-18 14:56:18,478 - zen_orchestrator - INFO - Starting Claude Code instance orchestration
|
209
|
+
2025-09-18 14:56:18,478 - zen_orchestrator - INFO - Starting 1 instances with 5.0s delay between launches (timeout: 10000s each)
|
210
|
+
2025-09-18 14:56:18,478 - zen_orchestrator - INFO - Now starting instance 'direct-runtests-3337c2c5' (after 0.0s delay)
|
211
|
+
|
212
|
+
```
|
213
|
+
# Example Config (Recommended Usage)
|
214
|
+
|
215
|
+
Your JSON file as `path\my_config.json`
|
216
|
+
```JSON
|
217
|
+
{
|
218
|
+
"instances": [
|
219
|
+
{
|
220
|
+
"name": "analyze-repository",
|
221
|
+
"command": "/analyze-repository; Spawn three subagents to understand how the information at this website is used in the zen directory. https://docs.claude.com/en/docs/about-claude/pricing#tool-use-pricing.",
|
222
|
+
"description": "Reads and understands the required portion of the repository",
|
223
|
+
"permission_mode": "bypassPermissions",
|
224
|
+
"output_format": "stream-json",
|
225
|
+
"max_tokens_per_command": 5000
|
226
|
+
}
|
227
|
+
]
|
228
|
+
}
|
229
|
+
```
|
230
|
+
```
|
231
|
+
zen --config path\my_config.json
|
232
|
+
```
|
233
|
+
|
234
|
+
```
|
235
|
+
...
|
236
|
+
|
237
|
+
2025-09-18 15:00:09,645 - zen_orchestrator - INFO - Loading config from config_example.json
|
238
|
+
|
239
|
+
2025-09-18 15:00:09,657 - zen_orchestrator - INFO - 🎯 Token transparency pricing engine enabled - Claude pricing compliance active
|
240
|
+
|
241
|
+
2025-09-18 15:00:09,657 - zen_orchestrator - WARNING - Command '/analyze-repository; Spawn three subagents to understand how the information at this website is used in the zen directory. https://docs.claude.com/en/docs/about-claude/pricing#tool-use-pricing.' not found in available commands
|
242
|
+
|
243
|
+
2025-09-18 15:00:09,657 - zen_orchestrator - INFO - Available commands: /clear, /compact, /help
|
244
|
+
|
245
|
+
2025-09-18 15:00:09,657 - zen_orchestrator - INFO - Added instance: analyze-repository - Reads and understands the required portion of the repository
|
246
|
+
|
247
|
+
2025-09-18 15:00:09,657 - zen_orchestrator - INFO - Starting Claude Code instance orchestration
|
248
|
+
|
249
|
+
2025-09-18 15:00:09,659 - zen_orchestrator - INFO - Starting 1 instances with 5.0s delay between launches (timeout: 10000s each)
|
250
|
+
|
251
|
+
2025-09-18 15:00:09,659 - zen_orchestrator - INFO - Now starting instance 'analyze-repository' (after 0.0s delay)
|
252
|
+
|
253
|
+
2025-09-18 15:00:09,659 - zen_orchestrator - INFO - Starting instance: analyze-repository
|
254
|
+
|
255
|
+
2025-09-18 15:00:09,665 - zen_orchestrator - INFO - Command: claude.CMD -p /analyze-repository; Spawn three subagents to understand how the information at this website is used in the zen directory. https://docs.claude.com/en/docs/about-claude/pricing#tool-use-pricing. --output-format=stream-json --permission-mode=bypassPermissions --verbose
|
256
|
+
|
257
|
+
2025-09-18 15:00:09,738 - zen_orchestrator - INFO - Permission mode: bypassPermissions (Platform: Windows)
|
258
|
+
2025-09-18 15:00:09,746 - zen_orchestrator - INFO - Instance analyze-repository started with PID 672
|
259
|
+
|
260
|
+
+=== STATUS REPORT [15:00:14] ===+
|
261
|
+
| Total: 1 instances
|
262
|
+
| Running: 1, Completed: 0, Failed: 0, Pending: 0
|
263
|
+
| Tokens: 0 total, 0 cached | Median: 0 | Tools: 0
|
264
|
+
| 💰 Cost: $0.0000 total, $0.0000 avg/instance | Pricing: Claude compliant
|
265
|
+
|
|
266
|
+
| 📝 Model shows actual Claude model used (critical for accurate cost tracking)
|
267
|
+
| 💡 Tip: Model may differ from your config - Claude routes requests intelligently
|
268
|
+
| Status Name Model Duration Overall Tokens Cache Cr Cache Rd Tools Budget
|
269
|
+
| -------- ------------------------------ ---------- ---------- -------- -------- -------- -------- ------ ----------
|
270
|
+
| 🏃 analyze-repository opus4 5.1s 0 0 0 0 0 -
|
271
|
+
+================================+
|
272
|
+
|
273
|
+
|
274
|
+
+=== STATUS REPORT [15:00:19] ===+
|
275
|
+
| Total: 1 instances
|
276
|
+
| Running: 1, Completed: 0, Failed: 0, Pending: 0
|
277
|
+
| Tokens: 14.7K total, 14.7K cached | Median: 14.7K | Tools: 0
|
278
|
+
| 💰 Cost: $0.0798 total, $0.0798 avg/instance | Pricing: Claude compliant
|
279
|
+
| Status Name Model Duration Overall Tokens Cache Cr Cache Rd Tools Budget
|
280
|
+
| -------- ------------------------------ ---------- ---------- -------- -------- -------- -------- ------ ----------
|
281
|
+
| 🏃 analyze-repository opus4 10.1s 14.7K 6 3.3K 11.4K 0 -
|
282
|
+
+================================+
|
283
|
+
|
284
|
+
```
|
285
|
+
|
86
286
|
|
87
287
|
## Inspiration and background
|
88
288
|
While developing Netra Apex (commercial product)
|
@@ -304,7 +504,7 @@ yields:
|
|
304
504
|
usage: zen [-h] [--workspace WORKSPACE] [--config CONFIG] [--dry-run] [--list-commands] [--inspect-command INSPECT_COMMAND]
|
305
505
|
[--output-format {json,stream-json}] [--timeout TIMEOUT] [--max-console-lines MAX_CONSOLE_LINES] [--quiet]
|
306
506
|
[--startup-delay STARTUP_DELAY] [--max-line-length MAX_LINE_LENGTH] [--status-report-interval STATUS_REPORT_INTERVAL]
|
307
|
-
[--start-at START_AT] [--
|
507
|
+
[--start-at START_AT] [--overall-token-budget OVERALL_TOKEN_BUDGET] [--command-budget COMMAND_BUDGET]
|
308
508
|
[--budget-enforcement-mode {warn,block}] [--disable-budget-visuals]
|
309
509
|
|
310
510
|
Claude Code Instance Orchestrator
|
@@ -1,15 +1,15 @@
|
|
1
|
-
zen_orchestrator.py,sha256=
|
1
|
+
zen_orchestrator.py,sha256=QApF_yEo7C8CUq_p8GGYJT2gPwMCLIMLSNIdFZFuxcI,144907
|
2
2
|
agent_interface/__init__.py,sha256=OsbOKzElHsxhVgak87oOx_u46QNgKmz-Reis-plAMwk,525
|
3
3
|
agent_interface/base_agent.py,sha256=GNskG9VaZgno7X24lQTpFdxUoQE0yJHLh0UPFJvOPn4,11098
|
4
|
-
netra_zen-1.0.
|
4
|
+
netra_zen-1.0.1.dist-info/licenses/LICENSE.md,sha256=PZrP0UDn58i4LjV4zijIQTnsQPvWm4zq9Fet9i7qgwI,80
|
5
5
|
token_budget/__init__.py,sha256=_2tmi72DGNtbYcZ-rGIxVKMytdkHFjzJaWz8bDhYACc,33
|
6
6
|
token_budget/budget_manager.py,sha256=VRWxKcGDtgJfIRh-ztYQ4-wuhBvddVJJnyoGfxCBlv0,9567
|
7
7
|
token_budget/models.py,sha256=14xFTk2-R1Ql0F9WLDof7vADrKC_5Fj7EE7UmZdoG00,2384
|
8
8
|
token_budget/visualization.py,sha256=SaNnZ15edHXtjDCA5Yfu7w3AztCZRYsYCPGBqzapupY,719
|
9
9
|
token_transparency/__init__.py,sha256=go86Rg4_VYAPLw3myVpLe1s1PbMu1llDTw1wfomP1lA,453
|
10
10
|
token_transparency/claude_pricing_engine.py,sha256=9zWQJS3HJEs_lljil-xT1cUvG-Jf3ykNAninJFyfNSM,12630
|
11
|
-
netra_zen-1.0.
|
12
|
-
netra_zen-1.0.
|
13
|
-
netra_zen-1.0.
|
14
|
-
netra_zen-1.0.
|
15
|
-
netra_zen-1.0.
|
11
|
+
netra_zen-1.0.1.dist-info/METADATA,sha256=ixxjb8v_zQKUIIoMXOPhfSXdrawdMMPWsOxAUBu_xCE,30220
|
12
|
+
netra_zen-1.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
13
|
+
netra_zen-1.0.1.dist-info/entry_points.txt,sha256=oDehCnPGZezG0m9ZWspxjHLHyQ3eERX87eojR4ljaRo,45
|
14
|
+
netra_zen-1.0.1.dist-info/top_level.txt,sha256=dHz-hgh_dfiiOUrPf8wW80fA31rfEYDFmA6fpu67Yjk,65
|
15
|
+
netra_zen-1.0.1.dist-info/RECORD,,
|
zen_orchestrator.py
CHANGED
@@ -180,7 +180,7 @@ class ClaudeInstanceOrchestrator:
|
|
180
180
|
|
181
181
|
def __init__(self, workspace_dir: Path, max_console_lines: int = 5, startup_delay: float = 1.0,
|
182
182
|
max_line_length: int = 500, status_report_interval: int = 30,
|
183
|
-
|
183
|
+
quiet: bool = False,
|
184
184
|
overall_token_budget: Optional[int] = None,
|
185
185
|
overall_cost_budget: Optional[float] = None,
|
186
186
|
budget_type: str = "tokens",
|
@@ -199,7 +199,6 @@ class ClaudeInstanceOrchestrator:
|
|
199
199
|
self.status_report_interval = status_report_interval # Seconds between status reports
|
200
200
|
self.last_status_report = time.time()
|
201
201
|
self.status_report_task = None # For the rolling status report task
|
202
|
-
self.use_cloud_sql = use_cloud_sql
|
203
202
|
self.quiet = quiet
|
204
203
|
self.log_level = log_level
|
205
204
|
self.batch_id = str(uuid4()) # Generate batch ID for this orchestration run
|
@@ -243,11 +242,6 @@ class ClaudeInstanceOrchestrator:
|
|
243
242
|
else:
|
244
243
|
logger.debug("Token budget tracking disabled (no budget specified)")
|
245
244
|
|
246
|
-
# Configure CloudSQL if requested
|
247
|
-
# CloudSQL functionality available with Netra Apex
|
248
|
-
if use_cloud_sql:
|
249
|
-
logger.warning("CloudSQL functionality has been disabled. Token metrics will be displayed locally only.")
|
250
|
-
logger.info("For data persistence, consider upgrading to Netra Apex.")
|
251
245
|
|
252
246
|
def log_at_level(self, level: LogLevel, message: str, log_func=None):
|
253
247
|
"""Log message only if current log level permits."""
|
@@ -2498,7 +2492,6 @@ async def main():
|
|
2498
2492
|
startup_delay=args.startup_delay,
|
2499
2493
|
max_line_length=args.max_line_length,
|
2500
2494
|
status_report_interval=args.status_report_interval,
|
2501
|
-
use_cloud_sql=args.use_cloud_sql,
|
2502
2495
|
quiet=args.quiet,
|
2503
2496
|
overall_token_budget=final_overall_budget,
|
2504
2497
|
overall_cost_budget=final_overall_cost_budget,
|
@@ -2726,9 +2719,6 @@ async def main():
|
|
2726
2719
|
|
2727
2720
|
# Run all instances
|
2728
2721
|
logger.info("Starting Claude Code instance orchestration")
|
2729
|
-
if args.use_cloud_sql:
|
2730
|
-
logger.info(f"Batch ID: {orchestrator.batch_id}")
|
2731
|
-
logger.info("Metrics will be saved to CloudSQL")
|
2732
2722
|
start_time = time.time()
|
2733
2723
|
|
2734
2724
|
results = await orchestrator.run_all_instances(args.timeout)
|
@@ -2867,12 +2857,6 @@ async def main():
|
|
2867
2857
|
print("🌐 Learn more: https://netrasystems.ai/")
|
2868
2858
|
print("="*80)
|
2869
2859
|
|
2870
|
-
# Show CloudSQL info if enabled
|
2871
|
-
if args.use_cloud_sql:
|
2872
|
-
print(f"\n📊 Local metrics displayed above")
|
2873
|
-
print(f" Batch ID: {orchestrator.batch_id}")
|
2874
|
-
print(f" Database persistence disabled for security")
|
2875
|
-
|
2876
2860
|
# Exit with appropriate code
|
2877
2861
|
sys.exit(0 if summary['failed'] == 0 else 1)
|
2878
2862
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|