navaia-code 1.0.50__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 (166) hide show
  1. navaia_code-1.0.50/.env.example +40 -0
  2. navaia_code-1.0.50/.genexa/commands/code.md +161 -0
  3. navaia_code-1.0.50/.genexa/commands/testSkill.md +12 -0
  4. navaia_code-1.0.50/.gitignore +18 -0
  5. navaia_code-1.0.50/BUILDING_AGENT_TEAMS.md +206 -0
  6. navaia_code-1.0.50/DEPLOYMENT.md +179 -0
  7. navaia_code-1.0.50/PKG-INFO +17 -0
  8. navaia_code-1.0.50/PLAN.md +2320 -0
  9. navaia_code-1.0.50/README.md +237 -0
  10. navaia_code-1.0.50/bin/navaia +7 -0
  11. navaia_code-1.0.50/enhancements.md +7 -0
  12. navaia_code-1.0.50/genexa/ui/widgets/todo_list.py +137 -0
  13. navaia_code-1.0.50/genexa/ui/widgets/todo_styles.py +17 -0
  14. navaia_code-1.0.50/learn.md +6 -0
  15. navaia_code-1.0.50/navaia/__init__.py +3 -0
  16. navaia_code-1.0.50/navaia/api/__init__.py +0 -0
  17. navaia_code-1.0.50/navaia/api/client.py +72 -0
  18. navaia_code-1.0.50/navaia/api/normalise.py +148 -0
  19. navaia_code-1.0.50/navaia/api/retry.py +114 -0
  20. navaia_code-1.0.50/navaia/api/streaming.py +341 -0
  21. navaia_code-1.0.50/navaia/api/types.py +213 -0
  22. navaia_code-1.0.50/navaia/commands/__init__.py +0 -0
  23. navaia_code-1.0.50/navaia/commands/builtin/__init__.py +0 -0
  24. navaia_code-1.0.50/navaia/commands/builtin/commands.py +206 -0
  25. navaia_code-1.0.50/navaia/commands/dispatcher.py +38 -0
  26. navaia_code-1.0.50/navaia/commands/parser.py +25 -0
  27. navaia_code-1.0.50/navaia/commands/registry.py +48 -0
  28. navaia_code-1.0.50/navaia/commands/skills.py +150 -0
  29. navaia_code-1.0.50/navaia/commands/types.py +26 -0
  30. navaia_code-1.0.50/navaia/compact/__init__.py +0 -0
  31. navaia_code-1.0.50/navaia/compact/compact.py +241 -0
  32. navaia_code-1.0.50/navaia/compact/prompt.py +22 -0
  33. navaia_code-1.0.50/navaia/compact/restore.py +91 -0
  34. navaia_code-1.0.50/navaia/config/__init__.py +0 -0
  35. navaia_code-1.0.50/navaia/config/env.py +53 -0
  36. navaia_code-1.0.50/navaia/config/global_config.py +43 -0
  37. navaia_code-1.0.50/navaia/config/project_config.py +53 -0
  38. navaia_code-1.0.50/navaia/config/providers.py +234 -0
  39. navaia_code-1.0.50/navaia/config/settings.py +113 -0
  40. navaia_code-1.0.50/navaia/context/__init__.py +0 -0
  41. navaia_code-1.0.50/navaia/context/cache.py +29 -0
  42. navaia_code-1.0.50/navaia/context/claudemd.py +252 -0
  43. navaia_code-1.0.50/navaia/context/system_prompt.py +172 -0
  44. navaia_code-1.0.50/navaia/effort/__init__.py +0 -0
  45. navaia_code-1.0.50/navaia/effort/effort.py +47 -0
  46. navaia_code-1.0.50/navaia/hooks/__init__.py +0 -0
  47. navaia_code-1.0.50/navaia/hooks/executor.py +153 -0
  48. navaia_code-1.0.50/navaia/hooks/settings.py +82 -0
  49. navaia_code-1.0.50/navaia/hooks/types.py +53 -0
  50. navaia_code-1.0.50/navaia/main.py +462 -0
  51. navaia_code-1.0.50/navaia/mcp/__init__.py +0 -0
  52. navaia_code-1.0.50/navaia/mcp/bootstrap.py +88 -0
  53. navaia_code-1.0.50/navaia/mcp/client.py +157 -0
  54. navaia_code-1.0.50/navaia/mcp/settings.py +80 -0
  55. navaia_code-1.0.50/navaia/mcp/tools.py +118 -0
  56. navaia_code-1.0.50/navaia/mcp/types.py +29 -0
  57. navaia_code-1.0.50/navaia/memory/__init__.py +0 -0
  58. navaia_code-1.0.50/navaia/memory/memdir.py +70 -0
  59. navaia_code-1.0.50/navaia/memory/paths.py +17 -0
  60. navaia_code-1.0.50/navaia/memory/scanner.py +85 -0
  61. navaia_code-1.0.50/navaia/memory/types.py +27 -0
  62. navaia_code-1.0.50/navaia/permissions/__init__.py +0 -0
  63. navaia_code-1.0.50/navaia/permissions/checker.py +147 -0
  64. navaia_code-1.0.50/navaia/permissions/rules.py +88 -0
  65. navaia_code-1.0.50/navaia/permissions/types.py +39 -0
  66. navaia_code-1.0.50/navaia/query/__init__.py +0 -0
  67. navaia_code-1.0.50/navaia/query/engine.py +477 -0
  68. navaia_code-1.0.50/navaia/query/types.py +43 -0
  69. navaia_code-1.0.50/navaia/session/__init__.py +0 -0
  70. navaia_code-1.0.50/navaia/session/history.py +64 -0
  71. navaia_code-1.0.50/navaia/session/serialise.py +184 -0
  72. navaia_code-1.0.50/navaia/session/state.py +20 -0
  73. navaia_code-1.0.50/navaia/session/storage.py +102 -0
  74. navaia_code-1.0.50/navaia/session/store.py +202 -0
  75. navaia_code-1.0.50/navaia/state/__init__.py +0 -0
  76. navaia_code-1.0.50/navaia/tasks/__init__.py +0 -0
  77. navaia_code-1.0.50/navaia/tasks/cron.py +113 -0
  78. navaia_code-1.0.50/navaia/tasks/manager.py +112 -0
  79. navaia_code-1.0.50/navaia/tasks/persistence.py +128 -0
  80. navaia_code-1.0.50/navaia/tasks/task.py +34 -0
  81. navaia_code-1.0.50/navaia/thinking/__init__.py +0 -0
  82. navaia_code-1.0.50/navaia/thinking/budget.py +42 -0
  83. navaia_code-1.0.50/navaia/thinking/config.py +55 -0
  84. navaia_code-1.0.50/navaia/tools/__init__.py +0 -0
  85. navaia_code-1.0.50/navaia/tools/agent_tool/__init__.py +0 -0
  86. navaia_code-1.0.50/navaia/tools/agent_tool/tool.py +148 -0
  87. navaia_code-1.0.50/navaia/tools/ask_user/__init__.py +0 -0
  88. navaia_code-1.0.50/navaia/tools/ask_user/bus.py +51 -0
  89. navaia_code-1.0.50/navaia/tools/ask_user/tool.py +64 -0
  90. navaia_code-1.0.50/navaia/tools/base.py +51 -0
  91. navaia_code-1.0.50/navaia/tools/bash/__init__.py +0 -0
  92. navaia_code-1.0.50/navaia/tools/bash/background.py +123 -0
  93. navaia_code-1.0.50/navaia/tools/bash/tool.py +234 -0
  94. navaia_code-1.0.50/navaia/tools/executor.py +111 -0
  95. navaia_code-1.0.50/navaia/tools/file_edit/__init__.py +0 -0
  96. navaia_code-1.0.50/navaia/tools/file_edit/tool.py +206 -0
  97. navaia_code-1.0.50/navaia/tools/file_read/__init__.py +0 -0
  98. navaia_code-1.0.50/navaia/tools/file_read/tool.py +209 -0
  99. navaia_code-1.0.50/navaia/tools/file_write/__init__.py +0 -0
  100. navaia_code-1.0.50/navaia/tools/file_write/tool.py +112 -0
  101. navaia_code-1.0.50/navaia/tools/glob_tool/__init__.py +0 -0
  102. navaia_code-1.0.50/navaia/tools/glob_tool/tool.py +97 -0
  103. navaia_code-1.0.50/navaia/tools/grep_tool/__init__.py +0 -0
  104. navaia_code-1.0.50/navaia/tools/grep_tool/tool.py +292 -0
  105. navaia_code-1.0.50/navaia/tools/monitor/__init__.py +0 -0
  106. navaia_code-1.0.50/navaia/tools/monitor/tool.py +101 -0
  107. navaia_code-1.0.50/navaia/tools/plan_mode/__init__.py +0 -0
  108. navaia_code-1.0.50/navaia/tools/plan_mode/enter.py +38 -0
  109. navaia_code-1.0.50/navaia/tools/plan_mode/exit.py +36 -0
  110. navaia_code-1.0.50/navaia/tools/registry.py +71 -0
  111. navaia_code-1.0.50/navaia/tools/result_storage.py +60 -0
  112. navaia_code-1.0.50/navaia/tools/skill_tool/__init__.py +0 -0
  113. navaia_code-1.0.50/navaia/tools/skill_tool/loader.py +147 -0
  114. navaia_code-1.0.50/navaia/tools/skill_tool/tool.py +88 -0
  115. navaia_code-1.0.50/navaia/tools/task_tools/__init__.py +0 -0
  116. navaia_code-1.0.50/navaia/tools/task_tools/create.py +60 -0
  117. navaia_code-1.0.50/navaia/tools/task_tools/get.py +52 -0
  118. navaia_code-1.0.50/navaia/tools/task_tools/list.py +39 -0
  119. navaia_code-1.0.50/navaia/tools/task_tools/manager.py +66 -0
  120. navaia_code-1.0.50/navaia/tools/task_tools/update.py +88 -0
  121. navaia_code-1.0.50/navaia/tools/todo_write/__init__.py +0 -0
  122. navaia_code-1.0.50/navaia/tools/todo_write/tool.py +121 -0
  123. navaia_code-1.0.50/navaia/tools/tool_search/__init__.py +0 -0
  124. navaia_code-1.0.50/navaia/tools/tool_search/tool.py +106 -0
  125. navaia_code-1.0.50/navaia/tools/web_fetch/__init__.py +0 -0
  126. navaia_code-1.0.50/navaia/tools/web_fetch/tool.py +88 -0
  127. navaia_code-1.0.50/navaia/tools/worktree/__init__.py +0 -0
  128. navaia_code-1.0.50/navaia/tools/worktree/enter.py +66 -0
  129. navaia_code-1.0.50/navaia/tools/worktree/exit.py +51 -0
  130. navaia_code-1.0.50/navaia/tools/worktree/manager.py +130 -0
  131. navaia_code-1.0.50/navaia/ui/__init__.py +0 -0
  132. navaia_code-1.0.50/navaia/ui/app.py +605 -0
  133. navaia_code-1.0.50/navaia/ui/bidi.py +70 -0
  134. navaia_code-1.0.50/navaia/ui/input/__init__.py +0 -0
  135. navaia_code-1.0.50/navaia/ui/input/history.py +84 -0
  136. navaia_code-1.0.50/navaia/ui/input/suggestions.py +72 -0
  137. navaia_code-1.0.50/navaia/ui/messages/__init__.py +0 -0
  138. navaia_code-1.0.50/navaia/ui/messages/assistant_text.py +46 -0
  139. navaia_code-1.0.50/navaia/ui/messages/bash_output.py +68 -0
  140. navaia_code-1.0.50/navaia/ui/messages/system_msg.py +25 -0
  141. navaia_code-1.0.50/navaia/ui/messages/tool_result.py +38 -0
  142. navaia_code-1.0.50/navaia/ui/messages/tool_use.py +70 -0
  143. navaia_code-1.0.50/navaia/ui/messages/user_prompt.py +27 -0
  144. navaia_code-1.0.50/navaia/ui/screens/__init__.py +0 -0
  145. navaia_code-1.0.50/navaia/ui/screens/repl.py +136 -0
  146. navaia_code-1.0.50/navaia/ui/styles/app.tcss +48 -0
  147. navaia_code-1.0.50/navaia/ui/widgets/__init__.py +0 -0
  148. navaia_code-1.0.50/navaia/ui/widgets/logo.py +48 -0
  149. navaia_code-1.0.50/navaia/ui/widgets/markdown_view.py +87 -0
  150. navaia_code-1.0.50/navaia/ui/widgets/message_list.py +387 -0
  151. navaia_code-1.0.50/navaia/ui/widgets/permission_prompt.py +137 -0
  152. navaia_code-1.0.50/navaia/ui/widgets/prompt_footer.py +67 -0
  153. navaia_code-1.0.50/navaia/ui/widgets/prompt_input.py +203 -0
  154. navaia_code-1.0.50/navaia/ui/widgets/question_prompt.py +58 -0
  155. navaia_code-1.0.50/navaia/ui/widgets/spinner.py +110 -0
  156. navaia_code-1.0.50/navaia/ui/widgets/thinking_view.py +124 -0
  157. navaia_code-1.0.50/pyproject.toml +29 -0
  158. navaia_code-1.0.50/setup.sh +103 -0
  159. navaia_code-1.0.50/test_deep.py +552 -0
  160. navaia_code-1.0.50/test_deep_fixes.py +493 -0
  161. navaia_code-1.0.50/test_deep_phase2.py +294 -0
  162. navaia_code-1.0.50/test_distribution.py +335 -0
  163. navaia_code-1.0.50/test_error_recovery.py +261 -0
  164. navaia_code-1.0.50/test_skill_flow.py +136 -0
  165. navaia_code-1.0.50/test_stress.py +397 -0
  166. navaia_code-1.0.50/test_tool_events.py +287 -0
