@anthropic-field/core 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.last_build +0 -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/monitoring-dashboard-logs.png +0 -0
- package/dist/docs/assets/monitoring-dashboard-metrics.png +0 -0
- package/dist/docs/assets/monitoring-dashboard-overview.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 +743 -0
- package/dist/docs/changelogs/latest.md +338 -0
- package/dist/docs/changelogs/preview.md +437 -0
- package/dist/docs/cli/authentication.md +3 -0
- package/dist/docs/cli/checkpointing.md +94 -0
- package/dist/docs/cli/cli-reference.md +101 -0
- package/dist/docs/cli/commands.md +430 -0
- package/dist/docs/cli/creating-skills.md +80 -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 +65 -0
- package/dist/docs/cli/keyboard-shortcuts.md +140 -0
- package/dist/docs/cli/model-routing.md +42 -0
- package/dist/docs/cli/model.md +62 -0
- package/dist/docs/cli/rewind.md +51 -0
- package/dist/docs/cli/sandbox.md +171 -0
- package/dist/docs/cli/session-management.md +158 -0
- package/dist/docs/cli/settings.md +139 -0
- package/dist/docs/cli/skills.md +112 -0
- package/dist/docs/cli/system-prompt.md +125 -0
- package/dist/docs/cli/telemetry.md +826 -0
- package/dist/docs/cli/themes.md +235 -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 +97 -0
- package/dist/docs/cli/tutorials.md +87 -0
- package/dist/docs/cli/uninstall.md +65 -0
- package/dist/docs/core/index.md +107 -0
- package/dist/docs/core/memport.md +246 -0
- package/dist/docs/core/policy-engine.md +305 -0
- package/dist/docs/core/remote-agents.md +84 -0
- package/dist/docs/core/subagents.md +191 -0
- package/dist/docs/core/tools-api.md +131 -0
- package/dist/docs/examples/proxy-script.md +83 -0
- package/dist/docs/extensions/best-practices.md +139 -0
- package/dist/docs/extensions/index.md +45 -0
- package/dist/docs/extensions/reference.md +336 -0
- package/dist/docs/extensions/releasing.md +183 -0
- package/dist/docs/extensions/writing-extensions.md +281 -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 +1585 -0
- package/dist/docs/get-started/examples.md +219 -0
- package/dist/docs/get-started/gemini-3.md +101 -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 +677 -0
- package/dist/docs/hooks/index.md +164 -0
- package/dist/docs/hooks/reference.md +322 -0
- package/dist/docs/hooks/writing-hooks.md +450 -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 +149 -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 +152 -0
- package/dist/docs/tools/file-system.md +217 -0
- package/dist/docs/tools/index.md +98 -0
- package/dist/docs/tools/mcp-server.md +1079 -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 +173 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/src/__mocks__/fs/promises.d.ts +11 -0
- package/dist/src/__mocks__/fs/promises.js +17 -0
- package/dist/src/__mocks__/fs/promises.js.map +1 -0
- package/dist/src/agents/a2a-client-manager.d.ts +77 -0
- package/dist/src/agents/a2a-client-manager.js +173 -0
- package/dist/src/agents/a2a-client-manager.js.map +1 -0
- package/dist/src/agents/a2aUtils.d.ts +29 -0
- package/dist/src/agents/a2aUtils.js +113 -0
- package/dist/src/agents/a2aUtils.js.map +1 -0
- package/dist/src/agents/acknowledgedAgents.d.ts +18 -0
- package/dist/src/agents/acknowledgedAgents.js +58 -0
- package/dist/src/agents/acknowledgedAgents.js.map +1 -0
- package/dist/src/agents/agent-scheduler.d.ts +33 -0
- package/dist/src/agents/agent-scheduler.js +29 -0
- package/dist/src/agents/agent-scheduler.js.map +1 -0
- package/dist/src/agents/agentLoader.d.ts +73 -0
- package/dist/src/agents/agentLoader.js +268 -0
- package/dist/src/agents/agentLoader.js.map +1 -0
- package/dist/src/agents/cli-help-agent.d.ts +24 -0
- package/dist/src/agents/cli-help-agent.js +80 -0
- package/dist/src/agents/cli-help-agent.js.map +1 -0
- package/dist/src/agents/codebase-investigator.d.ts +47 -0
- package/dist/src/agents/codebase-investigator.js +159 -0
- package/dist/src/agents/codebase-investigator.js.map +1 -0
- package/dist/src/agents/generalist-agent.d.ts +21 -0
- package/dist/src/agents/generalist-agent.js +60 -0
- package/dist/src/agents/generalist-agent.js.map +1 -0
- package/dist/src/agents/local-executor.d.ts +110 -0
- package/dist/src/agents/local-executor.js +879 -0
- package/dist/src/agents/local-executor.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/registry.d.ts +85 -0
- package/dist/src/agents/registry.js +374 -0
- package/dist/src/agents/registry.js.map +1 -0
- package/dist/src/agents/remote-invocation.d.ts +35 -0
- package/dist/src/agents/remote-invocation.js +127 -0
- package/dist/src/agents/remote-invocation.js.map +1 -0
- package/dist/src/agents/subagent-tool-wrapper.d.ts +38 -0
- package/dist/src/agents/subagent-tool-wrapper.js +51 -0
- package/dist/src/agents/subagent-tool-wrapper.js.map +1 -0
- package/dist/src/agents/subagent-tool.d.ts +15 -0
- package/dist/src/agents/subagent-tool.js +61 -0
- package/dist/src/agents/subagent-tool.js.map +1 -0
- package/dist/src/agents/types.d.ts +154 -0
- package/dist/src/agents/types.js +23 -0
- package/dist/src/agents/types.js.map +1 -0
- package/dist/src/agents/utils.d.ts +15 -0
- package/dist/src/agents/utils.js +29 -0
- package/dist/src/agents/utils.js.map +1 -0
- 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/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 +24 -0
- package/dist/src/availability/policyCatalog.js +106 -0
- package/dist/src/availability/policyCatalog.js.map +1 -0
- package/dist/src/availability/policyHelpers.d.ts +52 -0
- package/dist/src/availability/policyHelpers.js +143 -0
- package/dist/src/availability/policyHelpers.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/admin/admin_controls.d.ts +32 -0
- package/dist/src/code_assist/admin/admin_controls.js +120 -0
- package/dist/src/code_assist/admin/admin_controls.js.map +1 -0
- package/dist/src/code_assist/codeAssist.d.ts +12 -0
- package/dist/src/code_assist/codeAssist.js +31 -0
- package/dist/src/code_assist/codeAssist.js.map +1 -0
- package/dist/src/code_assist/converter.d.ts +75 -0
- package/dist/src/code_assist/converter.js +161 -0
- package/dist/src/code_assist/converter.js.map +1 -0
- package/dist/src/code_assist/experiments/client_metadata.d.ts +12 -0
- package/dist/src/code_assist/experiments/client_metadata.js +51 -0
- package/dist/src/code_assist/experiments/client_metadata.js.map +1 -0
- package/dist/src/code_assist/experiments/experiments.d.ts +17 -0
- package/dist/src/code_assist/experiments/experiments.js +57 -0
- package/dist/src/code_assist/experiments/experiments.js.map +1 -0
- package/dist/src/code_assist/experiments/flagNames.d.ts +16 -0
- package/dist/src/code_assist/experiments/flagNames.js +16 -0
- package/dist/src/code_assist/experiments/flagNames.js.map +1 -0
- package/dist/src/code_assist/experiments/types.d.ts +35 -0
- package/dist/src/code_assist/experiments/types.js +7 -0
- package/dist/src/code_assist/experiments/types.js.map +1 -0
- package/dist/src/code_assist/oauth-credential-storage.d.ts +25 -0
- package/dist/src/code_assist/oauth-credential-storage.js +109 -0
- package/dist/src/code_assist/oauth-credential-storage.js.map +1 -0
- package/dist/src/code_assist/oauth2.d.ts +25 -0
- package/dist/src/code_assist/oauth2.js +579 -0
- package/dist/src/code_assist/oauth2.js.map +1 -0
- package/dist/src/code_assist/server.d.ts +50 -0
- package/dist/src/code_assist/server.js +228 -0
- package/dist/src/code_assist/server.js.map +1 -0
- package/dist/src/code_assist/setup.d.ts +46 -0
- package/dist/src/code_assist/setup.js +179 -0
- package/dist/src/code_assist/setup.js.map +1 -0
- package/dist/src/code_assist/telemetry.d.ts +14 -0
- package/dist/src/code_assist/telemetry.js +157 -0
- package/dist/src/code_assist/telemetry.js.map +1 -0
- package/dist/src/code_assist/types.d.ts +306 -0
- package/dist/src/code_assist/types.js +94 -0
- package/dist/src/code_assist/types.js.map +1 -0
- package/dist/src/cognitive/gemini-adapter.d.ts +29 -0
- package/dist/src/cognitive/gemini-adapter.js +109 -0
- package/dist/src/cognitive/gemini-adapter.js.map +1 -0
- package/dist/src/cognitive/index.d.ts +22 -0
- package/dist/src/cognitive/index.js +50 -0
- package/dist/src/cognitive/index.js.map +1 -0
- package/dist/src/cognitive/integration.d.ts +57 -0
- package/dist/src/cognitive/integration.js +103 -0
- package/dist/src/cognitive/integration.js.map +1 -0
- package/dist/src/cognitive/loader/index.d.ts +8 -0
- package/dist/src/cognitive/loader/index.js +9 -0
- package/dist/src/cognitive/loader/index.js.map +1 -0
- package/dist/src/cognitive/loader/module-loader.d.ts +67 -0
- package/dist/src/cognitive/loader/module-loader.js +369 -0
- package/dist/src/cognitive/loader/module-loader.js.map +1 -0
- package/dist/src/cognitive/runtime/envelope.d.ts +31 -0
- package/dist/src/cognitive/runtime/envelope.js +167 -0
- package/dist/src/cognitive/runtime/envelope.js.map +1 -0
- package/dist/src/cognitive/runtime/executor.d.ts +65 -0
- package/dist/src/cognitive/runtime/executor.js +245 -0
- package/dist/src/cognitive/runtime/executor.js.map +1 -0
- package/dist/src/cognitive/runtime/index.d.ts +12 -0
- package/dist/src/cognitive/runtime/index.js +18 -0
- package/dist/src/cognitive/runtime/index.js.map +1 -0
- package/dist/src/cognitive/runtime/prompt-builder.d.ts +34 -0
- package/dist/src/cognitive/runtime/prompt-builder.js +216 -0
- package/dist/src/cognitive/runtime/prompt-builder.js.map +1 -0
- package/dist/src/cognitive/runtime/repair-pass.d.ts +43 -0
- package/dist/src/cognitive/runtime/repair-pass.js +170 -0
- package/dist/src/cognitive/runtime/repair-pass.js.map +1 -0
- package/dist/src/cognitive/runtime/risk-aggregator.d.ts +39 -0
- package/dist/src/cognitive/runtime/risk-aggregator.js +90 -0
- package/dist/src/cognitive/runtime/risk-aggregator.js.map +1 -0
- package/dist/src/cognitive/tool/cognitive-registry.d.ts +99 -0
- package/dist/src/cognitive/tool/cognitive-registry.js +192 -0
- package/dist/src/cognitive/tool/cognitive-registry.js.map +1 -0
- package/dist/src/cognitive/tool/cognitive-tool.d.ts +56 -0
- package/dist/src/cognitive/tool/cognitive-tool.js +217 -0
- package/dist/src/cognitive/tool/cognitive-tool.js.map +1 -0
- package/dist/src/cognitive/tool/index.d.ts +9 -0
- package/dist/src/cognitive/tool/index.js +10 -0
- package/dist/src/cognitive/tool/index.js.map +1 -0
- package/dist/src/cognitive/types.d.ts +234 -0
- package/dist/src/cognitive/types.js +10 -0
- package/dist/src/cognitive/types.js.map +1 -0
- package/dist/src/cognitive/validator/envelope-validator.d.ts +45 -0
- package/dist/src/cognitive/validator/envelope-validator.js +214 -0
- package/dist/src/cognitive/validator/envelope-validator.js.map +1 -0
- package/dist/src/cognitive/validator/index.d.ts +9 -0
- package/dist/src/cognitive/validator/index.js +10 -0
- package/dist/src/cognitive/validator/index.js.map +1 -0
- package/dist/src/cognitive/validator/schema-validator.d.ts +46 -0
- package/dist/src/cognitive/validator/schema-validator.js +202 -0
- package/dist/src/cognitive/validator/schema-validator.js.map +1 -0
- package/dist/src/commands/cognitive.d.ts +39 -0
- package/dist/src/commands/cognitive.js +335 -0
- package/dist/src/commands/cognitive.js.map +1 -0
- package/dist/src/commands/extensions.d.ts +7 -0
- package/dist/src/commands/extensions.js +9 -0
- package/dist/src/commands/extensions.js.map +1 -0
- 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/memory.d.ts +11 -0
- package/dist/src/commands/memory.js +80 -0
- package/dist/src/commands/memory.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/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 +766 -0
- package/dist/src/config/config.js +1625 -0
- package/dist/src/config/config.js.map +1 -0
- package/dist/src/config/constants.d.ts +15 -0
- package/dist/src/config/constants.js +24 -0
- package/dist/src/config/constants.js.map +1 -0
- package/dist/src/config/defaultModelConfigs.d.ts +7 -0
- package/dist/src/config/defaultModelConfigs.js +231 -0
- package/dist/src/config/defaultModelConfigs.js.map +1 -0
- package/dist/src/config/models.d.ts +67 -0
- package/dist/src/config/models.js +144 -0
- package/dist/src/config/models.js.map +1 -0
- package/dist/src/config/storage.d.ts +44 -0
- package/dist/src/config/storage.js +139 -0
- package/dist/src/config/storage.js.map +1 -0
- package/dist/src/confirmation-bus/index.d.ts +7 -0
- package/dist/src/confirmation-bus/index.js +8 -0
- package/dist/src/confirmation-bus/index.js.map +1 -0
- package/dist/src/confirmation-bus/message-bus.d.ts +24 -0
- package/dist/src/confirmation-bus/message-bus.js +120 -0
- package/dist/src/confirmation-bus/message-bus.js.map +1 -0
- package/dist/src/confirmation-bus/types.d.ts +147 -0
- package/dist/src/confirmation-bus/types.js +25 -0
- package/dist/src/confirmation-bus/types.js.map +1 -0
- package/dist/src/core/apiKeyCredentialStorage.d.ts +17 -0
- package/dist/src/core/apiKeyCredentialStorage.js +64 -0
- package/dist/src/core/apiKeyCredentialStorage.js.map +1 -0
- package/dist/src/core/baseLlmClient.d.ts +74 -0
- package/dist/src/core/baseLlmClient.js +167 -0
- package/dist/src/core/baseLlmClient.js.map +1 -0
- package/dist/src/core/client.d.ts +59 -0
- package/dist/src/core/client.js +716 -0
- package/dist/src/core/client.js.map +1 -0
- package/dist/src/core/contentGenerator.d.ts +34 -0
- package/dist/src/core/contentGenerator.js +107 -0
- package/dist/src/core/contentGenerator.js.map +1 -0
- package/dist/src/core/coreToolHookTriggers.d.ts +23 -0
- package/dist/src/core/coreToolHookTriggers.js +195 -0
- package/dist/src/core/coreToolHookTriggers.js.map +1 -0
- package/dist/src/core/coreToolScheduler.d.ts +50 -0
- package/dist/src/core/coreToolScheduler.js +703 -0
- package/dist/src/core/coreToolScheduler.js.map +1 -0
- package/dist/src/core/fakeContentGenerator.d.ts +34 -0
- package/dist/src/core/fakeContentGenerator.js +59 -0
- package/dist/src/core/fakeContentGenerator.js.map +1 -0
- package/dist/src/core/geminiChat.d.ts +160 -0
- package/dist/src/core/geminiChat.js +744 -0
- package/dist/src/core/geminiChat.js.map +1 -0
- package/dist/src/core/geminiRequest.d.ts +13 -0
- package/dist/src/core/geminiRequest.js +11 -0
- package/dist/src/core/geminiRequest.js.map +1 -0
- package/dist/src/core/logger.d.ts +65 -0
- package/dist/src/core/logger.js +368 -0
- package/dist/src/core/logger.js.map +1 -0
- package/dist/src/core/loggingContentGenerator.d.ts +29 -0
- package/dist/src/core/loggingContentGenerator.js +202 -0
- package/dist/src/core/loggingContentGenerator.js.map +1 -0
- package/dist/src/core/prompts.d.ts +19 -0
- package/dist/src/core/prompts.js +27 -0
- package/dist/src/core/prompts.js.map +1 -0
- package/dist/src/core/recordingContentGenerator.d.ts +19 -0
- package/dist/src/core/recordingContentGenerator.js +82 -0
- package/dist/src/core/recordingContentGenerator.js.map +1 -0
- package/dist/src/core/tokenLimits.d.ts +10 -0
- package/dist/src/core/tokenLimits.js +22 -0
- package/dist/src/core/tokenLimits.js.map +1 -0
- package/dist/src/core/turn.d.ts +167 -0
- package/dist/src/core/turn.js +209 -0
- package/dist/src/core/turn.js.map +1 -0
- package/dist/src/fallback/handler.d.ts +7 -0
- package/dist/src/fallback/handler.js +110 -0
- package/dist/src/fallback/handler.js.map +1 -0
- package/dist/src/fallback/types.d.ts +31 -0
- package/dist/src/fallback/types.js +7 -0
- package/dist/src/fallback/types.js.map +1 -0
- package/dist/src/generated/git-commit.d.ts +7 -0
- package/dist/src/generated/git-commit.js +10 -0
- package/dist/src/generated/git-commit.js.map +1 -0
- package/dist/src/hooks/hookAggregator.d.ts +68 -0
- package/dist/src/hooks/hookAggregator.js +279 -0
- package/dist/src/hooks/hookAggregator.js.map +1 -0
- package/dist/src/hooks/hookEventHandler.d.ts +107 -0
- package/dist/src/hooks/hookEventHandler.js +325 -0
- package/dist/src/hooks/hookEventHandler.js.map +1 -0
- package/dist/src/hooks/hookPlanner.d.ts +42 -0
- package/dist/src/hooks/hookPlanner.js +103 -0
- package/dist/src/hooks/hookPlanner.js.map +1 -0
- package/dist/src/hooks/hookRegistry.d.ts +75 -0
- package/dist/src/hooks/hookRegistry.js +215 -0
- package/dist/src/hooks/hookRegistry.js.map +1 -0
- package/dist/src/hooks/hookRunner.d.ts +44 -0
- package/dist/src/hooks/hookRunner.js +329 -0
- package/dist/src/hooks/hookRunner.js.map +1 -0
- package/dist/src/hooks/hookSystem.d.ts +99 -0
- package/dist/src/hooks/hookSystem.js +262 -0
- package/dist/src/hooks/hookSystem.js.map +1 -0
- package/dist/src/hooks/hookTranslator.d.ts +113 -0
- package/dist/src/hooks/hookTranslator.js +233 -0
- package/dist/src/hooks/hookTranslator.js.map +1 -0
- package/dist/src/hooks/index.d.ts +16 -0
- package/dist/src/hooks/index.js +16 -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/types.d.ts +442 -0
- package/dist/src/hooks/types.js +303 -0
- package/dist/src/hooks/types.js.map +1 -0
- package/dist/src/ide/constants.d.ts +9 -0
- package/dist/src/ide/constants.js +10 -0
- package/dist/src/ide/constants.js.map +1 -0
- package/dist/src/ide/detect-ide.d.ts +109 -0
- package/dist/src/ide/detect-ide.js +125 -0
- package/dist/src/ide/detect-ide.js.map +1 -0
- package/dist/src/ide/ide-client.d.ts +113 -0
- package/dist/src/ide/ide-client.js +669 -0
- package/dist/src/ide/ide-client.js.map +1 -0
- package/dist/src/ide/ide-installer.d.ts +14 -0
- package/dist/src/ide/ide-installer.js +227 -0
- package/dist/src/ide/ide-installer.js.map +1 -0
- package/dist/src/ide/ideContext.d.ts +44 -0
- package/dist/src/ide/ideContext.js +101 -0
- package/dist/src/ide/ideContext.js.map +1 -0
- package/dist/src/ide/process-utils.d.ts +21 -0
- package/dist/src/ide/process-utils.js +181 -0
- package/dist/src/ide/process-utils.js.map +1 -0
- package/dist/src/ide/types.d.ts +486 -0
- package/dist/src/ide/types.js +138 -0
- package/dist/src/ide/types.js.map +1 -0
- package/dist/src/index.d.ts +145 -0
- package/dist/src/index.js +161 -0
- package/dist/src/index.js.map +1 -0
- 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 +33 -0
- package/dist/src/mcp/google-auth-provider.js +118 -0
- package/dist/src/mcp/google-auth-provider.js.map +1 -0
- package/dist/src/mcp/oauth-provider.d.ts +160 -0
- package/dist/src/mcp/oauth-provider.js +729 -0
- package/dist/src/mcp/oauth-provider.js.map +1 -0
- package/dist/src/mcp/oauth-token-storage.d.ts +65 -0
- package/dist/src/mcp/oauth-token-storage.js +181 -0
- package/dist/src/mcp/oauth-token-storage.js.map +1 -0
- package/dist/src/mcp/oauth-utils.d.ts +142 -0
- package/dist/src/mcp/oauth-utils.js +289 -0
- package/dist/src/mcp/oauth-utils.js.map +1 -0
- package/dist/src/mcp/sa-impersonation-provider.d.ts +27 -0
- package/dist/src/mcp/sa-impersonation-provider.js +113 -0
- package/dist/src/mcp/sa-impersonation-provider.js.map +1 -0
- package/dist/src/mcp/token-storage/base-token-storage.d.ts +19 -0
- package/dist/src/mcp/token-storage/base-token-storage.js +36 -0
- package/dist/src/mcp/token-storage/base-token-storage.js.map +1 -0
- package/dist/src/mcp/token-storage/file-token-storage.d.ts +24 -0
- package/dist/src/mcp/token-storage/file-token-storage.js +145 -0
- package/dist/src/mcp/token-storage/file-token-storage.js.map +1 -0
- package/dist/src/mcp/token-storage/hybrid-token-storage.d.ts +23 -0
- package/dist/src/mcp/token-storage/hybrid-token-storage.js +78 -0
- package/dist/src/mcp/token-storage/hybrid-token-storage.js.map +1 -0
- package/dist/src/mcp/token-storage/index.d.ts +11 -0
- package/dist/src/mcp/token-storage/index.js +12 -0
- package/dist/src/mcp/token-storage/index.js.map +1 -0
- package/dist/src/mcp/token-storage/keychain-token-storage.d.ts +35 -0
- package/dist/src/mcp/token-storage/keychain-token-storage.js +246 -0
- package/dist/src/mcp/token-storage/keychain-token-storage.js.map +1 -0
- package/dist/src/mcp/token-storage/types.d.ts +44 -0
- package/dist/src/mcp/token-storage/types.js +11 -0
- package/dist/src/mcp/token-storage/types.js.map +1 -0
- package/dist/src/mocks/msw.d.ts +6 -0
- package/dist/src/mocks/msw.js +8 -0
- package/dist/src/mocks/msw.js.map +1 -0
- package/dist/src/output/json-formatter.d.ts +11 -0
- package/dist/src/output/json-formatter.js +33 -0
- package/dist/src/output/json-formatter.js.map +1 -0
- package/dist/src/output/stream-json-formatter.d.ts +32 -0
- package/dist/src/output/stream-json-formatter.js +58 -0
- package/dist/src/output/stream-json-formatter.js.map +1 -0
- package/dist/src/output/types.d.ts +85 -0
- package/dist/src/output/types.js +22 -0
- package/dist/src/output/types.js.map +1 -0
- package/dist/src/policy/config.d.ts +31 -0
- package/dist/src/policy/config.js +355 -0
- package/dist/src/policy/config.js.map +1 -0
- package/dist/src/policy/index.d.ts +9 -0
- package/dist/src/policy/index.js +10 -0
- package/dist/src/policy/index.js.map +1 -0
- package/dist/src/policy/policies/discovered.toml +8 -0
- package/dist/src/policy/policies/plan.toml +79 -0
- package/dist/src/policy/policies/read-only.toml +51 -0
- package/dist/src/policy/policies/write.toml +78 -0
- package/dist/src/policy/policies/yolo.toml +32 -0
- package/dist/src/policy/policy-engine.d.ts +65 -0
- package/dist/src/policy/policy-engine.js +357 -0
- package/dist/src/policy/policy-engine.js.map +1 -0
- package/dist/src/policy/stable-stringify.d.ts +58 -0
- package/dist/src/policy/stable-stringify.js +122 -0
- package/dist/src/policy/stable-stringify.js.map +1 -0
- package/dist/src/policy/toml-loader.d.ts +45 -0
- package/dist/src/policy/toml-loader.js +366 -0
- package/dist/src/policy/toml-loader.js.map +1 -0
- package/dist/src/policy/types.d.ts +220 -0
- package/dist/src/policy/types.js +44 -0
- package/dist/src/policy/types.js.map +1 -0
- package/dist/src/policy/utils.d.ts +21 -0
- package/dist/src/policy/utils.js +45 -0
- package/dist/src/policy/utils.js.map +1 -0
- package/dist/src/prompts/mcp-prompts.d.ts +8 -0
- package/dist/src/prompts/mcp-prompts.js +13 -0
- package/dist/src/prompts/mcp-prompts.js.map +1 -0
- package/dist/src/prompts/prompt-registry.d.ts +34 -0
- package/dist/src/prompts/prompt-registry.js +64 -0
- package/dist/src/prompts/prompt-registry.js.map +1 -0
- package/dist/src/prompts/promptProvider.d.ts +18 -0
- package/dist/src/prompts/promptProvider.js +129 -0
- package/dist/src/prompts/promptProvider.js.map +1 -0
- package/dist/src/prompts/snippets.d.ts +76 -0
- package/dist/src/prompts/snippets.js +455 -0
- package/dist/src/prompts/snippets.js.map +1 -0
- package/dist/src/prompts/utils.d.ts +23 -0
- package/dist/src/prompts/utils.js +72 -0
- package/dist/src/prompts/utils.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/routing/modelRouterService.d.ts +23 -0
- package/dist/src/routing/modelRouterService.js +80 -0
- package/dist/src/routing/modelRouterService.js.map +1 -0
- package/dist/src/routing/routingStrategy.d.ts +64 -0
- package/dist/src/routing/routingStrategy.js +7 -0
- package/dist/src/routing/routingStrategy.js.map +1 -0
- package/dist/src/routing/strategies/classifierStrategy.d.ts +12 -0
- package/dist/src/routing/strategies/classifierStrategy.js +152 -0
- package/dist/src/routing/strategies/classifierStrategy.js.map +1 -0
- package/dist/src/routing/strategies/compositeStrategy.d.ts +26 -0
- package/dist/src/routing/strategies/compositeStrategy.js +70 -0
- package/dist/src/routing/strategies/compositeStrategy.js.map +1 -0
- package/dist/src/routing/strategies/defaultStrategy.d.ts +12 -0
- package/dist/src/routing/strategies/defaultStrategy.js +21 -0
- package/dist/src/routing/strategies/defaultStrategy.js.map +1 -0
- package/dist/src/routing/strategies/fallbackStrategy.d.ts +12 -0
- package/dist/src/routing/strategies/fallbackStrategy.js +33 -0
- package/dist/src/routing/strategies/fallbackStrategy.js.map +1 -0
- package/dist/src/routing/strategies/numericalClassifierStrategy.d.ts +13 -0
- package/dist/src/routing/strategies/numericalClassifierStrategy.js +178 -0
- package/dist/src/routing/strategies/numericalClassifierStrategy.js.map +1 -0
- package/dist/src/routing/strategies/overrideStrategy.d.ts +15 -0
- package/dist/src/routing/strategies/overrideStrategy.js +29 -0
- package/dist/src/routing/strategies/overrideStrategy.js.map +1 -0
- package/dist/src/safety/built-in.d.ts +21 -0
- package/dist/src/safety/built-in.js +106 -0
- package/dist/src/safety/built-in.js.map +1 -0
- package/dist/src/safety/checker-runner.d.ts +48 -0
- package/dist/src/safety/checker-runner.js +219 -0
- package/dist/src/safety/checker-runner.js.map +1 -0
- package/dist/src/safety/context-builder.d.ts +23 -0
- package/dist/src/safety/context-builder.js +47 -0
- package/dist/src/safety/context-builder.js.map +1 -0
- package/dist/src/safety/protocol.d.ts +88 -0
- package/dist/src/safety/protocol.js +15 -0
- package/dist/src/safety/protocol.js.map +1 -0
- package/dist/src/safety/registry.d.ts +26 -0
- package/dist/src/safety/registry.js +65 -0
- package/dist/src/safety/registry.js.map +1 -0
- package/dist/src/scheduler/confirmation.d.ts +49 -0
- package/dist/src/scheduler/confirmation.js +183 -0
- package/dist/src/scheduler/confirmation.js.map +1 -0
- package/dist/src/scheduler/policy.d.ts +25 -0
- package/dist/src/scheduler/policy.js +108 -0
- package/dist/src/scheduler/policy.js.map +1 -0
- package/dist/src/scheduler/scheduler.d.ts +61 -0
- package/dist/src/scheduler/scheduler.js +356 -0
- package/dist/src/scheduler/scheduler.js.map +1 -0
- package/dist/src/scheduler/state-manager.d.ts +73 -0
- package/dist/src/scheduler/state-manager.js +356 -0
- package/dist/src/scheduler/state-manager.js.map +1 -0
- package/dist/src/scheduler/tool-executor.d.ts +22 -0
- package/dist/src/scheduler/tool-executor.js +201 -0
- package/dist/src/scheduler/tool-executor.js.map +1 -0
- package/dist/src/scheduler/tool-modifier.d.ts +23 -0
- package/dist/src/scheduler/tool-modifier.js +50 -0
- package/dist/src/scheduler/tool-modifier.js.map +1 -0
- package/dist/src/scheduler/types.d.ts +118 -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 +41 -0
- package/dist/src/services/chatCompressionService.js +339 -0
- package/dist/src/services/chatCompressionService.js.map +1 -0
- package/dist/src/services/chatRecordingService.d.ts +174 -0
- package/dist/src/services/chatRecordingService.js +427 -0
- package/dist/src/services/chatRecordingService.js.map +1 -0
- 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/environmentSanitization.d.ts +15 -0
- package/dist/src/services/environmentSanitization.js +145 -0
- package/dist/src/services/environmentSanitization.js.map +1 -0
- package/dist/src/services/fileDiscoveryService.d.ts +45 -0
- package/dist/src/services/fileDiscoveryService.js +141 -0
- package/dist/src/services/fileDiscoveryService.js.map +1 -0
- package/dist/src/services/fileSystemService.d.ts +31 -0
- package/dist/src/services/fileSystemService.js +18 -0
- package/dist/src/services/fileSystemService.js.map +1 -0
- package/dist/src/services/gitService.d.ts +24 -0
- package/dist/src/services/gitService.js +132 -0
- package/dist/src/services/gitService.js.map +1 -0
- package/dist/src/services/loopDetectionService.d.ts +106 -0
- package/dist/src/services/loopDetectionService.js +433 -0
- package/dist/src/services/loopDetectionService.js.map +1 -0
- package/dist/src/services/modelConfigService.d.ts +86 -0
- package/dist/src/services/modelConfigService.js +215 -0
- package/dist/src/services/modelConfigService.js.map +1 -0
- 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/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/shellExecutionService.d.ts +145 -0
- package/dist/src/services/shellExecutionService.js +871 -0
- package/dist/src/services/shellExecutionService.js.map +1 -0
- package/dist/src/services/test-data/resolved-aliases-retry.golden.json +238 -0
- package/dist/src/services/test-data/resolved-aliases.golden.json +238 -0
- package/dist/src/skills/builtin/skill-creator/SKILL.md +382 -0
- package/dist/src/skills/builtin/skill-creator/scripts/init_skill.cjs +235 -0
- package/dist/src/skills/builtin/skill-creator/scripts/package_skill.cjs +102 -0
- package/dist/src/skills/builtin/skill-creator/scripts/validate_skill.cjs +127 -0
- package/dist/src/skills/skillLoader.d.ts +31 -0
- package/dist/src/skills/skillLoader.js +133 -0
- package/dist/src/skills/skillLoader.js.map +1 -0
- package/dist/src/skills/skillManager.d.ts +69 -0
- package/dist/src/skills/skillManager.js +138 -0
- package/dist/src/skills/skillManager.js.map +1 -0
- package/dist/src/telemetry/activity-detector.d.ts +41 -0
- package/dist/src/telemetry/activity-detector.js +61 -0
- package/dist/src/telemetry/activity-detector.js.map +1 -0
- package/dist/src/telemetry/activity-monitor.d.ts +116 -0
- package/dist/src/telemetry/activity-monitor.js +209 -0
- package/dist/src/telemetry/activity-monitor.js.map +1 -0
- package/dist/src/telemetry/activity-types.d.ts +19 -0
- package/dist/src/telemetry/activity-types.js +21 -0
- package/dist/src/telemetry/activity-types.js.map +1 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.d.ts +172 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js +1316 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js.map +1 -0
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.d.ts +150 -0
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js +377 -0
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js.map +1 -0
- package/dist/src/telemetry/config.d.ts +31 -0
- package/dist/src/telemetry/config.js +78 -0
- package/dist/src/telemetry/config.js.map +1 -0
- package/dist/src/telemetry/constants.d.ts +6 -0
- package/dist/src/telemetry/constants.js +7 -0
- package/dist/src/telemetry/constants.js.map +1 -0
- package/dist/src/telemetry/file-exporters.d.ts +29 -0
- package/dist/src/telemetry/file-exporters.js +62 -0
- package/dist/src/telemetry/file-exporters.js.map +1 -0
- package/dist/src/telemetry/gcp-exporters.d.ts +35 -0
- package/dist/src/telemetry/gcp-exporters.js +120 -0
- package/dist/src/telemetry/gcp-exporters.js.map +1 -0
- package/dist/src/telemetry/high-water-mark-tracker.d.ts +43 -0
- package/dist/src/telemetry/high-water-mark-tracker.js +88 -0
- package/dist/src/telemetry/high-water-mark-tracker.js.map +1 -0
- package/dist/src/telemetry/index.d.ts +33 -0
- package/dist/src/telemetry/index.js +44 -0
- package/dist/src/telemetry/index.js.map +1 -0
- package/dist/src/telemetry/integration.test.circular.d.ts +6 -0
- package/dist/src/telemetry/integration.test.circular.js +54 -0
- package/dist/src/telemetry/integration.test.circular.js.map +1 -0
- package/dist/src/telemetry/loggers.d.ts +46 -0
- package/dist/src/telemetry/loggers.js +517 -0
- package/dist/src/telemetry/loggers.js.map +1 -0
- package/dist/src/telemetry/loggers.test.circular.d.ts +6 -0
- package/dist/src/telemetry/loggers.test.circular.js +107 -0
- package/dist/src/telemetry/loggers.test.circular.js.map +1 -0
- package/dist/src/telemetry/memory-monitor.d.ts +149 -0
- package/dist/src/telemetry/memory-monitor.js +335 -0
- package/dist/src/telemetry/memory-monitor.js.map +1 -0
- package/dist/src/telemetry/metrics.d.ts +533 -0
- package/dist/src/telemetry/metrics.js +852 -0
- package/dist/src/telemetry/metrics.js.map +1 -0
- package/dist/src/telemetry/rate-limiter.d.ts +48 -0
- package/dist/src/telemetry/rate-limiter.js +100 -0
- package/dist/src/telemetry/rate-limiter.js.map +1 -0
- 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/sdk.d.ts +16 -0
- package/dist/src/telemetry/sdk.js +307 -0
- package/dist/src/telemetry/sdk.js.map +1 -0
- package/dist/src/telemetry/semantic.d.ts +82 -0
- package/dist/src/telemetry/semantic.js +357 -0
- package/dist/src/telemetry/semantic.js.map +1 -0
- 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/telemetry-utils.d.ts +6 -0
- package/dist/src/telemetry/telemetry-utils.js +14 -0
- package/dist/src/telemetry/telemetry-utils.js.map +1 -0
- package/dist/src/telemetry/telemetryAttributes.d.ts +8 -0
- package/dist/src/telemetry/telemetryAttributes.js +19 -0
- package/dist/src/telemetry/telemetryAttributes.js.map +1 -0
- package/dist/src/telemetry/tool-call-decision.d.ts +13 -0
- package/dist/src/telemetry/tool-call-decision.js +29 -0
- package/dist/src/telemetry/tool-call-decision.js.map +1 -0
- package/dist/src/telemetry/trace.d.ts +46 -0
- package/dist/src/telemetry/trace.js +121 -0
- package/dist/src/telemetry/trace.js.map +1 -0
- package/dist/src/telemetry/types.d.ts +566 -0
- package/dist/src/telemetry/types.js +1495 -0
- package/dist/src/telemetry/types.js.map +1 -0
- package/dist/src/telemetry/uiTelemetry.d.ts +76 -0
- package/dist/src/telemetry/uiTelemetry.js +154 -0
- package/dist/src/telemetry/uiTelemetry.js.map +1 -0
- package/dist/src/test-utils/config.d.ts +17 -0
- package/dist/src/test-utils/config.js +32 -0
- package/dist/src/test-utils/config.js.map +1 -0
- package/dist/src/test-utils/index.d.ts +6 -0
- package/dist/src/test-utils/index.js +7 -0
- package/dist/src/test-utils/index.js.map +1 -0
- package/dist/src/test-utils/mock-message-bus.d.ts +43 -0
- package/dist/src/test-utils/mock-message-bus.js +96 -0
- package/dist/src/test-utils/mock-message-bus.js.map +1 -0
- package/dist/src/test-utils/mock-tool.d.ts +69 -0
- package/dist/src/test-utils/mock-tool.js +123 -0
- package/dist/src/test-utils/mock-tool.js.map +1 -0
- package/dist/src/test-utils/mockWorkspaceContext.d.ts +13 -0
- package/dist/src/test-utils/mockWorkspaceContext.js +24 -0
- package/dist/src/test-utils/mockWorkspaceContext.js.map +1 -0
- package/dist/src/tools/activate-skill.d.ts +27 -0
- package/dist/src/tools/activate-skill.js +133 -0
- package/dist/src/tools/activate-skill.js.map +1 -0
- package/dist/src/tools/ask-user.d.ts +23 -0
- package/dist/src/tools/ask-user.js +155 -0
- package/dist/src/tools/ask-user.js.map +1 -0
- package/dist/src/tools/constants.d.ts +7 -0
- package/dist/src/tools/constants.js +8 -0
- package/dist/src/tools/constants.js.map +1 -0
- package/dist/src/tools/diffOptions.d.ts +9 -0
- package/dist/src/tools/diffOptions.js +50 -0
- package/dist/src/tools/diffOptions.js.map +1 -0
- package/dist/src/tools/edit.d.ts +79 -0
- package/dist/src/tools/edit.js +750 -0
- package/dist/src/tools/edit.js.map +1 -0
- package/dist/src/tools/get-internal-docs.d.ts +27 -0
- package/dist/src/tools/get-internal-docs.js +122 -0
- package/dist/src/tools/get-internal-docs.js.map +1 -0
- package/dist/src/tools/glob.d.ts +57 -0
- package/dist/src/tools/glob.js +240 -0
- package/dist/src/tools/glob.js.map +1 -0
- package/dist/src/tools/grep.d.ts +41 -0
- package/dist/src/tools/grep.js +505 -0
- package/dist/src/tools/grep.js.map +1 -0
- package/dist/src/tools/ls.d.ts +69 -0
- package/dist/src/tools/ls.js +214 -0
- package/dist/src/tools/ls.js.map +1 -0
- package/dist/src/tools/mcp-client-manager.d.ts +93 -0
- package/dist/src/tools/mcp-client-manager.js +338 -0
- package/dist/src/tools/mcp-client-manager.js.map +1 -0
- package/dist/src/tools/mcp-client.d.ts +243 -0
- package/dist/src/tools/mcp-client.js +1351 -0
- package/dist/src/tools/mcp-client.js.map +1 -0
- package/dist/src/tools/mcp-tool.d.ts +49 -0
- package/dist/src/tools/mcp-tool.js +300 -0
- package/dist/src/tools/mcp-tool.js.map +1 -0
- package/dist/src/tools/memoryTool.d.ts +42 -0
- package/dist/src/tools/memoryTool.js +269 -0
- package/dist/src/tools/memoryTool.js.map +1 -0
- package/dist/src/tools/modifiable-tool.d.ts +36 -0
- package/dist/src/tools/modifiable-tool.js +110 -0
- package/dist/src/tools/modifiable-tool.js.map +1 -0
- package/dist/src/tools/read-file.d.ts +37 -0
- package/dist/src/tools/read-file.js +141 -0
- package/dist/src/tools/read-file.js.map +1 -0
- package/dist/src/tools/read-many-files.d.ts +54 -0
- package/dist/src/tools/read-many-files.js +364 -0
- package/dist/src/tools/read-many-files.js.map +1 -0
- package/dist/src/tools/ripGrep.d.ts +74 -0
- package/dist/src/tools/ripGrep.js +422 -0
- package/dist/src/tools/ripGrep.js.map +1 -0
- package/dist/src/tools/shell.d.ts +33 -0
- package/dist/src/tools/shell.js +436 -0
- package/dist/src/tools/shell.js.map +1 -0
- package/dist/src/tools/tool-error.d.ts +70 -0
- package/dist/src/tools/tool-error.js +92 -0
- package/dist/src/tools/tool-error.js.map +1 -0
- package/dist/src/tools/tool-names.d.ts +41 -0
- package/dist/src/tools/tool-names.js +94 -0
- package/dist/src/tools/tool-names.js.map +1 -0
- package/dist/src/tools/tool-registry.d.ts +103 -0
- package/dist/src/tools/tool-registry.js +429 -0
- package/dist/src/tools/tool-registry.js.map +1 -0
- package/dist/src/tools/tools.d.ts +347 -0
- package/dist/src/tools/tools.js +405 -0
- package/dist/src/tools/tools.js.map +1 -0
- package/dist/src/tools/web-fetch.d.ts +35 -0
- package/dist/src/tools/web-fetch.js +299 -0
- package/dist/src/tools/web-fetch.js.map +1 -0
- package/dist/src/tools/web-search.d.ts +50 -0
- package/dist/src/tools/web-search.js +141 -0
- package/dist/src/tools/web-search.js.map +1 -0
- package/dist/src/tools/write-file.d.ts +53 -0
- package/dist/src/tools/write-file.js +341 -0
- package/dist/src/tools/write-file.js.map +1 -0
- package/dist/src/tools/write-todos.d.ts +50 -0
- package/dist/src/tools/write-todos.js +194 -0
- package/dist/src/tools/write-todos.js.map +1 -0
- package/dist/src/utils/apiConversionUtils.d.ts +12 -0
- package/dist/src/utils/apiConversionUtils.js +46 -0
- package/dist/src/utils/apiConversionUtils.js.map +1 -0
- package/dist/src/utils/bfsFileSearch.d.ts +32 -0
- package/dist/src/utils/bfsFileSearch.js +136 -0
- package/dist/src/utils/bfsFileSearch.js.map +1 -0
- package/dist/src/utils/browser.d.ts +13 -0
- package/dist/src/utils/browser.js +50 -0
- package/dist/src/utils/browser.js.map +1 -0
- package/dist/src/utils/channel.d.ts +19 -0
- package/dist/src/utils/channel.js +49 -0
- package/dist/src/utils/channel.js.map +1 -0
- 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/constants.d.ts +7 -0
- package/dist/src/utils/constants.js +8 -0
- package/dist/src/utils/constants.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/debugLogger.d.ts +28 -0
- package/dist/src/utils/debugLogger.js +61 -0
- package/dist/src/utils/debugLogger.js.map +1 -0
- package/dist/src/utils/delay.d.ts +16 -0
- package/dist/src/utils/delay.js +43 -0
- package/dist/src/utils/delay.js.map +1 -0
- package/dist/src/utils/editCorrector.d.ts +54 -0
- package/dist/src/utils/editCorrector.js +596 -0
- package/dist/src/utils/editCorrector.js.map +1 -0
- package/dist/src/utils/editor.d.ts +39 -0
- package/dist/src/utils/editor.js +219 -0
- package/dist/src/utils/editor.js.map +1 -0
- package/dist/src/utils/environmentContext.d.ts +23 -0
- package/dist/src/utils/environmentContext.js +81 -0
- package/dist/src/utils/environmentContext.js.map +1 -0
- package/dist/src/utils/errorParsing.d.ts +8 -0
- package/dist/src/utils/errorParsing.js +65 -0
- package/dist/src/utils/errorParsing.js.map +1 -0
- package/dist/src/utils/errorReporting.d.ts +14 -0
- package/dist/src/utils/errorReporting.js +89 -0
- package/dist/src/utils/errorReporting.js.map +1 -0
- package/dist/src/utils/errors.d.ts +53 -0
- package/dist/src/utils/errors.js +145 -0
- package/dist/src/utils/errors.js.map +1 -0
- package/dist/src/utils/events.d.ts +211 -0
- package/dist/src/utils/events.js +134 -0
- package/dist/src/utils/events.js.map +1 -0
- 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 +86 -0
- package/dist/src/utils/extensionLoader.js +208 -0
- package/dist/src/utils/extensionLoader.js.map +1 -0
- package/dist/src/utils/fetch.d.ts +12 -0
- package/dist/src/utils/fetch.js +55 -0
- package/dist/src/utils/fetch.js.map +1 -0
- package/dist/src/utils/fileDiffUtils.d.ts +18 -0
- package/dist/src/utils/fileDiffUtils.js +37 -0
- package/dist/src/utils/fileDiffUtils.js.map +1 -0
- package/dist/src/utils/fileUtils.d.ts +86 -0
- package/dist/src/utils/fileUtils.js +495 -0
- package/dist/src/utils/fileUtils.js.map +1 -0
- package/dist/src/utils/filesearch/crawlCache.d.ts +25 -0
- package/dist/src/utils/filesearch/crawlCache.js +57 -0
- package/dist/src/utils/filesearch/crawlCache.js.map +1 -0
- package/dist/src/utils/filesearch/crawler.d.ts +16 -0
- package/dist/src/utils/filesearch/crawler.js +67 -0
- package/dist/src/utils/filesearch/crawler.js.map +1 -0
- package/dist/src/utils/filesearch/fileSearch.d.ts +39 -0
- package/dist/src/utils/filesearch/fileSearch.js +192 -0
- package/dist/src/utils/filesearch/fileSearch.js.map +1 -0
- package/dist/src/utils/filesearch/ignore.d.ts +37 -0
- package/dist/src/utils/filesearch/ignore.js +99 -0
- package/dist/src/utils/filesearch/ignore.js.map +1 -0
- package/dist/src/utils/filesearch/result-cache.d.ts +33 -0
- package/dist/src/utils/filesearch/result-cache.js +59 -0
- package/dist/src/utils/filesearch/result-cache.js.map +1 -0
- package/dist/src/utils/formatters.d.ts +7 -0
- package/dist/src/utils/formatters.js +17 -0
- package/dist/src/utils/formatters.js.map +1 -0
- package/dist/src/utils/generateContentResponseUtilities.d.ts +15 -0
- package/dist/src/utils/generateContentResponseUtilities.js +186 -0
- package/dist/src/utils/generateContentResponseUtilities.js.map +1 -0
- package/dist/src/utils/getFolderStructure.d.ts +31 -0
- package/dist/src/utils/getFolderStructure.js +243 -0
- package/dist/src/utils/getFolderStructure.js.map +1 -0
- package/dist/src/utils/getPty.d.ts +19 -0
- package/dist/src/utils/getPty.js +23 -0
- package/dist/src/utils/getPty.js.map +1 -0
- package/dist/src/utils/gitIgnoreParser.d.ts +19 -0
- package/dist/src/utils/gitIgnoreParser.js +169 -0
- package/dist/src/utils/gitIgnoreParser.js.map +1 -0
- package/dist/src/utils/gitUtils.d.ts +17 -0
- package/dist/src/utils/gitUtils.js +61 -0
- package/dist/src/utils/gitUtils.js.map +1 -0
- package/dist/src/utils/googleErrors.d.ts +104 -0
- package/dist/src/utils/googleErrors.js +165 -0
- package/dist/src/utils/googleErrors.js.map +1 -0
- package/dist/src/utils/googleQuotaErrors.d.ts +51 -0
- package/dist/src/utils/googleQuotaErrors.js +250 -0
- package/dist/src/utils/googleQuotaErrors.js.map +1 -0
- package/dist/src/utils/httpErrors.d.ts +18 -0
- package/dist/src/utils/httpErrors.js +36 -0
- package/dist/src/utils/httpErrors.js.map +1 -0
- package/dist/src/utils/ignoreFileParser.d.ts +30 -0
- package/dist/src/utils/ignoreFileParser.js +100 -0
- package/dist/src/utils/ignoreFileParser.js.map +1 -0
- package/dist/src/utils/ignorePatterns.d.ts +103 -0
- package/dist/src/utils/ignorePatterns.js +220 -0
- package/dist/src/utils/ignorePatterns.js.map +1 -0
- package/dist/src/utils/installationManager.d.ts +16 -0
- package/dist/src/utils/installationManager.js +51 -0
- package/dist/src/utils/installationManager.js.map +1 -0
- package/dist/src/utils/language-detection.d.ts +6 -0
- package/dist/src/utils/language-detection.js +101 -0
- package/dist/src/utils/language-detection.js.map +1 -0
- package/dist/src/utils/llm-edit-fixer.d.ts +26 -0
- package/dist/src/utils/llm-edit-fixer.js +152 -0
- package/dist/src/utils/llm-edit-fixer.js.map +1 -0
- package/dist/src/utils/memoryDiscovery.d.ts +40 -0
- package/dist/src/utils/memoryDiscovery.js +421 -0
- package/dist/src/utils/memoryDiscovery.js.map +1 -0
- package/dist/src/utils/memoryImportProcessor.d.ts +42 -0
- package/dist/src/utils/memoryImportProcessor.js +273 -0
- package/dist/src/utils/memoryImportProcessor.js.map +1 -0
- package/dist/src/utils/messageInspectors.d.ts +8 -0
- package/dist/src/utils/messageInspectors.js +16 -0
- package/dist/src/utils/messageInspectors.js.map +1 -0
- package/dist/src/utils/nextSpeakerChecker.d.ts +12 -0
- package/dist/src/utils/nextSpeakerChecker.js +97 -0
- package/dist/src/utils/nextSpeakerChecker.js.map +1 -0
- package/dist/src/utils/package.d.ts +26 -0
- package/dist/src/utils/package.js +35 -0
- package/dist/src/utils/package.js.map +1 -0
- package/dist/src/utils/partUtils.d.ts +35 -0
- package/dist/src/utils/partUtils.js +133 -0
- package/dist/src/utils/partUtils.js.map +1 -0
- package/dist/src/utils/pathCorrector.d.ts +25 -0
- package/dist/src/utils/pathCorrector.js +43 -0
- package/dist/src/utils/pathCorrector.js.map +1 -0
- package/dist/src/utils/pathReader.d.ts +17 -0
- package/dist/src/utils/pathReader.js +92 -0
- package/dist/src/utils/pathReader.js.map +1 -0
- package/dist/src/utils/paths.d.ts +78 -0
- package/dist/src/utils/paths.js +311 -0
- package/dist/src/utils/paths.js.map +1 -0
- package/dist/src/utils/process-utils.d.ts +32 -0
- package/dist/src/utils/process-utils.js +88 -0
- package/dist/src/utils/process-utils.js.map +1 -0
- package/dist/src/utils/promptIdContext.d.ts +13 -0
- package/dist/src/utils/promptIdContext.js +23 -0
- package/dist/src/utils/promptIdContext.js.map +1 -0
- package/dist/src/utils/quotaErrorDetection.d.ts +16 -0
- package/dist/src/utils/quotaErrorDetection.js +19 -0
- package/dist/src/utils/quotaErrorDetection.js.map +1 -0
- package/dist/src/utils/retry.d.ts +39 -0
- package/dist/src/utils/retry.js +267 -0
- package/dist/src/utils/retry.js.map +1 -0
- package/dist/src/utils/safeJsonStringify.d.ts +13 -0
- package/dist/src/utils/safeJsonStringify.js +49 -0
- package/dist/src/utils/safeJsonStringify.js.map +1 -0
- package/dist/src/utils/schemaValidator.d.ts +21 -0
- package/dist/src/utils/schemaValidator.js +59 -0
- package/dist/src/utils/schemaValidator.js.map +1 -0
- package/dist/src/utils/secure-browser-launcher.d.ts +23 -0
- package/dist/src/utils/secure-browser-launcher.js +165 -0
- package/dist/src/utils/secure-browser-launcher.js.map +1 -0
- package/dist/src/utils/security.d.ts +16 -0
- package/dist/src/utils/security.js +88 -0
- package/dist/src/utils/security.js.map +1 -0
- package/dist/src/utils/session.d.ts +6 -0
- package/dist/src/utils/session.js +8 -0
- package/dist/src/utils/session.js.map +1 -0
- package/dist/src/utils/shell-utils.d.ts +118 -0
- package/dist/src/utils/shell-utils.js +708 -0
- package/dist/src/utils/shell-utils.js.map +1 -0
- package/dist/src/utils/stdio.d.ts +32 -0
- package/dist/src/utils/stdio.js +85 -0
- package/dist/src/utils/stdio.js.map +1 -0
- package/dist/src/utils/summarizer.d.ts +27 -0
- package/dist/src/utils/summarizer.js +50 -0
- package/dist/src/utils/summarizer.js.map +1 -0
- package/dist/src/utils/systemEncoding.d.ts +40 -0
- package/dist/src/utils/systemEncoding.js +150 -0
- package/dist/src/utils/systemEncoding.js.map +1 -0
- package/dist/src/utils/terminal.d.ts +22 -0
- package/dist/src/utils/terminal.js +62 -0
- package/dist/src/utils/terminal.js.map +1 -0
- package/dist/src/utils/terminalSerializer.d.ts +25 -0
- package/dist/src/utils/terminalSerializer.js +444 -0
- package/dist/src/utils/terminalSerializer.js.map +1 -0
- package/dist/src/utils/testUtils.d.ts +29 -0
- package/dist/src/utils/testUtils.js +70 -0
- package/dist/src/utils/testUtils.js.map +1 -0
- package/dist/src/utils/textUtils.d.ts +32 -0
- package/dist/src/utils/textUtils.js +65 -0
- package/dist/src/utils/textUtils.js.map +1 -0
- package/dist/src/utils/thoughtUtils.d.ts +21 -0
- package/dist/src/utils/thoughtUtils.js +39 -0
- package/dist/src/utils/thoughtUtils.js.map +1 -0
- package/dist/src/utils/tokenCalculation.d.ts +19 -0
- package/dist/src/utils/tokenCalculation.js +150 -0
- package/dist/src/utils/tokenCalculation.js.map +1 -0
- package/dist/src/utils/tool-utils.d.ts +28 -0
- package/dist/src/utils/tool-utils.js +96 -0
- package/dist/src/utils/tool-utils.js.map +1 -0
- package/dist/src/utils/toolCallContext.d.ts +35 -0
- package/dist/src/utils/toolCallContext.js +29 -0
- package/dist/src/utils/toolCallContext.js.map +1 -0
- package/dist/src/utils/userAccountManager.d.ts +20 -0
- package/dist/src/utils/userAccountManager.js +115 -0
- package/dist/src/utils/userAccountManager.js.map +1 -0
- 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/workspaceContext.d.ts +82 -0
- package/dist/src/utils/workspaceContext.js +192 -0
- package/dist/src/utils/workspaceContext.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +97 -0
|
@@ -0,0 +1,852 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { diag, metrics, ValueType } from '@opentelemetry/api';
|
|
7
|
+
import { SERVICE_NAME } from './constants.js';
|
|
8
|
+
import { AuthType } from '../core/contentGenerator.js';
|
|
9
|
+
import { getCommonAttributes } from './telemetryAttributes.js';
|
|
10
|
+
import { sanitizeHookName } from './sanitize.js';
|
|
11
|
+
const EVENT_CHAT_COMPRESSION = 'gemini_cli.chat_compression';
|
|
12
|
+
const TOOL_CALL_COUNT = 'gemini_cli.tool.call.count';
|
|
13
|
+
const TOOL_CALL_LATENCY = 'gemini_cli.tool.call.latency';
|
|
14
|
+
const API_REQUEST_COUNT = 'gemini_cli.api.request.count';
|
|
15
|
+
const API_REQUEST_LATENCY = 'gemini_cli.api.request.latency';
|
|
16
|
+
const TOKEN_USAGE = 'gemini_cli.token.usage';
|
|
17
|
+
const SESSION_COUNT = 'gemini_cli.session.count';
|
|
18
|
+
const FILE_OPERATION_COUNT = 'gemini_cli.file.operation.count';
|
|
19
|
+
const LINES_CHANGED = 'gemini_cli.lines.changed';
|
|
20
|
+
const INVALID_CHUNK_COUNT = 'gemini_cli.chat.invalid_chunk.count';
|
|
21
|
+
const CONTENT_RETRY_COUNT = 'gemini_cli.chat.content_retry.count';
|
|
22
|
+
const CONTENT_RETRY_FAILURE_COUNT = 'gemini_cli.chat.content_retry_failure.count';
|
|
23
|
+
const MODEL_ROUTING_LATENCY = 'gemini_cli.model_routing.latency';
|
|
24
|
+
const MODEL_ROUTING_FAILURE_COUNT = 'gemini_cli.model_routing.failure.count';
|
|
25
|
+
const MODEL_SLASH_COMMAND_CALL_COUNT = 'gemini_cli.slash_command.model.call_count';
|
|
26
|
+
const EVENT_HOOK_CALL_COUNT = 'gemini_cli.hook_call.count';
|
|
27
|
+
const EVENT_HOOK_CALL_LATENCY = 'gemini_cli.hook_call.latency';
|
|
28
|
+
// Agent Metrics
|
|
29
|
+
const AGENT_RUN_COUNT = 'gemini_cli.agent.run.count';
|
|
30
|
+
const AGENT_DURATION_MS = 'gemini_cli.agent.duration';
|
|
31
|
+
const AGENT_TURNS = 'gemini_cli.agent.turns';
|
|
32
|
+
const AGENT_RECOVERY_ATTEMPT_COUNT = 'gemini_cli.agent.recovery_attempt.count';
|
|
33
|
+
const AGENT_RECOVERY_ATTEMPT_DURATION = 'gemini_cli.agent.recovery_attempt.duration';
|
|
34
|
+
// OpenTelemetry GenAI Semantic Convention Metrics
|
|
35
|
+
const GEN_AI_CLIENT_TOKEN_USAGE = 'gen_ai.client.token.usage';
|
|
36
|
+
const GEN_AI_CLIENT_OPERATION_DURATION = 'gen_ai.client.operation.duration';
|
|
37
|
+
// Performance Monitoring Metrics
|
|
38
|
+
const STARTUP_TIME = 'gemini_cli.startup.duration';
|
|
39
|
+
const MEMORY_USAGE = 'gemini_cli.memory.usage';
|
|
40
|
+
const CPU_USAGE = 'gemini_cli.cpu.usage';
|
|
41
|
+
const TOOL_QUEUE_DEPTH = 'gemini_cli.tool.queue.depth';
|
|
42
|
+
const TOOL_EXECUTION_BREAKDOWN = 'gemini_cli.tool.execution.breakdown';
|
|
43
|
+
const TOKEN_EFFICIENCY = 'gemini_cli.token.efficiency';
|
|
44
|
+
const API_REQUEST_BREAKDOWN = 'gemini_cli.api.request.breakdown';
|
|
45
|
+
const PERFORMANCE_SCORE = 'gemini_cli.performance.score';
|
|
46
|
+
const REGRESSION_DETECTION = 'gemini_cli.performance.regression';
|
|
47
|
+
const REGRESSION_PERCENTAGE_CHANGE = 'gemini_cli.performance.regression.percentage_change';
|
|
48
|
+
const BASELINE_COMPARISON = 'gemini_cli.performance.baseline.comparison';
|
|
49
|
+
const FLICKER_FRAME_COUNT = 'gemini_cli.ui.flicker.count';
|
|
50
|
+
const SLOW_RENDER_LATENCY = 'gemini_cli.ui.slow_render.latency';
|
|
51
|
+
const EXIT_FAIL_COUNT = 'gemini_cli.exit.fail.count';
|
|
52
|
+
const baseMetricDefinition = {
|
|
53
|
+
getCommonAttributes,
|
|
54
|
+
};
|
|
55
|
+
const COUNTER_DEFINITIONS = {
|
|
56
|
+
[TOOL_CALL_COUNT]: {
|
|
57
|
+
description: 'Counts tool calls, tagged by function name and success.',
|
|
58
|
+
valueType: ValueType.INT,
|
|
59
|
+
assign: (c) => (toolCallCounter = c),
|
|
60
|
+
attributes: {},
|
|
61
|
+
},
|
|
62
|
+
[API_REQUEST_COUNT]: {
|
|
63
|
+
description: 'Counts API requests, tagged by model and status.',
|
|
64
|
+
valueType: ValueType.INT,
|
|
65
|
+
assign: (c) => (apiRequestCounter = c),
|
|
66
|
+
attributes: {},
|
|
67
|
+
},
|
|
68
|
+
[TOKEN_USAGE]: {
|
|
69
|
+
description: 'Counts the total number of tokens used.',
|
|
70
|
+
valueType: ValueType.INT,
|
|
71
|
+
assign: (c) => (tokenUsageCounter = c),
|
|
72
|
+
attributes: {},
|
|
73
|
+
},
|
|
74
|
+
[SESSION_COUNT]: {
|
|
75
|
+
description: 'Count of CLI sessions started.',
|
|
76
|
+
valueType: ValueType.INT,
|
|
77
|
+
assign: (c) => (sessionCounter = c),
|
|
78
|
+
attributes: {},
|
|
79
|
+
},
|
|
80
|
+
[FILE_OPERATION_COUNT]: {
|
|
81
|
+
description: 'Counts file operations (create, read, update).',
|
|
82
|
+
valueType: ValueType.INT,
|
|
83
|
+
assign: (c) => (fileOperationCounter = c),
|
|
84
|
+
attributes: {},
|
|
85
|
+
},
|
|
86
|
+
[LINES_CHANGED]: {
|
|
87
|
+
description: 'Number of lines changed (from file diffs).',
|
|
88
|
+
valueType: ValueType.INT,
|
|
89
|
+
assign: (c) => (linesChangedCounter = c),
|
|
90
|
+
attributes: {},
|
|
91
|
+
},
|
|
92
|
+
[INVALID_CHUNK_COUNT]: {
|
|
93
|
+
description: 'Counts invalid chunks received from a stream.',
|
|
94
|
+
valueType: ValueType.INT,
|
|
95
|
+
assign: (c) => (invalidChunkCounter = c),
|
|
96
|
+
attributes: {},
|
|
97
|
+
},
|
|
98
|
+
[CONTENT_RETRY_COUNT]: {
|
|
99
|
+
description: 'Counts retries due to content errors (e.g., empty stream).',
|
|
100
|
+
valueType: ValueType.INT,
|
|
101
|
+
assign: (c) => (contentRetryCounter = c),
|
|
102
|
+
attributes: {},
|
|
103
|
+
},
|
|
104
|
+
[CONTENT_RETRY_FAILURE_COUNT]: {
|
|
105
|
+
description: 'Counts occurrences of all content retries failing.',
|
|
106
|
+
valueType: ValueType.INT,
|
|
107
|
+
assign: (c) => (contentRetryFailureCounter = c),
|
|
108
|
+
attributes: {},
|
|
109
|
+
},
|
|
110
|
+
[MODEL_ROUTING_FAILURE_COUNT]: {
|
|
111
|
+
description: 'Counts model routing failures.',
|
|
112
|
+
valueType: ValueType.INT,
|
|
113
|
+
assign: (c) => (modelRoutingFailureCounter = c),
|
|
114
|
+
attributes: {},
|
|
115
|
+
},
|
|
116
|
+
[MODEL_SLASH_COMMAND_CALL_COUNT]: {
|
|
117
|
+
description: 'Counts model slash command calls.',
|
|
118
|
+
valueType: ValueType.INT,
|
|
119
|
+
assign: (c) => (modelSlashCommandCallCounter = c),
|
|
120
|
+
attributes: {},
|
|
121
|
+
},
|
|
122
|
+
[EVENT_CHAT_COMPRESSION]: {
|
|
123
|
+
description: 'Counts chat compression events.',
|
|
124
|
+
valueType: ValueType.INT,
|
|
125
|
+
assign: (c) => (chatCompressionCounter = c),
|
|
126
|
+
attributes: {},
|
|
127
|
+
},
|
|
128
|
+
[AGENT_RUN_COUNT]: {
|
|
129
|
+
description: 'Counts agent runs, tagged by name and termination reason.',
|
|
130
|
+
valueType: ValueType.INT,
|
|
131
|
+
assign: (c) => (agentRunCounter = c),
|
|
132
|
+
attributes: {},
|
|
133
|
+
},
|
|
134
|
+
[AGENT_RECOVERY_ATTEMPT_COUNT]: {
|
|
135
|
+
description: 'Counts agent recovery attempts.',
|
|
136
|
+
valueType: ValueType.INT,
|
|
137
|
+
assign: (c) => (agentRecoveryAttemptCounter = c),
|
|
138
|
+
attributes: {},
|
|
139
|
+
},
|
|
140
|
+
[FLICKER_FRAME_COUNT]: {
|
|
141
|
+
description: 'Counts UI frames that flicker (render taller than the terminal).',
|
|
142
|
+
valueType: ValueType.INT,
|
|
143
|
+
assign: (c) => (flickerFrameCounter = c),
|
|
144
|
+
attributes: {},
|
|
145
|
+
},
|
|
146
|
+
[EXIT_FAIL_COUNT]: {
|
|
147
|
+
description: 'Counts CLI exit failures.',
|
|
148
|
+
valueType: ValueType.INT,
|
|
149
|
+
assign: (c) => (exitFailCounter = c),
|
|
150
|
+
attributes: {},
|
|
151
|
+
},
|
|
152
|
+
[EVENT_HOOK_CALL_COUNT]: {
|
|
153
|
+
description: 'Counts hook calls, tagged by hook event name and success.',
|
|
154
|
+
valueType: ValueType.INT,
|
|
155
|
+
assign: (c) => (hookCallCounter = c),
|
|
156
|
+
attributes: {},
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
const HISTOGRAM_DEFINITIONS = {
|
|
160
|
+
[TOOL_CALL_LATENCY]: {
|
|
161
|
+
description: 'Latency of tool calls in milliseconds.',
|
|
162
|
+
unit: 'ms',
|
|
163
|
+
valueType: ValueType.INT,
|
|
164
|
+
assign: (h) => (toolCallLatencyHistogram = h),
|
|
165
|
+
attributes: {},
|
|
166
|
+
},
|
|
167
|
+
[API_REQUEST_LATENCY]: {
|
|
168
|
+
description: 'Latency of API requests in milliseconds.',
|
|
169
|
+
unit: 'ms',
|
|
170
|
+
valueType: ValueType.INT,
|
|
171
|
+
assign: (h) => (apiRequestLatencyHistogram = h),
|
|
172
|
+
attributes: {},
|
|
173
|
+
},
|
|
174
|
+
[MODEL_ROUTING_LATENCY]: {
|
|
175
|
+
description: 'Latency of model routing decisions in milliseconds.',
|
|
176
|
+
unit: 'ms',
|
|
177
|
+
valueType: ValueType.INT,
|
|
178
|
+
assign: (h) => (modelRoutingLatencyHistogram = h),
|
|
179
|
+
attributes: {},
|
|
180
|
+
},
|
|
181
|
+
[AGENT_DURATION_MS]: {
|
|
182
|
+
description: 'Duration of agent runs in milliseconds.',
|
|
183
|
+
unit: 'ms',
|
|
184
|
+
valueType: ValueType.INT,
|
|
185
|
+
assign: (h) => (agentDurationHistogram = h),
|
|
186
|
+
attributes: {},
|
|
187
|
+
},
|
|
188
|
+
[SLOW_RENDER_LATENCY]: {
|
|
189
|
+
description: 'Counts UI frames that take too long to render.',
|
|
190
|
+
unit: 'ms',
|
|
191
|
+
valueType: ValueType.INT,
|
|
192
|
+
assign: (h) => (slowRenderHistogram = h),
|
|
193
|
+
attributes: {},
|
|
194
|
+
},
|
|
195
|
+
[AGENT_TURNS]: {
|
|
196
|
+
description: 'Number of turns taken by agents.',
|
|
197
|
+
unit: 'turns',
|
|
198
|
+
valueType: ValueType.INT,
|
|
199
|
+
assign: (h) => (agentTurnsHistogram = h),
|
|
200
|
+
attributes: {},
|
|
201
|
+
},
|
|
202
|
+
[AGENT_RECOVERY_ATTEMPT_DURATION]: {
|
|
203
|
+
description: 'Duration of agent recovery attempts in milliseconds.',
|
|
204
|
+
unit: 'ms',
|
|
205
|
+
valueType: ValueType.INT,
|
|
206
|
+
assign: (h) => (agentRecoveryAttemptDurationHistogram = h),
|
|
207
|
+
attributes: {},
|
|
208
|
+
},
|
|
209
|
+
[GEN_AI_CLIENT_TOKEN_USAGE]: {
|
|
210
|
+
description: 'Number of input and output tokens used.',
|
|
211
|
+
unit: 'token',
|
|
212
|
+
valueType: ValueType.INT,
|
|
213
|
+
assign: (h) => (genAiClientTokenUsageHistogram = h),
|
|
214
|
+
attributes: {},
|
|
215
|
+
},
|
|
216
|
+
[GEN_AI_CLIENT_OPERATION_DURATION]: {
|
|
217
|
+
description: 'GenAI operation duration.',
|
|
218
|
+
unit: 's',
|
|
219
|
+
valueType: ValueType.DOUBLE,
|
|
220
|
+
assign: (h) => (genAiClientOperationDurationHistogram = h),
|
|
221
|
+
attributes: {},
|
|
222
|
+
},
|
|
223
|
+
[EVENT_HOOK_CALL_LATENCY]: {
|
|
224
|
+
description: 'Latency of hook calls in milliseconds.',
|
|
225
|
+
unit: 'ms',
|
|
226
|
+
valueType: ValueType.INT,
|
|
227
|
+
assign: (c) => (hookCallLatencyHistogram = c),
|
|
228
|
+
attributes: {},
|
|
229
|
+
},
|
|
230
|
+
};
|
|
231
|
+
const PERFORMANCE_COUNTER_DEFINITIONS = {
|
|
232
|
+
[REGRESSION_DETECTION]: {
|
|
233
|
+
description: 'Performance regression detection events.',
|
|
234
|
+
valueType: ValueType.INT,
|
|
235
|
+
assign: (c) => (regressionDetectionCounter = c),
|
|
236
|
+
attributes: {},
|
|
237
|
+
},
|
|
238
|
+
};
|
|
239
|
+
const PERFORMANCE_HISTOGRAM_DEFINITIONS = {
|
|
240
|
+
[STARTUP_TIME]: {
|
|
241
|
+
description: 'CLI startup time in milliseconds, broken down by initialization phase.',
|
|
242
|
+
unit: 'ms',
|
|
243
|
+
valueType: ValueType.DOUBLE,
|
|
244
|
+
assign: (h) => (startupTimeHistogram = h),
|
|
245
|
+
attributes: {},
|
|
246
|
+
},
|
|
247
|
+
[MEMORY_USAGE]: {
|
|
248
|
+
description: 'Memory usage in bytes.',
|
|
249
|
+
unit: 'bytes',
|
|
250
|
+
valueType: ValueType.INT,
|
|
251
|
+
assign: (h) => (memoryUsageGauge = h),
|
|
252
|
+
attributes: {},
|
|
253
|
+
},
|
|
254
|
+
[CPU_USAGE]: {
|
|
255
|
+
description: 'CPU usage percentage.',
|
|
256
|
+
unit: 'percent',
|
|
257
|
+
valueType: ValueType.DOUBLE,
|
|
258
|
+
assign: (h) => (cpuUsageGauge = h),
|
|
259
|
+
attributes: {},
|
|
260
|
+
},
|
|
261
|
+
[TOOL_QUEUE_DEPTH]: {
|
|
262
|
+
description: 'Number of tools in execution queue.',
|
|
263
|
+
unit: 'count',
|
|
264
|
+
valueType: ValueType.INT,
|
|
265
|
+
assign: (h) => (toolQueueDepthGauge = h),
|
|
266
|
+
attributes: {},
|
|
267
|
+
},
|
|
268
|
+
[TOOL_EXECUTION_BREAKDOWN]: {
|
|
269
|
+
description: 'Tool execution time breakdown by phase in milliseconds.',
|
|
270
|
+
unit: 'ms',
|
|
271
|
+
valueType: ValueType.INT,
|
|
272
|
+
assign: (h) => (toolExecutionBreakdownHistogram = h),
|
|
273
|
+
attributes: {},
|
|
274
|
+
},
|
|
275
|
+
[TOKEN_EFFICIENCY]: {
|
|
276
|
+
description: 'Token efficiency metrics (tokens per operation, cache hit rate, etc.).',
|
|
277
|
+
unit: 'ratio',
|
|
278
|
+
valueType: ValueType.DOUBLE,
|
|
279
|
+
assign: (h) => (tokenEfficiencyHistogram = h),
|
|
280
|
+
attributes: {},
|
|
281
|
+
},
|
|
282
|
+
[API_REQUEST_BREAKDOWN]: {
|
|
283
|
+
description: 'API request time breakdown by phase in milliseconds.',
|
|
284
|
+
unit: 'ms',
|
|
285
|
+
valueType: ValueType.INT,
|
|
286
|
+
assign: (h) => (apiRequestBreakdownHistogram = h),
|
|
287
|
+
attributes: {},
|
|
288
|
+
},
|
|
289
|
+
[PERFORMANCE_SCORE]: {
|
|
290
|
+
description: 'Composite performance score (0-100).',
|
|
291
|
+
unit: 'score',
|
|
292
|
+
valueType: ValueType.DOUBLE,
|
|
293
|
+
assign: (h) => (performanceScoreGauge = h),
|
|
294
|
+
attributes: {},
|
|
295
|
+
},
|
|
296
|
+
[REGRESSION_PERCENTAGE_CHANGE]: {
|
|
297
|
+
description: 'Percentage change compared to baseline for detected regressions.',
|
|
298
|
+
unit: 'percent',
|
|
299
|
+
valueType: ValueType.DOUBLE,
|
|
300
|
+
assign: (h) => (regressionPercentageChangeHistogram = h),
|
|
301
|
+
attributes: {},
|
|
302
|
+
},
|
|
303
|
+
[BASELINE_COMPARISON]: {
|
|
304
|
+
description: 'Performance comparison to established baseline (percentage change).',
|
|
305
|
+
unit: 'percent',
|
|
306
|
+
valueType: ValueType.DOUBLE,
|
|
307
|
+
assign: (h) => (baselineComparisonHistogram = h),
|
|
308
|
+
attributes: {},
|
|
309
|
+
},
|
|
310
|
+
};
|
|
311
|
+
export var FileOperation;
|
|
312
|
+
(function (FileOperation) {
|
|
313
|
+
FileOperation["CREATE"] = "create";
|
|
314
|
+
FileOperation["READ"] = "read";
|
|
315
|
+
FileOperation["UPDATE"] = "update";
|
|
316
|
+
})(FileOperation || (FileOperation = {}));
|
|
317
|
+
export var PerformanceMetricType;
|
|
318
|
+
(function (PerformanceMetricType) {
|
|
319
|
+
PerformanceMetricType["STARTUP"] = "startup";
|
|
320
|
+
PerformanceMetricType["MEMORY"] = "memory";
|
|
321
|
+
PerformanceMetricType["CPU"] = "cpu";
|
|
322
|
+
PerformanceMetricType["TOOL_EXECUTION"] = "tool_execution";
|
|
323
|
+
PerformanceMetricType["API_REQUEST"] = "api_request";
|
|
324
|
+
PerformanceMetricType["TOKEN_EFFICIENCY"] = "token_efficiency";
|
|
325
|
+
})(PerformanceMetricType || (PerformanceMetricType = {}));
|
|
326
|
+
export var MemoryMetricType;
|
|
327
|
+
(function (MemoryMetricType) {
|
|
328
|
+
MemoryMetricType["HEAP_USED"] = "heap_used";
|
|
329
|
+
MemoryMetricType["HEAP_TOTAL"] = "heap_total";
|
|
330
|
+
MemoryMetricType["EXTERNAL"] = "external";
|
|
331
|
+
MemoryMetricType["RSS"] = "rss";
|
|
332
|
+
})(MemoryMetricType || (MemoryMetricType = {}));
|
|
333
|
+
export var ToolExecutionPhase;
|
|
334
|
+
(function (ToolExecutionPhase) {
|
|
335
|
+
ToolExecutionPhase["VALIDATION"] = "validation";
|
|
336
|
+
ToolExecutionPhase["PREPARATION"] = "preparation";
|
|
337
|
+
ToolExecutionPhase["EXECUTION"] = "execution";
|
|
338
|
+
ToolExecutionPhase["RESULT_PROCESSING"] = "result_processing";
|
|
339
|
+
})(ToolExecutionPhase || (ToolExecutionPhase = {}));
|
|
340
|
+
export var ApiRequestPhase;
|
|
341
|
+
(function (ApiRequestPhase) {
|
|
342
|
+
ApiRequestPhase["REQUEST_PREPARATION"] = "request_preparation";
|
|
343
|
+
ApiRequestPhase["NETWORK_LATENCY"] = "network_latency";
|
|
344
|
+
ApiRequestPhase["RESPONSE_PROCESSING"] = "response_processing";
|
|
345
|
+
ApiRequestPhase["TOKEN_PROCESSING"] = "token_processing";
|
|
346
|
+
})(ApiRequestPhase || (ApiRequestPhase = {}));
|
|
347
|
+
export var GenAiOperationName;
|
|
348
|
+
(function (GenAiOperationName) {
|
|
349
|
+
GenAiOperationName["GENERATE_CONTENT"] = "generate_content";
|
|
350
|
+
})(GenAiOperationName || (GenAiOperationName = {}));
|
|
351
|
+
export var GenAiProviderName;
|
|
352
|
+
(function (GenAiProviderName) {
|
|
353
|
+
GenAiProviderName["GCP_GEN_AI"] = "gcp.gen_ai";
|
|
354
|
+
GenAiProviderName["GCP_VERTEX_AI"] = "gcp.vertex_ai";
|
|
355
|
+
})(GenAiProviderName || (GenAiProviderName = {}));
|
|
356
|
+
export var GenAiTokenType;
|
|
357
|
+
(function (GenAiTokenType) {
|
|
358
|
+
GenAiTokenType["INPUT"] = "input";
|
|
359
|
+
GenAiTokenType["OUTPUT"] = "output";
|
|
360
|
+
})(GenAiTokenType || (GenAiTokenType = {}));
|
|
361
|
+
let cliMeter;
|
|
362
|
+
let toolCallCounter;
|
|
363
|
+
let toolCallLatencyHistogram;
|
|
364
|
+
let apiRequestCounter;
|
|
365
|
+
let apiRequestLatencyHistogram;
|
|
366
|
+
let tokenUsageCounter;
|
|
367
|
+
let sessionCounter;
|
|
368
|
+
let fileOperationCounter;
|
|
369
|
+
let linesChangedCounter;
|
|
370
|
+
let chatCompressionCounter;
|
|
371
|
+
let invalidChunkCounter;
|
|
372
|
+
let contentRetryCounter;
|
|
373
|
+
let contentRetryFailureCounter;
|
|
374
|
+
let modelRoutingLatencyHistogram;
|
|
375
|
+
let modelRoutingFailureCounter;
|
|
376
|
+
let modelSlashCommandCallCounter;
|
|
377
|
+
let agentRunCounter;
|
|
378
|
+
let agentDurationHistogram;
|
|
379
|
+
let agentTurnsHistogram;
|
|
380
|
+
let agentRecoveryAttemptCounter;
|
|
381
|
+
let agentRecoveryAttemptDurationHistogram;
|
|
382
|
+
let flickerFrameCounter;
|
|
383
|
+
let exitFailCounter;
|
|
384
|
+
let slowRenderHistogram;
|
|
385
|
+
let hookCallCounter;
|
|
386
|
+
let hookCallLatencyHistogram;
|
|
387
|
+
// OpenTelemetry GenAI Semantic Convention Metrics
|
|
388
|
+
let genAiClientTokenUsageHistogram;
|
|
389
|
+
let genAiClientOperationDurationHistogram;
|
|
390
|
+
// Performance Monitoring Metrics
|
|
391
|
+
let startupTimeHistogram;
|
|
392
|
+
let memoryUsageGauge; // Using Histogram until ObservableGauge is available
|
|
393
|
+
let cpuUsageGauge;
|
|
394
|
+
let toolQueueDepthGauge;
|
|
395
|
+
let toolExecutionBreakdownHistogram;
|
|
396
|
+
let tokenEfficiencyHistogram;
|
|
397
|
+
let apiRequestBreakdownHistogram;
|
|
398
|
+
let performanceScoreGauge;
|
|
399
|
+
let regressionDetectionCounter;
|
|
400
|
+
let regressionPercentageChangeHistogram;
|
|
401
|
+
let baselineComparisonHistogram;
|
|
402
|
+
let isMetricsInitialized = false;
|
|
403
|
+
let isPerformanceMonitoringEnabled = false;
|
|
404
|
+
export function getMeter() {
|
|
405
|
+
if (!cliMeter) {
|
|
406
|
+
cliMeter = metrics.getMeter(SERVICE_NAME);
|
|
407
|
+
}
|
|
408
|
+
return cliMeter;
|
|
409
|
+
}
|
|
410
|
+
export function initializeMetrics(config) {
|
|
411
|
+
if (isMetricsInitialized)
|
|
412
|
+
return;
|
|
413
|
+
const meter = getMeter();
|
|
414
|
+
if (!meter)
|
|
415
|
+
return;
|
|
416
|
+
// Initialize core metrics
|
|
417
|
+
Object.entries(COUNTER_DEFINITIONS).forEach(([name, { description, valueType, assign }]) => {
|
|
418
|
+
assign(meter.createCounter(name, { description, valueType }));
|
|
419
|
+
});
|
|
420
|
+
Object.entries(HISTOGRAM_DEFINITIONS).forEach(([name, { description, unit, valueType, assign }]) => {
|
|
421
|
+
assign(meter.createHistogram(name, { description, unit, valueType }));
|
|
422
|
+
});
|
|
423
|
+
// Increment session counter after all metrics are initialized
|
|
424
|
+
sessionCounter?.add(1, baseMetricDefinition.getCommonAttributes(config));
|
|
425
|
+
// Initialize performance monitoring metrics if enabled
|
|
426
|
+
initializePerformanceMonitoring(config);
|
|
427
|
+
isMetricsInitialized = true;
|
|
428
|
+
}
|
|
429
|
+
export function recordChatCompressionMetrics(config, attributes) {
|
|
430
|
+
if (!chatCompressionCounter || !isMetricsInitialized)
|
|
431
|
+
return;
|
|
432
|
+
chatCompressionCounter.add(1, {
|
|
433
|
+
...baseMetricDefinition.getCommonAttributes(config),
|
|
434
|
+
...attributes,
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
export function recordToolCallMetrics(config, durationMs, attributes) {
|
|
438
|
+
if (!toolCallCounter || !toolCallLatencyHistogram || !isMetricsInitialized)
|
|
439
|
+
return;
|
|
440
|
+
const metricAttributes = {
|
|
441
|
+
...baseMetricDefinition.getCommonAttributes(config),
|
|
442
|
+
...attributes,
|
|
443
|
+
};
|
|
444
|
+
toolCallCounter.add(1, metricAttributes);
|
|
445
|
+
toolCallLatencyHistogram.record(durationMs, {
|
|
446
|
+
...baseMetricDefinition.getCommonAttributes(config),
|
|
447
|
+
function_name: attributes.function_name,
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
export function recordCustomTokenUsageMetrics(config, tokenCount, attributes) {
|
|
451
|
+
if (!tokenUsageCounter || !isMetricsInitialized)
|
|
452
|
+
return;
|
|
453
|
+
tokenUsageCounter.add(tokenCount, {
|
|
454
|
+
...baseMetricDefinition.getCommonAttributes(config),
|
|
455
|
+
...attributes,
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
export function recordCustomApiResponseMetrics(config, durationMs, attributes) {
|
|
459
|
+
if (!apiRequestCounter ||
|
|
460
|
+
!apiRequestLatencyHistogram ||
|
|
461
|
+
!isMetricsInitialized)
|
|
462
|
+
return;
|
|
463
|
+
const metricAttributes = {
|
|
464
|
+
...baseMetricDefinition.getCommonAttributes(config),
|
|
465
|
+
model: attributes.model,
|
|
466
|
+
status_code: attributes.status_code ?? 'ok',
|
|
467
|
+
};
|
|
468
|
+
apiRequestCounter.add(1, metricAttributes);
|
|
469
|
+
apiRequestLatencyHistogram.record(durationMs, {
|
|
470
|
+
...baseMetricDefinition.getCommonAttributes(config),
|
|
471
|
+
model: attributes.model,
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
export function recordApiErrorMetrics(config, durationMs, attributes) {
|
|
475
|
+
if (!apiRequestCounter ||
|
|
476
|
+
!apiRequestLatencyHistogram ||
|
|
477
|
+
!isMetricsInitialized)
|
|
478
|
+
return;
|
|
479
|
+
const metricAttributes = {
|
|
480
|
+
...baseMetricDefinition.getCommonAttributes(config),
|
|
481
|
+
model: attributes.model,
|
|
482
|
+
status_code: attributes.status_code ?? 'error',
|
|
483
|
+
error_type: attributes.error_type ?? 'unknown',
|
|
484
|
+
};
|
|
485
|
+
apiRequestCounter.add(1, metricAttributes);
|
|
486
|
+
apiRequestLatencyHistogram.record(durationMs, {
|
|
487
|
+
...baseMetricDefinition.getCommonAttributes(config),
|
|
488
|
+
model: attributes.model,
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
export function recordFileOperationMetric(config, attributes) {
|
|
492
|
+
if (!fileOperationCounter || !isMetricsInitialized)
|
|
493
|
+
return;
|
|
494
|
+
fileOperationCounter.add(1, {
|
|
495
|
+
...baseMetricDefinition.getCommonAttributes(config),
|
|
496
|
+
...attributes,
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
export function recordLinesChanged(config, lines, changeType, attributes) {
|
|
500
|
+
if (!linesChangedCounter || !isMetricsInitialized)
|
|
501
|
+
return;
|
|
502
|
+
if (!Number.isFinite(lines) || lines <= 0)
|
|
503
|
+
return;
|
|
504
|
+
linesChangedCounter.add(lines, {
|
|
505
|
+
...baseMetricDefinition.getCommonAttributes(config),
|
|
506
|
+
type: changeType,
|
|
507
|
+
...(attributes ?? {}),
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
// --- New Metric Recording Functions ---
|
|
511
|
+
/**
|
|
512
|
+
* Records a metric for when a UI frame flickers.
|
|
513
|
+
*/
|
|
514
|
+
export function recordFlickerFrame(config) {
|
|
515
|
+
if (!flickerFrameCounter || !isMetricsInitialized)
|
|
516
|
+
return;
|
|
517
|
+
flickerFrameCounter.add(1, baseMetricDefinition.getCommonAttributes(config));
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* Records a metric for when user failed to exit
|
|
521
|
+
*/
|
|
522
|
+
export function recordExitFail(config) {
|
|
523
|
+
if (!exitFailCounter || !isMetricsInitialized)
|
|
524
|
+
return;
|
|
525
|
+
exitFailCounter.add(1, baseMetricDefinition.getCommonAttributes(config));
|
|
526
|
+
}
|
|
527
|
+
/**
|
|
528
|
+
* Records a metric for when a UI frame is slow in rendering
|
|
529
|
+
*/
|
|
530
|
+
export function recordSlowRender(config, renderLatency) {
|
|
531
|
+
if (!slowRenderHistogram || !isMetricsInitialized)
|
|
532
|
+
return;
|
|
533
|
+
slowRenderHistogram.record(renderLatency, {
|
|
534
|
+
...baseMetricDefinition.getCommonAttributes(config),
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Records a metric for when an invalid chunk is received from a stream.
|
|
539
|
+
*/
|
|
540
|
+
export function recordInvalidChunk(config) {
|
|
541
|
+
if (!invalidChunkCounter || !isMetricsInitialized)
|
|
542
|
+
return;
|
|
543
|
+
invalidChunkCounter.add(1, baseMetricDefinition.getCommonAttributes(config));
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* Records a metric for when a retry is triggered due to a content error.
|
|
547
|
+
*/
|
|
548
|
+
export function recordContentRetry(config) {
|
|
549
|
+
if (!contentRetryCounter || !isMetricsInitialized)
|
|
550
|
+
return;
|
|
551
|
+
contentRetryCounter.add(1, baseMetricDefinition.getCommonAttributes(config));
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* Records a metric for when all content error retries have failed for a request.
|
|
555
|
+
*/
|
|
556
|
+
export function recordContentRetryFailure(config) {
|
|
557
|
+
if (!contentRetryFailureCounter || !isMetricsInitialized)
|
|
558
|
+
return;
|
|
559
|
+
contentRetryFailureCounter.add(1, baseMetricDefinition.getCommonAttributes(config));
|
|
560
|
+
}
|
|
561
|
+
export function recordModelSlashCommand(config, event) {
|
|
562
|
+
if (!modelSlashCommandCallCounter || !isMetricsInitialized)
|
|
563
|
+
return;
|
|
564
|
+
modelSlashCommandCallCounter.add(1, {
|
|
565
|
+
...baseMetricDefinition.getCommonAttributes(config),
|
|
566
|
+
'slash_command.model.model_name': event.model_name,
|
|
567
|
+
});
|
|
568
|
+
}
|
|
569
|
+
export function recordModelRoutingMetrics(config, event) {
|
|
570
|
+
if (!modelRoutingLatencyHistogram ||
|
|
571
|
+
!modelRoutingFailureCounter ||
|
|
572
|
+
!isMetricsInitialized)
|
|
573
|
+
return;
|
|
574
|
+
const attributes = {
|
|
575
|
+
...baseMetricDefinition.getCommonAttributes(config),
|
|
576
|
+
'routing.decision_model': event.decision_model,
|
|
577
|
+
'routing.decision_source': event.decision_source,
|
|
578
|
+
'routing.failed': event.failed,
|
|
579
|
+
};
|
|
580
|
+
if (event.reasoning) {
|
|
581
|
+
attributes['routing.reasoning'] = event.reasoning;
|
|
582
|
+
}
|
|
583
|
+
if (event.enable_numerical_routing !== undefined) {
|
|
584
|
+
attributes['routing.enable_numerical_routing'] =
|
|
585
|
+
event.enable_numerical_routing;
|
|
586
|
+
}
|
|
587
|
+
if (event.classifier_threshold) {
|
|
588
|
+
attributes['routing.classifier_threshold'] = event.classifier_threshold;
|
|
589
|
+
}
|
|
590
|
+
modelRoutingLatencyHistogram.record(event.routing_latency_ms, attributes);
|
|
591
|
+
if (event.failed) {
|
|
592
|
+
modelRoutingFailureCounter.add(1, {
|
|
593
|
+
...attributes,
|
|
594
|
+
'routing.error_message': event.error_message,
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
export function recordAgentRunMetrics(config, event) {
|
|
599
|
+
if (!agentRunCounter ||
|
|
600
|
+
!agentDurationHistogram ||
|
|
601
|
+
!agentTurnsHistogram ||
|
|
602
|
+
!isMetricsInitialized)
|
|
603
|
+
return;
|
|
604
|
+
const commonAttributes = baseMetricDefinition.getCommonAttributes(config);
|
|
605
|
+
agentRunCounter.add(1, {
|
|
606
|
+
...commonAttributes,
|
|
607
|
+
agent_name: event.agent_name,
|
|
608
|
+
terminate_reason: event.terminate_reason,
|
|
609
|
+
});
|
|
610
|
+
agentDurationHistogram.record(event.duration_ms, {
|
|
611
|
+
...commonAttributes,
|
|
612
|
+
agent_name: event.agent_name,
|
|
613
|
+
});
|
|
614
|
+
agentTurnsHistogram.record(event.turn_count, {
|
|
615
|
+
...commonAttributes,
|
|
616
|
+
agent_name: event.agent_name,
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
export function recordRecoveryAttemptMetrics(config, event) {
|
|
620
|
+
if (!agentRecoveryAttemptCounter ||
|
|
621
|
+
!agentRecoveryAttemptDurationHistogram ||
|
|
622
|
+
!isMetricsInitialized)
|
|
623
|
+
return;
|
|
624
|
+
const commonAttributes = baseMetricDefinition.getCommonAttributes(config);
|
|
625
|
+
agentRecoveryAttemptCounter.add(1, {
|
|
626
|
+
...commonAttributes,
|
|
627
|
+
agent_name: event.agent_name,
|
|
628
|
+
reason: event.reason,
|
|
629
|
+
success: event.success,
|
|
630
|
+
});
|
|
631
|
+
agentRecoveryAttemptDurationHistogram.record(event.duration_ms, {
|
|
632
|
+
...commonAttributes,
|
|
633
|
+
agent_name: event.agent_name,
|
|
634
|
+
});
|
|
635
|
+
}
|
|
636
|
+
// OpenTelemetry GenAI Semantic Convention Recording Functions
|
|
637
|
+
export function recordGenAiClientTokenUsage(config, tokenCount, attributes) {
|
|
638
|
+
if (!genAiClientTokenUsageHistogram || !isMetricsInitialized)
|
|
639
|
+
return;
|
|
640
|
+
const metricAttributes = {
|
|
641
|
+
...baseMetricDefinition.getCommonAttributes(config),
|
|
642
|
+
...attributes,
|
|
643
|
+
};
|
|
644
|
+
genAiClientTokenUsageHistogram.record(tokenCount, metricAttributes);
|
|
645
|
+
}
|
|
646
|
+
export function recordGenAiClientOperationDuration(config, durationSeconds, attributes) {
|
|
647
|
+
if (!genAiClientOperationDurationHistogram || !isMetricsInitialized)
|
|
648
|
+
return;
|
|
649
|
+
const metricAttributes = {
|
|
650
|
+
...baseMetricDefinition.getCommonAttributes(config),
|
|
651
|
+
...attributes,
|
|
652
|
+
};
|
|
653
|
+
genAiClientOperationDurationHistogram.record(durationSeconds, metricAttributes);
|
|
654
|
+
}
|
|
655
|
+
export function getConventionAttributes(event) {
|
|
656
|
+
const operationName = getGenAiOperationName();
|
|
657
|
+
const provider = getGenAiProvider(event.auth_type);
|
|
658
|
+
return {
|
|
659
|
+
'gen_ai.operation.name': operationName,
|
|
660
|
+
'gen_ai.provider.name': provider,
|
|
661
|
+
'gen_ai.request.model': event.model,
|
|
662
|
+
'gen_ai.response.model': event.model,
|
|
663
|
+
};
|
|
664
|
+
}
|
|
665
|
+
/**
|
|
666
|
+
* Maps authentication type to GenAI provider name following OpenTelemetry conventions
|
|
667
|
+
*/
|
|
668
|
+
function getGenAiProvider(authType) {
|
|
669
|
+
switch (authType) {
|
|
670
|
+
case AuthType.USE_VERTEX_AI:
|
|
671
|
+
case AuthType.COMPUTE_ADC:
|
|
672
|
+
case AuthType.LOGIN_WITH_GOOGLE:
|
|
673
|
+
return GenAiProviderName.GCP_VERTEX_AI;
|
|
674
|
+
case AuthType.USE_GEMINI:
|
|
675
|
+
default:
|
|
676
|
+
return GenAiProviderName.GCP_GEN_AI;
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
function getGenAiOperationName() {
|
|
680
|
+
return GenAiOperationName.GENERATE_CONTENT;
|
|
681
|
+
}
|
|
682
|
+
// Performance Monitoring Functions
|
|
683
|
+
export function initializePerformanceMonitoring(config) {
|
|
684
|
+
const meter = getMeter();
|
|
685
|
+
if (!meter)
|
|
686
|
+
return;
|
|
687
|
+
// Check if performance monitoring is enabled in config
|
|
688
|
+
// For now, enable performance monitoring when telemetry is enabled
|
|
689
|
+
// TODO: Add specific performance monitoring settings to config
|
|
690
|
+
isPerformanceMonitoringEnabled = config.getTelemetryEnabled();
|
|
691
|
+
if (!isPerformanceMonitoringEnabled)
|
|
692
|
+
return;
|
|
693
|
+
Object.entries(PERFORMANCE_COUNTER_DEFINITIONS).forEach(([name, { description, valueType, assign }]) => {
|
|
694
|
+
assign(meter.createCounter(name, { description, valueType }));
|
|
695
|
+
});
|
|
696
|
+
Object.entries(PERFORMANCE_HISTOGRAM_DEFINITIONS).forEach(([name, { description, unit, valueType, assign }]) => {
|
|
697
|
+
assign(meter.createHistogram(name, { description, unit, valueType }));
|
|
698
|
+
});
|
|
699
|
+
}
|
|
700
|
+
export function recordStartupPerformance(config, durationMs, attributes) {
|
|
701
|
+
if (!startupTimeHistogram || !isPerformanceMonitoringEnabled)
|
|
702
|
+
return;
|
|
703
|
+
const metricAttributes = {
|
|
704
|
+
...baseMetricDefinition.getCommonAttributes(config),
|
|
705
|
+
phase: attributes.phase,
|
|
706
|
+
...attributes.details,
|
|
707
|
+
};
|
|
708
|
+
startupTimeHistogram.record(durationMs, metricAttributes);
|
|
709
|
+
}
|
|
710
|
+
export function recordMemoryUsage(config, bytes, attributes) {
|
|
711
|
+
if (!memoryUsageGauge || !isPerformanceMonitoringEnabled)
|
|
712
|
+
return;
|
|
713
|
+
const metricAttributes = {
|
|
714
|
+
...baseMetricDefinition.getCommonAttributes(config),
|
|
715
|
+
...attributes,
|
|
716
|
+
};
|
|
717
|
+
memoryUsageGauge.record(bytes, metricAttributes);
|
|
718
|
+
}
|
|
719
|
+
export function recordCpuUsage(config, percentage, attributes) {
|
|
720
|
+
if (!cpuUsageGauge || !isPerformanceMonitoringEnabled)
|
|
721
|
+
return;
|
|
722
|
+
const metricAttributes = {
|
|
723
|
+
...baseMetricDefinition.getCommonAttributes(config),
|
|
724
|
+
...attributes,
|
|
725
|
+
};
|
|
726
|
+
cpuUsageGauge.record(percentage, metricAttributes);
|
|
727
|
+
}
|
|
728
|
+
export function recordToolQueueDepth(config, queueDepth) {
|
|
729
|
+
if (!toolQueueDepthGauge || !isPerformanceMonitoringEnabled)
|
|
730
|
+
return;
|
|
731
|
+
const attributes = {
|
|
732
|
+
...baseMetricDefinition.getCommonAttributes(config),
|
|
733
|
+
};
|
|
734
|
+
toolQueueDepthGauge.record(queueDepth, attributes);
|
|
735
|
+
}
|
|
736
|
+
export function recordToolExecutionBreakdown(config, durationMs, attributes) {
|
|
737
|
+
if (!toolExecutionBreakdownHistogram || !isPerformanceMonitoringEnabled)
|
|
738
|
+
return;
|
|
739
|
+
const metricAttributes = {
|
|
740
|
+
...baseMetricDefinition.getCommonAttributes(config),
|
|
741
|
+
...attributes,
|
|
742
|
+
};
|
|
743
|
+
toolExecutionBreakdownHistogram.record(durationMs, metricAttributes);
|
|
744
|
+
}
|
|
745
|
+
export function recordTokenEfficiency(config, value, attributes) {
|
|
746
|
+
if (!tokenEfficiencyHistogram || !isPerformanceMonitoringEnabled)
|
|
747
|
+
return;
|
|
748
|
+
const metricAttributes = {
|
|
749
|
+
...baseMetricDefinition.getCommonAttributes(config),
|
|
750
|
+
...attributes,
|
|
751
|
+
};
|
|
752
|
+
tokenEfficiencyHistogram.record(value, metricAttributes);
|
|
753
|
+
}
|
|
754
|
+
export function recordApiRequestBreakdown(config, durationMs, attributes) {
|
|
755
|
+
if (!apiRequestBreakdownHistogram || !isPerformanceMonitoringEnabled)
|
|
756
|
+
return;
|
|
757
|
+
const metricAttributes = {
|
|
758
|
+
...baseMetricDefinition.getCommonAttributes(config),
|
|
759
|
+
...attributes,
|
|
760
|
+
};
|
|
761
|
+
apiRequestBreakdownHistogram.record(durationMs, metricAttributes);
|
|
762
|
+
}
|
|
763
|
+
export function recordPerformanceScore(config, score, attributes) {
|
|
764
|
+
if (!performanceScoreGauge || !isPerformanceMonitoringEnabled)
|
|
765
|
+
return;
|
|
766
|
+
const metricAttributes = {
|
|
767
|
+
...baseMetricDefinition.getCommonAttributes(config),
|
|
768
|
+
...attributes,
|
|
769
|
+
};
|
|
770
|
+
performanceScoreGauge.record(score, metricAttributes);
|
|
771
|
+
}
|
|
772
|
+
export function recordPerformanceRegression(config, attributes) {
|
|
773
|
+
if (!regressionDetectionCounter || !isPerformanceMonitoringEnabled)
|
|
774
|
+
return;
|
|
775
|
+
const metricAttributes = {
|
|
776
|
+
...baseMetricDefinition.getCommonAttributes(config),
|
|
777
|
+
...attributes,
|
|
778
|
+
};
|
|
779
|
+
regressionDetectionCounter.add(1, metricAttributes);
|
|
780
|
+
if (attributes.baseline_value !== 0 && regressionPercentageChangeHistogram) {
|
|
781
|
+
const percentageChange = ((attributes.current_value - attributes.baseline_value) /
|
|
782
|
+
attributes.baseline_value) *
|
|
783
|
+
100;
|
|
784
|
+
regressionPercentageChangeHistogram.record(percentageChange, metricAttributes);
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
export function recordBaselineComparison(config, attributes) {
|
|
788
|
+
if (!baselineComparisonHistogram || !isPerformanceMonitoringEnabled)
|
|
789
|
+
return;
|
|
790
|
+
if (attributes.baseline_value === 0) {
|
|
791
|
+
diag.warn('Baseline value is zero, skipping comparison.');
|
|
792
|
+
return;
|
|
793
|
+
}
|
|
794
|
+
const percentageChange = ((attributes.current_value - attributes.baseline_value) /
|
|
795
|
+
attributes.baseline_value) *
|
|
796
|
+
100;
|
|
797
|
+
const metricAttributes = {
|
|
798
|
+
...baseMetricDefinition.getCommonAttributes(config),
|
|
799
|
+
...attributes,
|
|
800
|
+
};
|
|
801
|
+
baselineComparisonHistogram.record(percentageChange, metricAttributes);
|
|
802
|
+
}
|
|
803
|
+
// Utility function to check if performance monitoring is enabled
|
|
804
|
+
export function isPerformanceMonitoringActive() {
|
|
805
|
+
return isPerformanceMonitoringEnabled && isMetricsInitialized;
|
|
806
|
+
}
|
|
807
|
+
/**
|
|
808
|
+
* Token usage recording that emits both custom and convention metrics.
|
|
809
|
+
*/
|
|
810
|
+
export function recordTokenUsageMetrics(config, tokenCount, attributes) {
|
|
811
|
+
recordCustomTokenUsageMetrics(config, tokenCount, {
|
|
812
|
+
model: attributes.model,
|
|
813
|
+
type: attributes.type,
|
|
814
|
+
});
|
|
815
|
+
if ((attributes.type === 'input' || attributes.type === 'output') &&
|
|
816
|
+
attributes.genAiAttributes) {
|
|
817
|
+
recordGenAiClientTokenUsage(config, tokenCount, {
|
|
818
|
+
...attributes.genAiAttributes,
|
|
819
|
+
'gen_ai.token.type': attributes.type,
|
|
820
|
+
});
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
/**
|
|
824
|
+
* Operation latency recording that emits both custom and convention metrics.
|
|
825
|
+
*/
|
|
826
|
+
export function recordApiResponseMetrics(config, durationMs, attributes) {
|
|
827
|
+
recordCustomApiResponseMetrics(config, durationMs, {
|
|
828
|
+
model: attributes.model,
|
|
829
|
+
status_code: attributes.status_code,
|
|
830
|
+
});
|
|
831
|
+
if (attributes.genAiAttributes) {
|
|
832
|
+
const durationSeconds = durationMs / 1000;
|
|
833
|
+
recordGenAiClientOperationDuration(config, durationSeconds, {
|
|
834
|
+
...attributes.genAiAttributes,
|
|
835
|
+
});
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
export function recordHookCallMetrics(config, hookEventName, hookName, durationMs, success) {
|
|
839
|
+
if (!hookCallCounter || !hookCallLatencyHistogram || !isMetricsInitialized)
|
|
840
|
+
return;
|
|
841
|
+
// Always sanitize hook names in metrics (metrics are aggregated and exposed)
|
|
842
|
+
const sanitizedHookName = sanitizeHookName(hookName);
|
|
843
|
+
const metricAttributes = {
|
|
844
|
+
...baseMetricDefinition.getCommonAttributes(config),
|
|
845
|
+
hook_event_name: hookEventName,
|
|
846
|
+
hook_name: sanitizedHookName,
|
|
847
|
+
success,
|
|
848
|
+
};
|
|
849
|
+
hookCallCounter.add(1, metricAttributes);
|
|
850
|
+
hookCallLatencyHistogram.record(durationMs, metricAttributes);
|
|
851
|
+
}
|
|
852
|
+
//# sourceMappingURL=metrics.js.map
|