@office-ai/aioncli-core 0.30.0 → 0.30.1
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/dist/docs/assets/theme-ansi-dark.png +0 -0
- package/dist/docs/assets/theme-atom-one-dark.png +0 -0
- package/dist/docs/assets/theme-ayu-dark.png +0 -0
- package/dist/docs/assets/theme-default-dark.png +0 -0
- package/dist/docs/assets/theme-dracula-dark.png +0 -0
- package/dist/docs/assets/theme-github-dark.png +0 -0
- package/dist/docs/assets/theme-holiday-dark.png +0 -0
- package/dist/docs/assets/theme-shades-of-purple-dark.png +0 -0
- package/dist/docs/assets/theme-solarized-dark.png +0 -0
- package/dist/docs/assets/theme-solarized-light.png +0 -0
- package/dist/docs/cli/notifications.md +58 -0
- package/dist/docs/redirects.json +20 -0
- package/dist/docs/reference/commands.md +563 -0
- package/dist/docs/reference/configuration.md +1804 -0
- package/dist/docs/reference/keyboard-shortcuts.md +168 -0
- package/dist/docs/reference/memport.md +246 -0
- package/dist/docs/reference/policy-engine.md +386 -0
- package/dist/docs/reference/tools.md +106 -0
- package/dist/docs/resources/faq.md +175 -0
- package/dist/docs/resources/quota-and-pricing.md +199 -0
- package/dist/docs/resources/tos-privacy.md +102 -0
- package/dist/docs/resources/troubleshooting.md +176 -0
- package/dist/docs/resources/uninstall.md +56 -0
- package/dist/src/agents/a2a-errors.d.ts +65 -0
- package/dist/src/agents/a2a-errors.js +164 -0
- package/dist/src/agents/a2a-errors.js.map +1 -0
- package/dist/src/agents/a2a-errors.test.d.ts +6 -0
- package/dist/src/agents/a2a-errors.test.js +183 -0
- package/dist/src/agents/a2a-errors.test.js.map +1 -0
- package/dist/src/agents/auth-provider/api-key-provider.d.ts +30 -0
- package/dist/src/agents/auth-provider/api-key-provider.js +66 -0
- package/dist/src/agents/auth-provider/api-key-provider.js.map +1 -0
- package/dist/src/agents/auth-provider/api-key-provider.test.d.ts +6 -0
- package/dist/src/agents/auth-provider/api-key-provider.test.js +130 -0
- package/dist/src/agents/auth-provider/api-key-provider.test.js.map +1 -0
- package/dist/src/agents/auth-provider/http-provider.d.ts +28 -0
- package/dist/src/agents/auth-provider/http-provider.js +73 -0
- package/dist/src/agents/auth-provider/http-provider.js.map +1 -0
- package/dist/src/agents/auth-provider/http-provider.test.d.ts +6 -0
- package/dist/src/agents/auth-provider/http-provider.test.js +112 -0
- package/dist/src/agents/auth-provider/http-provider.test.js.map +1 -0
- package/dist/src/agents/auth-provider/oauth2-provider.d.ts +65 -0
- package/dist/src/agents/auth-provider/oauth2-provider.js +233 -0
- package/dist/src/agents/auth-provider/oauth2-provider.js.map +1 -0
- package/dist/src/agents/auth-provider/oauth2-provider.test.d.ts +6 -0
- package/dist/src/agents/auth-provider/oauth2-provider.test.js +490 -0
- package/dist/src/agents/auth-provider/oauth2-provider.test.js.map +1 -0
- package/dist/src/agents/browser/analyzeScreenshot.d.ts +35 -0
- package/dist/src/agents/browser/analyzeScreenshot.js +183 -0
- package/dist/src/agents/browser/analyzeScreenshot.js.map +1 -0
- package/dist/src/agents/browser/analyzeScreenshot.test.d.ts +6 -0
- package/dist/src/agents/browser/analyzeScreenshot.test.js +161 -0
- package/dist/src/agents/browser/analyzeScreenshot.test.js.map +1 -0
- package/dist/src/agents/browser/automationOverlay.d.ts +26 -0
- package/dist/src/agents/browser/automationOverlay.js +100 -0
- package/dist/src/agents/browser/automationOverlay.js.map +1 -0
- package/dist/src/agents/browser/browserAgentDefinition.d.ts +50 -0
- package/dist/src/agents/browser/browserAgentDefinition.js +141 -0
- package/dist/src/agents/browser/browserAgentDefinition.js.map +1 -0
- package/dist/src/agents/browser/browserAgentFactory.d.ts +42 -0
- package/dist/src/agents/browser/browserAgentFactory.js +116 -0
- package/dist/src/agents/browser/browserAgentFactory.js.map +1 -0
- package/dist/src/agents/browser/browserAgentFactory.test.d.ts +6 -0
- package/dist/src/agents/browser/browserAgentFactory.test.js +240 -0
- package/dist/src/agents/browser/browserAgentFactory.test.js.map +1 -0
- package/dist/src/agents/browser/browserAgentInvocation.d.ts +34 -0
- package/dist/src/agents/browser/browserAgentInvocation.js +386 -0
- package/dist/src/agents/browser/browserAgentInvocation.js.map +1 -0
- package/dist/src/agents/browser/browserAgentInvocation.test.d.ts +6 -0
- package/dist/src/agents/browser/browserAgentInvocation.test.js +382 -0
- package/dist/src/agents/browser/browserAgentInvocation.test.js.map +1 -0
- package/dist/src/agents/browser/browserManager.d.ts +115 -0
- package/dist/src/agents/browser/browserManager.js +370 -0
- package/dist/src/agents/browser/browserManager.js.map +1 -0
- package/dist/src/agents/browser/browserManager.test.d.ts +6 -0
- package/dist/src/agents/browser/browserManager.test.js +382 -0
- package/dist/src/agents/browser/browserManager.test.js.map +1 -0
- package/dist/src/agents/browser/mcpToolWrapper.d.ts +45 -0
- package/dist/src/agents/browser/mcpToolWrapper.js +358 -0
- package/dist/src/agents/browser/mcpToolWrapper.js.map +1 -0
- package/dist/src/agents/browser/mcpToolWrapper.test.d.ts +6 -0
- package/dist/src/agents/browser/mcpToolWrapper.test.js +126 -0
- package/dist/src/agents/browser/mcpToolWrapper.test.js.map +1 -0
- package/dist/src/agents/browser/mcpToolWrapperConfirmation.test.d.ts +6 -0
- package/dist/src/agents/browser/mcpToolWrapperConfirmation.test.js +59 -0
- package/dist/src/agents/browser/mcpToolWrapperConfirmation.test.js.map +1 -0
- package/dist/src/agents/browser/modelAvailability.d.ts +23 -0
- package/dist/src/agents/browser/modelAvailability.js +23 -0
- package/dist/src/agents/browser/modelAvailability.js.map +1 -0
- package/dist/src/agents/cli-help-agent.d.ts +2 -2
- package/dist/src/billing/billing.d.ts +80 -0
- package/dist/src/billing/billing.js +128 -0
- package/dist/src/billing/billing.js.map +1 -0
- package/dist/src/billing/billing.test.d.ts +6 -0
- package/dist/src/billing/billing.test.js +182 -0
- package/dist/src/billing/billing.test.js.map +1 -0
- package/dist/src/billing/index.d.ts +6 -0
- package/dist/src/billing/index.js +7 -0
- package/dist/src/billing/index.js.map +1 -0
- package/dist/src/code_assist/oauth2.d.ts +1 -1
- package/dist/src/code_assist/types.d.ts +26 -26
- package/dist/src/config/agent-loop-context.d.ts +22 -0
- package/dist/src/config/agent-loop-context.js +7 -0
- package/dist/src/config/agent-loop-context.js.map +1 -0
- package/dist/src/config/trackerFeatureFlag.test.d.ts +6 -0
- package/dist/src/config/trackerFeatureFlag.test.js +43 -0
- package/dist/src/config/trackerFeatureFlag.test.js.map +1 -0
- package/dist/src/config/userHintService.d.ts +46 -0
- package/dist/src/config/userHintService.js +81 -0
- package/dist/src/config/userHintService.js.map +1 -0
- package/dist/src/config/userHintService.test.d.ts +6 -0
- package/dist/src/config/userHintService.test.js +62 -0
- package/dist/src/config/userHintService.test.js.map +1 -0
- package/dist/src/core/localLiteRtLmClient.d.ts +24 -0
- package/dist/src/core/localLiteRtLmClient.js +77 -0
- package/dist/src/core/localLiteRtLmClient.js.map +1 -0
- package/dist/src/core/localLiteRtLmClient.test.d.ts +6 -0
- package/dist/src/core/localLiteRtLmClient.test.js +87 -0
- package/dist/src/core/localLiteRtLmClient.test.js.map +1 -0
- package/dist/src/core/openaiContentGenerator.d.ts +1 -0
- package/dist/src/core/openaiContentGenerator.js +13 -13
- package/dist/src/core/openaiContentGenerator.js.map +1 -1
- package/dist/src/hooks/runtimeHooks.test.d.ts +6 -0
- package/dist/src/hooks/runtimeHooks.test.js +100 -0
- package/dist/src/hooks/runtimeHooks.test.js.map +1 -0
- package/dist/src/ide/types.d.ts +6 -6
- package/dist/src/mcp/mcp-oauth-provider.d.ts +43 -0
- package/dist/src/mcp/mcp-oauth-provider.js +67 -0
- package/dist/src/mcp/mcp-oauth-provider.js.map +1 -0
- package/dist/src/mcp/mcp-oauth-provider.test.d.ts +6 -0
- package/dist/src/mcp/mcp-oauth-provider.test.js +63 -0
- package/dist/src/mcp/mcp-oauth-provider.test.js.map +1 -0
- package/dist/src/policy/integrity.d.ts +45 -0
- package/dist/src/policy/integrity.js +121 -0
- package/dist/src/policy/integrity.js.map +1 -0
- package/dist/src/policy/integrity.test.d.ts +6 -0
- package/dist/src/policy/integrity.test.js +132 -0
- package/dist/src/policy/integrity.test.js.map +1 -0
- package/dist/src/policy/policies/conseca.toml +6 -0
- package/dist/src/policy/workspace-policy.test.js +231 -0
- package/dist/src/policy/workspace-policy.test.js.map +1 -0
- package/dist/src/routing/strategies/approvalModeStrategy.d.ts +18 -0
- package/dist/src/routing/strategies/approvalModeStrategy.js +59 -0
- package/dist/src/routing/strategies/approvalModeStrategy.js.map +1 -0
- package/dist/src/routing/strategies/approvalModeStrategy.test.d.ts +6 -0
- package/dist/src/routing/strategies/approvalModeStrategy.test.js +140 -0
- package/dist/src/routing/strategies/approvalModeStrategy.test.js.map +1 -0
- package/dist/src/routing/strategies/gemmaClassifierStrategy.d.ts +14 -0
- package/dist/src/routing/strategies/gemmaClassifierStrategy.js +182 -0
- package/dist/src/routing/strategies/gemmaClassifierStrategy.js.map +1 -0
- package/dist/src/routing/strategies/gemmaClassifierStrategy.test.d.ts +6 -0
- package/dist/src/routing/strategies/gemmaClassifierStrategy.test.js +218 -0
- package/dist/src/routing/strategies/gemmaClassifierStrategy.test.js.map +1 -0
- package/dist/src/safety/conseca/conseca.d.ts +31 -0
- package/dist/src/safety/conseca/conseca.js +105 -0
- package/dist/src/safety/conseca/conseca.js.map +1 -0
- package/dist/src/safety/conseca/conseca.test.js +226 -0
- package/dist/src/safety/conseca/conseca.test.js.map +1 -0
- package/dist/src/safety/conseca/integration.test.js +19 -0
- package/dist/src/safety/conseca/integration.test.js.map +1 -0
- package/dist/src/safety/conseca/policy-enforcer.d.ts +13 -0
- package/dist/src/safety/conseca/policy-enforcer.js +135 -0
- package/dist/src/safety/conseca/policy-enforcer.js.map +1 -0
- package/dist/src/safety/conseca/policy-enforcer.test.js +141 -0
- package/dist/src/safety/conseca/policy-enforcer.test.js.map +1 -0
- package/dist/src/safety/conseca/policy-generator.d.ts +15 -0
- package/dist/src/safety/conseca/policy-generator.js +144 -0
- package/dist/src/safety/conseca/policy-generator.js.map +1 -0
- package/dist/src/safety/conseca/policy-generator.test.d.ts +6 -0
- package/dist/src/safety/conseca/policy-generator.test.js +84 -0
- package/dist/src/safety/conseca/policy-generator.test.js.map +1 -0
- package/dist/src/safety/conseca/types.d.ts +15 -0
- package/dist/src/safety/conseca/types.js +7 -0
- package/dist/src/safety/conseca/types.js.map +1 -0
- package/dist/src/scheduler/scheduler_parallel.test.d.ts +6 -0
- package/dist/src/scheduler/scheduler_parallel.test.js +401 -0
- package/dist/src/scheduler/scheduler_parallel.test.js.map +1 -0
- package/dist/src/services/FolderTrustDiscoveryService.d.ts +32 -0
- package/dist/src/services/FolderTrustDiscoveryService.js +169 -0
- package/dist/src/services/FolderTrustDiscoveryService.js.map +1 -0
- package/dist/src/services/FolderTrustDiscoveryService.test.d.ts +6 -0
- package/dist/src/services/FolderTrustDiscoveryService.test.js +118 -0
- package/dist/src/services/FolderTrustDiscoveryService.test.js.map +1 -0
- package/dist/src/services/fileKeychain.d.ts +24 -0
- package/dist/src/services/fileKeychain.js +123 -0
- package/dist/src/services/fileKeychain.js.map +1 -0
- package/dist/src/services/keychainService.d.ts +51 -0
- package/dist/src/services/keychainService.js +133 -0
- package/dist/src/services/keychainService.js.map +1 -0
- package/dist/src/services/keychainService.test.d.ts +6 -0
- package/dist/src/services/keychainService.test.js +150 -0
- package/dist/src/services/keychainService.test.js.map +1 -0
- package/dist/src/services/keychainTypes.d.ts +41 -0
- package/dist/src/services/keychainTypes.js +18 -0
- package/dist/src/services/keychainTypes.js.map +1 -0
- package/dist/src/services/trackerService.d.ts +49 -0
- package/dist/src/services/trackerService.js +193 -0
- package/dist/src/services/trackerService.js.map +1 -0
- package/dist/src/services/trackerService.test.d.ts +6 -0
- package/dist/src/services/trackerService.test.js +117 -0
- package/dist/src/services/trackerService.test.js.map +1 -0
- package/dist/src/services/trackerTypes.d.ts +51 -0
- package/dist/src/services/trackerTypes.js +33 -0
- package/dist/src/services/trackerTypes.js.map +1 -0
- package/dist/src/telemetry/billingEvents.d.ts +75 -0
- package/dist/src/telemetry/billingEvents.js +181 -0
- package/dist/src/telemetry/billingEvents.js.map +1 -0
- package/dist/src/telemetry/billingEvents.test.d.ts +6 -0
- package/dist/src/telemetry/billingEvents.test.js +139 -0
- package/dist/src/telemetry/billingEvents.test.js.map +1 -0
- package/dist/src/telemetry/conseca-logger.d.ts +9 -0
- package/dist/src/telemetry/conseca-logger.js +91 -0
- package/dist/src/telemetry/conseca-logger.js.map +1 -0
- package/dist/src/telemetry/conseca-logger.test.d.ts +6 -0
- package/dist/src/telemetry/conseca-logger.test.js +90 -0
- package/dist/src/telemetry/conseca-logger.test.js.map +1 -0
- package/dist/src/telemetry/trace.test.d.ts +6 -0
- package/dist/src/telemetry/trace.test.js +116 -0
- package/dist/src/telemetry/trace.test.js.map +1 -0
- package/dist/src/tools/definitions/trackerTools.d.ts +12 -0
- package/dist/src/tools/definitions/trackerTools.js +146 -0
- package/dist/src/tools/definitions/trackerTools.js.map +1 -0
- package/dist/src/tools/diff-utils.d.ts +9 -0
- package/dist/src/tools/diff-utils.js +66 -0
- package/dist/src/tools/diff-utils.js.map +1 -0
- package/dist/src/tools/diff-utils.test.d.ts +6 -0
- package/dist/src/tools/diff-utils.test.js +53 -0
- package/dist/src/tools/diff-utils.test.js.map +1 -0
- package/dist/src/tools/grep-utils.d.ts +49 -0
- package/dist/src/tools/grep-utils.js +147 -0
- package/dist/src/tools/grep-utils.js.map +1 -0
- package/dist/src/tools/omissionPlaceholderDetector.d.ts +15 -0
- package/dist/src/tools/omissionPlaceholderDetector.js +90 -0
- package/dist/src/tools/omissionPlaceholderDetector.js.map +1 -0
- package/dist/src/tools/omissionPlaceholderDetector.test.d.ts +6 -0
- package/dist/src/tools/omissionPlaceholderDetector.test.js +49 -0
- package/dist/src/tools/omissionPlaceholderDetector.test.js.map +1 -0
- package/dist/src/tools/trackerTools.d.ts +122 -0
- package/dist/src/tools/trackerTools.js +365 -0
- package/dist/src/tools/trackerTools.js.map +1 -0
- package/dist/src/tools/trackerTools.test.d.ts +6 -0
- package/dist/src/tools/trackerTools.test.js +97 -0
- package/dist/src/tools/trackerTools.test.js.map +1 -0
- package/dist/src/utils/approvalModeUtils.d.ts +14 -0
- package/dist/src/utils/approvalModeUtils.js +35 -0
- package/dist/src/utils/approvalModeUtils.js.map +1 -0
- package/dist/src/utils/approvalModeUtils.test.d.ts +6 -0
- package/dist/src/utils/approvalModeUtils.test.js +36 -0
- package/dist/src/utils/approvalModeUtils.test.js.map +1 -0
- package/dist/src/utils/cache.d.ts +63 -0
- package/dist/src/utils/cache.js +103 -0
- package/dist/src/utils/cache.js.map +1 -0
- package/dist/src/utils/cache.test.d.ts +6 -0
- package/dist/src/utils/cache.test.js +158 -0
- package/dist/src/utils/cache.test.js.map +1 -0
- package/dist/src/utils/checkpointUtils.d.ts +2 -2
- package/dist/src/utils/compatibility.d.ts +41 -0
- package/dist/src/utils/compatibility.js +112 -0
- package/dist/src/utils/compatibility.js.map +1 -0
- package/dist/src/utils/compatibility.test.d.ts +6 -0
- package/dist/src/utils/compatibility.test.js +233 -0
- package/dist/src/utils/compatibility.test.js.map +1 -0
- package/dist/src/utils/envExpansion.d.ts +18 -0
- package/dist/src/utils/envExpansion.js +46 -0
- package/dist/src/utils/envExpansion.js.map +1 -0
- package/dist/src/utils/envExpansion.test.d.ts +6 -0
- package/dist/src/utils/envExpansion.test.js +110 -0
- package/dist/src/utils/envExpansion.test.js.map +1 -0
- package/dist/src/utils/errors_timeout.test.d.ts +6 -0
- package/dist/src/utils/errors_timeout.test.js +40 -0
- package/dist/src/utils/errors_timeout.test.js.map +1 -0
- package/dist/src/utils/fetch.test.d.ts +6 -0
- package/dist/src/utils/fetch.test.js +206 -0
- package/dist/src/utils/fetch.test.js.map +1 -0
- package/dist/src/utils/markdownUtils.d.ts +22 -0
- package/dist/src/utils/markdownUtils.js +126 -0
- package/dist/src/utils/markdownUtils.js.map +1 -0
- package/dist/src/utils/markdownUtils.test.d.ts +6 -0
- package/dist/src/utils/markdownUtils.test.js +107 -0
- package/dist/src/utils/markdownUtils.test.js.map +1 -0
- package/dist/src/utils/oauth-flow.d.ts +105 -0
- package/dist/src/utils/oauth-flow.js +370 -0
- package/dist/src/utils/oauth-flow.js.map +1 -0
- package/dist/src/utils/oauth-flow.test.d.ts +6 -0
- package/dist/src/utils/oauth-flow.test.js +360 -0
- package/dist/src/utils/oauth-flow.test.js.map +1 -0
- package/dist/src/utils/sessionUtils.d.ts +14 -0
- package/dist/src/utils/sessionUtils.js +122 -0
- package/dist/src/utils/sessionUtils.js.map +1 -0
- package/dist/src/utils/sessionUtils.test.d.ts +1 -0
- package/dist/src/utils/sessionUtils.test.js +171 -0
- package/dist/src/utils/sessionUtils.test.js.map +1 -0
- package/dist/src/voice/responseFormatter.d.ts +38 -0
- package/dist/src/voice/responseFormatter.js +130 -0
- package/dist/src/voice/responseFormatter.js.map +1 -0
- package/dist/src/voice/responseFormatter.test.d.ts +6 -0
- package/dist/src/voice/responseFormatter.test.js +214 -0
- package/dist/src/voice/responseFormatter.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/docs/CONTRIBUTING.md +0 -555
- package/dist/src/agents/executor.d.ts +0 -114
- package/dist/src/agents/executor.js +0 -779
- package/dist/src/agents/executor.js.map +0 -1
- package/dist/src/agents/executor.test.js +0 -1362
- package/dist/src/agents/executor.test.js.map +0 -1
- package/dist/src/agents/invocation.d.ts +0 -46
- package/dist/src/agents/invocation.js +0 -102
- package/dist/src/agents/invocation.js.map +0 -1
- package/dist/src/agents/invocation.test.js +0 -215
- package/dist/src/agents/invocation.test.js.map +0 -1
- package/dist/src/core/subagent.d.ts +0 -236
- package/dist/src/core/subagent.js +0 -482
- package/dist/src/core/subagent.js.map +0 -1
- package/dist/src/core/subagent.test.js +0 -530
- package/dist/src/core/subagent.test.js.map +0 -1
- package/dist/src/tools/smart-edit.d.ts +0 -78
- package/dist/src/tools/smart-edit.js +0 -717
- package/dist/src/tools/smart-edit.js.map +0 -1
- package/dist/src/tools/smart-edit.test.js +0 -592
- package/dist/src/tools/smart-edit.test.js.map +0 -1
- /package/dist/src/{agents/executor.test.d.ts → policy/workspace-policy.test.d.ts} +0 -0
- /package/dist/src/{agents/invocation.test.d.ts → safety/conseca/conseca.test.d.ts} +0 -0
- /package/dist/src/{core/subagent.test.d.ts → safety/conseca/integration.test.d.ts} +0 -0
- /package/dist/src/{tools/smart-edit.test.d.ts → safety/conseca/policy-enforcer.test.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,555 +0,0 @@
|
|
|
1
|
-
# How to contribute
|
|
2
|
-
|
|
3
|
-
We would love to accept your patches and contributions to this project. This
|
|
4
|
-
document includes:
|
|
5
|
-
|
|
6
|
-
- **[Before you begin](#before-you-begin):** Essential steps to take before
|
|
7
|
-
becoming a Gemini CLI contributor.
|
|
8
|
-
- **[Code contribution process](#code-contribution-process):** How to contribute
|
|
9
|
-
code to Gemini CLI.
|
|
10
|
-
- **[Development setup and workflow](#development-setup-and-workflow):** How to
|
|
11
|
-
set up your development environment and workflow.
|
|
12
|
-
- **[Documentation contribution process](#documentation-contribution-process):**
|
|
13
|
-
How to contribute documentation to Gemini CLI.
|
|
14
|
-
|
|
15
|
-
We're looking forward to seeing your contributions!
|
|
16
|
-
|
|
17
|
-
## Before you begin
|
|
18
|
-
|
|
19
|
-
### Sign our Contributor License Agreement
|
|
20
|
-
|
|
21
|
-
Contributions to this project must be accompanied by a
|
|
22
|
-
[Contributor License Agreement](https://cla.developers.google.com/about) (CLA).
|
|
23
|
-
You (or your employer) retain the copyright to your contribution; this simply
|
|
24
|
-
gives us permission to use and redistribute your contributions as part of the
|
|
25
|
-
project.
|
|
26
|
-
|
|
27
|
-
If you or your current employer have already signed the Google CLA (even if it
|
|
28
|
-
was for a different project), you probably don't need to do it again.
|
|
29
|
-
|
|
30
|
-
Visit <https://cla.developers.google.com/> to see your current agreements or to
|
|
31
|
-
sign a new one.
|
|
32
|
-
|
|
33
|
-
### Review our Community Guidelines
|
|
34
|
-
|
|
35
|
-
This project follows
|
|
36
|
-
[Google's Open Source Community Guidelines](https://opensource.google/conduct/).
|
|
37
|
-
|
|
38
|
-
## Code contribution process
|
|
39
|
-
|
|
40
|
-
### Get started
|
|
41
|
-
|
|
42
|
-
The process for contributing code is as follows:
|
|
43
|
-
|
|
44
|
-
1. **Find an issue** that you want to work on. If an issue is tagged as
|
|
45
|
-
`🔒Maintainers only`, this means it is reserved for project maintainers. We
|
|
46
|
-
will not accept pull requests related to these issues. In the near future,
|
|
47
|
-
we will explicitly mark issues looking for contributions using the
|
|
48
|
-
`help-wanted` label. If you believe an issue is a good candidate for
|
|
49
|
-
community contribution, please leave a comment on the issue. A maintainer
|
|
50
|
-
will review it and apply the `help-wanted` label if appropriate. Only
|
|
51
|
-
maintainers should attempt to add the `help-wanted` label to an issue.
|
|
52
|
-
2. **Fork the repository** and create a new branch.
|
|
53
|
-
3. **Make your changes** in the `packages/` directory.
|
|
54
|
-
4. **Ensure all checks pass** by running `npm run preflight`.
|
|
55
|
-
5. **Open a pull request** with your changes.
|
|
56
|
-
|
|
57
|
-
### Code reviews
|
|
58
|
-
|
|
59
|
-
All submissions, including submissions by project members, require review. We
|
|
60
|
-
use [GitHub pull requests](https://docs.github.com/articles/about-pull-requests)
|
|
61
|
-
for this purpose.
|
|
62
|
-
|
|
63
|
-
If your pull request involves changes to `packages/cli` (the frontend), we
|
|
64
|
-
recommend running our automated frontend review tool. **Note: This tool is
|
|
65
|
-
currently experimental.** It helps detect common React anti-patterns, testing
|
|
66
|
-
issues, and other frontend-specific best practices that are easy to miss.
|
|
67
|
-
|
|
68
|
-
To run the review tool, enter the following command from within Gemini CLI:
|
|
69
|
-
|
|
70
|
-
```text
|
|
71
|
-
/review-frontend <PR_NUMBER>
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
Replace `<PR_NUMBER>` with your pull request number. Authors are encouraged to
|
|
75
|
-
run this on their own PRs for self-review, and reviewers should use it to
|
|
76
|
-
augment their manual review process.
|
|
77
|
-
|
|
78
|
-
### Self assigning issues
|
|
79
|
-
|
|
80
|
-
To assign an issue to yourself, simply add a comment with the text `/assign`.
|
|
81
|
-
The comment must contain only that text and nothing else. This command will
|
|
82
|
-
assign the issue to you, provided it is not already assigned.
|
|
83
|
-
|
|
84
|
-
Please note that you can have a maximum of 3 issues assigned to you at any given
|
|
85
|
-
time.
|
|
86
|
-
|
|
87
|
-
### Pull request guidelines
|
|
88
|
-
|
|
89
|
-
To help us review and merge your PRs quickly, please follow these guidelines.
|
|
90
|
-
PRs that do not meet these standards may be closed.
|
|
91
|
-
|
|
92
|
-
#### 1. Link to an existing issue
|
|
93
|
-
|
|
94
|
-
All PRs should be linked to an existing issue in our tracker. This ensures that
|
|
95
|
-
every change has been discussed and is aligned with the project's goals before
|
|
96
|
-
any code is written.
|
|
97
|
-
|
|
98
|
-
- **For bug fixes:** The PR should be linked to the bug report issue.
|
|
99
|
-
- **For features:** The PR should be linked to the feature request or proposal
|
|
100
|
-
issue that has been approved by a maintainer.
|
|
101
|
-
|
|
102
|
-
If an issue for your change doesn't exist, we will automatically close your PR
|
|
103
|
-
along with a comment reminding you to associate the PR with an issue. The ideal
|
|
104
|
-
workflow starts with an issue that has been reviewed and approved by a
|
|
105
|
-
maintainer. Please **open the issue first** and wait for feedback before you
|
|
106
|
-
start coding.
|
|
107
|
-
|
|
108
|
-
#### 2. Keep it small and focused
|
|
109
|
-
|
|
110
|
-
We favor small, atomic PRs that address a single issue or add a single,
|
|
111
|
-
self-contained feature.
|
|
112
|
-
|
|
113
|
-
- **Do:** Create a PR that fixes one specific bug or adds one specific feature.
|
|
114
|
-
- **Don't:** Bundle multiple unrelated changes (e.g., a bug fix, a new feature,
|
|
115
|
-
and a refactor) into a single PR.
|
|
116
|
-
|
|
117
|
-
Large changes should be broken down into a series of smaller, logical PRs that
|
|
118
|
-
can be reviewed and merged independently.
|
|
119
|
-
|
|
120
|
-
#### 3. Use draft PRs for work in progress
|
|
121
|
-
|
|
122
|
-
If you'd like to get early feedback on your work, please use GitHub's **Draft
|
|
123
|
-
Pull Request** feature. This signals to the maintainers that the PR is not yet
|
|
124
|
-
ready for a formal review but is open for discussion and initial feedback.
|
|
125
|
-
|
|
126
|
-
#### 4. Ensure all checks pass
|
|
127
|
-
|
|
128
|
-
Before submitting your PR, ensure that all automated checks are passing by
|
|
129
|
-
running `npm run preflight`. This command runs all tests, linting, and other
|
|
130
|
-
style checks.
|
|
131
|
-
|
|
132
|
-
#### 5. Update documentation
|
|
133
|
-
|
|
134
|
-
If your PR introduces a user-facing change (e.g., a new command, a modified
|
|
135
|
-
flag, or a change in behavior), you must also update the relevant documentation
|
|
136
|
-
in the `/docs` directory.
|
|
137
|
-
|
|
138
|
-
See more about writing documentation:
|
|
139
|
-
[Documentation contribution process](#documentation-contribution-process).
|
|
140
|
-
|
|
141
|
-
#### 6. Write clear commit messages and a good PR description
|
|
142
|
-
|
|
143
|
-
Your PR should have a clear, descriptive title and a detailed description of the
|
|
144
|
-
changes. Follow the [Conventional Commits](https://www.conventionalcommits.org/)
|
|
145
|
-
standard for your commit messages.
|
|
146
|
-
|
|
147
|
-
- **Good PR title:** `feat(cli): Add --json flag to 'config get' command`
|
|
148
|
-
- **Bad PR title:** `Made some changes`
|
|
149
|
-
|
|
150
|
-
In the PR description, explain the "why" behind your changes and link to the
|
|
151
|
-
relevant issue (e.g., `Fixes #123`).
|
|
152
|
-
|
|
153
|
-
### Forking
|
|
154
|
-
|
|
155
|
-
If you are forking the repository you will be able to run the Build, Test and
|
|
156
|
-
Integration test workflows. However in order to make the integration tests run
|
|
157
|
-
you'll need to add a
|
|
158
|
-
[GitHub Repository Secret](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository)
|
|
159
|
-
with a value of `GEMINI_API_KEY` and set that to a valid API key that you have
|
|
160
|
-
available. Your key and secret are private to your repo; no one without access
|
|
161
|
-
can see your key and you cannot see any secrets related to this repo.
|
|
162
|
-
|
|
163
|
-
Additionally you will need to click on the `Actions` tab and enable workflows
|
|
164
|
-
for your repository, you'll find it's the large blue button in the center of the
|
|
165
|
-
screen.
|
|
166
|
-
|
|
167
|
-
### Development setup and workflow
|
|
168
|
-
|
|
169
|
-
This section guides contributors on how to build, modify, and understand the
|
|
170
|
-
development setup of this project.
|
|
171
|
-
|
|
172
|
-
### Setting up the development environment
|
|
173
|
-
|
|
174
|
-
**Prerequisites:**
|
|
175
|
-
|
|
176
|
-
1. **Node.js**:
|
|
177
|
-
- **Development:** Please use Node.js `~20.19.0`. This specific version is
|
|
178
|
-
required due to an upstream development dependency issue. You can use a
|
|
179
|
-
tool like [nvm](https://github.com/nvm-sh/nvm) to manage Node.js versions.
|
|
180
|
-
- **Production:** For running the CLI in a production environment, any
|
|
181
|
-
version of Node.js `>=20` is acceptable.
|
|
182
|
-
2. **Git**
|
|
183
|
-
|
|
184
|
-
### Build process
|
|
185
|
-
|
|
186
|
-
To clone the repository:
|
|
187
|
-
|
|
188
|
-
```bash
|
|
189
|
-
git clone https://github.com/google-gemini/gemini-cli.git # Or your fork's URL
|
|
190
|
-
cd gemini-cli
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
To install dependencies defined in `package.json` as well as root dependencies:
|
|
194
|
-
|
|
195
|
-
```bash
|
|
196
|
-
npm install
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
To build the entire project (all packages):
|
|
200
|
-
|
|
201
|
-
```bash
|
|
202
|
-
npm run build
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
This command typically compiles TypeScript to JavaScript, bundles assets, and
|
|
206
|
-
prepares the packages for execution. Refer to `scripts/build.js` and
|
|
207
|
-
`package.json` scripts for more details on what happens during the build.
|
|
208
|
-
|
|
209
|
-
### Enabling sandboxing
|
|
210
|
-
|
|
211
|
-
[Sandboxing](#sandboxing) is highly recommended and requires, at a minimum,
|
|
212
|
-
setting `GEMINI_SANDBOX=true` in your `~/.env` and ensuring a sandboxing
|
|
213
|
-
provider (e.g. `macOS Seatbelt`, `docker`, or `podman`) is available. See
|
|
214
|
-
[Sandboxing](#sandboxing) for details.
|
|
215
|
-
|
|
216
|
-
To build both the `gemini` CLI utility and the sandbox container, run
|
|
217
|
-
`build:all` from the root directory:
|
|
218
|
-
|
|
219
|
-
```bash
|
|
220
|
-
npm run build:all
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
To skip building the sandbox container, you can use `npm run build` instead.
|
|
224
|
-
|
|
225
|
-
### Running the CLI
|
|
226
|
-
|
|
227
|
-
To start the Gemini CLI from the source code (after building), run the following
|
|
228
|
-
command from the root directory:
|
|
229
|
-
|
|
230
|
-
```bash
|
|
231
|
-
npm start
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
If you'd like to run the source build outside of the gemini-cli folder, you can
|
|
235
|
-
utilize `npm link path/to/gemini-cli/packages/cli` (see:
|
|
236
|
-
[docs](https://docs.npmjs.com/cli/v9/commands/npm-link)) or
|
|
237
|
-
`alias gemini="node path/to/gemini-cli/packages/cli"` to run with `gemini`
|
|
238
|
-
|
|
239
|
-
### Running tests
|
|
240
|
-
|
|
241
|
-
This project contains two types of tests: unit tests and integration tests.
|
|
242
|
-
|
|
243
|
-
#### Unit tests
|
|
244
|
-
|
|
245
|
-
To execute the unit test suite for the project:
|
|
246
|
-
|
|
247
|
-
```bash
|
|
248
|
-
npm run test
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
This will run tests located in the `packages/core` and `packages/cli`
|
|
252
|
-
directories. Ensure tests pass before submitting any changes. For a more
|
|
253
|
-
comprehensive check, it is recommended to run `npm run preflight`.
|
|
254
|
-
|
|
255
|
-
#### Integration tests
|
|
256
|
-
|
|
257
|
-
The integration tests are designed to validate the end-to-end functionality of
|
|
258
|
-
the Gemini CLI. They are not run as part of the default `npm run test` command.
|
|
259
|
-
|
|
260
|
-
To run the integration tests, use the following command:
|
|
261
|
-
|
|
262
|
-
```bash
|
|
263
|
-
npm run test:e2e
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
For more detailed information on the integration testing framework, please see
|
|
267
|
-
the [Integration Tests documentation](/docs/integration-tests.md).
|
|
268
|
-
|
|
269
|
-
### Linting and preflight checks
|
|
270
|
-
|
|
271
|
-
To ensure code quality and formatting consistency, run the preflight check:
|
|
272
|
-
|
|
273
|
-
```bash
|
|
274
|
-
npm run preflight
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
This command will run ESLint, Prettier, all tests, and other checks as defined
|
|
278
|
-
in the project's `package.json`.
|
|
279
|
-
|
|
280
|
-
_ProTip_
|
|
281
|
-
|
|
282
|
-
after cloning create a git precommit hook file to ensure your commits are always
|
|
283
|
-
clean.
|
|
284
|
-
|
|
285
|
-
```bash
|
|
286
|
-
echo "
|
|
287
|
-
# Run npm build and check for errors
|
|
288
|
-
if ! npm run preflight; then
|
|
289
|
-
echo "npm build failed. Commit aborted."
|
|
290
|
-
exit 1
|
|
291
|
-
fi
|
|
292
|
-
" > .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit
|
|
293
|
-
```
|
|
294
|
-
|
|
295
|
-
#### Formatting
|
|
296
|
-
|
|
297
|
-
To separately format the code in this project by running the following command
|
|
298
|
-
from the root directory:
|
|
299
|
-
|
|
300
|
-
```bash
|
|
301
|
-
npm run format
|
|
302
|
-
```
|
|
303
|
-
|
|
304
|
-
This command uses Prettier to format the code according to the project's style
|
|
305
|
-
guidelines.
|
|
306
|
-
|
|
307
|
-
#### Linting
|
|
308
|
-
|
|
309
|
-
To separately lint the code in this project, run the following command from the
|
|
310
|
-
root directory:
|
|
311
|
-
|
|
312
|
-
```bash
|
|
313
|
-
npm run lint
|
|
314
|
-
```
|
|
315
|
-
|
|
316
|
-
### Coding conventions
|
|
317
|
-
|
|
318
|
-
- Please adhere to the coding style, patterns, and conventions used throughout
|
|
319
|
-
the existing codebase.
|
|
320
|
-
- Consult
|
|
321
|
-
[GEMINI.md](https://github.com/google-gemini/gemini-cli/blob/main/GEMINI.md)
|
|
322
|
-
(typically found in the project root) for specific instructions related to
|
|
323
|
-
AI-assisted development, including conventions for React, comments, and Git
|
|
324
|
-
usage.
|
|
325
|
-
- **Imports:** Pay special attention to import paths. The project uses ESLint to
|
|
326
|
-
enforce restrictions on relative imports between packages.
|
|
327
|
-
|
|
328
|
-
### Project structure
|
|
329
|
-
|
|
330
|
-
- `packages/`: Contains the individual sub-packages of the project.
|
|
331
|
-
- `a2a-server`: A2A server implementation for the Gemini CLI. (Experimental)
|
|
332
|
-
- `cli/`: The command-line interface.
|
|
333
|
-
- `core/`: The core backend logic for the Gemini CLI.
|
|
334
|
-
- `test-utils` Utilities for creating and cleaning temporary file systems for
|
|
335
|
-
testing.
|
|
336
|
-
- `vscode-ide-companion/`: The Gemini CLI Companion extension pairs with
|
|
337
|
-
Gemini CLI.
|
|
338
|
-
- `docs/`: Contains all project documentation.
|
|
339
|
-
- `scripts/`: Utility scripts for building, testing, and development tasks.
|
|
340
|
-
|
|
341
|
-
For more detailed architecture, see `docs/architecture.md`.
|
|
342
|
-
|
|
343
|
-
### Debugging
|
|
344
|
-
|
|
345
|
-
#### VS Code
|
|
346
|
-
|
|
347
|
-
0. Run the CLI to interactively debug in VS Code with `F5`
|
|
348
|
-
1. Start the CLI in debug mode from the root directory:
|
|
349
|
-
```bash
|
|
350
|
-
npm run debug
|
|
351
|
-
```
|
|
352
|
-
This command runs `node --inspect-brk dist/gemini.js` within the
|
|
353
|
-
`packages/cli` directory, pausing execution until a debugger attaches. You
|
|
354
|
-
can then open `chrome://inspect` in your Chrome browser to connect to the
|
|
355
|
-
debugger.
|
|
356
|
-
2. In VS Code, use the "Attach" launch configuration (found in
|
|
357
|
-
`.vscode/launch.json`).
|
|
358
|
-
|
|
359
|
-
Alternatively, you can use the "Launch Program" configuration in VS Code if you
|
|
360
|
-
prefer to launch the currently open file directly, but 'F5' is generally
|
|
361
|
-
recommended.
|
|
362
|
-
|
|
363
|
-
To hit a breakpoint inside the sandbox container run:
|
|
364
|
-
|
|
365
|
-
```bash
|
|
366
|
-
DEBUG=1 gemini
|
|
367
|
-
```
|
|
368
|
-
|
|
369
|
-
**Note:** If you have `DEBUG=true` in a project's `.env` file, it won't affect
|
|
370
|
-
gemini-cli due to automatic exclusion. Use `.gemini/.env` files for gemini-cli
|
|
371
|
-
specific debug settings.
|
|
372
|
-
|
|
373
|
-
### React DevTools
|
|
374
|
-
|
|
375
|
-
To debug the CLI's React-based UI, you can use React DevTools. Ink, the library
|
|
376
|
-
used for the CLI's interface, is compatible with React DevTools version 4.x.
|
|
377
|
-
|
|
378
|
-
1. **Start the Gemini CLI in development mode:**
|
|
379
|
-
|
|
380
|
-
```bash
|
|
381
|
-
DEV=true npm start
|
|
382
|
-
```
|
|
383
|
-
|
|
384
|
-
2. **Install and run React DevTools version 4.28.5 (or the latest compatible
|
|
385
|
-
4.x version):**
|
|
386
|
-
|
|
387
|
-
You can either install it globally:
|
|
388
|
-
|
|
389
|
-
```bash
|
|
390
|
-
npm install -g react-devtools@4.28.5
|
|
391
|
-
react-devtools
|
|
392
|
-
```
|
|
393
|
-
|
|
394
|
-
Or run it directly using npx:
|
|
395
|
-
|
|
396
|
-
```bash
|
|
397
|
-
npx react-devtools@4.28.5
|
|
398
|
-
```
|
|
399
|
-
|
|
400
|
-
Your running CLI application should then connect to React DevTools.
|
|
401
|
-

|
|
402
|
-
|
|
403
|
-
### Sandboxing
|
|
404
|
-
|
|
405
|
-
#### macOS Seatbelt
|
|
406
|
-
|
|
407
|
-
On macOS, `gemini` uses Seatbelt (`sandbox-exec`) under a `permissive-open`
|
|
408
|
-
profile (see `packages/cli/src/utils/sandbox-macos-permissive-open.sb`) that
|
|
409
|
-
restricts writes to the project folder but otherwise allows all other operations
|
|
410
|
-
and outbound network traffic ("open") by default. You can switch to a
|
|
411
|
-
`strict-open` profile (see
|
|
412
|
-
`packages/cli/src/utils/sandbox-macos-strict-open.sb`) that restricts both reads
|
|
413
|
-
and writes to the working directory while allowing outbound network traffic by
|
|
414
|
-
setting `SEATBELT_PROFILE=strict-open` in your environment or `.env` file.
|
|
415
|
-
Available built-in profiles are `permissive-{open,proxied}`,
|
|
416
|
-
`restrictive-{open,proxied}`, and `strict-{open,proxied}` (see below for proxied
|
|
417
|
-
networking). You can also switch to a custom profile
|
|
418
|
-
`SEATBELT_PROFILE=<profile>` if you also create a file
|
|
419
|
-
`.gemini/sandbox-macos-<profile>.sb` under your project settings directory
|
|
420
|
-
`.gemini`.
|
|
421
|
-
|
|
422
|
-
#### Container-based sandboxing (all platforms)
|
|
423
|
-
|
|
424
|
-
For stronger container-based sandboxing on macOS or other platforms, you can set
|
|
425
|
-
`GEMINI_SANDBOX=true|docker|podman|<command>` in your environment or `.env`
|
|
426
|
-
file. The specified command (or if `true` then either `docker` or `podman`) must
|
|
427
|
-
be installed on the host machine. Once enabled, `npm run build:all` will build a
|
|
428
|
-
minimal container ("sandbox") image and `npm start` will launch inside a fresh
|
|
429
|
-
instance of that container. The first build can take 20-30s (mostly due to
|
|
430
|
-
downloading of the base image) but after that both build and start overhead
|
|
431
|
-
should be minimal. Default builds (`npm run build`) will not rebuild the
|
|
432
|
-
sandbox.
|
|
433
|
-
|
|
434
|
-
Container-based sandboxing mounts the project directory (and system temp
|
|
435
|
-
directory) with read-write access and is started/stopped/removed automatically
|
|
436
|
-
as you start/stop Gemini CLI. Files created within the sandbox should be
|
|
437
|
-
automatically mapped to your user/group on host machine. You can easily specify
|
|
438
|
-
additional mounts, ports, or environment variables by setting
|
|
439
|
-
`SANDBOX_{MOUNTS,PORTS,ENV}` as needed. You can also fully customize the sandbox
|
|
440
|
-
for your projects by creating the files `.gemini/sandbox.Dockerfile` and/or
|
|
441
|
-
`.gemini/sandbox.bashrc` under your project settings directory (`.gemini`) and
|
|
442
|
-
running `gemini` with `BUILD_SANDBOX=1` to trigger building of your custom
|
|
443
|
-
sandbox.
|
|
444
|
-
|
|
445
|
-
#### Proxied networking
|
|
446
|
-
|
|
447
|
-
All sandboxing methods, including macOS Seatbelt using `*-proxied` profiles,
|
|
448
|
-
support restricting outbound network traffic through a custom proxy server that
|
|
449
|
-
can be specified as `GEMINI_SANDBOX_PROXY_COMMAND=<command>`, where `<command>`
|
|
450
|
-
must start a proxy server that listens on `:::8877` for relevant requests. See
|
|
451
|
-
`docs/examples/proxy-script.md` for a minimal proxy that only allows `HTTPS`
|
|
452
|
-
connections to `example.com:443` (e.g. `curl https://example.com`) and declines
|
|
453
|
-
all other requests. The proxy is started and stopped automatically alongside the
|
|
454
|
-
sandbox.
|
|
455
|
-
|
|
456
|
-
### Manual publish
|
|
457
|
-
|
|
458
|
-
We publish an artifact for each commit to our internal registry. But if you need
|
|
459
|
-
to manually cut a local build, then run the following commands:
|
|
460
|
-
|
|
461
|
-
```
|
|
462
|
-
npm run clean
|
|
463
|
-
npm install
|
|
464
|
-
npm run auth
|
|
465
|
-
npm run prerelease:dev
|
|
466
|
-
npm publish --workspaces
|
|
467
|
-
```
|
|
468
|
-
|
|
469
|
-
## Documentation contribution process
|
|
470
|
-
|
|
471
|
-
Our documentation must be kept up-to-date with our code contributions. We want
|
|
472
|
-
our documentation to be clear, concise, and helpful to our users. We value:
|
|
473
|
-
|
|
474
|
-
- **Clarity:** Use simple and direct language. Avoid jargon where possible.
|
|
475
|
-
- **Accuracy:** Ensure all information is correct and up-to-date.
|
|
476
|
-
- **Completeness:** Cover all aspects of a feature or topic.
|
|
477
|
-
- **Examples:** Provide practical examples to help users understand how to use
|
|
478
|
-
Gemini CLI.
|
|
479
|
-
|
|
480
|
-
### Getting started
|
|
481
|
-
|
|
482
|
-
The process for contributing to the documentation is similar to contributing
|
|
483
|
-
code.
|
|
484
|
-
|
|
485
|
-
1. **Fork the repository** and create a new branch.
|
|
486
|
-
2. **Make your changes** in the `/docs` directory.
|
|
487
|
-
3. **Preview your changes locally** in Markdown rendering.
|
|
488
|
-
4. **Lint and format your changes.** Our preflight check includes linting and
|
|
489
|
-
formatting for documentation files.
|
|
490
|
-
```bash
|
|
491
|
-
npm run preflight
|
|
492
|
-
```
|
|
493
|
-
5. **Open a pull request** with your changes.
|
|
494
|
-
|
|
495
|
-
### Documentation structure
|
|
496
|
-
|
|
497
|
-
Our documentation is organized using [sidebar.json](/docs/sidebar.json) as the
|
|
498
|
-
table of contents. When adding new documentation:
|
|
499
|
-
|
|
500
|
-
1. Create your markdown file **in the appropriate directory** under `/docs`.
|
|
501
|
-
2. Add an entry to `sidebar.json` in the relevant section.
|
|
502
|
-
3. Ensure all internal links use relative paths and point to existing files.
|
|
503
|
-
|
|
504
|
-
### Style guide
|
|
505
|
-
|
|
506
|
-
We follow the
|
|
507
|
-
[Google Developer Documentation Style Guide](https://developers.google.com/style).
|
|
508
|
-
Please refer to it for guidance on writing style, tone, and formatting.
|
|
509
|
-
|
|
510
|
-
#### Key style points
|
|
511
|
-
|
|
512
|
-
- Use sentence case for headings.
|
|
513
|
-
- Write in second person ("you") when addressing the reader.
|
|
514
|
-
- Use present tense.
|
|
515
|
-
- Keep paragraphs short and focused.
|
|
516
|
-
- Use code blocks with appropriate language tags for syntax highlighting.
|
|
517
|
-
- Include practical examples whenever possible.
|
|
518
|
-
|
|
519
|
-
### Linting and formatting
|
|
520
|
-
|
|
521
|
-
We use `prettier` to enforce a consistent style across our documentation. The
|
|
522
|
-
`npm run preflight` command will check for any linting issues.
|
|
523
|
-
|
|
524
|
-
You can also run the linter and formatter separately:
|
|
525
|
-
|
|
526
|
-
- `npm run lint` - Check for linting issues
|
|
527
|
-
- `npm run format` - Auto-format markdown files
|
|
528
|
-
- `npm run lint:fix` - Auto-fix linting issues where possible
|
|
529
|
-
|
|
530
|
-
Please make sure your contributions are free of linting errors before submitting
|
|
531
|
-
a pull request.
|
|
532
|
-
|
|
533
|
-
### Before you submit
|
|
534
|
-
|
|
535
|
-
Before submitting your documentation pull request, please:
|
|
536
|
-
|
|
537
|
-
1. Run `npm run preflight` to ensure all checks pass.
|
|
538
|
-
2. Review your changes for clarity and accuracy.
|
|
539
|
-
3. Check that all links work correctly.
|
|
540
|
-
4. Ensure any code examples are tested and functional.
|
|
541
|
-
5. Sign the
|
|
542
|
-
[Contributor License Agreement (CLA)](https://cla.developers.google.com/) if
|
|
543
|
-
you haven't already.
|
|
544
|
-
|
|
545
|
-
### Need help?
|
|
546
|
-
|
|
547
|
-
If you have questions about contributing documentation:
|
|
548
|
-
|
|
549
|
-
- Check our [FAQ](/docs/faq.md).
|
|
550
|
-
- Review existing documentation for examples.
|
|
551
|
-
- Open [an issue](https://github.com/google-gemini/gemini-cli/issues) to discuss
|
|
552
|
-
your proposed changes.
|
|
553
|
-
- Reach out to the maintainers.
|
|
554
|
-
|
|
555
|
-
We appreciate your contributions to making Gemini CLI documentation better!
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2025 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import type { Config } from '../config/config.js';
|
|
7
|
-
import type { AgentDefinition, AgentInputs, OutputObject, SubagentActivityEvent } from './types.js';
|
|
8
|
-
import { type z } from 'zod';
|
|
9
|
-
/** A callback function to report on agent activity. */
|
|
10
|
-
export type ActivityCallback = (activity: SubagentActivityEvent) => void;
|
|
11
|
-
/**
|
|
12
|
-
* Executes an agent loop based on an {@link AgentDefinition}.
|
|
13
|
-
*
|
|
14
|
-
* This executor runs the agent in a loop, calling tools until it calls the
|
|
15
|
-
* mandatory `complete_task` tool to signal completion.
|
|
16
|
-
*/
|
|
17
|
-
export declare class AgentExecutor<TOutput extends z.ZodTypeAny> {
|
|
18
|
-
readonly definition: AgentDefinition<TOutput>;
|
|
19
|
-
private readonly agentId;
|
|
20
|
-
private readonly toolRegistry;
|
|
21
|
-
private readonly runtimeContext;
|
|
22
|
-
private readonly onActivity?;
|
|
23
|
-
private readonly compressionService;
|
|
24
|
-
private hasFailedCompressionAttempt;
|
|
25
|
-
/**
|
|
26
|
-
* Creates and validates a new `AgentExecutor` instance.
|
|
27
|
-
*
|
|
28
|
-
* This method ensures that all tools specified in the agent's definition are
|
|
29
|
-
* safe for non-interactive use before creating the executor.
|
|
30
|
-
*
|
|
31
|
-
* @param definition The definition object for the agent.
|
|
32
|
-
* @param runtimeContext The global runtime configuration.
|
|
33
|
-
* @param onActivity An optional callback to receive activity events.
|
|
34
|
-
* @returns A promise that resolves to a new `AgentExecutor` instance.
|
|
35
|
-
*/
|
|
36
|
-
static create<TOutput extends z.ZodTypeAny>(definition: AgentDefinition<TOutput>, runtimeContext: Config, onActivity?: ActivityCallback): Promise<AgentExecutor<TOutput>>;
|
|
37
|
-
/**
|
|
38
|
-
* Constructs a new AgentExecutor instance.
|
|
39
|
-
*
|
|
40
|
-
* @private This constructor is private. Use the static `create` method to
|
|
41
|
-
* instantiate the class.
|
|
42
|
-
*/
|
|
43
|
-
private constructor();
|
|
44
|
-
/**
|
|
45
|
-
* Executes a single turn of the agent's logic, from calling the model
|
|
46
|
-
* to processing its response.
|
|
47
|
-
*
|
|
48
|
-
* @returns An {@link AgentTurnResult} object indicating whether to continue
|
|
49
|
-
* or stop the agent loop.
|
|
50
|
-
*/
|
|
51
|
-
private executeTurn;
|
|
52
|
-
/**
|
|
53
|
-
* Generates a specific warning message for the agent's final turn.
|
|
54
|
-
*/
|
|
55
|
-
private getFinalWarningMessage;
|
|
56
|
-
/**
|
|
57
|
-
* Attempts a single, final recovery turn if the agent stops for a recoverable reason.
|
|
58
|
-
* Gives the agent a grace period to call `complete_task`.
|
|
59
|
-
*
|
|
60
|
-
* @returns The final result string if recovery was successful, or `null` if it failed.
|
|
61
|
-
*/
|
|
62
|
-
private executeFinalWarningTurn;
|
|
63
|
-
/**
|
|
64
|
-
* Runs the agent.
|
|
65
|
-
*
|
|
66
|
-
* @param inputs The validated input parameters for this invocation.
|
|
67
|
-
* @param signal An `AbortSignal` for cancellation.
|
|
68
|
-
* @returns A promise that resolves to the agent's final output.
|
|
69
|
-
*/
|
|
70
|
-
run(inputs: AgentInputs, signal: AbortSignal): Promise<OutputObject>;
|
|
71
|
-
private tryCompressChat;
|
|
72
|
-
/**
|
|
73
|
-
* Calls the generative model with the current context and tools.
|
|
74
|
-
*
|
|
75
|
-
* @returns The model's response, including any tool calls or text.
|
|
76
|
-
*/
|
|
77
|
-
private callModel;
|
|
78
|
-
/** Initializes a `GeminiChat` instance for the agent run. */
|
|
79
|
-
private createChatObject;
|
|
80
|
-
/**
|
|
81
|
-
* Executes function calls requested by the model and returns the results.
|
|
82
|
-
*
|
|
83
|
-
* @returns A new `Content` object for history, any submitted output, and completion status.
|
|
84
|
-
*/
|
|
85
|
-
private processFunctionCalls;
|
|
86
|
-
/**
|
|
87
|
-
* Prepares the list of tool function declarations to be sent to the model.
|
|
88
|
-
*/
|
|
89
|
-
private prepareToolsList;
|
|
90
|
-
/** Builds the system prompt from the agent definition and inputs. */
|
|
91
|
-
private buildSystemPrompt;
|
|
92
|
-
/**
|
|
93
|
-
* Applies template strings to initial messages.
|
|
94
|
-
*
|
|
95
|
-
* @param initialMessages The initial messages from the prompt config.
|
|
96
|
-
* @param inputs The validated input parameters for this invocation.
|
|
97
|
-
* @returns A new array of `Content` with templated strings.
|
|
98
|
-
*/
|
|
99
|
-
private applyTemplateToInitialMessages;
|
|
100
|
-
/**
|
|
101
|
-
* Validates that all tools in a registry are safe for non-interactive use.
|
|
102
|
-
*
|
|
103
|
-
* @throws An error if a tool is not on the allow-list for non-interactive execution.
|
|
104
|
-
*/
|
|
105
|
-
private static validateTools;
|
|
106
|
-
/**
|
|
107
|
-
* Checks if the agent should terminate due to exceeding configured limits.
|
|
108
|
-
*
|
|
109
|
-
* @returns The reason for termination, or `null` if execution can continue.
|
|
110
|
-
*/
|
|
111
|
-
private checkTermination;
|
|
112
|
-
/** Emits an activity event to the configured callback. */
|
|
113
|
-
private emitActivity;
|
|
114
|
-
}
|