@@ -0,0 +1,40 @@
1
+ # Navaia Code — LLM provider configuration
2
+ # Copy to .env and fill in your values.
3
+
4
+ # Which provider to use. One of: openrouter | internal | qwen | ollama
5
+ NAVAIA_PROVIDER=openrouter
6
+
7
+ # --- OpenRouter (cloud) ---
8
+ OPENROUTER_API_KEY=sk-or-v1-your-key-here
9
+ # NAVAIA_OPENROUTER_BASE_URL=https://openrouter.ai/api/v1
10
+ # Default is gpt-oss-120b.
11
+ # Swap for a different one by uncommenting and editing:
12
+ # NAVAIA_OPENROUTER_MODEL=gpt-oss-120b
13
+ # NAVAIA_OPENROUTER_MODEL=minimax/minimax-m2
14
+ # NAVAIA_OPENROUTER_MODEL=anthropic/claude-sonnet-4.6
15
+ # NAVAIA_OPENROUTER_MODEL=openai/gpt-4o
16
+ # NAVAIA_OPENROUTER_TIMEOUT=120
17
+
18
+ # --- Internal vLLM (no API key needed) ---
19
+ # NAVAIA_INTERNAL_BASE_URL=https://ngx.tawakkalna.nic.gov.sa/v1
20
+ # NAVAIA_INTERNAL_MODEL=/models/gpt-oss-120b
21
+ # NAVAIA_INTERNAL_TIMEOUT=500
22
+ # NAVAIA_INTERNAL_VERIFY_SSL=false
23
+
24
+ # --- Local Qwen (or any OpenAI-compatible server you host) ---
25
+ # Works with vLLM, llama.cpp --server, LM Studio, text-generation-webui, SGLang, etc.
26
+ # Start your server first, then point these at it:
27
+ # vLLM: python -m vllm.entrypoints.openai.api_server --model Qwen/Qwen2.5-7B-Instruct --port 8000
28
+ # llama.cpp: ./server -m qwen2.5-7b-instruct-q4.gguf --port 8080
29
+ # LM Studio: enable "Local Server" tab (default :1234)
30
+ # NAVAIA_QWEN_BASE_URL=http://localhost:8000/v1
31
+ # NAVAIA_QWEN_MODEL=Qwen/Qwen2.5-7B-Instruct
32
+ # NAVAIA_QWEN_TIMEOUT=300
33
+ # NAVAIA_QWEN_VERIFY_SSL=true
34
+ # QWEN_API_KEY=empty # most local servers don't check this
35
+
36
+ # --- Ollama (local, default port 11434) ---
37
+ # Run `ollama pull qwen2.5:7b` then `ollama serve`, then:
38
+ # NAVAIA_OLLAMA_BASE_URL=http://localhost:11434/v1
39
+ # NAVAIA_OLLAMA_MODEL=qwen2.5:7b
40
+ # NAVAIA_OLLAMA_TIMEOUT=300
@@ -0,0 +1,161 @@
1
+ ---
2
+ name: code
3
+ description: How to approach any coding task — plan a todo list, tell the user, do the work, and verify every change with a shell command before claiming success.
4
+ ---
5
+
6
+ # /code — Disciplined Coding Workflow
7
+
8
+ You are about to write or change code. Many small mistakes come from skipping
9
+ structure: jumping to an edit before understanding the file, claiming a change
10
+ landed without checking, or doing several steps silently and losing the user.
11
+ Follow the workflow below **every time** you do a coding task. Do not skip
12
+ steps "because the task looks small" — the workflow is what keeps small tasks
13
+ from turning into broken ones.
14
+
15
+ ---
16
+
17
+ ## 1. Understand before you touch
18
+
19
+ Before writing or editing any file:
20
+
21
+ 1. **Restate the task** in one or two sentences so the user can correct you
22
+ early if you misunderstood.
23
+ 2. **Read the relevant files first.** Use the `Read` tool on the exact file
24
+ you intend to change. If you do not know which file, use `Grep` / `Glob`
25
+ to locate it. Never edit a file you have not read in this session.
26
+ 3. **Identify the smallest correct change.** Do not refactor surrounding
27
+ code, do not "improve" unrelated logic, do not add features that were
28
+ not requested.
29
+
30
+ If anything is ambiguous, ask the user one focused question instead of
31
+ guessing.
32
+
33
+ ---
34
+
35
+ ## 2. Make a todo list — and show it
36
+
37
+ For any task with **more than one step** (which is almost every coding task),
38
+ use the `TodoWrite` tool to record the plan **before** you start editing.
39
+
40
+ Rules for the todo list:
41
+
42
+ - One concrete action per item. Bad: "fix bug". Good:
43
+ "Add `--retry` flag to `genexa/cli.py:parse_args`".
44
+ - Order items in the sequence you will actually do them.
45
+ - Include a final verification item (see step 4).
46
+ - Mark exactly **one** item as `in_progress` at a time. Mark it `completed`
47
+ the moment that step is done — do not batch completions at the end.
48
+
49
+ **Tell the user the plan.** After calling `TodoWrite`, write a short message
50
+ to the user that says, in plain prose, what you are about to do. Example:
51
+
52
+ > Here's the plan:
53
+ > 1. Read `genexa/foo.py` to find the handler.
54
+ > 2. Add a `timeout` parameter with default `30`.
55
+ > 3. Update the one call site in `genexa/bar.py`.
56
+ > 4. Run the test file to confirm nothing broke.
57
+
58
+ Then start step 1. Whenever you move to the next item, update the todo list
59
+ with `TodoWrite` and briefly tell the user which step you are on. The user
60
+ should always know which step is active without having to ask.
61
+
62
+ ---
63
+
64
+ ## 3. Make the change
65
+
66
+ For each item on the todo list:
67
+
68
+ - Use `Edit` for modifying existing files. Use `Write` only for creating new
69
+ files or full rewrites — `Write` will overwrite. You **must** have used
70
+ `Read` on the file first.
71
+ - Keep the diff minimal. Only change what the step calls for.
72
+ - Preserve existing style: indentation, quoting, import order, type-hint
73
+ conventions. Match the file you are editing.
74
+ - Do not add comments, docstrings, or type annotations to code you did not
75
+ change.
76
+ - Do not add error handling for situations that cannot happen, and do not
77
+ add backwards-compatibility shims unless the user asked.
78
+
79
+ ---
80
+
81
+ ## 4. Verify every change with a shell command (mandatory)
82
+
83
+ After **every** file write or edit, run a `Bash` command that proves the
84
+ change is actually on disk and correct. Never claim "added" or "done" based
85
+ on the tool's success message alone — the tool can succeed and the content
86
+ can still be wrong (wrong path, wrong indent, partial replacement, stale
87
+ content from a tool error).
88
+
89
+ Pick the verification that fits the change. Examples:
90
+
91
+ - **Added a new file** → confirm it exists and inspect it:
92
+ ```
93
+ ls -la <path> && wc -l <path> && sed -n '1,40p' <path>
94
+ ```
95
+ - **Added a function / symbol** → grep for the new symbol in the file:
96
+ ```
97
+ grep -n "def my_new_function" <path>
98
+ ```
99
+ - **Edited an existing line** → grep for the new content AND confirm the
100
+ old content is gone:
101
+ ```
102
+ grep -n "new_text" <path>
103
+ grep -n "old_text" <path> # should print nothing
104
+ ```
105
+ - **Added an import or config key** → grep for it in the actual file.
106
+ - **New CLI flag / behavior** → run the command and check the output:
107
+ ```
108
+ python -m genexa --help | grep -- --retry
109
+ ```
110
+ - **Python change** → at minimum, byte-compile to catch syntax errors:
111
+ ```
112
+ python -m py_compile <path>
113
+ ```
114
+ If tests exist for the area, run only the relevant ones:
115
+ ```
116
+ pytest tests/test_foo.py -k my_change -q
117
+ ```
118
+
119
+ If verification fails:
120
+
121
+ 1. **Stop.** Do not move to the next todo item.
122
+ 2. Re-read the file with `Read` to see the real current state.
123
+ 3. Diagnose the root cause — wrong path, wrong `old_string`, indentation
124
+ mismatch, etc. Do not retry the identical action blindly.
125
+ 4. Fix it, then verify again.
126
+
127
+ Only mark the todo item `completed` once the verification command shows the
128
+ expected result.
129
+
130
+ ---
131
+
132
+ ## 5. Keep the user informed
133
+
134
+ Communicate proactively but tersely:
135
+
136
+ - Announce the plan once, after `TodoWrite` (step 2).
137
+ - When you move to a new step, say which step in one short line.
138
+ - When verification passes, say so in one short line (e.g. "Verified:
139
+ `grep` shows the new import on line 12.").
140
+ - When verification fails, say so plainly and describe what you will do
141
+ next.
142
+ - At the very end, give a short summary: which files changed, what each
143
+ change does, and how you verified it.
144
+
145
+ Do **not** narrate every keystroke, do not paste the full file back, and do
146
+ not summarize what the user can already see in the diff.
147
+
148
+ ---
149
+
150
+ ## 6. Finishing
151
+
152
+ Before you tell the user the task is complete:
153
+
154
+ - [ ] Every todo item is `completed` (none `in_progress`, none `pending`).
155
+ - [ ] Every file change has a passing verification command on the record.
156
+ - [ ] No unrelated files were modified.
157
+ - [ ] No secrets, API keys, or credentials were added to source.
158
+ - [ ] If you ran tests, they passed; if you did not, you said so honestly.
159
+
160
+ Then give the final summary to the user. If anything is incomplete, say so
161
+ explicitly — never claim success you have not verified.
@@ -0,0 +1,12 @@
1
+ ---
2
+ description: A throwaway skill used to verify slash-command discovery and dispatch.
3
+ ---
4
+
5
+ # testSkill
6
+
7
+ You are running the testSkill command. Respond with exactly one line:
8
+
9
+ `TESTSKILL_OK <args>`
10
+
11
+ where `<args>` is whatever was passed after /testSkill (or `NONE` if no args).
12
+ Do not explain anything. Do not add any other text.
@@ -0,0 +1,18 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.pyc
4
+ .env
5
+ dist/
6
+ build/
7
+ *.egg-info/
8
+ .mypy_cache/
9
+ .pytest_cache/
10
+ .coverage
11
+ .coverage.*
12
+ htmlcov/
13
+ .ruff_cache/
14
+ .DS_Store
15
+ ~/.navaia/
16
+
17
+ p.enc
18
+ recovered_model.zip
@@ -0,0 +1,206 @@
1
+ # Building Agent Teams with Navaia
2
+
3
+ > Onboarding guide for the **Navaia Code** + **NavaiaForge SDK** stack.
4
+ > If you've just been added as a collaborator, start here.
5
+
6
+ ---
7
+
8
+ ## The two repos, and how they fit together
9
+
10
+ You have access to two repos that together form the Navaia development stack:
11
+
12
+ | Repo | What it is | Stack |
13
+ |---|---|---|
14
+ | [`NavaiaSolutions/navaia-code-main`](https://github.com/NavaiaSolutions/navaia-code-main) | **Navaia Code** — a self-hosted terminal AI coding agent. Your AI pair-programmer for writing SDK integrations, scripts, and infrastructure. | Python (Textual TUI) |
15
+ | [`NavaiaSolutions/navaia-forge-sdk`](https://github.com/NavaiaSolutions/navaia-forge-sdk) | **NavaiaForge SDK** — the official SDK to build, deploy, and orchestrate AI workforces on the NavaiaForge platform. | TypeScript + Python |
16
+
17
+ ### How they integrate
18
+
19
+ ```
20
+ ┌──────────────────────────────┐ ┌──────────────────────────────┐
21
+ │ navaia-code-main │ │ navaia-forge-sdk │
22
+ │ (your dev tool) │ │ (what you build with) │
23
+ │ │ ─────▶ │ │
24
+ │ AI pair-programmer in your │ writes │ Programmatic API to create │
25
+ │ terminal. 50+ tools, MCP, │ code │ workforces, agents, tasks, │
26
+ │ any OpenAI-compatible LLM. │ │ knowledge, observability. │
27
+ └──────────────────────────────┘ └──────────────────────────────┘
28
+
29
+
30
+ Calls the NavaiaForge platform
31
+ (api.navaia.com) → spawns and
32
+ runs your agent teams.
33
+ ```
34
+
35
+ - **navaia-forge-sdk** is the product. Your shipped work lives here.
36
+ - **navaia-code-main** is internal tooling — install once, use it to write SDK code faster. Not required to ship, but recommended.
37
+ - Loop: open Navaia Code in the SDK repo → tell it what to build → it edits files, runs tests, opens PRs → you ship faster workforces.
38
+
39
+ ---
40
+
41
+ ## Setup (≈5 minutes)
42
+
43
+ ### 1. Clone both repos
44
+
45
+ ```bash
46
+ git clone git@github.com:NavaiaSolutions/navaia-forge-sdk.git
47
+ git clone git@github.com:NavaiaSolutions/navaia-code-main.git
48
+ ```
49
+
50
+ ### 2. Install Navaia Code (the dev tool)
51
+
52
+ ```bash
53
+ cd navaia-code-main
54
+ ./setup.sh --global # symlinks `navaia` into ~/.local/bin
55
+ cp .env.example .env
56
+ # Edit .env: set OPENROUTER_API_KEY (or your provider key)
57
+ navaia # launch interactive UI
58
+ ```
59
+
60
+ Provider options live in `.env`: OpenRouter (cloud, easiest), Ollama (local), vLLM/llama.cpp/LM Studio, or an internal vLLM deployment.
61
+
62
+ ### 3. Install the SDK (the product)
63
+
64
+ ```bash
65
+ cd navaia-forge-sdk
66
+
67
+ # TypeScript
68
+ cd packages/typescript && npm install && npm test
69
+
70
+ # Python
71
+ cd packages/python && pip install -e ".[dev]" && pytest
72
+ ```
73
+
74
+ ### 4. Use them together
75
+
76
+ From inside `navaia-forge-sdk/`:
77
+
78
+ ```bash
79
+ navaia # opens Navaia Code in the SDK repo
80
+ > "Add a retry helper to the Python tasks client and tests for it."
81
+ ```
82
+
83
+ Navaia Code will read the codebase, write the change on a feature branch, run tests, and prepare a PR.
84
+
85
+ ---
86
+
87
+ ## Build your first agent team
88
+
89
+ ### TypeScript
90
+
91
+ ```ts
92
+ import { NavaiaForge } from "@navaia/forge";
93
+
94
+ const nf = new NavaiaForge({
95
+ apiKey: process.env.NAVAIA_API_KEY!,
96
+ baseUrl: "https://api.navaia.com",
97
+ });
98
+
99
+ const workforce = await nf.workforces.create({ name: "Research Crew" });
100
+
101
+ const researcher = await nf.agents.create({
102
+ workforce_id: workforce.id,
103
+ name: "Researcher",
104
+ role: "research",
105
+ instructions: "Find and summarize info on any topic.",
106
+ model_provider: "anthropic",
107
+ model_name: "sonnet",
108
+ });
109
+
110
+ const task = await nf.tasks.create({
111
+ workforce_id: workforce.id,
112
+ agent_id: researcher.id,
113
+ title: "Summarize AI trends in 2026",
114
+ });
115
+
116
+ console.log((await nf.tasks.waitForCompletion(task.id)).result);
117
+ ```
118
+
119
+ ### Python
120
+
121
+ ```python
122
+ from navaia_forge import NavaiaForgeClient
123
+
124
+ client = NavaiaForgeClient(
125
+ base_url="https://api.navaia.com",
126
+ api_key="nf_your_api_key",
127
+ )
128
+
129
+ workforce = client.workforces.create(name="Research Crew")
130
+
131
+ researcher = client.agents.create(
132
+ workforce_id=workforce["id"],
133
+ name="Researcher",
134
+ role="research",
135
+ instructions="Find and summarize info on any topic.",
136
+ model_provider="anthropic",
137
+ model_name="sonnet",
138
+ )
139
+
140
+ task = client.tasks.create(
141
+ workforce_id=workforce["id"],
142
+ agent_id=researcher["id"],
143
+ title="Summarize AI trends in 2026",
144
+ )
145
+
146
+ print(client.tasks.wait_for_completion(task["id"])["result"])
147
+ ```
148
+
149
+ See the SDK repo's `examples/` and `templates/` directories for ready-to-fork workforces (multi-agent crews, RAG-powered support bots, etc.).
150
+
151
+ ---
152
+
153
+ ## SDK surface area
154
+
155
+ The SDK gives you full access to the NavaiaForge API:
156
+
157
+ | Resource | Use it for |
158
+ |---|---|
159
+ | **Workforces** | Create and manage AI workforces (collections of agents) |
160
+ | **Agents** | Configure agents with roles, instructions, and models |
161
+ | **Tasks** | Submit tasks, approve/reject, retry, poll for results |
162
+ | **Conversations** | Chat with agents in real-time |
163
+ | **Knowledge** | Upload documents for RAG-powered agents |
164
+ | **Templates** | Browse and instantiate pre-built workforce templates |
165
+ | **Observability** | Monitor token usage, costs, and performance metrics |
166
+ | **Integrations** | Connect third-party services |
167
+
168
+ ---
169
+
170
+ ## Branch workflow (enforced)
171
+
172
+ Three branches are protected on both repos: **`main`**, **`develop`**, **`release`**.
173
+
174
+ - ❌ Direct pushes to `main` / `develop` / `release` are **rejected**.
175
+ - ✅ Branch off `develop`, push, open a PR.
176
+ - ✅ PR needs 1 approval and all conversations resolved before merge.
177
+ - ✅ Only the maintainer (RekAlrasheed) can merge into the protected branches.
178
+
179
+ ```bash
180
+ # In either repo
181
+ git checkout develop && git pull
182
+ git checkout -b feat/your-feature
183
+ # ... edit, commit ...
184
+ git push -u origin feat/your-feature
185
+ gh pr create --base develop # PR into develop, NOT main
186
+ ```
187
+
188
+ **Flow:** feature branches → `develop` → cut to `release` → merge to `main` for tagged releases.
189
+
190
+ ### Commit style
191
+
192
+ Conventional commits: `feat:`, `fix:`, `refactor:`, `docs:`, `test:`, `chore:`, `perf:`, `ci:`.
193
+
194
+ ```
195
+ feat(tasks): add exponential-backoff retry to wait_for_completion
196
+ ```
197
+
198
+ ---
199
+
200
+ ## Need help?
201
+
202
+ - Open a GitHub issue on the relevant repo.
203
+ - Platform endpoint: `https://api.navaia.com` — ask the maintainer for an API key.
204
+ - Provider config / Navaia Code questions: see this repo's `README.md` and `PLAN.md`.
205
+
206
+ Welcome aboard. Now go build a workforce.
@@ -0,0 +1,179 @@
1
+ # Deployment
2
+
3
+ How to ship Genexa Code to internal users and capture usage.
4
+
5
+ ---
6
+
7
+ ## 1. Architecture
8
+
9
+ ```
10
+ ┌──────────────────────────┐
11
+ │ Dev laptop │
12
+ │ genexa CLI (pipx) │
13
+ │ ~/.genexa/config.toml │
14
+ └──┬───────┬───────┬───────┘
15
+ │ LLM │ OTLP │ telemetry events
16
+ ▼ ▼ ▼
17
+ Providers Phoenix TWK backend
18
+ (optional)
19
+ ```
20
+
21
+ - Distribution: **internal git repo** — users clone, run a script. No URL hosting, no IT.
22
+ - Observability: pick one (or both) — **Phoenix tracing** (recommended, no backend work) or **TWK backend telemetry** (custom events table).
23
+
24
+ ---
25
+
26
+ ## 2. Distribution mode (pick one)
27
+
28
+ End-user flow is identical in both. Only difference is whether installed files are readable Python.
29
+
30
+ | | Mode A — Source as-is | Mode B — PyArmor obfuscated |
31
+ |---|---|---|
32
+ | Source visible to user | Yes | No (encrypted bytecode) |
33
+ | Same upgrade UX | yes | yes |
34
+ | Extra build step | None | `pyarmor gen` in CI |
35
+ | Repo users clone | `genexa-code` | `genexa-dist` (built artifact repo) |
36
+
37
+ ---
38
+
39
+ ## 3. End-user flow
40
+
41
+ ### First install (one time)
42
+
43
+ ```bash
44
+ git clone https://<repo>.git ~/.genexa/src
45
+ cd ~/.genexa/src && ./install.sh
46
+ ```
47
+
48
+ `install.sh` verifies Python ≥ 3.12, installs `pipx` if missing, runs `pipx install .`, then `genexa init` for config.
49
+
50
+ ### Use
51
+
52
+ ```bash
53
+ genexa # interactive TUI
54
+ genexa -p "fix this bug" # one-shot
55
+ ```
56
+
57
+ ### Upgrade
58
+
59
+ ```bash
60
+ genexa upgrade
61
+ ```
62
+
63
+ Pulls the cloned repo, reinstalls, prints version diff:
64
+
65
+ ```
66
+ Current: 1.0.50 → Latest: 1.0.51
67
+ Done.
68
+ ```
69
+
70
+ Startup also shows a non-blocking banner when a newer tag exists.
71
+
72
+ ### Uninstall
73
+
74
+ ```bash
75
+ pipx uninstall genexa-code && rm -rf ~/.genexa
76
+ ```
77
+
78
+ ---
79
+
80
+ ## 4. Observability (pick one or both)
81
+
82
+ ### Option 1 — Phoenix tracing (Easiest)
83
+
84
+ Phoenix instrumentation runs **inside the CLI**. Each user's LLM calls emit OTLP traces directly to the internal Phoenix collector. No backend changes.
85
+
86
+ Captures: full LLM calls (prompts, completions, tokens, latency, model, errors), tool calls, tagged under project `"Genexa-Code"`. Per-user via `install_id` attribute.
87
+
88
+ Needs: deps `arize-phoenix-otel` + `openinference-instrumentation-openai`, one `register()` call at startup, config:
89
+
90
+ ```toml
91
+ [phoenix]
92
+ enabled = true
93
+ endpoint = "https://phoenix.corp.internal"
94
+ ```
95
+
96
+ Kill switch: `GENEXA_PHOENIX_ENABLED=0`.
97
+
98
+ ### Option 2 — Genexa backend telemetry (custom events)
99
+
100
+ CLI POSTs anonymized usage events to a new endpoint in the TWK QA Portal backend. Stored in Postgres for custom dashboards.
101
+
102
+ Captures: session counts, token totals, provider/model mix, error types, version, OS. **No prompts or content.**
103
+
104
+ Needs:
105
+ - **Backend:** new SQLAlchemy model + alembic migration for `genexa_telemetry_events`, new router `POST /api/v1/genexa-telemetry/events`, PAT auth (reuse existing PAT pattern), one line in `main.py` to register router.
106
+ - **CLI:** `genexa/telemetry/` module (client + disk spool + retry), event hooks in the query engine, config:
107
+
108
+ ```toml
109
+ [telemetry]
110
+ enabled = true
111
+ endpoint = "https://<twk-host>/genexa/api/v1/genexa-telemetry/events"
112
+ pat = "<from TWK portal>"
113
+ ```
114
+
115
+ Kill switch: `GENEXA_TELEMETRY=0`.
116
+
117
+ ### When to pick which
118
+
119
+ - **Phoenix only** — fastest to ship, best for debugging quality issues, reuses existing infra.
120
+ - **Backend only** — when more data and dashboard needed, recieving whats needed only.
121
+ - **Both** — Phoenix for engineering, backend for PM/usage dashboards.
122
+
123
+ ---
124
+
125
+ ## 5. Release flow
126
+
127
+ Single source of truth: `version` in `pyproject.toml`. Git tags as `v<version>`.
128
+
129
+ ### Mode A
130
+
131
+ 1. Bump `version` in `pyproject.toml`.
132
+ 2. Commit + `git tag v1.0.51 && git push --tags`.
133
+
134
+ End users get it on next `genexa upgrade`.
135
+
136
+ ### Mode B
137
+
138
+ CI on tag in `genexa-code`:
139
+
140
+ 1. Build with `pyarmor gen`.
141
+ 2. Push artifact tree + matching tag to `genexa-dist` repo.
142
+
143
+ End users (pointed at `genexa-dist`) get it on next `genexa upgrade`.
144
+
145
+ ---
146
+
147
+ ## 6. Build checklist
148
+
149
+ Nothing on this list exists yet.
150
+
151
+ **Genexa Code repo (always):**
152
+ - [ ] `install.sh` at repo root.
153
+ - [ ] `genexa init` subcommand (config wizard).
154
+ - [ ] `genexa upgrade` subcommand (git pull + reinstall + version diff).
155
+
156
+ **If using Phoenix:**
157
+ - [ ] `genexa/observability/phoenix.py` (setup + opt-in via env/config).
158
+ - [ ] Phoenix deps in `pyproject.toml`.
159
+
160
+ **If using TWK backend telemetry:**
161
+ - [ ] `genexa/telemetry/` module (client + spool).
162
+ - [ ] TWK backend: model + migration + router + main.py wiring.
163
+ - [ ] PAT-issuing UI in the TWK frontend.
164
+
165
+ **Mode B only:**
166
+ - [ ] `genexa-dist` repo on internal git.
167
+ - [ ] CI job that runs PyArmor and pushes to `genexa-dist` on tag.
168
+
169
+ ---
170
+
171
+ ## 7. Rollback
172
+
173
+ ```bash
174
+ cd ~/.genexa/src
175
+ git checkout v<old-version>
176
+ pipx install . --force
177
+ ```
178
+
179
+ Repo-wide: move tag back; users get the older version on next `genexa upgrade`.
@@ -0,0 +1,17 @@
1
+ Metadata-Version: 2.4
2
+ Name: navaia-code
3
+ Version: 1.0.50
4
+ Summary: Navaia Code — AI coding agent, built in Python
5
+ Requires-Python: >=3.12
6
+ Requires-Dist: aiofiles>=23.2.0
7
+ Requires-Dist: arabic-reshaper>=3.0.0
8
+ Requires-Dist: httpx>=0.27.0
9
+ Requires-Dist: openai>=1.30.0
10
+ Requires-Dist: pydantic>=2.7.0
11
+ Requires-Dist: python-bidi>=0.6.0
12
+ Requires-Dist: python-dotenv>=1.1.0
13
+ Requires-Dist: pyyaml>=6.0.0
14
+ Requires-Dist: rich>=13.9.0
15
+ Requires-Dist: textual>=0.80.0
16
+ Requires-Dist: tiktoken>=0.7.0
17
+ Requires-Dist: typer>=0.12.0