@dgxo/mashadevcli 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +393 -0
- package/bundle/builtin/skill-creator/SKILL.md +382 -0
- package/bundle/builtin/skill-creator/scripts/init_skill.cjs +239 -0
- package/bundle/builtin/skill-creator/scripts/package_skill.cjs +131 -0
- package/bundle/builtin/skill-creator/scripts/validate_skill.cjs +131 -0
- package/bundle/docs/CONTRIBUTING.md +1 -0
- package/bundle/docs/admin/enterprise-controls.md +115 -0
- package/bundle/docs/assets/connected_devtools.png +0 -0
- package/bundle/docs/assets/gemini-screenshot.png +0 -0
- package/bundle/docs/assets/monitoring-dashboard-logs.png +0 -0
- package/bundle/docs/assets/monitoring-dashboard-metrics.png +0 -0
- package/bundle/docs/assets/monitoring-dashboard-overview.png +0 -0
- package/bundle/docs/assets/release_patch.png +0 -0
- package/bundle/docs/assets/theme-ansi-light.png +0 -0
- package/bundle/docs/assets/theme-ansi.png +0 -0
- package/bundle/docs/assets/theme-atom-one.png +0 -0
- package/bundle/docs/assets/theme-ayu-light.png +0 -0
- package/bundle/docs/assets/theme-ayu.png +0 -0
- package/bundle/docs/assets/theme-custom.png +0 -0
- package/bundle/docs/assets/theme-default-light.png +0 -0
- package/bundle/docs/assets/theme-default.png +0 -0
- package/bundle/docs/assets/theme-dracula.png +0 -0
- package/bundle/docs/assets/theme-github-light.png +0 -0
- package/bundle/docs/assets/theme-github.png +0 -0
- package/bundle/docs/assets/theme-google-light.png +0 -0
- package/bundle/docs/assets/theme-xcode-light.png +0 -0
- package/bundle/docs/changelogs/index.md +867 -0
- package/bundle/docs/changelogs/latest.md +208 -0
- package/bundle/docs/changelogs/preview.md +187 -0
- package/bundle/docs/cli/checkpointing.md +93 -0
- package/bundle/docs/cli/cli-reference.md +115 -0
- package/bundle/docs/cli/creating-skills.md +80 -0
- package/bundle/docs/cli/custom-commands.md +327 -0
- package/bundle/docs/cli/enterprise.md +604 -0
- package/bundle/docs/cli/gemini-ignore.md +71 -0
- package/bundle/docs/cli/gemini-md.md +116 -0
- package/bundle/docs/cli/generation-settings.md +210 -0
- package/bundle/docs/cli/headless.md +50 -0
- package/bundle/docs/cli/model-routing.md +42 -0
- package/bundle/docs/cli/model.md +53 -0
- package/bundle/docs/cli/plan-mode.md +375 -0
- package/bundle/docs/cli/rewind.md +51 -0
- package/bundle/docs/cli/sandbox.md +257 -0
- package/bundle/docs/cli/session-management.md +184 -0
- package/bundle/docs/cli/settings.md +165 -0
- package/bundle/docs/cli/skills.md +134 -0
- package/bundle/docs/cli/system-prompt.md +125 -0
- package/bundle/docs/cli/telemetry.md +922 -0
- package/bundle/docs/cli/themes.md +269 -0
- package/bundle/docs/cli/token-caching.md +20 -0
- package/bundle/docs/cli/trusted-folders.md +126 -0
- package/bundle/docs/cli/tutorials/automation.md +283 -0
- package/bundle/docs/cli/tutorials/file-management.md +142 -0
- package/bundle/docs/cli/tutorials/mcp-setup.md +113 -0
- package/bundle/docs/cli/tutorials/memory-management.md +126 -0
- package/bundle/docs/cli/tutorials/session-management.md +105 -0
- package/bundle/docs/cli/tutorials/shell-commands.md +107 -0
- package/bundle/docs/cli/tutorials/skills-getting-started.md +110 -0
- package/bundle/docs/cli/tutorials/task-planning.md +93 -0
- package/bundle/docs/cli/tutorials/web-tools.md +78 -0
- package/bundle/docs/core/index.md +107 -0
- package/bundle/docs/core/remote-agents.md +84 -0
- package/bundle/docs/core/subagents.md +307 -0
- package/bundle/docs/examples/proxy-script.md +83 -0
- package/bundle/docs/extensions/best-practices.md +188 -0
- package/bundle/docs/extensions/index.md +61 -0
- package/bundle/docs/extensions/reference.md +333 -0
- package/bundle/docs/extensions/releasing.md +154 -0
- package/bundle/docs/extensions/writing-extensions.md +308 -0
- package/bundle/docs/get-started/authentication.md +402 -0
- package/bundle/docs/get-started/examples.md +139 -0
- package/bundle/docs/get-started/gemini-3.md +115 -0
- package/bundle/docs/get-started/index.md +82 -0
- package/bundle/docs/get-started/installation.md +174 -0
- package/bundle/docs/hooks/best-practices.md +709 -0
- package/bundle/docs/hooks/index.md +164 -0
- package/bundle/docs/hooks/reference.md +330 -0
- package/bundle/docs/hooks/writing-hooks.md +474 -0
- package/bundle/docs/ide-integration/ide-companion-spec.md +267 -0
- package/bundle/docs/ide-integration/index.md +224 -0
- package/bundle/docs/index.md +141 -0
- package/bundle/docs/integration-tests.md +211 -0
- package/bundle/docs/issue-and-pr-automation.md +172 -0
- package/bundle/docs/local-development.md +134 -0
- package/bundle/docs/mermaid/context.mmd +103 -0
- package/bundle/docs/mermaid/render-path.mmd +64 -0
- package/bundle/docs/npm.md +62 -0
- package/bundle/docs/redirects.json +20 -0
- package/bundle/docs/reference/commands.md +526 -0
- package/bundle/docs/reference/configuration.md +1786 -0
- package/bundle/docs/reference/keyboard-shortcuts.md +164 -0
- package/bundle/docs/reference/memport.md +246 -0
- package/bundle/docs/reference/policy-engine.md +364 -0
- package/bundle/docs/reference/tools.md +106 -0
- package/bundle/docs/release-confidence.md +164 -0
- package/bundle/docs/releases.md +540 -0
- package/bundle/docs/resources/faq.md +175 -0
- package/bundle/docs/resources/quota-and-pricing.md +165 -0
- package/bundle/docs/resources/tos-privacy.md +102 -0
- package/bundle/docs/resources/troubleshooting.md +176 -0
- package/bundle/docs/resources/uninstall.md +56 -0
- package/bundle/docs/sidebar.json +233 -0
- package/bundle/docs/tools/activate-skill.md +43 -0
- package/bundle/docs/tools/ask-user.md +95 -0
- package/bundle/docs/tools/file-system.md +129 -0
- package/bundle/docs/tools/internal-docs.md +46 -0
- package/bundle/docs/tools/mcp-server.md +1150 -0
- package/bundle/docs/tools/memory.md +35 -0
- package/bundle/docs/tools/planning.md +58 -0
- package/bundle/docs/tools/shell.md +216 -0
- package/bundle/docs/tools/todos.md +35 -0
- package/bundle/docs/tools/web-fetch.md +35 -0
- package/bundle/docs/tools/web-search.md +32 -0
- package/bundle/docs/update/update-guide.md +111 -0
- package/bundle/masha.js +563471 -0
- package/bundle/node_modules/@dgxo/mashadevcli-devtools/dist/client/main.js +89 -0
- package/bundle/node_modules/@dgxo/mashadevcli-devtools/dist/src/_client-assets.d.ts +7 -0
- package/bundle/node_modules/@dgxo/mashadevcli-devtools/dist/src/_client-assets.js +9 -0
- package/bundle/node_modules/@dgxo/mashadevcli-devtools/dist/src/_client-assets.js.map +1 -0
- package/bundle/node_modules/@dgxo/mashadevcli-devtools/dist/src/index.d.ts +48 -0
- package/bundle/node_modules/@dgxo/mashadevcli-devtools/dist/src/index.js +299 -0
- package/bundle/node_modules/@dgxo/mashadevcli-devtools/dist/src/index.js.map +1 -0
- package/bundle/node_modules/@dgxo/mashadevcli-devtools/dist/src/types.d.ts +36 -0
- package/bundle/node_modules/@dgxo/mashadevcli-devtools/dist/src/types.js +7 -0
- package/bundle/node_modules/@dgxo/mashadevcli-devtools/dist/src/types.js.map +1 -0
- package/bundle/node_modules/@dgxo/mashadevcli-devtools/package.json +32 -0
- package/bundle/policies/conseca.toml +6 -0
- package/bundle/policies/discovered.toml +8 -0
- package/bundle/policies/plan.toml +109 -0
- package/bundle/policies/read-only.toml +53 -0
- package/bundle/policies/write.toml +80 -0
- package/bundle/policies/yolo.toml +54 -0
- package/bundle/sandbox-macos-permissive-open.sb +27 -0
- package/bundle/sandbox-macos-permissive-proxied.sb +37 -0
- package/bundle/sandbox-macos-restrictive-open.sb +96 -0
- package/bundle/sandbox-macos-restrictive-proxied.sb +98 -0
- package/bundle/sandbox-macos-strict-open.sb +131 -0
- package/bundle/sandbox-macos-strict-proxied.sb +133 -0
- package/package.json +169 -0
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
# Integration tests
|
|
2
|
+
|
|
3
|
+
This document provides information about the integration testing framework used
|
|
4
|
+
in this project.
|
|
5
|
+
|
|
6
|
+
## Overview
|
|
7
|
+
|
|
8
|
+
The integration tests are designed to validate the end-to-end functionality of
|
|
9
|
+
the Gemini CLI. They execute the built binary in a controlled environment and
|
|
10
|
+
verify that it behaves as expected when interacting with the file system.
|
|
11
|
+
|
|
12
|
+
These tests are located in the `integration-tests` directory and are run using a
|
|
13
|
+
custom test runner.
|
|
14
|
+
|
|
15
|
+
## Building the tests
|
|
16
|
+
|
|
17
|
+
Prior to running any integration tests, you need to create a release bundle that
|
|
18
|
+
you want to actually test:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm run bundle
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
You must re-run this command after making any changes to the CLI source code,
|
|
25
|
+
but not after making changes to tests.
|
|
26
|
+
|
|
27
|
+
## Running the tests
|
|
28
|
+
|
|
29
|
+
The integration tests are not run as part of the default `npm run test` command.
|
|
30
|
+
They must be run explicitly using the `npm run test:integration:all` script.
|
|
31
|
+
|
|
32
|
+
The integration tests can also be run using the following shortcut:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm run test:e2e
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Running a specific set of tests
|
|
39
|
+
|
|
40
|
+
To run a subset of test files, you can use
|
|
41
|
+
`npm run <integration test command> <file_name1> ....` where <integration
|
|
42
|
+
test command> is either `test:e2e` or `test:integration*` and `<file_name>`
|
|
43
|
+
is any of the `.test.js` files in the `integration-tests/` directory. For
|
|
44
|
+
example, the following command runs `list_directory.test.js` and
|
|
45
|
+
`write_file.test.js`:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npm run test:e2e list_directory write_file
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Running a single test by name
|
|
52
|
+
|
|
53
|
+
To run a single test by its name, use the `--test-name-pattern` flag:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npm run test:e2e -- --test-name-pattern "reads a file"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Regenerating model responses
|
|
60
|
+
|
|
61
|
+
Some integration tests use faked out model responses, which may need to be
|
|
62
|
+
regenerated from time to time as the implementations change.
|
|
63
|
+
|
|
64
|
+
To regenerate these golden files, set the REGENERATE_MODEL_GOLDENS environment
|
|
65
|
+
variable to "true" when running the tests, for example:
|
|
66
|
+
|
|
67
|
+
**WARNING**: If running locally you should review these updated responses for
|
|
68
|
+
any information about yourself or your system that gemini may have included in
|
|
69
|
+
these responses.
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
REGENERATE_MODEL_GOLDENS="true" npm run test:e2e
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**WARNING**: Make sure you run **await rig.cleanup()** at the end of your test,
|
|
76
|
+
else the golden files will not be updated.
|
|
77
|
+
|
|
78
|
+
### Deflaking a test
|
|
79
|
+
|
|
80
|
+
Before adding a **new** integration test, you should test it at least 5 times
|
|
81
|
+
with the deflake script or workflow to make sure that it is not flaky.
|
|
82
|
+
|
|
83
|
+
### Deflake script
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
npm run deflake -- --runs=5 --command="npm run test:e2e -- -- --test-name-pattern '<your-new-test-name>'"
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
#### Deflake workflow
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
gh workflow run deflake.yml --ref <your-branch> -f test_name_pattern="<your-test-name-pattern>"
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Running all tests
|
|
96
|
+
|
|
97
|
+
To run the entire suite of integration tests, use the following command:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
npm run test:integration:all
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Sandbox matrix
|
|
104
|
+
|
|
105
|
+
The `all` command will run tests for `no sandboxing`, `docker` and `podman`.
|
|
106
|
+
Each individual type can be run using the following commands:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
npm run test:integration:sandbox:none
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
npm run test:integration:sandbox:docker
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
npm run test:integration:sandbox:podman
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Diagnostics
|
|
121
|
+
|
|
122
|
+
The integration test runner provides several options for diagnostics to help
|
|
123
|
+
track down test failures.
|
|
124
|
+
|
|
125
|
+
### Keeping test output
|
|
126
|
+
|
|
127
|
+
You can preserve the temporary files created during a test run for inspection.
|
|
128
|
+
This is useful for debugging issues with file system operations.
|
|
129
|
+
|
|
130
|
+
To keep the test output set the `KEEP_OUTPUT` environment variable to `true`.
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
KEEP_OUTPUT=true npm run test:integration:sandbox:none
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
When output is kept, the test runner will print the path to the unique directory
|
|
137
|
+
for the test run.
|
|
138
|
+
|
|
139
|
+
### Verbose output
|
|
140
|
+
|
|
141
|
+
For more detailed debugging, set the `VERBOSE` environment variable to `true`.
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
VERBOSE=true npm run test:integration:sandbox:none
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
When using `VERBOSE=true` and `KEEP_OUTPUT=true` in the same command, the output
|
|
148
|
+
is streamed to the console and also saved to a log file within the test's
|
|
149
|
+
temporary directory.
|
|
150
|
+
|
|
151
|
+
The verbose output is formatted to clearly identify the source of the logs:
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
--- TEST: <log dir>:<test-name> ---
|
|
155
|
+
... output from the gemini command ...
|
|
156
|
+
--- END TEST: <log dir>:<test-name> ---
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Linting and formatting
|
|
160
|
+
|
|
161
|
+
To ensure code quality and consistency, the integration test files are linted as
|
|
162
|
+
part of the main build process. You can also manually run the linter and
|
|
163
|
+
auto-fixer.
|
|
164
|
+
|
|
165
|
+
### Running the linter
|
|
166
|
+
|
|
167
|
+
To check for linting errors, run the following command:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
npm run lint
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
You can include the `:fix` flag in the command to automatically fix any fixable
|
|
174
|
+
linting errors:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
npm run lint:fix
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## Directory structure
|
|
181
|
+
|
|
182
|
+
The integration tests create a unique directory for each test run inside the
|
|
183
|
+
`.integration-tests` directory. Within this directory, a subdirectory is created
|
|
184
|
+
for each test file, and within that, a subdirectory is created for each
|
|
185
|
+
individual test case.
|
|
186
|
+
|
|
187
|
+
This structure makes it easy to locate the artifacts for a specific test run,
|
|
188
|
+
file, or case.
|
|
189
|
+
|
|
190
|
+
```
|
|
191
|
+
.integration-tests/
|
|
192
|
+
└── <run-id>/
|
|
193
|
+
└── <test-file-name>.test.js/
|
|
194
|
+
└── <test-case-name>/
|
|
195
|
+
├── output.log
|
|
196
|
+
└── ...other test artifacts...
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## Continuous integration
|
|
200
|
+
|
|
201
|
+
To ensure the integration tests are always run, a GitHub Actions workflow is
|
|
202
|
+
defined in `.github/workflows/chained_e2e.yml`. This workflow automatically runs
|
|
203
|
+
the integrations tests for pull requests against the `main` branch, or when a
|
|
204
|
+
pull request is added to a merge queue.
|
|
205
|
+
|
|
206
|
+
The workflow runs the tests in different sandboxing environments to ensure
|
|
207
|
+
Gemini CLI is tested across each:
|
|
208
|
+
|
|
209
|
+
- `sandbox:none`: Runs the tests without any sandboxing.
|
|
210
|
+
- `sandbox:docker`: Runs the tests in a Docker container.
|
|
211
|
+
- `sandbox:podman`: Runs the tests in a Podman container.
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# Automation and triage processes
|
|
2
|
+
|
|
3
|
+
This document provides a detailed overview of the automated processes we use to
|
|
4
|
+
manage and triage issues and pull requests. Our goal is to provide prompt
|
|
5
|
+
feedback and ensure that contributions are reviewed and integrated efficiently.
|
|
6
|
+
Understanding this automation will help you as a contributor know what to expect
|
|
7
|
+
and how to best interact with our repository bots.
|
|
8
|
+
|
|
9
|
+
## Guiding principle: Issues and pull requests
|
|
10
|
+
|
|
11
|
+
First and foremost, almost every Pull Request (PR) should be linked to a
|
|
12
|
+
corresponding Issue. The issue describes the "what" and the "why" (the bug or
|
|
13
|
+
feature), while the PR is the "how" (the implementation). This separation helps
|
|
14
|
+
us track work, prioritize features, and maintain clear historical context. Our
|
|
15
|
+
automation is built around this principle.
|
|
16
|
+
|
|
17
|
+
> **Note:** Issues tagged as "🔒Maintainers only" are reserved for project
|
|
18
|
+
> maintainers. We will not accept pull requests related to these issues.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Detailed automation workflows
|
|
23
|
+
|
|
24
|
+
Here is a breakdown of the specific automation workflows that run in our
|
|
25
|
+
repository.
|
|
26
|
+
|
|
27
|
+
### 1. When you open an issue: `Automated Issue Triage`
|
|
28
|
+
|
|
29
|
+
This is the first bot you will interact with when you create an issue. Its job
|
|
30
|
+
is to perform an initial analysis and apply the correct labels.
|
|
31
|
+
|
|
32
|
+
- **Workflow File**: `.github/workflows/gemini-automated-issue-triage.yml`
|
|
33
|
+
- **When it runs**: Immediately after an issue is created or reopened.
|
|
34
|
+
- **What it does**:
|
|
35
|
+
- It uses a Gemini model to analyze the issue's title and body against a
|
|
36
|
+
detailed set of guidelines.
|
|
37
|
+
- **Applies one `area/*` label**: Categorizes the issue into a functional area
|
|
38
|
+
of the project (e.g., `area/ux`, `area/models`, `area/platform`).
|
|
39
|
+
- **Applies one `kind/*` label**: Identifies the type of issue (e.g.,
|
|
40
|
+
`kind/bug`, `kind/enhancement`, `kind/question`).
|
|
41
|
+
- **Applies one `priority/*` label**: Assigns a priority from P0 (critical) to
|
|
42
|
+
P3 (low) based on the described impact.
|
|
43
|
+
- **May apply `status/need-information`**: If the issue lacks critical details
|
|
44
|
+
(like logs or reproduction steps), it will be flagged for more information.
|
|
45
|
+
- **May apply `status/need-retesting`**: If the issue references a CLI version
|
|
46
|
+
that is more than six versions old, it will be flagged for retesting on a
|
|
47
|
+
current version.
|
|
48
|
+
- **What you should do**:
|
|
49
|
+
- Fill out the issue template as completely as possible. The more detail you
|
|
50
|
+
provide, the more accurate the triage will be.
|
|
51
|
+
- If the `status/need-information` label is added, please provide the
|
|
52
|
+
requested details in a comment.
|
|
53
|
+
|
|
54
|
+
### 2. When you open a pull request: `Continuous Integration (CI)`
|
|
55
|
+
|
|
56
|
+
This workflow ensures that all changes meet our quality standards before they
|
|
57
|
+
can be merged.
|
|
58
|
+
|
|
59
|
+
- **Workflow File**: `.github/workflows/ci.yml`
|
|
60
|
+
- **When it runs**: On every push to a pull request.
|
|
61
|
+
- **What it does**:
|
|
62
|
+
- **Lint**: Checks that your code adheres to our project's formatting and
|
|
63
|
+
style rules.
|
|
64
|
+
- **Test**: Runs our full suite of automated tests across macOS, Windows, and
|
|
65
|
+
Linux, and on multiple Node.js versions. This is the most time-consuming
|
|
66
|
+
part of the CI process.
|
|
67
|
+
- **Post Coverage Comment**: After all tests have successfully passed, a bot
|
|
68
|
+
will post a comment on your PR. This comment provides a summary of how well
|
|
69
|
+
your changes are covered by tests.
|
|
70
|
+
- **What you should do**:
|
|
71
|
+
- Ensure all CI checks pass. A green checkmark ✅ will appear next to your
|
|
72
|
+
commit when everything is successful.
|
|
73
|
+
- If a check fails (a red "X" ❌), click the "Details" link next to the failed
|
|
74
|
+
check to view the logs, identify the problem, and push a fix.
|
|
75
|
+
|
|
76
|
+
### 3. Ongoing triage for pull requests: `PR Auditing and Label Sync`
|
|
77
|
+
|
|
78
|
+
This workflow runs periodically to ensure all open PRs are correctly linked to
|
|
79
|
+
issues and have consistent labels.
|
|
80
|
+
|
|
81
|
+
- **Workflow File**: `.github/workflows/gemini-scheduled-pr-triage.yml`
|
|
82
|
+
- **When it runs**: Every 15 minutes on all open pull requests.
|
|
83
|
+
- **What it does**:
|
|
84
|
+
- **Checks for a linked issue**: The bot scans your PR description for a
|
|
85
|
+
keyword that links it to an issue (e.g., `Fixes #123`, `Closes #456`).
|
|
86
|
+
- **Adds `status/need-issue`**: If no linked issue is found, the bot will add
|
|
87
|
+
the `status/need-issue` label to your PR. This is a clear signal that an
|
|
88
|
+
issue needs to be created and linked.
|
|
89
|
+
- **Synchronizes labels**: If an issue _is_ linked, the bot ensures the PR's
|
|
90
|
+
labels perfectly match the issue's labels. It will add any missing labels
|
|
91
|
+
and remove any that don't belong, and it will remove the `status/need-issue`
|
|
92
|
+
label if it was present.
|
|
93
|
+
- **What you should do**:
|
|
94
|
+
- **Always link your PR to an issue.** This is the most important step. Add a
|
|
95
|
+
line like `Resolves #<issue-number>` to your PR description.
|
|
96
|
+
- This will ensure your PR is correctly categorized and moves through the
|
|
97
|
+
review process smoothly.
|
|
98
|
+
|
|
99
|
+
### 4. Ongoing triage for issues: `Scheduled Issue Triage`
|
|
100
|
+
|
|
101
|
+
This is a fallback workflow to ensure that no issue gets missed by the triage
|
|
102
|
+
process.
|
|
103
|
+
|
|
104
|
+
- **Workflow File**: `.github/workflows/gemini-scheduled-issue-triage.yml`
|
|
105
|
+
- **When it runs**: Every hour on all open issues.
|
|
106
|
+
- **What it does**:
|
|
107
|
+
- It actively seeks out issues that either have no labels at all or still have
|
|
108
|
+
the `status/need-triage` label.
|
|
109
|
+
- It then triggers the same powerful Gemini-based analysis as the initial
|
|
110
|
+
triage bot to apply the correct labels.
|
|
111
|
+
- **What you should do**:
|
|
112
|
+
- You typically don't need to do anything. This workflow is a safety net to
|
|
113
|
+
ensure every issue is eventually categorized, even if the initial triage
|
|
114
|
+
fails.
|
|
115
|
+
|
|
116
|
+
### 5. Automatic unassignment of inactive contributors: `Unassign Inactive Issue Assignees`
|
|
117
|
+
|
|
118
|
+
To keep the list of open `help wanted` issues accessible to all contributors,
|
|
119
|
+
this workflow automatically removes **external contributors** who have not
|
|
120
|
+
opened a linked pull request within **7 days** of being assigned. Maintainers,
|
|
121
|
+
org members, and repo collaborators with write access or above are always exempt
|
|
122
|
+
and will never be auto-unassigned.
|
|
123
|
+
|
|
124
|
+
- **Workflow File**: `.github/workflows/unassign-inactive-assignees.yml`
|
|
125
|
+
- **When it runs**: Every day at 09:00 UTC, and can be triggered manually with
|
|
126
|
+
an optional `dry_run` mode.
|
|
127
|
+
- **What it does**:
|
|
128
|
+
1. Finds every open issue labeled `help wanted` that has at least one
|
|
129
|
+
assignee.
|
|
130
|
+
2. Identifies privileged users (team members, repo collaborators with write+
|
|
131
|
+
access, maintainers) and skips them entirely.
|
|
132
|
+
3. For each remaining (external) assignee it reads the issue's timeline to
|
|
133
|
+
determine:
|
|
134
|
+
- The exact date they were assigned (using `assigned` timeline events).
|
|
135
|
+
- Whether they have opened a PR that is already linked/cross-referenced to
|
|
136
|
+
the issue.
|
|
137
|
+
4. Each cross-referenced PR is fetched to verify it is **ready for review**:
|
|
138
|
+
open and non-draft, or already merged. Draft PRs do not count.
|
|
139
|
+
5. If an assignee has been assigned for **more than 7 days** and no qualifying
|
|
140
|
+
PR is found, they are automatically unassigned and a comment is posted
|
|
141
|
+
explaining the reason and how to re-claim the issue.
|
|
142
|
+
6. Assignees who have a non-draft, open or merged PR linked to the issue are
|
|
143
|
+
**never** unassigned by this workflow.
|
|
144
|
+
- **What you should do**:
|
|
145
|
+
- **Open a real PR, not a draft**: Within 7 days of being assigned, open a PR
|
|
146
|
+
that is ready for review and include `Fixes #<issue-number>` in the
|
|
147
|
+
description. Draft PRs do not satisfy the requirement and will not prevent
|
|
148
|
+
auto-unassignment.
|
|
149
|
+
- **Re-assign if unassigned by mistake**: Comment `/assign` on the issue to
|
|
150
|
+
assign yourself again.
|
|
151
|
+
- **Unassign yourself** if you can no longer work on the issue by commenting
|
|
152
|
+
`/unassign`, so other contributors can pick it up right away.
|
|
153
|
+
|
|
154
|
+
### 6. Release automation
|
|
155
|
+
|
|
156
|
+
This workflow handles the process of packaging and publishing new versions of
|
|
157
|
+
the Gemini CLI.
|
|
158
|
+
|
|
159
|
+
- **Workflow File**: `.github/workflows/release-manual.yml`
|
|
160
|
+
- **When it runs**: On a daily schedule for "nightly" releases, and manually for
|
|
161
|
+
official patch/minor releases.
|
|
162
|
+
- **What it does**:
|
|
163
|
+
- Automatically builds the project, bumps the version numbers, and publishes
|
|
164
|
+
the packages to npm.
|
|
165
|
+
- Creates a corresponding release on GitHub with generated release notes.
|
|
166
|
+
- **What you should do**:
|
|
167
|
+
- As a contributor, you don't need to do anything for this process. You can be
|
|
168
|
+
confident that once your PR is merged into the `main` branch, your changes
|
|
169
|
+
will be included in the very next nightly release.
|
|
170
|
+
|
|
171
|
+
We hope this detailed overview is helpful. If you have any questions about our
|
|
172
|
+
automation or processes, please don't hesitate to ask!
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# Local development guide
|
|
2
|
+
|
|
3
|
+
This guide provides instructions for setting up and using local development
|
|
4
|
+
features, such as tracing.
|
|
5
|
+
|
|
6
|
+
## Tracing
|
|
7
|
+
|
|
8
|
+
Traces are OpenTelemetry (OTel) records that help you debug your code by
|
|
9
|
+
instrumenting key events like model calls, tool scheduler operations, and tool
|
|
10
|
+
calls.
|
|
11
|
+
|
|
12
|
+
Traces provide deep visibility into agent behavior and are invaluable for
|
|
13
|
+
debugging complex issues. They are captured automatically when telemetry is
|
|
14
|
+
enabled.
|
|
15
|
+
|
|
16
|
+
### Viewing traces
|
|
17
|
+
|
|
18
|
+
You can view traces using either Jaeger or the Genkit Developer UI.
|
|
19
|
+
|
|
20
|
+
#### Using Genkit
|
|
21
|
+
|
|
22
|
+
Genkit provides a web-based UI for viewing traces and other telemetry data.
|
|
23
|
+
|
|
24
|
+
1. **Start the Genkit telemetry server:**
|
|
25
|
+
|
|
26
|
+
Run the following command to start the Genkit server:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm run telemetry -- --target=genkit
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The script will output the URL for the Genkit Developer UI, for example:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
Genkit Developer UI: http://localhost:4000
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
2. **Run Gemini CLI:**
|
|
39
|
+
|
|
40
|
+
In a separate terminal, run your Gemini CLI command:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
gemini
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
3. **View the traces:**
|
|
47
|
+
|
|
48
|
+
Open the Genkit Developer UI URL in your browser and navigate to the
|
|
49
|
+
**Traces** tab to view the traces.
|
|
50
|
+
|
|
51
|
+
#### Using Jaeger
|
|
52
|
+
|
|
53
|
+
You can view traces in the Jaeger UI. To get started, follow these steps:
|
|
54
|
+
|
|
55
|
+
1. **Start the telemetry collector:**
|
|
56
|
+
|
|
57
|
+
Run the following command in your terminal to download and start Jaeger and
|
|
58
|
+
an OTEL collector:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npm run telemetry -- --target=local
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
This command also configures your workspace for local telemetry and provides
|
|
65
|
+
a link to the Jaeger UI (usually `http://localhost:16686`).
|
|
66
|
+
|
|
67
|
+
2. **Run Gemini CLI:**
|
|
68
|
+
|
|
69
|
+
In a separate terminal, run your Gemini CLI command:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
gemini
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
3. **View the traces:**
|
|
76
|
+
|
|
77
|
+
After running your command, open the Jaeger UI link in your browser to view
|
|
78
|
+
the traces.
|
|
79
|
+
|
|
80
|
+
For more detailed information on telemetry, see the
|
|
81
|
+
[telemetry documentation](./cli/telemetry.md).
|
|
82
|
+
|
|
83
|
+
### Instrumenting code with traces
|
|
84
|
+
|
|
85
|
+
You can add traces to your own code for more detailed instrumentation. This is
|
|
86
|
+
useful for debugging and understanding the flow of execution.
|
|
87
|
+
|
|
88
|
+
Use the `runInDevTraceSpan` function to wrap any section of code in a trace
|
|
89
|
+
span.
|
|
90
|
+
|
|
91
|
+
Here is a basic example:
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
import { runInDevTraceSpan } from '@dgxo/mashadevcli-core';
|
|
95
|
+
import { GeminiCliOperation } from '@dgxo/mashadevcli-core/lib/telemetry/constants.js';
|
|
96
|
+
|
|
97
|
+
await runInDevTraceSpan(
|
|
98
|
+
{
|
|
99
|
+
operation: GeminiCliOperation.ToolCall,
|
|
100
|
+
attributes: {
|
|
101
|
+
[GEN_AI_AGENT_NAME]: 'gemini-cli',
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
async ({ metadata }) => {
|
|
105
|
+
// The `metadata` object allows you to record the input and output of the
|
|
106
|
+
// operation as well as other attributes.
|
|
107
|
+
metadata.input = { key: 'value' };
|
|
108
|
+
// Set custom attributes.
|
|
109
|
+
metadata.attributes['custom.attribute'] = 'custom.value';
|
|
110
|
+
|
|
111
|
+
// Your code to be traced goes here
|
|
112
|
+
try {
|
|
113
|
+
const output = await somethingRisky();
|
|
114
|
+
metadata.output = output;
|
|
115
|
+
return output;
|
|
116
|
+
} catch (e) {
|
|
117
|
+
metadata.error = e;
|
|
118
|
+
throw e;
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
);
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
In this example:
|
|
125
|
+
|
|
126
|
+
- `operation`: The operation type of the span, represented by the
|
|
127
|
+
`GeminiCliOperation` enum.
|
|
128
|
+
- `metadata.input`: (Optional) An object containing the input data for the
|
|
129
|
+
traced operation.
|
|
130
|
+
- `metadata.output`: (Optional) An object containing the output data from the
|
|
131
|
+
traced operation.
|
|
132
|
+
- `metadata.attributes`: (Optional) A record of custom attributes to add to the
|
|
133
|
+
span.
|
|
134
|
+
- `metadata.error`: (Optional) An error object to record if the operation fails.
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
graph LR
|
|
2
|
+
%% --- Style Definitions ---
|
|
3
|
+
classDef new fill:#98fb98,color:#000
|
|
4
|
+
classDef changed fill:#add8e6,color:#000
|
|
5
|
+
classDef unchanged fill:#f0f0f0,color:#000
|
|
6
|
+
|
|
7
|
+
%% --- Subgraphs ---
|
|
8
|
+
subgraph "Context Providers"
|
|
9
|
+
direction TB
|
|
10
|
+
A["gemini.tsx"]
|
|
11
|
+
B["AppContainer.tsx"]
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
subgraph "Contexts"
|
|
15
|
+
direction TB
|
|
16
|
+
CtxSession["SessionContext"]
|
|
17
|
+
CtxVim["VimModeContext"]
|
|
18
|
+
CtxSettings["SettingsContext"]
|
|
19
|
+
CtxApp["AppContext"]
|
|
20
|
+
CtxConfig["ConfigContext"]
|
|
21
|
+
CtxUIState["UIStateContext"]
|
|
22
|
+
CtxUIActions["UIActionsContext"]
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
subgraph "Component Consumers"
|
|
26
|
+
direction TB
|
|
27
|
+
ConsumerApp["App"]
|
|
28
|
+
ConsumerAppContainer["AppContainer"]
|
|
29
|
+
ConsumerAppHeader["AppHeader"]
|
|
30
|
+
ConsumerDialogManager["DialogManager"]
|
|
31
|
+
ConsumerHistoryItem["HistoryItemDisplay"]
|
|
32
|
+
ConsumerComposer["Composer"]
|
|
33
|
+
ConsumerMainContent["MainContent"]
|
|
34
|
+
ConsumerNotifications["Notifications"]
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
%% --- Provider -> Context Connections ---
|
|
38
|
+
A -.-> CtxSession
|
|
39
|
+
A -.-> CtxVim
|
|
40
|
+
A -.-> CtxSettings
|
|
41
|
+
|
|
42
|
+
B -.-> CtxApp
|
|
43
|
+
B -.-> CtxConfig
|
|
44
|
+
B -.-> CtxUIState
|
|
45
|
+
B -.-> CtxUIActions
|
|
46
|
+
B -.-> CtxSettings
|
|
47
|
+
|
|
48
|
+
%% --- Context -> Consumer Connections ---
|
|
49
|
+
CtxSession -.-> ConsumerAppContainer
|
|
50
|
+
CtxSession -.-> ConsumerApp
|
|
51
|
+
|
|
52
|
+
CtxVim -.-> ConsumerAppContainer
|
|
53
|
+
CtxVim -.-> ConsumerComposer
|
|
54
|
+
CtxVim -.-> ConsumerApp
|
|
55
|
+
|
|
56
|
+
CtxSettings -.-> ConsumerAppContainer
|
|
57
|
+
CtxSettings -.-> ConsumerAppHeader
|
|
58
|
+
CtxSettings -.-> ConsumerDialogManager
|
|
59
|
+
CtxSettings -.-> ConsumerApp
|
|
60
|
+
|
|
61
|
+
CtxApp -.-> ConsumerAppHeader
|
|
62
|
+
CtxApp -.-> ConsumerNotifications
|
|
63
|
+
|
|
64
|
+
CtxConfig -.-> ConsumerAppHeader
|
|
65
|
+
CtxConfig -.-> ConsumerHistoryItem
|
|
66
|
+
CtxConfig -.-> ConsumerComposer
|
|
67
|
+
CtxConfig -.-> ConsumerDialogManager
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
CtxUIState -.-> ConsumerApp
|
|
72
|
+
CtxUIState -.-> ConsumerMainContent
|
|
73
|
+
CtxUIState -.-> ConsumerComposer
|
|
74
|
+
CtxUIState -.-> ConsumerDialogManager
|
|
75
|
+
|
|
76
|
+
CtxUIActions -.-> ConsumerComposer
|
|
77
|
+
CtxUIActions -.-> ConsumerDialogManager
|
|
78
|
+
|
|
79
|
+
%% --- Apply Styles ---
|
|
80
|
+
%% New Elements (Green)
|
|
81
|
+
class B,CtxApp,CtxConfig,CtxUIState,CtxUIActions,ConsumerAppHeader,ConsumerDialogManager,ConsumerComposer,ConsumerMainContent,ConsumerNotifications new
|
|
82
|
+
|
|
83
|
+
%% Heavily Changed Elements (Blue)
|
|
84
|
+
class A,ConsumerApp,ConsumerAppContainer,ConsumerHistoryItem changed
|
|
85
|
+
|
|
86
|
+
%% Mostly Unchanged Elements (Gray)
|
|
87
|
+
class CtxSession,CtxVim,CtxSettings unchanged
|
|
88
|
+
|
|
89
|
+
%% --- Link Styles ---
|
|
90
|
+
%% CtxSession (Red)
|
|
91
|
+
linkStyle 0,8,9 stroke:#e57373,stroke-width:2px
|
|
92
|
+
%% CtxVim (Orange)
|
|
93
|
+
linkStyle 1,10,11,12 stroke:#ffb74d,stroke-width:2px
|
|
94
|
+
%% CtxSettings (Yellow)
|
|
95
|
+
linkStyle 2,7,13,14,15,16 stroke:#fff176,stroke-width:2px
|
|
96
|
+
%% CtxApp (Green)
|
|
97
|
+
linkStyle 3,17,18 stroke:#81c784,stroke-width:2px
|
|
98
|
+
%% CtxConfig (Blue)
|
|
99
|
+
linkStyle 4,19,20,21,22 stroke:#64b5f6,stroke-width:2px
|
|
100
|
+
%% CtxUIState (Indigo)
|
|
101
|
+
linkStyle 5,23,24,25,26 stroke:#7986cb,stroke-width:2px
|
|
102
|
+
%% CtxUIActions (Violet)
|
|
103
|
+
linkStyle 6,27,28 stroke:#ba68c8,stroke-width:2px
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
graph TD
|
|
2
|
+
%% --- Style Definitions ---
|
|
3
|
+
classDef new fill:#98fb98,color:#000
|
|
4
|
+
classDef changed fill:#add8e6,color:#000
|
|
5
|
+
classDef unchanged fill:#f0f0f0,color:#000
|
|
6
|
+
classDef dispatcher fill:#f9e79f,color:#000,stroke:#333,stroke-width:1px
|
|
7
|
+
classDef container fill:#f5f5f5,color:#000,stroke:#ccc
|
|
8
|
+
|
|
9
|
+
%% --- Component Tree ---
|
|
10
|
+
subgraph "Entry Point"
|
|
11
|
+
A["gemini.tsx"]
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
subgraph "State & Logic Wrapper"
|
|
15
|
+
B["AppContainer.tsx"]
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
subgraph "Primary Layout"
|
|
19
|
+
C["App.tsx"]
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
A -.-> B
|
|
23
|
+
B -.-> C
|
|
24
|
+
|
|
25
|
+
subgraph "UI Containers"
|
|
26
|
+
direction LR
|
|
27
|
+
C -.-> D["MainContent"]
|
|
28
|
+
C -.-> G["Composer"]
|
|
29
|
+
C -.-> F["DialogManager"]
|
|
30
|
+
C -.-> E["Notifications"]
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
subgraph "MainContent"
|
|
34
|
+
direction TB
|
|
35
|
+
D -.-> H["AppHeader"]
|
|
36
|
+
D -.-> I["HistoryItemDisplay"]:::dispatcher
|
|
37
|
+
D -.-> L["ShowMoreLines"]
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
subgraph "Composer"
|
|
41
|
+
direction TB
|
|
42
|
+
G -.-> K_Prompt["InputPrompt"]
|
|
43
|
+
G -.-> K_Footer["Footer"]
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
subgraph "DialogManager"
|
|
47
|
+
F -.-> J["Various Dialogs<br>(Auth, Theme, Settings, etc.)"]
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
%% --- Apply Styles ---
|
|
51
|
+
class B,D,E,F,G,H,J,K_Prompt,L new
|
|
52
|
+
class A,C,I changed
|
|
53
|
+
class K_Footer unchanged
|
|
54
|
+
|
|
55
|
+
%% --- Link Styles ---
|
|
56
|
+
%% MainContent Branch (Blue)
|
|
57
|
+
linkStyle 2,6,7,8 stroke:#64b5f6,stroke-width:2px
|
|
58
|
+
%% Composer Branch (Green)
|
|
59
|
+
linkStyle 3,9,10 stroke:#81c784,stroke-width:2px
|
|
60
|
+
%% DialogManager Branch (Orange)
|
|
61
|
+
linkStyle 4,11 stroke:#ffb74d,stroke-width:2px
|
|
62
|
+
%% Notifications Branch (Violet)
|
|
63
|
+
linkStyle 5 stroke:#ba68c8,stroke-width:2px
|
|
64
|
+
|