mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-23 08:10:57 -07:00
Compare commits
43 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9cedc6131e | |||
| 0179726222 | |||
| 0957f7d3e2 | |||
| 773567c6ca | |||
| 58901207bd | |||
| 21e1c60922 | |||
| 35907057ad | |||
| e2a5231e30 | |||
| db6943fbee | |||
| 128e3567cb | |||
| a74bb603c0 | |||
| 565eafc1ec | |||
| 7bba7f437c | |||
| b499562921 | |||
| 86f5a198bd | |||
| 31069329bb | |||
| 3b7c17a22c | |||
| 1d36309f5f | |||
| 7d1de3bccc | |||
| f6c08a114b | |||
| c1fd6027e2 | |||
| 0fd0851e1a | |||
| 5fc8fea8d7 | |||
| 43b93e9e1b | |||
| e09410b6e5 | |||
| 69bf2d75ef | |||
| 96cc8a0dad | |||
| 55db77bb91 | |||
| de628b04fc | |||
| 451edb3ea6 | |||
| 0f7f7be4ef | |||
| f744913584 | |||
| 45100f7c0e | |||
| a7a091360e | |||
| 20113ee595 | |||
| 2a5f798863 | |||
| 570f0235f8 | |||
| e406856343 | |||
| f387e456be | |||
| a9b5c693ca | |||
| 0690192d45 | |||
| 5bcb6b619d | |||
| b238a453e3 |
@@ -162,5 +162,7 @@ instructions for the other section.
|
||||
|
||||
## Finalize
|
||||
|
||||
- After making changes, run `npm run format` ONLY to ensure consistency.
|
||||
- After making changes, if `npm run format` fails, it may be necessary to run
|
||||
`npm install` first to ensure all formatting dependencies are available.
|
||||
Then, run `npm run format` to ensure consistency.
|
||||
- Delete any temporary files created during the process.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
name: docs-writer
|
||||
description:
|
||||
Always use this skill when the task involves writing, reviewing, or editing
|
||||
Always use this skill when the task involves writing, reviewing, or editing
|
||||
files in the `/docs` directory or any `.md` files in the repository.
|
||||
---
|
||||
|
||||
@@ -24,7 +24,7 @@ approach.
|
||||
|
||||
- **Perspective and tense:** Address the reader as "you." Use active voice and
|
||||
present tense (e.g., "The API returns...").
|
||||
- **Tone:** Professional, friendly, and direct.
|
||||
- **Tone:** Professional, friendly, and direct.
|
||||
- **Clarity:** Use simple vocabulary. Avoid jargon, slang, and marketing hype.
|
||||
- **Global Audience:** Write in standard US English. Avoid idioms and cultural
|
||||
references.
|
||||
@@ -47,8 +47,8 @@ Write precisely to ensure your instructions are unambiguous.
|
||||
"foo" or "bar."
|
||||
- **Quota and limit terminology:** For any content involving resource capacity
|
||||
or using the word "quota" or "limit", strictly adhere to the guidelines in
|
||||
the `quota-limit-style-guide.md` resource file. Generally, Use "quota" for the
|
||||
administrative bucket and "limit" for the numerical ceiling.
|
||||
the `quota-limit-style-guide.md` resource file. Generally, Use "quota" for
|
||||
the administrative bucket and "limit" for the numerical ceiling.
|
||||
|
||||
### Formatting and syntax
|
||||
Apply consistent formatting to make documentation visually organized and
|
||||
@@ -120,7 +120,7 @@ accessible.
|
||||
> This is an experimental feature currently under active development.
|
||||
|
||||
- **Headings:** Use hierarchical headings to support the user journey.
|
||||
- **Procedures:**
|
||||
- **Procedures:**
|
||||
- Introduce lists of steps with a complete sentence.
|
||||
- Start each step with an imperative verb.
|
||||
- Number sequential steps; use bullets for non-sequential lists.
|
||||
@@ -134,7 +134,7 @@ accessible.
|
||||
|
||||
## Phase 2: Preparation
|
||||
Before modifying any documentation, thoroughly investigate the request and the
|
||||
surrounding context.
|
||||
surrounding context.
|
||||
|
||||
1. **Clarify:** Understand the core request. Differentiate between writing new
|
||||
content and editing existing content. If the request is ambiguous (e.g.,
|
||||
@@ -145,6 +145,8 @@ surrounding context.
|
||||
4. **Connect:** Identify all referencing pages if changing behavior. Check if
|
||||
`docs/sidebar.json` needs updates.
|
||||
5. **Plan:** Create a step-by-step plan before making changes.
|
||||
6. **Audit Docset:** If asked to audit the documentation, follow the procedural
|
||||
guide in [docs-auditing.md](./references/docs-auditing.md).
|
||||
|
||||
## Phase 3: Execution
|
||||
Implement your plan by either updating existing files or creating new ones
|
||||
@@ -157,7 +159,7 @@ documentation.
|
||||
|
||||
- **Gaps:** Identify areas where the documentation is incomplete or no longer
|
||||
reflects existing code.
|
||||
- **Structure:** Apply "Structure (New Docs)" rules (BLUF, headings, etc.) when
|
||||
- **Structure:** Apply "Structure (New Docs)" rules (BLUF, headings, etc.) when
|
||||
adding new sections to existing pages.
|
||||
- **Headers**: If you change a header, you must check for links that lead to
|
||||
that header and update them.
|
||||
@@ -168,15 +170,16 @@ documentation.
|
||||
documents.
|
||||
|
||||
## Phase 4: Verification and finalization
|
||||
Perform a final quality check to ensure that all changes are correctly formatted
|
||||
and that all links are functional.
|
||||
Perform a final quality check to ensure that all changes are correctly
|
||||
formatted and that all links are functional.
|
||||
|
||||
1. **Accuracy:** Ensure content accurately reflects the implementation and
|
||||
technical behavior.
|
||||
2. **Self-review:** Re-read changes for formatting, correctness, and flow.
|
||||
3. **Link check:** Verify all new and existing links leading to or from modified
|
||||
pages. If you changed a header, ensure that any links that lead to it are
|
||||
updated.
|
||||
4. **Format:** Once all changes are complete, ask to execute `npm run format`
|
||||
to ensure consistent formatting across the project. If the user confirms,
|
||||
execute the command.
|
||||
3. **Link check:** Verify all new and existing links leading to or from
|
||||
modified pages. If you changed a header, ensure that any links that lead to
|
||||
it are updated.
|
||||
4. **Format:** If `npm run format` fails, it may be necessary to run `npm
|
||||
install` first to ensure all formatting dependencies are available. Once all
|
||||
changes are complete, ask to execute `npm run format` to ensure consistent
|
||||
formatting across the project. If the user confirms, execute the command.
|
||||
|
||||
@@ -0,0 +1,195 @@
|
||||
# Procedural Guide: Auditing the Docset
|
||||
|
||||
This guide outlines the process for auditing the Gemini CLI documentation for
|
||||
correctness and adherence to style guidelines. This process involves both an
|
||||
"Editor" and "Technical Writer" phase.
|
||||
|
||||
## Objective
|
||||
|
||||
To ensure all public-facing documentation is accurate, up-to-date, adheres to
|
||||
the Gemini CLI documentation style guide, and reflects the current state of the
|
||||
codebase.
|
||||
|
||||
## Phase 1: Editor Audit
|
||||
|
||||
**Role:** The editor is responsible for identifying potential issues based on
|
||||
style guide violations and technical inaccuracies.
|
||||
|
||||
### Steps
|
||||
|
||||
1. **Identify Documentation Scope:**
|
||||
- Read `docs/sidebar.json` to get a list of all viewable documentation
|
||||
pages.
|
||||
- For each entry with a `slug`, convert it into a file path (e.g., `docs` ->
|
||||
`docs/index.md`, `docs/get-started` -> `docs/get-started.md`). Ignore
|
||||
entries with `link` properties.
|
||||
|
||||
2. **Prepare Audit Results File:**
|
||||
- Create a new Markdown file named `audit-results-[YYYY-MM-DD].md` (e.g.,
|
||||
`audit-results-2026-03-13.md`). This file will contain all identified
|
||||
violations and recommendations.
|
||||
|
||||
3. **Retrieve Style Guidelines:**
|
||||
- Familiarize yourself with the `docs-writer` skill instructions and the
|
||||
included style guidelines.
|
||||
|
||||
4. **Audit Each Document:**
|
||||
- For each documentation file identified in Step 1, read its content.
|
||||
- **Review against Style Guide:**
|
||||
- **Voice and Tone Violations:**
|
||||
- **Unprofessional Tone:** Identify phrasing that is overly casual,
|
||||
defensive, or lacks a professional and friendly demeanor.
|
||||
- **Indirectness or Vagueness:** Identify sentences that are
|
||||
unnecessarily wordy or fail to be concise and direct.
|
||||
- **Incorrect Pronoun:** Identify any use of third-person pronouns
|
||||
(e.g., "we," "they," "the user") when referring to the reader, instead
|
||||
of the second-person pronoun **"you"**.
|
||||
- **Passive Voice:** Identify sentences written in the passive voice.
|
||||
- **Incorrect Tense:** Identify the use of past or future tense verbs,
|
||||
instead of the **present tense**.
|
||||
- **Poor Vocabulary:** Identify the use of jargon, slang, or overly
|
||||
informal language.
|
||||
- **Language and Grammar Violations:**
|
||||
- **Lack of Conciseness:** Identify unnecessarily long phrases or
|
||||
sentences.
|
||||
- **Punctuation Errors:** Identify incorrect or missing punctuation.
|
||||
- **Ambiguous Dates:** Identify dates that could be misinterpreted
|
||||
(e.g., "next Monday" instead of "April 15, 2026").
|
||||
- **Abbreviation Usage:** Identify the use of abbreviations that should
|
||||
be spelled out (e.g., "e.g." instead of "for example").
|
||||
- **Terminology:** Check for incorrect or inconsistent use of
|
||||
product-specific terms (e.g., "quota" vs. "limit").
|
||||
- **Formatting and Syntax Violations:**
|
||||
- **Missing Overview:** Check for the absence of a brief overview
|
||||
paragraph at the start of the document.
|
||||
- **Line Length:** Identify any lines of text that exceed **80
|
||||
characters** (text wrap violation).
|
||||
- **Casing:** Identify incorrect casing for headings, titles, or named
|
||||
entities (e.g., product names like `Gemini CLI`).
|
||||
- **List Formatting:** Identify incorrectly formatted lists (e.g.,
|
||||
inconsistent indentation or numbering).
|
||||
- **Incorrect Emphasis:** Identify incorrect use of bold text (should
|
||||
only be used for UI elements) or code font (should be used for code,
|
||||
file names, or command-line input).
|
||||
- **Link Quality:** Identify links with non-descriptive anchor text
|
||||
(e.g., "click here").
|
||||
- **Image Alt Text:** Identify images with missing or poor-quality
|
||||
(non-descriptive) alt text.
|
||||
- **Structure Violations:**
|
||||
- **Missing BLUF:** Check for the absence of a "Bottom Line Up Front"
|
||||
summary at the start of complex sections or documents.
|
||||
- **Experimental Feature Notes:** Identify experimental features that
|
||||
are not clearly labeled with a standard note.
|
||||
- **Heading Hierarchy:** Check for skipped heading levels (e.g., going
|
||||
from `##` to `####`).
|
||||
- **Procedure Clarity:** Check for procedural steps that do not start
|
||||
with an imperative verb or where a condition is placed _after_ the
|
||||
instruction.
|
||||
- **Element Misuse:** Identify the incorrect or inappropriate use of
|
||||
special elements (e.g., Notes, Warnings, Cautions).
|
||||
- **Table of Contents:** Identify the presence of a dynamically
|
||||
generated or manually included table of contents.
|
||||
- **Missing Next Steps:** Check for procedural documents that lack a
|
||||
"Next steps" section (if applicable).
|
||||
- **Verify Code Accuracy (if applicable):**
|
||||
- If the document contains code snippets (e.g., shell commands, API calls,
|
||||
file paths, Docker image versions), use `grep_search` and `read_file`
|
||||
within the `packages/` directory (or other relevant parts of the
|
||||
codebase) to ensure the code is still accurate and up-to-date. Pay close
|
||||
attention to version numbers, package names, and command syntax.
|
||||
- **Record Findings:** For each **violation** or inaccuracy found:
|
||||
- Note the file path.
|
||||
- Describe the violation (e.g., "Violation (Language and Grammar): Uses
|
||||
'e.g.'").
|
||||
- Provide a clear and actionable recommendation to correct the issue.
|
||||
(e.g., "Recommendation: Replace 'e.g.' with 'for example'." or
|
||||
"Recommendation: Replace '...' with '...' in active voice.).
|
||||
- Append these findings to `audit-results-[YYYY-MM-DD].md`.
|
||||
|
||||
## Phase 2: Software Engineer Audit
|
||||
|
||||
**Role:** The software engineer is responsible for finding undocumented features
|
||||
by auditing the codebase and recent changelogs, and passing these findings to
|
||||
the technical writer.
|
||||
|
||||
### Steps
|
||||
|
||||
1. **Proactive Codebase Audit:**
|
||||
- Audit high-signal areas of the codebase to identify undocumented features.
|
||||
You MUST review:
|
||||
- `packages/cli/src/commands/`
|
||||
- `packages/core/src/tools/`
|
||||
- `packages/cli/src/config/settings.ts`
|
||||
|
||||
2. **Review Recent Updates:**
|
||||
- Check recent changelogs in stable and announcements within the
|
||||
documentation to see if newly introduced features are documented properly.
|
||||
|
||||
3. **Evaluate and Record Findings:**
|
||||
- Determine if these features are adequately covered in the docs. They do
|
||||
not need to be documented word for word, but major features that customers
|
||||
should care about probably should have an article.
|
||||
- Append your findings to the `audit-results-[YYYY-MM-DD].md` file,
|
||||
providing a brief description of the feature and where it should be
|
||||
documented.
|
||||
|
||||
## Phase 3: Technical Writer Implementation
|
||||
|
||||
**Role:** The technical writer handles input from both the editor and the
|
||||
software engineer, makes appropriate decisions about what to change, and
|
||||
implements the approved changes.
|
||||
|
||||
### Steps
|
||||
|
||||
1. **Review Audit Results:**
|
||||
- Read `audit-results-[YYYY-MM-DD].md` to understand all identified issues,
|
||||
undocumented features, and recommendations from both the Editor and
|
||||
Software Engineer phases.
|
||||
|
||||
2. **Make Decisions and Log Reasoning:**
|
||||
- Create or update an implementation log (e.g.,
|
||||
`audit-implementation-log-[YYYY-MM-DD].md`).
|
||||
- Make sure the logs are updated for all steps, documenting your reasoning
|
||||
for each recommendation (why it was accepted, modified, or rejected). This
|
||||
is required for a final check by a human in the PR.
|
||||
|
||||
3. **Implement Changes:**
|
||||
- For each approved recommendation:
|
||||
- Read the target documentation file.
|
||||
- Apply the recommended change using the `replace` tool. Pay close
|
||||
attention to `old_string` for exact matches, including whitespace and
|
||||
newlines. For multiple occurrences of the same simple string (e.g.,
|
||||
"e.g."), use `allow_multiple: true`.
|
||||
- **String replacement safeguards:** When applying these fixes across the
|
||||
docset, you must verify the following:
|
||||
- **Preserve Code Blocks:** Explicitly verify that no code blocks,
|
||||
inline code snippets, terminal commands, or file paths have been
|
||||
erroneously capitalized or modified.
|
||||
- **Preserve Literal Strings:** Never alter the wording of literal error
|
||||
messages, UI quotes, or system logs. For example, if a style rule says
|
||||
to remove the word "please", you must NOT remove it if it appears
|
||||
inside a quoted error message (e.g.,
|
||||
`Error: Please contact your administrator`).
|
||||
- **Verify Sentence Casing:** When removing filler words (like "please")
|
||||
from the beginning of a sentence or list item, always verify that the
|
||||
new first word of the sentence is properly capitalized.
|
||||
- For structural changes (e.g., adding an overview paragraph), use
|
||||
`replace` or `write_file` as appropriate.
|
||||
- For broken links, determine the correct new path or update the link
|
||||
text.
|
||||
- For creating new files (e.g., `docs/get-started.md` to fix a broken
|
||||
link, or a new feature article), use `write_file`.
|
||||
|
||||
4. **Execute Auto-Generation Scripts:**
|
||||
- Some documentation pages are auto-generated from the codebase and should
|
||||
be updated using npm scripts rather than manual edits. After implementing
|
||||
manual changes (especially if you edited settings or configurations based
|
||||
on SWE recommendations), ensure you run:
|
||||
- `npm run docs:settings` to generate/update the configuration reference.
|
||||
- `npm run docs:keybindings` to generate/update the keybindings reference.
|
||||
|
||||
5. **Format Code:**
|
||||
- **Dependencies:** If `npm run format` fails, it may be necessary to run
|
||||
`npm install` first to ensure all formatting dependencies are available.
|
||||
- After all changes have been implemented, run `npm run format` to ensure
|
||||
consistent formatting across the project.
|
||||
@@ -0,0 +1,62 @@
|
||||
name: 'Automated Documentation Audit'
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# Runs every Monday at 00:00 UTC
|
||||
- cron: '0 0 * * MON'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
audit-docs:
|
||||
runs-on: 'ubuntu-latest'
|
||||
permissions:
|
||||
contents: 'write'
|
||||
pull-requests: 'write'
|
||||
|
||||
steps:
|
||||
- name: 'Checkout repository'
|
||||
uses: 'actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5'
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: 'main'
|
||||
|
||||
- name: 'Set up Node.js'
|
||||
uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020'
|
||||
with:
|
||||
node-version: '20'
|
||||
|
||||
- name: 'Run Docs Audit with Gemini'
|
||||
id: 'run_gemini'
|
||||
uses: 'google-github-actions/run-gemini-cli@a3bf79042542528e91937b3a3a6fbc4967ee3c31'
|
||||
with:
|
||||
gemini_api_key: '${{ secrets.GEMINI_API_KEY }}'
|
||||
prompt: |
|
||||
Activate the 'docs-writer' skill.
|
||||
|
||||
**Task:** Execute the docs audit procedure, as defined in your 'docs-auditing.md' reference.
|
||||
Provide a detailed summary of the changes you make.
|
||||
|
||||
- name: 'Get current date'
|
||||
id: 'date'
|
||||
run: |
|
||||
echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: 'Create Pull Request with Audit Results'
|
||||
uses: 'peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c'
|
||||
with:
|
||||
token: '${{ secrets.GEMINI_CLI_ROBOT_GITHUB_PAT }}'
|
||||
commit-message: 'docs: weekly audit results for ${{ github.run_id }}'
|
||||
title: 'Docs audit: ${{ steps.date.outputs.date }}'
|
||||
body: |
|
||||
This PR contains the auto-generated documentation audit for the week. It includes a new `audit-results-*.md` file with findings and any direct fixes applied by the agent.
|
||||
|
||||
### Audit Summary:
|
||||
${{ steps.run_gemini.outputs.summary || 'No summary provided.' }}
|
||||
|
||||
Please review the suggestions and merge.
|
||||
|
||||
Related to #25152
|
||||
branch: 'docs-audit-${{ github.run_id }}'
|
||||
base: 'main'
|
||||
team-reviewers: 'gemini-cli-docs, gemini-cli-maintainers'
|
||||
delete-branch: true
|
||||
@@ -72,7 +72,7 @@ organization.
|
||||
**Supported Fields:**
|
||||
|
||||
- `url`: (Required) The full URL of the MCP server endpoint.
|
||||
- `type`: (Required) The connection type (e.g., `sse` or `http`).
|
||||
- `type`: (Required) The connection type (for example, `sse` or `http`).
|
||||
- `trust`: (Optional) If set to `true`, the server is trusted and tool execution
|
||||
will not require user approval.
|
||||
- `includeTools`: (Optional) An explicit list of tool names to allow. If
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Latest stable release: v0.37.0
|
||||
# Latest stable release: v0.37.1
|
||||
|
||||
Released: April 08, 2026
|
||||
Released: April 09, 2026
|
||||
|
||||
For most users, our latest stable release is the recommended release. Install
|
||||
the latest stable version with:
|
||||
@@ -26,6 +26,12 @@ npm install -g @google/gemini-cli
|
||||
|
||||
## What's Changed
|
||||
|
||||
- fix(acp): handle all InvalidStreamError types gracefully in prompt
|
||||
[#24540](https://github.com/google-gemini/gemini-cli/pull/24540)
|
||||
- feat(acp): add support for /about command
|
||||
[#24649](https://github.com/google-gemini/gemini-cli/pull/24649)
|
||||
- feat(acp): add /help command
|
||||
[#24839](https://github.com/google-gemini/gemini-cli/pull/24839)
|
||||
- feat(evals): centralize test agents into test-utils for reuse by @Samee24 in
|
||||
[#23616](https://github.com/google-gemini/gemini-cli/pull/23616)
|
||||
- revert: chore(config): disable agents by default by @abhipatel12 in
|
||||
@@ -416,4 +422,4 @@ npm install -g @google/gemini-cli
|
||||
[#24842](https://github.com/google-gemini/gemini-cli/pull/24842)
|
||||
|
||||
**Full Changelog**:
|
||||
https://github.com/google-gemini/gemini-cli/compare/v0.36.0...v0.37.0
|
||||
https://github.com/google-gemini/gemini-cli/compare/v0.36.0...v0.37.1
|
||||
|
||||
@@ -44,8 +44,8 @@ and Gemini CLI (the server).
|
||||
|
||||
- **Communication:** The entire communication happens over standard input/output
|
||||
(stdio) using the JSON-RPC 2.0 protocol.
|
||||
- **Client's role:** The client is responsible for sending requests (e.g.,
|
||||
prompts) and handling responses and notifications from Gemini CLI.
|
||||
- **Client's role:** The client is responsible for sending requests (for
|
||||
example, prompts) and handling responses and notifications from Gemini CLI.
|
||||
- **Gemini CLI's role:** In ACP mode, Gemini CLI listens for incoming JSON-RPC
|
||||
requests, processes them, and sends back responses.
|
||||
|
||||
@@ -72,8 +72,8 @@ leverage the IDE's capabilities to perform tasks. The MCP client logic is in
|
||||
|
||||
## Capabilities and supported methods
|
||||
|
||||
The ACP protocol exposes a number of methods for ACP clients (e.g. IDEs) to
|
||||
control Gemini CLI.
|
||||
The ACP protocol exposes a number of methods for ACP clients (for example IDEs)
|
||||
to control Gemini CLI.
|
||||
|
||||
### Core methods
|
||||
|
||||
@@ -87,8 +87,8 @@ control Gemini CLI.
|
||||
|
||||
### Session control
|
||||
|
||||
- `setSessionMode`: Allows changing the approval level for tool calls (e.g., to
|
||||
`auto-approve`).
|
||||
- `setSessionMode`: Allows changing the approval level for tool calls (for
|
||||
example, to `auto-approve`).
|
||||
- `unstable_setSessionModel`: Changes the model for the current session.
|
||||
|
||||
### File system proxy
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# Checkpointing
|
||||
|
||||
The Gemini CLI includes a Checkpointing feature that automatically saves a
|
||||
snapshot of your project's state before any file modifications are made by
|
||||
AI-powered tools. This lets you safely experiment with and apply code changes,
|
||||
knowing you can instantly revert back to the state before the tool was run.
|
||||
Gemini CLI includes a Checkpointing feature that automatically saves a snapshot
|
||||
of your project's state before any file modifications are made by AI-powered
|
||||
tools. This lets you safely experiment with and apply code changes, knowing you
|
||||
can instantly revert back to the state before the tool was run.
|
||||
|
||||
## How it works
|
||||
|
||||
@@ -72,7 +72,7 @@ To see a list of all saved checkpoints for the current project, simply run:
|
||||
|
||||
The CLI will display a list of available checkpoint files. These file names are
|
||||
typically composed of a timestamp, the name of the file being modified, and the
|
||||
name of the tool that was about to be run (e.g.,
|
||||
name of the tool that was about to be run (for example,
|
||||
`2025-06-22T10-00-00_000Z-my-file.txt-write_file`).
|
||||
|
||||
### Restore a specific checkpoint
|
||||
|
||||
+11
-11
@@ -29,16 +29,16 @@ and parameters.
|
||||
|
||||
These commands are available within the interactive REPL.
|
||||
|
||||
| Command | Description |
|
||||
| -------------------- | ---------------------------------------- |
|
||||
| `/skills reload` | Reload discovered skills from disk |
|
||||
| `/agents reload` | Reload the agent registry |
|
||||
| `/commands reload` | Reload custom slash commands |
|
||||
| `/memory reload` | Reload context files (e.g., `GEMINI.md`) |
|
||||
| `/mcp reload` | Restart and reload MCP servers |
|
||||
| `/extensions reload` | Reload all active extensions |
|
||||
| `/help` | Show help for all commands |
|
||||
| `/quit` | Exit the interactive session |
|
||||
| Command | Description |
|
||||
| -------------------- | ----------------------------------------------- |
|
||||
| `/skills reload` | Reload discovered skills from disk |
|
||||
| `/agents reload` | Reload the agent registry |
|
||||
| `/commands reload` | Reload custom slash commands |
|
||||
| `/memory reload` | Reload context files (for example, `GEMINI.md`) |
|
||||
| `/mcp reload` | Restart and reload MCP servers |
|
||||
| `/extensions reload` | Reload all active extensions |
|
||||
| `/help` | Show help for all commands |
|
||||
| `/quit` | Exit the interactive session |
|
||||
|
||||
## CLI Options
|
||||
|
||||
@@ -60,7 +60,7 @@ These commands are available within the interactive REPL.
|
||||
| `--allowed-tools` | - | array | - | **Deprecated.** Use the [Policy Engine](../reference/policy-engine.md) instead. Tools that are allowed to run without confirmation (comma-separated or multiple flags) |
|
||||
| `--extensions` | `-e` | array | - | List of extensions to use. If not provided, all extensions are enabled (comma-separated or multiple flags) |
|
||||
| `--list-extensions` | `-l` | boolean | - | List all available extensions and exit |
|
||||
| `--resume` | `-r` | string | - | Resume a previous session. Use `"latest"` for most recent or index number (e.g. `--resume 5`) |
|
||||
| `--resume` | `-r` | string | - | Resume a previous session. Use `"latest"` for most recent or index number (for example `--resume 5`) |
|
||||
| `--list-sessions` | - | boolean | - | List available sessions for the current project and exit |
|
||||
| `--delete-session` | - | string | - | Delete a session by index number (use `--list-sessions` to see available sessions) |
|
||||
| `--include-directories` | - | array | - | Additional directories to include in the workspace (comma-separated or multiple flags) |
|
||||
|
||||
@@ -14,7 +14,7 @@ skill. To use it, ask Gemini CLI to create a new skill for you.
|
||||
|
||||
Gemini CLI will then use the `skill-creator` to generate the skill:
|
||||
|
||||
1. Generate a new directory for your skill (e.g., `my-new-skill/`).
|
||||
1. Generate a new directory for your skill (for example, `my-new-skill/`).
|
||||
2. Create a `SKILL.md` file with the necessary YAML frontmatter (`name` and
|
||||
`description`).
|
||||
3. Create the standard resource directories: `scripts/`, `references/`, and
|
||||
@@ -24,7 +24,7 @@ Gemini CLI will then use the `skill-creator` to generate the skill:
|
||||
|
||||
If you prefer to create skills manually:
|
||||
|
||||
1. **Create a directory** for your skill (e.g., `my-new-skill/`).
|
||||
1. **Create a directory** for your skill (for example, `my-new-skill/`).
|
||||
2. **Create a `SKILL.md` file** inside the new directory.
|
||||
|
||||
To add additional resources that support the skill, refer to the skill
|
||||
|
||||
+15
-14
@@ -85,8 +85,8 @@ The model receives:
|
||||
**B. Using arguments in shell commands (inside `!{...}` blocks)**
|
||||
|
||||
When you use `{{args}}` inside a shell injection block (`!{...}`), the arguments
|
||||
are automatically **shell-escaped** before replacement. This allows you to
|
||||
safely pass arguments to shell commands, ensuring the resulting command is
|
||||
are automatically **shell-escaped** before replacement. This lets you safely
|
||||
pass arguments to shell commands, ensuring the resulting command is
|
||||
syntactically correct and secure while preventing command injection
|
||||
vulnerabilities.
|
||||
|
||||
@@ -105,8 +105,8 @@ When you run `/grep-code It's complicated`:
|
||||
|
||||
1. The CLI sees `{{args}}` used both outside and inside `!{...}`.
|
||||
2. Outside: The first `{{args}}` is replaced raw with `It's complicated`.
|
||||
3. Inside: The second `{{args}}` is replaced with the escaped version (e.g., on
|
||||
Linux: `"It\'s complicated"`).
|
||||
3. Inside: The second `{{args}}` is replaced with the escaped version (for
|
||||
example, on Linux: `"It\'s complicated"`).
|
||||
4. The command executed is `grep -r "It's complicated" .`.
|
||||
5. The CLI prompts you to confirm this exact, secure command before execution.
|
||||
6. The final prompt is sent.
|
||||
@@ -116,13 +116,13 @@ When you run `/grep-code It's complicated`:
|
||||
If your `prompt` does **not** contain the special placeholder `{{args}}`, the
|
||||
CLI uses a default behavior for handling arguments.
|
||||
|
||||
If you provide arguments to the command (e.g., `/mycommand arg1`), the CLI will
|
||||
append the full command you typed to the end of the prompt, separated by two
|
||||
newlines. This allows the model to see both the original instructions and the
|
||||
specific arguments you just provided.
|
||||
If you provide arguments to the command (for example, `/mycommand arg1`), the
|
||||
CLI will append the full command you typed to the end of the prompt, separated
|
||||
by two newlines. This allows the model to see both the original instructions and
|
||||
the specific arguments you just provided.
|
||||
|
||||
If you do **not** provide any arguments (e.g., `/mycommand`), the prompt is sent
|
||||
to the model exactly as it is, with nothing appended.
|
||||
If you do **not** provide any arguments (for example, `/mycommand`), the prompt
|
||||
is sent to the model exactly as it is, with nothing appended.
|
||||
|
||||
**Example (`changelog.toml`):**
|
||||
|
||||
@@ -188,7 +188,7 @@ ensure that only intended commands can be run.
|
||||
dialog will appear showing the exact command(s) to be executed.
|
||||
5. **Execution and error reporting:** The command is executed. If the command
|
||||
fails, the output injected into the prompt will include the error messages
|
||||
(stderr) followed by a status line, e.g.,
|
||||
(stderr) followed by a status line, for example,
|
||||
`[Shell command exited with code 1]`. This helps the model understand the
|
||||
context of the failure.
|
||||
|
||||
@@ -229,9 +229,10 @@ operate on specific files.
|
||||
|
||||
- **File injection**: `@{path/to/file.txt}` is replaced by the content of
|
||||
`file.txt`.
|
||||
- **Multimodal support**: If the path points to a supported image (e.g., PNG,
|
||||
JPEG), PDF, audio, or video file, it will be correctly encoded and injected as
|
||||
multimodal input. Other binary files are handled gracefully and skipped.
|
||||
- **Multimodal support**: If the path points to a supported image (for example,
|
||||
PNG, JPEG), PDF, audio, or video file, it will be correctly encoded and
|
||||
injected as multimodal input. Other binary files are handled gracefully and
|
||||
skipped.
|
||||
- **Directory listing**: `@{path/to/dir}` is traversed and each file present
|
||||
within the directory and all subdirectories is inserted into the prompt. This
|
||||
respects `.gitignore` and `.geminiignore` if enabled.
|
||||
|
||||
+16
-13
@@ -175,8 +175,8 @@ the enterprise settings are always loaded with the highest precedence.
|
||||
**Example wrapper script:**
|
||||
|
||||
Administrators can create a script named `gemini` and place it in a directory
|
||||
that appears earlier in the user's `PATH` than the actual Gemini CLI binary
|
||||
(e.g., `/usr/local/bin/gemini`).
|
||||
that appears earlier in the user's `PATH` than the actual Gemini CLI binary (for
|
||||
example, `/usr/local/bin/gemini`).
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
@@ -325,9 +325,9 @@ User. When it comes to the `mcpServers` object, these configurations are
|
||||
1. **Merging:** The lists of servers from all three levels are combined into a
|
||||
single list.
|
||||
2. **Precedence:** If a server with the **same name** is defined at multiple
|
||||
levels (e.g., a server named `corp-api` exists in both system and user
|
||||
settings), the definition from the highest-precedence level is used. The
|
||||
order of precedence is: **System > Workspace > User**.
|
||||
levels (for example, a server named `corp-api` exists in both system and
|
||||
user settings), the definition from the highest-precedence level is used.
|
||||
The order of precedence is: **System > Workspace > User**.
|
||||
|
||||
This means a user **cannot** override the definition of a server that is already
|
||||
defined in the system-level settings. However, they **can** add new servers with
|
||||
@@ -343,8 +343,8 @@ canonical servers and adding their names to an allowlist.
|
||||
For even greater security, especially when dealing with third-party MCP servers,
|
||||
you can restrict which specific tools from a server are exposed to the model.
|
||||
This is done using the `includeTools` and `excludeTools` properties within a
|
||||
server's definition. This allows you to use a subset of tools from a server
|
||||
without allowing potentially dangerous ones.
|
||||
server's definition. This lets you use a subset of tools from a server without
|
||||
allowing potentially dangerous ones.
|
||||
|
||||
Following the principle of least privilege, it is highly recommended to use
|
||||
`includeTools` to create an allowlist of only the necessary tools.
|
||||
@@ -481,9 +481,8 @@ an environment variable, but it can also be enforced for custom tools via the
|
||||
## Telemetry and auditing
|
||||
|
||||
For auditing and monitoring purposes, you can configure Gemini CLI to send
|
||||
telemetry data to a central location. This allows you to track tool usage and
|
||||
other events. For more information, see the
|
||||
[telemetry documentation](./telemetry.md).
|
||||
telemetry data to a central location. This lets you track tool usage and other
|
||||
events. For more information, see the [telemetry documentation](./telemetry.md).
|
||||
|
||||
**Example:** Enable telemetry and send it to a local OTLP collector. If
|
||||
`otlpEndpoint` is not specified, it defaults to `http://localhost:4317`.
|
||||
@@ -506,15 +505,19 @@ other events. For more information, see the
|
||||
## Authentication
|
||||
|
||||
You can enforce a specific authentication method for all users by setting the
|
||||
`enforcedAuthType` in the system-level `settings.json` file. This prevents users
|
||||
from choosing a different authentication method. See the
|
||||
`security.auth.enforcedType` in the system-level `settings.json` file. This
|
||||
prevents users from choosing a different authentication method. See the
|
||||
[Authentication docs](../get-started/authentication.md) for more details.
|
||||
|
||||
**Example:** Enforce the use of Google login for all users.
|
||||
|
||||
```json
|
||||
{
|
||||
"enforcedAuthType": "oauth-personal"
|
||||
"security": {
|
||||
"auth": {
|
||||
"enforcedType": "oauth-personal"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# Ignoring files
|
||||
|
||||
This document provides an overview of the Gemini Ignore (`.geminiignore`)
|
||||
feature of the Gemini CLI.
|
||||
feature of Gemini CLI.
|
||||
|
||||
The Gemini CLI includes the ability to automatically ignore files, similar to
|
||||
Gemini CLI includes the ability to automatically ignore files, similar to
|
||||
`.gitignore` (used by Git) and `.aiexclude` (used by Gemini Code Assist). Adding
|
||||
paths to your `.geminiignore` file will exclude them from tools that support
|
||||
this feature, although they will still be visible to other services (such as
|
||||
|
||||
@@ -1,26 +1,28 @@
|
||||
# Advanced Model Configuration
|
||||
|
||||
This guide details the Model Configuration system within the Gemini CLI.
|
||||
Designed for researchers, AI quality engineers, and advanced users, this system
|
||||
provides a rigorous framework for managing generative model hyperparameters and
|
||||
This guide details the Model Configuration system within Gemini CLI. Designed
|
||||
for researchers, AI quality engineers, and advanced users, this system provides
|
||||
a rigorous framework for managing generative model hyperparameters and
|
||||
behaviors.
|
||||
|
||||
> **Warning**: This is a power-user feature. Configuration values are passed
|
||||
<!-- prettier-ignore -->
|
||||
> [!WARNING]
|
||||
> This is a power-user feature. Configuration values are passed
|
||||
> directly to the model provider with minimal validation. Incorrect settings
|
||||
> (e.g., incompatible parameter combinations) may result in runtime errors from
|
||||
> the API.
|
||||
> (for example, incompatible parameter combinations) may result in runtime
|
||||
> errors from the API.
|
||||
|
||||
## 1. System Overview
|
||||
|
||||
The Model Configuration system (`ModelConfigService`) enables deterministic
|
||||
control over model generation. It decouples the requested model identifier
|
||||
(e.g., a CLI flag or agent request) from the underlying API configuration. This
|
||||
allows for:
|
||||
control over model generation. It decouples the requested model identifier (for
|
||||
example, a CLI flag or agent request) from the underlying API configuration.
|
||||
This allows for:
|
||||
|
||||
- **Precise Hyperparameter Tuning**: Direct control over `temperature`, `topP`,
|
||||
`thinkingBudget`, and other SDK-level parameters.
|
||||
- **Environment-Specific Behavior**: Distinct configurations for different
|
||||
operating contexts (e.g., testing vs. production).
|
||||
operating contexts (for example, testing vs. production).
|
||||
- **Agent-Scoped Customization**: Applying specific settings only when a
|
||||
particular agent is active.
|
||||
|
||||
@@ -71,7 +73,7 @@ context. They are evaluated dynamically for each model request.
|
||||
specified `match` properties.
|
||||
- `model`: Matches the requested model name or alias.
|
||||
- `overrideScope`: Matches the distinct scope of the request (typically the
|
||||
agent name, e.g., `codebaseInvestigator`).
|
||||
agent name, for example, `codebaseInvestigator`).
|
||||
|
||||
**Example Override**:
|
||||
|
||||
@@ -113,8 +115,8 @@ and `overrideScope`).
|
||||
1. **Filtering**: All matching overrides are identified.
|
||||
2. **Sorting**: Matches are prioritized by **specificity** (the number of
|
||||
matched keys in the `match` object).
|
||||
- Specific matches (e.g., `model` + `overrideScope`) override broad matches
|
||||
(e.g., `model` only).
|
||||
- Specific matches (for example, `model` + `overrideScope`) override broad
|
||||
matches (for example, `model` only).
|
||||
- Tie-breaking: If specificity is equal, the order of definition in the
|
||||
`overrides` array is preserved (last one wins).
|
||||
3. **Merging**: The configurations from the sorted overrides are merged
|
||||
@@ -128,10 +130,10 @@ The configuration follows the `ModelConfigServiceConfig` interface.
|
||||
|
||||
Defines the actual parameters for the model.
|
||||
|
||||
| Property | Type | Description |
|
||||
| :---------------------- | :------- | :----------------------------------------------------------------- |
|
||||
| `model` | `string` | The identifier of the model to be called (e.g., `gemini-2.5-pro`). |
|
||||
| `generateContentConfig` | `object` | The configuration object passed to the `@google/genai` SDK. |
|
||||
| Property | Type | Description |
|
||||
| :---------------------- | :------- | :------------------------------------------------------------------------ |
|
||||
| `model` | `string` | The identifier of the model to be called (for example, `gemini-2.5-pro`). |
|
||||
| `generateContentConfig` | `object` | The configuration object passed to the `@google/genai` SDK. |
|
||||
|
||||
### `GenerateContentConfig` (Common Parameters)
|
||||
|
||||
@@ -142,7 +144,7 @@ Directly maps to the SDK's `GenerateContentConfig`. Common parameters include:
|
||||
- **`topP`**: (`number`) Nucleus sampling probability.
|
||||
- **`maxOutputTokens`**: (`number`) Limit on generated response length.
|
||||
- **`thinkingConfig`**: (`object`) Configuration for models with reasoning
|
||||
capabilities (e.g., `thinkingBudget`, `includeThoughts`).
|
||||
capabilities (for example, `thinkingBudget`, `includeThoughts`).
|
||||
|
||||
## 5. Practical Examples
|
||||
|
||||
@@ -170,7 +172,7 @@ configuration but enforcing zero temperature.
|
||||
### Agent-Specific Parameter Injection
|
||||
|
||||
Enforce extended thinking budgets for a specific agent without altering the
|
||||
global default, e.g. for the `codebaseInvestigator`.
|
||||
global default, for example for the `codebaseInvestigator`.
|
||||
|
||||
```json
|
||||
"modelConfigs": {
|
||||
|
||||
@@ -10,8 +10,8 @@ Model routing is managed by the `ModelAvailabilityService`, which monitors model
|
||||
health and automatically routes requests to available models based on defined
|
||||
policies.
|
||||
|
||||
1. **Model failure:** If the currently selected model fails (e.g., due to quota
|
||||
or server errors), the CLI will initiate the fallback process.
|
||||
1. **Model failure:** If the currently selected model fails (for example, due
|
||||
to quota or server errors), the CLI will initiate the fallback process.
|
||||
|
||||
2. **User consent:** Depending on the failure and the model's policy, the CLI
|
||||
may prompt you to switch to a fallback model (by default always prompts
|
||||
|
||||
@@ -19,7 +19,7 @@ Model steering is an experimental feature and is disabled by default. You can
|
||||
enable it using the `/settings` command or by updating your `settings.json`
|
||||
file.
|
||||
|
||||
1. Type `/settings` in the Gemini CLI.
|
||||
1. Type `/settings` in Gemini CLI.
|
||||
2. Search for **Model Steering**.
|
||||
3. Set the value to **true**.
|
||||
|
||||
|
||||
@@ -314,8 +314,8 @@ Hooks such as `BeforeTool` or `AfterTool` can be configured to intercept the
|
||||
> [!WARNING] When hooks are triggered by **tool executions**, they do **not**
|
||||
> run when you manually toggle Plan Mode using the `/plan` command or the
|
||||
> `Shift+Tab` keyboard shortcut. If you need hooks to execute on mode changes,
|
||||
> ensure the transition is initiated by the agent (e.g., by asking "start a plan
|
||||
> for...").
|
||||
> ensure the transition is initiated by the agent (for example, by asking "start
|
||||
> a plan for...").
|
||||
|
||||
#### Example: Archive approved plans to GCS (`AfterTool`)
|
||||
|
||||
|
||||
+7
-5
@@ -1,11 +1,11 @@
|
||||
# Sandboxing in the Gemini CLI
|
||||
# Sandboxing in Gemini CLI
|
||||
|
||||
This document provides a guide to sandboxing in the Gemini CLI, including
|
||||
This document provides a guide to sandboxing in Gemini CLI, including
|
||||
prerequisites, quickstart, and configuration.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before using sandboxing, you need to install and set up the Gemini CLI:
|
||||
Before using sandboxing, you need to install and set up Gemini CLI:
|
||||
|
||||
```bash
|
||||
npm install -g @google/gemini-cli
|
||||
@@ -229,7 +229,7 @@ gemini -p "run the test suite"
|
||||
2. **Environment variable**:
|
||||
`GEMINI_SANDBOX=true|docker|podman|sandbox-exec|runsc|lxc`
|
||||
3. **Settings file**: `"sandbox": true` in the `tools` object of your
|
||||
`settings.json` file (e.g., `{"tools": {"sandbox": true}}`).
|
||||
`settings.json` file (for example, `{"tools": {"sandbox": true}}`).
|
||||
|
||||
### macOS Seatbelt profiles
|
||||
|
||||
@@ -309,7 +309,9 @@ $env:SANDBOX_SET_UID_GID="false" # Disable UID/GID mapping
|
||||
|
||||
**Missing commands**
|
||||
|
||||
- Add to custom Dockerfile.
|
||||
- Add to a custom Dockerfile. Automatic `BUILD_SANDBOX` builds are only
|
||||
available when running Gemini CLI from source; npm installs need a prebuilt
|
||||
image instead.
|
||||
- Install via `sandbox.bashrc`.
|
||||
|
||||
**Network issues**
|
||||
|
||||
@@ -35,7 +35,7 @@ via a `.gemini/.env` file. See
|
||||
- `GEMINI_SYSTEM_MD=/absolute/path/to/my-system.md`
|
||||
- Relative paths are supported and resolved from the current working
|
||||
directory.
|
||||
- Tilde expansion is supported (e.g., `~/my-system.md`).
|
||||
- Tilde expansion is supported (for example, `~/my-system.md`).
|
||||
|
||||
- Disable the override (use built‑in prompt):
|
||||
- `GEMINI_SYSTEM_MD=false` or `GEMINI_SYSTEM_MD=0` or unset the variable.
|
||||
@@ -70,7 +70,7 @@ dynamically include built-in content:
|
||||
- `${AvailableTools}`: Injects a bulleted list of all currently enabled tool
|
||||
names.
|
||||
- Tool Name Variables: Injects the actual name of a tool using the pattern:
|
||||
`${toolName}_ToolName` (e.g., `${write_file_ToolName}`,
|
||||
`${toolName}_ToolName` (for example, `${write_file_ToolName}`,
|
||||
`${run_shell_command_ToolName}`).
|
||||
|
||||
This pattern is generated dynamically for all available tools.
|
||||
|
||||
+2
-2
@@ -117,8 +117,8 @@ least `background.primary`, `text.primary`, `text.secondary`, and the various
|
||||
accent colors via `text.link`, `text.accent`, and `status` to ensure a cohesive
|
||||
UI.
|
||||
|
||||
You can use either hex codes (e.g., `#FF0000`) **or** standard CSS color names
|
||||
(e.g., `coral`, `teal`, `blue`) for any color value. See
|
||||
You can use either hex codes (for example, `#FF0000`) **or** standard CSS color
|
||||
names (for example, `coral`, `teal`, `blue`) for any color value. See
|
||||
[CSS color names](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#color_keywords)
|
||||
for a full list of supported names.
|
||||
|
||||
|
||||
+14
-14
@@ -1,7 +1,7 @@
|
||||
# Trusted Folders
|
||||
|
||||
The Trusted Folders feature is a security setting that gives you control over
|
||||
which projects can use the full capabilities of the Gemini CLI. It prevents
|
||||
which projects can use the full capabilities of Gemini CLI. It prevents
|
||||
potentially malicious code from running by asking you to approve a folder before
|
||||
the CLI loads any project-specific configurations from it.
|
||||
|
||||
@@ -24,12 +24,12 @@ Add the following to your user `settings.json` file:
|
||||
|
||||
## How it works: The trust dialog
|
||||
|
||||
Once the feature is enabled, the first time you run the Gemini CLI from a
|
||||
folder, a dialog will automatically appear, prompting you to make a choice:
|
||||
Once the feature is enabled, the first time you run Gemini CLI from a folder, a
|
||||
dialog will automatically appear, prompting you to make a choice:
|
||||
|
||||
- **Trust folder**: Grants full trust to the current folder (e.g.,
|
||||
- **Trust folder**: Grants full trust to the current folder (for example,
|
||||
`my-project`).
|
||||
- **Trust parent folder**: Grants trust to the parent directory (e.g.,
|
||||
- **Trust parent folder**: Grants trust to the parent directory (for example,
|
||||
`safe-projects`), which automatically trusts all of its subdirectories as
|
||||
well. This is useful if you keep all your safe projects in one place.
|
||||
- **Don't trust**: Marks the folder as untrusted. The CLI will operate in a
|
||||
@@ -40,9 +40,9 @@ will only be asked once per folder.
|
||||
|
||||
## Understanding folder contents: The discovery phase
|
||||
|
||||
Before you make a choice, the Gemini CLI performs a **discovery phase** to scan
|
||||
the folder for potential configurations. This information is displayed in the
|
||||
trust dialog to help you make an informed decision.
|
||||
Before you make a choice, Gemini CLI performs a **discovery phase** to scan the
|
||||
folder for potential configurations. This information is displayed in the trust
|
||||
dialog to help you make an informed decision.
|
||||
|
||||
The discovery UI lists the following categories of items found in the project:
|
||||
|
||||
@@ -63,16 +63,16 @@ attention:
|
||||
settings, such as auto-approving certain tools or disabling the security
|
||||
sandbox.
|
||||
- **Discovery Errors**: If the CLI encounters issues while scanning the folder
|
||||
(e.g., a malformed `settings.json` file), these errors will be displayed
|
||||
prominently.
|
||||
(for example, a malformed `settings.json` file), these errors will be
|
||||
displayed prominently.
|
||||
|
||||
By reviewing these details, you can ensure that you only grant trust to projects
|
||||
that you know are safe.
|
||||
|
||||
## Why trust matters: The impact of an untrusted workspace
|
||||
|
||||
When a folder is **untrusted**, the Gemini CLI runs in a restricted "safe mode"
|
||||
to protect you. In this mode, the following features are disabled:
|
||||
When a folder is **untrusted**, Gemini CLI runs in a restricted "safe mode" to
|
||||
protect you. In this mode, the following features are disabled:
|
||||
|
||||
1. **Workspace settings are ignored**: The CLI will **not** load the
|
||||
`.gemini/settings.json` file from the project. This prevents the loading of
|
||||
@@ -97,8 +97,8 @@ to protect you. In this mode, the following features are disabled:
|
||||
commands from .toml files, including both project-specific and global user
|
||||
commands.
|
||||
|
||||
Granting trust to a folder unlocks the full functionality of the Gemini CLI for
|
||||
that workspace.
|
||||
Granting trust to a folder unlocks the full functionality of Gemini CLI for that
|
||||
workspace.
|
||||
|
||||
## Managing your trust settings
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ The agent will:
|
||||
## Troubleshooting
|
||||
|
||||
- **Server won't start?** Try running the docker command manually in your
|
||||
terminal to see if it prints an error (e.g., "image not found").
|
||||
terminal to see if it prints an error (for example, "image not found").
|
||||
- **Tools not found?** Run `/mcp reload` to force the CLI to re-query the server
|
||||
for its capabilities.
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ loaded into every conversation.
|
||||
|
||||
### Scenario: Using the hierarchy
|
||||
|
||||
Context is loaded hierarchically. This allows you to have general rules for
|
||||
Context is loaded hierarchically. This lets you have general rules for
|
||||
everything and specific rules for sub-projects.
|
||||
|
||||
1. **Global:** `~/.gemini/GEMINI.md` (Rules for _every_ project you work on).
|
||||
|
||||
@@ -79,8 +79,8 @@ each step with higher confidence and fewer errors.
|
||||
- **Steer early:** Providing feedback during the research phase is more
|
||||
efficient than waiting for the final plan to be drafted.
|
||||
- **Use for context:** Steering is a great way to provide knowledge that might
|
||||
not be obvious from reading the code (e.g., "We are planning to deprecate this
|
||||
module next month").
|
||||
not be obvious from reading the code (for example, "We are planning to
|
||||
deprecate this module next month").
|
||||
|
||||
## Next steps
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ browser.
|
||||
|
||||
This opens a searchable list of all your past sessions. You'll see:
|
||||
|
||||
- A timestamp (e.g., "2 hours ago").
|
||||
- A timestamp (for example, "2 hours ago").
|
||||
- The first user message (helping you identify the topic).
|
||||
- The number of turns in the conversation.
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ watchers.
|
||||
|
||||
**Prompt:** `Start the React dev server in the background.`
|
||||
|
||||
Gemini will run the command (e.g., `npm run dev`) and detach it.
|
||||
Gemini will run the command (for example, `npm run dev`) and detach it.
|
||||
|
||||
### Scenario: Viewing active shells
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ progress with the todo list.
|
||||
## Prerequisites
|
||||
|
||||
- Gemini CLI installed and authenticated.
|
||||
- A complex task in mind (e.g., a multi-file refactor or new feature).
|
||||
- A complex task in mind (for example, a multi-file refactor or new feature).
|
||||
|
||||
## Why use task planning?
|
||||
|
||||
@@ -58,7 +58,7 @@ Tell the agent to proceed.
|
||||
As the agent works, you'll see the todo list update in real-time above the input
|
||||
box.
|
||||
|
||||
- **Current focus:** The active task is highlighted (e.g.,
|
||||
- **Current focus:** The active task is highlighted (for example,
|
||||
`[IN_PROGRESS] Create tsconfig.json`).
|
||||
- **Progress:** Completed tasks are marked as done.
|
||||
|
||||
@@ -90,4 +90,4 @@ living document, not a static text block.
|
||||
- See the [Todo tool reference](../../tools/todos.md) for technical schema
|
||||
details.
|
||||
- Learn about [Memory management](memory-management.md) to persist planning
|
||||
preferences (e.g., "Always create a test plan first").
|
||||
preferences (for example, "Always create a test plan first").
|
||||
|
||||
+5
-6
@@ -29,7 +29,7 @@ While the `packages/cli` portion of Gemini CLI provides the user interface,
|
||||
potentially incorporating conversation history, tool definitions, and
|
||||
instructional context from `GEMINI.md` files.
|
||||
- **Tool management & orchestration:**
|
||||
- Registering available tools (e.g., file system tools, shell command
|
||||
- Registering available tools (for example, file system tools, shell command
|
||||
execution).
|
||||
- Interpreting tool use requests from the Gemini model.
|
||||
- Executing the requested tools with the provided arguments.
|
||||
@@ -45,7 +45,7 @@ The core plays a vital role in security:
|
||||
|
||||
- **API key management:** It handles the `GEMINI_API_KEY` and ensures it's used
|
||||
securely when communicating with the Gemini API.
|
||||
- **Tool execution:** When tools interact with the local system (e.g.,
|
||||
- **Tool execution:** When tools interact with the local system (for example,
|
||||
`run_shell_command`), the core (and its underlying tool implementations) must
|
||||
do so with appropriate caution, often involving sandboxing mechanisms to
|
||||
prevent unintended modifications.
|
||||
@@ -70,7 +70,7 @@ to use the CLI even if the default "pro" model is rate-limited.
|
||||
|
||||
If you are using the default "pro" model and the CLI detects that you are being
|
||||
rate-limited, it automatically switches to the "flash" model for the current
|
||||
session. This allows you to continue working without interruption.
|
||||
session. This lets you continue working without interruption.
|
||||
|
||||
Internal utility calls that use `gemini-2.5-flash-lite` (for example, prompt
|
||||
completion and classification) silently fall back to `gemini-2.5-flash` and
|
||||
@@ -90,9 +90,8 @@ in a hierarchical manner, starting from the current working directory and moving
|
||||
up to the project root and the user's home directory. It also searches in
|
||||
subdirectories.
|
||||
|
||||
This allows you to have global, project-level, and component-level context
|
||||
files, which are all combined to provide the model with the most relevant
|
||||
information.
|
||||
This lets you have global, project-level, and component-level context files,
|
||||
which are all combined to provide the model with the most relevant information.
|
||||
|
||||
You can use the [`/memory` command](../reference/commands.md) to `show`, `add`,
|
||||
and `refresh` the content of loaded `GEMINI.md` files.
|
||||
|
||||
@@ -108,7 +108,7 @@ Download complete.
|
||||
$ ./lit.lit.macos_arm64 pull gemma3-1b-gpu-custom
|
||||
|
||||
[Legal] The model you are about to download is governed by
|
||||
the Gemma Terms of Use and Prohibited Use Policy. Please review these terms and ensure you agree before continuing.
|
||||
the Gemma Terms of Use and Prohibited Use Policy. Review these terms and ensure you agree before continuing.
|
||||
|
||||
Full Terms: https://ai.google.dev/gemma/terms
|
||||
Prohibited Use Policy: https://ai.google.dev/gemma/prohibited_use_policy
|
||||
|
||||
@@ -430,7 +430,7 @@ both behind auth.
|
||||
|
||||
## Managing Subagents
|
||||
|
||||
Users can manage subagents using the following commands within the Gemini CLI:
|
||||
Users can manage subagents using the following commands within Gemini CLI:
|
||||
|
||||
- `/agents list`: Displays all available local and remote subagents.
|
||||
- `/agents reload`: Reloads the agent registry. Use this after adding or
|
||||
|
||||
+21
-3
@@ -358,7 +358,7 @@ it yourself; just report it.
|
||||
| `kind` | string | No | `local` (default) or `remote`. |
|
||||
| `tools` | array | No | List of tool names this agent can use. Supports wildcards: `*` (all tools), `mcp_*` (all MCP tools), `mcp_server_*` (all tools from a server). **If omitted, it inherits all tools from the parent session.** |
|
||||
| `mcpServers` | object | No | Configuration for inline Model Context Protocol (MCP) servers isolated to this specific agent. |
|
||||
| `model` | string | No | Specific model to use (e.g., `gemini-3-preview`). Defaults to `inherit` (uses the main session model). |
|
||||
| `model` | string | No | Specific model to use (for example, `gemini-3-preview`). Defaults to `inherit` (uses the main session model). |
|
||||
| `temperature` | number | No | Model temperature (0.0 - 2.0). Defaults to `1`. |
|
||||
| `max_turns` | number | No | Maximum number of conversation turns allowed for this agent before it must return. Defaults to `30`. |
|
||||
| `timeout_mins` | number | No | Maximum execution time in minutes. Defaults to `10`. |
|
||||
@@ -410,8 +410,8 @@ With this feature, you can:
|
||||
### Configuring isolated tools and servers
|
||||
|
||||
You can configure tool isolation for a subagent by updating its markdown
|
||||
frontmatter. This allows you to explicitly state which tools the subagent can
|
||||
use, rather than relying on the global registry.
|
||||
frontmatter. This lets you explicitly state which tools the subagent can use,
|
||||
rather than relying on the global registry.
|
||||
|
||||
Add an `mcpServers` object to define inline MCP servers that are unique to the
|
||||
agent.
|
||||
@@ -521,6 +521,24 @@ field.
|
||||
}
|
||||
```
|
||||
|
||||
#### Safety policies (TOML)
|
||||
|
||||
You can restrict access to specific subagents using the CLI's **Policy Engine**.
|
||||
Subagents are treated as virtual tool names for policy matching purposes.
|
||||
|
||||
To govern access to a subagent, create a `.toml` file in your policy directory
|
||||
(e.g., `~/.gemini/policies/`):
|
||||
|
||||
```toml
|
||||
[[rule]]
|
||||
toolName = "codebase_investigator"
|
||||
decision = "deny"
|
||||
deny_message = "Deep codebase analysis is restricted for this session."
|
||||
```
|
||||
|
||||
For more information on setting up fine-grained safety guardrails, see the
|
||||
[Policy Engine reference](../reference/policy-engine.md#special-syntax-for-subagents).
|
||||
|
||||
### Optimizing your subagent
|
||||
|
||||
The main agent's system prompt encourages it to use an expert subagent when one
|
||||
|
||||
@@ -117,8 +117,9 @@ for your users.
|
||||
Follow [Semantic Versioning (SemVer)](https://semver.org/) to communicate
|
||||
changes clearly.
|
||||
|
||||
- **Major:** Breaking changes (e.g., renaming tools or changing arguments).
|
||||
- **Minor:** New features (e.g., adding new tools or commands).
|
||||
- **Major:** Breaking changes (for example, renaming tools or changing
|
||||
arguments).
|
||||
- **Minor:** New features (for example, adding new tools or commands).
|
||||
- **Patch:** Bug fixes and performance improvements.
|
||||
|
||||
### Release channels
|
||||
@@ -182,7 +183,7 @@ If your tools aren't working as expected:
|
||||
If a custom command isn't responding:
|
||||
|
||||
- **Check precedence:** Remember that user and project commands take precedence
|
||||
over extension commands. Use the prefixed name (e.g., `/extension.command`) to
|
||||
verify the extension's version.
|
||||
over extension commands. Use the prefixed name (for example,
|
||||
`/extension.command`) to verify the extension's version.
|
||||
- **Help command:** Run `/help` to see a list of all available commands and
|
||||
their sources.
|
||||
|
||||
@@ -88,12 +88,12 @@ gemini extensions new <path> [template]
|
||||
```
|
||||
|
||||
- `<path>`: The directory to create.
|
||||
- `[template]`: The template to use (e.g., `mcp-server`, `context`,
|
||||
- `[template]`: The template to use (for example, `mcp-server`, `context`,
|
||||
`custom-commands`).
|
||||
|
||||
### Link a local extension
|
||||
|
||||
Create a symbolic link between your development directory and the Gemini CLI
|
||||
Create a symbolic link between your development directory and Gemini CLI
|
||||
extensions directory. This lets you test changes immediately without
|
||||
reinstalling.
|
||||
|
||||
@@ -244,7 +244,7 @@ agent definition files (`.md`) to an `agents/` directory in your extension root.
|
||||
|
||||
### <a id="policy-engine"></a>Policy Engine
|
||||
|
||||
Extensions can contribute policy rules and safety checkers to the Gemini CLI
|
||||
Extensions can contribute policy rules and safety checkers to Gemini CLI
|
||||
[Policy Engine](../reference/policy-engine.md). These rules are defined in
|
||||
`.toml` files and take effect when the extension is activated.
|
||||
|
||||
@@ -324,13 +324,14 @@ defined in the `themes` array in `gemini-extension.json`.
|
||||
Custom themes provided by extensions can be selected using the `/theme` command
|
||||
or by setting the `ui.theme` property in your `settings.json` file. Note that
|
||||
when referring to a theme from an extension, the extension name is appended to
|
||||
the theme name in parentheses, e.g., `shades-of-green (my-green-extension)`.
|
||||
the theme name in parentheses, for example,
|
||||
`shades-of-green (my-green-extension)`.
|
||||
|
||||
### Conflict resolution
|
||||
|
||||
Extension commands have the lowest precedence. If an extension command name
|
||||
conflicts with a user or project command, the extension command is prefixed with
|
||||
the extension name (e.g., `/gcp.deploy`) using a dot separator.
|
||||
the extension name (for example, `/gcp.deploy`) using a dot separator.
|
||||
|
||||
## Variables
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ Use these values for the placeholders:
|
||||
**Examples:**
|
||||
|
||||
- `darwin.arm64.my-tool.tar.gz` (specific to Apple Silicon Macs)
|
||||
- `darwin.my-tool.tar.gz` (fallback for all Macs, e.g. Intel)
|
||||
- `darwin.my-tool.tar.gz` (fallback for all Macs, for example Intel)
|
||||
- `linux.x64.my-tool.tar.gz`
|
||||
- `win32.my-tool.zip`
|
||||
|
||||
@@ -155,9 +155,10 @@ jobs:
|
||||
|
||||
## Migrating an Extension Repository
|
||||
|
||||
If you need to move your extension to a new repository (e.g., from a personal
|
||||
account to an organization) or rename it, you can use the `migratedTo` property
|
||||
in your `gemini-extension.json` file to seamlessly transition your users.
|
||||
If you need to move your extension to a new repository (for example, from a
|
||||
personal account to an organization) or rename it, you can use the `migratedTo`
|
||||
property in your `gemini-extension.json` file to seamlessly transition your
|
||||
users.
|
||||
|
||||
1. **Create the new repository**: Setup your extension in its new location.
|
||||
2. **Update the old repository**: In your original repository, update the
|
||||
@@ -173,7 +174,7 @@ in your `gemini-extension.json` file to seamlessly transition your users.
|
||||
```
|
||||
3. **Release the update**: Publish this new version in your old repository.
|
||||
|
||||
When users check for updates, the Gemini CLI will detect the `migratedTo` field,
|
||||
When users check for updates, Gemini CLI will detect the `migratedTo` field,
|
||||
verify that the new repository contains a valid extension update, and
|
||||
automatically update their local installation to track the new source and name
|
||||
moving forward. All extension settings will automatically migrate to the new
|
||||
|
||||
@@ -7,22 +7,22 @@ linking it for local development.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before you start, ensure you have the Gemini CLI installed and a basic
|
||||
understanding of Node.js.
|
||||
Before you start, ensure you have Gemini CLI installed and a basic understanding
|
||||
of Node.js.
|
||||
|
||||
## Extension features
|
||||
|
||||
Extensions offer several ways to customize Gemini CLI. Use this table to decide
|
||||
which features your extension needs.
|
||||
|
||||
| Feature | What it is | When to use it | Invoked by |
|
||||
| :------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- |
|
||||
| **[MCP server](reference.md#mcp-servers)** | A standard way to expose new tools and data sources to the model. | Use this when you want the model to be able to _do_ new things, like fetching data from an internal API, querying a database, or controlling a local application. We also support MCP resources (which can replace custom commands) and system instructions (which can replace custom context) | Model |
|
||||
| **[Custom commands](../cli/custom-commands.md)** | A shortcut (like `/my-cmd`) that executes a pre-defined prompt or shell command. | Use this for repetitive tasks or to save long, complex prompts that you use frequently. Great for automation. | User |
|
||||
| **[Context file (`GEMINI.md`)](reference.md#contextfilename)** | A markdown file containing instructions that are loaded into the model's context at the start of every session. | Use this to define the "personality" of your extension, set coding standards, or provide essential knowledge that the model should always have. | CLI provides to model |
|
||||
| **[Agent skills](../cli/skills.md)** | A specialized set of instructions and workflows that the model activates only when needed. | Use this for complex, occasional tasks (like "create a PR" or "audit security") to avoid cluttering the main context window when the skill isn't being used. | Model |
|
||||
| **[Hooks](../hooks/index.md)** | A way to intercept and customize the CLI's behavior at specific lifecycle events (e.g., before/after a tool call). | Use this when you want to automate actions based on what the model is doing, like validating tool arguments, logging activity, or modifying the model's input/output. | CLI |
|
||||
| **[Custom themes](reference.md#themes)** | A set of color definitions to personalize the CLI UI. | Use this to provide a unique visual identity for your extension or to offer specialized high-contrast or thematic color schemes. | User (via /theme) |
|
||||
| Feature | What it is | When to use it | Invoked by |
|
||||
| :------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------ | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- |
|
||||
| **[MCP server](reference.md#mcp-servers)** | A standard way to expose new tools and data sources to the model. | Use this when you want the model to be able to _do_ new things, like fetching data from an internal API, querying a database, or controlling a local application. We also support MCP resources (which can replace custom commands) and system instructions (which can replace custom context) | Model |
|
||||
| **[Custom commands](../cli/custom-commands.md)** | A shortcut (like `/my-cmd`) that executes a pre-defined prompt or shell command. | Use this for repetitive tasks or to save long, complex prompts that you use frequently. Great for automation. | User |
|
||||
| **[Context file (`GEMINI.md`)](reference.md#contextfilename)** | A markdown file containing instructions that are loaded into the model's context at the start of every session. | Use this to define the "personality" of your extension, set coding standards, or provide essential knowledge that the model should always have. | CLI provides to model |
|
||||
| **[Agent skills](../cli/skills.md)** | A specialized set of instructions and workflows that the model activates only when needed. | Use this for complex, occasional tasks (like "create a PR" or "audit security") to avoid cluttering the main context window when the skill isn't being used. | Model |
|
||||
| **[Hooks](../hooks/index.md)** | A way to intercept and customize the CLI's behavior at specific lifecycle events (for example, before/after a tool call). | Use this when you want to automate actions based on what the model is doing, like validating tool arguments, logging activity, or modifying the model's input/output. | CLI |
|
||||
| **[Custom themes](reference.md#themes)** | A set of color definitions to personalize the CLI UI. | Use this to provide a unique visual identity for your extension or to offer specialized high-contrast or thematic color schemes. | User (via /theme) |
|
||||
|
||||
## Step 1: Create a new extension
|
||||
|
||||
@@ -172,7 +172,7 @@ Link your extension to your Gemini CLI installation for local development.
|
||||
|
||||
2. **Link the extension:**
|
||||
|
||||
The `link` command creates a symbolic link from the Gemini CLI extensions
|
||||
The `link` command creates a symbolic link from Gemini CLI extensions
|
||||
directory to your development directory. Changes you make are reflected
|
||||
immediately.
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ or fallback to Gemini 2.5 Pro.
|
||||
> [!NOTE]
|
||||
> The **Keep trying** option uses exponential backoff, in which Gemini
|
||||
> CLI waits longer between each retry, when the system is busy. If the retry
|
||||
> doesn't happen immediately, please wait a few minutes for the request to
|
||||
> doesn't happen immediately, wait a few minutes for the request to
|
||||
> process.
|
||||
|
||||
### Model selection and routing types
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Get started with Gemini CLI
|
||||
|
||||
Welcome to Gemini CLI! This guide will help you install, configure, and start
|
||||
using the Gemini CLI to enhance your workflow right from your terminal.
|
||||
using Gemini CLI to enhance your workflow right from your terminal.
|
||||
|
||||
## Quickstart: Install, authenticate, configure, and use Gemini CLI
|
||||
|
||||
@@ -132,7 +132,7 @@ colors. After analyzing the source code, here's how it works:
|
||||
getters. The `red` getter adds the red color code, and the `bold` getter adds
|
||||
the bold code.
|
||||
|
||||
- **Output generation:** When the chain is treated as a string (e.g., in
|
||||
- **Output generation:** When the chain is treated as a string (for example, in
|
||||
`console.log`), a final `toString()` method is called. This method joins all
|
||||
the stored ANSI codes, wraps them around the input string ('Hello'), and adds
|
||||
a reset code at the end. This produces the final, styled string that the
|
||||
|
||||
@@ -367,7 +367,7 @@ chmod +x .gemini/hooks/*.js
|
||||
```
|
||||
|
||||
**Windows Note**: On Windows, PowerShell scripts (`.ps1`) don't use `chmod`, but
|
||||
you may need to ensure your execution policy allows them to run (e.g.,
|
||||
you may need to ensure your execution policy allows them to run (for example,
|
||||
`Set-ExecutionPolicy RemoteSigned -Scope CurrentUser`).
|
||||
|
||||
### Version control
|
||||
@@ -401,12 +401,12 @@ git add .gemini/settings.json
|
||||
Understanding where hooks come from and what they can do is critical for secure
|
||||
usage.
|
||||
|
||||
| Hook Source | Description |
|
||||
| :---------------------------- | :------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **System** | Configured by system administrators (e.g., `/etc/gemini-cli/settings.json`, `/Library/...`). Assumed to be the **safest**. |
|
||||
| **User** (`~/.gemini/...`) | Configured by you. You are responsible for ensuring they are safe. |
|
||||
| **Extensions** | You explicitly approve and install these. Security depends on the extension source (integrity). |
|
||||
| **Project** (`./.gemini/...`) | **Untrusted by default.** Safest in trusted internal repos; higher risk in third-party/public repos. |
|
||||
| Hook Source | Description |
|
||||
| :---------------------------- | :-------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **System** | Configured by system administrators (for example, `/etc/gemini-cli/settings.json`, `/Library/...`). Assumed to be the **safest**. |
|
||||
| **User** (`~/.gemini/...`) | Configured by you. You are responsible for ensuring they are safe. |
|
||||
| **Extensions** | You explicitly approve and install these. Security depends on the extension source (integrity). |
|
||||
| **Project** (`./.gemini/...`) | **Untrusted by default.** Safest in trusted internal repos; higher risk in third-party/public repos. |
|
||||
|
||||
#### Project Hook Security
|
||||
|
||||
@@ -422,9 +422,10 @@ When you open a project with hooks defined in `.gemini/settings.json`:
|
||||
5. **Trust**: The hook is marked as "trusted" for this project.
|
||||
|
||||
> **Modification detection**: If the `command` string of a project hook is
|
||||
> changed (e.g., by a `git pull`), its identity changes. Gemini CLI will treat
|
||||
> it as a **new, untrusted hook** and warn you again. This prevents malicious
|
||||
> actors from silently swapping a verified command for a malicious one.
|
||||
> changed (for example, by a `git pull`), its identity changes. Gemini CLI will
|
||||
> treat it as a **new, untrusted hook** and warn you again. This prevents
|
||||
> malicious actors from silently swapping a verified command for a malicious
|
||||
> one.
|
||||
|
||||
### Risks
|
||||
|
||||
@@ -441,17 +442,17 @@ When you open a project with hooks defined in `.gemini/settings.json`:
|
||||
**Verify the source** of any project hooks or extensions before enabling them.
|
||||
|
||||
- For open-source projects, a quick review of the hook scripts is recommended.
|
||||
- For extensions, ensure you trust the author or publisher (e.g., verified
|
||||
publishers, well-known community members).
|
||||
- For extensions, ensure you trust the author or publisher (for example,
|
||||
verified publishers, well-known community members).
|
||||
- Be cautious with obfuscated scripts or compiled binaries from unknown sources.
|
||||
|
||||
#### Sanitize environment
|
||||
|
||||
Hooks inherit the environment of the Gemini CLI process, which may include
|
||||
sensitive API keys. Gemini CLI provides a
|
||||
Hooks inherit the environment of Gemini CLI process, which may include sensitive
|
||||
API keys. Gemini CLI provides a
|
||||
[redaction system](../reference/configuration.md#environment-variable-redaction)
|
||||
that automatically filters variables matching sensitive patterns (e.g., `KEY`,
|
||||
`TOKEN`).
|
||||
that automatically filters variables matching sensitive patterns (for example,
|
||||
`KEY`, `TOKEN`).
|
||||
|
||||
> **Disabled by Default**: Environment redaction is currently **OFF by
|
||||
> default**. We strongly recommend enabling it if you are running third-party
|
||||
@@ -511,7 +512,7 @@ chmod +x .gemini/hooks/my-hook.sh
|
||||
```
|
||||
|
||||
**Windows Note**: On Windows, ensure your execution policy allows running
|
||||
scripts (e.g., `Get-ExecutionPolicy`).
|
||||
scripts (for example, `Get-ExecutionPolicy`).
|
||||
|
||||
**Verify script path:** Ensure the path in `settings.json` resolves correctly.
|
||||
|
||||
|
||||
+9
-8
@@ -63,9 +63,9 @@ Hooks communicate via `stdin` (Input) and `stdout` (Output).
|
||||
2. **Pollution = Failure**: If `stdout` contains non-JSON text, parsing will
|
||||
fail. The CLI will default to "Allow" and treat the entire output as a
|
||||
`systemMessage`.
|
||||
3. **Debug via Stderr**: Use `stderr` for **all** logging and debugging (e.g.,
|
||||
`echo "debug" >&2`). Gemini CLI captures `stderr` but never attempts to parse
|
||||
it as JSON.
|
||||
3. **Debug via Stderr**: Use `stderr` for **all** logging and debugging (for
|
||||
example, `echo "debug" >&2`). Gemini CLI captures `stderr` but never attempts
|
||||
to parse it as JSON.
|
||||
|
||||
#### Exit codes
|
||||
|
||||
@@ -74,7 +74,7 @@ execution:
|
||||
|
||||
| Exit Code | Label | Behavioral Impact |
|
||||
| --------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **0** | **Success** | The `stdout` is parsed as JSON. **Preferred code** for all logic, including intentional blocks (e.g., `{"decision": "deny"}`). |
|
||||
| **0** | **Success** | The `stdout` is parsed as JSON. **Preferred code** for all logic, including intentional blocks (for example, `{"decision": "deny"}`). |
|
||||
| **2** | **System Block** | **Critical Block**. The target action (tool, turn, or stop) is aborted. `stderr` is used as the rejection reason. High severity; used for security stops or script failures. |
|
||||
| **Other** | **Warning** | Non-fatal failure. A warning is shown, but the interaction proceeds using original parameters. |
|
||||
|
||||
@@ -84,8 +84,9 @@ You can filter which specific tools or triggers fire your hook using the
|
||||
`matcher` field.
|
||||
|
||||
- **Tool events** (`BeforeTool`, `AfterTool`): Matchers are **Regular
|
||||
Expressions**. (e.g., `"write_.*"`).
|
||||
- **Lifecycle events**: Matchers are **Exact Strings**. (e.g., `"startup"`).
|
||||
Expressions**. (for example, `"write_.*"`).
|
||||
- **Lifecycle events**: Matchers are **Exact Strings**. (for example,
|
||||
`"startup"`).
|
||||
- **Wildcards**: `"*"` or `""` (empty string) matches all occurrences.
|
||||
|
||||
## Configuration
|
||||
@@ -151,8 +152,8 @@ Hooks are executed with a sanitized environment.
|
||||
|
||||
**Project-level hooks** are particularly risky when opening untrusted projects.
|
||||
Gemini CLI **fingerprints** project hooks. If a hook's name or command changes
|
||||
(e.g., via `git pull`), it is treated as a **new, untrusted hook** and you will
|
||||
be warned before it executes.
|
||||
(for example, via `git pull`), it is treated as a **new, untrusted hook** and
|
||||
you will be warned before it executes.
|
||||
|
||||
See [Security Considerations](../hooks/best-practices.md#using-hooks-securely)
|
||||
for a detailed threat model.
|
||||
|
||||
+10
-10
@@ -20,8 +20,8 @@ including JSON schemas and API details.
|
||||
|
||||
## Configuration schema
|
||||
|
||||
Hooks are defined in `settings.json` within the `hooks` object. Each event
|
||||
(e.g., `BeforeTool`) contains an array of **hook definitions**.
|
||||
Hooks are defined in `settings.json` within the `hooks` object. Each event (for
|
||||
example, `BeforeTool`) contains an array of **hook definitions**.
|
||||
|
||||
### Hook definition
|
||||
|
||||
@@ -52,7 +52,7 @@ All hooks receive these common fields via `stdin`:
|
||||
"session_id": string, // Unique ID for the current session
|
||||
"transcript_path": string, // Absolute path to session transcript JSON
|
||||
"cwd": string, // Current working directory
|
||||
"hook_event_name": string, // The firing event (e.g. "BeforeTool")
|
||||
"hook_event_name": string, // The firing event (for example "BeforeTool")
|
||||
"timestamp": string // ISO 8601 execution time
|
||||
}
|
||||
```
|
||||
@@ -81,12 +81,12 @@ Most hooks support these fields in their `stdout` JSON:
|
||||
For `BeforeTool` and `AfterTool` events, the `matcher` field in your settings is
|
||||
compared against the name of the tool being executed.
|
||||
|
||||
- **Built-in Tools**: You can match any built-in tool (e.g., `read_file`,
|
||||
- **Built-in Tools**: You can match any built-in tool (for example, `read_file`,
|
||||
`run_shell_command`). See the [Tools Reference](../reference/tools) for a full
|
||||
list of available tool names.
|
||||
- **MCP Tools**: Tools from MCP servers follow the naming pattern
|
||||
`mcp_<server_name>_<tool_name>`.
|
||||
- **Regex Support**: Matchers support regular expressions (e.g.,
|
||||
- **Regex Support**: Matchers support regular expressions (for example,
|
||||
`matcher: "read_.*"` matches all file reading tools).
|
||||
|
||||
### `BeforeTool`
|
||||
@@ -194,7 +194,7 @@ request format.
|
||||
(generation params).
|
||||
- **Relevant Output Fields**:
|
||||
- `hookSpecificOutput.llm_request`: An object that **overrides** parts of the
|
||||
outgoing request (e.g., changing models or temperature).
|
||||
outgoing request (for example, changing models or temperature).
|
||||
- `hookSpecificOutput.llm_response`: A **Synthetic Response** object. If
|
||||
provided, the CLI skips the LLM call entirely and uses this as the response.
|
||||
- `decision`: Set to `"deny"` to block the request and abort the turn.
|
||||
@@ -271,14 +271,14 @@ telemetry.
|
||||
|
||||
### `Notification`
|
||||
|
||||
Fires when the CLI emits a system alert (e.g., Tool Permissions). Used for
|
||||
external logging or cross-platform alerts.
|
||||
Fires when the CLI emits a system alert (for example, Tool Permissions). Used
|
||||
for external logging or cross-platform alerts.
|
||||
|
||||
- **Input Fields**:
|
||||
- `notification_type`: (`"ToolPermission"`)
|
||||
- `message`: Summary of the alert.
|
||||
- `details`: JSON object with alert-specific metadata (e.g., tool name, file
|
||||
path).
|
||||
- `details`: JSON object with alert-specific metadata (for example, tool name,
|
||||
file path).
|
||||
- **Relevant Output Fields**:
|
||||
- `systemMessage`: Displayed alongside the system alert.
|
||||
- **Observability Only**: This hook **cannot** block alerts or grant permissions
|
||||
|
||||
@@ -20,9 +20,9 @@ Protocol (MCP)**.
|
||||
|
||||
- **Protocol:** The server must be a valid MCP server. We recommend using an
|
||||
existing MCP SDK for your language of choice if available.
|
||||
- **Endpoint:** The server should expose a single endpoint (e.g., `/mcp`) for
|
||||
all MCP communication.
|
||||
- **Port:** The server **MUST** listen on a dynamically assigned port (i.e.,
|
||||
- **Endpoint:** The server should expose a single endpoint (for example, `/mcp`)
|
||||
for all MCP communication.
|
||||
- **Port:** The server **MUST** listen on a dynamically assigned port (that is,
|
||||
listen on port `0`).
|
||||
|
||||
### 2. Discovery mechanism: The port file
|
||||
@@ -68,15 +68,15 @@ creating a "discovery file."
|
||||
The CLI will include this token in an `Authorization: Bearer <token>` header
|
||||
on all requests.
|
||||
- `ideInfo` (object, required): Information about the IDE.
|
||||
- `name` (string, required): A short, lowercase identifier for the IDE
|
||||
(e.g., `vscode`, `jetbrains`).
|
||||
- `displayName` (string, required): A user-friendly name for the IDE (e.g.,
|
||||
`VS Code`, `JetBrains IDE`).
|
||||
- `name` (string, required): A short, lowercase identifier for the IDE (for
|
||||
example, `vscode`, `jetbrains`).
|
||||
- `displayName` (string, required): A user-friendly name for the IDE (for
|
||||
example, `VS Code`, `JetBrains IDE`).
|
||||
|
||||
- **Authentication:** To secure the connection, the plugin **MUST** generate a
|
||||
unique, secret token and include it in the discovery file. The CLI will then
|
||||
include this token in the `Authorization` header for all requests to the MCP
|
||||
server (e.g., `Authorization: Bearer a-very-secret-token`). Your server
|
||||
server (for example, `Authorization: Bearer a-very-secret-token`). Your server
|
||||
**MUST** validate this token on every request and reject any that are
|
||||
unauthorized.
|
||||
- **Tie-breaking with environment variables (recommended):** For the most
|
||||
@@ -135,7 +135,7 @@ to the CLI whenever the user's context changes.
|
||||
<!-- prettier-ignore -->
|
||||
> [!NOTE]
|
||||
> The `openFiles` list should only include files that exist on disk.
|
||||
> Virtual files (e.g., unsaved files without a path, editor settings pages)
|
||||
> Virtual files (for example, unsaved files without a path, editor settings pages)
|
||||
> **MUST** be excluded.
|
||||
|
||||
### How the CLI uses this context
|
||||
@@ -188,7 +188,7 @@ The plugin **MUST** register an `openDiff` tool on its MCP server.
|
||||
`CallToolResult` to acknowledge the request and report whether the diff view
|
||||
was successfully opened.
|
||||
- On Success: If the diff view was opened successfully, the response **MUST**
|
||||
contain empty content (i.e., `content: []`).
|
||||
contain empty content (that is, `content: []`).
|
||||
- On Failure: If an error prevented the diff view from opening, the response
|
||||
**MUST** have `isError: true` and include a `TextContent` block in the
|
||||
`content` array describing the error.
|
||||
@@ -223,9 +223,9 @@ The plugin **MUST** register a `closeDiff` tool on its MCP server.
|
||||
|
||||
### `ide/diffAccepted` notification
|
||||
|
||||
When the user accepts the changes in a diff view (e.g., by clicking an "Apply"
|
||||
or "Save" button), the plugin **MUST** send an `ide/diffAccepted` notification
|
||||
to the CLI.
|
||||
When the user accepts the changes in a diff view (for example, by clicking an
|
||||
"Apply" or "Save" button), the plugin **MUST** send an `ide/diffAccepted`
|
||||
notification to the CLI.
|
||||
|
||||
- **Payload:** The notification parameters **MUST** include the file path and
|
||||
the final content of the file. The content may differ from the original
|
||||
@@ -242,7 +242,7 @@ to the CLI.
|
||||
|
||||
### `ide/diffRejected` notification
|
||||
|
||||
When the user rejects the changes (e.g., by closing the diff view without
|
||||
When the user rejects the changes (for example, by closing the diff view without
|
||||
accepting), the plugin **MUST** send an `ide/diffRejected` notification to the
|
||||
CLI.
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ editor.
|
||||
**To accept a diff**, you can perform any of the following actions:
|
||||
|
||||
- Click the **checkmark icon** in the diff editor's title bar.
|
||||
- Save the file (e.g., with `Cmd+S` or `Ctrl+S`).
|
||||
- Save the file (for example, with `Cmd+S` or `Ctrl+S`).
|
||||
- Open the Command Palette and run **Gemini CLI: Accept Diff**.
|
||||
- Respond with `yes` in the CLI when prompted.
|
||||
|
||||
@@ -208,7 +208,7 @@ directly through their in-built registry features.
|
||||
|
||||
## Using with sandboxing
|
||||
|
||||
If you are using Gemini CLI within a sandbox, please be aware of the following:
|
||||
If you are using Gemini CLI within a sandbox, be aware of the following:
|
||||
|
||||
- **On macOS:** The IDE integration requires network access to communicate with
|
||||
the IDE companion extension. You must use a Seatbelt profile that allows
|
||||
@@ -299,5 +299,5 @@ to connect using the provided PID.
|
||||
|
||||
### ACP integration errors
|
||||
|
||||
For issues related to ACP integration, please refer to the debugging and
|
||||
telemetry section in the [ACP Mode](../cli/acp-mode.md) documentation.
|
||||
For issues related to ACP integration, refer to the debugging and telemetry
|
||||
section in the [ACP Mode](../cli/acp-mode.md) documentation.
|
||||
|
||||
@@ -6,8 +6,8 @@ in this project.
|
||||
## Overview
|
||||
|
||||
The integration tests are designed to validate the end-to-end functionality of
|
||||
the Gemini CLI. They execute the built binary in a controlled environment and
|
||||
verify that it behaves as expected when interacting with the file system.
|
||||
Gemini CLI. They execute the built binary in a controlled environment and verify
|
||||
that it behaves as expected when interacting with the file system.
|
||||
|
||||
These tests are located in the `integration-tests` directory and are run using a
|
||||
custom test runner.
|
||||
|
||||
@@ -37,8 +37,8 @@ is to perform an initial analysis and apply the correct labels.
|
||||
- It uses a Gemini model to analyze the issue's title and body against a
|
||||
detailed set of guidelines.
|
||||
- **Applies one `area/*` label**: Categorizes the issue into a functional area
|
||||
of the project (e.g., `area/ux`, `area/models`, `area/platform`).
|
||||
- **Applies one `kind/*` label**: Identifies the type of issue (e.g.,
|
||||
of the project (for example, `area/ux`, `area/models`, `area/platform`).
|
||||
- **Applies one `kind/*` label**: Identifies the type of issue (for example,
|
||||
`kind/bug`, `kind/enhancement`, `kind/question`).
|
||||
- **Applies one `priority/*` label**: Assigns a priority from P0 (critical) to
|
||||
P3 (low) based on the described impact.
|
||||
@@ -50,8 +50,8 @@ is to perform an initial analysis and apply the correct labels.
|
||||
- **What you should do**:
|
||||
- Fill out the issue template as completely as possible. The more detail you
|
||||
provide, the more accurate the triage will be.
|
||||
- If the `status/need-information` label is added, please provide the
|
||||
requested details in a comment.
|
||||
- If the `status/need-information` label is added, provide the requested
|
||||
details in a comment.
|
||||
|
||||
### 2. When you open a pull request: `Continuous Integration (CI)`
|
||||
|
||||
@@ -84,7 +84,8 @@ issues and have consistent labels.
|
||||
- **When it runs**: Every 15 minutes on all open pull requests.
|
||||
- **What it does**:
|
||||
- **Checks for a linked issue**: The bot scans your PR description for a
|
||||
keyword that links it to an issue (e.g., `Fixes #123`, `Closes #456`).
|
||||
keyword that links it to an issue (for example, `Fixes #123`,
|
||||
`Closes #456`).
|
||||
- **Adds `status/need-issue`**: If no linked issue is found, the bot will add
|
||||
the `status/need-issue` label to your PR. This is a clear signal that an
|
||||
issue needs to be created and linked.
|
||||
@@ -156,7 +157,7 @@ and will never be auto-unassigned.
|
||||
### 6. Release automation
|
||||
|
||||
This workflow handles the process of packaging and publishing new versions of
|
||||
the Gemini CLI.
|
||||
Gemini CLI.
|
||||
|
||||
- **Workflow File**: `.github/workflows/release-manual.yml`
|
||||
- **When it runs**: On a daily schedule for "nightly" releases, and manually for
|
||||
@@ -171,4 +172,4 @@ the Gemini CLI.
|
||||
will be included in the very next nightly release.
|
||||
|
||||
We hope this detailed overview is helpful. If you have any questions about our
|
||||
automation or processes, please don't hesitate to ask!
|
||||
automation or processes, don't hesitate to ask!
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ This monorepo contains two main packages: `@google/gemini-cli` and
|
||||
|
||||
## `@google/gemini-cli`
|
||||
|
||||
This is the main package for the Gemini CLI. It is responsible for the user
|
||||
This is the main package for Gemini CLI. It is responsible for the user
|
||||
interface, command parsing, and all other user-facing functionality.
|
||||
|
||||
When this package is published, it is bundled into a single executable file.
|
||||
|
||||
+11
-11
@@ -156,7 +156,7 @@ Slash commands provide meta-level control over the CLI itself.
|
||||
|
||||
### `/docs`
|
||||
|
||||
- **Description:** Open the Gemini CLI documentation in your browser.
|
||||
- **Description:** Open Gemini CLI documentation in your browser.
|
||||
|
||||
### `/editor`
|
||||
|
||||
@@ -400,8 +400,8 @@ Slash commands provide meta-level control over the CLI itself.
|
||||
|
||||
### `/shells` (or `/bashes`)
|
||||
|
||||
- **Description:** Toggle the background shells view. This allows you to view
|
||||
and manage long-running processes that you've sent to the background.
|
||||
- **Description:** Toggle the background shells view. This lets you view and
|
||||
manage long-running processes that you've sent to the background.
|
||||
|
||||
### `/setup-github`
|
||||
|
||||
@@ -474,7 +474,8 @@ Slash commands provide meta-level control over the CLI itself.
|
||||
input area supports vim-style navigation and editing commands in both NORMAL
|
||||
and INSERT modes.
|
||||
- **Features:**
|
||||
- **Count support:** Prefix commands with numbers (e.g., `3h`, `5w`, `10G`)
|
||||
- **Count support:** Prefix commands with numbers (for example, `3h`, `5w`,
|
||||
`10G`)
|
||||
- **Editing commands:** Delete with `x`, change with `c`, insert with `i`,
|
||||
`a`, `o`, `O`; complex operations like `dd`, `cc`, `dw`, `cw`
|
||||
- **INSERT mode:** Standard text input with escape to return to NORMAL mode
|
||||
@@ -490,9 +491,8 @@ Slash commands provide meta-level control over the CLI itself.
|
||||
### Custom commands
|
||||
|
||||
Custom commands allow you to create personalized shortcuts for your most-used
|
||||
prompts. For detailed instructions on how to create, manage, and use them,
|
||||
please see the dedicated
|
||||
[Custom Commands documentation](../cli/custom-commands.md).
|
||||
prompts. For detailed instructions on how to create, manage, and use them, see
|
||||
the dedicated [Custom Commands documentation](../cli/custom-commands.md).
|
||||
|
||||
## Input prompt shortcuts
|
||||
|
||||
@@ -523,7 +523,7 @@ your prompt to Gemini. These commands include git-aware filtering.
|
||||
- If a path to a single file is provided, the content of that file is read.
|
||||
- If a path to a directory is provided, the command attempts to read the
|
||||
content of files within that directory and any subdirectories.
|
||||
- Spaces in paths should be escaped with a backslash (e.g.,
|
||||
- Spaces in paths should be escaped with a backslash (for example,
|
||||
`@My\ Documents/file.txt`).
|
||||
- The command uses the `read_many_files` tool internally. The content is
|
||||
fetched and then inserted into your query before being sent to the Gemini
|
||||
@@ -549,8 +549,8 @@ your prompt to Gemini. These commands include git-aware filtering.
|
||||
- If the path specified after `@` is not found or is invalid, an error message
|
||||
will be displayed, and the query might not be sent to the Gemini model, or it
|
||||
will be sent without the file content.
|
||||
- If the `read_many_files` tool encounters an error (e.g., permission issues),
|
||||
this will also be reported.
|
||||
- If the `read_many_files` tool encounters an error (for example, permission
|
||||
issues), this will also be reported.
|
||||
|
||||
## Shell mode and passthrough commands (`!`)
|
||||
|
||||
@@ -583,4 +583,4 @@ Gemini CLI.
|
||||
- **Environment variable:** When a command is executed via `!` or in shell mode,
|
||||
the `GEMINI_CLI=1` environment variable is set in the subprocess's
|
||||
environment. This allows scripts or tools to detect if they are being run from
|
||||
within the Gemini CLI.
|
||||
within Gemini CLI.
|
||||
|
||||
@@ -71,7 +71,7 @@ Additionally, each extension can have its own `.env` file in its directory,
|
||||
which will be loaded automatically.
|
||||
|
||||
**Note for Enterprise Users:** For guidance on deploying and managing Gemini CLI
|
||||
in a corporate environment, please see the
|
||||
in a corporate environment, see the
|
||||
[Enterprise Configuration](../cli/enterprise.md) documentation.
|
||||
|
||||
### The `.gemini` directory in your project
|
||||
@@ -79,7 +79,7 @@ in a corporate environment, please see the
|
||||
In addition to a project settings file, a project's `.gemini` directory can
|
||||
contain other project-specific files related to Gemini CLI's operation, such as:
|
||||
|
||||
- [Custom sandbox profiles](#sandboxing) (e.g.,
|
||||
- [Custom sandbox profiles](#sandboxing) (for example,
|
||||
`.gemini/sandbox-macos-custom.sb`, `.gemini/sandbox.Dockerfile`).
|
||||
|
||||
### Available settings in `settings.json`
|
||||
@@ -202,6 +202,12 @@ their corresponding top-level category object in your `settings.json` file.
|
||||
|
||||
#### `ui`
|
||||
|
||||
- **`ui.debugRainbow`** (boolean):
|
||||
- **Description:** Enable debug rainbow rendering. Only useful for debugging
|
||||
rendering bugs and performance issues.
|
||||
- **Default:** `false`
|
||||
- **Requires restart:** Yes
|
||||
|
||||
- **`ui.theme`** (string):
|
||||
- **Description:** The color theme for the UI. See the CLI themes guide for
|
||||
available options.
|
||||
@@ -1912,15 +1918,15 @@ Configures connections to one or more Model-Context Protocol (MCP) servers for
|
||||
discovering and using custom tools. Gemini CLI attempts to connect to each
|
||||
configured MCP server to discover available tools. Every discovered tool is
|
||||
prepended with the `mcp_` prefix and its server alias to form a fully qualified
|
||||
name (FQN) (e.g., `mcp_serverAlias_actualToolName`) to avoid conflicts. Note
|
||||
that the system might strip certain schema properties from MCP tool definitions
|
||||
for compatibility. At least one of `command`, `url`, or `httpUrl` must be
|
||||
provided. If multiple are specified, the order of precedence is `httpUrl`, then
|
||||
`url`, then `command`.
|
||||
name (FQN) (for example, `mcp_serverAlias_actualToolName`) to avoid conflicts.
|
||||
Note that the system might strip certain schema properties from MCP tool
|
||||
definitions for compatibility. At least one of `command`, `url`, or `httpUrl`
|
||||
must be provided. If multiple are specified, the order of precedence is
|
||||
`httpUrl`, then `url`, then `command`.
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
> [!WARNING]
|
||||
> Avoid using underscores (`_`) in your server aliases (e.g., use
|
||||
> Avoid using underscores (`_`) in your server aliases (for example, use
|
||||
> `my-server` instead of `my_server`). The underlying policy engine parses Fully
|
||||
> Qualified Names (`mcp_server_tool`) using the first underscore after the
|
||||
> `mcp_` prefix. An underscore in your server alias will cause the parser to
|
||||
@@ -2086,8 +2092,8 @@ the `advanced.excludedEnvVars` setting in your `settings.json` file.
|
||||
- Your API key for the Gemini API.
|
||||
- One of several available
|
||||
[authentication methods](../get-started/authentication.md).
|
||||
- Set this in your shell profile (e.g., `~/.bashrc`, `~/.zshrc`) or an `.env`
|
||||
file.
|
||||
- Set this in your shell profile (for example, `~/.bashrc`, `~/.zshrc`) or an
|
||||
`.env` file.
|
||||
- **`GEMINI_MODEL`**:
|
||||
- Specifies the default Gemini model to use.
|
||||
- Overrides the hardcoded default
|
||||
@@ -2171,7 +2177,7 @@ the `advanced.excludedEnvVars` setting in your `settings.json` file.
|
||||
Any other value is treated as disabling it.
|
||||
- Overrides the `telemetry.useCollector` setting.
|
||||
- **`GOOGLE_CLOUD_LOCATION`**:
|
||||
- Your Google Cloud Project Location (e.g., us-central1).
|
||||
- Your Google Cloud Project Location (for example, us-central1).
|
||||
- Required for using Vertex AI in non-express mode.
|
||||
- Example: `export GOOGLE_CLOUD_LOCATION="YOUR_PROJECT_LOCATION"` (Windows
|
||||
PowerShell: `$env:GOOGLE_CLOUD_LOCATION="YOUR_PROJECT_LOCATION"`).
|
||||
@@ -2202,7 +2208,7 @@ the `advanced.excludedEnvVars` setting in your `settings.json` file.
|
||||
- `strict-proxied`: Same as `strict-open` but routes network through proxy.
|
||||
- `<profile_name>`: Uses a custom profile. To define a custom profile, create
|
||||
a file named `sandbox-macos-<profile_name>.sb` in your project's `.gemini/`
|
||||
directory (e.g., `my-project/.gemini/sandbox-macos-custom.sb`).
|
||||
directory (for example, `my-project/.gemini/sandbox-macos-custom.sb`).
|
||||
- **`DEBUG` or `DEBUG_MODE`** (often used by underlying libraries or the CLI
|
||||
itself):
|
||||
- Set to `true` or `1` to enable verbose debug logging, which can be helpful
|
||||
@@ -2241,7 +2247,7 @@ from the system or loaded from `.env` files.
|
||||
|
||||
**Allowlist (Never Redacted):**
|
||||
|
||||
- Common system variables (e.g., `PATH`, `HOME`, `USER`, `SHELL`, `TERM`,
|
||||
- Common system variables (for example, `PATH`, `HOME`, `USER`, `SHELL`, `TERM`,
|
||||
`LANG`).
|
||||
- Variables starting with `GEMINI_CLI_`.
|
||||
- GitHub Action specific variables.
|
||||
@@ -2367,7 +2373,7 @@ for that specific session.
|
||||
While not strictly configuration for the CLI's _behavior_, context files
|
||||
(defaulting to `GEMINI.md` but configurable via the `context.fileName` setting)
|
||||
are crucial for configuring the _instructional context_ (also referred to as
|
||||
"memory") provided to the Gemini model. This powerful feature allows you to give
|
||||
"memory") provided to the Gemini model. This powerful feature lets you give
|
||||
project-specific instructions, coding style guides, or any relevant background
|
||||
information to the AI, making its responses more tailored and accurate to your
|
||||
needs. The CLI includes UI elements, such as an indicator in the footer showing
|
||||
@@ -2378,7 +2384,7 @@ context.
|
||||
that you want the Gemini model to be aware of during your interactions. The
|
||||
system is designed to manage this instructional context hierarchically.
|
||||
|
||||
### Example context file content (e.g., `GEMINI.md`)
|
||||
### Example context file content (for example, `GEMINI.md`)
|
||||
|
||||
Here's a conceptual example of what a context file at the root of a TypeScript
|
||||
project might contain:
|
||||
@@ -2388,7 +2394,7 @@ project might contain:
|
||||
|
||||
## General Instructions:
|
||||
|
||||
- When generating new TypeScript code, please follow the existing coding style.
|
||||
- When generating new TypeScript code, follow the existing coding style.
|
||||
- Ensure all new functions and classes have JSDoc comments.
|
||||
- Prefer functional programming paradigms where appropriate.
|
||||
- All code should be compatible with TypeScript 5.0 and Node.js 20+.
|
||||
@@ -2396,7 +2402,7 @@ project might contain:
|
||||
## Coding Style:
|
||||
|
||||
- Use 2 spaces for indentation.
|
||||
- Interface names should be prefixed with `I` (e.g., `IUserService`).
|
||||
- Interface names should be prefixed with `I` (for example, `IUserService`).
|
||||
- Private class members should be prefixed with an underscore (`_`).
|
||||
- Always use strict equality (`===` and `!==`).
|
||||
|
||||
@@ -2410,7 +2416,7 @@ project might contain:
|
||||
## Regarding Dependencies:
|
||||
|
||||
- Avoid introducing new external dependencies unless absolutely necessary.
|
||||
- If a new dependency is required, please state the reason.
|
||||
- If a new dependency is required, state the reason.
|
||||
```
|
||||
|
||||
This example demonstrates how you can provide general project context, specific
|
||||
@@ -2420,13 +2426,13 @@ you. Project-specific context files are highly encouraged to establish
|
||||
conventions and context.
|
||||
|
||||
- **Hierarchical loading and precedence:** The CLI implements a sophisticated
|
||||
hierarchical memory system by loading context files (e.g., `GEMINI.md`) from
|
||||
several locations. Content from files lower in this list (more specific)
|
||||
hierarchical memory system by loading context files (for example, `GEMINI.md`)
|
||||
from several locations. Content from files lower in this list (more specific)
|
||||
typically overrides or supplements content from files higher up (more
|
||||
general). The exact concatenation order and final context can be inspected
|
||||
using the `/memory show` command. The typical loading order is:
|
||||
1. **Global context file:**
|
||||
- Location: `~/.gemini/<configured-context-filename>` (e.g.,
|
||||
- Location: `~/.gemini/<configured-context-filename>` (for example,
|
||||
`~/.gemini/GEMINI.md` in your user home directory).
|
||||
- Scope: Provides default instructions for all your projects.
|
||||
2. **Project root and ancestors context files:**
|
||||
@@ -2463,12 +2469,12 @@ conventions and context.
|
||||
|
||||
By understanding and utilizing these configuration layers and the hierarchical
|
||||
nature of context files, you can effectively manage the AI's memory and tailor
|
||||
the Gemini CLI's responses to your specific needs and projects.
|
||||
Gemini CLI's responses to your specific needs and projects.
|
||||
|
||||
## Sandboxing
|
||||
|
||||
The Gemini CLI can execute potentially unsafe operations (like shell commands
|
||||
and file modifications) within a sandboxed environment to protect your system.
|
||||
Gemini CLI can execute potentially unsafe operations (like shell commands and
|
||||
file modifications) within a sandboxed environment to protect your system.
|
||||
|
||||
Sandboxing is disabled by default, but you can enable it in a few ways:
|
||||
|
||||
@@ -2503,11 +2509,15 @@ sandbox image:
|
||||
BUILD_SANDBOX=1 gemini -s
|
||||
```
|
||||
|
||||
Building a custom sandbox with `BUILD_SANDBOX` is only supported when running
|
||||
Gemini CLI from source. If you installed the CLI with npm, build the Docker
|
||||
image separately and reference that image in your sandbox configuration.
|
||||
|
||||
## Usage statistics
|
||||
|
||||
To help us improve the Gemini CLI, we collect anonymized usage statistics. This
|
||||
data helps us understand how the CLI is used, identify common issues, and
|
||||
prioritize new features.
|
||||
To help us improve Gemini CLI, we collect anonymized usage statistics. This data
|
||||
helps us understand how the CLI is used, identify common issues, and prioritize
|
||||
new features.
|
||||
|
||||
**What we collect:**
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ available combinations.
|
||||
|
||||
| Command | Action | Keys |
|
||||
| ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ |
|
||||
| `app.showErrorDetails` | Toggle detailed error information. | `F12` |
|
||||
| `app.showErrorDetails` | Toggle the debug console for detailed error information. | `F12` |
|
||||
| `app.showFullTodos` | Toggle the full TODO list. | `Ctrl+T` |
|
||||
| `app.showIdeContextDetail` | Show IDE context details. | `F4` |
|
||||
| `app.toggleMarkdown` | Toggle Markdown rendering. | `Alt+M` |
|
||||
@@ -248,6 +248,83 @@ a `key` combination.
|
||||
- `Double-click` on a paste placeholder (alternate buffer mode only): Expand to
|
||||
view full content inline. Double-click again to collapse.
|
||||
|
||||
## Vi mode shortcuts
|
||||
|
||||
When vim mode is enabled with `/vim` or `general.vimMode: true`, Gemini CLI
|
||||
supports NORMAL and INSERT modes.
|
||||
|
||||
### Mode switching
|
||||
|
||||
| Action | Keys |
|
||||
| -------------------------------------------- | --------- |
|
||||
| Enter NORMAL mode from INSERT mode | `Esc` |
|
||||
| Enter INSERT mode at the cursor | `i` |
|
||||
| Enter INSERT mode after the cursor | `a` |
|
||||
| Enter INSERT mode at the start of the line | `I` |
|
||||
| Enter INSERT mode at the end of the line | `A` |
|
||||
| Insert a new line below and switch to INSERT | `o` |
|
||||
| Insert a new line above and switch to INSERT | `O` |
|
||||
| Clear input in NORMAL mode | `Esc Esc` |
|
||||
|
||||
### Navigation in NORMAL mode
|
||||
|
||||
| Action | Keys |
|
||||
| --------------------------------- | --------------- |
|
||||
| Move left | `h` |
|
||||
| Move down | `j` |
|
||||
| Move up | `k` |
|
||||
| Move right | `l` |
|
||||
| Move to start of line | `0` |
|
||||
| Move to first non-whitespace char | `^` |
|
||||
| Move to end of line | `$` |
|
||||
| Move forward by word | `w` |
|
||||
| Move backward by word | `b` |
|
||||
| Move to end of word | `e` |
|
||||
| Move forward by WORD | `W` |
|
||||
| Move backward by WORD | `B` |
|
||||
| Move to end of WORD | `E` |
|
||||
| Go to first line | `gg` |
|
||||
| Go to last line | `G` |
|
||||
| Go to line N | `N G` or `N gg` |
|
||||
|
||||
Counts are supported for navigation commands. For example, `5j` moves down five
|
||||
lines and `3w` moves forward three words.
|
||||
|
||||
### Editing in NORMAL mode
|
||||
|
||||
| Action | Keys |
|
||||
| ------------------------------ | ----- |
|
||||
| Delete character under cursor | `x` |
|
||||
| Delete to end of line | `D` |
|
||||
| Delete line | `dd` |
|
||||
| Change to end of line | `C` |
|
||||
| Change line | `cc` |
|
||||
| Delete forward word | `dw` |
|
||||
| Delete backward word | `db` |
|
||||
| Delete to end of word | `de` |
|
||||
| Delete forward WORD | `dW` |
|
||||
| Delete backward WORD | `dB` |
|
||||
| Delete to end of WORD | `dE` |
|
||||
| Change forward word | `cw` |
|
||||
| Change backward word | `cb` |
|
||||
| Change to end of word | `ce` |
|
||||
| Change forward WORD | `cW` |
|
||||
| Change backward WORD | `cB` |
|
||||
| Change to end of WORD | `cE` |
|
||||
| Delete to start of line | `d0` |
|
||||
| Delete to first non-whitespace | `d^` |
|
||||
| Change to start of line | `c0` |
|
||||
| Change to first non-whitespace | `c^` |
|
||||
| Delete from first line to here | `dgg` |
|
||||
| Delete from here to last line | `dG` |
|
||||
| Change from first line to here | `cgg` |
|
||||
| Change from here to last line | `cG` |
|
||||
| Undo last change | `u` |
|
||||
| Repeat last command | `.` |
|
||||
|
||||
Counts are also supported for editing commands. For example, `3dd` deletes three
|
||||
lines and `2cw` changes two words.
|
||||
|
||||
## Limitations
|
||||
|
||||
- On [Windows Terminal](https://en.wikipedia.org/wiki/Windows_Terminal):
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
# Memory Import Processor
|
||||
|
||||
The Memory Import Processor is a feature that allows you to modularize your
|
||||
GEMINI.md files by importing content from other files using the `@file.md`
|
||||
syntax.
|
||||
The Memory Import Processor is a feature that lets you modularize your GEMINI.md
|
||||
files by importing content from other files using the `@file.md` syntax.
|
||||
|
||||
## Overview
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# Policy engine
|
||||
|
||||
The Gemini CLI includes a powerful policy engine that provides fine-grained
|
||||
control over tool execution. It allows users and administrators to define rules
|
||||
that determine whether a tool call should be allowed, denied, or require user
|
||||
Gemini CLI includes a powerful policy engine that provides fine-grained control
|
||||
over tool execution. It allows users and administrators to define rules that
|
||||
determine whether a tool call should be allowed, denied, or require user
|
||||
confirmation.
|
||||
|
||||
## Quick start
|
||||
@@ -23,9 +23,9 @@ To create your first policy:
|
||||
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.gemini\policies"
|
||||
```
|
||||
|
||||
2. **Create a new policy file** (e.g., `~/.gemini/policies/my-rules.toml`). You
|
||||
can use any filename ending in `.toml`; all such files in this directory
|
||||
will be loaded and combined:
|
||||
2. **Create a new policy file** (for example,
|
||||
`~/.gemini/policies/my-rules.toml`). You can use any filename ending in
|
||||
`.toml`; all such files in this directory will be loaded and combined:
|
||||
```toml
|
||||
[[rule]]
|
||||
toolName = "run_shell_command"
|
||||
@@ -33,7 +33,7 @@ To create your first policy:
|
||||
decision = "deny"
|
||||
priority = 100
|
||||
```
|
||||
3. **Run a command** that triggers the policy (e.g., ask Gemini CLI to
|
||||
3. **Run a command** that triggers the policy (for example, ask Gemini CLI to
|
||||
`rm -rf /`). The tool will now be blocked automatically.
|
||||
|
||||
## Core concepts
|
||||
@@ -127,13 +127,13 @@ rule with the highest priority wins**.
|
||||
To provide a clear hierarchy, policies are organized into three tiers. Each tier
|
||||
has a designated number that forms the base of the final priority calculation.
|
||||
|
||||
| Tier | Base | Description |
|
||||
| :-------- | :--- | :------------------------------------------------------------------------- |
|
||||
| Default | 1 | Built-in policies that ship with the Gemini CLI. |
|
||||
| Extension | 2 | Policies defined in extensions. |
|
||||
| Workspace | 3 | Policies defined in the current workspace's configuration directory. |
|
||||
| User | 4 | Custom policies defined by the user. |
|
||||
| Admin | 5 | Policies managed by an administrator (e.g., in an enterprise environment). |
|
||||
| Tier | Base | Description |
|
||||
| :-------- | :--- | :-------------------------------------------------------------------------------- |
|
||||
| Default | 1 | Built-in policies that ship with Gemini CLI. |
|
||||
| Extension | 2 | Policies defined in extensions. |
|
||||
| Workspace | 3 | Policies defined in the current workspace's configuration directory. |
|
||||
| User | 4 | Custom policies defined by the user. |
|
||||
| Admin | 5 | Policies managed by an administrator (for example, in an enterprise environment). |
|
||||
|
||||
Within a TOML policy file, you assign a priority value from **0 to 999**. The
|
||||
engine transforms this into a final priority using the following formula:
|
||||
@@ -159,8 +159,8 @@ For example:
|
||||
|
||||
Approval modes allow the policy engine to apply different sets of rules based on
|
||||
the CLI's operational mode. A rule in a TOML policy file can be associated with
|
||||
one or more modes (e.g., `yolo`, `autoEdit`, `plan`). The rule will only be
|
||||
active if the CLI is running in one of its specified modes. If a rule has no
|
||||
one or more modes (for example, `yolo`, `autoEdit`, `plan`). The rule will only
|
||||
be active if the CLI is running in one of its specified modes. If a rule has no
|
||||
modes specified, it is always active.
|
||||
|
||||
- `default`: The standard interactive mode where most write tools require
|
||||
@@ -257,7 +257,7 @@ To prevent privilege escalation, the CLI enforces strict security checks on the
|
||||
directory are **ignored**.
|
||||
|
||||
- **Linux / macOS:** Must be owned by `root` (UID 0) and NOT writable by group
|
||||
or others (e.g., `chmod 755`).
|
||||
or others (for example, `chmod 755`).
|
||||
- **Windows:** Must be in `C:\ProgramData`. Standard users (`Users`, `Everyone`)
|
||||
must NOT have `Write`, `Modify`, or `Full Control` permissions. If you see a
|
||||
security warning, use the folder properties to remove write permissions for
|
||||
@@ -386,7 +386,7 @@ policies, as it is much more robust than manually writing Fully Qualified Names
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
> [!WARNING]
|
||||
> Do not use underscores (`_`) in your MCP server names (e.g., use
|
||||
> Do not use underscores (`_`) in your MCP server names (for example, use
|
||||
> `my-server` rather than `my_server`). The policy parser splits Fully Qualified
|
||||
> Names (`mcp_server_tool`) on the _first_ underscore following the `mcp_`
|
||||
> prefix. If your server name contains an underscore, the parser will
|
||||
@@ -397,7 +397,8 @@ policies, as it is much more robust than manually writing Fully Qualified Names
|
||||
|
||||
Combine `mcpName` and `toolName` to target a single operation. When using
|
||||
`mcpName`, the `toolName` field should strictly be the simple name of the tool
|
||||
(e.g., `search`), **not** the Fully Qualified Name (e.g., `mcp_server_search`).
|
||||
(for example, `search`), **not** the Fully Qualified Name (for example,
|
||||
`mcp_server_search`).
|
||||
|
||||
```toml
|
||||
# Allows the `search` tool on the `my-jira-server` MCP
|
||||
@@ -438,10 +439,37 @@ decision = "ask_user"
|
||||
priority = 10
|
||||
```
|
||||
|
||||
### Special syntax for subagents
|
||||
|
||||
You can secure and govern subagents using standard policy rules by treating the
|
||||
subagent's name as the `toolName`.
|
||||
|
||||
When the main agent invokes a subagent (e.g., using the unified `invoke_agent`
|
||||
tool), the Policy Engine automatically treats the target `agent_name` as a
|
||||
virtual tool alias for rule matching.
|
||||
|
||||
**Example:**
|
||||
|
||||
This rule denies access to the `codebase_investigator` subagent.
|
||||
|
||||
```toml
|
||||
[[rule]]
|
||||
toolName = "codebase_investigator"
|
||||
decision = "deny"
|
||||
priority = 500
|
||||
deny_message = "Deep codebase analysis is restricted for this session."
|
||||
```
|
||||
|
||||
- **Backward Compatibility**: Any rules written targeting historical 1:1
|
||||
subagent tool names will continue to match transparently.
|
||||
- **Context differentiation**: To create rules based on **who** is calling a
|
||||
tool, use the `subagent` field instead. See
|
||||
[TOML rule schema](#toml-rule-schema).
|
||||
|
||||
## Default policies
|
||||
|
||||
The Gemini CLI ships with a set of default policies to provide a safe
|
||||
out-of-the-box experience.
|
||||
Gemini CLI ships with a set of default policies to provide a safe out-of-the-box
|
||||
experience.
|
||||
|
||||
- **Read-only tools** (like `read_file`, `glob`) are generally **allowed**.
|
||||
- **Agent delegation** defaults to **`ask_user`** to ensure remote agents can
|
||||
|
||||
+16
-4
@@ -113,12 +113,24 @@ each tool.
|
||||
| :-------------- | :------ | :----------------------------------------------------------------------------------------------------------------- |
|
||||
| `complete_task` | `Other` | Finalizes a subagent's mission and returns the result to the parent agent. This tool is not available to the user. |
|
||||
|
||||
### Task Tracking
|
||||
|
||||
| Tool | Kind | Description |
|
||||
| :----------------------- | :------ | :-------------------------------------------------------------------------- |
|
||||
| `tracker_add_dependency` | `Think` | Adds a dependency between two existing tasks in the tracker. |
|
||||
| `tracker_create_task` | `Think` | Creates a new task in the internal tracker to monitor progress. |
|
||||
| `tracker_get_task` | `Think` | Retrieves the details and current status of a specific tracked task. |
|
||||
| `tracker_list_tasks` | `Think` | Lists all tasks currently being tracked. |
|
||||
| `tracker_update_task` | `Think` | Updates the status or details of an existing task. |
|
||||
| `tracker_visualize` | `Think` | Generates a visual representation of the current task dependency graph. |
|
||||
| `update_topic` | `Think` | Updates the current topic and status to keep the user informed of progress. |
|
||||
|
||||
### Web
|
||||
|
||||
| Tool | Kind | Description |
|
||||
| :-------------------------------------------- | :------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [`google_web_search`](../tools/web-search.md) | `Search` | Performs a Google Search to find up-to-date information. |
|
||||
| [`web_fetch`](../tools/web-fetch.md) | `Fetch` | Retrieves and processes content from specific URLs. **Warning:** This tool can access local and private network addresses (e.g., localhost), which may pose a security risk if used with untrusted prompts. In Plan Mode, this tool requires explicit user confirmation. |
|
||||
| Tool | Kind | Description |
|
||||
| :-------------------------------------------- | :------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| [`google_web_search`](../tools/web-search.md) | `Search` | Performs a Google Search to find up-to-date information. |
|
||||
| [`web_fetch`](../tools/web-fetch.md) | `Fetch` | Retrieves and processes content from specific URLs. **Warning:** This tool can access local and private network addresses (for example, localhost), which may pose a security risk if used with untrusted prompts. In Plan Mode, this tool requires explicit user confirmation. |
|
||||
|
||||
## Under the hood
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Release confidence strategy
|
||||
|
||||
This document outlines the strategy for gaining confidence in every release of
|
||||
the Gemini CLI. It serves as a checklist and quality gate for release manager to
|
||||
Gemini CLI. It serves as a checklist and quality gate for release manager to
|
||||
ensure we are shipping a high-quality product.
|
||||
|
||||
## The goal
|
||||
|
||||
+19
-19
@@ -45,7 +45,7 @@ promotion flow is:
|
||||
### Preview
|
||||
|
||||
These releases will not have been fully vetted and may contain regressions or
|
||||
other outstanding issues. Please help us test and install with `preview` tag.
|
||||
other outstanding issues. Help us test and install with `preview` tag.
|
||||
|
||||
```bash
|
||||
npm install -g @google/gemini-cli@preview
|
||||
@@ -126,8 +126,8 @@ specific version from any branch, tag, or commit SHA.
|
||||
2. Select the **Release: Manual** workflow from the list.
|
||||
3. Click the **Run workflow** dropdown button.
|
||||
4. Fill in the required inputs:
|
||||
- **Version**: The exact version to release (e.g., `v0.6.1`). This must be a
|
||||
valid semantic version with a `v` prefix.
|
||||
- **Version**: The exact version to release (for example, `v0.6.1`). This
|
||||
must be a valid semantic version with a `v` prefix.
|
||||
- **Ref**: The branch, tag, or full commit SHA to release from.
|
||||
- **NPM Channel**: The npm channel to publish to. The options are `preview`,
|
||||
`nightly`, `latest` (for stable releases), and `dev`. The default is
|
||||
@@ -165,9 +165,10 @@ require a full release cycle.
|
||||
3. Click the **Run workflow** dropdown button.
|
||||
4. Fill in the required inputs:
|
||||
- **Version**: The existing package version that you want to point the tag
|
||||
to (e.g., `0.5.0-preview-2`). This version **must** already be published
|
||||
to the npm registry.
|
||||
- **Channel**: The npm `dist-tag` to apply (e.g., `preview`, `stable`).
|
||||
to (for example, `0.5.0-preview-2`). This version **must** already be
|
||||
published to the npm registry.
|
||||
- **Channel**: The npm `dist-tag` to apply (for example, `preview`,
|
||||
`stable`).
|
||||
- **Dry Run**: Leave as `true` to log the action without making changes, or
|
||||
set to `false` to perform the live tag change.
|
||||
- **Environment**: Select the appropriate environment. The `dev` environment
|
||||
@@ -227,7 +228,7 @@ workflow.
|
||||
This workflow will automatically:
|
||||
|
||||
1. Find the latest release tag for the channel.
|
||||
2. Create a release branch from that tag if one doesn't exist (e.g.,
|
||||
2. Create a release branch from that tag if one doesn't exist (for example,
|
||||
`release/v0.5.1-pr-12345`).
|
||||
3. Create a new hotfix branch from the release branch.
|
||||
4. Cherry-pick your specified commit into the hotfix branch.
|
||||
@@ -282,9 +283,8 @@ created:
|
||||
6. **Update the PR description**: Consider updating the PR title and description
|
||||
to reflect that it includes multiple fixes.
|
||||
|
||||
This approach allows you to group related fixes into a single patch release
|
||||
while maintaining full control over what gets included and how conflicts are
|
||||
resolved.
|
||||
This approach lets you group related fixes into a single patch release while
|
||||
maintaining full control over what gets included and how conflicts are resolved.
|
||||
|
||||
#### 3. Automatic release
|
||||
|
||||
@@ -302,9 +302,9 @@ consistently and reliably.
|
||||
#### Troubleshooting: Older branch workflows
|
||||
|
||||
**Issue**: If the patch trigger workflow fails with errors like "Resource not
|
||||
accessible by integration" or references to non-existent workflow files (e.g.,
|
||||
`patch-release.yml`), this indicates the hotfix branch contains an outdated
|
||||
version of the workflow files.
|
||||
accessible by integration" or references to non-existent workflow files (for
|
||||
example, `patch-release.yml`), this indicates the hotfix branch contains an
|
||||
outdated version of the workflow files.
|
||||
|
||||
**Root cause**: When a PR is merged, GitHub Actions runs the workflow definition
|
||||
from the **source branch** (the hotfix branch), not from the target branch (the
|
||||
@@ -428,7 +428,7 @@ This command will do the following:
|
||||
|
||||
You can then inspect the generated tarballs to ensure that they contain the
|
||||
correct files and that the `package.json` files have been updated correctly. The
|
||||
tarballs will be created in the root of each package's directory (e.g.,
|
||||
tarballs will be created in the root of each package's directory (for example,
|
||||
`packages/cli/google-gemini-cli-0.1.6.tgz`).
|
||||
|
||||
By performing a dry run, you can be confident that your changes to the packaging
|
||||
@@ -477,9 +477,9 @@ executable that enables `npx` usage directly from the GitHub repository.
|
||||
1. **The JavaScript bundle is created:**
|
||||
- **What happens:** The built JavaScript from both `packages/core/dist` and
|
||||
`packages/cli/dist`, along with all third-party JavaScript dependencies,
|
||||
are bundled by `esbuild` into a single, executable JavaScript file (e.g.,
|
||||
`gemini.js`). The `node-pty` library is excluded from this bundle as it
|
||||
contains native binaries.
|
||||
are bundled by `esbuild` into a single, executable JavaScript file (for
|
||||
example, `gemini.js`). The `node-pty` library is excluded from this bundle
|
||||
as it contains native binaries.
|
||||
- **Why:** This creates a single, optimized file that contains all the
|
||||
necessary application code. It simplifies execution for users who want to
|
||||
run the CLI without a full `npm install`, as all dependencies (including
|
||||
@@ -540,9 +540,9 @@ The list of available labels is not currently populated correctly. If you want
|
||||
to add a label that does not appear alphabetically in the first 30 labels in the
|
||||
repo, you must use your browser's developer tools to manually modify the UI:
|
||||
|
||||
1. Open your browser's developer tools (e.g., Chrome DevTools).
|
||||
1. Open your browser's developer tools (for example, Chrome DevTools).
|
||||
2. In the `/github-settings` dialog, inspect the list of labels.
|
||||
3. Locate one of the `<li>` elements representing a label.
|
||||
4. In the HTML, modify the `data-option-value` attribute of that `<li>` element
|
||||
to the desired label name (e.g., `release-failure`).
|
||||
to the desired label name (for example, `release-failure`).
|
||||
5. Click on your modified label in the UI to select it, then save your settings.
|
||||
|
||||
@@ -8,7 +8,7 @@ problems encountered while using Gemini CLI.
|
||||
This section addresses common questions about Gemini CLI usage, security, and
|
||||
troubleshooting general errors.
|
||||
|
||||
### Why can't I use third-party software (e.g. Claude Code, OpenClaw, OpenCode) with Gemini CLI?
|
||||
### Why can't I use third-party software like Claude Code, OpenClaw, or OpenCode with Gemini CLI?
|
||||
|
||||
Using third-party software, tools, or services to harvest or piggyback on Gemini
|
||||
CLI's OAuth authentication to access our backend services is a direct violation
|
||||
@@ -113,8 +113,8 @@ export GOOGLE_CLOUD_PROJECT="your-project-id"
|
||||
$env:GOOGLE_CLOUD_PROJECT="your-project-id"
|
||||
```
|
||||
|
||||
To make this setting permanent, add this line to your shell's startup file
|
||||
(e.g., `~/.bashrc`, `~/.zshrc`).
|
||||
To make this setting permanent, add this line to your shell's startup file (for
|
||||
example, `~/.bashrc`, `~/.zshrc`).
|
||||
|
||||
### What is the best way to store my API keys securely?
|
||||
|
||||
@@ -131,9 +131,9 @@ To store your API keys securely, you can:
|
||||
Manager, or a secret manager on Linux). You can then have your scripts or
|
||||
environment load the key from the secure storage at runtime.
|
||||
|
||||
### Where are the Gemini CLI configuration and settings files stored?
|
||||
### Where are Gemini CLI configuration and settings files stored?
|
||||
|
||||
The Gemini CLI configuration is stored in two `settings.json` files:
|
||||
Gemini CLI configuration is stored in two `settings.json` files:
|
||||
|
||||
1. In your home directory: `~/.gemini/settings.json`.
|
||||
2. In your project's root directory: `./.gemini/settings.json`.
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
# Gemini CLI: License, Terms of Service, and Privacy Notices
|
||||
|
||||
Gemini CLI is an open-source tool that lets you interact with Google's powerful
|
||||
AI services directly from your command-line interface. The Gemini CLI software
|
||||
is licensed under the
|
||||
AI services directly from your command-line interface. Gemini CLI software is
|
||||
licensed under the
|
||||
[Apache 2.0 license](https://github.com/google-gemini/gemini-cli/blob/main/LICENSE).
|
||||
When you use Gemini CLI to access or use Google’s services, the Terms of Service
|
||||
and Privacy Notices applicable to those services apply to such access and use.
|
||||
|
||||
Directly accessing the services powering Gemini CLI (e.g., the Gemini Code
|
||||
Assist service) using third-party software, tools, or services (for example,
|
||||
using OpenClaw with Gemini CLI OAuth) is a violation of applicable terms and
|
||||
policies. Such actions may be grounds for suspension or termination of your
|
||||
account.
|
||||
Directly accessing the services powering Gemini CLI (for example, the Gemini
|
||||
Code Assist service) using third-party software, tools, or services (for
|
||||
example, using OpenClaw with Gemini CLI OAuth) is a violation of applicable
|
||||
terms and policies. Such actions may be grounds for suspension or termination of
|
||||
your account.
|
||||
|
||||
Your Gemini CLI Usage Statistics are handled in accordance with Google's Privacy
|
||||
Policy.
|
||||
@@ -19,7 +19,7 @@ Policy.
|
||||
<!-- prettier-ignore -->
|
||||
> [!NOTE]
|
||||
> See [quotas and pricing](quota-and-pricing.md) for the quota and
|
||||
> pricing details that apply to your usage of the Gemini CLI.
|
||||
> pricing details that apply to your usage of Gemini CLI.
|
||||
|
||||
## Supported authentication methods
|
||||
|
||||
@@ -37,7 +37,7 @@ If you log in with your Google account and you do not already have a Gemini Code
|
||||
Assist account associated with your Google account, you will be directed to the
|
||||
sign up flow for Gemini Code Assist for individuals. If your Google account is
|
||||
managed by your organization, your administrator may not permit access to Gemini
|
||||
Code Assist for individuals. Please see the
|
||||
Code Assist for individuals. See the
|
||||
[Gemini Code Assist for individuals FAQs](https://developers.google.com/gemini-code-assist/resources/faqs)
|
||||
for further information.
|
||||
|
||||
@@ -76,7 +76,7 @@ If you are using a Gemini API key for authentication with the
|
||||
[Gemini Developer API](https://ai.google.dev/gemini-api/docs), these Terms of
|
||||
Service and Privacy Notice documents apply:
|
||||
|
||||
- Terms of Service: Your use of the Gemini CLI is governed by the
|
||||
- Terms of Service: Your use of Gemini CLI is governed by the
|
||||
[Gemini API Terms of Service](https://ai.google.dev/gemini-api/terms). These
|
||||
terms may differ depending on whether you are using an unpaid or paid service:
|
||||
- For unpaid services, refer to the
|
||||
@@ -92,7 +92,7 @@ If you are using a Gemini API key for authentication with a
|
||||
[Vertex AI GenAI API](https://cloud.google.com/vertex-ai/generative-ai/docs/reference/rest)
|
||||
backend, these Terms of Service and Privacy Notice documents apply:
|
||||
|
||||
- Terms of Service: Your use of the Gemini CLI is governed by the
|
||||
- Terms of Service: Your use of Gemini CLI is governed by the
|
||||
[Google Cloud Platform Service Terms](https://cloud.google.com/terms/service-terms/).
|
||||
- Privacy Notice: The collection and use of your data is described in the
|
||||
[Google Cloud Privacy Notice](https://cloud.google.com/terms/cloud-privacy-notice).
|
||||
|
||||
@@ -80,9 +80,9 @@ topics on:
|
||||
directory is in your `PATH`. You can update Gemini CLI using the command
|
||||
`npm install -g @google/gemini-cli@latest`.
|
||||
- If you are running `gemini` from source, ensure you are using the correct
|
||||
command to invoke it (e.g., `node packages/cli/dist/index.js ...`). To
|
||||
update Gemini CLI, pull the latest changes from the repository, and then
|
||||
rebuild using the command `npm run build`.
|
||||
command to invoke it (for example, `node packages/cli/dist/index.js ...`).
|
||||
To update Gemini CLI, pull the latest changes from the repository, and
|
||||
then rebuild using the command `npm run build`.
|
||||
|
||||
- **Error: `MODULE_NOT_FOUND` or import errors.**
|
||||
- **Cause:** Dependencies are not installed correctly, or the project hasn't
|
||||
@@ -101,18 +101,18 @@ topics on:
|
||||
configuration.
|
||||
|
||||
- **Gemini CLI is not running in interactive mode in "CI" environments**
|
||||
- **Issue:** The Gemini CLI does not enter interactive mode (no prompt
|
||||
appears) if an environment variable starting with `CI_` (e.g., `CI_TOKEN`)
|
||||
is set. This is because the `is-in-ci` package, used by the underlying UI
|
||||
- **Issue:** Gemini CLI does not enter interactive mode (no prompt appears) if
|
||||
an environment variable starting with `CI_` (for example, `CI_TOKEN`) is
|
||||
set. This is because the `is-in-ci` package, used by the underlying UI
|
||||
framework, detects these variables and assumes a non-interactive CI
|
||||
environment.
|
||||
- **Cause:** The `is-in-ci` package checks for the presence of `CI`,
|
||||
`CONTINUOUS_INTEGRATION`, or any environment variable with a `CI_` prefix.
|
||||
When any of these are found, it signals that the environment is
|
||||
non-interactive, which prevents the Gemini CLI from starting in its
|
||||
interactive mode.
|
||||
non-interactive, which prevents Gemini CLI from starting in its interactive
|
||||
mode.
|
||||
- **Solution:** If the `CI_` prefixed variable is not needed for the CLI to
|
||||
function, you can temporarily unset it for the command. e.g.,
|
||||
function, you can temporarily unset it for the command. For example,
|
||||
`env -u CI_TOKEN gemini`
|
||||
|
||||
- **DEBUG mode not working from project .env file**
|
||||
@@ -126,7 +126,7 @@ topics on:
|
||||
|
||||
- **Warning: `npm WARN deprecated node-domexception@1.0.0` or
|
||||
`npm WARN deprecated glob` during install/update**
|
||||
- **Issue:** When installing or updating the Gemini CLI globally via
|
||||
- **Issue:** When installing or updating Gemini CLI globally via
|
||||
`npm install -g @google/gemini-cli` or `npm update -g @google/gemini-cli`,
|
||||
you might see deprecation warnings regarding `node-domexception` or old
|
||||
versions of `glob`.
|
||||
@@ -141,14 +141,14 @@ topics on:
|
||||
|
||||
## Exit codes
|
||||
|
||||
The Gemini CLI uses specific exit codes to indicate the reason for termination.
|
||||
This is especially useful for scripting and automation.
|
||||
Gemini CLI uses specific exit codes to indicate the reason for termination. This
|
||||
is especially useful for scripting and automation.
|
||||
|
||||
| Exit Code | Error Type | Description |
|
||||
| --------- | -------------------------- | --------------------------------------------------------------------------------------------------- |
|
||||
| 41 | `FatalAuthenticationError` | An error occurred during the authentication process. |
|
||||
| 42 | `FatalInputError` | Invalid or missing input was provided to the CLI. (non-interactive mode only) |
|
||||
| 44 | `FatalSandboxError` | An error occurred with the sandboxing environment (e.g., Docker, Podman, or Seatbelt). |
|
||||
| 44 | `FatalSandboxError` | An error occurred with the sandboxing environment (for example, Docker, Podman, or Seatbelt). |
|
||||
| 52 | `FatalConfigError` | A configuration file (`settings.json`) is invalid or contains errors. |
|
||||
| 53 | `FatalTurnLimitedError` | The maximum number of conversational turns for the session was reached. (non-interactive mode only) |
|
||||
|
||||
@@ -164,8 +164,8 @@ This is especially useful for scripting and automation.
|
||||
- Check the server console output for error messages or stack traces.
|
||||
- Increase log verbosity if configurable. For example, set the `DEBUG_MODE`
|
||||
environment variable to `true` or `1`.
|
||||
- Use Node.js debugging tools (e.g., `node --inspect`) if you need to step
|
||||
through server-side code.
|
||||
- Use Node.js debugging tools (for example, `node --inspect`) if you need to
|
||||
step through server-side code.
|
||||
|
||||
- **Tool issues:**
|
||||
- If a specific tool is failing, try to isolate the issue by running the
|
||||
@@ -182,7 +182,7 @@ This is especially useful for scripting and automation.
|
||||
## Existing GitHub issues similar to yours or creating new issues
|
||||
|
||||
If you encounter an issue that was not covered here in this _Troubleshooting
|
||||
guide_, consider searching the Gemini CLI
|
||||
guide_, consider searching Gemini CLI
|
||||
[Issue tracker on GitHub](https://github.com/google-gemini/gemini-cli/issues).
|
||||
If you can't find an issue similar to yours, consider creating a new GitHub
|
||||
Issue with a detailed description. Pull requests are also welcome!
|
||||
|
||||
@@ -28,8 +28,9 @@ Remove-Item -Path (Join-Path $env:LocalAppData "npm-cache\_npx") -Recurse -Force
|
||||
|
||||
## Method 2: Using npm (global install)
|
||||
|
||||
If you installed the CLI globally (e.g., `npm install -g @google/gemini-cli`),
|
||||
use the `npm uninstall` command with the `-g` flag to remove it.
|
||||
If you installed the CLI globally (for example,
|
||||
`npm install -g @google/gemini-cli`), use the `npm uninstall` command with the
|
||||
`-g` flag to remove it.
|
||||
|
||||
```bash
|
||||
npm uninstall -g @google/gemini-cli
|
||||
@@ -39,7 +40,7 @@ This command completely removes the package from your system.
|
||||
|
||||
## Method 3: Homebrew
|
||||
|
||||
If you installed the CLI globally using Homebrew (e.g.,
|
||||
If you installed the CLI globally using Homebrew (for example,
|
||||
`brew install gemini-cli`), use the `brew uninstall` command to remove it.
|
||||
|
||||
```bash
|
||||
@@ -48,7 +49,7 @@ brew uninstall gemini-cli
|
||||
|
||||
## Method 4: MacPorts
|
||||
|
||||
If you installed the CLI globally using MacPorts (e.g.,
|
||||
If you installed the CLI globally using MacPorts (for example,
|
||||
`sudo port install gemini-cli`), use the `port uninstall` command to remove it.
|
||||
|
||||
```bash
|
||||
|
||||
@@ -15,7 +15,7 @@ confirmation.
|
||||
Each question object has the following properties:
|
||||
- `question` (string, required): The complete question text.
|
||||
- `header` (string, required): A short label (max 16 chars) displayed as a
|
||||
chip/tag (e.g., "Auth", "Database").
|
||||
chip/tag (for example, "Auth", "Database").
|
||||
- `type` (string, optional): The type of question. Defaults to `'choice'`.
|
||||
- `'choice'`: Multiple-choice with options (supports multi-select).
|
||||
- `'text'`: Free-form text input.
|
||||
@@ -35,7 +35,7 @@ confirmation.
|
||||
- Returns the user's answers to the model.
|
||||
|
||||
- **Output (`llmContent`):** A JSON string containing the user's answers,
|
||||
indexed by question position (e.g.,
|
||||
indexed by question position (for example,
|
||||
`{"answers":{"0": "Option A", "1": "Some text"}}`).
|
||||
|
||||
- **Confirmation:** Yes. The tool inherently involves user interaction.
|
||||
@@ -75,7 +75,7 @@ confirmation.
|
||||
"header": "Project Name",
|
||||
"question": "What is the name of your new project?",
|
||||
"type": "text",
|
||||
"placeholder": "e.g., my-awesome-app"
|
||||
"placeholder": "for example, my-awesome-app"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# File system tools reference
|
||||
|
||||
The Gemini CLI core provides a suite of tools for interacting with the local
|
||||
file system. These tools allow the model to explore and modify your codebase.
|
||||
Gemini CLI core provides a suite of tools for interacting with the local file
|
||||
system. These tools allow the model to explore and modify your codebase.
|
||||
|
||||
## Technical reference
|
||||
|
||||
@@ -49,8 +49,8 @@ Finds files matching specific glob patterns across the workspace.
|
||||
- **Display name:** FindFiles
|
||||
- **File:** `glob.ts`
|
||||
- **Parameters:**
|
||||
- `pattern` (string, required): The glob pattern to match against (e.g.,
|
||||
`"*.py"`, `"src/**/*.js"`).
|
||||
- `pattern` (string, required): The glob pattern to match against (for
|
||||
example, `"*.py"`, `"src/**/*.js"`).
|
||||
- `path` (string, optional): The absolute path to the directory to search
|
||||
within. If omitted, searches the tool's root directory.
|
||||
- `case_sensitive` (boolean, optional): Whether the search should be
|
||||
@@ -78,18 +78,18 @@ lines containing matches, along with their file paths and line numbers.
|
||||
- **File:** `grep.ts`
|
||||
- **Parameters:**
|
||||
- `pattern` (string, required): The regular expression (regex) to search for
|
||||
(e.g., `"function\s+myFunction"`).
|
||||
(for example, `"function\s+myFunction"`).
|
||||
- `path` (string, optional): The absolute path to the directory to search
|
||||
within. Defaults to the current working directory.
|
||||
- `include` (string, optional): A glob pattern to filter which files are
|
||||
searched (e.g., `"*.js"`, `"src/**/*.{ts,tsx}"`). If omitted, searches most
|
||||
files (respecting common ignores).
|
||||
searched (for example, `"*.js"`, `"src/**/*.{ts,tsx}"`). If omitted,
|
||||
searches most files (respecting common ignores).
|
||||
- **Behavior:**
|
||||
- Uses `git grep` if available in a Git repository for speed; otherwise, falls
|
||||
back to system `grep` or a JavaScript-based search.
|
||||
- Returns a list of matching lines, each prefixed with its file path (relative
|
||||
to the search directory) and line number.
|
||||
- **Output (`llmContent`):** A formatted string of matches, e.g.:
|
||||
- **Output (`llmContent`):** A formatted string of matches, for example:
|
||||
```
|
||||
Found 3 matches for pattern "myFunction" in path "." (filter: "*.ts"):
|
||||
---
|
||||
|
||||
+38
-36
@@ -1,7 +1,7 @@
|
||||
# MCP servers with the Gemini CLI
|
||||
# MCP servers with Gemini CLI
|
||||
|
||||
This document provides a guide to configuring and using Model Context Protocol
|
||||
(MCP) servers with the Gemini CLI.
|
||||
(MCP) servers with Gemini CLI.
|
||||
|
||||
## What is an MCP server?
|
||||
|
||||
@@ -10,7 +10,7 @@ CLI through the Model Context Protocol, allowing it to interact with external
|
||||
systems and data sources. MCP servers act as a bridge between the Gemini model
|
||||
and your local environment or other services like APIs.
|
||||
|
||||
An MCP server enables the Gemini CLI to:
|
||||
An MCP server enables Gemini CLI to:
|
||||
|
||||
- **Discover tools:** List available tools, their descriptions, and parameters
|
||||
through standardized schema definitions.
|
||||
@@ -19,13 +19,13 @@ An MCP server enables the Gemini CLI to:
|
||||
- **Access resources:** Read data from specific resources that the server
|
||||
exposes (files, API payloads, reports, etc.).
|
||||
|
||||
With an MCP server, you can extend the Gemini CLI's capabilities to perform
|
||||
actions beyond its built-in features, such as interacting with databases, APIs,
|
||||
custom scripts, or specialized workflows.
|
||||
With an MCP server, you can extend Gemini CLI's capabilities to perform actions
|
||||
beyond its built-in features, such as interacting with databases, APIs, custom
|
||||
scripts, or specialized workflows.
|
||||
|
||||
## Core integration architecture
|
||||
|
||||
The Gemini CLI integrates with MCP servers through a sophisticated discovery and
|
||||
Gemini CLI integrates with MCP servers through a sophisticated discovery and
|
||||
execution system built into the core package (`packages/core/src/tools/`):
|
||||
|
||||
### Discovery Layer (`mcp-client.ts`)
|
||||
@@ -54,7 +54,7 @@ Each discovered MCP tool is wrapped in a `DiscoveredMCPTool` instance that:
|
||||
|
||||
### Transport mechanisms
|
||||
|
||||
The Gemini CLI supports three MCP transport types:
|
||||
Gemini CLI supports three MCP transport types:
|
||||
|
||||
- **Stdio Transport:** Spawns a subprocess and communicates via stdin/stdout
|
||||
- **SSE Transport:** Connects to Server-Sent Events endpoints
|
||||
@@ -88,9 +88,9 @@ in the conversation.
|
||||
|
||||
## How to set up your MCP server
|
||||
|
||||
The Gemini CLI uses the `mcpServers` configuration in your `settings.json` file
|
||||
to locate and connect to MCP servers. This configuration supports multiple
|
||||
servers with different transport mechanisms.
|
||||
Gemini CLI uses the `mcpServers` configuration in your `settings.json` file to
|
||||
locate and connect to MCP servers. This configuration supports multiple servers
|
||||
with different transport mechanisms.
|
||||
|
||||
### Configure the MCP server in settings.json
|
||||
|
||||
@@ -155,7 +155,8 @@ Each server configuration supports the following properties:
|
||||
#### Required (one of the following)
|
||||
|
||||
- **`command`** (string): Path to the executable for Stdio transport
|
||||
- **`url`** (string): SSE endpoint URL (e.g., `"http://localhost:8080/sse"`)
|
||||
- **`url`** (string): SSE endpoint URL (for example,
|
||||
`"http://localhost:8080/sse"`)
|
||||
- **`httpUrl`** (string): HTTP streaming endpoint URL
|
||||
|
||||
#### Optional
|
||||
@@ -188,7 +189,7 @@ Each server configuration supports the following properties:
|
||||
### Environment variable expansion
|
||||
|
||||
Gemini CLI automatically expands environment variables in the `env` block of
|
||||
your MCP server configuration. This allows you to securely reference variables
|
||||
your MCP server configuration. This lets you securely reference variables
|
||||
defined in your shell or environment without hardcoding sensitive information
|
||||
directly in your `settings.json` file.
|
||||
|
||||
@@ -241,13 +242,14 @@ specific data with that server.
|
||||
<!-- prettier-ignore -->
|
||||
> [!NOTE]
|
||||
> Even when explicitly defined, you should avoid hardcoding secrets.
|
||||
> Instead, use environment variable expansion (e.g., `"MY_KEY": "$MY_KEY"`) to
|
||||
> securely pull the value from your host environment at runtime.
|
||||
> Instead, use environment variable expansion
|
||||
> (for example, `"MY_KEY": "$MY_KEY"`) to securely pull the value from your host
|
||||
> environment at runtime.
|
||||
|
||||
### OAuth support for remote MCP servers
|
||||
|
||||
The Gemini CLI supports OAuth 2.0 authentication for remote MCP servers using
|
||||
SSE or HTTP transports. This enables secure access to MCP servers that require
|
||||
Gemini CLI supports OAuth 2.0 authentication for remote MCP servers using SSE or
|
||||
HTTP transports. This enables secure access to MCP servers that require
|
||||
authentication.
|
||||
|
||||
#### Automatic OAuth discovery
|
||||
@@ -403,7 +405,7 @@ then be used to authenticate with the MCP server.
|
||||
5. **Grant all users and groups** who will access the MCP Server the necessary
|
||||
permissions to
|
||||
[impersonate the service account](https://cloud.google.com/docs/authentication/use-service-account-impersonation)
|
||||
(i.e., `roles/iam.serviceAccountTokenCreator`).
|
||||
(for example, `roles/iam.serviceAccountTokenCreator`).
|
||||
6. **[Enable](https://console.cloud.google.com/apis/library/iamcredentials.googleapis.com)
|
||||
the IAM Credentials API** for your project.
|
||||
|
||||
@@ -532,8 +534,8 @@ then be used to authenticate with the MCP server.
|
||||
|
||||
## Discovery process deep dive
|
||||
|
||||
When the Gemini CLI starts, it performs MCP server discovery through the
|
||||
following detailed process:
|
||||
When Gemini CLI starts, it performs MCP server discovery through the following
|
||||
detailed process:
|
||||
|
||||
### 1. Server iteration and connection
|
||||
|
||||
@@ -583,7 +585,7 @@ every discovered MCP tool is assigned a strict namespace.
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
> [!WARNING]
|
||||
> Do not use underscores (`_`) in your MCP server names (e.g., use
|
||||
> Do not use underscores (`_`) in your MCP server names (for example, use
|
||||
> `my-server` rather than `my_server`). The policy parser splits Fully Qualified
|
||||
> Names (`mcp_server_tool`) on the _first_ underscore following the `mcp_`
|
||||
> prefix. If your server name contains an underscore, the parser will
|
||||
@@ -888,7 +890,7 @@ use.
|
||||
|
||||
MCP tools are not limited to returning simple text. You can return rich,
|
||||
multi-part content, including text, images, audio, and other binary data in a
|
||||
single tool response. This allows you to build powerful tools that can provide
|
||||
single tool response. This lets you build powerful tools that can provide
|
||||
diverse information to the model in a single turn.
|
||||
|
||||
All data returned from the tool is processed and sent to the model as context
|
||||
@@ -901,8 +903,8 @@ To return rich content, your tool's response must adhere to the MCP
|
||||
specification for a
|
||||
[`CallToolResult`](https://modelcontextprotocol.io/specification/2025-06-18/server/tools#tool-result).
|
||||
The `content` field of the result should be an array of `ContentBlock` objects.
|
||||
The Gemini CLI will correctly process this array, separating text from binary
|
||||
data and packaging it for the model.
|
||||
Gemini CLI will correctly process this array, separating text from binary data
|
||||
and packaging it for the model.
|
||||
|
||||
You can mix and match different content block types in the `content` array. The
|
||||
supported block types include:
|
||||
@@ -938,7 +940,7 @@ text description and an image:
|
||||
}
|
||||
```
|
||||
|
||||
When the Gemini CLI receives this response, it will:
|
||||
When Gemini CLI receives this response, it will:
|
||||
|
||||
1. Extract all the text and combine it into a single `functionResponse` part
|
||||
for the model.
|
||||
@@ -952,8 +954,8 @@ context to the Gemini model.
|
||||
## MCP prompts as slash commands
|
||||
|
||||
In addition to tools, MCP servers can expose predefined prompts that can be
|
||||
executed as slash commands within the Gemini CLI. This allows you to create
|
||||
shortcuts for common or complex queries that can be easily invoked by name.
|
||||
executed as slash commands within Gemini CLI. This lets you create shortcuts for
|
||||
common or complex queries that can be easily invoked by name.
|
||||
|
||||
### Defining prompts on the server
|
||||
|
||||
@@ -1021,8 +1023,8 @@ or, using positional arguments:
|
||||
/poem-writer "Gemini CLI" reverent
|
||||
```
|
||||
|
||||
When you run this command, the Gemini CLI executes the `prompts/get` method on
|
||||
the MCP server with the provided arguments. The server is responsible for
|
||||
When you run this command, Gemini CLI executes the `prompts/get` method on the
|
||||
MCP server with the provided arguments. The server is responsible for
|
||||
substituting the arguments into the prompt template and returning the final
|
||||
prompt text. The CLI then sends this prompt to the model for execution. This
|
||||
provides a convenient way to automate and share common workflows.
|
||||
@@ -1030,10 +1032,10 @@ provides a convenient way to automate and share common workflows.
|
||||
## Managing MCP servers with `gemini mcp`
|
||||
|
||||
While you can always configure MCP servers by manually editing your
|
||||
`settings.json` file, the Gemini CLI provides a convenient set of commands to
|
||||
manage your server configurations programmatically. These commands streamline
|
||||
the process of adding, listing, and removing MCP servers without needing to
|
||||
directly edit JSON files.
|
||||
`settings.json` file, Gemini CLI provides a convenient set of commands to manage
|
||||
your server configurations programmatically. These commands streamline the
|
||||
process of adding, listing, and removing MCP servers without needing to directly
|
||||
edit JSON files.
|
||||
|
||||
### Adding a server (`gemini mcp add`)
|
||||
|
||||
@@ -1056,9 +1058,9 @@ gemini mcp add [options] <name> <commandOrUrl> [args...]
|
||||
|
||||
- `-s, --scope`: Configuration scope (user or project). [default: "project"]
|
||||
- `-t, --transport`: Transport type (stdio, sse, http). [default: "stdio"]
|
||||
- `-e, --env`: Set environment variables (e.g. -e KEY=value).
|
||||
- `-H, --header`: Set HTTP headers for SSE and HTTP transports (e.g. -H
|
||||
"X-Api-Key: abc123" -H "Authorization: Bearer abc123").
|
||||
- `-e, --env`: Set environment variables (for example, `-e KEY=value`).
|
||||
- `-H, --header`: Set HTTP headers for SSE and HTTP transports (for example,
|
||||
`-H "X-Api-Key: abc123" -H "Authorization: Bearer abc123"`).
|
||||
- `--timeout`: Set connection timeout in milliseconds.
|
||||
- `--trust`: Trust the server (bypass all tool call confirmation prompts).
|
||||
- `--description`: Set the description for the server.
|
||||
|
||||
+5
-5
@@ -32,7 +32,7 @@ The tool returns a JSON object containing:
|
||||
## Configuration
|
||||
|
||||
You can configure the behavior of the `run_shell_command` tool by modifying your
|
||||
`settings.json` file or by using the `/settings` command in the Gemini CLI.
|
||||
`settings.json` file or by using the `/settings` command in Gemini CLI.
|
||||
|
||||
### Enabling interactive commands
|
||||
|
||||
@@ -93,9 +93,9 @@ applies when `tools.shell.enableInteractiveShell` is enabled.
|
||||
## Interactive commands
|
||||
|
||||
The `run_shell_command` tool now supports interactive commands by integrating a
|
||||
pseudo-terminal (pty). This allows you to run commands that require real-time
|
||||
user input, such as text editors (`vim`, `nano`), terminal-based UIs (`htop`),
|
||||
and interactive version control operations (`git rebase -i`).
|
||||
pseudo-terminal (pty). This lets you run commands that require real-time user
|
||||
input, such as text editors (`vim`, `nano`), terminal-based UIs (`htop`), and
|
||||
interactive version control operations (`git rebase -i`).
|
||||
|
||||
When an interactive command is running, you can send input to it from the Gemini
|
||||
CLI. To focus on the interactive shell, press `Tab`. The terminal output,
|
||||
@@ -116,7 +116,7 @@ including complex TUIs, will be rendered correctly.
|
||||
|
||||
When `run_shell_command` executes a command, it sets the `GEMINI_CLI=1`
|
||||
environment variable in the subprocess's environment. This allows scripts or
|
||||
tools to detect if they are being run from within the Gemini CLI.
|
||||
tools to detect if they are being run from within Gemini CLI.
|
||||
|
||||
## Command restrictions
|
||||
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ const external = [
|
||||
'@lydell/node-pty-linux-x64',
|
||||
'@lydell/node-pty-win32-arm64',
|
||||
'@lydell/node-pty-win32-x64',
|
||||
'keytar',
|
||||
'@github/keytar',
|
||||
'@google/gemini-cli-devtools',
|
||||
];
|
||||
|
||||
|
||||
+56
-37
@@ -9,10 +9,46 @@ import path from 'node:path';
|
||||
|
||||
import { describe, expect } from 'vitest';
|
||||
|
||||
import { evalTest, TEST_AGENTS } from './test-helper.js';
|
||||
import { AGENT_TOOL_NAME } from '@google/gemini-cli-core';
|
||||
import { evalTest, TEST_AGENTS, TestRig } from './test-helper.js';
|
||||
|
||||
const INDEX_TS = 'export const add = (a: number, b: number) => a + b;\n';
|
||||
|
||||
/**
|
||||
* Helper to verify that a specific subagent was successfully invoked via the unified tool.
|
||||
*/
|
||||
async function expectSubagentCall(rig: TestRig, agentName: string) {
|
||||
await rig.expectToolCallSuccess(
|
||||
[AGENT_TOOL_NAME],
|
||||
undefined,
|
||||
(args: string) => {
|
||||
try {
|
||||
const parsed = JSON.parse(args);
|
||||
return parsed.agent_name === agentName;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper to check if a subagent (either via unified tool or direct name) was called.
|
||||
*/
|
||||
function isSubagentCalled(toolLogs: any[], agentName: string): boolean {
|
||||
return toolLogs.some((l) => {
|
||||
if (l.toolRequest.name === AGENT_TOOL_NAME) {
|
||||
try {
|
||||
const args = JSON.parse(l.toolRequest.args);
|
||||
return args.agent_name === agentName;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return l.toolRequest.name === agentName;
|
||||
});
|
||||
}
|
||||
|
||||
// A minimal package.json is used to provide a realistic workspace anchor.
|
||||
// This prevents the agent from making incorrect assumptions about the environment
|
||||
// and helps it properly navigate or act as if it is in a standard Node.js project.
|
||||
@@ -62,7 +98,7 @@ describe('subagent eval test cases', () => {
|
||||
'README.md': 'TODO: update the README.\n',
|
||||
},
|
||||
assert: async (rig, _result) => {
|
||||
await rig.expectToolCallSuccess([TEST_AGENTS.DOCS_AGENT.name]);
|
||||
await expectSubagentCall(rig, TEST_AGENTS.DOCS_AGENT.name);
|
||||
},
|
||||
});
|
||||
|
||||
@@ -99,14 +135,10 @@ describe('subagent eval test cases', () => {
|
||||
}>;
|
||||
|
||||
expect(updatedIndex).toContain('export const sum =');
|
||||
expect(
|
||||
toolLogs.some(
|
||||
(l) => l.toolRequest.name === TEST_AGENTS.DOCS_AGENT.name,
|
||||
),
|
||||
).toBe(false);
|
||||
expect(toolLogs.some((l) => l.toolRequest.name === 'generalist')).toBe(
|
||||
expect(isSubagentCalled(toolLogs, TEST_AGENTS.DOCS_AGENT.name)).toBe(
|
||||
false,
|
||||
);
|
||||
expect(isSubagentCalled(toolLogs, 'generalist')).toBe(false);
|
||||
},
|
||||
});
|
||||
|
||||
@@ -140,13 +172,11 @@ describe('subagent eval test cases', () => {
|
||||
},
|
||||
assert: async (rig, _result) => {
|
||||
const toolLogs = rig.readToolLogs() as Array<{
|
||||
toolRequest: { name: string };
|
||||
toolRequest: { name: string; args: string };
|
||||
}>;
|
||||
|
||||
await rig.expectToolCallSuccess([TEST_AGENTS.TESTING_AGENT.name]);
|
||||
expect(toolLogs.some((l) => l.toolRequest.name === 'generalist')).toBe(
|
||||
false,
|
||||
);
|
||||
await expectSubagentCall(rig, TEST_AGENTS.TESTING_AGENT.name);
|
||||
expect(isSubagentCalled(toolLogs, 'generalist')).toBe(false);
|
||||
},
|
||||
});
|
||||
|
||||
@@ -181,18 +211,15 @@ describe('subagent eval test cases', () => {
|
||||
},
|
||||
assert: async (rig, _result) => {
|
||||
const toolLogs = rig.readToolLogs() as Array<{
|
||||
toolRequest: { name: string };
|
||||
toolRequest: { name: string; args: string };
|
||||
}>;
|
||||
const readme = readProjectFile(rig, 'README.md');
|
||||
|
||||
await rig.expectToolCallSuccess([
|
||||
TEST_AGENTS.DOCS_AGENT.name,
|
||||
TEST_AGENTS.TESTING_AGENT.name,
|
||||
]);
|
||||
await expectSubagentCall(rig, TEST_AGENTS.DOCS_AGENT.name);
|
||||
await expectSubagentCall(rig, TEST_AGENTS.TESTING_AGENT.name);
|
||||
|
||||
expect(readme).not.toContain('TODO: update the README.');
|
||||
expect(toolLogs.some((l) => l.toolRequest.name === 'generalist')).toBe(
|
||||
false,
|
||||
);
|
||||
expect(isSubagentCalled(toolLogs, 'generalist')).toBe(false);
|
||||
},
|
||||
});
|
||||
|
||||
@@ -219,14 +246,11 @@ describe('subagent eval test cases', () => {
|
||||
'package.json': MOCK_PACKAGE_JSON,
|
||||
},
|
||||
assert: async (rig, _result) => {
|
||||
const toolLogs = rig.readToolLogs() as Array<{
|
||||
toolRequest: { name: string };
|
||||
}>;
|
||||
await rig.expectToolCallSuccess(['database-agent']);
|
||||
const toolLogs = rig.readToolLogs();
|
||||
await expectSubagentCall(rig, TEST_AGENTS.DATABASE_AGENT.name);
|
||||
|
||||
// Ensure the generalist and other irrelevant specialists were not invoked
|
||||
const uncalledAgents = [
|
||||
'generalist',
|
||||
TEST_AGENTS.DOCS_AGENT.name,
|
||||
TEST_AGENTS.TESTING_AGENT.name,
|
||||
TEST_AGENTS.CSS_AGENT.name,
|
||||
@@ -239,10 +263,9 @@ describe('subagent eval test cases', () => {
|
||||
];
|
||||
|
||||
for (const agentName of uncalledAgents) {
|
||||
expect(toolLogs.some((l) => l.toolRequest.name === agentName)).toBe(
|
||||
false,
|
||||
);
|
||||
expect(isSubagentCalled(toolLogs, agentName)).toBe(false);
|
||||
}
|
||||
expect(isSubagentCalled(toolLogs, 'generalist')).toBe(false);
|
||||
},
|
||||
});
|
||||
|
||||
@@ -274,14 +297,11 @@ describe('subagent eval test cases', () => {
|
||||
'package.json': MOCK_PACKAGE_JSON,
|
||||
},
|
||||
assert: async (rig, _result) => {
|
||||
const toolLogs = rig.readToolLogs() as Array<{
|
||||
toolRequest: { name: string };
|
||||
}>;
|
||||
await rig.expectToolCallSuccess(['database-agent']);
|
||||
const toolLogs = rig.readToolLogs();
|
||||
await expectSubagentCall(rig, TEST_AGENTS.DATABASE_AGENT.name);
|
||||
|
||||
// Ensure the generalist and other irrelevant specialists were not invoked
|
||||
const uncalledAgents = [
|
||||
'generalist',
|
||||
TEST_AGENTS.DOCS_AGENT.name,
|
||||
TEST_AGENTS.TESTING_AGENT.name,
|
||||
TEST_AGENTS.CSS_AGENT.name,
|
||||
@@ -294,10 +314,9 @@ describe('subagent eval test cases', () => {
|
||||
];
|
||||
|
||||
for (const agentName of uncalledAgents) {
|
||||
expect(toolLogs.some((l) => l.toolRequest.name === agentName)).toBe(
|
||||
false,
|
||||
);
|
||||
expect(isSubagentCalled(toolLogs, agentName)).toBe(false);
|
||||
}
|
||||
expect(isSubagentCalled(toolLogs, 'generalist')).toBe(false);
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"I'll check the dynamic content page on the localhost server."},{"functionCall":{"name":"browser_agent","args":{"task":"Navigate to http://127.0.0.1:18923/dynamic.html, wait for the dynamic content to load, then capture the accessibility tree and report what content appeared"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":40,"totalTokenCount":140}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"I'll check the dynamic content page on the localhost server."},{"functionCall":{"name":"invoke_agent","args":{"agent_name":"browser_agent","prompt":"Navigate to http://127.0.0.1:18923/dynamic.html, wait for the dynamic content to load, then capture the accessibility tree and report what content appeared"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":40,"totalTokenCount":140}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"navigate_page","args":{"url":"http://127.0.0.1:18923/dynamic.html"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":20,"totalTokenCount":120}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"wait_for","args":{"selector":"#dynamic-content","state":"visible","timeout":5000}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":150,"candidatesTokenCount":25,"totalTokenCount":175}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"take_snapshot","args":{}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":180,"candidatesTokenCount":15,"totalTokenCount":195}}]}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"I'll fill out the contact form on the localhost server."},{"functionCall":{"name":"browser_agent","args":{"task":"Navigate to http://127.0.0.1:18923/form.html, fill in the name field with 'Test User', the email field with 'test@example.com', the message field with 'Hello World', and submit the form"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":50,"totalTokenCount":150}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"I'll fill out the contact form on the localhost server."},{"functionCall":{"name":"invoke_agent","args":{"agent_name":"browser_agent","prompt":"Navigate to http://127.0.0.1:18923/form.html, fill in the name field with 'Test User', the email field with 'test@example.com', the message field with 'Hello World', and submit the form"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":50,"totalTokenCount":150}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"navigate_page","args":{"url":"http://127.0.0.1:18923/form.html"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":20,"totalTokenCount":120}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"fill","args":{"selector":"#name","value":"Test User"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":150,"candidatesTokenCount":25,"totalTokenCount":175}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"fill","args":{"selector":"#email","value":"test@example.com"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":180,"candidatesTokenCount":25,"totalTokenCount":205}}]}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"I'll go through the multi-step flow on the localhost server."},{"functionCall":{"name":"browser_agent","args":{"task":"Navigate to http://127.0.0.1:18923/multi-step/step1.html, fill in 'testuser' as the username, click Next, then on step 2 select 'Option B' and click Finish. Report the final result page content."}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":50,"totalTokenCount":150}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"I'll go through the multi-step flow on the localhost server."},{"functionCall":{"name":"invoke_agent","args":{"agent_name":"browser_agent","prompt":"Navigate to http://127.0.0.1:18923/multi-step/step1.html, fill in 'testuser' as the username, click Next, then on step 2 select 'Option B' and click Finish. Report the final result page content."}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":50,"totalTokenCount":150}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"navigate_page","args":{"url":"http://127.0.0.1:18923/multi-step/step1.html"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":20,"totalTokenCount":120}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"fill","args":{"selector":"#username","value":"testuser"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":150,"candidatesTokenCount":25,"totalTokenCount":175}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"click","args":{"selector":"#next-btn"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":180,"candidatesTokenCount":20,"totalTokenCount":200}}]}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"I'll navigate to the localhost page and read its content using the browser agent."},{"functionCall":{"name":"browser_agent","args":{"task":"Navigate to http://127.0.0.1:18923/index.html and tell me the page title and list all links on the page"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":40,"totalTokenCount":140}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"I'll navigate to the localhost page and read its content using the browser agent."},{"functionCall":{"name":"invoke_agent","args":{"agent_name":"browser_agent","prompt":"Navigate to http://127.0.0.1:18923/index.html and tell me the page title and list all links on the page"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":40,"totalTokenCount":140}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"navigate_page","args":{"url":"http://127.0.0.1:18923/index.html"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":20,"totalTokenCount":120}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"take_snapshot","args":{}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":150,"candidatesTokenCount":20,"totalTokenCount":170}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"complete_task","args":{"result":{"success":true,"summary":"Page title is 'Test Fixture - Home'. Found 3 links: Contact Form (/form.html), Multi-Step Flow (/multi-step/step1.html), Dynamic Content (/dynamic.html)."}}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":200,"candidatesTokenCount":40,"totalTokenCount":240}}]}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"I'll take a screenshot of the localhost test page."},{"functionCall":{"name":"browser_agent","args":{"task":"Navigate to http://127.0.0.1:18923/index.html and take a screenshot of the page"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":35,"totalTokenCount":135}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"I'll take a screenshot of the localhost test page."},{"functionCall":{"name":"invoke_agent","args":{"agent_name":"browser_agent","prompt":"Navigate to http://127.0.0.1:18923/index.html and take a screenshot of the page"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":35,"totalTokenCount":135}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"navigate_page","args":{"url":"http://127.0.0.1:18923/index.html"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":20,"totalTokenCount":120}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"take_screenshot","args":{}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":150,"candidatesTokenCount":15,"totalTokenCount":165}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"complete_task","args":{"result":{"success":true,"summary":"Screenshot captured of the localhost test fixture home page showing the heading, navigation links, and footer.","data":{"screenshotTaken":true}}}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":200,"candidatesTokenCount":40,"totalTokenCount":240}}]}
|
||||
|
||||
@@ -54,7 +54,9 @@ describe('browser-agent-localhost', () => {
|
||||
|
||||
const toolLogs = rig.readToolLogs();
|
||||
const browserAgentCall = toolLogs.find(
|
||||
(t) => t.toolRequest.name === 'browser_agent',
|
||||
(t) =>
|
||||
t.toolRequest.name === 'invoke_agent' &&
|
||||
JSON.parse(t.toolRequest.args).agent_name === 'browser_agent',
|
||||
);
|
||||
expect(
|
||||
browserAgentCall,
|
||||
@@ -79,7 +81,9 @@ describe('browser-agent-localhost', () => {
|
||||
|
||||
const toolLogs = rig.readToolLogs();
|
||||
const browserAgentCall = toolLogs.find(
|
||||
(t) => t.toolRequest.name === 'browser_agent',
|
||||
(t) =>
|
||||
t.toolRequest.name === 'invoke_agent' &&
|
||||
JSON.parse(t.toolRequest.args).agent_name === 'browser_agent',
|
||||
);
|
||||
expect(
|
||||
browserAgentCall,
|
||||
@@ -104,7 +108,9 @@ describe('browser-agent-localhost', () => {
|
||||
|
||||
const toolLogs = rig.readToolLogs();
|
||||
const browserAgentCall = toolLogs.find(
|
||||
(t) => t.toolRequest.name === 'browser_agent',
|
||||
(t) =>
|
||||
t.toolRequest.name === 'invoke_agent' &&
|
||||
JSON.parse(t.toolRequest.args).agent_name === 'browser_agent',
|
||||
);
|
||||
expect(
|
||||
browserAgentCall,
|
||||
@@ -129,7 +135,9 @@ describe('browser-agent-localhost', () => {
|
||||
|
||||
const toolLogs = rig.readToolLogs();
|
||||
const browserAgentCall = toolLogs.find(
|
||||
(t) => t.toolRequest.name === 'browser_agent',
|
||||
(t) =>
|
||||
t.toolRequest.name === 'invoke_agent' &&
|
||||
JSON.parse(t.toolRequest.args).agent_name === 'browser_agent',
|
||||
);
|
||||
expect(
|
||||
browserAgentCall,
|
||||
@@ -154,7 +162,9 @@ describe('browser-agent-localhost', () => {
|
||||
|
||||
const toolLogs = rig.readToolLogs();
|
||||
const browserCalls = toolLogs.filter(
|
||||
(t) => t.toolRequest.name === 'browser_agent',
|
||||
(t) =>
|
||||
t.toolRequest.name === 'invoke_agent' &&
|
||||
JSON.parse(t.toolRequest.args).agent_name === 'browser_agent',
|
||||
);
|
||||
expect(browserCalls.length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"I'll open https://example.com and check the page title for you."},{"functionCall":{"name":"browser_agent","args":{"task":"Open https://example.com and get the page title"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":35,"totalTokenCount":135}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"I'll open https://example.com and check the page title for you."},{"functionCall":{"name":"invoke_agent","args":{"agent_name":"browser_agent","prompt":"Open https://example.com and get the page title"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":35,"totalTokenCount":135}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"navigate_page","args":{"url":"https://example.com"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":20,"totalTokenCount":120}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"take_snapshot","args":{}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":150,"candidatesTokenCount":20,"totalTokenCount":170}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"complete_task","args":{"result":{"success":true,"summary":"The page title is 'Example Domain'."}}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":200,"candidatesTokenCount":30,"totalTokenCount":230}}]}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"I'll launch two browser agents concurrently to check both repositories."},{"functionCall":{"name":"browser_agent","args":{"task":"Navigate to https://example.com and get the page title"}}},{"functionCall":{"name":"browser_agent","args":{"task":"Navigate to https://example.com and get the page title"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":50,"totalTokenCount":150}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"I'll launch two browser agents concurrently to check both repositories."},{"functionCall":{"name":"invoke_agent","args":{"agent_name":"browser_agent","prompt":"Navigate to https://example.com and get the page title"}}},{"functionCall":{"name":"invoke_agent","args":{"agent_name":"browser_agent","prompt":"Navigate to https://example.com and get the page title"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":50,"totalTokenCount":150}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"navigate_page","args":{"url":"https://example.com"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":20,"totalTokenCount":120}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"navigate_page","args":{"url":"https://example.com"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":20,"totalTokenCount":120}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"take_snapshot","args":{}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":150,"candidatesTokenCount":15,"totalTokenCount":165}}]}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"I'll navigate to https://example.com and analyze the links on the page."},{"functionCall":{"name":"browser_agent","args":{"task":"Go to https://example.com and find all links on the page, then describe them"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":40,"totalTokenCount":140}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"I'll navigate to https://example.com and analyze the links on the page."},{"functionCall":{"name":"invoke_agent","args":{"agent_name":"browser_agent","prompt":"Go to https://example.com and find all links on the page, then describe them"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":40,"totalTokenCount":140}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"navigate_page","args":{"url":"https://example.com"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":20,"totalTokenCount":120}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"take_snapshot","args":{}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":150,"candidatesTokenCount":20,"totalTokenCount":170}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"complete_task","args":{"result":{"success":true,"summary":"Found one link on https://example.com: 'More information...' linking to the IANA website for details about reserved domains."}}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":200,"candidatesTokenCount":40,"totalTokenCount":240}}]}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"I'll help you open https://example.com and analyze the page. Let me use the browser agent to navigate and capture the page information."},{"functionCall":{"name":"browser_agent","args":{"task":"Navigate to https://example.com and capture the accessibility tree to get the page title and main content"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":50,"totalTokenCount":150}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"I'll help you open https://example.com and analyze the page. Let me use the browser agent to navigate and capture the page information."},{"functionCall":{"name":"invoke_agent","args":{"agent_name":"browser_agent","prompt":"Navigate to https://example.com and capture the accessibility tree to get the page title and main content"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":50,"totalTokenCount":150}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"navigate_page","args":{"url":"https://example.com"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":30,"totalTokenCount":130}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"take_snapshot","args":{}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":150,"candidatesTokenCount":20,"totalTokenCount":170}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"complete_task","args":{"result":{"success":true,"summary":"Successfully navigated to https://example.com. The page title is 'Example Domain' and the main content states: 'This domain is for use in illustrative examples in documents.'"}}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":200,"candidatesTokenCount":40,"totalTokenCount":240}}]}
|
||||
|
||||
@@ -1,8 +1,26 @@
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"I'll browse to example.com twice to verify the content. Let me first check the page title, then check the links on the page."},{"functionCall":{"name":"browser_agent","args":{"task":"Navigate to https://example.com and tell me the page title using the accessibility tree"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":50,"totalTokenCount":150}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"navigate_page","args":{"url":"https://example.com"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":30,"totalTokenCount":130}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"take_snapshot","args":{}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":150,"candidatesTokenCount":20,"totalTokenCount":170}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"complete_task","args":{"result":{"success":true,"summary":"Page title is 'Example Domain'."}}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":200,"candidatesTokenCount":40,"totalTokenCount":240}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"The page title is 'Example Domain'. Now let me check the links on the page."},{"functionCall":{"name":"browser_agent","args":{"task":"Take a snapshot of the accessibility tree on the currently open page and tell me about any links"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":200,"candidatesTokenCount":50,"totalTokenCount":250}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"take_snapshot","args":{}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":150,"candidatesTokenCount":20,"totalTokenCount":170}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"complete_task","args":{"result":{"success":true,"summary":"Found a link 'More information...' pointing to iana.org."}}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":200,"candidatesTokenCount":40,"totalTokenCount":240}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"I browsed example.com twice using persistent browser sessions:\n\n1. **First visit**: Page title is 'Example Domain'\n2. **Second visit**: Found a link 'More information...' pointing to iana.org\n\nThe browser stayed open between both visits, confirming persistent session management works correctly."}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":300,"candidatesTokenCount":60,"totalTokenCount":360}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"I will invoke the browser agent to get the page title of example.com."}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":10491,"candidatesTokenCount":16,"totalTokenCount":10587,"promptTokensDetails":[{"modality":"TEXT","tokenCount":10491}],"thoughtsTokenCount":80}},{"candidates":[{"content":{"parts":[{"functionCall":{"name":"invoke_agent","args":{"prompt":"Navigate to example.com and return the page title.","agent_name":"browser_agent"},"id":"1zgnzmz8"},"thoughtSignature":"EpgDCpUDAb4+9vtATVUpO7R/Du3cyW+qLtXqHV5MxjoY/uOyN6tesv96PEfcvXarQ/u24REH9DCw2AIG00h9WM2jRtfgbU544f4lEQn0dLEkAJCQaiBcxx8yPND+qKmwq8PFHo6ESQs3nssi3XOqfiA7YMxxY2vEx4GDZfieEeS/nyTe3F7A7dEoMnE2VnMWRVdAAW1F2K2ZeDQZSDrJxtelkn0dGd/MS0R6iNDENWg9QWJQlok4xttspRJFLS5BvkvnkBcUWQFQlo60AQb1Vbo8MQvV8WHUPORRePj4iW3IyxOohmb7uMfDo7UiRyv3Li8AAga7+oSUU9HSf5XZrjSL0juzJpYxxCqnIuj1/ZIY5SBSwGAWKuLQwmbo433bKij9HnY8n/MeNiDgwMiBX56mNlAOIqVLR9Qskod14H4hB+xAbvFy8j8hwf3hksLGjhM9BTBlcBQ2dbor5OUmZ/C7XsnLZvnhw+in7ji2tHz/68/4gmIN08khU1BRvfZdxtX8eQoVLcCfvwkGX7/drD9bM0TrjZuWXh9o"}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":10491,"candidatesTokenCount":52,"totalTokenCount":10623,"promptTokensDetails":[{"modality":"TEXT","tokenCount":10491}],"thoughtsTokenCount":80}},{"candidates":[{"content":{"parts":[{"text":""}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":10491,"candidatesTokenCount":52,"totalTokenCount":10623,"cachedContentTokenCount":8126,"promptTokensDetails":[{"modality":"TEXT","tokenCount":10491}],"cacheTokensDetails":[{"modality":"TEXT","tokenCount":8126}],"thoughtsTokenCount":80}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"list_pages","args":{"wait_for_previous":true},"id":"q9a8dwir"},"thoughtSignature":"Et4DCtsDAb4+9vtRa6LmDS0G8Z6sSxYi8TMEuRycQ7Zi/yYxo5sLhVJnIqMZdJiq+q2ZgvFiS9xxX6rrUTj+a5eEN2UrHC5MmzKVu9TSMs/Vd1XV9ayzef54tmsLy7PDb5Ja1ZPo8iRHIvnleWw/JgcwckXRPO/NwAyFfmYQ9lM93nRbZxnQQ12jBjS9R0f+TkGZyy26HDLl09w0psqNW8fwCm+nWc+Ouf8V/Gu6QOTh+VBZo+JP0HbMm25IHc7BlKoMtKNj9C0BVTVXyEzKelCiciR3VcfqdqdMmaVK8UXWGtcEnwyaObbtOPlav0sTFhHZsmV6P4HKUFoiYM/An2p66sGA4YwZYnhTsSXmbxb2pVNQWTjVJaRyJOsBnAiA5sxqqR/exo84YDsvBzGJ/1Y99Q/vHRNWVKgwfV8k5mkV7zLxJmh5oILaEHGYCVriVd/v419qWUZv3QAu0vcWwoqc65SZtfkG1JKMfrPuWXk8i1s2dSYwGg7tCtL8laocy0+l14ga8sxAsmvWAnVUQCANTxyvQDFuEMReyr2cjQjQXohbm2Q02wGXvkYXT9UW15V+KTdt8DmR28x0mZBseIJOAjmx9ZyaGibOMc72UbS+tf93RVGRO3Fey60+uhQvGA=="}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":8627,"candidatesTokenCount":18,"totalTokenCount":8742,"promptTokensDetails":[{"modality":"TEXT","tokenCount":8627}],"thoughtsTokenCount":97}},{"candidates":[{"content":{"parts":[{"text":""}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":8627,"candidatesTokenCount":18,"totalTokenCount":8742,"cachedContentTokenCount":8066,"promptTokensDetails":[{"modality":"TEXT","tokenCount":8627}],"cacheTokensDetails":[{"modality":"TEXT","tokenCount":8066}],"thoughtsTokenCount":97}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"new_page","args":{"url":"http://example.com","wait_for_previous":true},"id":"q8jik45z"},"thoughtSignature":"EokFCoYFAb4+9vtsenxLqqQxdEMBTS84fPfG1xsGHJ6JckbLR97g7mCgljX8/CJ1z+uvP6l7W4264EE9XzgkhYVWK40uD2/HSBRetjIAKPB2RgX0/fjj1xDNMUoQ78W2Dg3WUTyT9VFI6RzHkW/Fu9fKCRm0jGVV6zvEnXJzbITkRoxe+F/AOOz31fZwBczgz1+qCoKi1TKclEK/gVcXbsf9z36+Ufz1yoOr0gRlDO0UjaDW+G7uV3ojB70KzA1IK3bYcsSUGQJKJBzBbst8OPYPuNRQbhlmp7jub5wgT1yXChpkP/0UgNXGKI4E/dzCvZlefcVvZNE3LiODSy/yS/jqcHk3ftVneKsReikKxFveYoPPl0U0+gpt87HRpDqkrUuAyK3+5lDqXn1q7WRE133lc6ZCTVka1QzH5Ovd/L4nk9n+hHDSxtefwED6s3sNjbKoAdFedr2xkZp+Kjd0vNeM6ryYkc9oWumrcrw9lQbYqluDlDx7J29B9p8BxJSFdoUjh6Bkx0WTHR8vwXUxOWh+ptgZlPlhj7k9qzUNQXZGizwoSE/EduYLux8X6uok2DX3pTABOJ9Cy9K1soVIeOGW+KPtkQoCOgHkSZ+CHX6b5By0DQzgPyqD2m+vAl7cbIYaOXRHFoBc/P7+7FbTeUJl8/C/XvpJ8feXKiB9d48uf9NARA5NRsT1q24Qvmsj2cXGEqJlpWxUWhbAn074dApx+pavchReA2B1AF71DI8K9OtoEh1x0njUQ1Wlfysuwo/0rq7nkXWz84vE6DQ0V5YMnOn5RYxMUcgSFHpWhhGkwoJRTw2MA5VT+NjTTzmjCxPklsu018ZafYGci8mIfqRf663nBjulz3qxyA=="}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":8669,"candidatesTokenCount":28,"totalTokenCount":8841,"promptTokensDetails":[{"modality":"TEXT","tokenCount":8669}],"thoughtsTokenCount":144}},{"candidates":[{"content":{"parts":[{"text":""}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":8766,"candidatesTokenCount":28,"totalTokenCount":8938,"cachedContentTokenCount":8059,"promptTokensDetails":[{"modality":"TEXT","tokenCount":8766}],"cacheTokensDetails":[{"modality":"TEXT","tokenCount":8059}],"thoughtsTokenCount":144}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"navigate_page","args":{"wait_for_previous":true,"url":"https://example.com","type":"url"},"id":"chnx16bz"},"thoughtSignature":"Et4DCtsDAb4+9vunBo00wroGvRnP/utICWzc0KfwQAhL4ReRSPB5X18M7/F2wrQNz4jGT9I5S8hnAUJlpFqiJT51c4AodbVSzm9Xy1Z+yPZ8nl73dMEoGvDDNSo3BYBEA8nGpub4iemIFGHm1int/IKrtC2H7QnnnMfdtsKJHNInaXhS6RUHEC0mlSPBS15+Y6QDKDPGqbm2zI/AsRKNa+lQ4FtRyep85yKzjquQkLjh2f/NKDz+Ur8FQvGyOXAPwJF6xE4OpciShNrAilEaWmc/D0XJ3k7X6L2mrKjs3E1kD/HzaZNh7DrN+yc7sbwmKyfzIjtuD7/9RWaFwr19imxR1rmXafssWFxesYR+LVjek0EHMNBXga/4jbY4WW+aN/Fcr+/yIvguT4XGuTjq9aWkQ4ZjInKzePi623saNK69/Jv8qr2+gtOPeHpuqnA8R/Gm+C+3FFLDzlfkZHSiW4JFqrtegZwihyBxxKtNWy4QHGajrJ4iH8jh5O95nOLpiSu/0ifl6havb4gtiCf71hEH/NNAhv8WAcyHhcjfjGQTY6XzIYOLv7nFKjmszzcKwbqFqE4mX/CRjnKABJAx6WeZD5BkrOz+oXNJSonJmttXOjY10KOMvvrJ5NpWMTmpfg=="}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":8726,"candidatesTokenCount":34,"totalTokenCount":8855,"promptTokensDetails":[{"modality":"TEXT","tokenCount":8726}],"thoughtsTokenCount":95}},{"candidates":[{"content":{"parts":[{"text":""}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":8967,"candidatesTokenCount":34,"totalTokenCount":9096,"cachedContentTokenCount":8053,"promptTokensDetails":[{"modality":"TEXT","tokenCount":8967}],"cacheTokensDetails":[{"modality":"TEXT","tokenCount":8053}],"thoughtsTokenCount":95}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"navigate_page","args":{"wait_for_previous":true,"url":"http://example.com","type":"url"},"id":"dh6nh7uc"},"thoughtSignature":"EqkFCqYFAb4+9vt7hpma0fd/eZEmeYjbwxo6ESmIHiPzZ+MZPJfsSgUlrXp6Af/94mxXL3Nwc+FPDJ5JNaOhQ+/kFjYryOE7oXPUXb0ytTSW7zNxqFlUFVA55SaTsL5OIRLQ3uy9tUJogHBIOgWI7KXipmI1v+IIR8szhGyVCs8Ie+kAS7JczmtNPZAPXAFQGTnXB4zo1mRxTBennBrS48ptuFh0wSFRTeKJ+0LX0c8mh1QKd9yVoN51syU6Z6Q9T557aelXF2KAZFgR+daNvZW3dMTE5FTV9iQR4hJlrYu+eyukPIBljBUFBP+5wDcrs4lWVI2sfOlXDQE1yfZTlOGSCBQYZ46XbVdAF00Vw+seeulRvEgo8s8ocmZdn5+yRqgonxAJSiySeYM+nIscJA3YZQpuZVdS/SrHLO/ilIEV6jyg1xrAc7Rcy5gViENkTI2MZvSFpyVxr01vO+WbCiRavEbdaTppGoGcSJM02qlPwbH2tGgXk0ennSd6AbNLAHX+9QkkCjb6tQc6f8nv3GHa3U3Tie38I9NZ5e22gn4xZTpgZ3iWeGN5BNxO1DnB0HO3TBkf0g8jMMOt0cSehW37/603ItlOCwCpUjWr6d0g88u0HXsRHebdxqDWebHs57RchcYteKda+MJvmCxWgoB4GT3xwa+lgkS+MSLIQgjdEAXHnUJ+iTWixUpnWsm9DQYxPy3nylpUD6Ohmu2/kw80NoVLL6dD8oCDEVa255EqJvTCfTUMvOCrLpFVObto4bLAdfkTBj/cyqdDFeWa+mqnt2g/GNryWW7JHa7SMBplmcNIGMjMa5FRalko0owgySklPNbMzmc2w+PXwxjaezEzITt2vdOZ3GZGpio8DznTfPdLcaDXLljhYvk8KVO7Ex42J9WJiFxRsqrp"}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":8823,"candidatesTokenCount":34,"totalTokenCount":9004,"promptTokensDetails":[{"modality":"TEXT","tokenCount":8823}],"thoughtsTokenCount":147}},{"candidates":[{"content":{"parts":[{"text":""}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":9159,"candidatesTokenCount":34,"totalTokenCount":9340,"cachedContentTokenCount":8047,"promptTokensDetails":[{"modality":"TEXT","tokenCount":9159}],"cacheTokensDetails":[{"modality":"TEXT","tokenCount":8047}],"thoughtsTokenCount":147}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"take_snapshot","args":{"wait_for_previous":true},"id":"prantos8"},"thoughtSignature":"EogECoUEAb4+9vs2VKT5xUS9DU5U+/45Ty62Y8FY+X9StlepMysDdL7n3ce4fR7jA3v6MINt6Tcd52eU1+ZO5t4eqNwOOB0kngJ/QLVAFl8Izm1J/+D6Mqs+U3gSRJ8BsRUxBXdBFieHhNuQh76nPL4rEfBWIRlusG09H8So9++loPfjlSX+9Pcb99sG3RdVT2ZXQg6GMq15x+iGr62tz8DZCB5xnTEPE3LfwhJutlJtDbK/kbzOs7ureURbR1MQ/3/36Igl8mii3DV3PIIPIeo5CuByB1Ha6aJ/JWHV+ssmeBeE0oczCt7xC5VhHXM9j8JgUKx/sKrC+aecYSDe6oAFSpoUfMUUVPcpzTuIp0WoW5YDe9wvt/49o5pwWgRcjIlWdpYMrM83dMIG1BvD7qNU/OCsK9m0bxd40nvfmtj0PQxKMHDtBHw/RfvM85iHNrzPsHY+ZcI6y79sthxxoNdBllfgHBDi54EDSl551jgnAC90KoozJryBMCP5ZKWPgtsPoXhvbNOnyz/9HlME7p31RbA03/3NwjS8V01G8YDtG1HrmEZKtlrIW/G19DjBVlhoEuYpkKUmX57ck0rbxW4egvwDcQjcQX7QaJIWwyIUvhseImIObGLBxVuSBP1Jjef9nelxWG20k+BafZbHVg1jMPCiKJpreD7relu4L2Y0yk8ChGG3Sx2luw=="}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":8920,"candidatesTokenCount":18,"totalTokenCount":9060,"promptTokensDetails":[{"modality":"TEXT","tokenCount":8920}],"thoughtsTokenCount":122}},{"candidates":[{"content":{"parts":[{"text":""}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":9403,"candidatesTokenCount":18,"totalTokenCount":9543,"cachedContentTokenCount":8043,"promptTokensDetails":[{"modality":"TEXT","tokenCount":9403}],"cacheTokensDetails":[{"modality":"TEXT","tokenCount":8043}],"thoughtsTokenCount":122}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"click","args":{"wait_for_previous":true,"uid":"1_12"},"id":"r79qt569"},"thoughtSignature":"EogCCoUCAb4+9vt60822Xp/P+yQ5WNfvAKPF0LS6q0a47hBm0WrzbxwEB/HBzw14/ywGVT0tGNCypHm6ZWVht+ZgHJoxA2WtHDOdRbdjsvvmJaIBIjI3wPSiVc2dm2S9qVKlCER5uMwhW5aHbgmax/F0TSHej+g1P4+uOq2cJeAZ3iqgCcyROYji/O/eKWIBqaB6Wu10KtUvj0M9Dd+K0GkPpjNIvw17IS2jUxu/yPPZ9m6CSSFrdhaA7R4YXaE4L6qISdcdBxgsiSRkI/m+0f3J2/1jPk24y6GjrWEiejKCpfMw+sHTnTaEABh8Unih31eRkR7/WmcyGu9/IUMXREEo3W3ddIGFgCS0"}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":9210,"candidatesTokenCount":25,"totalTokenCount":9275,"promptTokensDetails":[{"modality":"TEXT","tokenCount":9210}],"thoughtsTokenCount":40}},{"candidates":[{"content":{"parts":[{"text":""}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":9815,"candidatesTokenCount":25,"totalTokenCount":9880,"cachedContentTokenCount":8041,"promptTokensDetails":[{"modality":"TEXT","tokenCount":9815}],"cacheTokensDetails":[{"modality":"TEXT","tokenCount":8041}],"thoughtsTokenCount":40}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"take_snapshot","args":{"wait_for_previous":true},"id":"3f6suk04"},"thoughtSignature":"EpEBCo4BAb4+9vvrysVAn4EZuigwkHrOkiDNXb0u0bGnAPKivQ0/NoR5aEg2NSa74y1Llo7ifzocwWsiqG+q0erh7yiacc0ypevnjpkJ9nfDrNOVoGZIz+OusBXs3AqPmMaNOiFCYFgOnNXIJNiZwkNSjrdSR7yr9T1L/+MfiXSS8Qy5ySSrlWyjjY/EBK0/vp4VHg=="}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":9251,"candidatesTokenCount":18,"totalTokenCount":9287,"promptTokensDetails":[{"modality":"TEXT","tokenCount":9251}],"thoughtsTokenCount":18}},{"candidates":[{"content":{"parts":[{"text":""}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":9896,"candidatesTokenCount":18,"totalTokenCount":9932,"cachedContentTokenCount":8034,"promptTokensDetails":[{"modality":"TEXT","tokenCount":9896}],"cacheTokensDetails":[{"modality":"TEXT","tokenCount":8034}],"thoughtsTokenCount":18}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"click","args":{"wait_for_previous":true,"uid":"2_3"},"id":"4hcr39ek"},"thoughtSignature":"EpoBCpcBAb4+9vtqGpRZfxSRRNqP+Yla/FpN5SRI6mbuvYI3+uUz6bG0Z3yxd6JeCbYM0+JCfyXOCbwZzRrdyf+cGGs0LjFlsRNEHbgjCzoGhN9dZdFzbHvFuXZMwaeCKP5BIWKtHjCPrtEwfsBO+HUnUqV5XeBB9zEfA8fgoPZm5y27ip8eyeYKtQarCXvaX9nIqygKNqGzxb/L4Q=="}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":9666,"candidatesTokenCount":24,"totalTokenCount":9714,"promptTokensDetails":[{"modality":"TEXT","tokenCount":9666}],"thoughtsTokenCount":24}},{"candidates":[{"content":{"parts":[{"text":""}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":10329,"candidatesTokenCount":24,"totalTokenCount":10377,"cachedContentTokenCount":8033,"promptTokensDetails":[{"modality":"TEXT","tokenCount":10329}],"cacheTokensDetails":[{"modality":"TEXT","tokenCount":8033}],"thoughtsTokenCount":24}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"take_snapshot","args":{"wait_for_previous":true},"id":"a7323k6z"},"thoughtSignature":"EoABCn4Bvj72+wrxMO/2uA1RwpvzkuM4xNaslnr/+xfZy/iqwCHZyR5bvsFfsovWYzjzolMLSmvVdGYx/bw6F1ewM3LohjPmEXdiLFI1fEBxNK0166QB6XdOGucHJbItjxzekY2hTYcMJTZWLArFaCl5+wxhLWXAE/zkj3TInmRSPRc="}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":9469,"candidatesTokenCount":18,"totalTokenCount":9503,"promptTokensDetails":[{"modality":"TEXT","tokenCount":9469}],"thoughtsTokenCount":16}},{"candidates":[{"content":{"parts":[{"text":""}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":10156,"candidatesTokenCount":18,"totalTokenCount":10190,"cachedContentTokenCount":8022,"promptTokensDetails":[{"modality":"TEXT","tokenCount":10156}],"cacheTokensDetails":[{"modality":"TEXT","tokenCount":8022}],"thoughtsTokenCount":16}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"complete_task","args":{"result":{"success":true,"summary":"Successfully navigated to example.com and found the page title: \"Example Domain\""},"wait_for_previous":true},"id":"81koewoz"},"thoughtSignature":"EoYBCoMBAb4+9vsiO1ru68XCJ6gZ+FKthHSwWAdj1b92U7qX4bVZ5j2kaNJFs3EYNsAdZHtkWLKLugPhFT1j9DXaptDYSfnbBbY/gEH5PW0RizHMI9VUQ6rvAyjrfUNh5ga7RuIEeRy3y0uCrglSx0JCOj2gtXG5kwGJDqT6YqTKjXvk3R0DRLg="}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":9606,"candidatesTokenCount":45,"totalTokenCount":9665,"promptTokensDetails":[{"modality":"TEXT","tokenCount":9606}],"thoughtsTokenCount":14}},{"candidates":[{"content":{"parts":[{"text":""}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":10309,"candidatesTokenCount":45,"totalTokenCount":10368,"cachedContentTokenCount":8017,"promptTokensDetails":[{"modality":"TEXT","tokenCount":10309}],"cacheTokensDetails":[{"modality":"TEXT","tokenCount":8017}],"thoughtsTokenCount":14}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"I will invoke the browser agent a"}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":10603,"candidatesTokenCount":7,"totalTokenCount":10649,"promptTokensDetails":[{"modality":"TEXT","tokenCount":10603}],"thoughtsTokenCount":39}},{"candidates":[{"content":{"parts":[{"text":" second time to check for links on example.com."}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":10603,"candidatesTokenCount":19,"totalTokenCount":10661,"promptTokensDetails":[{"modality":"TEXT","tokenCount":10603}],"thoughtsTokenCount":39}},{"candidates":[{"content":{"parts":[{"functionCall":{"name":"invoke_agent","args":{"prompt":"Navigate to example.com and list all the links on the page.","agent_name":"browser_agent"},"id":"rn9rpbw6"},"thoughtSignature":"EosCCogCAb4+9vt0QmjCmkrGoIi1HLtLRARGxmKpP3a2ZF8HrZLv4bfHC1a7d5a1BlPllShIkkAjL1RZmTe9tjpulNV7xsavrWINRdkfrNqC/on1h+F3nhQAa3HBbf4AWWH/AHmVPlUsVDr19hq4NLLL3hxFg04Fb1YEgRDHrjWOs3Oy9SmzdG+MiWv5GFVUM6spjOujO76dKzHZGe7chmMsmE8NhjQ9c/lbWUoXBxJ/72Qs+mRQHpd3p1ufkL0UV8bFtfyJdLTF4iJ/R5kJiqsEN1FtS3PpQaQHsmby7ytEjPX29ps7xp6NO1i/je9p3u+tGXEpnomqdJJ4SvdDJm4XyqO9HTIQxC3jg7mi"}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":10603,"candidatesTokenCount":58,"totalTokenCount":10700,"promptTokensDetails":[{"modality":"TEXT","tokenCount":10603}],"thoughtsTokenCount":39}},{"candidates":[{"content":{"parts":[{"text":""}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":10683,"candidatesTokenCount":58,"totalTokenCount":10780,"cachedContentTokenCount":8119,"promptTokensDetails":[{"modality":"TEXT","tokenCount":10683}],"cacheTokensDetails":[{"modality":"TEXT","tokenCount":8119}],"thoughtsTokenCount":39}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"list_pages","args":{"wait_for_previous":true},"id":"vqfkekqm"},"thoughtSignature":"ErUGCrIGAb4+9vuVZfEoGpZh5UgzOffyNf9rzbFR/OyyQKQAOC8OtObFsJJvFgYIEXxBrnqRr8ijpJpQN0T5ibim+epO1Wos/ToAQwbioOjIxAdT9som9mndJSoBmA8D9HtxM6XjZzwf9qoMY2k2lUZjmk1BXRl7nFMtZ/cMQfFAkt2FUYZ64p2Y7xdY3ohweiMXFGbjjWvwCA1akSFa3JkVnfjHXlB3Yl9adrrL2V4h5OunJHbIqbyGxJPqBLyhrrhQbfrEtiVxVR09qqx2F2t3FMxXhMt1PmzhGB/2gAtlezUIvKdAT/c8h0Q4KPNueQP64UwxmKebfUmk6oDqrQG3sP2yF9fIcrqaiSv/DCecr/JYJv2E7Y79zDJV1FsKPKOn2cnpnmy9BgeXK0i2TCuaSm0XWK72EFHcMjqpBb/S5Y+U4DarGHnKGPd9YJ/I+D9NrxUNfJTmZw8wP6RQR0daiPX+APgdQOYXJOtLSXRY6lzS+oGKund7/hLhpHdcLto+UobcFEfNyJGG5+OHheKXCOqCWO602Rx4GFLTOYK/qea/R0QwFLgYZfJhjVIeeEsQvexxX9q/MGvtrilqqMEtHhAe+5QhamgUII8CcDK/15O7rgBbpQxXI+GPOJYMu5O0JMV7jC57DOeDCnslmyTlsqQtN3D5lhL1OKWSHjZmqHiRiSQGx23CdgNQF1ctsSKpB1GdXYqH9N+7TO90p+x0Wqbkfw0yJAF9TKHH9BJYciPSULjFcOLSFWqotQd31fTXur8eNv/fdk7kJZsfqxX50M41bBhwT4ydvy+Q1ao5Nu9TXRF6kGDtcdbeZOzDWZP+2akUH2glgqWSy4i97HG4H+UHqDXMpUtWzVFiJw0NcY6Pdt3XNbT5hO6mSO/A7ZhR8N4RSyw0Nh1eRzZSqu79valUfi+ykuB9s3w4duMmMNpGpHOMNVu+ol2ltY6zrwhFz5TCvo/zXmabLc6kEYu1C1xazAQLGFjxRVpcN8Qft4eN3KZRou5zy3Dp4PtQ+KiX3JfMb2wnuXWZ1CoUNfFnVi0Y5VpzeF7M8Yzi+ZarzcE5XEFSROl3VfxeVZyFlxgZObU83K0="}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":8630,"candidatesTokenCount":18,"totalTokenCount":8823,"promptTokensDetails":[{"modality":"TEXT","tokenCount":8630}],"thoughtsTokenCount":175}},{"candidates":[{"content":{"parts":[{"text":""}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":8630,"candidatesTokenCount":18,"totalTokenCount":8823,"cachedContentTokenCount":8066,"promptTokensDetails":[{"modality":"TEXT","tokenCount":8630}],"cacheTokensDetails":[{"modality":"TEXT","tokenCount":8066}],"thoughtsTokenCount":175}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"navigate_page","args":{"type":"url","url":"https://example.com","wait_for_previous":true},"id":"dsy0oh63"},"thoughtSignature":"ErECCq4CAb4+9vuQlylaFlrtKtYp1EGoDqb9nhSmJ9IPYvmFcBku92rqL1WJU3x2CeLvj0tww69yEodZQSSIJw/4hPtWzLlr3P362ITxFIgvgpzAue5AIjH6EbXJmAcEO8i+I8TV8QneJQiula5HBUdncCTqKycdrjyCKVbAcV1nnkNxbPagAiuumgOaWGPPmE4d+W4Xgbq695Rov0xR0ijSeknqkcf14JKqZqpyuGdMYSDxQhveQS7o4UgrsUhQOgEVc53XqfV5tMjhC7Agpb3WN7zoDUmIAzgbnoG6ha2mJOQ2x3jSRUozLq6fIQ2oZSmb7eajvcGqUxtXp4n4z9cdLpBuHlPB8hfiCxNN0RP60uvaqBtvAFBNfVCbk1eZdxnnvpwQdqp3Ue7H4lzJ9tDBey8="}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":8672,"candidatesTokenCount":34,"totalTokenCount":8765,"promptTokensDetails":[{"modality":"TEXT","tokenCount":8672}],"thoughtsTokenCount":59}},{"candidates":[{"content":{"parts":[{"text":""}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":8847,"candidatesTokenCount":34,"totalTokenCount":8940,"cachedContentTokenCount":8060,"promptTokensDetails":[{"modality":"TEXT","tokenCount":8847}],"cacheTokensDetails":[{"modality":"TEXT","tokenCount":8060}],"thoughtsTokenCount":59}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"navigate_page","args":{"type":"url","wait_for_previous":true,"url":"http://example.com"},"id":"spfjmlgz"},"thoughtSignature":"EqIECp8EAb4+9vs3KbfYgD6JCpaYYtFFyQdv6a7TPEL2cMQCTkaO/7k7goC17ok0NkX13S9xoQmLqXDqDwMnLZd4BcJVZoqeBysjLEOKA6AcP7ZCFPX/84VTtMgvB123l2x5GcXq/9yDmSLqy9B4U+u4cEtdfArQUuFWPh+bGqOCdxlrncTv6c2yReLXSLYUiQMNcV2f51g+giKIeG6Gsdp/RQNVTi1RrVIun4sY6t7Pdogrp2hGXP1VuQDCwzyuHcVPfvVh8oMKdPUywrdaJvzH2/L4F9OoNpmfJkjJZtYdPLFzoDm5uzFV7jNiwvYpeL1/EnpB1nbh2in/i3Q0MH60pf6ik7r4ebcdA9FQ0zjQoRxH3zqTYIH1QaeokwpaHkfKNj/8+Ke1mmmmTf8XNs/cZ4t2EQO3Wp/SVtGbIYq4LvbdZfMhIpFX1dHlAQlo+52xffABzfkqki5Rt7V4+V/9FpARvkBX3/lmK/tr7aVxsne8CRv6JKMtPbjnkKYhm7IeKKt9tEP9ZGDJ9+0kUVBmxnWbmn0cO8PE9vpfrISEakjC4H0YuLWo/ra56t8MJ6aUJNjTHkN5nH6cQuIB8V5vOne534SKs8O4tM7StnYJxneczLe8L6cpk2Wp4W4KWter51N/sr5xpKbo0lN5nq13EoXGe0cSAN8ze0O8LNMmPjrfDcDEZfHlsQPvmwO+w9A9nBU8ObUGDQddKaznrbIhSafH"}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":8763,"candidatesTokenCount":34,"totalTokenCount":8906,"promptTokensDetails":[{"modality":"TEXT","tokenCount":8763}],"thoughtsTokenCount":109}},{"candidates":[{"content":{"parts":[{"text":""}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":8997,"candidatesTokenCount":34,"totalTokenCount":9140,"cachedContentTokenCount":8054,"promptTokensDetails":[{"modality":"TEXT","tokenCount":8997}],"cacheTokensDetails":[{"modality":"TEXT","tokenCount":8054}],"thoughtsTokenCount":109}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"new_page","args":{"url":"http://example.com","wait_for_previous":true},"id":"xa6m1ifg"},"thoughtSignature":"EooGCocGAb4+9vvfzf5F8NnOVWM1Ge5dkpHWzgAx7E3Tjv2BgvQHBaPEtUN22F5ps7pVx8VvtFR773quXuQQFnjAVSgKK7//8P561JvXkK+nl7rh1s01RDLHUE92hemwAcre1xBftHfGlLADiPg3hXKFLyZpXYMWoy5+RY2Vo3FR0jIG6rpThHg7dfb1OhOLGP9d+hgmcpwozn1UVle0ncg/mVHd+uK6jEKt7b6IZAbyNBLUykYPoxCZKtbHYuZyOL55HksF35CD3x4AAn1qOhV/tARjLEWpxLsrnO5ten76un2Guw8pnsFCB0SmZye9Qnr5eSfYc/fs6GE41dRfDyc3+BOSlJWjoxxyRzNfQjAfS2m0SUQ6o6+EtlXqkjCfNnR0moA3HVYTIXlf1QMownc6HOX37OswmwaVf/YfVGxfQM02ysWycgmapGefKkZim4qmdAHqZuEwXn5qCnG1asbPQSLqxIOpBrEEZsiCTpkvtSd3+4oED0jBmEq3x4IU8uW23ujPcsrwppmwLSCyPYx+09xhPdHruywtGAvEhRDzfHYSnW3ZTiu0ZBKKRmPwcKMBn37Z/GjjjeI8HGPCVtP5dbB0vlTsNuNe8lYSWy3H3dOFUIqfsATu6by9QA0SBmvN8/CMgkHlAgofrbhv27XOIQMFzamUmj3bsEXZR5RvCbQ5T0OLM+4y32B0VT9lIhSLijKDo1XaoQ1Erj66RIcv3jvrseTmIFTr8T0tkUkOqir7p1udfbtxWh66kHTd++JAevEJC5HZcmC7MmvGux7gK3NRhhteJ4qOIM+KGW17BukpOOcJxBH3rW8tEJalC30WdqoMM+TBKbxVqBBByU12TeGnEYOxghxnXmPhMOzuwUyTqLUTBCemaQuXowwNArJozzewcw/uY3lSsu0lEy8YCC+BARMmh85jT6JBvvMMThKcNhtul4gBIkOfLDqUjQcFvMs1QBU+kpQP9oHpXluxkY5cdANPG1cU94GJN7PoycJcRju9Vf2Goej+P6ZE+BkPM3f5lQQqBgiLLg=="}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":8854,"candidatesTokenCount":28,"totalTokenCount":9044,"promptTokensDetails":[{"modality":"TEXT","tokenCount":8854}],"thoughtsTokenCount":162}},{"candidates":[{"content":{"parts":[{"text":""}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":9197,"candidatesTokenCount":28,"totalTokenCount":9387,"cachedContentTokenCount":8048,"promptTokensDetails":[{"modality":"TEXT","tokenCount":9197}],"cacheTokensDetails":[{"modality":"TEXT","tokenCount":8048}],"thoughtsTokenCount":162}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"new_page","args":{"url":"https://www.example.com","wait_for_previous":true},"id":"1pxqeqmn"},"thoughtSignature":"Eo4FCosFAb4+9vtx8s8Eo2HJhknUEkVg9w/xZwt/pceuH9eggBkeyIgJbskQCQ32xHqgSXrz5d9p0tiVjYrPFA6h2CVfQP2GFJE4BGGG+QD2cHMweol7asWRXQIM7NiQF+asQE43IYEhBl0EQ0QM9C2/kiQIMyCmXVF6N643ZBjwHFlM72t6spatjj6+z2Ep/B8MycvQoFw5RAvVegJsu1O+Ep8yCZNyCUcx/2Z4bTAt+Grnzwl0o9QI6TDg7kuNWCc4AFnbOGRofB0C5emwEpnDaDH7mS6TujFpoDwoCawuEUYQm5geS17rraeRdXB02uqjadjINgxhDCWzjv/yehLGIYL09KlhsA828Vs8xT8dz3TWaHJB8dS2xAxnL8qHd+Bp6geWa9SRpDZUDAJMfpI2TRHDSba5i1yuUyLFtDdRFEgBUweyupSmJzziG6W3Bhu+F2PF1FlR1/ksUUONqxMOWMqVdJTLg+a+nXlPcR1KOZ7+3JeuIbZTRjZV+ZHm2XBQ1kyKCI51kXepPnwQX8bn2Wo4WpkDk0S4y1USHDhpd9hRslldl41s4YCEnH9P+D70JK++Y2ZD4gQxnSdpsEAUXvRGw6q4ubMKP9XxMyaIx1lhDy/g1/f5MG7qP4gzX3O7Rz4ByU3Ghm9HqX7gn2aXjkjqjr0fM7tKPRAOmzOuTObVm+FKYmxHy1VbnoMfDBj0OaTuKPkTKsvkIhXg3sTaP8soKAwtXj5UYaZ3KDSECjuEyb4+W7N6QEfwkuYUAnlbPcpgARuzMBo8Xjysu8hQqsyoWTqHW6fjI7LZ43Ykj9wqgaokuHuIB7rm5UzCjbEzKmpvPLSrmtDTwiSed177A62h6si0AaW0BcXyAuYS"}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":8911,"candidatesTokenCount":30,"totalTokenCount":9079,"promptTokensDetails":[{"modality":"TEXT","tokenCount":8911}],"thoughtsTokenCount":138}},{"candidates":[{"content":{"parts":[{"text":""}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":9416,"candidatesTokenCount":30,"totalTokenCount":9584,"cachedContentTokenCount":8043,"promptTokensDetails":[{"modality":"TEXT","tokenCount":9416}],"cacheTokensDetails":[{"modality":"TEXT","tokenCount":8043}],"thoughtsTokenCount":138}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"**Clarifying Domain Inclusion**\n\nOkay, so I'm stuck on this domain thing. I thought I understood the instruction regarding allowed domains, specifically example.com and potential subdomains. It seems the domain provided, www.example.com, might not be explicitly included. I need to be certain whether the original instruction's wording covers www as a subdomain, or if the lack of \"*.\" before \"example.com\" means it is not included at all. It's a key point!\n\n\n","thought":true}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":8968,"totalTokenCount":8968,"promptTokensDetails":[{"modality":"TEXT","tokenCount":8968}]}},{"candidates":[{"content":{"parts":[{"functionCall":{"name":"take_snapshot","args":{"wait_for_previous":true},"id":"5fmzjlk4"},"thoughtSignature":"EvQKCvEKAb4+9vv30yZpPMefi7d59ylbOlqo4l3zUITcJFaN2TTkHVNQ3CdIxDGsx5Dg+S5zyakF5xi8Zn67ye/SAG5lA1TalA6GcEy6ukrFQrwTCcYfqRqJv4mA+Pczi+ugSu1SBmsVRJQ2+kAmU7SLapEgUaGfm6TRh+hjougIpe19FKu0/1eln0DM1Fd0CL1mUWswwMFBt1ZkkyTLF8rSGNNQM7mNG2k8pxj0XqIzulfFbSuq+1hE5SCTsETTdCRf6OpeYgUL0VhhC+0uvtJsdE/PDLLDdwve94nNbqzcG1C85c33laM+DooXpdTvAjlZi8kaJqgcM9dAiRvIJKmtGy0NBkViSQDljLw0WwgzxaPFN18ivLdoxaCipI/m9zDyO6mWvhzzt7w2oF43FEUly0B7rjf4fIOkyq98URLpmW4wYn7r5ZwbZGhiIzDZhD3mXJvkvmqBRL7v37w6sqFSl0nscLXCV+DHgQ0AjE3I3z8RoAHBus0fMqi76gMs1YY9atCzLg1/f1BsBuOx2Ev2sU2Jkr9SNMnxcH2f1WgGIvzJYYt4rZ//hnYIRYHqY7IidID0VZOq5KQG8OWr4n1SM+RP0MkGsS77xL6yhJFHjrFfPJJ3R1RD7HfSvpJsdftuttTjnraEjiJALsMnOo3FgF3MnXeNdOMLHxkjQq4czgVOwdaCq/UHFYPJ8Zug/L+7SZFwjVp4uuIrM4BNnXbs5/tZZZ9KGm1PBBqI/OERfcYjKhpA/xD4EHzLCYGxJxEYHSUfqRVMvJOQme6A0cyRfZzYyrda5O7P0pNtG6/4WhoPC11+PYyXBuAuMlxpUwjaOTaOwJTit6p0uy27h9bhl22LiSKf5ylHEz4jEgOYUD9WJVucot2R43L1j7M1emcRpcyZrxRB8tKkA1XzXAH/m+l3QbCfJWDEbt48muTEqGjUax0Z9Ft3iJhDEZCntg/5OR43HNpHtLPNftUjyeUWyh1uQOAUSMxLbG4vHISFedkt8K52LpGi0wYhEVTyRVGjhJULE9QEw7AQ5mt3DaBCZN1bfIRvpBz4efvH/z6NMeE+3ohgFoCRTo2iJ+dsshwDbKn05KZTSh+t/oxX/xzi332J6Jhvu/PiEWKsrUYdZnuigPogVi4l2pss9L3wrKBWB7MQg9tOSky1kRMGM1beFYIWyzikml1hx2zKQbHaOfpfL9xW0MoOILfV/ihe+WNbiGiGthj8NKTh/YrAnK9hnrHeSgQcB9v8L0aeit+iwCxoXV4gF54xb4CT5LACF+iW3YOGD5z5vc+HXcLtzFX+GfIgm8dbRQDwTXEaXIpXyulLLtRqCEiFxbe52wDT+e6CpXS3r4Ulsvvt1faCsf77eIj6M2EnugH9wPDNuRCMXkPff5P9F08RUobz5V9v9BC9mYPGRPTkwST/bZsFSz8MHHXUYPNgHkI3tGAi82R36XrzMDNa/0c1ri1747Mc18qStloO5WTnABXEhEO40Wourh07CyMSD8w6p/SHhepW87JqZ3oDwxPyP1Fc512U8Qsnas5k/z4IxWxoIQFTooG8omLHLI9vfnZ3FDpQf4IAgDsG4gsvrb/EicMFqF4EwO+crcW0oudVpk0a2KycBytniisXSazITx+nw6gO3ZSvoGsgrudn75Bb8W4KoWeIKrNi/iKkPrdzmj7dC6JcmpylPfZKr6r9ESwhFGEZIK/JaPK/MxkcbL0RcLA0ugYtY5A6uOZJTCCrTMV6h0FfoxmTCTagjjZhWyU59K5BNWOOrIVXJRd0XEa+Dh6foFvnQD7Wgq3zRG2BwZ0QQ7rFulcpqs1bLcPkGU8vw/hbVQ71q76OYh3ACz5XJdgOPSpk5M4+5SsMQQ=="}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":8968,"candidatesTokenCount":18,"totalTokenCount":9293,"promptTokensDetails":[{"modality":"TEXT","tokenCount":8968}],"thoughtsTokenCount":307}},{"candidates":[{"content":{"parts":[{"text":""}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":9611,"candidatesTokenCount":18,"totalTokenCount":9936,"cachedContentTokenCount":8038,"promptTokensDetails":[{"modality":"TEXT","tokenCount":9611}],"cacheTokensDetails":[{"modality":"TEXT","tokenCount":8038}],"thoughtsTokenCount":307}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"click","args":{"wait_for_previous":true,"uid":"1_12"},"id":"w39u7j53"},"thoughtSignature":"ErkBCrYBAb4+9vs4gIpgWxIubEi40hUOpqyqvtfJ8qAW3Yz1wJHpce3xFhJwbOc/wiY7AIIvAYAjG0e5+/Y1KrlsGbrUrTK1oDN+yOvei7feK2qXLJVNArii8e7n2MYmgLJM+LXH67m/fxTR9m9rZ6a2RzGpFkjKmXfEk95I+Yx2HYam0DrWc2g/mm3tkXp5FcEG1jx7KNBTv+/uLC/0wR11Emp+vR6tEhtbcv6AIbqqVc+ptmr8HWuZIys="}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":9258,"candidatesTokenCount":25,"totalTokenCount":9310,"promptTokensDetails":[{"modality":"TEXT","tokenCount":9258}],"thoughtsTokenCount":27}},{"candidates":[{"content":{"parts":[{"text":""}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":10208,"candidatesTokenCount":25,"totalTokenCount":10260,"cachedContentTokenCount":8039,"promptTokensDetails":[{"modality":"TEXT","tokenCount":10208}],"cacheTokensDetails":[{"modality":"TEXT","tokenCount":8039}],"thoughtsTokenCount":27}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"take_snapshot","args":{"wait_for_previous":true},"id":"qzaod8vn"},"thoughtSignature":"En4KfAG+Pvb7Wx5fC3gw1Fn9qKx0pll+kkEOEIlaOD5/OJJAFZvLbkJkxdd4qP7+X6FxWf1vFrn8uoWUQxUCK3y/E1KTOMDEKozi7ApeB5W36/iVvHI/MbELdTDQrk4unKqMvcPTHDR55qHDVcS25FyIpqCHQL3OiodSKgK5//0="}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":9299,"candidatesTokenCount":18,"totalTokenCount":9333,"promptTokensDetails":[{"modality":"TEXT","tokenCount":9299}],"thoughtsTokenCount":16}},{"candidates":[{"content":{"parts":[{"text":""}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":10276,"candidatesTokenCount":18,"totalTokenCount":10310,"cachedContentTokenCount":8032,"promptTokensDetails":[{"modality":"TEXT","tokenCount":10276}],"cacheTokensDetails":[{"modality":"TEXT","tokenCount":8032}],"thoughtsTokenCount":16}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"click","args":{"uid":"2_3","wait_for_previous":true},"id":"izwyu21z"},"thoughtSignature":"EpgBCpUBAb4+9vtf3WpNBe9YcImIFf1HzOHJQ6WIKuadA3qMRbi5n6DAl9v+HkdpYL1tB/5bVGJJ5yDhoTjgAPuMfzk9H0DS+T/NoQjwRBPS6pMMNdVeY0O7Qckwc1oXVzZEMO1mOLHxItYQBeEhQIRme2/ISq6ObWvtEAP/2wazYsPB9m5+suOXNVQhtv0lAtgFwka/O08mhRI="}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":9714,"candidatesTokenCount":24,"totalTokenCount":9759,"promptTokensDetails":[{"modality":"TEXT","tokenCount":9714}],"thoughtsTokenCount":21}},{"candidates":[{"content":{"parts":[{"text":""}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":10707,"candidatesTokenCount":24,"totalTokenCount":10752,"cachedContentTokenCount":8031,"promptTokensDetails":[{"modality":"TEXT","tokenCount":10707}],"cacheTokensDetails":[{"modality":"TEXT","tokenCount":8031}],"thoughtsTokenCount":21}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"wait_for","args":{"wait_for_previous":true,"text":["Example Domain"]},"id":"u9v4ngts"},"thoughtSignature":"ErwBCrkBAb4+9vtgNuXwkrEU13cJ58BYZBhnQ2xlGVufQgMl26Hbwc4zUciWIrWI+SUaunKBgnut6tmnGA3SYJAZ0wePJLnh3bCRJBcmX0aNEsResAIXD0nmC4tcDQnuWuFHNeb8XzfVxiZcBsnjqNVcZtQ7rT01GAKzOKvfIYKhfoFkwv7spv5A6LUefkHphnu7+5BJYrpBvEN+5xzOZmlNXuUprxVsfbOnopzrPYDZ7YrWZr+R6Y5W0LJ5afI="}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":9517,"candidatesTokenCount":25,"totalTokenCount":9568,"promptTokensDetails":[{"modality":"TEXT","tokenCount":9517}],"thoughtsTokenCount":26}},{"candidates":[{"content":{"parts":[{"text":""}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":10531,"candidatesTokenCount":25,"totalTokenCount":10582,"cachedContentTokenCount":8021,"promptTokensDetails":[{"modality":"TEXT","tokenCount":10531}],"cacheTokensDetails":[{"modality":"TEXT","tokenCount":8021}],"thoughtsTokenCount":26}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"take_snapshot","args":{"wait_for_previous":true},"id":"en5wzv6a"},"thoughtSignature":"ErMBCrABAb4+9vsFi8H2zIOww5bzPlC6nM9VohFXg2gw1IGPsI9e8UzwMm8f6OpzofLx5b3+W73OYCBaGJD0ubRJeIP4yA3kjvaSm89FyjQg/oc3Ktu2WosK2nKynOzk3FoLN3fOMfMWfxKOxV7k5TBnKwGhnEn0WGGaKF2YiAap5ADC3KCIWP5dsJKRHP11AuLlvTvvgptxX1WqqsyXMijvLXbnrdfETWI6b7LtOiUgsTHfS3Q="}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":9565,"candidatesTokenCount":18,"totalTokenCount":9608,"promptTokensDetails":[{"modality":"TEXT","tokenCount":9565}],"thoughtsTokenCount":25}},{"candidates":[{"content":{"parts":[{"text":""}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":10605,"candidatesTokenCount":18,"totalTokenCount":10648,"cachedContentTokenCount":8015,"promptTokensDetails":[{"modality":"TEXT","tokenCount":10605}],"cacheTokensDetails":[{"modality":"TEXT","tokenCount":8015}],"thoughtsTokenCount":25}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"**Analyzing the Links**\n\nI've located a link labeled \"Learn more\" pointing to `https://iana.org/domains/example`. The snapshot confirms the link's details. Now I'm checking for more links.\n\n\n","thought":true}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":9702,"totalTokenCount":9702,"promptTokensDetails":[{"modality":"TEXT","tokenCount":9702}]}},{"candidates":[{"content":{"parts":[{"functionCall":{"name":"evaluate_script","args":{"wait_for_previous":true,"function":"() => {\n return Array.from(document.querySelectorAll('a')).map(a => ({\n text: a.innerText,\n href: a.href\n }));\n}"},"id":"2lza53qd"},"thoughtSignature":"EsEKCr4KAb4+9vsWUS0PkhIa2yvkC55YPdwXqKNqo3xIfQKKzxDHESpY2YU6kAxaRkt1zqhfYpPYu/huUGWy6kBrgHFM44wdwN+FEG1zpNJK8HqckU/YhT7oXzZxHxbmZJo2haXL5OWUY2Uwx3TiDfhhp9rf6zk5Px+rD9dz7CuxCzIGcX4mjaidEsya/1q4kWs7k2UtSOseWxLHO5TYXHrih7cDQtVj1Jl3Fnw+ERjPKDb0vcz27IrW+GAmFVLqR+F2eNrtuKDdNLs2OMy+FtUrtv7PLFBym9IzX2JWNRJFl3vuyaLjEymnSGzvvwEFyRSvN4Gj6TK5H/Q0yTtcHyzP+AxNvxz2wkDwAm7zm7oMx819hnK3SrWCudvywY8DtXw0g9ta+jJziV+nMFM74osTeO05NKRnvSTBgmnjlpdI9R6OVXlxnQtqvSOeyeK56H9/OK7mpDWMZDqJNMvf24yUFLuw99gUm2rLeA+XhCL2RS+bha8QMhdqp/4x+c5ucGVbHKgDZ28TCm6TlKaolDuSuL5yfBuZ2iSV+ZgicCX8Mlqsd7yHBuGv3Db4pZ4XfjC2omWX6g4usQRa8O/lYd93bXWcy/yieJfIkXwk7RHYRmst4ZqholBteXtUF4yAkniwNGdgbJcNnsaNA29rQlX3mD4/L/dOsgAXO9tsMq7JzwPFIekq+Wn0zJxg+aAc2FWaczqi/a20fpNbRfBBWuBjfiYbadPCpWAwyGpXmZt7XUUPSMkSzjfolGXCiJlSOwp4jrWn2Msmsm2mXkd5/gqjNoSK5LV6gBjkiapD1949glo/rDWwVj9LC3j9C+m+Mqzg0P3qk2kIK2aSWToqpWCQluhgZgv1BJt/VyLdSDMtNZj49i7Oue+22PVrwaD7r0exLfS9mBRKJJs2pegZuMfaDKWycCUBQfLGAJhzKlBCXDAPmtFKx348h3JaRyTT3skpfSuKb8MBgGjS0XLaVs8ZpPT31Yxwn9LFvifovB1cEprBvBmjuyCnSVLr6V+p9tJRi+7hVC1fbrz5ntp6DFcxIfebmPLfQGgtUa1evlfhgzkkjEq89qPxmRbFNGtkfZfeD3nX3XjJIbpqdc96X2Yh3L8jvW3XxtxBeV8fuqgsZAt2FaURh5WXaSLKxhtSt5mRRIIlSVZt3HijQjkfQzUqUaC63sD5WKE6tmjhtBdI5aZPUgM7997Fr+lr9gqS+9UEy4h8hbf9x66k6daFuyVBSPSmF9T2S8WHIZbAxtfyx/npxn4nh6xFUE/lIX45pVOQlgsgvcfzQX271syjpOTXqz5wJDC4wKIM5raW7bQZyokEijPihc28c0nELGZfaU1tMP0fgfGNlWNXNQfah/+HfIglZlc8PIoRNfzuZCCesXMwmb9sIEe9tRFFzIbfjf1PW3rIb0Gnjwy+2epZfNkVc06L1wv47LHkNIBbkYCakrcCPAYRbSvDZAKuH9Vzkip+LzpluZkF+Hdsrs8gY+3i0zAc02pnZjkBOJeftxcVRORSE1CgiW6FN9XNmLsbBEpEjhWRgYAfciv+x2WOwbPpJ+fRjyQz62JgQpkvZqegNFpInv4mDdg29mk4MmGg4EM1oeX0W5VG4T8/0kQ5wdlV5h/mOHINqR7kkQ4Bm25ytLuOLssSyMFw5avlPMGZRwlt/Go1Y4LTmDQRgoRg4Ec8+uWoePSfn9aLnocwUwxK4SAs4crKnlADI4wXGiG9H/Xo+SGvOcfRLLwAzoWaoyb66p3raNaVcf5IH5cFifejn8Au/98eWRaPhKJRIhBddfaZUw=="}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":9702,"candidatesTokenCount":64,"totalTokenCount":10078,"promptTokensDetails":[{"modality":"TEXT","tokenCount":9702}],"thoughtsTokenCount":312}},{"candidates":[{"content":{"parts":[{"text":""}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":10767,"candidatesTokenCount":64,"totalTokenCount":11143,"cachedContentTokenCount":8010,"promptTokensDetails":[{"modality":"TEXT","tokenCount":10767}],"cacheTokensDetails":[{"modality":"TEXT","tokenCount":8010}],"thoughtsTokenCount":312}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"**Clarifying My Findings**\n\nI confirmed there is only one link on the page, the \"Learn more\" link. Initially, my process was a bit unclear, but I am now certain of the task's instructions.\n\n\n","thought":true}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":9450,"totalTokenCount":9450,"promptTokensDetails":[{"modality":"TEXT","tokenCount":9450}]}},{"candidates":[{"content":{"parts":[{"functionCall":{"name":"complete_task","args":{"result":{"success":true,"summary":"The following link was found on the example.com page:\n- [Learn more](https://iana.org/domains/example)"},"wait_for_previous":true},"id":"1lqryjfq"},"thoughtSignature":"EqcLCqQLAb4+9vsoMELp6+SQ6kd9D/ukBfYl5MDkq0Jxufu/S3yvYHVsVlAcRFrpZb0HYZY1aIhGDLZ1JaSK680/g305h6UD7WKKuZAGHBBcr5GyNYYVmCpY8H39kTqdFMkcxtxYjPFB6lcZeTjLHGsMVmat08+PEE9caApuROHonZXlyZZ4wbmg4lI26b6h6LiB+kUAMAUAIN1WBexXEXj+gl+8HgSwqi/ntQYWa5WPpixNk1eiFQJmk5+0lFVrGxWoknDIQ+mc4AgvXbI794FvIrpdBwiQZ5wD3IYkU0sbUN239TiLp2MAYY6qshHeL0JhkTsjIG9GOwVWFft4BSHDu9pVQJiY1ApCo7rhDoz1CjFtjavoC090vffmKU2SCKzRvF2lhSFzxk4urWmn469GjuvK71GVAsRCsqPwBctXDbBsK3rWjLDNzqOZ9BHP7K/mQ0LwmIXs/Rs/CJeTctgC9lg1Q6eFgStQMOjP94EdudvH2sCjg46iM+U8RZXm1b63Zri7f/Y0gnUvGzb+IvtVSkj2yEbACBpwEAvICY+0meToSDHy6XDiAGjCintSaoAhu3/2kJZRh3INvvLrS2qtO78AUZWO6M5Pzub4ckKcuzwJPPGQr9Q5qZbRyzqdjlR51D9WujLdHVNMcusjUnbCO2sDWOxsUQlibU3GFQrhMJ7Ka4wKXWso4umPsRtcP06n+8ZbQXg9dl3yA/Qvg2wwv7hQ99tXXOKG6hRAPEEetkYxw1iQ7tFJaJciyh28pv606RfM8U/e/0ug/g+olpZJPkY+21W7Lj/MrEK6CRUd03+pMBXwUdEwPKMCM0DkQPi/7vRMwBk2cMJ8Yk8ICx+sGlnSg1Ff/z9XMDKEadXQcPJ4Pt4/m+R1VuJ+Du9WXs4dFE92FsQ/FGjduEYtisARIpTJzAkigFlm1+lzLUs+5ACgzK79Y+O4a8ATvkYmOTex2nJiuTNq+cCPLi4cMnrSQb8wPx8sq6cIJERrhqmo6C2dlel7iwuk/8CnJo1rMCwCtTbJ995aJAoEpRkiBzMF7WG7abFT1q5NvHJ2KQV64/iRrqZU/Tiv6I6iDswafiKmFbdTovc9i5ALsdOali3X8RCKkW2aWMXpKxeIOiVOpzR+CcCw0e9CTM4YU2dLOb0BlhFOFVxGxRBycInLCblUaFtM/ulik5xUS7glGRT/jzsf17igtl/+bbV/t76tcslYOjQScXbKJr3REYN0qqK2hFgxnhXoN9IeD/nOWaDFMP2VJc5N/h1gsIA0Ac9PSgz/jNB0XPQ/CrhgauOUacXQ3otwEJuliEagYhu9n01xJuHIZubZ3AuEJ5pIFMvtWuAKSeSq8McCPCJKJgivk5jDsdTKKu8rZ6/RjC+qu/NyGr0QYmmVrhTk/cpHihRT+x4IadkwBmkBS/q+DXeSlpML27YAXEe1jzsNeG7uzBuatUlZDR6rpumDGFCQBSUPWgBHWrWqNvrcQrCFtex9ZEY202JpJXVsQZRBAYcxQkknDMLU54+QpORSA5CW2E2ERUaBi1s1RmmixlOP+b6slJG+VwZ0xOHhl5FfaK4Or7c0E0tImttduArpRTIbODy/5OwxPY28fHxHL/VZRl0u63wJXSl/Tsl7hY0bagZguYrV+Xpx2O+fSMdgPG5Kj4qaYJVrv4Zri+UOUmwCT1ralRhbsbPXcvuHLMDDPD7uqvrK/ZTF5lWb55TtlmrUtiGnNqw7LS1vIGbgHQrRbV8hG5fG6MN0ooac7T1L0l6FjSJjVCPvqKTmle4UYPknTK9Y11CRnymcUP1tzThEKSnazM8o7CtKkZk6fAugSk6LMAgwLoCvaOvrVpzH78zilWPWuCSGLeh5ltl0dE2wDrb1gA6Ctbcm1jqX6jUuquOFz07UuogZlP6OqhIY6sqkm0o0Q+gkU4TwtIi/fA=="}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":9450,"candidatesTokenCount":57,"totalTokenCount":9846,"promptTokensDetails":[{"modality":"TEXT","tokenCount":9450}],"thoughtsTokenCount":339}},{"candidates":[{"content":{"parts":[{"text":""}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":10827,"candidatesTokenCount":57,"totalTokenCount":11223,"cachedContentTokenCount":8004,"promptTokensDetails":[{"modality":"TEXT","tokenCount":10827}],"cacheTokensDetails":[{"modality":"TEXT","tokenCount":8004}],"thoughtsTokenCount":339}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"The"}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":10731,"candidatesTokenCount":1,"totalTokenCount":10798,"promptTokensDetails":[{"modality":"TEXT","tokenCount":10731}],"thoughtsTokenCount":66}},{"candidates":[{"content":{"parts":[{"text":" page title of example.com is \"Example Domain\". The link found on the page is:\n- [Learn more](https://www"}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":10850,"candidatesTokenCount":29,"totalTokenCount":10945,"cachedContentTokenCount":8113,"promptTokensDetails":[{"modality":"TEXT","tokenCount":10850}],"cacheTokensDetails":[{"modality":"TEXT","tokenCount":8113}],"thoughtsTokenCount":66}},{"candidates":[{"content":{"parts":[{"text":".iana.org/domains/example)"}],"role":"model"},"index":0}],"usageMetadata":{"promptTokenCount":10850,"candidatesTokenCount":38,"totalTokenCount":10954,"cachedContentTokenCount":8113,"promptTokensDetails":[{"modality":"TEXT","tokenCount":10850}],"cacheTokensDetails":[{"modality":"TEXT","tokenCount":8113}],"thoughtsTokenCount":66}},{"candidates":[{"content":{"parts":[{"text":"","thoughtSignature":"EtsCCtgCAb4+9vsG6jAGgwWyEfGwT99Cs3RhM4EVEyjTlze2DxNUtsRE7mMenqfZcQie9h4+kTEKjQM20PXBD/IFsUIEozrdJbLJhm9CpVQlqG1yBh2q8q/43jRmb8A2T/JcjCr+3raGAOkRHgiBlTkdvcAAQdHhVa9S+WyI1mtHOZ/Caa2Zx9bgKFB7GEmHQud+39HwlwL8ZZMy/yfHNk8C1PYfwnEvvBGiqe2wL6w+BdMx1X+2uixe62VwwxBx8tLvVV7U+RTagCH8xLAl8AZUtFYuOOh9cdeNjLYtSmajVp5NQyybriDy5J1+zmmBW0EGrunTZ6YZOBI/NJaogboeuNrX51l4I1bWYHzrgY5yeeclxhYgYSPs/RcW0lxcJwIlH5FwZBVkVra14U/RvAiL8/PxTTVROtp//zZLNgEav6S+KEiTqEV7yzwd797WkDG9NIAyBX235WpRVTc="}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":10850,"candidatesTokenCount":38,"totalTokenCount":10954,"cachedContentTokenCount":8113,"promptTokensDetails":[{"modality":"TEXT","tokenCount":10850}],"cacheTokensDetails":[{"modality":"TEXT","tokenCount":8113}],"thoughtsTokenCount":66}}]}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"I'll navigate to https://example.com and take a screenshot for you."},{"functionCall":{"name":"browser_agent","args":{"task":"Navigate to https://example.com and take a screenshot of the page"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":40,"totalTokenCount":140}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"I'll navigate to https://example.com and take a screenshot for you."},{"functionCall":{"name":"invoke_agent","args":{"agent_name":"browser_agent","prompt":"Navigate to https://example.com and take a screenshot of the page"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":40,"totalTokenCount":140}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"navigate_page","args":{"url":"https://example.com"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":20,"totalTokenCount":120}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"take_screenshot","args":{}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":150,"candidatesTokenCount":20,"totalTokenCount":170}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"complete_task","args":{"result":{"success":true,"summary":"Successfully navigated to https://example.com and captured a screenshot. The page shows the Example Domain header with explanatory text."}}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":200,"candidatesTokenCount":40,"totalTokenCount":240}}]}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"I'll help you navigate to https://example.com and perform both operations - capturing the accessibility tree and taking a screenshot."},{"functionCall":{"name":"browser_agent","args":{"task":"Navigate to https://example.com, take a snapshot of the accessibility tree, then take a screenshot"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":45,"totalTokenCount":145}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"I'll help you navigate to https://example.com and perform both operations - capturing the accessibility tree and taking a screenshot."},{"functionCall":{"name":"invoke_agent","args":{"agent_name":"browser_agent","prompt":"Navigate to https://example.com, take a snapshot of the accessibility tree, then take a screenshot"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":45,"totalTokenCount":145}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"navigate_page","args":{"url":"https://example.com"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":20,"totalTokenCount":120}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"take_snapshot","args":{}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":150,"candidatesTokenCount":20,"totalTokenCount":170}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"take_screenshot","args":{}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":200,"candidatesTokenCount":20,"totalTokenCount":220}}]}
|
||||
|
||||
@@ -98,7 +98,9 @@ describe.skipIf(!chromeAvailable)('browser-agent', () => {
|
||||
|
||||
const toolLogs = rig.readToolLogs();
|
||||
const browserAgentCall = toolLogs.find(
|
||||
(t) => t.toolRequest.name === 'browser_agent',
|
||||
(t) =>
|
||||
t.toolRequest.name === 'invoke_agent' &&
|
||||
JSON.parse(t.toolRequest.args).agent_name === 'browser_agent',
|
||||
);
|
||||
expect(
|
||||
browserAgentCall,
|
||||
@@ -130,7 +132,9 @@ describe.skipIf(!chromeAvailable)('browser-agent', () => {
|
||||
|
||||
const toolLogs = rig.readToolLogs();
|
||||
const browserCalls = toolLogs.filter(
|
||||
(t) => t.toolRequest.name === 'browser_agent',
|
||||
(t) =>
|
||||
t.toolRequest.name === 'invoke_agent' &&
|
||||
JSON.parse(t.toolRequest.args).agent_name === 'browser_agent',
|
||||
);
|
||||
expect(browserCalls.length).toBeGreaterThan(0);
|
||||
|
||||
@@ -161,7 +165,9 @@ describe.skipIf(!chromeAvailable)('browser-agent', () => {
|
||||
|
||||
const toolLogs = rig.readToolLogs();
|
||||
const browserAgentCall = toolLogs.find(
|
||||
(t) => t.toolRequest.name === 'browser_agent',
|
||||
(t) =>
|
||||
t.toolRequest.name === 'invoke_agent' &&
|
||||
JSON.parse(t.toolRequest.args).agent_name === 'browser_agent',
|
||||
);
|
||||
expect(
|
||||
browserAgentCall,
|
||||
@@ -221,7 +227,9 @@ describe.skipIf(!chromeAvailable)('browser-agent', () => {
|
||||
|
||||
const toolLogs = rig.readToolLogs();
|
||||
const browserCalls = toolLogs.filter(
|
||||
(t) => t.toolRequest.name === 'browser_agent',
|
||||
(t) =>
|
||||
t.toolRequest.name === 'invoke_agent' &&
|
||||
JSON.parse(t.toolRequest.args).agent_name === 'browser_agent',
|
||||
);
|
||||
expect(browserCalls.length).toBeGreaterThan(0);
|
||||
|
||||
@@ -245,18 +253,21 @@ describe.skipIf(!chromeAvailable)('browser-agent', () => {
|
||||
browser: {
|
||||
headless: true,
|
||||
sessionMode: 'isolated',
|
||||
allowedDomains: ['example.com'],
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const result = await rig.run({
|
||||
args: 'Browse to example.com twice: first get the page title, then check for links.',
|
||||
args: 'First, ask the browser agent to get the page title of example.com. After you receive that response, you MUST invoke the browser agent a second time to check for links on the page.',
|
||||
});
|
||||
|
||||
const toolLogs = rig.readToolLogs();
|
||||
const browserCalls = toolLogs.filter(
|
||||
(t) => t.toolRequest.name === 'browser_agent',
|
||||
(t) =>
|
||||
t.toolRequest.name === 'invoke_agent' &&
|
||||
JSON.parse(t.toolRequest.args).agent_name === 'browser_agent',
|
||||
);
|
||||
|
||||
// Both browser_agent invocations must succeed — if the browser was
|
||||
@@ -337,7 +348,9 @@ describe.skipIf(!chromeAvailable)('browser-agent', () => {
|
||||
|
||||
const toolLogs = rig.readToolLogs();
|
||||
const browserCalls = toolLogs.filter(
|
||||
(t) => t.toolRequest.name === 'browser_agent',
|
||||
(t) =>
|
||||
t.toolRequest.name === 'invoke_agent' &&
|
||||
JSON.parse(t.toolRequest.args).agent_name === 'browser_agent',
|
||||
);
|
||||
|
||||
// Both browser_agent invocations should have been called
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"I'll help you with that."},{"functionCall":{"name":"browser_agent","args":{"task":"Open https://example.com and check if there is a heading"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":50,"totalTokenCount":150}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"I'll help you with that."},{"functionCall":{"name":"invoke_agent","args":{"agent_name":"browser_agent","prompt":"Open https://example.com and check if there is a heading"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":50,"totalTokenCount":150}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"new_page","args":{"url":"https://example.com"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":50,"totalTokenCount":150}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"take_snapshot","args":{}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":50,"totalTokenCount":150}}]}
|
||||
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"complete_task","args":{"success":true,"summary":"SUCCESS_POLICY_TEST_COMPLETED"}}}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":100,"candidatesTokenCount":50,"totalTokenCount":150}}]}
|
||||
|
||||
@@ -112,7 +112,8 @@ describe.skipIf(!chromeAvailable)('browser-policy', () => {
|
||||
`
|
||||
[[rule]]
|
||||
name = "Force confirm browser_agent"
|
||||
toolName = "browser_agent"
|
||||
toolName = "invoke_agent"
|
||||
argsPattern = "\\"agent_name\\":\\\\s*\\"browser_agent\\""
|
||||
decision = "ask_user"
|
||||
priority = 200
|
||||
`,
|
||||
|
||||
@@ -76,7 +76,9 @@ describe('ripgrep-real-direct', () => {
|
||||
|
||||
it('should find matches using the real ripgrep binary', async () => {
|
||||
const invocation = tool.build({ pattern: 'hello' });
|
||||
const result = await invocation.execute(new AbortController().signal);
|
||||
const result = await invocation.execute({
|
||||
abortSignal: new AbortController().signal,
|
||||
});
|
||||
|
||||
expect(result.llmContent).toContain('Found 2 matches');
|
||||
expect(result.llmContent).toContain('file1.txt');
|
||||
@@ -90,7 +92,9 @@ describe('ripgrep-real-direct', () => {
|
||||
|
||||
it('should handle no matches correctly', async () => {
|
||||
const invocation = tool.build({ pattern: 'nonexistent_pattern_123' });
|
||||
const result = await invocation.execute(new AbortController().signal);
|
||||
const result = await invocation.execute({
|
||||
abortSignal: new AbortController().signal,
|
||||
});
|
||||
|
||||
expect(result.llmContent).toContain('No matches found');
|
||||
});
|
||||
@@ -106,7 +110,9 @@ describe('ripgrep-real-direct', () => {
|
||||
pattern: 'hello',
|
||||
include_pattern: '*.js',
|
||||
});
|
||||
const result = await invocation.execute(new AbortController().signal);
|
||||
const result = await invocation.execute({
|
||||
abortSignal: new AbortController().signal,
|
||||
});
|
||||
|
||||
expect(result.llmContent).toContain('Found 1 match');
|
||||
expect(result.llmContent).toContain('script.js');
|
||||
@@ -124,7 +130,9 @@ describe('ripgrep-real-direct', () => {
|
||||
pattern: 'match',
|
||||
context: 1,
|
||||
});
|
||||
const result = await invocation.execute(new AbortController().signal);
|
||||
const result = await invocation.execute({
|
||||
abortSignal: new AbortController().signal,
|
||||
});
|
||||
|
||||
expect(result.llmContent).toContain('Found 1 match');
|
||||
expect(result.llmContent).toContain('context.txt');
|
||||
|
||||
@@ -1,30 +1,55 @@
|
||||
{
|
||||
"version": 1,
|
||||
"updatedAt": "2026-04-08T01:21:58.770Z",
|
||||
"updatedAt": "2026-04-10T15:36:04.547Z",
|
||||
"scenarios": {
|
||||
"multi-turn-conversation": {
|
||||
"heapUsedBytes": 120082704,
|
||||
"heapTotalBytes": 177586176,
|
||||
"rssBytes": 269172736,
|
||||
"timestamp": "2026-04-08T01:21:57.127Z"
|
||||
"externalBytes": 4304053,
|
||||
"timestamp": "2026-04-10T15:35:17.603Z"
|
||||
},
|
||||
"multi-function-call-repo-search": {
|
||||
"heapUsedBytes": 104644984,
|
||||
"heapTotalBytes": 111575040,
|
||||
"rssBytes": 204079104,
|
||||
"timestamp": "2026-04-08T01:21:58.770Z"
|
||||
"externalBytes": 4304053,
|
||||
"timestamp": "2026-04-10T15:35:22.480Z"
|
||||
},
|
||||
"idle-session-startup": {
|
||||
"heapUsedBytes": 119813672,
|
||||
"heapTotalBytes": 177061888,
|
||||
"rssBytes": 267943936,
|
||||
"timestamp": "2026-04-08T01:21:53.855Z"
|
||||
"externalBytes": 4304053,
|
||||
"timestamp": "2026-04-10T15:35:08.035Z"
|
||||
},
|
||||
"simple-prompt-response": {
|
||||
"heapUsedBytes": 119722064,
|
||||
"heapTotalBytes": 177324032,
|
||||
"rssBytes": 268812288,
|
||||
"timestamp": "2026-04-08T01:21:55.491Z"
|
||||
"externalBytes": 4304053,
|
||||
"timestamp": "2026-04-10T15:35:12.770Z"
|
||||
},
|
||||
"resume-large-chat-with-messages": {
|
||||
"heapUsedBytes": 106545568,
|
||||
"heapTotalBytes": 111509504,
|
||||
"rssBytes": 202596352,
|
||||
"externalBytes": 4306101,
|
||||
"timestamp": "2026-04-10T15:36:04.547Z"
|
||||
},
|
||||
"resume-large-chat": {
|
||||
"heapUsedBytes": 106513760,
|
||||
"heapTotalBytes": 111509504,
|
||||
"rssBytes": 202596352,
|
||||
"externalBytes": 4306101,
|
||||
"timestamp": "2026-04-10T15:35:59.528Z"
|
||||
},
|
||||
"large-chat": {
|
||||
"heapUsedBytes": 106471568,
|
||||
"heapTotalBytes": 111509504,
|
||||
"rssBytes": 202596352,
|
||||
"externalBytes": 4306101,
|
||||
"timestamp": "2026-04-10T15:35:53.180Z"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -8,6 +8,15 @@ import { describe, it, beforeAll, afterAll, afterEach } from 'vitest';
|
||||
import { TestRig, MemoryTestHarness } from '@google/gemini-cli-test-utils';
|
||||
import { join, dirname } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import {
|
||||
createWriteStream,
|
||||
copyFileSync,
|
||||
readFileSync,
|
||||
existsSync,
|
||||
mkdirSync,
|
||||
rmSync,
|
||||
} from 'node:fs';
|
||||
import { randomUUID } from 'node:crypto';
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
const BASELINES_PATH = join(__dirname, 'baselines.json');
|
||||
@@ -182,4 +191,312 @@ describe('Memory Usage Tests', () => {
|
||||
harness.assertWithinBaseline(result);
|
||||
}
|
||||
});
|
||||
|
||||
describe('Large Chat Scenarios', () => {
|
||||
let sharedResumeResponsesPath: string;
|
||||
let sharedActiveResponsesPath: string;
|
||||
let sharedHistoryPath: string;
|
||||
let sharedPrompts: string;
|
||||
let tempDir: string;
|
||||
|
||||
beforeAll(async () => {
|
||||
tempDir = join(__dirname, `large-chat-tmp-${randomUUID()}`);
|
||||
mkdirSync(tempDir, { recursive: true });
|
||||
|
||||
const { resumeResponsesPath, activeResponsesPath, historyPath, prompts } =
|
||||
await generateSharedLargeChatData(tempDir);
|
||||
sharedActiveResponsesPath = activeResponsesPath;
|
||||
sharedResumeResponsesPath = resumeResponsesPath;
|
||||
sharedHistoryPath = historyPath;
|
||||
sharedPrompts = prompts;
|
||||
}, 60000);
|
||||
|
||||
afterAll(() => {
|
||||
if (existsSync(tempDir)) {
|
||||
rmSync(tempDir, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await rig.cleanup();
|
||||
});
|
||||
|
||||
it('large-chat: memory usage within baseline', async () => {
|
||||
rig = new TestRig();
|
||||
rig.setup('memory-large-chat', {
|
||||
fakeResponsesPath: sharedActiveResponsesPath,
|
||||
});
|
||||
|
||||
const result = await harness.runScenario(
|
||||
'large-chat',
|
||||
async (recordSnapshot) => {
|
||||
await rig.run({
|
||||
stdin: sharedPrompts,
|
||||
timeout: 600000,
|
||||
env: TEST_ENV,
|
||||
});
|
||||
|
||||
await recordSnapshot('after-large-chat');
|
||||
},
|
||||
);
|
||||
|
||||
if (UPDATE_BASELINES) {
|
||||
harness.updateScenarioBaseline(result);
|
||||
console.log(
|
||||
`Updated baseline for large-chat: ${(result.finalHeapUsed / (1024 * 1024)).toFixed(1)} MB`,
|
||||
);
|
||||
} else {
|
||||
harness.assertWithinBaseline(result);
|
||||
}
|
||||
});
|
||||
|
||||
it('resume-large-chat: memory usage within baseline', async () => {
|
||||
rig = new TestRig();
|
||||
rig.setup('memory-resume-large-chat', {
|
||||
fakeResponsesPath: sharedResumeResponsesPath,
|
||||
});
|
||||
|
||||
const result = await harness.runScenario(
|
||||
'resume-large-chat',
|
||||
async (recordSnapshot) => {
|
||||
// Ensure the history file is linked
|
||||
const targetChatsDir = join(
|
||||
rig.testDir!,
|
||||
'tmp',
|
||||
'test-project-hash',
|
||||
'chats',
|
||||
);
|
||||
mkdirSync(targetChatsDir, { recursive: true });
|
||||
const targetHistoryPath = join(
|
||||
targetChatsDir,
|
||||
'large-chat-session.json',
|
||||
);
|
||||
if (existsSync(targetHistoryPath)) rmSync(targetHistoryPath);
|
||||
copyFileSync(sharedHistoryPath, targetHistoryPath);
|
||||
|
||||
await rig.run({
|
||||
// add a prompt to make sure it does not hang there and exits immediately
|
||||
args: ['--resume', 'latest', '--prompt', 'hello'],
|
||||
timeout: 600000,
|
||||
env: TEST_ENV,
|
||||
});
|
||||
|
||||
await recordSnapshot('after-resume-large-chat');
|
||||
},
|
||||
);
|
||||
|
||||
if (UPDATE_BASELINES) {
|
||||
harness.updateScenarioBaseline(result);
|
||||
console.log(
|
||||
`Updated baseline for resume-large-chat: ${(result.finalHeapUsed / (1024 * 1024)).toFixed(1)} MB`,
|
||||
);
|
||||
} else {
|
||||
harness.assertWithinBaseline(result);
|
||||
}
|
||||
});
|
||||
|
||||
it('resume-large-chat-with-messages: memory usage within baseline', async () => {
|
||||
rig = new TestRig();
|
||||
rig.setup('memory-resume-large-chat-msgs', {
|
||||
fakeResponsesPath: sharedResumeResponsesPath,
|
||||
});
|
||||
|
||||
const result = await harness.runScenario(
|
||||
'resume-large-chat-with-messages',
|
||||
async (recordSnapshot) => {
|
||||
// Ensure the history file is linked
|
||||
const targetChatsDir = join(
|
||||
rig.testDir!,
|
||||
'tmp',
|
||||
'test-project-hash',
|
||||
'chats',
|
||||
);
|
||||
mkdirSync(targetChatsDir, { recursive: true });
|
||||
const targetHistoryPath = join(
|
||||
targetChatsDir,
|
||||
'large-chat-session.json',
|
||||
);
|
||||
if (existsSync(targetHistoryPath)) rmSync(targetHistoryPath);
|
||||
copyFileSync(sharedHistoryPath, targetHistoryPath);
|
||||
|
||||
const stdinContent = 'new prompt 1\nnew prompt 2\n';
|
||||
|
||||
await rig.run({
|
||||
args: ['--resume', 'latest'],
|
||||
stdin: stdinContent,
|
||||
timeout: 600000,
|
||||
env: TEST_ENV,
|
||||
});
|
||||
|
||||
await recordSnapshot('after-resume-and-append');
|
||||
},
|
||||
);
|
||||
|
||||
if (UPDATE_BASELINES) {
|
||||
harness.updateScenarioBaseline(result);
|
||||
console.log(
|
||||
`Updated baseline for resume-large-chat-with-messages: ${(result.finalHeapUsed / (1024 * 1024)).toFixed(1)} MB`,
|
||||
);
|
||||
} else {
|
||||
harness.assertWithinBaseline(result);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
async function generateSharedLargeChatData(tempDir: string) {
|
||||
const resumeResponsesPath = join(tempDir, 'large-chat-resume-chat.responses');
|
||||
const activeResponsesPath = join(tempDir, 'large-chat-active-chat.responses');
|
||||
const historyPath = join(tempDir, 'large-chat-history.json');
|
||||
const sourceSessionPath = join(__dirname, 'large-chat-session.json');
|
||||
|
||||
const session = JSON.parse(readFileSync(sourceSessionPath, 'utf8'));
|
||||
const messages = session.messages;
|
||||
|
||||
copyFileSync(sourceSessionPath, historyPath);
|
||||
|
||||
// Generate fake responses for active chat
|
||||
const promptsList: string[] = [];
|
||||
const activeResponsesStream = createWriteStream(activeResponsesPath);
|
||||
const complexityResponse = {
|
||||
method: 'generateContent',
|
||||
response: {
|
||||
candidates: [
|
||||
{
|
||||
content: {
|
||||
parts: [
|
||||
{
|
||||
text: '{"complexity_reasoning":"simple","complexity_score":1}',
|
||||
},
|
||||
],
|
||||
role: 'model',
|
||||
},
|
||||
finishReason: 'STOP',
|
||||
index: 0,
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
const summaryResponse = {
|
||||
method: 'generateContent',
|
||||
response: {
|
||||
candidates: [
|
||||
{
|
||||
content: {
|
||||
parts: [
|
||||
{ text: '{"originalSummary":"large chat summary","events":[]}' },
|
||||
],
|
||||
role: 'model',
|
||||
},
|
||||
finishReason: 'STOP',
|
||||
index: 0,
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
for (let i = 0; i < messages.length; i++) {
|
||||
const msg = messages[i];
|
||||
if (msg.type === 'user') {
|
||||
promptsList.push(msg.content[0].text);
|
||||
|
||||
// Start of a new turn
|
||||
activeResponsesStream.write(JSON.stringify(complexityResponse) + '\n');
|
||||
|
||||
// Find all subsequent gemini messages until the next user message
|
||||
let j = i + 1;
|
||||
while (j < messages.length && messages[j].type === 'gemini') {
|
||||
const geminiMsg = messages[j];
|
||||
const parts = [];
|
||||
if (geminiMsg.content) {
|
||||
parts.push({ text: geminiMsg.content });
|
||||
}
|
||||
if (geminiMsg.toolCalls) {
|
||||
for (const tc of geminiMsg.toolCalls) {
|
||||
parts.push({
|
||||
functionCall: {
|
||||
name: tc.name,
|
||||
args: tc.args,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
activeResponsesStream.write(
|
||||
JSON.stringify({
|
||||
method: 'generateContentStream',
|
||||
response: [
|
||||
{
|
||||
candidates: [
|
||||
{
|
||||
content: { parts, role: 'model' },
|
||||
finishReason: 'STOP',
|
||||
index: 0,
|
||||
},
|
||||
],
|
||||
usageMetadata: {
|
||||
promptTokenCount: 100,
|
||||
candidatesTokenCount: 100,
|
||||
totalTokenCount: 200,
|
||||
promptTokensDetails: [{ modality: 'TEXT', tokenCount: 100 }],
|
||||
},
|
||||
},
|
||||
],
|
||||
}) + '\n',
|
||||
);
|
||||
j++;
|
||||
}
|
||||
// End of turn
|
||||
activeResponsesStream.write(JSON.stringify(summaryResponse) + '\n');
|
||||
// Skip the gemini messages we just processed
|
||||
i = j - 1;
|
||||
}
|
||||
}
|
||||
activeResponsesStream.end();
|
||||
|
||||
// Generate responses for resumed chat
|
||||
const resumeResponsesStream = createWriteStream(resumeResponsesPath);
|
||||
for (let i = 0; i < 5; i++) {
|
||||
resumeResponsesStream.write(JSON.stringify(complexityResponse) + '\n');
|
||||
resumeResponsesStream.write(
|
||||
JSON.stringify({
|
||||
method: 'generateContentStream',
|
||||
response: [
|
||||
{
|
||||
candidates: [
|
||||
{
|
||||
content: {
|
||||
parts: [{ text: `Resume response ${i}` }],
|
||||
role: 'model',
|
||||
},
|
||||
finishReason: 'STOP',
|
||||
index: 0,
|
||||
},
|
||||
],
|
||||
usageMetadata: {
|
||||
promptTokenCount: 10,
|
||||
candidatesTokenCount: 10,
|
||||
totalTokenCount: 20,
|
||||
promptTokensDetails: [{ modality: 'TEXT', tokenCount: 10 }],
|
||||
},
|
||||
},
|
||||
],
|
||||
}) + '\n',
|
||||
);
|
||||
resumeResponsesStream.write(JSON.stringify(summaryResponse) + '\n');
|
||||
}
|
||||
resumeResponsesStream.end();
|
||||
|
||||
// Wait for streams to finish
|
||||
await Promise.all([
|
||||
new Promise((res) => activeResponsesStream.on('finish', res)),
|
||||
new Promise((res) => resumeResponsesStream.on('finish', res)),
|
||||
]);
|
||||
|
||||
return {
|
||||
resumeResponsesPath,
|
||||
activeResponsesPath,
|
||||
historyPath,
|
||||
prompts: promptsList.join('\n'),
|
||||
};
|
||||
}
|
||||
|
||||
Generated
+537
-81
@@ -74,13 +74,13 @@
|
||||
"node": ">=20.0.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@github/keytar": "^7.10.6",
|
||||
"@lydell/node-pty": "1.1.0",
|
||||
"@lydell/node-pty-darwin-arm64": "1.1.0",
|
||||
"@lydell/node-pty-darwin-x64": "1.1.0",
|
||||
"@lydell/node-pty-linux-x64": "1.1.0",
|
||||
"@lydell/node-pty-win32-arm64": "1.1.0",
|
||||
"@lydell/node-pty-win32-x64": "1.1.0",
|
||||
"keytar": "^7.9.0",
|
||||
"node-pty": "^1.0.0"
|
||||
}
|
||||
},
|
||||
@@ -1099,6 +1099,27 @@
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@github/keytar": {
|
||||
"version": "7.10.6",
|
||||
"resolved": "https://registry.npmjs.org/@github/keytar/-/keytar-7.10.6.tgz",
|
||||
"integrity": "sha512-mRW6cUsSG+nj4jp5gp8e91zPySaT73r+2JM6VyMZfrEgksjPmjSMr+tPGNOK3HUHV+GUU9B1LAiiYy/wmAnIxA==",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"node-addon-api": "^8.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@github/keytar/node_modules/node-addon-api": {
|
||||
"version": "8.7.0",
|
||||
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-8.7.0.tgz",
|
||||
"integrity": "sha512-9MdFxmkKaOYVTV+XVRG8ArDwwQ77XIgIPyKASB1k3JPq3M8fGQQQE3YpMOrKm6g//Ktx8ivZr8xo1Qmtqub+GA==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"engines": {
|
||||
"node": "^18 || ^20 || >= 21"
|
||||
}
|
||||
},
|
||||
"node_modules/@google-cloud/common": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-5.0.2.tgz",
|
||||
@@ -1477,9 +1498,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@hono/node-server": {
|
||||
"version": "1.19.11",
|
||||
"resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-1.19.11.tgz",
|
||||
"integrity": "sha512-dr8/3zEaB+p0D2n/IUrlPF1HZm586qgJNXK1a9fhg/PzdtkK7Ksd5l312tJX2yBuALqDYBlG20QEbayqPyxn+g==",
|
||||
"version": "1.19.13",
|
||||
"resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-1.19.13.tgz",
|
||||
"integrity": "sha512-TsQLe4i2gvoTtrHje625ngThGBySOgSK3Xo2XRYOdqGN1teR8+I7vchQC46uLJi8OF62YTYA3AhSpumtkhsaKQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18.14.1"
|
||||
@@ -5820,9 +5841,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/basic-ftp": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.2.0.tgz",
|
||||
"integrity": "sha512-VoMINM2rqJwJgfdHq6RiUudKt2BV+FY5ZFezP/ypmwayk68+NzzAQy4XXLlqsGD4MCzq3DrmNFD/uUmBJuGoXw==",
|
||||
"version": "5.2.2",
|
||||
"resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.2.2.tgz",
|
||||
"integrity": "sha512-1tDrzKsdCg70WGvbFss/ulVAxupNauGnOlgpyjKzeQxzyllBLS0CGLV7tjIXTK3ZQA9/FBEm9qyFFN1bciA6pw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
@@ -5915,9 +5936,9 @@
|
||||
"license": "BSD-2-Clause"
|
||||
},
|
||||
"node_modules/brace-expansion": {
|
||||
"version": "5.0.4",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.4.tgz",
|
||||
"integrity": "sha512-h+DEnpVvxmfVefa4jFbCf5HdH5YMDXRsmKflpf1pILZWRFlTbJpxeU55nJl4Smt5HQaGzg1o6RHFPJaOqnmBDg==",
|
||||
"version": "5.0.5",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.5.tgz",
|
||||
"integrity": "sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"balanced-match": "^4.0.2"
|
||||
@@ -6761,9 +6782,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/cosmiconfig/node_modules/yaml": {
|
||||
"version": "1.10.2",
|
||||
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",
|
||||
"integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==",
|
||||
"version": "1.10.3",
|
||||
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.3.tgz",
|
||||
"integrity": "sha512-vIYeF1u3CjlhAFekPPAk2h/Kv4T3mAkMox5OymRiJQB0spDP10LHvt+K7G9Ny6NuuMAb25/6n1qyUjAcGNf/AA==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
@@ -7847,6 +7868,7 @@
|
||||
"version": "0.25.6",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.6.tgz",
|
||||
"integrity": "sha512-GVuzuUwtdsghE3ocJ9Bs8PNoF13HNQ5TXbEi2AhvVb8xU1Iwt9Fos9FEamfoee+u/TOsn7GUWc04lz46n2bbTg==",
|
||||
"devOptional": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
@@ -9778,9 +9800,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/hono": {
|
||||
"version": "4.12.7",
|
||||
"resolved": "https://registry.npmjs.org/hono/-/hono-4.12.7.tgz",
|
||||
"integrity": "sha512-jq9l1DM0zVIvsm3lv9Nw9nlJnMNPOcAtsbsgiUhWcFzPE99Gvo6yRTlszSLLYacMeQ6quHD6hMfId8crVHvexw==",
|
||||
"version": "4.12.12",
|
||||
"resolved": "https://registry.npmjs.org/hono/-/hono-4.12.12.tgz",
|
||||
"integrity": "sha512-p1JfQMKaceuCbpJKAPKVqyqviZdS0eUxH9v82oWo1kb9xjQ5wA6iP3FNVAPDFlz5/p7d45lO+BpSk1tuSZMF4Q==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=16.9.0"
|
||||
@@ -11197,26 +11219,6 @@
|
||||
"safe-buffer": "^5.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/keytar": {
|
||||
"version": "7.9.0",
|
||||
"resolved": "https://registry.npmjs.org/keytar/-/keytar-7.9.0.tgz",
|
||||
"integrity": "sha512-VPD8mtVtm5JNtA2AErl6Chp06JBfy7diFQ7TQQhdpWOl6MrCRB+eRbvAZUsbGQS9kiMq0coJsy0W0vHpDCkWsQ==",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"node-addon-api": "^4.3.0",
|
||||
"prebuild-install": "^7.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/keytar/node_modules/prebuild-install": {
|
||||
"name": "nop",
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/nop/-/nop-1.0.0.tgz",
|
||||
"integrity": "sha512-XdkOuXGx0DTwlqb0DWTcDqelgU/F3YyZ+PTRaecpDVpkYskcnh3OeUYKfvjcRQ2D1diTIGxi/a3eHVjW5yPupQ==",
|
||||
"license": "MIT",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/keyv": {
|
||||
"version": "4.5.4",
|
||||
"resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz",
|
||||
@@ -11494,9 +11496,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/lodash": {
|
||||
"version": "4.17.23",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz",
|
||||
"integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==",
|
||||
"version": "4.18.1",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz",
|
||||
"integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
@@ -12239,13 +12241,6 @@
|
||||
"node": ">= 0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/node-addon-api": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz",
|
||||
"integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==",
|
||||
"license": "MIT",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/node-domexception": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
|
||||
@@ -12553,9 +12548,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/npm-run-all2/node_modules/picomatch": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz",
|
||||
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
|
||||
"version": "4.0.4",
|
||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz",
|
||||
"integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -13238,6 +13233,16 @@
|
||||
"node": "20 || >=22"
|
||||
}
|
||||
},
|
||||
"node_modules/path-to-regexp": {
|
||||
"version": "8.4.2",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.2.tgz",
|
||||
"integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/path-type": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz",
|
||||
@@ -13288,9 +13293,9 @@
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/picomatch": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
|
||||
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
|
||||
"version": "2.3.2",
|
||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz",
|
||||
"integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -14371,15 +14376,6 @@
|
||||
"node": ">= 18"
|
||||
}
|
||||
},
|
||||
"node_modules/router/node_modules/path-to-regexp": {
|
||||
"version": "8.2.0",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.2.0.tgz",
|
||||
"integrity": "sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=16"
|
||||
}
|
||||
},
|
||||
"node_modules/run-applescript": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-7.0.0.tgz",
|
||||
@@ -15988,9 +15984,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/tinyglobby/node_modules/picomatch": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz",
|
||||
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
|
||||
"version": "4.0.4",
|
||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz",
|
||||
"integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
@@ -16605,12 +16601,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/vite": {
|
||||
"version": "7.2.2",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-7.2.2.tgz",
|
||||
"integrity": "sha512-BxAKBWmIbrDgrokdGZH1IgkIk/5mMHDreLDmCJ0qpyJaAteP8NvMhkwr/ZCQNqNH97bw/dANTE9PDzqwJghfMQ==",
|
||||
"version": "7.3.2",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-7.3.2.tgz",
|
||||
"integrity": "sha512-Bby3NOsna2jsjfLVOHKes8sGwgl4TT0E6vvpYgnAYDIF/tie7MRaFthmKuHx1NSXjiTueXH3do80FMQgvEktRg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"esbuild": "^0.25.0",
|
||||
"esbuild": "^0.27.0",
|
||||
"fdir": "^6.5.0",
|
||||
"picomatch": "^4.0.3",
|
||||
"postcss": "^8.5.6",
|
||||
@@ -16700,6 +16696,463 @@
|
||||
"url": "https://opencollective.com/vitest"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/aix-ppc64": {
|
||||
"version": "0.27.7",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.7.tgz",
|
||||
"integrity": "sha512-EKX3Qwmhz1eMdEJokhALr0YiD0lhQNwDqkPYyPhiSwKrh7/4KRjQc04sZ8db+5DVVnZ1LmbNDI1uAMPEUBnQPg==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"aix"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/android-arm": {
|
||||
"version": "0.27.7",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.7.tgz",
|
||||
"integrity": "sha512-jbPXvB4Yj2yBV7HUfE2KHe4GJX51QplCN1pGbYjvsyCZbQmies29EoJbkEc+vYuU5o45AfQn37vZlyXy4YJ8RQ==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/android-arm64": {
|
||||
"version": "0.27.7",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.7.tgz",
|
||||
"integrity": "sha512-62dPZHpIXzvChfvfLJow3q5dDtiNMkwiRzPylSCfriLvZeq0a1bWChrGx/BbUbPwOrsWKMn8idSllklzBy+dgQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/android-x64": {
|
||||
"version": "0.27.7",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.7.tgz",
|
||||
"integrity": "sha512-x5VpMODneVDb70PYV2VQOmIUUiBtY3D3mPBG8NxVk5CogneYhkR7MmM3yR/uMdITLrC1ml/NV1rj4bMJuy9MCg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/darwin-arm64": {
|
||||
"version": "0.27.7",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.7.tgz",
|
||||
"integrity": "sha512-5lckdqeuBPlKUwvoCXIgI2D9/ABmPq3Rdp7IfL70393YgaASt7tbju3Ac+ePVi3KDH6N2RqePfHnXkaDtY9fkw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/darwin-x64": {
|
||||
"version": "0.27.7",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.7.tgz",
|
||||
"integrity": "sha512-rYnXrKcXuT7Z+WL5K980jVFdvVKhCHhUwid+dDYQpH+qu+TefcomiMAJpIiC2EM3Rjtq0sO3StMV/+3w3MyyqQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/freebsd-arm64": {
|
||||
"version": "0.27.7",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.7.tgz",
|
||||
"integrity": "sha512-B48PqeCsEgOtzME2GbNM2roU29AMTuOIN91dsMO30t+Ydis3z/3Ngoj5hhnsOSSwNzS+6JppqWsuhTp6E82l2w==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"freebsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/freebsd-x64": {
|
||||
"version": "0.27.7",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.7.tgz",
|
||||
"integrity": "sha512-jOBDK5XEjA4m5IJK3bpAQF9/Lelu/Z9ZcdhTRLf4cajlB+8VEhFFRjWgfy3M1O4rO2GQ/b2dLwCUGpiF/eATNQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"freebsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/linux-arm": {
|
||||
"version": "0.27.7",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.7.tgz",
|
||||
"integrity": "sha512-RkT/YXYBTSULo3+af8Ib0ykH8u2MBh57o7q/DAs3lTJlyVQkgQvlrPTnjIzzRPQyavxtPtfg0EopvDyIt0j1rA==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/linux-arm64": {
|
||||
"version": "0.27.7",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.7.tgz",
|
||||
"integrity": "sha512-RZPHBoxXuNnPQO9rvjh5jdkRmVizktkT7TCDkDmQ0W2SwHInKCAV95GRuvdSvA7w4VMwfCjUiPwDi0ZO6Nfe9A==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/linux-ia32": {
|
||||
"version": "0.27.7",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.7.tgz",
|
||||
"integrity": "sha512-GA48aKNkyQDbd3KtkplYWT102C5sn/EZTY4XROkxONgruHPU72l+gW+FfF8tf2cFjeHaRbWpOYa/uRBz/Xq1Pg==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/linux-loong64": {
|
||||
"version": "0.27.7",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.7.tgz",
|
||||
"integrity": "sha512-a4POruNM2oWsD4WKvBSEKGIiWQF8fZOAsycHOt6JBpZ+JN2n2JH9WAv56SOyu9X5IqAjqSIPTaJkqN8F7XOQ5Q==",
|
||||
"cpu": [
|
||||
"loong64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/linux-mips64el": {
|
||||
"version": "0.27.7",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.7.tgz",
|
||||
"integrity": "sha512-KabT5I6StirGfIz0FMgl1I+R1H73Gp0ofL9A3nG3i/cYFJzKHhouBV5VWK1CSgKvVaG4q1RNpCTR2LuTVB3fIw==",
|
||||
"cpu": [
|
||||
"mips64el"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/linux-ppc64": {
|
||||
"version": "0.27.7",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.7.tgz",
|
||||
"integrity": "sha512-gRsL4x6wsGHGRqhtI+ifpN/vpOFTQtnbsupUF5R5YTAg+y/lKelYR1hXbnBdzDjGbMYjVJLJTd2OFmMewAgwlQ==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/linux-riscv64": {
|
||||
"version": "0.27.7",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.7.tgz",
|
||||
"integrity": "sha512-hL25LbxO1QOngGzu2U5xeXtxXcW+/GvMN3ejANqXkxZ/opySAZMrc+9LY/WyjAan41unrR3YrmtTsUpwT66InQ==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/linux-s390x": {
|
||||
"version": "0.27.7",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.7.tgz",
|
||||
"integrity": "sha512-2k8go8Ycu1Kb46vEelhu1vqEP+UeRVj2zY1pSuPdgvbd5ykAw82Lrro28vXUrRmzEsUV0NzCf54yARIK8r0fdw==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/linux-x64": {
|
||||
"version": "0.27.7",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.7.tgz",
|
||||
"integrity": "sha512-hzznmADPt+OmsYzw1EE33ccA+HPdIqiCRq7cQeL1Jlq2gb1+OyWBkMCrYGBJ+sxVzve2ZJEVeePbLM2iEIZSxA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/netbsd-arm64": {
|
||||
"version": "0.27.7",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.7.tgz",
|
||||
"integrity": "sha512-b6pqtrQdigZBwZxAn1UpazEisvwaIDvdbMbmrly7cDTMFnw/+3lVxxCTGOrkPVnsYIosJJXAsILG9XcQS+Yu6w==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"netbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/netbsd-x64": {
|
||||
"version": "0.27.7",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.7.tgz",
|
||||
"integrity": "sha512-OfatkLojr6U+WN5EDYuoQhtM+1xco+/6FSzJJnuWiUw5eVcicbyK3dq5EeV/QHT1uy6GoDhGbFpprUiHUYggrw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"netbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/openbsd-arm64": {
|
||||
"version": "0.27.7",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.7.tgz",
|
||||
"integrity": "sha512-AFuojMQTxAz75Fo8idVcqoQWEHIXFRbOc1TrVcFSgCZtQfSdc1RXgB3tjOn/krRHENUB4j00bfGjyl2mJrU37A==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"openbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/openbsd-x64": {
|
||||
"version": "0.27.7",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.7.tgz",
|
||||
"integrity": "sha512-+A1NJmfM8WNDv5CLVQYJ5PshuRm/4cI6WMZRg1by1GwPIQPCTs1GLEUHwiiQGT5zDdyLiRM/l1G0Pv54gvtKIg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"openbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/openharmony-arm64": {
|
||||
"version": "0.27.7",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.7.tgz",
|
||||
"integrity": "sha512-+KrvYb/C8zA9CU/g0sR6w2RBw7IGc5J2BPnc3dYc5VJxHCSF1yNMxTV5LQ7GuKteQXZtspjFbiuW5/dOj7H4Yw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"openharmony"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/sunos-x64": {
|
||||
"version": "0.27.7",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.7.tgz",
|
||||
"integrity": "sha512-ikktIhFBzQNt/QDyOL580ti9+5mL/YZeUPKU2ivGtGjdTYoqz6jObj6nOMfhASpS4GU4Q/Clh1QtxWAvcYKamA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"sunos"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/win32-arm64": {
|
||||
"version": "0.27.7",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.7.tgz",
|
||||
"integrity": "sha512-7yRhbHvPqSpRUV7Q20VuDwbjW5kIMwTHpptuUzV+AA46kiPze5Z7qgt6CLCK3pWFrHeNfDd1VKgyP4O+ng17CA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/win32-ia32": {
|
||||
"version": "0.27.7",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.7.tgz",
|
||||
"integrity": "sha512-SmwKXe6VHIyZYbBLJrhOoCJRB/Z1tckzmgTLfFYOfpMAx63BJEaL9ExI8x7v0oAO3Zh6D/Oi1gVxEYr5oUCFhw==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/@esbuild/win32-x64": {
|
||||
"version": "0.27.7",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.7.tgz",
|
||||
"integrity": "sha512-56hiAJPhwQ1R4i+21FVF7V8kSD5zZTdHcVuRFMW0hn753vVfQN8xlx4uOPT4xoGH0Z/oVATuR82AiqSTDIpaHg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/esbuild": {
|
||||
"version": "0.27.7",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.7.tgz",
|
||||
"integrity": "sha512-IxpibTjyVnmrIQo5aqNpCgoACA/dTKLTlhMHihVHhdkxKyPO1uBBthumT0rdHmcsk9uMonIWS0m4FljWzILh3w==",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"esbuild": "bin/esbuild"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@esbuild/aix-ppc64": "0.27.7",
|
||||
"@esbuild/android-arm": "0.27.7",
|
||||
"@esbuild/android-arm64": "0.27.7",
|
||||
"@esbuild/android-x64": "0.27.7",
|
||||
"@esbuild/darwin-arm64": "0.27.7",
|
||||
"@esbuild/darwin-x64": "0.27.7",
|
||||
"@esbuild/freebsd-arm64": "0.27.7",
|
||||
"@esbuild/freebsd-x64": "0.27.7",
|
||||
"@esbuild/linux-arm": "0.27.7",
|
||||
"@esbuild/linux-arm64": "0.27.7",
|
||||
"@esbuild/linux-ia32": "0.27.7",
|
||||
"@esbuild/linux-loong64": "0.27.7",
|
||||
"@esbuild/linux-mips64el": "0.27.7",
|
||||
"@esbuild/linux-ppc64": "0.27.7",
|
||||
"@esbuild/linux-riscv64": "0.27.7",
|
||||
"@esbuild/linux-s390x": "0.27.7",
|
||||
"@esbuild/linux-x64": "0.27.7",
|
||||
"@esbuild/netbsd-arm64": "0.27.7",
|
||||
"@esbuild/netbsd-x64": "0.27.7",
|
||||
"@esbuild/openbsd-arm64": "0.27.7",
|
||||
"@esbuild/openbsd-x64": "0.27.7",
|
||||
"@esbuild/openharmony-arm64": "0.27.7",
|
||||
"@esbuild/sunos-x64": "0.27.7",
|
||||
"@esbuild/win32-arm64": "0.27.7",
|
||||
"@esbuild/win32-ia32": "0.27.7",
|
||||
"@esbuild/win32-x64": "0.27.7"
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/fdir": {
|
||||
"version": "6.5.0",
|
||||
"resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",
|
||||
@@ -16718,9 +17171,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/vite/node_modules/picomatch": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz",
|
||||
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
|
||||
"version": "4.0.4",
|
||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz",
|
||||
"integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
@@ -16802,9 +17255,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/vitest/node_modules/picomatch": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz",
|
||||
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
|
||||
"version": "4.0.4",
|
||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz",
|
||||
"integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
@@ -17234,15 +17687,18 @@
|
||||
}
|
||||
},
|
||||
"node_modules/yaml": {
|
||||
"version": "2.8.1",
|
||||
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz",
|
||||
"integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==",
|
||||
"version": "2.8.3",
|
||||
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.3.tgz",
|
||||
"integrity": "sha512-AvbaCLOO2Otw/lW5bmh9d/WEdcDFdQp2Z2ZUH3pX9U2ihyUY0nvLv7J6TrWowklRGPYbB/IuIMfYgxaCPg5Bpg==",
|
||||
"license": "ISC",
|
||||
"bin": {
|
||||
"yaml": "bin.mjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 14.6"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/eemeli"
|
||||
}
|
||||
},
|
||||
"node_modules/yargs": {
|
||||
@@ -17768,13 +18224,13 @@
|
||||
"node": ">=20"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@github/keytar": "^7.10.6",
|
||||
"@lydell/node-pty": "1.1.0",
|
||||
"@lydell/node-pty-darwin-arm64": "1.1.0",
|
||||
"@lydell/node-pty-darwin-x64": "1.1.0",
|
||||
"@lydell/node-pty-linux-x64": "1.1.0",
|
||||
"@lydell/node-pty-win32-arm64": "1.1.0",
|
||||
"@lydell/node-pty-win32-x64": "1.1.0",
|
||||
"keytar": "^7.9.0",
|
||||
"node-pty": "^1.0.0"
|
||||
}
|
||||
},
|
||||
@@ -17923,9 +18379,9 @@
|
||||
}
|
||||
},
|
||||
"packages/core/node_modules/picomatch": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz",
|
||||
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
|
||||
"version": "4.0.4",
|
||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz",
|
||||
"integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
|
||||
+1
-1
@@ -150,13 +150,13 @@
|
||||
"simple-git": "^3.28.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@github/keytar": "^7.10.6",
|
||||
"@lydell/node-pty": "1.1.0",
|
||||
"@lydell/node-pty-darwin-arm64": "1.1.0",
|
||||
"@lydell/node-pty-darwin-x64": "1.1.0",
|
||||
"@lydell/node-pty-linux-x64": "1.1.0",
|
||||
"@lydell/node-pty-win32-arm64": "1.1.0",
|
||||
"@lydell/node-pty-win32-x64": "1.1.0",
|
||||
"keytar": "^7.9.0",
|
||||
"node-pty": "^1.0.0"
|
||||
},
|
||||
"lint-staged": {
|
||||
|
||||
@@ -101,8 +101,8 @@ export class AddMemoryCommand implements Command {
|
||||
const tool = toolRegistry.getTool(result.toolName);
|
||||
if (tool) {
|
||||
const abortController = new AbortController();
|
||||
const signal = abortController.signal;
|
||||
await tool.buildAndExecute(result.toolArgs, signal, undefined, {
|
||||
const abortSignal = abortController.signal;
|
||||
await tool.buildAndExecute(result.toolArgs, abortSignal, undefined, {
|
||||
shellExecutionConfig: {
|
||||
sanitizationConfig: DEFAULT_SANITIZATION_CONFIG,
|
||||
sandboxManager: loopContext.sandboxManager,
|
||||
|
||||
@@ -1129,7 +1129,9 @@ export class Session {
|
||||
});
|
||||
}
|
||||
|
||||
const toolResult: ToolResult = await invocation.execute(abortSignal);
|
||||
const toolResult: ToolResult = await invocation.execute({
|
||||
abortSignal,
|
||||
});
|
||||
const content = toToolCallContent(toolResult);
|
||||
|
||||
const updateContent: acp.ToolCallContent[] = content ? [content] : [];
|
||||
@@ -1671,7 +1673,7 @@ export class Session {
|
||||
kind: toAcpToolKind(readManyFilesTool.kind),
|
||||
});
|
||||
|
||||
const result = await invocation.execute(abortSignal);
|
||||
const result = await invocation.execute({ abortSignal });
|
||||
const content = toToolCallContent(result) || {
|
||||
type: 'content',
|
||||
content: {
|
||||
|
||||
@@ -153,5 +153,49 @@ describe('footerItems', () => {
|
||||
expect(state.orderedIds).toContain('auth');
|
||||
expect(state.selectedIds.has('auth')).toBe(true);
|
||||
});
|
||||
|
||||
it('includes context-used in selectedIds when hideContextPercentage is false and items is undefined', () => {
|
||||
const settings = createMockSettings({
|
||||
ui: {
|
||||
footer: {
|
||||
hideContextPercentage: false,
|
||||
},
|
||||
},
|
||||
}).merged;
|
||||
|
||||
const state = resolveFooterState(settings);
|
||||
expect(state.selectedIds.has('context-used')).toBe(true);
|
||||
expect(state.orderedIds).toContain('context-used');
|
||||
});
|
||||
|
||||
it('does not include context-used in selectedIds when hideContextPercentage is true (default)', () => {
|
||||
const settings = createMockSettings({
|
||||
ui: {
|
||||
footer: {
|
||||
hideContextPercentage: true,
|
||||
},
|
||||
},
|
||||
}).merged;
|
||||
|
||||
const state = resolveFooterState(settings);
|
||||
expect(state.selectedIds.has('context-used')).toBe(false);
|
||||
// context-used should still be in orderedIds (as unselected)
|
||||
expect(state.orderedIds).toContain('context-used');
|
||||
});
|
||||
|
||||
it('persisted items array takes precedence over hideContextPercentage', () => {
|
||||
const settings = createMockSettings({
|
||||
ui: {
|
||||
footer: {
|
||||
items: ['workspace', 'model-name'],
|
||||
hideContextPercentage: false,
|
||||
},
|
||||
},
|
||||
}).merged;
|
||||
|
||||
const state = resolveFooterState(settings);
|
||||
// items array explicitly omits context-used, so it should not be selected
|
||||
expect(state.selectedIds.has('context-used')).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -67,6 +67,11 @@ describe('Policy Engine Integration Tests', () => {
|
||||
expect(
|
||||
(await engine.check({ name: 'unknown_tool' }, undefined)).decision,
|
||||
).toBe(PolicyDecision.ASK_USER);
|
||||
|
||||
// invoke_agent should be allowed by default (via agents.toml)
|
||||
expect(
|
||||
(await engine.check({ name: 'invoke_agent' }, undefined)).decision,
|
||||
).toBe(PolicyDecision.ALLOW);
|
||||
});
|
||||
|
||||
it('should handle MCP server wildcard patterns correctly', async () => {
|
||||
@@ -350,9 +355,37 @@ describe('Policy Engine Integration Tests', () => {
|
||||
(await engine.check({ name: 'get_internal_docs' }, undefined)).decision,
|
||||
).toBe(PolicyDecision.ALLOW);
|
||||
expect(
|
||||
(await engine.check({ name: 'cli_help' }, undefined)).decision,
|
||||
(
|
||||
await engine.check(
|
||||
{ name: 'invoke_agent', args: { agent_name: 'cli_help' } },
|
||||
undefined,
|
||||
)
|
||||
).decision,
|
||||
).toBe(PolicyDecision.ALLOW);
|
||||
|
||||
// codebase_investigator should be allowed in Plan mode
|
||||
expect(
|
||||
(
|
||||
await engine.check(
|
||||
{
|
||||
name: 'invoke_agent',
|
||||
args: { agent_name: 'codebase_investigator' },
|
||||
},
|
||||
undefined,
|
||||
)
|
||||
).decision,
|
||||
).toBe(PolicyDecision.ALLOW);
|
||||
|
||||
// Unknown agents should be denied in Plan mode (via catch-all)
|
||||
expect(
|
||||
(
|
||||
await engine.check(
|
||||
{ name: 'invoke_agent', args: { agent_name: 'unknown_agent' } },
|
||||
undefined,
|
||||
)
|
||||
).decision,
|
||||
).toBe(PolicyDecision.DENY);
|
||||
|
||||
// Other tools should be denied via catch all
|
||||
expect(
|
||||
(await engine.check({ name: 'replace' }, undefined)).decision,
|
||||
|
||||
@@ -439,6 +439,16 @@ const SETTINGS_SCHEMA = {
|
||||
description: 'User interface settings.',
|
||||
showInDialog: false,
|
||||
properties: {
|
||||
debugRainbow: {
|
||||
type: 'boolean',
|
||||
label: 'Debug Rainbow',
|
||||
category: 'UI',
|
||||
requiresRestart: true,
|
||||
default: false,
|
||||
description:
|
||||
'Enable debug rainbow rendering. Only useful for debugging rendering bugs and performance issues.',
|
||||
showInDialog: false,
|
||||
},
|
||||
theme: {
|
||||
type: 'string',
|
||||
label: 'Theme',
|
||||
|
||||
@@ -304,6 +304,25 @@ describe('gemini.tsx main function', () => {
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('should suppress AbortError and not open debug console', async () => {
|
||||
const debugLoggerErrorSpy = vi.spyOn(debugLogger, 'error');
|
||||
const debugLoggerLogSpy = vi.spyOn(debugLogger, 'log');
|
||||
const abortError = new DOMException(
|
||||
'The operation was aborted.',
|
||||
'AbortError',
|
||||
);
|
||||
|
||||
setupUnhandledRejectionHandler();
|
||||
process.emit('unhandledRejection', abortError, Promise.resolve());
|
||||
|
||||
await new Promise(process.nextTick);
|
||||
|
||||
expect(debugLoggerErrorSpy).not.toHaveBeenCalled();
|
||||
expect(debugLoggerLogSpy).toHaveBeenCalledWith(
|
||||
expect.stringContaining('Suppressed unhandled AbortError'),
|
||||
);
|
||||
});
|
||||
|
||||
it('should log unhandled promise rejections and open debug console on first error', async () => {
|
||||
const processExitSpy = vi
|
||||
.spyOn(process, 'exit')
|
||||
@@ -1409,12 +1428,13 @@ describe('startInteractiveUI', () => {
|
||||
vi.mock('./ui/utils/updateCheck.js', () => ({
|
||||
checkForUpdates: vi.fn(() => Promise.resolve(null)),
|
||||
}));
|
||||
|
||||
vi.mock('./utils/cleanup.js', () => ({
|
||||
cleanupCheckpoints: vi.fn(() => Promise.resolve()),
|
||||
registerCleanup: vi.fn(),
|
||||
removeCleanup: vi.fn(),
|
||||
runExitCleanup: vi.fn(),
|
||||
registerSyncCleanup: vi.fn(),
|
||||
removeSyncCleanup: vi.fn(),
|
||||
registerTelemetryConfig: vi.fn(),
|
||||
setupSignalHandlers: vi.fn(),
|
||||
setupTtyCheck: vi.fn(() => vi.fn()),
|
||||
|
||||
@@ -164,6 +164,14 @@ export function getNodeMemoryArgs(isDebugMode: boolean): string[] {
|
||||
export function setupUnhandledRejectionHandler() {
|
||||
let unhandledRejectionOccurred = false;
|
||||
process.on('unhandledRejection', (reason, _promise) => {
|
||||
// AbortError is expected when the user cancels a request (e.g. pressing ESC).
|
||||
// It may surface as an unhandled rejection due to async timing in the
|
||||
// streaming pipeline, but it is not a bug.
|
||||
if (reason instanceof Error && reason.name === 'AbortError') {
|
||||
debugLogger.log(`Suppressed unhandled AbortError: ${reason.message}`);
|
||||
return;
|
||||
}
|
||||
|
||||
const errorMessage = `=========================================
|
||||
This is an unexpected error. Please file a bug report using the /bug tool.
|
||||
CRITICAL: Unhandled Promise Rejection!
|
||||
|
||||
@@ -142,7 +142,9 @@ vi.mock('./utils/cleanup.js', async (importOriginal) => {
|
||||
...actual,
|
||||
cleanupCheckpoints: vi.fn().mockResolvedValue(undefined),
|
||||
registerCleanup: vi.fn(),
|
||||
removeCleanup: vi.fn(),
|
||||
registerSyncCleanup: vi.fn(),
|
||||
removeSyncCleanup: vi.fn(),
|
||||
registerTelemetryConfig: vi.fn(),
|
||||
runExitCleanup: vi.fn().mockResolvedValue(undefined),
|
||||
};
|
||||
|
||||
@@ -9,7 +9,11 @@ import { render } from 'ink';
|
||||
import { basename } from 'node:path';
|
||||
import { AppContainer } from './ui/AppContainer.js';
|
||||
import { ConsolePatcher } from './ui/utils/ConsolePatcher.js';
|
||||
import { registerCleanup, setupTtyCheck } from './utils/cleanup.js';
|
||||
import {
|
||||
registerCleanup,
|
||||
removeCleanup,
|
||||
setupTtyCheck,
|
||||
} from './utils/cleanup.js';
|
||||
import {
|
||||
type StartupWarning,
|
||||
type Config,
|
||||
@@ -89,7 +93,6 @@ export async function startInteractiveUI(
|
||||
debugMode: config.getDebugMode(),
|
||||
});
|
||||
consolePatcher.patch();
|
||||
registerCleanup(consolePatcher.cleanup);
|
||||
|
||||
const { stdout: inkStdout, stderr: inkStderr } = createWorkingStdio();
|
||||
|
||||
@@ -163,14 +166,15 @@ export async function startInteractiveUI(
|
||||
settings.merged.ui.incrementalRendering !== false &&
|
||||
useAlternateBuffer &&
|
||||
!isShpool,
|
||||
debugRainbow: settings.merged.ui.debugRainbow === true,
|
||||
},
|
||||
);
|
||||
|
||||
let cleanupLineWrapping: (() => void) | undefined;
|
||||
if (useAlternateBuffer) {
|
||||
disableLineWrapping();
|
||||
registerCleanup(() => {
|
||||
enableLineWrapping();
|
||||
});
|
||||
cleanupLineWrapping = () => enableLineWrapping();
|
||||
registerCleanup(cleanupLineWrapping);
|
||||
}
|
||||
|
||||
checkForUpdates(settings)
|
||||
@@ -184,9 +188,48 @@ export async function startInteractiveUI(
|
||||
}
|
||||
});
|
||||
|
||||
registerCleanup(() => instance.unmount());
|
||||
const cleanupUnmount = () => instance.unmount();
|
||||
registerCleanup(cleanupUnmount);
|
||||
|
||||
registerCleanup(setupTtyCheck());
|
||||
const cleanupTtyCheck = setupTtyCheck();
|
||||
registerCleanup(cleanupTtyCheck);
|
||||
|
||||
const cleanupConsolePatcher = () => consolePatcher.cleanup();
|
||||
registerCleanup(cleanupConsolePatcher);
|
||||
|
||||
try {
|
||||
await instance.waitUntilExit();
|
||||
} finally {
|
||||
try {
|
||||
removeCleanup(cleanupConsolePatcher);
|
||||
cleanupConsolePatcher();
|
||||
} catch (e: unknown) {
|
||||
debugLogger.error('Error cleaning up console patcher:', e);
|
||||
}
|
||||
|
||||
try {
|
||||
removeCleanup(cleanupUnmount);
|
||||
instance.unmount();
|
||||
} catch (e: unknown) {
|
||||
debugLogger.error('Error unmounting Ink instance:', e);
|
||||
}
|
||||
|
||||
try {
|
||||
removeCleanup(cleanupTtyCheck);
|
||||
cleanupTtyCheck();
|
||||
} catch (e: unknown) {
|
||||
debugLogger.error('Error in TTY cleanup:', e);
|
||||
}
|
||||
|
||||
if (cleanupLineWrapping) {
|
||||
try {
|
||||
removeCleanup(cleanupLineWrapping);
|
||||
cleanupLineWrapping();
|
||||
} catch (e: unknown) {
|
||||
debugLogger.error('Error restoring line wrapping:', e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setWindowTitle(title: string, settings: LoadedSettings) {
|
||||
|
||||
@@ -3290,6 +3290,85 @@ describe('AppContainer State Management', () => {
|
||||
unmount();
|
||||
});
|
||||
|
||||
it('does not reset the hint timer when overflowingIdsSize decreases', async () => {
|
||||
const { unmount } = await act(async () => renderAppContainer());
|
||||
await waitFor(() => expect(capturedOverflowActions).toBeTruthy());
|
||||
|
||||
act(() => {
|
||||
capturedOverflowActions.addOverflowingId('test-id-1');
|
||||
capturedOverflowActions.addOverflowingId('test-id-2');
|
||||
});
|
||||
|
||||
await waitFor(() => {
|
||||
expect(capturedUIState.showIsExpandableHint).toBe(true);
|
||||
});
|
||||
|
||||
act(() => {
|
||||
vi.advanceTimersByTime(EXPAND_HINT_DURATION_MS / 2);
|
||||
});
|
||||
expect(capturedUIState.showIsExpandableHint).toBe(true);
|
||||
|
||||
act(() => {
|
||||
capturedOverflowActions.removeOverflowingId('test-id-2');
|
||||
});
|
||||
|
||||
act(() => {
|
||||
vi.advanceTimersByTime(1);
|
||||
});
|
||||
|
||||
act(() => {
|
||||
vi.advanceTimersByTime(EXPAND_HINT_DURATION_MS / 2);
|
||||
});
|
||||
|
||||
await waitFor(() => {
|
||||
expect(capturedUIState.showIsExpandableHint).toBe(false);
|
||||
});
|
||||
|
||||
unmount();
|
||||
});
|
||||
|
||||
it('does not auto-reset the hint timer for new overflow while expanded', async () => {
|
||||
const { stdin, unmount } = await act(async () => renderAppContainer());
|
||||
await waitFor(() => expect(capturedOverflowActions).toBeTruthy());
|
||||
|
||||
act(() => {
|
||||
capturedOverflowActions.addOverflowingId('test-id-1');
|
||||
});
|
||||
|
||||
await waitFor(() => {
|
||||
expect(capturedUIState.showIsExpandableHint).toBe(true);
|
||||
});
|
||||
|
||||
act(() => {
|
||||
stdin.write('\x0f'); // Ctrl+O
|
||||
});
|
||||
|
||||
expect(capturedUIState.constrainHeight).toBe(false);
|
||||
|
||||
act(() => {
|
||||
vi.advanceTimersByTime(EXPAND_HINT_DURATION_MS - 1000);
|
||||
});
|
||||
expect(capturedUIState.showIsExpandableHint).toBe(true);
|
||||
|
||||
act(() => {
|
||||
capturedOverflowActions.addOverflowingId('test-id-2');
|
||||
});
|
||||
|
||||
act(() => {
|
||||
vi.advanceTimersByTime(1);
|
||||
});
|
||||
|
||||
act(() => {
|
||||
vi.advanceTimersByTime(1000);
|
||||
});
|
||||
|
||||
await waitFor(() => {
|
||||
expect(capturedUIState.showIsExpandableHint).toBe(false);
|
||||
});
|
||||
|
||||
unmount();
|
||||
});
|
||||
|
||||
it('toggles expansion state and resets the hint timer when Ctrl+O is pressed in Standard Mode', async () => {
|
||||
const { stdin, unmount } = await act(async () => renderAppContainer());
|
||||
await waitFor(() => expect(capturedOverflowActions).toBeTruthy());
|
||||
|
||||
@@ -89,6 +89,7 @@ import {
|
||||
buildUserSteeringHintPrompt,
|
||||
logBillingEvent,
|
||||
ApiKeyUpdatedEvent,
|
||||
LegacyAgentProtocol,
|
||||
type InjectionSource,
|
||||
startMemoryService,
|
||||
} from '@google/gemini-cli-core';
|
||||
@@ -118,6 +119,7 @@ import { computeTerminalTitle } from '../utils/windowTitle.js';
|
||||
import { useTextBuffer } from './components/shared/text-buffer.js';
|
||||
import { useLogger } from './hooks/useLogger.js';
|
||||
import { useGeminiStream } from './hooks/useGeminiStream.js';
|
||||
import { useAgentStream } from './hooks/useAgentStream.js';
|
||||
import { type BackgroundTask } from './hooks/useExecutionLifecycle.js';
|
||||
import { useVim } from './hooks/vim.js';
|
||||
import { type LoadableSettingScope, SettingScope } from '../config/settings.js';
|
||||
@@ -134,7 +136,11 @@ import { type IdeIntegrationNudgeResult } from './IdeIntegrationNudge.js';
|
||||
import { appEvents, AppEvent, TransientMessageType } from '../utils/events.js';
|
||||
import { type UpdateObject } from './utils/updateCheck.js';
|
||||
import { setUpdateHandler } from '../utils/handleAutoUpdate.js';
|
||||
import { registerCleanup, runExitCleanup } from '../utils/cleanup.js';
|
||||
import {
|
||||
registerCleanup,
|
||||
removeCleanup,
|
||||
runExitCleanup,
|
||||
} from '../utils/cleanup.js';
|
||||
import { relaunchApp } from '../utils/processUtils.js';
|
||||
import type { SessionInfo } from '../utils/sessionUtils.js';
|
||||
import { useMessageQueue } from './hooks/useMessageQueue.js';
|
||||
@@ -181,6 +187,7 @@ import {
|
||||
isToolAwaitingConfirmation,
|
||||
getAllToolCalls,
|
||||
} from './utils/historyUtils.js';
|
||||
import { shouldAutoTriggerExpandHint } from './utils/expandHint.js';
|
||||
|
||||
interface AppContainerProps {
|
||||
config: Config;
|
||||
@@ -323,24 +330,35 @@ export const AppContainer = (props: AppContainerProps) => {
|
||||
const showIsExpandableHint = Boolean(expandHintTrigger);
|
||||
const overflowState = useOverflowState();
|
||||
const overflowingIdsSize = overflowState?.overflowingIds.size ?? 0;
|
||||
const hasOverflowState = overflowingIdsSize > 0 || !constrainHeight;
|
||||
const previousOverflowingIdsSizeRef = useRef(0);
|
||||
|
||||
/**
|
||||
* Manages the visibility and x-second timer for the expansion hint.
|
||||
*
|
||||
* This effect triggers the timer countdown whenever an overflow is detected
|
||||
* or the user manually toggles the expansion state with Ctrl+O.
|
||||
* By depending on overflowingIdsSize, the timer resets when *new* views
|
||||
* overflow, but avoids infinitely resetting during single-view streaming.
|
||||
* while the response is actually constrained. The Ctrl+O handler still
|
||||
* refreshes the hint manually when the user toggles expansion.
|
||||
*
|
||||
* In alternate buffer mode, we don't trigger the hint automatically on overflow
|
||||
* to avoid noise, but the user can still trigger it manually with Ctrl+O.
|
||||
* We only auto-refresh when the number of overflowing regions grows. That
|
||||
* keeps the "show more" hint responsive for newly truncated content without
|
||||
* retriggering on layout churn, overflow shrinkage, or while the content is
|
||||
* already expanded.
|
||||
*/
|
||||
useEffect(() => {
|
||||
if (hasOverflowState) {
|
||||
const previousOverflowingIdsSize = previousOverflowingIdsSizeRef.current;
|
||||
|
||||
if (
|
||||
shouldAutoTriggerExpandHint({
|
||||
constrainHeight,
|
||||
overflowingIdsSize,
|
||||
previousOverflowingIdsSize,
|
||||
})
|
||||
) {
|
||||
triggerExpandHint(true);
|
||||
}
|
||||
}, [hasOverflowState, overflowingIdsSize, triggerExpandHint]);
|
||||
|
||||
previousOverflowingIdsSizeRef.current = overflowingIdsSize;
|
||||
}, [constrainHeight, overflowingIdsSize, triggerExpandHint]);
|
||||
|
||||
const [defaultBannerText, setDefaultBannerText] = useState('');
|
||||
const [warningBannerText, setWarningBannerText] = useState('');
|
||||
@@ -517,7 +535,7 @@ export const AppContainer = (props: AppContainerProps) => {
|
||||
debugLogger.warn('Background summary generation failed:', e);
|
||||
});
|
||||
})();
|
||||
registerCleanup(async () => {
|
||||
const cleanupFn = async () => {
|
||||
// Turn off mouse scroll.
|
||||
disableMouseEvents();
|
||||
|
||||
@@ -533,7 +551,15 @@ export const AppContainer = (props: AppContainerProps) => {
|
||||
|
||||
// Fire SessionEnd hook on cleanup (only if hooks are enabled)
|
||||
await config?.getHookSystem()?.fireSessionEndEvent(SessionEndReason.Exit);
|
||||
});
|
||||
};
|
||||
registerCleanup(cleanupFn);
|
||||
|
||||
return () => {
|
||||
removeCleanup(cleanupFn);
|
||||
cleanupFn().catch((e: unknown) =>
|
||||
debugLogger.error('Error during cleanup:', e),
|
||||
);
|
||||
};
|
||||
// Disable the dependencies check here. historyManager gets flagged
|
||||
// but we don't want to react to changes to it because each new history
|
||||
// item, including the ones from the start session hook will cause a
|
||||
@@ -1161,6 +1187,46 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
||||
};
|
||||
}, [config]);
|
||||
|
||||
const streamAgent = useMemo(
|
||||
() =>
|
||||
config?.getAgentSessionInteractiveEnabled()
|
||||
? new LegacyAgentProtocol({ config, getPreferredEditor })
|
||||
: undefined,
|
||||
[config, getPreferredEditor],
|
||||
);
|
||||
|
||||
const activeStream = streamAgent
|
||||
? // eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
useAgentStream({
|
||||
agent: streamAgent,
|
||||
addItem: historyManager.addItem,
|
||||
onCancelSubmit,
|
||||
isShellFocused: embeddedShellFocused,
|
||||
logger,
|
||||
})
|
||||
: // eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
useGeminiStream(
|
||||
config.getGeminiClient(),
|
||||
historyManager.history,
|
||||
historyManager.addItem,
|
||||
config,
|
||||
settings,
|
||||
setDebugMessage,
|
||||
handleSlashCommand,
|
||||
shellModeActive,
|
||||
getPreferredEditor,
|
||||
onAuthError,
|
||||
performMemoryRefresh,
|
||||
modelSwitchedFromQuotaError,
|
||||
setModelSwitchedFromQuotaError,
|
||||
onCancelSubmit,
|
||||
setEmbeddedShellFocused,
|
||||
terminalWidth,
|
||||
terminalHeight,
|
||||
embeddedShellFocused,
|
||||
consumePendingHints,
|
||||
);
|
||||
|
||||
const {
|
||||
streamingState,
|
||||
submitQuery,
|
||||
@@ -1180,27 +1246,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
||||
backgroundTasks,
|
||||
dismissBackgroundTask,
|
||||
retryStatus,
|
||||
} = useGeminiStream(
|
||||
config.getGeminiClient(),
|
||||
historyManager.history,
|
||||
historyManager.addItem,
|
||||
config,
|
||||
settings,
|
||||
setDebugMessage,
|
||||
handleSlashCommand,
|
||||
shellModeActive,
|
||||
getPreferredEditor,
|
||||
onAuthError,
|
||||
performMemoryRefresh,
|
||||
modelSwitchedFromQuotaError,
|
||||
setModelSwitchedFromQuotaError,
|
||||
onCancelSubmit,
|
||||
setEmbeddedShellFocused,
|
||||
terminalWidth,
|
||||
terminalHeight,
|
||||
embeddedShellFocused,
|
||||
consumePendingHints,
|
||||
);
|
||||
} = activeStream;
|
||||
|
||||
const pendingHistoryItems = useMemo(
|
||||
() => [...pendingSlashCommandHistoryItems, ...pendingGeminiHistoryItems],
|
||||
@@ -1783,7 +1829,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
||||
if (keyMatchers[Command.QUIT](key)) {
|
||||
// If the user presses Ctrl+C, we want to cancel any ongoing requests.
|
||||
// This should happen regardless of the count.
|
||||
cancelOngoingRequest?.();
|
||||
void cancelOngoingRequest?.();
|
||||
|
||||
handleCtrlCPress();
|
||||
return true;
|
||||
|
||||
@@ -15,7 +15,6 @@ export const settingsCommand: SlashCommand = {
|
||||
description: 'View and edit Gemini CLI settings',
|
||||
kind: CommandKind.BUILT_IN,
|
||||
autoExecute: true,
|
||||
isSafeConcurrent: true,
|
||||
action: (_context, _args): OpenDialogActionReturn => ({
|
||||
type: 'dialog',
|
||||
dialog: 'settings',
|
||||
|
||||
@@ -13,7 +13,11 @@ import { useUIState } from '../contexts/UIStateContext.js';
|
||||
import { useKeypress, type Key } from '../hooks/useKeypress.js';
|
||||
import { Command } from '../key/keyMatchers.js';
|
||||
import { FooterRow, type FooterRowItem } from './Footer.js';
|
||||
import { ALL_ITEMS, resolveFooterState } from '../../config/footerItems.js';
|
||||
import {
|
||||
ALL_ITEMS,
|
||||
resolveFooterState,
|
||||
deriveItemsFromLegacySettings,
|
||||
} from '../../config/footerItems.js';
|
||||
import { SettingScope } from '../../config/settings.js';
|
||||
import { BaseSelectionList } from './shared/BaseSelectionList.js';
|
||||
import type { SelectionListItem } from '../hooks/useSelectionList.js';
|
||||
@@ -137,17 +141,16 @@ export const FooterConfigDialog: React.FC<FooterConfigDialogProps> = ({
|
||||
const handleSaveAndClose = useCallback(() => {
|
||||
const finalItems = orderedIds.filter((id: string) => selectedIds.has(id));
|
||||
const currentSetting = settings.merged.ui?.footer?.items;
|
||||
if (JSON.stringify(finalItems) !== JSON.stringify(currentSetting)) {
|
||||
// When items haven't been explicitly set yet (legacy mode), compare against
|
||||
// the legacy-derived items to avoid persisting items and silently overriding
|
||||
// legacy boolean settings like hideContextPercentage.
|
||||
const effectiveCurrent =
|
||||
currentSetting ?? deriveItemsFromLegacySettings(settings.merged);
|
||||
if (JSON.stringify(finalItems) !== JSON.stringify(effectiveCurrent)) {
|
||||
setSetting(SettingScope.User, 'ui.footer.items', finalItems);
|
||||
}
|
||||
onClose?.();
|
||||
}, [
|
||||
orderedIds,
|
||||
selectedIds,
|
||||
setSetting,
|
||||
settings.merged.ui?.footer?.items,
|
||||
onClose,
|
||||
]);
|
||||
}, [orderedIds, selectedIds, setSetting, settings.merged, onClose]);
|
||||
|
||||
const handleResetToDefaults = useCallback(() => {
|
||||
setSetting(SettingScope.User, 'ui.footer.items', undefined);
|
||||
|
||||
@@ -22,8 +22,7 @@ import { theme } from '../../semantic-colors.js';
|
||||
import { useConfig } from '../../contexts/ConfigContext.js';
|
||||
import { isShellTool } from './ToolShared.js';
|
||||
import {
|
||||
shouldHideToolCall,
|
||||
CoreToolCallStatus,
|
||||
isVisibleInToolGroup,
|
||||
Kind,
|
||||
EDIT_DISPLAY_NAME,
|
||||
GLOB_DISPLAY_NAME,
|
||||
@@ -36,6 +35,7 @@ import {
|
||||
READ_MANY_FILES_DISPLAY_NAME,
|
||||
isFileDiff,
|
||||
} from '@google/gemini-cli-core';
|
||||
import { buildToolVisibilityContextFromDisplay } from '../../utils/historyUtils.js';
|
||||
import { useUIState } from '../../contexts/UIStateContext.js';
|
||||
import { getToolGroupBorderAppearance } from '../../utils/borderStyles.js';
|
||||
import { useSettings } from '../../contexts/SettingsContext.js';
|
||||
@@ -125,40 +125,13 @@ export const ToolGroupMessage: React.FC<ToolGroupMessageProps> = ({
|
||||
// Filter out tool calls that should be hidden (e.g. in-progress Ask User, or Plan Mode operations).
|
||||
const visibleToolCalls = useMemo(
|
||||
() =>
|
||||
allToolCalls.filter((t) => {
|
||||
// Hide internal errors unless full verbosity
|
||||
if (
|
||||
isLowErrorVerbosity &&
|
||||
t.status === CoreToolCallStatus.Error &&
|
||||
!t.isClientInitiated
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
// Standard hiding logic (e.g. Plan Mode internal edits)
|
||||
if (
|
||||
shouldHideToolCall({
|
||||
displayName: t.name,
|
||||
status: t.status,
|
||||
approvalMode: t.approvalMode,
|
||||
hasResultDisplay: !!t.resultDisplay,
|
||||
parentCallId: t.parentCallId,
|
||||
})
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// We HIDE tools that are still in pre-execution states (Confirming, Pending)
|
||||
// from the History log. They live in the Global Queue or wait for their turn.
|
||||
// Only show tools that are actually running or finished.
|
||||
const displayStatus = mapCoreStatusToDisplayStatus(t.status);
|
||||
|
||||
// We hide Confirming tools from the history log because they are
|
||||
// currently being rendered in the interactive ToolConfirmationQueue.
|
||||
// We show everything else, including Pending (waiting to run) and
|
||||
// Canceled (rejected by user), to ensure the history is complete
|
||||
// and to avoid tools "vanishing" after approval.
|
||||
return displayStatus !== ToolCallStatus.Confirming;
|
||||
}),
|
||||
allToolCalls.filter((t) =>
|
||||
// Use the unified visibility utility
|
||||
isVisibleInToolGroup(
|
||||
buildToolVisibilityContextFromDisplay(t),
|
||||
isLowErrorVerbosity ? 'low' : 'full',
|
||||
),
|
||||
),
|
||||
[allToolCalls, isLowErrorVerbosity],
|
||||
);
|
||||
|
||||
|
||||
@@ -533,7 +533,7 @@ async function readLocalFiles(
|
||||
let invocation: AnyToolInvocation | undefined = undefined;
|
||||
try {
|
||||
invocation = readManyFilesTool.build(toolArgs);
|
||||
const result = await invocation.execute(signal);
|
||||
const result = await invocation.execute({ abortSignal: signal });
|
||||
const display: IndividualToolCallDisplay = {
|
||||
callId: `client-read-${userMessageTimestamp}`,
|
||||
name: readManyFilesTool.displayName,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user