gemcode 0.3.77__tar.gz → 0.3.78__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.
- {gemcode-0.3.77/src/gemcode.egg-info → gemcode-0.3.78}/PKG-INFO +119 -30
- {gemcode-0.3.77 → gemcode-0.3.78}/README.md +118 -29
- {gemcode-0.3.77 → gemcode-0.3.78}/pyproject.toml +1 -1
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/agent.py +42 -1
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/autotune.py +17 -3
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/cli.py +17 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/config.py +6 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/evals/harness.py +74 -20
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/repl_commands.py +131 -1
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/repl_slash.py +326 -3
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/trust.py +5 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/tui/input_handler.py +8 -42
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/tui/scrollback.py +1 -0
- {gemcode-0.3.77 → gemcode-0.3.78/src/gemcode.egg-info}/PKG-INFO +119 -30
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode.egg-info/SOURCES.txt +2 -0
- gemcode-0.3.78/tests/test_eval_harness_layout.py +32 -0
- gemcode-0.3.78/tests/test_repl_slash.py +241 -0
- gemcode-0.3.78/tests/test_slash_completion_registry.py +48 -0
- gemcode-0.3.77/tests/test_repl_slash.py +0 -86
- {gemcode-0.3.77 → gemcode-0.3.78}/LICENSE +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/MANIFEST.in +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/setup.cfg +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/__init__.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/__main__.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/audit.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/autocompact.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/callbacks.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/capability_routing.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/checkpoints.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/compaction.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/computer_use/__init__.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/computer_use/browser_computer.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/context_budget.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/context_warning.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/credentials.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/curated_memory.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/dynamic_policy.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/hitl_session.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/hooks.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/ide_protocol.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/ide_stdio.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/intent_classifier.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/interactions.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/invoke.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/kaira_daemon.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/learning.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/limits.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/live_audio_engine.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/logging_config.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/mcp_loader.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/memory/__init__.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/memory/embedding_memory_service.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/memory/file_memory_service.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/modality_tools.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/model_errors.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/model_routing.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/openapi_loader.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/output_styles.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/paths.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/permissions.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/plugins/__init__.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/plugins/terminal_hooks_plugin.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/plugins/tool_recovery_plugin.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/policy_profile.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/pricing.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/prompt_suggestions.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/query/__init__.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/query/config.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/query/deps.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/query/engine.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/query/stop_hooks.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/query/token_budget.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/query/transitions.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/refine.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/review_agent.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/rules.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/session_runtime.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/session_store.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/skills.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/slash_commands.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/thinking.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/tool_prompt_manifest.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/tool_registry.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/tool_result_store.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/tools/__init__.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/tools/bash.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/tools/browser.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/tools/curated_memory.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/tools/edit.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/tools/filesystem.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/tools/notebook.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/tools/notes.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/tools/repo_map.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/tools/search.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/tools/shell.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/tools/shell_gate.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/tools/skills.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/tools/subtask.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/tools/tasks.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/tools/think.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/tools/todo.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/tools/web.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/tools/web_search.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/tools_inspector.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/tui/spinner.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/tui/welcome_banner.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/tui/welcome_rich.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/version.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/vertex.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/web/__init__.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/web/sse_adapter.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/web/terminal_repl.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/web/web_sse_compat.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode/workspace_hints.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode.egg-info/dependency_links.txt +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode.egg-info/entry_points.txt +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode.egg-info/requires.txt +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/src/gemcode.egg-info/top_level.txt +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/tests/test_add_dir.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/tests/test_agent_instruction.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/tests/test_autocompact.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/tests/test_capability_routing.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/tests/test_checkpoint_diff_command.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/tests/test_cli_init.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/tests/test_computer_use_permissions.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/tests/test_context_budget.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/tests/test_context_warning.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/tests/test_credentials.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/tests/test_interactive_permission_ask.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/tests/test_kaira_scheduler.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/tests/test_modality_tools.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/tests/test_model_error_retry.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/tests/test_model_errors.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/tests/test_model_routing.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/tests/test_output_styles_and_rules.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/tests/test_paths.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/tests/test_permissions.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/tests/test_prompt_suggestions.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/tests/test_repl_commands.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/tests/test_skills.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/tests/test_slash_commands.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/tests/test_thinking_config.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/tests/test_token_budget.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/tests/test_tool_context_circulation.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/tests/test_tools.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/tests/test_tools_inspector.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/tests/test_web_sse_adapter.py +0 -0
- {gemcode-0.3.77 → gemcode-0.3.78}/tests/test_workspace_hints.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gemcode
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.78
|
|
4
4
|
Summary: Local-first coding agent on Google Gemini + ADK
|
|
5
5
|
Author: GemCode Contributors
|
|
6
6
|
License: Apache License
|
|
@@ -197,32 +197,82 @@ This document is the **authoritative reference** for CLI behavior, configuration
|
|
|
197
197
|
|
|
198
198
|
## Table of contents
|
|
199
199
|
|
|
200
|
-
1. [
|
|
201
|
-
2. [
|
|
202
|
-
3. [
|
|
203
|
-
4. [
|
|
204
|
-
5. [
|
|
205
|
-
6. [
|
|
206
|
-
7. [
|
|
207
|
-
8. [
|
|
208
|
-
9. [
|
|
209
|
-
10. [
|
|
210
|
-
11. [
|
|
211
|
-
12. [
|
|
212
|
-
13. [
|
|
213
|
-
14. [
|
|
214
|
-
15. [
|
|
215
|
-
16. [
|
|
216
|
-
17. [
|
|
217
|
-
18. [
|
|
218
|
-
19. [
|
|
219
|
-
20. [
|
|
220
|
-
21. [
|
|
221
|
-
22. [
|
|
222
|
-
23. [
|
|
223
|
-
24. [
|
|
224
|
-
25. [
|
|
225
|
-
26. [
|
|
200
|
+
1. [What GemCode is (detailed)](#what-gemcode-is-detailed)
|
|
201
|
+
2. [Architecture](#architecture)
|
|
202
|
+
3. [Requirements and install](#requirements-and-install)
|
|
203
|
+
4. [First run](#first-run)
|
|
204
|
+
5. [CLI commands](#cli-commands)
|
|
205
|
+
6. [Main CLI flags](#main-cli-flags)
|
|
206
|
+
7. [The `.gemcode/` directory](#the-gemcode-directory)
|
|
207
|
+
8. [Project context: `GEMINI.md`](#project-context-geminimd)
|
|
208
|
+
9. [Function tools (catalog)](#function-tools-catalog)
|
|
209
|
+
10. [REPL: slash commands](#repl-slash-commands)
|
|
210
|
+
11. [GemSkills](#gemskills)
|
|
211
|
+
12. [Curated memory](#curated-memory)
|
|
212
|
+
13. [Workspace trust](#workspace-trust)
|
|
213
|
+
14. [Output styles and rules](#output-styles-and-rules)
|
|
214
|
+
15. [Checkpoints, diff, and rewind](#checkpoints-diff-and-rewind)
|
|
215
|
+
16. [Multi-root workspaces (`/add-dir`)](#multi-root-workspaces-add-dir)
|
|
216
|
+
17. [Model routing and thinking](#model-routing-and-thinking)
|
|
217
|
+
18. [Capabilities](#capabilities)
|
|
218
|
+
19. [Permissions and interactive approval](#permissions-and-interactive-approval)
|
|
219
|
+
20. [Hooks](#hooks)
|
|
220
|
+
21. [Token budget, context, and compaction](#token-budget-context-and-compaction)
|
|
221
|
+
22. [MCP](#mcp)
|
|
222
|
+
23. [IDE bridge: `gemcode ide --stdio`](#ide-bridge-gemcode-ide-stdio)
|
|
223
|
+
24. [Eval harness and autotune](#eval-harness-and-autotune)
|
|
224
|
+
25. [Kaira scheduler](#kaira-scheduler)
|
|
225
|
+
26. [Live audio](#live-audio)
|
|
226
|
+
27. [Related components](#related-components)
|
|
227
|
+
28. [Environment variables](#environment-variables)
|
|
228
|
+
29. [Development and release](#development-and-release)
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## What GemCode is (detailed)
|
|
233
|
+
|
|
234
|
+
**GemCode** is a single Python package that exposes a **`gemcode`** CLI. Every invocation is anchored to a **project root** (`-C`, default current directory). From there it:
|
|
235
|
+
|
|
236
|
+
- Builds a **GemCodeConfig** (model, capabilities, permissions, limits, paths).
|
|
237
|
+
- Optionally loads **MCP** toolsets from `.gemcode/mcp.json`.
|
|
238
|
+
- Constructs an ADK **Runner** with a root **LlmAgent** whose **system instruction** aggregates: global behavior, `GEMINI.md`, capability sections, tool manifest, optional **output style** and **rules**, the **skills manifest** (metadata only), and any **session-loaded GemSkills** (full bodies after `/gemskill`).
|
|
239
|
+
- Persists conversation state in **SQLite** (`.gemcode/sessions.sqlite`) keyed by **`--session`** / REPL session id.
|
|
240
|
+
|
|
241
|
+
### Modes of use
|
|
242
|
+
|
|
243
|
+
| Mode | How | Best for |
|
|
244
|
+
|------|-----|----------|
|
|
245
|
+
| **One-shot CLI** | `gemcode -C repo "prompt"` | Scripts, CI-style runs, quick questions. |
|
|
246
|
+
| **REPL** | `gemcode -C repo` (TTY, no prompt arg) | Long sessions, slash commands, exploration. |
|
|
247
|
+
| **TUI** | Same as REPL with `GEMCODE_TUI=1` (default when supported) | Scrollback, styled output, slash **completion menu**. |
|
|
248
|
+
| **IDE** | VS Code extension → `gemcode ide --stdio` | Editor-native Chat, diff apply, proposals. |
|
|
249
|
+
| **Kaira** | `gemcode kaira` | Background queue of independent agent jobs. |
|
|
250
|
+
| **Live audio** | `gemcode live-audio` | Voice → Gemini Live (separate from file-editing REPL). |
|
|
251
|
+
|
|
252
|
+
### “Memory” in GemCode (three different things)
|
|
253
|
+
|
|
254
|
+
| Mechanism | Where | Purpose |
|
|
255
|
+
|-----------|--------|---------|
|
|
256
|
+
| **Session history** | `sessions.sqlite` | Full turn-by-turn chat for a session id. |
|
|
257
|
+
| **Curated memory** | `GEMCODE_MEMORY.md`, `GEMCODE_USER.md` (under `.gemcode/`) | Small, **human-approved** facts injected when memory features are on; distinct from noisy auto-memory. |
|
|
258
|
+
| **Embedding memory** | `memories.jsonl` + ADK hooks (when enabled) | Retrieval-oriented storage when **`GEMCODE_ENABLE_MEMORY`** (and related) are on. |
|
|
259
|
+
|
|
260
|
+
Use **`/curated`** in the REPL to preview the curated snapshot; tools such as **`read_curated_memory`** / **`remember_fact`** operate on that layer.
|
|
261
|
+
|
|
262
|
+
### GemSkills at a glance (four ways)
|
|
263
|
+
|
|
264
|
+
| Mechanism | Effect |
|
|
265
|
+
|-----------|--------|
|
|
266
|
+
| **`/create gemskill <name> [description]`** | Creates **`.gemcode/skills/<name>/SKILL.md`** scaffold (new skill on disk). |
|
|
267
|
+
| **`/gemskill <name>`** | **Pins** the skill’s **full body** into the **system instruction** for the **current session** (until `/gemskill clear`, new session, or resume). Rebuilds the runner. |
|
|
268
|
+
| **`/append gemskill <name> <request>`** | One model turn instructed to **edit** that skill file according to `<request>`. |
|
|
269
|
+
| **`/skill <name>`**, **`/<name>`**, or tools **`load_skill`** | **One-shot** turn: inject expanded skill into the **user message** for that turn only (does not pin to system prompt). |
|
|
270
|
+
|
|
271
|
+
The built-in **`batch`** skill is manual-only (`disable_model_invocation`); use **`/batch <goal>`** to run it.
|
|
272
|
+
|
|
273
|
+
### Slash completion
|
|
274
|
+
|
|
275
|
+
The REPL and TUI use a **canonical** command list for Tab completion (`repl_commands.SLASH_COMMANDS`). Some spellings (e.g. `/quit`, `/logs`, `/embed`) still work in **`process_repl_slash`** but may not appear as separate menu rows—see descriptions in **`/help`**.
|
|
226
276
|
|
|
227
277
|
---
|
|
228
278
|
|
|
@@ -311,6 +361,7 @@ State is **project-local** (unless noted).
|
|
|
311
361
|
| Path / artifact | Purpose |
|
|
312
362
|
|-----------------|---------|
|
|
313
363
|
| `sessions.sqlite` | ADK session service: conversation history for `--session` ids. |
|
|
364
|
+
| `GEMCODE_MEMORY.md`, `GEMCODE_USER.md` | **Curated memory** (see [Curated memory](#curated-memory)). |
|
|
314
365
|
| `audit.log` | JSONL audit: tool usage, model usage, terminal reasons, optional tool-use summaries. |
|
|
315
366
|
| `tool-results/` | Offloaded large tool outputs; references like `tool_result:<sha256>`. |
|
|
316
367
|
| `artifacts/` | File artifacts (ADK `FileArtifactService`). |
|
|
@@ -421,10 +472,15 @@ In interactive mode, lines starting with `/` are **slash commands** (see `repl_c
|
|
|
421
472
|
|
|
422
473
|
| Command | Purpose |
|
|
423
474
|
|---------|---------|
|
|
475
|
+
| `/trust`, `/trust on`, `/trust off` | Show, grant, or revoke **workspace trust** for the project root (stored in `~/.gemcode/trust.json`; required for file/shell/git tools). |
|
|
424
476
|
| `/init` \| `/init force` | Analyze the repo and generate or overwrite `GEMINI.md`. |
|
|
425
477
|
| `/cost` | Token usage and estimated cost for the session. |
|
|
426
478
|
| `/notes`, `/notes clear`, `/notes edit` | View, clear, or edit `.gemcode/notes.md`. |
|
|
427
|
-
| `/create gemskill <name> [description]` |
|
|
479
|
+
| `/create gemskill <name> [description]` | **Create** a new GemSkill (scaffold `SKILL.md`). |
|
|
480
|
+
| `/gemskill <name>` | **Load** an existing skill into the **session system prompt** (until `/gemskill clear` or new session). |
|
|
481
|
+
| `/gemskill list` \| `/gemskill clear` | List skills or unload all session-loaded skills. |
|
|
482
|
+
| `/append gemskill <name> <request>` | **Iterate** the skill file: model edits `SKILL.md` per your request. |
|
|
483
|
+
| `/curated` | Show **curated memory** snapshot (`.gemcode/GEMCODE_MEMORY.md`, `GEMCODE_USER.md`). |
|
|
428
484
|
| `/style`, `/style <name>\|off` | List or activate **output styles** (`.gemcode/output-styles/*.md`). |
|
|
429
485
|
| `/rules` | Show **rule** files from `.gemcode/rules/` (with path gating). |
|
|
430
486
|
| `/diff`, `/diff last`, `/diff cp_…` | Git diff, or **checkpoint → workspace** diff. |
|
|
@@ -437,7 +493,7 @@ In interactive mode, lines starting with `/` are **slash commands** (see `repl_c
|
|
|
437
493
|
| Command | Purpose |
|
|
438
494
|
|---------|---------|
|
|
439
495
|
| `/help` | Short help. |
|
|
440
|
-
| `/status` | Model, capabilities, thinking, limits, risk/context telemetry. |
|
|
496
|
+
| `/status` | Model, capabilities, thinking, limits, risk/context telemetry; **`loaded_skills`** (session-pinned GemSkills from `/gemskill`). |
|
|
441
497
|
| `/config` | Dump active config fields. |
|
|
442
498
|
| `/session`, `/session list`, `/session name`, `/session resume`, `/session new` | Session management; `/clear` aliases `/session new`. |
|
|
443
499
|
| `/compact`, `/compact <focus>` | Force context compaction / summarization. |
|
|
@@ -445,6 +501,12 @@ In interactive mode, lines starting with `/` are **slash commands** (see `repl_c
|
|
|
445
501
|
| `/context` | Context pressure and token breakdown (includes styles, rules, skills manifest, touched paths). |
|
|
446
502
|
| `/audit [N]` | Tail of `audit.log`. |
|
|
447
503
|
| `/tools` | Tool inventory for current config. |
|
|
504
|
+
| `/tools smoke` | Declaration compile check only (lists failures). |
|
|
505
|
+
| `/eval`, `/eval llm` | **Eval harness**: tool smoke + `pytest` if a `tests/` tree exists; optional LLM golden prompts (costs tokens). Writes `.gemcode/evals/last_eval.json`. |
|
|
506
|
+
| `/autotune init <tag>` | Create git branch `autotune/<tag>` (requires a git repo). |
|
|
507
|
+
| `/autotune eval`, `… llm` | Run eval and append `.gemcode/evals/autotune_ledger.jsonl`. |
|
|
508
|
+
| `/login` | How to run **`gemcode login`** (API key is set outside the REPL). |
|
|
509
|
+
| `/live-audio` | How to run **`gemcode live-audio`** (mic → Gemini Live). |
|
|
448
510
|
| `/doctor` | Environment sanity check. |
|
|
449
511
|
| `/version` | Version string. |
|
|
450
512
|
| `/exit` | Leave the REPL. |
|
|
@@ -462,6 +524,7 @@ In interactive mode, lines starting with `/` are **slash commands** (see `repl_c
|
|
|
462
524
|
|---------|---------|
|
|
463
525
|
| `/computer`, `/computer on\|off`, `/computer url` | Browser automation (Playwright). |
|
|
464
526
|
| `/research`, `/research on\|off` | Deep research tools. |
|
|
527
|
+
| `/maps`, `/maps on\|off` | Maps **grounding** toggle (runner rebuild). |
|
|
465
528
|
| `/embeddings on\|off` | Semantic search tool. |
|
|
466
529
|
| `/caps`, `/caps …` | View or bulk-toggle capabilities. |
|
|
467
530
|
| `/memory`, `/memory on\|off` | Persistent memory. |
|
|
@@ -496,7 +559,33 @@ The TUI (when `GEMCODE_TUI=1` and terminal supports it) provides **slash complet
|
|
|
496
559
|
- **Discovery:** Only **metadata** (name + description) is preloaded into context for token efficiency. Full body loads **on demand** via `/skill <name>`, `/<name>`, or tools `load_skill` / `list_skills`.
|
|
497
560
|
- **Built-in:** **`batch`** — parallel large-change workflow (map → units → `run_subtask` → verify). Exposed as `/batch <goal>`; not auto-invoked by the model (`disable_model_invocation`).
|
|
498
561
|
|
|
499
|
-
|
|
562
|
+
- **`/create gemskill <name>`** — create a new skill directory.
|
|
563
|
+
- **`/gemskill <name>`** — pin the full skill body into the system prompt for this session.
|
|
564
|
+
- **`/append gemskill <name> <text>`** — one-shot turn for the model to revise that skill on disk.
|
|
565
|
+
|
|
566
|
+
---
|
|
567
|
+
|
|
568
|
+
## Curated memory
|
|
569
|
+
|
|
570
|
+
**Curated memory** is a small, **intentional** text layer separate from raw session logs or embedding retrieval:
|
|
571
|
+
|
|
572
|
+
- **Project facts:** `.gemcode/GEMCODE_MEMORY.md` (conventions, commands, architecture notes the team wants the agent to see).
|
|
573
|
+
- **User preferences (per project):** `.gemcode/GEMCODE_USER.md`.
|
|
574
|
+
|
|
575
|
+
Legacy filenames **`.gemcode/MEMORY.md`** and **`.gemcode/USER.md`** are still read if the new names are absent.
|
|
576
|
+
|
|
577
|
+
Content is **sanitized** before append (length and sensitivity heuristics). The REPL command **`/curated`** prints a bounded snapshot of what would be injected. When the **memory** capability is enabled, curated material can be combined with broader memory tools—see **`remember_fact`**, **`read_curated_memory`** in the [function tools](#function-tools-catalog) table.
|
|
578
|
+
|
|
579
|
+
---
|
|
580
|
+
|
|
581
|
+
## Workspace trust
|
|
582
|
+
|
|
583
|
+
File, shell, and related tools require the **project root** to be **trusted**. Trust is stored in **`~/.gemcode/trust.json`** (path configurable via **`GEMCODE_HOME`**), not inside the repo.
|
|
584
|
+
|
|
585
|
+
- **`/trust`** — show whether the current root is trusted.
|
|
586
|
+
- **`/trust on`** / **`/trust off`** — grant or revoke trust for **`cfg.project_root`**.
|
|
587
|
+
|
|
588
|
+
Without trust, mutating and shell tools remain blocked even if **`--yes`** is set—this reduces accidental execution when the cwd is wrong (e.g. home directory).
|
|
500
589
|
|
|
501
590
|
---
|
|
502
591
|
|
|
@@ -8,32 +8,82 @@ This document is the **authoritative reference** for CLI behavior, configuration
|
|
|
8
8
|
|
|
9
9
|
## Table of contents
|
|
10
10
|
|
|
11
|
-
1. [
|
|
12
|
-
2. [
|
|
13
|
-
3. [
|
|
14
|
-
4. [
|
|
15
|
-
5. [
|
|
16
|
-
6. [
|
|
17
|
-
7. [
|
|
18
|
-
8. [
|
|
19
|
-
9. [
|
|
20
|
-
10. [
|
|
21
|
-
11. [
|
|
22
|
-
12. [
|
|
23
|
-
13. [
|
|
24
|
-
14. [
|
|
25
|
-
15. [
|
|
26
|
-
16. [
|
|
27
|
-
17. [
|
|
28
|
-
18. [
|
|
29
|
-
19. [
|
|
30
|
-
20. [
|
|
31
|
-
21. [
|
|
32
|
-
22. [
|
|
33
|
-
23. [
|
|
34
|
-
24. [
|
|
35
|
-
25. [
|
|
36
|
-
26. [
|
|
11
|
+
1. [What GemCode is (detailed)](#what-gemcode-is-detailed)
|
|
12
|
+
2. [Architecture](#architecture)
|
|
13
|
+
3. [Requirements and install](#requirements-and-install)
|
|
14
|
+
4. [First run](#first-run)
|
|
15
|
+
5. [CLI commands](#cli-commands)
|
|
16
|
+
6. [Main CLI flags](#main-cli-flags)
|
|
17
|
+
7. [The `.gemcode/` directory](#the-gemcode-directory)
|
|
18
|
+
8. [Project context: `GEMINI.md`](#project-context-geminimd)
|
|
19
|
+
9. [Function tools (catalog)](#function-tools-catalog)
|
|
20
|
+
10. [REPL: slash commands](#repl-slash-commands)
|
|
21
|
+
11. [GemSkills](#gemskills)
|
|
22
|
+
12. [Curated memory](#curated-memory)
|
|
23
|
+
13. [Workspace trust](#workspace-trust)
|
|
24
|
+
14. [Output styles and rules](#output-styles-and-rules)
|
|
25
|
+
15. [Checkpoints, diff, and rewind](#checkpoints-diff-and-rewind)
|
|
26
|
+
16. [Multi-root workspaces (`/add-dir`)](#multi-root-workspaces-add-dir)
|
|
27
|
+
17. [Model routing and thinking](#model-routing-and-thinking)
|
|
28
|
+
18. [Capabilities](#capabilities)
|
|
29
|
+
19. [Permissions and interactive approval](#permissions-and-interactive-approval)
|
|
30
|
+
20. [Hooks](#hooks)
|
|
31
|
+
21. [Token budget, context, and compaction](#token-budget-context-and-compaction)
|
|
32
|
+
22. [MCP](#mcp)
|
|
33
|
+
23. [IDE bridge: `gemcode ide --stdio`](#ide-bridge-gemcode-ide-stdio)
|
|
34
|
+
24. [Eval harness and autotune](#eval-harness-and-autotune)
|
|
35
|
+
25. [Kaira scheduler](#kaira-scheduler)
|
|
36
|
+
26. [Live audio](#live-audio)
|
|
37
|
+
27. [Related components](#related-components)
|
|
38
|
+
28. [Environment variables](#environment-variables)
|
|
39
|
+
29. [Development and release](#development-and-release)
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## What GemCode is (detailed)
|
|
44
|
+
|
|
45
|
+
**GemCode** is a single Python package that exposes a **`gemcode`** CLI. Every invocation is anchored to a **project root** (`-C`, default current directory). From there it:
|
|
46
|
+
|
|
47
|
+
- Builds a **GemCodeConfig** (model, capabilities, permissions, limits, paths).
|
|
48
|
+
- Optionally loads **MCP** toolsets from `.gemcode/mcp.json`.
|
|
49
|
+
- Constructs an ADK **Runner** with a root **LlmAgent** whose **system instruction** aggregates: global behavior, `GEMINI.md`, capability sections, tool manifest, optional **output style** and **rules**, the **skills manifest** (metadata only), and any **session-loaded GemSkills** (full bodies after `/gemskill`).
|
|
50
|
+
- Persists conversation state in **SQLite** (`.gemcode/sessions.sqlite`) keyed by **`--session`** / REPL session id.
|
|
51
|
+
|
|
52
|
+
### Modes of use
|
|
53
|
+
|
|
54
|
+
| Mode | How | Best for |
|
|
55
|
+
|------|-----|----------|
|
|
56
|
+
| **One-shot CLI** | `gemcode -C repo "prompt"` | Scripts, CI-style runs, quick questions. |
|
|
57
|
+
| **REPL** | `gemcode -C repo` (TTY, no prompt arg) | Long sessions, slash commands, exploration. |
|
|
58
|
+
| **TUI** | Same as REPL with `GEMCODE_TUI=1` (default when supported) | Scrollback, styled output, slash **completion menu**. |
|
|
59
|
+
| **IDE** | VS Code extension → `gemcode ide --stdio` | Editor-native Chat, diff apply, proposals. |
|
|
60
|
+
| **Kaira** | `gemcode kaira` | Background queue of independent agent jobs. |
|
|
61
|
+
| **Live audio** | `gemcode live-audio` | Voice → Gemini Live (separate from file-editing REPL). |
|
|
62
|
+
|
|
63
|
+
### “Memory” in GemCode (three different things)
|
|
64
|
+
|
|
65
|
+
| Mechanism | Where | Purpose |
|
|
66
|
+
|-----------|--------|---------|
|
|
67
|
+
| **Session history** | `sessions.sqlite` | Full turn-by-turn chat for a session id. |
|
|
68
|
+
| **Curated memory** | `GEMCODE_MEMORY.md`, `GEMCODE_USER.md` (under `.gemcode/`) | Small, **human-approved** facts injected when memory features are on; distinct from noisy auto-memory. |
|
|
69
|
+
| **Embedding memory** | `memories.jsonl` + ADK hooks (when enabled) | Retrieval-oriented storage when **`GEMCODE_ENABLE_MEMORY`** (and related) are on. |
|
|
70
|
+
|
|
71
|
+
Use **`/curated`** in the REPL to preview the curated snapshot; tools such as **`read_curated_memory`** / **`remember_fact`** operate on that layer.
|
|
72
|
+
|
|
73
|
+
### GemSkills at a glance (four ways)
|
|
74
|
+
|
|
75
|
+
| Mechanism | Effect |
|
|
76
|
+
|-----------|--------|
|
|
77
|
+
| **`/create gemskill <name> [description]`** | Creates **`.gemcode/skills/<name>/SKILL.md`** scaffold (new skill on disk). |
|
|
78
|
+
| **`/gemskill <name>`** | **Pins** the skill’s **full body** into the **system instruction** for the **current session** (until `/gemskill clear`, new session, or resume). Rebuilds the runner. |
|
|
79
|
+
| **`/append gemskill <name> <request>`** | One model turn instructed to **edit** that skill file according to `<request>`. |
|
|
80
|
+
| **`/skill <name>`**, **`/<name>`**, or tools **`load_skill`** | **One-shot** turn: inject expanded skill into the **user message** for that turn only (does not pin to system prompt). |
|
|
81
|
+
|
|
82
|
+
The built-in **`batch`** skill is manual-only (`disable_model_invocation`); use **`/batch <goal>`** to run it.
|
|
83
|
+
|
|
84
|
+
### Slash completion
|
|
85
|
+
|
|
86
|
+
The REPL and TUI use a **canonical** command list for Tab completion (`repl_commands.SLASH_COMMANDS`). Some spellings (e.g. `/quit`, `/logs`, `/embed`) still work in **`process_repl_slash`** but may not appear as separate menu rows—see descriptions in **`/help`**.
|
|
37
87
|
|
|
38
88
|
---
|
|
39
89
|
|
|
@@ -122,6 +172,7 @@ State is **project-local** (unless noted).
|
|
|
122
172
|
| Path / artifact | Purpose |
|
|
123
173
|
|-----------------|---------|
|
|
124
174
|
| `sessions.sqlite` | ADK session service: conversation history for `--session` ids. |
|
|
175
|
+
| `GEMCODE_MEMORY.md`, `GEMCODE_USER.md` | **Curated memory** (see [Curated memory](#curated-memory)). |
|
|
125
176
|
| `audit.log` | JSONL audit: tool usage, model usage, terminal reasons, optional tool-use summaries. |
|
|
126
177
|
| `tool-results/` | Offloaded large tool outputs; references like `tool_result:<sha256>`. |
|
|
127
178
|
| `artifacts/` | File artifacts (ADK `FileArtifactService`). |
|
|
@@ -232,10 +283,15 @@ In interactive mode, lines starting with `/` are **slash commands** (see `repl_c
|
|
|
232
283
|
|
|
233
284
|
| Command | Purpose |
|
|
234
285
|
|---------|---------|
|
|
286
|
+
| `/trust`, `/trust on`, `/trust off` | Show, grant, or revoke **workspace trust** for the project root (stored in `~/.gemcode/trust.json`; required for file/shell/git tools). |
|
|
235
287
|
| `/init` \| `/init force` | Analyze the repo and generate or overwrite `GEMINI.md`. |
|
|
236
288
|
| `/cost` | Token usage and estimated cost for the session. |
|
|
237
289
|
| `/notes`, `/notes clear`, `/notes edit` | View, clear, or edit `.gemcode/notes.md`. |
|
|
238
|
-
| `/create gemskill <name> [description]` |
|
|
290
|
+
| `/create gemskill <name> [description]` | **Create** a new GemSkill (scaffold `SKILL.md`). |
|
|
291
|
+
| `/gemskill <name>` | **Load** an existing skill into the **session system prompt** (until `/gemskill clear` or new session). |
|
|
292
|
+
| `/gemskill list` \| `/gemskill clear` | List skills or unload all session-loaded skills. |
|
|
293
|
+
| `/append gemskill <name> <request>` | **Iterate** the skill file: model edits `SKILL.md` per your request. |
|
|
294
|
+
| `/curated` | Show **curated memory** snapshot (`.gemcode/GEMCODE_MEMORY.md`, `GEMCODE_USER.md`). |
|
|
239
295
|
| `/style`, `/style <name>\|off` | List or activate **output styles** (`.gemcode/output-styles/*.md`). |
|
|
240
296
|
| `/rules` | Show **rule** files from `.gemcode/rules/` (with path gating). |
|
|
241
297
|
| `/diff`, `/diff last`, `/diff cp_…` | Git diff, or **checkpoint → workspace** diff. |
|
|
@@ -248,7 +304,7 @@ In interactive mode, lines starting with `/` are **slash commands** (see `repl_c
|
|
|
248
304
|
| Command | Purpose |
|
|
249
305
|
|---------|---------|
|
|
250
306
|
| `/help` | Short help. |
|
|
251
|
-
| `/status` | Model, capabilities, thinking, limits, risk/context telemetry. |
|
|
307
|
+
| `/status` | Model, capabilities, thinking, limits, risk/context telemetry; **`loaded_skills`** (session-pinned GemSkills from `/gemskill`). |
|
|
252
308
|
| `/config` | Dump active config fields. |
|
|
253
309
|
| `/session`, `/session list`, `/session name`, `/session resume`, `/session new` | Session management; `/clear` aliases `/session new`. |
|
|
254
310
|
| `/compact`, `/compact <focus>` | Force context compaction / summarization. |
|
|
@@ -256,6 +312,12 @@ In interactive mode, lines starting with `/` are **slash commands** (see `repl_c
|
|
|
256
312
|
| `/context` | Context pressure and token breakdown (includes styles, rules, skills manifest, touched paths). |
|
|
257
313
|
| `/audit [N]` | Tail of `audit.log`. |
|
|
258
314
|
| `/tools` | Tool inventory for current config. |
|
|
315
|
+
| `/tools smoke` | Declaration compile check only (lists failures). |
|
|
316
|
+
| `/eval`, `/eval llm` | **Eval harness**: tool smoke + `pytest` if a `tests/` tree exists; optional LLM golden prompts (costs tokens). Writes `.gemcode/evals/last_eval.json`. |
|
|
317
|
+
| `/autotune init <tag>` | Create git branch `autotune/<tag>` (requires a git repo). |
|
|
318
|
+
| `/autotune eval`, `… llm` | Run eval and append `.gemcode/evals/autotune_ledger.jsonl`. |
|
|
319
|
+
| `/login` | How to run **`gemcode login`** (API key is set outside the REPL). |
|
|
320
|
+
| `/live-audio` | How to run **`gemcode live-audio`** (mic → Gemini Live). |
|
|
259
321
|
| `/doctor` | Environment sanity check. |
|
|
260
322
|
| `/version` | Version string. |
|
|
261
323
|
| `/exit` | Leave the REPL. |
|
|
@@ -273,6 +335,7 @@ In interactive mode, lines starting with `/` are **slash commands** (see `repl_c
|
|
|
273
335
|
|---------|---------|
|
|
274
336
|
| `/computer`, `/computer on\|off`, `/computer url` | Browser automation (Playwright). |
|
|
275
337
|
| `/research`, `/research on\|off` | Deep research tools. |
|
|
338
|
+
| `/maps`, `/maps on\|off` | Maps **grounding** toggle (runner rebuild). |
|
|
276
339
|
| `/embeddings on\|off` | Semantic search tool. |
|
|
277
340
|
| `/caps`, `/caps …` | View or bulk-toggle capabilities. |
|
|
278
341
|
| `/memory`, `/memory on\|off` | Persistent memory. |
|
|
@@ -307,7 +370,33 @@ The TUI (when `GEMCODE_TUI=1` and terminal supports it) provides **slash complet
|
|
|
307
370
|
- **Discovery:** Only **metadata** (name + description) is preloaded into context for token efficiency. Full body loads **on demand** via `/skill <name>`, `/<name>`, or tools `load_skill` / `list_skills`.
|
|
308
371
|
- **Built-in:** **`batch`** — parallel large-change workflow (map → units → `run_subtask` → verify). Exposed as `/batch <goal>`; not auto-invoked by the model (`disable_model_invocation`).
|
|
309
372
|
|
|
310
|
-
|
|
373
|
+
- **`/create gemskill <name>`** — create a new skill directory.
|
|
374
|
+
- **`/gemskill <name>`** — pin the full skill body into the system prompt for this session.
|
|
375
|
+
- **`/append gemskill <name> <text>`** — one-shot turn for the model to revise that skill on disk.
|
|
376
|
+
|
|
377
|
+
---
|
|
378
|
+
|
|
379
|
+
## Curated memory
|
|
380
|
+
|
|
381
|
+
**Curated memory** is a small, **intentional** text layer separate from raw session logs or embedding retrieval:
|
|
382
|
+
|
|
383
|
+
- **Project facts:** `.gemcode/GEMCODE_MEMORY.md` (conventions, commands, architecture notes the team wants the agent to see).
|
|
384
|
+
- **User preferences (per project):** `.gemcode/GEMCODE_USER.md`.
|
|
385
|
+
|
|
386
|
+
Legacy filenames **`.gemcode/MEMORY.md`** and **`.gemcode/USER.md`** are still read if the new names are absent.
|
|
387
|
+
|
|
388
|
+
Content is **sanitized** before append (length and sensitivity heuristics). The REPL command **`/curated`** prints a bounded snapshot of what would be injected. When the **memory** capability is enabled, curated material can be combined with broader memory tools—see **`remember_fact`**, **`read_curated_memory`** in the [function tools](#function-tools-catalog) table.
|
|
389
|
+
|
|
390
|
+
---
|
|
391
|
+
|
|
392
|
+
## Workspace trust
|
|
393
|
+
|
|
394
|
+
File, shell, and related tools require the **project root** to be **trusted**. Trust is stored in **`~/.gemcode/trust.json`** (path configurable via **`GEMCODE_HOME`**), not inside the repo.
|
|
395
|
+
|
|
396
|
+
- **`/trust`** — show whether the current root is trusted.
|
|
397
|
+
- **`/trust on`** / **`/trust off`** — grant or revoke trust for **`cfg.project_root`**.
|
|
398
|
+
|
|
399
|
+
Without trust, mutating and shell tools remain blocked even if **`--yes`** is set—this reduces accidental execution when the cwd is wrong (e.g. home directory).
|
|
311
400
|
|
|
312
401
|
---
|
|
313
402
|
|
|
@@ -27,11 +27,49 @@ from gemcode.limits import make_before_model_limits_callback, make_before_model_
|
|
|
27
27
|
from gemcode.thinking import build_thinking_config
|
|
28
28
|
from gemcode.tools import build_function_tools
|
|
29
29
|
from gemcode.tool_prompt_manifest import build_tool_manifest
|
|
30
|
-
from gemcode.skills import
|
|
30
|
+
from gemcode.skills import (
|
|
31
|
+
build_skill_manifest_text,
|
|
32
|
+
expand_skill_text,
|
|
33
|
+
list_supporting_files,
|
|
34
|
+
load_skill,
|
|
35
|
+
)
|
|
31
36
|
from gemcode.output_styles import build_output_style_section
|
|
32
37
|
from gemcode.rules import build_rules_section
|
|
33
38
|
|
|
34
39
|
|
|
40
|
+
def _build_session_loaded_skills_section(cfg: GemCodeConfig) -> str:
|
|
41
|
+
"""Full bodies for GemSkills the user loaded with /gemskill (session-scoped)."""
|
|
42
|
+
names = list(getattr(cfg, "session_loaded_skill_names", None) or [])
|
|
43
|
+
if not names:
|
|
44
|
+
return ""
|
|
45
|
+
sid = getattr(cfg, "session_skill_expand_session_id", None) or ""
|
|
46
|
+
chunks: list[str] = []
|
|
47
|
+
seen: set[str] = set()
|
|
48
|
+
for raw in names:
|
|
49
|
+
sk_name = (raw or "").strip().lower()
|
|
50
|
+
if not sk_name or sk_name in seen:
|
|
51
|
+
continue
|
|
52
|
+
seen.add(sk_name)
|
|
53
|
+
s = load_skill(cfg.project_root, sk_name)
|
|
54
|
+
if s is None:
|
|
55
|
+
continue
|
|
56
|
+
expanded = expand_skill_text(s, arguments="", session_id=sid)
|
|
57
|
+
files = list_supporting_files(s)
|
|
58
|
+
head = f"### GemSkill: `/{s.meta.name}` (loaded for this session)\n\n"
|
|
59
|
+
chunk = head + expanded
|
|
60
|
+
if files:
|
|
61
|
+
chunk += f"\n\nSupporting files: {', '.join(files)}"
|
|
62
|
+
chunks.append(chunk)
|
|
63
|
+
if not chunks:
|
|
64
|
+
return ""
|
|
65
|
+
return (
|
|
66
|
+
"## Loaded GemSkills (this session)\n"
|
|
67
|
+
"The user explicitly loaded these skills with `/gemskill`. Follow their workflows "
|
|
68
|
+
"when the task matches their purpose; do not force them on unrelated requests.\n\n"
|
|
69
|
+
+ "\n\n---\n\n".join(chunks)
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
|
|
35
73
|
def build_global_instruction() -> str:
|
|
36
74
|
"""Global instruction applied to the entire agent tree (via ADK plugin)."""
|
|
37
75
|
return (
|
|
@@ -888,6 +926,9 @@ You have two tools to persist project insights across sessions (auto-memory styl
|
|
|
888
926
|
skill_manifest = build_skill_manifest_text(cfg.project_root)
|
|
889
927
|
if skill_manifest:
|
|
890
928
|
base = f"{base}\n\n{skill_manifest}"
|
|
929
|
+
loaded_skills = _build_session_loaded_skills_section(cfg)
|
|
930
|
+
if loaded_skills:
|
|
931
|
+
base = f"{base}\n\n{loaded_skills}"
|
|
891
932
|
extra = _load_gemini_md(cfg.project_root)
|
|
892
933
|
if extra.strip():
|
|
893
934
|
return f"{base}\n\n## Project instructions (GEMINI.md)\n{extra}"
|
|
@@ -3,8 +3,9 @@ from __future__ import annotations
|
|
|
3
3
|
import subprocess
|
|
4
4
|
import time
|
|
5
5
|
from pathlib import Path
|
|
6
|
-
from typing import Any
|
|
6
|
+
from typing import Any, Iterable
|
|
7
7
|
|
|
8
|
+
from gemcode.config import GemCodeConfig
|
|
8
9
|
from gemcode.evals.harness import run_eval_suite, write_eval_record
|
|
9
10
|
|
|
10
11
|
|
|
@@ -47,11 +48,24 @@ def init_autotune(*, project_root: Path, tag: str) -> dict[str, Any]:
|
|
|
47
48
|
return {"status": "created", "branch": branch}
|
|
48
49
|
|
|
49
50
|
|
|
50
|
-
def run_autotune_eval(
|
|
51
|
+
def run_autotune_eval(
|
|
52
|
+
*,
|
|
53
|
+
project_root: Path,
|
|
54
|
+
include_llm: bool,
|
|
55
|
+
model: str | None = None,
|
|
56
|
+
session_cfg: GemCodeConfig | None = None,
|
|
57
|
+
extra_tools: Iterable[Any] | None = None,
|
|
58
|
+
) -> dict[str, Any]:
|
|
51
59
|
"""
|
|
52
60
|
Run eval suite and persist last result to .gemcode/evals/last_eval.json.
|
|
53
61
|
"""
|
|
54
|
-
res = run_eval_suite(
|
|
62
|
+
res = run_eval_suite(
|
|
63
|
+
project_root=project_root,
|
|
64
|
+
include_llm=include_llm,
|
|
65
|
+
model=model,
|
|
66
|
+
session_cfg=session_cfg,
|
|
67
|
+
extra_tools=extra_tools,
|
|
68
|
+
)
|
|
55
69
|
meta = {
|
|
56
70
|
"ts": time.time(),
|
|
57
71
|
"git_sha": _git_head_sha(project_root),
|
|
@@ -245,6 +245,13 @@ async def _run_repl(cfg: GemCodeConfig, session_id: str, *, use_mcp: bool) -> No
|
|
|
245
245
|
file=sys.stderr,
|
|
246
246
|
)
|
|
247
247
|
|
|
248
|
+
try:
|
|
249
|
+
from gemcode.repl_commands import install_readline_slash_completion
|
|
250
|
+
|
|
251
|
+
install_readline_slash_completion()
|
|
252
|
+
except Exception:
|
|
253
|
+
pass
|
|
254
|
+
|
|
248
255
|
print(
|
|
249
256
|
"GemCode CLI is running. Type your prompt and press Enter. (Ctrl+D to exit)",
|
|
250
257
|
file=sys.stderr,
|
|
@@ -261,6 +268,7 @@ async def _run_repl(cfg: GemCodeConfig, session_id: str, *, use_mcp: bool) -> No
|
|
|
261
268
|
if prompt_text in (":q", "quit", "exit", "/exit"):
|
|
262
269
|
break
|
|
263
270
|
|
|
271
|
+
cfg.session_skill_expand_session_id = session_id
|
|
264
272
|
slash = await process_repl_slash(
|
|
265
273
|
cfg=cfg,
|
|
266
274
|
runner=runner,
|
|
@@ -273,7 +281,16 @@ async def _run_repl(cfg: GemCodeConfig, session_id: str, *, use_mcp: bool) -> No
|
|
|
273
281
|
break
|
|
274
282
|
if slash.new_session_id is not None:
|
|
275
283
|
session_id = slash.new_session_id
|
|
284
|
+
cfg.session_skill_expand_session_id = session_id
|
|
276
285
|
if slash.skip_model_turn:
|
|
286
|
+
if slash.force_rebuild_runner:
|
|
287
|
+
try:
|
|
288
|
+
_c = runner.close()
|
|
289
|
+
if asyncio.iscoroutine(_c):
|
|
290
|
+
await _c
|
|
291
|
+
except Exception:
|
|
292
|
+
pass
|
|
293
|
+
runner = create_runner(cfg, extra_tools=None)
|
|
277
294
|
continue
|
|
278
295
|
prompt_text = slash.model_prompt or prompt_text
|
|
279
296
|
|
|
@@ -212,6 +212,12 @@ class GemCodeConfig:
|
|
|
212
212
|
default_factory=lambda: os.environ.get("GEMCODE_OUTPUT_STYLE") or None
|
|
213
213
|
)
|
|
214
214
|
|
|
215
|
+
# GemSkills explicitly loaded via /gemskill — full bodies injected into the
|
|
216
|
+
# system instruction until cleared or the session is reset/resumed.
|
|
217
|
+
session_loaded_skill_names: list[str] = field(default_factory=list)
|
|
218
|
+
# Substitutes ${GEMCODE_SESSION_ID} when expanding loaded skills for prompts.
|
|
219
|
+
session_skill_expand_session_id: str | None = None
|
|
220
|
+
|
|
215
221
|
# Modality toggles (tool injection + routing).
|
|
216
222
|
enable_deep_research: bool = field(
|
|
217
223
|
default_factory=lambda: _truthy_env("GEMCODE_ENABLE_DEEP_RESEARCH", default=False)
|