@office-ai/aioncli-core 0.18.7 → 0.24.0-preview.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/CONTRIBUTING.md +546 -0
- package/dist/docs/architecture.md +80 -0
- package/dist/docs/assets/connected_devtools.png +0 -0
- package/dist/docs/assets/gemini-screenshot.png +0 -0
- package/dist/docs/assets/release_patch.png +0 -0
- package/dist/docs/assets/theme-ansi-light.png +0 -0
- package/dist/docs/assets/theme-ansi.png +0 -0
- package/dist/docs/assets/theme-atom-one.png +0 -0
- package/dist/docs/assets/theme-ayu-light.png +0 -0
- package/dist/docs/assets/theme-ayu.png +0 -0
- package/dist/docs/assets/theme-custom.png +0 -0
- package/dist/docs/assets/theme-default-light.png +0 -0
- package/dist/docs/assets/theme-default.png +0 -0
- package/dist/docs/assets/theme-dracula.png +0 -0
- package/dist/docs/assets/theme-github-light.png +0 -0
- package/dist/docs/assets/theme-github.png +0 -0
- package/dist/docs/assets/theme-google-light.png +0 -0
- package/dist/docs/assets/theme-xcode-light.png +0 -0
- package/dist/docs/changelogs/index.md +592 -0
- package/dist/docs/changelogs/latest.md +225 -0
- package/dist/docs/changelogs/preview.md +129 -0
- package/dist/docs/changelogs/releases.md +896 -0
- package/dist/docs/cli/authentication.md +3 -0
- package/dist/docs/cli/checkpointing.md +94 -0
- package/dist/docs/cli/commands.md +354 -0
- package/dist/docs/cli/configuration.md +780 -0
- package/dist/docs/cli/custom-commands.md +315 -0
- package/dist/docs/cli/enterprise.md +565 -0
- package/dist/docs/cli/gemini-ignore.md +71 -0
- package/dist/docs/cli/gemini-md.md +108 -0
- package/dist/docs/cli/generation-settings.md +210 -0
- package/dist/docs/cli/headless.md +388 -0
- package/dist/docs/cli/index.md +63 -0
- package/dist/docs/cli/keyboard-shortcuts.md +143 -0
- package/dist/docs/cli/model-routing.md +37 -0
- package/dist/docs/cli/model.md +62 -0
- package/dist/docs/cli/sandbox.md +171 -0
- package/dist/docs/cli/session-management.md +158 -0
- package/dist/docs/cli/settings.md +114 -0
- package/dist/docs/cli/skills.md +156 -0
- package/dist/docs/cli/system-prompt.md +93 -0
- package/dist/docs/cli/telemetry.md +791 -0
- package/dist/docs/cli/themes.md +237 -0
- package/dist/docs/cli/token-caching.md +20 -0
- package/dist/docs/cli/trusted-folders.md +95 -0
- package/dist/docs/cli/tutorials/skills-getting-started.md +124 -0
- package/dist/docs/cli/tutorials.md +87 -0
- package/dist/docs/cli/uninstall.md +47 -0
- package/dist/docs/core/index.md +101 -0
- package/dist/docs/core/memport.md +244 -0
- package/dist/docs/core/policy-engine.md +267 -0
- package/dist/docs/core/tools-api.md +131 -0
- package/dist/docs/examples/proxy-script.md +83 -0
- package/dist/docs/extension.md +160 -0
- package/dist/docs/extensions/extension-releasing.md +183 -0
- package/dist/docs/extensions/getting-started-extensions.md +245 -0
- package/dist/docs/extensions/index.md +293 -0
- package/dist/docs/faq.md +154 -0
- package/dist/docs/get-started/authentication.md +321 -0
- package/dist/docs/get-started/configuration-v1.md +888 -0
- package/dist/docs/get-started/configuration.md +1536 -0
- package/dist/docs/get-started/deployment.md +143 -0
- package/dist/docs/get-started/examples.md +219 -0
- package/dist/docs/get-started/gemini-3.md +116 -0
- package/dist/docs/get-started/index.md +71 -0
- package/dist/docs/get-started/installation.md +141 -0
- package/dist/docs/hooks/best-practices.md +856 -0
- package/dist/docs/hooks/index.md +687 -0
- package/dist/docs/hooks/reference.md +168 -0
- package/dist/docs/hooks/writing-hooks.md +1026 -0
- package/dist/docs/ide-integration/ide-companion-spec.md +267 -0
- package/dist/docs/ide-integration/index.md +202 -0
- package/dist/docs/index.md +147 -0
- package/dist/docs/integration-tests.md +211 -0
- package/dist/docs/issue-and-pr-automation.md +134 -0
- package/dist/docs/local-development.md +128 -0
- package/dist/docs/mermaid/context.mmd +103 -0
- package/dist/docs/mermaid/render-path.mmd +64 -0
- package/dist/docs/npm.md +62 -0
- package/dist/docs/quota-and-pricing.md +158 -0
- package/dist/docs/release-confidence.md +164 -0
- package/dist/docs/releases.md +540 -0
- package/dist/docs/sidebar.json +301 -0
- package/dist/docs/tools/file-system.md +217 -0
- package/dist/docs/tools/index.md +95 -0
- package/dist/docs/tools/mcp-server.md +1044 -0
- package/dist/docs/tools/memory.md +54 -0
- package/dist/docs/tools/shell.md +260 -0
- package/dist/docs/tools/todos.md +57 -0
- package/dist/docs/tools/web-fetch.md +59 -0
- package/dist/docs/tools/web-search.md +42 -0
- package/dist/docs/tos-privacy.md +96 -0
- package/dist/docs/troubleshooting.md +158 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/src/agents/a2a-client-manager.d.ts +78 -0
- package/dist/src/agents/a2a-client-manager.js +295 -0
- package/dist/src/agents/a2a-client-manager.js.map +1 -0
- package/dist/src/agents/a2a-client-manager.test.d.ts +6 -0
- package/dist/src/agents/a2a-client-manager.test.js +237 -0
- package/dist/src/agents/a2a-client-manager.test.js.map +1 -0
- package/dist/src/agents/a2aUtils.d.ts +28 -0
- package/dist/src/agents/a2aUtils.js +111 -0
- package/dist/src/agents/a2aUtils.js.map +1 -0
- package/dist/src/agents/a2aUtils.test.d.ts +6 -0
- package/dist/src/agents/a2aUtils.test.js +147 -0
- package/dist/src/agents/a2aUtils.test.js.map +1 -0
- package/dist/src/agents/codebase-investigator.d.ts +2 -2
- package/dist/src/agents/codebase-investigator.js +5 -4
- package/dist/src/agents/codebase-investigator.js.map +1 -1
- package/dist/src/agents/delegate-to-agent-tool.d.ts +19 -0
- package/dist/src/agents/delegate-to-agent-tool.js +115 -0
- package/dist/src/agents/delegate-to-agent-tool.js.map +1 -0
- package/dist/src/agents/delegate-to-agent-tool.test.d.ts +6 -0
- package/dist/src/agents/delegate-to-agent-tool.test.js +165 -0
- package/dist/src/agents/delegate-to-agent-tool.test.js.map +1 -0
- package/dist/src/agents/introspection-agent.d.ts +23 -0
- package/dist/src/agents/introspection-agent.js +72 -0
- package/dist/src/agents/introspection-agent.js.map +1 -0
- package/dist/src/agents/introspection-agent.test.d.ts +6 -0
- package/dist/src/agents/introspection-agent.test.js +47 -0
- package/dist/src/agents/introspection-agent.test.js.map +1 -0
- package/dist/src/agents/local-executor.d.ts +108 -0
- package/dist/src/agents/local-executor.js +801 -0
- package/dist/src/agents/local-executor.js.map +1 -0
- package/dist/src/agents/local-executor.test.d.ts +6 -0
- package/dist/src/agents/local-executor.test.js +1380 -0
- package/dist/src/agents/local-executor.test.js.map +1 -0
- package/dist/src/agents/local-invocation.d.ts +45 -0
- package/dist/src/agents/local-invocation.js +101 -0
- package/dist/src/agents/local-invocation.js.map +1 -0
- package/dist/src/agents/local-invocation.test.d.ts +6 -0
- package/dist/src/agents/local-invocation.test.js +218 -0
- package/dist/src/agents/local-invocation.test.js.map +1 -0
- package/dist/src/agents/registry.d.ts +25 -1
- package/dist/src/agents/registry.js +149 -5
- package/dist/src/agents/registry.js.map +1 -1
- package/dist/src/agents/registry.test.js +247 -25
- package/dist/src/agents/registry.test.js.map +1 -1
- package/dist/src/agents/remote-invocation.d.ts +35 -0
- package/dist/src/agents/remote-invocation.js +129 -0
- package/dist/src/agents/remote-invocation.js.map +1 -0
- package/dist/src/agents/remote-invocation.test.d.ts +6 -0
- package/dist/src/agents/remote-invocation.test.js +201 -0
- package/dist/src/agents/remote-invocation.test.js.map +1 -0
- package/dist/src/agents/subagent-tool-wrapper.d.ts +2 -2
- package/dist/src/agents/subagent-tool-wrapper.js +11 -6
- package/dist/src/agents/subagent-tool-wrapper.js.map +1 -1
- package/dist/src/agents/subagent-tool-wrapper.test.js +25 -17
- package/dist/src/agents/subagent-tool-wrapper.test.js.map +1 -1
- package/dist/src/agents/toml-loader.d.ts +74 -0
- package/dist/src/agents/toml-loader.js +248 -0
- package/dist/src/agents/toml-loader.js.map +1 -0
- package/dist/src/agents/toml-loader.test.d.ts +6 -0
- package/dist/src/agents/toml-loader.test.js +309 -0
- package/dist/src/agents/toml-loader.test.js.map +1 -0
- package/dist/src/agents/types.d.ts +18 -4
- package/dist/src/availability/errorClassification.d.ts +7 -0
- package/dist/src/availability/errorClassification.js +20 -0
- package/dist/src/availability/errorClassification.js.map +1 -0
- package/dist/src/availability/modelAvailabilityService.d.ts +36 -0
- package/dist/src/availability/modelAvailabilityService.js +87 -0
- package/dist/src/availability/modelAvailabilityService.js.map +1 -0
- package/dist/src/availability/modelAvailabilityService.test.d.ts +6 -0
- package/dist/src/availability/modelAvailabilityService.test.js +140 -0
- package/dist/src/availability/modelAvailabilityService.test.js.map +1 -0
- package/dist/src/availability/modelPolicy.d.ts +49 -0
- package/dist/src/availability/modelPolicy.js +7 -0
- package/dist/src/availability/modelPolicy.js.map +1 -0
- package/dist/src/availability/policyCatalog.d.ts +23 -0
- package/dist/src/availability/policyCatalog.js +82 -0
- package/dist/src/availability/policyCatalog.js.map +1 -0
- package/dist/src/availability/policyCatalog.test.d.ts +6 -0
- package/dist/src/availability/policyCatalog.test.js +70 -0
- package/dist/src/availability/policyCatalog.test.js.map +1 -0
- package/dist/src/availability/policyHelpers.d.ts +52 -0
- package/dist/src/availability/policyHelpers.js +136 -0
- package/dist/src/availability/policyHelpers.js.map +1 -0
- package/dist/src/availability/policyHelpers.test.d.ts +6 -0
- package/dist/src/availability/policyHelpers.test.js +182 -0
- package/dist/src/availability/policyHelpers.test.js.map +1 -0
- package/dist/src/availability/testUtils.d.ts +10 -0
- package/dist/src/availability/testUtils.js +22 -0
- package/dist/src/availability/testUtils.js.map +1 -0
- package/dist/src/code_assist/experiments/client_metadata.js +3 -2
- package/dist/src/code_assist/experiments/client_metadata.js.map +1 -1
- package/dist/src/code_assist/experiments/client_metadata.test.js +7 -10
- package/dist/src/code_assist/experiments/client_metadata.test.js.map +1 -1
- package/dist/src/code_assist/experiments/experiments.js +2 -2
- package/dist/src/code_assist/experiments/experiments.js.map +1 -1
- package/dist/src/code_assist/oauth2.d.ts +2 -0
- package/dist/src/code_assist/oauth2.js +73 -17
- package/dist/src/code_assist/oauth2.js.map +1 -1
- package/dist/src/code_assist/oauth2.test.js +195 -18
- package/dist/src/code_assist/oauth2.test.js.map +1 -1
- package/dist/src/code_assist/server.d.ts +10 -1
- package/dist/src/code_assist/server.js +81 -15
- package/dist/src/code_assist/server.js.map +1 -1
- package/dist/src/code_assist/server.test.js +221 -25
- package/dist/src/code_assist/server.test.js.map +1 -1
- package/dist/src/code_assist/setup.js +6 -4
- package/dist/src/code_assist/setup.js.map +1 -1
- package/dist/src/code_assist/setup.test.js +63 -0
- package/dist/src/code_assist/setup.test.js.map +1 -1
- package/dist/src/code_assist/telemetry.d.ts +14 -0
- package/dist/src/code_assist/telemetry.js +156 -0
- package/dist/src/code_assist/telemetry.js.map +1 -0
- package/dist/src/code_assist/telemetry.test.d.ts +6 -0
- package/dist/src/code_assist/telemetry.test.js +300 -0
- package/dist/src/code_assist/telemetry.test.js.map +1 -0
- package/dist/src/code_assist/types.d.ts +84 -1
- package/dist/src/code_assist/types.js +21 -0
- package/dist/src/code_assist/types.js.map +1 -1
- package/dist/src/commands/init.d.ts +7 -0
- package/dist/src/commands/init.js +53 -0
- package/dist/src/commands/init.js.map +1 -0
- package/dist/src/commands/init.test.d.ts +6 -0
- package/dist/src/commands/init.test.js +25 -0
- package/dist/src/commands/init.test.js.map +1 -0
- package/dist/src/commands/restore.d.ts +9 -0
- package/dist/src/commands/restore.js +46 -0
- package/dist/src/commands/restore.js.map +1 -0
- package/dist/src/commands/restore.test.d.ts +6 -0
- package/dist/src/commands/restore.test.js +137 -0
- package/dist/src/commands/restore.test.js.map +1 -0
- package/dist/src/commands/types.d.ts +41 -0
- package/dist/src/commands/types.js +7 -0
- package/dist/src/commands/types.js.map +1 -0
- package/dist/src/config/config.d.ts +120 -23
- package/dist/src/config/config.js +336 -116
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/config.test.js +373 -95
- package/dist/src/config/config.test.js.map +1 -1
- package/dist/src/config/defaultModelConfigs.js +46 -0
- package/dist/src/config/defaultModelConfigs.js.map +1 -1
- package/dist/src/config/flashFallback.test.js +11 -35
- package/dist/src/config/flashFallback.test.js.map +1 -1
- package/dist/src/config/models.d.ts +29 -15
- package/dist/src/config/models.js +78 -28
- package/dist/src/config/models.js.map +1 -1
- package/dist/src/config/models.test.js +91 -77
- package/dist/src/config/models.test.js.map +1 -1
- package/dist/src/config/storage.d.ts +4 -0
- package/dist/src/config/storage.js +12 -0
- package/dist/src/config/storage.js.map +1 -1
- package/dist/src/config/storage.test.js +16 -0
- package/dist/src/config/storage.test.js.map +1 -1
- package/dist/src/confirmation-bus/message-bus.d.ts +6 -0
- package/dist/src/confirmation-bus/message-bus.js +66 -3
- package/dist/src/confirmation-bus/message-bus.js.map +1 -1
- package/dist/src/confirmation-bus/types.d.ts +29 -2
- package/dist/src/confirmation-bus/types.js +3 -0
- package/dist/src/confirmation-bus/types.js.map +1 -1
- package/dist/src/core/baseLlmClient.d.ts +30 -2
- package/dist/src/core/baseLlmClient.js +107 -49
- package/dist/src/core/baseLlmClient.js.map +1 -1
- package/dist/src/core/baseLlmClient.test.js +271 -13
- package/dist/src/core/baseLlmClient.test.js.map +1 -1
- package/dist/src/core/client.d.ts +5 -1
- package/dist/src/core/client.js +241 -63
- package/dist/src/core/client.js.map +1 -1
- package/dist/src/core/client.test.js +462 -72
- package/dist/src/core/client.test.js.map +1 -1
- package/dist/src/core/clientHookTriggers.d.ts +36 -0
- package/dist/src/core/clientHookTriggers.js +76 -0
- package/dist/src/core/clientHookTriggers.js.map +1 -0
- package/dist/src/core/contentGenerator.js +17 -4
- package/dist/src/core/contentGenerator.js.map +1 -1
- package/dist/src/core/contentGenerator.test.js +132 -3
- package/dist/src/core/contentGenerator.test.js.map +1 -1
- package/dist/src/core/coreToolHookTriggers.d.ts +55 -0
- package/dist/src/core/coreToolHookTriggers.js +304 -0
- package/dist/src/core/coreToolHookTriggers.js.map +1 -0
- package/dist/src/core/coreToolHookTriggers.test.d.ts +6 -0
- package/dist/src/core/coreToolHookTriggers.test.js +191 -0
- package/dist/src/core/coreToolHookTriggers.test.js.map +1 -0
- package/dist/src/core/coreToolScheduler.d.ts +6 -85
- package/dist/src/core/coreToolScheduler.js +69 -267
- package/dist/src/core/coreToolScheduler.js.map +1 -1
- package/dist/src/core/coreToolScheduler.test.js +161 -346
- package/dist/src/core/coreToolScheduler.test.js.map +1 -1
- package/dist/src/core/geminiChat.js +132 -76
- package/dist/src/core/geminiChat.js.map +1 -1
- package/dist/src/core/geminiChat.test.js +240 -257
- package/dist/src/core/geminiChat.test.js.map +1 -1
- package/dist/src/core/geminiChatHookTriggers.d.ts +64 -0
- package/dist/src/core/geminiChatHookTriggers.js +136 -0
- package/dist/src/core/geminiChatHookTriggers.js.map +1 -0
- package/dist/src/core/geminiChat_network_retry.test.d.ts +6 -0
- package/dist/src/core/geminiChat_network_retry.test.js +196 -0
- package/dist/src/core/geminiChat_network_retry.test.js.map +1 -0
- package/dist/src/core/logger.js.map +1 -1
- package/dist/src/core/loggingContentGenerator.js +23 -6
- package/dist/src/core/loggingContentGenerator.js.map +1 -1
- package/dist/src/core/nonInteractiveToolExecutor.test.js +13 -8
- package/dist/src/core/nonInteractiveToolExecutor.test.js.map +1 -1
- package/dist/src/core/prompts.js +82 -26
- package/dist/src/core/prompts.js.map +1 -1
- package/dist/src/core/prompts.test.js +102 -3
- package/dist/src/core/prompts.test.js.map +1 -1
- package/dist/src/core/sessionHookTriggers.d.ts +29 -0
- package/dist/src/core/sessionHookTriggers.js +75 -0
- package/dist/src/core/sessionHookTriggers.js.map +1 -0
- package/dist/src/core/turn.d.ts +34 -21
- package/dist/src/core/turn.js +33 -13
- package/dist/src/core/turn.js.map +1 -1
- package/dist/src/core/turn.test.js +0 -5
- package/dist/src/core/turn.test.js.map +1 -1
- package/dist/src/fallback/handler.js +101 -93
- package/dist/src/fallback/handler.js.map +1 -1
- package/dist/src/fallback/handler.test.js +186 -173
- package/dist/src/fallback/handler.test.js.map +1 -1
- package/dist/src/fallback/types.d.ts +8 -0
- package/dist/src/generated/git-commit.d.ts +3 -3
- package/dist/src/generated/git-commit.js +3 -3
- package/dist/src/generated/git-commit.js.map +1 -1
- package/dist/src/hooks/hookAggregator.js +7 -0
- package/dist/src/hooks/hookAggregator.js.map +1 -1
- package/dist/src/hooks/hookEventHandler.d.ts +113 -0
- package/dist/src/hooks/hookEventHandler.js +571 -0
- package/dist/src/hooks/hookEventHandler.js.map +1 -0
- package/dist/src/hooks/hookEventHandler.test.d.ts +6 -0
- package/dist/src/hooks/hookEventHandler.test.js +461 -0
- package/dist/src/hooks/hookEventHandler.test.js.map +1 -0
- package/dist/src/hooks/hookPlanner.d.ts +1 -5
- package/dist/src/hooks/hookPlanner.js +2 -7
- package/dist/src/hooks/hookPlanner.js.map +1 -1
- package/dist/src/hooks/hookPlanner.test.js +62 -2
- package/dist/src/hooks/hookPlanner.test.js.map +1 -1
- package/dist/src/hooks/hookRegistry.d.ts +6 -18
- package/dist/src/hooks/hookRegistry.js +49 -35
- package/dist/src/hooks/hookRegistry.js.map +1 -1
- package/dist/src/hooks/hookRegistry.test.js +167 -8
- package/dist/src/hooks/hookRegistry.test.js.map +1 -1
- package/dist/src/hooks/hookRunner.d.ts +5 -3
- package/dist/src/hooks/hookRunner.js +74 -18
- package/dist/src/hooks/hookRunner.js.map +1 -1
- package/dist/src/hooks/hookRunner.test.js +174 -36
- package/dist/src/hooks/hookRunner.test.js.map +1 -1
- package/dist/src/hooks/hookSystem.d.ts +40 -0
- package/dist/src/hooks/hookSystem.js +65 -0
- package/dist/src/hooks/hookSystem.js.map +1 -0
- package/dist/src/hooks/hookSystem.test.d.ts +6 -0
- package/dist/src/hooks/hookSystem.test.js +319 -0
- package/dist/src/hooks/hookSystem.test.js.map +1 -0
- package/dist/src/hooks/index.d.ts +17 -0
- package/dist/src/hooks/index.js +18 -0
- package/dist/src/hooks/index.js.map +1 -0
- package/dist/src/hooks/trustedHooks.d.ts +28 -0
- package/dist/src/hooks/trustedHooks.js +90 -0
- package/dist/src/hooks/trustedHooks.js.map +1 -0
- package/dist/src/hooks/trustedHooks.test.d.ts +6 -0
- package/dist/src/hooks/trustedHooks.test.js +154 -0
- package/dist/src/hooks/trustedHooks.test.js.map +1 -0
- package/dist/src/hooks/types.d.ts +21 -11
- package/dist/src/hooks/types.js +31 -27
- package/dist/src/hooks/types.js.map +1 -1
- package/dist/src/hooks/types.test.js +5 -24
- package/dist/src/hooks/types.test.js.map +1 -1
- package/dist/src/ide/detect-ide.test.js +32 -1
- package/dist/src/ide/detect-ide.test.js.map +1 -1
- package/dist/src/ide/ide-client.js +9 -4
- package/dist/src/ide/ide-client.js.map +1 -1
- package/dist/src/ide/ide-client.test.js +17 -0
- package/dist/src/ide/ide-client.test.js.map +1 -1
- package/dist/src/ide/ide-installer.test.js +1 -1
- package/dist/src/ide/ide-installer.test.js.map +1 -1
- package/dist/src/ide/types.d.ts +4 -4
- package/dist/src/index.d.ts +17 -1
- package/dist/src/index.js +18 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/mcp/auth-provider.d.ts +16 -0
- package/dist/src/mcp/auth-provider.js +7 -0
- package/dist/src/mcp/auth-provider.js.map +1 -0
- package/dist/src/mcp/google-auth-provider.d.ts +10 -2
- package/dist/src/mcp/google-auth-provider.js +28 -0
- package/dist/src/mcp/google-auth-provider.js.map +1 -1
- package/dist/src/mcp/google-auth-provider.test.js +45 -0
- package/dist/src/mcp/google-auth-provider.test.js.map +1 -1
- package/dist/src/mcp/oauth-provider.js +6 -2
- package/dist/src/mcp/oauth-provider.js.map +1 -1
- package/dist/src/mcp/oauth-provider.test.js +4 -1
- package/dist/src/mcp/oauth-provider.test.js.map +1 -1
- package/dist/src/mcp/oauth-utils.d.ts +8 -1
- package/dist/src/mcp/oauth-utils.js +31 -2
- package/dist/src/mcp/oauth-utils.js.map +1 -1
- package/dist/src/mcp/oauth-utils.test.js +42 -0
- package/dist/src/mcp/oauth-utils.test.js.map +1 -1
- package/dist/src/mcp/sa-impersonation-provider.d.ts +2 -2
- package/dist/src/mcp/sa-impersonation-provider.js.map +1 -1
- package/dist/src/mcp/token-storage/hybrid-token-storage.js +1 -1
- package/dist/src/mcp/token-storage/hybrid-token-storage.js.map +1 -1
- package/dist/src/mcp/token-storage/keychain-token-storage.js +1 -1
- package/dist/src/mcp/token-storage/keychain-token-storage.js.map +1 -1
- package/dist/src/output/json-formatter.d.ts +2 -2
- package/dist/src/output/json-formatter.js +6 -3
- package/dist/src/output/json-formatter.js.map +1 -1
- package/dist/src/output/json-formatter.test.js +37 -9
- package/dist/src/output/json-formatter.test.js.map +1 -1
- package/dist/src/output/stream-json-formatter.js +6 -0
- package/dist/src/output/stream-json-formatter.js.map +1 -1
- package/dist/src/output/stream-json-formatter.test.js +98 -100
- package/dist/src/output/stream-json-formatter.test.js.map +1 -1
- package/dist/src/output/types.d.ts +3 -0
- package/dist/src/output/types.js.map +1 -1
- package/dist/src/policy/config.js +140 -15
- package/dist/src/policy/config.js.map +1 -1
- package/dist/src/policy/config.test.js +21 -0
- package/dist/src/policy/config.test.js.map +1 -1
- package/dist/src/policy/persistence.test.d.ts +6 -0
- package/dist/src/policy/persistence.test.js +154 -0
- package/dist/src/policy/persistence.test.js.map +1 -0
- package/dist/src/policy/policies/agent.toml +31 -0
- package/dist/src/policy/policies/read-only.toml +5 -0
- package/dist/src/policy/policies/write.toml +5 -0
- package/dist/src/policy/policies/yolo.toml +1 -0
- package/dist/src/policy/policy-engine.d.ts +30 -1
- package/dist/src/policy/policy-engine.js +192 -5
- package/dist/src/policy/policy-engine.js.map +1 -1
- package/dist/src/policy/policy-engine.test.js +520 -3
- package/dist/src/policy/policy-engine.test.js.map +1 -1
- package/dist/src/policy/policy-updater.test.d.ts +6 -0
- package/dist/src/policy/policy-updater.test.js +116 -0
- package/dist/src/policy/policy-updater.test.js.map +1 -0
- package/dist/src/policy/shell-safety.test.d.ts +6 -0
- package/dist/src/policy/shell-safety.test.js +75 -0
- package/dist/src/policy/shell-safety.test.js.map +1 -0
- package/dist/src/policy/toml-loader.d.ts +3 -5
- package/dist/src/policy/toml-loader.js +12 -60
- package/dist/src/policy/toml-loader.js.map +1 -1
- package/dist/src/policy/toml-loader.test.js +38 -7
- package/dist/src/policy/toml-loader.test.js.map +1 -1
- package/dist/src/policy/types.d.ts +72 -1
- package/dist/src/policy/types.js +21 -0
- package/dist/src/policy/types.js.map +1 -1
- package/dist/src/policy/utils.d.ts +21 -0
- package/dist/src/policy/utils.js +42 -0
- package/dist/src/policy/utils.js.map +1 -0
- package/dist/src/policy/utils.test.d.ts +6 -0
- package/dist/src/policy/utils.test.js +64 -0
- package/dist/src/policy/utils.test.js.map +1 -0
- package/dist/src/resources/resource-registry.d.ts +30 -0
- package/dist/src/resources/resource-registry.js +57 -0
- package/dist/src/resources/resource-registry.js.map +1 -0
- package/dist/src/resources/resource-registry.test.d.ts +6 -0
- package/dist/src/resources/resource-registry.test.js +54 -0
- package/dist/src/resources/resource-registry.test.js.map +1 -0
- package/dist/src/routing/modelRouterService.js +0 -15
- package/dist/src/routing/modelRouterService.js.map +1 -1
- package/dist/src/routing/modelRouterService.test.js +0 -62
- package/dist/src/routing/modelRouterService.test.js.map +1 -1
- package/dist/src/routing/strategies/classifierStrategy.js +10 -21
- package/dist/src/routing/strategies/classifierStrategy.js.map +1 -1
- package/dist/src/routing/strategies/classifierStrategy.test.js +2 -1
- package/dist/src/routing/strategies/classifierStrategy.test.js.map +1 -1
- package/dist/src/routing/strategies/compositeStrategy.js +4 -2
- package/dist/src/routing/strategies/compositeStrategy.js.map +1 -1
- package/dist/src/routing/strategies/compositeStrategy.test.js +11 -10
- package/dist/src/routing/strategies/compositeStrategy.test.js.map +1 -1
- package/dist/src/routing/strategies/fallbackStrategy.js +20 -12
- package/dist/src/routing/strategies/fallbackStrategy.js.map +1 -1
- package/dist/src/routing/strategies/fallbackStrategy.test.js +63 -39
- package/dist/src/routing/strategies/fallbackStrategy.test.js.map +1 -1
- package/dist/src/routing/strategies/overrideStrategy.js +3 -2
- package/dist/src/routing/strategies/overrideStrategy.js.map +1 -1
- package/dist/src/safety/checker-runner.js +17 -6
- package/dist/src/safety/checker-runner.js.map +1 -1
- package/dist/src/scheduler/tool-executor.d.ts +22 -0
- package/dist/src/scheduler/tool-executor.js +198 -0
- package/dist/src/scheduler/tool-executor.js.map +1 -0
- package/dist/src/scheduler/tool-executor.test.d.ts +6 -0
- package/dist/src/scheduler/tool-executor.test.js +231 -0
- package/dist/src/scheduler/tool-executor.test.js.map +1 -0
- package/dist/src/scheduler/types.d.ts +95 -0
- package/dist/src/scheduler/types.js +7 -0
- package/dist/src/scheduler/types.js.map +1 -0
- package/dist/src/services/chatCompressionService.d.ts +1 -0
- package/dist/src/services/chatCompressionService.js +38 -8
- package/dist/src/services/chatCompressionService.js.map +1 -1
- package/dist/src/services/chatCompressionService.test.js +35 -31
- package/dist/src/services/chatCompressionService.test.js.map +1 -1
- package/dist/src/services/chatRecordingService.d.ts +14 -0
- package/dist/src/services/chatRecordingService.js +37 -0
- package/dist/src/services/chatRecordingService.js.map +1 -1
- package/dist/src/services/contextManager.d.ts +29 -0
- package/dist/src/services/contextManager.js +71 -0
- package/dist/src/services/contextManager.js.map +1 -0
- package/dist/src/services/contextManager.test.d.ts +6 -0
- package/dist/src/services/contextManager.test.js +104 -0
- package/dist/src/services/contextManager.test.js.map +1 -0
- package/dist/src/services/environmentSanitization.d.ts +15 -0
- package/dist/src/services/environmentSanitization.js +141 -0
- package/dist/src/services/environmentSanitization.js.map +1 -0
- package/dist/src/services/environmentSanitization.test.d.ts +6 -0
- package/dist/src/services/environmentSanitization.test.js +284 -0
- package/dist/src/services/environmentSanitization.test.js.map +1 -0
- package/dist/src/services/fileSystemService.d.ts +0 -9
- package/dist/src/services/fileSystemService.js +0 -11
- package/dist/src/services/fileSystemService.js.map +1 -1
- package/dist/src/services/gitService.js +18 -2
- package/dist/src/services/gitService.js.map +1 -1
- package/dist/src/services/gitService.test.js +56 -0
- package/dist/src/services/gitService.test.js.map +1 -1
- package/dist/src/services/loopDetectionService.js +5 -4
- package/dist/src/services/loopDetectionService.js.map +1 -1
- package/dist/src/services/loopDetectionService.test.js +14 -8
- package/dist/src/services/loopDetectionService.test.js.map +1 -1
- package/dist/src/services/modelConfig.golden.test.js +32 -0
- package/dist/src/services/modelConfig.golden.test.js.map +1 -1
- package/dist/src/services/modelConfig.integration.test.js +1 -1
- package/dist/src/services/modelConfig.integration.test.js.map +1 -1
- package/dist/src/services/modelConfigService.d.ts +4 -0
- package/dist/src/services/modelConfigService.js +8 -3
- package/dist/src/services/modelConfigService.js.map +1 -1
- package/dist/src/services/modelConfigService.test.js +221 -0
- package/dist/src/services/modelConfigService.test.js.map +1 -1
- package/dist/src/services/modelConfigServiceTestUtils.d.ts +10 -0
- package/dist/src/services/modelConfigServiceTestUtils.js +17 -0
- package/dist/src/services/modelConfigServiceTestUtils.js.map +1 -0
- package/dist/src/services/sessionSummaryService.d.ts +28 -0
- package/dist/src/services/sessionSummaryService.js +131 -0
- package/dist/src/services/sessionSummaryService.js.map +1 -0
- package/dist/src/services/sessionSummaryService.test.d.ts +6 -0
- package/dist/src/services/sessionSummaryService.test.js +785 -0
- package/dist/src/services/sessionSummaryService.test.js.map +1 -0
- package/dist/src/services/sessionSummaryUtils.d.ts +16 -0
- package/dist/src/services/sessionSummaryUtils.js +129 -0
- package/dist/src/services/sessionSummaryUtils.js.map +1 -0
- package/dist/src/services/sessionSummaryUtils.test.d.ts +6 -0
- package/dist/src/services/sessionSummaryUtils.test.js +137 -0
- package/dist/src/services/sessionSummaryUtils.test.js.map +1 -0
- package/dist/src/services/shellExecutionService.d.ts +4 -0
- package/dist/src/services/shellExecutionService.js +45 -27
- package/dist/src/services/shellExecutionService.js.map +1 -1
- package/dist/src/services/shellExecutionService.test.js +240 -8
- package/dist/src/services/shellExecutionService.test.js.map +1 -1
- package/dist/src/services/test-data/resolved-aliases-retry.golden.json +238 -0
- package/dist/src/services/test-data/resolved-aliases.golden.json +36 -0
- package/dist/src/skills/skillLoader.d.ts +28 -0
- package/dist/src/skills/skillLoader.js +77 -0
- package/dist/src/skills/skillLoader.js.map +1 -0
- package/dist/src/skills/skillLoader.test.d.ts +1 -0
- package/dist/src/skills/skillLoader.test.js +2 -0
- package/dist/src/skills/skillLoader.test.js.map +1 -0
- package/dist/src/skills/skillManager.d.ts +51 -0
- package/dist/src/skills/skillManager.js +89 -0
- package/dist/src/skills/skillManager.js.map +1 -0
- package/dist/src/skills/skillManager.test.d.ts +6 -0
- package/dist/src/skills/skillManager.test.js +128 -0
- package/dist/src/skills/skillManager.test.js.map +1 -0
- package/dist/src/telemetry/activity-detector.test.js.map +1 -1
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.d.ts +11 -7
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js +127 -47
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js.map +1 -1
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js +105 -18
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js.map +1 -1
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.d.ts +9 -3
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js +20 -5
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js.map +1 -1
- package/dist/src/telemetry/config.js +2 -0
- package/dist/src/telemetry/config.js.map +1 -1
- package/dist/src/telemetry/config.test.js +25 -0
- package/dist/src/telemetry/config.test.js.map +1 -1
- package/dist/src/telemetry/gcp-exporters.d.ts +4 -3
- package/dist/src/telemetry/gcp-exporters.js +8 -4
- package/dist/src/telemetry/gcp-exporters.js.map +1 -1
- package/dist/src/telemetry/index.d.ts +2 -1
- package/dist/src/telemetry/index.js +2 -1
- package/dist/src/telemetry/index.js.map +1 -1
- package/dist/src/telemetry/loggers.d.ts +5 -3
- package/dist/src/telemetry/loggers.js +353 -334
- package/dist/src/telemetry/loggers.js.map +1 -1
- package/dist/src/telemetry/loggers.test.circular.js +1 -0
- package/dist/src/telemetry/loggers.test.circular.js.map +1 -1
- package/dist/src/telemetry/loggers.test.js +238 -31
- package/dist/src/telemetry/loggers.test.js.map +1 -1
- package/dist/src/telemetry/metrics.d.ts +22 -0
- package/dist/src/telemetry/metrics.js +32 -0
- package/dist/src/telemetry/metrics.js.map +1 -1
- package/dist/src/telemetry/metrics.test.js +64 -0
- package/dist/src/telemetry/metrics.test.js.map +1 -1
- package/dist/src/telemetry/sanitize.d.ts +25 -0
- package/dist/src/telemetry/sanitize.js +48 -0
- package/dist/src/telemetry/sanitize.js.map +1 -0
- package/dist/src/telemetry/sanitize.test.d.ts +6 -0
- package/dist/src/telemetry/sanitize.test.js +279 -0
- package/dist/src/telemetry/sanitize.test.js.map +1 -0
- package/dist/src/telemetry/sdk.d.ts +9 -2
- package/dist/src/telemetry/sdk.js +142 -17
- package/dist/src/telemetry/sdk.js.map +1 -1
- package/dist/src/telemetry/sdk.test.js +130 -28
- package/dist/src/telemetry/sdk.test.js.map +1 -1
- package/dist/src/telemetry/semantic.js +1 -1
- package/dist/src/telemetry/semantic.js.map +1 -1
- package/dist/src/telemetry/startupProfiler.d.ts +51 -0
- package/dist/src/telemetry/startupProfiler.js +170 -0
- package/dist/src/telemetry/startupProfiler.js.map +1 -0
- package/dist/src/telemetry/startupProfiler.test.d.ts +6 -0
- package/dist/src/telemetry/startupProfiler.test.js +285 -0
- package/dist/src/telemetry/startupProfiler.test.js.map +1 -0
- package/dist/src/telemetry/telemetry.test.js +10 -3
- package/dist/src/telemetry/telemetry.test.js.map +1 -1
- package/dist/src/telemetry/trace.js +2 -2
- package/dist/src/telemetry/trace.js.map +1 -1
- package/dist/src/telemetry/types.d.ts +62 -16
- package/dist/src/telemetry/types.js +157 -27
- package/dist/src/telemetry/types.js.map +1 -1
- package/dist/src/telemetry/uiTelemetry.d.ts +1 -0
- package/dist/src/telemetry/uiTelemetry.js +2 -0
- package/dist/src/telemetry/uiTelemetry.js.map +1 -1
- package/dist/src/telemetry/uiTelemetry.test.js +4 -0
- package/dist/src/telemetry/uiTelemetry.test.js.map +1 -1
- package/dist/src/test-utils/mock-message-bus.d.ts +61 -0
- package/dist/src/test-utils/mock-message-bus.js +160 -0
- package/dist/src/test-utils/mock-message-bus.js.map +1 -0
- package/dist/src/test-utils/mock-tool.d.ts +5 -3
- package/dist/src/test-utils/mock-tool.js +12 -11
- package/dist/src/test-utils/mock-tool.js.map +1 -1
- package/dist/src/tools/activate-skill.d.ts +27 -0
- package/dist/src/tools/activate-skill.js +120 -0
- package/dist/src/tools/activate-skill.js.map +1 -0
- package/dist/src/tools/activate-skill.test.d.ts +6 -0
- package/dist/src/tools/activate-skill.test.js +95 -0
- package/dist/src/tools/activate-skill.test.js.map +1 -0
- package/dist/src/tools/confirmation-policy.test.d.ts +6 -0
- package/dist/src/tools/confirmation-policy.test.js +142 -0
- package/dist/src/tools/confirmation-policy.test.js.map +1 -0
- package/dist/src/tools/edit.d.ts +27 -5
- package/dist/src/tools/edit.js +449 -137
- package/dist/src/tools/edit.js.map +1 -1
- package/dist/src/tools/edit.test.js +258 -526
- package/dist/src/tools/edit.test.js.map +1 -1
- package/dist/src/tools/get-internal-docs.d.ts +27 -0
- package/dist/src/tools/get-internal-docs.js +129 -0
- package/dist/src/tools/get-internal-docs.js.map +1 -0
- package/dist/src/tools/get-internal-docs.test.d.ts +6 -0
- package/dist/src/tools/get-internal-docs.test.js +57 -0
- package/dist/src/tools/get-internal-docs.test.js.map +1 -0
- package/dist/src/tools/glob.d.ts +2 -2
- package/dist/src/tools/glob.js +1 -1
- package/dist/src/tools/glob.js.map +1 -1
- package/dist/src/tools/glob.test.js +2 -1
- package/dist/src/tools/glob.test.js.map +1 -1
- package/dist/src/tools/grep.d.ts +2 -2
- package/dist/src/tools/grep.js +1 -1
- package/dist/src/tools/grep.js.map +1 -1
- package/dist/src/tools/grep.test.js +5 -4
- package/dist/src/tools/grep.test.js.map +1 -1
- package/dist/src/tools/ls.d.ts +2 -2
- package/dist/src/tools/ls.js +2 -2
- package/dist/src/tools/ls.js.map +1 -1
- package/dist/src/tools/ls.test.js +2 -1
- package/dist/src/tools/ls.test.js.map +1 -1
- package/dist/src/tools/mcp-client-manager.d.ts +3 -1
- package/dist/src/tools/mcp-client-manager.js +42 -9
- package/dist/src/tools/mcp-client-manager.js.map +1 -1
- package/dist/src/tools/mcp-client-manager.test.js +66 -10
- package/dist/src/tools/mcp-client-manager.test.js.map +1 -1
- package/dist/src/tools/mcp-client.d.ts +44 -6
- package/dist/src/tools/mcp-client.js +476 -176
- package/dist/src/tools/mcp-client.js.map +1 -1
- package/dist/src/tools/mcp-client.test.js +633 -36
- package/dist/src/tools/mcp-client.test.js.map +1 -1
- package/dist/src/tools/mcp-tool.d.ts +2 -2
- package/dist/src/tools/mcp-tool.js +20 -7
- package/dist/src/tools/mcp-tool.js.map +1 -1
- package/dist/src/tools/mcp-tool.test.js +35 -5
- package/dist/src/tools/mcp-tool.test.js.map +1 -1
- package/dist/src/tools/memoryTool.d.ts +3 -3
- package/dist/src/tools/memoryTool.js +3 -4
- package/dist/src/tools/memoryTool.js.map +1 -1
- package/dist/src/tools/memoryTool.test.js +5 -2
- package/dist/src/tools/memoryTool.test.js.map +1 -1
- package/dist/src/tools/message-bus-integration.test.js +10 -37
- package/dist/src/tools/message-bus-integration.test.js.map +1 -1
- package/dist/src/tools/modifiable-tool.js.map +1 -1
- package/dist/src/tools/modifiable-tool.test.js +22 -13
- package/dist/src/tools/modifiable-tool.test.js.map +1 -1
- package/dist/src/tools/read-file.d.ts +2 -2
- package/dist/src/tools/read-file.js +2 -2
- package/dist/src/tools/read-file.js.map +1 -1
- package/dist/src/tools/read-file.test.js +3 -2
- package/dist/src/tools/read-file.test.js.map +1 -1
- package/dist/src/tools/read-many-files.d.ts +2 -2
- package/dist/src/tools/read-many-files.js +7 -6
- package/dist/src/tools/read-many-files.js.map +1 -1
- package/dist/src/tools/read-many-files.test.js +4 -3
- package/dist/src/tools/read-many-files.test.js.map +1 -1
- package/dist/src/tools/ripGrep.d.ts +3 -2
- package/dist/src/tools/ripGrep.js +18 -7
- package/dist/src/tools/ripGrep.js.map +1 -1
- package/dist/src/tools/ripGrep.test.js +60 -4
- package/dist/src/tools/ripGrep.test.js.map +1 -1
- package/dist/src/tools/shell.d.ts +5 -7
- package/dist/src/tools/shell.js +77 -51
- package/dist/src/tools/shell.js.map +1 -1
- package/dist/src/tools/shell.test.js +59 -63
- package/dist/src/tools/shell.test.js.map +1 -1
- package/dist/src/tools/tool-error.d.ts +2 -1
- package/dist/src/tools/tool-error.js +2 -0
- package/dist/src/tools/tool-error.js.map +1 -1
- package/dist/src/tools/tool-names.d.ts +17 -0
- package/dist/src/tools/tool-names.js +59 -0
- package/dist/src/tools/tool-names.js.map +1 -1
- package/dist/src/tools/tool-names.test.d.ts +6 -0
- package/dist/src/tools/tool-names.test.js +43 -0
- package/dist/src/tools/tool-names.test.js.map +1 -0
- package/dist/src/tools/tool-registry.d.ts +11 -7
- package/dist/src/tools/tool-registry.js +15 -10
- package/dist/src/tools/tool-registry.js.map +1 -1
- package/dist/src/tools/tool-registry.test.js +16 -11
- package/dist/src/tools/tool-registry.test.js.map +1 -1
- package/dist/src/tools/tools.d.ts +25 -6
- package/dist/src/tools/tools.js +44 -25
- package/dist/src/tools/tools.js.map +1 -1
- package/dist/src/tools/tools.test.js +3 -1
- package/dist/src/tools/tools.test.js.map +1 -1
- package/dist/src/tools/web-fetch.d.ts +2 -2
- package/dist/src/tools/web-fetch.js +22 -9
- package/dist/src/tools/web-fetch.js.map +1 -1
- package/dist/src/tools/web-fetch.test.js +18 -19
- package/dist/src/tools/web-fetch.test.js.map +1 -1
- package/dist/src/tools/web-search.d.ts +2 -2
- package/dist/src/tools/web-search.js +5 -5
- package/dist/src/tools/web-search.js.map +1 -1
- package/dist/src/tools/web-search.test.js +2 -1
- package/dist/src/tools/web-search.test.js.map +1 -1
- package/dist/src/tools/write-file.d.ts +2 -2
- package/dist/src/tools/write-file.js +10 -4
- package/dist/src/tools/write-file.js.map +1 -1
- package/dist/src/tools/write-file.test.js +4 -1
- package/dist/src/tools/write-file.test.js.map +1 -1
- package/dist/src/tools/write-todos.d.ts +2 -2
- package/dist/src/tools/write-todos.js +5 -4
- package/dist/src/tools/write-todos.js.map +1 -1
- package/dist/src/tools/write-todos.test.js +2 -1
- package/dist/src/tools/write-todos.test.js.map +1 -1
- package/dist/src/utils/bfsFileSearch.d.ts +8 -0
- package/dist/src/utils/bfsFileSearch.js +63 -23
- package/dist/src/utils/bfsFileSearch.js.map +1 -1
- package/dist/src/utils/bfsFileSearch.test.js +65 -1
- package/dist/src/utils/bfsFileSearch.test.js.map +1 -1
- package/dist/src/utils/checkpointUtils.d.ts +82 -0
- package/dist/src/utils/checkpointUtils.js +117 -0
- package/dist/src/utils/checkpointUtils.js.map +1 -0
- package/dist/src/utils/checkpointUtils.test.d.ts +6 -0
- package/dist/src/utils/checkpointUtils.test.js +229 -0
- package/dist/src/utils/checkpointUtils.test.js.map +1 -0
- package/dist/src/utils/customHeaderUtils.d.ts +9 -0
- package/dist/src/utils/customHeaderUtils.js +34 -0
- package/dist/src/utils/customHeaderUtils.js.map +1 -0
- package/dist/src/utils/customHeaderUtils.test.d.ts +6 -0
- package/dist/src/utils/customHeaderUtils.test.js +77 -0
- package/dist/src/utils/customHeaderUtils.test.js.map +1 -0
- package/dist/src/utils/debugLogger.d.ts +3 -0
- package/dist/src/utils/debugLogger.js +28 -0
- package/dist/src/utils/debugLogger.js.map +1 -1
- package/dist/src/utils/editCorrector.js +6 -5
- package/dist/src/utils/editCorrector.js.map +1 -1
- package/dist/src/utils/editCorrector.test.js +7 -3
- package/dist/src/utils/editCorrector.test.js.map +1 -1
- package/dist/src/utils/editor.d.ts +9 -1
- package/dist/src/utils/editor.js +23 -14
- package/dist/src/utils/editor.js.map +1 -1
- package/dist/src/utils/environmentContext.d.ts +1 -0
- package/dist/src/utils/environmentContext.js +4 -0
- package/dist/src/utils/environmentContext.js.map +1 -1
- package/dist/src/utils/environmentContext.test.js +2 -0
- package/dist/src/utils/environmentContext.test.js.map +1 -1
- package/dist/src/utils/errorReporting.d.ts +1 -1
- package/dist/src/utils/errorReporting.js +13 -12
- package/dist/src/utils/errorReporting.js.map +1 -1
- package/dist/src/utils/errorReporting.test.js +17 -14
- package/dist/src/utils/errorReporting.test.js.map +1 -1
- package/dist/src/utils/errors.d.ts +8 -0
- package/dist/src/utils/errors.js +39 -2
- package/dist/src/utils/errors.js.map +1 -1
- package/dist/src/utils/errors.test.d.ts +6 -0
- package/dist/src/utils/errors.test.js +155 -0
- package/dist/src/utils/errors.test.js.map +1 -0
- package/dist/src/utils/events.d.ts +49 -19
- package/dist/src/utils/events.js +21 -9
- package/dist/src/utils/events.js.map +1 -1
- package/dist/src/utils/events.test.js +25 -0
- package/dist/src/utils/events.test.js.map +1 -1
- package/dist/src/utils/exitCodes.d.ts +12 -0
- package/dist/src/utils/exitCodes.js +13 -0
- package/dist/src/utils/exitCodes.js.map +1 -0
- package/dist/src/utils/extensionLoader.d.ts +2 -2
- package/dist/src/utils/extensionLoader.js +5 -6
- package/dist/src/utils/extensionLoader.js.map +1 -1
- package/dist/src/utils/extensionLoader.test.js +11 -0
- package/dist/src/utils/extensionLoader.test.js.map +1 -1
- package/dist/src/utils/fetch.d.ts +1 -1
- package/dist/src/utils/fetch.js +3 -3
- package/dist/src/utils/fetch.js.map +1 -1
- package/dist/src/utils/fileUtils.d.ts +4 -0
- package/dist/src/utils/fileUtils.js +53 -0
- package/dist/src/utils/fileUtils.js.map +1 -1
- package/dist/src/utils/fileUtils.test.js +127 -1
- package/dist/src/utils/fileUtils.test.js.map +1 -1
- package/dist/src/utils/filesearch/crawlCache.js.map +1 -1
- package/dist/src/utils/filesearch/fileSearch.js.map +1 -1
- package/dist/src/utils/flashFallback.test.js +1 -1
- package/dist/src/utils/flashFallback.test.js.map +1 -1
- package/dist/src/utils/geminiIgnoreParser.d.ts +11 -0
- package/dist/src/utils/geminiIgnoreParser.js +20 -0
- package/dist/src/utils/geminiIgnoreParser.js.map +1 -1
- package/dist/src/utils/geminiIgnoreParser.test.js +48 -0
- package/dist/src/utils/geminiIgnoreParser.test.js.map +1 -1
- package/dist/src/utils/generateContentResponseUtilities.d.ts +3 -1
- package/dist/src/utils/generateContentResponseUtilities.js +106 -0
- package/dist/src/utils/generateContentResponseUtilities.js.map +1 -1
- package/dist/src/utils/generateContentResponseUtilities.test.js +279 -2
- package/dist/src/utils/generateContentResponseUtilities.test.js.map +1 -1
- package/dist/src/utils/getFolderStructure.js +7 -2
- package/dist/src/utils/getFolderStructure.js.map +1 -1
- package/dist/src/utils/googleErrors.js +31 -18
- package/dist/src/utils/googleErrors.js.map +1 -1
- package/dist/src/utils/googleErrors.test.js +10 -2
- package/dist/src/utils/googleErrors.test.js.map +1 -1
- package/dist/src/utils/googleQuotaErrors.d.ts +3 -3
- package/dist/src/utils/googleQuotaErrors.js +32 -6
- package/dist/src/utils/googleQuotaErrors.js.map +1 -1
- package/dist/src/utils/googleQuotaErrors.test.js +94 -2
- package/dist/src/utils/googleQuotaErrors.test.js.map +1 -1
- package/dist/src/utils/memoryDiscovery.d.ts +5 -0
- package/dist/src/utils/memoryDiscovery.js +9 -5
- package/dist/src/utils/memoryDiscovery.js.map +1 -1
- package/dist/src/utils/memoryDiscovery.test.js +31 -1
- package/dist/src/utils/memoryDiscovery.test.js.map +1 -1
- package/dist/src/utils/nextSpeakerChecker.test.js +4 -0
- package/dist/src/utils/nextSpeakerChecker.test.js.map +1 -1
- package/dist/src/utils/package.d.ts +14 -0
- package/dist/src/utils/package.js +15 -2
- package/dist/src/utils/package.js.map +1 -1
- package/dist/src/utils/pathCorrector.js +12 -2
- package/dist/src/utils/pathCorrector.js.map +1 -1
- package/dist/src/utils/pathCorrector.test.js +6 -2
- package/dist/src/utils/pathCorrector.test.js.map +1 -1
- package/dist/src/utils/retry.d.ts +11 -0
- package/dist/src/utils/retry.js +62 -21
- package/dist/src/utils/retry.js.map +1 -1
- package/dist/src/utils/retry.test.js +170 -10
- package/dist/src/utils/retry.test.js.map +1 -1
- package/dist/src/utils/schemaValidator.d.ts +1 -1
- package/dist/src/utils/schemaValidator.js +1 -1
- package/dist/src/utils/shell-permissions.d.ts +52 -0
- package/dist/src/utils/shell-permissions.js +188 -0
- package/dist/src/utils/shell-permissions.js.map +1 -0
- package/dist/src/utils/shell-permissions.test.d.ts +6 -0
- package/dist/src/utils/shell-permissions.test.js +369 -0
- package/dist/src/utils/shell-permissions.test.js.map +1 -0
- package/dist/src/utils/shell-utils.d.ts +16 -47
- package/dist/src/utils/shell-utils.js +99 -195
- package/dist/src/utils/shell-utils.js.map +1 -1
- package/dist/src/utils/shell-utils.test.js +99 -288
- package/dist/src/utils/shell-utils.test.js.map +1 -1
- package/dist/src/utils/stdio.d.ts +2 -2
- package/dist/src/utils/stdio.js +2 -2
- package/dist/src/utils/stdio.js.map +1 -1
- package/dist/src/utils/stdio.test.js +5 -5
- package/dist/src/utils/stdio.test.js.map +1 -1
- package/dist/src/utils/summarizer.test.js +3 -2
- package/dist/src/utils/summarizer.test.js.map +1 -1
- package/dist/src/utils/terminal.d.ts +4 -0
- package/dist/src/utils/terminal.js +12 -0
- package/dist/src/utils/terminal.js.map +1 -1
- package/dist/src/utils/terminalSerializer.test.js +17 -0
- package/dist/src/utils/terminalSerializer.test.js.map +1 -1
- package/dist/src/utils/tokenCalculation.d.ts +19 -0
- package/dist/src/utils/tokenCalculation.js +85 -0
- package/dist/src/utils/tokenCalculation.js.map +1 -0
- package/dist/src/utils/tokenCalculation.test.d.ts +6 -0
- package/dist/src/utils/tokenCalculation.test.js +87 -0
- package/dist/src/utils/tokenCalculation.test.js.map +1 -0
- package/dist/src/utils/tool-utils.d.ts +9 -0
- package/dist/src/utils/tool-utils.js +29 -0
- package/dist/src/utils/tool-utils.js.map +1 -1
- package/dist/src/utils/tool-utils.test.js +17 -2
- package/dist/src/utils/tool-utils.test.js.map +1 -1
- package/dist/src/utils/version.d.ts +6 -0
- package/dist/src/utils/version.js +15 -0
- package/dist/src/utils/version.js.map +1 -0
- package/dist/src/utils/version.test.d.ts +6 -0
- package/dist/src/utils/version.test.js +39 -0
- package/dist/src/utils/version.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -7
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Gemini CLI core: Tools API
|
|
2
|
+
|
|
3
|
+
The Gemini CLI core (`packages/core`) features a robust system for defining,
|
|
4
|
+
registering, and executing tools. These tools extend the capabilities of the
|
|
5
|
+
Gemini model, allowing it to interact with the local environment, fetch web
|
|
6
|
+
content, and perform various actions beyond simple text generation.
|
|
7
|
+
|
|
8
|
+
## Core concepts
|
|
9
|
+
|
|
10
|
+
- **Tool (`tools.ts`):** An interface and base class (`BaseTool`) that defines
|
|
11
|
+
the contract for all tools. Each tool must have:
|
|
12
|
+
- `name`: A unique internal name (used in API calls to Gemini).
|
|
13
|
+
- `displayName`: A user-friendly name.
|
|
14
|
+
- `description`: A clear explanation of what the tool does, which is provided
|
|
15
|
+
to the Gemini model.
|
|
16
|
+
- `parameterSchema`: A JSON schema defining the parameters that the tool
|
|
17
|
+
accepts. This is crucial for the Gemini model to understand how to call the
|
|
18
|
+
tool correctly.
|
|
19
|
+
- `validateToolParams()`: A method to validate incoming parameters.
|
|
20
|
+
- `getDescription()`: A method to provide a human-readable description of what
|
|
21
|
+
the tool will do with specific parameters before execution.
|
|
22
|
+
- `shouldConfirmExecute()`: A method to determine if user confirmation is
|
|
23
|
+
required before execution (e.g., for potentially destructive operations).
|
|
24
|
+
- `execute()`: The core method that performs the tool's action and returns a
|
|
25
|
+
`ToolResult`.
|
|
26
|
+
|
|
27
|
+
- **`ToolResult` (`tools.ts`):** An interface defining the structure of a tool's
|
|
28
|
+
execution outcome:
|
|
29
|
+
- `llmContent`: The factual content to be included in the history sent back to
|
|
30
|
+
the LLM for context. This can be a simple string or a `PartListUnion` (an
|
|
31
|
+
array of `Part` objects and strings) for rich content.
|
|
32
|
+
- `returnDisplay`: A user-friendly string (often Markdown) or a special object
|
|
33
|
+
(like `FileDiff`) for display in the CLI.
|
|
34
|
+
|
|
35
|
+
- **Returning rich content:** Tools are not limited to returning simple text.
|
|
36
|
+
The `llmContent` can be a `PartListUnion`, which is an array that can contain
|
|
37
|
+
a mix of `Part` objects (for images, audio, etc.) and `string`s. This allows a
|
|
38
|
+
single tool execution to return multiple pieces of rich content.
|
|
39
|
+
|
|
40
|
+
- **Tool registry (`tool-registry.ts`):** A class (`ToolRegistry`) responsible
|
|
41
|
+
for:
|
|
42
|
+
- **Registering tools:** Holding a collection of all available built-in tools
|
|
43
|
+
(e.g., `ReadFileTool`, `ShellTool`).
|
|
44
|
+
- **Discovering tools:** It can also discover tools dynamically:
|
|
45
|
+
- **Command-based discovery:** If `tools.discoveryCommand` is configured in
|
|
46
|
+
settings, this command is executed. It's expected to output JSON
|
|
47
|
+
describing custom tools, which are then registered as `DiscoveredTool`
|
|
48
|
+
instances.
|
|
49
|
+
- **MCP-based discovery:** If `mcp.serverCommand` is configured, the
|
|
50
|
+
registry can connect to a Model Context Protocol (MCP) server to list and
|
|
51
|
+
register tools (`DiscoveredMCPTool`).
|
|
52
|
+
- **Providing schemas:** Exposing the `FunctionDeclaration` schemas of all
|
|
53
|
+
registered tools to the Gemini model, so it knows what tools are available
|
|
54
|
+
and how to use them.
|
|
55
|
+
- **Retrieving tools:** Allowing the core to get a specific tool by name for
|
|
56
|
+
execution.
|
|
57
|
+
|
|
58
|
+
## Built-in tools
|
|
59
|
+
|
|
60
|
+
The core comes with a suite of pre-defined tools, typically found in
|
|
61
|
+
`packages/core/src/tools/`. These include:
|
|
62
|
+
|
|
63
|
+
- **File system tools:**
|
|
64
|
+
- `LSTool` (`ls.ts`): Lists directory contents.
|
|
65
|
+
- `ReadFileTool` (`read-file.ts`): Reads the content of a single file.
|
|
66
|
+
- `WriteFileTool` (`write-file.ts`): Writes content to a file.
|
|
67
|
+
- `GrepTool` (`grep.ts`): Searches for patterns in files.
|
|
68
|
+
- `GlobTool` (`glob.ts`): Finds files matching glob patterns.
|
|
69
|
+
- `EditTool` (`edit.ts`): Performs in-place modifications to files (often
|
|
70
|
+
requiring confirmation).
|
|
71
|
+
- `ReadManyFilesTool` (`read-many-files.ts`): Reads and concatenates content
|
|
72
|
+
from multiple files or glob patterns (used by the `@` command in CLI).
|
|
73
|
+
- **Execution tools:**
|
|
74
|
+
- `ShellTool` (`shell.ts`): Executes arbitrary shell commands (requires
|
|
75
|
+
careful sandboxing and user confirmation).
|
|
76
|
+
- **Web tools:**
|
|
77
|
+
- `WebFetchTool` (`web-fetch.ts`): Fetches content from a URL.
|
|
78
|
+
- `WebSearchTool` (`web-search.ts`): Performs a web search.
|
|
79
|
+
- **Memory tools:**
|
|
80
|
+
- `MemoryTool` (`memoryTool.ts`): Interacts with the AI's memory.
|
|
81
|
+
|
|
82
|
+
Each of these tools extends `BaseTool` and implements the required methods for
|
|
83
|
+
its specific functionality.
|
|
84
|
+
|
|
85
|
+
## Tool execution flow
|
|
86
|
+
|
|
87
|
+
1. **Model request:** The Gemini model, based on the user's prompt and the
|
|
88
|
+
provided tool schemas, decides to use a tool and returns a `FunctionCall`
|
|
89
|
+
part in its response, specifying the tool name and arguments.
|
|
90
|
+
2. **Core receives request:** The core parses this `FunctionCall`.
|
|
91
|
+
3. **Tool retrieval:** It looks up the requested tool in the `ToolRegistry`.
|
|
92
|
+
4. **Parameter validation:** The tool's `validateToolParams()` method is
|
|
93
|
+
called.
|
|
94
|
+
5. **Confirmation (if needed):**
|
|
95
|
+
- The tool's `shouldConfirmExecute()` method is called.
|
|
96
|
+
- If it returns details for confirmation, the core communicates this back to
|
|
97
|
+
the CLI, which prompts the user.
|
|
98
|
+
- The user's decision (e.g., proceed, cancel) is sent back to the core.
|
|
99
|
+
6. **Execution:** If validated and confirmed (or if no confirmation is needed),
|
|
100
|
+
the core calls the tool's `execute()` method with the provided arguments and
|
|
101
|
+
an `AbortSignal` (for potential cancellation).
|
|
102
|
+
7. **Result processing:** The `ToolResult` from `execute()` is received by the
|
|
103
|
+
core.
|
|
104
|
+
8. **Response to model:** The `llmContent` from the `ToolResult` is packaged as
|
|
105
|
+
a `FunctionResponse` and sent back to the Gemini model so it can continue
|
|
106
|
+
generating a user-facing response.
|
|
107
|
+
9. **Display to user:** The `returnDisplay` from the `ToolResult` is sent to
|
|
108
|
+
the CLI to show the user what the tool did.
|
|
109
|
+
|
|
110
|
+
## Extending with custom tools
|
|
111
|
+
|
|
112
|
+
While direct programmatic registration of new tools by users isn't explicitly
|
|
113
|
+
detailed as a primary workflow in the provided files for typical end-users, the
|
|
114
|
+
architecture supports extension through:
|
|
115
|
+
|
|
116
|
+
- **Command-based discovery:** Advanced users or project administrators can
|
|
117
|
+
define a `tools.discoveryCommand` in `settings.json`. This command, when run
|
|
118
|
+
by the Gemini CLI core, should output a JSON array of `FunctionDeclaration`
|
|
119
|
+
objects. The core will then make these available as `DiscoveredTool`
|
|
120
|
+
instances. The corresponding `tools.callCommand` would then be responsible for
|
|
121
|
+
actually executing these custom tools.
|
|
122
|
+
- **MCP server(s):** For more complex scenarios, one or more MCP servers can be
|
|
123
|
+
set up and configured via the `mcpServers` setting in `settings.json`. The
|
|
124
|
+
Gemini CLI core can then discover and use tools exposed by these servers. As
|
|
125
|
+
mentioned, if you have multiple MCP servers, the tool names will be prefixed
|
|
126
|
+
with the server name from your configuration (e.g.,
|
|
127
|
+
`serverAlias__actualToolName`).
|
|
128
|
+
|
|
129
|
+
This tool system provides a flexible and powerful way to augment the Gemini
|
|
130
|
+
model's capabilities, making the Gemini CLI a versatile assistant for a wide
|
|
131
|
+
range of tasks.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Example proxy script
|
|
2
|
+
|
|
3
|
+
The following is an example of a proxy script that can be used with the
|
|
4
|
+
`GEMINI_SANDBOX_PROXY_COMMAND` environment variable. This script only allows
|
|
5
|
+
`HTTPS` connections to `example.com:443` and declines all other requests.
|
|
6
|
+
|
|
7
|
+
```javascript
|
|
8
|
+
#!/usr/bin/env node
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @license
|
|
12
|
+
* Copyright 2025 Google LLC
|
|
13
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
// Example proxy server that listens on :::8877 and only allows HTTPS connections to example.com.
|
|
17
|
+
// Set `GEMINI_SANDBOX_PROXY_COMMAND=scripts/example-proxy.js` to run proxy alongside sandbox
|
|
18
|
+
// Test via `curl https://example.com` inside sandbox (in shell mode or via shell tool)
|
|
19
|
+
|
|
20
|
+
import http from 'node:http';
|
|
21
|
+
import net from 'node:net';
|
|
22
|
+
import { URL } from 'node:url';
|
|
23
|
+
import console from 'node:console';
|
|
24
|
+
|
|
25
|
+
const PROXY_PORT = 8877;
|
|
26
|
+
const ALLOWED_DOMAINS = ['example.com', 'googleapis.com'];
|
|
27
|
+
const ALLOWED_PORT = '443';
|
|
28
|
+
|
|
29
|
+
const server = http.createServer((req, res) => {
|
|
30
|
+
// Deny all requests other than CONNECT for HTTPS
|
|
31
|
+
console.log(
|
|
32
|
+
`[PROXY] Denying non-CONNECT request for: ${req.method} ${req.url}`,
|
|
33
|
+
);
|
|
34
|
+
res.writeHead(405, { 'Content-Type': 'text/plain' });
|
|
35
|
+
res.end('Method Not Allowed');
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
server.on('connect', (req, clientSocket, head) => {
|
|
39
|
+
// req.url will be in the format "hostname:port" for a CONNECT request.
|
|
40
|
+
const { port, hostname } = new URL(`http://${req.url}`);
|
|
41
|
+
|
|
42
|
+
console.log(`[PROXY] Intercepted CONNECT request for: ${hostname}:${port}`);
|
|
43
|
+
|
|
44
|
+
if (
|
|
45
|
+
ALLOWED_DOMAINS.some(
|
|
46
|
+
(domain) => hostname == domain || hostname.endsWith(`.${domain}`),
|
|
47
|
+
) &&
|
|
48
|
+
port === ALLOWED_PORT
|
|
49
|
+
) {
|
|
50
|
+
console.log(`[PROXY] Allowing connection to ${hostname}:${port}`);
|
|
51
|
+
|
|
52
|
+
// Establish a TCP connection to the original destination.
|
|
53
|
+
const serverSocket = net.connect(port, hostname, () => {
|
|
54
|
+
clientSocket.write('HTTP/1.1 200 Connection Established\r\n\r\n');
|
|
55
|
+
// Create a tunnel by piping data between the client and the destination server.
|
|
56
|
+
serverSocket.write(head);
|
|
57
|
+
serverSocket.pipe(clientSocket);
|
|
58
|
+
clientSocket.pipe(serverSocket);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
serverSocket.on('error', (err) => {
|
|
62
|
+
console.error(`[PROXY] Error connecting to destination: ${err.message}`);
|
|
63
|
+
clientSocket.end(`HTTP/1.1 502 Bad Gateway\r\n\r\n`);
|
|
64
|
+
});
|
|
65
|
+
} else {
|
|
66
|
+
console.log(`[PROXY] Denying connection to ${hostname}:${port}`);
|
|
67
|
+
clientSocket.end('HTTP/1.1 403 Forbidden\r\n\r\n');
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
clientSocket.on('error', (err) => {
|
|
71
|
+
// This can happen if the client hangs up.
|
|
72
|
+
console.error(`[PROXY] Client socket error: ${err.message}`);
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
server.listen(PROXY_PORT, () => {
|
|
77
|
+
const address = server.address();
|
|
78
|
+
console.log(`[PROXY] Proxy listening on ${address.address}:${address.port}`);
|
|
79
|
+
console.log(
|
|
80
|
+
`[PROXY] Allowing HTTPS connections to domains: ${ALLOWED_DOMAINS.join(', ')}`,
|
|
81
|
+
);
|
|
82
|
+
});
|
|
83
|
+
```
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# Gemini CLI Extensions
|
|
2
|
+
|
|
3
|
+
_This documentation is up-to-date with the v0.4.0 release._
|
|
4
|
+
|
|
5
|
+
Gemini CLI extensions package prompts, MCP servers, and custom commands into a familiar and user-friendly format. With extensions, you can expand the capabilities of Gemini CLI and share those capabilities with others. They are designed to be easily installable and shareable.
|
|
6
|
+
|
|
7
|
+
## Extension management
|
|
8
|
+
|
|
9
|
+
We offer a suite of extension management tools using `gemini extensions` commands.
|
|
10
|
+
|
|
11
|
+
Note that these commands are not supported from within the CLI, although you can list installed extensions using the `/extensions list` subcommand.
|
|
12
|
+
|
|
13
|
+
Note that all of these commands will only be reflected in active CLI sessions on restart.
|
|
14
|
+
|
|
15
|
+
### Installing an extension
|
|
16
|
+
|
|
17
|
+
You can install an extension using `gemini extensions install` with either a GitHub URL or a local path`.
|
|
18
|
+
|
|
19
|
+
Note that we create a copy of the installed extension, so you will need to run `gemini extensions update` to pull in changes from both locally-defined extensions and those on GitHub.
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
gemini extensions install https://github.com/gemini-cli-extensions/security
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
This will install the Gemini CLI Security extension, which offers support for a `/security:analyze` command.
|
|
26
|
+
|
|
27
|
+
### Uninstalling an extension
|
|
28
|
+
|
|
29
|
+
To uninstall, run `gemini extensions uninstall extension-name`, so, in the case of the install example:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
gemini extensions uninstall gemini-cli-security
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Disabling an extension
|
|
36
|
+
|
|
37
|
+
Extensions are, by default, enabled across all workspaces. You can disable an extension entirely or for specific workspace.
|
|
38
|
+
|
|
39
|
+
For example, `gemini extensions disable extension-name` will disable the extension at the user level, so it will be disabled everywhere. `gemini extensions disable extension-name --scope=workspace` will only disable the extension in the current workspace.
|
|
40
|
+
|
|
41
|
+
### Enabling an extension
|
|
42
|
+
|
|
43
|
+
You can enable extensions using `gemini extensions enable extension-name`. You can also enable an extension for a specific workspace using `gemini extensions enable extension-name --scope=workspace` from within that workspace.
|
|
44
|
+
|
|
45
|
+
This is useful if you have an extension disabled at the top-level and only enabled in specific places.
|
|
46
|
+
|
|
47
|
+
### Updating an extension
|
|
48
|
+
|
|
49
|
+
For extensions installed from a local path or a git repository, you can explicitly update to the latest version (as reflected in the `gemini-extension.json` `version` field) with `gemini extensions update extension-name`.
|
|
50
|
+
|
|
51
|
+
You can update all extensions with:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
gemini extensions update --all
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Extension creation
|
|
58
|
+
|
|
59
|
+
We offer commands to make extension development easier.
|
|
60
|
+
|
|
61
|
+
### Create a boilerplate extension
|
|
62
|
+
|
|
63
|
+
We offer several example extensions `context`, `custom-commands`, `exclude-tools` and `mcp-server`. You can view these examples [here](https://github.com/google-gemini/gemini-cli/tree/main/packages/cli/src/commands/extensions/examples).
|
|
64
|
+
|
|
65
|
+
To copy one of these examples into a development directory using the type of your choosing, run:
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
gemini extensions new path/to/directory custom-commands
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Link a local extension
|
|
72
|
+
|
|
73
|
+
The `gemini extensions link` command will create a symbolic link from the extension installation directory to the development path.
|
|
74
|
+
|
|
75
|
+
This is useful so you don't have to run `gemini extensions update` every time you make changes you'd like to test.
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
gemini extensions link path/to/directory
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## How it works
|
|
82
|
+
|
|
83
|
+
On startup, Gemini CLI looks for extensions in `<home>/.gemini/extensions`
|
|
84
|
+
|
|
85
|
+
Extensions exist as a directory that contains a `gemini-extension.json` file. For example:
|
|
86
|
+
|
|
87
|
+
`<home>/.gemini/extensions/my-extension/gemini-extension.json`
|
|
88
|
+
|
|
89
|
+
### `gemini-extension.json`
|
|
90
|
+
|
|
91
|
+
The `gemini-extension.json` file contains the configuration for the extension. The file has the following structure:
|
|
92
|
+
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"name": "my-extension",
|
|
96
|
+
"version": "1.0.0",
|
|
97
|
+
"mcpServers": {
|
|
98
|
+
"my-server": {
|
|
99
|
+
"command": "node my-server.js"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"contextFileName": "GEMINI.md",
|
|
103
|
+
"excludeTools": ["run_shell_command"]
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
- `name`: The name of the extension. This is used to uniquely identify the extension and for conflict resolution when extension commands have the same name as user or project commands. The name should be lowercase or numbers and use dashes instead of underscores or spaces. This is how users will refer to your extension in the CLI. Note that we expect this name to match the extension directory name.
|
|
108
|
+
- `version`: The version of the extension.
|
|
109
|
+
- `mcpServers`: A map of MCP servers to configure. The key is the name of the server, and the value is the server configuration. These servers will be loaded on startup just like MCP servers configured in a [`settings.json` file](./cli/configuration.md). If both an extension and a `settings.json` file configure an MCP server with the same name, the server defined in the `settings.json` file takes precedence.
|
|
110
|
+
- Note that all MCP server configuration options are supported except for `trust`.
|
|
111
|
+
- `contextFileName`: The name of the file that contains the context for the extension. This will be used to load the context from the extension directory. If this property is not used but a `GEMINI.md` file is present in your extension directory, then that file will be loaded.
|
|
112
|
+
- `excludeTools`: An array of tool names to exclude from the model. You can also specify command-specific restrictions for tools that support it, like the `run_shell_command` tool. For example, `"excludeTools": ["run_shell_command(rm -rf)"]` will block the `rm -rf` command. Note that this differs from the MCP server `excludeTools` functionality, which can be listed in the MCP server config.
|
|
113
|
+
|
|
114
|
+
When Gemini CLI starts, it loads all the extensions and merges their configurations. If there are any conflicts, the workspace configuration takes precedence.
|
|
115
|
+
|
|
116
|
+
### Custom commands
|
|
117
|
+
|
|
118
|
+
Extensions can provide [custom commands](./cli/commands.md#custom-commands) by placing TOML files in a `commands/` subdirectory within the extension directory. These commands follow the same format as user and project custom commands and use standard naming conventions.
|
|
119
|
+
|
|
120
|
+
**Example**
|
|
121
|
+
|
|
122
|
+
An extension named `gcp` with the following structure:
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
.gemini/extensions/gcp/
|
|
126
|
+
├── gemini-extension.json
|
|
127
|
+
└── commands/
|
|
128
|
+
├── deploy.toml
|
|
129
|
+
└── gcs/
|
|
130
|
+
└── sync.toml
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Would provide these commands:
|
|
134
|
+
|
|
135
|
+
- `/deploy` - Shows as `[gcp] Custom command from deploy.toml` in help
|
|
136
|
+
- `/gcs:sync` - Shows as `[gcp] Custom command from sync.toml` in help
|
|
137
|
+
|
|
138
|
+
### Conflict resolution
|
|
139
|
+
|
|
140
|
+
Extension commands have the lowest precedence. When a conflict occurs with user or project commands:
|
|
141
|
+
|
|
142
|
+
1. **No conflict**: Extension command uses its natural name (e.g., `/deploy`)
|
|
143
|
+
2. **With conflict**: Extension command is renamed with the extension prefix (e.g., `/gcp.deploy`)
|
|
144
|
+
|
|
145
|
+
For example, if both a user and the `gcp` extension define a `deploy` command:
|
|
146
|
+
|
|
147
|
+
- `/deploy` - Executes the user's deploy command
|
|
148
|
+
- `/gcp.deploy` - Executes the extension's deploy command (marked with `[gcp]` tag)
|
|
149
|
+
|
|
150
|
+
## Variables
|
|
151
|
+
|
|
152
|
+
Gemini CLI extensions allow variable substitution in `gemini-extension.json`. This can be useful if e.g., you need the current directory to run an MCP server using `"cwd": "${extensionPath}${/}run.ts"`.
|
|
153
|
+
|
|
154
|
+
**Supported variables:**
|
|
155
|
+
|
|
156
|
+
| variable | description |
|
|
157
|
+
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
158
|
+
| `${extensionPath}` | The fully-qualified path of the extension in the user's filesystem e.g., '/Users/username/.gemini/extensions/example-extension'. This will not unwrap symlinks. |
|
|
159
|
+
| `${workspacePath}` | The fully-qualified path of the current workspace. |
|
|
160
|
+
| `${/} or ${pathSeparator}` | The path separator (differs per OS). |
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# Extension releasing
|
|
2
|
+
|
|
3
|
+
There are two primary ways of releasing extensions to users:
|
|
4
|
+
|
|
5
|
+
- [Git repository](#releasing-through-a-git-repository)
|
|
6
|
+
- [Github Releases](#releasing-through-github-releases)
|
|
7
|
+
|
|
8
|
+
Git repository releases tend to be the simplest and most flexible approach,
|
|
9
|
+
while GitHub releases can be more efficient on initial install as they are
|
|
10
|
+
shipped as single archives instead of requiring a git clone which downloads each
|
|
11
|
+
file individually. Github releases may also contain platform specific archives
|
|
12
|
+
if you need to ship platform specific binary files.
|
|
13
|
+
|
|
14
|
+
## Releasing through a git repository
|
|
15
|
+
|
|
16
|
+
This is the most flexible and simple option. All you need to do is create a
|
|
17
|
+
publicly accessible git repo (such as a public github repository) and then users
|
|
18
|
+
can install your extension using `gemini extensions install <your-repo-uri>`.
|
|
19
|
+
They can optionally depend on a specific ref (branch/tag/commit) using the
|
|
20
|
+
`--ref=<some-ref>` argument, this defaults to the default branch.
|
|
21
|
+
|
|
22
|
+
Whenever commits are pushed to the ref that a user depends on, they will be
|
|
23
|
+
prompted to update the extension. Note that this also allows for easy rollbacks,
|
|
24
|
+
the HEAD commit is always treated as the latest version regardless of the actual
|
|
25
|
+
version in the `gemini-extension.json` file.
|
|
26
|
+
|
|
27
|
+
### Managing release channels using a git repository
|
|
28
|
+
|
|
29
|
+
Users can depend on any ref from your git repo, such as a branch or tag, which
|
|
30
|
+
allows you to manage multiple release channels.
|
|
31
|
+
|
|
32
|
+
For instance, you can maintain a `stable` branch, which users can install this
|
|
33
|
+
way `gemini extensions install <your-repo-uri> --ref=stable`. Or, you could make
|
|
34
|
+
this the default by treating your default branch as your stable release branch,
|
|
35
|
+
and doing development in a different branch (for instance called `dev`). You can
|
|
36
|
+
maintain as many branches or tags as you like, providing maximum flexibility for
|
|
37
|
+
you and your users.
|
|
38
|
+
|
|
39
|
+
Note that these `ref` arguments can be tags, branches, or even specific commits,
|
|
40
|
+
which allows users to depend on a specific version of your extension. It is up
|
|
41
|
+
to you how you want to manage your tags and branches.
|
|
42
|
+
|
|
43
|
+
### Example releasing flow using a git repo
|
|
44
|
+
|
|
45
|
+
While there are many options for how you want to manage releases using a git
|
|
46
|
+
flow, we recommend treating your default branch as your "stable" release branch.
|
|
47
|
+
This means that the default behavior for
|
|
48
|
+
`gemini extensions install <your-repo-uri>` is to be on the stable release
|
|
49
|
+
branch.
|
|
50
|
+
|
|
51
|
+
Lets say you want to maintain three standard release channels, `stable`,
|
|
52
|
+
`preview`, and `dev`. You would do all your standard development in the `dev`
|
|
53
|
+
branch. When you are ready to do a preview release, you merge that branch into
|
|
54
|
+
your `preview` branch. When you are ready to promote your preview branch to
|
|
55
|
+
stable, you merge `preview` into your stable branch (which might be your default
|
|
56
|
+
branch or a different branch).
|
|
57
|
+
|
|
58
|
+
You can also cherry pick changes from one branch into another using
|
|
59
|
+
`git cherry-pick`, but do note that this will result in your branches having a
|
|
60
|
+
slightly divergent history from each other, unless you force push changes to
|
|
61
|
+
your branches on each release to restore the history to a clean slate (which may
|
|
62
|
+
not be possible for the default branch depending on your repository settings).
|
|
63
|
+
If you plan on doing cherry picks, you may want to avoid having your default
|
|
64
|
+
branch be the stable branch to avoid force-pushing to the default branch which
|
|
65
|
+
should generally be avoided.
|
|
66
|
+
|
|
67
|
+
## Releasing through GitHub releases
|
|
68
|
+
|
|
69
|
+
Gemini CLI extensions can be distributed through
|
|
70
|
+
[GitHub Releases](https://docs.github.com/en/repositories/releasing-projects-on-github/about-releases).
|
|
71
|
+
This provides a faster and more reliable initial installation experience for
|
|
72
|
+
users, as it avoids the need to clone the repository.
|
|
73
|
+
|
|
74
|
+
Each release includes at least one archive file, which contains the full
|
|
75
|
+
contents of the repo at the tag that it was linked to. Releases may also include
|
|
76
|
+
[pre-built archives](#custom-pre-built-archives) if your extension requires some
|
|
77
|
+
build step or has platform specific binaries attached to it.
|
|
78
|
+
|
|
79
|
+
When checking for updates, gemini will just look for the "latest" release on
|
|
80
|
+
github (you must mark it as such when creating the release), unless the user
|
|
81
|
+
installed a specific release by passing `--ref=<some-release-tag>`.
|
|
82
|
+
|
|
83
|
+
You may also install extensions with the `--pre-release` flag in order to get
|
|
84
|
+
the latest release regardless of whether it has been marked as "latest". This
|
|
85
|
+
allows you to test that your release works before actually pushing it to all
|
|
86
|
+
users.
|
|
87
|
+
|
|
88
|
+
### Custom pre-built archives
|
|
89
|
+
|
|
90
|
+
Custom archives must be attached directly to the github release as assets and
|
|
91
|
+
must be fully self-contained. This means they should include the entire
|
|
92
|
+
extension, see [archive structure](#archive-structure).
|
|
93
|
+
|
|
94
|
+
If your extension is platform-independent, you can provide a single generic
|
|
95
|
+
asset. In this case, there should be only one asset attached to the release.
|
|
96
|
+
|
|
97
|
+
Custom archives may also be used if you want to develop your extension within a
|
|
98
|
+
larger repository, you can build an archive which has a different layout from
|
|
99
|
+
the repo itself (for instance it might just be an archive of a subdirectory
|
|
100
|
+
containing the extension).
|
|
101
|
+
|
|
102
|
+
#### Platform specific archives
|
|
103
|
+
|
|
104
|
+
To ensure Gemini CLI can automatically find the correct release asset for each
|
|
105
|
+
platform, you must follow this naming convention. The CLI will search for assets
|
|
106
|
+
in the following order:
|
|
107
|
+
|
|
108
|
+
1. **Platform and architecture-Specific:**
|
|
109
|
+
`{platform}.{arch}.{name}.{extension}`
|
|
110
|
+
2. **Platform-specific:** `{platform}.{name}.{extension}`
|
|
111
|
+
3. **Generic:** If only one asset is provided, it will be used as a generic
|
|
112
|
+
fallback.
|
|
113
|
+
|
|
114
|
+
- `{name}`: The name of your extension.
|
|
115
|
+
- `{platform}`: The operating system. Supported values are:
|
|
116
|
+
- `darwin` (macOS)
|
|
117
|
+
- `linux`
|
|
118
|
+
- `win32` (Windows)
|
|
119
|
+
- `{arch}`: The architecture. Supported values are:
|
|
120
|
+
- `x64`
|
|
121
|
+
- `arm64`
|
|
122
|
+
- `{extension}`: The file extension of the archive (e.g., `.tar.gz` or `.zip`).
|
|
123
|
+
|
|
124
|
+
**Examples:**
|
|
125
|
+
|
|
126
|
+
- `darwin.arm64.my-tool.tar.gz` (specific to Apple Silicon Macs)
|
|
127
|
+
- `darwin.my-tool.tar.gz` (for all Macs)
|
|
128
|
+
- `linux.x64.my-tool.tar.gz`
|
|
129
|
+
- `win32.my-tool.zip`
|
|
130
|
+
|
|
131
|
+
#### Archive structure
|
|
132
|
+
|
|
133
|
+
Archives must be fully contained extensions and have all the standard
|
|
134
|
+
requirements - specifically the `gemini-extension.json` file must be at the root
|
|
135
|
+
of the archive.
|
|
136
|
+
|
|
137
|
+
The rest of the layout should look exactly the same as a typical extension, see
|
|
138
|
+
[extensions.md](./index.md).
|
|
139
|
+
|
|
140
|
+
#### Example GitHub Actions workflow
|
|
141
|
+
|
|
142
|
+
Here is an example of a GitHub Actions workflow that builds and releases a
|
|
143
|
+
Gemini CLI extension for multiple platforms:
|
|
144
|
+
|
|
145
|
+
```yaml
|
|
146
|
+
name: Release Extension
|
|
147
|
+
|
|
148
|
+
on:
|
|
149
|
+
push:
|
|
150
|
+
tags:
|
|
151
|
+
- 'v*'
|
|
152
|
+
|
|
153
|
+
jobs:
|
|
154
|
+
release:
|
|
155
|
+
runs-on: ubuntu-latest
|
|
156
|
+
steps:
|
|
157
|
+
- uses: actions/checkout@v3
|
|
158
|
+
|
|
159
|
+
- name: Set up Node.js
|
|
160
|
+
uses: actions/setup-node@v3
|
|
161
|
+
with:
|
|
162
|
+
node-version: '20'
|
|
163
|
+
|
|
164
|
+
- name: Install dependencies
|
|
165
|
+
run: npm ci
|
|
166
|
+
|
|
167
|
+
- name: Build extension
|
|
168
|
+
run: npm run build
|
|
169
|
+
|
|
170
|
+
- name: Create release assets
|
|
171
|
+
run: |
|
|
172
|
+
npm run package -- --platform=darwin --arch=arm64
|
|
173
|
+
npm run package -- --platform=linux --arch=x64
|
|
174
|
+
npm run package -- --platform=win32 --arch=x64
|
|
175
|
+
|
|
176
|
+
- name: Create GitHub Release
|
|
177
|
+
uses: softprops/action-gh-release@v1
|
|
178
|
+
with:
|
|
179
|
+
files: |
|
|
180
|
+
release/darwin.arm64.my-tool.tar.gz
|
|
181
|
+
release/linux.arm64.my-tool.tar.gz
|
|
182
|
+
release/win32.arm64.my-tool.zip
|
|
183
|
+
```
|